@3t-transform/threeteeui 0.1.8 → 0.1.19

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.
Files changed (109) hide show
  1. package/dist/cjs/{index-8ba406f6.js → index-b8a62ede.js} +80 -1
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/tttx-button.cjs.entry.js +24 -24
  4. package/dist/cjs/tttx-filter.cjs.entry.js +162 -0
  5. package/dist/cjs/tttx-form.cjs.entry.js +363 -363
  6. package/dist/cjs/tttx-icon.cjs.entry.js +11 -11
  7. package/dist/cjs/tttx-keyvalue-block.cjs.entry.js +62 -58
  8. package/dist/cjs/tttx-list.cjs.entry.js +43 -43
  9. package/dist/cjs/tttx-loading-spinner.cjs.entry.js +16 -16
  10. package/dist/cjs/tttx-standalone-input.cjs.entry.js +60 -60
  11. package/dist/cjs/tttx-toolbar.cjs.entry.js +10 -10
  12. package/dist/cjs/tttx.cjs.js +2 -2
  13. package/dist/collection/collection-manifest.json +1 -0
  14. package/dist/collection/components/atoms/tttx-button/tttx-button.js +110 -110
  15. package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +14 -14
  16. package/dist/collection/components/atoms/tttx-icon/tttx-icon.js +62 -62
  17. package/dist/collection/components/atoms/tttx-icon/tttx-icon.stories.js +22 -22
  18. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.css +6 -0
  19. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js +111 -107
  20. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.js +38 -38
  21. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.js +67 -67
  22. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.js +17 -17
  23. package/dist/collection/components/molecules/tttx-filter/tttx-filter.css +215 -0
  24. package/dist/collection/components/molecules/tttx-filter/tttx-filter.js +325 -0
  25. package/dist/collection/components/molecules/tttx-filter/tttx-filter.stories.js +118 -0
  26. package/dist/collection/components/molecules/tttx-form/lib/setErrorState.js +35 -35
  27. package/dist/collection/components/molecules/tttx-form/lib/validityCheck.js +58 -58
  28. package/dist/collection/components/molecules/tttx-form/tttx-form.js +364 -364
  29. package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +127 -127
  30. package/dist/collection/components/molecules/tttx-list/tttx-list.js +105 -105
  31. package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +43 -43
  32. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +627 -627
  33. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +157 -157
  34. package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.js +44 -44
  35. package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.stories.js +14 -14
  36. package/dist/collection/components/palette.stories.js +7 -7
  37. package/dist/collection/docs/gettingstarted-developer.stories.js +5 -5
  38. package/dist/collection/icons.js +2838 -2838
  39. package/dist/collection/index.js +1 -1
  40. package/dist/collection/shared/domsanitiser.options.js +14 -14
  41. package/dist/components/index.d.ts +1 -0
  42. package/dist/components/index.js +1 -0
  43. package/dist/components/tttx-button.js +48 -48
  44. package/dist/components/tttx-filter.d.ts +11 -0
  45. package/dist/components/tttx-filter.js +195 -0
  46. package/dist/components/tttx-form.js +380 -380
  47. package/dist/components/tttx-icon2.js +28 -28
  48. package/dist/components/tttx-keyvalue-block.js +79 -75
  49. package/dist/components/tttx-list.js +65 -65
  50. package/dist/components/tttx-loading-spinner.js +33 -33
  51. package/dist/components/tttx-standalone-input.js +107 -107
  52. package/dist/components/tttx-toolbar.js +26 -26
  53. package/dist/esm/{index-5f9b72ff.js → index-e888a5f4.js} +80 -2
  54. package/dist/esm/loader.js +3 -3
  55. package/dist/esm/polyfills/core-js.js +0 -0
  56. package/dist/esm/polyfills/dom.js +0 -0
  57. package/dist/esm/polyfills/es5-html-element.js +0 -0
  58. package/dist/esm/polyfills/index.js +0 -0
  59. package/dist/esm/polyfills/system.js +0 -0
  60. package/dist/esm/tttx-button.entry.js +24 -24
  61. package/dist/esm/tttx-filter.entry.js +158 -0
  62. package/dist/esm/tttx-form.entry.js +363 -363
  63. package/dist/esm/tttx-icon.entry.js +11 -11
  64. package/dist/esm/tttx-keyvalue-block.entry.js +62 -58
  65. package/dist/esm/tttx-list.entry.js +43 -43
  66. package/dist/esm/tttx-loading-spinner.entry.js +16 -16
  67. package/dist/esm/tttx-standalone-input.entry.js +60 -60
  68. package/dist/esm/tttx-toolbar.entry.js +10 -10
  69. package/dist/esm/tttx.js +3 -3
  70. package/dist/tttx/{p-405219b2.entry.js → p-01f4628e.entry.js} +1 -1
  71. package/dist/tttx/{p-435c62b3.entry.js → p-043f9b8a.entry.js} +1 -1
  72. package/dist/tttx/{p-9cff9c64.entry.js → p-34052e38.entry.js} +1 -1
  73. package/dist/tttx/p-41f5b296.entry.js +1 -0
  74. package/dist/tttx/{p-0342cc46.entry.js → p-4cf3e1e0.entry.js} +1 -1
  75. package/dist/tttx/{p-1290dcd7.entry.js → p-6dff6b5a.entry.js} +1 -1
  76. package/dist/tttx/p-6f535da9.entry.js +1 -0
  77. package/dist/tttx/{p-adf35f58.entry.js → p-96bbf1ed.entry.js} +1 -1
  78. package/dist/tttx/{p-4ecc9e8b.entry.js → p-b3a03986.entry.js} +1 -1
  79. package/dist/tttx/p-f764ffc4.js +2 -0
  80. package/dist/tttx/tttx.esm.js +1 -1
  81. package/dist/types/components/atoms/tttx-button/tttx-button.d.ts +10 -10
  82. package/dist/types/components/atoms/tttx-button/tttx-button.stories.d.ts +10 -10
  83. package/dist/types/components/atoms/tttx-icon/tttx-icon.d.ts +5 -5
  84. package/dist/types/components/atoms/tttx-icon/tttx-icon.stories.d.ts +20 -20
  85. package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.d.ts +7 -7
  86. package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.d.ts +9 -9
  87. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.d.ts +6 -6
  88. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.d.ts +17 -17
  89. package/dist/types/components/molecules/tttx-filter/tttx-filter.d.ts +37 -0
  90. package/dist/types/components/molecules/tttx-filter/tttx-filter.stories.d.ts +43 -0
  91. package/dist/types/components/molecules/tttx-form/lib/setErrorState.d.ts +13 -13
  92. package/dist/types/components/molecules/tttx-form/lib/validityCheck.d.ts +17 -17
  93. package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +114 -114
  94. package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +13 -13
  95. package/dist/types/components/molecules/tttx-list/tttx-list.d.ts +11 -11
  96. package/dist/types/components/molecules/tttx-list/tttx-list.stories.d.ts +14 -14
  97. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +56 -56
  98. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.d.ts +123 -123
  99. package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.d.ts +4 -4
  100. package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.stories.d.ts +13 -13
  101. package/dist/types/components/palette.stories.d.ts +6 -6
  102. package/dist/types/components.d.ts +33 -0
  103. package/dist/types/docs/gettingstarted-developer.stories.d.ts +5 -5
  104. package/dist/types/icons.d.ts +2 -2
  105. package/dist/types/index.d.ts +1 -1
  106. package/dist/types/shared/domsanitiser.options.d.ts +10 -10
  107. package/package.json +1 -1
  108. package/dist/tttx/p-1b394414.entry.js +0 -1
  109. package/dist/tttx/p-c4b803fc.js +0 -2
