@dropi/ui 0.1.43 → 0.1.44
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/dropi-button.cjs.entry.js +19 -2
- package/dist/cjs/dropi-checkbox.cjs.entry.js +23 -2
- package/dist/cjs/dropi-country-selector.cjs.entry.js +15 -2
- package/dist/cjs/dropi-date-picker.cjs.entry.js +40 -4
- package/dist/cjs/dropi-input_3.cjs.entry.js +3 -3
- package/dist/cjs/dropi-otp-send-code.cjs.entry.js +22 -2
- package/dist/cjs/dropi-phone-input.cjs.entry.js +25 -2
- package/dist/cjs/dropi-radio-button.cjs.entry.js +18 -1
- package/dist/cjs/dropi-select.cjs.entry.js +1 -1
- package/dist/cjs/dropi-switch.cjs.entry.js +22 -1
- package/dist/cjs/dropi-text-area.cjs.entry.js +3 -3
- package/dist/cjs/dropi-ui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/dropi-button/dropi-button.js +39 -2
- package/dist/collection/components/dropi-checkbox/dropi-checkbox.js +38 -2
- package/dist/collection/components/dropi-country-selector/dropi-country-selector.js +29 -2
- package/dist/collection/components/dropi-date-picker/dropi-date-picker.js +55 -4
- package/dist/collection/components/dropi-input/dropi-input.js +4 -4
- package/dist/collection/components/dropi-otp-send-code/dropi-otp-send-code.js +36 -2
- package/dist/collection/components/dropi-phone-input/dropi-phone-input.js +39 -2
- package/dist/collection/components/dropi-radio-button/dropi-radio-button.js +13 -2
- package/dist/collection/components/dropi-select/dropi-select.js +2 -2
- package/dist/collection/components/dropi-switch/dropi-switch.js +37 -1
- package/dist/collection/components/dropi-text-area/dropi-text-area.js +4 -4
- package/dist/components/dropi-alert-modal.js +1 -1
- package/dist/components/dropi-button.js +1 -1
- package/dist/components/dropi-card-checkbox.js +1 -1
- package/dist/components/dropi-card-section.js +1 -1
- package/dist/components/dropi-checkbox-selection-list.js +1 -1
- package/dist/components/dropi-checkbox.js +1 -1
- package/dist/components/dropi-country-selector.js +1 -1
- package/dist/components/dropi-date-picker.js +1 -1
- package/dist/components/dropi-dropdown.js +1 -1
- package/dist/components/dropi-empty-state.js +1 -1
- package/dist/components/dropi-file-upload.js +1 -1
- package/dist/components/dropi-input.js +1 -1
- package/dist/components/dropi-otp-send-code.js +1 -1
- package/dist/components/dropi-phone-input.js +1 -1
- package/dist/components/dropi-radio-button.js +1 -1
- package/dist/components/dropi-search.js +1 -1
- package/dist/components/dropi-select.js +1 -1
- package/dist/components/dropi-switch.js +1 -1
- package/dist/components/dropi-table.js +1 -1
- package/dist/components/dropi-text-area.js +1 -1
- package/dist/components/p-CCZ6rIo5.js +1 -0
- package/dist/components/p-Dd1g1gjR.js +1 -0
- package/dist/components/p-Dnx3uXgo.js +1 -0
- package/dist/components/p-Qrac2GRu.js +1 -0
- package/dist/dropi-ui/dropi-button.entry.js +19 -2
- package/dist/dropi-ui/dropi-button.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-checkbox.entry.js +23 -2
- package/dist/dropi-ui/dropi-checkbox.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-country-selector.entry.js +15 -2
- package/dist/dropi-ui/dropi-country-selector.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-date-picker.entry.js +40 -4
- package/dist/dropi-ui/dropi-date-picker.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-input.entry.js +3 -3
- package/dist/dropi-ui/dropi-input.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-otp-send-code.entry.js +22 -2
- package/dist/dropi-ui/dropi-otp-send-code.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-phone-input.entry.js +25 -2
- package/dist/dropi-ui/dropi-phone-input.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-radio-button.entry.js +18 -1
- package/dist/dropi-ui/dropi-radio-button.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-select.entry.js +1 -1
- package/dist/dropi-ui/dropi-select.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-switch.entry.js +22 -1
- package/dist/dropi-ui/dropi-switch.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-text-area.entry.js +3 -3
- package/dist/dropi-ui/dropi-text-area.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-ui.esm.js +1 -1
- package/dist/dropi-ui/p-09462f7b.entry.js +1 -0
- package/dist/dropi-ui/p-42a85ce5.entry.js +1 -0
- package/dist/dropi-ui/p-43e21ed8.entry.js +1 -0
- package/dist/dropi-ui/p-532136cc.entry.js +1 -0
- package/dist/dropi-ui/p-9a569a4e.entry.js +1 -0
- package/dist/dropi-ui/p-b2e8c0e2.entry.js +1 -0
- package/dist/dropi-ui/p-bc6bb893.entry.js +1 -0
- package/dist/dropi-ui/p-c08b8995.entry.js +1 -0
- package/dist/dropi-ui/p-c6926604.entry.js +1 -0
- package/dist/dropi-ui/p-eaa10fe8.entry.js +1 -0
- package/dist/dropi-ui/p-fb4856ea.entry.js +1 -0
- package/dist/esm/dropi-button.entry.js +19 -2
- package/dist/esm/dropi-checkbox.entry.js +23 -2
- package/dist/esm/dropi-country-selector.entry.js +15 -2
- package/dist/esm/dropi-date-picker.entry.js +40 -4
- package/dist/esm/dropi-input_3.entry.js +3 -3
- package/dist/esm/dropi-otp-send-code.entry.js +22 -2
- package/dist/esm/dropi-phone-input.entry.js +25 -2
- package/dist/esm/dropi-radio-button.entry.js +18 -1
- package/dist/esm/dropi-select.entry.js +1 -1
- package/dist/esm/dropi-switch.entry.js +22 -1
- package/dist/esm/dropi-text-area.entry.js +3 -3
- package/dist/esm/dropi-ui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/dropi-button/dropi-button.d.ts +4 -0
- package/dist/types/components/dropi-checkbox/dropi-checkbox.d.ts +5 -0
- package/dist/types/components/dropi-country-selector/dropi-country-selector.d.ts +3 -0
- package/dist/types/components/dropi-date-picker/dropi-date-picker.d.ts +6 -0
- package/dist/types/components/dropi-otp-send-code/dropi-otp-send-code.d.ts +3 -0
- package/dist/types/components/dropi-phone-input/dropi-phone-input.d.ts +5 -0
- package/dist/types/components/dropi-radio-button/dropi-radio-button.d.ts +3 -0
- package/dist/types/components/dropi-switch/dropi-switch.d.ts +5 -0
- package/dist/types/components.d.ts +109 -4
- package/hydrate/index.js +218 -43
- package/hydrate/index.mjs +218 -43
- package/package.json +1 -1
- package/readme.md +36 -0
|
@@ -10,12 +10,18 @@ const DAYS_ES = ['Do', 'Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sa'];
|
|
|
10
10
|
* Emits ISO date strings (YYYY-MM-DD).
|
|
11
11
|
*/
|
|
12
12
|
export class DropiDatePicker {
|
|
13
|
+
internals;
|
|
14
|
+
/** Name for native form submission */
|
|
15
|
+
name = '';
|
|
13
16
|
/** Selected date (ISO string, single mode) - matches Angular 'selectedDate' */
|
|
14
17
|
selectedDate = '';
|
|
15
18
|
/** Range start date (ISO string, range mode) */
|
|
16
19
|
startDate = '';
|
|
17
20
|
/** Range end date (ISO string, range mode) */
|
|
18
21
|
endDate = '';
|
|
22
|
+
valueChanged() {
|
|
23
|
+
this.updateFormValue();
|
|
24
|
+
}
|
|
19
25
|
/** Enable range selection - matches Angular selectionMode */
|
|
20
26
|
selectionMode = 'single';
|
|
21
27
|
/** Min selectable date (ISO string) */
|
|
@@ -48,6 +54,17 @@ export class DropiDatePicker {
|
|
|
48
54
|
dropiClosePanel;
|
|
49
55
|
/** Emitted when range selected */
|
|
50
56
|
dropiRangeChange;
|
|
57
|
+
componentWillLoad() {
|
|
58
|
+
this.updateFormValue();
|
|
59
|
+
}
|
|
60
|
+
updateFormValue() {
|
|
61
|
+
if (this.selectionMode === 'range') {
|
|
62
|
+
this.internals.setFormValue(this.startDate && this.endDate ? `${this.startDate},${this.endDate}` : '');
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
this.internals.setFormValue(this.selectedDate || '');
|
|
66
|
+
}
|
|
67
|
+
}
|
|
51
68
|
get displayValue() {
|
|
52
69
|
if (this.selectionMode === 'range') {
|
|
53
70
|
if (this.startDate && this.endDate)
|
|
@@ -167,12 +184,12 @@ export class DropiDatePicker {
|
|
|
167
184
|
render() {
|
|
168
185
|
const days = this.buildDays();
|
|
169
186
|
const today = new Date().toISOString().slice(0, 10);
|
|
170
|
-
return (h("div", { key: '
|
|
187
|
+
return (h("div", { key: '97a96b56b0e8ae551f747bad4a3459a1f4945411', class: "dp-wrap" }, this.label && h("label", { key: 'a1792032ab9ae2dbe574f50b7a537df687eae40c', class: "dp-label" }, this.label), h("button", { key: '4237c2b988f1e9fbaa77dc2a989964216e3fe902', class: {
|
|
171
188
|
'dp-trigger': true,
|
|
172
189
|
'dp-trigger--disabled': this.disabled,
|
|
173
190
|
'dp-trigger--invalid': this.isInvalid,
|
|
174
191
|
'dp-trigger--loading': this.loading
|
|
175
|
-
}, onClick: () => this.open ? this.open = false : this.open_(), disabled: this.disabled || this.loading, type: "button" }, h("dropi-icon", { key: '
|
|
192
|
+
}, onClick: () => this.open ? this.open = false : this.open_(), disabled: this.disabled || this.loading, type: "button" }, h("dropi-icon", { key: '39591fedb92b92e6507b564fc8c145711f1a21b1', name: "Calendar", iconWidth: "16px", iconHeight: "16px", color: "Gray-Gray-400" }), h("span", { key: '305e3f81d64c01603687d53edc59e1d19ef06c3c', class: { 'dp-trigger__value': true, 'dp-trigger__placeholder': !this.displayValue } }, this.displayValue || this.placeholder), h("dropi-icon", { key: '13feb346ad7b07a7e2f208e299f62a8261a97655', name: "Arrow-Down-2", iconWidth: "12px", iconHeight: "12px", color: "Gray-Gray-400" })), this.open && (h("div", { key: '4cdf8a69422a0b54d0f7c1a6711a683dab7d1f34', class: "dp-popup" }, h("div", { key: '0c6fb31094003c66c5b471e738dd75e7b865401f', class: "dp-nav" }, h("button", { key: '4fa24f9450cf6c5e888cea374619e14245c0c005', class: "dp-nav__btn", onClick: () => this.prevMonth(), type: "button" }, h("dropi-icon", { key: '2196f85700b252d4f83536f11ed197c083fc45ec', name: "Arrow-Left-2", iconWidth: "16px", iconHeight: "16px", color: "Gray-Gray-600" })), h("span", { key: '01619de7c5218b506f75234745f3184af813a491', class: "dp-nav__title" }, h("span", { key: '8074e7deeb6c102bad7f1911739e785187783a7c' }, MONTHS_ES[this.viewMonth]), h("span", { key: '69e9c3b41361e293a843f911b5bcf4690995d2b4' }, this.viewYear)), h("button", { key: '51c0ad3da96835736170fbf94338fd70c942c3d2', class: "dp-nav__btn", onClick: () => this.nextMonth(), type: "button" }, h("dropi-icon", { key: '24eb4385639c9a71f5312f32b33b36593c2b0259', name: "Arrow-Right-2", iconWidth: "16px", iconHeight: "16px", color: "Gray-Gray-600" }))), h("div", { key: 'c18cecd81af38b3a6f23402501011c09b8b453d7', class: "dp-grid" }, DAYS_ES.map(d => (h("div", { class: "dp-day-header" }, d))), days.map(({ iso, day, currentMonth }) => {
|
|
176
193
|
const isSelected = this.selectionMode !== 'range'
|
|
177
194
|
? iso === this.selectedDate
|
|
178
195
|
: iso === this.startDate || iso === this.endDate;
|
|
@@ -194,12 +211,12 @@ export class DropiDatePicker {
|
|
|
194
211
|
if (this.selectionMode === 'range' && this.startDate && !this.endDate)
|
|
195
212
|
this.hoverDate = iso;
|
|
196
213
|
}, onMouseLeave: () => this.hoverDate = '' }, day));
|
|
197
|
-
})), h("div", { key: '
|
|
214
|
+
})), h("div", { key: '594f280cb269c32ac3a129401e13b710af1a7c7e', class: "dp-footer" }, h("button", { key: '6028ef84bc17f0d1bb0fd587a991698a8fc69338', class: "dp-footer__clear", type: "button", onClick: () => {
|
|
198
215
|
this.selectedDate = '';
|
|
199
216
|
this.startDate = '';
|
|
200
217
|
this.endDate = '';
|
|
201
218
|
this.open = false;
|
|
202
|
-
} }, "Limpiar"), h("button", { key: '
|
|
219
|
+
} }, "Limpiar"), h("button", { key: 'ab01840a18d657621205d4fba69cc53feb474d11', class: "dp-footer__today", type: "button", onClick: () => {
|
|
203
220
|
if (this.selectionMode !== 'range') {
|
|
204
221
|
this.selectedDate = today;
|
|
205
222
|
this.open = false;
|
|
@@ -213,6 +230,7 @@ export class DropiDatePicker {
|
|
|
213
230
|
}
|
|
214
231
|
static get is() { return "dropi-date-picker"; }
|
|
215
232
|
static get encapsulation() { return "shadow"; }
|
|
233
|
+
static get formAssociated() { return true; }
|
|
216
234
|
static get originalStyleUrls() {
|
|
217
235
|
return {
|
|
218
236
|
"$": ["dropi-date-picker.css"]
|
|
@@ -225,6 +243,26 @@ export class DropiDatePicker {
|
|
|
225
243
|
}
|
|
226
244
|
static get properties() {
|
|
227
245
|
return {
|
|
246
|
+
"name": {
|
|
247
|
+
"type": "string",
|
|
248
|
+
"mutable": false,
|
|
249
|
+
"complexType": {
|
|
250
|
+
"original": "string",
|
|
251
|
+
"resolved": "string",
|
|
252
|
+
"references": {}
|
|
253
|
+
},
|
|
254
|
+
"required": false,
|
|
255
|
+
"optional": false,
|
|
256
|
+
"docs": {
|
|
257
|
+
"tags": [],
|
|
258
|
+
"text": "Name for native form submission"
|
|
259
|
+
},
|
|
260
|
+
"getter": false,
|
|
261
|
+
"setter": false,
|
|
262
|
+
"reflect": true,
|
|
263
|
+
"attribute": "name",
|
|
264
|
+
"defaultValue": "''"
|
|
265
|
+
},
|
|
228
266
|
"selectedDate": {
|
|
229
267
|
"type": "string",
|
|
230
268
|
"mutable": true,
|
|
@@ -504,6 +542,18 @@ export class DropiDatePicker {
|
|
|
504
542
|
}];
|
|
505
543
|
}
|
|
506
544
|
static get elementRef() { return "el"; }
|
|
545
|
+
static get watchers() {
|
|
546
|
+
return [{
|
|
547
|
+
"propName": "selectedDate",
|
|
548
|
+
"methodName": "valueChanged"
|
|
549
|
+
}, {
|
|
550
|
+
"propName": "startDate",
|
|
551
|
+
"methodName": "valueChanged"
|
|
552
|
+
}, {
|
|
553
|
+
"propName": "endDate",
|
|
554
|
+
"methodName": "valueChanged"
|
|
555
|
+
}];
|
|
556
|
+
}
|
|
507
557
|
static get listeners() {
|
|
508
558
|
return [{
|
|
509
559
|
"name": "click",
|
|
@@ -513,4 +563,5 @@ export class DropiDatePicker {
|
|
|
513
563
|
"passive": false
|
|
514
564
|
}];
|
|
515
565
|
}
|
|
566
|
+
static get attachInternalsMemberName() { return "internals"; }
|
|
516
567
|
}
|
|
@@ -151,6 +151,7 @@ export class DropiInput {
|
|
|
151
151
|
this.value = val;
|
|
152
152
|
this.internals.setFormValue(val);
|
|
153
153
|
this.dropiInput.emit(val);
|
|
154
|
+
this.dropiChange.emit(val);
|
|
154
155
|
}
|
|
155
156
|
handleKeyDown(e) {
|
|
156
157
|
if ((this.isNumericInput || this.isMoneyInput || this.isThousandSeparator) && !this.isAllowedNumberKey(e)) {
|
|
@@ -165,7 +166,6 @@ export class DropiInput {
|
|
|
165
166
|
}
|
|
166
167
|
handleBlur() {
|
|
167
168
|
this.touched = true;
|
|
168
|
-
this.dropiChange.emit(this.value);
|
|
169
169
|
this.dropiBlur.emit();
|
|
170
170
|
}
|
|
171
171
|
togglePassword() {
|
|
@@ -231,14 +231,14 @@ export class DropiInput {
|
|
|
231
231
|
render() {
|
|
232
232
|
const showObligatoryAsterisk = this.required && this.showObligatoryAsterisk && !this.disabled;
|
|
233
233
|
const showIconInline = !!this.icon;
|
|
234
|
-
return (h("div", { key: '
|
|
234
|
+
return (h("div", { key: '6af757e1d86bfe96d471e9cbed258a50727ae190', class: { 'fixed-label-container': this.fixedLabel } }, this.fixedLabel && (h("div", { key: 'e88bf81fd2b79933e386c2e5fa38f57d85cfe836', class: "input-label Body-S-Regular" }, this.label, showObligatoryAsterisk && h("span", { key: 'be8ec1b0d3ef624ca22e58ae072917ad2ecc79fb', class: "asterisk" }, " *"))), h("div", { key: '4806c0d250f00bb08788d9d6aa935ca15f2aa826', class: "form-group" }, h("div", { key: 'b9fa243d299bcd165458947d6695fcc845764276', class: { 'input-container': true, 'input-container--has-icon': showIconInline } }, showIconInline && (h("dropi-icon", { key: '92b3cf11803745784f13e908ea88992f76c74473', class: "icon-input", name: this.icon, color: this.iconColor, iconWidth: "20px", iconHeight: "20px", style: { width: '20px', height: '20px' } })), this.passwordInput && (h("dropi-icon", { key: 'c7dc725d577a6d4afb7f87c8b53b16c621de9e86', class: "icon-input-password", name: this.showPassword ? 'Eye' : 'Eye-crossed', iconWidth: "20px", iconHeight: "20px", style: { width: '20px', height: '20px' }, color: "Gray-Gray-500", onClick: () => this.togglePassword() })), h("input", { key: '8146ae1794cbe1f200bb681358c7319f10faab3c', id: this.resolvedId, class: {
|
|
235
235
|
'form-control': true,
|
|
236
236
|
'form-control-valid': !this.isInvalid && this.touched && !!this.value,
|
|
237
237
|
'form-control-invalid': this.isInvalid,
|
|
238
238
|
'padding-icon': showIconInline,
|
|
239
239
|
'text-password': this.passwordInput && !this.showPassword,
|
|
240
240
|
'fixed-label-input': this.fixedLabel,
|
|
241
|
-
}, 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": undefined, onInput: e => this.handleInput(e), onKeyDown: e => this.handleKeyDown(e), onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur() }), !this.fixedLabel && (h("label", { key: '
|
|
241
|
+
}, 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": undefined, onInput: e => this.handleInput(e), onKeyDown: e => this.handleKeyDown(e), onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur() }), !this.fixedLabel && (h("label", { key: '005d15af6b50b2cb2d47ac8381a722794eb273e5', class: "Body-S-Regular label-bottom", htmlFor: this.resolvedId }, this.label, showObligatoryAsterisk && h("span", { key: 'ad56df877cff3df8a801cdfcb607d9af02f7465a', class: "asterisk" }, " *"))), this.showHelper && (h("div", { key: '76e858c13a798f69b2d20ee9908f17531568dad1', class: "form-control-helper" }, this.isInvalid && h("dropi-icon", { key: '3e42ffb4db7444ebfb49cc9c6720d5a9d02b2860', name: "Warning-circle", iconWidth: "12px", iconHeight: "12px", color: "Error-Error-500" }), h("span", { key: '5e970903eb51ca6b72a43bef0edf6ef149443247', class: {
|
|
242
242
|
'disabled-helper': this.disabled,
|
|
243
243
|
'invalid-color': this.isInvalid,
|
|
244
244
|
} }, this.textHelper)))))));
|
|
@@ -294,7 +294,7 @@ export class DropiInput {
|
|
|
294
294
|
},
|
|
295
295
|
"getter": false,
|
|
296
296
|
"setter": false,
|
|
297
|
-
"reflect":
|
|
297
|
+
"reflect": true,
|
|
298
298
|
"attribute": "name",
|
|
299
299
|
"defaultValue": "''"
|
|
300
300
|
},
|
|
@@ -5,6 +5,9 @@ const RESEND_SECONDS = 30;
|
|
|
5
5
|
* OTP input with configurable length, countdown timer and resend capability.
|
|
6
6
|
*/
|
|
7
7
|
export class DropiOtpSendCode {
|
|
8
|
+
internals;
|
|
9
|
+
/** Name for native form submission */
|
|
10
|
+
name = '';
|
|
8
11
|
/** Delivery method label */
|
|
9
12
|
engine = 'email';
|
|
10
13
|
/** Contact info (email/phone to show in label) */
|
|
@@ -36,6 +39,7 @@ export class DropiOtpSendCode {
|
|
|
36
39
|
componentWillLoad() {
|
|
37
40
|
this.digits = Array(this.digitsCount).fill('');
|
|
38
41
|
this.digitStates = Array(this.digitsCount).fill('idle');
|
|
42
|
+
this.internals.setFormValue('');
|
|
39
43
|
}
|
|
40
44
|
componentDidLoad() { this.startCountdown(); }
|
|
41
45
|
disconnectedCallback() { clearInterval(this.timer); }
|
|
@@ -63,9 +67,13 @@ export class DropiOtpSendCode {
|
|
|
63
67
|
this.inputs[index + 1]?.focus();
|
|
64
68
|
if (newDigits.every(d => d !== '')) {
|
|
65
69
|
const finalCode = newDigits.join('');
|
|
70
|
+
this.internals.setFormValue(finalCode);
|
|
66
71
|
this.codeCompleted.emit(finalCode);
|
|
67
72
|
this.codeAccepted.emit(finalCode);
|
|
68
73
|
}
|
|
74
|
+
else {
|
|
75
|
+
this.internals.setFormValue(newDigits.join(''));
|
|
76
|
+
}
|
|
69
77
|
}
|
|
70
78
|
handleKeyDown(e, index) {
|
|
71
79
|
if (e.key === 'Backspace' && !this.digits[index] && index > 0) {
|
|
@@ -82,23 +90,28 @@ export class DropiOtpSendCode {
|
|
|
82
90
|
this.inputs[Math.min(text.length, this.digitsCount - 1)]?.focus();
|
|
83
91
|
if (newDigits.every(d => d !== '')) {
|
|
84
92
|
const finalCode = newDigits.join('');
|
|
93
|
+
this.internals.setFormValue(finalCode);
|
|
85
94
|
this.codeCompleted.emit(finalCode);
|
|
86
95
|
this.codeAccepted.emit(finalCode);
|
|
87
96
|
}
|
|
97
|
+
else {
|
|
98
|
+
this.internals.setFormValue(newDigits.join(''));
|
|
99
|
+
}
|
|
88
100
|
}
|
|
89
101
|
render() {
|
|
90
102
|
const engineLabel = this.engine === 'sms' ? 'SMS' : this.engine === '2fa' ? 'autenticador' : 'correo';
|
|
91
|
-
return (h("div", { key: '
|
|
103
|
+
return (h("div", { key: 'ee2e6766c4b220a1a12b8734747138cf2351a0d8', class: "otp" }, this.showLabelContact && (h("p", { key: '87f34e3b13c0e16e584cc03ea8c5a35e462784b1', class: "otp__label" }, "Ingresa el c\u00F3digo enviado a tu ", engineLabel, this.labelContact && h("strong", { key: '6c9d0c73340ff8dab1730b5d6c9cc0431f3ff21c' }, " ", this.labelContact))), h("div", { key: 'd82904db02da1da5f863bb86cef65b0da166ff0c', class: "otp__inputs", onPaste: (e) => this.handlePaste(e) }, this.digits.map((_, i) => (h("input", { key: i, ref: (el) => {
|
|
92
104
|
if (el)
|
|
93
105
|
this.inputs[i] = el;
|
|
94
106
|
}, class: {
|
|
95
107
|
'otp__digit': true,
|
|
96
108
|
'otp__digit--filled': this.digitStates[i] === 'filled',
|
|
97
109
|
'otp__digit--error': this.error,
|
|
98
|
-
}, type: "text", inputMode: "numeric", maxLength: 1, value: this.digits[i] ?? '', onInput: (e) => this.handleInput(e, i), onKeyDown: (e) => this.handleKeyDown(e, i) })))), this.error && this.errorMessage && (h("p", { key: '
|
|
110
|
+
}, type: "text", inputMode: "numeric", maxLength: 1, value: this.digits[i] ?? '', onInput: (e) => this.handleInput(e, i), onKeyDown: (e) => this.handleKeyDown(e, i) })))), this.error && this.errorMessage && (h("p", { key: '7629619d5b2c4e8f38e2c2bc93ab134242b8e079', class: "otp__error" }, this.errorMessage)), h("div", { key: 'ea5472d4c55f1cdc30304e9e9bcaacf303ba4501', class: "otp__resend" }, this.canResend ? (h("button", { class: "otp__resend-btn", onClick: () => { this.startCountdown(); this.dropiResend.emit(); } }, "Reenviar c\u00F3digo")) : (h("span", { class: "otp__countdown" }, "Reenviar en ", this.countdown, "s")))));
|
|
99
111
|
}
|
|
100
112
|
static get is() { return "dropi-otp-send-code"; }
|
|
101
113
|
static get encapsulation() { return "shadow"; }
|
|
114
|
+
static get formAssociated() { return true; }
|
|
102
115
|
static get originalStyleUrls() {
|
|
103
116
|
return {
|
|
104
117
|
"$": ["dropi-otp-send-code.css"]
|
|
@@ -111,6 +124,26 @@ export class DropiOtpSendCode {
|
|
|
111
124
|
}
|
|
112
125
|
static get properties() {
|
|
113
126
|
return {
|
|
127
|
+
"name": {
|
|
128
|
+
"type": "string",
|
|
129
|
+
"mutable": false,
|
|
130
|
+
"complexType": {
|
|
131
|
+
"original": "string",
|
|
132
|
+
"resolved": "string",
|
|
133
|
+
"references": {}
|
|
134
|
+
},
|
|
135
|
+
"required": false,
|
|
136
|
+
"optional": false,
|
|
137
|
+
"docs": {
|
|
138
|
+
"tags": [],
|
|
139
|
+
"text": "Name for native form submission"
|
|
140
|
+
},
|
|
141
|
+
"getter": false,
|
|
142
|
+
"setter": false,
|
|
143
|
+
"reflect": true,
|
|
144
|
+
"attribute": "name",
|
|
145
|
+
"defaultValue": "''"
|
|
146
|
+
},
|
|
114
147
|
"engine": {
|
|
115
148
|
"type": "string",
|
|
116
149
|
"mutable": false,
|
|
@@ -276,4 +309,5 @@ export class DropiOtpSendCode {
|
|
|
276
309
|
"methodName": "handleDigitsCountChange"
|
|
277
310
|
}];
|
|
278
311
|
}
|
|
312
|
+
static get attachInternalsMemberName() { return "internals"; }
|
|
279
313
|
}
|
|
@@ -100,6 +100,9 @@ const COUNTRIES = [
|
|
|
100
100
|
*/
|
|
101
101
|
export class DropiPhoneInput {
|
|
102
102
|
el;
|
|
103
|
+
internals;
|
|
104
|
+
/** Name for native form submission */
|
|
105
|
+
name = '';
|
|
103
106
|
/** Initial country dial code (e.g. "57") — matches Angular 'CodArea' setter */
|
|
104
107
|
codArea = '57';
|
|
105
108
|
/** Phone number value — matches Angular 'ngModelPhone' */
|
|
@@ -134,6 +137,10 @@ export class DropiPhoneInput {
|
|
|
134
137
|
dropiChangeSelect;
|
|
135
138
|
codAreaChanged() {
|
|
136
139
|
this.ngModelPhone = '';
|
|
140
|
+
this.updateFormValue();
|
|
141
|
+
}
|
|
142
|
+
ngModelPhoneChanged() {
|
|
143
|
+
this.updateFormValue();
|
|
137
144
|
}
|
|
138
145
|
selectedOptionChanged(val) {
|
|
139
146
|
if (!val)
|
|
@@ -145,6 +152,11 @@ export class DropiPhoneInput {
|
|
|
145
152
|
componentWillLoad() {
|
|
146
153
|
if (this.selectedOption)
|
|
147
154
|
this.selectedOptionChanged(this.selectedOption);
|
|
155
|
+
this.updateFormValue();
|
|
156
|
+
}
|
|
157
|
+
updateFormValue() {
|
|
158
|
+
const fullValue = this.ngModelPhone ? `+${this.codArea}${this.ngModelPhone}` : '';
|
|
159
|
+
this.internals.setFormValue(fullValue);
|
|
148
160
|
}
|
|
149
161
|
get selectedCountry() {
|
|
150
162
|
const cleanCodArea = (this.codArea ?? '57').replace('+', '');
|
|
@@ -171,13 +183,14 @@ export class DropiPhoneInput {
|
|
|
171
183
|
render() {
|
|
172
184
|
const country = this.selectedCountry;
|
|
173
185
|
const isInvalid = this.isValidPhone === false;
|
|
174
|
-
return (h("div", { key: '
|
|
186
|
+
return (h("div", { key: '1634a703f734cd5db7b5d7acf83f403ea07962a3', class: "phone-wrap" }, h("div", { key: 'a9ed4a17b4a01893fc22d051241dcd494fa2e66d', class: "phone-input-container" }, h("div", { key: '6a50121fbb8939eac54035a314c340137aae63d5', class: "custom-select" }, h("button", { key: '0157b468dab13e23f83b9528ec235bc61be91733', type: "button", class: { 'select-button': true, 'select-invalid': isInvalid }, disabled: this.disabledInput, onClick: () => {
|
|
175
187
|
if (!this.disabledInput)
|
|
176
188
|
this.open = !this.open;
|
|
177
|
-
} }, h("span", { key: '
|
|
189
|
+
} }, h("span", { key: 'b174ec714c415964d09f4661f58a1a62e8c80653', style: { display: 'flex', gap: '0.5rem', alignItems: 'center' } }, h("img", { key: 'f4c62db877a54bd395b756926918b8ff16511a2a', src: `https://flagsapi.com/${country.flag}/flat/24.png`, alt: "flag" }), country.code), h("dropi-icon", { key: '809f64bed4cccd911110c9e8e52752554b0d8a86', name: this.open ? 'Dropdown-up' : 'Dropdown-down', iconWidth: "14px", iconHeight: "14px", color: "Gray-Gray-500" })), h("ul", { key: 'b4dea28807780b086ba15161cee3e417efb2f2a1', class: { 'select-dropdown': true, 'expanded-select': this.open, 'collapsed-select': !this.open } }, COUNTRIES.map(option => (h("li", null, h("button", { type: "button", class: "option", onMouseDown: (e) => { e.preventDefault(); this.selectCountry(option); } }, h("img", { src: `https://flagsapi.com/${option.flag}/flat/24.png`, alt: option.flag }), option.code)))))), h("input", { key: '4e1113fedf25b9c91d2aff815d6c862a7d47d072', id: "phone-input", type: "tel", inputmode: "numeric", class: { 'form-control': true, 'is-invalid': isInvalid }, placeholder: this.phoneNumberPlaceholder, value: this.ngModelPhone, disabled: this.disabledInput, maxLength: country.maxLength, onInput: (e) => this.handleInput(e) }))));
|
|
178
190
|
}
|
|
179
191
|
static get is() { return "dropi-phone-input"; }
|
|
180
192
|
static get encapsulation() { return "shadow"; }
|
|
193
|
+
static get formAssociated() { return true; }
|
|
181
194
|
static get originalStyleUrls() {
|
|
182
195
|
return {
|
|
183
196
|
"$": ["dropi-phone-input.css"]
|
|
@@ -190,6 +203,26 @@ export class DropiPhoneInput {
|
|
|
190
203
|
}
|
|
191
204
|
static get properties() {
|
|
192
205
|
return {
|
|
206
|
+
"name": {
|
|
207
|
+
"type": "string",
|
|
208
|
+
"mutable": false,
|
|
209
|
+
"complexType": {
|
|
210
|
+
"original": "string",
|
|
211
|
+
"resolved": "string",
|
|
212
|
+
"references": {}
|
|
213
|
+
},
|
|
214
|
+
"required": false,
|
|
215
|
+
"optional": false,
|
|
216
|
+
"docs": {
|
|
217
|
+
"tags": [],
|
|
218
|
+
"text": "Name for native form submission"
|
|
219
|
+
},
|
|
220
|
+
"getter": false,
|
|
221
|
+
"setter": false,
|
|
222
|
+
"reflect": true,
|
|
223
|
+
"attribute": "name",
|
|
224
|
+
"defaultValue": "''"
|
|
225
|
+
},
|
|
193
226
|
"codArea": {
|
|
194
227
|
"type": "string",
|
|
195
228
|
"mutable": true,
|
|
@@ -425,6 +458,9 @@ export class DropiPhoneInput {
|
|
|
425
458
|
return [{
|
|
426
459
|
"propName": "codArea",
|
|
427
460
|
"methodName": "codAreaChanged"
|
|
461
|
+
}, {
|
|
462
|
+
"propName": "ngModelPhone",
|
|
463
|
+
"methodName": "ngModelPhoneChanged"
|
|
428
464
|
}, {
|
|
429
465
|
"propName": "selectedOption",
|
|
430
466
|
"methodName": "selectedOptionChanged"
|
|
@@ -439,4 +475,5 @@ export class DropiPhoneInput {
|
|
|
439
475
|
"passive": false
|
|
440
476
|
}];
|
|
441
477
|
}
|
|
478
|
+
static get attachInternalsMemberName() { return "internals"; }
|
|
442
479
|
}
|
|
@@ -4,6 +4,7 @@ import { h } from "@stencil/core";
|
|
|
4
4
|
* Styled radio button with label.
|
|
5
5
|
*/
|
|
6
6
|
export class DropiRadioButton {
|
|
7
|
+
internals;
|
|
7
8
|
/** Label text displayed next to the radio */
|
|
8
9
|
label = '';
|
|
9
10
|
/** Input name (for grouping radio buttons) */
|
|
@@ -23,12 +24,18 @@ export class DropiRadioButton {
|
|
|
23
24
|
if (val)
|
|
24
25
|
this.checked = false;
|
|
25
26
|
}
|
|
27
|
+
checkedChanged(val) {
|
|
28
|
+
this.internals.setFormValue(val ? 'on' : null);
|
|
29
|
+
}
|
|
30
|
+
componentWillLoad() {
|
|
31
|
+
this.internals.setFormValue(this.checked ? 'on' : null);
|
|
32
|
+
}
|
|
26
33
|
handleChange(e) {
|
|
27
34
|
this.checked = e.target.checked;
|
|
28
35
|
this.dropiChange.emit(e);
|
|
29
36
|
}
|
|
30
37
|
render() {
|
|
31
|
-
return (h("div", { key: '
|
|
38
|
+
return (h("div", { key: 'e4b54d9bda299b9150ebf9791925e0e7c3b9fb38', class: "dropi-radio-button" }, h("label", { key: '0a4c6443668477a2cb6b2d5a3d8bc1744a0fcffd', htmlFor: this.id }, h("input", { key: '6ba6b5af4bc061664dee0b6554c769613080dbb8', id: this.id, type: "radio", name: this.name, checked: this.checked, onChange: (e) => this.handleChange(e) }), this.label)));
|
|
32
39
|
}
|
|
33
40
|
static get is() { return "dropi-radio-button"; }
|
|
34
41
|
static get encapsulation() { return "shadow"; }
|
|
@@ -81,7 +88,7 @@ export class DropiRadioButton {
|
|
|
81
88
|
},
|
|
82
89
|
"getter": false,
|
|
83
90
|
"setter": false,
|
|
84
|
-
"reflect":
|
|
91
|
+
"reflect": true,
|
|
85
92
|
"attribute": "name",
|
|
86
93
|
"defaultValue": "'name'"
|
|
87
94
|
},
|
|
@@ -169,6 +176,10 @@ export class DropiRadioButton {
|
|
|
169
176
|
return [{
|
|
170
177
|
"propName": "resetTrigger",
|
|
171
178
|
"methodName": "onResetTrigger"
|
|
179
|
+
}, {
|
|
180
|
+
"propName": "checked",
|
|
181
|
+
"methodName": "checkedChanged"
|
|
172
182
|
}];
|
|
173
183
|
}
|
|
184
|
+
static get attachInternalsMemberName() { return "internals"; }
|
|
174
185
|
}
|
|
@@ -387,7 +387,7 @@ export class DropiSelect {
|
|
|
387
387
|
]), !this.isGrouped && this.filteredOptions.map(opt => this.renderOption(opt)), this.filteredOptions.length === 0 && (h("li", { class: "no-results" }, "Sin resultados"))));
|
|
388
388
|
}
|
|
389
389
|
render() {
|
|
390
|
-
return (h("div", { key: '
|
|
390
|
+
return (h("div", { key: 'f09113a288d45bb5519503bb78c41e236913c1eb', class: "custom-select" }, !this.dropdownType && this.label && (h("label", { key: 'c0b59763dc3529d7f9bb5597a2bea0d38070a07b', class: { 'disabled-label': this.disabled } }, this.label, this.showObligatory && !this.disabled && h("span", { key: '6c8a47bdfc216231ba72420298b3bc8deeeae435', class: "asterisk" }, " *"))), h("div", { key: '8ec45010af1252effe34bb69d3f40ea277459511', class: "dropdown-container" }, this.dropdownType && this.label && (h("div", { key: 'b3f7f9adacd57b091baac662fc7be6fcd847c3a4', class: "left-label" }, this.label)), this.renderTrigger()), this.textHelper && !this.hasError && (h("div", { key: 'a4cce833b50b2bc62cb7142da420f81c0647e97e', class: "select-helper" }, h("span", { key: 'f69375abc2f66b5b1278895b8f313adabfa0f938' }, this.textHelper))), this.hasError && this.errorText && (h("div", { key: '6681bdbb705633d393adab09a889f3f1fb6fbe8a', class: "select-helper-error" }, h("dropi-icon", { key: '09521eeef2cf2a58cb74bea5bfae8a6d58d17682', name: "Warning-circle", iconWidth: "12px", iconHeight: "12px", color: "Error-Error-500" }), h("span", { key: '807820bb0a474079627bf12c20f4a034896785cd' }, this.errorText))), this.renderDropdown()));
|
|
391
391
|
}
|
|
392
392
|
static get is() { return "dropi-select"; }
|
|
393
393
|
static get encapsulation() { return "shadow"; }
|
|
@@ -491,7 +491,7 @@ export class DropiSelect {
|
|
|
491
491
|
},
|
|
492
492
|
"getter": false,
|
|
493
493
|
"setter": false,
|
|
494
|
-
"reflect":
|
|
494
|
+
"reflect": true,
|
|
495
495
|
"attribute": "name",
|
|
496
496
|
"defaultValue": "''"
|
|
497
497
|
},
|
|
@@ -4,19 +4,28 @@ import { h } from "@stencil/core";
|
|
|
4
4
|
* Toggle switch component. Emits dropiChange on toggle.
|
|
5
5
|
*/
|
|
6
6
|
export class DropiSwitch {
|
|
7
|
+
internals;
|
|
8
|
+
/** Name for native form submission */
|
|
9
|
+
name = '';
|
|
7
10
|
/** Whether the switch is on */
|
|
8
11
|
isChecked = false;
|
|
9
12
|
/** Whether the switch is disabled */
|
|
10
13
|
disabled = false;
|
|
11
14
|
/** Emitted when the toggle state changes */
|
|
12
15
|
dropiChange;
|
|
16
|
+
checkedChanged(val) {
|
|
17
|
+
this.internals.setFormValue(val ? 'on' : null);
|
|
18
|
+
}
|
|
19
|
+
componentWillLoad() {
|
|
20
|
+
this.internals.setFormValue(this.isChecked ? 'on' : null);
|
|
21
|
+
}
|
|
13
22
|
onToggleChange(event) {
|
|
14
23
|
const input = event.target;
|
|
15
24
|
this.isChecked = input.checked;
|
|
16
25
|
this.dropiChange.emit(this.isChecked);
|
|
17
26
|
}
|
|
18
27
|
render() {
|
|
19
|
-
return (h("label", { key: '
|
|
28
|
+
return (h("label", { key: 'b3321fd96a1487210a920f5494708dc2eb05f10c', class: "toggle-switch" }, h("input", { key: 'ee7cfecf443a1c839ce145ade18cc3ff15924816', type: "checkbox", checked: this.isChecked, disabled: this.disabled, onChange: (e) => this.onToggleChange(e) }), h("span", { key: 'c0800bd9a7f52cf666b3e475265da223b852be9a', class: "slider" })));
|
|
20
29
|
}
|
|
21
30
|
static get is() { return "dropi-switch"; }
|
|
22
31
|
static get encapsulation() { return "shadow"; }
|
|
@@ -33,6 +42,26 @@ export class DropiSwitch {
|
|
|
33
42
|
}
|
|
34
43
|
static get properties() {
|
|
35
44
|
return {
|
|
45
|
+
"name": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"mutable": false,
|
|
48
|
+
"complexType": {
|
|
49
|
+
"original": "string",
|
|
50
|
+
"resolved": "string",
|
|
51
|
+
"references": {}
|
|
52
|
+
},
|
|
53
|
+
"required": false,
|
|
54
|
+
"optional": false,
|
|
55
|
+
"docs": {
|
|
56
|
+
"tags": [],
|
|
57
|
+
"text": "Name for native form submission"
|
|
58
|
+
},
|
|
59
|
+
"getter": false,
|
|
60
|
+
"setter": false,
|
|
61
|
+
"reflect": true,
|
|
62
|
+
"attribute": "name",
|
|
63
|
+
"defaultValue": "''"
|
|
64
|
+
},
|
|
36
65
|
"isChecked": {
|
|
37
66
|
"type": "boolean",
|
|
38
67
|
"mutable": true,
|
|
@@ -93,4 +122,11 @@ export class DropiSwitch {
|
|
|
93
122
|
}
|
|
94
123
|
}];
|
|
95
124
|
}
|
|
125
|
+
static get watchers() {
|
|
126
|
+
return [{
|
|
127
|
+
"propName": "isChecked",
|
|
128
|
+
"methodName": "checkedChanged"
|
|
129
|
+
}];
|
|
130
|
+
}
|
|
131
|
+
static get attachInternalsMemberName() { return "internals"; }
|
|
96
132
|
}
|
|
@@ -80,10 +80,10 @@ export class DropiTextArea {
|
|
|
80
80
|
this.value = val;
|
|
81
81
|
this.internals.setFormValue(val);
|
|
82
82
|
this.dropiInput.emit(val);
|
|
83
|
+
this.dropiChange.emit(val);
|
|
83
84
|
}
|
|
84
85
|
handleBlur() {
|
|
85
86
|
this.touched = true;
|
|
86
|
-
this.dropiChange.emit(this.value);
|
|
87
87
|
this.dropiBlur.emit();
|
|
88
88
|
}
|
|
89
89
|
get resolvedId() {
|
|
@@ -98,12 +98,12 @@ export class DropiTextArea {
|
|
|
98
98
|
render() {
|
|
99
99
|
const showAsterisk = this.required && this.showObligatoryAsterisk && !this.disabled;
|
|
100
100
|
const showHelper = this.textHelper || this.isInvalid;
|
|
101
|
-
return (h("div", { key: '
|
|
101
|
+
return (h("div", { key: '8c25826a54d1f0bec06d8f70211d2bcd873d59a6', class: "textarea-wrapper" }, this.label && (h("label", { key: '58a578753a1248b185d2763aedf50eaaa152c791', htmlFor: this.resolvedId, style: { color: this.disabled ? 'var(--Gray-Gray-400)' : 'var(--Gray-Gray-600)' } }, this.label, showAsterisk && h("span", { key: 'cf31923103a7594f552df4ec86885f78d0c31779', class: "asterisk" }, " *"))), h("div", { key: '6ea60b6286fd4438389cfda0580379d8fe013adc', class: "textarea-container" }, h("textarea", { key: 'fc5e495d80bfd665e55480668b9fa7ed62651984', id: this.resolvedId, class: {
|
|
102
102
|
'form-control': true,
|
|
103
103
|
'Body-M-Regular': true,
|
|
104
104
|
'form-control-valid': !this.isInvalid && this.touched && !!this.value,
|
|
105
105
|
'form-control-invalid': this.isInvalid,
|
|
106
|
-
}, 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: '
|
|
106
|
+
}, 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: '07c350ce7a2e56b466229450645e6faece3d284b', class: "char-counter" }, this.charCount, "/", this.maxLength))), showHelper && (h("div", { key: 'c9fbd9a21b7e26fbd9571fc524b6f706404145d3', class: "form-control-helper" }, this.isInvalid && (h("dropi-icon", { key: '8fc6e34849f9e3175097597280a3bea9defb6bb0', name: "Warning-circle", iconWidth: "12px", iconHeight: "12px", color: "Error-Error-500" })), h("span", { key: '68bf62627efb3de92afe54f7803e322f5a0462e4', class: { 'invalid-color': this.isInvalid }, style: { color: this.disabled ? 'var(--Gray-Gray-400)' : undefined } }, this.textHelper)))));
|
|
107
107
|
}
|
|
108
108
|
static get is() { return "dropi-text-area"; }
|
|
109
109
|
static get encapsulation() { return "shadow"; }
|
|
@@ -156,7 +156,7 @@ export class DropiTextArea {
|
|
|
156
156
|
},
|
|
157
157
|
"getter": false,
|
|
158
158
|
"setter": false,
|
|
159
|
-
"reflect":
|
|
159
|
+
"reflect": true,
|
|
160
160
|
"attribute": "name",
|
|
161
161
|
"defaultValue": "''"
|
|
162
162
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as i,H as e,c as s,h as a}from"./index.js";import{d as o}from"./p-
|
|
1
|
+
import{t,p as i,H as e,c as s,h as a}from"./index.js";import{d as o}from"./p-Dnx3uXgo.js";import{d}from"./p-B9rJd-Rf.js";import{d as n}from"./p-Bw8zPxUl.js";const l=i(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.dropiPrimaryClick=s(this,"dropiPrimaryClick"),this.dropiSecondaryClick=s(this,"dropiSecondaryClick"),this.dropiVisibleChange=s(this,"dropiVisibleChange"),this.dropiHide=s(this,"dropiHide")}visible=!1;type="question";tittle="";message="";primaryButton="Accept";secondaryButton="";loading=!1;closable=!1;displayButtons=!0;loadingTitle="Loading";loadingMessage="Please wait a moment";isStep=!1;baseZIndex=0;isWhiteLabel=!1;params=null;paramsChanged(t){t&&(void 0!==t.tittle&&(this.tittle=t.tittle),void 0!==t.type&&(this.type=t.type),void 0!==t.message&&(this.message=t.message),void 0!==t.primaryButton&&(this.primaryButton=t.primaryButton),void 0!==t.secondaryButton&&(this.secondaryButton=t.secondaryButton),void 0!==t.loadingTitle&&(this.loadingTitle=t.loadingTitle),void 0!==t.loadingMessage&&(this.loadingMessage=t.loadingMessage),void 0!==t.closable&&(this.closable=t.closable),void 0!==t.displayButtons&&(this.displayButtons=t.displayButtons))}dropiPrimaryClick;dropiSecondaryClick;dropiVisibleChange;dropiHide;lottieMap={question:"/assets/lottie-files/question.json",warning:"/assets/lottie-files/warning.json",success:"/assets/lottie-files/success.json",error:"/assets/lottie-files/failure.json",loading:"/assets/lottie-files/loading.json"};componentWillLoad(){this.params&&this.paramsChanged(this.params)}async show(){this.visible=!0}async hide(){this.visible=!1}handlePrimary(){this.dropiPrimaryClick.emit(!0),this.isStep||(this.visible=!1,this.dropiVisibleChange.emit(!1))}handleSecondary(){this.dropiSecondaryClick.emit(!0),this.visible=!1,this.dropiVisibleChange.emit(!1)}onModalHide(){this.visible=!1,this.dropiVisibleChange.emit(!1),this.dropiHide.emit()}render(){const t=this.loading?"loading":this.type;return a("dropi-modal",{key:"322c59ea0a067a4c0cb28a5ffbe9cbc0c642eee6",visible:this.visible,showHeader:this.closable,showCloseIcon:this.closable,dismissable:!1,closeOnEscape:!1,showFooter:!1,size:"s",onDropiHide:()=>this.onModalHide()},a("div",{key:"06530f3da45738d1ed75a4e8b5b8b0b80dfd2647",class:"body-alert"},this.lottieMap[t]&&a("div",{key:"7a4ab4fbbdf3cbbacfa22f918d212b788f4392a4",class:"lottie-img"+("loading"===t?" lottie-img--loading":"")},a("lottie-player",{key:t,src:this.lottieMap[t],background:"transparent",speed:"1",loop:!0,autoplay:!0})),a("div",{key:"0e72f42d10c59047e82df8b2842affd38ab60fc7",class:"content-alert"},a("h2",{key:"8262de8fbcf5b87fbac34740d34d99d0b6ff921d"},this.loading?this.loadingTitle:this.tittle),a("p",{key:"ca9c734e0b9686bff7e2616ae98224446ac0ca33"},this.loading?this.loadingMessage:this.message)),a("div",{key:"1b5edb3af1044cb0dd0b57a425517b1d824672be",class:"custom-content"},a("slot",{key:"57f4a8acdbcf8a11445f7c8233355bb4ac46c9ab"})),!this.loading&&this.displayButtons&&a("div",{key:"32580f42d98f628b4c1d1f300b5a3aaaa1be2486",class:"actions"},this.secondaryButton&&a("dropi-button",{key:"dcf8707a7f4d8b80126a10022dd6de1c0ea44dc7",text:this.secondaryButton,severity:"secondary",onDropiClick:()=>this.handleSecondary(),fullWidth:!0}),a("dropi-button",{key:"3ed494fc7a83021174c4d006ae4327348d400e93",text:this.primaryButton,severity:"primary",onDropiClick:()=>this.handlePrimary(),fullWidth:!0}))))}static get watchers(){return{params:[{paramsChanged:0}]}}static get style(){return":host{display:contents}.body-alert{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:var(--Size-3);width:100%;flex:1;overflow:visible;padding-bottom:var(--Size-2)}.lottie-img{width:120px;height:120px;overflow:hidden;flex-shrink:0;align-self:center;margin-top:-8px;margin-bottom:var(--Size-2)}.lottie-img lottie-player{display:block;width:120px;height:120px}.lottie-img--loading{width:100%;height:120px;overflow:hidden;display:flex;align-items:center;justify-content:center}.lottie-img--loading lottie-player{width:300px;height:auto;flex-shrink:0}.content-alert{text-align:center;width:100%;display:flex;flex-direction:column;align-items:center}.content-alert h2{color:var(--Gray-Gray-800);font-size:19px;font-weight:var(--font-weight-semibold);margin:0}.content-alert p{color:var(--Gray-Gray-500);font-size:var(--font-size-s);margin-bottom:var(--Size-2);overflow-wrap:anywhere;max-height:100px;overflow:auto}.custom-content{width:100%;text-align:left;margin-top:var(--Size-2);display:flex;flex-direction:column;gap:var(--Size-3)}.actions{display:flex;gap:var(--Size-3);width:100%}.actions dropi-button{flex:1;display:flex;justify-content:center}@media (max-width: 768px){.actions{flex-direction:column}.actions dropi-button{width:100%}}"}},[772,"dropi-alert-modal",{visible:[1544],type:[1025],tittle:[1025],message:[1025],primaryButton:[1025,"primary-button"],secondaryButton:[1025,"secondary-button"],loading:[4],closable:[1028],displayButtons:[1028,"display-buttons"],loadingTitle:[1025,"loading-title"],loadingMessage:[1025,"loading-message"],isStep:[4,"is-step"],baseZIndex:[2,"base-z-index"],isWhiteLabel:[4,"is-white-label"],params:[8],show:[64],hide:[64]},void 0,{params:[{paramsChanged:0}]}]);function r(){"undefined"!=typeof customElements&&["dropi-alert-modal","dropi-button","dropi-icon","dropi-modal"].forEach((i=>{switch(i){case"dropi-alert-modal":customElements.get(t(i))||customElements.define(t(i),l);break;case"dropi-button":customElements.get(t(i))||o();break;case"dropi-icon":customElements.get(t(i))||d();break;case"dropi-modal":customElements.get(t(i))||n()}}))}r();const c=l,h=r;export{c as DropiAlertModal,h as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as o,d as s}from"./p-
|
|
1
|
+
import{D as o,d as s}from"./p-Dnx3uXgo.js";const p=o,r=s;export{p as DropiButton,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as i,H as t,c as r,h as a}from"./index.js";import{d as c}from"./p-
|
|
1
|
+
import{t as e,p as i,H as t,c as r,h as a}from"./index.js";import{d as c}from"./p-Qrac2GRu.js";const o=i(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.dropiChange=r(this,"dropiChange")}type="default";state="checked";title="Tittle";description="";extraInfo="";extraInfoDescription="";disabled=!1;dropiChange;get isChecked(){return"checked"===this.state}handleClick(){this.disabled||(this.state=this.isChecked?"default":"checked",this.dropiChange.emit(this.isChecked))}render(){return a("div",{key:"b9004c813a03956904cfed8484cac2d8290be86f",class:{"container-card-check":!0,"default-card":"default"===this.type,"is-checked":this.isChecked&&"with card"===this.type,disabled:this.disabled},onClick:()=>this.handleClick()},a("dropi-checkbox",{key:"0c5c50811559c6472173fced2f04eee4626f118f",checked:this.isChecked,disabled:this.disabled}),a("div",{key:"1cb17bf8aea55a498d451922942b4fba6d99492c",class:"container-text"},a("div",{key:"6e2eab2ae82c13cb4e7a654cc989530cee1122c6",class:"title-check"},this.title),this.description&&a("div",{key:"040e5d8f633975bf3eb806835aae8aa308b1d4f8",class:"description-text"},this.description)),(this.extraInfo||this.extraInfoDescription)&&a("div",{key:"a5c794b5f2fa249b309b2fb00a759aea5b9e0d6c",class:"extra-info"},this.extraInfo&&a("div",{key:"1587e1a0801312fa8e759af2a367b36f842e1354"},this.extraInfo),this.extraInfoDescription&&a("h4",{key:"930811071657dfbbeff7c2bdc4cd2c2776d38177"},this.extraInfoDescription)))}static get style(){return":host{display:block;width:100%}*,*::before,*::after{box-sizing:border-box}.container-card-check{padding:var(--Size-4, 16px);border:1px solid var(--Gray-Gray-200, #c3c9d9);border-radius:var(--Size-2, 8px);width:100%;display:flex;align-items:center;gap:var(--Size-3, 12px);cursor:pointer;height:66px;overflow:hidden;transition:background 0.15s ease, border-color 0.15s ease}.container-card-check.disabled{border-radius:var(--Border-2, 8px);border:1px solid var(--Gray-Gray-100, #e6eaf2);background-color:var(--Gray-Gray-50, #f7f8fa);cursor:default}.container-card-check.disabled .title-check,.container-card-check.disabled .description-text,.container-card-check.disabled .extra-info{color:var(--Gray-Gray-400, #858ea6)}.container-text{width:100%;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;text-align:start;overflow:hidden}.title-check{color:var(--Gray-Gray-700, #32394d);font-size:var(--font-size-m, 14px);font-weight:var(--font-weight-regular, 400);display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.description-text{color:var(--Gray-Gray-500, #69738c);font-size:var(--font-size-s, 12px);margin-top:var(--Size-1, 4px);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.extra-info{display:flex;justify-content:space-between;align-items:center;flex-direction:column;gap:4px;flex-shrink:0;font-size:var(--font-size-s, 12px);color:var(--Gray-Gray-600, #475066)}.extra-info h4{margin:0;font-weight:var(--font-weight-semibold);color:inherit;line-height:inherit}.default-card{border:none}.is-checked{background:var(--Primary-Primary-50, #fff8f0);border:1px solid var(--Primary-Primary-500, #f49a3d)}"}},[513,"dropi-card-checkbox",{type:[1],state:[1025],title:[1],description:[1],extraInfo:[1,"extra-info"],extraInfoDescription:[1,"extra-info-description"],disabled:[4]}]);function s(){"undefined"!=typeof customElements&&["dropi-card-checkbox","dropi-checkbox"].forEach((i=>{switch(i){case"dropi-card-checkbox":customElements.get(e(i))||customElements.define(e(i),o);break;case"dropi-checkbox":customElements.get(e(i))||c()}}))}s();const d=o,n=s;export{d as DropiCardCheckbox,n as defineCustomElement}
|