@3t-transform/threeteeui 0.2.112 → 0.2.113

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,7 +14,7 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["tttx-data-pattern.cjs",[[1,"tttx-data-pattern",{"data":[1],"sorteroptions":[1],"filteroptions":[1],"filterheader":[1]}]]],["tttx-multiselect-box.cjs",[[1,"tttx-multiselect-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"htmlVisibleValue":[4,"html-visible-value"],"visibleValue":[1,"visible-value"],"open":[32],"unsavedSelectedItems":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-dialog-box.cjs",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"allowOverflow":[4,"allow-overflow"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-select-box.cjs",[[1,"tttx-select-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"selectedValue":[1,"selected-value"],"open":[32],"selectedItem":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-tree-view.cjs",[[1,"tttx-tree-view",{"data":[1040],"firstSelected":[1028,"first-selected"],"treeData":[32],"selectedId":[32]}]]],["tttx-checkbox.cjs",[[0,"tttx-checkbox",{"checkboxId":[1,"checkbox-id"],"label":[1],"inline":[4],"indeterminate":[4],"checked":[4]}]]],["tttx-dialog.cjs",[[1,"tttx-dialog",{"header":[1],"type":[1],"size":[1],"open":[4],"allowOverflow":[4,"allow-overflow"],"closeEnabled":[4,"close-enabled"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-expander.cjs",[[1,"tttx-expander",{"name":[1],"open":[4],"lefticon":[1],"lefticoncolor":[1],"isExpanded":[32]}]]],["tttx-tabs.cjs",[[2,"tttx-tabs",{"tabsName":[1,"tabs-name"],"navigation":[4],"wide":[4],"tabs":[1],"_tabs":[32]},[[0,"keydown","handleKeyDown"]]]]],["tttx-checkbox-group.cjs",[[1,"tttx-checkbox-group"]]],["tttx-checkbox-group-caption.cjs",[[4,"tttx-checkbox-group-caption"]]],["tttx-checkbox-group-heading.cjs",[[4,"tttx-checkbox-group-heading"]]],["tttx-form.cjs",[[1,"tttx-form",{"formschema":[1025],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block.cjs",[[1,"tttx-keyvalue-block",{"keyvalues":[1],"horizontal":[4],"spacedout":[4],"_elements":[32]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-percentage-bar.cjs",[[2,"tttx-percentage-bar",{"percentage":[8],"thresholds":[1],"color":[1],"min":[1],"labelid":[1],"_percentage":[32],"_ranges":[32],"_min":[32]}]]],["tttx-qrcode.cjs",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag.cjs",[[1,"tttx-tag",{"text":[1],"color":[1],"textColor":[1,"text-color"]}]]],["tttx-textarea.cjs",[[2,"tttx-textarea",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"rows":[2],"textareaautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"disabled":[4],"maxlength":[8],"name":[1],"placeholder":[1],"readonly":[8],"required":[4],"value":[1032]}]]],["tttx-icon.cjs",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]],["tttx-standalone-input.cjs",[[2,"tttx-standalone-input",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"iconleft":[1],"iconleftcolor":[1],"iconright":[1],"iconrightcolor":[1],"inputicon":[1],"inputiconcolor":[1],"inline":[4],"inputautocapitalize":[1],"inputautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"autocomplete":[1],"checked":[4],"disabled":[4],"max":[8],"maxlength":[8],"min":[8],"minlength":[8],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[8],"required":[4],"step":[8],"type":[1],"value":[1032]}]]],["tttx-filter_4.cjs",[[1,"tttx-filter",{"filterKey":[1,"filter-key"],"filterOptions":[1,"filter-options"],"showSelectAll":[4,"show-select-all"],"showSearchField":[4,"show-search-field"],"showOptionIcons":[4,"show-option-icons"],"filterButtonStyle":[1,"filter-button-style"],"filterHeader":[1,"filter-header"],"defaultFilterOptions":[1,"default-filter-options"],"popoverWidth":[1,"popover-width"],"showPopover":[32],"displayedFilterSettings":[32],"selectedFilters":[32],"filterSearchTerm":[32],"allSelected":[32]},[[0,"closeFilter","handleCloseFilter"]]],[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32]}],[1,"tttx-sorter",{"sorterKey":[1,"sorter-key"],"defaultSortDirection":[1,"default-sort-direction"],"fieldOptionsData":[1,"field-options-data"],"defaultOption":[1,"default-option"],"selectedField":[32],"sortDirection":[32],"dropdownExpand":[32],"dropdownOptions":[32]},[[0,"closeSorter","handleCloseSorter"]]],[1,"tttx-toolbar",{"border":[4],"viewSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-button.cjs",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
17
+ return index.bootstrapLazy([["tttx-data-pattern.cjs",[[1,"tttx-data-pattern",{"data":[1],"sorteroptions":[1],"filteroptions":[1],"filterheader":[1]}]]],["tttx-multiselect-box.cjs",[[1,"tttx-multiselect-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"htmlVisibleValue":[4,"html-visible-value"],"visibleValue":[1,"visible-value"],"open":[32],"unsavedSelectedItems":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-dialog-box.cjs",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"allowOverflow":[4,"allow-overflow"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-select-box.cjs",[[1,"tttx-select-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"selectedValue":[1,"selected-value"],"open":[32],"selectedItem":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-tree-view.cjs",[[1,"tttx-tree-view",{"data":[1040],"firstSelected":[1028,"first-selected"],"treeData":[32],"selectedId":[32]}]]],["tttx-checkbox.cjs",[[0,"tttx-checkbox",{"checkboxId":[1,"checkbox-id"],"label":[1],"inline":[4],"indeterminate":[4],"checked":[4]}]]],["tttx-dialog.cjs",[[1,"tttx-dialog",{"header":[1],"type":[1],"size":[1],"open":[4],"allowOverflow":[4,"allow-overflow"],"closeEnabled":[4,"close-enabled"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-expander.cjs",[[1,"tttx-expander",{"name":[1],"open":[4],"lefticon":[1],"lefticoncolor":[1],"isExpanded":[32]}]]],["tttx-tabs.cjs",[[2,"tttx-tabs",{"tabsName":[1,"tabs-name"],"navigation":[4],"wide":[4],"tabs":[1],"_tabs":[32]},[[0,"keydown","handleKeyDown"]]]]],["tttx-checkbox-group.cjs",[[1,"tttx-checkbox-group"]]],["tttx-checkbox-group-caption.cjs",[[4,"tttx-checkbox-group-caption"]]],["tttx-checkbox-group-heading.cjs",[[4,"tttx-checkbox-group-heading"]]],["tttx-form.cjs",[[1,"tttx-form",{"formschema":[1025],"data":[1032],"submit":[64],"setSelectOptions":[64]}]]],["tttx-keyvalue-block.cjs",[[1,"tttx-keyvalue-block",{"keyvalues":[1],"horizontal":[4],"spacedout":[4],"_elements":[32]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-percentage-bar.cjs",[[2,"tttx-percentage-bar",{"percentage":[8],"thresholds":[1],"color":[1],"min":[1],"labelid":[1],"_percentage":[32],"_ranges":[32],"_min":[32]}]]],["tttx-qrcode.cjs",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag.cjs",[[1,"tttx-tag",{"text":[1],"color":[1],"textColor":[1,"text-color"]}]]],["tttx-textarea.cjs",[[2,"tttx-textarea",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"rows":[2],"textareaautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"disabled":[4],"maxlength":[8],"name":[1],"placeholder":[1],"readonly":[8],"required":[4],"value":[1032]}]]],["tttx-icon.cjs",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]],["tttx-standalone-input.cjs",[[2,"tttx-standalone-input",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"iconleft":[1],"iconleftcolor":[1],"iconright":[1],"iconrightcolor":[1],"inputicon":[1],"inputiconcolor":[1],"inline":[4],"inputautocapitalize":[1],"inputautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"autocomplete":[1],"checked":[4],"disabled":[4],"max":[8],"maxlength":[8],"min":[8],"minlength":[8],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[8],"required":[4],"step":[8],"type":[1],"value":[1032]}]]],["tttx-filter_4.cjs",[[1,"tttx-filter",{"filterKey":[1,"filter-key"],"filterOptions":[1,"filter-options"],"showSelectAll":[4,"show-select-all"],"showSearchField":[4,"show-search-field"],"showOptionIcons":[4,"show-option-icons"],"filterButtonStyle":[1,"filter-button-style"],"filterHeader":[1,"filter-header"],"defaultFilterOptions":[1,"default-filter-options"],"popoverWidth":[1,"popover-width"],"showPopover":[32],"displayedFilterSettings":[32],"selectedFilters":[32],"filterSearchTerm":[32],"allSelected":[32]},[[0,"closeFilter","handleCloseFilter"]]],[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32]}],[1,"tttx-sorter",{"sorterKey":[1,"sorter-key"],"defaultSortDirection":[1,"default-sort-direction"],"fieldOptionsData":[1,"field-options-data"],"defaultOption":[1,"default-option"],"selectedField":[32],"sortDirection":[32],"dropdownExpand":[32],"dropdownOptions":[32]},[[0,"closeSorter","handleCloseSorter"]]],[1,"tttx-toolbar",{"border":[4],"viewSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-button.cjs",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -187,6 +187,23 @@ const TttxForm = class {
187
187
  async submit() {
188
188
  this.submitButton.click();
189
189
  }
190
+ /**
191
+ * Replace all children in a given select list with a list of new options
192
+ * @param { string } fieldname the form name of the given field
193
+ * @param { {label: string, value: string}[] } options a list of option values and labels
194
+ */
195
+ async setSelectOptions(fieldname, options) {
196
+ const select = this.fieldset.querySelector(`[name=${fieldname}]`);
197
+ select.innerHTML = '';
198
+ const fragment = new DocumentFragment();
199
+ for (const option of options) {
200
+ const o = document.createElement('option');
201
+ o.innerText = option.label;
202
+ o.value = option.value;
203
+ fragment.appendChild(o);
204
+ }
205
+ select.appendChild(fragment);
206
+ }
190
207
  /**
191
208
  * Submits the form data to the server.
192
209
  *
@@ -17,7 +17,7 @@ const patchBrowser = () => {
17
17
  };
18
18
 
19
19
  patchBrowser().then(options => {
20
- return index.bootstrapLazy([["tttx-data-pattern.cjs",[[1,"tttx-data-pattern",{"data":[1],"sorteroptions":[1],"filteroptions":[1],"filterheader":[1]}]]],["tttx-multiselect-box.cjs",[[1,"tttx-multiselect-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"htmlVisibleValue":[4,"html-visible-value"],"visibleValue":[1,"visible-value"],"open":[32],"unsavedSelectedItems":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-dialog-box.cjs",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"allowOverflow":[4,"allow-overflow"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-select-box.cjs",[[1,"tttx-select-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"selectedValue":[1,"selected-value"],"open":[32],"selectedItem":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-tree-view.cjs",[[1,"tttx-tree-view",{"data":[1040],"firstSelected":[1028,"first-selected"],"treeData":[32],"selectedId":[32]}]]],["tttx-checkbox.cjs",[[0,"tttx-checkbox",{"checkboxId":[1,"checkbox-id"],"label":[1],"inline":[4],"indeterminate":[4],"checked":[4]}]]],["tttx-dialog.cjs",[[1,"tttx-dialog",{"header":[1],"type":[1],"size":[1],"open":[4],"allowOverflow":[4,"allow-overflow"],"closeEnabled":[4,"close-enabled"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-expander.cjs",[[1,"tttx-expander",{"name":[1],"open":[4],"lefticon":[1],"lefticoncolor":[1],"isExpanded":[32]}]]],["tttx-tabs.cjs",[[2,"tttx-tabs",{"tabsName":[1,"tabs-name"],"navigation":[4],"wide":[4],"tabs":[1],"_tabs":[32]},[[0,"keydown","handleKeyDown"]]]]],["tttx-checkbox-group.cjs",[[1,"tttx-checkbox-group"]]],["tttx-checkbox-group-caption.cjs",[[4,"tttx-checkbox-group-caption"]]],["tttx-checkbox-group-heading.cjs",[[4,"tttx-checkbox-group-heading"]]],["tttx-form.cjs",[[1,"tttx-form",{"formschema":[1025],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block.cjs",[[1,"tttx-keyvalue-block",{"keyvalues":[1],"horizontal":[4],"spacedout":[4],"_elements":[32]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-percentage-bar.cjs",[[2,"tttx-percentage-bar",{"percentage":[8],"thresholds":[1],"color":[1],"min":[1],"labelid":[1],"_percentage":[32],"_ranges":[32],"_min":[32]}]]],["tttx-qrcode.cjs",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag.cjs",[[1,"tttx-tag",{"text":[1],"color":[1],"textColor":[1,"text-color"]}]]],["tttx-textarea.cjs",[[2,"tttx-textarea",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"rows":[2],"textareaautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"disabled":[4],"maxlength":[8],"name":[1],"placeholder":[1],"readonly":[8],"required":[4],"value":[1032]}]]],["tttx-icon.cjs",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]],["tttx-standalone-input.cjs",[[2,"tttx-standalone-input",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"iconleft":[1],"iconleftcolor":[1],"iconright":[1],"iconrightcolor":[1],"inputicon":[1],"inputiconcolor":[1],"inline":[4],"inputautocapitalize":[1],"inputautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"autocomplete":[1],"checked":[4],"disabled":[4],"max":[8],"maxlength":[8],"min":[8],"minlength":[8],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[8],"required":[4],"step":[8],"type":[1],"value":[1032]}]]],["tttx-filter_4.cjs",[[1,"tttx-filter",{"filterKey":[1,"filter-key"],"filterOptions":[1,"filter-options"],"showSelectAll":[4,"show-select-all"],"showSearchField":[4,"show-search-field"],"showOptionIcons":[4,"show-option-icons"],"filterButtonStyle":[1,"filter-button-style"],"filterHeader":[1,"filter-header"],"defaultFilterOptions":[1,"default-filter-options"],"popoverWidth":[1,"popover-width"],"showPopover":[32],"displayedFilterSettings":[32],"selectedFilters":[32],"filterSearchTerm":[32],"allSelected":[32]},[[0,"closeFilter","handleCloseFilter"]]],[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32]}],[1,"tttx-sorter",{"sorterKey":[1,"sorter-key"],"defaultSortDirection":[1,"default-sort-direction"],"fieldOptionsData":[1,"field-options-data"],"defaultOption":[1,"default-option"],"selectedField":[32],"sortDirection":[32],"dropdownExpand":[32],"dropdownOptions":[32]},[[0,"closeSorter","handleCloseSorter"]]],[1,"tttx-toolbar",{"border":[4],"viewSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-button.cjs",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
20
+ return index.bootstrapLazy([["tttx-data-pattern.cjs",[[1,"tttx-data-pattern",{"data":[1],"sorteroptions":[1],"filteroptions":[1],"filterheader":[1]}]]],["tttx-multiselect-box.cjs",[[1,"tttx-multiselect-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"htmlVisibleValue":[4,"html-visible-value"],"visibleValue":[1,"visible-value"],"open":[32],"unsavedSelectedItems":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-dialog-box.cjs",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"allowOverflow":[4,"allow-overflow"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-select-box.cjs",[[1,"tttx-select-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"selectedValue":[1,"selected-value"],"open":[32],"selectedItem":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-tree-view.cjs",[[1,"tttx-tree-view",{"data":[1040],"firstSelected":[1028,"first-selected"],"treeData":[32],"selectedId":[32]}]]],["tttx-checkbox.cjs",[[0,"tttx-checkbox",{"checkboxId":[1,"checkbox-id"],"label":[1],"inline":[4],"indeterminate":[4],"checked":[4]}]]],["tttx-dialog.cjs",[[1,"tttx-dialog",{"header":[1],"type":[1],"size":[1],"open":[4],"allowOverflow":[4,"allow-overflow"],"closeEnabled":[4,"close-enabled"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-expander.cjs",[[1,"tttx-expander",{"name":[1],"open":[4],"lefticon":[1],"lefticoncolor":[1],"isExpanded":[32]}]]],["tttx-tabs.cjs",[[2,"tttx-tabs",{"tabsName":[1,"tabs-name"],"navigation":[4],"wide":[4],"tabs":[1],"_tabs":[32]},[[0,"keydown","handleKeyDown"]]]]],["tttx-checkbox-group.cjs",[[1,"tttx-checkbox-group"]]],["tttx-checkbox-group-caption.cjs",[[4,"tttx-checkbox-group-caption"]]],["tttx-checkbox-group-heading.cjs",[[4,"tttx-checkbox-group-heading"]]],["tttx-form.cjs",[[1,"tttx-form",{"formschema":[1025],"data":[1032],"submit":[64],"setSelectOptions":[64]}]]],["tttx-keyvalue-block.cjs",[[1,"tttx-keyvalue-block",{"keyvalues":[1],"horizontal":[4],"spacedout":[4],"_elements":[32]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-percentage-bar.cjs",[[2,"tttx-percentage-bar",{"percentage":[8],"thresholds":[1],"color":[1],"min":[1],"labelid":[1],"_percentage":[32],"_ranges":[32],"_min":[32]}]]],["tttx-qrcode.cjs",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag.cjs",[[1,"tttx-tag",{"text":[1],"color":[1],"textColor":[1,"text-color"]}]]],["tttx-textarea.cjs",[[2,"tttx-textarea",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"rows":[2],"textareaautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"disabled":[4],"maxlength":[8],"name":[1],"placeholder":[1],"readonly":[8],"required":[4],"value":[1032]}]]],["tttx-icon.cjs",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]],["tttx-standalone-input.cjs",[[2,"tttx-standalone-input",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"iconleft":[1],"iconleftcolor":[1],"iconright":[1],"iconrightcolor":[1],"inputicon":[1],"inputiconcolor":[1],"inline":[4],"inputautocapitalize":[1],"inputautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"autocomplete":[1],"checked":[4],"disabled":[4],"max":[8],"maxlength":[8],"min":[8],"minlength":[8],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[8],"required":[4],"step":[8],"type":[1],"value":[1032]}]]],["tttx-filter_4.cjs",[[1,"tttx-filter",{"filterKey":[1,"filter-key"],"filterOptions":[1,"filter-options"],"showSelectAll":[4,"show-select-all"],"showSearchField":[4,"show-search-field"],"showOptionIcons":[4,"show-option-icons"],"filterButtonStyle":[1,"filter-button-style"],"filterHeader":[1,"filter-header"],"defaultFilterOptions":[1,"default-filter-options"],"popoverWidth":[1,"popover-width"],"showPopover":[32],"displayedFilterSettings":[32],"selectedFilters":[32],"filterSearchTerm":[32],"allSelected":[32]},[[0,"closeFilter","handleCloseFilter"]]],[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32]}],[1,"tttx-sorter",{"sorterKey":[1,"sorter-key"],"defaultSortDirection":[1,"default-sort-direction"],"fieldOptionsData":[1,"field-options-data"],"defaultOption":[1,"default-option"],"selectedField":[32],"sortDirection":[32],"dropdownExpand":[32],"dropdownOptions":[32]},[[0,"closeSorter","handleCloseSorter"]]],[1,"tttx-toolbar",{"border":[4],"viewSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-button.cjs",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
21
21
  });
22
22
 
23
23
  exports.setNonce = index.setNonce;
@@ -57,6 +57,23 @@ export class TttxForm {
57
57
  async submit() {
58
58
  this.submitButton.click();
59
59
  }
60
+ /**
61
+ * Replace all children in a given select list with a list of new options
62
+ * @param { string } fieldname the form name of the given field
63
+ * @param { {label: string, value: string}[] } options a list of option values and labels
64
+ */
65
+ async setSelectOptions(fieldname, options) {
66
+ const select = this.fieldset.querySelector(`[name=${fieldname}]`);
67
+ select.innerHTML = '';
68
+ const fragment = new DocumentFragment();
69
+ for (const option of options) {
70
+ const o = document.createElement('option');
71
+ o.innerText = option.label;
72
+ o.value = option.value;
73
+ fragment.appendChild(o);
74
+ }
75
+ select.appendChild(fragment);
76
+ }
60
77
  /**
61
78
  * Submits the form data to the server.
62
79
  *
@@ -734,6 +751,40 @@ export class TttxForm {
734
751
  "text": "",
735
752
  "tags": []
736
753
  }
754
+ },
755
+ "setSelectOptions": {
756
+ "complexType": {
757
+ "signature": "(fieldname: string, options: { label: string; value: string; }[]) => Promise<void>",
758
+ "parameters": [{
759
+ "tags": [{
760
+ "name": "param",
761
+ "text": "fieldname the form name of the given field"
762
+ }],
763
+ "text": "the form name of the given field"
764
+ }, {
765
+ "tags": [{
766
+ "name": "param",
767
+ "text": "options a list of option values and labels"
768
+ }],
769
+ "text": "a list of option values and labels"
770
+ }],
771
+ "references": {
772
+ "Promise": {
773
+ "location": "global"
774
+ }
775
+ },
776
+ "return": "Promise<void>"
777
+ },
778
+ "docs": {
779
+ "text": "Replace all children in a given select list with a list of new options",
780
+ "tags": [{
781
+ "name": "param",
782
+ "text": "fieldname the form name of the given field"
783
+ }, {
784
+ "name": "param",
785
+ "text": "options a list of option values and labels"
786
+ }]
787
+ }
737
788
  }
738
789
  };
739
790
  }
@@ -184,6 +184,23 @@ const TttxForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
184
184
  async submit() {
185
185
  this.submitButton.click();
186
186
  }
187
+ /**
188
+ * Replace all children in a given select list with a list of new options
189
+ * @param { string } fieldname the form name of the given field
190
+ * @param { {label: string, value: string}[] } options a list of option values and labels
191
+ */
192
+ async setSelectOptions(fieldname, options) {
193
+ const select = this.fieldset.querySelector(`[name=${fieldname}]`);
194
+ select.innerHTML = '';
195
+ const fragment = new DocumentFragment();
196
+ for (const option of options) {
197
+ const o = document.createElement('option');
198
+ o.innerText = option.label;
199
+ o.value = option.value;
200
+ fragment.appendChild(o);
201
+ }
202
+ select.appendChild(fragment);
203
+ }
187
204
  /**
188
205
  * Submits the form data to the server.
189
206
  *
@@ -761,7 +778,8 @@ const TttxForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
761
778
  }, [1, "tttx-form", {
762
779
  "formschema": [1025],
763
780
  "data": [1032],
764
- "submit": [64]
781
+ "submit": [64],
782
+ "setSelectOptions": [64]
765
783
  }]);
766
784
  function defineCustomElement$1() {
767
785
  if (typeof customElements === "undefined") {
@@ -11,7 +11,7 @@ const patchEsm = () => {
11
11
  const defineCustomElements = (win, options) => {
12
12
  if (typeof window === 'undefined') return Promise.resolve();
13
13
  return patchEsm().then(() => {
14
- return bootstrapLazy([["tttx-data-pattern",[[1,"tttx-data-pattern",{"data":[1],"sorteroptions":[1],"filteroptions":[1],"filterheader":[1]}]]],["tttx-multiselect-box",[[1,"tttx-multiselect-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"htmlVisibleValue":[4,"html-visible-value"],"visibleValue":[1,"visible-value"],"open":[32],"unsavedSelectedItems":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-dialog-box",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"allowOverflow":[4,"allow-overflow"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-select-box",[[1,"tttx-select-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"selectedValue":[1,"selected-value"],"open":[32],"selectedItem":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-tree-view",[[1,"tttx-tree-view",{"data":[1040],"firstSelected":[1028,"first-selected"],"treeData":[32],"selectedId":[32]}]]],["tttx-checkbox",[[0,"tttx-checkbox",{"checkboxId":[1,"checkbox-id"],"label":[1],"inline":[4],"indeterminate":[4],"checked":[4]}]]],["tttx-dialog",[[1,"tttx-dialog",{"header":[1],"type":[1],"size":[1],"open":[4],"allowOverflow":[4,"allow-overflow"],"closeEnabled":[4,"close-enabled"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-expander",[[1,"tttx-expander",{"name":[1],"open":[4],"lefticon":[1],"lefticoncolor":[1],"isExpanded":[32]}]]],["tttx-tabs",[[2,"tttx-tabs",{"tabsName":[1,"tabs-name"],"navigation":[4],"wide":[4],"tabs":[1],"_tabs":[32]},[[0,"keydown","handleKeyDown"]]]]],["tttx-checkbox-group",[[1,"tttx-checkbox-group"]]],["tttx-checkbox-group-caption",[[4,"tttx-checkbox-group-caption"]]],["tttx-checkbox-group-heading",[[4,"tttx-checkbox-group-heading"]]],["tttx-form",[[1,"tttx-form",{"formschema":[1025],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block",[[1,"tttx-keyvalue-block",{"keyvalues":[1],"horizontal":[4],"spacedout":[4],"_elements":[32]}]]],["tttx-loading-spinner",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-percentage-bar",[[2,"tttx-percentage-bar",{"percentage":[8],"thresholds":[1],"color":[1],"min":[1],"labelid":[1],"_percentage":[32],"_ranges":[32],"_min":[32]}]]],["tttx-qrcode",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag",[[1,"tttx-tag",{"text":[1],"color":[1],"textColor":[1,"text-color"]}]]],["tttx-textarea",[[2,"tttx-textarea",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"rows":[2],"textareaautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"disabled":[4],"maxlength":[8],"name":[1],"placeholder":[1],"readonly":[8],"required":[4],"value":[1032]}]]],["tttx-icon",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]],["tttx-standalone-input",[[2,"tttx-standalone-input",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"iconleft":[1],"iconleftcolor":[1],"iconright":[1],"iconrightcolor":[1],"inputicon":[1],"inputiconcolor":[1],"inline":[4],"inputautocapitalize":[1],"inputautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"autocomplete":[1],"checked":[4],"disabled":[4],"max":[8],"maxlength":[8],"min":[8],"minlength":[8],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[8],"required":[4],"step":[8],"type":[1],"value":[1032]}]]],["tttx-filter_4",[[1,"tttx-filter",{"filterKey":[1,"filter-key"],"filterOptions":[1,"filter-options"],"showSelectAll":[4,"show-select-all"],"showSearchField":[4,"show-search-field"],"showOptionIcons":[4,"show-option-icons"],"filterButtonStyle":[1,"filter-button-style"],"filterHeader":[1,"filter-header"],"defaultFilterOptions":[1,"default-filter-options"],"popoverWidth":[1,"popover-width"],"showPopover":[32],"displayedFilterSettings":[32],"selectedFilters":[32],"filterSearchTerm":[32],"allSelected":[32]},[[0,"closeFilter","handleCloseFilter"]]],[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32]}],[1,"tttx-sorter",{"sorterKey":[1,"sorter-key"],"defaultSortDirection":[1,"default-sort-direction"],"fieldOptionsData":[1,"field-options-data"],"defaultOption":[1,"default-option"],"selectedField":[32],"sortDirection":[32],"dropdownExpand":[32],"dropdownOptions":[32]},[[0,"closeSorter","handleCloseSorter"]]],[1,"tttx-toolbar",{"border":[4],"viewSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-button",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
14
+ return bootstrapLazy([["tttx-data-pattern",[[1,"tttx-data-pattern",{"data":[1],"sorteroptions":[1],"filteroptions":[1],"filterheader":[1]}]]],["tttx-multiselect-box",[[1,"tttx-multiselect-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"htmlVisibleValue":[4,"html-visible-value"],"visibleValue":[1,"visible-value"],"open":[32],"unsavedSelectedItems":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-dialog-box",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"allowOverflow":[4,"allow-overflow"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-select-box",[[1,"tttx-select-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"selectedValue":[1,"selected-value"],"open":[32],"selectedItem":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-tree-view",[[1,"tttx-tree-view",{"data":[1040],"firstSelected":[1028,"first-selected"],"treeData":[32],"selectedId":[32]}]]],["tttx-checkbox",[[0,"tttx-checkbox",{"checkboxId":[1,"checkbox-id"],"label":[1],"inline":[4],"indeterminate":[4],"checked":[4]}]]],["tttx-dialog",[[1,"tttx-dialog",{"header":[1],"type":[1],"size":[1],"open":[4],"allowOverflow":[4,"allow-overflow"],"closeEnabled":[4,"close-enabled"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-expander",[[1,"tttx-expander",{"name":[1],"open":[4],"lefticon":[1],"lefticoncolor":[1],"isExpanded":[32]}]]],["tttx-tabs",[[2,"tttx-tabs",{"tabsName":[1,"tabs-name"],"navigation":[4],"wide":[4],"tabs":[1],"_tabs":[32]},[[0,"keydown","handleKeyDown"]]]]],["tttx-checkbox-group",[[1,"tttx-checkbox-group"]]],["tttx-checkbox-group-caption",[[4,"tttx-checkbox-group-caption"]]],["tttx-checkbox-group-heading",[[4,"tttx-checkbox-group-heading"]]],["tttx-form",[[1,"tttx-form",{"formschema":[1025],"data":[1032],"submit":[64],"setSelectOptions":[64]}]]],["tttx-keyvalue-block",[[1,"tttx-keyvalue-block",{"keyvalues":[1],"horizontal":[4],"spacedout":[4],"_elements":[32]}]]],["tttx-loading-spinner",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-percentage-bar",[[2,"tttx-percentage-bar",{"percentage":[8],"thresholds":[1],"color":[1],"min":[1],"labelid":[1],"_percentage":[32],"_ranges":[32],"_min":[32]}]]],["tttx-qrcode",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag",[[1,"tttx-tag",{"text":[1],"color":[1],"textColor":[1,"text-color"]}]]],["tttx-textarea",[[2,"tttx-textarea",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"rows":[2],"textareaautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"disabled":[4],"maxlength":[8],"name":[1],"placeholder":[1],"readonly":[8],"required":[4],"value":[1032]}]]],["tttx-icon",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]],["tttx-standalone-input",[[2,"tttx-standalone-input",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"iconleft":[1],"iconleftcolor":[1],"iconright":[1],"iconrightcolor":[1],"inputicon":[1],"inputiconcolor":[1],"inline":[4],"inputautocapitalize":[1],"inputautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"autocomplete":[1],"checked":[4],"disabled":[4],"max":[8],"maxlength":[8],"min":[8],"minlength":[8],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[8],"required":[4],"step":[8],"type":[1],"value":[1032]}]]],["tttx-filter_4",[[1,"tttx-filter",{"filterKey":[1,"filter-key"],"filterOptions":[1,"filter-options"],"showSelectAll":[4,"show-select-all"],"showSearchField":[4,"show-search-field"],"showOptionIcons":[4,"show-option-icons"],"filterButtonStyle":[1,"filter-button-style"],"filterHeader":[1,"filter-header"],"defaultFilterOptions":[1,"default-filter-options"],"popoverWidth":[1,"popover-width"],"showPopover":[32],"displayedFilterSettings":[32],"selectedFilters":[32],"filterSearchTerm":[32],"allSelected":[32]},[[0,"closeFilter","handleCloseFilter"]]],[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32]}],[1,"tttx-sorter",{"sorterKey":[1,"sorter-key"],"defaultSortDirection":[1,"default-sort-direction"],"fieldOptionsData":[1,"field-options-data"],"defaultOption":[1,"default-option"],"selectedField":[32],"sortDirection":[32],"dropdownExpand":[32],"dropdownOptions":[32]},[[0,"closeSorter","handleCloseSorter"]]],[1,"tttx-toolbar",{"border":[4],"viewSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-button",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
15
15
  });
16
16
  };
17
17
 
@@ -183,6 +183,23 @@ const TttxForm = class {
183
183
  async submit() {
184
184
  this.submitButton.click();
185
185
  }
186
+ /**
187
+ * Replace all children in a given select list with a list of new options
188
+ * @param { string } fieldname the form name of the given field
189
+ * @param { {label: string, value: string}[] } options a list of option values and labels
190
+ */
191
+ async setSelectOptions(fieldname, options) {
192
+ const select = this.fieldset.querySelector(`[name=${fieldname}]`);
193
+ select.innerHTML = '';
194
+ const fragment = new DocumentFragment();
195
+ for (const option of options) {
196
+ const o = document.createElement('option');
197
+ o.innerText = option.label;
198
+ o.value = option.value;
199
+ fragment.appendChild(o);
200
+ }
201
+ select.appendChild(fragment);
202
+ }
186
203
  /**
187
204
  * Submits the form data to the server.
188
205
  *
package/dist/esm/tttx.js CHANGED
@@ -14,5 +14,5 @@ const patchBrowser = () => {
14
14
  };
15
15
 
16
16
  patchBrowser().then(options => {
17
- return bootstrapLazy([["tttx-data-pattern",[[1,"tttx-data-pattern",{"data":[1],"sorteroptions":[1],"filteroptions":[1],"filterheader":[1]}]]],["tttx-multiselect-box",[[1,"tttx-multiselect-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"htmlVisibleValue":[4,"html-visible-value"],"visibleValue":[1,"visible-value"],"open":[32],"unsavedSelectedItems":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-dialog-box",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"allowOverflow":[4,"allow-overflow"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-select-box",[[1,"tttx-select-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"selectedValue":[1,"selected-value"],"open":[32],"selectedItem":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-tree-view",[[1,"tttx-tree-view",{"data":[1040],"firstSelected":[1028,"first-selected"],"treeData":[32],"selectedId":[32]}]]],["tttx-checkbox",[[0,"tttx-checkbox",{"checkboxId":[1,"checkbox-id"],"label":[1],"inline":[4],"indeterminate":[4],"checked":[4]}]]],["tttx-dialog",[[1,"tttx-dialog",{"header":[1],"type":[1],"size":[1],"open":[4],"allowOverflow":[4,"allow-overflow"],"closeEnabled":[4,"close-enabled"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-expander",[[1,"tttx-expander",{"name":[1],"open":[4],"lefticon":[1],"lefticoncolor":[1],"isExpanded":[32]}]]],["tttx-tabs",[[2,"tttx-tabs",{"tabsName":[1,"tabs-name"],"navigation":[4],"wide":[4],"tabs":[1],"_tabs":[32]},[[0,"keydown","handleKeyDown"]]]]],["tttx-checkbox-group",[[1,"tttx-checkbox-group"]]],["tttx-checkbox-group-caption",[[4,"tttx-checkbox-group-caption"]]],["tttx-checkbox-group-heading",[[4,"tttx-checkbox-group-heading"]]],["tttx-form",[[1,"tttx-form",{"formschema":[1025],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block",[[1,"tttx-keyvalue-block",{"keyvalues":[1],"horizontal":[4],"spacedout":[4],"_elements":[32]}]]],["tttx-loading-spinner",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-percentage-bar",[[2,"tttx-percentage-bar",{"percentage":[8],"thresholds":[1],"color":[1],"min":[1],"labelid":[1],"_percentage":[32],"_ranges":[32],"_min":[32]}]]],["tttx-qrcode",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag",[[1,"tttx-tag",{"text":[1],"color":[1],"textColor":[1,"text-color"]}]]],["tttx-textarea",[[2,"tttx-textarea",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"rows":[2],"textareaautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"disabled":[4],"maxlength":[8],"name":[1],"placeholder":[1],"readonly":[8],"required":[4],"value":[1032]}]]],["tttx-icon",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]],["tttx-standalone-input",[[2,"tttx-standalone-input",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"iconleft":[1],"iconleftcolor":[1],"iconright":[1],"iconrightcolor":[1],"inputicon":[1],"inputiconcolor":[1],"inline":[4],"inputautocapitalize":[1],"inputautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"autocomplete":[1],"checked":[4],"disabled":[4],"max":[8],"maxlength":[8],"min":[8],"minlength":[8],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[8],"required":[4],"step":[8],"type":[1],"value":[1032]}]]],["tttx-filter_4",[[1,"tttx-filter",{"filterKey":[1,"filter-key"],"filterOptions":[1,"filter-options"],"showSelectAll":[4,"show-select-all"],"showSearchField":[4,"show-search-field"],"showOptionIcons":[4,"show-option-icons"],"filterButtonStyle":[1,"filter-button-style"],"filterHeader":[1,"filter-header"],"defaultFilterOptions":[1,"default-filter-options"],"popoverWidth":[1,"popover-width"],"showPopover":[32],"displayedFilterSettings":[32],"selectedFilters":[32],"filterSearchTerm":[32],"allSelected":[32]},[[0,"closeFilter","handleCloseFilter"]]],[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32]}],[1,"tttx-sorter",{"sorterKey":[1,"sorter-key"],"defaultSortDirection":[1,"default-sort-direction"],"fieldOptionsData":[1,"field-options-data"],"defaultOption":[1,"default-option"],"selectedField":[32],"sortDirection":[32],"dropdownExpand":[32],"dropdownOptions":[32]},[[0,"closeSorter","handleCloseSorter"]]],[1,"tttx-toolbar",{"border":[4],"viewSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-button",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
17
+ return bootstrapLazy([["tttx-data-pattern",[[1,"tttx-data-pattern",{"data":[1],"sorteroptions":[1],"filteroptions":[1],"filterheader":[1]}]]],["tttx-multiselect-box",[[1,"tttx-multiselect-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"htmlVisibleValue":[4,"html-visible-value"],"visibleValue":[1,"visible-value"],"open":[32],"unsavedSelectedItems":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-dialog-box",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"allowOverflow":[4,"allow-overflow"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-select-box",[[1,"tttx-select-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"selectedValue":[1,"selected-value"],"open":[32],"selectedItem":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-tree-view",[[1,"tttx-tree-view",{"data":[1040],"firstSelected":[1028,"first-selected"],"treeData":[32],"selectedId":[32]}]]],["tttx-checkbox",[[0,"tttx-checkbox",{"checkboxId":[1,"checkbox-id"],"label":[1],"inline":[4],"indeterminate":[4],"checked":[4]}]]],["tttx-dialog",[[1,"tttx-dialog",{"header":[1],"type":[1],"size":[1],"open":[4],"allowOverflow":[4,"allow-overflow"],"closeEnabled":[4,"close-enabled"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-expander",[[1,"tttx-expander",{"name":[1],"open":[4],"lefticon":[1],"lefticoncolor":[1],"isExpanded":[32]}]]],["tttx-tabs",[[2,"tttx-tabs",{"tabsName":[1,"tabs-name"],"navigation":[4],"wide":[4],"tabs":[1],"_tabs":[32]},[[0,"keydown","handleKeyDown"]]]]],["tttx-checkbox-group",[[1,"tttx-checkbox-group"]]],["tttx-checkbox-group-caption",[[4,"tttx-checkbox-group-caption"]]],["tttx-checkbox-group-heading",[[4,"tttx-checkbox-group-heading"]]],["tttx-form",[[1,"tttx-form",{"formschema":[1025],"data":[1032],"submit":[64],"setSelectOptions":[64]}]]],["tttx-keyvalue-block",[[1,"tttx-keyvalue-block",{"keyvalues":[1],"horizontal":[4],"spacedout":[4],"_elements":[32]}]]],["tttx-loading-spinner",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-percentage-bar",[[2,"tttx-percentage-bar",{"percentage":[8],"thresholds":[1],"color":[1],"min":[1],"labelid":[1],"_percentage":[32],"_ranges":[32],"_min":[32]}]]],["tttx-qrcode",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag",[[1,"tttx-tag",{"text":[1],"color":[1],"textColor":[1,"text-color"]}]]],["tttx-textarea",[[2,"tttx-textarea",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"rows":[2],"textareaautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"disabled":[4],"maxlength":[8],"name":[1],"placeholder":[1],"readonly":[8],"required":[4],"value":[1032]}]]],["tttx-icon",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]],["tttx-standalone-input",[[2,"tttx-standalone-input",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"iconleft":[1],"iconleftcolor":[1],"iconright":[1],"iconrightcolor":[1],"inputicon":[1],"inputiconcolor":[1],"inline":[4],"inputautocapitalize":[1],"inputautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"autocomplete":[1],"checked":[4],"disabled":[4],"max":[8],"maxlength":[8],"min":[8],"minlength":[8],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[8],"required":[4],"step":[8],"type":[1],"value":[1032]}]]],["tttx-filter_4",[[1,"tttx-filter",{"filterKey":[1,"filter-key"],"filterOptions":[1,"filter-options"],"showSelectAll":[4,"show-select-all"],"showSearchField":[4,"show-search-field"],"showOptionIcons":[4,"show-option-icons"],"filterButtonStyle":[1,"filter-button-style"],"filterHeader":[1,"filter-header"],"defaultFilterOptions":[1,"default-filter-options"],"popoverWidth":[1,"popover-width"],"showPopover":[32],"displayedFilterSettings":[32],"selectedFilters":[32],"filterSearchTerm":[32],"allSelected":[32]},[[0,"closeFilter","handleCloseFilter"]]],[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32]}],[1,"tttx-sorter",{"sorterKey":[1,"sorter-key"],"defaultSortDirection":[1,"default-sort-direction"],"fieldOptionsData":[1,"field-options-data"],"defaultOption":[1,"default-option"],"selectedField":[32],"sortDirection":[32],"dropdownExpand":[32],"dropdownOptions":[32]},[[0,"closeSorter","handleCloseSorter"]]],[1,"tttx-toolbar",{"border":[4],"viewSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-button",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
18
18
  });
@@ -0,0 +1 @@
1
+ import{r as e,c as t,h as o,H as i}from"./p-65bb4035.js";import{p as n,d as r}from"./p-88ee2406.js";import"./p-112455b1.js";function a(e,t,o,i){let n;if(n=void 0!==i?i.querySelector(".errorBubble"):"label"===e.parentElement.nodeName.toLowerCase()?e.parentElement.querySelector(".errorBubble"):e.parentElement.parentElement.querySelector(".errorBubble"),n)if(t){e.classList.add("invalid"),n.classList.add("visible");const t=document.createElement("span");t.className="material-symbols-rounded",t.textContent="warning",n.innerHTML="",n.append(t),n.append(o)}else n.classList.remove("visible"),e.classList.remove("invalid"),n.innerHTML=""}const l=class{constructor(o){e(this,o),this.dataSubmitted=t(this,"dataSubmitted",7),this.dataChanged=t(this,"dataChanged",7),this.template=document.createElement("template"),this.formschema=void 0,this.data=void 0}onFormSchemaChange(e){if(!this.data&&this.form&&this._formSchema){const e=new FormData(this.form);this._data=Object.fromEntries(Object.keys(this._formSchema.properties).map((t=>[t,e.get(t)])))}this._formSchema="string"==typeof e?JSON.parse(e):e}onDataChange(e){this._data="string"==typeof e?JSON.parse(e):e}fieldChanged(e){this.dataChanged.emit({name:e.target.name,value:e.target.value})}async submit(){this.submitButton.click()}async setSelectOptions(e,t){const o=this.fieldset.querySelector(`[name=${e}]`);o.innerHTML="";const i=new DocumentFragment;for(const e of t){const t=document.createElement("option");t.innerText=e.label,t.value=e.value,i.appendChild(t)}o.appendChild(i)}doSubmit(e){e.preventDefault();const t=new FormData(e.target),o=this._formSchema.properties;for(const e of Object.keys(o))"checkbox"!==o[e].form.type||t.has(e)||t.append(e,"off");this.dataSubmitted.emit(t)}componentWillLoad(){this.onFormSchemaChange(this.formschema),this.data&&this.onDataChange(this.data)}componentWillRender(){this.template=document.createElement("template"),this.populateFormFromSchema()}createSelect(e,t){var o;const i=document.createElement("select");return i.setAttribute("name",e),t.options.forEach((e=>{this.appendOption(i,e)})),(null===(o=this._data)||void 0===o?void 0:o[e])&&i.classList.remove("placeholder"),i}appendOption(e,t){const o=document.createElement("option");o.setAttribute("value",t.value),t.placeholder&&(o.setAttribute("disabled",""),o.setAttribute("selected",""),o.setAttribute("hidden",""),e.classList.add("placeholder")),t.label&&(o.innerHTML=n.sanitize(t.label,r)),e.appendChild(o)}createInput(e,t){var o;const i=document.createElement("input");return i.type=t.type,i.name=e,i.placeholder=null!==(o=t.placeholder)&&void 0!==o?o:"",i.autocomplete="off",i.autocapitalize="off",t.readonly&&(i.readOnly=!0),i}createTextArea(e,t){var o;const i=document.createElement("textarea");return i.name=e,i.placeholder=null!==(o=t.placeholder)&&void 0!==o?o:"",i.autocomplete="off",i.autocapitalize="off",t.readonly&&(i.readOnly=!0),i}createStartEndDateComponent(e,t){const o=document.createElement("input"),i=document.createElement("input");let n,r;o.type=i.type="date",o.name=`${e}-startdate`,i.name=`${e}-enddate`,o.setAttribute("data-formkey",e),i.setAttribute("data-formkey",e),t.readonly&&(o.readOnly=!0,i.readOnly=!0),this.applyValidation(o,{required:{message:"Please enter a start date"},dateCompare:{to:i.name}}),this.applyValidation(i,{required:{message:"Please enter an end date"},dateCompare:{with:o.name,message:"End date cannot be before the start date"}}),t.includeTime&&(n=document.createElement("input"),r=document.createElement("input"),n.type=r.type="time",n.name=`${e}-starttime`,r.name=`${e}-endtime`,n.setAttribute("data-formkey",e),r.setAttribute("data-formkey",e),t.readonly&&(n.readOnly=!0,r.readOnly=!0),this.applyValidation(n,{required:{message:"Please enter a start time"}}),this.applyValidation(r,{required:{message:"Please enter an end time"}}));const a=document.createElement("label");a.innerText="Start date";const l=document.createElement("label");l.innerText="End date";const s=document.createElement("div"),d=document.createElement("div");return s.className=d.className="outer-container inputBlock",a.className=l.className="flex-label",s.append(o),n&&s.append(n),a.append(s),a.append(this.createErrorBubble()),d.append(i),r&&d.append(r),l.append(d),l.append(this.createErrorBubble()),{start:a,end:l}}applyValidation(e,t){var o,i;t.required&&(e.setAttribute("required",""),e.setAttribute("data-required",null!==(o=t.required.message)&&void 0!==o?o:"")),t.pattern&&(e.setAttribute("pattern",t.pattern.pattern),e.setAttribute("data-pattern",null!==(i=t.pattern.message)&&void 0!==i?i:"")),t.badInput&&e.setAttribute("data-badinput",t.badInput.message),t.minmax&&(e.setAttribute("min",t.minmax.min),e.setAttribute("max",t.minmax.max),e.setAttribute("data-range",t.minmax.message)),t.maxlength&&e.setAttribute("maxlength",t.maxlength),t.dateCompare&&(t.dateCompare.message&&t.dateCompare.with&&(e.setAttribute("data-compare",t.dateCompare.message),e.setAttribute("data-compare-with",t.dateCompare.with)),t.dateCompare.to&&e.setAttribute("data-compare-to",t.dateCompare.to))}createErrorBubble(){const e=document.createElement("div");return e.className="errorBubble",e}appendCheckboxInput(e,t,o){if(e.label){const e=document.createElement("br");o.appendChild(e)}if(o.appendChild(t),!e.inlineLabel)return;const i=document.createElement("span");i.className="inlineLabel",i.textContent=e.inlineLabel,o.appendChild(i)}createLabel(e,t,o){var i;const n=document.createElement("div");let r="outer-container inputBlock";const a=document.createElement("label");if(a.innerText=e.label,!(null===(i=e.validation)||void 0===i?void 0:i.required)&&e.label){const e=document.createElement("span");e.className="optional",e.innerHTML="&nbsp;(optional)",a.appendChild(e)}return"radio"===e.type&&(r+=" radioBlock"),n.className=r,e.readonly&&a.classList.add("readonly"),"checkbox"===e.type?this.appendCheckboxInput(e,t,a):n.appendChild(t),"checkbox"!==e.type&&a.appendChild(n),a.appendChild(o),a}createRadio(e,t){var o,i;const n=new DocumentFragment;for(const r of t.options){const a=document.createElement("input");a.type="radio",a.name=e,a.value=r.value,(null===(o=null==t?void 0:t.validation)||void 0===o?void 0:o.required)&&(a.setAttribute("required","required"),a.setAttribute("data-required",null!==(i=t.validation.required.message)&&void 0!==i?i:""));const l=document.createElement("span");l.innerText=r.label,n.appendChild(a),n.appendChild(l),n.appendChild(document.createElement("br"))}return n}populateFormFromSchema(){var e;if(!this._formSchema)return;const t=this._formSchema.properties,o=Object.keys(t);for(const i of o){const o=t[i].form;if("startenddate"===o.type){const{start:e,end:t}=this.createStartEndDateComponent(i,o);this.template.content.append(e),this.template.content.append(t);continue}let n;switch(o.type){case"select":n=this.createSelect(i,o);break;case"radio":n=this.createRadio(i,o);break;case"textarea":n=this.createTextArea(i,o);break;default:n=this.createInput(i,o)}o.validation&&"radio"!==o.type&&this.applyValidation(n,o.validation);const r=this.createErrorBubble(),l=this.createLabel(o,n,r);if(null===(e=o.validation)||void 0===e?void 0:e.invalid){const e=o.validation.invalid.message;n.setCustomValidity(e),a(n,!0,e)}this.template.content.append(l)}}componentDidRender(){if(!this._formSchema)return;const e=this.template.content.cloneNode(!0),t=this._formSchema.properties,o=Object.keys(t);for(const i of o){const o=e.querySelectorAll(`[name^=${i}]`);for(const e of o)e.oninvalid=this.validityCheckWrapper.bind(this),e.onblur=this.validityCheckWrapper.bind(this),e.onkeyup=this.fieldChanged.bind(this),e.onchange=this.fieldChanged.bind(this),"select"===t[i].form.type&&e.classList.contains("placeholder")&&e.addEventListener("change",(()=>{e.classList.remove("placeholder")})),"startenddate"===t[i].form.type&&e.hasAttribute("data-compare-with")&&(e.oninvalid=this.endDateComparisonValidator.bind(this),e.onblur=this.endDateComparisonValidator.bind(this)),"startenddate"===t[i].form.type&&"time"===e.type&&(e.oninvalid=this.startEndTimeComparitor.bind(this),e.onblur=this.startEndTimeComparitor.bind(this)),"startenddate"===t[i].form.type&&e.hasAttribute("data-compare-to")&&(e.oninvalid=this.startDateComparisonValidator.bind(this),e.onblur=this.startDateComparisonValidator.bind(this))}if(this._data&&Object.keys(this._data).length>0){const t=Object.keys(this._data);for(const o of t){const t=e.querySelectorAll(`[name=${o}]`);for(const e of t)switch(e.type){case"checkbox":"on"===this._data[o]&&(e.checked=!0);break;case"radio":e.value===this._data[o]&&(e.checked=!0);break;default:e.value=this._data[o]}}}this.fieldset.replaceChildren(e)}startEndTimeComparitor(e){var t,o;const i=e.target,n=i.getAttribute("data-formkey"),r=Array.from(i.parentElement.parentElement.parentElement.querySelectorAll(`[data-formkey=${n}]`));if(4===r.length){const n=r.find((e=>e.name.endsWith("starttime"))),l=r.find((e=>e.name.endsWith("endtime"))),s=r.find((e=>e.name.endsWith("startdate"))),d=r.find((e=>e.name.endsWith("enddate")));n.valueAsNumber>=l.valueAsNumber&&(null===(t=s.valueAsDate)||void 0===t?void 0:t.valueOf())===(null===(o=d.valueAsDate)||void 0===o?void 0:o.valueOf())?(a(l,!0,"End time cannot be the same or before the start time"),i.name.endsWith("starttime")&&this.validityCheckWrapper(e)):(l.setCustomValidity(""),a(l,!1,null),this.validityCheckWrapper(e))}}clearTimeComparitor(e){const t=e.target,o=t.getAttribute("data-formkey"),i=Array.from(t.parentElement.parentElement.parentElement.querySelectorAll(`[type=time][data-formkey=${o}]`));if(i.length){const e=i.find((e=>e.name.endsWith("endtime")));e.setCustomValidity(""),a(e,!1,null)}}startDateComparisonValidator(e){const t=e.target,o=t.getAttribute("data-compare-to"),i=t.parentElement.parentElement.parentElement.querySelector(`[name=${o}]`);this.endDateComparisonValidator({target:i},!0),this.validityCheckWrapper(e)}endDateComparisonValidator(e,t=!1){var o,i,n,r;const l=e.target;if(!l.value&&t)return;const s=l.getAttribute("data-compare-with"),d=l.parentElement.parentElement.parentElement.querySelector(`[name=${s}]`);(null===(o=l.valueAsDate)||void 0===o?void 0:o.valueOf())<(null===(i=d.valueAsDate)||void 0===i?void 0:i.valueOf())?(l.setCustomValidity(l.getAttribute("data-compare")),a(l,!0,l.getAttribute("data-compare"))):(null===(n=l.valueAsDate)||void 0===n?void 0:n.valueOf())===(null===(r=d.valueAsDate)||void 0===r?void 0:r.valueOf())?(l.setCustomValidity(""),this.validityCheckWrapper(e),this.startEndTimeComparitor(e)):(this.clearTimeComparitor(e),this.validityCheckWrapper(e))}validityCheckWrapper(e){const{target:t,hasError:o,errorMessage:i}=function(e){var t,o,i,n;e.preventDefault&&e.preventDefault();const r=e.target;let a=!0,l="";switch(r.value.length&&!r.value.replace(/\s/g,"").length?(l="This field cannot be left blank",r.setCustomValidity(l)):(l="",r.setCustomValidity&&r.setCustomValidity("")),!0){case r.validity.valueMissing:l=null!==(t=r.dataset.required)&&void 0!==t?t:"This field is required";break;case r.validity.patternMismatch:l=null!==(o=r.dataset.pattern)&&void 0!==o?o:"Incorrect format";break;case r.validity.badInput:l=null!==(i=r.dataset.badinput)&&void 0!==i?i:"Wrong input type";break;case r.validity.rangeOverflow||r.validity.rangeUnderflow:l=null!==(n=r.dataset.range)&&void 0!==n?n:"Invalid value";break;case r.validity.customError:l=r.validationMessage;break;default:a=!1}return{target:r,hasError:a,errorMessage:l}}(e);a(t,o,i)}render(){return o(i,null,o("form",{ref:e=>this.form=e,onSubmit:this.doSubmit.bind(this)},o("fieldset",{ref:e=>this.fieldset=e}),o("input",{type:"submit",ref:e=>this.submitButton=e,style:{display:"none"}})))}static get watchers(){return{formschema:["onFormSchemaChange"],data:["onDataChange"]}}};l.style='.material-symbols-rounded{font-variation-settings:"FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24}.material-symbols-rounded{font-variation-settings:"FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24}label{font-weight:500;font-size:16px;line-height:19px;color:#212121}label .optional{color:#757575;font-weight:normal}label .outer-container{position:relative}label .outer-container .left-icons,label .outer-container .right-icons{display:flex;position:absolute;height:24px;gap:8px}label .outer-container .left-icons tttx-icon,label .outer-container .right-icons tttx-icon{height:24px;width:24px}label .outer-container .left-icons{left:8px}label .outer-container .right-icons{right:8px}label .outer-container input,label .outer-container textarea{color:#212121;box-sizing:border-box;border:1px solid #d5d5d5;border-radius:4px;padding:0;padding-left:16px;padding-right:16px;margin-top:4px;}label .outer-container input.has-input-icon,label .outer-container textarea.has-input-icon{padding-left:40px}label .outer-container input.has-input-icon.has-left-icon,label .outer-container textarea.has-input-icon.has-left-icon{padding-left:72px}label .outer-container input.has-left-icon,label .outer-container textarea.has-left-icon{padding-left:40px}label .outer-container input.has-right-icon,label .outer-container textarea.has-right-icon{padding-right:40px}label .outer-container input.invalid,label .outer-container textarea.invalid{border:1px solid #dc0000}label .outer-container input:not([type=submit]),label .outer-container textarea:not([type=submit]){font-family:"Roboto", serif;width:100%;height:36px;font-size:16px;line-height:19px}label .outer-container input[type=radio],label .outer-container textarea[type=radio]{width:20px;height:20px}label .outer-container input[type=date],label .outer-container textarea[type=date]{background:white;display:block;min-width:calc(100% - 18px);line-height:37px}label .outer-container input[readonly],label .outer-container textarea[readonly]{cursor:default;pointer-events:none;user-select:none;color:gray}label .outer-container input:focus,label .outer-container textarea:focus{border-color:#1479c6}label .outer-container input:focus-visible,label .outer-container textarea:focus-visible{outline:none}label .outer-container textarea{padding:8px;height:auto;min-height:100px;resize:vertical}label .outer-container.inputBlock{display:flex;align-items:center;line-height:21px}label .outer-container.inputBlock .left-icons,label .outer-container.inputBlock .right-icons{margin-top:4px}label .outer-container.inputBlock.readonly{pointer-events:none;user-select:none;color:gray}label .outer-container.inputBlock.radioBlock{display:block}label .outer-container.inputInline{display:flex;white-space:nowrap;align-items:center;margin:0}label .outer-container.inputInline input{margin-top:0}label .secondarylabel{color:#757575;font-size:14px;line-height:16px;font-weight:normal;display:flex;margin-top:4px}label .errorBubble{position:relative;font-size:14px;line-height:16px;font-weight:normal;width:100%;font-family:"Roboto", sans-serif;color:#dc0000;display:flex;align-content:center;align-items:center;justify-items:center;margin-top:4px}label .errorBubble:not(.visible){display:none}label .errorBubble span{color:#dc0000;font-size:16px;margin-right:4px}.material-symbols-rounded{font-family:"Material Symbols Rounded", sans-serif;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;color:#9e9e9e}button{cursor:pointer}.button{font-family:Roboto, serif;box-sizing:border-box;height:36px;min-width:36px;padding:0;margin:0;background:transparent;color:#212121;border:1px solid #c8c8c8;border-radius:4px;text-transform:uppercase;display:flex;justify-content:left;align-items:center;font-size:14px;font-weight:500}.button-content{display:block;padding:0 16px}.icon-left,.icon-right{margin-top:4px}.iconleft{padding-left:8px}.iconleft .button-content{padding-left:4px}.iconright{padding-right:8px}.iconright .button-content{padding-right:4px}.notext{padding:0 6px}.button:active{background:rgba(17, 17, 17, 0.2);border:1px solid #d5d5d5}.primary{background:#1479c6;border:1px solid #1479c6;color:white}.primary:active{background:#1464a2;border:1px solid #1464a2}.borderless{background:transparent;border:none;color:#212121}.borderless:active{background:rgba(17, 17, 17, 0.2);border:none}.borderless-circle{background:transparent;border:none;color:#212121;border-radius:50%}.borderless-circle:active{border:none}.borderless-circle:focus{border-color:transparent}.danger{background:#dc0000;border:1px solid #dc0000;color:white}.danger:active{background:#b00000;border:1px solid #b00000}.disabled{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}.disabled:active{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}@media (hover: hover){.button:hover{background:rgba(17, 17, 17, 0.1);border:1px solid #d5d5d5}.primary:hover{background:#146eb3;border:1px solid #146eb3}.borderless:hover{background:rgba(17, 17, 17, 0.1);border:none}.borderless-circle:hover{background:rgba(17, 17, 17, 0.1);border:none}.danger:hover{background:#c60000;border:1px solid #c60000}.disabled:hover{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}}:host{display:block}fieldset{margin:0;padding:0;border:none}label{display:block;position:relative;margin-bottom:16px}.inlineLabel{font-weight:400;display:inline-block;vertical-align:top;padding-top:4px}input[type=checkbox]{width:18px;height:18px}input~label{font-weight:400}select{font-family:"Roboto", serif;box-sizing:border-box;width:100%;height:36px;padding:0 16px;font-size:16px;border:1px solid #d5d5d5;border-radius:4px;margin-top:4px}.placeholder{color:#9e9e9e}.placeholder option{color:initial}select.invalid:invalid{border:1px solid #dc0000}select~.errorBubble{position:relative;font-size:14px;font-weight:normal;width:100%;font-family:"Roboto", sans-serif;color:#dc0000;display:flex;align-content:center;align-items:center;justify-items:center}select~.errorBubble:not(.visible){visibility:hidden}select~.errorBubble span{color:#dc0000;font-size:16px;margin-right:4px;height:16px}select.invalid:invalid~.errorBubble{position:relative;font-size:14px;font-weight:normal;width:100%;font-family:"Roboto", sans-serif;color:#dc0000;visibility:visible}select:focus{border-color:#1479c6}select:focus-visible{outline:none}.button{padding:0 16px}.footer{display:flex;gap:16px;flex-direction:row-reverse}label.flex-label{display:flex;flex-direction:column;width:300px;box-sizing:border-box}label.flex-label input[type=date]{flex-grow:1;min-width:auto}label.flex-label input[type=time]{min-width:auto;text-align:center;width:180px;margin-left:16px}';export{l as tttx_form}
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-65bb4035.js";export{s as setNonce}from"./p-65bb4035.js";(()=>{const t=import.meta.url,o={};return""!==t&&(o.resourcesUrl=new URL(".",t).href),e(o)})().then((e=>t([["p-7f1452fb",[[1,"tttx-data-pattern",{data:[1],sorteroptions:[1],filteroptions:[1],filterheader:[1]}]]],["p-f8c7f162",[[1,"tttx-multiselect-box",{optionsData:[1,"options-data"],label:[1],inline:[4],placeholder:[1],searchEnabled:[4,"search-enabled"],htmlVisibleValue:[4,"html-visible-value"],visibleValue:[1,"visible-value"],open:[32],unsavedSelectedItems:[32],searchTerm:[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["p-c476e635",[[1,"tttx-dialog-box",{data:[1025],size:[1],open:[1028],allowOverflow:[4,"allow-overflow"],elementSize:[32]},[[9,"resize","handleResize"]]]]],["p-6b6da818",[[1,"tttx-select-box",{optionsData:[1,"options-data"],label:[1],inline:[4],placeholder:[1],searchEnabled:[4,"search-enabled"],selectedValue:[1,"selected-value"],open:[32],selectedItem:[32],searchTerm:[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["p-888fb9ee",[[1,"tttx-tree-view",{data:[1040],firstSelected:[1028,"first-selected"],treeData:[32],selectedId:[32]}]]],["p-69e15a92",[[0,"tttx-checkbox",{checkboxId:[1,"checkbox-id"],label:[1],inline:[4],indeterminate:[4],checked:[4]}]]],["p-20d3d8fb",[[1,"tttx-dialog",{header:[1],type:[1],size:[1],open:[4],allowOverflow:[4,"allow-overflow"],closeEnabled:[4,"close-enabled"],elementSize:[32]},[[9,"resize","handleResize"]]]]],["p-87b6e5a9",[[1,"tttx-expander",{name:[1],open:[4],lefticon:[1],lefticoncolor:[1],isExpanded:[32]}]]],["p-562eafbd",[[2,"tttx-tabs",{tabsName:[1,"tabs-name"],navigation:[4],wide:[4],tabs:[1],_tabs:[32]},[[0,"keydown","handleKeyDown"]]]]],["p-67f24d17",[[1,"tttx-checkbox-group"]]],["p-a64c9910",[[4,"tttx-checkbox-group-caption"]]],["p-80e3bd36",[[4,"tttx-checkbox-group-heading"]]],["p-521d72e9",[[1,"tttx-form",{formschema:[1025],data:[1032],submit:[64]}]]],["p-15b7a577",[[1,"tttx-keyvalue-block",{keyvalues:[1],horizontal:[4],spacedout:[4],_elements:[32]}]]],["p-fe6c321b",[[1,"tttx-loading-spinner",{loadingMessage:[1028,"loading-message"],size:[1025]}]]],["p-be16cf2d",[[2,"tttx-percentage-bar",{percentage:[8],thresholds:[1],color:[1],min:[1],labelid:[1],_percentage:[32],_ranges:[32],_min:[32]}]]],["p-69642b71",[[1,"tttx-qrcode",{link:[1025],size:[1026]}]]],["p-e7b7d2e2",[[1,"tttx-tag",{text:[1],color:[1],textColor:[1,"text-color"]}]]],["p-34f328f9",[[2,"tttx-textarea",{label:[1],secondarylabel:[1],showerrormsg:[4],showerrorbubble:[4],errormsg:[1],rows:[2],textareaautofocus:[4],inputkeyhint:[1],inputindex:[8],inputtitle:[1],disabled:[4],maxlength:[8],name:[1],placeholder:[1],readonly:[8],required:[4],value:[1032]}]]],["p-bcf3844e",[[1,"tttx-icon",{icon:[1],color:[1]}]]],["p-bf5e95e2",[[2,"tttx-standalone-input",{label:[1],secondarylabel:[1],showerrormsg:[4],showerrorbubble:[4],errormsg:[1],iconleft:[1],iconleftcolor:[1],iconright:[1],iconrightcolor:[1],inputicon:[1],inputiconcolor:[1],inline:[4],inputautocapitalize:[1],inputautofocus:[4],inputkeyhint:[1],inputindex:[8],inputtitle:[1],autocomplete:[1],checked:[4],disabled:[4],max:[8],maxlength:[8],min:[8],minlength:[8],name:[1],pattern:[1],placeholder:[1],readonly:[8],required:[4],step:[8],type:[1],value:[1032]}]]],["p-f27adb48",[[1,"tttx-filter",{filterKey:[1,"filter-key"],filterOptions:[1,"filter-options"],showSelectAll:[4,"show-select-all"],showSearchField:[4,"show-search-field"],showOptionIcons:[4,"show-option-icons"],filterButtonStyle:[1,"filter-button-style"],filterHeader:[1,"filter-header"],defaultFilterOptions:[1,"default-filter-options"],popoverWidth:[1,"popover-width"],showPopover:[32],displayedFilterSettings:[32],selectedFilters:[32],filterSearchTerm:[32],allSelected:[32]},[[0,"closeFilter","handleCloseFilter"]]],[1,"tttx-list",{data:[1025],name:[1],_data:[32]}],[1,"tttx-sorter",{sorterKey:[1,"sorter-key"],defaultSortDirection:[1,"default-sort-direction"],fieldOptionsData:[1,"field-options-data"],defaultOption:[1,"default-option"],selectedField:[32],sortDirection:[32],dropdownExpand:[32],dropdownOptions:[32]},[[0,"closeSorter","handleCloseSorter"]]],[1,"tttx-toolbar",{border:[4],viewSize:[32]},[[9,"resize","handleResize"]]]]],["p-61741832",[[1,"tttx-button",{notext:[4],icon:[1],iconposition:[1],iconcolor:[1025],design:[1]}]]]],e)));
1
+ import{p as e,b as t}from"./p-65bb4035.js";export{s as setNonce}from"./p-65bb4035.js";(()=>{const t=import.meta.url,o={};return""!==t&&(o.resourcesUrl=new URL(".",t).href),e(o)})().then((e=>t([["p-7f1452fb",[[1,"tttx-data-pattern",{data:[1],sorteroptions:[1],filteroptions:[1],filterheader:[1]}]]],["p-f8c7f162",[[1,"tttx-multiselect-box",{optionsData:[1,"options-data"],label:[1],inline:[4],placeholder:[1],searchEnabled:[4,"search-enabled"],htmlVisibleValue:[4,"html-visible-value"],visibleValue:[1,"visible-value"],open:[32],unsavedSelectedItems:[32],searchTerm:[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["p-c476e635",[[1,"tttx-dialog-box",{data:[1025],size:[1],open:[1028],allowOverflow:[4,"allow-overflow"],elementSize:[32]},[[9,"resize","handleResize"]]]]],["p-6b6da818",[[1,"tttx-select-box",{optionsData:[1,"options-data"],label:[1],inline:[4],placeholder:[1],searchEnabled:[4,"search-enabled"],selectedValue:[1,"selected-value"],open:[32],selectedItem:[32],searchTerm:[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["p-888fb9ee",[[1,"tttx-tree-view",{data:[1040],firstSelected:[1028,"first-selected"],treeData:[32],selectedId:[32]}]]],["p-69e15a92",[[0,"tttx-checkbox",{checkboxId:[1,"checkbox-id"],label:[1],inline:[4],indeterminate:[4],checked:[4]}]]],["p-20d3d8fb",[[1,"tttx-dialog",{header:[1],type:[1],size:[1],open:[4],allowOverflow:[4,"allow-overflow"],closeEnabled:[4,"close-enabled"],elementSize:[32]},[[9,"resize","handleResize"]]]]],["p-87b6e5a9",[[1,"tttx-expander",{name:[1],open:[4],lefticon:[1],lefticoncolor:[1],isExpanded:[32]}]]],["p-562eafbd",[[2,"tttx-tabs",{tabsName:[1,"tabs-name"],navigation:[4],wide:[4],tabs:[1],_tabs:[32]},[[0,"keydown","handleKeyDown"]]]]],["p-67f24d17",[[1,"tttx-checkbox-group"]]],["p-a64c9910",[[4,"tttx-checkbox-group-caption"]]],["p-80e3bd36",[[4,"tttx-checkbox-group-heading"]]],["p-ed9ebbfb",[[1,"tttx-form",{formschema:[1025],data:[1032],submit:[64],setSelectOptions:[64]}]]],["p-15b7a577",[[1,"tttx-keyvalue-block",{keyvalues:[1],horizontal:[4],spacedout:[4],_elements:[32]}]]],["p-fe6c321b",[[1,"tttx-loading-spinner",{loadingMessage:[1028,"loading-message"],size:[1025]}]]],["p-be16cf2d",[[2,"tttx-percentage-bar",{percentage:[8],thresholds:[1],color:[1],min:[1],labelid:[1],_percentage:[32],_ranges:[32],_min:[32]}]]],["p-69642b71",[[1,"tttx-qrcode",{link:[1025],size:[1026]}]]],["p-e7b7d2e2",[[1,"tttx-tag",{text:[1],color:[1],textColor:[1,"text-color"]}]]],["p-34f328f9",[[2,"tttx-textarea",{label:[1],secondarylabel:[1],showerrormsg:[4],showerrorbubble:[4],errormsg:[1],rows:[2],textareaautofocus:[4],inputkeyhint:[1],inputindex:[8],inputtitle:[1],disabled:[4],maxlength:[8],name:[1],placeholder:[1],readonly:[8],required:[4],value:[1032]}]]],["p-bcf3844e",[[1,"tttx-icon",{icon:[1],color:[1]}]]],["p-bf5e95e2",[[2,"tttx-standalone-input",{label:[1],secondarylabel:[1],showerrormsg:[4],showerrorbubble:[4],errormsg:[1],iconleft:[1],iconleftcolor:[1],iconright:[1],iconrightcolor:[1],inputicon:[1],inputiconcolor:[1],inline:[4],inputautocapitalize:[1],inputautofocus:[4],inputkeyhint:[1],inputindex:[8],inputtitle:[1],autocomplete:[1],checked:[4],disabled:[4],max:[8],maxlength:[8],min:[8],minlength:[8],name:[1],pattern:[1],placeholder:[1],readonly:[8],required:[4],step:[8],type:[1],value:[1032]}]]],["p-f27adb48",[[1,"tttx-filter",{filterKey:[1,"filter-key"],filterOptions:[1,"filter-options"],showSelectAll:[4,"show-select-all"],showSearchField:[4,"show-search-field"],showOptionIcons:[4,"show-option-icons"],filterButtonStyle:[1,"filter-button-style"],filterHeader:[1,"filter-header"],defaultFilterOptions:[1,"default-filter-options"],popoverWidth:[1,"popover-width"],showPopover:[32],displayedFilterSettings:[32],selectedFilters:[32],filterSearchTerm:[32],allSelected:[32]},[[0,"closeFilter","handleCloseFilter"]]],[1,"tttx-list",{data:[1025],name:[1],_data:[32]}],[1,"tttx-sorter",{sorterKey:[1,"sorter-key"],defaultSortDirection:[1,"default-sort-direction"],fieldOptionsData:[1,"field-options-data"],defaultOption:[1,"default-option"],selectedField:[32],sortDirection:[32],dropdownExpand:[32],dropdownOptions:[32]},[[0,"closeSorter","handleCloseSorter"]]],[1,"tttx-toolbar",{border:[4],viewSize:[32]},[[9,"resize","handleResize"]]]]],["p-61741832",[[1,"tttx-button",{notext:[4],icon:[1],iconposition:[1],iconcolor:[1025],design:[1]}]]]],e)));
@@ -25,6 +25,15 @@ export declare class TttxForm {
25
25
  */
26
26
  fieldChanged(event: KeyboardEvent | Event): void;
27
27
  submit(): Promise<void>;
28
+ /**
29
+ * Replace all children in a given select list with a list of new options
30
+ * @param { string } fieldname the form name of the given field
31
+ * @param { {label: string, value: string}[] } options a list of option values and labels
32
+ */
33
+ setSelectOptions(fieldname: string, options: {
34
+ label: string;
35
+ value: string;
36
+ }[]): Promise<void>;
28
37
  /**
29
38
  * Submits the form data to the server.
30
39
  *
@@ -77,6 +77,12 @@ export namespace Components {
77
77
  interface TttxForm {
78
78
  "data": any;
79
79
  "formschema": Record<string, any> | string;
80
+ /**
81
+ * Replace all children in a given select list with a list of new options
82
+ * @param fieldname the form name of the given field
83
+ * @param options a list of option values and labels
84
+ */
85
+ "setSelectOptions": (fieldname: string, options: { label: string; value: string; }[]) => Promise<void>;
80
86
  "submit": () => Promise<void>;
81
87
  }
82
88
  interface TttxIcon {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3t-transform/threeteeui",
3
- "version": "0.2.112",
3
+ "version": "0.2.113",
4
4
  "description": "3t Design System",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1 +0,0 @@
1
- import{r as e,c as t,h as o,H as i}from"./p-65bb4035.js";import{p as n,d as r}from"./p-88ee2406.js";import"./p-112455b1.js";function a(e,t,o,i){let n;if(n=void 0!==i?i.querySelector(".errorBubble"):"label"===e.parentElement.nodeName.toLowerCase()?e.parentElement.querySelector(".errorBubble"):e.parentElement.parentElement.querySelector(".errorBubble"),n)if(t){e.classList.add("invalid"),n.classList.add("visible");const t=document.createElement("span");t.className="material-symbols-rounded",t.textContent="warning",n.innerHTML="",n.append(t),n.append(o)}else n.classList.remove("visible"),e.classList.remove("invalid"),n.innerHTML=""}const l=class{constructor(o){e(this,o),this.dataSubmitted=t(this,"dataSubmitted",7),this.dataChanged=t(this,"dataChanged",7),this.template=document.createElement("template"),this.formschema=void 0,this.data=void 0}onFormSchemaChange(e){if(!this.data&&this.form&&this._formSchema){const e=new FormData(this.form);this._data=Object.fromEntries(Object.keys(this._formSchema.properties).map((t=>[t,e.get(t)])))}this._formSchema="string"==typeof e?JSON.parse(e):e}onDataChange(e){this._data="string"==typeof e?JSON.parse(e):e}fieldChanged(e){this.dataChanged.emit({name:e.target.name,value:e.target.value})}async submit(){this.submitButton.click()}doSubmit(e){e.preventDefault();const t=new FormData(e.target),o=this._formSchema.properties;for(const e of Object.keys(o))"checkbox"!==o[e].form.type||t.has(e)||t.append(e,"off");this.dataSubmitted.emit(t)}componentWillLoad(){this.onFormSchemaChange(this.formschema),this.data&&this.onDataChange(this.data)}componentWillRender(){this.template=document.createElement("template"),this.populateFormFromSchema()}createSelect(e,t){var o;const i=document.createElement("select");return i.setAttribute("name",e),t.options.forEach((e=>{this.appendOption(i,e)})),(null===(o=this._data)||void 0===o?void 0:o[e])&&i.classList.remove("placeholder"),i}appendOption(e,t){const o=document.createElement("option");o.setAttribute("value",t.value),t.placeholder&&(o.setAttribute("disabled",""),o.setAttribute("selected",""),o.setAttribute("hidden",""),e.classList.add("placeholder")),t.label&&(o.innerHTML=n.sanitize(t.label,r)),e.appendChild(o)}createInput(e,t){var o;const i=document.createElement("input");return i.type=t.type,i.name=e,i.placeholder=null!==(o=t.placeholder)&&void 0!==o?o:"",i.autocomplete="off",i.autocapitalize="off",t.readonly&&(i.readOnly=!0),i}createTextArea(e,t){var o;const i=document.createElement("textarea");return i.name=e,i.placeholder=null!==(o=t.placeholder)&&void 0!==o?o:"",i.autocomplete="off",i.autocapitalize="off",t.readonly&&(i.readOnly=!0),i}createStartEndDateComponent(e,t){const o=document.createElement("input"),i=document.createElement("input");let n,r;o.type=i.type="date",o.name=`${e}-startdate`,i.name=`${e}-enddate`,o.setAttribute("data-formkey",e),i.setAttribute("data-formkey",e),t.readonly&&(o.readOnly=!0,i.readOnly=!0),this.applyValidation(o,{required:{message:"Please enter a start date"},dateCompare:{to:i.name}}),this.applyValidation(i,{required:{message:"Please enter an end date"},dateCompare:{with:o.name,message:"End date cannot be before the start date"}}),t.includeTime&&(n=document.createElement("input"),r=document.createElement("input"),n.type=r.type="time",n.name=`${e}-starttime`,r.name=`${e}-endtime`,n.setAttribute("data-formkey",e),r.setAttribute("data-formkey",e),t.readonly&&(n.readOnly=!0,r.readOnly=!0),this.applyValidation(n,{required:{message:"Please enter a start time"}}),this.applyValidation(r,{required:{message:"Please enter an end time"}}));const a=document.createElement("label");a.innerText="Start date";const l=document.createElement("label");l.innerText="End date";const s=document.createElement("div"),d=document.createElement("div");return s.className=d.className="outer-container inputBlock",a.className=l.className="flex-label",s.append(o),n&&s.append(n),a.append(s),a.append(this.createErrorBubble()),d.append(i),r&&d.append(r),l.append(d),l.append(this.createErrorBubble()),{start:a,end:l}}applyValidation(e,t){var o,i;t.required&&(e.setAttribute("required",""),e.setAttribute("data-required",null!==(o=t.required.message)&&void 0!==o?o:"")),t.pattern&&(e.setAttribute("pattern",t.pattern.pattern),e.setAttribute("data-pattern",null!==(i=t.pattern.message)&&void 0!==i?i:"")),t.badInput&&e.setAttribute("data-badinput",t.badInput.message),t.minmax&&(e.setAttribute("min",t.minmax.min),e.setAttribute("max",t.minmax.max),e.setAttribute("data-range",t.minmax.message)),t.maxlength&&e.setAttribute("maxlength",t.maxlength),t.dateCompare&&(t.dateCompare.message&&t.dateCompare.with&&(e.setAttribute("data-compare",t.dateCompare.message),e.setAttribute("data-compare-with",t.dateCompare.with)),t.dateCompare.to&&e.setAttribute("data-compare-to",t.dateCompare.to))}createErrorBubble(){const e=document.createElement("div");return e.className="errorBubble",e}appendCheckboxInput(e,t,o){if(e.label){const e=document.createElement("br");o.appendChild(e)}if(o.appendChild(t),!e.inlineLabel)return;const i=document.createElement("span");i.className="inlineLabel",i.textContent=e.inlineLabel,o.appendChild(i)}createLabel(e,t,o){var i;const n=document.createElement("div");let r="outer-container inputBlock";const a=document.createElement("label");if(a.innerText=e.label,!(null===(i=e.validation)||void 0===i?void 0:i.required)&&e.label){const e=document.createElement("span");e.className="optional",e.innerHTML="&nbsp;(optional)",a.appendChild(e)}return"radio"===e.type&&(r+=" radioBlock"),n.className=r,e.readonly&&a.classList.add("readonly"),"checkbox"===e.type?this.appendCheckboxInput(e,t,a):n.appendChild(t),"checkbox"!==e.type&&a.appendChild(n),a.appendChild(o),a}createRadio(e,t){var o,i;const n=new DocumentFragment;for(const r of t.options){const a=document.createElement("input");a.type="radio",a.name=e,a.value=r.value,(null===(o=null==t?void 0:t.validation)||void 0===o?void 0:o.required)&&(a.setAttribute("required","required"),a.setAttribute("data-required",null!==(i=t.validation.required.message)&&void 0!==i?i:""));const l=document.createElement("span");l.innerText=r.label,n.appendChild(a),n.appendChild(l),n.appendChild(document.createElement("br"))}return n}populateFormFromSchema(){var e;if(!this._formSchema)return;const t=this._formSchema.properties,o=Object.keys(t);for(const i of o){const o=t[i].form;if("startenddate"===o.type){const{start:e,end:t}=this.createStartEndDateComponent(i,o);this.template.content.append(e),this.template.content.append(t);continue}let n;switch(o.type){case"select":n=this.createSelect(i,o);break;case"radio":n=this.createRadio(i,o);break;case"textarea":n=this.createTextArea(i,o);break;default:n=this.createInput(i,o)}o.validation&&"radio"!==o.type&&this.applyValidation(n,o.validation);const r=this.createErrorBubble(),l=this.createLabel(o,n,r);if(null===(e=o.validation)||void 0===e?void 0:e.invalid){const e=o.validation.invalid.message;n.setCustomValidity(e),a(n,!0,e)}this.template.content.append(l)}}componentDidRender(){if(!this._formSchema)return;const e=this.template.content.cloneNode(!0),t=this._formSchema.properties,o=Object.keys(t);for(const i of o){const o=e.querySelectorAll(`[name^=${i}]`);for(const e of o)e.oninvalid=this.validityCheckWrapper.bind(this),e.onblur=this.validityCheckWrapper.bind(this),e.onkeyup=this.fieldChanged.bind(this),e.onchange=this.fieldChanged.bind(this),"select"===t[i].form.type&&e.classList.contains("placeholder")&&e.addEventListener("change",(()=>{e.classList.remove("placeholder")})),"startenddate"===t[i].form.type&&e.hasAttribute("data-compare-with")&&(e.oninvalid=this.endDateComparisonValidator.bind(this),e.onblur=this.endDateComparisonValidator.bind(this)),"startenddate"===t[i].form.type&&"time"===e.type&&(e.oninvalid=this.startEndTimeComparitor.bind(this),e.onblur=this.startEndTimeComparitor.bind(this)),"startenddate"===t[i].form.type&&e.hasAttribute("data-compare-to")&&(e.oninvalid=this.startDateComparisonValidator.bind(this),e.onblur=this.startDateComparisonValidator.bind(this))}if(this._data&&Object.keys(this._data).length>0){const t=Object.keys(this._data);for(const o of t){const t=e.querySelectorAll(`[name=${o}]`);for(const e of t)switch(e.type){case"checkbox":"on"===this._data[o]&&(e.checked=!0);break;case"radio":e.value===this._data[o]&&(e.checked=!0);break;default:e.value=this._data[o]}}}this.fieldset.replaceChildren(e)}startEndTimeComparitor(e){var t,o;const i=e.target,n=i.getAttribute("data-formkey"),r=Array.from(i.parentElement.parentElement.parentElement.querySelectorAll(`[data-formkey=${n}]`));if(4===r.length){const n=r.find((e=>e.name.endsWith("starttime"))),l=r.find((e=>e.name.endsWith("endtime"))),s=r.find((e=>e.name.endsWith("startdate"))),d=r.find((e=>e.name.endsWith("enddate")));n.valueAsNumber>=l.valueAsNumber&&(null===(t=s.valueAsDate)||void 0===t?void 0:t.valueOf())===(null===(o=d.valueAsDate)||void 0===o?void 0:o.valueOf())?(a(l,!0,"End time cannot be the same or before the start time"),i.name.endsWith("starttime")&&this.validityCheckWrapper(e)):(l.setCustomValidity(""),a(l,!1,null),this.validityCheckWrapper(e))}}clearTimeComparitor(e){const t=e.target,o=t.getAttribute("data-formkey"),i=Array.from(t.parentElement.parentElement.parentElement.querySelectorAll(`[type=time][data-formkey=${o}]`));if(i.length){const e=i.find((e=>e.name.endsWith("endtime")));e.setCustomValidity(""),a(e,!1,null)}}startDateComparisonValidator(e){const t=e.target,o=t.getAttribute("data-compare-to"),i=t.parentElement.parentElement.parentElement.querySelector(`[name=${o}]`);this.endDateComparisonValidator({target:i},!0),this.validityCheckWrapper(e)}endDateComparisonValidator(e,t=!1){var o,i,n,r;const l=e.target;if(!l.value&&t)return;const s=l.getAttribute("data-compare-with"),d=l.parentElement.parentElement.parentElement.querySelector(`[name=${s}]`);(null===(o=l.valueAsDate)||void 0===o?void 0:o.valueOf())<(null===(i=d.valueAsDate)||void 0===i?void 0:i.valueOf())?(l.setCustomValidity(l.getAttribute("data-compare")),a(l,!0,l.getAttribute("data-compare"))):(null===(n=l.valueAsDate)||void 0===n?void 0:n.valueOf())===(null===(r=d.valueAsDate)||void 0===r?void 0:r.valueOf())?(l.setCustomValidity(""),this.validityCheckWrapper(e),this.startEndTimeComparitor(e)):(this.clearTimeComparitor(e),this.validityCheckWrapper(e))}validityCheckWrapper(e){const{target:t,hasError:o,errorMessage:i}=function(e){var t,o,i,n;e.preventDefault&&e.preventDefault();const r=e.target;let a=!0,l="";switch(r.value.length&&!r.value.replace(/\s/g,"").length?(l="This field cannot be left blank",r.setCustomValidity(l)):(l="",r.setCustomValidity&&r.setCustomValidity("")),!0){case r.validity.valueMissing:l=null!==(t=r.dataset.required)&&void 0!==t?t:"This field is required";break;case r.validity.patternMismatch:l=null!==(o=r.dataset.pattern)&&void 0!==o?o:"Incorrect format";break;case r.validity.badInput:l=null!==(i=r.dataset.badinput)&&void 0!==i?i:"Wrong input type";break;case r.validity.rangeOverflow||r.validity.rangeUnderflow:l=null!==(n=r.dataset.range)&&void 0!==n?n:"Invalid value";break;case r.validity.customError:l=r.validationMessage;break;default:a=!1}return{target:r,hasError:a,errorMessage:l}}(e);a(t,o,i)}render(){return o(i,null,o("form",{ref:e=>this.form=e,onSubmit:this.doSubmit.bind(this)},o("fieldset",{ref:e=>this.fieldset=e}),o("input",{type:"submit",ref:e=>this.submitButton=e,style:{display:"none"}})))}static get watchers(){return{formschema:["onFormSchemaChange"],data:["onDataChange"]}}};l.style='.material-symbols-rounded{font-variation-settings:"FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24}.material-symbols-rounded{font-variation-settings:"FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24}label{font-weight:500;font-size:16px;line-height:19px;color:#212121}label .optional{color:#757575;font-weight:normal}label .outer-container{position:relative}label .outer-container .left-icons,label .outer-container .right-icons{display:flex;position:absolute;height:24px;gap:8px}label .outer-container .left-icons tttx-icon,label .outer-container .right-icons tttx-icon{height:24px;width:24px}label .outer-container .left-icons{left:8px}label .outer-container .right-icons{right:8px}label .outer-container input,label .outer-container textarea{color:#212121;box-sizing:border-box;border:1px solid #d5d5d5;border-radius:4px;padding:0;padding-left:16px;padding-right:16px;margin-top:4px;}label .outer-container input.has-input-icon,label .outer-container textarea.has-input-icon{padding-left:40px}label .outer-container input.has-input-icon.has-left-icon,label .outer-container textarea.has-input-icon.has-left-icon{padding-left:72px}label .outer-container input.has-left-icon,label .outer-container textarea.has-left-icon{padding-left:40px}label .outer-container input.has-right-icon,label .outer-container textarea.has-right-icon{padding-right:40px}label .outer-container input.invalid,label .outer-container textarea.invalid{border:1px solid #dc0000}label .outer-container input:not([type=submit]),label .outer-container textarea:not([type=submit]){font-family:"Roboto", serif;width:100%;height:36px;font-size:16px;line-height:19px}label .outer-container input[type=radio],label .outer-container textarea[type=radio]{width:20px;height:20px}label .outer-container input[type=date],label .outer-container textarea[type=date]{background:white;display:block;min-width:calc(100% - 18px);line-height:37px}label .outer-container input[readonly],label .outer-container textarea[readonly]{cursor:default;pointer-events:none;user-select:none;color:gray}label .outer-container input:focus,label .outer-container textarea:focus{border-color:#1479c6}label .outer-container input:focus-visible,label .outer-container textarea:focus-visible{outline:none}label .outer-container textarea{padding:8px;height:auto;min-height:100px;resize:vertical}label .outer-container.inputBlock{display:flex;align-items:center;line-height:21px}label .outer-container.inputBlock .left-icons,label .outer-container.inputBlock .right-icons{margin-top:4px}label .outer-container.inputBlock.readonly{pointer-events:none;user-select:none;color:gray}label .outer-container.inputBlock.radioBlock{display:block}label .outer-container.inputInline{display:flex;white-space:nowrap;align-items:center;margin:0}label .outer-container.inputInline input{margin-top:0}label .secondarylabel{color:#757575;font-size:14px;line-height:16px;font-weight:normal;display:flex;margin-top:4px}label .errorBubble{position:relative;font-size:14px;line-height:16px;font-weight:normal;width:100%;font-family:"Roboto", sans-serif;color:#dc0000;display:flex;align-content:center;align-items:center;justify-items:center;margin-top:4px}label .errorBubble:not(.visible){display:none}label .errorBubble span{color:#dc0000;font-size:16px;margin-right:4px}.material-symbols-rounded{font-family:"Material Symbols Rounded", sans-serif;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;color:#9e9e9e}button{cursor:pointer}.button{font-family:Roboto, serif;box-sizing:border-box;height:36px;min-width:36px;padding:0;margin:0;background:transparent;color:#212121;border:1px solid #c8c8c8;border-radius:4px;text-transform:uppercase;display:flex;justify-content:left;align-items:center;font-size:14px;font-weight:500}.button-content{display:block;padding:0 16px}.icon-left,.icon-right{margin-top:4px}.iconleft{padding-left:8px}.iconleft .button-content{padding-left:4px}.iconright{padding-right:8px}.iconright .button-content{padding-right:4px}.notext{padding:0 6px}.button:active{background:rgba(17, 17, 17, 0.2);border:1px solid #d5d5d5}.primary{background:#1479c6;border:1px solid #1479c6;color:white}.primary:active{background:#1464a2;border:1px solid #1464a2}.borderless{background:transparent;border:none;color:#212121}.borderless:active{background:rgba(17, 17, 17, 0.2);border:none}.borderless-circle{background:transparent;border:none;color:#212121;border-radius:50%}.borderless-circle:active{border:none}.borderless-circle:focus{border-color:transparent}.danger{background:#dc0000;border:1px solid #dc0000;color:white}.danger:active{background:#b00000;border:1px solid #b00000}.disabled{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}.disabled:active{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}@media (hover: hover){.button:hover{background:rgba(17, 17, 17, 0.1);border:1px solid #d5d5d5}.primary:hover{background:#146eb3;border:1px solid #146eb3}.borderless:hover{background:rgba(17, 17, 17, 0.1);border:none}.borderless-circle:hover{background:rgba(17, 17, 17, 0.1);border:none}.danger:hover{background:#c60000;border:1px solid #c60000}.disabled:hover{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}}:host{display:block}fieldset{margin:0;padding:0;border:none}label{display:block;position:relative;margin-bottom:16px}.inlineLabel{font-weight:400;display:inline-block;vertical-align:top;padding-top:4px}input[type=checkbox]{width:18px;height:18px}input~label{font-weight:400}select{font-family:"Roboto", serif;box-sizing:border-box;width:100%;height:36px;padding:0 16px;font-size:16px;border:1px solid #d5d5d5;border-radius:4px;margin-top:4px}.placeholder{color:#9e9e9e}.placeholder option{color:initial}select.invalid:invalid{border:1px solid #dc0000}select~.errorBubble{position:relative;font-size:14px;font-weight:normal;width:100%;font-family:"Roboto", sans-serif;color:#dc0000;display:flex;align-content:center;align-items:center;justify-items:center}select~.errorBubble:not(.visible){visibility:hidden}select~.errorBubble span{color:#dc0000;font-size:16px;margin-right:4px;height:16px}select.invalid:invalid~.errorBubble{position:relative;font-size:14px;font-weight:normal;width:100%;font-family:"Roboto", sans-serif;color:#dc0000;visibility:visible}select:focus{border-color:#1479c6}select:focus-visible{outline:none}.button{padding:0 16px}.footer{display:flex;gap:16px;flex-direction:row-reverse}label.flex-label{display:flex;flex-direction:column;width:300px;box-sizing:border-box}label.flex-label input[type=date]{flex-grow:1;min-width:auto}label.flex-label input[type=time]{min-width:auto;text-align:center;width:180px;margin-left:16px}';export{l as tttx_form}