@haiilo/catalyst 11.0.0 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalyst/catalyst.esm.js +1 -1
- package/dist/catalyst/catalyst.esm.js.map +1 -1
- package/dist/catalyst/index.esm.js +2 -2
- package/dist/catalyst/index.esm.js.map +1 -1
- package/dist/catalyst/loader.esm.js.map +1 -0
- package/dist/catalyst/p-6a54965a.entry.js +10 -0
- package/dist/catalyst/p-6a54965a.entry.js.map +1 -0
- package/dist/catalyst/p-B-m4GNf1.js +3 -0
- package/dist/catalyst/p-B-m4GNf1.js.map +1 -0
- package/dist/catalyst/p-DQuL1Twl.js +2 -0
- package/dist/catalyst/p-DQuL1Twl.js.map +1 -0
- package/dist/catalyst/p-LJZzaWFR.js +2 -0
- package/dist/catalyst/p-LJZzaWFR.js.map +1 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js +8 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -0
- package/dist/cjs/cat-alert_30.cjs.entry.js +1467 -1833
- package/dist/cjs/cat-alert_30.cjs.entry.js.map +1 -1
- package/dist/cjs/catalyst.cjs.js +8 -7
- package/dist/cjs/catalyst.cjs.js.map +1 -1
- package/dist/cjs/index-DNLT6JC9.js +10178 -0
- package/dist/cjs/index-DNLT6JC9.js.map +1 -0
- package/dist/cjs/{index-1094f0fc.js → index-jGQAsDy6.js} +528 -358
- package/dist/cjs/index-jGQAsDy6.js.map +1 -0
- package/dist/cjs/index.cjs.js +461 -453
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +4 -5
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/cat-alert/cat-alert.js +15 -4
- package/dist/collection/components/cat-alert/cat-alert.js.map +1 -1
- package/dist/collection/components/cat-avatar/cat-avatar.js +33 -14
- package/dist/collection/components/cat-avatar/cat-avatar.js.map +1 -1
- package/dist/collection/components/cat-badge/cat-badge.js +45 -9
- package/dist/collection/components/cat-badge/cat-badge.js.map +1 -1
- package/dist/collection/components/cat-button/cat-button.css +4 -2
- package/dist/collection/components/cat-button/cat-button.js +107 -35
- package/dist/collection/components/cat-button/cat-button.js.map +1 -1
- package/dist/collection/components/cat-button-group/cat-button-group.js +3 -2
- package/dist/collection/components/cat-button-group/cat-button-group.js.map +1 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.js +83 -24
- package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
- package/dist/collection/components/cat-date/cat-date.js +114 -39
- package/dist/collection/components/cat-date/cat-date.js.map +1 -1
- package/dist/collection/components/cat-date-inline/cat-date-inline.js +69 -19
- package/dist/collection/components/cat-date-inline/cat-date-inline.js.map +1 -1
- package/dist/collection/components/cat-datepicker/cat-datepicker.js +130 -42
- package/dist/collection/components/cat-datepicker/cat-datepicker.js.map +1 -1
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js +37 -12
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js.map +1 -1
- package/dist/collection/components/cat-dropdown/cat-dropdown.js +129 -17
- package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
- package/dist/collection/components/cat-form-group/cat-form-group.js +19 -4
- package/dist/collection/components/cat-form-group/cat-form-group.js.map +1 -1
- package/dist/collection/components/cat-icon/cat-icon.js +15 -7
- package/dist/collection/components/cat-icon/cat-icon.js.map +1 -1
- package/dist/collection/components/cat-input/cat-input.js +143 -51
- package/dist/collection/components/cat-input/cat-input.js.map +1 -1
- package/dist/collection/components/cat-pagination/cat-pagination.js +60 -10
- package/dist/collection/components/cat-pagination/cat-pagination.js.map +1 -1
- package/dist/collection/components/cat-radio/cat-radio.js +65 -18
- package/dist/collection/components/cat-radio/cat-radio.js.map +1 -1
- package/dist/collection/components/cat-radio-group/cat-radio-group.js +21 -8
- package/dist/collection/components/cat-radio-group/cat-radio-group.js.map +1 -1
- package/dist/collection/components/cat-scrollable/cat-scrollable.js +32 -7
- package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -1
- package/dist/collection/components/cat-select/cat-select.js +105 -34
- package/dist/collection/components/cat-select/cat-select.js.map +1 -1
- package/dist/collection/components/cat-skeleton/cat-skeleton.js +22 -5
- package/dist/collection/components/cat-skeleton/cat-skeleton.js.map +1 -1
- package/dist/collection/components/cat-spinner/cat-spinner.js +15 -4
- package/dist/collection/components/cat-spinner/cat-spinner.js.map +1 -1
- package/dist/collection/components/cat-tab/cat-tab.js +84 -17
- package/dist/collection/components/cat-tab/cat-tab.js.map +1 -1
- package/dist/collection/components/cat-tabs/cat-tabs.css +29 -12
- package/dist/collection/components/cat-tabs/cat-tabs.js +189 -8
- package/dist/collection/components/cat-tabs/cat-tabs.js.map +1 -1
- package/dist/collection/components/cat-tag/cat-tag.js +84 -25
- package/dist/collection/components/cat-tag/cat-tag.js.map +1 -1
- package/dist/collection/components/cat-textarea/cat-textarea.js +90 -32
- package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
- package/dist/collection/components/cat-time/cat-time.js +120 -39
- package/dist/collection/components/cat-time/cat-time.js.map +1 -1
- package/dist/collection/components/cat-toggle/cat-toggle.js +71 -22
- package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.js +49 -8
- package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -1
- package/dist/components/cat-alert.js +8 -3
- package/dist/components/cat-alert.js.map +1 -1
- package/dist/components/cat-avatar.js +1 -0
- package/dist/components/cat-avatar2.js +11 -8
- package/dist/components/cat-avatar2.js.map +1 -1
- package/dist/components/cat-badge.js +23 -3
- package/dist/components/cat-badge.js.map +1 -1
- package/dist/components/cat-button-group.js +2 -3
- package/dist/components/cat-button-group.js.map +1 -1
- package/dist/components/cat-button.js +1 -0
- package/dist/components/cat-button2.js +41 -17
- package/dist/components/cat-button2.js.map +1 -1
- package/dist/components/cat-card.js +2 -2
- package/dist/components/cat-card.js.map +1 -1
- package/dist/components/cat-checkbox.js +1 -0
- package/dist/components/cat-checkbox2.js +34 -10
- package/dist/components/cat-checkbox2.js.map +1 -1
- package/dist/components/cat-date-inline.js +1 -0
- package/dist/components/cat-date-inline2.js +29 -7
- package/dist/components/cat-date-inline2.js.map +1 -1
- package/dist/components/cat-date.js +41 -17
- package/dist/components/cat-date.js.map +1 -1
- package/dist/components/cat-datepicker-inline.js +16 -8
- package/dist/components/cat-datepicker-inline.js.map +1 -1
- package/dist/components/cat-datepicker.js +50 -20
- package/dist/components/cat-datepicker.js.map +1 -1
- package/dist/components/cat-datepicker.locale.js +110 -99
- package/dist/components/cat-datepicker.locale.js.map +1 -1
- package/dist/components/cat-dropdown.js +1 -0
- package/dist/components/cat-dropdown2.js +70 -13
- package/dist/components/cat-dropdown2.js.map +1 -1
- package/dist/components/cat-form-group.js +12 -3
- package/dist/components/cat-form-group.js.map +1 -1
- package/dist/components/cat-form-hint.js +1 -0
- package/dist/components/cat-form-hint.js.map +1 -1
- package/dist/components/cat-i18n-registry.js +1 -0
- package/dist/components/cat-i18n-registry.js.map +1 -1
- package/dist/components/cat-icon-registry.js +22 -21
- package/dist/components/cat-icon-registry.js.map +1 -1
- package/dist/components/cat-icon.js +1 -0
- package/dist/components/cat-icon2.js +5 -5
- package/dist/components/cat-icon2.js.map +1 -1
- package/dist/components/cat-input.js +1 -0
- package/dist/components/cat-input2.js +50 -25
- package/dist/components/cat-input2.js.map +1 -1
- package/dist/components/cat-pagination.js +32 -2
- package/dist/components/cat-pagination.js.map +1 -1
- package/dist/components/cat-radio-group.js +8 -5
- package/dist/components/cat-radio-group.js.map +1 -1
- package/dist/components/cat-radio.js +28 -8
- package/dist/components/cat-radio.js.map +1 -1
- package/dist/components/cat-scrollable.js +1 -0
- package/dist/components/cat-scrollable2.js +322 -542
- package/dist/components/cat-scrollable2.js.map +1 -1
- package/dist/components/cat-select-demo.js +27 -49
- package/dist/components/cat-select-demo.js.map +1 -1
- package/dist/components/cat-select.js +1 -0
- package/dist/components/cat-select2.js +135 -316
- package/dist/components/cat-select2.js.map +1 -1
- package/dist/components/cat-skeleton.js +1 -0
- package/dist/components/cat-skeleton2.js +12 -3
- package/dist/components/cat-skeleton2.js.map +1 -1
- package/dist/components/cat-spinner.js +1 -0
- package/dist/components/cat-spinner2.js +8 -3
- package/dist/components/cat-spinner2.js.map +1 -1
- package/dist/components/cat-tab.js +34 -9
- package/dist/components/cat-tab.js.map +1 -1
- package/dist/components/cat-tabs.js +140 -11
- package/dist/components/cat-tabs.js.map +1 -1
- package/dist/components/cat-tag.js +35 -13
- package/dist/components/cat-tag.js.map +1 -1
- package/dist/components/cat-textarea.js +33 -16
- package/dist/components/cat-textarea.js.map +1 -1
- package/dist/components/cat-time.js +44 -16
- package/dist/components/cat-time.js.map +1 -1
- package/dist/components/cat-toggle.js +28 -10
- package/dist/components/cat-toggle.js.map +1 -1
- package/dist/components/cat-tooltip.js +28 -3
- package/dist/components/cat-tooltip.js.map +1 -1
- package/dist/components/coerce.js +1 -0
- package/dist/components/coerce.js.map +1 -1
- package/dist/components/first-tabbable.js +1 -0
- package/dist/components/first-tabbable.js.map +1 -1
- package/dist/components/{floating-ui.dom.esm.js → floating-ui.dom.js} +3 -492
- package/dist/components/floating-ui.dom.js.map +1 -0
- package/dist/components/index.js +460 -450
- package/dist/components/index.js.map +1 -1
- package/dist/components/index2.js +9456 -0
- package/dist/components/index2.js.map +1 -0
- package/dist/components/loglevel.js +368 -356
- package/dist/components/loglevel.js.map +1 -1
- package/dist/components/media-matcher.js +1 -0
- package/dist/components/media-matcher.js.map +1 -1
- package/dist/esm/app-globals-DQuL1Twl.js +6 -0
- package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
- package/dist/esm/cat-alert_30.entry.js +1428 -1792
- package/dist/esm/cat-alert_30.entry.js.map +1 -1
- package/dist/esm/catalyst.js +7 -5
- package/dist/esm/catalyst.js.map +1 -1
- package/dist/esm/{index-e8c0ddf2.js → index-B-m4GNf1.js} +528 -338
- package/dist/esm/index-B-m4GNf1.js.map +1 -0
- package/dist/esm/index-LJZzaWFR.js +10057 -0
- package/dist/esm/index-LJZzaWFR.js.map +1 -0
- package/dist/esm/index.js +458 -448
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +5 -4
- package/dist/esm/loader.js.map +1 -1
- package/dist/types/components/cat-dropdown/cat-dropdown.d.ts +11 -1
- package/dist/types/components/cat-tab/cat-tab.d.ts +6 -0
- package/dist/types/components/cat-tabs/cat-tabs.d.ts +18 -0
- package/dist/types/components.d.ts +46 -0
- package/dist/types/stencil-public-runtime.d.ts +28 -2
- package/loader/index.d.ts +3 -0
- package/package.json +3 -3
- package/dist/catalyst/p-59e2ada2.entry.js +0 -10
- package/dist/catalyst/p-59e2ada2.entry.js.map +0 -1
- package/dist/catalyst/p-7f3bcfb9.js +0 -3
- package/dist/catalyst/p-7f3bcfb9.js.map +0 -1
- package/dist/catalyst/p-9500d6fb.js +0 -2
- package/dist/catalyst/p-9500d6fb.js.map +0 -1
- package/dist/catalyst/p-e1255160.js +0 -2
- package/dist/catalyst/p-e1255160.js.map +0 -1
- package/dist/cjs/app-globals-3a1e7e63.js +0 -7
- package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
- package/dist/cjs/index-1094f0fc.js.map +0 -1
- package/dist/cjs/of-958251e4.js +0 -1549
- package/dist/cjs/of-958251e4.js.map +0 -1
- package/dist/collection/components/cat-alert/cat-alert.e2e.js +0 -11
- package/dist/collection/components/cat-alert/cat-alert.e2e.js.map +0 -1
- package/dist/collection/components/cat-alert/cat-alert.spec.js +0 -14
- package/dist/collection/components/cat-alert/cat-alert.spec.js.map +0 -1
- package/dist/collection/components/cat-avatar/cat-avatar.e2e.js +0 -10
- package/dist/collection/components/cat-avatar/cat-avatar.e2e.js.map +0 -1
- package/dist/collection/components/cat-avatar/cat-avatar.spec.js +0 -14
- package/dist/collection/components/cat-avatar/cat-avatar.spec.js.map +0 -1
- package/dist/collection/components/cat-badge/cat-badge.e2e.js +0 -10
- package/dist/collection/components/cat-badge/cat-badge.e2e.js.map +0 -1
- package/dist/collection/components/cat-badge/cat-badge.spec.js +0 -14
- package/dist/collection/components/cat-badge/cat-badge.spec.js.map +0 -1
- package/dist/collection/components/cat-button/cat-button.e2e.js +0 -10
- package/dist/collection/components/cat-button/cat-button.e2e.js.map +0 -1
- package/dist/collection/components/cat-button/cat-button.spec.js +0 -20
- package/dist/collection/components/cat-button/cat-button.spec.js.map +0 -1
- package/dist/collection/components/cat-button-group/cat-button-group.e2e.js +0 -10
- package/dist/collection/components/cat-button-group/cat-button-group.e2e.js.map +0 -1
- package/dist/collection/components/cat-button-group/cat-button-group.spec.js +0 -14
- package/dist/collection/components/cat-button-group/cat-button-group.spec.js.map +0 -1
- package/dist/collection/components/cat-card/cat-card.e2e.js +0 -10
- package/dist/collection/components/cat-card/cat-card.e2e.js.map +0 -1
- package/dist/collection/components/cat-card/cat-card.spec.js +0 -14
- package/dist/collection/components/cat-card/cat-card.spec.js.map +0 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.e2e.js +0 -10
- package/dist/collection/components/cat-checkbox/cat-checkbox.e2e.js.map +0 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.spec.js +0 -14
- package/dist/collection/components/cat-checkbox/cat-checkbox.spec.js.map +0 -1
- package/dist/collection/components/cat-date/cat-date.e2e.js +0 -11
- package/dist/collection/components/cat-date/cat-date.e2e.js.map +0 -1
- package/dist/collection/components/cat-date/cat-date.spec.js +0 -17
- package/dist/collection/components/cat-date/cat-date.spec.js.map +0 -1
- package/dist/collection/components/cat-date-inline/cat-date-inline.e2e.js +0 -11
- package/dist/collection/components/cat-date-inline/cat-date-inline.e2e.js.map +0 -1
- package/dist/collection/components/cat-date-inline/cat-date-inline.spec.js +0 -16
- package/dist/collection/components/cat-date-inline/cat-date-inline.spec.js.map +0 -1
- package/dist/collection/components/cat-datepicker/cat-datepicker.e2e.js +0 -11
- package/dist/collection/components/cat-datepicker/cat-datepicker.e2e.js.map +0 -1
- package/dist/collection/components/cat-datepicker/cat-datepicker.spec.js +0 -15
- package/dist/collection/components/cat-datepicker/cat-datepicker.spec.js.map +0 -1
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.e2e.js +0 -11
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.e2e.js.map +0 -1
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.spec.js +0 -15
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.spec.js.map +0 -1
- package/dist/collection/components/cat-dropdown/cat-dropdown.e2e.js +0 -10
- package/dist/collection/components/cat-dropdown/cat-dropdown.e2e.js.map +0 -1
- package/dist/collection/components/cat-dropdown/cat-dropdown.spec.js +0 -21
- package/dist/collection/components/cat-dropdown/cat-dropdown.spec.js.map +0 -1
- package/dist/collection/components/cat-form-group/cat-form-group.e2e.js +0 -10
- package/dist/collection/components/cat-form-group/cat-form-group.e2e.js.map +0 -1
- package/dist/collection/components/cat-form-group/cat-form-group.spec.js +0 -14
- package/dist/collection/components/cat-form-group/cat-form-group.spec.js.map +0 -1
- package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js +0 -15
- package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js.map +0 -1
- package/dist/collection/components/cat-i18n/cat-i18n-registry.spec.js +0 -7
- package/dist/collection/components/cat-i18n/cat-i18n-registry.spec.js.map +0 -1
- package/dist/collection/components/cat-icon/cat-icon-registry.spec.js +0 -7
- package/dist/collection/components/cat-icon/cat-icon-registry.spec.js.map +0 -1
- package/dist/collection/components/cat-icon/cat-icon.e2e.js +0 -11
- package/dist/collection/components/cat-icon/cat-icon.e2e.js.map +0 -1
- package/dist/collection/components/cat-icon/cat-icon.spec.js +0 -15
- package/dist/collection/components/cat-icon/cat-icon.spec.js.map +0 -1
- package/dist/collection/components/cat-input/cat-input.e2e.js +0 -11
- package/dist/collection/components/cat-input/cat-input.e2e.js.map +0 -1
- package/dist/collection/components/cat-input/cat-input.spec.js +0 -15
- package/dist/collection/components/cat-input/cat-input.spec.js.map +0 -1
- package/dist/collection/components/cat-notification/cat-notification.spec.js +0 -7
- package/dist/collection/components/cat-notification/cat-notification.spec.js.map +0 -1
- package/dist/collection/components/cat-pagination/cat-pagination.e2e.js +0 -14
- package/dist/collection/components/cat-pagination/cat-pagination.e2e.js.map +0 -1
- package/dist/collection/components/cat-pagination/cat-pagination.spec.js +0 -15
- package/dist/collection/components/cat-pagination/cat-pagination.spec.js.map +0 -1
- package/dist/collection/components/cat-radio/cat-radio.e2e.js +0 -10
- package/dist/collection/components/cat-radio/cat-radio.e2e.js.map +0 -1
- package/dist/collection/components/cat-radio/cat-radio.spec.js +0 -14
- package/dist/collection/components/cat-radio/cat-radio.spec.js.map +0 -1
- package/dist/collection/components/cat-radio-group/cat-radio-group.e2e.js +0 -10
- package/dist/collection/components/cat-radio-group/cat-radio-group.e2e.js.map +0 -1
- package/dist/collection/components/cat-radio-group/cat-radio-group.spec.js +0 -14
- package/dist/collection/components/cat-radio-group/cat-radio-group.spec.js.map +0 -1
- package/dist/collection/components/cat-scrollable/cat-scrollable.e2e.js +0 -10
- package/dist/collection/components/cat-scrollable/cat-scrollable.e2e.js.map +0 -1
- package/dist/collection/components/cat-scrollable/cat-scrollable.spec.js +0 -14
- package/dist/collection/components/cat-scrollable/cat-scrollable.spec.js.map +0 -1
- package/dist/collection/components/cat-select/cat-select.e2e.js +0 -14
- package/dist/collection/components/cat-select/cat-select.e2e.js.map +0 -1
- package/dist/collection/components/cat-select/cat-select.spec.js +0 -15
- package/dist/collection/components/cat-select/cat-select.spec.js.map +0 -1
- package/dist/collection/components/cat-skeleton/cat-skeleton.e2e.js +0 -10
- package/dist/collection/components/cat-skeleton/cat-skeleton.e2e.js.map +0 -1
- package/dist/collection/components/cat-skeleton/cat-skeleton.spec.js +0 -14
- package/dist/collection/components/cat-skeleton/cat-skeleton.spec.js.map +0 -1
- package/dist/collection/components/cat-spinner/cat-spinner.e2e.js +0 -10
- package/dist/collection/components/cat-spinner/cat-spinner.e2e.js.map +0 -1
- package/dist/collection/components/cat-spinner/cat-spinner.spec.js +0 -18
- package/dist/collection/components/cat-spinner/cat-spinner.spec.js.map +0 -1
- package/dist/collection/components/cat-tab/cat-tab.e2e.js +0 -10
- package/dist/collection/components/cat-tab/cat-tab.e2e.js.map +0 -1
- package/dist/collection/components/cat-tab/cat-tab.spec.js +0 -14
- package/dist/collection/components/cat-tab/cat-tab.spec.js.map +0 -1
- package/dist/collection/components/cat-tabs/cat-tabs.e2e.js +0 -10
- package/dist/collection/components/cat-tabs/cat-tabs.e2e.js.map +0 -1
- package/dist/collection/components/cat-tabs/cat-tabs.spec.js +0 -14
- package/dist/collection/components/cat-tabs/cat-tabs.spec.js.map +0 -1
- package/dist/collection/components/cat-tag/cat-tag.e2e.js +0 -14
- package/dist/collection/components/cat-tag/cat-tag.e2e.js.map +0 -1
- package/dist/collection/components/cat-tag/cat-tag.spec.js +0 -23
- package/dist/collection/components/cat-tag/cat-tag.spec.js.map +0 -1
- package/dist/collection/components/cat-textarea/cat-textarea.e2e.js +0 -11
- package/dist/collection/components/cat-textarea/cat-textarea.e2e.js.map +0 -1
- package/dist/collection/components/cat-textarea/cat-textarea.spec.js +0 -15
- package/dist/collection/components/cat-textarea/cat-textarea.spec.js.map +0 -1
- package/dist/collection/components/cat-time/cat-time.e2e.js +0 -11
- package/dist/collection/components/cat-time/cat-time.e2e.js.map +0 -1
- package/dist/collection/components/cat-time/cat-time.spec.js +0 -16
- package/dist/collection/components/cat-time/cat-time.spec.js.map +0 -1
- package/dist/collection/components/cat-toggle/cat-toggle.e2e.js +0 -10
- package/dist/collection/components/cat-toggle/cat-toggle.e2e.js.map +0 -1
- package/dist/collection/components/cat-toggle/cat-toggle.spec.js +0 -14
- package/dist/collection/components/cat-toggle/cat-toggle.spec.js.map +0 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.e2e.js +0 -10
- package/dist/collection/components/cat-tooltip/cat-tooltip.e2e.js.map +0 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.spec.js +0 -20
- package/dist/collection/components/cat-tooltip/cat-tooltip.spec.js.map +0 -1
- package/dist/collection/utils/media-matcher.spec.js +0 -39
- package/dist/collection/utils/media-matcher.spec.js.map +0 -1
- package/dist/components/floating-ui.dom.esm.js.map +0 -1
- package/dist/components/from.js +0 -928
- package/dist/components/from.js.map +0 -1
- package/dist/components/of.js +0 -10
- package/dist/components/of.js.map +0 -1
- package/dist/esm/app-globals-0f993ce5.js +0 -5
- package/dist/esm/app-globals-0f993ce5.js.map +0 -1
- package/dist/esm/index-e8c0ddf2.js.map +0 -1
- package/dist/esm/of-e4ec2eb4.js +0 -1523
- package/dist/esm/of-e4ec2eb4.js.map +0 -1
- package/loader/package.json +0 -11
|
@@ -21,27 +21,44 @@ export class CatTextarea {
|
|
|
21
21
|
this.hasSlottedLabel = false;
|
|
22
22
|
this.hasSlottedHint = false;
|
|
23
23
|
this.hasSlottedCounter = false;
|
|
24
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Whether the label need a marker to shown if the textarea is required or optional.
|
|
26
|
+
*/
|
|
25
27
|
this.requiredMarker = 'optional';
|
|
28
|
+
/**
|
|
29
|
+
* Whether the label is on top or left.
|
|
30
|
+
*/
|
|
26
31
|
this.horizontal = false;
|
|
27
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Whether the textarea is disabled.
|
|
34
|
+
*/
|
|
28
35
|
this.disabled = false;
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
/**
|
|
37
|
+
* The label for the textarea.
|
|
38
|
+
*/
|
|
31
39
|
this.label = '';
|
|
40
|
+
/**
|
|
41
|
+
* Visually hide the label, but still show it to assistive technologies like screen readers.
|
|
42
|
+
*/
|
|
32
43
|
this.labelHidden = false;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
this.placeholder = undefined;
|
|
44
|
+
/**
|
|
45
|
+
* The value is not editable.
|
|
46
|
+
*/
|
|
37
47
|
this.readonly = false;
|
|
48
|
+
/**
|
|
49
|
+
* A value is required or must be check for the form to be submittable.
|
|
50
|
+
*/
|
|
38
51
|
this.required = false;
|
|
52
|
+
/**
|
|
53
|
+
* Specifies the initial number of lines in the textarea.
|
|
54
|
+
*/
|
|
39
55
|
this.rows = 3;
|
|
40
|
-
|
|
41
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Fine-grained control over when the errors are shown. Can be `false` to
|
|
58
|
+
* never show errors, `true` to show errors on blur, or a number to show
|
|
59
|
+
* errors change with the given delay in milliseconds or immediately on blur.
|
|
60
|
+
*/
|
|
42
61
|
this.errorUpdate = 0;
|
|
43
|
-
this.nativeAttributes = undefined;
|
|
44
|
-
this.testId = undefined;
|
|
45
62
|
}
|
|
46
63
|
get id() {
|
|
47
64
|
return this.identifier || this._id;
|
|
@@ -164,6 +181,7 @@ export class CatTextarea {
|
|
|
164
181
|
return {
|
|
165
182
|
"requiredMarker": {
|
|
166
183
|
"type": "string",
|
|
184
|
+
"attribute": "required-marker",
|
|
167
185
|
"mutable": false,
|
|
168
186
|
"complexType": {
|
|
169
187
|
"original": "'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!'",
|
|
@@ -176,12 +194,14 @@ export class CatTextarea {
|
|
|
176
194
|
"tags": [],
|
|
177
195
|
"text": "Whether the label need a marker to shown if the textarea is required or optional."
|
|
178
196
|
},
|
|
179
|
-
"
|
|
197
|
+
"getter": false,
|
|
198
|
+
"setter": false,
|
|
180
199
|
"reflect": false,
|
|
181
200
|
"defaultValue": "'optional'"
|
|
182
201
|
},
|
|
183
202
|
"horizontal": {
|
|
184
203
|
"type": "boolean",
|
|
204
|
+
"attribute": "horizontal",
|
|
185
205
|
"mutable": false,
|
|
186
206
|
"complexType": {
|
|
187
207
|
"original": "boolean",
|
|
@@ -194,12 +214,14 @@ export class CatTextarea {
|
|
|
194
214
|
"tags": [],
|
|
195
215
|
"text": "Whether the label is on top or left."
|
|
196
216
|
},
|
|
197
|
-
"
|
|
217
|
+
"getter": false,
|
|
218
|
+
"setter": false,
|
|
198
219
|
"reflect": false,
|
|
199
220
|
"defaultValue": "false"
|
|
200
221
|
},
|
|
201
222
|
"autoComplete": {
|
|
202
223
|
"type": "string",
|
|
224
|
+
"attribute": "auto-complete",
|
|
203
225
|
"mutable": false,
|
|
204
226
|
"complexType": {
|
|
205
227
|
"original": "string",
|
|
@@ -212,11 +234,13 @@ export class CatTextarea {
|
|
|
212
234
|
"tags": [],
|
|
213
235
|
"text": "Hint for form autofill feature."
|
|
214
236
|
},
|
|
215
|
-
"
|
|
237
|
+
"getter": false,
|
|
238
|
+
"setter": false,
|
|
216
239
|
"reflect": false
|
|
217
240
|
},
|
|
218
241
|
"disabled": {
|
|
219
242
|
"type": "boolean",
|
|
243
|
+
"attribute": "disabled",
|
|
220
244
|
"mutable": false,
|
|
221
245
|
"complexType": {
|
|
222
246
|
"original": "boolean",
|
|
@@ -229,12 +253,14 @@ export class CatTextarea {
|
|
|
229
253
|
"tags": [],
|
|
230
254
|
"text": "Whether the textarea is disabled."
|
|
231
255
|
},
|
|
232
|
-
"
|
|
256
|
+
"getter": false,
|
|
257
|
+
"setter": false,
|
|
233
258
|
"reflect": false,
|
|
234
259
|
"defaultValue": "false"
|
|
235
260
|
},
|
|
236
261
|
"hint": {
|
|
237
262
|
"type": "string",
|
|
263
|
+
"attribute": "hint",
|
|
238
264
|
"mutable": false,
|
|
239
265
|
"complexType": {
|
|
240
266
|
"original": "string | string[]",
|
|
@@ -247,11 +273,13 @@ export class CatTextarea {
|
|
|
247
273
|
"tags": [],
|
|
248
274
|
"text": "Optional hint text(s) to be displayed with the textarea."
|
|
249
275
|
},
|
|
250
|
-
"
|
|
276
|
+
"getter": false,
|
|
277
|
+
"setter": false,
|
|
251
278
|
"reflect": false
|
|
252
279
|
},
|
|
253
280
|
"identifier": {
|
|
254
281
|
"type": "string",
|
|
282
|
+
"attribute": "identifier",
|
|
255
283
|
"mutable": false,
|
|
256
284
|
"complexType": {
|
|
257
285
|
"original": "string",
|
|
@@ -264,11 +292,13 @@ export class CatTextarea {
|
|
|
264
292
|
"tags": [],
|
|
265
293
|
"text": "A unique identifier for the input."
|
|
266
294
|
},
|
|
267
|
-
"
|
|
295
|
+
"getter": false,
|
|
296
|
+
"setter": false,
|
|
268
297
|
"reflect": false
|
|
269
298
|
},
|
|
270
299
|
"label": {
|
|
271
300
|
"type": "string",
|
|
301
|
+
"attribute": "label",
|
|
272
302
|
"mutable": false,
|
|
273
303
|
"complexType": {
|
|
274
304
|
"original": "string",
|
|
@@ -281,12 +311,14 @@ export class CatTextarea {
|
|
|
281
311
|
"tags": [],
|
|
282
312
|
"text": "The label for the textarea."
|
|
283
313
|
},
|
|
284
|
-
"
|
|
314
|
+
"getter": false,
|
|
315
|
+
"setter": false,
|
|
285
316
|
"reflect": false,
|
|
286
317
|
"defaultValue": "''"
|
|
287
318
|
},
|
|
288
319
|
"labelHidden": {
|
|
289
320
|
"type": "boolean",
|
|
321
|
+
"attribute": "label-hidden",
|
|
290
322
|
"mutable": false,
|
|
291
323
|
"complexType": {
|
|
292
324
|
"original": "boolean",
|
|
@@ -299,12 +331,14 @@ export class CatTextarea {
|
|
|
299
331
|
"tags": [],
|
|
300
332
|
"text": "Visually hide the label, but still show it to assistive technologies like screen readers."
|
|
301
333
|
},
|
|
302
|
-
"
|
|
334
|
+
"getter": false,
|
|
335
|
+
"setter": false,
|
|
303
336
|
"reflect": false,
|
|
304
337
|
"defaultValue": "false"
|
|
305
338
|
},
|
|
306
339
|
"maxLength": {
|
|
307
340
|
"type": "number",
|
|
341
|
+
"attribute": "max-length",
|
|
308
342
|
"mutable": false,
|
|
309
343
|
"complexType": {
|
|
310
344
|
"original": "number",
|
|
@@ -317,11 +351,13 @@ export class CatTextarea {
|
|
|
317
351
|
"tags": [],
|
|
318
352
|
"text": "A maximum length (number of characters) for textual values."
|
|
319
353
|
},
|
|
320
|
-
"
|
|
354
|
+
"getter": false,
|
|
355
|
+
"setter": false,
|
|
321
356
|
"reflect": false
|
|
322
357
|
},
|
|
323
358
|
"minLength": {
|
|
324
359
|
"type": "number",
|
|
360
|
+
"attribute": "min-length",
|
|
325
361
|
"mutable": false,
|
|
326
362
|
"complexType": {
|
|
327
363
|
"original": "number",
|
|
@@ -334,11 +370,13 @@ export class CatTextarea {
|
|
|
334
370
|
"tags": [],
|
|
335
371
|
"text": "A minimum length (number of characters) for textual values."
|
|
336
372
|
},
|
|
337
|
-
"
|
|
373
|
+
"getter": false,
|
|
374
|
+
"setter": false,
|
|
338
375
|
"reflect": false
|
|
339
376
|
},
|
|
340
377
|
"name": {
|
|
341
378
|
"type": "string",
|
|
379
|
+
"attribute": "name",
|
|
342
380
|
"mutable": false,
|
|
343
381
|
"complexType": {
|
|
344
382
|
"original": "string",
|
|
@@ -351,11 +389,13 @@ export class CatTextarea {
|
|
|
351
389
|
"tags": [],
|
|
352
390
|
"text": "The name of the form control. Submitted with the form as part of a name/value pair."
|
|
353
391
|
},
|
|
354
|
-
"
|
|
392
|
+
"getter": false,
|
|
393
|
+
"setter": false,
|
|
355
394
|
"reflect": false
|
|
356
395
|
},
|
|
357
396
|
"placeholder": {
|
|
358
397
|
"type": "string",
|
|
398
|
+
"attribute": "placeholder",
|
|
359
399
|
"mutable": false,
|
|
360
400
|
"complexType": {
|
|
361
401
|
"original": "string",
|
|
@@ -368,11 +408,13 @@ export class CatTextarea {
|
|
|
368
408
|
"tags": [],
|
|
369
409
|
"text": "The placeholder text to display within the input."
|
|
370
410
|
},
|
|
371
|
-
"
|
|
411
|
+
"getter": false,
|
|
412
|
+
"setter": false,
|
|
372
413
|
"reflect": false
|
|
373
414
|
},
|
|
374
415
|
"readonly": {
|
|
375
416
|
"type": "boolean",
|
|
417
|
+
"attribute": "readonly",
|
|
376
418
|
"mutable": false,
|
|
377
419
|
"complexType": {
|
|
378
420
|
"original": "boolean",
|
|
@@ -385,12 +427,14 @@ export class CatTextarea {
|
|
|
385
427
|
"tags": [],
|
|
386
428
|
"text": "The value is not editable."
|
|
387
429
|
},
|
|
388
|
-
"
|
|
430
|
+
"getter": false,
|
|
431
|
+
"setter": false,
|
|
389
432
|
"reflect": false,
|
|
390
433
|
"defaultValue": "false"
|
|
391
434
|
},
|
|
392
435
|
"required": {
|
|
393
436
|
"type": "boolean",
|
|
437
|
+
"attribute": "required",
|
|
394
438
|
"mutable": false,
|
|
395
439
|
"complexType": {
|
|
396
440
|
"original": "boolean",
|
|
@@ -403,12 +447,14 @@ export class CatTextarea {
|
|
|
403
447
|
"tags": [],
|
|
404
448
|
"text": "A value is required or must be check for the form to be submittable."
|
|
405
449
|
},
|
|
406
|
-
"
|
|
450
|
+
"getter": false,
|
|
451
|
+
"setter": false,
|
|
407
452
|
"reflect": false,
|
|
408
453
|
"defaultValue": "false"
|
|
409
454
|
},
|
|
410
455
|
"rows": {
|
|
411
456
|
"type": "number",
|
|
457
|
+
"attribute": "rows",
|
|
412
458
|
"mutable": false,
|
|
413
459
|
"complexType": {
|
|
414
460
|
"original": "number",
|
|
@@ -421,12 +467,14 @@ export class CatTextarea {
|
|
|
421
467
|
"tags": [],
|
|
422
468
|
"text": "Specifies the initial number of lines in the textarea."
|
|
423
469
|
},
|
|
424
|
-
"
|
|
470
|
+
"getter": false,
|
|
471
|
+
"setter": false,
|
|
425
472
|
"reflect": false,
|
|
426
473
|
"defaultValue": "3"
|
|
427
474
|
},
|
|
428
475
|
"value": {
|
|
429
476
|
"type": "string",
|
|
477
|
+
"attribute": "value",
|
|
430
478
|
"mutable": true,
|
|
431
479
|
"complexType": {
|
|
432
480
|
"original": "string",
|
|
@@ -439,11 +487,13 @@ export class CatTextarea {
|
|
|
439
487
|
"tags": [],
|
|
440
488
|
"text": "The initial value of the control."
|
|
441
489
|
},
|
|
442
|
-
"
|
|
490
|
+
"getter": false,
|
|
491
|
+
"setter": false,
|
|
443
492
|
"reflect": false
|
|
444
493
|
},
|
|
445
494
|
"errors": {
|
|
446
495
|
"type": "boolean",
|
|
496
|
+
"attribute": "errors",
|
|
447
497
|
"mutable": false,
|
|
448
498
|
"complexType": {
|
|
449
499
|
"original": "boolean | string[] | ErrorMap",
|
|
@@ -462,11 +512,13 @@ export class CatTextarea {
|
|
|
462
512
|
"tags": [],
|
|
463
513
|
"text": "The validation errors for this input. Will render a hint under the input\nwith the translated error message(s) `error.${key}`. If an object is\npassed, the keys will be used as error keys and the values translation\nparameters.\nIf the value is `true`, the input will be marked as invalid without any\nhints under the input."
|
|
464
514
|
},
|
|
465
|
-
"
|
|
515
|
+
"getter": false,
|
|
516
|
+
"setter": false,
|
|
466
517
|
"reflect": false
|
|
467
518
|
},
|
|
468
519
|
"errorUpdate": {
|
|
469
520
|
"type": "any",
|
|
521
|
+
"attribute": "error-update",
|
|
470
522
|
"mutable": false,
|
|
471
523
|
"complexType": {
|
|
472
524
|
"original": "boolean | number",
|
|
@@ -479,12 +531,14 @@ export class CatTextarea {
|
|
|
479
531
|
"tags": [],
|
|
480
532
|
"text": "Fine-grained control over when the errors are shown. Can be `false` to\nnever show errors, `true` to show errors on blur, or a number to show\nerrors change with the given delay in milliseconds or immediately on blur."
|
|
481
533
|
},
|
|
482
|
-
"
|
|
534
|
+
"getter": false,
|
|
535
|
+
"setter": false,
|
|
483
536
|
"reflect": false,
|
|
484
537
|
"defaultValue": "0"
|
|
485
538
|
},
|
|
486
539
|
"nativeAttributes": {
|
|
487
540
|
"type": "unknown",
|
|
541
|
+
"attribute": "native-attributes",
|
|
488
542
|
"mutable": false,
|
|
489
543
|
"complexType": {
|
|
490
544
|
"original": "{ [key: string]: string }",
|
|
@@ -496,10 +550,13 @@ export class CatTextarea {
|
|
|
496
550
|
"docs": {
|
|
497
551
|
"tags": [],
|
|
498
552
|
"text": "Attributes that will be added to the native HTML textarea element."
|
|
499
|
-
}
|
|
553
|
+
},
|
|
554
|
+
"getter": false,
|
|
555
|
+
"setter": false
|
|
500
556
|
},
|
|
501
557
|
"testId": {
|
|
502
558
|
"type": "string",
|
|
559
|
+
"attribute": "test-id",
|
|
503
560
|
"mutable": false,
|
|
504
561
|
"complexType": {
|
|
505
562
|
"original": "string",
|
|
@@ -512,7 +569,8 @@ export class CatTextarea {
|
|
|
512
569
|
"tags": [],
|
|
513
570
|
"text": "A unique identifier for the underlying native element that is used for\ntesting purposes. The attribute is added as `data-test` attribute and acts\nas a shorthand for `nativeAttributes={ 'data-test': 'test-Id' }`."
|
|
514
571
|
},
|
|
515
|
-
"
|
|
572
|
+
"getter": false,
|
|
573
|
+
"setter": false,
|
|
516
574
|
"reflect": false
|
|
517
575
|
}
|
|
518
576
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cat-textarea.js","sourceRoot":"","sources":["../../../src/components/cat-textarea/cat-textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,EACN,MAAM,eAAe,CAAC;AACvB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAY,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,eAAe,IAAI,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAExE,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB;;;;;;;;;;GAUG;AASH,MAAM,OAAO,WAAW;;QACL,QAAG,GAAG,gBAAgB,YAAY,EAAE,EAAE,CAAC;+BAU7B,KAAK;8BAEN,KAAK;iCAEF,KAAK;;8BASgE,UAAU;0BAKvF,KAAK;;wBAUP,KAAK;;;qBAeR,EAAE;2BAKI,KAAK;;;;;wBAyBR,KAAK;wBAKL,KAAK;oBAKT,CAAC;;;2BAsBwB,CAAC;;;;IAlHzC,IAAY,EAAE;QACZ,OAAO,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,G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a,KAAK,IAAI,CAAC,WAAW,IAAI,QAAQ,CAAC,aAAa,KAAK,IAAI,CAAC,QAAQ,CAAC;QACzG,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n State,\n Watch\n} from '@stencil/core';\nimport autosize from 'autosize';\nimport { coerceBoolean, coerceNumber } from '../../utils/coerce';\nimport { CatFormHint, ErrorMap } from '../cat-form-hint/cat-form-hint';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\n\nlet nextUniqueId = 0;\n\n/**\n * Textarea specifies a control that allows user to write text over multiple\n * rows. Used when the expected user input is long. For shorter input, use the\n * input component.\n *\n * @slot hint - Optional hint element to be displayed with the textarea.\n * @slot label - The slotted label. If both the label property and the label slot are present, only the label slot will be displayed.\n * @slot counter - Custom counter element to be displayed in the top right corner of the label.\n * @part label - The native label element.\n * @part textarea - The native textarea element.\n */\n@Component({\n tag: 'cat-textarea',\n styleUrl: 'cat-textarea.scss',\n formAssociated: true,\n shadow: {\n delegatesFocus: true\n }\n})\nexport class CatTextarea {\n private readonly _id = `cat-textarea-${nextUniqueId++}`;\n private get id() {\n return this.identifier || this._id;\n }\n\n private textarea!: HTMLTextAreaElement;\n private errorMapSrc?: ErrorMap | true;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n @State() hasSlottedHint = false;\n\n @State() hasSlottedCounter = false;\n\n @State() errorMap?: ErrorMap | true;\n\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * Whether the label need a marker to shown if the textarea is required or optional.\n */\n @Prop() requiredMarker?: 'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!' = 'optional';\n\n /**\n * Whether the label is on top or left.\n */\n @Prop() horizontal = false;\n\n /**\n * Hint for form autofill feature.\n */\n @Prop() autoComplete?: string;\n\n /**\n * Whether the textarea is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Optional hint text(s) to be displayed with the textarea.\n */\n @Prop() hint?: string | string[];\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * The label for the textarea.\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * A maximum length (number of characters) for textual values.\n */\n @Prop() maxLength?: number;\n\n /**\n * A minimum length (number of characters) for textual values.\n */\n @Prop() minLength?: number;\n\n /**\n * The name of the form control. Submitted with the form as part of a name/value pair.\n */\n @Prop() name?: string;\n\n /**\n * The placeholder text to display within the input.\n */\n @Prop() placeholder?: string;\n\n /**\n * The value is not editable.\n */\n @Prop() readonly = false;\n\n /**\n * A value is required or must be check for the form to be submittable.\n */\n @Prop() required = false;\n\n /**\n * Specifies the initial number of lines in the textarea.\n */\n @Prop() rows = 3;\n\n /**\n * The initial value of the control.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The validation errors for this input. Will render a hint under the input\n * with the translated error message(s) `error.${key}`. If an object is\n * passed, the keys will be used as error keys and the values translation\n * parameters.\n * If the value is `true`, the input will be marked as invalid without any\n * hints under the input.\n */\n @Prop() errors?: boolean | string[] | ErrorMap;\n\n /**\n * Fine-grained control over when the errors are shown. Can be `false` to\n * never show errors, `true` to show errors on blur, or a number to show\n * errors change with the given delay in milliseconds or immediately on blur.\n */\n @Prop() errorUpdate: boolean | number = 0;\n\n /**\n * Attributes that will be added to the native HTML textarea element.\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * A unique identifier for the underlying native element that is used for\n * testing purposes. The attribute is added as `data-test` attribute and acts\n * as a shorthand for `nativeAttributes={ 'data-test': 'test-Id' }`.\n */\n @Prop() testId?: string;\n\n /**\n * Emitted when the value is changed.\n */\n @Event() catChange!: EventEmitter<string>;\n\n /**\n * Emitted when the textarea received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the textarea loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillLoad(): void {\n this.onErrorsChanged(this.errors, undefined, false);\n }\n\n componentWillRender(): void {\n this.internals.setFormValue(this.value ?? null);\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n this.hasSlottedCounter = !!this.hostElement.querySelector('[slot=\"counter\"]');\n }\n\n componentDidLoad(): void {\n autosize(this.textarea);\n }\n\n /**\n * Programmatically move focus to the textarea. Use this method instead of\n * `textarea.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this.textarea.focus(options);\n }\n\n /**\n * Programmatically remove focus from the textarea. Use this method instead of\n * `textarea.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.textarea.blur();\n }\n\n /**\n * Clear the textarea.\n */\n @Method()\n async clear(): Promise<void> {\n this.value = '';\n this.catChange.emit(this.value);\n }\n\n @Watch('errors')\n onErrorsChanged(newValue?: boolean | string[] | ErrorMap, _oldValue?: unknown, update: boolean = true) {\n if (!coerceBoolean(this.errorUpdate)) {\n this.errorMap = undefined;\n } else {\n this.errorMapSrc = Array.isArray(newValue)\n ? (newValue as string[]).reduce((acc, err) => ({ ...acc, [err]: undefined }), {})\n : newValue || undefined;\n if (update) {\n this.showErrorsIfTimeout() || this.showErrorsIfNoFocus();\n }\n }\n }\n\n render() {\n this.hostElement.tabIndex = Number(this.hostElement.getAttribute('tabindex')) || 0;\n return (\n <Host>\n <div\n class={{\n 'textarea-field': true,\n 'textarea-horizontal': this.horizontal\n }}\n >\n <div class={{ 'label-container': true, hidden: this.labelHidden }}>\n {(this.hasSlottedLabel || this.label) && (\n <label htmlFor={this.id} part=\"label\">\n <span class=\"label-wrapper\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n <div class=\"label-metadata\">\n {!this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.optional')})\n </span>\n )}\n {this.required && this.requiredMarker?.startsWith('required') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.required')})\n </span>\n )}\n {(this.maxLength || this.hasSlottedCounter) && (\n <div class=\"label-character-count\" aria-hidden=\"true\">\n {this.hasSlottedCounter ? (\n <slot name=\"counter\"></slot>\n ) : (\n `${this.value?.length ?? 0}/${this.maxLength}`\n )}\n </div>\n )}\n </div>\n </span>\n </label>\n )}\n </div>\n <div class=\"textarea-container\">\n <div\n class={{\n 'textarea-wrapper': true,\n 'textarea-readonly': this.readonly,\n 'textarea-disabled': this.disabled,\n 'textarea-invalid': this.invalid\n }}\n >\n <textarea\n data-test={this.testId}\n {...this.nativeAttributes}\n part=\"textarea\"\n ref={el => (this.textarea = el as HTMLTextAreaElement)}\n id={this.id}\n disabled={this.disabled}\n autocomplete={this.autoComplete}\n maxlength={this.maxLength}\n minlength={this.minLength}\n name={this.name}\n placeholder={this.placeholder}\n readonly={this.readonly}\n required={this.required}\n rows={this.rows}\n value={this.value}\n onInput={this.onInput.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n aria-invalid={this.invalid ? 'true' : undefined}\n aria-describedby={this.hasHint ? this.id + '-hint' : undefined}\n ></textarea>\n {this.invalid && (\n <cat-icon\n icon=\"$cat:input-error\"\n class=\"icon-suffix cat-text-danger\"\n size=\"l\"\n onClick={() => this.textarea.focus()}\n ></cat-icon>\n )}\n </div>\n {this.hasHint && (\n <CatFormHint\n id={this.id}\n hint={this.hint}\n slottedHint={this.hasSlottedHint && <slot name=\"hint\"></slot>}\n errorMap={this.errorMap}\n />\n )}\n </div>\n </div>\n </Host>\n );\n }\n\n private get hasHint() {\n return !!this.hint || !!this.hasSlottedHint || this.invalid;\n }\n\n private get invalid() {\n return this.errorMap === true || !!Object.keys(this.errorMap || {}).length;\n }\n\n private onInput() {\n this.value = this.textarea.value;\n this.internals.setFormValue(this.textarea.value);\n this.catChange.emit(this.value);\n this.showErrorsIfTimeout();\n }\n\n private onFocus(event: FocusEvent) {\n this.catFocus.emit(event);\n }\n\n private onBlur(event: FocusEvent) {\n this.catBlur.emit(event);\n if (coerceBoolean(this.errorUpdate)) {\n this.showErrors();\n }\n }\n\n private showErrors() {\n this.errorMap = this.errorMapSrc;\n }\n\n private errorUpdateTimeoutId?: number;\n private showErrorsIfTimeout() {\n const errorUpdate = coerceNumber(this.errorUpdate, null);\n if (errorUpdate !== null) {\n typeof this.errorUpdateTimeoutId === 'number' && window.clearTimeout(this.errorUpdateTimeoutId);\n this.errorUpdateTimeoutId = window.setTimeout(() => this.showErrors(), errorUpdate);\n return true;\n }\n return false;\n }\n\n private showErrorsIfNoFocus() {\n const hasFocus = document.activeElement === this.hostElement || document.activeElement === this.textarea;\n if (!hasFocus) {\n this.showErrors();\n }\n }\n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KAAK,IAAI,CAAC,QAAQ,CAAC;QACzG,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n State,\n Watch\n} from '@stencil/core';\nimport autosize from 'autosize';\nimport { coerceBoolean, coerceNumber } from '../../utils/coerce';\nimport { CatFormHint, ErrorMap } from '../cat-form-hint/cat-form-hint';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\n\nlet nextUniqueId = 0;\n\n/**\n * Textarea specifies a control that allows user to write text over multiple\n * rows. Used when the expected user input is long. For shorter input, use the\n * input component.\n *\n * @slot hint - Optional hint element to be displayed with the textarea.\n * @slot label - The slotted label. If both the label property and the label slot are present, only the label slot will be displayed.\n * @slot counter - Custom counter element to be displayed in the top right corner of the label.\n * @part label - The native label element.\n * @part textarea - The native textarea element.\n */\n@Component({\n tag: 'cat-textarea',\n styleUrl: 'cat-textarea.scss',\n formAssociated: true,\n shadow: {\n delegatesFocus: true\n }\n})\nexport class CatTextarea {\n private readonly _id = `cat-textarea-${nextUniqueId++}`;\n private get id() {\n return this.identifier || this._id;\n }\n\n private textarea!: HTMLTextAreaElement;\n private errorMapSrc?: ErrorMap | true;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n @State() hasSlottedHint = false;\n\n @State() hasSlottedCounter = false;\n\n @State() errorMap?: ErrorMap | true;\n\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * Whether the label need a marker to shown if the textarea is required or optional.\n */\n @Prop() requiredMarker?: 'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!' = 'optional';\n\n /**\n * Whether the label is on top or left.\n */\n @Prop() horizontal = false;\n\n /**\n * Hint for form autofill feature.\n */\n @Prop() autoComplete?: string;\n\n /**\n * Whether the textarea is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Optional hint text(s) to be displayed with the textarea.\n */\n @Prop() hint?: string | string[];\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * The label for the textarea.\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * A maximum length (number of characters) for textual values.\n */\n @Prop() maxLength?: number;\n\n /**\n * A minimum length (number of characters) for textual values.\n */\n @Prop() minLength?: number;\n\n /**\n * The name of the form control. Submitted with the form as part of a name/value pair.\n */\n @Prop() name?: string;\n\n /**\n * The placeholder text to display within the input.\n */\n @Prop() placeholder?: string;\n\n /**\n * The value is not editable.\n */\n @Prop() readonly = false;\n\n /**\n * A value is required or must be check for the form to be submittable.\n */\n @Prop() required = false;\n\n /**\n * Specifies the initial number of lines in the textarea.\n */\n @Prop() rows = 3;\n\n /**\n * The initial value of the control.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The validation errors for this input. Will render a hint under the input\n * with the translated error message(s) `error.${key}`. If an object is\n * passed, the keys will be used as error keys and the values translation\n * parameters.\n * If the value is `true`, the input will be marked as invalid without any\n * hints under the input.\n */\n @Prop() errors?: boolean | string[] | ErrorMap;\n\n /**\n * Fine-grained control over when the errors are shown. Can be `false` to\n * never show errors, `true` to show errors on blur, or a number to show\n * errors change with the given delay in milliseconds or immediately on blur.\n */\n @Prop() errorUpdate: boolean | number = 0;\n\n /**\n * Attributes that will be added to the native HTML textarea element.\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * A unique identifier for the underlying native element that is used for\n * testing purposes. The attribute is added as `data-test` attribute and acts\n * as a shorthand for `nativeAttributes={ 'data-test': 'test-Id' }`.\n */\n @Prop() testId?: string;\n\n /**\n * Emitted when the value is changed.\n */\n @Event() catChange!: EventEmitter<string>;\n\n /**\n * Emitted when the textarea received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the textarea loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillLoad(): void {\n this.onErrorsChanged(this.errors, undefined, false);\n }\n\n componentWillRender(): void {\n this.internals.setFormValue(this.value ?? null);\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n this.hasSlottedCounter = !!this.hostElement.querySelector('[slot=\"counter\"]');\n }\n\n componentDidLoad(): void {\n autosize(this.textarea);\n }\n\n /**\n * Programmatically move focus to the textarea. Use this method instead of\n * `textarea.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this.textarea.focus(options);\n }\n\n /**\n * Programmatically remove focus from the textarea. Use this method instead of\n * `textarea.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.textarea.blur();\n }\n\n /**\n * Clear the textarea.\n */\n @Method()\n async clear(): Promise<void> {\n this.value = '';\n this.catChange.emit(this.value);\n }\n\n @Watch('errors')\n onErrorsChanged(newValue?: boolean | string[] | ErrorMap, _oldValue?: unknown, update: boolean = true) {\n if (!coerceBoolean(this.errorUpdate)) {\n this.errorMap = undefined;\n } else {\n this.errorMapSrc = Array.isArray(newValue)\n ? (newValue as string[]).reduce((acc, err) => ({ ...acc, [err]: undefined }), {})\n : newValue || undefined;\n if (update) {\n this.showErrorsIfTimeout() || this.showErrorsIfNoFocus();\n }\n }\n }\n\n render() {\n this.hostElement.tabIndex = Number(this.hostElement.getAttribute('tabindex')) || 0;\n return (\n <Host>\n <div\n class={{\n 'textarea-field': true,\n 'textarea-horizontal': this.horizontal\n }}\n >\n <div class={{ 'label-container': true, hidden: this.labelHidden }}>\n {(this.hasSlottedLabel || this.label) && (\n <label htmlFor={this.id} part=\"label\">\n <span class=\"label-wrapper\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n <div class=\"label-metadata\">\n {!this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.optional')})\n </span>\n )}\n {this.required && this.requiredMarker?.startsWith('required') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.required')})\n </span>\n )}\n {(this.maxLength || this.hasSlottedCounter) && (\n <div class=\"label-character-count\" aria-hidden=\"true\">\n {this.hasSlottedCounter ? (\n <slot name=\"counter\"></slot>\n ) : (\n `${this.value?.length ?? 0}/${this.maxLength}`\n )}\n </div>\n )}\n </div>\n </span>\n </label>\n )}\n </div>\n <div class=\"textarea-container\">\n <div\n class={{\n 'textarea-wrapper': true,\n 'textarea-readonly': this.readonly,\n 'textarea-disabled': this.disabled,\n 'textarea-invalid': this.invalid\n }}\n >\n <textarea\n data-test={this.testId}\n {...this.nativeAttributes}\n part=\"textarea\"\n ref={el => (this.textarea = el as HTMLTextAreaElement)}\n id={this.id}\n disabled={this.disabled}\n autocomplete={this.autoComplete}\n maxlength={this.maxLength}\n minlength={this.minLength}\n name={this.name}\n placeholder={this.placeholder}\n readonly={this.readonly}\n required={this.required}\n rows={this.rows}\n value={this.value}\n onInput={this.onInput.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n aria-invalid={this.invalid ? 'true' : undefined}\n aria-describedby={this.hasHint ? this.id + '-hint' : undefined}\n ></textarea>\n {this.invalid && (\n <cat-icon\n icon=\"$cat:input-error\"\n class=\"icon-suffix cat-text-danger\"\n size=\"l\"\n onClick={() => this.textarea.focus()}\n ></cat-icon>\n )}\n </div>\n {this.hasHint && (\n <CatFormHint\n id={this.id}\n hint={this.hint}\n slottedHint={this.hasSlottedHint && <slot name=\"hint\"></slot>}\n errorMap={this.errorMap}\n />\n )}\n </div>\n </div>\n </Host>\n );\n }\n\n private get hasHint() {\n return !!this.hint || !!this.hasSlottedHint || this.invalid;\n }\n\n private get invalid() {\n return this.errorMap === true || !!Object.keys(this.errorMap || {}).length;\n }\n\n private onInput() {\n this.value = this.textarea.value;\n this.internals.setFormValue(this.textarea.value);\n this.catChange.emit(this.value);\n this.showErrorsIfTimeout();\n }\n\n private onFocus(event: FocusEvent) {\n this.catFocus.emit(event);\n }\n\n private onBlur(event: FocusEvent) {\n this.catBlur.emit(event);\n if (coerceBoolean(this.errorUpdate)) {\n this.showErrors();\n }\n }\n\n private showErrors() {\n this.errorMap = this.errorMapSrc;\n }\n\n private errorUpdateTimeoutId?: number;\n private showErrorsIfTimeout() {\n const errorUpdate = coerceNumber(this.errorUpdate, null);\n if (errorUpdate !== null) {\n typeof this.errorUpdateTimeoutId === 'number' && window.clearTimeout(this.errorUpdateTimeoutId);\n this.errorUpdateTimeoutId = window.setTimeout(() => this.showErrors(), errorUpdate);\n return true;\n }\n return false;\n }\n\n private showErrorsIfNoFocus() {\n const hasFocus = document.activeElement === this.hostElement || document.activeElement === this.textarea;\n if (!hasFocus) {\n this.showErrors();\n }\n }\n}\n"]}
|