@dropi/ui 0.1.37 → 0.1.41
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/assets/icons/symbol/svg/sprite.css.svg +1 -1
- package/dist/cjs/dropi-accordion-item.cjs.entry.js +1 -1
- package/dist/cjs/dropi-alert.cjs.entry.js +1 -1
- package/dist/cjs/dropi-banner-external.cjs.entry.js +1 -1
- package/dist/cjs/dropi-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/dropi-button.cjs.entry.js +1 -1
- package/dist/cjs/dropi-card-product.cjs.entry.js +2 -2
- package/dist/cjs/dropi-card-section.cjs.entry.js +1 -1
- package/dist/cjs/dropi-checkbox-selection-list.cjs.entry.js +2 -2
- package/dist/cjs/dropi-chips.cjs.entry.js +1 -1
- package/dist/cjs/dropi-city-selector.cjs.entry.js +2 -2
- package/dist/cjs/dropi-country-selector.cjs.entry.js +1 -1
- package/dist/cjs/dropi-date-picker.cjs.entry.js +3 -3
- package/dist/cjs/dropi-drawer.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 +2 -2
- package/dist/cjs/dropi-icon.cjs.entry.js +18 -20
- package/dist/cjs/dropi-ilustration-icon.cjs.entry.js +1 -1
- package/dist/cjs/dropi-image-miniature.cjs.entry.js +1 -1
- package/dist/cjs/dropi-image-overlay.cjs.entry.js +1 -1
- package/dist/cjs/dropi-input_3.cjs.entry.js +11 -9
- package/dist/cjs/dropi-languages-selector.cjs.entry.js +1 -1
- package/dist/cjs/dropi-media-player.cjs.entry.js +2 -2
- package/dist/cjs/dropi-modal.cjs.entry.js +2 -2
- package/dist/cjs/dropi-navbar.cjs.entry.js +2 -2
- package/dist/cjs/dropi-otp-send-code.cjs.entry.js +14 -6
- package/dist/cjs/dropi-phone-input.cjs.entry.js +1 -1
- package/dist/cjs/dropi-radio-selection-list.cjs.entry.js +2 -2
- package/dist/cjs/dropi-search.cjs.entry.js +2 -2
- package/dist/cjs/dropi-select.cjs.entry.js +7 -7
- package/dist/cjs/dropi-sidebar.cjs.entry.js +2 -2
- package/dist/cjs/dropi-steps.cjs.entry.js +1 -1
- package/dist/cjs/dropi-table.cjs.entry.js +5 -5
- package/dist/cjs/dropi-tabs.cjs.entry.js +1 -1
- package/dist/cjs/dropi-text-area.cjs.entry.js +1 -1
- package/dist/cjs/dropi-time-line.cjs.entry.js +1 -1
- package/dist/cjs/dropi-toast.cjs.entry.js +1 -1
- package/dist/cjs/dropi-tooltip-v2.cjs.entry.js +2 -2
- package/dist/cjs/dropi-ui.cjs.js +1 -1
- package/dist/cjs/dropi-vertical-steps.cjs.entry.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/assets/icons/symbol/svg/sprite.css.svg +1 -1
- package/dist/collection/components/dropi-accordion/dropi-accordion-item.js +1 -1
- package/dist/collection/components/dropi-alert/dropi-alert.js +1 -1
- package/dist/collection/components/dropi-banner-external/dropi-banner-external.js +1 -1
- package/dist/collection/components/dropi-breadcrumb/dropi-breadcrumb.js +2 -2
- package/dist/collection/components/dropi-button/dropi-button.js +1 -1
- package/dist/collection/components/dropi-card-product/dropi-card-product.js +2 -2
- package/dist/collection/components/dropi-card-section/dropi-card-section.js +1 -1
- package/dist/collection/components/dropi-checkbox-selection-list/dropi-checkbox-selection-list.js +2 -2
- package/dist/collection/components/dropi-chips/dropi-chips.js +1 -1
- package/dist/collection/components/dropi-city-selector/dropi-city-selector.js +2 -2
- package/dist/collection/components/dropi-country-selector/dropi-country-selector.js +1 -1
- package/dist/collection/components/dropi-date-picker/dropi-date-picker.js +3 -3
- package/dist/collection/components/dropi-drawer/dropi-drawer.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 +2 -2
- package/dist/collection/components/dropi-file-upload-progress-bar/dropi-file-upload-progress-bar.js +1 -1
- package/dist/collection/components/dropi-icon/dropi-icon.css +0 -2
- package/dist/collection/components/dropi-icon/dropi-icon.js +25 -27
- package/dist/collection/components/dropi-ilustration-icon/dropi-ilustration-icon.js +1 -1
- package/dist/collection/components/dropi-image-miniature/dropi-image-miniature.js +1 -1
- package/dist/collection/components/dropi-image-overlay/dropi-image-overlay.js +1 -1
- package/dist/collection/components/dropi-input/dropi-input.css +13 -5
- package/dist/collection/components/dropi-input/dropi-input.js +9 -7
- package/dist/collection/components/dropi-languages-selector/dropi-languages-selector.js +1 -1
- package/dist/collection/components/dropi-media-player/dropi-media-player.js +2 -2
- package/dist/collection/components/dropi-modal/dropi-modal.js +4 -4
- package/dist/collection/components/dropi-navbar/dropi-navbar.js +2 -2
- package/dist/collection/components/dropi-otp-send-code/dropi-otp-send-code.js +29 -7
- package/dist/collection/components/dropi-paginator/dropi-paginator.js +2 -2
- package/dist/collection/components/dropi-phone-input/dropi-phone-input.js +1 -1
- package/dist/collection/components/dropi-radio-selection-list/dropi-radio-selection-list.js +2 -2
- package/dist/collection/components/dropi-search/dropi-search.js +2 -2
- package/dist/collection/components/dropi-select/dropi-select.js +7 -7
- package/dist/collection/components/dropi-sidebar/dropi-sidebar.js +2 -2
- package/dist/collection/components/dropi-steps/dropi-steps.js +1 -1
- package/dist/collection/components/dropi-table/dropi-table.js +7 -7
- package/dist/collection/components/dropi-tabs/dropi-tabs.js +1 -1
- package/dist/collection/components/dropi-tag/dropi-tag.js +1 -1
- package/dist/collection/components/dropi-text-area/dropi-text-area.js +1 -1
- package/dist/collection/components/dropi-time-line/dropi-time-line.js +1 -1
- package/dist/collection/components/dropi-toast/dropi-toast.js +1 -1
- package/dist/collection/components/dropi-tooltip-v2/dropi-tooltip.js +2 -2
- package/dist/collection/components/dropi-vertical-steps/dropi-vertical-steps.js +1 -1
- package/dist/collection/components/dropi-youtube-lazy-video/dropi-youtube-lazy-video.js +1 -1
- package/dist/components/dropi-accordion-item.js +1 -1
- package/dist/components/dropi-alert-modal.js +1 -1
- package/dist/components/dropi-alert.js +1 -1
- package/dist/components/dropi-banner-external.js +1 -1
- package/dist/components/dropi-breadcrumb.js +1 -1
- package/dist/components/dropi-button.js +1 -1
- package/dist/components/dropi-card-product.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-chips.js +1 -1
- package/dist/components/dropi-city-selector.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-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-icon.js +1 -1
- package/dist/components/dropi-ilustration-icon.js +1 -1
- package/dist/components/dropi-image-miniature.js +1 -1
- package/dist/components/dropi-image-overlay.js +1 -1
- package/dist/components/dropi-input.js +1 -1
- package/dist/components/dropi-languages-selector.js +1 -1
- package/dist/components/dropi-media-player.js +1 -1
- package/dist/components/dropi-modal.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-radio-selection-list.js +1 -1
- package/dist/components/dropi-search.js +1 -1
- package/dist/components/dropi-select.js +1 -1
- package/dist/components/dropi-sidebar.js +1 -1
- package/dist/components/dropi-steps.js +1 -1
- package/dist/components/dropi-table.js +1 -1
- package/dist/components/dropi-tabs.js +1 -1
- package/dist/components/dropi-tag.js +1 -1
- package/dist/components/dropi-text-area.js +1 -1
- package/dist/components/dropi-time-line.js +1 -1
- package/dist/components/dropi-toast.js +1 -1
- package/dist/components/dropi-tooltip-v2.js +1 -1
- package/dist/components/dropi-vertical-steps.js +1 -1
- package/dist/components/dropi-youtube-lazy-video.js +1 -1
- package/dist/components/p-2YgFOle2.js +1 -0
- package/dist/components/p-BDYn1JDe.js +1 -0
- package/dist/components/p-BKTMBQVw.js +1 -0
- package/dist/components/p-Btsw7sPN.js +1 -0
- package/dist/components/p-CgRY3n1J.js +1 -0
- package/dist/components/p-Cjq4FTif.js +1 -0
- package/dist/components/p-DfdhNT9F.js +1 -0
- package/dist/components/p-DvLWbKsf.js +1 -0
- package/dist/components/p-Dz9uN5Nw.js +1 -0
- package/dist/components/p-FAhcOdS-.js +1 -0
- package/dist/dropi-ui/dropi-accordion-item.entry.js +58 -0
- package/dist/dropi-ui/dropi-accordion-item.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-accordion.entry.js +20 -0
- package/dist/dropi-ui/dropi-accordion.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-alert-legacy.entry.js +40 -0
- package/dist/dropi-ui/dropi-alert-legacy.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-alert-modal.entry.js +129 -0
- package/dist/dropi-ui/dropi-alert-modal.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-alert.entry.js +65 -0
- package/dist/dropi-ui/dropi-alert.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-avatars.entry.js +32 -0
- package/dist/dropi-ui/dropi-avatars.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-badge-legacy.entry.js +31 -0
- package/dist/dropi-ui/dropi-badge-legacy.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-badge.entry.js +38 -0
- package/dist/dropi-ui/dropi-badge.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-banner-external.entry.js +64 -0
- package/dist/dropi-ui/dropi-banner-external.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-breadcrumb.entry.js +49 -0
- package/dist/dropi-ui/dropi-breadcrumb.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-button.entry.js +88 -0
- package/dist/dropi-ui/dropi-button.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-card-checkbox.entry.js +49 -0
- package/dist/dropi-ui/dropi-card-checkbox.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-card-product.entry.js +79 -0
- package/dist/dropi-ui/dropi-card-product.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-card-section.entry.js +39 -0
- package/dist/dropi-ui/dropi-card-section.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-carousel.entry.js +154 -0
- package/dist/dropi-ui/dropi-carousel.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-checkbox-selection-list.entry.js +74 -0
- package/dist/dropi-ui/dropi-checkbox-selection-list.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-checkbox.entry.js +37 -0
- package/dist/dropi-ui/dropi-checkbox.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-chips.entry.js +31 -0
- package/dist/dropi-ui/dropi-chips.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-city-selector.entry.js +105 -0
- package/dist/dropi-ui/dropi-city-selector.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-color-picker.entry.js +320 -0
- package/dist/dropi-ui/dropi-color-picker.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-country-flags.entry.js +38 -0
- package/dist/dropi-ui/dropi-country-flags.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-country-selector.entry.js +198 -0
- package/dist/dropi-ui/dropi-country-selector.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-date-picker-range.entry.js +116 -0
- package/dist/dropi-ui/dropi-date-picker-range.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-date-picker.entry.js +224 -0
- package/dist/dropi-ui/dropi-date-picker.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-drawer.entry.js +80 -0
- package/dist/dropi-ui/dropi-drawer.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-dropdown.entry.js +66 -0
- package/dist/dropi-ui/dropi-dropdown.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-empty-state.entry.js +37 -0
- package/dist/dropi-ui/dropi-empty-state.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-favorite-button.entry.js +28 -0
- package/dist/dropi-ui/dropi-favorite-button.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-file-upload-progress-bar.entry.js +78 -0
- package/dist/dropi-ui/dropi-file-upload-progress-bar.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-file-upload.entry.js +238 -0
- package/dist/dropi-ui/dropi-file-upload.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-icon.entry.js +66 -0
- package/dist/dropi-ui/dropi-icon.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-ilustration-icon.entry.js +40 -0
- package/dist/dropi-ui/dropi-ilustration-icon.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-image-miniature.entry.js +45 -0
- package/dist/dropi-ui/dropi-image-miniature.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-image-overlay.entry.js +64 -0
- package/dist/dropi-ui/dropi-image-overlay.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-input.entry.js +266 -0
- package/dist/dropi-ui/dropi-input.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-languages-selector.entry.js +62 -0
- package/dist/dropi-ui/dropi-languages-selector.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-logo.entry.js +38 -0
- package/dist/dropi-ui/dropi-logo.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-lottie-loader.entry.js +28 -0
- package/dist/dropi-ui/dropi-lottie-loader.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-media-player.entry.js +193 -0
- package/dist/dropi-ui/dropi-media-player.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-modal.entry.js +143 -0
- package/dist/dropi-ui/dropi-modal.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-navbar.entry.js +55 -0
- package/dist/dropi-ui/dropi-navbar.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-otp-send-code.entry.js +101 -0
- package/dist/dropi-ui/dropi-otp-send-code.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-paginator.entry.js +70 -0
- package/dist/dropi-ui/dropi-paginator.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-phone-input.entry.js +198 -0
- package/dist/dropi-ui/dropi-phone-input.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-radio-button.entry.js +48 -0
- package/dist/dropi-ui/dropi-radio-button.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-radio-selection-list.entry.js +61 -0
- package/dist/dropi-ui/dropi-radio-selection-list.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-read-more.entry.js +41 -0
- package/dist/dropi-ui/dropi-read-more.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-search.entry.js +125 -0
- package/dist/dropi-ui/dropi-search.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-select.entry.js +383 -0
- package/dist/dropi-ui/dropi-select.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-sidebar.entry.js +79 -0
- package/dist/dropi-ui/dropi-sidebar.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-simple-stepper.entry.js +54 -0
- package/dist/dropi-ui/dropi-simple-stepper.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-skeleton.entry.js +58 -0
- package/dist/dropi-ui/dropi-skeleton.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-steps.entry.js +53 -0
- package/dist/dropi-ui/dropi-steps.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-switch.entry.js +31 -0
- package/dist/dropi-ui/dropi-switch.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-table.entry.js +300 -0
- package/dist/dropi-ui/dropi-table.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-tabs.entry.js +52 -0
- package/dist/dropi-ui/dropi-tabs.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-tag-type-product.entry.js +20 -0
- package/dist/dropi-ui/dropi-tag-type-product.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-tag.entry.js +69 -0
- package/dist/dropi-ui/dropi-tag.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-text-area.entry.js +135 -0
- package/dist/dropi-ui/dropi-text-area.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-time-line.entry.js +35 -0
- package/dist/dropi-ui/dropi-time-line.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-toast.entry.js +57 -0
- package/dist/dropi-ui/dropi-toast.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-tooltip-v2.entry.js +132 -0
- package/dist/dropi-ui/dropi-tooltip-v2.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-tooltip.entry.js +22 -0
- package/dist/dropi-ui/dropi-tooltip.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-ui.css +311 -1
- package/dist/dropi-ui/dropi-ui.esm.js +50 -1
- package/dist/dropi-ui/dropi-ui.esm.js.map +1 -0
- package/dist/dropi-ui/dropi-vertical-steps.entry.js +56 -0
- package/dist/dropi-ui/dropi-vertical-steps.entry.js.map +1 -0
- package/dist/dropi-ui/dropi-youtube-lazy-video.entry.js +34 -0
- package/dist/dropi-ui/dropi-youtube-lazy-video.entry.js.map +1 -0
- package/dist/dropi-ui/index-Cvp2LQOM.js +4585 -0
- package/dist/dropi-ui/index-Cvp2LQOM.js.map +1 -0
- package/dist/dropi-ui/index.esm.js +4 -0
- package/dist/dropi-ui/index.esm.js.map +1 -0
- package/dist/dropi-ui/{p-db38bf16.entry.js → p-01e4fe42.entry.js} +1 -1
- package/dist/dropi-ui/p-099f4475.entry.js +1 -0
- package/dist/dropi-ui/p-17b16a74.entry.js +1 -0
- package/dist/dropi-ui/p-1a07b3a6.entry.js +1 -0
- package/dist/dropi-ui/p-1cd4d630.entry.js +1 -0
- package/dist/dropi-ui/p-1d75dff6.entry.js +1 -0
- package/dist/dropi-ui/p-20a6a2aa.entry.js +1 -0
- package/dist/dropi-ui/p-256bf069.entry.js +1 -0
- package/dist/dropi-ui/p-25f0c2c9.entry.js +1 -0
- package/dist/dropi-ui/p-2d9978c1.entry.js +1 -0
- package/dist/dropi-ui/p-35b37d1a.entry.js +1 -0
- package/dist/dropi-ui/p-38ea66e4.entry.js +1 -0
- package/dist/dropi-ui/p-4e401fbc.entry.js +1 -0
- package/dist/dropi-ui/p-53d2905c.entry.js +1 -0
- package/dist/dropi-ui/p-54bfb072.entry.js +1 -0
- package/dist/dropi-ui/p-5915d227.entry.js +1 -0
- package/dist/dropi-ui/p-650a7679.entry.js +1 -0
- package/dist/dropi-ui/p-719a01cb.entry.js +1 -0
- package/dist/dropi-ui/p-7369b3b4.entry.js +1 -0
- package/dist/dropi-ui/{p-e3ad21f8.entry.js → p-77cd2fcb.entry.js} +1 -1
- package/dist/dropi-ui/p-7a18b7a0.entry.js +1 -0
- package/dist/dropi-ui/p-83887880.entry.js +1 -0
- package/dist/dropi-ui/p-83dbc407.entry.js +1 -0
- package/dist/dropi-ui/p-85c637bd.entry.js +1 -0
- package/dist/dropi-ui/{p-e6e766ed.entry.js → p-87cc4dcd.entry.js} +1 -1
- package/dist/dropi-ui/p-899089f0.entry.js +1 -0
- package/dist/dropi-ui/p-8c107dbe.entry.js +1 -0
- package/dist/dropi-ui/p-929bc2b6.entry.js +1 -0
- package/dist/dropi-ui/p-9ac8caea.entry.js +1 -0
- package/dist/dropi-ui/p-9b24e8fd.entry.js +1 -0
- package/dist/dropi-ui/p-9c73b4ce.entry.js +1 -0
- package/dist/dropi-ui/p-a580e8c8.entry.js +1 -0
- package/dist/dropi-ui/p-a9f93e82.entry.js +1 -0
- package/dist/dropi-ui/p-aa0f5964.entry.js +1 -0
- package/dist/dropi-ui/p-aadd5863.entry.js +1 -0
- package/dist/dropi-ui/p-b25faf92.entry.js +1 -0
- package/dist/dropi-ui/p-b605d3d9.entry.js +1 -0
- package/dist/dropi-ui/p-bbb5e0ae.entry.js +1 -0
- package/dist/dropi-ui/p-c4d2881d.entry.js +1 -0
- package/dist/dropi-ui/p-d1aeb373.entry.js +1 -0
- package/dist/dropi-ui/p-d724ced4.entry.js +1 -0
- package/dist/dropi-ui/p-dc53a798.entry.js +1 -0
- package/dist/dropi-ui/p-e1b3c9a3.entry.js +1 -0
- package/dist/dropi-ui/p-e3c120ba.entry.js +1 -0
- package/dist/dropi-ui/p-edf796ee.entry.js +1 -0
- package/dist/dropi-ui/p-f2527a45.entry.js +1 -0
- package/dist/dropi-ui/p-f6c9057d.entry.js +1 -0
- package/dist/dropi-ui/p-f7fd7832.entry.js +1 -0
- package/dist/dropi-ui/p-f9888cea.entry.js +1 -0
- package/dist/dropi-ui/p-ffd415a2.entry.js +1 -0
- package/dist/esm/dropi-accordion-item.entry.js +1 -1
- package/dist/esm/dropi-alert.entry.js +1 -1
- package/dist/esm/dropi-banner-external.entry.js +1 -1
- package/dist/esm/dropi-breadcrumb.entry.js +2 -2
- package/dist/esm/dropi-button.entry.js +1 -1
- package/dist/esm/dropi-card-product.entry.js +2 -2
- package/dist/esm/dropi-card-section.entry.js +1 -1
- package/dist/esm/dropi-checkbox-selection-list.entry.js +2 -2
- package/dist/esm/dropi-chips.entry.js +1 -1
- package/dist/esm/dropi-city-selector.entry.js +2 -2
- package/dist/esm/dropi-country-selector.entry.js +1 -1
- package/dist/esm/dropi-date-picker.entry.js +3 -3
- package/dist/esm/dropi-drawer.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 +2 -2
- package/dist/esm/dropi-icon.entry.js +18 -20
- package/dist/esm/dropi-ilustration-icon.entry.js +1 -1
- package/dist/esm/dropi-image-miniature.entry.js +1 -1
- package/dist/esm/dropi-image-overlay.entry.js +1 -1
- package/dist/esm/dropi-input_3.entry.js +11 -9
- package/dist/esm/dropi-languages-selector.entry.js +1 -1
- package/dist/esm/dropi-media-player.entry.js +2 -2
- package/dist/esm/dropi-modal.entry.js +2 -2
- package/dist/esm/dropi-navbar.entry.js +2 -2
- package/dist/esm/dropi-otp-send-code.entry.js +14 -6
- package/dist/esm/dropi-phone-input.entry.js +1 -1
- package/dist/esm/dropi-radio-selection-list.entry.js +2 -2
- package/dist/esm/dropi-search.entry.js +2 -2
- package/dist/esm/dropi-select.entry.js +7 -7
- package/dist/esm/dropi-sidebar.entry.js +2 -2
- package/dist/esm/dropi-steps.entry.js +1 -1
- package/dist/esm/dropi-table.entry.js +5 -5
- package/dist/esm/dropi-tabs.entry.js +1 -1
- package/dist/esm/dropi-text-area.entry.js +1 -1
- package/dist/esm/dropi-time-line.entry.js +1 -1
- package/dist/esm/dropi-toast.entry.js +1 -1
- package/dist/esm/dropi-tooltip-v2.entry.js +2 -2
- package/dist/esm/dropi-ui.js +1 -1
- package/dist/esm/dropi-vertical-steps.entry.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-icon/dropi-icon.d.ts +4 -9
- package/dist/types/components/dropi-input/dropi-input.d.ts +1 -1
- package/dist/types/components/dropi-modal/dropi-modal.d.ts +1 -1
- package/dist/types/components/dropi-otp-send-code/dropi-otp-send-code.d.ts +3 -1
- package/dist/types/components/dropi-table/dropi-table.d.ts +1 -1
- package/dist/types/components.d.ts +39 -38
- package/hydrate/index.js +109 -101
- package/hydrate/index.mjs +109 -101
- package/package.json +1 -1
- package/scripts/setup.js +25 -4
- package/dist/components/p-B_Ace02i.js +0 -1
- package/dist/components/p-BrjO_JXp.js +0 -1
- package/dist/components/p-BwhxWL4p.js +0 -1
- package/dist/components/p-Bz2jXX3R.js +0 -1
- package/dist/components/p-D-vQQQNz.js +0 -1
- package/dist/components/p-D13d88W3.js +0 -1
- package/dist/components/p-I3w7xF7Q.js +0 -1
- package/dist/components/p-o5gyrbbD.js +0 -1
- package/dist/dropi-ui/p-00e5a2de.entry.js +0 -1
- package/dist/dropi-ui/p-0188e07a.entry.js +0 -1
- package/dist/dropi-ui/p-02710049.entry.js +0 -1
- package/dist/dropi-ui/p-18adf694.entry.js +0 -1
- package/dist/dropi-ui/p-1a3619c3.entry.js +0 -1
- package/dist/dropi-ui/p-25640777.entry.js +0 -1
- package/dist/dropi-ui/p-2674d901.entry.js +0 -1
- package/dist/dropi-ui/p-2af538b9.entry.js +0 -1
- package/dist/dropi-ui/p-3013f3b8.entry.js +0 -1
- package/dist/dropi-ui/p-3321ca70.entry.js +0 -1
- package/dist/dropi-ui/p-33d242ec.entry.js +0 -1
- package/dist/dropi-ui/p-39af6478.entry.js +0 -1
- package/dist/dropi-ui/p-446a481d.entry.js +0 -1
- package/dist/dropi-ui/p-50e0d44f.entry.js +0 -1
- package/dist/dropi-ui/p-5c0bd7c2.entry.js +0 -1
- package/dist/dropi-ui/p-5ddf6e93.entry.js +0 -1
- package/dist/dropi-ui/p-5fb33ae4.entry.js +0 -1
- package/dist/dropi-ui/p-665ef7ba.entry.js +0 -1
- package/dist/dropi-ui/p-66b80371.entry.js +0 -1
- package/dist/dropi-ui/p-7bfc1c27.entry.js +0 -1
- package/dist/dropi-ui/p-7c0d2edf.entry.js +0 -1
- package/dist/dropi-ui/p-7eb27836.entry.js +0 -1
- package/dist/dropi-ui/p-8bf5d8ee.entry.js +0 -1
- package/dist/dropi-ui/p-9212f544.entry.js +0 -1
- package/dist/dropi-ui/p-955e52f8.entry.js +0 -1
- package/dist/dropi-ui/p-976a15e3.entry.js +0 -1
- package/dist/dropi-ui/p-a1c93e55.entry.js +0 -1
- package/dist/dropi-ui/p-a232c6a7.entry.js +0 -1
- package/dist/dropi-ui/p-a822a23e.entry.js +0 -1
- package/dist/dropi-ui/p-af8e2157.entry.js +0 -1
- package/dist/dropi-ui/p-c3614c4a.entry.js +0 -1
- package/dist/dropi-ui/p-cc527d91.entry.js +0 -1
- package/dist/dropi-ui/p-cdde481b.entry.js +0 -1
- package/dist/dropi-ui/p-dd5d8b1b.entry.js +0 -1
- package/dist/dropi-ui/p-efc2fc35.entry.js +0 -1
- package/dist/dropi-ui/p-f41cd9b5.entry.js +0 -1
- package/dist/dropi-ui/p-fa3d0267.entry.js +0 -1
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { r as registerInstance, d as createEvent, e as Build, h } from './index-Cvp2LQOM.js';
|
|
2
|
+
|
|
3
|
+
const dropiModalCss = () => `:host{display:contents}*,*::before,*::after{box-sizing:border-box}.modal-root{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none;opacity:0;transition:opacity 0.18s ease;z-index:1100}.modal-root--open{opacity:1;pointer-events:auto}.modal-root--closing{opacity:1;pointer-events:none}.modal-mask{position:absolute;inset:0;background:rgba(6,11,16,0.66);pointer-events:auto;opacity:0;transition:opacity 0.18s ease}.modal-root--open .modal-mask{opacity:1}.modal-root--closing .modal-mask{opacity:0}.modal-panel{position:relative;pointer-events:auto;display:flex;flex-direction:column;border-radius:var(--Border-2, 8px);background:var(--Neutral-White, #ffffff);box-shadow:0 0 60px rgba(0,0,0,0.06);overflow:hidden;padding:var(--Size-6, 32px);gap:var(--Size-5, 24px);max-height:calc(100vh - 60px);opacity:0;transform:translateY(16px) scale(0.92);transition:opacity 0.18s ease, transform 0.18s ease}.modal-root--open .modal-panel{opacity:1;transform:none}.modal-root--closing .modal-panel{opacity:0;transform:translateY(-12px) scale(1.06)}.modal-header{display:flex;align-items:center;gap:4px}.modal-title{color:var(--Gray-Gray-700,#32394d);font-size:var(--Size-5, 24px);font-weight:var(--font-weight-bold);flex:1;text-align:left}.modal-close{margin-left:auto;border:0;background:transparent;cursor:pointer;padding:0;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:var(--font-size-xxl);line-height:1;color:var(--Gray-Gray-400)}.modal-close:hover{opacity:0.7}.modal-content{padding-right:8px;overflow:auto;flex:1;display:flex;flex-direction:column;scrollbar-width:thin;scrollbar-color:var(--Gray-Gray-300,#a3abbf) var(--Gray-Gray-50,#f7f8fa)}.modal-content::-webkit-scrollbar{width:4px}.modal-content::-webkit-scrollbar-track{background:var(--Gray-Gray-50,#f7f8fa);border-radius:16px}.modal-content::-webkit-scrollbar-thumb{background:var(--Gray-Gray-300,#a3abbf);border-radius:16px}.modal-footer{display:flex;justify-content:flex-end;align-items:flex-start;gap:var(--Size-1, 4px);width:100%}.modal-footer:empty{display:none}::slotted(.button-container){display:grid;grid-template-columns:1fr 1fr;gap:var(--Size-4, 16px);min-width:470px;width:100%}::slotted(.button-container)>*{width:100%}::slotted(.button-container) dropi-button{width:100%}.modal-panel.size-m .modal-footer,.modal-panel.size-s .modal-footer{justify-content:center}.modal-panel.size-m .modal-footer ::slotted(.button-container),.modal-panel.size-s .modal-footer ::slotted(.button-container){min-width:unset !important;width:100%}.modal-panel.size-drawer-s .modal-footer ::slotted(.button-container){min-width:unset;display:flex;flex-direction:column-reverse;gap:var(--Size-4, 16px)}.modal-panel.size-full{width:100%;height:100vh;max-height:100vh;border-radius:0}.modal-panel.size-xxl{width:calc(100% - 60px);max-width:1520px;height:calc(100vh - 120px);max-height:900px}.modal-panel.size-l{width:1137px;max-width:1137px;max-height:754px}.modal-panel.size-m{max-width:550px;width:550px}.modal-panel.size-s{width:454px}.modal-root--right{align-items:stretch;justify-content:flex-end}.modal-root--right .modal-panel{height:100vh;max-height:100vh;border-radius:0;gap:0;opacity:1;transform:translateX(100%);transition:transform 0.32s cubic-bezier(0.4,0,0.2,1)}.modal-root--open.modal-root--right .modal-panel{transform:translateX(0)}.modal-root--closing.modal-root--right .modal-panel{transform:translateX(100%)}.modal-root--right .modal-panel.size-drawer-s{width:351px;padding:20px;box-shadow:0 8px 40px rgba(0,0,0,0.16)}.modal-root--right .modal-panel.size-drawer-m{width:550px;box-shadow:0 8px 40px rgba(0,0,0,0.16)}.modal-root--right .modal-panel.size-drawer-l{width:1137px;box-shadow:0 8px 40px rgba(0,0,0,0.16)}.modal-root--right .modal-panel.size-drawer-xxl{width:1214px;box-shadow:0 8px 40px rgba(0,0,0,0.16)}.modal-root--right .modal-panel.size-sidebar-half{width:50vw;min-width:600px;box-shadow:0 8px 40px rgba(0,0,0,0.16)}@media (max-width: 768px){.modal-root--right .modal-panel.size-drawer-s,.modal-root--right .modal-panel.size-drawer-m,.modal-root--right .modal-panel.size-drawer-l,.modal-root--right .modal-panel.size-drawer-xxl,.modal-root--right .modal-panel.size-sidebar-half{width:100vw;min-width:unset}}.modal-root--left{align-items:stretch;justify-content:flex-start}.modal-root--left .modal-panel{height:100vh;max-height:100vh;border-radius:0;gap:0;opacity:1;transform:translateX(-100%);transition:transform 0.32s cubic-bezier(0.4,0,0.2,1)}.modal-root--open.modal-root--left .modal-panel{transform:translateX(0)}.modal-root--closing.modal-root--left .modal-panel{transform:translateX(-100%)}.modal-root--top{align-items:flex-start}.modal-root--bottom{align-items:flex-end}@media (max-width: 599px){.modal-panel{padding:20px;width:100% !important}.modal-panel:not(.size-s){border-radius:0 !important;height:100% !important;max-height:unset !important}.modal-root--right .modal-panel{width:100vw !important;min-width:unset !important}.modal-footer{justify-content:center}.modal-footer ::slotted(.button-container){width:100%;min-width:unset !important;display:flex;flex-direction:column-reverse;gap:var(--Size-4, 16px)}}@media (prefers-reduced-motion: reduce){.modal-root,.modal-mask,.modal-panel{transition:none !important}}`;
|
|
4
|
+
|
|
5
|
+
const DropiModal = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.onShow = createEvent(this, "onShow", 5);
|
|
9
|
+
this.onHide = createEvent(this, "onHide", 5);
|
|
10
|
+
this.visibleChange = createEvent(this, "visibleChange", 5);
|
|
11
|
+
}
|
|
12
|
+
visible = false;
|
|
13
|
+
header = null;
|
|
14
|
+
showCloseIcon = true;
|
|
15
|
+
dismissable = true;
|
|
16
|
+
dismissableMask = true;
|
|
17
|
+
dismissible = true;
|
|
18
|
+
closeOnEscape = true;
|
|
19
|
+
modal = true;
|
|
20
|
+
closable = true;
|
|
21
|
+
blockScroll = true;
|
|
22
|
+
showHeader = true;
|
|
23
|
+
showFooter = true;
|
|
24
|
+
position = 'center';
|
|
25
|
+
size = 'm';
|
|
26
|
+
styleClass = null;
|
|
27
|
+
maxWidth = null;
|
|
28
|
+
/** Auto-manage z-index stack (matches Angular `autoZIndex`) */
|
|
29
|
+
autoZIndex = true;
|
|
30
|
+
/** Base z-index value when autoZIndex is false (matches Angular `baseZIndex`) */
|
|
31
|
+
baseZIndex = 1100;
|
|
32
|
+
/** CSS transition duration, e.g. '0.15s' (matches Angular `transitionOptions`) */
|
|
33
|
+
transitionOptions = '0.15s';
|
|
34
|
+
/** Enable a before-close hook (matches Angular `enableBeforeClose`) */
|
|
35
|
+
enableBeforeClose = false;
|
|
36
|
+
/** No-op — kept for API parity with Angular (matches Angular `draggable`) */
|
|
37
|
+
isDraggable = false;
|
|
38
|
+
/** No-op — kept for API parity with Angular (matches Angular `resizable`) */
|
|
39
|
+
resizable = false;
|
|
40
|
+
onShow;
|
|
41
|
+
onHide;
|
|
42
|
+
visibleChange;
|
|
43
|
+
isOpen = false;
|
|
44
|
+
isClosing = false;
|
|
45
|
+
mounted = false;
|
|
46
|
+
closeTimer = null;
|
|
47
|
+
keyHandler = null;
|
|
48
|
+
visibleChanged(val, oldVal) {
|
|
49
|
+
const isVisible = val === true || String(val) === 'true';
|
|
50
|
+
const wasVisible = oldVal === true || String(oldVal) === 'true';
|
|
51
|
+
if (isVisible === wasVisible)
|
|
52
|
+
return;
|
|
53
|
+
console.log('[DropiModal] visibleChanged:', isVisible);
|
|
54
|
+
isVisible ? this.openModal() : (this.mounted && this.startClose());
|
|
55
|
+
}
|
|
56
|
+
componentDidLoad() {
|
|
57
|
+
const isVisible = this.visible === true || String(this.visible) === 'true';
|
|
58
|
+
if (isVisible)
|
|
59
|
+
this.openModal();
|
|
60
|
+
}
|
|
61
|
+
disconnectedCallback() {
|
|
62
|
+
this.removeKeyHandler();
|
|
63
|
+
if (this.closeTimer)
|
|
64
|
+
clearTimeout(this.closeTimer);
|
|
65
|
+
if (typeof document !== 'undefined') {
|
|
66
|
+
document.body.classList.remove('dropi-modal-open');
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
async hide() {
|
|
70
|
+
this.visible = false;
|
|
71
|
+
this.visibleChange.emit(false);
|
|
72
|
+
this.startClose();
|
|
73
|
+
}
|
|
74
|
+
async show() {
|
|
75
|
+
this.visible = true;
|
|
76
|
+
this.visibleChange.emit(true);
|
|
77
|
+
this.openModal();
|
|
78
|
+
}
|
|
79
|
+
openModal() {
|
|
80
|
+
if (this.closeTimer) {
|
|
81
|
+
clearTimeout(this.closeTimer);
|
|
82
|
+
this.closeTimer = null;
|
|
83
|
+
}
|
|
84
|
+
this.mounted = true;
|
|
85
|
+
this.isClosing = false;
|
|
86
|
+
this.isOpen = false;
|
|
87
|
+
requestAnimationFrame(() => requestAnimationFrame(() => {
|
|
88
|
+
this.isOpen = true;
|
|
89
|
+
this.onShow.emit();
|
|
90
|
+
}));
|
|
91
|
+
this.addKeyHandler();
|
|
92
|
+
if ((this.modal ?? true) && Build.isBrowser && document.body) {
|
|
93
|
+
document.body.classList.add('dropi-modal-open');
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
startClose() {
|
|
97
|
+
if (this.isClosing)
|
|
98
|
+
return;
|
|
99
|
+
this.isClosing = true;
|
|
100
|
+
this.isOpen = false;
|
|
101
|
+
this.removeKeyHandler();
|
|
102
|
+
if (this.closeTimer)
|
|
103
|
+
clearTimeout(this.closeTimer);
|
|
104
|
+
this.closeTimer = setTimeout(() => {
|
|
105
|
+
this.mounted = false;
|
|
106
|
+
this.isClosing = false;
|
|
107
|
+
this.closeTimer = null;
|
|
108
|
+
if ((this.modal ?? true) && Build.isBrowser && document.body) {
|
|
109
|
+
document.body.classList.remove('dropi-modal-open');
|
|
110
|
+
}
|
|
111
|
+
this.onHide.emit();
|
|
112
|
+
}, 200);
|
|
113
|
+
}
|
|
114
|
+
addKeyHandler() {
|
|
115
|
+
if (!this.closeOnEscape)
|
|
116
|
+
return;
|
|
117
|
+
this.keyHandler = (e) => {
|
|
118
|
+
if (e.key === 'Escape' && this.visible && this.dismissable)
|
|
119
|
+
this.hide();
|
|
120
|
+
};
|
|
121
|
+
document.addEventListener('keydown', this.keyHandler);
|
|
122
|
+
}
|
|
123
|
+
removeKeyHandler() {
|
|
124
|
+
if (this.keyHandler) {
|
|
125
|
+
document.removeEventListener('keydown', this.keyHandler);
|
|
126
|
+
this.keyHandler = null;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
render() {
|
|
130
|
+
return (h("div", { key: '1aee093f108c54540005a6cb2f48bef700f05d63', class: `modal-root modal-root--${this.position}${this.isOpen ? ' modal-root--open' : ''}${this.isClosing ? ' modal-root--closing' : ''}`, style: { display: this.mounted || this.isClosing ? 'flex' : 'none' } }, (this.modal ?? true) && h("div", { key: '06ebd29da0c7dc699e7c16769476e310336ab149', class: "modal-mask", onClick: () => this.dismissable && this.hide() }), h("div", { key: '87cb9bbd4c1c6c27a6a7d09f561ea781c1571803', class: `modal-panel size-${this.size || 'm'}`, role: "dialog", "aria-modal": "true" }, this.showHeader && (h("div", { key: '86f22ef920b7a7437825f4c5f9ccff23b591c499', class: "modal-header" }, this.header && h("span", { key: '2ae7c9b879ee6c025b6b42977bad643ff4d28370', class: "modal-title" }, this.header), h("slot", { key: '85a0a54691ca191719202c8fea6b30ffff30aacc', name: "header" }), this.showCloseIcon && (h("button", { key: 'dc1f570830d22535a39c9e9fbf0bccdb8e4bfcf7', class: "modal-close", onClick: () => this.hide(), "aria-label": "Cerrar" }, "\u00D7")))), h("div", { key: 'ceca42f33ff7d4762c79b2d133e23bc7cedb3cb3', class: "modal-content" }, h("slot", { key: '14a82735c521c45deda61e8a69ae8673ad754b3d' })), this.showFooter && h("div", { key: 'e71a5393c19de696247502abd09d26a38cd1b979', class: "modal-footer" }, h("slot", { key: '1364eed1b66e82d321d06d13d9d34615c7634ce0', name: "footer" })))));
|
|
131
|
+
}
|
|
132
|
+
static get watchers() { return {
|
|
133
|
+
"visible": [{
|
|
134
|
+
"visibleChanged": 0
|
|
135
|
+
}]
|
|
136
|
+
}; }
|
|
137
|
+
};
|
|
138
|
+
DropiModal.style = dropiModalCss();
|
|
139
|
+
|
|
140
|
+
export { DropiModal as dropi_modal };
|
|
141
|
+
//# sourceMappingURL=dropi-modal.entry.esm.js.map
|
|
142
|
+
|
|
143
|
+
//# sourceMappingURL=dropi-modal.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"dropi-modal.entry.js","mappings":";;AAAA,MAAM,aAAa,GAAG,MAAM,CAAC,6pKAA6pK,CAAC;;MCe9qK,UAAU,GAAA,MAAA;;;;;;;IACmB,OAAO,GAAQ,KAAK;IACpD,MAAM,GAAkB,IAAI;IAC5B,aAAa,GAAY,IAAI;IAC7B,WAAW,GAAY,IAAI;IAC3B,eAAe,GAAY,IAAI;IAC/B,WAAW,GAAY,IAAI;IAC3B,aAAa,GAAY,IAAI;IAC7B,KAAK,GAAY,IAAI;IACrB,QAAQ,GAAY,IAAI;IACxB,WAAW,GAAY,IAAI;IAC3B,UAAU,GAAY,IAAI;IAC1B,UAAU,GAAY,IAAI;IAC1B,QAAQ,GAAkB,QAAQ;IAClC,IAAI,GAAc,GAAG;IACrB,UAAU,GAAkB,IAAI;IAChC,QAAQ,GAAkB,IAAI;;IAE9B,UAAU,GAAY,IAAI;;IAE1B,UAAU,GAAW,IAAI;;IAEzB,iBAAiB,GAAW,OAAO;;IAEnC,iBAAiB,GAAY,KAAK;;IAElC,WAAW,GAAY,KAAK;;IAE5B,SAAS,GAAY,KAAK;AAEN,IAAA,MAAM;AACN,IAAA,MAAM;AACN,IAAA,aAAa;IAExB,MAAM,GAAY,KAAK;IACvB,SAAS,GAAY,KAAK;IAC1B,OAAO,GAAY,KAAK;IAEjC,UAAU,GAAQ,IAAI;IACtB,UAAU,GAAwC,IAAI;IAG9D,cAAc,CAAC,GAAQ,EAAE,MAAW,EAAA;AAClC,QAAA,MAAM,SAAS,GAAG,GAAG,KAAK,IAAI,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,M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d,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,cAAc,EAAA,EACtB,IAAI,CAAC,MAAM,IAAI,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,KAAK,EAAC,aAAa,EAAA,EAAE,IAAI,CAAC,MAAM,CAAQ,EAC9D,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,QAAQ,EAAA,CAAQ,EAC1B,IAAI,CAAC,aAAa,KACjB,+DAAQ,KAAK,EAAC,aAAa,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,IAAI,EAAE,gBAAa,QAAQ,EAAA,EAAA,QAAA,CAElE,CACV,CACG,CACP,EACD,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,eAAe,EAAA,EAAC,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAQ,CAAM,EACxC,IAAI,CAAC,UAAU,IAAI,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,cAAc,EAAA,EAAC,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,QAAQ,EAAA,CAAG,CAAM,CACtE,CACF;;;;;;;;;;;;","names":[],"sources":["src/components/dropi-modal/dropi-modal.css?tag=dropi-modal&encapsulation=shadow","src/components/dropi-modal/dropi-modal.tsx"],"sourcesContent":[":host { display: contents; }\n*, *::before, *::after { box-sizing: border-box; }\n\n.modal-root {\n position: fixed; inset: 0;\n display: flex; align-items: center; justify-content: center;\n pointer-events: none; opacity: 0;\n transition: opacity 0.18s ease; z-index: 1100;\n}\n.modal-root--open { opacity: 1; pointer-events: auto; }\n.modal-root--closing { opacity: 1; pointer-events: none; }\n\n.modal-mask {\n position: absolute; inset: 0;\n background: rgba(6,11,16,0.66); pointer-events: auto;\n opacity: 0; transition: opacity 0.18s ease;\n}\n.modal-root--open .modal-mask { opacity: 1; }\n.modal-root--closing .modal-mask { opacity: 0; }\n\n.modal-panel {\n position: relative; pointer-events: auto;\n display: flex; flex-direction: column;\n border-radius: var(--Border-2, 8px);\n background: var(--Neutral-White, #ffffff);\n box-shadow: 0 0 60px rgba(0,0,0,0.06);\n overflow: hidden;\n padding: var(--Size-6, 32px); gap: var(--Size-5, 24px);\n max-height: calc(100vh - 60px);\n opacity: 0; transform: translateY(16px) scale(0.92);\n transition: opacity 0.18s ease, transform 0.18s ease;\n}\n.modal-root--open .modal-panel { opacity: 1; transform: none; }\n.modal-root--closing .modal-panel { opacity: 0; transform: translateY(-12px) scale(1.06); }\n\n.modal-header { display: flex; align-items: center; gap: 4px; }\n.modal-title { color: var(--Gray-Gray-700,#32394d); font-size: var(--Size-5, 24px); font-weight: var(--font-weight-bold); flex: 1; text-align: left; }\n.modal-close { margin-left: auto; border: 0; background: transparent; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: var(--font-size-xxl); line-height: 1; color: var(--Gray-Gray-400); }\n.modal-close:hover { opacity: 0.7; }\n\n.modal-content {\n padding-right: 8px; overflow: auto; flex: 1;\n display: flex; flex-direction: column;\n scrollbar-width: thin; scrollbar-color: var(--Gray-Gray-300,#a3abbf) var(--Gray-Gray-50,#f7f8fa);\n}\n.modal-content::-webkit-scrollbar { width: 4px; }\n.modal-content::-webkit-scrollbar-track { background: var(--Gray-Gray-50,#f7f8fa); border-radius: 16px; }\n.modal-content::-webkit-scrollbar-thumb { background: var(--Gray-Gray-300,#a3abbf); border-radius: 16px; }\n\n.modal-footer { \n display: flex; \n justify-content: flex-end; \n align-items: flex-start; \n gap: var(--Size-1, 4px); \n width: 100%;\n}\n.modal-footer:empty { display: none; }\n\n/* button-container: grid 2 columnas igual que en Angular host p-dialog-footer */\n::slotted(.button-container) {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: var(--Size-4, 16px);\n min-width: 470px;\n width: 100%;\n}\n::slotted(.button-container) > * {\n width: 100%;\n}\n::slotted(.button-container) dropi-button {\n width: 100%;\n}\n\n.modal-panel.size-m .modal-footer,\n.modal-panel.size-s .modal-footer { \n justify-content: center; \n}\n\n.modal-panel.size-m .modal-footer ::slotted(.button-container),\n.modal-panel.size-s .modal-footer ::slotted(.button-container) { \n min-width: unset !important;\n width: 100%;\n}\n\n.modal-panel.size-drawer-s .modal-footer ::slotted(.button-container) { \n min-width: unset; \n display: flex; \n flex-direction: column-reverse; \n gap: var(--Size-4, 16px);\n}\n\n.modal-panel.size-full { width: 100%; height: 100vh; max-height: 100vh; border-radius: 0; }\n.modal-panel.size-xxl { width: calc(100% - 60px); max-width: 1520px; height: calc(100vh - 120px); max-height: 900px; }\n.modal-panel.size-l { width: 1137px; max-width: 1137px; max-height: 754px; }\n.modal-panel.size-m { max-width: 550px; width: 550px; }\n.modal-panel.size-s { width: 454px; }\n\n.modal-root--right { align-items: stretch; justify-content: flex-end; }\n.modal-root--right .modal-panel { height: 100vh; max-height: 100vh; border-radius: 0; gap: 0; opacity: 1; transform: translateX(100%); transition: transform 0.32s cubic-bezier(0.4,0,0.2,1); }\n.modal-root--open.modal-root--right .modal-panel { transform: translateX(0); }\n.modal-root--closing.modal-root--right .modal-panel { transform: translateX(100%); }\n.modal-root--right .modal-panel.size-drawer-s { width: 351px; padding: 20px; box-shadow: 0 8px 40px rgba(0,0,0,0.16); }\n.modal-root--right .modal-panel.size-drawer-m { width: 550px; box-shadow: 0 8px 40px rgba(0,0,0,0.16); }\n.modal-root--right .modal-panel.size-drawer-l { width: 1137px; box-shadow: 0 8px 40px rgba(0,0,0,0.16); }\n.modal-root--right .modal-panel.size-drawer-xxl { width: 1214px; box-shadow: 0 8px 40px rgba(0,0,0,0.16); }\n.modal-root--right .modal-panel.size-sidebar-half { width: 50vw; min-width: 600px; box-shadow: 0 8px 40px rgba(0,0,0,0.16); }\n\n@media (max-width: 768px) {\n .modal-root--right .modal-panel.size-drawer-s,\n .modal-root--right .modal-panel.size-drawer-m,\n .modal-root--right .modal-panel.size-drawer-l,\n .modal-root--right .modal-panel.size-drawer-xxl,\n .modal-root--right .modal-panel.size-sidebar-half { width: 100vw; min-width: unset; }\n}\n\n.modal-root--left { align-items: stretch; justify-content: flex-start; }\n.modal-root--left .modal-panel { height: 100vh; max-height: 100vh; border-radius: 0; gap: 0; opacity: 1; transform: translateX(-100%); transition: transform 0.32s cubic-bezier(0.4,0,0.2,1); }\n.modal-root--open.modal-root--left .modal-panel { transform: translateX(0); }\n.modal-root--closing.modal-root--left .modal-panel { transform: translateX(-100%); }\n\n.modal-root--top { align-items: flex-start; }\n.modal-root--bottom { align-items: flex-end; }\n\n@media (max-width: 599px) {\n .modal-panel { padding: 20px; width: 100% !important; }\n .modal-panel:not(.size-s) { border-radius: 0 !important; height: 100% !important; max-height: unset !important; }\n .modal-root--right .modal-panel { width: 100vw !important; min-width: unset !important; }\n \n .modal-footer { justify-content: center; }\n .modal-footer ::slotted(.button-container) { \n width: 100%;\n min-width: unset !important;\n display: flex;\n flex-direction: column-reverse;\n gap: var(--Size-4, 16px);\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .modal-root, .modal-mask, .modal-panel { transition: none !important; }\n}\n","import { Component, Prop, Event, EventEmitter, State, Watch, Method, h, Build } from '@stencil/core';\n\nexport type ModalPosition = 'center' | 'right' | 'left' | 'top' | 'bottom';\nexport type ModalSize = 'full' | 'xxl' | 'l' | 'm' | 's' | 'drawer-s' | 'drawer-m' | 'drawer-l' | 'drawer-xxl' | 'sidebar-half';\n\n/**\n * @component dropi-modal\n * Modal/dialog with backdrop, close button, and header/content/footer slots.\n * Slots: (default) body, \"header\" custom header, \"footer\" actions.\n */\n@Component({\n tag: 'dropi-modal',\n styleUrl: 'dropi-modal.css',\n shadow: true,\n})\nexport class DropiModal {\n @Prop({ mutable: true, reflect: true }) visible: any = false;\n @Prop() header: string | null = null;\n @Prop() showCloseIcon: boolean = true;\n @Prop() dismissable: boolean = true;\n @Prop() dismissableMask: boolean = true;\n @Prop() dismissible: boolean = true;\n @Prop() closeOnEscape: boolean = true;\n @Prop() modal: boolean = true;\n @Prop() closable: boolean = true;\n @Prop() blockScroll: boolean = true;\n @Prop() showHeader: boolean = true;\n @Prop() showFooter: boolean = true;\n @Prop() position: ModalPosition = 'center';\n @Prop() size: ModalSize = 'm';\n @Prop() styleClass: string | null = null;\n @Prop() maxWidth: string | null = null;\n /** Auto-manage z-index stack (matches Angular `autoZIndex`) */\n @Prop() autoZIndex: boolean = true;\n /** Base z-index value when autoZIndex is false (matches Angular `baseZIndex`) */\n @Prop() baseZIndex: number = 1100;\n /** CSS transition duration, e.g. '0.15s' (matches Angular `transitionOptions`) */\n @Prop() transitionOptions: string = '0.15s';\n /** Enable a before-close hook (matches Angular `enableBeforeClose`) */\n @Prop() enableBeforeClose: boolean = false;\n /** No-op — kept for API parity with Angular (matches Angular `draggable`) */\n @Prop() isDraggable: boolean = false;\n /** No-op — kept for API parity with Angular (matches Angular `resizable`) */\n @Prop() resizable: boolean = false;\n\n @Event({ composed: false }) onShow: EventEmitter<void>;\n @Event({ composed: false }) onHide: EventEmitter<void>;\n @Event({ composed: false }) visibleChange: EventEmitter<boolean>;\n\n @State() private isOpen: boolean = false;\n @State() private isClosing: boolean = false;\n @State() private mounted: boolean = false;\n\n private closeTimer: any = null;\n private keyHandler: ((e: KeyboardEvent) => void) | null = null;\n\n @Watch('visible')\n visibleChanged(val: any, oldVal: any) {\n const isVisible = val === true || String(val) === 'true';\n const wasVisible = oldVal === true || String(oldVal) === 'true';\n if (isVisible === wasVisible) return;\n \n console.log('[DropiModal] visibleChanged:', isVisible);\n isVisible ? this.openModal() : (this.mounted && this.startClose());\n }\n\n componentDidLoad() {\n const isVisible = this.visible === true || String(this.visible) === 'true';\n if (isVisible) this.openModal();\n }\n\n disconnectedCallback() {\n this.removeKeyHandler();\n if (this.closeTimer) clearTimeout(this.closeTimer);\n if (typeof document !== 'undefined') {\n document.body.classList.remove('dropi-modal-open');\n }\n }\n\n @Method() async hide() {\n this.visible = false;\n this.visibleChange.emit(false);\n this.startClose();\n }\n\n @Method() async show() {\n this.visible = true;\n this.visibleChange.emit(true);\n this.openModal();\n }\n\n private openModal() {\n if (this.closeTimer) { clearTimeout(this.closeTimer); this.closeTimer = null; }\n this.mounted = true;\n this.isClosing = false;\n this.isOpen = false;\n requestAnimationFrame(() => requestAnimationFrame(() => {\n this.isOpen = true;\n this.onShow.emit();\n }));\n this.addKeyHandler();\n if ((this.modal ?? true) && Build.isBrowser && document.body) {\n document.body.classList.add('dropi-modal-open');\n }\n }\n\n private startClose() {\n if (this.isClosing) return;\n this.isClosing = true;\n this.isOpen = false;\n this.removeKeyHandler();\n if (this.closeTimer) clearTimeout(this.closeTimer);\n this.closeTimer = setTimeout(() => {\n this.mounted = false;\n this.isClosing = false;\n this.closeTimer = null;\n if ((this.modal ?? true) && Build.isBrowser && document.body) {\n document.body.classList.remove('dropi-modal-open');\n }\n this.onHide.emit();\n }, 200);\n }\n\n private addKeyHandler() {\n if (!this.closeOnEscape) return;\n this.keyHandler = (e: KeyboardEvent) => {\n if (e.key === 'Escape' && this.visible && this.dismissable) this.hide();\n };\n document.addEventListener('keydown', this.keyHandler);\n }\n\n private removeKeyHandler() {\n if (this.keyHandler) { document.removeEventListener('keydown', this.keyHandler); this.keyHandler = null; }\n }\n\n render() {\n return (\n <div \n class={`modal-root modal-root--${this.position}${this.isOpen ? ' modal-root--open' : ''}${this.isClosing ? ' modal-root--closing' : ''}`}\n style={{ display: this.mounted || this.isClosing ? 'flex' : 'none' }}\n >\n {(this.modal ?? true) && <div class=\"modal-mask\" onClick={() => this.dismissable && this.hide()} />}\n <div class={`modal-panel size-${this.size || 'm'}`} role=\"dialog\" aria-modal=\"true\">\n {this.showHeader && (\n <div class=\"modal-header\">\n {this.header && <span class=\"modal-title\">{this.header}</span>}\n <slot name=\"header\"></slot>\n {this.showCloseIcon && (\n <button class=\"modal-close\" onClick={() => this.hide()} aria-label=\"Cerrar\">\n ×\n </button>\n )}\n </div>\n )}\n <div class=\"modal-content\"><slot /></div>\n {this.showFooter && <div class=\"modal-footer\"><slot name=\"footer\" /></div>}\n </div>\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { r as registerInstance, d as createEvent, h } from './index-Cvp2LQOM.js';
|
|
2
|
+
|
|
3
|
+
const dropiNavbarCss = () => `:host{display:block;width:100%}*,*::before,*::after{box-sizing:border-box}.navbar{display:flex;align-items:center;height:56px;padding:0 var(--Size-4, 16px);background:var(--Neutral-White, #ffffff);border-bottom:1px solid var(--Gray-Gray-100, #eceef4);gap:var(--Size-4, 16px);position:relative}.navbar__left{display:flex;align-items:center;gap:var(--Size-2, 8px);flex-shrink:0}.navbar__menu-btn{background:none;border:none;padding:6px;cursor:pointer;border-radius:var(--Border-1, 4px);display:flex;align-items:center;transition:background 0.15s}.navbar__menu-btn:hover{background:var(--Gray-Gray-50, #f7f8fa)}.navbar__logo{height:28px;object-fit:contain}.navbar__items{flex:1;list-style:none;margin:0;padding:0;display:flex;align-items:center;gap:var(--Size-1, 4px)}.navbar__item{display:flex;align-items:center;gap:var(--Size-1, 4px);padding:6px var(--Size-3, 12px);background:none;border:none;border-radius:var(--Border-1, 4px);font-size:var(--font-size-s, 12px);font-family:inherit;color:var(--Gray-Gray-600, #475066);cursor:pointer;transition:background 0.15s, color 0.15s;white-space:nowrap}.navbar__item:hover{background:var(--Gray-Gray-50, #f7f8fa)}.navbar__item--active{background:var(--Primary-Primary-50, #fff5eb);color:var(--Primary-Primary-500, #f49a3d);font-weight:var(--font-weight-bold, 700)}.navbar__badge{background:var(--Error-Error-500, #f46a6b);color:var(--Neutral-White, #ffffff);font-size:var(--font-size-xxs);font-weight:var(--font-weight-bold);min-width:16px;height:16px;border-radius:100px;display:flex;align-items:center;justify-content:center;padding:0 4px}.navbar__right{display:flex;align-items:center;gap:var(--Size-2, 8px);flex-shrink:0}.navbar__icon-btn{position:relative;background:none;border:none;padding:6px;cursor:pointer;border-radius:var(--Border-1, 4px);display:flex;align-items:center;transition:background 0.15s}.navbar__icon-btn:hover{background:var(--Gray-Gray-50, #f7f8fa)}.navbar__notif-badge{position:absolute;top:2px;right:2px;background:var(--Error-Error-500, #f46a6b);color:var(--Neutral-White, #ffffff);font-size:9px;font-weight:var(--font-weight-bold);min-width:14px;height:14px;border-radius:100px;display:flex;align-items:center;justify-content:center;padding:0 3px}.navbar__user-btn{display:flex;align-items:center;gap:var(--Size-1, 4px);background:none;border:none;padding:4px 8px;border-radius:var(--Border-1, 4px);cursor:pointer;transition:background 0.15s;font-family:inherit}.navbar__user-btn:hover{background:var(--Gray-Gray-50, #f7f8fa)}.navbar__avatar{width:28px;height:28px;border-radius:50%;object-fit:cover}.navbar__avatar-placeholder{width:28px;height:28px;border-radius:50%;background:var(--Primary-Primary-500, #f49a3d);color:var(--Neutral-White, #ffffff);display:flex;align-items:center;justify-content:center;font-size:var(--font-size-xs, 10px);font-weight:var(--font-weight-bold, 700)}.navbar__user-name{font-size:var(--font-size-s, 12px);color:var(--Gray-Gray-700, #32394d);max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}`;
|
|
4
|
+
|
|
5
|
+
const DropiNavbar = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.clickLoadItem = createEvent(this, "clickLoadItem", 7);
|
|
9
|
+
this.dropiNotificationsClick = createEvent(this, "dropiNotificationsClick", 7);
|
|
10
|
+
this.dropiUserClick = createEvent(this, "dropiUserClick", 7);
|
|
11
|
+
this.dropiMenuToggle = createEvent(this, "dropiMenuToggle", 7);
|
|
12
|
+
}
|
|
13
|
+
/** Logo URL */
|
|
14
|
+
logoUrl = '';
|
|
15
|
+
/** Logo alt */
|
|
16
|
+
logoAlt = 'Logo';
|
|
17
|
+
/** Navigation data (matches Angular `data: DropiTableRow[]`) */
|
|
18
|
+
data = [];
|
|
19
|
+
/** Title (matches Angular `title`) */
|
|
20
|
+
title = '';
|
|
21
|
+
/** Active item ID */
|
|
22
|
+
activeId = '';
|
|
23
|
+
/** User name */
|
|
24
|
+
userName = '';
|
|
25
|
+
/** User avatar URL */
|
|
26
|
+
userAvatar = '';
|
|
27
|
+
/** Notification count (0 = no badge) */
|
|
28
|
+
notifications = 0;
|
|
29
|
+
/** Show menu toggle (mobile) */
|
|
30
|
+
showMenuToggle = true;
|
|
31
|
+
/** Emitted when a nav item is clicked (matches Angular `clickLoadItem`) */
|
|
32
|
+
clickLoadItem;
|
|
33
|
+
/** Emitted when notification bell is clicked */
|
|
34
|
+
dropiNotificationsClick;
|
|
35
|
+
/** Emitted when avatar/user is clicked */
|
|
36
|
+
dropiUserClick;
|
|
37
|
+
/** Emitted when mobile menu toggle clicked */
|
|
38
|
+
dropiMenuToggle;
|
|
39
|
+
get parsedData() {
|
|
40
|
+
const val = this.data;
|
|
41
|
+
return typeof val === 'string' ? JSON.parse(val) : (val || []);
|
|
42
|
+
}
|
|
43
|
+
render() {
|
|
44
|
+
const items = this.parsedData;
|
|
45
|
+
return (h("nav", { key: '15c337396dbe445ac7a13d7e0f2d99f88b4de439', class: "navbar" }, h("div", { key: '922a217dfe53f3f34dd6746033996bcd71dadfb2', class: "navbar__left" }, this.showMenuToggle && (h("button", { key: 'db80ad1fd6f47807196c81ae60bf9cea8bb16e77', class: "navbar__menu-btn", onClick: () => this.dropiMenuToggle.emit(), "aria-label": "Men\u00FA" }, h("dropi-icon", { key: 'eca18144260cb6471a19f78f7ce75254ba5a138e', name: "Menu", iconWidth: "20px", iconHeight: "20px", color: "Gray-Gray-700" }))), this.logoUrl && (h("img", { key: '374ea8553605f289c413882c757eda70054ba71d', class: "navbar__logo", src: this.logoUrl, alt: this.logoAlt })), this.title && h("span", { key: '8e2abceb591c0de10ca99d2090fea7a0da792a7b', class: "navbar__title" }, this.title)), items.length > 0 && (h("ul", { key: 'fd26fc64ea3325ddc439a802ab56e69b329020dd', class: "navbar__items" }, items.map(item => (h("li", null, h("button", { class: { 'navbar__item': true, 'navbar__item--active': item.id === this.activeId }, onClick: () => this.clickLoadItem.emit(item), type: "button" }, item.icon && h("dropi-icon", { name: item.icon, iconWidth: "16px", iconHeight: "16px", color: item.id === this.activeId ? 'Primary-Primary-500' : 'Gray-Gray-600' }), h("span", null, item.name?.value || item.label), item.badge != null && String(item.badge) !== '0' && (h("span", { class: "navbar__badge" }, item.badge)))))))), h("div", { key: '51a6532caac773ea7236e95b0aa5ee9ee052db4a', class: "navbar__right" }, h("button", { key: '309b47a8fa074e7d47632a95490c5ba0d2950745', class: "navbar__icon-btn", onClick: () => this.dropiNotificationsClick.emit(), "aria-label": "Notificaciones" }, h("dropi-icon", { key: '2a970ae36fdd4e42d9fbab5d8ebb61a1d14d54c8', name: "Bell", iconWidth: "20px", iconHeight: "20px", color: "Gray-Gray-600" }), this.notifications > 0 && (h("span", { key: '67412b6d3c7689f78cca15e91a1e8e3ee88152a2', class: "navbar__notif-badge" }, this.notifications > 99 ? '99+' : this.notifications))), h("button", { key: '38cc70fdc1c204b06b62c54a23f4b8c76647fd6b', class: "navbar__user-btn", onClick: () => this.dropiUserClick.emit(), type: "button" }, this.userAvatar
|
|
46
|
+
? h("img", { class: "navbar__avatar", src: this.userAvatar, alt: this.userName })
|
|
47
|
+
: h("div", { class: "navbar__avatar-placeholder" }, this.userName ? this.userName[0].toUpperCase() : '?'), this.userName && h("span", { key: '1f2cfe4bddef60d31751c24c3f02cace2f07d6dd', class: "navbar__user-name" }, this.userName), h("dropi-icon", { key: '520aff19c56964eefb3b1f59646c19df779c7e47', name: "Arrow-Down-2", iconWidth: "12px", iconHeight: "12px", color: "Gray-Gray-400" })))));
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
DropiNavbar.style = dropiNavbarCss();
|
|
51
|
+
|
|
52
|
+
export { DropiNavbar as dropi_navbar };
|
|
53
|
+
//# sourceMappingURL=dropi-navbar.entry.esm.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CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,KAAK,EAAC,mBAAmB,EAAA,EAAE,IAAI,CAAC,QAAQ,CAAQ,EACxE,CAAA,CAAA,YAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAY,IAAI,EAAC,cAAc,EAAC,SAAS,EAAC,MAAM,EAAC,UAAU,EAAC,MAAM,EAAC,KAAK,EAAC,eAAe,EAAA,CAAG,CACpF,CACL,CACF;;;;;;;","names":[],"sources":["src/components/dropi-navbar/dropi-navbar.css?tag=dropi-navbar&encapsulation=shadow","src/components/dropi-navbar/dropi-navbar.tsx"],"sourcesContent":[":host { display: block; width: 100%; }\n*, *::before, *::after { box-sizing: border-box; }\n\n.navbar {\n display: flex;\n align-items: center;\n height: 56px;\n padding: 0 var(--Size-4, 16px);\n background: var(--Neutral-White, #ffffff);\n border-bottom: 1px solid var(--Gray-Gray-100, #eceef4);\n gap: var(--Size-4, 16px);\n position: relative;\n}\n\n/* Left */\n.navbar__left {\n display: flex;\n align-items: center;\n gap: var(--Size-2, 8px);\n flex-shrink: 0;\n}\n\n.navbar__menu-btn {\n background: none;\n border: none;\n padding: 6px;\n cursor: pointer;\n border-radius: var(--Border-1, 4px);\n display: flex;\n align-items: center;\n transition: background 0.15s;\n}\n.navbar__menu-btn:hover { background: var(--Gray-Gray-50, #f7f8fa); }\n\n.navbar__logo {\n height: 28px;\n object-fit: contain;\n}\n\n/* Center nav items */\n.navbar__items {\n flex: 1;\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n align-items: center;\n gap: var(--Size-1, 4px);\n}\n\n.navbar__item {\n display: flex;\n align-items: center;\n gap: var(--Size-1, 4px);\n padding: 6px var(--Size-3, 12px);\n background: none;\n border: none;\n border-radius: var(--Border-1, 4px);\n font-size: var(--font-size-s, 12px);\n font-family: inherit;\n color: var(--Gray-Gray-600, #475066);\n cursor: pointer;\n transition: background 0.15s, color 0.15s;\n white-space: nowrap;\n}\n.navbar__item:hover { background: var(--Gray-Gray-50, #f7f8fa); }\n.navbar__item--active {\n background: var(--Primary-Primary-50, #fff5eb);\n color: var(--Primary-Primary-500, #f49a3d);\n font-weight: var(--font-weight-bold, 700);\n}\n\n.navbar__badge {\n background: var(--Error-Error-500, #f46a6b);\n color: var(--Neutral-White, #ffffff);\n font-size: var(--font-size-xxs);\n font-weight: var(--font-weight-bold);\n min-width: 16px;\n height: 16px;\n border-radius: 100px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0 4px;\n}\n\n/* Right */\n.navbar__right {\n display: flex;\n align-items: center;\n gap: var(--Size-2, 8px);\n flex-shrink: 0;\n}\n\n.navbar__icon-btn {\n position: relative;\n background: none;\n border: none;\n padding: 6px;\n cursor: pointer;\n border-radius: var(--Border-1, 4px);\n display: flex;\n align-items: center;\n transition: background 0.15s;\n}\n.navbar__icon-btn:hover { background: var(--Gray-Gray-50, #f7f8fa); }\n\n.navbar__notif-badge {\n position: absolute;\n top: 2px;\n right: 2px;\n background: var(--Error-Error-500, #f46a6b);\n color: var(--Neutral-White, #ffffff);\n font-size: 9px;\n font-weight: var(--font-weight-bold);\n min-width: 14px;\n height: 14px;\n border-radius: 100px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0 3px;\n}\n\n.navbar__user-btn {\n display: flex;\n align-items: center;\n gap: var(--Size-1, 4px);\n background: none;\n border: none;\n padding: 4px 8px;\n border-radius: var(--Border-1, 4px);\n cursor: pointer;\n transition: background 0.15s;\n font-family: inherit;\n}\n.navbar__user-btn:hover { background: var(--Gray-Gray-50, #f7f8fa); }\n\n.navbar__avatar {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n object-fit: cover;\n}\n\n.navbar__avatar-placeholder {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n background: var(--Primary-Primary-500, #f49a3d);\n color: var(--Neutral-White, #ffffff);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--font-size-xs, 10px);\n font-weight: var(--font-weight-bold, 700);\n}\n\n.navbar__user-name {\n font-size: var(--font-size-s, 12px);\n color: var(--Gray-Gray-700, #32394d);\n max-width: 120px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n","import { Component, Prop, Event, EventEmitter, h } from '@stencil/core';\n\nexport interface NavItem {\n id: string;\n label: string;\n icon?: string;\n badge?: string | number;\n href?: string;\n}\n\n/**\n * @component dropi-navbar\n * Top navigation bar with logo, nav items, notification bell, and user avatar.\n */\n@Component({\n tag: 'dropi-navbar',\n styleUrl: 'dropi-navbar.css',\n shadow: true,\n})\nexport class DropiNavbar {\n /** Logo URL */\n @Prop() logoUrl: string = '';\n /** Logo alt */\n @Prop() logoAlt: string = 'Logo';\n\n /** Navigation data (matches Angular `data: DropiTableRow[]`) */\n @Prop() data: any[] | string = [];\n /** Title (matches Angular `title`) */\n @Prop() title: string = '';\n\n /** Active item ID */\n @Prop() activeId: string = '';\n /** User name */\n @Prop() userName: string = '';\n /** User avatar URL */\n @Prop() userAvatar: string = '';\n /** Notification count (0 = no badge) */\n @Prop() notifications: number = 0;\n /** Show menu toggle (mobile) */\n @Prop() showMenuToggle: boolean = true;\n\n /** Emitted when a nav item is clicked (matches Angular `clickLoadItem`) */\n @Event() clickLoadItem: EventEmitter<any>;\n /** Emitted when notification bell is clicked */\n @Event() dropiNotificationsClick: EventEmitter<void>;\n /** Emitted when avatar/user is clicked */\n @Event() dropiUserClick: EventEmitter<void>;\n /** Emitted when mobile menu toggle clicked */\n @Event() dropiMenuToggle: EventEmitter<void>;\n\n private get parsedData(): any[] {\n const val = this.data;\n return typeof val === 'string' ? JSON.parse(val) : (val || []);\n }\n\n render() {\n const items = this.parsedData;\n\n return (\n <nav class=\"navbar\">\n {/* Left: logo + title + menu toggle */}\n <div class=\"navbar__left\">\n {this.showMenuToggle && (\n <button class=\"navbar__menu-btn\" onClick={() => this.dropiMenuToggle.emit()} aria-label=\"Menú\">\n <dropi-icon name=\"Menu\" iconWidth=\"20px\" iconHeight=\"20px\" color=\"Gray-Gray-700\" />\n </button>\n )}\n {this.logoUrl && (\n <img class=\"navbar__logo\" src={this.logoUrl} alt={this.logoAlt} />\n )}\n {this.title && <span class=\"navbar__title\">{this.title}</span>}\n </div>\n\n {/* Center: nav items */}\n {items.length > 0 && (\n <ul class=\"navbar__items\">\n {items.map(item => (\n <li>\n <button\n class={{ 'navbar__item': true, 'navbar__item--active': item.id === this.activeId }}\n onClick={() => this.clickLoadItem.emit(item)}\n type=\"button\"\n >\n {item.icon && <dropi-icon name={item.icon} iconWidth=\"16px\" iconHeight=\"16px\" color={item.id === this.activeId ? 'Primary-Primary-500' : 'Gray-Gray-600'} />}\n <span>{item.name?.value || item.label}</span>\n {item.badge != null && String(item.badge) !== '0' && (\n <span class=\"navbar__badge\">{item.badge}</span>\n )}\n </button>\n </li>\n ))}\n </ul>\n )}\n\n {/* Right: notifications + user */}\n <div class=\"navbar__right\">\n <button class=\"navbar__icon-btn\" onClick={() => this.dropiNotificationsClick.emit()} aria-label=\"Notificaciones\">\n <dropi-icon name=\"Bell\" iconWidth=\"20px\" iconHeight=\"20px\" color=\"Gray-Gray-600\" />\n {this.notifications > 0 && (\n <span class=\"navbar__notif-badge\">{this.notifications > 99 ? '99+' : this.notifications}</span>\n )}\n </button>\n\n <button class=\"navbar__user-btn\" onClick={() => this.dropiUserClick.emit()} type=\"button\">\n {this.userAvatar\n ? <img class=\"navbar__avatar\" src={this.userAvatar} alt={this.userName} />\n : <div class=\"navbar__avatar-placeholder\">\n {this.userName ? this.userName[0].toUpperCase() : '?'}\n </div>\n }\n {this.userName && <span class=\"navbar__user-name\">{this.userName}</span>}\n <dropi-icon name=\"Arrow-Down-2\" iconWidth=\"12px\" iconHeight=\"12px\" color=\"Gray-Gray-400\" />\n </button>\n </div>\n </nav>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { r as registerInstance, d as createEvent, h } from './index-Cvp2LQOM.js';
|
|
2
|
+
|
|
3
|
+
const dropiOtpSendCodeCss = () => `:host{display:block;width:100%}*,*::before,*::after{box-sizing:border-box}.otp{display:flex;flex-direction:column;align-items:center;gap:var(--Size-4, 16px)}.otp__label{font-size:var(--font-size-s, 12px);color:var(--Gray-Gray-600, #475066);text-align:center;margin:0}.otp__inputs{display:flex;gap:var(--Size-4, 16px)}.otp__digit{width:56px;height:56px;border:1.5px solid var(--Gray-Gray-200, #d3d7de);border-radius:var(--Border-2, 8px);text-align:center;font-size:22px;font-weight:var(--font-weight-bold, 700);font-family:inherit;color:var(--Gray-Gray-800, #1f2433);outline:none;transition:border-color 0.15s ease;background:var(--Neutral-White, #ffffff)}.otp__digit:focus{border:2px solid var(--Primary-Primary-500, #f49a3d)}.otp__digit--filled{border:1px solid var(--Success-Success-500, #0abb87);color:var(--Neutral-Neutral-900, #0e111a)}.otp__digit--error{border:1px solid var(--Error-Error-500, #f46a6b)}.otp__error{margin:0;font-size:var(--font-size-xs, 10px);color:var(--Error-Error-500, #f46a6b);text-align:center}.otp__resend{text-align:center}.otp__countdown{font-size:var(--font-size-xs, 10px);color:var(--Gray-Gray-400, #858ea6)}.otp__resend-btn{background:none;border:none;padding:0;font-size:var(--font-size-s, 12px);font-weight:var(--font-weight-bold, 700);color:var(--Primary-Primary-500, #f49a3d);cursor:pointer;text-decoration:underline}`;
|
|
4
|
+
|
|
5
|
+
const OTP_LENGTH = 6;
|
|
6
|
+
const RESEND_SECONDS = 30;
|
|
7
|
+
const DropiOtpSendCode = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
registerInstance(this, hostRef);
|
|
10
|
+
this.codeCompleted = createEvent(this, "codeCompleted", 7);
|
|
11
|
+
this.codeAccepted = createEvent(this, "codeAccepted", 7);
|
|
12
|
+
this.dropiResend = createEvent(this, "dropiResend", 7);
|
|
13
|
+
}
|
|
14
|
+
/** Delivery method label */
|
|
15
|
+
engine = 'email';
|
|
16
|
+
/** Contact info (email/phone to show in label) */
|
|
17
|
+
labelContact = '';
|
|
18
|
+
/** Show contact label */
|
|
19
|
+
showLabelContact = false;
|
|
20
|
+
/** Error message to display */
|
|
21
|
+
errorMessage = '';
|
|
22
|
+
digits = Array(OTP_LENGTH).fill('');
|
|
23
|
+
digitStates = Array(OTP_LENGTH).fill('idle');
|
|
24
|
+
countdown = RESEND_SECONDS;
|
|
25
|
+
canResend = false;
|
|
26
|
+
error = false;
|
|
27
|
+
inputs = [];
|
|
28
|
+
timer;
|
|
29
|
+
/** Emitted when all 6 digits are entered. */
|
|
30
|
+
codeCompleted;
|
|
31
|
+
/** Emitted when all 6 digits are entered (alternative event). */
|
|
32
|
+
codeAccepted;
|
|
33
|
+
/** Emitted when resend is requested */
|
|
34
|
+
dropiResend;
|
|
35
|
+
componentDidLoad() { this.startCountdown(); }
|
|
36
|
+
disconnectedCallback() { clearInterval(this.timer); }
|
|
37
|
+
startCountdown() {
|
|
38
|
+
this.countdown = RESEND_SECONDS;
|
|
39
|
+
this.canResend = false;
|
|
40
|
+
clearInterval(this.timer);
|
|
41
|
+
this.timer = setInterval(() => {
|
|
42
|
+
this.countdown--;
|
|
43
|
+
if (this.countdown <= 0) {
|
|
44
|
+
clearInterval(this.timer);
|
|
45
|
+
this.canResend = true;
|
|
46
|
+
}
|
|
47
|
+
}, 1000);
|
|
48
|
+
}
|
|
49
|
+
handleInput(e, index) {
|
|
50
|
+
const val = e.target.value.replace(/\D/g, '').slice(-1);
|
|
51
|
+
const newDigits = [...(this.digits ?? Array(OTP_LENGTH).fill(''))];
|
|
52
|
+
newDigits[index] = val;
|
|
53
|
+
this.digits = newDigits;
|
|
54
|
+
const newStates = [...(this.digitStates ?? Array(OTP_LENGTH).fill('idle'))];
|
|
55
|
+
newStates[index] = val ? 'filled' : 'idle';
|
|
56
|
+
this.digitStates = newStates;
|
|
57
|
+
if (val && index < OTP_LENGTH - 1)
|
|
58
|
+
this.inputs[index + 1]?.focus();
|
|
59
|
+
if (newDigits.every(d => d !== '')) {
|
|
60
|
+
const finalCode = newDigits.join('');
|
|
61
|
+
this.codeCompleted.emit(finalCode);
|
|
62
|
+
this.codeAccepted.emit(finalCode);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
handleKeyDown(e, index) {
|
|
66
|
+
if (e.key === 'Backspace' && !(this.digits ?? [])[index] && index > 0) {
|
|
67
|
+
this.inputs[index - 1]?.focus();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
handlePaste(e) {
|
|
71
|
+
e.preventDefault();
|
|
72
|
+
const text = e.clipboardData?.getData('text')?.replace(/\D/g, '').slice(0, OTP_LENGTH) || '';
|
|
73
|
+
const newDigits = Array(OTP_LENGTH).fill('');
|
|
74
|
+
text.split('').forEach((c, i) => { newDigits[i] = c; });
|
|
75
|
+
this.digits = newDigits;
|
|
76
|
+
this.digitStates = newDigits.map(d => d ? 'filled' : 'idle');
|
|
77
|
+
this.inputs[Math.min(text.length, OTP_LENGTH - 1)]?.focus();
|
|
78
|
+
if (newDigits.every(d => d !== '')) {
|
|
79
|
+
const finalCode = newDigits.join('');
|
|
80
|
+
this.codeCompleted.emit(finalCode);
|
|
81
|
+
this.codeAccepted.emit(finalCode);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
render() {
|
|
85
|
+
const engineLabel = this.engine === 'sms' ? 'SMS' : this.engine === '2fa' ? 'autenticador' : 'correo';
|
|
86
|
+
return (h("div", { key: '8071fefc81136d40bbbb9e899e93cf482e824ccd', class: "otp" }, this.showLabelContact && (h("p", { key: '811bc73073e180fe9094e99596c222870ed6c01f', class: "otp__label" }, "Ingresa el c\u00F3digo enviado a tu ", engineLabel, this.labelContact && h("strong", { key: '3fe866ea995638f1b003330ee70c9f21e4c700a0' }, " ", this.labelContact))), h("div", { key: '17701568ff66f89f89fce0f10fdda45840fffd5f', class: "otp__inputs", onPaste: (e) => this.handlePaste(e) }, Array.from({ length: OTP_LENGTH }, (_, i) => (h("input", { key: i, ref: (el) => {
|
|
87
|
+
if (el)
|
|
88
|
+
this.inputs[i] = el;
|
|
89
|
+
}, class: {
|
|
90
|
+
'otp__digit': true,
|
|
91
|
+
'otp__digit--filled': (this.digitStates ?? [])[i] === 'filled',
|
|
92
|
+
'otp__digit--error': this.error,
|
|
93
|
+
}, 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: 'ab3021f6227105d3bb2a244e4b9b08c8dca51dec', class: "otp__error" }, this.errorMessage)), h("div", { key: '6915de3762c811ad365336e8dc2b129c20abe3a6', 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")))));
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
DropiOtpSendCode.style = dropiOtpSendCodeCss();
|
|
97
|
+
|
|
98
|
+
export { DropiOtpSendCode as dropi_otp_send_code };
|
|
99
|
+
//# sourceMappingURL=dropi-otp-send-code.entry.esm.js.map
|
|
100
|
+
|
|
101
|
+
//# sourceMappingURL=dropi-otp-send-code.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"dropi-otp-send-code.entry.js","mappings":";;AAAA,MAAM,mBAAmB,GAAG,MAAM,CAAC,20CAA20C,CAAC;;ACE/2C,MAAM,UAAU,GAAG,CAAC;AACpB,MAAM,cAAc,GAAG,EAAE;MAWZ,gBAAgB,GAAA,MAAA;;;;;;;;IAEnB,MAAM,GAA4B,OAAO;;IAEzC,YAAY,GAAW,EAAE;;IAEzB,gBAAgB,GAAY,KAAK;;IAEjC,YAAY,GAAW,EAAE;IAEhB,MAAM,GAAa,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;IAC7C,WAAW,GAAoC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;IAC7E,SAAS,G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,EAAA,EAAA,sBAAA,CAEzF,KAET,CAAA,CAAA,MAAA,EAAA,EAAM,KAAK,EAAC,gBAAgB,EAAA,kBAAc,IAAI,CAAC,SAAS,MAAS,CAClE,CACG,CACF;;;;;;;","names":[],"sources":["src/components/dropi-otp-send-code/dropi-otp-send-code.css?tag=dropi-otp-send-code&encapsulation=shadow","src/components/dropi-otp-send-code/dropi-otp-send-code.tsx"],"sourcesContent":[":host { display: block; width: 100%; }\n*, *::before, *::after { box-sizing: border-box; }\n\n.otp { display: flex; flex-direction: column; align-items: center; gap: var(--Size-4, 16px); }\n\n.otp__label {\n font-size: var(--font-size-s, 12px);\n color: var(--Gray-Gray-600, #475066);\n text-align: center;\n margin: 0;\n}\n\n.otp__inputs {\n display: flex;\n gap: var(--Size-4, 16px);\n}\n\n.otp__digit {\n width: 56px;\n height: 56px;\n border: 1.5px solid var(--Gray-Gray-200, #d3d7de);\n border-radius: var(--Border-2, 8px);\n text-align: center;\n font-size: 22px;\n font-weight: var(--font-weight-bold, 700);\n font-family: inherit;\n color: var(--Gray-Gray-800, #1f2433);\n outline: none;\n transition: border-color 0.15s ease;\n background: var(--Neutral-White, #ffffff);\n}\n\n.otp__digit:focus { \n border: 2px solid var(--Primary-Primary-500, #f49a3d);\n}\n.otp__digit--filled { \n border: 1px solid var(--Success-Success-500, #0abb87); \n color: var(--Neutral-Neutral-900, #0e111a); \n}\n.otp__digit--error { \n border: 1px solid var(--Error-Error-500, #f46a6b);\n}\n\n.otp__error {\n margin: 0;\n font-size: var(--font-size-xs, 10px);\n color: var(--Error-Error-500, #f46a6b);\n text-align: center;\n}\n\n.otp__resend { text-align: center; }\n\n.otp__countdown {\n font-size: var(--font-size-xs, 10px);\n color: var(--Gray-Gray-400, #858ea6);\n}\n\n.otp__resend-btn {\n background: none;\n border: none;\n padding: 0;\n font-size: var(--font-size-s, 12px);\n font-weight: var(--font-weight-bold, 700);\n color: var(--Primary-Primary-500, #f49a3d);\n cursor: pointer;\n text-decoration: underline;\n}\n","import { Component, Prop, State, Event, EventEmitter, h } from '@stencil/core';\n\nconst OTP_LENGTH = 6;\nconst RESEND_SECONDS = 30;\n\n/**\n * @component dropi-otp-send-code\n * 6-digit OTP input with countdown timer and resend capability.\n */\n@Component({\n tag: 'dropi-otp-send-code',\n styleUrl: 'dropi-otp-send-code.css',\n shadow: true,\n})\nexport class DropiOtpSendCode {\n /** Delivery method label */\n @Prop() engine: 'email' | 'sms' | '2fa' = 'email';\n /** Contact info (email/phone to show in label) */\n @Prop() labelContact: string = '';\n /** Show contact label */\n @Prop() showLabelContact: boolean = false;\n /** Error message to display */\n @Prop() errorMessage: string = '';\n\n @State() private digits: string[] = Array(OTP_LENGTH).fill('');\n @State() private digitStates: ('idle' | 'filled' | 'error')[] = Array(OTP_LENGTH).fill('idle');\n @State() private countdown: number = RESEND_SECONDS;\n @State() private canResend: boolean = false;\n @State() private error: boolean = false;\n\n private inputs: HTMLInputElement[] = [];\n private timer: any;\n\n /** Emitted when all 6 digits are entered. */\n @Event() codeCompleted: EventEmitter<string>;\n /** Emitted when all 6 digits are entered (alternative event). */\n @Event() codeAccepted: EventEmitter<string>;\n /** Emitted when resend is requested */\n @Event() dropiResend: EventEmitter<void>;\n\n componentDidLoad() { this.startCountdown(); }\n disconnectedCallback() { clearInterval(this.timer); }\n\n private startCountdown() {\n this.countdown = RESEND_SECONDS;\n this.canResend = false;\n clearInterval(this.timer);\n this.timer = setInterval(() => {\n this.countdown--;\n if (this.countdown <= 0) { clearInterval(this.timer); this.canResend = true; }\n }, 1000);\n }\n\n private handleInput(e: InputEvent, index: number) {\n const val = (e.target as HTMLInputElement).value.replace(/\\D/g, '').slice(-1);\n const newDigits = [...(this.digits ?? Array(OTP_LENGTH).fill(''))];\n newDigits[index] = val;\n this.digits = newDigits;\n\n const newStates = [...(this.digitStates ?? Array(OTP_LENGTH).fill('idle'))];\n newStates[index] = val ? 'filled' : 'idle';\n this.digitStates = newStates;\n\n if (val && index < OTP_LENGTH - 1) this.inputs[index + 1]?.focus();\n\n if (newDigits.every(d => d !== '')) {\n const finalCode = newDigits.join('');\n this.codeCompleted.emit(finalCode);\n this.codeAccepted.emit(finalCode);\n }\n }\n\n private handleKeyDown(e: KeyboardEvent, index: number) {\n if (e.key === 'Backspace' && !(this.digits ?? [])[index] && index > 0) {\n this.inputs[index - 1]?.focus();\n }\n }\n\n private handlePaste(e: ClipboardEvent) {\n e.preventDefault();\n const text = e.clipboardData?.getData('text')?.replace(/\\D/g, '').slice(0, OTP_LENGTH) || '';\n const newDigits = Array(OTP_LENGTH).fill('');\n text.split('').forEach((c, i) => { newDigits[i] = c; });\n this.digits = newDigits;\n this.digitStates = newDigits.map(d => d ? 'filled' : 'idle');\n this.inputs[Math.min(text.length, OTP_LENGTH - 1)]?.focus();\n \n if (newDigits.every(d => d !== '')) {\n const finalCode = newDigits.join('');\n this.codeCompleted.emit(finalCode);\n this.codeAccepted.emit(finalCode);\n }\n }\n\n render() {\n const engineLabel = this.engine === 'sms' ? 'SMS' : this.engine === '2fa' ? 'autenticador' : 'correo';\n\n return (\n <div class=\"otp\">\n {this.showLabelContact && (\n <p class=\"otp__label\">\n Ingresa el código enviado a tu {engineLabel}\n {this.labelContact && <strong> {this.labelContact}</strong>}\n </p>\n )}\n\n <div class=\"otp__inputs\" onPaste={(e) => this.handlePaste(e)}>\n {Array.from({ length: OTP_LENGTH }, (_, i) => (\n <input\n key={i}\n ref={(el) => { if (el) this.inputs[i] = el as HTMLInputElement; }}\n class={{\n 'otp__digit': true,\n 'otp__digit--filled': (this.digitStates ?? [])[i] === 'filled',\n 'otp__digit--error': this.error,\n }}\n type=\"text\"\n inputMode=\"numeric\"\n maxLength={1}\n value={(this.digits ?? [])[i] ?? ''}\n onInput={(e) => this.handleInput(e as InputEvent, i)}\n onKeyDown={(e) => this.handleKeyDown(e as KeyboardEvent, i)}\n />\n ))}\n </div>\n\n {this.error && this.errorMessage && (\n <p class=\"otp__error\">{this.errorMessage}</p>\n )}\n\n <div class=\"otp__resend\">\n {this.canResend ? (\n <button class=\"otp__resend-btn\" onClick={() => { this.startCountdown(); this.dropiResend.emit(); }}>\n Reenviar código\n </button>\n ) : (\n <span class=\"otp__countdown\">Reenviar en {this.countdown}s</span>\n )}\n </div>\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { r as registerInstance, d as createEvent, h } from './index-Cvp2LQOM.js';
|
|
2
|
+
|
|
3
|
+
const dropiPaginatorCss = () => `:host{display:block}*,*::before,*::after{box-sizing:border-box}.paginator{display:flex;align-items:center;justify-content:flex-end;gap:var(--Size-4, 16px);flex-wrap:wrap}.paginator-pages{display:flex;align-items:center;gap:var(--Size-1, 4px)}.paginator-btn{width:32px;height:32px;padding:0;border:none;border-radius:50%;background:transparent;color:var(--Gray-Gray-600, #475066);font-size:var(--font-size-s, 12px);font-family:inherit;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background 0.15s ease}.paginator-btn:hover:not(:disabled){background:var(--Gray-Gray-50, #f7f8fa)}.paginator-btn:disabled{opacity:0.4;cursor:not-allowed}.paginator-btn--active{background:var(--Primary-Primary-500, #f49a3d);color:var(--Neutral-White, #ffffff);font-weight:var(--font-weight-bold, 700)}.paginator-btn--active:hover{background:var(--Primary-Primary-500, #f49a3d)}.paginator-btn--arrow{width:auto;padding:0 var(--Size-2, 8px);border-radius:var(--Border-1, 4px);gap:4px}.paginator-btn--arrow:hover:not(:disabled){background:var(--Gray-Gray-50, #f7f8fa)}.paginator-label{font-size:var(--font-size-s, 12px);color:inherit}.paginator-ellipsis{color:var(--Gray-Gray-400, #858ea6);padding:0 4px;font-size:var(--font-size-s, 12px);display:flex;align-items:center}.paginator-size{display:flex;align-items:center;gap:var(--Size-2, 8px)}.paginator-size-label{font-size:var(--font-size-s, 12px);color:var(--Gray-Gray-500, #69738c)}.paginator-size-select{height:32px;padding:0 var(--Size-2, 8px);border:1px solid var(--Gray-Gray-200, #c3c9d9);border-radius:var(--Border-1, 4px);background:var(--Neutral-White, #ffffff);color:var(--Gray-Gray-600, #475066);font-size:var(--font-size-s, 12px);font-family:inherit;cursor:pointer;outline:none}`;
|
|
4
|
+
|
|
5
|
+
const DropiPaginator = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.pageChange = createEvent(this, "pageChange", 7);
|
|
9
|
+
}
|
|
10
|
+
/** Total number of pages */
|
|
11
|
+
totalPages = 1;
|
|
12
|
+
/** Current page (1-based) */
|
|
13
|
+
currentPage = 1;
|
|
14
|
+
/** Disabled state */
|
|
15
|
+
disabled = false;
|
|
16
|
+
/** Max page buttons to show at once */
|
|
17
|
+
maxVisiblePages = 8;
|
|
18
|
+
/** Hide total page count (show only arrows) */
|
|
19
|
+
isNotTotalPages = false;
|
|
20
|
+
/** Hide "Anterior"/"Siguiente" text labels, show only arrows */
|
|
21
|
+
noLabels = false;
|
|
22
|
+
/** Emitted when page changes. e.detail = new page number */
|
|
23
|
+
pageChange;
|
|
24
|
+
get pageNumbers() {
|
|
25
|
+
const total = this.totalPages;
|
|
26
|
+
const cur = this.currentPage;
|
|
27
|
+
const max = this.maxVisiblePages;
|
|
28
|
+
if (total <= max)
|
|
29
|
+
return Array.from({ length: total }, (_, i) => i + 1);
|
|
30
|
+
const half = Math.floor(max / 2);
|
|
31
|
+
let start = Math.max(1, cur - half);
|
|
32
|
+
let end = Math.min(total, start + max - 1);
|
|
33
|
+
if (end - start < max - 1)
|
|
34
|
+
start = Math.max(1, end - max + 1);
|
|
35
|
+
const pages = [];
|
|
36
|
+
if (start > 1) {
|
|
37
|
+
pages.push(1);
|
|
38
|
+
if (start > 2)
|
|
39
|
+
pages.push('...');
|
|
40
|
+
}
|
|
41
|
+
for (let i = start; i <= end; i++)
|
|
42
|
+
pages.push(i);
|
|
43
|
+
if (end < total) {
|
|
44
|
+
if (end < total - 1)
|
|
45
|
+
pages.push('...');
|
|
46
|
+
pages.push(total);
|
|
47
|
+
}
|
|
48
|
+
return pages;
|
|
49
|
+
}
|
|
50
|
+
goTo(p) {
|
|
51
|
+
if (this.disabled || p < 1 || p > this.totalPages || p === this.currentPage)
|
|
52
|
+
return;
|
|
53
|
+
this.currentPage = p;
|
|
54
|
+
this.pageChange.emit(this.currentPage);
|
|
55
|
+
}
|
|
56
|
+
render() {
|
|
57
|
+
const pages = this.pageNumbers;
|
|
58
|
+
const isFirst = this.currentPage <= 1;
|
|
59
|
+
const isLast = this.currentPage >= this.totalPages;
|
|
60
|
+
return (h("div", { key: 'b601f88e4f971f885835d81fe876303fe97027c7', class: "paginator" }, h("div", { key: '988ffb7ed122d4a666af4525bc85159d8d36538a', class: "paginator-pages" }, !isFirst && !this.noLabels && (h("button", { key: '920a1a407782bde436fb6560caeb39848e9c7e28', class: { 'paginator-btn': true, 'paginator-btn--arrow': true }, onClick: () => this.goTo(1), "aria-label": "Primera p\u00E1gina", disabled: this.disabled }, h("dropi-icon", { key: '249d4f2fc0a7ba2d790e3cf1c7a36a8d853a8cfe', name: "Arrow-double-small-left", iconWidth: "16px", iconHeight: "16px", color: "Gray-Gray-600" }))), !isFirst && (h("button", { key: '7b3cbe1cbd33db77fe540b5e179ed759e2d515e9', class: { 'paginator-btn': true, 'paginator-btn--arrow': true }, onClick: () => this.goTo(this.currentPage - 1), "aria-label": "Anterior", disabled: this.disabled }, h("dropi-icon", { key: '4f162e4df1573f5b6df40477099c3dc50347b738', name: "Dropdown-left", iconWidth: "16px", iconHeight: "16px", color: "Gray-Gray-600" }), !this.noLabels && h("span", { key: 'a569b225a577e3dfb41466247be33846254ba1f6', class: "paginator-label" }, "Anterior"))), pages.map((p, i) => p === '...'
|
|
61
|
+
? h("span", { class: "paginator-ellipsis", key: `e${i}` }, "\u2026")
|
|
62
|
+
: h("button", { key: p, class: { 'paginator-btn': true, 'paginator-btn--active': p === this.currentPage }, onClick: () => this.goTo(p), "aria-current": p === this.currentPage ? 'page' : undefined, disabled: this.disabled }, p)), !isLast && (h("button", { key: 'ad51ec2f21741cf89e0e692cca2057c8cacea9f3', class: { 'paginator-btn': true, 'paginator-btn--arrow': true }, onClick: () => this.goTo(this.currentPage + 1), "aria-label": "Siguiente", disabled: this.disabled }, !this.noLabels && h("span", { key: '3eb463a7749ef9f419613c07975a87073df29ecf', class: "paginator-label" }, "Siguiente"), h("dropi-icon", { key: 'a6ece1855840a3ada48de22151bab4a43fd1972e', name: "Dropdown-Right", iconWidth: "16px", iconHeight: "16px", color: "Gray-Gray-600" }))), !isLast && !this.noLabels && (h("button", { key: '4ac9168aba1221ad17a08f7463cc2f065ea1ce6f', class: { 'paginator-btn': true, 'paginator-btn--arrow': true }, onClick: () => this.goTo(this.totalPages), "aria-label": "\u00DAltima p\u00E1gina", disabled: this.disabled }, h("dropi-icon", { key: '9e3618334ec1d476ea59ea00a600499f47a45a9a', name: "Arrow-double-small-right", iconWidth: "16px", iconHeight: "16px", color: "Gray-Gray-600" }))))));
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
DropiPaginator.style = dropiPaginatorCss();
|
|
66
|
+
|
|
67
|
+
export { DropiPaginator as dropi_paginator };
|
|
68
|
+
//# sourceMappingURL=dropi-paginator.entry.esm.js.map
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=dropi-paginator.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"dropi-paginator.entry.js","mappings":";;AAAA,MAAM,iBAAiB,GAAG,MAAM,CAAC,wtDAAwtD,CAAC;;MCW7uD,cAAc,GAAA,MAAA;;;;;;IAEjB,UAAU,GAAW,CAAC;;IAEU,WAAW,GAAW,CAAC;;IAEvD,QAAQ,GAAY,KAAK;;IAEzB,eAAe,GAAW,CAAC;;IAE3B,eAAe,GAAY,KAAK;;IAEhC,QAAQ,GAAY,KAAK;;AAGxB,IAAA,UAAU;AAEnB,IAAA,IAAY,WAAW,GAAA;AACrB,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU;AAC7B,QAAA,MAAM,GAAG,GAAG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CAAC,WAAW,GAAG,CAAC,CAAC,gBACnC,WAAW,EACtB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAA,EAEtB,CAAC,IAAI,CAAC,QAAQ,IAAI,6DAAM,KAAK,EAAC,iBAAiB,EAAA,EAAA,WAAA,CAAiB,EACjE,CAAA,CAAA,YAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAY,IAAI,EAAC,gBAAgB,EAAC,SAAS,EAAC,MAAM,EAAC,UAAU,EAAC,MAAM,EAAC,KAAK,EAAC,eAAe,EAAA,CAAG,CACtF,CACV,EAEA,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,KACxB,CAAA,CAAA,QAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACE,KAAK,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,sBAAsB,EAAE,IAAI,EAAE,EAC9D,OAAO,EAAE,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,gBAC9B,yBAAe,EAC1B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAA,EAEvB,CAAA,CAAA,YAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAY,IAAI,EAAC,0BAA0B,EAAC,SAAS,EAAC,MAAM,EAAC,UAAU,EAAC,MAAM,EAAC,KAAK,EAAC,eAAe,EAAA,CAAG,CAChG,CACV,CACG,CACF;;;;;;;","names":[],"sources":["src/components/dropi-paginator/dropi-paginator.css?tag=dropi-paginator&encapsulation=shadow","src/components/dropi-paginator/dropi-paginator.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n*, *::before, *::after { box-sizing: border-box; }\n\n.paginator {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: var(--Size-4, 16px);\n flex-wrap: wrap;\n}\n\n.paginator-pages {\n display: flex;\n align-items: center;\n gap: var(--Size-1, 4px);\n}\n\n.paginator-btn {\n width: 32px;\n height: 32px;\n padding: 0;\n border: none;\n border-radius: 50%;\n background: transparent;\n color: var(--Gray-Gray-600, #475066);\n font-size: var(--font-size-s, 12px);\n font-family: inherit;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: background 0.15s ease;\n}\n\n.paginator-btn:hover:not(:disabled) {\n background: var(--Gray-Gray-50, #f7f8fa);\n}\n\n.paginator-btn:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n.paginator-btn--active {\n background: var(--Primary-Primary-500, #f49a3d);\n color: var(--Neutral-White, #ffffff);\n font-weight: var(--font-weight-bold, 700);\n}\n\n.paginator-btn--active:hover {\n background: var(--Primary-Primary-500, #f49a3d);\n}\n\n.paginator-btn--arrow {\n width: auto;\n padding: 0 var(--Size-2, 8px);\n border-radius: var(--Border-1, 4px);\n gap: 4px;\n}\n\n.paginator-btn--arrow:hover:not(:disabled) {\n background: var(--Gray-Gray-50, #f7f8fa);\n}\n\n.paginator-label {\n font-size: var(--font-size-s, 12px);\n color: inherit;\n}\n\n.paginator-ellipsis {\n color: var(--Gray-Gray-400, #858ea6);\n padding: 0 4px;\n font-size: var(--font-size-s, 12px);\n display: flex;\n align-items: center;\n}\n\n.paginator-size {\n display: flex;\n align-items: center;\n gap: var(--Size-2, 8px);\n}\n\n.paginator-size-label {\n font-size: var(--font-size-s, 12px);\n color: var(--Gray-Gray-500, #69738c);\n}\n\n.paginator-size-select {\n height: 32px;\n padding: 0 var(--Size-2, 8px);\n border: 1px solid var(--Gray-Gray-200, #c3c9d9);\n border-radius: var(--Border-1, 4px);\n background: var(--Neutral-White, #ffffff);\n color: var(--Gray-Gray-600, #475066);\n font-size: var(--font-size-s, 12px);\n font-family: inherit;\n cursor: pointer;\n outline: none;\n}\n","import { Component, Prop, Event, EventEmitter, h } from '@stencil/core';\n\n/**\n * @component dropi-paginator\n * Pagination control with page numbers, prev/next buttons and items-per-page selector.\n */\n@Component({\n tag: 'dropi-paginator',\n styleUrl: 'dropi-paginator.css',\n shadow: true,\n})\nexport class DropiPaginator {\n /** Total number of pages */\n @Prop() totalPages: number = 1;\n /** Current page (1-based) */\n @Prop({ mutable: true, reflect: true }) currentPage: number = 1;\n /** Disabled state */\n @Prop() disabled: boolean = false;\n /** Max page buttons to show at once */\n @Prop() maxVisiblePages: number = 8;\n /** Hide total page count (show only arrows) */\n @Prop() isNotTotalPages: boolean = false;\n /** Hide \"Anterior\"/\"Siguiente\" text labels, show only arrows */\n @Prop() noLabels: boolean = false;\n\n /** Emitted when page changes. e.detail = new page number */\n @Event() pageChange: EventEmitter<number>;\n\n private get pageNumbers(): (number | '...')[] {\n const total = this.totalPages;\n const cur = this.currentPage;\n const max = this.maxVisiblePages;\n\n if (total <= max) return Array.from({ length: total }, (_, i) => i + 1);\n\n const half = Math.floor(max / 2);\n let start = Math.max(1, cur - half);\n let end = Math.min(total, start + max - 1);\n if (end - start < max - 1) start = Math.max(1, end - max + 1);\n\n const pages: (number | '...')[] = [];\n if (start > 1) { pages.push(1); if (start > 2) pages.push('...'); }\n for (let i = start; i <= end; i++) pages.push(i);\n if (end < total) { if (end < total - 1) pages.push('...'); pages.push(total); }\n return pages;\n }\n\n private goTo(p: number) {\n if (this.disabled || p < 1 || p > this.totalPages || p === this.currentPage) return;\n this.currentPage = p;\n this.pageChange.emit(this.currentPage);\n }\n\n render() {\n const pages = this.pageNumbers;\n const isFirst = this.currentPage <= 1;\n const isLast = this.currentPage >= this.totalPages;\n\n return (\n <div class=\"paginator\">\n <div class=\"paginator-pages\">\n {!isFirst && !this.noLabels && (\n <button\n class={{ 'paginator-btn': true, 'paginator-btn--arrow': true }}\n onClick={() => this.goTo(1)}\n aria-label=\"Primera página\"\n disabled={this.disabled}\n >\n <dropi-icon name=\"Arrow-double-small-left\" iconWidth=\"16px\" iconHeight=\"16px\" color=\"Gray-Gray-600\" />\n </button>\n )}\n\n {!isFirst && (\n <button\n class={{ 'paginator-btn': true, 'paginator-btn--arrow': true }}\n onClick={() => this.goTo(this.currentPage - 1)}\n aria-label=\"Anterior\"\n disabled={this.disabled}\n >\n <dropi-icon name=\"Dropdown-left\" iconWidth=\"16px\" iconHeight=\"16px\" color=\"Gray-Gray-600\" />\n {!this.noLabels && <span class=\"paginator-label\">Anterior</span>}\n </button>\n )}\n\n {pages.map((p, i) =>\n p === '...'\n ? <span class=\"paginator-ellipsis\" key={`e${i}`}>…</span>\n : <button\n key={p}\n class={{ 'paginator-btn': true, 'paginator-btn--active': p === this.currentPage }}\n onClick={() => this.goTo(p as number)}\n aria-current={p === this.currentPage ? 'page' : undefined}\n disabled={this.disabled}\n >\n {p}\n </button>\n )}\n\n {!isLast && (\n <button\n class={{ 'paginator-btn': true, 'paginator-btn--arrow': true }}\n onClick={() => this.goTo(this.currentPage + 1)}\n aria-label=\"Siguiente\"\n disabled={this.disabled}\n >\n {!this.noLabels && <span class=\"paginator-label\">Siguiente</span>}\n <dropi-icon name=\"Dropdown-Right\" iconWidth=\"16px\" iconHeight=\"16px\" color=\"Gray-Gray-600\" />\n </button>\n )}\n\n {!isLast && !this.noLabels && (\n <button\n class={{ 'paginator-btn': true, 'paginator-btn--arrow': true }}\n onClick={() => this.goTo(this.totalPages)}\n aria-label=\"Última página\"\n disabled={this.disabled}\n >\n <dropi-icon name=\"Arrow-double-small-right\" iconWidth=\"16px\" iconHeight=\"16px\" color=\"Gray-Gray-600\" />\n </button>\n )}\n </div>\n </div>\n );\n }\n}\n"],"version":3}
|