Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

Commit

Permalink
Beginning of UI state change support
Browse files Browse the repository at this point in the history
  • Loading branch information
amber-vale committed Jul 6, 2021
1 parent a21ef8b commit 9eea59f
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions bs-jsonform.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,9 @@ class BS4_JsonForm {
inputClasses: "mb-2"
},
{ // Feedback
muted: "text-muted"
muted: "text-muted",
invalid: "is-invalid",
valid: "is-valid"
},
{ // Control
submitBtnClasses: "btn btn-primary w-100 mb-n2 mt-2"
Expand All @@ -405,7 +407,9 @@ class BS4_JsonForm {
inputClasses: "mb-1"
},
{ // Feedback
muted: "text-muted"
muted: "text-muted",
invalid: "is-invalid",
valid: "is-valid"
},
{ // Control
submitBtnClasses: "btn btn-primary w-100 mb-n3 mt-1"
Expand Down Expand Up @@ -434,7 +438,7 @@ class BS4_JsonForm {

// Determine what template to use
let template = `<div class="${theme.fieldClasses.wrapperClasses} col-${colSize}">`;
let sublabel;
let sublabel = "";
switch (fieldPayload.type) {
// Text elements
case "text":
Expand Down Expand Up @@ -583,6 +587,13 @@ class BS4_JsonForm {

// Handles a field status changing (disabled, valid, invalid, etc)
_fieldOnStatusChange(formInstance, fieldPayload, statusPayload) {
const formId = formInstance.id
const fieldId = `${formId}-${fieldPayload.id}`
const fieldIdAsElem = document.getElementById(fieldId)
const config = fieldPayload.config

this._debugMsg(`Changing status on field '${fieldName}' from form '${formInstance}' with payload: `, statusPayload)


}

Expand Down

0 comments on commit 9eea59f

Please sign in to comment.