@@ -0,0 +1,158 @@
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-e888a5f4.js';
2
+
3
+ const tttxFilterCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.material-symbols-rounded{font-family:\"Material Symbols Rounded\", sans-serif;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;color:#9e9e9e}.filter-container .filter-button{display:inline-flex;justify-content:center;align-items:center;font-size:14px;font-weight:400;font-family:\"Roboto\", serif;text-transform:uppercase;color:#212121;border:1px solid #d5d5d5;border-radius:4px;background:transparent;height:36px;width:95px;margin:0;padding-right:16px}.filter-container .filter-button .filter-icon{padding-left:8px;padding-right:4px}.filter-container .filter-button.--list-icon{font-size:0;width:36px;height:36px;padding:0}.filter-container .filter-button.--list-icon .filter-icon{padding:0}.filter-container .filter-button.--list-icon:hover{background:#e3e3e3}.filter-container .filter-button.--table-icon{font-size:0;width:36px;height:36px;padding:0;border:none}.filter-container .filter-button.--table-icon .filter-icon{padding:0;width:24px;height:24px}.filter-container .filter-button.--table-icon:hover{background:#e3e3e3;border-radius:50%;width:36px;height:36px}.filter-container .filter-button:hover{background:#e3e3e3}.filter-container .filter-popover-container{display:block;width:196px;border-radius:4px;box-shadow:0px 1px 5px #1111114D;position:absolute}.filter-container .filter-popover-container .filter-header{color:#757575;text-transform:uppercase;font-size:14px;font-weight:500;font-family:\"Roboto\", serif;padding-left:16px;padding-top:12px;padding-bottom:12px;margin:0}.filter-container .filter-popover-container .popover-divider{border:none;width:164px;display:flex;margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:8px;height:1px;background-color:#d5d5d5}.filter-container .filter-popover-container .filter-option{display:flex;flex-direction:row;align-items:center;height:36px;padding-left:22px;padding-bottom:4px}.filter-container .filter-popover-container .filter-option .select-all-icon{padding-right:6px}.filter-container .filter-popover-container .filter-option .checkbox-icon{padding-right:8px}.filter-container .filter-popover-container .filter-option .filter-label{padding-left:8px;padding-bottom:3px;font-size:16px;font-weight:500;font-family:\"Roboto\", serif}.filter-container .filter-popover-container .filter-option:first-child{margin-top:8px}.filter-container .filter-popover-container .filter-option:last-child{margin-bottom:8px}.filter-container .filter-popover-container .filter-popover-button-container{display:flex;justify-content:flex-end;align-items:center;padding-bottom:8px}.filter-container .filter-popover-container .filter-popover-button-container .close-button{height:36px;width:74px;background-color:white;border:1px solid #d5d5d5;border-radius:4px;text-transform:uppercase;margin-right:8px;font-size:14px;font-weight:400;font-family:\"Roboto\", serif}.filter-container .filter-popover-container .filter-popover-button-container .apply-button{height:36px;width:73px;background-color:#1479c6;color:white;border-radius:4px;border:none;text-transform:uppercase;margin-right:16px;font-size:14px;font-weight:400;font-family:\"Roboto\", serif}.filter-container .filter-popover-container.--with-search-field{width:252px}.filter-container .filter-popover-container.--with-search-field .popover-divider{width:220px}.filter-container .filter-popover-container.--with-search-field .popover-divider:first-child{top:44px}.filter-container .filter-popover-container.--with-search-field .search-field-container{position:relative;color:#d5d5d5;width:220px;height:36px;padding:0 16px}.filter-container .filter-popover-container.--with-search-field .search-field-container .search-icon{position:absolute;top:50%;padding-left:8px;padding-bottom:9.2px;height:17px;width:17px;transform:translateY(-50%)}.filter-container .filter-popover-container.--with-search-field .search-field-container .search-input{padding-left:36px;border:1px solid #d5d5d5;border-radius:4px;height:36px;width:220px;font-size:16px;font-family:\"Roboto\", serif;font-weight:500;color:#9e9e9e;box-sizing:border-box}.filter-container .filter-popover-container.--with-search-field .search-field-container .search-input:focus-visible,.filter-container .filter-popover-container.--with-search-field .search-field-container .search-input:focus{outline:none;border:1px solid #1479c6}.filter-container .filter-popover-container.--with-search-field .search-field-container .search-input::placeholder{color:#9e9e9e;font-size:16px;font-family:\"Roboto\", serif;font-weight:500}.filter-container .filter-popover-container.--with-search-field .search-field-container .popover-divider{margin-top:8px}.filter-container .filter-popover-container.--with-search-field .filter-option:first-child{padding-top:8px}";
4
+
5
+ const TttxFilter = class {
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ this.filterChangeEvent = createEvent(this, "filterChangeEvent", 7);
9
+ this.filterKey = undefined;
10
+ this.filterOptions = [
11
+ { optionIcon: 'cancel', optionIconColor: 'darkred', optionText: 'Expired' },
12
+ { optionIcon: 'warning', optionIconColor: 'orange', optionText: 'Expiring soon' },
13
+ { optionIcon: 'check_circle', optionIconColor: 'green', optionText: 'Active' },
14
+ ];
15
+ this.showSelectAll = true;
16
+ this.showSearchField = false;
17
+ this.showOptionIcons = true;
18
+ this.filterButtonStyle = 'list filter';
19
+ this.filterHeader = 'Qualification status';
20
+ this.showPopover = false;
21
+ this.selectedFilters = this.filterOptions.map((filterOption) => filterOption.optionText);
22
+ this.filterSearchTerm = '';
23
+ this.displayedFilterSettings = this.filterOptions;
24
+ this.allSelected = true;
25
+ }
26
+ emitFilterEvent() {
27
+ this.filterChangeEvent.emit({
28
+ selectedFilters: this.selectedFilters,
29
+ filterKey: this.filterKey,
30
+ allSelected: this.allSelected,
31
+ });
32
+ }
33
+ onFilterButtonClick() {
34
+ this.togglePopover();
35
+ }
36
+ onCloseButtonClick() {
37
+ this.togglePopover();
38
+ }
39
+ onApplyFilterButtonClick() {
40
+ this.emitFilterEvent();
41
+ this.togglePopover();
42
+ }
43
+ onFilterOptionSelected(selectedOption) {
44
+ this.allSelected = false;
45
+ if (this.selectedFilters.includes(selectedOption)) {
46
+ this.selectedFilters = this.selectedFilters.filter((filter) => filter != selectedOption);
47
+ }
48
+ else {
49
+ this.selectedFilters = [...this.selectedFilters, selectedOption];
50
+ }
51
+ }
52
+ togglePopover() {
53
+ this.showPopover = !this.showPopover;
54
+ // if(!this.showPopover) {
55
+ // // this._focussedElementIndex = -1;
56
+ // }
57
+ }
58
+ // Commented out keyboard interaction for now
59
+ // @Listen('keyup')
60
+ // handleKeyUp(event: KeyboardEvent) {
61
+ // const keyboardEventValue = event.key;
62
+ // if (document.activeElement.id != `filter__${this.filterKey}`) return;
63
+ // if (event.key == " " || event.code == "Space" || event.keyCode == 32) {
64
+ // if (this._focussedElementIndex == 0) {
65
+ // this.onSelectAllClick()
66
+ // } else {
67
+ // const options = this.el.shadowRoot.querySelectorAll('.filter-option') as HTMLElement[];
68
+ // this.onFilterOptionSelected(options[this._focussedElementIndex].textContent)
69
+ // }
70
+ // return;
71
+ // }
72
+ // switch (keyboardEventValue) {
73
+ // case 'Enter':
74
+ // if(!this.showPopover) {
75
+ // this.showPopover=true
76
+ // } else {
77
+ // this.emitFilterEvent()
78
+ // }
79
+ // break;
80
+ // case 'Escape':
81
+ // this.showPopover = false;
82
+ // this._focussedElementIndex = -1;
83
+ // break;
84
+ // case 'ArrowDown':
85
+ // this.showPopover = true;
86
+ // if (this._focussedElementIndex == -1) {
87
+ // this._focussedElementIndex = 0;
88
+ // } else {
89
+ // const options = this.el.shadowRoot.querySelectorAll('.filter-option') as HTMLElement[];
90
+ // const currentOption = options[this._focussedElementIndex] as HTMLElement;
91
+ // currentOption.blur();
92
+ // // options[this._focussedElementIndex].focus();
93
+ // this._focussedElementIndex + 1 < options.length ? this._focussedElementIndex++ : (this._focussedElementIndex = 0);
94
+ // }
95
+ // break;
96
+ // case 'ArrowUp':
97
+ // if (this._focussedElementIndex == -1) {
98
+ // this.showPopover = true;
99
+ // this._focussedElementIndex = 0;
100
+ // } else {
101
+ // const options = this.el.shadowRoot.querySelectorAll('.filter-option') as HTMLElement[];
102
+ // const currentOption = options[this._focussedElementIndex] as HTMLElement;
103
+ // currentOption.blur();
104
+ // // options[this._focussedElementIndex].focus();
105
+ // this._focussedElementIndex > 0 ? this._focussedElementIndex-- : (this._focussedElementIndex = options.length - 1);
106
+ // }
107
+ // break;
108
+ // }
109
+ // }
110
+ handleFilterChange(event) {
111
+ const target = event.target;
112
+ this.filterSearchTerm = target.value;
113
+ const filteredResults = this.filterOptions.filter((filterOption) => {
114
+ const lowercaseOption = filterOption.optionText.toLowerCase();
115
+ const filterTerm = this.filterSearchTerm.toLowerCase();
116
+ return lowercaseOption.includes(filterTerm);
117
+ });
118
+ this.displayedFilterSettings = filteredResults;
119
+ }
120
+ onSelectAllClick() {
121
+ this.allSelected = !this.allSelected;
122
+ if (this.allSelected) {
123
+ this.displayedFilterSettings.forEach((filterSetting) => { this.selectedFilters = [...this.selectedFilters, filterSetting.optionText]; });
124
+ }
125
+ else {
126
+ this.selectedFilters = [];
127
+ }
128
+ }
129
+ getFilterButtonClassName(buttonStyle) {
130
+ switch (buttonStyle) {
131
+ case 'table icon': {
132
+ return '--table-icon';
133
+ }
134
+ case 'list icon': {
135
+ return '--list-icon';
136
+ }
137
+ default: {
138
+ return '';
139
+ }
140
+ }
141
+ }
142
+ render() {
143
+ const filterPopoverContainerClassNameModifier = this.showSearchField ? '--with-search-field' : '';
144
+ const selectAllCheckboxIcon = this.allSelected ? 'check_box' : 'check_box_outline_blank';
145
+ const selectAllCheckboxColor = this.allSelected ? 'blue' : 'grey';
146
+ const buttonStyleClassNameModifier = this.getFilterButtonClassName(this.filterButtonStyle);
147
+ const filterKey = `filter__${this.filterKey}`;
148
+ return (h(Host, { id: filterKey }, h("div", { class: 'filter-container' }, h("button", { class: `filter-button ${buttonStyleClassNameModifier}`, type: 'button', onClick: this.onFilterButtonClick.bind(this) }, h("tttx-icon", { icon: 'filter_list', class: 'filter-icon', color: 'black' }), "Filter"), this.showPopover && (h("div", { class: `filter-popover-container ${filterPopoverContainerClassNameModifier}` }, h("h4", { class: 'filter-header' }, this.filterHeader), h("hr", { class: 'popover-divider' }), this.showSearchField ? (h("div", { class: 'search-field-container' }, h("tttx-icon", { icon: 'search', class: 'search-icon' }), h("input", { type: 'text', class: 'search-input', placeholder: 'Search', value: this.filterSearchTerm, onInput: this.handleFilterChange.bind(this) }), h("hr", { class: 'popover-divider' }))) : (''), h("div", { class: 'filter-options-container' }, this.showSelectAll ? (h("div", { class: 'filter-option', tabIndex: -1, onClick: this.onSelectAllClick.bind(this) }, h("tttx-icon", { icon: selectAllCheckboxIcon, color: selectAllCheckboxColor, class: 'select-all-icon' }), h("label", { class: 'filter-label' }, "Select all"))) : (''), this.displayedFilterSettings.map((option) => {
149
+ const checkboxIcon = this.selectedFilters.includes(option.optionText) ? 'check_box' : 'check_box_outline_blank';
150
+ const checkboxColor = this.selectedFilters.includes(option.optionText) ? 'blue' : 'grey';
151
+ return h("div", { class: 'filter-option', tabIndex: -1, onClick: () => this.onFilterOptionSelected(option.optionText), key: option.optionText }, h("tttx-icon", { icon: checkboxIcon, color: checkboxColor, class: 'checkbox-icon' }), this.showOptionIcons && h("tttx-icon", { icon: option.optionIcon, color: option.optionIconColor }), h("label", { class: 'filter-label' }, option.optionText));
152
+ })), h("hr", { class: 'popover-divider' }), h("div", { class: 'filter-popover-button-container' }, h("button", { type: 'button', class: 'close-button', onClick: this.onCloseButtonClick.bind(this) }, "Close"), h("button", { type: 'button', class: 'apply-button', onClick: this.onApplyFilterButtonClick.bind(this) }, "Apply")))))));
153
+ }
154
+ get el() { return getElement(this); }
155
+ };
156
+ TttxFilter.style = tttxFilterCss;
157
+
158
+ export { TttxFilter as tttx_filter };