@dropi/ui 0.1.17 → 0.1.19
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.cjs.entry.js +1 -1
- package/dist/cjs/dropi-alert.cjs.entry.js +58 -0
- package/dist/cjs/dropi-avatars.cjs.entry.js +31 -0
- package/dist/cjs/dropi-badge.cjs.entry.js +1 -1
- package/dist/cjs/dropi-button.cjs.entry.js +2 -2
- package/dist/cjs/dropi-card-section.cjs.entry.js +38 -0
- package/dist/cjs/dropi-checkbox-selection-list.cjs.entry.js +71 -0
- package/dist/cjs/dropi-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/dropi-chips.cjs.entry.js +30 -0
- package/dist/cjs/dropi-dropdown.cjs.entry.js +58 -0
- package/dist/cjs/dropi-empty-state.cjs.entry.js +1 -1
- package/dist/cjs/dropi-favorite-button.cjs.entry.js +27 -0
- package/dist/cjs/dropi-icon.cjs.entry.js +1 -1
- package/dist/cjs/dropi-image-miniature.cjs.entry.js +44 -0
- package/dist/cjs/dropi-image-overlay.cjs.entry.js +62 -0
- package/dist/cjs/dropi-input.cjs.entry.js +5 -5
- package/dist/cjs/dropi-logo.cjs.entry.js +27 -0
- package/dist/cjs/dropi-lottie-loader.cjs.entry.js +27 -0
- package/dist/cjs/dropi-otp-send-code.cjs.entry.js +92 -0
- package/dist/cjs/dropi-paginator.cjs.entry.js +5 -3
- package/dist/cjs/dropi-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/dropi-radio-selection-list.cjs.entry.js +56 -0
- package/dist/cjs/dropi-read-more.cjs.entry.js +36 -0
- package/dist/cjs/dropi-search.cjs.entry.js +110 -0
- package/dist/cjs/dropi-select.cjs.entry.js +1 -1
- package/dist/cjs/dropi-simple-stepper.cjs.entry.js +51 -0
- package/dist/cjs/dropi-steps.cjs.entry.js +50 -0
- package/dist/cjs/dropi-switch.cjs.entry.js +1 -1
- package/dist/cjs/dropi-tabs.cjs.entry.js +1 -1
- package/dist/cjs/dropi-tag.cjs.entry.js +1 -1
- package/dist/cjs/dropi-text-area.cjs.entry.js +3 -3
- package/dist/cjs/dropi-time-line.cjs.entry.js +34 -0
- package/dist/cjs/dropi-toast.cjs.entry.js +1 -1
- package/dist/cjs/dropi-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/dropi-ui.cjs.js +1 -1
- package/dist/cjs/dropi-vertical-steps.cjs.entry.js +55 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +19 -0
- package/dist/collection/components/dropi-accordion/dropi-accordion.js +1 -1
- package/dist/collection/components/dropi-alert/dropi-alert.css +123 -0
- package/dist/collection/components/dropi-alert/dropi-alert.js +305 -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.js +1 -1
- package/dist/collection/components/dropi-button/dropi-button.js +2 -2
- 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-checkbox/dropi-checkbox.js +2 -2
- 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 +245 -0
- package/dist/collection/components/dropi-chips/dropi-chips.css +66 -0
- package/dist/collection/components/dropi-chips/dropi-chips.js +169 -0
- package/dist/collection/components/dropi-dropdown/dropi-dropdown.css +51 -0
- package/dist/collection/components/dropi-dropdown/dropi-dropdown.js +184 -0
- package/dist/collection/components/dropi-empty-state/dropi-empty-state.js +1 -1
- 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-icon/dropi-icon.js +1 -1
- 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 +82 -0
- package/dist/collection/components/dropi-image-overlay/dropi-image-overlay.js +155 -0
- package/dist/collection/components/dropi-input/dropi-input.css +11 -0
- package/dist/collection/components/dropi-input/dropi-input.js +4 -4
- package/dist/collection/components/dropi-logo/dropi-logo.css +26 -0
- package/dist/collection/components/dropi-logo/dropi-logo.js +96 -0
- package/dist/collection/components/dropi-lottie-loader/dropi-lottie-loader.css +50 -0
- package/dist/collection/components/dropi-lottie-loader/dropi-lottie-loader.js +116 -0
- package/dist/collection/components/dropi-otp-send-code/dropi-otp-send-code.css +60 -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 +15 -12
- package/dist/collection/components/dropi-paginator/dropi-paginator.js +24 -2
- package/dist/collection/components/dropi-radio-button/dropi-radio-button.js +1 -1
- 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 +209 -0
- package/dist/collection/components/dropi-read-more/dropi-read-more.css +28 -0
- package/dist/collection/components/dropi-read-more/dropi-read-more.js +110 -0
- package/dist/collection/components/dropi-search/dropi-search.css +112 -0
- package/dist/collection/components/dropi-search/dropi-search.js +392 -0
- package/dist/collection/components/dropi-select/dropi-select.js +1 -1
- package/dist/collection/components/dropi-simple-stepper/dropi-simple-stepper.css +94 -0
- package/dist/collection/components/dropi-simple-stepper/dropi-simple-stepper.js +172 -0
- package/dist/collection/components/dropi-steps/dropi-steps.css +95 -0
- package/dist/collection/components/dropi-steps/dropi-steps.js +145 -0
- package/dist/collection/components/dropi-switch/dropi-switch.js +1 -1
- 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.css +0 -1
- package/dist/collection/components/dropi-text-area/dropi-text-area.js +2 -2
- 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.js +1 -1
- package/dist/collection/components/dropi-tooltip/dropi-tooltip.js +1 -1
- 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/components/dropi-accordion.js +1 -1
- package/dist/components/dropi-alert.d.ts +11 -0
- package/dist/components/dropi-alert.js +1 -0
- package/dist/components/dropi-avatars.d.ts +11 -0
- package/dist/components/dropi-avatars.js +1 -0
- package/dist/components/dropi-badge.js +1 -1
- package/dist/components/dropi-button.js +1 -1
- package/dist/components/dropi-card-section.d.ts +11 -0
- package/dist/components/dropi-card-section.js +1 -0
- package/dist/components/dropi-checkbox-selection-list.d.ts +11 -0
- package/dist/components/dropi-checkbox-selection-list.js +1 -0
- package/dist/components/dropi-checkbox.js +1 -1
- package/dist/components/dropi-chips.d.ts +11 -0
- package/dist/components/dropi-chips.js +1 -0
- package/dist/components/dropi-dropdown.d.ts +11 -0
- package/dist/components/dropi-dropdown.js +1 -0
- package/dist/components/dropi-empty-state.js +1 -1
- package/dist/components/dropi-favorite-button.d.ts +11 -0
- package/dist/components/dropi-favorite-button.js +1 -0
- package/dist/components/dropi-icon.js +1 -1
- package/dist/components/dropi-image-miniature.d.ts +11 -0
- package/dist/components/dropi-image-miniature.js +1 -0
- package/dist/components/dropi-image-overlay.d.ts +11 -0
- package/dist/components/dropi-image-overlay.js +1 -0
- package/dist/components/dropi-input.js +1 -1
- package/dist/components/dropi-logo.d.ts +11 -0
- package/dist/components/dropi-logo.js +1 -0
- package/dist/components/dropi-lottie-loader.d.ts +11 -0
- package/dist/components/dropi-lottie-loader.js +1 -0
- package/dist/components/dropi-modal.js +1 -1
- package/dist/components/dropi-otp-send-code.d.ts +11 -0
- package/dist/components/dropi-otp-send-code.js +1 -0
- package/dist/components/dropi-paginator.js +1 -1
- package/dist/components/dropi-radio-button.js +1 -1
- package/dist/components/dropi-radio-selection-list.d.ts +11 -0
- package/dist/components/dropi-radio-selection-list.js +1 -0
- package/dist/components/dropi-read-more.d.ts +11 -0
- package/dist/components/dropi-read-more.js +1 -0
- package/dist/components/dropi-search.d.ts +11 -0
- package/dist/components/dropi-search.js +1 -0
- package/dist/components/dropi-select.js +1 -1
- package/dist/components/dropi-simple-stepper.d.ts +11 -0
- package/dist/components/dropi-simple-stepper.js +1 -0
- package/dist/components/dropi-steps.d.ts +11 -0
- package/dist/components/dropi-steps.js +1 -0
- package/dist/components/dropi-switch.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.d.ts +11 -0
- package/dist/components/dropi-time-line.js +1 -0
- package/dist/components/dropi-toast.js +1 -1
- package/dist/components/dropi-tooltip.js +1 -1
- package/dist/components/dropi-vertical-steps.d.ts +11 -0
- package/dist/components/dropi-vertical-steps.js +1 -0
- package/dist/components/{p-ChOXWKmI.js → p-CPs3fHRc.js} +1 -1
- package/dist/components/p-DKXrREI4.js +1 -0
- package/dist/components/p-Ds74ZOlC.js +1 -0
- package/dist/components/{p-NCyvfOs2.js → p-WZTFyFH2.js} +1 -1
- package/dist/dropi-ui/dropi-ui.esm.js +1 -1
- package/dist/dropi-ui/p-061e1ad4.entry.js +1 -0
- package/dist/dropi-ui/{p-ecda6e19.entry.js → p-0c13dded.entry.js} +1 -1
- package/dist/dropi-ui/{p-79466fec.entry.js → p-121c8a09.entry.js} +1 -1
- package/dist/dropi-ui/p-291a1416.entry.js +1 -0
- package/dist/dropi-ui/p-2cee44f9.entry.js +1 -0
- package/dist/dropi-ui/{p-6031ac9d.entry.js → p-30fdd316.entry.js} +1 -1
- package/dist/dropi-ui/p-3537ee5a.entry.js +1 -0
- package/dist/dropi-ui/{p-26dbae0d.entry.js → p-3d859657.entry.js} +1 -1
- package/dist/dropi-ui/p-433d161d.entry.js +1 -0
- package/dist/dropi-ui/p-4bdfad16.entry.js +1 -0
- package/dist/dropi-ui/p-4ea7d3a7.entry.js +1 -0
- package/dist/dropi-ui/{p-09c38a49.entry.js → p-51c8ef68.entry.js} +1 -1
- package/dist/dropi-ui/{p-6d15d32f.entry.js → p-54780c90.entry.js} +1 -1
- package/dist/dropi-ui/{p-63e969da.entry.js → p-66deb85e.entry.js} +1 -1
- package/dist/dropi-ui/p-68f81080.entry.js +1 -0
- package/dist/dropi-ui/p-724a2aea.entry.js +1 -0
- package/dist/dropi-ui/p-74c37688.entry.js +1 -0
- package/dist/dropi-ui/p-7cec1cea.entry.js +1 -0
- package/dist/dropi-ui/{p-f0e1e0f6.entry.js → p-7daa2677.entry.js} +1 -1
- package/dist/dropi-ui/p-8906a68d.entry.js +1 -0
- package/dist/dropi-ui/{p-1739d20c.entry.js → p-a4204ece.entry.js} +1 -1
- package/dist/dropi-ui/p-a9116dbe.entry.js +1 -0
- package/dist/dropi-ui/p-b36b819f.entry.js +1 -0
- package/dist/dropi-ui/p-c10cbb8d.entry.js +1 -0
- package/dist/dropi-ui/{p-42179ae4.entry.js → p-c2316d4d.entry.js} +1 -1
- package/dist/dropi-ui/{p-e44242e2.entry.js → p-cb5fd7a9.entry.js} +1 -1
- package/dist/dropi-ui/p-d1e1b716.entry.js +1 -0
- package/dist/dropi-ui/p-d5ecc394.entry.js +1 -0
- package/dist/dropi-ui/p-db6c9828.entry.js +1 -0
- package/dist/dropi-ui/{p-4d582d58.entry.js → p-e721127d.entry.js} +1 -1
- package/dist/dropi-ui/p-e8557da0.entry.js +1 -0
- package/dist/dropi-ui/p-ebfd4665.entry.js +1 -0
- package/dist/dropi-ui/p-f3cef35a.entry.js +1 -0
- package/dist/dropi-ui/p-f6a69c4e.entry.js +1 -0
- package/dist/dropi-ui/{p-65fa8558.entry.js → p-ff45e7c8.entry.js} +1 -1
- package/dist/esm/dropi-accordion.entry.js +1 -1
- package/dist/esm/dropi-alert.entry.js +56 -0
- package/dist/esm/dropi-avatars.entry.js +29 -0
- package/dist/esm/dropi-badge.entry.js +1 -1
- package/dist/esm/dropi-button.entry.js +2 -2
- package/dist/esm/dropi-card-section.entry.js +36 -0
- package/dist/esm/dropi-checkbox-selection-list.entry.js +69 -0
- package/dist/esm/dropi-checkbox.entry.js +2 -2
- package/dist/esm/dropi-chips.entry.js +28 -0
- package/dist/esm/dropi-dropdown.entry.js +56 -0
- package/dist/esm/dropi-empty-state.entry.js +1 -1
- package/dist/esm/dropi-favorite-button.entry.js +25 -0
- package/dist/esm/dropi-icon.entry.js +1 -1
- package/dist/esm/dropi-image-miniature.entry.js +42 -0
- package/dist/esm/dropi-image-overlay.entry.js +60 -0
- package/dist/esm/dropi-input.entry.js +5 -5
- package/dist/esm/dropi-logo.entry.js +25 -0
- package/dist/esm/dropi-lottie-loader.entry.js +25 -0
- package/dist/esm/dropi-otp-send-code.entry.js +90 -0
- package/dist/esm/dropi-paginator.entry.js +5 -3
- package/dist/esm/dropi-radio-button.entry.js +1 -1
- package/dist/esm/dropi-radio-selection-list.entry.js +54 -0
- package/dist/esm/dropi-read-more.entry.js +34 -0
- package/dist/esm/dropi-search.entry.js +108 -0
- package/dist/esm/dropi-select.entry.js +1 -1
- package/dist/esm/dropi-simple-stepper.entry.js +49 -0
- package/dist/esm/dropi-steps.entry.js +48 -0
- package/dist/esm/dropi-switch.entry.js +1 -1
- package/dist/esm/dropi-tabs.entry.js +1 -1
- package/dist/esm/dropi-tag.entry.js +1 -1
- package/dist/esm/dropi-text-area.entry.js +3 -3
- package/dist/esm/dropi-time-line.entry.js +32 -0
- package/dist/esm/dropi-toast.entry.js +1 -1
- package/dist/esm/dropi-tooltip.entry.js +1 -1
- package/dist/esm/dropi-ui.js +1 -1
- package/dist/esm/dropi-vertical-steps.entry.js +53 -0
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/dropi-alert/dropi-alert.d.ts +35 -0
- package/dist/types/components/dropi-avatars/dropi-avatars.d.ts +17 -0
- package/dist/types/components/dropi-card-section/dropi-card-section.d.ts +22 -0
- package/dist/types/components/dropi-checkbox-selection-list/dropi-checkbox-selection-list.d.ts +37 -0
- package/dist/types/components/dropi-chips/dropi-chips.d.ts +23 -0
- package/dist/types/components/dropi-dropdown/dropi-dropdown.d.ts +28 -0
- package/dist/types/components/dropi-favorite-button/dropi-favorite-button.d.ts +14 -0
- package/dist/types/components/dropi-image-miniature/dropi-image-miniature.d.ts +23 -0
- package/dist/types/components/dropi-image-overlay/dropi-image-overlay.d.ts +26 -0
- package/dist/types/components/dropi-logo/dropi-logo.d.ts +14 -0
- package/dist/types/components/dropi-lottie-loader/dropi-lottie-loader.d.ts +15 -0
- package/dist/types/components/dropi-otp-send-code/dropi-otp-send-code.d.ts +33 -0
- package/dist/types/components/dropi-paginator/dropi-paginator.d.ts +2 -0
- package/dist/types/components/dropi-radio-selection-list/dropi-radio-selection-list.d.ts +34 -0
- package/dist/types/components/dropi-read-more/dropi-read-more.d.ts +17 -0
- package/dist/types/components/dropi-search/dropi-search.d.ts +51 -0
- package/dist/types/components/dropi-simple-stepper/dropi-simple-stepper.d.ts +20 -0
- package/dist/types/components/dropi-steps/dropi-steps.d.ts +21 -0
- package/dist/types/components/dropi-time-line/dropi-time-line.d.ts +18 -0
- package/dist/types/components/dropi-vertical-steps/dropi-vertical-steps.d.ts +24 -0
- package/dist/types/components.d.ts +1830 -3
- package/package.json +1 -1
- package/readme.md +189 -2
- package/dist/dropi-ui/p-082b7039.entry.js +0 -1
- package/dist/dropi-ui/p-eb7f9a57.entry.js +0 -1
- package/dist/dropi-ui/p-f283f41d.entry.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,c as e,h as r}from"./p-Twbb5MNM.js";const a=class{constructor(r){i(this,r),this.dropiClose=e(this,"dropiClose")}visible=!1;images=[];activeIndex=0;current=0;parsedImages=[];dropiClose;imagesChanged(i){this.parsedImages="string"==typeof i?JSON.parse(i):i||[]}indexChanged(i){this.current=i}visibleChanged(i){i&&(this.current=this.activeIndex)}componentWillLoad(){this.imagesChanged(this.images),this.current=this.activeIndex}close(){this.visible=!1,this.dropiClose.emit()}prev(){this.current=(this.current-1+this.parsedImages.length)%this.parsedImages.length}next(){this.current=(this.current+1)%this.parsedImages.length}handleError(i){i.target.src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MDAgMzAwIj48cmVjdCB3aWR0aD0iNDAwIiBoZWlnaHQ9IjMwMCIgZmlsbD0iIzFhMjAzMyIvPjx0ZXh0IHg9IjIwMCIgeT0iMTU1IiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmaWxsPSIjNDc1MDY2IiBmb250LXNpemU9IjE0Ij5TaW4gaW1hZ2VuPC90ZXh0Pjwvc3ZnPg=="}render(){if(!this.visible)return null;const i=this.parsedImages,e=i.length>1;return r("div",{class:"overlay",onClick:()=>this.close()},r("button",{class:"overlay__close",onClick:i=>{i.stopPropagation(),this.close()},"aria-label":"Cerrar"},r("dropi-icon",{name:"Close-small",width:"24px",height:"24px",color:"Neutral-White"})),r("div",{class:"overlay__main",onClick:i=>i.stopPropagation()},e&&r("button",{class:"overlay__nav overlay__nav--prev",onClick:()=>this.prev(),"aria-label":"Anterior"},r("dropi-icon",{name:"Dropdown-left",width:"24px",height:"24px",color:"Neutral-White"})),r("img",{class:"overlay__image",src:i[this.current],alt:`imagen ${this.current+1}`,onError:i=>this.handleError(i)}),e&&r("button",{class:"overlay__nav overlay__nav--next",onClick:()=>this.next(),"aria-label":"Siguiente"},r("dropi-icon",{name:"Dropdown-Right",width:"24px",height:"24px",color:"Neutral-White"}))),e&&r("div",{class:"overlay__thumbs",onClick:i=>i.stopPropagation()},i.map(((i,e)=>r("img",{key:e,class:{overlay__thumb:!0,"overlay__thumb--active":e===this.current},src:i,alt:`miniatura ${e+1}`,onClick:()=>this.current=e,onError:i=>this.handleError(i)})))))}static get watchers(){return{images:[{imagesChanged:0}],activeIndex:[{indexChanged:0}],visible:[{visibleChanged:0}]}}};a.style=":host{display:block}.overlay{position:fixed;inset:0;background:rgba(0,0,0,0.92);display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:9999;gap:var(--Size-3, 12px)}.overlay__close{position:absolute;top:var(--Size-4, 16px);right:var(--Size-4, 16px);background:rgba(255,255,255,0.1);border:none;border-radius:50%;width:40px;height:40px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background 0.15s}.overlay__close:hover{background:rgba(255,255,255,0.2)}.overlay__main{position:relative;display:flex;align-items:center;gap:var(--Size-3, 12px);max-width:90vw;max-height:75vh}.overlay__image{max-width:80vw;max-height:72vh;object-fit:contain;border-radius:var(--Border-2, 8px)}.overlay__nav{background:rgba(255,255,255,0.1);border:none;border-radius:50%;width:44px;height:44px;display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;transition:background 0.15s}.overlay__nav:hover{background:rgba(255,255,255,0.2)}.overlay__thumbs{display:flex;gap:var(--Size-2, 8px);flex-wrap:wrap;justify-content:center;max-width:90vw}.overlay__thumb{width:56px;height:56px;object-fit:cover;border-radius:var(--Border-1, 4px);cursor:pointer;opacity:0.5;border:2px solid transparent;transition:opacity 0.15s, border-color 0.15s}.overlay__thumb:hover{opacity:0.8}.overlay__thumb--active{opacity:1;border-color:var(--Primary-Primary-500, #f49a3d)}";export{a as dropi_image_overlay}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as s,h as i}from"./p-Twbb5MNM.js";const r=class{constructor(i){e(this,i),this.dropiCheckedValues=s(this,"dropiCheckedValues"),this.dropiSearch=s(this,"dropiSearch")}options=[];showFilter=!0;filterPlaceholder="Buscar...";showNotFound=!0;notFoundMessage="Sin resultados";multiSelect=!0;filterText="";selected=[];parsedOptions=[];dropiCheckedValues;dropiSearch;optionsChanged(e){this.parsedOptions="string"==typeof e?JSON.parse(e):e||[]}componentWillLoad(){this.optionsChanged(this.options)}get filtered(){if(!this.filterText)return this.parsedOptions;const e=this.filterText.toLowerCase();return this.parsedOptions.filter((s=>s.name?.toLowerCase().includes(e)))}toggle(e){this.selected=this.multiSelect?this.selected.includes(e)?this.selected.filter((s=>s!==e)):[...this.selected,e]:this.selected.includes(e)?[]:[e],this.dropiCheckedValues.emit(this.selected)}render(){const e=this.filtered;return i("div",{key:"4606e983827d32c18990c44589c2cfcac678b0ae",class:"csl"},this.showFilter&&i("div",{key:"532d95a9e0530023094611ce55b37f56eb6f9d78",class:"csl__search"},i("dropi-icon",{key:"79598d6cb8b36f90e15d2983f8c3e54cb713d193",name:"Search",width:"16px",height:"16px",color:"Gray-Gray-400"}),i("input",{key:"fa95ab8c1112e335560b8c49f7f4b502b3f7b3a0",class:"csl__search-input",type:"text",placeholder:this.filterPlaceholder,value:this.filterText,onInput:e=>{this.filterText=e.target.value,this.dropiSearch.emit(this.filterText)}}),this.filterText&&i("button",{key:"94574b93a5e1d938ebedd7f462e3aed6917390ef",class:"csl__clear",onClick:()=>{this.filterText="",this.dropiSearch.emit("")}},i("dropi-icon",{key:"c9765efda527f9321757a69028f9ceb7e12a7514",name:"Close-small",width:"14px",height:"14px",color:"Gray-Gray-400"}))),i("div",{key:"2f40c32f10c84277924c240a12e89876ff60a4d2",class:"csl__list"},0===e.length&&this.showNotFound?i("div",{class:"csl__empty"},this.notFoundMessage):e.map((e=>{const s=this.selected.includes(e.id);return i("div",{class:"csl__item",key:e.id,onClick:()=>this.toggle(e.id)},i("dropi-checkbox",{checked:s}),e.icon&&i("img",{class:"csl__icon",src:e.icon,alt:e.name}),i("span",{class:"csl__label"},e.name))}))))}static get watchers(){return{options:[{optionsChanged:0}]}}};r.style=":host{display:block;width:100%}*,*::before,*::after{box-sizing:border-box}.csl__search{display:flex;align-items:center;gap:var(--Size-2, 8px);padding:var(--Size-2, 8px) var(--Size-3, 12px);border:1px solid var(--Gray-Gray-200, #c3c9d9);border-radius:var(--Border-2, 8px);margin-bottom:var(--Size-2, 8px)}.csl__search-input{flex:1;border:none;outline:none;font-size:var(--font-size-s, 12px);font-family:inherit;color:var(--Gray-Gray-700, #32394d);background:transparent}.csl__clear{display:flex;background:none;border:none;padding:0;cursor:pointer}.csl__list{display:flex;flex-direction:column}.csl__item{display:flex;align-items:center;gap:var(--Size-2, 8px);padding:var(--Size-2, 8px) var(--Size-3, 12px);cursor:pointer;border-radius:var(--Border-1, 4px);transition:background 0.15s}.csl__item:hover{background:var(--Gray-Gray-50, #f7f8fa)}.csl__icon{width:24px;height:24px;border-radius:50%;object-fit:cover;flex-shrink:0}.csl__label{font-size:var(--font-size-s, 12px);color:var(--Gray-Gray-700, #32394d);flex:1}.csl__empty{padding:var(--Size-4, 16px);text-align:center;font-size:var(--font-size-s, 12px);color:var(--Gray-Gray-400, #858ea6)}";export{r as dropi_checkbox_selection_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,c as t,h as
|
|
1
|
+
import{r as a,c as t,h as r}from"./p-Twbb5MNM.js";const e=class{constructor(r){a(this,r),this.dropiTabChange=t(this,"dropiTabChange")}tabs=[];activeTab=0;showIcon=!1;dropiTabChange;parsedTabs=[];tabsChanged(a){this.parsedTabs="string"==typeof a?JSON.parse(a):a??[]}componentWillLoad(){this.tabsChanged(this.tabs)}handleClick(a){a.disabled||(this.activeTab=a.id,this.dropiTabChange.emit(a))}render(){return r("div",{key:"73bb4c928411c00cd9c6cfa6c0ed591c4573bbb1",class:"tabs-container",role:"tablist"},this.parsedTabs.map((a=>{const t=a.id===this.activeTab;return r("div",{role:"tab","aria-selected":String(t),class:{"tab-item":!0,"tab-item--active":t&&!a.disabled,"tab-item--disabled":!!a.disabled},onClick:()=>this.handleClick(a)},r("span",{class:"tab-label-row"},r("span",{class:"tab-label"},a.label),null!=a.counter&&r("span",{class:{"tab-counter":!0,"tab-counter--active":t}},a.counter)),this.showIcon&&(a.completed?r("dropi-icon",{name:"Check-circle",width:"12px",height:"12px",color:"Success-Success-500"}):r("span",{class:"tab-status-dot"})))})))}static get watchers(){return{tabs:[{tabsChanged:0}]}}};e.style=":host{display:block;width:100%}*,*::before,*::after{box-sizing:border-box}.tabs-container{display:flex;flex-wrap:nowrap;overflow-x:auto;width:100%;height:52px;scrollbar-width:none}.tabs-container::-webkit-scrollbar{width:0;height:0}.tab-item{padding:var(--Size-4,16px) var(--Size-5,20px);background:var(--Neutral-White,#fff);border-bottom:2px solid var(--Gray-Gray-100,#e6eaf2);cursor:pointer;display:flex;gap:16px;align-items:center;white-space:nowrap;flex-shrink:0;transition:border-color 0.15s ease;user-select:none}.tab-item:hover:not(.tab-item--disabled):not(.tab-item--active){border-color:var(--Gray-Gray-300,#a3abbf)}.tab-item--active{border-bottom:2px solid var(--Primary-Primary-500,#f49a3d)}.tab-item--disabled{background:rgba(223,228,237,0.22);cursor:not-allowed;opacity:0.7;pointer-events:none}.tab-label-row{display:flex;align-items:center;gap:8px}.tab-label{font-size:var(--font-size-m,14px);font-weight:var(--font-weight-bold,700);color:var(--Gray-Gray-400,#858ea6);line-height:20px}.tab-item--active .tab-label{color:var(--Gray-Gray-600,#475066)}.tab-item--disabled .tab-label{font-weight:300;color:var(--Gray-Gray-300,#a3abbf)}.tab-counter{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;border-radius:20px;font-size:var(--font-size-xs,10px);font-weight:var(--font-weight-medium,500);background:var(--Gray-Gray-100,#e6eaf2);color:var(--Gray-Gray-500,#69738c)}.tab-counter--active{background:var(--Primary-Primary-100,#fde8d0);color:var(--Primary-Primary-500,#f49a3d)}.tab-status-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background-color:var(--Primary-Primary-500, #f49a3d);flex-shrink:0}";export{e as dropi_tabs}
|
|
@@ -38,7 +38,7 @@ const DropiAccordion = class {
|
|
|
38
38
|
setTimeout(() => this.updateHeight(this.open), 0);
|
|
39
39
|
}
|
|
40
40
|
render() {
|
|
41
|
-
return (h("div", { key: '
|
|
41
|
+
return (h("div", { key: 'af11e06f8e10d85d6dffdbcb639479ce7095ed6e', class: { 'accordion': true, 'accordion--open': this.open, 'accordion--disabled': this.disabled } }, h("button", { key: '5c3e5303dc6e5a37dece808559dcf6a8c6245980', class: "accordion-header", onClick: () => this.handleToggle(), "aria-expanded": String(this.open), disabled: this.disabled }, h("span", { key: '062be2726403e5b9d90694555317db406c70d93f', class: "accordion-header-left" }, this.preIcon && h("dropi-icon", { key: 'c626c98aaab3074cdf754460d5eff45739683404', name: this.preIcon, width: "20px", height: "20px", color: "Gray-Gray-600" }), h("span", { key: '3143e043a462df9e2b794fd2ff608ab910972a54', class: "accordion-title" }, this.header)), h("span", { key: '3ffd80e303fa17582b57a0778b2bc610c6dff899', class: { 'accordion-chevron': true, 'accordion-chevron--open': this.open } }, h("dropi-icon", { key: 'b353a6cbfbd3b51d408ced11c29eeb8a8cded9a6', name: "Dropdown-down", width: "20px", height: "20px", color: "Gray-Gray-500" }))), h("div", { key: '0754969bc5483586224ddb3774f65328dd8cd3cb', class: "accordion-body", style: { maxHeight: this.contentHeight }, ref: (el) => this.contentRef = el }, h("div", { key: '96e87adb7ca8de258541be0d4626ba9ce09e1f97', class: "accordion-content" }, h("slot", { key: '5b82c186bc11b7e9e5a714217454c0c6058be5cf' })))));
|
|
42
42
|
}
|
|
43
43
|
static get watchers() { return {
|
|
44
44
|
"open": [{
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-Twbb5MNM.js';
|
|
2
|
+
|
|
3
|
+
const dropiAlertCss = () => `:host{display:block;width:100%}*,*::before,*::after{box-sizing:border-box}.alert{display:flex;align-items:flex-start;gap:var(--Size-2, 8px);padding:var(--Size-3, 12px) var(--Size-4, 16px);border-radius:var(--Border-2, 8px);border:1px solid transparent;width:100%;animation:fadeIn 0.3s ease-in-out}@keyframes fadeIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.alert--success{background:var(--Success-Success-50, #f0fdf4);border-color:var(--Success-Success-200, #bbf7d0)}.alert--error{background:var(--Error-Error-50, #fff5f5);border-color:var(--Error-Error-200, #fecaca)}.alert--warning{background:var(--Warning-Warning-50, #fffbeb);border-color:var(--Warning-Warning-200, #fde68a)}.alert--info{background:var(--Info-Info-50, #eff6ff);border-color:var(--Info-Info-200, #bfdbfe)}.alert--flag{border-left-width:4px;border-radius:0 var(--Border-2, 8px) var(--Border-2, 8px) 0}.alert__icon{display:flex;align-items:center;flex-shrink:0;padding-top:1px}.alert__body{flex:1;display:flex;flex-wrap:wrap;align-items:center;gap:var(--Size-1, 4px)}.alert__message{font-size:var(--font-size-s, 12px);color:var(--Gray-Gray-700, #32394d);line-height:1.5}.alert__link{font-size:var(--font-size-s, 12px);font-weight:var(--font-weight-bold, 700);color:var(--Primary-Primary-500, #f49a3d);text-decoration:underline;cursor:pointer}.alert__actions{display:flex;align-items:center;gap:var(--Size-2, 8px);flex-shrink:0}.alert__btn{height:28px;padding:0 var(--Size-3, 12px);border-radius:var(--Border-2, 8px);border:1px solid var(--Primary-Primary-500, #f49a3d);background:transparent;color:var(--Primary-Primary-500, #f49a3d);font-size:var(--font-size-xs, 10px);font-family:inherit;font-weight:var(--font-weight-bold, 700);cursor:pointer;transition:background 0.15s, color 0.15s}.alert__btn:hover{background:var(--Primary-Primary-500, #f49a3d);color:var(--Neutral-White, #fff)}.alert__close{display:flex;align-items:center;justify-content:center;background:none;border:none;padding:0;cursor:pointer;opacity:0.6;transition:opacity 0.15s}.alert__close:hover{opacity:1}`;
|
|
4
|
+
|
|
5
|
+
const STATE_ICONS = {
|
|
6
|
+
success: 'Check-circle',
|
|
7
|
+
error: 'Warning-circle',
|
|
8
|
+
warning: 'Warning-triangle',
|
|
9
|
+
info: 'Info-circle',
|
|
10
|
+
};
|
|
11
|
+
const STATE_COLORS = {
|
|
12
|
+
success: 'Success-Success-500',
|
|
13
|
+
error: 'Error-Error-500',
|
|
14
|
+
warning: 'Warning-Warning-500',
|
|
15
|
+
info: 'Info-Info-500',
|
|
16
|
+
};
|
|
17
|
+
const DropiAlert = class {
|
|
18
|
+
constructor(hostRef) {
|
|
19
|
+
registerInstance(this, hostRef);
|
|
20
|
+
this.dropiClose = createEvent(this, "dropiClose");
|
|
21
|
+
this.dropiButtonClick = createEvent(this, "dropiButtonClick");
|
|
22
|
+
this.dropiLinkClick = createEvent(this, "dropiLinkClick");
|
|
23
|
+
}
|
|
24
|
+
/** Alert message text (supports plain text) */
|
|
25
|
+
message = '';
|
|
26
|
+
/** Layout type: default (inline) | flag (accented left border) */
|
|
27
|
+
type = 'default';
|
|
28
|
+
/** Semantic state */
|
|
29
|
+
state = 'info';
|
|
30
|
+
/** Show the × close button */
|
|
31
|
+
dismissable = false;
|
|
32
|
+
/** Show action button */
|
|
33
|
+
showButton = false;
|
|
34
|
+
/** Action button label */
|
|
35
|
+
buttonText = '';
|
|
36
|
+
/** Anchor/link label */
|
|
37
|
+
anchorText = '';
|
|
38
|
+
/** Anchor href */
|
|
39
|
+
anchorUrl = '';
|
|
40
|
+
/** Whether the alert is visible */
|
|
41
|
+
showAlert = true;
|
|
42
|
+
/** Emitted when the alert is dismissed */
|
|
43
|
+
dropiClose;
|
|
44
|
+
/** Emitted when the action button is clicked */
|
|
45
|
+
dropiButtonClick;
|
|
46
|
+
/** Emitted when the anchor link is clicked */
|
|
47
|
+
dropiLinkClick;
|
|
48
|
+
render() {
|
|
49
|
+
if (!this.showAlert)
|
|
50
|
+
return null;
|
|
51
|
+
return (h("div", { class: { 'alert': true, [`alert--${this.type}`]: true, [`alert--${this.state}`]: true } }, h("div", { class: "alert__icon" }, h("dropi-icon", { name: STATE_ICONS[this.state], width: "18px", height: "18px", color: STATE_COLORS[this.state] })), h("div", { class: "alert__body" }, h("span", { class: "alert__message" }, this.message), this.anchorText && (h("a", { class: "alert__link", href: this.anchorUrl || '#', onClick: (e) => { e.preventDefault(); this.dropiLinkClick.emit(); } }, this.anchorText))), h("div", { class: "alert__actions" }, this.showButton && this.buttonText && (h("button", { class: "alert__btn", onClick: () => this.dropiButtonClick.emit() }, this.buttonText)), this.dismissable && (h("button", { class: "alert__close", onClick: () => { this.showAlert = false; this.dropiClose.emit(); }, "aria-label": "Cerrar" }, h("dropi-icon", { name: "Close-small", width: "18px", height: "18px", color: "Gray-Gray-500" }))))));
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
DropiAlert.style = dropiAlertCss();
|
|
55
|
+
|
|
56
|
+
export { DropiAlert as dropi_alert };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-Twbb5MNM.js';
|
|
2
|
+
|
|
3
|
+
const dropiAvatarsCss = () => `:host{display:inline-block}.avatar{margin:0;padding:0;display:flex;align-items:center;justify-content:center;border-radius:50%;overflow:hidden;flex-shrink:0}.avatar img{width:100%;height:100%;object-fit:cover;border-radius:50%}.avatar--users,.avatar--transport,.avatar--payment{width:35px;height:35px}.avatar--supplier{width:70px;height:70px}.avatar--counter{width:33px;height:33px}.avatar__initials{display:flex;align-items:center;justify-content:center;width:100%;height:100%;border-radius:50%;background-color:var(--Primary-Primary-100, #fde9d0);color:var(--Primary-Primary-600, #d4872e);font-size:var(--font-size-xs, 10px);font-weight:var(--font-weight-bold, 700);text-transform:uppercase;letter-spacing:0.5px}`;
|
|
4
|
+
|
|
5
|
+
const FALLBACK = `data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzNiAzNiI+PGNpcmNsZSBjeD0iMTgiIGN5PSIxOCIgcj0iMTgiIGZpbGw9IiNlNmVhZjIiLz48Y2lyY2xlIGN4PSIxOCIgY3k9IjE0IiByPSI2IiBmaWxsPSIjODU4ZWE2Ii8+PHBhdGggZD0iTTYgMzJjMC04IDI0LTggMjQgMCIgZmlsbD0iIzg1OGVhNiIvPjwvc3ZnPg==`;
|
|
6
|
+
const DropiAvatars = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
}
|
|
10
|
+
/** Image URL */
|
|
11
|
+
image = '';
|
|
12
|
+
/** Alt text for the image */
|
|
13
|
+
alt = 'avatar';
|
|
14
|
+
/** Size/context variant */
|
|
15
|
+
type = 'users';
|
|
16
|
+
/** Initials to show when no image (max 2 chars) */
|
|
17
|
+
initials = '';
|
|
18
|
+
handleError(e) {
|
|
19
|
+
e.target.src = FALLBACK;
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
const displayInitials = this.initials?.slice(0, 2).toUpperCase();
|
|
23
|
+
const showInitials = !this.image && displayInitials;
|
|
24
|
+
return (h("figure", { key: '5bce853f6d1d17dcad603cf103d6de09ae612147', class: { 'avatar': true, [`avatar--${this.type}`]: true } }, showInitials ? (h("div", { class: "avatar__initials" }, displayInitials)) : (h("img", { src: this.image || FALLBACK, alt: this.alt, onError: (e) => this.handleError(e) }))));
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
DropiAvatars.style = dropiAvatarsCss();
|
|
28
|
+
|
|
29
|
+
export { DropiAvatars as dropi_avatars };
|
|
@@ -27,7 +27,7 @@ const DropiBadge = class {
|
|
|
27
27
|
return null;
|
|
28
28
|
}
|
|
29
29
|
render() {
|
|
30
|
-
return (h("div", { key: '
|
|
30
|
+
return (h("div", { key: '7a043420848f083d161765c16da41dc1f7c38065', class: `tag-state ${this.state}` }, this.renderIcon(), h("p", { key: '4227bf47f3169673f44b62bde46498e3c8d607cd' }, this.stateText[this.state])));
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
DropiBadge.style = dropiBadgeCss();
|
|
@@ -64,14 +64,14 @@ const DropiButton = class {
|
|
|
64
64
|
const hasText = this.text !== '';
|
|
65
65
|
const showPostIcon = this.postIcon !== '' || this.type === 'dropdown';
|
|
66
66
|
const dropdownIcon = this.type === 'dropdown' ? 'Dropdown-down' : this.postIcon;
|
|
67
|
-
return (h("button", { key: '
|
|
67
|
+
return (h("button", { key: '893717e317f10193bfa723d65607fc79e5875309', class: {
|
|
68
68
|
btn: true,
|
|
69
69
|
'without-text': !hasText,
|
|
70
70
|
[this.severity]: true,
|
|
71
71
|
[this.type]: true,
|
|
72
72
|
[this.size]: true,
|
|
73
73
|
[this.state]: true,
|
|
74
|
-
}, disabled: isDisabled, onClick: (e) => this.handleClick(e) }, this.preIcon && (h("dropi-icon", { key: '
|
|
74
|
+
}, disabled: isDisabled, onClick: (e) => this.handleClick(e) }, this.preIcon && (h("dropi-icon", { key: '922e32f5466164279fdb9408502412d4246ee1f2', name: this.preIcon, width: this.iconSize, height: this.iconSize, color: this.fontColor })), hasText && h("span", { key: '9b8c506a5e4a791bde84d36e2991386ee2a3822f', class: "text" }, this.text), showPostIcon && (h("dropi-icon", { key: 'c1f66fba38426ff724450a806c99939ffaca0c75', name: dropdownIcon, width: this.iconSize, height: this.iconSize, color: this.fontColor })), this.state === 'loading' && this.renderLoadingSpinner(), h("slot", { key: 'af5cc164403ec0592f4740368784c343e38a0227' })));
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
77
|
DropiButton.style = dropiButtonCss();
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-Twbb5MNM.js';
|
|
2
|
+
|
|
3
|
+
const dropiCardSectionCss = () => `:host{display:block;width:100%}*,*::before,*::after{box-sizing:border-box}.card-section{display:flex;align-items:center;justify-content:space-between;gap:var(--Size-4, 16px);padding:var(--Size-3, 12px) var(--Size-4, 16px);background:var(--Neutral-White, #fff);border:1px solid var(--Gray-Gray-100, #e6eaf2);border-radius:var(--Border-2, 8px)}.card-section__text{flex:1}.card-section__title{margin:0 0 4px;font-family:inherit;font-weight:var(--font-weight-bold, 700);color:var(--Gray-Gray-800, #1a2033)}h5.card-section__title{font-size:var(--font-size-m, 14px)}h6.card-section__title{font-size:var(--font-size-s, 12px)}.card-section__desc{margin:0;font-size:var(--font-size-xs, 10px);color:var(--Gray-Gray-500, #69738c)}.card-section__control{flex-shrink:0}.card-section__dropdown-btn{display:flex;align-items:center;background:none;border:none;padding:0;cursor:pointer}`;
|
|
4
|
+
|
|
5
|
+
const DropiCardSection = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.dropiChange = createEvent(this, "dropiChange");
|
|
9
|
+
this.dropiClick = createEvent(this, "dropiClick");
|
|
10
|
+
}
|
|
11
|
+
/** Section title */
|
|
12
|
+
sectionTitle = '';
|
|
13
|
+
/** Section description */
|
|
14
|
+
description = '';
|
|
15
|
+
/** Control type on the right */
|
|
16
|
+
typeElement = 'switch';
|
|
17
|
+
/** Title size variant */
|
|
18
|
+
type = 'medium';
|
|
19
|
+
/** Switch checked state */
|
|
20
|
+
isChecked = false;
|
|
21
|
+
/** Emitted when switch changes. e.detail = new boolean value */
|
|
22
|
+
dropiChange;
|
|
23
|
+
/** Emitted when dropdown icon is clicked */
|
|
24
|
+
dropiClick;
|
|
25
|
+
render() {
|
|
26
|
+
return (h("div", { key: '5820426132998a0fcc95ec9bc5626044809bc8f9', class: "card-section" }, h("div", { key: '56023483c0be283b4e8b71bdb8ab91c3bbe0e518', class: "card-section__text" }, this.type === 'important'
|
|
27
|
+
? h("h5", { class: "card-section__title card-section__title--important" }, this.sectionTitle)
|
|
28
|
+
: h("h6", { class: "card-section__title" }, this.sectionTitle), this.description && h("p", { key: '123f616e6404040a052c8e3313ea74368ef1564e', class: "card-section__desc" }, this.description)), h("div", { key: '70d91f09bfe12b561a0457d6b1c531e04c697119', class: "card-section__control" }, this.typeElement === 'switch' ? (h("dropi-switch", { isChecked: this.isChecked, onDropiChange: (e) => {
|
|
29
|
+
this.isChecked = e.detail;
|
|
30
|
+
this.dropiChange.emit(e.detail);
|
|
31
|
+
} })) : (h("button", { class: "card-section__dropdown-btn", onClick: () => this.dropiClick.emit(), "aria-label": "Expandir" }, h("dropi-icon", { name: "Dropdown-down", width: "20px", height: "20px", color: "Gray-Gray-500" }))))));
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
DropiCardSection.style = dropiCardSectionCss();
|
|
35
|
+
|
|
36
|
+
export { DropiCardSection as dropi_card_section };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-Twbb5MNM.js';
|
|
2
|
+
|
|
3
|
+
const dropiCheckboxSelectionListCss = () => `:host{display:block;width:100%}*,*::before,*::after{box-sizing:border-box}.csl__search{display:flex;align-items:center;gap:var(--Size-2, 8px);padding:var(--Size-2, 8px) var(--Size-3, 12px);border:1px solid var(--Gray-Gray-200, #c3c9d9);border-radius:var(--Border-2, 8px);margin-bottom:var(--Size-2, 8px)}.csl__search-input{flex:1;border:none;outline:none;font-size:var(--font-size-s, 12px);font-family:inherit;color:var(--Gray-Gray-700, #32394d);background:transparent}.csl__clear{display:flex;background:none;border:none;padding:0;cursor:pointer}.csl__list{display:flex;flex-direction:column}.csl__item{display:flex;align-items:center;gap:var(--Size-2, 8px);padding:var(--Size-2, 8px) var(--Size-3, 12px);cursor:pointer;border-radius:var(--Border-1, 4px);transition:background 0.15s}.csl__item:hover{background:var(--Gray-Gray-50, #f7f8fa)}.csl__icon{width:24px;height:24px;border-radius:50%;object-fit:cover;flex-shrink:0}.csl__label{font-size:var(--font-size-s, 12px);color:var(--Gray-Gray-700, #32394d);flex:1}.csl__empty{padding:var(--Size-4, 16px);text-align:center;font-size:var(--font-size-s, 12px);color:var(--Gray-Gray-400, #858ea6)}`;
|
|
4
|
+
|
|
5
|
+
const DropiCheckboxSelectionList = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.dropiCheckedValues = createEvent(this, "dropiCheckedValues");
|
|
9
|
+
this.dropiSearch = createEvent(this, "dropiSearch");
|
|
10
|
+
}
|
|
11
|
+
/** Options array or JSON string */
|
|
12
|
+
options = [];
|
|
13
|
+
/** Show search filter */
|
|
14
|
+
showFilter = true;
|
|
15
|
+
/** Search placeholder */
|
|
16
|
+
filterPlaceholder = 'Buscar...';
|
|
17
|
+
/** Show "no results" message */
|
|
18
|
+
showNotFound = true;
|
|
19
|
+
/** Empty state message */
|
|
20
|
+
notFoundMessage = 'Sin resultados';
|
|
21
|
+
/** Allow multiple selection */
|
|
22
|
+
multiSelect = true;
|
|
23
|
+
filterText = '';
|
|
24
|
+
selected = [];
|
|
25
|
+
parsedOptions = [];
|
|
26
|
+
/** Emitted when selection changes. e.detail = selected option ids */
|
|
27
|
+
dropiCheckedValues;
|
|
28
|
+
/** Emitted on search input. e.detail = search text */
|
|
29
|
+
dropiSearch;
|
|
30
|
+
optionsChanged(val) {
|
|
31
|
+
this.parsedOptions = typeof val === 'string' ? JSON.parse(val) : (val || []);
|
|
32
|
+
}
|
|
33
|
+
componentWillLoad() { this.optionsChanged(this.options); }
|
|
34
|
+
get filtered() {
|
|
35
|
+
if (!this.filterText)
|
|
36
|
+
return this.parsedOptions;
|
|
37
|
+
const q = this.filterText.toLowerCase();
|
|
38
|
+
return this.parsedOptions.filter(o => o.name?.toLowerCase().includes(q));
|
|
39
|
+
}
|
|
40
|
+
toggle(id) {
|
|
41
|
+
if (this.multiSelect) {
|
|
42
|
+
this.selected = this.selected.includes(id)
|
|
43
|
+
? this.selected.filter(s => s !== id)
|
|
44
|
+
: [...this.selected, id];
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
this.selected = this.selected.includes(id) ? [] : [id];
|
|
48
|
+
}
|
|
49
|
+
this.dropiCheckedValues.emit(this.selected);
|
|
50
|
+
}
|
|
51
|
+
render() {
|
|
52
|
+
const items = this.filtered;
|
|
53
|
+
return (h("div", { key: '4606e983827d32c18990c44589c2cfcac678b0ae', class: "csl" }, this.showFilter && (h("div", { key: '532d95a9e0530023094611ce55b37f56eb6f9d78', class: "csl__search" }, h("dropi-icon", { key: '79598d6cb8b36f90e15d2983f8c3e54cb713d193', name: "Search", width: "16px", height: "16px", color: "Gray-Gray-400" }), h("input", { key: 'fa95ab8c1112e335560b8c49f7f4b502b3f7b3a0', class: "csl__search-input", type: "text", placeholder: this.filterPlaceholder, value: this.filterText, onInput: (e) => {
|
|
54
|
+
this.filterText = e.target.value;
|
|
55
|
+
this.dropiSearch.emit(this.filterText);
|
|
56
|
+
} }), this.filterText && (h("button", { key: '94574b93a5e1d938ebedd7f462e3aed6917390ef', class: "csl__clear", onClick: () => { this.filterText = ''; this.dropiSearch.emit(''); } }, h("dropi-icon", { key: 'c9765efda527f9321757a69028f9ceb7e12a7514', name: "Close-small", width: "14px", height: "14px", color: "Gray-Gray-400" }))))), h("div", { key: '2f40c32f10c84277924c240a12e89876ff60a4d2', class: "csl__list" }, items.length === 0 && this.showNotFound ? (h("div", { class: "csl__empty" }, this.notFoundMessage)) : (items.map(opt => {
|
|
57
|
+
const checked = this.selected.includes(opt.id);
|
|
58
|
+
return (h("div", { class: "csl__item", key: opt.id, onClick: () => this.toggle(opt.id) }, h("dropi-checkbox", { checked: checked }), opt.icon && h("img", { class: "csl__icon", src: opt.icon, alt: opt.name }), h("span", { class: "csl__label" }, opt.name)));
|
|
59
|
+
})))));
|
|
60
|
+
}
|
|
61
|
+
static get watchers() { return {
|
|
62
|
+
"options": [{
|
|
63
|
+
"optionsChanged": 0
|
|
64
|
+
}]
|
|
65
|
+
}; }
|
|
66
|
+
};
|
|
67
|
+
DropiCheckboxSelectionList.style = dropiCheckboxSelectionListCss();
|
|
68
|
+
|
|
69
|
+
export { DropiCheckboxSelectionList as dropi_checkbox_selection_list };
|
|
@@ -20,12 +20,12 @@ const DropiCheckbox = class {
|
|
|
20
20
|
this.dropiChange.emit(this.checked);
|
|
21
21
|
}
|
|
22
22
|
render() {
|
|
23
|
-
return (h("div", { key: '
|
|
23
|
+
return (h("div", { key: '4e56a55cec60e55f61205e370845f734b5baedcc', class: "container-dropi-checkbox", onClick: () => this.changeState() }, h("div", { key: 'dd440f791d8fa5dd3fd7e8a00054c2d0fe337961', class: {
|
|
24
24
|
check: true,
|
|
25
25
|
isCheck: this.checked,
|
|
26
26
|
noCheck: !this.checked,
|
|
27
27
|
disabled: this.disabled,
|
|
28
|
-
} }, h("svg", { key: '
|
|
28
|
+
} }, h("svg", { key: 'f7470772cd3f47777c0ade490de8772a4e0a2d43', xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none" }, h("path", { key: 'ed529e987fe524339bb01ee0e95d838df962d0bc', d: "M20.5991 5.69251L9.08325 17.2075C9.00583 17.2852 8.91382 17.3469 8.8125 17.389C8.71118 17.4311 8.60255 17.4527 8.49283 17.4527C8.38312 17.4527 8.27449 17.4311 8.17317 17.389C8.07185 17.3469 7.97984 17.2852 7.90242 17.2075L3.44908 12.75C3.37166 12.6723 3.27965 12.6106 3.17833 12.5685C3.07701 12.5264 2.96838 12.5048 2.85867 12.5048C2.74896 12.5048 2.64032 12.5264 2.53901 12.5685C2.43769 12.6106 2.34568 12.6723 2.26825 12.75C2.19052 12.8274 2.12884 12.9194 2.08676 13.0208C2.04467 13.1221 2.02301 13.2307 2.02301 13.3404C2.02301 13.4501 2.04467 13.5588 2.08676 13.6601C2.12884 13.7614 2.19052 13.8534 2.26825 13.9308L6.72325 18.385C7.19321 18.8541 7.83008 19.1175 8.49408 19.1175C9.15809 19.1175 9.79496 18.8541 10.2649 18.385L21.7799 6.87251C21.8575 6.7951 21.9191 6.70314 21.9611 6.6019C22.0031 6.50065 22.0247 6.39212 22.0247 6.28251C22.0247 6.17289 22.0031 6.06436 21.9611 5.96312C21.9191 5.86188 21.8575 5.76992 21.7799 5.69251C21.7025 5.61478 21.6105 5.5531 21.5092 5.51101C21.4078 5.46893 21.2992 5.44727 21.1895 5.44727C21.0798 5.44727 20.9712 5.46893 20.8698 5.51101C20.7685 5.5531 20.6765 5.61478 20.5991 5.69251Z", fill: "#FFFFFF" })))));
|
|
29
29
|
}
|
|
30
30
|
static get formAssociated() { return true; }
|
|
31
31
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-Twbb5MNM.js';
|
|
2
|
+
|
|
3
|
+
const dropiChipsCss = () => `:host{display:inline-flex}*,*::before,*::after{box-sizing:border-box}.chip{display:inline-flex;align-items:center;gap:var(--Size-1, 4px);height:24px;padding:0 var(--Size-2, 8px);border-radius:var(--Border-2, 8px);font-size:var(--font-size-xs, 10px);font-family:inherit;max-width:200px}.chip--filters{background:var(--Primary-Primary-50, #fff5eb);border:1px solid var(--Primary-Primary-200, #fbd4a3);color:var(--Primary-Primary-600, #d4872e)}.chip--fill{background:var(--Gray-Gray-100, #e6eaf2);border:1px solid transparent;color:var(--Gray-Gray-700, #32394d)}.chip__avatar{width:16px;height:16px;border-radius:50%;object-fit:cover;flex-shrink:0}.chip__text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}.chip__close{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;background:none;border:none;padding:0;cursor:pointer;color:inherit;opacity:0.7;transition:opacity 0.15s}.chip__close:hover{opacity:1}`;
|
|
4
|
+
|
|
5
|
+
const DropiChips = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.dropiClose = createEvent(this, "dropiClose");
|
|
9
|
+
}
|
|
10
|
+
/** Visual style */
|
|
11
|
+
chipStyle = 'filters';
|
|
12
|
+
/** Content type */
|
|
13
|
+
type = 'text';
|
|
14
|
+
/** Avatar image URL (when type = 'avatar') */
|
|
15
|
+
urlImg = '';
|
|
16
|
+
/** Show the close/remove icon */
|
|
17
|
+
showIcon = true;
|
|
18
|
+
/** Icon name (when type = 'icon') */
|
|
19
|
+
icon = '';
|
|
20
|
+
/** Emitted when the close icon is clicked */
|
|
21
|
+
dropiClose;
|
|
22
|
+
render() {
|
|
23
|
+
return (h("div", { key: '06d0ac1f96349389f1513b59a1f84dbff9864169', class: { 'chip': true, [`chip--${this.chipStyle}`]: true } }, this.type === 'avatar' && this.urlImg && (h("img", { key: '38bc54471c0cf6dc7a25cccaba0764573d5d43e1', class: "chip__avatar", src: this.urlImg, alt: "" })), this.type === 'icon' && this.icon && (h("dropi-icon", { key: '908f3b217b425f6a3c9bf242a94110b742ca34b3', class: "chip__pre-icon", name: this.icon, width: "14px", height: "14px", color: "currentColor" })), h("span", { key: 'cb76f76056e6a28cfc497f2fabece2c95d6b9a60', class: "chip__text" }, h("slot", { key: '4d3aade9d8408d2b5b627c43754a9cfafd44b941' })), this.showIcon && (h("button", { key: 'fbb30fa90841e499d21c928c4a319724def58bb2', class: "chip__close", onClick: () => this.dropiClose.emit(), "aria-label": "Eliminar" }, h("dropi-icon", { key: 'f11c820069c550fa7ee3a143c3c6f29d338041c8', name: "Close-small", width: "14px", height: "14px", color: "currentColor" })))));
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
DropiChips.style = dropiChipsCss();
|
|
27
|
+
|
|
28
|
+
export { DropiChips as dropi_chips };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-Twbb5MNM.js';
|
|
2
|
+
|
|
3
|
+
const dropiDropdownCss = () => `:host{display:block;width:100%}*,*::before,*::after{box-sizing:border-box}.dropdown{display:flex;flex-direction:column;overflow-y:auto;max-height:var(--dropdown-height, 300px);border:1px solid var(--Gray-Gray-200, #c3c9d9);border-radius:var(--Border-2, 8px);background:var(--Neutral-White, #fff)}.dropdown__item{display:flex;align-items:center;gap:var(--Size-2, 8px);padding:var(--Size-2, 8px) var(--Size-3, 12px);cursor:pointer;transition:background 0.15s;user-select:none}.dropdown__item:hover{background:var(--Gray-Gray-50, #f7f8fa)}.dropdown__item--active{background:var(--Primary-Primary-50, #fff5eb)}.dropdown__avatar{width:28px;height:28px;border-radius:50%;object-fit:cover;flex-shrink:0}.dropdown__label{flex:1;font-size:var(--font-size-s, 12px);color:var(--Gray-Gray-700, #32394d);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}`;
|
|
4
|
+
|
|
5
|
+
const DropiDropdown = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.dropiChange = createEvent(this, "dropiChange");
|
|
9
|
+
}
|
|
10
|
+
/** Options array or JSON string */
|
|
11
|
+
options = [];
|
|
12
|
+
/** Property name to display as the option label */
|
|
13
|
+
valueModel = 'name';
|
|
14
|
+
/** Property name to use as the option image/avatar URL */
|
|
15
|
+
imageModel = '';
|
|
16
|
+
/** Max height of the list container (CSS value) */
|
|
17
|
+
height = '300px';
|
|
18
|
+
selected = [];
|
|
19
|
+
parsedOptions = [];
|
|
20
|
+
/** Emitted when selection changes. e.detail = selected items array */
|
|
21
|
+
dropiChange;
|
|
22
|
+
optionsChanged(val) {
|
|
23
|
+
this.parsedOptions = typeof val === 'string' ? JSON.parse(val) : (val || []);
|
|
24
|
+
}
|
|
25
|
+
componentWillLoad() {
|
|
26
|
+
this.optionsChanged(this.options);
|
|
27
|
+
}
|
|
28
|
+
isSelected(opt) {
|
|
29
|
+
return this.selected.some(s => JSON.stringify(s) === JSON.stringify(opt));
|
|
30
|
+
}
|
|
31
|
+
toggleOption(opt) {
|
|
32
|
+
if (this.isSelected(opt)) {
|
|
33
|
+
this.selected = this.selected.filter(s => JSON.stringify(s) !== JSON.stringify(opt));
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
this.selected = [...this.selected, opt];
|
|
37
|
+
}
|
|
38
|
+
this.dropiChange.emit(this.selected);
|
|
39
|
+
}
|
|
40
|
+
render() {
|
|
41
|
+
return (h("div", { key: 'e9b2fe1b667a4d83c0d142ff9ba8187d848f606d', class: "dropdown", style: { '--dropdown-height': this.height } }, this.parsedOptions.map((opt, i) => {
|
|
42
|
+
const label = opt[this.valueModel] ?? String(opt);
|
|
43
|
+
const imgUrl = this.imageModel ? opt[this.imageModel] : '';
|
|
44
|
+
const active = this.isSelected(opt);
|
|
45
|
+
return (h("div", { class: { 'dropdown__item': true, 'dropdown__item--active': active }, key: i, onClick: () => this.toggleOption(opt) }, h("dropi-checkbox", { checked: active }), imgUrl && (h("img", { class: "dropdown__avatar", src: imgUrl, alt: label })), h("span", { class: "dropdown__label" }, label)));
|
|
46
|
+
})));
|
|
47
|
+
}
|
|
48
|
+
static get watchers() { return {
|
|
49
|
+
"options": [{
|
|
50
|
+
"optionsChanged": 0
|
|
51
|
+
}]
|
|
52
|
+
}; }
|
|
53
|
+
};
|
|
54
|
+
DropiDropdown.style = dropiDropdownCss();
|
|
55
|
+
|
|
56
|
+
export { DropiDropdown as dropi_dropdown };
|
|
@@ -25,7 +25,7 @@ const DropiEmptyState = class {
|
|
|
25
25
|
/** Emitted when secondary action button is clicked */
|
|
26
26
|
dropiSecondaryAction;
|
|
27
27
|
render() {
|
|
28
|
-
return (h("div", { key: '
|
|
28
|
+
return (h("div", { key: '7c393f2a56387d573162068576809a6f6a975a34', class: "empty-state" }, this.imageUrl ? (h("img", { class: "empty-state-img", src: this.imageUrl, alt: this.imageAlt })) : (h("div", { class: "empty-state-placeholder" }, h("svg", { viewBox: "0 0 80 80", fill: "none", xmlns: "http://www.w3.org/2000/svg", class: "empty-state-svg" }, h("rect", { width: "80", height: "80", rx: "40", fill: "var(--Gray-Gray-100, #e6eaf2)" }), h("path", { d: "M40 20C29 20 20 29 20 40s9 20 20 20 20-9 20-20S51 20 40 20zm0 36c-8.8 0-16-7.2-16-16S31.2 24 40 24s16 7.2 16 16-7.2 16-16 16zm-1-28h2v12h-2zm0 14h2v2h-2z", fill: "var(--Gray-Gray-400, #858ea6)" })))), this.header && h("h3", { key: 'd1fbe8d995e295cb4a72064745e7b521b35bbad6', class: "empty-state-title" }, this.header), this.description && h("p", { key: '948e6bcb6e07fab09261e6f68d658bf1faf17c8e', class: "empty-state-description" }, this.description), h("slot", { key: '8663d0a1e2df4ee914a25a0bda27e5f2ee41a941' }), (this.actionLabel || this.secondaryLabel) && (h("div", { key: 'af582b6316e8ebf2700589b55deef1fe8fbf08f2', class: "empty-state-actions" }, this.secondaryLabel && (h("dropi-button", { key: '1e69d9a9143708157a20dba1179498bd01203af2', text: this.secondaryLabel, severity: "secondary", onDropiClick: () => this.dropiSecondaryAction.emit() })), this.actionLabel && (h("dropi-button", { key: '3850ddf4716b2732bb21ee9fa731e90022b2ecd2', text: this.actionLabel, severity: "primary", onDropiClick: () => this.dropiAction.emit() }))))));
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
DropiEmptyState.style = dropiEmptyStateCss();
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-Twbb5MNM.js';
|
|
2
|
+
|
|
3
|
+
const dropiFavoriteButtonCss = () => `:host{display:inline-flex}.fav-btn{display:flex;align-items:center;justify-content:center;width:37px;height:37px;border-radius:8px;border:1px solid var(--Gray-Gray-200);background:var(--Neutral-White);cursor:pointer;transition:all 0.2s ease-in-out}.fav-btn:hover,.fav-btn--active{background:var(--Gray-Gray-50)}.fav-btn:active{transform:scale(0.95)}`;
|
|
4
|
+
|
|
5
|
+
const DropiFavoriteButton = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.dropiToggleFavorite = createEvent(this, "dropiToggleFavorite");
|
|
9
|
+
}
|
|
10
|
+
/** Whether the item is currently marked as favorite */
|
|
11
|
+
isFavorite = false;
|
|
12
|
+
/** Emitted when toggled. e.detail = new favorite state */
|
|
13
|
+
dropiToggleFavorite;
|
|
14
|
+
hovered = false;
|
|
15
|
+
toggle() {
|
|
16
|
+
this.isFavorite = !this.isFavorite;
|
|
17
|
+
this.dropiToggleFavorite.emit(this.isFavorite);
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
return (h("button", { key: '3920b723683dc337ebe5aedc473414c9ed27a593', class: { 'fav-btn': true, 'fav-btn--active': this.isFavorite }, onClick: () => this.toggle(), onMouseEnter: () => this.hovered = true, onMouseLeave: () => this.hovered = false, "aria-label": this.isFavorite ? 'Quitar de favoritos' : 'Agregar a favoritos', "aria-pressed": String(this.isFavorite) }, h("dropi-icon", { key: '60748aaafd0a183e175fd84c5d44313a0254ed5e', name: this.isFavorite || this.hovered ? 'Heart-solid' : 'Heart', width: "19px", height: "19px", color: this.isFavorite || this.hovered ? 'Primary-Primary-500' : 'Gray-Gray-800' })));
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
DropiFavoriteButton.style = dropiFavoriteButtonCss();
|
|
24
|
+
|
|
25
|
+
export { DropiFavoriteButton as dropi_favorite_button };
|
|
@@ -35,7 +35,7 @@ const DropiIcon = class {
|
|
|
35
35
|
this.el.style.setProperty('--icon-fill', fill);
|
|
36
36
|
}
|
|
37
37
|
render() {
|
|
38
|
-
return (h("svg", { key: '
|
|
38
|
+
return (h("svg", { key: 'd92e0c9deb01962dfb172ae25af4f1236647e24c', width: this.width, height: this.height, class: { spin: this.name === 'Spinner' }, "aria-hidden": "true" }, h("use", { key: '76be21d4bcbb2a5409e0c784cd17c6ca3cd243f6', href: `/assets/icons/symbol/svg/sprite.css.svg#${this.name}` })));
|
|
39
39
|
}
|
|
40
40
|
static get watchers() { return {
|
|
41
41
|
"color": [{
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-Twbb5MNM.js';
|
|
2
|
+
|
|
3
|
+
const dropiImageMiniatureCss = () => `:host{display:block}*,*::before,*::after{box-sizing:border-box}.miniature__label{display:block;font-size:var(--font-size-xs, 10px);color:var(--Gray-Gray-600, #475066);margin-bottom:var(--Size-2, 8px)}.miniature__grid{display:flex;flex-wrap:wrap;gap:var(--Size-2, 8px)}.miniature__item{position:relative;border-radius:var(--Border-2, 8px);overflow:hidden;cursor:pointer;flex-shrink:0}.miniature__item img{width:100%;height:100%;object-fit:cover;display:block;transition:transform 0.2s}.miniature__zoom{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,0.35);opacity:0;transition:opacity 0.2s}.miniature__item:hover img{transform:scale(1.05)}.miniature__item:hover .miniature__zoom{opacity:1}`;
|
|
4
|
+
|
|
5
|
+
const DropiImageMiniature = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.dropiImageClick = createEvent(this, "dropiImageClick");
|
|
9
|
+
}
|
|
10
|
+
/** Optional label above the grid */
|
|
11
|
+
label = '';
|
|
12
|
+
/** Array of image URLs. Pass as JSON string or array */
|
|
13
|
+
images = [];
|
|
14
|
+
/** Thumbnail width (CSS value) */
|
|
15
|
+
width = '88px';
|
|
16
|
+
/** Thumbnail height (CSS value) */
|
|
17
|
+
height = '88px';
|
|
18
|
+
/** Emitted when a thumbnail is clicked. e.detail = { images, index } */
|
|
19
|
+
dropiImageClick;
|
|
20
|
+
get parsedImages() {
|
|
21
|
+
if (typeof this.images === 'string') {
|
|
22
|
+
try {
|
|
23
|
+
return JSON.parse(this.images);
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return this.images || [];
|
|
30
|
+
}
|
|
31
|
+
handleError(e) {
|
|
32
|
+
e.target.src =
|
|
33
|
+
`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4OCA4OCI+PHJlY3Qgd2lkdGg9Ijg4IiBoZWlnaHQ9Ijg4IiBmaWxsPSIjZjdmOGZhIi8+PHRleHQgeD0iNDQiIHk9IjQ4IiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmaWxsPSIjYzNjOWQ5IiBmb250LXNpemU9IjEyIj5TaW4gaW1hZ2VuPC90ZXh0Pjwvc3ZnPg==`;
|
|
34
|
+
}
|
|
35
|
+
render() {
|
|
36
|
+
const imgs = this.parsedImages;
|
|
37
|
+
return (h("div", { key: '5182a02b3f7da5b1440230c87c8661f5f33bb7be', class: "miniature" }, this.label && h("span", { key: 'bf649e5c27972799d600df583c0953938a1cacad', class: "miniature__label" }, this.label), h("div", { key: '7197ca2d4bbf5d65db4ca71addcf352045734d94', class: "miniature__grid" }, imgs.map((src, i) => (h("div", { class: "miniature__item", style: { width: this.width, height: this.height }, key: i, onClick: () => this.dropiImageClick.emit({ images: imgs, index: i }) }, h("img", { src: src, alt: `imagen ${i + 1}`, loading: "lazy", onError: (e) => this.handleError(e) }), h("div", { class: "miniature__zoom" }, h("dropi-icon", { name: "Search", width: "16px", height: "16px", color: "Neutral-White" }))))))));
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
DropiImageMiniature.style = dropiImageMiniatureCss();
|
|
41
|
+
|
|
42
|
+
export { DropiImageMiniature as dropi_image_miniature };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-Twbb5MNM.js';
|
|
2
|
+
|
|
3
|
+
const dropiImageOverlayCss = () => `:host{display:block}.overlay{position:fixed;inset:0;background:rgba(0,0,0,0.92);display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:9999;gap:var(--Size-3, 12px)}.overlay__close{position:absolute;top:var(--Size-4, 16px);right:var(--Size-4, 16px);background:rgba(255,255,255,0.1);border:none;border-radius:50%;width:40px;height:40px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background 0.15s}.overlay__close:hover{background:rgba(255,255,255,0.2)}.overlay__main{position:relative;display:flex;align-items:center;gap:var(--Size-3, 12px);max-width:90vw;max-height:75vh}.overlay__image{max-width:80vw;max-height:72vh;object-fit:contain;border-radius:var(--Border-2, 8px)}.overlay__nav{background:rgba(255,255,255,0.1);border:none;border-radius:50%;width:44px;height:44px;display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;transition:background 0.15s}.overlay__nav:hover{background:rgba(255,255,255,0.2)}.overlay__thumbs{display:flex;gap:var(--Size-2, 8px);flex-wrap:wrap;justify-content:center;max-width:90vw}.overlay__thumb{width:56px;height:56px;object-fit:cover;border-radius:var(--Border-1, 4px);cursor:pointer;opacity:0.5;border:2px solid transparent;transition:opacity 0.15s, border-color 0.15s}.overlay__thumb:hover{opacity:0.8}.overlay__thumb--active{opacity:1;border-color:var(--Primary-Primary-500, #f49a3d)}`;
|
|
4
|
+
|
|
5
|
+
const DropiImageOverlay = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.dropiClose = createEvent(this, "dropiClose");
|
|
9
|
+
}
|
|
10
|
+
/** Whether the overlay is visible */
|
|
11
|
+
visible = false;
|
|
12
|
+
/** Images array or JSON string */
|
|
13
|
+
images = [];
|
|
14
|
+
/** Initially active image index */
|
|
15
|
+
activeIndex = 0;
|
|
16
|
+
current = 0;
|
|
17
|
+
parsedImages = [];
|
|
18
|
+
/** Emitted when overlay closes */
|
|
19
|
+
dropiClose;
|
|
20
|
+
imagesChanged(val) {
|
|
21
|
+
this.parsedImages = typeof val === 'string' ? JSON.parse(val) : (val || []);
|
|
22
|
+
}
|
|
23
|
+
indexChanged(val) { this.current = val; }
|
|
24
|
+
visibleChanged(val) {
|
|
25
|
+
if (val)
|
|
26
|
+
this.current = this.activeIndex;
|
|
27
|
+
}
|
|
28
|
+
componentWillLoad() {
|
|
29
|
+
this.imagesChanged(this.images);
|
|
30
|
+
this.current = this.activeIndex;
|
|
31
|
+
}
|
|
32
|
+
close() { this.visible = false; this.dropiClose.emit(); }
|
|
33
|
+
prev() { this.current = (this.current - 1 + this.parsedImages.length) % this.parsedImages.length; }
|
|
34
|
+
next() { this.current = (this.current + 1) % this.parsedImages.length; }
|
|
35
|
+
handleError(e) {
|
|
36
|
+
e.target.src =
|
|
37
|
+
`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MDAgMzAwIj48cmVjdCB3aWR0aD0iNDAwIiBoZWlnaHQ9IjMwMCIgZmlsbD0iIzFhMjAzMyIvPjx0ZXh0IHg9IjIwMCIgeT0iMTU1IiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmaWxsPSIjNDc1MDY2IiBmb250LXNpemU9IjE0Ij5TaW4gaW1hZ2VuPC90ZXh0Pjwvc3ZnPg==`;
|
|
38
|
+
}
|
|
39
|
+
render() {
|
|
40
|
+
if (!this.visible)
|
|
41
|
+
return null;
|
|
42
|
+
const imgs = this.parsedImages;
|
|
43
|
+
const multi = imgs.length > 1;
|
|
44
|
+
return (h("div", { class: "overlay", onClick: () => this.close() }, h("button", { class: "overlay__close", onClick: (e) => { e.stopPropagation(); this.close(); }, "aria-label": "Cerrar" }, h("dropi-icon", { name: "Close-small", width: "24px", height: "24px", color: "Neutral-White" })), h("div", { class: "overlay__main", onClick: (e) => e.stopPropagation() }, multi && (h("button", { class: "overlay__nav overlay__nav--prev", onClick: () => this.prev(), "aria-label": "Anterior" }, h("dropi-icon", { name: "Dropdown-left", width: "24px", height: "24px", color: "Neutral-White" }))), h("img", { class: "overlay__image", src: imgs[this.current], alt: `imagen ${this.current + 1}`, onError: (e) => this.handleError(e) }), multi && (h("button", { class: "overlay__nav overlay__nav--next", onClick: () => this.next(), "aria-label": "Siguiente" }, h("dropi-icon", { name: "Dropdown-Right", width: "24px", height: "24px", color: "Neutral-White" })))), multi && (h("div", { class: "overlay__thumbs", onClick: (e) => e.stopPropagation() }, imgs.map((src, i) => (h("img", { key: i, class: { 'overlay__thumb': true, 'overlay__thumb--active': i === this.current }, src: src, alt: `miniatura ${i + 1}`, onClick: () => this.current = i, onError: (e) => this.handleError(e) })))))));
|
|
45
|
+
}
|
|
46
|
+
static get watchers() { return {
|
|
47
|
+
"images": [{
|
|
48
|
+
"imagesChanged": 0
|
|
49
|
+
}],
|
|
50
|
+
"activeIndex": [{
|
|
51
|
+
"indexChanged": 0
|
|
52
|
+
}],
|
|
53
|
+
"visible": [{
|
|
54
|
+
"visibleChanged": 0
|
|
55
|
+
}]
|
|
56
|
+
}; }
|
|
57
|
+
};
|
|
58
|
+
DropiImageOverlay.style = dropiImageOverlayCss();
|
|
59
|
+
|
|
60
|
+
export { DropiImageOverlay as dropi_image_overlay };
|