@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
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
2
|
|
|
3
3
|
const catSpinnerCss = ":host{display:inline-flex;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}:host[hidden]{display:none}span{display:inline-flex}svg{fill:none;stroke:currentColor;stroke-dasharray:135px;stroke-dashoffset:95px;stroke-linecap:round;stroke-width:5px;transform-origin:center center;animation:spin 0.75s cubic-bezier(0.4, 0.15, 0.6, 0.85) infinite;width:1em;height:1em}.spinner-xs svg{font-size:0.75rem}.spinner-s svg{font-size:1rem}.spinner-m svg{font-size:1.25rem}.spinner-l svg{font-size:1.5rem}.spinner-xl svg{font-size:1.75rem}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}";
|
|
4
|
-
const CatSpinnerStyle0 = catSpinnerCss;
|
|
5
4
|
|
|
6
5
|
const CatSpinner = /*@__PURE__*/ proxyCustomElement(class CatSpinner extends HTMLElement {
|
|
7
6
|
constructor() {
|
|
8
7
|
super();
|
|
9
8
|
this.__registerHost();
|
|
10
9
|
this.__attachShadow();
|
|
10
|
+
/**
|
|
11
|
+
* The size of the spinner.
|
|
12
|
+
*/
|
|
11
13
|
this.size = 'm';
|
|
12
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Value of the progress bar. Defaults to zero. Mirrored to aria-valuenow.
|
|
16
|
+
*/
|
|
13
17
|
this.value = 0;
|
|
14
18
|
}
|
|
15
19
|
render() {
|
|
@@ -17,7 +21,7 @@ const CatSpinner = /*@__PURE__*/ proxyCustomElement(class CatSpinner extends HTM
|
|
|
17
21
|
[`spinner-${this.size}`]: this.size !== 'inline'
|
|
18
22
|
} }, h("svg", { key: '6a649c21b27b3dbad3c73a71936566e7e9648254', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48" }, h("circle", { key: '3fb75a339ec6e18d0209e9da2cbf650f2dae4420', cx: "24", cy: "24", r: "21.5" }))));
|
|
19
23
|
}
|
|
20
|
-
static get style() { return
|
|
24
|
+
static get style() { return catSpinnerCss; }
|
|
21
25
|
}, [1, "cat-spinner", {
|
|
22
26
|
"size": [1],
|
|
23
27
|
"a11yLabel": [1, "a11y-label"],
|
|
@@ -38,5 +42,6 @@ function defineCustomElement() {
|
|
|
38
42
|
}
|
|
39
43
|
|
|
40
44
|
export { CatSpinner as C, defineCustomElement as d };
|
|
45
|
+
//# sourceMappingURL=cat-spinner2.js.map
|
|
41
46
|
|
|
42
47
|
//# sourceMappingURL=cat-spinner2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"cat-spinner2.js","mappings":";;AAAA,MAAM,aAAa,GAAG,6nBAA6nB,
|
|
1
|
+
{"file":"cat-spinner2.js","mappings":";;AAAA,MAAM,aAAa,GAAG,6nBAA6nB;;MCUtoB,UAAU,iBAAAA,kBAAA,CAAA,MAAA,UAAA,SAAA,WAAA,CAAA;AALvB,IAAA,WAAA,GAAA;;;;AAME;;AAEG;AACK,QAAA,IAAI,CAAA,IAAA,GAA6C,GAAG;AAQ5D;;AAEG;AAC2B,QAAA,IAAK,CAAA,KAAA,GAAW,CAAC;AAsBhD;IApBC,MAAM,GAAA;QACJ,QACE,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACE,IAAI,EAAC,aAAa,EAClB,QAAQ,EAAC,IAAI,gBACD,IAAI,CAAC,SAAS,EAAA,aAAA,EACb,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,MAAM,EAC5B,eAAA,EAAA,IAAI,CAAC,KAAK,mBACX,GAAG,EAAA,eAAA,EACH,KAAK,EACnB,KAAK,EAAE;gBACL,CAAC,CAAA,QAAA,EAAW,IAAI,CAAC,IAAI,CAAA,CAAE,GAAG,IAAI,CAAC,IAAI,KAAK;aACzC,EAAA,EAED,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,WAAW,EAAA,EACzD,CAAA,CAAA,QAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,MAAM,EAAA,CAAU,CACtC,CACD;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement"],"sources":["src/components/cat-spinner/cat-spinner.scss?tag=cat-spinner&encapsulation=shadow","src/components/cat-spinner/cat-spinner.tsx"],"sourcesContent":["@use 'variables' as *;\n@use 'mixins' as *;\n@use 'sass:map';\n\n$spinner-sizes: (\n 'xl': 1.75rem,\n 'l': 1.5rem,\n 'm': 1.25rem,\n 's': 1rem,\n 'xs': 0.75rem\n);\n\n:host {\n display: inline-flex;\n vertical-align: middle;\n @include cat-select(none);\n\n &[hidden] {\n display: none;\n }\n}\n\nspan {\n display: inline-flex;\n}\n\nsvg {\n fill: none;\n stroke: currentColor;\n stroke-dasharray: 135px;\n stroke-dashoffset: 95px;\n stroke-linecap: round;\n stroke-width: 5px;\n transform-origin: center center;\n animation: spin 0.75s cubic-bezier(0.4, 0.15, 0.6, 0.85) infinite;\n width: 1em;\n height: 1em;\n}\n\n// ----- sizes\n\n@mixin size($size) {\n .spinner-#{$size} svg {\n font-size: map.get($spinner-sizes, $size);\n }\n}\n\n@include size('xs');\n@include size('s');\n@include size('m');\n@include size('l');\n@include size('xl');\n\n// ----- animation\n\n@keyframes spin {\n from {\n transform: rotate(0deg);\n }\n\n to {\n transform: rotate(360deg);\n }\n}\n","import { Component, h, Prop } from '@stencil/core';\n\n/**\n * Spinners are used to indicate users that their action is being processed.\n */\n@Component({\n tag: 'cat-spinner',\n styleUrl: 'cat-spinner.scss',\n shadow: true\n})\nexport class CatSpinner {\n /**\n * The size of the spinner.\n */\n @Prop() size: 'xs' | 's' | 'm' | 'l' | 'xl' | 'inline' = 'm';\n\n /**\n * Adds accessible label for the spinner that is only shown for screen\n * readers. The `aria-hidden` attribute will be set if no label is present.\n */\n @Prop({ attribute: 'a11y-label' }) a11yLabel?: string;\n\n /**\n * Value of the progress bar. Defaults to zero. Mirrored to aria-valuenow.\n */\n @Prop({ attribute: 'value' }) value: number = 0;\n\n render() {\n return (\n <span\n role=\"progressbar\"\n tabindex=\"-1\"\n aria-label={this.a11yLabel}\n aria-hidden={this.a11yLabel ? null : 'true'}\n aria-valuenow={this.value}\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n class={{\n [`spinner-${this.size}`]: this.size !== 'inline'\n }}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 48\">\n <circle cx=\"24\" cy=\"24\" r=\"21.5\"></circle>\n </svg>\n </span>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
|
|
3
3
|
const catTabCss = ":host{display:block}:host([hidden]){display:none}";
|
|
4
|
-
const CatTabStyle0 = catTabCss;
|
|
5
4
|
|
|
6
5
|
let nextUniqueId = 0;
|
|
7
6
|
const CatTab$1 = /*@__PURE__*/ proxyCustomElement(class CatTab extends HTMLElement {
|
|
@@ -10,17 +9,41 @@ const CatTab$1 = /*@__PURE__*/ proxyCustomElement(class CatTab extends HTMLEleme
|
|
|
10
9
|
this.__registerHost();
|
|
11
10
|
this.__attachShadow();
|
|
12
11
|
this.catClick = createEvent(this, "catClick", 7);
|
|
12
|
+
/**
|
|
13
|
+
* The label of the tab.
|
|
14
|
+
*/
|
|
13
15
|
this.label = '';
|
|
14
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Hide the actual button content and only display the tab.
|
|
18
|
+
*/
|
|
15
19
|
this.iconOnly = false;
|
|
20
|
+
/**
|
|
21
|
+
* Display the icon on the right.
|
|
22
|
+
*/
|
|
16
23
|
this.iconRight = false;
|
|
17
|
-
|
|
18
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Specifies that the tab should be deactivated.
|
|
26
|
+
*/
|
|
19
27
|
this.deactivated = false;
|
|
28
|
+
/**
|
|
29
|
+
* Specifies that the tab does not have an active state and thus cannot be
|
|
30
|
+
* activated. This does not mean, that the tab is deactivated. The tab can
|
|
31
|
+
* still be clicked and emit the `catClick` event. This is helpful if a tab
|
|
32
|
+
* should only trigger a click action (such as opening a modal).
|
|
33
|
+
*/
|
|
20
34
|
this.noActive = false;
|
|
35
|
+
/**
|
|
36
|
+
* Specifies that the tab is always visible in adaptive mode.
|
|
37
|
+
* Only the first sticky tab will be taken into account.
|
|
38
|
+
* Sticky has advantage on activeTabAlwaysVisible if there is no space to show both.
|
|
39
|
+
*/
|
|
40
|
+
this.sticky = false;
|
|
41
|
+
/**
|
|
42
|
+
* Specifies that the tab content pane contains an error. This will color
|
|
43
|
+
* the tab in an error state and also switch to an error icon if an icon
|
|
44
|
+
* is specified.
|
|
45
|
+
*/
|
|
21
46
|
this.error = false;
|
|
22
|
-
this.nativeAttributes = undefined;
|
|
23
|
-
this.testId = undefined;
|
|
24
47
|
}
|
|
25
48
|
connectedCallback() {
|
|
26
49
|
if (!this.hostElement.id) {
|
|
@@ -31,10 +54,10 @@ const CatTab$1 = /*@__PURE__*/ proxyCustomElement(class CatTab extends HTMLEleme
|
|
|
31
54
|
this.catClick.emit(event);
|
|
32
55
|
}
|
|
33
56
|
render() {
|
|
34
|
-
return h(Host, { key: '
|
|
57
|
+
return h(Host, { key: 'd74edadf291560111aff4a925b4147b377a24b63' });
|
|
35
58
|
}
|
|
36
59
|
get hostElement() { return this; }
|
|
37
|
-
static get style() { return
|
|
60
|
+
static get style() { return catTabCss; }
|
|
38
61
|
}, [1, "cat-tab", {
|
|
39
62
|
"label": [513],
|
|
40
63
|
"icon": [513],
|
|
@@ -44,8 +67,9 @@ const CatTab$1 = /*@__PURE__*/ proxyCustomElement(class CatTab extends HTMLEleme
|
|
|
44
67
|
"urlTarget": [513, "url-target"],
|
|
45
68
|
"deactivated": [516],
|
|
46
69
|
"noActive": [516, "no-active"],
|
|
70
|
+
"sticky": [516],
|
|
47
71
|
"error": [516],
|
|
48
|
-
"nativeAttributes": [16],
|
|
72
|
+
"nativeAttributes": [16, "native-attributes"],
|
|
49
73
|
"testId": [1, "test-id"]
|
|
50
74
|
}, [[0, "click", "onClick"]]]);
|
|
51
75
|
function defineCustomElement$1() {
|
|
@@ -66,5 +90,6 @@ const CatTab = CatTab$1;
|
|
|
66
90
|
const defineCustomElement = defineCustomElement$1;
|
|
67
91
|
|
|
68
92
|
export { CatTab, defineCustomElement };
|
|
93
|
+
//# sourceMappingURL=cat-tab.js.map
|
|
69
94
|
|
|
70
95
|
//# sourceMappingURL=cat-tab.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"cat-tab.js","mappings":";;AAAA,MAAM,SAAS,GAAG,mDAAmD
|
|
1
|
+
{"file":"cat-tab.js","mappings":";;AAAA,MAAM,SAAS,GAAG,mDAAmD;;ACGrE,IAAI,YAAY,GAAG,CAAC;MAUPA,QAAM,iBAAAC,kBAAA,CAAA,MAAA,MAAA,SAAA,WAAA,CAAA;AALnB,IAAA,WAAA,GAAA;;;;;AAQE;;AAEG;AACsB,QAAA,IAAK,CAAA,KAAA,GAAG,EAAE;AAOnC;;AAEG;AACsB,QAAA,IAAQ,CAAA,QAAA,GAAyB,KAAK;AAE/D;;AAEG;AACsB,QAAA,IAAS,CAAA,SAAA,GAAG,KAAK;AAY1C;;AAEG;AACsB,QAAA,IAAW,CAAA,WAAA,GAAG,KAAK;AAE5C;;;;;AAKG;AACsB,QAAA,IAAQ,CAAA,QAAA,GAAG,KAAK;AAEzC;;;;AAIG;AACsB,QAAA,IAAM,CAAA,MAAA,GAAG,KAAK;AAEvC;;;;AAIG;AACsB,QAAA,IAAK,CAAA,KAAA,GAAG,KAAK;AAiCvC;IAdC,iBAAiB,GAAA;AACf,QAAA,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,EAAE;YACxB,IAAI,CAAC,WAAW,CAAC,EAAE,GAAG,CAAW,QAAA,EAAA,YAAY,EAAE,CAAA,CAAE;;;AAKrD,IAAA,OAAO,CAAC,KAAiB,EAAA;AACvB,QAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;;IAG3B,MAAM,GAAA;QACJ,OAAO,CAAA,CAAC,IAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CatTab","__stencil_proxyCustomElement"],"sources":["src/components/cat-tab/cat-tab.scss?tag=cat-tab&encapsulation=shadow","src/components/cat-tab/cat-tab.tsx"],"sourcesContent":["@use 'variables' as *;\n@use 'mixins' as *;\n\n:host {\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n","import { Component, h, Prop, Event, EventEmitter, Listen, Host, Element } from '@stencil/core';\nimport { Breakpoint } from '../../utils/breakpoints';\n\nlet nextUniqueId = 0;\n\n/**\n * A single tab inside a tabs component.\n */\n@Component({\n tag: 'cat-tab',\n styleUrl: 'cat-tab.scss',\n shadow: true\n})\nexport class CatTab {\n @Element() hostElement!: HTMLElement;\n\n /**\n * The label of the tab.\n */\n @Prop({ reflect: true }) label = '';\n\n /**\n * The name of an icon to be displayed in the tab.\n */\n @Prop({ reflect: true }) icon?: string;\n\n /**\n * Hide the actual button content and only display the tab.\n */\n @Prop({ reflect: true }) iconOnly: boolean | Breakpoint = false;\n\n /**\n * Display the icon on the right.\n */\n @Prop({ reflect: true }) iconRight = false;\n\n /**\n * A destination to link to, rendered in the href attribute of a link.\n */\n @Prop({ reflect: true }) url?: string;\n\n /**\n * Specifies where to open the linked document.\n */\n @Prop({ reflect: true }) urlTarget?: '_blank' | '_self';\n\n /**\n * Specifies that the tab should be deactivated.\n */\n @Prop({ reflect: true }) deactivated = false;\n\n /**\n * Specifies that the tab does not have an active state and thus cannot be\n * activated. This does not mean, that the tab is deactivated. The tab can\n * still be clicked and emit the `catClick` event. This is helpful if a tab\n * should only trigger a click action (such as opening a modal).\n */\n @Prop({ reflect: true }) noActive = false;\n\n /**\n * Specifies that the tab is always visible in adaptive mode.\n * Only the first sticky tab will be taken into account.\n * Sticky has advantage on activeTabAlwaysVisible if there is no space to show both.\n */\n @Prop({ reflect: true }) sticky = false;\n\n /**\n * Specifies that the tab content pane contains an error. This will color\n * the tab in an error state and also switch to an error icon if an icon\n * is specified.\n */\n @Prop({ reflect: true }) error = false;\n\n /**\n * Attributes that will be added to the native HTML button 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 tab is clicked.\n */\n @Event() catClick!: EventEmitter<MouseEvent>;\n\n connectedCallback() {\n if (!this.hostElement.id) {\n this.hostElement.id = `cat-tab-${nextUniqueId++}`;\n }\n }\n\n @Listen('click')\n onClick(event: MouseEvent) {\n this.catClick.emit(event);\n }\n\n render() {\n return <Host></Host>;\n }\n}\n"],"version":3}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { c as catI18nRegistry } from './cat-i18n-registry.js';
|
|
3
|
+
import { d as defineCustomElement$5 } from './cat-button2.js';
|
|
4
|
+
import { d as defineCustomElement$4 } from './cat-dropdown2.js';
|
|
3
5
|
import { d as defineCustomElement$3 } from './cat-icon2.js';
|
|
4
6
|
import { d as defineCustomElement$2 } from './cat-spinner2.js';
|
|
5
7
|
|
|
6
|
-
const catTabsCss = ":host{display:flex;flex-direction:row;box-shadow:inset 0 -1px 0 0 rgb(var(--cat-border-color, 235, 236, 240))}:host([hidden]){display:none}:host([tabs-align=center]){justify-content:center}:host([tabs-align=right]){justify-content:end}:host([tabs-align=justify]) cat-button{flex:1 0 auto}.cat-tab{display:inline-flex;flex-direction:column;align-items:center;justify-content:space-between;position:relative;transition:none}.cat-tab
|
|
7
|
-
const CatTabsStyle0 = catTabsCss;
|
|
8
|
+
const catTabsCss = ":host{display:flex;flex-direction:row;box-shadow:inset 0 -1px 0 0 rgb(var(--cat-border-color, 235, 236, 240))}:host([hidden]){display:none}:host([tabs-align=center]){justify-content:center}:host([tabs-align=right]){justify-content:end}:host([tabs-align=justify]) cat-button{flex:1 0 auto}.cat-tab,.cat-tab-more-button{display:inline-flex;flex-direction:column;align-items:center;justify-content:space-between;position:relative;transition:none}.cat-tab::after,.cat-tab-more-button::after{opacity:0;content:\"\";position:absolute;background:currentColor;left:0.75rem;right:0.75rem;bottom:0;height:2px}.cat-tab:hover::after,.cat-tab-more-button:hover::after{opacity:0.25}.cat-tab.cat-tab-active,.cat-tab-more-button.cat-tab-active{font-weight:700;color:rgb(var(--cat-primary-text-active, 2, 99, 113))}.cat-tab.cat-tab-active::after,.cat-tab-more-button.cat-tab-active::after{opacity:1}.cat-tab:first-of-type{margin-left:-0.75rem}.cat-tab:last-of-type{margin-right:-0.75rem}.cat-tab.cat-tab-error{color:rgb(var(--cat-danger-text-active, 174, 42, 10))}nav ul{list-style:none;margin:0;padding:0}.cat-tab-list{display:flex;width:100%}";
|
|
8
9
|
|
|
9
10
|
const CatTabs$1 = /*@__PURE__*/ proxyCustomElement(class CatTabs extends HTMLElement {
|
|
10
11
|
constructor() {
|
|
@@ -12,9 +13,26 @@ const CatTabs$1 = /*@__PURE__*/ proxyCustomElement(class CatTabs extends HTMLEle
|
|
|
12
13
|
this.__registerHost();
|
|
13
14
|
this.__attachShadow();
|
|
14
15
|
this.catChange = createEvent(this, "catChange", 7);
|
|
16
|
+
this.resizedObserver = new ResizeObserver(() => this.adjustAdaptiveTabs());
|
|
15
17
|
this.tabs = [];
|
|
18
|
+
this.hiddenTabs = [];
|
|
19
|
+
/**
|
|
20
|
+
* The ID of the active tab.
|
|
21
|
+
*/
|
|
16
22
|
this.activeTab = '';
|
|
23
|
+
/**
|
|
24
|
+
* The alignment of the tabs.
|
|
25
|
+
*/
|
|
17
26
|
this.tabsAlign = 'left';
|
|
27
|
+
/**
|
|
28
|
+
* Whether the visible items change according to the available space. A 'More' button is used to reveal hidden items.
|
|
29
|
+
*/
|
|
30
|
+
this.adaptive = false;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the active tab should always be visible. Applied when adaptive is enabled.
|
|
33
|
+
* Has less priority than sticky if there is no space to show both.
|
|
34
|
+
*/
|
|
35
|
+
this.activeTabAlwaysVisible = false;
|
|
18
36
|
}
|
|
19
37
|
componentWillLoad() {
|
|
20
38
|
this.syncTabs();
|
|
@@ -26,6 +44,12 @@ const CatTabs$1 = /*@__PURE__*/ proxyCustomElement(class CatTabs extends HTMLEle
|
|
|
26
44
|
attributes: true,
|
|
27
45
|
subtree: true
|
|
28
46
|
});
|
|
47
|
+
if (this.adaptive) {
|
|
48
|
+
this.resizedObserver.observe(this.hostElement);
|
|
49
|
+
requestAnimationFrame(() => {
|
|
50
|
+
this.adjustAdaptiveTabs();
|
|
51
|
+
});
|
|
52
|
+
}
|
|
29
53
|
}
|
|
30
54
|
disconnectedCallback() {
|
|
31
55
|
this.mutationObserver?.disconnect();
|
|
@@ -62,19 +86,113 @@ const CatTabs$1 = /*@__PURE__*/ proxyCustomElement(class CatTabs extends HTMLEle
|
|
|
62
86
|
async setActiveIndex(index) {
|
|
63
87
|
this.activate(this.tabs[index]);
|
|
64
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Recalculates visible and hidden adaptive tabs.
|
|
91
|
+
*/
|
|
92
|
+
async updateAdaptiveTabs() {
|
|
93
|
+
if (this.adaptive) {
|
|
94
|
+
this.adjustAdaptiveTabs();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
65
97
|
render() {
|
|
66
98
|
this.hostElement.tabIndex = Number(this.hostElement.getAttribute('tabindex')) || 0;
|
|
67
|
-
return (h(Host, { key: '
|
|
68
|
-
return (h("cat-button", { buttonId: tab.id,
|
|
99
|
+
return (h(Host, { key: '874b547102901311b51c66aace5a2f91f4d52bbb' }, h("div", { key: 'ab2ccbf398bdb5897c71762c9befe63f383a04db', role: "tablist", class: "cat-tab-list" }, this.tabs.map((tab, index) => {
|
|
100
|
+
return (h("cat-button", { buttonId: tab.id, part: "tab", class: {
|
|
69
101
|
'cat-tab': true,
|
|
70
102
|
'cat-tab-active': tab.id === this.activeTab,
|
|
71
|
-
'cat-tab-error': tab.error
|
|
72
|
-
|
|
73
|
-
|
|
103
|
+
'cat-tab-error': tab.error,
|
|
104
|
+
'cat-tab-sticky': tab.sticky
|
|
105
|
+
}, active: tab.id === this.activeTab, color: tab.error ? 'danger' : tab.id === this.activeTab ? 'primary' : 'secondary', variant: "text", icon: tab.icon ? (tab.error ? '$cat:input-error' : tab.icon) : undefined, iconOnly: tab.iconOnly, iconRight: tab.iconRight, url: tab.url, disabled: tab.deactivated, urlTarget: tab.urlTarget, onCatClick: () => this.click(tab), testId: tab.testId, nativeAttributes: {
|
|
106
|
+
...tab.nativeAttributes,
|
|
107
|
+
role: 'tab',
|
|
108
|
+
'aria-selected': String(tab.id === this.activeTab),
|
|
109
|
+
'aria-setsize': String(this.tabs.length),
|
|
110
|
+
'aria-posinset': String(index + 1)
|
|
111
|
+
}, nativeContentAttributes: { 'data-text': tab.label }, "data-dropdown-no-close": true }, tab.label));
|
|
112
|
+
}), this.adaptive ? (h("cat-dropdown", { ref: el => (this.moreDropdown = el) }, h("cat-button", { ref: el => (this.moreButton = el), class: {
|
|
113
|
+
'cat-tab-more-button': true,
|
|
114
|
+
'cat-tab-active': !!this.hiddenTabs.find(tab => tab.id === this.activeTab)
|
|
115
|
+
}, iconRight: true, icon: this.moreDropdown?.isOpen ? 'chevron-up-outlined' : 'chevron-down-outlined', slot: "trigger", part: "more", variant: "text", color: this.hiddenTabs.find(tab => tab.id === this.activeTab) ? 'primary' : 'secondary' }, catI18nRegistry.t('tabs.more')), h("nav", { slot: "content" }, h("ul", null, this.hiddenTabs.map((tab, index) => {
|
|
116
|
+
return (h("li", null, h("cat-button", { class: "cat-nav-item", active: tab.id === this.activeTab, urlTarget: tab.urlTarget, onCatClick: () => this.click(tab), testId: tab.testId, nativeAttributes: {
|
|
117
|
+
...tab.nativeAttributes,
|
|
118
|
+
role: 'tab',
|
|
119
|
+
'aria-selected': String(tab.id === this.activeTab),
|
|
120
|
+
'aria-setsize': String(this.tabs.length),
|
|
121
|
+
'aria-posinset': String(index + 1)
|
|
122
|
+
}, nativeContentAttributes: { 'data-text': tab.label } }, tab.label)));
|
|
123
|
+
}))))) : null)));
|
|
124
|
+
}
|
|
125
|
+
adjustAdaptiveTabs() {
|
|
126
|
+
const tabs = this.hostElement.shadowRoot?.querySelectorAll('.cat-tab');
|
|
127
|
+
if (!tabs?.length) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
// show all hidden tabs for correct calculation
|
|
131
|
+
for (const tab of tabs) {
|
|
132
|
+
tab.style.display = 'inline-flex';
|
|
133
|
+
}
|
|
134
|
+
// show hidden "more" button for correct calculation
|
|
135
|
+
if (this.moreButton) {
|
|
136
|
+
this.moreButton.style.display = 'inline-flex';
|
|
137
|
+
}
|
|
138
|
+
const MORE_WIDTH = this.moreButton?.offsetWidth || 0;
|
|
139
|
+
const visibleTabsIndexes = [];
|
|
140
|
+
let fittingWidth = 0;
|
|
141
|
+
const stickyTabIndex = this.tabs.findIndex(tab => tab.sticky);
|
|
142
|
+
const stickyTabWidth = tabs.item(stickyTabIndex)?.scrollWidth || 0;
|
|
143
|
+
const stickyTabIsVisible = stickyTabIndex > -1 && stickyTabWidth <= this.hostElement.offsetWidth;
|
|
144
|
+
const activeTabIndex = this.tabs.findIndex(tab => tab.id === this.activeTab);
|
|
145
|
+
const activeTabWidth = tabs.item(activeTabIndex)?.scrollWidth || 0;
|
|
146
|
+
const activeTabIsVisible = this.activeTabAlwaysVisible &&
|
|
147
|
+
activeTabIndex > -1 &&
|
|
148
|
+
activeTabWidth + stickyTabWidth <= this.hostElement.offsetWidth;
|
|
149
|
+
if (stickyTabIsVisible) {
|
|
150
|
+
fittingWidth += stickyTabWidth;
|
|
151
|
+
visibleTabsIndexes.push(stickyTabIndex.toString());
|
|
152
|
+
}
|
|
153
|
+
if (activeTabIsVisible && stickyTabIndex !== activeTabIndex) {
|
|
154
|
+
fittingWidth += activeTabWidth;
|
|
155
|
+
visibleTabsIndexes.push(activeTabIndex.toString());
|
|
156
|
+
}
|
|
157
|
+
for (const [index, tab] of tabs.entries()) {
|
|
158
|
+
if ((activeTabIsVisible && index === activeTabIndex) || (stickyTabIsVisible && index === stickyTabIndex)) {
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
if (fittingWidth + tab.scrollWidth <= this.hostElement.offsetWidth) {
|
|
162
|
+
// tab fits within tabs parent
|
|
163
|
+
fittingWidth += tab.scrollWidth;
|
|
164
|
+
visibleTabsIndexes.push(index.toString());
|
|
165
|
+
}
|
|
166
|
+
else if (fittingWidth + MORE_WIDTH <= this.hostElement.offsetWidth) {
|
|
167
|
+
// tab doesn't fit, but more button does
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
// tab doesn't fit and more button doesn't fit either
|
|
172
|
+
// remove last fitting tab so that more button fits
|
|
173
|
+
visibleTabsIndexes.pop();
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
this.hiddenTabs = this.tabs.filter((_, index) => !visibleTabsIndexes.includes(index.toString()));
|
|
178
|
+
if (this.moreButton) {
|
|
179
|
+
if (this.tabs.length > visibleTabsIndexes.length) {
|
|
180
|
+
this.moreButton.style.display = 'inline-flex';
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
this.moreButton.style.display = 'none';
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
for (const [index, tab] of tabs.entries()) {
|
|
187
|
+
if (!visibleTabsIndexes.includes(index.toString())) {
|
|
188
|
+
tab.style.display = 'none';
|
|
189
|
+
}
|
|
190
|
+
}
|
|
74
191
|
}
|
|
75
192
|
syncTabs() {
|
|
76
193
|
this.tabs = Array.from(this.hostElement.querySelectorAll('cat-tab'));
|
|
77
194
|
this.activeTab = this.activeTab || this.tabs.filter(tab => this.canActivate(tab) && !tab.noActive)[0]?.id;
|
|
195
|
+
this.adjustAdaptiveTabs();
|
|
78
196
|
}
|
|
79
197
|
click(tab) {
|
|
80
198
|
if (this.canActivate(tab)) {
|
|
@@ -91,6 +209,7 @@ const CatTabs$1 = /*@__PURE__*/ proxyCustomElement(class CatTabs extends HTMLEle
|
|
|
91
209
|
else if (this.canActivate(tab)) {
|
|
92
210
|
this.activeTab = tab.id;
|
|
93
211
|
}
|
|
212
|
+
this.adjustAdaptiveTabs();
|
|
94
213
|
}
|
|
95
214
|
canActivate(tab) {
|
|
96
215
|
return !tab.deactivated && !tab.url && tab.id !== this.activeTab;
|
|
@@ -100,13 +219,17 @@ const CatTabs$1 = /*@__PURE__*/ proxyCustomElement(class CatTabs extends HTMLEle
|
|
|
100
219
|
static get watchers() { return {
|
|
101
220
|
"activeTab": ["onActiveTabChange"]
|
|
102
221
|
}; }
|
|
103
|
-
static get style() { return
|
|
222
|
+
static get style() { return catTabsCss; }
|
|
104
223
|
}, [17, "cat-tabs", {
|
|
105
224
|
"activeTab": [1537, "active-tab"],
|
|
106
225
|
"tabsAlign": [1, "tabs-align"],
|
|
226
|
+
"adaptive": [4],
|
|
227
|
+
"activeTabAlwaysVisible": [4, "active-tab-always-visible"],
|
|
107
228
|
"tabs": [32],
|
|
229
|
+
"hiddenTabs": [32],
|
|
108
230
|
"setActive": [64],
|
|
109
|
-
"setActiveIndex": [64]
|
|
231
|
+
"setActiveIndex": [64],
|
|
232
|
+
"updateAdaptiveTabs": [64]
|
|
110
233
|
}, [[0, "keydown", "onKeydown"]], {
|
|
111
234
|
"activeTab": ["onActiveTabChange"]
|
|
112
235
|
}]);
|
|
@@ -114,7 +237,7 @@ function defineCustomElement$1() {
|
|
|
114
237
|
if (typeof customElements === "undefined") {
|
|
115
238
|
return;
|
|
116
239
|
}
|
|
117
|
-
const components = ["cat-tabs", "cat-button", "cat-icon", "cat-spinner"];
|
|
240
|
+
const components = ["cat-tabs", "cat-button", "cat-dropdown", "cat-icon", "cat-spinner"];
|
|
118
241
|
components.forEach(tagName => { switch (tagName) {
|
|
119
242
|
case "cat-tabs":
|
|
120
243
|
if (!customElements.get(tagName)) {
|
|
@@ -122,6 +245,11 @@ function defineCustomElement$1() {
|
|
|
122
245
|
}
|
|
123
246
|
break;
|
|
124
247
|
case "cat-button":
|
|
248
|
+
if (!customElements.get(tagName)) {
|
|
249
|
+
defineCustomElement$5();
|
|
250
|
+
}
|
|
251
|
+
break;
|
|
252
|
+
case "cat-dropdown":
|
|
125
253
|
if (!customElements.get(tagName)) {
|
|
126
254
|
defineCustomElement$4();
|
|
127
255
|
}
|
|
@@ -143,5 +271,6 @@ const CatTabs = CatTabs$1;
|
|
|
143
271
|
const defineCustomElement = defineCustomElement$1;
|
|
144
272
|
|
|
145
273
|
export { CatTabs, defineCustomElement };
|
|
274
|
+
//# sourceMappingURL=cat-tabs.js.map
|
|
146
275
|
|
|
147
276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AAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;KAC3G;IAEO,KAAK,CAAC,GAAsB;QAClC,IAAI,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE;YACzB,GAAG,CAAC,KAAK,EAAE,CAAC;YACZ,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE;gBACjB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;aACpB;SACF;KACF;IAEO,QAAQ,CAAC,GAAuB;QACtC,IAAI,CAAC,GAAG,EAAE;YACR,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;SACrB;aAAM,IAAI,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE;YAChC,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,EAAE,CAAC;SACzB;KACF;IAEO,WAAW,CAAC,GAAsB;QACxC,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,SAAS,CAAC;KAClE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CatTabs"],"sources":["src/components/cat-tabs/cat-tabs.scss?tag=cat-tabs&encapsulation=shadow","src/components/cat-tabs/cat-tabs.tsx"],"sourcesContent":["@use 'variables' as *;\n@use 'mixins' as *;\n\n:host {\n display: flex;\n flex-direction: row;\n box-shadow: inset 0 -1px 0 0 cat-token('color.ui.border.default');\n}\n\n:host([hidden]) {\n display: none;\n}\n\n:host([tabs-align='center']) {\n justify-content: center;\n}\n\n:host([tabs-align='right']) {\n justify-content: end;\n}\n\n:host([tabs-align='justify']) {\n cat-button {\n flex: 1 0 auto;\n }\n}\n\n.cat-tab {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n justify-content: space-between;\n position: relative;\n transition: none;\n\n &:first-of-type {\n margin-left: -0.75rem;\n }\n\n &:last-of-type {\n margin-right: -0.75rem;\n }\n\n &::after {\n opacity: 0;\n content: '';\n position: absolute;\n background: currentColor;\n left: 0.75rem;\n right: 0.75rem;\n bottom: 0;\n height: 2px;\n }\n\n &:hover::after {\n opacity: 0.25;\n }\n\n &.cat-tab-active {\n font-weight: 700;\n color: cat-token('color.theme.primary.textActive');\n }\n\n &.cat-tab-error {\n color: cat-token('color.theme.danger.textActive');\n }\n\n &.cat-tab-active::after {\n opacity: 1;\n }\n}\n","import { Component, Element, Event, EventEmitter, Host, Listen, Method, Prop, State, Watch, h } from '@stencil/core';\n\n/**\n * Tabs are used to display multiple panels to be contained within a single\n * window, using tabs as a navigational element.\n *\n * @part tab - The header of the tab.\n * @part more - An optional more button to display additional tabs.\n */\n@Component({\n tag: 'cat-tabs',\n styleUrl: 'cat-tabs.scss',\n shadow: {\n delegatesFocus: true\n }\n})\nexport class CatTabs {\n private mutationObserver?: MutationObserver;\n\n @Element() hostElement!: HTMLElement;\n\n @State() tabs: HTMLCatTabElement[] = [];\n\n /**\n * The ID of the active tab.\n */\n @Prop({ mutable: true, reflect: true }) activeTab = '';\n\n /**\n * The alignment of the tabs.\n */\n @Prop() tabsAlign: 'left' | 'center' | 'right' | 'justify' = 'left';\n\n componentWillLoad(): void {\n this.syncTabs();\n }\n\n componentDidLoad() {\n this.mutationObserver = new MutationObserver(\n mutations => mutations.some(value => value.target.nodeName === 'CAT-TAB') && this.syncTabs()\n );\n this.mutationObserver?.observe(this.hostElement, {\n childList: true,\n attributes: true,\n subtree: true\n });\n }\n\n disconnectedCallback() {\n this.mutationObserver?.disconnect();\n }\n\n @Watch('activeTab')\n onActiveTabChange(id: string) {\n const index = this.tabs.findIndex(tab => tab.id === id);\n this.catChange.emit({ id, index });\n }\n\n @Listen('keydown')\n onKeydown(event: KeyboardEvent): void {\n if (['ArrowDown', 'ArrowUp', 'ArrowRight', 'ArrowLeft'].includes(event.key)) {\n const elements = this.hostElement.shadowRoot?.querySelectorAll<HTMLCatButtonElement>('cat-button[role=\"tab\"]');\n const targetElements = Array.from(elements ?? []).filter(button => !button.disabled);\n const activeElement = this.hostElement.shadowRoot?.activeElement as HTMLCatButtonElement;\n const activeIdx = activeElement ? targetElements.indexOf(activeElement) : -1;\n const activeOff = ['ArrowDown', 'ArrowRight'].includes(event.key) ? 1 : -1;\n const targetIdx = activeIdx < 0 ? 0 : (activeIdx + activeOff + targetElements.length) % targetElements.length;\n targetElements[targetIdx].doFocus();\n event.preventDefault();\n }\n }\n\n /**\n * Activates the tab with the given id.\n *\n * @param id The tab id.\n */\n @Method()\n async setActive(id: string): Promise<void> {\n this.activate(this.tabs.find(tab => tab.id === id));\n }\n\n /**\n * Activates the tab with the given index.\n *\n * @param index The tab index.\n */\n @Method()\n async setActiveIndex(index: number): Promise<void> {\n this.activate(this.tabs[index]);\n }\n\n /**\n * Emitted when active tab is changed.\n */\n @Event() catChange!: EventEmitter<{ id: string; index: number }>;\n\n render() {\n this.hostElement.tabIndex = Number(this.hostElement.getAttribute('tabindex')) || 0;\n return (\n <Host>\n {this.tabs.map((tab: HTMLCatTabElement) => {\n return (\n <cat-button\n buttonId={tab.id}\n role=\"tab\"\n part=\"tab\"\n class={{\n 'cat-tab': true,\n 'cat-tab-active': tab.id === this.activeTab,\n 'cat-tab-error': tab.error\n }}\n active={tab.id === this.activeTab}\n color={tab.error ? 'danger' : tab.id === this.activeTab ? 'primary' : 'secondary'}\n variant=\"text\"\n icon={tab.icon ? (tab.error ? '$cat:input-error' : tab.icon) : undefined}\n iconOnly={tab.iconOnly}\n iconRight={tab.iconRight}\n url={tab.url}\n disabled={tab.deactivated}\n urlTarget={tab.urlTarget}\n onCatClick={() => this.click(tab)}\n testId={tab.testId}\n nativeAttributes={{ ...tab.nativeAttributes }}\n nativeContentAttributes={{ 'data-text': tab.label }}\n data-dropdown-no-close\n >\n {tab.label}\n </cat-button>\n );\n })}\n <slot name=\"more\"></slot>\n </Host>\n );\n }\n\n private syncTabs() {\n this.tabs = Array.from(this.hostElement.querySelectorAll('cat-tab'));\n this.activeTab = this.activeTab || this.tabs.filter(tab => this.canActivate(tab) && !tab.noActive)[0]?.id;\n }\n\n private click(tab: HTMLCatTabElement) {\n if (this.canActivate(tab)) {\n tab.click();\n if (!tab.noActive) {\n this.activate(tab);\n }\n }\n }\n\n private activate(tab?: HTMLCatTabElement) {\n if (!tab) {\n this.activeTab = '';\n } else if (this.canActivate(tab)) {\n this.activeTab = tab.id;\n }\n }\n\n private canActivate(tab: HTMLCatTabElement) {\n return !tab.deactivated && !tab.url && tab.id !== this.activeTab;\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"cat-tabs.js","mappings":";;;;;;;AAAA,MAAM,UAAU,GAAG,ymCAAymC;;MCiB/mCA,SAAO,iBAAAC,kBAAA,CAAA,MAAA,OAAA,SAAA,WAAA,CAAA;AAPpB,IAAA,WAAA,GAAA;;;;;AAWmB,QAAA,IAAA,CAAA,eAAe,GAAG,IAAI,cAAc,CAAC,MAAM,IAAI,CAAC,kBAAkB,EAAE,CAAC;AAI7E,QAAA,IAAI,CAAA,IAAA,GAAwB,EAAE;AAC9B,QAAA,IAAU,CAAA,UAAA,GAAwB,EAAE;AAE7C;;AAEG;AACqC,QAAA,IAAS,CAAA,SAAA,GAAG,EAAE;AAEtD;;AAEG;AACK,QAAA,IAAS,CAAA,SAAA,GAA4C,MAAM;AAEnE;;AAEG;AACK,QAAA,IAAQ,CAAA,QAAA,GAAG,KAAK;AAExB;;;AAGG;AACK,QAAA,IAAsB,CAAA,sBAAA,GAAG,KAAK;AAsRvC;IApRC,iBAAiB,GAAA;QACf,IAAI,CAAC,QAAQ,EAAE;;IAGjB,gBAAgB,GAAA;AACd,QAAA,IAAI,CAAC,gBAAgB,GAAG,IAAI,gBAAgB,CAC1C,SAAS,IAAI,SAAS,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAC7F;Q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AG,EAAE;AACR,YAAA,IAAI,CAAC,SAAS,GAAG,EAAE;;AACd,aAAA,IAAI,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE;AAChC,YAAA,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,EAAE;;QAEzB,IAAI,CAAC,kBAAkB,EAAE;;AAGnB,IAAA,WAAW,CAAC,GAAsB,EAAA;AACxC,QAAA,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CatTabs","__stencil_proxyCustomElement","i18n"],"sources":["src/components/cat-tabs/cat-tabs.scss?tag=cat-tabs&encapsulation=shadow","src/components/cat-tabs/cat-tabs.tsx"],"sourcesContent":["@use 'variables' as *;\n@use 'mixins' as *;\n\n:host {\n display: flex;\n flex-direction: row;\n box-shadow: inset 0 -1px 0 0 cat-token('color.ui.border.default');\n}\n\n:host([hidden]) {\n display: none;\n}\n\n:host([tabs-align='center']) {\n justify-content: center;\n}\n\n:host([tabs-align='right']) {\n justify-content: end;\n}\n\n:host([tabs-align='justify']) {\n cat-button {\n flex: 1 0 auto;\n }\n}\n\n.cat-tab,\n.cat-tab-more-button {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n justify-content: space-between;\n position: relative;\n transition: none;\n\n &::after {\n opacity: 0;\n content: '';\n position: absolute;\n background: currentColor;\n left: 0.75rem;\n right: 0.75rem;\n bottom: 0;\n height: 2px;\n }\n\n &:hover::after {\n opacity: 0.25;\n }\n\n &.cat-tab-active {\n font-weight: 700;\n color: cat-token('color.theme.primary.textActive');\n }\n\n &.cat-tab-active::after {\n opacity: 1;\n }\n}\n\n.cat-tab {\n &:first-of-type {\n margin-left: -0.75rem;\n }\n\n &:last-of-type {\n margin-right: -0.75rem;\n }\n\n &.cat-tab-error {\n color: cat-token('color.theme.danger.textActive');\n }\n}\n\nnav {\n ul {\n list-style: none;\n margin: 0;\n padding: 0;\n }\n}\n\n.cat-tab-list {\n display: flex;\n width: 100%;\n}\n","import { Component, Element, Event, EventEmitter, Host, Listen, Method, Prop, State, Watch, h } from '@stencil/core';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\n\n/**\n * Tabs are used to display multiple panels to be contained within a single\n * window, using tabs as a navigational element.\n *\n * @part tab - The header of the tab.\n * @part more - An optional more button to display additional tabs.\n */\n@Component({\n tag: 'cat-tabs',\n styleUrl: 'cat-tabs.scss',\n shadow: {\n delegatesFocus: true\n }\n})\nexport class CatTabs {\n private mutationObserver?: MutationObserver;\n private moreDropdown?: HTMLCatDropdownElement;\n private moreButton?: HTMLCatButtonElement;\n private readonly resizedObserver = new ResizeObserver(() => this.adjustAdaptiveTabs());\n\n @Element() hostElement!: HTMLElement;\n\n @State() tabs: HTMLCatTabElement[] = [];\n @State() hiddenTabs: HTMLCatTabElement[] = [];\n\n /**\n * The ID of the active tab.\n */\n @Prop({ mutable: true, reflect: true }) activeTab = '';\n\n /**\n * The alignment of the tabs.\n */\n @Prop() tabsAlign: 'left' | 'center' | 'right' | 'justify' = 'left';\n\n /**\n * Whether the visible items change according to the available space. A 'More' button is used to reveal hidden items.\n */\n @Prop() adaptive = false;\n\n /**\n * Whether the active tab should always be visible. Applied when adaptive is enabled.\n * Has less priority than sticky if there is no space to show both.\n */\n @Prop() activeTabAlwaysVisible = false;\n\n componentWillLoad(): void {\n this.syncTabs();\n }\n\n componentDidLoad() {\n this.mutationObserver = new MutationObserver(\n mutations => mutations.some(value => value.target.nodeName === 'CAT-TAB') && this.syncTabs()\n );\n this.mutationObserver?.observe(this.hostElement, {\n childList: true,\n attributes: true,\n subtree: true\n });\n\n if (this.adaptive) {\n this.resizedObserver.observe(this.hostElement);\n requestAnimationFrame(() => {\n this.adjustAdaptiveTabs();\n });\n }\n }\n\n disconnectedCallback() {\n this.mutationObserver?.disconnect();\n }\n\n @Watch('activeTab')\n onActiveTabChange(id: string) {\n const index = this.tabs.findIndex(tab => tab.id === id);\n this.catChange.emit({ id, index });\n }\n\n @Listen('keydown')\n onKeydown(event: KeyboardEvent): void {\n if (['ArrowDown', 'ArrowUp', 'ArrowRight', 'ArrowLeft'].includes(event.key)) {\n const elements = this.hostElement.shadowRoot?.querySelectorAll<HTMLCatButtonElement>('cat-button[role=\"tab\"]');\n const targetElements = Array.from(elements ?? []).filter(button => !button.disabled);\n const activeElement = this.hostElement.shadowRoot?.activeElement as HTMLCatButtonElement;\n const activeIdx = activeElement ? targetElements.indexOf(activeElement) : -1;\n const activeOff = ['ArrowDown', 'ArrowRight'].includes(event.key) ? 1 : -1;\n const targetIdx = activeIdx < 0 ? 0 : (activeIdx + activeOff + targetElements.length) % targetElements.length;\n targetElements[targetIdx].doFocus();\n event.preventDefault();\n }\n }\n\n /**\n * Activates the tab with the given id.\n *\n * @param id The tab id.\n */\n @Method()\n async setActive(id: string): Promise<void> {\n this.activate(this.tabs.find(tab => tab.id === id));\n }\n\n /**\n * Activates the tab with the given index.\n *\n * @param index The tab index.\n */\n @Method()\n async setActiveIndex(index: number): Promise<void> {\n this.activate(this.tabs[index]);\n }\n\n /**\n * Recalculates visible and hidden adaptive tabs.\n */\n @Method()\n async updateAdaptiveTabs(): Promise<void> {\n if (this.adaptive) {\n this.adjustAdaptiveTabs();\n }\n }\n\n /**\n * Emitted when active tab is changed.\n */\n @Event() catChange!: EventEmitter<{ id: string; index: number }>;\n\n render() {\n this.hostElement.tabIndex = Number(this.hostElement.getAttribute('tabindex')) || 0;\n return (\n <Host>\n <div role=\"tablist\" class=\"cat-tab-list\">\n {this.tabs.map((tab: HTMLCatTabElement, index: number) => {\n return (\n <cat-button\n buttonId={tab.id}\n part=\"tab\"\n class={{\n 'cat-tab': true,\n 'cat-tab-active': tab.id === this.activeTab,\n 'cat-tab-error': tab.error,\n 'cat-tab-sticky': tab.sticky\n }}\n active={tab.id === this.activeTab}\n color={tab.error ? 'danger' : tab.id === this.activeTab ? 'primary' : 'secondary'}\n variant=\"text\"\n icon={tab.icon ? (tab.error ? '$cat:input-error' : tab.icon) : undefined}\n iconOnly={tab.iconOnly}\n iconRight={tab.iconRight}\n url={tab.url}\n disabled={tab.deactivated}\n urlTarget={tab.urlTarget}\n onCatClick={() => this.click(tab)}\n testId={tab.testId}\n nativeAttributes={{\n ...tab.nativeAttributes,\n role: 'tab',\n 'aria-selected': String(tab.id === this.activeTab),\n 'aria-setsize': String(this.tabs.length),\n 'aria-posinset': String(index + 1)\n }}\n nativeContentAttributes={{ 'data-text': tab.label }}\n data-dropdown-no-close\n >\n {tab.label}\n </cat-button>\n );\n })}\n {this.adaptive ? (\n <cat-dropdown ref={el => (this.moreDropdown = el as HTMLCatDropdownElement)}>\n <cat-button\n ref={el => (this.moreButton = el as HTMLCatButtonElement)}\n class={{\n 'cat-tab-more-button': true,\n 'cat-tab-active': !!this.hiddenTabs.find(tab => tab.id === this.activeTab)\n }}\n iconRight\n icon={this.moreDropdown?.isOpen ? 'chevron-up-outlined' : 'chevron-down-outlined'}\n slot=\"trigger\"\n part=\"more\"\n variant=\"text\"\n color={this.hiddenTabs.find(tab => tab.id === this.activeTab) ? 'primary' : 'secondary'}\n >\n {i18n.t('tabs.more')}\n </cat-button>\n <nav slot=\"content\">\n <ul>\n {this.hiddenTabs.map((tab: HTMLCatTabElement, index: number) => {\n return (\n <li>\n <cat-button\n class=\"cat-nav-item\"\n active={tab.id === this.activeTab}\n urlTarget={tab.urlTarget}\n onCatClick={() => this.click(tab)}\n testId={tab.testId}\n nativeAttributes={{\n ...tab.nativeAttributes,\n role: 'tab',\n 'aria-selected': String(tab.id === this.activeTab),\n 'aria-setsize': String(this.tabs.length),\n 'aria-posinset': String(index + 1)\n }}\n nativeContentAttributes={{ 'data-text': tab.label }}\n >\n {tab.label}\n </cat-button>\n </li>\n );\n })}\n </ul>\n </nav>\n </cat-dropdown>\n ) : null}\n </div>\n </Host>\n );\n }\n\n private adjustAdaptiveTabs() {\n const tabs = this.hostElement.shadowRoot?.querySelectorAll('.cat-tab') as NodeListOf<HTMLCatButtonElement>;\n if (!tabs?.length) {\n return;\n }\n\n // show all hidden tabs for correct calculation\n for (const tab of tabs) {\n tab.style.display = 'inline-flex';\n }\n // show hidden \"more\" button for correct calculation\n if (this.moreButton) {\n this.moreButton.style.display = 'inline-flex';\n }\n\n const MORE_WIDTH = this.moreButton?.offsetWidth || 0;\n const visibleTabsIndexes: string[] = [];\n let fittingWidth = 0;\n\n const stickyTabIndex = this.tabs.findIndex(tab => tab.sticky);\n const stickyTabWidth = tabs.item(stickyTabIndex)?.scrollWidth || 0;\n const stickyTabIsVisible = stickyTabIndex > -1 && stickyTabWidth <= this.hostElement.offsetWidth;\n\n const activeTabIndex = this.tabs.findIndex(tab => tab.id === this.activeTab);\n const activeTabWidth = tabs.item(activeTabIndex)?.scrollWidth || 0;\n const activeTabIsVisible =\n this.activeTabAlwaysVisible &&\n activeTabIndex > -1 &&\n activeTabWidth + stickyTabWidth <= this.hostElement.offsetWidth;\n\n if (stickyTabIsVisible) {\n fittingWidth += stickyTabWidth;\n visibleTabsIndexes.push(stickyTabIndex.toString());\n }\n\n if (activeTabIsVisible && stickyTabIndex !== activeTabIndex) {\n fittingWidth += activeTabWidth;\n visibleTabsIndexes.push(activeTabIndex.toString());\n }\n\n for (const [index, tab] of tabs.entries()) {\n if ((activeTabIsVisible && index === activeTabIndex) || (stickyTabIsVisible && index === stickyTabIndex)) {\n continue;\n }\n\n if (fittingWidth + tab.scrollWidth <= this.hostElement.offsetWidth) {\n // tab fits within tabs parent\n fittingWidth += tab.scrollWidth;\n visibleTabsIndexes.push(index.toString());\n } else if (fittingWidth + MORE_WIDTH <= this.hostElement.offsetWidth) {\n // tab doesn't fit, but more button does\n break;\n } else {\n // tab doesn't fit and more button doesn't fit either\n // remove last fitting tab so that more button fits\n visibleTabsIndexes.pop();\n break;\n }\n }\n\n this.hiddenTabs = this.tabs.filter((_, index) => !visibleTabsIndexes.includes(index.toString()));\n\n if (this.moreButton) {\n if (this.tabs.length > visibleTabsIndexes.length) {\n this.moreButton.style.display = 'inline-flex';\n } else {\n this.moreButton.style.display = 'none';\n }\n }\n for (const [index, tab] of tabs.entries()) {\n if (!visibleTabsIndexes.includes(index.toString())) {\n tab.style.display = 'none';\n }\n }\n }\n\n private syncTabs() {\n this.tabs = Array.from(this.hostElement.querySelectorAll('cat-tab'));\n this.activeTab = this.activeTab || this.tabs.filter(tab => this.canActivate(tab) && !tab.noActive)[0]?.id;\n this.adjustAdaptiveTabs();\n }\n\n private click(tab: HTMLCatTabElement) {\n if (this.canActivate(tab)) {\n tab.click();\n if (!tab.noActive) {\n this.activate(tab);\n }\n }\n }\n\n private activate(tab?: HTMLCatTabElement) {\n if (!tab) {\n this.activeTab = '';\n } else if (this.canActivate(tab)) {\n this.activeTab = tab.id;\n }\n this.adjustAdaptiveTabs();\n }\n\n private canActivate(tab: HTMLCatTabElement) {\n return !tab.deactivated && !tab.url && tab.id !== this.activeTab;\n }\n}\n"],"version":3}
|
|
@@ -7,7 +7,6 @@ import { d as defineCustomElement$3 } from './cat-icon2.js';
|
|
|
7
7
|
import { d as defineCustomElement$2 } from './cat-spinner2.js';
|
|
8
8
|
|
|
9
9
|
const catTagCss = ".label{overflow:hidden;word-wrap:break-word;word-break:break-word}.input-field:not(.input-horizontal) .label-container.hidden,.textarea-field:not(.textarea-horizontal) .label-container.hidden,.select-field:not(.select-horizontal) .label-container.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.label-container{flex-basis:var(--label-size, 33.33%)}.label-wrapper{display:flex;gap:0.25rem}.label-metadata{display:flex;flex-shrink:0;flex-grow:1;justify-content:space-between;gap:0.25rem;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.label-optional,.label-character-count{display:inline-flex;align-items:center;max-height:1.25rem;font-size:0.75rem;line-height:1rem}.label-character-count{margin-left:auto}.input-horizontal .label-container.hidden label,.textarea-horizontal .label-container.hidden label,.select-horizontal .label-container.hidden label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.input-horizontal .label-wrapper,.textarea-horizontal .label-wrapper,.select-horizontal .label-wrapper{flex-direction:column}.input-horizontal label,.textarea-horizontal label,.select-horizontal label{min-height:2.5rem;display:inline-flex;align-items:center}.input-horizontal .label-metadata,.textarea-horizontal .label-metadata,.select-horizontal .label-metadata{justify-content:flex-start}.input-horizontal .label-metadata .label-character-count,.textarea-horizontal .label-metadata .label-character-count,.select-horizontal .label-metadata .label-character-count{margin-left:0}.hint-wrapper{flex:0 1 auto;display:flex;gap:0.5rem}.hint-section{flex:1 1 auto;display:flex;flex-direction:column;gap:0.25rem;color:rgb(var(--cat-font-color-muted, 81, 92, 108));font-size:0.875rem;line-height:1.125rem}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){margin:0 !important}.cat-bg-primary{background-color:rgb(var(--cat-primary-bg, 0, 129, 148)) !important;color:rgb(var(--cat-primary-fill, 255, 255, 255)) !important;--cat-primary-text:var(--cat-primary-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-primary-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-primary-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-bg-primary-hover{transition:background-color 125ms, color 125ms}.cat-bg-primary-hover:hover{background-color:rgb(var(--cat-primary-bg-hover, 1, 115, 132)) !important;color:rgb(var(--cat-primary-fill-hover, 255, 255, 255)) !important;--cat-primary-text:var(--cat-primary-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-primary-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-primary-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-text-primary,.cat-link-primary{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}button.cat-text-primary,button.cat-link-primary{margin:0;padding:0;font:inherit;border:none;background:none;cursor:pointer}button.cat-link-primary:hover:not(:disabled){text-decoration:var(--cat-link-decoration-hover, underline)}button.cat-link-primary:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-link-primary,.cat-text-primary-hover{transition:color 125ms}.cat-link-primary:hover,.cat-text-primary-hover:hover{color:rgb(var(--cat-primary-text-hover, 1, 115, 132)) !important}.cat-link-primary:active,.cat-text-primary-hover:active{color:rgb(var(--cat-primary-text-active, 2, 99, 113)) !important}.cat-bg-primaryInverted{background-color:#93b4f2 !important;color:black !important;--cat-primary-text:0, 0, 0;--cat-primary-text-hover:0, 0, 0;--cat-primary-text-active:0, 0, 0;--cat-link-decoration:underline}.cat-bg-primaryInverted-hover{transition:background-color 125ms, color 125ms}.cat-bg-primaryInverted-hover:hover{background-color:#93b4f2 !important;color:black !important;--cat-primary-text:0, 0, 0;--cat-primary-text-hover:0, 0, 0;--cat-primary-text-active:0, 0, 0;--cat-link-decoration:underline}.cat-text-primaryInverted,.cat-link-primaryInverted{color:#93b4f2 !important}button.cat-text-primaryInverted,button.cat-link-primaryInverted{margin:0;padding:0;font:inherit;border:none;background:none;cursor:pointer}button.cat-link-primaryInverted:hover:not(:disabled){text-decoration:var(--cat-link-decoration-hover, underline)}button.cat-link-primaryInverted:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-link-primaryInverted,.cat-text-primaryInverted-hover{transition:color 125ms}.cat-link-primaryInverted:hover,.cat-text-primaryInverted-hover:hover{color:#93b4f2 !important}.cat-link-primaryInverted:active,.cat-text-primaryInverted-hover:active{color:#93b4f2 !important}.cat-bg-secondary{background-color:rgb(var(--cat-secondary-bg, 105, 118, 135)) !important;color:rgb(var(--cat-secondary-fill, 255, 255, 255)) !important;--cat-primary-text:var(--cat-secondary-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-secondary-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-secondary-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-bg-secondary-hover{transition:background-color 125ms, color 125ms}.cat-bg-secondary-hover:hover{background-color:rgb(var(--cat-secondary-bg-hover, 105, 118, 135)) !important;color:rgb(var(--cat-secondary-fill-hover, 255, 255, 255)) !important;--cat-primary-text:var(--cat-secondary-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-secondary-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-secondary-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-text-secondary,.cat-link-secondary{color:rgb(var(--cat-secondary-text, 0, 0, 0)) !important}button.cat-text-secondary,button.cat-link-secondary{margin:0;padding:0;font:inherit;border:none;background:none;cursor:pointer}button.cat-link-secondary:hover:not(:disabled){text-decoration:var(--cat-link-decoration-hover, underline)}button.cat-link-secondary:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-link-secondary,.cat-text-secondary-hover{transition:color 125ms}.cat-link-secondary:hover,.cat-text-secondary-hover:hover{color:rgb(var(--cat-secondary-text-hover, 0, 0, 0)) !important}.cat-link-secondary:active,.cat-text-secondary-hover:active{color:rgb(var(--cat-secondary-text-active, 0, 0, 0)) !important}.cat-bg-secondaryInverted{background-color:#697687 !important;color:black !important;--cat-primary-text:0, 0, 0;--cat-primary-text-hover:0, 0, 0;--cat-primary-text-active:0, 0, 0;--cat-link-decoration:underline}.cat-bg-secondaryInverted-hover{transition:background-color 125ms, color 125ms}.cat-bg-secondaryInverted-hover:hover{background-color:#697687 !important;color:black !important;--cat-primary-text:0, 0, 0;--cat-primary-text-hover:0, 0, 0;--cat-primary-text-active:0, 0, 0;--cat-link-decoration:underline}.cat-text-secondaryInverted,.cat-link-secondaryInverted{color:white !important}button.cat-text-secondaryInverted,button.cat-link-secondaryInverted{margin:0;padding:0;font:inherit;border:none;background:none;cursor:pointer}button.cat-link-secondaryInverted:hover:not(:disabled){text-decoration:var(--cat-link-decoration-hover, underline)}button.cat-link-secondaryInverted:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-link-secondaryInverted,.cat-text-secondaryInverted-hover{transition:color 125ms}.cat-link-secondaryInverted:hover,.cat-text-secondaryInverted-hover:hover{color:white !important}.cat-link-secondaryInverted:active,.cat-text-secondaryInverted-hover:active{color:white !important}.cat-bg-info{background-color:rgb(var(--cat-info-bg, 0, 115, 230)) !important;color:rgb(var(--cat-info-fill, 255, 255, 255)) !important;--cat-primary-text:var(--cat-info-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-info-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-info-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-bg-info-hover{transition:background-color 125ms, color 125ms}.cat-bg-info-hover:hover{background-color:rgb(var(--cat-info-bg-hover, 0, 107, 227)) !important;color:rgb(var(--cat-info-fill-hover, 255, 255, 255)) !important;--cat-primary-text:var(--cat-info-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-info-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-info-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-text-info,.cat-link-info{color:rgb(var(--cat-info-text, 0, 115, 230)) !important}button.cat-text-info,button.cat-link-info{margin:0;padding:0;font:inherit;border:none;background:none;cursor:pointer}button.cat-link-info:hover:not(:disabled){text-decoration:var(--cat-link-decoration-hover, underline)}button.cat-link-info:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-link-info,.cat-text-info-hover{transition:color 125ms}.cat-link-info:hover,.cat-text-info-hover:hover{color:rgb(var(--cat-info-text-hover, 0, 107, 227)) !important}.cat-link-info:active,.cat-text-info-hover:active{color:rgb(var(--cat-info-text-active, 0, 96, 223)) !important}.cat-bg-success{background-color:rgb(var(--cat-success-bg, 0, 132, 88)) !important;color:rgb(var(--cat-success-fill, 255, 255, 255)) !important;--cat-primary-text:var(--cat-success-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-success-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-success-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-bg-success-hover{transition:background-color 125ms, color 125ms}.cat-bg-success-hover:hover{background-color:rgb(var(--cat-success-bg-hover, 0, 117, 78)) !important;color:rgb(var(--cat-success-fill-hover, 255, 255, 255)) !important;--cat-primary-text:var(--cat-success-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-success-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-success-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-text-success,.cat-link-success{color:rgb(var(--cat-success-text, 0, 132, 88)) !important}button.cat-text-success,button.cat-link-success{margin:0;padding:0;font:inherit;border:none;background:none;cursor:pointer}button.cat-link-success:hover:not(:disabled){text-decoration:var(--cat-link-decoration-hover, underline)}button.cat-link-success:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-link-success,.cat-text-success-hover{transition:color 125ms}.cat-link-success:hover,.cat-text-success-hover:hover{color:rgb(var(--cat-success-text-hover, 0, 117, 78)) !important}.cat-link-success:active,.cat-text-success-hover:active{color:rgb(var(--cat-success-text-active, 0, 105, 70)) !important}.cat-bg-warning{background-color:rgb(var(--cat-warning-bg, 255, 206, 128)) !important;color:rgb(var(--cat-warning-fill, 0, 0, 0)) !important;--cat-primary-text:var(--cat-warning-fill, 0, 0, 0);--cat-primary-text-hover:var(--cat-warning-fill-hover, 0, 0, 0);--cat-primary-text-active:var(--cat-warning-fill-active, 0, 0, 0);--cat-link-decoration:underline}.cat-bg-warning-hover{transition:background-color 125ms, color 125ms}.cat-bg-warning-hover:hover{background-color:rgb(var(--cat-warning-bg-hover, 255, 214, 148)) !important;color:rgb(var(--cat-warning-fill-hover, 0, 0, 0)) !important;--cat-primary-text:var(--cat-warning-fill, 0, 0, 0);--cat-primary-text-hover:var(--cat-warning-fill-hover, 0, 0, 0);--cat-primary-text-active:var(--cat-warning-fill-active, 0, 0, 0);--cat-link-decoration:underline}.cat-text-warning,.cat-link-warning{color:rgb(var(--cat-warning-text, 159, 97, 0)) !important}button.cat-text-warning,button.cat-link-warning{margin:0;padding:0;font:inherit;border:none;background:none;cursor:pointer}button.cat-link-warning:hover:not(:disabled){text-decoration:var(--cat-link-decoration-hover, underline)}button.cat-link-warning:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-link-warning,.cat-text-warning-hover{transition:color 125ms}.cat-link-warning:hover,.cat-text-warning-hover:hover{color:rgb(var(--cat-warning-text-hover, 159, 97, 0)) !important}.cat-link-warning:active,.cat-text-warning-hover:active{color:rgb(var(--cat-warning-text-active, 159, 97, 0)) !important}.cat-bg-danger{background-color:rgb(var(--cat-danger-bg, 217, 52, 13)) !important;color:rgb(var(--cat-danger-fill, 255, 255, 255)) !important;--cat-primary-text:var(--cat-danger-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-danger-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-danger-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-bg-danger-hover{transition:background-color 125ms, color 125ms}.cat-bg-danger-hover:hover{background-color:rgb(var(--cat-danger-bg-hover, 194, 46, 11)) !important;color:rgb(var(--cat-danger-fill-hover, 255, 255, 255)) !important;--cat-primary-text:var(--cat-danger-fill, 255, 255, 255);--cat-primary-text-hover:var(--cat-danger-fill-hover, 255, 255, 255);--cat-primary-text-active:var(--cat-danger-fill-active, 255, 255, 255);--cat-link-decoration:underline}.cat-text-danger,.cat-link-danger{color:rgb(var(--cat-danger-text, 217, 52, 13)) !important}button.cat-text-danger,button.cat-link-danger{margin:0;padding:0;font:inherit;border:none;background:none;cursor:pointer}button.cat-link-danger:hover:not(:disabled){text-decoration:var(--cat-link-decoration-hover, underline)}button.cat-link-danger:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-link-danger,.cat-text-danger-hover{transition:color 125ms}.cat-link-danger:hover,.cat-text-danger-hover:hover{color:rgb(var(--cat-danger-text-hover, 194, 46, 11)) !important}.cat-link-danger:active,.cat-text-danger-hover:active{color:rgb(var(--cat-danger-text-active, 174, 42, 10)) !important}.cat-active{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-text-active{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-muted{color:rgb(var(--cat-font-color-muted, 81, 92, 108)) !important}.cat-text-muted{color:rgb(var(--cat-font-color-muted, 81, 92, 108)) !important}.cat-bg-muted{background-color:#f2f4f7 !important}.cat-text-reset{color:inherit !important}.cat-link-reset{color:inherit !important;text-decoration:inherit !important}:host{display:flex;flex-direction:column;gap:0.5rem}input{font:inherit;margin:0;min-width:20rem;padding:0.375rem 0;flex:1 1 auto;border:none;outline:none;background:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.input-disabled input{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}input::placeholder{color:rgb(var(--cat-font-color-muted, 81, 92, 108))}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus{-webkit-box-shadow:0 0 0 9999px #e8f0fe inset}.input-wrapper{flex:1 1 auto;display:flex;align-items:stretch;gap:0.25rem;padding:0.25rem 0.75rem;min-height:2rem;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);box-shadow:inset 0 0 0 1px rgb(var(--border-color));transition:box-shadow 125ms linear;--border-color:var(--cat-border-color-dark, 215, 219, 224);flex-wrap:wrap;}.input-wrapper.input-disabled{background:#f2f4f7;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.input-wrapper:not(.input-disabled):hover{box-shadow:inset 0 0 0 1px rgb(var(--border-color)), 0 0 0 1px rgb(var(--border-color))}.input-wrapper:focus-within{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:-1px}.input-wrapper:focus-within:has(.clearable:focus){outline:none}.input-wrapper.input-invalid{--border-color:var(--cat-danger-bg, 217, 52, 13), 0.2}.input-wrapper:has(input:-webkit-autofill),.input-wrapper:has(input:-webkit-autofill):hover,.input-wrapper:has(input:-webkit-autofill):focus{background-color:#e8f0fe}.tag-pill{display:flex;align-items:center;gap:0.5rem;padding:0.25rem 0.5rem;background:#f2f4f7;border-radius:var(--cat-border-radius-s, 0.125rem);white-space:nowrap;min-width:0}.tag-pill>span{overflow:hidden;text-overflow:ellipsis;flex:1 1 0}.tag-pill>cat-button{margin-right:-0.25rem;margin-left:-0.25rem}.icon-suffix{align-self:center}.input-inner-wrapper{flex:1 1 auto;display:flex}";
|
|
10
|
-
const CatTagStyle0 = catTagCss;
|
|
11
10
|
|
|
12
11
|
let nextUniqueId = 0;
|
|
13
12
|
const CatTag$1 = /*@__PURE__*/ proxyCustomElement(class CatTag extends HTMLElement {
|
|
@@ -22,23 +21,45 @@ const CatTag$1 = /*@__PURE__*/ proxyCustomElement(class CatTag extends HTMLEleme
|
|
|
22
21
|
this.hasSlottedLabel = false;
|
|
23
22
|
this.hasSlottedHint = false;
|
|
24
23
|
this.tags = [];
|
|
25
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Whether the label need a marker to shown if the select is required or optional.
|
|
26
|
+
*/
|
|
26
27
|
this.requiredMarker = 'optional';
|
|
28
|
+
/**
|
|
29
|
+
* Whether the select is disabled.
|
|
30
|
+
*/
|
|
27
31
|
this.disabled = false;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
/**
|
|
33
|
+
* The label for the select.
|
|
34
|
+
*/
|
|
31
35
|
this.label = '';
|
|
32
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Visually hide the label, but still show it to assistive technologies like screen readers.
|
|
38
|
+
*/
|
|
33
39
|
this.labelHidden = false;
|
|
40
|
+
/**
|
|
41
|
+
* A value is required or must be checked for the form to be submittable.
|
|
42
|
+
*/
|
|
34
43
|
this.required = false;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Whether the input should show a clear button.
|
|
46
|
+
*/
|
|
38
47
|
this.clearable = false;
|
|
39
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Fine-grained control over when the errors are shown. Can be `false` to
|
|
50
|
+
* never show errors, `true` to show errors on blur, or a number to show
|
|
51
|
+
* errors change with the given delay in milliseconds or immediately on blur.
|
|
52
|
+
*/
|
|
40
53
|
this.errorUpdate = 0;
|
|
54
|
+
/**
|
|
55
|
+
* List of characters that should create a new tag. This need to be comparable to `keydownEvent.key`.
|
|
56
|
+
* Pasted values will also be split by those chars.
|
|
57
|
+
* Defaults to `[' ']`.
|
|
58
|
+
*/
|
|
41
59
|
this.tagCreationChars = [' '];
|
|
60
|
+
/**
|
|
61
|
+
* Whether new tag is added when the input is blurred.
|
|
62
|
+
*/
|
|
42
63
|
this.addOnBlur = false;
|
|
43
64
|
}
|
|
44
65
|
get id() {
|
|
@@ -158,7 +179,7 @@ const CatTag$1 = /*@__PURE__*/ proxyCustomElement(class CatTag extends HTMLEleme
|
|
|
158
179
|
static get watchers() { return {
|
|
159
180
|
"errors": ["onErrorsChanged"]
|
|
160
181
|
}; }
|
|
161
|
-
static get style() { return
|
|
182
|
+
static get style() { return catTagCss; }
|
|
162
183
|
}, [17, "cat-tag", {
|
|
163
184
|
"requiredMarker": [1, "required-marker"],
|
|
164
185
|
"disabled": [4],
|
|
@@ -169,13 +190,13 @@ const CatTag$1 = /*@__PURE__*/ proxyCustomElement(class CatTag extends HTMLEleme
|
|
|
169
190
|
"name": [1],
|
|
170
191
|
"labelHidden": [4, "label-hidden"],
|
|
171
192
|
"required": [4],
|
|
172
|
-
"nativeAttributes": [16],
|
|
193
|
+
"nativeAttributes": [16, "native-attributes"],
|
|
173
194
|
"testId": [1, "test-id"],
|
|
174
195
|
"value": [1040],
|
|
175
196
|
"clearable": [4],
|
|
176
197
|
"errors": [4],
|
|
177
198
|
"errorUpdate": [8, "error-update"],
|
|
178
|
-
"tagCreationChars": [16],
|
|
199
|
+
"tagCreationChars": [16, "tag-creation-chars"],
|
|
179
200
|
"addOnBlur": [4, "add-on-blur"],
|
|
180
201
|
"hasSlottedLabel": [32],
|
|
181
202
|
"hasSlottedHint": [32],
|
|
@@ -217,5 +238,6 @@ const CatTag = CatTag$1;
|
|
|
217
238
|
const defineCustomElement = defineCustomElement$1;
|
|
218
239
|
|
|
219
240
|
export { CatTag, defineCustomElement };
|
|
241
|
+
//# sourceMappingURL=cat-tag.js.map
|
|
220
242
|
|
|
221
243
|
//# sourceMappingURL=cat-tag.js.map
|