@3t-transform/threeteeui 0.0.16 → 0.0.18
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-864b7110.js → index-bf777121.js} +3 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/tttx-button.cjs.entry.js +25 -19
- package/dist/cjs/tttx-checkbox.cjs.entry.js +18 -18
- package/dist/cjs/tttx-form.cjs.entry.js +365 -365
- package/dist/cjs/tttx-icon.cjs.entry.js +14 -1856
- package/dist/cjs/tttx-input-calendar.cjs.entry.js +125 -0
- package/dist/cjs/tttx-keyvalue-block.cjs.entry.js +33 -0
- package/dist/cjs/tttx-list.cjs.entry.js +188 -188
- package/dist/cjs/tttx-loading-spinner.cjs.entry.js +16 -16
- package/dist/cjs/tttx-popover-content.cjs.entry.js +13 -13
- package/dist/cjs/tttx-standalone-input.cjs.entry.js +127 -127
- package/dist/cjs/tttx-table.cjs.entry.js +50 -50
- package/dist/cjs/tttx.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/atoms/tttx-button/tttx-button.css +94 -18
- package/dist/collection/components/atoms/tttx-button/tttx-button.js +110 -93
- package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +74 -27
- package/dist/collection/components/atoms/tttx-icon/tttx-icon.css +8 -5
- package/dist/collection/components/atoms/tttx-icon/tttx-icon.js +62 -116
- package/dist/collection/components/atoms/tttx-icon/tttx-icon.stories.js +22 -47
- package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.css +26 -0
- package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.js +56 -0
- package/dist/collection/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.js +12 -0
- package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.js +67 -66
- package/dist/collection/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.js +17 -17
- package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.js +97 -96
- package/dist/collection/components/atoms/tttx-popover-content/tttx-popover-content.stories.js +23 -23
- package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.js +102 -101
- package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.stories.js +9 -9
- package/dist/collection/components/molecules/tttx-form/tttx-form.css +95 -11
- package/dist/collection/components/molecules/tttx-form/tttx-form.js +452 -451
- package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +109 -109
- package/dist/collection/components/molecules/tttx-input-calendar/tttx-input-calendar.css +93 -0
- package/dist/collection/components/molecules/tttx-input-calendar/tttx-input-calendar.js +174 -0
- package/dist/collection/components/molecules/tttx-input-calendar/tttx-input-calendar.stories.js +27 -0
- package/dist/collection/components/molecules/tttx-list/tttx-list.js +312 -311
- package/dist/collection/components/molecules/tttx-list/tttx-list.stories.js +14 -14
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.js +570 -569
- package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js +134 -134
- package/dist/collection/components/molecules/tttx-table/tttx-table.js +174 -177
- package/dist/collection/components/molecules/tttx-table/tttx-table.stories.js +65 -65
- package/dist/collection/components/palette.stories.js +7 -7
- package/dist/collection/docs/gettingstarted-developer.stories.js +5 -5
- package/dist/collection/icons.js +2838 -2838
- package/dist/collection/index.js +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/tttx-button.js +1 -40
- package/dist/components/tttx-button2.js +56 -0
- package/dist/components/tttx-checkbox.js +36 -36
- package/dist/components/tttx-form.js +382 -382
- package/dist/components/tttx-icon2.js +32 -1874
- package/dist/components/tttx-input-calendar.d.ts +11 -0
- package/dist/components/tttx-input-calendar.js +157 -0
- package/dist/components/tttx-keyvalue-block.d.ts +11 -0
- package/dist/components/tttx-keyvalue-block.js +49 -0
- package/dist/components/tttx-list.js +214 -214
- package/dist/components/tttx-loading-spinner2.js +33 -33
- package/dist/components/tttx-popover-content2.js +32 -32
- package/dist/components/tttx-standalone-input.js +168 -169
- package/dist/components/tttx-table.js +79 -79
- package/dist/esm/{index-232e347b.js → index-a05bd606.js} +3 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/esm/tttx-button.entry.js +25 -19
- package/dist/esm/tttx-checkbox.entry.js +18 -18
- package/dist/esm/tttx-form.entry.js +365 -365
- package/dist/esm/tttx-icon.entry.js +14 -1856
- package/dist/esm/tttx-input-calendar.entry.js +121 -0
- package/dist/esm/tttx-keyvalue-block.entry.js +29 -0
- package/dist/esm/tttx-list.entry.js +188 -188
- package/dist/esm/tttx-loading-spinner.entry.js +16 -16
- package/dist/esm/tttx-popover-content.entry.js +13 -13
- package/dist/esm/tttx-standalone-input.entry.js +127 -127
- package/dist/esm/tttx-table.entry.js +50 -50
- package/dist/esm/tttx.js +3 -3
- package/dist/tttx/{p-3973b7dd.entry.js → p-037d286f.entry.js} +1 -1
- package/dist/tttx/{p-184c4fae.js → p-07b134af.js} +1 -1
- package/dist/tttx/{p-125f06b3.entry.js → p-1b63f16a.entry.js} +1 -1
- package/dist/tttx/p-45afb84c.entry.js +1 -0
- package/dist/tttx/p-68ff0f39.entry.js +1 -0
- package/dist/tttx/{p-6828fe6f.entry.js → p-93763d3c.entry.js} +1 -1
- package/dist/tttx/p-a5808741.entry.js +1 -0
- package/dist/tttx/{p-fe4c70b2.entry.js → p-a92ca87e.entry.js} +1 -1
- package/dist/tttx/{p-5ce1ba22.entry.js → p-a96ca037.entry.js} +1 -1
- package/dist/tttx/p-dc087fd8.entry.js +1 -0
- package/dist/tttx/p-e3cc75bb.entry.js +1 -0
- package/dist/tttx/{p-01e1894e.entry.js → p-f579ed1e.entry.js} +1 -1
- package/dist/tttx/tttx.esm.js +1 -1
- package/dist/types/components/atoms/tttx-button/tttx-button.d.ts +10 -9
- package/dist/types/components/atoms/tttx-button/tttx-button.stories.d.ts +10 -20
- package/dist/types/components/atoms/tttx-icon/tttx-icon.d.ts +5 -14
- package/dist/types/components/atoms/tttx-icon/tttx-icon.stories.d.ts +20 -21
- package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.d.ts +4 -0
- package/dist/types/components/atoms/tttx-keyvalue-block/tttx-keyvalue-block.stories.d.ts +6 -0
- package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.d.ts +6 -6
- package/dist/types/components/atoms/tttx-loading-spinner/tttx-loading-spinner.stories.d.ts +17 -17
- package/dist/types/components/atoms/tttx-popover-content/tttx-popover-content.d.ts +7 -7
- package/dist/types/components/atoms/tttx-popover-content/tttx-popover-content.stories.d.ts +18 -18
- package/dist/types/components/atoms/ttx-checkbox/tttx-checkbox.d.ts +9 -9
- package/dist/types/components/atoms/ttx-checkbox/tttx-checkbox.stories.d.ts +6 -6
- package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +134 -134
- package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +12 -12
- package/dist/types/components/molecules/tttx-input-calendar/tttx-input-calendar.d.ts +19 -0
- package/dist/types/components/molecules/tttx-input-calendar/tttx-input-calendar.stories.d.ts +26 -0
- package/dist/types/components/molecules/tttx-list/tttx-list.d.ts +51 -51
- package/dist/types/components/molecules/tttx-list/tttx-list.stories.d.ts +13 -13
- package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.d.ts +38 -38
- package/dist/types/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.d.ts +106 -106
- package/dist/types/components/molecules/tttx-table/tttx-table.d.ts +15 -15
- package/dist/types/components/molecules/tttx-table/tttx-table.stories.d.ts +21 -21
- package/dist/types/components/palette.stories.d.ts +6 -6
- package/dist/types/components.d.ts +46 -15
- package/dist/types/docs/gettingstarted-developer.stories.d.ts +5 -5
- package/dist/types/icons.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/package.json +4 -4
- package/dist/tttx/p-10316ff1.entry.js +0 -1
- package/dist/tttx/p-b1c22f5f.entry.js +0 -1
- package/dist/tttx/p-c7f9be65.entry.js +0 -1
package/dist/collection/components/molecules/tttx-standalone-input/tttx-standalone-input.stories.js
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import icons from '../../../icons';
|
|
2
|
-
export default {
|
|
3
|
-
title: 'Molecules/Standalone Input',
|
|
4
|
-
component: 'tttx-standalone-input',
|
|
5
|
-
argTypes: {
|
|
6
|
-
iconleft: {
|
|
7
|
-
options: icons,
|
|
8
|
-
control: { type: 'select' },
|
|
9
|
-
},
|
|
10
|
-
iconright: {
|
|
11
|
-
options: icons,
|
|
12
|
-
control: { type: 'select' },
|
|
13
|
-
},
|
|
14
|
-
label: {
|
|
15
|
-
control: { type: 'text' },
|
|
16
|
-
},
|
|
17
|
-
errormsg: {
|
|
18
|
-
control: { type: 'text' },
|
|
19
|
-
},
|
|
20
|
-
showerrormsg: {
|
|
21
|
-
control: { type: 'boolean' },
|
|
22
|
-
},
|
|
23
|
-
checked: {
|
|
24
|
-
control: { type: 'boolean' },
|
|
25
|
-
},
|
|
26
|
-
disabled: {
|
|
27
|
-
control: { type: 'boolean' },
|
|
28
|
-
},
|
|
29
|
-
max: {
|
|
30
|
-
control: { type: 'text' },
|
|
31
|
-
},
|
|
32
|
-
maxlength: {
|
|
33
|
-
control: { type: 'text' },
|
|
34
|
-
},
|
|
35
|
-
min: {
|
|
36
|
-
control: { type: 'text' },
|
|
37
|
-
},
|
|
38
|
-
minlength: {
|
|
39
|
-
control: { type: 'text' },
|
|
40
|
-
},
|
|
41
|
-
name: {
|
|
42
|
-
control: { type: 'text' },
|
|
43
|
-
},
|
|
44
|
-
pattern: {
|
|
45
|
-
control: { type: 'text' },
|
|
46
|
-
},
|
|
47
|
-
placeholder: {
|
|
48
|
-
control: { type: 'text' },
|
|
49
|
-
},
|
|
50
|
-
readonly: {
|
|
51
|
-
control: { type: 'boolean' },
|
|
52
|
-
},
|
|
53
|
-
required: {
|
|
54
|
-
control: { type: 'boolean' },
|
|
55
|
-
},
|
|
56
|
-
step: {
|
|
57
|
-
control: { type: 'text' },
|
|
58
|
-
},
|
|
59
|
-
type: {
|
|
60
|
-
options: ['text', 'password', 'email', 'number'],
|
|
61
|
-
control: { type: 'radio' },
|
|
62
|
-
},
|
|
63
|
-
value: {
|
|
64
|
-
control: { type: 'text' },
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
};
|
|
1
|
+
import icons from '../../../icons';
|
|
2
|
+
export default {
|
|
3
|
+
title: 'Molecules/Standalone Input',
|
|
4
|
+
component: 'tttx-standalone-input',
|
|
5
|
+
argTypes: {
|
|
6
|
+
iconleft: {
|
|
7
|
+
options: icons,
|
|
8
|
+
control: { type: 'select' },
|
|
9
|
+
},
|
|
10
|
+
iconright: {
|
|
11
|
+
options: icons,
|
|
12
|
+
control: { type: 'select' },
|
|
13
|
+
},
|
|
14
|
+
label: {
|
|
15
|
+
control: { type: 'text' },
|
|
16
|
+
},
|
|
17
|
+
errormsg: {
|
|
18
|
+
control: { type: 'text' },
|
|
19
|
+
},
|
|
20
|
+
showerrormsg: {
|
|
21
|
+
control: { type: 'boolean' },
|
|
22
|
+
},
|
|
23
|
+
checked: {
|
|
24
|
+
control: { type: 'boolean' },
|
|
25
|
+
},
|
|
26
|
+
disabled: {
|
|
27
|
+
control: { type: 'boolean' },
|
|
28
|
+
},
|
|
29
|
+
max: {
|
|
30
|
+
control: { type: 'text' },
|
|
31
|
+
},
|
|
32
|
+
maxlength: {
|
|
33
|
+
control: { type: 'text' },
|
|
34
|
+
},
|
|
35
|
+
min: {
|
|
36
|
+
control: { type: 'text' },
|
|
37
|
+
},
|
|
38
|
+
minlength: {
|
|
39
|
+
control: { type: 'text' },
|
|
40
|
+
},
|
|
41
|
+
name: {
|
|
42
|
+
control: { type: 'text' },
|
|
43
|
+
},
|
|
44
|
+
pattern: {
|
|
45
|
+
control: { type: 'text' },
|
|
46
|
+
},
|
|
47
|
+
placeholder: {
|
|
48
|
+
control: { type: 'text' },
|
|
49
|
+
},
|
|
50
|
+
readonly: {
|
|
51
|
+
control: { type: 'boolean' },
|
|
52
|
+
},
|
|
53
|
+
required: {
|
|
54
|
+
control: { type: 'boolean' },
|
|
55
|
+
},
|
|
56
|
+
step: {
|
|
57
|
+
control: { type: 'text' },
|
|
58
|
+
},
|
|
59
|
+
type: {
|
|
60
|
+
options: ['text', 'password', 'email', 'number'],
|
|
61
|
+
control: { type: 'radio' },
|
|
62
|
+
},
|
|
63
|
+
value: {
|
|
64
|
+
control: { type: 'text' },
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
68
|
const TemplateTextInput = ({ iconleft, iconright, label, errormsg, showerrormsg, checked, disabled, max, maxlength, min, minlength, name, pattern, placeholder, readonly, required, step, type, value, }) => `
|
|
69
69
|
<tttx-standalone-input
|
|
70
70
|
iconleft="${iconleft || ''}"
|
|
@@ -87,70 +87,70 @@ const TemplateTextInput = ({ iconleft, iconright, label, errormsg, showerrormsg,
|
|
|
87
87
|
type="${type}"
|
|
88
88
|
value="${value}"
|
|
89
89
|
/>
|
|
90
|
-
`;
|
|
91
|
-
export const InputField = TemplateTextInput.bind({});
|
|
92
|
-
InputField.args = {
|
|
93
|
-
value: '',
|
|
94
|
-
label: 'First name',
|
|
95
|
-
type: 'text',
|
|
96
|
-
errormsg: 'Please enter your first name',
|
|
97
|
-
required: false,
|
|
98
|
-
showerrormsg: false,
|
|
99
|
-
placeholder: 'Enter first name',
|
|
100
|
-
};
|
|
101
|
-
// export const TextInputIconLeft = TemplateTextInput.bind({});
|
|
102
|
-
// TextInputIconLeft.args = {
|
|
103
|
-
// value: 'Uh egg',
|
|
104
|
-
// label: 'Please tell me about your egg',
|
|
105
|
-
// iconleft: 'egg',
|
|
106
|
-
// type: 'text',
|
|
107
|
-
// errormsg: 'Incorrect egg, please egg again.',
|
|
108
|
-
// required: true,
|
|
109
|
-
// showerrormsg: true,
|
|
110
|
-
// placeholder: 'Please for the love of god tell me about your egg',
|
|
111
|
-
// };
|
|
112
|
-
// export const TextInputIconRight = TemplateTextInput.bind({});
|
|
113
|
-
// TextInputIconRight.args = {
|
|
114
|
-
// value: 'Uh egg',
|
|
115
|
-
// label: 'Please tell me about your egg',
|
|
116
|
-
// iconright: 'egg',
|
|
117
|
-
// type: 'text',
|
|
118
|
-
// errormsg: 'Incorrect egg, please egg again.',
|
|
119
|
-
// required: true,
|
|
120
|
-
// showerrormsg: true,
|
|
121
|
-
// placeholder: 'Please for the love of god tell me about your egg',
|
|
122
|
-
// };
|
|
123
|
-
// export const PasswordInputBasic = TemplateTextInput.bind({});
|
|
124
|
-
// PasswordInputBasic.args = {
|
|
125
|
-
// value: 'qwefdweferg',
|
|
126
|
-
// label: 'Input your Password',
|
|
127
|
-
// iconleft: 'lock',
|
|
128
|
-
// type: 'password',
|
|
129
|
-
// errormsg: 'Password is not strong enough',
|
|
130
|
-
// required: true,
|
|
131
|
-
// showerrormsg: true,
|
|
132
|
-
// placeholder: 'Your password',
|
|
133
|
-
// };
|
|
134
|
-
// export const EmailInputBasic = TemplateTextInput.bind({});
|
|
135
|
-
// EmailInputBasic.args = {
|
|
136
|
-
// value: 'email.address@website.com',
|
|
137
|
-
// label: 'Choose an email address',
|
|
138
|
-
// iconleft: 'mail',
|
|
139
|
-
// type: 'email',
|
|
140
|
-
// errormsg: 'This email smells funny',
|
|
141
|
-
// required: true,
|
|
142
|
-
// valid: false,
|
|
143
|
-
// showerrormsg: true,
|
|
144
|
-
// placeholder: 'Your email address',
|
|
145
|
-
// };
|
|
146
|
-
// export const NumberInputBasic = TemplateTextInput.bind({});
|
|
147
|
-
// NumberInputBasic.args = {
|
|
148
|
-
// value: '42069',
|
|
149
|
-
// label: 'What is your favourite number?',
|
|
150
|
-
// iconleft: '123',
|
|
151
|
-
// type: 'number',
|
|
152
|
-
// errormsg: 'This number feels wrong',
|
|
153
|
-
// required: true,
|
|
154
|
-
// showerrormsg: true,
|
|
155
|
-
// placeholder: 'Your favourite number',
|
|
156
|
-
// };
|
|
90
|
+
`;
|
|
91
|
+
export const InputField = TemplateTextInput.bind({});
|
|
92
|
+
InputField.args = {
|
|
93
|
+
value: '',
|
|
94
|
+
label: 'First name',
|
|
95
|
+
type: 'text',
|
|
96
|
+
errormsg: 'Please enter your first name',
|
|
97
|
+
required: false,
|
|
98
|
+
showerrormsg: false,
|
|
99
|
+
placeholder: 'Enter first name',
|
|
100
|
+
};
|
|
101
|
+
// export const TextInputIconLeft = TemplateTextInput.bind({});
|
|
102
|
+
// TextInputIconLeft.args = {
|
|
103
|
+
// value: 'Uh egg',
|
|
104
|
+
// label: 'Please tell me about your egg',
|
|
105
|
+
// iconleft: 'egg',
|
|
106
|
+
// type: 'text',
|
|
107
|
+
// errormsg: 'Incorrect egg, please egg again.',
|
|
108
|
+
// required: true,
|
|
109
|
+
// showerrormsg: true,
|
|
110
|
+
// placeholder: 'Please for the love of god tell me about your egg',
|
|
111
|
+
// };
|
|
112
|
+
// export const TextInputIconRight = TemplateTextInput.bind({});
|
|
113
|
+
// TextInputIconRight.args = {
|
|
114
|
+
// value: 'Uh egg',
|
|
115
|
+
// label: 'Please tell me about your egg',
|
|
116
|
+
// iconright: 'egg',
|
|
117
|
+
// type: 'text',
|
|
118
|
+
// errormsg: 'Incorrect egg, please egg again.',
|
|
119
|
+
// required: true,
|
|
120
|
+
// showerrormsg: true,
|
|
121
|
+
// placeholder: 'Please for the love of god tell me about your egg',
|
|
122
|
+
// };
|
|
123
|
+
// export const PasswordInputBasic = TemplateTextInput.bind({});
|
|
124
|
+
// PasswordInputBasic.args = {
|
|
125
|
+
// value: 'qwefdweferg',
|
|
126
|
+
// label: 'Input your Password',
|
|
127
|
+
// iconleft: 'lock',
|
|
128
|
+
// type: 'password',
|
|
129
|
+
// errormsg: 'Password is not strong enough',
|
|
130
|
+
// required: true,
|
|
131
|
+
// showerrormsg: true,
|
|
132
|
+
// placeholder: 'Your password',
|
|
133
|
+
// };
|
|
134
|
+
// export const EmailInputBasic = TemplateTextInput.bind({});
|
|
135
|
+
// EmailInputBasic.args = {
|
|
136
|
+
// value: 'email.address@website.com',
|
|
137
|
+
// label: 'Choose an email address',
|
|
138
|
+
// iconleft: 'mail',
|
|
139
|
+
// type: 'email',
|
|
140
|
+
// errormsg: 'This email smells funny',
|
|
141
|
+
// required: true,
|
|
142
|
+
// valid: false,
|
|
143
|
+
// showerrormsg: true,
|
|
144
|
+
// placeholder: 'Your email address',
|
|
145
|
+
// };
|
|
146
|
+
// export const NumberInputBasic = TemplateTextInput.bind({});
|
|
147
|
+
// NumberInputBasic.args = {
|
|
148
|
+
// value: '42069',
|
|
149
|
+
// label: 'What is your favourite number?',
|
|
150
|
+
// iconleft: '123',
|
|
151
|
+
// type: 'number',
|
|
152
|
+
// errormsg: 'This number feels wrong',
|
|
153
|
+
// required: true,
|
|
154
|
+
// showerrormsg: true,
|
|
155
|
+
// placeholder: 'Your favourite number',
|
|
156
|
+
// };
|
|
@@ -1,177 +1,174 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
this.
|
|
6
|
-
this.
|
|
7
|
-
this.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
this.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
this.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
static get
|
|
49
|
-
static get
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
"
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
"
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
"
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
"
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
"
|
|
138
|
-
"
|
|
139
|
-
"
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
"
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
"
|
|
153
|
-
"
|
|
154
|
-
"
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
"
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
"
|
|
171
|
-
"
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}];
|
|
176
|
-
}
|
|
177
|
-
}
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import { Host, h } from '@stencil/core';
|
|
3
|
+
export class TttxTable {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.headers = [];
|
|
6
|
+
this.data = [];
|
|
7
|
+
this.loading = false;
|
|
8
|
+
this.selected = -1;
|
|
9
|
+
}
|
|
10
|
+
handleKeyDown(ev) {
|
|
11
|
+
if (ev.key === 'ArrowDown' || ev.key === 'ArrowUp') {
|
|
12
|
+
this.updateSelectedIndex(ev.key);
|
|
13
|
+
this.emitRowSelected();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
updateSelectedIndex(key) {
|
|
17
|
+
if (this.selected === -1) {
|
|
18
|
+
this.selected = 0;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
const isArrowDown = key === 'ArrowDown';
|
|
22
|
+
const isArrowUp = key === 'ArrowUp';
|
|
23
|
+
if (isArrowDown && this.selected < this.data.length - 1) {
|
|
24
|
+
this.selected++;
|
|
25
|
+
}
|
|
26
|
+
else if (isArrowUp && this.selected > 0) {
|
|
27
|
+
this.selected--;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
emitRowSelected() {
|
|
32
|
+
this.rowSelected.emit(this.data[this.selected]);
|
|
33
|
+
}
|
|
34
|
+
rowSelectedHandler(row) {
|
|
35
|
+
this.rowSelected.emit(row);
|
|
36
|
+
this.selected = this.data.findIndex((item) => item === row);
|
|
37
|
+
}
|
|
38
|
+
headerClickedHandler(key) {
|
|
39
|
+
this.headerClicked.emit(key);
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
return (h(Host, null, h("table", null, h("thead", null, h("tr", null, this.loading ?
|
|
43
|
+
[1, 2, 3].map(() => (h("th", null, h("div", { class: "skeleton" })))) :
|
|
44
|
+
this.headers && this.headers.map((header) => (h("th", { scope: "col", onClick: () => this.headerClickedHandler(header.key) }, header.label))))), h("tbody", null, this.loading ?
|
|
45
|
+
[1, 2, 3].map(() => (h("tr", null, h("td", null, h("div", { class: "skeleton" })), h("td", null, h("div", { class: "skeleton" })), h("td", null, h("div", { class: "skeleton" }))))) :
|
|
46
|
+
Object.keys(this.data).map((key, index) => (h("tr", { class: index === this.selected ? 'selected' : '', onClick: () => this.rowSelectedHandler(this.data[key]) }, this.headers.map((header) => (h("td", null, this.data[key][header.key], " ", header.actions && h("tttx-icon", { class: "align-right", icon: "more_vert" }, h("div", { slot: "popover" }, 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" })))))))))))));
|
|
47
|
+
}
|
|
48
|
+
static get is() { return "tttx-table"; }
|
|
49
|
+
static get encapsulation() { return "shadow"; }
|
|
50
|
+
static get originalStyleUrls() {
|
|
51
|
+
return {
|
|
52
|
+
"$": ["tttx-table.css"]
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
static get styleUrls() {
|
|
56
|
+
return {
|
|
57
|
+
"$": ["tttx-table.css"]
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
static get properties() {
|
|
61
|
+
return {
|
|
62
|
+
"headers": {
|
|
63
|
+
"type": "unknown",
|
|
64
|
+
"mutable": false,
|
|
65
|
+
"complexType": {
|
|
66
|
+
"original": "any[]",
|
|
67
|
+
"resolved": "any[]",
|
|
68
|
+
"references": {}
|
|
69
|
+
},
|
|
70
|
+
"required": false,
|
|
71
|
+
"optional": false,
|
|
72
|
+
"docs": {
|
|
73
|
+
"tags": [],
|
|
74
|
+
"text": ""
|
|
75
|
+
},
|
|
76
|
+
"defaultValue": "[]"
|
|
77
|
+
},
|
|
78
|
+
"data": {
|
|
79
|
+
"type": "unknown",
|
|
80
|
+
"mutable": false,
|
|
81
|
+
"complexType": {
|
|
82
|
+
"original": "any[]",
|
|
83
|
+
"resolved": "any[]",
|
|
84
|
+
"references": {}
|
|
85
|
+
},
|
|
86
|
+
"required": false,
|
|
87
|
+
"optional": false,
|
|
88
|
+
"docs": {
|
|
89
|
+
"tags": [],
|
|
90
|
+
"text": ""
|
|
91
|
+
},
|
|
92
|
+
"defaultValue": "[]"
|
|
93
|
+
},
|
|
94
|
+
"loading": {
|
|
95
|
+
"type": "boolean",
|
|
96
|
+
"mutable": false,
|
|
97
|
+
"complexType": {
|
|
98
|
+
"original": "boolean",
|
|
99
|
+
"resolved": "boolean",
|
|
100
|
+
"references": {}
|
|
101
|
+
},
|
|
102
|
+
"required": false,
|
|
103
|
+
"optional": false,
|
|
104
|
+
"docs": {
|
|
105
|
+
"tags": [],
|
|
106
|
+
"text": ""
|
|
107
|
+
},
|
|
108
|
+
"attribute": "loading",
|
|
109
|
+
"reflect": false,
|
|
110
|
+
"defaultValue": "false"
|
|
111
|
+
},
|
|
112
|
+
"selected": {
|
|
113
|
+
"type": "number",
|
|
114
|
+
"mutable": false,
|
|
115
|
+
"complexType": {
|
|
116
|
+
"original": "number",
|
|
117
|
+
"resolved": "number",
|
|
118
|
+
"references": {}
|
|
119
|
+
},
|
|
120
|
+
"required": false,
|
|
121
|
+
"optional": false,
|
|
122
|
+
"docs": {
|
|
123
|
+
"tags": [],
|
|
124
|
+
"text": ""
|
|
125
|
+
},
|
|
126
|
+
"attribute": "selected",
|
|
127
|
+
"reflect": false,
|
|
128
|
+
"defaultValue": "-1"
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
static get events() {
|
|
133
|
+
return [{
|
|
134
|
+
"method": "rowSelected",
|
|
135
|
+
"name": "rowSelected",
|
|
136
|
+
"bubbles": true,
|
|
137
|
+
"cancelable": true,
|
|
138
|
+
"composed": true,
|
|
139
|
+
"docs": {
|
|
140
|
+
"tags": [],
|
|
141
|
+
"text": ""
|
|
142
|
+
},
|
|
143
|
+
"complexType": {
|
|
144
|
+
"original": "any",
|
|
145
|
+
"resolved": "any",
|
|
146
|
+
"references": {}
|
|
147
|
+
}
|
|
148
|
+
}, {
|
|
149
|
+
"method": "headerClicked",
|
|
150
|
+
"name": "headerClicked",
|
|
151
|
+
"bubbles": true,
|
|
152
|
+
"cancelable": true,
|
|
153
|
+
"composed": true,
|
|
154
|
+
"docs": {
|
|
155
|
+
"tags": [],
|
|
156
|
+
"text": ""
|
|
157
|
+
},
|
|
158
|
+
"complexType": {
|
|
159
|
+
"original": "any",
|
|
160
|
+
"resolved": "any",
|
|
161
|
+
"references": {}
|
|
162
|
+
}
|
|
163
|
+
}];
|
|
164
|
+
}
|
|
165
|
+
static get listeners() {
|
|
166
|
+
return [{
|
|
167
|
+
"name": "keydown",
|
|
168
|
+
"method": "handleKeyDown",
|
|
169
|
+
"target": "document",
|
|
170
|
+
"capture": false,
|
|
171
|
+
"passive": false
|
|
172
|
+
}];
|
|
173
|
+
}
|
|
174
|
+
}
|