@koobiq/components 17.0.0-rc.9 → 17.0.1
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/README.md +1 -2
- package/alert/_alert-theme.scss +0 -1
- package/alert/alert.component.d.ts +3 -1
- package/alert/alert.component.scss +14 -14
- package/alert/public-api.d.ts +1 -1
- package/autocomplete/_autocomplete-theme.scss +0 -1
- package/autocomplete/autocomplete.scss +3 -6
- package/autocomplete/public-api.d.ts +2 -2
- package/badge/_badge-theme.scss +1 -2
- package/badge/badge.component.scss +0 -1
- package/badge/public-api.d.ts +1 -1
- package/button/_button-base.scss +0 -1
- package/button/_button-theme.scss +5 -3
- package/button/button.component.d.ts +2 -2
- package/button/button.scss +0 -1
- package/button/public-api.d.ts +1 -1
- package/button-toggle/_button-toggle-theme.scss +2 -3
- package/button-toggle/button-toggle.scss +2 -9
- package/button-toggle/public-api.d.ts +1 -1
- package/card/_card-theme.scss +0 -1
- package/card/card.component.d.ts +1 -1
- package/card/card.component.scss +1 -2
- package/card/public-api.d.ts +1 -1
- package/checkbox/_checkbox-theme.scss +10 -11
- package/checkbox/checkbox.scss +13 -19
- package/code-block/README.md +17 -14
- package/code-block/_code-block-theme.scss +23 -16
- package/code-block/actionbar.component.d.ts +2 -1
- package/code-block/actionbar.component.scss +5 -13
- package/code-block/code-block.component.d.ts +4 -3
- package/code-block/code-block.scss +8 -14
- package/code-block/public-api.d.ts +1 -1
- package/core/animation/index.d.ts +1 -1
- package/core/common-behaviors/index.d.ts +3 -3
- package/core/datetime/index.d.ts +1 -1
- package/core/formatters/index.d.ts +1 -1
- package/core/forms/_forms-theme.scss +0 -1
- package/core/forms/_forms.scss +0 -1
- package/core/forms/index.d.ts +1 -1
- package/core/locales/index.d.ts +1 -1
- package/core/option/_optgroup-theme.scss +0 -1
- package/core/option/_option-action-theme.scss +0 -1
- package/core/option/_option-theme.scss +0 -1
- package/core/option/action.scss +4 -2
- package/core/option/index.d.ts +2 -2
- package/core/option/optgroup.scss +2 -3
- package/core/option/option.scss +0 -1
- package/core/pop-up/_pop-up.scss +0 -1
- package/core/pop-up/pop-up-trigger.d.ts +3 -3
- package/core/public-api.d.ts +3 -3
- package/core/select/constants.d.ts +1 -1
- package/core/select/index.d.ts +3 -3
- package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +0 -2
- package/core/selection/pseudo-checkbox/pseudo-checkbox.scss +0 -1
- package/core/services/theme.service.d.ts +3 -2
- package/core/styles/_core.scss +0 -1
- package/core/styles/_koobiq-theme.scss +5 -3
- package/core/styles/common/_animation.scss +11 -10
- package/core/styles/common/_button.scss +0 -2
- package/core/styles/common/_clearfix.scss +1 -1
- package/core/styles/common/_groups.scss +0 -4
- package/core/styles/common/_list.scss +23 -61
- package/core/styles/common/_overlay.scss +4 -3
- package/core/styles/common/_popup.scss +0 -1
- package/core/styles/common/_rtl.scss +4 -4
- package/core/styles/common/_select.scss +37 -26
- package/core/styles/common/_tokens.scss +0 -2
- package/core/styles/functions/_number.scss +14 -19
- package/core/styles/functions/_string.scss +18 -19
- package/core/styles/functions/_timing.scss +24 -24
- package/core/styles/theming/_components-theming.scss +1120 -1208
- package/core/styles/theming/_scrollbar-theme.scss +8 -5
- package/core/styles/theming/_theming.scss +22 -20
- package/core/styles/typography/_typography-utils.scss +9 -3
- package/core/styles/typography/_typography.scss +114 -94
- package/core/styles/visual/_body.scss +0 -2
- package/core/styles/visual/_layout.scss +30 -22
- package/core/utils/data-size/index.d.ts +1 -1
- package/core/utils/public-api.d.ts +1 -1
- package/datepicker/_datepicker-theme.scss +21 -8
- package/datepicker/calendar-body.scss +0 -3
- package/datepicker/calendar-header.scss +0 -1
- package/datepicker/calendar.scss +1 -2
- package/datepicker/datepicker-content.scss +1 -3
- package/datepicker/datepicker-input.directive.d.ts +1 -0
- package/datepicker/datepicker-input.scss +0 -1
- package/datepicker/datepicker-toggle.scss +0 -1
- package/datepicker/datepicker.component.d.ts +2 -2
- package/datepicker/public-api.d.ts +4 -4
- package/divider/_divider-theme.scss +0 -1
- package/divider/divider.scss +0 -1
- package/dl/_dl-theme.scss +0 -2
- package/dl/dl.scss +0 -1
- package/dl/public-api.d.ts +1 -1
- package/dropdown/_dropdown-theme.scss +4 -2
- package/dropdown/dropdown-content.directive.d.ts +1 -1
- package/dropdown/dropdown-item.component.d.ts +1 -1
- package/dropdown/dropdown-item.scss +9 -7
- package/dropdown/dropdown.component.d.ts +1 -1
- package/dropdown/dropdown.scss +0 -1
- package/dropdown/public-api.d.ts +5 -5
- package/ellipsis-center/ellipsis-center.directive.d.ts +1 -1
- package/empty-state/README.md +0 -0
- package/empty-state/_empty-state-theme.scss +56 -0
- package/empty-state/empty-state.component.d.ts +31 -0
- package/empty-state/empty-state.module.d.ts +10 -0
- package/empty-state/empty-state.scss +81 -0
- package/empty-state/index.d.ts +1 -0
- package/empty-state/public-api.d.ts +2 -0
- package/esm2022/alert/alert.component.mjs +7 -3
- package/esm2022/alert/alert.module.mjs +1 -1
- package/esm2022/alert/public-api.mjs +2 -2
- package/esm2022/autocomplete/autocomplete-origin.directive.mjs +1 -1
- package/esm2022/autocomplete/autocomplete-trigger.directive.mjs +25 -42
- package/esm2022/autocomplete/autocomplete.component.mjs +14 -9
- package/esm2022/autocomplete/autocomplete.module.mjs +3 -3
- package/esm2022/autocomplete/public-api.mjs +3 -3
- package/esm2022/badge/badge.component.mjs +8 -6
- package/esm2022/badge/badge.module.mjs +1 -1
- package/esm2022/badge/public-api.mjs +2 -2
- package/esm2022/button/button.component.mjs +12 -9
- package/esm2022/button/button.module.mjs +1 -1
- package/esm2022/button/public-api.mjs +2 -2
- package/esm2022/button-toggle/button-toggle.component.mjs +26 -20
- package/esm2022/button-toggle/button-toggle.module.mjs +1 -1
- package/esm2022/button-toggle/public-api.mjs +2 -2
- package/esm2022/card/card.component.mjs +4 -5
- package/esm2022/card/card.module.mjs +1 -1
- package/esm2022/card/public-api.mjs +2 -2
- package/esm2022/checkbox/checkbox-config.mjs +1 -1
- package/esm2022/checkbox/checkbox-module.mjs +1 -1
- package/esm2022/checkbox/checkbox-required-validator.mjs +1 -1
- package/esm2022/checkbox/checkbox.mjs +6 -8
- package/esm2022/checkbox/public-api.mjs +1 -1
- package/esm2022/code-block/actionbar.component.mjs +6 -6
- package/esm2022/code-block/code-block.component.mjs +20 -19
- package/esm2022/code-block/code-block.module.mjs +9 -5
- package/esm2022/code-block/public-api.mjs +2 -2
- package/esm2022/core/animation/fade-animations.mjs +1 -1
- package/esm2022/core/animation/index.mjs +2 -2
- package/esm2022/core/animation/select-animations.mjs +2 -2
- package/esm2022/core/common-behaviors/color.mjs +4 -2
- package/esm2022/core/common-behaviors/common-module.mjs +2 -5
- package/esm2022/core/common-behaviors/constructor.mjs +1 -1
- package/esm2022/core/common-behaviors/disabled.mjs +2 -2
- package/esm2022/core/common-behaviors/error-state.mjs +1 -1
- package/esm2022/core/common-behaviors/index.mjs +4 -4
- package/esm2022/core/common-behaviors/tabindex.mjs +1 -1
- package/esm2022/core/datetime/date-adapter.mjs +1 -2
- package/esm2022/core/datetime/date-formats.mjs +1 -1
- package/esm2022/core/datetime/index.mjs +2 -2
- package/esm2022/core/error/error-options.mjs +1 -1
- package/esm2022/core/form-field/form-field-ref.mjs +1 -1
- package/esm2022/core/formatters/date/formatter.mjs +1 -1
- package/esm2022/core/formatters/date/formatter.pipe.mjs +1 -1
- package/esm2022/core/formatters/index.mjs +2 -2
- package/esm2022/core/formatters/number/formatter.mjs +19 -24
- package/esm2022/core/forms/forms-module.mjs +1 -1
- package/esm2022/core/forms/forms.directive.mjs +1 -1
- package/esm2022/core/forms/index.mjs +2 -2
- package/esm2022/core/highlight/highlight.pipe.mjs +1 -1
- package/esm2022/core/highlight/index.mjs +1 -1
- package/esm2022/core/label/label-options.mjs +1 -1
- package/esm2022/core/line/line.mjs +2 -2
- package/esm2022/core/locales/en-US.mjs +1 -1
- package/esm2022/core/locales/es-LA.mjs +1 -1
- package/esm2022/core/locales/fa-IR.mjs +1 -1
- package/esm2022/core/locales/formatters.mjs +1 -3
- package/esm2022/core/locales/index.mjs +2 -2
- package/esm2022/core/locales/locale-service.mjs +8 -5
- package/esm2022/core/locales/locale-service.module.mjs +1 -1
- package/esm2022/core/locales/pt-BR.mjs +1 -1
- package/esm2022/core/locales/ru-RU.mjs +3 -3
- package/esm2022/core/locales/zh-CN.mjs +1 -1
- package/esm2022/core/option/action.mjs +22 -14
- package/esm2022/core/option/index.mjs +3 -3
- package/esm2022/core/option/optgroup.mjs +4 -5
- package/esm2022/core/option/option-module.mjs +1 -1
- package/esm2022/core/option/option.mjs +13 -10
- package/esm2022/core/overlay/overlay-position-map.mjs +1 -1
- package/esm2022/core/pop-up/pop-up-trigger.mjs +14 -24
- package/esm2022/core/pop-up/pop-up.mjs +1 -2
- package/esm2022/core/public-api.mjs +4 -4
- package/esm2022/core/select/common.mjs +2 -5
- package/esm2022/core/select/constants.mjs +1 -2
- package/esm2022/core/select/index.mjs +4 -4
- package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +3 -3
- package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.module.mjs +1 -1
- package/esm2022/core/services/measure-scrollbar.service.mjs +1 -2
- package/esm2022/core/services/theme.service.mjs +5 -4
- package/esm2022/core/title/title-text-ref.mjs +1 -1
- package/esm2022/core/utils/data-size/config.mjs +1 -1
- package/esm2022/core/utils/data-size/data-size.pipe.mjs +2 -3
- package/esm2022/core/utils/data-size/index.mjs +2 -2
- package/esm2022/core/utils/data-size/size.mjs +3 -6
- package/esm2022/core/utils/public-api.mjs +2 -2
- package/esm2022/core/utils/utils.mjs +4 -2
- package/esm2022/core/validation/validation.mjs +4 -2
- package/esm2022/core/version.mjs +2 -2
- package/esm2022/datepicker/calendar-body.component.mjs +3 -5
- package/esm2022/datepicker/calendar-header.component.mjs +8 -8
- package/esm2022/datepicker/calendar.component.mjs +6 -6
- package/esm2022/datepicker/datepicker-animations.mjs +1 -1
- package/esm2022/datepicker/datepicker-errors.mjs +1 -1
- package/esm2022/datepicker/datepicker-input.directive.mjs +47 -49
- package/esm2022/datepicker/datepicker-intl.mjs +1 -1
- package/esm2022/datepicker/datepicker-module.mjs +2 -2
- package/esm2022/datepicker/datepicker-toggle.component.mjs +11 -10
- package/esm2022/datepicker/datepicker.component.mjs +15 -18
- package/esm2022/datepicker/month-view.component.mjs +14 -14
- package/esm2022/datepicker/public-api.mjs +5 -5
- package/esm2022/divider/divider.component.mjs +1 -1
- package/esm2022/divider/divider.module.mjs +1 -1
- package/esm2022/dl/dl.component.mjs +7 -7
- package/esm2022/dl/dl.module.mjs +2 -2
- package/esm2022/dl/public-api.mjs +2 -2
- package/esm2022/dropdown/dropdown-animations.mjs +2 -2
- package/esm2022/dropdown/dropdown-content.directive.mjs +3 -3
- package/esm2022/dropdown/dropdown-item.component.mjs +5 -8
- package/esm2022/dropdown/dropdown-trigger.directive.mjs +24 -33
- package/esm2022/dropdown/dropdown.component.mjs +10 -19
- package/esm2022/dropdown/dropdown.module.mjs +1 -1
- package/esm2022/dropdown/dropdown.types.mjs +1 -2
- package/esm2022/dropdown/public-api.mjs +6 -6
- package/esm2022/ellipsis-center/ellipsis-center.directive.mjs +6 -5
- package/esm2022/empty-state/empty-state.component.mjs +104 -0
- package/esm2022/empty-state/empty-state.module.mjs +50 -0
- package/esm2022/empty-state/index.mjs +2 -0
- package/esm2022/empty-state/koobiq-components-empty-state.mjs +5 -0
- package/esm2022/empty-state/public-api.mjs +3 -0
- package/esm2022/file-upload/file-drop.mjs +3 -2
- package/esm2022/file-upload/file-upload.mjs +1 -1
- package/esm2022/file-upload/file-upload.module.mjs +2 -2
- package/esm2022/file-upload/index.mjs +1 -1
- package/esm2022/file-upload/multiple-file-upload.component.mjs +16 -14
- package/esm2022/file-upload/public-api.mjs +2 -2
- package/esm2022/file-upload/single-file-upload.component.mjs +14 -12
- package/esm2022/form-field/cleaner.mjs +13 -3
- package/esm2022/form-field/form-field-control.mjs +1 -2
- package/esm2022/form-field/form-field-errors.mjs +1 -1
- package/esm2022/form-field/form-field.mjs +8 -15
- package/esm2022/form-field/form-field.module.mjs +1 -1
- package/esm2022/form-field/hint.mjs +6 -6
- package/esm2022/form-field/password-hint.mjs +15 -15
- package/esm2022/form-field/password-toggle.mjs +4 -7
- package/esm2022/form-field/prefix.mjs +1 -1
- package/esm2022/form-field/public-api.mjs +4 -4
- package/esm2022/form-field/stepper.mjs +33 -29
- package/esm2022/form-field/suffix.mjs +1 -1
- package/esm2022/form-field/validate.directive.mjs +6 -7
- package/esm2022/icon/icon-button.component.mjs +4 -4
- package/esm2022/icon/icon-item.component.mjs +3 -3
- package/esm2022/icon/icon.component.mjs +5 -6
- package/esm2022/icon/icon.module.mjs +1 -1
- package/esm2022/icon/public-api.mjs +3 -3
- package/esm2022/input/input-number-validators.mjs +1 -1
- package/esm2022/input/input-number.mjs +29 -41
- package/esm2022/input/input-password.mjs +13 -8
- package/esm2022/input/input-value-accessor.mjs +1 -1
- package/esm2022/input/input.mjs +13 -10
- package/esm2022/input/input.module.mjs +1 -1
- package/esm2022/input/public-api.mjs +3 -3
- package/esm2022/link/link.component.mjs +2 -2
- package/esm2022/link/link.module.mjs +1 -1
- package/esm2022/link/public-api.mjs +2 -2
- package/esm2022/list/list-selection.component.mjs +36 -41
- package/esm2022/list/list.component.mjs +5 -6
- package/esm2022/list/list.module.mjs +2 -2
- package/esm2022/list/public-api.mjs +3 -3
- package/esm2022/loader-overlay/loader-overlay.component.mjs +3 -3
- package/esm2022/loader-overlay/loader-overlay.module.mjs +1 -1
- package/esm2022/loader-overlay/public-api.mjs +2 -2
- package/esm2022/markdown/markdown.component.mjs +20 -6
- package/esm2022/markdown/markdown.module.mjs +1 -1
- package/esm2022/markdown/markdown.service.mjs +1 -1
- package/esm2022/modal/css-unit.pipe.mjs +1 -1
- package/esm2022/modal/modal-control.service.mjs +6 -2
- package/esm2022/modal/modal-ref.class.mjs +1 -2
- package/esm2022/modal/modal-util.mjs +1 -1
- package/esm2022/modal/modal.component.mjs +60 -33
- package/esm2022/modal/modal.directive.mjs +27 -11
- package/esm2022/modal/modal.module.mjs +2 -2
- package/esm2022/modal/modal.service.mjs +3 -6
- package/esm2022/modal/modal.type.mjs +1 -1
- package/esm2022/modal/public-api.mjs +3 -3
- package/esm2022/navbar/index.mjs +1 -1
- package/esm2022/navbar/navbar-item.component.mjs +41 -33
- package/esm2022/navbar/navbar.component.mjs +19 -29
- package/esm2022/navbar/navbar.module.mjs +2 -2
- package/esm2022/navbar/public-api.mjs +3 -3
- package/esm2022/navbar/vertical-navbar.component.mjs +21 -23
- package/esm2022/popover/popover-animations.mjs +1 -1
- package/esm2022/popover/popover-confirm.component.mjs +3 -3
- package/esm2022/popover/popover.component.mjs +5 -5
- package/esm2022/popover/popover.module.mjs +1 -1
- package/esm2022/popover/public-api.mjs +3 -3
- package/esm2022/progress-bar/progress-bar.component.mjs +4 -4
- package/esm2022/progress-bar/progress-bar.module.mjs +2 -2
- package/esm2022/progress-bar/public-api.mjs +2 -2
- package/esm2022/progress-spinner/progress-spinner.component.mjs +4 -4
- package/esm2022/progress-spinner/progress-spinner.module.mjs +1 -1
- package/esm2022/progress-spinner/public-api.mjs +2 -2
- package/esm2022/radio/public-api.mjs +2 -2
- package/esm2022/radio/radio.component.mjs +9 -14
- package/esm2022/radio/radio.module.mjs +1 -1
- package/esm2022/risk-level/public-api.mjs +2 -2
- package/esm2022/risk-level/risk-level.component.mjs +3 -3
- package/esm2022/risk-level/risk-level.module.mjs +1 -1
- package/esm2022/scrollbar/public-api.mjs +2 -2
- package/esm2022/scrollbar/scrollbar.component.mjs +19 -21
- package/esm2022/scrollbar/scrollbar.directive.mjs +4 -5
- package/esm2022/scrollbar/scrollbar.module.mjs +2 -2
- package/esm2022/scrollbar/scrollbar.types.mjs +3 -2
- package/esm2022/select/public-api.mjs +3 -3
- package/esm2022/select/select-option.directive.mjs +8 -5
- package/esm2022/select/select.component.mjs +45 -71
- package/esm2022/select/select.module.mjs +1 -1
- package/esm2022/sidebar/public-api.mjs +2 -2
- package/esm2022/sidebar/sidebar-animations.mjs +1 -1
- package/esm2022/sidebar/sidebar.component.mjs +5 -7
- package/esm2022/sidebar/sidebar.module.mjs +1 -1
- package/esm2022/sidepanel/public-api.mjs +4 -4
- package/esm2022/sidepanel/sidepanel-animations.mjs +7 -4
- package/esm2022/sidepanel/sidepanel-config.mjs +1 -1
- package/esm2022/sidepanel/sidepanel-container.component.mjs +4 -4
- package/esm2022/sidepanel/sidepanel-directives.mjs +33 -20
- package/esm2022/sidepanel/sidepanel-ref.mjs +10 -5
- package/esm2022/sidepanel/sidepanel.module.mjs +1 -1
- package/esm2022/sidepanel/sidepanel.service.mjs +11 -15
- package/esm2022/splitter/public-api.mjs +2 -2
- package/esm2022/splitter/splitter.component.mjs +13 -24
- package/esm2022/splitter/splitter.module.mjs +1 -1
- package/esm2022/table/public-api.mjs +2 -2
- package/esm2022/table/table.component.mjs +3 -3
- package/esm2022/table/table.module.mjs +1 -1
- package/esm2022/tabs/paginated-tab-header.mjs +9 -14
- package/esm2022/tabs/public-api.mjs +6 -6
- package/esm2022/tabs/tab-body.component.mjs +10 -11
- package/esm2022/tabs/tab-content.directive.mjs +1 -1
- package/esm2022/tabs/tab-group.component.mjs +11 -13
- package/esm2022/tabs/tab-header.component.mjs +4 -4
- package/esm2022/tabs/tab-label-wrapper.directive.mjs +1 -1
- package/esm2022/tabs/tab-label.directive.mjs +1 -1
- package/esm2022/tabs/tab-nav-bar/index.mjs +1 -1
- package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +46 -49
- package/esm2022/tabs/tab.component.mjs +7 -10
- package/esm2022/tabs/tabs-animations.mjs +1 -1
- package/esm2022/tabs/tabs.module.mjs +2 -2
- package/esm2022/tags/public-api.mjs +5 -5
- package/esm2022/tags/tag-default-options.mjs +1 -1
- package/esm2022/tags/tag-input.mjs +12 -16
- package/esm2022/tags/tag-list.component.mjs +15 -27
- package/esm2022/tags/tag-text-control.mjs +1 -1
- package/esm2022/tags/tag.component.mjs +5 -8
- package/esm2022/tags/tag.module.mjs +9 -7
- package/esm2022/textarea/index.mjs +1 -1
- package/esm2022/textarea/textarea.component.mjs +4 -7
- package/esm2022/textarea/textarea.module.mjs +1 -1
- package/esm2022/timepicker/public-api.mjs +2 -2
- package/esm2022/timepicker/timepicker.constants.mjs +6 -2
- package/esm2022/timepicker/timepicker.directive.mjs +62 -31
- package/esm2022/timepicker/timepicker.module.mjs +1 -1
- package/esm2022/timezone/cities-by-filter.pipe.mjs +1 -1
- package/esm2022/timezone/timezone-option.component.mjs +12 -11
- package/esm2022/timezone/timezone-option.directive.mjs +3 -3
- package/esm2022/timezone/timezone-select.component.mjs +5 -5
- package/esm2022/timezone/timezone.models.mjs +1 -2
- package/esm2022/timezone/timezone.module.mjs +1 -1
- package/esm2022/timezone/timezone.utils.mjs +5 -9
- package/esm2022/timezone/utc-offset.pipe.mjs +1 -1
- package/esm2022/title/public-api.mjs +2 -2
- package/esm2022/title/title.directive.mjs +9 -5
- package/esm2022/title/title.module.mjs +1 -1
- package/esm2022/toast/public-api.mjs +4 -4
- package/esm2022/toast/toast-animations.mjs +2 -2
- package/esm2022/toast/toast-container.component.mjs +5 -6
- package/esm2022/toast/toast.component.mjs +6 -6
- package/esm2022/toast/toast.module.mjs +1 -1
- package/esm2022/toast/toast.service.mjs +18 -30
- package/esm2022/toast/toast.type.mjs +1 -1
- package/esm2022/toggle/public-api.mjs +2 -2
- package/esm2022/toggle/toggle.component.mjs +17 -11
- package/esm2022/toggle/toggle.module.mjs +1 -1
- package/esm2022/tooltip/public-api.mjs +2 -2
- package/esm2022/tooltip/tooltip.animations.mjs +1 -1
- package/esm2022/tooltip/tooltip.component.mjs +7 -7
- package/esm2022/tooltip/tooltip.module.mjs +2 -2
- package/esm2022/tree/control/base-tree-control.mjs +1 -2
- package/esm2022/tree/control/flat-tree-control.filters.mjs +4 -7
- package/esm2022/tree/control/flat-tree-control.mjs +4 -7
- package/esm2022/tree/control/nested-tree-control.mjs +1 -2
- package/esm2022/tree/control/tree-control.mjs +1 -1
- package/esm2022/tree/data-source/flat-data-source.mjs +3 -8
- package/esm2022/tree/data-source/nested-data-source.mjs +2 -4
- package/esm2022/tree/node.mjs +1 -1
- package/esm2022/tree/outlet.mjs +1 -1
- package/esm2022/tree/padding.directive.mjs +4 -5
- package/esm2022/tree/public-api.mjs +11 -11
- package/esm2022/tree/toggle.mjs +8 -5
- package/esm2022/tree/tree-base.mjs +3 -7
- package/esm2022/tree/tree-errors.mjs +1 -1
- package/esm2022/tree/tree-option.component.mjs +9 -13
- package/esm2022/tree/tree-selection.component.mjs +20 -36
- package/esm2022/tree/tree.mjs +7 -3
- package/esm2022/tree/tree.module.mjs +2 -3
- package/esm2022/tree-select/public-api.mjs +2 -2
- package/esm2022/tree-select/tree-select.component.mjs +59 -72
- package/esm2022/tree-select/tree-select.module.mjs +1 -1
- package/fesm2022/koobiq-components-alert.mjs +10 -6
- package/fesm2022/koobiq-components-alert.mjs.map +1 -1
- package/fesm2022/koobiq-components-autocomplete.mjs +60 -72
- package/fesm2022/koobiq-components-autocomplete.mjs.map +1 -1
- package/fesm2022/koobiq-components-badge.mjs +10 -8
- package/fesm2022/koobiq-components-badge.mjs.map +1 -1
- package/fesm2022/koobiq-components-button-toggle.mjs +30 -24
- package/fesm2022/koobiq-components-button-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-button.mjs +14 -11
- package/fesm2022/koobiq-components-button.mjs.map +1 -1
- package/fesm2022/koobiq-components-card.mjs +4 -5
- package/fesm2022/koobiq-components-card.mjs.map +1 -1
- package/fesm2022/koobiq-components-checkbox.mjs +3 -5
- package/fesm2022/koobiq-components-checkbox.mjs.map +1 -1
- package/fesm2022/koobiq-components-code-block.mjs +39 -34
- package/fesm2022/koobiq-components-code-block.mjs.map +1 -1
- package/fesm2022/koobiq-components-core.mjs +325 -336
- package/fesm2022/koobiq-components-core.mjs.map +1 -1
- package/fesm2022/koobiq-components-datepicker.mjs +105 -111
- package/fesm2022/koobiq-components-datepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-divider.mjs.map +1 -1
- package/fesm2022/koobiq-components-dl.mjs +9 -9
- package/fesm2022/koobiq-components-dl.mjs.map +1 -1
- package/fesm2022/koobiq-components-dropdown.mjs +125 -147
- package/fesm2022/koobiq-components-dropdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-ellipsis-center.mjs +3 -2
- package/fesm2022/koobiq-components-ellipsis-center.mjs.map +1 -1
- package/fesm2022/koobiq-components-empty-state.mjs +157 -0
- package/fesm2022/koobiq-components-empty-state.mjs.map +1 -0
- package/fesm2022/koobiq-components-file-upload.mjs +46 -41
- package/fesm2022/koobiq-components-file-upload.mjs.map +1 -1
- package/fesm2022/koobiq-components-form-field.mjs +75 -73
- package/fesm2022/koobiq-components-form-field.mjs.map +1 -1
- package/fesm2022/koobiq-components-icon.mjs +9 -10
- package/fesm2022/koobiq-components-icon.mjs.map +1 -1
- package/fesm2022/koobiq-components-input.mjs +56 -60
- package/fesm2022/koobiq-components-input.mjs.map +1 -1
- package/fesm2022/koobiq-components-link.mjs +1 -1
- package/fesm2022/koobiq-components-link.mjs.map +1 -1
- package/fesm2022/koobiq-components-list.mjs +43 -49
- package/fesm2022/koobiq-components-list.mjs.map +1 -1
- package/fesm2022/koobiq-components-loader-overlay.mjs +6 -6
- package/fesm2022/koobiq-components-loader-overlay.mjs.map +1 -1
- package/fesm2022/koobiq-components-markdown.mjs +18 -4
- package/fesm2022/koobiq-components-markdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-modal.mjs +96 -54
- package/fesm2022/koobiq-components-modal.mjs.map +1 -1
- package/fesm2022/koobiq-components-navbar.mjs +82 -86
- package/fesm2022/koobiq-components-navbar.mjs.map +1 -1
- package/fesm2022/koobiq-components-popover.mjs +12 -12
- package/fesm2022/koobiq-components-popover.mjs.map +1 -1
- package/fesm2022/koobiq-components-progress-bar.mjs +5 -5
- package/fesm2022/koobiq-components-progress-bar.mjs.map +1 -1
- package/fesm2022/koobiq-components-progress-spinner.mjs +5 -5
- package/fesm2022/koobiq-components-progress-spinner.mjs.map +1 -1
- package/fesm2022/koobiq-components-radio.mjs +11 -16
- package/fesm2022/koobiq-components-radio.mjs.map +1 -1
- package/fesm2022/koobiq-components-risk-level.mjs +4 -4
- package/fesm2022/koobiq-components-risk-level.mjs.map +1 -1
- package/fesm2022/koobiq-components-scrollbar.mjs +22 -24
- package/fesm2022/koobiq-components-scrollbar.mjs.map +1 -1
- package/fesm2022/koobiq-components-select.mjs +55 -78
- package/fesm2022/koobiq-components-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-sidebar.mjs +5 -7
- package/fesm2022/koobiq-components-sidebar.mjs.map +1 -1
- package/fesm2022/koobiq-components-sidepanel.mjs +110 -93
- package/fesm2022/koobiq-components-sidepanel.mjs.map +1 -1
- package/fesm2022/koobiq-components-splitter.mjs +15 -26
- package/fesm2022/koobiq-components-splitter.mjs.map +1 -1
- package/fesm2022/koobiq-components-table.mjs +5 -5
- package/fesm2022/koobiq-components-table.mjs.map +1 -1
- package/fesm2022/koobiq-components-tabs.mjs +85 -98
- package/fesm2022/koobiq-components-tabs.mjs.map +1 -1
- package/fesm2022/koobiq-components-tags.mjs +39 -56
- package/fesm2022/koobiq-components-tags.mjs.map +1 -1
- package/fesm2022/koobiq-components-textarea.mjs +2 -5
- package/fesm2022/koobiq-components-textarea.mjs.map +1 -1
- package/fesm2022/koobiq-components-timepicker.mjs +69 -34
- package/fesm2022/koobiq-components-timepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-timezone.mjs +16 -21
- package/fesm2022/koobiq-components-timezone.mjs.map +1 -1
- package/fesm2022/koobiq-components-title.mjs +11 -7
- package/fesm2022/koobiq-components-title.mjs.map +1 -1
- package/fesm2022/koobiq-components-toast.mjs +74 -87
- package/fesm2022/koobiq-components-toast.mjs.map +1 -1
- package/fesm2022/koobiq-components-toggle.mjs +17 -11
- package/fesm2022/koobiq-components-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-tooltip.mjs +10 -10
- package/fesm2022/koobiq-components-tooltip.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree-select.mjs +67 -80
- package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree.mjs +509 -541
- package/fesm2022/koobiq-components-tree.mjs.map +1 -1
- package/file-upload/_file-upload-theme.scss +28 -18
- package/file-upload/file-upload.scss +0 -1
- package/file-upload/multiple-file-upload.component.d.ts +2 -2
- package/file-upload/multiple-file-upload.component.scss +17 -27
- package/file-upload/public-api.d.ts +1 -1
- package/file-upload/single-file-upload.component.d.ts +2 -2
- package/file-upload/single-file-upload.component.scss +1 -7
- package/form-field/_form-field-theme.scss +24 -12
- package/form-field/_hint-theme.scss +0 -2
- package/form-field/cleaner.scss +0 -1
- package/form-field/form-field.scss +12 -14
- package/form-field/hint.scss +0 -1
- package/form-field/password-toggle.scss +0 -1
- package/form-field/public-api.d.ts +3 -3
- package/form-field/stepper.scss +0 -1
- package/icon/_icon-button-theme.scss +18 -7
- package/icon/_icon-theme.scss +0 -1
- package/icon/icon-button.scss +2 -5
- package/icon/icon-item.scss +2 -5
- package/icon/icon.scss +0 -1
- package/icon/public-api.d.ts +2 -2
- package/input/_input-theme.scss +0 -1
- package/input/input.scss +9 -9
- package/input/public-api.d.ts +2 -2
- package/link/_link-theme.scss +12 -18
- package/link/link.component.d.ts +1 -1
- package/link/public-api.d.ts +1 -1
- package/list/_list-theme.scss +0 -1
- package/list/list-selection.component.d.ts +3 -3
- package/list/list.scss +1 -3
- package/list/public-api.d.ts +2 -2
- package/loader-overlay/_loader-overlay-theme.scss +6 -4
- package/loader-overlay/loader-overlay.scss +0 -1
- package/loader-overlay/public-api.d.ts +1 -1
- package/markdown/_markdown-theme.scss +11 -8
- package/markdown/markdown.scss +3 -3
- package/modal/README.md +4 -3
- package/modal/_modal-animation.scss +0 -1
- package/modal/_modal-confirm.scss +0 -1
- package/modal/_modal-theme.scss +8 -9
- package/modal/modal.directive.d.ts +3 -3
- package/modal/modal.scss +9 -15
- package/modal/modal.type.d.ts +2 -2
- package/modal/public-api.d.ts +2 -2
- package/navbar/README.md +21 -20
- package/navbar/_navbar-item_horizontal.scss +31 -24
- package/navbar/_navbar-item_vertical.scss +0 -3
- package/navbar/_navbar-theme.scss +3 -6
- package/navbar/navbar-brand.scss +0 -1
- package/navbar/navbar-divider.scss +0 -1
- package/navbar/navbar-item.component.d.ts +1 -1
- package/navbar/navbar-item.scss +9 -2
- package/navbar/navbar.scss +0 -1
- package/navbar/public-api.d.ts +2 -2
- package/navbar/vertical-navbar.scss +0 -1
- package/package.json +12 -6
- package/popover/README.md +17 -14
- package/popover/_popover-theme.scss +0 -1
- package/popover/popover.component.d.ts +1 -1
- package/popover/popover.scss +5 -13
- package/popover/public-api.d.ts +2 -2
- package/prebuilt-themes/dark-theme.css +1 -1
- package/prebuilt-themes/light-theme.css +1 -1
- package/progress-bar/_progress-bar-theme.scss +0 -1
- package/progress-bar/progress-bar.scss +0 -1
- package/progress-bar/public-api.d.ts +1 -1
- package/progress-spinner/_progress-spinner-theme.scss +0 -1
- package/progress-spinner/progress-spinner.scss +0 -1
- package/progress-spinner/public-api.d.ts +1 -1
- package/radio/_radio-theme.scss +13 -5
- package/radio/public-api.d.ts +1 -1
- package/radio/radio.scss +20 -6
- package/risk-level/_risk-level-theme.scss +0 -1
- package/risk-level/public-api.d.ts +1 -1
- package/risk-level/risk-level.component.scss +1 -4
- package/schematics/ng-add/index.js +4 -4
- package/scrollbar/_scrollbar-component-theme.scss +2 -3
- package/scrollbar/public-api.d.ts +1 -1
- package/scrollbar/scrollbar.component.scss +56 -44
- package/scrollbar/scrollbar.directive.d.ts +1 -1
- package/scrollbar/scrollbar.types.d.ts +1 -1
- package/select/_select-theme.scss +0 -1
- package/select/public-api.d.ts +2 -2
- package/select/select.component.d.ts +4 -1
- package/select/select.scss +0 -1
- package/sidebar/public-api.d.ts +1 -1
- package/sidepanel/_sidepanel-theme.scss +0 -1
- package/sidepanel/public-api.d.ts +3 -3
- package/sidepanel/sidepanel.scss +6 -12
- package/splitter/_splitter-theme.scss +0 -1
- package/splitter/public-api.d.ts +1 -1
- package/splitter/splitter.component.d.ts +2 -2
- package/splitter/splitter.scss +0 -1
- package/table/_table-theme.scss +7 -7
- package/table/public-api.d.ts +1 -1
- package/table/table.scss +2 -2
- package/tabs/_tabs-common.scss +10 -8
- package/tabs/_tabs-theme.scss +0 -1
- package/tabs/paginated-tab-header.d.ts +1 -1
- package/tabs/public-api.d.ts +5 -5
- package/tabs/tab-body.component.d.ts +3 -3
- package/tabs/tab-group.component.d.ts +1 -1
- package/tabs/tab-group.scss +0 -1
- package/tabs/tab-header.scss +0 -6
- package/tabs/tab-nav-bar/tab-nav-bar.d.ts +17 -17
- package/tabs/tab-nav-bar/tab-nav-bar.scss +0 -1
- package/tags/_tag-theme.scss +0 -2
- package/tags/public-api.d.ts +4 -4
- package/tags/tag-input.d.ts +1 -1
- package/tags/tag-list.scss +9 -7
- package/tags/tag.component.d.ts +2 -2
- package/tags/tag.scss +1 -4
- package/textarea/_textarea-theme.scss +0 -1
- package/textarea/textarea.component.d.ts +1 -1
- package/textarea/textarea.scss +1 -4
- package/timepicker/public-api.d.ts +1 -1
- package/timepicker/timepicker.constants.d.ts +2 -0
- package/timepicker/timepicker.directive.d.ts +10 -3
- package/timepicker/timepicker.scss +0 -1
- package/timezone/_timezone-option-theme.scss +0 -1
- package/timezone/timezone-option.component.scss +0 -1
- package/timezone/timezone-option.directive.d.ts +1 -1
- package/timezone/timezone-select.component.scss +0 -1
- package/timezone/timezone.utils.d.ts +1 -1
- package/title/public-api.d.ts +1 -1
- package/title/title.directive.d.ts +2 -2
- package/toast/_toast-theme.scss +0 -2
- package/toast/public-api.d.ts +3 -3
- package/toast/toast-container.component.scss +0 -1
- package/toast/toast.component.scss +4 -2
- package/toast/toast.service.d.ts +2 -2
- package/toast/toast.type.d.ts +1 -1
- package/toggle/_toggle-theme.scss +10 -9
- package/toggle/public-api.d.ts +1 -1
- package/toggle/toggle.component.d.ts +2 -2
- package/toggle/toggle.scss +0 -1
- package/tooltip/_tooltip-theme.scss +0 -1
- package/tooltip/public-api.d.ts +1 -1
- package/tooltip/tooltip.component.d.ts +2 -2
- package/tooltip/tooltip.scss +1 -5
- package/tree/_tree-theme.scss +2 -3
- package/tree/public-api.d.ts +10 -10
- package/tree/toggle.scss +0 -1
- package/tree/tree-base.d.ts +1 -1
- package/tree/tree-option.component.d.ts +1 -1
- package/tree/tree-option.scss +12 -8
- package/tree/tree-selection.component.d.ts +3 -2
- package/tree-select/_tree-select-theme.scss +0 -1
- package/tree-select/public-api.d.ts +1 -1
- package/tree-select/tree-select.component.d.ts +9 -4
- package/tree-select/tree-select.scss +0 -1
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import { A11yModule } from '@angular/cdk/a11y';
|
|
2
|
-
import * as i3$1 from '@angular/cdk/overlay';
|
|
3
|
-
import { Overlay, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
|
|
4
|
-
import { ComponentPortal, PortalModule } from '@angular/cdk/portal';
|
|
5
|
-
import * as i1 from '@angular/common';
|
|
6
|
-
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
7
1
|
import * as i0 from '@angular/core';
|
|
8
2
|
import { EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, Output, Injectable, Optional, ViewChild, InjectionToken, Inject, forwardRef, Directive, ContentChild, NgModule } from '@angular/core';
|
|
9
|
-
import * as
|
|
10
|
-
import {
|
|
11
|
-
import * as i6 from '@koobiq/components/icon';
|
|
12
|
-
import { KbqIconModule } from '@koobiq/components/icon';
|
|
13
|
-
import * as i5 from '@koobiq/components/select';
|
|
14
|
-
import { KbqSelectModule } from '@koobiq/components/select';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
15
5
|
import * as i1$1 from '@koobiq/components/core';
|
|
16
6
|
import { validationTooltipShowDelay, validationTooltipHideDelay, KBQ_DATE_FORMATS, KBQ_LOCALE_SERVICE } from '@koobiq/components/core';
|
|
7
|
+
import * as i3 from '@koobiq/components/button';
|
|
8
|
+
import { KbqButtonModule } from '@koobiq/components/button';
|
|
17
9
|
import * as i4 from '@koobiq/components/form-field';
|
|
18
10
|
import { KbqFormFieldControl } from '@koobiq/components/form-field';
|
|
11
|
+
import * as i5 from '@koobiq/components/select';
|
|
12
|
+
import { KbqSelectModule } from '@koobiq/components/select';
|
|
13
|
+
import * as i6 from '@koobiq/components/icon';
|
|
14
|
+
import { KbqIconModule } from '@koobiq/components/icon';
|
|
19
15
|
import { Subject, Subscription, merge, of } from 'rxjs';
|
|
16
|
+
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
20
17
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
21
18
|
import { NG_VALUE_ACCESSOR, NG_VALIDATORS, Validators } from '@angular/forms';
|
|
22
19
|
import { TAB, SPACE, UP_ARROW, DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW, HOME, PAGE_UP, END, PAGE_DOWN, ESCAPE, isLetterKey, hasModifierKey, isVerticalMovement, isHorizontalMovement, DELETE, BACKSPACE } from '@koobiq/cdk/keycodes';
|
|
23
20
|
import '@koobiq/components/tooltip';
|
|
24
21
|
import * as i5$1 from '@angular/cdk/bidi';
|
|
22
|
+
import * as i3$1 from '@angular/cdk/overlay';
|
|
23
|
+
import { Overlay, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
|
|
24
|
+
import { ComponentPortal, PortalModule } from '@angular/cdk/portal';
|
|
25
25
|
import { take } from 'rxjs/operators';
|
|
26
|
-
import {
|
|
26
|
+
import { A11yModule } from '@angular/cdk/a11y';
|
|
27
27
|
|
|
28
|
-
// tslint:disable:no-magic-numbers
|
|
29
28
|
/**
|
|
30
29
|
* An internal class that represents the data corresponding to a single calendar cell.
|
|
31
30
|
* @docs-private
|
|
@@ -63,7 +62,6 @@ class KbqCalendarBody {
|
|
|
63
62
|
}
|
|
64
63
|
ngOnChanges(changes) {
|
|
65
64
|
const columnChanges = changes.numCols;
|
|
66
|
-
// tslint:disable-next-line:no-this-assignment
|
|
67
65
|
const { rows, numCols } = this;
|
|
68
66
|
if (changes.rows || columnChanges) {
|
|
69
67
|
this.firstRowOffset = rows && rows.length && rows[0].length ? numCols - rows[0].length : 0;
|
|
@@ -86,13 +84,13 @@ class KbqCalendarBody {
|
|
|
86
84
|
return cellNumber === this.activeCell;
|
|
87
85
|
}
|
|
88
86
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: KbqCalendarBody, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
89
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.0", type: KbqCalendarBody, selector: "[kbq-calendar-body]", inputs: { rows: "rows", todayValue: "todayValue", selectedValue: "selectedValue", labelMinRequiredCells: "labelMinRequiredCells", numCols: "numCols", activeCell: "activeCell", cellAspectRatio: "cellAspectRatio" }, outputs: { selectedValueChange: "selectedValueChange" }, host: { classAttribute: "kbq-calendar__body" }, exportAs: ["kbqCalendarBody"], usesOnChanges: true, ngImport: i0, template: "<!-- Create the first row separately so we can include a special spacer cell. -->\n<tr *ngFor=\"let row of rows; let rowIndex = index\">\n <!--\n We mark this cell as aria-hidden so it doesn't get read out as one of the days in the week.\n The aspect ratio of the table cells is maintained by setting the top and bottom padding as a\n percentage of the width (a variant of the trick described here:\n https://www.w3schools.com/howto/howto_css_aspect_ratio.asp).\n -->\n <td
|
|
87
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.0", type: KbqCalendarBody, selector: "[kbq-calendar-body]", inputs: { rows: "rows", todayValue: "todayValue", selectedValue: "selectedValue", labelMinRequiredCells: "labelMinRequiredCells", numCols: "numCols", activeCell: "activeCell", cellAspectRatio: "cellAspectRatio" }, outputs: { selectedValueChange: "selectedValueChange" }, host: { classAttribute: "kbq-calendar__body" }, exportAs: ["kbqCalendarBody"], usesOnChanges: true, ngImport: i0, template: "<!-- Create the first row separately so we can include a special spacer cell. -->\n<tr *ngFor=\"let row of rows; let rowIndex = index\">\n <!--\n We mark this cell as aria-hidden so it doesn't get read out as one of the days in the week.\n The aspect ratio of the table cells is maintained by setting the top and bottom padding as a\n percentage of the width (a variant of the trick described here:\n https://www.w3schools.com/howto/howto_css_aspect_ratio.asp).\n -->\n <td\n *ngIf=\"rowIndex === 0 && firstRowOffset\"\n class=\"kbq-calendar__body-label\"\n [attr.colspan]=\"firstRowOffset\"\n ></td>\n\n <td\n *ngFor=\"let item of row; let colIndex = index\"\n class=\"kbq-calendar__body-cell\"\n [class.kbq-calendar__body_active]=\"isActiveCell(rowIndex, colIndex)\"\n [ngClass]=\"item.cssClasses!\"\n [style.paddingBottom]=\"cellPadding\"\n [style.paddingTop]=\"cellPadding\"\n [style.width]=\"cellWidth\"\n [tabindex]=\"isActiveCell(rowIndex, colIndex) ? 0 : -1\"\n (click)=\"cellClicked(item)\"\n >\n <div\n class=\"kbq-calendar__body-cell-content\"\n [class.kbq-calendar__body-today]=\"todayValue === item.value\"\n [class.kbq-disabled]=\"!item.enabled\"\n [class.kbq-selected]=\"selectedValue === item.value\"\n >\n {{ item.displayValue }}\n </div>\n </td>\n</tr>\n", styles: [".kbq-calendar__body-cell{position:relative;height:0;line-height:0;text-align:center;outline:none;cursor:pointer;padding:0}.kbq-disabled{cursor:default}.kbq-calendar__body-cell-content{display:flex;align-items:center;justify-content:center;box-sizing:border-box;height:32px;line-height:1;border-radius:var(--kbq-datepicker-size-grid-cell-border-radius, 8px);margin-bottom:var(--kbq-datepicker-size-grid-content-gap-vertical, 2px)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
90
88
|
}
|
|
91
89
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: KbqCalendarBody, decorators: [{
|
|
92
90
|
type: Component,
|
|
93
91
|
args: [{ selector: '[kbq-calendar-body]', exportAs: 'kbqCalendarBody', host: {
|
|
94
92
|
class: 'kbq-calendar__body'
|
|
95
|
-
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- Create the first row separately so we can include a special spacer cell. -->\n<tr *ngFor=\"let row of rows; let rowIndex = index\">\n <!--\n We mark this cell as aria-hidden so it doesn't get read out as one of the days in the week.\n The aspect ratio of the table cells is maintained by setting the top and bottom padding as a\n percentage of the width (a variant of the trick described here:\n https://www.w3schools.com/howto/howto_css_aspect_ratio.asp).\n -->\n <td
|
|
93
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- Create the first row separately so we can include a special spacer cell. -->\n<tr *ngFor=\"let row of rows; let rowIndex = index\">\n <!--\n We mark this cell as aria-hidden so it doesn't get read out as one of the days in the week.\n The aspect ratio of the table cells is maintained by setting the top and bottom padding as a\n percentage of the width (a variant of the trick described here:\n https://www.w3schools.com/howto/howto_css_aspect_ratio.asp).\n -->\n <td\n *ngIf=\"rowIndex === 0 && firstRowOffset\"\n class=\"kbq-calendar__body-label\"\n [attr.colspan]=\"firstRowOffset\"\n ></td>\n\n <td\n *ngFor=\"let item of row; let colIndex = index\"\n class=\"kbq-calendar__body-cell\"\n [class.kbq-calendar__body_active]=\"isActiveCell(rowIndex, colIndex)\"\n [ngClass]=\"item.cssClasses!\"\n [style.paddingBottom]=\"cellPadding\"\n [style.paddingTop]=\"cellPadding\"\n [style.width]=\"cellWidth\"\n [tabindex]=\"isActiveCell(rowIndex, colIndex) ? 0 : -1\"\n (click)=\"cellClicked(item)\"\n >\n <div\n class=\"kbq-calendar__body-cell-content\"\n [class.kbq-calendar__body-today]=\"todayValue === item.value\"\n [class.kbq-disabled]=\"!item.enabled\"\n [class.kbq-selected]=\"selectedValue === item.value\"\n >\n {{ item.displayValue }}\n </div>\n </td>\n</tr>\n", styles: [".kbq-calendar__body-cell{position:relative;height:0;line-height:0;text-align:center;outline:none;cursor:pointer;padding:0}.kbq-disabled{cursor:default}.kbq-calendar__body-cell-content{display:flex;align-items:center;justify-content:center;box-sizing:border-box;height:32px;line-height:1;border-radius:var(--kbq-datepicker-size-grid-cell-border-radius, 8px);margin-bottom:var(--kbq-datepicker-size-grid-content-gap-vertical, 2px)}\n"] }]
|
|
96
94
|
}], propDecorators: { rows: [{
|
|
97
95
|
type: Input
|
|
98
96
|
}], todayValue: [{
|
|
@@ -151,15 +149,13 @@ class KbqCalendarHeader {
|
|
|
151
149
|
constructor(adapter) {
|
|
152
150
|
this.adapter = adapter;
|
|
153
151
|
this.years = [];
|
|
154
|
-
// tslint:disable-next-line:no-magic-numbers
|
|
155
152
|
this._maxDate = this.adapter.createDate(defaultMaxYear, 11);
|
|
156
153
|
this._minDate = this.adapter.createDate(defaultMinYear, 1);
|
|
157
154
|
/** Emits when any date is activated. */
|
|
158
155
|
this.activeDateChange = new EventEmitter();
|
|
159
156
|
this.monthSelected = new EventEmitter();
|
|
160
157
|
this.yearSelected = new EventEmitter();
|
|
161
|
-
this.monthNames = this.adapter.getMonthNames('long')
|
|
162
|
-
.map((name, i) => ({ name, value: i }));
|
|
158
|
+
this.monthNames = this.adapter.getMonthNames('long').map((name, i) => ({ name, value: i }));
|
|
163
159
|
}
|
|
164
160
|
ngAfterContentInit() {
|
|
165
161
|
this.updateYearsArray();
|
|
@@ -204,8 +200,10 @@ class KbqCalendarHeader {
|
|
|
204
200
|
updateSelectedValues() {
|
|
205
201
|
this.selectedMonth = this.monthNames[this.adapter.getMonth(this.activeDate)].value;
|
|
206
202
|
const year = this.adapter.getYear(this.activeDate);
|
|
207
|
-
this.selectedYear = this.years.find(({ name }) => name === year)
|
|
208
|
-
|
|
203
|
+
this.selectedYear = this.years.find(({ name }) => name === year) || {
|
|
204
|
+
name: year,
|
|
205
|
+
value: this.adapter.getYearName(this.activeDate)
|
|
206
|
+
};
|
|
209
207
|
}
|
|
210
208
|
updateYearsArray() {
|
|
211
209
|
const minYear = this.adapter.getYear(this.minDate);
|
|
@@ -216,13 +214,13 @@ class KbqCalendarHeader {
|
|
|
216
214
|
}
|
|
217
215
|
}
|
|
218
216
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: KbqCalendarHeader, deps: [{ token: i1$1.DateAdapter }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
219
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.0", type: KbqCalendarHeader, selector: "kbq-calendar-header", inputs: { activeDate: "activeDate", maxDate: "maxDate", minDate: "minDate" }, outputs: { activeDateChange: "activeDateChange", monthSelected: "monthSelected", yearSelected: "yearSelected" }, host: { classAttribute: "kbq-calendar-header" }, exportAs: ["kbqCalendarHeader"], ngImport: i0, template: "<div class=\"kbq-calendar-header__select-group\">\n <kbq-select\n
|
|
217
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.0", type: KbqCalendarHeader, selector: "kbq-calendar-header", inputs: { activeDate: "activeDate", maxDate: "maxDate", minDate: "minDate" }, outputs: { activeDateChange: "activeDateChange", monthSelected: "monthSelected", yearSelected: "yearSelected" }, host: { classAttribute: "kbq-calendar-header" }, exportAs: ["kbqCalendarHeader"], ngImport: i0, template: "<div class=\"kbq-calendar-header__select-group\">\n <kbq-select\n #monthSelect=\"kbqSelect\"\n class=\"kbq-calendar-header__select\"\n [panelClass]=\"'kbq-calendar-select-panel'\"\n [value]=\"selectedMonth\"\n (selectionChange)=\"onMonthSelected($event.value)\"\n >\n <button\n kbq-button\n kbq-select-matcher\n class=\"layout-padding-right-xs\"\n [class.kbq-active]=\"monthSelect.panelOpen\"\n [color]=\"'contrast'\"\n [kbqStyle]=\"'transparent'\"\n [tabindex]=\"-1\"\n >\n {{ monthSelect.triggerValue }}\n\n <i\n kbq-icon=\"mc-angle-down-S_16\"\n class=\"layout-padding-left-3xs\"\n [color]=\"'contrast'\"\n ></i>\n </button>\n\n <kbq-option\n *ngFor=\"let month of monthNames\"\n [kbqTooltipDisabled]=\"true\"\n [value]=\"month.value\"\n >\n {{ month.name }}\n </kbq-option>\n </kbq-select>\n\n <kbq-select\n #yearSelect=\"kbqSelect\"\n [panelClass]=\"'kbq-calendar-select-panel'\"\n [value]=\"selectedYear\"\n (selectionChange)=\"onYearSelected($event.value.name)\"\n >\n <button\n kbq-button\n kbq-select-matcher\n class=\"layout-padding-right-xs\"\n [class.kbq-active]=\"yearSelect.panelOpen\"\n [color]=\"'contrast'\"\n [kbqStyle]=\"'transparent'\"\n [tabindex]=\"-1\"\n >\n {{ selectedYear.value }}\n\n <i\n kbq-icon=\"mc-angle-down-S_16\"\n class=\"layout-padding-left-3xs\"\n ></i>\n </button>\n\n <kbq-option\n *ngFor=\"let year of years\"\n [kbqTooltipDisabled]=\"true\"\n [value]=\"year\"\n >\n {{ year.value }}\n </kbq-option>\n </kbq-select>\n</div>\n\n<div class=\"kbq-calendar-header__button-group\">\n <button\n kbq-button\n class=\"kbq-calendar-header__previous-button\"\n [color]=\"'contrast'\"\n [disabled]=\"previousDisabled\"\n [kbqStyle]=\"'transparent'\"\n [tabindex]=\"-1\"\n (click)=\"selectPreviousMonth()\"\n >\n <i kbq-icon=\"mc-angle-left-L_16\"></i>\n </button>\n\n <button\n kbq-button\n [color]=\"'contrast'\"\n [kbqStyle]=\"'transparent'\"\n [tabindex]=\"-1\"\n (click)=\"selectCurrentDate()\"\n >\n <i kbq-icon=\"mc-circle-8_16\"></i>\n </button>\n\n <button\n kbq-button\n class=\"kbq-calendar-header__next-button\"\n [color]=\"'contrast'\"\n [disabled]=\"nextDisabled\"\n [kbqStyle]=\"'transparent'\"\n [tabindex]=\"-1\"\n (click)=\"selectNextMonth()\"\n >\n <i kbq-icon=\"mc-angle-right-L_16\"></i>\n </button>\n</div>\n", styles: [".kbq-calendar-header{display:flex;flex-direction:row;justify-content:space-between;padding-right:var(--kbq-datepicker-size-header-padding-horizontal, 4px);padding-left:var(--kbq-datepicker-size-header-padding-horizontal, 4px);margin-bottom:var(--kbq-datepicker-size-header-margin-bottom, 2px)}.kbq-calendar-header__select{width:auto!important}.kbq-calendar-header__button-group,.kbq-calendar-header__select-group{display:flex;flex-direction:row}.kbq-calendar-select-panel{margin-top:2px;min-width:98%!important}.kbq-calendar-select-panel .kbq-select__content{max-height:384px;overflow-x:hidden;scrollbar-gutter:auto}.kbq-calendar-select-panel .kbq-select__content .kbq-option{min-width:65px}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i3.KbqButton, selector: "[kbq-button]", inputs: ["color", "tabIndex", "kbqStyle", "disabled"] }, { kind: "directive", type: i3.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "directive", type: i4.KbqValidateDirective, selector: " input[kbqInput], input[kbqInputPassword], input[kbqTimepicker], input[kbqDatepicker], textarea[kbqTextarea], kbq-select, kbq-tree-select, kbq-tag-list ", exportAs: ["KbqValidate"] }, { kind: "component", type: i5.KbqSelect, selector: "kbq-select", inputs: ["disabled", "tabIndex", "hiddenItemsText", "panelClass", "backdropClass", "errorStateMatcher", "sortComparator", "hasBackdrop", "placeholder", "required", "multiple", "compareWith", "value", "id", "hiddenItemsTextFormatter"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["kbqSelect"] }, { kind: "directive", type: i5.KbqOptionTooltip, selector: "kbq-option" }, { kind: "component", type: i1$1.KbqOption, selector: "kbq-option", inputs: ["value", "showCheckbox", "disabled"], outputs: ["onSelectionChange"], exportAs: ["kbqOption"] }, { kind: "directive", type: i1$1.KbqSelectMatcher, selector: "kbq-select-matcher, [kbq-select-matcher]" }, { kind: "component", type: i6.KbqIcon, selector: "[kbq-icon]", inputs: ["color", "small", "autoColor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
220
218
|
}
|
|
221
219
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: KbqCalendarHeader, decorators: [{
|
|
222
220
|
type: Component,
|
|
223
221
|
args: [{ selector: 'kbq-calendar-header', exportAs: 'kbqCalendarHeader', host: {
|
|
224
222
|
class: 'kbq-calendar-header'
|
|
225
|
-
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"kbq-calendar-header__select-group\">\n <kbq-select\n
|
|
223
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"kbq-calendar-header__select-group\">\n <kbq-select\n #monthSelect=\"kbqSelect\"\n class=\"kbq-calendar-header__select\"\n [panelClass]=\"'kbq-calendar-select-panel'\"\n [value]=\"selectedMonth\"\n (selectionChange)=\"onMonthSelected($event.value)\"\n >\n <button\n kbq-button\n kbq-select-matcher\n class=\"layout-padding-right-xs\"\n [class.kbq-active]=\"monthSelect.panelOpen\"\n [color]=\"'contrast'\"\n [kbqStyle]=\"'transparent'\"\n [tabindex]=\"-1\"\n >\n {{ monthSelect.triggerValue }}\n\n <i\n kbq-icon=\"mc-angle-down-S_16\"\n class=\"layout-padding-left-3xs\"\n [color]=\"'contrast'\"\n ></i>\n </button>\n\n <kbq-option\n *ngFor=\"let month of monthNames\"\n [kbqTooltipDisabled]=\"true\"\n [value]=\"month.value\"\n >\n {{ month.name }}\n </kbq-option>\n </kbq-select>\n\n <kbq-select\n #yearSelect=\"kbqSelect\"\n [panelClass]=\"'kbq-calendar-select-panel'\"\n [value]=\"selectedYear\"\n (selectionChange)=\"onYearSelected($event.value.name)\"\n >\n <button\n kbq-button\n kbq-select-matcher\n class=\"layout-padding-right-xs\"\n [class.kbq-active]=\"yearSelect.panelOpen\"\n [color]=\"'contrast'\"\n [kbqStyle]=\"'transparent'\"\n [tabindex]=\"-1\"\n >\n {{ selectedYear.value }}\n\n <i\n kbq-icon=\"mc-angle-down-S_16\"\n class=\"layout-padding-left-3xs\"\n ></i>\n </button>\n\n <kbq-option\n *ngFor=\"let year of years\"\n [kbqTooltipDisabled]=\"true\"\n [value]=\"year\"\n >\n {{ year.value }}\n </kbq-option>\n </kbq-select>\n</div>\n\n<div class=\"kbq-calendar-header__button-group\">\n <button\n kbq-button\n class=\"kbq-calendar-header__previous-button\"\n [color]=\"'contrast'\"\n [disabled]=\"previousDisabled\"\n [kbqStyle]=\"'transparent'\"\n [tabindex]=\"-1\"\n (click)=\"selectPreviousMonth()\"\n >\n <i kbq-icon=\"mc-angle-left-L_16\"></i>\n </button>\n\n <button\n kbq-button\n [color]=\"'contrast'\"\n [kbqStyle]=\"'transparent'\"\n [tabindex]=\"-1\"\n (click)=\"selectCurrentDate()\"\n >\n <i kbq-icon=\"mc-circle-8_16\"></i>\n </button>\n\n <button\n kbq-button\n class=\"kbq-calendar-header__next-button\"\n [color]=\"'contrast'\"\n [disabled]=\"nextDisabled\"\n [kbqStyle]=\"'transparent'\"\n [tabindex]=\"-1\"\n (click)=\"selectNextMonth()\"\n >\n <i kbq-icon=\"mc-angle-right-L_16\"></i>\n </button>\n</div>\n", styles: [".kbq-calendar-header{display:flex;flex-direction:row;justify-content:space-between;padding-right:var(--kbq-datepicker-size-header-padding-horizontal, 4px);padding-left:var(--kbq-datepicker-size-header-padding-horizontal, 4px);margin-bottom:var(--kbq-datepicker-size-header-margin-bottom, 2px)}.kbq-calendar-header__select{width:auto!important}.kbq-calendar-header__button-group,.kbq-calendar-header__select-group{display:flex;flex-direction:row}.kbq-calendar-select-panel{margin-top:2px;min-width:98%!important}.kbq-calendar-select-panel .kbq-select__content{max-height:384px;overflow-x:hidden;scrollbar-gutter:auto}.kbq-calendar-select-panel .kbq-select__content .kbq-option{min-width:65px}\n"] }]
|
|
226
224
|
}], ctorParameters: () => [{ type: i1$1.DateAdapter }], propDecorators: { activeDate: [{
|
|
227
225
|
type: Input
|
|
228
226
|
}], maxDate: [{
|
|
@@ -280,7 +278,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImpor
|
|
|
280
278
|
args: [{ providedIn: 'root' }]
|
|
281
279
|
}] });
|
|
282
280
|
|
|
283
|
-
// tslint:disable:no-magic-numbers
|
|
284
281
|
const DAYS_PER_WEEK = 7;
|
|
285
282
|
/**
|
|
286
283
|
* An internal component used to display a single month in the datepicker.
|
|
@@ -327,9 +324,7 @@ class KbqMonthView {
|
|
|
327
324
|
const weekdays = longWeekdays.map((long, i) => {
|
|
328
325
|
return { long, narrow: narrowWeekdays[i] };
|
|
329
326
|
});
|
|
330
|
-
this.weekdays = weekdays
|
|
331
|
-
.slice(firstDayOfWeek)
|
|
332
|
-
.concat(weekdays.slice(0, firstDayOfWeek));
|
|
327
|
+
this.weekdays = weekdays.slice(firstDayOfWeek).concat(weekdays.slice(0, firstDayOfWeek));
|
|
333
328
|
this._activeDate = this.adapter.today();
|
|
334
329
|
}
|
|
335
330
|
ngAfterContentInit() {
|
|
@@ -350,7 +345,9 @@ class KbqMonthView {
|
|
|
350
345
|
this.selectedDate = this.getDateInCurrentMonth(this.selected);
|
|
351
346
|
this.todayDate = this.getDateInCurrentMonth(this.adapter.today());
|
|
352
347
|
const firstOfMonth = this.adapter.createDate(this.adapter.getYear(this.activeDate), this.adapter.getMonth(this.activeDate));
|
|
353
|
-
this.firstWeekOffset =
|
|
348
|
+
this.firstWeekOffset =
|
|
349
|
+
(DAYS_PER_WEEK + this.adapter.getDayOfWeek(firstOfMonth) - this.adapter.getFirstDayOfWeek()) %
|
|
350
|
+
DAYS_PER_WEEK;
|
|
354
351
|
this.createWeekCells();
|
|
355
352
|
this.changeDetectorRef.markForCheck();
|
|
356
353
|
}
|
|
@@ -367,16 +364,15 @@ class KbqMonthView {
|
|
|
367
364
|
const date = this.adapter.createDate(this.adapter.getYear(this.activeDate), this.adapter.getMonth(this.activeDate), i + 1);
|
|
368
365
|
const enabled = this.shouldEnableDate(date);
|
|
369
366
|
const cellClasses = this.dateClass ? this.dateClass(date) : undefined;
|
|
370
|
-
this.weeks[this.weeks.length - 1]
|
|
371
|
-
.push(new KbqCalendarCell(i + 1, dateNames[i], enabled, cellClasses));
|
|
367
|
+
this.weeks[this.weeks.length - 1].push(new KbqCalendarCell(i + 1, dateNames[i], enabled, cellClasses));
|
|
372
368
|
}
|
|
373
369
|
}
|
|
374
370
|
/** Date filter for the month */
|
|
375
371
|
shouldEnableDate(date) {
|
|
376
|
-
return !!date &&
|
|
372
|
+
return (!!date &&
|
|
377
373
|
(!this.dateFilter || this.dateFilter(date)) &&
|
|
378
374
|
(!this.minDate || this.adapter.compareDate(date, this.minDate) >= 0) &&
|
|
379
|
-
(!this.maxDate || this.adapter.compareDate(date, this.maxDate) <= 0);
|
|
375
|
+
(!this.maxDate || this.adapter.compareDate(date, this.maxDate) <= 0));
|
|
380
376
|
}
|
|
381
377
|
/**
|
|
382
378
|
* Gets the date in this month that the given Date falls on.
|
|
@@ -387,15 +383,17 @@ class KbqMonthView {
|
|
|
387
383
|
}
|
|
388
384
|
/** Checks whether the 2 dates are non-null and fall within the same month of the same year. */
|
|
389
385
|
hasSameMonthAndYear(d1, d2) {
|
|
390
|
-
return !!(d1 &&
|
|
386
|
+
return !!(d1 &&
|
|
387
|
+
d2 &&
|
|
388
|
+
this.adapter.getMonth(d1) === this.adapter.getMonth(d2) &&
|
|
391
389
|
this.adapter.getYear(d1) === this.adapter.getYear(d2));
|
|
392
390
|
}
|
|
393
391
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: KbqMonthView, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$1.DateAdapter, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
394
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.0", type: KbqMonthView, selector: "kbq-month-view", inputs: { activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate", dateFilter: "dateFilter", dateClass: "dateClass" }, outputs: { selectedChange: "selectedChange", userSelection: "userSelection", activeDateChange: "activeDateChange" }, viewQueries: [{ propertyName: "kbqCalendarBody", first: true, predicate: KbqCalendarBody, descendants: true }], exportAs: ["kbqMonthView"], ngImport: i0, template: "<table class=\"kbq-calendar__table\">\n <thead class=\"kbq-calendar__table-header\">\n <tr>\n <th
|
|
392
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.0", type: KbqMonthView, selector: "kbq-month-view", inputs: { activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate", dateFilter: "dateFilter", dateClass: "dateClass" }, outputs: { selectedChange: "selectedChange", userSelection: "userSelection", activeDateChange: "activeDateChange" }, viewQueries: [{ propertyName: "kbqCalendarBody", first: true, predicate: KbqCalendarBody, descendants: true }], exportAs: ["kbqMonthView"], ngImport: i0, template: "<table class=\"kbq-calendar__table\">\n <thead class=\"kbq-calendar__table-header\">\n <tr>\n <th\n *ngFor=\"let day of weekdays\"\n [attr.aria-label]=\"day.long\"\n >\n {{ day.narrow }}\n </th>\n </tr>\n <tr>\n <th\n colspan=\"7\"\n class=\"kbq-calendar__table-header-divider\"\n ></th>\n </tr>\n </thead>\n <tbody\n kbq-calendar-body\n [activeCell]=\"adapter.getDate(activeDate) - 1\"\n [labelMinRequiredCells]=\"3\"\n [rows]=\"weeks\"\n [selectedValue]=\"selectedDate!\"\n [todayValue]=\"todayDate!\"\n (selectedValueChange)=\"dateSelected($event)\"\n ></tbody>\n</table>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: KbqCalendarBody, selector: "[kbq-calendar-body]", inputs: ["rows", "todayValue", "selectedValue", "labelMinRequiredCells", "numCols", "activeCell", "cellAspectRatio"], outputs: ["selectedValueChange"], exportAs: ["kbqCalendarBody"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
395
393
|
}
|
|
396
394
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: KbqMonthView, decorators: [{
|
|
397
395
|
type: Component,
|
|
398
|
-
args: [{ selector: 'kbq-month-view', exportAs: 'kbqMonthView', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<table class=\"kbq-calendar__table\">\n <thead class=\"kbq-calendar__table-header\">\n <tr>\n <th
|
|
396
|
+
args: [{ selector: 'kbq-month-view', exportAs: 'kbqMonthView', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<table class=\"kbq-calendar__table\">\n <thead class=\"kbq-calendar__table-header\">\n <tr>\n <th\n *ngFor=\"let day of weekdays\"\n [attr.aria-label]=\"day.long\"\n >\n {{ day.narrow }}\n </th>\n </tr>\n <tr>\n <th\n colspan=\"7\"\n class=\"kbq-calendar__table-header-divider\"\n ></th>\n </tr>\n </thead>\n <tbody\n kbq-calendar-body\n [activeCell]=\"adapter.getDate(activeDate) - 1\"\n [labelMinRequiredCells]=\"3\"\n [rows]=\"weeks\"\n [selectedValue]=\"selectedDate!\"\n [todayValue]=\"todayDate!\"\n (selectedValueChange)=\"dateSelected($event)\"\n ></tbody>\n</table>\n" }]
|
|
399
397
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$1.DateAdapter, decorators: [{
|
|
400
398
|
type: Optional
|
|
401
399
|
}] }], propDecorators: { activeDate: [{
|
|
@@ -432,8 +430,8 @@ class KbqCalendar {
|
|
|
432
430
|
}
|
|
433
431
|
set startAt(value) {
|
|
434
432
|
const deserializedValue = this.getValidDateOrNull(this.adapter.deserialize(value));
|
|
435
|
-
this._startAt =
|
|
436
|
-
this.adapter.clampDate(deserializedValue, this.minDate, this.maxDate) : null;
|
|
433
|
+
this._startAt =
|
|
434
|
+
deserializedValue !== null ? this.adapter.clampDate(deserializedValue, this.minDate, this.maxDate) : null;
|
|
437
435
|
}
|
|
438
436
|
/** The currently selected date. */
|
|
439
437
|
get selected() {
|
|
@@ -536,19 +534,19 @@ class KbqCalendar {
|
|
|
536
534
|
*/
|
|
537
535
|
// todo выглядит как костыль от которого нужно избавиться
|
|
538
536
|
getValidDateOrNull(obj) {
|
|
539
|
-
return
|
|
537
|
+
return this.adapter.isDateInstance(obj) && this.adapter.isValid(obj) ? obj : null;
|
|
540
538
|
}
|
|
541
539
|
getActiveDateDefault() {
|
|
542
540
|
return this.startAt || this.adapter.today();
|
|
543
541
|
}
|
|
544
542
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: KbqCalendar, deps: [{ token: KbqDatepickerIntl }, { token: i1$1.DateAdapter, optional: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
545
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.0", type: KbqCalendar, selector: "kbq-calendar", inputs: { startAt: "startAt", selected: "selected", minDate: "minDate", maxDate: "maxDate", dateFilter: "dateFilter", dateClass: "dateClass" }, outputs: { selectedChange: "selectedChange", yearSelected: "yearSelected", monthSelected: "monthSelected", userSelection: "userSelection" }, host: { classAttribute: "kbq-calendar" }, viewQueries: [{ propertyName: "monthView", first: true, predicate: KbqMonthView, descendants: true }], exportAs: ["kbqCalendar"], usesOnChanges: true, ngImport: i0, template: "<kbq-calendar-header\n [
|
|
543
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.0", type: KbqCalendar, selector: "kbq-calendar", inputs: { startAt: "startAt", selected: "selected", minDate: "minDate", maxDate: "maxDate", dateFilter: "dateFilter", dateClass: "dateClass" }, outputs: { selectedChange: "selectedChange", yearSelected: "yearSelected", monthSelected: "monthSelected", userSelection: "userSelection" }, host: { classAttribute: "kbq-calendar" }, viewQueries: [{ propertyName: "monthView", first: true, predicate: KbqMonthView, descendants: true }], exportAs: ["kbqCalendar"], usesOnChanges: true, ngImport: i0, template: "<kbq-calendar-header\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [(activeDate)]=\"activeDate\"\n (monthSelected)=\"monthSelected.emit(activeDate)\"\n (yearSelected)=\"yearSelected.emit(activeDate)\"\n/>\n\n<div class=\"kbq-calendar__content\">\n <kbq-month-view\n [dateClass]=\"dateClass\"\n [dateFilter]=\"dateFilter\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"selected\"\n [(activeDate)]=\"activeDate\"\n (selectedChange)=\"dateSelected($event!)\"\n (userSelection)=\"userSelected()\"\n />\n</div>\n", styles: [".kbq-calendar{display:block}.kbq-calendar__content{padding-right:var(--kbq-datepicker-size-grid-padding-horizontal, 12px);padding-left:var(--kbq-datepicker-size-grid-padding-horizontal, 12px);outline:none}.kbq-calendar__table{border-spacing:0;border-collapse:collapse;width:100%}.kbq-calendar__table-header th{text-align:center;height:30px}.kbq-calendar__table-header th.kbq-calendar__table-header-divider{position:relative;box-sizing:border-box;height:var(--kbq-datepicker-size-grid-content-gap-vertical, 2px)}.kbq-calendar__table-header th.kbq-calendar__table-header-divider:after{content:\"\";position:absolute;top:0;left:calc(-1 * var(--kbq-datepicker-size-grid-padding-horizontal, 12px));right:calc(-1 * var(--kbq-datepicker-size-grid-padding-horizontal, 12px));height:var(--kbq-datepicker-size-grid-divider-height, 1px)}\n"], dependencies: [{ kind: "component", type: KbqMonthView, selector: "kbq-month-view", inputs: ["activeDate", "selected", "minDate", "maxDate", "dateFilter", "dateClass"], outputs: ["selectedChange", "userSelection", "activeDateChange"], exportAs: ["kbqMonthView"] }, { kind: "component", type: KbqCalendarHeader, selector: "kbq-calendar-header", inputs: ["activeDate", "maxDate", "minDate"], outputs: ["activeDateChange", "monthSelected", "yearSelected"], exportAs: ["kbqCalendarHeader"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
546
544
|
}
|
|
547
545
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: KbqCalendar, decorators: [{
|
|
548
546
|
type: Component,
|
|
549
547
|
args: [{ selector: 'kbq-calendar', exportAs: 'kbqCalendar', host: {
|
|
550
548
|
class: 'kbq-calendar'
|
|
551
|
-
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<kbq-calendar-header\n [
|
|
549
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<kbq-calendar-header\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [(activeDate)]=\"activeDate\"\n (monthSelected)=\"monthSelected.emit(activeDate)\"\n (yearSelected)=\"yearSelected.emit(activeDate)\"\n/>\n\n<div class=\"kbq-calendar__content\">\n <kbq-month-view\n [dateClass]=\"dateClass\"\n [dateFilter]=\"dateFilter\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [selected]=\"selected\"\n [(activeDate)]=\"activeDate\"\n (selectedChange)=\"dateSelected($event!)\"\n (userSelection)=\"userSelected()\"\n />\n</div>\n", styles: [".kbq-calendar{display:block}.kbq-calendar__content{padding-right:var(--kbq-datepicker-size-grid-padding-horizontal, 12px);padding-left:var(--kbq-datepicker-size-grid-padding-horizontal, 12px);outline:none}.kbq-calendar__table{border-spacing:0;border-collapse:collapse;width:100%}.kbq-calendar__table-header th{text-align:center;height:30px}.kbq-calendar__table-header th.kbq-calendar__table-header-divider{position:relative;box-sizing:border-box;height:var(--kbq-datepicker-size-grid-content-gap-vertical, 2px)}.kbq-calendar__table-header th.kbq-calendar__table-header-divider:after{content:\"\";position:absolute;top:0;left:calc(-1 * var(--kbq-datepicker-size-grid-padding-horizontal, 12px));right:calc(-1 * var(--kbq-datepicker-size-grid-padding-horizontal, 12px));height:var(--kbq-datepicker-size-grid-divider-height, 1px)}\n"] }]
|
|
552
550
|
}], ctorParameters: () => [{ type: KbqDatepickerIntl }, { type: i1$1.DateAdapter, decorators: [{
|
|
553
551
|
type: Optional
|
|
554
552
|
}] }, { type: i0.ChangeDetectorRef }], propDecorators: { startAt: [{
|
|
@@ -607,14 +605,11 @@ if (!Element.prototype.matches) {
|
|
|
607
605
|
Element.prototype.matches = Element.prototype.msMatchesSelector;
|
|
608
606
|
}
|
|
609
607
|
|
|
610
|
-
// tslint:disable:no-unbound-method
|
|
611
|
-
// tslint:disable:no-magic-numbers
|
|
612
608
|
/** Used to generate a unique ID for each datepicker instance. */
|
|
613
609
|
let datepickerUid = 0;
|
|
614
610
|
/** Injection token that determines the scroll handling while the calendar is open. */
|
|
615
611
|
const KBQ_DATEPICKER_SCROLL_STRATEGY = new InjectionToken('kbq-datepicker-scroll-strategy');
|
|
616
612
|
/** @docs-private */
|
|
617
|
-
// tslint:disable-next-line:naming-convention
|
|
618
613
|
function KBQ_DATEPICKER_SCROLL_STRATEGY_FACTORY(overlay) {
|
|
619
614
|
return () => overlay.scrollStrategies.reposition();
|
|
620
615
|
}
|
|
@@ -652,7 +647,7 @@ class KbqDatepickerContent {
|
|
|
652
647
|
this.changeDetectorRef.markForCheck();
|
|
653
648
|
}
|
|
654
649
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: KbqDatepickerContent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
655
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.0", type: KbqDatepickerContent, selector: "kbq-datepicker__content", host: { listeners: { "@transformPanel.done": "animationDone.next()" }, properties: { "@transformPanel": "animationState" }, classAttribute: "kbq-datepicker__content" }, viewQueries: [{ propertyName: "calendar", first: true, predicate: KbqCalendar, descendants: true }], exportAs: ["kbqDatepickerContent"], ngImport: i0, template: "<kbq-calendar
|
|
650
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.0", type: KbqDatepickerContent, selector: "kbq-datepicker__content", host: { listeners: { "@transformPanel.done": "animationDone.next()" }, properties: { "@transformPanel": "animationState" }, classAttribute: "kbq-datepicker__content" }, viewQueries: [{ propertyName: "calendar", first: true, predicate: KbqCalendar, descendants: true }], exportAs: ["kbqDatepickerContent"], ngImport: i0, template: "<kbq-calendar\n [dateClass]=\"datepicker.dateClass\"\n [dateFilter]=\"datepicker.dateFilter\"\n [id]=\"datepicker.id\"\n [maxDate]=\"datepicker.maxDate\"\n [minDate]=\"datepicker.minDate\"\n [ngClass]=\"datepicker.panelClass\"\n [selected]=\"datepicker.selected\"\n [startAt]=\"datepicker.startAt\"\n (monthSelected)=\"datepicker.selectMonth($event)\"\n (selectedChange)=\"datepicker.select($event)\"\n (userSelection)=\"datepicker.close()\"\n (yearSelected)=\"datepicker.selectYear($event)\"\n [@fadeInCalendar]=\"'enter'\"\n/>\n", styles: [".kbq-datepicker__content{display:block;border-radius:var(--kbq-datepicker-size-container-border-radius, 8px)}.kbq-datepicker__content .kbq-calendar{width:304px;height:270px;padding-top:var(--kbq-datepicker-size-container-padding-vertical, 12px);padding-bottom:var(--kbq-datepicker-size-container-padding-vertical, 12px)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: KbqCalendar, selector: "kbq-calendar", inputs: ["startAt", "selected", "minDate", "maxDate", "dateFilter", "dateClass"], outputs: ["selectedChange", "yearSelected", "monthSelected", "userSelection"], exportAs: ["kbqCalendar"] }], animations: [
|
|
656
651
|
kbqDatepickerAnimations.transformPanel,
|
|
657
652
|
kbqDatepickerAnimations.fadeInCalendar
|
|
658
653
|
], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
@@ -666,7 +661,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImpor
|
|
|
666
661
|
}, animations: [
|
|
667
662
|
kbqDatepickerAnimations.transformPanel,
|
|
668
663
|
kbqDatepickerAnimations.fadeInCalendar
|
|
669
|
-
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<kbq-calendar
|
|
664
|
+
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<kbq-calendar\n [dateClass]=\"datepicker.dateClass\"\n [dateFilter]=\"datepicker.dateFilter\"\n [id]=\"datepicker.id\"\n [maxDate]=\"datepicker.maxDate\"\n [minDate]=\"datepicker.minDate\"\n [ngClass]=\"datepicker.panelClass\"\n [selected]=\"datepicker.selected\"\n [startAt]=\"datepicker.startAt\"\n (monthSelected)=\"datepicker.selectMonth($event)\"\n (selectedChange)=\"datepicker.select($event)\"\n (userSelection)=\"datepicker.close()\"\n (yearSelected)=\"datepicker.selectYear($event)\"\n [@fadeInCalendar]=\"'enter'\"\n/>\n", styles: [".kbq-datepicker__content{display:block;border-radius:var(--kbq-datepicker-size-container-border-radius, 8px)}.kbq-datepicker__content .kbq-calendar{width:304px;height:270px;padding-top:var(--kbq-datepicker-size-container-padding-vertical, 12px);padding-bottom:var(--kbq-datepicker-size-container-padding-vertical, 12px)}\n"] }]
|
|
670
665
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { calendar: [{
|
|
671
666
|
type: ViewChild,
|
|
672
667
|
args: [KbqCalendar]
|
|
@@ -690,8 +685,10 @@ class KbqDatepicker {
|
|
|
690
685
|
}
|
|
691
686
|
set startAt(value) {
|
|
692
687
|
const deserializedValue = this.dateAdapter.deserialize(value);
|
|
693
|
-
this._startAt =
|
|
694
|
-
|
|
688
|
+
this._startAt =
|
|
689
|
+
deserializedValue !== null
|
|
690
|
+
? this.dateAdapter.clampDate(deserializedValue, this.minDate, this.maxDate)
|
|
691
|
+
: null;
|
|
695
692
|
}
|
|
696
693
|
/** Whether the datepicker pop-up should be disabled. */
|
|
697
694
|
get disabled() {
|
|
@@ -798,8 +795,7 @@ class KbqDatepicker {
|
|
|
798
795
|
throw Error('A KbqDatepicker can only be associated with a single input.');
|
|
799
796
|
}
|
|
800
797
|
this.datepickerInput = input;
|
|
801
|
-
this.inputSubscription = this.datepickerInput.valueChange
|
|
802
|
-
.subscribe((value) => {
|
|
798
|
+
this.inputSubscription = this.datepickerInput.valueChange.subscribe((value) => {
|
|
803
799
|
this.selected = value;
|
|
804
800
|
if (this.popupComponentRef) {
|
|
805
801
|
this.popupComponentRef.instance.calendar.monthView?.init();
|
|
@@ -830,9 +826,7 @@ class KbqDatepicker {
|
|
|
830
826
|
if (this.popupComponentRef) {
|
|
831
827
|
const instance = this.popupComponentRef.instance;
|
|
832
828
|
instance.startExitAnimation();
|
|
833
|
-
instance.animationDone
|
|
834
|
-
.pipe(take(1))
|
|
835
|
-
.subscribe(() => this.destroyOverlay());
|
|
829
|
+
instance.animationDone.pipe(take(1)).subscribe(() => this.destroyOverlay());
|
|
836
830
|
}
|
|
837
831
|
if (restoreFocus) {
|
|
838
832
|
this.focusedElementBeforeOpen.focus();
|
|
@@ -866,7 +860,8 @@ class KbqDatepicker {
|
|
|
866
860
|
this.popupComponentRef = this.popupRef.attach(this.calendarPortal);
|
|
867
861
|
this.popupComponentRef.instance.datepicker = this;
|
|
868
862
|
// Update the position once the calendar has rendered.
|
|
869
|
-
this.ngZone.onStable
|
|
863
|
+
this.ngZone.onStable
|
|
864
|
+
.asObservable()
|
|
870
865
|
.pipe(take(1))
|
|
871
866
|
.subscribe(() => this.popupRef?.updatePosition());
|
|
872
867
|
}
|
|
@@ -882,8 +877,7 @@ class KbqDatepicker {
|
|
|
882
877
|
panelClass: 'kbq-datepicker__popup'
|
|
883
878
|
});
|
|
884
879
|
this.popupRef = this.overlay.create(overlayConfig);
|
|
885
|
-
this.closeSubscription = this.closingActions()
|
|
886
|
-
.subscribe(() => this.close(this.restoreFocus()));
|
|
880
|
+
this.closeSubscription = this.closingActions().subscribe(() => this.close(this.restoreFocus()));
|
|
887
881
|
}
|
|
888
882
|
restoreFocus() {
|
|
889
883
|
return this.document.activeElement === this.document.body;
|
|
@@ -893,7 +887,8 @@ class KbqDatepicker {
|
|
|
893
887
|
}
|
|
894
888
|
/** Create the popup PositionStrategy. */
|
|
895
889
|
createPopupPositionStrategy() {
|
|
896
|
-
return this.overlay
|
|
890
|
+
return this.overlay
|
|
891
|
+
.position()
|
|
897
892
|
.flexibleConnectedTo(this.datepickerInput.elementRef)
|
|
898
893
|
.withTransformOriginOn('.kbq-datepicker__content')
|
|
899
894
|
.withFlexibleDimensions(false)
|
|
@@ -981,8 +976,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImpor
|
|
|
981
976
|
args: ['closed']
|
|
982
977
|
}] } });
|
|
983
978
|
|
|
984
|
-
// tslint:disable:no-empty, deprecation
|
|
985
|
-
// tslint:disable:naming-convention
|
|
986
979
|
var DateParts;
|
|
987
980
|
(function (DateParts) {
|
|
988
981
|
DateParts["year"] = "y";
|
|
@@ -1115,8 +1108,7 @@ class KbqDatepickerInput {
|
|
|
1115
1108
|
this.datepicker = value;
|
|
1116
1109
|
this.datepicker.registerInput(this);
|
|
1117
1110
|
this.datepickerSubscription.unsubscribe();
|
|
1118
|
-
this.datepickerSubscription = this.datepicker.selectedChanged
|
|
1119
|
-
.subscribe((selected) => {
|
|
1111
|
+
this.datepickerSubscription = this.datepicker.selectedChanged.subscribe((selected) => {
|
|
1120
1112
|
const newValue = this.saveTimePart(selected);
|
|
1121
1113
|
this.value = newValue;
|
|
1122
1114
|
this.cvaOnChange(newValue);
|
|
@@ -1259,7 +1251,6 @@ class KbqDatepickerInput {
|
|
|
1259
1251
|
this.secondDigit = null;
|
|
1260
1252
|
this.thirdDigit = null;
|
|
1261
1253
|
this.usePlaceholderFromInput = false;
|
|
1262
|
-
// tslint:disable-next-line:no-empty
|
|
1263
1254
|
this.onTouched = () => { };
|
|
1264
1255
|
this.onInput = () => {
|
|
1265
1256
|
this.correctCursorPosition();
|
|
@@ -1290,7 +1281,6 @@ class KbqDatepickerInput {
|
|
|
1290
1281
|
.map((value) => value)
|
|
1291
1282
|
.filter((value) => value);
|
|
1292
1283
|
const [firsViewDigit, secondViewDigit, thirdViewDigit] = viewDigits;
|
|
1293
|
-
// tslint:disable-next-line:no-magic-numbers
|
|
1294
1284
|
if (viewDigits.length !== 3) {
|
|
1295
1285
|
this.lastValueValid = false;
|
|
1296
1286
|
this._value = null;
|
|
@@ -1299,11 +1289,8 @@ class KbqDatepickerInput {
|
|
|
1299
1289
|
date[this.firstDigit.fullName] = this.firstDigit.parse(firsViewDigit);
|
|
1300
1290
|
date[this.secondDigit.fullName] = this.secondDigit.parse(secondViewDigit);
|
|
1301
1291
|
date[this.thirdDigit.fullName] = this.thirdDigit.parse(thirdViewDigit);
|
|
1302
|
-
const [digitWithYear, viewDigitWithYear] = [this.firstDigit, this.secondDigit, this.thirdDigit]
|
|
1303
|
-
.reduce((acc, digit, index) => digit.value === DateParts.year ? [digit, viewDigits[index]] : acc, []);
|
|
1304
|
-
// tslint:disable-next-line:no-magic-numbers
|
|
1292
|
+
const [digitWithYear, viewDigitWithYear] = [this.firstDigit, this.secondDigit, this.thirdDigit].reduce((acc, digit, index) => (digit.value === DateParts.year ? [digit, viewDigits[index]] : acc), []);
|
|
1305
1293
|
if (viewDigitWithYear.length < 3) {
|
|
1306
|
-
// tslint:disable-next-line:no-magic-numbers
|
|
1307
1294
|
date.year += date.year < 30 ? 2000 : 1900;
|
|
1308
1295
|
}
|
|
1309
1296
|
else if (viewDigitWithYear.length < digitWithYear.length) {
|
|
@@ -1333,35 +1320,34 @@ class KbqDatepickerInput {
|
|
|
1333
1320
|
}
|
|
1334
1321
|
this.value = this.value;
|
|
1335
1322
|
};
|
|
1336
|
-
// tslint:disable-next-line:no-empty
|
|
1337
1323
|
this.cvaOnChange = () => { };
|
|
1338
|
-
// tslint:disable-next-line:no-empty
|
|
1339
1324
|
this.validatorOnChange = () => { };
|
|
1340
1325
|
/** The form control validator for whether the input parses. */
|
|
1341
1326
|
this.parseValidator = () => {
|
|
1342
|
-
return this.focused ||
|
|
1343
|
-
|
|
1344
|
-
|
|
1327
|
+
return this.focused || this.empty || this.lastValueValid
|
|
1328
|
+
? null
|
|
1329
|
+
: { kbqDatepickerParse: { text: this.elementRef.nativeElement.value } };
|
|
1345
1330
|
};
|
|
1346
1331
|
/** The form control validator for the min date. */
|
|
1347
1332
|
this.minValidator = (control) => {
|
|
1348
1333
|
const controlValue = this.adapter.deserialize(control.value);
|
|
1349
|
-
return !this.min || !controlValue || this.adapter.compareDateTime(this.min, controlValue) <= 0
|
|
1350
|
-
null
|
|
1351
|
-
{ kbqDatepickerMin: { min: this.min, actual: controlValue } };
|
|
1334
|
+
return !this.min || !controlValue || this.adapter.compareDateTime(this.min, controlValue) <= 0
|
|
1335
|
+
? null
|
|
1336
|
+
: { kbqDatepickerMin: { min: this.min, actual: controlValue } };
|
|
1352
1337
|
};
|
|
1353
1338
|
/** The form control validator for the max date. */
|
|
1354
1339
|
this.maxValidator = (control) => {
|
|
1355
1340
|
const controlValue = this.adapter.deserialize(control.value);
|
|
1356
|
-
return !this.max || !controlValue || this.adapter.compareDateTime(this.max, controlValue) >= 0
|
|
1357
|
-
null
|
|
1358
|
-
{ kbqDatepickerMax: { max: this.max, actual: controlValue } };
|
|
1341
|
+
return !this.max || !controlValue || this.adapter.compareDateTime(this.max, controlValue) >= 0
|
|
1342
|
+
? null
|
|
1343
|
+
: { kbqDatepickerMax: { max: this.max, actual: controlValue } };
|
|
1359
1344
|
};
|
|
1360
1345
|
/** The form control validator for the date filter. */
|
|
1361
1346
|
this.filterValidator = (control) => {
|
|
1362
1347
|
const controlValue = this.adapter.deserialize(control.value);
|
|
1363
|
-
return !this.dateFilter || !controlValue || this.dateFilter(controlValue)
|
|
1364
|
-
null
|
|
1348
|
+
return !this.dateFilter || !controlValue || this.dateFilter(controlValue)
|
|
1349
|
+
? null
|
|
1350
|
+
: { kbqDatepickerFilter: true };
|
|
1365
1351
|
};
|
|
1366
1352
|
this.validator = Validators.compose([
|
|
1367
1353
|
this.parseValidator,
|
|
@@ -1373,8 +1359,7 @@ class KbqDatepickerInput {
|
|
|
1373
1359
|
throw createMissingDateImplError('DateAdapter');
|
|
1374
1360
|
}
|
|
1375
1361
|
this.setFormat(this.dateInputFormat);
|
|
1376
|
-
this.localeSubscription = adapter.localeChanges
|
|
1377
|
-
.subscribe(this.updateLocaleParams);
|
|
1362
|
+
this.localeSubscription = adapter.localeChanges.subscribe(this.updateLocaleParams);
|
|
1378
1363
|
}
|
|
1379
1364
|
onContainerClick() {
|
|
1380
1365
|
this.focus();
|
|
@@ -1523,11 +1508,12 @@ class KbqDatepickerInput {
|
|
|
1523
1508
|
return this.adapter.createDateTime(years, month, day, hours, minutes, seconds, milliseconds);
|
|
1524
1509
|
}
|
|
1525
1510
|
setFormat(format) {
|
|
1511
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1526
1512
|
// @ts-ignore
|
|
1527
1513
|
this.separator = format.match(/[aA-zZ]+(?<separator>\W|\D)[aA-zZ]+/).groups.separator;
|
|
1528
1514
|
this.separatorPositions = format
|
|
1529
1515
|
.split('')
|
|
1530
|
-
.reduce((acc, item, index) => this.separator === item ? [...acc, index + 1] : acc, []);
|
|
1516
|
+
.reduce((acc, item, index) => (this.separator === item ? [...acc, index + 1] : acc), []);
|
|
1531
1517
|
this.getDigitPositions(format);
|
|
1532
1518
|
}
|
|
1533
1519
|
updateValue(newValue) {
|
|
@@ -1549,9 +1535,10 @@ class KbqDatepickerInput {
|
|
|
1549
1535
|
return isLetterKey(event) && !event.ctrlKey && !event.metaKey;
|
|
1550
1536
|
}
|
|
1551
1537
|
isKeyForByPass(event) {
|
|
1552
|
-
return (hasModifierKey(event) && (isVerticalMovement(event) || isHorizontalMovement(event))) ||
|
|
1553
|
-
event.ctrlKey ||
|
|
1554
|
-
|
|
1538
|
+
return ((hasModifierKey(event) && (isVerticalMovement(event) || isHorizontalMovement(event))) ||
|
|
1539
|
+
event.ctrlKey ||
|
|
1540
|
+
event.metaKey ||
|
|
1541
|
+
[DELETE, BACKSPACE, TAB].includes(event.keyCode));
|
|
1555
1542
|
}
|
|
1556
1543
|
spaceKeyHandler(event) {
|
|
1557
1544
|
event.preventDefault();
|
|
@@ -1590,9 +1577,7 @@ class KbqDatepickerInput {
|
|
|
1590
1577
|
return null;
|
|
1591
1578
|
}
|
|
1592
1579
|
const date = this.getDefaultValue();
|
|
1593
|
-
const viewDigits = timeString
|
|
1594
|
-
.split(this.separator)
|
|
1595
|
-
.map((value) => value);
|
|
1580
|
+
const viewDigits = timeString.split(this.separator).map((value) => value);
|
|
1596
1581
|
const [firsViewDigit, secondViewDigit, thirdViewDigit] = viewDigits;
|
|
1597
1582
|
if (viewDigits.length === 1) {
|
|
1598
1583
|
if (/\D/.test(firsViewDigit) || firsViewDigit.length < this.firstDigit.length) {
|
|
@@ -1602,7 +1587,6 @@ class KbqDatepickerInput {
|
|
|
1602
1587
|
if (this.firstDigit.isDay) {
|
|
1603
1588
|
date.month = 1;
|
|
1604
1589
|
}
|
|
1605
|
-
// tslint:disable-next-line:no-magic-numbers
|
|
1606
1590
|
}
|
|
1607
1591
|
else if (viewDigits.length === 2) {
|
|
1608
1592
|
if (firsViewDigit.length < this.firstDigit.length || secondViewDigit.length < this.secondDigit.length) {
|
|
@@ -1610,7 +1594,6 @@ class KbqDatepickerInput {
|
|
|
1610
1594
|
}
|
|
1611
1595
|
date[this.firstDigit.fullName] = this.firstDigit.parse(firsViewDigit);
|
|
1612
1596
|
date[this.secondDigit.fullName] = this.secondDigit.parse(secondViewDigit);
|
|
1613
|
-
// tslint:disable-next-line:no-magic-numbers
|
|
1614
1597
|
}
|
|
1615
1598
|
else if (viewDigits.length === 3) {
|
|
1616
1599
|
if (firsViewDigit.length < this.firstDigit.length ||
|
|
@@ -1624,7 +1607,7 @@ class KbqDatepickerInput {
|
|
|
1624
1607
|
digitViewValue[dateDigit.fullName] = parseInt(viewDigits[index]);
|
|
1625
1608
|
}
|
|
1626
1609
|
if (this.value && digitViewValue.month && digitViewValue.month <= this.firstDigit.maxMonth) {
|
|
1627
|
-
dateDigits.forEach((digit) => digit.maxDays = this.getLastDayFor(digitViewValue.year, digitViewValue.month - 1));
|
|
1610
|
+
dateDigits.forEach((digit) => (digit.maxDays = this.getLastDayFor(digitViewValue.year, digitViewValue.month - 1)));
|
|
1628
1611
|
}
|
|
1629
1612
|
date[this.firstDigit.fullName] = this.firstDigit.parse(firsViewDigit);
|
|
1630
1613
|
date[this.secondDigit.fullName] = this.secondDigit.parse(secondViewDigit);
|
|
@@ -1672,9 +1655,8 @@ class KbqDatepickerInput {
|
|
|
1672
1655
|
day = 1;
|
|
1673
1656
|
}
|
|
1674
1657
|
break;
|
|
1675
|
-
case DateParts.month:
|
|
1658
|
+
case DateParts.month: {
|
|
1676
1659
|
month++;
|
|
1677
|
-
// tslint:disable-next-line:no-magic-numbers
|
|
1678
1660
|
if (month > 11) {
|
|
1679
1661
|
month = 0;
|
|
1680
1662
|
}
|
|
@@ -1683,6 +1665,7 @@ class KbqDatepickerInput {
|
|
|
1683
1665
|
day = lastDay;
|
|
1684
1666
|
}
|
|
1685
1667
|
break;
|
|
1668
|
+
}
|
|
1686
1669
|
case DateParts.year:
|
|
1687
1670
|
year++;
|
|
1688
1671
|
if (year > MAX_YEAR) {
|
|
@@ -1707,10 +1690,9 @@ class KbqDatepickerInput {
|
|
|
1707
1690
|
day = this.adapter.getNumDaysInMonth(dateVal);
|
|
1708
1691
|
}
|
|
1709
1692
|
break;
|
|
1710
|
-
case DateParts.month:
|
|
1693
|
+
case DateParts.month: {
|
|
1711
1694
|
month--;
|
|
1712
1695
|
if (month < 0) {
|
|
1713
|
-
// tslint:disable-next-line:no-magic-numbers
|
|
1714
1696
|
month = 11;
|
|
1715
1697
|
}
|
|
1716
1698
|
const lastDay = this.getLastDayFor(year, month);
|
|
@@ -1718,6 +1700,7 @@ class KbqDatepickerInput {
|
|
|
1718
1700
|
day = lastDay;
|
|
1719
1701
|
}
|
|
1720
1702
|
break;
|
|
1703
|
+
}
|
|
1721
1704
|
case DateParts.year:
|
|
1722
1705
|
year--;
|
|
1723
1706
|
if (year < 1) {
|
|
@@ -1759,14 +1742,28 @@ class KbqDatepickerInput {
|
|
|
1759
1742
|
cursorPos = this.viewValue.length;
|
|
1760
1743
|
}
|
|
1761
1744
|
else if (keyCode === LEFT_ARROW) {
|
|
1745
|
+
this.fixEmptyDigit();
|
|
1762
1746
|
cursorPos = cursorPos === 0 ? this.viewValue.length : cursorPos - 1;
|
|
1763
1747
|
}
|
|
1764
1748
|
else if (keyCode === RIGHT_ARROW) {
|
|
1749
|
+
this.fixEmptyDigit();
|
|
1765
1750
|
const nextSeparatorPos = this.viewValue.indexOf(this.separator, cursorPos);
|
|
1766
1751
|
cursorPos = nextSeparatorPos ? nextSeparatorPos + 1 : 0;
|
|
1767
1752
|
}
|
|
1768
1753
|
this.selectDigitByCursor(cursorPos);
|
|
1769
1754
|
}
|
|
1755
|
+
fixEmptyDigit() {
|
|
1756
|
+
const hasEmptyDigit = this.viewValue
|
|
1757
|
+
.split(this.separator)
|
|
1758
|
+
.map((part) => part.length)
|
|
1759
|
+
.some((item) => !item);
|
|
1760
|
+
if (hasEmptyDigit && this.value) {
|
|
1761
|
+
const year = this.adapter.getYear(this.value);
|
|
1762
|
+
const month = this.adapter.getMonth(this.value);
|
|
1763
|
+
const day = this.adapter.getDate(this.value);
|
|
1764
|
+
this.value = this.createDate(year, month, day);
|
|
1765
|
+
}
|
|
1766
|
+
}
|
|
1770
1767
|
selectDigitByCursor(cursorPos) {
|
|
1771
1768
|
setTimeout(() => {
|
|
1772
1769
|
const [, selectionStart, selectionEnd] = this.getDateEditMetrics(cursorPos);
|
|
@@ -1807,23 +1804,20 @@ class KbqDatepickerInput {
|
|
|
1807
1804
|
return;
|
|
1808
1805
|
}
|
|
1809
1806
|
this.control = control;
|
|
1810
|
-
this.control.valueChanges
|
|
1811
|
-
.subscribe((value) => this._value = value);
|
|
1807
|
+
this.control.valueChanges.subscribe((value) => (this._value = value));
|
|
1812
1808
|
}
|
|
1813
1809
|
/**
|
|
1814
1810
|
* @param obj The object to check.
|
|
1815
1811
|
* @returns The given object if it is both a date instance and valid, otherwise null.
|
|
1816
1812
|
*/
|
|
1817
1813
|
getValidDateOrNull(obj) {
|
|
1818
|
-
return
|
|
1814
|
+
return this.adapter.isDateInstance(obj) && this.adapter.isValid(obj) ? obj : null;
|
|
1819
1815
|
}
|
|
1820
1816
|
getDigitPositions(format) {
|
|
1821
1817
|
this.firstDigit = this.secondDigit = this.thirdDigit = null;
|
|
1822
1818
|
const formatInLowerCase = format.toLowerCase();
|
|
1823
|
-
formatInLowerCase
|
|
1824
|
-
.
|
|
1825
|
-
.reduce(({ prev, length, start }, value, index, arr) => {
|
|
1826
|
-
if (value === this.separator || (arr.length - 1) === index) {
|
|
1819
|
+
formatInLowerCase.split('').reduce(({ prev, length, start }, value, index, arr) => {
|
|
1820
|
+
if (value === this.separator || arr.length - 1 === index) {
|
|
1827
1821
|
if (!this.firstDigit) {
|
|
1828
1822
|
this.firstDigit = new DateDigit(prev, start, length);
|
|
1829
1823
|
}
|
|
@@ -1833,7 +1827,6 @@ class KbqDatepickerInput {
|
|
|
1833
1827
|
else if (!this.thirdDigit) {
|
|
1834
1828
|
this.thirdDigit = new DateDigit(prev, start, arr.length - start);
|
|
1835
1829
|
}
|
|
1836
|
-
// tslint:disable:no-parameter-reassignment
|
|
1837
1830
|
length = 0;
|
|
1838
1831
|
start = index + 1;
|
|
1839
1832
|
}
|
|
@@ -1975,23 +1968,24 @@ class KbqDatepickerToggle {
|
|
|
1975
1968
|
}
|
|
1976
1969
|
watchStateChanges() {
|
|
1977
1970
|
const datepickerDisabled = this.datepicker ? this.datepicker.disabledChange : of();
|
|
1978
|
-
const inputDisabled = this.datepicker && this.datepicker.datepickerInput
|
|
1979
|
-
this.datepicker.datepickerInput.disabledChange
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1971
|
+
const inputDisabled = this.datepicker && this.datepicker.datepickerInput
|
|
1972
|
+
? this.datepicker.datepickerInput.disabledChange
|
|
1973
|
+
: of();
|
|
1974
|
+
const datepickerToggled = this.datepicker
|
|
1975
|
+
? merge(this.datepicker.openedStream, this.datepicker.closedStream)
|
|
1976
|
+
: of();
|
|
1983
1977
|
this.stateChanges.unsubscribe();
|
|
1984
1978
|
this.stateChanges = merge(this.intl.changes, datepickerDisabled, inputDisabled, datepickerToggled).subscribe(() => this.changeDetectorRef.markForCheck());
|
|
1985
1979
|
}
|
|
1986
1980
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: KbqDatepickerToggle, deps: [{ token: KbqDatepickerIntl }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1987
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.0", type: KbqDatepickerToggle, selector: "kbq-datepicker-toggle", inputs: { disabled: "disabled", datepicker: ["for", "datepicker"], tabIndex: "tabIndex" }, host: { properties: { "class.kbq-active": "datepicker && datepicker.opened" }, classAttribute: "kbq-datepicker-toggle" }, queries: [{ propertyName: "customIcon", first: true, predicate: KbqDatepickerToggleIcon, descendants: true }], viewQueries: [{ propertyName: "button", first: true, predicate: ["button"], descendants: true }], exportAs: ["kbqDatepickerToggle"], usesOnChanges: true, ngImport: i0, template: "<!--todo need simplify this-->\n<button\n #button\n kbq-button\n type=\"button\"\n class=\"kbq-datepicker-toggle__button\"\n
|
|
1981
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.0", type: KbqDatepickerToggle, selector: "kbq-datepicker-toggle", inputs: { disabled: "disabled", datepicker: ["for", "datepicker"], tabIndex: "tabIndex" }, host: { properties: { "class.kbq-active": "datepicker && datepicker.opened" }, classAttribute: "kbq-datepicker-toggle" }, queries: [{ propertyName: "customIcon", first: true, predicate: KbqDatepickerToggleIcon, descendants: true }], viewQueries: [{ propertyName: "button", first: true, predicate: ["button"], descendants: true }], exportAs: ["kbqDatepickerToggle"], usesOnChanges: true, ngImport: i0, template: "<!--todo need simplify this-->\n<button\n #button\n aria-haspopup=\"true\"\n kbq-button\n type=\"button\"\n class=\"kbq-datepicker-toggle__button\"\n [attr.aria-label]=\"intl.openCalendarLabel\"\n [disabled]=\"disabled\"\n [tabIndex]=\"tabIndex\"\n (click)=\"open($event)\"\n>\n <i\n *ngIf=\"!customIcon\"\n kbq-icon=\"mc-calendar_16\"\n class=\"kbq-datepicker-toggle__default-icon\"\n ></i>\n\n <ng-content select=\"[kbqDatepickerToggleIcon]\" />\n</button>\n", styles: [".kbq-datepicker-toggle:focus{outline:0}.kbq-datepicker-toggle__button.kbq-button-icon{width:var(--kbq-datepicker-toggle-size-width, );height:var(--kbq-datepicker-toggle-size-height, );margin-left:2px}.kbq-form-field-appearance-legacy .kbq-form-field-prefix .kbq-datepicker-toggle__default-icon,.kbq-form-field-appearance-legacy .kbq-form-field-suffix .kbq-datepicker-toggle__default-icon{width:1em}.kbq-form-field:not(.kbq-form-field-appearance-legacy) .kbq-form-field-prefix .kbq-datepicker-toggle__default-icon,.kbq-form-field:not(.kbq-form-field-appearance-legacy) .kbq-form-field-suffix .kbq-datepicker-toggle__default-icon{display:block;width:1.5em;height:1.5em}.kbq-form-field:not(.kbq-form-field-appearance-legacy) .kbq-form-field-prefix .kbq-button-icon .kbq-datepicker-toggle__default-icon,.kbq-form-field:not(.kbq-form-field-appearance-legacy) .kbq-form-field-suffix .kbq-button-icon .kbq-datepicker-toggle__default-icon{margin:auto}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.KbqButton, selector: "[kbq-button]", inputs: ["color", "tabIndex", "kbqStyle", "disabled"] }, { kind: "directive", type: i3.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "component", type: i6.KbqIcon, selector: "[kbq-icon]", inputs: ["color", "small", "autoColor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1988
1982
|
}
|
|
1989
1983
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: KbqDatepickerToggle, decorators: [{
|
|
1990
1984
|
type: Component,
|
|
1991
1985
|
args: [{ selector: 'kbq-datepicker-toggle', host: {
|
|
1992
1986
|
class: 'kbq-datepicker-toggle',
|
|
1993
1987
|
'[class.kbq-active]': 'datepicker && datepicker.opened'
|
|
1994
|
-
}, exportAs: 'kbqDatepickerToggle', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--todo need simplify this-->\n<button\n #button\n kbq-button\n type=\"button\"\n class=\"kbq-datepicker-toggle__button\"\n
|
|
1988
|
+
}, exportAs: 'kbqDatepickerToggle', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--todo need simplify this-->\n<button\n #button\n aria-haspopup=\"true\"\n kbq-button\n type=\"button\"\n class=\"kbq-datepicker-toggle__button\"\n [attr.aria-label]=\"intl.openCalendarLabel\"\n [disabled]=\"disabled\"\n [tabIndex]=\"tabIndex\"\n (click)=\"open($event)\"\n>\n <i\n *ngIf=\"!customIcon\"\n kbq-icon=\"mc-calendar_16\"\n class=\"kbq-datepicker-toggle__default-icon\"\n ></i>\n\n <ng-content select=\"[kbqDatepickerToggleIcon]\" />\n</button>\n", styles: [".kbq-datepicker-toggle:focus{outline:0}.kbq-datepicker-toggle__button.kbq-button-icon{width:var(--kbq-datepicker-toggle-size-width, );height:var(--kbq-datepicker-toggle-size-height, );margin-left:2px}.kbq-form-field-appearance-legacy .kbq-form-field-prefix .kbq-datepicker-toggle__default-icon,.kbq-form-field-appearance-legacy .kbq-form-field-suffix .kbq-datepicker-toggle__default-icon{width:1em}.kbq-form-field:not(.kbq-form-field-appearance-legacy) .kbq-form-field-prefix .kbq-datepicker-toggle__default-icon,.kbq-form-field:not(.kbq-form-field-appearance-legacy) .kbq-form-field-suffix .kbq-datepicker-toggle__default-icon{display:block;width:1.5em;height:1.5em}.kbq-form-field:not(.kbq-form-field-appearance-legacy) .kbq-form-field-prefix .kbq-button-icon .kbq-datepicker-toggle__default-icon,.kbq-form-field:not(.kbq-form-field-appearance-legacy) .kbq-form-field-suffix .kbq-button-icon .kbq-datepicker-toggle__default-icon{margin:auto}\n"] }]
|
|
1995
1989
|
}], ctorParameters: () => [{ type: KbqDatepickerIntl }, { type: i0.ChangeDetectorRef }], propDecorators: { disabled: [{
|
|
1996
1990
|
type: Input
|
|
1997
1991
|
}], datepicker: [{
|