@3t-transform/threeteeui 0.1.8 → 0.1.10

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 (57) hide show
  1. package/dist/cjs/{index-8ba406f6.js → index-dc6cc829.js} +82 -89
  2. package/dist/cjs/loader.cjs.js +3 -4
  3. package/dist/cjs/tttx-button.cjs.entry.js +1 -1
  4. package/dist/cjs/tttx-filter.cjs.entry.js +162 -0
  5. package/dist/cjs/tttx-form.cjs.entry.js +1 -1
  6. package/dist/cjs/tttx-icon.cjs.entry.js +1 -1
  7. package/dist/cjs/tttx-keyvalue-block.cjs.entry.js +4 -3
  8. package/dist/cjs/tttx-list.cjs.entry.js +1 -1
  9. package/dist/cjs/tttx-loading-spinner.cjs.entry.js +1 -1
  10. package/dist/cjs/tttx-standalone-input.cjs.entry.js +1 -1
  11. package/dist/cjs/tttx-toolbar.cjs.entry.js +1 -1
  12. package/dist/cjs/tttx.cjs.js +3 -7
  13. package/dist/collection/collection-manifest.json +3 -2
  14. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.css +4 -0
  15. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js +2 -1
  16. package/dist/collection/components/molecules/tttx-filter/tttx-filter.css +215 -0
  17. package/dist/collection/components/molecules/tttx-filter/tttx-filter.js +325 -0
  18. package/dist/collection/components/molecules/tttx-filter/tttx-filter.stories.js +118 -0
  19. package/dist/components/index.d.ts +1 -9
  20. package/dist/components/index.js +2 -1
  21. package/dist/components/tttx-filter.d.ts +11 -0
  22. package/dist/components/tttx-filter.js +195 -0
  23. package/dist/components/tttx-keyvalue-block.js +3 -2
  24. package/dist/esm/{index-5f9b72ff.js → index-86faeaab.js} +82 -89
  25. package/dist/esm/loader.js +3 -4
  26. package/dist/esm/polyfills/css-shim.js +1 -1
  27. package/dist/esm/tttx-button.entry.js +1 -1
  28. package/dist/esm/tttx-filter.entry.js +158 -0
  29. package/dist/esm/tttx-form.entry.js +1 -1
  30. package/dist/esm/tttx-icon.entry.js +1 -1
  31. package/dist/esm/tttx-keyvalue-block.entry.js +4 -3
  32. package/dist/esm/tttx-list.entry.js +1 -1
  33. package/dist/esm/tttx-loading-spinner.entry.js +1 -1
  34. package/dist/esm/tttx-standalone-input.entry.js +1 -1
  35. package/dist/esm/tttx-toolbar.entry.js +1 -1
  36. package/dist/esm/tttx.js +3 -4
  37. package/dist/tttx/p-12fc0b16.entry.js +3 -0
  38. package/dist/tttx/p-52a47b7c.js +2 -0
  39. package/dist/tttx/p-603f6ebe.entry.js +1 -0
  40. package/dist/tttx/{p-435c62b3.entry.js → p-8f3badad.entry.js} +1 -1
  41. package/dist/tttx/{p-0342cc46.entry.js → p-ae48fe5a.entry.js} +1 -1
  42. package/dist/tttx/{p-9cff9c64.entry.js → p-b0eedc78.entry.js} +1 -1
  43. package/dist/tttx/{p-405219b2.entry.js → p-bdb054b2.entry.js} +1 -1
  44. package/dist/tttx/p-dcd78796.entry.js +1 -0
  45. package/dist/tttx/{p-adf35f58.entry.js → p-e25d5fe2.entry.js} +1 -1
  46. package/dist/tttx/{p-4ecc9e8b.entry.js → p-f1d7eb35.entry.js} +1 -1
  47. package/dist/tttx/tttx.esm.js +1 -1
  48. package/dist/types/components/molecules/tttx-filter/tttx-filter.d.ts +37 -0
  49. package/dist/types/components/molecules/tttx-filter/tttx-filter.stories.d.ts +43 -0
  50. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +6 -6
  51. package/dist/types/components.d.ts +33 -0
  52. package/dist/types/stencil-public-runtime.d.ts +3 -59
  53. package/loader/index.d.ts +0 -9
  54. package/package.json +1 -1
  55. package/dist/tttx/p-1290dcd7.entry.js +0 -3
  56. package/dist/tttx/p-1b394414.entry.js +0 -1
  57. package/dist/tttx/p-c4b803fc.js +0 -2
