@3t-transform/threeteeui 0.1.65 → 0.1.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,7 +14,7 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["tttx-dialog-box.cjs",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"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"],"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]}]]],["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-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-toolbar.cjs",[[1,"tttx-toolbar",{"border":[4]}]]],["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-dialog-box.cjs",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"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"],"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],"setAllCheckboxes":[64]}]]],["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-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-toolbar.cjs",[[1,"tttx-toolbar",{"border":[4]}]]],["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
 
@@ -6,37 +6,78 @@ const index = require('./index-43af0e62.js');
6
6
  const domsanitiser_options = require('./domsanitiser.options-1dfa7205.js');
7
7
  require('./_commonjsHelpers-537d719a.js');
8
8
 
9
- 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}.item{list-style:none;margin:0;padding:8px;border-bottom:1px solid #d5d5d5;min-height:36px;display:flex;align-items:center}.item:first-of-type{border-top:1px solid #d5d5d5}.item.clickable:hover{cursor:pointer}.item.clickable:active{background-color:#e6e6e6}.item:hover{background-color:#1111110D}.align-right{margin-left:auto}.item-content{display:flex;align-items:center}";
9
+ 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.clickable:active{background-color:#e6e6e6}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:hover{background-color:#1111110D}.align-right{margin-left:auto}.item-content{display:flex;align-items:center;flex-grow:2;min-height:36px}.checkbox{padding:6px;margin-left:-8px}";
10
10
 
11
11
  const TttxList = class {
12
12
  constructor(hostRef) {
13
13
  index.registerInstance(this, hostRef);
14
14
  this.rowClick = index.createEvent(this, "listRowClick", 7);
15
+ this.rowCheckboxClick = index.createEvent(this, "listRowCheckboxClick", 7);
15
16
  this.data = undefined;
17
+ this._data = undefined;
16
18
  this.name = undefined;
17
19
  }
20
+ onDataChange() {
21
+ if (!this.data) {
22
+ return;
23
+ }
24
+ if (typeof this.data === 'string') {
25
+ this._data = JSON.parse(this.data);
26
+ }
27
+ else {
28
+ this._data = [...this.data];
29
+ }
30
+ for (const data of this._data) {
31
+ if (data.hasCheckbox && data.checked === undefined) {
32
+ data.checked = false;
33
+ }
34
+ }
35
+ }
36
+ componentWillLoad() {
37
+ // dynamic constructor: any props can be added later
38
+ this.onDataChange();
39
+ }
40
+ onRowCheckboxHandler(event, item) {
41
+ event.stopPropagation();
42
+ if (!item.rowData)
43
+ return;
44
+ if (item.hasCheckbox) {
45
+ item.checked = !item.checked;
46
+ }
47
+ // re-render component by updating its state
48
+ this._data = [...this._data];
49
+ this.rowCheckboxClick.emit({ key: item.key, name: this.name, data: item.rowData, checked: item.checked });
50
+ }
18
51
  onRowClickHandler(item) {
19
52
  if (!item.clickable || !item.rowData)
20
53
  return;
21
- this.rowClick.emit({ name: this.name, data: item.rowData });
54
+ this.rowClick.emit({ key: item.key, name: this.name, data: item.rowData });
55
+ }
56
+ async setAllCheckboxes(check) {
57
+ for (const data of this._data) {
58
+ if (data.hasCheckbox) {
59
+ data.checked = check;
60
+ }
61
+ }
62
+ // re-render component by updating its state
63
+ this._data = [...this._data];
22
64
  }
23
65
  renderListItem(item) {
24
66
  const cleanHTML = domsanitiser_options.purify.sanitize(item.element, domsanitiser_options.domSanitiserOptions);
25
67
  return (index.h("li", { class: `item ${item.clickable ? 'clickable' : ''}`, onClick: () => {
26
68
  this.onRowClickHandler(item);
27
- } }, item.element && index.h("span", { class: "item-content", innerHTML: cleanHTML }), item.icon && index.h("tttx-icon", { class: "align-right ", icon: item.icon })));
69
+ } }, 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 => {
70
+ this.onRowCheckboxHandler(event, item);
71
+ } }))), 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' })))));
28
72
  }
29
73
  render() {
30
- if (!this.data)
74
+ if (!this._data)
31
75
  return;
32
- if (typeof this.data === 'string') {
33
- this._data = JSON.parse(this.data);
34
- }
35
- else {
36
- this._data = this.data;
37
- }
38
76
  return index.h("ul", { class: "list" }, this._data.map((item) => this.renderListItem(item)));
39
77
  }
78
+ static get watchers() { return {
79
+ "data": ["onDataChange"]
80
+ }; }
40
81
  };
41
82
  TttxList.style = tttxListCss;
42
83
 
@@ -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],"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"],"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]}]]],["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-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-toolbar.cjs",[[1,"tttx-toolbar",{"border":[4]}]]],["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-dialog-box.cjs",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"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"],"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],"setAllCheckboxes":[64]}]]],["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-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-toolbar.cjs",[[1,"tttx-toolbar",{"border":[4]}]]],["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;
@@ -29,26 +29,40 @@
29
29
  padding: 0;
30
30
  }
