@3t-transform/threeteeui 0.0.24 → 0.1.0
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-bc080fb4.js → index-451f61dd.js} +51 -60
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/tttx-button.cjs.entry.js +1 -1
- package/dist/cjs/tttx-form.cjs.entry.js +377 -0
- package/dist/cjs/tttx-icon.cjs.entry.js +2 -2
- package/dist/cjs/tttx-keyvalue-block.cjs.entry.js +8 -5
- package/dist/cjs/tttx-list.cjs.entry.js +1677 -7
- package/dist/cjs/tttx-loading-spinner.cjs.entry.js +1 -1
- package/dist/cjs/tttx-standalone-input.cjs.entry.js +7 -3
- package/dist/cjs/tttx.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/atoms/tttx-icon/tttx-icon.css +4 -0
- package/dist/collection/components/atoms/tttx-icon/tttx-icon.stories.js +1 -1
- package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js +7 -4
- package/dist/collection/components/molecules/tttx-form/lib/setErrorState.js +35 -0
- package/dist/collection/components/molecules/tttx-form/lib/validityCheck.js +58 -0
- package/dist/collection/components/molecules/tttx-form/tttx-form.css +336 -0
- package/dist/collection/components/molecules/tttx-form/tttx-form.js +364 -0
- package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +127 -0
- package/dist/collection/components/molecules/tttx-list/tttx-list.css +8 -2
- package/dist/collection/components/molecules/tttx-list/tttx-list.js +33 -7
- package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +46 -14
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.css +25 -3
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +57 -1
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +14 -1
- package/dist/collection/shared/domsanitiser.options.js +14 -0
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{tttx-table.d.ts → tttx-form.d.ts} +4 -4
- package/dist/components/tttx-form.js +394 -0
- package/dist/components/tttx-icon2.js +1 -1
- package/dist/components/tttx-keyvalue-block.js +7 -4
- package/dist/components/tttx-list.js +1678 -7
- package/dist/components/tttx-standalone-input.js +9 -2
- package/dist/esm/{index-901bfd55.js → index-0350f122.js} +51 -60
- package/dist/esm/loader.js +2 -2
- package/dist/esm/tttx-button.entry.js +1 -1
- package/dist/esm/tttx-form.entry.js +373 -0
- package/dist/esm/tttx-icon.entry.js +2 -2
- package/dist/esm/tttx-keyvalue-block.entry.js +8 -5
- package/dist/esm/tttx-list.entry.js +1677 -7
- package/dist/esm/tttx-loading-spinner.entry.js +1 -1
- package/dist/esm/tttx-standalone-input.entry.js +7 -3
- package/dist/esm/tttx.js +2 -2
- package/dist/tttx/{p-a4077908.entry.js → p-1b015a9d.entry.js} +1 -1
- package/dist/tttx/{p-9a382959.entry.js → p-4f3958fa.entry.js} +1 -1
- package/dist/tttx/p-62869344.js +2 -0
- package/dist/tttx/{p-0ae51ec5.entry.js → p-92465671.entry.js} +1 -1
- package/dist/tttx/p-a0179cb1.entry.js +1 -0
- package/dist/tttx/p-b0a6b872.entry.js +1 -0
- package/dist/tttx/p-cd1565e0.entry.js +3 -0
- package/dist/tttx/p-ce015353.entry.js +1 -0
- package/dist/tttx/tttx.esm.js +1 -1
- package/dist/types/components/molecules/tttx-form/lib/setErrorState.d.ts +13 -0
- package/dist/types/components/molecules/tttx-form/lib/validityCheck.d.ts +17 -0
- package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +114 -0
- package/dist/types/components/molecules/{tttx-table/tttx-table.stories.d.ts → tttx-form/tttx-form.stories.d.ts} +2 -10
- package/dist/types/components/molecules/tttx-list/interfaces.d.ts +4 -2
- package/dist/types/components/molecules/tttx-list/tttx-list.d.ts +3 -1
- package/dist/types/components/molecules/tttx-list/tttx-list.stories.d.ts +7 -0
- package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +3 -0
- package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.d.ts +16 -0
- package/dist/types/components.d.ts +32 -28
- package/dist/types/shared/domsanitiser.options.d.ts +10 -0
- package/package.json +1 -1
- package/dist/cjs/tttx-table.cjs.entry.js +0 -60
- 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 -43
- 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 -164
- package/dist/collection/components/atoms/tttx-loading-spinner/Test/tttx-loading-spinner.spec.js +0 -64
- package/dist/collection/components/molecules/tttx-list/test/tttx-list.spec.js +0 -151
- 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 -146
- package/dist/collection/components/molecules/tttx-table/test/tttx-table.e2e.js +0 -9
- package/dist/collection/components/molecules/tttx-table/tttx-table.css +0 -166
- package/dist/collection/components/molecules/tttx-table/tttx-table.js +0 -174
- package/dist/collection/components/molecules/tttx-table/tttx-table.stories.js +0 -81
- package/dist/components/tttx-table.js +0 -85
- package/dist/esm/tttx-table.entry.js +0 -56
- package/dist/tttx/p-1ec23160.entry.js +0 -1
- package/dist/tttx/p-300ff6a8.entry.js +0 -1
- package/dist/tttx/p-32ad02d3.entry.js +0 -1
- package/dist/tttx/p-80cf5236.entry.js +0 -1
- package/dist/tttx/p-a1bd16a1.entry.js +0 -1
- package/dist/tttx/p-a6953900.entry.js +0 -1
- package/dist/tttx/p-b46e3c59.entry.js +0 -1
- package/dist/tttx/p-c290160b.js +0 -2
- package/dist/tttx/p-dc179257.entry.js +0 -1
- package/dist/tttx/p-e19eb07e.entry.js +0 -1
- package/dist/tttx/p-e4341658.entry.js +0 -1
- 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-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-table/test/tttx-table.e2e.d.ts +0 -1
- package/dist/types/components/molecules/tttx-table/tttx-table.d.ts +0 -15
|
@@ -14,6 +14,10 @@ export namespace Components {
|
|
|
14
14
|
"iconposition": 'left' | 'right';
|
|
15
15
|
"notext": boolean;
|
|
16
16
|
}
|
|
17
|
+
interface TttxForm {
|
|
18
|
+
"formschema": any;
|
|
19
|
+
"submitValue": any;
|
|
20
|
+
}
|
|
17
21
|
interface TttxIcon {
|
|
18
22
|
"color": string;
|
|
19
23
|
"icon": string;
|
|
@@ -24,6 +28,7 @@ export namespace Components {
|
|
|
24
28
|
}
|
|
25
29
|
interface TttxList {
|
|
26
30
|
"data": string | ListItem[];
|
|
31
|
+
"name": string;
|
|
27
32
|
}
|
|
28
33
|
interface TttxLoadingSpinner {
|
|
29
34
|
"loadingMessage": boolean;
|
|
@@ -36,6 +41,7 @@ export namespace Components {
|
|
|
36
41
|
"errormsg": string;
|
|
37
42
|
"iconleft": string;
|
|
38
43
|
"iconright": string;
|
|
44
|
+
"inline": boolean;
|
|
39
45
|
"inputAutocapitalize": 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters';
|
|
40
46
|
"inputAutofocus": boolean;
|
|
41
47
|
/**
|
|
@@ -49,6 +55,7 @@ export namespace Components {
|
|
|
49
55
|
*/
|
|
50
56
|
"inputKeyhint": 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
|
|
51
57
|
"inputTitle": string;
|
|
58
|
+
"inputicon": string;
|
|
52
59
|
"label": string;
|
|
53
60
|
"max": MinMaxDates | number;
|
|
54
61
|
"maxlength": string | number;
|
|
@@ -59,17 +66,16 @@ export namespace Components {
|
|
|
59
66
|
"placeholder": string;
|
|
60
67
|
"readonly": string | boolean;
|
|
61
68
|
"required": boolean;
|
|
69
|
+
"showerrorbubble": boolean;
|
|
62
70
|
"showerrormsg": boolean;
|
|
63
71
|
"step": string | number;
|
|
64
72
|
"type": string;
|
|
65
73
|
"value": string | number;
|
|
66
74
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"selected": number;
|
|
72
|
-
}
|
|
75
|
+
}
|
|
76
|
+
export interface TttxFormCustomEvent<T> extends CustomEvent<T> {
|
|
77
|
+
detail: T;
|
|
78
|
+
target: HTMLTttxFormElement;
|
|
73
79
|
}
|
|
74
80
|
export interface TttxListCustomEvent<T> extends CustomEvent<T> {
|
|
75
81
|
detail: T;
|
|
@@ -79,10 +85,6 @@ export interface TttxStandaloneInputCustomEvent<T> extends CustomEvent<T> {
|
|
|
79
85
|
detail: T;
|
|
80
86
|
target: HTMLTttxStandaloneInputElement;
|
|
81
87
|
}
|
|
82
|
-
export interface TttxTableCustomEvent<T> extends CustomEvent<T> {
|
|
83
|
-
detail: T;
|
|
84
|
-
target: HTMLTttxTableElement;
|
|
85
|
-
}
|
|
86
88
|
declare global {
|
|
87
89
|
interface HTMLTttxButtonElement extends Components.TttxButton, HTMLStencilElement {
|
|
88
90
|
}
|
|
@@ -90,6 +92,12 @@ declare global {
|
|
|
90
92
|
prototype: HTMLTttxButtonElement;
|
|
91
93
|
new (): HTMLTttxButtonElement;
|
|
92
94
|
};
|
|
95
|
+
interface HTMLTttxFormElement extends Components.TttxForm, HTMLStencilElement {
|
|
96
|
+
}
|
|
97
|
+
var HTMLTttxFormElement: {
|
|
98
|
+
prototype: HTMLTttxFormElement;
|
|
99
|
+
new (): HTMLTttxFormElement;
|
|
100
|
+
};
|
|
93
101
|
interface HTMLTttxIconElement extends Components.TttxIcon, HTMLStencilElement {
|
|
94
102
|
}
|
|
95
103
|
var HTMLTttxIconElement: {
|
|
@@ -120,20 +128,14 @@ declare global {
|
|
|
120
128
|
prototype: HTMLTttxStandaloneInputElement;
|
|
121
129
|
new (): HTMLTttxStandaloneInputElement;
|
|
122
130
|
};
|
|
123
|
-
interface HTMLTttxTableElement extends Components.TttxTable, HTMLStencilElement {
|
|
124
|
-
}
|
|
125
|
-
var HTMLTttxTableElement: {
|
|
126
|
-
prototype: HTMLTttxTableElement;
|
|
127
|
-
new (): HTMLTttxTableElement;
|
|
128
|
-
};
|
|
129
131
|
interface HTMLElementTagNameMap {
|
|
130
132
|
"tttx-button": HTMLTttxButtonElement;
|
|
133
|
+
"tttx-form": HTMLTttxFormElement;
|
|
131
134
|
"tttx-icon": HTMLTttxIconElement;
|
|
132
135
|
"tttx-keyvalue-block": HTMLTttxKeyvalueBlockElement;
|
|
133
136
|
"tttx-list": HTMLTttxListElement;
|
|
134
137
|
"tttx-loading-spinner": HTMLTttxLoadingSpinnerElement;
|
|
135
138
|
"tttx-standalone-input": HTMLTttxStandaloneInputElement;
|
|
136
|
-
"tttx-table": HTMLTttxTableElement;
|
|
137
139
|
}
|
|
138
140
|
}
|
|
139
141
|
declare namespace LocalJSX {
|
|
@@ -143,6 +145,12 @@ declare namespace LocalJSX {
|
|
|
143
145
|
"iconposition"?: 'left' | 'right';
|
|
144
146
|
"notext"?: boolean;
|
|
145
147
|
}
|
|
148
|
+
interface TttxForm {
|
|
149
|
+
"formschema"?: any;
|
|
150
|
+
"onDataChanged"?: (event: TttxFormCustomEvent<{ name: string, value: any }>) => void;
|
|
151
|
+
"onDataSubmitted"?: (event: TttxFormCustomEvent<FormData>) => void;
|
|
152
|
+
"submitValue"?: any;
|
|
153
|
+
}
|
|
146
154
|
interface TttxIcon {
|
|
147
155
|
"color"?: string;
|
|
148
156
|
"icon"?: string;
|
|
@@ -153,7 +161,8 @@ declare namespace LocalJSX {
|
|
|
153
161
|
}
|
|
154
162
|
interface TttxList {
|
|
155
163
|
"data"?: string | ListItem[];
|
|
156
|
-
"
|
|
164
|
+
"name"?: string;
|
|
165
|
+
"onListRowClick"?: (event: TttxListCustomEvent<any>) => void;
|
|
157
166
|
}
|
|
158
167
|
interface TttxLoadingSpinner {
|
|
159
168
|
"loadingMessage"?: boolean;
|
|
@@ -166,6 +175,7 @@ declare namespace LocalJSX {
|
|
|
166
175
|
"errormsg"?: string;
|
|
167
176
|
"iconleft"?: string;
|
|
168
177
|
"iconright"?: string;
|
|
178
|
+
"inline"?: boolean;
|
|
169
179
|
"inputAutocapitalize"?: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters';
|
|
170
180
|
"inputAutofocus"?: boolean;
|
|
171
181
|
/**
|
|
@@ -179,6 +189,7 @@ declare namespace LocalJSX {
|
|
|
179
189
|
*/
|
|
180
190
|
"inputKeyhint"?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
|
|
181
191
|
"inputTitle"?: string;
|
|
192
|
+
"inputicon"?: string;
|
|
182
193
|
"label"?: string;
|
|
183
194
|
"max"?: MinMaxDates | number;
|
|
184
195
|
"maxlength"?: string | number;
|
|
@@ -193,27 +204,20 @@ declare namespace LocalJSX {
|
|
|
193
204
|
"placeholder"?: string;
|
|
194
205
|
"readonly"?: string | boolean;
|
|
195
206
|
"required"?: boolean;
|
|
207
|
+
"showerrorbubble"?: boolean;
|
|
196
208
|
"showerrormsg"?: boolean;
|
|
197
209
|
"step"?: string | number;
|
|
198
210
|
"type"?: string;
|
|
199
211
|
"value"?: string | number;
|
|
200
212
|
}
|
|
201
|
-
interface TttxTable {
|
|
202
|
-
"data"?: any[];
|
|
203
|
-
"headers"?: any[];
|
|
204
|
-
"loading"?: boolean;
|
|
205
|
-
"onHeaderClicked"?: (event: TttxTableCustomEvent<any>) => void;
|
|
206
|
-
"onRowSelected"?: (event: TttxTableCustomEvent<any>) => void;
|
|
207
|
-
"selected"?: number;
|
|
208
|
-
}
|
|
209
213
|
interface IntrinsicElements {
|
|
210
214
|
"tttx-button": TttxButton;
|
|
215
|
+
"tttx-form": TttxForm;
|
|
211
216
|
"tttx-icon": TttxIcon;
|
|
212
217
|
"tttx-keyvalue-block": TttxKeyvalueBlock;
|
|
213
218
|
"tttx-list": TttxList;
|
|
214
219
|
"tttx-loading-spinner": TttxLoadingSpinner;
|
|
215
220
|
"tttx-standalone-input": TttxStandaloneInput;
|
|
216
|
-
"tttx-table": TttxTable;
|
|
217
221
|
}
|
|
218
222
|
}
|
|
219
223
|
export { LocalJSX as JSX };
|
|
@@ -221,12 +225,12 @@ declare module "@stencil/core" {
|
|
|
221
225
|
export namespace JSX {
|
|
222
226
|
interface IntrinsicElements {
|
|
223
227
|
"tttx-button": LocalJSX.TttxButton & JSXBase.HTMLAttributes<HTMLTttxButtonElement>;
|
|
228
|
+
"tttx-form": LocalJSX.TttxForm & JSXBase.HTMLAttributes<HTMLTttxFormElement>;
|
|
224
229
|
"tttx-icon": LocalJSX.TttxIcon & JSXBase.HTMLAttributes<HTMLTttxIconElement>;
|
|
225
230
|
"tttx-keyvalue-block": LocalJSX.TttxKeyvalueBlock & JSXBase.HTMLAttributes<HTMLTttxKeyvalueBlockElement>;
|
|
226
231
|
"tttx-list": LocalJSX.TttxList & JSXBase.HTMLAttributes<HTMLTttxListElement>;
|
|
227
232
|
"tttx-loading-spinner": LocalJSX.TttxLoadingSpinner & JSXBase.HTMLAttributes<HTMLTttxLoadingSpinnerElement>;
|
|
228
233
|
"tttx-standalone-input": LocalJSX.TttxStandaloneInput & JSXBase.HTMLAttributes<HTMLTttxStandaloneInputElement>;
|
|
229
|
-
"tttx-table": LocalJSX.TttxTable & JSXBase.HTMLAttributes<HTMLTttxTableElement>;
|
|
230
234
|
}
|
|
231
235
|
}
|
|
232
236
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare function tagRegXp(tagName: string): RegExpExecArray;
|
|
2
|
+
declare function attributeNameCheck(): boolean;
|
|
3
|
+
declare const domSanitiserOptions: {
|
|
4
|
+
CUSTOM_ELEMENT_HANDLING: {
|
|
5
|
+
tagNameCheck: typeof tagRegXp;
|
|
6
|
+
attributeNameCheck: typeof attributeNameCheck;
|
|
7
|
+
allowCustomizedBuiltInElements: boolean;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export default domSanitiserOptions;
|
package/package.json
CHANGED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-bc080fb4.js');
|
|
6
|
-
|
|
7
|
-
const tttxTableCss = "// SPACING $spacing-unit: 4px; // REGULAR $horizontal-spacing: $spacing-unit * 4; $vertical-spacing: $spacing-unit * 2; $base-padding: $vertical-spacing $horizontal-spacing; $base-height: $spacing-unit * 9; $component-spacing: $spacing-unit * 4; // SMALL $horizontal-spacing-sm: $spacing-unit * 2; $vertical-spacing-sm: $spacing-unit * 1; $base-padding-sm: $vertical-spacing-sm $horizontal-spacing-sm; $base-height-sm: $spacing-unit * 7; // COLOURS $grey-0: #212121; $grey-1: #363636; $grey-2: #4c4c4c; $grey-3: #636363; $grey-4: #757575; $grey-5: #9e9e9e; $grey-6: #aeaeae; $grey-7: #c8c8c8; $grey-8: #e3e3e3; $grey-9: #f0f0f0; $white: white; $black: $grey-0; $transparent: transparent; $blue-0: #00187c; $blue-1: #032e8c; $blue-2: #0849a3; $blue-3: #0951a8; $blue-4: #1169ba; $blue-5: #1479c6; $blue-6: #5194d2; $blue-7: #7aacdd; $blue-8: #b9d5ed; $blue-9: #e7f1f9; $red-0: #7c0000; $red-1: #8c0000; $red-2: #a30000; $red-3: #a80000; $red-4: #ba0000; $red-5: #dc0000; $red-6: #d25151; $red-7: #dd7a7a; $red-8: #edc1c1; $red-9: #f9e7e7; $black-1: #e6e6e6; $brand: $blue-0; $accent: $blue-5; $accent-selected: $blue-9; $error: $red-5; $severity-critical: #dc0000; $severity-warning: #f59500; $severity-success: #a2bb31; $severity-info: $accent; $ui-primary: $black; $ui-secondary: $grey-4; $ui-disabled: $grey-2; $ui-placeholder: $grey-5; $ui-background: $grey-9; $ui-sheet: $white; $ui-border: #d5d5d5; // BORDERS $ui-border-radius: 4px; $ui-border-width: 1px; // TYPOGRAPHY $font-size-default: 16px; $font-size-small: 14px; .material-symbols-rounded{font-variation-settings:'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24}.skeleton{animation:skeleton-loading 1s linear infinite alternate;border-radius:4px;width:100%}@keyframes skeleton-loading{0%{background-color:hsl(200, 20%, 80%)}100%{background-color:hsl(200, 20%, 95%)}}:host{display:block}table{box-sizing:border-box;width:100%;border-collapse:collapse;border-spacing:0;border:1px solid #ddd;border-bottom:none}thead tr{height:52px;color:#757575}tbody tr{height:48px;color:#212121}tr{font-family:'Roboto', sans-serif;font-weight:400;font-size:16px;display:flex;align-items:center;border-bottom:1px solid #ddd}.selected{background-color:#F0F0F0}.checked{background-color:#e7f1f9}td,th{min-width:300px;margin-left:16px;display:flex;align-items:left}.skeleton{height:24px;display:block}.align-right{margin-left:auto}";
|
|
8
|
-
|
|
9
|
-
const TttxTable = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
index.registerInstance(this, hostRef);
|
|
12
|
-
this.rowSelected = index.createEvent(this, "rowSelected", 7);
|
|
13
|
-
this.headerClicked = index.createEvent(this, "headerClicked", 7);
|
|
14
|
-
this.headers = [];
|
|
15
|
-
this.data = [];
|
|
16
|
-
this.loading = false;
|
|
17
|
-
this.selected = -1;
|
|
18
|
-
}
|
|
19
|
-
handleKeyDown(ev) {
|
|
20
|
-
if (ev.key === 'ArrowDown' || ev.key === 'ArrowUp') {
|
|
21
|
-
this.updateSelectedIndex(ev.key);
|
|
22
|
-
this.emitRowSelected();
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
updateSelectedIndex(key) {
|
|
26
|
-
if (this.selected === -1) {
|
|
27
|
-
this.selected = 0;
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
const isArrowDown = key === 'ArrowDown';
|
|
31
|
-
const isArrowUp = key === 'ArrowUp';
|
|
32
|
-
if (isArrowDown && this.selected < this.data.length - 1) {
|
|
33
|
-
this.selected++;
|
|
34
|
-
}
|
|
35
|
-
else if (isArrowUp && this.selected > 0) {
|
|
36
|
-
this.selected--;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
emitRowSelected() {
|
|
41
|
-
this.rowSelected.emit(this.data[this.selected]);
|
|
42
|
-
}
|
|
43
|
-
rowSelectedHandler(row) {
|
|
44
|
-
this.rowSelected.emit(row);
|
|
45
|
-
this.selected = this.data.findIndex((item) => item === row);
|
|
46
|
-
}
|
|
47
|
-
headerClickedHandler(key) {
|
|
48
|
-
this.headerClicked.emit(key);
|
|
49
|
-
}
|
|
50
|
-
render() {
|
|
51
|
-
return (index.h(index.Host, null, index.h("table", null, index.h("thead", null, index.h("tr", null, this.loading ?
|
|
52
|
-
[1, 2, 3].map(() => (index.h("th", null, index.h("div", { class: "skeleton" })))) :
|
|
53
|
-
this.headers && this.headers.map((header) => (index.h("th", { scope: "col", onClick: () => this.headerClickedHandler(header.key) }, header.label))))), index.h("tbody", null, this.loading ?
|
|
54
|
-
[1, 2, 3].map(() => (index.h("tr", null, index.h("td", null, index.h("div", { class: "skeleton" })), index.h("td", null, index.h("div", { class: "skeleton" })), index.h("td", null, index.h("div", { class: "skeleton" }))))) :
|
|
55
|
-
Object.keys(this.data).map((key, index$1) => (index.h("tr", { class: index$1 === this.selected ? 'selected' : '', onClick: () => this.rowSelectedHandler(this.data[key]) }, this.headers.map((header) => (index.h("td", null, this.data[key][header.key], " ", header.actions && index.h("tttx-icon", { class: "align-right", icon: "more_vert" }, index.h("div", { slot: "popover" }, index.h("tttx-popover-content", { header: "The humble egg", body: "Most arthropods such as insects, vertebrates (excluding live-bearing mammals), and mollusks lay eggs, although some, such as scorpions, do not.", linkcontext: "Wikipedia_egg", linktext: "Learn more about eggs" })))))))))))));
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
TttxTable.style = tttxTableCss;
|
|
59
|
-
|
|
60
|
-
exports.tttx_table = TttxTable;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { newE2EPage } from '@stencil/core/testing';
|
|
2
|
-
describe('tttx-button', () => {
|
|
3
|
-
it('renders', async () => {
|
|
4
|
-
const page = await newE2EPage();
|
|
5
|
-
await page.setContent('<tttx-button></tttx-button>');
|
|
6
|
-
const element = await page.find('tttx-button');
|
|
7
|
-
expect(element).toHaveClass('hydrated');
|
|
8
|
-
});
|
|
9
|
-
});
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { newSpecPage } from '@stencil/core/testing';
|
|
2
|
-
import { TttxButton } from '../tttx-button';
|
|
3
|
-
describe('tttx-button', () => {
|
|
4
|
-
it('renders', async () => {
|
|
5
|
-
const page = await newSpecPage({
|
|
6
|
-
components: [TttxButton],
|
|
7
|
-
html: '<tttx-button></tttx-button>',
|
|
8
|
-
});
|
|
9
|
-
expect(page.root).toEqualHtml(`
|
|
10
|
-
<tttx-button>
|
|
11
|
-
<mock:shadow-root>
|
|
12
|
-
<button class="button default">
|
|
13
|
-
<div class="button-content">
|
|
14
|
-
<slot></slot>
|
|
15
|
-
</div>
|
|
16
|
-
</button>
|
|
17
|
-
</mock:shadow-root>
|
|
18
|
-
</tttx-button>
|
|
19
|
-
`);
|
|
20
|
-
});
|
|
21
|
-
it('clicks', async () => {
|
|
22
|
-
const page = await newSpecPage({
|
|
23
|
-
components: [TttxButton],
|
|
24
|
-
html: '<tttx-button></tttx-button>',
|
|
25
|
-
});
|
|
26
|
-
expect(page.root).toEqualHtml(`
|
|
27
|
-
<tttx-button>
|
|
28
|
-
<mock:shadow-root>
|
|
29
|
-
<button class="button default">
|
|
30
|
-
<div class="button-content">
|
|
31
|
-
<slot></slot>
|
|
32
|
-
</div>
|
|
33
|
-
</button>
|
|
34
|
-
</mock:shadow-root>
|
|
35
|
-
</tttx-button>
|
|
36
|
-
`);
|
|
37
|
-
const callbackFn = jest.fn();
|
|
38
|
-
// add an event listener directly to the tttx-button host and click it
|
|
39
|
-
page.root.addEventListener('click', callbackFn);
|
|
40
|
-
page.root.click();
|
|
41
|
-
expect(callbackFn).toHaveBeenCalled();
|
|
42
|
-
});
|
|
43
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { newE2EPage } from '@stencil/core/testing';
|
|
2
|
-
describe('tttx-icon', () => {
|
|
3
|
-
it('renders', async () => {
|
|
4
|
-
const page = await newE2EPage();
|
|
5
|
-
await page.setContent('<tttx-icon></tttx-icon>');
|
|
6
|
-
const element = await page.find('tttx-icon');
|
|
7
|
-
expect(element).toHaveClass('hydrated');
|
|
8
|
-
});
|
|
9
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { newSpecPage } from '@stencil/core/testing';
|
|
2
|
-
import { TttxIcon } from '../tttx-icon';
|
|
3
|
-
describe('tttx-icon', () => {
|
|
4
|
-
it('renders', async () => {
|
|
5
|
-
const page = await newSpecPage({
|
|
6
|
-
components: [TttxIcon],
|
|
7
|
-
html: '<tttx-icon color="danger" icon="warning"></tttx-icon>',
|
|
8
|
-
});
|
|
9
|
-
expect(page.root).toEqualHtml(`
|
|
10
|
-
<tttx-icon color="danger" icon="warning">
|
|
11
|
-
<mock:shadow-root>
|
|
12
|
-
<span class="material-symbols-rounded danger">warning</span>
|
|
13
|
-
</mock:shadow-root>
|
|
14
|
-
</tttx-icon>`);
|
|
15
|
-
});
|
|
16
|
-
});
|
package/dist/collection/components/atoms/tttx-keyvalue-block/test/tttx-keyvalue-block.spec.js
DELETED
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import { newSpecPage } from '@stencil/core/testing';
|
|
2
|
-
import { TttxKeyvalueBlock } from '../tttx-keyvalue-block';
|
|
3
|
-
describe('tttx-keyvalue-block', () => {
|
|
4
|
-
it('renders multiple key value pairs', async () => {
|
|
5
|
-
const keyValuePair = {
|
|
6
|
-
'Name': 'John Doe',
|
|
7
|
-
'Date of birth': '14 Jan 1981',
|
|
8
|
-
'Start of postcode': 'AB10'
|
|
9
|
-
};
|
|
10
|
-
const page = await newSpecPage({
|
|
11
|
-
components: [TttxKeyvalueBlock],
|
|
12
|
-
html: `<tttx-keyvalue-block keyvalues='${JSON.stringify(keyValuePair)}' />`
|
|
13
|
-
});
|
|
14
|
-
await page.waitForChanges();
|
|
15
|
-
expect(page.root).toEqualHtml(`
|
|
16
|
-
<tttx-keyvalue-block keyvalues='{"Name":"John Doe","Date of birth":"14 Jan 1981","Start of postcode":"AB10"}'>
|
|
17
|
-
<mock:shadow-root>
|
|
18
|
-
<dl>
|
|
19
|
-
<dt>
|
|
20
|
-
Name
|
|
21
|
-
</dt>
|
|
22
|
-
<dd>
|
|
23
|
-
John Doe
|
|
24
|
-
</dd>
|
|
25
|
-
<dt>
|
|
26
|
-
Date of birth
|
|
27
|
-
</dt>
|
|
28
|
-
<dd>
|
|
29
|
-
14 Jan 1981
|
|
30
|
-
</dd>
|
|
31
|
-
<dt>
|
|
32
|
-
Start of postcode
|
|
33
|
-
</dt>
|
|
34
|
-
<dd>
|
|
35
|
-
AB10
|
|
36
|
-
</dd>
|
|
37
|
-
</dl>
|
|
38
|
-
</mock:shadow-root>
|
|
39
|
-
</tttx-keyvalue-block>
|
|
40
|
-
`);
|
|
41
|
-
});
|
|
42
|
-
it('renders an array of key value subtitles', async () => {
|
|
43
|
-
const keyValueArray = [
|
|
44
|
-
{ title: "title", subTitle: "sub", data: "data" },
|
|
45
|
-
{ title: "title2", subTitle: "sub2", data: "data2" }
|
|
46
|
-
];
|
|
47
|
-
const page = await newSpecPage({
|
|
48
|
-
components: [TttxKeyvalueBlock],
|
|
49
|
-
html: `<tttx-keyvalue-block keyvalues='${JSON.stringify(keyValueArray)}' />`
|
|
50
|
-
});
|
|
51
|
-
await page.waitForChanges();
|
|
52
|
-
expect(page.root).toEqualHtml(`
|
|
53
|
-
<tttx-keyvalue-block keyvalues='[{"title":"title","subTitle":"sub","data":"data"},{"title":"title2","subTitle":"sub2","data":"data2"}]'>
|
|
54
|
-
<mock:shadow-root>
|
|
55
|
-
<dl>
|
|
56
|
-
<dt class="mainTitle">
|
|
57
|
-
title
|
|
58
|
-
</dt>
|
|
59
|
-
<dt class="subTitle">
|
|
60
|
-
sub
|
|
61
|
-
</dt>
|
|
62
|
-
<dd>
|
|
63
|
-
data
|
|
64
|
-
</dd>
|
|
65
|
-
<dt class="mainTitle">
|
|
66
|
-
title2
|
|
67
|
-
</dt>
|
|
68
|
-
<dt class="subTitle">
|
|
69
|
-
sub2
|
|
70
|
-
</dt>
|
|
71
|
-
<dd>
|
|
72
|
-
data2
|
|
73
|
-
</dd>
|
|
74
|
-
</dl>
|
|
75
|
-
</mock:shadow-root>
|
|
76
|
-
</tttx-keyvalue-block>
|
|
77
|
-
`);
|
|
78
|
-
});
|
|
79
|
-
it('renders multiple horizontal key value pairs', async () => {
|
|
80
|
-
const keyValuePair = {
|
|
81
|
-
'Name': 'John Doe',
|
|
82
|
-
'Date of birth': '14 Jan 1981',
|
|
83
|
-
'Start of postcode': 'AB10'
|
|
84
|
-
};
|
|
85
|
-
const page = await newSpecPage({
|
|
86
|
-
components: [TttxKeyvalueBlock],
|
|
87
|
-
html: `<tttx-keyvalue-block horizontal="true" keyvalues='${JSON.stringify(keyValuePair)}' />`
|
|
88
|
-
});
|
|
89
|
-
await page.waitForChanges();
|
|
90
|
-
expect(page.root).toEqualHtml(`
|
|
91
|
-
<tttx-keyvalue-block horizontal="true" keyvalues='{"Name":"John Doe","Date of birth":"14 Jan 1981","Start of postcode":"AB10"}'>
|
|
92
|
-
<mock:shadow-root>
|
|
93
|
-
<dl class="horizontal">
|
|
94
|
-
<div>
|
|
95
|
-
<dt>
|
|
96
|
-
Name
|
|
97
|
-
</dt>
|
|
98
|
-
<dd>
|
|
99
|
-
John Doe
|
|
100
|
-
</dd>
|
|
101
|
-
</div>
|
|
102
|
-
<div>
|
|
103
|
-
<dt>
|
|
104
|
-
Date of birth
|
|
105
|
-
</dt>
|
|
106
|
-
<dd>
|
|
107
|
-
14 Jan 1981
|
|
108
|
-
</dd>
|
|
109
|
-
</div>
|
|
110
|
-
<div>
|
|
111
|
-
<dt>
|
|
112
|
-
Start of postcode
|
|
113
|
-
</dt>
|
|
114
|
-
<dd>
|
|
115
|
-
AB10
|
|
116
|
-
</dd>
|
|
117
|
-
</div>
|
|
118
|
-
</dl>
|
|
119
|
-
</mock:shadow-root>
|
|
120
|
-
</tttx-keyvalue-block>
|
|
121
|
-
`);
|
|
122
|
-
});
|
|
123
|
-
it('renders an array of horizontal key value subtitles', async () => {
|
|
124
|
-
const keyValueArray = [
|
|
125
|
-
{ title: "title", subTitle: "sub", data: "data" },
|
|
126
|
-
{ title: "title2", subTitle: "sub2", data: "data2" }
|
|
127
|
-
];
|
|
128
|
-
const page = await newSpecPage({
|
|
129
|
-
components: [TttxKeyvalueBlock],
|
|
130
|
-
html: `<tttx-keyvalue-block horizontal="true" keyvalues='${JSON.stringify(keyValueArray)}' />`
|
|
131
|
-
});
|
|
132
|
-
await page.waitForChanges();
|
|
133
|
-
expect(page.root).toEqualHtml(`
|
|
134
|
-
<tttx-keyvalue-block horizontal="true" keyvalues='[{"title":"title","subTitle":"sub","data":"data"},{"title":"title2","subTitle":"sub2","data":"data2"}]'>
|
|
135
|
-
<mock:shadow-root>
|
|
136
|
-
<dl class="horizontal">
|
|
137
|
-
<div>
|
|
138
|
-
<dt class="mainTitle">
|
|
139
|
-
title
|
|
140
|
-
</dt>
|
|
141
|
-
<dt class="subTitle">
|
|
142
|
-
sub
|
|
143
|
-
</dt>
|
|
144
|
-
<dd>
|
|
145
|
-
data
|
|
146
|
-
</dd>
|
|
147
|
-
</div>
|
|
148
|
-
<div>
|
|
149
|
-
<dt class="mainTitle">
|
|
150
|
-
title2
|
|
151
|
-
</dt>
|
|
152
|
-
<dt class="subTitle">
|
|
153
|
-
sub2
|
|
154
|
-
</dt>
|
|
155
|
-
<dd>
|
|
156
|
-
data2
|
|
157
|
-
</dd>
|
|
158
|
-
</div>
|
|
159
|
-
</dl>
|
|
160
|
-
</mock:shadow-root>
|
|
161
|
-
</tttx-keyvalue-block>
|
|
162
|
-
`);
|
|
163
|
-
});
|
|
164
|
-
});
|
package/dist/collection/components/atoms/tttx-loading-spinner/Test/tttx-loading-spinner.spec.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { newSpecPage } from '@stencil/core/testing';
|
|
2
|
-
import { TttxLoadingSpinner } from '../tttx-loading-spinner';
|
|
3
|
-
describe('tttx-loading-spinner', () => {
|
|
4
|
-
it('renders the loading text when the loading message prop is set to true', async () => {
|
|
5
|
-
const page = await newSpecPage({
|
|
6
|
-
components: [TttxLoadingSpinner],
|
|
7
|
-
html: '<tttx-loading-spinner></tttx-loading-spinner>',
|
|
8
|
-
});
|
|
9
|
-
page.rootInstance.loadingMessage = true;
|
|
10
|
-
await page.waitForChanges();
|
|
11
|
-
expect(page.root).toEqualHtml(`
|
|
12
|
-
<tttx-loading-spinner>
|
|
13
|
-
<mock:shadow-root>
|
|
14
|
-
<div class='spinner-container'><div class="loading-box"><span class='spinner large'></span></div><div class='loading-text'>Loading, please wait...</div></div>
|
|
15
|
-
</mock:shadow-root>
|
|
16
|
-
</tttx-loading-spinner>
|
|
17
|
-
`);
|
|
18
|
-
});
|
|
19
|
-
it('renders without the loading text when the loading message prop is set to false', async () => {
|
|
20
|
-
const page = await newSpecPage({
|
|
21
|
-
components: [TttxLoadingSpinner],
|
|
22
|
-
html: '<tttx-loading-spinner></tttx-loading-spinner>',
|
|
23
|
-
});
|
|
24
|
-
page.rootInstance.loadingMessage = false;
|
|
25
|
-
await page.waitForChanges();
|
|
26
|
-
expect(page.root).toEqualHtml(`
|
|
27
|
-
<tttx-loading-spinner>
|
|
28
|
-
<mock:shadow-root>
|
|
29
|
-
<div class='spinner-container'><div class="loading-box"><span class='spinner large'></span></div></div>
|
|
30
|
-
</mock:shadow-root>
|
|
31
|
-
</tttx-loading-spinner>
|
|
32
|
-
`);
|
|
33
|
-
});
|
|
34
|
-
it('renders the small spinner when the size prop is set to small', async () => {
|
|
35
|
-
const page = await newSpecPage({
|
|
36
|
-
components: [TttxLoadingSpinner],
|
|
37
|
-
html: '<tttx-loading-spinner></tttx-loading-spinner>',
|
|
38
|
-
});
|
|
39
|
-
page.rootInstance.size = 'small';
|
|
40
|
-
await page.waitForChanges();
|
|
41
|
-
expect(page.root).toEqualHtml(`
|
|
42
|
-
<tttx-loading-spinner>
|
|
43
|
-
<mock:shadow-root>
|
|
44
|
-
<div class='spinner-container'><div class="loading-box"><span class='spinner small'></span></div></div>
|
|
45
|
-
</mock:shadow-root>
|
|
46
|
-
</tttx-loading-spinner>
|
|
47
|
-
`);
|
|
48
|
-
});
|
|
49
|
-
it('renders the large spinner when the size prop is set to large', async () => {
|
|
50
|
-
const page = await newSpecPage({
|
|
51
|
-
components: [TttxLoadingSpinner],
|
|
52
|
-
html: '<tttx-loading-spinner></tttx-loading-spinner>',
|
|
53
|
-
});
|
|
54
|
-
page.rootInstance.size = 'large';
|
|
55
|
-
await page.waitForChanges();
|
|
56
|
-
expect(page.root).toEqualHtml(`
|
|
57
|
-
<tttx-loading-spinner>
|
|
58
|
-
<mock:shadow-root>
|
|
59
|
-
<div class='spinner-container'><div class="loading-box"><span class='spinner large'></span></div></div>
|
|
60
|
-
</mock:shadow-root>
|
|
61
|
-
</tttx-loading-spinner>
|
|
62
|
-
`);
|
|
63
|
-
});
|
|
64
|
-
});
|