@3t-transform/threeteeui 0.1.52 → 0.1.57

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 (117) hide show
  1. package/dist/cjs/{domsanitiser.options-b2d88e35.js → domsanitiser.options-cd2932a9.js} +17 -17
  2. package/dist/cjs/tttx-button.cjs.entry.js +23 -23
  3. package/dist/cjs/tttx-dialog-box.cjs.entry.js +69 -69
  4. package/dist/cjs/tttx-filter.cjs.entry.js +182 -180
  5. package/dist/cjs/tttx-form.cjs.entry.js +457 -457
  6. package/dist/cjs/tttx-icon.cjs.entry.js +10 -10
  7. package/dist/cjs/tttx-keyvalue-block.cjs.entry.js +58 -58
  8. package/dist/cjs/tttx-list.cjs.entry.js +31 -31
  9. package/dist/cjs/tttx-loading-spinner.cjs.entry.js +15 -15
  10. package/dist/cjs/tttx-qrcode.cjs.entry.js +27 -27
  11. package/dist/cjs/tttx-sorter.cjs.entry.js +107 -104
  12. package/dist/cjs/tttx-standalone-input.cjs.entry.js +78 -78
  13. package/dist/cjs/tttx-toolbar.cjs.entry.js +9 -9
  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.js +109 -109
  19. package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.js +38 -38
  20. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.js +67 -67
  21. package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.js +17 -17
  22. package/dist/collection/components/atoms/tttx-qrcode/tttx-qrcode.js +81 -81
  23. package/dist/collection/components/atoms/tttx-qrcode/tttx-qrcode.stories.js +22 -22
  24. package/dist/collection/components/molecules/tttx-dialog-box/tttx-dialog-box.js +172 -172
  25. package/dist/collection/components/molecules/tttx-dialog-box/tttx-dialog-box.stories.js +289 -289
  26. package/dist/collection/components/molecules/tttx-filter/tttx-filter.js +416 -400
  27. package/dist/collection/components/molecules/tttx-filter/tttx-filter.stories.js +80 -80
  28. package/dist/collection/components/molecules/tttx-form/lib/setErrorState.js +37 -37
  29. package/dist/collection/components/molecules/tttx-form/lib/validityCheck.js +61 -61
  30. package/dist/collection/components/molecules/tttx-form/tttx-form.js +479 -479
  31. package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +272 -272
  32. package/dist/collection/components/molecules/tttx-list/tttx-list.js +105 -105
  33. package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +43 -43
  34. package/dist/collection/components/molecules/tttx-sorter/tttx-sorter.js +253 -236
  35. package/dist/collection/components/molecules/tttx-sorter/tttx-sorter.stories.js +42 -42
  36. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +759 -759
  37. package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +172 -172
  38. package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.js +44 -44
  39. package/dist/collection/components/molecules/tttx-toolbar/tttx-toolbar.stories.js +14 -14
  40. package/dist/collection/components/palette.stories.js +7 -7
  41. package/dist/collection/docs/gettingstarted-developer.stories.js +5 -5
  42. package/dist/collection/icons.js +2838 -2838
  43. package/dist/collection/index.js +1 -1
  44. package/dist/collection/shared/domsanitiser.options.js +14 -14
  45. package/dist/components/domsanitiser.options.js +17 -17
  46. package/dist/components/tttx-button2.js +48 -48
  47. package/dist/components/tttx-dialog-box.js +97 -97
  48. package/dist/components/tttx-filter.js +217 -215
  49. package/dist/components/tttx-form.js +475 -475
  50. package/dist/components/tttx-icon2.js +28 -28
  51. package/dist/components/tttx-keyvalue-block.js +76 -76
  52. package/dist/components/tttx-list.js +53 -53
  53. package/dist/components/tttx-loading-spinner.js +33 -33
  54. package/dist/components/tttx-qrcode.js +45 -45
  55. package/dist/components/tttx-sorter.js +136 -133
  56. package/dist/components/tttx-standalone-input.js +130 -130
  57. package/dist/components/tttx-toolbar.js +26 -26
  58. package/dist/esm/{domsanitiser.options-81611f82.js → domsanitiser.options-563c1cf3.js} +17 -17
  59. package/dist/esm/polyfills/core-js.js +0 -0
  60. package/dist/esm/polyfills/dom.js +0 -0
  61. package/dist/esm/polyfills/es5-html-element.js +0 -0
  62. package/dist/esm/polyfills/index.js +0 -0
  63. package/dist/esm/polyfills/system.js +0 -0
  64. package/dist/esm/tttx-button.entry.js +23 -23
  65. package/dist/esm/tttx-dialog-box.entry.js +69 -69
  66. package/dist/esm/tttx-filter.entry.js +182 -180
  67. package/dist/esm/tttx-form.entry.js +457 -457
  68. package/dist/esm/tttx-icon.entry.js +10 -10
  69. package/dist/esm/tttx-keyvalue-block.entry.js +58 -58
  70. package/dist/esm/tttx-list.entry.js +31 -31
  71. package/dist/esm/tttx-loading-spinner.entry.js +15 -15
  72. package/dist/esm/tttx-qrcode.entry.js +27 -27
  73. package/dist/esm/tttx-sorter.entry.js +107 -104
  74. package/dist/esm/tttx-standalone-input.entry.js +78 -78
  75. package/dist/esm/tttx-toolbar.entry.js +9 -9
  76. package/dist/tttx/p-225e6fa6.entry.js +1 -0
  77. package/dist/tttx/{p-bc3b9283.entry.js → p-58d7c978.entry.js} +1 -1
  78. package/dist/tttx/{p-c751ebc2.entry.js → p-8b511fff.entry.js} +1 -1
  79. package/dist/tttx/{p-6a6ff7b7.entry.js → p-909c090d.entry.js} +1 -1
  80. package/dist/tttx/p-a658e1ac.entry.js +1 -0
  81. package/dist/tttx/{p-0b25ac9c.js → p-d3835fde.js} +2 -2
  82. package/dist/tttx/tttx.esm.js +1 -1
  83. package/dist/types/components/atoms/tttx-button/tttx-button.d.ts +10 -10
  84. package/dist/types/components/atoms/tttx-button/tttx-button.stories.d.ts +10 -10
  85. package/dist/types/components/atoms/tttx-icon/tttx-icon.d.ts +5 -5
  86. package/dist/types/components/atoms/tttx-icon/tttx-icon.stories.d.ts +20 -20
  87. package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.d.ts +7 -7
  88. package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.d.ts +9 -9
  89. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.d.ts +6 -6
  90. package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.d.ts +17 -17
  91. package/dist/types/components/atoms/tttx-qrcode/tttx-qrcode.d.ts +8 -8
  92. package/dist/types/components/atoms/tttx-qrcode/tttx-qrcode.stories.d.ts +23 -23
  93. package/dist/types/components/molecules/tttx-dialog-box/tttx-dialog-box.d.ts +18 -18
  94. package/dist/types/components/molecules/tttx-dialog-box/tttx-dialog-box.stories.d.ts +24 -24
  95. package/dist/types/components/molecules/tttx-filter/tttx-filter.d.ts +44 -43
  96. package/dist/types/components/molecules/tttx-filter/tttx-filter.stories.d.ts +76 -0
  97. package/dist/types/components/molecules/tttx-form/lib/setErrorState.d.ts +13 -13
  98. package/dist/types/components/molecules/tttx-form/lib/validityCheck.d.ts +17 -17
  99. package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +133 -133
  100. package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +278 -0
  101. package/dist/types/components/molecules/tttx-list/tttx-list.d.ts +11 -11
  102. package/dist/types/components/molecules/tttx-list/tttx-list.stories.d.ts +14 -0
  103. package/dist/types/components/molecules/tttx-sorter/tttx-sorter.d.ts +21 -20
  104. package/dist/types/components/molecules/tttx-sorter/tttx-sorter.stories.d.ts +30 -0
  105. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +69 -69
  106. package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.d.ts +143 -143
  107. package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.d.ts +4 -4
  108. package/dist/types/components/molecules/tttx-toolbar/tttx-toolbar.stories.d.ts +13 -13
  109. package/dist/types/components/palette.stories.d.ts +6 -6
  110. package/dist/types/components.d.ts +2 -0
  111. package/dist/types/docs/gettingstarted-developer.stories.d.ts +5 -5
  112. package/dist/types/icons.d.ts +2 -2
  113. package/dist/types/index.d.ts +1 -1
  114. package/dist/types/shared/domsanitiser.options.d.ts +10 -10
  115. package/package.json +1 -1
  116. package/dist/tttx/p-3b29e8af.entry.js +0 -1
  117. package/dist/tttx/p-637e7e88.entry.js +0 -1
