@roadtrip/components 3.26.0 → 3.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/road-badge_14.cjs.entry.js +30 -10
- package/dist/cjs/road-badge_14.cjs.entry.js.map +1 -1
- package/dist/cjs/road-checkbox.cjs.entry.js +3 -2
- package/dist/cjs/road-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/road-navbar-item.cjs.entry.js +12 -1
- package/dist/cjs/road-navbar-item.cjs.entry.js.map +1 -1
- package/dist/cjs/road-progress-indicator-horizontal.cjs.entry.js +1 -1
- package/dist/cjs/road-progress-indicator-horizontal.cjs.entry.js.map +1 -1
- package/dist/cjs/road-radio.cjs.entry.js +3 -2
- package/dist/cjs/road-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/road-select-filter.cjs.entry.js +5 -0
- package/dist/cjs/road-select-filter.cjs.entry.js.map +1 -1
- package/dist/cjs/road-tab-button.cjs.entry.js +6 -4
- package/dist/cjs/road-tab-button.cjs.entry.js.map +1 -1
- package/dist/cjs/road-textarea.cjs.entry.js +1 -1
- package/dist/cjs/road-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/roadtrip.cjs.js +1 -1
- package/dist/collection/components/checkbox/checkbox.css +7 -2
- package/dist/collection/components/checkbox/checkbox.js +19 -1
- package/dist/collection/components/checkbox/checkbox.js.map +1 -1
- package/dist/collection/components/checkbox/checkbox.stories.js +5 -0
- package/dist/collection/components/input/input.js +1 -1
- package/dist/collection/components/input/input.js.map +1 -1
- package/dist/collection/components/input-group/input-group.css +58 -12
- package/dist/collection/components/input-group/input-group.js +55 -8
- package/dist/collection/components/input-group/input-group.js.map +1 -1
- package/dist/collection/components/input-group/input-group.stories.js +24 -14
- package/dist/collection/components/navbar-item/navbar-item.js +15 -1
- package/dist/collection/components/navbar-item/navbar-item.js.map +1 -1
- package/dist/collection/components/progress-indicator-horizontal/progress-indicator-horizontal.css +24 -5
- package/dist/collection/components/progress-indicator-horizontal/progress-indicator-horizontal.js +6 -6
- package/dist/collection/components/progress-indicator-horizontal/progress-indicator-horizontal.js.map +1 -1
- package/dist/collection/components/progress-indicator-horizontal/progress-indicator-horizontal.stories.js +3 -3
- package/dist/collection/components/radio/radio.css +5 -0
- package/dist/collection/components/radio/radio.js +19 -1
- package/dist/collection/components/radio/radio.js.map +1 -1
- package/dist/collection/components/radio/radio.stories.js +5 -0
- package/dist/collection/components/select-filter/select-filter.js +5 -0
- package/dist/collection/components/select-filter/select-filter.js.map +1 -1
- package/dist/collection/components/tab-button/tab-button.css +16 -0
- package/dist/collection/components/tab-button/tab-button.js +23 -3
- package/dist/collection/components/tab-button/tab-button.js.map +1 -1
- package/dist/collection/components/textarea/textarea.css +2 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/road-badge_14.entry.js +30 -10
- package/dist/esm/road-badge_14.entry.js.map +1 -1
- package/dist/esm/road-checkbox.entry.js +3 -2
- package/dist/esm/road-checkbox.entry.js.map +1 -1
- package/dist/esm/road-navbar-item.entry.js +12 -1
- package/dist/esm/road-navbar-item.entry.js.map +1 -1
- package/dist/esm/road-progress-indicator-horizontal.entry.js +1 -1
- package/dist/esm/road-progress-indicator-horizontal.entry.js.map +1 -1
- package/dist/esm/road-radio.entry.js +3 -2
- package/dist/esm/road-radio.entry.js.map +1 -1
- package/dist/esm/road-select-filter.entry.js +5 -0
- package/dist/esm/road-select-filter.entry.js.map +1 -1
- package/dist/esm/road-tab-button.entry.js +6 -4
- package/dist/esm/road-tab-button.entry.js.map +1 -1
- package/dist/esm/road-textarea.entry.js +1 -1
- package/dist/esm/road-textarea.entry.js.map +1 -1
- package/dist/esm/roadtrip.js +1 -1
- package/dist/html.html-data.json +27 -1
- package/dist/roadtrip/p-40ee0f8a.entry.js +2 -0
- package/dist/roadtrip/p-40ee0f8a.entry.js.map +1 -0
- package/dist/roadtrip/{p-0dbf612d.entry.js → p-49025654.entry.js} +2 -2
- package/dist/roadtrip/p-49025654.entry.js.map +1 -0
- package/dist/roadtrip/p-708f262a.entry.js +2 -0
- package/dist/roadtrip/p-708f262a.entry.js.map +1 -0
- package/dist/roadtrip/{p-9ff79904.entry.js → p-73a21ee9.entry.js} +2 -2
- package/dist/roadtrip/p-73a21ee9.entry.js.map +1 -0
- package/dist/roadtrip/p-ac7b2425.entry.js +2 -0
- package/dist/roadtrip/p-ac7b2425.entry.js.map +1 -0
- package/dist/roadtrip/p-b2c38586.entry.js +2 -0
- package/dist/roadtrip/p-b2c38586.entry.js.map +1 -0
- package/dist/roadtrip/{p-21b1569a.entry.js → p-c09f4088.entry.js} +2 -2
- package/dist/roadtrip/{p-21b1569a.entry.js.map → p-c09f4088.entry.js.map} +1 -1
- package/dist/roadtrip/p-f09d5d41.entry.js +2 -0
- package/dist/roadtrip/p-f09d5d41.entry.js.map +1 -0
- package/dist/roadtrip/roadtrip.esm.js +1 -1
- package/dist/roadtrip/roadtrip.esm.js.map +1 -1
- package/dist/types/components/checkbox/checkbox.d.ts +4 -0
- package/dist/types/components/input-group/input-group.d.ts +7 -1
- package/dist/types/components/navbar-item/navbar-item.d.ts +4 -0
- package/dist/types/components/progress-indicator-horizontal/progress-indicator-horizontal.d.ts +3 -3
- package/dist/types/components/radio/radio.d.ts +4 -0
- package/dist/types/components/tab-button/tab-button.d.ts +4 -0
- package/dist/types/components.d.ts +38 -6
- package/hydrate/index.js +68 -23
- package/package.json +1 -1
- package/dist/roadtrip/p-0dbf612d.entry.js.map +0 -1
- package/dist/roadtrip/p-254ba3c4.entry.js +0 -2
- package/dist/roadtrip/p-254ba3c4.entry.js.map +0 -1
- package/dist/roadtrip/p-48fad2ec.entry.js +0 -2
- package/dist/roadtrip/p-48fad2ec.entry.js.map +0 -1
- package/dist/roadtrip/p-76ccfc61.entry.js +0 -2
- package/dist/roadtrip/p-76ccfc61.entry.js.map +0 -1
- package/dist/roadtrip/p-98cd42c5.entry.js +0 -2
- package/dist/roadtrip/p-98cd42c5.entry.js.map +0 -1
- package/dist/roadtrip/p-9ff79904.entry.js.map +0 -1
- package/dist/roadtrip/p-e9f24444.entry.js +0 -2
- package/dist/roadtrip/p-e9f24444.entry.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r,h as o,H as i}from"./p-f3d586b3.js";const a=':host{display:block}.progress-indicator-horizontal{display:flex;padding-left:0;margin:0;font-family:var(--road-font);line-height:1.5;list-style:none}.progress-indicator-horizontal.progress-indicator-horizontal-header{background-color:var(--road-header-surface)}.progress-indicator-horizontal-item{display:flex;flex:1;flex-direction:column;text-align:center}.progress-indicator-horizontal-item:last-child{margin-top:0.125rem}.progress-indicator-horizontal-item:not(:last-child)::after{position:relative;top:0.8rem;left:calc(50% + 12px);order:-1;width:calc(100% - 24px);height:2px;content:"";background:var(--road-surface-disabled)}.progress-indicator-horizontal-header .progress-indicator-horizontal-item:not(:last-child)::after{position:relative;top:0.8rem;left:calc(50% + 12px);order:-1;width:calc(100% - 24px);height:2px;content:"";background:var(--road-header-surface-disabled)}.progress-indicator-horizontal-item:not(.completed) .progress-indicator-horizontal-link{cursor:not-allowed}.progress-indicator-horizontal-link{z-index:1;display:flex;flex-direction:column;align-items:center;text-decoration:none}.progress-indicator-horizontal-icon{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;font-size:var(--road-font-size-12);font-weight:700;color:var(--road-on-surface-disabled);background:var(--road-surface-disabled);border-radius:50%;fill:currentColor}::slotted([slot="progress-indicator-horizontal-icon"]) road-icon{color:currentColor}.progress-indicator-horizontal-header ::slotted([slot="progress-indicator-horizontal-icon"]) road-icon{color:currentColor}.progress-indicator-horizontal-header .progress-indicator-horizontal-icon{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;font-size:var(--road-font-size-12);font-weight:700;color:var(--road-on-header-surface-disabled);background:var(--road-header-surface-disabled);border-radius:50%;fill:currentColor}.progress-indicator-horizontal-title{display:block;margin-top:0.25rem;font-size:var(--road-body-small);font-weight:700;color:var(--road-on-surface-disabled)}.progress-indicator-horizontal-title span{display:block;font-size:var(--road-body-small);font-weight:400;color:var(--road-on-surface-weak)}.progress-indicator-horizontal-header .progress-indicator-horizontal-title{display:block;margin-top:0.25rem;font-size:var(--road-body-small);font-weight:700;color:var(--road-on-header-surface-disabled)}.progress-indicator-horizontal-header .progress-indicator-horizontal-title span{display:block;font-size:var(--road-body-small);font-weight:400;color:var(--road-on-header-surface-weak)}.completed:not(:last-child)::after{background:var(--road-primary)}.progress-indicator-horizontal-header .completed:not(:last-child)::after,.progress-indicator-horizontal-header .in-progress:not(:last-child)::after{background:var(--road-header-badge)}.current .progress-indicator-horizontal-icon{color:var(--road-on-primary);background:var(--road-primary);border:0}.completed .progress-indicator-horizontal-icon,.in-progress .progress-indicator-horizontal-icon{width:calc(1.5rem - 4px);height:calc(1.5rem - 4px);color:var(--road-primary);background:var(--road-surface);border:2px solid var(--road-primary)}.progress-indicator-horizontal-header .completed .progress-indicator-horizontal-icon,.progress-indicator-horizontal-header .in-progress .progress-indicator-horizontal-icon{color:var(--road-header-badge);background:none;border:2px solid var(--road-header-badge)}.progress-indicator-horizontal-header .current .progress-indicator-horizontal-icon{width:calc(1.5rem);height:calc(1.5rem);color:var(--road-on-header-badge);background:var(--road-header-badge);border:0}.current .progress-indicator-horizontal-title,.completed .progress-indicator-horizontal-title,.in-progress .progress-indicator-horizontal-title{font-weight:700;color:var(--road-on-surface)}.progress-indicator-horizontal-header .current .progress-indicator-horizontal-title,.progress-indicator-horizontal-header .completed .progress-indicator-horizontal-title,.progress-indicator-horizontal-header .in-progress .progress-indicator-horizontal-title{font-weight:700;color:var(--road-on-header-surface)}.in-progress.progress-indicator-horizontal-item:not(:last-child)::before{position:relative;top:0.93rem;left:calc(50% + 12px);order:-1;width:calc(50% - 24px);height:2px;content:"";background:var(--road-primary)}';const t=class{constructor(o){r(this,o);this.color="default";this.numberStep=3;this.stateFirstStep=undefined;this.stateSecondStep=undefined;this.stateThirdStep=undefined;this.urlStep1=undefined;this.urlStep2=undefined;this.urlStep3=undefined}render(){const r=this.color!==undefined?`progress-indicator-horizontal progress-indicator-horizontal-${this.color}`:"progress-indicator-horizontal";const a=this.stateFirstStep!==undefined?`progress-indicator-horizontal-item ${this.stateFirstStep}`:"progress-indicator-horizontal-item";const t=this.stateSecondStep!==undefined?`progress-indicator-horizontal-item ${this.stateSecondStep}`:"progress-indicator-horizontal-item";const e=this.stateThirdStep!==undefined?`progress-indicator-horizontal-item ${this.stateThirdStep}`:"progress-indicator-horizontal-item";const n=this.urlStep1!==undefined?`${this.urlStep1}`:"#";const s=this.urlStep2!==undefined?`${this.urlStep2}`:"#";const d=this.urlStep3!==undefined?`${this.urlStep3}`:"#";return o(i,null,o("nav",null,o("ul",{class:`${r}`},o("li",{class:`${a}`},o("a",{class:"progress-indicator-horizontal-link",href:`${n}`},o("span",{class:"progress-indicator-horizontal-icon"},o("slot",{name:"progress-indicator-horizontal-icon"})),o("span",{class:"progress-indicator-horizontal-title"},o("slot",{name:"progress-indicator-horizontal-title"})))),o("li",{class:`${t}`},o("a",{class:"progress-indicator-horizontal-link",href:`${s}`},o("span",{class:"progress-indicator-horizontal-icon"},o("slot",{name:"progress-indicator-horizontal-icon2"})),o("span",{class:"progress-indicator-horizontal-title"},o("slot",{name:"progress-indicator-horizontal-title2"})))),this.numberStep==3&&o("li",{class:`${e}`},o("a",{class:"progress-indicator-horizontal-link",href:`${d}`},o("span",{class:"progress-indicator-horizontal-icon"},o("slot",{name:"progress-indicator-horizontal-icon3"})),o("span",{class:"progress-indicator-horizontal-title"},o("slot",{name:"progress-indicator-horizontal-title3"})))))))}};t.style=a;export{t as road_progress_indicator_horizontal};
|
|
2
|
+
//# sourceMappingURL=p-708f262a.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["progressIndicatorHorizontalCss","Stepper","render","colorClass","this","color","undefined","stateClass","stateFirstStep","stateSecondStepClass","stateSecondStep","stateThirdStepClass","stateThirdStep","urlStep1","urlStep2","urlStep3","h","Host","class","href","name","numberStep"],"sources":["src/components/progress-indicator-horizontal/progress-indicator-horizontal.css?tag=road-progress-indicator-horizontal&encapsulation=shadow","src/components/progress-indicator-horizontal/progress-indicator-horizontal.tsx"],"sourcesContent":["/*\n * Progress-indicator-horizontal\n *\n * Index\n * - Item\n * - Link\n * - Icon\n * - Title\n * - Completed\n */\n\n:host {\n display: block;\n}\n\n/* PROGRESS INDICATOR HORIZONTAL\n -------------------- */\n\n.progress-indicator-horizontal {\n display: flex;\n padding-left: 0;\n margin: 0;\n font-family: var(--road-font);\n line-height: 1.5;\n list-style: none;\n}\n\n.progress-indicator-horizontal.progress-indicator-horizontal-header {\n background-color: var(--road-header-surface);\n}\n\n\n/* PROGRESS INDICATOR HORIZONTAL ITEM\n -------------------- */\n\n.progress-indicator-horizontal-item {\n display: flex;\n flex: 1;\n flex-direction: column;\n text-align: center;\n}\n\n.progress-indicator-horizontal-item:last-child {\n margin-top: 0.125rem;\n}\n\n/**\n * Line between items\n */\n\n\n.progress-indicator-horizontal-item:not(:last-child)::after {\n position: relative;\n top: 0.8rem;\n left: calc(50% + 12px);\n order: -1;\n width: calc(100% - 24px);\n height: 2px;\n content: \"\";\n background: var(--road-surface-disabled);\n}\n\n.progress-indicator-horizontal-header .progress-indicator-horizontal-item:not(:last-child)::after {\n position: relative;\n top: 0.8rem;\n left: calc(50% + 12px);\n order: -1;\n width: calc(100% - 24px);\n height: 2px;\n content: \"\";\n background: var(--road-header-surface-disabled);\n}\n\n\n/**\n * Disabled click for current and next steps\n */\n\n\n.progress-indicator-horizontal-item:not(.completed) .progress-indicator-horizontal-link {\n cursor: not-allowed;\n}\n\n/* PROGRESS INDICATOR HORIZONTAL LINK\n -------------------- */\n\n.progress-indicator-horizontal-link {\n z-index: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n text-decoration: none;\n}\n\n/* PROGRESS INDICATOR HORIZONTAL ICON\n -------------------- */\n\n.progress-indicator-horizontal-icon {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 1.5rem;\n height: 1.5rem;\n font-size: var(--road-font-size-12);\n font-weight: 700;\n color: var(--road-on-surface-disabled);\n background: var(--road-surface-disabled);\n border-radius: 50%;\n fill: currentColor;\n}\n\n::slotted([slot=\"progress-indicator-horizontal-icon\"]) road-icon{\n color: currentColor;\n}\n\n.progress-indicator-horizontal-header ::slotted([slot=\"progress-indicator-horizontal-icon\"]) road-icon{\n color: currentColor;\n}\n\n.progress-indicator-horizontal-header .progress-indicator-horizontal-icon {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 1.5rem;\n height: 1.5rem;\n font-size: var(--road-font-size-12);\n font-weight: 700;\n color: var(--road-on-header-surface-disabled);\n background: var(--road-header-surface-disabled);\n border-radius: 50%;\n fill: currentColor;\n}\n\n/* PROGRESS INDICATOR HORIZONTAL TITLE\n -------------------- */\n\n.progress-indicator-horizontal-title {\n display: block;\n margin-top: 0.25rem;\n font-size: var(--road-body-small);\n font-weight: 700;\n color: var(--road-on-surface-disabled);\n}\n\n.progress-indicator-horizontal-title span{\n display: block;\n font-size: var(--road-body-small);\n font-weight: 400;\n color: var(--road-on-surface-weak);\n}\n\n.progress-indicator-horizontal-header .progress-indicator-horizontal-title {\n display: block;\n margin-top: 0.25rem;\n font-size: var(--road-body-small);\n font-weight: 700;\n color: var(--road-on-header-surface-disabled);\n}\n\n.progress-indicator-horizontal-header .progress-indicator-horizontal-title span{\n display: block;\n font-size: var(--road-body-small);\n font-weight: 400;\n color: var(--road-on-header-surface-weak);\n}\n\n/* STEP COMPLETED\n -------------------- */\n\n.completed:not(:last-child)::after {\n background: var(--road-primary);\n}\n\n.progress-indicator-horizontal-header .completed:not(:last-child)::after,\n.progress-indicator-horizontal-header .in-progress:not(:last-child)::after {\n background: var(--road-header-badge);\n}\n\n.current .progress-indicator-horizontal-icon {\n color: var(--road-on-primary);\n background: var(--road-primary);\n border: 0;\n}\n\n.completed .progress-indicator-horizontal-icon,\n.in-progress .progress-indicator-horizontal-icon{\n width: calc(1.5rem - 4px);\n height: calc(1.5rem - 4px);\n color: var(--road-primary);\n background: var(--road-surface);\n border: 2px solid var(--road-primary);\n}\n\n.progress-indicator-horizontal-header .completed .progress-indicator-horizontal-icon,\n.progress-indicator-horizontal-header .in-progress .progress-indicator-horizontal-icon {\n color: var(--road-header-badge);\n background: none;\n border: 2px solid var(--road-header-badge);\n}\n\n.progress-indicator-horizontal-header .current .progress-indicator-horizontal-icon {\n width: calc(1.5rem);\n height: calc(1.5rem);\n color: var(--road-on-header-badge);\n background: var(--road-header-badge);\n border: 0;\n}\n\n.current .progress-indicator-horizontal-title,\n.completed .progress-indicator-horizontal-title,\n.in-progress .progress-indicator-horizontal-title {\n font-weight: 700;\n color: var(--road-on-surface);\n}\n\n.progress-indicator-horizontal-header .current .progress-indicator-horizontal-title,\n.progress-indicator-horizontal-header .completed .progress-indicator-horizontal-title,\n.progress-indicator-horizontal-header .in-progress .progress-indicator-horizontal-title {\n font-weight: 700;\n color: var(--road-on-header-surface);\n}\n\n/* IN PROGRESS\n-------------------- */\n\n.in-progress.progress-indicator-horizontal-item:not(:last-child)::before {\n position: relative;\n top: 0.93rem;\n left: calc(50% + 12px);\n order: -1;\n width: calc(50% - 24px);\n height: 2px;\n content: \"\";\n background: var(--road-primary);\n}\n","import { Component, Host, h, Prop } from '@stencil/core';\n\n/**\n * @slot progress-indicator-horizontal-icon - if the state of the step 1 is completed add\n * `<road-icon name=\"check-small\" class=\"d-block\" style=\"color: currentColor;\"></road-icon>` by default.\n * @slot progress-indicator-horizontal-title \n * @slot progress-indicator-horizontal-icon2 - if the state of the step 2 is completed add\n * `<road-icon name=\"check-small\" class=\"d-block\" style=\"color: currentColor;\"></road-icon>` by default.\n * @slot progress-indicator-horizontal-title2 \n * @slot progress-indicator-horizontal-icon3 - if the state of the step 3 is completed add\n * `<road-icon name=\"check-small\" class=\"d-block\" style=\"color: currentColor;\"></road-icon>` by default.\n * @slot progress-indicator-horizontal-title3\n */\n\n@Component({\n tag: 'road-progress-indicator-horizontal',\n styleUrl: 'progress-indicator-horizontal.css',\n shadow: true,\n})\nexport class Stepper {\n\n /**\n * The color progress-indicator-horizontal.\n */\n @Prop({ reflect: true }) color?: 'default' | 'header' = 'default';\n\n /**\n * The nombre of steps.\n */\n @Prop() numberStep?: 3 | 2 = 3;\n\n /**\n * The color of the first step.\n */\n @Prop() stateFirstStep?: 'default' | 'current' | 'comleted' | 'in-progress';\n\n /**\n * The color of the second step.\n */\n @Prop() stateSecondStep?: 'default' | 'current' | 'comleted' | 'in-progress';\n\n /**\n * The color of the third step.\n */\n @Prop() stateThirdStep?: 'default' | 'current' | 'comleted' | 'in-progress';\n\n /**\n * The url of the first step.\n */\n @Prop() urlStep1?: string;\n\n /**\n * The url of the first step.\n */\n @Prop() urlStep2?: string;\n\n /**\n * The url of the first step.\n */\n @Prop() urlStep3?: string;\n \n\n render() {\n\n const colorClass = this.color !== undefined ? `progress-indicator-horizontal progress-indicator-horizontal-${this.color}` : 'progress-indicator-horizontal';\n const stateClass = this.stateFirstStep !== undefined ? `progress-indicator-horizontal-item ${this.stateFirstStep}` : 'progress-indicator-horizontal-item';\n const stateSecondStepClass = this.stateSecondStep !== undefined ? `progress-indicator-horizontal-item ${this.stateSecondStep}` : 'progress-indicator-horizontal-item';\n const stateThirdStepClass = this.stateThirdStep !== undefined ? `progress-indicator-horizontal-item ${this.stateThirdStep}` : 'progress-indicator-horizontal-item';\n const urlStep1 = this.urlStep1 !== undefined ? `${this.urlStep1}` : '#';\n const urlStep2 = this.urlStep2 !== undefined ? `${this.urlStep2}` : '#';\n const urlStep3 = this.urlStep3 !== undefined ? `${this.urlStep3}` : '#';\n\n return (\n <Host>\n <nav>\n <ul class={`${colorClass}`}>\n <li class={`${stateClass}`}>\n <a class=\"progress-indicator-horizontal-link\" href={`${urlStep1}`}>\n <span class=\"progress-indicator-horizontal-icon\">\n <slot name=\"progress-indicator-horizontal-icon\"/>\n </span>\n <span class=\"progress-indicator-horizontal-title\">\n <slot name=\"progress-indicator-horizontal-title\"/>\n </span>\n </a>\n </li>\n <li class={`${stateSecondStepClass}`}>\n <a class=\"progress-indicator-horizontal-link\" href={`${urlStep2}`}>\n <span class=\"progress-indicator-horizontal-icon\">\n <slot name=\"progress-indicator-horizontal-icon2\"/>\n </span>\n <span class=\"progress-indicator-horizontal-title\">\n <slot name=\"progress-indicator-horizontal-title2\"/>\n </span>\n </a>\n </li>\n {this.numberStep == 3 && <li class={`${stateThirdStepClass}`}>\n <a class=\"progress-indicator-horizontal-link\" href={`${urlStep3}`}>\n <span class=\"progress-indicator-horizontal-icon\">\n <slot name=\"progress-indicator-horizontal-icon3\"/>\n </span>\n <span class=\"progress-indicator-horizontal-title\">\n <slot name=\"progress-indicator-horizontal-title3\"/>\n </span>\n </a>\n </li>}\n \n </ul>\n </nav>\n </Host>\n );\n }\n\n}\n"],"mappings":"6CAAA,MAAMA,EAAiC,wzI,MCmB1BC,EAAO,M,oCAKwC,U,gBAK3B,E,mKAiC5B,MAAAC,GAEE,MAAMC,EAAaC,KAAKC,QAAUC,UAAY,+DAA+DF,KAAKC,QAAU,gCAC5H,MAAME,EAAaH,KAAKI,iBAAmBF,UAAY,sCAAsCF,KAAKI,iBAAmB,qCACrH,MAAMC,EAAuBL,KAAKM,kBAAoBJ,UAAY,sCAAsCF,KAAKM,kBAAoB,qCACjI,MAAMC,EAAsBP,KAAKQ,iBAAmBN,UAAY,sCAAsCF,KAAKQ,iBAAmB,qCAC9H,MAAMC,EAAWT,KAAKS,WAAaP,UAAY,GAAGF,KAAKS,WAAa,IACpE,MAAMC,EAAWV,KAAKU,WAAaR,UAAY,GAAGF,KAAKU,WAAa,IACpE,MAAMC,EAAWX,KAAKW,WAAaT,UAAY,GAAGF,KAAKW,WAAa,IAEpE,OACEC,EAACC,EAAI,KACHD,EAAA,WACKA,EAAA,MAAIE,MAAO,GAAGf,KACda,EAAA,MAAIE,MAAO,GAAGX,KACZS,EAAA,KAAGE,MAAM,qCAAqCC,KAAM,GAAGN,KACrDG,EAAA,QAAME,MAAM,sCACVF,EAAA,QAAMI,KAAK,wCAEbJ,EAAA,QAAME,MAAM,uCACVF,EAAA,QAAMI,KAAK,2CAIjBJ,EAAA,MAAIE,MAAO,GAAGT,KACbO,EAAA,KAAGE,MAAM,qCAAqCC,KAAM,GAAGL,KACrDE,EAAA,QAAME,MAAM,sCACVF,EAAA,QAAMI,KAAK,yCAEbJ,EAAA,QAAME,MAAM,uCACVF,EAAA,QAAMI,KAAK,4CAIhBhB,KAAKiB,YAAc,GAAKL,EAAA,MAAIE,MAAO,GAAGP,KACrCK,EAAA,KAAGE,MAAM,qCAAqCC,KAAM,GAAGJ,KACrDC,EAAA,QAAME,MAAM,sCACVF,EAAA,QAAMI,KAAK,yCAEbJ,EAAA,QAAME,MAAM,uCACVF,EAAA,QAAMI,KAAK,8C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,H as o,a}from"./p-f3d586b3.js";const r=':host{position:relative;box-sizing:border-box;display:flex;flex:1;flex-basis:0;flex-direction:column;flex-grow:1;align-items:center;justify-content:center;text-align:center;white-space:nowrap}@media (min-width: 1200px){:host{flex-grow:inherit;width:100%;padding:0.5rem}}:host(.tab-disabled),:host(.tab-disabled) road-tooltip,:host(.tab-disabled) road-tooltip road-icon,:host(.tab-disabled) ::slotted(road-icon){color:var(--road-on-surface-disabled);cursor:not-allowed;fill:var(--road-on-surface-disabled)}:host(.tab-selected),:host(.tab-selected) road-tooltip road-icon,:host(.tab-selected) ::slotted(road-icon){color:var(--road-on-button-tertiary);fill:var(--road-on-button-tertiary)}:host(.tab-selected)::after{position:absolute;bottom:-12px;left:0;display:block;width:100%;height:4px;color:var(--road-on-button-tertiary);content:"";background-color:var(--road-on-button-tertiary)}@media (min-width: 1200px){:host(.tab-selected)::after{bottom:auto;left:0;width:4px;height:100%}}:host(.focus-visible) ::slotted(road-icon),:host(.focus-visible) ::slotted(road-icon)::after,:host(.focus-visible) ::slotted(road-label),:host(.focus-visible) ::slotted(road-label)::after,:host(:hover) ::slotted(road-icon),:host(:hover) ::slotted(road-icon)::after,:host(:hover) ::slotted(road-label),:host(:hover) ::slotted(road-label)::after{color:var(--road-on-button-tertiary)}:host(.tab-disabled.focus-visible) ::slotted(road-icon),:host(.tab-disabled.focus-visible) ::slotted(road-label),:host(.tab-disabled:hover) ::slotted(road-icon),:host(.tab-disabled:hover) ::slotted(road-label){color:var(--road-on-surface-disabled);cursor:not-allowed;fill:var(--road-on-surface-disabled)}.button-native{position:relative;box-sizing:border-box;display:flex;flex-direction:inherit;align-items:inherit;justify-content:inherit;width:100%;height:100%;margin:0;overflow:visible;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;color:inherit;text-align:inherit;text-decoration:none;text-indent:inherit;text-overflow:inherit;text-transform:inherit;letter-spacing:inherit;white-space:inherit;cursor:pointer;background:transparent;border-color:initial;border-style:initial;border-width:0;border-radius:inherit;border-image:initial;outline:0;-webkit-tap-highlight-color:rgba(0, 0, 0, 0)}:host(.tab-disabled) .button-native{cursor:not-allowed}.button-inner{position:relative;z-index:1;display:flex;flex-flow:inherit;align-items:inherit;justify-content:inherit;width:100%;height:100%}::slotted(road-icon){display:block;width:2rem;height:2rem;margin-right:auto;margin-bottom:0.25rem;margin-left:auto;fill:currentColor}@media (min-width: 1200px){:host ::slotted(road-tooltip){width:100%}}::slotted(road-label){position:relative;box-sizing:border-box;display:flex;flex:1;flex-direction:column;font-size:var(--road-label-small);font-weight:700;text-align:center;white-space:nowrap}@media (min-width: 1200px){::slotted(road-label){display:block}}::slotted(road-badge){position:absolute;top:4px;left:calc(50% + 0.375rem);z-index:1;box-sizing:border-box;height:auto;font-size:var(--road-font-size-10);font-weight:400}';const s=class{constructor(i){t(this,i);this.roadnavbaritemclick=e(this,"roadnavbaritemclick",7);this.roadNavbarItemClick=e(this,"roadNavbarItemClick",7);this.onKeyUp=t=>{if(t.key==="Enter"||t.key===" "){this.selectTab(t)}};this.onClick=t=>{this.selectTab(t)};this.disabled=false;this.download=undefined;this.href=undefined;this.rel=undefined;this.selected=false;this.tab=undefined;this.target=undefined}onNavbarChanged(t){this.selected=this.tab===t.detail.tab}selectTab(t){if(this.tab!==undefined){if(!this.disabled){this.roadnavbaritemclick.emit({tab:this.tab,href:this.href,selected:this.selected});this.roadNavbarItemClick.emit({tab:this.tab,href:this.href,selected:this.selected})}if(this.href===undefined){t.preventDefault()}}}render(){const{href:t,rel:e,target:a,selected:r,tab:s,disabled:l}=this;const n={download:this.download,href:t,rel:e,target:a};return i(o,{onClick:this.onClick,onKeyup:this.onKeyUp,role:"
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as e,h as i,H as o,a}from"./p-f3d586b3.js";const r=':host{position:relative;box-sizing:border-box;display:flex;flex:1;flex-basis:0;flex-direction:column;flex-grow:1;align-items:center;justify-content:center;text-align:center;white-space:nowrap}@media (min-width: 1200px){:host{flex-grow:inherit;width:100%;padding:0.5rem}}:host(.tab-disabled),:host(.tab-disabled) road-tooltip,:host(.tab-disabled) road-tooltip road-icon,:host(.tab-disabled) ::slotted(road-icon){color:var(--road-on-surface-disabled);cursor:not-allowed;fill:var(--road-on-surface-disabled)}:host(.tab-selected),:host(.tab-selected) road-tooltip road-icon,:host(.tab-selected) ::slotted(road-icon){color:var(--road-on-button-tertiary);fill:var(--road-on-button-tertiary)}:host(.tab-selected)::after{position:absolute;bottom:-12px;left:0;display:block;width:100%;height:4px;color:var(--road-on-button-tertiary);content:"";background-color:var(--road-on-button-tertiary)}@media (min-width: 1200px){:host(.tab-selected)::after{bottom:auto;left:0;width:4px;height:100%}}:host(.focus-visible) ::slotted(road-icon),:host(.focus-visible) ::slotted(road-icon)::after,:host(.focus-visible) ::slotted(road-label),:host(.focus-visible) ::slotted(road-label)::after,:host(:hover) ::slotted(road-icon),:host(:hover) ::slotted(road-icon)::after,:host(:hover) ::slotted(road-label),:host(:hover) ::slotted(road-label)::after{color:var(--road-on-button-tertiary)}:host(.tab-disabled.focus-visible) ::slotted(road-icon),:host(.tab-disabled.focus-visible) ::slotted(road-label),:host(.tab-disabled:hover) ::slotted(road-icon),:host(.tab-disabled:hover) ::slotted(road-label){color:var(--road-on-surface-disabled);cursor:not-allowed;fill:var(--road-on-surface-disabled)}.button-native{position:relative;box-sizing:border-box;display:flex;flex-direction:inherit;align-items:inherit;justify-content:inherit;width:100%;height:100%;margin:0;overflow:visible;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;color:inherit;text-align:inherit;text-decoration:none;text-indent:inherit;text-overflow:inherit;text-transform:inherit;letter-spacing:inherit;white-space:inherit;cursor:pointer;background:transparent;border-color:initial;border-style:initial;border-width:0;border-radius:inherit;border-image:initial;outline:0;-webkit-tap-highlight-color:rgba(0, 0, 0, 0)}:host(.tab-disabled) .button-native{cursor:not-allowed}.button-inner{position:relative;z-index:1;display:flex;flex-flow:inherit;align-items:inherit;justify-content:inherit;width:100%;height:100%}::slotted(road-icon){display:block;width:2rem;height:2rem;margin-right:auto;margin-bottom:0.25rem;margin-left:auto;fill:currentColor}@media (min-width: 1200px){:host ::slotted(road-tooltip){width:100%}}::slotted(road-label){position:relative;box-sizing:border-box;display:flex;flex:1;flex-direction:column;font-size:var(--road-label-small);font-weight:700;text-align:center;white-space:nowrap}@media (min-width: 1200px){::slotted(road-label){display:block}}::slotted(road-badge){position:absolute;top:4px;left:calc(50% + 0.375rem);z-index:1;box-sizing:border-box;height:auto;font-size:var(--road-font-size-10);font-weight:400}';const s=class{constructor(i){t(this,i);this.roadnavbaritemclick=e(this,"roadnavbaritemclick",7);this.roadNavbarItemClick=e(this,"roadNavbarItemClick",7);this.onKeyUp=t=>{if(t.key==="Enter"||t.key===" "){this.selectTab(t)}};this.onClick=t=>{this.selectTab(t)};this.disabled=false;this.download=undefined;this.href=undefined;this.rel=undefined;this.selected=false;this.tab=undefined;this.target=undefined}onNavbarChanged(t){this.selected=this.tab===t.detail.tab}handleSelectedChange(t){if(t){this.el.focus()}}selectTab(t){if(this.tab!==undefined){if(!this.disabled){this.roadnavbaritemclick.emit({tab:this.tab,href:this.href,selected:this.selected});this.roadNavbarItemClick.emit({tab:this.tab,href:this.href,selected:this.selected})}if(this.href===undefined){t.preventDefault()}}}render(){const{href:t,rel:e,target:a,selected:r,tab:s,disabled:l}=this;const n={download:this.download,href:t,rel:e,target:a};return i(o,{onClick:this.onClick,onKeyup:this.onKeyUp,role:"menuitem",tabindex:"0","aria-selected":r?"true":null,id:s!==undefined?`navbar-item-${s}`:null,disabled:l,class:{"navbar-item":true,"tab-selected":r,"tab-disabled":l}},i("a",Object.assign({},n,{tabIndex:-1,class:"button-native",part:"native"}),i("span",{class:"button-inner"},i("slot",null))))}get el(){return a(this)}static get watchers(){return{selected:["handleSelectedChange"]}}};s.style=r;export{s as road_navbar_item};
|
|
2
|
+
//# sourceMappingURL=p-73a21ee9.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["navbarItemCss","NavbarItem","this","onKeyUp","ev","key","selectTab","onClick","onNavbarChanged","selected","tab","detail","handleSelectedChange","newValue","el","focus","undefined","disabled","roadnavbaritemclick","emit","href","roadNavbarItemClick","preventDefault","render","rel","target","attrs","download","h","Host","onKeyup","role","tabindex","id","class","Object","assign","tabIndex","part"],"sources":["src/components/navbar-item/navbar-item.css?tag=road-navbar-item&encapsulation=shadow","src/components/navbar-item/navbar-item.tsx"],"sourcesContent":["/*\n * Navbar item\n *\n * Index\n * - Native\n * - Inner\n * - Icon\n * - Badge\n */\n\n\n:host {\n position: relative;\n box-sizing: border-box;\n display: flex;\n flex: 1;\n flex-basis: 0;\n flex-direction: column;\n flex-grow: 1;\n align-items: center;\n justify-content: center;\n text-align: center;\n white-space: nowrap;\n}\n\n@media (min-width: 1200px) {\n\n :host {\n flex-grow: inherit;\n width: 100%;\n padding: 0.5rem;\n }\n\n}\n\n/**\n * Disabled\n */\n\n:host(.tab-disabled),\n:host(.tab-disabled) road-tooltip,\n:host(.tab-disabled) road-tooltip road-icon,\n:host(.tab-disabled) ::slotted(road-icon) {\n color: var(--road-on-surface-disabled);\n cursor: not-allowed;\n fill: var(--road-on-surface-disabled);\n}\n\n/**\n * Selected state\n */\n\n:host(.tab-selected),\n:host(.tab-selected) road-tooltip road-icon,\n:host(.tab-selected) ::slotted(road-icon) {\n color: var(--road-on-button-tertiary);\n fill: var(--road-on-button-tertiary);\n}\n\n:host(.tab-selected)::after {\n position: absolute;\n bottom: -12px;\n left: 0;\n display: block;\n width: 100%;\n height: 4px;\n color: var(--road-on-button-tertiary);\n content: \"\";\n background-color: var(--road-on-button-tertiary);\n}\n\n@media (min-width: 1200px) {\n\n :host(.tab-selected)::after {\n bottom: auto;\n left: 0;\n width: 4px;\n height: 100%;\n }\n\n}\n\n\n/**\n * Focus on Tab state\n */\n\n:host(.focus-visible) ::slotted(road-icon),\n:host(.focus-visible) ::slotted(road-icon)::after,\n:host(.focus-visible) ::slotted(road-label),\n:host(.focus-visible) ::slotted(road-label)::after,\n:host(:hover) ::slotted(road-icon),\n:host(:hover) ::slotted(road-icon)::after,\n:host(:hover) ::slotted(road-label),\n:host(:hover) ::slotted(road-label)::after {\n color: var(--road-on-button-tertiary);\n}\n\n:host(.tab-disabled.focus-visible) ::slotted(road-icon),\n:host(.tab-disabled.focus-visible) ::slotted(road-label),\n:host(.tab-disabled:hover) ::slotted(road-icon),\n:host(.tab-disabled:hover) ::slotted(road-label) {\n color: var(--road-on-surface-disabled);\n cursor: not-allowed;\n fill: var(--road-on-surface-disabled);\n}\n\n\n/* NATIVE\n -------------------- */\n\n.button-native {\n position: relative;\n box-sizing: border-box;\n display: flex;\n flex-direction: inherit;\n align-items: inherit;\n justify-content: inherit;\n width: 100%;\n height: 100%;\n margin: 0;\n overflow: visible;\n font-family: inherit;\n font-size: inherit;\n font-style: inherit;\n font-weight: inherit;\n color: inherit;\n text-align: inherit;\n text-decoration: none;\n text-indent: inherit;\n text-overflow: inherit;\n text-transform: inherit;\n letter-spacing: inherit;\n white-space: inherit;\n cursor: pointer;\n background: transparent;\n border-color: initial;\n border-style: initial;\n border-width: 0;\n border-radius: inherit;\n border-image: initial;\n outline: 0;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n\n:host(.tab-disabled) .button-native {\n cursor: not-allowed;\n}\n\n/* INNER\n -------------------- */\n\n.button-inner {\n position: relative;\n z-index: 1;\n display: flex;\n flex-flow: inherit;\n align-items: inherit;\n justify-content: inherit;\n width: 100%;\n height: 100%;\n}\n\n/* ICON\n -------------------- */\n\n::slotted(road-icon) {\n display: block;\n width: 2rem;\n height: 2rem;\n margin-right: auto;\n margin-bottom: 0.25rem;\n margin-left: auto;\n fill: currentColor;\n}\n\n/* TOOLTIP\n -------------------- */\n\n@media (min-width: 1200px) {\n\n :host ::slotted(road-tooltip) {\n width: 100%;\n }\n\n}\n\n/* LABEL\n -------------------- */\n\n::slotted(road-label) {\n position: relative;\n box-sizing: border-box;\n display: flex;\n flex: 1;\n flex-direction: column;\n font-size: var(--road-label-small);\n font-weight: 700;\n text-align: center;\n white-space: nowrap;\n}\n\n@media (min-width: 1200px) {\n\n ::slotted(road-label) {\n display: block;\n }\n}\n\n/* BADGE\n -------------------- */\n\n::slotted(road-badge) {\n position: absolute;\n top: 4px;\n left: calc(50% + 0.375rem);\n z-index: 1;\n box-sizing: border-box;\n height: auto;\n font-size: var(--road-font-size-10);\n font-weight: 400;\n}\n","import { Component, Host, h, Element, Prop, Event, EventEmitter, Listen, Watch } from '@stencil/core';\n\n/**\n * @slot - Content of the item, it should be road-icon and road-label elements.\n *\n * @part native - The native HTML anchor element that wraps all child elements.\n */\n\n@Component({\n tag: 'road-navbar-item',\n styleUrl: 'navbar-item.css',\n shadow: true,\n})\nexport class NavbarItem {\n\n @Element() el!: HTMLRoadNavbarItemElement;\n\n /**\n * If `true`, the user cannot interact with the tab button.\n */\n @Prop() disabled = false;\n\n /**\n * This attribute instructs browsers to download a URL instead of navigating to\n * it, so the user will be prompted to save it as a local file. If the attribute\n * has a value, it is used as the pre-filled file name in the Save prompt\n * (the user can still change the file name if they want).\n */\n @Prop() download: string | undefined;\n\n /**\n * Contains a URL or a URL fragment that the hyperlink points to.\n * If this property is set, an anchor tag will be rendered.\n */\n @Prop() href: string | undefined;\n\n /**\n * Specifies the relationship of the target object to the link object.\n * The value is a space-separated list of [link types](https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types).\n */\n @Prop() rel: string | undefined;\n\n /**\n * The selected tab component\n */\n @Prop({ mutable: true }) selected = false;\n\n /**\n * A tab id must be provided for each `road-tab`. It's used internally to reference\n * the selected tab.\n */\n @Prop() tab?: string;\n\n /**\n * Specifies where to display the linked URL.\n * Only applies when an `href` is provided.\n * Special keywords: `\"_blank\"`, `\"_self\"`, `\"_parent\"`, `\"_top\"`.\n */\n @Prop() target: string | undefined;\n\n /**\n * Emitted when the tab bar is clicked\n * @internal\n */\n @Event() roadnavbaritemclick!: EventEmitter;\n /** @internal */\n @Event() roadNavbarItemClick!: EventEmitter;\n\n @Listen('roadNavbarChanged', { target: 'window' })\n @Listen('roadnavbarchanged', { target: 'window' })\n onNavbarChanged(ev: CustomEvent) {\n this.selected = this.tab === ev.detail.tab;\n }\n\n /**\n * Watch for changes to `selected` and move focus to this element if `selected` is true.\n */\n @Watch('selected')\n handleSelectedChange(newValue: boolean) {\n if (newValue) {\n this.el.focus();\n }\n }\n\n private selectTab(ev: Event | KeyboardEvent) {\n if (this.tab !== undefined) {\n if (!this.disabled) {\n this.roadnavbaritemclick.emit({\n tab: this.tab,\n href: this.href,\n selected: this.selected,\n });\n this.roadNavbarItemClick.emit({\n tab: this.tab,\n href: this.href,\n selected: this.selected,\n });\n }\n if(this.href === undefined) {\n ev.preventDefault();\n }\n }\n }\n\n private onKeyUp = (ev: KeyboardEvent) => {\n if (ev.key === 'Enter' || ev.key === ' ') {\n this.selectTab(ev);\n }\n };\n\n private onClick = (ev: Event) => {\n this.selectTab(ev);\n };\n\n render() {\n const { href, rel, target, selected, tab, disabled } = this;\n const attrs = {\n download: this.download,\n href,\n rel,\n target,\n };\n\n return (\n <Host\n onClick={this.onClick}\n onKeyup={this.onKeyUp}\n role=\"menuitem\"\n tabindex=\"0\"\n aria-selected={selected ? 'true' : null}\n id={tab !== undefined ? `navbar-item-${tab}` : null}\n disabled={disabled}\n class={{\n 'navbar-item': true,\n 'tab-selected': selected,\n 'tab-disabled': disabled,\n }}\n >\n <a {...attrs} tabIndex={-1} class=\"button-native\" part=\"native\">\n <span class=\"button-inner\">\n <slot/>\n </span>\n </a>\n </Host>\n );\n }\n\n}\n"],"mappings":"2DAAA,MAAMA,EAAgB,iiG,MCaTC,EAAU,M,2IA2FbC,KAAAC,QAAWC,IACjB,GAAIA,EAAGC,MAAQ,SAAWD,EAAGC,MAAQ,IAAK,CACxCH,KAAKI,UAAUF,E,GAIXF,KAAAK,QAAWH,IACjBF,KAAKI,UAAUF,EAAG,E,cA3FD,M,6EAyBiB,M,yCAyBpC,eAAAI,CAAgBJ,GACdF,KAAKO,SAAWP,KAAKQ,MAAQN,EAAGO,OAAOD,G,CAOzC,oBAAAE,CAAqBC,GACnB,GAAIA,EAAU,CACZX,KAAKY,GAAGC,O,EAIJ,SAAAT,CAAUF,GAChB,GAAIF,KAAKQ,MAAQM,UAAW,CAC1B,IAAKd,KAAKe,SAAU,CAClBf,KAAKgB,oBAAoBC,KAAK,CAC5BT,IAAKR,KAAKQ,IACVU,KAAMlB,KAAKkB,KACXX,SAAUP,KAAKO,WAEjBP,KAAKmB,oBAAoBF,KAAK,CAC5BT,IAAKR,KAAKQ,IACVU,KAAMlB,KAAKkB,KACXX,SAAUP,KAAKO,U,CAGnB,GAAGP,KAAKkB,OAASJ,UAAW,CAC1BZ,EAAGkB,gB,GAeT,MAAAC,GACE,MAAMH,KAAEA,EAAII,IAAEA,EAAGC,OAAEA,EAAMhB,SAAEA,EAAQC,IAAEA,EAAGO,SAAEA,GAAaf,KACvD,MAAMwB,EAAQ,CACZC,SAAUzB,KAAKyB,SACfP,OACAI,MACAC,UAGF,OACEG,EAACC,EAAI,CACHtB,QAASL,KAAKK,QACduB,QAAS5B,KAAKC,QACd4B,KAAK,WACLC,SAAS,IAAG,gBACGvB,EAAW,OAAS,KACnCwB,GAAIvB,IAAQM,UAAY,eAAeN,IAAQ,KAC/CO,SAAUA,EACViB,MAAO,CACL,cAAe,KACf,eAAgBzB,EAChB,eAAgBQ,IAGlBW,EAAA,IAAAO,OAAAC,OAAA,GAAOV,EAAK,CAAEW,UAAW,EAAGH,MAAM,gBAAgBI,KAAK,WACrDV,EAAA,QAAMM,MAAM,gBACVN,EAAA,e"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as c,c as e,h as o,H as r}from"./p-f3d586b3.js";import{c as a,b as i}from"./p-db82e012.js";import"./p-1ccae339.js";const s='.sc-road-checkbox-h{position:relative;display:block;margin-bottom:1.5rem;font-family:var(--road-font, sans-serif);font-size:var(--road-font-size-16);line-height:1.5;color:var(--road-on-surface)}.form-check-input.sc-road-checkbox{position:absolute;z-index:-1;opacity:0}.form-check-label.sc-road-checkbox{position:relative;display:inline-flex;margin:0;cursor:pointer;-webkit-tap-highlight-color:rgba(0, 0, 0, 0)}.form-check-label.sc-road-checkbox::before{box-sizing:border-box;display:block;flex-shrink:0;width:1.25rem;height:1.25rem;margin:0 0.75rem 0 0;content:"";background:var(--road-surface);border:1px solid var(--road-input-outline);border-radius:0.25rem;transition:border 0.2s ease-in-out, background 0.2s ease-in-out}.form-check-label-span.sc-road-checkbox{color:var(--road-on-surface-weak)}.form-check-icon.sc-road-checkbox{position:absolute;top:0;left:0;box-sizing:border-box;display:block;width:1.25rem;height:1.25rem;color:var(--road-primary-contrast);opacity:0;transition:opacity 0.2s ease-in-out}@media (hover: hover){.form-check-input.sc-road-checkbox:not(:disabled)~.form-check-label.sc-road-checkbox:hover::before{border-color:var(--road-input-surface-variant)}.form-check-input.sc-road-checkbox:not(:disabled):checked~.form-check-label.sc-road-checkbox:hover::before,.form-check-input.sc-road-checkbox:not(:disabled):indeterminate~.form-check-label.sc-road-checkbox:hover::before{background:var(--road-input-surface-variant)}}.form-check-input.sc-road-checkbox:checked~.form-check-label.sc-road-checkbox .form-check-icon.sc-road-checkbox,.form-check-input.sc-road-checkbox:indeterminate~.form-check-label.sc-road-checkbox .form-check-icon.sc-road-checkbox{opacity:1}.form-check-input.sc-road-checkbox:checked~.form-check-label.sc-road-checkbox::before,.form-check-input.sc-road-checkbox:indeterminate~.form-check-label.sc-road-checkbox::before{background:var(--road-input-surface);border-color:var(--road-input-surface)}.form-check-input.focus-visible.sc-road-checkbox~.form-check-label.sc-road-checkbox::before{box-shadow:0 0 0 0.125rem var(--road-grey-000), 0 0 0 0.1875rem var(--road-primary-700)}.form-check-input.focus-visible.sc-road-checkbox:checked~.form-check-label.sc-road-checkbox::before,.form-check-input.focus-visible.sc-road-checkbox:indeterminate~.form-check-label.sc-road-checkbox::before{background:var(--road-input-surface-variant);border-color:var(--road-input-surface-variant)}.form-check-input.sc-road-checkbox:disabled~.form-check-label.sc-road-checkbox,.form-check-input[readonly].sc-road-checkbox~.form-check-label.sc-road-checkbox{cursor:not-allowed}.form-check-input.sc-road-checkbox:disabled~.form-check-label.sc-road-checkbox::before,.form-check-input[readonly].sc-road-checkbox~.form-check-label.sc-road-checkbox::before{background:var(--road-surface-disabled);border:none}.form-check-input.sc-road-checkbox:disabled~.form-check-label.sc-road-checkbox .form-check-icon.sc-road-checkbox,.form-check-input[readonly].sc-road-checkbox~.form-check-label.sc-road-checkbox .form-check-icon.sc-road-checkbox{fill:var(--road-on-surface-disabled)}.invalid-feedback.sc-road-checkbox{display:none;flex:0 0 100%;width:100%;margin-top:0.5rem;font-size:var(--road-font-size-12);color:var(--road-danger-default)}.form-check-input.is-invalid.sc-road-checkbox~.form-check-label.sc-road-checkbox::before,.was-validated.sc-road-checkbox .form-check-input.sc-road-checkbox:invalid~.form-check-label.sc-road-checkbox::before{border-color:var(--road-danger-outline)}.form-check-input.is-invalid.sc-road-checkbox~.invalid-feedback.sc-road-checkbox,.was-validated.sc-road-checkbox .form-check-input.sc-road-checkbox:invalid~.invalid-feedback.sc-road-checkbox{display:block}.form-checkbox-inverse.sc-road-checkbox{display:flex;flex-direction:row-reverse;justify-content:space-between}.form-checkbox-inverse.sc-road-checkbox::before{margin:0 0 0 1rem}.form-checkbox-inverse.sc-road-checkbox .form-check-icon.sc-road-checkbox{right:0;left:auto}.helper.sc-road-checkbox{margin-top:0.5rem;margin-left:2rem;font-size:var(--road-font-size-14);color:var(--road-on-surface-weak)}';const h=class{constructor(o){c(this,o);this.roadchange=e(this,"roadchange",7);this.roadChange=e(this,"roadChange",7);this.roadfocus=e(this,"roadfocus",7);this.roadFocus=e(this,"roadFocus",7);this.roadblur=e(this,"roadblur",7);this.roadBlur=e(this,"roadBlur",7);this.onClick=()=>{this.checked=!this.checked;this.indeterminate=false};this.onFocus=()=>{this.roadfocus.emit();this.roadFocus.emit()};this.onBlur=()=>{this.roadblur.emit();this.roadBlur.emit()};this.checkboxId=`road-checkbox-${t++}`;this.name=this.checkboxId;this.required=false;this.checked=false;this.indeterminate=false;this.disabled=false;this.value="on";this.label=`${this.checkboxId}-label`;this.secondaryLabel=undefined;this.inverse=false;this.error=undefined;this.helper=undefined}checkedChanged(c){this.roadchange.emit({checked:c,value:this.value});this.roadChange.emit({checked:c,value:this.value})}render(){const c=this.checkboxId+"-label";const e=this.inverse&&"form-checkbox-inverse";const s=this.error!==undefined&&!this.checked&&this.error!==""?"is-invalid":"";return o(r,null,o("input",{class:`form-check-input ${s}`,type:"checkbox",id:this.checkboxId,name:this.name,required:this.required,disabled:this.disabled,indeterminate:this.indeterminate,checked:this.checked,value:this.value,"aria-checked":`${this.checked}`,"aria-disabled":this.disabled?"true":null,"aria-labelledby":c,onClick:this.onClick,onFocus:this.onFocus,onBlur:this.onBlur}),o("label",{class:`form-check-label ${e}`,id:c,htmlFor:this.checkboxId},o("div",null,this.label," ",o("span",{class:"form-check-label-span"},this.secondaryLabel),o("slot",null)),this.checked&&!this.indeterminate&&o("road-icon",{class:"form-check-icon",icon:a}),this.indeterminate&&o("road-icon",{class:"form-check-icon",icon:i})),this.error&&this.error!==""&&o("p",{class:"invalid-feedback"},this.error),this.helper&&this.helper!==""&&o("p",{class:"helper"},this.helper))}static get watchers(){return{checked:["checkedChanged"]}}};let t=0;h.style=s;export{h as road_checkbox};
|
|
2
|
+
//# sourceMappingURL=p-ac7b2425.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["checkboxCss","Checkbox","this","onClick","checked","indeterminate","onFocus","roadfocus","emit","roadFocus","onBlur","roadblur","roadBlur","checkboxIds","checkboxId","checkedChanged","isChecked","roadchange","value","roadChange","render","labelId","inverseClass","inverse","isInvalidClass","error","undefined","h","Host","class","type","id","name","required","disabled","htmlFor","label","secondaryLabel","icon","checkWide","navigationAddLess","helper"],"sources":["src/components/checkbox/checkbox.css?tag=road-checkbox&encapsulation=scoped","src/components/checkbox/checkbox.tsx"],"sourcesContent":["/*\n * Checkbox\n *\n * For accessibility, we provide a style for focus only on Tab,\n * for that add the javascript polyfill for focus-visible\n * (https://github.com/WICG/focus-visible).\n *\n * Index\n * - Checkbox\n * - Label\n * - Error\n * - Helper\n * - Position\n */\n\n\n/* CHECKBOX\n -------------------- */\n\n:host {\n position: relative;\n display: block;\n margin-bottom: 1.5rem;\n font-family: var(--road-font, sans-serif);\n font-size: var(--road-font-size-16);\n line-height: 1.5;\n color: var(--road-on-surface);\n}\n\n/**\n * Hide input\n */\n\n.form-check-input {\n position: absolute;\n z-index: -1;\n opacity: 0;\n}\n\n/* LABEL\n -------------------- */\n\n.form-check-label {\n position: relative;\n display: inline-flex;\n margin: 0;\n cursor: pointer;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n\n.form-check-label::before {\n box-sizing: border-box;\n display: block;\n flex-shrink: 0;\n width: 1.25rem;\n height: 1.25rem;\n margin: 0 0.75rem 0 0;\n content: \"\";\n background: var(--road-surface);\n border: 1px solid var(--road-input-outline);\n border-radius: 0.25rem;\n transition: border 0.2s ease-in-out, background 0.2s ease-in-out;\n}\n\n.form-check-label-span {\n color: var(--road-on-surface-weak);\n}\n\n.form-check-icon {\n position: absolute;\n top: 0;\n left: 0;\n box-sizing: border-box;\n display: block;\n width: 1.25rem;\n height: 1.25rem;\n color: var(--road-primary-contrast);\n opacity: 0;\n transition: opacity 0.2s ease-in-out;\n}\n\n/**\n * Hover state\n */\n\n@media (hover: hover) {\n\n .form-check-input:not(:disabled) ~ .form-check-label:hover::before {\n border-color: var(--road-input-surface-variant);\n }\n\n .form-check-input:not(:disabled):checked ~ .form-check-label:hover::before,\n .form-check-input:not(:disabled):indeterminate ~ .form-check-label:hover::before {\n background: var(--road-input-surface-variant);\n }\n}\n\n/**\n * Checked state\n */\n\n.form-check-input:checked ~ .form-check-label .form-check-icon,\n.form-check-input:indeterminate ~ .form-check-label .form-check-icon {\n opacity: 1;\n}\n\n.form-check-input:checked ~ .form-check-label::before,\n.form-check-input:indeterminate ~ .form-check-label::before {\n background: var(--road-input-surface);\n border-color: var(--road-input-surface);\n}\n\n/**\n * Focus on Tab\n */\n\n.form-check-input.focus-visible ~ .form-check-label::before {\n box-shadow: 0 0 0 0.125rem var(--road-grey-000), 0 0 0 0.1875rem var(--road-primary-700);\n}\n\n.form-check-input.focus-visible:checked ~ .form-check-label::before,\n.form-check-input.focus-visible:indeterminate ~ .form-check-label::before {\n background: var(--road-input-surface-variant);\n border-color: var(--road-input-surface-variant);\n}\n\n/**\n * Disabled state\n */\n\n.form-check-input:disabled ~ .form-check-label,\n.form-check-input[readonly] ~ .form-check-label {\n cursor: not-allowed;\n}\n\n.form-check-input:disabled ~ .form-check-label::before,\n.form-check-input[readonly] ~ .form-check-label::before {\n background: var(--road-surface-disabled);\n border: none;\n}\n\n.form-check-input:disabled ~ .form-check-label .form-check-icon,\n.form-check-input[readonly] ~ .form-check-label .form-check-icon {\n fill: var(--road-on-surface-disabled);\n}\n\n/* ERROR\n -------------------- */\n\n.invalid-feedback {\n display: none;\n flex: 0 0 100%;\n width: 100%;\n margin-top: 0.5rem;\n font-size: var(--road-font-size-12);\n color: var(--road-danger-default);\n}\n\n.form-check-input.is-invalid ~ .form-check-label::before,\n.was-validated .form-check-input:invalid ~ .form-check-label::before {\n border-color: var(--road-danger-outline);\n}\n\n.form-check-input.is-invalid ~ .invalid-feedback,\n.was-validated .form-check-input:invalid ~ .invalid-feedback {\n display: block;\n}\n\n/* POSITION\n -------------------- */\n\n.form-checkbox-inverse {\n display: flex;\n flex-direction: row-reverse;\n justify-content: space-between;\n}\n\n.form-checkbox-inverse::before {\n margin: 0 0 0 1rem;\n}\n\n.form-checkbox-inverse .form-check-icon {\n right: 0;\n left: auto;\n}\n\n/* HELPER\n -------------------- */\n\n.helper {\n margin-top: 0.5rem;\n margin-left: 2rem;\n font-size: var(--road-font-size-14);\n color: var(--road-on-surface-weak);\n}\n","import { Component, Event, EventEmitter, Host, Prop, Watch, h } from '@stencil/core';\nimport { checkWide, navigationAddLess } from '../../../icons';\n\nimport './../../utils/polyfill';\n\n/**\n * @slot - Adding additional elements next to the label (e.g. number of items in filters).\n */\n\n@Component({\n tag: 'road-checkbox',\n styleUrl: 'checkbox.css',\n scoped: true,\n})\nexport class Checkbox {\n\n /**\n * The id of checkbox\n */\n @Prop() checkboxId: string = `road-checkbox-${checkboxIds++}`;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.checkboxId;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required: boolean = false;\n\n /**\n * If `true`, the checkbox is checked.\n */\n @Prop({ mutable: true }) checked = false;\n\n /**\n * If `true`, the checkbox will visually appear as indeterminate.\n */\n @Prop() indeterminate: boolean = false;\n\n /**\n * If `true`, the user cannot interact with the checkbox.\n */\n @Prop() disabled: boolean = false;\n\n /**\n * Value the form will get\n */\n @Prop() value: string = 'on';\n\n /**\n * Label for the field\n */\n @Prop() label: string = `${this.checkboxId}-label`;\n\n /**\n * Secondary Label for the field\n */\n @Prop() secondaryLabel?: string;\n\n /**\n * If `true`, the label and the checkbox are inverse and spaced\n */\n @Prop() inverse: boolean = false;\n\n /**\n * Error message for the field\n */\n @Prop() error?: string;\n\n /**\n * Helper message for the field\n */\n @Prop() helper?: string;\n\n /**\n * Emitted when the checked property has changed.\n */\n @Event() roadchange!: EventEmitter<{\n checked: boolean,\n value: string | undefined | null\n }>;\n /** @internal */\n @Event() roadChange!: EventEmitter<{\n checked: boolean,\n value: string | undefined | null\n }>;\n\n /**\n * Emitted when the checkbox has focus.\n */\n @Event() roadfocus!: EventEmitter<void>;\n /** @internal */\n @Event() roadFocus!: EventEmitter<void>;\n\n /**\n * Emitted when the checkbox loses focus.\n */\n @Event() roadblur!: EventEmitter<void>;\n /** @internal */\n @Event() roadBlur!: EventEmitter<void>;\n\n @Watch('checked')\n checkedChanged(isChecked: boolean) {\n this.roadchange.emit({\n checked: isChecked,\n value: this.value,\n });\n this.roadChange.emit({\n checked: isChecked,\n value: this.value,\n });\n }\n\n private onClick = () => {\n this.checked = !this.checked;\n this.indeterminate = false;\n };\n\n private onFocus = () => {\n this.roadfocus.emit();\n this.roadFocus.emit();\n };\n\n private onBlur = () => {\n this.roadblur.emit();\n this.roadBlur.emit();\n };\n\n render() {\n const labelId = this.checkboxId + '-label';\n const inverseClass = this.inverse && 'form-checkbox-inverse';\n const isInvalidClass = this.error !== undefined && !this.checked && this.error !== '' ? 'is-invalid' : '';\n\n return (\n <Host>\n <input\n class={`form-check-input ${isInvalidClass}`}\n type=\"checkbox\"\n id={this.checkboxId}\n name={this.name}\n required={this.required}\n disabled={this.disabled}\n indeterminate={this.indeterminate}\n checked={this.checked}\n value={this.value}\n aria-checked={`${this.checked}`}\n aria-disabled={this.disabled ? 'true' : null}\n aria-labelledby={labelId}\n onClick={this.onClick}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n />\n <label class={`form-check-label ${inverseClass}`} id={labelId} htmlFor={this.checkboxId}>\n <div>\n {this.label} <span class=\"form-check-label-span\">{this.secondaryLabel}</span><slot/>\n </div>\n {this.checked && !this.indeterminate && <road-icon class=\"form-check-icon\" icon={checkWide}></road-icon>}\n {this.indeterminate && <road-icon class=\"form-check-icon\" icon={navigationAddLess}></road-icon>}\n </label>\n {this.error && this.error !== '' && <p class=\"invalid-feedback\">{this.error}</p>}\n {this.helper && this.helper !== '' && <p class=\"helper\">{this.helper}</p>}\n </Host>\n );\n }\n}\n\nlet checkboxIds = 0;\n"],"mappings":"4HAAA,MAAMA,EAAc,+/H,MCcPC,EAAQ,M,uPAqGXC,KAAAC,QAAU,KAChBD,KAAKE,SAAWF,KAAKE,QACrBF,KAAKG,cAAgB,KAAK,EAGpBH,KAAAI,QAAU,KAChBJ,KAAKK,UAAUC,OACfN,KAAKO,UAAUD,MAAM,EAGfN,KAAAQ,OAAS,KACfR,KAAKS,SAASH,OACdN,KAAKU,SAASJ,MAAM,E,gBA5GO,iBAAiBK,M,UAKvBX,KAAKY,W,cAKA,M,aAKO,M,mBAKD,M,cAKN,M,WAKJ,K,WAKA,GAAGZ,KAAKY,mB,2CAUL,M,2CAwC3B,cAAAC,CAAeC,GACbd,KAAKe,WAAWT,KAAK,CACnBJ,QAASY,EACTE,MAAOhB,KAAKgB,QAEdhB,KAAKiB,WAAWX,KAAK,CACnBJ,QAASY,EACTE,MAAOhB,KAAKgB,O,CAmBhB,MAAAE,GACE,MAAMC,EAAUnB,KAAKY,WAAa,SAClC,MAAMQ,EAAepB,KAAKqB,SAAW,wBACrC,MAAMC,EAAiBtB,KAAKuB,QAAUC,YAAcxB,KAAKE,SAAWF,KAAKuB,QAAU,GAAK,aAAe,GAEvG,OACEE,EAACC,EAAI,KACHD,EAAA,SACEE,MAAO,oBAAoBL,IAC3BM,KAAK,WACLC,GAAI7B,KAAKY,WACTkB,KAAM9B,KAAK8B,KACXC,SAAU/B,KAAK+B,SACfC,SAAUhC,KAAKgC,SACf7B,cAAeH,KAAKG,cACpBD,QAASF,KAAKE,QACdc,MAAOhB,KAAKgB,MAAK,eACH,GAAGhB,KAAKE,UAAS,gBAChBF,KAAKgC,SAAW,OAAS,KAAI,kBAC3Bb,EACjBlB,QAASD,KAAKC,QACdG,QAASJ,KAAKI,QACdI,OAAQR,KAAKQ,SAEfiB,EAAA,SAAOE,MAAO,oBAAoBP,IAAgBS,GAAIV,EAASc,QAASjC,KAAKY,YAC3Ea,EAAA,WACGzB,KAAKkC,MAAK,IAAET,EAAA,QAAME,MAAM,yBAAyB3B,KAAKmC,gBAAsBV,EAAA,cAE9EzB,KAAKE,UAAYF,KAAKG,eAAiBsB,EAAA,aAAWE,MAAM,kBAAkBS,KAAMC,IAChFrC,KAAKG,eAAiBsB,EAAA,aAAWE,MAAM,kBAAkBS,KAAME,KAEjEtC,KAAKuB,OAASvB,KAAKuB,QAAU,IAAME,EAAA,KAAGE,MAAM,oBAAoB3B,KAAKuB,OACrEvB,KAAKuC,QAAUvC,KAAKuC,SAAW,IAAMd,EAAA,KAAGE,MAAM,UAAU3B,KAAKuC,Q,4DAMtE,IAAI5B,EAAc,E"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as a,c as r,h as t,H as e}from"./p-f3d586b3.js";const o='.sc-road-textarea-h{position:relative;display:block;margin-bottom:1rem;font-family:var(--road-font, sans-serif);color:var(--road-on-surface)}.form-control.sc-road-textarea{box-sizing:border-box;display:block;width:100%;height:3rem;padding:0.75rem 1rem 0;margin:0;font-size:var(--road-body-medium);color:var(--road-on-surface);background:var(--road-surface);border:1px solid var(--road-input-outline);border-radius:0.25rem;box-shadow:none;appearance:none}.form-control.sc-road-textarea::placeholder{color:var(--road-on-surface-extra-weak);opacity:1}@media (hover: hover){.form-control.sc-road-textarea:not(:disabled):hover{border-color:var(--road-input-outline-variant)}}.form-control.sc-road-textarea:focus~.form-label.sc-road-textarea,.form-control[required].sc-road-textarea:valid~.form-label.sc-road-textarea,.form-control.has-value.sc-road-textarea~.form-label.sc-road-textarea{transform:scale(0.625) translateY(-0.625rem)}.form-control.sc-road-textarea:placeholder-shown~.form-label.sc-road-textarea{transform:scale(0.625) translateY(-0.625rem)}.form-control.sc-road-textarea:-ms-input-placeholder~.form-label.sc-road-textarea{transform:scale(0.625) translateY(-0.625rem)}.form-control.sc-road-textarea:not(:disabled):focus{border-color:var(--road-input-outline-variant)}.form-control.sc-road-textarea:disabled,.form-control[readonly].sc-road-textarea{color:var(--road-on-surface-weak);cursor:not-allowed;background:var(--road-surface-disabled);opacity:1}.textarea-control.sc-road-textarea{height:auto;padding-top:1rem;padding-bottom:0.5rem;line-height:1.5}.textarea-control.no-resize.sc-road-textarea{resize:none}.form-label.sc-road-textarea{position:absolute;top:0.75rem;left:1rem;display:block;font-size:var(--road-body-medium);line-height:1.5;color:var(--road-on-surface-weak);pointer-events:none;transition:transform 200ms cubic-bezier(0, 0, 0.2, 1) 0ms;transform-origin:0 0}.input-xl.sc-road-textarea-h{--height:3.5rem}.input-xl.sc-road-textarea-h .form-control.sc-road-textarea{padding:1.5rem 1rem 0.5rem}.input-xl.sc-road-textarea-h .form-label.sc-road-textarea{top:1rem}.input-xl.sc-road-textarea-h .form-control.sc-road-textarea:focus~.form-label.sc-road-textarea,.input-xl.sc-road-textarea-h .form-control[required].sc-road-textarea:valid~.form-label.sc-road-textarea,.input-xl.sc-road-textarea-h .form-control.has-value.sc-road-textarea~.form-label.sc-road-textarea,.input-xl.sc-road-textarea-h .form-control[type="date"].sc-road-textarea~.form-label.sc-road-textarea,.input-xl.sc-road-textarea-h .form-control[type="time"].sc-road-textarea~.form-label.sc-road-textarea{width:100vw;transform:scale(0.75) translateY(-0.625rem)}.input-xl.sc-road-textarea-h .form-control.sc-road-textarea:placeholder-shown~.form-label.sc-road-textarea{width:100vw;transform:scale(0.75) translateY(-0.625rem)}.invalid-feedback.sc-road-textarea{display:none;width:100%;margin-top:0.5rem;font-size:var(--road-helper-medium);color:var(--road-on-danger-surface)}.form-control.is-invalid.sc-road-textarea,.was-validated.sc-road-textarea .form-control.sc-road-textarea:invalid{border-color:var(--road-danger-outline)}.form-control.is-invalid.sc-road-textarea~.invalid-feedback.sc-road-textarea,.was-validated.sc-road-textarea .form-control.sc-road-textarea:invalid~.invalid-feedback.sc-road-textarea{display:block}.helper.sc-road-textarea{margin-top:0.5rem;font-size:var(--road-helper-medium);color:var(--road-on-surface-weak)}';const s=class{constructor(t){a(this,t);this.roadinput=r(this,"roadinput",7);this.roadInput=r(this,"roadInput",7);this.roadchange=r(this,"roadchange",7);this.roadChange=r(this,"roadChange",7);this.roadblur=r(this,"roadblur",7);this.roadBlur=r(this,"roadBlur",7);this.roadfocus=r(this,"roadfocus",7);this.roadFocus=r(this,"roadFocus",7);this.onInput=a=>{const r=a.target;if(r){this.value=r.value||""}this.roadinput.emit(a);this.roadInput.emit(a)};this.onBlur=()=>{this.roadblur.emit();this.roadBlur.emit()};this.onFocus=()=>{this.roadfocus.emit();this.roadFocus.emit()};this.textareaId=`road-textarea-${i++}`;this.autocapitalize="none";this.autofocus=false;this.disabled=false;this.inputmode=undefined;this.enterkeyhint=undefined;this.maxlength=undefined;this.minlength=undefined;this.name=this.textareaId;this.placeholder=undefined;this.sizes="lg";this.readonly=false;this.required=false;this.spellcheck=false;this.resize=true;this.cols=undefined;this.rows=undefined;this.wrap=undefined;this.value="";this.label=`${this.textareaId}-label`;this.error=undefined;this.helper=undefined}valueChanged(){this.roadchange.emit({value:this.value});this.roadChange.emit({value:this.value})}getValue(){return this.value||""}render(){const a=this.getValue();const r=this.textareaId+"-label";const o=this.value!==""?"has-value":"";const s=this.resize==false?"no-resize":"";const i=this.error!==undefined&&this.error!==""?"is-invalid":"";return t(e,{"aria-disabled":this.disabled?"true":null,class:this.sizes&&`input-${this.sizes}`},t("textarea",{class:`form-control textarea-control ${o} ${s} ${i}`,id:this.textareaId,"aria-disabled":this.disabled?"true":null,"aria-labelledby":r,disabled:this.disabled,autoCapitalize:this.autocapitalize,autoFocus:this.autofocus,enterKeyHint:this.enterkeyhint,inputMode:this.inputmode,maxLength:this.maxlength,minLength:this.minlength,name:this.name,placeholder:this.placeholder,readOnly:this.readonly,required:this.required,value:a,spellcheck:this.spellcheck,cols:this.cols,rows:this.rows,wrap:this.wrap,onInput:this.onInput,onBlur:this.onBlur,onFocus:this.onFocus}),t("label",{class:"form-label",id:r,htmlFor:this.textareaId},this.label),this.error&&this.error!==""&&t("p",{class:"invalid-feedback"},this.error),this.helper&&this.helper!==""&&t("p",{class:"helper"},this.helper))}static get watchers(){return{value:["valueChanged"]}}};let i=0;s.style=o;export{s as road_textarea};
|
|
2
|
+
//# sourceMappingURL=p-b2c38586.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["textareaCss","Textarea","this","onInput","ev","input","target","value","roadinput","emit","roadInput","onBlur","roadblur","roadBlur","onFocus","roadfocus","roadFocus","textareaIds","textareaId","valueChanged","roadchange","roadChange","getValue","render","labelId","hasValueClass","noResizeClass","resize","isInvalidClass","error","undefined","h","Host","disabled","class","sizes","id","autoCapitalize","autocapitalize","autoFocus","autofocus","enterKeyHint","enterkeyhint","inputMode","inputmode","maxLength","maxlength","minLength","minlength","name","placeholder","readOnly","readonly","required","spellcheck","cols","rows","wrap","htmlFor","label","helper"],"sources":["src/components/textarea/textarea.css?tag=road-textarea&encapsulation=scoped","src/components/textarea/textarea.tsx"],"sourcesContent":["/*\n * Textarea\n *\n * Index\n * - Input\n * - Textarea\n * - Label\n * - Sizes\n * - Error\n * - Helper\n */\n\n:host {\n position: relative;\n display: block;\n margin-bottom: 1rem;\n font-family: var(--road-font, sans-serif);\n color: var(--road-on-surface);\n}\n\n/* INPUT\n -------------------- */\n\n.form-control {\n box-sizing: border-box;\n display: block;\n width: 100%;\n height: 3rem;\n padding: 0.75rem 1rem 0;\n margin: 0;\n font-size: var(--road-body-medium);\n color: var(--road-on-surface);\n background: var(--road-surface);\n border: 1px solid var(--road-input-outline);\n border-radius: 0.25rem;\n box-shadow: none;\n appearance: none;\n}\n\n/**\n * Placeholder\n */\n\n.form-control::placeholder {\n color: var(--road-on-surface-extra-weak);\n opacity: 1;\n}\n\n/**\n * Hover state\n */\n\n@media (hover: hover) {\n\n .form-control:not(:disabled):hover {\n border-color: var(--road-input-outline-variant);\n }\n}\n\n/**\n * Focus state\n */\n\n.form-control:focus ~ .form-label,\n.form-control[required]:valid ~ .form-label,\n.form-control.has-value ~ .form-label {\n transform: scale(0.625) translateY(-0.625rem);\n}\n\n.form-control:placeholder-shown ~ .form-label {\n transform: scale(0.625) translateY(-0.625rem);\n}\n\n/* stylelint-disable */\n\n/* IE FIX */\n\n.form-control:-ms-input-placeholder ~ .form-label {\n transform: scale(0.625) translateY(-0.625rem);\n}\n/* stylelint-enable */\n\n.form-control:not(:disabled):focus {\n border-color: var(--road-input-outline-variant);\n}\n\n/**\n * Disabled state\n */\n\n.form-control:disabled,\n.form-control[readonly] {\n color: var(--road-on-surface-weak);\n cursor: not-allowed;\n background: var(--road-surface-disabled);\n opacity: 1;\n}\n\n/* TEXTAREA\n -------------------- */\n\n.textarea-control {\n height: auto;\n padding-top: 1rem;\n padding-bottom: 0.5rem;\n line-height: 1.5;\n}\n\n.textarea-control.no-resize {\n resize: none;\n}\n\n/* LABEL\n -------------------- */\n\n.form-label {\n position: absolute;\n top: 0.75rem;\n left: 1rem;\n display: block;\n font-size: var(--road-body-medium);\n line-height: 1.5;\n color: var(--road-on-surface-weak);\n pointer-events: none;\n transition: transform 200ms cubic-bezier(0, 0, 0.2, 1) 0ms;\n transform-origin: 0 0;\n}\n\n/* SIZES\n -------------------- */\n\n:host(.input-xl) {\n --height: 3.5rem;\n}\n\n:host(.input-xl) .form-control {\n padding: 1.5rem 1rem 0.5rem;\n}\n\n:host(.input-xl) .form-label {\n top: 1rem;\n}\n\n:host(.input-xl) .form-control:focus ~ .form-label,\n:host(.input-xl) .form-control[required]:valid ~ .form-label,\n:host(.input-xl) .form-control.has-value ~ .form-label,\n:host(.input-xl) .form-control[type=\"date\"] ~ .form-label,\n:host(.input-xl) .form-control[type=\"time\"] ~ .form-label {\n width: 100vw;\n transform: scale(0.75) translateY(-0.625rem);\n}\n\n:host(.input-xl) .form-control:placeholder-shown ~ .form-label {\n width: 100vw;\n transform: scale(0.75) translateY(-0.625rem);\n}\n\n\n/* ERROR\n -------------------- */\n\n.invalid-feedback {\n display: none;\n width: 100%;\n margin-top: 0.5rem;\n font-size: var(--road-helper-medium);\n color: var(--road-on-danger-surface);\n}\n\n.form-control.is-invalid,\n.was-validated .form-control:invalid {\n border-color: var(--road-danger-outline);\n}\n\n.form-control.is-invalid ~ .invalid-feedback,\n.was-validated .form-control:invalid ~ .invalid-feedback {\n display: block;\n}\n\n/* HELPER\n -------------------- */\n\n.helper {\n margin-top: 0.5rem;\n font-size: var(--road-helper-medium);\n color: var(--road-on-surface-weak);\n}\n","import { Component, Event, EventEmitter, Host, Prop, Watch, h } from '@stencil/core';\n\n@Component({\n tag: 'road-textarea',\n styleUrl: 'textarea.css',\n scoped: true,\n})\nexport class Textarea {\n\n /**\n * The id of textarea\n */\n @Prop() textareaId: string = `road-textarea-${textareaIds++}`;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n */\n @Prop() autocapitalize: string = 'none';\n\n /**\n * This Boolean attribute lets you specify that a form control should have focus when the page loads.\n */\n @Prop() autofocus: boolean = false;\n\n /**\n * If `true`, the user cannot interact with the textarea.\n */\n @Prop() disabled: boolean = false;\n\n /**\n * A hint to the browser for which keyboard to display.\n * This attribute applies when the value of the type attribute is `\"text\"`, `\"password\"`, `\"email\"`, or `\"url\"`. Possible values are: `\"verbatim\"`, `\"latin\"`, `\"latin-name\"`, `\"latin-prose\"`, `\"full-width-latin\"`, `\"kana\"`, `\"katakana\"`, `\"numeric\"`, `\"tel\"`, `\"email\"`, `\"url\"`.\n */\n @Prop() inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';\n\n /**\n * A hint to the browser for which enter key to display.\n * Possible values: `\"enter\"`, `\"done\"`, `\"go\"`, `\"next\"`,\n * `\"previous\"`, `\"search\"`, and `\"send\"`.\n */\n @Prop() enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.textareaId;\n\n /**\n * Instructional text that shows before the textarea has a value.\n */\n @Prop() placeholder?: string;\n\n /**\n * The sizes of the input.\n */\n @Prop() sizes: 'lg' | 'xl' = 'lg';\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop() readonly: boolean = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required: boolean = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n @Prop() spellcheck: boolean = false;\n\n /**\n * If `false`, to disabled resize.\n */\n @Prop() resize: boolean = true;\n\n /**\n * The visible width of the text control, in average character widths. If it is specified, it must be a positive integer.\n */\n @Prop() cols?: number;\n\n /**\n * The number of rows of the control.\n */\n @Prop() rows?: number;\n\n /**\n * Indicates how the control wraps text.\n */\n @Prop() wrap?: 'hard' | 'soft' | 'off';\n\n /**\n * The value of the textarea.\n */\n @Prop({ mutable: true }) value?: string | null = '';\n\n /**\n * Label for the field\n */\n @Prop() label: string = `${this.textareaId}-label`;\n\n /**\n * Error message for the field\n */\n @Prop() error?: string;\n\n /**\n * Helper message for the field\n */\n @Prop() helper?: string;\n\n /**\n * Update the native textarea element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n this.roadchange.emit({ value: this.value });\n this.roadChange.emit({ value: this.value });\n }\n\n /**\n * Emitted when a keyboard input occurred.\n */\n @Event() roadinput!: EventEmitter<KeyboardEvent>;\n /** @internal */\n @Event() roadInput!: EventEmitter<KeyboardEvent>;\n\n /**\n * Emitted when the value has changed.\n */\n @Event() roadchange!: EventEmitter<{\n value: string | undefined | null\n }>;\n /** @internal */\n @Event() roadChange!: EventEmitter<{\n value: string | undefined | null\n }>;\n\n /**\n * Emitted when the textarea loses focus.\n */\n @Event() roadblur!: EventEmitter<void>;\n /** @internal */\n @Event() roadBlur!: EventEmitter<void>;\n\n /**\n * Emitted when the textarea has focus.\n */\n @Event() roadfocus!: EventEmitter<void>;\n /** @internal */\n @Event() roadFocus!: EventEmitter<void>;\n\n private getValue(): string {\n return this.value || '';\n }\n\n private onInput = (ev: Event) => {\n const input = ev.target as HTMLInputElement | null;\n if (input) {\n this.value = input.value || '';\n }\n this.roadinput.emit(ev as KeyboardEvent);\n this.roadInput.emit(ev as KeyboardEvent);\n };\n\n private onBlur = () => {\n this.roadblur.emit();\n this.roadBlur.emit();\n };\n\n private onFocus = () => {\n this.roadfocus.emit();\n this.roadFocus.emit();\n };\n\n render() {\n const value = this.getValue();\n const labelId = this.textareaId + '-label';\n const hasValueClass = this.value !== '' ? 'has-value' : '';\n const noResizeClass = this.resize == false ? 'no-resize' : '';\n const isInvalidClass = this.error !== undefined && this.error !== '' ? 'is-invalid' : '';\n\n return (\n <Host aria-disabled={this.disabled ? 'true' : null} class={this.sizes && `input-${this.sizes}`}>\n <textarea\n class={`form-control textarea-control ${hasValueClass} ${noResizeClass} ${isInvalidClass}`}\n id={this.textareaId}\n aria-disabled={this.disabled ? 'true' : null}\n aria-labelledby={labelId}\n disabled={this.disabled}\n autoCapitalize={this.autocapitalize}\n autoFocus={this.autofocus}\n enterKeyHint={this.enterkeyhint}\n inputMode={this.inputmode}\n maxLength={this.maxlength}\n minLength={this.minlength}\n name={this.name}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n value={value}\n spellcheck={this.spellcheck}\n cols={this.cols}\n rows={this.rows}\n wrap={this.wrap}\n onInput={this.onInput}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n >\n </textarea>\n <label class=\"form-label\" id={labelId} htmlFor={this.textareaId}>{this.label}</label>\n {this.error && this.error !== '' && <p class=\"invalid-feedback\">{this.error}</p>}\n {this.helper && this.helper !== '' && <p class=\"helper\">{this.helper}</p>}\n </Host>\n );\n }\n\n}\n\nlet textareaIds = 0;\n"],"mappings":"yDAAA,MAAMA,EAAc,61G,MCOPC,EAAQ,M,iUAgKXC,KAAAC,QAAWC,IACjB,MAAMC,EAAQD,EAAGE,OACjB,GAAID,EAAO,CACTH,KAAKK,MAAQF,EAAME,OAAS,E,CAE9BL,KAAKM,UAAUC,KAAKL,GACpBF,KAAKQ,UAAUD,KAAKL,EAAoB,EAGlCF,KAAAS,OAAS,KACfT,KAAKU,SAASH,OACdP,KAAKW,SAASJ,MAAM,EAGdP,KAAAY,QAAU,KAChBZ,KAAKa,UAAUN,OACfP,KAAKc,UAAUP,MAAM,E,gBA3KM,iBAAiBQ,M,oBAKb,O,eAKJ,M,cAKD,M,iHA4BLf,KAAKgB,W,sCAUE,K,cAKF,M,cAKA,M,gBAKE,M,YAKF,K,uEAoBqB,G,WAKzB,GAAGhB,KAAKgB,mB,2CAgBtB,YAAAC,GACRjB,KAAKkB,WAAWX,KAAK,CAAEF,MAAOL,KAAKK,QACnCL,KAAKmB,WAAWZ,KAAK,CAAEF,MAAOL,KAAKK,O,CAmC7B,QAAAe,GACN,OAAOpB,KAAKK,OAAS,E,CAsBvB,MAAAgB,GACE,MAAMhB,EAAQL,KAAKoB,WACnB,MAAME,EAAUtB,KAAKgB,WAAa,SAClC,MAAMO,EAAgBvB,KAAKK,QAAU,GAAK,YAAc,GACxD,MAAMmB,EAAgBxB,KAAKyB,QAAU,MAAQ,YAAc,GAC3D,MAAMC,EAAiB1B,KAAK2B,QAAUC,WAAa5B,KAAK2B,QAAU,GAAK,aAAe,GAEtF,OACEE,EAACC,EAAI,iBAAgB9B,KAAK+B,SAAW,OAAS,KAAMC,MAAOhC,KAAKiC,OAAS,SAASjC,KAAKiC,SACrFJ,EAAA,YACEG,MAAO,iCAAiCT,KAAiBC,KAAiBE,IAC1EQ,GAAIlC,KAAKgB,WAAU,gBACJhB,KAAK+B,SAAW,OAAS,KAAI,kBAC3BT,EACjBS,SAAU/B,KAAK+B,SACfI,eAAgBnC,KAAKoC,eACrBC,UAAWrC,KAAKsC,UAChBC,aAAcvC,KAAKwC,aACnBC,UAAWzC,KAAK0C,UAChBC,UAAW3C,KAAK4C,UAChBC,UAAW7C,KAAK8C,UAChBC,KAAM/C,KAAK+C,KACXC,YAAahD,KAAKgD,YAClBC,SAAUjD,KAAKkD,SACfC,SAAUnD,KAAKmD,SACf9C,MAAOA,EACP+C,WAAYpD,KAAKoD,WACjBC,KAAMrD,KAAKqD,KACXC,KAAMtD,KAAKsD,KACXC,KAAMvD,KAAKuD,KACXtD,QAASD,KAAKC,QACdQ,OAAQT,KAAKS,OACbG,QAASZ,KAAKY,UAGhBiB,EAAA,SAAOG,MAAM,aAAaE,GAAIZ,EAASkC,QAASxD,KAAKgB,YAAahB,KAAKyD,OACtEzD,KAAK2B,OAAS3B,KAAK2B,QAAU,IAAME,EAAA,KAAGG,MAAM,oBAAoBhC,KAAK2B,OACrE3B,KAAK0D,QAAU1D,KAAK0D,SAAW,IAAM7B,EAAA,KAAGG,MAAM,UAAUhC,KAAK0D,Q,wDAOtE,IAAI3C,EAAc,E"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as e,h as s,H as i,a as n}from"./p-f3d586b3.js";function r(t){return!Array.isArray?M(t)==="[object Array]":Array.isArray(t)}const c=1/0;function o(t){if(typeof t=="string"){return t}let e=t+"";return e=="0"&&1/t==-c?"-0":e}function a(t){return t==null?"":o(t)}function l(t){return typeof t==="string"}function h(t){return typeof t==="number"}function u(t){return t===true||t===false||d(t)&&M(t)=="[object Boolean]"}function f(t){return typeof t==="object"}function d(t){return f(t)&&t!==null}function g(t){return t!==undefined&&t!==null}function m(t){return!t.trim().length}function M(t){return t==null?t===undefined?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const p="Extended search is not available";const x="Incorrect 'index' type";const v=t=>`Invalid value for key ${t}`;const y=t=>`Pattern length exceeds max of ${t}.`;const w=t=>`Missing ${t} property in key`;const L=t=>`Property 'weight' in key '${t}' must be a positive integer`;const b=Object.prototype.hasOwnProperty;class ${constructor(t){this._keys=[];this._keyMap={};let e=0;t.forEach((t=>{let s=k(t);e+=s.weight;this._keys.push(s);this._keyMap[s.id]=s;e+=s.weight}));this._keys.forEach((t=>{t.weight/=e}))}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function k(t){let e=null;let s=null;let i=null;let n=1;if(l(t)||r(t)){i=t;e=A(t);s=S(t)}else{if(!b.call(t,"name")){throw new Error(w("name"))}const r=t.name;i=r;if(b.call(t,"weight")){n=t.weight;if(n<=0){throw new Error(L(r))}}e=A(r);s=S(r)}return{path:e,id:s,weight:n,src:i}}function A(t){return r(t)?t:t.split(".")}function S(t){return r(t)?t.join("."):t}function C(t,e){let s=[];let i=false;const n=(t,e,c)=>{if(!g(t)){return}if(!e[c]){s.push(t)}else{let o=e[c];const f=t[o];if(!g(f)){return}if(c===e.length-1&&(l(f)||h(f)||u(f))){s.push(a(f))}else if(r(f)){i=true;for(let t=0,s=f.length;t<s;t+=1){n(f[t],e,c+1)}}else if(e.length){n(f,e,c+1)}}};n(t,l(e)?e.split("."):e,0);return i?s:s[0]}const R={includeMatches:false,findAllMatches:false,minMatchCharLength:1};const N={isCaseSensitive:false,includeScore:false,keys:[],shouldSort:true,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1};const I={location:0,threshold:.6,distance:100};const F={useExtendedSearch:false,getFn:C,ignoreLocation:false,ignoreFieldNorm:false,fieldNormWeight:1};var O={...N,...R,...I,...F};const j=/[^ ]+/g;function E(t=1,e=3){const s=new Map;const i=Math.pow(10,e);return{get(e){const n=e.match(j).length;if(s.has(n)){return s.get(n)}const r=1/Math.pow(n,.5*t);const c=parseFloat(Math.round(r*i)/i);s.set(n,c);return c},clear(){s.clear()}}}class _{constructor({getFn:t=O.getFn,fieldNormWeight:e=O.fieldNormWeight}={}){this.norm=E(e,3);this.getFn=t;this.isCreated=false;this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t;this._keysMap={};t.forEach(((t,e)=>{this._keysMap[t.id]=e}))}create(){if(this.isCreated||!this.docs.length){return}this.isCreated=true;if(l(this.docs[0])){this.docs.forEach(((t,e)=>{this._addString(t,e)}))}else{this.docs.forEach(((t,e)=>{this._addObject(t,e)}))}this.norm.clear()}add(t){const e=this.size();if(l(t)){this._addString(t,e)}else{this._addObject(t,e)}}removeAt(t){this.records.splice(t,1);for(let e=t,s=this.size();e<s;e+=1){this.records[e].i-=1}}getValueForItemAtKeyId(t,e){return t[this._keysMap[e]]}size(){return this.records.length}_addString(t,e){if(!g(t)||m(t)){return}let s={v:t,i:e,n:this.norm.get(t)};this.records.push(s)}_addObject(t,e){let s={i:e,$:{}};this.keys.forEach(((e,i)=>{let n=this.getFn(t,e.path);if(!g(n)){return}if(r(n)){let t=[];const e=[{nestedArrIndex:-1,value:n}];while(e.length){const{nestedArrIndex:s,value:i}=e.pop();if(!g(i)){continue}if(l(i)&&!m(i)){let e={v:i,i:s,n:this.norm.get(i)};t.push(e)}else if(r(i)){i.forEach(((t,s)=>{e.push({nestedArrIndex:s,value:t})}))}else;}s.$[i]=t}else if(!m(n)){let t={v:n,n:this.norm.get(n)};s.$[i]=t}}));this.records.push(s)}toJSON(){return{keys:this.keys,records:this.records}}}function W(t,e,{getFn:s=O.getFn,fieldNormWeight:i=O.fieldNormWeight}={}){const n=new _({getFn:s,fieldNormWeight:i});n.setKeys(t.map(k));n.setSources(e);n.create();return n}function z(t,{getFn:e=O.getFn,fieldNormWeight:s=O.fieldNormWeight}={}){const{keys:i,records:n}=t;const r=new _({getFn:e,fieldNormWeight:s});r.setKeys(i);r.setIndexRecords(n);return r}function P(t,{errors:e=0,currentLocation:s=0,expectedLocation:i=0,distance:n=O.distance,ignoreLocation:r=O.ignoreLocation}={}){const c=e/t.length;if(r){return c}const o=Math.abs(i-s);if(!n){return o?1:c}return c+o/n}function T(t=[],e=O.minMatchCharLength){let s=[];let i=-1;let n=-1;let r=0;for(let c=t.length;r<c;r+=1){let c=t[r];if(c&&i===-1){i=r}else if(!c&&i!==-1){n=r-1;if(n-i+1>=e){s.push([i,n])}i=-1}}if(t[r-1]&&r-i>=e){s.push([i,r-1])}return s}const H=32;function J(t,e,s,{location:i=O.location,distance:n=O.distance,threshold:r=O.threshold,findAllMatches:c=O.findAllMatches,minMatchCharLength:o=O.minMatchCharLength,includeMatches:a=O.includeMatches,ignoreLocation:l=O.ignoreLocation}={}){if(e.length>H){throw new Error(y(H))}const h=e.length;const u=t.length;const f=Math.max(0,Math.min(i,u));let d=r;let g=f;const m=o>1||a;const M=m?Array(u):[];let p;while((p=t.indexOf(e,g))>-1){let t=P(e,{currentLocation:p,expectedLocation:f,distance:n,ignoreLocation:l});d=Math.min(t,d);g=p+h;if(m){let t=0;while(t<h){M[p+t]=1;t+=1}}}g=-1;let x=[];let v=1;let w=h+u;const L=1<<h-1;for(let i=0;i<h;i+=1){let r=0;let o=w;while(r<o){const t=P(e,{errors:i,currentLocation:f+o,expectedLocation:f,distance:n,ignoreLocation:l});if(t<=d){r=o}else{w=o}o=Math.floor((w-r)/2+r)}w=o;let a=Math.max(1,f-o+1);let p=c?u:Math.min(f+o,u)+h;let y=Array(p+2);y[p+1]=(1<<i)-1;for(let r=p;r>=a;r-=1){let c=r-1;let o=s[t.charAt(c)];if(m){M[c]=+!!o}y[r]=(y[r+1]<<1|1)&o;if(i){y[r]|=(x[r+1]|x[r])<<1|1|x[r+1]}if(y[r]&L){v=P(e,{errors:i,currentLocation:c,expectedLocation:f,distance:n,ignoreLocation:l});if(v<=d){d=v;g=c;if(g<=f){break}a=Math.max(1,2*f-g)}}}const b=P(e,{errors:i+1,currentLocation:f,expectedLocation:f,distance:n,ignoreLocation:l});if(b>d){break}x=y}const b={isMatch:g>=0,score:Math.max(.001,v)};if(m){const t=T(M,o);if(!t.length){b.isMatch=false}else if(a){b.indices=t}}return b}function K(t){let e={};for(let s=0,i=t.length;s<i;s+=1){const n=t.charAt(s);e[n]=(e[n]||0)|1<<i-s-1}return e}class B{constructor(t,{location:e=O.location,threshold:s=O.threshold,distance:i=O.distance,includeMatches:n=O.includeMatches,findAllMatches:r=O.findAllMatches,minMatchCharLength:c=O.minMatchCharLength,isCaseSensitive:o=O.isCaseSensitive,ignoreLocation:a=O.ignoreLocation}={}){this.options={location:e,threshold:s,distance:i,includeMatches:n,findAllMatches:r,minMatchCharLength:c,isCaseSensitive:o,ignoreLocation:a};this.pattern=o?t:t.toLowerCase();this.chunks=[];if(!this.pattern.length){return}const l=(t,e)=>{this.chunks.push({pattern:t,alphabet:K(t),startIndex:e})};const h=this.pattern.length;if(h>H){let t=0;const e=h%H;const s=h-e;while(t<s){l(this.pattern.substr(t,H),t);t+=H}if(e){const t=h-H;l(this.pattern.substr(t),t)}}else{l(this.pattern,0)}}searchIn(t){const{isCaseSensitive:e,includeMatches:s}=this.options;if(!e){t=t.toLowerCase()}if(this.pattern===t){let e={isMatch:true,score:0};if(s){e.indices=[[0,t.length-1]]}return e}const{location:i,distance:n,threshold:r,findAllMatches:c,minMatchCharLength:o,ignoreLocation:a}=this.options;let l=[];let h=0;let u=false;this.chunks.forEach((({pattern:e,alphabet:f,startIndex:d})=>{const{isMatch:g,score:m,indices:M}=J(t,e,f,{location:i+d,distance:n,threshold:r,findAllMatches:c,minMatchCharLength:o,includeMatches:s,ignoreLocation:a});if(g){u=true}h+=m;if(g&&M){l=[...l,...M]}}));let f={isMatch:u,score:u?h/this.chunks.length:1};if(u&&s){f.indices=l}return f}}class D{constructor(t){this.pattern=t}static isMultiMatch(t){return U(t,this.multiRegex)}static isSingleMatch(t){return U(t,this.singleRegex)}search(){}}function U(t,e){const s=t.match(e);return s?s[1]:null}class V extends D{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const e=t===this.pattern;return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}}class q extends D{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const e=t.indexOf(this.pattern);const s=e===-1;return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}}class G extends D{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const e=t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}}class Q extends D{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const e=!t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}}class X extends D{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const e=t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class Y extends D{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const e=!t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}}class Z extends D{constructor(t,{location:e=O.location,threshold:s=O.threshold,distance:i=O.distance,includeMatches:n=O.includeMatches,findAllMatches:r=O.findAllMatches,minMatchCharLength:c=O.minMatchCharLength,isCaseSensitive:o=O.isCaseSensitive,ignoreLocation:a=O.ignoreLocation}={}){super(t);this._bitapSearch=new B(t,{location:e,threshold:s,distance:i,includeMatches:n,findAllMatches:r,minMatchCharLength:c,isCaseSensitive:o,ignoreLocation:a})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class tt extends D{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let e=0;let s;const i=[];const n=this.pattern.length;while((s=t.indexOf(this.pattern,e))>-1){e=s+n;i.push([s,e-1])}const r=!!i.length;return{isMatch:r,score:r?0:1,indices:i}}}const et=[V,tt,G,Q,Y,X,q,Z];const st=et.length;const it=/ +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/;const nt="|";function rt(t,e={}){return t.split(nt).map((t=>{let s=t.trim().split(it).filter((t=>t&&!!t.trim()));let i=[];for(let t=0,n=s.length;t<n;t+=1){const n=s[t];let r=false;let c=-1;while(!r&&++c<st){const t=et[c];let s=t.isMultiMatch(n);if(s){i.push(new t(s,e));r=true}}if(r){continue}c=-1;while(++c<st){const t=et[c];let s=t.isSingleMatch(n);if(s){i.push(new t(s,e));break}}}return i}))}const ct=new Set([Z.type,tt.type]);class ot{constructor(t,{isCaseSensitive:e=O.isCaseSensitive,includeMatches:s=O.includeMatches,minMatchCharLength:i=O.minMatchCharLength,ignoreLocation:n=O.ignoreLocation,findAllMatches:r=O.findAllMatches,location:c=O.location,threshold:o=O.threshold,distance:a=O.distance}={}){this.query=null;this.options={isCaseSensitive:e,includeMatches:s,minMatchCharLength:i,findAllMatches:r,ignoreLocation:n,location:c,threshold:o,distance:a};this.pattern=e?t:t.toLowerCase();this.query=rt(this.pattern,this.options)}static condition(t,e){return e.useExtendedSearch}searchIn(t){const e=this.query;if(!e){return{isMatch:false,score:1}}const{includeMatches:s,isCaseSensitive:i}=this.options;t=i?t:t.toLowerCase();let n=0;let r=[];let c=0;for(let i=0,o=e.length;i<o;i+=1){const o=e[i];r.length=0;n=0;for(let e=0,i=o.length;e<i;e+=1){const i=o[e];const{isMatch:a,indices:l,score:h}=i.search(t);if(a){n+=1;c+=h;if(s){const t=i.constructor.type;if(ct.has(t)){r=[...r,...l]}else{r.push(l)}}}else{c=0;n=0;r.length=0;break}}if(n){let t={isMatch:true,score:c/n};if(s){t.indices=r}return t}}return{isMatch:false,score:1}}}const at=[];function lt(...t){at.push(...t)}function ht(t,e){for(let s=0,i=at.length;s<i;s+=1){let i=at[s];if(i.condition(t,e)){return new i(t,e)}}return new B(t,e)}const ut={AND:"$and",OR:"$or"};const ft={PATH:"$path",PATTERN:"$val"};const dt=t=>!!(t[ut.AND]||t[ut.OR]);const gt=t=>!!t[ft.PATH];const mt=t=>!r(t)&&f(t)&&!dt(t);const Mt=t=>({[ut.AND]:Object.keys(t).map((e=>({[e]:t[e]})))});function pt(t,e,{auto:s=true}={}){const i=t=>{let n=Object.keys(t);const c=gt(t);if(!c&&n.length>1&&!dt(t)){return i(Mt(t))}if(mt(t)){const i=c?t[ft.PATH]:n[0];const r=c?t[ft.PATTERN]:t[i];if(!l(r)){throw new Error(v(i))}const o={keyId:S(i),pattern:r};if(s){o.searcher=ht(r,e)}return o}let o={children:[],operator:n[0]};n.forEach((e=>{const s=t[e];if(r(s)){s.forEach((t=>{o.children.push(i(t))}))}}));return o};if(!dt(t)){t=Mt(t)}return i(t)}function xt(t,{ignoreFieldNorm:e=O.ignoreFieldNorm}){t.forEach((t=>{let s=1;t.matches.forEach((({key:t,norm:i,score:n})=>{const r=t?t.weight:null;s*=Math.pow(n===0&&r?Number.EPSILON:n,(r||1)*(e?1:i))}));t.score=s}))}function vt(t,e){const s=t.matches;e.matches=[];if(!g(s)){return}s.forEach((t=>{if(!g(t.indices)||!t.indices.length){return}const{indices:s,value:i}=t;let n={indices:s,value:i};if(t.key){n.key=t.key.src}if(t.idx>-1){n.refIndex=t.idx}e.matches.push(n)}))}function yt(t,e){e.score=t.score}function wt(t,e,{includeMatches:s=O.includeMatches,includeScore:i=O.includeScore}={}){const n=[];if(s)n.push(vt);if(i)n.push(yt);return t.map((t=>{const{idx:s}=t;const i={item:e[s],refIndex:s};if(n.length){n.forEach((e=>{e(t,i)}))}return i}))}class Lt{constructor(t,e={},s){this.options={...O,...e};if(this.options.useExtendedSearch&&!true){throw new Error(p)}this._keyStore=new $(this.options.keys);this.setCollection(t,s)}setCollection(t,e){this._docs=t;if(e&&!(e instanceof _)){throw new Error(x)}this._myIndex=e||W(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){if(!g(t)){return}this._docs.push(t);this._myIndex.add(t)}remove(t=(()=>false)){const e=[];for(let s=0,i=this._docs.length;s<i;s+=1){const n=this._docs[s];if(t(n,s)){this.removeAt(s);s-=1;i-=1;e.push(n)}}return e}removeAt(t){this._docs.splice(t,1);this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:e=-1}={}){const{includeMatches:s,includeScore:i,shouldSort:n,sortFn:r,ignoreFieldNorm:c}=this.options;let o=l(t)?l(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);xt(o,{ignoreFieldNorm:c});if(n){o.sort(r)}if(h(e)&&e>-1){o=o.slice(0,e)}return wt(o,this._docs,{includeMatches:s,includeScore:i})}_searchStringList(t){const e=ht(t,this.options);const{records:s}=this._myIndex;const i=[];s.forEach((({v:t,i:s,n})=>{if(!g(t)){return}const{isMatch:r,score:c,indices:o}=e.searchIn(t);if(r){i.push({item:t,idx:s,matches:[{score:c,value:t,norm:n,indices:o}]})}}));return i}_searchLogical(t){const e=pt(t,this.options);const s=(t,e,i)=>{if(!t.children){const{keyId:s,searcher:n}=t;const r=this._findMatches({key:this._keyStore.get(s),value:this._myIndex.getValueForItemAtKeyId(e,s),searcher:n});if(r&&r.length){return[{idx:i,item:e,matches:r}]}return[]}const n=[];for(let r=0,c=t.children.length;r<c;r+=1){const c=t.children[r];const o=s(c,e,i);if(o.length){n.push(...o)}else if(t.operator===ut.AND){return[]}}return n};const i=this._myIndex.records;const n={};const r=[];i.forEach((({$:t,i})=>{if(g(t)){let c=s(e,t,i);if(c.length){if(!n[i]){n[i]={idx:i,item:t,matches:[]};r.push(n[i])}c.forEach((({matches:t})=>{n[i].matches.push(...t)}))}}}));return r}_searchObjectList(t){const e=ht(t,this.options);const{keys:s,records:i}=this._myIndex;const n=[];i.forEach((({$:t,i})=>{if(!g(t)){return}let r=[];s.forEach(((s,i)=>{r.push(...this._findMatches({key:s,value:t[i],searcher:e}))}));if(r.length){n.push({idx:i,item:t,matches:r})}}));return n}_findMatches({key:t,value:e,searcher:s}){if(!g(e)){return[]}let i=[];if(r(e)){e.forEach((({v:e,i:n,n:r})=>{if(!g(e)){return}const{isMatch:c,score:o,indices:a}=s.searchIn(e);if(c){i.push({score:o,key:t,value:e,idx:n,norm:r,indices:a})}}))}else{const{v:n,n:r}=e;const{isMatch:c,score:o,indices:a}=s.searchIn(n);if(c){i.push({score:o,key:t,value:n,norm:r,indices:a})}}return i}}Lt.version="6.5.3";Lt.createIndex=W;Lt.parseIndex=z;Lt.config=O;{Lt.parseQuery=pt}{lt(ot)}const bt=".sc-road-select-filter-h{--margin-top:3rem;position:relative;display:block}.select-filter-list.sc-road-select-filter{position:absolute;top:var(--margin-top);z-index:2;width:100%;max-height:16rem;padding:0;margin:0;overflow-y:scroll;font-family:var(--road-font, sans-serif);font-size:1rem;color:var(--road-on-surface);list-style-type:none;background:var(--road-surface);border-radius:0 0 0.25rem 0.25rem;box-shadow:var(--road-elevation-low)}.select-filter-list.not-active.sc-road-select-filter{opacity:0}.select-filter-item.sc-road-select-filter{display:flex;align-items:center;padding:0.75rem 1rem;cursor:pointer}.select-filter-item.active.sc-road-select-filter{outline:1px solid var(--road-input-outline-variant)}.select-filter-item.sc-road-select-filter:hover,.select-filter-item.sc-road-select-filter:focus,.select-filter-item.highlight.sc-road-select-filter{color:var(--road-on-primary);background:var(--road-primary)}";const $t=class{constructor(s){t(this,s);this.roadselected=e(this,"roadselected",7);this.roadSelected=e(this,"roadSelected",7);this.onClick=(t,e)=>{this.el.querySelector("road-input").value=e;if(document.getElementsByClassName("phone-number-label-icon").length>0){this.el.querySelector("road-icon").name="flag-"+e}this.isOpen=false;this.roadselected.emit({value:t.toString(),label:e});this.roadSelected.emit({value:t.toString(),label:e});this.activeIndex=-1};this.handleOptionMouseOver=t=>{this.activeIndex=t};this.handleOptionClick=(t,e)=>{this.onClick(t,e)};this.handleMouseLeave=()=>{this.activeIndex=-1};this.isOpen=false;this.currentValue="";this.activeIndex=-1;this.options=[];this.parameters={keys:["value","label"],threshold:.3,ignoreLocation:true};this.isActive=false;this.onlySelect=true}handleFocus(){this.isOpen=true;this.isActive=true}handleBlur(){this.isActive=false}handleChange(t){this.currentValue=t.detail.value.toLowerCase()}onClickOutside(t){if(this.isOpen&&!this.el.contains(t.target)){this.isOpen=false;this.isActive=false;const t=this.el.querySelector("road-input").value;if(this.onlySelect&&!this.options.some((e=>e["label"]===t))){this.el.querySelector("road-input").value=""}}}handleKeydown(t){if(this.isOpen){if(t.key==="ArrowDown"){t.preventDefault();this.activeIndex=(this.activeIndex+1)%this.filteredOptions.length}else if(t.key==="ArrowUp"){t.preventDefault();this.activeIndex=(this.activeIndex-1+this.filteredOptions.length)%this.filteredOptions.length}else if(t.key==="Enter"){t.preventDefault();const e=this.filteredOptions[this.activeIndex];if(e){this.onClick(e.item.value,e.item.label)}}}}get filteredOptions(){const t=new Lt(this.options,this.parameters);return this.currentValue===""?this.options.map(((t,e)=>({item:t,score:1,refIndex:e}))):t.search(this.currentValue)}render(){const t=this.filteredOptions;const e=this.isActive?"true":"false";const n=this.isActive?"":"not-active";return s(i,{"is-active":e},s("slot",null),this.isOpen&&s("ul",{class:`${n} select-filter-list`,role:"listbox",onMouseLeave:this.handleMouseLeave},t.map(((t,e)=>s("li",{class:`select-filter-item ${this.activeIndex===e?"active":""}`,role:"option","aria-selected":this.activeIndex===e?"true":"false",onClick:()=>this.handleOptionClick(t.item.value,t.item.label.replace(/(<([^>]+)>)/gi,"")),onMouseOver:()=>this.handleOptionMouseOver(e),innerHTML:t.item.label,tabindex:this.activeIndex===e?0:-1})))))}get el(){return n(this)}};$t.style=bt;export{$t as road_select_filter};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as e,h as s,H as i,a as n}from"./p-f3d586b3.js";function r(t){return!Array.isArray?M(t)==="[object Array]":Array.isArray(t)}const c=1/0;function o(t){if(typeof t=="string"){return t}let e=t+"";return e=="0"&&1/t==-c?"-0":e}function a(t){return t==null?"":o(t)}function l(t){return typeof t==="string"}function h(t){return typeof t==="number"}function u(t){return t===true||t===false||d(t)&&M(t)=="[object Boolean]"}function f(t){return typeof t==="object"}function d(t){return f(t)&&t!==null}function g(t){return t!==undefined&&t!==null}function m(t){return!t.trim().length}function M(t){return t==null?t===undefined?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const p="Extended search is not available";const x="Incorrect 'index' type";const v=t=>`Invalid value for key ${t}`;const y=t=>`Pattern length exceeds max of ${t}.`;const w=t=>`Missing ${t} property in key`;const L=t=>`Property 'weight' in key '${t}' must be a positive integer`;const b=Object.prototype.hasOwnProperty;class ${constructor(t){this._keys=[];this._keyMap={};let e=0;t.forEach((t=>{let s=k(t);e+=s.weight;this._keys.push(s);this._keyMap[s.id]=s;e+=s.weight}));this._keys.forEach((t=>{t.weight/=e}))}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function k(t){let e=null;let s=null;let i=null;let n=1;if(l(t)||r(t)){i=t;e=A(t);s=S(t)}else{if(!b.call(t,"name")){throw new Error(w("name"))}const r=t.name;i=r;if(b.call(t,"weight")){n=t.weight;if(n<=0){throw new Error(L(r))}}e=A(r);s=S(r)}return{path:e,id:s,weight:n,src:i}}function A(t){return r(t)?t:t.split(".")}function S(t){return r(t)?t.join("."):t}function C(t,e){let s=[];let i=false;const n=(t,e,c)=>{if(!g(t)){return}if(!e[c]){s.push(t)}else{let o=e[c];const f=t[o];if(!g(f)){return}if(c===e.length-1&&(l(f)||h(f)||u(f))){s.push(a(f))}else if(r(f)){i=true;for(let t=0,s=f.length;t<s;t+=1){n(f[t],e,c+1)}}else if(e.length){n(f,e,c+1)}}};n(t,l(e)?e.split("."):e,0);return i?s:s[0]}const R={includeMatches:false,findAllMatches:false,minMatchCharLength:1};const N={isCaseSensitive:false,includeScore:false,keys:[],shouldSort:true,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1};const I={location:0,threshold:.6,distance:100};const F={useExtendedSearch:false,getFn:C,ignoreLocation:false,ignoreFieldNorm:false,fieldNormWeight:1};var O={...N,...R,...I,...F};const j=/[^ ]+/g;function E(t=1,e=3){const s=new Map;const i=Math.pow(10,e);return{get(e){const n=e.match(j).length;if(s.has(n)){return s.get(n)}const r=1/Math.pow(n,.5*t);const c=parseFloat(Math.round(r*i)/i);s.set(n,c);return c},clear(){s.clear()}}}class _{constructor({getFn:t=O.getFn,fieldNormWeight:e=O.fieldNormWeight}={}){this.norm=E(e,3);this.getFn=t;this.isCreated=false;this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t;this._keysMap={};t.forEach(((t,e)=>{this._keysMap[t.id]=e}))}create(){if(this.isCreated||!this.docs.length){return}this.isCreated=true;if(l(this.docs[0])){this.docs.forEach(((t,e)=>{this._addString(t,e)}))}else{this.docs.forEach(((t,e)=>{this._addObject(t,e)}))}this.norm.clear()}add(t){const e=this.size();if(l(t)){this._addString(t,e)}else{this._addObject(t,e)}}removeAt(t){this.records.splice(t,1);for(let e=t,s=this.size();e<s;e+=1){this.records[e].i-=1}}getValueForItemAtKeyId(t,e){return t[this._keysMap[e]]}size(){return this.records.length}_addString(t,e){if(!g(t)||m(t)){return}let s={v:t,i:e,n:this.norm.get(t)};this.records.push(s)}_addObject(t,e){let s={i:e,$:{}};this.keys.forEach(((e,i)=>{let n=this.getFn(t,e.path);if(!g(n)){return}if(r(n)){let t=[];const e=[{nestedArrIndex:-1,value:n}];while(e.length){const{nestedArrIndex:s,value:i}=e.pop();if(!g(i)){continue}if(l(i)&&!m(i)){let e={v:i,i:s,n:this.norm.get(i)};t.push(e)}else if(r(i)){i.forEach(((t,s)=>{e.push({nestedArrIndex:s,value:t})}))}else;}s.$[i]=t}else if(!m(n)){let t={v:n,n:this.norm.get(n)};s.$[i]=t}}));this.records.push(s)}toJSON(){return{keys:this.keys,records:this.records}}}function W(t,e,{getFn:s=O.getFn,fieldNormWeight:i=O.fieldNormWeight}={}){const n=new _({getFn:s,fieldNormWeight:i});n.setKeys(t.map(k));n.setSources(e);n.create();return n}function z(t,{getFn:e=O.getFn,fieldNormWeight:s=O.fieldNormWeight}={}){const{keys:i,records:n}=t;const r=new _({getFn:e,fieldNormWeight:s});r.setKeys(i);r.setIndexRecords(n);return r}function P(t,{errors:e=0,currentLocation:s=0,expectedLocation:i=0,distance:n=O.distance,ignoreLocation:r=O.ignoreLocation}={}){const c=e/t.length;if(r){return c}const o=Math.abs(i-s);if(!n){return o?1:c}return c+o/n}function T(t=[],e=O.minMatchCharLength){let s=[];let i=-1;let n=-1;let r=0;for(let c=t.length;r<c;r+=1){let c=t[r];if(c&&i===-1){i=r}else if(!c&&i!==-1){n=r-1;if(n-i+1>=e){s.push([i,n])}i=-1}}if(t[r-1]&&r-i>=e){s.push([i,r-1])}return s}const H=32;function J(t,e,s,{location:i=O.location,distance:n=O.distance,threshold:r=O.threshold,findAllMatches:c=O.findAllMatches,minMatchCharLength:o=O.minMatchCharLength,includeMatches:a=O.includeMatches,ignoreLocation:l=O.ignoreLocation}={}){if(e.length>H){throw new Error(y(H))}const h=e.length;const u=t.length;const f=Math.max(0,Math.min(i,u));let d=r;let g=f;const m=o>1||a;const M=m?Array(u):[];let p;while((p=t.indexOf(e,g))>-1){let t=P(e,{currentLocation:p,expectedLocation:f,distance:n,ignoreLocation:l});d=Math.min(t,d);g=p+h;if(m){let t=0;while(t<h){M[p+t]=1;t+=1}}}g=-1;let x=[];let v=1;let w=h+u;const L=1<<h-1;for(let i=0;i<h;i+=1){let r=0;let o=w;while(r<o){const t=P(e,{errors:i,currentLocation:f+o,expectedLocation:f,distance:n,ignoreLocation:l});if(t<=d){r=o}else{w=o}o=Math.floor((w-r)/2+r)}w=o;let a=Math.max(1,f-o+1);let p=c?u:Math.min(f+o,u)+h;let y=Array(p+2);y[p+1]=(1<<i)-1;for(let r=p;r>=a;r-=1){let c=r-1;let o=s[t.charAt(c)];if(m){M[c]=+!!o}y[r]=(y[r+1]<<1|1)&o;if(i){y[r]|=(x[r+1]|x[r])<<1|1|x[r+1]}if(y[r]&L){v=P(e,{errors:i,currentLocation:c,expectedLocation:f,distance:n,ignoreLocation:l});if(v<=d){d=v;g=c;if(g<=f){break}a=Math.max(1,2*f-g)}}}const b=P(e,{errors:i+1,currentLocation:f,expectedLocation:f,distance:n,ignoreLocation:l});if(b>d){break}x=y}const b={isMatch:g>=0,score:Math.max(.001,v)};if(m){const t=T(M,o);if(!t.length){b.isMatch=false}else if(a){b.indices=t}}return b}function K(t){let e={};for(let s=0,i=t.length;s<i;s+=1){const n=t.charAt(s);e[n]=(e[n]||0)|1<<i-s-1}return e}class B{constructor(t,{location:e=O.location,threshold:s=O.threshold,distance:i=O.distance,includeMatches:n=O.includeMatches,findAllMatches:r=O.findAllMatches,minMatchCharLength:c=O.minMatchCharLength,isCaseSensitive:o=O.isCaseSensitive,ignoreLocation:a=O.ignoreLocation}={}){this.options={location:e,threshold:s,distance:i,includeMatches:n,findAllMatches:r,minMatchCharLength:c,isCaseSensitive:o,ignoreLocation:a};this.pattern=o?t:t.toLowerCase();this.chunks=[];if(!this.pattern.length){return}const l=(t,e)=>{this.chunks.push({pattern:t,alphabet:K(t),startIndex:e})};const h=this.pattern.length;if(h>H){let t=0;const e=h%H;const s=h-e;while(t<s){l(this.pattern.substr(t,H),t);t+=H}if(e){const t=h-H;l(this.pattern.substr(t),t)}}else{l(this.pattern,0)}}searchIn(t){const{isCaseSensitive:e,includeMatches:s}=this.options;if(!e){t=t.toLowerCase()}if(this.pattern===t){let e={isMatch:true,score:0};if(s){e.indices=[[0,t.length-1]]}return e}const{location:i,distance:n,threshold:r,findAllMatches:c,minMatchCharLength:o,ignoreLocation:a}=this.options;let l=[];let h=0;let u=false;this.chunks.forEach((({pattern:e,alphabet:f,startIndex:d})=>{const{isMatch:g,score:m,indices:M}=J(t,e,f,{location:i+d,distance:n,threshold:r,findAllMatches:c,minMatchCharLength:o,includeMatches:s,ignoreLocation:a});if(g){u=true}h+=m;if(g&&M){l=[...l,...M]}}));let f={isMatch:u,score:u?h/this.chunks.length:1};if(u&&s){f.indices=l}return f}}class D{constructor(t){this.pattern=t}static isMultiMatch(t){return U(t,this.multiRegex)}static isSingleMatch(t){return U(t,this.singleRegex)}search(){}}function U(t,e){const s=t.match(e);return s?s[1]:null}class V extends D{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const e=t===this.pattern;return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}}class q extends D{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const e=t.indexOf(this.pattern);const s=e===-1;return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}}class G extends D{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const e=t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}}class Q extends D{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const e=!t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}}class X extends D{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const e=t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class Y extends D{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const e=!t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}}class Z extends D{constructor(t,{location:e=O.location,threshold:s=O.threshold,distance:i=O.distance,includeMatches:n=O.includeMatches,findAllMatches:r=O.findAllMatches,minMatchCharLength:c=O.minMatchCharLength,isCaseSensitive:o=O.isCaseSensitive,ignoreLocation:a=O.ignoreLocation}={}){super(t);this._bitapSearch=new B(t,{location:e,threshold:s,distance:i,includeMatches:n,findAllMatches:r,minMatchCharLength:c,isCaseSensitive:o,ignoreLocation:a})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class tt extends D{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let e=0;let s;const i=[];const n=this.pattern.length;while((s=t.indexOf(this.pattern,e))>-1){e=s+n;i.push([s,e-1])}const r=!!i.length;return{isMatch:r,score:r?0:1,indices:i}}}const et=[V,tt,G,Q,Y,X,q,Z];const st=et.length;const it=/ +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/;const nt="|";function rt(t,e={}){return t.split(nt).map((t=>{let s=t.trim().split(it).filter((t=>t&&!!t.trim()));let i=[];for(let t=0,n=s.length;t<n;t+=1){const n=s[t];let r=false;let c=-1;while(!r&&++c<st){const t=et[c];let s=t.isMultiMatch(n);if(s){i.push(new t(s,e));r=true}}if(r){continue}c=-1;while(++c<st){const t=et[c];let s=t.isSingleMatch(n);if(s){i.push(new t(s,e));break}}}return i}))}const ct=new Set([Z.type,tt.type]);class ot{constructor(t,{isCaseSensitive:e=O.isCaseSensitive,includeMatches:s=O.includeMatches,minMatchCharLength:i=O.minMatchCharLength,ignoreLocation:n=O.ignoreLocation,findAllMatches:r=O.findAllMatches,location:c=O.location,threshold:o=O.threshold,distance:a=O.distance}={}){this.query=null;this.options={isCaseSensitive:e,includeMatches:s,minMatchCharLength:i,findAllMatches:r,ignoreLocation:n,location:c,threshold:o,distance:a};this.pattern=e?t:t.toLowerCase();this.query=rt(this.pattern,this.options)}static condition(t,e){return e.useExtendedSearch}searchIn(t){const e=this.query;if(!e){return{isMatch:false,score:1}}const{includeMatches:s,isCaseSensitive:i}=this.options;t=i?t:t.toLowerCase();let n=0;let r=[];let c=0;for(let i=0,o=e.length;i<o;i+=1){const o=e[i];r.length=0;n=0;for(let e=0,i=o.length;e<i;e+=1){const i=o[e];const{isMatch:a,indices:l,score:h}=i.search(t);if(a){n+=1;c+=h;if(s){const t=i.constructor.type;if(ct.has(t)){r=[...r,...l]}else{r.push(l)}}}else{c=0;n=0;r.length=0;break}}if(n){let t={isMatch:true,score:c/n};if(s){t.indices=r}return t}}return{isMatch:false,score:1}}}const at=[];function lt(...t){at.push(...t)}function ht(t,e){for(let s=0,i=at.length;s<i;s+=1){let i=at[s];if(i.condition(t,e)){return new i(t,e)}}return new B(t,e)}const ut={AND:"$and",OR:"$or"};const ft={PATH:"$path",PATTERN:"$val"};const dt=t=>!!(t[ut.AND]||t[ut.OR]);const gt=t=>!!t[ft.PATH];const mt=t=>!r(t)&&f(t)&&!dt(t);const Mt=t=>({[ut.AND]:Object.keys(t).map((e=>({[e]:t[e]})))});function pt(t,e,{auto:s=true}={}){const i=t=>{let n=Object.keys(t);const c=gt(t);if(!c&&n.length>1&&!dt(t)){return i(Mt(t))}if(mt(t)){const i=c?t[ft.PATH]:n[0];const r=c?t[ft.PATTERN]:t[i];if(!l(r)){throw new Error(v(i))}const o={keyId:S(i),pattern:r};if(s){o.searcher=ht(r,e)}return o}let o={children:[],operator:n[0]};n.forEach((e=>{const s=t[e];if(r(s)){s.forEach((t=>{o.children.push(i(t))}))}}));return o};if(!dt(t)){t=Mt(t)}return i(t)}function xt(t,{ignoreFieldNorm:e=O.ignoreFieldNorm}){t.forEach((t=>{let s=1;t.matches.forEach((({key:t,norm:i,score:n})=>{const r=t?t.weight:null;s*=Math.pow(n===0&&r?Number.EPSILON:n,(r||1)*(e?1:i))}));t.score=s}))}function vt(t,e){const s=t.matches;e.matches=[];if(!g(s)){return}s.forEach((t=>{if(!g(t.indices)||!t.indices.length){return}const{indices:s,value:i}=t;let n={indices:s,value:i};if(t.key){n.key=t.key.src}if(t.idx>-1){n.refIndex=t.idx}e.matches.push(n)}))}function yt(t,e){e.score=t.score}function wt(t,e,{includeMatches:s=O.includeMatches,includeScore:i=O.includeScore}={}){const n=[];if(s)n.push(vt);if(i)n.push(yt);return t.map((t=>{const{idx:s}=t;const i={item:e[s],refIndex:s};if(n.length){n.forEach((e=>{e(t,i)}))}return i}))}class Lt{constructor(t,e={},s){this.options={...O,...e};if(this.options.useExtendedSearch&&!true){throw new Error(p)}this._keyStore=new $(this.options.keys);this.setCollection(t,s)}setCollection(t,e){this._docs=t;if(e&&!(e instanceof _)){throw new Error(x)}this._myIndex=e||W(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){if(!g(t)){return}this._docs.push(t);this._myIndex.add(t)}remove(t=(()=>false)){const e=[];for(let s=0,i=this._docs.length;s<i;s+=1){const n=this._docs[s];if(t(n,s)){this.removeAt(s);s-=1;i-=1;e.push(n)}}return e}removeAt(t){this._docs.splice(t,1);this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:e=-1}={}){const{includeMatches:s,includeScore:i,shouldSort:n,sortFn:r,ignoreFieldNorm:c}=this.options;let o=l(t)?l(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);xt(o,{ignoreFieldNorm:c});if(n){o.sort(r)}if(h(e)&&e>-1){o=o.slice(0,e)}return wt(o,this._docs,{includeMatches:s,includeScore:i})}_searchStringList(t){const e=ht(t,this.options);const{records:s}=this._myIndex;const i=[];s.forEach((({v:t,i:s,n})=>{if(!g(t)){return}const{isMatch:r,score:c,indices:o}=e.searchIn(t);if(r){i.push({item:t,idx:s,matches:[{score:c,value:t,norm:n,indices:o}]})}}));return i}_searchLogical(t){const e=pt(t,this.options);const s=(t,e,i)=>{if(!t.children){const{keyId:s,searcher:n}=t;const r=this._findMatches({key:this._keyStore.get(s),value:this._myIndex.getValueForItemAtKeyId(e,s),searcher:n});if(r&&r.length){return[{idx:i,item:e,matches:r}]}return[]}const n=[];for(let r=0,c=t.children.length;r<c;r+=1){const c=t.children[r];const o=s(c,e,i);if(o.length){n.push(...o)}else if(t.operator===ut.AND){return[]}}return n};const i=this._myIndex.records;const n={};const r=[];i.forEach((({$:t,i})=>{if(g(t)){let c=s(e,t,i);if(c.length){if(!n[i]){n[i]={idx:i,item:t,matches:[]};r.push(n[i])}c.forEach((({matches:t})=>{n[i].matches.push(...t)}))}}}));return r}_searchObjectList(t){const e=ht(t,this.options);const{keys:s,records:i}=this._myIndex;const n=[];i.forEach((({$:t,i})=>{if(!g(t)){return}let r=[];s.forEach(((s,i)=>{r.push(...this._findMatches({key:s,value:t[i],searcher:e}))}));if(r.length){n.push({idx:i,item:t,matches:r})}}));return n}_findMatches({key:t,value:e,searcher:s}){if(!g(e)){return[]}let i=[];if(r(e)){e.forEach((({v:e,i:n,n:r})=>{if(!g(e)){return}const{isMatch:c,score:o,indices:a}=s.searchIn(e);if(c){i.push({score:o,key:t,value:e,idx:n,norm:r,indices:a})}}))}else{const{v:n,n:r}=e;const{isMatch:c,score:o,indices:a}=s.searchIn(n);if(c){i.push({score:o,key:t,value:n,norm:r,indices:a})}}return i}}Lt.version="6.5.3";Lt.createIndex=W;Lt.parseIndex=z;Lt.config=O;{Lt.parseQuery=pt}{lt(ot)}const bt=".sc-road-select-filter-h{--margin-top:3rem;position:relative;display:block}.select-filter-list.sc-road-select-filter{position:absolute;top:var(--margin-top);z-index:2;width:100%;max-height:16rem;padding:0;margin:0;overflow-y:scroll;font-family:var(--road-font, sans-serif);font-size:1rem;color:var(--road-on-surface);list-style-type:none;background:var(--road-surface);border-radius:0 0 0.25rem 0.25rem;box-shadow:var(--road-elevation-low)}.select-filter-list.not-active.sc-road-select-filter{opacity:0}.select-filter-item.sc-road-select-filter{display:flex;align-items:center;padding:0.75rem 1rem;cursor:pointer}.select-filter-item.active.sc-road-select-filter{outline:1px solid var(--road-input-outline-variant)}.select-filter-item.sc-road-select-filter:hover,.select-filter-item.sc-road-select-filter:focus,.select-filter-item.highlight.sc-road-select-filter{color:var(--road-on-primary);background:var(--road-primary)}";const $t=class{constructor(s){t(this,s);this.roadselected=e(this,"roadselected",7);this.roadSelected=e(this,"roadSelected",7);this.onClick=(t,e)=>{this.el.querySelector("road-input").value=e;if(document.getElementsByClassName("phone-number-label-icon").length>0){this.el.querySelector("road-icon").name="flag-"+e}this.isOpen=false;this.roadselected.emit({value:t.toString(),label:e});this.roadSelected.emit({value:t.toString(),label:e});this.activeIndex=-1};this.handleOptionMouseOver=t=>{this.activeIndex=t};this.handleOptionClick=(t,e)=>{this.onClick(t,e)};this.handleMouseLeave=()=>{this.activeIndex=-1};this.isOpen=false;this.currentValue="";this.activeIndex=-1;this.options=[];this.parameters={keys:["value","label"],threshold:.3,ignoreLocation:true};this.isActive=false;this.onlySelect=true}handleFocus(){this.isOpen=true;this.isActive=true}handleBlur(){this.isActive=false}handleChange(t){this.currentValue=t.detail.value.toLowerCase()}onClickOutside(t){if(this.isOpen&&!this.el.contains(t.target)){this.isOpen=false;this.isActive=false;const t=this.el.querySelector("road-input").value;if(this.onlySelect&&!this.options.some((e=>e["label"]===t))){this.el.querySelector("road-input").value=""}}}handleKeydown(t){if(this.isOpen){if(t.key==="ArrowDown"){t.preventDefault();this.activeIndex=(this.activeIndex+1)%this.filteredOptions.length}else if(t.key==="ArrowUp"){t.preventDefault();this.activeIndex=(this.activeIndex-1+this.filteredOptions.length)%this.filteredOptions.length}else if(t.key==="Enter"){t.preventDefault();const e=this.filteredOptions[this.activeIndex];if(e){this.onClick(e.item.value,e.item.label)}}else if(t.key==="Escape"){t.preventDefault();this.isOpen=false;this.isActive=false}}}get filteredOptions(){const t=new Lt(this.options,this.parameters);return this.currentValue===""?this.options.map(((t,e)=>({item:t,score:1,refIndex:e}))):t.search(this.currentValue)}render(){const t=this.filteredOptions;const e=this.isActive?"true":"false";const n=this.isActive?"":"not-active";return s(i,{"is-active":e},s("slot",null),this.isOpen&&s("ul",{class:`${n} select-filter-list`,role:"listbox",onMouseLeave:this.handleMouseLeave},t.map(((t,e)=>s("li",{class:`select-filter-item ${this.activeIndex===e?"active":""}`,role:"option","aria-selected":this.activeIndex===e?"true":"false",onClick:()=>this.handleOptionClick(t.item.value,t.item.label.replace(/(<([^>]+)>)/gi,"")),onMouseOver:()=>this.handleOptionMouseOver(e),innerHTML:t.item.label,tabindex:this.activeIndex===e?0:-1})))))}get el(){return n(this)}};$t.style=bt;export{$t as road_select_filter};
|
|
2
|
+
//# sourceMappingURL=p-c09f4088.entry.js.map
|