@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
|
@@ -1,95 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { p as purify, d as domSanitiserOptions } from './domsanitiser.options.js';
|
|
3
|
-
import { d as defineCustomElement$2 } from './tttx-icon2.js';
|
|
4
|
-
|
|
5
|
-
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}";
|
|
6
|
-
|
|
7
|
-
const TttxList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
8
|
-
constructor() {
|
|
9
|
-
super();
|
|
10
|
-
this.__registerHost();
|
|
11
|
-
this.__attachShadow();
|
|
12
|
-
this.rowClick = createEvent(this, "listRowClick", 7);
|
|
13
|
-
this.rowCheckboxClick = createEvent(this, "listRowCheckboxClick", 7);
|
|
14
|
-
this.data = undefined;
|
|
15
|
-
this._data = undefined;
|
|
16
|
-
this.name = undefined;
|
|
17
|
-
}
|
|
18
|
-
onDataChange() {
|
|
19
|
-
if (!this.data) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
if (typeof this.data === 'string') {
|
|
23
|
-
this._data = JSON.parse(this.data);
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
this._data = [...this.data];
|
|
27
|
-
}
|
|
28
|
-
for (const data of this._data) {
|
|
29
|
-
if (data.hasCheckbox && data.checked === undefined) {
|
|
30
|
-
data.checked = false;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
componentWillLoad() {
|
|
35
|
-
// dynamic constructor: any props can be added later
|
|
36
|
-
this.onDataChange();
|
|
37
|
-
}
|
|
38
|
-
onRowCheckboxHandler(event, item) {
|
|
39
|
-
event.stopPropagation();
|
|
40
|
-
if (!item.rowData)
|
|
41
|
-
return;
|
|
42
|
-
this.rowCheckboxClick.emit({ key: item.key, name: this.name, data: item.rowData });
|
|
43
|
-
}
|
|
44
|
-
onRowClickHandler(item) {
|
|
45
|
-
if ((!item.clickable && !item.toggleable) || !item.rowData)
|
|
46
|
-
return;
|
|
47
|
-
this.rowClick.emit({ key: item.key, name: this.name, data: item.rowData });
|
|
48
|
-
}
|
|
49
|
-
renderListItem(item) {
|
|
50
|
-
const cleanHTML = purify.sanitize(item.element, domSanitiserOptions);
|
|
51
|
-
return (h(Fragment, null, item.hasCheckbox && (h("div", { class: "checkbox" }, h("tttx-icon", { icon: item.checked ? 'check_box' : 'check_box_outline_blank', color: item.checked ? 'blue' : 'grey', onClick: event => {
|
|
52
|
-
this.onRowCheckboxHandler(event, item);
|
|
53
|
-
} }))), item.element && h("span", { class: "item-content", innerHTML: cleanHTML }), item.icon && (h("span", { class: "icons" }, h("tttx-icon", { class: "align-right", icon: item.icon, color: 'black' })))));
|
|
54
|
-
}
|
|
55
|
-
render() {
|
|
56
|
-
if (!this._data)
|
|
57
|
-
return;
|
|
58
|
-
return (h("ul", { class: "list" }, this._data.map((item) => (h("li", { key: item.key, class: 'item' +
|
|
59
|
-
(item.clickable ? ' clickable' : '') +
|
|
60
|
-
(item.toggleable ? ' toggleable' : '') +
|
|
61
|
-
(item.checked ? ' selected' : '') +
|
|
62
|
-
(item.active ? ' active' : ''), onClick: () => {
|
|
63
|
-
this.onRowClickHandler(item);
|
|
64
|
-
} }, this.renderListItem(item))))));
|
|
65
|
-
}
|
|
66
|
-
static get watchers() { return {
|
|
67
|
-
"data": ["onDataChange"]
|
|
68
|
-
}; }
|
|
69
|
-
static get style() { return tttxListCss; }
|
|
70
|
-
}, [1, "tttx-list", {
|
|
71
|
-
"data": [1025],
|
|
72
|
-
"name": [1],
|
|
73
|
-
"_data": [32]
|
|
74
|
-
}]);
|
|
75
|
-
function defineCustomElement$1() {
|
|
76
|
-
if (typeof customElements === "undefined") {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
const components = ["tttx-list", "tttx-icon"];
|
|
80
|
-
components.forEach(tagName => { switch (tagName) {
|
|
81
|
-
case "tttx-list":
|
|
82
|
-
if (!customElements.get(tagName)) {
|
|
83
|
-
customElements.define(tagName, TttxList$1);
|
|
84
|
-
}
|
|
85
|
-
break;
|
|
86
|
-
case "tttx-icon":
|
|
87
|
-
if (!customElements.get(tagName)) {
|
|
88
|
-
defineCustomElement$2();
|
|
89
|
-
}
|
|
90
|
-
break;
|
|
91
|
-
} });
|
|
92
|
-
}
|
|
1
|
+
import { T as TttxList$1, d as defineCustomElement$1 } from './tttx-list2.js';
|
|
93
2
|
|
|
94
3
|
const TttxList = TttxList$1;
|
|
95
4
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { p as purify, d as domSanitiserOptions } from './domsanitiser.options
|
|
3
|
-
import './
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Fragment } from '@stencil/core/internal/client';
|
|
2
|
+
import { p as purify, d as domSanitiserOptions } from './domsanitiser.options.js';
|
|
3
|
+
import { d as defineCustomElement$1 } from './tttx-icon2.js';
|
|
4
4
|
|
|
5
5
|
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}";
|
|
6
6
|
|
|
7
|
-
const TttxList = class {
|
|
8
|
-
constructor(
|
|
9
|
-
|
|
7
|
+
const TttxList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.__registerHost();
|
|
11
|
+
this.__attachShadow();
|
|
10
12
|
this.rowClick = createEvent(this, "listRowClick", 7);
|
|
11
13
|
this.rowCheckboxClick = createEvent(this, "listRowCheckboxClick", 7);
|
|
12
14
|
this.data = undefined;
|
|
@@ -64,7 +66,29 @@ const TttxList = class {
|
|
|
64
66
|
static get watchers() { return {
|
|
65
67
|
"data": ["onDataChange"]
|
|
66
68
|
}; }
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
+
static get style() { return tttxListCss; }
|
|
70
|
+
}, [1, "tttx-list", {
|
|
71
|
+
"data": [1025],
|
|
72
|
+
"name": [1],
|
|
73
|
+
"_data": [32]
|
|
74
|
+
}]);
|
|
75
|
+
function defineCustomElement() {
|
|
76
|
+
if (typeof customElements === "undefined") {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const components = ["tttx-list", "tttx-icon"];
|
|
80
|
+
components.forEach(tagName => { switch (tagName) {
|
|
81
|
+
case "tttx-list":
|
|
82
|
+
if (!customElements.get(tagName)) {
|
|
83
|
+
customElements.define(tagName, TttxList);
|
|
84
|
+
}
|
|
85
|
+
break;
|
|
86
|
+
case "tttx-icon":
|
|
87
|
+
if (!customElements.get(tagName)) {
|
|
88
|
+
defineCustomElement$1();
|
|
89
|
+
}
|
|
90
|
+
break;
|
|
91
|
+
} });
|
|
92
|
+
}
|
|
69
93
|
|
|
70
|
-
export { TttxList as
|
|
94
|
+
export { TttxList as T, defineCustomElement as d };
|
|
@@ -1,145 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as defineCustomElement$2 } from './tttx-icon2.js';
|
|
3
|
-
|
|
4
|
-
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}}";
|
|
5
|
-
|
|
6
|
-
const TttxSorter$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
|
-
constructor() {
|
|
8
|
-
super();
|
|
9
|
-
this.__registerHost();
|
|
10
|
-
this.__attachShadow();
|
|
11
|
-
this.sorterChangeEvent = createEvent(this, "sorterChangeEvent", 7);
|
|
12
|
-
this.toggleSorter = createEvent(this, "toggleSorter", 7);
|
|
13
|
-
this.sorterKey = undefined;
|
|
14
|
-
this.defaultSortDirection = 'descending';
|
|
15
|
-
this.fieldOptionsData = null;
|
|
16
|
-
this.defaultOption = '';
|
|
17
|
-
this.selectedField = this.defaultOption;
|
|
18
|
-
this.sortDirection = this.defaultSortDirection;
|
|
19
|
-
this.dropdownExpand = false;
|
|
20
|
-
this.dropdownOptions = undefined;
|
|
21
|
-
}
|
|
22
|
-
handleCloseSorter() {
|
|
23
|
-
this.dropdownExpand = false;
|
|
24
|
-
}
|
|
25
|
-
emitSortEvent() {
|
|
26
|
-
this.sorterChangeEvent.emit({
|
|
27
|
-
sorterDirection: this.sortDirection,
|
|
28
|
-
sorterKey: this.sorterKey,
|
|
29
|
-
sortField: this.selectedField,
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
onSortToggleClick(event) {
|
|
33
|
-
event.preventDefault();
|
|
34
|
-
if (this.sortDirection == 'ascending') {
|
|
35
|
-
this.sortDirection = 'descending';
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
this.sortDirection = 'ascending';
|
|
39
|
-
}
|
|
40
|
-
this.emitSortEvent();
|
|
41
|
-
}
|
|
42
|
-
onDropdownClicked() {
|
|
43
|
-
this.dropdownExpand = !this.dropdownExpand;
|
|
44
|
-
this.toggleSorter.emit(this.dropdownExpand);
|
|
45
|
-
}
|
|
46
|
-
onDropdownSelected(event) {
|
|
47
|
-
this.dropdownExpand = false;
|
|
48
|
-
const target = event.target;
|
|
49
|
-
this.selectedField = target.innerHTML;
|
|
50
|
-
this.emitSortEvent();
|
|
51
|
-
this.toggleSorter.emit(this.dropdownExpand);
|
|
52
|
-
}
|
|
53
|
-
// getOptionsList() {
|
|
54
|
-
// return this.el.shadowRoot.querySelectorAll('.dropdown-option');
|
|
55
|
-
// }
|
|
56
|
-
// /* istanbul ignore next */
|
|
57
|
-
// @Listen('keyup')
|
|
58
|
-
// handleKeyDown(ev: KeyboardEvent) {
|
|
59
|
-
// const keyboardEventValue = ev.key;
|
|
60
|
-
// if (document.activeElement.id != `sorter__${this.sorterKey}`) return;
|
|
61
|
-
// switch (keyboardEventValue) {
|
|
62
|
-
// case 'Enter':
|
|
63
|
-
// if (this._focussedElementIndex > -1) {
|
|
64
|
-
// const options = this.el.shadowRoot.querySelectorAll('.dropdown-option');
|
|
65
|
-
// this.selectedField = options[this._focussedElementIndex].innerHTML;
|
|
66
|
-
// this.emitSortEvent();
|
|
67
|
-
// }
|
|
68
|
-
// this.dropdownExpand = false;
|
|
69
|
-
// break;
|
|
70
|
-
// case 'Escape':
|
|
71
|
-
// this.dropdownExpand = false;
|
|
72
|
-
// break;
|
|
73
|
-
// case 'ArrowDown':
|
|
74
|
-
// this.dropdownExpand = true;
|
|
75
|
-
// if (this._focussedElementIndex > -1) {
|
|
76
|
-
// const options = this.getOptionsList();
|
|
77
|
-
// const currentOption = options[this._focussedElementIndex] as HTMLElement;
|
|
78
|
-
// currentOption.blur();
|
|
79
|
-
// options[this._focussedElementIndex].focus();
|
|
80
|
-
// this._focussedElementIndex + 1 < options.length ? this._focussedElementIndex++ : (this._focussedElementIndex = 0);
|
|
81
|
-
// } else {
|
|
82
|
-
// this._focussedElementIndex++;
|
|
83
|
-
// }
|
|
84
|
-
// break;
|
|
85
|
-
// case 'ArrowUp':
|
|
86
|
-
// this.dropdownExpand = true;
|
|
87
|
-
// if (this._focussedElementIndex == -1) {
|
|
88
|
-
// const options = this.getOptionsList();
|
|
89
|
-
// this._focussedElementIndex = options.length - 1;
|
|
90
|
-
// } else {
|
|
91
|
-
// const options = this.getOptionsList();
|
|
92
|
-
// const currentOption = options[this._focussedElementIndex] as HTMLElement;
|
|
93
|
-
// currentOption.blur();
|
|
94
|
-
// this._focussedElementIndex > 0 ? this._focussedElementIndex-- : (this._focussedElementIndex = options.length - 1);
|
|
95
|
-
// options[this._focussedElementIndex].focus();
|
|
96
|
-
// }
|
|
97
|
-
// break;
|
|
98
|
-
// }
|
|
99
|
-
// }
|
|
100
|
-
render() {
|
|
101
|
-
const parsedFieldOptionsData = typeof this.fieldOptionsData === 'string' ? JSON.parse(this.fieldOptionsData) : this.fieldOptionsData;
|
|
102
|
-
if (!this.fieldOptionsData)
|
|
103
|
-
return;
|
|
104
|
-
const arrowIcon = this.sortDirection == 'ascending' ? 'arrow_upward' : 'arrow_downward';
|
|
105
|
-
const chevronIcon = this.dropdownExpand ? 'expand_less' : 'expand_more';
|
|
106
|
-
const selectedOption = this.selectedField;
|
|
107
|
-
const dropdownSelectorClassNameModifier = this.dropdownExpand ? '--expanded' : '';
|
|
108
|
-
const sorterKey = `sorter__${this.sorterKey}`;
|
|
109
|
-
return (h(Host, { id: sorterKey }, h("div", { tabindex: 0, class: `sorter-container ${dropdownSelectorClassNameModifier}` }, h("button", { class: "arrow-toggle-button", type: "button", onClick: this.onSortToggleClick.bind(this) }, h("tttx-icon", { icon: arrowIcon, color: "black" })), h("div", { class: "dropdown-selector", onClick: this.onDropdownClicked.bind(this) }, h("div", { class: "dropdown-selector-button" }, h("div", { class: "dropdown-selector-text" }, selectedOption), h("div", { class: "dropdown-selector-chevron" }, h("tttx-icon", { icon: chevronIcon, color: "black" })))), this.dropdownExpand && (h("div", { class: "dropdown-options-list" }, parsedFieldOptionsData.sorterOptions.map(option => {
|
|
110
|
-
return (h("div", { class: "dropdown-option", tabIndex: -1, onClick: this.onDropdownSelected.bind(this), key: option.optionLabel }, option.optionLabel));
|
|
111
|
-
}))))));
|
|
112
|
-
}
|
|
113
|
-
get el() { return this; }
|
|
114
|
-
static get style() { return tttxSorterCss; }
|
|
115
|
-
}, [1, "tttx-sorter", {
|
|
116
|
-
"sorterKey": [1, "sorter-key"],
|
|
117
|
-
"defaultSortDirection": [1, "default-sort-direction"],
|
|
118
|
-
"fieldOptionsData": [1, "field-options-data"],
|
|
119
|
-
"defaultOption": [1, "default-option"],
|
|
120
|
-
"selectedField": [32],
|
|
121
|
-
"sortDirection": [32],
|
|
122
|
-
"dropdownExpand": [32],
|
|
123
|
-
"dropdownOptions": [32]
|
|
124
|
-
}, [[0, "closeSorter", "handleCloseSorter"]]]);
|
|
125
|
-
function defineCustomElement$1() {
|
|
126
|
-
if (typeof customElements === "undefined") {
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
const components = ["tttx-sorter", "tttx-icon"];
|
|
130
|
-
components.forEach(tagName => { switch (tagName) {
|
|
131
|
-
case "tttx-sorter":
|
|
132
|
-
if (!customElements.get(tagName)) {
|
|
133
|
-
customElements.define(tagName, TttxSorter$1);
|
|
134
|
-
}
|
|
135
|
-
break;
|
|
136
|
-
case "tttx-icon":
|
|
137
|
-
if (!customElements.get(tagName)) {
|
|
138
|
-
defineCustomElement$2();
|
|
139
|
-
}
|
|
140
|
-
break;
|
|
141
|
-
} });
|
|
142
|
-
}
|
|
1
|
+
import { T as TttxSorter$1, d as defineCustomElement$1 } from './tttx-sorter2.js';
|
|
143
2
|
|
|
144
3
|
const TttxSorter = TttxSorter$1;
|
|
145
4
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as defineCustomElement$1 } from './tttx-icon2.js';
|
|
2
3
|
|
|
3
4
|
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}}";
|
|
4
5
|
|
|
5
|
-
const TttxSorter = class {
|
|
6
|
-
constructor(
|
|
7
|
-
|
|
6
|
+
const TttxSorter = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.__attachShadow();
|
|
8
11
|
this.sorterChangeEvent = createEvent(this, "sorterChangeEvent", 7);
|
|
9
12
|
this.toggleSorter = createEvent(this, "toggleSorter", 7);
|
|
10
13
|
this.sorterKey = undefined;
|
|
@@ -107,8 +110,35 @@ const TttxSorter = class {
|
|
|
107
110
|
return (h("div", { class: "dropdown-option", tabIndex: -1, onClick: this.onDropdownSelected.bind(this), key: option.optionLabel }, option.optionLabel));
|
|
108
111
|
}))))));
|
|
109
112
|
}
|
|
110
|
-
get el() { return
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
+
get el() { return this; }
|
|
114
|
+
static get style() { return tttxSorterCss; }
|
|
115
|
+
}, [1, "tttx-sorter", {
|
|
116
|
+
"sorterKey": [1, "sorter-key"],
|
|
117
|
+
"defaultSortDirection": [1, "default-sort-direction"],
|
|
118
|
+
"fieldOptionsData": [1, "field-options-data"],
|
|
119
|
+
"defaultOption": [1, "default-option"],
|
|
120
|
+
"selectedField": [32],
|
|
121
|
+
"sortDirection": [32],
|
|
122
|
+
"dropdownExpand": [32],
|
|
123
|
+
"dropdownOptions": [32]
|
|
124
|
+
}, [[0, "closeSorter", "handleCloseSorter"]]]);
|
|
125
|
+
function defineCustomElement() {
|
|
126
|
+
if (typeof customElements === "undefined") {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const components = ["tttx-sorter", "tttx-icon"];
|
|
130
|
+
components.forEach(tagName => { switch (tagName) {
|
|
131
|
+
case "tttx-sorter":
|
|
132
|
+
if (!customElements.get(tagName)) {
|
|
133
|
+
customElements.define(tagName, TttxSorter);
|
|
134
|
+
}
|
|
135
|
+
break;
|
|
136
|
+
case "tttx-icon":
|
|
137
|
+
if (!customElements.get(tagName)) {
|
|
138
|
+
defineCustomElement$1();
|
|
139
|
+
}
|
|
140
|
+
break;
|
|
141
|
+
} });
|
|
142
|
+
}
|
|
113
143
|
|
|
114
|
-
export { TttxSorter as
|
|
144
|
+
export { TttxSorter as T, defineCustomElement as d };
|
|
@@ -1,50 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
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}";
|
|
4
|
-
|
|
5
|
-
const TttxToolbar$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
-
constructor() {
|
|
7
|
-
super();
|
|
8
|
-
this.__registerHost();
|
|
9
|
-
this.__attachShadow();
|
|
10
|
-
this.border = true;
|
|
11
|
-
this.viewSize = undefined;
|
|
12
|
-
}
|
|
13
|
-
handleResize() {
|
|
14
|
-
this.setViewSize();
|
|
15
|
-
}
|
|
16
|
-
async componentWillLoad() {
|
|
17
|
-
this.setViewSize();
|
|
18
|
-
}
|
|
19
|
-
setViewSize() {
|
|
20
|
-
if (window.innerWidth < 698) {
|
|
21
|
-
this.viewSize = 'mobile';
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
this.viewSize = 'desktop';
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
render() {
|
|
28
|
-
return (h(Host, null, h("div", { class: `container ${this.border ? 'bordered' : ''} ${this.viewSize}` }, h("slot", { name: 'before' }), h("slot", { name: 'center' }), h("slot", { name: 'after' }))));
|
|
29
|
-
}
|
|
30
|
-
static get style() { return tttxToolbarCss; }
|
|
31
|
-
}, [1, "tttx-toolbar", {
|
|
32
|
-
"border": [4],
|
|
33
|
-
"viewSize": [32]
|
|
34
|
-
}, [[9, "resize", "handleResize"]]]);
|
|
35
|
-
function defineCustomElement$1() {
|
|
36
|
-
if (typeof customElements === "undefined") {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
const components = ["tttx-toolbar"];
|
|
40
|
-
components.forEach(tagName => { switch (tagName) {
|
|
41
|
-
case "tttx-toolbar":
|
|
42
|
-
if (!customElements.get(tagName)) {
|
|
43
|
-
customElements.define(tagName, TttxToolbar$1);
|
|
44
|
-
}
|
|
45
|
-
break;
|
|
46
|
-
} });
|
|
47
|
-
}
|
|
1
|
+
import { T as TttxToolbar$1, d as defineCustomElement$1 } from './tttx-toolbar2.js';
|
|
48
2
|
|
|
49
3
|
const TttxToolbar = TttxToolbar$1;
|
|
50
4
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
|
|
3
3
|
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}";
|
|
4
4
|
|
|
5
|
-
const TttxToolbar = class {
|
|
6
|
-
constructor(
|
|
7
|
-
|
|
5
|
+
const TttxToolbar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.__attachShadow();
|
|
8
10
|
this.border = true;
|
|
9
11
|
this.viewSize = undefined;
|
|
10
12
|
}
|
|
@@ -25,7 +27,23 @@ const TttxToolbar = class {
|
|
|
25
27
|
render() {
|
|
26
28
|
return (h(Host, null, h("div", { class: `container ${this.border ? 'bordered' : ''} ${this.viewSize}` }, h("slot", { name: 'before' }), h("slot", { name: 'center' }), h("slot", { name: 'after' }))));
|
|
27
29
|
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
+
static get style() { return tttxToolbarCss; }
|
|
31
|
+
}, [1, "tttx-toolbar", {
|
|
32
|
+
"border": [4],
|
|
33
|
+
"viewSize": [32]
|
|
34
|
+
}, [[9, "resize", "handleResize"]]]);
|
|
35
|
+
function defineCustomElement() {
|
|
36
|
+
if (typeof customElements === "undefined") {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const components = ["tttx-toolbar"];
|
|
40
|
+
components.forEach(tagName => { switch (tagName) {
|
|
41
|
+
case "tttx-toolbar":
|
|
42
|
+
if (!customElements.get(tagName)) {
|
|
43
|
+
customElements.define(tagName, TttxToolbar);
|
|
44
|
+
}
|
|
45
|
+
break;
|
|
46
|
+
} });
|
|
47
|
+
}
|
|
30
48
|
|
|
31
|
-
export { TttxToolbar as
|
|
49
|
+
export { TttxToolbar as T, defineCustomElement as d };
|
package/dist/esm/loader.js
CHANGED
|
@@ -11,7 +11,7 @@ const patchEsm = () => {
|
|
|
11
11
|
const defineCustomElements = (win, options) => {
|
|
12
12
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
13
13
|
return patchEsm().then(() => {
|
|
14
|
-
return bootstrapLazy([["tttx-multiselect-box",[[1,"tttx-multiselect-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"htmlVisibleValue":[4,"html-visible-value"],"visibleValue":[1,"visible-value"],"open":[32],"unsavedSelectedItems":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-dialog-box",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"allowOverflow":[4,"allow-overflow"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-select-box",[[1,"tttx-select-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"selectedValue":[1,"selected-value"],"open":[32],"selectedItem":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-tree-view",[[1,"tttx-tree-view",{"data":[1040],"treeData":[32],"selectedId":[32]}]]],["tttx-expander",[[1,"tttx-expander",{"name":[1],"
|
|
14
|
+
return bootstrapLazy([["tttx-data-pattern",[[1,"tttx-data-pattern",{"data":[1],"sorteroptions":[1],"filteroptions":[1],"filterheader":[1]}]]],["tttx-multiselect-box",[[1,"tttx-multiselect-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"htmlVisibleValue":[4,"html-visible-value"],"visibleValue":[1,"visible-value"],"open":[32],"unsavedSelectedItems":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-dialog-box",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"allowOverflow":[4,"allow-overflow"],"elementSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-select-box",[[1,"tttx-select-box",{"optionsData":[1,"options-data"],"label":[1],"inline":[4],"placeholder":[1],"searchEnabled":[4,"search-enabled"],"selectedValue":[1,"selected-value"],"open":[32],"selectedItem":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-tree-view",[[1,"tttx-tree-view",{"data":[1040],"treeData":[32],"selectedId":[32]}]]],["tttx-expander",[[1,"tttx-expander",{"name":[1],"open":[4],"lefticon":[1],"lefticoncolor":[1],"isExpanded":[32]}]]],["tttx-tabs",[[2,"tttx-tabs",{"tabsName":[1,"tabs-name"],"navigation":[4],"wide":[4],"tabs":[1],"_tabs":[32]},[[0,"keydown","handleKeyDown"]]]]],["tttx-form",[[1,"tttx-form",{"formschema":[1025],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block",[[1,"tttx-keyvalue-block",{"keyvalues":[1],"horizontal":[4],"spacedout":[4],"_elements":[32]}]]],["tttx-loading-spinner",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-percentage-bar",[[2,"tttx-percentage-bar",{"percentage":[8],"thresholds":[1],"color":[1],"min":[1],"labelid":[1],"_percentage":[32],"_ranges":[32],"_min":[32]}]]],["tttx-qrcode",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-tag",[[1,"tttx-tag",{"text":[1],"color":[1],"textColor":[1,"text-color"]}]]],["tttx-textarea",[[2,"tttx-textarea",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"rows":[2],"textareaautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"disabled":[4],"maxlength":[8],"name":[1],"placeholder":[1],"readonly":[8],"required":[4],"value":[1032]}]]],["tttx-icon",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]],["tttx-standalone-input",[[2,"tttx-standalone-input",{"label":[1],"secondarylabel":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"iconleft":[1],"iconleftcolor":[1],"iconright":[1],"iconrightcolor":[1],"inputicon":[1],"inputiconcolor":[1],"inline":[4],"inputautocapitalize":[1],"inputautofocus":[4],"inputkeyhint":[1],"inputindex":[8],"inputtitle":[1],"autocomplete":[1],"checked":[4],"disabled":[4],"max":[8],"maxlength":[8],"min":[8],"minlength":[8],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[8],"required":[4],"step":[8],"type":[1],"value":[1032]}]]],["tttx-filter_4",[[1,"tttx-filter",{"filterKey":[1,"filter-key"],"filterOptions":[1,"filter-options"],"showSelectAll":[4,"show-select-all"],"showSearchField":[4,"show-search-field"],"showOptionIcons":[4,"show-option-icons"],"filterButtonStyle":[1,"filter-button-style"],"filterHeader":[1,"filter-header"],"defaultFilterOptions":[1,"default-filter-options"],"popoverWidth":[1,"popover-width"],"showPopover":[32],"displayedFilterSettings":[32],"selectedFilters":[32],"filterSearchTerm":[32],"allSelected":[32]},[[0,"closeFilter","handleCloseFilter"]]],[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32]}],[1,"tttx-sorter",{"sorterKey":[1,"sorter-key"],"defaultSortDirection":[1,"default-sort-direction"],"fieldOptionsData":[1,"field-options-data"],"defaultOption":[1,"default-option"],"selectedField":[32],"sortDirection":[32],"dropdownExpand":[32],"dropdownOptions":[32]},[[0,"closeSorter","handleCloseSorter"]]],[1,"tttx-toolbar",{"border":[4],"viewSize":[32]},[[9,"resize","handleResize"]]]]],["tttx-button",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
17
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-65b1e0d1.js';
|
|
2
|
+
|
|
3
|
+
const tttxDataPatternCss = ":host{display:block}";
|
|
4
|
+
|
|
5
|
+
const TttxDataPattern = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.data = undefined;
|
|
9
|
+
this.sorteroptions = undefined;
|
|
10
|
+
this.filteroptions = undefined;
|
|
11
|
+
this.filterheader = 'Filter';
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return (h(Host, null, h("div", { class: "container" }, h("tttx-toolbar", { border: true }, h("span", { slot: "before" }, h("tttx-sorter", { sorterKey: "data-pattern-list", fieldOptionsData: this.sorteroptions, defaultOption: "Sort by" }), h("tttx-filter", { "filter-options": JSON.stringify(this.filteroptions), showSelectAll: false, "show-option-icons": true, "filter-header": this.filterheader, "filter-key": "data-pattern-list" })), h("span", { slot: "after" }, h("tttx-standalone-input", { class: "qualifications-filter", showerrorbubble: false, inputicon: "search", inline: true, required: true, placeholder: "Search", type: "text",
|
|
15
|
+
// onInput={this.debounceFilter.bind(this)}
|
|
16
|
+
maxlength: 30 }))), h("tttx-toolbar", { border: false }, h("span", { slot: "before" }, h("tttx-button", { design: "primary", icon: "add" }, "Add"))), h("tttx-list", { data: this.data }))));
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
TttxDataPattern.style = tttxDataPatternCss;
|
|
20
|
+
|
|
21
|
+
export { TttxDataPattern as tttx_data_pattern };
|
|
@@ -1,21 +1,32 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-65b1e0d1.js';
|
|
2
2
|
|
|
3
|
-
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}";
|
|
3
|
+
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}";
|
|
4
4
|
|
|
5
5
|
const TttxExpander = class {
|
|
6
6
|
constructor(hostRef) {
|
|
7
7
|
registerInstance(this, hostRef);
|
|
8
|
-
this.
|
|
8
|
+
this.toggleExpander = createEvent(this, "toggleExpander", 7);
|
|
9
9
|
this.name = undefined;
|
|
10
|
-
this.
|
|
10
|
+
this.open = false;
|
|
11
11
|
this.lefticon = undefined;
|
|
12
12
|
this.lefticoncolor = undefined;
|
|
13
|
+
this.isExpanded = false;
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
this.
|
|
15
|
+
componentWillRender() {
|
|
16
|
+
this.isExpanded = this.open;
|
|
17
|
+
}
|
|
18
|
+
handleExpand() {
|
|
19
|
+
// pre-render logic, so the attribute check is reversed
|
|
20
|
+
if (this.expander.getAttribute('open') === null) {
|
|
21
|
+
this.isExpanded = true;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
this.isExpanded = false;
|
|
25
|
+
}
|
|
26
|
+
this.toggleExpander.emit({ open: this.isExpanded, name: this.name });
|
|
16
27
|
}
|
|
17
28
|
render() {
|
|
18
|
-
return (h(Host, null, h("
|
|
29
|
+
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)))));
|
|
19
30
|
}
|
|
20
31
|
};
|
|
21
32
|
TttxExpander.style = tttxExpanderCss;
|