@luzmo/lucero 2.9.0 → 2.10.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/components/action-menu/index.cjs +1 -1
- package/components/action-menu/index.js +1 -1
- package/components/{action-menu-CT0OYS56.js → action-menu-CGacKJK4.js} +1 -1
- package/components/{action-menu-BFy0mEyu.cjs → action-menu-w10ElSsd.cjs} +1 -1
- package/components/button/index.cjs +1 -1
- package/components/button/index.js +1 -1
- package/components/button-BOdc31WB.js +125 -0
- package/components/button-DEh8GO34.cjs +20 -0
- package/components/index.cjs +1 -1
- package/components/index.js +11 -11
- package/components/menu/index.cjs +1 -1
- package/components/menu/index.js +1 -1
- package/components/menu/menu.d.ts +6 -0
- package/components/{menu-tDMNLuND.cjs → menu-AtXo1cjU.cjs} +1 -1
- package/components/{menu-CM-ZA_ZM.js → menu-vCPMeQPa.js} +1 -1
- package/components/notice/index.cjs +1 -1
- package/components/notice/index.js +1 -1
- package/components/{notice-62Wpb7BH.js → notice-BSRnOSRV.js} +1 -1
- package/components/{notice-DrrmwMlw.cjs → notice-CPRDU_S1.cjs} +1 -1
- package/components/pending-state-BCnY_Rko.cjs +27 -0
- package/components/{pending-state-KsPO-6Ei.js → pending-state-BGPYLKpF.js} +13 -3
- package/components/permission-box/index.cjs +1 -1
- package/components/permission-box/index.js +1 -1
- package/components/{permission-box-BsmcqGnU.cjs → permission-box-CFGremih.cjs} +1 -1
- package/components/{permission-box-yUZKSyS9.js → permission-box-okjtXMqE.js} +2 -2
- package/components/picker/index.cjs +1 -1
- package/components/picker/index.js +1 -1
- package/components/{picker-nWTz5f1J.js → picker-94xKmr0R.js} +2 -2
- package/components/{picker-h0nO2GgS.cjs → picker-LKoYb_hf.cjs} +1 -1
- package/components/prompt-box/index.cjs +1 -1
- package/components/prompt-box/index.js +1 -1
- package/components/{prompt-box-BUMtyCsa.js → prompt-box-CXha8r-x.js} +3 -2
- package/components/{prompt-box-B3gDbsQo.cjs → prompt-box-il9-QwaZ.cjs} +3 -3
- package/components/question-box/index.cjs +1 -1
- package/components/question-box/index.js +1 -1
- package/components/question-box/question-box-templates.d.ts +2 -0
- package/components/question-box/question-box.d.ts +6 -0
- package/components/question-box-B7JHOnKn.cjs +403 -0
- package/components/{question-box-wYSFkVoP.js → question-box-D3eWOKeD.js} +148 -138
- package/components/search/index.cjs +1 -1
- package/components/search/index.js +1 -1
- package/components/{search-Dl5y1IqM.js → search-BsuMVoK_.js} +1 -1
- package/components/{search-CXuXsgJt.cjs → search-DHqWPsSc.cjs} +1 -1
- package/components/select/index.cjs +1 -1
- package/components/select/index.js +1 -1
- package/components/{select-lS54kKFO.js → select-C0Sduhc2.js} +1 -1
- package/components/{select-Dm7rf5Un.cjs → select-CceGtCu-.cjs} +1 -1
- package/components/tags/index.cjs +1 -1
- package/components/tags/index.js +1 -1
- package/components/{tags-CWJqZufu.cjs → tags-D3nJDejG.cjs} +1 -1
- package/components/{tags-BEfsznJy.js → tags-D6FwbnCF.js} +1 -1
- package/custom-elements.json +1 -1
- package/package.json +5 -1
- package/standalone/action-menu.js +1 -1
- package/standalone/button.js +1 -1
- package/standalone/chunks/button-BuO6UpFs.js +4 -0
- package/standalone/chunks/{button-DFVs4O1S.js → button-lnvFyXi7.js} +1 -1
- package/standalone/chunks/{menu-BQ1vUHja.js → menu-BWSRYdS7.js} +1 -1
- package/standalone/chunks/pending-state-C8xxYBPj.js +11 -0
- package/standalone/chunks/{picker-BOuknvzl.js → picker-Blouz5eb.js} +1 -1
- package/standalone/manifest.json +5 -5
- package/standalone/menu.js +1 -1
- package/standalone/notice.js +1 -1
- package/standalone/permission-box.js +1 -1
- package/standalone/picker.js +1 -1
- package/standalone/prompt-box.js +3 -3
- package/standalone/question-box.js +75 -73
- package/standalone/search.js +1 -1
- package/standalone/select.js +1 -1
- package/standalone/tags.js +1 -1
- package/utils/reactive-controllers/pending-state.d.ts +12 -0
- package/components/button-5jzMIMLW.js +0 -125
- package/components/button-CjgL13CD.cjs +0 -20
- package/components/pending-state-CQuz9Qiv.cjs +0 -27
- package/components/question-box-C7oXNWje.cjs +0 -401
- package/standalone/chunks/button-PsWOoEKo.js +0 -4
- package/standalone/chunks/pending-state-BbjpQDWR.js +0 -11
|
@@ -23,19 +23,19 @@ import "./icon-DADJww_a.js";
|
|
|
23
23
|
import { t as a } from "./language-resolution-7rc0khIK.js";
|
|
24
24
|
import "./action-button-LmKtPKfe.js";
|
|
25
25
|
import "./badge-bODlaAG_.js";
|
|
26
|
-
import "./button-
|
|
26
|
+
import "./button-BOdc31WB.js";
|
|
27
27
|
import "./checkbox-D884zXBt.js";
|
|
28
28
|
import "./field-group/index.js";
|
|
29
29
|
import "./text-field-Cn51A87k.js";
|
|
30
30
|
import "./radio-B_oHwHgO.js";
|
|
31
31
|
import { html as o, nothing as s, unsafeCSS as c } from "lit";
|
|
32
32
|
import { property as l, query as u, state as d } from "lit/decorators.js";
|
|
33
|
-
import { luzmoAngleLeft as
|
|
34
|
-
import { ifDefined as
|
|
35
|
-
import { repeat as
|
|
36
|
-
import { keyed as
|
|
33
|
+
import { luzmoAngleLeft as f, luzmoAngleRight as ee, luzmoPencil as p } from "@luzmo/icons";
|
|
34
|
+
import { ifDefined as m } from "lit/directives/if-defined.js";
|
|
35
|
+
import { repeat as h } from "lit/directives/repeat.js";
|
|
36
|
+
import { keyed as te } from "lit/directives/keyed.js";
|
|
37
37
|
// src/components/question-box/question-box.module.scss?inline
|
|
38
|
-
var g = ":host{font-family:var(--question-box-font-family);font-size:var(--question-box-font-size);color:var(--highcontrast-question-box-color,var(--question-box-color));box-sizing:border-box;inline-size:100%;max-inline-size:var(--luzmo-question-box-max-inline-size,var(--question-box-max-inline-size));display:block}:host([disabled]){pointer-events:none}.card{gap:var(--question-box-gap);padding:var(--question-box-padding);box-sizing:border-box;border-width:var(--question-box-border-width);border-style:solid;border-color:var(--highcontrast-question-box-border-color,var(--question-box-border-color));border-radius:var(--question-box-border-radius);background-color:var(--highcontrast-question-box-background-color,var(--question-box-background-color));flex-direction:column;display:flex}.header{justify-content:space-between;align-items:flex-start;gap:var(--question-box-header-gap);display:flex}.header-actions,.step-navigation{align-items:center;display:flex}.header-actions{gap:var(--question-box-header-actions-gap);min-block-size:0;block-size:max(var(--question-box-title-font-size) * var(--question-box-title-line-height), var(--question-box-header-control-size) - 2 * (var(--question-box-padding) - var(--question-box-header-actions-inset)));flex-shrink:0;margin-inline-start:auto;overflow:visible}.step-navigation{gap:var(--question-box-copy-gap)}.heading{gap:var(--question-box-heading-copy-gap);flex-direction:column;min-inline-size:0;display:flex}.progress{font-size:var(--question-box-progress-font-size);color:var(--question-box-muted-color);margin:0}.title{font-size:var(--question-box-title-font-size);font-weight:var(--luzmo-font-weight-bold);line-height:var(--question-box-title-line-height);margin:0}.title:focus,.summary-heading:focus{outline:none}.title:focus-visible,.summary-heading:focus-visible{-webkit-text-decoration-color:var(--question-box-focus-ring-color);text-decoration-color:var(--question-box-focus-ring-color);text-decoration-line:underline;text-decoration-thickness:var(--question-box-focus-ring-width);text-underline-offset:var(--question-box-focus-ring-gap);outline:none}.description{color:var(--question-box-muted-color);font-size:inherit;margin:0;margin-block-start:var(--question-box-heading-copy-offset);line-height:1.4}.close{flex-shrink:0}.body{gap:var(--question-box-option-gap);max-block-size:var(--luzmo-question-box-body-max-block-size,var(--question-box-body-max-block-size));padding-block:var(--question-box-body-focus-inset);margin-block:calc(var(--question-box-body-focus-inset) * -1);flex-direction:column;display:flex;overflow:hidden auto}.body::-webkit-scrollbar{width:var(--luzmo-question-box-scrollbar-width,var(--question-box-scrollbar-width));height:var(--luzmo-question-box-scrollbar-width,var(--question-box-scrollbar-width))}.body::-webkit-scrollbar-track{background:var(--luzmo-question-box-scrollbar-track-background,var(--question-box-scrollbar-track-background));border-radius:var(--luzmo-question-box-scrollbar-track-border-radius,var(--question-box-scrollbar-track-border-radius))}.body::-webkit-scrollbar-thumb{background:var(--luzmo-question-box-scrollbar-thumb-background,var(--question-box-scrollbar-thumb-background));border-radius:var(--luzmo-question-box-scrollbar-thumb-border-radius,var(--question-box-scrollbar-thumb-border-radius))}.body::-webkit-scrollbar-thumb:hover{background:var(--luzmo-question-box-scrollbar-thumb-hover-background,var(--question-box-scrollbar-thumb-hover-background))}.body{scrollbar-width:var(--luzmo-scrollbar-width,thin);scrollbar-color:var(--luzmo-question-box-scrollbar-thumb-background,var(--question-box-scrollbar-thumb-background)) var(--luzmo-question-box-scrollbar-track-background,var(--question-box-scrollbar-track-background))}.options{box-sizing:border-box;flex-direction:column;inline-size:100%;min-inline-size:0;display:flex}.options--descriptive luzmo-radio,.options--descriptive luzmo-checkbox,.options--descriptive .other-option-answer{padding-block:var(--luzmo-question-box-descriptive-option-padding-block,var(--question-box-descriptive-option-padding-block))}.body:has(.options--descriptive){margin-block:calc(var(--question-box-option-padding-block) - var(--question-box-body-focus-inset) - var(--luzmo-question-box-descriptive-option-padding-block,var(--question-box-descriptive-option-padding-block)))}luzmo-radio,luzmo-checkbox{box-sizing:border-box;inline-size:100%;min-block-size:var(--question-box-option-min-block-size);padding-block:var(--question-box-option-padding-block);padding-inline:var(--question-box-option-padding-inline);border-block-end-width:var(--luzmo-question-box-divider-width,var(--question-box-divider-width));border-block-end-style:solid;border-block-end-color:var(--luzmo-question-box-divider-color,var(--question-box-divider-color));border-radius:var(--luzmo-border-radius-s);align-items:center;display:flex}luzmo-radio:hover,luzmo-checkbox:hover{background-color:var(--question-box-option-hover-background)}.other-option-row{align-items:center;gap:var(--question-box-option-gap);box-sizing:border-box;border-block-end-width:var(--luzmo-question-box-divider-width,var(--question-box-divider-width));border-block-end-style:solid;border-block-end-color:var(--luzmo-question-box-divider-color,var(--question-box-divider-color));inline-size:100%;max-inline-size:100%;display:flex}.other-option-answer{align-items:center;gap:var(--question-box-option-gap);box-sizing:border-box;min-inline-size:0;min-block-size:var(--question-box-option-min-block-size);padding-block:var(--question-box-option-padding-block);padding-inline:var(--question-box-option-padding-inline);border-radius:var(--luzmo-border-radius-s);flex:1;display:flex}.other-option-answer:hover{background-color:var(--question-box-option-hover-background)}luzmo-radio.other-option,luzmo-checkbox.other-option{border:0;flex:none;min-block-size:auto;inline-size:auto;padding:0}luzmo-radio.other-option{--luzmo-radio-button-top-to-control:0px}luzmo-radio.numbered-option{--luzmo-radio-button-control-size:0px;--luzmo-radio-button-top-to-control:0px;--luzmo-radio-text-to-control:0px;--luzmo-radio-border-width:0px;--luzmo-radio-focus-indicator-width:0px}luzmo-checkbox.numbered-option{--luzmo-checkbox-control-size:0px;--luzmo-checkbox-text-to-control:0px;--luzmo-checkbox-top-to-text:0px;--luzmo-checkbox-border-width:0px;--luzmo-checkbox-selected-border-width:0px;--luzmo-checkbox-focus-indicator-width:0px}luzmo-radio.numbered-option::part(control),luzmo-checkbox.numbered-option::part(control){display:none}luzmo-radio.other-option:hover,luzmo-checkbox.other-option:hover{background-color:#0000}.other-field{inline-size:auto;min-inline-size:0;max-inline-size:100%;min-block-size:var(--question-box-other-field-min-block-size);font-size:var(--question-box-other-field-font-size);--luzmo-text-field-width:100%;--luzmo-text-field-height:var(--question-box-other-field-min-block-size);--luzmo-text-field-background-color:transparent;--luzmo-text-field-background-color-disabled:transparent;--luzmo-text-field-placeholder-font-size:var(--question-box-other-field-font-size);--luzmo-text-field-border-width:0px;--luzmo-text-field-spacing-inline:0px;--luzmo-text-field-spacing-block-start:0px;--luzmo-text-field-spacing-block-end:0px;flex:1;justify-content:center}.other-primary{flex:none}.other-actions{box-sizing:border-box;justify-content:flex-end;align-items:center;gap:var(--question-box-copy-gap-detailed);inline-size:100%;padding-inline:var(--question-box-option-padding-inline);margin-block-start:var(--question-box-copy-gap-detailed);display:flex}.selected-count{font-size:var(--luzmo-question-box-selected-count-font-size,var(--question-box-selected-count-font-size))}.other-actions .selected-count{min-inline-size:0;margin-inline-end:auto}.other-actions luzmo-button{flex:none}.status-error{--luzmo-helptext-font-size:var(--luzmo-question-box-selected-count-font-size,var(--question-box-selected-count-font-size));--luzmo-helptext-min-height:0;--luzmo-helptext-top-to-text:0;--luzmo-helptext-bottom-to-text:0}.visually-hidden{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.option-content{align-items:flex-start;gap:var(--question-box-option-gap);inline-size:100%;display:flex}.option-number{forced-color-adjust:none;inline-size:var(--question-box-option-number-size);block-size:var(--question-box-option-number-size);box-sizing:border-box;border:var(--luzmo-border-width) solid var(--highcontrast-question-box-option-number-border-color,var(--question-box-option-number-border-color));border-radius:var(--luzmo-border-radius);color:var(--highcontrast-question-box-option-number-color,var(--question-box-option-number-color));background-color:var(--highcontrast-question-box-option-number-background,var(--question-box-option-number-background));transition:color var(--luzmo-animation-duration) ease-in-out, border-color var(--luzmo-animation-duration) ease-in-out, background-color var(--luzmo-animation-duration) ease-in-out;flex:none;justify-content:center;align-items:center;line-height:1;display:inline-flex}luzmo-radio[checked] .option-number,luzmo-checkbox[checked] .option-number{color:var(--highcontrast-question-box-option-number-selected-color,var(--question-box-option-number-selected-color));border-color:var(--highcontrast-question-box-option-number-selected-background,var(--question-box-option-number-selected-background));background-color:var(--highcontrast-question-box-option-number-selected-background,var(--question-box-option-number-selected-background))}luzmo-radio[data-focus-visible] .option-number,luzmo-checkbox[data-focus-visible] .option-number,.option-number--focused{outline:var(--luzmo-question-box-focus-ring-width,var(--question-box-focus-ring-width)) solid var(--highcontrast-question-box-focus-ring-color,var(--luzmo-question-box-focus-ring-color,var(--question-box-focus-ring-color)));outline-offset:var(--luzmo-question-box-focus-ring-gap,var(--question-box-focus-ring-gap))}luzmo-radio[disabled] .option-number,luzmo-checkbox[disabled] .option-number{opacity:.5}.option-copy{gap:var(--question-box-copy-gap);flex-direction:column;flex:1;min-inline-size:0;display:flex}.option-edit luzmo-icon{color:inherit}.option-heading{align-items:center;gap:var(--question-box-recommended-gap);min-block-size:var(--question-box-option-number-size);flex-wrap:wrap;display:flex}.option-text{align-items:baseline;gap:var(--question-box-recommended-gap);flex-wrap:wrap;min-inline-size:0;display:flex}.option-description{color:var(--question-box-muted-color);line-height:1.4}.option-hint{color:var(--question-box-muted-color);font-size:var(--luzmo-font-size-s)}.footer{justify-content:space-between;align-items:center;gap:var(--question-box-option-gap);flex-wrap:wrap;display:flex}.status{color:var(--question-box-muted-color);font-size:var(--luzmo-question-box-selected-count-font-size,var(--question-box-selected-count-font-size))}.actions{justify-content:flex-end;gap:var(--question-box-recommended-gap);flex-wrap:wrap;margin-inline-start:auto;display:flex}:host([dir=rtl]) .step-navigation luzmo-icon{transform:scaleX(-1)}.resolved{gap:var(--question-box-summary-gap)}.summary-actions{justify-content:flex-end;gap:var(--question-box-recommended-gap);flex-wrap:wrap;display:flex}.summary{gap:var(--question-box-option-gap);flex-direction:column;display:flex}.summary-heading{font-size:var(--question-box-title-font-size);line-height:var(--question-box-title-line-height);margin:0}.summary-row{gap:var(--question-box-copy-gap);flex-direction:column;display:flex}.summary-title{color:var(--question-box-muted-color);font-size:var(--luzmo-font-size-s)}.summary-answer{font-weight:var(--luzmo-font-weight-bold)}@media (prefers-reduced-motion:reduce){.option-number{transition-duration:0s}}@media (forced-colors:active){:host{--highcontrast-question-box-border-color:CanvasText;--highcontrast-question-box-background-color:Canvas;--highcontrast-question-box-color:CanvasText;--highcontrast-question-box-focus-ring-color:Highlight;--highcontrast-question-box-option-number-border-color:ButtonText;--highcontrast-question-box-option-number-color:ButtonText;--highcontrast-question-box-option-number-background:Canvas;--highcontrast-question-box-option-number-selected-background:Highlight;--highcontrast-question-box-option-number-selected-color:HighlightText}}:host{--question-box-font-family:var(--luzmo-font-family);--question-box-font-size:var(--luzmo-font-size-m);--question-box-color:var(--luzmo-font-color);--question-box-muted-color:color-mix(in srgb, var(--luzmo-font-color) 80%, var(--luzmo-background-color));--question-box-background-color:var(--luzmo-background-color);--question-box-border-color:var(--luzmo-border-color);--question-box-border-width:var(--luzmo-border-width);--question-box-border-radius:var(--luzmo-border-radius-l);--question-box-padding:var(--luzmo-spacing-5);--question-box-gap:var(--luzmo-spacing-4);--question-box-header-gap:var(--luzmo-spacing-3);--question-box-header-actions-gap:var(--luzmo-spacing-2);--question-box-header-actions-inset:var(--luzmo-spacing-2);--question-box-header-control-size:var(--luzmo-component-height);--question-box-max-inline-size:40rem;--question-box-body-max-block-size:24rem;--question-box-title-font-size:var(--question-box-font-size);--question-box-title-line-height:1.3;--question-box-progress-font-size:var(--luzmo-font-size-s);--question-box-selected-count-font-size:var(--luzmo-font-size-s);--question-box-option-min-block-size:var(--luzmo-component-height);--question-box-option-hover-background:var(--luzmo-background-color-hover);--question-box-option-number-size:var(--luzmo-component-height-xs);--question-box-descriptive-option-padding-block:var(--question-box-option-padding-block);--question-box-option-padding-block:var(--luzmo-spacing-1);--question-box-option-padding-inline:var(--luzmo-spacing-3);--question-box-option-gap:var(--luzmo-spacing-3);--question-box-heading-copy-gap:0px;--question-box-heading-copy-offset:calc(var(--question-box-font-size) * -.25);--question-box-copy-gap:var(--luzmo-spacing-1);--question-box-copy-gap-detailed:var(--luzmo-spacing-2);--question-box-recommended-gap:var(--luzmo-spacing-2);--question-box-summary-gap:var(--luzmo-spacing-4);--question-box-body-focus-inset:calc(var(--luzmo-indicator-gap) + var(--luzmo-indicator-width));--question-box-focus-ring-width:var(--luzmo-indicator-width);--question-box-focus-ring-gap:var(--luzmo-indicator-gap);--question-box-focus-ring-color:var(--luzmo-indicator-color);--question-box-divider-width:0px;--question-box-option-number-background:var(--luzmo-background-color);--question-box-option-number-border-color:var(--luzmo-border-color);--question-box-option-number-color:var(--luzmo-font-color);--question-box-option-number-selected-background:var(--luzmo-primary);--question-box-option-number-selected-color:var(--luzmo-primary-inverse-color);--question-box-other-field-min-block-size:var(--question-box-option-min-block-size);--question-box-other-field-font-size:var(--question-box-font-size);--question-box-divider-color:var(--luzmo-border-color);--question-box-scrollbar-width:var(--luzmo-scrollbar-size);--question-box-scrollbar-track-background:var(--luzmo-scrollbar-track-background);--question-box-scrollbar-track-border-radius:var(--luzmo-scrollbar-track-border-radius);--question-box-scrollbar-thumb-background:var(--luzmo-scrollbar-thumb-background);--question-box-scrollbar-thumb-border-radius:var(--luzmo-scrollbar-thumb-border-radius);--question-box-scrollbar-thumb-hover-background:var(--luzmo-scrollbar-thumb-hover-background)}:host([size=s]){--question-box-padding:var(--luzmo-spacing-4);--question-box-font-size:var(--luzmo-font-size-s);--question-box-selected-count-font-size:var(--luzmo-font-size-xs);--question-box-title-font-size:var(--question-box-font-size);--question-box-header-control-size:var(--luzmo-component-height-s);--question-box-option-min-block-size:var(--luzmo-component-height-s);--question-box-option-number-size:var(--luzmo-component-height-xs);--question-box-other-field-min-block-size:var(--question-box-option-min-block-size);--question-box-other-field-font-size:var(--question-box-font-size)}:host([size=l]){--question-box-font-size:var(--luzmo-font-size-l);--question-box-selected-count-font-size:var(--luzmo-font-size-m);--question-box-title-font-size:var(--question-box-font-size);--question-box-header-control-size:var(--luzmo-component-height-l);--question-box-option-min-block-size:var(--luzmo-component-height-l);--question-box-option-number-size:var(--luzmo-component-height-s);--question-box-other-field-min-block-size:var(--question-box-option-min-block-size);--question-box-other-field-font-size:var(--question-box-font-size)}:host([size=xl]){--question-box-font-size:var(--luzmo-font-size-xl);--question-box-selected-count-font-size:var(--luzmo-font-size-l);--question-box-title-font-size:var(--question-box-font-size);--question-box-header-control-size:var(--luzmo-component-height-xl);--question-box-option-min-block-size:var(--luzmo-component-height-xl);--question-box-option-number-size:var(--luzmo-component-height);--question-box-other-field-min-block-size:var(--question-box-option-min-block-size);--question-box-other-field-font-size:var(--question-box-font-size)}", _ = "__other__", v = {
|
|
38
|
+
var g = ":host{font-family:var(--question-box-font-family);font-size:var(--question-box-font-size);color:var(--highcontrast-question-box-color,var(--question-box-color));box-sizing:border-box;inline-size:100%;max-inline-size:var(--luzmo-question-box-max-inline-size,var(--question-box-max-inline-size));display:block}:host([disabled]){pointer-events:none}.card{gap:var(--question-box-gap);padding:var(--question-box-padding);box-sizing:border-box;border-width:var(--question-box-border-width);border-style:solid;border-color:var(--highcontrast-question-box-border-color,var(--question-box-border-color));border-radius:var(--question-box-border-radius);background-color:var(--highcontrast-question-box-background-color,var(--question-box-background-color));flex-direction:column;display:flex}.header{justify-content:space-between;align-items:flex-start;gap:var(--question-box-header-gap);display:flex}.header-actions,.step-navigation{align-items:center;display:flex}.header-actions{gap:var(--question-box-header-actions-gap);min-block-size:0;block-size:max(var(--question-box-title-font-size) * var(--question-box-title-line-height), var(--question-box-header-control-size) - 2 * (var(--question-box-padding) - var(--question-box-header-actions-inset)));flex-shrink:0;margin-inline-start:auto;overflow:visible}.step-navigation{gap:var(--question-box-copy-gap)}.heading{gap:var(--question-box-heading-copy-gap);flex-direction:column;min-inline-size:0;display:flex}.progress{font-size:var(--question-box-progress-font-size);color:var(--question-box-muted-color);margin:0}.title{font-size:var(--question-box-title-font-size);font-weight:var(--luzmo-font-weight-bold);line-height:var(--question-box-title-line-height);margin:0}.title:focus,.summary-heading:focus{outline:none}.title:focus-visible,.summary-heading:focus-visible{-webkit-text-decoration-color:var(--question-box-focus-ring-color);text-decoration-color:var(--question-box-focus-ring-color);text-decoration-line:underline;text-decoration-thickness:var(--question-box-focus-ring-width);text-underline-offset:var(--question-box-focus-ring-gap);outline:none}.description{color:var(--question-box-muted-color);font-size:inherit;margin:0;margin-block-start:var(--question-box-heading-copy-offset);line-height:1.4}.close{flex-shrink:0}.body{gap:var(--question-box-option-gap);max-block-size:var(--luzmo-question-box-body-max-block-size,var(--question-box-body-max-block-size));padding-block:var(--question-box-body-focus-inset);margin-block:calc(var(--question-box-body-focus-inset) * -1);flex-direction:column;display:flex;overflow:hidden auto}.body::-webkit-scrollbar{width:var(--luzmo-question-box-scrollbar-width,var(--question-box-scrollbar-width));height:var(--luzmo-question-box-scrollbar-width,var(--question-box-scrollbar-width))}.body::-webkit-scrollbar-track{background:var(--luzmo-question-box-scrollbar-track-background,var(--question-box-scrollbar-track-background));border-radius:var(--luzmo-question-box-scrollbar-track-border-radius,var(--question-box-scrollbar-track-border-radius))}.body::-webkit-scrollbar-thumb{background:var(--luzmo-question-box-scrollbar-thumb-background,var(--question-box-scrollbar-thumb-background));border-radius:var(--luzmo-question-box-scrollbar-thumb-border-radius,var(--question-box-scrollbar-thumb-border-radius))}.body::-webkit-scrollbar-thumb:hover{background:var(--luzmo-question-box-scrollbar-thumb-hover-background,var(--question-box-scrollbar-thumb-hover-background))}.body{scrollbar-width:var(--luzmo-scrollbar-width,thin);scrollbar-color:var(--luzmo-question-box-scrollbar-thumb-background,var(--question-box-scrollbar-thumb-background)) var(--luzmo-question-box-scrollbar-track-background,var(--question-box-scrollbar-track-background))}.options{box-sizing:border-box;flex-direction:column;inline-size:100%;min-inline-size:0;display:flex}.options--descriptive luzmo-radio,.options--descriptive luzmo-checkbox,.options--descriptive .other-option-answer{padding-block:var(--luzmo-question-box-descriptive-option-padding-block,var(--question-box-descriptive-option-padding-block))}.body:has(.options--descriptive){margin-block:calc(var(--question-box-option-padding-block) - var(--question-box-body-focus-inset) - var(--luzmo-question-box-descriptive-option-padding-block,var(--question-box-descriptive-option-padding-block)))}luzmo-radio,luzmo-checkbox{box-sizing:border-box;inline-size:100%;min-block-size:var(--question-box-option-min-block-size);padding-block:var(--question-box-option-padding-block);padding-inline:var(--question-box-option-padding-inline);border-block-end-width:var(--luzmo-question-box-divider-width,var(--question-box-divider-width));border-block-end-style:solid;border-block-end-color:var(--luzmo-question-box-divider-color,var(--question-box-divider-color));border-radius:var(--luzmo-border-radius-s);align-items:center;display:flex}luzmo-radio:hover,luzmo-checkbox:hover{background-color:var(--question-box-option-hover-background)}.other-option-row{align-items:center;gap:var(--question-box-option-gap);box-sizing:border-box;border-block-end-width:var(--luzmo-question-box-divider-width,var(--question-box-divider-width));border-block-end-style:solid;border-block-end-color:var(--luzmo-question-box-divider-color,var(--question-box-divider-color));inline-size:100%;max-inline-size:100%;display:flex}.other-option-answer{align-items:center;gap:var(--question-box-option-gap);box-sizing:border-box;min-inline-size:0;min-block-size:var(--question-box-option-min-block-size);padding-block:var(--question-box-option-padding-block);padding-inline:var(--question-box-option-padding-inline);border-radius:var(--luzmo-border-radius-s);flex:1;display:flex}.other-option-answer:hover{background-color:var(--question-box-option-hover-background)}luzmo-radio.other-option,luzmo-checkbox.other-option{border:0;flex:none;min-block-size:auto;inline-size:auto;padding:0}luzmo-radio.other-option{--luzmo-radio-button-top-to-control:0px}luzmo-radio.numbered-option{--luzmo-radio-button-control-size:0px;--luzmo-radio-button-top-to-control:0px;--luzmo-radio-text-to-control:0px;--luzmo-radio-border-width:0px;--luzmo-radio-focus-indicator-width:0px}luzmo-checkbox.numbered-option{--luzmo-checkbox-control-size:0px;--luzmo-checkbox-text-to-control:0px;--luzmo-checkbox-top-to-text:0px;--luzmo-checkbox-border-width:0px;--luzmo-checkbox-selected-border-width:0px;--luzmo-checkbox-focus-indicator-width:0px}luzmo-radio.numbered-option::part(control),luzmo-checkbox.numbered-option::part(control){display:none}luzmo-radio.other-option:hover,luzmo-checkbox.other-option:hover{background-color:#0000}.other-field{inline-size:auto;min-inline-size:0;max-inline-size:100%;min-block-size:var(--question-box-other-field-min-block-size);font-size:var(--question-box-other-field-font-size);--luzmo-text-field-width:100%;--luzmo-text-field-height:var(--question-box-other-field-min-block-size);--luzmo-text-field-background-color:transparent;--luzmo-text-field-background-color-disabled:transparent;--luzmo-text-field-placeholder-font-size:var(--question-box-other-field-font-size);--luzmo-text-field-border-width:0px;--luzmo-text-field-spacing-inline:0px;--luzmo-text-field-spacing-block-start:0px;--luzmo-text-field-spacing-block-end:0px;flex:1;justify-content:center}.other-primary{flex:none}.other-actions{box-sizing:border-box;justify-content:flex-end;align-items:center;gap:var(--question-box-copy-gap-detailed);inline-size:100%;padding-inline:var(--question-box-option-padding-inline);margin-block-start:var(--question-box-copy-gap-detailed);display:flex}.selected-count{font-size:var(--luzmo-question-box-selected-count-font-size,var(--question-box-selected-count-font-size))}.other-actions .selected-count{min-inline-size:0;margin-inline-end:auto}.other-actions luzmo-button{flex:none}.status-error{--luzmo-helptext-font-size:var(--luzmo-question-box-selected-count-font-size,var(--question-box-selected-count-font-size));--luzmo-helptext-min-height:0;--luzmo-helptext-top-to-text:0;--luzmo-helptext-bottom-to-text:0}.visually-hidden{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.option-content{align-items:flex-start;gap:var(--question-box-option-gap);inline-size:100%;display:flex}.option-number{forced-color-adjust:none;inline-size:var(--question-box-option-number-size);block-size:var(--question-box-option-number-size);box-sizing:border-box;border:var(--luzmo-border-width) solid var(--highcontrast-question-box-option-number-border-color,var(--question-box-option-number-border-color));border-radius:var(--luzmo-border-radius);color:var(--highcontrast-question-box-option-number-color,var(--question-box-option-number-color));background-color:var(--highcontrast-question-box-option-number-background,var(--question-box-option-number-background));transition:color var(--luzmo-animation-duration) ease-in-out, border-color var(--luzmo-animation-duration) ease-in-out, background-color var(--luzmo-animation-duration) ease-in-out;flex:none;justify-content:center;align-items:center;line-height:1;display:inline-flex}luzmo-radio[checked] .option-number,luzmo-checkbox[checked] .option-number{color:var(--highcontrast-question-box-option-number-selected-color,var(--question-box-option-number-selected-color));border-color:var(--highcontrast-question-box-option-number-selected-background,var(--question-box-option-number-selected-background));background-color:var(--highcontrast-question-box-option-number-selected-background,var(--question-box-option-number-selected-background))}luzmo-radio[data-focus-visible] .option-number,luzmo-checkbox[data-focus-visible] .option-number,.option-number--focused{outline:var(--luzmo-question-box-focus-ring-width,var(--question-box-focus-ring-width)) solid var(--highcontrast-question-box-focus-ring-color,var(--luzmo-question-box-focus-ring-color,var(--question-box-focus-ring-color)));outline-offset:var(--luzmo-question-box-focus-ring-gap,var(--question-box-focus-ring-gap))}luzmo-radio[disabled] .option-number,luzmo-checkbox[disabled] .option-number{opacity:.5}.option-copy{gap:var(--question-box-copy-gap);flex-direction:column;flex:1;min-inline-size:0;display:flex}.option-edit luzmo-icon{color:inherit}.option-heading{align-items:center;gap:var(--question-box-recommended-gap);min-block-size:var(--question-box-option-number-size);flex-wrap:wrap;display:flex}.option-text{align-items:baseline;gap:var(--question-box-recommended-gap);flex-wrap:wrap;min-inline-size:0;display:flex}.option-description{color:var(--question-box-muted-color);line-height:1.4}.option-hint{color:var(--question-box-muted-color);font-size:var(--luzmo-font-size-s)}.footer{justify-content:space-between;align-items:center;gap:var(--question-box-option-gap);flex-wrap:wrap;display:flex}.status{color:var(--question-box-muted-color);font-size:var(--luzmo-question-box-selected-count-font-size,var(--question-box-selected-count-font-size))}.actions{justify-content:flex-end;gap:var(--question-box-recommended-gap);flex-wrap:wrap;margin-inline-start:auto;display:flex}:host([dir=rtl]) .step-navigation luzmo-icon{transform:scaleX(-1)}.resolved{gap:var(--question-box-summary-gap)}.summary-actions{justify-content:flex-end;gap:var(--question-box-recommended-gap);flex-wrap:wrap;display:flex}.summary{gap:var(--question-box-option-gap);flex-direction:column;display:flex}.summary-heading{font-size:var(--question-box-title-font-size);line-height:var(--question-box-title-line-height);margin:0}.summary-row{gap:var(--question-box-copy-gap);flex-direction:column;display:flex}.summary-value{color:var(--question-box-muted-color)}.summary-answer{color:var(--highcontrast-question-box-color,var(--question-box-color));font-weight:var(--luzmo-font-weight-semibold)}@media (prefers-reduced-motion:reduce){.option-number{transition-duration:0s}}@media (forced-colors:active){:host{--highcontrast-question-box-border-color:CanvasText;--highcontrast-question-box-background-color:Canvas;--highcontrast-question-box-color:CanvasText;--highcontrast-question-box-focus-ring-color:Highlight;--highcontrast-question-box-option-number-border-color:ButtonText;--highcontrast-question-box-option-number-color:ButtonText;--highcontrast-question-box-option-number-background:Canvas;--highcontrast-question-box-option-number-selected-background:Highlight;--highcontrast-question-box-option-number-selected-color:HighlightText}}:host{--question-box-font-family:var(--luzmo-font-family);--question-box-font-size:var(--luzmo-font-size-m);--question-box-color:var(--luzmo-font-color);--question-box-muted-color:color-mix(in srgb, var(--luzmo-font-color) 80%, var(--luzmo-background-color));--question-box-background-color:var(--luzmo-background-color);--question-box-border-color:var(--luzmo-border-color);--question-box-border-width:var(--luzmo-border-width);--question-box-border-radius:var(--luzmo-border-radius-l);--question-box-padding:var(--luzmo-spacing-5);--question-box-gap:var(--luzmo-spacing-4);--question-box-header-gap:var(--luzmo-spacing-3);--question-box-header-actions-gap:var(--luzmo-spacing-2);--question-box-header-actions-inset:var(--luzmo-spacing-2);--question-box-header-control-size:var(--luzmo-component-height);--question-box-max-inline-size:40rem;--question-box-body-max-block-size:24rem;--question-box-title-font-size:var(--question-box-font-size);--question-box-title-line-height:1.3;--question-box-progress-font-size:var(--luzmo-font-size-s);--question-box-selected-count-font-size:var(--luzmo-font-size-s);--question-box-option-min-block-size:var(--luzmo-component-height);--question-box-option-hover-background:var(--luzmo-background-color-hover);--question-box-option-number-size:var(--luzmo-component-height-xs);--question-box-descriptive-option-padding-block:var(--question-box-option-padding-block);--question-box-option-padding-block:var(--luzmo-spacing-1);--question-box-option-padding-inline:var(--luzmo-spacing-3);--question-box-option-gap:var(--luzmo-spacing-3);--question-box-heading-copy-gap:0px;--question-box-heading-copy-offset:calc(var(--question-box-font-size) * -.25);--question-box-copy-gap:var(--luzmo-spacing-1);--question-box-copy-gap-detailed:var(--luzmo-spacing-2);--question-box-recommended-gap:var(--luzmo-spacing-2);--question-box-summary-gap:var(--luzmo-spacing-4);--question-box-body-focus-inset:calc(var(--luzmo-indicator-gap) + var(--luzmo-indicator-width));--question-box-focus-ring-width:var(--luzmo-indicator-width);--question-box-focus-ring-gap:var(--luzmo-indicator-gap);--question-box-focus-ring-color:var(--luzmo-indicator-color);--question-box-divider-width:0px;--question-box-option-number-background:var(--luzmo-background-color);--question-box-option-number-border-color:var(--luzmo-border-color);--question-box-option-number-color:var(--luzmo-font-color);--question-box-option-number-selected-background:var(--luzmo-primary);--question-box-option-number-selected-color:var(--luzmo-primary-inverse-color);--question-box-other-field-min-block-size:var(--question-box-option-min-block-size);--question-box-other-field-font-size:var(--question-box-font-size);--question-box-divider-color:var(--luzmo-border-color);--question-box-scrollbar-width:var(--luzmo-scrollbar-size);--question-box-scrollbar-track-background:var(--luzmo-scrollbar-track-background);--question-box-scrollbar-track-border-radius:var(--luzmo-scrollbar-track-border-radius);--question-box-scrollbar-thumb-background:var(--luzmo-scrollbar-thumb-background);--question-box-scrollbar-thumb-border-radius:var(--luzmo-scrollbar-thumb-border-radius);--question-box-scrollbar-thumb-hover-background:var(--luzmo-scrollbar-thumb-hover-background)}:host([size=s]){--question-box-padding:var(--luzmo-spacing-4);--question-box-font-size:var(--luzmo-font-size-s);--question-box-selected-count-font-size:var(--luzmo-font-size-xs);--question-box-title-font-size:var(--question-box-font-size);--question-box-header-control-size:var(--luzmo-component-height-s);--question-box-option-min-block-size:var(--luzmo-component-height-s);--question-box-option-number-size:var(--luzmo-component-height-xs);--question-box-other-field-min-block-size:var(--question-box-option-min-block-size);--question-box-other-field-font-size:var(--question-box-font-size)}:host([size=l]){--question-box-font-size:var(--luzmo-font-size-l);--question-box-selected-count-font-size:var(--luzmo-font-size-m);--question-box-title-font-size:var(--question-box-font-size);--question-box-header-control-size:var(--luzmo-component-height-l);--question-box-option-min-block-size:var(--luzmo-component-height-l);--question-box-option-number-size:var(--luzmo-component-height-s);--question-box-other-field-min-block-size:var(--question-box-option-min-block-size);--question-box-other-field-font-size:var(--question-box-font-size)}:host([size=xl]){--question-box-font-size:var(--luzmo-font-size-xl);--question-box-selected-count-font-size:var(--luzmo-font-size-l);--question-box-title-font-size:var(--question-box-font-size);--question-box-header-control-size:var(--luzmo-component-height-xl);--question-box-option-min-block-size:var(--luzmo-component-height-xl);--question-box-option-number-size:var(--luzmo-component-height);--question-box-other-field-min-block-size:var(--question-box-option-min-block-size);--question-box-other-field-font-size:var(--question-box-font-size)}", _ = "__other__", v = {
|
|
39
39
|
continue: "Next",
|
|
40
40
|
back: "Back",
|
|
41
41
|
submit: "Submit",
|
|
@@ -83,17 +83,17 @@ var g = ":host{font-family:var(--question-box-font-family);font-size:var(--quest
|
|
|
83
83
|
}, E = (e, t) => {
|
|
84
84
|
let n = t[e.id];
|
|
85
85
|
return e.type === "single" ? typeof n == "string" && n ? [n] : [] : Array.isArray(n) ? T(n) : [];
|
|
86
|
-
}, D = (e, t) => E(e, t).includes(_),
|
|
86
|
+
}, D = (e, t) => E(e, t).includes(_), re = (e) => {
|
|
87
87
|
let t = Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
|
|
88
88
|
return {
|
|
89
89
|
...v,
|
|
90
90
|
...t
|
|
91
91
|
};
|
|
92
|
-
},
|
|
92
|
+
}, O = (e, t) => {
|
|
93
93
|
let n = e;
|
|
94
94
|
for (let [e, r] of Object.entries(t)) n = n.replaceAll(`{${e}}`, r);
|
|
95
95
|
return n;
|
|
96
|
-
},
|
|
96
|
+
}, ie = (e) => {
|
|
97
97
|
let t = /* @__PURE__ */ new Set();
|
|
98
98
|
for (let n of e) {
|
|
99
99
|
if (!n.id) throw TypeError("luzmo-question-box: every question needs an id.");
|
|
@@ -115,7 +115,7 @@ var g = ":host{font-family:var(--question-box-font-family);font-size:var(--quest
|
|
|
115
115
|
o.add(e.value);
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
},
|
|
118
|
+
}, k = (e, t) => {
|
|
119
119
|
let n = Object.fromEntries([]);
|
|
120
120
|
for (let r of e) {
|
|
121
121
|
let e = ne(r), i = t[r.id], a = Object.hasOwn(t, r.id);
|
|
@@ -132,45 +132,45 @@ var g = ":host{font-family:var(--question-box-font-family);font-size:var(--quest
|
|
|
132
132
|
typeof s == "string" ? C(n, o, s) : !a && r.options.length === 0 && typeof r.default == "string" && C(n, o, r.default);
|
|
133
133
|
}
|
|
134
134
|
return n;
|
|
135
|
-
},
|
|
136
|
-
let n =
|
|
137
|
-
return n > 0 && r !== void 0 ?
|
|
135
|
+
}, A = (e) => e.minSelected ?? +!!e.required, ae = (e, t) => {
|
|
136
|
+
let n = A(e), r = e.maxSelected;
|
|
137
|
+
return n > 0 && r !== void 0 ? O(t.selectionRangeDescription, {
|
|
138
138
|
min: String(n),
|
|
139
139
|
max: String(r)
|
|
140
|
-
}) : n === 1 ? t.requiredSelectionDescription : n > 1 ?
|
|
141
|
-
},
|
|
142
|
-
let n = E(e, t), r =
|
|
140
|
+
}) : n === 1 ? t.requiredSelectionDescription : n > 1 ? O(t.minSelectedError, { min: String(n) }) : r === void 0 ? void 0 : O(t.maxSelectedError, { max: String(r) });
|
|
141
|
+
}, j = (e, t) => {
|
|
142
|
+
let n = E(e, t), r = A(e), i = e.maxSelected;
|
|
143
143
|
if (n.length < r) return r <= 1 ? "missing" : "minimum";
|
|
144
144
|
if (i !== void 0 && n.length > i) return "maximum";
|
|
145
145
|
if (D(e, t) && !String(t[y(e.id)] ?? "").trim()) return "otherText";
|
|
146
|
-
},
|
|
147
|
-
switch (
|
|
148
|
-
case "minimum": return
|
|
149
|
-
case "maximum": return
|
|
146
|
+
}, M = (e, t) => j(e, t) !== void 0, N = (e, t, n) => {
|
|
147
|
+
switch (j(e, t)) {
|
|
148
|
+
case "minimum": return O(n.minSelectedError, { min: String(A(e)) });
|
|
149
|
+
case "maximum": return O(n.maxSelectedError, { max: String(e.maxSelected) });
|
|
150
150
|
case "otherText": return n.otherRequiredError;
|
|
151
151
|
default: return;
|
|
152
152
|
}
|
|
153
|
-
},
|
|
153
|
+
}, P = (e, t, n, r, i) => {
|
|
154
154
|
if (i || t.disabled) return !0;
|
|
155
155
|
if (e.type !== "multiple" || n) return !1;
|
|
156
156
|
let a = e.maxSelected;
|
|
157
157
|
return a !== void 0 && E(e, r).length >= a;
|
|
158
|
-
},
|
|
158
|
+
}, F = (e, t) => O(e === 1 ? t.selectedCountOne : t.selectedCount, { count: String(e) }), I, oe = (e, t) => {
|
|
159
159
|
try {
|
|
160
|
-
return
|
|
160
|
+
return I?.language !== t && (I = {
|
|
161
161
|
language: t,
|
|
162
162
|
formatter: new Intl.ListFormat(t, {
|
|
163
163
|
style: "narrow",
|
|
164
164
|
type: "conjunction"
|
|
165
165
|
})
|
|
166
|
-
}),
|
|
166
|
+
}), I.formatter.format(e);
|
|
167
167
|
} catch {
|
|
168
168
|
return e.join(", ");
|
|
169
169
|
}
|
|
170
|
-
},
|
|
170
|
+
}, se = (e, t) => e.recommended ? O(t.recommendedSuffix, {
|
|
171
171
|
label: e.label,
|
|
172
172
|
recommended: t.recommended
|
|
173
|
-
}) : e.label,
|
|
173
|
+
}) : e.label, ce = (e) => {
|
|
174
174
|
let t = e.options.map((e) => ({
|
|
175
175
|
const: e.value,
|
|
176
176
|
title: e.label
|
|
@@ -179,10 +179,10 @@ var g = ":host{font-family:var(--question-box-font-family);font-size:var(--quest
|
|
|
179
179
|
const: _,
|
|
180
180
|
title: typeof e.other == "object" && e.other.label || v.other
|
|
181
181
|
}), t;
|
|
182
|
-
},
|
|
182
|
+
}, L = (e) => {
|
|
183
183
|
let t = { type: "string" };
|
|
184
184
|
return typeof e.other == "object" && e.other.label && (t.title = e.other.label), t;
|
|
185
|
-
},
|
|
185
|
+
}, R = (e) => {
|
|
186
186
|
let t = [], n = [];
|
|
187
187
|
for (let r of e) {
|
|
188
188
|
if (r.options.length === 0) {
|
|
@@ -190,7 +190,7 @@ var g = ":host{font-family:var(--question-box-font-family);font-size:var(--quest
|
|
|
190
190
|
r.title && (e.title = r.title), r.description && (e.description = r.description), typeof r.default == "string" && (e.default = r.default), t.push([r.id, e]), r.required && n.push(r.id);
|
|
191
191
|
continue;
|
|
192
192
|
}
|
|
193
|
-
let e =
|
|
193
|
+
let e = ce(r);
|
|
194
194
|
if (r.type === "single") {
|
|
195
195
|
let n = {
|
|
196
196
|
type: "string",
|
|
@@ -210,7 +210,7 @@ var g = ":host{font-family:var(--question-box-font-family);font-size:var(--quest
|
|
|
210
210
|
}
|
|
211
211
|
t.push([r.id, n]);
|
|
212
212
|
}
|
|
213
|
-
r.required && n.push(r.id), b(r) && t.push([y(r.id),
|
|
213
|
+
r.required && n.push(r.id), b(r) && t.push([y(r.id), L(r)]);
|
|
214
214
|
}
|
|
215
215
|
let r = Object.fromEntries(t);
|
|
216
216
|
return n.length > 0 ? {
|
|
@@ -221,10 +221,10 @@ var g = ":host{font-family:var(--question-box-font-family);font-size:var(--quest
|
|
|
221
221
|
type: "object",
|
|
222
222
|
properties: r
|
|
223
223
|
};
|
|
224
|
-
},
|
|
224
|
+
}, z = (e, t) => String(t[y(e.id)] ?? "").trim(), B = (e, t) => {
|
|
225
225
|
let n = [];
|
|
226
226
|
for (let r of e) {
|
|
227
|
-
let e =
|
|
227
|
+
let e = z(r, t);
|
|
228
228
|
if (r.options.length === 0) {
|
|
229
229
|
e && n.push([r.id, e]);
|
|
230
230
|
continue;
|
|
@@ -233,11 +233,11 @@ var g = ":host{font-family:var(--question-box-font-family);font-size:var(--quest
|
|
|
233
233
|
r.type === "single" ? i[0] && n.push([r.id, i[0]]) : i.length > 0 && n.push([r.id, [...i]]), b(r) && D(r, t) && e && n.push([y(r.id), e]);
|
|
234
234
|
}
|
|
235
235
|
return Object.fromEntries(n);
|
|
236
|
-
},
|
|
236
|
+
}, V = (e) => !!e && typeof e == "object" && !Array.isArray(e), H = (e) => V(e) ? e : {}, U = (e) => {
|
|
237
237
|
let t = e.oneOf ?? e.items?.anyOf;
|
|
238
238
|
if (Array.isArray(t)) {
|
|
239
239
|
let e = [], n = /* @__PURE__ */ new Set();
|
|
240
|
-
for (let r of t)
|
|
240
|
+
for (let r of t) V(r) && typeof r.const == "string" && r.const && !n.has(r.const) && (n.add(r.const), e.push({
|
|
241
241
|
value: r.const,
|
|
242
242
|
label: typeof r.title == "string" && r.title ? r.title : r.const
|
|
243
243
|
}));
|
|
@@ -267,20 +267,20 @@ var g = ":host{font-family:var(--question-box-font-family);font-size:var(--quest
|
|
|
267
267
|
declared: !1,
|
|
268
268
|
options: []
|
|
269
269
|
};
|
|
270
|
-
},
|
|
270
|
+
}, W = (e) => y(e), G = (e) => e.format !== void 0 || e.minLength !== void 0 || e.maxLength !== void 0 || e.pattern !== void 0, le = (e) => e.type === "string" && !U(e).declared && !G(e), ue = (e) => {
|
|
271
271
|
if (e.type !== "object" || !e.properties) return [];
|
|
272
272
|
let t = e.properties, n = new Set(e.required ?? []), r = /* @__PURE__ */ new Set();
|
|
273
273
|
for (let e of Object.keys(t)) {
|
|
274
|
-
let n =
|
|
275
|
-
n in t &&
|
|
274
|
+
let n = W(e), i = U(H(t[e])), a = H(t[n]);
|
|
275
|
+
n in t && le(a) && i.options.some((e) => e.value === "__other__") && r.add(n);
|
|
276
276
|
}
|
|
277
277
|
let i = [];
|
|
278
278
|
for (let [e, a] of Object.entries(t)) {
|
|
279
279
|
if (r.has(e)) continue;
|
|
280
|
-
let o =
|
|
280
|
+
let o = H(a), s = U(o), c = s.options.some((e) => e.value === _), l = W(e);
|
|
281
281
|
if (c && !r.has(l)) continue;
|
|
282
282
|
let u = s.options.filter((e) => e.value !== _);
|
|
283
|
-
if (o.type === "number" || o.type === "integer" || o.type === "boolean" || o.type !== "string" && o.type !== "array" || s.declared && s.options.length === 0 || o.type === "array" && !s.declared || o.type === "string" && !s.declared &&
|
|
283
|
+
if (o.type === "number" || o.type === "integer" || o.type === "boolean" || o.type !== "string" && o.type !== "array" || s.declared && s.options.length === 0 || o.type === "array" && !s.declared || o.type === "string" && !s.declared && G(o)) continue;
|
|
284
284
|
let d = {
|
|
285
285
|
id: e,
|
|
286
286
|
type: o.type === "array" ? "multiple" : "single",
|
|
@@ -288,7 +288,7 @@ var g = ":host{font-family:var(--question-box-font-family);font-size:var(--quest
|
|
|
288
288
|
options: u
|
|
289
289
|
};
|
|
290
290
|
if (o.description && (d.description = o.description), n.has(e) && (d.required = !0), o.type === "array" ? (o.minItems !== void 0 && (d.minSelected = o.minItems), o.maxItems !== void 0 && (d.maxSelected = o.maxItems), Array.isArray(o.default) && o.default.length > 0 && (d.default = o.default)) : typeof o.default == "string" && (d.default = o.default), c && l in t) {
|
|
291
|
-
let e =
|
|
291
|
+
let e = H(t[l]);
|
|
292
292
|
d.other = !e.title || { label: e.title };
|
|
293
293
|
}
|
|
294
294
|
i.push(d);
|
|
@@ -296,7 +296,7 @@ var g = ":host{font-family:var(--question-box-font-family);font-size:var(--quest
|
|
|
296
296
|
return i;
|
|
297
297
|
};
|
|
298
298
|
// src/components/question-box/question-box-templates.ts
|
|
299
|
-
function
|
|
299
|
+
function K(e) {
|
|
300
300
|
switch (e) {
|
|
301
301
|
case "m": return "xs";
|
|
302
302
|
case "l": return "s";
|
|
@@ -305,24 +305,54 @@ function G(e) {
|
|
|
305
305
|
default: return "xxs";
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
-
function
|
|
308
|
+
function q(e) {
|
|
309
309
|
return e.step >= e.questions.length - 1;
|
|
310
310
|
}
|
|
311
|
-
function
|
|
312
|
-
return e.disabled ? !0 : e.readonly ?
|
|
311
|
+
function J(e, t) {
|
|
312
|
+
return e.disabled ? !0 : e.readonly ? q(e) : e.questionInvalid(t);
|
|
313
313
|
}
|
|
314
|
-
function
|
|
314
|
+
function de(e, t) {
|
|
315
315
|
let n = e.selectedValues(t);
|
|
316
|
-
return n.length === 0 ? "" :
|
|
316
|
+
return n.length === 0 ? "" : oe(n.map((n) => {
|
|
317
317
|
if (n === "__other__") return String(e.value[y(t.id)] ?? e.copy.other);
|
|
318
318
|
let r = t.options.find((e) => e.value === n);
|
|
319
|
-
return r ?
|
|
319
|
+
return r ? se(r, e.copy) : n;
|
|
320
320
|
}), e.language);
|
|
321
321
|
}
|
|
322
|
-
function
|
|
323
|
-
let n =
|
|
322
|
+
function fe(e, t) {
|
|
323
|
+
let n = de(e, t), r = e.copy.answer.split("{answer}").map((e, t) => o`${t > 0 ? o`<span class="summary-answer">${n}</span>` : s}${e}`);
|
|
324
324
|
return o`<span class="summary-value">${r}</span>`;
|
|
325
325
|
}
|
|
326
|
+
function pe(e) {
|
|
327
|
+
let t = e.copy;
|
|
328
|
+
return o`
|
|
329
|
+
<div class="summary-actions">
|
|
330
|
+
${!e.submitted || e.showChange ? o`
|
|
331
|
+
<luzmo-button
|
|
332
|
+
id="change-button"
|
|
333
|
+
dir=${e.dir}
|
|
334
|
+
variant="primary"
|
|
335
|
+
treatment=${e.submitted ? "fill" : "outline"}
|
|
336
|
+
size=${e.size}
|
|
337
|
+
?disabled=${e.disabled}
|
|
338
|
+
@click=${e.handlers.change}
|
|
339
|
+
>${t.change}</luzmo-button
|
|
340
|
+
>
|
|
341
|
+
` : s}
|
|
342
|
+
${e.submitted ? s : o`
|
|
343
|
+
<luzmo-button
|
|
344
|
+
id="review-submit-button"
|
|
345
|
+
dir=${e.dir}
|
|
346
|
+
variant="primary"
|
|
347
|
+
size=${e.size}
|
|
348
|
+
?disabled=${e.disabled || e.readonly}
|
|
349
|
+
@click=${e.handlers.primary}
|
|
350
|
+
>${t.submit}</luzmo-button
|
|
351
|
+
>
|
|
352
|
+
`}
|
|
353
|
+
</div>
|
|
354
|
+
`;
|
|
355
|
+
}
|
|
326
356
|
function me(e) {
|
|
327
357
|
let t = e.copy, n = e.questions.reduce((t, n) => t + e.selectedValues(n).length, 0);
|
|
328
358
|
return o`
|
|
@@ -331,42 +361,18 @@ function me(e) {
|
|
|
331
361
|
<h2 class="summary-heading" id="resolved-title" tabindex="-1">
|
|
332
362
|
${n === 1 ? t.answerTitle : t.answersTitle}
|
|
333
363
|
</h2>
|
|
334
|
-
${
|
|
364
|
+
${h(e.questions, (e) => e.id, (t) => o`
|
|
335
365
|
<div class="summary-row">
|
|
336
366
|
<span class="summary-title">${t.title}</span>
|
|
337
|
-
${
|
|
367
|
+
${fe(e, t)}
|
|
338
368
|
</div>
|
|
339
369
|
`)}
|
|
340
370
|
</div>
|
|
341
|
-
|
|
342
|
-
${!e.submitted || e.showChange ? o`
|
|
343
|
-
<luzmo-button
|
|
344
|
-
id="change-button"
|
|
345
|
-
dir=${e.dir}
|
|
346
|
-
variant="primary"
|
|
347
|
-
treatment=${e.submitted ? "fill" : "outline"}
|
|
348
|
-
size=${e.size}
|
|
349
|
-
?disabled=${e.disabled}
|
|
350
|
-
@click=${e.handlers.change}
|
|
351
|
-
>${t.change}</luzmo-button
|
|
352
|
-
>
|
|
353
|
-
` : s}
|
|
354
|
-
${e.submitted ? s : o`
|
|
355
|
-
<luzmo-button
|
|
356
|
-
id="review-submit-button"
|
|
357
|
-
dir=${e.dir}
|
|
358
|
-
variant="primary"
|
|
359
|
-
size=${e.size}
|
|
360
|
-
?disabled=${e.disabled || e.readonly}
|
|
361
|
-
@click=${e.handlers.primary}
|
|
362
|
-
>${t.submit}</luzmo-button
|
|
363
|
-
>
|
|
364
|
-
`}
|
|
365
|
-
</div>
|
|
371
|
+
${e.answered ? s : pe(e)}
|
|
366
372
|
</div>
|
|
367
373
|
`;
|
|
368
374
|
}
|
|
369
|
-
function
|
|
375
|
+
function Y(e, t, n) {
|
|
370
376
|
let i = e.optionIndicator === "letters" && n < 26 ? String.fromCharCode(65 + n) : String(n + 1);
|
|
371
377
|
return o`
|
|
372
378
|
<span
|
|
@@ -395,7 +401,7 @@ function J(e, t, n) {
|
|
|
395
401
|
</span>
|
|
396
402
|
`;
|
|
397
403
|
}
|
|
398
|
-
function
|
|
404
|
+
function X(e, t) {
|
|
399
405
|
return e.disabledReason ? o`<span class="visually-hidden" id="option-reason-${t}"
|
|
400
406
|
>${e.disabledReason}</span
|
|
401
407
|
>` : s;
|
|
@@ -410,7 +416,7 @@ function he(e, t) {
|
|
|
410
416
|
>
|
|
411
417
|
` : s;
|
|
412
418
|
}
|
|
413
|
-
function
|
|
419
|
+
function Z(e, t) {
|
|
414
420
|
if (t.type !== "multiple") return s;
|
|
415
421
|
let n = e.showError ? e.questionError(t) : void 0;
|
|
416
422
|
return o`
|
|
@@ -421,14 +427,14 @@ function X(e, t) {
|
|
|
421
427
|
dir=${e.dir}
|
|
422
428
|
variant="negative"
|
|
423
429
|
>${n}</luzmo-help-text
|
|
424
|
-
>` :
|
|
430
|
+
>` : F(e.selectedValues(t).length, e.copy)}</span
|
|
425
431
|
>
|
|
426
432
|
`;
|
|
427
433
|
}
|
|
428
434
|
function ge(e, t) {
|
|
429
435
|
return o`
|
|
430
436
|
<div class="other-actions">
|
|
431
|
-
${
|
|
437
|
+
${Z(e, t)}
|
|
432
438
|
${e.hideSkip ? s : o`
|
|
433
439
|
<luzmo-button
|
|
434
440
|
id="other-skip-button"
|
|
@@ -448,9 +454,9 @@ function ge(e, t) {
|
|
|
448
454
|
variant="primary"
|
|
449
455
|
treatment="outline"
|
|
450
456
|
size=${r(e.size)}
|
|
451
|
-
?disabled=${
|
|
457
|
+
?disabled=${J(e, t)}
|
|
452
458
|
@click=${e.handlers.primary}
|
|
453
|
-
>${
|
|
459
|
+
>${q(e) ? e.copy.submit : e.copy.continue}</luzmo-button
|
|
454
460
|
>
|
|
455
461
|
</div>
|
|
456
462
|
`;
|
|
@@ -458,7 +464,7 @@ function ge(e, t) {
|
|
|
458
464
|
function _e(e, t) {
|
|
459
465
|
return e.isOtherSelected(t) && String(e.value[y(t.id)] ?? "").trim().length > 0;
|
|
460
466
|
}
|
|
461
|
-
function
|
|
467
|
+
function Q(e, t) {
|
|
462
468
|
let n = x(t), r = y(t.id), i = e.isOtherSelected(t), a = e.optionDisabled(t, {
|
|
463
469
|
value: _,
|
|
464
470
|
label: n.label || e.copy.other
|
|
@@ -485,7 +491,7 @@ function Z(e, t) {
|
|
|
485
491
|
></luzmo-text-field>
|
|
486
492
|
`;
|
|
487
493
|
}
|
|
488
|
-
function
|
|
494
|
+
function ve(e, t) {
|
|
489
495
|
let n = _e(e, t);
|
|
490
496
|
return t.type === "multiple" || e.hideSkip && !n ? s : o`
|
|
491
497
|
<luzmo-button
|
|
@@ -495,13 +501,13 @@ function Q(e, t) {
|
|
|
495
501
|
variant="primary"
|
|
496
502
|
treatment="outline"
|
|
497
503
|
size=${r(e.size)}
|
|
498
|
-
?disabled=${n ?
|
|
504
|
+
?disabled=${n ? J(e, t) : e.disabled || e.readonly}
|
|
499
505
|
@click=${n ? e.handlers.primary : e.handlers.skip}
|
|
500
|
-
>${n ?
|
|
506
|
+
>${n ? q(e) ? e.copy.submit : e.copy.continue : e.copy.skip}</luzmo-button
|
|
501
507
|
>
|
|
502
508
|
`;
|
|
503
509
|
}
|
|
504
|
-
function
|
|
510
|
+
function ye(e, t, n) {
|
|
505
511
|
let r = e.selectedValues(t)[0] ?? "", i = t.options.some((e) => e.description) ? "options options--descriptive" : "options";
|
|
506
512
|
return o`
|
|
507
513
|
<luzmo-radio-group
|
|
@@ -511,15 +517,15 @@ function ve(e, t, n) {
|
|
|
511
517
|
vertical
|
|
512
518
|
label=${t.title}
|
|
513
519
|
manual-selection
|
|
514
|
-
aria-readonly=${
|
|
515
|
-
aria-required=${
|
|
520
|
+
aria-readonly=${m(e.readonly ? "true" : void 0)}
|
|
521
|
+
aria-required=${m(t.required ? "true" : void 0)}
|
|
516
522
|
.selected=${r}
|
|
517
523
|
?invalid=${!!n}
|
|
518
524
|
@change=${e.handlers.radioChange}
|
|
519
525
|
@focusin=${e.handlers.focusIn}
|
|
520
526
|
@focusout=${e.handlers.focusOut}
|
|
521
527
|
>
|
|
522
|
-
${
|
|
528
|
+
${h(t.options, (e) => e.value, (n, i) => o`
|
|
523
529
|
<luzmo-radio
|
|
524
530
|
class="numbered-option"
|
|
525
531
|
dir=${e.dir}
|
|
@@ -529,12 +535,12 @@ function ve(e, t, n) {
|
|
|
529
535
|
emphasized
|
|
530
536
|
?disabled=${e.optionDisabled(t, n, n.value === r)}
|
|
531
537
|
?readonly=${e.readonly}
|
|
532
|
-
aria-describedby=${
|
|
538
|
+
aria-describedby=${m(n.disabledReason ? `option-reason-${i}` : void 0)}
|
|
533
539
|
@click=${e.handlers.radioClick}
|
|
534
540
|
@change=${e.handlers.radioChange}
|
|
535
541
|
>
|
|
536
|
-
${
|
|
537
|
-
${
|
|
542
|
+
${Y(e, n, i)}
|
|
543
|
+
${X(n, i)}
|
|
538
544
|
</luzmo-radio>
|
|
539
545
|
`)}
|
|
540
546
|
${b(t) ? o`
|
|
@@ -556,22 +562,22 @@ function ve(e, t, n) {
|
|
|
556
562
|
<luzmo-icon
|
|
557
563
|
block
|
|
558
564
|
dir=${e.dir}
|
|
559
|
-
.size=${
|
|
560
|
-
.icon=${
|
|
565
|
+
.size=${K(e.size)}
|
|
566
|
+
.icon=${p}
|
|
561
567
|
></luzmo-icon>
|
|
562
568
|
</span>
|
|
563
569
|
</luzmo-radio>
|
|
564
|
-
${
|
|
570
|
+
${Q(e, t)}
|
|
565
571
|
</div>
|
|
566
|
-
${
|
|
572
|
+
${ve(e, t)}
|
|
567
573
|
</div>
|
|
568
574
|
` : s}
|
|
569
575
|
${he(e, n)}
|
|
570
576
|
</luzmo-radio-group>
|
|
571
577
|
`;
|
|
572
578
|
}
|
|
573
|
-
function
|
|
574
|
-
let r = new Set(e.selectedValues(t)), i = e.isOtherSelected(t), a = t.options.some((e) => e.description) ? "options options--descriptive" : "options", c =
|
|
579
|
+
function be(e, t, n) {
|
|
580
|
+
let r = new Set(e.selectedValues(t)), i = e.isOtherSelected(t), a = t.options.some((e) => e.description) ? "options options--descriptive" : "options", c = ae(t, e.copy);
|
|
575
581
|
return o`
|
|
576
582
|
${c ? o`<span class="visually-hidden" id="selection-requirement"
|
|
577
583
|
>${c}</span
|
|
@@ -582,12 +588,12 @@ function ye(e, t, n) {
|
|
|
582
588
|
class=${a}
|
|
583
589
|
vertical
|
|
584
590
|
label=${t.title}
|
|
585
|
-
aria-describedby=${
|
|
591
|
+
aria-describedby=${m(c ? "selection-requirement" : void 0)}
|
|
586
592
|
?invalid=${!!n}
|
|
587
593
|
@focusin=${e.handlers.focusIn}
|
|
588
594
|
@focusout=${e.handlers.focusOut}
|
|
589
595
|
>
|
|
590
|
-
${
|
|
596
|
+
${h(t.options, (e) => e.value, (n, i) => o`
|
|
591
597
|
<luzmo-checkbox
|
|
592
598
|
class="numbered-option"
|
|
593
599
|
dir=${e.dir}
|
|
@@ -598,11 +604,11 @@ function ye(e, t, n) {
|
|
|
598
604
|
?checked=${r.has(n.value)}
|
|
599
605
|
?disabled=${e.optionDisabled(t, n, r.has(n.value))}
|
|
600
606
|
?readonly=${e.readonly}
|
|
601
|
-
aria-describedby=${
|
|
607
|
+
aria-describedby=${m(n.disabledReason ? `option-reason-${i}` : void 0)}
|
|
602
608
|
@change=${e.handlers.checkboxChange}
|
|
603
609
|
>
|
|
604
|
-
${
|
|
605
|
-
${
|
|
610
|
+
${Y(e, n, i)}
|
|
611
|
+
${X(n, i)}
|
|
606
612
|
</luzmo-checkbox>
|
|
607
613
|
`)}
|
|
608
614
|
${b(t) ? o`
|
|
@@ -627,15 +633,15 @@ function ye(e, t, n) {
|
|
|
627
633
|
<luzmo-icon
|
|
628
634
|
block
|
|
629
635
|
dir=${e.dir}
|
|
630
|
-
.size=${
|
|
631
|
-
.icon=${
|
|
636
|
+
.size=${K(e.size)}
|
|
637
|
+
.icon=${p}
|
|
632
638
|
></luzmo-icon>
|
|
633
639
|
</span>
|
|
634
640
|
<span class="visually-hidden"
|
|
635
641
|
>${x(t).label || e.copy.other}</span
|
|
636
642
|
>
|
|
637
643
|
</luzmo-checkbox>
|
|
638
|
-
${
|
|
644
|
+
${Q(e, t)}
|
|
639
645
|
</div>
|
|
640
646
|
</div>
|
|
641
647
|
${ge(e, t)}
|
|
@@ -643,8 +649,8 @@ function ye(e, t, n) {
|
|
|
643
649
|
</luzmo-field-group>
|
|
644
650
|
`;
|
|
645
651
|
}
|
|
646
|
-
function
|
|
647
|
-
let n = e.copy, i =
|
|
652
|
+
function xe(e, t) {
|
|
653
|
+
let n = e.copy, i = O(n.progress, {
|
|
648
654
|
current: String(e.step + 1),
|
|
649
655
|
total: String(e.questions.length)
|
|
650
656
|
});
|
|
@@ -675,7 +681,7 @@ function be(e, t) {
|
|
|
675
681
|
block
|
|
676
682
|
dir=${e.dir}
|
|
677
683
|
.size=${r(e.size)}
|
|
678
|
-
.icon=${
|
|
684
|
+
.icon=${f}
|
|
679
685
|
></luzmo-icon>
|
|
680
686
|
</div>
|
|
681
687
|
</luzmo-action-button>
|
|
@@ -688,7 +694,7 @@ function be(e, t) {
|
|
|
688
694
|
quiet
|
|
689
695
|
size=${r(e.size)}
|
|
690
696
|
label=${n.continue}
|
|
691
|
-
?disabled=${
|
|
697
|
+
?disabled=${J(e, t) || q(e)}
|
|
692
698
|
@click=${e.handlers.primary}
|
|
693
699
|
>
|
|
694
700
|
<div slot="icon">
|
|
@@ -696,7 +702,7 @@ function be(e, t) {
|
|
|
696
702
|
block
|
|
697
703
|
dir=${e.dir}
|
|
698
704
|
.size=${r(e.size)}
|
|
699
|
-
.icon=${
|
|
705
|
+
.icon=${ee}
|
|
700
706
|
></luzmo-icon>
|
|
701
707
|
</div>
|
|
702
708
|
</luzmo-action-button>
|
|
@@ -717,11 +723,11 @@ function be(e, t) {
|
|
|
717
723
|
</header>
|
|
718
724
|
`;
|
|
719
725
|
}
|
|
720
|
-
function
|
|
726
|
+
function Se(e, t) {
|
|
721
727
|
let n = e.copy;
|
|
722
728
|
return o`
|
|
723
729
|
<footer class="footer">
|
|
724
|
-
<div class="status">${
|
|
730
|
+
<div class="status">${Z(e, t)}</div>
|
|
725
731
|
<div class="actions">
|
|
726
732
|
${e.hideSkip ? s : o`
|
|
727
733
|
<luzmo-button
|
|
@@ -735,14 +741,14 @@ function xe(e, t) {
|
|
|
735
741
|
>${n.skip}</luzmo-button
|
|
736
742
|
>
|
|
737
743
|
`}
|
|
738
|
-
${
|
|
744
|
+
${q(e) && t.type === "multiple" ? o`
|
|
739
745
|
<luzmo-button
|
|
740
746
|
id="submit-button"
|
|
741
747
|
dir=${e.dir}
|
|
742
748
|
variant="primary"
|
|
743
749
|
treatment="outline"
|
|
744
750
|
size=${r(e.size)}
|
|
745
|
-
?disabled=${
|
|
751
|
+
?disabled=${J(e, t)}
|
|
746
752
|
@click=${e.handlers.primary}
|
|
747
753
|
>${n.submit}</luzmo-button
|
|
748
754
|
>
|
|
@@ -751,7 +757,7 @@ function xe(e, t) {
|
|
|
751
757
|
</footer>
|
|
752
758
|
`;
|
|
753
759
|
}
|
|
754
|
-
function
|
|
760
|
+
function Ce(e) {
|
|
755
761
|
if (e.questions.length === 0) return s;
|
|
756
762
|
if (e.resolved) return me(e);
|
|
757
763
|
let t = e.questions[e.step];
|
|
@@ -763,16 +769,16 @@ function Se(e) {
|
|
|
763
769
|
].filter(Boolean).join(" ") || void 0;
|
|
764
770
|
return o`
|
|
765
771
|
<div class="card" @click=${e.handlers.contentClick}>
|
|
766
|
-
${
|
|
772
|
+
${xe(e, t)}
|
|
767
773
|
<div
|
|
768
774
|
class="body"
|
|
769
775
|
role="group"
|
|
770
776
|
aria-labelledby="question-title"
|
|
771
|
-
aria-describedby=${
|
|
777
|
+
aria-describedby=${m(i)}
|
|
772
778
|
>
|
|
773
|
-
${
|
|
779
|
+
${te(t.id, t.type === "single" ? ye(e, t, n) : be(e, t, n))}
|
|
774
780
|
</div>
|
|
775
|
-
${r ?
|
|
781
|
+
${r ? Se(e, t) : s}
|
|
776
782
|
</div>
|
|
777
783
|
`;
|
|
778
784
|
}
|
|
@@ -784,7 +790,7 @@ var $ = class extends n(e, { validSizes: [
|
|
|
784
790
|
"xl"
|
|
785
791
|
] }) {
|
|
786
792
|
constructor(...e) {
|
|
787
|
-
super(...e), this.questions = [], this.value = {}, this.labels = {}, this.dir = "ltr", this.disabled = !1, this.readonly = !1, this.hideClose = !1, this.hideSkip = !1, this.showChange = !1, this._optionIndicator = "numbers", this._step = 0, this._resolved = !1, this._submitted = !1, this._showError = !1, this.languageResolver = new a(this), this._radioChangeAdvanced = !1, this.multipleChoiceRoving = new i(this, {
|
|
793
|
+
super(...e), this.questions = [], this.value = {}, this.labels = {}, this.dir = "ltr", this.disabled = !1, this.readonly = !1, this.answered = !1, this.hideClose = !1, this.hideSkip = !1, this.showChange = !1, this._optionIndicator = "numbers", this._step = 0, this._resolved = !1, this._submitted = !1, this._showError = !1, this.languageResolver = new a(this), this._radioChangeAdvanced = !1, this.multipleChoiceRoving = new i(this, {
|
|
788
794
|
direction: "vertical",
|
|
789
795
|
elements: () => [...this.shadowRoot?.querySelectorAll("luzmo-field-group#options luzmo-checkbox[data-option-index]") ?? []],
|
|
790
796
|
focusInIndex: (e) => {
|
|
@@ -794,7 +800,7 @@ var $ = class extends n(e, { validSizes: [
|
|
|
794
800
|
isFocusableElement: (e) => !e.disabled,
|
|
795
801
|
listenerScope: () => this.shadowRoot?.querySelector("luzmo-field-group#options")
|
|
796
802
|
}), this.handleKeydown = (e) => {
|
|
797
|
-
if (this.disabled) return;
|
|
803
|
+
if (this.disabled || this.answered) return;
|
|
798
804
|
let t = e.composedPath(), n = this.shadowRoot?.activeElement;
|
|
799
805
|
if (e.key !== "Escape" && this.otherField && (t.includes(this.otherField) || n === this.otherField)) return;
|
|
800
806
|
let r = this.focusedOptionForEvent(e), i = this.currentQuestion;
|
|
@@ -818,7 +824,7 @@ var $ = class extends n(e, { validSizes: [
|
|
|
818
824
|
o.click();
|
|
819
825
|
} else e.key === "Escape" && (e.preventDefault(), !this.disabled && this.cancel());
|
|
820
826
|
}, this.handleKeyup = (e) => {
|
|
821
|
-
if (this.disabled || this.readonly || e.code !== "Space") return;
|
|
827
|
+
if (this.disabled || this.readonly || this.answered || e.code !== "Space") return;
|
|
822
828
|
let t = this.focusedOptionForEvent(e);
|
|
823
829
|
t && !t.hasAttribute("disabled") && (e.preventDefault(), t.click());
|
|
824
830
|
}, this.handleFocusIn = (e) => {
|
|
@@ -908,13 +914,13 @@ var $ = class extends n(e, { validSizes: [
|
|
|
908
914
|
this.removeEventListener("keydown", this.handleKeydown), this.removeEventListener("keyup", this.handleKeyup), this.removeEventListener("focusin", this.handleFocusIn), super.disconnectedCallback();
|
|
909
915
|
}
|
|
910
916
|
focus() {
|
|
911
|
-
this._resolved ? this.moveFocus(this.resolvedTitle) : this.focusOptions();
|
|
917
|
+
this._resolved || this.answered ? this.moveFocus(this.resolvedTitle) : this.focusOptions();
|
|
912
918
|
}
|
|
913
919
|
checkValidity() {
|
|
914
920
|
return this.questions.every((e) => !this.questionInvalid(e));
|
|
915
921
|
}
|
|
916
922
|
submit() {
|
|
917
|
-
this.disabled || this.readonly || this._submitted || this.acceptFlow();
|
|
923
|
+
this.disabled || this.readonly || this.answered || this._submitted || this.acceptFlow();
|
|
918
924
|
}
|
|
919
925
|
reset() {
|
|
920
926
|
this._resolved = !1, this._submitted = !1, this._showError = !1, this._step = 0, this.value = {};
|
|
@@ -925,20 +931,20 @@ var $ = class extends n(e, { validSizes: [
|
|
|
925
931
|
willUpdate(e) {
|
|
926
932
|
if (super.willUpdate(e), e.has("questions") || e.has("value")) {
|
|
927
933
|
if (e.has("questions")) {
|
|
928
|
-
|
|
934
|
+
ie(this.questions);
|
|
929
935
|
let t = (e.get("questions") ?? []).map((e) => e.id), n = this.questions.map((e) => e.id);
|
|
930
936
|
t.join("\0") !== n.join("\0") && (this._step = 0, this._resolved = !1, this._submitted = !1, this._showError = !1);
|
|
931
937
|
}
|
|
932
|
-
let t =
|
|
938
|
+
let t = k(this.questions, this.value);
|
|
933
939
|
w(t, this.value) || (this.value = t);
|
|
934
940
|
}
|
|
935
941
|
e.has("questions") && (this._step = Math.min(this._step, Math.max(0, this.questions.length - 1)));
|
|
936
942
|
}
|
|
937
943
|
updated(e) {
|
|
938
|
-
super.updated(e), (e.has("questions") || e.has("size") || e.has("disabled") || e.has("readonly") || e.has("_step") || e.has("_resolved")) && this.multipleChoiceRoving.clearElementCache();
|
|
944
|
+
super.updated(e), (e.has("questions") || e.has("size") || e.has("disabled") || e.has("readonly") || e.has("answered") || e.has("_step") || e.has("_resolved")) && this.multipleChoiceRoving.clearElementCache();
|
|
939
945
|
}
|
|
940
946
|
render() {
|
|
941
|
-
return
|
|
947
|
+
return Ce(this.renderContext);
|
|
942
948
|
}
|
|
943
949
|
get renderContext() {
|
|
944
950
|
return {
|
|
@@ -946,7 +952,8 @@ var $ = class extends n(e, { validSizes: [
|
|
|
946
952
|
value: this.value,
|
|
947
953
|
copy: this.copy,
|
|
948
954
|
step: this._step,
|
|
949
|
-
resolved: this._resolved,
|
|
955
|
+
resolved: this._resolved || this.answered,
|
|
956
|
+
answered: this.answered,
|
|
950
957
|
submitted: this._submitted,
|
|
951
958
|
showError: this._showError,
|
|
952
959
|
disabled: this.disabled,
|
|
@@ -985,7 +992,7 @@ var $ = class extends n(e, { validSizes: [
|
|
|
985
992
|
};
|
|
986
993
|
}
|
|
987
994
|
get copy() {
|
|
988
|
-
return
|
|
995
|
+
return re(this.labels);
|
|
989
996
|
}
|
|
990
997
|
get currentQuestion() {
|
|
991
998
|
return this.questions[this._step];
|
|
@@ -1035,7 +1042,7 @@ var $ = class extends n(e, { validSizes: [
|
|
|
1035
1042
|
}
|
|
1036
1043
|
acceptFlow() {
|
|
1037
1044
|
let e = this.questions.findIndex((e) => this.questionInvalid(e));
|
|
1038
|
-
e === -1 ? (this._showError = !1, this._resolved = !0, this._submitted = !0, this.emitResult("accept",
|
|
1045
|
+
e === -1 ? (this._showError = !1, this._resolved = !0, this._submitted = !0, this.emitResult("accept", B(this.questions, this.value)), this.updateComplete.then(() => this.focus())) : (this._step = e, this._showError = !0, this.updateComplete.then(() => this.focusOptions()));
|
|
1039
1046
|
}
|
|
1040
1047
|
commitAnswer(e, t, n) {
|
|
1041
1048
|
let r = S(this.value);
|
|
@@ -1087,13 +1094,13 @@ var $ = class extends n(e, { validSizes: [
|
|
|
1087
1094
|
return D(e, this.value);
|
|
1088
1095
|
}
|
|
1089
1096
|
questionError(e) {
|
|
1090
|
-
return
|
|
1097
|
+
return N(e, this.value, this.copy);
|
|
1091
1098
|
}
|
|
1092
1099
|
questionInvalid(e) {
|
|
1093
|
-
return
|
|
1100
|
+
return M(e, this.value);
|
|
1094
1101
|
}
|
|
1095
1102
|
optionDisabled(e, t, n) {
|
|
1096
|
-
return
|
|
1103
|
+
return P(e, t, n, this.value, this.disabled);
|
|
1097
1104
|
}
|
|
1098
1105
|
};
|
|
1099
1106
|
// src/components/question-box/index.ts
|
|
@@ -1104,6 +1111,9 @@ t([l({ attribute: !1 })], $.prototype, "questions", void 0), t([l({ attribute: !
|
|
|
1104
1111
|
type: Boolean,
|
|
1105
1112
|
reflect: !0
|
|
1106
1113
|
})], $.prototype, "readonly", void 0), t([l({
|
|
1114
|
+
type: Boolean,
|
|
1115
|
+
reflect: !0
|
|
1116
|
+
})], $.prototype, "answered", void 0), t([l({
|
|
1107
1117
|
type: Boolean,
|
|
1108
1118
|
reflect: !0,
|
|
1109
1119
|
attribute: "hide-close"
|
|
@@ -1119,4 +1129,4 @@ t([l({ attribute: !1 })], $.prototype, "questions", void 0), t([l({ attribute: !
|
|
|
1119
1129
|
reflect: !0,
|
|
1120
1130
|
attribute: "option-indicator"
|
|
1121
1131
|
})], $.prototype, "optionIndicator", null), t([d()], $.prototype, "_step", void 0), t([d()], $.prototype, "_resolved", void 0), t([d()], $.prototype, "_submitted", void 0), t([d()], $.prototype, "_showError", void 0), t([u("#question-title")], $.prototype, "questionTitle", void 0), t([u("#other-field")], $.prototype, "otherField", void 0), t([u("#options")], $.prototype, "optionsGroup", void 0), t([u("#resolved-title")], $.prototype, "resolvedTitle", void 0), typeof customElements < "u" && !customElements.get("luzmo-question-box") && customElements.define("luzmo-question-box", $);
|
|
1122
|
-
export { v as a,
|
|
1132
|
+
export { v as a, B as i, R as n, _ as o, ue as r, y as s, $ as t };
|