@randstad-uca/design-system 1.0.50 → 1.0.52
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/Button.d.ts +2 -2
- package/dist/components/File.d.ts +3 -0
- package/dist/components/FormGroup.d.ts +1 -0
- package/dist/components/Modal.d.ts +2 -0
- package/dist/index.js +160 -63
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/stories/DatePicker.stories.d.ts +4 -0
- package/dist/stories/FormGroup.stories.d.ts +71 -0
- package/dist/stories/Modal.stories.d.ts +3 -3
- package/dist/stories/UploadFile.stories.d.ts +11 -0
- package/dist/styles/progress-bar-upload.d.ts +1 -0
- package/dist/styles/progress-bar-upload.ts +23 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -204,7 +204,7 @@ function A(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
204
204
|
flex-direction: column;
|
|
205
205
|
gap: 16px;
|
|
206
206
|
}
|
|
207
|
-
`}render(){return e`<slot></slot>`}};Y=a([d("accordion-list")],Y);let U=class extends t{constructor(){super(...arguments),this.variant="button-primary",this.size="md",this.label="",this.loader=!1,this.iconPosition="left",this.
|
|
207
|
+
`}render(){return e`<slot></slot>`}};Y=a([d("accordion-list")],Y);let U=class extends t{constructor(){super(...arguments),this.type="button",this.variant="button-primary",this.size="md",this.label="",this.loader=!1,this.iconPosition="left",this.iconName=null,this.disabled=!1,this.idevent=""}static{this.styles=o`
|
|
208
208
|
:host {
|
|
209
209
|
display: inline-block;
|
|
210
210
|
}
|
|
@@ -216,11 +216,30 @@ function A(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
216
216
|
border-radius: 4px;
|
|
217
217
|
cursor: pointer;
|
|
218
218
|
font-weight: 400;
|
|
219
|
-
padding:
|
|
219
|
+
padding: 0;
|
|
220
220
|
border: none;
|
|
221
221
|
transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
|
|
222
222
|
gap: 4px;
|
|
223
223
|
width: 100%;
|
|
224
|
+
position: relative;
|
|
225
|
+
box-sizing: border-box;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.content-container {
|
|
229
|
+
display: flex;
|
|
230
|
+
align-items: center;
|
|
231
|
+
justify-content: center;
|
|
232
|
+
gap: 4px;
|
|
233
|
+
width: 100%;
|
|
234
|
+
padding: 16px;
|
|
235
|
+
height: 100%;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.content-container .label-text {
|
|
239
|
+
display: flex;
|
|
240
|
+
align-items: center;
|
|
241
|
+
justify-content: center;
|
|
242
|
+
height: 100%;
|
|
224
243
|
}
|
|
225
244
|
|
|
226
245
|
.button-lg {
|
|
@@ -369,15 +388,17 @@ function A(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
369
388
|
color: var(--secondary-color-60);
|
|
370
389
|
cursor: default;
|
|
371
390
|
}
|
|
372
|
-
|
|
391
|
+
|
|
373
392
|
/* Loader */
|
|
393
|
+
.loader, .label-text, .button-icon {
|
|
394
|
+
line-height: 1;
|
|
395
|
+
}
|
|
396
|
+
|
|
374
397
|
.loader {
|
|
375
398
|
display: flex;
|
|
376
|
-
gap: 8px;
|
|
377
|
-
justify-content: center;
|
|
378
399
|
align-items: center;
|
|
379
|
-
|
|
380
|
-
|
|
400
|
+
justify-content: center;
|
|
401
|
+
gap: 8px;
|
|
381
402
|
}
|
|
382
403
|
|
|
383
404
|
.dot {
|
|
@@ -419,6 +440,33 @@ function A(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
419
440
|
color: var(--white);
|
|
420
441
|
}
|
|
421
442
|
|
|
443
|
+
/* Estilos de sobrescritura para el estado de carga */
|
|
444
|
+
.button-primary.loader[disabled] {
|
|
445
|
+
background-color: var(--primary-color) !important;
|
|
446
|
+
color: var(--white) !important;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.button-secondary.loader[disabled] {
|
|
450
|
+
background-color: var(--primary-color) !important;
|
|
451
|
+
border-color: var(--primary-color) !important;
|
|
452
|
+
color: var(--white) !important;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
.button-tertiary.loader[disabled] {
|
|
456
|
+
color: var(--primary-color) !important;
|
|
457
|
+
background-color: transparent !important;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.button-round.loader[disabled] {
|
|
461
|
+
background-color: var(--white) !important;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
.button-icon.loader[disabled] {
|
|
465
|
+
color: var(--primary-color) !important;
|
|
466
|
+
background-color: transparent !important;
|
|
467
|
+
}
|
|
468
|
+
/* */
|
|
469
|
+
|
|
422
470
|
.button-card {
|
|
423
471
|
font-family: 'Graphik';
|
|
424
472
|
background-color: var(--primary-color);
|
|
@@ -458,24 +506,31 @@ function A(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
458
506
|
part="button"
|
|
459
507
|
type=${this.type}
|
|
460
508
|
class=${n(t)}
|
|
461
|
-
?disabled=${this.disabled}
|
|
509
|
+
?disabled=${this.disabled||this.loader}
|
|
462
510
|
?aria-busy=${this.loader}
|
|
463
511
|
@click=${this.handleClick}
|
|
464
512
|
>
|
|
465
513
|
${this.loader?e`
|
|
514
|
+
<div class="content-container">
|
|
466
515
|
<div class="loader">
|
|
467
516
|
<span class="dot" style="background-color: ${i};"></span>
|
|
468
517
|
<span class="dot" style="background-color: ${i};"></span>
|
|
469
518
|
<span class="dot" style="background-color: ${i};"></span>
|
|
470
519
|
</div>
|
|
520
|
+
</div>
|
|
471
521
|
`:e`
|
|
522
|
+
<div class="content-container">
|
|
472
523
|
${this.iconSrc&&"button-round"===this.variant?e`<img src=${this.iconSrc} alt="icon" class="button-icon" part="button-icon"/>`:""}
|
|
524
|
+
|
|
473
525
|
${this.iconName&&"button-round"!==this.variant&&"left"===this.iconPosition?e`<randstad-icon name=${this.iconName} size="24px"></randstad-icon>`:""}
|
|
474
|
-
|
|
526
|
+
|
|
527
|
+
${this.label?e`<span class="label-text" part="label">${this.label}</span>`:e`<slot></slot>`}
|
|
528
|
+
|
|
475
529
|
${this.iconName&&"button-round"!==this.variant&&"right"===this.iconPosition?e`<randstad-icon name=${this.iconName} size="24px"></randstad-icon>`:""}
|
|
476
|
-
|
|
530
|
+
</div>
|
|
531
|
+
`}
|
|
477
532
|
</button>
|
|
478
|
-
`}};a([T({type:String}),s("design:type",String)],U.prototype,"
|
|
533
|
+
`}};a([T({type:String}),s("design:type",String)],U.prototype,"type",void 0),a([T({type:String}),s("design:type",String)],U.prototype,"variant",void 0),a([T({type:String}),s("design:type",String)],U.prototype,"size",void 0),a([T({type:String}),s("design:type",Object)],U.prototype,"label",void 0),a([T({type:Boolean}),s("design:type",Object)],U.prototype,"loader",void 0),a([T({type:String,attribute:"icon-src"}),s("design:type",String)],U.prototype,"iconSrc",void 0),a([T({type:String}),s("design:type",String)],U.prototype,"iconPosition",void 0),a([T({type:String}),s("design:type",Object)],U.prototype,"iconName",void 0),a([T({type:Boolean,reflect:!0}),s("design:type",Boolean)],U.prototype,"disabled",void 0),a([T({type:String}),s("design:type",Object)],U.prototype,"idevent",void 0),U=a([d("randstad-button")],U);let H=class extends t{constructor(){super(...arguments),this.img="",this.name="",this.title="",this.description="",this.buttonLabel="Contactanos",this.cardId=""}static{this.styles=o`
|
|
479
534
|
:host {
|
|
480
535
|
display: inline-block;
|
|
481
536
|
font-family: "Graphik", sans-serif;
|
|
@@ -848,6 +903,20 @@ function A(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
848
903
|
color: var(--secondary-color);
|
|
849
904
|
}
|
|
850
905
|
|
|
906
|
+
/* Hover normal (sin error ni foco) */
|
|
907
|
+
.form:not(.error):not(:focus-within) .form-input:hover {
|
|
908
|
+
box-shadow: 0px 0px 0px 4px var(--form-hover-shadow);
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
/* Hover con error (sin foco) */
|
|
912
|
+
.form.error:not(:focus-within) .form-input:hover {
|
|
913
|
+
box-shadow: 0px 0px 0px 4px var(--ui-negative-pink-shadow);
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
.form-input:focus {
|
|
917
|
+
border: 2px solid var(--primary-color)
|
|
918
|
+
}
|
|
919
|
+
|
|
851
920
|
.form.disabled .form-input {
|
|
852
921
|
background-color: var(--secondary-color-10);
|
|
853
922
|
cursor: default;
|
|
@@ -1028,31 +1097,42 @@ function A(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
1028
1097
|
|
|
1029
1098
|
${this.renderHelper()}
|
|
1030
1099
|
</div>
|
|
1031
|
-
`}};a([T({type:String}),s("design:type",String)],J.prototype,"size",void 0),a([T({type:String}),s("design:type",Object)],J.prototype,"icon",void 0),a([T({type:Boolean}),s("design:type",Boolean)],J.prototype,"typing",void 0),a([T({type:String}),s("design:type",String)],J.prototype,"type",void 0),a([T({type:String}),s("design:type",String)],J.prototype,"linkText",void 0),a([T({type:String}),s("design:type",String)],J.prototype,"linkRoute",void 0),a([T({type:Boolean,reflect:!0}),s("design:type",Object)],J.prototype,"isPasswordVisible",void 0),a([T({type:Boolean}),s("design:type",Boolean)],J.prototype,"cleanButton",void 0),a([T({type:Number}),s("design:type",Number)],J.prototype,"maxLength",void 0),a([T({type:String}),s("design:type",String)],J.prototype,"heightTextArea",void 0),a([T({type:String}),s("design:type",String)],J.prototype,"maxHeightTextArea",void 0),J=a([d("randstad-form")],J);let Z=class extends L{static{this.styles=o`
|
|
1100
|
+
`}};a([T({type:String}),s("design:type",String)],J.prototype,"size",void 0),a([T({type:String}),s("design:type",Object)],J.prototype,"icon",void 0),a([T({type:Boolean}),s("design:type",Boolean)],J.prototype,"typing",void 0),a([T({type:String}),s("design:type",String)],J.prototype,"type",void 0),a([T({type:String}),s("design:type",String)],J.prototype,"linkText",void 0),a([T({type:String}),s("design:type",String)],J.prototype,"linkRoute",void 0),a([T({type:Boolean,reflect:!0}),s("design:type",Object)],J.prototype,"isPasswordVisible",void 0),a([T({type:Boolean}),s("design:type",Boolean)],J.prototype,"cleanButton",void 0),a([T({type:Number}),s("design:type",Number)],J.prototype,"maxLength",void 0),a([T({type:String}),s("design:type",String)],J.prototype,"heightTextArea",void 0),a([T({type:String}),s("design:type",String)],J.prototype,"maxHeightTextArea",void 0),J=a([d("randstad-form")],J);let Z=class extends L{constructor(){super(...arguments),this.rows=""}static{this.styles=o`
|
|
1032
1101
|
${X}
|
|
1033
1102
|
${Q}
|
|
1034
1103
|
${K}
|
|
1035
1104
|
|
|
1036
1105
|
:host {
|
|
1106
|
+
display: flex;
|
|
1107
|
+
flex-direction: column;
|
|
1037
1108
|
gap: 8px;
|
|
1038
1109
|
}
|
|
1039
1110
|
|
|
1040
|
-
.
|
|
1111
|
+
.group-container {
|
|
1041
1112
|
display: flex;
|
|
1042
1113
|
flex-direction: column;
|
|
1043
|
-
gap:
|
|
1114
|
+
gap: 8px;
|
|
1115
|
+
width: 100%;
|
|
1044
1116
|
}
|
|
1045
|
-
`}render(){return e`
|
|
1046
|
-
${this.renderLabel()}
|
|
1047
1117
|
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1118
|
+
.fields {
|
|
1119
|
+
gap: 8px;
|
|
1120
|
+
}
|
|
1121
|
+
`}render(){const t=this.rows?`display: grid; grid-template-columns: ${this.rows};`:"display: flex; flex-direction: column;";return e`
|
|
1122
|
+
<div class="group-container">
|
|
1123
|
+
${this.renderLabelContainer()}
|
|
1124
|
+
|
|
1125
|
+
<div class="input-container">
|
|
1126
|
+
<div class="fields" style="${t};">
|
|
1127
|
+
<slot></slot>
|
|
1128
|
+
</div>
|
|
1051
1129
|
|
|
1052
|
-
|
|
1130
|
+
${this.renderError()}
|
|
1131
|
+
</div>
|
|
1053
1132
|
|
|
1054
|
-
|
|
1055
|
-
|
|
1133
|
+
${this.renderHelper()}
|
|
1134
|
+
</div>
|
|
1135
|
+
`}};a([T({type:String}),s("design:type",String)],Z.prototype,"rows",void 0),Z=a([d("randstad-form-group")],Z);class tt extends t{constructor(){super(...arguments),this.name="",this.size="24px"}static{this.styles=o`
|
|
1056
1136
|
:host {
|
|
1057
1137
|
display: inline-flex;
|
|
1058
1138
|
width: var(--icon-size, 24px);
|
|
@@ -1119,7 +1199,7 @@ function A(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
1119
1199
|
<randstad-icon class="icon" name="${this.icon}" size="24px" style="color: var(--icon-color);"></randstad-icon>
|
|
1120
1200
|
<span class="message">${this.message}</span>
|
|
1121
1201
|
</div>
|
|
1122
|
-
`}};a([T({type:String}),s("design:type",String)],et.prototype,"type",void 0),a([T({type:String}),s("design:type",String)],et.prototype,"icon",void 0),a([T({type:String}),s("design:type",String)],et.prototype,"message",void 0),a([T({type:Boolean}),s("design:type",Boolean)],et.prototype,"open",void 0),et=a([d("randstad-notice")],et);let it=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.modalWidth="500px",this.scrollable=!1,this.setScrollableMode=()=>{this.scrollable=window.innerWidth>940}}static{this.styles=o`
|
|
1202
|
+
`}};a([T({type:String}),s("design:type",String)],et.prototype,"type",void 0),a([T({type:String}),s("design:type",String)],et.prototype,"icon",void 0),a([T({type:String}),s("design:type",String)],et.prototype,"message",void 0),a([T({type:Boolean}),s("design:type",Boolean)],et.prototype,"open",void 0),et=a([d("randstad-notice")],et);let it=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.scrollable=!1,this.setScrollableMode=()=>{this.scrollable=window.innerWidth>940}}static{this.styles=o`
|
|
1123
1203
|
:host {
|
|
1124
1204
|
font-family: 'Graphik', sans-serif;
|
|
1125
1205
|
display: none;
|
|
@@ -1312,13 +1392,15 @@ function A(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
1312
1392
|
size="md"
|
|
1313
1393
|
@click=${()=>this.dispatchEvent(new CustomEvent("primary-click"))}
|
|
1314
1394
|
label=${this.primaryButtonLabel}
|
|
1395
|
+
.loader=${this.isPrimaryLoader}
|
|
1396
|
+
.disabled=${this.isPrimaryDisabled}
|
|
1315
1397
|
>
|
|
1316
1398
|
</randstad-button>
|
|
1317
1399
|
`:i}
|
|
1318
1400
|
</div>
|
|
1319
1401
|
</div>
|
|
1320
1402
|
</div>
|
|
1321
|
-
`}};a([T({type:Boolean,reflect:!0}),s("design:type",Object)],it.prototype,"open",void 0),a([T({type:String}),s("design:type",Object)],it.prototype,"title",void 0),a([T({type:String}),s("design:type",String)],it.prototype,"subtitle",void 0),a([T({type:Boolean}),s("design:type",Object)],it.prototype,"showNotice",void 0),a([T({type:String}),s("design:type",String)],it.prototype,"noticeType",void 0),a([T({type:String}),s("design:type",Object)],it.prototype,"noticeMessage",void 0),a([T({type:String}),s("design:type",Object)],it.prototype,"noticeIcon",void 0),a([T({type:Boolean}),s("design:type",Object)],it.prototype,"showPrimaryButton",void 0),a([T({type:String}),s("design:type",Object)],it.prototype,"primaryButtonLabel",void 0),a([T({type:Boolean}),s("design:type",Object)],it.prototype,"showSecondaryButton",void 0),a([T({type:String}),s("design:type",Object)],it.prototype,"secondaryButtonLabel",void 0),a([T({type:Boolean}),s("design:type",Object)],it.prototype,"isFooterCustom",void 0),a([T({type:String}),s("design:type",Object)],it.prototype,"modalWidth",void 0),a([z(),s("design:type",Object)],it.prototype,"scrollable",void 0),it=a([d("custom-modal")],it);let ot=class extends t{constructor(){super(...arguments),this.open=!1,this.type="default",this.icon="warning",this.title="Título del Popup",this.description="Descripción del popup",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`
|
|
1403
|
+
`}};a([T({type:Boolean,reflect:!0}),s("design:type",Object)],it.prototype,"open",void 0),a([T({type:String}),s("design:type",Object)],it.prototype,"title",void 0),a([T({type:String}),s("design:type",String)],it.prototype,"subtitle",void 0),a([T({type:Boolean}),s("design:type",Object)],it.prototype,"showNotice",void 0),a([T({type:String}),s("design:type",String)],it.prototype,"noticeType",void 0),a([T({type:String}),s("design:type",Object)],it.prototype,"noticeMessage",void 0),a([T({type:String}),s("design:type",Object)],it.prototype,"noticeIcon",void 0),a([T({type:Boolean}),s("design:type",Object)],it.prototype,"showPrimaryButton",void 0),a([T({type:String}),s("design:type",Object)],it.prototype,"primaryButtonLabel",void 0),a([T({type:Boolean}),s("design:type",Object)],it.prototype,"showSecondaryButton",void 0),a([T({type:String}),s("design:type",Object)],it.prototype,"secondaryButtonLabel",void 0),a([T({type:Boolean}),s("design:type",Object)],it.prototype,"isFooterCustom",void 0),a([T({type:Boolean}),s("design:type",Object)],it.prototype,"isPrimaryLoader",void 0),a([T({type:Boolean}),s("design:type",Object)],it.prototype,"isPrimaryDisabled",void 0),a([T({type:String}),s("design:type",Object)],it.prototype,"modalWidth",void 0),a([z(),s("design:type",Object)],it.prototype,"scrollable",void 0),it=a([d("custom-modal")],it);let ot=class extends t{constructor(){super(...arguments),this.open=!1,this.type="default",this.icon="warning",this.title="Título del Popup",this.description="Descripción del popup",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`
|
|
1322
1404
|
:host {
|
|
1323
1405
|
display: none;
|
|
1324
1406
|
position: fixed;
|
|
@@ -2548,7 +2630,29 @@ const Yt=o`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
2548
2630
|
</button>
|
|
2549
2631
|
`:null}
|
|
2550
2632
|
</div>
|
|
2551
|
-
`}};a([T({type:Array}),s("design:type",Array)],Jt.prototype,"tabs",void 0),a([T({type:String}),s("design:type",String)],Jt.prototype,"selected",void 0),a([z(),s("design:type",String)],Jt.prototype,"internalSelected",void 0),a([z(),s("design:type",Object)],Jt.prototype,"showPrev",void 0),a([z(),s("design:type",Object)],Jt.prototype,"showNext",void 0),Jt=a([d("tabs-bar")],Jt);
|
|
2633
|
+
`}};a([T({type:Array}),s("design:type",Array)],Jt.prototype,"tabs",void 0),a([T({type:String}),s("design:type",String)],Jt.prototype,"selected",void 0),a([z(),s("design:type",String)],Jt.prototype,"internalSelected",void 0),a([z(),s("design:type",Object)],Jt.prototype,"showPrev",void 0),a([z(),s("design:type",Object)],Jt.prototype,"showNext",void 0),Jt=a([d("tabs-bar")],Jt);const Zt=o`
|
|
2634
|
+
.progress-bar-container {
|
|
2635
|
+
min-height: 23px;
|
|
2636
|
+
display: flex;
|
|
2637
|
+
align-items: center;
|
|
2638
|
+
}
|
|
2639
|
+
|
|
2640
|
+
.progress-bar {
|
|
2641
|
+
min-width: 80px;
|
|
2642
|
+
height: 8px;
|
|
2643
|
+
background-color: var(--secondary-color-20);
|
|
2644
|
+
border-radius: 999px;
|
|
2645
|
+
overflow: hidden;
|
|
2646
|
+
}
|
|
2647
|
+
|
|
2648
|
+
.progress-bar-fill {
|
|
2649
|
+
height: 100%;
|
|
2650
|
+
background-color: var(--primary-color);
|
|
2651
|
+
transition: width 0.1s ease;
|
|
2652
|
+
}
|
|
2653
|
+
`;let te=class extends t{constructor(){super(...arguments),this.files=[],this.disabled=!1,this.simulatedDelay=0,this.loading=!1,this.progress=0,this.isDragging=!1}static{this.styles=o`
|
|
2654
|
+
${Zt}
|
|
2655
|
+
|
|
2552
2656
|
:host {
|
|
2553
2657
|
font-family: 'Graphik', sans-serif;
|
|
2554
2658
|
}
|
|
@@ -2623,26 +2727,6 @@ const Yt=o`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
2623
2727
|
input[type="file"] {
|
|
2624
2728
|
display: none;
|
|
2625
2729
|
}
|
|
2626
|
-
|
|
2627
|
-
.progress-bar-container {
|
|
2628
|
-
min-height: 23px;
|
|
2629
|
-
display: flex;
|
|
2630
|
-
align-items: center;
|
|
2631
|
-
}
|
|
2632
|
-
|
|
2633
|
-
.progress-bar {
|
|
2634
|
-
min-width: 80px;
|
|
2635
|
-
height: 8px;
|
|
2636
|
-
background-color: var(--secondary-color-20);
|
|
2637
|
-
border-radius: 999px;
|
|
2638
|
-
overflow: hidden;
|
|
2639
|
-
}
|
|
2640
|
-
|
|
2641
|
-
.progress-bar-fill {
|
|
2642
|
-
height: 100%;
|
|
2643
|
-
background-color: var(--primary-color);
|
|
2644
|
-
transition: width 0.1s ease;
|
|
2645
|
-
}
|
|
2646
2730
|
`}async handleFiles(t){if(this.loading||this.disabled)return;const e=Array.isArray(this.files)?this.files:[],i=Array.from(t||[]).slice(0,3-e.length),o=this.simulatedDelay??0;if(o<=0)return this.files=[...e,...i],void this.dispatchEvent(new CustomEvent("files-changed",{detail:this.files}));this.loading=!0,this.progress=0,await this.updateComplete;const r=Date.now(),n=setInterval((()=>{const t=Date.now()-r,a=Math.min(Math.round(t/o*100),100);this.progress=a,this.progress>=100&&(clearInterval(n),this.files=[...e,...i],this.loading=!1,this.progress=0,this.dispatchEvent(new CustomEvent("files-changed",{detail:this.files})))}),10)}onFileInputChange(t){const e=t.target;this.handleFiles(e.files)}onDrop(t){t.preventDefault(),this.disabled||(this.isDragging=!1,this.handleFiles(t.dataTransfer?.files||null))}onDragOver(t){t.preventDefault(),this.disabled||(this.isDragging=!0)}onDragLeave(t){t.preventDefault(),this.disabled||(this.isDragging=!1)}render(){return e`
|
|
2647
2731
|
<div class="container ${this.isDragging?"dragging":""}"
|
|
2648
2732
|
@drop="${this.onDrop}"
|
|
@@ -2677,7 +2761,7 @@ const Yt=o`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
2677
2761
|
</label>
|
|
2678
2762
|
`}
|
|
2679
2763
|
</div>
|
|
2680
|
-
`}};a([T({type:Array}),s("design:type",Array)],Zt.prototype,"files",void 0),a([T({type:Boolean,reflect:!0}),s("design:type",Object)],Zt.prototype,"disabled",void 0),a([T({type:Number}),s("design:type",Object)],Zt.prototype,"simulatedDelay",void 0),a([z(),s("design:type",Object)],Zt.prototype,"loading",void 0),a([z(),s("design:type",Object)],Zt.prototype,"progress",void 0),a([z(),s("design:type",Object)],Zt.prototype,"isDragging",void 0),Zt=a([d("upload-image")],Zt);const te=6048e5,ee=Symbol.for("constructDateFrom");function ie(t,e){return"function"==typeof t?t(e):t&&"object"==typeof t&&ee in t?t[ee](e):t instanceof Date?new t.constructor(e):new Date(e)}function oe(t,e){return ie(e||t,t)}function re(t,e,i){const o=oe(t,i?.in);if(isNaN(e))return ie(t,NaN);if(!e)return o;const r=o.getDate(),n=ie(t,o.getTime());n.setMonth(o.getMonth()+e+1,0);return r>=n.getDate()?n:(o.setFullYear(n.getFullYear(),n.getMonth(),r),o)}let ne={};function ae(){return ne}function se(t,e){const i=ae(),o=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,r=oe(t,e?.in),n=r.getDay(),a=(n<o?7:0)+n-o;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}function de(t,e){return se(t,{...e,weekStartsOn:1})}function le(t,e){const i=oe(t,e?.in),o=i.getFullYear(),r=ie(i,0);r.setFullYear(o+1,0,4),r.setHours(0,0,0,0);const n=de(r),a=ie(i,0);a.setFullYear(o,0,4),a.setHours(0,0,0,0);const s=de(a);return i.getTime()>=n.getTime()?o+1:i.getTime()>=s.getTime()?o:o-1}function ce(t){const e=oe(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 he(t,...e){const i=ie.bind(null,e.find((t=>"object"==typeof t)));return e.map(i)}function pe(t,e){const i=oe(t,e?.in);return i.setHours(0,0,0,0),i}function ue(t,e,i){return re(t,12*e,i)}function be(t){return!(!((e=t)instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))&&"number"!=typeof t||isNaN(+oe(t)));var e}function me(t,e){const i=oe(t,e?.in);return i.setDate(1),i.setHours(0,0,0,0),i}const ge={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 ye(t){return(e={})=>{const i=e.width?String(e.width):t.defaultWidth;return t.formats[i]||t.formats[t.defaultWidth]}}const fe={date:ye({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:ye({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:ye({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},ve={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function xe(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 we(t){return(e,i={})=>{const o=i.width,r=o&&t.matchPatterns[o]||t.matchPatterns[t.defaultMatchWidth],n=e.match(r);if(!n)return null;const a=n[0],s=o&&t.parsePatterns[o]||t.parsePatterns[t.defaultParseWidth],d=Array.isArray(s)?function(t,e){for(let i=0;i<t.length;i++)if(e(t[i]))return i;return}(s,(t=>t.test(a))):function(t,e){for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&e(t[i]))return i;return}(s,(t=>t.test(a)));let l;l=t.valueCallback?t.valueCallback(d):d,l=i.valueCallback?i.valueCallback(l):l;return{value:l,rest:e.slice(a.length)}}}var ke;const $e={code:"en-US",formatDistance:(t,e,i)=>{let o;const r=ge[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:fe,formatRelative:(t,e,i,o)=>ve[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:xe({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:xe({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:xe({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:xe({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:xe({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:(ke={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const i=t.match(ke.matchPattern);if(!i)return null;const o=i[0],r=t.match(ke.parsePattern);if(!r)return null;let n=ke.valueCallback?ke.valueCallback(r[0]):r[0];return n=e.valueCallback?e.valueCallback(n):n,{value:n,rest:t.slice(o.length)}}),era:we({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:we({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:we({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:we({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:we({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 Se(t,e){const i=oe(t,e?.in),o=function(t,e){const[i,o]=he(0,t,e),r=pe(i),n=pe(o),a=+r-ce(r),s=+n-ce(n);return Math.round((a-s)/864e5)}(i,function(t,e){const i=oe(t,e?.in);return i.setFullYear(i.getFullYear(),0,1),i.setHours(0,0,0,0),i}(i));return o+1}function Ce(t,e){const i=oe(t,e?.in),o=+de(i)-+function(t,e){const i=le(t,e),o=ie(t,0);return o.setFullYear(i,0,4),o.setHours(0,0,0,0),de(o)}(i);return Math.round(o/te)+1}function Ee(t,e){const i=oe(t,e?.in),o=i.getFullYear(),r=ae(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=ie(e?.in||t,0);a.setFullYear(o+1,0,n),a.setHours(0,0,0,0);const s=se(a,e),d=ie(e?.in||t,0);d.setFullYear(o,0,n),d.setHours(0,0,0,0);const l=se(d,e);return+i>=+s?o+1:+i>=+l?o:o-1}function De(t,e){const i=oe(t,e?.in),o=+se(i,e)-+function(t,e){const i=ae(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,r=Ee(t,e),n=ie(e?.in||t,0);return n.setFullYear(r,0,o),n.setHours(0,0,0,0),se(n,e)}(i,e);return Math.round(o/te)+1}function Oe(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const Me={y(t,e){const i=t.getFullYear(),o=i>0?i:1-i;return Oe("yy"===e?o%100:o,e.length)},M(t,e){const i=t.getMonth();return"M"===e?String(i+1):Oe(i+1,2)},d:(t,e)=>Oe(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)=>Oe(t.getHours()%12||12,e.length),H:(t,e)=>Oe(t.getHours(),e.length),m:(t,e)=>Oe(t.getMinutes(),e.length),s:(t,e)=>Oe(t.getSeconds(),e.length),S(t,e){const i=e.length,o=t.getMilliseconds();return Oe(Math.trunc(o*Math.pow(10,i-3)),e.length)}},Fe="midnight",Pe="noon",je="morning",Te="afternoon",ze="evening",Ae="night",Le={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 Me.y(t,e)},Y:function(t,e,i,o){const r=Ee(t,o),n=r>0?r:1-r;if("YY"===e){return Oe(n%100,2)}return"Yo"===e?i.ordinalNumber(n,{unit:"year"}):Oe(n,e.length)},R:function(t,e){return Oe(le(t),e.length)},u:function(t,e){return Oe(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 Oe(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 Oe(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 Me.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 Oe(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=De(t,o);return"wo"===e?i.ordinalNumber(r,{unit:"week"}):Oe(r,e.length)},I:function(t,e,i){const o=Ce(t);return"Io"===e?i.ordinalNumber(o,{unit:"week"}):Oe(o,e.length)},d:function(t,e,i){return"do"===e?i.ordinalNumber(t.getDate(),{unit:"date"}):Me.d(t,e)},D:function(t,e,i){const o=Se(t);return"Do"===e?i.ordinalNumber(o,{unit:"dayOfYear"}):Oe(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(),n=(r-o.weekStartsOn+8)%7||7;switch(e){case"e":return String(n);case"ee":return Oe(n,2);case"eo":return i.ordinalNumber(n,{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(),n=(r-o.weekStartsOn+8)%7||7;switch(e){case"c":return String(n);case"cc":return Oe(n,e.length);case"co":return i.ordinalNumber(n,{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 Oe(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?Pe:0===o?Fe: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?ze:o>=12?Te:o>=4?je:Ae,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 Me.h(t,e)},H:function(t,e,i){return"Ho"===e?i.ordinalNumber(t.getHours(),{unit:"hour"}):Me.H(t,e)},K:function(t,e,i){const o=t.getHours()%12;return"Ko"===e?i.ordinalNumber(o,{unit:"hour"}):Oe(o,e.length)},k:function(t,e,i){let o=t.getHours();return 0===o&&(o=24),"ko"===e?i.ordinalNumber(o,{unit:"hour"}):Oe(o,e.length)},m:function(t,e,i){return"mo"===e?i.ordinalNumber(t.getMinutes(),{unit:"minute"}):Me.m(t,e)},s:function(t,e,i){return"so"===e?i.ordinalNumber(t.getSeconds(),{unit:"second"}):Me.s(t,e)},S:function(t,e){return Me.S(t,e)},X:function(t,e,i){const o=t.getTimezoneOffset();if(0===o)return"Z";switch(e){case"X":return _e(o);case"XXXX":case"XX":return Ne(o);default:return Ne(o,":")}},x:function(t,e,i){const o=t.getTimezoneOffset();switch(e){case"x":return _e(o);case"xxxx":case"xx":return Ne(o);default:return Ne(o,":")}},O:function(t,e,i){const o=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Ie(o,":");default:return"GMT"+Ne(o,":")}},z:function(t,e,i){const o=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Ie(o,":");default:return"GMT"+Ne(o,":")}},t:function(t,e,i){return Oe(Math.trunc(+t/1e3),e.length)},T:function(t,e,i){return Oe(+t,e.length)}};function Ie(t,e=""){const i=t>0?"-":"+",o=Math.abs(t),r=Math.trunc(o/60),n=o%60;return 0===n?i+String(r):i+String(r)+e+Oe(n,2)}function _e(t,e){if(t%60==0){return(t>0?"-":"+")+Oe(Math.abs(t)/60,2)}return Ne(t,e)}function Ne(t,e=""){const i=t>0?"-":"+",o=Math.abs(t);return i+Oe(Math.trunc(o/60),2)+e+Oe(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"})}},Be=(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"})}},Ve={p:Be,P:(t,e)=>{const i=t.match(/(P+)(p+)?/)||[],o=i[1],r=i[2];if(!r)return Re(t,e);let n;switch(o){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;default:n=e.dateTime({width:"full"})}return n.replace("{{date}}",Re(o,e)).replace("{{time}}",Be(r,e))}},qe=/^D+$/,We=/^Y+$/,Ye=["D","DD","YY","YYYY"];const Ue=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,He=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ge=/^'([^]*?)'?$/,Ke=/''/g,Xe=/[a-zA-Z]/;function Qe(t,e,i){const o=ae(),r=o.locale??$e,n=o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,a=o.weekStartsOn??o.locale?.options?.weekStartsOn??0,s=oe(t,i?.in);if(!be(s))throw new RangeError("Invalid time value");let d=e.match(He).map((t=>{const e=t[0];if("p"===e||"P"===e){return(0,Ve[e])(t,r.formatLong)}return t})).join("").match(Ue).map((t=>{if("''"===t)return{isToken:!1,value:"'"};const e=t[0];if("'"===e)return{isToken:!1,value:Je(t)};if(Le[e])return{isToken:!0,value:t};if(e.match(Xe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+e+"`");return{isToken:!1,value:t}}));r.localize.preprocessor&&(d=r.localize.preprocessor(s,d));const l={firstWeekContainsDate:n,weekStartsOn:a,locale:r};return d.map((i=>{if(!i.isToken)return i.value;const o=i.value;(function(t){return We.test(t)}(o)||function(t){return qe.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),Ye.includes(t))throw new RangeError(o)}(o,e,String(t));return(0,Le[o[0]])(s,o,r.localize,l)})).join("")}function Je(t){const e=t.match(Ge);return e?e[1].replace(Ke,"'"):t}function Ze(t,e){return oe(t,e?.in).getDate()}function ti(t,e){const i=oe(t,e?.in),o=i.getFullYear(),r=i.getMonth(),n=ie(i,0);return n.setFullYear(o,r+1,0),n.setHours(0,0,0,0),n.getDate()}function ei(t,e){return+oe(t)>+oe(e)}function ii(t,e){return+oe(t)<+oe(e)}function oi(t,e,i){const[o,r]=he(0,t,e);return o.getFullYear()===r.getFullYear()&&o.getMonth()===r.getMonth()}function ri(t,e,i){const[o,r]=he(0,t,e);return o.getFullYear()===r.getFullYear()}function ni(t,e){return function(t,e){const[i,o]=he(0,t,e);return+pe(i)===+pe(o)}(ie(t,t),function(t){return ie(t,Date.now())}(t))}let ai=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.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=o`
|
|
2764
|
+
`}};a([T({type:Array}),s("design:type",Array)],te.prototype,"files",void 0),a([T({type:Boolean,reflect:!0}),s("design:type",Object)],te.prototype,"disabled",void 0),a([T({type:Number}),s("design:type",Object)],te.prototype,"simulatedDelay",void 0),a([z(),s("design:type",Object)],te.prototype,"loading",void 0),a([z(),s("design:type",Object)],te.prototype,"progress",void 0),a([z(),s("design:type",Object)],te.prototype,"isDragging",void 0),te=a([d("upload-image")],te);const ee=6048e5,ie=Symbol.for("constructDateFrom");function oe(t,e){return"function"==typeof t?t(e):t&&"object"==typeof t&&ie in t?t[ie](e):t instanceof Date?new t.constructor(e):new Date(e)}function re(t,e){return oe(e||t,t)}function ne(t,e,i){const o=re(t,i?.in);if(isNaN(e))return oe(t,NaN);if(!e)return o;const r=o.getDate(),n=oe(t,o.getTime());n.setMonth(o.getMonth()+e+1,0);return r>=n.getDate()?n:(o.setFullYear(n.getFullYear(),n.getMonth(),r),o)}let ae={};function se(){return ae}function de(t,e){const i=se(),o=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,r=re(t,e?.in),n=r.getDay(),a=(n<o?7:0)+n-o;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}function le(t,e){return de(t,{...e,weekStartsOn:1})}function ce(t,e){const i=re(t,e?.in),o=i.getFullYear(),r=oe(i,0);r.setFullYear(o+1,0,4),r.setHours(0,0,0,0);const n=le(r),a=oe(i,0);a.setFullYear(o,0,4),a.setHours(0,0,0,0);const s=le(a);return i.getTime()>=n.getTime()?o+1:i.getTime()>=s.getTime()?o:o-1}function he(t){const e=re(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 pe(t,...e){const i=oe.bind(null,e.find((t=>"object"==typeof t)));return e.map(i)}function ue(t,e){const i=re(t,e?.in);return i.setHours(0,0,0,0),i}function be(t,e,i){return ne(t,12*e,i)}function me(t){return!(!((e=t)instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))&&"number"!=typeof t||isNaN(+re(t)));var e}function ge(t,e){const i=re(t,e?.in);return i.setDate(1),i.setHours(0,0,0,0),i}const ye={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 fe(t){return(e={})=>{const i=e.width?String(e.width):t.defaultWidth;return t.formats[i]||t.formats[t.defaultWidth]}}const ve={date:fe({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:fe({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:fe({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},xe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function we(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 ke(t){return(e,i={})=>{const o=i.width,r=o&&t.matchPatterns[o]||t.matchPatterns[t.defaultMatchWidth],n=e.match(r);if(!n)return null;const a=n[0],s=o&&t.parsePatterns[o]||t.parsePatterns[t.defaultParseWidth],d=Array.isArray(s)?function(t,e){for(let i=0;i<t.length;i++)if(e(t[i]))return i;return}(s,(t=>t.test(a))):function(t,e){for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&e(t[i]))return i;return}(s,(t=>t.test(a)));let l;l=t.valueCallback?t.valueCallback(d):d,l=i.valueCallback?i.valueCallback(l):l;return{value:l,rest:e.slice(a.length)}}}var $e;const Se={code:"en-US",formatDistance:(t,e,i)=>{let o;const r=ye[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:ve,formatRelative:(t,e,i,o)=>xe[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:we({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:we({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:we({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:we({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:we({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:($e={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const i=t.match($e.matchPattern);if(!i)return null;const o=i[0],r=t.match($e.parsePattern);if(!r)return null;let n=$e.valueCallback?$e.valueCallback(r[0]):r[0];return n=e.valueCallback?e.valueCallback(n):n,{value:n,rest:t.slice(o.length)}}),era:ke({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:ke({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:ke({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:ke({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:ke({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 Ce(t,e){const i=re(t,e?.in),o=function(t,e){const[i,o]=pe(0,t,e),r=ue(i),n=ue(o),a=+r-he(r),s=+n-he(n);return Math.round((a-s)/864e5)}(i,function(t,e){const i=re(t,e?.in);return i.setFullYear(i.getFullYear(),0,1),i.setHours(0,0,0,0),i}(i));return o+1}function Ee(t,e){const i=re(t,e?.in),o=+le(i)-+function(t,e){const i=ce(t,e),o=oe(t,0);return o.setFullYear(i,0,4),o.setHours(0,0,0,0),le(o)}(i);return Math.round(o/ee)+1}function De(t,e){const i=re(t,e?.in),o=i.getFullYear(),r=se(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=oe(e?.in||t,0);a.setFullYear(o+1,0,n),a.setHours(0,0,0,0);const s=de(a,e),d=oe(e?.in||t,0);d.setFullYear(o,0,n),d.setHours(0,0,0,0);const l=de(d,e);return+i>=+s?o+1:+i>=+l?o:o-1}function Oe(t,e){const i=re(t,e?.in),o=+de(i,e)-+function(t,e){const i=se(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,r=De(t,e),n=oe(e?.in||t,0);return n.setFullYear(r,0,o),n.setHours(0,0,0,0),de(n,e)}(i,e);return Math.round(o/ee)+1}function Me(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const Fe={y(t,e){const i=t.getFullYear(),o=i>0?i:1-i;return Me("yy"===e?o%100:o,e.length)},M(t,e){const i=t.getMonth();return"M"===e?String(i+1):Me(i+1,2)},d:(t,e)=>Me(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)=>Me(t.getHours()%12||12,e.length),H:(t,e)=>Me(t.getHours(),e.length),m:(t,e)=>Me(t.getMinutes(),e.length),s:(t,e)=>Me(t.getSeconds(),e.length),S(t,e){const i=e.length,o=t.getMilliseconds();return Me(Math.trunc(o*Math.pow(10,i-3)),e.length)}},Pe="midnight",je="noon",Te="morning",ze="afternoon",Ae="evening",Le="night",Ie={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 Fe.y(t,e)},Y:function(t,e,i,o){const r=De(t,o),n=r>0?r:1-r;if("YY"===e){return Me(n%100,2)}return"Yo"===e?i.ordinalNumber(n,{unit:"year"}):Me(n,e.length)},R:function(t,e){return Me(ce(t),e.length)},u:function(t,e){return Me(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 Me(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 Me(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 Fe.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 Me(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=Oe(t,o);return"wo"===e?i.ordinalNumber(r,{unit:"week"}):Me(r,e.length)},I:function(t,e,i){const o=Ee(t);return"Io"===e?i.ordinalNumber(o,{unit:"week"}):Me(o,e.length)},d:function(t,e,i){return"do"===e?i.ordinalNumber(t.getDate(),{unit:"date"}):Fe.d(t,e)},D:function(t,e,i){const o=Ce(t);return"Do"===e?i.ordinalNumber(o,{unit:"dayOfYear"}):Me(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(),n=(r-o.weekStartsOn+8)%7||7;switch(e){case"e":return String(n);case"ee":return Me(n,2);case"eo":return i.ordinalNumber(n,{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(),n=(r-o.weekStartsOn+8)%7||7;switch(e){case"c":return String(n);case"cc":return Me(n,e.length);case"co":return i.ordinalNumber(n,{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 Me(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?je:0===o?Pe: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?Ae:o>=12?ze:o>=4?Te:Le,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 Fe.h(t,e)},H:function(t,e,i){return"Ho"===e?i.ordinalNumber(t.getHours(),{unit:"hour"}):Fe.H(t,e)},K:function(t,e,i){const o=t.getHours()%12;return"Ko"===e?i.ordinalNumber(o,{unit:"hour"}):Me(o,e.length)},k:function(t,e,i){let o=t.getHours();return 0===o&&(o=24),"ko"===e?i.ordinalNumber(o,{unit:"hour"}):Me(o,e.length)},m:function(t,e,i){return"mo"===e?i.ordinalNumber(t.getMinutes(),{unit:"minute"}):Fe.m(t,e)},s:function(t,e,i){return"so"===e?i.ordinalNumber(t.getSeconds(),{unit:"second"}):Fe.s(t,e)},S:function(t,e){return Fe.S(t,e)},X:function(t,e,i){const o=t.getTimezoneOffset();if(0===o)return"Z";switch(e){case"X":return Ne(o);case"XXXX":case"XX":return Re(o);default:return Re(o,":")}},x:function(t,e,i){const o=t.getTimezoneOffset();switch(e){case"x":return Ne(o);case"xxxx":case"xx":return Re(o);default:return Re(o,":")}},O:function(t,e,i){const o=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+_e(o,":");default:return"GMT"+Re(o,":")}},z:function(t,e,i){const o=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+_e(o,":");default:return"GMT"+Re(o,":")}},t:function(t,e,i){return Me(Math.trunc(+t/1e3),e.length)},T:function(t,e,i){return Me(+t,e.length)}};function _e(t,e=""){const i=t>0?"-":"+",o=Math.abs(t),r=Math.trunc(o/60),n=o%60;return 0===n?i+String(r):i+String(r)+e+Me(n,2)}function Ne(t,e){if(t%60==0){return(t>0?"-":"+")+Me(Math.abs(t)/60,2)}return Re(t,e)}function Re(t,e=""){const i=t>0?"-":"+",o=Math.abs(t);return i+Me(Math.trunc(o/60),2)+e+Me(o%60,2)}const Be=(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"})}},Ve=(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"})}},qe={p:Ve,P:(t,e)=>{const i=t.match(/(P+)(p+)?/)||[],o=i[1],r=i[2];if(!r)return Be(t,e);let n;switch(o){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;default:n=e.dateTime({width:"full"})}return n.replace("{{date}}",Be(o,e)).replace("{{time}}",Ve(r,e))}},We=/^D+$/,Ye=/^Y+$/,Ue=["D","DD","YY","YYYY"];const He=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ge=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ke=/^'([^]*?)'?$/,Xe=/''/g,Qe=/[a-zA-Z]/;function Je(t,e,i){const o=se(),r=o.locale??Se,n=o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,a=o.weekStartsOn??o.locale?.options?.weekStartsOn??0,s=re(t,i?.in);if(!me(s))throw new RangeError("Invalid time value");let d=e.match(Ge).map((t=>{const e=t[0];if("p"===e||"P"===e){return(0,qe[e])(t,r.formatLong)}return t})).join("").match(He).map((t=>{if("''"===t)return{isToken:!1,value:"'"};const e=t[0];if("'"===e)return{isToken:!1,value:Ze(t)};if(Ie[e])return{isToken:!0,value:t};if(e.match(Qe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+e+"`");return{isToken:!1,value:t}}));r.localize.preprocessor&&(d=r.localize.preprocessor(s,d));const l={firstWeekContainsDate:n,weekStartsOn:a,locale:r};return d.map((i=>{if(!i.isToken)return i.value;const o=i.value;(function(t){return Ye.test(t)}(o)||function(t){return We.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),Ue.includes(t))throw new RangeError(o)}(o,e,String(t));return(0,Ie[o[0]])(s,o,r.localize,l)})).join("")}function Ze(t){const e=t.match(Ke);return e?e[1].replace(Xe,"'"):t}function ti(t,e){return re(t,e?.in).getDate()}function ei(t,e){const i=re(t,e?.in),o=i.getFullYear(),r=i.getMonth(),n=oe(i,0);return n.setFullYear(o,r+1,0),n.setHours(0,0,0,0),n.getDate()}function ii(t,e){return+re(t)>+re(e)}function oi(t,e){return+re(t)<+re(e)}function ri(t,e,i){const[o,r]=pe(0,t,e);return o.getFullYear()===r.getFullYear()&&o.getMonth()===r.getMonth()}function ni(t,e,i){const[o,r]=pe(0,t,e);return o.getFullYear()===r.getFullYear()}function ai(t,e){return function(t,e){const[i,o]=pe(0,t,e);return+ue(i)===+ue(o)}(oe(t,t),function(t){return oe(t,Date.now())}(t))}let si=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.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=o`
|
|
2681
2765
|
/* Estilos generales del contenedor del calendario (escritorio) */
|
|
2682
2766
|
.calendar-container {
|
|
2683
2767
|
position: absolute;
|
|
@@ -3091,7 +3175,7 @@ const Yt=o`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
3091
3175
|
color: var(--secondary-randstad-dark-blue-30, #b1b5c4);
|
|
3092
3176
|
}
|
|
3093
3177
|
/* */
|
|
3094
|
-
`}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.handleOutsideClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleOutsideClick)}handleHeaderClick(){"days"===this.currentView?this.currentView="years":this.currentView="days"}_updateView(t,e=null){this.viewDate=t,e&&(this.currentView=e),this.dispatchEvent(new CustomEvent("view-date-change",{detail:{date:this.viewDate}}))}handleNavClick(t){let e=this.viewDate;e="days"===this.currentView?
|
|
3178
|
+
`}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.handleOutsideClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleOutsideClick)}handleHeaderClick(){"days"===this.currentView?this.currentView="years":this.currentView="days"}_updateView(t,e=null){this.viewDate=t,e&&(this.currentView=e),this.dispatchEvent(new CustomEvent("view-date-change",{detail:{date:this.viewDate}}))}handleNavClick(t){let e=this.viewDate;e="days"===this.currentView?ne(this.viewDate,t):"months"===this.currentView?be(this.viewDate,t):be(this.viewDate,21*t),this._updateView(e)}handleYearSelect(t){const e=function(t,e,i){const o=re(t,i?.in);return isNaN(+o)?oe(t,NaN):(o.setFullYear(e),o)}(this.viewDate,t);this._updateView(e,"months")}handleMonthSelect(t){const e=function(t,e,i){const o=re(t,i?.in),r=o.getFullYear(),n=o.getDate(),a=oe(t,0);a.setFullYear(r,e,15),a.setHours(0,0,0,0);const s=ei(a);return o.setMonth(e,Math.min(n,s)),o}(this.viewDate,t);this._updateView(e,"days")}handleDayClick(t){this.selectedDate=t,this.dispatchEvent(new CustomEvent("date-selected",{detail:{date:t},bubbles:!0,composed:!0}))}getFullMonthNames(){return["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"]}getShortMonthNames(){return this.getFullMonthNames().map((t=>t.substring(0,3)))}getShortWeekdays(){return["lu","ma","mi","ju","vi","sa","do"]}renderHeader(){const t=this.getFullMonthNames();let i="",o=!1,r=!1;if("years"===this.currentView){const t=this.viewDate.getFullYear()-this.viewDate.getFullYear()%21,e=t+20;i=`${t} - ${e}`;o=t<=(this.minDate?this.minDate.getFullYear():-1/0),r=e>=(this.maxDate?this.maxDate.getFullYear():1/0)}else if("months"===this.currentView){i=`${this.viewDate.getFullYear()}`;const t=this.viewDate.getFullYear();o=t<=(this.minDate?this.minDate.getFullYear():-1/0),r=t>=(this.maxDate?this.maxDate.getFullYear():1/0)}else{i=`${t[this.viewDate.getMonth()]} ${this.viewDate.getFullYear()}`,this.minDate&&(o=ri(ge(this.viewDate),ge(this.minDate))||oi(this.viewDate,this.minDate)),this.maxDate&&(r=ri(ge(this.viewDate),ge(this.maxDate))||ii(this.viewDate,this.maxDate))}return e`
|
|
3095
3179
|
<div class="header">
|
|
3096
3180
|
<div class="header-left">
|
|
3097
3181
|
<button class="month-year-button" @click=${this.handleHeaderClick}>
|
|
@@ -3125,7 +3209,7 @@ const Yt=o`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
3125
3209
|
</div>
|
|
3126
3210
|
`}renderMonthsView(){const t=this.getShortMonthNames(),i=this.selectedDate?.getMonth(),o=(new Date).getMonth(),r=this.viewDate.getFullYear();return e`
|
|
3127
3211
|
<div class="month-grid">
|
|
3128
|
-
${t.map(((t,n)=>{const a=n===o,s=n===i&&this.selectedDate&&
|
|
3212
|
+
${t.map(((t,n)=>{const a=n===o,s=n===i&&this.selectedDate&&ni(this.viewDate,this.selectedDate),d=n===i&&this.selectedDate&&!ni(this.viewDate,this.selectedDate);let l=!1;this.minDate&&r===this.minDate.getFullYear()&&(l=n<this.minDate.getMonth()),this.maxDate&&r===this.maxDate.getFullYear()&&(l=l||n>this.maxDate.getMonth());return e`
|
|
3129
3213
|
<button
|
|
3130
3214
|
class="${"month-button "+(s?"selected":d?"secondary-selected":a?"current":"")}"
|
|
3131
3215
|
?disabled=${l}
|
|
@@ -3135,20 +3219,20 @@ const Yt=o`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
3135
3219
|
</button>
|
|
3136
3220
|
`}))}
|
|
3137
3221
|
</div>
|
|
3138
|
-
`}renderDayView(){const t=
|
|
3222
|
+
`}renderDayView(){const t=ei(this.viewDate),i=ge(this.viewDate),o=re(i,r?.in).getDay();var r;const n=Array.from({length:0===o?6:o-1},(()=>null)),a=Array.from({length:t},((t,e)=>function(t,e,i){const o=re(t,i?.in);return o.setDate(e),o}(i,e+1))),s=this.getShortWeekdays();return e`
|
|
3139
3223
|
<div class="weekdays">
|
|
3140
3224
|
${s.map((t=>e`<div>${t}</div>`))}
|
|
3141
3225
|
</div>
|
|
3142
3226
|
|
|
3143
3227
|
<div class="days-grid">
|
|
3144
3228
|
${n.map((()=>e`<div></div>`))}
|
|
3145
|
-
${a.map((t=>{const i=
|
|
3229
|
+
${a.map((t=>{const i=ue(t),o=this.selectedDate?ue(this.selectedDate):null,r=this.minDate&&oi(i,ue(this.minDate))||this.maxDate&&ii(i,ue(this.maxDate)),n=ai(i),a=o&&ti(i)===ti(o),s=a&&o&&ri(i,o)&&ni(i,o);return e`
|
|
3146
3230
|
<button
|
|
3147
3231
|
class="${`day ${n?"today":""} ${s?"selected":a&&!s?"secondary-selected":""}`}"
|
|
3148
3232
|
?disabled=${r}
|
|
3149
3233
|
@click=${()=>this.handleDayClick(t)}
|
|
3150
3234
|
>
|
|
3151
|
-
${
|
|
3235
|
+
${Je(t,"d")}
|
|
3152
3236
|
</button>
|
|
3153
3237
|
`}))}
|
|
3154
3238
|
</div>
|
|
@@ -3165,7 +3249,7 @@ const Yt=o`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
3165
3249
|
<div class="calendar-container" style="width: ${this.calendarWidth}px;">
|
|
3166
3250
|
${i}
|
|
3167
3251
|
</div>
|
|
3168
|
-
`}};a([T({type:Object}),s("design:type",Object)],
|
|
3252
|
+
`}};a([T({type:Object}),s("design:type",Object)],si.prototype,"selectedDate",void 0),a([T({type:Object}),s("design:type",Date)],si.prototype,"viewDate",void 0),a([T({type:Boolean}),s("design:type",Object)],si.prototype,"isMobile",void 0),a([T({type:Number}),s("design:type",Number)],si.prototype,"calendarWidth",void 0),a([T({type:Object}),s("design:type",Object)],si.prototype,"minDate",void 0),a([T({type:Object}),s("design:type",Object)],si.prototype,"maxDate",void 0),a([z(),s("design:type",String)],si.prototype,"currentView",void 0),si=a([d("calendar-overlay")],si);let di=class extends L{constructor(){super(...arguments),this.isRenderClearButton=!0,this.isOpen=!1,this.selectedDate=null,this.viewDate=new Date,this.isMobile=!1,this.calendarWidth=0,this.updateResponsiveModeBound=this.updateResponsiveMode.bind(this),this.handleClickOutside=t=>{t.composedPath().includes(this)||(this.isOpen=!1,this.error&&this.closeOverlay(""))}}static{this.styles=o`
|
|
3169
3253
|
${X}
|
|
3170
3254
|
${Q}
|
|
3171
3255
|
${K}
|
|
@@ -3259,7 +3343,7 @@ const Yt=o`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
3259
3343
|
.calendar-button randstad-icon {
|
|
3260
3344
|
font-size: 18px;
|
|
3261
3345
|
}
|
|
3262
|
-
`}connectedCallback(){super.connectedCallback(),this.updateResponsiveMode(),window.addEventListener("resize",this.updateResponsiveModeBound),document.addEventListener("click",this.handleClickOutside)}disconnectedCallback(){window.removeEventListener("resize",this.updateResponsiveModeBound),document.removeEventListener("click",this.handleClickOutside),super.disconnectedCallback()}firstUpdated(){this.setInitialWidth()}updated(t){t.has("value")&&this._syncValue(this.value),(t.has("isOpen")||t.has("value"))&&this.setInitialWidth(),super.updated(t)}setInitialWidth(){this.inputContainer&&(this.calendarWidth=this.inputContainer.getBoundingClientRect().width)}updateResponsiveMode(){this.isMobile=window.innerWidth<=940,this.setInitialWidth()}handleInput(t){const e=t.target;this._parseAndValidateDate(e.value,!0)}handleCalendarButtonClick(t){this.disabled||(t.stopPropagation(),this.isOpen=!this.isOpen,this.selectedDate?this.viewDate=this.selectedDate:this.viewDate=new Date,this.requestUpdate())}handleClearDate(){this.selectedDate=null,this.error=!1,this.errorMessage=null,this.closeOverlay("")}handleDateSelect(t){const e=t.detail.date;e&&(this.selectedDate=e,this.viewDate=e,this.closeOverlay(
|
|
3346
|
+
`}connectedCallback(){super.connectedCallback(),this.updateResponsiveMode(),window.addEventListener("resize",this.updateResponsiveModeBound),document.addEventListener("click",this.handleClickOutside)}disconnectedCallback(){window.removeEventListener("resize",this.updateResponsiveModeBound),document.removeEventListener("click",this.handleClickOutside),super.disconnectedCallback()}firstUpdated(){this.setInitialWidth()}updated(t){t.has("value")&&this._syncValue(this.value),(t.has("isOpen")||t.has("value"))&&this.setInitialWidth(),super.updated(t)}setInitialWidth(){this.inputContainer&&(this.calendarWidth=this.inputContainer.getBoundingClientRect().width)}updateResponsiveMode(){this.isMobile=window.innerWidth<=940,this.setInitialWidth()}handleInput(t){const e=t.target;this._parseAndValidateDate(e.value,!0)}handleCalendarButtonClick(t){this.disabled||(t.stopPropagation(),this.isOpen=!this.isOpen,this.selectedDate?this.viewDate=this.selectedDate:this.viewDate=new Date,this.requestUpdate())}handleClearDate(){this.selectedDate=null,this.error=!1,this.errorMessage=null,this.closeOverlay("")}handleDateSelect(t){const e=t.detail.date;e&&(this.selectedDate=e,this.viewDate=e,this.closeOverlay(Je(e,"dd-MM-yyyy")))}handleViewDateChange(t){this.viewDate=t.detail.date}closeOverlay(t){this.value=t,this.isOpen=!1,this.dispatchEvent(new CustomEvent("date-selected",{detail:{value:t}}))}_syncValue(t){if(""===t)return void(this.error||(this.selectedDate=null,this.errorMessage=null));const e=this._parseDate(t);e&&this._isWithinBounds(e)?(this.selectedDate=e,this.viewDate=e,this.error=!1,this.errorMessage=null,this.value=Je(e,"dd-MM-yyyy")):(this.selectedDate=null,this.error=!0,this.errorMessage="Formato de fecha no válido o fuera de rango. Se esperaba 'dd-MM-yyyy'.")}_parseAndValidateDate(t,e){if(this.disabled)return;if(""===t)return this.selectedDate=null,this.error=!1,this.errorMessage=null,void(e&&this.closeOverlay(""));const i=this._parseDate(t);if(i)if(this._isWithinBounds(i))this.selectedDate=i,this.viewDate=i,this.error=!1,this.errorMessage=null,e&&this.closeOverlay(Je(i,"dd-MM-yyyy"));else{this.error=!0;const t=this._getValidDateRange();this.errorMessage=`La fecha debe estar entre ${t?.minDate?Je(t.minDate,"dd-MM-yyyy"):"el inicio de los tiempos"} y ${t?.maxDate?Je(t.maxDate,"dd-MM-yyyy"):"el fin de los tiempos"}.`,e&&this.closeOverlay(""),console.error("La fecha está fuera del rango permitido.")}else this.error=!0,this.errorMessage="Formato de fecha no válido. Se esperaba 'dd-MM-yyyy' o 'yyyy-MM-dd'.",e&&this.closeOverlay(""),console.error("Formato de fecha no válido.")}_parseDate(t){const e=t.split("-").map(Number);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(me(e)&&Je(e,"dd-MM-yyyy")===t)return e}}const i=t.split("-").map(Number);if(3===i.length){const[t,e,o]=i;if(t&&e&&o&&e>=1&&e<=12&&t>1e3){const i=new Date(t,e-1,o,12);if(me(i))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&&ii(t,e)?null:{minDate:t,maxDate:e}:{minDate:null,maxDate:null}}_isWithinBounds(t){const e=this._getValidDateRange();return!e||(!e.minDate||!oi(t,e.minDate))&&(!e.maxDate||!ii(t,e.maxDate))}render(){const t=n({"input-wrapper":!0,active:this.isOpen,error:this.error,disabled:this.disabled}),o=`width: ${this.width||"100%"};`,r=this._getValidDateRange();return e`
|
|
3263
3347
|
<div class="datepicker-container" style="${this.labelColor?` --label-color: ${this.labelColor}`:""} ${o}">
|
|
3264
3348
|
${this.renderLabelContainer()}
|
|
3265
3349
|
|
|
@@ -3311,10 +3395,11 @@ const Yt=o`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
3311
3395
|
|
|
3312
3396
|
${this.renderHelper()}
|
|
3313
3397
|
</div>
|
|
3314
|
-
`}};a([T({type:String}),s("design:type",String)],
|
|
3398
|
+
`}};a([T({type:String}),s("design:type",String)],di.prototype,"width",void 0),a([T({type:Boolean}),s("design:type",Object)],di.prototype,"isRenderClearButton",void 0),a([T({type:String}),s("design:type",String)],di.prototype,"minDate",void 0),a([T({type:String}),s("design:type",String)],di.prototype,"maxDate",void 0),a([z(),s("design:type",Object)],di.prototype,"isOpen",void 0),a([z(),s("design:type",Object)],di.prototype,"selectedDate",void 0),a([z(),s("design:type",Date)],di.prototype,"viewDate",void 0),a([z(),s("design:type",Object)],di.prototype,"isMobile",void 0),a([z(),s("design:type",Number)],di.prototype,"calendarWidth",void 0),a([A(".input-container"),s("design:type",HTMLDivElement)],di.prototype,"inputContainer",void 0),di=a([d("datepicker-component")],di);const li={"application/pdf":"PDF","application/msword":"Word (.doc)","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"Word (.docx)","image/jpeg":"JPEG","image/png":"PNG","text/plain":"Texto (.txt)"};let ci=class extends L{constructor(){super(...arguments),this.files=[],this.maxFiles=1,this.acceptedFileTypes=[],this.maxFileSize=5242880,this.buttonText="Agregar archivo",this.simulatedDelay=0,this.loading=!1,this.progress=0}static{this.styles=o`
|
|
3315
3399
|
${X}
|
|
3316
3400
|
${Q}
|
|
3317
3401
|
${K}
|
|
3402
|
+
${Zt}
|
|
3318
3403
|
|
|
3319
3404
|
:host([width]) {
|
|
3320
3405
|
width: var(--upload-file-width);
|
|
@@ -3367,17 +3452,29 @@ const Yt=o`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
3367
3452
|
.remove-file-button {
|
|
3368
3453
|
--primary-color: var(--ui-negative, #E00F0F);
|
|
3369
3454
|
}
|
|
3370
|
-
|
|
3455
|
+
|
|
3456
|
+
.progress-bar {
|
|
3457
|
+
width: 100%;
|
|
3458
|
+
}
|
|
3459
|
+
`}updated(t){super.updated(t),this.applyWidth()}applyWidth(){this.width&&this.style.setProperty("--upload-file-width",this.width)}getReadableFileTypes(){const t=this.acceptedFileTypes.map((t=>li[t]||t));if(t.length<=1)return t.join("");const e=t.pop();return`${t.join(", ")} y ${e}`}validateFiles(t){const e=this.maxFileSize/1024/1024;for(const i of t){if(this.acceptedFileTypes.length>0&&!this.acceptedFileTypes.includes(i.type))return this.errorMessage=`Formato de archivo no válido. Se aceptan: ${this.getReadableFileTypes()}.`,!1;if(i.size>this.maxFileSize)return this.errorMessage=`El archivo es demasiado grande. El tamaño máximo es de ${e}MB.`,!1}return!0}async handleFiles(t){if(this.error=!1,this.errorMessage=null,!t||this.disabled||this.loading)return;const e=Number.isFinite(this.maxFiles)&&this.maxFiles>0?this.maxFiles:1,i=Array.from(t),o=e-this.files.length;if(o<=0)return this.error=!0,void(this.errorMessage=`Se ha alcanzado el número máximo de archivos (${e}).`);const r=i.slice(0,o);if(!this.validateFiles(r))return void(this.error=!0);const n=this.simulatedDelay??0;if(n<=0)return this.files=[...this.files,...r],void this.dispatchEvent(new CustomEvent("files-changed",{detail:this.files}));this.loading=!0,this.progress=0,await this.updateComplete;const a=Date.now(),s=setInterval((()=>{const t=Date.now()-a,e=Math.min(Math.round(t/n*100),100);this.progress=e,this.progress>=100&&(clearInterval(s),this.files=[...this.files,...r],this.loading=!1,this.progress=0,this.dispatchEvent(new CustomEvent("files-changed",{detail:this.files})))}),10);this.fileInput&&(this.fileInput.value="")}onFileInputChange(t){const e=t.target;this.handleFiles(e.files),this.fileInput&&(this.fileInput.value="")}removeFile(t){this.files=this.files.filter(((e,i)=>i!==t)),this.dispatchEvent(new CustomEvent("files-changed",{detail:this.files})),0===this.files.length&&(this.error=!1,this.errorMessage=null)}render(){const t=this.files.length>=this.maxFiles,o=this.disabled||t;return e`
|
|
3371
3460
|
<div class="file-container" style="${this.labelColor?`--label-color: ${this.labelColor};`:""}">
|
|
3372
3461
|
${this.renderLabelContainer()}
|
|
3373
3462
|
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3463
|
+
${this.loading?e`
|
|
3464
|
+
<div class="progress-bar-container">
|
|
3465
|
+
<div class="progress-bar" role="progressbar" aria-label="Subiendo archivo…">
|
|
3466
|
+
<div class="progress-bar-fill" style="width: ${this.progress}%;"></div>
|
|
3467
|
+
</div>
|
|
3468
|
+
</div>
|
|
3469
|
+
`:e`
|
|
3470
|
+
<randstad-button
|
|
3471
|
+
.label=${this.buttonText}
|
|
3472
|
+
.variant=${"button-primary"}
|
|
3473
|
+
?disabled=${o}
|
|
3474
|
+
@click=${()=>this.fileInput?.click()}
|
|
3475
|
+
>
|
|
3476
|
+
</randstad-button>
|
|
3477
|
+
`}
|
|
3381
3478
|
|
|
3382
3479
|
<input
|
|
3383
3480
|
type="file"
|
|
@@ -3412,5 +3509,5 @@ const Yt=o`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
3412
3509
|
</div>
|
|
3413
3510
|
`:i}
|
|
3414
3511
|
</div>
|
|
3415
|
-
`}};a([T({type:String}),s("design:type",String)],
|
|
3512
|
+
`}};a([T({type:String}),s("design:type",String)],ci.prototype,"width",void 0),a([T({type:Array}),s("design:type",Array)],ci.prototype,"files",void 0),a([T({type:Number}),s("design:type",Object)],ci.prototype,"maxFiles",void 0),a([T({type:Array}),s("design:type",Array)],ci.prototype,"acceptedFileTypes",void 0),a([T({type:Number}),s("design:type",Object)],ci.prototype,"maxFileSize",void 0),a([T({type:String}),s("design:type",Object)],ci.prototype,"buttonText",void 0),a([T({type:Number}),s("design:type",Object)],ci.prototype,"simulatedDelay",void 0),a([z(),s("design:type",Object)],ci.prototype,"loading",void 0),a([z(),s("design:type",Object)],ci.prototype,"progress",void 0),a([A('input[type="file"]'),s("design:type",HTMLInputElement)],ci.prototype,"fileInput",void 0),ci=a([d("upload-file")],ci);export{Y as AccordionList,W as AccordionPanel,L as BaseControl,si as CalendarOverlay,H as CarouselCard,G as Checkbox,it as CustomModal,ot as CustomPopup,Ht as CustomRadio,Qt as CustomStepper,di as DatePickerComponent,Gt as FilterableSelect,Z as FormGroup,tt as IconComponent,rt as ProgressCircle,U as RandstadButton,J as RandstadForm,et as RandstadNotice,Jt as TabsBar,ci as UploadFile,te as UploadImage};
|
|
3416
3513
|
//# sourceMappingURL=index.js.map
|