@@ -1,11 +1,9 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-8ba406f6.js');
3
+ const index = require('./index-dc6cc829.js');
6
4
 
7
5
  /*
8
- Stencil Client Patch Browser v2.22.3 | MIT Licensed | https://stenciljs.com
6
+ Stencil Client Patch Browser v2.20.0 | MIT Licensed | https://stenciljs.com
9
7
  */
10
8
  const patchBrowser = () => {
11
9
  const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('tttx.cjs.js', document.baseURI).href));
@@ -17,7 +15,5 @@ const patchBrowser = () => {
17
15
  };
18
16
 
19
17
  patchBrowser().then(options => {
20
- return index.bootstrapLazy([["tttx-button.cjs",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"design":[1]}]]],["tttx-list.cjs",[[1,"tttx-list",{"data":[1025],"name":[1]}]]],["tttx-standalone-input.cjs",[[2,"tttx-standalone-input",{"label":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"iconleft":[1],"iconright":[1],"inputicon":[1],"inline":[4],"inputAutocapitalize":[1,"input-autocapitalize"],"inputAutofocus":[4,"input-autofocus"],"inputKeyhint":[1,"input-keyhint"],"inputIndex":[8,"input-index"],"inputTitle":[1,"input-title"],"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-form.cjs",[[1,"tttx-form",{"formschema":[1032],"submitValue":[1032,"submit-value"]}]]],["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-toolbar.cjs",[[1,"tttx-toolbar",{"border":[4]}]]],["tttx-icon.cjs",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]]], options);
18
+ return index.bootstrapLazy([["tttx-button.cjs",[[1,"tttx-button",{"notext":[4],"icon":[1],"iconposition":[1],"design":[1]}]]],["tttx-filter.cjs",[[1,"tttx-filter",{"filterKey":[1,"filter-key"],"filterOptions":[16],"showSelectAll":[4,"show-select-all"],"showSearchField":[4,"show-search-field"],"showOptionIcons":[4,"show-option-icons"],"filterButtonStyle":[1,"filter-button-style"],"filterHeader":[1,"filter-header"],"showPopover":[32],"selectedFilters":[32],"filterSearchTerm":[32],"displayedFilterSettings":[32],"allSelected":[32]}]]],["tttx-list.cjs",[[1,"tttx-list",{"data":[1025],"name":[1]}]]],["tttx-standalone-input.cjs",[[2,"tttx-standalone-input",{"label":[1],"showerrormsg":[4],"showerrorbubble":[4],"errormsg":[1],"iconleft":[1],"iconright":[1],"inputicon":[1],"inline":[4],"inputAutocapitalize":[1,"input-autocapitalize"],"inputAutofocus":[4,"input-autofocus"],"inputKeyhint":[1,"input-keyhint"],"inputIndex":[8,"input-index"],"inputTitle":[1,"input-title"],"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-form.cjs",[[1,"tttx-form",{"formschema":[1032],"submitValue":[1032,"submit-value"]}]]],["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-toolbar.cjs",[[1,"tttx-toolbar",{"border":[4]}]]],["tttx-icon.cjs",[[1,"tttx-icon",{"icon":[1],"color":[1]}]]]], options);
21
19
  });
22
-
23
- exports.setNonce = index.setNonce;
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "entries": [
3
+ "./components/molecules/tttx-filter/tttx-filter.js",
3
4
  "./components/molecules/tttx-standalone-input/tttx-standalone-input.js",
4
5
  "./components/atoms/tttx-button/tttx-button.js",
5
6
  "./components/atoms/tttx-icon/tttx-icon.js",
@@ -11,8 +12,8 @@
11
12
  ],
12
13
  "compiler": {
13
14
  "name": "@stencil/core",
14
- "version": "2.22.3",
15
- "typescriptVersion": "4.9.4"
15
+ "version": "2.20.0",
16
+ "typescriptVersion": "4.8.4"
16
17
  },
17
18
  "collections": [],
18
19
  "bundles": []
@@ -23,6 +23,10 @@ dt.mainTitle {
23
23
  color: #212121;
24
24
  }
25
25
 
26
+ dt, dd {
27
+ overflow-wrap: anywhere;
28
+ }
29
+
26
30
  dd {
27
31
  margin: 0;
28
32
  font-weight: 400;
@@ -21,10 +21,11 @@ export class TttxKeyvalueBlock {
21
21
  }
22
22
  renderArrayElements(values) {
23
23
  const elements = [];
24
+ const divSize = (100 / values.length).toString();
24
25
  for (let i = 0; i < values.length; i++) {
25
26
  const value = values[i];
26
27
  if (this.horizontal) {
27
- elements.push(h("div", null, h("dt", { class: 'mainTitle' }, value.title), h("dt", { class: 'subTitle' }, value.subTitle), h("dd", null, value.data)));
28
+ elements.push(h("div", { style: { maxWidth: divSize } }, h("dt", { class: 'mainTitle' }, value.title), h("dt", { class: 'subTitle' }, value.subTitle), h("dd", null, value.data)));
28
29
  }
29
30
  else {
30
31
  elements.push(h("dt", { class: 'mainTitle' }, value.title));
@@ -0,0 +1,215 @@
1
+ .material-symbols-rounded {
2
+ font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
3
+ }
4
+
5
+ .material-symbols-rounded {
6
+ font-family: "Material Symbols Rounded", sans-serif;
7
+ font-weight: 400;
8
+ font-style: normal;
9
+ font-size: 24px;
10
+ line-height: 1;
11
+ letter-spacing: normal;
12
+ text-transform: none;
13
+ display: inline-block;
14
+ white-space: nowrap;
15
+ word-wrap: normal;
16
+ direction: ltr;
17
+ text-rendering: optimizeLegibility;
18
+ -webkit-font-smoothing: antialiased;
19
+ color: #9e9e9e;
20
+ }
21
+
22
+ .filter-container .filter-button {
23
+ display: inline-flex;
24
+ justify-content: center;
25
+ align-items: center;
26
+ font-size: 14px;
27
+ font-weight: 400;
28
+ font-family: "Roboto", serif;
29
+ text-transform: uppercase;
30
+ color: #212121;
31
+ border: 1px solid #d5d5d5;
32
+ border-radius: 4px;
33
+ background: transparent;
34
+ height: 36px;
35
+ width: 95px;
36
+ margin: 0;
37
+ padding-right: 16px;
38
+ }
39
+ .filter-container .filter-button .filter-icon {
40
+ padding-left: 8px;
41
+ padding-right: 4px;
42
+ }
43
+ .filter-container .filter-button.--list-icon {
44
+ font-size: 0;
45
+ width: 36px;
46
+ height: 36px;
47
+ padding: 0;
48
+ }
49
+ .filter-container .filter-button.--list-icon .filter-icon {
50
+ padding: 0;
51
+ }
52
+ .filter-container .filter-button.--list-icon:hover {
53
+ background: #e3e3e3;
54
+ }
55
+ .filter-container .filter-button.--table-icon {
56
+ font-size: 0;
57
+ width: 36px;
58
+ height: 36px;
59
+ padding: 0;
60
+ border: none;
61
+ }
62
+ .filter-container .filter-button.--table-icon .filter-icon {
63
+ padding: 0;
64
+ width: 24px;
65
+ height: 24px;
66
+ }
67
+ .filter-container .filter-button.--table-icon:hover {
68
+ background: #e3e3e3;
69
+ border-radius: 50%;
70
+ width: 36px;
71
+ height: 36px;
72
+ }
73
+ .filter-container .filter-button:hover {
74
+ background: #e3e3e3;
75
+ }
76
+ .filter-container .filter-popover-container {
77
+ display: block;
78
+ width: 196px;
79
+ border-radius: 4px;
80
+ box-shadow: 0px 1px 5px #1111114D;
81
+ position: absolute;
82
+ }
83
+ .filter-container .filter-popover-container .filter-header {
84
+ color: #757575;
85
+ text-transform: uppercase;
86
+ font-size: 14px;
87
+ font-weight: 500;
88
+ font-family: "Roboto", serif;
89
+ padding-left: 16px;
90
+ padding-top: 12px;
91
+ padding-bottom: 12px;
92
+ margin: 0;
93
+ }
94
+ .filter-container .filter-popover-container .popover-divider {
95
+ border: none;
96
+ width: 164px;
97
+ display: flex;
98
+ margin-left: auto;
99
+ margin-right: auto;
100
+ margin-top: 0;
101
+ margin-bottom: 8px;
102
+ height: 1px;
103
+ background-color: #d5d5d5;
104
+ }
105
+ .filter-container .filter-popover-container .filter-option {
106
+ display: flex;
107
+ flex-direction: row;
108
+ align-items: center;
109
+ height: 36px;
110
+ padding-left: 22px;
111
+ padding-bottom: 4px;
112
+ }
113
+ .filter-container .filter-popover-container .filter-option .select-all-icon {
114
+ padding-right: 6px;
115
+ }
116
+ .filter-container .filter-popover-container .filter-option .checkbox-icon {
117
+ padding-right: 8px;
118
+ }
119
+ .filter-container .filter-popover-container .filter-option .filter-label {
120
+ padding-left: 8px;
121
+ padding-bottom: 3px;
122
+ font-size: 16px;
123
+ font-weight: 500;
124
+ font-family: "Roboto", serif;
125
+ }
126
+ .filter-container .filter-popover-container .filter-option:first-child {
127
+ margin-top: 8px;
128
+ }
129
+ .filter-container .filter-popover-container .filter-option:last-child {
130
+ margin-bottom: 8px;
131
+ }
132
+ .filter-container .filter-popover-container .filter-popover-button-container {
133
+ display: flex;
134
+ justify-content: flex-end;
135
+ align-items: center;
136
+ padding-bottom: 8px;
137
+ }
138
+ .filter-container .filter-popover-container .filter-popover-button-container .close-button {
139
+ height: 36px;
140
+ width: 74px;
141
+ background-color: white;
142
+ border: 1px solid #d5d5d5;
143
+ border-radius: 4px;
144
+ text-transform: uppercase;
145
+ margin-right: 8px;
146
+ font-size: 14px;
147
+ font-weight: 400;
148
+ font-family: "Roboto", serif;
149
+ }
150
+ .filter-container .filter-popover-container .filter-popover-button-container .apply-button {
151
+ height: 36px;
152
+ width: 73px;
153
+ background-color: #1479c6;
154
+ color: white;
155
+ border-radius: 4px;
156
+ border: none;
157
+ text-transform: uppercase;
158
+ margin-right: 16px;
159
+ font-size: 14px;
160
+ font-weight: 400;
161
+ font-family: "Roboto", serif;
162
+ }
163
+ .filter-container .filter-popover-container.--with-search-field {
164
+ width: 252px;
165
+ }
166
+ .filter-container .filter-popover-container.--with-search-field .popover-divider {
167
+ width: 220px;
168
+ }
169
+ .filter-container .filter-popover-container.--with-search-field .popover-divider:first-child {
170
+ top: 44px;
171
+ }
172
+ .filter-container .filter-popover-container.--with-search-field .search-field-container {
173
+ position: relative;
174
+ color: #d5d5d5;
175
+ width: 220px;
176
+ height: 36px;
177
+ padding: 0 16px;
178
+ }
179
+ .filter-container .filter-popover-container.--with-search-field .search-field-container .search-icon {
180
+ position: absolute;
181
+ top: 50%;
182
+ padding-left: 8px;
183
+ padding-bottom: 9.2px;
184
+ height: 17px;
185
+ width: 17px;
186
+ transform: translateY(-50%);
187
+ }
188
+ .filter-container .filter-popover-container.--with-search-field .search-field-container .search-input {
189
+ padding-left: 36px;
190
+ border: 1px solid #d5d5d5;
191
+ border-radius: 4px;
192
+ height: 36px;
193
+ width: 220px;
194
+ font-size: 16px;
195
+ font-family: "Roboto", serif;
196
+ font-weight: 500;
197
+ color: #9e9e9e;
198
+ box-sizing: border-box;
199
+ }
200
+ .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 {
201
+ outline: none;
202
+ border: 1px solid #1479c6;
203
+ }
204
+ .filter-container .filter-popover-container.--with-search-field .search-field-container .search-input::placeholder {
205
+ color: #9e9e9e;
206
+ font-size: 16px;
207
+ font-family: "Roboto", serif;
208
+ font-weight: 500;
209
+ }
210
+ .filter-container .filter-popover-container.--with-search-field .search-field-container .popover-divider {
211
+ margin-top: 8px;
212
+ }
213
+ .filter-container .filter-popover-container.--with-search-field .filter-option:first-child {
214
+ padding-top: 8px;
215
+ }
@@ -0,0 +1,325 @@
1
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
+ import { h, Host } from '@stencil/core';
3
+ export class TttxFilter {
4
+ constructor() {
5
+ this.filterKey = undefined;
6
+ this.filterOptions = [
7
+ { optionIcon: 'cancel', optionIconColor: 'darkred', optionText: 'Expired' },
8
+ { optionIcon: 'warning', optionIconColor: 'orange', optionText: 'Expiring soon' },
9
+ { optionIcon: 'check_circle', optionIconColor: 'green', optionText: 'Active' },
10
+ ];
11
+ this.showSelectAll = true;
12
+ this.showSearchField = false;
13
+ this.showOptionIcons = true;
14
+ this.filterButtonStyle = 'list filter';
15
+ this.filterHeader = 'Qualification status';
16
+ this.showPopover = false;
17
+ this.selectedFilters = this.filterOptions.map((filterOption) => filterOption.optionText);
18
+ this.filterSearchTerm = '';
19
+ this.displayedFilterSettings = this.filterOptions;
20
+ this.allSelected = true;
21
+ }
22
+ emitFilterEvent() {
23
+ this.filterChangeEvent.emit({
24
+ selectedFilters: this.selectedFilters,
25
+ filterKey: this.filterKey,
26
+ allSelected: this.allSelected,
27
+ });
28
+ }
29
+ onFilterButtonClick() {
30
+ this.togglePopover();
31
+ }
32
+ onCloseButtonClick() {
33
+ this.togglePopover();
34
+ }
35
+ onApplyFilterButtonClick() {
36
+ this.emitFilterEvent();
37
+ this.togglePopover();
38
+ }
39
+ onFilterOptionSelected(selectedOption) {
40
+ this.allSelected = false;
41
+ if (this.selectedFilters.includes(selectedOption)) {
42
+ this.selectedFilters = this.selectedFilters.filter((filter) => filter != selectedOption);
43
+ }
44
+ else {
45
+ this.selectedFilters = [...this.selectedFilters, selectedOption];
46
+ }
47
+ }
48
+ togglePopover() {
49
+ this.showPopover = !this.showPopover;
50
+ // if(!this.showPopover) {
51
+ // // this._focussedElementIndex = -1;
52
+ // }
53
+ }
54
+ // Commented out keyboard interaction for now
55
+ // @Listen('keyup')
56
+ // handleKeyUp(event: KeyboardEvent) {
57
+ // const keyboardEventValue = event.key;
58
+ // if (document.activeElement.id != `filter__${this.filterKey}`) return;
59
+ // if (event.key == " " || event.code == "Space" || event.keyCode == 32) {
60
+ // if (this._focussedElementIndex == 0) {
61
+ // this.onSelectAllClick()
62
+ // } else {
63
+ // const options = this.el.shadowRoot.querySelectorAll('.filter-option') as HTMLElement[];
64
+ // this.onFilterOptionSelected(options[this._focussedElementIndex].textContent)
65
+ // }
66
+ // return;
67
+ // }
68
+ // switch (keyboardEventValue) {
69
+ // case 'Enter':
70
+ // if(!this.showPopover) {
71
+ // this.showPopover=true
72
+ // } else {
73
+ // this.emitFilterEvent()
74
+ // }
75
+ // break;
76
+ // case 'Escape':
77
+ // this.showPopover = false;
78
+ // this._focussedElementIndex = -1;
79
+ // break;
80
+ // case 'ArrowDown':
81
+ // this.showPopover = true;
82
+ // if (this._focussedElementIndex == -1) {
83
+ // this._focussedElementIndex = 0;
84
+ // } else {
85
+ // const options = this.el.shadowRoot.querySelectorAll('.filter-option') as HTMLElement[];
86
+ // const currentOption = options[this._focussedElementIndex] as HTMLElement;
87
+ // currentOption.blur();
88
+ // // options[this._focussedElementIndex].focus();
89
+ // this._focussedElementIndex + 1 < options.length ? this._focussedElementIndex++ : (this._focussedElementIndex = 0);
90
+ // }
91
+ // break;
92
+ // case 'ArrowUp':
93
+ // if (this._focussedElementIndex == -1) {
94
+ // this.showPopover = true;
95
+ // this._focussedElementIndex = 0;
96
+ // } else {
97
+ // const options = this.el.shadowRoot.querySelectorAll('.filter-option') as HTMLElement[];
98
+ // const currentOption = options[this._focussedElementIndex] as HTMLElement;
99
+ // currentOption.blur();
100
+ // // options[this._focussedElementIndex].focus();
101
+ // this._focussedElementIndex > 0 ? this._focussedElementIndex-- : (this._focussedElementIndex = options.length - 1);
102
+ // }
103
+ // break;
104
+ // }
105
+ // }
106
+ handleFilterChange(event) {
107
+ const target = event.target;
108
+ this.filterSearchTerm = target.value;
109
+ const filteredResults = this.filterOptions.filter((filterOption) => {
110
+ const lowercaseOption = filterOption.optionText.toLowerCase();
111
+ const filterTerm = this.filterSearchTerm.toLowerCase();
112
+ return lowercaseOption.includes(filterTerm);
113
+ });
114
+ this.displayedFilterSettings = filteredResults;
115
+ }
116
+ onSelectAllClick() {
117
+ this.allSelected = !this.allSelected;
118
+ if (this.allSelected) {
119
+ this.displayedFilterSettings.forEach((filterSetting) => { this.selectedFilters = [...this.selectedFilters, filterSetting.optionText]; });
120
+ }
121
+ else {
122
+ this.selectedFilters = [];
123
+ }
124
+ }
125
+ getFilterButtonClassName(buttonStyle) {
126
+ switch (buttonStyle) {
127
+ case 'table icon': {
128
+ return '--table-icon';
129
+ }
130
+ case 'list icon': {
131
+ return '--list-icon';
132
+ }
133
+ default: {
134
+ return '';
135
+ }
136
+ }
137
+ }
138
+ render() {
139
+ const filterPopoverContainerClassNameModifier = this.showSearchField ? '--with-search-field' : '';
140
+ const selectAllCheckboxIcon = this.allSelected ? 'check_box' : 'check_box_outline_blank';
141
+ const selectAllCheckboxColor = this.allSelected ? 'blue' : 'grey';
142
+ const buttonStyleClassNameModifier = this.getFilterButtonClassName(this.filterButtonStyle);
143
+ const filterKey = `filter__${this.filterKey}`;
144
+ 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) => {
145
+ const checkboxIcon = this.selectedFilters.includes(option.optionText) ? 'check_box' : 'check_box_outline_blank';
146
+ const checkboxColor = this.selectedFilters.includes(option.optionText) ? 'blue' : 'grey';
147
+ 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));
148
+ })), 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")))))));
149
+ }
150
+ static get is() { return "tttx-filter"; }
151
+ static get encapsulation() { return "shadow"; }
152
+ static get originalStyleUrls() {
153
+ return {
154
+ "$": ["tttx-filter.scss"]
155
+ };
156
+ }
157
+ static get styleUrls() {
158
+ return {
159
+ "$": ["tttx-filter.css"]
160
+ };
161
+ }
162
+ static get properties() {
163
+ return {
164
+ "filterKey": {
165
+ "type": "string",
166
+ "mutable": false,
167
+ "complexType": {
168
+ "original": "string",
169
+ "resolved": "string",
170
+ "references": {}
171
+ },
172
+ "required": false,
173
+ "optional": false,
174
+ "docs": {
175
+ "tags": [],
176
+ "text": ""
177
+ },
178
+ "attribute": "filter-key",
179
+ "reflect": false
180
+ },
181
+ "filterOptions": {
182
+ "type": "unknown",
183
+ "mutable": false,
184
+ "complexType": {
185
+ "original": "FilterSettings[]",
186
+ "resolved": "FilterSettings[]",
187
+ "references": {
188
+ "FilterSettings": {
189
+ "location": "local"
190
+ }
191
+ }
192
+ },
193
+ "required": false,
194
+ "optional": false,
195
+ "docs": {
196
+ "tags": [],
197
+ "text": ""
198
+ },
199
+ "defaultValue": "[\n { optionIcon: 'cancel', optionIconColor: 'darkred', optionText: 'Expired' },\n { optionIcon: 'warning', optionIconColor: 'orange', optionText: 'Expiring soon' },\n { optionIcon: 'check_circle', optionIconColor: 'green', optionText: 'Active' },\n ]"
200
+ },
201
+ "showSelectAll": {
202
+ "type": "boolean",
203
+ "mutable": false,
204
+ "complexType": {
205
+ "original": "boolean",
206
+ "resolved": "boolean",
207
+ "references": {}
208
+ },
209
+ "required": false,
210
+ "optional": false,
211
+ "docs": {
212
+ "tags": [],
213
+ "text": ""
214
+ },
215
+ "attribute": "show-select-all",
216
+ "reflect": false,
217
+ "defaultValue": "true"
218
+ },
219
+ "showSearchField": {
220
+ "type": "boolean",
221
+ "mutable": false,
222
+ "complexType": {
223
+ "original": "boolean",
224
+ "resolved": "boolean",
225
+ "references": {}
226
+ },
227
+ "required": false,
228
+ "optional": false,
229
+ "docs": {
230
+ "tags": [],
231
+ "text": ""
232
+ },
233
+ "attribute": "show-search-field",
234
+ "reflect": false,
235
+ "defaultValue": "false"
236
+ },
237
+ "showOptionIcons": {
238
+ "type": "boolean",
239
+ "mutable": false,
240
+ "complexType": {
241
+ "original": "boolean",
242
+ "resolved": "boolean",
243
+ "references": {}
244
+ },
245
+ "required": false,
246
+ "optional": false,
247
+ "docs": {
248
+ "tags": [],
249
+ "text": ""
250
+ },
251
+ "attribute": "show-option-icons",
252
+ "reflect": false,
253
+ "defaultValue": "true"
254
+ },
255
+ "filterButtonStyle": {
256
+ "type": "string",
257
+ "mutable": false,
258
+ "complexType": {
259
+ "original": "'list filter' | 'list icon' | 'table icon'",
260
+ "resolved": "\"list filter\" | \"list icon\" | \"table icon\"",
261
+ "references": {}
262
+ },
263
+ "required": false,
264
+ "optional": false,
265
+ "docs": {
266
+ "tags": [],
267
+ "text": ""
268
+ },
269
+ "attribute": "filter-button-style",
270
+ "reflect": false,
271
+ "defaultValue": "'list filter'"
272
+ },
273
+ "filterHeader": {
274
+ "type": "string",
275
+ "mutable": false,
276
+ "complexType": {
277
+ "original": "string",
278
+ "resolved": "string",
279
+ "references": {}
280
+ },
281
+ "required": false,
282
+ "optional": false,
283
+ "docs": {
284
+ "tags": [],
285
+ "text": ""
286
+ },
287
+ "attribute": "filter-header",
288
+ "reflect": false,
289
+ "defaultValue": "'Qualification status'"
290
+ }
291
+ };
292
+ }
293
+ static get states() {
294
+ return {
295
+ "showPopover": {},
296
+ "selectedFilters": {},
297
+ "filterSearchTerm": {},
298
+ "displayedFilterSettings": {},
299
+ "allSelected": {}
300
+ };
301
+ }
302
+ static get events() {
303
+ return [{
304
+ "method": "filterChangeEvent",
305
+ "name": "filterChangeEvent",
306
+ "bubbles": true,
307
+ "cancelable": true,
308
+ "composed": true,
309
+ "docs": {
310
+ "tags": [],
311
+ "text": ""
312
+ },
313
+ "complexType": {
314
+ "original": "FilterChangeEvent",
315
+ "resolved": "FilterChangeEvent",
316
+ "references": {
317
+ "FilterChangeEvent": {
318
+ "location": "local"
319
+ }
320
+ }
321
+ }
322
+ }];
323
+ }
324
+ static get elementRef() { return "el"; }
325
+ }