@dropi/ui 0.1.43 → 0.1.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/dropi-button.cjs.entry.js +19 -2
- package/dist/cjs/dropi-checkbox.cjs.entry.js +23 -2
- package/dist/cjs/dropi-country-selector.cjs.entry.js +15 -2
- package/dist/cjs/dropi-date-picker.cjs.entry.js +40 -4
- package/dist/cjs/dropi-input_3.cjs.entry.js +3 -3
- package/dist/cjs/dropi-otp-send-code.cjs.entry.js +22 -2
- package/dist/cjs/dropi-phone-input.cjs.entry.js +25 -2
- package/dist/cjs/dropi-radio-button.cjs.entry.js +18 -1
- package/dist/cjs/dropi-select.cjs.entry.js +1 -1
- package/dist/cjs/dropi-switch.cjs.entry.js +22 -1
- package/dist/cjs/dropi-text-area.cjs.entry.js +3 -3
- package/dist/cjs/dropi-ui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/dropi-button/dropi-button.js +39 -2
- package/dist/collection/components/dropi-checkbox/dropi-checkbox.js +38 -2
- package/dist/collection/components/dropi-country-selector/dropi-country-selector.js +29 -2
- package/dist/collection/components/dropi-date-picker/dropi-date-picker.js +55 -4
- package/dist/collection/components/dropi-input/dropi-input.js +4 -4
- package/dist/collection/components/dropi-otp-send-code/dropi-otp-send-code.js +36 -2
- package/dist/collection/components/dropi-phone-input/dropi-phone-input.js +39 -2
- package/dist/collection/components/dropi-radio-button/dropi-radio-button.js +13 -2
- package/dist/collection/components/dropi-select/dropi-select.js +2 -2
- package/dist/collection/components/dropi-switch/dropi-switch.js +37 -1
- package/dist/collection/components/dropi-text-area/dropi-text-area.js +4 -4
- package/dist/components/dropi-alert-modal.js +1 -1
- package/dist/components/dropi-button.js +1 -1
- package/dist/components/dropi-card-checkbox.js +1 -1
- package/dist/components/dropi-card-section.js +1 -1
- package/dist/components/dropi-checkbox-selection-list.js +1 -1
- package/dist/components/dropi-checkbox.js +1 -1
- package/dist/components/dropi-country-selector.js +1 -1
- package/dist/components/dropi-date-picker.js +1 -1
- package/dist/components/dropi-dropdown.js +1 -1
- package/dist/components/dropi-empty-state.js +1 -1
- package/dist/components/dropi-file-upload.js +1 -1
- package/dist/components/dropi-input.js +1 -1
- package/dist/components/dropi-otp-send-code.js +1 -1
- package/dist/components/dropi-phone-input.js +1 -1
- package/dist/components/dropi-radio-button.js +1 -1
- package/dist/components/dropi-search.js +1 -1
- package/dist/components/dropi-select.js +1 -1
- package/dist/components/dropi-switch.js +1 -1
- package/dist/components/dropi-table.js +1 -1
- package/dist/components/dropi-text-area.js +1 -1
- package/dist/components/p-CCZ6rIo5.js +1 -0
- package/dist/components/p-Dd1g1gjR.js +1 -0
- package/dist/components/p-Dnx3uXgo.js +1 -0
- package/dist/components/p-Qrac2GRu.js +1 -0
- package/dist/dropi-ui/dropi-button.entry.js +19 -2
- package/dist/dropi-ui/dropi-button.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-checkbox.entry.js +23 -2
- package/dist/dropi-ui/dropi-checkbox.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-country-selector.entry.js +15 -2
- package/dist/dropi-ui/dropi-country-selector.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-date-picker.entry.js +40 -4
- package/dist/dropi-ui/dropi-date-picker.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-input.entry.js +3 -3
- package/dist/dropi-ui/dropi-input.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-otp-send-code.entry.js +22 -2
- package/dist/dropi-ui/dropi-otp-send-code.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-phone-input.entry.js +25 -2
- package/dist/dropi-ui/dropi-phone-input.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-radio-button.entry.js +18 -1
- package/dist/dropi-ui/dropi-radio-button.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-select.entry.js +1 -1
- package/dist/dropi-ui/dropi-select.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-switch.entry.js +22 -1
- package/dist/dropi-ui/dropi-switch.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-text-area.entry.js +3 -3
- package/dist/dropi-ui/dropi-text-area.entry.js.map +1 -1
- package/dist/dropi-ui/dropi-ui.esm.js +1 -1
- package/dist/dropi-ui/p-09462f7b.entry.js +1 -0
- package/dist/dropi-ui/p-42a85ce5.entry.js +1 -0
- package/dist/dropi-ui/p-43e21ed8.entry.js +1 -0
- package/dist/dropi-ui/p-532136cc.entry.js +1 -0
- package/dist/dropi-ui/p-9a569a4e.entry.js +1 -0
- package/dist/dropi-ui/p-b2e8c0e2.entry.js +1 -0
- package/dist/dropi-ui/p-bc6bb893.entry.js +1 -0
- package/dist/dropi-ui/p-c08b8995.entry.js +1 -0
- package/dist/dropi-ui/p-c6926604.entry.js +1 -0
- package/dist/dropi-ui/p-eaa10fe8.entry.js +1 -0
- package/dist/dropi-ui/p-fb4856ea.entry.js +1 -0
- package/dist/esm/dropi-button.entry.js +19 -2
- package/dist/esm/dropi-checkbox.entry.js +23 -2
- package/dist/esm/dropi-country-selector.entry.js +15 -2
- package/dist/esm/dropi-date-picker.entry.js +40 -4
- package/dist/esm/dropi-input_3.entry.js +3 -3
- package/dist/esm/dropi-otp-send-code.entry.js +22 -2
- package/dist/esm/dropi-phone-input.entry.js +25 -2
- package/dist/esm/dropi-radio-button.entry.js +18 -1
- package/dist/esm/dropi-select.entry.js +1 -1
- package/dist/esm/dropi-switch.entry.js +22 -1
- package/dist/esm/dropi-text-area.entry.js +3 -3
- package/dist/esm/dropi-ui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/dropi-button/dropi-button.d.ts +4 -0
- package/dist/types/components/dropi-checkbox/dropi-checkbox.d.ts +5 -0
- package/dist/types/components/dropi-country-selector/dropi-country-selector.d.ts +3 -0
- package/dist/types/components/dropi-date-picker/dropi-date-picker.d.ts +6 -0
- package/dist/types/components/dropi-otp-send-code/dropi-otp-send-code.d.ts +3 -0
- package/dist/types/components/dropi-phone-input/dropi-phone-input.d.ts +5 -0
- package/dist/types/components/dropi-radio-button/dropi-radio-button.d.ts +3 -0
- package/dist/types/components/dropi-switch/dropi-switch.d.ts +5 -0
- package/dist/types/components.d.ts +109 -4
- package/hydrate/index.js +218 -43
- package/hydrate/index.mjs +218 -43
- package/package.json +1 -1
- package/readme.md +225 -6
- package/skills/update-context/skill.md +37 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as t,h as i}from"./p-B-h7fjQz.js";const o=class{constructor(i){e(this,i),this.dropiChange=t(this,"dropiChange"),i.$hostElement$["s-ei"]?this.internals=i.$hostElement$["s-ei"]:(this.internals=i.$hostElement$.attachInternals(),i.$hostElement$["s-ei"]=this.internals)}internals;name="";isChecked=!1;disabled=!1;dropiChange;checkedChanged(e){this.internals.setFormValue(e?"on":null)}componentWillLoad(){this.internals.setFormValue(this.isChecked?"on":null)}onToggleChange(e){this.isChecked=e.target.checked,this.dropiChange.emit(this.isChecked)}render(){return i("label",{key:"b3321fd96a1487210a920f5494708dc2eb05f10c",class:"toggle-switch"},i("input",{key:"ee7cfecf443a1c839ce145ade18cc3ff15924816",type:"checkbox",checked:this.isChecked,disabled:this.disabled,onChange:e=>this.onToggleChange(e)}),i("span",{key:"c0800bd9a7f52cf666b3e475265da223b852be9a",class:"slider"}))}static get formAssociated(){return!0}static get watchers(){return{isChecked:[{checkedChanged:0}]}}};o.style=":host{display:inline-block}*,*::before,*::after{box-sizing:border-box}.toggle-switch{position:relative;display:inline-block;width:40px;height:21px;margin-bottom:0;cursor:pointer}.toggle-switch input{opacity:0;width:0;height:0}.slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:var(--Gray-Gray-200, #c3c9d9);transition:0.4s;border-radius:34px}.slider::before{position:absolute;content:'';height:17px;width:17px;left:3px;bottom:2px;background-color:var(--Neutral-White, #ffffff);transition:0.4s;border-radius:50%}input:checked+.slider{background-color:var(--Primary-Primary-500, #f49a3d)}input:checked+.slider::before{transform:translateX(17px)}:host([disabled]) .toggle-switch{cursor:not-allowed;opacity:0.5}";export{o as dropi_switch}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as a,c as e,a as n,h as o}from"./p-B-h7fjQz.js";const t=[{code:"57",name:"Colombia",flag:"CO",maxLength:10},{code:"52",name:"Mexico",flag:"MX",maxLength:10},{code:"507",name:"Panama",flag:"PA",maxLength:8},{code:"56",name:"Chile",flag:"CL",maxLength:9},{code:"593",name:"Ecuador",flag:"EC",maxLength:10},{code:"51",name:"Peru",flag:"PE",maxLength:9},{code:"34",name:"España",flag:"ES",maxLength:9},{code:"595",name:"Paraguay",flag:"PY",maxLength:9},{code:"58",name:"Venezuela",flag:"VE",maxLength:11},{code:"54",name:"Argentina",flag:"AR",maxLength:10},{code:"55",name:"Brasil",flag:"BR",maxLength:11},{code:"1",name:"United States",flag:"US",maxLength:10},{code:"502",name:"Guatemala",flag:"GT",maxLength:8},{code:"598",name:"Uruguay",flag:"UY",maxLength:9},{code:"501",name:"Belize",flag:"BZ",maxLength:7},{code:"81",name:"Japan",flag:"JP",maxLength:10},{code:"1",name:"Canada",flag:"CA",maxLength:9},{code:"1473",name:"Grenada",flag:"GD",maxLength:10},{code:"509",name:"Haiti",flag:"HT",maxLength:10},{code:"1809",name:"Dominican Republic",flag:"DO",maxLength:10},{code:"1829",name:"Dominican Republic",flag:"DO",maxLength:10},{code:"1849",name:"Dominican Republic",flag:"DO",maxLength:10},{code:"1869",name:"Saint Kitts And Nevis",flag:"KN",maxLength:10},{code:"1784",name:"Saint Vincent And The Grenadines",flag:"VC",maxLength:10},{code:"1758",name:"Saint Lucia",flag:"LC",maxLength:10},{code:"597",name:"Suriname",flag:"SR",maxLength:10},{code:"1868",name:"Trinidad and Tobago",flag:"TT",maxLength:10},{code:"505",name:"Nicaragua",flag:"NI",maxLength:8},{code:"506",name:"Costa Rica",flag:"CR",maxLength:8},{code:"591",name:"Bolivia",flag:"BO",maxLength:8},{code:"7",name:"Russia",flag:"RU",maxLength:11},{code:"20",name:"Egypt",flag:"EG",maxLength:9},{code:"27",name:"South Africa",flag:"ZA",maxLength:10},{code:"30",name:"Greece",flag:"GR",maxLength:10},{code:"31",name:"Netherlands",flag:"NL",maxLength:9},{code:"32",name:"Belgium",flag:"BE",maxLength:8},{code:"33",name:"France",flag:"FR",maxLength:9},{code:"36",name:"Hungary",flag:"HU",maxLength:9},{code:"40",name:"Romania",flag:"RO",maxLength:9},{code:"39",name:"Italy",flag:"IT",maxLength:10},{code:"41",name:"Switzerland",flag:"CH",maxLength:9},{code:"44",name:"United Kingdom",flag:"GB",maxLength:11},{code:"45",name:"Denmark",flag:"DK",maxLength:8},{code:"46",name:"Sweden",flag:"SE",maxLength:8},{code:"47",name:"Norway",flag:"NO",maxLength:8},{code:"48",name:"Poland",flag:"PL",maxLength:9},{code:"49",name:"Germany",flag:"DE",maxLength:11},{code:"53",name:"Malta",flag:"MT",maxLength:8},{code:"60",name:"Malaysia",flag:"MY",maxLength:9},{code:"61",name:"Australia",flag:"AU",maxLength:9},{code:"62",name:"Indonesia",flag:"ID",maxLength:12},{code:"63",name:"Philippines",flag:"PH",maxLength:10},{code:"64",name:"New Zealand",flag:"NZ",maxLength:12},{code:"65",name:"Singapore",flag:"SG",maxLength:8},{code:"66",name:"Thailand",flag:"TH",maxLength:9},{code:"82",name:"South Korea",flag:"KR",maxLength:9},{code:"84",name:"Vietnam",flag:"VN",maxLength:11},{code:"86",name:"China",flag:"CN",maxLength:11},{code:"90",name:"Turkey",flag:"TR",maxLength:10},{code:"91",name:"India",flag:"IN",maxLength:10},{code:"92",name:"Pakistan",flag:"PK",maxLength:9},{code:"93",name:"Afghanistan",flag:"AF",maxLength:10},{code:"94",name:"Sri Lanka",flag:"LK",maxLength:9},{code:"95",name:"Myanmar",flag:"MM",maxLength:9},{code:"98",name:"Iran",flag:"IR",maxLength:10},{code:"211",name:"South Sudan",flag:"SS",maxLength:10},{code:"212",name:"Morocco",flag:"MA",maxLength:9},{code:"213",name:"Algeria",flag:"DZ",maxLength:9},{code:"216",name:"Tunisia",flag:"TN",maxLength:8},{code:"218",name:"Libya",flag:"LY",maxLength:9},{code:"220",name:"Gambia",flag:"GM",maxLength:8},{code:"221",name:"Senegal",flag:"SN",maxLength:9},{code:"222",name:"Mauritania",flag:"MR",maxLength:9},{code:"223",name:"Mali",flag:"ML",maxLength:8},{code:"224",name:"Guinea",flag:"GN",maxLength:9},{code:"225",name:"Ivory Coast",flag:"CI",maxLength:10},{code:"226",name:"Burkina Faso",flag:"BF",maxLength:10},{code:"227",name:"Niger",flag:"NE",maxLength:8},{code:"228",name:"Togo",flag:"TG",maxLength:8},{code:"229",name:"Benin",flag:"BJ",maxLength:8},{code:"230",name:"Mauritius",flag:"MU",maxLength:10},{code:"231",name:"Liberia",flag:"LR",maxLength:8},{code:"232",name:"Sierra Leone",flag:"SL",maxLength:11},{code:"233",name:"Ghana",flag:"GH",maxLength:9},{code:"234",name:"Nigeria",flag:"NG",maxLength:11},{code:"235",name:"Chad",flag:"TD",maxLength:8},{code:"236",name:"Central African Republic",flag:"CF",maxLength:21},{code:"237",name:"Cameroon",flag:"CM",maxLength:10},{code:"238",name:"Cape Verde",flag:"CV",maxLength:9},{code:"239",name:"São Tomé and Príncipe",flag:"ST",maxLength:14},{code:"240",name:"Equatorial Guinea",flag:"GQ",maxLength:17},{code:"241",name:"Gabon",flag:"GA",maxLength:9}],r=class{constructor(n){a(this,n),this.dropiCodChange=e(this,"dropiCodChange"),this.dropiPhoneChange=e(this,"dropiPhoneChange"),this.dropiVerify=e(this,"dropiVerify"),this.dropiChangeSelect=e(this,"dropiChangeSelect"),n.$hostElement$["s-ei"]?this.internals=n.$hostElement$["s-ei"]:(this.internals=n.$hostElement$.attachInternals(),n.$hostElement$["s-ei"]=this.internals)}get el(){return n(this)}internals;name="";codArea="57";ngModelPhone="";phoneNumberPlaceholder=null;disabledInput=!1;isValidPhone=void 0;validateOnInit=!0;selectedOption=null;selectProperties=null;open=!1;dropiCodChange;dropiPhoneChange;dropiVerify;dropiChangeSelect;codAreaChanged(){this.ngModelPhone="",this.updateFormValue()}ngModelPhoneChanged(){this.updateFormValue()}selectedOptionChanged(a){a&&(this.codArea=String(a.dialCode??a.code??this.codArea).replace("+",""))}componentWillLoad(){this.selectedOption&&this.selectedOptionChanged(this.selectedOption),this.updateFormValue()}updateFormValue(){this.internals.setFormValue(this.ngModelPhone?`+${this.codArea}${this.ngModelPhone}`:"")}get selectedCountry(){const a=(this.codArea??"57").replace("+","");return t.find((e=>e.code===a))??t[0]}selectCountry(a){this.codArea=a.code,this.open=!1,this.dropiCodChange.emit(a.code),this.dropiChangeSelect.emit(a)}handleInput(a){const e=a.target.value.replace(/\D/g,"");this.ngModelPhone=e.slice(0,this.selectedCountry.maxLength),a.target.value=this.ngModelPhone,this.dropiPhoneChange.emit(this.ngModelPhone)}handleWindowClick(a){a.composedPath().includes(this.el)||(this.open=!1)}render(){const a=this.selectedCountry,e=!1===this.isValidPhone;return o("div",{key:"1634a703f734cd5db7b5d7acf83f403ea07962a3",class:"phone-wrap"},o("div",{key:"a9ed4a17b4a01893fc22d051241dcd494fa2e66d",class:"phone-input-container"},o("div",{key:"6a50121fbb8939eac54035a314c340137aae63d5",class:"custom-select"},o("button",{key:"0157b468dab13e23f83b9528ec235bc61be91733",type:"button",class:{"select-button":!0,"select-invalid":e},disabled:this.disabledInput,onClick:()=>{this.disabledInput||(this.open=!this.open)}},o("span",{key:"b174ec714c415964d09f4661f58a1a62e8c80653",style:{display:"flex",gap:"0.5rem",alignItems:"center"}},o("img",{key:"f4c62db877a54bd395b756926918b8ff16511a2a",src:`https://flagsapi.com/${a.flag}/flat/24.png`,alt:"flag"}),a.code),o("dropi-icon",{key:"809f64bed4cccd911110c9e8e52752554b0d8a86",name:this.open?"Dropdown-up":"Dropdown-down",iconWidth:"14px",iconHeight:"14px",color:"Gray-Gray-500"})),o("ul",{key:"b4dea28807780b086ba15161cee3e417efb2f2a1",class:{"select-dropdown":!0,"expanded-select":this.open,"collapsed-select":!this.open}},t.map((a=>o("li",null,o("button",{type:"button",class:"option",onMouseDown:e=>{e.preventDefault(),this.selectCountry(a)}},o("img",{src:`https://flagsapi.com/${a.flag}/flat/24.png`,alt:a.flag}),a.code)))))),o("input",{key:"4e1113fedf25b9c91d2aff815d6c862a7d47d072",id:"phone-input",type:"tel",inputmode:"numeric",class:{"form-control":!0,"is-invalid":e},placeholder:this.phoneNumberPlaceholder,value:this.ngModelPhone,disabled:this.disabledInput,maxLength:a.maxLength,onInput:a=>this.handleInput(a)})))}static get formAssociated(){return!0}static get watchers(){return{codArea:[{codAreaChanged:0}],ngModelPhone:[{ngModelPhoneChanged:0}],selectedOption:[{selectedOptionChanged:0}]}}};r.style=":host{display:block;width:100%;position:relative;font-family:'Inter', sans-serif}*,*::before,*::after{box-sizing:border-box}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}input[type='number']{-moz-appearance:textfield;appearance:textfield}.phone-wrap{width:100%}.phone-label{display:block;font-size:var(--font-size-xs, 10px);color:var(--Gray-Gray-600, #475066);margin-bottom:4px}.phone-input-container{display:flex;align-items:center;gap:8px}.custom-select{position:relative;width:50%}.form-control{flex:1;width:100%;border:1px solid var(--Gray-Gray-200, #c3c9d9);border-radius:5px;font-size:14px;font-family:inherit;transition:border-color 0.3s ease-in-out;height:40px;padding:0 12px;outline:none;color:var(--Gray-Gray-700, #32394d);background-color:var(--Neutral-White, #ffffff)}.form-control::placeholder{color:var(--Gray-Gray-500, #69738c)}.form-control:focus::placeholder{color:var(--Gray-Gray-500, #69738c)}.form-control:focus{border-color:var(--Info-Info-500, #50a5f1);outline:none}.form-control:disabled{border:1px solid var(--Gray-Gray-200, #c3c9d9) !important;color:var(--Gray-Gray-400, #858ea6);background-color:var(--Gray-Gray-50, #f7f8fa);outline:none}.form-control.is-invalid{background:#fffbfb;border-color:var(--Error-Error-500, #f46a6b) !important}.select-button{width:100%;height:40px;padding:0.47rem 0.75rem;padding-right:7px;border:1px solid var(--Gray-Gray-200, #c3c9d9);border-radius:var(--Border-2, 8px);background:var(--Neutral-White, #ffffff);color:var(--Gray-Gray-500, #69738c);font-size:var(--font-size-s, 12px);font-family:inherit;display:flex;justify-content:space-between;align-items:center;text-align:left;cursor:pointer}.select-button img{width:20px;height:20px}.select-button:focus{border-color:var(--Info-Info-500, #50a5f1) !important;outline:none}.select-button:disabled{border-color:var(--Gray-Gray-200, #c3c9d9);color:var(--Gray-Gray-400, #858ea6);background-color:var(--Gray-Gray-50, #f7f8fa);cursor:unset}.select-button.select-completed{border-color:var(--Gray-Gray-400, #858ea6);color:var(--Gray-Gray-600, #475066);background:var(--Neutral-White, #ffffff)}.select-button.select-invalid{border-color:var(--Error-Error-500, #f46a6b) !important}.select-dropdown{position:absolute;width:100%;overflow:hidden;list-style:none;padding:0;margin:4px 0 0 0;border:1px solid transparent;border-radius:var(--Border-2, 8px);overflow-y:scroll;z-index:var(--dropi-z-index-overlay, 11000)}.select-dropdown::-webkit-scrollbar{width:6px}.select-dropdown::-webkit-scrollbar-thumb{background-color:var(--Gray-Gray-300, #d1d6e1);border-radius:4px}.expanded-select{max-height:250px;background:var(--Neutral-White, #ffffff);box-shadow:var(--Shadow-medium, 0 4px 16px rgba(0, 0, 0, 0.08));border:1px solid var(--Gray-Gray-200, #c3c9d9);transition:max-height 0.2s ease-in}.collapsed-select{max-height:0;background:transparent;box-shadow:none;border:1px solid transparent;transition:max-height 0.2s ease-out, background 0.6s ease-out, box-shadow 0.6s ease-out}.select-dropdown li{margin:0;padding:0}.option{width:100%;height:45px;border-radius:var(--Border-2, 8px);padding-top:var(--Size-3, 12px);padding-right:var(--Size-4, 16px);padding-bottom:var(--Size-3, 12px);padding-left:var(--Size-4, 16px);border:none;background:transparent;text-align:left;color:var(--Gray-Gray-600, #475066);font-size:var(--font-size-s, 12px);font-family:inherit;cursor:pointer;display:flex;align-items:center;gap:8px}.option img{width:20px;height:20px}.option:hover{background:var(--Gray-Gray-50, #f7f8fa)}.option:disabled{color:var(--Gray-Gray-400, #858ea6);background-color:var(--Gray-Gray-50, #f7f8fa);cursor:unset}.invalid-color{color:var(--Error-Error-500, #f46a6b) !important}.phone-error{margin:4px 0 0;font-size:var(--font-size-xs, 10px);color:var(--Error-Error-500, #f46a6b)}";export{r as dropi_phone_input}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as i,h as r}from"./p-B-h7fjQz.js";const c=class{constructor(r){e(this,r),this.dropiChange=i(this,"dropiChange"),r.$hostElement$["s-ei"]?this.internals=r.$hostElement$["s-ei"]:(this.internals=r.$hostElement$.attachInternals(),r.$hostElement$["s-ei"]=this.internals)}internals;name="";checked=!1;disabled=!1;dropiChange;checkedChanged(e){this.internals.setFormValue(e?"on":null)}componentWillLoad(){this.internals.setFormValue(this.checked?"on":null)}changeState(){this.disabled||(this.checked=!this.checked,this.dropiChange.emit(this.checked))}render(){return r("div",{key:"27fec5f03a48c19652c8ae01173dcbb6e3514693",class:"container-dropi-checkbox",onClick:()=>this.changeState()},r("div",{key:"243d07e4444c0dc149ff137258f9ddd58428c438",class:{check:!0,isCheck:this.checked,noCheck:!this.checked,disabled:this.disabled}},r("svg",{key:"7a1fd9c7b3fa575ec263fe5ad48fbc0294a79980",xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none"},r("path",{key:"e77e5cd40c71e542a045934641509e41a7cd4899",d:"M20.5991 5.69251L9.08325 17.2075C9.00583 17.2852 8.91382 17.3469 8.8125 17.389C8.71118 17.4311 8.60255 17.4527 8.49283 17.4527C8.38312 17.4527 8.27449 17.4311 8.17317 17.389C8.07185 17.3469 7.97984 17.2852 7.90242 17.2075L3.44908 12.75C3.37166 12.6723 3.27965 12.6106 3.17833 12.5685C3.07701 12.5264 2.96838 12.5048 2.85867 12.5048C2.74896 12.5048 2.64032 12.5264 2.53901 12.5685C2.43769 12.6106 2.34568 12.6723 2.26825 12.75C2.19052 12.8274 2.12884 12.9194 2.08676 13.0208C2.04467 13.1221 2.02301 13.2307 2.02301 13.3404C2.02301 13.4501 2.04467 13.5588 2.08676 13.6601C2.12884 13.7614 2.19052 13.8534 2.26825 13.9308L6.72325 18.385C7.19321 18.8541 7.83008 19.1175 8.49408 19.1175C9.15809 19.1175 9.79496 18.8541 10.2649 18.385L21.7799 6.87251C21.8575 6.7951 21.9191 6.70314 21.9611 6.6019C22.0031 6.50065 22.0247 6.39212 22.0247 6.28251C22.0247 6.17289 22.0031 6.06436 21.9611 5.96312C21.9191 5.86188 21.8575 5.76992 21.7799 5.69251C21.7025 5.61478 21.6105 5.5531 21.5092 5.51101C21.4078 5.46893 21.2992 5.44727 21.1895 5.44727C21.0798 5.44727 20.9712 5.46893 20.8698 5.51101C20.7685 5.5531 20.6765 5.61478 20.5991 5.69251Z",fill:"#FFFFFF"}))))}static get formAssociated(){return!0}static get watchers(){return{checked:[{checkedChanged:0}]}}};c.style=":host{display:inline-block}*,*::before,*::after{box-sizing:border-box}.container-dropi-checkbox{display:inline-block}.check{width:20px;height:20px;border-radius:var(--Border-1, 4px);cursor:pointer;transition:background-color 0.3s ease-in-out, border-style 0.3s ease-in-out}.noCheck{border-style:solid;border-width:2px;border-color:var(--Gray-Gray-200, #c3c9d9);display:flex;justify-content:center;align-items:center}.noCheck svg{visibility:hidden}.isCheck{display:flex;background-color:var(--Primary-Primary-500, #f49a3d);justify-content:center;align-items:center}.disabled{background-color:var(--Gray-Gray-50, #f7f8fa);border-color:var(--Gray-Gray-100, #e6eaf2);cursor:not-allowed}";export{c as dropi_checkbox}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as o,a as n,h as a}from"./p-B-h7fjQz.js";const r=[{name:"Afghanistan",code:"AF",codePhone:"93"},{name:"Albania",code:"AL",codePhone:"355"},{name:"Algeria",code:"DZ",codePhone:"213"},{name:"Argentina",code:"AR",codePhone:"54"},{name:"Australia",code:"AU",codePhone:"61"},{name:"Austria",code:"AT",codePhone:"43"},{name:"Azerbaijan",code:"AZ",codePhone:"994"},{name:"Bahamas",code:"BS",codePhone:"1242"},{name:"Bahrain",code:"BH",codePhone:"973"},{name:"Bangladesh",code:"BD",codePhone:"880"},{name:"Belgium",code:"BE",codePhone:"32"},{name:"Bolivia",code:"BO",codePhone:"591"},{name:"Brazil",code:"BR",codePhone:"55"},{name:"Cambodia",code:"KH",codePhone:"855"},{name:"Canada",code:"CA",codePhone:"1"},{name:"Chile",code:"CL",codePhone:"56"},{name:"China",code:"CN",codePhone:"86"},{name:"Colombia",code:"CO",codePhone:"57"},{name:"Costa Rica",code:"CR",codePhone:"506"},{name:"Cuba",code:"CU",codePhone:"53"},{name:"Czech Republic",code:"CZ",codePhone:"420"},{name:"Denmark",code:"DK",codePhone:"45"},{name:"Dominican Republic",code:"DO",codePhone:"1"},{name:"Ecuador",code:"EC",codePhone:"593"},{name:"Egypt",code:"EG",codePhone:"20"},{name:"El Salvador",code:"SV",codePhone:"503"},{name:"Estonia",code:"EE",codePhone:"372"},{name:"Ethiopia",code:"ET",codePhone:"251"},{name:"Finland",code:"FI",codePhone:"358"},{name:"France",code:"FR",codePhone:"33"},{name:"Germany",code:"DE",codePhone:"49"},{name:"Ghana",code:"GH",codePhone:"233"},{name:"Greece",code:"GR",codePhone:"30"},{name:"Guatemala",code:"GT",codePhone:"502"},{name:"Honduras",code:"HN",codePhone:"504"},{name:"Hong Kong",code:"HK",codePhone:"852"},{name:"Hungary",code:"HU",codePhone:"36"},{name:"India",code:"IN",codePhone:"91"},{name:"Indonesia",code:"ID",codePhone:"62"},{name:"Iran, Islamic Republic Of",code:"IR",codePhone:"98"},{name:"Iraq",code:"IQ",codePhone:"964"},{name:"Ireland",code:"IE",codePhone:"353"},{name:"Israel",code:"IL",codePhone:"972"},{name:"Italy",code:"IT",codePhone:"39"},{name:"Jamaica",code:"JM",codePhone:"1876"},{name:"Japan",code:"JP",codePhone:"81"},{name:"Jordan",code:"JO",codePhone:"962"},{name:"Kazakhstan",code:"KZ",codePhone:"7"},{name:"Kenya",code:"KE",codePhone:"254"},{name:"Kuwait",code:"KW",codePhone:"965"},{name:"Lebanon",code:"LB",codePhone:"961"},{name:"Malaysia",code:"MY",codePhone:"60"},{name:"Mexico",code:"MX",codePhone:"52"},{name:"Morocco",code:"MA",codePhone:"212"},{name:"Netherlands",code:"NL",codePhone:"31"},{name:"New Zealand",code:"NZ",codePhone:"64"},{name:"Nicaragua",code:"NI",codePhone:"505"},{name:"Nigeria",code:"NG",codePhone:"234"},{name:"Norway",code:"NO",codePhone:"47"},{name:"Pakistan",code:"PK",codePhone:"92"},{name:"Panama",code:"PA",codePhone:"507"},{name:"Paraguay",code:"PY",codePhone:"595"},{name:"Peru",code:"PE",codePhone:"51"},{name:"Philippines",code:"PH",codePhone:"63"},{name:"Poland",code:"PL",codePhone:"48"},{name:"Portugal",code:"PT",codePhone:"351"},{name:"Qatar",code:"QA",codePhone:"974"},{name:"Romania",code:"RO",codePhone:"40"},{name:"Russian Federation",code:"RU",codePhone:"7"},{name:"Saudi Arabia",code:"SA",codePhone:"966"},{name:"Singapore",code:"SG",codePhone:"65"},{name:"South Africa",code:"ZA",codePhone:"27"},{name:"Spain",code:"ES",codePhone:"34"},{name:"Sri Lanka",code:"LK",codePhone:"94"},{name:"Sweden",code:"SE",codePhone:"46"},{name:"Switzerland",code:"CH",codePhone:"41"},{name:"Taiwan, Province of China",code:"TW",codePhone:"886"},{name:"Thailand",code:"TH",codePhone:"66"},{name:"Tunisia",code:"TN",codePhone:"216"},{name:"Turkey",code:"TR",codePhone:"90"},{name:"Uganda",code:"UG",codePhone:"256"},{name:"Ukraine",code:"UA",codePhone:"380"},{name:"United Arab Emirates",code:"AE",codePhone:"971"},{name:"United Kingdom",code:"GB",codePhone:"44"},{name:"United States",code:"US",codePhone:"1"},{name:"Uruguay",code:"UY",codePhone:"598"},{name:"Venezuela",code:"VE",codePhone:"58"},{name:"Viet Nam",code:"VN",codePhone:"84"},{name:"Zimbabwe",code:"ZW",codePhone:"263"}],c=class{constructor(n){e(this,n),this.dropiChange=o(this,"dropiChange"),n.$hostElement$["s-ei"]?this.internals=n.$hostElement$["s-ei"]:(this.internals=n.$hostElement$.attachInternals(),n.$hostElement$["s-ei"]=this.internals)}internals;name="";label="";placeholder="Selecciona un país";currentSelection="";disabled=!1;showObligatory=!1;hasError=!1;textHelper="";searchTerm="";selectProperties=null;appendTo="";dropiChange;isOpen=!1;selected=null;get el(){return n(this)}buttonRef;portalContainer=null;portalFocusedSelector=null;handleDocClick(e){if(!this.isOpen)return;const o=e.composedPath();o.includes(this.el)||this.portalContainer&&o.includes(this.portalContainer)||(this.isOpen=!1)}searchInputRef;currentSelectionChanged(e){this.selected=r.find((o=>o.code===e))||null,this.internals.setFormValue(e)}selectPropertiesChanged(e){e&&(void 0!==e.label&&(this.label=e.label),void 0!==e.placeholder&&(this.placeholder=e.placeholder),void 0!==e.showObligatory&&(this.showObligatory=e.showObligatory),void 0!==e.textHelper&&(this.textHelper=e.textHelper),void 0!==e.hasError&&(this.hasError=e.hasError))}componentWillLoad(){this.selectProperties&&this.selectPropertiesChanged(this.selectProperties),this.currentSelection&&this.currentSelectionChanged(this.currentSelection),this.internals.setFormValue(this.currentSelection??"")}componentDidLoad(){if("body"!==this.appendTo)return;this.portalContainer=document.createElement("div");const e=document.createElement("style");e.textContent="\n.select-dropdown {\n background: #ffffff;\n border: 1px solid #c3c9d9;\n border-radius: 8px;\n list-style: none;\n padding: 0;\n margin: 0;\n box-shadow: 0 8px 24px rgba(0,0,0,.10);\n overflow: hidden;\n transition: max-height .2s ease, opacity .2s ease;\n font-family: inherit;\n font-size: 14px;\n}\n.select-dropdown.expanded { max-height: 300px; opacity: 1; overflow-y: auto; }\n.select-dropdown.collapsed { max-height: 0; opacity: 0; pointer-events: none; border-color: transparent; box-shadow: none; }\n.select-dropdown::-webkit-scrollbar { width: 6px; }\n.select-dropdown::-webkit-scrollbar-track { background: transparent; }\n.select-dropdown::-webkit-scrollbar-thumb { background: #c3c9d9; border-radius: 4px; }\n.search-li { padding: 10px 12px; position: sticky; top: 0; background: #ffffff; z-index: 1; border-bottom: 1px solid #e6eaf2; }\n.search-field { position: relative; display: flex; align-items: center; }\n.country-search { width: 100%; height: 36px; padding: 0 36px 0 12px; border: 1px solid #c3c9d9; border-radius: 8px; outline: none; font-size: 14px; font-family: inherit; color: #32394d; background: #f7f8fa; }\n.country-search:focus { border-color: #50a5f1; background: #ffffff; }\n.country-search::placeholder { color: #858ea6; }\n.search-icon { position: absolute; right: 10px; display: flex; align-items: center; pointer-events: none; }\n.option { width: 100%; min-height: 44px; padding: 10px 16px; border: none; background: transparent; text-align: left; color: #32394d; font-size: 14px; font-family: inherit; cursor: pointer; display: flex; align-items: center; gap: 10px; transition: background .1s ease; white-space: nowrap; }\n.option:hover { background: #f7f8fa; }\n.flag-img { border-radius: 4px; width: 24px; height: 24px; object-fit: cover; flex-shrink: 0; }\n",this.portalContainer.appendChild(e),document.body.appendChild(this.portalContainer)}disconnectedCallback(){this.returnUlToShadow(),this.portalContainer?.remove(),this.portalContainer=null}componentWillRender(){if(!this.portalContainer)return;const e=document.activeElement;e&&this.portalContainer.contains(e)&&(this.portalFocusedSelector="."+Array.from(e.classList).join(".")),this.returnUlToShadow()}componentDidRender(){if(!this.portalContainer||!this.buttonRef)return;const e=this.el.shadowRoot?.querySelector("ul.select-dropdown");if(!e)return;const o=this.buttonRef.getBoundingClientRect();if(e.style.cssText=`position:fixed;top:${o.bottom+4}px;left:${o.left}px;width:${o.width}px;z-index:11000;`,this.portalContainer.appendChild(e),this.portalFocusedSelector){const e=this.portalContainer.querySelector(this.portalFocusedSelector);if(e){const o=e.value?.length??0;e.focus(),e.setSelectionRange?.(o,o)}this.portalFocusedSelector=null}}returnUlToShadow(){if(!this.portalContainer)return;const e=this.portalContainer.querySelector("ul.select-dropdown");e&&this.el.shadowRoot?.querySelector(".custom-select")?.appendChild(e)}get filtered(){if(!this.searchTerm)return r;const e=this.searchTerm.toLowerCase();return r.filter((o=>o.name.toLowerCase().includes(e)))}open(){this.disabled||(this.isOpen=!this.isOpen,this.isOpen&&setTimeout((()=>this.searchInputRef?.focus()),50))}select(e){this.selected=e,this.isOpen=!1,this.searchTerm="",this.currentSelection=e.code,this.dropiChange.emit(e)}render(){return a("div",{key:"98292dbf6f84139b409cefe4690fb5ce834372c7",class:"custom-select"},this.label&&a("label",{key:"7dd60d54e701108f7061623a89e8ff29edbb8dc6"},this.label,this.showObligatory&&a("span",{key:"971fd2a900d9ef4740a96145cadc948aab95232a",class:"required"},"*")),a("button",{key:"6c0067cfaf920160a4f8c05f59c34f3539540d29",type:"button",ref:e=>{this.buttonRef=e},class:{"select-button":!0,"select-completed":!!this.selected,"select-invalid":this.hasError},disabled:this.disabled,onClick:()=>this.open()},a("div",{key:"b28c2c5b0de9b8052bb920a272b9dcc51f4eac6f",class:"selected-content"},this.selected?a("span",{class:"selected-option"},a("img",{class:"flag-img",src:`https://flagsapi.com/${this.selected.code}/shiny/24.png`,alt:this.selected.name}),this.selected.name):a("span",{class:"placeholder-text"},this.placeholder)),a("dropi-icon",{key:"2ec568b0ad4efdb3a22ffceb1e85fbc6f1d483e8",name:this.isOpen?"Arrow-Up-2":"Arrow-Down-2",iconWidth:"20px",iconHeight:"20px",color:"Gray-Gray-500"})),a("ul",{key:"34f0e5772ebb21e85cb246cbb91196d128d9ca59",class:"select-dropdown"+(this.isOpen?" expanded":" collapsed")},a("li",{key:"77cdf81222a7c593f1d54198e2b897468db890a5",class:"search-li"},a("div",{key:"970723feefd04adf0b113ae63931092f58d0264a",class:"search-field"},a("input",{key:"294868580087dc1bdb04258ad84672f3d10e7ba7",ref:e=>{this.searchInputRef=e},type:"text",class:"country-search",placeholder:"Buscar país...",value:this.searchTerm,onInput:e=>{this.searchTerm=e.target.value}}),a("span",{key:"02781dc595e568865ab5ae14aeed326b71b36e10",class:"search-icon"},a("dropi-icon",{key:"0c06d5e5f26d2a2e5ec20967a2ebb9430397f3ea",name:"Search",iconWidth:"16px",iconHeight:"16px",color:"Gray-Gray-400"})))),this.filtered.map((e=>a("li",{key:e.code},a("button",{class:"option",type:"button",onClick:()=>this.select(e)},a("img",{class:"flag-img",src:`https://flagsapi.com/${e.code}/shiny/24.png`,alt:e.name}),e.name))))),this.textHelper&&a("div",{key:"aae58bc17bbb6953a676818fe02da94b5a4e9f73",class:{"select-helper":!0,"select-helper-error":this.hasError}},this.hasError&&a("dropi-icon",{key:"7542ef4620499957711079c587f6cb650096f6d3",name:"Warning-circle",iconWidth:"12px",iconHeight:"12px",color:"Error-Error-500"}),a("span",{key:"ea4c5cedd3b87444a90b4e210f7afa3a318a4832"},this.textHelper)))}static get formAssociated(){return!0}static get watchers(){return{currentSelection:[{currentSelectionChanged:0}],selectProperties:[{selectPropertiesChanged:0}]}}};c.style=":host{display:block;width:100%;text-align:left}*,*::before,*::after{box-sizing:border-box}.custom-select{position:relative;width:100%}label{display:block;font-size:var(--font-size-xs, 11px);font-weight:var(--font-weight-regular, 400);color:var(--Gray-Gray-600, #475066);margin-bottom:6px}.required{color:var(--Error-Error-500, #ef4444);margin-left:2px}.select-button{width:100%;height:44px;padding:0 12px;border:1px solid var(--Gray-Gray-200, #c3c9d9);border-radius:var(--Border-2, 8px);background:var(--Neutral-White, #ffffff);color:var(--Gray-Gray-500, #69738c);font-size:var(--font-size-s, 14px);font-family:inherit;display:flex;justify-content:space-between;align-items:center;text-align:left;cursor:pointer;transition:border-color 0.15s ease}.select-button:focus{outline:none;border-color:var(--Info-Info-500, #3b82f6)}.select-button:disabled{border-color:var(--Gray-Gray-200, #c3c9d9);color:var(--Gray-Gray-400, #858ea6);background:var(--Gray-Gray-50, #f7f8fa);cursor:not-allowed}.select-button.select-completed{color:var(--Gray-Gray-700, #32394d)}.select-button.select-invalid{border-color:var(--Error-Error-500, #ef4444)}.selected-content{display:flex;align-items:center;gap:8px;overflow:hidden;flex:1}.selected-option{display:flex;align-items:center;gap:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--Gray-Gray-700, #32394d);font-size:var(--font-size-s, 14px)}.placeholder-text{color:var(--Gray-Gray-400, #858ea6);font-size:var(--font-size-s, 14px)}.flag-img{border-radius:var(--Border-1, 4px);width:24px;height:24px;object-fit:cover;flex-shrink:0}.select-dropdown{position:absolute;top:calc(100% + 4px);left:0;right:0;background:var(--Neutral-White, #ffffff);border:1px solid var(--Gray-Gray-200, #c3c9d9);border-radius:var(--Border-2, 8px);z-index:var(--dropi-z-index-overlay, 11000);list-style:none;padding:0;margin:0;box-shadow:0 8px 24px rgba(0, 0, 0, 0.10);overflow:hidden;transition:max-height 0.2s ease, opacity 0.2s ease}.select-dropdown.expanded{max-height:300px;opacity:1;overflow-y:auto}.select-dropdown.collapsed{max-height:0;opacity:0;pointer-events:none;border-color:transparent;box-shadow:none}.select-dropdown::-webkit-scrollbar{width:6px}.select-dropdown::-webkit-scrollbar-track{background:transparent}.select-dropdown::-webkit-scrollbar-thumb{background:var(--Gray-Gray-200, #c3c9d9);border-radius:4px}.select-dropdown::-webkit-scrollbar-thumb:hover{background:var(--Gray-Gray-300, #a3abbf)}.search-li{padding:10px 12px;position:sticky;top:0;background:var(--Neutral-White, #ffffff);z-index:1;border-bottom:1px solid var(--Gray-Gray-100, #e6eaf2)}.search-field{position:relative;display:flex;align-items:center}.country-search{width:100%;height:36px;padding:0 36px 0 12px;border:1px solid var(--Gray-Gray-200, #c3c9d9);border-radius:var(--Border-2, 8px);outline:none;font-size:var(--font-size-s, 14px);font-family:inherit;color:var(--Gray-Gray-700, #32394d);background:var(--Gray-Gray-50, #f7f8fa);transition:border-color 0.15s, background 0.15s}.country-search:focus{border-color:var(--Info-Info-500, #50a5f1);background:var(--Neutral-White, #ffffff)}.country-search::placeholder{color:var(--Gray-Gray-400, #858ea6)}.search-icon{position:absolute;right:10px;display:flex;align-items:center;pointer-events:none}.option{width:100%;min-height:44px;padding:10px 16px;border:none;background:transparent;text-align:left;color:var(--Gray-Gray-700, #32394d);font-size:var(--font-size-s, 14px);font-family:inherit;cursor:pointer;display:flex;align-items:center;gap:10px;transition:background 0.1s ease;white-space:nowrap}.option:hover{background:var(--Gray-Gray-50, #f7f8fa)}";export{c as dropi_country_selector}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as r,h as i}from"./p-B-h7fjQz.js";const t=class{constructor(i){e(this,i),this.dropiChange=r(this,"dropiChange"),i.$hostElement$["s-ei"]?this.internals=i.$hostElement$["s-ei"]:(this.internals=i.$hostElement$.attachInternals(),i.$hostElement$["s-ei"]=this.internals)}internals;label="";name="name";id="radioButton";checked=!1;resetTrigger=!1;dropiChange;onResetTrigger(e){e&&(this.checked=!1)}checkedChanged(e){this.internals.setFormValue(e?"on":null)}componentWillLoad(){this.internals.setFormValue(this.checked?"on":null)}handleChange(e){this.checked=e.target.checked,this.dropiChange.emit(e)}render(){return i("div",{key:"e4b54d9bda299b9150ebf9791925e0e7c3b9fb38",class:"dropi-radio-button"},i("label",{key:"0a4c6443668477a2cb6b2d5a3d8bc1744a0fcffd",htmlFor:this.id},i("input",{key:"6ba6b5af4bc061664dee0b6554c769613080dbb8",id:this.id,type:"radio",name:this.name,checked:this.checked,onChange:e=>this.handleChange(e)}),this.label))}static get formAssociated(){return!0}static get watchers(){return{resetTrigger:[{onResetTrigger:0}],checked:[{checkedChanged:0}]}}};t.style=":host{display:inline-block}*,*::before,*::after{box-sizing:border-box}.dropi-radio-button{display:flex;align-items:center;justify-content:flex-start;gap:20px}label{display:flex;flex-direction:row;align-items:center;gap:8px;cursor:pointer;color:var(--Gray-Gray-700, #32394d);font-size:var(--font-size-s, 12px);font-weight:var(--font-weight-regular, 400);line-height:1.5}input[type='radio']{appearance:none;-webkit-appearance:none;width:20px;height:20px;min-width:20px;border:2px solid var(--Gray-Gray-200, #c3c9d9);border-radius:50%;background-color:transparent;position:relative;cursor:pointer;outline:none;flex-shrink:0;align-self:center;vertical-align:middle;margin:0}input[type='radio']::before{content:'';position:absolute;top:3px;left:3px;width:10px;height:10px;background-color:var(--Primary-Primary-400, #f7b46f);border-radius:50%;display:none}input[type='radio']:checked{border:2px solid var(--Primary-Primary-500, #f49a3d)}input[type='radio']:checked::before{display:block}";export{t as dropi_radio_button}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as a}from"./p-B-h7fjQz.js";const e=class{constructor(a){t(this,a),this.dropiInput=i(this,"dropiInput"),this.dropiChange=i(this,"dropiChange"),this.dropiFocus=i(this,"dropiFocus"),this.dropiBlur=i(this,"dropiBlur"),a.$hostElement$["s-ei"]?this.internals=a.$hostElement$["s-ei"]:(this.internals=a.$hostElement$.attachInternals(),a.$hostElement$["s-ei"]=this.internals)}internals;inputId="";name="";label="";placeholder=" ";value="";maxLength;disabled=!1;required=!1;showObligatoryAsterisk=!0;fixedLabel=!1;inputMode="text";passwordInput=!1;isMoneyInput=!1;isThousandSeparator=!1;isNumericInput=!1;allowDecimals=!1;isLettersOnly=!1;icon="";iconColor="Gray-Gray-400";hasError=!1;textHelper="";showHelperOnlyOnError=!1;inputProperties=null;showPassword=!1;touched=!1;dropiInput;dropiChange;dropiFocus;dropiBlur;inputPropertiesChanged(t){t&&(void 0!==t.id&&(this.inputId=t.id),void 0!==t.inputId&&(this.inputId=t.inputId),void 0!==t.label&&(this.label=t.label),void 0!==t.placeholder&&(this.placeholder=t.placeholder),void 0!==t.maxLength&&(this.maxLength=t.maxLength),void 0!==t.textHelper&&(this.textHelper=t.textHelper),void 0!==t.passwordInput&&(this.passwordInput=t.passwordInput),void 0!==t.isPasswordInput&&(this.passwordInput=t.isPasswordInput),void 0!==t.icon&&(this.icon=t.icon),void 0!==t.iconColor&&(this.iconColor=t.iconColor),void 0!==t.isMoneyInput&&(this.isMoneyInput=t.isMoneyInput),void 0!==t.showObligatoryAsterisk&&(this.showObligatoryAsterisk=t.showObligatoryAsterisk),void 0!==t.isNumericInput&&(this.isNumericInput=t.isNumericInput),void 0!==t.allowDecimals&&(this.allowDecimals=t.allowDecimals),void 0!==t.isThousandSeparator&&(this.isThousandSeparator=t.isThousandSeparator),void 0!==t.showHelperOnlyOnError&&(this.showHelperOnlyOnError=t.showHelperOnlyOnError),void 0!==t.isLettersOnly&&(this.isLettersOnly=t.isLettersOnly),void 0!==t.inputMode&&(this.inputMode=t.inputMode))}valueChanged(t){this.internals.setFormValue(t)}disabledChanged(t){this.internals.setValidity(t?{customError:!0}:{},t?"Field is disabled":"")}componentWillLoad(){this.internals.setFormValue(this.value??""),this.inputProperties&&this.inputPropertiesChanged(this.inputProperties)}handleInput(t){let i=t.target.value;this.isNumericInput&&(i=this.filterNumbers(i)),this.isLettersOnly&&(i=this.filterLetters(i)),(this.isMoneyInput||this.isThousandSeparator)&&(i=this.formatThousands(i,this.isMoneyInput)),this.value=i,this.internals.setFormValue(i),this.dropiInput.emit(i),this.dropiChange.emit(i)}handleKeyDown(t){(this.isNumericInput||this.isMoneyInput||this.isThousandSeparator)&&!this.isAllowedNumberKey(t)&&t.preventDefault(),this.isLettersOnly&&!this.isAllowedLetterKey(t)&&t.preventDefault()}handleFocus(){this.dropiFocus.emit()}handleBlur(){this.touched=!0,this.dropiBlur.emit()}togglePassword(){this.disabled||(this.showPassword=!this.showPassword)}filterNumbers(t){return t.replace(this.allowDecimals?/[^0-9.]/g:/[^0-9]/g,"")}filterLetters(t){return t.replace(/[^a-zA-ZáéíóúÁÉÍÓÚñÑüÜ\s]/g,"")}isAllowedNumberKey(t){return!!(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter","Home","End"].includes(t.key)||t.ctrlKey||t.metaKey||/^[0-9]$/.test(t.key)||this.allowDecimals&&"."===t.key)}isAllowedLetterKey(t){return!!["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter","Home","End"," "].includes(t.key)||!(!t.ctrlKey&&!t.metaKey)||/^[a-zA-ZáéíóúÁÉÍÓÚñÑüÜ]$/.test(t.key)}formatThousands(t,i){const a=t.replace(/[^0-9.]/g,""),[e,r]=a.split("."),o=e.replace(/\B(?=(\d{3})+(?!\d))/g,","),s=void 0!==r?`${o}.${r}`:o;return i?`$${s}`:s}get resolvedId(){return this.inputId||this.label}get inputType(){return this.passwordInput?this.showPassword?"text":"password":"text"}get showHelper(){return!!this.textHelper&&(!this.showHelperOnlyOnError||this.hasError&&this.touched)}get isInvalid(){return this.hasError&&this.touched}render(){const t=this.required&&this.showObligatoryAsterisk&&!this.disabled,i=!!this.icon;return a("div",{key:"6af757e1d86bfe96d471e9cbed258a50727ae190",class:{"fixed-label-container":this.fixedLabel}},this.fixedLabel&&a("div",{key:"e88bf81fd2b79933e386c2e5fa38f57d85cfe836",class:"input-label Body-S-Regular"},this.label,t&&a("span",{key:"be8ec1b0d3ef624ca22e58ae072917ad2ecc79fb",class:"asterisk"}," *")),a("div",{key:"4806c0d250f00bb08788d9d6aa935ca15f2aa826",class:"form-group"},a("div",{key:"b9fa243d299bcd165458947d6695fcc845764276",class:{"input-container":!0,"input-container--has-icon":i}},i&&a("dropi-icon",{key:"92b3cf11803745784f13e908ea88992f76c74473",class:"icon-input",name:this.icon,color:this.iconColor,iconWidth:"20px",iconHeight:"20px",style:{width:"20px",height:"20px"}}),this.passwordInput&&a("dropi-icon",{key:"c7dc725d577a6d4afb7f87c8b53b16c621de9e86",class:"icon-input-password",name:this.showPassword?"Eye":"Eye-crossed",iconWidth:"20px",iconHeight:"20px",style:{width:"20px",height:"20px"},color:"Gray-Gray-500",onClick:()=>this.togglePassword()}),a("input",{key:"8146ae1794cbe1f200bb681358c7319f10faab3c",id:this.resolvedId,class:{"form-control":!0,"form-control-valid":!this.isInvalid&&this.touched&&!!this.value,"form-control-invalid":this.isInvalid,"padding-icon":i,"text-password":this.passwordInput&&!this.showPassword,"fixed-label-input":this.fixedLabel},type:this.inputType,value:this.value,placeholder:this.fixedLabel?this.placeholder:" ",disabled:this.disabled,required:this.required,maxLength:this.maxLength,inputMode:this.inputMode,"data-cy":void 0,onInput:t=>this.handleInput(t),onKeyDown:t=>this.handleKeyDown(t),onFocus:()=>this.handleFocus(),onBlur:()=>this.handleBlur()}),!this.fixedLabel&&a("label",{key:"005d15af6b50b2cb2d47ac8381a722794eb273e5",class:"Body-S-Regular label-bottom",htmlFor:this.resolvedId},this.label,t&&a("span",{key:"ad56df877cff3df8a801cdfcb607d9af02f7465a",class:"asterisk"}," *")),this.showHelper&&a("div",{key:"76e858c13a798f69b2d20ee9908f17531568dad1",class:"form-control-helper"},this.isInvalid&&a("dropi-icon",{key:"3e42ffb4db7444ebfb49cc9c6720d5a9d02b2860",name:"Warning-circle",iconWidth:"12px",iconHeight:"12px",color:"Error-Error-500"}),a("span",{key:"5e970903eb51ca6b72a43bef0edf6ef149443247",class:{"disabled-helper":this.disabled,"invalid-color":this.isInvalid}},this.textHelper)))))}static get formAssociated(){return!0}static get watchers(){return{inputProperties:[{inputPropertiesChanged:0}],value:[{valueChanged:0}],disabled:[{disabledChanged:0}]}}};e.style=":host{display:block;width:100%}*,*::before,*::after{box-sizing:border-box}.fixed-label-container{display:flex;width:100%;flex-direction:column;align-items:flex-start;gap:8px}.input-label{color:var(--Gray-Gray-600, #475066);font-size:var(--font-size-xs, 10px);font-weight:var(--font-weight-regular, 400);text-align:left}.asterisk{color:var(--Error-Error-500, #f46a6b)}.form-group{position:relative;width:100%}.input-container{position:relative}.icon-input{position:absolute;top:50%;left:12px;transform:translateY(-50%);z-index:1;display:flex;align-items:center;justify-content:center}.icon-input-password{position:absolute;top:50%;right:13px;transform:translateY(-50%);cursor:pointer;z-index:1;display:flex;align-items:center;justify-content:center}.form-control{box-sizing:border-box;width:100%;padding:var(--Size-2, 8px);border:1px solid var(--Gray-Gray-200, #c3c9d9);border-radius:var(--Border-2, 8px);background:var(--Neutral-White, #ffffff);font-size:var(--font-size-s, 12px);font-family:inherit;color:var(--Gray-Gray-700, #32394d);transition:border-color 0.3s ease-in-out;height:40px;outline:none;appearance:none;text-align:left}.form-control::placeholder{color:transparent;transition:color 0.2s ease-in-out}.form-control:focus::placeholder,.fixed-label-input::placeholder{color:var(--Gray-Gray-400, #858ea6)}.form-control:focus{border-color:var(--Info-Info-500, #50a5f1)}.form-control-valid{border-color:var(--Gray-Gray-400, #858ea6) !important;color:var(--Gray-Gray-600, #475066)}.form-control-invalid{border-color:var(--Error-Error-500, #f46a6b) !important;color:var(--Gray-Gray-600, #475066)}.form-control:disabled{border-color:var(--Gray-Gray-200, #c3c9d9) !important;color:var(--Gray-Gray-400, #858ea6);background-color:var(--Gray-Gray-50, #f7f8fa);cursor:not-allowed}.padding-icon{padding-left:40px}.input-container--has-icon label.label-bottom{left:40px}.input-container--has-icon .form-control:focus+label.label-bottom,.input-container--has-icon .form-control:not(:placeholder-shown)+label.label-bottom{left:0}.text-password{-webkit-text-security:disc;text-security:disc}label.label-bottom{position:absolute;font-weight:var(--font-weight-regular, 400);top:10px;font-size:var(--font-size-s, 12px);color:var(--Gray-Gray-500, #69738c);left:10px;transition:all 0.2s ease-in-out;pointer-events:none;overflow:hidden;width:90%;white-space:nowrap}.form-control:focus+label.label-bottom,.form-control:not(:placeholder-shown)+label.label-bottom{top:-22px;left:0;font-size:var(--font-size-xs, 10px);color:var(--Gray-Gray-600, #475066);width:unset}.form-control:disabled+label.label-bottom{color:var(--Gray-Gray-400, #858ea6)}.form-control-helper{display:flex;position:absolute;top:100%;left:0;gap:4px;align-items:center;margin-top:4px}.form-control-helper span{display:block;color:var(--Gray-Gray-600, #475066);font-size:var(--font-size-xs, 10px)}.invalid-color{color:var(--Error-Error-500, #f46a6b) !important}.disabled-helper{color:var(--Gray-Gray-400, #858ea6) !important}.disabled-helper{color:var(--Gray-Gray-400, #858ea6) !important}";const r=class{constructor(a){t(this,a),this.dropiPageChange=i(this,"dropiPageChange")}totalPages=1;currentPage=1;disabled=!1;maxVisiblePages=8;isNotTotalPages=!1;noLabels=!1;dropiPageChange;get pageNumbers(){const t=this.totalPages,i=this.currentPage,a=this.maxVisiblePages;if(t<=a)return Array.from({length:t},((t,i)=>i+1));const e=Math.floor(a/2);let r=Math.max(1,i-e),o=Math.min(t,r+a-1);o-r<a-1&&(r=Math.max(1,o-a+1));const s=[];r>1&&(s.push(1),r>2&&s.push("..."));for(let t=r;t<=o;t++)s.push(t);return o<t&&(o<t-1&&s.push("..."),s.push(t)),s}goTo(t){this.disabled||t<1||t>this.totalPages||t===this.currentPage||(this.currentPage=t,this.dropiPageChange.emit(this.currentPage))}render(){const t=this.pageNumbers,i=this.currentPage<=1,e=this.currentPage>=this.totalPages;return a("div",{key:"af6614df5a241ef536b6723d30bde12c8a6f474f",class:"paginator"},a("div",{key:"8b5405baa717a36042fc03ca2e68370799c01ff7",class:"paginator-pages"},!i&&!this.noLabels&&a("button",{key:"c340304b29d658ef9eaa8105a91540660c829048",class:{"paginator-btn":!0,"paginator-btn--arrow":!0},onClick:()=>this.goTo(1),"aria-label":"Primera página",disabled:this.disabled},a("dropi-icon",{key:"3adfc1508cbcedbb91f99e467db2270c40a4ac83",name:"Arrow-double-small-left",iconWidth:"16px",iconHeight:"16px",color:"Gray-Gray-600"})),!i&&a("button",{key:"5936642c4b9e5b72546229996fbc72fe973e6f5f",class:{"paginator-btn":!0,"paginator-btn--arrow":!0},onClick:()=>this.goTo(this.currentPage-1),"aria-label":"Anterior",disabled:this.disabled},a("dropi-icon",{key:"c9f7eb1c0c27a738ee31e859617964fc75e514cc",name:"Dropdown-left",iconWidth:"16px",iconHeight:"16px",color:"Gray-Gray-600"}),!this.noLabels&&a("span",{key:"5d448a9a6536c90c56fafd700e7c5998a85d6fdf",class:"paginator-label"},"Anterior")),t.map(((t,i)=>"..."===t?a("span",{class:"paginator-ellipsis",key:`e${i}`},"…"):a("button",{key:t,class:{"paginator-btn":!0,"paginator-btn--active":t===this.currentPage},onClick:()=>this.goTo(t),"aria-current":t===this.currentPage?"page":void 0,disabled:this.disabled},t))),!e&&a("button",{key:"1a43d8dde37cdbc40527eb1c66bc5001a64cf59f",class:{"paginator-btn":!0,"paginator-btn--arrow":!0},onClick:()=>this.goTo(this.currentPage+1),"aria-label":"Siguiente",disabled:this.disabled},!this.noLabels&&a("span",{key:"f76ccd791d02b25d78c509341b73e1c1bca0b986",class:"paginator-label"},"Siguiente"),a("dropi-icon",{key:"822a3a7e4ac651e00c469b565e300a7efcc5614b",name:"Dropdown-Right",iconWidth:"16px",iconHeight:"16px",color:"Gray-Gray-600"})),!e&&!this.noLabels&&a("button",{key:"2b4f7435f9083ab9c4d9ce81be5c259eda830e4a",class:{"paginator-btn":!0,"paginator-btn--arrow":!0},onClick:()=>this.goTo(this.totalPages),"aria-label":"Última página",disabled:this.disabled},a("dropi-icon",{key:"63ab5568c44ed3cbda917842defe4dc4254bb3f1",name:"Arrow-double-small-right",iconWidth:"16px",iconHeight:"16px",color:"Gray-Gray-600"}))))}};r.style=":host{display:block}*,*::before,*::after{box-sizing:border-box}.paginator{display:flex;align-items:center;justify-content:flex-end;gap:var(--Size-4, 16px);flex-wrap:wrap}.paginator-pages{display:flex;align-items:center;gap:var(--Size-1, 4px)}.paginator-btn{width:32px;height:32px;padding:0;border:none;border-radius:50%;background:transparent;color:var(--Gray-Gray-600, #475066);font-size:var(--font-size-s, 12px);font-family:inherit;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background 0.15s ease}.paginator-btn:hover:not(:disabled){background:var(--Gray-Gray-50, #f7f8fa)}.paginator-btn:disabled{opacity:0.4;cursor:not-allowed}.paginator-btn--active{background:var(--Primary-Primary-500, #f49a3d);color:var(--Neutral-White, #ffffff);font-weight:var(--font-weight-bold, 700)}.paginator-btn--active:hover{background:var(--Primary-Primary-500, #f49a3d)}.paginator-btn--arrow{width:auto;padding:0 var(--Size-2, 8px);border-radius:var(--Border-1, 4px);gap:4px}.paginator-btn--arrow:hover:not(:disabled){background:var(--Gray-Gray-50, #f7f8fa)}.paginator-label{font-size:var(--font-size-s, 12px);color:inherit}.paginator-ellipsis{color:var(--Gray-Gray-400, #858ea6);padding:0 4px;font-size:var(--font-size-s, 12px);display:flex;align-items:center}.paginator-size{display:flex;align-items:center;gap:var(--Size-2, 8px)}.paginator-size-label{font-size:var(--font-size-s, 12px);color:var(--Gray-Gray-500, #69738c)}.paginator-size-select{height:32px;padding:0 var(--Size-2, 8px);border:1px solid var(--Gray-Gray-200, #c3c9d9);border-radius:var(--Border-1, 4px);background:var(--Neutral-White, #ffffff);color:var(--Gray-Gray-600, #475066);font-size:var(--font-size-s, 12px);font-family:inherit;cursor:pointer;outline:none}";const o=class{constructor(i){t(this,i)}variant="tag";type="primary";state="default";showIcon=!1;icon="";text="";colorMap={default:"Primary-Primary",success:"Success-Success",info:"Info-Info",warning:"Warning-Warning",error:"Error-Error",legacy:"Gray-Gray"};propsChanged(){}get bgColor(){const t=this.colorMap[this.state];return"primary"===this.type?`var(--${t}-500)`:`var(--${t}${"default"===this.state||"legacy"===this.state?"-100":"-50"})`}get textColor(){return"text"===this.variant?this.dotColor:"dot"===this.variant||this.showIcon?"var(--Gray-Gray-500)":"primary"===this.type?"var(--Neutral-White)":`var(--${this.colorMap[this.state]}${"default"===this.state?"-500":"-700"})`}get dotColor(){return`var(--${this.colorMap[this.state]}-500)`}get fontWeight(){return"secondary"!==this.type||this.showIcon?"500":"300"}get iconColor(){return"primary"===this.type?"Neutral-White":`${this.colorMap[this.state]}${"default"===this.state?"-500":"-700"}`}get hasContent(){return"string"==typeof this.text&&this.text.trim().length>0}render(){return a("div",{key:"6a50111c0057b7ef3380dde9f639e9409b7fbea9",class:"container-chips"},a("div",{key:"f2f78c3682aa2e8bef5f3f1b43a1729cae8ae293",class:{tags:!0,"icon-only":this.showIcon&&!this.hasContent,"dot-variant":"dot"===this.variant,"text-variant":"text"===this.variant},style:{backgroundColor:"dot"===this.variant||"text"===this.variant?"transparent":this.bgColor,color:this.textColor,fontWeight:this.fontWeight}},"dot"===this.variant&&a("div",{key:"5364569230575b79b1160e06cc29046220bdf198",class:"dot-indicator",style:{backgroundColor:this.dotColor}}),this.showIcon&&this.icon&&a("dropi-icon",{key:"8ea74f9ad58e7892405e3e748289b71456945de6",class:"file-icon",name:this.icon,iconWidth:"16px",iconHeight:"16px",color:"dot"===this.variant?"Gray-Gray-500":this.iconColor}),this.hasContent&&a("span",{key:"99409549735fd48cf0a40e411f1f236716e53939"},this.text)))}static get watchers(){return{type:[{propsChanged:0}],state:[{propsChanged:0}],variant:[{propsChanged:0}]}}};o.style=":host{display:inline-flex}*,*::before,*::after{box-sizing:border-box}.container-chips{display:flex;align-items:center;justify-content:center}.tags{display:inline-flex;padding:4px 8px;justify-content:center;align-items:center;gap:4px;border-radius:var(--Border-5, 9999px);overflow:hidden;text-align:center;text-overflow:ellipsis;font-size:var(--font-size-xs, 12px);font-weight:var(--font-weight-medium, 500);line-height:var(--lineheight-large, 150%);animation:fade-in 200ms ease-out}.tags.dot-variant,.tags.text-variant{padding:0;gap:8px;background-color:transparent !important;line-height:normal}.dot-indicator{width:10px;height:10px;border-radius:50%;flex-shrink:0}@keyframes fade-in{from{opacity:0;transform:scale(0.8)}to{opacity:1;transform:scale(1)}}";export{e as dropi_input,r as dropi_paginator,o as dropi_tag}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r,c as e,h as t}from"./p-B-h7fjQz.js";const o=class{constructor(t){r(this,t),this.dropiInput=e(this,"dropiInput"),this.dropiChange=e(this,"dropiChange"),this.dropiFocus=e(this,"dropiFocus"),this.dropiBlur=e(this,"dropiBlur"),t.$hostElement$["s-ei"]?this.internals=t.$hostElement$["s-ei"]:(this.internals=t.$hostElement$.attachInternals(),t.$hostElement$["s-ei"]=this.internals)}internals;id="";name="";label="";placeholder="";value="";maxLength;minLength=0;rows=4;resize="vertical";disabled=!1;required=!1;showObligatoryAsterisk=!1;textHelper="";hasError=!1;textAreaProperties=null;textAreaPropertiesChanged(r){r&&(void 0!==r.id&&(this.id=r.id),void 0!==r.label&&(this.label=r.label),void 0!==r.placeholder&&(this.placeholder=r.placeholder),void 0!==r.maxLength&&(this.maxLength=r.maxLength),void 0!==r.minLength&&(this.minLength=r.minLength),void 0!==r.textHelper&&(this.textHelper=r.textHelper),void 0!==r.rows&&(this.rows=r.rows),void 0!==r.resize&&(this.resize=r.resize))}touched=!1;dropiInput;dropiChange;dropiFocus;dropiBlur;valueChanged(r){this.internals.setFormValue(r)}componentWillLoad(){this.internals.setFormValue(this.value??""),this.textAreaProperties&&this.textAreaPropertiesChanged(this.textAreaProperties)}handleInput(r){const e=r.target.value;this.value=e,this.internals.setFormValue(e),this.dropiInput.emit(e),this.dropiChange.emit(e)}handleBlur(){this.touched=!0,this.dropiBlur.emit()}get resolvedId(){return this.id||this.label}get isInvalid(){return this.hasError&&this.touched}get charCount(){return this.value?.length??0}render(){const r=this.textHelper||this.isInvalid;return t("div",{key:"8c25826a54d1f0bec06d8f70211d2bcd873d59a6",class:"textarea-wrapper"},this.label&&t("label",{key:"58a578753a1248b185d2763aedf50eaaa152c791",htmlFor:this.resolvedId,style:{color:this.disabled?"var(--Gray-Gray-400)":"var(--Gray-Gray-600)"}},this.label,this.required&&this.showObligatoryAsterisk&&!this.disabled&&t("span",{key:"cf31923103a7594f552df4ec86885f78d0c31779",class:"asterisk"}," *")),t("div",{key:"6ea60b6286fd4438389cfda0580379d8fe013adc",class:"textarea-container"},t("textarea",{key:"fc5e495d80bfd665e55480668b9fa7ed62651984",id:this.resolvedId,class:{"form-control":!0,"Body-M-Regular":!0,"form-control-valid":!this.isInvalid&&this.touched&&!!this.value,"form-control-invalid":this.isInvalid},rows:this.rows,placeholder:this.placeholder,maxLength:this.maxLength,minLength:this.minLength,disabled:this.disabled,required:this.required,style:{resize:this.resize},onInput:r=>this.handleInput(r),onFocus:()=>this.dropiFocus.emit(),onBlur:()=>this.handleBlur()},this.value),this.maxLength>0&&t("div",{key:"07c350ce7a2e56b466229450645e6faece3d284b",class:"char-counter"},this.charCount,"/",this.maxLength)),r&&t("div",{key:"c9fbd9a21b7e26fbd9571fc524b6f706404145d3",class:"form-control-helper"},this.isInvalid&&t("dropi-icon",{key:"8fc6e34849f9e3175097597280a3bea9defb6bb0",name:"Warning-circle",iconWidth:"12px",iconHeight:"12px",color:"Error-Error-500"}),t("span",{key:"68bf62627efb3de92afe54f7803e322f5a0462e4",class:{"invalid-color":this.isInvalid},style:{color:this.disabled?"var(--Gray-Gray-400)":void 0}},this.textHelper)))}static get formAssociated(){return!0}static get watchers(){return{textAreaProperties:[{textAreaPropertiesChanged:0}],value:[{valueChanged:0}]}}};o.style=":host{display:flex;flex-direction:column;width:100%}*,*::before,*::after{box-sizing:border-box}.textarea-wrapper{position:relative;width:100%;display:flex;flex-direction:column;gap:4px}.textarea-wrapper label{font-size:var(--font-size-xs, 10px);font-weight:var(--font-weight-regular, 400);color:var(--Gray-Gray-600, #475066)}.asterisk{color:var(--Error-Error-500, #f46a6b)}.textarea-container{position:relative;display:flex;flex-direction:column}textarea.form-control{box-sizing:border-box;width:100%;flex:1;overflow:auto;padding:var(--Size-3, 12px);border:1px solid var(--Gray-Gray-200, #c3c9d9);border-radius:var(--Border-2, 8px);font-size:var(--font-size-s, 12px);font-family:inherit;color:var(--Gray-Gray-700, #32394d);background:var(--Neutral-White, #ffffff);transition:border-color 0.3s ease-in-out;outline:none;appearance:none}textarea.form-control:focus{border-color:var(--Info-Info-500, #50a5f1)}textarea.form-control:focus::placeholder{color:var(--Gray-Gray-400, #858ea6)}textarea.form-control-valid{border-color:var(--Gray-Gray-400, #858ea6) !important;color:var(--Gray-Gray-600, #475066)}textarea.form-control-invalid{border-color:var(--Error-Error-500, #f46a6b) !important;color:var(--Gray-Gray-600, #475066)}textarea.form-control:disabled{border-color:var(--Gray-Gray-200, #c3c9d9) !important;color:var(--Gray-Gray-400, #858ea6);background-color:var(--Gray-Gray-50, #f7f8fa);cursor:not-allowed}.char-counter{position:absolute;bottom:10px;right:16px;font-size:var(--font-size-xs, 10px);color:var(--Gray-Gray-500, #69738c);pointer-events:none}.form-control-helper{display:flex;gap:4px;align-items:center}.form-control-helper span{display:block;color:var(--Gray-Gray-600, #475066);font-size:var(--font-size-xs, 10px)}.invalid-color{color:var(--Error-Error-500, #f46a6b) !important}";export{o as dropi_text_area}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as t,a,h as r}from"./p-B-h7fjQz.js";const i=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],o=["Do","Lu","Ma","Mi","Ju","Vi","Sa"],n=class{constructor(a){e(this,a),this.dropiChangeDate=t(this,"dropiChangeDate"),this.dropiClosePanel=t(this,"dropiClosePanel"),this.dropiRangeChange=t(this,"dropiRangeChange"),a.$hostElement$["s-ei"]?this.internals=a.$hostElement$["s-ei"]:(this.internals=a.$hostElement$.attachInternals(),a.$hostElement$["s-ei"]=this.internals)}internals;name="";selectedDate="";startDate="";endDate="";valueChanged(){this.updateFormValue()}selectionMode="single";minDate="";maxDate="";label=null;placeholder="DD/MM/YYYY";disabled=!1;isInvalid=!1;loading=!1;open=!1;viewYear=(new Date).getFullYear();viewMonth=(new Date).getMonth();hoverDate="";get el(){return a(this)}handleDocClick(e){this.open&&!e.composedPath().includes(this.el)&&(this.open=!1)}dropiChangeDate;dropiClosePanel;dropiRangeChange;componentWillLoad(){this.updateFormValue()}updateFormValue(){this.internals.setFormValue("range"===this.selectionMode?this.startDate&&this.endDate?`${this.startDate},${this.endDate}`:"":this.selectedDate||"")}get displayValue(){return"range"===this.selectionMode?this.startDate&&this.endDate?`${this.startDate} – ${this.endDate}`:this.startDate?this.startDate:"":this.selectedDate}open_(){if(!this.disabled){if(this.selectedDate){const e=new Date(this.selectedDate);this.viewYear=e.getFullYear(),this.viewMonth=e.getMonth()}else if(this.startDate){const e=new Date(this.startDate);this.viewYear=e.getFullYear(),this.viewMonth=e.getMonth()}this.open=!0}}prevMonth(){0===this.viewMonth?(this.viewMonth=11,this.viewYear--):this.viewMonth--}nextMonth(){11===this.viewMonth?(this.viewMonth=0,this.viewYear++):this.viewMonth++}toISO(e,t,a){return`${e}-${String(t+1).padStart(2,"0")}-${String(a).padStart(2,"0")}`}isDisabled(e){return!!(this.minDate&&e<this.minDate)||!!(this.maxDate&&e>this.maxDate)}isInRange(e){if("range"!==this.selectionMode)return!1;const t=this.startDate,a=this.endDate||this.hoverDate;if(!t||!a)return!1;const[r,i]=t<=a?[t,a]:[a,t];return e>r&&e<i}selectDate(e){if(!this.isDisabled(e))return"range"!==this.selectionMode?(this.selectedDate=e,this.open=!1,void this.dropiChangeDate.emit(e)):void(!this.startDate||this.startDate&&this.endDate?(this.startDate=e,this.endDate=""):(e<this.startDate?(this.endDate=this.startDate,this.startDate=e):this.endDate=e,this.open=!1,this.dropiRangeChange.emit({start:this.startDate,end:this.endDate})))}buildDays(){const e=this.viewYear,t=this.viewMonth,a=new Date(e,t,1).getDay(),r=new Date(e,t+1,0).getDate(),i=new Date(e,t,0).getDate(),o=[];for(let r=a-1;r>=0;r--){const a=i-r;o.push({iso:this.toISO(0===t?e-1:e,0===t?11:t-1,a),day:a,currentMonth:!1})}for(let a=1;a<=r;a++)o.push({iso:this.toISO(e,t,a),day:a,currentMonth:!0});const n=42-o.length;for(let a=1;a<=n;a++)o.push({iso:this.toISO(11===t?e+1:e,11===t?0:t+1,a),day:a,currentMonth:!1});return o}render(){const e=this.buildDays(),t=(new Date).toISOString().slice(0,10);return r("div",{key:"97a96b56b0e8ae551f747bad4a3459a1f4945411",class:"dp-wrap"},this.label&&r("label",{key:"a1792032ab9ae2dbe574f50b7a537df687eae40c",class:"dp-label"},this.label),r("button",{key:"4237c2b988f1e9fbaa77dc2a989964216e3fe902",class:{"dp-trigger":!0,"dp-trigger--disabled":this.disabled,"dp-trigger--invalid":this.isInvalid,"dp-trigger--loading":this.loading},onClick:()=>this.open?this.open=!1:this.open_(),disabled:this.disabled||this.loading,type:"button"},r("dropi-icon",{key:"39591fedb92b92e6507b564fc8c145711f1a21b1",name:"Calendar",iconWidth:"16px",iconHeight:"16px",color:"Gray-Gray-400"}),r("span",{key:"305e3f81d64c01603687d53edc59e1d19ef06c3c",class:{"dp-trigger__value":!0,"dp-trigger__placeholder":!this.displayValue}},this.displayValue||this.placeholder),r("dropi-icon",{key:"13feb346ad7b07a7e2f208e299f62a8261a97655",name:"Arrow-Down-2",iconWidth:"12px",iconHeight:"12px",color:"Gray-Gray-400"})),this.open&&r("div",{key:"4cdf8a69422a0b54d0f7c1a6711a683dab7d1f34",class:"dp-popup"},r("div",{key:"0c6fb31094003c66c5b471e738dd75e7b865401f",class:"dp-nav"},r("button",{key:"4fa24f9450cf6c5e888cea374619e14245c0c005",class:"dp-nav__btn",onClick:()=>this.prevMonth(),type:"button"},r("dropi-icon",{key:"2196f85700b252d4f83536f11ed197c083fc45ec",name:"Arrow-Left-2",iconWidth:"16px",iconHeight:"16px",color:"Gray-Gray-600"})),r("span",{key:"01619de7c5218b506f75234745f3184af813a491",class:"dp-nav__title"},r("span",{key:"8074e7deeb6c102bad7f1911739e785187783a7c"},i[this.viewMonth]),r("span",{key:"69e9c3b41361e293a843f911b5bcf4690995d2b4"},this.viewYear)),r("button",{key:"51c0ad3da96835736170fbf94338fd70c942c3d2",class:"dp-nav__btn",onClick:()=>this.nextMonth(),type:"button"},r("dropi-icon",{key:"24eb4385639c9a71f5312f32b33b36593c2b0259",name:"Arrow-Right-2",iconWidth:"16px",iconHeight:"16px",color:"Gray-Gray-600"}))),r("div",{key:"c18cecd81af38b3a6f23402501011c09b8b453d7",class:"dp-grid"},o.map((e=>r("div",{class:"dp-day-header"},e))),e.map((({iso:e,day:a,currentMonth:i})=>{const o="range"!==this.selectionMode?e===this.selectedDate:e===this.startDate||e===this.endDate,n="range"===this.selectionMode&&e===this.startDate,s="range"===this.selectionMode&&e===this.endDate,d=this.isInRange(e),l=this.isDisabled(e);return r("button",{class:{"dp-cell":!0,"dp-cell--other-month":!i,"dp-cell--today":e===t,"dp-cell--selected":o,"dp-cell--range-start":n,"dp-cell--range-end":s,"dp-cell--in-range":d,"dp-cell--disabled":l},type:"button",disabled:l,onClick:()=>this.selectDate(e),onMouseEnter:()=>{"range"===this.selectionMode&&this.startDate&&!this.endDate&&(this.hoverDate=e)},onMouseLeave:()=>this.hoverDate=""},a)}))),r("div",{key:"594f280cb269c32ac3a129401e13b710af1a7c7e",class:"dp-footer"},r("button",{key:"6028ef84bc17f0d1bb0fd587a991698a8fc69338",class:"dp-footer__clear",type:"button",onClick:()=>{this.selectedDate="",this.startDate="",this.endDate="",this.open=!1}},"Limpiar"),r("button",{key:"ab01840a18d657621205d4fba69cc53feb474d11",class:"dp-footer__today",type:"button",onClick:()=>{"range"!==this.selectionMode?(this.selectedDate=t,this.open=!1,this.dropiChangeDate.emit(t)):(this.startDate=t,this.endDate="")}},"Hoy"))))}static get formAssociated(){return!0}static get watchers(){return{selectedDate:[{valueChanged:0}],startDate:[{valueChanged:0}],endDate:[{valueChanged:0}]}}};n.style=':host{display:block;width:100%;position:relative}*,*::before,*::after{box-sizing:border-box}.dp-label{display:block;font-size:var(--font-size-xxs, 10px);color:var(--Gray-Gray-600, #475066);margin-bottom:4px}.dp-trigger{width:100%;height:44px;display:flex;align-items:center;gap:var(--Size-2, 8px);padding:0 var(--Size-3, 12px);border:1px solid var(--Gray-Gray-200, #c3c9d9);border-radius:var(--Border-2, 8px);background:var(--Neutral-White, #ffffff);cursor:pointer;font-family:inherit;transition:border-color 0.2s}.dp-trigger:hover:not(:disabled){border-color:var(--Info-Info-500, #50a5f1)}.dp-trigger--disabled{background:var(--Gray-Gray-50, #f7f8fa);cursor:not-allowed;opacity:0.6}.dp-trigger__value{flex:1;text-align:left;font-size:var(--font-size-xs, 12px);color:var(--Gray-Gray-700, #32394d);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dp-trigger__placeholder{color:var(--Gray-Gray-400, #858ea6)}.dp-popup{position:absolute;top:calc(100% + 8px);left:0;width:320px;background:var(--Neutral-White, #ffffff);border:1px solid var(--Gray-Gray-200, #c3c9d9);border-radius:var(--Border-3, 12px);box-shadow:0 4px 16px rgba(0,0,0,0.08);z-index:300;padding:var(--Size-4, 16px)}.dp-nav{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--Size-4, 16px)}.dp-nav__btn{background:none;border:none;padding:0;cursor:pointer;border-radius:50%;display:flex;align-items:center;justify-content:center;width:32px;height:32px;transition:background 0.15s}.dp-nav__btn:hover{background:var(--Gray-Gray-50, #f7f8fa)}.dp-nav__title{font-size:var(--font-size-s, 14px);font-weight:var(--font-weight-bold, 700);color:var(--Gray-Gray-700, #32394d);display:flex;gap:8px}.dp-grid{display:grid;grid-template-columns:repeat(7, 1fr);row-gap:8px;column-gap:4px}.dp-day-header{font-size:var(--font-size-s, 14px);color:var(--Gray-Gray-700, #32394d);text-align:center;padding:8px 0;font-weight:var(--font-weight-bold, 700)}.dp-cell{aspect-ratio:1;display:flex;align-items:center;justify-content:center;font-size:var(--font-size-xs, 12px);font-family:inherit;border:none;cursor:pointer;background:transparent;color:var(--Gray-Gray-600, #475066);width:100%;position:relative;z-index:1;padding:0}.dp-cell::after{content:"";position:absolute;top:0;left:0;right:0;bottom:0;border-radius:50%;transition:all 0.2s;z-index:-1;background:transparent}.dp-cell::before{content:"";position:absolute;top:0;bottom:0;z-index:-2;border-radius:0;background:transparent}.dp-cell:hover:not(:disabled)::after{background:var(--Gray-Gray-100, #e6eaf2)}.dp-cell--other-month{color:var(--Gray-Gray-300, #a0a9c0)}.dp-cell--today{font-weight:var(--font-weight-bold, 700)}.dp-cell--today::after{background:var(--Gray-Gray-100, #e6eaf2)}.dp-cell--selected{color:var(--Neutral-White, #ffffff);font-weight:var(--font-weight-bold, 700)}.dp-cell--selected::after{background:var(--Orange-orange-500, #f49a3d) !important}.dp-cell--range-start,.dp-cell--range-end{color:var(--Neutral-White, #ffffff);font-weight:var(--font-weight-bold, 700)}.dp-cell--range-start::after,.dp-cell--range-end::after{background:var(--Orange-orange-500, #f49a3d) !important}.dp-cell--in-range{color:var(--Orange-orange-500, #f49a3d);font-weight:var(--font-weight-bold, 700)}.dp-cell--in-range::before{left:-2px;right:-2px;background:var(--Orange-orange-50, #fef5ec)}.dp-cell--range-start::before{left:50%;right:-2px;background:var(--Orange-orange-50, #fef5ec)}.dp-cell--range-end::before{left:-2px;right:50%;background:var(--Orange-orange-50, #fef5ec)}.dp-cell--range-start.dp-cell--range-end::before{background:transparent}.dp-cell--disabled{opacity:0.35;cursor:not-allowed}.dp-footer{display:flex;justify-content:space-between;margin-top:var(--Size-3, 12px);border-top:1px solid var(--Gray-Gray-100, #e6eaf2);padding-top:var(--Size-2, 8px)}.dp-footer__clear,.dp-footer__today{background:none;border:none;padding:4px 8px;font-size:var(--font-size-xxs, 10px);font-family:inherit;cursor:pointer;border-radius:var(--Border-1, 4px);transition:background 0.15s}.dp-footer__clear{color:var(--Gray-Gray-500, #69738c)}.dp-footer__today{color:var(--Orange-orange-500, #f49a3d);font-weight:var(--font-weight-bold, 700)}.dp-footer__clear:hover{background:var(--Gray-Gray-50, #f7f8fa)}.dp-footer__today:hover{background:var(--Orange-orange-50, #fef5ec)}';export{n as dropi_date_picker}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,c as t,a as e,h as r}from"./p-B-h7fjQz.js";const o=class{constructor(e){i(this,e),this.dropiChangeSelect=t(this,"dropiChangeSelect"),this.dropiClear=t(this,"dropiClear"),this.dropiSearch=t(this,"dropiSearch"),this.dropiScrollEnd=t(this,"dropiScrollEnd"),this.dropiKeyEnter=t(this,"dropiKeyEnter"),e.$hostElement$["s-ei"]?this.internals=e.$hostElement$["s-ei"]:(this.internals=e.$hostElement$.attachInternals(),e.$hostElement$["s-ei"]=this.internals)}get el(){return e(this)}internals;buttonRef;scrollDebounce;hasEmittedScrollEnd=!1;lastScrollTop=0;label="";placeholder="Select";options=[];name="";disabled=!1;hasError=!1;errorText="";textHelper="";showObligatory=!1;searchEnabled=!1;multiSelect=!1;dropdownType=!1;showCountryFlags=!1;radioOptions=!1;placeHolderSearch="Buscar";preIcon="";defaultSelectedId;selectedOption=null;overlayClass="";withinModal=!1;selectProperties=null;isOpen=!1;_selectedOption=null;multiSelected=[];filteredOptions=[];searchTerm="";dropdownStyle={top:"0px",left:"0px",width:"0px"};dropiChangeSelect;dropiClear;dropiSearch;dropiScrollEnd;dropiKeyEnter;componentWillLoad(){this.selectProperties&&this.selectPropertiesChanged(this.selectProperties),this.normalizeOptions(),this.filteredOptions=[...this.options],this.applyDefaultSelection()}selectPropertiesChanged(i){i&&(void 0!==i.label&&(this.label=i.label),void 0!==i.placeholder&&(this.placeholder=i.placeholder),void 0!==i.options&&(this.options=i.options),void 0!==i.showObligatory&&(this.showObligatory=i.showObligatory),void 0!==i.textHelper&&(this.textHelper=i.textHelper),void 0!==i.searchEnabled&&(this.searchEnabled=i.searchEnabled),void 0!==i.multiSelect&&(this.multiSelect=i.multiSelect),void 0!==i.dropdownType&&(this.dropdownType=i.dropdownType),void 0!==i.hasError&&(this.hasError=i.hasError),void 0!==i.errorText&&(this.errorText=i.errorText),void 0!==i.radioOptions&&(this.radioOptions=i.radioOptions),void 0!==i.preIcon&&(this.preIcon=i.preIcon))}optionsChanged(){this.normalizeOptions(),this.filteredOptions=[...this.options],this.applyDefaultSelection()}normalizeOptions(){if(this.options){if("string"==typeof this.options)try{this.options=JSON.parse(this.options)}catch(i){this.options=[]}}else this.options=[]}defaultChanged(i){this.applyDefaultSelection(i)}valueChanged(i){this._selectedOption=i,this.internals.setFormValue(i?String(i.id):"")}async setById(i){const t=this.options.find((t=>t.id===i||String(t.id)===String(i)));t&&this.selectOption(t)}async setByLabel(i){const t=this.options.find((t=>t.label===i));t&&this.selectOption(t)}async clearSelection(){this._selectedOption=null,this.multiSelected=[],this.internals.setFormValue(""),this.dropiClear.emit()}async resetMultiSelect(i){this.multiSelected=[],this.internals.setFormValue("")}handleWindowScroll(i){this.isOpen&&!this.withinModal&&i.target!==this.el&&this.closeDropdown()}handleWindowResize(){this.isOpen&&!this.withinModal&&this.closeDropdown()}handleOutsideClick(i){this.isOpen&&!i.composedPath().includes(this.el)&&this.closeDropdown()}applyDefaultSelection(i){const t=i??this.defaultSelectedId;if(""===t||null==t)return;const e=this.flatOptions().find((i=>i.id===t||String(i.id)===String(t)));e&&(this._selectedOption=e,this.internals.setFormValue(String(e.id)))}flatOptions(){return this.options?.length?"category"in this.options[0]?this.options.flatMap((i=>i.options)):this.options:[]}get isGrouped(){return this.options?.length>0&&"category"in this.options[0]}get triggerLabel(){return this.multiSelect?this.multiSelected.length?this.multiSelected.map((i=>i.label)).join(", "):this.placeholder:this._selectedOption?this.showCountryFlags&&this._selectedOption.shortLabel?this._selectedOption.shortLabel:this._selectedOption.label:this.placeholder}updateDropdownPosition(){if(!this.buttonRef)return;const i=this.buttonRef.getBoundingClientRect(),t=window.innerHeight;this.dropdownStyle={top:`${t-i.bottom>=250?i.bottom+4:i.top-250-4}px`,left:`${i.left}px`,width:`${i.width}px`}}openDropdown(){this.withinModal?this.dropdownStyle={top:`${this.el.offsetHeight}px`,left:"0px",width:"100%"}:this.updateDropdownPosition(),this.isOpen=!0,this.searchEnabled&&setTimeout((()=>{const i=this.el.shadowRoot?.querySelector(".search-input");i?.focus()}),50)}closeDropdown(){this.isOpen=!1,this.searchTerm="",this.filteredOptions=[...this.options]}toggleDropdown(){this.isOpen?this.closeDropdown():this.openDropdown()}selectOption(i){if(!i.disabled)if(this.multiSelect){const t=this.multiSelected.findIndex((t=>t.id===i.id));this.multiSelected=t>=0?this.multiSelected.filter((t=>t.id!==i.id)):[...this.multiSelected,i],this.internals.setFormValue(this.multiSelected.map((i=>i.id)).join(",")),this.dropiChangeSelect.emit([...this.multiSelected])}else this._selectedOption=i,this.internals.setFormValue(String(i.id)),this.dropiChangeSelect.emit(i),this.closeDropdown()}isOptionChecked(i){return this.multiSelected.some((t=>t.id===i.id))}handleSearch(i){this.searchTerm=i,this.dropiSearch.emit(i);const t=i.toLowerCase().trim();this.filteredOptions=t?this.isGrouped?this.options.map((i=>({...i,options:i.options.filter((i=>i.label.toLowerCase().includes(t)))}))).filter((i=>i.options.length>0)):this.options.filter((i=>i.label.toLowerCase().includes(t))):[...this.options]}handleScroll(i){const t=i.target;clearTimeout(this.scrollDebounce),this.scrollDebounce=setTimeout((()=>{if(!t)return;const i=t.scrollHeight-t.scrollTop-t.clientHeight,e=Math.min(50,t.clientHeight/2);t.scrollTop<this.lastScrollTop&&(this.hasEmittedScrollEnd=!1),this.lastScrollTop=t.scrollTop,i<=e&&!this.hasEmittedScrollEnd&&(this.dropiScrollEnd.emit(),this.hasEmittedScrollEnd=!0,setTimeout((()=>{this.hasEmittedScrollEnd=!1}),1e3))}),100)}renderTrigger(){const i=this.disabled?"Gray-Gray-300":this.dropdownType?"Gray-Gray-600":"Gray-Gray-400",t=this.dropdownType?"24px":"20px";return r("button",{type:"button",class:{"select-button":!0,"select-completed":this.multiSelect?this.multiSelected.length>0:!!this._selectedOption,"select-button-error":this.hasError,"no-border":this.dropdownType},disabled:this.disabled,ref:i=>this.buttonRef=i,onClick:()=>this.toggleDropdown()},r("div",{class:{"button-content":!0,"option-radio":this.radioOptions&&!!this._selectedOption&&!this.multiSelect}},this.preIcon&&r("dropi-icon",{name:this.preIcon,iconWidth:"20px",iconHeight:"20px",color:"Gray-Gray-500"}),this.radioOptions&&this._selectedOption&&!this.multiSelect&&[this._selectedOption.imageUrl&&!this._selectedOption.isFallback?r("img",{class:"option-image small-image",src:this._selectedOption.imageUrl,alt:"",onError:()=>{this._selectedOption&&(this._selectedOption={...this._selectedOption,isFallback:!0})}}):this._selectedOption.isFallback?r("span",{class:"option-image-fallback small-image"},this._selectedOption.label.charAt(0).toUpperCase()):null,r("div",{class:"labels-container elipsis"},r("span",null,this._selectedOption.label),this._selectedOption.secondLabel&&r("span",{class:"option-second-label"},this._selectedOption.secondLabel))],!(this.radioOptions&&this._selectedOption&&!this.multiSelect)&&r("div",{class:"elipsis"},this.triggerLabel)),r("dropi-icon",{name:this.isOpen?"Dropdown-up":"Dropdown-down",iconWidth:t,iconHeight:t,color:i}))}renderOption(i){const t=this.multiSelect?this.isOptionChecked(i):this._selectedOption?.id===i.id;return r("li",{key:i.id},r("button",{type:"button",class:{option:!0,"option-radio":this.radioOptions,"option-with-flag":this.showCountryFlags&&!!i.countryCode,"disabled-option":!!i.disabled,"selected-option":t},disabled:i.disabled,onClick:()=>this.selectOption(i)},this.multiSelect&&r("span",{class:{"multi-checkbox":!0,checked:t}},t&&r("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none"},r("path",{d:"M20.6 5.7L9.1 17.2c-.2.2-.5.3-.8.3s-.6-.1-.8-.3L3 12.8c-.4-.4-.4-1 0-1.4.4-.4 1-.4 1.4 0l3.9 3.9L19.2 4.3c.4-.4 1-.4 1.4 0 .4.4.4 1 0 1.4z",fill:"white"}))),this.radioOptions&&r("div",{class:{radio:!0,selected:t}},t&&r("div",{class:"circle"})),!this.radioOptions&&i.preIcon&&r("dropi-icon",{name:i.preIcon,iconWidth:"20px",iconHeight:"20px",color:"Gray-Gray-500"}),this.radioOptions&&i.imageUrl&&!i.isFallback&&r("img",{class:"option-image",src:i.imageUrl,alt:"",onError:()=>{i.isFallback=!0,this.options=[...this.options]}}),this.radioOptions&&i.isFallback&&r("span",{class:"option-image-fallback"},i.label.charAt(0).toUpperCase()),this.showCountryFlags&&i.countryCode&&r("span",{class:"flag-placeholder"},i.countryCode),this.radioOptions?r("div",{class:"labels-container"},r("span",{class:"elipsis"},i.label),i.secondLabel&&r("span",{class:"option-second-label"},i.secondLabel)):r("span",{class:"elipsis"},this.showCountryFlags&&i.shortLabel?i.shortLabel:i.label)))}renderDropdown(){return this.isOpen?r("ul",{class:`select-dropdown-overlay ${this.overlayClass} ${this.withinModal?"within-modal":""}`,style:this.dropdownStyle,onScroll:i=>this.handleScroll(i)},this.searchEnabled&&r("li",{class:"sticky-search"},r("div",{class:"search-wrapper"},r("dropi-icon",{name:"Search",iconWidth:"16px",iconHeight:"16px",color:"Gray-Gray-400"}),r("input",{class:"search-input",type:"text",placeholder:this.placeHolderSearch,value:this.searchTerm,onInput:i=>this.handleSearch(i.target.value),onKeyDown:i=>{"Enter"===i.key&&this.dropiKeyEnter.emit(i)}}),this.searchTerm&&r("button",{type:"button",class:"search-clear",onClick:()=>this.handleSearch("")},r("dropi-icon",{name:"Close",iconWidth:"14px",iconHeight:"14px",color:"Gray-Gray-400"})))),this.isGrouped&&this.filteredOptions.map((i=>[r("li",{class:"option-group-title"},i.category),...i.options.map((i=>r("li",{key:i.id},r("button",{type:"button",class:{option:!0,"option-group":!0,"disabled-option":!!i.disabled},disabled:i.disabled,onClick:()=>this.selectOption(i)},i.preIcon&&r("dropi-icon",{name:i.preIcon,iconWidth:"20px",iconHeight:"20px",color:"Gray-Gray-500"}),r("span",{class:"elipsis"},i.label)))))])),!this.isGrouped&&this.filteredOptions.map((i=>this.renderOption(i))),0===this.filteredOptions.length&&r("li",{class:"no-results"},"Sin resultados")):null}render(){return r("div",{key:"f09113a288d45bb5519503bb78c41e236913c1eb",class:"custom-select"},!this.dropdownType&&this.label&&r("label",{key:"c0b59763dc3529d7f9bb5597a2bea0d38070a07b",class:{"disabled-label":this.disabled}},this.label,this.showObligatory&&!this.disabled&&r("span",{key:"6c8a47bdfc216231ba72420298b3bc8deeeae435",class:"asterisk"}," *")),r("div",{key:"8ec45010af1252effe34bb69d3f40ea277459511",class:"dropdown-container"},this.dropdownType&&this.label&&r("div",{key:"b3f7f9adacd57b091baac662fc7be6fcd847c3a4",class:"left-label"},this.label),this.renderTrigger()),this.textHelper&&!this.hasError&&r("div",{key:"a4cce833b50b2bc62cb7142da420f81c0647e97e",class:"select-helper"},r("span",{key:"f69375abc2f66b5b1278895b8f313adabfa0f938"},this.textHelper)),this.hasError&&this.errorText&&r("div",{key:"6681bdbb705633d393adab09a889f3f1fb6fbe8a",class:"select-helper-error"},r("dropi-icon",{key:"09521eeef2cf2a58cb74bea5bfae8a6d58d17682",name:"Warning-circle",iconWidth:"12px",iconHeight:"12px",color:"Error-Error-500"}),r("span",{key:"807820bb0a474079627bf12c20f4a034896785cd"},this.errorText)),this.renderDropdown())}static get formAssociated(){return!0}static get watchers(){return{selectProperties:[{selectPropertiesChanged:0}],options:[{optionsChanged:0}],defaultSelectedId:[{defaultChanged:0}],selectedOption:[{valueChanged:0}]}}};o.style=":host{display:block;width:100%;text-align:left}*,*::before,*::after{box-sizing:border-box}.custom-select{position:relative;width:100%}.custom-select label{display:block;font-size:var(--font-size-xs, 10px);font-weight:var(--font-weight-regular, 400);color:var(--Gray-Gray-600, #475066)}.disabled-label{color:var(--Gray-Gray-400, #858ea6) !important}.asterisk{color:var(--Error-Error-500, #f46a6b)}.dropdown-container{display:flex;align-items:center;gap:4px}.left-label{color:var(--Gray-Gray-600, #475066);font-size:var(--font-size-m, 14px);white-space:nowrap}.select-button{box-sizing:border-box;width:100%;height:40px;padding:0 0.75rem;border:1px solid var(--Gray-Gray-200, #c3c9d9);border-radius:var(--Border-2, 8px);background:var(--Neutral-White, #ffffff);color:var(--Gray-Gray-500, #69738c);font-size:var(--font-size-s, 12px);font-family:inherit;display:flex;justify-content:space-between;align-items:center;text-align:left;cursor:pointer;transition:border-color 0.2s ease;gap:8px}.select-button:focus{outline:none;border-color:var(--Info-Info-500, #50a5f1)}.select-button:disabled{border-color:var(--Gray-Gray-200, #c3c9d9);color:var(--Gray-Gray-400, #858ea6);background-color:var(--Gray-Gray-50, #f7f8fa);cursor:not-allowed}.select-completed{border-color:var(--Gray-Gray-400, #858ea6);color:var(--Gray-Gray-600, #475066)}.select-button-error{border-color:var(--Error-Error-500, #f46a6b) !important}.no-border{border:none !important;color:var(--Gray-Gray-600, #475066);padding:var(--Size-4, 16px);background-color:transparent !important;gap:var(--Size-2, 8px)}.no-border:disabled{background-color:transparent !important}.button-content{display:flex;align-items:center;gap:8px;overflow:hidden;flex:1;min-width:0}.elipsis{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select-dropdown-overlay{position:fixed;max-height:250px;overflow-y:auto;list-style:none;padding:var(--Size-4, 16px) var(--Size-4, 16px) var(--Size-3, 12px);margin:0;border-radius:var(--Border-2, 8px);background:var(--Neutral-White, #ffffff);box-shadow:0px 8px 24px rgba(0, 0, 0, 0.12);z-index:var(--dropi-z-index-overlay, 11000);animation:dropdown-open 120ms ease-out}.select-dropdown-overlay.within-modal{position:absolute}@keyframes dropdown-open{from{opacity:0;transform:scaleY(0.95);transform-origin:top}to{opacity:1;transform:scaleY(1);transform-origin:top}}.option{box-sizing:border-box;width:100%;min-height:40px;border-radius:var(--Border-2, 8px);padding:var(--Size-3, 12px) var(--Size-4, 16px);border:none;background:transparent;text-align:left;color:var(--Gray-Gray-600, #475066);font-size:var(--font-size-s, 12px);font-family:inherit;cursor:pointer;display:flex;align-items:center;gap:var(--Size-2, 8px);transition:background 0.15s ease}.option:hover:not(:disabled){background:var(--Gray-Gray-50, #f7f8fa)}.option:disabled,.disabled-option{opacity:0.5;cursor:not-allowed}.option.selected-option:not(.option-radio){background:var(--Primary-Primary-50, #fef8f2);color:var(--Primary-Primary-500, #f49a3d)}.option-group-title{padding:var(--Size-3, 12px) var(--Size-4, 16px);font-size:var(--font-size-s, 12px);font-weight:var(--font-weight-medium, 500);color:var(--Gray-Gray-500, #69738c);list-style:none}.option-group{padding-left:var(--Size-6, 32px)}.sticky-search{position:sticky;top:calc(-1 * var(--Size-4, 16px));background:var(--Neutral-White, #ffffff);z-index:10;margin:calc(-1 * var(--Size-4, 16px)) calc(-1 * var(--Size-4, 16px)) 0;padding:var(--Size-2, 8px) var(--Size-4, 16px);border-bottom:1px solid var(--Gray-Gray-100, #e6eaf2);list-style:none}.search-wrapper{display:flex;align-items:center;gap:8px;border:1px solid var(--Gray-Gray-200, #c3c9d9);border-radius:var(--Border-2, 8px);padding:6px 10px;background:var(--Neutral-White, #ffffff)}.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}.search-input::placeholder{color:var(--Gray-Gray-400, #858ea6)}.search-clear{background:none;border:none;cursor:pointer;padding:0;display:flex;align-items:center}.multi-checkbox{width:18px;height:18px;min-width:18px;border-radius:var(--Border-1, 4px);border:2px solid var(--Gray-Gray-200, #c3c9d9);display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:background 0.15s, border-color 0.15s}.multi-checkbox.checked{background:var(--Primary-Primary-500, #f49a3d);border-color:var(--Primary-Primary-500, #f49a3d)}.option-radio{display:flex;align-items:center;gap:12px}.option-radio.selected-option{border-radius:var(--Border-2, 8px);background:var(--Primary-Primary-50, #fef8f2);color:var(--Primary-Primary-500, #f49a3d)}.option-radio.selected-option .option-second-label{color:var(--Primary-Primary-500, #f49a3d)}.radio{width:20px;height:20px;min-width:20px;border-radius:50%;border:2px solid var(--Gray-Gray-200, #c3c9d9);display:flex;align-items:center;justify-content:center;flex-shrink:0}.radio.selected{border-color:var(--Primary-Primary-500, #f49a3d)}.circle{width:12px;height:12px;border-radius:50%;background:var(--Primary-Primary-500, #f49a3d)}.labels-container{display:flex;justify-content:space-between;width:100%;min-width:0}.option-image{width:24px;height:24px;border-radius:60px;object-fit:cover;flex-shrink:0}.small-image{width:20px;height:20px}.option-image-fallback{width:24px;height:24px;border-radius:60px;background:var(--Primary-Primary-500, #f49a3d);color:white;font-size:13px;font-weight:var(--font-weight-bold);display:flex;justify-content:center;align-items:center;flex-shrink:0}.small-image.option-image-fallback{width:20px;height:20px}.option-second-label{color:var(--Gray-Gray-700, #32394d);font-weight:var(--font-weight-bold);white-space:nowrap}.flag-placeholder{font-size:11px;font-weight:var(--font-weight-semibold);color:var(--Gray-Gray-500, #69738c);flex-shrink:0}.select-helper,.select-helper-error{display:flex;gap:var(--Size-1, 4px);align-items:center;margin-top:var(--Size-1, 4px)}.select-helper span{color:var(--Gray-Gray-600, #475066);font-size:var(--font-size-xs, 10px)}.select-helper-error span{color:var(--Error-Error-500, #f46a6b);font-size:var(--font-size-xs, 10px)}.no-results{padding:var(--Size-3, 12px) var(--Size-4, 16px);color:var(--Gray-Gray-400, #858ea6);font-size:var(--font-size-s, 12px);list-style:none;text-align:center}";export{o as dropi_select}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as e,h as i}from"./p-B-h7fjQz.js";const s=class{constructor(i){t(this,i),this.codeCompleted=e(this,"codeCompleted"),this.codeAccepted=e(this,"codeAccepted"),this.dropiResend=e(this,"dropiResend"),i.$hostElement$["s-ei"]?this.internals=i.$hostElement$["s-ei"]:(this.internals=i.$hostElement$.attachInternals(),i.$hostElement$["s-ei"]=this.internals)}internals;name="";engine="email";labelContact="";showLabelContact=!1;errorMessage="";digitsCount=6;digits=[];digitStates=[];countdown=30;canResend=!1;error=!1;inputs=[];timer;handleDigitsCountChange(t){this.digits=Array(t).fill(""),this.digitStates=Array(t).fill("idle"),this.inputs=[]}codeCompleted;codeAccepted;dropiResend;componentWillLoad(){this.digits=Array(this.digitsCount).fill(""),this.digitStates=Array(this.digitsCount).fill("idle"),this.internals.setFormValue("")}componentDidLoad(){this.startCountdown()}disconnectedCallback(){clearInterval(this.timer)}startCountdown(){this.countdown=30,this.canResend=!1,clearInterval(this.timer),this.timer=setInterval((()=>{this.countdown--,this.countdown<=0&&(clearInterval(this.timer),this.canResend=!0)}),1e3)}handleInput(t,e){const i=t.target.value.replace(/\D/g,"").slice(-1),s=[...this.digits];s[e]=i,this.digits=s;const r=[...this.digitStates];if(r[e]=i?"filled":"idle",this.digitStates=r,i&&e<this.digitsCount-1&&this.inputs[e+1]?.focus(),s.every((t=>""!==t))){const t=s.join("");this.internals.setFormValue(t),this.codeCompleted.emit(t),this.codeAccepted.emit(t)}else this.internals.setFormValue(s.join(""))}handleKeyDown(t,e){"Backspace"===t.key&&!this.digits[e]&&e>0&&this.inputs[e-1]?.focus()}handlePaste(t){t.preventDefault();const e=t.clipboardData?.getData("text")?.replace(/\D/g,"").slice(0,this.digitsCount)||"",i=Array(this.digitsCount).fill("");if(e.split("").forEach(((t,e)=>{i[e]=t})),this.digits=i,this.digitStates=i.map((t=>t?"filled":"idle")),this.inputs[Math.min(e.length,this.digitsCount-1)]?.focus(),i.every((t=>""!==t))){const t=i.join("");this.internals.setFormValue(t),this.codeCompleted.emit(t),this.codeAccepted.emit(t)}else this.internals.setFormValue(i.join(""))}render(){return i("div",{key:"ee2e6766c4b220a1a12b8734747138cf2351a0d8",class:"otp"},this.showLabelContact&&i("p",{key:"87f34e3b13c0e16e584cc03ea8c5a35e462784b1",class:"otp__label"},"Ingresa el código enviado a tu ","sms"===this.engine?"SMS":"2fa"===this.engine?"autenticador":"correo",this.labelContact&&i("strong",{key:"6c9d0c73340ff8dab1730b5d6c9cc0431f3ff21c"}," ",this.labelContact)),i("div",{key:"d82904db02da1da5f863bb86cef65b0da166ff0c",class:"otp__inputs",onPaste:t=>this.handlePaste(t)},this.digits.map(((t,e)=>i("input",{key:e,ref:t=>{t&&(this.inputs[e]=t)},class:{otp__digit:!0,"otp__digit--filled":"filled"===this.digitStates[e],"otp__digit--error":this.error},type:"text",inputMode:"numeric",maxLength:1,value:this.digits[e]??"",onInput:t=>this.handleInput(t,e),onKeyDown:t=>this.handleKeyDown(t,e)})))),this.error&&this.errorMessage&&i("p",{key:"7629619d5b2c4e8f38e2c2bc93ab134242b8e079",class:"otp__error"},this.errorMessage),i("div",{key:"ea5472d4c55f1cdc30304e9e9bcaacf303ba4501",class:"otp__resend"},this.canResend?i("button",{class:"otp__resend-btn",onClick:()=>{this.startCountdown(),this.dropiResend.emit()}},"Reenviar código"):i("span",{class:"otp__countdown"},"Reenviar en ",this.countdown,"s")))}static get formAssociated(){return!0}static get watchers(){return{digitsCount:[{handleDigitsCountChange:0}]}}};s.style=":host{display:block;width:100%}*,*::before,*::after{box-sizing:border-box}.otp{display:flex;flex-direction:column;align-items:center;gap:var(--Size-4, 16px)}.otp__label{font-size:var(--font-size-s, 12px);color:var(--Gray-Gray-600, #475066);text-align:center;margin:0}.otp__inputs{display:flex;gap:var(--Size-4, 16px)}.otp__digit{width:56px;height:56px;border:1.5px solid var(--Gray-Gray-200, #d3d7de);border-radius:var(--Border-2, 8px);text-align:center;font-size:22px;font-weight:var(--font-weight-bold, 700);font-family:inherit;color:var(--Gray-Gray-800, #1f2433);outline:none;transition:border-color 0.15s ease;background:var(--Neutral-White, #ffffff)}.otp__digit:focus{border:2px solid var(--Primary-Primary-500, #f49a3d)}.otp__digit--filled{border:1px solid var(--Success-Success-500, #0abb87);color:var(--Neutral-Neutral-900, #0e111a)}.otp__digit--error{border:1px solid var(--Error-Error-500, #f46a6b)}.otp__error{margin:0;font-size:var(--font-size-xs, 10px);color:var(--Error-Error-500, #f46a6b);text-align:center}.otp__resend{text-align:center}.otp__countdown{font-size:var(--font-size-xs, 10px);color:var(--Gray-Gray-400, #858ea6)}.otp__resend-btn{background:none;border:none;padding:0;font-size:var(--font-size-s, 12px);font-weight:var(--font-weight-bold, 700);color:var(--Primary-Primary-500, #f49a3d);cursor:pointer;text-decoration:underline}";export{s as dropi_otp_send_code}
|
|
@@ -6,7 +6,15 @@ const DropiButton = class {
|
|
|
6
6
|
constructor(hostRef) {
|
|
7
7
|
registerInstance(this, hostRef);
|
|
8
8
|
this.dropiClick = createEvent(this, "dropiClick");
|
|
9
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
10
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
14
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
15
|
+
}
|
|
9
16
|
}
|
|
17
|
+
internals;
|
|
10
18
|
/** Visual color palette */
|
|
11
19
|
type = 'default';
|
|
12
20
|
/** Primary (filled) | Secondary (outlined) | Tertiary (ghost) */
|
|
@@ -25,6 +33,8 @@ const DropiButton = class {
|
|
|
25
33
|
customIconColor = '';
|
|
26
34
|
/** Button label */
|
|
27
35
|
text = '';
|
|
36
|
+
/** Native HTML button type (submit, reset, button) */
|
|
37
|
+
nativeType = 'button';
|
|
28
38
|
/** Emitted on click (not emitted when disabled or loading) */
|
|
29
39
|
dropiClick;
|
|
30
40
|
colorMap = {
|
|
@@ -59,6 +69,12 @@ const DropiButton = class {
|
|
|
59
69
|
handleClick(e) {
|
|
60
70
|
if (this.state !== 'disabled' && this.state !== 'loading') {
|
|
61
71
|
this.dropiClick.emit(e);
|
|
72
|
+
if (this.nativeType === 'submit') {
|
|
73
|
+
this.internals.form?.requestSubmit();
|
|
74
|
+
}
|
|
75
|
+
else if (this.nativeType === 'reset') {
|
|
76
|
+
this.internals.form?.reset();
|
|
77
|
+
}
|
|
62
78
|
}
|
|
63
79
|
}
|
|
64
80
|
renderLoadingSpinner() {
|
|
@@ -69,7 +85,7 @@ const DropiButton = class {
|
|
|
69
85
|
const hasText = (this.text ?? '') !== '';
|
|
70
86
|
const showPostIcon = (this.postIcon ?? '') !== '' || (this.type ?? 'default') === 'dropdown';
|
|
71
87
|
const dropdownIcon = (this.type ?? 'default') === 'dropdown' ? 'Dropdown-down' : (this.postIcon ?? '');
|
|
72
|
-
return (h("button", { key: '
|
|
88
|
+
return (h("button", { key: '21d2654de08dff8db6c2b1ba87594e1184a7aa35', class: {
|
|
73
89
|
btn: true,
|
|
74
90
|
'without-text': !hasText,
|
|
75
91
|
[this.severity ?? 'primary']: true,
|
|
@@ -77,8 +93,9 @@ const DropiButton = class {
|
|
|
77
93
|
[this.size ?? 'normal']: true,
|
|
78
94
|
[this.state ?? 'default']: true,
|
|
79
95
|
'full-width': this.fullWidth,
|
|
80
|
-
}, disabled: isDisabled, onClick: (e) => this.handleClick(e) }, this.preIcon && (h("dropi-icon", { key: '
|
|
96
|
+
}, type: this.nativeType, disabled: isDisabled, onClick: (e) => this.handleClick(e) }, this.preIcon && (h("dropi-icon", { key: '6c6c01c923a37df20b614602b18cd2da949bcb91', name: this.preIcon, iconWidth: this.iconSize, iconHeight: this.iconSize, color: this.fontColor })), hasText && h("span", { key: '82447aab8b87bc4a89105cd0209e6c5681222f28', class: "text" }, this.text), showPostIcon && (h("dropi-icon", { key: '6bdefe7c1c819b213d24e0100c2303fb7840ea00', name: dropdownIcon, iconWidth: this.iconSize, iconHeight: this.iconSize, color: this.fontColor })), this.state === 'loading' && this.renderLoadingSpinner(), h("slot", { key: '44483caf52d2ca617ad86c1574a54709f8e77ab5' })));
|
|
81
97
|
}
|
|
98
|
+
static get formAssociated() { return true; }
|
|
82
99
|
};
|
|
83
100
|
DropiButton.style = dropiButtonCss();
|
|
84
101
|
|
|
@@ -6,13 +6,29 @@ const DropiCheckbox = class {
|
|
|
6
6
|
constructor(hostRef) {
|
|
7
7
|
registerInstance(this, hostRef);
|
|
8
8
|
this.dropiChange = createEvent(this, "dropiChange");
|
|
9
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
10
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
14
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
15
|
+
}
|
|
9
16
|
}
|
|
17
|
+
internals;
|
|
18
|
+
/** Name for native form submission */
|
|
19
|
+
name = '';
|
|
10
20
|
/** Whether the checkbox is checked */
|
|
11
21
|
checked = false;
|
|
12
22
|
/** Whether the checkbox is disabled */
|
|
13
23
|
disabled = false;
|
|
14
24
|
/** Emitted when the checked state changes */
|
|
15
25
|
dropiChange;
|
|
26
|
+
checkedChanged(val) {
|
|
27
|
+
this.internals.setFormValue(val ? 'on' : null);
|
|
28
|
+
}
|
|
29
|
+
componentWillLoad() {
|
|
30
|
+
this.internals.setFormValue(this.checked ? 'on' : null);
|
|
31
|
+
}
|
|
16
32
|
changeState() {
|
|
17
33
|
if (this.disabled)
|
|
18
34
|
return;
|
|
@@ -20,14 +36,19 @@ const DropiCheckbox = class {
|
|
|
20
36
|
this.dropiChange.emit(this.checked);
|
|
21
37
|
}
|
|
22
38
|
render() {
|
|
23
|
-
return (h("div", { key: '
|
|
39
|
+
return (h("div", { key: '27fec5f03a48c19652c8ae01173dcbb6e3514693', class: "container-dropi-checkbox", onClick: () => this.changeState() }, h("div", { key: '243d07e4444c0dc149ff137258f9ddd58428c438', class: {
|
|
24
40
|
check: true,
|
|
25
41
|
isCheck: this.checked,
|
|
26
42
|
noCheck: !this.checked,
|
|
27
43
|
disabled: this.disabled,
|
|
28
|
-
} }, h("svg", { key: '
|
|
44
|
+
} }, h("svg", { key: '7a1fd9c7b3fa575ec263fe5ad48fbc0294a79980', xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none" }, h("path", { key: 'e77e5cd40c71e542a045934641509e41a7cd4899', d: "M20.5991 5.69251L9.08325 17.2075C9.00583 17.2852 8.91382 17.3469 8.8125 17.389C8.71118 17.4311 8.60255 17.4527 8.49283 17.4527C8.38312 17.4527 8.27449 17.4311 8.17317 17.389C8.07185 17.3469 7.97984 17.2852 7.90242 17.2075L3.44908 12.75C3.37166 12.6723 3.27965 12.6106 3.17833 12.5685C3.07701 12.5264 2.96838 12.5048 2.85867 12.5048C2.74896 12.5048 2.64032 12.5264 2.53901 12.5685C2.43769 12.6106 2.34568 12.6723 2.26825 12.75C2.19052 12.8274 2.12884 12.9194 2.08676 13.0208C2.04467 13.1221 2.02301 13.2307 2.02301 13.3404C2.02301 13.4501 2.04467 13.5588 2.08676 13.6601C2.12884 13.7614 2.19052 13.8534 2.26825 13.9308L6.72325 18.385C7.19321 18.8541 7.83008 19.1175 8.49408 19.1175C9.15809 19.1175 9.79496 18.8541 10.2649 18.385L21.7799 6.87251C21.8575 6.7951 21.9191 6.70314 21.9611 6.6019C22.0031 6.50065 22.0247 6.39212 22.0247 6.28251C22.0247 6.17289 22.0031 6.06436 21.9611 5.96312C21.9191 5.86188 21.8575 5.76992 21.7799 5.69251C21.7025 5.61478 21.6105 5.5531 21.5092 5.51101C21.4078 5.46893 21.2992 5.44727 21.1895 5.44727C21.0798 5.44727 20.9712 5.46893 20.8698 5.51101C20.7685 5.5531 20.6765 5.61478 20.5991 5.69251Z", fill: "#FFFFFF" })))));
|
|
29
45
|
}
|
|
30
46
|
static get formAssociated() { return true; }
|
|
47
|
+
static get watchers() { return {
|
|
48
|
+
"checked": [{
|
|
49
|
+
"checkedChanged": 0
|
|
50
|
+
}]
|
|
51
|
+
}; }
|
|
31
52
|
};
|
|
32
53
|
DropiCheckbox.style = dropiCheckboxCss();
|
|
33
54
|
|
|
@@ -126,7 +126,17 @@ const DropiCountrySelector = class {
|
|
|
126
126
|
constructor(hostRef) {
|
|
127
127
|
registerInstance(this, hostRef);
|
|
128
128
|
this.dropiChange = createEvent(this, "dropiChange");
|
|
129
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
130
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
134
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
135
|
+
}
|
|
129
136
|
}
|
|
137
|
+
internals;
|
|
138
|
+
/** Name for native form submission */
|
|
139
|
+
name = '';
|
|
130
140
|
/** Label above the select */
|
|
131
141
|
label = '';
|
|
132
142
|
/** Placeholder when nothing is selected */
|
|
@@ -171,6 +181,7 @@ const DropiCountrySelector = class {
|
|
|
171
181
|
searchInputRef;
|
|
172
182
|
currentSelectionChanged(val) {
|
|
173
183
|
this.selected = COUNTRIES.find(c => c.code === val) || null;
|
|
184
|
+
this.internals.setFormValue(val);
|
|
174
185
|
}
|
|
175
186
|
selectPropertiesChanged(val) {
|
|
176
187
|
if (!val)
|
|
@@ -191,6 +202,7 @@ const DropiCountrySelector = class {
|
|
|
191
202
|
this.selectPropertiesChanged(this.selectProperties);
|
|
192
203
|
if (this.currentSelection)
|
|
193
204
|
this.currentSelectionChanged(this.currentSelection);
|
|
205
|
+
this.internals.setFormValue(this.currentSelection ?? '');
|
|
194
206
|
}
|
|
195
207
|
componentDidLoad() {
|
|
196
208
|
if (this.appendTo !== 'body')
|
|
@@ -263,12 +275,13 @@ const DropiCountrySelector = class {
|
|
|
263
275
|
this.dropiChange.emit(country);
|
|
264
276
|
}
|
|
265
277
|
render() {
|
|
266
|
-
return (h("div", { key: '
|
|
278
|
+
return (h("div", { key: '98292dbf6f84139b409cefe4690fb5ce834372c7', class: "custom-select" }, this.label && (h("label", { key: '7dd60d54e701108f7061623a89e8ff29edbb8dc6' }, this.label, this.showObligatory && h("span", { key: '971fd2a900d9ef4740a96145cadc948aab95232a', class: "required" }, "*"))), h("button", { key: '6c0067cfaf920160a4f8c05f59c34f3539540d29', type: "button", ref: (el) => { this.buttonRef = el; }, class: {
|
|
267
279
|
'select-button': true,
|
|
268
280
|
'select-completed': !!this.selected,
|
|
269
281
|
'select-invalid': this.hasError,
|
|
270
|
-
}, disabled: this.disabled, onClick: () => this.open() }, h("div", { key: '
|
|
282
|
+
}, disabled: this.disabled, onClick: () => this.open() }, h("div", { key: 'b28c2c5b0de9b8052bb920a272b9dcc51f4eac6f', class: "selected-content" }, this.selected ? (h("span", { class: "selected-option" }, h("img", { class: "flag-img", src: `https://flagsapi.com/${this.selected.code}/shiny/24.png`, alt: this.selected.name }), this.selected.name)) : (h("span", { class: "placeholder-text" }, this.placeholder))), h("dropi-icon", { key: '2ec568b0ad4efdb3a22ffceb1e85fbc6f1d483e8', name: this.isOpen ? 'Arrow-Up-2' : 'Arrow-Down-2', iconWidth: "20px", iconHeight: "20px", color: "Gray-Gray-500" })), h("ul", { key: '34f0e5772ebb21e85cb246cbb91196d128d9ca59', class: `select-dropdown${this.isOpen ? ' expanded' : ' collapsed'}` }, h("li", { key: '77cdf81222a7c593f1d54198e2b897468db890a5', class: "search-li" }, h("div", { key: '970723feefd04adf0b113ae63931092f58d0264a', class: "search-field" }, h("input", { key: '294868580087dc1bdb04258ad84672f3d10e7ba7', ref: (el) => { this.searchInputRef = el; }, type: "text", class: "country-search", placeholder: "Buscar pa\u00EDs...", value: this.searchTerm, onInput: (e) => { this.searchTerm = e.target.value; } }), h("span", { key: '02781dc595e568865ab5ae14aeed326b71b36e10', class: "search-icon" }, h("dropi-icon", { key: '0c06d5e5f26d2a2e5ec20967a2ebb9430397f3ea', name: "Search", iconWidth: "16px", iconHeight: "16px", color: "Gray-Gray-400" })))), this.filtered.map(country => (h("li", { key: country.code }, h("button", { class: "option", type: "button", onClick: () => this.select(country) }, h("img", { class: "flag-img", src: `https://flagsapi.com/${country.code}/shiny/24.png`, alt: country.name }), country.name))))), this.textHelper && (h("div", { key: 'aae58bc17bbb6953a676818fe02da94b5a4e9f73', class: { 'select-helper': true, 'select-helper-error': this.hasError } }, this.hasError && h("dropi-icon", { key: '7542ef4620499957711079c587f6cb650096f6d3', name: "Warning-circle", iconWidth: "12px", iconHeight: "12px", color: "Error-Error-500" }), h("span", { key: 'ea4c5cedd3b87444a90b4e210f7afa3a318a4832' }, this.textHelper)))));
|
|
271
283
|
}
|
|
284
|
+
static get formAssociated() { return true; }
|
|
272
285
|
static get watchers() { return {
|
|
273
286
|
"currentSelection": [{
|
|
274
287
|
"currentSelectionChanged": 0
|
|
@@ -13,13 +13,26 @@ const DropiDatePicker = class {
|
|
|
13
13
|
this.dropiChangeDate = createEvent(this, "dropiChangeDate");
|
|
14
14
|
this.dropiClosePanel = createEvent(this, "dropiClosePanel");
|
|
15
15
|
this.dropiRangeChange = createEvent(this, "dropiRangeChange");
|
|
16
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
17
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
21
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
22
|
+
}
|
|
16
23
|
}
|
|
24
|
+
internals;
|
|
25
|
+
/** Name for native form submission */
|
|
26
|
+
name = '';
|
|
17
27
|
/** Selected date (ISO string, single mode) - matches Angular 'selectedDate' */
|
|
18
28
|
selectedDate = '';
|
|
19
29
|
/** Range start date (ISO string, range mode) */
|
|
20
30
|
startDate = '';
|
|
21
31
|
/** Range end date (ISO string, range mode) */
|
|
22
32
|
endDate = '';
|
|
33
|
+
valueChanged() {
|
|
34
|
+
this.updateFormValue();
|
|
35
|
+
}
|
|
23
36
|
/** Enable range selection - matches Angular selectionMode */
|
|
24
37
|
selectionMode = 'single';
|
|
25
38
|
/** Min selectable date (ISO string) */
|
|
@@ -52,6 +65,17 @@ const DropiDatePicker = class {
|
|
|
52
65
|
dropiClosePanel;
|
|
53
66
|
/** Emitted when range selected */
|
|
54
67
|
dropiRangeChange;
|
|
68
|
+
componentWillLoad() {
|
|
69
|
+
this.updateFormValue();
|
|
70
|
+
}
|
|
71
|
+
updateFormValue() {
|
|
72
|
+
if (this.selectionMode === 'range') {
|
|
73
|
+
this.internals.setFormValue(this.startDate && this.endDate ? `${this.startDate},${this.endDate}` : '');
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
this.internals.setFormValue(this.selectedDate || '');
|
|
77
|
+
}
|
|
78
|
+
}
|
|
55
79
|
get displayValue() {
|
|
56
80
|
if (this.selectionMode === 'range') {
|
|
57
81
|
if (this.startDate && this.endDate)
|
|
@@ -171,12 +195,12 @@ const DropiDatePicker = class {
|
|
|
171
195
|
render() {
|
|
172
196
|
const days = this.buildDays();
|
|
173
197
|
const today = new Date().toISOString().slice(0, 10);
|
|
174
|
-
return (h("div", { key: '
|
|
198
|
+
return (h("div", { key: '97a96b56b0e8ae551f747bad4a3459a1f4945411', class: "dp-wrap" }, this.label && h("label", { key: 'a1792032ab9ae2dbe574f50b7a537df687eae40c', class: "dp-label" }, this.label), h("button", { key: '4237c2b988f1e9fbaa77dc2a989964216e3fe902', class: {
|
|
175
199
|
'dp-trigger': true,
|
|
176
200
|
'dp-trigger--disabled': this.disabled,
|
|
177
201
|
'dp-trigger--invalid': this.isInvalid,
|
|
178
202
|
'dp-trigger--loading': this.loading
|
|
179
|
-
}, onClick: () => this.open ? this.open = false : this.open_(), disabled: this.disabled || this.loading, type: "button" }, h("dropi-icon", { key: '
|
|
203
|
+
}, onClick: () => this.open ? this.open = false : this.open_(), disabled: this.disabled || this.loading, type: "button" }, h("dropi-icon", { key: '39591fedb92b92e6507b564fc8c145711f1a21b1', name: "Calendar", iconWidth: "16px", iconHeight: "16px", color: "Gray-Gray-400" }), h("span", { key: '305e3f81d64c01603687d53edc59e1d19ef06c3c', class: { 'dp-trigger__value': true, 'dp-trigger__placeholder': !this.displayValue } }, this.displayValue || this.placeholder), h("dropi-icon", { key: '13feb346ad7b07a7e2f208e299f62a8261a97655', name: "Arrow-Down-2", iconWidth: "12px", iconHeight: "12px", color: "Gray-Gray-400" })), this.open && (h("div", { key: '4cdf8a69422a0b54d0f7c1a6711a683dab7d1f34', class: "dp-popup" }, h("div", { key: '0c6fb31094003c66c5b471e738dd75e7b865401f', class: "dp-nav" }, h("button", { key: '4fa24f9450cf6c5e888cea374619e14245c0c005', class: "dp-nav__btn", onClick: () => this.prevMonth(), type: "button" }, h("dropi-icon", { key: '2196f85700b252d4f83536f11ed197c083fc45ec', name: "Arrow-Left-2", iconWidth: "16px", iconHeight: "16px", color: "Gray-Gray-600" })), h("span", { key: '01619de7c5218b506f75234745f3184af813a491', class: "dp-nav__title" }, h("span", { key: '8074e7deeb6c102bad7f1911739e785187783a7c' }, MONTHS_ES[this.viewMonth]), h("span", { key: '69e9c3b41361e293a843f911b5bcf4690995d2b4' }, this.viewYear)), h("button", { key: '51c0ad3da96835736170fbf94338fd70c942c3d2', class: "dp-nav__btn", onClick: () => this.nextMonth(), type: "button" }, h("dropi-icon", { key: '24eb4385639c9a71f5312f32b33b36593c2b0259', name: "Arrow-Right-2", iconWidth: "16px", iconHeight: "16px", color: "Gray-Gray-600" }))), h("div", { key: 'c18cecd81af38b3a6f23402501011c09b8b453d7', class: "dp-grid" }, DAYS_ES.map(d => (h("div", { class: "dp-day-header" }, d))), days.map(({ iso, day, currentMonth }) => {
|
|
180
204
|
const isSelected = this.selectionMode !== 'range'
|
|
181
205
|
? iso === this.selectedDate
|
|
182
206
|
: iso === this.startDate || iso === this.endDate;
|
|
@@ -198,12 +222,12 @@ const DropiDatePicker = class {
|
|
|
198
222
|
if (this.selectionMode === 'range' && this.startDate && !this.endDate)
|
|
199
223
|
this.hoverDate = iso;
|
|
200
224
|
}, onMouseLeave: () => this.hoverDate = '' }, day));
|
|
201
|
-
})), h("div", { key: '
|
|
225
|
+
})), h("div", { key: '594f280cb269c32ac3a129401e13b710af1a7c7e', class: "dp-footer" }, h("button", { key: '6028ef84bc17f0d1bb0fd587a991698a8fc69338', class: "dp-footer__clear", type: "button", onClick: () => {
|
|
202
226
|
this.selectedDate = '';
|
|
203
227
|
this.startDate = '';
|
|
204
228
|
this.endDate = '';
|
|
205
229
|
this.open = false;
|
|
206
|
-
} }, "Limpiar"), h("button", { key: '
|
|
230
|
+
} }, "Limpiar"), h("button", { key: 'ab01840a18d657621205d4fba69cc53feb474d11', class: "dp-footer__today", type: "button", onClick: () => {
|
|
207
231
|
if (this.selectionMode !== 'range') {
|
|
208
232
|
this.selectedDate = today;
|
|
209
233
|
this.open = false;
|
|
@@ -215,6 +239,18 @@ const DropiDatePicker = class {
|
|
|
215
239
|
}
|
|
216
240
|
} }, "Hoy"))))));
|
|
217
241
|
}
|
|
242
|
+
static get formAssociated() { return true; }
|
|
243
|
+
static get watchers() { return {
|
|
244
|
+
"selectedDate": [{
|
|
245
|
+
"valueChanged": 0
|
|
246
|
+
}],
|
|
247
|
+
"startDate": [{
|
|
248
|
+
"valueChanged": 0
|
|
249
|
+
}],
|
|
250
|
+
"endDate": [{
|
|
251
|
+
"valueChanged": 0
|
|
252
|
+
}]
|
|
253
|
+
}; }
|
|
218
254
|
};
|
|
219
255
|
DropiDatePicker.style = dropiDatePickerCss();
|
|
220
256
|
|
|
@@ -153,6 +153,7 @@ const DropiInput = class {
|
|
|
153
153
|
this.value = val;
|
|
154
154
|
this.internals.setFormValue(val);
|
|
155
155
|
this.dropiInput.emit(val);
|
|
156
|
+
this.dropiChange.emit(val);
|
|
156
157
|
}
|
|
157
158
|
handleKeyDown(e) {
|
|
158
159
|
if ((this.isNumericInput || this.isMoneyInput || this.isThousandSeparator) && !this.isAllowedNumberKey(e)) {
|
|
@@ -167,7 +168,6 @@ const DropiInput = class {
|
|
|
167
168
|
}
|
|
168
169
|
handleBlur() {
|
|
169
170
|
this.touched = true;
|
|
170
|
-
this.dropiChange.emit(this.value);
|
|
171
171
|
this.dropiBlur.emit();
|
|
172
172
|
}
|
|
173
173
|
togglePassword() {
|
|
@@ -233,14 +233,14 @@ const DropiInput = class {
|
|
|
233
233
|
render() {
|
|
234
234
|
const showObligatoryAsterisk = this.required && this.showObligatoryAsterisk && !this.disabled;
|
|
235
235
|
const showIconInline = !!this.icon;
|
|
236
|
-
return (h("div", { key: '
|
|
236
|
+
return (h("div", { key: '6af757e1d86bfe96d471e9cbed258a50727ae190', class: { 'fixed-label-container': this.fixedLabel } }, this.fixedLabel && (h("div", { key: 'e88bf81fd2b79933e386c2e5fa38f57d85cfe836', class: "input-label Body-S-Regular" }, this.label, showObligatoryAsterisk && h("span", { key: 'be8ec1b0d3ef624ca22e58ae072917ad2ecc79fb', class: "asterisk" }, " *"))), h("div", { key: '4806c0d250f00bb08788d9d6aa935ca15f2aa826', class: "form-group" }, h("div", { key: 'b9fa243d299bcd165458947d6695fcc845764276', class: { 'input-container': true, 'input-container--has-icon': showIconInline } }, showIconInline && (h("dropi-icon", { key: '92b3cf11803745784f13e908ea88992f76c74473', class: "icon-input", name: this.icon, color: this.iconColor, iconWidth: "20px", iconHeight: "20px", style: { width: '20px', height: '20px' } })), this.passwordInput && (h("dropi-icon", { key: 'c7dc725d577a6d4afb7f87c8b53b16c621de9e86', class: "icon-input-password", name: this.showPassword ? 'Eye' : 'Eye-crossed', iconWidth: "20px", iconHeight: "20px", style: { width: '20px', height: '20px' }, color: "Gray-Gray-500", onClick: () => this.togglePassword() })), h("input", { key: '8146ae1794cbe1f200bb681358c7319f10faab3c', id: this.resolvedId, class: {
|
|
237
237
|
'form-control': true,
|
|
238
238
|
'form-control-valid': !this.isInvalid && this.touched && !!this.value,
|
|
239
239
|
'form-control-invalid': this.isInvalid,
|
|
240
240
|
'padding-icon': showIconInline,
|
|
241
241
|
'text-password': this.passwordInput && !this.showPassword,
|
|
242
242
|
'fixed-label-input': this.fixedLabel,
|
|
243
|
-
}, type: this.inputType, value: this.value, placeholder: this.fixedLabel ? this.placeholder : ' ', disabled: this.disabled, required: this.required, maxLength: this.maxLength, inputMode: this.inputMode, "data-cy": undefined, onInput: e => this.handleInput(e), onKeyDown: e => this.handleKeyDown(e), onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur() }), !this.fixedLabel && (h("label", { key: '
|
|
243
|
+
}, type: this.inputType, value: this.value, placeholder: this.fixedLabel ? this.placeholder : ' ', disabled: this.disabled, required: this.required, maxLength: this.maxLength, inputMode: this.inputMode, "data-cy": undefined, onInput: e => this.handleInput(e), onKeyDown: e => this.handleKeyDown(e), onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur() }), !this.fixedLabel && (h("label", { key: '005d15af6b50b2cb2d47ac8381a722794eb273e5', class: "Body-S-Regular label-bottom", htmlFor: this.resolvedId }, this.label, showObligatoryAsterisk && h("span", { key: 'ad56df877cff3df8a801cdfcb607d9af02f7465a', class: "asterisk" }, " *"))), this.showHelper && (h("div", { key: '76e858c13a798f69b2d20ee9908f17531568dad1', class: "form-control-helper" }, this.isInvalid && h("dropi-icon", { key: '3e42ffb4db7444ebfb49cc9c6720d5a9d02b2860', name: "Warning-circle", iconWidth: "12px", iconHeight: "12px", color: "Error-Error-500" }), h("span", { key: '5e970903eb51ca6b72a43bef0edf6ef149443247', class: {
|
|
244
244
|
'disabled-helper': this.disabled,
|
|
245
245
|
'invalid-color': this.isInvalid,
|
|
246
246
|
} }, this.textHelper)))))));
|