@3t-transform/threeteeui 0.2.73 → 0.2.75
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-multiselect-box.cjs.entry.js +130 -0
- package/dist/cjs/tttx-select-box.cjs.entry.js +1 -1
- package/dist/cjs/tttx.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/molecules/tttx-multiselect-box/tttx-multiselect-box.css +135 -0
- package/dist/collection/components/molecules/tttx-multiselect-box/tttx-multiselect-box.js +339 -0
- package/dist/collection/components/molecules/tttx-multiselect-box/tttx-multiselect-box.stories.js +201 -0
- package/dist/collection/components/molecules/tttx-select-box/tttx-select-box.css +2 -1
- package/dist/collection/components/molecules/tttx-select-box/tttx-select-box.stories.js +10 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/tttx-multiselect-box.d.ts +11 -0
- package/dist/components/tttx-multiselect-box.js +172 -0
- package/dist/components/tttx-select-box.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tttx-multiselect-box.entry.js +126 -0
- package/dist/esm/tttx-select-box.entry.js +1 -1
- package/dist/esm/tttx.js +1 -1
- package/dist/tttx/p-77fed2a6.entry.js +1 -0
- package/dist/tttx/{p-d9444b12.entry.js → p-887f56cb.entry.js} +1 -1
- package/dist/tttx/tttx.esm.js +1 -1
- package/dist/types/components/molecules/tttx-multiselect-box/interfaces.d.ts +6 -0
- package/dist/types/components/molecules/tttx-multiselect-box/tttx-multiselect-box.d.ts +38 -0
- package/dist/types/components/molecules/tttx-multiselect-box/tttx-multiselect-box.stories.d.ts +15 -0
- package/dist/types/components.d.ts +39 -4
- package/package.json +1 -1
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -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-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],"treeData":[32]}]]],["tttx-filter.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"]]]]],["tttx-list.cjs",[[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32]}]]],["tttx-sorter.cjs",[[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"]]]]],["tttx-tabs.cjs",[[2,"tttx-tabs",{"tabsName":[1,"tabs-name"],"navigation":[4],"wide":[4],"tabs":[1],"_tabs":[32]},[[0,"keydown","handleKeyDown"]]]]],["tttx-form.cjs",[[1,"tttx-form",{"formschema":[1032],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block.cjs",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-qrcode.cjs",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag.cjs",[[1,"tttx-tag",{"text":[1],"color":[1]}]]],["tttx-toolbar.cjs",[[1,"tttx-toolbar",{"border":[4],"viewSize":[32]},[[9,"resize","handleResize"]]]]],["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-button.cjs",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
|
|
17
|
+
return index.bootstrapLazy([["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],"treeData":[32]}]]],["tttx-filter.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"]]]]],["tttx-list.cjs",[[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32]}]]],["tttx-sorter.cjs",[[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"]]]]],["tttx-tabs.cjs",[[2,"tttx-tabs",{"tabsName":[1,"tabs-name"],"navigation":[4],"wide":[4],"tabs":[1],"_tabs":[32]},[[0,"keydown","handleKeyDown"]]]]],["tttx-form.cjs",[[1,"tttx-form",{"formschema":[1032],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block.cjs",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-qrcode.cjs",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag.cjs",[[1,"tttx-tag",{"text":[1],"color":[1]}]]],["tttx-toolbar.cjs",[[1,"tttx-toolbar",{"border":[4],"viewSize":[32]},[[9,"resize","handleResize"]]]]],["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-button.cjs",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-4cfa8e25.js');
|
|
6
|
+
const domsanitiser_options = require('./domsanitiser.options-1dfa7205.js');
|
|
7
|
+
require('./_commonjsHelpers-537d719a.js');
|
|
8
|
+
|
|
9
|
+
const tttxMultiselectBoxCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}:host{display:flex;gap:4px}.label{font-size:16px;font-style:normal;font-weight:500;line-height:normal}:host(.inline) .label{padding-top:8px}:host(.block){flex-direction:column}.dropdown-container{display:grid;position:relative;display:flex;flex-direction:column;width:100%}.dropdown-container:focus-visible{outline:none}.dropdown-container:focus .dropdown-selector{border:1px solid #1479c6}.dropdown-selector,.dropdown-body{display:flex;border-radius:4px;background-color:white}.dropdown-selector{grid-row:1;align-items:center;gap:8px;padding:6px 8px 6px 16px;cursor:pointer;border:1px solid #d5d5d5}.dropdown-selector-chevron{margin-left:auto;height:24px}.dropdown-selector-chevron>tttx-icon{cursor:pointer}.dropdown-selector-html-content{display:flex;gap:8px;flex-wrap:wrap}.dropdown-body-container{grid-row:2;position:relative}.dropdown-body{position:absolute;display:flex;position:absolute;flex-direction:column;box-shadow:0px 1px 5px #1111114D;padding-bottom:8px;border:1px solid #d5d5d5;width:100%}.dropdown-options-list{display:flex;flex-direction:column;overflow-y:auto;scrollbar-gutter:stable;max-height:288px}.dropdown-option{padding:6px 8px 6px 16px;cursor:pointer;display:flex;gap:8px}.dropdown-option .checkbox-icon{height:24px}.dropdown-option .plaintext-option{line-height:24px}.dropdown-option:hover{background-color:#1111110d}.dropdown-option:active,.dropdown-option.selected{background-color:#ebfbfc}.placeholder{color:#9e9e9e}.searchbox{padding:8px 16px 8px 16px;height:52px;box-sizing:border-box}.searchbox tttx-standalone-input{margin-top:-4px}.hidden{display:none}.footer{display:flex;gap:8px;flex-direction:row-reverse;padding:8px 16px 0 16px;border-top:1px solid #d5d5d5}";
|
|
10
|
+
|
|
11
|
+
const TttxMultiselectBox = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
14
|
+
this.selectItemEvent = index.createEvent(this, "selectItemEvent", 7);
|
|
15
|
+
this.toggleOpen = index.createEvent(this, "toggleOpen", 7);
|
|
16
|
+
this.changesApplied = index.createEvent(this, "changesApplied", 7);
|
|
17
|
+
this.bodyOffset = {};
|
|
18
|
+
this.optionsData = null;
|
|
19
|
+
this.label = undefined;
|
|
20
|
+
this.inline = undefined;
|
|
21
|
+
this.placeholder = '';
|
|
22
|
+
this.searchEnabled = undefined;
|
|
23
|
+
this.htmlVisibleValue = undefined;
|
|
24
|
+
this.visibleValue = undefined;
|
|
25
|
+
this.open = false;
|
|
26
|
+
this.unsavedSelectedItems = undefined;
|
|
27
|
+
this.searchTerm = '';
|
|
28
|
+
}
|
|
29
|
+
handleCloseSelectBox() {
|
|
30
|
+
this.open = false;
|
|
31
|
+
}
|
|
32
|
+
handleBlur() {
|
|
33
|
+
this.open = false;
|
|
34
|
+
this.toggleOpen.emit(false);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* We want to generally clone instances of optionsData, _optionsData and unsavedSelectedItems
|
|
38
|
+
* This is because they may be assigned from each other, but have different purposes
|
|
39
|
+
* If we don't clone them, changing one may propagate to the others
|
|
40
|
+
* JSON.parse/stringify will deep clone them, so the references of the array elements will also change
|
|
41
|
+
*/
|
|
42
|
+
safelyCloneArray(arr) {
|
|
43
|
+
return JSON.parse(JSON.stringify(arr));
|
|
44
|
+
}
|
|
45
|
+
onDropdownClicked() {
|
|
46
|
+
this.open = !this.open;
|
|
47
|
+
this.searchTerm = '';
|
|
48
|
+
this.calculateDropdownMenuOffset();
|
|
49
|
+
this.toggleOpen.emit(this.open);
|
|
50
|
+
}
|
|
51
|
+
onCancel() {
|
|
52
|
+
this.open = false;
|
|
53
|
+
this.unsavedSelectedItems = this.safelyCloneArray(this._optionsData);
|
|
54
|
+
this.toggleOpen.emit(false);
|
|
55
|
+
}
|
|
56
|
+
applyChanges() {
|
|
57
|
+
this.open = false;
|
|
58
|
+
this.changesApplied.emit(this.safelyCloneArray(this.unsavedSelectedItems));
|
|
59
|
+
}
|
|
60
|
+
onItemSelected(option) {
|
|
61
|
+
const optionIndex = this.unsavedSelectedItems.findIndex((item) => item.value === option.value);
|
|
62
|
+
this.unsavedSelectedItems[optionIndex] = Object.assign(Object.assign({}, option), { selected: !option.selected });
|
|
63
|
+
this.unsavedSelectedItems = [...this.unsavedSelectedItems];
|
|
64
|
+
this.selectItemEvent.emit(option);
|
|
65
|
+
}
|
|
66
|
+
dropdownSelectorContent() {
|
|
67
|
+
if (!this._optionsData.find((item) => item.selected))
|
|
68
|
+
return index.h("div", { class: "placeholder" }, this.placeholder);
|
|
69
|
+
if (this.htmlVisibleValue) {
|
|
70
|
+
const sanitisedHTML = domsanitiser_options.purify.sanitize(this.visibleValue, domsanitiser_options.domSanitiserOptions);
|
|
71
|
+
return index.h("div", { class: "dropdown-selector-html-content", innerHTML: sanitisedHTML });
|
|
72
|
+
}
|
|
73
|
+
return index.h("div", null, this.visibleValue);
|
|
74
|
+
}
|
|
75
|
+
dropdownOption(option) {
|
|
76
|
+
// This is tested in e2e tests
|
|
77
|
+
/* istanbul ignore next */
|
|
78
|
+
const hideOption = this.searchEnabled && option.label.toLowerCase().indexOf(this.searchTerm.toLowerCase()) === -1;
|
|
79
|
+
const checkboxIcon = option.selected ? 'check_box' : 'check_box_outline_blank';
|
|
80
|
+
const checkboxColor = option.selected ? 'blue' : 'grey';
|
|
81
|
+
if (option.html) {
|
|
82
|
+
const sanitisedHTML = domsanitiser_options.purify.sanitize(option.html, domsanitiser_options.domSanitiserOptions);
|
|
83
|
+
// This is tested in e2e tests
|
|
84
|
+
/* istanbul ignore next */
|
|
85
|
+
return (index.h("div", { class: `dropdown-option ${hideOption ? 'hidden' : ''} ${option.selected ? 'selected' : ''}`, onClick: this.onItemSelected.bind(this, option), key: option.label }, index.h("tttx-icon", { icon: checkboxIcon, color: checkboxColor, class: 'checkbox-icon' }), index.h("div", { innerHTML: sanitisedHTML })));
|
|
86
|
+
}
|
|
87
|
+
// This is tested in e2e tests
|
|
88
|
+
/* istanbul ignore next */
|
|
89
|
+
return (index.h("div", { class: `dropdown-option ${hideOption ? 'hidden' : ''} ${option.selected ? 'selected' : ''}`, onClick: this.onItemSelected.bind(this, option), key: option.label }, index.h("tttx-icon", { icon: checkboxIcon, color: checkboxColor, class: 'checkbox-icon' }), index.h("div", { class: "plaintext-option" }, option.label)));
|
|
90
|
+
}
|
|
91
|
+
// This is tested in e2e tests
|
|
92
|
+
/* istanbul ignore next */
|
|
93
|
+
handleSearchInput(event) {
|
|
94
|
+
const target = event.target;
|
|
95
|
+
this.searchTerm = target.value;
|
|
96
|
+
}
|
|
97
|
+
calculateDropdownMenuOffset() {
|
|
98
|
+
const dropdownSelector = this.el.shadowRoot.querySelector('.dropdown-selector');
|
|
99
|
+
const bottomPosY = dropdownSelector.getBoundingClientRect().bottom;
|
|
100
|
+
// (Max list height OR 36px * number of items) + 52px for search bar + 45px for footer + 8px padding at bottom
|
|
101
|
+
let dropdownMenuMaxHeight = Math.min((288), 36 * this._optionsData.length) + 45 + 8;
|
|
102
|
+
if (this.searchEnabled)
|
|
103
|
+
dropdownMenuMaxHeight += 52;
|
|
104
|
+
if (bottomPosY + dropdownMenuMaxHeight > window.innerHeight) {
|
|
105
|
+
this.bodyOffset = { bottom: '16px', position: 'fixed', width: `${dropdownSelector.offsetWidth}px` };
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
this.bodyOffset = {};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
render() {
|
|
112
|
+
if (!this.optionsData)
|
|
113
|
+
return;
|
|
114
|
+
this._optionsData = typeof this.optionsData === 'string' ? JSON.parse(this.optionsData) : this.optionsData;
|
|
115
|
+
// initialise, if not already. After initialisation, this will be managed by internal state
|
|
116
|
+
// Check is performed in render in case initial render did not include optionsData
|
|
117
|
+
if (!this.unsavedSelectedItems)
|
|
118
|
+
this.unsavedSelectedItems = this.safelyCloneArray(this._optionsData);
|
|
119
|
+
const chevronIcon = this.open ? 'expand_less' : 'expand_more';
|
|
120
|
+
return (index.h(index.Host, { class: this.inline ? 'inline' : 'block' }, this.label && index.h("div", { class: "label" }, this.label), index.h("div", { tabindex: "0", class: "dropdown-container" }, index.h("div", { class: "dropdown-selector", onClick: this.onDropdownClicked.bind(this) }, this.dropdownSelectorContent(), index.h("div", { class: "dropdown-selector-chevron" }, index.h("tttx-icon", { icon: chevronIcon, color: "black" }))), this.open && (index.h("div", { class: "dropdown-body-container" }, index.h("div", { class: "dropdown-body", style: Object.assign({}, this.bodyOffset) }, this.searchEnabled &&
|
|
121
|
+
/* istanbul ignore next */
|
|
122
|
+
index.h("div", { class: "searchbox" }, index.h("tttx-standalone-input", { type: "text", label: "", required: true, showerrorbubble: false, iconleft: 'search', onInput: this.handleSearchInput.bind(this), inline: true })), index.h("div", { class: "dropdown-options-list" }, this.unsavedSelectedItems.map((option) => {
|
|
123
|
+
return this.dropdownOption(option);
|
|
124
|
+
})), index.h("div", { class: 'footer' }, index.h("tttx-button", { design: "primary", onClick: this.applyChanges.bind(this) }, "Apply"), index.h("tttx-button", { onClick: this.onCancel.bind(this) }, "Cancel"))))))));
|
|
125
|
+
}
|
|
126
|
+
get el() { return index.getElement(this); }
|
|
127
|
+
};
|
|
128
|
+
TttxMultiselectBox.style = tttxMultiselectBoxCss;
|
|
129
|
+
|
|
130
|
+
exports.tttx_multiselect_box = TttxMultiselectBox;
|
|
@@ -6,7 +6,7 @@ const index = require('./index-4cfa8e25.js');
|
|
|
6
6
|
const domsanitiser_options = require('./domsanitiser.options-1dfa7205.js');
|
|
7
7
|
require('./_commonjsHelpers-537d719a.js');
|
|
8
8
|
|
|
9
|
-
const tttxSelectBoxCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}:host{display:flex;gap:4px}.label{font-size:16px;font-style:normal;font-weight:500;line-height:normal}:host(.inline) .label{padding-top:8px}:host(.block){flex-direction:column}.dropdown-container{position:relative;display:flex;flex-direction:column;width:100%}.dropdown-container:focus-visible{outline:none}.dropdown-container:focus .dropdown-selector{border:1px solid #1479c6}.dropdown-selector,.dropdown-body{display:flex;border-radius:4px;background-color:white}.dropdown-selector{align-items:center;gap:8px;padding:8px 8px 8px 16px;cursor:pointer;border:1px solid #d5d5d5}.dropdown-selector-chevron{margin-left:auto;height:24px}.dropdown-selector-chevron>tttx-icon{cursor:pointer}.dropdown-body{display:flex;position:absolute;flex-direction:column;top:inherit;margin-top:45px;box-shadow:0px 1px 5px #1111114D;padding-bottom:8px;border:1px solid #d5d5d5}.dropdown-body.search{max-height:410px}.dropdown-options-list{display:flex;flex-direction:column;overflow-y:auto;max-height:368px}.dropdown-option{padding:8px 8px 8px 16px;cursor:pointer}.dropdown-option:hover{background-color:#1111110d}.dropdown-option:active,.dropdown-option.selected{background-color:#ebfbfc}.placeholder{color:#
|
|
9
|
+
const tttxSelectBoxCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}:host{display:flex;gap:4px}.label{font-size:16px;font-style:normal;font-weight:500;line-height:normal}:host(.inline) .label{padding-top:8px}:host(.block){flex-direction:column}.dropdown-container{position:relative;display:flex;flex-direction:column;width:100%}.dropdown-container:focus-visible{outline:none}.dropdown-container:focus .dropdown-selector{border:1px solid #1479c6}.dropdown-selector,.dropdown-body{display:flex;border-radius:4px;background-color:white}.dropdown-selector{align-items:center;gap:8px;padding:8px 8px 8px 16px;cursor:pointer;border:1px solid #d5d5d5}.dropdown-selector-chevron{margin-left:auto;height:24px}.dropdown-selector-chevron>tttx-icon{cursor:pointer}.dropdown-body{display:flex;position:absolute;flex-direction:column;top:inherit;margin-top:45px;box-shadow:0px 1px 5px #1111114D;padding-bottom:8px;border:1px solid #d5d5d5;z-index:1000}.dropdown-body.search{max-height:410px}.dropdown-options-list{display:flex;flex-direction:column;overflow-y:auto;max-height:368px}.dropdown-option{padding:8px 8px 8px 16px;cursor:pointer}.dropdown-option:hover{background-color:#1111110d}.dropdown-option:active,.dropdown-option.selected{background-color:#ebfbfc}.placeholder{color:#757575}.searchbox{padding:8px 16px 0 16px}.searchbox tttx-standalone-input{margin-top:-4px}.hidden{display:none}";
|
|
10
10
|
|
|
11
11
|
const TttxSelectBox = class {
|
|
12
12
|
constructor(hostRef) {
|
package/dist/cjs/tttx.cjs.js
CHANGED
|
@@ -17,7 +17,7 @@ const patchBrowser = () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(options => {
|
|
20
|
-
return index.bootstrapLazy([["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],"treeData":[32]}]]],["tttx-filter.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"]]]]],["tttx-list.cjs",[[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32]}]]],["tttx-sorter.cjs",[[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"]]]]],["tttx-tabs.cjs",[[2,"tttx-tabs",{"tabsName":[1,"tabs-name"],"navigation":[4],"wide":[4],"tabs":[1],"_tabs":[32]},[[0,"keydown","handleKeyDown"]]]]],["tttx-form.cjs",[[1,"tttx-form",{"formschema":[1032],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block.cjs",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-qrcode.cjs",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag.cjs",[[1,"tttx-tag",{"text":[1],"color":[1]}]]],["tttx-toolbar.cjs",[[1,"tttx-toolbar",{"border":[4],"viewSize":[32]},[[9,"resize","handleResize"]]]]],["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-button.cjs",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
|
|
20
|
+
return index.bootstrapLazy([["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],"treeData":[32]}]]],["tttx-filter.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"]]]]],["tttx-list.cjs",[[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32]}]]],["tttx-sorter.cjs",[[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"]]]]],["tttx-tabs.cjs",[[2,"tttx-tabs",{"tabsName":[1,"tabs-name"],"navigation":[4],"wide":[4],"tabs":[1],"_tabs":[32]},[[0,"keydown","handleKeyDown"]]]]],["tttx-form.cjs",[[1,"tttx-form",{"formschema":[1032],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block.cjs",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-loading-spinner.cjs",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-qrcode.cjs",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag.cjs",[[1,"tttx-tag",{"text":[1],"color":[1]}]]],["tttx-toolbar.cjs",[[1,"tttx-toolbar",{"border":[4],"viewSize":[32]},[[9,"resize","handleResize"]]]]],["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-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;
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"./components/molecules/tttx-dialog-box/tttx-dialog-box.js",
|
|
12
12
|
"./components/molecules/tttx-form/tttx-form.js",
|
|
13
13
|
"./components/molecules/tttx-list/tttx-list.js",
|
|
14
|
+
"./components/molecules/tttx-multiselect-box/tttx-multiselect-box.js",
|
|
14
15
|
"./components/molecules/tttx-select-box/tttx-select-box.js",
|
|
15
16
|
"./components/molecules/tttx-sorter/tttx-sorter.js",
|
|
16
17
|
"./components/molecules/tttx-tabs/tttx-tabs.js",
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
.material-symbols-rounded {
|
|
2
|
+
font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
:host {
|
|
6
|
+
display: flex;
|
|
7
|
+
gap: 4px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.label {
|
|
11
|
+
font-size: 16px;
|
|
12
|
+
font-style: normal;
|
|
13
|
+
font-weight: 500;
|
|
14
|
+
line-height: normal;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
:host(.inline) .label {
|
|
18
|
+
padding-top: 8px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:host(.block) {
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.dropdown-container {
|
|
26
|
+
display: grid;
|
|
27
|
+
position: relative;
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
width: 100%;
|
|
31
|
+
}
|
|
32
|
+
.dropdown-container:focus-visible {
|
|
33
|
+
outline: none;
|
|
34
|
+
}
|
|
35
|
+
.dropdown-container:focus .dropdown-selector {
|
|
36
|
+
border: 1px solid #1479c6;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.dropdown-selector, .dropdown-body {
|
|
40
|
+
display: flex;
|
|
41
|
+
border-radius: 4px;
|
|
42
|
+
background-color: white;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.dropdown-selector {
|
|
46
|
+
grid-row: 1;
|
|
47
|
+
align-items: center;
|
|
48
|
+
gap: 8px;
|
|
49
|
+
padding: 6px 8px 6px 16px;
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
border: 1px solid #d5d5d5;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.dropdown-selector-chevron {
|
|
55
|
+
margin-left: auto;
|
|
56
|
+
height: 24px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.dropdown-selector-chevron > tttx-icon {
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.dropdown-selector-html-content {
|
|
64
|
+
display: flex;
|
|
65
|
+
gap: 8px;
|
|
66
|
+
flex-wrap: wrap;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.dropdown-body-container {
|
|
70
|
+
grid-row: 2;
|
|
71
|
+
position: relative;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.dropdown-body {
|
|
75
|
+
position: absolute;
|
|
76
|
+
display: flex;
|
|
77
|
+
position: absolute;
|
|
78
|
+
flex-direction: column;
|
|
79
|
+
box-shadow: 0px 1px 5px #1111114D;
|
|
80
|
+
padding-bottom: 8px;
|
|
81
|
+
border: 1px solid #d5d5d5;
|
|
82
|
+
width: 100%;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.dropdown-options-list {
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-direction: column;
|
|
88
|
+
overflow-y: auto;
|
|
89
|
+
scrollbar-gutter: stable;
|
|
90
|
+
max-height: 288px;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.dropdown-option {
|
|
94
|
+
padding: 6px 8px 6px 16px;
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
display: flex;
|
|
97
|
+
gap: 8px;
|
|
98
|
+
}
|
|
99
|
+
.dropdown-option .checkbox-icon {
|
|
100
|
+
height: 24px;
|
|
101
|
+
}
|
|
102
|
+
.dropdown-option .plaintext-option {
|
|
103
|
+
line-height: 24px;
|
|
104
|
+
}
|
|
105
|
+
.dropdown-option:hover {
|
|
106
|
+
background-color: #1111110d;
|
|
107
|
+
}
|
|
108
|
+
.dropdown-option:active, .dropdown-option.selected {
|
|
109
|
+
background-color: #ebfbfc;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.placeholder {
|
|
113
|
+
color: #9e9e9e;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.searchbox {
|
|
117
|
+
padding: 8px 16px 8px 16px;
|
|
118
|
+
height: 52px;
|
|
119
|
+
box-sizing: border-box;
|
|
120
|
+
}
|
|
121
|
+
.searchbox tttx-standalone-input {
|
|
122
|
+
margin-top: -4px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.hidden {
|
|
126
|
+
display: none;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.footer {
|
|
130
|
+
display: flex;
|
|
131
|
+
gap: 8px;
|
|
132
|
+
flex-direction: row-reverse;
|
|
133
|
+
padding: 8px 16px 0 16px;
|
|
134
|
+
border-top: 1px solid #d5d5d5;
|
|
135
|
+
}
|