@nldd/design-system 0.29.3 → 0.30.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/custom-elements.json +461 -208
- package/dist/assets/styles/shadow-resets.d.ts +22 -7
- package/dist/assets/styles/shadow-resets.d.ts.map +1 -1
- package/dist/assets/styles/shadow-resets.js +30 -1
- package/dist/assets/styles/shadow-resets.js.map +1 -1
- package/dist/assets/styles/text-wrap.d.ts +20 -4
- package/dist/assets/styles/text-wrap.d.ts.map +1 -1
- package/dist/assets/styles/text-wrap.js +27 -5
- package/dist/assets/styles/text-wrap.js.map +1 -1
- package/dist/cdn/autoloader.js +139 -140
- package/dist/cdn/chunks/{accordion-qIt44RLF.js → accordion-DgR70Lf-.js} +4 -4
- package/dist/cdn/chunks/{accordion-item-Dc6eccrJ.js → accordion-item-BDevWF9t.js} +6 -5
- package/dist/cdn/chunks/{activity-indicator-D3Trvd26.js → activity-indicator-B-iqA8XF.js} +6 -9
- package/dist/cdn/chunks/{admonition-SGAs1_Zu.js → admonition-PKX7ePb3.js} +6 -5
- package/dist/cdn/chunks/{avatar-vY0iiAzq.js → avatar-Bm_cbn5X.js} +6 -6
- package/dist/cdn/chunks/{avatar-group-6fsYuye5.js → avatar-group-5XxwtbbC.js} +15 -15
- package/dist/cdn/chunks/{badge-D2QCPBU6.js → badge-CpxDQfHS.js} +31 -29
- package/dist/cdn/chunks/{banner-N1LY9uhq.js → banner-Ccc9LgDk.js} +8 -8
- package/dist/cdn/chunks/{bar-split-view-CthxhXh8.js → bar-split-view-0yxggCZe.js} +5 -5
- package/dist/cdn/chunks/{blockquote-C-oSxq4b.js → blockquote-CmbDjlPB.js} +32 -31
- package/dist/cdn/chunks/{box-B_NqS9H1.js → box-DQjgR2YI.js} +3 -3
- package/dist/cdn/chunks/{breadcrumbs-v-nEtdOp.js → breadcrumbs-C8yzb9pA.js} +6 -6
- package/dist/cdn/chunks/{button-DHLts-vo.js → button-D_KfPyHS.js} +113 -90
- package/dist/cdn/chunks/{button-bar-CPLhSKNo.js → button-bar-f-qcw_zA.js} +3 -3
- package/dist/cdn/chunks/{button-group-BIt4ERX1.js → button-group-Dq3q44jB.js} +2 -2
- package/dist/cdn/chunks/{card--GUIZiTn.js → card-CDT7nkKG.js} +4 -4
- package/dist/cdn/chunks/{cell-Ch6VVWYl.js → cell-B7ksoCyd.js} +6 -6
- package/dist/cdn/chunks/{checkbox-BNI1xGry.js → checkbox-CUReiYVg.js} +5 -5
- package/dist/cdn/chunks/{checkbox-field-BPtTyzq-.js → checkbox-field-CkQ8WLSq.js} +8 -8
- package/dist/cdn/chunks/{checkbox-group-DYElCUgt.js → checkbox-group-BpDzGuFk.js} +3 -3
- package/dist/cdn/chunks/{class-map-DwD-ilOn.js → class-map-BQWXee9F.js} +1 -1
- package/dist/cdn/chunks/{code-editor-DEJ-KbPY.js → code-editor-CwLcukqn.js} +15 -5
- package/dist/cdn/chunks/{code-viewer-CIiRvhkZ.js → code-viewer-CvSF5fyg.js} +37 -10
- package/dist/cdn/chunks/{codemirror-input-y7sZIE85.js → codemirror-input-CcaHTu9u.js} +5 -5
- package/dist/cdn/chunks/{collection-Cb7Ej5Ua.js → collection-DqqkdrVS.js} +8 -8
- package/dist/cdn/chunks/{combo-box-CDqddeN5.js → combo-box-BQ9jS1fP.js} +19 -10
- package/dist/cdn/chunks/{container-DZfSFaA9.js → container-BC5PiMvR.js} +83 -82
- package/dist/cdn/chunks/{custom-element-aLDsY95V.js → custom-element-DGdiDiuN.js} +1 -1
- package/dist/cdn/chunks/{date-field-C4xutZpO.js → date-field-Dmli_GlI.js} +12 -12
- package/dist/cdn/chunks/{date-picker-CtdRwpu7.js → date-picker-BCHBh6vd.js} +15 -17
- package/dist/cdn/chunks/{decorate-D28R7mwV.js → decorate-D2snH_th.js} +1 -1
- package/dist/cdn/chunks/described-by-mixin-Doan1yj6.js +106 -0
- package/dist/cdn/chunks/{description-cell-BYgUCAev.js → description-cell-QL0CUcxH.js} +7 -7
- package/dist/cdn/chunks/{dev-checks-C6cMs71h.js → dev-checks-BQsZ10CZ.js} +31 -11
- package/dist/cdn/chunks/{directive-helpers-B-J-xMIs.js → directive-helpers-BtIbEaBv.js} +1 -1
- package/dist/cdn/chunks/{dist-CHuLNwDW.js → dist-0sEOO4c9.js} +3 -3
- package/dist/cdn/chunks/{dist-Bo5l49Uq.js → dist-BX-aE56q.js} +1 -1
- package/dist/cdn/chunks/{dist-tBRozql6.js → dist-CJ-hLN4o.js} +2 -2
- package/dist/cdn/chunks/{dist-CSUsf3Jq.js → dist-CUCs0edm.js} +2 -2
- package/dist/cdn/chunks/{dist-BxjZtyyd.js → dist-CeovKDYB.js} +3 -3
- package/dist/cdn/chunks/{dist-Bnz9cU2A.js → dist-CoM5yDHD.js} +1 -1
- package/dist/cdn/chunks/{dist-Dr-gFR08.js → dist-DM49yEzE.js} +2 -2
- package/dist/cdn/chunks/{dist-DKy1SqZx.js → dist-DizTxYTi.js} +1 -1
- package/dist/cdn/chunks/{dist-CIFs0Nqx.js → dist-Dj0pXI2B.js} +1 -1
- package/dist/cdn/chunks/{dist-CON6NKtQ.js → dist-Dtn2rsM6.js} +1 -1
- package/dist/cdn/chunks/{dist-BpXie73W.js → dist-QheJD595.js} +1 -1
- package/dist/cdn/chunks/{divider-CTKk-YoH.js → divider-D8o0JPE2.js} +2 -2
- package/dist/cdn/chunks/{document-tab-bar-DY_eja8b.js → document-tab-bar-BX6UhFBl.js} +10 -13
- package/dist/cdn/chunks/{dropdown-CruRvMW9.js → dropdown-afozwXVW.js} +5 -5
- package/dist/cdn/chunks/{file-field-D9iNPYKY.js → file-field-BKhUYcHf.js} +108 -106
- package/dist/cdn/chunks/{form-sQRdMSb4.js → form-DnZIiX9b.js} +1 -1
- package/dist/cdn/chunks/{form-actions-BuKwcAbF.js → form-actions-Ddg9vIVq.js} +2 -2
- package/dist/cdn/chunks/{form-associated-mixin-C1rOeFAh.js → form-associated-mixin-BMQQpMlL.js} +2 -2
- package/dist/cdn/chunks/form-field-DDBYuAl_.js +405 -0
- package/dist/cdn/chunks/form-field.i18n-D-3yEP-C.js +6 -0
- package/dist/cdn/chunks/form-section-Co0TM35-.js +78 -0
- package/dist/cdn/chunks/{full-bleed-section-DM0pv5Xt.js → full-bleed-section-DD8ibmsa.js} +3 -3
- package/dist/cdn/chunks/{hero-C8zDTYdo.js → hero-BYrY2MZc.js} +7 -7
- package/dist/cdn/chunks/{icon-CgFQSvEf.js → icon-BzeHXcdi.js} +4 -2
- package/dist/cdn/chunks/{icon-button-ya52TYkO.js → icon-button-BErQf42w.js} +65 -62
- package/dist/cdn/chunks/{icon-cell-DbqWtIl9.js → icon-cell-DGIMXKxK.js} +5 -5
- package/dist/cdn/chunks/{identity-DPerpCOw.js → identity-Cq-WnU6u.js} +30 -27
- package/dist/cdn/chunks/{if-defined-D5G_Kkpm.js → if-defined-CuY6t6gH.js} +1 -1
- package/dist/cdn/chunks/{image-eyP-R4JG.js → image-BjjyqV0V.js} +23 -22
- package/dist/cdn/chunks/{inline-dialog-z7jzLiRx.js → inline-dialog-Bk2G7f5r.js} +24 -23
- package/dist/cdn/chunks/{just-in-time-education-2O-UcSq5.js → just-in-time-education-Dxh5DNCy.js} +5 -5
- package/dist/cdn/chunks/{kanban-Dz3KcfW2.js → kanban-BvmtB9D9.js} +7 -8
- package/dist/cdn/chunks/{kanban-column-DQeIGacj.js → kanban-column-CJ2g7pgA.js} +9 -11
- package/dist/cdn/chunks/{keyboard-shortcut-CUxShTHr.js → keyboard-shortcut-BV5DFQtT.js} +3 -3
- package/dist/cdn/chunks/{languages-D_vPs_jY.js → languages-DJjHEjGl.js} +12 -12
- package/dist/cdn/chunks/{link-emVjLq3i.js → link-BcukwT5Y.js} +6 -6
- package/dist/cdn/chunks/{link-group-Cygt2XBP.js → link-group-Ci1q3uEd.js} +2 -2
- package/dist/cdn/chunks/{list-TKhlBlV_.js → list-CFFHWUSC.js} +9 -9
- package/dist/cdn/chunks/{list-item-D2On2ug1.js → list-item-Bg1NyOXd.js} +12 -13
- package/dist/cdn/chunks/{list-item-segment-XERq2wPj.js → list-item-segment-DJ8pk08-.js} +4 -4
- package/dist/cdn/chunks/{menu-b2UFN5q8.js → menu-BEjqhn1-.js} +10 -10
- package/dist/cdn/chunks/{menu-bar-BJ6PjqmT.js → menu-bar-DkjXy-TE.js} +6 -6
- package/dist/cdn/chunks/{menu-bar-item-kRxuNXj5.js → menu-bar-item-3cJS29Ey.js} +6 -6
- package/dist/cdn/chunks/{menu-divider-Cpa6JbxR.js → menu-divider-CYmEimsb.js} +3 -3
- package/dist/cdn/chunks/{menu-group-DrwvnJ1C.js → menu-group-ggwAcgis.js} +4 -4
- package/dist/cdn/chunks/{menu-item-D7CoiS88.js → menu-item-BzH9H87h.js} +4 -4
- package/dist/cdn/chunks/{menu.template-BAqqSWm-.js → menu.template-PG82-P20.js} +6 -6
- package/dist/cdn/chunks/{modal-dialog-DOZuUmOi.js → modal-dialog-Bu7ETELf.js} +4 -4
- package/dist/cdn/chunks/{multi-line-text-field-CB-rGXUh.js → multi-line-text-field-CQTKNBN7.js} +6 -6
- package/dist/cdn/chunks/{navigation-split-view-Bc5AUAmC.js → navigation-split-view-elMoUjHh.js} +7 -13
- package/dist/cdn/chunks/{nl.generated-B194RR-y.js → nl.generated-Lu29XEF3.js} +1 -1
- package/dist/cdn/chunks/{notification-Cs-f2gLW.js → notification-DCjXGfbY.js} +7 -7
- package/dist/cdn/chunks/{number-field-DqQOrvOA.js → number-field-BUQUcG--.js} +8 -8
- package/dist/cdn/chunks/{one-half-one-half-section-BqiqGK-m.js → one-half-one-half-section-DiGkeUVr.js} +3 -3
- package/dist/cdn/chunks/{one-third-two-thirds-section-3LPjeo2n.js → one-third-two-thirds-section-q_AP4qIJ.js} +3 -3
- package/dist/cdn/chunks/{one-time-code-field-CZxm-CQt.js → one-time-code-field-BybS_l6h.js} +9 -10
- package/dist/cdn/chunks/{overflow-menu-DkyYNSg3.js → overflow-menu-Duey_XJs.js} +1 -1
- package/dist/cdn/chunks/{page-DYzfOL9K.js → page-BrIeWp1b.js} +46 -45
- package/dist/cdn/chunks/{page-footer-ChNrnN3t.js → page-footer-DPQg9Qbw.js} +5 -5
- package/dist/cdn/chunks/{page-section-mixin-7d4JVDUI.js → page-section-mixin-B8FbeXaK.js} +3 -3
- package/dist/cdn/chunks/{pagination-CYl78pZT.js → pagination-CfLJwflH.js} +37 -36
- package/dist/cdn/chunks/{password-field-Bg1lsru6.js → password-field-CmoopbNF.js} +36 -35
- package/dist/cdn/chunks/{popover-jP9P86r3.js → popover-CPAR4N_a.js} +5 -5
- package/dist/cdn/chunks/{progress-bar-C08-J2b3.js → progress-bar-vKGXvxfe.js} +10 -11
- package/dist/cdn/chunks/{progress-circle-_NDiM4Vw.js → progress-circle-dweisHzt.js} +8 -8
- package/dist/cdn/chunks/{radio-button-OdrY0lUT.js → radio-button-DE1K49_2.js} +4 -4
- package/dist/cdn/chunks/{radio-button-field-C8XD59fa.js → radio-button-field-DCrWiVoA.js} +7 -7
- package/dist/cdn/chunks/{radio-button-group-C7ntRQO7.js → radio-button-group-oLP_1cGy.js} +3 -3
- package/dist/cdn/chunks/{render-marked-Cdt8DyWh.js → render-marked-BE3kBc1D.js} +1 -1
- package/dist/cdn/chunks/{reorder-handle-cell-C6q1_RaE.js → reorder-handle-cell-COCN6knt.js} +4 -4
- package/dist/cdn/chunks/{reorder-handle-mixin-mJLOiHhZ.js → reorder-handle-mixin-CG-KhmuT.js} +2 -2
- package/dist/cdn/chunks/{repeat-DLQZAi6Q.js → repeat-D69H_dsv.js} +2 -2
- package/dist/cdn/chunks/{rich-text-CR5iRjCn.js → rich-text-jEyIU58i.js} +3 -3
- package/dist/cdn/chunks/{row-header-mixin-BUn7AC4_.js → row-header-mixin-BejxhOCs.js} +2 -2
- package/dist/cdn/chunks/{scroll-fade-B7Gy3Bmm.js → scroll-fade-Cae9xqXr.js} +2 -2
- package/dist/cdn/chunks/{search-field-B62sYRtl.js → search-field-B8woxFh-.js} +40 -37
- package/dist/cdn/chunks/{segmented-control-VU38x7xX.js → segmented-control-DbOi6Wk6.js} +7 -7
- package/dist/cdn/chunks/{shadow-resets-uUyDr3ia.js → shadow-resets-CNmJbdJw.js} +26 -11
- package/dist/cdn/chunks/{sheet-jMZkPdlu.js → sheet-bK663_K4.js} +3 -3
- package/dist/cdn/chunks/{shell-2Wa4Waez.js → shell-DLu1fHOH.js} +3 -3
- package/dist/cdn/chunks/{side-by-side-split-view-v6riuRqk.js → side-by-side-split-view-vNhUmTiE.js} +4 -4
- package/dist/cdn/chunks/{sidebar-section-D3Zy_9y1.js → sidebar-section-CoE5F_h5.js} +8 -8
- package/dist/cdn/chunks/{simple-section-kCKeHqmt.js → simple-section-1v7a_ZgI.js} +3 -3
- package/dist/cdn/chunks/{skip-link-BeoObN4D.js → skip-link-C6B6mMkA.js} +5 -5
- package/dist/cdn/chunks/{slider-BSALXKxX.js → slider-BT-q6SP2.js} +12 -16
- package/dist/cdn/chunks/{spacer-CXXmb3su.js → spacer-DlFn3NtV.js} +2 -2
- package/dist/cdn/chunks/{spacer-cell-BV9uv10a.js → spacer-cell-Dy_twSDQ.js} +4 -4
- package/dist/cdn/chunks/{split-button-DE4NaJZs.js → split-button-URHM5eTx.js} +7 -7
- package/dist/cdn/chunks/{split-view-divider-BqLSYIwg.js → split-view-divider-DeLyeDBx.js} +2 -2
- package/dist/cdn/chunks/{stacked-split-view-CPCCQhHV.js → stacked-split-view-D0kiQJmL.js} +4 -4
- package/dist/cdn/chunks/{static-html-DtH5-I4g.js → static-html-CAKb1-Ht.js} +1 -1
- package/dist/cdn/chunks/{status-bar-CBi4aCqy.js → status-bar-Bov-LrPy.js} +4 -4
- package/dist/cdn/chunks/{step-bar-BFzioHLn.js → step-bar-BLtsl_S_.js} +6 -6
- package/dist/cdn/chunks/{step-cell-fNIdX1cI.js → step-cell-cxM7vhtH.js} +5 -5
- package/dist/cdn/chunks/{stepper-CgmgV0qw.js → stepper-DeIcLT7G.js} +7 -7
- package/dist/cdn/chunks/{style-map-DhI1E0EI.js → style-map-CQX4CmTz.js} +1 -1
- package/dist/cdn/chunks/{swatch-picker-BYb0cq8H.js → swatch-picker-A7AU6Agu.js} +6 -6
- package/dist/cdn/chunks/{switch-fRxqZBKc.js → switch-D0UPsKws.js} +5 -5
- package/dist/cdn/chunks/{switch-field-BH6xhWUz.js → switch-field-D63lc5C0.js} +7 -7
- package/dist/cdn/chunks/{tab-bar-B66obS2x.js → tab-bar-CzGSRfKd.js} +8 -8
- package/dist/cdn/chunks/{table-s8GDKuuW.js → table-DfunY2Dn.js} +5 -5
- package/dist/cdn/chunks/{tag-TE8mlX1U.js → tag-DSWjjDBo.js} +5 -5
- package/dist/cdn/chunks/{term-Cm9BrUtJ.js → term-Bk9cdlCz.js} +12 -12
- package/dist/cdn/chunks/{text-DEk52Hq2.js → text-CDBiVulh.js} +4 -4
- package/dist/cdn/chunks/{text-cell-DxzojZsc.js → text-cell-DUOJAXZo.js} +40 -37
- package/dist/cdn/chunks/{text-editor-C_8jEhF2.js → text-editor-BIbYF0AB.js} +22 -12
- package/dist/cdn/chunks/{text-field-BgPlCLFl.js → text-field-CAnQNcXB.js} +6 -6
- package/dist/cdn/chunks/{text-wrap-DjzB16-4.js → text-wrap-COu7AY91.js} +13 -5
- package/dist/cdn/chunks/{time-field-Sde0_8NH.js → time-field-xriXgFMl.js} +14 -14
- package/dist/cdn/chunks/{time-picker-CZbLW9ap.js → time-picker-D3_KbYUW.js} +6 -6
- package/dist/cdn/chunks/{title-v-FXk0hs.js → title-HPn4c-s5.js} +5 -5
- package/dist/cdn/chunks/{title-cell-Bv9b6G_p.js → title-cell-BXMZkbXf.js} +51 -48
- package/dist/cdn/chunks/{toggle-button-DWlS9Rbg.js → toggle-button-DY22KEwY.js} +72 -56
- package/dist/cdn/chunks/{toggle-button-group-CetB0Cio.js → toggle-button-group-DsjZofEG.js} +2 -2
- package/dist/cdn/chunks/{token-BXJXjQwc.js → token-DwT2i71b.js} +5 -5
- package/dist/cdn/chunks/{token-field-CsxYfu8b.js → token-field-CQxSARGi.js} +11 -11
- package/dist/cdn/chunks/{toolbar-CUWVCKM6.js → toolbar-CaDvhCqm.js} +69 -68
- package/dist/cdn/chunks/{toolbar-item-BxzbSJdv.js → toolbar-item-BDl4ys-w.js} +3 -3
- package/dist/cdn/chunks/{toolbar-title-C4qJ_fkM.js → toolbar-title-yGR8Hzhp.js} +4 -4
- package/dist/cdn/chunks/{toolbar.styles-D9FuZFnd.js → toolbar.styles-DlyfZkRq.js} +3 -3
- package/dist/cdn/chunks/{tooltip-D5XT5lRe.js → tooltip-BDiYghAz.js} +5 -5
- package/dist/cdn/chunks/{top-navigation-bar-C3azLUd1.js → top-navigation-bar-ibsjezN_.js} +18 -18
- package/dist/cdn/chunks/{top-title-bar-D1m-dREA.js → top-title-bar-BKdwEZfj.js} +6 -6
- package/dist/cdn/chunks/{two-thirds-one-third-section-D3VEGv6P.js → two-thirds-one-third-section-DmumCsGo.js} +3 -3
- package/dist/cdn/chunks/{validation-list-D7tDyaoK.js → validation-list-CXcJfvOJ.js} +61 -49
- package/dist/cdn/chunks/{visibility-mixin-D2VzUDfE.js → visibility-mixin-C7s59UlL.js} +2 -2
- package/dist/cdn/chunks/{visually-hidden-CSYlyubF.js → visually-hidden-CMzKHcSc.js} +2 -2
- package/dist/cdn/chunks/{window-6IQfu4dU.js → window-CSNx5wt1.js} +4 -4
- package/dist/cdn/chunks/{with-translations-Dr6Z41n9.js → with-translations-0oyNXfdD.js} +3 -3
- package/dist/components/actions/button/button.styles.d.ts.map +1 -1
- package/dist/components/actions/button/button.styles.js +26 -7
- package/dist/components/actions/button/button.styles.js.map +1 -1
- package/dist/components/actions/button/button.template.d.ts.map +1 -1
- package/dist/components/actions/button/button.template.js +7 -5
- package/dist/components/actions/button/button.template.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.styles.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.styles.js +4 -2
- package/dist/components/actions/icon-button/icon-button.styles.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.template.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.template.js +4 -2
- package/dist/components/actions/icon-button/icon-button.template.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.template.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.template.js +2 -1
- package/dist/components/actions/toolbar/toolbar.template.js.map +1 -1
- package/dist/components/content/accordion/accordion-item.styles.d.ts.map +1 -1
- package/dist/components/content/accordion/accordion-item.styles.js +1 -0
- package/dist/components/content/accordion/accordion-item.styles.js.map +1 -1
- package/dist/components/content/admonition/admonition.styles.d.ts.map +1 -1
- package/dist/components/content/admonition/admonition.styles.js +1 -0
- package/dist/components/content/admonition/admonition.styles.js.map +1 -1
- package/dist/components/content/blockquote/blockquote.template.d.ts.map +1 -1
- package/dist/components/content/blockquote/blockquote.template.js +2 -1
- package/dist/components/content/blockquote/blockquote.template.js.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.styles.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.styles.js +30 -3
- package/dist/components/content/code-viewer/code-viewer.styles.js.map +1 -1
- package/dist/components/content/icon/icon-aliases.d.ts.map +1 -1
- package/dist/components/content/icon/icon-aliases.js +4 -0
- package/dist/components/content/icon/icon-aliases.js.map +1 -1
- package/dist/components/content/identity/identity.d.ts +8 -5
- package/dist/components/content/identity/identity.d.ts.map +1 -1
- package/dist/components/content/identity/identity.js +8 -5
- package/dist/components/content/identity/identity.js.map +1 -1
- package/dist/components/content/identity/identity.styles.d.ts.map +1 -1
- package/dist/components/content/identity/identity.styles.js +4 -1
- package/dist/components/content/identity/identity.styles.js.map +1 -1
- package/dist/components/content/image/image.template.d.ts.map +1 -1
- package/dist/components/content/image/image.template.js +9 -8
- package/dist/components/content/image/image.template.js.map +1 -1
- package/dist/components/content/rich-text/rich-text.d.ts +4 -2
- package/dist/components/content/rich-text/rich-text.d.ts.map +1 -1
- package/dist/components/content/rich-text/rich-text.js +4 -2
- package/dist/components/content/rich-text/rich-text.js.map +1 -1
- package/dist/components/content/text/text.d.ts +2 -0
- package/dist/components/content/text/text.d.ts.map +1 -1
- package/dist/components/content/text/text.js +2 -0
- package/dist/components/content/text/text.js.map +1 -1
- package/dist/components/forms/form-field/form-field.d.ts +138 -73
- package/dist/components/forms/form-field/form-field.d.ts.map +1 -1
- package/dist/components/forms/form-field/form-field.i18n.d.ts +1 -0
- package/dist/components/forms/form-field/form-field.i18n.d.ts.map +1 -1
- package/dist/components/forms/form-field/form-field.i18n.js +2 -0
- package/dist/components/forms/form-field/form-field.i18n.js.map +1 -1
- package/dist/components/forms/form-field/form-field.js +317 -149
- package/dist/components/forms/form-field/form-field.js.map +1 -1
- package/dist/components/forms/form-field/form-field.styles.d.ts +0 -1
- package/dist/components/forms/form-field/form-field.styles.d.ts.map +1 -1
- package/dist/components/forms/form-field/form-field.styles.js +18 -97
- package/dist/components/forms/form-field/form-field.styles.js.map +1 -1
- package/dist/components/forms/form-field/form-field.template.d.ts +0 -2
- package/dist/components/forms/form-field/form-field.template.d.ts.map +1 -1
- package/dist/components/forms/form-field/form-field.template.js +22 -15
- package/dist/components/forms/form-field/form-field.template.js.map +1 -1
- package/dist/components/forms/form-section/form-section.d.ts +40 -16
- package/dist/components/forms/form-section/form-section.d.ts.map +1 -1
- package/dist/components/forms/form-section/form-section.js +47 -183
- package/dist/components/forms/form-section/form-section.js.map +1 -1
- package/dist/components/forms/form-section/form-section.styles.d.ts +2 -0
- package/dist/components/forms/form-section/form-section.styles.d.ts.map +1 -0
- package/dist/components/forms/form-section/form-section.styles.js +44 -0
- package/dist/components/forms/form-section/form-section.styles.js.map +1 -0
- package/dist/components/forms/form-section/form-section.template.d.ts +4 -0
- package/dist/components/forms/form-section/form-section.template.d.ts.map +1 -0
- package/dist/components/forms/form-section/form-section.template.js +19 -0
- package/dist/components/forms/form-section/form-section.template.js.map +1 -0
- package/dist/components/forms/validation-list/validation-list.d.ts +36 -6
- package/dist/components/forms/validation-list/validation-list.d.ts.map +1 -1
- package/dist/components/forms/validation-list/validation-list.js +75 -15
- package/dist/components/forms/validation-list/validation-list.js.map +1 -1
- package/dist/components/forms/validation-list/validation-list.template.d.ts +1 -1
- package/dist/components/forms/validation-list/validation-list.template.d.ts.map +1 -1
- package/dist/components/forms/validation-list/validation-list.template.js +2 -2
- package/dist/components/forms/validation-list/validation-list.template.js.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.styles.d.ts.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.styles.js +10 -0
- package/dist/components/inputs/code-editor/code-editor.styles.js.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.styles.d.ts.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.styles.js +10 -1
- package/dist/components/inputs/combo-box/combo-box.styles.js.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.template.d.ts.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.template.js +4 -6
- package/dist/components/inputs/date-picker/date-picker.template.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.styles.js +3 -2
- package/dist/components/inputs/file-field/file-field.styles.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.template.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.template.js +8 -8
- package/dist/components/inputs/file-field/file-field.template.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.truncate.d.ts +4 -3
- package/dist/components/inputs/file-field/file-field.truncate.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.truncate.js +8 -5
- package/dist/components/inputs/file-field/file-field.truncate.js.map +1 -1
- package/dist/components/inputs/one-time-code-field/one-time-code-field.template.js +1 -1
- package/dist/components/inputs/one-time-code-field/one-time-code-field.template.js.map +1 -1
- package/dist/components/inputs/password-field/password-field.template.d.ts.map +1 -1
- package/dist/components/inputs/password-field/password-field.template.js +2 -1
- package/dist/components/inputs/password-field/password-field.template.js.map +1 -1
- package/dist/components/inputs/search-field/search-field.d.ts +3 -0
- package/dist/components/inputs/search-field/search-field.d.ts.map +1 -1
- package/dist/components/inputs/search-field/search-field.js +7 -6
- package/dist/components/inputs/search-field/search-field.js.map +1 -1
- package/dist/components/inputs/slider/slider.template.js +2 -2
- package/dist/components/inputs/slider/slider.template.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.mentions.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.mentions.js +2 -1
- package/dist/components/inputs/text-editor/text-editor.mentions.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.styles.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.styles.js +10 -0
- package/dist/components/inputs/text-editor/text-editor.styles.js.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.styles.d.ts.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.styles.js +18 -3
- package/dist/components/inputs/toggle-button/toggle-button.styles.js.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.template.d.ts.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.template.js +7 -3
- package/dist/components/inputs/toggle-button/toggle-button.template.js.map +1 -1
- package/dist/components/layout/container/container.template.d.ts.map +1 -1
- package/dist/components/layout/container/container.template.js +2 -1
- package/dist/components/layout/container/container.template.js.map +1 -1
- package/dist/components/layout/kanban/kanban-column.template.d.ts.map +1 -1
- package/dist/components/layout/kanban/kanban-column.template.js +5 -7
- package/dist/components/layout/kanban/kanban-column.template.js.map +1 -1
- package/dist/components/layout/kanban/kanban.template.d.ts.map +1 -1
- package/dist/components/layout/kanban/kanban.template.js +2 -3
- package/dist/components/layout/kanban/kanban.template.js.map +1 -1
- package/dist/components/layout/page/page.template.d.ts.map +1 -1
- package/dist/components/layout/page/page.template.js +3 -2
- package/dist/components/layout/page/page.template.js.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts +11 -0
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js +11 -0
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.template.js +2 -2
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.template.js.map +1 -1
- package/dist/components/lists-and-tables/cells/description-cell/description-cell.d.ts +3 -2
- package/dist/components/lists-and-tables/cells/description-cell/description-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/description-cell/description-cell.js +3 -2
- package/dist/components/lists-and-tables/cells/description-cell/description-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.d.ts +1 -0
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.js +1 -0
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.d.ts +13 -13
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.js +13 -13
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.styles.js +4 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.d.ts +8 -4
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.js +8 -4
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.styles.js +4 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.template.js +7 -8
- package/dist/components/lists-and-tables/list-item/list-item.template.js.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.template.js +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.template.js.map +1 -1
- package/dist/components/navigation/pagination/pagination.template.d.ts.map +1 -1
- package/dist/components/navigation/pagination/pagination.template.js +3 -2
- package/dist/components/navigation/pagination/pagination.template.js.map +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.template.d.ts.map +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.template.js +2 -3
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.template.js.map +1 -1
- package/dist/components/status-and-feedback/badge/badge.template.d.ts.map +1 -1
- package/dist/components/status-and-feedback/badge/badge.template.js +3 -7
- package/dist/components/status-and-feedback/badge/badge.template.js.map +1 -1
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.template.d.ts.map +1 -1
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.template.js +3 -4
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.template.js.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.template.d.ts.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.template.js +2 -3
- package/dist/components/status-and-feedback/progress-bar/progress-bar.template.js.map +1 -1
- package/dist/components/status-and-feedback/step-bar/step-bar.d.ts +1 -1
- package/dist/components/status-and-feedback/step-bar/step-bar.js +1 -1
- package/dist/css/form.css +14 -0
- package/dist/css/global-open-font.css +0 -1
- package/dist/css/global.css +0 -1
- package/dist/css/rich-text.css +16 -4
- package/dist/css/text.css +3 -1
- package/dist/css/title.css +3 -1
- package/dist/css/variables.css +5 -0
- package/dist/nldd.min.js +1905 -1798
- package/dist/translations/en-US.d.ts.map +1 -1
- package/dist/translations/en-US.js +1 -0
- package/dist/translations/en-US.js.map +1 -1
- package/dist/translations/fy.d.ts.map +1 -1
- package/dist/translations/fy.js +1 -0
- package/dist/translations/fy.js.map +1 -1
- package/dist/translations/nl.generated.d.ts +1 -0
- package/dist/translations/nl.generated.d.ts.map +1 -1
- package/dist/translations/pap-AW.d.ts.map +1 -1
- package/dist/translations/pap-AW.js +1 -0
- package/dist/translations/pap-AW.js.map +1 -1
- package/dist/translations/pap-CW.d.ts.map +1 -1
- package/dist/translations/pap-CW.js +1 -0
- package/dist/translations/pap-CW.js.map +1 -1
- package/dist/types/react.d.ts +18 -23
- package/dist/types/vue.d.ts +77 -82
- package/dist/utilities/autoloader.generated.d.ts.map +1 -1
- package/dist/utilities/autoloader.generated.js +0 -1
- package/dist/utilities/autoloader.generated.js.map +1 -1
- package/dist/utilities/described-by-mixin.d.ts +36 -1
- package/dist/utilities/described-by-mixin.d.ts.map +1 -1
- package/dist/utilities/described-by-mixin.js +132 -8
- package/dist/utilities/described-by-mixin.js.map +1 -1
- package/dist/utilities/dev-rules.generated.d.ts.map +1 -1
- package/dist/utilities/dev-rules.generated.js +32 -13
- package/dist/utilities/dev-rules.generated.js.map +1 -1
- package/dist/utilities/file-name-breaks.d.ts +13 -0
- package/dist/utilities/file-name-breaks.d.ts.map +1 -0
- package/dist/utilities/file-name-breaks.js +27 -0
- package/dist/utilities/file-name-breaks.js.map +1 -0
- package/dist/utilities/same-items.d.ts +10 -0
- package/dist/utilities/same-items.d.ts.map +1 -0
- package/dist/utilities/same-items.js +14 -0
- package/dist/utilities/same-items.js.map +1 -0
- package/lint/data.generated.json +1 -1
- package/lint/fix.js +49 -6
- package/lint/rule-compiler.js +7 -3
- package/lint/rule.schema.json +12 -0
- package/package.json +2 -1
- package/dist/cdn/chunks/described-by-mixin-k3KNxaZ2.js +0 -62
- package/dist/cdn/chunks/form-field-BF-6cws6.js +0 -434
- package/dist/cdn/chunks/form-field.i18n-B-UZduXL.js +0 -3
- package/dist/cdn/chunks/form-section-Cp9xiFew.js +0 -64
- package/dist/css/form-section.css +0 -104
|
@@ -5,43 +5,63 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
|
-
* Nederlandse Digitale Dienst Form Field
|
|
8
|
+
* Nederlandse Digitale Dienst Form Field Component (Lit + TypeScript)
|
|
9
9
|
*
|
|
10
10
|
* A field around one input: its label, supporting label, optional badge,
|
|
11
11
|
* validation and help text. It finds the input among its children, hands it
|
|
12
12
|
* the label as its accessible name and gives it an id, so you write no `for`
|
|
13
|
-
* or `id` yourself.
|
|
14
|
-
*
|
|
15
|
-
* the
|
|
16
|
-
*
|
|
17
|
-
*
|
|
13
|
+
* or `id` yourself. An input that is defined later, as the autoloader does,
|
|
14
|
+
* or that appears later inside a wrapper, is found when it arrives. The input
|
|
15
|
+
* is the first one it finds, leaving out what sits in an nldd-toolbar inside
|
|
16
|
+
* the field: a toolbar works on the field, such as the formatting bar above an
|
|
17
|
+
* nldd-text-editor, and is never the field itself. A native `for` cannot cross
|
|
18
|
+
* a shadow boundary, so a click on the label focuses the input from script.
|
|
18
19
|
*
|
|
19
20
|
* Mark the optional fields with `optional`, not the required ones; the design
|
|
20
21
|
* guidelines say why. Put the requirements on a value in an
|
|
21
22
|
* nldd-validation-list inside the same field. What only your server knows,
|
|
22
23
|
* such as a password found in a breach, the app names in `unmet` on the input
|
|
23
|
-
* itself: see nldd-validation-list. The field hands the list its input and
|
|
24
|
-
* the list
|
|
24
|
+
* itself: see nldd-validation-list. The field hands the list its input, and
|
|
25
|
+
* the list adds its items on screen to the accessible description of that
|
|
26
|
+
* input itself. A list with a `for` of its own describes the control it names
|
|
27
|
+
* instead. The list is a direct child of the field, also when the input sits in
|
|
28
|
+
* a wrapper: a list deeper down is not the field's, and the field does not
|
|
29
|
+
* touch it.
|
|
30
|
+
*
|
|
31
|
+
* Plain help text goes in `help-text`. Help text with more in it, such as a
|
|
32
|
+
* link, goes in an nldd-text in the `help-text` slot. That nldd-text takes the
|
|
33
|
+
* look of help text, as the attribute does, so every help text looks the same:
|
|
34
|
+
* a size, color or weight of its own does nothing there.
|
|
35
|
+
*
|
|
36
|
+
* A field is about one control. A question that takes more than one, such as
|
|
37
|
+
* a date in three fields or a radio group with an "Anders" text field, is a
|
|
38
|
+
* `group`: the field is then the group, named by its label, and describes
|
|
39
|
+
* itself rather than its first control. More than one question are more
|
|
40
|
+
* fields.
|
|
41
|
+
*
|
|
42
|
+
* The accessible name is the label, followed by "optioneel" when the field is
|
|
43
|
+
* `optional`. The accessible description follows the order on screen: the
|
|
44
|
+
* supporting label, then what is wrong, then the help text, from the slot or
|
|
45
|
+
* `help-text`. The supporting label and `help-text` are text in the field
|
|
46
|
+
* itself. A control that carries its own role, such as a radio group or a
|
|
47
|
+
* native input, and a field that is a `group`, can only take text as
|
|
48
|
+
* `aria-description`, which a browser reads only while no element describes
|
|
49
|
+
* it: not while an error shows, and not beside help text in the slot. Put the
|
|
50
|
+
* supporting label in that help text then.
|
|
25
51
|
*
|
|
26
52
|
* @element nldd-form-field
|
|
27
53
|
* @keywords veld, label
|
|
28
54
|
*
|
|
29
55
|
* @attr {'top'|'right'|'left'} label-alignment - 'top' (default) | 'right' | 'left'. A value of its own wins over the one of a wrapping nldd-form.
|
|
30
56
|
* @attr {string} label - Field label text. Omit for no-label layout. Supports **bold** markdown syntax, for the word to type in a confirmation; the accessible name of the control takes the text without the markers.
|
|
31
|
-
* @attr {string} supporting-label - Short supporting text below the label. Same typography as optional badge. Supports **bold** markdown syntax.
|
|
32
|
-
* @attr {
|
|
57
|
+
* @attr {string} supporting-label - Short supporting text below the label. Same typography as optional badge. Supports **bold** markdown syntax. Read as part of the accessible description of the input, first, before the validation and the help text.
|
|
58
|
+
* @attr {string} help-text - Help text below the input, as plain text. Supports **bold** markdown syntax. Read as part of the accessible description of the input, after the supporting label and the validation. Help text with a link, or text that every screen reader has to read, goes in the `help-text` slot, which takes its place: on a control with a role of its own and on a `group`, `help-text` is an `aria-description`, which not every screen reader reads.
|
|
59
|
+
* @attr {boolean} optional - Shows an optional badge next to the label, and adds it to the accessible name of the input. Its text is the translation key `components.form-field.optional-label` ("Optioneel"); the name is `components.form-field.optional-accessible-label` ("{label}, optioneel").
|
|
60
|
+
* @attr {boolean} group - One question answered with more than one control, such as a postcode and a house number. The field is then a group named by the label, as a fieldset with a legend is, and each control names itself. Without a `label` it takes no role. A radio group or a checkbox group is a group of its own already and needs no `group`.
|
|
33
61
|
* @attr {object} translations - Override translation keys, such as the text of the optional badge; unset keys fall back to Dutch
|
|
34
62
|
*
|
|
35
|
-
* @slot - The slotted input (e.g. nldd-text-field)
|
|
36
|
-
*
|
|
37
|
-
* ─────────────────────────────────────────────────────────────────────────
|
|
38
|
-
*
|
|
39
|
-
* @element nldd-form-field-help-text
|
|
40
|
-
*
|
|
41
|
-
* @slot - Help text content. Inline elements in it look as they do in nldd-text: `<strong>` and `<b>` take the bold weight from the scale, `<em>` and `<i>` are italic, `<a>` is an underlined link, `<code>` sits on a tinted surface in the monospace font and `<mark>` is highlighted. Only direct children get that styling: an element inside another (a `<code>` in an `<a>`) is left as it is.
|
|
42
|
-
* @accepts a, strong, b, em, i, code, mark
|
|
43
|
-
*
|
|
44
|
-
* ─────────────────────────────────────────────────────────────────────────
|
|
63
|
+
* @slot - The slotted input (e.g. nldd-text-field) and its nldd-validation-list.
|
|
64
|
+
* @slot help-text - Help text with more than plain text in it, such as a link: an nldd-text with a `<p>` in it. It takes the look of help text, whatever `size`, `color` or `weight` it has. Takes the place of `help-text`.
|
|
45
65
|
*
|
|
46
66
|
* @example
|
|
47
67
|
* <nldd-form-field label="Password">
|
|
@@ -50,24 +70,25 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
50
70
|
* <nldd-validation-item id="password-required" required>This field is required.</nldd-validation-item>
|
|
51
71
|
* <nldd-validation-item id="password-length" minlength="8">Must be at least 8 characters.</nldd-validation-item>
|
|
52
72
|
* </nldd-validation-list>
|
|
53
|
-
* <nldd-
|
|
54
|
-
* We only use this to sign you in. <a href="/help">Learn more</a
|
|
55
|
-
* </nldd-
|
|
73
|
+
* <nldd-text slot="help-text">
|
|
74
|
+
* <p>We only use this to sign you in. <a href="/help">Learn more</a>.</p>
|
|
75
|
+
* </nldd-text>
|
|
56
76
|
* </nldd-form-field>
|
|
57
77
|
*/
|
|
58
78
|
import { LitElement } from 'lit';
|
|
59
79
|
import { property } from 'lit/decorators.js';
|
|
60
80
|
import { customElement } from '../../../utilities/custom-element.js';
|
|
81
|
+
import { sameItems } from '../../../utilities/same-items.js';
|
|
61
82
|
import { setOwnedAttribute } from '../../../utilities/owned-attribute.js';
|
|
62
83
|
import { stripBold } from '../../../utilities/render-marked.js';
|
|
63
|
-
import {
|
|
64
|
-
import { formFieldStyles
|
|
65
|
-
import { formFieldTemplate
|
|
66
|
-
import { setState, styleValueState } from '../../../utilities/element-state.js';
|
|
84
|
+
import { contributeInputDescribedBy, withdrawInputDescribedBy } from '../../../utilities/described-by-mixin.js';
|
|
85
|
+
import { formFieldStyles } from './form-field.styles.js';
|
|
86
|
+
import { formFieldTemplate } from './form-field.template.js';
|
|
87
|
+
import { internalsOf, setState, styleValueState } from '../../../utilities/element-state.js';
|
|
67
88
|
import { withTranslations } from '../../../utilities/with-translations.js';
|
|
68
89
|
import { nlddFormFieldTranslations } from './form-field.i18n.js';
|
|
69
|
-
|
|
70
|
-
const
|
|
90
|
+
/** Help text in the `help-text` slot, which is never the input. */
|
|
91
|
+
const isHelpText = (el) => el.getAttribute('slot') === 'help-text';
|
|
71
92
|
/**
|
|
72
93
|
* Whether this element is the input a field is about.
|
|
73
94
|
*
|
|
@@ -132,9 +153,11 @@ let NLDDFormField = class NLDDFormField extends withTranslations(LitElement, nld
|
|
|
132
153
|
this.label = '';
|
|
133
154
|
/**
|
|
134
155
|
* Short supporting text shown below the label. Same typography as the
|
|
135
|
-
* optional badge. Use
|
|
156
|
+
* optional badge. Use `help-text` for longer descriptive text.
|
|
136
157
|
*/
|
|
137
158
|
this.supportingLabel = '';
|
|
159
|
+
/** Plain help text below the input. Help text with a link goes in the `help-text` slot. */
|
|
160
|
+
this.helpText = '';
|
|
138
161
|
/**
|
|
139
162
|
* When true an "Optional" badge is shown next to the label.
|
|
140
163
|
* Required fields are intentionally left unmarked per design spec.
|
|
@@ -144,23 +167,49 @@ let NLDDFormField = class NLDDFormField extends withTranslations(LitElement, nld
|
|
|
144
167
|
* on the slotted input element so screen readers announce it correctly.
|
|
145
168
|
*/
|
|
146
169
|
this.optional = false;
|
|
170
|
+
/**
|
|
171
|
+
* Makes the field a group around more than one control, named by the label.
|
|
172
|
+
*
|
|
173
|
+
* Through its own role and not a `<fieldset>`: a legend in a shadow root
|
|
174
|
+
* does not name the controls in its slot for NVDA in Firefox, which is why
|
|
175
|
+
* nldd-form-section rendered its fieldset in the light DOM. A role and a
|
|
176
|
+
* name on the host are the same thing to assistive software, and reach.
|
|
177
|
+
*/
|
|
178
|
+
this.group = false;
|
|
147
179
|
this._childObserver = null;
|
|
148
|
-
/**
|
|
149
|
-
this.
|
|
150
|
-
/** Handed to each validation list, which calls it when an item shows or hides. */
|
|
151
|
-
this._onItemVisibilityChange = () => this._syncDescription();
|
|
152
|
-
/** The lists that hold that callback now, to take it back from. */
|
|
153
|
-
this._watchedLists = [];
|
|
180
|
+
/** The validation lists this field told what to read and describe, to take that back from one that leaves. */
|
|
181
|
+
this._lists = [];
|
|
154
182
|
/** The last label this field wrote onto the control, so it only takes back its own. */
|
|
155
183
|
this._appliedLabel = null;
|
|
184
|
+
/** The control this field is about now, to hand back what it wrote when that changes. */
|
|
185
|
+
this._input = null;
|
|
186
|
+
/** The element this field contributes its supporting label and help text to: its input, or itself as a group. */
|
|
187
|
+
this._describing = null;
|
|
188
|
+
/** Tags of children that are not defined yet, waited for once each. */
|
|
189
|
+
this._pendingTags = new Set();
|
|
190
|
+
/** The inputs found last time, whose own content the observer leaves alone. */
|
|
191
|
+
this._inputs = [];
|
|
192
|
+
/** Whether this field gave itself the role of a group, to take it back. */
|
|
193
|
+
this._grouped = false;
|
|
194
|
+
/** Whether the first update is behind us: Lit reports every property as changed on that one. */
|
|
195
|
+
this._settled = false;
|
|
156
196
|
}
|
|
157
197
|
render() {
|
|
158
198
|
return formFieldTemplate(this);
|
|
159
199
|
}
|
|
160
200
|
updated(changed) {
|
|
161
|
-
|
|
201
|
+
// `firstUpdated` has looked already, with every property as it is now:
|
|
202
|
+
// Lit calls it in the same update, just before this.
|
|
203
|
+
if (!this._settled) {
|
|
204
|
+
this._settled = true;
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
if (changed.has('label') || changed.has('optional') || changed.has('translations') || changed.has('group')) {
|
|
162
208
|
this._onSlotChange();
|
|
163
209
|
}
|
|
210
|
+
else if (changed.has('supportingLabel') || changed.has('helpText')) {
|
|
211
|
+
this._syncDescription();
|
|
212
|
+
}
|
|
164
213
|
}
|
|
165
214
|
willUpdate(changed) {
|
|
166
215
|
super.willUpdate(changed);
|
|
@@ -169,10 +218,29 @@ let NLDDFormField = class NLDDFormField extends withTranslations(LitElement, nld
|
|
|
169
218
|
}
|
|
170
219
|
connectedCallback() {
|
|
171
220
|
super.connectedCallback();
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
//
|
|
175
|
-
//
|
|
221
|
+
// The whole subtree: an input that appears later inside a wrapper (a `v-if`
|
|
222
|
+
// in a `div`) is as much the field's input as a direct child. Then a list
|
|
223
|
+
// that names another control with `for`, and help text that is hidden or
|
|
224
|
+
// shown, since a hidden element that is referenced is still read out.
|
|
225
|
+
// Only the attributes of its own children count: a slot or a `for` deeper
|
|
226
|
+
// down, such as in a toolbar of a text editor, is about something else.
|
|
227
|
+
// What changes inside an input it found is the input's own business, such
|
|
228
|
+
// as the options an app slots into a combo box on every keystroke, and a
|
|
229
|
+
// validation list describes its control with its items itself.
|
|
230
|
+
this._childObserver = new MutationObserver((mutations) => {
|
|
231
|
+
const ownChild = (m) => m.target.parentElement === this;
|
|
232
|
+
const inInput = (m) => this._inputs.some(input => input.contains(m.target));
|
|
233
|
+
const inList = (m) => Boolean(m.target.closest?.('nldd-validation-list'));
|
|
234
|
+
const elementsMoved = (m) => [...m.addedNodes, ...m.removedNodes].some(n => n.nodeType === Node.ELEMENT_NODE);
|
|
235
|
+
const moved = mutations.some(m => (ownChild(m) && (m.attributeName === 'slot' || m.attributeName === 'for'))
|
|
236
|
+
|| (elementsMoved(m) && !inInput(m) && !inList(m)));
|
|
237
|
+
if (moved)
|
|
238
|
+
this._onSlotChange();
|
|
239
|
+
else if (mutations.some(m => ownChild(m) && m.attributeName === 'hidden' && isHelpText(m.target)))
|
|
240
|
+
this._syncDescription();
|
|
241
|
+
});
|
|
242
|
+
this._childObserver.observe(this, { childList: true, subtree: true, attributes: true, attributeFilter: ['slot', 'hidden', 'for'] });
|
|
243
|
+
// Moved in the DOM: `firstUpdated` does not come again.
|
|
176
244
|
if (this.hasUpdated)
|
|
177
245
|
this._onSlotChange();
|
|
178
246
|
}
|
|
@@ -182,18 +250,59 @@ let NLDDFormField = class NLDDFormField extends withTranslations(LitElement, nld
|
|
|
182
250
|
disconnectedCallback() {
|
|
183
251
|
super.disconnectedCallback();
|
|
184
252
|
this._childObserver?.disconnect();
|
|
185
|
-
this
|
|
186
|
-
|
|
253
|
+
// Its input may stay on the page, moved elsewhere: take back what this
|
|
254
|
+
// field said about it, its name and its description. Connecting again
|
|
255
|
+
// says it again.
|
|
256
|
+
if (this._input)
|
|
257
|
+
this._release(this._input);
|
|
258
|
+
this._input = null;
|
|
259
|
+
for (const list of this._lists)
|
|
260
|
+
this._letGo(list);
|
|
261
|
+
this._lists = [];
|
|
262
|
+
// The role and name of a group stay: they are this element's own, and
|
|
263
|
+
// say nothing while it is off the page.
|
|
264
|
+
if (this._describing)
|
|
265
|
+
withdrawInputDescribedBy(this._describing, this);
|
|
266
|
+
this._describing = null;
|
|
187
267
|
}
|
|
188
|
-
/**
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
268
|
+
/**
|
|
269
|
+
* Waits for each child that is not defined yet, and looks again once it is.
|
|
270
|
+
*
|
|
271
|
+
* Whether an element is an input is asked of its class, and an element whose
|
|
272
|
+
* class is not registered yet has none to ask. The autoloader defines tags in
|
|
273
|
+
* the order it meets them, so the field is often defined before its input.
|
|
274
|
+
* Upgrading an element fires no mutation and no `slotchange`, so without this
|
|
275
|
+
* the field never looks again (#512).
|
|
276
|
+
*/
|
|
277
|
+
_awaitUndefined() {
|
|
278
|
+
for (const el of Array.from(this.querySelectorAll(':not(:defined)'))) {
|
|
279
|
+
const tag = el.localName;
|
|
280
|
+
if (this._pendingTags.has(tag))
|
|
281
|
+
continue;
|
|
282
|
+
// One wait per tag while it is undefined: a field that leaves and comes
|
|
283
|
+
// back before the tag arrives keeps the first wait, which still looks
|
|
284
|
+
// when it does. Once defined, the tag no longer matches :not(:defined).
|
|
285
|
+
this._pendingTags.add(tag);
|
|
286
|
+
// A tag that is never defined, such as one of a framework, leaves the
|
|
287
|
+
// promise waiting for good: it holds on to nothing more than a weak
|
|
288
|
+
// reference, so a field that leaves the page can go.
|
|
289
|
+
const field = new WeakRef(this);
|
|
290
|
+
customElements.whenDefined(tag).then(() => {
|
|
291
|
+
const self = field.deref();
|
|
292
|
+
if (!self)
|
|
293
|
+
return;
|
|
294
|
+
self._pendingTags.delete(tag);
|
|
295
|
+
if (self.isConnected)
|
|
296
|
+
self._onSlotChange();
|
|
297
|
+
});
|
|
193
298
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
299
|
+
}
|
|
300
|
+
/** Hands back what this field wrote on a control it is no longer about. */
|
|
301
|
+
_release(control) {
|
|
302
|
+
const attribute = this._labelAttribute(control);
|
|
303
|
+
if (attribute)
|
|
304
|
+
setOwnedAttribute(control, attribute, '', this._appliedLabel);
|
|
305
|
+
this._appliedLabel = null;
|
|
197
306
|
}
|
|
198
307
|
/**
|
|
199
308
|
* Called when the label is clicked. Focuses the slotted input.
|
|
@@ -211,24 +320,40 @@ let NLDDFormField = class NLDDFormField extends withTranslations(LitElement, nld
|
|
|
211
320
|
* wrap a control owe consumers that `focus()`.
|
|
212
321
|
*/
|
|
213
322
|
_focusInput(e) {
|
|
214
|
-
const input = this.
|
|
323
|
+
const input = this._findInputs()[0];
|
|
215
324
|
if (!input)
|
|
216
325
|
return;
|
|
217
326
|
e.preventDefault();
|
|
218
327
|
input.focus();
|
|
219
328
|
}
|
|
220
329
|
_onSlotChange() {
|
|
221
|
-
|
|
330
|
+
this._awaitUndefined();
|
|
331
|
+
const inputs = this._findInputs();
|
|
332
|
+
this._inputs = inputs;
|
|
333
|
+
const input = inputs[0];
|
|
222
334
|
// A consumer's own element can be an input too, which no selector can know.
|
|
223
335
|
setState(this, 'has-input', Boolean(input));
|
|
336
|
+
if (import.meta.env?.DEV)
|
|
337
|
+
setState(this, 'multiple-inputs', inputs.length > 1);
|
|
338
|
+
this._applyGroup();
|
|
339
|
+
// A group names and describes itself, and none of its controls.
|
|
340
|
+
const named = this.group ? undefined : input;
|
|
341
|
+
if (this._input && this._input !== named)
|
|
342
|
+
this._release(this._input);
|
|
343
|
+
this._input = named ?? null;
|
|
224
344
|
if (!input) {
|
|
345
|
+
if (import.meta.env?.DEV)
|
|
346
|
+
setState(this, 'list-reads-first-control', false);
|
|
347
|
+
this._adoptValidationLists(null, inputs);
|
|
348
|
+
this._syncDescription();
|
|
225
349
|
return;
|
|
226
350
|
}
|
|
227
|
-
//
|
|
228
|
-
//
|
|
229
|
-
// is a
|
|
230
|
-
//
|
|
231
|
-
//
|
|
351
|
+
// An id on the control, for the app to point at, such as a `for` on a
|
|
352
|
+
// validation list outside the field or a link to the field from an error
|
|
353
|
+
// summary. `inputId` is a component that hands out the id of the control it
|
|
354
|
+
// renders, which is a different question from how it wants to be named, so
|
|
355
|
+
// it is asked separately (see _applyAccessibleLabel). A plain <input> gets
|
|
356
|
+
// the id directly. The host never gets one, to avoid duplicate ids.
|
|
232
357
|
if ('inputId' in input) {
|
|
233
358
|
const existingId = input.inputId;
|
|
234
359
|
const generatedId = existingId || generateId();
|
|
@@ -238,10 +363,26 @@ let NLDDFormField = class NLDDFormField extends withTranslations(LitElement, nld
|
|
|
238
363
|
if (!input.id)
|
|
239
364
|
input.id = generateId();
|
|
240
365
|
}
|
|
241
|
-
|
|
242
|
-
|
|
366
|
+
if (named)
|
|
367
|
+
this._applyAccessibleLabel(named);
|
|
368
|
+
this._adoptValidationLists(input, inputs);
|
|
243
369
|
this._syncDescription();
|
|
244
370
|
}
|
|
371
|
+
/**
|
|
372
|
+
* Gives this field the role and the name of a group, or takes them back.
|
|
373
|
+
*
|
|
374
|
+
* No role without a label: a group without a name is announced as just
|
|
375
|
+
* "group", which tells a screen reader user less than no group at all.
|
|
376
|
+
*/
|
|
377
|
+
_applyGroup() {
|
|
378
|
+
if (!this.group && !this._grouped)
|
|
379
|
+
return;
|
|
380
|
+
const internals = internalsOf(this);
|
|
381
|
+
const name = this.group ? this._accessibleName() : '';
|
|
382
|
+
internals.role = name ? 'group' : null;
|
|
383
|
+
internals.ariaLabel = name || null;
|
|
384
|
+
this._grouped = this.group;
|
|
385
|
+
}
|
|
245
386
|
/**
|
|
246
387
|
* Hands the label to the control as its accessible name, through whichever
|
|
247
388
|
* channel the control offers.
|
|
@@ -264,53 +405,100 @@ let NLDDFormField = class NLDDFormField extends withTranslations(LitElement, nld
|
|
|
264
405
|
* takes back what it did not write.
|
|
265
406
|
*/
|
|
266
407
|
_applyAccessibleLabel(input) {
|
|
267
|
-
const attribute =
|
|
408
|
+
const attribute = this._labelAttribute(input);
|
|
409
|
+
if (!attribute)
|
|
410
|
+
return;
|
|
411
|
+
this._appliedLabel = setOwnedAttribute(input, attribute, this._accessibleName(), this._appliedLabel);
|
|
412
|
+
}
|
|
413
|
+
/** The attribute through which this control takes a name, or null for one that names itself. */
|
|
414
|
+
_labelAttribute(input) {
|
|
415
|
+
return 'accessibleLabel' in input
|
|
268
416
|
? 'accessible-label'
|
|
269
417
|
: input instanceof HTMLInputElement
|
|
270
418
|
|| input instanceof HTMLSelectElement
|
|
271
419
|
|| input instanceof HTMLTextAreaElement
|
|
272
420
|
? 'aria-label'
|
|
273
421
|
: null;
|
|
274
|
-
if (!attribute)
|
|
275
|
-
return;
|
|
276
|
-
this._appliedLabel = setOwnedAttribute(input, attribute, stripBold(this.label), this._appliedLabel);
|
|
277
422
|
}
|
|
278
423
|
/**
|
|
279
|
-
*
|
|
280
|
-
*
|
|
424
|
+
* The label as a name: without its markers, and with "optioneel" after it
|
|
425
|
+
* when the field is optional.
|
|
426
|
+
*
|
|
427
|
+
* The badge is on screen beside the label, and a screen reader user needs it
|
|
428
|
+
* as much. In the name and not the description: a description is read later
|
|
429
|
+
* or not at all, depending on the reader's settings, while the name is read
|
|
430
|
+
* every time the field is reached. This field composes the name as a string
|
|
431
|
+
* anyway, so where the badge sits in the layout makes no difference.
|
|
432
|
+
*/
|
|
433
|
+
_accessibleName() {
|
|
434
|
+
const label = stripBold(this.label);
|
|
435
|
+
if (!label || !this.optional)
|
|
436
|
+
return label;
|
|
437
|
+
return this._t('components.form-field.optional-accessible-label', { label });
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Tells every validation list in this field what it is about, so it does
|
|
441
|
+
* not have to go looking. The list describes that control with its items
|
|
442
|
+
* itself.
|
|
281
443
|
*
|
|
282
444
|
* A list with a `for` of its own is left alone: that is how you say it is
|
|
283
|
-
* about a different control than the first.
|
|
445
|
+
* about a different control than the first, and it describes that one.
|
|
284
446
|
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
*
|
|
289
|
-
* match.
|
|
447
|
+
* In a `group` a list without `for` reads the value of the first control,
|
|
448
|
+
* judges as soon as any control of the group is `invalid`, and describes
|
|
449
|
+
* the group: what it says is about the question as a whole. A list that
|
|
450
|
+
* reads a value then quietly reads the first one, and nothing on screen
|
|
451
|
+
* would show it: the rules simply never match. Such a list needs a `for`.
|
|
290
452
|
*/
|
|
291
|
-
_adoptValidationLists(input) {
|
|
453
|
+
_adoptValidationLists(input, inputs) {
|
|
292
454
|
const lists = Array.from(this.children)
|
|
293
455
|
.filter((el) => el.tagName.toLowerCase() === 'nldd-validation-list');
|
|
456
|
+
const group = this.group ? (this._accessibleName() ? this : null) : undefined;
|
|
294
457
|
for (const list of lists) {
|
|
295
|
-
|
|
458
|
+
const own = !list.getAttribute('for');
|
|
459
|
+
if (own)
|
|
296
460
|
list.control = input;
|
|
461
|
+
list.describes = own ? group : undefined;
|
|
462
|
+
// Only a new array when the controls changed: a new one each time
|
|
463
|
+
// would render every list again on each look.
|
|
464
|
+
const judgedBy = own && this.group ? inputs : [];
|
|
465
|
+
// A list that is not defined yet, as with the autoloader, has none: sameItems takes that as empty.
|
|
466
|
+
if (!sameItems(list.judgedBy, judgedBy))
|
|
467
|
+
list.judgedBy = [...judgedBy];
|
|
468
|
+
}
|
|
469
|
+
for (const list of this._lists) {
|
|
470
|
+
if (!lists.includes(list))
|
|
471
|
+
this._letGo(list);
|
|
297
472
|
}
|
|
473
|
+
this._lists = lists;
|
|
298
474
|
if (!import.meta.env?.DEV)
|
|
299
475
|
return;
|
|
300
476
|
const readsValue = lists.some(list => !list.getAttribute('for') && Array.from(list.children)
|
|
301
477
|
.some(item => item.hasAttribute('match') || item.hasAttribute('minlength') || item.hasAttribute('maxlength')));
|
|
302
|
-
|
|
303
|
-
.filter(el => !HELPER_TAGS.includes(el.tagName.toLowerCase()) && isFormInput(el));
|
|
304
|
-
setState(this, 'list-reads-first-control', readsValue && controls.length > 1);
|
|
478
|
+
setState(this, 'list-reads-first-control', readsValue && inputs.length > 1);
|
|
305
479
|
}
|
|
306
480
|
/**
|
|
307
|
-
*
|
|
308
|
-
*
|
|
481
|
+
* Takes back what this field told a validation list that is no longer its
|
|
482
|
+
* own: a list without `for` is about no control of it any more, one with a
|
|
483
|
+
* `for` describes that control. One that is in another field now is that
|
|
484
|
+
* field's to set.
|
|
485
|
+
*/
|
|
486
|
+
_letGo(list) {
|
|
487
|
+
if (list.parentElement?.localName === 'nldd-form-field' && list.parentElement !== this)
|
|
488
|
+
return;
|
|
489
|
+
if (!list.getAttribute('for'))
|
|
490
|
+
list.control = null;
|
|
491
|
+
list.describes = undefined;
|
|
492
|
+
if (list.judgedBy?.length)
|
|
493
|
+
list.judgedBy = [];
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* The inputs in this field, in document order, wrapped or not. An input in
|
|
497
|
+
* another one, such as a checkbox field in a checkbox group, is part of that
|
|
498
|
+
* one and not counted.
|
|
309
499
|
*
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
* belong in one field. The first input carries the caption, and the ones
|
|
313
|
-
* after it name themselves.
|
|
500
|
+
* The first is the one the field is about. A field with more than one is a
|
|
501
|
+
* `group`, and then names none of them.
|
|
314
502
|
*
|
|
315
503
|
* Looking inside matters because a `div` or an `nldd-container` around your
|
|
316
504
|
* input is a normal thing to write. Stopping at that wrapper sent the id,
|
|
@@ -321,62 +509,55 @@ let NLDDFormField = class NLDDFormField extends withTranslations(LitElement, nld
|
|
|
321
509
|
* and says so in DEV, rather than picking whatever came first and quietly
|
|
322
510
|
* treating a tag or a button as your input.
|
|
323
511
|
*/
|
|
324
|
-
|
|
512
|
+
_findInputs() {
|
|
513
|
+
const found = [];
|
|
325
514
|
const children = Array.from(this.children)
|
|
326
|
-
.filter(el => !
|
|
515
|
+
.filter(el => !isHelpText(el) && !isToolbar(el));
|
|
327
516
|
for (const child of children) {
|
|
328
|
-
if (isFormInput(child))
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
517
|
+
if (isFormInput(child)) {
|
|
518
|
+
found.push(child);
|
|
519
|
+
continue;
|
|
520
|
+
}
|
|
521
|
+
for (const el of Array.from(child.querySelectorAll('*'))) {
|
|
522
|
+
if (isFormInput(el) && !inToolbar(el, child) && !found.some(outer => outer.contains(el)))
|
|
523
|
+
found.push(el);
|
|
524
|
+
}
|
|
333
525
|
}
|
|
334
|
-
return
|
|
526
|
+
return found;
|
|
335
527
|
}
|
|
336
528
|
/**
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
*
|
|
340
|
-
*
|
|
341
|
-
*
|
|
342
|
-
* description comes out empty. A control that renders its own input takes
|
|
343
|
-
* `describedByElements` and puts the references where they belong; anything
|
|
344
|
-
* that is the control itself, a native input or a host with a role of its
|
|
345
|
-
* own, is pointed at directly.
|
|
346
|
-
*
|
|
347
|
-
* The items of a validation list that are on screen, not the list. Safari
|
|
348
|
-
* passes nothing on to VoiceOver for an element whose text sits in a
|
|
349
|
-
* `role="list"`, which the list renders, so a reference to the list was an
|
|
350
|
-
* empty description there. Only the visible items, because an element
|
|
351
|
-
* referenced directly is read even while it is hidden: a met requirement
|
|
352
|
-
* would still be read out. The references change when an item shows or
|
|
353
|
-
* hides, which is when the description changes anyway.
|
|
529
|
+
* Says the supporting label and the help text of this field to what it is
|
|
530
|
+
* about: its input, or itself as a group. A group without a name has no role
|
|
531
|
+
* to carry a description, so nothing. The validation lists say their own
|
|
532
|
+
* part, and the input puts the parts in their order: the supporting label,
|
|
533
|
+
* what is wrong, the help text (see `contributeInputDescribedBy`).
|
|
354
534
|
*
|
|
355
|
-
* The
|
|
356
|
-
*
|
|
535
|
+
* The supporting label and `help-text` sit in this shadow root, where no
|
|
536
|
+
* reference from the control can reach them, so they go over as text. Help
|
|
537
|
+
* text in the slot is in the light DOM and goes over as an element, which
|
|
538
|
+
* every control can point at: a host that carries its own role, such as a
|
|
539
|
+
* radio group, says text only as `aria-description`, and a browser drops
|
|
540
|
+
* that as soon as there is an `aria-describedby`.
|
|
357
541
|
*/
|
|
358
542
|
_syncDescription() {
|
|
359
|
-
const
|
|
360
|
-
if (
|
|
543
|
+
const target = this.group ? (this._accessibleName() ? this : null) : this._input;
|
|
544
|
+
if (this._describing && this._describing !== target)
|
|
545
|
+
withdrawInputDescribedBy(this._describing, this);
|
|
546
|
+
this._describing = target;
|
|
547
|
+
if (!target)
|
|
361
548
|
return;
|
|
362
|
-
|
|
363
|
-
const
|
|
364
|
-
const
|
|
365
|
-
|
|
366
|
-
this
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
if ('describedByElements' in input) {
|
|
375
|
-
input.describedByElements = describedBy;
|
|
376
|
-
}
|
|
377
|
-
else {
|
|
378
|
-
applyDescribedBy(input, describedBy);
|
|
379
|
-
}
|
|
549
|
+
// Help text in the slot takes the place of `help-text`, also while it is hidden.
|
|
550
|
+
const slotted = this._helpTexts();
|
|
551
|
+
const supporting = stripBold(this.supportingLabel).trim();
|
|
552
|
+
const helpText = stripBold(this.helpText).trim();
|
|
553
|
+
contributeInputDescribedBy(target, this, 'supporting-label', supporting ? [supporting] : []);
|
|
554
|
+
contributeInputDescribedBy(target, this, 'help-text', slotted.length
|
|
555
|
+
? slotted.filter(el => !el.hidden)
|
|
556
|
+
: helpText ? [helpText] : []);
|
|
557
|
+
}
|
|
558
|
+
/** The elements in the `help-text` slot. */
|
|
559
|
+
_helpTexts() {
|
|
560
|
+
return Array.from(this.children).filter(isHelpText);
|
|
380
561
|
}
|
|
381
562
|
};
|
|
382
563
|
NLDDFormField.styles = formFieldStyles;
|
|
@@ -392,30 +573,17 @@ __decorate([
|
|
|
392
573
|
__decorate([
|
|
393
574
|
property({ type: String, attribute: 'supporting-label' })
|
|
394
575
|
], NLDDFormField.prototype, "supportingLabel", void 0);
|
|
576
|
+
__decorate([
|
|
577
|
+
property({ type: String, attribute: 'help-text' })
|
|
578
|
+
], NLDDFormField.prototype, "helpText", void 0);
|
|
395
579
|
__decorate([
|
|
396
580
|
property({ type: Boolean })
|
|
397
581
|
], NLDDFormField.prototype, "optional", void 0);
|
|
582
|
+
__decorate([
|
|
583
|
+
property({ type: Boolean, reflect: true })
|
|
584
|
+
], NLDDFormField.prototype, "group", void 0);
|
|
398
585
|
NLDDFormField = __decorate([
|
|
399
586
|
customElement('nldd-form-field')
|
|
400
587
|
], NLDDFormField);
|
|
401
588
|
export { NLDDFormField };
|
|
402
|
-
/* ============================================================
|
|
403
|
-
nldd-form-field-help-text
|
|
404
|
-
============================================================ */
|
|
405
|
-
let NLDDFormFieldHelpText = class NLDDFormFieldHelpText extends LitElement {
|
|
406
|
-
connectedCallback() {
|
|
407
|
-
super.connectedCallback();
|
|
408
|
-
// Assign to the 'help' slot automatically so consumers don't need to set slot="help" manually.
|
|
409
|
-
// Note: this will overwrite any explicit slot attribute set by the consumer.
|
|
410
|
-
this.slot = 'help';
|
|
411
|
-
}
|
|
412
|
-
render() {
|
|
413
|
-
return formFieldHelpTextTemplate(this);
|
|
414
|
-
}
|
|
415
|
-
};
|
|
416
|
-
NLDDFormFieldHelpText.styles = formFieldHelpTextStyles;
|
|
417
|
-
NLDDFormFieldHelpText = __decorate([
|
|
418
|
-
customElement('nldd-form-field-help-text')
|
|
419
|
-
], NLDDFormFieldHelpText);
|
|
420
|
-
export { NLDDFormFieldHelpText };
|
|
421
589
|
//# sourceMappingURL=form-field.js.map
|