@public-ui/components 1.6.0-rc.27 → 1.6.0-rc.28
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 +76 -75
- package/dist/cjs/controller-05364c23.js +4 -0
- package/dist/cjs/controller-05364c23.js.map +1 -0
- package/dist/cjs/controller-089fee12.js +4 -0
- package/dist/cjs/controller-089fee12.js.map +1 -0
- package/dist/cjs/{controller-cbfc7eba.js → controller-0d0ee1fa.js} +1 -1
- package/dist/cjs/{controller-cbfc7eba.js.map → controller-0d0ee1fa.js.map} +1 -1
- package/dist/cjs/{controller-ac75a14a.js → controller-b3c90050.js} +1 -1
- package/dist/cjs/{controller-ac75a14a.js.map → controller-b3c90050.js.map} +1 -1
- package/dist/cjs/{controller-icon-753d8c2f.js → controller-icon-dfd87d21.js} +1 -1
- package/dist/cjs/{controller-icon-753d8c2f.js.map → controller-icon-dfd87d21.js.map} +1 -1
- package/dist/cjs/hide-label-71458adc.js +4 -0
- package/dist/cjs/hide-label-71458adc.js.map +1 -0
- package/dist/cjs/kol-abbr.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-alert-wc_2.cjs.entry.js +1 -1
- package/dist/cjs/kol-alert-wc_2.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-breadcrumb.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-button-link.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-button-wc_2.cjs.entry.js +1 -1
- package/dist/cjs/kol-button-wc_2.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-button.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-card.cjs.entry.js +1 -1
- package/dist/cjs/kol-card.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-details.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-heading.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-icon-font-awesome.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-icon-icofont.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-input-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-input-color.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-color.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-input-date.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-date.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-input-email.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-email.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-input-file.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-file.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-input-number.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-number.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-input-password.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-password.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-input-radio.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-input-range.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-range.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-input-text.cjs.entry.js +1 -1
- package/dist/cjs/kol-input-text.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-kolibri.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-link-button.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-link-group.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-link-wc.cjs.entry.js +1 -1
- package/dist/cjs/kol-link-wc.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-link.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-logo.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-nav.cjs.entry.js +1 -1
- package/dist/cjs/kol-nav.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-quote.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-select.cjs.entry.js +1 -1
- package/dist/cjs/kol-select.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-skip-nav.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-span-wc.cjs.entry.js +1 -1
- package/dist/cjs/kol-span-wc.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-span.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-split-button.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-symbol.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-table.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-tabs.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-textarea.cjs.entry.js +1 -1
- package/dist/cjs/kol-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/kol-version.cjs.entry.js.map +1 -1
- package/dist/components/component.js.map +1 -1
- package/dist/components/component13.js +1 -1
- package/dist/components/component13.js.map +1 -1
- package/dist/components/component14.js.map +1 -1
- package/dist/components/component16.js +1 -1
- package/dist/components/component16.js.map +1 -1
- package/dist/components/component2.js +1 -1
- package/dist/components/component2.js.map +1 -1
- package/dist/components/component5.js.map +1 -1
- package/dist/components/component6.js.map +1 -1
- package/dist/components/component8.js.map +1 -1
- package/dist/components/component9.js.map +1 -1
- package/dist/components/controller.js +1 -1
- package/dist/components/controller.js.map +1 -1
- package/dist/components/controller4.js +1 -1
- package/dist/components/controller4.js.map +1 -1
- package/dist/components/kol-abbr.js.map +1 -1
- package/dist/components/kol-accordion.js.map +1 -1
- package/dist/components/kol-breadcrumb.js.map +1 -1
- package/dist/components/kol-button-link.js.map +1 -1
- package/dist/components/kol-card.js +1 -1
- package/dist/components/kol-card.js.map +1 -1
- package/dist/components/kol-details.js.map +1 -1
- package/dist/components/kol-heading.js.map +1 -1
- package/dist/components/kol-icon-font-awesome.js.map +1 -1
- package/dist/components/kol-icon-icofont.js.map +1 -1
- package/dist/components/kol-input-checkbox.js +1 -1
- package/dist/components/kol-input-checkbox.js.map +1 -1
- package/dist/components/kol-input-color.js +1 -1
- package/dist/components/kol-input-color.js.map +1 -1
- package/dist/components/kol-input-date.js +1 -1
- package/dist/components/kol-input-date.js.map +1 -1
- package/dist/components/kol-input-email.js +1 -1
- package/dist/components/kol-input-email.js.map +1 -1
- package/dist/components/kol-input-file.js +1 -1
- package/dist/components/kol-input-file.js.map +1 -1
- package/dist/components/kol-input-number.js +1 -1
- package/dist/components/kol-input-number.js.map +1 -1
- package/dist/components/kol-input-password.js +1 -1
- package/dist/components/kol-input-password.js.map +1 -1
- package/dist/components/kol-input-range.js +1 -1
- package/dist/components/kol-input-range.js.map +1 -1
- package/dist/components/kol-input-text.js +1 -1
- package/dist/components/kol-input-text.js.map +1 -1
- package/dist/components/kol-kolibri.js.map +1 -1
- package/dist/components/kol-link-button.js.map +1 -1
- package/dist/components/kol-link-group.js.map +1 -1
- package/dist/components/kol-logo.js.map +1 -1
- package/dist/components/kol-modal.js.map +1 -1
- package/dist/components/kol-nav.js.map +1 -1
- package/dist/components/kol-quote.js.map +1 -1
- package/dist/components/kol-skip-nav.js.map +1 -1
- package/dist/components/kol-span.js.map +1 -1
- package/dist/components/kol-split-button.js.map +1 -1
- package/dist/components/kol-symbol.js.map +1 -1
- package/dist/components/kol-table.js.map +1 -1
- package/dist/components/kol-tabs.js.map +1 -1
- package/dist/components/kol-textarea.js +1 -1
- package/dist/components/kol-textarea.js.map +1 -1
- package/dist/components/kol-toast.js.map +1 -1
- package/dist/components/kol-version.js.map +1 -1
- package/dist/components/shadow.js.map +1 -1
- package/dist/components/shadow2.js.map +1 -1
- package/dist/components/shadow3.js.map +1 -1
- package/dist/esm/{controller-8dfe7c91.js → controller-1dceb20a.js} +1 -1
- package/dist/esm/{controller-8dfe7c91.js.map → controller-1dceb20a.js.map} +1 -1
- package/dist/esm/controller-374af419.js +4 -0
- package/dist/esm/controller-374af419.js.map +1 -0
- package/dist/esm/controller-3d8d8584.js +4 -0
- package/dist/esm/controller-3d8d8584.js.map +1 -0
- package/dist/esm/{controller-607473a1.js → controller-a239899d.js} +1 -1
- package/dist/esm/{controller-607473a1.js.map → controller-a239899d.js.map} +1 -1
- package/dist/esm/{controller-icon-9b323870.js → controller-icon-72506bd1.js} +1 -1
- package/dist/esm/{controller-icon-9b323870.js.map → controller-icon-72506bd1.js.map} +1 -1
- package/dist/esm/{hide-label-2fd3b093.js → hide-label-3260d69a.js} +1 -1
- package/dist/esm/hide-label-3260d69a.js.map +1 -0
- package/dist/esm/kol-abbr.entry.js.map +1 -1
- package/dist/esm/kol-accordion.entry.js.map +1 -1
- package/dist/esm/kol-alert-wc_2.entry.js +1 -1
- package/dist/esm/kol-alert-wc_2.entry.js.map +1 -1
- package/dist/esm/kol-alert.entry.js.map +1 -1
- package/dist/esm/kol-badge.entry.js.map +1 -1
- package/dist/esm/kol-breadcrumb.entry.js.map +1 -1
- package/dist/esm/kol-button-link.entry.js.map +1 -1
- package/dist/esm/kol-button-wc_2.entry.js +1 -1
- package/dist/esm/kol-button-wc_2.entry.js.map +1 -1
- package/dist/esm/kol-button.entry.js.map +1 -1
- package/dist/esm/kol-card.entry.js +1 -1
- package/dist/esm/kol-card.entry.js.map +1 -1
- package/dist/esm/kol-details.entry.js.map +1 -1
- package/dist/esm/kol-heading.entry.js.map +1 -1
- package/dist/esm/kol-icon-font-awesome.entry.js.map +1 -1
- package/dist/esm/kol-icon-icofont.entry.js.map +1 -1
- package/dist/esm/kol-icon.entry.js.map +1 -1
- package/dist/esm/kol-input-checkbox.entry.js +1 -1
- package/dist/esm/kol-input-checkbox.entry.js.map +1 -1
- package/dist/esm/kol-input-color.entry.js +1 -1
- package/dist/esm/kol-input-color.entry.js.map +1 -1
- package/dist/esm/kol-input-date.entry.js +1 -1
- package/dist/esm/kol-input-date.entry.js.map +1 -1
- package/dist/esm/kol-input-email.entry.js +1 -1
- package/dist/esm/kol-input-email.entry.js.map +1 -1
- package/dist/esm/kol-input-file.entry.js +1 -1
- package/dist/esm/kol-input-file.entry.js.map +1 -1
- package/dist/esm/kol-input-number.entry.js +1 -1
- package/dist/esm/kol-input-number.entry.js.map +1 -1
- package/dist/esm/kol-input-password.entry.js +1 -1
- package/dist/esm/kol-input-password.entry.js.map +1 -1
- package/dist/esm/kol-input-radio.entry.js +1 -1
- package/dist/esm/kol-input-radio.entry.js.map +1 -1
- package/dist/esm/kol-input-range.entry.js +1 -1
- package/dist/esm/kol-input-range.entry.js.map +1 -1
- package/dist/esm/kol-input-text.entry.js +1 -1
- package/dist/esm/kol-input-text.entry.js.map +1 -1
- package/dist/esm/kol-kolibri.entry.js.map +1 -1
- package/dist/esm/kol-link-button.entry.js.map +1 -1
- package/dist/esm/kol-link-group.entry.js.map +1 -1
- package/dist/esm/kol-link-wc.entry.js +1 -1
- package/dist/esm/kol-link-wc.entry.js.map +1 -1
- package/dist/esm/kol-link.entry.js.map +1 -1
- package/dist/esm/kol-logo.entry.js.map +1 -1
- package/dist/esm/kol-modal.entry.js.map +1 -1
- package/dist/esm/kol-nav.entry.js +1 -1
- package/dist/esm/kol-nav.entry.js.map +1 -1
- package/dist/esm/kol-quote.entry.js.map +1 -1
- package/dist/esm/kol-select.entry.js +1 -1
- package/dist/esm/kol-select.entry.js.map +1 -1
- package/dist/esm/kol-skip-nav.entry.js.map +1 -1
- package/dist/esm/kol-span-wc.entry.js +1 -1
- package/dist/esm/kol-span-wc.entry.js.map +1 -1
- package/dist/esm/kol-span.entry.js.map +1 -1
- package/dist/esm/kol-split-button.entry.js.map +1 -1
- package/dist/esm/kol-symbol.entry.js.map +1 -1
- package/dist/esm/kol-table.entry.js.map +1 -1
- package/dist/esm/kol-tabs.entry.js.map +1 -1
- package/dist/esm/kol-textarea.entry.js +1 -1
- package/dist/esm/kol-textarea.entry.js.map +1 -1
- package/dist/esm/kol-toast.entry.js.map +1 -1
- package/dist/esm/kol-version.entry.js.map +1 -1
- package/dist/kolibri/{controller-8dfe7c91.js → controller-1dceb20a.js} +1 -1
- package/dist/kolibri/controller-374af419.js +4 -0
- package/dist/kolibri/controller-374af419.js.map +1 -0
- package/dist/kolibri/controller-3d8d8584.js +4 -0
- package/dist/kolibri/controller-3d8d8584.js.map +1 -0
- package/dist/kolibri/{controller-607473a1.js → controller-a239899d.js} +1 -1
- package/dist/kolibri/{controller-icon-9b323870.js → controller-icon-72506bd1.js} +1 -1
- package/dist/kolibri/hide-label-3260d69a.js +4 -0
- package/dist/kolibri/hide-label-3260d69a.js.map +1 -0
- package/dist/kolibri/kol-abbr.entry.js.map +1 -1
- package/dist/kolibri/kol-accordion.entry.js.map +1 -1
- package/dist/kolibri/kol-alert-wc_2.entry.js +1 -1
- package/dist/kolibri/kol-alert-wc_2.entry.js.map +1 -1
- package/dist/kolibri/kol-alert.entry.js.map +1 -1
- package/dist/kolibri/kol-badge.entry.js.map +1 -1
- package/dist/kolibri/kol-breadcrumb.entry.js.map +1 -1
- package/dist/kolibri/kol-button-link.entry.js.map +1 -1
- package/dist/kolibri/kol-button-wc_2.entry.js +1 -1
- package/dist/kolibri/kol-button-wc_2.entry.js.map +1 -1
- package/dist/kolibri/kol-button.entry.js.map +1 -1
- package/dist/kolibri/kol-card.entry.js +1 -1
- package/dist/kolibri/kol-card.entry.js.map +1 -1
- package/dist/kolibri/kol-details.entry.js.map +1 -1
- package/dist/kolibri/kol-heading.entry.js.map +1 -1
- package/dist/kolibri/kol-icon-font-awesome.entry.js.map +1 -1
- package/dist/kolibri/kol-icon-icofont.entry.js.map +1 -1
- package/dist/kolibri/kol-icon.entry.js.map +1 -1
- package/dist/kolibri/kol-input-checkbox.entry.js +1 -1
- package/dist/kolibri/kol-input-checkbox.entry.js.map +1 -1
- package/dist/kolibri/kol-input-color.entry.js +1 -1
- package/dist/kolibri/kol-input-color.entry.js.map +1 -1
- package/dist/kolibri/kol-input-date.entry.js +1 -1
- package/dist/kolibri/kol-input-date.entry.js.map +1 -1
- package/dist/kolibri/kol-input-email.entry.js +1 -1
- package/dist/kolibri/kol-input-email.entry.js.map +1 -1
- package/dist/kolibri/kol-input-file.entry.js +1 -1
- package/dist/kolibri/kol-input-file.entry.js.map +1 -1
- package/dist/kolibri/kol-input-number.entry.js +1 -1
- package/dist/kolibri/kol-input-number.entry.js.map +1 -1
- package/dist/kolibri/kol-input-password.entry.js +1 -1
- package/dist/kolibri/kol-input-password.entry.js.map +1 -1
- package/dist/kolibri/kol-input-radio.entry.js +1 -1
- package/dist/kolibri/kol-input-radio.entry.js.map +1 -1
- package/dist/kolibri/kol-input-range.entry.js +1 -1
- package/dist/kolibri/kol-input-range.entry.js.map +1 -1
- package/dist/kolibri/kol-input-text.entry.js +1 -1
- package/dist/kolibri/kol-input-text.entry.js.map +1 -1
- package/dist/kolibri/kol-kolibri.entry.js.map +1 -1
- package/dist/kolibri/kol-link-button.entry.js.map +1 -1
- package/dist/kolibri/kol-link-group.entry.js.map +1 -1
- package/dist/kolibri/kol-link-wc.entry.js +1 -1
- package/dist/kolibri/kol-link-wc.entry.js.map +1 -1
- package/dist/kolibri/kol-link.entry.js.map +1 -1
- package/dist/kolibri/kol-logo.entry.js.map +1 -1
- package/dist/kolibri/kol-modal.entry.js.map +1 -1
- package/dist/kolibri/kol-nav.entry.js +1 -1
- package/dist/kolibri/kol-nav.entry.js.map +1 -1
- package/dist/kolibri/kol-quote.entry.js.map +1 -1
- package/dist/kolibri/kol-select.entry.js +1 -1
- package/dist/kolibri/kol-select.entry.js.map +1 -1
- package/dist/kolibri/kol-skip-nav.entry.js.map +1 -1
- package/dist/kolibri/kol-span-wc.entry.js +1 -1
- package/dist/kolibri/kol-span-wc.entry.js.map +1 -1
- package/dist/kolibri/kol-span.entry.js.map +1 -1
- package/dist/kolibri/kol-split-button.entry.js.map +1 -1
- package/dist/kolibri/kol-symbol.entry.js.map +1 -1
- package/dist/kolibri/kol-table.entry.js.map +1 -1
- package/dist/kolibri/kol-tabs.entry.js.map +1 -1
- package/dist/kolibri/kol-textarea.entry.js +1 -1
- package/dist/kolibri/kol-textarea.entry.js.map +1 -1
- package/dist/kolibri/kol-toast.entry.js.map +1 -1
- package/dist/kolibri/kol-version.entry.js.map +1 -1
- package/dist/types/components/@deprecated/input/controller.d.ts +0 -1
- package/dist/types/components/input-password/controller.d.ts +0 -2
- package/dist/types/components.d.ts +184 -178
- package/dist/types/types/props/hide-label.d.ts +2 -1
- package/doc/abbr.md +5 -5
- package/doc/accordion.md +1 -1
- package/doc/alert.md +1 -1
- package/doc/badge.md +8 -8
- package/doc/breadcrumb.md +5 -5
- package/doc/button-link.md +21 -21
- package/doc/button.md +24 -24
- package/doc/card.md +9 -9
- package/doc/details.md +1 -1
- package/doc/icon-font-awesome.md +6 -6
- package/doc/icon-icofont.md +5 -5
- package/doc/icon.md +6 -6
- package/doc/input-checkbox.md +22 -22
- package/doc/input-color.md +1 -1
- package/doc/input-date.md +2 -2
- package/doc/input-email.md +1 -1
- package/doc/input-number.md +28 -28
- package/doc/input-radio.md +1 -1
- package/doc/input-range.md +1 -1
- package/doc/input-text.md +2 -2
- package/doc/kolibri.md +5 -5
- package/doc/link-button.md +23 -23
- package/doc/link-group.md +10 -10
- package/doc/link.md +25 -25
- package/doc/logo.md +4 -4
- package/doc/modal.md +7 -7
- package/doc/nav.md +12 -12
- package/doc/quote.md +7 -7
- package/doc/select.md +2 -2
- package/doc/skip-nav.md +5 -5
- package/doc/span.md +6 -6
- package/doc/split-button.md +22 -22
- package/doc/symbol.md +5 -5
- package/doc/table.md +9 -9
- package/doc/tabs.md +9 -9
- package/doc/toast.md +2 -2
- package/doc/version.md +4 -4
- package/jest-test-results.json +1 -1
- package/package.json +1 -1
- package/vscode-custom-data.json +74 -74
- package/dist/cjs/controller-720ed373.js +0 -4
- package/dist/cjs/controller-720ed373.js.map +0 -1
- package/dist/cjs/controller-79c136e6.js +0 -4
- package/dist/cjs/controller-79c136e6.js.map +0 -1
- package/dist/cjs/hide-label-9c11b83c.js +0 -4
- package/dist/cjs/hide-label-9c11b83c.js.map +0 -1
- package/dist/declare.d.ts +0 -26
- package/dist/esm/controller-24d68464.js +0 -4
- package/dist/esm/controller-24d68464.js.map +0 -1
- package/dist/esm/controller-db9c89e4.js +0 -4
- package/dist/esm/controller-db9c89e4.js.map +0 -1
- package/dist/esm/hide-label-2fd3b093.js.map +0 -1
- package/dist/kolibri/controller-24d68464.js +0 -4
- package/dist/kolibri/controller-24d68464.js.map +0 -1
- package/dist/kolibri/controller-db9c89e4.js +0 -4
- package/dist/kolibri/controller-db9c89e4.js.map +0 -1
- package/dist/kolibri/hide-label-2fd3b093.js +0 -4
- package/dist/kolibri/hide-label-2fd3b093.js.map +0 -1
- package/dist/types/core/declare.d.ts +0 -10
- /package/dist/kolibri/{controller-8dfe7c91.js.map → controller-1dceb20a.js.map} +0 -0
- /package/dist/kolibri/{controller-607473a1.js.map → controller-a239899d.js.map} +0 -0
- /package/dist/kolibri/{controller-icon-9b323870.js.map → controller-icon-72506bd1.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"controller-05364c23.js","mappings":";;;;;;;;MAea,kBAAkB,GAAG,CAAC,SAAoC,EAAE,KAA0B;EAClGA,4BAAY,CAAC,SAAS,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;AAC/C;;MCTa,uBAAwB,SAAQC,kCAAmB;EAI/D,YAAmB,SAA4C,EAAE,IAAY,EAAE,IAAkB;IAChG,KAAK,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC7B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;GAC3B;EAEM,oBAAoB,CAAC,KAAsB;IACjDC,8BAAc,CACb,IAAI,CAAC,SAAS,EACd,eAAe,EACf,CAAC,KAAK,KAAc,OAAO,KAAK,KAAK,QAAQ,KAAK,KAAK,KAAK,IAAI,IAAI,KAAK,KA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CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACpD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAClD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC9C,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IACtD,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IAChD,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IAChD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACxC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;GAC1C;EAES,MAAM,CAAC,KAAY;IAoB5B,IAAI,CAAC,SAAS,CAAC,KAAK,mCAChB,IAAI,CAAC,SAAS,CAAC,KAAK,KACvB,YAAY,EAAE,IAAI,CAAC,gBAAgB,GACnC,CAAC;IACF,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAClC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;GACpB;EAES,OAAO,CAAC,KAAY;IAC7B,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,YAAsB,CAAC;IACpE,IAAI,CAAC,SAAS,CAAC,KAAK,mCAChB,IAAI,CAAC,SAAS,CAAC,KAAK,KACvB,YAAY,EAAE,SAAS,GACvB,CAAC;IACF,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;GACrB;;;;;;","names":["watchBoolean","InputIconController","watchValidator","watchNumber","watchString"],"sources":["src/types/props/has-counter.ts","src/components/input-password/controller.ts"],"sourcesContent":["import { Generic } from '@a11y-ui/core';\n\nimport { watchBoolean } from '../../utils/prop.validators';\n\n/* types */\nexport type HasCounterPropType = boolean;\n\n/**\n * Shows the character count on the lower border of the input.\n */\nexport type PropHasCounter = {\n\thasCounter: HasCounterPropType;\n};\n\n/* validator */\nexport const validateHasCounter = (component: Generic.Element.Component, value?: HasCounterPropType): void => {\n\twatchBoolean(component, '_hasCounter', value);\n};\n","import { Generic } from '@a11y-ui/core';\n\nimport { InputTypeOnOff } from '../../types/input/types';\nimport { validateHasCounter } from '../../types/props/has-counter';\nimport { watchBoolean, watchNumber, watchString, watchValidator } from '../../utils/prop.validators';\nimport { InputIconController } from '../@deprecated/input/controller-icon';\nimport { Props, Watches } from './types';\n\nexport class InputPasswordController extends InputIconController implements Watches {\n\tprotected readonly component: Generic.Element.Component & Props;\n\tprivate placeholderCache?: string;\n\n\tpublic constructor(component: Generic.Element.Component & Props, name: string, host?: HTMLElement) {\n\t\tsuper(component, name, host);\n\t\tthis.component = component;\n\t}\n\n\tpublic validateAutoComplete(value?: InputTypeOnOff): void {\n\t\twatchValidator(\n\t\t\tthis.component,\n\t\t\t'_autoComplete',\n\t\t\t(value): boolean => typeof value === 'string' && (value === 'on' || value === 'off'),\n\t\t\tnew Set(['on | off']),\n\t\t\tvalue\n\t\t);\n\t}\n\n\tpublic validateHasCounter(value?: boolean): void {\n\t\tvalidateHasCounter(this.component, value);\n\t}\n\n\tpublic validateMaxLength(value?: number): void {\n\t\twatchNumber(this.component, '_maxLength', value, {\n\t\t\tmin: 0,\n\t\t});\n\t}\n\n\tpublic validatePattern(value?: string): void {\n\t\twatchString(this.component, '_pattern', value);\n\t}\n\n\tpublic validatePlaceholder(value?: string): void {\n\t\twatchString(this.component, '_placeholder', value);\n\t}\n\n\tpublic validateReadOnly(value?: boolean): void {\n\t\twatchBoolean(this.component, '_readOnly', value);\n\t}\n\n\tpublic validateRequired(value?: boolean): void {\n\t\twatchBoolean(this.component, '_required', value);\n\t}\n\n\tpublic validateSize(value?: number): void {\n\t\twatchNumber(this.component, '_size', value, {\n\t\t\tmin: 1,\n\t\t});\n\t}\n\n\tpublic validateValue(value?: string): void {\n\t\twatchString(this.component, '_value', value);\n\t\tthis.setFormAssociatedValue(this.component.state._value as string);\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tsuper.componentWillLoad();\n\t\tthis.validateAutoComplete(this.component._autoComplete);\n\t\tthis.validateHasCounter(this.component._hasCounter);\n\t\tthis.validateMaxLength(this.component._maxLength);\n\t\tthis.validatePattern(this.component._pattern);\n\t\tthis.validatePlaceholder(this.component._placeholder);\n\t\tthis.validateReadOnly(this.component._readOnly);\n\t\tthis.validateRequired(this.component._required);\n\t\tthis.validateSize(this.component._size);\n\t\tthis.validateValue(this.component._value);\n\t}\n\n\tprotected onBlur(event: Event): void {\n\t\t/**\n\t\t * Beim Screenreader NVDA wird der Placeholder mit\n\t\t * vorgelesen. Somit kann es vorkommen, dass das\n\t\t * Label und der Placeholder vorgelesen werden.\n\t\t *\n\t\t * Aufgrund dessen, dass das Label immer vorgelesen\n\t\t * werden muss, kann das zusätzliche Vorlesen des\n\t\t * Placeholders störend sein.\n\t\t *\n\t\t * Damit beim Fokussieren das \"doppelte\" vorlesen\n\t\t * vermieden werden kann, wird der Placeholder für\n\t\t * den fokussierten Feldstatus entfernt.\n\t\t *\n\t\t * Hinweis: Für alle Nutzenden müssen die all dar-\n\t\t * gestellten Inhalte, also auch der Place-\n\t\t * holder, gleichermaßen zugänglich sein.\n\t\t * Das oben beschriebene Handling erfüllt\n\t\t * diese Anforderung nicht.\n\t\t */\n\t\tthis.component.state = {\n\t\t\t...this.component.state,\n\t\t\t_placeholder: this.placeholderCache,\n\t\t};\n\t\tthis.placeholderCache = undefined;\n\t\tsuper.onBlur(event);\n\t}\n\n\tprotected onFocus(event: Event): void {\n\t\tthis.placeholderCache = this.component.state._placeholder as string;\n\t\tthis.component.state = {\n\t\t\t...this.component.state,\n\t\t\t_placeholder: undefined,\n\t\t};\n\t\tsuper.onFocus(event);\n\t}\n}\n"],"version":3}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* KoliBri - The accessible HTML-Standard
|
|
3
|
+
*/
|
|
4
|
+
"use strict";const prop_validators=require("./prop.validators-b6ab0589.js"),label=require("./label-7742b440.js"),a11y_tipps=require("./a11y.tipps-f5915f9f.js"),associated_controller=require("./associated.controller-e2131335.js"),tabIndex=require("./tab-index-3e4027b0.js"),hideLabel=require("./hide-label-71458adc.js"),getRenderStates=t=>{const e="string"==typeof t._error&&t._error.length>0&&!0===t._touched,o="string"==typeof t._hint&&t._hint.length>0,i=[];return!0===e&&i.push(`${t._id}-error`),!0===o&&i.push(`${t._id}-hint`),{hasError:e,hasHint:o,ariaDescribedBy:i}},validateAdjustHeight=(t,e)=>{prop_validators.watchBoolean(t,"_adjustHeight",e)},validateTouched=(t,e)=>{prop_validators.watchBoolean(t,"_touched",e)};class ControlledInputController extends associated_controller.AssociatedInputController{constructor(t,e,o){super(t,e,o),this.component=t}validateAlert(t){prop_validators.watchBoolean(this.component,"_alert",t)}validateTouched(t){validateTouched(this.component,t)}componentWillLoad(){super.componentWillLoad(),this.validateAlert(this.component._alert),this.validateTouched(this.component._touched)}}class InputController extends ControlledInputController{constructor(t,e,o){super(t,e,o),this.valueChangeListeners=[],this.onFacade={onBlur:this.onBlur.bind(this),onChange:this.onChange.bind(this),onClick:this.onClick.bind(this),onFocus:this.onFocus.bind(this)},this.component=t}validateAccessKey(t){prop_validators.watchString(this.component,"_accessKey",t)}validateAdjustHeight(t){validateAdjustHeight(this.component,t)}validateDisabled(t){prop_validators.watchBoolean(this.component,"_disabled",t),!0===t&&a11y_tipps.a11yHintDisabled()}validateError(t){prop_validators.watchString(this.component,"_error",t)}validateHideLabel(t){hideLabel.validateHideLabel(this.component,t,{hooks:{afterPatch:()=>{this.component.state._hideLabel&&a11y_tipps.a11yHint("Property hide-label for inputs: Only use for exceptions like search inputs that are clearly identifiable by their context.")}}})}validateHint(t){prop_validators.watchString(this.component,"_hint",t)}validateId(t){prop_validators.watchString(this.component,"_id",t,{hooks:{afterPatch:()=>{this.setAttribute("id",this.formAssociated,this.component.state._id)}},minLength:1}),""!==t&&void 0!==t||a11y_tipps.devHint("Eine eindeutige ID an den Eingabefeldern ist nicht zwingend erforderlich, könnte aber für die E2E-Tests relevant sein.")}validateLabel(t){label.validateLabelWithExpertSlot(this.component,t)}validateOn(t){"object"==typeof t&&prop_validators.setState(this.component,"_on",t)}validateSmartButton(t){prop_validators.objectObjectHandler(t,(()=>{try{t=prop_validators.parseJson(t)}catch(t){}prop_validators.setState(this.component,"_smartButton",t)}))}validateTabIndex(t){tabIndex.validateTabIndex(this.component,t)}componentWillLoad(){super.componentWillLoad(),this.validateAccessKey(this.component._accessKey),this.validateAdjustHeight(this.component._adjustHeight),this.validateError(this.component._error),this.validateDisabled(this.component._disabled),this.validateHideLabel(this.component._hideLabel),this.validateHint(this.component._hint),this.validateId(this.component._id),this.validateLabel(this.component._label),this.validateSmartButton(this.component._smartButton),this.validateOn(this.component._on),this.validateTabIndex(this.component._tabIndex)}onBlur(t){var e;this.component._alert=!0,this.component._touched=!0,associated_controller.stopPropagation(t),associated_controller.tryToDispatchKoliBriEvent("blur",this.host),"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onBlur)&&this.component._on.onBlur(t)}onChange(t){var e;const o=t.target.value;associated_controller.stopPropagation(t),associated_controller.tryToDispatchKoliBriEvent("change",this.host,o),this.setFormAssociatedValue(o),"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onChange)&&this.component._on.onChange(t,o),this.valueChangeListeners.forEach((t=>t(o)))}onClick(t){var e;associated_controller.stopPropagation(t),associated_controller.tryToDispatchKoliBriEvent("click",this.host),"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onClick)&&this.component._on.onClick(t)}onFocus(t){var e;this.component._alert=!0,associated_controller.stopPropagation(t),associated_controller.tryToDispatchKoliBriEvent("focus",this.host),"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onFocus)&&this.component._on.onFocus(t)}setValue(t,e){var o;this.setFormAssociatedValue(e),"function"==typeof(null===(o=this.component._on)||void 0===o?void 0:o.onChange)&&this.component._on.onChange(t,e)}addValueChangeListener(t){this.valueChangeListeners.push(t)}}exports.InputController=InputController,exports.getRenderStates=getRenderStates;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"controller-089fee12.js","mappings":";;;;;;;;;;;;MASa,eAAe,GAAG,CAAC,KAK/B;EAKA,MAAM,QAAQ,GAAG,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC;EACxG,MAAM,OAAO,GAAG,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;EAE1E,MAAM,eAAe,GAAa,EAAE,CAAC;EACrC,IAAI,QAAQ,KAAK,IAAI,EAAE;IACtB,eAAe,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,GAAG,QAAQ,CAAC,CAAC;GAC3C;EACD,IAAI,OAAO,KAAK,IAAI,EAAE;IACrB,eAAe,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC;GAC1C;EACD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;AAC/C;;ACfO,MAAM,oBAAoB,GAAG,CAAC,SAAoC,EAAE,KAA4B;EACtGA,4BAAY,CAAC,SAAS,EAAE,eAAe,EAAE,KAAK,CAAC,CAAC;AACjD,CAAC;;ACFM,MAAM,eAAe,GAAG,CAAC,SAAoC,EAAE,KAAuB;EAC5FA,4BAAY,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;AAC5C,CAAC;;MCVY,yBAA0B,SAAQC,+CAAyB;EAGvE,YAAmB,SAA4C,EAAE,IAAY,EAAE,IAAkB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AC,GAAG,0CAAE,OAAO,CAAA,KAAK,UAAU,EAAE;MACtD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;KAClC;GACD;EAES,OAAO,CAAC,KAAY;;IAC7B,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC;IAG7BD,qCAAe,CAAC,KAAK,CAAC,CAAC;IACvBC,+CAAyB,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAG9C,IAAI,QAAO,MAAA,IAAI,CAAC,SAAS,CAAC,GAAG,0CAAE,OAAO,CAAA,KAAK,UAAU,EAAE;MACtD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;KAClC;GACD;EAEM,QAAQ,CAAC,KAAY,EAAE,KAAgC;;IAC7D,IAAI,CAAC,sBAAsB,CAAC,KAAe,CAAC,CAAC;IAC7C,IAAI,QAAO,MAAA,IAAI,CAAC,SAAS,CAAC,GAAG,0CAAE,QAAQ,CAAA,KAAK,UAAU,EAAE;MACvD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;KAC1C;GACD;EAEM,sBAAsB,CAAC,QAA6B;IAC1D,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;GACzC;;;;;;","names":["watchBoolean","AssociatedInputController","watchString","a11yHintDisabled","validateHideLabel","a11yHint","devHint","validateLabelWithExpertSlot","setState","objectObjectHandler","parseJson","validateTabIndex","stopPropagation","tryToDispatchKoliBriEvent"],"sources":["src/components/input/controller.ts","src/types/props/adjust-height.ts","src/types/props/touched.ts","src/components/input-adapter-leanup/controller.ts","src/components/@deprecated/input/controller.ts"],"sourcesContent":["import { TouchedPropType } from '../../types/props/touched';\n\n/**\n * Berechnet in Abhängigkeit des Component-State, wie die\n * aria-describedby-Attributs gesetzt werden sollen.\n *\n * @param state State der Component\n * @returns Render-States\n */\nexport const getRenderStates = (state: {\n\t_error?: string;\n\t_hint?: string;\n\t_id: string;\n\t_touched?: TouchedPropType;\n}): {\n\thasError: boolean;\n\thasHint: boolean;\n\tariaDescribedBy: string[];\n} => {\n\tconst hasError = typeof state._error === 'string' && state._error.length > 0 && state._touched === true;\n\tconst hasHint = typeof state._hint === 'string' && state._hint.length > 0;\n\n\tconst ariaDescribedBy: string[] = [];\n\tif (hasError === true) {\n\t\tariaDescribedBy.push(`${state._id}-error`);\n\t}\n\tif (hasHint === true) {\n\t\tariaDescribedBy.push(`${state._id}-hint`);\n\t}\n\treturn { hasError, hasHint, ariaDescribedBy };\n};\n","import { Generic } from '@a11y-ui/core';\n\nimport { watchBoolean } from '../../utils/prop.validators';\n\n/* types */\nexport type AdjustHeightPropType = boolean;\n\n/**\n * Adjusts the height of the element to its content.\n */\nexport type PropAdjustHeight = {\n\tadjustHeight: AdjustHeightPropType;\n};\n\n/* validator */\nexport const validateAdjustHeight = (component: Generic.Element.Component, value?: AdjustHeightPropType): void => {\n\twatchBoolean(component, '_adjustHeight', value);\n};\n","import { Generic } from '@a11y-ui/core';\n\nimport { watchBoolean } from '../../utils/prop.validators';\n\n/* types */\nexport type TouchedPropType = boolean;\n\n/**\n * Shows if the input was touched by a user.\n */\nexport type PropTouched = {\n\ttouched: TouchedPropType;\n};\n\n/* validator */\nexport const validateTouched = (component: Generic.Element.Component, value?: TouchedPropType): void => {\n\twatchBoolean(component, '_touched', value);\n};\n","import { Generic } from '@a11y-ui/core';\n\nimport { validateTouched } from '../../types/props/touched';\nimport { watchBoolean } from '../../utils/prop.validators';\nimport { AssociatedInputController } from './associated.controller';\nimport { Props, Watches } from './types';\n\nexport class ControlledInputController extends AssociatedInputController implements Watches {\n\tprotected readonly component: Generic.Element.Component & Props;\n\n\tpublic constructor(component: Generic.Element.Component & Props, name: string, host?: HTMLElement) {\n\t\tsuper(component, name, host);\n\t\tthis.component = component;\n\t}\n\n\tpublic validateAlert(value?: boolean): void {\n\t\twatchBoolean(this.component, '_alert', value);\n\t}\n\n\tpublic validateTouched(value?: boolean): void {\n\t\tvalidateTouched(this.component, value);\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tsuper.componentWillLoad();\n\t\tthis.validateAlert(this.component._alert);\n\t\tthis.validateTouched(this.component._touched);\n\t}\n}\n","import { Generic } from '@a11y-ui/core';\n\nimport { InputTypeOnDefault } from '../../../types/input/types';\nimport { AdjustHeightPropType, validateAdjustHeight } from '../../../types/props/adjust-height';\nimport { LabelWithExpertSlotPropType, validateLabelWithExpertSlot } from '../../../types/props/label';\nimport { a11yHint, a11yHintDisabled, devHint } from '../../../utils/a11y.tipps';\nimport { stopPropagation, tryToDispatchKoliBriEvent } from '../../../utils/events';\nimport { objectObjectHandler, parseJson, setState, watchBoolean, watchString } from '../../../utils/prop.validators';\nimport { validateTabIndex } from '../../../utils/validators/tab-index';\nimport { ControlledInputController } from '../../input-adapter-leanup/controller';\nimport { Props as ButtonProps } from '../../button/types';\nimport { Props as AdapterProps } from '../../input-adapter-leanup/types';\nimport { Props, Watches } from './types';\nimport { validateHideLabel } from '../../../types/props/hide-label';\n\ntype ValueChangeListener = (value: string) => void;\n\nexport class InputController extends ControlledInputController implements Watches {\n\tprotected readonly component: Generic.Element.Component & Props & AdapterProps;\n\n\tprivate readonly valueChangeListeners: ValueChangeListener[] = [];\n\n\tpublic constructor(component: Generic.Element.Component & Props, name: string, host?: HTMLElement) {\n\t\tsuper(component, name, host);\n\t\tthis.component = component;\n\t}\n\n\tpublic validateAccessKey(value?: string): void {\n\t\twatchString(this.component, '_accessKey', value);\n\t}\n\n\tpublic validateAdjustHeight(value?: AdjustHeightPropType): void {\n\t\tvalidateAdjustHeight(this.component, value);\n\t}\n\n\tpublic validateDisabled(value?: boolean): void {\n\t\twatchBoolean(this.component, '_disabled', value);\n\t\tif (value === true) {\n\t\t\ta11yHintDisabled();\n\t\t}\n\t}\n\n\tpublic validateError(value?: string): void {\n\t\twatchString(this.component, '_error', value);\n\t}\n\n\tpublic validateHideLabel(value?: boolean): void {\n\t\tvalidateHideLabel(this.component, value, {\n\t\t\thooks: {\n\t\t\t\tafterPatch: () => {\n\t\t\t\t\tif (this.component.state._hideLabel) {\n\t\t\t\t\t\ta11yHint('Property hide-label for inputs: Only use for exceptions like search inputs that are clearly identifiable by their context.');\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\t}\n\n\tpublic validateHint(value?: string): void {\n\t\twatchString(this.component, '_hint', value);\n\t}\n\n\tpublic validateId(value?: string): void {\n\t\twatchString(this.component, '_id', value, {\n\t\t\thooks: {\n\t\t\t\tafterPatch: () => {\n\t\t\t\t\tthis.setAttribute('id', this.formAssociated, this.component.state._id as string);\n\t\t\t\t},\n\t\t\t},\n\t\t\tminLength: 1,\n\t\t});\n\t\tif (value === '' || typeof value === 'undefined') {\n\t\t\tdevHint(`Eine eindeutige ID an den Eingabefeldern ist nicht zwingend erforderlich, könnte aber für die E2E-Tests relevant sein.`);\n\t\t}\n\t}\n\n\tpublic validateLabel(value?: LabelWithExpertSlotPropType): void {\n\t\tvalidateLabelWithExpertSlot(this.component, value);\n\t}\n\n\tpublic validateOn(value?: InputTypeOnDefault): void {\n\t\tif (typeof value === 'object') {\n\t\t\tsetState(this.component, '_on', value);\n\t\t}\n\t}\n\n\tpublic validateSmartButton(value?: ButtonProps | string): void {\n\t\tobjectObjectHandler(value, () => {\n\t\t\ttry {\n\t\t\t\tvalue = parseJson<ButtonProps>(value as string);\n\t\t\t\t// eslint-disable-next-line no-empty\n\t\t\t} catch (e) {\n\t\t\t\t// value behält den ursprünglichen Wert\n\t\t\t}\n\t\t\tsetState(this.component, '_smartButton', value);\n\t\t});\n\t}\n\n\tpublic validateTabIndex(value?: number): void {\n\t\tvalidateTabIndex(this.component, value);\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tsuper.componentWillLoad();\n\t\tthis.validateAccessKey(this.component._accessKey);\n\t\tthis.validateAdjustHeight(this.component._adjustHeight);\n\t\tthis.validateError(this.component._error);\n\t\tthis.validateDisabled(this.component._disabled);\n\t\tthis.validateHideLabel(this.component._hideLabel);\n\t\tthis.validateHint(this.component._hint);\n\t\tthis.validateId(this.component._id);\n\t\tthis.validateLabel(this.component._label);\n\t\tthis.validateSmartButton(this.component._smartButton);\n\t\tthis.validateOn(this.component._on);\n\t\tthis.validateTabIndex(this.component._tabIndex);\n\t}\n\n\tprotected onBlur(event: Event): void {\n\t\tthis.component._alert = true;\n\t\tthis.component._touched = true;\n\n\t\t// Event handling\n\t\tstopPropagation(event);\n\t\ttryToDispatchKoliBriEvent('blur', this.host);\n\n\t\t// Callback\n\t\tif (typeof this.component._on?.onBlur === 'function') {\n\t\t\tthis.component._on.onBlur(event);\n\t\t}\n\t}\n\n\tprotected onChange(event: Event): void {\n\t\tconst value = (event.target as HTMLInputElement).value;\n\n\t\t// Event handling\n\t\tstopPropagation(event);\n\t\ttryToDispatchKoliBriEvent('change', this.host, value);\n\n\t\t// Static form handling\n\t\tthis.setFormAssociatedValue(value);\n\n\t\t// Callback\n\t\tif (typeof this.component._on?.onChange === 'function') {\n\t\t\t/**\n\t\t\t * TODO\n\t\t\t * Value-Handling muss für InputDate und InputNumber optimiert werden\n\t\t\t * - value\n\t\t\t * - valueAsNumber\n\t\t\t * - valueAsDate\n\t\t\t */\n\t\t\tthis.component._on.onChange(event, value);\n\t\t}\n\n\t\t/**\n\t\t * TODO: Was ist das?\n\t\t */\n\t\tthis.valueChangeListeners.forEach((listener) => listener(value));\n\t}\n\n\tprotected onClick(event: Event): void {\n\t\t// Event handling\n\t\tstopPropagation(event);\n\t\ttryToDispatchKoliBriEvent('click', this.host);\n\n\t\t// Callback\n\t\tif (typeof this.component._on?.onClick === 'function') {\n\t\t\tthis.component._on.onClick(event);\n\t\t}\n\t}\n\n\tprotected onFocus(event: Event): void {\n\t\tthis.component._alert = true;\n\n\t\t// Event handling\n\t\tstopPropagation(event);\n\t\ttryToDispatchKoliBriEvent('focus', this.host);\n\n\t\t// Callback\n\t\tif (typeof this.component._on?.onFocus === 'function') {\n\t\t\tthis.component._on.onFocus(event);\n\t\t}\n\t}\n\n\tpublic setValue(event: Event, value: string | number | boolean): void {\n\t\tthis.setFormAssociatedValue(value as string);\n\t\tif (typeof this.component._on?.onChange === 'function') {\n\t\t\tthis.component._on.onChange(event, value);\n\t\t}\n\t}\n\n\tpublic addValueChangeListener(listener: ValueChangeListener) {\n\t\tthis.valueChangeListeners.push(listener);\n\t}\n\n\t/**\n\t * Hinweis: In der Subklasse 'InputPasswordController'\n\t * werden die Methoden onBlur und onFocus\n\t * überschrieben.\n\t * Es werden somit zunächst die Methoden der\n\t * Subklasse ausgeführt und danach die der\n\t * Oberklassen.\n\t */\n\tpublic readonly onFacade = {\n\t\tonBlur: this.onBlur.bind(this),\n\t\tonChange: this.onChange.bind(this),\n\t\tonClick: this.onClick.bind(this),\n\t\tonFocus: this.onFocus.bind(this),\n\t};\n}\n"],"version":3}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
"use strict";const prop_validators=require("./prop.validators-b6ab0589.js"),label=require("./label-7742b440.js"),a11y_tipps=require("./a11y.tipps-f5915f9f.js"),reuse=require("./reuse-5fad9b6e.js"),controller=require("./controller-
|
|
4
|
+
"use strict";const prop_validators=require("./prop.validators-b6ab0589.js"),label=require("./label-7742b440.js"),a11y_tipps=require("./a11y.tipps-f5915f9f.js"),reuse=require("./reuse-5fad9b6e.js"),controller=require("./controller-089fee12.js"),validateInputSelectOptions=t=>{if("object"==typeof t&&null!==t){if("string"==typeof t.label&&t.label.length>0)return t.disabled=!0===t.disabled,t.label=`${t.label}`.trim(),!1===label.hasEnoughReadableChars(t.label,3)&&!1===label.containsOnlyNumbers(t.label)&&a11y_tipps.a11yHint(`Ein abweichendes Aria-Label (${t.label}) ist nicht barrierefrei. Ein abweichendes Aria-Label sollte aus mindestens drei lesbaren Zeichen bestehen.`),!Array.isArray(t.options)||void 0===t.options.find((t=>!1===validateInputSelectOptions(t)));if("number"==typeof t.label)return!0}return!1},validateOptions=(t,e,o={})=>{prop_validators.watchJsonArrayString(t,"_options",(t=>"object"==typeof t&&null!==t&&"string"==typeof t.label&&t.label.length>0),e,void 0,o)},validateOptionsWithOptgroup=(t,e,o={})=>{prop_validators.watchJsonArrayString(t,"_options",validateInputSelectOptions,e,void 0,o)},validateRequired=(t,e)=>{prop_validators.watchBoolean(t,"_required",e)},fillKeyOptionMap=(t,e,o="")=>{e.forEach(((e,i)=>{const a=`${o}-${i}`;"object"==typeof e&&null!==e&&"string"==typeof e.label&&e.label.length>0&&(Array.isArray(e.options)?fillKeyOptionMap(t,e.options,a):t.set(a,e))}))};class InputCheckboxRadioController extends controller.InputController{constructor(t,e,o){super(t,e,o),this.component=t}validateRequired(t){validateRequired(this.component,t)}componentWillLoad(){super.componentWillLoad(),this.validateRequired(this.component._required)}}class InputRadioController extends InputCheckboxRadioController{constructor(t,e,o){super(t,e,o),this.keyOptionMap=new Map,this.getOptionByKey=t=>this.keyOptionMap.get(t),this.isValueInOptions=(t,e)=>void 0!==e.find((e=>e.value===t)),this.beforePatchOptions=(t,e)=>{const o=e.has("_options")?e.get("_options"):this.component.state._options;if(Array.isArray(o)&&o.length>0){this.keyOptionMap.clear(),fillKeyOptionMap(this.keyOptionMap,o);const t=e.has("_value")?e.get("_value"):this.component.state._value;if(!1===this.isValueInOptions(t,o)){const t=o[0].value;e.set("_value",t),this.onStateChange()}}},this.component=t}validateOrientation(t){prop_validators.watchValidator(this.component,"_orientation",(t=>"horizontal"===t||"vertical"===t),new Set(["Orientation {horizontal, vertical}"]),t,{defaultValue:"vertical"})}validateOptions(t){validateOptions(this.component,t,{hooks:{beforePatch:this.beforePatchOptions}})}validateValue(t){t=prop_validators.mapString2Unknown(t),t=Array.isArray(t)?t[0]:t,prop_validators.setState(this.component,"_value",t,{beforePatch:this.beforePatchOptions}),this.setFormAssociatedValue(this.component._value)}componentWillLoad(t){super.componentWillLoad(),this.onStateChange=()=>{if("function"==typeof t){const e=setTimeout((()=>{clearTimeout(e),t(reuse.STATE_CHANGE_EVENT)}))}},this.validateOrientation(this.component._orientation),this.validateOptions(this.component._options||this.component._list),this.validateValue(this.component._value)}}exports.InputCheckboxRadioController=InputCheckboxRadioController,exports.InputRadioController=InputRadioController,exports.fillKeyOptionMap=fillKeyOptionMap,exports.validateOptionsWithOptgroup=validateOptionsWithOptgroup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"controller-cbfc7eba.js","mappings":";;;;;;;;;;;AAIO,MAAM,0BAA0B,GAAG,CAAI,MAAuB;EACpE,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,EAAE;IAClD,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;MAChE,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,KAAK,IAAI,CAAC;MAC3C,MAAM,CAAC,KAAK,GAAG,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC;MACxC,IAAIA,4BAAsB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,KAAK,IAAIC,yBAAmB,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,KAAK,EAAE;QACrGC,mBAAQ,CACP,gCAAgC,MAAM,CAAC,KAAK,6GAA6G,CACzJ,CAAC;OACF;MACD,IAAI,KAAK,CAAC,OAAO,CAAE,MAAsB,CAAC,OAAO,CAAC,EAAE;QACnD,QACE,MAAsB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI;UACzC,OAAO,0BAA0B,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC;SAClD,CAAC,KAAK,SAAS,EACf;OACF;MACD,OAAO,IAAI,CAAC;KACZ;SAAM,IAAI,OAAO,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AAK,CAAC;IACpEC,wBAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE;MACzC,WAAW,EAAE,IAAI,CAAC,kBAAkB;KACpC,CAAC,CAAC;IACH,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,SAAS,CAAC,MAAgB,CAAC,CAAC;GAC7D;EAEM,iBAAiB,CAAC,QAAiC;IACzD,KAAK,CAAC,iBAAiB,EAAE,CAAC;IAE1B,IAAI,CAAC,aAAa,GAAG;MACpB,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;QACnC,MAAM,OAAO,GAAG,UAAU,CAAC;UAC1B,YAAY,CAAC,OAAO,CAAC,CAAC;UACtB,QAAQ,CAACC,wBAAkB,CAAC,CAAC;SAC7B,CAAC,CAAC;OACH;KACD,CAAC;IAEF,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IACtD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACtE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;GAC1C;;;;;;;;","names":["hasEnoughReadableChars","containsOnlyNumbers","a11yHint","watchJsonArrayString","watchBoolean","InputController","watchValidator","mapString2Unknown","setState","STATE_CHANGE_EVENT"],"sources":["src/utils/validators/options.ts","src/types/props/options.ts","src/types/props/required.ts","src/components/input-radio/controller.ts"],"sourcesContent":["import { Optgroup, SelectOption } from '../../types/input/types';\nimport { containsOnlyNumbers, hasEnoughReadableChars } from '../../types/props/label';\nimport { a11yHint } from '../a11y.tipps';\n\nexport const validateInputSelectOptions = <T>(option: SelectOption<T>): boolean => {\n\tif (typeof option === 'object' && option !== null) {\n\t\tif (typeof option.label === 'string' && option.label.length > 0) {\n\t\t\toption.disabled = option.disabled === true;\n\t\t\toption.label = `${option.label}`.trim();\n\t\t\tif (hasEnoughReadableChars(option.label, 3) === false && containsOnlyNumbers(option.label) === false) {\n\t\t\t\ta11yHint(\n\t\t\t\t\t`Ein abweichendes Aria-Label (${option.label}) ist nicht barrierefrei. Ein abweichendes Aria-Label sollte aus mindestens drei lesbaren Zeichen bestehen.`\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (Array.isArray((option as Optgroup<T>).options)) {\n\t\t\t\treturn (\n\t\t\t\t\t(option as Optgroup<T>).options.find((item) => {\n\t\t\t\t\t\treturn validateInputSelectOptions(item) === false;\n\t\t\t\t\t}) === undefined\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn true;\n\t\t} else if (typeof option.label === 'number') {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n};\n","import { Generic } from '@a11y-ui/core';\n\nimport { watchJsonArrayString, WatchOptions } from '../../utils/prop.validators';\nimport { validateInputSelectOptions } from '../../utils/validators/options';\nimport { Stringified } from '../common';\nimport { Optgroup, Option } from '../input/types';\nimport { W3CInputValue } from '../w3c';\n\n/* types */\n\nexport type OptionsPropType = Stringified<Option<W3CInputValue>[]>;\nexport type OptionsWithOptgroupPropType = Stringified<(Option<W3CInputValue> | Optgroup<W3CInputValue>)[]>;\n\n/**\n * Options the user can choose from.\n */\nexport type PropOptions = {\n\toptions: OptionsPropType;\n};\n\n/**\n * Options the user can choose from, also supporting Optgroup.\n */\nexport type PropOptionsWithOptgroup = {\n\toptions: OptionsWithOptgroupPropType;\n};\n\n/* validators */\n\nexport const validateOptions = (component: Generic.Element.Component, value: OptionsPropType | undefined, options: WatchOptions = {}): void => {\n\twatchJsonArrayString(\n\t\tcomponent,\n\t\t'_options',\n\t\t(item: Option<W3CInputValue>) => typeof item === 'object' && item !== null && typeof item.label === 'string' && item.label.length > 0,\n\t\tvalue,\n\t\tundefined,\n\t\toptions\n\t);\n};\n\nexport const validateOptionsWithOptgroup = (\n\tcomponent: Generic.Element.Component,\n\tvalue: OptionsWithOptgroupPropType | undefined,\n\toptions: WatchOptions = {}\n) => {\n\twatchJsonArrayString(component, '_options', validateInputSelectOptions, value, undefined, options);\n};\n","import { Generic } from '@a11y-ui/core';\n\nimport { watchBoolean } from '../../utils/prop.validators';\n\n/* types */\ntype RequiredPropType = boolean;\n\n/**\n * Makes the input element required.\n */\nexport type PropRequired = {\n\trequired: RequiredPropType;\n};\n\n/* validator */\nexport const validateRequired = (component: Generic.Element.Component, value?: RequiredPropType): void => {\n\twatchBoolean(component, '_required', value);\n};\n","import { Generic } from '@a11y-ui/core';\n\nimport { Stringified } from '../../types/common';\nimport { Optgroup, Option, SelectOption } from '../../types/input/types';\nimport { Orientation } from '../../types/orientation';\nimport { PropLabelWithExpertSlot } from '../../types/props/label';\nimport { OptionsPropType, validateOptions } from '../../types/props/options';\nimport { validateRequired } from '../../types/props/required';\nimport { StencilUnknown } from '../../types/unknown';\nimport { W3CInputValue } from '../../types/w3c';\nimport { mapString2Unknown, setState, watchValidator } from '../../utils/prop.validators';\nimport { STATE_CHANGE_EVENT } from '../../utils/validator';\nimport { InputController } from '../@deprecated/input/controller';\nimport { Props, Watches } from './types';\n\nexport const fillKeyOptionMap = <T>(keyOptionMap: Map<string, Option<T>>, options: SelectOption<T>[], preKey = ''): void => {\n\toptions.forEach((option, index) => {\n\t\tconst key = `${preKey}-${index}`;\n\t\tif (typeof option === 'object' && option !== null && typeof option.label === 'string' && option.label.length > 0) {\n\t\t\tif (Array.isArray((option as Optgroup<T>).options)) {\n\t\t\t\tfillKeyOptionMap(keyOptionMap, (option as Optgroup<T>).options, key);\n\t\t\t} else {\n\t\t\t\tkeyOptionMap.set(key, option as Option<T>);\n\t\t\t}\n\t\t}\n\t});\n};\n\ntype RequiredProps = PropLabelWithExpertSlot;\ntype OptionalProps = {\n\trequired: boolean;\n};\ntype InputCheckboxRadioProps = Generic.Element.Members<RequiredProps, OptionalProps>;\ntype InputCheckboxRadioWatches = Generic.Element.Watchers<RequiredProps, OptionalProps>;\n\nexport class InputCheckboxRadioController extends InputController implements InputCheckboxRadioWatches {\n\tprotected readonly component: Generic.Element.Component & InputCheckboxRadioProps;\n\n\tpublic constructor(component: Generic.Element.Component & InputCheckboxRadioProps, name: string, host?: HTMLElement) {\n\t\tsuper(component, name, host);\n\t\tthis.component = component;\n\t}\n\n\tpublic validateRequired(value?: boolean): void {\n\t\tvalidateRequired(this.component, value);\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tsuper.componentWillLoad();\n\t\tthis.validateRequired(this.component._required);\n\t}\n}\n\nexport class InputRadioController extends InputCheckboxRadioController implements Watches {\n\tprotected readonly component: Generic.Element.Component & Props;\n\tprivate onStateChange!: () => void;\n\tprivate readonly keyOptionMap = new Map<string, Option<W3CInputValue>>();\n\n\tpublic constructor(component: Generic.Element.Component & Props, name: string, host?: HTMLElement) {\n\t\tsuper(component, name, host);\n\t\tthis.component = component;\n\t}\n\n\tpublic readonly getOptionByKey = (key: string): Option<W3CInputValue> | undefined => this.keyOptionMap.get(key);\n\n\tprivate readonly isValueInOptions = (value: unknown, options: Option<W3CInputValue>[]): boolean => {\n\t\treturn options.find((option) => option.value === value) !== undefined;\n\t};\n\n\tprotected readonly beforePatchOptions = (_value: unknown, nextState: Map<string, unknown>): void => {\n\t\tconst options = nextState.has('_options') ? nextState.get('_options') : this.component.state._options;\n\t\tif (Array.isArray(options) && options.length > 0) {\n\t\t\tthis.keyOptionMap.clear();\n\t\t\tfillKeyOptionMap(this.keyOptionMap, options as SelectOption<W3CInputValue>[]);\n\t\t\tconst value = nextState.has('_value') ? nextState.get('_value') : this.component.state._value;\n\t\t\tif (this.isValueInOptions(value, options as Option<W3CInputValue>[]) === false) {\n\t\t\t\tconst newValue = (\n\t\t\t\t\toptions[0] as {\n\t\t\t\t\t\tvalue: string;\n\t\t\t\t\t}\n\t\t\t\t).value;\n\t\t\t\tnextState.set('_value', newValue);\n\t\t\t\tthis.onStateChange();\n\t\t\t}\n\t\t}\n\t};\n\n\tpublic validateOrientation(value?: Orientation): void {\n\t\twatchValidator(\n\t\t\tthis.component,\n\t\t\t'_orientation',\n\t\t\t(value): boolean => value === 'horizontal' || value === 'vertical',\n\t\t\tnew Set(['Orientation {horizontal, vertical}']),\n\t\t\tvalue,\n\t\t\t{\n\t\t\t\tdefaultValue: 'vertical',\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic validateOptions(value?: OptionsPropType): void {\n\t\tvalidateOptions(this.component, value, {\n\t\t\thooks: {\n\t\t\t\tbeforePatch: this.beforePatchOptions,\n\t\t\t},\n\t\t});\n\t}\n\n\tpublic validateValue(value?: Stringified<StencilUnknown>): void {\n\t\tvalue = mapString2Unknown(value);\n\t\tvalue = Array.isArray(value) ? (value[0] as StencilUnknown) : value;\n\t\tsetState(this.component, '_value', value, {\n\t\t\tbeforePatch: this.beforePatchOptions,\n\t\t});\n\t\tthis.setFormAssociatedValue(this.component._value as string);\n\t}\n\n\tpublic componentWillLoad(onChange?: (event: Event) => void): void {\n\t\tsuper.componentWillLoad();\n\n\t\tthis.onStateChange = () => {\n\t\t\tif (typeof onChange === 'function') {\n\t\t\t\tconst timeout = setTimeout(() => {\n\t\t\t\t\tclearTimeout(timeout);\n\t\t\t\t\tonChange(STATE_CHANGE_EVENT);\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tthis.validateOrientation(this.component._orientation);\n\t\tthis.validateOptions(this.component._options || this.component._list);\n\t\tthis.validateValue(this.component._value);\n\t}\n}\n"],"version":3}
|
|
1
|
+
{"file":"controller-0d0ee1fa.js","mappings":";;;;;;;;;;;AAIO,MAAM,0BAA0B,GAAG,CAAI,MAAuB;EACpE,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,EAAE;IAClD,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;MAChE,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,KAAK,IAAI,CAAC;MAC3C,MAAM,CAAC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AAC;IACtE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;GAC1C;;;;;;;;","names":["hasEnoughReadableChars","containsOnlyNumbers","a11yHint","watchJsonArrayString","watchBoolean","InputController","watchValidator","mapString2Unknown","setState","STATE_CHANGE_EVENT"],"sources":["src/utils/validators/options.ts","src/types/props/options.ts","src/types/props/required.ts","src/components/input-radio/controller.ts"],"sourcesContent":["import { Optgroup, SelectOption } from '../../types/input/types';\nimport { containsOnlyNumbers, hasEnoughReadableChars } from '../../types/props/label';\nimport { a11yHint } from '../a11y.tipps';\n\nexport const validateInputSelectOptions = <T>(option: SelectOption<T>): boolean => {\n\tif (typeof option === 'object' && option !== null) {\n\t\tif (typeof option.label === 'string' && option.label.length > 0) {\n\t\t\toption.disabled = option.disabled === true;\n\t\t\toption.label = `${option.label}`.trim();\n\t\t\tif (hasEnoughReadableChars(option.label, 3) === false && containsOnlyNumbers(option.label) === false) {\n\t\t\t\ta11yHint(\n\t\t\t\t\t`Ein abweichendes Aria-Label (${option.label}) ist nicht barrierefrei. Ein abweichendes Aria-Label sollte aus mindestens drei lesbaren Zeichen bestehen.`\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (Array.isArray((option as Optgroup<T>).options)) {\n\t\t\t\treturn (\n\t\t\t\t\t(option as Optgroup<T>).options.find((item) => {\n\t\t\t\t\t\treturn validateInputSelectOptions(item) === false;\n\t\t\t\t\t}) === undefined\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn true;\n\t\t} else if (typeof option.label === 'number') {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n};\n","import { Generic } from '@a11y-ui/core';\n\nimport { watchJsonArrayString, WatchOptions } from '../../utils/prop.validators';\nimport { validateInputSelectOptions } from '../../utils/validators/options';\nimport { Stringified } from '../common';\nimport { Optgroup, Option } from '../input/types';\nimport { W3CInputValue } from '../w3c';\n\n/* types */\n\nexport type OptionsPropType = Stringified<Option<W3CInputValue>[]>;\nexport type OptionsWithOptgroupPropType = Stringified<(Option<W3CInputValue> | Optgroup<W3CInputValue>)[]>;\n\n/**\n * Options the user can choose from.\n */\nexport type PropOptions = {\n\toptions: OptionsPropType;\n};\n\n/**\n * Options the user can choose from, also supporting Optgroup.\n */\nexport type PropOptionsWithOptgroup = {\n\toptions: OptionsWithOptgroupPropType;\n};\n\n/* validators */\n\nexport const validateOptions = (component: Generic.Element.Component, value: OptionsPropType | undefined, options: WatchOptions = {}): void => {\n\twatchJsonArrayString(\n\t\tcomponent,\n\t\t'_options',\n\t\t(item: Option<W3CInputValue>) => typeof item === 'object' && item !== null && typeof item.label === 'string' && item.label.length > 0,\n\t\tvalue,\n\t\tundefined,\n\t\toptions\n\t);\n};\n\nexport const validateOptionsWithOptgroup = (\n\tcomponent: Generic.Element.Component,\n\tvalue: OptionsWithOptgroupPropType | undefined,\n\toptions: WatchOptions = {}\n) => {\n\twatchJsonArrayString(component, '_options', validateInputSelectOptions, value, undefined, options);\n};\n","import { Generic } from '@a11y-ui/core';\n\nimport { watchBoolean } from '../../utils/prop.validators';\n\n/* types */\ntype RequiredPropType = boolean;\n\n/**\n * Makes the input element required.\n */\nexport type PropRequired = {\n\trequired: RequiredPropType;\n};\n\n/* validator */\nexport const validateRequired = (component: Generic.Element.Component, value?: RequiredPropType): void => {\n\twatchBoolean(component, '_required', value);\n};\n","import { Generic } from '@a11y-ui/core';\n\nimport { Stringified } from '../../types/common';\nimport { Optgroup, Option, SelectOption } from '../../types/input/types';\nimport { Orientation } from '../../types/orientation';\nimport { PropLabelWithExpertSlot } from '../../types/props/label';\nimport { OptionsPropType, validateOptions } from '../../types/props/options';\nimport { validateRequired } from '../../types/props/required';\nimport { StencilUnknown } from '../../types/unknown';\nimport { W3CInputValue } from '../../types/w3c';\nimport { mapString2Unknown, setState, watchValidator } from '../../utils/prop.validators';\nimport { STATE_CHANGE_EVENT } from '../../utils/validator';\nimport { InputController } from '../@deprecated/input/controller';\nimport { Props, Watches } from './types';\n\nexport const fillKeyOptionMap = <T>(keyOptionMap: Map<string, Option<T>>, options: SelectOption<T>[], preKey = ''): void => {\n\toptions.forEach((option, index) => {\n\t\tconst key = `${preKey}-${index}`;\n\t\tif (typeof option === 'object' && option !== null && typeof option.label === 'string' && option.label.length > 0) {\n\t\t\tif (Array.isArray((option as Optgroup<T>).options)) {\n\t\t\t\tfillKeyOptionMap(keyOptionMap, (option as Optgroup<T>).options, key);\n\t\t\t} else {\n\t\t\t\tkeyOptionMap.set(key, option as Option<T>);\n\t\t\t}\n\t\t}\n\t});\n};\n\ntype RequiredProps = PropLabelWithExpertSlot;\ntype OptionalProps = {\n\trequired: boolean;\n};\ntype InputCheckboxRadioProps = Generic.Element.Members<RequiredProps, OptionalProps>;\ntype InputCheckboxRadioWatches = Generic.Element.Watchers<RequiredProps, OptionalProps>;\n\nexport class InputCheckboxRadioController extends InputController implements InputCheckboxRadioWatches {\n\tprotected readonly component: Generic.Element.Component & InputCheckboxRadioProps;\n\n\tpublic constructor(component: Generic.Element.Component & InputCheckboxRadioProps, name: string, host?: HTMLElement) {\n\t\tsuper(component, name, host);\n\t\tthis.component = component;\n\t}\n\n\tpublic validateRequired(value?: boolean): void {\n\t\tvalidateRequired(this.component, value);\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tsuper.componentWillLoad();\n\t\tthis.validateRequired(this.component._required);\n\t}\n}\n\nexport class InputRadioController extends InputCheckboxRadioController implements Watches {\n\tprotected readonly component: Generic.Element.Component & Props;\n\tprivate onStateChange!: () => void;\n\tprivate readonly keyOptionMap = new Map<string, Option<W3CInputValue>>();\n\n\tpublic constructor(component: Generic.Element.Component & Props, name: string, host?: HTMLElement) {\n\t\tsuper(component, name, host);\n\t\tthis.component = component;\n\t}\n\n\tpublic readonly getOptionByKey = (key: string): Option<W3CInputValue> | undefined => this.keyOptionMap.get(key);\n\n\tprivate readonly isValueInOptions = (value: unknown, options: Option<W3CInputValue>[]): boolean => {\n\t\treturn options.find((option) => option.value === value) !== undefined;\n\t};\n\n\tprotected readonly beforePatchOptions = (_value: unknown, nextState: Map<string, unknown>): void => {\n\t\tconst options = nextState.has('_options') ? nextState.get('_options') : this.component.state._options;\n\t\tif (Array.isArray(options) && options.length > 0) {\n\t\t\tthis.keyOptionMap.clear();\n\t\t\tfillKeyOptionMap(this.keyOptionMap, options as SelectOption<W3CInputValue>[]);\n\t\t\tconst value = nextState.has('_value') ? nextState.get('_value') : this.component.state._value;\n\t\t\tif (this.isValueInOptions(value, options as Option<W3CInputValue>[]) === false) {\n\t\t\t\tconst newValue = (\n\t\t\t\t\toptions[0] as {\n\t\t\t\t\t\tvalue: string;\n\t\t\t\t\t}\n\t\t\t\t).value;\n\t\t\t\tnextState.set('_value', newValue);\n\t\t\t\tthis.onStateChange();\n\t\t\t}\n\t\t}\n\t};\n\n\tpublic validateOrientation(value?: Orientation): void {\n\t\twatchValidator(\n\t\t\tthis.component,\n\t\t\t'_orientation',\n\t\t\t(value): boolean => value === 'horizontal' || value === 'vertical',\n\t\t\tnew Set(['Orientation {horizontal, vertical}']),\n\t\t\tvalue,\n\t\t\t{\n\t\t\t\tdefaultValue: 'vertical',\n\t\t\t}\n\t\t);\n\t}\n\n\tpublic validateOptions(value?: OptionsPropType): void {\n\t\tvalidateOptions(this.component, value, {\n\t\t\thooks: {\n\t\t\t\tbeforePatch: this.beforePatchOptions,\n\t\t\t},\n\t\t});\n\t}\n\n\tpublic validateValue(value?: Stringified<StencilUnknown>): void {\n\t\tvalue = mapString2Unknown(value);\n\t\tvalue = Array.isArray(value) ? (value[0] as StencilUnknown) : value;\n\t\tsetState(this.component, '_value', value, {\n\t\t\tbeforePatch: this.beforePatchOptions,\n\t\t});\n\t\tthis.setFormAssociatedValue(this.component._value as string);\n\t}\n\n\tpublic componentWillLoad(onChange?: (event: Event) => void): void {\n\t\tsuper.componentWillLoad();\n\n\t\tthis.onStateChange = () => {\n\t\t\tif (typeof onChange === 'function') {\n\t\t\t\tconst timeout = setTimeout(() => {\n\t\t\t\t\tclearTimeout(timeout);\n\t\t\t\t\tonChange(STATE_CHANGE_EVENT);\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tthis.validateOrientation(this.component._orientation);\n\t\tthis.validateOptions(this.component._options || this.component._list);\n\t\tthis.validateValue(this.component._value);\n\t}\n}\n"],"version":3}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
"use strict";const controller=require("./controller-
|
|
4
|
+
"use strict";const controller=require("./controller-05364c23.js"),suggestions=require("./suggestions-3b2a9e9a.js"),prop_validators=require("./prop.validators-b6ab0589.js");class InputTextEmailController extends controller.InputPasswordController{constructor(t,e,o){super(t,e,o),this.component=t}validateList(){}validateSuggestions(t){suggestions.validateSuggestions(this.component,t)}componentWillLoad(){super.componentWillLoad(),this.validateSuggestions(this.component._suggestions||this.component._list)}}class InputTextController extends InputTextEmailController{constructor(t,e,o){super(t,e,o),this.hasError=!1,this.component=t}validateType(t){prop_validators.watchValidator(this.component,"_type",(t=>"string"==typeof t&&("text"===t||"search"===t||"url"===t||"tel"===t)),new Set(["String {text, search, url, tel}"]),t)}validateHasCounter(t){controller.validateHasCounter(this.component,t)}componentWillLoad(){super.componentWillLoad(),this.validateType(this.component._type),this.validateHasCounter(this.component._hasCounter)}}exports.InputTextController=InputTextController,exports.InputTextEmailController=InputTextEmailController;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"controller-
|
|
1
|
+
{"file":"controller-b3c90050.js","mappings":";;;;;;;;;MAmBa,wBAAyB,SAAQA,kCAAuB;EAGpE,YAAmB,SAA0D,EAAE,IAAY,EAAE,IAAkB;IAC9G,KAAK,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC7B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;GAC3B;EAMM,YAAY,MAAW;EAEvB,mBAAmB,CAAC,KAA2B;IACrDC,+BAAmB,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;GAC3C;EAEM,iBAAiB;IACvB,KAAK,CAAC,iBAAiB,EAAE,CAAC;IAC1B,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;GAC9E;CACD;MAEY,mBAAoB,SAAQ,wBAAwB;EAKhE,YAAmB,SAAqD,EAAE,IAAY,EAAE,IAAkB;IACzG,KAAK,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAHvB,aAAQ,GAAG,KAAK,CAAC;IAIvB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;GAC3B;EAEM,YAAY,CAAC,KAAqB;IACxCC,8BAAc,CACb,IAAI,CAAC,SAAS,EACd,OAAO,EACP,CAAC,KAAK,KAAc,OAAO,KAAK,KAAK,QAAQ,KAAK,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,KAAK,CAAC,EAC/H,IAAI,GAAG,CAAC,CAAC,iCAAiC,CAAC,CAAC,EAC5C,KAAK,CACL,CAAC;GACF;EAEM,kBAAkB,CAAC,KAAe;IACxCC,6BAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;GAC1C;EAEM,iBAAiB;IACvB,KAAK,CAAC,iBAAiB,EAAE,CAAC;IAC1B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACxC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;GACpD;;;;;;","names":["InputPasswordController","validateSuggestions","watchValidator","validateHasCounter"],"sources":["src/components/input-text/controller.ts"],"sourcesContent":["import { Generic } from '@a11y-ui/core';\n\nimport { Stringified } from '../../types/common';\nimport { InputTextType } from '../../types/input/control/text';\nimport { validateHasCounter } from '../../types/props/has-counter';\nimport { PropLabelWithExpertSlot } from '../../types/props/label';\nimport { PropSuggestions, SuggestionsPropType, validateSuggestions } from '../../types/props/suggestions';\nimport { watchValidator } from '../../utils/prop.validators';\nimport { InputPasswordController } from '../input-password/controller';\nimport { Props as InputTextProps, Watches as InputTextWatches } from './types';\n\ntype RequiredProps = PropLabelWithExpertSlot;\ntype OptionalProps = {\n\tid: string;\n\tlist: Stringified<string[]>;\n} & PropSuggestions;\ntype InputTextEmailProps = Generic.Element.Members<RequiredProps, OptionalProps>;\ntype InputTextEmailWatches = Generic.Element.Watchers<RequiredProps, OptionalProps>;\n\nexport class InputTextEmailController extends InputPasswordController implements InputTextEmailWatches {\n\tprotected readonly component: Generic.Element.Component & InputTextEmailProps;\n\n\tpublic constructor(component: Generic.Element.Component & InputTextEmailProps, name: string, host?: HTMLElement) {\n\t\tsuper(component, name, host);\n\t\tthis.component = component;\n\t}\n\n\t/**\n\t * @deprecated remains to satisfy `Watches` interface\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-empty-function\n\tpublic validateList(): void {}\n\n\tpublic validateSuggestions(value?: SuggestionsPropType): void {\n\t\tvalidateSuggestions(this.component, value);\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tsuper.componentWillLoad();\n\t\tthis.validateSuggestions(this.component._suggestions || this.component._list);\n\t}\n}\n\nexport class InputTextController extends InputTextEmailController implements InputTextWatches {\n\tprotected readonly component: Generic.Element.Component & InputTextProps;\n\n\tpublic hasError = false;\n\n\tpublic constructor(component: Generic.Element.Component & InputTextProps, name: string, host?: HTMLElement) {\n\t\tsuper(component, name, host);\n\t\tthis.component = component;\n\t}\n\n\tpublic validateType(value?: InputTextType): void {\n\t\twatchValidator(\n\t\t\tthis.component,\n\t\t\t'_type',\n\t\t\t(value): boolean => typeof value === 'string' && (value === 'text' || value === 'search' || value === 'url' || value === 'tel'),\n\t\t\tnew Set(['String {text, search, url, tel}']),\n\t\t\tvalue\n\t\t);\n\t}\n\n\tpublic validateHasCounter(value?: boolean): void {\n\t\tvalidateHasCounter(this.component, value);\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tsuper.componentWillLoad();\n\t\tthis.validateType(this.component._type);\n\t\tthis.validateHasCounter(this.component._hasCounter);\n\t}\n}\n"],"version":3}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
"use strict";const icon=require("./icon-4cc2d4a0.js"),prop_validators=require("./prop.validators-b6ab0589.js"),reuse=require("./reuse-5fad9b6e.js"),controller=require("./controller-
|
|
4
|
+
"use strict";const icon=require("./icon-4cc2d4a0.js"),prop_validators=require("./prop.validators-b6ab0589.js"),reuse=require("./reuse-5fad9b6e.js"),controller=require("./controller-089fee12.js"),beforePatchIcon=(o,e)=>{const t=o;"object"==typeof t&&null!==t&&(reuse.isString(t.right,1)&&(t.right={icon:t.right}),reuse.isString(t.left,1)&&(t.left={icon:t.left}),e.set("_icon",t))};class InputIconController extends controller.InputController{constructor(o,e,t){super(o,e,t),this.component=o}validateIcon(o){prop_validators.objectObjectHandler(o,(()=>{try{o=prop_validators.parseJson(o)}catch(o){}prop_validators.watchValidator(this.component,"_icon",(o=>"object"==typeof o&&null!==o&&(reuse.isString(o.left,1)||icon.isIcon(o.left)||reuse.isString(o.right,1)||icon.isIcon(o.right))),new Set(["KoliBriHorizontalIcon"]),o,{hooks:{beforePatch:beforePatchIcon},required:!0})}))}componentWillLoad(){super.componentWillLoad(),this.validateIcon(this.component._icon)}}exports.InputIconController=InputIconController;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"controller-icon-
|
|
1
|
+
{"file":"controller-icon-dfd87d21.js","mappings":";;;;;;;;;;AAUA,MAAM,eAAe,GAAG,CAAC,KAAc,EAAE,SAA+B;EACvE,MAAM,IAAI,GAAG,KAA8B,CAAC;EAC5C,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI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CACD,CAAC;KACF,CAAC,CAAC;GACH;EAEM,iBAAiB;IACvB,KAAK,CAAC,iBAAiB,EAAE,CAAC;IAC1B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;GACxC;;;;;","names":["isString","InputController","objectObjectHandler","parseJson","watchValidator","isIcon"],"sources":["src/components/@deprecated/input/controller-icon.ts"],"sourcesContent":["import { Generic } from '@a11y-ui/core';\n\nimport { Stringified } from '../../../types/common';\nimport { KoliBriHorizontalIcon } from '../../../types/icon';\nimport { isIcon } from '../../../types/props/icon';\nimport { objectObjectHandler, parseJson, watchValidator } from '../../../utils/prop.validators';\nimport { isString } from '../../../utils/validator';\nimport { InputController } from './controller';\nimport { Props, Watches } from './types-icon';\n\nconst beforePatchIcon = (value: unknown, nextState: Map<string, unknown>): void => {\n\tconst icon = value as KoliBriHorizontalIcon;\n\tif (typeof icon === 'object' && icon !== null) {\n\t\tif (isString(icon.right, 1)) {\n\t\t\ticon.right = { icon: icon.right as string };\n\t\t}\n\t\tif (isString(icon.left, 1)) {\n\t\t\ticon.left = { icon: icon.left as string };\n\t\t}\n\t\tnextState.set('_icon', icon);\n\t}\n};\n\nexport class InputIconController extends InputController implements Watches {\n\tprotected readonly component: Generic.Element.Component & Props;\n\n\tpublic constructor(component: Generic.Element.Component & Props, name: string, host?: HTMLElement) {\n\t\tsuper(component, name, host);\n\t\tthis.component = component;\n\t}\n\n\tpublic validateIcon(value?: Stringified<KoliBriHorizontalIcon>): void {\n\t\tobjectObjectHandler(value, () => {\n\t\t\ttry {\n\t\t\t\tvalue = parseJson<KoliBriHorizontalIcon>(value as string);\n\t\t\t\t// eslint-disable-next-line no-empty\n\t\t\t} catch (e) {\n\t\t\t\t// value behält den ursprünglichen Wert\n\t\t\t}\n\t\t\twatchValidator(\n\t\t\t\tthis.component,\n\t\t\t\t'_icon',\n\t\t\t\t(value): boolean => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\ttypeof value === 'object' && value !== null && (isString(value.left, 1) || isIcon(value.left) || isString(value.right, 1) || isIcon(value.right))\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tnew Set(['KoliBriHorizontalIcon']),\n\t\t\t\tvalue,\n\t\t\t\t{\n\t\t\t\t\thooks: {\n\t\t\t\t\t\tbeforePatch: beforePatchIcon,\n\t\t\t\t\t},\n\t\t\t\t\trequired: true,\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tsuper.componentWillLoad();\n\t\tthis.validateIcon(this.component._icon);\n\t}\n}\n"],"version":3}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"hide-label-71458adc.js","mappings":";;;;;;;MAea,iBAAiB,GAAG,CAAC,SAAoC,EAAE,KAAyB,EAAE,UAA+B,EAAE;EACnIA,4BAAY,CAAC,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AACvD;;;;","names":["watchBoolean"],"sources":["src/types/props/hide-label.ts"],"sourcesContent":["import { Generic } from '@a11y-ui/core';\n\nimport { watchBoolean, WatchBooleanOptions } from '../../utils/prop.validators';\n\n/* types */\nexport type HideLabelPropType = boolean;\n\n/**\n * Tells the element to hide the label.\n */\nexport type PropHideLabel = {\n\thideLabel: HideLabelPropType;\n};\n\n/* validator */\nexport const validateHideLabel = (component: Generic.Element.Component, value?: HideLabelPropType, options: WatchBooleanOptions = {}): void => {\n\twatchBoolean(component, '_hideLabel', value, options);\n};\n"],"version":3}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"kol-abbr.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,6sBAA6sB;;MCiBxtB,OAAO;;;IACF,UAAK,GAAGA,eAAK,EAAE,CAAC;;yBAwBqB,KAAK;;iBAc3B;MAC/B,MAAM,EAAE,GAAG;MACX,aAAa,EAAE,KAAK;KACpB;;EAvCM,MAAM;IACZ,QACCC,QAACC,UAAI,QAEJD,qCAAuB,IAAI,CAAC,KAAK,EAAE,IAAI,EAAC,YAAY,EAAC,QAAQ,EAAC,GAAG,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,IACzFA,kBAAM,KAAK,EAAC,EAAE,IACbA,qBAAQ,CACF,CACD,EACPA,yBAAa,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAgB,CACnG,EACN;GACF;EAsCM,aAAa,CAAC,KAAqB;IACzCE,mBAAa,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;GAC3B;EAGM,aAAa,CAAC,KAAc;IAClC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;GAC1B;EAGM,oBAAoB,CAAC,KAA4B;IACvDC,iCAAoB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;GAClC;EAEM,iBAAiB;IACvB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/C,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;GAC9C;;;;;;;;;;;;;","names":["nonce","h","Host","validateLabel","validateTooltipAlign"],"sources":["src/components/abbr/style.css?tag=kol-abbr&mode=default&encapsulation=shadow","src/components/abbr/component.tsx"],"sourcesContent":["@import url(../style.css);\n:host > abbr {\n\tcursor: help;\n}\n","import { Component, h, Host, JSX, Prop, State, Watch } from '@stencil/core';\n\nimport { LabelPropType, validateLabel } from '../../types/props/label';\nimport { nonce } from '../../utils/dev.utils';\nimport { API, States } from './types';\nimport { TooltipAlignPropType, validateTooltipAlign } from '../../types/props/tooltip-align';\n\n/**\n * @slot - Der Begriff, der erläutert werden soll.\n */\n@Component({\n\ttag: 'kol-abbr',\n\tstyleUrls: {\n\t\tdefault: './style.css',\n\t},\n\tshadow: true,\n})\nexport class KolAbbr implements API {\n\tprivate readonly nonce = nonce();\n\n\tpublic render(): JSX.Element {\n\t\treturn (\n\t\t\t<Host>\n\t\t\t\t{/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */}\n\t\t\t\t<abbr aria-labelledby={this.nonce} role=\"definition\" tabindex=\"0\" title={this.state._label}>\n\t\t\t\t\t<span title=\"\">\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t</span>\n\t\t\t\t</abbr>\n\t\t\t\t<kol-tooltip _align={this.state._tooltipAlign} _id={this.nonce} _label={this.state._label}></kol-tooltip>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t/**\n\t * Setzt die sichtbare oder semantische Beschriftung der Komponente (z.B. Aria-Label, Label, Headline, Caption, Summary usw.).\n\t */\n\t@Prop() public _label?: LabelPropType;\n\n\t/**\n\t * Defines where to show the Tooltip preferably: top, right, bottom or left.\n\t */\n\t@Prop() public _tooltipAlign?: TooltipAlignPropType = 'top';\n\n\t/**\n\t * Dieses Property gibt die Beschreibung oder Erläuterung der Abkürzung an.\n\t * @deprecated Use _label.\n\t */\n\t@Prop() public _title?: string;\n\n\t/**\n\t * Die State-Parameter repräsentieren den inneren State\n\t * einer Komponente.\n\t *\n\t * @see: https://stenciljs.com/docs/state\n\t */\n\t@State() public state: States = {\n\t\t_label: '…', // ⚠ required\n\t\t_tooltipAlign: 'top',\n\t};\n\n\t/**\n\t * Die Watch-Methoden dienen der Möglichkeit zur\n\t * Validierung der Werte eines Properties und\n\t * dem Mapping dessen auf einen anderen internen\n\t * State-Typ.\n\t *\n\t * @see: https://stenciljs.com/docs/properties#prop-validation\n\t */\n\t@Watch('_label')\n\tpublic validateLabel(value?: LabelPropType): void {\n\t\tvalidateLabel(this, value);\n\t}\n\n\t@Watch('_title')\n\tpublic validateTitle(value?: string): void {\n\t\tthis.validateLabel(value);\n\t}\n\n\t@Watch('_tooltipAlign')\n\tpublic validateTooltipAlign(value?: TooltipAlignPropType): void {\n\t\tvalidateTooltipAlign(this, value);\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tthis.validateLabel(this._label || this._title);\n\t\tthis.validateTooltipAlign(this._tooltipAlign);\n\t}\n}\n"],"version":3}
|
|
1
|
+
{"file":"kol-abbr.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,6sBAA6sB;;MCiBxtB,OAAO;;;IACF,UAAK,GAAGA,eAAK,EAAE,CAAC;;yBAwBqB,KAAK;;iBAc3B;MAC/B,MAAM,EAAE,GAAG;MACX,aAAa,EAAE,KAAK;KACpB;;EAvCM,MAAM;IACZ,QACCC,QAACC,UAAI,QAEJD,qCAAuB,IAAI,CAAC,KAAK,EAAE,IAAI,EAAC,YAAY,EAAC,QAAQ,EAAC,GAAG,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,IACzFA,kBAAM,KAAK,EAAC,EAAE,IACbA,qBAAQ,CACF,CACD,EACPA,yBAAa,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAgB,CACnG,EACN;GACF;EAsCM,aAAa,CAAC,KAAqB;IACzCE,mBAAa,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;GAC3B;EAGM,aAAa,CAAC,KAAc;IAClC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;GAC1B;EAGM,oBAAoB,CAAC,KAA4B;IACvDC,iCAAoB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;GAClC;EAEM,iBAAiB;IACvB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/C,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;GAC9C;;;;;;;;;;;;;","names":["nonce","h","Host","validateLabel","validateTooltipAlign"],"sources":["src/components/abbr/style.css?tag=kol-abbr&mode=default&encapsulation=shadow","src/components/abbr/component.tsx"],"sourcesContent":["@import url(../style.css);\n:host > abbr {\n\tcursor: help;\n}\n","import { Component, h, Host, JSX, Prop, State, Watch } from '@stencil/core';\n\nimport { LabelPropType, validateLabel } from '../../types/props/label';\nimport { nonce } from '../../utils/dev.utils';\nimport { API, States } from './types';\nimport { TooltipAlignPropType, validateTooltipAlign } from '../../types/props/tooltip-align';\n\n/**\n * @slot - Der Begriff, der erläutert werden soll.\n */\n@Component({\n\ttag: 'kol-abbr',\n\tstyleUrls: {\n\t\tdefault: './style.css',\n\t},\n\tshadow: true,\n})\nexport class KolAbbr implements API {\n\tprivate readonly nonce = nonce();\n\n\tpublic render(): JSX.Element {\n\t\treturn (\n\t\t\t<Host>\n\t\t\t\t{/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */}\n\t\t\t\t<abbr aria-labelledby={this.nonce} role=\"definition\" tabindex=\"0\" title={this.state._label}>\n\t\t\t\t\t<span title=\"\">\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t</span>\n\t\t\t\t</abbr>\n\t\t\t\t<kol-tooltip _align={this.state._tooltipAlign} _id={this.nonce} _label={this.state._label}></kol-tooltip>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t/**\n\t * Setzt die sichtbare oder semantische Beschriftung der Komponente (z.B. Aria-Label, Label, Headline, Caption, Summary usw.).\n\t */\n\t@Prop() public _label?: LabelPropType;\n\n\t/**\n\t * Defines where to show the Tooltip preferably: top, right, bottom or left.\n\t */\n\t@Prop() public _tooltipAlign?: TooltipAlignPropType = 'top';\n\n\t/**\n\t * Deprecated: Dieses Property gibt die Beschreibung oder Erläuterung der Abkürzung an.\n\t * @deprecated Use _label.\n\t */\n\t@Prop() public _title?: string;\n\n\t/**\n\t * Die State-Parameter repräsentieren den inneren State\n\t * einer Komponente.\n\t *\n\t * @see: https://stenciljs.com/docs/state\n\t */\n\t@State() public state: States = {\n\t\t_label: '…', // ⚠ required\n\t\t_tooltipAlign: 'top',\n\t};\n\n\t/**\n\t * Die Watch-Methoden dienen der Möglichkeit zur\n\t * Validierung der Werte eines Properties und\n\t * dem Mapping dessen auf einen anderen internen\n\t * State-Typ.\n\t *\n\t * @see: https://stenciljs.com/docs/properties#prop-validation\n\t */\n\t@Watch('_label')\n\tpublic validateLabel(value?: LabelPropType): void {\n\t\tvalidateLabel(this, value);\n\t}\n\n\t@Watch('_title')\n\tpublic validateTitle(value?: string): void {\n\t\tthis.validateLabel(value);\n\t}\n\n\t@Watch('_tooltipAlign')\n\tpublic validateTooltipAlign(value?: TooltipAlignPropType): void {\n\t\tvalidateTooltipAlign(this, value);\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tthis.validateLabel(this._label || this._title);\n\t\tthis.validateTooltipAlign(this._tooltipAlign);\n\t}\n}\n"],"version":3}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"kol-accordion.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;AAeO,MAAM,YAAY,GAAG,CAAC,SAAoC,EAAE,KAAoB;EACtFA,4BAAY,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACzC,CAAC;;ACjBD,MAAM,eAAe,GAAG,i7BAAi7B;;ACcz8BC,sBAAW,CAAC;;;;yCAI6B,CAAC,CAAC;AAC3CA,sBAAW,CAAC,iEAAiE,CAAC,CAAC;MAelE,YAAY;;;IACP,UAAK,GAAGC,eAAK,EAAE,CAAC;IACzB,mBAAc,GAAuB,IAAI,CAAC;IAC1C,0BAAqB,GAAuB,IAAI,CAAC;IACjD,oBAAe,GAA0B,IAAI,CAAC;IAC9C,eAAU,GAAG,KAAK,CAAC;IAEV,wBAAmB,GAAG,CAAC,OAAqB;MAC5D,IAAI,OAAO;QAAE,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;KAC3C,CAAC;IACe,+BAA0B,GAAG,CAAC,OAAqB;MACnE,IAAI,OAAO;QAAE,IAAI,CAAC,qBAAqB,GAAG,OAAO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,eAAe,IAAI,IAAI,CAAC,cAAc;QAAE,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;KACnG,CAAC,CAAC;IAEH,UAAU,CAAC;MACV,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;KACvB,EAAE,GAAG,CAAC,CAAC;GACR;;;;;;;;;;;;;;;","names":["watchBoolean","featureHint","nonce","h","Host","validateLabel","watchHeadingLevel","setState","processEnv"],"sources":["src/types/props/open.ts","src/components/accordion/style.css?tag=kol-accordion&mode=default&encapsulation=shadow","src/components/accordion/component.tsx"],"sourcesContent":["import { Generic } from '@a11y-ui/core';\n\nimport { watchBoolean } from '../../utils/prop.validators';\n\n/* types */\nexport type OpenPropType = boolean;\n\n/**\n * If set (to true) opens/expands the element, closes if not set (or set to false).\n */\nexport type PropOpen = {\n\topen: OpenPropType;\n};\n\n/* validator */\nexport const validateOpen = (component: Generic.Element.Component, value?: OpenPropType): void => {\n\twatchBoolean(component, '_open', value);\n};\n","@import url(../style.css);\n@import url(../host-display-block.css);\n/*\n * Inside a button the label text ist always centered.\n * So we need text align left.\n */\n.accordion kol-heading-wc kol-button-wc button kol-span-wc {\n\tjustify-items: start;\n}\n.content {\n\tinset: 0 0 auto 0;\n\twidth: 100%;\n}\n.transition {\n\ttransition: height 0.3s ease-in-out;\n}\n/* https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion */\n@media (prefers-reduced-motion) {\n\t.transition {\n\t\ttransition-duration: 0s;\n\t}\n}\n","// https://codepen.io/mbxtr/pen/OJPOYg?html-preprocessor=haml\n\nimport { Component, h, Host, JSX, Prop, State, Watch } from '@stencil/core';\n\nimport { HeadingLevel } from '../../types/heading-level';\nimport { LabelPropType, validateLabel } from '../../types/props/label';\nimport { OpenPropType, validateOpen } from '../../types/props/open';\nimport { featureHint } from '../../utils/a11y.tipps';\nimport { nonce } from '../../utils/dev.utils';\nimport { setState } from '../../utils/prop.validators';\nimport { processEnv } from '../../utils/reuse';\nimport { watchHeadingLevel } from '../heading/validation';\nimport { API, KoliBriAccordionCallbacks, States } from './types';\n\nfeatureHint(`[KolAccordion] Anfrage nach einer KolAccordionGroup bei dem immer nur ein Accordion geöffnet ist.\n\n- onClick auf der KolAccordion anwenden\n- Click-Event prüft den _open-Status der Accordions\n- Logik Öffnet und Schließt entsprechend`);\nfeatureHint(`[KolAccordion] Tab-Sperre des Inhalts im geschlossenen Zustand.`);\n\n/**\n *\n * @slot - Ermöglicht das Einfügen beliebigen HTML's in den Inhaltsbereich des Accordions.\n * @slot content - Ermöglicht das Einfügen beliebigen HTML's in den Inhaltsbereich des Accordions.\n * @slot header - Deprecated für Version 2: Ermöglicht das Einfügen beliebigen HTML's in den Kopfbereich des Accordions.\n */\n@Component({\n\ttag: 'kol-accordion',\n\tstyleUrls: {\n\t\tdefault: './style.css',\n\t},\n\tshadow: true,\n})\nexport class KolAccordion implements API {\n\tprivate readonly nonce = nonce();\n\tprivate contentElement: HTMLElement | null = null;\n\tprivate contentWrapperElement: HTMLElement | null = null;\n\tprivate contentObserver: ResizeObserver | null = null;\n\tprivate transition = false;\n\n\tprivate readonly catchContentElement = (element?: HTMLElement) => {\n\t\tif (element) this.contentElement = element;\n\t};\n\tprivate readonly catchContentWrapperElement = (element?: HTMLElement) => {\n\t\tif (element) this.contentWrapperElement = element;\n\t};\n\n\tresizeWrapper(list?: ResizeObserverEntry[]) {\n\t\tconst content = this.contentElement;\n\t\tconst wrapper = this.contentWrapperElement;\n\t\tconst observer = this.contentObserver;\n\t\tif (content && wrapper && observer) {\n\t\t\tif (this._open) {\n\t\t\t\twrapper.style.display = 'block';\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\twrapper.style.height = `${content?.clientHeight ?? 0}px`;\n\t\t\t\t});\n\t\t\t\tif (!list) observer.observe(content);\n\t\t\t\twrapper.addEventListener(\n\t\t\t\t\t'transitionend',\n\t\t\t\t\t() => {\n\t\t\t\t\t\twrapper.style.overflow = '';\n\t\t\t\t\t},\n\t\t\t\t\t{ once: true }\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\twrapper.style.overflow = 'hidden';\n\t\t\t\tobserver.unobserve(content);\n\t\t\t\twrapper.style.height = '0';\n\t\t\t\tif (this.transition) {\n\t\t\t\t\twrapper.addEventListener(\n\t\t\t\t\t\t'transitionend',\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\twrapper.style.display = 'none';\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ once: true }\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\twrapper.style.display = 'none';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic render(): JSX.Element {\n\t\treturn (\n\t\t\t<Host>\n\t\t\t\t<div\n\t\t\t\t\tclass={{\n\t\t\t\t\t\taccordion: true,\n\t\t\t\t\t\topen: this.state._open === true,\n\t\t\t\t\t\tclose: this.state._open !== true,\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<kol-heading-wc _label=\"\" _level={this.state._level}>\n\t\t\t\t\t\t<kol-button-wc\n\t\t\t\t\t\t\t// slot=\"expert\"\n\t\t\t\t\t\t\t_ariaControls={this.nonce}\n\t\t\t\t\t\t\t_ariaExpanded={this.state._open}\n\t\t\t\t\t\t\t_icon={this.state._open ? 'codicon codicon-remove' : 'codicon codicon-add'}\n\t\t\t\t\t\t\t_label={this.state._label}\n\t\t\t\t\t\t\t_on={{ onClick: this.onClick }}\n\t\t\t\t\t\t></kol-button-wc>\n\t\t\t\t\t</kol-heading-wc>\n\t\t\t\t\t<div class=\"header\">\n\t\t\t\t\t\t<slot name=\"header\"></slot>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div ref={this.catchContentWrapperElement} class={{ wrapper: true, transition: this.transition }}>\n\t\t\t\t\t\t<div ref={this.catchContentElement} aria-hidden={this.state._open === false ? 'true' : undefined} class=\"content\" id={this.nonce}>\n\t\t\t\t\t\t\t<slot name=\"content\"></slot> {/* Deprecated for version 2 */}\n\t\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t/**\n\t * Gibt die Beschriftung der Komponente an.\n\t * @deprecated Use _label.\n\t */\n\t@Prop() public _heading?: string;\n\n\t/**\n\t * Setzt die sichtbare oder semantische Beschriftung der Komponente (z.B. Aria-Label, Label, Headline, Caption, Summary usw.).\n\t */\n\t@Prop() public _label?: string;\n\n\t/**\n\t * Gibt an, welchen H-Level von 1 bis 6 die Überschrift hat. Oder bei 0, ob es keine Überschrift ist und als fett gedruckter Text angezeigt werden soll.\n\t */\n\t@Prop() public _level?: HeadingLevel = 1;\n\n\t/**\n\t * Gibt die EventCallback-Funktionen an.\n\t */\n\t@Prop() public _on?: KoliBriAccordionCallbacks;\n\n\t/**\n\t * If set (to true) opens/expands the element, closes if not set (or set to false).\n\t * TODO: Change type back to `OpenPropType` after Stencil#4663 has been resolved\n\t */\n\t@Prop({ mutable: true, reflect: true }) public _open?: boolean = false;\n\n\t@State() public state: States = {\n\t\t_label: '…', // ⚠ required\n\t\t_level: 1,\n\t};\n\n\t@Watch('_heading')\n\tpublic validateHeading(value?: string): void {\n\t\tthis.validateLabel(value);\n\t}\n\n\t@Watch('_label')\n\tpublic validateLabel(value?: LabelPropType): void {\n\t\tvalidateLabel(this, value);\n\t}\n\n\t@Watch('_level')\n\tpublic validateLevel(value?: HeadingLevel): void {\n\t\twatchHeadingLevel(this, value);\n\t}\n\n\t@Watch('_on')\n\tpublic validateOn(value?: KoliBriAccordionCallbacks): void {\n\t\tif (typeof value === 'object' && value !== null && typeof value.onClick === 'function') {\n\t\t\tsetState(this, '_on', value);\n\t\t}\n\t}\n\n\t@Watch('_open')\n\tpublic validateOpen(value?: OpenPropType): void {\n\t\tvalidateOpen(this, value);\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tthis.validateLabel(this._label || this._heading);\n\t\tthis.validateLevel(this._level);\n\t\tthis.validateOn(this._on);\n\t\tthis.validateOpen(this._open);\n\t\tif (processEnv !== 'test') this.contentObserver = new ResizeObserver(this.resizeWrapper.bind(this));\n\t\tsetTimeout(() => {\n\t\t\tif (this.contentObserver && this.contentElement) this.contentObserver.observe(this.contentElement);\n\t\t});\n\t\t// So it does not transition if it is set to open from the start.\n\t\tsetTimeout(() => {\n\t\t\tthis.transition = true;\n\t\t}, 200);\n\t}\n\n\tprivate onClick = (event: Event) => {\n\t\tthis._open = !this._open;\n\t\tthis.resizeWrapper();\n\n\t\t/**\n\t\t * Der Timeout wird benötigt, damit das Event\n\t\t * vom Button- auf das Accordion-Event wechselt.\n\t\t * So ist es dem Anwendenden möglich das _open-\n\t\t * Attribute abzufragen.\n\t\t */\n\t\tsetTimeout(() => {\n\t\t\tif (typeof this.state._on?.onClick === 'function') {\n\t\t\t\tthis.state._on.onClick(event, this._open === true);\n\t\t\t}\n\t\t});\n\t};\n}\n"],"version":3}
|
|
1
|
+
{"file":"kol-accordion.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;AAeO,MAAM,YAAY,GAAG,CAAC,SAAoC,EAAE,KAAoB;EACtFA,4BAAY,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACzC,CAAC;;ACjBD,MAAM,eAAe,GAAG,i7BAAi7B;;ACcz8BC,sBAAW,CAAC;;;;yCAI6B,CAAC,CAAC;AAC3CA,sBAAW,CAAC,iEAAiE,CAAC,CAAC;MAelE,YAAY;;;IACP,UAAK,GAAGC,eAAK,EAAE,CAAC;IACzB,mBAAc,GAAuB,IAAI,CAAC;IAC1C,0BAAqB,GAAuB,IAAI,CAAC;IACjD,oBAAe,GAA0B,IAAI,CAAC;IAC9C,eAAU,GAAG,KAAK,CAAC;IAEV,wBAAmB,GAAG,CAAC,OAAqB;MAC5D,IAAI,OAAO;QAAE,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;KAC3C,CAAC;IACe,+BAA0B,GAAG,CAAC,OAAqB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AAC,CAAC,CAAC;IACpG,UAAU,CAAC;MACV,IAAI,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,cAAc;QAAE,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;KACnG,CAAC,CAAC;IAEH,UAAU,CAAC;MACV,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;KACvB,EAAE,GAAG,CAAC,CAAC;GACR;;;;;;;;;;;;;;;","names":["watchBoolean","featureHint","nonce","h","Host","validateLabel","watchHeadingLevel","setState","processEnv"],"sources":["src/types/props/open.ts","src/components/accordion/style.css?tag=kol-accordion&mode=default&encapsulation=shadow","src/components/accordion/component.tsx"],"sourcesContent":["import { Generic } from '@a11y-ui/core';\n\nimport { watchBoolean } from '../../utils/prop.validators';\n\n/* types */\nexport type OpenPropType = boolean;\n\n/**\n * If set (to true) opens/expands the element, closes if not set (or set to false).\n */\nexport type PropOpen = {\n\topen: OpenPropType;\n};\n\n/* validator */\nexport const validateOpen = (component: Generic.Element.Component, value?: OpenPropType): void => {\n\twatchBoolean(component, '_open', value);\n};\n","@import url(../style.css);\n@import url(../host-display-block.css);\n/*\n * Inside a button the label text ist always centered.\n * So we need text align left.\n */\n.accordion kol-heading-wc kol-button-wc button kol-span-wc {\n\tjustify-items: start;\n}\n.content {\n\tinset: 0 0 auto 0;\n\twidth: 100%;\n}\n.transition {\n\ttransition: height 0.3s ease-in-out;\n}\n/* https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion */\n@media (prefers-reduced-motion) {\n\t.transition {\n\t\ttransition-duration: 0s;\n\t}\n}\n","// https://codepen.io/mbxtr/pen/OJPOYg?html-preprocessor=haml\n\nimport { Component, h, Host, JSX, Prop, State, Watch } from '@stencil/core';\n\nimport { HeadingLevel } from '../../types/heading-level';\nimport { LabelPropType, validateLabel } from '../../types/props/label';\nimport { OpenPropType, validateOpen } from '../../types/props/open';\nimport { featureHint } from '../../utils/a11y.tipps';\nimport { nonce } from '../../utils/dev.utils';\nimport { setState } from '../../utils/prop.validators';\nimport { processEnv } from '../../utils/reuse';\nimport { watchHeadingLevel } from '../heading/validation';\nimport { API, KoliBriAccordionCallbacks, States } from './types';\n\nfeatureHint(`[KolAccordion] Anfrage nach einer KolAccordionGroup bei dem immer nur ein Accordion geöffnet ist.\n\n- onClick auf der KolAccordion anwenden\n- Click-Event prüft den _open-Status der Accordions\n- Logik Öffnet und Schließt entsprechend`);\nfeatureHint(`[KolAccordion] Tab-Sperre des Inhalts im geschlossenen Zustand.`);\n\n/**\n *\n * @slot - Ermöglicht das Einfügen beliebigen HTML's in den Inhaltsbereich des Accordions.\n * @slot content - Ermöglicht das Einfügen beliebigen HTML's in den Inhaltsbereich des Accordions.\n * @slot header - Deprecated für Version 2: Ermöglicht das Einfügen beliebigen HTML's in den Kopfbereich des Accordions.\n */\n@Component({\n\ttag: 'kol-accordion',\n\tstyleUrls: {\n\t\tdefault: './style.css',\n\t},\n\tshadow: true,\n})\nexport class KolAccordion implements API {\n\tprivate readonly nonce = nonce();\n\tprivate contentElement: HTMLElement | null = null;\n\tprivate contentWrapperElement: HTMLElement | null = null;\n\tprivate contentObserver: ResizeObserver | null = null;\n\tprivate transition = false;\n\n\tprivate readonly catchContentElement = (element?: HTMLElement) => {\n\t\tif (element) this.contentElement = element;\n\t};\n\tprivate readonly catchContentWrapperElement = (element?: HTMLElement) => {\n\t\tif (element) this.contentWrapperElement = element;\n\t};\n\n\tresizeWrapper(list?: ResizeObserverEntry[]) {\n\t\tconst content = this.contentElement;\n\t\tconst wrapper = this.contentWrapperElement;\n\t\tconst observer = this.contentObserver;\n\t\tif (content && wrapper && observer) {\n\t\t\tif (this._open) {\n\t\t\t\twrapper.style.display = 'block';\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\twrapper.style.height = `${content?.clientHeight ?? 0}px`;\n\t\t\t\t});\n\t\t\t\tif (!list) observer.observe(content);\n\t\t\t\twrapper.addEventListener(\n\t\t\t\t\t'transitionend',\n\t\t\t\t\t() => {\n\t\t\t\t\t\twrapper.style.overflow = '';\n\t\t\t\t\t},\n\t\t\t\t\t{ once: true }\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\twrapper.style.overflow = 'hidden';\n\t\t\t\tobserver.unobserve(content);\n\t\t\t\twrapper.style.height = '0';\n\t\t\t\tif (this.transition) {\n\t\t\t\t\twrapper.addEventListener(\n\t\t\t\t\t\t'transitionend',\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\twrapper.style.display = 'none';\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ once: true }\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\twrapper.style.display = 'none';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic render(): JSX.Element {\n\t\treturn (\n\t\t\t<Host>\n\t\t\t\t<div\n\t\t\t\t\tclass={{\n\t\t\t\t\t\taccordion: true,\n\t\t\t\t\t\topen: this.state._open === true,\n\t\t\t\t\t\tclose: this.state._open !== true,\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<kol-heading-wc _label=\"\" _level={this.state._level}>\n\t\t\t\t\t\t<kol-button-wc\n\t\t\t\t\t\t\t// slot=\"expert\"\n\t\t\t\t\t\t\t_ariaControls={this.nonce}\n\t\t\t\t\t\t\t_ariaExpanded={this.state._open}\n\t\t\t\t\t\t\t_icon={this.state._open ? 'codicon codicon-remove' : 'codicon codicon-add'}\n\t\t\t\t\t\t\t_label={this.state._label}\n\t\t\t\t\t\t\t_on={{ onClick: this.onClick }}\n\t\t\t\t\t\t></kol-button-wc>\n\t\t\t\t\t</kol-heading-wc>\n\t\t\t\t\t<div class=\"header\">\n\t\t\t\t\t\t<slot name=\"header\"></slot>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div ref={this.catchContentWrapperElement} class={{ wrapper: true, transition: this.transition }}>\n\t\t\t\t\t\t<div ref={this.catchContentElement} aria-hidden={this.state._open === false ? 'true' : undefined} class=\"content\" id={this.nonce}>\n\t\t\t\t\t\t\t<slot name=\"content\"></slot> {/* Deprecated for version 2 */}\n\t\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t/**\n\t * Deprecated: Gibt die Beschriftung der Komponente an.\n\t * @deprecated Use _label.\n\t */\n\t@Prop() public _heading?: string;\n\n\t/**\n\t * Setzt die sichtbare oder semantische Beschriftung der Komponente (z.B. Aria-Label, Label, Headline, Caption, Summary usw.).\n\t */\n\t@Prop() public _label?: string;\n\n\t/**\n\t * Gibt an, welchen H-Level von 1 bis 6 die Überschrift hat. Oder bei 0, ob es keine Überschrift ist und als fett gedruckter Text angezeigt werden soll.\n\t */\n\t@Prop() public _level?: HeadingLevel = 1;\n\n\t/**\n\t * Gibt die EventCallback-Funktionen an.\n\t */\n\t@Prop() public _on?: KoliBriAccordionCallbacks;\n\n\t/**\n\t * If set (to true) opens/expands the element, closes if not set (or set to false).\n\t * TODO: Change type back to `OpenPropType` after Stencil#4663 has been resolved\n\t */\n\t@Prop({ mutable: true, reflect: true }) public _open?: boolean = false;\n\n\t@State() public state: States = {\n\t\t_label: '…', // ⚠ required\n\t\t_level: 1,\n\t};\n\n\t@Watch('_heading')\n\tpublic validateHeading(value?: string): void {\n\t\tthis.validateLabel(value);\n\t}\n\n\t@Watch('_label')\n\tpublic validateLabel(value?: LabelPropType): void {\n\t\tvalidateLabel(this, value);\n\t}\n\n\t@Watch('_level')\n\tpublic validateLevel(value?: HeadingLevel): void {\n\t\twatchHeadingLevel(this, value);\n\t}\n\n\t@Watch('_on')\n\tpublic validateOn(value?: KoliBriAccordionCallbacks): void {\n\t\tif (typeof value === 'object' && value !== null && typeof value.onClick === 'function') {\n\t\t\tsetState(this, '_on', value);\n\t\t}\n\t}\n\n\t@Watch('_open')\n\tpublic validateOpen(value?: OpenPropType): void {\n\t\tvalidateOpen(this, value);\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tthis.validateLabel(this._label || this._heading);\n\t\tthis.validateLevel(this._level);\n\t\tthis.validateOn(this._on);\n\t\tthis.validateOpen(this._open);\n\t\tif (processEnv !== 'test') this.contentObserver = new ResizeObserver(this.resizeWrapper.bind(this));\n\t\tsetTimeout(() => {\n\t\t\tif (this.contentObserver && this.contentElement) this.contentObserver.observe(this.contentElement);\n\t\t});\n\t\t// So it does not transition if it is set to open from the start.\n\t\tsetTimeout(() => {\n\t\t\tthis.transition = true;\n\t\t}, 200);\n\t}\n\n\tprivate onClick = (event: Event) => {\n\t\tthis._open = !this._open;\n\t\tthis.resizeWrapper();\n\n\t\t/**\n\t\t * Der Timeout wird benötigt, damit das Event\n\t\t * vom Button- auf das Accordion-Event wechselt.\n\t\t * So ist es dem Anwendenden möglich das _open-\n\t\t * Attribute abzufragen.\n\t\t */\n\t\tsetTimeout(() => {\n\t\t\tif (typeof this.state._on?.onClick === 'function') {\n\t\t\t\tthis.state._on.onClick(event, this._open === true);\n\t\t\t}\n\t\t});\n\t};\n}\n"],"version":3}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* KoliBri - The accessible HTML-Standard
|
|
3
3
|
*/
|
|
4
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const index=require("./index-18912bca.js"),i18n=require("./i18n-0da7ff8e.js"),hasCloser=require("./has-closer-f40fd838.js"),label=require("./label-7742b440.js"),dev_utils=require("./dev.utils-2a489081.js"),prop_validators=require("./prop.validators-b6ab0589.js"),validation=require("./validation-648eeb98.js");require("./index-68e17b5d.js"),require("./index-6a24b8dc.js"),require("./a11y.tipps-f5915f9f.js"),require("./reuse-5fad9b6e.js");const Icon=t=>index.h("kol-icon",{class:"heading-icon",_ariaLabel:"string"==typeof t.label&&t.label.length>0?"":t.ariaLabel,_icon:t.icon}),AlertIcon=t=>{switch(t.type){case"error":return index.h(Icon,{ariaLabel:i18n.translate("kol-error"),icon:"codicon codicon-error",label:t.label});case"info":return index.h(Icon,{ariaLabel:i18n.translate("kol-info"),icon:"codicon codicon-info",label:t.label});case"warning":return index.h(Icon,{ariaLabel:i18n.translate("kol-warning"),icon:"codicon codicon-warning",label:t.label});case"success":return index.h(Icon,{ariaLabel:i18n.translate("kol-success"),icon:"codicon codicon-pass",label:t.label});default:return index.h(Icon,{ariaLabel:i18n.translate("kol-message"),icon:"codicon codicon-comment",label:t.label})}},KolAlertWc=class{constructor(t){index.registerInstance(this,t),this.close=()=>{var t;void 0!==(null===(t=this._on)||void 0===t?void 0:t.onClose)&&this._on.onClose(new Event("Close"))},this.on={onClick:this.close},this.validateOnValue=t=>"object"==typeof t&&null!==t&&"function"==typeof t.onClose,this._alert=!1,this._hasCloser=!1,this._label=void 0,this._level=1,this._on=void 0,this._type="default",this._variant="msg",this.state={_level:1}}render(){var t;if(this.state._alert){try{dev_utils.Log.debug(["Navigator should vibrate ...",navigator.vibrate([100,75,100,75,100])])}catch(t){dev_utils.Log.debug("Navigator does not support vibration.")}setTimeout((()=>{this.validateAlert(!1)}),1e4)}return index.h(index.Host,{class:{[this.state._type]:!0,[this.state._variant]:!0,hasCloser:!!this.state._hasCloser},role:this.state._alert?"alert":void 0},index.h("div",{class:"heading"},index.h(AlertIcon,{label:this.state._label,type:this.state._type}),index.h("div",null,"string"==typeof this.state._label&&(null===(t=this.state._label)||void 0===t?void 0:t.length)>0&&index.h("kol-heading-wc",{_label:this.state._label,_level:this.state._level}),"msg"===this._variant&&index.h("div",{class:"content"},index.h("slot",null))),this.state._hasCloser&&index.h("kol-button-wc",{class:"close",_hideLabel:!0,_icon:{left:{icon:"codicon codicon-close"}},_label:i18n.translate("kol-close"),_on:this.on,_tooltipAlign:"left"})),"card"===this._variant&&index.h("div",{class:"content"},index.h("slot",null)))}validateAlert(t){prop_validators.watchBoolean(this,"_alert",t)}validateHasCloser(t){hasCloser.validateHasCloser(this,t)}validateLabel(t){label.validateLabel(this,t)}validateLevel(t){validation.watchHeadingLevel(this,t)}validateOn(t){this.validateOnValue(t)&&prop_validators.setState(this,"_on",{onClose:t.onClose})}validateType(t){prop_validators.watchValidator(this,"_type",(t=>"string"==typeof t&&("default"===t||"error"===t||"info"===t||"success"===t||"warning"===t)),new Set("String {success, info, warning, error}"),t)}validateVariant(t){prop_validators.watchValidator(this,"_variant",(t=>"card"===t||"msg"===t),new Set("AlertVariant {card, msg}"),t)}componentWillLoad(){this.validateAlert(this._alert),this.validateHasCloser(this._hasCloser),this.validateLabel(this._label),this.validateLevel(this._level),this.validateOn(this._on),this.validateType(this._type),this.validateVariant(this._variant)}static get watchers(){return{_alert:["validateAlert"],_hasCloser:["validateHasCloser"],_label:["validateLabel"],_level:["validateLevel"],_on:["validateOn"],_type:["validateType"],_variant:["validateVariant"]}}},KolInput=class{constructor(t){index.registerInstance(this,t),this._alert=!0,this._currentLength=void 0,this._disabled=!1,this._error="",this._hasCounter=void 0,this._hideLabel=!1,this._hint="",this._icon=void 0,this._id=void 0,this._maxLength=void 0,this._readOnly=!1,this._renderNoLabel=!1,this._required=!1,this._slotName=void 0,this._suggestions=void 0,this._smartButton=void 0,this._touched=!1}render(){var t,i,e,a;const s="string"==typeof this._error&&this._error.length>0&&!0===this._touched,l="string"==typeof this._hint&&this._hint.length>0,n
|
|
4
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const index=require("./index-18912bca.js"),i18n=require("./i18n-0da7ff8e.js"),hasCloser=require("./has-closer-f40fd838.js"),label=require("./label-7742b440.js"),dev_utils=require("./dev.utils-2a489081.js"),prop_validators=require("./prop.validators-b6ab0589.js"),validation=require("./validation-648eeb98.js");require("./index-68e17b5d.js"),require("./index-6a24b8dc.js"),require("./a11y.tipps-f5915f9f.js"),require("./reuse-5fad9b6e.js");const Icon=t=>index.h("kol-icon",{class:"heading-icon",_ariaLabel:"string"==typeof t.label&&t.label.length>0?"":t.ariaLabel,_icon:t.icon}),AlertIcon=t=>{switch(t.type){case"error":return index.h(Icon,{ariaLabel:i18n.translate("kol-error"),icon:"codicon codicon-error",label:t.label});case"info":return index.h(Icon,{ariaLabel:i18n.translate("kol-info"),icon:"codicon codicon-info",label:t.label});case"warning":return index.h(Icon,{ariaLabel:i18n.translate("kol-warning"),icon:"codicon codicon-warning",label:t.label});case"success":return index.h(Icon,{ariaLabel:i18n.translate("kol-success"),icon:"codicon codicon-pass",label:t.label});default:return index.h(Icon,{ariaLabel:i18n.translate("kol-message"),icon:"codicon codicon-comment",label:t.label})}},KolAlertWc=class{constructor(t){index.registerInstance(this,t),this.close=()=>{var t;void 0!==(null===(t=this._on)||void 0===t?void 0:t.onClose)&&this._on.onClose(new Event("Close"))},this.on={onClick:this.close},this.validateOnValue=t=>"object"==typeof t&&null!==t&&"function"==typeof t.onClose,this._alert=!1,this._hasCloser=!1,this._label=void 0,this._level=1,this._on=void 0,this._type="default",this._variant="msg",this.state={_level:1}}render(){var t;if(this.state._alert){try{dev_utils.Log.debug(["Navigator should vibrate ...",navigator.vibrate([100,75,100,75,100])])}catch(t){dev_utils.Log.debug("Navigator does not support vibration.")}setTimeout((()=>{this.validateAlert(!1)}),1e4)}return index.h(index.Host,{class:{[this.state._type]:!0,[this.state._variant]:!0,hasCloser:!!this.state._hasCloser},role:this.state._alert?"alert":void 0},index.h("div",{class:"heading"},index.h(AlertIcon,{label:this.state._label,type:this.state._type}),index.h("div",null,"string"==typeof this.state._label&&(null===(t=this.state._label)||void 0===t?void 0:t.length)>0&&index.h("kol-heading-wc",{_label:this.state._label,_level:this.state._level}),"msg"===this._variant&&index.h("div",{class:"content"},index.h("slot",null))),this.state._hasCloser&&index.h("kol-button-wc",{class:"close",_hideLabel:!0,_icon:{left:{icon:"codicon codicon-close"}},_label:i18n.translate("kol-close"),_on:this.on,_tooltipAlign:"left"})),"card"===this._variant&&index.h("div",{class:"content"},index.h("slot",null)))}validateAlert(t){prop_validators.watchBoolean(this,"_alert",t)}validateHasCloser(t){hasCloser.validateHasCloser(this,t)}validateLabel(t){label.validateLabel(this,t)}validateLevel(t){validation.watchHeadingLevel(this,t)}validateOn(t){this.validateOnValue(t)&&prop_validators.setState(this,"_on",{onClose:t.onClose})}validateType(t){prop_validators.watchValidator(this,"_type",(t=>"string"==typeof t&&("default"===t||"error"===t||"info"===t||"success"===t||"warning"===t)),new Set("String {success, info, warning, error}"),t)}validateVariant(t){prop_validators.watchValidator(this,"_variant",(t=>"card"===t||"msg"===t),new Set("AlertVariant {card, msg}"),t)}componentWillLoad(){this.validateAlert(this._alert),this.validateHasCloser(this._hasCloser),this.validateLabel(this._label),this.validateLevel(this._level),this.validateOn(this._on),this.validateType(this._type),this.validateVariant(this._variant)}static get watchers(){return{_alert:["validateAlert"],_hasCloser:["validateHasCloser"],_label:["validateLabel"],_level:["validateLevel"],_on:["validateOn"],_type:["validateType"],_variant:["validateVariant"]}}},KolInput=class{constructor(t){index.registerInstance(this,t),this._alert=!0,this._currentLength=void 0,this._disabled=!1,this._error="",this._hasCounter=void 0,this._hideLabel=!1,this._hint="",this._icon=void 0,this._id=void 0,this._maxLength=void 0,this._readOnly=!1,this._renderNoLabel=!1,this._required=!1,this._slotName=void 0,this._suggestions=void 0,this._smartButton=void 0,this._touched=!1}render(){var t,i,e,a;const s="string"==typeof this._error&&this._error.length>0&&!0===this._touched,l="string"==typeof this._hint&&this._hint.length>0,n=this._slotName?this._slotName:"input";return index.h(index.Host,{class:{disabled:!0===this._disabled,error:!0===s,"read-only":!0===this._readOnly,required:!0===this._required,touched:!0===this._touched}},!1===this._renderNoLabel&&index.h("label",{id:`${this._id}-label`,hidden:this._hideLabel,htmlFor:this._id},index.h("span",null,index.h("slot",{name:"label"}))),l&&index.h("span",{class:"hint",id:`${this._id}-hint`},this._hint),index.h("div",{class:{input:!0,"icon-left":"object"==typeof(null===(t=this._icon)||void 0===t?void 0:t.left),"icon-right":"object"==typeof(null===(i=this._icon)||void 0===i?void 0:i.right)}},(null===(e=this._icon)||void 0===e?void 0:e.left)&&index.h("kol-icon",{_ariaLabel:"",_icon:this._icon.left.icon}),index.h("slot",{name:n}),"object"==typeof this._smartButton&&null!==this._smartButton&&index.h("kol-button-wc",{_customClass:this._smartButton._customClass,_disabled:this._smartButton._disabled,_icon:this._smartButton._icon,_hideLabel:!0,_id:this._smartButton._id,_label:this._smartButton._label,_on:this._smartButton._on,_tooltipAlign:this._smartButton._tooltipAlign,_variant:this._smartButton._variant}),(null===(a=this._icon)||void 0===a?void 0:a.right)&&index.h("kol-icon",{_ariaLabel:"",_icon:this._icon.right.icon})),s&&index.h("kol-alert",{class:"error",id:`${this._id}-error`,_alert:this._alert,_type:"error",_variant:"msg"},this._error),Array.isArray(this._suggestions)&&this._suggestions.length>0&&index.h("datalist",{id:`${this._id}-list`},this._suggestions.map((t=>index.h("option",{value:t})))),this._hasCounter&&index.h("span",{"aria-atomic":"true","aria-live":"polite"},this._currentLength,this._maxLength&&index.h(index.Fragment,null,index.h("span",{"aria-label":i18n.translate("kol-of"),role:"img"},"/"),this._maxLength)," ",index.h("span",null,i18n.translate("kol-characters"))))}};exports.kol_alert_wc=KolAlertWc,exports.kol_input=KolInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"kol-alert-wc.kol-input.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;AAWA,MAAM,IAAI,GAAG,CAAC,KAA0D;EACvE,OAAOA,sBAAU,KAAK,EAAC,cAAc,EAAC,UAAU,EAAE,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,GAAI,CAAC;AAC3J,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,KAA2C;EAC7D,QAAQ,KAAK,CAAC,IAAI;IACjB,KAAK,OAAO;MACX,OAAOA,QAAC,IAAI,IAAC,SAAS,EAAEC,cAAS,CAAC,WAAW,CAAC,EAAE,IAAI,EAAC,uBAAuB,EAAC,KAAK,EAA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AC,CAAQ,CACpC,CACP,CACK,EACN;GACF;;;;;;","names":["h","translate","Log","Host","watchBoolean","validateHasCloser","validateLabel","watchHeadingLevel","setState","watchValidator","Fragment"],"sources":["src/components/alert/component.tsx","src/components/input/component.tsx"],"sourcesContent":["import { Component, h, Host, JSX, Prop, State, Watch } from '@stencil/core';\n\nimport { translate } from '../../i18n';\nimport { HeadingLevel } from '../../types/heading-level';\nimport { HasCloserPropType, validateHasCloser } from '../../types/props/has-closer';\nimport { LabelPropType, validateLabel } from '../../types/props/label';\nimport { Log } from '../../utils/dev.utils';\nimport { setState, watchBoolean, watchValidator } from '../../utils/prop.validators';\nimport { watchHeadingLevel } from '../heading/validation';\nimport { AlertType, AlertVariant, API, KoliBriAlertEventCallbacks, States } from './types';\n\nconst Icon = (props: { ariaLabel: string; icon: string; label?: string }) => {\n\treturn <kol-icon class=\"heading-icon\" _ariaLabel={typeof props.label === 'string' && props.label.length > 0 ? '' : props.ariaLabel} _icon={props.icon} />;\n};\n\nconst AlertIcon = (props: { label?: string; type?: AlertType }) => {\n\tswitch (props.type) {\n\t\tcase 'error':\n\t\t\treturn <Icon ariaLabel={translate('kol-error')} icon=\"codicon codicon-error\" label={props.label} />;\n\t\tcase 'info':\n\t\t\treturn <Icon ariaLabel={translate('kol-info')} icon=\"codicon codicon-info\" label={props.label} />;\n\t\tcase 'warning':\n\t\t\treturn <Icon ariaLabel={translate('kol-warning')} icon=\"codicon codicon-warning\" label={props.label} />;\n\t\tcase 'success':\n\t\t\treturn <Icon ariaLabel={translate('kol-success')} icon=\"codicon codicon-pass\" label={props.label} />;\n\t\tdefault:\n\t\t\treturn <Icon ariaLabel={translate('kol-message')} icon=\"codicon codicon-comment\" label={props.label} />;\n\t}\n};\n\n/**\n * @slot - Der Inhalt der Meldung.\n */\n@Component({\n\ttag: 'kol-alert-wc',\n\tshadow: false,\n})\nexport class KolAlertWc implements API {\n\tprivate readonly close = () => {\n\t\tif (this._on?.onClose !== undefined) {\n\t\t\tthis._on.onClose(new Event('Close'));\n\t\t}\n\t};\n\n\tprivate readonly on = {\n\t\tonClick: this.close,\n\t};\n\n\tpublic render(): JSX.Element {\n\t\tif (this.state._alert) {\n\t\t\t/**\n\t\t\t * - https://developer.mozilla.org/de/docs/Web/API/Navigator/vibrate\n\t\t\t * - https://googlechrome.github.io/samples/vibration/\n\t\t\t */\n\t\t\ttry {\n\t\t\t\tLog.debug(['Navigator should vibrate ...', navigator.vibrate([100, 75, 100, 75, 100])]);\n\t\t\t} catch (e) {\n\t\t\t\tLog.debug('Navigator does not support vibration.');\n\t\t\t}\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.validateAlert(false);\n\t\t\t}, 10000);\n\t\t}\n\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={{\n\t\t\t\t\t[this.state._type as string]: true,\n\t\t\t\t\t[this.state._variant as string]: true,\n\t\t\t\t\thasCloser: !!this.state._hasCloser,\n\t\t\t\t}}\n\t\t\t\trole={this.state._alert ? 'alert' : undefined}\n\t\t\t>\n\t\t\t\t<div class=\"heading\">\n\t\t\t\t\t<AlertIcon label={this.state._label} type={this.state._type} />\n\t\t\t\t\t<div>\n\t\t\t\t\t\t{typeof this.state._label === 'string' && this.state._label?.length > 0 && (\n\t\t\t\t\t\t\t<kol-heading-wc _label={this.state._label} _level={this.state._level}></kol-heading-wc>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{this._variant === 'msg' && (\n\t\t\t\t\t\t\t<div class=\"content\">\n\t\t\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t\t{this.state._hasCloser && (\n\t\t\t\t\t\t<kol-button-wc\n\t\t\t\t\t\t\tclass=\"close\"\n\t\t\t\t\t\t\t_hideLabel\n\t\t\t\t\t\t\t_icon={{\n\t\t\t\t\t\t\t\tleft: {\n\t\t\t\t\t\t\t\t\ticon: 'codicon codicon-close',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t_label={translate('kol-close')}\n\t\t\t\t\t\t\t_on={this.on}\n\t\t\t\t\t\t\t_tooltipAlign=\"left\"\n\t\t\t\t\t\t></kol-button-wc>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t\t{this._variant === 'card' && (\n\t\t\t\t\t<div class=\"content\">\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t/**\n\t * Gibt an, ob der Screenreader die Meldung aktiv vorlesen soll.\n\t */\n\t@Prop() public _alert?: boolean = false;\n\n\t/**\n\t * Defines whether the element can be closed.\n\t * TODO: Change type back to `HasCloserPropType` after Stencil#4663 has been resolved\n\t */\n\t@Prop() public _hasCloser?: boolean = false;\n\n\t/**\n\t * Setzt die sichtbare oder semantische Beschriftung der Komponente (z.B. Aria-Label, Label, Headline, Caption, Summary usw.).\n\t */\n\t@Prop() public _label?: LabelPropType;\n\n\t/**\n\t * Gibt an, welchen H-Level von 1 bis 6 die Überschrift hat. Oder bei 0, ob es keine Überschrift ist und als fett gedruckter Text angezeigt werden soll.\n\t */\n\t@Prop() public _level?: HeadingLevel = 1;\n\n\t/**\n\t * Gibt die EventCallback-Function für das Schließen des Alerts an.\n\t */\n\t@Prop() public _on?: KoliBriAlertEventCallbacks;\n\n\t/**\n\t * Setzt den Typ der Komponente oder des interaktiven Elements in der Komponente an.\n\t */\n\t@Prop() public _type?: AlertType = 'default';\n\n\t/**\n\t * Gibt an, welche Variante der Darstellung genutzt werden soll.\n\t */\n\t@Prop() public _variant?: AlertVariant = 'msg';\n\n\t@State() public state: States = {\n\t\t_level: 1,\n\t};\n\n\t@Watch('_alert')\n\tpublic validateAlert(value?: boolean): void {\n\t\twatchBoolean(this, '_alert', value);\n\t}\n\n\t@Watch('_hasCloser')\n\tpublic validateHasCloser(value?: HasCloserPropType): void {\n\t\tvalidateHasCloser(this, value);\n\t}\n\n\t@Watch('_label')\n\tpublic validateLabel(value?: LabelPropType): void {\n\t\tvalidateLabel(this, value);\n\t}\n\n\t@Watch('_level')\n\tpublic validateLevel(value?: HeadingLevel): void {\n\t\twatchHeadingLevel(this, value);\n\t}\n\n\tprivate validateOnValue = (value: unknown): boolean =>\n\t\ttypeof value === 'object' && value !== null && typeof (value as KoliBriAlertEventCallbacks).onClose === 'function';\n\n\t@Watch('_on')\n\tpublic validateOn(value?: KoliBriAlertEventCallbacks): void {\n\t\tif (this.validateOnValue(value)) {\n\t\t\tsetState<KoliBriAlertEventCallbacks>(\n\t\t\t\tthis,\n\t\t\t\t'_on',\n\t\t\t\t{\n\t\t\t\t\tonClose: (value as KoliBriAlertEventCallbacks).onClose,\n\t\t\t\t}\n\t\t\t\t// {\n\t\t\t\t// \tafterPatch: (value: unknown) => {\n\t\t\t\t// \t\tthis._hasCloser = this.validateOnValue(value);\n\t\t\t\t// \t},\n\t\t\t\t// }\n\t\t\t);\n\t\t\t// } else {\n\t\t\t// \tsetState<KoliBriAlertEventCallbacks>(this, '_on', null, {\n\t\t\t// \t\tafterPatch: (value: unknown) => {\n\t\t\t// \t\t\tthis._hasCloser = this.validateOnValue(value);\n\t\t\t// \t\t},\n\t\t\t// \t});\n\t\t}\n\t}\n\n\t@Watch('_type')\n\tpublic validateType(value?: AlertType): void {\n\t\twatchValidator(\n\t\t\tthis,\n\t\t\t'_type',\n\t\t\t(value) => typeof value === 'string' && (value === 'default' || value === 'error' || value === 'info' || value === 'success' || value === 'warning'),\n\t\t\tnew Set('String {success, info, warning, error}'),\n\t\t\tvalue\n\t\t);\n\t}\n\n\t@Watch('_variant')\n\tpublic validateVariant(value?: AlertVariant): void {\n\t\twatchValidator(this, '_variant', (value) => value === 'card' || value === 'msg', new Set('AlertVariant {card, msg}'), value);\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tthis.validateAlert(this._alert);\n\t\tthis.validateHasCloser(this._hasCloser);\n\t\tthis.validateLabel(this._label);\n\t\tthis.validateLevel(this._level);\n\t\tthis.validateOn(this._on);\n\t\tthis.validateType(this._type);\n\t\tthis.validateVariant(this._variant);\n\t}\n}\n","/* eslint-disable jsx-a11y/label-has-associated-control */\nimport { Component, Fragment, h, Host, JSX, Prop } from '@stencil/core';\n\nimport { translate } from '../../i18n';\nimport { Props as ButtonProps } from '../button/types';\nimport { Stringified } from '../../types/common';\nimport { KoliBriCustomIcon, KoliBriHorizontalIcon } from '../../types/icon';\nimport { SuggestionsPropType } from '../../types/props/suggestions';\nimport { W3CInputValue } from '../../types/w3c';\nimport { Props } from './types';\nimport { IdPropType } from '../../types/props/id';\n\n/**\n * @internal\n */\n@Component({\n\ttag: 'kol-input',\n\tshadow: false,\n})\nexport class KolInput implements Props {\n\tpublic render(): JSX.Element {\n\t\tconst hasError = typeof this._error === 'string' && this._error.length > 0 && this._touched === true;\n\t\tconst hasHint = typeof this._hint === 'string' && this._hint.length > 0;\n\t\tconst hideLabel = this._hideLabel === true && this._required !== true;\n\t\tconst slotName = this._slotName ? this._slotName : 'input';\n\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={{\n\t\t\t\t\tdisabled: this._disabled === true,\n\t\t\t\t\terror: hasError === true,\n\t\t\t\t\t'read-only': this._readOnly === true,\n\t\t\t\t\trequired: this._required === true,\n\t\t\t\t\ttouched: this._touched === true,\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{this._renderNoLabel === false && (\n\t\t\t\t\t<label id={`${this._id}-label`} hidden={hideLabel} htmlFor={this._id}>\n\t\t\t\t\t\t{/* INFO: span is needed for css styling :after content like a star (*) or optional text ! */}\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t{/* INFO: label comes with any html tag or as plain text! */}\n\t\t\t\t\t\t\t<slot name=\"label\"></slot>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</label>\n\t\t\t\t)}\n\t\t\t\t{hasHint && (\n\t\t\t\t\t<span class=\"hint\" id={`${this._id}-hint`}>\n\t\t\t\t\t\t{this._hint}\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t\t<div\n\t\t\t\t\tclass={{\n\t\t\t\t\t\tinput: true,\n\t\t\t\t\t\t'icon-left': typeof this._icon?.left === 'object',\n\t\t\t\t\t\t'icon-right': typeof this._icon?.right === 'object',\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{this._icon?.left && <kol-icon _ariaLabel=\"\" _icon={(this._icon.left as KoliBriCustomIcon).icon}></kol-icon>}\n\t\t\t\t\t<slot name={slotName}></slot>\n\t\t\t\t\t{typeof this._smartButton === 'object' && this._smartButton !== null && (\n\t\t\t\t\t\t<kol-button-wc\n\t\t\t\t\t\t\t_customClass={this._smartButton._customClass}\n\t\t\t\t\t\t\t_disabled={this._smartButton._disabled}\n\t\t\t\t\t\t\t_icon={this._smartButton._icon}\n\t\t\t\t\t\t\t_hideLabel={true}\n\t\t\t\t\t\t\t_id={this._smartButton._id}\n\t\t\t\t\t\t\t_label={this._smartButton._label}\n\t\t\t\t\t\t\t_on={this._smartButton._on}\n\t\t\t\t\t\t\t_tooltipAlign={this._smartButton._tooltipAlign}\n\t\t\t\t\t\t\t_variant={this._smartButton._variant}\n\t\t\t\t\t\t></kol-button-wc>\n\t\t\t\t\t)}\n\t\t\t\t\t{this._icon?.right && <kol-icon _ariaLabel=\"\" _icon={(this._icon.right as KoliBriCustomIcon).icon}></kol-icon>}\n\t\t\t\t</div>\n\t\t\t\t{hasError && (\n\t\t\t\t\t<kol-alert class=\"error\" id={`${this._id}-error`} _alert={this._alert} _type=\"error\" _variant=\"msg\">\n\t\t\t\t\t\t{this._error}\n\t\t\t\t\t</kol-alert>\n\t\t\t\t)}\n\t\t\t\t{Array.isArray(this._suggestions) && this._suggestions.length > 0 && (\n\t\t\t\t\t<datalist id={`${this._id}-list`}>\n\t\t\t\t\t\t{this._suggestions.map((option: W3CInputValue) => (\n\t\t\t\t\t\t\t<option value={option} />\n\t\t\t\t\t\t))}\n\t\t\t\t\t</datalist>\n\t\t\t\t)}\n\t\t\t\t{this._hasCounter && (\n\t\t\t\t\t<span aria-atomic=\"true\" aria-live=\"polite\">\n\t\t\t\t\t\t{this._currentLength}\n\t\t\t\t\t\t{this._maxLength && (\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t<span aria-label={translate('kol-of')} role=\"img\">\n\t\t\t\t\t\t\t\t\t/\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t{this._maxLength}\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t)}{' '}\n\t\t\t\t\t\t<span>{translate('kol-characters')}</span>\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t/**\n\t * Defines whether the screen-readers should read out the notification.\n\t * TODO: Change type back to `AlertPropType` after Stencil#4663 has been resolved\n\t */\n\t@Prop() public _alert?: boolean = true;\n\n\t/**\n\t * @internal\n\t */\n\t@Prop() public _currentLength?: number;\n\n\t/**\n\t * Makes the element not focusable and ignore all events.\n\t * TODO: Change type back to `DisabledPropType` after Stencil#4663 has been resolved\n\t */\n\t@Prop() public _disabled?: boolean = false;\n\n\t/**\n\t * Gibt den Text für eine Fehlermeldung an.\n\t */\n\t@Prop() public _error?: string = '';\n\n\t/**\n\t * Shows the character count on the lower border of the input.\n\t * TODO: Change type back to `HasCounterPropType` after Stencil#4663 has been resolved\n\t */\n\t@Prop() public _hasCounter?: boolean;\n\n\t/**\n\t * Hides the label and shows the description in a Tooltip instead.\n\t * TODO: Change type back to `HideLabelPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop() public _hideLabel?: boolean = false;\n\n\t/**\n\t * Gibt den Hinweistext an.\n\t */\n\t@Prop() public _hint?: string = '';\n\n\t/**\n\t * Setzt die Iconklasse (z.B.: `_icon=\"codicon codicon-home`).\n\t */\n\t@Prop() public _icon?: KoliBriHorizontalIcon;\n\n\t/**\n\t * Defines the internal ID of the primary component element.\n\t */\n\t@Prop() public _id!: IdPropType;\n\n\t/**\n\t * Gibt an, wie viele Zeichen maximal eingegeben werden können.\n\t */\n\t@Prop() public _maxLength?: number;\n\n\t/**\n\t * Makes the input element read only.\n\t * TODO: Change type back to `ReadOnlyPropType` after Stencil#4663 has been resolved\n\t */\n\t@Prop() public _readOnly?: boolean = false;\n\n\t/**\n\t * Gibt an, ob die Komponente kein Label rendern soll.\n\t */\n\t@Prop() public _renderNoLabel?: boolean = false;\n\n\t/**\n\t * Makes the input element required.\n\t * TODO: Change type back to `RequiredPropType` after Stencil#4663 has been resolved\n\t */\n\t@Prop() public _required?: boolean = false;\n\n\t/**\n\t * Ermöglicht den Slotnamen zu bestimmen. Wird nur verwendet, wenn sonst mehrere Slots mit dem gleichen Namen innerhalb eines Shadow DOMs existieren würden.\n\t * @internal\n\t */\n\t@Prop() public _slotName?: string;\n\n\t/**\n\t * Suggestions to provide for the input.\n\t */\n\t@Prop() public _suggestions?: SuggestionsPropType;\n\n\t/**\n\t * Ermöglicht eine Schaltfläche in das Eingabefeld mit einer beliebigen Aktion zu einzufügen (ohne label).\n\t */\n\t@Prop() public _smartButton?: Stringified<ButtonProps>;\n\n\t/**\n\t * Shows if the input was touched by a user.\n\t * TODO: Change type back to `TouchedPropType` after Stencil#4663 has been resolved\n\t */\n\t@Prop() public _touched?: boolean = false;\n}\n"],"version":3}
|
|
1
|
+
{"file":"kol-alert-wc.kol-input.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;AAWA,MAAM,IAAI,GAAG,CAAC,KAA0D;EACvE,OAAOA,sBAAU,KAAK,EAAC,cAAc,EAAC,UAAU,EAAE,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,GAAI,CAAC;AAC3J,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,KAA2C;EAC7D,QAAQ,KAAK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ACN,CACX,EAAE,GAAG,EACND,sBAAOC,cAAS,CAAC,gBAAgB,CAAC,CAAQ,CACpC,CACP,CACK,EACN;GACF;;;;;;","names":["h","translate","Log","Host","watchBoolean","validateHasCloser","validateLabel","watchHeadingLevel","setState","watchValidator","Fragment"],"sources":["src/components/alert/component.tsx","src/components/input/component.tsx"],"sourcesContent":["import { Component, h, Host, JSX, Prop, State, Watch } from '@stencil/core';\n\nimport { translate } from '../../i18n';\nimport { HeadingLevel } from '../../types/heading-level';\nimport { HasCloserPropType, validateHasCloser } from '../../types/props/has-closer';\nimport { LabelPropType, validateLabel } from '../../types/props/label';\nimport { Log } from '../../utils/dev.utils';\nimport { setState, watchBoolean, watchValidator } from '../../utils/prop.validators';\nimport { watchHeadingLevel } from '../heading/validation';\nimport { AlertType, AlertVariant, API, KoliBriAlertEventCallbacks, States } from './types';\n\nconst Icon = (props: { ariaLabel: string; icon: string; label?: string }) => {\n\treturn <kol-icon class=\"heading-icon\" _ariaLabel={typeof props.label === 'string' && props.label.length > 0 ? '' : props.ariaLabel} _icon={props.icon} />;\n};\n\nconst AlertIcon = (props: { label?: string; type?: AlertType }) => {\n\tswitch (props.type) {\n\t\tcase 'error':\n\t\t\treturn <Icon ariaLabel={translate('kol-error')} icon=\"codicon codicon-error\" label={props.label} />;\n\t\tcase 'info':\n\t\t\treturn <Icon ariaLabel={translate('kol-info')} icon=\"codicon codicon-info\" label={props.label} />;\n\t\tcase 'warning':\n\t\t\treturn <Icon ariaLabel={translate('kol-warning')} icon=\"codicon codicon-warning\" label={props.label} />;\n\t\tcase 'success':\n\t\t\treturn <Icon ariaLabel={translate('kol-success')} icon=\"codicon codicon-pass\" label={props.label} />;\n\t\tdefault:\n\t\t\treturn <Icon ariaLabel={translate('kol-message')} icon=\"codicon codicon-comment\" label={props.label} />;\n\t}\n};\n\n/**\n * @slot - Der Inhalt der Meldung.\n */\n@Component({\n\ttag: 'kol-alert-wc',\n\tshadow: false,\n})\nexport class KolAlertWc implements API {\n\tprivate readonly close = () => {\n\t\tif (this._on?.onClose !== undefined) {\n\t\t\tthis._on.onClose(new Event('Close'));\n\t\t}\n\t};\n\n\tprivate readonly on = {\n\t\tonClick: this.close,\n\t};\n\n\tpublic render(): JSX.Element {\n\t\tif (this.state._alert) {\n\t\t\t/**\n\t\t\t * - https://developer.mozilla.org/de/docs/Web/API/Navigator/vibrate\n\t\t\t * - https://googlechrome.github.io/samples/vibration/\n\t\t\t */\n\t\t\ttry {\n\t\t\t\tLog.debug(['Navigator should vibrate ...', navigator.vibrate([100, 75, 100, 75, 100])]);\n\t\t\t} catch (e) {\n\t\t\t\tLog.debug('Navigator does not support vibration.');\n\t\t\t}\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.validateAlert(false);\n\t\t\t}, 10000);\n\t\t}\n\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={{\n\t\t\t\t\t[this.state._type as string]: true,\n\t\t\t\t\t[this.state._variant as string]: true,\n\t\t\t\t\thasCloser: !!this.state._hasCloser,\n\t\t\t\t}}\n\t\t\t\trole={this.state._alert ? 'alert' : undefined}\n\t\t\t>\n\t\t\t\t<div class=\"heading\">\n\t\t\t\t\t<AlertIcon label={this.state._label} type={this.state._type} />\n\t\t\t\t\t<div>\n\t\t\t\t\t\t{typeof this.state._label === 'string' && this.state._label?.length > 0 && (\n\t\t\t\t\t\t\t<kol-heading-wc _label={this.state._label} _level={this.state._level}></kol-heading-wc>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{this._variant === 'msg' && (\n\t\t\t\t\t\t\t<div class=\"content\">\n\t\t\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t\t{this.state._hasCloser && (\n\t\t\t\t\t\t<kol-button-wc\n\t\t\t\t\t\t\tclass=\"close\"\n\t\t\t\t\t\t\t_hideLabel\n\t\t\t\t\t\t\t_icon={{\n\t\t\t\t\t\t\t\tleft: {\n\t\t\t\t\t\t\t\t\ticon: 'codicon codicon-close',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t_label={translate('kol-close')}\n\t\t\t\t\t\t\t_on={this.on}\n\t\t\t\t\t\t\t_tooltipAlign=\"left\"\n\t\t\t\t\t\t></kol-button-wc>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t\t{this._variant === 'card' && (\n\t\t\t\t\t<div class=\"content\">\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t/**\n\t * Gibt an, ob der Screenreader die Meldung aktiv vorlesen soll.\n\t */\n\t@Prop() public _alert?: boolean = false;\n\n\t/**\n\t * Defines whether the element can be closed.\n\t * TODO: Change type back to `HasCloserPropType` after Stencil#4663 has been resolved\n\t */\n\t@Prop() public _hasCloser?: boolean = false;\n\n\t/**\n\t * Setzt die sichtbare oder semantische Beschriftung der Komponente (z.B. Aria-Label, Label, Headline, Caption, Summary usw.).\n\t */\n\t@Prop() public _label?: LabelPropType;\n\n\t/**\n\t * Gibt an, welchen H-Level von 1 bis 6 die Überschrift hat. Oder bei 0, ob es keine Überschrift ist und als fett gedruckter Text angezeigt werden soll.\n\t */\n\t@Prop() public _level?: HeadingLevel = 1;\n\n\t/**\n\t * Gibt die EventCallback-Function für das Schließen des Alerts an.\n\t */\n\t@Prop() public _on?: KoliBriAlertEventCallbacks;\n\n\t/**\n\t * Defines either the type of the component or of the components interactive element.\n\t */\n\t@Prop() public _type?: AlertType = 'default';\n\n\t/**\n\t * Gibt an, welche Variante der Darstellung genutzt werden soll.\n\t */\n\t@Prop() public _variant?: AlertVariant = 'msg';\n\n\t@State() public state: States = {\n\t\t_level: 1,\n\t};\n\n\t@Watch('_alert')\n\tpublic validateAlert(value?: boolean): void {\n\t\twatchBoolean(this, '_alert', value);\n\t}\n\n\t@Watch('_hasCloser')\n\tpublic validateHasCloser(value?: HasCloserPropType): void {\n\t\tvalidateHasCloser(this, value);\n\t}\n\n\t@Watch('_label')\n\tpublic validateLabel(value?: LabelPropType): void {\n\t\tvalidateLabel(this, value);\n\t}\n\n\t@Watch('_level')\n\tpublic validateLevel(value?: HeadingLevel): void {\n\t\twatchHeadingLevel(this, value);\n\t}\n\n\tprivate validateOnValue = (value: unknown): boolean =>\n\t\ttypeof value === 'object' && value !== null && typeof (value as KoliBriAlertEventCallbacks).onClose === 'function';\n\n\t@Watch('_on')\n\tpublic validateOn(value?: KoliBriAlertEventCallbacks): void {\n\t\tif (this.validateOnValue(value)) {\n\t\t\tsetState<KoliBriAlertEventCallbacks>(\n\t\t\t\tthis,\n\t\t\t\t'_on',\n\t\t\t\t{\n\t\t\t\t\tonClose: (value as KoliBriAlertEventCallbacks).onClose,\n\t\t\t\t}\n\t\t\t\t// {\n\t\t\t\t// \tafterPatch: (value: unknown) => {\n\t\t\t\t// \t\tthis._hasCloser = this.validateOnValue(value);\n\t\t\t\t// \t},\n\t\t\t\t// }\n\t\t\t);\n\t\t\t// } else {\n\t\t\t// \tsetState<KoliBriAlertEventCallbacks>(this, '_on', null, {\n\t\t\t// \t\tafterPatch: (value: unknown) => {\n\t\t\t// \t\t\tthis._hasCloser = this.validateOnValue(value);\n\t\t\t// \t\t},\n\t\t\t// \t});\n\t\t}\n\t}\n\n\t@Watch('_type')\n\tpublic validateType(value?: AlertType): void {\n\t\twatchValidator(\n\t\t\tthis,\n\t\t\t'_type',\n\t\t\t(value) => typeof value === 'string' && (value === 'default' || value === 'error' || value === 'info' || value === 'success' || value === 'warning'),\n\t\t\tnew Set('String {success, info, warning, error}'),\n\t\t\tvalue\n\t\t);\n\t}\n\n\t@Watch('_variant')\n\tpublic validateVariant(value?: AlertVariant): void {\n\t\twatchValidator(this, '_variant', (value) => value === 'card' || value === 'msg', new Set('AlertVariant {card, msg}'), value);\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tthis.validateAlert(this._alert);\n\t\tthis.validateHasCloser(this._hasCloser);\n\t\tthis.validateLabel(this._label);\n\t\tthis.validateLevel(this._level);\n\t\tthis.validateOn(this._on);\n\t\tthis.validateType(this._type);\n\t\tthis.validateVariant(this._variant);\n\t}\n}\n","/* eslint-disable jsx-a11y/label-has-associated-control */\nimport { Component, Fragment, h, Host, JSX, Prop } from '@stencil/core';\n\nimport { translate } from '../../i18n';\nimport { Props as ButtonProps } from '../button/types';\nimport { Stringified } from '../../types/common';\nimport { KoliBriCustomIcon, KoliBriHorizontalIcon } from '../../types/icon';\nimport { SuggestionsPropType } from '../../types/props/suggestions';\nimport { W3CInputValue } from '../../types/w3c';\nimport { Props } from './types';\nimport { IdPropType } from '../../types/props/id';\n\n/**\n * @internal\n */\n@Component({\n\ttag: 'kol-input',\n\tshadow: false,\n})\nexport class KolInput implements Props {\n\tpublic render(): JSX.Element {\n\t\tconst hasError = typeof this._error === 'string' && this._error.length > 0 && this._touched === true;\n\t\tconst hasHint = typeof this._hint === 'string' && this._hint.length > 0;\n\t\tconst slotName = this._slotName ? this._slotName : 'input';\n\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={{\n\t\t\t\t\tdisabled: this._disabled === true,\n\t\t\t\t\terror: hasError === true,\n\t\t\t\t\t'read-only': this._readOnly === true,\n\t\t\t\t\trequired: this._required === true,\n\t\t\t\t\ttouched: this._touched === true,\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{this._renderNoLabel === false && (\n\t\t\t\t\t<label id={`${this._id}-label`} hidden={this._hideLabel} htmlFor={this._id}>\n\t\t\t\t\t\t{/* INFO: span is needed for css styling :after content like a star (*) or optional text ! */}\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t{/* INFO: label comes with any html tag or as plain text! */}\n\t\t\t\t\t\t\t<slot name=\"label\"></slot>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</label>\n\t\t\t\t)}\n\t\t\t\t{hasHint && (\n\t\t\t\t\t<span class=\"hint\" id={`${this._id}-hint`}>\n\t\t\t\t\t\t{this._hint}\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t\t<div\n\t\t\t\t\tclass={{\n\t\t\t\t\t\tinput: true,\n\t\t\t\t\t\t'icon-left': typeof this._icon?.left === 'object',\n\t\t\t\t\t\t'icon-right': typeof this._icon?.right === 'object',\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{this._icon?.left && <kol-icon _ariaLabel=\"\" _icon={(this._icon.left as KoliBriCustomIcon).icon}></kol-icon>}\n\t\t\t\t\t<slot name={slotName}></slot>\n\t\t\t\t\t{typeof this._smartButton === 'object' && this._smartButton !== null && (\n\t\t\t\t\t\t<kol-button-wc\n\t\t\t\t\t\t\t_customClass={this._smartButton._customClass}\n\t\t\t\t\t\t\t_disabled={this._smartButton._disabled}\n\t\t\t\t\t\t\t_icon={this._smartButton._icon}\n\t\t\t\t\t\t\t_hideLabel={true}\n\t\t\t\t\t\t\t_id={this._smartButton._id}\n\t\t\t\t\t\t\t_label={this._smartButton._label}\n\t\t\t\t\t\t\t_on={this._smartButton._on}\n\t\t\t\t\t\t\t_tooltipAlign={this._smartButton._tooltipAlign}\n\t\t\t\t\t\t\t_variant={this._smartButton._variant}\n\t\t\t\t\t\t></kol-button-wc>\n\t\t\t\t\t)}\n\t\t\t\t\t{this._icon?.right && <kol-icon _ariaLabel=\"\" _icon={(this._icon.right as KoliBriCustomIcon).icon}></kol-icon>}\n\t\t\t\t</div>\n\t\t\t\t{hasError && (\n\t\t\t\t\t<kol-alert class=\"error\" id={`${this._id}-error`} _alert={this._alert} _type=\"error\" _variant=\"msg\">\n\t\t\t\t\t\t{this._error}\n\t\t\t\t\t</kol-alert>\n\t\t\t\t)}\n\t\t\t\t{Array.isArray(this._suggestions) && this._suggestions.length > 0 && (\n\t\t\t\t\t<datalist id={`${this._id}-list`}>\n\t\t\t\t\t\t{this._suggestions.map((option: W3CInputValue) => (\n\t\t\t\t\t\t\t<option value={option} />\n\t\t\t\t\t\t))}\n\t\t\t\t\t</datalist>\n\t\t\t\t)}\n\t\t\t\t{this._hasCounter && (\n\t\t\t\t\t<span aria-atomic=\"true\" aria-live=\"polite\">\n\t\t\t\t\t\t{this._currentLength}\n\t\t\t\t\t\t{this._maxLength && (\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t<span aria-label={translate('kol-of')} role=\"img\">\n\t\t\t\t\t\t\t\t\t/\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t{this._maxLength}\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t)}{' '}\n\t\t\t\t\t\t<span>{translate('kol-characters')}</span>\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t/**\n\t * Defines whether the screen-readers should read out the notification.\n\t * TODO: Change type back to `AlertPropType` after Stencil#4663 has been resolved\n\t */\n\t@Prop() public _alert?: boolean = true;\n\n\t/**\n\t * @internal\n\t */\n\t@Prop() public _currentLength?: number;\n\n\t/**\n\t * Makes the element not focusable and ignore all events.\n\t * TODO: Change type back to `DisabledPropType` after Stencil#4663 has been resolved\n\t */\n\t@Prop() public _disabled?: boolean = false;\n\n\t/**\n\t * Gibt den Text für eine Fehlermeldung an.\n\t */\n\t@Prop() public _error?: string = '';\n\n\t/**\n\t * Shows the character count on the lower border of the input.\n\t * TODO: Change type back to `HasCounterPropType` after Stencil#4663 has been resolved\n\t */\n\t@Prop() public _hasCounter?: boolean;\n\n\t/**\n\t * Hides the label and shows the description in a Tooltip instead.\n\t * TODO: Change type back to `HideLabelPropType` after Stencil#4663 has been resolved.\n\t */\n\t@Prop() public _hideLabel?: boolean = false;\n\n\t/**\n\t * Gibt den Hinweistext an.\n\t */\n\t@Prop() public _hint?: string = '';\n\n\t/**\n\t * Setzt die Iconklasse (z.B.: `_icon=\"codicon codicon-home`).\n\t */\n\t@Prop() public _icon?: KoliBriHorizontalIcon;\n\n\t/**\n\t * Defines the internal ID of the primary component element.\n\t */\n\t@Prop() public _id!: IdPropType;\n\n\t/**\n\t * Gibt an, wie viele Zeichen maximal eingegeben werden können.\n\t */\n\t@Prop() public _maxLength?: number;\n\n\t/**\n\t * Makes the input element read only.\n\t * TODO: Change type back to `ReadOnlyPropType` after Stencil#4663 has been resolved\n\t */\n\t@Prop() public _readOnly?: boolean = false;\n\n\t/**\n\t * Gibt an, ob die Komponente kein Label rendern soll.\n\t */\n\t@Prop() public _renderNoLabel?: boolean = false;\n\n\t/**\n\t * Makes the input element required.\n\t * TODO: Change type back to `RequiredPropType` after Stencil#4663 has been resolved\n\t */\n\t@Prop() public _required?: boolean = false;\n\n\t/**\n\t * Ermöglicht den Slotnamen zu bestimmen. Wird nur verwendet, wenn sonst mehrere Slots mit dem gleichen Namen innerhalb eines Shadow DOMs existieren würden.\n\t * @internal\n\t */\n\t@Prop() public _slotName?: string;\n\n\t/**\n\t * Suggestions to provide for the input.\n\t */\n\t@Prop() public _suggestions?: SuggestionsPropType;\n\n\t/**\n\t * Ermöglicht eine Schaltfläche in das Eingabefeld mit einer beliebigen Aktion zu einzufügen (ohne label).\n\t */\n\t@Prop() public _smartButton?: Stringified<ButtonProps>;\n\n\t/**\n\t * Shows if the input was touched by a user.\n\t * TODO: Change type back to `TouchedPropType` after Stencil#4663 has been resolved\n\t */\n\t@Prop() public _touched?: boolean = false;\n}\n"],"version":3}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"kol-alert.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,eAAe,GAAG,g0BAAg0B;;MCgB30B,QAAQ;;;kBAsBc,KAAK;
|
|
1
|
+
{"file":"kol-alert.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,eAAe,GAAG,g0BAAg0B;;MCgB30B,QAAQ;;;kBAsBc,KAAK;sBAMD,KAAK;;;kBAgBJ,CAAC;;iBAUL,SAAS;oBAKH,KAAK;iBAEd;MAC/B,MAAM,EAAE,CAAC;KACT;;EA9DM,MAAM;IACZ,QACCA,QAACC,UAAI,QACJD,0BACC,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,EACpC,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAEvBA,qBAAQ,CACM,CACT,EACN;GACF;;;;;;;;","names":["h","Host"],"sources":["src/components/alert/style.css?tag=kol-alert&mode=default&encapsulation=shadow","src/components/alert/shadow.tsx"],"sourcesContent":["@import url(../style.css);\n@import url(../host-display-block.css);\nkol-alert-wc {\n\tdisplay: grid;\n}\nkol-alert-wc .heading {\n\tdisplay: flex;\n\tplace-items: center;\n}\nkol-alert-wc .heading > div {\n\tflex-grow: 1;\n}\n","import { Component, h, Host, JSX, Prop, State } from '@stencil/core';\n\nimport { HeadingLevel } from '../../types/heading-level';\nimport { LabelPropType } from '../../types/props/label';\nimport { AlertType, AlertVariant, KoliBriAlertEventCallbacks, Props, States } from './types';\n\n/**\n * @slot - Der Inhalt der Meldung.\n */\n@Component({\n\ttag: 'kol-alert',\n\tstyleUrls: {\n\t\tdefault: './style.css',\n\t},\n\tshadow: true,\n})\nexport class KolAlert implements Props {\n\tpublic render(): JSX.Element {\n\t\treturn (\n\t\t\t<Host>\n\t\t\t\t<kol-alert-wc\n\t\t\t\t\t_alert={this._alert}\n\t\t\t\t\t_hasCloser={this._hasCloser}\n\t\t\t\t\t_label={this._label || this._heading}\n\t\t\t\t\t_level={this._level}\n\t\t\t\t\t_on={this._on}\n\t\t\t\t\t_type={this._type}\n\t\t\t\t\t_variant={this._variant}\n\t\t\t\t>\n\t\t\t\t\t<slot />\n\t\t\t\t</kol-alert-wc>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t/**\n\t * Gibt an, ob der Screenreader die Meldung aktiv vorlesen soll.\n\t */\n\t@Prop() public _alert?: boolean = false;\n\n\t/**\n\t * Defines whether the element can be closed.\n\t * TODO: Change type back to `HasCloserPropType` after Stencil#4663 has been resolved\n\t */\n\t@Prop() public _hasCloser?: boolean = false;\n\n\t/**\n\t * Deprecated: Gibt die Beschriftung der Komponente an.\n\t * @deprecated Use _label.\n\t */\n\t@Prop() public _heading?: string;\n\n\t/**\n\t * Setzt die sichtbare oder semantische Beschriftung der Komponente (z.B. Aria-Label, Label, Headline, Caption, Summary usw.).\n\t */\n\t@Prop() public _label?: LabelPropType;\n\n\t/**\n\t * Gibt an, welchen H-Level von 1 bis 6 die Überschrift hat. Oder bei 0, ob es keine Überschrift ist und als fett gedruckter Text angezeigt werden soll.\n\t */\n\t@Prop() public _level?: HeadingLevel = 1;\n\n\t/**\n\t * Gibt die EventCallback-Function für das Schließen des Alerts an.\n\t */\n\t@Prop() public _on?: KoliBriAlertEventCallbacks;\n\n\t/**\n\t * Defines either the type of the component or of the components interactive element.\n\t */\n\t@Prop() public _type?: AlertType = 'default';\n\n\t/**\n\t * Gibt an, welche Variante der Darstellung genutzt werden soll.\n\t */\n\t@Prop() public _variant?: AlertVariant = 'msg';\n\n\t@State() public state: States = {\n\t\t_level: 1,\n\t};\n}\n"],"version":3}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"kol-badge.entry.cjs.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,sxBAAsxB;;ACY9yBA,sBAAW,CAAC,qEAAqE,CAAC,CAAC;MAStE,QAAQ;;;IACZ,eAAU,GAAG,MAAM,CAAC;IACpB,aAAQ,GAAG,MAAM,CAAC;IACT,OAAE,GAAGC,eAAK,EAAE,CAAC;
|
|
1
|
+
{"file":"kol-badge.entry.cjs.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,sxBAAsxB;;ACY9yBA,sBAAW,CAAC,qEAAqE,CAAC,CAAC;MAStE,QAAQ;;;IACZ,eAAU,GAAG,MAAM,CAA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C,EAAE,EAAE,cAAc,GAAG,IAAI,CAAC,EAAE,GAAG,SAAS,EACxC,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,SAAS,EAC7C,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,MAAM,EAAE,IAAI,CAAC,MAAM,GACL,EACd,cAAc,IAAI,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,YAA2B,CAAC,CAC3E,CACD,EACN;GACF;EAqDM,aAAa,CAAC,KAA8B;IAClDE,mBAAa,CAAC,IAAI,EAAE,KAAK,EAAE;MAC1B,YAAY,EAAE,MAAM;MACpB,KAAK,EAAE;QACN,WAAW,EAAE,IAAI,CAAC,iBAAiB;OACnC;KACD,CAAC,CAAC;GACH;EAGM,mBAAmB,CAAC,KAA4B;IACtDC,mCAAmB,CAAC,KAAK,EAAE;MAC1B,IAAI;QACH,KAAK,GAAGC,yBAAS,CAAc,KAAe,CAAC,CAAC;OAEhD;MAAC,OAAO,CAAC,EAAE;OAEX;MACDC,wBAAQ,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,CAAC,CAAC;KACtC,CAAC,CAAC;GACH;EAEM,iBAAiB;IACvB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAChC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;GAC5C;;;;;;;;;;;;","names":["featureHint","nonce","handleColorChange","h","Host","validateColor","objectObjectHandler","parseJson","setState"],"sources":["src/components/badge/style.css?tag=kol-badge&mode=default&encapsulation=shadow","src/components/badge/component.tsx"],"sourcesContent":["@import url(../style.css);\n:host > span {\n\tdisplay: inline-flex;\n\tplace-items: center;\n}\n:host > span > kol-button-wc button {\n\tcolor: inherit;\n}\n","import { Component, h, Host, JSX, Prop, State, Watch } from '@stencil/core';\n\nimport { Stringified } from '../../types/common';\nimport { KoliBriIconProp } from '../../types/icon';\nimport { handleColorChange, PropColor, validateColor } from '../../types/props/color';\nimport { LabelPropType } from '../../types/props/label';\nimport { featureHint } from '../../utils/a11y.tipps';\nimport { nonce } from '../../utils/dev.utils';\nimport { objectObjectHandler, parseJson, setState } from '../../utils/prop.validators';\nimport { ButtonProps } from '../button/types';\nimport { API, States } from './types';\n\nfeatureHint(`[KolBadge] Optimierung des _color-Properties (rgba, rgb, hex usw.).`);\n\n@Component({\n\ttag: 'kol-badge',\n\tstyleUrls: {\n\t\tdefault: './style.css',\n\t},\n\tshadow: true,\n})\nexport class KolBadge implements API {\n\tprivate bgColorStr = '#000';\n\tprivate colorStr = '#fff';\n\tprivate readonly id = nonce();\n\n\tprivate renderSmartButton(props: ButtonProps): JSX.Element {\n\t\treturn (\n\t\t\t<kol-button-wc\n\t\t\t\t_ariaControls={this.id}\n\t\t\t\t_customClass={props._customClass}\n\t\t\t\t_disabled={props._disabled}\n\t\t\t\t_hideLabel={true}\n\t\t\t\t_icon={props._icon}\n\t\t\t\t_id={props._id}\n\t\t\t\t_label={props._label}\n\t\t\t\t_on={props._on}\n\t\t\t\t_tooltipAlign={props._tooltipAlign}\n\t\t\t\t_variant={props._variant}\n\t\t\t></kol-button-wc>\n\t\t);\n\t}\n\n\tpublic render(): JSX.Element {\n\t\tconst hasSmartButton = typeof this.state._smartButton === 'object' && this.state._smartButton !== null;\n\t\treturn (\n\t\t\t<Host>\n\t\t\t\t<span\n\t\t\t\t\tclass={{\n\t\t\t\t\t\t'smart-button': typeof this.state._smartButton === 'object' && this.state._smartButton !== null,\n\t\t\t\t\t}}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tbackgroundColor: this.bgColorStr,\n\t\t\t\t\t\tcolor: this.colorStr,\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<kol-span-wc\n\t\t\t\t\t\tid={hasSmartButton ? this.id : undefined}\n\t\t\t\t\t\t_hideLabel={this._hideLabel || this._iconOnly}\n\t\t\t\t\t\t_icon={this._icon}\n\t\t\t\t\t\t_label={this._label}\n\t\t\t\t\t></kol-span-wc>\n\t\t\t\t\t{hasSmartButton && this.renderSmartButton(this.state._smartButton as ButtonProps)}\n\t\t\t\t</span>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t/**\n\t * Setzt die Hintergrundfarbe.\n\t */\n\t@Prop() public _color?: Stringified<PropColor> = '#000';\n\n\t/**\n\t * Deprecated:\n\t * ⚠️ We does not support the `_hide-label` property for the `kol-badge` element,\n\t * since it would not be accessible without visible labeling. A separate tooltip\n\t * is not planed, because a badge is not an interactive element.\n\t * TODO: Change type back to `HideLabelPropType` after Stencil#4663 has been resolved.\n\t * @deprecated Will be removed in the next major version.\n\t */\n\t@Prop() public _hideLabel?: boolean = false;\n\n\t/**\n\t * Setzt die Iconklasse (z.B.: `_icon=\"codicon codicon-home`).\n\t */\n\t@Prop() public _icon?: Stringified<KoliBriIconProp>;\n\n\t/**\n\t * Deprecated: Blendet die Beschriftung (Label) aus und zeigt sie stattdessen mittels eines Tooltips an.\n\t *\n\t * @deprecated use _hide-label\n\t */\n\t@Prop() public _iconOnly?: boolean;\n\n\t/**\n\t * Setzt die sichtbare oder semantische Beschriftung der Komponente (z.B. Aria-Label, Label, Headline, Caption, Summary usw.).\n\t */\n\t@Prop() public _label!: LabelPropType;\n\n\t/**\n\t * Ermöglicht einen Schalter in das Eingabefeld mit einer beliebigen Aktion zu einzufügen (nur _hide-label).\n\t */\n\t@Prop() public _smartButton?: Stringified<ButtonProps>;\n\n\t@State() public state: States = {\n\t\t_color: {\n\t\t\tbackgroundColor: '#000',\n\t\t\tforegroundColor: '#fff',\n\t\t},\n\t};\n\n\tprivate handleColorChange = (value: unknown) => {\n\t\tconst colorPair = handleColorChange(value);\n\t\tthis.bgColorStr = colorPair.backgroundColor;\n\t\tthis.colorStr = colorPair.foregroundColor as string;\n\t};\n\n\t@Watch('_color')\n\tpublic validateColor(value?: Stringified<PropColor>): void {\n\t\tvalidateColor(this, value, {\n\t\t\tdefaultValue: '#000',\n\t\t\thooks: {\n\t\t\t\tbeforePatch: this.handleColorChange,\n\t\t\t},\n\t\t});\n\t}\n\n\t@Watch('_smartButton')\n\tpublic validateSmartButton(value?: ButtonProps | string): void {\n\t\tobjectObjectHandler(value, () => {\n\t\t\ttry {\n\t\t\t\tvalue = parseJson<ButtonProps>(value as string);\n\t\t\t\t// eslint-disable-next-line no-empty\n\t\t\t} catch (e) {\n\t\t\t\t// value behält den ursprünglichen Wert\n\t\t\t}\n\t\t\tsetState(this, '_smartButton', value);\n\t\t});\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tthis.validateColor(this._color);\n\t\tthis.validateSmartButton(this._smartButton);\n\t}\n}\n"],"version":3}
|