31
31
 
32
- .item {
32
+ li {
33
+ display: flex;
34
+ align-items: flex-start;
35
+ }
36
+ li.item {
33
37
  list-style: none;
34
38
  margin: 0;
35
39
  padding: 8px;
36
40
  border-bottom: 1px solid #d5d5d5;
37
41
  min-height: 36px;
38
- /* center the contents vertically */
39
- display: flex;
40
- align-items: center;
41
42
  }
42
- .item:first-of-type {
43
+ li.item:first-of-type {
43
44
  border-top: 1px solid #d5d5d5;
44
45
  }
45
- .item.clickable:hover {
46
+ li.item.clickable:hover {
46
47
  cursor: pointer;
47
48
  }
48
- .item.clickable:active {
49
+ li.item.clickable:active {
49
50
  background-color: #e6e6e6;
50
51
  }
51
- .item:hover {
52
+ li.item .icons {
53
+ display: flex;
54
+ justify-content: flex-end;
55
+ flex-grow: 1;
56
+ align-items: center;
57
+ height: 36px;
58
+ }
59
+ li.item .icons tttx-icon:hover {
60
+ cursor: pointer;
61
+ }
62
+ li.item .icons * {
63
+ display: flex;
64
+ }
65
+ li:hover {
52
66
  background-color: #1111110D;
53
67
  }
54
68
 
@@ -59,4 +73,11 @@
59
73
  .item-content {
60
74
  display: flex;
61
75
  align-items: center;
76
+ flex-grow: 2;
77
+ min-height: 36px;
78
+ }
79
+
80
+ .checkbox {
81
+ padding: 6px;
82
+ margin-left: -8px;
62
83
  }
@@ -5,28 +5,65 @@ import domSanitiserOptions from '../../../shared/domsanitiser.options';
5
5
  export class TttxList {
6
6
  constructor() {
7
7
  this.data = undefined;
8
+ this._data = undefined;
8
9
  this.name = undefined;
9
10
  }
11
+ onDataChange() {
12
+ if (!this.data) {
13
+ return;
14
+ }
15
+ if (typeof this.data === 'string') {
16
+ this._data = JSON.parse(this.data);
17
+ }
18
+ else {
19
+ this._data = [...this.data];
20
+ }
21
+ for (const data of this._data) {
22
+ if (data.hasCheckbox && data.checked === undefined) {
23
+ data.checked = false;
24
+ }
25
+ }
26
+ }
27
+ componentWillLoad() {
28
+ // dynamic constructor: any props can be added later
29
+ this.onDataChange();
30
+ }
31
+ onRowCheckboxHandler(event, item) {
32
+ event.stopPropagation();
33
+ if (!item.rowData)
34
+ return;
35
+ if (item.hasCheckbox) {
36
+ item.checked = !item.checked;
37
+ }
38
+ // re-render component by updating its state
39
+ this._data = [...this._data];
40
+ this.rowCheckboxClick.emit({ key: item.key, name: this.name, data: item.rowData, checked: item.checked });
41
+ }
10
42
  onRowClickHandler(item) {
11
43
  if (!item.clickable || !item.rowData)
12
44
  return;
13
- this.rowClick.emit({ name: this.name, data: item.rowData });
45
+ this.rowClick.emit({ key: item.key, name: this.name, data: item.rowData });
46
+ }
47
+ async setAllCheckboxes(check) {
48
+ for (const data of this._data) {
49
+ if (data.hasCheckbox) {
50
+ data.checked = check;
51
+ }
52
+ }
53
+ // re-render component by updating its state
54
+ this._data = [...this._data];
14
55
  }
15
56
  renderListItem(item) {
16
57
  const cleanHTML = DOMPurify.sanitize(item.element, domSanitiserOptions);
17
58
  return (h("li", { class: `item ${item.clickable ? 'clickable' : ''}`, onClick: () => {
18
59
  this.onRowClickHandler(item);
19
- } }, item.element && h("span", { class: "item-content", innerHTML: cleanHTML }), item.icon && h("tttx-icon", { class: "align-right ", icon: item.icon })));
60
+ } }, 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 => {
61
+ this.onRowCheckboxHandler(event, item);
62
+ } }))), 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' })))));
20
63
  }
21
64
  render() {
22
- if (!this.data)
65
+ if (!this._data)
23
66
  return;
24
- if (typeof this.data === 'string') {
25
- this._data = JSON.parse(this.data);
26
- }
27
- else {
28
- this._data = this.data;
29
- }
30
67
  return h("ul", { class: "list" }, this._data.map((item) => this.renderListItem(item)));
31
68
  }
32
69
  static get is() { return "tttx-list"; }
@@ -84,6 +121,11 @@ export class TttxList {
84
121
  }
85
122
  };
86
123
  }
