@haiilo/catalyst 8.1.0 → 8.2.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.css +4 -9
- 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/{p-85d057f0.js → p-6ae13953.js} +1 -1
- package/dist/catalyst/p-6cd4fa1e.js +3 -0
- package/dist/catalyst/p-6cd4fa1e.js.map +1 -0
- package/dist/catalyst/p-a05fbea3.entry.js +10 -0
- package/dist/catalyst/p-a05fbea3.entry.js.map +1 -0
- package/dist/catalyst/scss/core/_dialog.scss +1 -1
- package/dist/catalyst/scss/core/_form.scss +2 -1
- package/dist/catalyst/scss/core/_typography.scss +1 -7
- package/dist/cjs/cat-alert_26.cjs.entry.js +3899 -3883
- package/dist/cjs/cat-alert_26.cjs.entry.js.map +1 -1
- package/dist/cjs/catalyst.cjs.js +3 -3
- package/dist/cjs/catalyst.cjs.js.map +1 -1
- package/dist/cjs/{index-1e7eef7e.js → index-eb056d5e.js} +51 -13
- package/dist/cjs/index-eb056d5e.js.map +1 -0
- package/dist/cjs/index.cjs.js +73 -73
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{of-395b2f57.js → of-2b7161d2.js} +155 -155
- package/dist/cjs/of-2b7161d2.js.map +1 -0
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/cat-alert/cat-alert.e2e.js +7 -7
- package/dist/collection/components/cat-alert/cat-alert.e2e.js.map +1 -1
- package/dist/collection/components/cat-alert/cat-alert.js +98 -98
- package/dist/collection/components/cat-alert/cat-alert.js.map +1 -1
- package/dist/collection/components/cat-alert/cat-alert.spec.js +7 -7
- package/dist/collection/components/cat-alert/cat-alert.spec.js.map +1 -1
- package/dist/collection/components/cat-avatar/cat-avatar.e2e.js +6 -6
- package/dist/collection/components/cat-avatar/cat-avatar.e2e.js.map +1 -1
- package/dist/collection/components/cat-avatar/cat-avatar.js +218 -218
- package/dist/collection/components/cat-avatar/cat-avatar.js.map +1 -1
- package/dist/collection/components/cat-avatar/cat-avatar.spec.js +7 -7
- package/dist/collection/components/cat-avatar/cat-avatar.spec.js.map +1 -1
- package/dist/collection/components/cat-badge/cat-badge.e2e.js +6 -6
- package/dist/collection/components/cat-badge/cat-badge.e2e.js.map +1 -1
- package/dist/collection/components/cat-badge/cat-badge.js +117 -117
- package/dist/collection/components/cat-badge/cat-badge.js.map +1 -1
- package/dist/collection/components/cat-badge/cat-badge.spec.js +7 -7
- package/dist/collection/components/cat-badge/cat-badge.spec.js.map +1 -1
- package/dist/collection/components/cat-button/cat-button.css +2 -1
- package/dist/collection/components/cat-button/cat-button.e2e.js +6 -6
- package/dist/collection/components/cat-button/cat-button.e2e.js.map +1 -1
- package/dist/collection/components/cat-button/cat-button.js +693 -693
- package/dist/collection/components/cat-button/cat-button.js.map +1 -1
- package/dist/collection/components/cat-button/cat-button.spec.js +7 -7
- package/dist/collection/components/cat-button/cat-button.spec.js.map +1 -1
- package/dist/collection/components/cat-button-group/cat-button-group.e2e.js +6 -6
- package/dist/collection/components/cat-button-group/cat-button-group.e2e.js.map +1 -1
- package/dist/collection/components/cat-button-group/cat-button-group.js +47 -47
- package/dist/collection/components/cat-button-group/cat-button-group.js.map +1 -1
- package/dist/collection/components/cat-button-group/cat-button-group.spec.js +7 -7
- package/dist/collection/components/cat-button-group/cat-button-group.spec.js.map +1 -1
- package/dist/collection/components/cat-card/cat-card.e2e.js +6 -6
- package/dist/collection/components/cat-card/cat-card.e2e.js.map +1 -1
- package/dist/collection/components/cat-card/cat-card.js +15 -15
- package/dist/collection/components/cat-card/cat-card.js.map +1 -1
- package/dist/collection/components/cat-card/cat-card.spec.js +7 -7
- package/dist/collection/components/cat-card/cat-card.spec.js.map +1 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.css +2 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.e2e.js +6 -6
- package/dist/collection/components/cat-checkbox/cat-checkbox.e2e.js.map +1 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.js +441 -441
- package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.spec.js +7 -7
- package/dist/collection/components/cat-checkbox/cat-checkbox.spec.js.map +1 -1
- package/dist/collection/components/cat-datepicker/cat-datepicker.config.js +62 -62
- package/dist/collection/components/cat-datepicker/cat-datepicker.config.js.map +1 -1
- package/dist/collection/components/cat-datepicker/cat-datepicker.e2e.js +7 -7
- package/dist/collection/components/cat-datepicker/cat-datepicker.e2e.js.map +1 -1
- package/dist/collection/components/cat-datepicker/cat-datepicker.format.js +20 -20
- package/dist/collection/components/cat-datepicker/cat-datepicker.format.js.map +1 -1
- package/dist/collection/components/cat-datepicker/cat-datepicker.js +720 -707
- package/dist/collection/components/cat-datepicker/cat-datepicker.js.map +1 -1
- package/dist/collection/components/cat-datepicker/cat-datepicker.locale.js +39 -39
- package/dist/collection/components/cat-datepicker/cat-datepicker.locale.js.map +1 -1
- package/dist/collection/components/cat-datepicker/cat-datepicker.spec.js +7 -7
- package/dist/collection/components/cat-datepicker/cat-datepicker.spec.js.map +1 -1
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.e2e.js +7 -7
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.e2e.js.map +1 -1
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js +244 -244
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js.map +1 -1
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.spec.js +7 -7
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.spec.js.map +1 -1
- package/dist/collection/components/cat-dropdown/cat-dropdown.e2e.js +6 -6
- package/dist/collection/components/cat-dropdown/cat-dropdown.e2e.js.map +1 -1
- package/dist/collection/components/cat-dropdown/cat-dropdown.js +300 -300
- package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
- package/dist/collection/components/cat-dropdown/cat-dropdown.spec.js +7 -7
- package/dist/collection/components/cat-dropdown/cat-dropdown.spec.js.map +1 -1
- package/dist/collection/components/cat-form-group/cat-form-group.e2e.js +6 -6
- package/dist/collection/components/cat-form-group/cat-form-group.e2e.js.map +1 -1
- package/dist/collection/components/cat-form-group/cat-form-group.js +107 -107
- package/dist/collection/components/cat-form-group/cat-form-group.js.map +1 -1
- package/dist/collection/components/cat-form-group/cat-form-group.spec.js +7 -7
- package/dist/collection/components/cat-form-group/cat-form-group.spec.js.map +1 -1
- package/dist/collection/components/cat-form-hint/cat-form-hint.js +9 -9
- package/dist/collection/components/cat-form-hint/cat-form-hint.js.map +1 -1
- package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js +7 -7
- package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js.map +1 -1
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js +71 -71
- package/dist/collection/components/cat-i18n/cat-i18n-registry.js.map +1 -1
- package/dist/collection/components/cat-i18n/cat-i18n-registry.spec.js +3 -3
- package/dist/collection/components/cat-i18n/cat-i18n-registry.spec.js.map +1 -1
- package/dist/collection/components/cat-icon/cat-icon-registry.js +77 -77
- package/dist/collection/components/cat-icon/cat-icon-registry.js.map +1 -1
- package/dist/collection/components/cat-icon/cat-icon-registry.spec.js +3 -3
- package/dist/collection/components/cat-icon/cat-icon-registry.spec.js.map +1 -1
- package/dist/collection/components/cat-icon/cat-icon.e2e.js +7 -7
- package/dist/collection/components/cat-icon/cat-icon.e2e.js.map +1 -1
- package/dist/collection/components/cat-icon/cat-icon.js +97 -97
- package/dist/collection/components/cat-icon/cat-icon.js.map +1 -1
- package/dist/collection/components/cat-icon/cat-icon.spec.js +7 -7
- package/dist/collection/components/cat-icon/cat-icon.spec.js.map +1 -1
- package/dist/collection/components/cat-input/cat-input.e2e.js +7 -7
- package/dist/collection/components/cat-input/cat-input.e2e.js.map +1 -1
- package/dist/collection/components/cat-input/cat-input.js +768 -768
- package/dist/collection/components/cat-input/cat-input.js.map +1 -1
- package/dist/collection/components/cat-input/cat-input.spec.js +7 -7
- package/dist/collection/components/cat-input/cat-input.spec.js.map +1 -1
- package/dist/collection/components/cat-notification/cat-notification.js +59 -59
- package/dist/collection/components/cat-notification/cat-notification.js.map +1 -1
- package/dist/collection/components/cat-notification/cat-notification.spec.js +3 -3
- package/dist/collection/components/cat-notification/cat-notification.spec.js.map +1 -1
- package/dist/collection/components/cat-pagination/cat-pagination.e2e.js +10 -10
- package/dist/collection/components/cat-pagination/cat-pagination.e2e.js.map +1 -1
- package/dist/collection/components/cat-pagination/cat-pagination.js +274 -274
- package/dist/collection/components/cat-pagination/cat-pagination.js.map +1 -1
- package/dist/collection/components/cat-pagination/cat-pagination.spec.js +7 -7
- package/dist/collection/components/cat-pagination/cat-pagination.spec.js.map +1 -1
- package/dist/collection/components/cat-radio/cat-radio.e2e.js +6 -6
- package/dist/collection/components/cat-radio/cat-radio.e2e.js.map +1 -1
- package/dist/collection/components/cat-radio/cat-radio.js +378 -378
- package/dist/collection/components/cat-radio/cat-radio.js.map +1 -1
- package/dist/collection/components/cat-radio/cat-radio.spec.js +7 -7
- package/dist/collection/components/cat-radio/cat-radio.spec.js.map +1 -1
- package/dist/collection/components/cat-radio-group/cat-radio-group.e2e.js +6 -6
- package/dist/collection/components/cat-radio-group/cat-radio-group.e2e.js.map +1 -1
- package/dist/collection/components/cat-radio-group/cat-radio-group.js +278 -278
- package/dist/collection/components/cat-radio-group/cat-radio-group.js.map +1 -1
- package/dist/collection/components/cat-radio-group/cat-radio-group.spec.js +7 -7
- package/dist/collection/components/cat-radio-group/cat-radio-group.spec.js.map +1 -1
- package/dist/collection/components/cat-scrollable/cat-scrollable.e2e.js +6 -6
- package/dist/collection/components/cat-scrollable/cat-scrollable.e2e.js.map +1 -1
- package/dist/collection/components/cat-scrollable/cat-scrollable.js +287 -287
- package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -1
- package/dist/collection/components/cat-scrollable/cat-scrollable.spec.js +7 -7
- package/dist/collection/components/cat-scrollable/cat-scrollable.spec.js.map +1 -1
- package/dist/collection/components/cat-select/cat-select.e2e.js +10 -10
- package/dist/collection/components/cat-select/cat-select.e2e.js.map +1 -1
- package/dist/collection/components/cat-select/cat-select.js +1143 -1143
- package/dist/collection/components/cat-select/cat-select.js.map +1 -1
- package/dist/collection/components/cat-select/cat-select.spec.js +7 -7
- package/dist/collection/components/cat-select/cat-select.spec.js.map +1 -1
- package/dist/collection/components/cat-select/connectors.js +13 -13
- package/dist/collection/components/cat-select/connectors.js.map +1 -1
- package/dist/collection/components/cat-select-demo/cat-select-demo.js +1379 -1379
- package/dist/collection/components/cat-select-demo/cat-select-demo.js.map +1 -1
- package/dist/collection/components/cat-skeleton/cat-skeleton.e2e.js +6 -6
- package/dist/collection/components/cat-skeleton/cat-skeleton.e2e.js.map +1 -1
- package/dist/collection/components/cat-skeleton/cat-skeleton.js +120 -120
- package/dist/collection/components/cat-skeleton/cat-skeleton.js.map +1 -1
- package/dist/collection/components/cat-skeleton/cat-skeleton.spec.js +7 -7
- package/dist/collection/components/cat-skeleton/cat-skeleton.spec.js.map +1 -1
- package/dist/collection/components/cat-spinner/cat-spinner.e2e.js +6 -6
- package/dist/collection/components/cat-spinner/cat-spinner.e2e.js.map +1 -1
- package/dist/collection/components/cat-spinner/cat-spinner.js +60 -60
- package/dist/collection/components/cat-spinner/cat-spinner.js.map +1 -1
- package/dist/collection/components/cat-spinner/cat-spinner.spec.js +7 -7
- package/dist/collection/components/cat-spinner/cat-spinner.spec.js.map +1 -1
- package/dist/collection/components/cat-tab/cat-tab.e2e.js +6 -6
- package/dist/collection/components/cat-tab/cat-tab.e2e.js.map +1 -1
- package/dist/collection/components/cat-tab/cat-tab.js +230 -211
- package/dist/collection/components/cat-tab/cat-tab.js.map +1 -1
- package/dist/collection/components/cat-tab/cat-tab.spec.js +7 -7
- package/dist/collection/components/cat-tab/cat-tab.spec.js.map +1 -1
- package/dist/collection/components/cat-tabs/cat-tabs.css +3 -0
- package/dist/collection/components/cat-tabs/cat-tabs.e2e.js +6 -6
- package/dist/collection/components/cat-tabs/cat-tabs.e2e.js.map +1 -1
- package/dist/collection/components/cat-tabs/cat-tabs.js +222 -215
- package/dist/collection/components/cat-tabs/cat-tabs.js.map +1 -1
- package/dist/collection/components/cat-tabs/cat-tabs.spec.js +7 -7
- package/dist/collection/components/cat-tabs/cat-tabs.spec.js.map +1 -1
- package/dist/collection/components/cat-textarea/cat-textarea.e2e.js +7 -7
- package/dist/collection/components/cat-textarea/cat-textarea.e2e.js.map +1 -1
- package/dist/collection/components/cat-textarea/cat-textarea.js +586 -586
- package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
- package/dist/collection/components/cat-textarea/cat-textarea.spec.js +7 -7
- package/dist/collection/components/cat-textarea/cat-textarea.spec.js.map +1 -1
- package/dist/collection/components/cat-toggle/cat-toggle.e2e.js +6 -6
- package/dist/collection/components/cat-toggle/cat-toggle.e2e.js.map +1 -1
- package/dist/collection/components/cat-toggle/cat-toggle.js +421 -421
- package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
- package/dist/collection/components/cat-toggle/cat-toggle.spec.js +7 -7
- package/dist/collection/components/cat-toggle/cat-toggle.spec.js.map +1 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.css +3 -0
- package/dist/collection/components/cat-tooltip/cat-tooltip.e2e.js +6 -6
- package/dist/collection/components/cat-tooltip/cat-tooltip.e2e.js.map +1 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.js +297 -296
- package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -1
- package/dist/collection/components/cat-tooltip/cat-tooltip.spec.js +12 -8
- package/dist/collection/components/cat-tooltip/cat-tooltip.spec.js.map +1 -1
- package/dist/collection/scss/core/_dialog.scss +1 -1
- package/dist/collection/scss/core/_form.scss +2 -1
- package/dist/collection/scss/core/_typography.scss +1 -7
- package/dist/collection/utils/breakpoints.js +6 -6
- package/dist/collection/utils/breakpoints.js.map +1 -1
- package/dist/collection/utils/coerce.js +3 -3
- package/dist/collection/utils/coerce.js.map +1 -1
- package/dist/collection/utils/find-closest.js +6 -6
- package/dist/collection/utils/find-closest.js.map +1 -1
- package/dist/collection/utils/first-tabbable.js +1 -1
- package/dist/collection/utils/first-tabbable.js.map +1 -1
- package/dist/collection/utils/load-img.js +6 -6
- package/dist/collection/utils/load-img.js.map +1 -1
- package/dist/collection/utils/media-matcher.js +30 -30
- package/dist/collection/utils/media-matcher.js.map +1 -1
- package/dist/collection/utils/media-matcher.spec.js +32 -32
- package/dist/collection/utils/media-matcher.spec.js.map +1 -1
- package/dist/collection/utils/platform.js +34 -34
- package/dist/collection/utils/platform.js.map +1 -1
- package/dist/collection/utils/setDefault.js +4 -4
- package/dist/collection/utils/setDefault.js.map +1 -1
- package/dist/components/cat-alert.d.ts +2 -2
- package/dist/components/cat-alert.js +56 -56
- package/dist/components/cat-alert.js.map +1 -1
- package/dist/components/cat-avatar.d.ts +2 -2
- package/dist/components/cat-avatar2.js +93 -93
- package/dist/components/cat-avatar2.js.map +1 -1
- package/dist/components/cat-badge.d.ts +2 -2
- package/dist/components/cat-badge.js +32 -32
- package/dist/components/cat-badge.js.map +1 -1
- package/dist/components/cat-button-group.d.ts +2 -2
- package/dist/components/cat-button-group.js +31 -31
- package/dist/components/cat-button-group.js.map +1 -1
- package/dist/components/cat-button.d.ts +2 -2
- package/dist/components/cat-button2.js +277 -277
- package/dist/components/cat-button2.js.map +1 -1
- package/dist/components/cat-card.d.ts +2 -2
- package/dist/components/cat-card.js +20 -20
- package/dist/components/cat-card.js.map +1 -1
- package/dist/components/cat-checkbox.d.ts +2 -2
- package/dist/components/cat-checkbox2.js +108 -108
- package/dist/components/cat-checkbox2.js.map +1 -1
- package/dist/components/cat-datepicker-inline.d.ts +2 -2
- package/dist/components/cat-datepicker-inline.js +89 -89
- package/dist/components/cat-datepicker-inline.js.map +1 -1
- package/dist/components/cat-datepicker.d.ts +2 -2
- package/dist/components/cat-datepicker.js +203 -194
- package/dist/components/cat-datepicker.js.map +1 -1
- package/dist/components/cat-datepicker.locale.js +121 -121
- package/dist/components/cat-datepicker.locale.js.map +1 -1
- package/dist/components/cat-dropdown.d.ts +2 -2
- package/dist/components/cat-dropdown2.js +177 -177
- package/dist/components/cat-dropdown2.js.map +1 -1
- package/dist/components/cat-form-group.d.ts +2 -2
- package/dist/components/cat-form-group.js +55 -55
- package/dist/components/cat-form-group.js.map +1 -1
- package/dist/components/cat-form-hint.js +9 -9
- package/dist/components/cat-form-hint.js.map +1 -1
- package/dist/components/cat-i18n-registry.js +71 -71
- package/dist/components/cat-i18n-registry.js.map +1 -1
- package/dist/components/cat-icon-registry.js +77 -77
- package/dist/components/cat-icon-registry.js.map +1 -1
- package/dist/components/cat-icon.d.ts +2 -2
- package/dist/components/cat-icon2.js +32 -32
- package/dist/components/cat-icon2.js.map +1 -1
- package/dist/components/cat-input.d.ts +2 -2
- package/dist/components/cat-input2.js +219 -219
- package/dist/components/cat-input2.js.map +1 -1
- package/dist/components/cat-pagination.d.ts +2 -2
- package/dist/components/cat-pagination.js +103 -103
- package/dist/components/cat-pagination.js.map +1 -1
- package/dist/components/cat-radio-group.d.ts +2 -2
- package/dist/components/cat-radio-group.js +113 -113
- package/dist/components/cat-radio-group.js.map +1 -1
- package/dist/components/cat-radio.d.ts +2 -2
- package/dist/components/cat-radio.js +93 -93
- package/dist/components/cat-radio.js.map +1 -1
- package/dist/components/cat-scrollable.d.ts +2 -2
- package/dist/components/cat-scrollable2.js +118 -118
- package/dist/components/cat-scrollable2.js.map +1 -1
- package/dist/components/cat-select-demo.d.ts +2 -2
- package/dist/components/cat-select-demo.js +1438 -1438
- package/dist/components/cat-select-demo.js.map +1 -1
- package/dist/components/cat-select.d.ts +2 -2
- package/dist/components/cat-select2.js +666 -666
- package/dist/components/cat-select2.js.map +1 -1
- package/dist/components/cat-skeleton.d.ts +2 -2
- package/dist/components/cat-skeleton2.js +53 -53
- package/dist/components/cat-skeleton2.js.map +1 -1
- package/dist/components/cat-spinner.d.ts +2 -2
- package/dist/components/cat-spinner2.js +27 -27
- package/dist/components/cat-spinner2.js.map +1 -1
- package/dist/components/cat-tab.d.ts +2 -2
- package/dist/components/cat-tab.js +48 -46
- package/dist/components/cat-tab.js.map +1 -1
- package/dist/components/cat-tabs.d.ts +2 -2
- package/dist/components/cat-tabs.js +120 -113
- package/dist/components/cat-tabs.js.map +1 -1
- package/dist/components/cat-textarea.d.ts +2 -2
- package/dist/components/cat-textarea.js +178 -178
- package/dist/components/cat-textarea.js.map +1 -1
- package/dist/components/cat-toggle.d.ts +2 -2
- package/dist/components/cat-toggle.js +104 -104
- package/dist/components/cat-toggle.js.map +1 -1
- package/dist/components/cat-tooltip.d.ts +2 -2
- package/dist/components/cat-tooltip.js +144 -143
- package/dist/components/cat-tooltip.js.map +1 -1
- package/dist/components/coerce.js +3 -3
- package/dist/components/coerce.js.map +1 -1
- package/dist/components/index.js +72 -72
- package/dist/components/index.js.map +1 -1
- package/dist/esm/cat-alert_26.entry.js +3899 -3883
- package/dist/esm/cat-alert_26.entry.js.map +1 -1
- package/dist/esm/catalyst.js +4 -4
- package/dist/esm/catalyst.js.map +1 -1
- package/dist/esm/{index-30a221a3.js → index-acddba36.js} +51 -13
- package/dist/esm/index-acddba36.js.map +1 -0
- package/dist/esm/index.js +74 -74
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{of-04d3d9e1.js → of-4f92b30b.js} +155 -155
- package/dist/esm/of-4f92b30b.js.map +1 -0
- package/dist/types/components/cat-alert/cat-alert.d.ts +17 -17
- package/dist/types/components/cat-avatar/cat-avatar.d.ts +41 -41
- package/dist/types/components/cat-badge/cat-badge.d.ts +22 -22
- package/dist/types/components/cat-button/cat-button.d.ts +151 -151
- package/dist/types/components/cat-button-group/cat-button-group.d.ts +9 -9
- package/dist/types/components/cat-card/cat-card.d.ts +1 -1
- package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +97 -97
- package/dist/types/components/cat-datepicker/cat-datepicker.config.d.ts +12 -12
- package/dist/types/components/cat-datepicker/cat-datepicker.d.ts +153 -149
- package/dist/types/components/cat-datepicker-inline/cat-datepicker-inline.d.ts +45 -45
- package/dist/types/components/cat-dropdown/cat-dropdown.d.ts +49 -49
- package/dist/types/components/cat-form-group/cat-form-group.d.ts +23 -23
- package/dist/types/components/cat-form-hint/cat-form-hint.d.ts +6 -6
- package/dist/types/components/cat-i18n/cat-i18n-registry.d.ts +17 -17
- package/dist/types/components/cat-icon/cat-icon-registry.d.ts +12 -12
- package/dist/types/components/cat-icon/cat-icon.d.ts +18 -18
- package/dist/types/components/cat-input/cat-input.d.ts +167 -167
- package/dist/types/components/cat-notification/cat-notification.d.ts +31 -31
- package/dist/types/components/cat-pagination/cat-pagination.d.ts +52 -52
- package/dist/types/components/cat-radio/cat-radio.d.ts +83 -83
- package/dist/types/components/cat-radio-group/cat-radio-group.d.ts +49 -49
- package/dist/types/components/cat-scrollable/cat-scrollable.d.ts +49 -49
- package/dist/types/components/cat-select/cat-select.d.ts +221 -221
- package/dist/types/components/cat-select/connectors.d.ts +5 -5
- package/dist/types/components/cat-select-demo/cat-select-demo.d.ts +11 -11
- package/dist/types/components/cat-skeleton/cat-skeleton.d.ts +23 -23
- package/dist/types/components/cat-spinner/cat-spinner.d.ts +10 -10
- package/dist/types/components/cat-tab/cat-tab.d.ts +48 -42
- package/dist/types/components/cat-tabs/cat-tabs.d.ts +40 -39
- package/dist/types/components/cat-textarea/cat-textarea.d.ts +131 -131
- package/dist/types/components/cat-toggle/cat-toggle.d.ts +93 -93
- package/dist/types/components/cat-tooltip/cat-tooltip.d.ts +64 -64
- package/dist/types/components.d.ts +10 -2
- package/dist/types/stencil-public-runtime.d.ts +8 -0
- package/dist/types/utils/breakpoints.d.ts +1 -1
- package/dist/types/utils/media-matcher.d.ts +10 -10
- package/dist/types/utils/platform.d.ts +16 -16
- package/dist/types/utils/setDefault.d.ts +2 -2
- package/package.json +18 -18
- package/dist/catalyst/p-1bd44896.js +0 -3
- package/dist/catalyst/p-1bd44896.js.map +0 -1
- package/dist/catalyst/p-dc953306.entry.js +0 -10
- package/dist/catalyst/p-dc953306.entry.js.map +0 -1
- package/dist/cjs/index-1e7eef7e.js.map +0 -1
- package/dist/cjs/of-395b2f57.js.map +0 -1
- package/dist/esm/index-30a221a3.js.map +0 -1
- package/dist/esm/of-04d3d9e1.js.map +0 -1
- /package/dist/catalyst/{p-85d057f0.js.map → p-6ae13953.js.map} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { newE2EPage } from "@stencil/core/testing";
|
|
2
2
|
describe('cat-scrollable', () => {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
it('renders', async () => {
|
|
4
|
+
const page = await newE2EPage();
|
|
5
|
+
await page.setContent('<cat-scrollable></cat-scrollable>');
|
|
6
|
+
const element = await page.find('cat-scrollable');
|
|
7
|
+
expect(element).toHaveClass('hydrated');
|
|
8
|
+
});
|
|
9
9
|
});
|
|
10
10
|
//# sourceMappingURL=cat-scrollable.e2e.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cat-scrollable.e2e.js","sourceRoot":"","sources":["../../../src/components/cat-scrollable/cat-scrollable.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;
|
|
1
|
+
{"version":3,"file":"cat-scrollable.e2e.js","sourceRoot":"","sources":["../../../src/components/cat-scrollable/cat-scrollable.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,CAAC,UAAU,CAAC,mCAAmC,CAAC,CAAC;QAE3D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAClD,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from '@stencil/core/testing';\n\ndescribe('cat-scrollable', () => {\n it('renders', async () => {\n const page = await newE2EPage();\n await page.setContent('<cat-scrollable></cat-scrollable>');\n\n const element = await page.find('cat-scrollable');\n expect(element).toHaveClass('hydrated');\n });\n});\n"]}
|
|
@@ -5,302 +5,302 @@ import { auditTime, distinctUntilChanged, filter, map, takeUntil } from "rxjs/op
|
|
|
5
5
|
* An element to display scrollable content.
|
|
6
6
|
*/
|
|
7
7
|
export class CatScrollable {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
componentDidRender() {
|
|
22
|
-
if (this.scrollElement) {
|
|
23
|
-
this.scrolled = fromEvent(this.scrollElement, 'scroll').pipe(takeUntil(this.destroyed));
|
|
24
|
-
this.resizedObserver.observe(this.scrollElement);
|
|
8
|
+
constructor() {
|
|
9
|
+
this.init = new Subject();
|
|
10
|
+
this.destroyed = new Subject();
|
|
11
|
+
this.resizedEntries = new Subject();
|
|
12
|
+
this.resizedObserver = new ResizeObserver(entries => this.resizedEntries.next(entries));
|
|
13
|
+
this.noShadowX = false;
|
|
14
|
+
this.noShadowY = false;
|
|
15
|
+
this.noOverflowX = false;
|
|
16
|
+
this.noOverflowY = false;
|
|
17
|
+
this.noOverscroll = false;
|
|
18
|
+
this.noScrolledInit = false;
|
|
19
|
+
this.scrolledBuffer = 0;
|
|
25
20
|
}
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
componentDidRender() {
|
|
22
|
+
if (this.scrollElement) {
|
|
23
|
+
this.scrolled = fromEvent(this.scrollElement, 'scroll').pipe(takeUntil(this.destroyed));
|
|
24
|
+
this.resizedObserver.observe(this.scrollElement);
|
|
25
|
+
}
|
|
26
|
+
if (this.scrollWrapperElement) {
|
|
27
|
+
this.resizedObserver.observe(this.scrollWrapperElement);
|
|
28
|
+
}
|
|
29
|
+
this.attachEmitter('left', this.scrolledLeft);
|
|
30
|
+
this.attachEmitter('right', this.scrolledRight);
|
|
31
|
+
this.attachEmitter('bottom', this.scrolledBottom);
|
|
32
|
+
this.attachEmitter('top', this.scrolledTop);
|
|
33
|
+
merge(this.init, this.scrolled, this.resizedEntries)
|
|
34
|
+
.pipe(auditTime(CatScrollable.THROTTLE), map(() => ({
|
|
35
|
+
top: this.getScrollOffset('top') > 0,
|
|
36
|
+
left: this.getScrollOffset('left') > 0,
|
|
37
|
+
right: this.getScrollOffset('right') > 0,
|
|
38
|
+
bottom: this.getScrollOffset('bottom') > 0
|
|
39
|
+
})), distinctUntilChanged(), takeUntil(this.destroyed))
|
|
40
|
+
.subscribe(({ top, left, right, bottom }) => {
|
|
41
|
+
this.toggleClass('cat-scrollable-top', top);
|
|
42
|
+
this.toggleClass('cat-scrollable-left', left);
|
|
43
|
+
this.toggleClass('cat-scrollable-right', right);
|
|
44
|
+
this.toggleClass('cat-scrollable-bottom', bottom);
|
|
45
|
+
});
|
|
28
46
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
merge(this.init, this.scrolled, this.resizedEntries)
|
|
34
|
-
.pipe(auditTime(CatScrollable.THROTTLE), map(() => ({
|
|
35
|
-
top: this.getScrollOffset('top') > 0,
|
|
36
|
-
left: this.getScrollOffset('left') > 0,
|
|
37
|
-
right: this.getScrollOffset('right') > 0,
|
|
38
|
-
bottom: this.getScrollOffset('bottom') > 0
|
|
39
|
-
})), distinctUntilChanged(), takeUntil(this.destroyed))
|
|
40
|
-
.subscribe(({ top, left, right, bottom }) => {
|
|
41
|
-
this.toggleClass('cat-scrollable-top', top);
|
|
42
|
-
this.toggleClass('cat-scrollable-left', left);
|
|
43
|
-
this.toggleClass('cat-scrollable-right', right);
|
|
44
|
-
this.toggleClass('cat-scrollable-bottom', bottom);
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
componentDidLoad() {
|
|
48
|
-
if (!this.noScrolledInit) {
|
|
49
|
-
this.init.next();
|
|
47
|
+
componentDidLoad() {
|
|
48
|
+
if (!this.noScrolledInit) {
|
|
49
|
+
this.init.next();
|
|
50
|
+
}
|
|
50
51
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
this.resizedObserver.disconnect();
|
|
57
|
-
}
|
|
58
|
-
render() {
|
|
59
|
-
return [
|
|
60
|
-
h("div", { class: "scrollable-wrapper", ref: el => (this.scrollWrapperElement = el) }, !this.noShadowY && h("div", { class: "shadow-top" }), !this.noShadowX && h("div", { class: "shadow-left" }), !this.noShadowX && h("div", { class: "shadow-right" }), !this.noShadowY && h("div", { class: "shadow-bottom" })),
|
|
61
|
-
h("div", { ref: el => (this.scrollElement = el), class: {
|
|
62
|
-
'scrollable-content': true,
|
|
63
|
-
'scroll-x': !this.noOverflowX,
|
|
64
|
-
'scroll-y': !this.noOverflowY,
|
|
65
|
-
'no-overscroll': this.noOverscroll
|
|
66
|
-
} }, h("slot", null))
|
|
67
|
-
];
|
|
68
|
-
}
|
|
69
|
-
attachEmitter(from, emitter) {
|
|
70
|
-
merge(this.init, this.scrolled, this.resizedEntries)
|
|
71
|
-
.pipe(auditTime(CatScrollable.THROTTLE), map(() => this.getScrollOffset(from)), map(offset => offset <= this.scrolledBuffer), distinctUntilChanged(), filter(isLower => isLower), takeUntil(this.destroyed))
|
|
72
|
-
.subscribe(() => emitter.emit());
|
|
73
|
-
}
|
|
74
|
-
getScrollOffset(from) {
|
|
75
|
-
if (this.scrollElement) {
|
|
76
|
-
switch (from) {
|
|
77
|
-
case 'top':
|
|
78
|
-
return this.scrollElement.scrollTop;
|
|
79
|
-
case 'left':
|
|
80
|
-
return this.scrollElement.scrollLeft;
|
|
81
|
-
case 'right':
|
|
82
|
-
return this.scrollElement.scrollWidth - this.scrollElement.clientWidth - this.scrollElement.scrollLeft;
|
|
83
|
-
case 'bottom':
|
|
84
|
-
return this.scrollElement.scrollHeight - this.scrollElement.clientHeight - this.scrollElement.scrollTop;
|
|
85
|
-
default:
|
|
86
|
-
return 0;
|
|
87
|
-
}
|
|
52
|
+
disconnectedCallback() {
|
|
53
|
+
this.init.complete();
|
|
54
|
+
this.destroyed.next();
|
|
55
|
+
this.destroyed.complete();
|
|
56
|
+
this.resizedObserver.disconnect();
|
|
88
57
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
58
|
+
render() {
|
|
59
|
+
return [
|
|
60
|
+
h("div", { class: "scrollable-wrapper", ref: el => (this.scrollWrapperElement = el) }, !this.noShadowY && h("div", { class: "shadow-top" }), !this.noShadowX && h("div", { class: "shadow-left" }), !this.noShadowX && h("div", { class: "shadow-right" }), !this.noShadowY && h("div", { class: "shadow-bottom" })),
|
|
61
|
+
h("div", { ref: el => (this.scrollElement = el), class: {
|
|
62
|
+
'scrollable-content': true,
|
|
63
|
+
'scroll-x': !this.noOverflowX,
|
|
64
|
+
'scroll-y': !this.noOverflowY,
|
|
65
|
+
'no-overscroll': this.noOverscroll
|
|
66
|
+
} }, h("slot", null))
|
|
67
|
+
];
|
|
94
68
|
}
|
|
95
|
-
|
|
96
|
-
|
|
69
|
+
attachEmitter(from, emitter) {
|
|
70
|
+
merge(this.init, this.scrolled, this.resizedEntries)
|
|
71
|
+
.pipe(auditTime(CatScrollable.THROTTLE), map(() => this.getScrollOffset(from)), map(offset => offset <= this.scrolledBuffer), distinctUntilChanged(), filter(isLower => isLower), takeUntil(this.destroyed))
|
|
72
|
+
.subscribe(() => emitter.emit());
|
|
97
73
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
return {
|
|
113
|
-
"noShadowX": {
|
|
114
|
-
"type": "boolean",
|
|
115
|
-
"mutable": false,
|
|
116
|
-
"complexType": {
|
|
117
|
-
"original": "boolean",
|
|
118
|
-
"resolved": "boolean",
|
|
119
|
-
"references": {}
|
|
120
|
-
},
|
|
121
|
-
"required": false,
|
|
122
|
-
"optional": false,
|
|
123
|
-
"docs": {
|
|
124
|
-
"tags": [],
|
|
125
|
-
"text": "Flags to disable/enable scroll shadowX."
|
|
126
|
-
},
|
|
127
|
-
"attribute": "no-shadow-x",
|
|
128
|
-
"reflect": false,
|
|
129
|
-
"defaultValue": "false"
|
|
130
|
-
},
|
|
131
|
-
"noShadowY": {
|
|
132
|
-
"type": "boolean",
|
|
133
|
-
"mutable": false,
|
|
134
|
-
"complexType": {
|
|
135
|
-
"original": "boolean",
|
|
136
|
-
"resolved": "boolean",
|
|
137
|
-
"references": {}
|
|
138
|
-
},
|
|
139
|
-
"required": false,
|
|
140
|
-
"optional": false,
|
|
141
|
-
"docs": {
|
|
142
|
-
"tags": [],
|
|
143
|
-
"text": "Flags to disable/enable scroll shadowY."
|
|
144
|
-
},
|
|
145
|
-
"attribute": "no-shadow-y",
|
|
146
|
-
"reflect": false,
|
|
147
|
-
"defaultValue": "false"
|
|
148
|
-
},
|
|
149
|
-
"noOverflowX": {
|
|
150
|
-
"type": "boolean",
|
|
151
|
-
"mutable": false,
|
|
152
|
-
"complexType": {
|
|
153
|
-
"original": "boolean",
|
|
154
|
-
"resolved": "boolean",
|
|
155
|
-
"references": {}
|
|
156
|
-
},
|
|
157
|
-
"required": false,
|
|
158
|
-
"optional": false,
|
|
159
|
-
"docs": {
|
|
160
|
-
"tags": [],
|
|
161
|
-
"text": "Flags to disable/enable overflowX."
|
|
162
|
-
},
|
|
163
|
-
"attribute": "no-overflow-x",
|
|
164
|
-
"reflect": false,
|
|
165
|
-
"defaultValue": "false"
|
|
166
|
-
},
|
|
167
|
-
"noOverflowY": {
|
|
168
|
-
"type": "boolean",
|
|
169
|
-
"mutable": false,
|
|
170
|
-
"complexType": {
|
|
171
|
-
"original": "boolean",
|
|
172
|
-
"resolved": "boolean",
|
|
173
|
-
"references": {}
|
|
174
|
-
},
|
|
175
|
-
"required": false,
|
|
176
|
-
"optional": false,
|
|
177
|
-
"docs": {
|
|
178
|
-
"tags": [],
|
|
179
|
-
"text": "Flags to disable/enable overflowY."
|
|
180
|
-
},
|
|
181
|
-
"attribute": "no-overflow-y",
|
|
182
|
-
"reflect": false,
|
|
183
|
-
"defaultValue": "false"
|
|
184
|
-
},
|
|
185
|
-
"noOverscroll": {
|
|
186
|
-
"type": "boolean",
|
|
187
|
-
"mutable": false,
|
|
188
|
-
"complexType": {
|
|
189
|
-
"original": "boolean",
|
|
190
|
-
"resolved": "boolean",
|
|
191
|
-
"references": {}
|
|
192
|
-
},
|
|
193
|
-
"required": false,
|
|
194
|
-
"optional": false,
|
|
195
|
-
"docs": {
|
|
196
|
-
"tags": [],
|
|
197
|
-
"text": "Flag to disable/enable overscroll behavior."
|
|
198
|
-
},
|
|
199
|
-
"attribute": "no-overscroll",
|
|
200
|
-
"reflect": false,
|
|
201
|
-
"defaultValue": "false"
|
|
202
|
-
},
|
|
203
|
-
"noScrolledInit": {
|
|
204
|
-
"type": "boolean",
|
|
205
|
-
"mutable": false,
|
|
206
|
-
"complexType": {
|
|
207
|
-
"original": "boolean",
|
|
208
|
-
"resolved": "boolean",
|
|
209
|
-
"references": {}
|
|
210
|
-
},
|
|
211
|
-
"required": false,
|
|
212
|
-
"optional": false,
|
|
213
|
-
"docs": {
|
|
214
|
-
"tags": [],
|
|
215
|
-
"text": "Flag to not fire an initial event after content initialization."
|
|
216
|
-
},
|
|
217
|
-
"attribute": "no-scrolled-init",
|
|
218
|
-
"reflect": false,
|
|
219
|
-
"defaultValue": "false"
|
|
220
|
-
},
|
|
221
|
-
"scrolledBuffer": {
|
|
222
|
-
"type": "number",
|
|
223
|
-
"mutable": false,
|
|
224
|
-
"complexType": {
|
|
225
|
-
"original": "number",
|
|
226
|
-
"resolved": "number",
|
|
227
|
-
"references": {}
|
|
228
|
-
},
|
|
229
|
-
"required": false,
|
|
230
|
-
"optional": false,
|
|
231
|
-
"docs": {
|
|
232
|
-
"tags": [],
|
|
233
|
-
"text": "Buffer to be used to calculate the scroll distance."
|
|
234
|
-
},
|
|
235
|
-
"attribute": "scrolled-buffer",
|
|
236
|
-
"reflect": false,
|
|
237
|
-
"defaultValue": "0"
|
|
238
|
-
}
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
static get events() {
|
|
242
|
-
return [{
|
|
243
|
-
"method": "scrolledTop",
|
|
244
|
-
"name": "scrolledTop",
|
|
245
|
-
"bubbles": true,
|
|
246
|
-
"cancelable": true,
|
|
247
|
-
"composed": true,
|
|
248
|
-
"docs": {
|
|
249
|
-
"tags": [],
|
|
250
|
-
"text": "Emitted when the content is fully scrolled to the top."
|
|
251
|
-
},
|
|
252
|
-
"complexType": {
|
|
253
|
-
"original": "void",
|
|
254
|
-
"resolved": "void",
|
|
255
|
-
"references": {}
|
|
74
|
+
getScrollOffset(from) {
|
|
75
|
+
if (this.scrollElement) {
|
|
76
|
+
switch (from) {
|
|
77
|
+
case 'top':
|
|
78
|
+
return this.scrollElement.scrollTop;
|
|
79
|
+
case 'left':
|
|
80
|
+
return this.scrollElement.scrollLeft;
|
|
81
|
+
case 'right':
|
|
82
|
+
return this.scrollElement.scrollWidth - this.scrollElement.clientWidth - this.scrollElement.scrollLeft;
|
|
83
|
+
case 'bottom':
|
|
84
|
+
return this.scrollElement.scrollHeight - this.scrollElement.clientHeight - this.scrollElement.scrollTop;
|
|
85
|
+
default:
|
|
86
|
+
return 0;
|
|
87
|
+
}
|
|
256
88
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
"composed": true,
|
|
263
|
-
"docs": {
|
|
264
|
-
"tags": [],
|
|
265
|
-
"text": "Emitted when the content is fully scrolled to the left."
|
|
266
|
-
},
|
|
267
|
-
"complexType": {
|
|
268
|
-
"original": "void",
|
|
269
|
-
"resolved": "void",
|
|
270
|
-
"references": {}
|
|
271
|
-
}
|
|
272
|
-
}, {
|
|
273
|
-
"method": "scrolledRight",
|
|
274
|
-
"name": "scrolledRight",
|
|
275
|
-
"bubbles": true,
|
|
276
|
-
"cancelable": true,
|
|
277
|
-
"composed": true,
|
|
278
|
-
"docs": {
|
|
279
|
-
"tags": [],
|
|
280
|
-
"text": "Emitted when the content is fully scrolled to the right."
|
|
281
|
-
},
|
|
282
|
-
"complexType": {
|
|
283
|
-
"original": "void",
|
|
284
|
-
"resolved": "void",
|
|
285
|
-
"references": {}
|
|
89
|
+
return 0;
|
|
90
|
+
}
|
|
91
|
+
toggleClass(name, value) {
|
|
92
|
+
if (value) {
|
|
93
|
+
this.scrollWrapperElement?.classList.add(name);
|
|
286
94
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
"name": "scrolledBottom",
|
|
290
|
-
"bubbles": true,
|
|
291
|
-
"cancelable": true,
|
|
292
|
-
"composed": true,
|
|
293
|
-
"docs": {
|
|
294
|
-
"tags": [],
|
|
295
|
-
"text": "Emitted when the content is fully scrolled to the bottom."
|
|
296
|
-
},
|
|
297
|
-
"complexType": {
|
|
298
|
-
"original": "void",
|
|
299
|
-
"resolved": "void",
|
|
300
|
-
"references": {}
|
|
95
|
+
else {
|
|
96
|
+
this.scrollWrapperElement?.classList.remove(name);
|
|
301
97
|
}
|
|
302
|
-
|
|
303
|
-
|
|
98
|
+
}
|
|
99
|
+
static get is() { return "cat-scrollable"; }
|
|
100
|
+
static get encapsulation() { return "shadow"; }
|
|
101
|
+
static get originalStyleUrls() {
|
|
102
|
+
return {
|
|
103
|
+
"$": ["cat-scrollable.scss"]
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
static get styleUrls() {
|
|
107
|
+
return {
|
|
108
|
+
"$": ["cat-scrollable.css"]
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
static get properties() {
|
|
112
|
+
return {
|
|
113
|
+
"noShadowX": {
|
|
114
|
+
"type": "boolean",
|
|
115
|
+
"mutable": false,
|
|
116
|
+
"complexType": {
|
|
117
|
+
"original": "boolean",
|
|
118
|
+
"resolved": "boolean",
|
|
119
|
+
"references": {}
|
|
120
|
+
},
|
|
121
|
+
"required": false,
|
|
122
|
+
"optional": false,
|
|
123
|
+
"docs": {
|
|
124
|
+
"tags": [],
|
|
125
|
+
"text": "Flags to disable/enable scroll shadowX."
|
|
126
|
+
},
|
|
127
|
+
"attribute": "no-shadow-x",
|
|
128
|
+
"reflect": false,
|
|
129
|
+
"defaultValue": "false"
|
|
130
|
+
},
|
|
131
|
+
"noShadowY": {
|
|
132
|
+
"type": "boolean",
|
|
133
|
+
"mutable": false,
|
|
134
|
+
"complexType": {
|
|
135
|
+
"original": "boolean",
|
|
136
|
+
"resolved": "boolean",
|
|
137
|
+
"references": {}
|
|
138
|
+
},
|
|
139
|
+
"required": false,
|
|
140
|
+
"optional": false,
|
|
141
|
+
"docs": {
|
|
142
|
+
"tags": [],
|
|
143
|
+
"text": "Flags to disable/enable scroll shadowY."
|
|
144
|
+
},
|
|
145
|
+
"attribute": "no-shadow-y",
|
|
146
|
+
"reflect": false,
|
|
147
|
+
"defaultValue": "false"
|
|
148
|
+
},
|
|
149
|
+
"noOverflowX": {
|
|
150
|
+
"type": "boolean",
|
|
151
|
+
"mutable": false,
|
|
152
|
+
"complexType": {
|
|
153
|
+
"original": "boolean",
|
|
154
|
+
"resolved": "boolean",
|
|
155
|
+
"references": {}
|
|
156
|
+
},
|
|
157
|
+
"required": false,
|
|
158
|
+
"optional": false,
|
|
159
|
+
"docs": {
|
|
160
|
+
"tags": [],
|
|
161
|
+
"text": "Flags to disable/enable overflowX."
|
|
162
|
+
},
|
|
163
|
+
"attribute": "no-overflow-x",
|
|
164
|
+
"reflect": false,
|
|
165
|
+
"defaultValue": "false"
|
|
166
|
+
},
|
|
167
|
+
"noOverflowY": {
|
|
168
|
+
"type": "boolean",
|
|
169
|
+
"mutable": false,
|
|
170
|
+
"complexType": {
|
|
171
|
+
"original": "boolean",
|
|
172
|
+
"resolved": "boolean",
|
|
173
|
+
"references": {}
|
|
174
|
+
},
|
|
175
|
+
"required": false,
|
|
176
|
+
"optional": false,
|
|
177
|
+
"docs": {
|
|
178
|
+
"tags": [],
|
|
179
|
+
"text": "Flags to disable/enable overflowY."
|
|
180
|
+
},
|
|
181
|
+
"attribute": "no-overflow-y",
|
|
182
|
+
"reflect": false,
|
|
183
|
+
"defaultValue": "false"
|
|
184
|
+
},
|
|
185
|
+
"noOverscroll": {
|
|
186
|
+
"type": "boolean",
|
|
187
|
+
"mutable": false,
|
|
188
|
+
"complexType": {
|
|
189
|
+
"original": "boolean",
|
|
190
|
+
"resolved": "boolean",
|
|
191
|
+
"references": {}
|
|
192
|
+
},
|
|
193
|
+
"required": false,
|
|
194
|
+
"optional": false,
|
|
195
|
+
"docs": {
|
|
196
|
+
"tags": [],
|
|
197
|
+
"text": "Flag to disable/enable overscroll behavior."
|
|
198
|
+
},
|
|
199
|
+
"attribute": "no-overscroll",
|
|
200
|
+
"reflect": false,
|
|
201
|
+
"defaultValue": "false"
|
|
202
|
+
},
|
|
203
|
+
"noScrolledInit": {
|
|
204
|
+
"type": "boolean",
|
|
205
|
+
"mutable": false,
|
|
206
|
+
"complexType": {
|
|
207
|
+
"original": "boolean",
|
|
208
|
+
"resolved": "boolean",
|
|
209
|
+
"references": {}
|
|
210
|
+
},
|
|
211
|
+
"required": false,
|
|
212
|
+
"optional": false,
|
|
213
|
+
"docs": {
|
|
214
|
+
"tags": [],
|
|
215
|
+
"text": "Flag to not fire an initial event after content initialization."
|
|
216
|
+
},
|
|
217
|
+
"attribute": "no-scrolled-init",
|
|
218
|
+
"reflect": false,
|
|
219
|
+
"defaultValue": "false"
|
|
220
|
+
},
|
|
221
|
+
"scrolledBuffer": {
|
|
222
|
+
"type": "number",
|
|
223
|
+
"mutable": false,
|
|
224
|
+
"complexType": {
|
|
225
|
+
"original": "number",
|
|
226
|
+
"resolved": "number",
|
|
227
|
+
"references": {}
|
|
228
|
+
},
|
|
229
|
+
"required": false,
|
|
230
|
+
"optional": false,
|
|
231
|
+
"docs": {
|
|
232
|
+
"tags": [],
|
|
233
|
+
"text": "Buffer to be used to calculate the scroll distance."
|
|
234
|
+
},
|
|
235
|
+
"attribute": "scrolled-buffer",
|
|
236
|
+
"reflect": false,
|
|
237
|
+
"defaultValue": "0"
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
static get events() {
|
|
242
|
+
return [{
|
|
243
|
+
"method": "scrolledTop",
|
|
244
|
+
"name": "scrolledTop",
|
|
245
|
+
"bubbles": true,
|
|
246
|
+
"cancelable": true,
|
|
247
|
+
"composed": true,
|
|
248
|
+
"docs": {
|
|
249
|
+
"tags": [],
|
|
250
|
+
"text": "Emitted when the content is fully scrolled to the top."
|
|
251
|
+
},
|
|
252
|
+
"complexType": {
|
|
253
|
+
"original": "void",
|
|
254
|
+
"resolved": "void",
|
|
255
|
+
"references": {}
|
|
256
|
+
}
|
|
257
|
+
}, {
|
|
258
|
+
"method": "scrolledLeft",
|
|
259
|
+
"name": "scrolledLeft",
|
|
260
|
+
"bubbles": true,
|
|
261
|
+
"cancelable": true,
|
|
262
|
+
"composed": true,
|
|
263
|
+
"docs": {
|
|
264
|
+
"tags": [],
|
|
265
|
+
"text": "Emitted when the content is fully scrolled to the left."
|
|
266
|
+
},
|
|
267
|
+
"complexType": {
|
|
268
|
+
"original": "void",
|
|
269
|
+
"resolved": "void",
|
|
270
|
+
"references": {}
|
|
271
|
+
}
|
|
272
|
+
}, {
|
|
273
|
+
"method": "scrolledRight",
|
|
274
|
+
"name": "scrolledRight",
|
|
275
|
+
"bubbles": true,
|
|
276
|
+
"cancelable": true,
|
|
277
|
+
"composed": true,
|
|
278
|
+
"docs": {
|
|
279
|
+
"tags": [],
|
|
280
|
+
"text": "Emitted when the content is fully scrolled to the right."
|
|
281
|
+
},
|
|
282
|
+
"complexType": {
|
|
283
|
+
"original": "void",
|
|
284
|
+
"resolved": "void",
|
|
285
|
+
"references": {}
|
|
286
|
+
}
|
|
287
|
+
}, {
|
|
288
|
+
"method": "scrolledBottom",
|
|
289
|
+
"name": "scrolledBottom",
|
|
290
|
+
"bubbles": true,
|
|
291
|
+
"cancelable": true,
|
|
292
|
+
"composed": true,
|
|
293
|
+
"docs": {
|
|
294
|
+
"tags": [],
|
|
295
|
+
"text": "Emitted when the content is fully scrolled to the bottom."
|
|
296
|
+
},
|
|
297
|
+
"complexType": {
|
|
298
|
+
"original": "void",
|
|
299
|
+
"resolved": "void",
|
|
300
|
+
"references": {}
|
|
301
|
+
}
|
|
302
|
+
}];
|
|
303
|
+
}
|
|
304
304
|
}
|
|
305
305
|
CatScrollable.THROTTLE = 50;
|
|
306
306
|
//# sourceMappingURL=cat-scrollable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cat-scrollable.js","sourceRoot":"","sources":["../../../src/components/cat-scrollable/cat-scrollable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAc,OAAO,EAAE,MAAM,MAAM,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,M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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAnKuB,sBAAQ,GAAG,EAAE,AAAL,CAAM","sourcesContent":["import { Component, Event, EventEmitter, h, Prop } from '@stencil/core';\nimport { fromEvent, merge, Observable, Subject } from 'rxjs';\nimport { auditTime, distinctUntilChanged, filter, map, takeUntil } from 'rxjs/operators';\n\n/**\n * An element to display scrollable content.\n */\n@Component({\n tag: 'cat-scrollable',\n styleUrl: 'cat-scrollable.scss',\n shadow: true\n})\nexport class CatScrollable {\n private static readonly THROTTLE = 50;\n scrollElement?: HTMLElement;\n scrollWrapperElement?: HTMLElement;\n private readonly init = new Subject<void>();\n private readonly destroyed = new Subject<void>();\n private readonly resizedEntries = new Subject<ResizeObserverEntry[]>();\n private readonly resizedObserver = new ResizeObserver(entries => this.resizedEntries.next(entries));\n private scrolled!: Observable<Event>;\n\n /** Flags to disable/enable scroll shadowX. */\n @Prop()\n noShadowX = false;\n\n /** Flags to disable/enable scroll shadowY. */\n @Prop()\n noShadowY = false;\n\n /** Flags to disable/enable overflowX. */\n @Prop()\n noOverflowX = false;\n\n /** Flags to disable/enable overflowY. */\n @Prop()\n noOverflowY = false;\n\n /** Flag to disable/enable overscroll behavior. */\n @Prop()\n noOverscroll = false;\n\n /**\n * Flag to not fire an initial event after content initialization.\n */\n @Prop() noScrolledInit = false;\n\n /**\n * Buffer to be used to calculate the scroll distance.\n */\n @Prop() scrolledBuffer = 0;\n\n /**\n * Emitted when the content is fully scrolled to the top.\n */\n @Event() scrolledTop!: EventEmitter<void>;\n\n /**\n * Emitted when the content is fully scrolled to the left.\n */\n @Event() scrolledLeft!: EventEmitter<void>;\n\n /**\n * Emitted when the content is fully scrolled to the right.\n */\n @Event() scrolledRight!: EventEmitter<void>;\n\n /**\n * Emitted when the content is fully scrolled to the bottom.\n */\n @Event() scrolledBottom!: EventEmitter<void>;\n\n componentDidRender() {\n if (this.scrollElement) {\n this.scrolled = fromEvent(this.scrollElement, 'scroll').pipe(takeUntil(this.destroyed));\n this.resizedObserver.observe(this.scrollElement);\n }\n if (this.scrollWrapperElement) {\n this.resizedObserver.observe(this.scrollWrapperElement);\n }\n this.attachEmitter('left', this.scrolledLeft);\n this.attachEmitter('right', this.scrolledRight);\n this.attachEmitter('bottom', this.scrolledBottom);\n this.attachEmitter('top', this.scrolledTop);\n merge(this.init, this.scrolled, this.resizedEntries)\n .pipe(\n auditTime(CatScrollable.THROTTLE),\n map(() => ({\n top: this.getScrollOffset('top') > 0,\n left: this.getScrollOffset('left') > 0,\n right: this.getScrollOffset('right') > 0,\n bottom: this.getScrollOffset('bottom') > 0\n })),\n distinctUntilChanged(),\n takeUntil(this.destroyed)\n )\n .subscribe(({ top, left, right, bottom }) => {\n this.toggleClass('cat-scrollable-top', top);\n this.toggleClass('cat-scrollable-left', left);\n this.toggleClass('cat-scrollable-right', right);\n this.toggleClass('cat-scrollable-bottom', bottom);\n });\n }\n\n componentDidLoad() {\n if (!this.noScrolledInit) {\n this.init.next();\n }\n }\n\n disconnectedCallback() {\n this.init.complete();\n this.destroyed.next();\n this.destroyed.complete();\n this.resizedObserver.disconnect();\n }\n\n render() {\n return [\n <div class=\"scrollable-wrapper\" ref={el => (this.scrollWrapperElement = el)}>\n {!this.noShadowY && <div class=\"shadow-top\"></div>}\n {!this.noShadowX && <div class=\"shadow-left\"></div>}\n {!this.noShadowX && <div class=\"shadow-right\"></div>}\n {!this.noShadowY && <div class=\"shadow-bottom\"></div>}\n </div>,\n <div\n ref={el => (this.scrollElement = el)}\n class={{\n 'scrollable-content': true,\n 'scroll-x': !this.noOverflowX,\n 'scroll-y': !this.noOverflowY,\n 'no-overscroll': this.noOverscroll\n }}\n >\n <slot></slot>\n </div>\n ];\n }\n\n private attachEmitter(from: 'top' | 'left' | 'right' | 'bottom', emitter: EventEmitter<void>) {\n merge(this.init, this.scrolled, this.resizedEntries)\n .pipe(\n auditTime(CatScrollable.THROTTLE),\n map(() => this.getScrollOffset(from)),\n map(offset => offset <= this.scrolledBuffer),\n distinctUntilChanged(),\n filter(isLower => isLower),\n takeUntil(this.destroyed)\n )\n .subscribe(() => emitter.emit());\n }\n\n private getScrollOffset(from: 'top' | 'left' | 'right' | 'bottom') {\n if (this.scrollElement) {\n switch (from) {\n case 'top':\n return this.scrollElement.scrollTop;\n case 'left':\n return this.scrollElement.scrollLeft;\n case 'right':\n return this.scrollElement.scrollWidth - this.scrollElement.clientWidth - this.scrollElement.scrollLeft;\n case 'bottom':\n return this.scrollElement.scrollHeight - this.scrollElement.clientHeight - this.scrollElement.scrollTop;\n default:\n return 0;\n }\n }\n return 0;\n }\n\n private toggleClass(name: string, value: boolean) {\n if (value) {\n this.scrollWrapperElement?.classList.add(name);\n } else {\n this.scrollWrapperElement?.classList.remove(name);\n }\n }\n}\n"]}
|