@gov-design-system-ce/components 4.0.7 → 4.0.8-rc01
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/array.utils-5a024b3a.js +46 -0
- package/dist/cjs/array.utils-5a024b3a.js.map +1 -0
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/{form-74063d50.js → form-47b5ef29.js} +2 -2
- package/dist/cjs/form-47b5ef29.js.map +1 -0
- package/dist/cjs/gov-form-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-control.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-file.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-input.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-multi-select.cjs.entry.js +82 -101
- package/dist/cjs/gov-form-multi-select.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-radio.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-select.cjs.entry.js +14 -18
- package/dist/cjs/gov-form-select.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-switch.cjs.entry.js +1 -1
- package/dist/cjs/gov-icon.cjs.entry.js +1 -1
- package/dist/cjs/gov-pagination.cjs.entry.js +2 -8
- package/dist/cjs/gov-pagination.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/stencil.utils-22814956.js +11 -0
- package/dist/cjs/stencil.utils-22814956.js.map +1 -0
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js +134 -253
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js.map +1 -1
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.types.js.map +1 -1
- package/dist/collection/components/gov-form/select/constants.js +1 -1
- package/dist/collection/components/gov-form/select/constants.js.map +1 -1
- package/dist/collection/components/gov-form/select/gov-form-select.js +40 -64
- package/dist/collection/components/gov-form/select/gov-form-select.js.map +1 -1
- package/dist/collection/components/gov-form/select/gov-form-select.types.js.map +1 -1
- package/dist/collection/components/gov-pagination/gov-pagination.js +1 -1
- package/dist/collection/components/gov-pagination/gov-pagination.js.map +1 -1
- package/dist/collection/pages/Forms.js +8 -7
- package/dist/collection/pages/Forms.js.map +1 -1
- package/dist/collection/utils/array.utils.js +14 -0
- package/dist/collection/utils/array.utils.js.map +1 -1
- package/dist/collection/utils/object.utils.js +18 -0
- package/dist/collection/utils/object.utils.js.map +1 -0
- package/dist/collection/utils/stencil.utils.js +6 -0
- package/dist/collection/utils/stencil.utils.js.map +1 -0
- package/dist/components/gov-accordion-item.js +1 -1
- package/dist/components/gov-attachments-item.js +1 -1
- package/dist/components/gov-breadcrumbs.js +1 -1
- package/dist/components/gov-button.js +1 -1
- package/dist/components/gov-card.js +1 -1
- package/dist/components/gov-chip.js +1 -1
- package/dist/components/gov-form-autocomplete.js +1 -1
- package/dist/components/gov-form-checkbox.js +1 -1
- package/dist/components/gov-form-control.js +1 -1
- package/dist/components/gov-form-file.js +1 -1
- package/dist/components/gov-form-input.js +1 -1
- package/dist/components/gov-form-multi-select.js +1 -1
- package/dist/components/gov-form-multi-select.js.map +1 -1
- package/dist/components/gov-form-radio.js +1 -1
- package/dist/components/gov-form-select.js +1 -1
- package/dist/components/gov-form-switch.js +1 -1
- package/dist/components/gov-icon.js +1 -1
- package/dist/components/gov-infobar.js +1 -1
- package/dist/components/gov-loading.js +1 -1
- package/dist/components/gov-modal.js +1 -1
- package/dist/components/gov-pagination.js +1 -1
- package/dist/components/gov-pagination.js.map +1 -1
- package/dist/components/gov-prompt.js +1 -1
- package/dist/components/gov-side-nav-item.js +1 -1
- package/dist/components/gov-tabs.js +1 -1
- package/dist/components/gov-tag.js +1 -1
- package/dist/components/gov-toast.js +1 -1
- package/dist/components/gov-tooltip-content.js +1 -1
- package/dist/components/gov-wizard-item.js +1 -1
- package/dist/components/{p-44762d17.js → p-23990b41.js} +2 -2
- package/dist/components/{p-5dbe0178.js → p-26805569.js} +2 -2
- package/dist/components/p-2dee9951.js.map +1 -1
- package/dist/components/p-6c1d0f47.js +2 -0
- package/dist/components/p-6c1d0f47.js.map +1 -0
- package/dist/components/{p-99860f34.js → p-a6a15eb1.js} +2 -2
- package/dist/components/p-b48d3aae.js +2 -0
- package/dist/components/p-b48d3aae.js.map +1 -0
- package/dist/components/{p-976404a5.js → p-b5a06a0a.js} +2 -2
- package/dist/components/p-c9baa62f.js +2 -0
- package/dist/components/p-c9baa62f.js.map +1 -0
- package/dist/components/{p-76b229e3.js → p-e2bee1ef.js} +2 -2
- package/dist/components/p-f9f8e529.js +2 -0
- package/dist/components/{p-8b7b916a.js.map → p-f9f8e529.js.map} +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-148501cc.entry.js → p-191e9b0c.entry.js} +2 -2
- package/dist/core/{p-9402e4cc.entry.js → p-2a13c39c.entry.js} +2 -2
- package/dist/core/p-4b4a270d.entry.js +2 -0
- package/dist/core/p-4b4a270d.entry.js.map +1 -0
- package/dist/core/p-575d0c94.entry.js +2 -0
- package/dist/core/p-575d0c94.entry.js.map +1 -0
- package/dist/core/p-5bc604a3.js.map +1 -1
- package/dist/core/p-831edc90.entry.js +2 -0
- package/dist/core/p-831edc90.entry.js.map +1 -0
- package/dist/core/{p-1bc2f62c.entry.js → p-8f121cad.entry.js} +2 -2
- package/dist/core/p-8fcc8483.js +2 -0
- package/dist/core/p-8fcc8483.js.map +1 -0
- package/dist/core/p-927880d6.entry.js.map +1 -1
- package/dist/core/p-ab5a13ea.js +2 -0
- package/dist/core/p-ab5a13ea.js.map +1 -0
- package/dist/core/{p-f9dcaafb.entry.js → p-af9a14e3.entry.js} +2 -2
- package/dist/core/{p-835f1187.entry.js → p-c0e8802d.entry.js} +2 -2
- package/dist/core/p-d784c44d.js +2 -0
- package/dist/core/p-d784c44d.js.map +1 -0
- package/dist/core/{p-ac856de6.entry.js → p-dd8816aa.entry.js} +2 -2
- package/dist/core/p-ef387ab2.entry.js +2 -0
- package/dist/core/{p-e3b14974.entry.js.map → p-ef387ab2.entry.js.map} +1 -1
- package/dist/esm/array.utils-b27436ea.js +43 -0
- package/dist/esm/array.utils-b27436ea.js.map +1 -0
- package/dist/esm/core.js +1 -1
- package/dist/esm/{form-39dc6896.js → form-e3424b70.js} +2 -2
- package/dist/esm/form-e3424b70.js.map +1 -0
- package/dist/esm/gov-form-checkbox.entry.js +1 -1
- package/dist/esm/gov-form-control.entry.js +1 -1
- package/dist/esm/gov-form-file.entry.js +1 -1
- package/dist/esm/gov-form-input.entry.js +1 -1
- package/dist/esm/gov-form-multi-select.entry.js +82 -101
- package/dist/esm/gov-form-multi-select.entry.js.map +1 -1
- package/dist/esm/gov-form-radio.entry.js +1 -1
- package/dist/esm/gov-form-select.entry.js +14 -18
- package/dist/esm/gov-form-select.entry.js.map +1 -1
- package/dist/esm/gov-form-switch.entry.js +1 -1
- package/dist/esm/gov-icon.entry.js +1 -1
- package/dist/esm/gov-pagination.entry.js +2 -8
- package/dist/esm/gov-pagination.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/stencil.utils-7cb5b075.js +9 -0
- package/dist/esm/stencil.utils-7cb5b075.js.map +1 -0
- package/dist/hydrate/index.js +145 -138
- package/dist/types/components/gov-form/multiselect/gov-form-multi-select.d.ts +17 -29
- package/dist/types/components/gov-form/multiselect/gov-form-multi-select.types.d.ts +3 -2
- package/dist/types/components/gov-form/select/constants.d.ts +1 -1
- package/dist/types/components/gov-form/select/gov-form-select.d.ts +6 -9
- package/dist/types/components/gov-form/select/gov-form-select.types.d.ts +1 -1
- package/dist/types/components.d.ts +28 -36
- package/dist/types/utils/array.utils.d.ts +1 -0
- package/dist/types/utils/object.utils.d.ts +1 -0
- package/dist/types/utils/stencil.utils.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/form-74063d50.js.map +0 -1
- package/dist/components/p-2d5d24af.js +0 -2
- package/dist/components/p-2d5d24af.js.map +0 -1
- package/dist/components/p-53e02bee.js +0 -2
- package/dist/components/p-53e02bee.js.map +0 -1
- package/dist/components/p-8b7b916a.js +0 -2
- package/dist/core/p-0e5fa8bf.js +0 -2
- package/dist/core/p-0e5fa8bf.js.map +0 -1
- package/dist/core/p-531c350f.entry.js +0 -2
- package/dist/core/p-531c350f.entry.js.map +0 -1
- package/dist/core/p-e3b14974.entry.js +0 -2
- package/dist/core/p-f1031bac.entry.js +0 -2
- package/dist/core/p-f1031bac.entry.js.map +0 -1
- package/dist/core/p-f7065042.entry.js +0 -2
- package/dist/core/p-f7065042.entry.js.map +0 -1
- package/dist/esm/form-39dc6896.js.map +0 -1
- package/dist/globals.d.ts +0 -2
- package/dist/types/types/typings.d.ts +0 -6
- /package/dist/components/{p-44762d17.js.map → p-23990b41.js.map} +0 -0
- /package/dist/components/{p-5dbe0178.js.map → p-26805569.js.map} +0 -0
- /package/dist/components/{p-99860f34.js.map → p-a6a15eb1.js.map} +0 -0
- /package/dist/components/{p-976404a5.js.map → p-b5a06a0a.js.map} +0 -0
- /package/dist/components/{p-76b229e3.js.map → p-e2bee1ef.js.map} +0 -0
- /package/dist/core/{p-148501cc.entry.js.map → p-191e9b0c.entry.js.map} +0 -0
- /package/dist/core/{p-9402e4cc.entry.js.map → p-2a13c39c.entry.js.map} +0 -0
- /package/dist/core/{p-1bc2f62c.entry.js.map → p-8f121cad.entry.js.map} +0 -0
- /package/dist/core/{p-f9dcaafb.entry.js.map → p-af9a14e3.entry.js.map} +0 -0
- /package/dist/core/{p-835f1187.entry.js.map → p-c0e8802d.entry.js.map} +0 -0
- /package/dist/core/{p-ac856de6.entry.js.map → p-dd8816aa.entry.js.map} +0 -0
package/dist/hydrate/index.js
CHANGED
|
@@ -7555,7 +7555,7 @@ const FormInputClass = {
|
|
|
7555
7555
|
root: 'gov-form-input',
|
|
7556
7556
|
};
|
|
7557
7557
|
|
|
7558
|
-
const FormSelectSizes = pick(Sizes, ['_M', '_L', '_XL']);
|
|
7558
|
+
const FormSelectSizes = pick(Sizes, ['_S', '_M', '_L', '_XL']);
|
|
7559
7559
|
const FormSelectVariants = pick(Variants, ['PRIMARY', 'SECONDARY']);
|
|
7560
7560
|
const FormSelectClass = {
|
|
7561
7561
|
root: 'gov-form-select',
|
|
@@ -8507,8 +8507,50 @@ class GovFormMessage {
|
|
|
8507
8507
|
}; }
|
|
8508
8508
|
}
|
|
8509
8509
|
|
|
8510
|
-
const
|
|
8511
|
-
|
|
8510
|
+
const is = (value) => value !== undefined && value !== null;
|
|
8511
|
+
const isObject = (obj) => typeof obj === 'object';
|
|
8512
|
+
const isString = (input) => is(input) && typeof input === 'string';
|
|
8513
|
+
|
|
8514
|
+
const parseJSONString = (value) => {
|
|
8515
|
+
if (isString(value) && value.length) {
|
|
8516
|
+
try {
|
|
8517
|
+
console.log(value);
|
|
8518
|
+
const parsed = JSON.parse(value);
|
|
8519
|
+
if (Array.isArray(parsed) || isObject(parsed)) {
|
|
8520
|
+
return parsed;
|
|
8521
|
+
}
|
|
8522
|
+
}
|
|
8523
|
+
catch (e) {
|
|
8524
|
+
console.log(e);
|
|
8525
|
+
return null;
|
|
8526
|
+
}
|
|
8527
|
+
}
|
|
8528
|
+
return null;
|
|
8529
|
+
};
|
|
8530
|
+
|
|
8531
|
+
const createArrayRange = (from, to) => {
|
|
8532
|
+
if (Number.isInteger(from) && Number.isInteger(to)) {
|
|
8533
|
+
return [...Array(to + 1).keys()].slice(from);
|
|
8534
|
+
}
|
|
8535
|
+
return [];
|
|
8536
|
+
};
|
|
8537
|
+
const propsValueToArray = (value) => {
|
|
8538
|
+
if (Array.isArray(value)) {
|
|
8539
|
+
return value;
|
|
8540
|
+
}
|
|
8541
|
+
else if (isString(value)) {
|
|
8542
|
+
const parsed = parseJSONString(value);
|
|
8543
|
+
if (Array.isArray(parsed)) {
|
|
8544
|
+
return parsed;
|
|
8545
|
+
}
|
|
8546
|
+
}
|
|
8547
|
+
return [];
|
|
8548
|
+
};
|
|
8549
|
+
|
|
8550
|
+
const tick = (callback) => {
|
|
8551
|
+
setTimeout(() => {
|
|
8552
|
+
callback();
|
|
8553
|
+
}, 0);
|
|
8512
8554
|
};
|
|
8513
8555
|
|
|
8514
8556
|
const govFormMultiSelectCss = ".gov-form-multi-select__list{margin:0;padding:0}.gov-form-multi-select__list>.gov-form-multi-select__item{margin:0;padding:0;background:none}.gov-form-multi-select__list>.gov-form-multi-select__item::before{display:none}.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-form-multi-select{position:relative;display:flex;width:100%;align-items:center}.gov-form-multi-select .element{position:relative;display:flex;flex:1 1 auto}.gov-form-multi-select input,.gov-form-multi-select select,.gov-form-multi-select textarea{width:100%;border-radius:var(--gov-border-radius, 0.1875rem);background-color:var(--gov-form-bg-color, var(--gov-color-neutral-white));font-family:var(--gov-font-family, \"Roboto\", sans-serif)}.gov-form-multi-select input:focus,.gov-form-multi-select select:focus,.gov-form-multi-select textarea:focus{outline:none}.gov-form-multi-select input:focus-visible,.gov-form-multi-select select:focus-visible,.gov-form-multi-select textarea:focus-visible{border-radius:var(--gov-border-radius, 0.1875rem);outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base);outline-offset:0}.gov-form-multi-select input::-moz-placeholder,.gov-form-multi-select select::-moz-placeholder,.gov-form-multi-select textarea::-moz-placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-multi-select input::placeholder,.gov-form-multi-select select::placeholder,.gov-form-multi-select textarea::placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-multi-select textarea{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);padding:0.5rem 0.75rem;resize:none}.gov-form-multi-select *[slot=left-icon],.gov-form-multi-select *[slot=right-icon]{position:absolute;top:50%;display:flex;justify-content:center;transform:translateY(-50%);pointer-events:none}.gov-form-multi-select *[slot=left-icon]{left:0}.gov-form-multi-select *[slot=right-icon]{right:0}.gov-form-multi-select *[slot=prefix],.gov-form-multi-select *[slot=sufix]{margin:0}[size=s].gov-form-multi-select{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);gap:0.5rem var(--gov-form-input-core-s-icon-size, 1rem)}[size=s].gov-form-multi-select input,[size=s].gov-form-multi-select select{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);height:var(--gov-form-input-core-s-height, 2rem);padding:var(--gov-form-input-core-s-padding, 0.25rem 0.75rem)}[size=s].gov-form-multi-select *[slot=left-icon],[size=s].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-s-icon-size, 1rem);height:var(--gov-form-input-core-s-icon-size, 1rem)}[size=s].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-s-icon-padding, 2rem) - var(--gov-form-input-core-s-icon-size, 1rem)) / 2)}[size=s].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-s-icon-padding, 2rem)}[size=s].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-s-icon-padding, 2rem) - var(--gov-form-input-core-s-icon-size, 1rem)) / 2)}[size=s].gov-form-multi-select *[slot=right-icon]~input,[size=s].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-s-icon-padding, 2rem)}[size=m].gov-form-multi-select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);gap:0.5rem var(--gov-form-input-core-m-icon-size, 1rem)}[size=m].gov-form-multi-select input,[size=m].gov-form-multi-select select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);height:var(--gov-form-input-core-m-height, 2.5rem);padding:var(--gov-form-input-core-m-padding, 0.4375rem 0.75rem)}[size=m].gov-form-multi-select *[slot=left-icon],[size=m].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-m-icon-size, 1rem);height:var(--gov-form-input-core-m-icon-size, 1rem)}[size=m].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-m-icon-padding, 2.5rem) - var(--gov-form-input-core-m-icon-size, 1rem)) / 2)}[size=m].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=m].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-m-icon-padding, 2.5rem) - var(--gov-form-input-core-m-icon-size, 1rem)) / 2)}[size=m].gov-form-multi-select *[slot=right-icon]~input,[size=m].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=l].gov-form-multi-select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);gap:0.5rem var(--gov-form-input-core-l-icon-size, 1rem)}[size=l].gov-form-multi-select input,[size=l].gov-form-multi-select select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);height:var(--gov-form-input-core-l-height, 3rem);padding:var(--gov-form-input-core-l-padding, 0.6875rem 0.75rem)}[size=l].gov-form-multi-select *[slot=left-icon],[size=l].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-l-icon-size, 1rem);height:var(--gov-form-input-core-l-icon-size, 1rem)}[size=l].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-l-icon-padding, 2.5rem) - var(--gov-form-input-core-l-icon-size, 1rem)) / 2)}[size=l].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=l].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-l-icon-padding, 2.5rem) - var(--gov-form-input-core-l-icon-size, 1rem)) / 2)}[size=l].gov-form-multi-select *[slot=right-icon]~input,[size=l].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=xl].gov-form-multi-select{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);gap:0.5rem var(--gov-form-input-core-xl-icon-size, 1.25rem)}[size=xl].gov-form-multi-select input,[size=xl].gov-form-multi-select select{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);height:var(--gov-form-input-core-xl-height, 3.5rem);padding:var(--gov-form-input-core-xl-padding, 0.9375rem 1rem 0.875rem)}[size=xl].gov-form-multi-select *[slot=left-icon],[size=xl].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-xl-icon-size, 1.25rem);height:var(--gov-form-input-core-xl-icon-size, 1.25rem)}[size=xl].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-xl-icon-padding, 3rem) - var(--gov-form-input-core-xl-icon-size, 1.25rem)) / 2)}[size=xl].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-xl-icon-padding, 3rem)}[size=xl].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-xl-icon-padding, 3rem) - var(--gov-form-input-core-xl-icon-size, 1.25rem)) / 2)}[size=xl].gov-form-multi-select *[slot=right-icon]~input,[size=xl].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-xl-icon-padding, 3rem)}[variant=primary].gov-form-multi-select input,[variant=primary].gov-form-multi-select select,[variant=primary].gov-form-multi-select textarea{color:var(--gov-form-input-color-primary, var(--gov-color-secondary-700));border:var(--gov-form-input-border-primary, 0.0625rem solid var(--gov-color-primary-600))}[variant=primary].gov-form-multi-select *[slot=left-icon],[variant=primary].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-input-icon-color-primary, var(--gov-color-primary))}[variant=secondary].gov-form-multi-select input,[variant=secondary].gov-form-multi-select select,[variant=secondary].gov-form-multi-select textarea{color:var(--gov-form-input-color-secondary, var(--gov-color-secondary-700));border:var(--gov-form-input-border-secondary, 0.0625rem solid var(--gov-color-secondary-700))}[variant=secondary].gov-form-multi-select *[slot=left-icon],[variant=secondary].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-input-icon-color-secondary, var(--gov-color-primary))}[disabled=\"\"].gov-form-multi-select,[disabled=true i].gov-form-multi-select,[disabled=\"1\"].gov-form-multi-select{pointer-events:none}[disabled=\"\"].gov-form-multi-select input,[disabled=\"\"].gov-form-multi-select select,[disabled=\"\"].gov-form-multi-select textarea,[disabled=true i].gov-form-multi-select input,[disabled=true i].gov-form-multi-select select,[disabled=true i].gov-form-multi-select textarea,[disabled=\"1\"].gov-form-multi-select input,[disabled=\"1\"].gov-form-multi-select select,[disabled=\"1\"].gov-form-multi-select textarea{border-color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600));background:var(--gov-form-input-disabled-bg, var(--gov-color-secondary-300));color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[disabled=\"\"].gov-form-multi-select *[slot=left-icon],[disabled=\"\"].gov-form-multi-select *[slot=right-icon],[disabled=true i].gov-form-multi-select *[slot=left-icon],[disabled=true i].gov-form-multi-select *[slot=right-icon],[disabled=\"1\"].gov-form-multi-select *[slot=left-icon],[disabled=\"1\"].gov-form-multi-select *[slot=right-icon]{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600)) !important}[invalid=\"\"].gov-form-multi-select input,[invalid=\"\"].gov-form-multi-select select,[invalid=\"\"].gov-form-multi-select textarea,[invalid=true i].gov-form-multi-select input,[invalid=true i].gov-form-multi-select select,[invalid=true i].gov-form-multi-select textarea,[invalid=\"1\"].gov-form-multi-select input,[invalid=\"1\"].gov-form-multi-select select,[invalid=\"1\"].gov-form-multi-select textarea{border-color:var(--gov-form-state-color-error, var(--gov-color-error));color:var(--gov-form-state-color-error, var(--gov-color-error))}[invalid=\"\"].gov-form-multi-select input::-moz-placeholder,[invalid=\"\"].gov-form-multi-select select::-moz-placeholder,[invalid=\"\"].gov-form-multi-select textarea::-moz-placeholder,[invalid=true i].gov-form-multi-select input::-moz-placeholder,[invalid=true i].gov-form-multi-select select::-moz-placeholder,[invalid=true i].gov-form-multi-select textarea::-moz-placeholder,[invalid=\"1\"].gov-form-multi-select input::-moz-placeholder,[invalid=\"1\"].gov-form-multi-select select::-moz-placeholder,[invalid=\"1\"].gov-form-multi-select textarea::-moz-placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=\"\"].gov-form-multi-select input::placeholder,[invalid=\"\"].gov-form-multi-select select::placeholder,[invalid=\"\"].gov-form-multi-select textarea::placeholder,[invalid=true i].gov-form-multi-select input::placeholder,[invalid=true i].gov-form-multi-select select::placeholder,[invalid=true i].gov-form-multi-select textarea::placeholder,[invalid=\"1\"].gov-form-multi-select input::placeholder,[invalid=\"1\"].gov-form-multi-select select::placeholder,[invalid=\"1\"].gov-form-multi-select textarea::placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=\"\"].gov-form-multi-select *[slot=left-icon],[invalid=\"\"].gov-form-multi-select *[slot=right-icon],[invalid=true i].gov-form-multi-select *[slot=left-icon],[invalid=true i].gov-form-multi-select *[slot=right-icon],[invalid=\"1\"].gov-form-multi-select *[slot=left-icon],[invalid=\"1\"].gov-form-multi-select *[slot=right-icon]{color:var(--gov-form-state-color-error, var(--gov-color-error)) !important}[invalid=\"\"].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[invalid=true i].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[invalid=\"1\"].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow){display:none}[success=\"\"].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow),[success=true i].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow),[success=\"1\"].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-state-color-success, var(--gov-color-success))}[success=\"\"].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success=true i].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success=\"1\"].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow){display:none}[multiline=\"\"].gov-form-multi-select *[slot=left-icon],[multiline=\"\"].gov-form-multi-select *[slot=right-icon],[multiline=true i].gov-form-multi-select *[slot=left-icon],[multiline=true i].gov-form-multi-select *[slot=right-icon],[multiline=\"1\"].gov-form-multi-select *[slot=left-icon],[multiline=\"1\"].gov-form-multi-select *[slot=right-icon]{display:none}.gov-form-multi-select{background:none}.gov-form-multi-select select{-webkit-appearance:none;-moz-appearance:none}.gov-form-multi-select select::-ms-expand{display:none}[size=s].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-s-arrow-right-position, 0.75rem);width:var(--gov-form-select-s-arrow-size, 0.75rem);height:var(--gov-form-select-s-arrow-size, 0.75rem)}[size=s][invalid=\"\"].gov-form-multi-select .icon-arrow,[size=s][invalid=true i].gov-form-multi-select .icon-arrow,[size=s][invalid=\"1\"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-s-arrow-right-position, 0.75rem))}[size=s][success=\"\"].gov-form-multi-select .icon-arrow,[size=s][success=true i].gov-form-multi-select .icon-arrow,[size=s][success=\"1\"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-s-arrow-right-position, 0.75rem))}[size=m].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-m-arrow-right-position, 1rem);width:var(--gov-form-select-m-arrow-size, 0.75rem);height:var(--gov-form-select-m-arrow-size, 0.75rem)}[size=m][invalid=\"\"].gov-form-multi-select .icon-arrow,[size=m][invalid=true i].gov-form-multi-select .icon-arrow,[size=m][invalid=\"1\"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-m-arrow-right-position, 1rem))}[size=m][success=\"\"].gov-form-multi-select .icon-arrow,[size=m][success=true i].gov-form-multi-select .icon-arrow,[size=m][success=\"1\"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-m-arrow-right-position, 1rem))}[size=l].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-l-arrow-right-position, 1rem);width:var(--gov-form-select-l-arrow-size, 1rem);height:var(--gov-form-select-l-arrow-size, 1rem)}[size=l][invalid=\"\"].gov-form-multi-select .icon-arrow,[size=l][invalid=true i].gov-form-multi-select .icon-arrow,[size=l][invalid=\"1\"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-l-arrow-right-position, 1rem))}[size=l][success=\"\"].gov-form-multi-select .icon-arrow,[size=l][success=true i].gov-form-multi-select .icon-arrow,[size=l][success=\"1\"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-l-arrow-right-position, 1rem))}[size=xl].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-xl-arrow-right-position, 1.3125rem);width:var(--gov-form-select-xl-arrow-size, 1rem);height:var(--gov-form-select-xl-arrow-size, 1rem)}[size=xl][invalid=\"\"].gov-form-multi-select .icon-arrow,[size=xl][invalid=true i].gov-form-multi-select .icon-arrow,[size=xl][invalid=\"1\"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-xl-arrow-right-position, 1.3125rem))}[size=xl][success=\"\"].gov-form-multi-select .icon-arrow,[size=xl][success=true i].gov-form-multi-select .icon-arrow,[size=xl][success=\"1\"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-xl-arrow-right-position, 1.3125rem))}[size=s][invalid=\"\"].gov-form-multi-select *[slot=right-icon]~select,[size=s][invalid=\"\"].gov-form-multi-select *[slot=right-icon]~input,[size=s][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=s][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=s][invalid=\"1\"].gov-form-multi-select *[slot=right-icon]~select,[size=s][invalid=\"1\"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-s-icon-padding, 2rem))}[size=s][success=\"\"].gov-form-multi-select *[slot=right-icon]~select,[size=s][success=\"\"].gov-form-multi-select *[slot=right-icon]~input,[size=s][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=s][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=s][success=\"1\"].gov-form-multi-select *[slot=right-icon]~select,[size=s][success=\"1\"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-s-icon-padding, 2rem))}[size=m][invalid=\"\"].gov-form-multi-select *[slot=right-icon]~select,[size=m][invalid=\"\"].gov-form-multi-select *[slot=right-icon]~input,[size=m][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=m][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=m][invalid=\"1\"].gov-form-multi-select *[slot=right-icon]~select,[size=m][invalid=\"1\"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-m-icon-padding, 2.5rem))}[size=m][success=\"\"].gov-form-multi-select *[slot=right-icon]~select,[size=m][success=\"\"].gov-form-multi-select *[slot=right-icon]~input,[size=m][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=m][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=m][success=\"1\"].gov-form-multi-select *[slot=right-icon]~select,[size=m][success=\"1\"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-m-icon-padding, 2.5rem))}[size=l][invalid=\"\"].gov-form-multi-select *[slot=right-icon]~select,[size=l][invalid=\"\"].gov-form-multi-select *[slot=right-icon]~input,[size=l][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=l][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=l][invalid=\"1\"].gov-form-multi-select *[slot=right-icon]~select,[size=l][invalid=\"1\"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-l-icon-padding, 2.5rem))}[size=l][success=\"\"].gov-form-multi-select *[slot=right-icon]~select,[size=l][success=\"\"].gov-form-multi-select *[slot=right-icon]~input,[size=l][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=l][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=l][success=\"1\"].gov-form-multi-select *[slot=right-icon]~select,[size=l][success=\"1\"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-l-icon-padding, 2.5rem))}[size=xl][invalid=\"\"].gov-form-multi-select *[slot=right-icon]~select,[size=xl][invalid=\"\"].gov-form-multi-select *[slot=right-icon]~input,[size=xl][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=xl][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=xl][invalid=\"1\"].gov-form-multi-select *[slot=right-icon]~select,[size=xl][invalid=\"1\"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-xl-icon-padding, 3rem))}[size=xl][success=\"\"].gov-form-multi-select *[slot=right-icon]~select,[size=xl][success=\"\"].gov-form-multi-select *[slot=right-icon]~input,[size=xl][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=xl][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=xl][success=\"1\"].gov-form-multi-select *[slot=right-icon]~select,[size=xl][success=\"1\"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-xl-icon-padding, 3rem))}.gov-form-multi-select{flex-wrap:wrap}.gov-form-multi-select__wrap{display:flex;gap:0.5rem;width:100%}.gov-form-multi-select__list{font-weight:var(--gov-text-xs-font-weight);font-size:var(--gov-text-xs-font-size);line-height:var(--gov-text-xs-line-height);letter-spacing:var(--gov-text-xs-letter-spacing);display:flex;gap:0.5rem;flex-wrap:wrap}.gov-form-multi-select__list>.gov-form-multi-select__item{position:relative;display:flex;flex:0 0 auto;align-items:center;padding:0rem 0rem 0rem 0.5rem;background:var(--gov-form-multiselect-bg, var(--gov-color-primary-200));transition:150ms linear background-color}";
|
|
@@ -8521,6 +8563,8 @@ class GovFormMultiSelect {
|
|
|
8521
8563
|
this.govChange = createEvent(this, "gov-change", 7);
|
|
8522
8564
|
this.govSelect = createEvent(this, "gov-select", 7);
|
|
8523
8565
|
this.govRemove = createEvent(this, "gov-remove", 7);
|
|
8566
|
+
this.value = undefined;
|
|
8567
|
+
this.options = undefined;
|
|
8524
8568
|
this.identifier = undefined;
|
|
8525
8569
|
this.placeholder = undefined;
|
|
8526
8570
|
this.variant = undefined;
|
|
@@ -8537,9 +8581,9 @@ class GovFormMultiSelect {
|
|
|
8537
8581
|
this.wcagLabelledBy = undefined;
|
|
8538
8582
|
this.wcagOwns = undefined;
|
|
8539
8583
|
this.focused = undefined;
|
|
8540
|
-
this.
|
|
8541
|
-
this.
|
|
8542
|
-
this.
|
|
8584
|
+
this.valueState = undefined;
|
|
8585
|
+
this.selectedOptionsState = [];
|
|
8586
|
+
this.optionsState = [];
|
|
8543
8587
|
this.selectId = createID('GovSelect');
|
|
8544
8588
|
this.listId = createID('GovMultiList');
|
|
8545
8589
|
this.h = govHost(this.host);
|
|
@@ -8551,6 +8595,12 @@ class GovFormMultiSelect {
|
|
|
8551
8595
|
validateSize(newValue) {
|
|
8552
8596
|
validateProp(FormMultiselectSizes, newValue, FormMultiSelectClass.root);
|
|
8553
8597
|
}
|
|
8598
|
+
watchOptions(newValue) {
|
|
8599
|
+
this.optionsState = propsValueToArray(newValue);
|
|
8600
|
+
}
|
|
8601
|
+
watchValue(newValue) {
|
|
8602
|
+
this.selectedOptionsState = propsValueToArray(newValue);
|
|
8603
|
+
}
|
|
8554
8604
|
watchDisabled() {
|
|
8555
8605
|
this.passControlAttrs();
|
|
8556
8606
|
}
|
|
@@ -8563,65 +8613,74 @@ class GovFormMultiSelect {
|
|
|
8563
8613
|
this.validateVariant(this.variant);
|
|
8564
8614
|
this.validateSize(this.size);
|
|
8565
8615
|
this.watchDisabled();
|
|
8616
|
+
this.passControlAttrs();
|
|
8617
|
+
this.f.passAttrToLabel('required', String(this.required));
|
|
8618
|
+
this.optionsState = propsValueToArray(this.options);
|
|
8619
|
+
this.selectedOptionsState = propsValueToArray(this.value);
|
|
8566
8620
|
}
|
|
8567
8621
|
getAvailableOptions(ignoreFilter = false) {
|
|
8568
|
-
if (Array.isArray(this.
|
|
8622
|
+
if (Array.isArray(this.optionsState) && this.optionsState.length) {
|
|
8569
8623
|
if (ignoreFilter) {
|
|
8570
|
-
return this.
|
|
8624
|
+
return this.optionsState;
|
|
8571
8625
|
}
|
|
8572
|
-
return this.
|
|
8573
|
-
const
|
|
8574
|
-
return (
|
|
8575
|
-
});
|
|
8626
|
+
return this.optionsState.filter((option) => {
|
|
8627
|
+
const selectedIndex = this.selectedValueIndex(option.value);
|
|
8628
|
+
return (selectedIndex !== -1 || (option === null || option === void 0 ? void 0 : option.disabled)) ? false : true;
|
|
8629
|
+
}).map((option) => { var _a; return ({ name: (_a = option.name) !== null && _a !== void 0 ? _a : option.value, value: option.value }); });
|
|
8576
8630
|
}
|
|
8577
8631
|
return Array.from(this.selectRef.querySelectorAll('option'))
|
|
8578
8632
|
.filter((option) => {
|
|
8579
8633
|
if (ignoreFilter) {
|
|
8580
8634
|
return true;
|
|
8581
8635
|
}
|
|
8582
|
-
|
|
8636
|
+
const selectedIndex = this.selectedValueIndex(option.value);
|
|
8637
|
+
return !(option.disabled || option.selected || selectedIndex > -1);
|
|
8583
8638
|
})
|
|
8584
8639
|
.map((option) => ({ name: option.textContent, value: option.value }));
|
|
8585
8640
|
}
|
|
8586
8641
|
initAutocomplete() {
|
|
8587
|
-
|
|
8588
|
-
this.autocompleteRef.addEventListener('gov-
|
|
8589
|
-
this.autocompleteRef.addEventListener('gov-
|
|
8590
|
-
this.autocompleteRef.addEventListener('gov-
|
|
8591
|
-
this.autocompleteRef
|
|
8592
|
-
|
|
8642
|
+
var _a, _b, _c, _d, _e;
|
|
8643
|
+
(_a = this.autocompleteRef) === null || _a === void 0 ? void 0 : _a.addEventListener('gov-select', this.onSelectHandler.bind(this));
|
|
8644
|
+
(_b = this.autocompleteRef) === null || _b === void 0 ? void 0 : _b.addEventListener('gov-input', this.onInputHandler.bind(this));
|
|
8645
|
+
(_c = this.autocompleteRef) === null || _c === void 0 ? void 0 : _c.addEventListener('gov-focus', this.onFocusHandler.bind(this));
|
|
8646
|
+
(_d = this.autocompleteRef) === null || _d === void 0 ? void 0 : _d.addEventListener('gov-blur', this.onBlurHandler.bind(this));
|
|
8647
|
+
(_e = this.autocompleteRef) === null || _e === void 0 ? void 0 : _e.setSearchCallback(searchString => {
|
|
8593
8648
|
return new Promise(resolve => {
|
|
8594
8649
|
const data = this.getAvailableOptions();
|
|
8595
|
-
if (String(
|
|
8650
|
+
if (String(searchString).length === 0) {
|
|
8596
8651
|
return resolve(data);
|
|
8597
8652
|
}
|
|
8598
|
-
resolve(data.filter(({ name }) => {
|
|
8653
|
+
resolve(data.filter(({ name, value }) => {
|
|
8599
8654
|
if (!name)
|
|
8600
|
-
|
|
8601
|
-
return removeDiacritics(name).toLowerCase().indexOf(removeDiacritics(
|
|
8655
|
+
name = value;
|
|
8656
|
+
return removeDiacritics(name).toLowerCase().indexOf(removeDiacritics(searchString).toLowerCase()) > -1;
|
|
8602
8657
|
}));
|
|
8603
8658
|
});
|
|
8604
|
-
})
|
|
8605
|
-
.then();
|
|
8659
|
+
}).finally();
|
|
8606
8660
|
}
|
|
8607
|
-
|
|
8608
|
-
return this.
|
|
8661
|
+
selectedValueIndex(value) {
|
|
8662
|
+
return this.selectedOptionsState.findIndex((selected) => selected === value);
|
|
8609
8663
|
}
|
|
8610
8664
|
getOptionElement(value) {
|
|
8611
|
-
return this.selectRef.querySelector('option[value="' + value
|
|
8665
|
+
return this.selectRef.querySelector('option[value="' + value + '"]');
|
|
8666
|
+
}
|
|
8667
|
+
getOption(value) {
|
|
8668
|
+
var _a;
|
|
8669
|
+
return (_a = this.getAvailableOptions(true).find((option) => option.value === value)) !== null && _a !== void 0 ? _a : null;
|
|
8612
8670
|
}
|
|
8613
8671
|
selectOption(newOption, notify = true) {
|
|
8614
|
-
const index = this.
|
|
8672
|
+
const index = this.selectedValueIndex(newOption);
|
|
8615
8673
|
if (index === -1) {
|
|
8616
|
-
this.
|
|
8674
|
+
this.selectedOptionsState = [...this.selectedOptionsState, newOption];
|
|
8675
|
+
this.value = this.selectedOptionsState;
|
|
8617
8676
|
if (notify) {
|
|
8618
8677
|
this.govChange.emit({
|
|
8619
8678
|
component: FormMultiSelectClass.root,
|
|
8620
|
-
value: this.
|
|
8679
|
+
value: this.selectedOptionsState,
|
|
8621
8680
|
});
|
|
8622
8681
|
this.govSelect.emit({
|
|
8623
8682
|
component: FormMultiSelectClass.root,
|
|
8624
|
-
value: this.
|
|
8683
|
+
value: this.selectedOptionsState,
|
|
8625
8684
|
});
|
|
8626
8685
|
}
|
|
8627
8686
|
const option = this.getOptionElement(newOption);
|
|
@@ -8631,18 +8690,19 @@ class GovFormMultiSelect {
|
|
|
8631
8690
|
}
|
|
8632
8691
|
}
|
|
8633
8692
|
removeOption(removeOption, notify = true) {
|
|
8634
|
-
const index = this.
|
|
8693
|
+
const index = this.selectedValueIndex(removeOption);
|
|
8635
8694
|
if (index !== -1) {
|
|
8636
|
-
this.
|
|
8637
|
-
this.
|
|
8695
|
+
this.selectedOptionsState.splice(index, 1);
|
|
8696
|
+
this.selectedOptionsState = [...this.selectedOptionsState];
|
|
8697
|
+
this.value = this.selectedOptionsState;
|
|
8638
8698
|
if (notify) {
|
|
8639
8699
|
this.govChange.emit({
|
|
8640
8700
|
component: FormMultiSelectClass.root,
|
|
8641
|
-
value: this.
|
|
8701
|
+
value: this.selectedOptionsState,
|
|
8642
8702
|
});
|
|
8643
8703
|
this.govRemove.emit({
|
|
8644
8704
|
component: FormMultiSelectClass.root,
|
|
8645
|
-
value: this.
|
|
8705
|
+
value: this.selectedOptionsState,
|
|
8646
8706
|
});
|
|
8647
8707
|
}
|
|
8648
8708
|
const option = this.getOptionElement(removeOption);
|
|
@@ -8653,13 +8713,14 @@ class GovFormMultiSelect {
|
|
|
8653
8713
|
}
|
|
8654
8714
|
async componentDidLoad() {
|
|
8655
8715
|
this.initAutocomplete();
|
|
8656
|
-
|
|
8657
|
-
|
|
8658
|
-
|
|
8659
|
-
|
|
8660
|
-
|
|
8661
|
-
|
|
8662
|
-
|
|
8716
|
+
}
|
|
8717
|
+
async componentDidRender() {
|
|
8718
|
+
tick(() => {
|
|
8719
|
+
this.selectRef.querySelectorAll('option').forEach((option) => {
|
|
8720
|
+
if (option.selected) {
|
|
8721
|
+
this.selectOption(option.value, false);
|
|
8722
|
+
}
|
|
8723
|
+
});
|
|
8663
8724
|
});
|
|
8664
8725
|
if (canValidateWcagOnRender()) {
|
|
8665
8726
|
await delay(500);
|
|
@@ -8667,10 +8728,16 @@ class GovFormMultiSelect {
|
|
|
8667
8728
|
}
|
|
8668
8729
|
}
|
|
8669
8730
|
render() {
|
|
8670
|
-
return (hAsync(Host, { class: FormMultiSelectClass.root, size: this.size, variant: this.variant }, hAsync("div", { class: FormMultiSelectClass.wrap }, hAsync("div", { class: "element" }, hAsync("gov-form-autocomplete", { value: this.
|
|
8671
|
-
|
|
8672
|
-
|
|
8673
|
-
return (hAsync("
|
|
8731
|
+
return (hAsync(Host, { class: FormMultiSelectClass.root, size: this.size, variant: this.variant }, hAsync("div", { class: FormMultiSelectClass.wrap }, hAsync("div", { class: "element" }, hAsync("gov-form-autocomplete", { value: this.valueState, disabled: this.disabled, identifier: this.identifier || this.selectId, required: false, size: this.size, variant: this.variant, placeholder: this.placeholder, "message-empty": this.messageEmpty, "message-loading": this.messageLoading, ref: el => (this.autocompleteRef = el), minlength: 0, wcagDescribedBy: this.wcagDescribedBy, wcagLabelledBy: this.wcagLabelledBy, wcagOwns: this.listId }), hAsync("gov-icon", { slot: "right-icon", class: "icon-arrow", name: "chevron-down" }), this.h.hasSlot('right-icon') && !(this.success || this.invalid) && hAsync("slot", { name: "right-icon" }), this.success && hAsync("gov-icon", { slot: "right-icon", class: "icon-validation", name: "check-lg" }), this.invalid && hAsync("gov-icon", { slot: "right-icon", class: "icon-validation", name: "exclamation-lg" }), hAsync("select", { hidden: true, class: 'hidden-select-list', "aria-hidden": toBoolAttr(true), multiple: true, required: this.required, name: this.name, disabled: this.disabled, ref: el => (this.selectRef = el), "aria-disabled": toBoolAttrIfDefined(this.disabled), "aria-required": toBoolAttrIfDefined(this.required), "aria-invalid": toBoolAttrIfDefined(this.invalid), "aria-describedby": this.wcagDescribedBy, "aria-labelledby": this.wcagLabelledBy, "aria-owns": this.wcagOwns }, hAsync("slot", null), Array.isArray(this.optionsState) && this.optionsState.map((option) => {
|
|
8732
|
+
var _a;
|
|
8733
|
+
const selectedOption = this.selectedValueIndex(option.value);
|
|
8734
|
+
return (hAsync("option", { value: option.value, selected: selectedOption > -1, disabled: option === null || option === void 0 ? void 0 : option.disabled }, (_a = option.name) !== null && _a !== void 0 ? _a : option.value));
|
|
8735
|
+
})))), this.hideSelectedList === false ? (hAsync("ul", { role: "listbox", id: this.listId, class: FormMultiSelectClass.list }, Array.isArray(this.selectedOptionsState) && this.selectedOptionsState.map(selected => {
|
|
8736
|
+
var _a, _b;
|
|
8737
|
+
const option = this.getOption(selected);
|
|
8738
|
+
if (!option)
|
|
8739
|
+
return null;
|
|
8740
|
+
return (hAsync("li", { class: FormMultiSelectClass.item, role: "option" }, (_a = option.name) !== null && _a !== void 0 ? _a : option.value, hAsync("gov-button", { wcagLabel: (_b = 'Odebrat vybranou položku ' + option.name) !== null && _b !== void 0 ? _b : option.value, variant: "primary", type: "base", size: "s", "on-gov-click": () => this.onTagRemove(selected) }, hAsync("gov-icon", { name: "x-lg" }))));
|
|
8674
8741
|
}))) : null));
|
|
8675
8742
|
}
|
|
8676
8743
|
onFocusHandler(e) {
|
|
@@ -8679,7 +8746,7 @@ class GovFormMultiSelect {
|
|
|
8679
8746
|
this.govFocus.emit({
|
|
8680
8747
|
component: FormMultiSelectClass.root,
|
|
8681
8748
|
originalEvent: e,
|
|
8682
|
-
value: this.
|
|
8749
|
+
value: this.selectedOptionsState,
|
|
8683
8750
|
});
|
|
8684
8751
|
}
|
|
8685
8752
|
onBlurHandler(e) {
|
|
@@ -8689,19 +8756,19 @@ class GovFormMultiSelect {
|
|
|
8689
8756
|
this.govBlur.emit({
|
|
8690
8757
|
component: FormMultiSelectClass.root,
|
|
8691
8758
|
originalEvent: e,
|
|
8692
|
-
value: this.
|
|
8759
|
+
value: this.selectedOptionsState,
|
|
8693
8760
|
});
|
|
8694
8761
|
}
|
|
8695
8762
|
onInputHandler(e) {
|
|
8696
|
-
this.
|
|
8763
|
+
this.valueState = e.detail.value;
|
|
8697
8764
|
e.stopPropagation();
|
|
8698
8765
|
}
|
|
8699
8766
|
onSelectHandler(e) {
|
|
8700
8767
|
e.stopPropagation();
|
|
8701
8768
|
const value = e.detail.selected;
|
|
8702
|
-
this.selectOption(value);
|
|
8703
|
-
this.
|
|
8704
|
-
this.autocompleteRef.clearValue();
|
|
8769
|
+
this.selectOption(value.value);
|
|
8770
|
+
this.valueState = '';
|
|
8771
|
+
this.autocompleteRef.clearValue().finally();
|
|
8705
8772
|
this.autocompleteRef.focus();
|
|
8706
8773
|
}
|
|
8707
8774
|
onTagRemove(removeOption) {
|
|
@@ -8717,7 +8784,7 @@ class GovFormMultiSelect {
|
|
|
8717
8784
|
* Sets the ordered value of the element
|
|
8718
8785
|
*/
|
|
8719
8786
|
async setValue(value) {
|
|
8720
|
-
this.
|
|
8787
|
+
this.valueState = value;
|
|
8721
8788
|
}
|
|
8722
8789
|
/**
|
|
8723
8790
|
* Returns an instance of the native html select element
|
|
@@ -8725,50 +8792,6 @@ class GovFormMultiSelect {
|
|
|
8725
8792
|
async getRef() {
|
|
8726
8793
|
return this.selectRef;
|
|
8727
8794
|
}
|
|
8728
|
-
/**
|
|
8729
|
-
* Returns a list of selected items
|
|
8730
|
-
*/
|
|
8731
|
-
async getSelectedOptions() {
|
|
8732
|
-
return this.selectedOptions;
|
|
8733
|
-
}
|
|
8734
|
-
/**
|
|
8735
|
-
* Setting a list of options to choose from
|
|
8736
|
-
*/
|
|
8737
|
-
async setOptions(options) {
|
|
8738
|
-
if (Array.isArray(options)) {
|
|
8739
|
-
this.options = [...options];
|
|
8740
|
-
}
|
|
8741
|
-
}
|
|
8742
|
-
/**
|
|
8743
|
-
* Returns all available options
|
|
8744
|
-
*/
|
|
8745
|
-
async getOptions(ignoreFilter = true) {
|
|
8746
|
-
return this.getAvailableOptions(ignoreFilter);
|
|
8747
|
-
}
|
|
8748
|
-
/**
|
|
8749
|
-
* Setting the list of selected options
|
|
8750
|
-
*/
|
|
8751
|
-
async setSelectedOptions(options) {
|
|
8752
|
-
if (Array.isArray(options)) {
|
|
8753
|
-
this.selectedOptions = [...options];
|
|
8754
|
-
}
|
|
8755
|
-
}
|
|
8756
|
-
/**
|
|
8757
|
-
* To remove an option from the selected list
|
|
8758
|
-
*/
|
|
8759
|
-
async removeSelectedOption(option, notify = false) {
|
|
8760
|
-
if (typeof option === 'object' && hasOwnProperty(option, 'name') && hasOwnProperty(option, 'value')) {
|
|
8761
|
-
this.removeOption(option, notify);
|
|
8762
|
-
}
|
|
8763
|
-
}
|
|
8764
|
-
/**
|
|
8765
|
-
* Returns an instance of the native html select element
|
|
8766
|
-
*/
|
|
8767
|
-
async setSelectedOption(option, notify = false) {
|
|
8768
|
-
if (typeof option === 'object' && hasOwnProperty(option, 'name') && hasOwnProperty(option, 'value')) {
|
|
8769
|
-
this.selectOption(option, notify);
|
|
8770
|
-
}
|
|
8771
|
-
}
|
|
8772
8795
|
/**
|
|
8773
8796
|
* Validate the WCAG attributes of the component
|
|
8774
8797
|
*/
|
|
@@ -8782,6 +8805,8 @@ class GovFormMultiSelect {
|
|
|
8782
8805
|
static get watchers() { return {
|
|
8783
8806
|
"variant": ["validateVariant"],
|
|
8784
8807
|
"size": ["validateSize", "watchDisabled"],
|
|
8808
|
+
"options": ["watchOptions"],
|
|
8809
|
+
"value": ["watchValue"],
|
|
8785
8810
|
"disabled": ["watchDisabled"],
|
|
8786
8811
|
"invalid": ["watchDisabled"],
|
|
8787
8812
|
"success": ["watchDisabled"]
|
|
@@ -8791,6 +8816,8 @@ class GovFormMultiSelect {
|
|
|
8791
8816
|
"$flags$": 4,
|
|
8792
8817
|
"$tagName$": "gov-form-multi-select",
|
|
8793
8818
|
"$members$": {
|
|
8819
|
+
"value": [1537],
|
|
8820
|
+
"options": [1537],
|
|
8794
8821
|
"identifier": [1],
|
|
8795
8822
|
"placeholder": [1],
|
|
8796
8823
|
"variant": [1],
|
|
@@ -8807,23 +8834,17 @@ class GovFormMultiSelect {
|
|
|
8807
8834
|
"wcagLabelledBy": [1, "wcag-labelled-by"],
|
|
8808
8835
|
"wcagOwns": [1, "wcag-owns"],
|
|
8809
8836
|
"focused": [32],
|
|
8810
|
-
"
|
|
8811
|
-
"
|
|
8812
|
-
"
|
|
8837
|
+
"valueState": [32],
|
|
8838
|
+
"selectedOptionsState": [32],
|
|
8839
|
+
"optionsState": [32],
|
|
8813
8840
|
"setFocus": [64],
|
|
8814
8841
|
"setValue": [64],
|
|
8815
8842
|
"getRef": [64],
|
|
8816
|
-
"getSelectedOptions": [64],
|
|
8817
|
-
"setOptions": [64],
|
|
8818
|
-
"getOptions": [64],
|
|
8819
|
-
"setSelectedOptions": [64],
|
|
8820
|
-
"removeSelectedOption": [64],
|
|
8821
|
-
"setSelectedOption": [64],
|
|
8822
8843
|
"validateWcag": [64]
|
|
8823
8844
|
},
|
|
8824
8845
|
"$listeners$": undefined,
|
|
8825
8846
|
"$lazyBundleId$": "-",
|
|
8826
|
-
"$attrsToReflect$": []
|
|
8847
|
+
"$attrsToReflect$": [["value", "value"], ["options", "options"]]
|
|
8827
8848
|
}; }
|
|
8828
8849
|
}
|
|
8829
8850
|
|
|
@@ -9026,6 +9047,7 @@ class GovFormSelect {
|
|
|
9026
9047
|
this.govBlur = createEvent(this, "gov-blur", 7);
|
|
9027
9048
|
this.govChange = createEvent(this, "gov-change", 7);
|
|
9028
9049
|
this.value = undefined;
|
|
9050
|
+
this.options = undefined;
|
|
9029
9051
|
this.identifier = undefined;
|
|
9030
9052
|
this.variant = 'secondary';
|
|
9031
9053
|
this.size = 'm';
|
|
@@ -9040,7 +9062,7 @@ class GovFormSelect {
|
|
|
9040
9062
|
this.wcagLabelledBy = undefined;
|
|
9041
9063
|
this.wcagOwns = undefined;
|
|
9042
9064
|
this.focused = undefined;
|
|
9043
|
-
this.
|
|
9065
|
+
this.optionsState = [];
|
|
9044
9066
|
this.h = govHost(this.host);
|
|
9045
9067
|
this.f = govForm(this.h);
|
|
9046
9068
|
this.selectId = createID('GovSelect');
|
|
@@ -9051,6 +9073,9 @@ class GovFormSelect {
|
|
|
9051
9073
|
validateSize(newValue) {
|
|
9052
9074
|
validateProp(FormSelectSizes, newValue, FormSelectClass.root);
|
|
9053
9075
|
}
|
|
9076
|
+
watchOptions(newValue) {
|
|
9077
|
+
this.optionsState = propsValueToArray(newValue);
|
|
9078
|
+
}
|
|
9054
9079
|
watchDisabled() {
|
|
9055
9080
|
this.passControlAttrs();
|
|
9056
9081
|
}
|
|
@@ -9068,12 +9093,14 @@ class GovFormSelect {
|
|
|
9068
9093
|
this.markSelectedValue();
|
|
9069
9094
|
this.passControlAttrs();
|
|
9070
9095
|
this.f.passAttrToLabel('required', String(this.required));
|
|
9096
|
+
this.optionsState = propsValueToArray(this.options);
|
|
9071
9097
|
}
|
|
9072
9098
|
async componentDidRender() {
|
|
9073
9099
|
if (canValidateWcagOnRender()) {
|
|
9074
9100
|
await delay(500);
|
|
9075
9101
|
await this.validateWcag();
|
|
9076
9102
|
}
|
|
9103
|
+
tick(() => this.markSelectedValue());
|
|
9077
9104
|
}
|
|
9078
9105
|
markSelectedValue() {
|
|
9079
9106
|
this.host.querySelectorAll('option').forEach((option) => {
|
|
@@ -9086,8 +9113,9 @@ class GovFormSelect {
|
|
|
9086
9113
|
});
|
|
9087
9114
|
}
|
|
9088
9115
|
render() {
|
|
9089
|
-
return (hAsync(Host, { class: FormSelectClass.root, size: this.size, variant: this.variant }, this.h.hasSlot('prefix') && hAsync("slot", { name: "prefix" }), hAsync("span", { class: "element" }, hAsync("gov-icon", { slot: "right-icon", name: "chevron-down", class: "icon-arrow" }), this.h.hasSlot('right-icon') && !(this.success || this.invalid) && hAsync("slot", { name: "right-icon" }), this.success && hAsync("gov-icon", { slot: "right-icon", class: "icon-validation", name: "check-lg" }), this.invalid && hAsync("gov-icon", { slot: "right-icon", class: "icon-validation", name: "exclamation-lg" }), hAsync("select", { id: this.identifier || this.selectId, onFocus: this.onFocusHandler.bind(this), onChange: this.onChangeHandler.bind(this), onBlur: this.onBlurHandler.bind(this), required: this.required, name: this.name, disabled: this.disabled, ref: el => (this.selectRef = el), "aria-disabled": toBoolAttrIfDefined(this.disabled), "aria-activedescendant": this.wcagActiveDescendant, "aria-controls": this.wcagControls, "aria-required": toBoolAttrIfDefined(this.required), "aria-invalid": toBoolAttrIfDefined(this.invalid), "aria-describedby": this.wcagDescribedBy, "aria-labelledby": this.wcagLabelledBy, "aria-owns": this.wcagOwns }, hAsync("slot", null), this.
|
|
9090
|
-
|
|
9116
|
+
return (hAsync(Host, { class: FormSelectClass.root, size: this.size, variant: this.variant }, this.h.hasSlot('prefix') && hAsync("slot", { name: "prefix" }), hAsync("span", { class: "element" }, hAsync("gov-icon", { slot: "right-icon", name: "chevron-down", class: "icon-arrow" }), this.h.hasSlot('right-icon') && !(this.success || this.invalid) && hAsync("slot", { name: "right-icon" }), this.success && hAsync("gov-icon", { slot: "right-icon", class: "icon-validation", name: "check-lg" }), this.invalid && hAsync("gov-icon", { slot: "right-icon", class: "icon-validation", name: "exclamation-lg" }), hAsync("select", { id: this.identifier || this.selectId, onFocus: this.onFocusHandler.bind(this), onChange: this.onChangeHandler.bind(this), onBlur: this.onBlurHandler.bind(this), required: this.required, name: this.name, disabled: this.disabled, ref: el => (this.selectRef = el), "aria-disabled": toBoolAttrIfDefined(this.disabled), "aria-activedescendant": this.wcagActiveDescendant, "aria-controls": this.wcagControls, "aria-required": toBoolAttrIfDefined(this.required), "aria-invalid": toBoolAttrIfDefined(this.invalid), "aria-describedby": this.wcagDescribedBy, "aria-labelledby": this.wcagLabelledBy, "aria-owns": this.wcagOwns }, hAsync("slot", null), Array.isArray(this.optionsState) && this.optionsState.map((option) => {
|
|
9117
|
+
var _a;
|
|
9118
|
+
return (hAsync("option", { value: option.value, selected: option.value === this.value, disabled: option === null || option === void 0 ? void 0 : option.disabled }, (_a = option.label) !== null && _a !== void 0 ? _a : option.value));
|
|
9091
9119
|
}))), this.h.hasSlot('sufix') && hAsync("slot", { name: "sufix" })));
|
|
9092
9120
|
}
|
|
9093
9121
|
onFocusHandler(e) {
|
|
@@ -9121,26 +9149,12 @@ class GovFormSelect {
|
|
|
9121
9149
|
async setFocus(options) {
|
|
9122
9150
|
return this.selectRef.focus(options);
|
|
9123
9151
|
}
|
|
9124
|
-
/**
|
|
9125
|
-
* Sets the ordered value of the element
|
|
9126
|
-
*/
|
|
9127
|
-
async setValue(value) {
|
|
9128
|
-
this.value = value;
|
|
9129
|
-
}
|
|
9130
9152
|
/**
|
|
9131
9153
|
* Returns an instance of the native html select element
|
|
9132
9154
|
*/
|
|
9133
9155
|
async getRef() {
|
|
9134
9156
|
return this.selectRef;
|
|
9135
9157
|
}
|
|
9136
|
-
/**
|
|
9137
|
-
* Sets the selection options
|
|
9138
|
-
*/
|
|
9139
|
-
async setOptions(options) {
|
|
9140
|
-
if (Array.isArray(options)) {
|
|
9141
|
-
this.options = options;
|
|
9142
|
-
}
|
|
9143
|
-
}
|
|
9144
9158
|
/**
|
|
9145
9159
|
* Validate the WCAG attributes of the component
|
|
9146
9160
|
*/
|
|
@@ -9155,6 +9169,7 @@ class GovFormSelect {
|
|
|
9155
9169
|
static get watchers() { return {
|
|
9156
9170
|
"variant": ["validateVariant"],
|
|
9157
9171
|
"size": ["validateSize", "watchDisabled"],
|
|
9172
|
+
"options": ["watchOptions"],
|
|
9158
9173
|
"disabled": ["watchDisabled"],
|
|
9159
9174
|
"invalid": ["watchDisabled"],
|
|
9160
9175
|
"value": ["watchValue"]
|
|
@@ -9165,6 +9180,7 @@ class GovFormSelect {
|
|
|
9165
9180
|
"$tagName$": "gov-form-select",
|
|
9166
9181
|
"$members$": {
|
|
9167
9182
|
"value": [1537],
|
|
9183
|
+
"options": [1537],
|
|
9168
9184
|
"identifier": [1],
|
|
9169
9185
|
"variant": [1],
|
|
9170
9186
|
"size": [1],
|
|
@@ -9179,16 +9195,14 @@ class GovFormSelect {
|
|
|
9179
9195
|
"wcagLabelledBy": [1, "wcag-labelled-by"],
|
|
9180
9196
|
"wcagOwns": [1, "wcag-owns"],
|
|
9181
9197
|
"focused": [32],
|
|
9182
|
-
"
|
|
9198
|
+
"optionsState": [32],
|
|
9183
9199
|
"setFocus": [64],
|
|
9184
|
-
"setValue": [64],
|
|
9185
9200
|
"getRef": [64],
|
|
9186
|
-
"setOptions": [64],
|
|
9187
9201
|
"validateWcag": [64]
|
|
9188
9202
|
},
|
|
9189
9203
|
"$listeners$": undefined,
|
|
9190
9204
|
"$lazyBundleId$": "-",
|
|
9191
|
-
"$attrsToReflect$": [["value", "value"]]
|
|
9205
|
+
"$attrsToReflect$": [["value", "value"], ["options", "options"]]
|
|
9192
9206
|
}; }
|
|
9193
9207
|
}
|
|
9194
9208
|
|
|
@@ -9995,13 +10009,6 @@ function paginate(totalItems, currentPage = 1, pageSize = 10, maxPages = 10) {
|
|
|
9995
10009
|
};
|
|
9996
10010
|
}
|
|
9997
10011
|
|
|
9998
|
-
const createArrayRange = (from, to) => {
|
|
9999
|
-
if (Number.isInteger(from) && Number.isInteger(to)) {
|
|
10000
|
-
return [...Array(to + 1).keys()].slice(from);
|
|
10001
|
-
}
|
|
10002
|
-
return [];
|
|
10003
|
-
};
|
|
10004
|
-
|
|
10005
10012
|
const govPaginationCss = ".gov-pagination__list{margin:0;padding:0}.gov-pagination__list .gov-pagination__item{margin:0;padding:0;background:none}.gov-pagination__list .gov-pagination__item::before{display:none}.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-pagination{position:relative;display:block;width:100%}.gov-pagination__list{display:flex;align-items:center;flex-wrap:wrap;font-weight:bold;text-align:center}.gov-pagination__list .gov-pagination__item{display:flex;justify-content:center;align-items:center;margin:0;padding:0.125rem;border-radius:var(--gov-border-radius, 0.1875rem);overflow:hidden}.gov-pagination__list .gov-pagination__item--arrow{display:flex}.gov-pagination__list .gov-pagination__item--select{z-index:1;display:flex;overflow:visible;padding:0rem 1rem}.gov-pagination__arrow{margin:0}.gov-pagination__item--more .gov-form-select select{border:none !important;padding-right:0.75rem !important}.gov-pagination__item--more .gov-form-select .gov-icon{display:none}.gov-pagination__inner{display:flex;justify-content:center;align-items:center;align-self:stretch;width:100%;text-decoration:none}.gov-pagination__inner[wcag-current=true][type=solid][variant=primary] .element{background-color:var(--gov-button-primary-solid-hover-bg, var(--gov-color-primary-700));color:var(--gov-button-primary-solid-hover-color, var(--gov-color-neutral-white))}.gov-pagination__inner[wcag-current=true][type=outlined][variant=primary] .element{background-color:var(--gov-button-primary-outlined-hover-bg, var(--gov-color-primary-100));color:var(--gov-button-primary-outlined-hover-color, var(--gov-color-primary))}.gov-pagination__inner[wcag-current=true][type=base][variant=primary] .element{background-color:var(--gov-button-primary-base-hover-bg, var(--gov-color-primary-100));color:var(--gov-button-primary-base-hover-color, var(--gov-color-primary))}.gov-pagination__inner[wcag-current=true][type=link][variant=primary] .element{background-color:var(--gov-button-primary-link-hover-bg, transparent);color:var(--gov-button-primary-link-hover-color, var(--gov-color-primary))}.gov-pagination__inner[wcag-current=true][type=solid][variant=secondary] .element{background-color:var(--gov-button-secondary-solid-hover-bg, var(--gov-color-secondary-900));color:var(--gov-button-secondary-solid-hover-color, var(--gov-color-neutral-white))}.gov-pagination__inner[wcag-current=true][type=outlined][variant=secondary] .element{background-color:var(--gov-button-secondary-outlined-hover-bg, var(--gov-color-secondary-300));color:var(--gov-button-secondary-outlined-hover-color, var(--gov-color-secondary))}.gov-pagination__inner[wcag-current=true][type=base][variant=secondary] .element{background-color:var(--gov-button-secondary-base-hover-bg, var(--gov-color-secondary-300));color:var(--gov-button-secondary-base-hover-color, var(--gov-color-secondary))}.gov-pagination__inner[wcag-current=true][type=link][variant=secondary] .element{background-color:var(--gov-button-secondary-link-hover-bg, transparent);color:var(--gov-button-secondary-link-hover-color, var(--gov-color-secondary))}.gov-pagination__inner[wcag-current=true][type=solid][variant=error] .element{background-color:var(--gov-button-error-solid-hover-bg, var(--gov-color-error-500));color:var(--gov-button-error-solid-hover-color, var(--gov-color-neutral-white))}.gov-pagination__inner[wcag-current=true][type=outlined][variant=error] .element{background-color:var(--gov-button-error-outlined-hover-bg, var(--gov-color-error-100));color:var(--gov-button-error-outlined-hover-color, var(--gov-color-error))}.gov-pagination__inner[wcag-current=true][type=base][variant=error] .element{background-color:var(--gov-button-error-base-hover-bg, var(--gov-color-error-100));color:var(--gov-button-error-base-hover-color, var(--gov-color-error))}.gov-pagination__inner[wcag-current=true][type=link][variant=error] .element{background-color:var(--gov-button-error-link-hover-bg, transparent);color:var(--gov-button-error-link-hover-color, var(--gov-color-error))}.gov-pagination__inner[wcag-current=true][type=solid][variant=success] .element{background-color:var(--gov-button-success-solid-hover-bg, var(--gov-color-success-600));color:var(--gov-button-success-solid-hover-color, var(--gov-color-neutral-white))}.gov-pagination__inner[wcag-current=true][type=outlined][variant=success] .element{background-color:var(--gov-button-success-outlined-hover-bg, var(--gov-color-success-100));color:var(--gov-button-success-outlined-hover-color, var(--gov-color-success-500))}.gov-pagination__inner[wcag-current=true][type=base][variant=success] .element{background-color:var(--gov-button-success-base-hover-bg, var(--gov-color-success-100));color:var(--gov-button-success-base-hover-color, var(--gov-color-success-500))}.gov-pagination__inner[wcag-current=true][type=link][variant=success] .element{background-color:var(--gov-button-success-link-hover-bg, transparent);color:var(--gov-button-success-link-hover-color, var(--gov-color-success-500))}.gov-pagination__inner[wcag-current=true][type=solid][variant=warning] .element{background-color:var(--gov-button-warning-solid-hover-bg, var(--gov-color-warning-600));color:var(--gov-button-warning-solid-hover-color, var(--gov-color-neutral-white))}.gov-pagination__inner[wcag-current=true][type=outlined][variant=warning] .element{background-color:var(--gov-button-warning-outlined-hover-bg, var(--gov-color-warning-200));color:var(--gov-button-warning-outlined-hover-color, var(--gov-color-warning-500))}.gov-pagination__inner[wcag-current=true][type=base][variant=warning] .element{background-color:var(--gov-button-warning-base-hover-bg, var(--gov-color-warning-200));color:var(--gov-button-warning-base-hover-color, var(--gov-color-warning-500))}.gov-pagination__inner[wcag-current=true][type=link][variant=warning] .element{background-color:var(--gov-button-warning-link-hover-bg, transparent);color:var(--gov-button-warning-link-hover-color, var(--gov-color-warning-500))}.gov-pagination[size=s] .gov-pagination__inner{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);font-weight:inherit}.gov-pagination[size=s] .gov-pagination__inner .element{min-width:var(--gov-pagination-s-button-size, 2rem)}.gov-pagination[size=m] .gov-pagination__inner{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);font-weight:inherit}.gov-pagination[size=m] .gov-pagination__inner .element{min-width:var(--gov-pagination-m-button-size, 2.5rem)}";
|
|
10006
10013
|
|
|
10007
10014
|
class GovPagination {
|
|
@@ -10083,7 +10090,7 @@ class GovPagination {
|
|
|
10083
10090
|
const ariaCurrent = toBoolAttrIfDefined(this.pagination.currentPage === page ? true : undefined);
|
|
10084
10091
|
return (hAsync("gov-button", { href: this.prepareLinkUrl(page), variant: this.variant, size: this.size, type: "base", disabled: isDisabled, "on-gov-click": (e) => this.onClickHandler(e, page), "wcag-label": description ? description : page > -1 ? this.wcagPageLabel + " " + page : undefined, "wcag-current": ariaCurrent, class: PaginationClass.inner }, content));
|
|
10085
10092
|
};
|
|
10086
|
-
return (hAsync(Host, { class: this.h.classes(PaginationClass.root), type: this.type, variant: this.variant, size: this.size }, hAsync("nav", { "aria-label": this.wcagLabel, "aria-labelledby": this.wcagLabelledBy }, hAsync("ul", { class: PaginationClass.list }, hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.currentPage > 1 ? 1 : -1, hAsync("gov-icon", { class: PaginationClass.arrow, name: "chevron-double-left" }), this.labelStart)), hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.startPage < this.pagination.currentPage ? this.pagination.currentPage - 1 : -1, hAsync("gov-icon", { class: PaginationClass.arrow, name: "chevron-left" }), this.labelPrev)), this.type == "select" ? (hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemSelect]) }, hAsync("span", { class: PaginationClass.inner }, hAsync("span", { id: this.pageSelectId, hidden: true }, this.wcagSelectLabel), hAsync("gov-form-select", { size:
|
|
10093
|
+
return (hAsync(Host, { class: this.h.classes(PaginationClass.root), type: this.type, variant: this.variant, size: this.size }, hAsync("nav", { "aria-label": this.wcagLabel, "aria-labelledby": this.wcagLabelledBy }, hAsync("ul", { class: PaginationClass.list }, hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.currentPage > 1 ? 1 : -1, hAsync("gov-icon", { class: PaginationClass.arrow, name: "chevron-double-left" }), this.labelStart)), hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.startPage < this.pagination.currentPage ? this.pagination.currentPage - 1 : -1, hAsync("gov-icon", { class: PaginationClass.arrow, name: "chevron-left" }), this.labelPrev)), this.type == "select" ? (hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemSelect]) }, hAsync("span", { class: PaginationClass.inner }, hAsync("span", { id: this.pageSelectId, hidden: true }, this.wcagSelectLabel), hAsync("gov-form-select", { size: this.size, variant: this.variant, "wcag-labelled-by": this.pageSelectId, "on-gov-change": this.onSelectHandler.bind(this) }, createArrayRange(1, this.pagination.totalPages).map(page => (hAsync("option", { value: page, selected: this.pagination.currentPage === page }, page))))))) : (hAsync(Fragment, null, this.pagination.pages.map(page => (hAsync("li", { class: this.isActivePageClass(PaginationClass.item, page) }, pageResolver(page, page, '')))), this.pagination.totalPages ? (hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemMore]) }, hAsync("span", { class: PaginationClass.inner }, hAsync("span", { id: this.pageSelectId, hidden: true }, this.wcagSelectLabel), hAsync("gov-form-select", { size: this.size, variant: this.variant, "wcag-labelled-by": this.pageSelectId, ref: el => (this.spreadSelectRef = el), "on-gov-change": this.onSelectHandler.bind(this) }, hAsync("option", { selected: true, hidden: true }, "..."), createArrayRange(1, this.pagination.totalPages).map(page => (hAsync("option", { value: page, selected: false }, page))))))) : null)), hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.totalPages > this.pagination.currentPage ? this.pagination.currentPage + 1 : -1, hAsync("gov-icon", { class: PaginationClass.arrow, name: "chevron-right" }), this.labelNext)), hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.totalPages > this.pagination.currentPage ? this.pagination.totalPages : -1, hAsync("gov-icon", { class: PaginationClass.arrow, name: "chevron-double-right" }), this.labelEnd))))));
|
|
10087
10094
|
}
|
|
10088
10095
|
onClickHandler(e, page) {
|
|
10089
10096
|
e.stopPropagation();
|