124
+ static get states() {
125
+ return {
126
+ "_data": {}
127
+ };
128
+ }
87
129
  static get events() {
88
130
  return [{
89
131
  "method": "rowClick",
@@ -96,10 +138,54 @@ export class TttxList {
96
138
  "text": ""
97
139
  },
98
140
  "complexType": {
99
- "original": "any",
100
- "resolved": "any",
141
+ "original": "{ key: string; name: string; data: any }",
142
+ "resolved": "{ key: string; name: string; data: any; }",
143
+ "references": {}
144
+ }
145
+ }, {
146
+ "method": "rowCheckboxClick",
147
+ "name": "listRowCheckboxClick",
148
+ "bubbles": true,
149
+ "cancelable": true,
150
+ "composed": true,
151
+ "docs": {
152
+ "tags": [],
153
+ "text": ""
154
+ },
155
+ "complexType": {
156
+ "original": "{ key: string; name: string; data: any; checked: boolean }",
157
+ "resolved": "{ key: string; name: string; data: any; checked: boolean; }",
101
158
  "references": {}
102
159
  }
103
160
  }];
104
161
  }
162
+ static get methods() {
163
+ return {
164
+ "setAllCheckboxes": {
165
+ "complexType": {
166
+ "signature": "(check: boolean) => Promise<void>",
167
+ "parameters": [{
168
+ "tags": [],
169
+ "text": ""
170
+ }],
171
+ "references": {
172
+ "Promise": {
173
+ "location": "global"
174
+ }
175
+ },
176
+ "return": "Promise<void>"
177
+ },
178
+ "docs": {
179
+ "text": "",
180
+ "tags": []
181
+ }
182
+ }
183
+ };
184
+ }
185
+ static get watchers() {
186
+ return [{
187
+ "propName": "data",
188
+ "methodName": "onDataChange"
189
+ }];
190
+ }
105
191
  }
