@3t-transform/threeteeui 0.2.86 → 0.2.87
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-data-pattern.cjs.entry.js +25 -0
- package/dist/cjs/tttx-expander.cjs.entry.js +17 -6
- package/dist/cjs/{tttx-filter.cjs.entry.js → tttx-filter_4.cjs.entry.js} +209 -0
- package/dist/cjs/tttx.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/molecules/tttx-expander/tttx-expander.css +13 -0
- package/dist/collection/components/molecules/tttx-expander/tttx-expander.js +26 -10
- package/dist/collection/components/molecules/tttx-expander/tttx-expander.stories.js +10 -10
- package/dist/collection/components/organisms/tttx-data-pattern/tttx-data-pattern.css +3 -0
- package/dist/collection/components/organisms/tttx-data-pattern/tttx-data-pattern.js +99 -0
- package/dist/collection/components/organisms/tttx-data-pattern/tttx-data-pattern.stories.js +35 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/tttx-data-pattern.d.ts +11 -0
- package/dist/components/tttx-data-pattern.js +86 -0
- package/dist/components/tttx-expander.js +20 -8
- package/dist/components/tttx-filter.js +1 -223
- package/dist/{esm/tttx-filter.entry.js → components/tttx-filter2.js} +44 -8
- package/dist/components/tttx-list.js +1 -92
- package/dist/{esm/tttx-list.entry.js → components/tttx-list2.js} +33 -9
- package/dist/components/tttx-sorter.js +1 -142
- package/dist/{esm/tttx-sorter.entry.js → components/tttx-sorter2.js} +38 -8
- package/dist/components/tttx-toolbar.js +1 -47
- package/dist/{esm/tttx-toolbar.entry.js → components/tttx-toolbar2.js} +25 -7
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tttx-data-pattern.entry.js +21 -0
- package/dist/esm/tttx-expander.entry.js +17 -6
- package/dist/esm/tttx-filter_4.entry.js +395 -0
- package/dist/esm/tttx.js +1 -1
- package/dist/tttx/p-003798cb.entry.js +1 -0
- package/dist/tttx/p-02515882.entry.js +1 -0
- package/dist/tttx/p-1190c6e5.entry.js +1 -0
- package/dist/tttx/tttx.esm.js +1 -1
- package/dist/types/components/molecules/tttx-expander/tttx-expander.d.ts +9 -3
- package/dist/types/components/organisms/tttx-data-pattern/tttx-data-pattern.d.ts +7 -0
- package/dist/types/components/organisms/tttx-data-pattern/tttx-data-pattern.stories.d.ts +13 -0
- package/dist/types/components.d.ts +24 -3
- package/package.json +1 -1
- package/dist/cjs/tttx-list.cjs.entry.js +0 -74
- package/dist/cjs/tttx-sorter.cjs.entry.js +0 -118
- package/dist/cjs/tttx-toolbar.cjs.entry.js +0 -35
- package/dist/tttx/p-0343ca04.entry.js +0 -1
- package/dist/tttx/p-5ca83a07.entry.js +0 -1
- package/dist/tttx/p-7346c185.entry.js +0 -1
- package/dist/tttx/p-96d6a1ed.entry.js +0 -1
- package/dist/tttx/p-df198186.entry.js +0 -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-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],"selectedId":[32]}]]],["tttx-expander.cjs",[[1,"tttx-expander",{"name":[1],"
|
|
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],"treeData":[32],"selectedId":[32]}]]],["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-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);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-44c9fa62.js');
|
|
6
|
+
|
|
7
|
+
const tttxDataPatternCss = ":host{display:block}";
|
|
8
|
+
|
|
9
|
+
const TttxDataPattern = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.data = undefined;
|
|
13
|
+
this.sorteroptions = undefined;
|
|
14
|
+
this.filteroptions = undefined;
|
|
15
|
+
this.filterheader = 'Filter';
|
|
16
|
+
}
|
|
17
|
+
render() {
|
|
18
|
+
return (index.h(index.Host, null, index.h("div", { class: "container" }, index.h("tttx-toolbar", { border: true }, index.h("span", { slot: "before" }, index.h("tttx-sorter", { sorterKey: "data-pattern-list", fieldOptionsData: this.sorteroptions, defaultOption: "Sort by" }), index.h("tttx-filter", { "filter-options": JSON.stringify(this.filteroptions), showSelectAll: false, "show-option-icons": true, "filter-header": this.filterheader, "filter-key": "data-pattern-list" })), index.h("span", { slot: "after" }, index.h("tttx-standalone-input", { class: "qualifications-filter", showerrorbubble: false, inputicon: "search", inline: true, required: true, placeholder: "Search", type: "text",
|
|
19
|
+
// onInput={this.debounceFilter.bind(this)}
|
|
20
|
+
maxlength: 30 }))), index.h("tttx-toolbar", { border: false }, index.h("span", { slot: "before" }, index.h("tttx-button", { design: "primary", icon: "add" }, "Add"))), index.h("tttx-list", { data: this.data }))));
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
TttxDataPattern.style = tttxDataPatternCss;
|
|
24
|
+
|
|
25
|
+
exports.tttx_data_pattern = TttxDataPattern;
|
|
@@ -4,22 +4,33 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-44c9fa62.js');
|
|
6
6
|
|
|
7
|
-
const tttxExpanderCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}:host{display:block}.expander{border-bottom:1px solid #d5d5d5}.expander .panel{display:flex;gap:4px;height:36px;align-items:center;justify-content:space-between;cursor:pointer}.expander .panel .panel-frame{display:flex;gap:4px;height:36px;align-items:center}.expander .panel .panel-frame .name{font-size:16px;font-weight:500;color:#212121}.expander .panel .left-icons,.expander .panel .expand-button{display:flex;height:36px;width:36px;align-items:center;justify-content:center}.expander .panel .left-icons>tttx-icon,.expander .panel .expand-button>tttx-icon{height:24px;cursor:inherit}.expander .content{margin-top:8px;margin-bottom:8px}";
|
|
7
|
+
const tttxExpanderCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}:host{display:block}.expander{border-bottom:1px solid #d5d5d5}.expander[open] .panel .open{display:initial}.expander[open] .panel .closed{display:none}.expander:not([open]) .panel .open{display:none}.expander:not([open]) .panel .closed{display:initial}.expander .panel{display:flex;gap:4px;height:36px;align-items:center;justify-content:space-between;cursor:pointer;user-select:none}.expander .panel .panel-frame{display:flex;gap:4px;height:36px;align-items:center}.expander .panel .panel-frame .name{font-size:16px;font-weight:500;color:#212121}.expander .panel .left-icons,.expander .panel .expand-button{display:flex;height:36px;width:36px;align-items:center;justify-content:center}.expander .panel .left-icons>tttx-icon,.expander .panel .expand-button>tttx-icon{height:24px;cursor:inherit}.expander .content{margin-top:8px;margin-bottom:8px}";
|
|
8
8
|
|
|
9
9
|
const TttxExpander = class {
|
|
10
10
|
constructor(hostRef) {
|
|
11
11
|
index.registerInstance(this, hostRef);
|
|
12
|
-
this.
|
|
12
|
+
this.toggleExpander = index.createEvent(this, "toggleExpander", 7);
|
|
13
13
|
this.name = undefined;
|
|
14
|
-
this.
|
|
14
|
+
this.open = false;
|
|
15
15
|
this.lefticon = undefined;
|
|
16
16
|
this.lefticoncolor = undefined;
|
|
17
|
+
this.isExpanded = false;
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
-
this.
|
|
19
|
+
componentWillRender() {
|
|
20
|
+
this.isExpanded = this.open;
|
|
21
|
+
}
|
|
22
|
+
handleExpand() {
|
|
23
|
+
// pre-render logic, so the attribute check is reversed
|
|
24
|
+
if (this.expander.getAttribute('open') === null) {
|
|
25
|
+
this.isExpanded = true;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
this.isExpanded = false;
|
|
29
|
+
}
|
|
30
|
+
this.toggleExpander.emit({ open: this.isExpanded, name: this.name });
|
|
20
31
|
}
|
|
21
32
|
render() {
|
|
22
|
-
return (index.h(index.Host, null, index.h("
|
|
33
|
+
return (index.h(index.Host, null, index.h("details", { class: "expander", open: this.open, "aria-owns": "expanderContent", "aria-expanded": `${this.isExpanded}`, onClick: this.handleExpand.bind(this), ref: el => (this.expander = el) }, index.h("summary", { class: "panel" }, index.h("span", { class: "panel-frame" }, this.lefticon && (index.h("span", { class: "left-icons" }, index.h("tttx-icon", { icon: this.lefticon, color: this.lefticoncolor }))), index.h("span", { class: "name" }, this.name)), index.h("span", { class: "expand-button" }, index.h("tttx-icon", { class: "open", icon: "expand_more", color: "black" }), index.h("tttx-icon", { class: "closed", icon: "chevron_right", color: "black" }))), index.h("div", { id: "expanderContent", class: "content", tabindex: "0" }, index.h("slot", null)))));
|
|
23
34
|
}
|
|
24
35
|
};
|
|
25
36
|
TttxExpander.style = tttxExpanderCss;
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-44c9fa62.js');
|
|
6
|
+
const domsanitiser_options = require('./domsanitiser.options-32e670aa.js');
|
|
7
|
+
require('./_commonjsHelpers-537d719a.js');
|
|
6
8
|
|
|
7
9
|
const tttxFilterCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.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}.filter-container{background-color:white;position:relative}.filter-container .filter-button{display:inline-flex;justify-content:center;align-items:center;font-size:14px;font-weight:400;font-family:\"Roboto\", serif;text-transform:uppercase;color:#212121;border:1px solid #d5d5d5;border-radius:4px;background:transparent;height:36px;width:95px;margin:0;padding-right:16px;cursor:pointer}@media (max-width: 475px){.filter-container .filter-button{padding-left:4px}}.filter-container .filter-button .filter-icon{padding-left:8px;padding-right:4px}.filter-container .filter-button.--list-icon{font-size:0;width:36px;height:36px;padding:0}.filter-container .filter-button.--list-icon .filter-icon{padding:0}.filter-container .filter-button.--list-icon:hover{background:#e3e3e3}.filter-container .filter-button.--table-icon{font-size:0;width:36px;height:36px;padding:0;border:none}.filter-container .filter-button.--table-icon .filter-icon{padding:0;width:24px;height:24px}.filter-container .filter-button.--table-icon:hover{background:#e3e3e3;border-radius:50%;width:36px;height:36px}.filter-container .filter-button:hover{background:#e3e3e3}.filter-container .filter-popover-container{display:flex;flex-direction:column;gap:8px;border-radius:4px;box-shadow:0px 1px 5px #1111114D;position:absolute;top:36px;left:0px;background-color:white;padding:8px 16px}.filter-container .filter-popover-container .filter-header{color:#757575;text-transform:uppercase;font-size:14px;font-weight:500;font-family:\"Roboto\", serif;padding-top:4px;padding-bottom:5px}.filter-container .filter-popover-container .filter-options-container{display:flex;flex-direction:column;gap:4px;border-top:1px solid #d5d5d5;border-bottom:1px solid #d5d5d5;padding-bottom:8px}.filter-container .filter-popover-container .filter-option{display:flex;flex-direction:row;align-items:center;min-height:36px;padding-left:8px}.filter-container .filter-popover-container .filter-option .select-all-icon{padding-right:6px}.filter-container .filter-popover-container .filter-option .checkbox-icon{padding-right:8px}.filter-container .filter-popover-container .filter-option .filter-label{padding-left:8px;padding-bottom:3px;font-size:16px;font-weight:500;font-family:\"Roboto\", serif}.filter-container .filter-popover-container .filter-option:first-child{padding-top:8px}.filter-container .filter-popover-container .filter-popover-button-container{display:flex;justify-content:flex-end;align-items:center}.filter-container .filter-popover-container .filter-popover-button-container .close-button{height:36px;width:74px;background-color:white;border:1px solid #d5d5d5;border-radius:4px;text-transform:uppercase;margin-right:8px;font-size:14px;font-weight:400;font-family:\"Roboto\", serif;color:#212121}.filter-container .filter-popover-container .filter-popover-button-container .apply-button{height:36px;width:73px;background-color:#1479c6;color:white;border-radius:4px;border:none;text-transform:uppercase;font-size:14px;font-weight:400;font-family:\"Roboto\", serif}.filter-container .filter-popover-container.--with-search-field .filter-header{border-bottom:1px solid #d5d5d5}.filter-container .filter-popover-container.--with-search-field .search-field-container{position:relative;color:#d5d5d5;height:36px}.filter-container .filter-popover-container.--with-search-field .search-field-container .search-icon{position:absolute;top:6px;left:8px}.filter-container .filter-popover-container.--with-search-field .search-field-container .search-input{padding-left:36px;border:1px solid #d5d5d5;border-radius:4px;height:36px;width:100%;font-size:16px;font-family:\"Roboto\", serif;font-weight:500;box-sizing:border-box}.filter-container .filter-popover-container.--with-search-field .search-field-container .search-input:focus-visible,.filter-container .filter-popover-container.--with-search-field .search-field-container .search-input:focus{outline:none;border:1px solid #1479c6}.filter-container .filter-popover-container.--with-search-field .search-field-container .search-input::placeholder{color:#9e9e9e;font-size:16px;font-family:\"Roboto\", serif;font-weight:500}";
|
|
8
10
|
|
|
@@ -190,4 +192,211 @@ const TttxFilter = class {
|
|
|
190
192
|
};
|
|
191
193
|
TttxFilter.style = tttxFilterCss;
|
|
192
194
|
|
|
195
|
+
const tttxListCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.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}:host{display:flex;flex-direction:column}.list{margin:0;padding:0}li{display:flex;align-items:flex-start}li.item{list-style:none;margin:0;padding:8px;border-bottom:1px solid #d5d5d5;min-height:36px}li.item:first-of-type{border-top:1px solid #d5d5d5}li.item.clickable:hover{cursor:pointer}li.item.toggleable:hover{cursor:pointer}li.item.active{background-color:rgba(17, 17, 17, 0.1)}li.item.active:hover{background-color:rgba(17, 17, 17, 0.15)}li.item.selected{background-color:#ebfbfc}li.item.selected:hover{background-color:#e0f8f9}li.item.selected.active{background-color:#ccf3f6}li.item.selected.active:hover{background-color:#bff0f3}li.item .icons{display:flex;justify-content:flex-end;flex-grow:1;align-items:center;height:36px}li.item .icons tttx-icon:hover{cursor:pointer}li.item .icons *{display:flex}li.item:hover{background-color:rgba(17, 17, 17, 0.05)}.align-right{margin-left:auto}.item-content{display:flex;align-items:center;flex-grow:2;min-height:36px}.checkbox{padding:6px;margin-left:-8px}";
|
|
196
|
+
|
|
197
|
+
const TttxList = class {
|
|
198
|
+
constructor(hostRef) {
|
|
199
|
+
index.registerInstance(this, hostRef);
|
|
200
|
+
this.rowClick = index.createEvent(this, "listRowClick", 7);
|
|
201
|
+
this.rowCheckboxClick = index.createEvent(this, "listRowCheckboxClick", 7);
|
|
202
|
+
this.data = undefined;
|
|
203
|
+
this._data = undefined;
|
|
204
|
+
this.name = undefined;
|
|
205
|
+
}
|
|
206
|
+
onDataChange() {
|
|
207
|
+
if (!this.data) {
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
if (typeof this.data === 'string') {
|
|
211
|
+
this._data = JSON.parse(this.data);
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
this._data = [...this.data];
|
|
215
|
+
}
|
|
216
|
+
for (const data of this._data) {
|
|
217
|
+
if (data.hasCheckbox && data.checked === undefined) {
|
|
218
|
+
data.checked = false;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
componentWillLoad() {
|
|
223
|
+
// dynamic constructor: any props can be added later
|
|
224
|
+
this.onDataChange();
|
|
225
|
+
}
|
|
226
|
+
onRowCheckboxHandler(event, item) {
|
|
227
|
+
event.stopPropagation();
|
|
228
|
+
if (!item.rowData)
|
|
229
|
+
return;
|
|
230
|
+
this.rowCheckboxClick.emit({ key: item.key, name: this.name, data: item.rowData });
|
|
231
|
+
}
|
|
232
|
+
onRowClickHandler(item) {
|
|
233
|
+
if ((!item.clickable && !item.toggleable) || !item.rowData)
|
|
234
|
+
return;
|
|
235
|
+
this.rowClick.emit({ key: item.key, name: this.name, data: item.rowData });
|
|
236
|
+
}
|
|
237
|
+
renderListItem(item) {
|
|
238
|
+
const cleanHTML = domsanitiser_options.purify.sanitize(item.element, domsanitiser_options.domSanitiserOptions);
|
|
239
|
+
return (index.h(index.Fragment, null, item.hasCheckbox && (index.h("div", { class: "checkbox" }, index.h("tttx-icon", { icon: item.checked ? 'check_box' : 'check_box_outline_blank', color: item.checked ? 'blue' : 'grey', onClick: event => {
|
|
240
|
+
this.onRowCheckboxHandler(event, item);
|
|
241
|
+
} }))), item.element && index.h("span", { class: "item-content", innerHTML: cleanHTML }), item.icon && (index.h("span", { class: "icons" }, index.h("tttx-icon", { class: "align-right", icon: item.icon, color: 'black' })))));
|
|
242
|
+
}
|
|
243
|
+
render() {
|
|
244
|
+
if (!this._data)
|
|
245
|
+
return;
|
|
246
|
+
return (index.h("ul", { class: "list" }, this._data.map((item) => (index.h("li", { key: item.key, class: 'item' +
|
|
247
|
+
(item.clickable ? ' clickable' : '') +
|
|
248
|
+
(item.toggleable ? ' toggleable' : '') +
|
|
249
|
+
(item.checked ? ' selected' : '') +
|
|
250
|
+
(item.active ? ' active' : ''), onClick: () => {
|
|
251
|
+
this.onRowClickHandler(item);
|
|
252
|
+
} }, this.renderListItem(item))))));
|
|
253
|
+
}
|
|
254
|
+
static get watchers() { return {
|
|
255
|
+
"data": ["onDataChange"]
|
|
256
|
+
}; }
|
|
257
|
+
};
|
|
258
|
+
TttxList.style = tttxListCss;
|
|
259
|
+
|
|
260
|
+
const tttxSorterCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.sorter-container{display:flex;flex-direction:row;position:relative;border:1px solid #d5d5d5;border-radius:4px;font-weight:400;box-sizing:border-box;height:36px;cursor:pointer;width:220px}@media (max-width: 475px){.sorter-container{width:68px}}.sorter-container .arrow-toggle-button{display:inline-flex;justify-content:center;align-items:center;flex-direction:column;background-color:white;border:none;border-bottom-left-radius:4px;border-top-left-radius:4px}@media (max-width: 475px){.sorter-container .arrow-toggle-button{padding-right:0px;padding-left:8px}}.sorter-container .arrow-toggle-button .hydrated{display:flex;justify-content:center;align-items:center;cursor:pointer}.sorter-container .arrow-toggle-button span{display:block;margin:auto;line-height:16px}.sorter-container .arrow-toggle-button .material-symbols-rounded{color:#212121}.sorter-container .dropdown-selector{display:inline-flex;position:relative;flex-grow:1}.sorter-container .dropdown-selector .dropdown-selector-button{display:inline-flex;flex-direction:row;gap:4px;padding-right:4px;align-items:center;color:#212121;width:100%}@media (max-width: 475px){.sorter-container .dropdown-selector .dropdown-selector-button .dropdown-selector-text{display:none}}.sorter-container .dropdown-selector .dropdown-selector-chevron{display:inline-flex;margin-left:auto;right:0;top:0;flex-direction:row;align-items:center;height:36px}.sorter-container .dropdown-selector .dropdown-selector-chevron .hydrated{height:24px;cursor:pointer}@media (max-width: 475px){.sorter-container .dropdown-selector .dropdown-selector-chevron{padding-right:2px}}.sorter-container .dropdown-options-list{position:absolute;top:36px;left:0;z-index:1;width:220px;line-height:21px;font-size:16px;border-radius:4px;padding-top:8px;padding-bottom:7px;box-shadow:0px 1px 5px #1111114D;box-sizing:border-box;background-color:white}@media (max-width: 475px){.sorter-container .dropdown-options-list{width:220px;padding-top:8px}}.sorter-container .dropdown-options-list .dropdown-option{padding:8px 16px;font-size:16px;line-height:21px}.sorter-container .dropdown-options-list .dropdown-option:hover,.sorter-container .dropdown-options-list .dropdown-option:focus{background-color:#ebfbfc}.sorter-container.--expanded{border-color:#1579c6}@media (max-width: 475px){.sorter-container.--expanded{border:none}}";
|
|
261
|
+
|
|
262
|
+
const TttxSorter = class {
|
|
263
|
+
constructor(hostRef) {
|
|
264
|
+
index.registerInstance(this, hostRef);
|
|
265
|
+
this.sorterChangeEvent = index.createEvent(this, "sorterChangeEvent", 7);
|
|
266
|
+
this.toggleSorter = index.createEvent(this, "toggleSorter", 7);
|
|
267
|
+
this.sorterKey = undefined;
|
|
268
|
+
this.defaultSortDirection = 'descending';
|
|
269
|
+
this.fieldOptionsData = null;
|
|
270
|
+
this.defaultOption = '';
|
|
271
|
+
this.selectedField = this.defaultOption;
|
|
272
|
+
this.sortDirection = this.defaultSortDirection;
|
|
273
|
+
this.dropdownExpand = false;
|
|
274
|
+
this.dropdownOptions = undefined;
|
|
275
|
+
}
|
|
276
|
+
handleCloseSorter() {
|
|
277
|
+
this.dropdownExpand = false;
|
|
278
|
+
}
|
|
279
|
+
emitSortEvent() {
|
|
280
|
+
this.sorterChangeEvent.emit({
|
|
281
|
+
sorterDirection: this.sortDirection,
|
|
282
|
+
sorterKey: this.sorterKey,
|
|
283
|
+
sortField: this.selectedField,
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
onSortToggleClick(event) {
|
|
287
|
+
event.preventDefault();
|
|
288
|
+
if (this.sortDirection == 'ascending') {
|
|
289
|
+
this.sortDirection = 'descending';
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
this.sortDirection = 'ascending';
|
|
293
|
+
}
|
|
294
|
+
this.emitSortEvent();
|
|
295
|
+
}
|
|
296
|
+
onDropdownClicked() {
|
|
297
|
+
this.dropdownExpand = !this.dropdownExpand;
|
|
298
|
+
this.toggleSorter.emit(this.dropdownExpand);
|
|
299
|
+
}
|
|
300
|
+
onDropdownSelected(event) {
|
|
301
|
+
this.dropdownExpand = false;
|
|
302
|
+
const target = event.target;
|
|
303
|
+
this.selectedField = target.innerHTML;
|
|
304
|
+
this.emitSortEvent();
|
|
305
|
+
this.toggleSorter.emit(this.dropdownExpand);
|
|
306
|
+
}
|
|
307
|
+
// getOptionsList() {
|
|
308
|
+
// return this.el.shadowRoot.querySelectorAll('.dropdown-option');
|
|
309
|
+
// }
|
|
310
|
+
// /* istanbul ignore next */
|
|
311
|
+
// @Listen('keyup')
|
|
312
|
+
// handleKeyDown(ev: KeyboardEvent) {
|
|
313
|
+
// const keyboardEventValue = ev.key;
|
|
314
|
+
// if (document.activeElement.id != `sorter__${this.sorterKey}`) return;
|
|
315
|
+
// switch (keyboardEventValue) {
|
|
316
|
+
// case 'Enter':
|
|
317
|
+
// if (this._focussedElementIndex > -1) {
|
|
318
|
+
// const options = this.el.shadowRoot.querySelectorAll('.dropdown-option');
|
|
319
|
+
// this.selectedField = options[this._focussedElementIndex].innerHTML;
|
|
320
|
+
// this.emitSortEvent();
|
|
321
|
+
// }
|
|
322
|
+
// this.dropdownExpand = false;
|
|
323
|
+
// break;
|
|
324
|
+
// case 'Escape':
|
|
325
|
+
// this.dropdownExpand = false;
|
|
326
|
+
// break;
|
|
327
|
+
// case 'ArrowDown':
|
|
328
|
+
// this.dropdownExpand = true;
|
|
329
|
+
// if (this._focussedElementIndex > -1) {
|
|
330
|
+
// const options = this.getOptionsList();
|
|
331
|
+
// const currentOption = options[this._focussedElementIndex] as HTMLElement;
|
|
332
|
+
// currentOption.blur();
|
|
333
|
+
// options[this._focussedElementIndex].focus();
|
|
334
|
+
// this._focussedElementIndex + 1 < options.length ? this._focussedElementIndex++ : (this._focussedElementIndex = 0);
|
|
335
|
+
// } else {
|
|
336
|
+
// this._focussedElementIndex++;
|
|
337
|
+
// }
|
|
338
|
+
// break;
|
|
339
|
+
// case 'ArrowUp':
|
|
340
|
+
// this.dropdownExpand = true;
|
|
341
|
+
// if (this._focussedElementIndex == -1) {
|
|
342
|
+
// const options = this.getOptionsList();
|
|
343
|
+
// this._focussedElementIndex = options.length - 1;
|
|
344
|
+
// } else {
|
|
345
|
+
// const options = this.getOptionsList();
|
|
346
|
+
// const currentOption = options[this._focussedElementIndex] as HTMLElement;
|
|
347
|
+
// currentOption.blur();
|
|
348
|
+
// this._focussedElementIndex > 0 ? this._focussedElementIndex-- : (this._focussedElementIndex = options.length - 1);
|
|
349
|
+
// options[this._focussedElementIndex].focus();
|
|
350
|
+
// }
|
|
351
|
+
// break;
|
|
352
|
+
// }
|
|
353
|
+
// }
|
|
354
|
+
render() {
|
|
355
|
+
const parsedFieldOptionsData = typeof this.fieldOptionsData === 'string' ? JSON.parse(this.fieldOptionsData) : this.fieldOptionsData;
|
|
356
|
+
if (!this.fieldOptionsData)
|
|
357
|
+
return;
|
|
358
|
+
const arrowIcon = this.sortDirection == 'ascending' ? 'arrow_upward' : 'arrow_downward';
|
|
359
|
+
const chevronIcon = this.dropdownExpand ? 'expand_less' : 'expand_more';
|
|
360
|
+
const selectedOption = this.selectedField;
|
|
361
|
+
const dropdownSelectorClassNameModifier = this.dropdownExpand ? '--expanded' : '';
|
|
362
|
+
const sorterKey = `sorter__${this.sorterKey}`;
|
|
363
|
+
return (index.h(index.Host, { id: sorterKey }, index.h("div", { tabindex: 0, class: `sorter-container ${dropdownSelectorClassNameModifier}` }, index.h("button", { class: "arrow-toggle-button", type: "button", onClick: this.onSortToggleClick.bind(this) }, index.h("tttx-icon", { icon: arrowIcon, color: "black" })), index.h("div", { class: "dropdown-selector", onClick: this.onDropdownClicked.bind(this) }, index.h("div", { class: "dropdown-selector-button" }, index.h("div", { class: "dropdown-selector-text" }, selectedOption), index.h("div", { class: "dropdown-selector-chevron" }, index.h("tttx-icon", { icon: chevronIcon, color: "black" })))), this.dropdownExpand && (index.h("div", { class: "dropdown-options-list" }, parsedFieldOptionsData.sorterOptions.map(option => {
|
|
364
|
+
return (index.h("div", { class: "dropdown-option", tabIndex: -1, onClick: this.onDropdownSelected.bind(this), key: option.optionLabel }, option.optionLabel));
|
|
365
|
+
}))))));
|
|
366
|
+
}
|
|
367
|
+
get el() { return index.getElement(this); }
|
|
368
|
+
};
|
|
369
|
+
TttxSorter.style = tttxSorterCss;
|
|
370
|
+
|
|
371
|
+
const tttxToolbarCss = ".container{display:flex;align-items:flex-end;row-gap:8px;padding:8px 0;flex-wrap:wrap}.container.bordered{border-bottom:1px solid #d5d5d5}.desktop ::slotted([slot=before]){flex:1 1 0px}.desktop ::slotted([slot=center]){flex:0 1 fit-content}.desktop ::slotted([slot=after]){flex:1 1 0px}::slotted([slot=before]){display:flex;align-items:flex-end;flex-wrap:wrap;gap:8px}::slotted([slot=center]){display:flex;justify-content:center;align-items:flex-end;flex-wrap:wrap;gap:8px}::slotted([slot=after]){display:flex;justify-content:end;align-items:flex-end;flex-wrap:wrap;gap:8px}";
|
|
372
|
+
|
|
373
|
+
const TttxToolbar = class {
|
|
374
|
+
constructor(hostRef) {
|
|
375
|
+
index.registerInstance(this, hostRef);
|
|
376
|
+
this.border = true;
|
|
377
|
+
this.viewSize = undefined;
|
|
378
|
+
}
|
|
379
|
+
handleResize() {
|
|
380
|
+
this.setViewSize();
|
|
381
|
+
}
|
|
382
|
+
async componentWillLoad() {
|
|
383
|
+
this.setViewSize();
|
|
384
|
+
}
|
|
385
|
+
setViewSize() {
|
|
386
|
+
if (window.innerWidth < 698) {
|
|
387
|
+
this.viewSize = 'mobile';
|
|
388
|
+
}
|
|
389
|
+
else {
|
|
390
|
+
this.viewSize = 'desktop';
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
render() {
|
|
394
|
+
return (index.h(index.Host, null, index.h("div", { class: `container ${this.border ? 'bordered' : ''} ${this.viewSize}` }, index.h("slot", { name: 'before' }), index.h("slot", { name: 'center' }), index.h("slot", { name: 'after' }))));
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
TttxToolbar.style = tttxToolbarCss;
|
|
398
|
+
|
|
193
399
|
exports.tttx_filter = TttxFilter;
|
|
400
|
+
exports.tttx_list = TttxList;
|
|
401
|
+
exports.tttx_sorter = TttxSorter;
|
|
402
|
+
exports.tttx_toolbar = TttxToolbar;
|
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-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],"selectedId":[32]}]]],["tttx-expander.cjs",[[1,"tttx-expander",{"name":[1],"
|
|
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],"treeData":[32],"selectedId":[32]}]]],["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-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);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
exports.setNonce = index.setNonce;
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"./components/molecules/tttx-tabs/tttx-tabs.js",
|
|
20
20
|
"./components/molecules/tttx-textarea/tttx-textarea.js",
|
|
21
21
|
"./components/molecules/tttx-toolbar/tttx-toolbar.js",
|
|
22
|
-
"./components/molecules/tttx-tree-view/tttx-tree-view.js"
|
|
22
|
+
"./components/molecules/tttx-tree-view/tttx-tree-view.js",
|
|
23
|
+
"./components/organisms/tttx-data-pattern/tttx-data-pattern.js"
|
|
23
24
|
],
|
|
24
25
|
"compiler": {
|
|
25
26
|
"name": "@stencil/core",
|
|
@@ -9,6 +9,18 @@
|
|
|
9
9
|
.expander {
|
|
10
10
|
border-bottom: 1px solid #d5d5d5;
|
|
11
11
|
}
|
|
12
|
+
.expander[open] .panel .open {
|
|
13
|
+
display: initial;
|
|
14
|
+
}
|
|
15
|
+
.expander[open] .panel .closed {
|
|
16
|
+
display: none;
|
|
17
|
+
}
|
|
18
|
+
.expander:not([open]) .panel .open {
|
|
19
|
+
display: none;
|
|
20
|
+
}
|
|
21
|
+
.expander:not([open]) .panel .closed {
|
|
22
|
+
display: initial;
|
|
23
|
+
}
|
|
12
24
|
.expander .panel {
|
|
13
25
|
display: flex;
|
|
14
26
|
gap: 4px;
|
|
@@ -16,6 +28,7 @@
|
|
|
16
28
|
align-items: center;
|
|
17
29
|
justify-content: space-between;
|
|
18
30
|
cursor: pointer;
|
|
31
|
+
user-select: none;
|
|
19
32
|
}
|
|
20
33
|
.expander .panel .panel-frame {
|
|
21
34
|
display: flex;
|
|
@@ -2,15 +2,26 @@ import { Host, h } from '@stencil/core';
|
|
|
2
2
|
export class TttxExpander {
|
|
3
3
|
constructor() {
|
|
4
4
|
this.name = undefined;
|
|
5
|
-
this.
|
|
5
|
+
this.open = false;
|
|
6
6
|
this.lefticon = undefined;
|
|
7
7
|
this.lefticoncolor = undefined;
|
|
8
|
+
this.isExpanded = false;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
-
this.
|
|
10
|
+
componentWillRender() {
|
|
11
|
+
this.isExpanded = this.open;
|
|
12
|
+
}
|
|
13
|
+
handleExpand() {
|
|
14
|
+
// pre-render logic, so the attribute check is reversed
|
|
15
|
+
if (this.expander.getAttribute('open') === null) {
|
|
16
|
+
this.isExpanded = true;
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
this.isExpanded = false;
|
|
20
|
+
}
|
|
21
|
+
this.toggleExpander.emit({ open: this.isExpanded, name: this.name });
|
|
11
22
|
}
|
|
12
23
|
render() {
|
|
13
|
-
return (h(Host, null, h("
|
|
24
|
+
return (h(Host, null, h("details", { class: "expander", open: this.open, "aria-owns": "expanderContent", "aria-expanded": `${this.isExpanded}`, onClick: this.handleExpand.bind(this), ref: el => (this.expander = el) }, h("summary", { class: "panel" }, h("span", { class: "panel-frame" }, this.lefticon && (h("span", { class: "left-icons" }, h("tttx-icon", { icon: this.lefticon, color: this.lefticoncolor }))), h("span", { class: "name" }, this.name)), h("span", { class: "expand-button" }, h("tttx-icon", { class: "open", icon: "expand_more", color: "black" }), h("tttx-icon", { class: "closed", icon: "chevron_right", color: "black" }))), h("div", { id: "expanderContent", class: "content", tabindex: "0" }, h("slot", null)))));
|
|
14
25
|
}
|
|
15
26
|
static get is() { return "tttx-expander"; }
|
|
16
27
|
static get encapsulation() { return "shadow"; }
|
|
@@ -43,7 +54,7 @@ export class TttxExpander {
|
|
|
43
54
|
"attribute": "name",
|
|
44
55
|
"reflect": false
|
|
45
56
|
},
|
|
46
|
-
"
|
|
57
|
+
"open": {
|
|
47
58
|
"type": "boolean",
|
|
48
59
|
"mutable": false,
|
|
49
60
|
"complexType": {
|
|
@@ -57,7 +68,7 @@ export class TttxExpander {
|
|
|
57
68
|
"tags": [],
|
|
58
69
|
"text": ""
|
|
59
70
|
},
|
|
60
|
-
"attribute": "
|
|
71
|
+
"attribute": "open",
|
|
61
72
|
"reflect": false,
|
|
62
73
|
"defaultValue": "false"
|
|
63
74
|
},
|
|
@@ -97,10 +108,15 @@ export class TttxExpander {
|
|
|
97
108
|
}
|
|
98
109
|
};
|
|
99
110
|
}
|
|
111
|
+
static get states() {
|
|
112
|
+
return {
|
|
113
|
+
"isExpanded": {}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
100
116
|
static get events() {
|
|
101
117
|
return [{
|
|
102
|
-
"method": "
|
|
103
|
-
"name": "
|
|
118
|
+
"method": "toggleExpander",
|
|
119
|
+
"name": "toggleExpander",
|
|
104
120
|
"bubbles": true,
|
|
105
121
|
"cancelable": true,
|
|
106
122
|
"composed": true,
|
|
@@ -109,8 +125,8 @@ export class TttxExpander {
|
|
|
109
125
|
"text": ""
|
|
110
126
|
},
|
|
111
127
|
"complexType": {
|
|
112
|
-
"original": "boolean",
|
|
113
|
-
"resolved": "boolean",
|
|
128
|
+
"original": "{ open: boolean; name: string }",
|
|
129
|
+
"resolved": "{ open: boolean; name: string; }",
|
|
114
130
|
"references": {}
|
|
115
131
|
}
|
|
116
132
|
}];
|
|
@@ -16,21 +16,21 @@ export default {
|
|
|
16
16
|
},
|
|
17
17
|
parameters: {
|
|
18
18
|
actions: {
|
|
19
|
-
handles: ['
|
|
19
|
+
handles: ['toggleExpander'],
|
|
20
20
|
},
|
|
21
21
|
},
|
|
22
22
|
decorators: [withActions],
|
|
23
23
|
};
|
|
24
|
-
const TemplateExpanderBookings = ({ name,
|
|
24
|
+
const TemplateExpanderBookings = ({ name, open, lefticon, lefticoncolor }) => `
|
|
25
25
|
<div style="width: 268px;">
|
|
26
|
-
<tttx-expander name="${name}"
|
|
27
|
-
<div style="height: 36px; display: flex; align-items: center; gap: 8px;">
|
|
26
|
+
<tttx-expander name="${name}" open="${open}" lefticon="${lefticon}" lefticoncolor="${lefticoncolor}">
|
|
27
|
+
<div tabindex="1" style="height: 36px; display: flex; align-items: center; gap: 8px;">
|
|
28
28
|
<tttx-icon style="height: 24px;" icon="check_box_outline_blank" color="gray"></tttx-icon><tttx-icon style="height: 24px;" icon="cancel" color="darkred"></tttx-icon><span>Not yet competent</span>
|
|
29
29
|
</div>
|
|
30
|
-
<div style="height: 36px; display: flex; align-items: center; gap: 8px;">
|
|
30
|
+
<div tabindex="2" style="height: 36px; display: flex; align-items: center; gap: 8px;">
|
|
31
31
|
<tttx-icon style="height: 24px;" icon="check_box_outline_blank" color="gray"></tttx-icon><tttx-icon style="height: 24px;" icon="check_circle" color="green"></tttx-icon><span>Competent</span>
|
|
32
32
|
</div>
|
|
33
|
-
<div style="height: 36px; display: flex; align-items: center; gap: 8px;">
|
|
33
|
+
<div tabindex="3" style="height: 36px; display: flex; align-items: center; gap: 8px;">
|
|
34
34
|
<tttx-icon style="height: 24px;" icon="check_box_outline_blank" color="gray"></tttx-icon><tttx-icon style="height: 24px;" icon="brightness_alert" color="blue"></tttx-icon><span>Not assessed</span>
|
|
35
35
|
</div>
|
|
36
36
|
</tttx-expander>
|
|
@@ -39,13 +39,13 @@ const TemplateExpanderBookings = ({ name, expanded, lefticon, lefticoncolor }) =
|
|
|
39
39
|
export const ExpanderBookings = TemplateExpanderBookings.bind({});
|
|
40
40
|
ExpanderBookings.args = {
|
|
41
41
|
name: 'Bookings',
|
|
42
|
-
|
|
42
|
+
open: false,
|
|
43
43
|
lefticon: 'schedule',
|
|
44
44
|
lefticoncolor: 'gray',
|
|
45
45
|
};
|
|
46
|
-
const TemplateExpanderTags = ({ name,
|
|
46
|
+
const TemplateExpanderTags = ({ name, open }) => `
|
|
47
47
|
<div style="width: 268px;">
|
|
48
|
-
<tttx-expander name="${name}"
|
|
48
|
+
<tttx-expander name="${name}" open="${open}">
|
|
49
49
|
<div style="height: 36px; display: flex; align-items: center; gap: 8px;">
|
|
50
50
|
<tttx-icon style="height: 24px;" icon="check_box_outline_blank" color="gray"></tttx-icon><tttx-tag text="Safety critical" color="#F2BEBE"></tttx-tag>
|
|
51
51
|
</div>
|
|
@@ -58,5 +58,5 @@ const TemplateExpanderTags = ({ name, expanded }) => `
|
|
|
58
58
|
export const ExpanderTags = TemplateExpanderTags.bind({});
|
|
59
59
|
ExpanderTags.args = {
|
|
60
60
|
name: 'Tag',
|
|
61
|
-
|
|
61
|
+
open: true,
|
|
62
62
|
};
|