blip-ds 1.198.2 → 1.200.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/blip-ds/bds-avatar-group.entry.js +19 -7
- package/dist/blip-ds/bds-avatar-group.system.entry.js +1 -1
- package/dist/blip-ds/bds-avatar.entry.js +19 -10
- package/dist/blip-ds/bds-avatar.system.entry.js +1 -1
- package/dist/blip-ds/bds-input-editable.entry.js +111 -21
- package/dist/blip-ds/bds-input-editable.system.entry.js +1 -1
- package/dist/blip-ds/bds-radio.entry.js +10 -3
- package/dist/blip-ds/bds-radio.system.entry.js +1 -1
- package/dist/blip-ds/blip-ds.esm.js +1 -1
- package/dist/blip-ds/blip-ds.system.js +1 -1
- package/dist/blip-ds/p-2c2f2e1e.system.entry.js +1 -0
- package/dist/blip-ds/p-36b0af8a.entry.js +1 -0
- package/dist/blip-ds/p-47075e60.system.entry.js +1 -0
- package/dist/blip-ds/p-775e9eba.entry.js +1 -0
- package/dist/blip-ds/p-8532c751.entry.js +1 -0
- package/dist/blip-ds/p-8936d3d8.entry.js +1 -0
- package/dist/blip-ds/p-9e39846b.system.entry.js +1 -0
- package/dist/blip-ds/p-a4ac8b27.system.js +1 -1
- package/dist/blip-ds/p-abc55863.system.entry.js +1 -0
- package/dist/cjs/bds-avatar-group.cjs.entry.js +18 -6
- package/dist/cjs/bds-avatar.cjs.entry.js +18 -9
- package/dist/cjs/bds-input-editable.cjs.entry.js +111 -21
- package/dist/cjs/bds-radio.cjs.entry.js +9 -2
- package/dist/cjs/blip-ds.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/avatar/avatar.css +44 -38
- package/dist/collection/components/avatar/avatar.js +47 -21
- package/dist/collection/components/avatar-group/avatar-group.css +65 -12
- package/dist/collection/components/avatar-group/avatar-group.js +51 -6
- package/dist/collection/components/input-editable/input-editable.css +275 -8
- package/dist/collection/components/input-editable/input-editable.js +218 -21
- package/dist/collection/components/radio/radio.css +65 -13
- package/dist/collection/components/radio/radio.js +17 -7
- package/dist/esm/bds-avatar-group.entry.js +19 -7
- package/dist/esm/bds-avatar.entry.js +19 -10
- package/dist/esm/bds-input-editable.entry.js +111 -21
- package/dist/esm/bds-radio.entry.js +10 -3
- package/dist/esm/blip-ds.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/bds-avatar-group.entry.js +1 -1
- package/dist/esm-es5/bds-avatar.entry.js +1 -1
- package/dist/esm-es5/bds-input-editable.entry.js +1 -1
- package/dist/esm-es5/bds-radio.entry.js +1 -1
- package/dist/esm-es5/blip-ds.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/types/components/avatar/avatar.d.ts +4 -0
- package/dist/types/components/avatar-group/avatar-group.d.ts +5 -0
- package/dist/types/components/input-editable/input-editable.d.ts +62 -13
- package/dist/types/components/radio/radio.d.ts +1 -0
- package/dist/types/components.d.ts +40 -0
- package/package.json +1 -1
- package/dist/blip-ds/p-15332863.system.entry.js +0 -1
- package/dist/blip-ds/p-537ae882.entry.js +0 -1
- package/dist/blip-ds/p-54a2db99.entry.js +0 -1
- package/dist/blip-ds/p-62716567.system.entry.js +0 -1
- package/dist/blip-ds/p-6b559ead.system.entry.js +0 -1
- package/dist/blip-ds/p-77364a3c.entry.js +0 -1
- package/dist/blip-ds/p-b21373d5.entry.js +0 -1
- package/dist/blip-ds/p-de710f3f.system.entry.js +0 -1
|
@@ -16,6 +16,273 @@
|
|
|
16
16
|
/**
|
|
17
17
|
* Define media query values
|
|
18
18
|
*/
|
|
19
|
+
/** Customs */
|
|
20
|
+
/** Animations */
|
|
21
|
+
/** Aligns */
|
|
22
|
+
/** Scoll Bar */
|
|
23
|
+
.element_input {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
position: relative;
|
|
27
|
+
flex: 1;
|
|
28
|
+
width: 100%;
|
|
29
|
+
max-width: 100%;
|
|
30
|
+
max-height: 100%;
|
|
31
|
+
}
|
|
32
|
+
.element_input input {
|
|
33
|
+
box-shadow: inherit;
|
|
34
|
+
}
|
|
35
|
+
.element_input input::placeholder {
|
|
36
|
+
color: #b9cbd3;
|
|
37
|
+
opacity: 1;
|
|
38
|
+
}
|
|
39
|
+
.element_input input::-webkit-input-placeholder {
|
|
40
|
+
color: #b9cbd3;
|
|
41
|
+
opacity: 1;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.input {
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: row;
|
|
47
|
+
align-items: center;
|
|
48
|
+
padding: 8px 4px 9px 12px;
|
|
49
|
+
flex: 1;
|
|
50
|
+
width: 100%;
|
|
51
|
+
max-width: 100%;
|
|
52
|
+
max-height: 100%;
|
|
53
|
+
background: #ffffff;
|
|
54
|
+
}
|
|
55
|
+
.input--state-primary {
|
|
56
|
+
border: 1px solid #d2dfe6;
|
|
57
|
+
box-sizing: border-box;
|
|
58
|
+
border-radius: 8px;
|
|
59
|
+
}
|
|
60
|
+
.input--state-primary:hover {
|
|
61
|
+
border: 1px solid #3f7de8;
|
|
62
|
+
box-sizing: border-box;
|
|
63
|
+
border-radius: 8px;
|
|
64
|
+
}
|
|
65
|
+
.input--state-primary.input--pressed {
|
|
66
|
+
border: 1px solid #3f7de8;
|
|
67
|
+
box-sizing: border-box;
|
|
68
|
+
border-radius: 8px;
|
|
69
|
+
-webkit-box-shadow: 0 0 0 2px rgba(63, 125, 232, 0.4);
|
|
70
|
+
box-shadow: 0 0 0 2px rgba(63, 125, 232, 0.4);
|
|
71
|
+
}
|
|
72
|
+
.input--state-primary .input__icon {
|
|
73
|
+
color: #3f7de8;
|
|
74
|
+
background-color: #e8f2ff;
|
|
75
|
+
}
|
|
76
|
+
.input--state-primary .input__container__label {
|
|
77
|
+
color: #8ca0b3;
|
|
78
|
+
}
|
|
79
|
+
.input--state-primary .input__container__label--pressed {
|
|
80
|
+
color: #3f7de8;
|
|
81
|
+
}
|
|
82
|
+
.input--state-primary .input__container__text {
|
|
83
|
+
caret-color: #3f7de8;
|
|
84
|
+
color: #202c44;
|
|
85
|
+
}
|
|
86
|
+
.input--state-danger {
|
|
87
|
+
border: 1px solid #ff4c4c;
|
|
88
|
+
box-sizing: border-box;
|
|
89
|
+
border-radius: 8px;
|
|
90
|
+
}
|
|
91
|
+
.input--state-danger:hover {
|
|
92
|
+
border: 1px solid #ff4c4c;
|
|
93
|
+
box-sizing: border-box;
|
|
94
|
+
border-radius: 8px;
|
|
95
|
+
}
|
|
96
|
+
.input--state-danger.input--pressed {
|
|
97
|
+
border: 1px solid #ff4c4c;
|
|
98
|
+
box-sizing: border-box;
|
|
99
|
+
border-radius: 8px;
|
|
100
|
+
-webkit-box-shadow: 0 0 0 2px #ffa5a5;
|
|
101
|
+
box-shadow: 0 0 0 2px #ffa5a5;
|
|
102
|
+
}
|
|
103
|
+
.input--state-danger .input__icon {
|
|
104
|
+
color: #ff4c4c;
|
|
105
|
+
background-color: #ffa5a5;
|
|
106
|
+
}
|
|
107
|
+
.input--state-danger .input__container__label {
|
|
108
|
+
color: #8ca0b3;
|
|
109
|
+
}
|
|
110
|
+
.input--state-danger .input__container__label--pressed {
|
|
111
|
+
color: #ff4c4c;
|
|
112
|
+
}
|
|
113
|
+
.input--state-danger .input__container__text {
|
|
114
|
+
caret-color: #ff4c4c;
|
|
115
|
+
color: #202c44;
|
|
116
|
+
}
|
|
117
|
+
.input--state-disabled {
|
|
118
|
+
cursor: not-allowed;
|
|
119
|
+
border: 1px solid #e7edf4;
|
|
120
|
+
box-sizing: border-box;
|
|
121
|
+
border-radius: 8px;
|
|
122
|
+
background: #f3f6fa;
|
|
123
|
+
}
|
|
124
|
+
.input--state-disabled:hover {
|
|
125
|
+
border: 1px solid #b9cbd3;
|
|
126
|
+
box-sizing: border-box;
|
|
127
|
+
border-radius: 8px;
|
|
128
|
+
border: 1px solid #e7edf4;
|
|
129
|
+
box-sizing: border-box;
|
|
130
|
+
border-radius: 8px;
|
|
131
|
+
}
|
|
132
|
+
.input--state-disabled.input--pressed {
|
|
133
|
+
border: 1px solid #b9cbd3;
|
|
134
|
+
box-sizing: border-box;
|
|
135
|
+
border-radius: 8px;
|
|
136
|
+
-webkit-box-shadow: 0 0 0 2px #e7edf4;
|
|
137
|
+
box-shadow: 0 0 0 2px #e7edf4;
|
|
138
|
+
}
|
|
139
|
+
.input--state-disabled .input__icon {
|
|
140
|
+
color: #b9cbd3;
|
|
141
|
+
background-color: #f8fbfb;
|
|
142
|
+
}
|
|
143
|
+
.input--state-disabled .input__container__label {
|
|
144
|
+
color: #b9cbd3;
|
|
145
|
+
}
|
|
146
|
+
.input--state-disabled .input__container__label--pressed {
|
|
147
|
+
color: #b9cbd3;
|
|
148
|
+
}
|
|
149
|
+
.input--state-disabled .input__container__text {
|
|
150
|
+
caret-color: #b9cbd3;
|
|
151
|
+
color: #b9cbd3;
|
|
152
|
+
}
|
|
153
|
+
.input--label {
|
|
154
|
+
padding: 7px 4px 8px 12px;
|
|
155
|
+
}
|
|
156
|
+
.input__icon {
|
|
157
|
+
cursor: inherit;
|
|
158
|
+
display: flex;
|
|
159
|
+
align-items: center;
|
|
160
|
+
justify-content: center;
|
|
161
|
+
border-radius: 8px;
|
|
162
|
+
margin-right: 8px;
|
|
163
|
+
padding: 2.5px;
|
|
164
|
+
}
|
|
165
|
+
.input__icon--large {
|
|
166
|
+
padding: 4px;
|
|
167
|
+
}
|
|
168
|
+
.input__container {
|
|
169
|
+
display: flex;
|
|
170
|
+
flex-direction: column;
|
|
171
|
+
justify-content: center;
|
|
172
|
+
width: 100%;
|
|
173
|
+
}
|
|
174
|
+
.input__container__wrapper {
|
|
175
|
+
display: flex;
|
|
176
|
+
flex-wrap: wrap;
|
|
177
|
+
}
|
|
178
|
+
.input__container__wrapper__chips {
|
|
179
|
+
display: inline;
|
|
180
|
+
max-height: 100px;
|
|
181
|
+
overflow: auto;
|
|
182
|
+
}
|
|
183
|
+
.input__container__wrapper__chips::-webkit-scrollbar {
|
|
184
|
+
width: 16px;
|
|
185
|
+
background-color: transparent;
|
|
186
|
+
}
|
|
187
|
+
.input__container__wrapper__chips::-webkit-scrollbar-thumb {
|
|
188
|
+
border-radius: 10px;
|
|
189
|
+
border: 4px solid transparent;
|
|
190
|
+
border-radius: 10px;
|
|
191
|
+
background-clip: content-box;
|
|
192
|
+
background-color: #b9cbd3;
|
|
193
|
+
}
|
|
194
|
+
.input__container__label {
|
|
195
|
+
display: flex;
|
|
196
|
+
align-items: center;
|
|
197
|
+
}
|
|
198
|
+
.input__container__text {
|
|
199
|
+
display: inline-block;
|
|
200
|
+
margin: 0;
|
|
201
|
+
border: 0;
|
|
202
|
+
padding: 0;
|
|
203
|
+
width: auto;
|
|
204
|
+
vertical-align: middle;
|
|
205
|
+
white-space: normal;
|
|
206
|
+
line-height: inherit;
|
|
207
|
+
background: none;
|
|
208
|
+
/* Browsers have different default form fonts */
|
|
209
|
+
color: inherit;
|
|
210
|
+
font-size: inherit;
|
|
211
|
+
font-family: inherit;
|
|
212
|
+
-webkit-box-sizing: content-box;
|
|
213
|
+
-moz-box-sizing: content-box;
|
|
214
|
+
box-sizing: content-box;
|
|
215
|
+
/* Make webkit render the search input like a normal text field */
|
|
216
|
+
/* Turn off the recent search for webkit. It adds about 15px padding on the left */
|
|
217
|
+
/* Fix IE7 display bug */
|
|
218
|
+
font-family: "Nunito Sans", "Tahoma", "Helvetica", "Arial", sans-serif;
|
|
219
|
+
font-size: 0.875rem;
|
|
220
|
+
line-height: 150%;
|
|
221
|
+
resize: none;
|
|
222
|
+
cursor: inherit;
|
|
223
|
+
}
|
|
224
|
+
.input__container__text:focus {
|
|
225
|
+
outline: 0;
|
|
226
|
+
}
|
|
227
|
+
.input__container__text::-webkit-file-upload-button {
|
|
228
|
+
padding: 0;
|
|
229
|
+
border: 0;
|
|
230
|
+
background: none;
|
|
231
|
+
}
|
|
232
|
+
.input__container__text:focus {
|
|
233
|
+
outline: 0;
|
|
234
|
+
}
|
|
235
|
+
.input__container__text[type=checkbox], .input__container__text[type=radio] {
|
|
236
|
+
width: 13px;
|
|
237
|
+
height: 13px;
|
|
238
|
+
}
|
|
239
|
+
.input__container__text[type=search] {
|
|
240
|
+
-webkit-appearance: textfield;
|
|
241
|
+
-webkit-box-sizing: content-box;
|
|
242
|
+
}
|
|
243
|
+
::-webkit-search-decoration {
|
|
244
|
+
display: none;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.input__container__text[type=reset], .input__container__text[type=button], .input__container__text[type=submit] {
|
|
248
|
+
overflow: visible;
|
|
249
|
+
}
|
|
250
|
+
.input__container__text::-webkit-scrollbar {
|
|
251
|
+
width: 16px;
|
|
252
|
+
background-color: transparent;
|
|
253
|
+
}
|
|
254
|
+
.input__container__text::-webkit-scrollbar-thumb {
|
|
255
|
+
border-radius: 10px;
|
|
256
|
+
border: 4px solid transparent;
|
|
257
|
+
border-radius: 10px;
|
|
258
|
+
background-clip: content-box;
|
|
259
|
+
background-color: #b9cbd3;
|
|
260
|
+
}
|
|
261
|
+
.input__message {
|
|
262
|
+
display: flex;
|
|
263
|
+
align-items: baseline;
|
|
264
|
+
height: 20px;
|
|
265
|
+
margin: 3.7px 2.5px;
|
|
266
|
+
transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
267
|
+
color: #8ca0b3;
|
|
268
|
+
word-break: break-word;
|
|
269
|
+
height: auto;
|
|
270
|
+
min-height: 20px;
|
|
271
|
+
}
|
|
272
|
+
.input__message bds-typo {
|
|
273
|
+
margin-top: 0px;
|
|
274
|
+
align-self: self-start;
|
|
275
|
+
}
|
|
276
|
+
.input__message__icon {
|
|
277
|
+
display: flex;
|
|
278
|
+
padding-right: 4px;
|
|
279
|
+
margin-top: 0px;
|
|
280
|
+
padding-top: 2px;
|
|
281
|
+
}
|
|
282
|
+
.input__message--danger {
|
|
283
|
+
color: #ff4c4c;
|
|
284
|
+
}
|
|
285
|
+
|
|
19
286
|
.input__editable {
|
|
20
287
|
display: block;
|
|
21
288
|
}
|
|
@@ -48,32 +315,32 @@
|
|
|
48
315
|
display: flex;
|
|
49
316
|
align-items: flex-start;
|
|
50
317
|
}
|
|
51
|
-
.input__editable--active
|
|
318
|
+
.input__editable--active .element_input {
|
|
52
319
|
min-width: 120px;
|
|
53
320
|
margin-right: 4px;
|
|
54
321
|
}
|
|
55
|
-
.input__editable--active
|
|
322
|
+
.input__editable--active .element_input.expanded {
|
|
56
323
|
max-width: 100%;
|
|
57
324
|
}
|
|
58
|
-
.input__editable--active
|
|
325
|
+
.input__editable--active .element_input.fixed {
|
|
59
326
|
max-width: 140px;
|
|
60
327
|
}
|
|
61
|
-
.input__editable--active
|
|
328
|
+
.input__editable--active .element_input.short input {
|
|
62
329
|
font-size: 1rem;
|
|
63
330
|
line-height: 0px;
|
|
64
331
|
}
|
|
65
|
-
.input__editable--active
|
|
332
|
+
.input__editable--active .element_input.standard input {
|
|
66
333
|
font-size: 1.5rem;
|
|
67
334
|
line-height: 0px;
|
|
68
335
|
}
|
|
69
|
-
.input__editable--active
|
|
336
|
+
.input__editable--active .element_input.tall input {
|
|
70
337
|
font-size: 2.5rem;
|
|
71
338
|
line-height: 0px;
|
|
72
339
|
}
|
|
73
|
-
.input__editable--active
|
|
340
|
+
.input__editable--active .element_input::part(input-container) {
|
|
74
341
|
padding: 4px 4px 5px 12px;
|
|
75
342
|
}
|
|
76
|
-
.input__editable--active
|
|
343
|
+
.input__editable--active .element_input::part(input__message) {
|
|
77
344
|
min-width: 180px;
|
|
78
345
|
}
|
|
79
346
|
.input__editable--active bds-icon {
|
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
import { Component, Prop, State, Event, Element, h, Host } from '@stencil/core';
|
|
2
2
|
export class InputEditable {
|
|
3
3
|
constructor() {
|
|
4
|
+
/**
|
|
5
|
+
* Conditions the element to say whether it is pressed or not, to add styles.
|
|
6
|
+
*/
|
|
7
|
+
this.isEditing = false;
|
|
8
|
+
/**
|
|
9
|
+
* Used to block the confirm icon.
|
|
10
|
+
*/
|
|
11
|
+
this.isValid = true;
|
|
12
|
+
/**
|
|
13
|
+
* Used to validate it is pressed.
|
|
14
|
+
*/
|
|
15
|
+
this.isPressed = false;
|
|
16
|
+
/**
|
|
17
|
+
* Used to validate it is focused.
|
|
18
|
+
*/
|
|
19
|
+
this.isFocused = false;
|
|
20
|
+
/**
|
|
21
|
+
* Used to set the error message setted by the internal validators
|
|
22
|
+
*/
|
|
23
|
+
this.validationMesage = '';
|
|
24
|
+
/**
|
|
25
|
+
* Used to set the danger behavior by the internal validators
|
|
26
|
+
*/
|
|
27
|
+
this.validationDanger = false;
|
|
4
28
|
/**
|
|
5
29
|
* Set the component size. Can be one of:
|
|
6
30
|
* 'short' | 'standard' | 'tall';
|
|
@@ -14,14 +38,6 @@ export class InputEditable {
|
|
|
14
38
|
* Data test is the prop to specifically test the component action object.
|
|
15
39
|
*/
|
|
16
40
|
this.dataTest = null;
|
|
17
|
-
/**
|
|
18
|
-
* Conditions the element to say whether it is pressed or not, to add styles.
|
|
19
|
-
*/
|
|
20
|
-
this.isEditing = false;
|
|
21
|
-
/**
|
|
22
|
-
* Used to block the confirm icon.
|
|
23
|
-
*/
|
|
24
|
-
this.isValid = true;
|
|
25
41
|
/**
|
|
26
42
|
* Input Name
|
|
27
43
|
*/
|
|
@@ -42,20 +58,14 @@ export class InputEditable {
|
|
|
42
58
|
* Indicated to pass a help to the user in complex filling.
|
|
43
59
|
*/
|
|
44
60
|
this.helperMessage = '';
|
|
61
|
+
/**
|
|
62
|
+
* Placeholder for native input element.
|
|
63
|
+
*/
|
|
64
|
+
this.placeholder = '';
|
|
45
65
|
/**
|
|
46
66
|
* Add state danger on input, use for use feedback. If true avoid save confirmation.
|
|
47
67
|
*/
|
|
48
68
|
this.danger = false;
|
|
49
|
-
this.onInputChange = (event) => {
|
|
50
|
-
if (event.detail) {
|
|
51
|
-
if (event.detail.value.length < Number(this.minlength)) {
|
|
52
|
-
this.isValid = false;
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
this.isValid = true;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
69
|
this.handleEditing = () => {
|
|
60
70
|
this.toggleEditing();
|
|
61
71
|
};
|
|
@@ -63,13 +73,44 @@ export class InputEditable {
|
|
|
63
73
|
this.isEditing = !this.isEditing;
|
|
64
74
|
};
|
|
65
75
|
this.handleSaveText = () => {
|
|
66
|
-
const newValue = this.
|
|
76
|
+
const newValue = this.nativeInput.value;
|
|
67
77
|
if (newValue.length > 0 && newValue.length >= this.minlength && !this.danger) {
|
|
68
78
|
this.bdsInputEditableSave.emit({ value: newValue, oldValue: this.value });
|
|
69
79
|
this.value = newValue;
|
|
70
80
|
this.toggleEditing();
|
|
71
81
|
}
|
|
72
82
|
};
|
|
83
|
+
this.changedInputValue = async (ev) => {
|
|
84
|
+
const input = ev.target;
|
|
85
|
+
this.checkValidity();
|
|
86
|
+
if (input) {
|
|
87
|
+
this.value = input.value || '';
|
|
88
|
+
if (input.value.length < Number(this.minlength)) {
|
|
89
|
+
this.isValid = false;
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
this.isValid = true;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
this.bdsInput.emit(ev);
|
|
96
|
+
this.bdsChange.emit({ value: this.nativeInput.value, oldValue: this.value });
|
|
97
|
+
};
|
|
98
|
+
this.onFocus = () => {
|
|
99
|
+
this.isFocused = true;
|
|
100
|
+
this.isPressed = true;
|
|
101
|
+
this.bdsFocus.emit();
|
|
102
|
+
};
|
|
103
|
+
this.onBlur = () => {
|
|
104
|
+
this.onBlurValidations();
|
|
105
|
+
this.bdsBlur.emit();
|
|
106
|
+
this.isPressed = false;
|
|
107
|
+
};
|
|
108
|
+
this.onClickWrapper = () => {
|
|
109
|
+
this.onFocus();
|
|
110
|
+
if (this.nativeInput) {
|
|
111
|
+
this.nativeInput.focus();
|
|
112
|
+
}
|
|
113
|
+
};
|
|
73
114
|
this.getExpand = () => {
|
|
74
115
|
if (this.expand) {
|
|
75
116
|
return 'expanded';
|
|
@@ -79,6 +120,33 @@ export class InputEditable {
|
|
|
79
120
|
}
|
|
80
121
|
};
|
|
81
122
|
}
|
|
123
|
+
onBlurValidations() {
|
|
124
|
+
this.requiredValidation();
|
|
125
|
+
(this.minlength || this.maxlength) && this.lengthValidation();
|
|
126
|
+
this.checkValidity();
|
|
127
|
+
}
|
|
128
|
+
requiredValidation() {
|
|
129
|
+
if (this.nativeInput.validity.valueMissing) {
|
|
130
|
+
this.validationMesage = this.requiredErrorMessage;
|
|
131
|
+
this.validationDanger = true;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
lengthValidation() {
|
|
135
|
+
if (this.nativeInput.validity.tooShort) {
|
|
136
|
+
this.validationMesage = this.minlengthErrorMessage;
|
|
137
|
+
this.validationDanger = true;
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
if (this.nativeInput.validity.tooLong) {
|
|
141
|
+
this.validationDanger = true;
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
checkValidity() {
|
|
146
|
+
if (this.nativeInput.validity.valid) {
|
|
147
|
+
this.validationDanger = false;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
82
150
|
getFontSizeClass() {
|
|
83
151
|
if (this.size == 'short') {
|
|
84
152
|
return 'fs-16';
|
|
@@ -93,6 +161,20 @@ export class InputEditable {
|
|
|
93
161
|
return 'fs-24';
|
|
94
162
|
}
|
|
95
163
|
}
|
|
164
|
+
renderMessage() {
|
|
165
|
+
const icon = this.danger ? 'error' : 'info';
|
|
166
|
+
let message = this.danger ? this.errorMessage : this.helperMessage;
|
|
167
|
+
if (!message && this.validationDanger)
|
|
168
|
+
message = this.validationMesage;
|
|
169
|
+
const styles = this.danger || this.validationDanger ? 'input__message input__message--danger' : 'input__message';
|
|
170
|
+
if (message) {
|
|
171
|
+
return (h("div", { class: styles, part: "input__message" },
|
|
172
|
+
h("div", { class: "input__message__icon" },
|
|
173
|
+
h("bds-icon", { size: "x-small", name: icon, theme: "solid", color: "inherit" })),
|
|
174
|
+
h("bds-typo", { variant: "fs-12" }, message)));
|
|
175
|
+
}
|
|
176
|
+
return undefined;
|
|
177
|
+
}
|
|
96
178
|
render() {
|
|
97
179
|
const variant = this.getFontSizeClass();
|
|
98
180
|
const inputExpand = this.getExpand();
|
|
@@ -102,7 +184,17 @@ export class InputEditable {
|
|
|
102
184
|
h("bds-typo", { tag: "span", part: "input__editable--static__typo", class: "input__editable--static__typo", variant: variant }, this.value),
|
|
103
185
|
h("bds-icon", { key: "edit-icon", class: "input__editable--static__icon", name: "edit" })),
|
|
104
186
|
h("div", { class: { 'input__editable--active': true, 'input__editable--hidden': !this.isEditing } },
|
|
105
|
-
h("
|
|
187
|
+
h("div", { class: { element_input: true, [inputExpand]: true, [this.size]: true } },
|
|
188
|
+
h("div", { class: {
|
|
189
|
+
input: true,
|
|
190
|
+
select: true,
|
|
191
|
+
'input--state-primary': !this.danger && !this.validationDanger,
|
|
192
|
+
'input--state-danger': this.danger || this.validationDanger,
|
|
193
|
+
'input--pressed': this.isPressed,
|
|
194
|
+
}, onClick: this.onClickWrapper },
|
|
195
|
+
h("div", { class: "input__container", tabindex: "0" },
|
|
196
|
+
h("input", { class: { input__container__text: true }, ref: (input) => (this.nativeInput = input), minLength: this.minlength, maxLength: this.maxlength, name: this.inputName, onBlur: this.onBlur, onFocus: this.onFocus, onInput: this.changedInputValue, placeholder: this.placeholder, value: this.value, required: true, part: "input", "data-test": this.dataTest }))),
|
|
197
|
+
this.renderMessage()),
|
|
106
198
|
h("div", { class: "input__editable--active__icon" },
|
|
107
199
|
h("bds-icon", { key: "error-icon", class: "input__editable--active__icon--error", theme: "solid", name: "error", onClick: this.handleEditing }),
|
|
108
200
|
h("bds-icon", { key: "checkball-icon", class: {
|
|
@@ -318,6 +410,24 @@ export class InputEditable {
|
|
|
318
410
|
"reflect": false,
|
|
319
411
|
"defaultValue": "''"
|
|
320
412
|
},
|
|
413
|
+
"placeholder": {
|
|
414
|
+
"type": "string",
|
|
415
|
+
"mutable": false,
|
|
416
|
+
"complexType": {
|
|
417
|
+
"original": "string",
|
|
418
|
+
"resolved": "string",
|
|
419
|
+
"references": {}
|
|
420
|
+
},
|
|
421
|
+
"required": false,
|
|
422
|
+
"optional": true,
|
|
423
|
+
"docs": {
|
|
424
|
+
"tags": [],
|
|
425
|
+
"text": "Placeholder for native input element."
|
|
426
|
+
},
|
|
427
|
+
"attribute": "placeholder",
|
|
428
|
+
"reflect": false,
|
|
429
|
+
"defaultValue": "''"
|
|
430
|
+
},
|
|
321
431
|
"danger": {
|
|
322
432
|
"type": "boolean",
|
|
323
433
|
"mutable": true,
|
|
@@ -339,7 +449,11 @@ export class InputEditable {
|
|
|
339
449
|
}; }
|
|
340
450
|
static get states() { return {
|
|
341
451
|
"isEditing": {},
|
|
342
|
-
"isValid": {}
|
|
452
|
+
"isValid": {},
|
|
453
|
+
"isPressed": {},
|
|
454
|
+
"isFocused": {},
|
|
455
|
+
"validationMesage": {},
|
|
456
|
+
"validationDanger": {}
|
|
343
457
|
}; }
|
|
344
458
|
static get events() { return [{
|
|
345
459
|
"method": "bdsInputEditableSave",
|
|
@@ -360,6 +474,89 @@ export class InputEditable {
|
|
|
360
474
|
}
|
|
361
475
|
}
|
|
362
476
|
}
|
|
477
|
+
}, {
|
|
478
|
+
"method": "bdsChange",
|
|
479
|
+
"name": "bdsChange",
|
|
480
|
+
"bubbles": true,
|
|
481
|
+
"cancelable": true,
|
|
482
|
+
"composed": true,
|
|
483
|
+
"docs": {
|
|
484
|
+
"tags": [],
|
|
485
|
+
"text": "Emitted when the value has changed."
|
|
486
|
+
},
|
|
487
|
+
"complexType": {
|
|
488
|
+
"original": "InputEditableEventDetail",
|
|
489
|
+
"resolved": "InputEditableEventDetail",
|
|
490
|
+
"references": {
|
|
491
|
+
"InputEditableEventDetail": {
|
|
492
|
+
"location": "local"
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}, {
|
|
497
|
+
"method": "bdsInput",
|
|
498
|
+
"name": "bdsInput",
|
|
499
|
+
"bubbles": true,
|
|
500
|
+
"cancelable": true,
|
|
501
|
+
"composed": true,
|
|
502
|
+
"docs": {
|
|
503
|
+
"tags": [],
|
|
504
|
+
"text": "Emitted when the input has changed."
|
|
505
|
+
},
|
|
506
|
+
"complexType": {
|
|
507
|
+
"original": "KeyboardEvent",
|
|
508
|
+
"resolved": "KeyboardEvent",
|
|
509
|
+
"references": {
|
|
510
|
+
"KeyboardEvent": {
|
|
511
|
+
"location": "global"
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}, {
|
|
516
|
+
"method": "bdsCancel",
|
|
517
|
+
"name": "bdsCancel",
|
|
518
|
+
"bubbles": true,
|
|
519
|
+
"cancelable": true,
|
|
520
|
+
"composed": true,
|
|
521
|
+
"docs": {
|
|
522
|
+
"tags": [],
|
|
523
|
+
"text": "Emitted when the selection is cancelled."
|
|
524
|
+
},
|
|
525
|
+
"complexType": {
|
|
526
|
+
"original": "void",
|
|
527
|
+
"resolved": "void",
|
|
528
|
+
"references": {}
|
|
529
|
+
}
|
|
530
|
+
}, {
|
|
531
|
+
"method": "bdsFocus",
|
|
532
|
+
"name": "bdsFocus",
|
|
533
|
+
"bubbles": true,
|
|
534
|
+
"cancelable": true,
|
|
535
|
+
"composed": true,
|
|
536
|
+
"docs": {
|
|
537
|
+
"tags": [],
|
|
538
|
+
"text": "Emitted when the select loses focus."
|
|
539
|
+
},
|
|
540
|
+
"complexType": {
|
|
541
|
+
"original": "void",
|
|
542
|
+
"resolved": "void",
|
|
543
|
+
"references": {}
|
|
544
|
+
}
|
|
545
|
+
}, {
|
|
546
|
+
"method": "bdsBlur",
|
|
547
|
+
"name": "bdsBlur",
|
|
548
|
+
"bubbles": true,
|
|
549
|
+
"cancelable": true,
|
|
550
|
+
"composed": true,
|
|
551
|
+
"docs": {
|
|
552
|
+
"tags": [],
|
|
553
|
+
"text": "Emitted when the select loses focus."
|
|
554
|
+
},
|
|
555
|
+
"complexType": {
|
|
556
|
+
"original": "void",
|
|
557
|
+
"resolved": "void",
|
|
558
|
+
"references": {}
|
|
559
|
+
}
|
|
363
560
|
}]; }
|
|
364
561
|
static get elementRef() { return "el"; }
|
|
365
562
|
}
|