@dropi/ui 0.1.27 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/dropi-accordion-item.cjs.entry.js +54 -0
- package/dist/cjs/dropi-accordion.cjs.entry.js +19 -0
- package/dist/cjs/dropi-alert-legacy.cjs.entry.js +39 -0
- package/dist/cjs/dropi-alert-modal.cjs.entry.js +128 -0
- package/dist/cjs/dropi-alert.cjs.entry.js +64 -0
- package/dist/cjs/dropi-avatars.cjs.entry.js +31 -0
- package/dist/cjs/dropi-badge-legacy.cjs.entry.js +30 -0
- package/dist/cjs/dropi-badge.cjs.entry.js +37 -0
- package/dist/cjs/dropi-banner-external.cjs.entry.js +63 -0
- package/dist/cjs/dropi-breadcrumb.cjs.entry.js +48 -0
- package/dist/cjs/dropi-button.cjs.entry.js +87 -0
- package/dist/cjs/dropi-card-checkbox.cjs.entry.js +48 -0
- package/dist/cjs/dropi-card-product.cjs.entry.js +78 -0
- package/dist/cjs/dropi-card-section.cjs.entry.js +38 -0
- package/dist/cjs/dropi-carousel.cjs.entry.js +153 -0
- package/dist/cjs/dropi-checkbox-selection-list.cjs.entry.js +73 -0
- package/dist/cjs/dropi-checkbox.cjs.entry.js +36 -0
- package/dist/cjs/dropi-chips.cjs.entry.js +30 -0
- package/dist/cjs/dropi-city-selector.cjs.entry.js +104 -0
- package/dist/cjs/dropi-color-picker.cjs.entry.js +319 -0
- package/dist/cjs/dropi-country-flags.cjs.entry.js +37 -0
- package/dist/cjs/dropi-country-selector.cjs.entry.js +197 -0
- package/dist/cjs/dropi-date-picker-range.cjs.entry.js +115 -0
- package/dist/cjs/dropi-date-picker.cjs.entry.js +223 -0
- package/dist/cjs/dropi-drawer.cjs.entry.js +79 -0
- package/dist/cjs/dropi-dropdown.cjs.entry.js +65 -0
- package/dist/cjs/dropi-empty-state.cjs.entry.js +36 -0
- package/dist/cjs/dropi-favorite-button.cjs.entry.js +27 -0
- package/dist/cjs/dropi-file-upload-progress-bar.cjs.entry.js +77 -0
- package/dist/cjs/dropi-file-upload.cjs.entry.js +237 -0
- package/dist/cjs/dropi-icon.cjs.entry.js +67 -0
- package/dist/cjs/dropi-ilustration-icon.cjs.entry.js +39 -0
- package/dist/cjs/dropi-image-miniature.cjs.entry.js +44 -0
- package/dist/cjs/dropi-image-overlay.cjs.entry.js +63 -0
- package/dist/cjs/dropi-input_3.cjs.entry.js +392 -0
- package/dist/cjs/dropi-languages-selector.cjs.entry.js +61 -0
- package/dist/cjs/dropi-logo.cjs.entry.js +37 -0
- package/dist/cjs/dropi-lottie-loader.cjs.entry.js +27 -0
- package/dist/cjs/dropi-media-player.cjs.entry.js +192 -0
- package/dist/cjs/dropi-modal.cjs.entry.js +142 -0
- package/dist/cjs/dropi-navbar.cjs.entry.js +54 -0
- package/dist/cjs/dropi-otp-send-code.cjs.entry.js +92 -0
- package/dist/cjs/dropi-phone-input.cjs.entry.js +197 -0
- package/dist/cjs/dropi-radio-button.cjs.entry.js +47 -0
- package/dist/cjs/dropi-radio-selection-list.cjs.entry.js +60 -0
- package/dist/cjs/dropi-read-more.cjs.entry.js +40 -0
- package/dist/cjs/dropi-search.cjs.entry.js +124 -0
- package/dist/cjs/dropi-select.cjs.entry.js +382 -0
- package/dist/cjs/dropi-sidebar.cjs.entry.js +78 -0
- package/dist/cjs/dropi-simple-stepper.cjs.entry.js +53 -0
- package/dist/cjs/dropi-skeleton.cjs.entry.js +57 -0
- package/dist/cjs/dropi-steps.cjs.entry.js +52 -0
- package/dist/cjs/dropi-switch.cjs.entry.js +30 -0
- package/dist/cjs/dropi-table.cjs.entry.js +299 -0
- package/dist/cjs/dropi-tabs.cjs.entry.js +51 -0
- package/dist/cjs/dropi-tag-type-product.cjs.entry.js +19 -0
- package/dist/cjs/dropi-text-area.cjs.entry.js +134 -0
- package/dist/cjs/dropi-time-line.cjs.entry.js +34 -0
- package/dist/cjs/dropi-toast.cjs.entry.js +56 -0
- package/dist/cjs/dropi-tooltip-v2.cjs.entry.js +131 -0
- package/dist/cjs/dropi-tooltip.cjs.entry.js +21 -0
- package/dist/cjs/dropi-ui.cjs.js +24 -0
- package/dist/cjs/dropi-vertical-steps.cjs.entry.js +55 -0
- package/dist/cjs/dropi-youtube-lazy-video.cjs.entry.js +33 -0
- package/dist/cjs/index-C8kwDvpf.js +2773 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +12 -0
- package/dist/collection/assets/icons/symbol/svg/sprite.css.svg +1 -0
- package/dist/collection/collection-manifest.json +77 -0
- package/dist/collection/components/dropi-accordion/dropi-accordion-item.css +45 -0
- package/dist/collection/components/dropi-accordion/dropi-accordion-item.js +172 -0
- package/dist/collection/components/dropi-accordion/dropi-accordion.css +21 -0
- package/dist/collection/components/dropi-accordion/dropi-accordion.js +48 -0
- package/dist/collection/components/dropi-alert/dropi-alert.css +128 -0
- package/dist/collection/components/dropi-alert/dropi-alert.js +371 -0
- package/dist/collection/components/dropi-alert-legacy/dropi-alert-legacy.css +31 -0
- package/dist/collection/components/dropi-alert-legacy/dropi-alert-legacy.js +128 -0
- package/dist/collection/components/dropi-alert-modal/dropi-alert-modal.css +105 -0
- package/dist/collection/components/dropi-alert-modal/dropi-alert-modal.js +525 -0
- package/dist/collection/components/dropi-avatars/dropi-avatars.css +55 -0
- package/dist/collection/components/dropi-avatars/dropi-avatars.js +126 -0
- package/dist/collection/components/dropi-badge/dropi-badge.css +41 -0
- package/dist/collection/components/dropi-badge/dropi-badge.js +71 -0
- package/dist/collection/components/dropi-badge-legacy/dropi-badge-legacy.css +17 -0
- package/dist/collection/components/dropi-badge-legacy/dropi-badge-legacy.js +119 -0
- package/dist/collection/components/dropi-banner-external/dropi-banner-external.css +56 -0
- package/dist/collection/components/dropi-banner-external/dropi-banner-external.js +254 -0
- package/dist/collection/components/dropi-breadcrumb/dropi-breadcrumb.css +69 -0
- package/dist/collection/components/dropi-breadcrumb/dropi-breadcrumb.js +171 -0
- package/dist/collection/components/dropi-button/dropi-button.css +177 -0
- package/dist/collection/components/dropi-button/dropi-button.js +323 -0
- package/dist/collection/components/dropi-card-checkbox/dropi-card-checkbox.css +92 -0
- package/dist/collection/components/dropi-card-checkbox/dropi-card-checkbox.js +222 -0
- package/dist/collection/components/dropi-card-product/dropi-card-product.css +235 -0
- package/dist/collection/components/dropi-card-product/dropi-card-product.js +386 -0
- package/dist/collection/components/dropi-card-section/dropi-card-section.css +42 -0
- package/dist/collection/components/dropi-card-section/dropi-card-section.js +178 -0
- package/dist/collection/components/dropi-carousel/dropi-carousel.css +148 -0
- package/dist/collection/components/dropi-carousel/dropi-carousel.js +379 -0
- package/dist/collection/components/dropi-checkbox/dropi-checkbox.css +47 -0
- package/dist/collection/components/dropi-checkbox/dropi-checkbox.js +103 -0
- package/dist/collection/components/dropi-checkbox-selection-list/dropi-checkbox-selection-list.css +44 -0
- package/dist/collection/components/dropi-checkbox-selection-list/dropi-checkbox-selection-list.js +267 -0
- package/dist/collection/components/dropi-chips/dropi-chips.css +68 -0
- package/dist/collection/components/dropi-chips/dropi-chips.js +169 -0
- package/dist/collection/components/dropi-city-selector/dropi-city-selector.css +218 -0
- package/dist/collection/components/dropi-city-selector/dropi-city-selector.js +242 -0
- package/dist/collection/components/dropi-color-picker/dropi-color-picker.css +210 -0
- package/dist/collection/components/dropi-color-picker/dropi-color-picker.js +393 -0
- package/dist/collection/components/dropi-country-flags/dropi-country-flags.css +30 -0
- package/dist/collection/components/dropi-country-flags/dropi-country-flags.js +129 -0
- package/dist/collection/components/dropi-country-selector/dropi-country-selector.css +211 -0
- package/dist/collection/components/dropi-country-selector/dropi-country-selector.js +429 -0
- package/dist/collection/components/dropi-date-picker/dropi-date-picker.css +215 -0
- package/dist/collection/components/dropi-date-picker/dropi-date-picker.js +516 -0
- package/dist/collection/components/dropi-date-picker-range/dropi-date-picker-range.css +143 -0
- package/dist/collection/components/dropi-date-picker-range/dropi-date-picker-range.js +327 -0
- package/dist/collection/components/dropi-drawer/dropi-drawer.css +129 -0
- package/dist/collection/components/dropi-drawer/dropi-drawer.js +287 -0
- package/dist/collection/components/dropi-dropdown/dropi-dropdown.css +51 -0
- package/dist/collection/components/dropi-dropdown/dropi-dropdown.js +209 -0
- package/dist/collection/components/dropi-empty-state/dropi-empty-state.css +59 -0
- package/dist/collection/components/dropi-empty-state/dropi-empty-state.js +222 -0
- package/dist/collection/components/dropi-favorite-button/dropi-favorite-button.css +24 -0
- package/dist/collection/components/dropi-favorite-button/dropi-favorite-button.js +78 -0
- package/dist/collection/components/dropi-file-upload/dropi-file-upload.css +464 -0
- package/dist/collection/components/dropi-file-upload/dropi-file-upload.js +517 -0
- package/dist/collection/components/dropi-file-upload-progress-bar/dropi-file-upload-progress-bar.css +115 -0
- package/dist/collection/components/dropi-file-upload-progress-bar/dropi-file-upload-progress-bar.js +258 -0
- package/dist/collection/components/dropi-icon/dropi-icon.css +26 -0
- package/dist/collection/components/dropi-icon/dropi-icon.js +159 -0
- package/dist/collection/components/dropi-ilustration-icon/dropi-ilustration-icon.css +91 -0
- package/dist/collection/components/dropi-ilustration-icon/dropi-ilustration-icon.js +150 -0
- package/dist/collection/components/dropi-image-miniature/dropi-image-miniature.css +45 -0
- package/dist/collection/components/dropi-image-miniature/dropi-image-miniature.js +150 -0
- package/dist/collection/components/dropi-image-overlay/dropi-image-overlay.css +127 -0
- package/dist/collection/components/dropi-image-overlay/dropi-image-overlay.js +156 -0
- package/dist/collection/components/dropi-input/dropi-input.css +185 -0
- package/dist/collection/components/dropi-input/dropi-input.js +808 -0
- package/dist/collection/components/dropi-languages-selector/dropi-languages-selector.css +79 -0
- package/dist/collection/components/dropi-languages-selector/dropi-languages-selector.js +158 -0
- package/dist/collection/components/dropi-logo/dropi-logo.css +26 -0
- package/dist/collection/components/dropi-logo/dropi-logo.js +107 -0
- package/dist/collection/components/dropi-lottie-loader/dropi-lottie-loader.css +56 -0
- package/dist/collection/components/dropi-lottie-loader/dropi-lottie-loader.js +116 -0
- package/dist/collection/components/dropi-media-player/dropi-media-player.css +320 -0
- package/dist/collection/components/dropi-media-player/dropi-media-player.js +394 -0
- package/dist/collection/components/dropi-modal/dropi-modal.css +140 -0
- package/dist/collection/components/dropi-modal/dropi-modal.js +695 -0
- package/dist/collection/components/dropi-navbar/dropi-navbar.css +166 -0
- package/dist/collection/components/dropi-navbar/dropi-navbar.js +302 -0
- package/dist/collection/components/dropi-otp-send-code/dropi-otp-send-code.css +67 -0
- package/dist/collection/components/dropi-otp-send-code/dropi-otp-send-code.js +221 -0
- package/dist/collection/components/dropi-paginator/dropi-paginator.css +103 -0
- package/dist/collection/components/dropi-paginator/dropi-paginator.js +215 -0
- package/dist/collection/components/dropi-phone-input/dropi-phone-input.css +209 -0
- package/dist/collection/components/dropi-phone-input/dropi-phone-input.js +442 -0
- package/dist/collection/components/dropi-radio-button/dropi-radio-button.css +62 -0
- package/dist/collection/components/dropi-radio-button/dropi-radio-button.js +174 -0
- package/dist/collection/components/dropi-radio-selection-list/dropi-radio-selection-list.css +64 -0
- package/dist/collection/components/dropi-radio-selection-list/dropi-radio-selection-list.js +259 -0
- package/dist/collection/components/dropi-read-more/dropi-read-more.css +25 -0
- package/dist/collection/components/dropi-read-more/dropi-read-more.js +154 -0
- package/dist/collection/components/dropi-search/dropi-search.css +112 -0
- package/dist/collection/components/dropi-search/dropi-search.js +526 -0
- package/dist/collection/components/dropi-select/dropi-select.css +366 -0
- package/dist/collection/components/dropi-select/dropi-select.js +1018 -0
- package/dist/collection/components/dropi-select/select.types.js +1 -0
- package/dist/collection/components/dropi-sidebar/dropi-sidebar.css +76 -0
- package/dist/collection/components/dropi-sidebar/dropi-sidebar.js +143 -0
- package/dist/collection/components/dropi-simple-stepper/dropi-simple-stepper.css +94 -0
- package/dist/collection/components/dropi-simple-stepper/dropi-simple-stepper.js +194 -0
- package/dist/collection/components/dropi-skeleton/dropi-skeleton.css +27 -0
- package/dist/collection/components/dropi-skeleton/dropi-skeleton.js +192 -0
- package/dist/collection/components/dropi-steps/dropi-steps.css +95 -0
- package/dist/collection/components/dropi-steps/dropi-steps.js +173 -0
- package/dist/collection/components/dropi-switch/dropi-switch.css +57 -0
- package/dist/collection/components/dropi-switch/dropi-switch.js +96 -0
- package/dist/collection/components/dropi-table/dropi-table.css +540 -0
- package/dist/collection/components/dropi-table/dropi-table.js +973 -0
- package/dist/collection/components/dropi-tabs/dropi-tabs.css +47 -0
- package/dist/collection/components/dropi-tabs/dropi-tabs.js +181 -0
- package/dist/collection/components/dropi-tag/dropi-tag.css +39 -0
- package/dist/collection/components/dropi-tag/dropi-tag.js +190 -0
- package/dist/collection/components/dropi-tag-type-product/dropi-tag-type-product.css +14 -0
- package/dist/collection/components/dropi-tag-type-product/dropi-tag-type-product.js +48 -0
- package/dist/collection/components/dropi-text-area/dropi-text-area.css +100 -0
- package/dist/collection/components/dropi-text-area/dropi-text-area.js +512 -0
- package/dist/collection/components/dropi-time-line/dropi-time-line.css +108 -0
- package/dist/collection/components/dropi-time-line/dropi-time-line.js +69 -0
- package/dist/collection/components/dropi-toast/dropi-toast.css +63 -0
- package/dist/collection/components/dropi-toast/dropi-toast.js +165 -0
- package/dist/collection/components/dropi-tooltip/dropi-tooltip.css +32 -0
- package/dist/collection/components/dropi-tooltip/dropi-tooltip.js +70 -0
- package/dist/collection/components/dropi-tooltip-v2/dropi-tooltip.css +67 -0
- package/dist/collection/components/dropi-tooltip-v2/dropi-tooltip.js +468 -0
- package/dist/collection/components/dropi-vertical-steps/dropi-vertical-steps.css +95 -0
- package/dist/collection/components/dropi-vertical-steps/dropi-vertical-steps.js +167 -0
- package/dist/collection/components/dropi-youtube-lazy-video/dropi-youtube-lazy-video.css +73 -0
- package/dist/collection/components/dropi-youtube-lazy-video/dropi-youtube-lazy-video.js +110 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/utils.js +3 -0
- package/dist/collection/utils/utils.unit.test.js +16 -0
- package/dist/components/dropi-accordion-item.js +1 -0
- package/dist/components/dropi-accordion.js +1 -0
- package/dist/components/dropi-alert-legacy.js +1 -0
- package/dist/components/dropi-alert-modal.js +1 -0
- package/dist/components/dropi-alert.js +1 -0
- package/dist/components/dropi-avatars.js +1 -0
- package/dist/components/dropi-badge-legacy.js +1 -0
- package/dist/components/dropi-badge.js +1 -0
- package/dist/components/dropi-banner-external.js +1 -0
- package/dist/components/dropi-breadcrumb.js +1 -0
- package/dist/components/dropi-button.js +1 -0
- package/dist/components/dropi-card-checkbox.js +1 -0
- package/dist/components/dropi-card-product.js +1 -0
- package/dist/components/dropi-card-section.js +1 -0
- package/dist/components/dropi-carousel.js +1 -0
- package/dist/components/dropi-checkbox-selection-list.js +1 -0
- package/dist/components/dropi-checkbox.js +1 -0
- package/dist/components/dropi-chips.js +1 -0
- package/dist/components/dropi-city-selector.js +1 -0
- package/dist/components/dropi-color-picker.js +1 -0
- package/dist/components/dropi-country-flags.js +1 -0
- package/dist/components/dropi-country-selector.js +1 -0
- package/dist/components/dropi-date-picker-range.js +1 -0
- package/dist/components/dropi-date-picker.js +1 -0
- package/dist/components/dropi-drawer.js +1 -0
- package/dist/components/dropi-dropdown.js +1 -0
- package/dist/components/dropi-empty-state.js +1 -0
- package/dist/components/dropi-favorite-button.js +1 -0
- package/dist/components/dropi-file-upload-progress-bar.js +1 -0
- package/dist/components/dropi-file-upload.js +1 -0
- package/dist/components/dropi-icon.js +1 -0
- package/dist/components/dropi-ilustration-icon.js +1 -0
- package/dist/components/dropi-image-miniature.js +1 -0
- package/dist/components/dropi-image-overlay.js +1 -0
- package/dist/components/dropi-input.js +1 -0
- package/dist/components/dropi-languages-selector.js +1 -0
- package/dist/components/dropi-logo.js +1 -0
- package/dist/components/dropi-lottie-loader.js +1 -0
- package/dist/components/dropi-media-player.js +1 -0
- package/dist/components/dropi-modal.js +1 -0
- package/dist/components/dropi-navbar.js +1 -0
- package/dist/components/dropi-otp-send-code.js +1 -0
- package/dist/components/dropi-paginator.js +1 -0
- package/dist/components/dropi-phone-input.js +1 -0
- package/dist/components/dropi-radio-button.js +1 -0
- package/dist/components/dropi-radio-selection-list.js +1 -0
- package/dist/components/dropi-read-more.js +1 -0
- package/dist/components/dropi-search.js +1 -0
- package/dist/components/dropi-select.js +1 -0
- package/dist/components/dropi-sidebar.js +1 -0
- package/dist/components/dropi-simple-stepper.js +1 -0
- package/dist/components/dropi-skeleton.js +1 -0
- package/dist/components/dropi-steps.js +1 -0
- package/dist/components/dropi-switch.js +1 -0
- package/dist/components/dropi-table.js +1 -0
- package/dist/components/dropi-tabs.js +1 -0
- package/dist/components/dropi-tag-type-product.js +1 -0
- package/dist/components/dropi-tag.js +1 -0
- package/dist/components/dropi-text-area.js +1 -0
- package/dist/components/dropi-time-line.js +1 -0
- package/dist/components/dropi-toast.js +1 -0
- package/dist/components/dropi-tooltip-v2.js +1 -0
- package/dist/components/dropi-tooltip.js +1 -0
- package/dist/components/dropi-vertical-steps.js +1 -0
- package/dist/components/dropi-youtube-lazy-video.js +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/p-B9R8Apw7.js +1 -0
- package/dist/components/p-B_Ace02i.js +1 -0
- package/dist/components/p-BrjO_JXp.js +1 -0
- package/dist/components/p-BwhxWL4p.js +1 -0
- package/dist/components/p-Bz2jXX3R.js +1 -0
- package/dist/components/p-CV_oz45O.js +1 -0
- package/dist/components/p-D-vQQQNz.js +1 -0
- package/dist/components/p-D13d88W3.js +1 -0
- package/dist/components/p-DGUfr98Z.js +1 -0
- package/dist/components/p-QOZr7tU8.js +1 -0
- package/dist/components/p-a-hGQrJd.js +1 -0
- package/dist/components/p-o5gyrbbD.js +1 -0
- package/dist/dropi-ui/dropi-ui.css +1 -311
- package/dist/dropi-ui/dropi-ui.esm.js +1 -50
- package/dist/dropi-ui/index.esm.js +0 -4
- package/dist/dropi-ui/p-00e5a2de.entry.js +1 -0
- package/dist/dropi-ui/p-0188e07a.entry.js +1 -0
- package/dist/dropi-ui/p-02710049.entry.js +1 -0
- package/dist/dropi-ui/p-17c56074.entry.js +1 -0
- package/dist/dropi-ui/p-18adf694.entry.js +1 -0
- package/dist/dropi-ui/p-1a3619c3.entry.js +1 -0
- package/dist/dropi-ui/p-1d3d6a32.entry.js +1 -0
- package/dist/dropi-ui/p-25640777.entry.js +1 -0
- package/dist/dropi-ui/p-2674d901.entry.js +1 -0
- package/dist/dropi-ui/p-2af538b9.entry.js +1 -0
- package/dist/dropi-ui/p-3013f3b8.entry.js +1 -0
- package/dist/dropi-ui/p-3321ca70.entry.js +1 -0
- package/dist/dropi-ui/p-33d242ec.entry.js +1 -0
- package/dist/dropi-ui/p-34b66ca2.entry.js +1 -0
- package/dist/dropi-ui/p-39af6478.entry.js +1 -0
- package/dist/dropi-ui/p-3e36c8b8.entry.js +1 -0
- package/dist/dropi-ui/p-3ebc9b7b.entry.js +1 -0
- package/dist/dropi-ui/p-446a481d.entry.js +1 -0
- package/dist/dropi-ui/p-50e0d44f.entry.js +1 -0
- package/dist/dropi-ui/p-53a7a37d.entry.js +1 -0
- package/dist/dropi-ui/p-5c0bd7c2.entry.js +1 -0
- package/dist/dropi-ui/p-5cee6721.entry.js +1 -0
- package/dist/dropi-ui/p-5fb33ae4.entry.js +1 -0
- package/dist/dropi-ui/p-665ef7ba.entry.js +1 -0
- package/dist/dropi-ui/p-66b80371.entry.js +1 -0
- package/dist/dropi-ui/p-7bfc1c27.entry.js +1 -0
- package/dist/dropi-ui/p-7c0d2edf.entry.js +1 -0
- package/dist/dropi-ui/p-7eb27836.entry.js +1 -0
- package/dist/dropi-ui/p-85444414.entry.js +1 -0
- package/dist/dropi-ui/p-86283e99.entry.js +1 -0
- package/dist/dropi-ui/p-8bf5d8ee.entry.js +1 -0
- package/dist/dropi-ui/p-9032ba00.entry.js +1 -0
- package/dist/dropi-ui/p-9212f544.entry.js +1 -0
- package/dist/dropi-ui/p-92291873.entry.js +1 -0
- package/dist/dropi-ui/p-955e52f8.entry.js +1 -0
- package/dist/dropi-ui/p-976a15e3.entry.js +1 -0
- package/dist/dropi-ui/p-9b037086.entry.js +1 -0
- package/dist/dropi-ui/p-9e0129cc.entry.js +1 -0
- package/dist/dropi-ui/p-9ffec3f7.entry.js +1 -0
- package/dist/dropi-ui/p-D5SAM1O2.js +2 -0
- package/dist/dropi-ui/p-a1c93e55.entry.js +1 -0
- package/dist/dropi-ui/p-a232c6a7.entry.js +1 -0
- package/dist/dropi-ui/p-a3c4d677.entry.js +1 -0
- package/dist/dropi-ui/p-a457e8ca.entry.js +1 -0
- package/dist/dropi-ui/p-a4e1df5e.entry.js +1 -0
- package/dist/dropi-ui/p-a822a23e.entry.js +1 -0
- package/dist/dropi-ui/p-a8f24270.entry.js +1 -0
- package/dist/dropi-ui/p-ae35d538.entry.js +1 -0
- package/dist/dropi-ui/p-af8e2157.entry.js +1 -0
- package/dist/dropi-ui/p-b2623a5c.entry.js +1 -0
- package/dist/dropi-ui/p-b3d3c72e.entry.js +1 -0
- package/dist/dropi-ui/p-c3614c4a.entry.js +1 -0
- package/dist/dropi-ui/p-cbf5367e.entry.js +1 -0
- package/dist/dropi-ui/p-cc527d91.entry.js +1 -0
- package/dist/dropi-ui/p-cdde481b.entry.js +1 -0
- package/dist/dropi-ui/p-d42d4ef7.entry.js +1 -0
- package/dist/dropi-ui/p-db38bf16.entry.js +1 -0
- package/dist/dropi-ui/p-dd5d8b1b.entry.js +1 -0
- package/dist/dropi-ui/p-e3ad21f8.entry.js +1 -0
- package/dist/dropi-ui/p-e6e766ed.entry.js +1 -0
- package/dist/dropi-ui/p-ec263862.entry.js +1 -0
- package/dist/dropi-ui/p-efc2fc35.entry.js +1 -0
- package/dist/dropi-ui/p-f41cd9b5.entry.js +1 -0
- package/dist/dropi-ui/p-fa3d0267.entry.js +1 -0
- package/dist/{dropi-ui → esm}/dropi-accordion-item.entry.js +2 -8
- package/dist/{dropi-ui → esm}/dropi-accordion.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-alert-legacy.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-alert-modal.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-alert.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-avatars.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-badge-legacy.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-badge.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-banner-external.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-breadcrumb.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-button.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-card-checkbox.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-card-product.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-card-section.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-carousel.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-checkbox-selection-list.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-checkbox.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-chips.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-city-selector.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-color-picker.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-country-flags.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-country-selector.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-date-picker-range.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-date-picker.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-drawer.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-dropdown.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-empty-state.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-favorite-button.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-file-upload-progress-bar.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-file-upload.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-icon.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-ilustration-icon.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-image-miniature.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-image-overlay.entry.js +1 -4
- package/dist/{dropi-ui/dropi-input.entry.js → esm/dropi-input_3.entry.js} +128 -4
- package/dist/{dropi-ui → esm}/dropi-languages-selector.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-logo.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-lottie-loader.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-media-player.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-modal.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-navbar.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-otp-send-code.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-phone-input.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-radio-button.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-radio-selection-list.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-read-more.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-search.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-select.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-sidebar.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-simple-stepper.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-skeleton.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-steps.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-switch.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-table.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-tabs.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-tag-type-product.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-text-area.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-time-line.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-toast.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-tooltip-v2.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-tooltip.entry.js +1 -4
- package/dist/esm/dropi-ui.js +20 -0
- package/dist/{dropi-ui → esm}/dropi-vertical-steps.entry.js +1 -4
- package/dist/{dropi-ui → esm}/dropi-youtube-lazy-video.entry.js +1 -4
- package/dist/esm/index-D5SAM1O2.js +2763 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +10 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
- package/dist/dropi-ui/dropi-accordion-item.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-accordion.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-alert-legacy.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-alert-modal.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-alert.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-avatars.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-badge-legacy.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-badge.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-banner-external.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-breadcrumb.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-button.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-card-checkbox.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-card-product.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-card-section.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-carousel.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-checkbox-selection-list.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-checkbox.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-chips.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-city-selector.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-color-picker.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-country-flags.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-country-selector.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-date-picker-range.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-date-picker.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-drawer.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-dropdown.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-empty-state.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-favorite-button.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-file-upload-progress-bar.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-file-upload.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-icon.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-ilustration-icon.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-image-miniature.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-image-overlay.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-input.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-languages-selector.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-logo.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-lottie-loader.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-media-player.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-modal.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-navbar.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-otp-send-code.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-paginator.entry.js +0 -70
- package/dist/dropi-ui/dropi-paginator.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-phone-input.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-radio-button.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-radio-selection-list.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-read-more.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-search.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-select.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-sidebar.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-simple-stepper.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-skeleton.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-steps.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-switch.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-table.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-tabs.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-tag-type-product.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-tag.entry.js +0 -69
- package/dist/dropi-ui/dropi-tag.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-text-area.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-time-line.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-toast.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-tooltip-v2.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-tooltip.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-ui.esm.js.map +0 -1
- package/dist/dropi-ui/dropi-vertical-steps.entry.js.map +0 -1
- package/dist/dropi-ui/dropi-youtube-lazy-video.entry.js.map +0 -1
- package/dist/dropi-ui/index-Cvp2LQOM.js +0 -4585
- package/dist/dropi-ui/index-Cvp2LQOM.js.map +0 -1
- package/dist/dropi-ui/index.esm.js.map +0 -1
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
export class DropiColorPicker {
|
|
3
|
+
el;
|
|
4
|
+
currentColor = '#ffffff';
|
|
5
|
+
position = 'right';
|
|
6
|
+
colorChange;
|
|
7
|
+
color = '';
|
|
8
|
+
hue = 0;
|
|
9
|
+
saturation = 0;
|
|
10
|
+
currentVal = 0;
|
|
11
|
+
opacity = 100;
|
|
12
|
+
showEdit = false;
|
|
13
|
+
isDragging = false;
|
|
14
|
+
isHueDragging = false;
|
|
15
|
+
isOpacityDragging = false;
|
|
16
|
+
colorCanvas;
|
|
17
|
+
hueCanvas;
|
|
18
|
+
opacityCanvas;
|
|
19
|
+
onValueChange(newValue) {
|
|
20
|
+
if (!this.showEdit) {
|
|
21
|
+
this.color = newValue;
|
|
22
|
+
this.syncFromHex();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
componentWillLoad() {
|
|
26
|
+
this.color = this.currentColor;
|
|
27
|
+
this.syncFromHex();
|
|
28
|
+
}
|
|
29
|
+
componentDidLoad() {
|
|
30
|
+
document.addEventListener('mousemove', this.onMouseMove.bind(this));
|
|
31
|
+
document.addEventListener('mouseup', this.onMouseUp.bind(this));
|
|
32
|
+
document.addEventListener('click', this.handleClickOutside.bind(this));
|
|
33
|
+
// Defer canvas drawing slightly to ensure elements are rendered
|
|
34
|
+
setTimeout(() => {
|
|
35
|
+
if (this.hueCanvas)
|
|
36
|
+
this.drawHueCanvas();
|
|
37
|
+
if (this.colorCanvas)
|
|
38
|
+
this.drawColorCanvas();
|
|
39
|
+
if (this.opacityCanvas)
|
|
40
|
+
this.drawOpacityCanvas();
|
|
41
|
+
}, 50);
|
|
42
|
+
}
|
|
43
|
+
disconnectedCallback() {
|
|
44
|
+
document.removeEventListener('mousemove', this.onMouseMove.bind(this));
|
|
45
|
+
document.removeEventListener('mouseup', this.onMouseUp.bind(this));
|
|
46
|
+
document.removeEventListener('click', this.handleClickOutside.bind(this));
|
|
47
|
+
}
|
|
48
|
+
onMouseMove(event) {
|
|
49
|
+
if (this.isDragging) {
|
|
50
|
+
this.updateColorFromPosition(event);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (this.isHueDragging) {
|
|
54
|
+
this.updateHueFromPosition(event);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (this.isOpacityDragging) {
|
|
58
|
+
this.updateOpacityFromPosition(event);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
onMouseUp() {
|
|
63
|
+
this.isDragging = false;
|
|
64
|
+
this.isHueDragging = false;
|
|
65
|
+
this.isOpacityDragging = false;
|
|
66
|
+
}
|
|
67
|
+
handleClickOutside(event) {
|
|
68
|
+
// Determine if the click target is outside the host element
|
|
69
|
+
const clickedInside = event.composedPath().includes(this.el);
|
|
70
|
+
if (!clickedInside && this.showEdit) {
|
|
71
|
+
this.showEdit = false;
|
|
72
|
+
this.currentColor = this.color;
|
|
73
|
+
this.colorChange.emit(this.color);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
drawColorCanvas() {
|
|
77
|
+
if (!this.colorCanvas)
|
|
78
|
+
return;
|
|
79
|
+
const ctx = this.colorCanvas.getContext('2d');
|
|
80
|
+
const width = this.colorCanvas.width;
|
|
81
|
+
const height = this.colorCanvas.height;
|
|
82
|
+
const saturationGradient = ctx.createLinearGradient(0, 0, width, 0);
|
|
83
|
+
saturationGradient.addColorStop(0, '#FFFFFF');
|
|
84
|
+
saturationGradient.addColorStop(1, `hsl(${this.hue ?? 0}, 100%, 50%)`);
|
|
85
|
+
const valueGradient = ctx.createLinearGradient(0, 0, 0, height);
|
|
86
|
+
valueGradient.addColorStop(0, 'rgba(0, 0, 0, 0)');
|
|
87
|
+
valueGradient.addColorStop(1, '#000000');
|
|
88
|
+
ctx.fillStyle = saturationGradient;
|
|
89
|
+
ctx.fillRect(0, 0, width, height);
|
|
90
|
+
ctx.fillStyle = valueGradient;
|
|
91
|
+
ctx.fillRect(0, 0, width, height);
|
|
92
|
+
}
|
|
93
|
+
drawHueCanvas() {
|
|
94
|
+
if (!this.hueCanvas)
|
|
95
|
+
return;
|
|
96
|
+
const ctx = this.hueCanvas.getContext('2d');
|
|
97
|
+
const width = this.hueCanvas.width;
|
|
98
|
+
const height = this.hueCanvas.height;
|
|
99
|
+
const hueGradient = ctx.createLinearGradient(0, 0, width, 0);
|
|
100
|
+
for (let i = 0; i <= 360; i += 60) {
|
|
101
|
+
hueGradient.addColorStop(i / 360, `hsl(${i}, 100%, 50%)`);
|
|
102
|
+
}
|
|
103
|
+
ctx.fillStyle = hueGradient;
|
|
104
|
+
ctx.fillRect(0, 0, width, height);
|
|
105
|
+
}
|
|
106
|
+
drawOpacityCanvas() {
|
|
107
|
+
if (!this.opacityCanvas)
|
|
108
|
+
return;
|
|
109
|
+
const ctx = this.opacityCanvas.getContext('2d');
|
|
110
|
+
const width = this.opacityCanvas.width;
|
|
111
|
+
const height = this.opacityCanvas.height;
|
|
112
|
+
ctx.clearRect(0, 0, width, height);
|
|
113
|
+
ctx.fillStyle = '#FFFFFF';
|
|
114
|
+
ctx.fillRect(0, 0, width, height);
|
|
115
|
+
const rgb = this.hsvToRgb(this.hue, this.saturation, this.currentVal);
|
|
116
|
+
const opacityGradient = ctx.createLinearGradient(0, 0, width, 0);
|
|
117
|
+
opacityGradient.addColorStop(0, `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, 0)`);
|
|
118
|
+
opacityGradient.addColorStop(1, `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, 1)`);
|
|
119
|
+
ctx.fillStyle = opacityGradient;
|
|
120
|
+
ctx.fillRect(0, 0, width, height);
|
|
121
|
+
}
|
|
122
|
+
updateColor() {
|
|
123
|
+
const rgb = this.hsvToRgb(this.hue, this.saturation, this.currentVal);
|
|
124
|
+
const hex = this.rgbToHex(rgb.r, rgb.g, rgb.b, this.opacity);
|
|
125
|
+
this.color = hex;
|
|
126
|
+
this.drawColorCanvas();
|
|
127
|
+
this.drawOpacityCanvas();
|
|
128
|
+
this.currentColor = hex;
|
|
129
|
+
this.colorChange.emit(this.color);
|
|
130
|
+
}
|
|
131
|
+
hsvToRgb(h, s, v) {
|
|
132
|
+
s /= 100;
|
|
133
|
+
v /= 100;
|
|
134
|
+
const c = v * s;
|
|
135
|
+
const x = c * (1 - Math.abs(((h / 60) % 2) - 1));
|
|
136
|
+
const m = v - c;
|
|
137
|
+
let r = 0, g = 0, b = 0;
|
|
138
|
+
if (h >= 0 && h < 60) {
|
|
139
|
+
r = c;
|
|
140
|
+
g = x;
|
|
141
|
+
b = 0;
|
|
142
|
+
}
|
|
143
|
+
else if (h >= 60 && h < 120) {
|
|
144
|
+
r = x;
|
|
145
|
+
g = c;
|
|
146
|
+
b = 0;
|
|
147
|
+
}
|
|
148
|
+
else if (h >= 120 && h < 180) {
|
|
149
|
+
r = 0;
|
|
150
|
+
g = c;
|
|
151
|
+
b = x;
|
|
152
|
+
}
|
|
153
|
+
else if (h >= 180 && h < 240) {
|
|
154
|
+
r = 0;
|
|
155
|
+
g = x;
|
|
156
|
+
b = c;
|
|
157
|
+
}
|
|
158
|
+
else if (h >= 240 && h < 300) {
|
|
159
|
+
r = x;
|
|
160
|
+
g = 0;
|
|
161
|
+
b = c;
|
|
162
|
+
}
|
|
163
|
+
else if (h >= 300 && h <= 360) {
|
|
164
|
+
r = c;
|
|
165
|
+
g = 0;
|
|
166
|
+
b = x;
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
r: Math.round((r + m) * 255),
|
|
170
|
+
g: Math.round((g + m) * 255),
|
|
171
|
+
b: Math.round((b + m) * 255),
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
rgbToHex(red, green, black, opacity = 100) {
|
|
175
|
+
const toHex = (val) => {
|
|
176
|
+
const hex = Math.round(val).toString(16);
|
|
177
|
+
return hex.padStart(2, '0');
|
|
178
|
+
};
|
|
179
|
+
const rHex = toHex(red);
|
|
180
|
+
const gHex = toHex(green);
|
|
181
|
+
const bHex = toHex(black);
|
|
182
|
+
const alpha = Math.round((opacity / 100) * 255);
|
|
183
|
+
const aHex = toHex(alpha);
|
|
184
|
+
return `#${rHex}${gHex}${bHex}${aHex}`;
|
|
185
|
+
}
|
|
186
|
+
syncFromHex() {
|
|
187
|
+
if (/^#?[0-9A-F]{6}([0-9A-F]{2})?$/i.test(this.color)) {
|
|
188
|
+
if (!this.color.startsWith('#')) {
|
|
189
|
+
this.color = '#' + this.color;
|
|
190
|
+
}
|
|
191
|
+
const hex = this.color.substring(1);
|
|
192
|
+
const r = parseInt(hex.substring(0, 2), 16);
|
|
193
|
+
const g = parseInt(hex.substring(2, 4), 16);
|
|
194
|
+
const b = parseInt(hex.substring(4, 6), 16);
|
|
195
|
+
const a = hex.length === 8 ? parseInt(hex.substring(6, 8), 16) / 255 : 1;
|
|
196
|
+
const hsv = this.rgbToHsv(r, g, b, a);
|
|
197
|
+
this.hue = hsv.h;
|
|
198
|
+
this.saturation = hsv.s;
|
|
199
|
+
this.currentVal = hsv.v;
|
|
200
|
+
this.opacity = a * 100;
|
|
201
|
+
this.drawColorCanvas();
|
|
202
|
+
this.drawOpacityCanvas();
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
onHexInputChange(event) {
|
|
206
|
+
this.color = event.target.value;
|
|
207
|
+
this.syncFromHex();
|
|
208
|
+
}
|
|
209
|
+
rgbToHsv(r, g, b, a = 1) {
|
|
210
|
+
r /= 255;
|
|
211
|
+
g /= 255;
|
|
212
|
+
b /= 255;
|
|
213
|
+
const max = Math.max(r, g, b);
|
|
214
|
+
const min = Math.min(r, g, b);
|
|
215
|
+
const delta = max - min;
|
|
216
|
+
let h = 0;
|
|
217
|
+
if (delta !== 0) {
|
|
218
|
+
if (max === r)
|
|
219
|
+
h = 60 * (((g - b) / delta) % 6);
|
|
220
|
+
else if (max === g)
|
|
221
|
+
h = 60 * ((b - r) / delta + 2);
|
|
222
|
+
else if (max === b)
|
|
223
|
+
h = 60 * ((r - g) / delta + 4);
|
|
224
|
+
}
|
|
225
|
+
if (h < 0)
|
|
226
|
+
h += 360;
|
|
227
|
+
const s = max === 0 ? 0 : (delta / max) * 100;
|
|
228
|
+
const v = max * 100;
|
|
229
|
+
return {
|
|
230
|
+
h: Math.round(h),
|
|
231
|
+
s: Math.round(s),
|
|
232
|
+
v: Math.round(v),
|
|
233
|
+
a: parseFloat(a.toFixed(3)),
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
getCanvasPosition(canvas, event) {
|
|
237
|
+
const rect = canvas.getBoundingClientRect();
|
|
238
|
+
const scaleX = canvas.width / rect.width;
|
|
239
|
+
const scaleY = canvas.height / rect.height;
|
|
240
|
+
return {
|
|
241
|
+
x: (event.clientX - rect.left) * scaleX,
|
|
242
|
+
y: (event.clientY - rect.top) * scaleY,
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
onColorMouseDown(event) {
|
|
246
|
+
this.isDragging = true;
|
|
247
|
+
this.updateColorFromPosition(event);
|
|
248
|
+
}
|
|
249
|
+
onHueMouseDown(event) {
|
|
250
|
+
this.isHueDragging = true;
|
|
251
|
+
this.updateHueFromPosition(event);
|
|
252
|
+
}
|
|
253
|
+
onOpacityMouseDown(event) {
|
|
254
|
+
this.isOpacityDragging = true;
|
|
255
|
+
this.updateOpacityFromPosition(event);
|
|
256
|
+
}
|
|
257
|
+
updateColorFromPosition(event) {
|
|
258
|
+
if (!this.colorCanvas)
|
|
259
|
+
return;
|
|
260
|
+
const pos = this.getCanvasPosition(this.colorCanvas, event);
|
|
261
|
+
const x = Math.max(0, Math.min(pos.x, 256));
|
|
262
|
+
const y = Math.max(0, Math.min(pos.y, 150));
|
|
263
|
+
this.saturation = Math.round((x / 256) * 100);
|
|
264
|
+
this.currentVal = 100 - Math.round((y / 150) * 100);
|
|
265
|
+
this.updateColor();
|
|
266
|
+
}
|
|
267
|
+
updateHueFromPosition(event) {
|
|
268
|
+
if (!this.hueCanvas)
|
|
269
|
+
return;
|
|
270
|
+
const pos = this.getCanvasPosition(this.hueCanvas, event);
|
|
271
|
+
const x = Math.max(0, Math.min(pos.x, 256));
|
|
272
|
+
this.hue = Math.round((x / 256) * 360);
|
|
273
|
+
this.drawColorCanvas();
|
|
274
|
+
this.updateColor();
|
|
275
|
+
}
|
|
276
|
+
updateOpacityFromPosition(event) {
|
|
277
|
+
if (!this.opacityCanvas)
|
|
278
|
+
return;
|
|
279
|
+
const pos = this.getCanvasPosition(this.opacityCanvas, event);
|
|
280
|
+
const x = Math.max(0, Math.min(pos.x, 256));
|
|
281
|
+
this.opacity = Math.round((x / 256) * 100);
|
|
282
|
+
this.updateColor();
|
|
283
|
+
}
|
|
284
|
+
showEditor() {
|
|
285
|
+
this.showEdit = !this.showEdit;
|
|
286
|
+
this.color = this.currentColor;
|
|
287
|
+
if (this.showEdit) {
|
|
288
|
+
setTimeout(() => {
|
|
289
|
+
this.drawHueCanvas();
|
|
290
|
+
this.drawColorCanvas();
|
|
291
|
+
this.drawOpacityCanvas();
|
|
292
|
+
this.syncFromHex();
|
|
293
|
+
}, 100);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
render() {
|
|
297
|
+
return (h("div", { key: '2ee2bd6abd837388d8169961f6b1024da228b453', class: "general-container" }, h("div", { key: '15416c1a844daf774dda53f1c08bbe6b15435b64', class: "main-input-container" }, h("div", { key: 'e08aacd3ebb059a8467cf6f597d2b3bb3419e286', class: "overlay", onClick: () => this.showEditor() }), h("div", { key: 'dda8addee7afb351fb1f6c18dda516d29259220d', class: "line-color-preview" }, h("div", { key: 'b242eac802dc0c1d0a9965fb6fc9b6f010408ae2', class: "color-preview", style: { background: this.currentColor } })), h("div", { key: '8dddc6632dddae52cc58d964ee50cae1e6460b12', class: "color-info" }, h("input", { key: '7181e30bddae8005260d285653425cd5cad2386e', type: "text", class: "color-input", value: this.currentColor, maxLength: 9, readOnly: true }))), h("div", { key: '0ad3b547299fc1a4ccab9ddb7efebd7962fd7855', class: `color-picker-container position-${this.position} ${this.showEdit ? 'show' : ''}` }, h("div", { key: 'c49847d5a6ca7a90f27889afe26f6c30c1959676', class: "main-color-canvas-container" }, h("canvas", { key: '44531a25415492782d70d070aacf17797f9e3818', ref: (el) => this.colorCanvas = el, width: 256, height: 150, onMouseDown: (e) => this.onColorMouseDown(e) }), h("div", { key: '325bc14afacafa6dddd0a9bc837c6448ff803bd8', class: "color-selector-pointer", style: {
|
|
298
|
+
left: `${(this.saturation / 100) * 256}px`,
|
|
299
|
+
top: `${((100 - this.currentVal) / 100) * 150}px`
|
|
300
|
+
} })), h("div", { key: 'ab6d2a987b4c317fa218e70a1602ea829505fe0a', class: "slider-container" }, h("div", { key: 'fe9ae897de10c04322653870cb9e5b79f61a2b86', class: "slider-group" }, h("div", { key: 'f39f1935c0410509f6ecbf69b718730201d70be7', class: "hue-slider-container" }, h("canvas", { key: '6a08c8dd36f3c9d70aa0f0438006bc4efa4df401', ref: (el) => this.hueCanvas = el, width: 256, height: 20, onMouseDown: (e) => this.onHueMouseDown(e) }), h("div", { key: 'a91a4f4469e3152b24bf1e7dfd3d4738eb17f661', class: "slider-pointer", style: { left: `${(this.hue / 360) * 234}px` } }))), h("div", { key: '2a45b1e24dcb447e515d8dbfac2ecd4032661af8', class: "slider-group" }, h("div", { key: 'ec945cd912ecf046ca16e7520bae48d3e998f8fd', class: "opacity-slider-container" }, h("canvas", { key: 'f181f9a8b16274d94377f3dd300c3bff231088df', ref: (el) => this.opacityCanvas = el, width: 256, height: 20, onMouseDown: (e) => this.onOpacityMouseDown(e) }), h("div", { key: '2e246b9e62991569c60024ac4f8b1ae32543e03e', class: "slider-pointer", style: { left: `${(this.opacity / 100) * 234}px` } }))), h("div", { key: 'c8c539dda06f8ce70b4c669a32e56cb693132f49', class: "color-info" }, h("div", { key: '5939e97e1331e57a5837e868ea6088b069e3c3eb', class: "color-label" }, "HEX"), h("input", { key: '321cebcb041223d4cb6c072f310720edcdb2391c', type: "text", class: "color-input", value: this.color, onInput: (e) => this.onHexInputChange(e), maxLength: 9 }))))));
|
|
301
|
+
}
|
|
302
|
+
static get is() { return "dropi-color-picker"; }
|
|
303
|
+
static get encapsulation() { return "shadow"; }
|
|
304
|
+
static get originalStyleUrls() {
|
|
305
|
+
return {
|
|
306
|
+
"$": ["dropi-color-picker.css"]
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
static get styleUrls() {
|
|
310
|
+
return {
|
|
311
|
+
"$": ["dropi-color-picker.css"]
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
static get properties() {
|
|
315
|
+
return {
|
|
316
|
+
"currentColor": {
|
|
317
|
+
"type": "string",
|
|
318
|
+
"mutable": true,
|
|
319
|
+
"complexType": {
|
|
320
|
+
"original": "string",
|
|
321
|
+
"resolved": "string",
|
|
322
|
+
"references": {}
|
|
323
|
+
},
|
|
324
|
+
"required": false,
|
|
325
|
+
"optional": false,
|
|
326
|
+
"docs": {
|
|
327
|
+
"tags": [],
|
|
328
|
+
"text": ""
|
|
329
|
+
},
|
|
330
|
+
"getter": false,
|
|
331
|
+
"setter": false,
|
|
332
|
+
"reflect": false,
|
|
333
|
+
"attribute": "current-color",
|
|
334
|
+
"defaultValue": "'#ffffff'"
|
|
335
|
+
},
|
|
336
|
+
"position": {
|
|
337
|
+
"type": "string",
|
|
338
|
+
"mutable": false,
|
|
339
|
+
"complexType": {
|
|
340
|
+
"original": "'top' | 'bottom' | 'left' | 'right'",
|
|
341
|
+
"resolved": "\"bottom\" | \"left\" | \"right\" | \"top\"",
|
|
342
|
+
"references": {}
|
|
343
|
+
},
|
|
344
|
+
"required": false,
|
|
345
|
+
"optional": false,
|
|
346
|
+
"docs": {
|
|
347
|
+
"tags": [],
|
|
348
|
+
"text": ""
|
|
349
|
+
},
|
|
350
|
+
"getter": false,
|
|
351
|
+
"setter": false,
|
|
352
|
+
"reflect": false,
|
|
353
|
+
"attribute": "position",
|
|
354
|
+
"defaultValue": "'right'"
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
static get states() {
|
|
359
|
+
return {
|
|
360
|
+
"color": {},
|
|
361
|
+
"hue": {},
|
|
362
|
+
"saturation": {},
|
|
363
|
+
"currentVal": {},
|
|
364
|
+
"opacity": {},
|
|
365
|
+
"showEdit": {}
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
static get events() {
|
|
369
|
+
return [{
|
|
370
|
+
"method": "colorChange",
|
|
371
|
+
"name": "colorChange",
|
|
372
|
+
"bubbles": true,
|
|
373
|
+
"cancelable": true,
|
|
374
|
+
"composed": true,
|
|
375
|
+
"docs": {
|
|
376
|
+
"tags": [],
|
|
377
|
+
"text": ""
|
|
378
|
+
},
|
|
379
|
+
"complexType": {
|
|
380
|
+
"original": "string",
|
|
381
|
+
"resolved": "string",
|
|
382
|
+
"references": {}
|
|
383
|
+
}
|
|
384
|
+
}];
|
|
385
|
+
}
|
|
386
|
+
static get elementRef() { return "el"; }
|
|
387
|
+
static get watchers() {
|
|
388
|
+
return [{
|
|
389
|
+
"propName": "value",
|
|
390
|
+
"methodName": "onValueChange"
|
|
391
|
+
}];
|
|
392
|
+
}
|
|
393
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.flag {
|
|
6
|
+
max-width: 40px;
|
|
7
|
+
max-height: 40px;
|
|
8
|
+
margin: 0;
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.flag img {
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
object-fit: cover;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.circle {
|
|
21
|
+
border-radius: 50%;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.rectangle {
|
|
26
|
+
border-radius: 4px;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
max-width: 32px !important;
|
|
29
|
+
max-height: 24px !important;
|
|
30
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* @component dropi-country-flags
|
|
4
|
+
* Displays a country flag image. Supports circle, rectangle, and flat styles.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* <dropi-country-flags country="CO" style="circle"></dropi-country-flags>
|
|
8
|
+
*/
|
|
9
|
+
export class DropiCountryFlags {
|
|
10
|
+
/** ISO 3166-1 alpha-2 country code (e.g. "CO", "US") */
|
|
11
|
+
country = '';
|
|
12
|
+
/** Visual style: circle uses circle-flags CDN, rectangle/flat uses flagsapi */
|
|
13
|
+
customStyle = 'flat';
|
|
14
|
+
/** Width in px */
|
|
15
|
+
width = '';
|
|
16
|
+
/** Height in px */
|
|
17
|
+
height = '';
|
|
18
|
+
get src() {
|
|
19
|
+
const code = (this.country || '').toUpperCase();
|
|
20
|
+
if (this.customStyle === 'circle') {
|
|
21
|
+
return `https://hatscripts.github.io/circle-flags/flags/${code.toLowerCase()}.svg`;
|
|
22
|
+
}
|
|
23
|
+
return `https://flagsapi.com/${code}/flat/64.png`;
|
|
24
|
+
}
|
|
25
|
+
render() {
|
|
26
|
+
const style = {};
|
|
27
|
+
if (this.width)
|
|
28
|
+
style['width'] = this.width.includes('px') ? this.width : `${this.width}px`;
|
|
29
|
+
if (this.height)
|
|
30
|
+
style['height'] = this.height.includes('px') ? this.height : `${this.height}px`;
|
|
31
|
+
return (h("figure", { key: '924adeb5372e2c02ce1c0471a162b57fc53616bd', class: `flag ${this.customStyle ?? 'flat'}` }, h("img", { key: '8433b69bbfc51aa5e72f8bd7166382e1d7907cfa', src: this.src, style: style, alt: `flag-${this.country}` })));
|
|
32
|
+
}
|
|
33
|
+
static get is() { return "dropi-country-flags"; }
|
|
34
|
+
static get encapsulation() { return "shadow"; }
|
|
35
|
+
static get originalStyleUrls() {
|
|
36
|
+
return {
|
|
37
|
+
"$": ["dropi-country-flags.css"]
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
static get styleUrls() {
|
|
41
|
+
return {
|
|
42
|
+
"$": ["dropi-country-flags.css"]
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
static get properties() {
|
|
46
|
+
return {
|
|
47
|
+
"country": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"mutable": false,
|
|
50
|
+
"complexType": {
|
|
51
|
+
"original": "string",
|
|
52
|
+
"resolved": "string",
|
|
53
|
+
"references": {}
|
|
54
|
+
},
|
|
55
|
+
"required": false,
|
|
56
|
+
"optional": false,
|
|
57
|
+
"docs": {
|
|
58
|
+
"tags": [],
|
|
59
|
+
"text": "ISO 3166-1 alpha-2 country code (e.g. \"CO\", \"US\")"
|
|
60
|
+
},
|
|
61
|
+
"getter": false,
|
|
62
|
+
"setter": false,
|
|
63
|
+
"reflect": false,
|
|
64
|
+
"attribute": "country",
|
|
65
|
+
"defaultValue": "''"
|
|
66
|
+
},
|
|
67
|
+
"customStyle": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"mutable": false,
|
|
70
|
+
"complexType": {
|
|
71
|
+
"original": "'circle' | 'rectangle' | 'flat'",
|
|
72
|
+
"resolved": "\"circle\" | \"flat\" | \"rectangle\"",
|
|
73
|
+
"references": {}
|
|
74
|
+
},
|
|
75
|
+
"required": false,
|
|
76
|
+
"optional": false,
|
|
77
|
+
"docs": {
|
|
78
|
+
"tags": [],
|
|
79
|
+
"text": "Visual style: circle uses circle-flags CDN, rectangle/flat uses flagsapi"
|
|
80
|
+
},
|
|
81
|
+
"getter": false,
|
|
82
|
+
"setter": false,
|
|
83
|
+
"reflect": false,
|
|
84
|
+
"attribute": "custom-style",
|
|
85
|
+
"defaultValue": "'flat'"
|
|
86
|
+
},
|
|
87
|
+
"width": {
|
|
88
|
+
"type": "string",
|
|
89
|
+
"mutable": false,
|
|
90
|
+
"complexType": {
|
|
91
|
+
"original": "string",
|
|
92
|
+
"resolved": "string",
|
|
93
|
+
"references": {}
|
|
94
|
+
},
|
|
95
|
+
"required": false,
|
|
96
|
+
"optional": false,
|
|
97
|
+
"docs": {
|
|
98
|
+
"tags": [],
|
|
99
|
+
"text": "Width in px"
|
|
100
|
+
},
|
|
101
|
+
"getter": false,
|
|
102
|
+
"setter": false,
|
|
103
|
+
"reflect": false,
|
|
104
|
+
"attribute": "width",
|
|
105
|
+
"defaultValue": "''"
|
|
106
|
+
},
|
|
107
|
+
"height": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"mutable": false,
|
|
110
|
+
"complexType": {
|
|
111
|
+
"original": "string",
|
|
112
|
+
"resolved": "string",
|
|
113
|
+
"references": {}
|
|
114
|
+
},
|
|
115
|
+
"required": false,
|
|
116
|
+
"optional": false,
|
|
117
|
+
"docs": {
|
|
118
|
+
"tags": [],
|
|
119
|
+
"text": "Height in px"
|
|
120
|
+
},
|
|
121
|
+
"getter": false,
|
|
122
|
+
"setter": false,
|
|
123
|
+
"reflect": false,
|
|
124
|
+
"attribute": "height",
|
|
125
|
+
"defaultValue": "''"
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
}
|