@3t-transform/threeteeui 1.2.0 → 1.3.0
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.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{tttx-button_1_2_0.cjs.entry.js → tttx-button_1_3_0.cjs.entry.js} +2 -2
- package/dist/cjs/{tttx-checkbox-group-caption_1_2_0.cjs.entry.js → tttx-checkbox-group-caption_1_3_0.cjs.entry.js} +1 -1
- package/dist/cjs/{tttx-checkbox-group-heading_1_2_0.cjs.entry.js → tttx-checkbox-group-heading_1_3_0.cjs.entry.js} +1 -1
- package/dist/cjs/{tttx-checkbox-group_1_2_0.cjs.entry.js → tttx-checkbox-group_1_3_0.cjs.entry.js} +1 -1
- package/dist/cjs/{tttx-checkbox_1_2_0.cjs.entry.js → tttx-checkbox_1_3_0.cjs.entry.js} +2 -2
- package/dist/cjs/{tttx-data-pattern_1_2_0.cjs.entry.js → tttx-data-pattern_1_3_0.cjs.entry.js} +2 -2
- package/dist/cjs/{tttx-dialog-box_1_2_0.cjs.entry.js → tttx-dialog-box_1_3_0.cjs.entry.js} +3 -3
- package/dist/cjs/{tttx-dialog_1_2_0.cjs.entry.js → tttx-dialog_1_3_0.cjs.entry.js} +2 -2
- package/dist/cjs/{tttx-expander_1_2_0.cjs.entry.js → tttx-expander_1_3_0.cjs.entry.js} +2 -2
- package/dist/cjs/{tttx-filter_1_2_0_4.cjs.entry.js → tttx-filter_1_3_0_4.cjs.entry.js} +17 -10
- package/dist/cjs/{tttx-form_1_2_0.cjs.entry.js → tttx-form_1_3_0.cjs.entry.js} +159 -127
- package/dist/cjs/{tttx-icon_1_2_0.cjs.entry.js → tttx-icon_1_3_0.cjs.entry.js} +1 -1
- package/dist/cjs/{tttx-keyvalue-block_1_2_0.cjs.entry.js → tttx-keyvalue-block_1_3_0.cjs.entry.js} +1 -1
- package/dist/cjs/{tttx-loading-spinner_1_2_0.cjs.entry.js → tttx-loading-spinner_1_3_0.cjs.entry.js} +1 -1
- package/dist/cjs/{tttx-multiselect-box_1_2_0.cjs.entry.js → tttx-multiselect-box_1_3_0.cjs.entry.js} +6 -6
- package/dist/cjs/{tttx-percentage-bar_1_2_0.cjs.entry.js → tttx-percentage-bar_1_3_0.cjs.entry.js} +2 -2
- package/dist/cjs/{tttx-qrcode_1_2_0.cjs.entry.js → tttx-qrcode_1_3_0.cjs.entry.js} +1 -1
- package/dist/cjs/{tttx-select-box_1_2_0.cjs.entry.js → tttx-select-box_1_3_0.cjs.entry.js} +3 -3
- package/dist/cjs/tttx-standalone-input_1_3_0.cjs.entry.js +94 -0
- package/dist/cjs/{tttx-tabs_1_2_0.cjs.entry.js → tttx-tabs_1_3_0.cjs.entry.js} +4 -4
- package/dist/cjs/{tttx-tag_1_2_0.cjs.entry.js → tttx-tag_1_3_0.cjs.entry.js} +1 -1
- package/dist/cjs/{tttx-textarea_1_2_0.cjs.entry.js → tttx-textarea_1_3_0.cjs.entry.js} +2 -2
- package/dist/cjs/{tttx-tree-view_1_2_0.cjs.entry.js → tttx-tree-view_1_3_0.cjs.entry.js} +3 -3
- package/dist/cjs/tttx.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/atoms/tttx-button/tttx-button.js +2 -2
- package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +20 -20
- package/dist/collection/components/atoms/tttx-checkbox/tttx-checkbox.js +2 -2
- package/dist/collection/components/atoms/tttx-checkbox/tttx-checkbox.stories.js +1 -1
- package/dist/collection/components/atoms/tttx-icon/tttx-icon.js +1 -1
- package/dist/collection/components/atoms/tttx-icon/tttx-icon.stories.js +1 -1
- package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js +1 -1
- package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.js +6 -6
- package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.js +1 -1
- package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.js +1 -1
- package/dist/collection/components/atoms/tttx-percentage-bar/tttx-percentage-bar.js +1 -1
- package/dist/collection/components/atoms/tttx-percentage-bar/tttx-percentage-bar.stories.js +5 -5
- package/dist/collection/components/atoms/tttx-qrcode/tttx-qrcode.js +1 -1
- package/dist/collection/components/atoms/tttx-qrcode/tttx-qrcode.stories.js +1 -1
- package/dist/collection/components/atoms/tttx-tag/tttx-tag.js +1 -1
- package/dist/collection/components/atoms/tttx-tag/tttx-tag.stories.js +6 -6
- package/dist/collection/components/molecules/tttx-checkbox-group/components/tttx-checkbox-group-caption.js +1 -1
- package/dist/collection/components/molecules/tttx-checkbox-group/components/tttx-checkbox-group-heading.js +1 -1
- package/dist/collection/components/molecules/tttx-checkbox-group/tttx-checkbox-group.js +1 -1
- package/dist/collection/components/molecules/tttx-checkbox-group/tttx-checkbox-group.stories.js +10 -10
- package/dist/collection/components/molecules/tttx-dialog/tttx-dialog.js +2 -2
- package/dist/collection/components/molecules/tttx-dialog/tttx-dialog.stories.js +6 -6
- package/dist/collection/components/molecules/tttx-dialog-box/tttx-dialog-box.js +3 -3
- package/dist/collection/components/molecules/tttx-dialog-box/tttx-dialog-box.stories.js +24 -24
- package/dist/collection/components/molecules/tttx-expander/tttx-expander.js +2 -2
- package/dist/collection/components/molecules/tttx-expander/tttx-expander.stories.js +9 -9
- package/dist/collection/components/molecules/tttx-filter/tttx-filter.js +3 -3
- package/dist/collection/components/molecules/tttx-filter/tttx-filter.stories.js +2 -2
- package/dist/collection/components/molecules/tttx-form/lib/setErrorState.js +0 -1
- package/dist/collection/components/molecules/tttx-form/lib/timecomparatorChecks.js +64 -0
- package/dist/collection/components/molecules/tttx-form/tttx-form.js +103 -129
- package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +5 -5
- package/dist/collection/components/molecules/tttx-list/tttx-list.js +11 -4
- package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +46 -46
- package/dist/collection/components/molecules/tttx-multiselect-box/tttx-multiselect-box.js +6 -6
- package/dist/collection/components/molecules/tttx-multiselect-box/tttx-multiselect-box.stories.js +33 -33
- package/dist/collection/components/molecules/tttx-select-box/tttx-select-box.js +3 -3
- package/dist/collection/components/molecules/tttx-select-box/tttx-select-box.stories.js +16 -16
- package/dist/collection/components/molecules/tttx-sorter/tttx-sorter.js +2 -2
- package/dist/collection/components/molecules/tttx-sorter/tttx-sorter.stories.js +1 -1
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +4 -4
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +1 -1
- package/dist/collection/components/molecules/tttx-tabs/tttx-tabs.js +3 -3
- package/dist/collection/components/molecules/tttx-tabs/tttx-tabs.stories.js +4 -4
- package/dist/collection/components/molecules/tttx-textarea/tttx-textarea.js +3 -3
- package/dist/collection/components/molecules/tttx-textarea/tttx-textarea.stories.js +1 -1
- package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.js +1 -1
- package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.stories.js +37 -37
- package/dist/collection/components/molecules/tttx-tree-view/tttx-tree-view.js +3 -3
- package/dist/collection/components/molecules/tttx-tree-view/tttx-tree-view.stories.js +8 -8
- package/dist/collection/components/organisms/tttx-data-pattern/tttx-data-pattern.js +2 -2
- package/dist/collection/components/organisms/tttx-data-pattern/tttx-data-pattern.stories.js +5 -5
- package/dist/components/index.d.ts +26 -26
- package/dist/components/index.js +26 -26
- package/dist/components/tttx-button.js +5 -5
- package/dist/components/{tttx-button_1_2_0.d.ts → tttx-button_1_3_0.d.ts} +4 -4
- package/dist/components/{tttx-button_1_2_0.js → tttx-button_1_3_0.js} +2 -2
- package/dist/components/tttx-checkbox-group-caption_1_3_0.d.ts +11 -0
- package/dist/components/{tttx-checkbox-group-caption_1_2_0.js → tttx-checkbox-group-caption_1_3_0.js} +5 -5
- package/dist/components/tttx-checkbox-group-heading_1_3_0.d.ts +11 -0
- package/dist/components/{tttx-checkbox-group-heading_1_2_0.js → tttx-checkbox-group-heading_1_3_0.js} +5 -5
- package/dist/components/tttx-checkbox-group_1_3_0.d.ts +11 -0
- package/dist/components/{tttx-checkbox-group_1_2_0.js → tttx-checkbox-group_1_3_0.js} +5 -5
- package/dist/components/{tttx-textarea_1_2_0.d.ts → tttx-checkbox_1_3_0.d.ts} +4 -4
- package/dist/components/{tttx-checkbox_1_2_0.js → tttx-checkbox_1_3_0.js} +7 -7
- package/dist/components/tttx-data-pattern_1_3_0.d.ts +11 -0
- package/dist/components/{tttx-data-pattern_1_2_0.js → tttx-data-pattern_1_3_0.js} +13 -13
- package/dist/components/{tttx-dialog-box_1_2_0.d.ts → tttx-dialog-box_1_3_0.d.ts} +4 -4
- package/dist/components/{tttx-dialog-box_1_2_0.js → tttx-dialog-box_1_3_0.js} +9 -9
- package/dist/components/{tttx-filter_1_2_0.d.ts → tttx-dialog_1_3_0.d.ts} +4 -4
- package/dist/components/{tttx-dialog_1_2_0.js → tttx-dialog_1_3_0.js} +8 -8
- package/dist/components/{tttx-expander_1_2_0.d.ts → tttx-expander_1_3_0.d.ts} +4 -4
- package/dist/components/{tttx-expander_1_2_0.js → tttx-expander_1_3_0.js} +7 -7
- package/dist/components/tttx-filter.js +6 -6
- package/dist/components/{tttx-qrcode_1_2_0.d.ts → tttx-filter_1_3_0.d.ts} +4 -4
- package/dist/components/{tttx-filter_1_2_0.js → tttx-filter_1_3_0.js} +2 -2
- package/dist/components/{tttx-icon_1_2_0.d.ts → tttx-form_1_3_0.d.ts} +4 -4
- package/dist/components/{tttx-form_1_2_0.js → tttx-form_1_3_0.js} +166 -134
- package/dist/components/tttx-icon.js +3 -3
- package/dist/components/{tttx-list_1_2_0.d.ts → tttx-icon_1_3_0.d.ts} +4 -4
- package/dist/components/{tttx-icon_1_2_0.js → tttx-icon_1_3_0.js} +2 -2
- package/dist/components/tttx-keyvalue-block_1_3_0.d.ts +11 -0
- package/dist/components/{tttx-keyvalue-block_1_2_0.js → tttx-keyvalue-block_1_3_0.js} +5 -5
- package/dist/components/tttx-list.js +14 -7
- package/dist/components/{tttx-form_1_2_0.d.ts → tttx-list_1_3_0.d.ts} +4 -4
- package/dist/components/{tttx-list_1_2_0.js → tttx-list_1_3_0.js} +2 -2
- package/dist/components/tttx-loading-spinner_1_3_0.d.ts +11 -0
- package/dist/components/{tttx-loading-spinner_1_2_0.js → tttx-loading-spinner_1_3_0.js} +5 -5
- package/dist/components/tttx-multiselect-box_1_3_0.d.ts +11 -0
- package/dist/components/{tttx-multiselect-box_1_2_0.js → tttx-multiselect-box_1_3_0.js} +13 -13
- package/dist/components/tttx-percentage-bar_1_3_0.d.ts +11 -0
- package/dist/components/{tttx-percentage-bar_1_2_0.js → tttx-percentage-bar_1_3_0.js} +6 -6
- package/dist/components/{tttx-dialog_1_2_0.d.ts → tttx-qrcode_1_3_0.d.ts} +4 -4
- package/dist/components/{tttx-qrcode_1_2_0.js → tttx-qrcode_1_3_0.js} +5 -5
- package/dist/components/tttx-select-box.js +7 -7
- package/dist/components/tttx-select-box_1_3_0.d.ts +11 -0
- package/dist/components/{tttx-select-box_1_2_0.js → tttx-select-box_1_3_0.js} +2 -2
- package/dist/components/tttx-sorter.js +5 -5
- package/dist/components/tttx-sorter_1_3_0.d.ts +11 -0
- package/dist/components/{tttx-sorter_1_2_0.js → tttx-sorter_1_3_0.js} +2 -2
- package/dist/components/tttx-standalone-input.js +6 -6
- package/dist/components/tttx-standalone-input_1_3_0.d.ts +11 -0
- package/dist/components/{tttx-standalone-input_1_2_0.js → tttx-standalone-input_1_3_0.js} +2 -2
- package/dist/components/{tttx-tabs_1_2_0.d.ts → tttx-tabs_1_3_0.d.ts} +4 -4
- package/dist/components/{tttx-tabs_1_2_0.js → tttx-tabs_1_3_0.js} +9 -9
- package/dist/components/{tttx-tag_1_2_0.d.ts → tttx-tag_1_3_0.d.ts} +4 -4
- package/dist/components/{tttx-tag_1_2_0.js → tttx-tag_1_3_0.js} +5 -5
- package/dist/components/{tttx-checkbox_1_2_0.d.ts → tttx-textarea_1_3_0.d.ts} +4 -4
- package/dist/components/{tttx-textarea_1_2_0.js → tttx-textarea_1_3_0.js} +6 -6
- package/dist/components/tttx-toolbar.js +3 -3
- package/dist/components/{tttx-toolbar_1_2_0.d.ts → tttx-toolbar_1_3_0.d.ts} +4 -4
- package/dist/components/{tttx-toolbar_1_2_0.js → tttx-toolbar_1_3_0.js} +2 -2
- package/dist/components/{tttx-tree-view_1_2_0.d.ts → tttx-tree-view_1_3_0.d.ts} +4 -4
- package/dist/components/{tttx-tree-view_1_2_0.js → tttx-tree-view_1_3_0.js} +9 -9
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{tttx-button_1_2_0.entry.js → tttx-button_1_3_0.entry.js} +2 -2
- package/dist/esm/{tttx-checkbox-group-caption_1_2_0.entry.js → tttx-checkbox-group-caption_1_3_0.entry.js} +1 -1
- package/dist/esm/{tttx-checkbox-group-heading_1_2_0.entry.js → tttx-checkbox-group-heading_1_3_0.entry.js} +1 -1
- package/dist/esm/{tttx-checkbox-group_1_2_0.entry.js → tttx-checkbox-group_1_3_0.entry.js} +1 -1
- package/dist/esm/{tttx-checkbox_1_2_0.entry.js → tttx-checkbox_1_3_0.entry.js} +2 -2
- package/dist/esm/{tttx-data-pattern_1_2_0.entry.js → tttx-data-pattern_1_3_0.entry.js} +2 -2
- package/dist/esm/{tttx-dialog-box_1_2_0.entry.js → tttx-dialog-box_1_3_0.entry.js} +3 -3
- package/dist/esm/{tttx-dialog_1_2_0.entry.js → tttx-dialog_1_3_0.entry.js} +2 -2
- package/dist/esm/{tttx-expander_1_2_0.entry.js → tttx-expander_1_3_0.entry.js} +2 -2
- package/dist/esm/{tttx-filter_1_2_0_4.entry.js → tttx-filter_1_3_0_4.entry.js} +14 -7
- package/dist/esm/{tttx-form_1_2_0.entry.js → tttx-form_1_3_0.entry.js} +159 -127
- package/dist/esm/{tttx-icon_1_2_0.entry.js → tttx-icon_1_3_0.entry.js} +1 -1
- package/dist/esm/{tttx-keyvalue-block_1_2_0.entry.js → tttx-keyvalue-block_1_3_0.entry.js} +1 -1
- package/dist/esm/{tttx-loading-spinner_1_2_0.entry.js → tttx-loading-spinner_1_3_0.entry.js} +1 -1
- package/dist/esm/{tttx-multiselect-box_1_2_0.entry.js → tttx-multiselect-box_1_3_0.entry.js} +6 -6
- package/dist/esm/{tttx-percentage-bar_1_2_0.entry.js → tttx-percentage-bar_1_3_0.entry.js} +2 -2
- package/dist/esm/{tttx-qrcode_1_2_0.entry.js → tttx-qrcode_1_3_0.entry.js} +1 -1
- package/dist/esm/{tttx-select-box_1_2_0.entry.js → tttx-select-box_1_3_0.entry.js} +3 -3
- package/dist/esm/tttx-standalone-input_1_3_0.entry.js +90 -0
- package/dist/esm/{tttx-tabs_1_2_0.entry.js → tttx-tabs_1_3_0.entry.js} +4 -4
- package/dist/esm/{tttx-tag_1_2_0.entry.js → tttx-tag_1_3_0.entry.js} +1 -1
- package/dist/esm/{tttx-textarea_1_2_0.entry.js → tttx-textarea_1_3_0.entry.js} +2 -2
- package/dist/esm/{tttx-tree-view_1_2_0.entry.js → tttx-tree-view_1_3_0.entry.js} +3 -3
- package/dist/esm/tttx.js +1 -1
- package/dist/tttx/p-0e515960.entry.js +1 -1
- package/dist/tttx/p-1e5ff5f8.entry.js +1 -1
- package/dist/tttx/p-23f45005.entry.js +1 -1
- package/dist/tttx/p-3676cddd.entry.js +1 -0
- package/dist/tttx/p-56c8c353.entry.js +1 -1
- package/dist/tttx/p-59c7b049.entry.js +1 -1
- package/dist/tttx/p-5d2706b1.entry.js +1 -1
- package/dist/tttx/p-63ad6fb7.entry.js +1 -1
- package/dist/tttx/p-6b1c7a21.entry.js +1 -1
- package/dist/tttx/p-6deb8699.entry.js +1 -1
- package/dist/tttx/p-796f699a.entry.js +1 -1
- package/dist/tttx/p-81aaafa0.entry.js +1 -1
- package/dist/tttx/p-822ec9dc.entry.js +1 -0
- package/dist/tttx/p-884f37d3.entry.js +1 -1
- package/dist/tttx/p-9434561e.entry.js +1 -1
- package/dist/tttx/p-983d63ff.entry.js +1 -1
- package/dist/tttx/p-a01e679a.entry.js +1 -1
- package/dist/tttx/p-a8e76e78.entry.js +1 -1
- package/dist/tttx/p-c170e3b8.entry.js +1 -1
- package/dist/tttx/p-ee358ce4.entry.js +1 -1
- package/dist/tttx/p-f374e293.entry.js +1 -1
- package/dist/tttx/p-f4db1cf2.entry.js +1 -1
- package/dist/tttx/p-fe967031.entry.js +1 -1
- package/dist/tttx/tttx.esm.js +1 -1
- package/dist/types/components/molecules/tttx-form/lib/timecomparatorChecks.d.ts +4 -0
- package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +35 -14
- package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +2 -2
- package/dist/types/components/molecules/tttx-textarea/tttx-textarea.d.ts +2 -2
- package/dist/types/components.d.ts +305 -304
- package/package.json +2 -1
- package/dist/cjs/tttx-standalone-input_1_2_0.cjs.entry.js +0 -94
- package/dist/components/tttx-checkbox-group-caption_1_2_0.d.ts +0 -11
- package/dist/components/tttx-checkbox-group-heading_1_2_0.d.ts +0 -11
- package/dist/components/tttx-checkbox-group_1_2_0.d.ts +0 -11
- package/dist/components/tttx-data-pattern_1_2_0.d.ts +0 -11
- package/dist/components/tttx-keyvalue-block_1_2_0.d.ts +0 -11
- package/dist/components/tttx-loading-spinner_1_2_0.d.ts +0 -11
- package/dist/components/tttx-multiselect-box_1_2_0.d.ts +0 -11
- package/dist/components/tttx-percentage-bar_1_2_0.d.ts +0 -11
- package/dist/components/tttx-select-box_1_2_0.d.ts +0 -11
- package/dist/components/tttx-sorter_1_2_0.d.ts +0 -11
- package/dist/components/tttx-standalone-input_1_2_0.d.ts +0 -11
- package/dist/esm/tttx-standalone-input_1_2_0.entry.js +0 -90
- package/dist/tttx/p-34be6c6d.entry.js +0 -1
- package/dist/tttx/p-c8589436.entry.js +0 -1
|
@@ -119,7 +119,6 @@ function setErrorState(target, hasError, errorMessage, parent = undefined) {
|
|
|
119
119
|
errorBubble.innerHTML = '';
|
|
120
120
|
errorBubble.append(errorIcon);
|
|
121
121
|
errorBubble.append(errorMessage);
|
|
122
|
-
// errorBubble.replaceChildren(errorIcon, errorMessage);
|
|
123
122
|
}
|
|
124
123
|
// If no error was detected, remove the "invalid" class from the input field and clear the error bubble
|
|
125
124
|
else {
|
|
@@ -129,6 +128,70 @@ function setErrorState(target, hasError, errorMessage, parent = undefined) {
|
|
|
129
128
|
}
|
|
130
129
|
}
|
|
131
130
|
|
|
131
|
+
function startEndTimeComparator(event) {
|
|
132
|
+
var _a, _b;
|
|
133
|
+
const target = event.target;
|
|
134
|
+
const formKey = target.getAttribute('data-formkey');
|
|
135
|
+
const timeFields = Array.from(target.parentElement.parentElement.parentElement.querySelectorAll(`[data-formkey=${formKey}]`));
|
|
136
|
+
if (timeFields.length === 4) {
|
|
137
|
+
const startTime = timeFields.find(t => t.name.endsWith('starttime'));
|
|
138
|
+
const endTime = timeFields.find(t => t.name.endsWith('endtime'));
|
|
139
|
+
const startDate = timeFields.find(t => t.name.endsWith('startdate'));
|
|
140
|
+
const endDate = timeFields.find(t => t.name.endsWith('enddate'));
|
|
141
|
+
if (startTime.valueAsNumber >= endTime.valueAsNumber && ((_a = startDate.valueAsDate) === null || _a === void 0 ? void 0 : _a.valueOf()) === ((_b = endDate.valueAsDate) === null || _b === void 0 ? void 0 : _b.valueOf())) {
|
|
142
|
+
setErrorState(endTime, true, 'End time cannot be the same or before the start time');
|
|
143
|
+
if (target.name.endsWith('starttime')) {
|
|
144
|
+
this.validityCheckWrapper(event);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
// clear any end time comparitor errors and perform the standard validity check on the event
|
|
149
|
+
endTime.setCustomValidity('');
|
|
150
|
+
setErrorState(endTime, false, null);
|
|
151
|
+
this.validityCheckWrapper(event);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function clearTimeComparator(event) {
|
|
156
|
+
const target = event.target;
|
|
157
|
+
const formKey = target.getAttribute('data-formkey');
|
|
158
|
+
const timeFields = Array.from(target.parentElement.parentElement.parentElement.querySelectorAll(`[type=time][data-formkey=${formKey}]`));
|
|
159
|
+
if (timeFields.length) {
|
|
160
|
+
const endTime = timeFields.find(t => t.name.endsWith('endtime'));
|
|
161
|
+
endTime.setCustomValidity('');
|
|
162
|
+
setErrorState(endTime, false, null);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
function endDateComparisonValidator(event, triggeredByStartDate = false) {
|
|
166
|
+
var _a, _b, _c, _d;
|
|
167
|
+
const endDate = event.target;
|
|
168
|
+
if (!endDate.value && triggeredByStartDate) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
const compareWithName = endDate.getAttribute('data-compare-with');
|
|
172
|
+
const startDate = endDate.parentElement.parentElement.parentElement.querySelector(`[name=${compareWithName}]`);
|
|
173
|
+
if (((_a = endDate.valueAsDate) === null || _a === void 0 ? void 0 : _a.valueOf()) < ((_b = startDate.valueAsDate) === null || _b === void 0 ? void 0 : _b.valueOf())) {
|
|
174
|
+
endDate.setCustomValidity(endDate.getAttribute('data-compare'));
|
|
175
|
+
setErrorState(endDate, true, endDate.getAttribute('data-compare'));
|
|
176
|
+
}
|
|
177
|
+
else if (((_c = endDate.valueAsDate) === null || _c === void 0 ? void 0 : _c.valueOf()) === ((_d = startDate.valueAsDate) === null || _d === void 0 ? void 0 : _d.valueOf())) {
|
|
178
|
+
endDate.setCustomValidity('');
|
|
179
|
+
this.validityCheckWrapper(event);
|
|
180
|
+
startEndTimeComparator.bind(this)(event);
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
clearTimeComparator.bind(this)(event);
|
|
184
|
+
this.validityCheckWrapper(event);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
function startDateComparisonValidator(event) {
|
|
188
|
+
const startDate = event.target;
|
|
189
|
+
const compareToName = startDate.getAttribute('data-compare-to');
|
|
190
|
+
const endDate = startDate.parentElement.parentElement.parentElement.querySelector(`[name=${compareToName}]`);
|
|
191
|
+
endDateComparisonValidator.bind(this)({ target: endDate }, true);
|
|
192
|
+
this.validityCheckWrapper(event);
|
|
193
|
+
}
|
|
194
|
+
|
|
132
195
|
const tttxFormCss = ".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:18.752px;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:18.752px}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:16.408px;font-weight:normal;display:flex;margin-top:4px}label .errorBubble{position:relative;font-size:14px;line-height:16.408px;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:346px;box-sizing:border-box}label>.outer-container>input[type=date]{min-width:0;width:200px}label.flex-label input[type=time]{min-width:auto;text-align:center;width:130px;margin-left:16px}label>.outer-container>input[type=date],label.flex-label input[type=time]{line-height:36px}";
|
|
133
196
|
|
|
134
197
|
const TttxForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
@@ -145,13 +208,6 @@ const TttxForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
145
208
|
}
|
|
146
209
|
// This method is called whenever the "formschema" property changes
|
|
147
210
|
onFormSchemaChange(newValue) {
|
|
148
|
-
// If the formSchema changes and the form data is uncontrolled, store the data since the fields will be removed to avoid form duplication
|
|
149
|
-
if (!this.data && this.form && this._formSchema) {
|
|
150
|
-
const formData = new FormData(this.form);
|
|
151
|
-
this._data = Object.fromEntries(Object.keys(this._formSchema.properties).map(formKey => {
|
|
152
|
-
return [formKey, formData.get(formKey)];
|
|
153
|
-
}));
|
|
154
|
-
}
|
|
155
211
|
// Check if the new value is a string, indicating that it needs to be parsed
|
|
156
212
|
if (typeof newValue === 'string') {
|
|
157
213
|
// Parse the string and set the "_formSchema" property
|
|
@@ -161,6 +217,7 @@ const TttxForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
161
217
|
// If the new value is already an object, set the "_formSchema" property directly
|
|
162
218
|
this._formSchema = newValue;
|
|
163
219
|
}
|
|
220
|
+
return this._formSchema;
|
|
164
221
|
}
|
|
165
222
|
onDataChange(newValue) {
|
|
166
223
|
if (typeof newValue === 'string') {
|
|
@@ -169,6 +226,7 @@ const TttxForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
169
226
|
else {
|
|
170
227
|
this._data = newValue;
|
|
171
228
|
}
|
|
229
|
+
return this._data;
|
|
172
230
|
}
|
|
173
231
|
/**
|
|
174
232
|
* Handles the focus event for a form field and emits a "dataChanged" event
|
|
@@ -208,7 +266,6 @@ const TttxForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
208
266
|
}
|
|
209
267
|
select.replaceChildren(fragment);
|
|
210
268
|
tttxSelect.optionsData = options;
|
|
211
|
-
//await tttxSelect.setOptionsData(options);
|
|
212
269
|
await tttxSelect.setSelectedItem(options[0].value);
|
|
213
270
|
}
|
|
214
271
|
/**
|
|
@@ -266,9 +323,10 @@ const TttxForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
266
323
|
formProperties.options.forEach(optionProperties => {
|
|
267
324
|
this.appendOption(select, optionProperties);
|
|
268
325
|
});
|
|
269
|
-
if ((_a = this._data) === null || _a === void 0 ? void 0 : _a[formKey])
|
|
326
|
+
if ((_a = this._data) === null || _a === void 0 ? void 0 : _a[formKey]) {
|
|
270
327
|
select.classList.remove('placeholder');
|
|
271
|
-
|
|
328
|
+
}
|
|
329
|
+
const tttxSelect = document.createElement('tttx-select-box_1_3_0');
|
|
272
330
|
tttxSelect.optionsData = (_b = formProperties.options) === null || _b === void 0 ? void 0 : _b.filter(o => !o.placeholder);
|
|
273
331
|
tttxSelect.placeholder = (_d = (_c = formProperties.options) === null || _c === void 0 ? void 0 : _c.filter(o => o.placeholder)[0]) === null || _d === void 0 ? void 0 : _d.label;
|
|
274
332
|
tttxSelect.inline = false;
|
|
@@ -279,13 +337,18 @@ const TttxForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
279
337
|
const fragment = document.createDocumentFragment();
|
|
280
338
|
fragment.append(tttxSelect);
|
|
281
339
|
select.style.display = 'none';
|
|
282
|
-
tttxSelect.addEventListener('selectItemEvent',
|
|
283
|
-
select.value = ev.detail.value;
|
|
284
|
-
select.onblur({ target: select }); // triggers validator
|
|
285
|
-
select.onchange({ target: select }); // triggers dataChanged event
|
|
286
|
-
});
|
|
340
|
+
tttxSelect.addEventListener('selectItemEvent', this.selectItemEventCallback.bind(select));
|
|
287
341
|
return { input: select, overlay: fragment };
|
|
288
342
|
}
|
|
343
|
+
selectItemEventCallback(ev) {
|
|
344
|
+
// this function MUST be bound to a HTMLSelectElement
|
|
345
|
+
// 'this' will be the select element
|
|
346
|
+
// the function was split out for testing
|
|
347
|
+
const select = this;
|
|
348
|
+
select.value = ev.detail.value;
|
|
349
|
+
select.onblur({ target: select }); // triggers validator
|
|
350
|
+
select.onchange({ target: select }); // triggers dataChanged event
|
|
351
|
+
}
|
|
289
352
|
/**
|
|
290
353
|
* Appends an option to a select element
|
|
291
354
|
*
|
|
@@ -516,7 +579,7 @@ const TttxForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
516
579
|
* @param {HTMLDivElement} errorBubble - The error bubble element to display error messages in.
|
|
517
580
|
* @return {HTMLLabelElement} - The new label element.
|
|
518
581
|
*/
|
|
519
|
-
createLabel(formProperties, input, overlay, errorBubble) {
|
|
582
|
+
createLabel(formProperties, input, overlay = null, errorBubble) {
|
|
520
583
|
var _a;
|
|
521
584
|
const outerContainer = document.createElement('div');
|
|
522
585
|
let outerContainerClassName = 'outer-container inputBlock';
|
|
@@ -567,7 +630,7 @@ const TttxForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
567
630
|
*/
|
|
568
631
|
createRadio(formKey, formProperties) {
|
|
569
632
|
var _a, _b;
|
|
570
|
-
const fragment =
|
|
633
|
+
const fragment = document.createDocumentFragment();
|
|
571
634
|
for (const optionProperties of formProperties.options) {
|
|
572
635
|
// Create a new <input> element with the specified name and type
|
|
573
636
|
const input = document.createElement('input');
|
|
@@ -597,8 +660,9 @@ const TttxForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
597
660
|
populateFormFromSchema() {
|
|
598
661
|
var _a;
|
|
599
662
|
// If there is no form schema, return early
|
|
600
|
-
if (!this._formSchema)
|
|
663
|
+
if (!this._formSchema) {
|
|
601
664
|
return;
|
|
665
|
+
}
|
|
602
666
|
// Get the properties of the form schema and their keys
|
|
603
667
|
const properties = this._formSchema.properties;
|
|
604
668
|
const propertyKeys = Object.keys(properties);
|
|
@@ -666,129 +730,97 @@ const TttxForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
666
730
|
const properties = this._formSchema.properties;
|
|
667
731
|
const propertyKeys = Object.keys(properties);
|
|
668
732
|
for (const formKey of propertyKeys) {
|
|
669
|
-
|
|
670
|
-
for (const formInput of formItemsByKey) {
|
|
671
|
-
// Bind events to form input elements
|
|
672
|
-
formInput.oninvalid = this.validityCheckWrapper.bind(this);
|
|
673
|
-
formInput.onblur = this.validityCheckWrapper.bind(this);
|
|
674
|
-
formInput.onkeyup = this.fieldChanged.bind(this);
|
|
675
|
-
formInput.onchange = this.fieldChanged.bind(this);
|
|
676
|
-
if (properties[formKey].form.type === 'select' && formInput.classList.contains('placeholder')) {
|
|
677
|
-
formInput.addEventListener('change', () => {
|
|
678
|
-
formInput.classList.remove('placeholder');
|
|
679
|
-
});
|
|
680
|
-
}
|
|
681
|
-
if (properties[formKey].form.type === 'startenddate' && formInput.hasAttribute('data-compare-with')) {
|
|
682
|
-
formInput.oninvalid = this.endDateComparisonValidator.bind(this);
|
|
683
|
-
formInput.onblur = this.endDateComparisonValidator.bind(this);
|
|
684
|
-
}
|
|
685
|
-
if (properties[formKey].form.type === 'startenddate' && formInput.type === 'time') {
|
|
686
|
-
formInput.oninvalid = this.startEndTimeComparitor.bind(this);
|
|
687
|
-
formInput.onblur = this.startEndTimeComparitor.bind(this);
|
|
688
|
-
}
|
|
689
|
-
if (properties[formKey].form.type === 'startenddate' && formInput.hasAttribute('data-compare-to')) {
|
|
690
|
-
formInput.oninvalid = this.startDateComparisonValidator.bind(this);
|
|
691
|
-
formInput.onblur = this.startDateComparisonValidator.bind(this);
|
|
692
|
-
}
|
|
693
|
-
}
|
|
733
|
+
this.applyValidationFunctionsToFormElement(formItems, formKey, properties);
|
|
694
734
|
}
|
|
695
735
|
// populate with existing form data if available
|
|
696
|
-
if (this._data && Object.keys(this._data).length > 0) {
|
|
697
|
-
|
|
698
|
-
for (const key of dataKeys) {
|
|
699
|
-
const formItemsByKey = formItems.querySelectorAll(`[name=${key}]`);
|
|
700
|
-
for (const formItem of formItemsByKey) {
|
|
701
|
-
switch (formItem.type) {
|
|
702
|
-
case 'checkbox':
|
|
703
|
-
if (this._data[key] === 'on') {
|
|
704
|
-
formItem.checked = true;
|
|
705
|
-
}
|
|
706
|
-
break;
|
|
707
|
-
case 'radio':
|
|
708
|
-
if (formItem.value === this._data[key]) {
|
|
709
|
-
formItem.checked = true;
|
|
710
|
-
}
|
|
711
|
-
break;
|
|
712
|
-
case 'select':
|
|
713
|
-
case 'select-one':
|
|
714
|
-
formItems.querySelector(`[name=overlay-${key}]`).selectedValue = this._data[key];
|
|
715
|
-
formItem.value = this._data[key];
|
|
716
|
-
break;
|
|
717
|
-
default:
|
|
718
|
-
formItem.value = this._data[key];
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
}
|
|
736
|
+
if ((this._data && Object.keys(this._data).length > 0)) {
|
|
737
|
+
this.populateFormWithExistingData(formItems);
|
|
722
738
|
}
|
|
723
739
|
// Append the cloned form elements to the fieldset
|
|
724
740
|
this.fieldset.replaceChildren(formItems);
|
|
725
741
|
}
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
742
|
+
/**
|
|
743
|
+
* Assign validation events to a given form item
|
|
744
|
+
* @param formItems The document fragment template of form items to be rendered
|
|
745
|
+
* @param formKey The key of the form item to bind events too
|
|
746
|
+
* @param properties The form item's properties, such as type and name
|
|
747
|
+
*/
|
|
748
|
+
applyValidationFunctionsToFormElement(formItems, formKey, properties) {
|
|
749
|
+
const formItemsByKey = formItems.querySelectorAll(`[name^=${formKey}]`);
|
|
750
|
+
for (const formInput of formItemsByKey) {
|
|
751
|
+
// Bind events to form input elements
|
|
752
|
+
formInput.oninvalid = this.validityCheckWrapper.bind(this);
|
|
753
|
+
formInput.onblur = this.validityCheckWrapper.bind(this);
|
|
754
|
+
formInput.onkeyup = this.fieldChanged.bind(this);
|
|
755
|
+
formInput.onchange = this.fieldChanged.bind(this);
|
|
756
|
+
if (properties[formKey].form.type === 'select' && formInput.classList.contains('placeholder')) {
|
|
757
|
+
formInput.addEventListener('change', this.selectRemovePlaceholderCallback.bind(formInput));
|
|
741
758
|
}
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
759
|
+
if (properties[formKey].form.type === 'startenddate' && formInput.hasAttribute('data-compare-with')) {
|
|
760
|
+
formInput.oninvalid = endDateComparisonValidator.bind(this);
|
|
761
|
+
formInput.onblur = endDateComparisonValidator.bind(this);
|
|
762
|
+
}
|
|
763
|
+
if (properties[formKey].form.type === 'startenddate' && formInput.type === 'time') {
|
|
764
|
+
formInput.oninvalid = startEndTimeComparator.bind(this);
|
|
765
|
+
formInput.onblur = startEndTimeComparator.bind(this);
|
|
766
|
+
}
|
|
767
|
+
if (properties[formKey].form.type === 'startenddate' && formInput.hasAttribute('data-compare-to')) {
|
|
768
|
+
formInput.oninvalid = startDateComparisonValidator.bind(this);
|
|
769
|
+
formInput.onblur = startDateComparisonValidator.bind(this);
|
|
747
770
|
}
|
|
748
771
|
}
|
|
749
772
|
}
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
773
|
+
/**
|
|
774
|
+
* If data exists, set form input values before rendering
|
|
775
|
+
* @param formItems The document fragment template of form items to be rendered
|
|
776
|
+
*/
|
|
777
|
+
populateFormWithExistingData(formItems) {
|
|
778
|
+
const dataKeys = Object.keys(this._data);
|
|
779
|
+
for (const key of dataKeys) {
|
|
780
|
+
const formItemsByKey = formItems.querySelectorAll(`[name=${key}]`);
|
|
781
|
+
for (const formItem of formItemsByKey) {
|
|
782
|
+
switch (formItem.type) {
|
|
783
|
+
case 'checkbox':
|
|
784
|
+
if (this._data[key] === 'on') {
|
|
785
|
+
formItem.checked = true;
|
|
786
|
+
}
|
|
787
|
+
break;
|
|
788
|
+
case 'radio':
|
|
789
|
+
if (formItem.value === this._data[key]) {
|
|
790
|
+
formItem.checked = true;
|
|
791
|
+
}
|
|
792
|
+
break;
|
|
793
|
+
case 'select':
|
|
794
|
+
case 'select-one':
|
|
795
|
+
formItems.querySelector(`[name=overlay-${key}]`)['selectedValue'] = this._data[key];
|
|
796
|
+
formItem.value = this._data[key];
|
|
797
|
+
break;
|
|
798
|
+
default:
|
|
799
|
+
formItem.value = this._data[key];
|
|
800
|
+
}
|
|
801
|
+
}
|
|
758
802
|
}
|
|
759
803
|
}
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
}
|
|
767
|
-
endDateComparisonValidator(event, triggeredByStartDate = false) {
|
|
768
|
-
var _a, _b, _c, _d;
|
|
769
|
-
const endDate = event.target;
|
|
770
|
-
if (!endDate.value && triggeredByStartDate)
|
|
771
|
-
return;
|
|
772
|
-
const compareWithName = endDate.getAttribute('data-compare-with');
|
|
773
|
-
const startDate = endDate.parentElement.parentElement.parentElement.querySelector(`[name=${compareWithName}]`);
|
|
774
|
-
if (((_a = endDate.valueAsDate) === null || _a === void 0 ? void 0 : _a.valueOf()) < ((_b = startDate.valueAsDate) === null || _b === void 0 ? void 0 : _b.valueOf())) {
|
|
775
|
-
endDate.setCustomValidity(endDate.getAttribute('data-compare'));
|
|
776
|
-
setErrorState(endDate, true, endDate.getAttribute('data-compare'));
|
|
777
|
-
}
|
|
778
|
-
else if (((_c = endDate.valueAsDate) === null || _c === void 0 ? void 0 : _c.valueOf()) === ((_d = startDate.valueAsDate) === null || _d === void 0 ? void 0 : _d.valueOf())) {
|
|
779
|
-
endDate.setCustomValidity('');
|
|
780
|
-
this.validityCheckWrapper(event);
|
|
781
|
-
this.startEndTimeComparitor(event);
|
|
782
|
-
}
|
|
783
|
-
else {
|
|
784
|
-
this.clearTimeComparitor(event);
|
|
785
|
-
this.validityCheckWrapper(event);
|
|
786
|
-
}
|
|
804
|
+
/**
|
|
805
|
+
* Remove the placeholder class on the bound THIS select element
|
|
806
|
+
*/
|
|
807
|
+
selectRemovePlaceholderCallback() {
|
|
808
|
+
const select = this;
|
|
809
|
+
select.classList.remove('placeholder');
|
|
787
810
|
}
|
|
811
|
+
/**
|
|
812
|
+
* A wrapper around validity check and set error state
|
|
813
|
+
*/
|
|
788
814
|
validityCheckWrapper(event) {
|
|
789
815
|
const { target, hasError, errorMessage } = validityCheck(event);
|
|
790
816
|
setErrorState(target, hasError, errorMessage);
|
|
791
817
|
}
|
|
818
|
+
assignFieldsetReference(el) {
|
|
819
|
+
this.fieldset = el;
|
|
820
|
+
}
|
|
821
|
+
assignButtonReference(el) {
|
|
822
|
+
this.submitButton = el;
|
|
823
|
+
}
|
|
792
824
|
/**
|
|
793
825
|
* Renders the component's template as a form element with a fieldset container. The form's
|
|
794
826
|
* "onSubmit" event is bound to the "doSubmit" function, which handles the form submission
|
|
@@ -797,14 +829,14 @@ const TttxForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
797
829
|
* later on.
|
|
798
830
|
*/
|
|
799
831
|
render() {
|
|
800
|
-
return (h(Host, null, h("form", {
|
|
832
|
+
return (h(Host, null, h("form", { onSubmit: this.doSubmit.bind(this) }, h("fieldset", { ref: this.assignFieldsetReference.bind(this) }), h("input", { type: "submit", ref: this.assignButtonReference.bind(this), style: { display: 'none' } }))));
|
|
801
833
|
}
|
|
802
834
|
static get watchers() { return {
|
|
803
835
|
"formschema": ["onFormSchemaChange"],
|
|
804
836
|
"data": ["onDataChange"]
|
|
805
837
|
}; }
|
|
806
838
|
static get style() { return tttxFormCss; }
|
|
807
|
-
}, [1, "tttx-
|
|
839
|
+
}, [1, "tttx-form_1_3_0", {
|
|
808
840
|
"formschema": [1025],
|
|
809
841
|
"data": [1032],
|
|
810
842
|
"submit": [64],
|
|
@@ -814,24 +846,24 @@ function defineCustomElement$1() {
|
|
|
814
846
|
if (typeof customElements === "undefined") {
|
|
815
847
|
return;
|
|
816
848
|
}
|
|
817
|
-
const components = ["tttx-
|
|
849
|
+
const components = ["tttx-form_1_3_0", "tttx-icon_1_3_0", "tttx-select-box_1_3_0", "tttx-standalone-input_1_3_0"];
|
|
818
850
|
components.forEach(tagName => { switch (tagName) {
|
|
819
|
-
case "tttx-
|
|
851
|
+
case "tttx-form_1_3_0":
|
|
820
852
|
if (!customElements.get(tagName)) {
|
|
821
853
|
customElements.define(tagName, TttxForm);
|
|
822
854
|
}
|
|
823
855
|
break;
|
|
824
|
-
case "tttx-
|
|
856
|
+
case "tttx-icon_1_3_0":
|
|
825
857
|
if (!customElements.get(tagName)) {
|
|
826
858
|
defineCustomElement$4();
|
|
827
859
|
}
|
|
828
860
|
break;
|
|
829
|
-
case "tttx-select-
|
|
861
|
+
case "tttx-select-box_1_3_0":
|
|
830
862
|
if (!customElements.get(tagName)) {
|
|
831
863
|
defineCustomElement$3();
|
|
832
864
|
}
|
|
833
865
|
break;
|
|
834
|
-
case "tttx-standalone-
|
|
866
|
+
case "tttx-standalone-input_1_3_0":
|
|
835
867
|
if (!customElements.get(tagName)) {
|
|
836
868
|
defineCustomElement$2();
|
|
837
869
|
}
|
|
@@ -839,7 +871,7 @@ function defineCustomElement$1() {
|
|
|
839
871
|
} });
|
|
840
872
|
}
|
|
841
873
|
|
|
842
|
-
const
|
|
874
|
+
const TttxForm_1_3_0 = TttxForm;
|
|
843
875
|
const defineCustomElement = defineCustomElement$1;
|
|
844
876
|
|
|
845
|
-
export {
|
|
877
|
+
export { TttxForm_1_3_0, defineCustomElement };
|
|
@@ -27,7 +27,7 @@ const TttxIcon = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
27
27
|
}
|
|
28
28
|
get element() { return this; }
|
|
29
29
|
static get style() { return tttxIconCss; }
|
|
30
|
-
}, [1, "tttx-
|
|
30
|
+
}, [1, "tttx-icon_1_3_0", {
|
|
31
31
|
"icon": [1],
|
|
32
32
|
"color": [1],
|
|
33
33
|
"size": [1026]
|
|
@@ -36,9 +36,9 @@ function defineCustomElement() {
|
|
|
36
36
|
if (typeof customElements === "undefined") {
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
|
-
const components = ["tttx-
|
|
39
|
+
const components = ["tttx-icon_1_3_0"];
|
|
40
40
|
components.forEach(tagName => { switch (tagName) {
|
|
41
|
-
case "tttx-
|
|
41
|
+
case "tttx-icon_1_3_0":
|
|
42
42
|
if (!customElements.get(tagName)) {
|
|
43
43
|
customElements.define(tagName, TttxIcon);
|
|
44
44
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Components, JSX } from "../types/components";
|
|
2
2
|
|
|
3
|
-
interface
|
|
4
|
-
export const
|
|
5
|
-
prototype:
|
|
6
|
-
new ():
|
|
3
|
+
interface TttxIcon_1_3_0 extends Components.TttxIcon_1_3_0, HTMLElement {}
|
|
4
|
+
export const TttxIcon_1_3_0: {
|
|
5
|
+
prototype: TttxIcon_1_3_0;
|
|
6
|
+
new (): TttxIcon_1_3_0;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
9
|
* Used to define this component and all nested components recursively.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { T as TttxIcon, d as defineCustomElement$1 } from './tttx-icon.js';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const TttxIcon_1_3_0 = TttxIcon;
|
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|
|
5
5
|
|
|
6
|
-
export {
|
|
6
|
+
export { TttxIcon_1_3_0, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface TttxKeyvalueBlock_1_3_0 extends Components.TttxKeyvalueBlock_1_3_0, HTMLElement {}
|
|
4
|
+
export const TttxKeyvalueBlock_1_3_0: {
|
|
5
|
+
prototype: TttxKeyvalueBlock_1_3_0;
|
|
6
|
+
new (): TttxKeyvalueBlock_1_3_0;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -65,7 +65,7 @@ const TttxKeyvalueBlock = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
65
65
|
return (h(Host, null, h("dl", { class: [this.horizontal ? 'horizontal' : undefined, this.spacedout ? ' spacedout' : undefined].join(' ').trim() }, this._elements)));
|
|
66
66
|
}
|
|
67
67
|
static get style() { return tttxKeyvalueBlockCss; }
|
|
68
|
-
}, [1, "tttx-keyvalue-
|
|
68
|
+
}, [1, "tttx-keyvalue-block_1_3_0", {
|
|
69
69
|
"keyvalues": [1],
|
|
70
70
|
"horizontal": [4],
|
|
71
71
|
"spacedout": [4],
|
|
@@ -75,9 +75,9 @@ function defineCustomElement$1() {
|
|
|
75
75
|
if (typeof customElements === "undefined") {
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
|
-
const components = ["tttx-keyvalue-
|
|
78
|
+
const components = ["tttx-keyvalue-block_1_3_0"];
|
|
79
79
|
components.forEach(tagName => { switch (tagName) {
|
|
80
|
-
case "tttx-keyvalue-
|
|
80
|
+
case "tttx-keyvalue-block_1_3_0":
|
|
81
81
|
if (!customElements.get(tagName)) {
|
|
82
82
|
customElements.define(tagName, TttxKeyvalueBlock);
|
|
83
83
|
}
|
|
@@ -85,7 +85,7 @@ function defineCustomElement$1() {
|
|
|
85
85
|
} });
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
const
|
|
88
|
+
const TttxKeyvalueBlock_1_3_0 = TttxKeyvalueBlock;
|
|
89
89
|
const defineCustomElement = defineCustomElement$1;
|
|
90
90
|
|
|
91
|
-
export {
|
|
91
|
+
export { TttxKeyvalueBlock_1_3_0, defineCustomElement };
|
|
@@ -47,10 +47,17 @@ const TttxList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
47
47
|
this.rowClick.emit({ key: item.key, name: this.name, data: item.rowData });
|
|
48
48
|
}
|
|
49
49
|
renderListItem(item) {
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
let element;
|
|
51
|
+
if (typeof item.element === 'string') {
|
|
52
|
+
const cleanHTML = purify.sanitize(item.element, domSanitiserOptions);
|
|
53
|
+
element = h("span", { class: "item-content", innerHTML: cleanHTML });
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
element = h("span", { class: "item-content" }, item.element);
|
|
57
|
+
}
|
|
58
|
+
return (h(Fragment, null, item.hasCheckbox && (h("div", { class: "checkbox" }, h("tttx-icon_1_3_0", { icon: item.checked ? 'check_box' : 'check_box_outline_blank', color: item.checked ? 'blue' : 'grey', onClick: event => {
|
|
52
59
|
this.onRowCheckboxHandler(event, item);
|
|
53
|
-
} }))), item.element &&
|
|
60
|
+
} }))), item.element && element, item.icon && (h("span", { class: "icons" }, h("tttx-icon_1_3_0", { class: "align-right", icon: item.icon, color: 'black' })))));
|
|
54
61
|
}
|
|
55
62
|
render() {
|
|
56
63
|
if (!this._data)
|
|
@@ -67,7 +74,7 @@ const TttxList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
67
74
|
"data": ["onDataChange"]
|
|
68
75
|
}; }
|
|
69
76
|
static get style() { return tttxListCss; }
|
|
70
|
-
}, [1, "tttx-
|
|
77
|
+
}, [1, "tttx-list_1_3_0", {
|
|
71
78
|
"data": [1025],
|
|
72
79
|
"name": [1],
|
|
73
80
|
"_data": [32]
|
|
@@ -76,14 +83,14 @@ function defineCustomElement() {
|
|
|
76
83
|
if (typeof customElements === "undefined") {
|
|
77
84
|
return;
|
|
78
85
|
}
|
|
79
|
-
const components = ["tttx-
|
|
86
|
+
const components = ["tttx-list_1_3_0", "tttx-icon_1_3_0"];
|
|
80
87
|
components.forEach(tagName => { switch (tagName) {
|
|
81
|
-
case "tttx-
|
|
88
|
+
case "tttx-list_1_3_0":
|
|
82
89
|
if (!customElements.get(tagName)) {
|
|
83
90
|
customElements.define(tagName, TttxList);
|
|
84
91
|
}
|
|
85
92
|
break;
|
|
86
|
-
case "tttx-
|
|
93
|
+
case "tttx-icon_1_3_0":
|
|
87
94
|
if (!customElements.get(tagName)) {
|
|
88
95
|
defineCustomElement$1();
|
|
89
96
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Components, JSX } from "../types/components";
|
|
2
2
|
|
|
3
|
-
interface
|
|
4
|
-
export const
|
|
5
|
-
prototype:
|
|
6
|
-
new ():
|
|
3
|
+
interface TttxList_1_3_0 extends Components.TttxList_1_3_0, HTMLElement {}
|
|
4
|
+
export const TttxList_1_3_0: {
|
|
5
|
+
prototype: TttxList_1_3_0;
|
|
6
|
+
new (): TttxList_1_3_0;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
9
|
* Used to define this component and all nested components recursively.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { T as TttxList, d as defineCustomElement$1 } from './tttx-list.js';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const TttxList_1_3_0 = TttxList;
|
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|
|
5
5
|
|
|
6
|
-
export {
|
|
6
|
+
export { TttxList_1_3_0, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface TttxLoadingSpinner_1_3_0 extends Components.TttxLoadingSpinner_1_3_0, HTMLElement {}
|
|
4
|
+
export const TttxLoadingSpinner_1_3_0: {
|
|
5
|
+
prototype: TttxLoadingSpinner_1_3_0;
|
|
6
|
+
new (): TttxLoadingSpinner_1_3_0;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|