@dropi/ui 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/LICENSE +21 -0
- package/dist/cjs/dropi-badge.cjs.entry.js +37 -0
- package/dist/cjs/dropi-button.cjs.entry.js +81 -0
- package/dist/cjs/dropi-checkbox.cjs.entry.js +36 -0
- package/dist/cjs/dropi-icon.cjs.entry.js +50 -0
- package/dist/cjs/dropi-input.cjs.entry.js +210 -0
- package/dist/cjs/dropi-radio-button.cjs.entry.js +47 -0
- package/dist/cjs/dropi-select.cjs.entry.js +335 -0
- package/dist/cjs/dropi-switch.cjs.entry.js +30 -0
- package/dist/cjs/dropi-tag.cjs.entry.js +68 -0
- package/dist/cjs/dropi-text-area.cjs.entry.js +103 -0
- package/dist/cjs/dropi-ui.cjs.js +24 -0
- package/dist/cjs/index-CuGLZVqo.js +1743 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +12 -0
- package/dist/collection/assets/icons/symbol/svg/sprite.css.svg +1 -0
- package/dist/collection/collection-manifest.json +22 -0
- package/dist/collection/components/dropi-badge/dropi-badge.css +41 -0
- package/dist/collection/components/dropi-badge/dropi-badge.js +72 -0
- package/dist/collection/components/dropi-button/dropi-button.css +169 -0
- package/dist/collection/components/dropi-button/dropi-button.js +277 -0
- package/dist/collection/components/dropi-checkbox/dropi-checkbox.css +47 -0
- package/dist/collection/components/dropi-checkbox/dropi-checkbox.js +103 -0
- package/dist/collection/components/dropi-icon/dropi-icon.css +19 -0
- package/dist/collection/components/dropi-icon/dropi-icon.js +142 -0
- package/dist/collection/components/dropi-input/dropi-input.css +168 -0
- package/dist/collection/components/dropi-input/dropi-input.js +735 -0
- package/dist/collection/components/dropi-radio-button/dropi-radio-button.css +59 -0
- package/dist/collection/components/dropi-radio-button/dropi-radio-button.js +181 -0
- package/dist/collection/components/dropi-select/dropi-select.css +364 -0
- package/dist/collection/components/dropi-select/dropi-select.js +932 -0
- package/dist/collection/components/dropi-select/select.types.js +1 -0
- package/dist/collection/components/dropi-switch/dropi-switch.css +57 -0
- package/dist/collection/components/dropi-switch/dropi-switch.js +96 -0
- package/dist/collection/components/dropi-tag/dropi-tag.css +40 -0
- package/dist/collection/components/dropi-tag/dropi-tag.js +190 -0
- package/dist/collection/components/dropi-text-area/dropi-text-area.css +97 -0
- package/dist/collection/components/dropi-text-area/dropi-text-area.js +457 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/utils.js +3 -0
- package/dist/collection/utils/utils.unit.test.js +16 -0
- package/dist/components/dropi-badge.d.ts +11 -0
- package/dist/components/dropi-badge.js +1 -0
- package/dist/components/dropi-button.d.ts +11 -0
- package/dist/components/dropi-button.js +1 -0
- package/dist/components/dropi-checkbox.d.ts +11 -0
- package/dist/components/dropi-checkbox.js +1 -0
- package/dist/components/dropi-icon.d.ts +11 -0
- package/dist/components/dropi-icon.js +1 -0
- package/dist/components/dropi-input.d.ts +11 -0
- package/dist/components/dropi-input.js +1 -0
- package/dist/components/dropi-radio-button.d.ts +11 -0
- package/dist/components/dropi-radio-button.js +1 -0
- package/dist/components/dropi-select.d.ts +11 -0
- package/dist/components/dropi-select.js +1 -0
- package/dist/components/dropi-switch.d.ts +11 -0
- package/dist/components/dropi-switch.js +1 -0
- package/dist/components/dropi-tag.d.ts +11 -0
- package/dist/components/dropi-tag.js +1 -0
- package/dist/components/dropi-text-area.d.ts +11 -0
- package/dist/components/dropi-text-area.js +1 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +1 -0
- package/dist/components/p-MNma8N1x.js +1 -0
- package/dist/dropi-ui/dropi-ui.css +1 -0
- package/dist/dropi-ui/dropi-ui.esm.js +1 -0
- package/dist/dropi-ui/index.esm.js +0 -0
- package/dist/dropi-ui/p-1a28b8f5.entry.js +1 -0
- package/dist/dropi-ui/p-21abf91a.entry.js +1 -0
- package/dist/dropi-ui/p-52291024.entry.js +1 -0
- package/dist/dropi-ui/p-54502c46.entry.js +1 -0
- package/dist/dropi-ui/p-6f0aa619.entry.js +1 -0
- package/dist/dropi-ui/p-9c7076d3.entry.js +1 -0
- package/dist/dropi-ui/p-DFz-gwFP.js +2 -0
- package/dist/dropi-ui/p-a1944f3d.entry.js +1 -0
- package/dist/dropi-ui/p-c7b9cbda.entry.js +1 -0
- package/dist/dropi-ui/p-dd089a60.entry.js +1 -0
- package/dist/dropi-ui/p-f785011f.entry.js +1 -0
- package/dist/esm/dropi-badge.entry.js +35 -0
- package/dist/esm/dropi-button.entry.js +79 -0
- package/dist/esm/dropi-checkbox.entry.js +34 -0
- package/dist/esm/dropi-icon.entry.js +48 -0
- package/dist/esm/dropi-input.entry.js +208 -0
- package/dist/esm/dropi-radio-button.entry.js +45 -0
- package/dist/esm/dropi-select.entry.js +333 -0
- package/dist/esm/dropi-switch.entry.js +28 -0
- package/dist/esm/dropi-tag.entry.js +66 -0
- package/dist/esm/dropi-text-area.entry.js +101 -0
- package/dist/esm/dropi-ui.js +20 -0
- package/dist/esm/index-DFz-gwFP.js +1734 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +10 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/dropi-badge/dropi-badge.d.ts +12 -0
- package/dist/types/components/dropi-button/dropi-button.d.ts +35 -0
- package/dist/types/components/dropi-checkbox/dropi-checkbox.d.ts +16 -0
- package/dist/types/components/dropi-icon/dropi-icon.d.ts +25 -0
- package/dist/types/components/dropi-input/dropi-input.d.ts +92 -0
- package/dist/types/components/dropi-radio-button/dropi-radio-button.d.ts +25 -0
- package/dist/types/components/dropi-select/dropi-select.d.ts +103 -0
- package/dist/types/components/dropi-select/select.types.d.ts +23 -0
- package/dist/types/components/dropi-switch/dropi-switch.d.ts +15 -0
- package/dist/types/components/dropi-tag/dropi-tag.d.ts +25 -0
- package/dist/types/components/dropi-text-area/dropi-text-area.d.ts +53 -0
- package/dist/types/components.d.ts +1549 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/stencil-public-runtime.d.ts +1860 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/dist/types/utils/utils.unit.test.d.ts +1 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +50 -0
- package/readme.md +89 -0
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* @component dropi-text-area
|
|
4
|
+
* Multi-line text area with label, char counter, validation states,
|
|
5
|
+
* helper text, and native form association.
|
|
6
|
+
*/
|
|
7
|
+
export class DropiTextArea {
|
|
8
|
+
internals;
|
|
9
|
+
/** Input id. Defaults to label. */
|
|
10
|
+
inputId = '';
|
|
11
|
+
/** Name for native form submission */
|
|
12
|
+
name = '';
|
|
13
|
+
/** Label shown above the textarea */
|
|
14
|
+
label = '';
|
|
15
|
+
/** Placeholder text */
|
|
16
|
+
placeholder = '';
|
|
17
|
+
/** Current value (controlled) */
|
|
18
|
+
value = '';
|
|
19
|
+
/** Max character length */
|
|
20
|
+
maxlength;
|
|
21
|
+
/** Min character length */
|
|
22
|
+
minlength = 0;
|
|
23
|
+
/** Number of visible rows */
|
|
24
|
+
rows = 4;
|
|
25
|
+
/** Resize behavior */
|
|
26
|
+
resize = 'vertical';
|
|
27
|
+
/** Disable the textarea */
|
|
28
|
+
disabled = false;
|
|
29
|
+
/** Mark as required */
|
|
30
|
+
required = false;
|
|
31
|
+
/** Show the required asterisk */
|
|
32
|
+
showAsterisk = false;
|
|
33
|
+
/** Helper / error text below the field */
|
|
34
|
+
helperText = '';
|
|
35
|
+
/** Mark the field as invalid (consumer-controlled) */
|
|
36
|
+
invalid = false;
|
|
37
|
+
touched = false;
|
|
38
|
+
/** Emitted on every keystroke */
|
|
39
|
+
dropiInput;
|
|
40
|
+
/** Emitted on blur */
|
|
41
|
+
dropiChange;
|
|
42
|
+
dropiFocus;
|
|
43
|
+
dropiBlur;
|
|
44
|
+
valueChanged(val) {
|
|
45
|
+
this.internals.setFormValue(val);
|
|
46
|
+
}
|
|
47
|
+
componentWillLoad() {
|
|
48
|
+
this.internals.setFormValue(this.value ?? '');
|
|
49
|
+
}
|
|
50
|
+
handleInput(e) {
|
|
51
|
+
const val = e.target.value;
|
|
52
|
+
this.value = val;
|
|
53
|
+
this.internals.setFormValue(val);
|
|
54
|
+
this.dropiInput.emit(val);
|
|
55
|
+
}
|
|
56
|
+
handleBlur() {
|
|
57
|
+
this.touched = true;
|
|
58
|
+
this.dropiChange.emit(this.value);
|
|
59
|
+
this.dropiBlur.emit();
|
|
60
|
+
}
|
|
61
|
+
get resolvedId() {
|
|
62
|
+
return this.inputId || this.label;
|
|
63
|
+
}
|
|
64
|
+
get isInvalid() {
|
|
65
|
+
return this.invalid && this.touched;
|
|
66
|
+
}
|
|
67
|
+
get charCount() {
|
|
68
|
+
return this.value?.length ?? 0;
|
|
69
|
+
}
|
|
70
|
+
render() {
|
|
71
|
+
const showAsterisk = this.required && this.showAsterisk && !this.disabled;
|
|
72
|
+
const showHelper = this.helperText || this.isInvalid;
|
|
73
|
+
return (h("div", { key: 'b35dec5dc3d7ab2992542f4008b97c330c060fbf', class: "textarea-wrapper" }, this.label && (h("label", { key: '89c67611b34012f24fc8377b181215f20ff5b626', htmlFor: this.resolvedId, style: { color: this.disabled ? 'var(--Gray-Gray-400)' : 'var(--Gray-Gray-600)' } }, this.label, showAsterisk && h("span", { key: '74f091ab3e5aee1162943e54795e69b789ff1a84', class: "asterisk" }, " *"))), h("div", { key: '4a1193b310160f3a782692faa798390a2c60f32d', class: "textarea-container" }, h("textarea", { key: '68f62069a7b768cbfa2263ff66970b79a2fca007', id: this.resolvedId, class: {
|
|
74
|
+
'form-control': true,
|
|
75
|
+
'Body-M-Regular': true,
|
|
76
|
+
'form-control-valid': !this.isInvalid && this.touched && !!this.value,
|
|
77
|
+
'form-control-invalid': this.isInvalid,
|
|
78
|
+
}, rows: this.rows, placeholder: this.placeholder, maxLength: this.maxlength, minLength: this.minlength, disabled: this.disabled, required: this.required, style: { resize: this.resize }, onInput: (e) => this.handleInput(e), onFocus: () => this.dropiFocus.emit(), onBlur: () => this.handleBlur() }, this.value), this.maxlength > 0 && (h("div", { key: '71596e1da89db842a391efca26cdef906b4e9982', class: "char-counter" }, this.charCount, "/", this.maxlength))), showHelper && (h("div", { key: '58f1124e504b85e5fdb2737f99524e4334e2dac5', class: "form-control-helper" }, this.isInvalid && (h("dropi-icon", { key: '9dd89e05639d924d96e0d117ee677461d30801e1', name: "Warning-circle", width: "12px", height: "12px", color: "Error-Error-500" })), h("span", { key: '823ad2ae0b9e6337a347c83075123b3af675d1a4', class: { 'invalid-color': this.isInvalid }, style: { color: this.disabled ? 'var(--Gray-Gray-400)' : undefined } }, this.helperText)))));
|
|
79
|
+
}
|
|
80
|
+
static get is() { return "dropi-text-area"; }
|
|
81
|
+
static get encapsulation() { return "shadow"; }
|
|
82
|
+
static get formAssociated() { return true; }
|
|
83
|
+
static get originalStyleUrls() {
|
|
84
|
+
return {
|
|
85
|
+
"$": ["dropi-text-area.css"]
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
static get styleUrls() {
|
|
89
|
+
return {
|
|
90
|
+
"$": ["dropi-text-area.css"]
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
static get properties() {
|
|
94
|
+
return {
|
|
95
|
+
"inputId": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"mutable": false,
|
|
98
|
+
"complexType": {
|
|
99
|
+
"original": "string",
|
|
100
|
+
"resolved": "string",
|
|
101
|
+
"references": {}
|
|
102
|
+
},
|
|
103
|
+
"required": false,
|
|
104
|
+
"optional": false,
|
|
105
|
+
"docs": {
|
|
106
|
+
"tags": [],
|
|
107
|
+
"text": "Input id. Defaults to label."
|
|
108
|
+
},
|
|
109
|
+
"getter": false,
|
|
110
|
+
"setter": false,
|
|
111
|
+
"reflect": false,
|
|
112
|
+
"attribute": "input-id",
|
|
113
|
+
"defaultValue": "''"
|
|
114
|
+
},
|
|
115
|
+
"name": {
|
|
116
|
+
"type": "string",
|
|
117
|
+
"mutable": false,
|
|
118
|
+
"complexType": {
|
|
119
|
+
"original": "string",
|
|
120
|
+
"resolved": "string",
|
|
121
|
+
"references": {}
|
|
122
|
+
},
|
|
123
|
+
"required": false,
|
|
124
|
+
"optional": false,
|
|
125
|
+
"docs": {
|
|
126
|
+
"tags": [],
|
|
127
|
+
"text": "Name for native form submission"
|
|
128
|
+
},
|
|
129
|
+
"getter": false,
|
|
130
|
+
"setter": false,
|
|
131
|
+
"reflect": false,
|
|
132
|
+
"attribute": "name",
|
|
133
|
+
"defaultValue": "''"
|
|
134
|
+
},
|
|
135
|
+
"label": {
|
|
136
|
+
"type": "string",
|
|
137
|
+
"mutable": false,
|
|
138
|
+
"complexType": {
|
|
139
|
+
"original": "string",
|
|
140
|
+
"resolved": "string",
|
|
141
|
+
"references": {}
|
|
142
|
+
},
|
|
143
|
+
"required": false,
|
|
144
|
+
"optional": false,
|
|
145
|
+
"docs": {
|
|
146
|
+
"tags": [],
|
|
147
|
+
"text": "Label shown above the textarea"
|
|
148
|
+
},
|
|
149
|
+
"getter": false,
|
|
150
|
+
"setter": false,
|
|
151
|
+
"reflect": false,
|
|
152
|
+
"attribute": "label",
|
|
153
|
+
"defaultValue": "''"
|
|
154
|
+
},
|
|
155
|
+
"placeholder": {
|
|
156
|
+
"type": "string",
|
|
157
|
+
"mutable": false,
|
|
158
|
+
"complexType": {
|
|
159
|
+
"original": "string",
|
|
160
|
+
"resolved": "string",
|
|
161
|
+
"references": {}
|
|
162
|
+
},
|
|
163
|
+
"required": false,
|
|
164
|
+
"optional": false,
|
|
165
|
+
"docs": {
|
|
166
|
+
"tags": [],
|
|
167
|
+
"text": "Placeholder text"
|
|
168
|
+
},
|
|
169
|
+
"getter": false,
|
|
170
|
+
"setter": false,
|
|
171
|
+
"reflect": false,
|
|
172
|
+
"attribute": "placeholder",
|
|
173
|
+
"defaultValue": "''"
|
|
174
|
+
},
|
|
175
|
+
"value": {
|
|
176
|
+
"type": "string",
|
|
177
|
+
"mutable": true,
|
|
178
|
+
"complexType": {
|
|
179
|
+
"original": "string",
|
|
180
|
+
"resolved": "string",
|
|
181
|
+
"references": {}
|
|
182
|
+
},
|
|
183
|
+
"required": false,
|
|
184
|
+
"optional": false,
|
|
185
|
+
"docs": {
|
|
186
|
+
"tags": [],
|
|
187
|
+
"text": "Current value (controlled)"
|
|
188
|
+
},
|
|
189
|
+
"getter": false,
|
|
190
|
+
"setter": false,
|
|
191
|
+
"reflect": false,
|
|
192
|
+
"attribute": "value",
|
|
193
|
+
"defaultValue": "''"
|
|
194
|
+
},
|
|
195
|
+
"maxlength": {
|
|
196
|
+
"type": "number",
|
|
197
|
+
"mutable": false,
|
|
198
|
+
"complexType": {
|
|
199
|
+
"original": "number",
|
|
200
|
+
"resolved": "number",
|
|
201
|
+
"references": {}
|
|
202
|
+
},
|
|
203
|
+
"required": false,
|
|
204
|
+
"optional": false,
|
|
205
|
+
"docs": {
|
|
206
|
+
"tags": [],
|
|
207
|
+
"text": "Max character length"
|
|
208
|
+
},
|
|
209
|
+
"getter": false,
|
|
210
|
+
"setter": false,
|
|
211
|
+
"reflect": false,
|
|
212
|
+
"attribute": "maxlength"
|
|
213
|
+
},
|
|
214
|
+
"minlength": {
|
|
215
|
+
"type": "number",
|
|
216
|
+
"mutable": false,
|
|
217
|
+
"complexType": {
|
|
218
|
+
"original": "number",
|
|
219
|
+
"resolved": "number",
|
|
220
|
+
"references": {}
|
|
221
|
+
},
|
|
222
|
+
"required": false,
|
|
223
|
+
"optional": false,
|
|
224
|
+
"docs": {
|
|
225
|
+
"tags": [],
|
|
226
|
+
"text": "Min character length"
|
|
227
|
+
},
|
|
228
|
+
"getter": false,
|
|
229
|
+
"setter": false,
|
|
230
|
+
"reflect": false,
|
|
231
|
+
"attribute": "minlength",
|
|
232
|
+
"defaultValue": "0"
|
|
233
|
+
},
|
|
234
|
+
"rows": {
|
|
235
|
+
"type": "number",
|
|
236
|
+
"mutable": false,
|
|
237
|
+
"complexType": {
|
|
238
|
+
"original": "number",
|
|
239
|
+
"resolved": "number",
|
|
240
|
+
"references": {}
|
|
241
|
+
},
|
|
242
|
+
"required": false,
|
|
243
|
+
"optional": false,
|
|
244
|
+
"docs": {
|
|
245
|
+
"tags": [],
|
|
246
|
+
"text": "Number of visible rows"
|
|
247
|
+
},
|
|
248
|
+
"getter": false,
|
|
249
|
+
"setter": false,
|
|
250
|
+
"reflect": false,
|
|
251
|
+
"attribute": "rows",
|
|
252
|
+
"defaultValue": "4"
|
|
253
|
+
},
|
|
254
|
+
"resize": {
|
|
255
|
+
"type": "string",
|
|
256
|
+
"mutable": false,
|
|
257
|
+
"complexType": {
|
|
258
|
+
"original": "ResizeMode",
|
|
259
|
+
"resolved": "\"both\" | \"horizontal\" | \"none\" | \"vertical\"",
|
|
260
|
+
"references": {
|
|
261
|
+
"ResizeMode": {
|
|
262
|
+
"location": "local",
|
|
263
|
+
"path": "/Users/mac-ti/Documents/dropi/dropi-ui/src/components/dropi-text-area/dropi-text-area.tsx",
|
|
264
|
+
"id": "src/components/dropi-text-area/dropi-text-area.tsx::ResizeMode"
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
"required": false,
|
|
269
|
+
"optional": false,
|
|
270
|
+
"docs": {
|
|
271
|
+
"tags": [],
|
|
272
|
+
"text": "Resize behavior"
|
|
273
|
+
},
|
|
274
|
+
"getter": false,
|
|
275
|
+
"setter": false,
|
|
276
|
+
"reflect": false,
|
|
277
|
+
"attribute": "resize",
|
|
278
|
+
"defaultValue": "'vertical'"
|
|
279
|
+
},
|
|
280
|
+
"disabled": {
|
|
281
|
+
"type": "boolean",
|
|
282
|
+
"mutable": false,
|
|
283
|
+
"complexType": {
|
|
284
|
+
"original": "boolean",
|
|
285
|
+
"resolved": "boolean",
|
|
286
|
+
"references": {}
|
|
287
|
+
},
|
|
288
|
+
"required": false,
|
|
289
|
+
"optional": false,
|
|
290
|
+
"docs": {
|
|
291
|
+
"tags": [],
|
|
292
|
+
"text": "Disable the textarea"
|
|
293
|
+
},
|
|
294
|
+
"getter": false,
|
|
295
|
+
"setter": false,
|
|
296
|
+
"reflect": true,
|
|
297
|
+
"attribute": "disabled",
|
|
298
|
+
"defaultValue": "false"
|
|
299
|
+
},
|
|
300
|
+
"required": {
|
|
301
|
+
"type": "boolean",
|
|
302
|
+
"mutable": false,
|
|
303
|
+
"complexType": {
|
|
304
|
+
"original": "boolean",
|
|
305
|
+
"resolved": "boolean",
|
|
306
|
+
"references": {}
|
|
307
|
+
},
|
|
308
|
+
"required": false,
|
|
309
|
+
"optional": false,
|
|
310
|
+
"docs": {
|
|
311
|
+
"tags": [],
|
|
312
|
+
"text": "Mark as required"
|
|
313
|
+
},
|
|
314
|
+
"getter": false,
|
|
315
|
+
"setter": false,
|
|
316
|
+
"reflect": true,
|
|
317
|
+
"attribute": "required",
|
|
318
|
+
"defaultValue": "false"
|
|
319
|
+
},
|
|
320
|
+
"showAsterisk": {
|
|
321
|
+
"type": "boolean",
|
|
322
|
+
"mutable": false,
|
|
323
|
+
"complexType": {
|
|
324
|
+
"original": "boolean",
|
|
325
|
+
"resolved": "boolean",
|
|
326
|
+
"references": {}
|
|
327
|
+
},
|
|
328
|
+
"required": false,
|
|
329
|
+
"optional": false,
|
|
330
|
+
"docs": {
|
|
331
|
+
"tags": [],
|
|
332
|
+
"text": "Show the required asterisk"
|
|
333
|
+
},
|
|
334
|
+
"getter": false,
|
|
335
|
+
"setter": false,
|
|
336
|
+
"reflect": false,
|
|
337
|
+
"attribute": "show-asterisk",
|
|
338
|
+
"defaultValue": "false"
|
|
339
|
+
},
|
|
340
|
+
"helperText": {
|
|
341
|
+
"type": "string",
|
|
342
|
+
"mutable": false,
|
|
343
|
+
"complexType": {
|
|
344
|
+
"original": "string",
|
|
345
|
+
"resolved": "string",
|
|
346
|
+
"references": {}
|
|
347
|
+
},
|
|
348
|
+
"required": false,
|
|
349
|
+
"optional": false,
|
|
350
|
+
"docs": {
|
|
351
|
+
"tags": [],
|
|
352
|
+
"text": "Helper / error text below the field"
|
|
353
|
+
},
|
|
354
|
+
"getter": false,
|
|
355
|
+
"setter": false,
|
|
356
|
+
"reflect": false,
|
|
357
|
+
"attribute": "helper-text",
|
|
358
|
+
"defaultValue": "''"
|
|
359
|
+
},
|
|
360
|
+
"invalid": {
|
|
361
|
+
"type": "boolean",
|
|
362
|
+
"mutable": false,
|
|
363
|
+
"complexType": {
|
|
364
|
+
"original": "boolean",
|
|
365
|
+
"resolved": "boolean",
|
|
366
|
+
"references": {}
|
|
367
|
+
},
|
|
368
|
+
"required": false,
|
|
369
|
+
"optional": false,
|
|
370
|
+
"docs": {
|
|
371
|
+
"tags": [],
|
|
372
|
+
"text": "Mark the field as invalid (consumer-controlled)"
|
|
373
|
+
},
|
|
374
|
+
"getter": false,
|
|
375
|
+
"setter": false,
|
|
376
|
+
"reflect": false,
|
|
377
|
+
"attribute": "invalid",
|
|
378
|
+
"defaultValue": "false"
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
static get states() {
|
|
383
|
+
return {
|
|
384
|
+
"touched": {}
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
static get events() {
|
|
388
|
+
return [{
|
|
389
|
+
"method": "dropiInput",
|
|
390
|
+
"name": "dropiInput",
|
|
391
|
+
"bubbles": true,
|
|
392
|
+
"cancelable": true,
|
|
393
|
+
"composed": true,
|
|
394
|
+
"docs": {
|
|
395
|
+
"tags": [],
|
|
396
|
+
"text": "Emitted on every keystroke"
|
|
397
|
+
},
|
|
398
|
+
"complexType": {
|
|
399
|
+
"original": "string",
|
|
400
|
+
"resolved": "string",
|
|
401
|
+
"references": {}
|
|
402
|
+
}
|
|
403
|
+
}, {
|
|
404
|
+
"method": "dropiChange",
|
|
405
|
+
"name": "dropiChange",
|
|
406
|
+
"bubbles": true,
|
|
407
|
+
"cancelable": true,
|
|
408
|
+
"composed": true,
|
|
409
|
+
"docs": {
|
|
410
|
+
"tags": [],
|
|
411
|
+
"text": "Emitted on blur"
|
|
412
|
+
},
|
|
413
|
+
"complexType": {
|
|
414
|
+
"original": "string",
|
|
415
|
+
"resolved": "string",
|
|
416
|
+
"references": {}
|
|
417
|
+
}
|
|
418
|
+
}, {
|
|
419
|
+
"method": "dropiFocus",
|
|
420
|
+
"name": "dropiFocus",
|
|
421
|
+
"bubbles": true,
|
|
422
|
+
"cancelable": true,
|
|
423
|
+
"composed": true,
|
|
424
|
+
"docs": {
|
|
425
|
+
"tags": [],
|
|
426
|
+
"text": ""
|
|
427
|
+
},
|
|
428
|
+
"complexType": {
|
|
429
|
+
"original": "void",
|
|
430
|
+
"resolved": "void",
|
|
431
|
+
"references": {}
|
|
432
|
+
}
|
|
433
|
+
}, {
|
|
434
|
+
"method": "dropiBlur",
|
|
435
|
+
"name": "dropiBlur",
|
|
436
|
+
"bubbles": true,
|
|
437
|
+
"cancelable": true,
|
|
438
|
+
"composed": true,
|
|
439
|
+
"docs": {
|
|
440
|
+
"tags": [],
|
|
441
|
+
"text": ""
|
|
442
|
+
},
|
|
443
|
+
"complexType": {
|
|
444
|
+
"original": "void",
|
|
445
|
+
"resolved": "void",
|
|
446
|
+
"references": {}
|
|
447
|
+
}
|
|
448
|
+
}];
|
|
449
|
+
}
|
|
450
|
+
static get watchers() {
|
|
451
|
+
return [{
|
|
452
|
+
"propName": "value",
|
|
453
|
+
"methodName": "valueChanged"
|
|
454
|
+
}];
|
|
455
|
+
}
|
|
456
|
+
static get attachInternalsMemberName() { return "internals"; }
|
|
457
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { format } from "./utils";
|
|
3
|
+
describe('format', () => {
|
|
4
|
+
it('returns empty string for no names defined', () => {
|
|
5
|
+
expect(format(undefined, undefined, undefined)).toEqual('');
|
|
6
|
+
});
|
|
7
|
+
it('formats just first names', () => {
|
|
8
|
+
expect(format('Joseph', undefined, undefined)).toEqual('Joseph');
|
|
9
|
+
});
|
|
10
|
+
it('formats first and last names', () => {
|
|
11
|
+
expect(format('Joseph', undefined, 'Publique')).toEqual('Joseph Publique');
|
|
12
|
+
});
|
|
13
|
+
it('formats first, middle and last names', () => {
|
|
14
|
+
expect(format('Joseph', 'Quincy', 'Publique')).toEqual('Joseph Quincy Publique');
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface DropiBadge extends Components.DropiBadge, HTMLElement {}
|
|
4
|
+
export const DropiBadge: {
|
|
5
|
+
prototype: DropiBadge;
|
|
6
|
+
new (): DropiBadge;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,p as t,H as a,h as n}from"./index.js";const s=t(class extends a{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow()}state="pending";stateText={pending:"Pendiente",active:"Activo",canceled:"Cancelado",frozen:"Congelado"};renderIcon(){return"active"===this.state?n("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n("path",{d:"M11.5444 5.87067L12.5389 6.88004L8.43554 10.9225C8.16142 11.1966 7.80087 11.3333 7.43892 11.3333C7.07696 11.3333 6.71287 11.1952 6.43592 10.919L4.46533 9.00929L5.45204 7.99142L7.43042 9.90887L11.5444 5.87067ZM17 8.5C17 13.187 13.187 17 8.5 17C3.81296 17 0 13.187 0 8.5C0 3.81296 3.81296 0 8.5 0C13.187 0 17 3.81296 17 8.5ZM15.5833 8.5C15.5833 4.59425 12.4057 1.41667 8.5 1.41667C4.59425 1.41667 1.41667 4.59425 1.41667 8.5C1.41667 12.4057 4.59425 15.5833 8.5 15.5833C12.4057 15.5833 15.5833 12.4057 15.5833 8.5Z",fill:"currentColor"})):"pending"===this.state?n("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n("path",{d:"M8.5 17C3.81296 17 0 13.187 0 8.5C0 3.81296 3.81296 0 8.5 0C13.187 0 17 3.81296 17 8.5C17 13.187 13.187 17 8.5 17ZM8.5 1.41667C4.59425 1.41667 1.41667 4.59425 1.41667 8.5C1.41667 12.4057 4.59425 15.5833 8.5 15.5833C12.4057 15.5833 15.5833 12.4057 15.5833 8.5C15.5833 4.59425 12.4057 1.41667 8.5 1.41667ZM9.20833 8.5V4.25C9.20833 3.859 8.891 3.54167 8.5 3.54167C8.109 3.54167 7.79167 3.859 7.79167 4.25V7.79167H5.66667C5.27567 7.79167 4.95833 8.109 4.95833 8.5C4.95833 8.891 5.27567 9.20833 5.66667 9.20833H8.5C8.891 9.20833 9.20833 8.891 9.20833 8.5Z",fill:"currentColor"})):"canceled"===this.state?n("svg",{width:"12",height:"14",viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.5497 4.86859V5.76046C12.1075 6.00391 12.5823 6.40464 12.916 6.91364C13.2497 7.42264 13.4279 8.01785 13.4287 8.62648V12.3844C13.4277 13.2146 13.0974 14.0106 12.5103 14.5976C11.9233 15.1847 11.1273 15.515 10.2971 15.516H4.03392C3.20368 15.515 2.40773 15.1847 1.82066 14.5976C1.23359 14.0106 0.903338 13.2146 0.902344 12.3844V8.62648C0.903144 8.01785 1.08129 7.42264 1.41498 6.91364C1.74868 6.40464 2.22347 6.00391 2.78129 5.76046V4.86859C2.78129 3.70582 3.2432 2.59068 4.0654 1.76848C4.8876 0.946282 6.00274 0.484375 7.1655 0.484375C8.32827 0.484375 9.44341 0.946282 10.2656 1.76848C11.0878 2.59068 11.5497 3.70582 11.5497 4.86859ZM4.95114 2.65422C4.36386 3.24151 4.03392 4.03804 4.03392 4.86859V5.4949H10.2971V4.86859C10.2971 4.03804 9.96715 3.24151 9.37986 2.65422C8.79258 2.06694 7.99605 1.73701 7.1655 1.73701C6.33496 1.73701 5.53843 2.06694 4.95114 2.65422ZM11.6257 13.713C11.9781 13.3606 12.176 12.8827 12.176 12.3844V8.62648C12.176 8.12815 11.9781 7.65023 11.6257 7.29786C11.2733 6.94549 10.7954 6.74753 10.2971 6.74753H4.03392C3.53559 6.74753 3.05768 6.94549 2.70531 7.29786C2.35294 7.65023 2.15498 8.12815 2.15498 8.62648V12.3844C2.15498 12.8827 2.35294 13.3606 2.70531 13.713C3.05768 14.0654 3.53559 14.2633 4.03392 14.2633H10.2971C10.7954 14.2633 11.2733 14.0654 11.6257 13.713ZM6.72263 9.43615C6.84009 9.31869 6.99939 9.25271 7.1655 9.25271C7.33161 9.25271 7.49092 9.31869 7.60837 9.43615C7.72583 9.55361 7.79182 9.71291 7.79182 9.87902V11.1317C7.79182 11.2978 7.72583 11.4571 7.60837 11.5745C7.49092 11.692 7.33161 11.758 7.1655 11.758C6.99939 11.758 6.84009 11.692 6.72263 11.5745C6.60517 11.4571 6.53919 11.2978 6.53919 11.1317V9.87902C6.53919 9.71291 6.60517 9.55361 6.72263 9.43615Z",fill:"currentColor"})):null}render(){return n("div",{key:"b66590d82d7dd760badcfb76c72eb3d589073721",class:"tag-state "+this.state},this.renderIcon(),n("p",{key:"82ae7072f3ac6d96ed02db8289f0f98f070a882d"},this.stateText[this.state]))}static get style(){return":host{display:inline-flex}*,*::before,*::after{box-sizing:border-box}.tag-state{border-radius:12px;padding:2px 10px;display:flex;align-items:center;gap:4px}.tag-state svg{width:13px}.tag-state p{font-size:13px;font-weight:500;line-height:20px;margin:0;padding:0}.tag-state.active{background:var(--Success-Success-50, #e7f8f3);color:var(--Success-Success-500, #0abb87)}.tag-state.pending{color:var(--Orange-orange-500, #f49a3d);background:var(--Orange-orange-50, #fef5ec)}.tag-state.canceled,.tag-state.frozen{color:var(--Gray-Gray-500, #69738c);background:var(--Gray-Gray-50, #f7f8fa)}"}},[513,"dropi-badge",{state:[1]}]);function r(){"undefined"!=typeof customElements&&["dropi-badge"].forEach((t=>{"dropi-badge"===t&&(customElements.get(e(t))||customElements.define(e(t),s))}))}r();const i=s,C=r;export{i as DropiBadge,C as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface DropiButton extends Components.DropiButton, HTMLElement {}
|
|
4
|
+
export const DropiButton: {
|
|
5
|
+
prototype: DropiButton;
|
|
6
|
+
new (): DropiButton;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as r,p as a,H as o,c as e,h as n}from"./index.js";import{d as t}from"./p-MNma8N1x.js";const c=a(class extends o{constructor(r){super(),!1!==r&&this.__registerHost(),this.__attachShadow(),this.dropiClick=e(this,"dropiClick")}type="default";severity="primary";size="normal";state="default";preIcon="";postIcon="";text="";dropiClick;colorMap={default:"Primary-Primary-",success:"Success-Success-",error:"Error-Error-",info:"Info-Info-",legacy:"Secondary-Secondary-",warning:"Warning-Warning-",dropdown:"Gray-Gray-"};get iconSize(){return"large"===this.size?"24px":"small"===this.size?"16px":"18px"}get color(){return(this.colorMap[this.type]??"Primary-Primary-")+("disabled"===this.state?"300":"500")}get fontColor(){return"tertiary"===this.severity?"default"===this.type||"legacy"===this.type?"Gray-Gray-500":this.color:"secondary"===this.severity?this.color:"Neutral-White"}handleClick(r){"disabled"!==this.state&&"loading"!==this.state&&this.dropiClick.emit(r)}renderLoadingSpinner(){return n("svg",{class:"spin",width:this.iconSize,height:this.iconSize,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n("path",{d:"M22.8 12C23.4627 12 24.0062 11.4614 23.9401 10.802C23.8232 9.6371 23.5362 8.49339 23.0866 7.4078C22.4835 5.95189 21.5996 4.62902 20.4853 3.51472C19.371 2.40042 18.0481 1.5165 16.5922 0.913445C15.5066 0.463778 14.3629 0.17683 13.198 0.0599502C12.5386 -0.00621439 12 0.537258 12 1.2C12 1.86274 12.5393 2.39227 13.1969 2.4749C14.0463 2.58164 14.8795 2.80176 15.6738 3.13076C16.8385 3.6132 17.8968 4.32033 18.7882 5.21177C19.6797 6.10322 20.3868 7.16151 20.8692 8.32624C21.1982 9.12051 21.4184 9.95367 21.5251 10.8031C21.6077 11.4607 22.1373 12 22.8 12Z",fill:`var(--${this.fontColor})`}))}render(){const r="disabled"===this.state||"loading"===this.state,a=""!==this.text,o=""!==this.postIcon||"dropdown"===this.type,e="dropdown"===this.type?"Dropdown-down":this.postIcon;return n("button",{key:"6cde7f2616d1cff9e3304481f2a0c38aabc34192",class:{btn:!0,"without-text":!a,[this.severity]:!0,[this.type]:!0,[this.size]:!0,[this.state]:!0},disabled:r,onClick:r=>this.handleClick(r)},this.preIcon&&n("dropi-icon",{key:"769cea8fce2947552462aa2cbbb09d64df952c76",name:this.preIcon,width:this.iconSize,height:this.iconSize,color:this.fontColor}),a&&n("span",{key:"f66ad80283d54f643cf37ea702145127b90d4ce4",class:"text"},this.text),o&&n("dropi-icon",{key:"4fd9c7d7d029c3316bc0492576cda0cca74fa460",name:e,width:this.iconSize,height:this.iconSize,color:this.fontColor}),"loading"===this.state&&this.renderLoadingSpinner(),n("slot",{key:"3280c56a28ea40016d35e186b9997635b8ba881b"}))}static get style(){return":host{display:inline-block}*,*::before,*::after{box-sizing:border-box}.btn{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;gap:var(--Size-1, 4px);border-radius:var(--Border-2, 8px);font-weight:700;min-width:33px;line-height:110%;cursor:pointer;white-space:nowrap;transition:background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease}.btn:active{transition:transform 0.01s ease-out;transform:scale(0.98)}.btn:hover:not(:active){transform:scale(1.01)}.btn.without-text{gap:0}.btn.large{padding:var(--Size-4, 16px);font-size:var(--Size-4, 16px);height:48px}.btn.normal{padding:var(--Size-3, 12px);font-size:var(--font-size-s, 12px);height:40px}.btn.small{padding:var(--Size-2, 8px);font-size:var(--Size-3, 12px);height:29px}.btn.disabled,.btn.loading{cursor:not-allowed;pointer-events:none}.btn.primary.default{background:var(--Primary-Primary-500, #f49a3d);color:var(--Neutral-White, #fff)}.btn.primary.default:hover{background:var(--Primary-Primary-600, #e58017)}.btn.primary.success{background:var(--Success-Success-500, #0abb87);color:var(--Neutral-White, #fff)}.btn.primary.success:hover{background:var(--Success-Success-600, #09aa7b)}.btn.primary.info{background:var(--Info-Info-500, #50a5f1);color:var(--Neutral-White, #fff)}.btn.primary.info:hover{background:var(--Info-Info-600, #4996db)}.btn.primary.error{background:var(--Error-Error-500, #f46a6b);color:var(--Neutral-White, #fff)}.btn.primary.error:hover{background:var(--Error-Error-600, #de6061)}.btn.primary.warning{background:var(--Warning-Warning-500, #f1b44c);color:var(--Neutral-White, #fff)}.btn.primary.warning:hover{background:var(--Warning-Warning-600, #dba445)}.btn.primary.legacy{background:var(--Secondary-Secondary-500, #008dbf);color:var(--Neutral-White, #fff)}.btn.primary.legacy:hover{background:var(--Secondary-Secondary-600, #007199)}.btn.primary.disabled.default{background:var(--Primary-Primary-300, #f2bc85);color:var(--Neutral-White, #fff)}.btn.primary.disabled.success{background:var(--Success-Success-300, #5bd1af);color:var(--Neutral-White, #fff)}.btn.primary.disabled.info{background:var(--Info-Info-300, #8ac3f6);color:var(--Neutral-White, #fff)}.btn.primary.disabled.error{background:var(--Error-Error-300, #f89b9c);color:var(--Neutral-White, #fff)}.btn.primary.disabled.warning{background:var(--Warning-Warning-300, #f6cd87);color:var(--Neutral-White, #fff)}.btn.primary.disabled.legacy{background:var(--Secondary-Secondary-300, #62bad9);color:var(--Neutral-White, #fff)}.btn.secondary{background:var(--Neutral-White, #fff);border:1px solid}.btn.secondary.default{border-color:var(--Primary-Primary-500, #f49a3d);color:var(--Primary-Primary-500, #f49a3d)}.btn.secondary.default:hover{color:var(--Primary-Primary-600, #e58017);border-color:var(--Primary-Primary-600, #e58017)}.btn.secondary.success{border-color:var(--Success-Success-500, #0abb87);color:var(--Success-Success-500, #0abb87)}.btn.secondary.success:hover{color:var(--Success-Success-600, #09aa7b);border-color:var(--Success-Success-600, #09aa7b)}.btn.secondary.info{border-color:var(--Info-Info-500, #50a5f1);color:var(--Info-Info-500, #50a5f1)}.btn.secondary.info:hover{color:var(--Info-Info-600, #4996db);border-color:var(--Info-Info-600, #4996db)}.btn.secondary.error{border-color:var(--Error-Error-500, #f46a6b);color:var(--Error-Error-500, #f46a6b)}.btn.secondary.error:hover{color:var(--Error-Error-600, #de6061);border-color:var(--Error-Error-600, #de6061)}.btn.secondary.warning{border-color:var(--Warning-Warning-500, #f1b44c);color:var(--Warning-Warning-500, #f1b44c)}.btn.secondary.warning:hover{color:var(--Warning-Warning-600, #dba445);border-color:var(--Warning-Warning-600, #dba445)}.btn.secondary.legacy{border-color:var(--Secondary-Secondary-500, #008dbf);color:var(--Secondary-Secondary-500, #008dbf)}.btn.secondary.legacy:hover{color:var(--Secondary-Secondary-600, #007199);border-color:var(--Secondary-Secondary-600, #007199)}.btn.secondary.disabled.default{border-color:var(--Primary-Primary-300, #f2bc85);color:var(--Primary-Primary-300, #f2bc85)}.btn.secondary.disabled.success{border-color:var(--Success-Success-300, #5bd1af);color:var(--Success-Success-300, #5bd1af)}.btn.secondary.disabled.info{border-color:var(--Info-Info-300, #8ac3f6);color:var(--Info-Info-300, #8ac3f6)}.btn.secondary.disabled.error{border-color:var(--Error-Error-300, #f89b9c);color:var(--Error-Error-300, #f89b9c)}.btn.secondary.disabled.warning{border-color:var(--Warning-Warning-300, #f6cd87);color:var(--Warning-Warning-300, #f6cd87)}.btn.secondary.disabled.legacy{border-color:var(--Secondary-Secondary-300, #62bad9);color:var(--Secondary-Secondary-300, #62bad9)}.btn.tertiary{background:none;border:none}.btn.tertiary.default,.btn.tertiary.legacy{border:1px solid var(--Gray-Gray-200, #c3c9d9);color:var(--Gray-Gray-500, #69738c)}.btn.tertiary.default:hover,.btn.tertiary.legacy:hover{border-color:var(--Gray-Gray-400, #858ea6);color:var(--Gray-Gray-600, #475066)}.btn.tertiary.success{color:var(--Success-Success-500, #0abb87)}.btn.tertiary.success:hover{background:var(--Success-Success-50, #e7f8f3)}.btn.tertiary.info{color:var(--Info-Info-500, #50a5f1)}.btn.tertiary.info:hover{background:var(--Info-Info-50, #eef6fe)}.btn.tertiary.error{color:var(--Error-Error-500, #f46a6b)}.btn.tertiary.error:hover{background:var(--Error-Error-50, #fef0f0)}.btn.tertiary.warning{color:var(--Warning-Warning-500, #f1b44c)}.btn.tertiary.warning:hover{background:var(--Warning-Warning-50, #fef8ed)}.btn.tertiary.dropdown{color:var(--Gray-Gray-500, #69738c);font-weight:400;font-size:14px;background:transparent}.btn.tertiary.disabled.default,.btn.tertiary.disabled.legacy{border:1px solid var(--Gray-Gray-200, #c3c9d9);color:var(--Gray-Gray-400, #858ea6)}.btn.tertiary.disabled.success{color:var(--Success-Success-300, #5bd1af)}.btn.tertiary.disabled.info{color:var(--Info-Info-300, #8ac3f6)}.btn.tertiary.disabled.error{color:var(--Error-Error-300, #f89b9c)}.btn.tertiary.disabled.warning{color:var(--Warning-Warning-300, #f6cd87)}.spin{animation:spin 1s linear infinite}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}"}},[769,"dropi-button",{type:[1],severity:[1],size:[1],state:[1],preIcon:[1,"pre-icon"],postIcon:[1,"post-icon"],text:[1]}]);function i(){"undefined"!=typeof customElements&&["dropi-button","dropi-icon"].forEach((a=>{switch(a){case"dropi-button":customElements.get(r(a))||customElements.define(r(a),c);break;case"dropi-icon":customElements.get(r(a))||t()}}))}i();const s=c,d=i;export{s as DropiButton,d as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface DropiCheckbox extends Components.DropiCheckbox, HTMLElement {}
|
|
4
|
+
export const DropiCheckbox: {
|
|
5
|
+
prototype: DropiCheckbox;
|
|
6
|
+
new (): DropiCheckbox;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,p as r,H as i,c as t,h as o}from"./index.js";const c=r(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.dropiChange=t(this,"dropiChange")}checked=!1;disabled=!1;dropiChange;changeState(){this.disabled||(this.checked=!this.checked,this.dropiChange.emit(this.checked))}render(){return o("div",{key:"e5c7ef2fd09e5e18b71cbbdd96cc13d4fd99b8a5",class:"container-dropi-checkbox",onClick:()=>this.changeState()},o("div",{key:"2b6a006125e8e68fbba9285451d0d7a578c183d2",class:{check:!0,isCheck:this.checked,noCheck:!this.checked,disabled:this.disabled}},o("svg",{key:"ce19f7e7e1159ee2915a78827775bd969484aa4a",xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none"},o("path",{key:"f41304ce433c5ea47f8eb964278e1a4c2c8184b2",d:"M20.5991 5.69251L9.08325 17.2075C9.00583 17.2852 8.91382 17.3469 8.8125 17.389C8.71118 17.4311 8.60255 17.4527 8.49283 17.4527C8.38312 17.4527 8.27449 17.4311 8.17317 17.389C8.07185 17.3469 7.97984 17.2852 7.90242 17.2075L3.44908 12.75C3.37166 12.6723 3.27965 12.6106 3.17833 12.5685C3.07701 12.5264 2.96838 12.5048 2.85867 12.5048C2.74896 12.5048 2.64032 12.5264 2.53901 12.5685C2.43769 12.6106 2.34568 12.6723 2.26825 12.75C2.19052 12.8274 2.12884 12.9194 2.08676 13.0208C2.04467 13.1221 2.02301 13.2307 2.02301 13.3404C2.02301 13.4501 2.04467 13.5588 2.08676 13.6601C2.12884 13.7614 2.19052 13.8534 2.26825 13.9308L6.72325 18.385C7.19321 18.8541 7.83008 19.1175 8.49408 19.1175C9.15809 19.1175 9.79496 18.8541 10.2649 18.385L21.7799 6.87251C21.8575 6.7951 21.9191 6.70314 21.9611 6.6019C22.0031 6.50065 22.0247 6.39212 22.0247 6.28251C22.0247 6.17289 22.0031 6.06436 21.9611 5.96312C21.9191 5.86188 21.8575 5.76992 21.7799 5.69251C21.7025 5.61478 21.6105 5.5531 21.5092 5.51101C21.4078 5.46893 21.2992 5.44727 21.1895 5.44727C21.0798 5.44727 20.9712 5.46893 20.8698 5.51101C20.7685 5.5531 20.6765 5.61478 20.5991 5.69251Z",fill:"#FFFFFF"}))))}static get formAssociated(){return!0}static get style(){return":host{display:inline-block}*,*::before,*::after{box-sizing:border-box}.container-dropi-checkbox{display:inline-block}.check{width:20px;height:20px;border-radius:var(--Border-1, 4px);cursor:pointer;transition:background-color 0.3s ease-in-out, border-style 0.3s ease-in-out}.noCheck{border-style:solid;border-width:2px;border-color:var(--Gray-Gray-200, #c3c9d9);display:flex;justify-content:center;align-items:center}.noCheck svg{visibility:hidden}.isCheck{display:flex;background-color:var(--Primary-Primary-500, #f49a3d);justify-content:center;align-items:center}.disabled{background-color:var(--Gray-Gray-50, #f7f8fa);border-color:var(--Gray-Gray-100, #e6eaf2);cursor:not-allowed}"}},[577,"dropi-checkbox",{checked:[1540],disabled:[516]}]);function s(){"undefined"!=typeof customElements&&["dropi-checkbox"].forEach((r=>{"dropi-checkbox"===r&&(customElements.get(e(r))||customElements.define(e(r),c))}))}s();const a=c,d=s;export{a as DropiCheckbox,d as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface DropiIcon extends Components.DropiIcon, HTMLElement {}
|
|
4
|
+
export const DropiIcon: {
|
|
5
|
+
prototype: DropiIcon;
|
|
6
|
+
new (): DropiIcon;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as o,d as s}from"./p-MNma8N1x.js";const a=o,m=s;export{a as DropiIcon,m as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface DropiInput extends Components.DropiInput, HTMLElement {}
|
|
4
|
+
export const DropiInput: {
|
|
5
|
+
prototype: DropiInput;
|
|
6
|
+
new (): DropiInput;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,p as t,H as o,c as r,h as i}from"./index.js";import{d as a}from"./p-MNma8N1x.js";const s=t(class extends o{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.dropiInput=r(this,"dropiInput"),this.dropiChange=r(this,"dropiChange"),this.dropiFocus=r(this,"dropiFocus"),this.dropiBlur=r(this,"dropiBlur"),this.internals=this.attachInternals()}internals;inputId="";name="";label="";placeholder=" ";value="";maxlength;disabled=!1;required=!1;showAsterisk=!0;fixedLabel=!1;inputMode="text";passwordInput=!1;moneyFormat=!1;thousandSeparator=!1;onlyNumbers=!1;allowDecimals=!1;onlyLetters=!1;icon="";iconColor="Gray-Gray-400";invalid=!1;helperText="";showHelperOnlyOnError=!1;showPassword=!1;touched=!1;dropiInput;dropiChange;dropiFocus;dropiBlur;valueChanged(e){this.internals.setFormValue(e)}disabledChanged(e){this.internals.setValidity(e?{customError:!0}:{},e?"Field is disabled":"")}componentWillLoad(){this.internals.setFormValue(this.value??"")}handleInput(e){let t=e.target.value;this.onlyNumbers&&(t=this.filterNumbers(t)),this.onlyLetters&&(t=this.filterLetters(t)),(this.moneyFormat||this.thousandSeparator)&&(t=this.formatThousands(t,this.moneyFormat)),this.value=t,this.internals.setFormValue(t),this.dropiInput.emit(t)}handleKeyDown(e){this.onlyNumbers&&!this.isAllowedNumberKey(e)&&e.preventDefault(),this.onlyLetters&&!this.isAllowedLetterKey(e)&&e.preventDefault()}handleFocus(){this.dropiFocus.emit()}handleBlur(){this.touched=!0,this.dropiChange.emit(this.value),this.dropiBlur.emit()}togglePassword(){this.disabled||(this.showPassword=!this.showPassword)}filterNumbers(e){return e.replace(this.allowDecimals?/[^0-9.]/g:/[^0-9]/g,"")}filterLetters(e){return e.replace(/[^a-zA-ZáéíóúÁÉÍÓÚñÑüÜ\s]/g,"")}isAllowedNumberKey(e){return!!(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter","Home","End"].includes(e.key)||e.ctrlKey||e.metaKey||/^[0-9]$/.test(e.key)||this.allowDecimals&&"."===e.key)}isAllowedLetterKey(e){return!!["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter","Home","End"," "].includes(e.key)||!(!e.ctrlKey&&!e.metaKey)||/^[a-zA-ZáéíóúÁÉÍÓÚñÑüÜ]$/.test(e.key)}formatThousands(e,t){const o=e.replace(/[^0-9.]/g,""),[r,i]=o.split("."),a=r.replace(/\B(?=(\d{3})+(?!\d))/g,","),s=void 0!==i?`${a}.${i}`:a;return t?"$"+s:s}get resolvedId(){return this.inputId||this.label}get inputType(){return this.passwordInput?this.showPassword?"text":"password":"text"}get showHelper(){return!!this.helperText&&(!this.showHelperOnlyOnError||this.invalid&&this.touched)}get isInvalid(){return this.invalid&&this.touched}render(){const e=this.required&&this.showAsterisk&&!this.disabled,t=!!this.icon&&!!this.value;return i("div",{key:"4ea9c2118e6452345a2a92eedc807e6d94019784",class:{"fixed-label-container":this.fixedLabel}},this.fixedLabel&&i("div",{key:"b8c1269e9d583becd9614f6f3c28f6a2b536f18f",class:"input-label Body-S-Regular"},this.label,e&&i("span",{key:"945665772caab1a1c95f1a054dea1b8dd88287a3",class:"asterisk"}," *")),i("div",{key:"f550584dde83c907429255d9a98b8a59ff322cbb",class:"form-group"},i("div",{key:"6cc46f5822e62d59bb211e7d9eb7909ab2b833c9",class:"input-container"},t&&i("dropi-icon",{key:"c860e808ae7cd805aa9c430d52743f7eab0aaeba",class:"icon-input",name:this.icon,color:this.iconColor,width:"20px",height:"20px"}),this.passwordInput&&i("dropi-icon",{key:"ba571d4d14ec2a911a8b0bd4cdc7a8481aebe746",class:"icon-input-password",name:this.showPassword?"Eye":"Eye-crossed",width:"20px",height:"20px",color:"Gray-Gray-500",onClick:()=>this.togglePassword()}),i("input",{key:"aad18a94d94c9600236bac7c23e38b1c1c41f06a",id:this.resolvedId,class:{"form-control":!0,"form-control-valid":!this.isInvalid&&this.touched&&!!this.value,"form-control-invalid":this.isInvalid,"padding-icon":t,"text-password":this.passwordInput&&!this.showPassword,"fixed-label-input":this.fixedLabel},type:this.inputType,value:this.value,placeholder:this.fixedLabel?this.placeholder:" ",disabled:this.disabled,required:this.required,maxLength:this.maxlength,inputMode:this.inputMode,"data-cy":void 0,onInput:e=>this.handleInput(e),onKeyDown:e=>this.handleKeyDown(e),onFocus:()=>this.handleFocus(),onBlur:()=>this.handleBlur()}),!this.fixedLabel&&i("label",{key:"8ba7ea50525aa8990662d45829ba732094c41f80",class:"Body-S-Regular label-bottom",htmlFor:this.resolvedId},this.label,e&&i("span",{key:"3916d3de6392da62b8086920cd2fce3b96238416",class:"asterisk"}," *")),this.showHelper&&i("div",{key:"83e17f7d0cdb503b86fd035775e1cb45d9f41709",class:"form-control-helper"},this.isInvalid&&i("dropi-icon",{key:"4e034348270853f8a3aafbbbb938a5974076aebd",name:"Warning-circle",width:"12px",height:"12px",color:"Error-Error-500"}),i("span",{key:"7832f200ccc6f6273d65012b9e642c313399a277",class:{"disabled-helper":this.disabled,"invalid-color":this.isInvalid}},this.helperText)))))}static get formAssociated(){return!0}static get watchers(){return{value:[{valueChanged:0}],disabled:[{disabledChanged:0}]}}static get style(){return":host{display:block;width:100%;text-align:left}*,*::before,*::after{box-sizing:border-box}.fixed-label-container{display:flex;width:100%;flex-direction:column;align-items:flex-start;gap:8px;text-align:left}.input-label{color:var(--Gray-Gray-600, #475066);font-size:var(--font-size-xs, 10px);font-weight:var(--font-weight-regular, 400)}.asterisk{color:var(--Error-Error-500, #f46a6b)}.form-group{position:relative;width:100%;text-align:left}.input-container{position:relative}.icon-input{position:absolute;top:10px;left:5px;z-index:1}.icon-input-password{position:absolute;top:10px;right:13px;cursor:pointer;z-index:1}.form-control{box-sizing:border-box;width:100%;padding:var(--Size-2, 8px);border:1px solid var(--Gray-Gray-200, #c3c9d9);border-radius:var(--Border-2, 8px);background:var(--Neutral-White, #fff);font-size:var(--font-size-s, 12px);font-family:inherit;color:var(--Gray-Gray-700, #32394d);transition:border-color 0.3s ease-in-out;height:40px;outline:none;appearance:none;text-align:left}.form-control::placeholder{color:transparent;transition:color 0.2s ease-in-out}.form-control:focus::placeholder,.fixed-label-input::placeholder{color:var(--Gray-Gray-400, #858ea6)}.form-control:focus{border-color:var(--Info-Info-500, #50a5f1)}.form-control-valid{border-color:var(--Gray-Gray-400, #858ea6) !important;color:var(--Gray-Gray-600, #475066)}.form-control-invalid{border-color:var(--Error-Error-500, #f46a6b) !important;color:var(--Gray-Gray-600, #475066)}.form-control:disabled{border-color:var(--Gray-Gray-200, #c3c9d9) !important;color:var(--Gray-Gray-400, #858ea6);background-color:var(--Gray-Gray-50, #f7f8fa);cursor:not-allowed}.padding-icon{padding-left:28px}.text-password{-webkit-text-security:disc;text-security:disc}label.label-bottom{position:absolute;font-weight:var(--font-weight-regular, 400);top:10px;font-size:var(--font-size-s, 12px);color:var(--Gray-Gray-500, #69738c);left:10px;transition:all 0.2s ease-in-out;pointer-events:none;overflow:hidden;width:90%;white-space:nowrap}.form-control:focus+label.label-bottom,.form-control:not(:placeholder-shown)+label.label-bottom{top:-22px;left:0;font-size:var(--font-size-xs, 10px);color:var(--Gray-Gray-600, #475066);width:unset}.form-control:disabled+label.label-bottom{color:var(--Gray-Gray-400, #858ea6)}.form-control-helper{display:flex;position:absolute;top:100%;left:0;gap:4px;align-items:center;margin-top:4px}.form-control-helper span{display:block;color:var(--Gray-Gray-600, #475066);font-size:var(--font-size-xs, 10px)}.invalid-color{color:var(--Error-Error-500, #f46a6b) !important}.disabled-helper{color:var(--Gray-Gray-400, #858ea6) !important}"}},[577,"dropi-input",{inputId:[1,"input-id"],name:[1],label:[1],placeholder:[1],value:[1025],maxlength:[2],disabled:[516],required:[516],showAsterisk:[4,"show-asterisk"],fixedLabel:[4,"fixed-label"],inputMode:[1,"input-mode"],passwordInput:[4,"password-input"],moneyFormat:[4,"money-format"],thousandSeparator:[4,"thousand-separator"],onlyNumbers:[4,"only-numbers"],allowDecimals:[4,"allow-decimals"],onlyLetters:[4,"only-letters"],icon:[1],iconColor:[1,"icon-color"],invalid:[4],helperText:[1,"helper-text"],showHelperOnlyOnError:[4,"show-helper-only-on-error"],showPassword:[32],touched:[32]},void 0,{value:[{valueChanged:0}],disabled:[{disabledChanged:0}]}]);function l(){"undefined"!=typeof customElements&&["dropi-input","dropi-icon"].forEach((t=>{switch(t){case"dropi-input":customElements.get(e(t))||customElements.define(e(t),s);break;case"dropi-icon":customElements.get(e(t))||a()}}))}l();const n=s,d=l;export{n as DropiInput,d as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface DropiRadioButton extends Components.DropiRadioButton, HTMLElement {}
|
|
4
|
+
export const DropiRadioButton: {
|
|
5
|
+
prototype: DropiRadioButton;
|
|
6
|
+
new (): DropiRadioButton;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,p as t,H as r,c as i,h as o}from"./index.js";const n=t(class extends r{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.dropiChange=i(this,"dropiChange")}label="";name="radio";inputId="radioButton";checked=!1;resetTrigger=!1;dropiChange;onResetTrigger(e){e&&(this.checked=!1)}handleChange(e){this.checked=e.target.checked,this.dropiChange.emit(e)}render(){return o("div",{key:"3b31699bf088bee52465981074c0aea48b6fe112",class:"dropi-radio-button"},o("label",{key:"072d19bd9c88739b849db0e264c65183eaab2132",htmlFor:this.inputId},o("input",{key:"82d1600002e9dc2795cdc5c731997742adc8e2db",id:this.inputId,type:"radio",name:this.name,checked:this.checked,onChange:e=>this.handleChange(e)}),this.label))}static get formAssociated(){return!0}static get watchers(){return{resetTrigger:[{onResetTrigger:0}]}}static get style(){return":host{display:inline-block}*,*::before,*::after{box-sizing:border-box}.dropi-radio-button{display:flex;align-items:center;justify-content:flex-start;gap:20px}label{display:flex;align-items:center;gap:8px;cursor:pointer;color:var(--Gray-Gray-700, #32394d);font-size:var(--font-size-s, 12px);font-weight:var(--font-weight-regular, 400);line-height:1.5}input[type='radio']{appearance:none;width:20px;height:20px;border:2px solid var(--Gray-Gray-200, #c3c9d9);border-radius:50%;background-color:transparent;position:relative;cursor:pointer;outline:none;flex-shrink:0;display:flex;justify-content:center;align-items:center}input[type='radio']::before{content:'';position:absolute;top:3px;left:3px;width:10px;height:10px;background-color:var(--Primary-Primary-400, #f7b46f);border-radius:50%;display:none}input[type='radio']:checked{border:2px solid var(--Primary-Primary-500, #f49a3d)}input[type='radio']:checked::before{display:block}"}},[577,"dropi-radio-button",{label:[1],name:[1],inputId:[1,"input-id"],checked:[1540],resetTrigger:[4,"reset-trigger"]},void 0,{resetTrigger:[{onResetTrigger:0}]}]);function a(){"undefined"!=typeof customElements&&["dropi-radio-button"].forEach((t=>{"dropi-radio-button"===t&&(customElements.get(e(t))||customElements.define(e(t),n))}))}a();const s=n,d=a;export{s as DropiRadioButton,d as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface DropiSelect extends Components.DropiSelect, HTMLElement {}
|
|
4
|
+
export const DropiSelect: {
|
|
5
|
+
prototype: DropiSelect;
|
|
6
|
+
new (): DropiSelect;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|