@randstad-uca/design-system 1.0.81 → 1.0.82
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/components/DatePicker.d.ts +13 -11
- package/dist/components/Modal.d.ts +2 -0
- package/dist/components/Popup.d.ts +1 -0
- package/dist/components/Select.d.ts +1 -0
- package/dist/index.js +31 -24
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/stories/Modal.stories.d.ts +6 -0
- package/dist/stories/Popup.stories.d.ts +1 -0
- package/package.json +1 -1
|
@@ -8,9 +8,7 @@ export declare class DatePickerComponent extends BaseControl {
|
|
|
8
8
|
maxDate?: string;
|
|
9
9
|
type: 'date' | 'month';
|
|
10
10
|
eighteenOrOlder: boolean;
|
|
11
|
-
|
|
12
|
-
get maxLength(): number;
|
|
13
|
-
set maxLength(value: number);
|
|
11
|
+
maxLength: number;
|
|
14
12
|
private isOpen;
|
|
15
13
|
private selectedDate;
|
|
16
14
|
private viewDate;
|
|
@@ -41,14 +39,6 @@ export declare class DatePickerComponent extends BaseControl {
|
|
|
41
39
|
* Es ideal para obtener el ancho del DOM por primera vez.
|
|
42
40
|
*/
|
|
43
41
|
firstUpdated(): void;
|
|
44
|
-
/**
|
|
45
|
-
* Ciclo de vida: se llama después de cada actualización.
|
|
46
|
-
* Se usa para recalcular el ancho si la apertura del calendario ha cambiado.
|
|
47
|
-
|
|
48
|
-
* @param changedProperties - Mapa de propiedades que han cambiado.
|
|
49
|
-
*/
|
|
50
|
-
protected willUpdate(changedProperties: Map<string, any>): void;
|
|
51
|
-
updated(changedProperties: Map<string, any>): void;
|
|
52
42
|
private setInitialWidth;
|
|
53
43
|
/**
|
|
54
44
|
* Referencia enlazada para el listener de resize.
|
|
@@ -87,6 +77,18 @@ export declare class DatePickerComponent extends BaseControl {
|
|
|
87
77
|
*/
|
|
88
78
|
private handleDateSelect;
|
|
89
79
|
private _emitToggle;
|
|
80
|
+
/**
|
|
81
|
+
* Ciclo de vida: se llama antes de cada actualización.
|
|
82
|
+
* Se utiliza para preparar el estado antes del renderizado.
|
|
83
|
+
* NO modifica propiedades reactivas aquí para evitar loops de renderizado.
|
|
84
|
+
*/
|
|
85
|
+
protected willUpdate(changedProperties: Map<string, any>): void;
|
|
86
|
+
/**
|
|
87
|
+
* Ciclo de vida: se llama después de cada actualización del componente.
|
|
88
|
+
* Se usa para operaciones que requieren el DOM ya renderizado.
|
|
89
|
+
* Solo recalcula el ancho si es necesario y evita loops de actualización.
|
|
90
|
+
*/
|
|
91
|
+
updated(changedProperties: Map<string, any>): void;
|
|
90
92
|
/**
|
|
91
93
|
* Maneja el cambio de la fecha de vista en el calendario.
|
|
92
94
|
|
|
@@ -21,10 +21,12 @@ export declare class CustomModal extends LitElement {
|
|
|
21
21
|
maxHeight: string;
|
|
22
22
|
hideFooter: boolean;
|
|
23
23
|
private scrollable;
|
|
24
|
+
private hasDropdownOpen;
|
|
24
25
|
static styles: (import("lit").CSSResult | CSSStyleSheet)[];
|
|
25
26
|
private closeModal;
|
|
26
27
|
connectedCallback(): void;
|
|
27
28
|
disconnectedCallback(): void;
|
|
29
|
+
private handleDropdownOpen;
|
|
28
30
|
private setScrollableMode;
|
|
29
31
|
private getFooterClass;
|
|
30
32
|
render(): import("lit-html").TemplateResult<1>;
|
|
@@ -54,6 +54,7 @@ export declare class FilterableSelect extends BaseControl {
|
|
|
54
54
|
handleMobileInput(event: Event): void;
|
|
55
55
|
handleSelect(option: SelectOption): void;
|
|
56
56
|
handleIconClick(): void;
|
|
57
|
+
private handleReset;
|
|
57
58
|
handleClickOutside(event: Event): void;
|
|
58
59
|
/**
|
|
59
60
|
* Maneja los eventos de teclado cuando el foco está en el input o el filter-fake (combobox).
|
package/dist/index.js
CHANGED
|
@@ -9,18 +9,18 @@ const a=t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e)}
|
|
|
9
9
|
* @license
|
|
10
10
|
* Copyright 2019 Google LLC
|
|
11
11
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
|
-
*/let p=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==c)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(d&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=h.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&h.set(e,t))}return t}toString(){return this.cssText}};const u=(t,e)=>{if(d)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of e){const e=document.createElement("style"),o=l.litNonce;void 0!==o&&e.setAttribute("nonce",o),e.textContent=i.cssText,t.appendChild(e)}},g=d?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new p("string"==typeof t?t:t+"",void 0,c))(e)})(t):t,{is:b,defineProperty:m,getOwnPropertyDescriptor:y,getOwnPropertyNames:f,getOwnPropertySymbols:v,getPrototypeOf:w}=Object,x=globalThis,k=x.trustedTypes,$=k?k.emptyScript:"",S=x.reactiveElementPolyfillSupport,D=(t,e)=>t,E={toAttribute(t,e){switch(e){case Boolean:t=t?$:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},
|
|
12
|
+
*/let p=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==c)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(d&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=h.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&h.set(e,t))}return t}toString(){return this.cssText}};const u=(t,e)=>{if(d)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of e){const e=document.createElement("style"),o=l.litNonce;void 0!==o&&e.setAttribute("nonce",o),e.textContent=i.cssText,t.appendChild(e)}},g=d?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new p("string"==typeof t?t:t+"",void 0,c))(e)})(t):t,{is:b,defineProperty:m,getOwnPropertyDescriptor:y,getOwnPropertyNames:f,getOwnPropertySymbols:v,getPrototypeOf:w}=Object,x=globalThis,k=x.trustedTypes,$=k?k.emptyScript:"",S=x.reactiveElementPolyfillSupport,D=(t,e)=>t,E={toAttribute(t,e){switch(e){case Boolean:t=t?$:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},O=(t,e)=>!b(t,e),C={attribute:!0,type:String,converter:E,reflect:!1,useDefault:!1,hasChanged:O};
|
|
13
13
|
/**
|
|
14
14
|
* @license
|
|
15
15
|
* Copyright 2017 Google LLC
|
|
16
16
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
|
-
*/Symbol.metadata??=Symbol("metadata"),x.litPropertyMetadata??=new WeakMap;class F extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=
|
|
17
|
+
*/Symbol.metadata??=Symbol("metadata"),x.litPropertyMetadata??=new WeakMap;class F extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=C){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),o=this.getPropertyDescriptor(t,i,e);void 0!==o&&m(this.prototype,t,o)}}static getPropertyDescriptor(t,e,i){const{get:o,set:r}=y(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:o,set(e){const s=o?.call(this);r?.call(this,e),this.requestUpdate(t,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??C}static _$Ei(){if(this.hasOwnProperty(D("elementProperties")))return;const t=w(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(D("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(D("properties"))){const t=this.properties,e=[...f(t),...v(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(g(t))}else void 0!==t&&e.push(g(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return u(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){const i=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,i);if(void 0!==o&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:E).toAttribute(e,i.type);this._$Em=t,null==r?this.removeAttribute(o):this.setAttribute(o,r),this._$Em=null}}_$AK(t,e){const i=this.constructor,o=i._$Eh.get(t);if(void 0!==o&&this._$Em!==o){const t=i.getPropertyOptions(o),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:E;this._$Em=o,this[o]=r.fromAttribute(e,t.type)??this._$Ej?.get(o)??null,this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){const o=this.constructor,r=this[t];if(i??=o.getPropertyOptions(t),!((i.hasChanged??O)(r,e)||i.useDefault&&i.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:o,wrapped:r},s){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,s??e??this[t]),!0!==r||void 0!==s)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===o&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,o=this[e];!0!==t||this._$AL.has(e)||void 0===o||this.C(e,void 0,i,o)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}}F.elementStyles=[],F.shadowRootOptions={mode:"open"},F[D("elementProperties")]=new Map,F[D("finalized")]=new Map,S?.({ReactiveElement:F}),(x.reactiveElementVersions??=[]).push("2.1.0");
|
|
18
18
|
/**
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
21
21
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
22
|
*/
|
|
23
|
-
const M={attribute:!0,type:String,converter:E,reflect:!1,hasChanged:
|
|
23
|
+
const M={attribute:!0,type:String,converter:E,reflect:!1,hasChanged:O},L=(t=M,e,i)=>{const{kind:o,metadata:r}=i;let s=globalThis.litPropertyMetadata.get(r);if(void 0===s&&globalThis.litPropertyMetadata.set(r,s=new Map),"setter"===o&&((t=Object.create(t)).wrapped=!0),s.set(i.name,t),"accessor"===o){const{name:o}=i;return{set(i){const r=e.get.call(this);e.set.call(this,i),this.requestUpdate(o,r,t)},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if("setter"===o){const{name:o}=i;return function(i){const r=this[o];e.call(this,i),this.requestUpdate(o,r,t)}}throw Error("Unsupported decorator location: "+o)};function B(t){return(e,i)=>"object"==typeof i?L(t,e,i):((t,e,i)=>{const o=e.hasOwnProperty(i);return e.constructor.createProperty(i,t),o?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}
|
|
24
24
|
/**
|
|
25
25
|
* @license
|
|
26
26
|
* Copyright 2017 Google LLC
|
|
@@ -103,14 +103,14 @@ function P(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
103
103
|
font-size: 18px;
|
|
104
104
|
line-height: 30px;
|
|
105
105
|
letter-spacing: 0%;
|
|
106
|
-
`,
|
|
106
|
+
`,z=o`
|
|
107
107
|
font-family: 'Graphik', sans-serif;
|
|
108
108
|
font-weight: 400;
|
|
109
109
|
font-size: 18px;
|
|
110
110
|
line-height: 30px;
|
|
111
111
|
letter-spacing: 0%;
|
|
112
112
|
vertical-align: middle;
|
|
113
|
-
`,
|
|
113
|
+
`,_=o`
|
|
114
114
|
font-family: 'Graphik', sans-serif;
|
|
115
115
|
font-weight: 400;
|
|
116
116
|
font-size: 20px;
|
|
@@ -1368,7 +1368,7 @@ function P(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
1368
1368
|
|
|
1369
1369
|
<span class="message">${this.message}</span>
|
|
1370
1370
|
</div>
|
|
1371
|
-
`}};s([B({type:String}),n("design:type",String)],ot.prototype,"type",void 0),s([B({type:String}),n("design:type",String)],ot.prototype,"icon",void 0),s([B({type:String}),n("design:type",String)],ot.prototype,"message",void 0),s([B({type:Boolean}),n("design:type",Boolean)],ot.prototype,"open",void 0),ot=s([a("randstad-notice")],ot);let rt=class extends t{constructor(){super(...arguments),this.open=!1,this.title="Título del modal",this.showNotice=!1,this.noticeType="informative",this.noticeMessage="",this.noticeIcon="info",this.showPrimaryButton=!1,this.primaryButtonLabel="Aceptar",this.showSecondaryButton=!1,this.secondaryButtonLabel="Cancelar",this.isFooterCustom=!1,this.isPrimaryLoader=!1,this.isPrimaryDisabled=!1,this.modalWidth="500px",this.modalHeight="80dvh",this.maxHeight="90dvh",this.hideFooter=!1,this.scrollable=!1,this.setScrollableMode=()=>{this.scrollable=window.innerWidth>940}}static{this.styles=[Z,o`
|
|
1371
|
+
`}};s([B({type:String}),n("design:type",String)],ot.prototype,"type",void 0),s([B({type:String}),n("design:type",String)],ot.prototype,"icon",void 0),s([B({type:String}),n("design:type",String)],ot.prototype,"message",void 0),s([B({type:Boolean}),n("design:type",Boolean)],ot.prototype,"open",void 0),ot=s([a("randstad-notice")],ot);let rt=class extends t{constructor(){super(...arguments),this.open=!1,this.title="Título del modal",this.showNotice=!1,this.noticeType="informative",this.noticeMessage="",this.noticeIcon="info",this.showPrimaryButton=!1,this.primaryButtonLabel="Aceptar",this.showSecondaryButton=!1,this.secondaryButtonLabel="Cancelar",this.isFooterCustom=!1,this.isPrimaryLoader=!1,this.isPrimaryDisabled=!1,this.modalWidth="500px",this.modalHeight="80dvh",this.maxHeight="90dvh",this.hideFooter=!1,this.scrollable=!1,this.hasDropdownOpen=!1,this.handleDropdownOpen=t=>{const e=t.detail;e&&"boolean"==typeof e.open?this.hasDropdownOpen=e.open:this.hasDropdownOpen=!0},this.setScrollableMode=()=>{this.scrollable=window.innerWidth>940}}static{this.styles=[Z,o`
|
|
1372
1372
|
${X}
|
|
1373
1373
|
|
|
1374
1374
|
:host {
|
|
@@ -1506,13 +1506,17 @@ function P(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
1506
1506
|
gap: 16px;
|
|
1507
1507
|
}
|
|
1508
1508
|
|
|
1509
|
+
.modal-body.has-dropdown-open {
|
|
1510
|
+
padding-bottom: 32px;
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1509
1513
|
.modal-footer {
|
|
1510
1514
|
display: flex;
|
|
1511
1515
|
padding: 24px;
|
|
1512
1516
|
gap: 16px;
|
|
1513
1517
|
border-top: 1px solid var(--secondary-color-20);
|
|
1514
1518
|
}
|
|
1515
|
-
`]}closeModal(){this.dispatchEvent(new CustomEvent("modal-close"))}connectedCallback(){super.connectedCallback(),this.setScrollableMode(),window.addEventListener("resize",this.setScrollableMode)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this.setScrollableMode)}getFooterClass(){return!this.isFooterCustom||this.showPrimaryButton||this.showSecondaryButton?this.showPrimaryButton&&this.showSecondaryButton?"two-buttons":"one-button":"footer-custom"}render(){return e`
|
|
1519
|
+
`]}closeModal(){this.dispatchEvent(new CustomEvent("modal-close"))}connectedCallback(){super.connectedCallback(),this.setScrollableMode(),window.addEventListener("resize",this.setScrollableMode),this.addEventListener("dropdown-toggle",this.handleDropdownOpen),this.addEventListener("calendar-toggle",this.handleDropdownOpen)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this.setScrollableMode),this.removeEventListener("dropdown-toggle",this.handleDropdownOpen),this.removeEventListener("calendar-toggle",this.handleDropdownOpen)}getFooterClass(){return!this.isFooterCustom||this.showPrimaryButton||this.showSecondaryButton?this.showPrimaryButton&&this.showSecondaryButton?"two-buttons":"one-button":"footer-custom"}render(){return e`
|
|
1516
1520
|
<div class="overlay" role="dialog" aria-modal="true">
|
|
1517
1521
|
<div class="modal" style="--modal-width: ${this.modalWidth}; --modal-height: ${this.modalHeight}; --modal-max-height: ${this.maxHeight};">
|
|
1518
1522
|
<div class="modal-header">
|
|
@@ -1544,7 +1548,7 @@ function P(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
1544
1548
|
`:i}
|
|
1545
1549
|
</div>
|
|
1546
1550
|
|
|
1547
|
-
<div class="modal-body ${this.scrollable?"scrollable":""}">
|
|
1551
|
+
<div class="modal-body ${this.scrollable?"scrollable":""} ${this.hasDropdownOpen?"has-dropdown-open":""}">
|
|
1548
1552
|
<slot name="content"></slot>
|
|
1549
1553
|
</div>
|
|
1550
1554
|
|
|
@@ -1576,7 +1580,7 @@ function P(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
1576
1580
|
`}
|
|
1577
1581
|
</div>
|
|
1578
1582
|
</div>
|
|
1579
|
-
`}};s([B({type:Boolean,reflect:!0}),n("design:type",Object)],rt.prototype,"open",void 0),s([B({type:String}),n("design:type",Object)],rt.prototype,"title",void 0),s([B({type:String}),n("design:type",String)],rt.prototype,"subtitle",void 0),s([B({type:Boolean}),n("design:type",Object)],rt.prototype,"showNotice",void 0),s([B({type:String}),n("design:type",String)],rt.prototype,"noticeType",void 0),s([B({type:String}),n("design:type",Object)],rt.prototype,"noticeMessage",void 0),s([B({type:String}),n("design:type",Object)],rt.prototype,"noticeIcon",void 0),s([B({type:Boolean}),n("design:type",Object)],rt.prototype,"showPrimaryButton",void 0),s([B({type:String}),n("design:type",Object)],rt.prototype,"primaryButtonLabel",void 0),s([B({type:Boolean}),n("design:type",Object)],rt.prototype,"showSecondaryButton",void 0),s([B({type:String}),n("design:type",Object)],rt.prototype,"secondaryButtonLabel",void 0),s([B({type:Boolean}),n("design:type",Object)],rt.prototype,"isFooterCustom",void 0),s([B({type:Boolean}),n("design:type",Object)],rt.prototype,"isPrimaryLoader",void 0),s([B({type:Boolean}),n("design:type",Object)],rt.prototype,"isPrimaryDisabled",void 0),s([B({type:String}),n("design:type",Object)],rt.prototype,"modalWidth",void 0),s([B({type:String}),n("design:type",Object)],rt.prototype,"modalHeight",void 0),s([B({type:String}),n("design:type",Object)],rt.prototype,"maxHeight",void 0),s([B({type:Boolean}),n("design:type",Object)],rt.prototype,"hideFooter",void 0),s([T(),n("design:type",Object)],rt.prototype,"scrollable",void 0),rt=s([a("custom-modal")],rt);let st=class extends t{constructor(){super(...arguments),this.open=!1,this.type="default",this.icon="warning",this.title="",this.description="",this.width="400px",this.buttonText="Aceptar",this.confirmText="Sí",this.cancelText="No",this.stackedActions=[],this._onBackgroundClick=t=>{const e=t.composedPath(),i=this.renderRoot.querySelector(".popup");i&&!e.includes(i)&&(this.dispatchEvent(new CustomEvent("popup-close",{detail:null})),this.open=!1)}}static{this.styles=o`
|
|
1583
|
+
`}};s([B({type:Boolean,reflect:!0}),n("design:type",Object)],rt.prototype,"open",void 0),s([B({type:String}),n("design:type",Object)],rt.prototype,"title",void 0),s([B({type:String}),n("design:type",String)],rt.prototype,"subtitle",void 0),s([B({type:Boolean}),n("design:type",Object)],rt.prototype,"showNotice",void 0),s([B({type:String}),n("design:type",String)],rt.prototype,"noticeType",void 0),s([B({type:String}),n("design:type",Object)],rt.prototype,"noticeMessage",void 0),s([B({type:String}),n("design:type",Object)],rt.prototype,"noticeIcon",void 0),s([B({type:Boolean}),n("design:type",Object)],rt.prototype,"showPrimaryButton",void 0),s([B({type:String}),n("design:type",Object)],rt.prototype,"primaryButtonLabel",void 0),s([B({type:Boolean}),n("design:type",Object)],rt.prototype,"showSecondaryButton",void 0),s([B({type:String}),n("design:type",Object)],rt.prototype,"secondaryButtonLabel",void 0),s([B({type:Boolean}),n("design:type",Object)],rt.prototype,"isFooterCustom",void 0),s([B({type:Boolean}),n("design:type",Object)],rt.prototype,"isPrimaryLoader",void 0),s([B({type:Boolean}),n("design:type",Object)],rt.prototype,"isPrimaryDisabled",void 0),s([B({type:String}),n("design:type",Object)],rt.prototype,"modalWidth",void 0),s([B({type:String}),n("design:type",Object)],rt.prototype,"modalHeight",void 0),s([B({type:String}),n("design:type",Object)],rt.prototype,"maxHeight",void 0),s([B({type:Boolean}),n("design:type",Object)],rt.prototype,"hideFooter",void 0),s([T(),n("design:type",Object)],rt.prototype,"scrollable",void 0),s([T(),n("design:type",Object)],rt.prototype,"hasDropdownOpen",void 0),rt=s([a("custom-modal")],rt);let st=class extends t{constructor(){super(...arguments),this.open=!1,this.type="default",this.icon="warning",this.title="",this.description="",this.width="400px",this.height="",this.buttonText="Aceptar",this.confirmText="Sí",this.cancelText="No",this.stackedActions=[],this._onBackgroundClick=t=>{const e=t.composedPath(),i=this.renderRoot.querySelector(".popup");i&&!e.includes(i)&&(this.dispatchEvent(new CustomEvent("popup-close",{detail:null})),this.open=!1)}}static{this.styles=o`
|
|
1580
1584
|
:host {
|
|
1581
1585
|
display: none;
|
|
1582
1586
|
position: fixed;
|
|
@@ -1603,6 +1607,7 @@ function P(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
1603
1607
|
@media (min-width:501px){
|
|
1604
1608
|
.popup {
|
|
1605
1609
|
width: var(--popup-width, 358px);
|
|
1610
|
+
min-height: var(--popup-height, auto);
|
|
1606
1611
|
}
|
|
1607
1612
|
}
|
|
1608
1613
|
|
|
@@ -1616,6 +1621,7 @@ function P(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
1616
1621
|
flex-direction: column;
|
|
1617
1622
|
gap: 24px;
|
|
1618
1623
|
align-items: center;
|
|
1624
|
+
box-sizing: border-box;
|
|
1619
1625
|
}
|
|
1620
1626
|
|
|
1621
1627
|
@keyframes fadeIn {
|
|
@@ -1638,7 +1644,7 @@ function P(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
1638
1644
|
}
|
|
1639
1645
|
|
|
1640
1646
|
.popup-title {
|
|
1641
|
-
${
|
|
1647
|
+
${_}
|
|
1642
1648
|
margin: 0;
|
|
1643
1649
|
color: var(--secondary-color-80);
|
|
1644
1650
|
}
|
|
@@ -1672,7 +1678,7 @@ function P(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
1672
1678
|
}
|
|
1673
1679
|
|
|
1674
1680
|
.action-item {
|
|
1675
|
-
${
|
|
1681
|
+
${z};
|
|
1676
1682
|
display: flex;
|
|
1677
1683
|
align-items: center;
|
|
1678
1684
|
gap: 16px;
|
|
@@ -1697,11 +1703,12 @@ function P(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
1697
1703
|
justify-content: center;
|
|
1698
1704
|
}
|
|
1699
1705
|
|
|
1700
|
-
`}firstUpdated(){if(this.open){const t=this.renderRoot.querySelector("randstad-button");t&&t.focus()}this.addEventListener("click",this._onBackgroundClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this._onBackgroundClick)}closePopup(t){this.dispatchEvent(new CustomEvent("popup-close",{detail:t})),this.open=!1}render(){return e`
|
|
1706
|
+
`}firstUpdated(){if(this.open){const t=this.renderRoot.querySelector("randstad-button");t&&t.focus()}this.addEventListener("click",this._onBackgroundClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this._onBackgroundClick)}closePopup(t){this.dispatchEvent(new CustomEvent("popup-close",{detail:t})),this.open=!1}render(){const t=this.width||this.height?`--popup-width: ${this.width||"400px"}; --popup-height: ${this.height||"auto"};`:"";return e`
|
|
1701
1707
|
<div
|
|
1702
1708
|
class="popup"
|
|
1703
1709
|
role="dialog"
|
|
1704
1710
|
aria-modal="true"
|
|
1711
|
+
style="${t}"
|
|
1705
1712
|
${"default"!==this.type?e`aria-labelledby="popup-title"`:i}
|
|
1706
1713
|
aria-describedby="popup-description"
|
|
1707
1714
|
>
|
|
@@ -1767,7 +1774,7 @@ function P(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
1767
1774
|
`}
|
|
1768
1775
|
</div>
|
|
1769
1776
|
</div>
|
|
1770
|
-
`}};s([B({type:Boolean,reflect:!0}),n("design:type",Object)],st.prototype,"open",void 0),s([B({type:String}),n("design:type",String)],st.prototype,"type",void 0),s([B({type:String}),n("design:type",Object)],st.prototype,"icon",void 0),s([B({type:String}),n("design:type",Object)],st.prototype,"title",void 0),s([B({type:String}),n("design:type",Object)],st.prototype,"description",void 0),s([B({type:String}),n("design:type",Object)],st.prototype,"width",void 0),s([B({type:String}),n("design:type",Object)],st.prototype,"buttonText",void 0),s([B({type:String}),n("design:type",Object)],st.prototype,"confirmText",void 0),s([B({type:String}),n("design:type",Object)],st.prototype,"cancelText",void 0),s([B({type:Array}),n("design:type",Array)],st.prototype,"stackedActions",void 0),st=s([a("custom-popup")],st);let nt=class extends t{constructor(){super(...arguments),this.value=0,this.max=5}static{this.styles=o`
|
|
1777
|
+
`}};s([B({type:Boolean,reflect:!0}),n("design:type",Object)],st.prototype,"open",void 0),s([B({type:String}),n("design:type",String)],st.prototype,"type",void 0),s([B({type:String}),n("design:type",Object)],st.prototype,"icon",void 0),s([B({type:String}),n("design:type",Object)],st.prototype,"title",void 0),s([B({type:String}),n("design:type",Object)],st.prototype,"description",void 0),s([B({type:String}),n("design:type",Object)],st.prototype,"width",void 0),s([B({type:String}),n("design:type",Object)],st.prototype,"height",void 0),s([B({type:String}),n("design:type",Object)],st.prototype,"buttonText",void 0),s([B({type:String}),n("design:type",Object)],st.prototype,"confirmText",void 0),s([B({type:String}),n("design:type",Object)],st.prototype,"cancelText",void 0),s([B({type:Array}),n("design:type",Array)],st.prototype,"stackedActions",void 0),st=s([a("custom-popup")],st);let nt=class extends t{constructor(){super(...arguments),this.value=0,this.max=5}static{this.styles=o`
|
|
1771
1778
|
:host {
|
|
1772
1779
|
display: inline-block;
|
|
1773
1780
|
width: 64px;
|
|
@@ -2331,7 +2338,7 @@ function P(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
2331
2338
|
flex-shrink: 0;
|
|
2332
2339
|
}
|
|
2333
2340
|
|
|
2334
|
-
options-list li.no-results-item {
|
|
2341
|
+
.options-list li.no-results-item {
|
|
2335
2342
|
${N}
|
|
2336
2343
|
cursor: default !important;
|
|
2337
2344
|
background-color: white !important;
|
|
@@ -2344,7 +2351,7 @@ function P(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
2344
2351
|
.mobile-modal .options-list li.no-results-item.mobile-item {
|
|
2345
2352
|
text-align: center;
|
|
2346
2353
|
}
|
|
2347
|
-
`]}manageScrollElement(t,e){e?t.classList.add("modal-open-no-scroll"):t.classList.remove("modal-open-no-scroll")}toggleDynamicScrollLock(t){const e=document.documentElement;if(t){this.originalHtmlOverflow=e.style.overflow,this.originalHtmlPaddingRight=e.style.paddingRight,e.style.overflow="hidden",this.manageScrollElement(e,!0);if(e.scrollHeight>e.clientHeight){const t=window.innerWidth-e.clientWidth;e.style.paddingRight=`${t}px`}}else e.style.overflow=this.originalHtmlOverflow,e.style.paddingRight=this.originalHtmlPaddingRight,this.manageScrollElement(e,!1)}sortOptions(t,e,i){const o=t=>"string"==typeof t?t:"string"==typeof t.value?t.value:"",r=this.getOptionLabel(t),s=this.getOptionLabel(e),n=r.toLowerCase(),a=s.toLowerCase();if(i&&i.length>0){const t=i.toLowerCase(),e=n.startsWith(t),o=a.startsWith(t);if(e&&!o)return-1;if(!e&&o)return 1}const l=o(t),d=o(e);if("+54"===l)return-1;if("+54"===d)return 1;if("+54"===l&&"+54"===d)return 0;const c=r.match(/^\d+(\.\d+)?/),h=s.match(/^\d+(\.\d+)?/),p=c?Number(c[0]):NaN,u=h?Number(h[0]):NaN;return isNaN(p)||isNaN(u)?n<a?-1:n>a?1:0:p-u}filterAndSortOptions(){if(!this.filterable||!this.filterValue||0===this.filterValue.length)return this.filteredOptions=this.sortable?[...this.options].sort(((t,e)=>this.sortOptions(t,e,void 0))):[...this.options],this.highlightedIndex=-1,void(this.showNoResults=!1);const t=this.filterValue,e=t.toLowerCase();let i=this.options.filter((t=>this.getOptionLabel(t).toLowerCase().includes(e)));this.sortable?this.filteredOptions=i.sort(((e,i)=>this.sortOptions(e,i,t))):this.filteredOptions=i,this.highlightedIndex=this.filteredOptions.length>0?0:-1,this.showNoResults=0===this.filteredOptions.length}handleOptionHover(t){this.highlightedIndex!==t&&(this.highlightedIndex=t)}update(t){if(t.has("options")){if(this.sortable){const t=[...this.options].sort(((t,e)=>this.sortOptions(t,e,void 0)));this.options=t}this.filterAndSortOptions();if(this.options.length<=5)this.filterable=!1;else{const t=this.getAttribute("filterable");this.filterable=null===t||"false"!==t}}if((t.has("defaultValue")||t.has("options")||t.has("value")&&this.value)&&!this._isCleared){const t=this.value||this.defaultValue,e=this.options.find((e=>"string"==typeof e?e===t:e.value===t));e?(this.filterValue="string"==typeof e?e:e.label,this.value="string"==typeof e?e:e.value):((this.isOpen||this.filterValue)&&(this.isOpen||""!==this.value)||(this.filterValue=""),this.value="")}this._isCleared&&""===this.value&&(this._isCleared=!1),super.update(t)}willUpdate(t){t.has("filterValue")&&this.filterAndSortOptions()}updated(t){super.updated(t);const e=!1===t.get("isOpen");this.isMobile&&this.isOpen&&t.has("isOpen")&&e&&this.updateComplete.then((()=>{const t=this.mobileInputRef;t&&window.setTimeout((()=>{t.focus(),t.setSelectionRange(t.value.length,t.value.length)}),0)}))}connectedCallback(){super.connectedCallback(),this.updateResponsiveMode(),window.addEventListener("resize",this.updateResponsiveModeBound),document.addEventListener("click",this.handleClickOutside.bind(this))}disconnectedCallback(){window.removeEventListener("resize",this.updateResponsiveModeBound),document.removeEventListener("click",this.handleClickOutside.bind(this)),this.isMobile&&this.toggleDynamicScrollLock(!1),super.disconnectedCallback()}updateResponsiveMode(){this.isMobile=window.innerWidth<=940}handleInputClick(t){this.disabled||(this.isOpen||(this.filteredOptions=[...this.options],this.showNoResults=!1,this.isMobile&&(this.mobileFilterValue="")),this.isOpen=!this.isOpen,this.isMobile&&this.toggleDynamicScrollLock(this.isOpen),this.requestUpdate())}handleInput(t){if(!this.filterable)return;this._isCleared=!1;const e=t.target.value,i=this.maxLength?e.slice(0,this.maxLength):e;if(this.filterValue=i,this.isOpen=!0,""===i)this.value="",this.filteredOptions=[...this.options],this.showNoResults=!1;else{const t=i.toLowerCase();this.filteredOptions=this.options.filter((e=>("string"==typeof e?e:e.label).toLowerCase().includes(t))),this.showNoResults=0===this.filteredOptions.length}this.debounceTimeout&&clearTimeout(this.debounceTimeout),this.debounceTimeout=window.setTimeout((()=>{this.filterValue.length>2&&this.dispatchEvent(new CustomEvent("filter-location",{detail:{value:this.filterValue},bubbles:!0,composed:!0}))}),300),this.requestUpdate()}handleMobileInput(t){this._isCleared=!1;const e=t.target.value,i=this.maxLength?e.slice(0,this.maxLength):e;this.mobileFilterValue=i;const o=i.toLowerCase();this.filteredOptions=this.options.filter((t=>("string"==typeof t?t:t.label).toLowerCase().includes(o))),this.showNoResults=i.length>0&&0===this.filteredOptions.length,this.requestUpdate(),this.debounceTimeout&&clearTimeout(this.debounceTimeout),this.debounceTimeout=window.setTimeout((()=>{i.length>2?this.dispatchEvent(new CustomEvent("filter-location",{detail:{value:i},bubbles:!0,composed:!0})):0===i.length&&(this.filteredOptions=[...this.options])}),300)}handleSelect(t){this._isCleared=!1,this.highlightedIndex=-1;const e="string"==typeof t?t:t.value;this.dispatchEvent(new CustomEvent("option-selected",{detail:{value:e},bubbles:!0,composed:!0})),this.filterValue="string"==typeof t?t:t.label,this.value=e,this.isOpen=!1,this.isMobile&&this.toggleDynamicScrollLock(!1),this.mobileFilterValue=this.filterValue,this.filteredOptions=[...this.options],this.showNoResults=!1,this.requestUpdate()}handleIconClick(){if(this.disabled)return;this.highlightedIndex=-1;const t=this.isRenderClearButton,e="string"==typeof this.value&&""!==this.value,i="object"==typeof this.value&&null!==this.value&&Object.keys(this.value).length>0;t&&(e||i)?(this._isCleared=!0,this.filterValue="",this.value="",this.filteredOptions=[...this.options],this.dispatchEvent(new CustomEvent("option-selected",{detail:{value:""},bubbles:!0,composed:!0})),this.isOpen=!1):(this.isOpen=!this.isOpen,this.isOpen?(this.mobileFilterValue="",this.showNoResults=!1,this.filteredOptions=[...this.options],this.updateComplete.then((()=>{if(this.isMobile)return;const t=this.shadowRoot?.querySelector(".filter-input");t?.focus()}))):(this.mobileFilterValue="",this.filteredOptions=[...this.options])),this.requestUpdate()}handleClickOutside(t){const e=t.target;e instanceof Node&&(!this.contains(e)&&this.isOpen&&(this.isOpen=!1,this.isMobile&&this.toggleDynamicScrollLock(!1),this.requestUpdate()),this.isMobile&&(this.mobileFilterValue="",this.filteredOptions=[...this.options]))}handleKeyDown(t){const{key:e}=t,i=this.shadowRoot?.querySelector(".filter-input");if("Backspace"===e&&this.filterable){const t=i?.value||"",e=i&&i.selectionStart!==i.selectionEnd,o=1===t.length&&!e,r=0===t.length;(o||r)&&(this.value="",this.filterValue="",this._isCleared=!0,this.filteredOptions=[...this.options],this.isOpen=!0,this.dispatchEvent(new CustomEvent("option-selected",{detail:{value:""},bubbles:!0,composed:!0})),this.requestUpdate())}const o=this.filteredOptions.filter((t=>!("object"==typeof t&&t.disabled)));if(!this.isOpen&&("Enter"===e||" "===e)){t.preventDefault(),this.isOpen=!0;const e=this.filteredOptions.findIndex((t=>!("object"==typeof t&&t.disabled)));return this.highlightedIndex=-1!==e?e:-1,void this.requestUpdate()}if(this.isOpen){if("ArrowDown"===e){t.preventDefault();let e=this.highlightedIndex+1;for(;e<this.filteredOptions.length;){const t=this.filteredOptions[e];if("object"!=typeof t||!t.disabled){this.highlightedIndex=e;break}e++}if(e>=this.filteredOptions.length){const t=this.filteredOptions.length-1;this.highlightedIndex=o.length>0?t:-1}this.requestUpdate(),this.updateComplete.then((()=>this.scrollHighlightedIntoView()))}else if("ArrowUp"===e){t.preventDefault();let e=this.highlightedIndex-1;for(;e>=0;){const t=this.filteredOptions[e];if("object"!=typeof t||!t.disabled){this.highlightedIndex=e;break}e--}e<0&&(this.highlightedIndex=-1),this.requestUpdate(),this.updateComplete.then((()=>this.scrollHighlightedIntoView()))}else if("Enter"===e||" "===e){this.highlightedIndex>=0&&t.preventDefault();const e=this.filteredOptions[this.highlightedIndex];if(this.highlightedIndex>=0&&e&&("object"!=typeof e||!e.disabled)){this.handleSelect(e);const t=this.shadowRoot?.querySelector(".filter-input"),i=this.shadowRoot?.querySelector(".filter-fake");return t?t.focus():i?.focus(),void(this.highlightedIndex=-1)}}else if("Escape"===e){t.preventDefault(),this.isOpen=!1,this.highlightedIndex=-1,this.isMobile&&this.toggleDynamicScrollLock(!1);const e=this.shadowRoot?.querySelector(".filter-input"),i=this.shadowRoot?.querySelector(".filter-fake");e?e.focus():i?.focus()}else"Tab"===e?(this.isOpen=!1,this.highlightedIndex=-1,this.requestUpdate()):!this.isMobile&&this.filterable&&1===e.length&&(this.highlightedIndex=-1);if(("ArrowLeft"===e||"ArrowRight"===e)&&this.filterable)return}if("ArrowRight"!==e)this.isOpen&&!this.isMobile&&this.filterable&&1===e.length&&(this.highlightedIndex=-1);else{const e=!i||i.selectionStart===i.value.length;if(!this.filterable||e){t.preventDefault();const e=this.shadowRoot?.querySelector(".icon-button");e?.focus()}}}handleButtonKeyDown(t){const{key:e}=t,i=this.shadowRoot?.querySelector(".filter-input"),o=this.shadowRoot?.querySelector(".filter-fake"),r=i||o;return"ArrowLeft"===e?(t.preventDefault(),r?.focus(),void(r instanceof HTMLInputElement&&(r.selectionStart=r.selectionEnd=r.value.length))):"Enter"===e||" "===e?(t.preventDefault(),this.filterable&&this.filterValue?(this.handleIconClick(),r?.focus()):(this.isOpen=!this.isOpen,this.isOpen&&(this.highlightedIndex=-1,r?.focus())),void this.requestUpdate()):void("Tab"===e&&this.isOpen&&(this.isOpen=!1,this.highlightedIndex=-1,this.requestUpdate()))}handleBlur(){window.setTimeout((()=>{if(this.isOpen)return;let t=!1,e=!1;if(this.value&&""!==this.value){const i=this.options.find((t=>"string"==typeof t?t===this.value:t.value===this.value));if(i){t=!0,e=("string"==typeof i?i:i.label).toLowerCase()===this.filterValue.toLowerCase()}}let i=!1;const o=!this.filterValue||""===this.filterValue.trim();o||t&&e||(i=!0),i?(this._isCleared=!0,this.value="",this.filterValue="",this.showNoResults=!1,this.dispatchEvent(new CustomEvent("option-selected",{detail:{value:""},bubbles:!0,composed:!0})),this.filterable&&(this.filteredOptions=[...this.options])):o&&this.filterable?(this.filteredOptions=[...this.options],this.showNoResults=!1):this.showNoResults&&(this.showNoResults=!1),this.requestUpdate()}),200)}scrollHighlightedIntoView(){if(this.isMobile||this.highlightedIndex<0)return;const t=this.shadowRoot?.querySelector(".options-list");if(!t)return;const e=t.querySelector("li.highlighted");e&&e.scrollIntoView({block:"nearest"})}renderSelectedIcon(){const t=this.options.find((t=>"string"==typeof t?t===this.value:t.value===this.value));return t&&"string"!=typeof t&&t.icon&&"string"==typeof t.icon?e`<span class="icon-selected" .innerHTML="${t.icon}"></span>`:i}renderOptionIcon(t){return t&&"string"==typeof t?e`<span class="icon-list" .innerHTML="${t}"></span>`:i}_getFilteredOptions(){if(!this.filterable)return this.options;if(!this.filterValue||""===this.filterValue.trim())return this.options;const t=this.filterValue.toLowerCase();return this.options.filter((e=>"string"==typeof e?e.toLowerCase().includes(t):e.label.toLowerCase().includes(t)))}render(){const t=this.isMobile,o=` --filter-text-color: ${this.value?"var( --secondary-color )":"var( --secondary-color-40 )"}; `,r=e`
|
|
2354
|
+
`]}manageScrollElement(t,e){e?t.classList.add("modal-open-no-scroll"):t.classList.remove("modal-open-no-scroll")}toggleDynamicScrollLock(t){const e=document.documentElement;if(t){this.originalHtmlOverflow=e.style.overflow,this.originalHtmlPaddingRight=e.style.paddingRight,e.style.overflow="hidden",this.manageScrollElement(e,!0);if(e.scrollHeight>e.clientHeight){const t=window.innerWidth-e.clientWidth;e.style.paddingRight=`${t}px`}}else e.style.overflow=this.originalHtmlOverflow,e.style.paddingRight=this.originalHtmlPaddingRight,this.manageScrollElement(e,!1)}sortOptions(t,e,i){const o=t=>"string"==typeof t?t:"string"==typeof t.value?t.value:"",r=this.getOptionLabel(t),s=this.getOptionLabel(e),n=r.toLowerCase(),a=s.toLowerCase();if(i&&i.length>0){const t=i.toLowerCase(),e=n.startsWith(t),o=a.startsWith(t);if(e&&!o)return-1;if(!e&&o)return 1}const l=o(t),d=o(e);if("+54"===l)return-1;if("+54"===d)return 1;if("+54"===l&&"+54"===d)return 0;const c=r.match(/^\d+(\.\d+)?/),h=s.match(/^\d+(\.\d+)?/),p=c?Number(c[0]):NaN,u=h?Number(h[0]):NaN;return isNaN(p)||isNaN(u)?n<a?-1:n>a?1:0:p-u}filterAndSortOptions(){if(!this.filterable||!this.filterValue||0===this.filterValue.length)return this.filteredOptions=this.sortable?[...this.options].sort(((t,e)=>this.sortOptions(t,e,void 0))):[...this.options],this.highlightedIndex=-1,void(this.showNoResults=!1);const t=this.filterValue,e=t.toLowerCase();let i=this.options.filter((t=>this.getOptionLabel(t).toLowerCase().includes(e)));this.sortable?this.filteredOptions=i.sort(((e,i)=>this.sortOptions(e,i,t))):this.filteredOptions=i,this.highlightedIndex=this.filteredOptions.length>0?0:-1,this.showNoResults=0===this.filteredOptions.length}handleOptionHover(t){this.highlightedIndex!==t&&(this.highlightedIndex=t)}update(t){if(t.has("options")){if(this.sortable){const t=[...this.options].sort(((t,e)=>this.sortOptions(t,e,void 0)));this.options=t}this.filterAndSortOptions();if(this.options.length<=5)this.filterable=!1;else{const t=this.getAttribute("filterable");this.filterable=null===t||"false"!==t}}if((t.has("defaultValue")||t.has("options")||t.has("value")&&this.value)&&!this._isCleared){const t=this.value||this.defaultValue,e=this.options.find((e=>"string"==typeof e?e===t:e.value===t));e?(this.filterValue="string"==typeof e?e:e.label,this.value="string"==typeof e?e:e.value):((this.isOpen||this.filterValue)&&(this.isOpen||""!==this.value)||(this.filterValue=""),this.value="")}this._isCleared&&""===this.value&&(this._isCleared=!1),super.update(t)}willUpdate(t){t.has("filterValue")&&this.filterAndSortOptions()}updated(t){super.updated(t);const e=!1===t.get("isOpen");this.isMobile&&this.isOpen&&t.has("isOpen")&&e&&this.updateComplete.then((()=>{const t=this.mobileInputRef;t&&window.setTimeout((()=>{t.focus(),t.setSelectionRange(t.value.length,t.value.length)}),0)}))}connectedCallback(){super.connectedCallback(),this.updateResponsiveMode(),window.addEventListener("resize",this.updateResponsiveModeBound),document.addEventListener("click",this.handleClickOutside.bind(this))}disconnectedCallback(){window.removeEventListener("resize",this.updateResponsiveModeBound),document.removeEventListener("click",this.handleClickOutside.bind(this)),this.debounceTimeout&&(clearTimeout(this.debounceTimeout),this.debounceTimeout=null),this.isMobile&&this.toggleDynamicScrollLock(!1),super.disconnectedCallback()}updateResponsiveMode(){this.isMobile=window.innerWidth<=940}handleInputClick(t){this.disabled||(this.isOpen||(this.filteredOptions=[...this.options],this.showNoResults=!1,this.isMobile&&(this.mobileFilterValue="")),this.isOpen=!this.isOpen,this.dispatchEvent(new CustomEvent("dropdown-toggle",{detail:{open:this.isOpen},bubbles:!0,composed:!0})),this.isMobile&&this.toggleDynamicScrollLock(this.isOpen),this.requestUpdate())}handleInput(t){if(!this.filterable)return;this._isCleared=!1;const e=t.target.value,i=this.maxLength?e.slice(0,this.maxLength):e;if(this.filterValue=i,this.isOpen=!0,""===i)this.value="",this.filteredOptions=[...this.options],this.showNoResults=!1;else{const t=i.toLowerCase();this.filteredOptions=this.options.filter((e=>("string"==typeof e?e:e.label).toLowerCase().includes(t))),this.showNoResults=0===this.filteredOptions.length}this.debounceTimeout&&clearTimeout(this.debounceTimeout),this.debounceTimeout=window.setTimeout((()=>{this.filterValue.length>2&&this.dispatchEvent(new CustomEvent("filter-location",{detail:{value:this.filterValue},bubbles:!0,composed:!0}))}),300),this.requestUpdate()}handleMobileInput(t){this._isCleared=!1;const e=t.target.value,i=this.maxLength?e.slice(0,this.maxLength):e;this.mobileFilterValue=i;const o=i.toLowerCase();this.filteredOptions=this.options.filter((t=>("string"==typeof t?t:t.label).toLowerCase().includes(o))),this.showNoResults=i.length>0&&0===this.filteredOptions.length,this.requestUpdate(),this.debounceTimeout&&clearTimeout(this.debounceTimeout),this.debounceTimeout=window.setTimeout((()=>{i.length>2?this.dispatchEvent(new CustomEvent("filter-location",{detail:{value:i},bubbles:!0,composed:!0})):0===i.length&&(this.filteredOptions=[...this.options])}),300)}handleSelect(t){this._isCleared=!1,this.highlightedIndex=-1;const e="string"==typeof t?t:t.value;this.dispatchEvent(new CustomEvent("option-selected",{detail:{value:e},bubbles:!0,composed:!0})),this.filterValue="string"==typeof t?t:t.label,this.value=e,this.isOpen=!1,this.isMobile&&this.toggleDynamicScrollLock(!1),this.mobileFilterValue=this.filterValue,this.filteredOptions=[...this.options],this.showNoResults=!1,this.requestUpdate()}handleIconClick(){if(this.disabled)return;this.highlightedIndex=-1;const t=this.isRenderClearButton,e="string"==typeof this.value&&""!==this.value,i="object"==typeof this.value&&null!==this.value&&Object.keys(this.value).length>0;t&&(e||i)?(this._isCleared=!0,this.filterValue="",this.value="",this.filteredOptions=[...this.options],this.dispatchEvent(new CustomEvent("option-selected",{detail:{value:""},bubbles:!0,composed:!0})),this.isOpen=!1):(this.isOpen=!this.isOpen,this.isOpen?(this.mobileFilterValue="",this.showNoResults=!1,this.filteredOptions=[...this.options],this.updateComplete.then((()=>{if(this.isMobile)return;const t=this.shadowRoot?.querySelector(".filter-input");t?.focus()}))):(this.mobileFilterValue="",this.filteredOptions=[...this.options])),this.requestUpdate()}handleReset(){this.filterValue="",this.showNoResults=!1,this.highlightedIndex=-1,this.mobileFilterValue="",this.filteredOptions=[...this.options]}handleClickOutside(t){const e=t.target;if(e instanceof Node){if(!this.contains(e)&&this.isOpen){const t=this.value&&""!==this.value;this.isOpen=!1,t||this.handleReset(),this.isMobile&&this.toggleDynamicScrollLock(!1),this.requestUpdate()}this.isMobile&&(this.mobileFilterValue="",this.filteredOptions=[...this.options])}}handleKeyDown(t){const{key:e}=t,i=this.shadowRoot?.querySelector(".filter-input");if("Backspace"===e&&this.filterable){const t=i?.value||"",e=i&&i.selectionStart!==i.selectionEnd,o=1===t.length&&!e,r=0===t.length;(o||r)&&(this.value="",this.filterValue="",this._isCleared=!0,this.filteredOptions=[...this.options],this.isOpen=!0,this.dispatchEvent(new CustomEvent("option-selected",{detail:{value:""},bubbles:!0,composed:!0})),this.requestUpdate())}const o=this.filteredOptions.filter((t=>!("object"==typeof t&&t.disabled)));if(!this.isOpen&&("Enter"===e||" "===e)){t.preventDefault(),this.isOpen=!0;const e=this.filteredOptions.findIndex((t=>!("object"==typeof t&&t.disabled)));return this.highlightedIndex=-1!==e?e:-1,void this.requestUpdate()}if(this.isOpen){if("ArrowDown"===e){t.preventDefault();let e=this.highlightedIndex+1;for(;e<this.filteredOptions.length;){const t=this.filteredOptions[e];if("object"!=typeof t||!t.disabled){this.highlightedIndex=e;break}e++}if(e>=this.filteredOptions.length){const t=this.filteredOptions.length-1;this.highlightedIndex=o.length>0?t:-1}this.requestUpdate(),this.updateComplete.then((()=>this.scrollHighlightedIntoView()))}else if("ArrowUp"===e){t.preventDefault();let e=this.highlightedIndex-1;for(;e>=0;){const t=this.filteredOptions[e];if("object"!=typeof t||!t.disabled){this.highlightedIndex=e;break}e--}e<0&&(this.highlightedIndex=-1),this.requestUpdate(),this.updateComplete.then((()=>this.scrollHighlightedIntoView()))}else if("Enter"===e||" "===e){this.highlightedIndex>=0&&t.preventDefault();const e=this.filteredOptions[this.highlightedIndex];if(this.highlightedIndex>=0&&e&&("object"!=typeof e||!e.disabled)){this.handleSelect(e);const t=this.shadowRoot?.querySelector(".filter-input"),i=this.shadowRoot?.querySelector(".filter-fake");return t?t.focus():i?.focus(),void(this.highlightedIndex=-1)}}else if("Escape"===e){t.preventDefault(),this.isOpen=!1,this.highlightedIndex=-1,this.isMobile&&this.toggleDynamicScrollLock(!1);const e=this.shadowRoot?.querySelector(".filter-input"),i=this.shadowRoot?.querySelector(".filter-fake");e?e.focus():i?.focus()}else"Tab"===e?(this.isOpen=!1,this.highlightedIndex=-1,this.requestUpdate()):!this.isMobile&&this.filterable&&1===e.length&&(this.highlightedIndex=-1);if(("ArrowLeft"===e||"ArrowRight"===e)&&this.filterable)return}if("ArrowRight"!==e)this.isOpen&&!this.isMobile&&this.filterable&&1===e.length&&(this.highlightedIndex=-1);else{const e=!i||i.selectionStart===i.value.length;if(!this.filterable||e){t.preventDefault();const e=this.shadowRoot?.querySelector(".icon-button");e?.focus()}}}handleButtonKeyDown(t){const{key:e}=t,i=this.shadowRoot?.querySelector(".filter-input"),o=this.shadowRoot?.querySelector(".filter-fake"),r=i||o;return"ArrowLeft"===e?(t.preventDefault(),r?.focus(),void(r instanceof HTMLInputElement&&(r.selectionStart=r.selectionEnd=r.value.length))):"Enter"===e||" "===e?(t.preventDefault(),this.filterable&&this.filterValue?(this.handleIconClick(),r?.focus()):(this.isOpen=!this.isOpen,this.isOpen&&(this.highlightedIndex=-1,r?.focus())),void this.requestUpdate()):void("Tab"===e&&this.isOpen&&(this.isOpen=!1,this.highlightedIndex=-1,this.requestUpdate()))}handleBlur(){window.setTimeout((()=>{if(this.isOpen)return;let t=!1,e=!1;if(this.value&&""!==this.value){const i=this.options.find((t=>"string"==typeof t?t===this.value:t.value===this.value));if(i){t=!0,e=("string"==typeof i?i:i.label).toLowerCase()===this.filterValue.toLowerCase()}}let i=!1;const o=!this.filterValue||""===this.filterValue.trim();o||t&&e||(i=!0),i?(this._isCleared=!0,this.value="",this.filterValue="",this.showNoResults=!1,this.dispatchEvent(new CustomEvent("option-selected",{detail:{value:""},bubbles:!0,composed:!0})),this.filterable&&(this.filteredOptions=[...this.options])):o&&this.filterable?(this.filteredOptions=[...this.options],this.showNoResults=!1):this.showNoResults&&(this.showNoResults=!1),this.requestUpdate()}),200)}scrollHighlightedIntoView(){if(this.isMobile||this.highlightedIndex<0)return;const t=this.shadowRoot?.querySelector(".options-list");if(!t)return;const e=t.querySelector("li.highlighted");e&&e.scrollIntoView({block:"nearest"})}renderSelectedIcon(){const t=this.options.find((t=>"string"==typeof t?t===this.value:t.value===this.value));return t&&"string"!=typeof t&&t.icon&&"string"==typeof t.icon?e`<span class="icon-selected" .innerHTML="${t.icon}"></span>`:i}renderOptionIcon(t){return t&&"string"==typeof t?e`<span class="icon-list" .innerHTML="${t}"></span>`:i}_getFilteredOptions(){if(!this.filterable)return this.options;if(!this.filterValue||""===this.filterValue.trim())return this.options;const t=this.filterValue.toLowerCase();return this.options.filter((e=>"string"==typeof e?e.toLowerCase().includes(t):e.label.toLowerCase().includes(t)))}render(){const t=this.isMobile,o=` --filter-text-color: ${this.value?"var( --secondary-color )":"var( --secondary-color-40 )"}; `,r=e`
|
|
2348
2355
|
<randstad-icon
|
|
2349
2356
|
name="${this.isOpen&&this.filteredOptions.length>0?"arrow_up":"arrow_down"}"
|
|
2350
2357
|
size="24px"
|
|
@@ -2352,7 +2359,7 @@ function P(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
2352
2359
|
>
|
|
2353
2360
|
</randstad-icon>
|
|
2354
2361
|
`,s=!0===this.isRenderClearButton,n=this.isOpen&&(this.filteredOptions.length>0||this.filterValue.length>0),a=!this.textLabelFilterNotResult||"string"!=typeof this.textLabelFilterNotResult,l=!this.textLabelMobileSearch||"string"!=typeof this.textLabelMobileSearch,d=!this.placeholder||"string"!=typeof this.placeholder,c=a?"No se encontraron resultados":this.textLabelFilterNotResult,h=l?"buscá una opción":this.textLabelMobileSearch,p=d?"seleccioná una opción":this.placeholder;return e`
|
|
2355
|
-
<div class="select-container
|
|
2362
|
+
<div class="select-container style="${this.labelColor?` --label-color: ${this.labelColor};`:""} ${o}">
|
|
2356
2363
|
${this.renderLabelContainer()}
|
|
2357
2364
|
|
|
2358
2365
|
<div class="list-container">
|
|
@@ -2734,7 +2741,7 @@ function P(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
2734
2741
|
}
|
|
2735
2742
|
|
|
2736
2743
|
.tab {
|
|
2737
|
-
${
|
|
2744
|
+
${z};
|
|
2738
2745
|
display: flex;
|
|
2739
2746
|
gap: 8px;
|
|
2740
2747
|
flex-direction: row;
|
|
@@ -3085,7 +3092,7 @@ function P(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
3085
3092
|
</div>
|
|
3086
3093
|
</div>
|
|
3087
3094
|
</div>
|
|
3088
|
-
`}};s([B({type:Array}),n("design:type",Array)],yt.prototype,"acceptedFileTypes",void 0),s([B({type:Number}),n("design:type",Object)],yt.prototype,"maxFiles",void 0),s([B({type:Number}),n("design:type",Object)],yt.prototype,"maxFileSize",void 0),s([B({type:Boolean}),n("design:type",Object)],yt.prototype,"isShowInfoSize",void 0),s([B({type:Boolean}),n("design:type",Object)],yt.prototype,"isChangeStyleError",void 0),s([T(),n("design:type",Object)],yt.prototype,"isDragging",void 0),s([T(),n("design:type",Array)],yt.prototype,"imageUrls",void 0),s([T(),n("design:type",Boolean)],yt.prototype,"isMaxFilesReached",void 0),yt=s([a("upload-image")],yt);const ft=6048e5,vt=Symbol.for("constructDateFrom");function wt(t,e){return"function"==typeof t?t(e):t&&"object"==typeof t&&vt in t?t[vt](e):t instanceof Date?new t.constructor(e):new Date(e)}function xt(t,e){return wt(e||t,t)}function kt(t,e,i){const o=xt(t,i?.in);if(isNaN(e))return wt(t,NaN);if(!e)return o;const r=o.getDate(),s=wt(t,o.getTime());s.setMonth(o.getMonth()+e+1,0);return r>=s.getDate()?s:(o.setFullYear(s.getFullYear(),s.getMonth(),r),o)}let $t={};function St(){return $t}function Dt(t,e){const i=St(),o=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,r=xt(t,e?.in),s=r.getDay(),n=(s<o?7:0)+s-o;return r.setDate(r.getDate()-n),r.setHours(0,0,0,0),r}function Et(t,e){return Dt(t,{...e,weekStartsOn:1})}function Ct(t,e){const i=xt(t,e?.in),o=i.getFullYear(),r=wt(i,0);r.setFullYear(o+1,0,4),r.setHours(0,0,0,0);const s=Et(r),n=wt(i,0);n.setFullYear(o,0,4),n.setHours(0,0,0,0);const a=Et(n);return i.getTime()>=s.getTime()?o+1:i.getTime()>=a.getTime()?o:o-1}function Ot(t){const e=xt(t),i=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return i.setUTCFullYear(e.getFullYear()),+t-+i}function Ft(t,...e){const i=wt.bind(null,e.find((t=>"object"==typeof t)));return e.map(i)}function Mt(t,e){const i=xt(t,e?.in);return i.setHours(0,0,0,0),i}function Lt(t,e,i){return kt(t,12*e,i)}function Bt(t){return!(!((e=t)instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))&&"number"!=typeof t||isNaN(+xt(t)));var e}function Tt(t,e){const i=xt(t,e?.in);return i.setDate(1),i.setHours(0,0,0,0),i}const Pt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function jt(t){return(e={})=>{const i=e.width?String(e.width):t.defaultWidth;return t.formats[i]||t.formats[t.defaultWidth]}}const Rt={date:jt({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:jt({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:jt({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},At={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Wt(t){return(e,i)=>{let o;if("formatting"===(i?.context?String(i.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,r=i?.width?String(i.width):e;o=t.formattingValues[r]||t.formattingValues[e]}else{const e=t.defaultWidth,r=i?.width?String(i.width):t.defaultWidth;o=t.values[r]||t.values[e]}return o[t.argumentCallback?t.argumentCallback(e):e]}}function Nt(t){return(e,i={})=>{const o=i.width,r=o&&t.matchPatterns[o]||t.matchPatterns[t.defaultMatchWidth],s=e.match(r);if(!s)return null;const n=s[0],a=o&&t.parsePatterns[o]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?function(t,e){for(let i=0;i<t.length;i++)if(e(t[i]))return i;return}(a,(t=>t.test(n))):function(t,e){for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&e(t[i]))return i;return}(a,(t=>t.test(n)));let d;d=t.valueCallback?t.valueCallback(l):l,d=i.valueCallback?i.valueCallback(d):d;return{value:d,rest:e.slice(n.length)}}}var _t;const zt={code:"en-US",formatDistance:(t,e,i)=>{let o;const r=Pt[t];return o="string"==typeof r?r:1===e?r.one:r.other.replace("{{count}}",e.toString()),i?.addSuffix?i.comparison&&i.comparison>0?"in "+o:o+" ago":o},formatLong:Rt,formatRelative:(t,e,i,o)=>At[t],localize:{ordinalNumber:(t,e)=>{const i=Number(t),o=i%100;if(o>20||o<10)switch(o%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:Wt({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Wt({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:Wt({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Wt({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Wt({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(_t={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const i=t.match(_t.matchPattern);if(!i)return null;const o=i[0],r=t.match(_t.parsePattern);if(!r)return null;let s=_t.valueCallback?_t.valueCallback(r[0]):r[0];return s=e.valueCallback?e.valueCallback(s):s,{value:s,rest:t.slice(o.length)}}),era:Nt({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Nt({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:Nt({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Nt({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Nt({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function It(t,e){const i=xt(t,e?.in),o=function(t,e){const[i,o]=Ft(0,t,e),r=Mt(i),s=Mt(o),n=+r-Ot(r),a=+s-Ot(s);return Math.round((n-a)/864e5)}(i,function(t,e){const i=xt(t,e?.in);return i.setFullYear(i.getFullYear(),0,1),i.setHours(0,0,0,0),i}(i));return o+1}function qt(t,e){const i=xt(t,e?.in),o=+Et(i)-+function(t,e){const i=Ct(t,e),o=wt(t,0);return o.setFullYear(i,0,4),o.setHours(0,0,0,0),Et(o)}(i);return Math.round(o/ft)+1}function Vt(t,e){const i=xt(t,e?.in),o=i.getFullYear(),r=St(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,n=wt(e?.in||t,0);n.setFullYear(o+1,0,s),n.setHours(0,0,0,0);const a=Dt(n,e),l=wt(e?.in||t,0);l.setFullYear(o,0,s),l.setHours(0,0,0,0);const d=Dt(l,e);return+i>=+a?o+1:+i>=+d?o:o-1}function Ut(t,e){const i=xt(t,e?.in),o=+Dt(i,e)-+function(t,e){const i=St(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,r=Vt(t,e),s=wt(e?.in||t,0);return s.setFullYear(r,0,o),s.setHours(0,0,0,0),Dt(s,e)}(i,e);return Math.round(o/ft)+1}function Ht(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const Yt={y(t,e){const i=t.getFullYear(),o=i>0?i:1-i;return Ht("yy"===e?o%100:o,e.length)},M(t,e){const i=t.getMonth();return"M"===e?String(i+1):Ht(i+1,2)},d:(t,e)=>Ht(t.getDate(),e.length),a(t,e){const i=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.toUpperCase();case"aaa":return i;case"aaaaa":return i[0];default:return"am"===i?"a.m.":"p.m."}},h:(t,e)=>Ht(t.getHours()%12||12,e.length),H:(t,e)=>Ht(t.getHours(),e.length),m:(t,e)=>Ht(t.getMinutes(),e.length),s:(t,e)=>Ht(t.getSeconds(),e.length),S(t,e){const i=e.length,o=t.getMilliseconds();return Ht(Math.trunc(o*Math.pow(10,i-3)),e.length)}},Gt="midnight",Kt="noon",Xt="morning",Qt="afternoon",Jt="evening",Zt="night",te={G:function(t,e,i){const o=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(o,{width:"abbreviated"});case"GGGGG":return i.era(o,{width:"narrow"});default:return i.era(o,{width:"wide"})}},y:function(t,e,i){if("yo"===e){const e=t.getFullYear(),o=e>0?e:1-e;return i.ordinalNumber(o,{unit:"year"})}return Yt.y(t,e)},Y:function(t,e,i,o){const r=Vt(t,o),s=r>0?r:1-r;if("YY"===e){return Ht(s%100,2)}return"Yo"===e?i.ordinalNumber(s,{unit:"year"}):Ht(s,e.length)},R:function(t,e){return Ht(Ct(t),e.length)},u:function(t,e){return Ht(t.getFullYear(),e.length)},Q:function(t,e,i){const o=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(o);case"QQ":return Ht(o,2);case"Qo":return i.ordinalNumber(o,{unit:"quarter"});case"QQQ":return i.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(o,{width:"narrow",context:"formatting"});default:return i.quarter(o,{width:"wide",context:"formatting"})}},q:function(t,e,i){const o=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(o);case"qq":return Ht(o,2);case"qo":return i.ordinalNumber(o,{unit:"quarter"});case"qqq":return i.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(o,{width:"narrow",context:"standalone"});default:return i.quarter(o,{width:"wide",context:"standalone"})}},M:function(t,e,i){const o=t.getMonth();switch(e){case"M":case"MM":return Yt.M(t,e);case"Mo":return i.ordinalNumber(o+1,{unit:"month"});case"MMM":return i.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(o,{width:"narrow",context:"formatting"});default:return i.month(o,{width:"wide",context:"formatting"})}},L:function(t,e,i){const o=t.getMonth();switch(e){case"L":return String(o+1);case"LL":return Ht(o+1,2);case"Lo":return i.ordinalNumber(o+1,{unit:"month"});case"LLL":return i.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(o,{width:"narrow",context:"standalone"});default:return i.month(o,{width:"wide",context:"standalone"})}},w:function(t,e,i,o){const r=Ut(t,o);return"wo"===e?i.ordinalNumber(r,{unit:"week"}):Ht(r,e.length)},I:function(t,e,i){const o=qt(t);return"Io"===e?i.ordinalNumber(o,{unit:"week"}):Ht(o,e.length)},d:function(t,e,i){return"do"===e?i.ordinalNumber(t.getDate(),{unit:"date"}):Yt.d(t,e)},D:function(t,e,i){const o=It(t);return"Do"===e?i.ordinalNumber(o,{unit:"dayOfYear"}):Ht(o,e.length)},E:function(t,e,i){const o=t.getDay();switch(e){case"E":case"EE":case"EEE":return i.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(o,{width:"short",context:"formatting"});default:return i.day(o,{width:"wide",context:"formatting"})}},e:function(t,e,i,o){const r=t.getDay(),s=(r-o.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return Ht(s,2);case"eo":return i.ordinalNumber(s,{unit:"day"});case"eee":return i.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(r,{width:"short",context:"formatting"});default:return i.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,i,o){const r=t.getDay(),s=(r-o.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return Ht(s,e.length);case"co":return i.ordinalNumber(s,{unit:"day"});case"ccc":return i.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(r,{width:"narrow",context:"standalone"});case"cccccc":return i.day(r,{width:"short",context:"standalone"});default:return i.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,i){const o=t.getDay(),r=0===o?7:o;switch(e){case"i":return String(r);case"ii":return Ht(r,e.length);case"io":return i.ordinalNumber(r,{unit:"day"});case"iii":return i.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(o,{width:"short",context:"formatting"});default:return i.day(o,{width:"wide",context:"formatting"})}},a:function(t,e,i){const o=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(o,{width:"narrow",context:"formatting"});default:return i.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(t,e,i){const o=t.getHours();let r;switch(r=12===o?Kt:0===o?Gt:o/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(r,{width:"narrow",context:"formatting"});default:return i.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,i){const o=t.getHours();let r;switch(r=o>=17?Jt:o>=12?Qt:o>=4?Xt:Zt,e){case"B":case"BB":case"BBB":return i.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(r,{width:"narrow",context:"formatting"});default:return i.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,i){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),i.ordinalNumber(e,{unit:"hour"})}return Yt.h(t,e)},H:function(t,e,i){return"Ho"===e?i.ordinalNumber(t.getHours(),{unit:"hour"}):Yt.H(t,e)},K:function(t,e,i){const o=t.getHours()%12;return"Ko"===e?i.ordinalNumber(o,{unit:"hour"}):Ht(o,e.length)},k:function(t,e,i){let o=t.getHours();return 0===o&&(o=24),"ko"===e?i.ordinalNumber(o,{unit:"hour"}):Ht(o,e.length)},m:function(t,e,i){return"mo"===e?i.ordinalNumber(t.getMinutes(),{unit:"minute"}):Yt.m(t,e)},s:function(t,e,i){return"so"===e?i.ordinalNumber(t.getSeconds(),{unit:"second"}):Yt.s(t,e)},S:function(t,e){return Yt.S(t,e)},X:function(t,e,i){const o=t.getTimezoneOffset();if(0===o)return"Z";switch(e){case"X":return ie(o);case"XXXX":case"XX":return oe(o);default:return oe(o,":")}},x:function(t,e,i){const o=t.getTimezoneOffset();switch(e){case"x":return ie(o);case"xxxx":case"xx":return oe(o);default:return oe(o,":")}},O:function(t,e,i){const o=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ee(o,":");default:return"GMT"+oe(o,":")}},z:function(t,e,i){const o=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ee(o,":");default:return"GMT"+oe(o,":")}},t:function(t,e,i){return Ht(Math.trunc(+t/1e3),e.length)},T:function(t,e,i){return Ht(+t,e.length)}};function ee(t,e=""){const i=t>0?"-":"+",o=Math.abs(t),r=Math.trunc(o/60),s=o%60;return 0===s?i+String(r):i+String(r)+e+Ht(s,2)}function ie(t,e){if(t%60==0){return(t>0?"-":"+")+Ht(Math.abs(t)/60,2)}return oe(t,e)}function oe(t,e=""){const i=t>0?"-":"+",o=Math.abs(t);return i+Ht(Math.trunc(o/60),2)+e+Ht(o%60,2)}const re=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},se=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},ne={p:se,P:(t,e)=>{const i=t.match(/(P+)(p+)?/)||[],o=i[1],r=i[2];if(!r)return re(t,e);let s;switch(o){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;default:s=e.dateTime({width:"full"})}return s.replace("{{date}}",re(o,e)).replace("{{time}}",se(r,e))}},ae=/^D+$/,le=/^Y+$/,de=["D","DD","YY","YYYY"];const ce=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,he=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,pe=/^'([^]*?)'?$/,ue=/''/g,ge=/[a-zA-Z]/;function be(t,e,i){const o=St(),r=o.locale??zt,s=o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,n=o.weekStartsOn??o.locale?.options?.weekStartsOn??0,a=xt(t,i?.in);if(!Bt(a))throw new RangeError("Invalid time value");let l=e.match(he).map((t=>{const e=t[0];if("p"===e||"P"===e){return(0,ne[e])(t,r.formatLong)}return t})).join("").match(ce).map((t=>{if("''"===t)return{isToken:!1,value:"'"};const e=t[0];if("'"===e)return{isToken:!1,value:me(t)};if(te[e])return{isToken:!0,value:t};if(e.match(ge))throw new RangeError("Format string contains an unescaped latin alphabet character `"+e+"`");return{isToken:!1,value:t}}));r.localize.preprocessor&&(l=r.localize.preprocessor(a,l));const d={firstWeekContainsDate:s,weekStartsOn:n,locale:r};return l.map((i=>{if(!i.isToken)return i.value;const o=i.value;(function(t){return le.test(t)}(o)||function(t){return ae.test(t)}(o))&&function(t,e,i){const o=function(t,e,i){const o="Y"===t[0]?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${o} to the input \`${i}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(t,e,i);if(console.warn(o),de.includes(t))throw new RangeError(o)}(o,e,String(t));return(0,te[o[0]])(a,o,r.localize,d)})).join("")}function me(t){const e=t.match(pe);return e?e[1].replace(ue,"'"):t}function ye(t,e){return xt(t,e?.in).getDate()}function fe(t,e){const i=xt(t,e?.in),o=i.getFullYear(),r=i.getMonth(),s=wt(i,0);return s.setFullYear(o,r+1,0),s.setHours(0,0,0,0),s.getDate()}function ve(t,e){return+xt(t)>+xt(e)}function we(t,e){return+xt(t)<+xt(e)}function xe(t,e,i){const[o,r]=Ft(0,t,e);return o.getFullYear()===r.getFullYear()&&o.getMonth()===r.getMonth()}function ke(t,e,i){const[o,r]=Ft(0,t,e);return o.getFullYear()===r.getFullYear()}function $e(t,e){return function(t,e){const[i,o]=Ft(0,t,e);return+Mt(i)===+Mt(o)}(wt(t,t),function(t){return wt(t,Date.now())}(t))}let Se=class extends t{constructor(){super(...arguments),this.selectedDate=null,this.viewDate=new Date,this.isMobile=!1,this.calendarWidth=0,this.minDate=null,this.maxDate=null,this.type="date",this.currentView="days",this.handleOutsideClick=t=>{const e=this.getRootNode(),i=e?.host;!i||t.composedPath().includes(this)||t.composedPath().includes(i)||this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}static{this.styles=[Z,o`
|
|
3095
|
+
`}};s([B({type:Array}),n("design:type",Array)],yt.prototype,"acceptedFileTypes",void 0),s([B({type:Number}),n("design:type",Object)],yt.prototype,"maxFiles",void 0),s([B({type:Number}),n("design:type",Object)],yt.prototype,"maxFileSize",void 0),s([B({type:Boolean}),n("design:type",Object)],yt.prototype,"isShowInfoSize",void 0),s([B({type:Boolean}),n("design:type",Object)],yt.prototype,"isChangeStyleError",void 0),s([T(),n("design:type",Object)],yt.prototype,"isDragging",void 0),s([T(),n("design:type",Array)],yt.prototype,"imageUrls",void 0),s([T(),n("design:type",Boolean)],yt.prototype,"isMaxFilesReached",void 0),yt=s([a("upload-image")],yt);const ft=6048e5,vt=Symbol.for("constructDateFrom");function wt(t,e){return"function"==typeof t?t(e):t&&"object"==typeof t&&vt in t?t[vt](e):t instanceof Date?new t.constructor(e):new Date(e)}function xt(t,e){return wt(e||t,t)}function kt(t,e,i){const o=xt(t,i?.in);if(isNaN(e))return wt(t,NaN);if(!e)return o;const r=o.getDate(),s=wt(t,o.getTime());s.setMonth(o.getMonth()+e+1,0);return r>=s.getDate()?s:(o.setFullYear(s.getFullYear(),s.getMonth(),r),o)}let $t={};function St(){return $t}function Dt(t,e){const i=St(),o=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,r=xt(t,e?.in),s=r.getDay(),n=(s<o?7:0)+s-o;return r.setDate(r.getDate()-n),r.setHours(0,0,0,0),r}function Et(t,e){return Dt(t,{...e,weekStartsOn:1})}function Ot(t,e){const i=xt(t,e?.in),o=i.getFullYear(),r=wt(i,0);r.setFullYear(o+1,0,4),r.setHours(0,0,0,0);const s=Et(r),n=wt(i,0);n.setFullYear(o,0,4),n.setHours(0,0,0,0);const a=Et(n);return i.getTime()>=s.getTime()?o+1:i.getTime()>=a.getTime()?o:o-1}function Ct(t){const e=xt(t),i=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return i.setUTCFullYear(e.getFullYear()),+t-+i}function Ft(t,...e){const i=wt.bind(null,e.find((t=>"object"==typeof t)));return e.map(i)}function Mt(t,e){const i=xt(t,e?.in);return i.setHours(0,0,0,0),i}function Lt(t,e,i){return kt(t,12*e,i)}function Bt(t){return!(!((e=t)instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))&&"number"!=typeof t||isNaN(+xt(t)));var e}function Tt(t,e){const i=xt(t,e?.in);return i.setDate(1),i.setHours(0,0,0,0),i}const Pt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function jt(t){return(e={})=>{const i=e.width?String(e.width):t.defaultWidth;return t.formats[i]||t.formats[t.defaultWidth]}}const Rt={date:jt({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:jt({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:jt({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},At={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Wt(t){return(e,i)=>{let o;if("formatting"===(i?.context?String(i.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,r=i?.width?String(i.width):e;o=t.formattingValues[r]||t.formattingValues[e]}else{const e=t.defaultWidth,r=i?.width?String(i.width):t.defaultWidth;o=t.values[r]||t.values[e]}return o[t.argumentCallback?t.argumentCallback(e):e]}}function Nt(t){return(e,i={})=>{const o=i.width,r=o&&t.matchPatterns[o]||t.matchPatterns[t.defaultMatchWidth],s=e.match(r);if(!s)return null;const n=s[0],a=o&&t.parsePatterns[o]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?function(t,e){for(let i=0;i<t.length;i++)if(e(t[i]))return i;return}(a,(t=>t.test(n))):function(t,e){for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&e(t[i]))return i;return}(a,(t=>t.test(n)));let d;d=t.valueCallback?t.valueCallback(l):l,d=i.valueCallback?i.valueCallback(d):d;return{value:d,rest:e.slice(n.length)}}}var zt;const _t={code:"en-US",formatDistance:(t,e,i)=>{let o;const r=Pt[t];return o="string"==typeof r?r:1===e?r.one:r.other.replace("{{count}}",e.toString()),i?.addSuffix?i.comparison&&i.comparison>0?"in "+o:o+" ago":o},formatLong:Rt,formatRelative:(t,e,i,o)=>At[t],localize:{ordinalNumber:(t,e)=>{const i=Number(t),o=i%100;if(o>20||o<10)switch(o%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:Wt({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Wt({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:Wt({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Wt({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Wt({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(zt={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const i=t.match(zt.matchPattern);if(!i)return null;const o=i[0],r=t.match(zt.parsePattern);if(!r)return null;let s=zt.valueCallback?zt.valueCallback(r[0]):r[0];return s=e.valueCallback?e.valueCallback(s):s,{value:s,rest:t.slice(o.length)}}),era:Nt({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Nt({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:Nt({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Nt({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Nt({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function It(t,e){const i=xt(t,e?.in),o=function(t,e){const[i,o]=Ft(0,t,e),r=Mt(i),s=Mt(o),n=+r-Ct(r),a=+s-Ct(s);return Math.round((n-a)/864e5)}(i,function(t,e){const i=xt(t,e?.in);return i.setFullYear(i.getFullYear(),0,1),i.setHours(0,0,0,0),i}(i));return o+1}function qt(t,e){const i=xt(t,e?.in),o=+Et(i)-+function(t,e){const i=Ot(t,e),o=wt(t,0);return o.setFullYear(i,0,4),o.setHours(0,0,0,0),Et(o)}(i);return Math.round(o/ft)+1}function Vt(t,e){const i=xt(t,e?.in),o=i.getFullYear(),r=St(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,n=wt(e?.in||t,0);n.setFullYear(o+1,0,s),n.setHours(0,0,0,0);const a=Dt(n,e),l=wt(e?.in||t,0);l.setFullYear(o,0,s),l.setHours(0,0,0,0);const d=Dt(l,e);return+i>=+a?o+1:+i>=+d?o:o-1}function Ut(t,e){const i=xt(t,e?.in),o=+Dt(i,e)-+function(t,e){const i=St(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,r=Vt(t,e),s=wt(e?.in||t,0);return s.setFullYear(r,0,o),s.setHours(0,0,0,0),Dt(s,e)}(i,e);return Math.round(o/ft)+1}function Ht(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const Yt={y(t,e){const i=t.getFullYear(),o=i>0?i:1-i;return Ht("yy"===e?o%100:o,e.length)},M(t,e){const i=t.getMonth();return"M"===e?String(i+1):Ht(i+1,2)},d:(t,e)=>Ht(t.getDate(),e.length),a(t,e){const i=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.toUpperCase();case"aaa":return i;case"aaaaa":return i[0];default:return"am"===i?"a.m.":"p.m."}},h:(t,e)=>Ht(t.getHours()%12||12,e.length),H:(t,e)=>Ht(t.getHours(),e.length),m:(t,e)=>Ht(t.getMinutes(),e.length),s:(t,e)=>Ht(t.getSeconds(),e.length),S(t,e){const i=e.length,o=t.getMilliseconds();return Ht(Math.trunc(o*Math.pow(10,i-3)),e.length)}},Gt="midnight",Kt="noon",Xt="morning",Qt="afternoon",Jt="evening",Zt="night",te={G:function(t,e,i){const o=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(o,{width:"abbreviated"});case"GGGGG":return i.era(o,{width:"narrow"});default:return i.era(o,{width:"wide"})}},y:function(t,e,i){if("yo"===e){const e=t.getFullYear(),o=e>0?e:1-e;return i.ordinalNumber(o,{unit:"year"})}return Yt.y(t,e)},Y:function(t,e,i,o){const r=Vt(t,o),s=r>0?r:1-r;if("YY"===e){return Ht(s%100,2)}return"Yo"===e?i.ordinalNumber(s,{unit:"year"}):Ht(s,e.length)},R:function(t,e){return Ht(Ot(t),e.length)},u:function(t,e){return Ht(t.getFullYear(),e.length)},Q:function(t,e,i){const o=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(o);case"QQ":return Ht(o,2);case"Qo":return i.ordinalNumber(o,{unit:"quarter"});case"QQQ":return i.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(o,{width:"narrow",context:"formatting"});default:return i.quarter(o,{width:"wide",context:"formatting"})}},q:function(t,e,i){const o=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(o);case"qq":return Ht(o,2);case"qo":return i.ordinalNumber(o,{unit:"quarter"});case"qqq":return i.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(o,{width:"narrow",context:"standalone"});default:return i.quarter(o,{width:"wide",context:"standalone"})}},M:function(t,e,i){const o=t.getMonth();switch(e){case"M":case"MM":return Yt.M(t,e);case"Mo":return i.ordinalNumber(o+1,{unit:"month"});case"MMM":return i.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(o,{width:"narrow",context:"formatting"});default:return i.month(o,{width:"wide",context:"formatting"})}},L:function(t,e,i){const o=t.getMonth();switch(e){case"L":return String(o+1);case"LL":return Ht(o+1,2);case"Lo":return i.ordinalNumber(o+1,{unit:"month"});case"LLL":return i.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(o,{width:"narrow",context:"standalone"});default:return i.month(o,{width:"wide",context:"standalone"})}},w:function(t,e,i,o){const r=Ut(t,o);return"wo"===e?i.ordinalNumber(r,{unit:"week"}):Ht(r,e.length)},I:function(t,e,i){const o=qt(t);return"Io"===e?i.ordinalNumber(o,{unit:"week"}):Ht(o,e.length)},d:function(t,e,i){return"do"===e?i.ordinalNumber(t.getDate(),{unit:"date"}):Yt.d(t,e)},D:function(t,e,i){const o=It(t);return"Do"===e?i.ordinalNumber(o,{unit:"dayOfYear"}):Ht(o,e.length)},E:function(t,e,i){const o=t.getDay();switch(e){case"E":case"EE":case"EEE":return i.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(o,{width:"short",context:"formatting"});default:return i.day(o,{width:"wide",context:"formatting"})}},e:function(t,e,i,o){const r=t.getDay(),s=(r-o.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return Ht(s,2);case"eo":return i.ordinalNumber(s,{unit:"day"});case"eee":return i.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(r,{width:"short",context:"formatting"});default:return i.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,i,o){const r=t.getDay(),s=(r-o.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return Ht(s,e.length);case"co":return i.ordinalNumber(s,{unit:"day"});case"ccc":return i.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(r,{width:"narrow",context:"standalone"});case"cccccc":return i.day(r,{width:"short",context:"standalone"});default:return i.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,i){const o=t.getDay(),r=0===o?7:o;switch(e){case"i":return String(r);case"ii":return Ht(r,e.length);case"io":return i.ordinalNumber(r,{unit:"day"});case"iii":return i.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(o,{width:"short",context:"formatting"});default:return i.day(o,{width:"wide",context:"formatting"})}},a:function(t,e,i){const o=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(o,{width:"narrow",context:"formatting"});default:return i.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(t,e,i){const o=t.getHours();let r;switch(r=12===o?Kt:0===o?Gt:o/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(r,{width:"narrow",context:"formatting"});default:return i.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,i){const o=t.getHours();let r;switch(r=o>=17?Jt:o>=12?Qt:o>=4?Xt:Zt,e){case"B":case"BB":case"BBB":return i.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(r,{width:"narrow",context:"formatting"});default:return i.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,i){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),i.ordinalNumber(e,{unit:"hour"})}return Yt.h(t,e)},H:function(t,e,i){return"Ho"===e?i.ordinalNumber(t.getHours(),{unit:"hour"}):Yt.H(t,e)},K:function(t,e,i){const o=t.getHours()%12;return"Ko"===e?i.ordinalNumber(o,{unit:"hour"}):Ht(o,e.length)},k:function(t,e,i){let o=t.getHours();return 0===o&&(o=24),"ko"===e?i.ordinalNumber(o,{unit:"hour"}):Ht(o,e.length)},m:function(t,e,i){return"mo"===e?i.ordinalNumber(t.getMinutes(),{unit:"minute"}):Yt.m(t,e)},s:function(t,e,i){return"so"===e?i.ordinalNumber(t.getSeconds(),{unit:"second"}):Yt.s(t,e)},S:function(t,e){return Yt.S(t,e)},X:function(t,e,i){const o=t.getTimezoneOffset();if(0===o)return"Z";switch(e){case"X":return ie(o);case"XXXX":case"XX":return oe(o);default:return oe(o,":")}},x:function(t,e,i){const o=t.getTimezoneOffset();switch(e){case"x":return ie(o);case"xxxx":case"xx":return oe(o);default:return oe(o,":")}},O:function(t,e,i){const o=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ee(o,":");default:return"GMT"+oe(o,":")}},z:function(t,e,i){const o=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ee(o,":");default:return"GMT"+oe(o,":")}},t:function(t,e,i){return Ht(Math.trunc(+t/1e3),e.length)},T:function(t,e,i){return Ht(+t,e.length)}};function ee(t,e=""){const i=t>0?"-":"+",o=Math.abs(t),r=Math.trunc(o/60),s=o%60;return 0===s?i+String(r):i+String(r)+e+Ht(s,2)}function ie(t,e){if(t%60==0){return(t>0?"-":"+")+Ht(Math.abs(t)/60,2)}return oe(t,e)}function oe(t,e=""){const i=t>0?"-":"+",o=Math.abs(t);return i+Ht(Math.trunc(o/60),2)+e+Ht(o%60,2)}const re=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},se=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},ne={p:se,P:(t,e)=>{const i=t.match(/(P+)(p+)?/)||[],o=i[1],r=i[2];if(!r)return re(t,e);let s;switch(o){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;default:s=e.dateTime({width:"full"})}return s.replace("{{date}}",re(o,e)).replace("{{time}}",se(r,e))}},ae=/^D+$/,le=/^Y+$/,de=["D","DD","YY","YYYY"];const ce=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,he=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,pe=/^'([^]*?)'?$/,ue=/''/g,ge=/[a-zA-Z]/;function be(t,e,i){const o=St(),r=o.locale??_t,s=o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,n=o.weekStartsOn??o.locale?.options?.weekStartsOn??0,a=xt(t,i?.in);if(!Bt(a))throw new RangeError("Invalid time value");let l=e.match(he).map((t=>{const e=t[0];if("p"===e||"P"===e){return(0,ne[e])(t,r.formatLong)}return t})).join("").match(ce).map((t=>{if("''"===t)return{isToken:!1,value:"'"};const e=t[0];if("'"===e)return{isToken:!1,value:me(t)};if(te[e])return{isToken:!0,value:t};if(e.match(ge))throw new RangeError("Format string contains an unescaped latin alphabet character `"+e+"`");return{isToken:!1,value:t}}));r.localize.preprocessor&&(l=r.localize.preprocessor(a,l));const d={firstWeekContainsDate:s,weekStartsOn:n,locale:r};return l.map((i=>{if(!i.isToken)return i.value;const o=i.value;(function(t){return le.test(t)}(o)||function(t){return ae.test(t)}(o))&&function(t,e,i){const o=function(t,e,i){const o="Y"===t[0]?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${o} to the input \`${i}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(t,e,i);if(console.warn(o),de.includes(t))throw new RangeError(o)}(o,e,String(t));return(0,te[o[0]])(a,o,r.localize,d)})).join("")}function me(t){const e=t.match(pe);return e?e[1].replace(ue,"'"):t}function ye(t,e){return xt(t,e?.in).getDate()}function fe(t,e){const i=xt(t,e?.in),o=i.getFullYear(),r=i.getMonth(),s=wt(i,0);return s.setFullYear(o,r+1,0),s.setHours(0,0,0,0),s.getDate()}function ve(t,e){return+xt(t)>+xt(e)}function we(t,e){return+xt(t)<+xt(e)}function xe(t,e,i){const[o,r]=Ft(0,t,e);return o.getFullYear()===r.getFullYear()&&o.getMonth()===r.getMonth()}function ke(t,e,i){const[o,r]=Ft(0,t,e);return o.getFullYear()===r.getFullYear()}function $e(t,e){return function(t,e){const[i,o]=Ft(0,t,e);return+Mt(i)===+Mt(o)}(wt(t,t),function(t){return wt(t,Date.now())}(t))}function Se(t,e,i){const o=xt(t,i?.in);return o.setDate(e),o}let De=class extends t{constructor(){super(...arguments),this.selectedDate=null,this.viewDate=new Date,this.isMobile=!1,this.calendarWidth=0,this.minDate=null,this.maxDate=null,this.type="date",this.currentView="days",this.handleOutsideClick=t=>{const e=this.getRootNode(),i=e?.host;!i||t.composedPath().includes(this)||t.composedPath().includes(i)||this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}static{this.styles=[Z,o`
|
|
3089
3096
|
${X}
|
|
3090
3097
|
|
|
3091
3098
|
/* Estilos generales del contenedor del calendario (escritorio) */
|
|
@@ -3557,7 +3564,7 @@ function P(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
3557
3564
|
</button>
|
|
3558
3565
|
`}))}
|
|
3559
3566
|
</div>
|
|
3560
|
-
`}renderDayView(){const t=fe(this.viewDate),i=Tt(this.viewDate),o=xt(i,r?.in).getDay();var r;const s=Array.from({length:0===o?6:o-1},(()=>null)),n=Array.from({length:t},((t,e)=>
|
|
3567
|
+
`}renderDayView(){const t=fe(this.viewDate),i=Tt(this.viewDate),o=xt(i,r?.in).getDay();var r;const s=Array.from({length:0===o?6:o-1},(()=>null)),n=Array.from({length:t},((t,e)=>Se(i,e+1))),a=this.getShortWeekdays();return e`
|
|
3561
3568
|
<div class="weekdays">
|
|
3562
3569
|
${a.map((t=>e`<div>${t}</div>`))}
|
|
3563
3570
|
</div>
|
|
@@ -3588,7 +3595,7 @@ function P(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
3588
3595
|
<div class="calendar-container" style="width: ${this.calendarWidth}px;">
|
|
3589
3596
|
${r}
|
|
3590
3597
|
</div>
|
|
3591
|
-
`}};s([B({type:Object}),n("design:type",Object)],
|
|
3598
|
+
`}};s([B({type:Object}),n("design:type",Object)],De.prototype,"selectedDate",void 0),s([B({type:Object}),n("design:type",Date)],De.prototype,"viewDate",void 0),s([B({type:Boolean}),n("design:type",Object)],De.prototype,"isMobile",void 0),s([B({type:Number}),n("design:type",Number)],De.prototype,"calendarWidth",void 0),s([B({type:Object}),n("design:type",Object)],De.prototype,"minDate",void 0),s([B({type:Object}),n("design:type",Object)],De.prototype,"maxDate",void 0),s([B({type:String}),n("design:type",String)],De.prototype,"type",void 0),s([T(),n("design:type",String)],De.prototype,"currentView",void 0),s([P(".day.selected, .day.today:not(.selected)"),n("design:type",HTMLButtonElement)],De.prototype,"initialFocusElement",void 0),De=s([a("calendar-overlay")],De);let Ee=class extends j{constructor(){super(...arguments),this.isRenderClearButton=!0,this.readonly=!1,this.type="date",this.eighteenOrOlder=!1,this.maxLength=10,this.isOpen=!1,this.selectedDate=null,this.viewDate=new Date,this.isMobile=!1,this.calendarWidth=0,this.inputValue=null,this.updateResponsiveModeBound=this.updateResponsiveMode.bind(this),this.handleClickOutside=t=>{t.composedPath().includes(this)||(this.isOpen&&this._emitToggle(!1),this.isOpen=!1)}}static{this.styles=o`
|
|
3592
3599
|
${Q}
|
|
3593
3600
|
${J}
|
|
3594
3601
|
${K}
|
|
@@ -3715,7 +3722,7 @@ function P(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
3715
3722
|
.calendar-button randstad-icon {
|
|
3716
3723
|
font-size: 18px;
|
|
3717
3724
|
}
|
|
3718
|
-
`}setMessageErrorFormatInvalid(){return`formato de fecha inválido, se esperaba '${"month"===this.type?"MM-yyyy":"dd-MM-yyyy"}'`}get _currentFormat(){return"month"===this.type?"MM-yyyy":"dd-MM-yyyy"}handleFocusInput(){this.shadowRoot?.querySelector(".date-input")?.focus()}connectedCallback(){super.connectedCallback(),this.updateResponsiveMode(),window.addEventListener("resize",this.updateResponsiveModeBound),document.addEventListener("click",this.handleClickOutside),this.addEventListener("focus-input",this.handleFocusInput)}disconnectedCallback(){window.removeEventListener("resize",this.updateResponsiveModeBound),document.removeEventListener("click",this.handleClickOutside),this.removeEventListener("focus-input",this.handleFocusInput),super.disconnectedCallback()}firstUpdated(){this.setInitialWidth()}
|
|
3725
|
+
`}setMessageErrorFormatInvalid(){return`formato de fecha inválido, se esperaba '${"month"===this.type?"MM-yyyy":"dd-MM-yyyy"}'`}get _currentFormat(){return"month"===this.type?"MM-yyyy":"dd-MM-yyyy"}handleFocusInput(){this.shadowRoot?.querySelector(".date-input")?.focus()}connectedCallback(){super.connectedCallback(),this.updateResponsiveMode(),window.addEventListener("resize",this.updateResponsiveModeBound),document.addEventListener("click",this.handleClickOutside),this.addEventListener("focus-input",this.handleFocusInput)}disconnectedCallback(){window.removeEventListener("resize",this.updateResponsiveModeBound),document.removeEventListener("click",this.handleClickOutside),this.removeEventListener("focus-input",this.handleFocusInput),super.disconnectedCallback()}firstUpdated(){this.setInitialWidth()}setInitialWidth(){if(!this.inputContainer)return;const t=this.inputContainer.getBoundingClientRect().width;this.calendarWidth!==t&&(this.calendarWidth=t)}updateResponsiveMode(){this.isMobile=window.innerWidth<=940,this.setInitialWidth()}handleInput(t){this.onlyNumericAndDash(t);const e=t.target,i=e.value.substring(0,this.maxLength);e.value!==i&&(e.value=i),this.inputValue=e.value,this._parseAndValidateDate(e.value,!0)}handleCalendarButtonClick(t){if(!this.disabled)if(t.stopPropagation(),this.isOpen){this.isOpen=!1,this._emitToggle(!1);const t=this.shadowRoot?.querySelector(".date-input");t?.focus()}else this.isOpen=!0,this._emitToggle(!0),this.selectedDate?this.viewDate=this.selectedDate:this.viewDate=new Date,this.requestUpdate(),this.updateComplete.then((()=>{const t=this.shadowRoot?.querySelector(".date-input");t?.focus()}))}handleClearDate(){this.inputValue=null,this.selectedDate=null,this.error=!1,this.errorMessage=null,this.closeOverlay(null)}handleDateSelect(t){let e=t.detail.date;if(!e)return;"month"===this.type&&(e=Se(e,1));if(this._validateDate(e)){this.selectedDate=e,this.viewDate=e;const t=be(e,this._currentFormat);this.inputValue=t.replace(/-/g,"/"),this.closeOverlay(t)}else{const t=be(e,this._currentFormat);this.inputValue=t.replace(/-/g,"/"),this.selectedDate=null,this.closeOverlay(null)}}_emitToggle(t){this.dispatchEvent(new CustomEvent("calendar-toggle",{detail:{open:t},bubbles:!0,composed:!0}))}willUpdate(t){if(t.has("width")&&this.style.setProperty("width",this.width||"100%"),t.has("value")){const e=t.get("value");this.value!==e&&this._syncValue(this.value)}t.has("type")&&("month"===this.type?this.maxLength=7:this.maxLength=10)}updated(t){(t.has("isOpen")||t.has("value"))&&this.isOpen&&this.updateComplete.then((()=>{this.setInitialWidth()})),super.updated(t)}handleViewDateChange(t){this.viewDate=t.detail.date}closeOverlay(t){this.value=t,this.inputValue=t?t.replace(/-/g,"/"):null,this.dispatchEvent(new CustomEvent("date-selected",{detail:{value:t}})),this.isOpen=!1,this._emitToggle(!1);const e=this.shadowRoot?.querySelector(".date-input");e?.focus()}_syncValue(t){if(""===t||null===t)return void(null===this.selectedDate&&null===this.inputValue||(this.selectedDate=null,this.inputValue=null,this.errorMessage=null,this.error=!1));let e=this._parseDate(t);e&&this._validateDate(e)?("month"===this.type&&(e=Se(e,1)),this.selectedDate=e,this.viewDate=e,this.error=!1,this.errorMessage=null,this.inputValue=be(e,this._currentFormat).replace(/-/g,"/")):this.selectedDate=e}_validateDate(t){if(!t)return!1;if(this.error=!1,this.errorMessage=null,this.eighteenOrOlder){const e=function(t,e,i){return Lt(t,-18,i)}(new Date);if(ve(t,e))return this.error=!0,this.errorMessage="tenés que ser mayor de 18 años",!1}if(!this._isWithinBounds(t)){const t=this._getValidDateRange();return this.error=!0,this.errorMessage=`la fecha debe estar entre ${t?.minDate?be(t.minDate,"dd-MM-yyyy"):""} y ${t?.maxDate?be(t.maxDate,"dd-MM-yyyy"):""}.`,!1}return!0}_parseAndValidateDate(t,e){if(this.disabled)return;if(""===t||null===t)return this.selectedDate=null,this.error=!1,this.errorMessage=null,void(e&&this.closeOverlay(null));const i=this._parseDate(t);if(i){this._validateDate(i)?(this.selectedDate=i,this.viewDate=i,this.error=!1,this.errorMessage=null,e&&this.closeOverlay(be(i,this._currentFormat))):(this.error=!0,this.selectedDate=null,e&&this.closeOverlay(null))}else this.error=!0,this.errorMessage=this.setMessageErrorFormatInvalid(),this.selectedDate=null,e&&this.closeOverlay(null)}_parseDate(t){const e=t.split("-").map(Number);if("month"===this.type&&2===e.length){const[t,i]=e;if(t>=1&&t<=12&&i>1e3){const e=new Date(i,t-1,1,12);if(Bt(e))return e}return null}if(3===e.length){const[i,o,r]=e;if(i&&o&&r&&o>=1&&o<=12&&r>1e3){const e=new Date(r,o-1,i,12);if(Bt(e)&&be(e,"dd-MM-yyyy")===t)return e}}const i=t.split("-").map(Number);if(3===i.length){const[e,o,r]=i;if(e&&o&&r&&o>=1&&o<=12&&e>1e3){const i=new Date(e,o-1,r,12);if(Bt(i)&&be(i,"yyyy-MM-dd")===t)return i}}return null}_parseDateString(t){if(!t)return null;const e=t.split("-").map(Number);if(3===e.length&&!isNaN(e[0])&&!isNaN(e[1])&&!isNaN(e[2])){return new Date(e[0],e[1]-1,e[2],12)}return null}_getValidDateRange(){const t=this._parseDateString(this.minDate),e=this._parseDateString(this.maxDate);return t||e?t&&e&&ve(t,e)?null:{minDate:t,maxDate:e}:{minDate:null,maxDate:null}}_isWithinBounds(t){const e=this._getValidDateRange();return!e||(!e.minDate||!we(t,e.minDate))&&(!e.maxDate||!ve(t,e.maxDate))}handleKeyDown(t){if(this.disabled)return;const{key:e}=t,i=this.shadowRoot?.querySelector(".date-input");if("Enter"===e||" "===e)t.preventDefault(),this.isOpen?this.closeOverlay(this.value):(this.isOpen=!0,this.selectedDate?this.viewDate=this.selectedDate:this.viewDate=new Date,this.requestUpdate());else if("Escape"===e){if(!this.isOpen)return;t.preventDefault(),this.closeOverlay(this.value)}else"ArrowDown"===e&&(t.preventDefault(),this.isOpen||(this.isOpen=!0,this.selectedDate?this.viewDate=this.selectedDate:this.viewDate=new Date,this.requestUpdate()),this.updateComplete.then((()=>{const t=this.shadowRoot?.querySelector("calendar-overlay");t&&"function"==typeof t.focusCalendar&&t.focusCalendar()})));const o=this.shadowRoot?.querySelector(".clear-button"),r=this.shadowRoot?.querySelector(".calendar-button");"ArrowRight"===e&&(t.preventDefault(),this.shadowRoot?.activeElement===i&&(o?o.focus():r?.focus()))}handleClearButtonKeydown(t){if(this.disabled)return;const{key:e}=t,i=this.shadowRoot?.querySelector(".date-input"),o=this.shadowRoot?.querySelector(".calendar-button");"ArrowLeft"===e?(t.preventDefault(),i?.focus()):"ArrowRight"===e&&(t.preventDefault(),o?.focus())}handleCalendarButtonKeydown(t){if(this.disabled)return;const{key:e}=t,i=this.shadowRoot?.querySelector(".date-input"),o=this.shadowRoot?.querySelector(".clear-button");"ArrowLeft"===e?(t.preventDefault(),o?o.focus():i?.focus()):("Enter"!==e&&" "!==e||t.preventDefault(),this.handleCalendarButtonClick(t))}onlyNumericAndDash(t){const e=t.target,i=e.value.replace(/[^0-9-]/g,"");e.value=i}render(){const t=r({"input-wrapper":!0,active:this.isOpen,error:this.error,disabled:this.disabled,readonly:this.readonly}),o=this._getValidDateRange();return e`
|
|
3719
3726
|
<div class="datepicker-container" style="${this.labelColor?` --label-color: ${this.labelColor}`:""}">
|
|
3720
3727
|
${this.renderLabelContainer()}
|
|
3721
3728
|
|
|
@@ -3774,7 +3781,7 @@ function P(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
3774
3781
|
|
|
3775
3782
|
${this.renderHelper()}
|
|
3776
3783
|
</div>
|
|
3777
|
-
`}};s([B({type:String}),n("design:type",String)],
|
|
3784
|
+
`}};s([B({type:String}),n("design:type",String)],Ee.prototype,"width",void 0),s([B({type:Boolean}),n("design:type",Object)],Ee.prototype,"isRenderClearButton",void 0),s([B({type:Boolean}),n("design:type",Object)],Ee.prototype,"readonly",void 0),s([B({type:String}),n("design:type",String)],Ee.prototype,"minDate",void 0),s([B({type:String}),n("design:type",String)],Ee.prototype,"maxDate",void 0),s([B({type:String}),n("design:type",String)],Ee.prototype,"type",void 0),s([B({type:Boolean}),n("design:type",Object)],Ee.prototype,"eighteenOrOlder",void 0),s([B({type:Number}),n("design:type",Number)],Ee.prototype,"maxLength",void 0),s([T(),n("design:type",Object)],Ee.prototype,"isOpen",void 0),s([T(),n("design:type",Object)],Ee.prototype,"selectedDate",void 0),s([T(),n("design:type",Date)],Ee.prototype,"viewDate",void 0),s([T(),n("design:type",Object)],Ee.prototype,"isMobile",void 0),s([T(),n("design:type",Number)],Ee.prototype,"calendarWidth",void 0),s([T(),n("design:type",Object)],Ee.prototype,"inputValue",void 0),s([P(".input-container"),n("design:type",HTMLDivElement)],Ee.prototype,"inputContainer",void 0),Ee=s([a("datepicker-component")],Ee);let Oe=class extends ut{constructor(){super(...arguments),this.maxFiles=1,this.acceptedFileTypes=[],this.maxFileSize=0,this.buttonText="Agregar archivo",this.showDeleteConfirmation=!1,this.showInternalError=!0,this.isRemovePopupOpen=!1,this.fileIndexToRemove=-1,this.fileNameToRemove=""}static{this.styles=o`
|
|
3778
3785
|
${Q}
|
|
3779
3786
|
${J}
|
|
3780
3787
|
${K}
|
|
@@ -3901,7 +3908,7 @@ function P(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
3901
3908
|
</custom-popup>
|
|
3902
3909
|
`:i}
|
|
3903
3910
|
</div>
|
|
3904
|
-
`}};s([B({type:String}),n("design:type",String)],
|
|
3911
|
+
`}};s([B({type:String}),n("design:type",String)],Oe.prototype,"width",void 0),s([B({type:Number}),n("design:type",Object)],Oe.prototype,"maxFiles",void 0),s([B({type:Array}),n("design:type",Array)],Oe.prototype,"acceptedFileTypes",void 0),s([B({type:Number}),n("design:type",Object)],Oe.prototype,"maxFileSize",void 0),s([B({type:String}),n("design:type",Object)],Oe.prototype,"buttonText",void 0),s([B({type:Boolean}),n("design:type",Object)],Oe.prototype,"showDeleteConfirmation",void 0),s([B({type:Boolean}),n("design:type",Object)],Oe.prototype,"showInternalError",void 0),s([T(),n("design:type",Boolean)],Oe.prototype,"isRemovePopupOpen",void 0),s([T(),n("design:type",Number)],Oe.prototype,"fileIndexToRemove",void 0),s([T(),n("design:type",String)],Oe.prototype,"fileNameToRemove",void 0),Oe=s([a("upload-file")],Oe);let Ce=class extends t{constructor(){super(),this.cards=[],this.cardWidth="",this.cardHeight="",this.navWidth=112,this.showNavButtons=!0,this.isDynamicWidth=!0,this.isInfiniteScrollPartial=!0,this.autoPlayDelayMs=0,this.showPrevButton=!1,this.showNextButton=!0,this.isDraggingWithButtons=!1,this.isDownWithButtons=!1,this.startXWithButtons=0,this.scrollLeftPositionWithButtons=0,this.isScrollingByButton=!1,this.isDownDrag=!1,this.prevXDrag=0,this.isDraggingDrag=!1,this.scrollLeftDrag=0,this.observer=null,this.scrollTimeout=null,this.autoPlayTimer=null,this.handleResize=()=>{},this.DESKTOP_GAP=40,this.TABLET_GAP=24,this.MOBILE_GAP=24,this.handleMouseDownWithButtons=this.handleMouseDownWithButtons.bind(this),this.handleMouseLeaveWithButtons=this.handleMouseLeaveWithButtons.bind(this),this.handleMouseUpWithButtons=this.handleMouseUpWithButtons.bind(this),this.handleMouseMoveWithButtons=this.handleMouseMoveWithButtons.bind(this),this.handleScrollWithButtons=this.handleScrollWithButtons.bind(this),this.handleMouseDownDrag=this.handleMouseDownDrag.bind(this),this.handleMouseLeaveDrag=this.handleMouseLeaveDrag.bind(this),this.handleMouseUpDrag=this.handleMouseUpDrag.bind(this),this.handleMouseMoveDrag=this.handleMouseMoveDrag.bind(this),this.handleResize=this.resizeHandler.bind(this)}static{this.styles=o`
|
|
3905
3912
|
:host {
|
|
3906
3913
|
display: block;
|
|
3907
3914
|
width: 100%;
|
|
@@ -4221,5 +4228,5 @@ function P(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
4221
4228
|
|
|
4222
4229
|
${this.renderNavButtons()}
|
|
4223
4230
|
</div>
|
|
4224
|
-
`}};s([B({type:Array}),n("design:type",Array)],Ce.prototype,"cards",void 0),s([B({type:String}),n("design:type",String)],Ce.prototype,"cardWidth",void 0),s([B({type:String}),n("design:type",String)],Ce.prototype,"cardHeight",void 0),s([B({type:Number}),n("design:type",Number)],Ce.prototype,"navWidth",void 0),s([B({type:Boolean}),n("design:type",Boolean)],Ce.prototype,"showNavButtons",void 0),s([B({type:Boolean}),n("design:type",Boolean)],Ce.prototype,"isDynamicWidth",void 0),s([B({type:Boolean}),n("design:type",Boolean)],Ce.prototype,"isInfiniteScrollPartial",void 0),s([B({type:Number}),n("design:type",Number)],Ce.prototype,"autoPlayDelayMs",void 0),s([T(),n("design:type",Object)],Ce.prototype,"showPrevButton",void 0),s([T(),n("design:type",Object)],Ce.prototype,"showNextButton",void 0),s([P(".carousel-wrapper"),n("design:type",HTMLElement)],Ce.prototype,"slider",void 0),s([P("slot"),n("design:type",HTMLSlotElement)],Ce.prototype,"slotElement",void 0),Ce=s([a("carousel-component"),n("design:paramtypes",[])],Ce);export{U as AccordionList,V as AccordionPanel,j as BaseControl,
|
|
4231
|
+
`}};s([B({type:Array}),n("design:type",Array)],Ce.prototype,"cards",void 0),s([B({type:String}),n("design:type",String)],Ce.prototype,"cardWidth",void 0),s([B({type:String}),n("design:type",String)],Ce.prototype,"cardHeight",void 0),s([B({type:Number}),n("design:type",Number)],Ce.prototype,"navWidth",void 0),s([B({type:Boolean}),n("design:type",Boolean)],Ce.prototype,"showNavButtons",void 0),s([B({type:Boolean}),n("design:type",Boolean)],Ce.prototype,"isDynamicWidth",void 0),s([B({type:Boolean}),n("design:type",Boolean)],Ce.prototype,"isInfiniteScrollPartial",void 0),s([B({type:Number}),n("design:type",Number)],Ce.prototype,"autoPlayDelayMs",void 0),s([T(),n("design:type",Object)],Ce.prototype,"showPrevButton",void 0),s([T(),n("design:type",Object)],Ce.prototype,"showNextButton",void 0),s([P(".carousel-wrapper"),n("design:type",HTMLElement)],Ce.prototype,"slider",void 0),s([P("slot"),n("design:type",HTMLSlotElement)],Ce.prototype,"slotElement",void 0),Ce=s([a("carousel-component"),n("design:paramtypes",[])],Ce);export{U as AccordionList,V as AccordionPanel,j as BaseControl,De as CalendarOverlay,Ce as Carousel,Y as CarouselCard,G as Checkbox,rt as CustomModal,st as CustomPopup,at as CustomRadio,ht as CustomStepper,Ee as DatePickerComponent,lt as FilterableSelect,et as FormGroup,it as IconComponent,nt as ProgressCircle,H as RandstadButton,tt as RandstadForm,ot as RandstadNotice,pt as TabsBar,Oe as UploadFile,yt as UploadImage,Z as scrollbarStyles};
|
|
4225
4232
|
//# sourceMappingURL=index.js.map
|