@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
|
@@ -8,7 +8,15 @@ const DropiButton = class {
|
|
|
8
8
|
constructor(hostRef) {
|
|
9
9
|
index.registerInstance(this, hostRef);
|
|
10
10
|
this.dropiClick = index.createEvent(this, "dropiClick");
|
|
11
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
12
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
16
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
17
|
+
}
|
|
11
18
|
}
|
|
19
|
+
internals;
|
|
12
20
|
/** Visual color palette */
|
|
13
21
|
type = 'default';
|
|
14
22
|
/** Primary (filled) | Secondary (outlined) | Tertiary (ghost) */
|
|
@@ -27,6 +35,8 @@ const DropiButton = class {
|
|
|
27
35
|
customIconColor = '';
|
|
28
36
|
/** Button label */
|
|
29
37
|
text = '';
|
|
38
|
+
/** Native HTML button type (submit, reset, button) */
|
|
39
|
+
nativeType = 'button';
|
|
30
40
|
/** Emitted on click (not emitted when disabled or loading) */
|
|
31
41
|
dropiClick;
|
|
32
42
|
colorMap = {
|
|
@@ -61,6 +71,12 @@ const DropiButton = class {
|
|
|
61
71
|
handleClick(e) {
|
|
62
72
|
if (this.state !== 'disabled' && this.state !== 'loading') {
|
|
63
73
|
this.dropiClick.emit(e);
|
|
74
|
+
if (this.nativeType === 'submit') {
|
|
75
|
+
this.internals.form?.requestSubmit();
|
|
76
|
+
}
|
|
77
|
+
else if (this.nativeType === 'reset') {
|
|
78
|
+
this.internals.form?.reset();
|
|
79
|
+
}
|
|
64
80
|
}
|
|
65
81
|
}
|
|
66
82
|
renderLoadingSpinner() {
|
|
@@ -71,7 +87,7 @@ const DropiButton = class {
|
|
|
71
87
|
const hasText = (this.text ?? '') !== '';
|
|
72
88
|
const showPostIcon = (this.postIcon ?? '') !== '' || (this.type ?? 'default') === 'dropdown';
|
|
73
89
|
const dropdownIcon = (this.type ?? 'default') === 'dropdown' ? 'Dropdown-down' : (this.postIcon ?? '');
|
|
74
|
-
return (index.h("button", { key: '
|
|
90
|
+
return (index.h("button", { key: '21d2654de08dff8db6c2b1ba87594e1184a7aa35', class: {
|
|
75
91
|
btn: true,
|
|
76
92
|
'without-text': !hasText,
|
|
77
93
|
[this.severity ?? 'primary']: true,
|
|
@@ -79,8 +95,9 @@ const DropiButton = class {
|
|
|
79
95
|
[this.size ?? 'normal']: true,
|
|
80
96
|
[this.state ?? 'default']: true,
|
|
81
97
|
'full-width': this.fullWidth,
|
|
82
|
-
}, disabled: isDisabled, onClick: (e) => this.handleClick(e) }, this.preIcon && (index.h("dropi-icon", { key: '
|
|
98
|
+
}, type: this.nativeType, disabled: isDisabled, onClick: (e) => this.handleClick(e) }, this.preIcon && (index.h("dropi-icon", { key: '6c6c01c923a37df20b614602b18cd2da949bcb91', name: this.preIcon, iconWidth: this.iconSize, iconHeight: this.iconSize, color: this.fontColor })), hasText && index.h("span", { key: '82447aab8b87bc4a89105cd0209e6c5681222f28', class: "text" }, this.text), showPostIcon && (index.h("dropi-icon", { key: '6bdefe7c1c819b213d24e0100c2303fb7840ea00', name: dropdownIcon, iconWidth: this.iconSize, iconHeight: this.iconSize, color: this.fontColor })), this.state === 'loading' && this.renderLoadingSpinner(), index.h("slot", { key: '44483caf52d2ca617ad86c1574a54709f8e77ab5' })));
|
|
83
99
|
}
|
|
100
|
+
static get formAssociated() { return true; }
|
|
84
101
|
};
|
|
85
102
|
DropiButton.style = dropiButtonCss();
|
|
86
103
|
|
|
@@ -8,13 +8,29 @@ const DropiCheckbox = class {
|
|
|
8
8
|
constructor(hostRef) {
|
|
9
9
|
index.registerInstance(this, hostRef);
|
|
10
10
|
this.dropiChange = index.createEvent(this, "dropiChange");
|
|
11
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
12
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
16
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
17
|
+
}
|
|
11
18
|
}
|
|
19
|
+
internals;
|
|
20
|
+
/** Name for native form submission */
|
|
21
|
+
name = '';
|
|
12
22
|
/** Whether the checkbox is checked */
|
|
13
23
|
checked = false;
|
|
14
24
|
/** Whether the checkbox is disabled */
|
|
15
25
|
disabled = false;
|
|
16
26
|
/** Emitted when the checked state changes */
|
|
17
27
|
dropiChange;
|
|
28
|
+
checkedChanged(val) {
|
|
29
|
+
this.internals.setFormValue(val ? 'on' : null);
|
|
30
|
+
}
|
|
31
|
+
componentWillLoad() {
|
|
32
|
+
this.internals.setFormValue(this.checked ? 'on' : null);
|
|
33
|
+
}
|
|
18
34
|
changeState() {
|
|
19
35
|
if (this.disabled)
|
|
20
36
|
return;
|
|
@@ -22,14 +38,19 @@ const DropiCheckbox = class {
|
|
|
22
38
|
this.dropiChange.emit(this.checked);
|
|
23
39
|
}
|
|
24
40
|
render() {
|
|
25
|
-
return (index.h("div", { key: '
|
|
41
|
+
return (index.h("div", { key: '27fec5f03a48c19652c8ae01173dcbb6e3514693', class: "container-dropi-checkbox", onClick: () => this.changeState() }, index.h("div", { key: '243d07e4444c0dc149ff137258f9ddd58428c438', class: {
|
|
26
42
|
check: true,
|
|
27
43
|
isCheck: this.checked,
|
|
28
44
|
noCheck: !this.checked,
|
|
29
45
|
disabled: this.disabled,
|
|
30
|
-
} }, index.h("svg", { key: '
|
|
46
|
+
} }, index.h("svg", { key: '7a1fd9c7b3fa575ec263fe5ad48fbc0294a79980', xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none" }, index.h("path", { key: 'e77e5cd40c71e542a045934641509e41a7cd4899', 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" })))));
|
|
31
47
|
}
|
|
32
48
|
static get formAssociated() { return true; }
|
|
49
|
+
static get watchers() { return {
|
|
50
|
+
"checked": [{
|
|
51
|
+
"checkedChanged": 0
|
|
52
|
+
}]
|
|
53
|
+
}; }
|
|
33
54
|
};
|
|
34
55
|
DropiCheckbox.style = dropiCheckboxCss();
|
|
35
56
|
|
|
@@ -128,7 +128,17 @@ const DropiCountrySelector = class {
|
|
|
128
128
|
constructor(hostRef) {
|
|
129
129
|
index.registerInstance(this, hostRef);
|
|
130
130
|
this.dropiChange = index.createEvent(this, "dropiChange");
|
|
131
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
132
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
136
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
137
|
+
}
|
|
131
138
|
}
|
|
139
|
+
internals;
|
|
140
|
+
/** Name for native form submission */
|
|
141
|
+
name = '';
|
|
132
142
|
/** Label above the select */
|
|
133
143
|
label = '';
|
|
134
144
|
/** Placeholder when nothing is selected */
|
|
@@ -173,6 +183,7 @@ const DropiCountrySelector = class {
|
|
|
173
183
|
searchInputRef;
|
|
174
184
|
currentSelectionChanged(val) {
|
|
175
185
|
this.selected = COUNTRIES.find(c => c.code === val) || null;
|
|
186
|
+
this.internals.setFormValue(val);
|
|
176
187
|
}
|
|
177
188
|
selectPropertiesChanged(val) {
|
|
178
189
|
if (!val)
|
|
@@ -193,6 +204,7 @@ const DropiCountrySelector = class {
|
|
|
193
204
|
this.selectPropertiesChanged(this.selectProperties);
|
|
194
205
|
if (this.currentSelection)
|
|
195
206
|
this.currentSelectionChanged(this.currentSelection);
|
|
207
|
+
this.internals.setFormValue(this.currentSelection ?? '');
|
|
196
208
|
}
|
|
197
209
|
componentDidLoad() {
|
|
198
210
|
if (this.appendTo !== 'body')
|
|
@@ -265,12 +277,13 @@ const DropiCountrySelector = class {
|
|
|
265
277
|
this.dropiChange.emit(country);
|
|
266
278
|
}
|
|
267
279
|
render() {
|
|
268
|
-
return (index.h("div", { key: '
|
|
280
|
+
return (index.h("div", { key: '98292dbf6f84139b409cefe4690fb5ce834372c7', class: "custom-select" }, this.label && (index.h("label", { key: '7dd60d54e701108f7061623a89e8ff29edbb8dc6' }, this.label, this.showObligatory && index.h("span", { key: '971fd2a900d9ef4740a96145cadc948aab95232a', class: "required" }, "*"))), index.h("button", { key: '6c0067cfaf920160a4f8c05f59c34f3539540d29', type: "button", ref: (el) => { this.buttonRef = el; }, class: {
|
|
269
281
|
'select-button': true,
|
|
270
282
|
'select-completed': !!this.selected,
|
|
271
283
|
'select-invalid': this.hasError,
|
|
272
|
-
}, disabled: this.disabled, onClick: () => this.open() }, index.h("div", { key: '
|
|
284
|
+
}, disabled: this.disabled, onClick: () => this.open() }, index.h("div", { key: 'b28c2c5b0de9b8052bb920a272b9dcc51f4eac6f', class: "selected-content" }, this.selected ? (index.h("span", { class: "selected-option" }, index.h("img", { class: "flag-img", src: `https://flagsapi.com/${this.selected.code}/shiny/24.png`, alt: this.selected.name }), this.selected.name)) : (index.h("span", { class: "placeholder-text" }, this.placeholder))), index.h("dropi-icon", { key: '2ec568b0ad4efdb3a22ffceb1e85fbc6f1d483e8', name: this.isOpen ? 'Arrow-Up-2' : 'Arrow-Down-2', iconWidth: "20px", iconHeight: "20px", color: "Gray-Gray-500" })), index.h("ul", { key: '34f0e5772ebb21e85cb246cbb91196d128d9ca59', class: `select-dropdown${this.isOpen ? ' expanded' : ' collapsed'}` }, index.h("li", { key: '77cdf81222a7c593f1d54198e2b897468db890a5', class: "search-li" }, index.h("div", { key: '970723feefd04adf0b113ae63931092f58d0264a', class: "search-field" }, index.h("input", { key: '294868580087dc1bdb04258ad84672f3d10e7ba7', ref: (el) => { this.searchInputRef = el; }, type: "text", class: "country-search", placeholder: "Buscar pa\u00EDs...", value: this.searchTerm, onInput: (e) => { this.searchTerm = e.target.value; } }), index.h("span", { key: '02781dc595e568865ab5ae14aeed326b71b36e10', class: "search-icon" }, index.h("dropi-icon", { key: '0c06d5e5f26d2a2e5ec20967a2ebb9430397f3ea', name: "Search", iconWidth: "16px", iconHeight: "16px", color: "Gray-Gray-400" })))), this.filtered.map(country => (index.h("li", { key: country.code }, index.h("button", { class: "option", type: "button", onClick: () => this.select(country) }, index.h("img", { class: "flag-img", src: `https://flagsapi.com/${country.code}/shiny/24.png`, alt: country.name }), country.name))))), this.textHelper && (index.h("div", { key: 'aae58bc17bbb6953a676818fe02da94b5a4e9f73', class: { 'select-helper': true, 'select-helper-error': this.hasError } }, this.hasError && index.h("dropi-icon", { key: '7542ef4620499957711079c587f6cb650096f6d3', name: "Warning-circle", iconWidth: "12px", iconHeight: "12px", color: "Error-Error-500" }), index.h("span", { key: 'ea4c5cedd3b87444a90b4e210f7afa3a318a4832' }, this.textHelper)))));
|
|
273
285
|
}
|
|
286
|
+
static get formAssociated() { return true; }
|
|
274
287
|
static get watchers() { return {
|
|
275
288
|
"currentSelection": [{
|
|
276
289
|
"currentSelectionChanged": 0
|
|
@@ -15,13 +15,26 @@ const DropiDatePicker = class {
|
|
|
15
15
|
this.dropiChangeDate = index.createEvent(this, "dropiChangeDate");
|
|
16
16
|
this.dropiClosePanel = index.createEvent(this, "dropiClosePanel");
|
|
17
17
|
this.dropiRangeChange = index.createEvent(this, "dropiRangeChange");
|
|
18
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
19
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
23
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
24
|
+
}
|
|
18
25
|
}
|
|
26
|
+
internals;
|
|
27
|
+
/** Name for native form submission */
|
|
28
|
+
name = '';
|
|
19
29
|
/** Selected date (ISO string, single mode) - matches Angular 'selectedDate' */
|
|
20
30
|
selectedDate = '';
|
|
21
31
|
/** Range start date (ISO string, range mode) */
|
|
22
32
|
startDate = '';
|
|
23
33
|
/** Range end date (ISO string, range mode) */
|
|
24
34
|
endDate = '';
|
|
35
|
+
valueChanged() {
|
|
36
|
+
this.updateFormValue();
|
|
37
|
+
}
|
|
25
38
|
/** Enable range selection - matches Angular selectionMode */
|
|
26
39
|
selectionMode = 'single';
|
|
27
40
|
/** Min selectable date (ISO string) */
|
|
@@ -54,6 +67,17 @@ const DropiDatePicker = class {
|
|
|
54
67
|
dropiClosePanel;
|
|
55
68
|
/** Emitted when range selected */
|
|
56
69
|
dropiRangeChange;
|
|
70
|
+
componentWillLoad() {
|
|
71
|
+
this.updateFormValue();
|
|
72
|
+
}
|
|
73
|
+
updateFormValue() {
|
|
74
|
+
if (this.selectionMode === 'range') {
|
|
75
|
+
this.internals.setFormValue(this.startDate && this.endDate ? `${this.startDate},${this.endDate}` : '');
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
this.internals.setFormValue(this.selectedDate || '');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
57
81
|
get displayValue() {
|
|
58
82
|
if (this.selectionMode === 'range') {
|
|
59
83
|
if (this.startDate && this.endDate)
|
|
@@ -173,12 +197,12 @@ const DropiDatePicker = class {
|
|
|
173
197
|
render() {
|
|
174
198
|
const days = this.buildDays();
|
|
175
199
|
const today = new Date().toISOString().slice(0, 10);
|
|
176
|
-
return (index.h("div", { key: '
|
|
200
|
+
return (index.h("div", { key: '97a96b56b0e8ae551f747bad4a3459a1f4945411', class: "dp-wrap" }, this.label && index.h("label", { key: 'a1792032ab9ae2dbe574f50b7a537df687eae40c', class: "dp-label" }, this.label), index.h("button", { key: '4237c2b988f1e9fbaa77dc2a989964216e3fe902', class: {
|
|
177
201
|
'dp-trigger': true,
|
|
178
202
|
'dp-trigger--disabled': this.disabled,
|
|
179
203
|
'dp-trigger--invalid': this.isInvalid,
|
|
180
204
|
'dp-trigger--loading': this.loading
|
|
181
|
-
}, onClick: () => this.open ? this.open = false : this.open_(), disabled: this.disabled || this.loading, type: "button" }, index.h("dropi-icon", { key: '
|
|
205
|
+
}, onClick: () => this.open ? this.open = false : this.open_(), disabled: this.disabled || this.loading, type: "button" }, index.h("dropi-icon", { key: '39591fedb92b92e6507b564fc8c145711f1a21b1', name: "Calendar", iconWidth: "16px", iconHeight: "16px", color: "Gray-Gray-400" }), index.h("span", { key: '305e3f81d64c01603687d53edc59e1d19ef06c3c', class: { 'dp-trigger__value': true, 'dp-trigger__placeholder': !this.displayValue } }, this.displayValue || this.placeholder), index.h("dropi-icon", { key: '13feb346ad7b07a7e2f208e299f62a8261a97655', name: "Arrow-Down-2", iconWidth: "12px", iconHeight: "12px", color: "Gray-Gray-400" })), this.open && (index.h("div", { key: '4cdf8a69422a0b54d0f7c1a6711a683dab7d1f34', class: "dp-popup" }, index.h("div", { key: '0c6fb31094003c66c5b471e738dd75e7b865401f', class: "dp-nav" }, index.h("button", { key: '4fa24f9450cf6c5e888cea374619e14245c0c005', class: "dp-nav__btn", onClick: () => this.prevMonth(), type: "button" }, index.h("dropi-icon", { key: '2196f85700b252d4f83536f11ed197c083fc45ec', name: "Arrow-Left-2", iconWidth: "16px", iconHeight: "16px", color: "Gray-Gray-600" })), index.h("span", { key: '01619de7c5218b506f75234745f3184af813a491', class: "dp-nav__title" }, index.h("span", { key: '8074e7deeb6c102bad7f1911739e785187783a7c' }, MONTHS_ES[this.viewMonth]), index.h("span", { key: '69e9c3b41361e293a843f911b5bcf4690995d2b4' }, this.viewYear)), index.h("button", { key: '51c0ad3da96835736170fbf94338fd70c942c3d2', class: "dp-nav__btn", onClick: () => this.nextMonth(), type: "button" }, index.h("dropi-icon", { key: '24eb4385639c9a71f5312f32b33b36593c2b0259', name: "Arrow-Right-2", iconWidth: "16px", iconHeight: "16px", color: "Gray-Gray-600" }))), index.h("div", { key: 'c18cecd81af38b3a6f23402501011c09b8b453d7', class: "dp-grid" }, DAYS_ES.map(d => (index.h("div", { class: "dp-day-header" }, d))), days.map(({ iso, day, currentMonth }) => {
|
|
182
206
|
const isSelected = this.selectionMode !== 'range'
|
|
183
207
|
? iso === this.selectedDate
|
|
184
208
|
: iso === this.startDate || iso === this.endDate;
|
|
@@ -200,12 +224,12 @@ const DropiDatePicker = class {
|
|
|
200
224
|
if (this.selectionMode === 'range' && this.startDate && !this.endDate)
|
|
201
225
|
this.hoverDate = iso;
|
|
202
226
|
}, onMouseLeave: () => this.hoverDate = '' }, day));
|
|
203
|
-
})), index.h("div", { key: '
|
|
227
|
+
})), index.h("div", { key: '594f280cb269c32ac3a129401e13b710af1a7c7e', class: "dp-footer" }, index.h("button", { key: '6028ef84bc17f0d1bb0fd587a991698a8fc69338', class: "dp-footer__clear", type: "button", onClick: () => {
|
|
204
228
|
this.selectedDate = '';
|
|
205
229
|
this.startDate = '';
|
|
206
230
|
this.endDate = '';
|
|
207
231
|
this.open = false;
|
|
208
|
-
} }, "Limpiar"), index.h("button", { key: '
|
|
232
|
+
} }, "Limpiar"), index.h("button", { key: 'ab01840a18d657621205d4fba69cc53feb474d11', class: "dp-footer__today", type: "button", onClick: () => {
|
|
209
233
|
if (this.selectionMode !== 'range') {
|
|
210
234
|
this.selectedDate = today;
|
|
211
235
|
this.open = false;
|
|
@@ -217,6 +241,18 @@ const DropiDatePicker = class {
|
|
|
217
241
|
}
|
|
218
242
|
} }, "Hoy"))))));
|
|
219
243
|
}
|
|
244
|
+
static get formAssociated() { return true; }
|
|
245
|
+
static get watchers() { return {
|
|
246
|
+
"selectedDate": [{
|
|
247
|
+
"valueChanged": 0
|
|
248
|
+
}],
|
|
249
|
+
"startDate": [{
|
|
250
|
+
"valueChanged": 0
|
|
251
|
+
}],
|
|
252
|
+
"endDate": [{
|
|
253
|
+
"valueChanged": 0
|
|
254
|
+
}]
|
|
255
|
+
}; }
|
|
220
256
|
};
|
|
221
257
|
DropiDatePicker.style = dropiDatePickerCss();
|
|
222
258
|
|
|
@@ -155,6 +155,7 @@ const DropiInput = class {
|
|
|
155
155
|
this.value = val;
|
|
156
156
|
this.internals.setFormValue(val);
|
|
157
157
|
this.dropiInput.emit(val);
|
|
158
|
+
this.dropiChange.emit(val);
|
|
158
159
|
}
|
|
159
160
|
handleKeyDown(e) {
|
|
160
161
|
if ((this.isNumericInput || this.isMoneyInput || this.isThousandSeparator) && !this.isAllowedNumberKey(e)) {
|
|
@@ -169,7 +170,6 @@ const DropiInput = class {
|
|
|
169
170
|
}
|
|
170
171
|
handleBlur() {
|
|
171
172
|
this.touched = true;
|
|
172
|
-
this.dropiChange.emit(this.value);
|
|
173
173
|
this.dropiBlur.emit();
|
|
174
174
|
}
|
|
175
175
|
togglePassword() {
|
|
@@ -235,14 +235,14 @@ const DropiInput = class {
|
|
|
235
235
|
render() {
|
|
236
236
|
const showObligatoryAsterisk = this.required && this.showObligatoryAsterisk && !this.disabled;
|
|
237
237
|
const showIconInline = !!this.icon;
|
|
238
|
-
return (index.h("div", { key: '
|
|
238
|
+
return (index.h("div", { key: '6af757e1d86bfe96d471e9cbed258a50727ae190', class: { 'fixed-label-container': this.fixedLabel } }, this.fixedLabel && (index.h("div", { key: 'e88bf81fd2b79933e386c2e5fa38f57d85cfe836', class: "input-label Body-S-Regular" }, this.label, showObligatoryAsterisk && index.h("span", { key: 'be8ec1b0d3ef624ca22e58ae072917ad2ecc79fb', class: "asterisk" }, " *"))), index.h("div", { key: '4806c0d250f00bb08788d9d6aa935ca15f2aa826', class: "form-group" }, index.h("div", { key: 'b9fa243d299bcd165458947d6695fcc845764276', class: { 'input-container': true, 'input-container--has-icon': showIconInline } }, showIconInline && (index.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 && (index.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() })), index.h("input", { key: '8146ae1794cbe1f200bb681358c7319f10faab3c', id: this.resolvedId, class: {
|
|
239
239
|
'form-control': true,
|
|
240
240
|
'form-control-valid': !this.isInvalid && this.touched && !!this.value,
|
|
241
241
|
'form-control-invalid': this.isInvalid,
|
|
242
242
|
'padding-icon': showIconInline,
|
|
243
243
|
'text-password': this.passwordInput && !this.showPassword,
|
|
244
244
|
'fixed-label-input': this.fixedLabel,
|
|
245
|
-
}, 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 && (index.h("label", { key: '
|
|
245
|
+
}, 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 && (index.h("label", { key: '005d15af6b50b2cb2d47ac8381a722794eb273e5', class: "Body-S-Regular label-bottom", htmlFor: this.resolvedId }, this.label, showObligatoryAsterisk && index.h("span", { key: 'ad56df877cff3df8a801cdfcb607d9af02f7465a', class: "asterisk" }, " *"))), this.showHelper && (index.h("div", { key: '76e858c13a798f69b2d20ee9908f17531568dad1', class: "form-control-helper" }, this.isInvalid && index.h("dropi-icon", { key: '3e42ffb4db7444ebfb49cc9c6720d5a9d02b2860', name: "Warning-circle", iconWidth: "12px", iconHeight: "12px", color: "Error-Error-500" }), index.h("span", { key: '5e970903eb51ca6b72a43bef0edf6ef149443247', class: {
|
|
246
246
|
'disabled-helper': this.disabled,
|
|
247
247
|
'invalid-color': this.isInvalid,
|
|
248
248
|
} }, this.textHelper)))))));
|
|
@@ -11,7 +11,17 @@ const DropiOtpSendCode = class {
|
|
|
11
11
|
this.codeCompleted = index.createEvent(this, "codeCompleted");
|
|
12
12
|
this.codeAccepted = index.createEvent(this, "codeAccepted");
|
|
13
13
|
this.dropiResend = index.createEvent(this, "dropiResend");
|
|
14
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
15
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
19
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
20
|
+
}
|
|
14
21
|
}
|
|
22
|
+
internals;
|
|
23
|
+
/** Name for native form submission */
|
|
24
|
+
name = '';
|
|
15
25
|
/** Delivery method label */
|
|
16
26
|
engine = 'email';
|
|
17
27
|
/** Contact info (email/phone to show in label) */
|
|
@@ -43,6 +53,7 @@ const DropiOtpSendCode = class {
|
|
|
43
53
|
componentWillLoad() {
|
|
44
54
|
this.digits = Array(this.digitsCount).fill('');
|
|
45
55
|
this.digitStates = Array(this.digitsCount).fill('idle');
|
|
56
|
+
this.internals.setFormValue('');
|
|
46
57
|
}
|
|
47
58
|
componentDidLoad() { this.startCountdown(); }
|
|
48
59
|
disconnectedCallback() { clearInterval(this.timer); }
|
|
@@ -70,9 +81,13 @@ const DropiOtpSendCode = class {
|
|
|
70
81
|
this.inputs[index + 1]?.focus();
|
|
71
82
|
if (newDigits.every(d => d !== '')) {
|
|
72
83
|
const finalCode = newDigits.join('');
|
|
84
|
+
this.internals.setFormValue(finalCode);
|
|
73
85
|
this.codeCompleted.emit(finalCode);
|
|
74
86
|
this.codeAccepted.emit(finalCode);
|
|
75
87
|
}
|
|
88
|
+
else {
|
|
89
|
+
this.internals.setFormValue(newDigits.join(''));
|
|
90
|
+
}
|
|
76
91
|
}
|
|
77
92
|
handleKeyDown(e, index) {
|
|
78
93
|
if (e.key === 'Backspace' && !this.digits[index] && index > 0) {
|
|
@@ -89,21 +104,26 @@ const DropiOtpSendCode = class {
|
|
|
89
104
|
this.inputs[Math.min(text.length, this.digitsCount - 1)]?.focus();
|
|
90
105
|
if (newDigits.every(d => d !== '')) {
|
|
91
106
|
const finalCode = newDigits.join('');
|
|
107
|
+
this.internals.setFormValue(finalCode);
|
|
92
108
|
this.codeCompleted.emit(finalCode);
|
|
93
109
|
this.codeAccepted.emit(finalCode);
|
|
94
110
|
}
|
|
111
|
+
else {
|
|
112
|
+
this.internals.setFormValue(newDigits.join(''));
|
|
113
|
+
}
|
|
95
114
|
}
|
|
96
115
|
render() {
|
|
97
116
|
const engineLabel = this.engine === 'sms' ? 'SMS' : this.engine === '2fa' ? 'autenticador' : 'correo';
|
|
98
|
-
return (index.h("div", { key: '
|
|
117
|
+
return (index.h("div", { key: 'ee2e6766c4b220a1a12b8734747138cf2351a0d8', class: "otp" }, this.showLabelContact && (index.h("p", { key: '87f34e3b13c0e16e584cc03ea8c5a35e462784b1', class: "otp__label" }, "Ingresa el c\u00F3digo enviado a tu ", engineLabel, this.labelContact && index.h("strong", { key: '6c9d0c73340ff8dab1730b5d6c9cc0431f3ff21c' }, " ", this.labelContact))), index.h("div", { key: 'd82904db02da1da5f863bb86cef65b0da166ff0c', class: "otp__inputs", onPaste: (e) => this.handlePaste(e) }, this.digits.map((_, i) => (index.h("input", { key: i, ref: (el) => {
|
|
99
118
|
if (el)
|
|
100
119
|
this.inputs[i] = el;
|
|
101
120
|
}, class: {
|
|
102
121
|
'otp__digit': true,
|
|
103
122
|
'otp__digit--filled': this.digitStates[i] === 'filled',
|
|
104
123
|
'otp__digit--error': this.error,
|
|
105
|
-
}, 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 && (index.h("p", { key: '
|
|
124
|
+
}, 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 && (index.h("p", { key: '7629619d5b2c4e8f38e2c2bc93ab134242b8e079', class: "otp__error" }, this.errorMessage)), index.h("div", { key: 'ea5472d4c55f1cdc30304e9e9bcaacf303ba4501', class: "otp__resend" }, this.canResend ? (index.h("button", { class: "otp__resend-btn", onClick: () => { this.startCountdown(); this.dropiResend.emit(); } }, "Reenviar c\u00F3digo")) : (index.h("span", { class: "otp__countdown" }, "Reenviar en ", this.countdown, "s")))));
|
|
106
125
|
}
|
|
126
|
+
static get formAssociated() { return true; }
|
|
107
127
|
static get watchers() { return {
|
|
108
128
|
"digitsCount": [{
|
|
109
129
|
"handleDigitsCountChange": 0
|
|
@@ -105,8 +105,18 @@ const DropiPhoneInput = class {
|
|
|
105
105
|
this.dropiPhoneChange = index.createEvent(this, "dropiPhoneChange");
|
|
106
106
|
this.dropiVerify = index.createEvent(this, "dropiVerify");
|
|
107
107
|
this.dropiChangeSelect = index.createEvent(this, "dropiChangeSelect");
|
|
108
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
109
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
113
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
114
|
+
}
|
|
108
115
|
}
|
|
109
116
|
get el() { return index.getElement(this); }
|
|
117
|
+
internals;
|
|
118
|
+
/** Name for native form submission */
|
|
119
|
+
name = '';
|
|
110
120
|
/** Initial country dial code (e.g. "57") — matches Angular 'CodArea' setter */
|
|
111
121
|
codArea = '57';
|
|
112
122
|
/** Phone number value — matches Angular 'ngModelPhone' */
|
|
@@ -141,6 +151,10 @@ const DropiPhoneInput = class {
|
|
|
141
151
|
dropiChangeSelect;
|
|
142
152
|
codAreaChanged() {
|
|
143
153
|
this.ngModelPhone = '';
|
|
154
|
+
this.updateFormValue();
|
|
155
|
+
}
|
|
156
|
+
ngModelPhoneChanged() {
|
|
157
|
+
this.updateFormValue();
|
|
144
158
|
}
|
|
145
159
|
selectedOptionChanged(val) {
|
|
146
160
|
if (!val)
|
|
@@ -152,6 +166,11 @@ const DropiPhoneInput = class {
|
|
|
152
166
|
componentWillLoad() {
|
|
153
167
|
if (this.selectedOption)
|
|
154
168
|
this.selectedOptionChanged(this.selectedOption);
|
|
169
|
+
this.updateFormValue();
|
|
170
|
+
}
|
|
171
|
+
updateFormValue() {
|
|
172
|
+
const fullValue = this.ngModelPhone ? `+${this.codArea}${this.ngModelPhone}` : '';
|
|
173
|
+
this.internals.setFormValue(fullValue);
|
|
155
174
|
}
|
|
156
175
|
get selectedCountry() {
|
|
157
176
|
const cleanCodArea = (this.codArea ?? '57').replace('+', '');
|
|
@@ -178,15 +197,19 @@ const DropiPhoneInput = class {
|
|
|
178
197
|
render() {
|
|
179
198
|
const country = this.selectedCountry;
|
|
180
199
|
const isInvalid = this.isValidPhone === false;
|
|
181
|
-
return (index.h("div", { key: '
|
|
200
|
+
return (index.h("div", { key: '1634a703f734cd5db7b5d7acf83f403ea07962a3', class: "phone-wrap" }, index.h("div", { key: 'a9ed4a17b4a01893fc22d051241dcd494fa2e66d', class: "phone-input-container" }, index.h("div", { key: '6a50121fbb8939eac54035a314c340137aae63d5', class: "custom-select" }, index.h("button", { key: '0157b468dab13e23f83b9528ec235bc61be91733', type: "button", class: { 'select-button': true, 'select-invalid': isInvalid }, disabled: this.disabledInput, onClick: () => {
|
|
182
201
|
if (!this.disabledInput)
|
|
183
202
|
this.open = !this.open;
|
|
184
|
-
} }, index.h("span", { key: '
|
|
203
|
+
} }, index.h("span", { key: 'b174ec714c415964d09f4661f58a1a62e8c80653', style: { display: 'flex', gap: '0.5rem', alignItems: 'center' } }, index.h("img", { key: 'f4c62db877a54bd395b756926918b8ff16511a2a', src: `https://flagsapi.com/${country.flag}/flat/24.png`, alt: "flag" }), country.code), index.h("dropi-icon", { key: '809f64bed4cccd911110c9e8e52752554b0d8a86', name: this.open ? 'Dropdown-up' : 'Dropdown-down', iconWidth: "14px", iconHeight: "14px", color: "Gray-Gray-500" })), index.h("ul", { key: 'b4dea28807780b086ba15161cee3e417efb2f2a1', class: { 'select-dropdown': true, 'expanded-select': this.open, 'collapsed-select': !this.open } }, COUNTRIES.map(option => (index.h("li", null, index.h("button", { type: "button", class: "option", onMouseDown: (e) => { e.preventDefault(); this.selectCountry(option); } }, index.h("img", { src: `https://flagsapi.com/${option.flag}/flat/24.png`, alt: option.flag }), option.code)))))), index.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) }))));
|
|
185
204
|
}
|
|
205
|
+
static get formAssociated() { return true; }
|
|
186
206
|
static get watchers() { return {
|
|
187
207
|
"codArea": [{
|
|
188
208
|
"codAreaChanged": 0
|
|
189
209
|
}],
|
|
210
|
+
"ngModelPhone": [{
|
|
211
|
+
"ngModelPhoneChanged": 0
|
|
212
|
+
}],
|
|
190
213
|
"selectedOption": [{
|
|
191
214
|
"selectedOptionChanged": 0
|
|
192
215
|
}]
|
|
@@ -8,7 +8,15 @@ const DropiRadioButton = class {
|
|
|
8
8
|
constructor(hostRef) {
|
|
9
9
|
index.registerInstance(this, hostRef);
|
|
10
10
|
this.dropiChange = index.createEvent(this, "dropiChange");
|
|
11
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
12
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
16
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
17
|
+
}
|
|
11
18
|
}
|
|
19
|
+
internals;
|
|
12
20
|
/** Label text displayed next to the radio */
|
|
13
21
|
label = '';
|
|
14
22
|
/** Input name (for grouping radio buttons) */
|
|
@@ -28,17 +36,26 @@ const DropiRadioButton = class {
|
|
|
28
36
|
if (val)
|
|
29
37
|
this.checked = false;
|
|
30
38
|
}
|
|
39
|
+
checkedChanged(val) {
|
|
40
|
+
this.internals.setFormValue(val ? 'on' : null);
|
|
41
|
+
}
|
|
42
|
+
componentWillLoad() {
|
|
43
|
+
this.internals.setFormValue(this.checked ? 'on' : null);
|
|
44
|
+
}
|
|
31
45
|
handleChange(e) {
|
|
32
46
|
this.checked = e.target.checked;
|
|
33
47
|
this.dropiChange.emit(e);
|
|
34
48
|
}
|
|
35
49
|
render() {
|
|
36
|
-
return (index.h("div", { key: '
|
|
50
|
+
return (index.h("div", { key: 'e4b54d9bda299b9150ebf9791925e0e7c3b9fb38', class: "dropi-radio-button" }, index.h("label", { key: '0a4c6443668477a2cb6b2d5a3d8bc1744a0fcffd', htmlFor: this.id }, index.h("input", { key: '6ba6b5af4bc061664dee0b6554c769613080dbb8', id: this.id, type: "radio", name: this.name, checked: this.checked, onChange: (e) => this.handleChange(e) }), this.label)));
|
|
37
51
|
}
|
|
38
52
|
static get formAssociated() { return true; }
|
|
39
53
|
static get watchers() { return {
|
|
40
54
|
"resetTrigger": [{
|
|
41
55
|
"onResetTrigger": 0
|
|
56
|
+
}],
|
|
57
|
+
"checked": [{
|
|
58
|
+
"checkedChanged": 0
|
|
42
59
|
}]
|
|
43
60
|
}; }
|
|
44
61
|
};
|
|
@@ -387,7 +387,7 @@ const DropiSelect = class {
|
|
|
387
387
|
]), !this.isGrouped && this.filteredOptions.map(opt => this.renderOption(opt)), this.filteredOptions.length === 0 && (index.h("li", { class: "no-results" }, "Sin resultados"))));
|
|
388
388
|
}
|
|
389
389
|
render() {
|
|
390
|
-
return (index.h("div", { key: '
|
|
390
|
+
return (index.h("div", { key: 'f09113a288d45bb5519503bb78c41e236913c1eb', class: "custom-select" }, !this.dropdownType && this.label && (index.h("label", { key: 'c0b59763dc3529d7f9bb5597a2bea0d38070a07b', class: { 'disabled-label': this.disabled } }, this.label, this.showObligatory && !this.disabled && index.h("span", { key: '6c8a47bdfc216231ba72420298b3bc8deeeae435', class: "asterisk" }, " *"))), index.h("div", { key: '8ec45010af1252effe34bb69d3f40ea277459511', class: "dropdown-container" }, this.dropdownType && this.label && (index.h("div", { key: 'b3f7f9adacd57b091baac662fc7be6fcd847c3a4', class: "left-label" }, this.label)), this.renderTrigger()), this.textHelper && !this.hasError && (index.h("div", { key: 'a4cce833b50b2bc62cb7142da420f81c0647e97e', class: "select-helper" }, index.h("span", { key: 'f69375abc2f66b5b1278895b8f313adabfa0f938' }, this.textHelper))), this.hasError && this.errorText && (index.h("div", { key: '6681bdbb705633d393adab09a889f3f1fb6fbe8a', class: "select-helper-error" }, index.h("dropi-icon", { key: '09521eeef2cf2a58cb74bea5bfae8a6d58d17682', name: "Warning-circle", iconWidth: "12px", iconHeight: "12px", color: "Error-Error-500" }), index.h("span", { key: '807820bb0a474079627bf12c20f4a034896785cd' }, this.errorText))), this.renderDropdown()));
|
|
391
391
|
}
|
|
392
392
|
static get formAssociated() { return true; }
|
|
393
393
|
static get watchers() { return {
|
|
@@ -8,22 +8,43 @@ const DropiSwitch = class {
|
|
|
8
8
|
constructor(hostRef) {
|
|
9
9
|
index.registerInstance(this, hostRef);
|
|
10
10
|
this.dropiChange = index.createEvent(this, "dropiChange");
|
|
11
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
12
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
16
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
17
|
+
}
|
|
11
18
|
}
|
|
19
|
+
internals;
|
|
20
|
+
/** Name for native form submission */
|
|
21
|
+
name = '';
|
|
12
22
|
/** Whether the switch is on */
|
|
13
23
|
isChecked = false;
|
|
14
24
|
/** Whether the switch is disabled */
|
|
15
25
|
disabled = false;
|
|
16
26
|
/** Emitted when the toggle state changes */
|
|
17
27
|
dropiChange;
|
|
28
|
+
checkedChanged(val) {
|
|
29
|
+
this.internals.setFormValue(val ? 'on' : null);
|
|
30
|
+
}
|
|
31
|
+
componentWillLoad() {
|
|
32
|
+
this.internals.setFormValue(this.isChecked ? 'on' : null);
|
|
33
|
+
}
|
|
18
34
|
onToggleChange(event) {
|
|
19
35
|
const input = event.target;
|
|
20
36
|
this.isChecked = input.checked;
|
|
21
37
|
this.dropiChange.emit(this.isChecked);
|
|
22
38
|
}
|
|
23
39
|
render() {
|
|
24
|
-
return (index.h("label", { key: '
|
|
40
|
+
return (index.h("label", { key: 'b3321fd96a1487210a920f5494708dc2eb05f10c', class: "toggle-switch" }, index.h("input", { key: 'ee7cfecf443a1c839ce145ade18cc3ff15924816', type: "checkbox", checked: this.isChecked, disabled: this.disabled, onChange: (e) => this.onToggleChange(e) }), index.h("span", { key: 'c0800bd9a7f52cf666b3e475265da223b852be9a', class: "slider" })));
|
|
25
41
|
}
|
|
26
42
|
static get formAssociated() { return true; }
|
|
43
|
+
static get watchers() { return {
|
|
44
|
+
"isChecked": [{
|
|
45
|
+
"checkedChanged": 0
|
|
46
|
+
}]
|
|
47
|
+
}; }
|
|
27
48
|
};
|
|
28
49
|
DropiSwitch.style = dropiSwitchCss();
|
|
29
50
|
|
|
@@ -94,10 +94,10 @@ const DropiTextArea = class {
|
|
|
94
94
|
this.value = val;
|
|
95
95
|
this.internals.setFormValue(val);
|
|
96
96
|
this.dropiInput.emit(val);
|
|
97
|
+
this.dropiChange.emit(val);
|
|
97
98
|
}
|
|
98
99
|
handleBlur() {
|
|
99
100
|
this.touched = true;
|
|
100
|
-
this.dropiChange.emit(this.value);
|
|
101
101
|
this.dropiBlur.emit();
|
|
102
102
|
}
|
|
103
103
|
get resolvedId() {
|
|
@@ -112,12 +112,12 @@ const DropiTextArea = class {
|
|
|
112
112
|
render() {
|
|
113
113
|
const showAsterisk = this.required && this.showObligatoryAsterisk && !this.disabled;
|
|
114
114
|
const showHelper = this.textHelper || this.isInvalid;
|
|
115
|
-
return (index.h("div", { key: '
|
|
115
|
+
return (index.h("div", { key: '8c25826a54d1f0bec06d8f70211d2bcd873d59a6', class: "textarea-wrapper" }, this.label && (index.h("label", { key: '58a578753a1248b185d2763aedf50eaaa152c791', htmlFor: this.resolvedId, style: { color: this.disabled ? 'var(--Gray-Gray-400)' : 'var(--Gray-Gray-600)' } }, this.label, showAsterisk && index.h("span", { key: 'cf31923103a7594f552df4ec86885f78d0c31779', class: "asterisk" }, " *"))), index.h("div", { key: '6ea60b6286fd4438389cfda0580379d8fe013adc', class: "textarea-container" }, index.h("textarea", { key: 'fc5e495d80bfd665e55480668b9fa7ed62651984', id: this.resolvedId, class: {
|
|
116
116
|
'form-control': true,
|
|
117
117
|
'Body-M-Regular': true,
|
|
118
118
|
'form-control-valid': !this.isInvalid && this.touched && !!this.value,
|
|
119
119
|
'form-control-invalid': this.isInvalid,
|
|
120
|
-
}, 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 && (index.h("div", { key: '
|
|
120
|
+
}, 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 && (index.h("div", { key: '07c350ce7a2e56b466229450645e6faece3d284b', class: "char-counter" }, this.charCount, "/", this.maxLength))), showHelper && (index.h("div", { key: 'c9fbd9a21b7e26fbd9571fc524b6f706404145d3', class: "form-control-helper" }, this.isInvalid && (index.h("dropi-icon", { key: '8fc6e34849f9e3175097597280a3bea9defb6bb0', name: "Warning-circle", iconWidth: "12px", iconHeight: "12px", color: "Error-Error-500" })), index.h("span", { key: '68bf62627efb3de92afe54f7803e322f5a0462e4', class: { 'invalid-color': this.isInvalid }, style: { color: this.disabled ? 'var(--Gray-Gray-400)' : undefined } }, this.textHelper)))));
|
|
121
121
|
}
|
|
122
122
|
static get formAssociated() { return true; }
|
|
123
123
|
static get watchers() { return {
|