@dropi/ui 0.1.50 → 0.1.52
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-date-picker-range.cjs.entry.js +210 -31
- package/dist/cjs/dropi-date-picker.cjs.entry.js +140 -55
- package/dist/cjs/dropi-drawer.cjs.entry.js +2 -2
- package/dist/cjs/dropi-empty-state.cjs.entry.js +1 -1
- package/dist/cjs/dropi-favorite-button.cjs.entry.js +1 -1
- package/dist/cjs/dropi-file-upload-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/dropi-file-upload.cjs.entry.js +1 -1
- package/dist/cjs/dropi-image-miniature.cjs.entry.js +1 -1
- package/dist/cjs/dropi-input_3.cjs.entry.js +2 -2
- package/dist/cjs/dropi-logo.cjs.entry.js +1 -1
- package/dist/cjs/dropi-navbar.cjs.entry.js +2 -2
- package/dist/cjs/dropi-otp-send-code.cjs.entry.js +2 -2
- package/dist/cjs/dropi-phone-input.cjs.entry.js +2 -2
- package/dist/cjs/dropi-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/dropi-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/dropi-read-more.cjs.entry.js +1 -1
- package/dist/cjs/dropi-select.cjs.entry.js +1 -1
- package/dist/cjs/dropi-switch.cjs.entry.js +1 -1
- package/dist/cjs/dropi-tag-type-product.cjs.entry.js +1 -1
- package/dist/cjs/dropi-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/dropi-ui.cjs.js +1 -1
- package/dist/cjs/dropi-youtube-lazy-video.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/dropi-date-picker/dropi-date-picker.css +119 -72
- package/dist/collection/components/dropi-date-picker/dropi-date-picker.js +169 -62
- package/dist/collection/components/dropi-date-picker-range/dropi-date-picker-range.css +223 -81
- package/dist/collection/components/dropi-date-picker-range/dropi-date-picker-range.js +251 -37
- package/dist/collection/components/dropi-drawer/dropi-drawer.js +2 -2
- package/dist/collection/components/dropi-empty-state/dropi-empty-state.js +1 -1
- package/dist/collection/components/dropi-favorite-button/dropi-favorite-button.js +1 -1
- package/dist/collection/components/dropi-file-upload/dropi-file-upload.js +1 -1
- package/dist/collection/components/dropi-file-upload-progress-bar/dropi-file-upload-progress-bar.js +1 -1
- package/dist/collection/components/dropi-image-miniature/dropi-image-miniature.js +1 -1
- package/dist/collection/components/dropi-logo/dropi-logo.js +1 -1
- package/dist/collection/components/dropi-navbar/dropi-navbar.js +2 -2
- package/dist/collection/components/dropi-otp-send-code/dropi-otp-send-code.js +2 -2
- package/dist/collection/components/dropi-paginator/dropi-paginator.js +2 -2
- package/dist/collection/components/dropi-phone-input/dropi-phone-input.js +2 -2
- package/dist/collection/components/dropi-progress-bar/dropi-progress-bar.js +1 -1
- package/dist/collection/components/dropi-radio-button/dropi-radio-button.js +1 -1
- package/dist/collection/components/dropi-read-more/dropi-read-more.js +1 -1
- package/dist/collection/components/dropi-select/dropi-select.js +1 -1
- package/dist/collection/components/dropi-switch/dropi-switch.js +1 -1
- package/dist/collection/components/dropi-tag-type-product/dropi-tag-type-product.js +1 -1
- package/dist/collection/components/dropi-tooltip/dropi-tooltip.js +1 -1
- package/dist/collection/components/dropi-youtube-lazy-video/dropi-youtube-lazy-video.js +1 -1
- package/dist/components/dropi-card-section.js +1 -1
- package/dist/components/dropi-date-picker-range.js +1 -1
- package/dist/components/dropi-date-picker.js +1 -1
- package/dist/components/dropi-drawer.js +1 -1
- package/dist/components/dropi-empty-state.js +1 -1
- package/dist/components/dropi-favorite-button.js +1 -1
- package/dist/components/dropi-file-upload-progress-bar.js +1 -1
- package/dist/components/dropi-file-upload.js +1 -1
- package/dist/components/dropi-image-miniature.js +1 -1
- package/dist/components/dropi-logo.js +1 -1
- package/dist/components/dropi-navbar.js +1 -1
- package/dist/components/dropi-otp-send-code.js +1 -1
- package/dist/components/dropi-paginator.js +1 -1
- package/dist/components/dropi-phone-input.js +1 -1
- package/dist/components/dropi-progress-bar.js +1 -1
- package/dist/components/dropi-radio-button.js +1 -1
- package/dist/components/dropi-read-more.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-tag-type-product.js +1 -1
- package/dist/components/dropi-tooltip.js +1 -1
- package/dist/components/dropi-youtube-lazy-video.js +1 -1
- package/dist/components/p-34gP610W.js +1 -0
- package/dist/components/p-BfQEGsBq.js +1 -0
- package/dist/components/p-BieZ2Zwa.js +1 -0
- package/dist/components/p-Ckpdx21D.js +1 -0
- package/dist/components/p-CqTImUhL.js +1 -0
- package/dist/components/p-D76mTEoh.js +1 -0
- package/dist/components/p-DdM0zO53.js +1 -0
- package/dist/components/p-eusoHxve.js +1 -0
- package/dist/docs.json +93 -18
- package/dist/dropi-ui/dropi-accordion-item.entry.js +1 -1
- package/dist/dropi-ui/dropi-accordion.entry.js +1 -1
- package/dist/dropi-ui/dropi-alert-legacy.entry.js +1 -1
- package/dist/dropi-ui/dropi-alert-modal.entry.js +15 -9
- package/dist/dropi-ui/dropi-alert-modal.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-alert.entry.js +1 -1
- package/dist/dropi-ui/dropi-avatars.entry.js +1 -1
- package/dist/dropi-ui/dropi-badge-legacy.entry.js +1 -1
- package/dist/dropi-ui/dropi-badge.entry.js +1 -1
- package/dist/dropi-ui/dropi-banner-external.entry.js +1 -1
- package/dist/dropi-ui/dropi-breadcrumb.entry.js +1 -1
- package/dist/dropi-ui/dropi-button.entry.js +1 -1
- package/dist/dropi-ui/dropi-card-checkbox.entry.js +2 -2
- package/dist/dropi-ui/dropi-card-checkbox.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-card-product.entry.js +1 -1
- package/dist/dropi-ui/dropi-card-section.entry.js +2 -2
- package/dist/dropi-ui/dropi-card-section.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-carousel.entry.js +1 -1
- package/dist/dropi-ui/dropi-checkbox-selection-list.entry.js +2 -2
- package/dist/dropi-ui/dropi-checkbox-selection-list.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-checkbox.entry.js +4 -4
- package/dist/dropi-ui/dropi-checkbox.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-chips.entry.js +1 -1
- package/dist/dropi-ui/dropi-city-selector.entry.js +1 -1
- package/dist/dropi-ui/dropi-color-picker.entry.js +1 -1
- package/dist/dropi-ui/dropi-country-flags.entry.js +1 -1
- package/dist/dropi-ui/dropi-country-selector.entry.js +4 -4
- package/dist/dropi-ui/dropi-country-selector.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-date-picker-range.entry.js +211 -32
- package/dist/dropi-ui/dropi-date-picker-range.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-date-picker.entry.js +104 -57
- package/dist/dropi-ui/dropi-date-picker.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-drawer.entry.js +3 -3
- package/dist/dropi-ui/dropi-dropdown.entry.js +2 -2
- package/dist/dropi-ui/dropi-dropdown.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-empty-state.entry.js +88 -11
- package/dist/dropi-ui/dropi-empty-state.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-favorite-button.entry.js +2 -2
- package/dist/dropi-ui/dropi-file-upload-progress-bar.entry.js +2 -2
- package/dist/dropi-ui/dropi-file-upload.entry.js +2 -2
- package/dist/dropi-ui/dropi-icon.entry.js +295 -24
- package/dist/dropi-ui/dropi-icon.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-ilustration-icon.entry.js +11 -7
- package/dist/dropi-ui/dropi-ilustration-icon.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-image-miniature.entry.js +2 -2
- package/dist/dropi-ui/dropi-image-overlay.entry.js +1 -1
- package/dist/dropi-ui/dropi-input.entry.js +8 -6
- package/dist/dropi-ui/dropi-input.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-languages-selector.entry.js +1 -1
- package/dist/dropi-ui/dropi-logo.entry.js +2 -2
- package/dist/dropi-ui/dropi-lottie-loader.entry.js +2 -2
- package/dist/dropi-ui/dropi-lottie-loader.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-media-player.entry.js +1 -1
- package/dist/dropi-ui/dropi-modal.entry.js +1 -1
- package/dist/dropi-ui/dropi-navbar.entry.js +3 -3
- package/dist/dropi-ui/dropi-otp-send-code.entry.js +4 -4
- package/dist/dropi-ui/dropi-otp-send-code.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-paginator.entry.js +3 -3
- package/dist/dropi-ui/dropi-phone-input.entry.js +4 -4
- package/dist/dropi-ui/dropi-phone-input.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-progress-bar.entry.js +2 -2
- package/dist/dropi-ui/dropi-radio-button.entry.js +4 -4
- package/dist/dropi-ui/dropi-radio-button.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-radio-selection-list.entry.js +1 -1
- package/dist/dropi-ui/dropi-read-more.entry.js +2 -2
- package/dist/dropi-ui/dropi-search.entry.js +2 -2
- package/dist/dropi-ui/dropi-search.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-select.entry.js +3 -3
- package/dist/dropi-ui/dropi-select.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-sidebar.entry.js +1 -1
- package/dist/dropi-ui/dropi-simple-stepper.entry.js +1 -1
- package/dist/dropi-ui/dropi-skeleton.entry.js +1 -1
- package/dist/dropi-ui/dropi-steps.entry.js +1 -1
- package/dist/dropi-ui/dropi-switch.entry.js +3 -3
- package/dist/dropi-ui/dropi-switch.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-table.entry.js +4 -4
- package/dist/dropi-ui/dropi-table.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-tabs.entry.js +1 -1
- package/dist/dropi-ui/dropi-tag-type-product.entry.js +2 -2
- package/dist/dropi-ui/dropi-tag.entry.js +1 -1
- package/dist/dropi-ui/dropi-text-area.entry.js +8 -8
- package/dist/dropi-ui/dropi-text-area.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-time-line.entry.js +1 -1
- package/dist/dropi-ui/dropi-toast.entry.js +1 -1
- package/dist/dropi-ui/dropi-tooltip-v2.entry.js +1 -1
- package/dist/dropi-ui/dropi-tooltip.entry.js +2 -2
- package/dist/dropi-ui/dropi-ui.esm.js +1 -1
- package/dist/dropi-ui/dropi-ui.esm.js.map +1 -1
- package/dist/dropi-ui/dropi-vertical-steps.entry.js +1 -1
- package/dist/dropi-ui/dropi-youtube-lazy-video.entry.js +2 -2
- package/dist/dropi-ui/index-CPacpXAJ.js +4625 -0
- package/dist/dropi-ui/index-CPacpXAJ.js.map +1 -0
- package/dist/dropi-ui/p-0190a96b.entry.js +1 -0
- package/dist/dropi-ui/p-02e0f8cc.entry.js +1 -0
- package/dist/dropi-ui/p-0551c30a.entry.js +1 -0
- package/dist/dropi-ui/p-05541247.entry.js +1 -0
- package/dist/dropi-ui/p-07cc280c.entry.js +1 -0
- package/dist/dropi-ui/p-094ab555.entry.js +1 -0
- package/dist/dropi-ui/p-0d3cabe9.entry.js +1 -0
- package/dist/dropi-ui/p-0d8ff50d.entry.js +1 -0
- package/dist/dropi-ui/p-11833072.entry.js +1 -0
- package/dist/dropi-ui/p-119a353b.entry.js +1 -0
- package/dist/dropi-ui/p-13ae29ad.entry.js +1 -0
- package/dist/dropi-ui/p-149c92ba.entry.js +1 -0
- package/dist/dropi-ui/p-17133bc1.entry.js +1 -0
- package/dist/dropi-ui/p-181b2d76.entry.js +1 -0
- package/dist/dropi-ui/p-1976985d.entry.js +1 -0
- package/dist/dropi-ui/p-1a874d9f.entry.js +1 -0
- package/dist/dropi-ui/p-1cc30188.entry.js +1 -0
- package/dist/dropi-ui/p-267fda26.entry.js +1 -0
- package/dist/dropi-ui/p-26c997a4.entry.js +1 -0
- package/dist/dropi-ui/p-280c5731.entry.js +1 -0
- package/dist/dropi-ui/p-287a3a81.entry.js +1 -0
- package/dist/dropi-ui/p-29e4dacf.entry.js +1 -0
- package/dist/dropi-ui/p-2af47f62.entry.js +1 -0
- package/dist/dropi-ui/p-2d1a6f05.entry.js +1 -0
- package/dist/dropi-ui/p-2f6b96de.entry.js +1 -0
- package/dist/dropi-ui/p-32512758.entry.js +1 -0
- package/dist/dropi-ui/p-32c71a16.entry.js +1 -0
- package/dist/dropi-ui/p-34f2e28d.entry.js +1 -0
- package/dist/dropi-ui/p-3769ad78.entry.js +1 -0
- package/dist/dropi-ui/p-3a9cd930.entry.js +1 -0
- package/dist/dropi-ui/p-3b1bb32e.entry.js +1 -0
- package/dist/dropi-ui/p-4390c849.entry.js +1 -0
- package/dist/dropi-ui/p-492f9d36.entry.js +1 -0
- package/dist/dropi-ui/p-4f498d26.entry.js +1 -0
- package/dist/dropi-ui/p-4f4b4a39.entry.js +1 -0
- package/dist/dropi-ui/p-51a44cdc.entry.js +1 -0
- package/dist/dropi-ui/p-59caf3ac.entry.js +1 -0
- package/dist/dropi-ui/p-5e0b54e3.entry.js +1 -0
- package/dist/dropi-ui/p-63356807.entry.js +1 -0
- package/dist/dropi-ui/p-64dd3db0.entry.js +1 -0
- package/dist/dropi-ui/p-65e31926.entry.js +1 -0
- package/dist/dropi-ui/p-66cf3dbe.entry.js +1 -0
- package/dist/dropi-ui/p-6a6171ba.entry.js +1 -0
- package/dist/dropi-ui/p-6aaf5a93.entry.js +1 -0
- package/dist/dropi-ui/p-6d9b61a9.entry.js +1 -0
- package/dist/dropi-ui/p-71ad00c8.entry.js +1 -0
- package/dist/dropi-ui/p-788b7388.entry.js +1 -0
- package/dist/dropi-ui/p-7a78e38d.entry.js +1 -0
- package/dist/dropi-ui/p-7a9628df.entry.js +1 -0
- package/dist/dropi-ui/p-7be214a0.entry.js +1 -0
- package/dist/dropi-ui/p-7ce74f7f.entry.js +1 -0
- package/dist/dropi-ui/p-7e0783d3.entry.js +1 -0
- package/dist/dropi-ui/p-7f6f757b.entry.js +1 -0
- package/dist/dropi-ui/p-7f85578a.entry.js +1 -0
- package/dist/dropi-ui/p-81e8b29e.entry.js +1 -0
- package/dist/dropi-ui/p-83fa5e18.entry.js +1 -0
- package/dist/dropi-ui/p-870846af.entry.js +1 -0
- package/dist/dropi-ui/p-87167578.entry.js +1 -0
- package/dist/dropi-ui/p-8adb80a4.entry.js +1 -0
- package/dist/dropi-ui/p-92879d0d.entry.js +1 -0
- package/dist/dropi-ui/p-964ba5de.entry.js +1 -0
- package/dist/dropi-ui/p-97de6718.entry.js +1 -0
- package/dist/dropi-ui/p-9b7810f9.entry.js +1 -0
- package/dist/dropi-ui/p-9bfd53be.entry.js +1 -0
- package/dist/dropi-ui/p-9c9c6274.entry.js +1 -0
- package/dist/dropi-ui/p-a0a87272.entry.js +1 -0
- package/dist/dropi-ui/p-a1471797.entry.js +1 -0
- package/dist/dropi-ui/p-a469a6d4.entry.js +1 -0
- package/dist/dropi-ui/p-ad7ea336.entry.js +1 -0
- package/dist/dropi-ui/p-b063716d.entry.js +1 -0
- package/dist/dropi-ui/p-b4e9dba6.entry.js +1 -0
- package/dist/dropi-ui/p-b66d88bf.entry.js +1 -0
- package/dist/dropi-ui/p-b801e55f.entry.js +1 -0
- package/dist/dropi-ui/p-bb6b09b7.entry.js +1 -0
- package/dist/dropi-ui/p-c6c40748.entry.js +1 -0
- package/dist/dropi-ui/p-c72650a6.entry.js +1 -0
- package/dist/dropi-ui/p-d104c97d.entry.js +1 -0
- package/dist/dropi-ui/p-d6ab011e.entry.js +1 -0
- package/dist/dropi-ui/p-d7d7b98b.entry.js +1 -0
- package/dist/dropi-ui/p-d9f7e521.entry.js +1 -0
- package/dist/dropi-ui/p-e0641dc8.entry.js +1 -0
- package/dist/dropi-ui/p-e0d43ef4.entry.js +1 -0
- package/dist/dropi-ui/p-e2413d09.entry.js +1 -0
- package/dist/dropi-ui/p-e3339048.entry.js +1 -0
- package/dist/dropi-ui/p-eac3194d.entry.js +1 -0
- package/dist/dropi-ui/p-eed4f130.entry.js +1 -0
- package/dist/dropi-ui/p-f03f0bf3.entry.js +1 -0
- package/dist/dropi-ui/p-f1457004.entry.js +1 -0
- package/dist/dropi-ui/p-f50b982c.entry.js +1 -0
- package/dist/dropi-ui/p-f87589c0.entry.js +1 -0
- package/dist/dropi-ui/p-fce82770.entry.js +1 -0
- package/dist/esm/dropi-date-picker-range.entry.js +211 -32
- package/dist/esm/dropi-date-picker.entry.js +140 -55
- package/dist/esm/dropi-drawer.entry.js +2 -2
- package/dist/esm/dropi-empty-state.entry.js +1 -1
- package/dist/esm/dropi-favorite-button.entry.js +1 -1
- package/dist/esm/dropi-file-upload-progress-bar.entry.js +1 -1
- package/dist/esm/dropi-file-upload.entry.js +1 -1
- package/dist/esm/dropi-image-miniature.entry.js +1 -1
- package/dist/esm/dropi-input_3.entry.js +2 -2
- package/dist/esm/dropi-logo.entry.js +1 -1
- package/dist/esm/dropi-navbar.entry.js +2 -2
- package/dist/esm/dropi-otp-send-code.entry.js +2 -2
- package/dist/esm/dropi-phone-input.entry.js +2 -2
- package/dist/esm/dropi-progress-bar.entry.js +1 -1
- package/dist/esm/dropi-radio-button.entry.js +1 -1
- package/dist/esm/dropi-read-more.entry.js +1 -1
- package/dist/esm/dropi-select.entry.js +1 -1
- package/dist/esm/dropi-switch.entry.js +1 -1
- package/dist/esm/dropi-tag-type-product.entry.js +1 -1
- package/dist/esm/dropi-tooltip.entry.js +1 -1
- package/dist/esm/dropi-ui.js +1 -1
- package/dist/esm/dropi-youtube-lazy-video.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/dropi-date-picker/dropi-date-picker.d.ts +22 -9
- package/dist/types/components/dropi-date-picker-range/dropi-date-picker-range.d.ts +27 -8
- package/dist/types/components.d.ts +40 -36
- package/hydrate/index.js +390 -117
- package/hydrate/index.mjs +390 -117
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ const MONTHS_ES = [
|
|
|
3
3
|
'Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio',
|
|
4
4
|
'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'
|
|
5
5
|
];
|
|
6
|
+
const MONTHS_SHORT = ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'];
|
|
6
7
|
const DAYS_ES = ['Do', 'Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sa'];
|
|
7
8
|
/**
|
|
8
9
|
* @component dropi-date-picker
|
|
@@ -13,16 +14,14 @@ export class DropiDatePicker {
|
|
|
13
14
|
internals;
|
|
14
15
|
/** Name for native form submission */
|
|
15
16
|
name;
|
|
16
|
-
/** Selected date (ISO string, single mode)
|
|
17
|
+
/** Selected date (ISO string, single mode) */
|
|
17
18
|
selectedDate = '';
|
|
18
19
|
/** Range start date (ISO string, range mode) */
|
|
19
20
|
startDate = '';
|
|
20
21
|
/** Range end date (ISO string, range mode) */
|
|
21
22
|
endDate = '';
|
|
22
|
-
valueChanged() {
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
/** Enable range selection - matches Angular selectionMode */
|
|
23
|
+
valueChanged() { this.updateFormValue(); }
|
|
24
|
+
/** Enable range selection */
|
|
26
25
|
selectionMode = 'single';
|
|
27
26
|
/** Min selectable date (ISO string) */
|
|
28
27
|
minDate = '';
|
|
@@ -34,29 +33,28 @@ export class DropiDatePicker {
|
|
|
34
33
|
placeholder = 'DD/MM/YYYY';
|
|
35
34
|
/** Disabled */
|
|
36
35
|
disabled = false;
|
|
37
|
-
/** Is invalid state
|
|
36
|
+
/** Is invalid state */
|
|
38
37
|
isInvalid = false;
|
|
39
|
-
/** Loading state
|
|
38
|
+
/** Loading state */
|
|
40
39
|
loading = false;
|
|
40
|
+
/** Hide "Hoy" shortcut */
|
|
41
|
+
hideTodayShortcut = false;
|
|
41
42
|
open = false;
|
|
42
43
|
viewYear = new Date().getFullYear();
|
|
43
44
|
viewMonth = new Date().getMonth();
|
|
44
45
|
hoverDate = '';
|
|
46
|
+
viewMode = 'day';
|
|
47
|
+
activeShortcut = -1;
|
|
45
48
|
el;
|
|
46
49
|
handleDocClick(e) {
|
|
47
50
|
if (this.open && !e.composedPath().includes(this.el)) {
|
|
48
51
|
this.open = false;
|
|
49
52
|
}
|
|
50
53
|
}
|
|
51
|
-
/** Emitted when date selected — matches Angular 'onChangeDate' */
|
|
52
54
|
dropiChangeDate;
|
|
53
|
-
/** Emitted when panel closes — matches Angular 'onClosePanel' */
|
|
54
55
|
dropiClosePanel;
|
|
55
|
-
/** Emitted when range selected */
|
|
56
56
|
dropiRangeChange;
|
|
57
|
-
componentWillLoad() {
|
|
58
|
-
this.updateFormValue();
|
|
59
|
-
}
|
|
57
|
+
componentWillLoad() { this.updateFormValue(); }
|
|
60
58
|
updateFormValue() {
|
|
61
59
|
if (this.selectionMode === 'range') {
|
|
62
60
|
this.internals.setFormValue(this.startDate && this.endDate ? `${this.startDate},${this.endDate}` : '');
|
|
@@ -88,23 +86,96 @@ export class DropiDatePicker {
|
|
|
88
86
|
this.viewYear = d.getFullYear();
|
|
89
87
|
this.viewMonth = d.getMonth();
|
|
90
88
|
}
|
|
89
|
+
this.viewMode = 'day';
|
|
91
90
|
this.open = true;
|
|
92
91
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
get decadeStart() {
|
|
93
|
+
return Math.floor(this.viewYear / 10) * 10;
|
|
94
|
+
}
|
|
95
|
+
get navTitle() {
|
|
96
|
+
if (this.viewMode === 'day')
|
|
97
|
+
return `${MONTHS_ES[this.viewMonth]} ${this.viewYear}`;
|
|
98
|
+
if (this.viewMode === 'month')
|
|
99
|
+
return `${this.viewYear}`;
|
|
100
|
+
return `${this.decadeStart}-${this.decadeStart + 9}`;
|
|
101
|
+
}
|
|
102
|
+
cycleView() {
|
|
103
|
+
if (this.viewMode === 'day')
|
|
104
|
+
this.viewMode = 'month';
|
|
105
|
+
else if (this.viewMode === 'month')
|
|
106
|
+
this.viewMode = 'year';
|
|
107
|
+
}
|
|
108
|
+
prevNav() {
|
|
109
|
+
if (this.viewMode === 'day') {
|
|
110
|
+
if (this.viewMonth === 0) {
|
|
111
|
+
this.viewMonth = 11;
|
|
112
|
+
this.viewYear--;
|
|
113
|
+
}
|
|
114
|
+
else
|
|
115
|
+
this.viewMonth--;
|
|
116
|
+
}
|
|
117
|
+
else if (this.viewMode === 'month') {
|
|
96
118
|
this.viewYear--;
|
|
97
119
|
}
|
|
98
|
-
else
|
|
99
|
-
this.
|
|
120
|
+
else {
|
|
121
|
+
this.viewYear = this.decadeStart - 10;
|
|
122
|
+
}
|
|
100
123
|
}
|
|
101
|
-
|
|
102
|
-
if (this.
|
|
103
|
-
this.viewMonth
|
|
124
|
+
nextNav() {
|
|
125
|
+
if (this.viewMode === 'day') {
|
|
126
|
+
if (this.viewMonth === 11) {
|
|
127
|
+
this.viewMonth = 0;
|
|
128
|
+
this.viewYear++;
|
|
129
|
+
}
|
|
130
|
+
else
|
|
131
|
+
this.viewMonth++;
|
|
132
|
+
}
|
|
133
|
+
else if (this.viewMode === 'month') {
|
|
104
134
|
this.viewYear++;
|
|
105
135
|
}
|
|
106
|
-
else
|
|
107
|
-
this.
|
|
136
|
+
else {
|
|
137
|
+
this.viewYear = this.decadeStart + 10;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
selectMonth(month) {
|
|
141
|
+
this.viewMonth = month;
|
|
142
|
+
this.viewMode = 'day';
|
|
143
|
+
}
|
|
144
|
+
selectYear(year) {
|
|
145
|
+
this.viewYear = year;
|
|
146
|
+
this.viewMode = 'month';
|
|
147
|
+
}
|
|
148
|
+
get today() {
|
|
149
|
+
return new Date().toISOString().slice(0, 10);
|
|
150
|
+
}
|
|
151
|
+
daysAgo(n) {
|
|
152
|
+
const d = new Date();
|
|
153
|
+
d.setDate(d.getDate() - n);
|
|
154
|
+
return d.toISOString().slice(0, 10);
|
|
155
|
+
}
|
|
156
|
+
get shortcuts() {
|
|
157
|
+
const all = [
|
|
158
|
+
{ label: 'Hoy', start: this.today, end: this.today },
|
|
159
|
+
{ label: 'Últimos 7 días', start: this.daysAgo(6), end: this.today },
|
|
160
|
+
{ label: 'Últimos 15 días', start: this.daysAgo(14), end: this.today },
|
|
161
|
+
{ label: 'Últimos 30 días', start: this.daysAgo(29), end: this.today },
|
|
162
|
+
{ label: 'Últimos 90 días', start: this.daysAgo(89), end: this.today },
|
|
163
|
+
];
|
|
164
|
+
return this.hideTodayShortcut ? all.slice(1) : all;
|
|
165
|
+
}
|
|
166
|
+
selectShortcut(idx) {
|
|
167
|
+
const s = this.shortcuts[idx];
|
|
168
|
+
this.activeShortcut = idx;
|
|
169
|
+
if (this.selectionMode === 'range') {
|
|
170
|
+
this.startDate = s.start;
|
|
171
|
+
this.endDate = s.end;
|
|
172
|
+
this.dropiRangeChange.emit({ start: s.start, end: s.end });
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
this.selectedDate = s.end;
|
|
176
|
+
this.dropiChangeDate.emit(s.end);
|
|
177
|
+
}
|
|
178
|
+
this.open = false;
|
|
108
179
|
}
|
|
109
180
|
toISO(year, month, day) {
|
|
110
181
|
return `${year}-${String(month + 1).padStart(2, '0')}-${String(day).padStart(2, '0')}`;
|
|
@@ -135,7 +206,6 @@ export class DropiDatePicker {
|
|
|
135
206
|
this.dropiChangeDate.emit(iso);
|
|
136
207
|
return;
|
|
137
208
|
}
|
|
138
|
-
// Range mode
|
|
139
209
|
if (!this.startDate || (this.startDate && this.endDate)) {
|
|
140
210
|
this.startDate = iso;
|
|
141
211
|
this.endDate = '';
|
|
@@ -156,23 +226,18 @@ export class DropiDatePicker {
|
|
|
156
226
|
const year = this.viewYear;
|
|
157
227
|
const month = this.viewMonth;
|
|
158
228
|
const firstDay = new Date(year, month, 1).getDay();
|
|
159
|
-
// Adjust to Sunday-first
|
|
160
|
-
const startOffset = firstDay;
|
|
161
229
|
const daysInMonth = new Date(year, month + 1, 0).getDate();
|
|
162
230
|
const daysInPrevMonth = new Date(year, month, 0).getDate();
|
|
163
231
|
const cells = [];
|
|
164
|
-
|
|
165
|
-
for (let i = startOffset - 1; i >= 0; i--) {
|
|
232
|
+
for (let i = firstDay - 1; i >= 0; i--) {
|
|
166
233
|
const d = daysInPrevMonth - i;
|
|
167
234
|
const m = month === 0 ? 11 : month - 1;
|
|
168
235
|
const y = month === 0 ? year - 1 : year;
|
|
169
236
|
cells.push({ iso: this.toISO(y, m, d), day: d, currentMonth: false });
|
|
170
237
|
}
|
|
171
|
-
// Current month
|
|
172
238
|
for (let d = 1; d <= daysInMonth; d++) {
|
|
173
239
|
cells.push({ iso: this.toISO(year, month, d), day: d, currentMonth: true });
|
|
174
240
|
}
|
|
175
|
-
// Next month filler
|
|
176
241
|
const remaining = 42 - cells.length;
|
|
177
242
|
for (let d = 1; d <= remaining; d++) {
|
|
178
243
|
const m = month === 11 ? 0 : month + 1;
|
|
@@ -181,15 +246,9 @@ export class DropiDatePicker {
|
|
|
181
246
|
}
|
|
182
247
|
return cells;
|
|
183
248
|
}
|
|
184
|
-
|
|
249
|
+
renderDayView(today) {
|
|
185
250
|
const days = this.buildDays();
|
|
186
|
-
|
|
187
|
-
return (h("div", { key: 'd2f6248ff409e53e916e266ab5d23136e9da76d0', class: "dp-wrap" }, this.label && h("label", { key: 'ba51f4091f18437e4449c05378def5b099883acd', class: "dp-label" }, this.label), h("button", { key: '88eb474ca75c9b62996765bdb4816a8cfc14bb8e', class: {
|
|
188
|
-
'dp-trigger': true,
|
|
189
|
-
'dp-trigger--disabled': this.disabled,
|
|
190
|
-
'dp-trigger--invalid': this.isInvalid,
|
|
191
|
-
'dp-trigger--loading': this.loading
|
|
192
|
-
}, onClick: () => this.open ? this.open = false : this.open_(), disabled: this.disabled || this.loading, type: "button" }, h("dropi-icon", { key: '1044cef59317f88cc472d2a466a6937a0c4d58f7', name: "Calendar", iconWidth: "16px", iconHeight: "16px", color: "Gray-Gray-400" }), h("span", { key: '6a7c5687cd06b9b2f42c256bc03ff0f412ca5573', class: { 'dp-trigger__value': true, 'dp-trigger__placeholder': !this.displayValue } }, this.displayValue || this.placeholder), h("dropi-icon", { key: '4be1fc67ed6f9ffb5a5d936e3e8d8330bb91fb0b', name: "Arrow-Down-2", iconWidth: "12px", iconHeight: "12px", color: "Gray-Gray-400" })), this.open && (h("div", { key: '5ad107e256d62a46b57e4bd1bebead70ecc8e46c', class: "dp-popup" }, h("div", { key: 'e3d51afbd24df88867777e43c9bd63dd41c3f542', class: "dp-nav" }, h("button", { key: '8819f79389c1d50ec639f719228aab88be4d0335', class: "dp-nav__btn", onClick: () => this.prevMonth(), type: "button" }, h("dropi-icon", { key: 'a17004ad24ce40590474d91227a826f46edf50ba', name: "Arrow-Left-2", iconWidth: "16px", iconHeight: "16px", color: "Gray-Gray-600" })), h("span", { key: 'e91c8a46b963a1e7f0d01c56610c2e4bb6fa3d39', class: "dp-nav__title" }, h("span", { key: '214a575cbd83e8c3bafe64ffbd93e914119b09aa' }, MONTHS_ES[this.viewMonth]), h("span", { key: '1f71a83e7110bf8a91f7b5e14e0400b09ba28e1a' }, this.viewYear)), h("button", { key: '21dbc0fdaabc423bd864bfb33ba314b72ca62d48', class: "dp-nav__btn", onClick: () => this.nextMonth(), type: "button" }, h("dropi-icon", { key: 'f248e65855555878afdbda7d1ba9a802d9eae4d5', name: "Arrow-Right-2", iconWidth: "16px", iconHeight: "16px", color: "Gray-Gray-600" }))), h("div", { key: '4fb29792028bf2132ea78a105c7694cf3806ff05', class: "dp-grid" }, DAYS_ES.map(d => (h("div", { class: "dp-day-header" }, d))), days.map(({ iso, day, currentMonth }) => {
|
|
251
|
+
return (h("div", { class: "dp-grid" }, DAYS_ES.map(d => h("div", { class: "dp-day-header" }, d)), days.map(({ iso, day, currentMonth }) => {
|
|
193
252
|
const isSelected = this.selectionMode !== 'range'
|
|
194
253
|
? iso === this.selectedDate
|
|
195
254
|
: iso === this.startDate || iso === this.endDate;
|
|
@@ -211,22 +270,48 @@ export class DropiDatePicker {
|
|
|
211
270
|
if (this.selectionMode === 'range' && this.startDate && !this.endDate)
|
|
212
271
|
this.hoverDate = iso;
|
|
213
272
|
}, onMouseLeave: () => this.hoverDate = '' }, day));
|
|
214
|
-
}))
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
273
|
+
})));
|
|
274
|
+
}
|
|
275
|
+
renderMonthView() {
|
|
276
|
+
const todayMonth = new Date().getMonth();
|
|
277
|
+
const todayYear = new Date().getFullYear();
|
|
278
|
+
return (h("div", { class: "dp-month-grid" }, MONTHS_SHORT.map((name, idx) => {
|
|
279
|
+
const isSelected = idx === this.viewMonth;
|
|
280
|
+
const isCurrent = idx === todayMonth && this.viewYear === todayYear;
|
|
281
|
+
return (h("button", { class: {
|
|
282
|
+
'dp-month-cell': true,
|
|
283
|
+
'dp-month-cell--selected': isSelected,
|
|
284
|
+
'dp-month-cell--current': isCurrent && !isSelected,
|
|
285
|
+
}, type: "button", onClick: () => this.selectMonth(idx) }, name));
|
|
286
|
+
})));
|
|
287
|
+
}
|
|
288
|
+
renderYearView() {
|
|
289
|
+
const currentYear = new Date().getFullYear();
|
|
290
|
+
const start = this.decadeStart;
|
|
291
|
+
const years = Array.from({ length: 10 }, (_, i) => start + i);
|
|
292
|
+
return (h("div", { class: "dp-year-grid" }, years.map(year => {
|
|
293
|
+
const isSelected = year === this.viewYear;
|
|
294
|
+
const isCurrent = year === currentYear;
|
|
295
|
+
return (h("button", { class: {
|
|
296
|
+
'dp-year-cell': true,
|
|
297
|
+
'dp-year-cell--selected': isSelected,
|
|
298
|
+
'dp-year-cell--current': isCurrent && !isSelected,
|
|
299
|
+
}, type: "button", onClick: () => this.selectYear(year) }, year));
|
|
300
|
+
})));
|
|
301
|
+
}
|
|
302
|
+
render() {
|
|
303
|
+
const today = new Date().toISOString().slice(0, 10);
|
|
304
|
+
return (h("div", { key: '6ae00de99b93a13faba81ac027c292b9624d0336', class: "dp-wrap" }, this.label && h("label", { key: '9282bb57332ebaef9861702d80759d641ea21757', class: "dp-label" }, this.label), h("button", { key: '1fe5d5fcd8ce1c0b151381d9c249c401d322f78a', class: {
|
|
305
|
+
'dp-trigger': true,
|
|
306
|
+
'dp-trigger--disabled': this.disabled,
|
|
307
|
+
'dp-trigger--invalid': this.isInvalid,
|
|
308
|
+
'dp-trigger--loading': this.loading
|
|
309
|
+
}, onClick: () => this.open ? this.open = false : this.open_(), disabled: this.disabled || this.loading, type: "button" }, h("dropi-icon", { key: '560cf80eb7652543b9000e375b213a3dba91060b', name: "Calendar", iconWidth: "16px", iconHeight: "16px", color: "Gray-Gray-400" }), h("span", { key: '3bdc45bd4706502af4050475e709c15beebce028', class: { 'dp-trigger__value': true, 'dp-trigger__placeholder': !this.displayValue } }, this.displayValue || this.placeholder)), this.open && (h("div", { key: 'e21053dd38d62ab43c01f337fbbeb8b36e70680c', class: "dp-popup" }, h("div", { key: 'd6c8fc40ec4bd11bcd5bf3d8b3706c4c62099bbf', class: "dp-calendar" }, h("div", { key: 'cf8f21d301592077851a44eb588418302240598f', class: "dp-nav" }, h("button", { key: '28702d76d499cec07cd69d7bd23f5eb0369d288f', class: "dp-nav__btn", onClick: () => this.prevNav(), type: "button" }, h("dropi-icon", { key: '18b1c6fb2ea5f51b4a4b59592c7d89c5406c6c39', name: "dropdown-left", iconWidth: "16px", iconHeight: "16px", color: "Gray-Gray-600" })), h("button", { key: '755274772a90deae38d613da369863aefe95e297', class: "dp-nav__title", onClick: () => this.cycleView(), type: "button" }, this.viewMode === 'day'
|
|
310
|
+
? [h("span", null, MONTHS_ES[this.viewMonth]), h("span", null, this.viewYear)]
|
|
311
|
+
: h("span", null, this.navTitle)), h("button", { key: '6442690df1e434f9fb0128327f8f07c3cecbed4c', class: "dp-nav__btn", onClick: () => this.nextNav(), type: "button" }, h("dropi-icon", { key: '00525ae2cbe5cc8a881d165141de10ce3d72e439', name: "dropdown-right", iconWidth: "16px", iconHeight: "16px", color: "Gray-Gray-600" }))), this.viewMode === 'day' && this.renderDayView(today), this.viewMode === 'month' && this.renderMonthView(), this.viewMode === 'year' && this.renderYearView()), this.selectionMode === 'range' && [
|
|
312
|
+
h("div", { key: '688df97b843c3c3342fc301d6c6c74ec88921d68', class: "dp-divider" }),
|
|
313
|
+
h("div", { key: '2c75f7b004812ee1eb18bbc349f03ab55623cd9f', class: "dp-shortcuts" }, this.shortcuts.map((s, i) => (h("button", { key: i, class: { 'shortcut-btn': true, 'shortcut-btn--active': this.activeShortcut === i }, onClick: () => this.selectShortcut(i), type: "button" }, s.label))))
|
|
314
|
+
]))));
|
|
230
315
|
}
|
|
231
316
|
static get is() { return "dropi-date-picker"; }
|
|
232
317
|
static get encapsulation() { return "shadow"; }
|
|
@@ -274,7 +359,7 @@ export class DropiDatePicker {
|
|
|
274
359
|
"optional": false,
|
|
275
360
|
"docs": {
|
|
276
361
|
"tags": [],
|
|
277
|
-
"text": "Selected date (ISO string, single mode)
|
|
362
|
+
"text": "Selected date (ISO string, single mode)"
|
|
278
363
|
},
|
|
279
364
|
"getter": false,
|
|
280
365
|
"setter": false,
|
|
@@ -334,7 +419,7 @@ export class DropiDatePicker {
|
|
|
334
419
|
"optional": false,
|
|
335
420
|
"docs": {
|
|
336
421
|
"tags": [],
|
|
337
|
-
"text": "Enable range selection
|
|
422
|
+
"text": "Enable range selection"
|
|
338
423
|
},
|
|
339
424
|
"getter": false,
|
|
340
425
|
"setter": false,
|
|
@@ -454,7 +539,7 @@ export class DropiDatePicker {
|
|
|
454
539
|
"optional": false,
|
|
455
540
|
"docs": {
|
|
456
541
|
"tags": [],
|
|
457
|
-
"text": "Is invalid state
|
|
542
|
+
"text": "Is invalid state"
|
|
458
543
|
},
|
|
459
544
|
"getter": false,
|
|
460
545
|
"setter": false,
|
|
@@ -474,13 +559,33 @@ export class DropiDatePicker {
|
|
|
474
559
|
"optional": false,
|
|
475
560
|
"docs": {
|
|
476
561
|
"tags": [],
|
|
477
|
-
"text": "Loading state
|
|
562
|
+
"text": "Loading state"
|
|
478
563
|
},
|
|
479
564
|
"getter": false,
|
|
480
565
|
"setter": false,
|
|
481
566
|
"reflect": false,
|
|
482
567
|
"attribute": "loading",
|
|
483
568
|
"defaultValue": "false"
|
|
569
|
+
},
|
|
570
|
+
"hideTodayShortcut": {
|
|
571
|
+
"type": "boolean",
|
|
572
|
+
"mutable": false,
|
|
573
|
+
"complexType": {
|
|
574
|
+
"original": "boolean",
|
|
575
|
+
"resolved": "boolean",
|
|
576
|
+
"references": {}
|
|
577
|
+
},
|
|
578
|
+
"required": false,
|
|
579
|
+
"optional": false,
|
|
580
|
+
"docs": {
|
|
581
|
+
"tags": [],
|
|
582
|
+
"text": "Hide \"Hoy\" shortcut"
|
|
583
|
+
},
|
|
584
|
+
"getter": false,
|
|
585
|
+
"setter": false,
|
|
586
|
+
"reflect": false,
|
|
587
|
+
"attribute": "hide-today-shortcut",
|
|
588
|
+
"defaultValue": "false"
|
|
484
589
|
}
|
|
485
590
|
};
|
|
486
591
|
}
|
|
@@ -489,7 +594,9 @@ export class DropiDatePicker {
|
|
|
489
594
|
"open": {},
|
|
490
595
|
"viewYear": {},
|
|
491
596
|
"viewMonth": {},
|
|
492
|
-
"hoverDate": {}
|
|
597
|
+
"hoverDate": {},
|
|
598
|
+
"viewMode": {},
|
|
599
|
+
"activeShortcut": {}
|
|
493
600
|
};
|
|
494
601
|
}
|
|
495
602
|
static get events() {
|
|
@@ -501,7 +608,7 @@ export class DropiDatePicker {
|
|
|
501
608
|
"composed": true,
|
|
502
609
|
"docs": {
|
|
503
610
|
"tags": [],
|
|
504
|
-
"text": "
|
|
611
|
+
"text": ""
|
|
505
612
|
},
|
|
506
613
|
"complexType": {
|
|
507
614
|
"original": "string",
|
|
@@ -516,7 +623,7 @@ export class DropiDatePicker {
|
|
|
516
623
|
"composed": true,
|
|
517
624
|
"docs": {
|
|
518
625
|
"tags": [],
|
|
519
|
-
"text": "
|
|
626
|
+
"text": ""
|
|
520
627
|
},
|
|
521
628
|
"complexType": {
|
|
522
629
|
"original": "void",
|
|
@@ -531,7 +638,7 @@ export class DropiDatePicker {
|
|
|
531
638
|
"composed": true,
|
|
532
639
|
"docs": {
|
|
533
640
|
"tags": [],
|
|
534
|
-
"text": "
|
|
641
|
+
"text": ""
|
|
535
642
|
},
|
|
536
643
|
"complexType": {
|
|
537
644
|
"original": "{ start: string; end: string }",
|