@@ -1,236 +1,253 @@
1
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
- import { h, Host } from '@stencil/core';
3
- export class TttxSorter {
4
- constructor() {
5
- this.sorterKey = undefined;
6
- this.defaultSortDirection = 'descending';
7
- this.fieldOptionsData = null;
8
- this.defaultOption = '';
9
- this.selectedField = this.defaultOption;
10
- this.sortDirection = this.defaultSortDirection;
11
- this.dropdownExpand = false;
12
- this.dropdownOptions = undefined;
13
- }
14
- handleCloseSorter() {
15
- this.dropdownExpand = false;
16
- }
17
- emitSortEvent() {
18
- this.sorterChangeEvent.emit({
19
- sorterDirection: this.sortDirection,
20
- sorterKey: this.sorterKey,
21
- sortField: this.selectedField,
22
- });
23
- }
24
- onSortToggleClick(event) {
25
- event.preventDefault();
26
- if (this.sortDirection == 'ascending') {
27
- this.sortDirection = 'descending';
28
- }
29
- else {
30
- this.sortDirection = 'ascending';
31
- }
32
- this.emitSortEvent();
33
- }
34
- onDropdownClicked() {
35
- this.dropdownExpand = !this.dropdownExpand;
36
- }
37
- onDropdownSelected(event) {
38
- this.dropdownExpand = false;
39
- const target = event.target;
40
- this.selectedField = target.innerHTML;
41
- this.emitSortEvent();
42
- }
43
- // getOptionsList() {
44
- // return this.el.shadowRoot.querySelectorAll('.dropdown-option');
45
- // }
46
- // /* istanbul ignore next */
47
- // @Listen('keyup')
48
- // handleKeyDown(ev: KeyboardEvent) {
49
- // const keyboardEventValue = ev.key;
50
- // if (document.activeElement.id != `sorter__${this.sorterKey}`) return;
51
- // switch (keyboardEventValue) {
52
- // case 'Enter':
53
- // if (this._focussedElementIndex > -1) {
54
- // const options = this.el.shadowRoot.querySelectorAll('.dropdown-option');
55
- // this.selectedField = options[this._focussedElementIndex].innerHTML;
56
- // this.emitSortEvent();
57
- // }
58
- // this.dropdownExpand = false;
59
- // break;
60
- // case 'Escape':
61
- // this.dropdownExpand = false;
62
- // break;
63
- // case 'ArrowDown':
64
- // this.dropdownExpand = true;
65
- // if (this._focussedElementIndex > -1) {
66
- // const options = this.getOptionsList();
67
- // const currentOption = options[this._focussedElementIndex] as HTMLElement;
68
- // currentOption.blur();
69
- // options[this._focussedElementIndex].focus();
70
- // this._focussedElementIndex + 1 < options.length ? this._focussedElementIndex++ : (this._focussedElementIndex = 0);
71
- // } else {
72
- // this._focussedElementIndex++;
73
- // }
74
- // break;
75
- // case 'ArrowUp':
76
- // this.dropdownExpand = true;
77
- // if (this._focussedElementIndex == -1) {
78
- // const options = this.getOptionsList();
79
- // this._focussedElementIndex = options.length - 1;
80
- // } else {
81
- // const options = this.getOptionsList();
82
- // const currentOption = options[this._focussedElementIndex] as HTMLElement;
83
- // currentOption.blur();
84
- // this._focussedElementIndex > 0 ? this._focussedElementIndex-- : (this._focussedElementIndex = options.length - 1);
85
- // options[this._focussedElementIndex].focus();
86
- // }
87
- // break;
88
- // }
89
- // }
90
- render() {
91
- const parsedFieldOptionsData = typeof this.fieldOptionsData === 'string' ? JSON.parse(this.fieldOptionsData) : this.fieldOptionsData;
92
- if (!this.fieldOptionsData)
93
- return;
94
- const arrowIcon = this.sortDirection == 'ascending' ? 'arrow_upward' : 'arrow_downward';
95
- const chevronIcon = this.dropdownExpand ? 'expand_less' : 'expand_more';
96
- const selectedOption = this.selectedField;
97
- const dropdownSelectorClassNameModifier = this.dropdownExpand ? '--expanded' : '';
98
- const sorterKey = `sorter__${this.sorterKey}`;
99
- return (h(Host, { id: sorterKey }, h("div", { tabindex: 0, class: `sorter-container ${dropdownSelectorClassNameModifier}` }, h("button", { class: "arrow-toggle-button", type: "button", onClick: this.onSortToggleClick.bind(this) }, h("tttx-icon", { icon: arrowIcon, color: "black" })), h("div", { class: "dropdown-selector", onClick: this.onDropdownClicked.bind(this) }, h("div", { class: "dropdown-selector-button" }, h("div", { class: "dropdown-selector-text" }, selectedOption), h("div", { class: "dropdown-selector-chevron" }, h("tttx-icon", { icon: chevronIcon, color: "black" })))), this.dropdownExpand && (h("div", { class: "dropdown-options-list" }, parsedFieldOptionsData.sorterOptions.map(option => {
100
- return (h("div", { class: "dropdown-option", tabIndex: -1, onClick: this.onDropdownSelected.bind(this), key: option.optionLabel }, option.optionLabel));
101
- }))))));
102
- }
103
- static get is() { return "tttx-sorter"; }
104
- static get encapsulation() { return "shadow"; }
105
- static get originalStyleUrls() {
106
- return {
107
- "$": ["tttx-sorter.scss"]
108
- };
109
- }
110
- static get styleUrls() {
111
- return {
112
- "$": ["tttx-sorter.css"]
113
- };
114
- }
115
- static get properties() {
116
- return {
117
- "sorterKey": {
118
- "type": "string",
119
- "mutable": false,
120
- "complexType": {
121
- "original": "string",
122
- "resolved": "string",
123
- "references": {}
124
- },
125
- "required": false,
126
- "optional": false,
127
- "docs": {
128
- "tags": [],
129
- "text": ""
130
- },
131
- "attribute": "sorter-key",
132
- "reflect": false
133
- },
134
- "defaultSortDirection": {
135
- "type": "string",
136
- "mutable": false,
137
- "complexType": {
138
- "original": "'ascending' | 'descending'",
139
- "resolved": "\"ascending\" | \"descending\"",
140
- "references": {}
141
- },
142
- "required": false,
143
- "optional": false,
144
- "docs": {
145
- "tags": [],
146
- "text": ""
147
- },
148
- "attribute": "default-sort-direction",
149
- "reflect": false,
150
- "defaultValue": "'descending'"
151
- },
152
- "fieldOptionsData": {
153
- "type": "string",
154
- "mutable": false,
155
- "complexType": {
156
- "original": "string | SorterData",
157
- "resolved": "SorterData | string",
158
- "references": {
159
- "SorterData": {
160
- "location": "import",
161
- "path": "./interfaces"
162
- }
163
- }
164
- },
165
- "required": false,
166
- "optional": false,
167
- "docs": {
168
- "tags": [],
169
- "text": ""
170
- },
171
- "attribute": "field-options-data",
172
- "reflect": false,
173
- "defaultValue": "null"
174
- },
175
- "defaultOption": {
176
- "type": "string",
177
- "mutable": false,
178
- "complexType": {
179
- "original": "string",
180
- "resolved": "string",
181
- "references": {}
182
- },
183
- "required": false,
184
- "optional": false,
185
- "docs": {
186
- "tags": [],
187
- "text": ""
188
- },
189
- "attribute": "default-option",
190
- "reflect": false,
191
- "defaultValue": "''"
192
- }
193
- };
194
- }
195
- static get states() {
196
- return {
197
- "selectedField": {},
198
- "sortDirection": {},
199
- "dropdownExpand": {},
200
- "dropdownOptions": {}
201
- };
202
- }
203
- static get events() {
204
- return [{
205
- "method": "sorterChangeEvent",
206
- "name": "sorterChangeEvent",
207
- "bubbles": true,
208
- "cancelable": true,
209
- "composed": true,
210
- "docs": {
211
- "tags": [],
212
- "text": ""
213
- },
214
- "complexType": {
215
- "original": "SorterChangeEvent",
216
- "resolved": "SorterChangeEvent",
217
- "references": {
218
- "SorterChangeEvent": {
219
- "location": "import",
220
- "path": "./interfaces"
221
- }
222
- }
223
- }
224
- }];
225
- }
226
- static get elementRef() { return "el"; }
227
- static get listeners() {
228
- return [{
229
- "name": "closeSorter",
230
- "method": "handleCloseSorter",
231
- "target": undefined,
232
- "capture": false,
233
- "passive": false
234
- }];
235
- }
236
- }
1
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
+ import { h, Host } from '@stencil/core';
3
+ export class TttxSorter {
4
+ constructor() {
5
+ this.sorterKey = undefined;
6
+ this.defaultSortDirection = 'descending';
7
+ this.fieldOptionsData = null;
8
+ this.defaultOption = '';
9
+ this.selectedField = this.defaultOption;
10
+ this.sortDirection = this.defaultSortDirection;
11
+ this.dropdownExpand = false;
12
+ this.dropdownOptions = undefined;
13
+ }
14
+ handleCloseSorter() {
15
+ this.dropdownExpand = false;
16
+ }
17
+ emitSortEvent() {
18
+ this.sorterChangeEvent.emit({
19
+ sorterDirection: this.sortDirection,
20
+ sorterKey: this.sorterKey,
21
+ sortField: this.selectedField,
22
+ });
23
+ }
24
+ onSortToggleClick(event) {
25
+ event.preventDefault();
26
+ if (this.sortDirection == 'ascending') {
27
+ this.sortDirection = 'descending';
28
+ }
29
+ else {
30
+ this.sortDirection = 'ascending';
31
+ }
32
+ this.emitSortEvent();
33
+ }
34
+ onDropdownClicked() {
35
+ this.dropdownExpand = !this.dropdownExpand;
36
+ this.toggleSorter.emit(this.dropdownExpand);
37
+ }
38
+ onDropdownSelected(event) {
39
+ this.dropdownExpand = false;
40
+ const target = event.target;
41
+ this.selectedField = target.innerHTML;
42
+ this.emitSortEvent();
43
+ this.toggleSorter.emit(this.dropdownExpand);
44
+ }
45
+ // getOptionsList() {
46
+ // return this.el.shadowRoot.querySelectorAll('.dropdown-option');
47
+ // }
48
+ // /* istanbul ignore next */
49
+ // @Listen('keyup')
50
+ // handleKeyDown(ev: KeyboardEvent) {
51
+ // const keyboardEventValue = ev.key;
52
+ // if (document.activeElement.id != `sorter__${this.sorterKey}`) return;
53
+ // switch (keyboardEventValue) {
54
+ // case 'Enter':
55
+ // if (this._focussedElementIndex > -1) {
56
+ // const options = this.el.shadowRoot.querySelectorAll('.dropdown-option');
57
+ // this.selectedField = options[this._focussedElementIndex].innerHTML;
58
+ // this.emitSortEvent();
59
+ // }
60
+ // this.dropdownExpand = false;
61
+ // break;
62
+ // case 'Escape':
63
+ // this.dropdownExpand = false;
64
+ // break;
65
+ // case 'ArrowDown':
66
+ // this.dropdownExpand = true;
67
+ // if (this._focussedElementIndex > -1) {
68
+ // const options = this.getOptionsList();
69
+ // const currentOption = options[this._focussedElementIndex] as HTMLElement;
70
+ // currentOption.blur();
71
+ // options[this._focussedElementIndex].focus();
72
+ // this._focussedElementIndex + 1 < options.length ? this._focussedElementIndex++ : (this._focussedElementIndex = 0);
73
+ // } else {
74
+ // this._focussedElementIndex++;
75
+ // }
76
+ // break;
77
+ // case 'ArrowUp':
78
+ // this.dropdownExpand = true;
79
+ // if (this._focussedElementIndex == -1) {
80
+ // const options = this.getOptionsList();
81
+ // this._focussedElementIndex = options.length - 1;
82
+ // } else {
83
+ // const options = this.getOptionsList();
84
+ // const currentOption = options[this._focussedElementIndex] as HTMLElement;
85
+ // currentOption.blur();
86
+ // this._focussedElementIndex > 0 ? this._focussedElementIndex-- : (this._focussedElementIndex = options.length - 1);
87
+ // options[this._focussedElementIndex].focus();
88
+ // }
89
+ // break;
90
+ // }
91
+ // }
92
+ render() {
93
+ const parsedFieldOptionsData = typeof this.fieldOptionsData === 'string' ? JSON.parse(this.fieldOptionsData) : this.fieldOptionsData;
94
+ if (!this.fieldOptionsData)
95
+ return;
96
+ const arrowIcon = this.sortDirection == 'ascending' ? 'arrow_upward' : 'arrow_downward';
97
+ const chevronIcon = this.dropdownExpand ? 'expand_less' : 'expand_more';
98
+ const selectedOption = this.selectedField;
99
+ const dropdownSelectorClassNameModifier = this.dropdownExpand ? '--expanded' : '';
100
+ const sorterKey = `sorter__${this.sorterKey}`;
101
+ return (h(Host, { id: sorterKey }, h("div", { tabindex: 0, class: `sorter-container ${dropdownSelectorClassNameModifier}` }, h("button", { class: "arrow-toggle-button", type: "button", onClick: this.onSortToggleClick.bind(this) }, h("tttx-icon", { icon: arrowIcon, color: "black" })), h("div", { class: "dropdown-selector", onClick: this.onDropdownClicked.bind(this) }, h("div", { class: "dropdown-selector-button" }, h("div", { class: "dropdown-selector-text" }, selectedOption), h("div", { class: "dropdown-selector-chevron" }, h("tttx-icon", { icon: chevronIcon, color: "black" })))), this.dropdownExpand && (h("div", { class: "dropdown-options-list" }, parsedFieldOptionsData.sorterOptions.map(option => {
102
+ return (h("div", { class: "dropdown-option", tabIndex: -1, onClick: this.onDropdownSelected.bind(this), key: option.optionLabel }, option.optionLabel));
103
+ }))))));
104
+ }
105
+ static get is() { return "tttx-sorter"; }
106
+ static get encapsulation() { return "shadow"; }
107
+ static get originalStyleUrls() {
108
+ return {
109
+ "$": ["tttx-sorter.scss"]
110
+ };
111
+ }
112
+ static get styleUrls() {
113
+ return {
114
+ "$": ["tttx-sorter.css"]
115
+ };
116
+ }
117
+ static get properties() {
118
+ return {
119
+ "sorterKey": {
120
+ "type": "string",
121
+ "mutable": false,
122
+ "complexType": {
123
+ "original": "string",
124
+ "resolved": "string",
125
+ "references": {}
126
+ },
127
+ "required": false,
128
+ "optional": false,
129
+ "docs": {
130
+ "tags": [],
131
+ "text": ""
132
+ },
133
+ "attribute": "sorter-key",
134
+ "reflect": false
135
+ },
136
+ "defaultSortDirection": {
137
+ "type": "string",
138
+ "mutable": false,
139
+ "complexType": {
140
+ "original": "'ascending' | 'descending'",
141
+ "resolved": "\"ascending\" | \"descending\"",
142
+ "references": {}
143
+ },
144
+ "required": false,
145
+ "optional": false,
146
+ "docs": {
147
+ "tags": [],
148
+ "text": ""
149
+ },
150
+ "attribute": "default-sort-direction",
151
+ "reflect": false,
152
+ "defaultValue": "'descending'"
153
+ },
154
+ "fieldOptionsData": {
155
+ "type": "string",
156
+ "mutable": false,
157
+ "complexType": {
158
+ "original": "string | SorterData",
159
+ "resolved": "SorterData | string",
160
+ "references": {
161
+ "SorterData": {
162
+ "location": "import",
163
+ "path": "./interfaces"
164
+ }
165
+ }
166
+ },
167
+ "required": false,
168
+ "optional": false,
169
+ "docs": {
170
+ "tags": [],
171
+ "text": ""
172
+ },
173
+ "attribute": "field-options-data",
174
+ "reflect": false,
175
+ "defaultValue": "null"
176
+ },
177
+ "defaultOption": {
178
+ "type": "string",
179
+ "mutable": false,
180
+ "complexType": {
181
+ "original": "string",
182
+ "resolved": "string",
183
+ "references": {}
184
+ },
185
+ "required": false,
186
+ "optional": false,
187
+ "docs": {
188
+ "tags": [],
189
+ "text": ""
190
+ },
191
+ "attribute": "default-option",
192
+ "reflect": false,
193
+ "defaultValue": "''"
194
+ }
195
+ };
196
+ }
197
+ static get states() {
198
+ return {
199
+ "selectedField": {},
200
+ "sortDirection": {},
201
+ "dropdownExpand": {},
202
+ "dropdownOptions": {}
203
+ };
204
+ }
205
+ static get events() {
206
+ return [{
207
+ "method": "sorterChangeEvent",
208
+ "name": "sorterChangeEvent",
209
+ "bubbles": true,
210
+ "cancelable": true,
211
+ "composed": true,
212
+ "docs": {
213
+ "tags": [],
214
+ "text": ""
215
+ },
216
+ "complexType": {
217
+ "original": "SorterChangeEvent",
218
+ "resolved": "SorterChangeEvent",
219
+ "references": {
220
+ "SorterChangeEvent": {
221
+ "location": "import",
222
+ "path": "./interfaces"
223
+ }
224
+ }
225
+ }
226
+ }, {
227
+ "method": "toggleSorter",
228
+ "name": "toggleSorter",
229
+ "bubbles": true,
230
+ "cancelable": true,
231
+ "composed": true,
232
+ "docs": {
233
+ "tags": [],
234
+ "text": ""
235
+ },
236
+ "complexType": {
237
+ "original": "boolean",
238
+ "resolved": "boolean",
239
+ "references": {}
240
+ }
241
+ }];
242
+ }
243
+ static get elementRef() { return "el"; }
244
+ static get listeners() {
245
+ return [{
246
+ "name": "closeSorter",
247
+ "method": "handleCloseSorter",
248
+ "target": undefined,
249
+ "capture": false,
250
+ "passive": false
251
+ }];
252
+ }
253
+ }
@@ -1,26 +1,26 @@
1
- import { withActions } from '@storybook/addon-actions/decorator';
2
- export default {
3
- title: 'molecules/Sorter',
4
- component: 'tttx-sorter',
5
- argTypes: {
6
- fieldOptionsData: {
7
- control: { type: 'object' },
8
- },
9
- defaultOption: {
10
- control: { type: 'text' },
11
- },
12
- sorterKey: {
13
- control: { type: 'text' },
14
- },
15
- },
16
- parameters: {
17
- actions: {
18
- handles: ['sorterChangeEvent'],
19
- },
20
- },
21
- decorators: [withActions],
22
- };
23
- const TemplateSorter = ({ fieldOptionsData, sorterKey, defaultOption }) => {
1
+ import { withActions } from '@storybook/addon-actions/decorator';
2
+ export default {
3
+ title: 'molecules/Sorter',
4
+ component: 'tttx-sorter',
5
+ argTypes: {
6
+ fieldOptionsData: {
7
+ control: { type: 'object' },
8
+ },
9
+ defaultOption: {
10
+ control: { type: 'text' },
11
+ },
12
+ sorterKey: {
13
+ control: { type: 'text' },
14
+ },
15
+ },
16
+ parameters: {
17
+ actions: {
18
+ handles: ['sorterChangeEvent'],
19
+ },
20
+ },
21
+ decorators: [withActions],
22
+ };
23
+ const TemplateSorter = ({ fieldOptionsData, sorterKey, defaultOption }) => {
24
24
  return `
25
25
  <div style='width: 250px;'>
26
26
  <tttx-sorter
@@ -28,22 +28,22 @@ const TemplateSorter = ({ fieldOptionsData, sorterKey, defaultOption }) => {
28
28
  default-option='${defaultOption}'
29
29
  sorter-key='${sorterKey}'/>
30
30
  </div>
31
- `;
32
- };
33
- const fieldOptionsData = {
34
- sorterOptions: [{ optionLabel: 'Expiry date' }, { optionLabel: 'Qualification name' }],
35
- };
36
- export const BasicSorter = TemplateSorter.bind({});
37
- BasicSorter.args = {
38
- fieldOptionsData: fieldOptionsData,
39
- sorterKey: 'BasicDropdown',
40
- defaultOption: 'Qualification name',
41
- };
42
- export const AnotherSorter = TemplateSorter.bind({});
43
- AnotherSorter.args = {
44
- fieldOptionsData: {
45
- sorterOptions: [{ optionLabel: 'Name' }, { optionLabel: 'Date of Birth' }, { optionLabel: 'Job Role' }],
46
- },
47
- sorterKey: 'BasicDropdown',
48
- defaultOption: 'Date of Birth',
49
- };
31
+ `;
32
+ };
33
+ const fieldOptionsData = {
34
+ sorterOptions: [{ optionLabel: 'Expiry date' }, { optionLabel: 'Qualification name' }],
35
+ };
36
+ export const BasicSorter = TemplateSorter.bind({});
37
+ BasicSorter.args = {
38
+ fieldOptionsData: fieldOptionsData,
39
+ sorterKey: 'BasicDropdown',
40
+ defaultOption: 'Qualification name',
41
+ };
42
+ export const AnotherSorter = TemplateSorter.bind({});
43
+ AnotherSorter.args = {
44
+ fieldOptionsData: {
45
+ sorterOptions: [{ optionLabel: 'Name' }, { optionLabel: 'Date of Birth' }, { optionLabel: 'Job Role' }],
46
+ },
47
+ sorterKey: 'BasicDropdown',
48
+ defaultOption: 'Date of Birth',
49
+ };