@3t-transform/threeteeui 0.1.7 → 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.
- package/dist/cjs/{index-451f61dd.js → index-dc6cc829.js} +83 -2
- package/dist/cjs/loader.cjs.js +2 -18
- package/dist/cjs/tttx-button.cjs.entry.js +2 -2
- package/dist/cjs/tttx-filter.cjs.entry.js +162 -0
- package/dist/cjs/tttx-form.cjs.entry.js +1 -1
- package/dist/cjs/tttx-icon.cjs.entry.js +1 -1
- package/dist/cjs/tttx-keyvalue-block.cjs.entry.js +4 -3
- package/dist/cjs/tttx-list.cjs.entry.js +4 -34
- package/dist/cjs/tttx-loading-spinner.cjs.entry.js +1 -1
- package/dist/cjs/tttx-standalone-input.cjs.entry.js +1 -1
- package/dist/cjs/tttx-toolbar.cjs.entry.js +1 -1
- package/dist/cjs/tttx.cjs.js +4 -116
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/atoms/tttx-button/tttx-button.css +8 -0
- package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.css +4 -0
- package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js +2 -1
- package/dist/collection/components/molecules/tttx-filter/tttx-filter.css +215 -0
- package/dist/collection/components/molecules/tttx-filter/tttx-filter.js +325 -0
- package/dist/collection/components/molecules/tttx-filter/tttx-filter.stories.js +118 -0
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +13 -0
- package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.stories.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -4
- package/dist/components/tttx-button.js +1 -1
- package/dist/components/tttx-filter.d.ts +11 -0
- package/dist/components/tttx-filter.js +195 -0
- package/dist/components/tttx-keyvalue-block.js +3 -2
- package/dist/components/tttx-list.js +3 -33
- package/dist/esm/{index-0350f122.js → index-86faeaab.js} +83 -3
- package/dist/esm/loader.js +2 -18
- package/dist/esm/tttx-button.entry.js +2 -2
- package/dist/esm/tttx-filter.entry.js +158 -0
- package/dist/esm/tttx-form.entry.js +1 -1
- package/dist/esm/tttx-icon.entry.js +1 -1
- package/dist/esm/tttx-keyvalue-block.entry.js +4 -3
- package/dist/esm/tttx-list.entry.js +4 -34
- package/dist/esm/tttx-loading-spinner.entry.js +1 -1
- package/dist/esm/tttx-standalone-input.entry.js +1 -1
- package/dist/esm/tttx-toolbar.entry.js +1 -1
- package/dist/esm/tttx.js +4 -116
- package/dist/tttx/index.esm.js +0 -1
- package/dist/tttx/{p-cd1565e0.entry.js → p-12fc0b16.entry.js} +1 -1
- package/dist/tttx/p-52a47b7c.js +2 -0
- package/dist/tttx/p-603f6ebe.entry.js +1 -0
- package/dist/tttx/{p-4f3958fa.entry.js → p-8f3badad.entry.js} +1 -1
- package/dist/tttx/{p-0a85dda4.entry.js → p-ae48fe5a.entry.js} +1 -1
- package/dist/tttx/{p-cc6644c9.entry.js → p-b0eedc78.entry.js} +1 -1
- package/dist/tttx/{p-5cae1beb.entry.js → p-bdb054b2.entry.js} +1 -1
- package/dist/tttx/p-dcd78796.entry.js +1 -0
- package/dist/tttx/{p-92465671.entry.js → p-e25d5fe2.entry.js} +1 -1
- package/dist/tttx/{p-1b015a9d.entry.js → p-f1d7eb35.entry.js} +1 -1
- package/dist/tttx/tttx.esm.js +1 -129
- package/dist/types/components/molecules/tttx-filter/tttx-filter.d.ts +37 -0
- package/dist/types/components/molecules/tttx-filter/tttx-filter.stories.d.ts +43 -0
- package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.d.ts +1 -0
- package/dist/types/components.d.ts +33 -0
- package/package.json +1 -1
- package/dist/cjs/app-globals-3a1e7e63.js +0 -5
- package/dist/cjs/css-shim-211819bc.js +0 -6
- package/dist/cjs/dom-9deb26c8.js +0 -75
- package/dist/cjs/index-11cfdabe.js +0 -3297
- package/dist/cjs/shadow-css-bf3843d2.js +0 -389
- package/dist/collection/components/atoms/tttx-button/test/tttx-button.e2e.js +0 -9
- package/dist/collection/components/atoms/tttx-button/test/tttx-button.spec.js +0 -83
- package/dist/collection/components/atoms/tttx-icon/test/tttx-icon.e2e.js +0 -9
- package/dist/collection/components/atoms/tttx-icon/test/tttx-icon.spec.js +0 -16
- package/dist/collection/components/atoms/tttx-keyvalue-block/test/tttx-keyvalue-block.spec.js +0 -216
- package/dist/collection/components/atoms/tttx-loading-spinner/Test/tttx-loading-spinner.spec.js +0 -64
- package/dist/collection/components/molecules/tttx-form/lib/setErrorState.spec.js +0 -38
- package/dist/collection/components/molecules/tttx-form/lib/validityCheck.spec.js +0 -214
- package/dist/collection/components/molecules/tttx-form/test/tttx-form.e2e.js +0 -9
- package/dist/collection/components/molecules/tttx-form/test/tttx-form.spec.js +0 -232
- package/dist/collection/components/molecules/tttx-list/test/ttttx-list.spec.e2e.js +0 -26
- package/dist/collection/components/molecules/tttx-list/test/tttx-list.spec.js +0 -183
- package/dist/collection/components/molecules/tttx-standalone-input/test/tttx-standalone-input.e2e.js +0 -9
- package/dist/collection/components/molecules/tttx-standalone-input/test/tttx-standalone-input.spec.js +0 -219
- package/dist/collection/components/molecules/tttx-toolbar/test/tttx-toolbar.test.js +0 -0
- package/dist/collection/shared/test/domsanitiser.options.spec.js +0 -23
- package/dist/esm/app-globals-0f993ce5.js +0 -3
- package/dist/esm/css-shim-9d54a2f2.js +0 -4
- package/dist/esm/dom-6be6f662.js +0 -73
- package/dist/esm/index-dbe25028.js +0 -3262
- package/dist/esm/shadow-css-ed4599f8.js +0 -387
- package/dist/tttx/app-globals-0f993ce5.js +0 -3
- package/dist/tttx/css-shim-9d54a2f2.js +0 -4
- package/dist/tttx/dom-6be6f662.js +0 -73
- package/dist/tttx/index-dbe25028.js +0 -3262
- package/dist/tttx/p-62869344.js +0 -2
- package/dist/tttx/p-a0179cb1.entry.js +0 -1
- package/dist/tttx/shadow-css-ed4599f8.js +0 -387
- package/dist/tttx/tttx-button.entry.js +0 -30
- package/dist/tttx/tttx-form.entry.js +0 -373
- package/dist/tttx/tttx-icon.entry.js +0 -17
- package/dist/tttx/tttx-keyvalue-block.entry.js +0 -63
- package/dist/tttx/tttx-list.entry.js +0 -1730
- package/dist/tttx/tttx-loading-spinner.entry.js +0 -22
- package/dist/tttx/tttx-standalone-input.entry.js +0 -66
- package/dist/tttx/tttx-toolbar.entry.js +0 -16
- package/dist/types/components/atoms/tttx-button/test/tttx-button.e2e.d.ts +0 -1
- package/dist/types/components/atoms/tttx-button/test/tttx-button.spec.d.ts +0 -1
- package/dist/types/components/atoms/tttx-icon/test/tttx-icon.e2e.d.ts +0 -1
- package/dist/types/components/atoms/tttx-icon/test/tttx-icon.spec.d.ts +0 -1
- package/dist/types/components/atoms/tttx-keyvalue-block/test/tttx-keyvalue-block.spec.d.ts +0 -1
- package/dist/types/components/atoms/tttx-loading-spinner/Test/tttx-loading-spinner.spec.d.ts +0 -1
- package/dist/types/components/molecules/tttx-form/lib/setErrorState.spec.d.ts +0 -1
- package/dist/types/components/molecules/tttx-form/lib/validityCheck.spec.d.ts +0 -1
- package/dist/types/components/molecules/tttx-form/test/tttx-form.e2e.d.ts +0 -1
- package/dist/types/components/molecules/tttx-form/test/tttx-form.spec.d.ts +0 -1
- package/dist/types/components/molecules/tttx-list/test/ttttx-list.spec.e2e.d.ts +0 -1
- package/dist/types/components/molecules/tttx-list/test/tttx-list.spec.d.ts +0 -1
- package/dist/types/components/molecules/tttx-standalone-input/test/tttx-standalone-input.e2e.d.ts +0 -1
- package/dist/types/components/molecules/tttx-standalone-input/test/tttx-standalone-input.spec.d.ts +0 -1
- package/dist/types/components/molecules/tttx-toolbar/test/tttx-toolbar.test.d.ts +0 -0
- package/dist/types/shared/test/domsanitiser.options.spec.d.ts +0 -1
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { withActions } from '@storybook/addon-actions/decorator';
|
|
2
|
+
export default {
|
|
3
|
+
title: 'molecules/Filter',
|
|
4
|
+
component: 'tttx-filter',
|
|
5
|
+
argTypes: {
|
|
6
|
+
filterButtonStyle: {
|
|
7
|
+
control: { type: 'select' },
|
|
8
|
+
options: ['list filter', 'list icon', 'table icon'],
|
|
9
|
+
},
|
|
10
|
+
showSearchField: {
|
|
11
|
+
control: { type: 'boolean' },
|
|
12
|
+
},
|
|
13
|
+
showSelectAll: {
|
|
14
|
+
control: { type: 'boolean' },
|
|
15
|
+
},
|
|
16
|
+
showOptionIcons: {
|
|
17
|
+
control: { type: 'boolean' },
|
|
18
|
+
},
|
|
19
|
+
filterHeader: {
|
|
20
|
+
control: { type: 'text' },
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
parameters: {
|
|
24
|
+
actions: {
|
|
25
|
+
handles: ['filterButtonClickEvent', 'applyFilterButtonClickEvent', 'filterOptionSelected'],
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
decorators: [withActions],
|
|
29
|
+
};
|
|
30
|
+
export const ExampleFilter = (args) => {
|
|
31
|
+
const filterButtonStyle = args.filterButtonStyle;
|
|
32
|
+
args.filterHeader = args.filterHeader || 'Qualification status';
|
|
33
|
+
const filterHeader = args.filterHeader;
|
|
34
|
+
const showSearchField = args.showSearchField;
|
|
35
|
+
const showSelectAll = args.showSelectAll;
|
|
36
|
+
const showOptionIcons = args.showOptionIcons;
|
|
37
|
+
const filterOptions = [
|
|
38
|
+
{ optionIcon: 'cancel', optionIconColor: 'exit', optionText: 'Expired' },
|
|
39
|
+
{ optionIcon: 'warning', optionIconColor: 'orange', optionText: 'Expiring soon' },
|
|
40
|
+
{ optionIcon: 'check_circle', optionIconColor: 'green', optionText: 'Active' },
|
|
41
|
+
];
|
|
42
|
+
const jsonFilterOptions = JSON.stringify(filterOptions);
|
|
43
|
+
return `<tttx-filter
|
|
44
|
+
filter-options='${jsonFilterOptions}'
|
|
45
|
+
show-search-field='${showSearchField}'
|
|
46
|
+
show-select-all='${showSelectAll}'
|
|
47
|
+
filter-button-style='${filterButtonStyle}'
|
|
48
|
+
show-option-icons='${showOptionIcons}'
|
|
49
|
+
filter-header='${filterHeader}'
|
|
50
|
+
filter-key='basic-filter'
|
|
51
|
+
/>`;
|
|
52
|
+
};
|
|
53
|
+
export const ListFilterWithoutSearchField = (args) => {
|
|
54
|
+
const filterButtonStyle = args.filterButtonStyle;
|
|
55
|
+
args.filterHeader = args.filterHeader || 'Qualification status';
|
|
56
|
+
const filterHeader = args.filterHeader;
|
|
57
|
+
const showSearchField = false;
|
|
58
|
+
const showSelectAll = args.showSelectAll;
|
|
59
|
+
const showOptionIcons = args.showOptionIcons;
|
|
60
|
+
const filterOptions = [
|
|
61
|
+
{ optionIcon: 'cancel', optionIconColor: 'exit', optionText: 'Expired' },
|
|
62
|
+
{ optionIcon: 'warning', optionIconColor: 'orange', optionText: 'Expiring soon' },
|
|
63
|
+
{ optionIcon: 'check_circle', optionIconColor: 'green', optionText: 'Active' },
|
|
64
|
+
];
|
|
65
|
+
const jsonFilterOptions = JSON.stringify(filterOptions);
|
|
66
|
+
return `<tttx-filter
|
|
67
|
+
filter-options='${jsonFilterOptions}'
|
|
68
|
+
show-search-field='${showSearchField}'
|
|
69
|
+
show-select-all='${showSelectAll}'
|
|
70
|
+
filter-button-style='${filterButtonStyle}'
|
|
71
|
+
show-option-icons='${showOptionIcons}'
|
|
72
|
+
filter-header='${filterHeader}'
|
|
73
|
+
/>`;
|
|
74
|
+
};
|
|
75
|
+
export const TableIconWithoutOptionIconsOrSelectAll = (args) => {
|
|
76
|
+
const filterButtonStyle = 'table icon';
|
|
77
|
+
args.filterHeader = args.filterHeader || 'Qualification status';
|
|
78
|
+
const filterHeader = args.filterHeader;
|
|
79
|
+
const showSearchField = args.showSearchField;
|
|
80
|
+
const showOptionIcons = false;
|
|
81
|
+
const showSelectAll = false;
|
|
82
|
+
const filterOptions = [
|
|
83
|
+
{ optionIcon: 'cancel', optionIconColor: 'exit', optionText: 'Expired' },
|
|
84
|
+
{ optionIcon: 'warning', optionIconColor: 'orange', optionText: 'Expiring soon' },
|
|
85
|
+
{ optionIcon: 'check_circle', optionIconColor: 'green', optionText: 'Active' },
|
|
86
|
+
];
|
|
87
|
+
const jsonFilterOptions = JSON.stringify(filterOptions);
|
|
88
|
+
return `<tttx-filter
|
|
89
|
+
filter-button-style='${filterButtonStyle}'
|
|
90
|
+
filter-options='${jsonFilterOptions}'
|
|
91
|
+
show-select-all='${showSelectAll}'
|
|
92
|
+
show-option-icons='${showOptionIcons}'
|
|
93
|
+
show-search-field='${showSearchField}'
|
|
94
|
+
filter-header='${filterHeader}'
|
|
95
|
+
/>`;
|
|
96
|
+
};
|
|
97
|
+
export const ListIconWithoutSearchField = (args) => {
|
|
98
|
+
const filterButtonStyle = 'list icon';
|
|
99
|
+
args.filterHeader = args.filterHeader || 'Qualification status';
|
|
100
|
+
const filterHeader = args.filterHeader;
|
|
101
|
+
const showSearchField = false;
|
|
102
|
+
const showOptionIcons = true;
|
|
103
|
+
const showSelectAll = args.showSelectAll;
|
|
104
|
+
const filterOptions = [
|
|
105
|
+
{ optionIcon: 'cancel', optionIconColor: 'exit', optionText: 'Expired' },
|
|
106
|
+
{ optionIcon: 'warning', optionIconColor: 'orange', optionText: 'Expiring soon' },
|
|
107
|
+
{ optionIcon: 'check_circle', optionIconColor: 'green', optionText: 'Active' },
|
|
108
|
+
];
|
|
109
|
+
const jsonFilterOptions = JSON.stringify(filterOptions);
|
|
110
|
+
return `<tttx-filter
|
|
111
|
+
filter-button-style='${filterButtonStyle}'
|
|
112
|
+
filter-options='${jsonFilterOptions}'
|
|
113
|
+
show-select-all='${showSelectAll}'
|
|
114
|
+
show-option-icons='${showOptionIcons}'
|
|
115
|
+
show-search-field='${showSearchField}'
|
|
116
|
+
filter-header='${filterHeader}'
|
|
117
|
+
/>`;
|
|
118
|
+
};
|
package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js
CHANGED
|
@@ -111,6 +111,19 @@ InputField.args = {
|
|
|
111
111
|
showerrormsg: false,
|
|
112
112
|
placeholder: 'Enter first name',
|
|
113
113
|
};
|
|
114
|
+
export const searchField = TemplateTextInput.bind({});
|
|
115
|
+
searchField.args = {
|
|
116
|
+
value: '',
|
|
117
|
+
label: '',
|
|
118
|
+
type: 'text',
|
|
119
|
+
errormsg: 'Please enter your first name',
|
|
120
|
+
required: true,
|
|
121
|
+
showerrormsg: false,
|
|
122
|
+
showerrorbubble: false,
|
|
123
|
+
placeholder: 'Search',
|
|
124
|
+
inline: true,
|
|
125
|
+
inputIcon: 'search'
|
|
126
|
+
};
|
|
114
127
|
// export const TextInputIconLeft = TemplateTextInput.bind({});
|
|
115
128
|
// TextInputIconLeft.args = {
|
|
116
129
|
// value: 'Uh egg',
|
|
@@ -12,7 +12,7 @@ const Default = ({ border }) => `
|
|
|
12
12
|
<span slot="before"><tttx-button design="primary">Before</tttx-button></span>
|
|
13
13
|
<span slot="center"><div style="position: relative; top: -4px;"><tttx-standalone-input placeholder="center" inline required showerrorbubble="false" inputicon="search" /></div></span>
|
|
14
14
|
<span slot="after"><tttx-keyvalue-block horizontal keyvalues='{"Position":"after"}' /></span>
|
|
15
|
-
|
|
15
|
+
</tttx-toolbar>
|
|
16
16
|
`;
|
|
17
17
|
export const BasicStringList = Default.bind({});
|
|
18
18
|
BasicStringList.args = {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* tttx custom elements */
|
|
2
2
|
export { TttxButton as TttxButton } from '../types/components/atoms/tttx-button/tttx-button';
|
|
3
|
+
export { TttxFilter as TttxFilter } from '../types/components/molecules/tttx-filter/tttx-filter';
|
|
3
4
|
export { TttxForm as TttxForm } from '../types/components/molecules/tttx-form/tttx-form';
|
|
4
5
|
export { TttxIcon as TttxIcon } from '../types/components/atoms/tttx-icon/tttx-icon';
|
|
5
6
|
export { TttxKeyvalueBlock as TttxKeyvalueBlock } from '../types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block';
|
package/dist/components/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
2
2
|
export { TttxButton, defineCustomElement as defineCustomElementTttxButton } from './tttx-button.js';
|
|
3
|
+
export { TttxFilter, defineCustomElement as defineCustomElementTttxFilter } from './tttx-filter.js';
|
|
3
4
|
export { TttxForm, defineCustomElement as defineCustomElementTttxForm } from './tttx-form.js';
|
|
4
5
|
export { TttxIcon, defineCustomElement as defineCustomElementTttxIcon } from './tttx-icon.js';
|
|
5
6
|
export { TttxKeyvalueBlock, defineCustomElement as defineCustomElementTttxKeyvalueBlock } from './tttx-keyvalue-block.js';
|
|
@@ -7,7 +8,3 @@ export { TttxList, defineCustomElement as defineCustomElementTttxList } from './
|
|
|
7
8
|
export { TttxLoadingSpinner, defineCustomElement as defineCustomElementTttxLoadingSpinner } from './tttx-loading-spinner.js';
|
|
8
9
|
export { TttxStandaloneInput, defineCustomElement as defineCustomElementTttxStandaloneInput } from './tttx-standalone-input.js';
|
|
9
10
|
export { TttxToolbar, defineCustomElement as defineCustomElementTttxToolbar } from './tttx-toolbar.js';
|
|
10
|
-
|
|
11
|
-
const globalScripts = () => {};
|
|
12
|
-
|
|
13
|
-
globalScripts();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { d as defineCustomElement$2 } from './tttx-icon2.js';
|
|
3
3
|
|
|
4
|
-
const tttxButtonCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.button{font-family:Roboto, serif;box-sizing:border-box;height:36px;min-width:36px;padding:0;margin:0;background:transparent;color:#212121;border:1px solid #c8c8c8;border-radius:4px;text-transform:uppercase;display:flex;justify-content:left;align-items:center;font-size:14px;font-weight:400}.button-content{display:block;padding:0 16px}.icon-left,.icon-right{margin-top:4px}.iconleft{padding-left:8px}.iconleft .button-content{padding-left:4px}.iconright{padding-right:8px}.iconright .button-content{padding-right:4px}.notext{padding:0 6px}.button:hover{background:rgba(17, 17, 17, 0.1);border:1px solid #D5D5D5}.button:active{background:rgba(17, 17, 17, 0.2);border:1px solid #D5D5D5}.primary{background:#1479c6;border:1px solid #1479c6;color:white}.primary:hover{background:#146EB3;border:1px solid #146EB3}.primary:active{background:#1464A2;border:1px solid #1464A2}.borderless{background:transparent;border:none;color:#212121}.borderless:hover{background:rgba(17, 17, 17, 0.1);border:none}.borderless:active{background:rgba(17, 17, 17, 0.2);border:none}.danger{background:#DC0000;border:1px solid #DC0000;color:white}.danger:hover{background:#C60000;border:1px solid #C60000}.danger:active{background:#B00000;border:1px solid #B00000}.disabled{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}.disabled:hover{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}.disabled:active{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}:host{display:inline-block}.spacingleft{margin-left:8px}";
|
|
4
|
+
const tttxButtonCss = ".material-symbols-rounded{font-variation-settings:\"FILL\" 1, \"wght\" 400, \"GRAD\" 0, \"opsz\" 24}.button{font-family:Roboto, serif;box-sizing:border-box;height:36px;min-width:36px;padding:0;margin:0;background:transparent;color:#212121;border:1px solid #c8c8c8;border-radius:4px;text-transform:uppercase;display:flex;justify-content:left;align-items:center;font-size:14px;font-weight:400}.button-content{display:block;padding:0 16px}.icon-left,.icon-right{margin-top:4px}.iconleft{padding-left:8px}.iconleft .button-content{padding-left:4px}.iconright{padding-right:8px}.iconright .button-content{padding-right:4px}.notext{padding:0 6px}.button:hover{background:rgba(17, 17, 17, 0.1);border:1px solid #D5D5D5}.button:active{background:rgba(17, 17, 17, 0.2);border:1px solid #D5D5D5}.primary{background:#1479c6;border:1px solid #1479c6;color:white}.primary:hover{background:#146EB3;border:1px solid #146EB3}.primary:active{background:#1464A2;border:1px solid #1464A2}.borderless{background:transparent;border:none;color:#212121}.borderless:hover{background:rgba(17, 17, 17, 0.1);border:none}.borderless:active{background:rgba(17, 17, 17, 0.2);border:none}.danger{background:#DC0000;border:1px solid #DC0000;color:white}.danger:hover{background:#C60000;border:1px solid #C60000}.danger:active{background:#B00000;border:1px solid #B00000}.disabled{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}.disabled:hover{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}.disabled:active{background:#aeaeae;border:none;color:#4c4c4c;cursor:not-allowed}:host{display:inline-block}button{cursor:pointer}tttx-icon{cursor:inherit}.spacingleft{margin-left:8px}";
|
|
5
5
|
|
|
6
6
|
const TttxButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
7
|
constructor() {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface TttxFilter extends Components.TttxFilter, HTMLElement {}
|
|
4
|
+
export const TttxFilter: {
|
|
5
|
+
prototype: TttxFilter;
|
|
6
|
+
new (): TttxFilter;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|