@3t-transform/threeteeui 0.0.6 → 0.0.7
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-8a7479e4.js → index-253ca97c.js} +239 -415
- package/dist/cjs/loader.cjs.js +4 -3
- package/dist/cjs/tttx-button.cjs.entry.js +28 -0
- package/dist/cjs/tttx-checkbox.cjs.entry.js +28 -0
- package/dist/cjs/tttx-form.cjs.entry.js +58 -0
- package/dist/cjs/tttx-single-input.cjs.entry.js +44 -0
- package/dist/cjs/tttx-text-box.cjs.entry.js +38 -0
- package/dist/cjs/tttx.cjs.js +7 -3
- package/dist/collection/collection-manifest.json +7 -5
- package/dist/collection/components/atoms/tttx-button/tttx-button.css +61 -0
- package/dist/collection/components/atoms/tttx-button/tttx-button.js +93 -0
- package/dist/collection/components/atoms/tttx-button/tttx-button.stories.js +30 -0
- package/dist/collection/components/atoms/tttx-single-input/tttx-single-input.css +142 -0
- package/dist/collection/components/atoms/tttx-single-input/tttx-single-input.js +259 -0
- package/dist/collection/components/atoms/tttx-single-input/tttx-single-input.stories.js +92 -0
- package/dist/collection/components/atoms/tttx-text-box/tttx-text-box.css +142 -0
- package/dist/collection/components/atoms/tttx-text-box/tttx-text-box.js +150 -0
- package/dist/collection/components/atoms/tttx-text-box/tttx-text-box.stories.js +17 -0
- package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.css +138 -0
- package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.js +101 -0
- package/dist/collection/components/atoms/ttx-checkbox/tttx-checkbox.stories.js +13 -0
- package/dist/collection/components/molecules/tttx-form/tttx-form.js +109 -0
- package/dist/collection/components/molecules/tttx-form/tttx-form.stories.js +37 -0
- package/dist/collection/icons.js +2838 -0
- package/dist/components/index.d.ts +14 -3
- package/dist/components/index.js +6 -4
- package/dist/components/{tttx-page.d.ts → tttx-button.d.ts} +4 -4
- package/dist/components/tttx-button.js +45 -0
- package/dist/components/{tttx-worksheet.d.ts → tttx-checkbox.d.ts} +4 -4
- package/dist/components/tttx-checkbox.js +46 -0
- package/dist/components/{tttx-icon.d.ts → tttx-form.d.ts} +4 -4
- package/dist/components/tttx-form.js +75 -0
- package/dist/components/tttx-single-input.d.ts +11 -0
- package/dist/components/tttx-single-input.js +71 -0
- package/dist/components/tttx-text-box.d.ts +11 -0
- package/dist/components/tttx-text-box.js +59 -0
- package/dist/esm/{index-854ff56f.js → index-fcca6c58.js} +237 -416
- package/dist/esm/loader.js +4 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/tttx-button.entry.js +24 -0
- package/dist/esm/tttx-checkbox.entry.js +24 -0
- package/dist/esm/tttx-form.entry.js +54 -0
- package/dist/esm/tttx-single-input.entry.js +40 -0
- package/dist/esm/tttx-text-box.entry.js +34 -0
- package/dist/esm/tttx.js +4 -3
- package/dist/tttx/p-05d7d002.entry.js +1 -0
- package/dist/tttx/p-40709c59.entry.js +1 -0
- package/dist/tttx/p-64703252.entry.js +1 -0
- package/dist/tttx/p-8d1f2e5c.entry.js +1 -0
- package/dist/tttx/p-9bf836ed.entry.js +1 -0
- package/dist/tttx/p-a7b95fd2.js +2 -0
- package/dist/tttx/tttx.esm.js +1 -1
- package/dist/types/components/atoms/tttx-button/tttx-button.d.ts +9 -0
- package/dist/types/components/atoms/tttx-button/tttx-button.stories.d.ts +20 -0
- package/dist/types/components/atoms/tttx-single-input/tttx-single-input.d.ts +20 -0
- package/dist/types/components/atoms/tttx-single-input/tttx-single-input.stories.d.ts +27 -0
- package/dist/types/components/atoms/tttx-text-box/tttx-text-box.d.ts +14 -0
- package/dist/types/components/atoms/tttx-text-box/tttx-text-box.stories.d.ts +6 -0
- package/dist/types/components/atoms/ttx-checkbox/tttx-checkbox.d.ts +9 -0
- package/dist/types/components/atoms/ttx-checkbox/tttx-checkbox.stories.d.ts +6 -0
- package/dist/types/components/molecules/tttx-form/tttx-form.d.ts +11 -0
- package/dist/types/components/molecules/tttx-form/tttx-form.stories.d.ts +6 -0
- package/dist/types/components.d.ts +128 -51
- package/dist/types/icons.d.ts +2 -0
- package/dist/types/stencil-public-runtime.d.ts +59 -3
- package/loader/index.d.ts +9 -0
- package/package.json +58 -59
- package/readme.md +1 -6
- package/dist/cjs/toolbar-656be6e6.js +0 -34259
- package/dist/cjs/tttx-icon.cjs.entry.js +0 -21
- package/dist/cjs/tttx-page.cjs.entry.js +0 -927
- package/dist/cjs/tttx-worksheet.cjs.entry.js +0 -47
- package/dist/collection/components/components/tttx-icon/tttx-icon.css +0 -89
- package/dist/collection/components/components/tttx-icon/tttx-icon.js +0 -59
- package/dist/collection/components/components/tttx-icon/tttx-icon.stories.js +0 -40
- package/dist/collection/components/patterns/tttx-page/tttx-page.css +0 -162
- package/dist/collection/components/patterns/tttx-page/tttx-page.js +0 -213
- package/dist/collection/components/patterns/tttx-page/tttx-page.stories.js +0 -80
- package/dist/collection/components/patterns/tttx-worksheet/tttx-worksheet.css +0 -134
- package/dist/collection/components/patterns/tttx-worksheet/tttx-worksheet.js +0 -70
- package/dist/collection/components/patterns/tttx-worksheet/tttx-worksheet.stories.js +0 -44
- package/dist/components/tttx-icon.js +0 -37
- package/dist/components/tttx-page.js +0 -953
- package/dist/components/tttx-worksheet.js +0 -6
- package/dist/components/tttx-worksheet2.js +0 -34288
- package/dist/esm/toolbar-cede4385.js +0 -34231
- package/dist/esm/tttx-icon.entry.js +0 -17
- package/dist/esm/tttx-page.entry.js +0 -923
- package/dist/esm/tttx-worksheet.entry.js +0 -43
- package/dist/tttx/p-4b57de2e.entry.js +0 -1
- package/dist/tttx/p-61f78304.entry.js +0 -1
- package/dist/tttx/p-7244abd4.entry.js +0 -1
- package/dist/tttx/p-d038fe18.js +0 -1
- package/dist/tttx/p-ddfeb0ba.js +0 -2
- package/dist/tttx/tttx.css +0 -1
- package/dist/types/components/components/tttx-icon/tttx-icon.d.ts +0 -5
- package/dist/types/components/components/tttx-icon/tttx-icon.stories.d.ts +0 -24
- package/dist/types/components/patterns/tttx-page/tttx-page.d.ts +0 -21
- package/dist/types/components/patterns/tttx-page/tttx-page.stories.d.ts +0 -48
- package/dist/types/components/patterns/tttx-worksheet/tttx-worksheet.d.ts +0 -9
- package/dist/types/components/patterns/tttx-worksheet/tttx-worksheet.stories.d.ts +0 -23
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { Host, h } from '@stencil/core';
|
|
2
|
+
export class TttxSingleInput {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.handleFocus = () => {
|
|
5
|
+
this.isfocused = true;
|
|
6
|
+
};
|
|
7
|
+
this.handleBlur = () => {
|
|
8
|
+
this.isfocused = false;
|
|
9
|
+
};
|
|
10
|
+
this.isfocused = false;
|
|
11
|
+
this.label = undefined;
|
|
12
|
+
this.valid = undefined;
|
|
13
|
+
this.showerrormsg = undefined;
|
|
14
|
+
this.errormsg = undefined;
|
|
15
|
+
this.value = undefined;
|
|
16
|
+
this.type = 'text';
|
|
17
|
+
this.placeholder = undefined;
|
|
18
|
+
this.pattern = undefined;
|
|
19
|
+
this.iconleft = undefined;
|
|
20
|
+
this.iconright = undefined;
|
|
21
|
+
this.required = undefined;
|
|
22
|
+
}
|
|
23
|
+
handleChange(event) {
|
|
24
|
+
const target = event.target;
|
|
25
|
+
this.value = target.value;
|
|
26
|
+
this.valueChanged.emit(target.value);
|
|
27
|
+
}
|
|
28
|
+
render() {
|
|
29
|
+
const inputClass = ['container', this.showerrormsg ? 'errorstate' : '', this.isfocused ? 'focused' : '', this.iconleft ? 'iconleft' : ''].join(' ');
|
|
30
|
+
return (h(Host, null, h("div", { class: "field spacing" }, this.label && h("label", { class: "label" }, this.label, !this.required ? h("span", { class: "optional" }, " (optional)") : ''), h("div", { class: inputClass }, this.iconleft && (h("div", { class: "icon-left" }, h("span", { class: "material-symbols-rounded" }, this.iconleft))), h("input", { class: "input", onFocus: this.handleFocus.bind(this), onBlur: this.handleBlur.bind(this), type: this.type, placeholder: this.placeholder, value: this.value, onInput: event => this.handleChange(event) }), this.iconright && (h("div", { class: "icon-right" }, h("span", { class: "material-symbols-rounded" }, this.iconright)))), this.showerrormsg && this.errormsg && h("div", { class: "errormsg" }, h("span", { class: "material-symbols-rounded validationicon" }, "warning"), " ", this.errormsg))));
|
|
31
|
+
}
|
|
32
|
+
static get is() { return "tttx-single-input"; }
|
|
33
|
+
static get encapsulation() { return "shadow"; }
|
|
34
|
+
static get originalStyleUrls() {
|
|
35
|
+
return {
|
|
36
|
+
"$": ["tttx-single-input.scss"]
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
static get styleUrls() {
|
|
40
|
+
return {
|
|
41
|
+
"$": ["tttx-single-input.css"]
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
static get properties() {
|
|
45
|
+
return {
|
|
46
|
+
"label": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"mutable": false,
|
|
49
|
+
"complexType": {
|
|
50
|
+
"original": "string",
|
|
51
|
+
"resolved": "string",
|
|
52
|
+
"references": {}
|
|
53
|
+
},
|
|
54
|
+
"required": false,
|
|
55
|
+
"optional": false,
|
|
56
|
+
"docs": {
|
|
57
|
+
"tags": [],
|
|
58
|
+
"text": ""
|
|
59
|
+
},
|
|
60
|
+
"attribute": "label",
|
|
61
|
+
"reflect": false
|
|
62
|
+
},
|
|
63
|
+
"valid": {
|
|
64
|
+
"type": "boolean",
|
|
65
|
+
"mutable": false,
|
|
66
|
+
"complexType": {
|
|
67
|
+
"original": "boolean",
|
|
68
|
+
"resolved": "boolean",
|
|
69
|
+
"references": {}
|
|
70
|
+
},
|
|
71
|
+
"required": false,
|
|
72
|
+
"optional": false,
|
|
73
|
+
"docs": {
|
|
74
|
+
"tags": [],
|
|
75
|
+
"text": ""
|
|
76
|
+
},
|
|
77
|
+
"attribute": "valid",
|
|
78
|
+
"reflect": false
|
|
79
|
+
},
|
|
80
|
+
"showerrormsg": {
|
|
81
|
+
"type": "boolean",
|
|
82
|
+
"mutable": false,
|
|
83
|
+
"complexType": {
|
|
84
|
+
"original": "boolean",
|
|
85
|
+
"resolved": "boolean",
|
|
86
|
+
"references": {}
|
|
87
|
+
},
|
|
88
|
+
"required": false,
|
|
89
|
+
"optional": false,
|
|
90
|
+
"docs": {
|
|
91
|
+
"tags": [],
|
|
92
|
+
"text": ""
|
|
93
|
+
},
|
|
94
|
+
"attribute": "showerrormsg",
|
|
95
|
+
"reflect": false
|
|
96
|
+
},
|
|
97
|
+
"errormsg": {
|
|
98
|
+
"type": "string",
|
|
99
|
+
"mutable": false,
|
|
100
|
+
"complexType": {
|
|
101
|
+
"original": "string",
|
|
102
|
+
"resolved": "string",
|
|
103
|
+
"references": {}
|
|
104
|
+
},
|
|
105
|
+
"required": false,
|
|
106
|
+
"optional": false,
|
|
107
|
+
"docs": {
|
|
108
|
+
"tags": [],
|
|
109
|
+
"text": ""
|
|
110
|
+
},
|
|
111
|
+
"attribute": "errormsg",
|
|
112
|
+
"reflect": false
|
|
113
|
+
},
|
|
114
|
+
"value": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"mutable": true,
|
|
117
|
+
"complexType": {
|
|
118
|
+
"original": "string",
|
|
119
|
+
"resolved": "string",
|
|
120
|
+
"references": {}
|
|
121
|
+
},
|
|
122
|
+
"required": false,
|
|
123
|
+
"optional": false,
|
|
124
|
+
"docs": {
|
|
125
|
+
"tags": [],
|
|
126
|
+
"text": ""
|
|
127
|
+
},
|
|
128
|
+
"attribute": "value",
|
|
129
|
+
"reflect": false
|
|
130
|
+
},
|
|
131
|
+
"type": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"mutable": false,
|
|
134
|
+
"complexType": {
|
|
135
|
+
"original": "string",
|
|
136
|
+
"resolved": "string",
|
|
137
|
+
"references": {}
|
|
138
|
+
},
|
|
139
|
+
"required": false,
|
|
140
|
+
"optional": false,
|
|
141
|
+
"docs": {
|
|
142
|
+
"tags": [],
|
|
143
|
+
"text": ""
|
|
144
|
+
},
|
|
145
|
+
"attribute": "type",
|
|
146
|
+
"reflect": false,
|
|
147
|
+
"defaultValue": "'text'"
|
|
148
|
+
},
|
|
149
|
+
"placeholder": {
|
|
150
|
+
"type": "string",
|
|
151
|
+
"mutable": false,
|
|
152
|
+
"complexType": {
|
|
153
|
+
"original": "string",
|
|
154
|
+
"resolved": "string",
|
|
155
|
+
"references": {}
|
|
156
|
+
},
|
|
157
|
+
"required": false,
|
|
158
|
+
"optional": false,
|
|
159
|
+
"docs": {
|
|
160
|
+
"tags": [],
|
|
161
|
+
"text": ""
|
|
162
|
+
},
|
|
163
|
+
"attribute": "placeholder",
|
|
164
|
+
"reflect": false
|
|
165
|
+
},
|
|
166
|
+
"pattern": {
|
|
167
|
+
"type": "string",
|
|
168
|
+
"mutable": false,
|
|
169
|
+
"complexType": {
|
|
170
|
+
"original": "string",
|
|
171
|
+
"resolved": "string",
|
|
172
|
+
"references": {}
|
|
173
|
+
},
|
|
174
|
+
"required": false,
|
|
175
|
+
"optional": false,
|
|
176
|
+
"docs": {
|
|
177
|
+
"tags": [],
|
|
178
|
+
"text": ""
|
|
179
|
+
},
|
|
180
|
+
"attribute": "pattern",
|
|
181
|
+
"reflect": false
|
|
182
|
+
},
|
|
183
|
+
"iconleft": {
|
|
184
|
+
"type": "string",
|
|
185
|
+
"mutable": false,
|
|
186
|
+
"complexType": {
|
|
187
|
+
"original": "string",
|
|
188
|
+
"resolved": "string",
|
|
189
|
+
"references": {}
|
|
190
|
+
},
|
|
191
|
+
"required": false,
|
|
192
|
+
"optional": false,
|
|
193
|
+
"docs": {
|
|
194
|
+
"tags": [],
|
|
195
|
+
"text": ""
|
|
196
|
+
},
|
|
197
|
+
"attribute": "iconleft",
|
|
198
|
+
"reflect": false
|
|
199
|
+
},
|
|
200
|
+
"iconright": {
|
|
201
|
+
"type": "string",
|
|
202
|
+
"mutable": false,
|
|
203
|
+
"complexType": {
|
|
204
|
+
"original": "string",
|
|
205
|
+
"resolved": "string",
|
|
206
|
+
"references": {}
|
|
207
|
+
},
|
|
208
|
+
"required": false,
|
|
209
|
+
"optional": false,
|
|
210
|
+
"docs": {
|
|
211
|
+
"tags": [],
|
|
212
|
+
"text": ""
|
|
213
|
+
},
|
|
214
|
+
"attribute": "iconright",
|
|
215
|
+
"reflect": false
|
|
216
|
+
},
|
|
217
|
+
"required": {
|
|
218
|
+
"type": "boolean",
|
|
219
|
+
"mutable": false,
|
|
220
|
+
"complexType": {
|
|
221
|
+
"original": "boolean",
|
|
222
|
+
"resolved": "boolean",
|
|
223
|
+
"references": {}
|
|
224
|
+
},
|
|
225
|
+
"required": false,
|
|
226
|
+
"optional": false,
|
|
227
|
+
"docs": {
|
|
228
|
+
"tags": [],
|
|
229
|
+
"text": ""
|
|
230
|
+
},
|
|
231
|
+
"attribute": "required",
|
|
232
|
+
"reflect": false
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
static get states() {
|
|
237
|
+
return {
|
|
238
|
+
"isfocused": {}
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
static get events() {
|
|
242
|
+
return [{
|
|
243
|
+
"method": "valueChanged",
|
|
244
|
+
"name": "valueChanged",
|
|
245
|
+
"bubbles": true,
|
|
246
|
+
"cancelable": true,
|
|
247
|
+
"composed": true,
|
|
248
|
+
"docs": {
|
|
249
|
+
"tags": [],
|
|
250
|
+
"text": ""
|
|
251
|
+
},
|
|
252
|
+
"complexType": {
|
|
253
|
+
"original": "string",
|
|
254
|
+
"resolved": "string",
|
|
255
|
+
"references": {}
|
|
256
|
+
}
|
|
257
|
+
}];
|
|
258
|
+
}
|
|
259
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import icons from './../../../icons';
|
|
2
|
+
export default {
|
|
3
|
+
title: 'Atoms/Single Input',
|
|
4
|
+
component: 'tttx-single-input',
|
|
5
|
+
argTypes: {
|
|
6
|
+
iconleft: {
|
|
7
|
+
options: icons,
|
|
8
|
+
control: { type: 'select' },
|
|
9
|
+
},
|
|
10
|
+
iconright: {
|
|
11
|
+
options: icons,
|
|
12
|
+
control: { type: 'select' },
|
|
13
|
+
},
|
|
14
|
+
type: {
|
|
15
|
+
options: ['text', 'password', 'email', 'number'],
|
|
16
|
+
control: { type: 'radio' },
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
const TemplateTest = ({ value, label, iconleft, iconright, type, required, errormsg, placeholder }) => `
|
|
21
|
+
<tttx-single-input
|
|
22
|
+
placeholder="${placeholder}"
|
|
23
|
+
iconleft="${iconleft}"
|
|
24
|
+
iconright="${iconright}"
|
|
25
|
+
value="${value}"
|
|
26
|
+
label="${label}"
|
|
27
|
+
type="${type}"
|
|
28
|
+
errormsg="${errormsg}"
|
|
29
|
+
${required ? `required` : ''}
|
|
30
|
+
></tttx-single-input>
|
|
31
|
+
`;
|
|
32
|
+
export const Default = TemplateTest.bind({});
|
|
33
|
+
Default.args = {
|
|
34
|
+
value: 'Uh egg',
|
|
35
|
+
label: 'Please tell me about your egg',
|
|
36
|
+
icon: 'egg',
|
|
37
|
+
type: 'text',
|
|
38
|
+
errormsg: 'Incorrect egg, please egg again.',
|
|
39
|
+
required: true,
|
|
40
|
+
valid: true,
|
|
41
|
+
placeholder: 'Please for the love of god tell me about your egg',
|
|
42
|
+
};
|
|
43
|
+
const TemplateMultiple = () => `
|
|
44
|
+
|
|
45
|
+
<tttx-single-input
|
|
46
|
+
iconleft="search"
|
|
47
|
+
iconright="clear"
|
|
48
|
+
placeholder="Search for your account"
|
|
49
|
+
label="Account number"
|
|
50
|
+
type="text"
|
|
51
|
+
errormsg="testing123"
|
|
52
|
+
showerrormsg
|
|
53
|
+
></tttx-single-input>
|
|
54
|
+
|
|
55
|
+
<tttx-single-input
|
|
56
|
+
placeholder="Enter first name"
|
|
57
|
+
label="First name"
|
|
58
|
+
type="text"
|
|
59
|
+
errormsg="Your first name is required"
|
|
60
|
+
required
|
|
61
|
+
showerrormsg
|
|
62
|
+
></tttx-single-input>
|
|
63
|
+
|
|
64
|
+
<tttx-single-input
|
|
65
|
+
placeholder="Enter last name"
|
|
66
|
+
label="Last name"
|
|
67
|
+
type="text"
|
|
68
|
+
errormsg="testing123"
|
|
69
|
+
required
|
|
70
|
+
showerrormsg
|
|
71
|
+
></tttx-single-input>
|
|
72
|
+
|
|
73
|
+
<tttx-single-input
|
|
74
|
+
placeholder="Enter date of birth"
|
|
75
|
+
label="Date of birth"
|
|
76
|
+
type="text"
|
|
77
|
+
errormsg="testing123"
|
|
78
|
+
required
|
|
79
|
+
showerrormsg
|
|
80
|
+
></tttx-single-input>
|
|
81
|
+
|
|
82
|
+
<tttx-single-input
|
|
83
|
+
placeholder="Enter email address"
|
|
84
|
+
label="Email address"
|
|
85
|
+
type="email"
|
|
86
|
+
errormsg="testing123"
|
|
87
|
+
required
|
|
88
|
+
showerrormsg
|
|
89
|
+
></tttx-single-input>
|
|
90
|
+
|
|
91
|
+
`;
|
|
92
|
+
export const Example = TemplateMultiple.bind({});
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
.material-symbols-rounded {
|
|
2
|
+
font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.material-symbols-rounded {
|
|
6
|
+
font-family: "Material Symbols Rounded";
|
|
7
|
+
font-weight: 400;
|
|
8
|
+
font-style: normal;
|
|
9
|
+
font-size: 24px;
|
|
10
|
+
line-height: 1;
|
|
11
|
+
letter-spacing: normal;
|
|
12
|
+
text-transform: none;
|
|
13
|
+
display: inline-block;
|
|
14
|
+
white-space: nowrap;
|
|
15
|
+
word-wrap: normal;
|
|
16
|
+
direction: ltr;
|
|
17
|
+
text-rendering: optimizeLegibility;
|
|
18
|
+
-webkit-font-smoothing: antialiased;
|
|
19
|
+
color: #9e9e9e;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.field {
|
|
23
|
+
clear: both;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.container {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-wrap: wrap;
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
height: 36px;
|
|
31
|
+
border: 1px solid #c8c8c8;
|
|
32
|
+
border-radius: 4px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.icon-left,
|
|
36
|
+
.icon-right {
|
|
37
|
+
flex-basis: 24px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.icon-left span,
|
|
41
|
+
.icon-right span {
|
|
42
|
+
font-size: 24px;
|
|
43
|
+
line-height: 24px;
|
|
44
|
+
text-align: center;
|
|
45
|
+
display: block;
|
|
46
|
+
width: 24px;
|
|
47
|
+
height: 24px;
|
|
48
|
+
margin-top: 4px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.icon-left span {
|
|
52
|
+
margin-left: 4px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.icon-right span {
|
|
56
|
+
margin-right: 4px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.input {
|
|
60
|
+
flex-grow: 1;
|
|
61
|
+
border: none;
|
|
62
|
+
outline: none;
|
|
63
|
+
font-size: 16px;
|
|
64
|
+
padding: 8px 16px;
|
|
65
|
+
background-color: transparent;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.iconleft .input {
|
|
69
|
+
padding-left: 4px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.iconright .input {
|
|
73
|
+
padding-right: 4px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.label {
|
|
77
|
+
display: block;
|
|
78
|
+
font-size: 16px;
|
|
79
|
+
height: 18px;
|
|
80
|
+
font-weight: 600;
|
|
81
|
+
color: #212121;
|
|
82
|
+
font-size: 16px;
|
|
83
|
+
margin-bottom: 4px;
|
|
84
|
+
z-index: 1;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.disabled {
|
|
88
|
+
background: #f0f0f0;
|
|
89
|
+
color: #9e9e9e;
|
|
90
|
+
border-color: #c8c8c8;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.focused {
|
|
94
|
+
border-color: #1479c6;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.errormsg {
|
|
98
|
+
height: 16px;
|
|
99
|
+
display: flex;
|
|
100
|
+
justify-content: center;
|
|
101
|
+
align-items: center;
|
|
102
|
+
float: left;
|
|
103
|
+
margin-bottom: 16px;
|
|
104
|
+
box-sizing: border-box;
|
|
105
|
+
background-color: transparent;
|
|
106
|
+
height: 26px;
|
|
107
|
+
font-size: 14px;
|
|
108
|
+
color: white;
|
|
109
|
+
border-radius: none;
|
|
110
|
+
z-index: 2;
|
|
111
|
+
color: #DC0000;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.errormsg .validationicon {
|
|
115
|
+
width: 16px;
|
|
116
|
+
height: 16px;
|
|
117
|
+
font-size: 16px;
|
|
118
|
+
margin-right: 4px;
|
|
119
|
+
vertical-align: middle;
|
|
120
|
+
color: #DC0000;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.danger {
|
|
124
|
+
color: #DC0000;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.optional {
|
|
128
|
+
color: #757575;
|
|
129
|
+
font-weight: normal;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
:host {
|
|
133
|
+
display: block;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.spacing {
|
|
137
|
+
margin-bottom: 16px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.errorstate {
|
|
141
|
+
border-color: #DC0000;
|
|
142
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { h, Host } from '@stencil/core';
|
|
2
|
+
export class TttxTextBox {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.handleFocus = () => {
|
|
5
|
+
this.isfocused = true;
|
|
6
|
+
};
|
|
7
|
+
this.handleBlur = () => {
|
|
8
|
+
this.isfocused = false;
|
|
9
|
+
};
|
|
10
|
+
this.label = undefined;
|
|
11
|
+
this.showerrormsg = undefined;
|
|
12
|
+
this.errormsg = undefined;
|
|
13
|
+
this.required = undefined;
|
|
14
|
+
this.value = undefined;
|
|
15
|
+
this.isfocused = false;
|
|
16
|
+
}
|
|
17
|
+
handleChange(event) {
|
|
18
|
+
const target = event.target;
|
|
19
|
+
this.value = target.value;
|
|
20
|
+
this.valueChanged.emit(target.value);
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
const inputClass = ['container', this.showerrormsg ? 'errorstate' : '', this.isfocused ? 'focused' : ''].join(' ');
|
|
24
|
+
return (h(Host, null, h("div", { class: "field spacing" }, this.label && h("label", { class: "label" }, this.label, !this.required ? h("span", { class: "optional" }, " (optional)") : ''), h("div", { class: inputClass }, h("input", { class: "input", type: "text", value: this.value, required: this.required, onInput: event => this.handleChange(event), onFocus: this.handleFocus.bind(this), onBlur: this.handleBlur.bind(this) })), this.showerrormsg && this.errormsg && h("div", { class: "errormsg" }, this.errormsg))));
|
|
25
|
+
}
|
|
26
|
+
static get is() { return "tttx-text-box"; }
|
|
27
|
+
static get encapsulation() { return "shadow"; }
|
|
28
|
+
static get originalStyleUrls() {
|
|
29
|
+
return {
|
|
30
|
+
"$": ["tttx-text-box.scss"]
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
static get styleUrls() {
|
|
34
|
+
return {
|
|
35
|
+
"$": ["tttx-text-box.css"]
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
static get properties() {
|
|
39
|
+
return {
|
|
40
|
+
"label": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"mutable": false,
|
|
43
|
+
"complexType": {
|
|
44
|
+
"original": "string",
|
|
45
|
+
"resolved": "string",
|
|
46
|
+
"references": {}
|
|
47
|
+
},
|
|
48
|
+
"required": false,
|
|
49
|
+
"optional": false,
|
|
50
|
+
"docs": {
|
|
51
|
+
"tags": [],
|
|
52
|
+
"text": ""
|
|
53
|
+
},
|
|
54
|
+
"attribute": "label",
|
|
55
|
+
"reflect": false
|
|
56
|
+
},
|
|
57
|
+
"showerrormsg": {
|
|
58
|
+
"type": "boolean",
|
|
59
|
+
"mutable": false,
|
|
60
|
+
"complexType": {
|
|
61
|
+
"original": "boolean",
|
|
62
|
+
"resolved": "boolean",
|
|
63
|
+
"references": {}
|
|
64
|
+
},
|
|
65
|
+
"required": false,
|
|
66
|
+
"optional": false,
|
|
67
|
+
"docs": {
|
|
68
|
+
"tags": [],
|
|
69
|
+
"text": ""
|
|
70
|
+
},
|
|
71
|
+
"attribute": "showerrormsg",
|
|
72
|
+
"reflect": false
|
|
73
|
+
},
|
|
74
|
+
"errormsg": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"mutable": false,
|
|
77
|
+
"complexType": {
|
|
78
|
+
"original": "string",
|
|
79
|
+
"resolved": "string",
|
|
80
|
+
"references": {}
|
|
81
|
+
},
|
|
82
|
+
"required": false,
|
|
83
|
+
"optional": false,
|
|
84
|
+
"docs": {
|
|
85
|
+
"tags": [],
|
|
86
|
+
"text": ""
|
|
87
|
+
},
|
|
88
|
+
"attribute": "errormsg",
|
|
89
|
+
"reflect": false
|
|
90
|
+
},
|
|
91
|
+
"required": {
|
|
92
|
+
"type": "boolean",
|
|
93
|
+
"mutable": false,
|
|
94
|
+
"complexType": {
|
|
95
|
+
"original": "boolean",
|
|
96
|
+
"resolved": "boolean",
|
|
97
|
+
"references": {}
|
|
98
|
+
},
|
|
99
|
+
"required": false,
|
|
100
|
+
"optional": false,
|
|
101
|
+
"docs": {
|
|
102
|
+
"tags": [],
|
|
103
|
+
"text": ""
|
|
104
|
+
},
|
|
105
|
+
"attribute": "required",
|
|
106
|
+
"reflect": false
|
|
107
|
+
},
|
|
108
|
+
"value": {
|
|
109
|
+
"type": "string",
|
|
110
|
+
"mutable": true,
|
|
111
|
+
"complexType": {
|
|
112
|
+
"original": "string",
|
|
113
|
+
"resolved": "string",
|
|
114
|
+
"references": {}
|
|
115
|
+
},
|
|
116
|
+
"required": false,
|
|
117
|
+
"optional": false,
|
|
118
|
+
"docs": {
|
|
119
|
+
"tags": [],
|
|
120
|
+
"text": ""
|
|
121
|
+
},
|
|
122
|
+
"attribute": "value",
|
|
123
|
+
"reflect": false
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
static get states() {
|
|
128
|
+
return {
|
|
129
|
+
"isfocused": {}
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
static get events() {
|
|
133
|
+
return [{
|
|
134
|
+
"method": "valueChanged",
|
|
135
|
+
"name": "valueChanged",
|
|
136
|
+
"bubbles": true,
|
|
137
|
+
"cancelable": true,
|
|
138
|
+
"composed": true,
|
|
139
|
+
"docs": {
|
|
140
|
+
"tags": [],
|
|
141
|
+
"text": ""
|
|
142
|
+
},
|
|
143
|
+
"complexType": {
|
|
144
|
+
"original": "string",
|
|
145
|
+
"resolved": "string",
|
|
146
|
+
"references": {}
|
|
147
|
+
}
|
|
148
|
+
}];
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
title: 'Atoms/Text Box',
|
|
3
|
+
component: 'tttx-text-box'
|
|
4
|
+
};
|
|
5
|
+
const TemplateTest = ({ label, errormsg, required }) => `
|
|
6
|
+
<tttx-text-box
|
|
7
|
+
label="${label}"
|
|
8
|
+
errormsg="${errormsg}"
|
|
9
|
+
${required ? `required` : ''}
|
|
10
|
+
></tttx-text-box>
|
|
11
|
+
`;
|
|
12
|
+
export const Default = TemplateTest.bind({});
|
|
13
|
+
Default.args = {
|
|
14
|
+
label: 'Input Label',
|
|
15
|
+
errormsg: 'Field is required',
|
|
16
|
+
required: true
|
|
17
|
+
};
|