@@ -4,7 +4,7 @@ export default {
4
4
  component: 'tttx-list',
5
5
  parameters: {
6
6
  actions: {
7
- handles: ['listRowClick'],
7
+ handles: ['listRowClick', 'listRowCheckboxClick'],
8
8
  },
9
9
  },
10
10
  decorators: [withActions],
@@ -21,7 +21,7 @@ BasicStringList.args = {
21
21
  data: [
22
22
  { icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="green" /></span> Demulon 1,000,000' },
23
23
  { icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="green" /></span> Patrick' },
24
- { icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="orange" /></span> Lee' },
24
+ { icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="orange" /></span> Lee', clickable: true },
25
25
  { element: '<span><tttx-icon icon="egg" color="red" /></span> Ben' },
26
26
  ],
27
27
  };
@@ -61,7 +61,12 @@ const TemplateClickableList = ({ data }) => `
61
61
  export const BasicClickableList = TemplateClickableList.bind({});
62
62
  BasicClickableList.args = {
63
63
  data: [
64
- { clickable: true, icon: 'chevron_right', element: '<span><tttx-icon icon="egg" /></span> Demulon 1,000,000', rowData: '[{ "name": "Demulon 1,000,000" }]' },
64
+ {
65
+ clickable: true,
66
+ icon: 'chevron_right',
67
+ element: '<span><tttx-icon icon="egg" /></span> Demulon 1,000,000',
68
+ rowData: '[{ "name": "Demulon 1,000,000" }]',
69
+ },
65
70
  { clickable: true, icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="red" /></span> Emma', rowData: [{ name: 'Emma' }] },
66
71
  { clickable: true, icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="green" /></span> Eulogio', rowData: 'Eulogio' },
67
72
  { clickable: true, icon: 'chevron_right', element: '<span><tttx-icon icon="egg" color="red" /></span> Patrick' },
@@ -69,3 +74,73 @@ BasicClickableList.args = {
69
74
  { icon: 'chevron_right', element: '<span><tttx-icon icon="egg" /></span> Ben' },
70
75
  ],
71
76
  };
77
+ const TemplateWorkerList = ({ data }) => `
78
+ <tttx-list
79
+ id='workersList'
80
+ name='workersList'
81
+ ></tttx-list>
82
+ <script>
83
+ if(!workersList) {
84
+ const workersList = document.getElementId('workersList');
85
+ }
86
+ workersList.data = ${JSON.stringify(data)};
87
+ </script>
88
+ `;
89
+ export const WorkerList = TemplateWorkerList.bind({});
90
+ WorkerList.args = {
91
+ data: [
92
+ {
93
+ key: '54c5b6fd-12d1-4794-92cb-93f4c2e1a892',
94
+ hasCheckbox: true,
95
+ clickable: true,
96
+ icon: 'chevron_right',
97
+ element: `
98
+ <div style="display: flex; flex-direction: row; align-items: flex-start;">
99
+ <label>
100
+ <ul style="list-style-type: none; padding: 0; margin: 0;">
101
+ <li>
102
+ <span style="padding: 8px; display: inline-flex; align-items: center;">
103
+ <a style="font-weight: 500; color: #146EB3; text-decoration: none;" href>Worker name</a>
104
+ </span>
105
+ <span style="padding: 8px; display: inline-flex; align-items: center; gap: 4px;">
106
+ <span style="color: #757575;">ID:</span> <span style="color: #212121;">9125</span>
107
+ </span>
108
+ </li>
109
+ <li>
110
+ <span style="padding: 8px; display: inline-flex; align-items: center; gap: 8px;">
111
+ <span style="font-size: 14px; background-color: #EABFFF; border-radius: 20px; padding: 4px 8px; display: inline-flex; align-items: center;">Driller</span>
112
+ <span style="font-size: 14px; background-color: #9BE8D5; border-radius: 20px; padding: 4px 8px; display: inline-flex; align-items: center;">Offshore</span>
113
+ <span style="font-size: 14px; background-color: #B9CCF5; border-radius: 20px; padding: 4px 8px; display: inline-flex; align-items: center;">3t Transform</span>
114
+ </span>
115
+ </li>
116
+ <li>
117
+ <span style="padding: 8px; display: inline-flex; align-items: center; gap: 8px;">
118
+ <span><tttx-icon icon="school" color="gray" /></span><span><tttx-icon icon="check_circle" color="green" /></span> 80%
119
+ </span>
120
+ <span style="padding: 8px; display: inline-flex; align-items: center; gap: 8px;">
121
+ <span><tttx-icon icon="verified_user" color="gray" /></span><span><tttx-icon icon="warning" color="orange" /></span> 60%
122
+ </span>
123
+ </li>
124
+ </ul>
125
+ </label>
126
+ </div>
127
+ `,
128
+ rowData: '{ "name": "Worker name", "id": 9125, "groups": ["Driller", "Offshore", "3t Transform"], "compliance": 80, "competence": 60 }',
129
+ },
130
+ {
131
+ key: 'a5df3398-2bd0-4e16-83a1-b962b74dc712',
132
+ clickable: true,
133
+ icon: 'chevron_right',
134
+ element: `
135
+ <div style="display: flex; flex-direction: row; align-items: center; gap: 8px;">
136
+ <span><tttx-icon icon="check_circle" color="green" /></span>
137
+ Qualification row
138
+ <span style="font-size: 14px; background-color: #D5D5D5; border-radius: 20px; padding: 4px 8px; display: inline-flex; align-items: center;">Vantage</span>
139
+ <span style="color: #757575;">Awarded:</span> <span style="color: #212121;">10 Jan 2022</span>
140
+ <span style="color: #757575;">Expiry:</span> <span style="color: #212121;">10 Jan 2023</span>
141
+ </div>
142
+ `,
143
+ rowData: 'any data',
144
+ },
145
+ ],
146
+ };
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/i
2
2
  import { p as purify, d as domSanitiserOptions } from './domsanitiser.options.js';
3
3
  import { d as defineCustomElement$2 } from './tttx-icon2.js';
4
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}.item{list-style:none;margin:0;padding:8px;border-bottom:1px solid #d5d5d5;min-height:36px;display:flex;align-items:center}.item:first-of-type{border-top:1px solid #d5d5d5}.item.clickable:hover{cursor:pointer}.item.clickable:active{background-color:#e6e6e6}.item:hover{background-color:#1111110D}.align-right{margin-left:auto}.item-content{display:flex;align-items:center}";
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.clickable:active{background-color:#e6e6e6}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:hover{background-color:#1111110D}.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
7
  const TttxList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
8
8
  constructor() {
@@ -10,35 +10,78 @@ const TttxList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
10
10
  this.__registerHost();
11
11
  this.__attachShadow();
12
12
  this.rowClick = createEvent(this, "listRowClick", 7);
13
+ this.rowCheckboxClick = createEvent(this, "listRowCheckboxClick", 7);
13
14
  this.data = undefined;
15
+ this._data = undefined;
14
16
  this.name = undefined;
15
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
+ if (item.hasCheckbox) {
43
+ item.checked = !item.checked;
44
+ }
45
+ // re-render component by updating its state
46
+ this._data = [...this._data];
47
+ this.rowCheckboxClick.emit({ key: item.key, name: this.name, data: item.rowData, checked: item.checked });
48
+ }
16
49
  onRowClickHandler(item) {
17
50
  if (!item.clickable || !item.rowData)
18
51
  return;
19
- this.rowClick.emit({ name: this.name, data: item.rowData });
52
+ this.rowClick.emit({ key: item.key, name: this.name, data: item.rowData });
53
+ }
54
+ async setAllCheckboxes(check) {
55
+ for (const data of this._data) {
56
+ if (data.hasCheckbox) {
57
+ data.checked = check;
58
+ }
59
+ }
60
+ // re-render component by updating its state
61
+ this._data = [...this._data];
20
62
  }
21
63
  renderListItem(item) {
22
64
  const cleanHTML = purify.sanitize(item.element, domSanitiserOptions);
23
65
  return (h("li", { class: `item ${item.clickable ? 'clickable' : ''}`, onClick: () => {
24
66
  this.onRowClickHandler(item);
25
- } }, item.element && h("span", { class: "item-content", innerHTML: cleanHTML }), item.icon && h("tttx-icon", { class: "align-right ", icon: item.icon })));
67
+ } }, 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 => {
68
+ this.onRowCheckboxHandler(event, item);
69
+ } }))), 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' })))));
26
70
  }
27
71
  render() {
28
- if (!this.data)
72
+ if (!this._data)
29
73
  return;
30
- if (typeof this.data === 'string') {
31
- this._data = JSON.parse(this.data);
32
- }
33
- else {
34
- this._data = this.data;
35
- }
36
74
  return h("ul", { class: "list" }, this._data.map((item) => this.renderListItem(item)));
37
75
  }
76
+ static get watchers() { return {
77
+ "data": ["onDataChange"]
78
+ }; }
38
79
  static get style() { return tttxListCss; }
39
80
  }, [1, "tttx-list", {
40
81
  "data": [1025],
41
- "name": [1]
82
+ "name": [1],
83
+ "_data": [32],
84
+ "setAllCheckboxes": [64]
42
85
  }]);
43
86
  function defineCustomElement$1() {
44
87
  if (typeof customElements === "undefined") {
@@ -11,7 +11,7 @@ const patchEsm = () => {
11
11
  const defineCustomElements = (win, options) => {
12
12
  if (typeof window === 'undefined') return Promise.resolve();
13
13
  return patchEsm().then(() => {
14
- return bootstrapLazy([["tttx-dialog-box",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"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"],"open":[32],"selectedItem":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-tree-view",[[1,"tttx-tree-view",{"data":[1040],"treeData":[32]}]]],["tttx-filter",[[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",[[1,"tttx-list",{"data":[1025],"name":[1]}]]],["tttx-sorter",[[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-form",[[1,"tttx-form",{"formschema":[1032],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-loading-spinner",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-qrcode",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-toolbar",[[1,"tttx-toolbar",{"border":[4]}]]],["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-button",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
14
+ return bootstrapLazy([["tttx-dialog-box",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"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"],"open":[32],"selectedItem":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-tree-view",[[1,"tttx-tree-view",{"data":[1040],"treeData":[32]}]]],["tttx-filter",[[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",[[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32],"setAllCheckboxes":[64]}]]],["tttx-sorter",[[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-form",[[1,"tttx-form",{"formschema":[1032],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-loading-spinner",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-qrcode",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-toolbar",[[1,"tttx-toolbar",{"border":[4]}]]],["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-button",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
15
15
  });
16
16
  };
17
17
 
@@ -2,37 +2,78 @@ import { r as registerInstance, c as createEvent, h } from './index-1c711ead.js'
2
2
  import { p as purify, d as domSanitiserOptions } from './domsanitiser.options-97a33389.js';
3
3
  import './_commonjsHelpers-9943807e.js';
4
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}.item{list-style:none;margin:0;padding:8px;border-bottom:1px solid #d5d5d5;min-height:36px;display:flex;align-items:center}.item:first-of-type{border-top:1px solid #d5d5d5}.item.clickable:hover{cursor:pointer}.item.clickable:active{background-color:#e6e6e6}.item:hover{background-color:#1111110D}.align-right{margin-left:auto}.item-content{display:flex;align-items:center}";
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.clickable:active{background-color:#e6e6e6}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:hover{background-color:#1111110D}.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
7
  const TttxList = class {
8
8
  constructor(hostRef) {
9
9
  registerInstance(this, hostRef);
10
10
  this.rowClick = createEvent(this, "listRowClick", 7);
11
+ this.rowCheckboxClick = createEvent(this, "listRowCheckboxClick", 7);
11
12
  this.data = undefined;
13
+ this._data = undefined;
12
14
  this.name = undefined;
13
15
  }
16
+ onDataChange() {
17
+ if (!this.data) {
18
+ return;
19
+ }
20
+ if (typeof this.data === 'string') {
21
+ this._data = JSON.parse(this.data);
22
+ }
23
+ else {
24
+ this._data = [...this.data];
25
+ }
26
+ for (const data of this._data) {
27
+ if (data.hasCheckbox && data.checked === undefined) {
28
+ data.checked = false;
29
+ }
30
+ }
31
+ }
32
+ componentWillLoad() {
33
+ // dynamic constructor: any props can be added later
34
+ this.onDataChange();
35
+ }
36
+ onRowCheckboxHandler(event, item) {
37
+ event.stopPropagation();
38
+ if (!item.rowData)
39
+ return;
40
+ if (item.hasCheckbox) {
41
+ item.checked = !item.checked;
42
+ }
43
+ // re-render component by updating its state
44
+ this._data = [...this._data];
45
+ this.rowCheckboxClick.emit({ key: item.key, name: this.name, data: item.rowData, checked: item.checked });
46
+ }
14
47
  onRowClickHandler(item) {
15
48
  if (!item.clickable || !item.rowData)
16
49
  return;
17
- this.rowClick.emit({ name: this.name, data: item.rowData });
50
+ this.rowClick.emit({ key: item.key, name: this.name, data: item.rowData });
51
+ }
52
+ async setAllCheckboxes(check) {
53
+ for (const data of this._data) {
54
+ if (data.hasCheckbox) {
55
+ data.checked = check;
56
+ }
57
+ }
58
+ // re-render component by updating its state
59
+ this._data = [...this._data];
18
60
  }
19
61
  renderListItem(item) {
20
62
  const cleanHTML = purify.sanitize(item.element, domSanitiserOptions);
21
63
  return (h("li", { class: `item ${item.clickable ? 'clickable' : ''}`, onClick: () => {
22
64
  this.onRowClickHandler(item);
23
- } }, item.element && h("span", { class: "item-content", innerHTML: cleanHTML }), item.icon && h("tttx-icon", { class: "align-right ", icon: item.icon })));
65
+ } }, 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 => {
66
+ this.onRowCheckboxHandler(event, item);
67
+ } }))), 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' })))));
24
68
  }
25
69
  render() {
26
- if (!this.data)
70
+ if (!this._data)
27
71
  return;
28
- if (typeof this.data === 'string') {
29
- this._data = JSON.parse(this.data);
30
- }
31
- else {
32
- this._data = this.data;
33
- }
34
72
  return h("ul", { class: "list" }, this._data.map((item) => this.renderListItem(item)));
35
73
  }
74
+ static get watchers() { return {
75
+ "data": ["onDataChange"]
76
+ }; }
36
77
  };
37
78
  TttxList.style = tttxListCss;
38
79
 
package/dist/esm/tttx.js CHANGED
@@ -14,5 +14,5 @@ const patchBrowser = () => {
14
14
  };
15
15
 
16
16
  patchBrowser().then(options => {
17
- return bootstrapLazy([["tttx-dialog-box",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"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"],"open":[32],"selectedItem":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-tree-view",[[1,"tttx-tree-view",{"data":[1040],"treeData":[32]}]]],["tttx-filter",[[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",[[1,"tttx-list",{"data":[1025],"name":[1]}]]],["tttx-sorter",[[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-form",[[1,"tttx-form",{"formschema":[1032],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-loading-spinner",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-qrcode",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-toolbar",[[1,"tttx-toolbar",{"border":[4]}]]],["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-button",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
17
+ return bootstrapLazy([["tttx-dialog-box",[[1,"tttx-dialog-box",{"data":[1025],"size":[1],"open":[1028],"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"],"open":[32],"selectedItem":[32],"searchTerm":[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["tttx-tree-view",[[1,"tttx-tree-view",{"data":[1040],"treeData":[32]}]]],["tttx-filter",[[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",[[1,"tttx-list",{"data":[1025],"name":[1],"_data":[32],"setAllCheckboxes":[64]}]]],["tttx-sorter",[[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-form",[[1,"tttx-form",{"formschema":[1032],"data":[1032],"submit":[64]}]]],["tttx-keyvalue-block",[[1,"tttx-keyvalue-block",{"keyvalues":[8],"horizontal":[4]}]]],["tttx-loading-spinner",[[1,"tttx-loading-spinner",{"loadingMessage":[1028,"loading-message"],"size":[1025]}]]],["tttx-qrcode",[[1,"tttx-qrcode",{"link":[1025],"size":[1026]}]]],["tttx-toolbar",[[1,"tttx-toolbar",{"border":[4]}]]],["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-button",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"iconcolor":[1025],"design":[1]}]]]], options);
18
18
  });
@@ -0,0 +1 @@
1
+ import{r as i,c as t,h as e}from"./p-c544551b.js";import{p as o,d as s}from"./p-5ed38d61.js";import"./p-112455b1.js";const n=class{constructor(e){i(this,e),this.rowClick=t(this,"listRowClick",7),this.rowCheckboxClick=t(this,"listRowCheckboxClick",7),this.data=void 0,this._data=void 0,this.name=void 0}onDataChange(){if(this.data){this._data="string"==typeof this.data?JSON.parse(this.data):[...this.data];for(const i of this._data)i.hasCheckbox&&void 0===i.checked&&(i.checked=!1)}}componentWillLoad(){this.onDataChange()}onRowCheckboxHandler(i,t){i.stopPropagation(),t.rowData&&(t.hasCheckbox&&(t.checked=!t.checked),this._data=[...this._data],this.rowCheckboxClick.emit({key:t.key,name:this.name,data:t.rowData,checked:t.checked}))}onRowClickHandler(i){i.clickable&&i.rowData&&this.rowClick.emit({key:i.key,name:this.name,data:i.rowData})}async setAllCheckboxes(i){for(const t of this._data)t.hasCheckbox&&(t.checked=i);this._data=[...this._data]}renderListItem(i){const t=o.sanitize(i.element,s);return e("li",{class:"item "+(i.clickable?"clickable":""),onClick:()=>{this.onRowClickHandler(i)}},i.hasCheckbox&&e("div",{class:"checkbox"},e("tttx-icon",{icon:i.checked?"check_box":"check_box_outline_blank",color:i.checked?"blue":"grey",onClick:t=>{this.onRowCheckboxHandler(t,i)}})),i.element&&e("span",{class:"item-content",innerHTML:t}),i.icon&&e("span",{class:"icons"},e("tttx-icon",{class:"align-right",icon:i.icon,color:"black"})))}render(){if(this._data)return e("ul",{class:"list"},this._data.map((i=>this.renderListItem(i))))}static get watchers(){return{data:["onDataChange"]}}};n.style='.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.clickable:active{background-color:#e6e6e6}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:hover{background-color:#1111110D}.align-right{margin-left:auto}.item-content{display:flex;align-items:center;flex-grow:2;min-height:36px}.checkbox{padding:6px;margin-left:-8px}';export{n as tttx_list}
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-c544551b.js";export{s as setNonce}from"./p-c544551b.js";(()=>{const t=import.meta.url,o={};return""!==t&&(o.resourcesUrl=new URL(".",t).href),e(o)})().then((e=>t([["p-64479f02",[[1,"tttx-dialog-box",{data:[1025],size:[1],open:[1028],elementSize:[32]},[[9,"resize","handleResize"]]]]],["p-ff38d9f3",[[1,"tttx-select-box",{optionsData:[1,"options-data"],label:[1],inline:[4],placeholder:[1],searchEnabled:[4,"search-enabled"],open:[32],selectedItem:[32],searchTerm:[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["p-2f066b53",[[1,"tttx-tree-view",{data:[1040],treeData:[32]}]]],["p-a658e1ac",[[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"]]]]],["p-cec36804",[[1,"tttx-list",{data:[1025],name:[1]}]]],["p-225e6fa6",[[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"]]]]],["p-57621fdb",[[1,"tttx-form",{formschema:[1032],data:[1032],submit:[64]}]]],["p-f80ab1d8",[[1,"tttx-keyvalue-block",{keyvalues:[8],horizontal:[4]}]]],["p-3467c62e",[[1,"tttx-loading-spinner",{loadingMessage:[1028,"loading-message"],size:[1025]}]]],["p-cff962bf",[[1,"tttx-qrcode",{link:[1025],size:[1026]}]]],["p-4879a614",[[1,"tttx-toolbar",{border:[4]}]]],["p-53fa8b4d",[[1,"tttx-icon",{icon:[1],color:[1]}]]],["p-e6bbdae3",[[2,"tttx-standalone-input",{label:[1],secondarylabel:[1],showerrormsg:[4],showerrorbubble:[4],errormsg:[1],iconleft:[1],iconleftcolor:[1],iconright:[1],iconrightcolor:[1],inputicon:[1],inputiconcolor:[1],inline:[4],inputautocapitalize:[1],inputautofocus:[4],inputkeyhint:[1],inputindex:[8],inputtitle:[1],autocomplete:[1],checked:[4],disabled:[4],max:[8],maxlength:[8],min:[8],minlength:[8],name:[1],pattern:[1],placeholder:[1],readonly:[8],required:[4],step:[8],type:[1],value:[1032]}]]],["p-3c7e11d9",[[1,"tttx-button",{notext:[4],icon:[1],iconposition:[1],iconcolor:[1025],design:[1]}]]]],e)));
1
+ import{p as e,b as t}from"./p-c544551b.js";export{s as setNonce}from"./p-c544551b.js";(()=>{const t=import.meta.url,o={};return""!==t&&(o.resourcesUrl=new URL(".",t).href),e(o)})().then((e=>t([["p-64479f02",[[1,"tttx-dialog-box",{data:[1025],size:[1],open:[1028],elementSize:[32]},[[9,"resize","handleResize"]]]]],["p-ff38d9f3",[[1,"tttx-select-box",{optionsData:[1,"options-data"],label:[1],inline:[4],placeholder:[1],searchEnabled:[4,"search-enabled"],open:[32],selectedItem:[32],searchTerm:[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["p-2f066b53",[[1,"tttx-tree-view",{data:[1040],treeData:[32]}]]],["p-a658e1ac",[[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"]]]]],["p-40c66a2e",[[1,"tttx-list",{data:[1025],name:[1],_data:[32],setAllCheckboxes:[64]}]]],["p-225e6fa6",[[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"]]]]],["p-57621fdb",[[1,"tttx-form",{formschema:[1032],data:[1032],submit:[64]}]]],["p-f80ab1d8",[[1,"tttx-keyvalue-block",{keyvalues:[8],horizontal:[4]}]]],["p-3467c62e",[[1,"tttx-loading-spinner",{loadingMessage:[1028,"loading-message"],size:[1025]}]]],["p-cff962bf",[[1,"tttx-qrcode",{link:[1025],size:[1026]}]]],["p-4879a614",[[1,"tttx-toolbar",{border:[4]}]]],["p-53fa8b4d",[[1,"tttx-icon",{icon:[1],color:[1]}]]],["p-e6bbdae3",[[2,"tttx-standalone-input",{label:[1],secondarylabel:[1],showerrormsg:[4],showerrorbubble:[4],errormsg:[1],iconleft:[1],iconleftcolor:[1],iconright:[1],iconrightcolor:[1],inputicon:[1],inputiconcolor:[1],inline:[4],inputautocapitalize:[1],inputautofocus:[4],inputkeyhint:[1],inputindex:[8],inputtitle:[1],autocomplete:[1],checked:[4],disabled:[4],max:[8],maxlength:[8],min:[8],minlength:[8],name:[1],pattern:[1],placeholder:[1],readonly:[8],required:[4],step:[8],type:[1],value:[1032]}]]],["p-3c7e11d9",[[1,"tttx-button",{notext:[4],icon:[1],iconposition:[1],iconcolor:[1025],design:[1]}]]]],e)));
@@ -1,6 +1,9 @@
1
1
  export interface ListItem {
2
- element: string;
3
- icon: string;
4
- clickable: boolean;
5
- rowData: any;
2
+ key?: string;
3
+ hasCheckbox?: boolean;
4
+ checked?: boolean;
5
+ element?: string;
6
+ icon?: string;
7
+ clickable?: boolean;
8
+ rowData?: any;
6
9
  }
@@ -2,10 +2,24 @@ import { EventEmitter } from '../../../stencil-public-runtime';
2
2
  import { ListItem } from './interfaces';
3
3
  export declare class TttxList {
4
4
  data: string | ListItem[];
5
+ _data: ListItem[];
5
6
  name: string;
6
- rowClick: EventEmitter;
7
- private _data;
7
+ onDataChange(): void;
8
+ componentWillLoad(): void;
9
+ rowClick: EventEmitter<{
10
+ key: string;
11
+ name: string;
12
+ data: any;
13
+ }>;
14
+ rowCheckboxClick: EventEmitter<{
15
+ key: string;
16
+ name: string;
17
+ data: any;
18
+ checked: boolean;
19
+ }>;
20
+ onRowCheckboxHandler(event: PointerEvent, item: ListItem): void;
8
21
  onRowClickHandler(item: ListItem): void;
22
+ setAllCheckboxes(check: boolean): Promise<void>;
9
23
  renderListItem(item: ListItem): any;
10
24
  render(): any;
11
25
  }
@@ -12,3 +12,4 @@ export default _default;
12
12
  export declare const BasicStringList: any;
13
13
  export declare const BasicObjectList: any;
14
14
  export declare const BasicClickableList: any;
15
+ export declare const WorkerList: any;
@@ -52,6 +52,7 @@ export namespace Components {
52
52
  interface TttxList {
53
53
  "data": string | ListItem[];
54
54
  "name": string;
55
+ "setAllCheckboxes": (check: boolean) => Promise<void>;
55
56
  }
56
57
  interface TttxLoadingSpinner {
57
58
  "loadingMessage": boolean;
@@ -305,7 +306,8 @@ declare namespace LocalJSX {
305
306
  interface TttxList {
306
307
  "data"?: string | ListItem[];
307
308
  "name"?: string;
308
- "onListRowClick"?: (event: TttxListCustomEvent<any>) => void;
309
+ "onListRowCheckboxClick"?: (event: TttxListCustomEvent<{ key: string; name: string; data: any; checked: boolean }>) => void;
310
+ "onListRowClick"?: (event: TttxListCustomEvent<{ key: string; name: string; data: any }>) => void;
309
311
  }
310
312
  interface TttxLoadingSpinner {
311
313
  "loadingMessage"?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3t-transform/threeteeui",
3
- "version": "0.1.65",
3
+ "version": "0.1.66",
4
4
  "description": "3t Design System",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1 +0,0 @@
1
- import{r as t,c as i,h as e}from"./p-c544551b.js";import{p as s,d as o}from"./p-5ed38d61.js";import"./p-112455b1.js";const n=class{constructor(e){t(this,e),this.rowClick=i(this,"listRowClick",7),this.data=void 0,this.name=void 0}onRowClickHandler(t){t.clickable&&t.rowData&&this.rowClick.emit({name:this.name,data:t.rowData})}renderListItem(t){const i=s.sanitize(t.element,o);return e("li",{class:"item "+(t.clickable?"clickable":""),onClick:()=>{this.onRowClickHandler(t)}},t.element&&e("span",{class:"item-content",innerHTML:i}),t.icon&&e("tttx-icon",{class:"align-right ",icon:t.icon}))}render(){if(this.data)return this._data="string"==typeof this.data?JSON.parse(this.data):this.data,e("ul",{class:"list"},this._data.map((t=>this.renderListItem(t))))}};n.style='.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}.item{list-style:none;margin:0;padding:8px;border-bottom:1px solid #d5d5d5;min-height:36px;display:flex;align-items:center}.item:first-of-type{border-top:1px solid #d5d5d5}.item.clickable:hover{cursor:pointer}.item.clickable:active{background-color:#e6e6e6}.item:hover{background-color:#1111110D}.align-right{margin-left:auto}.item-content{display:flex;align-items:center}';export{n as tttx_list}