@randstad-uca/design-system 1.0.22 → 1.0.24
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/assets/icons/arrow_back.svg +10 -0
- package/dist/components/Button.d.ts +1 -1
- package/dist/components/Form.d.ts +1 -0
- package/dist/components/Select.d.ts +2 -0
- package/dist/index.js +112 -48
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -2
- package/dist/stories/Button.stories.d.ts +3 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9,23 +9,23 @@ const l=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 u=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==p)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(c&&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 b=(t,e)=>{if(c)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of e){const e=document.createElement("style"),o=d.litNonce;void 0!==o&&e.setAttribute("nonce",o),e.textContent=i.cssText,t.appendChild(e)}},y=c?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new u("string"==typeof t?t:t+"",void 0,p))(e)})(t):t,{is:m,defineProperty:
|
|
12
|
+
*/let u=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==p)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(c&&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 b=(t,e)=>{if(c)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of e){const e=document.createElement("style"),o=d.litNonce;void 0!==o&&e.setAttribute("nonce",o),e.textContent=i.cssText,t.appendChild(e)}},y=c?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new u("string"==typeof t?t:t+"",void 0,p))(e)})(t):t,{is:m,defineProperty:g,getOwnPropertyDescriptor:f,getOwnPropertyNames:v,getOwnPropertySymbols:x,getPrototypeOf:w}=Object,k=globalThis,$=k.trustedTypes,S=$?$.emptyScript:"",C=k.reactiveElementPolyfillSupport,E=(t,e)=>t,O={toAttribute(t,e){switch(e){case Boolean:t=t?S: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}},P=(t,e)=>!m(t,e),T={attribute:!0,type:String,converter:O,reflect:!1,useDefault:!1,hasChanged:P};
|
|
13
13
|
/**
|
|
14
14
|
* @license
|
|
15
15
|
* Copyright 2017 Google LLC
|
|
16
16
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
|
-
*/Symbol.metadata??=Symbol("metadata"),k.litPropertyMetadata??=new WeakMap;class A 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=T){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&&
|
|
17
|
+
*/Symbol.metadata??=Symbol("metadata"),k.litPropertyMetadata??=new WeakMap;class A 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=T){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&&g(this.prototype,t,o)}}static getPropertyDescriptor(t,e,i){const{get:o,set:r}=f(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)??T}static _$Ei(){if(this.hasOwnProperty(E("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(E("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(E("properties"))){const t=this.properties,e=[...v(t),...x(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(y(t))}else void 0!==t&&e.push(y(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 b(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:O).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:O;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??P)(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){}}A.elementStyles=[],A.shadowRootOptions={mode:"open"},A[E("elementProperties")]=new Map,A[E("finalized")]=new Map,C?.({ReactiveElement:A}),(k.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 z={attribute:!0,type:String,converter:O,reflect:!1,hasChanged:P},
|
|
23
|
+
const z={attribute:!0,type:String,converter:O,reflect:!1,hasChanged:P},I=(t=z,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 j(t){return(e,i)=>"object"==typeof i?I(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
|
|
27
27
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
|
-
*/function L(t){return
|
|
28
|
+
*/function L(t){return j({...t,state:!0,attribute:!1})}
|
|
29
29
|
/**
|
|
30
30
|
* @license
|
|
31
31
|
* Copyright 2017 Google LLC
|
|
@@ -54,13 +54,13 @@ function _(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
54
54
|
font-size: 16px;
|
|
55
55
|
line-height: 25px;
|
|
56
56
|
letter-spacing: 0%;
|
|
57
|
-
`,
|
|
57
|
+
`,U=t`
|
|
58
58
|
font-family: 'Graphik', sans-serif;
|
|
59
59
|
font-weight: 400;
|
|
60
60
|
font-size: 18px;
|
|
61
61
|
line-height: 30px;
|
|
62
62
|
letter-spacing: 0%;
|
|
63
|
-
`,
|
|
63
|
+
`,B=t`
|
|
64
64
|
font-family: 'Graphik', sans-serif;
|
|
65
65
|
font-weight: 400;
|
|
66
66
|
font-size: 18px;
|
|
@@ -81,7 +81,7 @@ function _(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
81
81
|
line-height: 30px;
|
|
82
82
|
letter-spacing: -1%;
|
|
83
83
|
vertical-align: middle;
|
|
84
|
-
`;let
|
|
84
|
+
`;let D=class extends e{constructor(){super(...arguments),this.variant="button-primary",this.size="md",this.label="",this.loader=!1,this.iconPosition="left",this.disabled=!1,this.iconName=null,this.type="button"}static{this.styles=t`
|
|
85
85
|
:host {
|
|
86
86
|
display: inline-block;
|
|
87
87
|
}
|
|
@@ -101,7 +101,7 @@ function _(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
.button-lg {
|
|
104
|
-
${
|
|
104
|
+
${U}
|
|
105
105
|
min-height: 62px;
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -269,6 +269,41 @@ function _(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
269
269
|
border: none;
|
|
270
270
|
color: var(--white);
|
|
271
271
|
}
|
|
272
|
+
|
|
273
|
+
.button-card {
|
|
274
|
+
font-family: 'Graphik';
|
|
275
|
+
background-color: var(--primary-color);
|
|
276
|
+
color: var(--white);
|
|
277
|
+
border-radius: 4px;
|
|
278
|
+
padding: 4px 16px;
|
|
279
|
+
font-weight: 400;
|
|
280
|
+
font-size: 12px;
|
|
281
|
+
line-height: 15px;
|
|
282
|
+
letter-spacing: 0%;
|
|
283
|
+
text-align: center;
|
|
284
|
+
vertical-align: middle;
|
|
285
|
+
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.button-card:not([disabled]):hover {
|
|
289
|
+
background-color: #175197;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.button-card:not([disabled]):active {
|
|
293
|
+
background-color: #124077;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.button-card:not([disabled]):focus-visible {
|
|
297
|
+
outline: 2px solid var(--primary-color);
|
|
298
|
+
outline-offset: 2px;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.button-card[disabled] {
|
|
302
|
+
background-color: #CFD1D9;
|
|
303
|
+
color: #6F758D;
|
|
304
|
+
cursor: not-allowed;
|
|
305
|
+
}
|
|
306
|
+
|
|
272
307
|
`}handleClick(t){if(!this.disabled)if("submit"===this.type){const t=this.closest("form");t&&t.requestSubmit()}else this.dispatchEvent(new CustomEvent("button-click",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("click",{bubbles:!0,composed:!0}))}render(){const t={button:!0,[`button-${this.size}`]:"button-round"!==this.variant,[this.variant]:!0,loader:this.loader},e="button-tertiary"===this.variant?"var(--primary-color)":"white";return i`
|
|
273
308
|
<button
|
|
274
309
|
part="button"
|
|
@@ -291,7 +326,7 @@ function _(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
291
326
|
${this.iconName&&"button-round"!==this.variant&&"right"===this.iconPosition?i`<randstad-icon name=${this.iconName} size="24px"></randstad-icon>`:""}
|
|
292
327
|
`}
|
|
293
328
|
</button>
|
|
294
|
-
`}};n([
|
|
329
|
+
`}};n([j({type:String}),a("design:type",String)],D.prototype,"variant",void 0),n([j({type:String}),a("design:type",String)],D.prototype,"size",void 0),n([j({type:String}),a("design:type",Object)],D.prototype,"label",void 0),n([j({type:Boolean}),a("design:type",Object)],D.prototype,"loader",void 0),n([j({type:String,attribute:"icon-src"}),a("design:type",String)],D.prototype,"iconSrc",void 0),n([j({type:String}),a("design:type",String)],D.prototype,"iconPosition",void 0),n([j({type:Boolean,reflect:!0}),a("design:type",Boolean)],D.prototype,"disabled",void 0),n([j({type:String}),a("design:type",Object)],D.prototype,"iconName",void 0),n([j({type:String}),a("design:type",String)],D.prototype,"type",void 0),D=n([l("randstad-button")],D);let q=class extends e{constructor(){super(...arguments),this.prefix="Acepto los",this.clause1Text="términos y condiciones",this.connector="y los",this.clause2Text="avisos de privacidad del sitio",this.checked=!1}static{this.styles=t`
|
|
295
330
|
:host {
|
|
296
331
|
display: block;
|
|
297
332
|
max-width: 100%;
|
|
@@ -345,7 +380,7 @@ function _(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
345
380
|
text-decoration: none;
|
|
346
381
|
cursor: pointer;
|
|
347
382
|
}
|
|
348
|
-
`}toggleCheck(t){this.checked=t.target.checked,this.dispatchEvent(new
|
|
383
|
+
`}toggleCheck(t){this.checked=t.target.checked,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("click",{bubbles:!0,composed:!0}))}renderClause(t,e){return e?i`<a class="terms-link" href="${e}" target="_blank" rel="noopener" @click=${this.stopPropagation}>${t}</a>`:i`${t}`}stopPropagation(t){t.stopPropagation()}render(){return i`
|
|
349
384
|
<label>
|
|
350
385
|
<input
|
|
351
386
|
type="checkbox"
|
|
@@ -361,7 +396,7 @@ function _(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
361
396
|
${this.renderClause(this.clause2Text,this.clause2Url)}.
|
|
362
397
|
</span>
|
|
363
398
|
</label>
|
|
364
|
-
`}};n([
|
|
399
|
+
`}};n([j({type:String}),a("design:type",Object)],q.prototype,"prefix",void 0),n([j({type:String}),a("design:type",Object)],q.prototype,"clause1Text",void 0),n([j({type:String}),a("design:type",String)],q.prototype,"clause1Url",void 0),n([j({type:String}),a("design:type",Object)],q.prototype,"connector",void 0),n([j({type:String}),a("design:type",Object)],q.prototype,"clause2Text",void 0),n([j({type:String}),a("design:type",String)],q.prototype,"clause2Url",void 0),n([j({type:Boolean,reflect:!0}),a("design:type",Object)],q.prototype,"checked",void 0),q=n([l("randstad-checkbox")],q);let G=class extends e{constructor(){super(...arguments),this.value="",this.size="md",this.icon=null,this.helper=null,this.error=!1,this.errorMessage="",this.disabled=!1,this.typing=!1,this.type="text",this.isPasswordVisible=!1,this.cleanButton=!1}static{this.styles=t`
|
|
365
400
|
:host {
|
|
366
401
|
display: block;
|
|
367
402
|
font-family: 'Graphik', sans-serif;
|
|
@@ -395,7 +430,7 @@ function _(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
395
430
|
}
|
|
396
431
|
|
|
397
432
|
.form-input {
|
|
398
|
-
${
|
|
433
|
+
${U}
|
|
399
434
|
padding: 16px;
|
|
400
435
|
border: 1px solid var(--secondary-color-10);
|
|
401
436
|
border-radius: 4px;
|
|
@@ -430,7 +465,7 @@ function _(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
430
465
|
}
|
|
431
466
|
|
|
432
467
|
input::placeholder {
|
|
433
|
-
${
|
|
468
|
+
${U}
|
|
434
469
|
color: var(--secondary-color-40);
|
|
435
470
|
}
|
|
436
471
|
|
|
@@ -468,7 +503,7 @@ function _(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
468
503
|
}
|
|
469
504
|
|
|
470
505
|
textarea {
|
|
471
|
-
${
|
|
506
|
+
${U}
|
|
472
507
|
resize: none;
|
|
473
508
|
}
|
|
474
509
|
|
|
@@ -582,7 +617,7 @@ function _(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
582
617
|
visibility: visible;
|
|
583
618
|
opacity: 1;
|
|
584
619
|
}
|
|
585
|
-
`}togglePassword(t){this.isPasswordVisible=!this.isPasswordVisible;const e=t.currentTarget.parentElement?.querySelector("input");e&&(e.type=this.isPasswordVisible?"text":"password"),this.requestUpdate()}handleInput(t){const e=t.target.value;void 0!==this.maxLength&&"textarea"!==this.type?this.value=e.slice(0,this.maxLength):this.value=e,this.dispatchEvent(new CustomEvent("valueChanged",{detail:this.value})),this.dispatchEvent(new Event("input",{bubbles:!0})),this.requestUpdate()}handleClear(){this.value="",this.dispatchEvent(new CustomEvent("valueChanged",{detail:this.value})),this.dispatchEvent(new Event("input",{bubbles:!0})),this.requestUpdate()}handleLinkClick(t){t.preventDefault(),this.linkRoute&&this.dispatchEvent(new CustomEvent("linkClicked",{detail:this.linkRoute,bubbles:!0,composed:!0}))}render(){const t=this.cleanButton&&this.value&&"password"!==this.type&&"textarea"!==this.type;return i`
|
|
620
|
+
`}togglePassword(t){this.isPasswordVisible=!this.isPasswordVisible;const e=t.currentTarget.parentElement?.querySelector("input");e&&(e.type=this.isPasswordVisible?"text":"password"),this.requestUpdate()}handleInput(t){const e=t.target.value;void 0!==this.maxLength&&"textarea"!==this.type?this.value=e.slice(0,this.maxLength):this.value=e,this.dispatchEvent(new CustomEvent("valueChanged",{detail:this.value})),this.dispatchEvent(new Event("input",{bubbles:!0})),this.requestUpdate()}handleClear(){this.value="",this.dispatchEvent(new CustomEvent("valueChanged",{detail:this.value})),this.dispatchEvent(new Event("input",{bubbles:!0})),this.requestUpdate()}handleLinkClick(t){t.preventDefault(),this.linkRoute&&this.dispatchEvent(new CustomEvent("linkClicked",{detail:this.linkRoute,bubbles:!0,composed:!0}))}handleKeyDown(t){if("Enter"===t.key){const t=new Event("submit",{bubbles:!0,composed:!0,cancelable:!0}),e=this.closest("form");e&&e.dispatchEvent(t)}}render(){const t=this.cleanButton&&this.value&&"password"!==this.type&&"textarea"!==this.type;return i`
|
|
586
621
|
<div
|
|
587
622
|
class="form ${this.error?"error":""} ${this.disabled?"disabled":""}"
|
|
588
623
|
style=${this.labelColor?`--label-color: ${this.labelColor}`:o}
|
|
@@ -607,6 +642,8 @@ function _(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
607
642
|
.value=${this.value}
|
|
608
643
|
?disabled=${this.disabled}
|
|
609
644
|
@input=${this.handleInput}
|
|
645
|
+
@keydown=${this.handleKeyDown}
|
|
646
|
+
maxlength=${this.maxLength??o}
|
|
610
647
|
></textarea>`:i`
|
|
611
648
|
<input
|
|
612
649
|
class="form-input"
|
|
@@ -615,6 +652,7 @@ function _(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
615
652
|
.value=${this.value}
|
|
616
653
|
?disabled=${this.disabled}
|
|
617
654
|
@input=${this.handleInput}
|
|
655
|
+
@keydown=${this.handleKeyDown}
|
|
618
656
|
maxlength=${this.maxLength??o}
|
|
619
657
|
/>
|
|
620
658
|
|
|
@@ -642,7 +680,7 @@ function _(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
642
680
|
|
|
643
681
|
${this.helper?i`<p class="helper-description">${this.helper}</p>`:o}
|
|
644
682
|
</div>
|
|
645
|
-
`}};n([
|
|
683
|
+
`}};n([j({type:String}),a("design:type",String)],G.prototype,"placeholder",void 0),n([j({type:String}),a("design:type",String)],G.prototype,"label",void 0),n([j({type:String}),a("design:type",String)],G.prototype,"labelColor",void 0),n([j({type:String}),a("design:type",String)],G.prototype,"value",void 0),n([j({type:String}),a("design:type",String)],G.prototype,"size",void 0),n([j({type:String}),a("design:type",Object)],G.prototype,"icon",void 0),n([j({type:String}),a("design:type",Object)],G.prototype,"helper",void 0),n([j({type:Boolean}),a("design:type",Boolean)],G.prototype,"error",void 0),n([j({type:String}),a("design:type",String)],G.prototype,"errorMessage",void 0),n([j({type:Boolean}),a("design:type",Boolean)],G.prototype,"disabled",void 0),n([j({type:Boolean}),a("design:type",Boolean)],G.prototype,"typing",void 0),n([j({type:String}),a("design:type",String)],G.prototype,"type",void 0),n([j({type:String}),a("design:type",String)],G.prototype,"tooltipMessage",void 0),n([j({type:String}),a("design:type",String)],G.prototype,"linkText",void 0),n([j({type:String}),a("design:type",String)],G.prototype,"linkRoute",void 0),n([j({type:Boolean,reflect:!0}),a("design:type",Object)],G.prototype,"isPasswordVisible",void 0),n([j({type:Boolean}),a("design:type",Boolean)],G.prototype,"cleanButton",void 0),n([j({type:Number}),a("design:type",Number)],G.prototype,"maxLength",void 0),G=n([l("randstad-form")],G);class K extends e{constructor(){super(...arguments),this.name="",this.size="24px"}static{this.styles=t`
|
|
646
684
|
:host {
|
|
647
685
|
display: inline-flex;
|
|
648
686
|
width: var(--icon-size, 24px);
|
|
@@ -656,7 +694,7 @@ function _(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
656
694
|
height: var(--icon-size, 24px);
|
|
657
695
|
fill: var(--icon-color, currentColor);
|
|
658
696
|
}
|
|
659
|
-
`}connectedCallback(){super.connectedCallback(),this.style.setProperty("--icon-size",this.size)}updated(t){t.has("size")&&this.style.setProperty("--icon-size",this.size)}async loadIcon(){try{const t=await fetch(`/assets/icons/${this.name}.svg`);if(!t.ok)throw new Error("Icon not found");const e=await t.text(),i=new DOMParser,o=i.parseFromString(e,"image/svg+xml").querySelector("svg");if(!o)throw new Error("No se encontró un elemento SVG válido");o.removeAttribute("fill"),o.setAttribute("width",this.size),o.setAttribute("height",this.size),o.querySelectorAll("[fill]").forEach((t=>t.removeAttribute("fill"))),o.setAttribute("fill","currentColor"),"innerHTML"in this.renderRoot&&(this.renderRoot.innerHTML=""),this.renderRoot.appendChild(o)}catch(t){console.error(`❌ Error cargando icono ${this.name}:`,t),"innerHTML"in this.renderRoot&&(this.renderRoot.innerHTML="<span>⚠️</span>")}}render(){return this.loadIcon(),null}}n([
|
|
697
|
+
`}connectedCallback(){super.connectedCallback(),this.style.setProperty("--icon-size",this.size)}updated(t){t.has("size")&&this.style.setProperty("--icon-size",this.size)}async loadIcon(){try{const t=await fetch(`/assets/icons/${this.name}.svg`);if(!t.ok)throw new Error("Icon not found");const e=await t.text(),i=new DOMParser,o=i.parseFromString(e,"image/svg+xml").querySelector("svg");if(!o)throw new Error("No se encontró un elemento SVG válido");o.removeAttribute("fill"),o.setAttribute("width",this.size),o.setAttribute("height",this.size),o.querySelectorAll("[fill]").forEach((t=>t.removeAttribute("fill"))),o.setAttribute("fill","currentColor"),"innerHTML"in this.renderRoot&&(this.renderRoot.innerHTML=""),this.renderRoot.appendChild(o)}catch(t){console.error(`❌ Error cargando icono ${this.name}:`,t),"innerHTML"in this.renderRoot&&(this.renderRoot.innerHTML="<span>⚠️</span>")}}render(){return this.loadIcon(),null}}n([j({type:String}),a("design:type",Object)],K.prototype,"name",void 0),n([j({type:String}),a("design:type",Object)],K.prototype,"size",void 0),customElements.define("randstad-icon",K);let H=class extends e{constructor(){super(...arguments),this.type="informative",this.icon="info",this.message="Este es un mensaje.",this.open=!1}static{this.styles=t`
|
|
660
698
|
:host {
|
|
661
699
|
display: block;
|
|
662
700
|
font-family: 'Graphik', sans-serif;
|
|
@@ -709,7 +747,7 @@ function _(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
709
747
|
<randstad-icon class="icon" name="${this.icon}" size="24px" style="color: var(--icon-color);"></randstad-icon>
|
|
710
748
|
<span class="message">${this.message}</span>
|
|
711
749
|
</div>
|
|
712
|
-
`}};n([
|
|
750
|
+
`}};n([j({type:String}),a("design:type",String)],H.prototype,"type",void 0),n([j({type:String}),a("design:type",String)],H.prototype,"icon",void 0),n([j({type:String}),a("design:type",String)],H.prototype,"message",void 0),n([j({type:Boolean}),a("design:type",Boolean)],H.prototype,"open",void 0),H=n([l("randstad-notice")],H);let Y=class extends e{constructor(){super(...arguments),this.open=!1,this.title="Título del modal",this.scrollable=!1,this.showNotice=!1,this.noticeType="informative",this.noticeMessage="",this.noticeIcon="info",this.showPrimaryButton=!1,this.primaryButtonLabel="Aceptar",this.showSecondaryButton=!1,this.secondaryButtonLabel="Cancelar"}static{this.styles=t`
|
|
713
751
|
:host {
|
|
714
752
|
font-family: 'Graphik', sans-serif;
|
|
715
753
|
display: none;
|
|
@@ -894,7 +932,7 @@ function _(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
894
932
|
</div>
|
|
895
933
|
</div>
|
|
896
934
|
</div>
|
|
897
|
-
`}};n([
|
|
935
|
+
`}};n([j({type:Boolean,reflect:!0}),a("design:type",Object)],Y.prototype,"open",void 0),n([j({type:String}),a("design:type",Object)],Y.prototype,"title",void 0),n([j({type:String}),a("design:type",String)],Y.prototype,"subtitle",void 0),n([j({type:Boolean}),a("design:type",Object)],Y.prototype,"scrollable",void 0),n([j({type:Boolean}),a("design:type",Object)],Y.prototype,"showNotice",void 0),n([j({type:String}),a("design:type",String)],Y.prototype,"noticeType",void 0),n([j({type:String}),a("design:type",Object)],Y.prototype,"noticeMessage",void 0),n([j({type:String}),a("design:type",Object)],Y.prototype,"noticeIcon",void 0),n([j({type:Boolean}),a("design:type",Object)],Y.prototype,"showPrimaryButton",void 0),n([j({type:String}),a("design:type",Object)],Y.prototype,"primaryButtonLabel",void 0),n([j({type:Boolean}),a("design:type",Object)],Y.prototype,"showSecondaryButton",void 0),n([j({type:String}),a("design:type",Object)],Y.prototype,"secondaryButtonLabel",void 0),Y=n([l("custom-modal")],Y);let W=class extends e{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"}static{this.styles=t`
|
|
898
936
|
:host {
|
|
899
937
|
display: none;
|
|
900
938
|
position: fixed;
|
|
@@ -1011,7 +1049,7 @@ function _(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
1011
1049
|
`}
|
|
1012
1050
|
</div>
|
|
1013
1051
|
</div>
|
|
1014
|
-
`}};n([
|
|
1052
|
+
`}};n([j({type:Boolean,reflect:!0}),a("design:type",Object)],W.prototype,"open",void 0),n([j({type:String}),a("design:type",Object)],W.prototype,"type",void 0),n([j({type:String}),a("design:type",Object)],W.prototype,"icon",void 0),n([j({type:String}),a("design:type",Object)],W.prototype,"title",void 0),n([j({type:String}),a("design:type",Object)],W.prototype,"description",void 0),n([j({type:String}),a("design:type",Object)],W.prototype,"width",void 0),n([j({type:String}),a("design:type",Object)],W.prototype,"buttonText",void 0),n([j({type:String}),a("design:type",Object)],W.prototype,"confirmText",void 0),n([j({type:String}),a("design:type",Object)],W.prototype,"cancelText",void 0),W=n([l("custom-popup")],W);
|
|
1015
1053
|
/**
|
|
1016
1054
|
* @license
|
|
1017
1055
|
* Copyright 2023 Google LLC
|
|
@@ -1022,7 +1060,7 @@ const X=Symbol("attachableController");let J;r||(J=new MutationObserver((t=>{for
|
|
|
1022
1060
|
* @license
|
|
1023
1061
|
* Copyright 2021 Google LLC
|
|
1024
1062
|
* SPDX-License-Identifier: Apache-2.0
|
|
1025
|
-
*/const Z=["focusin","focusout","pointerdown"];class tt extends e{constructor(){super(...arguments),this.visible=!1,this.inward=!1,this.attachableController=new Q(this,this.onControlChange.bind(this))}get htmlFor(){return this.attachableController.htmlFor}set htmlFor(t){this.attachableController.htmlFor=t}get control(){return this.attachableController.control}set control(t){this.attachableController.control=t}attach(t){this.attachableController.attach(t)}detach(){this.attachableController.detach()}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}handleEvent(t){if(!t[et]){switch(t.type){default:return;case"focusin":this.visible=this.control?.matches(":focus-visible")??!1;break;case"focusout":case"pointerdown":this.visible=!1}t[et]=!0}}onControlChange(t,e){if(!r)for(const i of Z)t?.removeEventListener(i,this),e?.addEventListener(i,this)}update(t){t.has("visible")&&this.dispatchEvent(new Event("visibility-changed")),super.update(t)}}n([
|
|
1063
|
+
*/const Z=["focusin","focusout","pointerdown"];class tt extends e{constructor(){super(...arguments),this.visible=!1,this.inward=!1,this.attachableController=new Q(this,this.onControlChange.bind(this))}get htmlFor(){return this.attachableController.htmlFor}set htmlFor(t){this.attachableController.htmlFor=t}get control(){return this.attachableController.control}set control(t){this.attachableController.control=t}attach(t){this.attachableController.attach(t)}detach(){this.attachableController.detach()}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}handleEvent(t){if(!t[et]){switch(t.type){default:return;case"focusin":this.visible=this.control?.matches(":focus-visible")??!1;break;case"focusout":case"pointerdown":this.visible=!1}t[et]=!0}}onControlChange(t,e){if(!r)for(const i of Z)t?.removeEventListener(i,this),e?.addEventListener(i,this)}update(t){t.has("visible")&&this.dispatchEvent(new Event("visibility-changed")),super.update(t)}}n([j({type:Boolean,reflect:!0})],tt.prototype,"visible",void 0),n([j({type:Boolean,reflect:!0})],tt.prototype,"inward",void 0);const et=Symbol("handledByFocusRing"),it=t`:host{animation-delay:0s,calc(var(--md-focus-ring-duration, 600ms)*.25);animation-duration:calc(var(--md-focus-ring-duration, 600ms)*.25),calc(var(--md-focus-ring-duration, 600ms)*.75);animation-timing-function:cubic-bezier(0.2, 0, 0, 1);box-sizing:border-box;color:var(--md-focus-ring-color, var(--md-sys-color-secondary, #625b71));display:none;pointer-events:none;position:absolute}:host([visible]){display:flex}:host(:not([inward])){animation-name:outward-grow,outward-shrink;border-end-end-radius:calc(var(--md-focus-ring-shape-end-end, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) + var(--md-focus-ring-outward-offset, 2px));border-end-start-radius:calc(var(--md-focus-ring-shape-end-start, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) + var(--md-focus-ring-outward-offset, 2px));border-start-end-radius:calc(var(--md-focus-ring-shape-start-end, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) + var(--md-focus-ring-outward-offset, 2px));border-start-start-radius:calc(var(--md-focus-ring-shape-start-start, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) + var(--md-focus-ring-outward-offset, 2px));inset:calc(-1*var(--md-focus-ring-outward-offset, 2px));outline:var(--md-focus-ring-width, 3px) solid currentColor}:host([inward]){animation-name:inward-grow,inward-shrink;border-end-end-radius:calc(var(--md-focus-ring-shape-end-end, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) - var(--md-focus-ring-inward-offset, 0px));border-end-start-radius:calc(var(--md-focus-ring-shape-end-start, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) - var(--md-focus-ring-inward-offset, 0px));border-start-end-radius:calc(var(--md-focus-ring-shape-start-end, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) - var(--md-focus-ring-inward-offset, 0px));border-start-start-radius:calc(var(--md-focus-ring-shape-start-start, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) - var(--md-focus-ring-inward-offset, 0px));border:var(--md-focus-ring-width, 3px) solid currentColor;inset:var(--md-focus-ring-inward-offset, 0px)}@keyframes outward-grow{from{outline-width:0}to{outline-width:var(--md-focus-ring-active-width, 8px)}}@keyframes outward-shrink{from{outline-width:var(--md-focus-ring-active-width, 8px)}}@keyframes inward-grow{from{border-width:0}to{border-width:var(--md-focus-ring-active-width, 8px)}}@keyframes inward-shrink{from{border-width:var(--md-focus-ring-active-width, 8px)}}@media(prefers-reduced-motion){:host{animation:none}}
|
|
1026
1064
|
`
|
|
1027
1065
|
/**
|
|
1028
1066
|
* @license
|
|
@@ -1044,7 +1082,7 @@ const rt="cubic-bezier(0.2, 0, 0, 1)";
|
|
|
1044
1082
|
* @license
|
|
1045
1083
|
* Copyright 2022 Google LLC
|
|
1046
1084
|
* SPDX-License-Identifier: Apache-2.0
|
|
1047
|
-
*/var st;!function(t){t[t.INACTIVE=0]="INACTIVE",t[t.TOUCH_DELAY=1]="TOUCH_DELAY",t[t.HOLDING=2]="HOLDING",t[t.WAITING_FOR_CLICK=3]="WAITING_FOR_CLICK"}(st||(st={}));const nt=["click","contextmenu","pointercancel","pointerdown","pointerenter","pointerleave","pointerup"],at=r?null:window.matchMedia("(forced-colors: active)");class lt extends e{constructor(){super(...arguments),this.disabled=!1,this.hovered=!1,this.pressed=!1,this.rippleSize="",this.rippleScale="",this.initialSize=0,this.state=st.INACTIVE,this.checkBoundsAfterContextMenu=!1,this.attachableController=new Q(this,this.onControlChange.bind(this))}get htmlFor(){return this.attachableController.htmlFor}set htmlFor(t){this.attachableController.htmlFor=t}get control(){return this.attachableController.control}set control(t){this.attachableController.control=t}attach(t){this.attachableController.attach(t)}detach(){this.attachableController.detach()}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){const t={hovered:this.hovered,pressed:this.pressed};return i`<div class="surface ${s(t)}"></div>`}update(t){t.has("disabled")&&this.disabled&&(this.hovered=!1,this.pressed=!1),super.update(t)}handlePointerenter(t){this.shouldReactToEvent(t)&&(this.hovered=!0)}handlePointerleave(t){this.shouldReactToEvent(t)&&(this.hovered=!1,this.state!==st.INACTIVE&&this.endPressAnimation())}handlePointerup(t){if(this.shouldReactToEvent(t)){if(this.state!==st.HOLDING)return this.state===st.TOUCH_DELAY?(this.state=st.WAITING_FOR_CLICK,void this.startPressAnimation(this.rippleStartEvent)):void 0;this.state=st.WAITING_FOR_CLICK}}async handlePointerdown(t){if(this.shouldReactToEvent(t)){if(this.rippleStartEvent=t,!this.isTouch(t))return this.state=st.WAITING_FOR_CLICK,void this.startPressAnimation(t);this.checkBoundsAfterContextMenu&&!this.inBounds(t)||(this.checkBoundsAfterContextMenu=!1,this.state=st.TOUCH_DELAY,await new Promise((t=>{setTimeout(t,150)})),this.state===st.TOUCH_DELAY&&(this.state=st.HOLDING,this.startPressAnimation(t)))}}handleClick(){this.disabled||(this.state!==st.WAITING_FOR_CLICK?this.state===st.INACTIVE&&(this.startPressAnimation(),this.endPressAnimation()):this.endPressAnimation())}handlePointercancel(t){this.shouldReactToEvent(t)&&this.endPressAnimation()}handleContextmenu(){this.disabled||(this.checkBoundsAfterContextMenu=!0,this.endPressAnimation())}determineRippleSize(){const{height:t,width:e}=this.getBoundingClientRect(),i=Math.max(t,e),o=Math.max(.35*i,75),r=Math.floor(.2*i),s=Math.sqrt(e**2+t**2)+10;this.initialSize=r,this.rippleScale=""+(s+o)/r,this.rippleSize=`${r}px`}getNormalizedPointerEventCoords(t){const{scrollX:e,scrollY:i}=window,{left:o,top:r}=this.getBoundingClientRect(),s=e+o,n=i+r,{pageX:a,pageY:l}=t;return{x:a-s,y:l-n}}getTranslationCoordinates(t){const{height:e,width:i}=this.getBoundingClientRect(),o={x:(i-this.initialSize)/2,y:(e-this.initialSize)/2};let r;return r=t instanceof PointerEvent?this.getNormalizedPointerEventCoords(t):{x:i/2,y:e/2},r={x:r.x-this.initialSize/2,y:r.y-this.initialSize/2},{startPoint:r,endPoint:o}}startPressAnimation(t){if(!this.mdRoot)return;this.pressed=!0,this.growAnimation?.cancel(),this.determineRippleSize();const{startPoint:e,endPoint:i}=this.getTranslationCoordinates(t),o=`${e.x}px, ${e.y}px`,r=`${i.x}px, ${i.y}px`;this.growAnimation=this.mdRoot.animate({top:[0,0],left:[0,0],height:[this.rippleSize,this.rippleSize],width:[this.rippleSize,this.rippleSize],transform:[`translate(${o}) scale(1)`,`translate(${r}) scale(${this.rippleScale})`]},{pseudoElement:"::after",duration:450,easing:rt,fill:"forwards"})}async endPressAnimation(){this.rippleStartEvent=void 0,this.state=st.INACTIVE;const t=this.growAnimation;let e=1/0;"number"==typeof t?.currentTime?e=t.currentTime:t?.currentTime&&(e=t.currentTime.to("ms").value),e>=225?this.pressed=!1:(await new Promise((t=>{setTimeout(t,225-e)})),this.growAnimation===t&&(this.pressed=!1))}shouldReactToEvent(t){if(this.disabled||!t.isPrimary)return!1;if(this.rippleStartEvent&&this.rippleStartEvent.pointerId!==t.pointerId)return!1;if("pointerenter"===t.type||"pointerleave"===t.type)return!this.isTouch(t);const e=1===t.buttons;return this.isTouch(t)||e}inBounds({x:t,y:e}){const{top:i,left:o,bottom:r,right:s}=this.getBoundingClientRect();return t>=o&&t<=s&&e>=i&&e<=r}isTouch({pointerType:t}){return"touch"===t}async handleEvent(t){if(!at?.matches)switch(t.type){case"click":this.handleClick();break;case"contextmenu":this.handleContextmenu();break;case"pointercancel":this.handlePointercancel(t);break;case"pointerdown":await this.handlePointerdown(t);break;case"pointerenter":this.handlePointerenter(t);break;case"pointerleave":this.handlePointerleave(t);break;case"pointerup":this.handlePointerup(t)}}onControlChange(t,e){if(!r)for(const i of nt)t?.removeEventListener(i,this),e?.addEventListener(i,this)}}n([
|
|
1085
|
+
*/var st;!function(t){t[t.INACTIVE=0]="INACTIVE",t[t.TOUCH_DELAY=1]="TOUCH_DELAY",t[t.HOLDING=2]="HOLDING",t[t.WAITING_FOR_CLICK=3]="WAITING_FOR_CLICK"}(st||(st={}));const nt=["click","contextmenu","pointercancel","pointerdown","pointerenter","pointerleave","pointerup"],at=r?null:window.matchMedia("(forced-colors: active)");class lt extends e{constructor(){super(...arguments),this.disabled=!1,this.hovered=!1,this.pressed=!1,this.rippleSize="",this.rippleScale="",this.initialSize=0,this.state=st.INACTIVE,this.checkBoundsAfterContextMenu=!1,this.attachableController=new Q(this,this.onControlChange.bind(this))}get htmlFor(){return this.attachableController.htmlFor}set htmlFor(t){this.attachableController.htmlFor=t}get control(){return this.attachableController.control}set control(t){this.attachableController.control=t}attach(t){this.attachableController.attach(t)}detach(){this.attachableController.detach()}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){const t={hovered:this.hovered,pressed:this.pressed};return i`<div class="surface ${s(t)}"></div>`}update(t){t.has("disabled")&&this.disabled&&(this.hovered=!1,this.pressed=!1),super.update(t)}handlePointerenter(t){this.shouldReactToEvent(t)&&(this.hovered=!0)}handlePointerleave(t){this.shouldReactToEvent(t)&&(this.hovered=!1,this.state!==st.INACTIVE&&this.endPressAnimation())}handlePointerup(t){if(this.shouldReactToEvent(t)){if(this.state!==st.HOLDING)return this.state===st.TOUCH_DELAY?(this.state=st.WAITING_FOR_CLICK,void this.startPressAnimation(this.rippleStartEvent)):void 0;this.state=st.WAITING_FOR_CLICK}}async handlePointerdown(t){if(this.shouldReactToEvent(t)){if(this.rippleStartEvent=t,!this.isTouch(t))return this.state=st.WAITING_FOR_CLICK,void this.startPressAnimation(t);this.checkBoundsAfterContextMenu&&!this.inBounds(t)||(this.checkBoundsAfterContextMenu=!1,this.state=st.TOUCH_DELAY,await new Promise((t=>{setTimeout(t,150)})),this.state===st.TOUCH_DELAY&&(this.state=st.HOLDING,this.startPressAnimation(t)))}}handleClick(){this.disabled||(this.state!==st.WAITING_FOR_CLICK?this.state===st.INACTIVE&&(this.startPressAnimation(),this.endPressAnimation()):this.endPressAnimation())}handlePointercancel(t){this.shouldReactToEvent(t)&&this.endPressAnimation()}handleContextmenu(){this.disabled||(this.checkBoundsAfterContextMenu=!0,this.endPressAnimation())}determineRippleSize(){const{height:t,width:e}=this.getBoundingClientRect(),i=Math.max(t,e),o=Math.max(.35*i,75),r=Math.floor(.2*i),s=Math.sqrt(e**2+t**2)+10;this.initialSize=r,this.rippleScale=""+(s+o)/r,this.rippleSize=`${r}px`}getNormalizedPointerEventCoords(t){const{scrollX:e,scrollY:i}=window,{left:o,top:r}=this.getBoundingClientRect(),s=e+o,n=i+r,{pageX:a,pageY:l}=t;return{x:a-s,y:l-n}}getTranslationCoordinates(t){const{height:e,width:i}=this.getBoundingClientRect(),o={x:(i-this.initialSize)/2,y:(e-this.initialSize)/2};let r;return r=t instanceof PointerEvent?this.getNormalizedPointerEventCoords(t):{x:i/2,y:e/2},r={x:r.x-this.initialSize/2,y:r.y-this.initialSize/2},{startPoint:r,endPoint:o}}startPressAnimation(t){if(!this.mdRoot)return;this.pressed=!0,this.growAnimation?.cancel(),this.determineRippleSize();const{startPoint:e,endPoint:i}=this.getTranslationCoordinates(t),o=`${e.x}px, ${e.y}px`,r=`${i.x}px, ${i.y}px`;this.growAnimation=this.mdRoot.animate({top:[0,0],left:[0,0],height:[this.rippleSize,this.rippleSize],width:[this.rippleSize,this.rippleSize],transform:[`translate(${o}) scale(1)`,`translate(${r}) scale(${this.rippleScale})`]},{pseudoElement:"::after",duration:450,easing:rt,fill:"forwards"})}async endPressAnimation(){this.rippleStartEvent=void 0,this.state=st.INACTIVE;const t=this.growAnimation;let e=1/0;"number"==typeof t?.currentTime?e=t.currentTime:t?.currentTime&&(e=t.currentTime.to("ms").value),e>=225?this.pressed=!1:(await new Promise((t=>{setTimeout(t,225-e)})),this.growAnimation===t&&(this.pressed=!1))}shouldReactToEvent(t){if(this.disabled||!t.isPrimary)return!1;if(this.rippleStartEvent&&this.rippleStartEvent.pointerId!==t.pointerId)return!1;if("pointerenter"===t.type||"pointerleave"===t.type)return!this.isTouch(t);const e=1===t.buttons;return this.isTouch(t)||e}inBounds({x:t,y:e}){const{top:i,left:o,bottom:r,right:s}=this.getBoundingClientRect();return t>=o&&t<=s&&e>=i&&e<=r}isTouch({pointerType:t}){return"touch"===t}async handleEvent(t){if(!at?.matches)switch(t.type){case"click":this.handleClick();break;case"contextmenu":this.handleContextmenu();break;case"pointercancel":this.handlePointercancel(t);break;case"pointerdown":await this.handlePointerdown(t);break;case"pointerenter":this.handlePointerenter(t);break;case"pointerleave":this.handlePointerleave(t);break;case"pointerup":this.handlePointerup(t)}}onControlChange(t,e){if(!r)for(const i of nt)t?.removeEventListener(i,this),e?.addEventListener(i,this)}}n([j({type:Boolean,reflect:!0})],lt.prototype,"disabled",void 0),n([L()],lt.prototype,"hovered",void 0),n([L()],lt.prototype,"pressed",void 0),n([_(".surface")],lt.prototype,"mdRoot",void 0);
|
|
1048
1086
|
/**
|
|
1049
1087
|
* @license
|
|
1050
1088
|
* Copyright 2024 Google LLC
|
|
@@ -1073,7 +1111,7 @@ function pt(t){return t.currentTarget===t.target&&(t.composedPath()[0]===t.targe
|
|
|
1073
1111
|
* Copyright 2023 Google LLC
|
|
1074
1112
|
* SPDX-License-Identifier: Apache-2.0
|
|
1075
1113
|
*/
|
|
1076
|
-
const yt=Symbol("createValidator"),mt=Symbol("getValidityAnchor"),
|
|
1114
|
+
const yt=Symbol("createValidator"),mt=Symbol("getValidityAnchor"),gt=Symbol("privateValidator"),ft=Symbol("privateSyncValidity"),vt=Symbol("privateCustomValidationMessage");
|
|
1077
1115
|
/**
|
|
1078
1116
|
* @license
|
|
1079
1117
|
* Copyright 2023 Google LLC
|
|
@@ -1106,7 +1144,7 @@ class Ot{constructor(t){this.getCurrentState=t,this.currentValidity={validity:{}
|
|
|
1106
1144
|
* @license
|
|
1107
1145
|
* Copyright 2018 Google LLC
|
|
1108
1146
|
* SPDX-License-Identifier: Apache-2.0
|
|
1109
|
-
*/var At;const zt=Symbol("checked");let
|
|
1147
|
+
*/var At;const zt=Symbol("checked");let It=0;const jt=function(t){var e;class i extends t{constructor(){super(...arguments),this[e]=""}get validity(){return this[ft](),this[ut].validity}get validationMessage(){return this[ft](),this[ut].validationMessage}get willValidate(){return this[ft](),this[ut].willValidate}checkValidity(){return this[ft](),this[ut].checkValidity()}reportValidity(){return this[ft](),this[ut].reportValidity()}setCustomValidity(t){this[vt]=t,this[ft]()}requestUpdate(t,e,i){super.requestUpdate(t,e,i),this[ft]()}firstUpdated(t){super.firstUpdated(t),this[ft]()}[(e=vt,ft)](){if(r)return;this[gt]||(this[gt]=this[yt]());const{validity:t,validationMessage:e}=this[gt].getValidity(),i=!!this[vt],o=this[vt]||e;this[ut].setValidity({...t,customError:i},o,this[mt]()??void 0)}[yt](){throw new Error("Implement [createValidator]")}[mt](){throw new Error("Implement [getValidityAnchor]")}}return i}(function(t){class e extends t{get form(){return this[ut].form}get labels(){return this[ut].labels}get name(){return this.getAttribute("name")??""}set name(t){this.setAttribute("name",t)}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",t)}attributeChangedCallback(t,e,i){if("name"!==t&&"disabled"!==t)super.attributeChangedCallback(t,e,i);else{const i="disabled"===t?null!==e:e;this.requestUpdate(t,i)}}requestUpdate(t,e,i){super.requestUpdate(t,e,i),this[ut].setFormValue(this[Ct](),this[Et]())}[Ct](){throw new Error("Implement [getFormValue]")}[Et](){return this[Ct]()}formDisabledCallback(t){this.disabled=t}}return e.formAssociated=!0,n([j({noAccessor:!0})],e.prototype,"name",null),n([j({type:Boolean,noAccessor:!0})],e.prototype,"disabled",null),e}((Lt=function(t){var e,i,o;class r extends t{constructor(){super(...arguments),this[e]=!0,this[i]=null,this[o]=!1}get[xt](){return this[wt]}set[xt](t){this[xt]!==t&&(this[wt]=t,this[St]())}connectedCallback(){super.connectedCallback(),this[St]()}attributeChangedCallback(t,e,i){if("tabindex"===t){if(this.requestUpdate("tabIndex",Number(e??-1)),!this[$t])return this.hasAttribute("tabindex")?void(this[kt]=this.tabIndex):(this[kt]=null,void this[St]())}else super.attributeChangedCallback(t,e,i)}[(e=wt,i=kt,o=$t,St)](){const t=this[xt]?0:-1,e=this[kt]??t;this[$t]=!0,this.tabIndex=e,this[$t]=!1}}return n([j({noAccessor:!0})],r.prototype,"tabIndex",void 0),r}(e),class extends Lt{get[ut](){return this[bt]||(this[bt]=this.attachInternals()),this[bt]}})));var Lt;class _t extends jt{get checked(){return this[zt]}set checked(t){const e=this.checked;e!==t&&(this[zt]=t,this.requestUpdate("checked",e),this.selectionController.handleCheckedChange())}constructor(){super(),this.maskId="cutout"+ ++It,this[At]=!1,this.required=!1,this.value="on",this.selectionController=new Tt(this),this.addController(this.selectionController),r||(this[ut].role="radio",this.addEventListener("click",this.handleClick.bind(this)),this.addEventListener("keydown",this.handleKeydown.bind(this)))}render(){const t={checked:this.checked};return i`
|
|
1110
1148
|
<div class="container ${s(t)}" aria-hidden="true">
|
|
1111
1149
|
<md-ripple
|
|
1112
1150
|
part="ripple"
|
|
@@ -1129,7 +1167,7 @@ class Ot{constructor(t){this.getCurrentState=t,this.currentValidity={validity:{}
|
|
|
1129
1167
|
|
|
1130
1168
|
<div class="touch-target"></div>
|
|
1131
1169
|
</div>
|
|
1132
|
-
`}updated(){this[ut].ariaChecked=String(this.checked)}async handleClick(t){this.disabled||(await 0,t.defaultPrevented||(pt(t)&&this.focus(),this.checked=!0,this.dispatchEvent(new Event("change",{bubbles:!0})),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))))}async handleKeydown(t){await 0," "!==t.key||t.defaultPrevented||this.click()}[(At=zt,Ct)](){return this.checked?this.value:null}[Et](){return String(this.checked)}formResetCallback(){this.checked=this.hasAttribute("checked")}formStateRestoreCallback(t){this.checked="true"===t}[yt](){return new Pt((()=>this.selectionController?this.selectionController.controls:[this]))}[mt](){return this.container}}n([
|
|
1170
|
+
`}updated(){this[ut].ariaChecked=String(this.checked)}async handleClick(t){this.disabled||(await 0,t.defaultPrevented||(pt(t)&&this.focus(),this.checked=!0,this.dispatchEvent(new Event("change",{bubbles:!0})),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))))}async handleKeydown(t){await 0," "!==t.key||t.defaultPrevented||this.click()}[(At=zt,Ct)](){return this.checked?this.value:null}[Et](){return String(this.checked)}formResetCallback(){this.checked=this.hasAttribute("checked")}formStateRestoreCallback(t){this.checked="true"===t}[yt](){return new Pt((()=>this.selectionController?this.selectionController.controls:[this]))}[mt](){return this.container}}n([j({type:Boolean})],_t.prototype,"checked",null),n([j({type:Boolean})],_t.prototype,"required",void 0),n([j()],_t.prototype,"value",void 0),n([_(".container")],_t.prototype,"container",void 0);
|
|
1133
1171
|
/**
|
|
1134
1172
|
* @license
|
|
1135
1173
|
* Copyright 2024 Google LLC
|
|
@@ -1200,7 +1238,7 @@ const Rt=t`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
1200
1238
|
></md-radio>
|
|
1201
1239
|
<span>${this.checked?"On":"Off"} ${this.error?"Error":""}</span>
|
|
1202
1240
|
</label>
|
|
1203
|
-
`}};n([
|
|
1241
|
+
`}};n([j({type:String}),a("design:type",Object)],Mt.prototype,"name",void 0),n([j({type:Boolean}),a("design:type",Object)],Mt.prototype,"checked",void 0),n([j({type:Boolean}),a("design:type",Object)],Mt.prototype,"disabled",void 0),n([j({type:Boolean}),a("design:type",Object)],Mt.prototype,"error",void 0),Mt=n([l("custom-radio")],Mt);let Ut=class extends e{static{this.styles=t`
|
|
1204
1242
|
:host {
|
|
1205
1243
|
display: block;
|
|
1206
1244
|
font-family: 'Graphik', sans-serif;
|
|
@@ -1310,7 +1348,7 @@ const Rt=t`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
1310
1348
|
}
|
|
1311
1349
|
|
|
1312
1350
|
.filter-input {
|
|
1313
|
-
${
|
|
1351
|
+
${U};
|
|
1314
1352
|
padding: 16px;
|
|
1315
1353
|
padding-right: 40px;
|
|
1316
1354
|
border: none;
|
|
@@ -1330,7 +1368,7 @@ const Rt=t`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
1330
1368
|
}
|
|
1331
1369
|
|
|
1332
1370
|
.filter-input::placeholder {
|
|
1333
|
-
${
|
|
1371
|
+
${U};
|
|
1334
1372
|
color: var(--secondary-color-40);
|
|
1335
1373
|
}
|
|
1336
1374
|
|
|
@@ -1375,12 +1413,16 @@ const Rt=t`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
1375
1413
|
}
|
|
1376
1414
|
|
|
1377
1415
|
.options-list li {
|
|
1378
|
-
${
|
|
1416
|
+
${U};
|
|
1379
1417
|
padding: 8px 16px 8px 16px;
|
|
1380
1418
|
cursor: pointer;
|
|
1381
1419
|
color: var(--secondary-color-80);
|
|
1382
1420
|
}
|
|
1383
1421
|
|
|
1422
|
+
.options-list li.highlighted {
|
|
1423
|
+
background-color: var(--primary-color-10);
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1384
1426
|
.mobile-modal {
|
|
1385
1427
|
position: fixed;
|
|
1386
1428
|
bottom: 0;
|
|
@@ -1440,7 +1482,7 @@ const Rt=t`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
1440
1482
|
}
|
|
1441
1483
|
|
|
1442
1484
|
.filter-fake {
|
|
1443
|
-
${
|
|
1485
|
+
${U};
|
|
1444
1486
|
padding: 15px;
|
|
1445
1487
|
padding-right: 40px;
|
|
1446
1488
|
width: 100%;
|
|
@@ -1478,7 +1520,7 @@ const Rt=t`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
1478
1520
|
.options-list::-webkit-scrollbar-button {
|
|
1479
1521
|
display: none;
|
|
1480
1522
|
}
|
|
1481
|
-
`}constructor(){if(super(),this.options=[],this.placeholder="Filtrar opciones...",this.defaultValue="",this.disabled=!1,this.label="",this.value="",this.labelColor="",this.filterable=!0,this.error=!1,this.isMobile=!1,this.filteredOptions=[],this.filterValue="",this.isOpen=!1,this.mobileFilterValue="",this.debounceTimeout=null,this.updateResponsiveModeBound=this.updateResponsiveMode.bind(this),this.defaultValue){const t=this.options.find((t=>"string"==typeof t?t===this.defaultValue:t.value===this.defaultValue));t&&(this.filterValue="string"==typeof t?t:t.label)}}willUpdate(t){if(t.has("options")&&(this.filteredOptions=[...this.options]),t.has("defaultValue")||t.has("options")){const t=this.options.find((t=>"string"==typeof t?t===this.defaultValue:t.value===this.defaultValue));t&&(this.filterValue="string"==typeof t?t:t.label)}if(t.has("value")){const t=this.options.find((t=>"string"==typeof t?t===this.value:t.value===this.value));t&&(this.filterValue="string"==typeof t?t:t.label)}}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)),super.disconnectedCallback()}updateResponsiveMode(){this.isMobile=window.innerWidth<=940}handleInputClick(t){this.isMobile&&(this.mobileFilterValue=""),this.disabled||(this.isOpen=!this.isOpen,this.requestUpdate())}handleInput(t){if(!this.filterable)return;const e=t.target.value,i=this.maxLength?e.slice(0,this.maxLength).toLowerCase():e.toLowerCase();this.filterValue=i,this.filteredOptions=this.options.filter((t=>("string"==typeof t?t:t.label).toLowerCase().includes(this.filterValue.toLowerCase()))),this.isOpen=!0,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){const e=t.target.value,i=this.maxLength?e.slice(0,this.maxLength).toLowerCase():e.toLowerCase();this.mobileFilterValue=i,this.filteredOptions=this.options.filter((t=>("string"==typeof t?t:t.label).toLowerCase().includes(i))),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}))}),300)}handleSelect(t){this.value="string"==typeof t?t:t.value;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.isOpen=!1,this.requestUpdate()}handleIconClick(){this.disabled||(this.filterable&&this.filterValue?(this.filterValue="",this.filteredOptions=[...this.options],this.dispatchEvent(new CustomEvent("option-selected",{detail:{value:""},bubbles:!0,composed:!0})),this.isOpen=!1):this.isOpen=!this.isOpen,this.requestUpdate())}handleClickOutside(t){const e=t.target;e instanceof Node&&(this.contains(e)||(this.isOpen=!1,this.requestUpdate()))}render(){const t=this.isMobile;return i`
|
|
1523
|
+
`}constructor(){if(super(),this.options=[],this.placeholder="Filtrar opciones...",this.defaultValue="",this.disabled=!1,this.label="",this.value="",this.labelColor="",this.filterable=!0,this.error=!1,this.isMobile=!1,this.filteredOptions=[],this.filterValue="",this.isOpen=!1,this.mobileFilterValue="",this.highlightedIndex=-1,this.debounceTimeout=null,this.updateResponsiveModeBound=this.updateResponsiveMode.bind(this),this.defaultValue){const t=this.options.find((t=>"string"==typeof t?t===this.defaultValue:t.value===this.defaultValue));t&&(this.filterValue="string"==typeof t?t:t.label)}}willUpdate(t){if(t.has("options")&&(this.filteredOptions=[...this.options]),t.has("defaultValue")||t.has("options")){const t=this.options.find((t=>"string"==typeof t?t===this.defaultValue:t.value===this.defaultValue));t&&(this.filterValue="string"==typeof t?t:t.label)}if(t.has("value")){const t=this.options.find((t=>"string"==typeof t?t===this.value:t.value===this.value));t&&(this.filterValue="string"==typeof t?t:t.label)}}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)),super.disconnectedCallback()}updateResponsiveMode(){this.isMobile=window.innerWidth<=940}handleInputClick(t){this.isMobile&&(this.mobileFilterValue=""),this.disabled||(this.isOpen=!this.isOpen,this.requestUpdate())}handleInput(t){if(!this.filterable)return;const e=t.target.value,i=this.maxLength?e.slice(0,this.maxLength).toLowerCase():e.toLowerCase();this.filterValue=i,this.filteredOptions=this.options.filter((t=>("string"==typeof t?t:t.label).toLowerCase().includes(this.filterValue.toLowerCase()))),this.isOpen=!0,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){const e=t.target.value,i=this.maxLength?e.slice(0,this.maxLength).toLowerCase():e.toLowerCase();this.mobileFilterValue=i,this.filteredOptions=this.options.filter((t=>("string"==typeof t?t:t.label).toLowerCase().includes(i))),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}))}),300)}handleSelect(t){this.value="string"==typeof t?t:t.value;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.isOpen=!1,this.requestUpdate()}handleIconClick(){this.disabled||(this.filterable&&this.filterValue?(this.filterValue="",this.filteredOptions=[...this.options],this.dispatchEvent(new CustomEvent("option-selected",{detail:{value:""},bubbles:!0,composed:!0})),this.isOpen=!1):this.isOpen=!this.isOpen,this.requestUpdate())}handleClickOutside(t){const e=t.target;e instanceof Node&&(this.contains(e)||(this.isOpen=!1,this.requestUpdate()))}handleKeyDown(t){const{key:e}=t;if(!this.isOpen&&("Enter"===e||" "===e))return t.preventDefault(),void(this.isOpen=!0);if(this.isOpen)if("ArrowDown"===e)t.preventDefault(),this.highlightedIndex=Math.min(this.highlightedIndex+1,this.filteredOptions.length-1),this.requestUpdate();else if("ArrowUp"===e)t.preventDefault(),this.highlightedIndex=Math.max(this.highlightedIndex-1,0),this.requestUpdate();else if("Enter"===e){t.preventDefault();const e=this.filteredOptions[this.highlightedIndex];e&&this.handleSelect(e)}else"Escape"===e&&(t.preventDefault(),this.isOpen=!1)}render(){const t=this.isMobile;return i`
|
|
1482
1524
|
<div class="select-container" style="${this.labelColor?` --label-color: ${this.labelColor}`:""}">
|
|
1483
1525
|
${this.label?i`
|
|
1484
1526
|
<div class="label-container">
|
|
@@ -1490,7 +1532,17 @@ const Rt=t`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
1490
1532
|
|
|
1491
1533
|
<div class="input-wrapper">
|
|
1492
1534
|
${t?i`
|
|
1493
|
-
<div
|
|
1535
|
+
<div
|
|
1536
|
+
class="filter-fake"
|
|
1537
|
+
@click="${this.handleInputClick}"
|
|
1538
|
+
@keydown="${this.handleKeyDown}"
|
|
1539
|
+
tabindex="0"
|
|
1540
|
+
role="combobox"
|
|
1541
|
+
aria-expanded="${this.isOpen}"
|
|
1542
|
+
aria-controls="options-list"
|
|
1543
|
+
aria-haspopup="listbox"
|
|
1544
|
+
aria-activedescendant=""
|
|
1545
|
+
">
|
|
1494
1546
|
${this.filterValue||this.placeholder}
|
|
1495
1547
|
</div>
|
|
1496
1548
|
`:i`
|
|
@@ -1498,6 +1550,7 @@ const Rt=t`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
1498
1550
|
class="filter-input"
|
|
1499
1551
|
.value="${this.filterValue||""}"
|
|
1500
1552
|
@click="${this.handleInputClick}"
|
|
1553
|
+
@keydown="${this.handleKeyDown}"
|
|
1501
1554
|
@input=${this.handleInput}
|
|
1502
1555
|
placeholder="${this.filterValue?"":this.placeholder}"
|
|
1503
1556
|
?disabled="${this.disabled}"
|
|
@@ -1530,12 +1583,14 @@ const Rt=t`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
1530
1583
|
</button>
|
|
1531
1584
|
</div>
|
|
1532
1585
|
<ul class="options-list">
|
|
1533
|
-
${this.filteredOptions.map((t=>{const
|
|
1586
|
+
${this.filteredOptions.map(((t,e)=>{const o="string"==typeof t?t:t.label,r="object"==typeof t&&t.disabled;return i`
|
|
1534
1587
|
<li
|
|
1535
|
-
class="${
|
|
1536
|
-
|
|
1588
|
+
class="${r?"disabled":""} ${e===this.highlightedIndex?"highlighted":""}"
|
|
1589
|
+
role="option"
|
|
1590
|
+
aria-selected="${e===this.highlightedIndex}"
|
|
1591
|
+
@click="${()=>{r||this.handleSelect(t)}}"
|
|
1537
1592
|
>
|
|
1538
|
-
${
|
|
1593
|
+
${o}
|
|
1539
1594
|
</li>
|
|
1540
1595
|
`}))}
|
|
1541
1596
|
</ul>
|
|
@@ -1543,19 +1598,21 @@ const Rt=t`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
1543
1598
|
</div>
|
|
1544
1599
|
`:!t&&this.isOpen&&this.filteredOptions.length>0?i`
|
|
1545
1600
|
<ul class="options-list">
|
|
1546
|
-
${this.filteredOptions.map((t=>{const
|
|
1601
|
+
${this.filteredOptions.map(((t,e)=>{const o="string"==typeof t?t:t.label,r="object"==typeof t&&t.disabled;return i`
|
|
1547
1602
|
<li
|
|
1548
|
-
class="${
|
|
1549
|
-
|
|
1603
|
+
class="${r?"disabled":""} ${e===this.highlightedIndex?"highlighted":""}"
|
|
1604
|
+
role="option"
|
|
1605
|
+
aria-selected="${e===this.highlightedIndex}"
|
|
1606
|
+
@click="${()=>{r||this.handleSelect(t)}}"
|
|
1550
1607
|
>
|
|
1551
|
-
${
|
|
1608
|
+
${o}
|
|
1552
1609
|
</li>
|
|
1553
1610
|
`}))}
|
|
1554
1611
|
</ul>
|
|
1555
1612
|
`:""}
|
|
1556
1613
|
</div>
|
|
1557
1614
|
</div>
|
|
1558
|
-
`}};n([
|
|
1615
|
+
`}};n([j({type:Array}),a("design:type",Array)],Ut.prototype,"options",void 0),n([j({type:String}),a("design:type",Object)],Ut.prototype,"placeholder",void 0),n([j({type:String,attribute:"default-value"}),a("design:type",Object)],Ut.prototype,"defaultValue",void 0),n([j({type:Boolean}),a("design:type",Object)],Ut.prototype,"disabled",void 0),n([j({type:String}),a("design:type",Object)],Ut.prototype,"label",void 0),n([j({type:String}),a("design:type",String)],Ut.prototype,"value",void 0),n([j({type:String}),a("design:type",Object)],Ut.prototype,"labelColor",void 0),n([j({type:Boolean}),a("design:type",Object)],Ut.prototype,"filterable",void 0),n([j({type:Number}),a("design:type",Number)],Ut.prototype,"maxLength",void 0),n([j({type:Boolean,reflect:!0}),a("design:type",Boolean)],Ut.prototype,"error",void 0),n([L(),a("design:type",Boolean)],Ut.prototype,"isMobile",void 0),n([L(),a("design:type",Array)],Ut.prototype,"filteredOptions",void 0),n([L(),a("design:type",Object)],Ut.prototype,"filterValue",void 0),n([L(),a("design:type",Object)],Ut.prototype,"isOpen",void 0),n([L(),a("design:type",Object)],Ut.prototype,"mobileFilterValue",void 0),n([L(),a("design:type",Object)],Ut.prototype,"highlightedIndex",void 0),Ut=n([l("filterable-select"),a("design:paramtypes",[])],Ut);let Bt=class extends e{constructor(){super(...arguments),this.totalSteps=4,this.currentStep=0}static{this.styles=t`
|
|
1559
1616
|
.stepper {
|
|
1560
1617
|
display: flex;
|
|
1561
1618
|
gap: 20px;
|
|
@@ -1655,7 +1712,7 @@ const Rt=t`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
1655
1712
|
</div>
|
|
1656
1713
|
`))}
|
|
1657
1714
|
</div>
|
|
1658
|
-
`}};n([
|
|
1715
|
+
`}};n([j({type:Number}),a("design:type",Object)],Bt.prototype,"totalSteps",void 0),n([j({type:Number}),a("design:type",Object)],Bt.prototype,"currentStep",void 0),Bt=n([l("custom-stepper")],Bt);const Vt=new CSSStyleSheet;Vt.replaceSync("\n @font-face {\n font-family: 'Graphik';\n src: url('/src/assets/font/Graphik-Regular.woff2') format('woff2'),\n url('/src/assets/font/Graphik-Regular.woff') format('woff'),\n url('/src/assets/font/Graphik-Regular.eot') format('embedded-opentype');\n font-weight: normal;\n font-style: normal;\n }\n\n .body-s {\n font-weight: 400;\n font-size: 14px;\n line-height: 100%;\n letter-spacing: 0%;\n color: green;\n }\n");class Nt extends e{static{this.styles=[Vt,t`
|
|
1659
1716
|
:host {
|
|
1660
1717
|
display: flex;
|
|
1661
1718
|
position: fixed;
|
|
@@ -1791,7 +1848,7 @@ const Rt=t`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
1791
1848
|
<randstad-icon name=${this.icon} size="24px" color="white"></randstad-icon>
|
|
1792
1849
|
<span class="message">${this.message}</span>
|
|
1793
1850
|
</div>
|
|
1794
|
-
`}}customElements.define("randstad-snackbar",Nt);let
|
|
1851
|
+
`}}customElements.define("randstad-snackbar",Nt);let Dt=class extends e{constructor(){super(...arguments),this.tabs=[],this.selected="",this.internalSelected="",this.showPrev=!1,this.showNext=!1,this.SCROLL_OFFSET=56,this.handleScroll=()=>{const t=this.renderRoot.querySelector(".tab-wrapper");if(!t)return;const{scrollLeft:e,scrollWidth:i,clientWidth:o}=t;this.showPrev=e>0,this.showNext=e+o<i-1}}static{this.styles=t`
|
|
1795
1852
|
:host {
|
|
1796
1853
|
display: block;
|
|
1797
1854
|
border-bottom: 1px solid #E7E8EC;
|
|
@@ -1804,7 +1861,7 @@ const Rt=t`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
1804
1861
|
}
|
|
1805
1862
|
|
|
1806
1863
|
.tab {
|
|
1807
|
-
${
|
|
1864
|
+
${B};
|
|
1808
1865
|
display: flex;
|
|
1809
1866
|
gap: 8px;
|
|
1810
1867
|
flex-direction: row;
|
|
@@ -1861,7 +1918,7 @@ const Rt=t`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
1861
1918
|
.tab-wrapper {
|
|
1862
1919
|
display: flex;
|
|
1863
1920
|
justify-content: flex-start;
|
|
1864
|
-
gap:
|
|
1921
|
+
gap: 0px;
|
|
1865
1922
|
overflow-x: auto;
|
|
1866
1923
|
scroll-behavior: smooth;
|
|
1867
1924
|
scrollbar-width: none; /* Firefox */
|
|
@@ -1878,7 +1935,7 @@ const Rt=t`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
1878
1935
|
font-size: 24px;
|
|
1879
1936
|
cursor: pointer;
|
|
1880
1937
|
z-index: 1;
|
|
1881
|
-
width:
|
|
1938
|
+
width: 56px;
|
|
1882
1939
|
height: 100%;
|
|
1883
1940
|
display: flex;
|
|
1884
1941
|
align-items: center;
|
|
@@ -1899,6 +1956,13 @@ const Rt=t`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
1899
1956
|
right: 0;
|
|
1900
1957
|
background: linear-gradient(270deg, #FFFFFF 0%, #FFFFFF 50%, rgba(255, 255, 255, 0) 100%);
|
|
1901
1958
|
}
|
|
1959
|
+
|
|
1960
|
+
@media (max-width: 940px) {
|
|
1961
|
+
.tab {
|
|
1962
|
+
${M};
|
|
1963
|
+
padding: 16px;
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1902
1966
|
`}firstUpdated(){this.handleScroll()}updated(t){t.has("selected")&&(this.internalSelected=this.selected)}selectTab(t){this.internalSelected=t,this.dispatchEvent(new CustomEvent("tab-change",{detail:t,bubbles:!0,composed:!0}))}scrollTabsLeft(){const t=this.renderRoot.querySelector(".tab-wrapper");if(!t)return;const e=t.scrollLeft,i=Array.from(t.querySelectorAll(".tab"));for(let o=i.length-1;o>=0;o--){const r=i[o].offsetLeft;if(r<e+this.SCROLL_OFFSET-1){const e=r-this.SCROLL_OFFSET;t.scrollTo({left:e,behavior:"smooth"});break}}setTimeout((()=>this.handleScroll()),300)}scrollTabsRight(){const t=this.renderRoot.querySelector(".tab-wrapper");if(!t)return;const e=t.scrollLeft,i=Array.from(t.querySelectorAll(".tab"));for(const o of i)if(o.offsetLeft>e+this.SCROLL_OFFSET){const e=o.offsetLeft-this.SCROLL_OFFSET;t.scrollTo({left:e,behavior:"smooth"});break}setTimeout((()=>this.handleScroll()),300)}render(){return i`
|
|
1903
1967
|
<div class="scroll-container">
|
|
1904
1968
|
${this.showPrev?i`
|
|
@@ -1923,7 +1987,7 @@ const Rt=t`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
1923
1987
|
</button>
|
|
1924
1988
|
`:null}
|
|
1925
1989
|
</div>
|
|
1926
|
-
`}};n([
|
|
1990
|
+
`}};n([j({type:Array}),a("design:type",Array)],Dt.prototype,"tabs",void 0),n([j({type:String}),a("design:type",String)],Dt.prototype,"selected",void 0),n([L(),a("design:type",String)],Dt.prototype,"internalSelected",void 0),n([L(),a("design:type",Object)],Dt.prototype,"showPrev",void 0),n([L(),a("design:type",Object)],Dt.prototype,"showNext",void 0),Dt=n([l("tabs-bar")],Dt);let qt=class extends e{constructor(){super(...arguments),this.value=0,this.max=5}static{this.styles=t`
|
|
1927
1991
|
:host {
|
|
1928
1992
|
display: inline-block;
|
|
1929
1993
|
width: 64px;
|
|
@@ -1984,5 +2048,5 @@ const Rt=t`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
1984
2048
|
${this.value} de ${this.max}
|
|
1985
2049
|
</text>
|
|
1986
2050
|
</svg>
|
|
1987
|
-
`}};n([
|
|
2051
|
+
`}};n([j({type:Number}),a("design:type",Object)],qt.prototype,"value",void 0),n([j({type:Number}),a("design:type",Object)],qt.prototype,"max",void 0),qt=n([l("progress-circle")],qt);export{q as Checkbox,Y as CustomModal,W as CustomPopup,Mt as CustomRadio,Bt as CustomStepper,Ut as FilterableSelect,K as IconComponent,qt as ProgressCircle,D as RandstadButton,G as RandstadForm,H as RandstadNotice,Dt as TabsBar};
|
|
1988
2052
|
//# sourceMappingURL=index.js.map
|