@koobiq/components 16.0.0-beta.1 → 16.0.0-beta.10
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/LICENSE +1 -1
- package/README.md +2 -2
- package/autocomplete/_autocomplete-theme.scss +3 -10
- package/autocomplete/autocomplete-origin.directive.d.ts +1 -1
- package/autocomplete/autocomplete-trigger.directive.d.ts +6 -16
- package/autocomplete/autocomplete.component.d.ts +1 -1
- package/autocomplete/autocomplete.scss +0 -8
- package/badge/README.md +0 -0
- package/{core/styles/theming/_badges-theme.scss → badge/_badge-theme.scss} +14 -13
- package/badge/badge.component.d.ts +44 -0
- package/badge/badge.component.scss +83 -0
- package/badge/badge.module.d.ts +10 -0
- package/badge/index.d.ts +1 -0
- package/badge/public-api.d.ts +2 -0
- package/button/_button-base.scss +1 -1
- package/button/_button-theme.scss +35 -27
- package/button/button.scss +5 -2
- package/button-toggle/_button-toggle-theme.scss +26 -45
- package/button-toggle/button-toggle.component.d.ts +2 -2
- package/button-toggle/button-toggle.scss +40 -87
- package/card/_card-theme.scss +1 -1
- package/checkbox/README.md +1 -1
- package/checkbox/_checkbox-theme.scss +10 -2
- package/checkbox/checkbox.d.ts +2 -2
- package/code-block/README.md +14 -14
- package/code-block/_code-block-theme.scss +8 -0
- package/code-block/code-block.component.d.ts +1 -1
- package/core/animation/index.d.ts +1 -1
- package/core/animation/select-animations.d.ts +1 -1
- package/core/common-behaviors/color.d.ts +1 -1
- package/core/common-behaviors/common-module.d.ts +1 -1
- package/core/formatters/index.d.ts +1 -1
- package/core/formatters/number/formatter.d.ts +56 -1
- package/core/forms/_forms-theme.scss +4 -4
- package/core/forms/_forms.scss +1 -3
- package/core/forms/forms.directive.d.ts +2 -2
- package/core/locales/en-US.d.ts +19 -1
- package/core/locales/es-LA.d.ts +27 -0
- package/core/locales/fa-IR.d.ts +28 -0
- package/core/locales/locale-service.d.ts +148 -3
- package/core/locales/pt-BR.d.ts +27 -0
- package/core/locales/ru-RU.d.ts +20 -1
- package/core/locales/zh-CN.d.ts +26 -0
- package/core/option/_optgroup-theme.scss +1 -1
- package/core/option/_option-action-theme.scss +1 -1
- package/core/option/_option-theme.scss +37 -14
- package/core/option/action.d.ts +1 -1
- package/core/option/action.scss +4 -5
- package/core/option/optgroup.d.ts +1 -1
- package/core/option/option.d.ts +37 -8
- package/core/option/option.scss +5 -50
- package/core/overlay/overlay-position-map.d.ts +7 -1
- package/core/pop-up/constants.d.ts +2 -1
- package/core/public-api.d.ts +1 -0
- package/core/select/constants.d.ts +2 -2
- package/core/services/theme.service.d.ts +23 -0
- package/core/styles/_koobiq-theme.scss +12 -1
- package/core/styles/_tokens.kbq.import.scss +4 -4
- package/core/styles/_tokens.scss +4 -4
- package/core/styles/_variables.scss +1 -0
- package/core/styles/common/_animation.scss +10 -6
- package/core/styles/common/_list.scss +123 -0
- package/core/styles/common/_overlay.scss +1 -1
- package/core/styles/common/_select.scss +232 -0
- package/core/styles/theming/_components-theming.scss +685 -92
- package/core/styles/theming/_theming.scss +201 -30
- package/core/styles/typography/_typography.scss +175 -5
- package/datepicker/_datepicker-theme.scss +43 -57
- package/datepicker/calendar-body.component.d.ts +1 -1
- package/datepicker/calendar-body.scss +11 -26
- package/datepicker/calendar-header.component.d.ts +9 -3
- package/datepicker/calendar-header.scss +7 -31
- package/datepicker/calendar.component.d.ts +4 -5
- package/datepicker/calendar.scss +20 -25
- package/datepicker/datepicker-animations.d.ts +2 -2
- package/datepicker/datepicker-content.scss +17 -10
- package/datepicker/datepicker-input.directive.d.ts +4 -4
- package/datepicker/datepicker-input.scss +1 -1
- package/datepicker/datepicker-toggle.component.d.ts +3 -3
- package/datepicker/datepicker.component.d.ts +2 -2
- package/datepicker/month-view.component.d.ts +5 -6
- package/dl/_dl-theme.scss +2 -56
- package/dl/dl.component.d.ts +1 -2
- package/dl/dl.scss +10 -47
- package/dropdown/_dropdown-theme.scss +29 -37
- package/dropdown/dropdown-animations.d.ts +1 -1
- package/dropdown/dropdown-content.directive.d.ts +1 -1
- package/dropdown/dropdown-item.component.d.ts +1 -1
- package/dropdown/dropdown-item.scss +18 -40
- package/dropdown/dropdown-trigger.directive.d.ts +2 -2
- package/dropdown/dropdown.component.d.ts +1 -1
- package/dropdown/dropdown.scss +16 -39
- package/dropdown/dropdown.types.d.ts +1 -1
- package/esm2022/alert/alert.component.mjs +3 -3
- package/esm2022/autocomplete/autocomplete-origin.directive.mjs +4 -4
- package/esm2022/autocomplete/autocomplete-trigger.directive.mjs +34 -31
- package/esm2022/autocomplete/autocomplete.component.mjs +4 -4
- package/esm2022/badge/badge.component.mjs +122 -0
- package/esm2022/badge/badge.module.mjs +40 -0
- package/esm2022/badge/index.mjs +2 -0
- package/esm2022/badge/koobiq-components-badge.mjs +5 -0
- package/esm2022/badge/public-api.mjs +3 -0
- package/esm2022/button/button.component.mjs +4 -3
- package/esm2022/button-toggle/button-toggle.component.mjs +15 -15
- package/esm2022/checkbox/checkbox.mjs +4 -4
- package/esm2022/code-block/actionbar.component.mjs +3 -3
- package/esm2022/code-block/code-block.component.mjs +4 -4
- package/esm2022/core/animation/index.mjs +2 -2
- package/esm2022/core/animation/select-animations.mjs +4 -4
- package/esm2022/core/common-behaviors/color.mjs +1 -1
- package/esm2022/core/common-behaviors/common-module.mjs +2 -2
- package/esm2022/core/formatters/index.mjs +10 -2
- package/esm2022/core/formatters/number/formatter.mjs +224 -3
- package/esm2022/core/forms/forms.directive.mjs +5 -5
- package/esm2022/core/locales/en-US.mjs +22 -4
- package/esm2022/core/locales/es-LA.mjs +31 -2
- package/esm2022/core/locales/fa-IR.mjs +30 -2
- package/esm2022/core/locales/locale-service.mjs +4 -4
- package/esm2022/core/locales/pt-BR.mjs +29 -2
- package/esm2022/core/locales/ru-RU.mjs +23 -2
- package/esm2022/core/locales/zh-CN.mjs +28 -2
- package/esm2022/core/option/action.mjs +8 -7
- package/esm2022/core/option/optgroup.mjs +3 -3
- package/esm2022/core/option/option.mjs +47 -10
- package/esm2022/core/overlay/overlay-position-map.mjs +8 -1
- package/esm2022/core/pop-up/constants.mjs +2 -1
- package/esm2022/core/pop-up/pop-up-trigger.mjs +12 -3
- package/esm2022/core/public-api.mjs +2 -1
- package/esm2022/core/select/constants.mjs +3 -3
- package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +3 -3
- package/esm2022/core/services/theme.service.mjs +60 -0
- package/esm2022/core/version.mjs +2 -2
- package/esm2022/datepicker/calendar-body.component.mjs +7 -5
- package/esm2022/datepicker/calendar-header.component.mjs +9 -8
- package/esm2022/datepicker/calendar.component.mjs +8 -17
- package/esm2022/datepicker/datepicker-animations.mjs +3 -3
- package/esm2022/datepicker/datepicker-input.directive.mjs +29 -20
- package/esm2022/datepicker/datepicker-toggle.component.mjs +6 -6
- package/esm2022/datepicker/datepicker.component.mjs +12 -12
- package/esm2022/datepicker/month-view.component.mjs +9 -18
- package/esm2022/dl/dl.component.mjs +3 -7
- package/esm2022/dropdown/dropdown-animations.mjs +4 -4
- package/esm2022/dropdown/dropdown-content.directive.mjs +3 -3
- package/esm2022/dropdown/dropdown-errors.mjs +6 -6
- package/esm2022/dropdown/dropdown-item.component.mjs +7 -6
- package/esm2022/dropdown/dropdown-trigger.directive.mjs +10 -9
- package/esm2022/dropdown/dropdown.component.mjs +9 -9
- package/esm2022/dropdown/dropdown.types.mjs +1 -1
- package/esm2022/file-upload/file-drop.mjs +43 -6
- package/esm2022/file-upload/file-upload.mjs +1 -1
- package/esm2022/file-upload/multiple-file-upload.component.mjs +13 -9
- package/esm2022/file-upload/single-file-upload.component.mjs +16 -13
- package/esm2022/form-field/cleaner.mjs +3 -3
- package/esm2022/form-field/form-field.mjs +12 -15
- package/esm2022/form-field/hint.mjs +16 -6
- package/esm2022/form-field/password-hint.mjs +25 -16
- package/esm2022/form-field/password-toggle.mjs +29 -12
- package/esm2022/form-field/prefix.mjs +3 -3
- package/esm2022/form-field/suffix.mjs +3 -3
- package/esm2022/form-field/validate.directive.mjs +15 -9
- package/esm2022/icon/icon-button.component.mjs +68 -0
- package/esm2022/icon/icon-item.component.mjs +27 -0
- package/esm2022/icon/icon.component.mjs +5 -90
- package/esm2022/icon/icon.module.mjs +4 -2
- package/esm2022/icon/public-api.mjs +3 -1
- package/esm2022/input/input-errors.mjs +2 -2
- package/esm2022/input/input-number.mjs +260 -44
- package/esm2022/input/input-password.mjs +5 -5
- package/esm2022/input/input.mjs +7 -7
- package/esm2022/link/link.component.mjs +14 -13
- package/esm2022/list/list-selection.component.mjs +23 -10
- package/esm2022/list/list.component.mjs +2 -2
- package/esm2022/list/list.module.mjs +8 -4
- package/esm2022/loader-overlay/loader-overlay.component.mjs +20 -19
- package/esm2022/modal/modal-control.service.mjs +5 -5
- package/esm2022/modal/modal-ref.class.mjs +1 -1
- package/esm2022/modal/modal.component.mjs +129 -134
- package/esm2022/modal/modal.module.mjs +13 -7
- package/esm2022/modal/modal.service.mjs +23 -23
- package/esm2022/modal/modal.type.mjs +1 -3
- package/esm2022/navbar/navbar-item.component.mjs +19 -18
- package/esm2022/navbar/navbar.component.mjs +18 -9
- package/esm2022/navbar/vertical-navbar.animation.mjs +2 -2
- package/esm2022/navbar/vertical-navbar.component.mjs +9 -6
- package/esm2022/popover/popover-animations.mjs +2 -2
- package/esm2022/popover/popover-confirm.component.mjs +9 -11
- package/esm2022/popover/popover.component.mjs +24 -24
- package/esm2022/progress-spinner/progress-spinner.component.mjs +1 -1
- package/esm2022/radio/radio.component.mjs +11 -8
- package/esm2022/risk-level/index.mjs +2 -0
- package/esm2022/risk-level/koobiq-components-risk-level.mjs +5 -0
- package/esm2022/risk-level/public-api.mjs +3 -0
- package/esm2022/risk-level/risk-level.component.mjs +40 -0
- package/esm2022/risk-level/risk-level.module.mjs +28 -0
- package/esm2022/select/select-option.directive.mjs +15 -3
- package/esm2022/select/select.component.mjs +47 -29
- package/esm2022/sidebar/sidebar-animations.mjs +2 -2
- package/esm2022/sidebar/sidebar.component.mjs +9 -9
- package/esm2022/sidepanel/sidepanel-container.component.mjs +3 -3
- package/esm2022/sidepanel/sidepanel-directives.mjs +8 -10
- package/esm2022/sidepanel/sidepanel.module.mjs +10 -4
- package/esm2022/splitter/splitter.component.mjs +3 -3
- package/esm2022/table/table.component.mjs +3 -3
- package/esm2022/tabs/paginated-tab-header.mjs +11 -2
- package/esm2022/tabs/tab-body.component.mjs +7 -7
- package/esm2022/tabs/tab-content.directive.mjs +3 -3
- package/esm2022/tabs/tab-group.component.mjs +16 -21
- package/esm2022/tabs/tab-header.component.mjs +2 -2
- package/esm2022/tabs/tab-label-wrapper.directive.mjs +4 -3
- package/esm2022/tabs/tab-label.directive.mjs +3 -3
- package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +21 -10
- package/esm2022/tabs/tab.component.mjs +14 -5
- package/esm2022/tabs/tabs-animations.mjs +2 -2
- package/esm2022/tabs/tabs.module.mjs +2 -6
- package/esm2022/tags/tag-default-options.mjs +1 -1
- package/esm2022/tags/tag-input.mjs +17 -15
- package/esm2022/tags/tag-list.component.mjs +15 -10
- package/esm2022/tags/tag.component.mjs +16 -16
- package/esm2022/textarea/textarea.component.mjs +4 -4
- package/esm2022/timepicker/timepicker.directive.mjs +10 -10
- package/esm2022/timezone/timezone-option.component.mjs +4 -4
- package/esm2022/timezone/timezone-select.component.mjs +5 -5
- package/esm2022/title/title.directive.mjs +6 -6
- package/esm2022/toast/toast-animations.mjs +2 -1
- package/esm2022/toast/toast-container.component.mjs +22 -8
- package/esm2022/toast/toast.component.mjs +30 -13
- package/esm2022/toast/toast.module.mjs +23 -8
- package/esm2022/toast/toast.service.mjs +2 -1
- package/esm2022/toast/toast.type.mjs +6 -1
- package/esm2022/toggle/toggle.component.mjs +4 -4
- package/esm2022/tooltip/tooltip.animations.mjs +2 -2
- package/esm2022/tooltip/tooltip.component.mjs +29 -28
- package/esm2022/tree/control/base-tree-control.mjs +1 -1
- package/esm2022/tree/control/flat-tree-control.mjs +4 -4
- package/esm2022/tree/control/tree-control.mjs +1 -1
- package/esm2022/tree/node.mjs +5 -5
- package/esm2022/tree/outlet.mjs +3 -3
- package/esm2022/tree/padding.directive.mjs +9 -9
- package/esm2022/tree/toggle.mjs +11 -12
- package/esm2022/tree/tree-base.mjs +3 -3
- package/esm2022/tree/tree-option.component.mjs +12 -10
- package/esm2022/tree/tree-selection.component.mjs +8 -6
- package/esm2022/tree/tree.mjs +3 -3
- package/esm2022/tree/tree.module.mjs +13 -4
- package/esm2022/tree-select/tree-select.component.mjs +28 -23
- package/fesm2022/koobiq-components-alert.mjs +2 -2
- package/fesm2022/koobiq-components-alert.mjs.map +1 -1
- package/fesm2022/koobiq-components-autocomplete.mjs +40 -37
- package/fesm2022/koobiq-components-autocomplete.mjs.map +1 -1
- package/fesm2022/koobiq-components-badge.mjs +166 -0
- package/fesm2022/koobiq-components-badge.mjs.map +1 -0
- package/fesm2022/koobiq-components-button-toggle.mjs +14 -14
- package/fesm2022/koobiq-components-button-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-button.mjs +3 -2
- package/fesm2022/koobiq-components-button.mjs.map +1 -1
- package/fesm2022/koobiq-components-checkbox.mjs +3 -3
- package/fesm2022/koobiq-components-checkbox.mjs.map +1 -1
- package/fesm2022/koobiq-components-code-block.mjs +5 -5
- package/fesm2022/koobiq-components-code-block.mjs.map +1 -1
- package/fesm2022/koobiq-components-core.mjs +535 -46
- package/fesm2022/koobiq-components-core.mjs.map +1 -1
- package/fesm2022/koobiq-components-datepicker.mjs +73 -79
- package/fesm2022/koobiq-components-datepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-dl.mjs +2 -6
- package/fesm2022/koobiq-components-dl.mjs.map +1 -1
- package/fesm2022/koobiq-components-dropdown.mjs +33 -31
- package/fesm2022/koobiq-components-dropdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-file-upload.mjs +65 -21
- package/fesm2022/koobiq-components-file-upload.mjs.map +1 -1
- package/fesm2022/koobiq-components-form-field.mjs +96 -59
- package/fesm2022/koobiq-components-form-field.mjs.map +1 -1
- package/fesm2022/koobiq-components-icon.mjs +10 -8
- package/fesm2022/koobiq-components-icon.mjs.map +1 -1
- package/fesm2022/koobiq-components-input.mjs +269 -55
- package/fesm2022/koobiq-components-input.mjs.map +1 -1
- package/fesm2022/koobiq-components-link.mjs +13 -12
- package/fesm2022/koobiq-components-link.mjs.map +1 -1
- package/fesm2022/koobiq-components-list.mjs +31 -14
- package/fesm2022/koobiq-components-list.mjs.map +1 -1
- package/fesm2022/koobiq-components-loader-overlay.mjs +19 -18
- package/fesm2022/koobiq-components-loader-overlay.mjs.map +1 -1
- package/fesm2022/koobiq-components-modal.mjs +164 -167
- package/fesm2022/koobiq-components-modal.mjs.map +1 -1
- package/fesm2022/koobiq-components-navbar.mjs +42 -33
- package/fesm2022/koobiq-components-navbar.mjs.map +1 -1
- package/fesm2022/koobiq-components-popover.mjs +32 -33
- package/fesm2022/koobiq-components-popover.mjs.map +1 -1
- package/fesm2022/koobiq-components-progress-spinner.mjs.map +1 -1
- package/fesm2022/koobiq-components-radio.mjs +10 -7
- package/fesm2022/koobiq-components-radio.mjs.map +1 -1
- package/fesm2022/koobiq-components-risk-level.mjs +72 -0
- package/fesm2022/koobiq-components-risk-level.mjs.map +1 -0
- package/fesm2022/koobiq-components-select.mjs +60 -30
- package/fesm2022/koobiq-components-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-sidebar.mjs +8 -8
- package/fesm2022/koobiq-components-sidebar.mjs.map +1 -1
- package/fesm2022/koobiq-components-sidepanel.mjs +19 -14
- package/fesm2022/koobiq-components-sidepanel.mjs.map +1 -1
- package/fesm2022/koobiq-components-splitter.mjs +2 -2
- package/fesm2022/koobiq-components-splitter.mjs.map +1 -1
- package/fesm2022/koobiq-components-table.mjs +2 -2
- package/fesm2022/koobiq-components-table.mjs.map +1 -1
- package/fesm2022/koobiq-components-tabs.mjs +74 -53
- package/fesm2022/koobiq-components-tabs.mjs.map +1 -1
- package/fesm2022/koobiq-components-tags.mjs +45 -38
- package/fesm2022/koobiq-components-tags.mjs.map +1 -1
- package/fesm2022/koobiq-components-textarea.mjs +3 -3
- package/fesm2022/koobiq-components-textarea.mjs.map +1 -1
- package/fesm2022/koobiq-components-timepicker.mjs +9 -9
- package/fesm2022/koobiq-components-timepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-timezone.mjs +7 -7
- package/fesm2022/koobiq-components-timezone.mjs.map +1 -1
- package/fesm2022/koobiq-components-title.mjs +5 -5
- package/fesm2022/koobiq-components-title.mjs.map +1 -1
- package/fesm2022/koobiq-components-toast.mjs +71 -22
- package/fesm2022/koobiq-components-toast.mjs.map +1 -1
- package/fesm2022/koobiq-components-toggle.mjs +3 -3
- package/fesm2022/koobiq-components-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-tooltip.mjs +29 -28
- package/fesm2022/koobiq-components-tooltip.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree-select.mjs +27 -22
- package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree.mjs +67 -54
- package/fesm2022/koobiq-components-tree.mjs.map +1 -1
- package/file-upload/_file-upload-theme.scss +54 -40
- package/file-upload/file-drop.d.ts +3 -2
- package/file-upload/file-upload.d.ts +4 -1
- package/file-upload/file-upload.scss +2 -9
- package/file-upload/multiple-file-upload.component.d.ts +6 -5
- package/file-upload/multiple-file-upload.component.scss +170 -59
- package/file-upload/single-file-upload.component.d.ts +6 -5
- package/file-upload/single-file-upload.component.scss +42 -22
- package/form-field/_form-field-theme.scss +3 -6
- package/form-field/_hint-theme.scss +6 -2
- package/form-field/cleaner.d.ts +1 -1
- package/form-field/form-field.d.ts +3 -4
- package/form-field/form-field.scss +2 -2
- package/form-field/hint.d.ts +4 -1
- package/form-field/hint.scss +9 -1
- package/form-field/password-hint.d.ts +7 -3
- package/form-field/password-hint.scss +6 -0
- package/form-field/password-toggle.d.ts +13 -7
- package/form-field/prefix.d.ts +1 -1
- package/form-field/suffix.d.ts +1 -1
- package/form-field/validate.directive.d.ts +1 -1
- package/icon/_icon-button-theme.scss +129 -0
- package/icon/_icon-item-theme.scss +41 -0
- package/icon/_icon-theme.scss +1 -232
- package/icon/icon-button.component.d.ts +22 -0
- package/icon/icon-button.scss +33 -0
- package/icon/icon-item.component.d.ts +10 -0
- package/icon/icon-item.scss +18 -0
- package/icon/icon.component.d.ts +1 -25
- package/icon/icon.module.d.ts +6 -4
- package/icon/icon.scss +0 -41
- package/icon/public-api.d.ts +2 -0
- package/input/_input-theme.scss +2 -1
- package/input/input-number.d.ts +61 -10
- package/input/input-password.d.ts +1 -1
- package/input/input.d.ts +2 -2
- package/input/input.scss +3 -1
- package/link/_link-theme.scss +101 -92
- package/link/link.component.d.ts +4 -4
- package/list/_list-theme.scss +36 -17
- package/list/list-selection.component.d.ts +6 -2
- package/list/list.module.d.ts +1 -1
- package/list/list.scss +6 -19
- package/loader-overlay/_loader-overlay-theme.scss +43 -11
- package/loader-overlay/loader-overlay.component.d.ts +6 -5
- package/loader-overlay/loader-overlay.scss +56 -22
- package/markdown/_markdown-theme.scss +2 -2
- package/modal/README.md +5 -5
- package/modal/_modal-confirm.scss +5 -37
- package/modal/_modal-theme.scss +14 -52
- package/modal/modal-ref.class.d.ts +2 -2
- package/modal/modal.component.d.ts +53 -52
- package/modal/modal.module.d.ts +2 -1
- package/modal/modal.scss +50 -31
- package/modal/modal.type.d.ts +35 -36
- package/navbar/_navbar-theme.scss +2 -2
- package/navbar/navbar-item.component.d.ts +4 -3
- package/navbar/navbar.component.d.ts +5 -2
- package/navbar/vertical-navbar.component.d.ts +4 -2
- package/package.json +48 -38
- package/popover/README.md +14 -14
- package/popover/_popover-theme.scss +15 -78
- package/popover/popover-animations.d.ts +1 -1
- package/popover/popover-confirm.component.d.ts +1 -3
- package/popover/popover.component.d.ts +3 -3
- package/popover/popover.scss +60 -50
- package/prebuilt-themes/dark-theme.css +1 -1
- package/prebuilt-themes/light-theme.css +1 -1
- package/progress-spinner/progress-spinner.component.d.ts +2 -2
- package/radio/_radio-theme.scss +17 -4
- package/radio/radio.component.d.ts +2 -2
- package/radio/radio.scss +13 -0
- package/risk-level/README.md +0 -0
- package/risk-level/_risk-level-theme.scss +88 -0
- package/risk-level/index.d.ts +1 -0
- package/risk-level/public-api.d.ts +2 -0
- package/risk-level/risk-level.component.d.ts +18 -0
- package/risk-level/risk-level.component.scss +26 -0
- package/risk-level/risk-level.module.d.ts +10 -0
- package/select/_select-theme.scss +12 -4
- package/select/select-option.directive.d.ts +2 -0
- package/select/select.component.d.ts +15 -12
- package/select/select.scss +6 -190
- package/sidebar/sidebar-animations.d.ts +1 -1
- package/sidebar/sidebar.component.d.ts +3 -3
- package/sidepanel/_sidepanel-theme.scss +11 -41
- package/sidepanel/sidepanel-directives.d.ts +0 -2
- package/sidepanel/sidepanel.scss +33 -35
- package/splitter/_splitter-theme.scss +1 -0
- package/splitter/splitter.component.d.ts +1 -1
- package/table/_table-theme.scss +1 -1
- package/table/table.component.d.ts +1 -1
- package/tabs/_tabs-common.scss +28 -147
- package/tabs/_tabs-theme.scss +81 -175
- package/tabs/paginated-tab-header.d.ts +1 -0
- package/tabs/tab-body.component.d.ts +1 -1
- package/tabs/tab-content.directive.d.ts +1 -1
- package/tabs/tab-group.component.d.ts +5 -8
- package/tabs/tab-group.scss +10 -10
- package/tabs/tab-header.scss +2 -24
- package/tabs/tab-label-wrapper.directive.d.ts +1 -1
- package/tabs/tab-label.directive.d.ts +1 -1
- package/tabs/tab-nav-bar/tab-nav-bar.d.ts +4 -2
- package/tabs/tab-nav-bar/tab-nav-bar.scss +9 -16
- package/tabs/tab.component.d.ts +1 -1
- package/tabs/tabs-animations.d.ts +1 -1
- package/tabs/tabs.module.d.ts +1 -1
- package/tags/_tag-theme.scss +1 -25
- package/tags/tag-default-options.d.ts +4 -0
- package/tags/tag-input.d.ts +2 -2
- package/tags/tag-list.component.d.ts +3 -2
- package/tags/tag-list.scss +26 -16
- package/tags/tag.component.d.ts +6 -6
- package/textarea/textarea.component.d.ts +1 -1
- package/timepicker/timepicker.directive.d.ts +2 -2
- package/timezone/timezone-option.component.d.ts +1 -1
- package/timezone/timezone-select.component.d.ts +1 -1
- package/title/title.directive.d.ts +1 -1
- package/toast/_toast-theme.scss +21 -33
- package/toast/toast-animations.d.ts +1 -0
- package/toast/toast-container.component.d.ts +7 -3
- package/toast/toast-container.component.scss +2 -1
- package/toast/toast.component.d.ts +6 -1
- package/toast/toast.component.scss +41 -34
- package/toast/toast.module.d.ts +1 -1
- package/toast/toast.service.d.ts +2 -0
- package/toast/toast.type.d.ts +8 -5
- package/toggle/_toggle-theme.scss +9 -1
- package/toggle/toggle.component.d.ts +1 -1
- package/toggle/toggle.scss +5 -2
- package/tooltip/tooltip.animations.d.ts +1 -1
- package/tooltip/tooltip.component.d.ts +5 -5
- package/tree/_tree-theme.scss +46 -34
- package/tree/control/base-tree-control.d.ts +1 -1
- package/tree/control/tree-control.d.ts +1 -1
- package/tree/node.d.ts +1 -1
- package/tree/outlet.d.ts +1 -1
- package/tree/padding.directive.d.ts +1 -1
- package/tree/toggle.d.ts +3 -3
- package/tree/tree-base.d.ts +1 -1
- package/tree/tree-option.component.d.ts +1 -2
- package/tree/tree-option.scss +40 -27
- package/tree/tree-selection.component.d.ts +1 -1
- package/tree/tree.d.ts +1 -1
- package/tree/tree.module.d.ts +2 -1
- package/tree-select/_tree-select-theme.scss +13 -3
- package/tree-select/tree-select.component.d.ts +6 -4
- package/tree-select/tree-select.scss +5 -194
- package/core/styles/theming/_badges.scss +0 -57
- package/core/styles/theming/prebuilt/light-theme.scss +0 -20
- package/list/_list-base.scss +0 -54
|
@@ -1,20 +1,22 @@
|
|
|
1
|
+
import * as i3 from '@angular/cdk/a11y';
|
|
2
|
+
import { A11yModule, FocusTrapFactory, ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';
|
|
1
3
|
import * as i1 from '@angular/cdk/overlay';
|
|
2
4
|
import { OverlayRef, OverlayModule } from '@angular/cdk/overlay';
|
|
3
|
-
import * as
|
|
5
|
+
import * as i4 from '@angular/common';
|
|
4
6
|
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
5
7
|
import * as i0 from '@angular/core';
|
|
6
8
|
import { Injectable, Optional, SkipSelf, Pipe, EventEmitter, TemplateRef, Type, Injector, ViewContainerRef, ElementRef, Component, ViewEncapsulation, ChangeDetectionStrategy, Inject, Input, Output, ViewChild, ViewChildren, Directive, NgModule } from '@angular/core';
|
|
7
9
|
import { ESCAPE, ENTER } from '@koobiq/cdk/keycodes';
|
|
8
|
-
import {
|
|
10
|
+
import { KbqComponentColors } from '@koobiq/components/core';
|
|
11
|
+
import { take, filter } from 'rxjs/operators';
|
|
9
12
|
import { Subject } from 'rxjs';
|
|
10
|
-
import * as i4 from '@angular/cdk/a11y';
|
|
11
|
-
import { A11yModule } from '@angular/cdk/a11y';
|
|
12
13
|
import * as i5 from '@koobiq/components/button';
|
|
13
14
|
import { KbqButtonModule } from '@koobiq/components/button';
|
|
14
15
|
import * as i6 from '@koobiq/components/icon';
|
|
15
16
|
import { KbqIconModule } from '@koobiq/components/icon';
|
|
17
|
+
import * as i7 from '@koobiq/components/title';
|
|
18
|
+
import { KbqTitleModule } from '@koobiq/components/title';
|
|
16
19
|
import { ComponentPortal } from '@angular/cdk/portal';
|
|
17
|
-
import { filter } from 'rxjs/operators';
|
|
18
20
|
|
|
19
21
|
class KbqModalControlService {
|
|
20
22
|
// Track singleton afterAllClose through over the injection tree
|
|
@@ -68,20 +70,20 @@ class KbqModalControlService {
|
|
|
68
70
|
}
|
|
69
71
|
handleMultipleMasks(modalRef) {
|
|
70
72
|
const modals = Array.from(this.registeredMetaMap.values()).map((v) => v.modalRef);
|
|
71
|
-
if (modals.filter((modal) => modal.
|
|
73
|
+
if (modals.filter((modal) => modal.kbqVisible).length > 1) {
|
|
72
74
|
const otherModals = modals.splice(0, modals.length - 1)
|
|
73
|
-
.filter((modal) => modal.
|
|
75
|
+
.filter((modal) => modal.kbqVisible && modal.kbqMask);
|
|
74
76
|
// hide other masks
|
|
75
77
|
setTimeout(() => {
|
|
76
78
|
otherModals.forEach((modal) => {
|
|
77
|
-
modal.getInstance().
|
|
79
|
+
modal.getInstance().kbqMask = false;
|
|
78
80
|
modal.markForCheck();
|
|
79
81
|
});
|
|
80
82
|
});
|
|
81
83
|
// show other masks on close
|
|
82
84
|
modalRef.afterClose.subscribe(() => {
|
|
83
85
|
otherModals.forEach((modal) => {
|
|
84
|
-
modal.getInstance().
|
|
86
|
+
modal.getInstance().kbqMask = true;
|
|
85
87
|
modal.markForCheck();
|
|
86
88
|
});
|
|
87
89
|
});
|
|
@@ -127,8 +129,6 @@ var ModalSize;
|
|
|
127
129
|
(function (ModalSize) {
|
|
128
130
|
ModalSize["Small"] = "small";
|
|
129
131
|
ModalSize["Medium"] = "medium";
|
|
130
|
-
// Normal is deprecated and will be deleted in 16.x
|
|
131
|
-
ModalSize["Normal"] = "medium";
|
|
132
132
|
ModalSize["Large"] = "large";
|
|
133
133
|
})(ModalSize || (ModalSize = {}));
|
|
134
134
|
|
|
@@ -150,37 +150,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.5", ngImpor
|
|
|
150
150
|
// Duration when perform animations (ms)
|
|
151
151
|
const MODAL_ANIMATE_DURATION = 200;
|
|
152
152
|
class KbqModalComponent extends KbqModalRef {
|
|
153
|
-
get
|
|
154
|
-
set
|
|
155
|
-
get
|
|
156
|
-
set
|
|
157
|
-
get
|
|
158
|
-
set
|
|
159
|
-
get
|
|
160
|
-
set
|
|
161
|
-
get
|
|
162
|
-
set
|
|
163
|
-
get
|
|
164
|
-
set
|
|
165
|
-
// Observable alias for
|
|
153
|
+
get kbqVisible() { return this._kbqVisible; }
|
|
154
|
+
set kbqVisible(value) { this._kbqVisible = value; }
|
|
155
|
+
get kbqClosable() { return this._kbqClosable; }
|
|
156
|
+
set kbqClosable(value) { this._kbqClosable = value; }
|
|
157
|
+
get kbqMask() { return this._kbqMask; }
|
|
158
|
+
set kbqMask(value) { this._kbqMask = value; }
|
|
159
|
+
get kbqMaskClosable() { return this._kbqMaskClosable; }
|
|
160
|
+
set kbqMaskClosable(value) { this._kbqMaskClosable = value; }
|
|
161
|
+
get kbqOkLoading() { return this._kbqOkLoading; }
|
|
162
|
+
set kbqOkLoading(value) { this._kbqOkLoading = value; }
|
|
163
|
+
get kbqCancelLoading() { return this._kbqCancelLoading; }
|
|
164
|
+
set kbqCancelLoading(value) { this._kbqCancelLoading = value; }
|
|
165
|
+
// Observable alias for kbqAfterOpen
|
|
166
166
|
get afterOpen() {
|
|
167
|
-
return this.
|
|
167
|
+
return this.kbqAfterOpen.asObservable();
|
|
168
168
|
}
|
|
169
|
-
// Observable alias for
|
|
169
|
+
// Observable alias for kbqAfterClose
|
|
170
170
|
get afterClose() {
|
|
171
|
-
return this.
|
|
171
|
+
return this.kbqAfterClose.asObservable();
|
|
172
172
|
}
|
|
173
173
|
get okText() {
|
|
174
|
-
return this.
|
|
174
|
+
return this.kbqOkText;
|
|
175
175
|
}
|
|
176
176
|
get cancelText() {
|
|
177
|
-
return this.
|
|
177
|
+
return this.kbqCancelText;
|
|
178
178
|
}
|
|
179
179
|
// Indicate whether this dialog should hidden
|
|
180
180
|
get hidden() {
|
|
181
|
-
return !this.
|
|
181
|
+
return !this.kbqVisible && !this.animationState;
|
|
182
182
|
}
|
|
183
|
-
constructor(overlay, renderer, cfr, elementRef, viewContainer, modalControl, changeDetector, document) {
|
|
183
|
+
constructor(overlay, renderer, cfr, elementRef, viewContainer, modalControl, changeDetector, focusMonitor, document) {
|
|
184
184
|
super();
|
|
185
185
|
this.overlay = overlay;
|
|
186
186
|
this.renderer = renderer;
|
|
@@ -189,47 +189,46 @@ class KbqModalComponent extends KbqModalRef {
|
|
|
189
189
|
this.viewContainer = viewContainer;
|
|
190
190
|
this.modalControl = modalControl;
|
|
191
191
|
this.changeDetector = changeDetector;
|
|
192
|
+
this.focusMonitor = focusMonitor;
|
|
192
193
|
this.document = document;
|
|
193
|
-
this.
|
|
194
|
-
this.
|
|
195
|
-
this.
|
|
196
|
-
this.
|
|
197
|
-
this.
|
|
198
|
-
this.
|
|
199
|
-
this.
|
|
200
|
-
this.
|
|
201
|
-
this.
|
|
202
|
-
this.
|
|
194
|
+
this.componentColors = KbqComponentColors;
|
|
195
|
+
this.kbqModalType = 'default';
|
|
196
|
+
this._kbqVisible = false;
|
|
197
|
+
this.kbqVisibleChange = new EventEmitter();
|
|
198
|
+
this.kbqZIndex = 1000;
|
|
199
|
+
this.kbqSize = ModalSize.Medium;
|
|
200
|
+
this.kbqCloseByESC = true;
|
|
201
|
+
this._kbqClosable = true;
|
|
202
|
+
this._kbqMask = true;
|
|
203
|
+
this._kbqMaskClosable = false;
|
|
203
204
|
// Trigger when modal open(visible) after animations
|
|
204
|
-
this.
|
|
205
|
+
this.kbqAfterOpen = new EventEmitter();
|
|
205
206
|
// Trigger when modal leave-animation over
|
|
206
|
-
this.
|
|
207
|
-
this.
|
|
208
|
-
this.
|
|
209
|
-
this.
|
|
210
|
-
this.
|
|
211
|
-
this.
|
|
212
|
-
this.
|
|
213
|
-
this.isTopOverflow = false;
|
|
214
|
-
this.isBottomOverflow = false;
|
|
207
|
+
this.kbqAfterClose = new EventEmitter();
|
|
208
|
+
this.kbqOkType = KbqComponentColors.Contrast;
|
|
209
|
+
this.kbqRestoreFocus = true;
|
|
210
|
+
this._kbqOkLoading = false;
|
|
211
|
+
this.kbqOnOk = new EventEmitter();
|
|
212
|
+
this._kbqCancelLoading = false;
|
|
213
|
+
this.kbqOnCancel = new EventEmitter();
|
|
215
214
|
// The origin point that animation based on
|
|
216
215
|
this.transformOrigin = '0px 0px 0px';
|
|
217
|
-
this.
|
|
216
|
+
this.kbqGetContainer = () => this.overlay.create();
|
|
218
217
|
}
|
|
219
218
|
ngOnInit() {
|
|
220
219
|
// Create component along without View
|
|
221
|
-
if (this.isComponent(this.
|
|
222
|
-
this.createDynamicComponent(this.
|
|
220
|
+
if (this.isComponent(this.kbqContent)) {
|
|
221
|
+
this.createDynamicComponent(this.kbqContent);
|
|
223
222
|
}
|
|
224
223
|
// Setup default button options
|
|
225
|
-
if (this.isModalButtons(this.
|
|
226
|
-
this.
|
|
224
|
+
if (this.isModalButtons(this.kbqFooter)) {
|
|
225
|
+
this.kbqFooter = this.formatModalButtons(this.kbqFooter);
|
|
227
226
|
}
|
|
228
|
-
if (this.isComponent(this.
|
|
229
|
-
this.createDynamicComponent(this.
|
|
227
|
+
if (this.isComponent(this.kbqComponent)) {
|
|
228
|
+
this.createDynamicComponent(this.kbqComponent);
|
|
230
229
|
}
|
|
231
230
|
// Place the modal dom to elsewhere
|
|
232
|
-
this.container = typeof this.
|
|
231
|
+
this.container = typeof this.kbqGetContainer === 'function' ? this.kbqGetContainer() : this.kbqGetContainer;
|
|
233
232
|
if (this.container instanceof HTMLElement) {
|
|
234
233
|
this.container.appendChild(this.elementRef.nativeElement);
|
|
235
234
|
}
|
|
@@ -242,13 +241,13 @@ class KbqModalComponent extends KbqModalRef {
|
|
|
242
241
|
}
|
|
243
242
|
// [NOTE] NOT available when using by service!
|
|
244
243
|
// Because ngOnChanges never be called when using by service,
|
|
245
|
-
// here we can't support "
|
|
246
|
-
// BUT: User also can change "
|
|
244
|
+
// here we can't support "kbqContent"(Component) etc. as inputs that initialized dynamically.
|
|
245
|
+
// BUT: User also can change "kbqContent" dynamically to trigger UI changes
|
|
247
246
|
// (provided you don't use Component that needs initializations)
|
|
248
247
|
ngOnChanges(changes) {
|
|
249
|
-
if (changes.
|
|
248
|
+
if (changes.kbqVisible) {
|
|
250
249
|
// Do not trigger animation while initializing
|
|
251
|
-
this.handleVisibleStateChange(this.
|
|
250
|
+
this.handleVisibleStateChange(this.kbqVisible, !changes.kbqVisible.firstChange);
|
|
252
251
|
}
|
|
253
252
|
}
|
|
254
253
|
ngAfterViewInit() {
|
|
@@ -257,40 +256,30 @@ class KbqModalComponent extends KbqModalRef {
|
|
|
257
256
|
this.bodyContainer.insert(this.contentComponentRef.hostView);
|
|
258
257
|
}
|
|
259
258
|
this.getElement().getElementsByTagName('button')[0]?.focus();
|
|
260
|
-
|
|
261
|
-
if (autoFocusedButton.nativeElement.autofocus) {
|
|
262
|
-
autoFocusedButton.nativeElement.focus();
|
|
263
|
-
break;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
this.checkOverflow();
|
|
259
|
+
this.getElement().querySelector('button[autofocus]')?.focus();
|
|
267
260
|
}
|
|
268
261
|
ngOnDestroy() {
|
|
269
262
|
if (this.container instanceof OverlayRef) {
|
|
270
263
|
this.container.dispose();
|
|
271
264
|
}
|
|
272
265
|
}
|
|
273
|
-
checkOverflow() {
|
|
274
|
-
const nativeElement = this.modalBody?.nativeElement;
|
|
275
|
-
if (!nativeElement) {
|
|
276
|
-
return;
|
|
277
|
-
}
|
|
278
|
-
const scrollTop = nativeElement.scrollTop;
|
|
279
|
-
const offsetHeight = nativeElement.offsetHeight;
|
|
280
|
-
const scrollHeight = nativeElement.scrollHeight;
|
|
281
|
-
this.isTopOverflow = scrollTop > 0;
|
|
282
|
-
this.isBottomOverflow = scrollTop + offsetHeight < scrollHeight;
|
|
283
|
-
}
|
|
284
266
|
open() {
|
|
285
267
|
this.focusedElementBeforeOpen = this.document.activeElement;
|
|
268
|
+
this.focusMonitor.monitor(this.modalContainer, true)
|
|
269
|
+
.pipe(take(1))
|
|
270
|
+
.subscribe((origin) => {
|
|
271
|
+
this.previouslyFocusedElementOrigin = origin;
|
|
272
|
+
this.focusMonitor.stopMonitoring(this.modalContainer);
|
|
273
|
+
});
|
|
286
274
|
this.changeVisibleFromInside(true);
|
|
287
275
|
}
|
|
288
276
|
close(result) {
|
|
289
|
-
|
|
290
|
-
this.focusedElementBeforeOpen
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
277
|
+
this.changeVisibleFromInside(false, result).then(() => {
|
|
278
|
+
if (this.kbqRestoreFocus && this.focusedElementBeforeOpen) {
|
|
279
|
+
this.focusMonitor.focusVia(this.focusedElementBeforeOpen, this.previouslyFocusedElementOrigin);
|
|
280
|
+
this.focusedElementBeforeOpen = null;
|
|
281
|
+
}
|
|
282
|
+
});
|
|
294
283
|
}
|
|
295
284
|
// Destroy equals Close
|
|
296
285
|
destroy(result) {
|
|
@@ -321,16 +310,16 @@ class KbqModalComponent extends KbqModalRef {
|
|
|
321
310
|
return this.getElement().getElementsByClassName('kbq-modal-footer').item(0);
|
|
322
311
|
}
|
|
323
312
|
onClickMask($event) {
|
|
324
|
-
if (this.
|
|
325
|
-
this.
|
|
313
|
+
if (this.kbqMask &&
|
|
314
|
+
this.kbqMaskClosable &&
|
|
326
315
|
$event.target.classList.contains('kbq-modal-wrap') &&
|
|
327
|
-
this.
|
|
316
|
+
this.kbqVisible) {
|
|
328
317
|
this.onClickOkCancel('cancel');
|
|
329
318
|
}
|
|
330
319
|
}
|
|
331
320
|
// tslint:disable-next-line: no-reserved-keywords
|
|
332
321
|
isModalType(type) {
|
|
333
|
-
return this.
|
|
322
|
+
return this.kbqModalType === type;
|
|
334
323
|
}
|
|
335
324
|
onKeyDown(event) {
|
|
336
325
|
// tslint:disable-next-line:deprecation .key isn't supported in Edge
|
|
@@ -340,7 +329,7 @@ class KbqModalComponent extends KbqModalRef {
|
|
|
340
329
|
}
|
|
341
330
|
// tslint:disable-next-line:deprecation .key isn't supported in Edge
|
|
342
331
|
if (event.ctrlKey && event.keyCode === ENTER) {
|
|
343
|
-
if (this.
|
|
332
|
+
if (this.kbqModalType === 'confirm') {
|
|
344
333
|
this.triggerOk();
|
|
345
334
|
}
|
|
346
335
|
this.getElement().querySelector('[kbq-modal-main-action]')?.click();
|
|
@@ -349,22 +338,25 @@ class KbqModalComponent extends KbqModalRef {
|
|
|
349
338
|
}
|
|
350
339
|
// AoT
|
|
351
340
|
onClickCloseBtn() {
|
|
352
|
-
if (this.
|
|
341
|
+
if (this.kbqVisible) {
|
|
353
342
|
this.onClickOkCancel('cancel');
|
|
354
343
|
}
|
|
355
344
|
}
|
|
356
345
|
// AoT
|
|
357
346
|
// tslint:disable-next-line: no-reserved-keywords
|
|
358
347
|
onClickOkCancel(type) {
|
|
359
|
-
|
|
360
|
-
|
|
348
|
+
this.handleCloseResult(type, (doClose) => doClose !== false);
|
|
349
|
+
}
|
|
350
|
+
handleCloseResult(triggerType, canClose) {
|
|
351
|
+
const trigger = { ok: this.kbqOnOk, cancel: this.kbqOnCancel }[triggerType];
|
|
352
|
+
const loadingKey = { ok: 'kbqOkLoading', cancel: 'kbqCancelLoading' }[triggerType];
|
|
361
353
|
if (trigger instanceof EventEmitter) {
|
|
362
354
|
trigger.emit(this.getContentComponent());
|
|
363
355
|
}
|
|
364
356
|
else if (typeof trigger === 'function') {
|
|
365
357
|
const result = trigger(this.getContentComponent());
|
|
366
358
|
// Users can return "false" to prevent closing by default
|
|
367
|
-
const caseClose = (doClose) => (doClose
|
|
359
|
+
const caseClose = (doClose) => canClose(doClose) && this.close(doClose);
|
|
368
360
|
if (isPromise(result)) {
|
|
369
361
|
this[loadingKey] = true;
|
|
370
362
|
const handleThen = (doClose) => {
|
|
@@ -404,7 +396,7 @@ class KbqModalComponent extends KbqModalRef {
|
|
|
404
396
|
}
|
|
405
397
|
return typeof value === 'function' ? value.apply(options, args) : value;
|
|
406
398
|
}
|
|
407
|
-
// On
|
|
399
|
+
// On kbqFooter's modal button click
|
|
408
400
|
// AoT
|
|
409
401
|
onButtonClick(button) {
|
|
410
402
|
// Call onClick directly
|
|
@@ -426,21 +418,21 @@ class KbqModalComponent extends KbqModalRef {
|
|
|
426
418
|
// Emit open/close event after animations over
|
|
427
419
|
.then(() => {
|
|
428
420
|
if (visible) {
|
|
429
|
-
this.
|
|
421
|
+
this.kbqAfterOpen.emit();
|
|
430
422
|
}
|
|
431
423
|
else {
|
|
432
|
-
this.
|
|
424
|
+
this.kbqAfterClose.emit(closeResult);
|
|
433
425
|
// Show/hide scrollbar when animation is over
|
|
434
426
|
this.changeBodyOverflow();
|
|
435
427
|
}
|
|
436
428
|
});
|
|
437
429
|
}
|
|
438
|
-
// Change
|
|
430
|
+
// Change kbqVisible from inside
|
|
439
431
|
changeVisibleFromInside(visible, closeResult) {
|
|
440
|
-
if (this.
|
|
441
|
-
// Change
|
|
442
|
-
this.
|
|
443
|
-
this.
|
|
432
|
+
if (this.kbqVisible !== visible) {
|
|
433
|
+
// Change kbqVisible value immediately
|
|
434
|
+
this.kbqVisible = visible;
|
|
435
|
+
this.kbqVisibleChange.emit(visible);
|
|
444
436
|
return this.handleVisibleStateChange(visible, true, closeResult);
|
|
445
437
|
}
|
|
446
438
|
return Promise.resolve();
|
|
@@ -511,9 +503,9 @@ class KbqModalComponent extends KbqModalRef {
|
|
|
511
503
|
parent: this.viewContainer.injector
|
|
512
504
|
});
|
|
513
505
|
this.contentComponentRef = factory.create(childInjector);
|
|
514
|
-
if (this.
|
|
506
|
+
if (this.kbqComponentParams) {
|
|
515
507
|
// @ts-ignore
|
|
516
|
-
Object.assign(this.contentComponentRef.instance, this.
|
|
508
|
+
Object.assign(this.contentComponentRef.instance, this.kbqComponentParams);
|
|
517
509
|
}
|
|
518
510
|
// Do the first change detection immediately
|
|
519
511
|
// (or we do detection at ngAfterViewInit, multi-changes error will be thrown)
|
|
@@ -540,78 +532,78 @@ class KbqModalComponent extends KbqModalRef {
|
|
|
540
532
|
this.renderer.removeStyle(this.document.body, 'overflow');
|
|
541
533
|
}
|
|
542
534
|
}
|
|
543
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: KbqModalComponent, deps: [{ token: i1.Overlay }, { token: i0.Renderer2 }, { token: i0.ComponentFactoryResolver }, { token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: KbqModalControlService }, { token: i0.ChangeDetectorRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
544
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.5", type: KbqModalComponent, selector: "kbq-modal", inputs: { mcModalType: "mcModalType", mcComponent: "mcComponent", mcContent: "mcContent", mcComponentParams: "mcComponentParams", mcFooter: "mcFooter", mcVisible: "mcVisible", mcZIndex: "mcZIndex", mcWidth: "mcWidth", mcSize: "mcSize", mcWrapClassName: "mcWrapClassName", mcClassName: "mcClassName", mcStyle: "mcStyle", mcTitle: "mcTitle", mcCloseByESC: "mcCloseByESC", mcClosable: "mcClosable", mcMask: "mcMask", mcMaskClosable: "mcMaskClosable", mcMaskStyle: "mcMaskStyle", mcBodyStyle: "mcBodyStyle", mcOkText: "mcOkText", mcOkType: "mcOkType", mcRestoreFocus: "mcRestoreFocus", mcOkLoading: "mcOkLoading", mcOnOk: "mcOnOk", mcCancelText: "mcCancelText", mcCancelLoading: "mcCancelLoading", mcOnCancel: "mcOnCancel", mcGetContainer: "mcGetContainer" }, outputs: { mcVisibleChange: "mcVisibleChange", mcAfterOpen: "mcAfterOpen", mcAfterClose: "mcAfterClose", mcOnOk: "mcOnOk", mcOnCancel: "mcOnCancel" }, host: { listeners: { "keydown": "onKeyDown($event)" } }, viewQueries: [{ propertyName: "modalContainer", first: true, predicate: ["modalContainer"], descendants: true, static: true }, { propertyName: "bodyContainer", first: true, predicate: ["bodyContainer"], descendants: true, read: ViewContainerRef }, { propertyName: "modalBody", first: true, predicate: ["modalBody"], descendants: true }, { propertyName: "autoFocusedButtons", predicate: ["autoFocusedButton"], descendants: true, read: ElementRef }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<!-- Compatible: the <ng-content> can appear only once -->\n<ng-template #tplOriginContent>\n <ng-content></ng-content>\n</ng-template>\n\n<div>\n <div *ngIf=\"mcMask\"\n class=\"kbq-modal-mask\"\n [ngClass]=\"maskAnimationClassMap\"\n [class.kbq-modal-mask-hidden]=\"hidden\"\n [ngStyle]=\"mcMaskStyle\"\n [style.zIndex]=\"mcZIndex\"\n ></div>\n <div (mousedown)=\"onClickMask($event)\"\n class=\"kbq-modal-wrap {{ mcWrapClassName }}\"\n [style.zIndex]=\"mcZIndex\"\n [style.display]=\"hidden ? 'none' : ''\"\n tabindex=\"-1\">\n\n <div #modalContainer\n class=\"kbq-modal {{ mcClassName }} kbq-modal_{{ mcSize }}\"\n [ngClass]=\"modalAnimationClassMap\"\n [ngStyle]=\"mcStyle\"\n [style.width]=\"mcWidth | toCssUnit\"\n [style.transform-origin]=\"transformOrigin\">\n\n <div class=\"kbq-modal-content\" cdkTrapFocus>\n <button *ngIf=\"mcClosable\"\n kbq-button\n (click)=\"onClickCloseBtn()\"\n class=\"kbq-modal-close kbq-button_transparent\">\n <i kbq-icon=\"mc-close-L_16\" class=\"kbq-icon kbq-icon_light\" [color]=\"themePalette.Secondary\"></i>\n </button>\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isModalType('default')\"\n [ngTemplateOutlet]=\"tplContentDefault\"></ng-container>\n <ng-container *ngSwitchCase=\"isModalType('confirm')\"\n [ngTemplateOutlet]=\"tplContentConfirm\"></ng-container>\n <ng-container *ngSwitchCase=\"isModalType('custom')\"\n [ngTemplateOutlet]=\"tplContentCustom\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #tplContentCustom>\n <ng-container #bodyContainer></ng-container>\n</ng-template>\n\n\n<!-- [Predefined] Default Modal Content -->\n<ng-template #tplContentDefault>\n <div *ngIf=\"mcTitle\" class=\"kbq-modal-header\" [class.kbq-modal-body_top-overflow]=\"isTopOverflow\">\n <div class=\"kbq-modal-title\">\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(mcTitle)\" [ngTemplateOutlet]=\"$any(mcTitle)\"></ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(mcTitle)\">\n <div [innerHTML]=\"mcTitle\"></div>\n </ng-container>\n </ng-container>\n </div>\n </div>\n <div class=\"kbq-modal-body kbq-scrollbar\" #modalBody [ngStyle]=\"mcBodyStyle\" (scroll)=\"checkOverflow()\">\n <ng-container #bodyContainer>\n <ng-container *ngIf=\"!isComponent(mcContent)\" [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(mcContent)\" [ngTemplateOutlet]=\"$any(mcContent)\"></ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(mcContent)\">\n <div [innerHTML]=\"mcContent\"></div>\n </ng-container>\n <ng-container *ngSwitchDefault [ngTemplateOutlet]=\"tplOriginContent\"></ng-container>\n </ng-container>\n </ng-container>\n </div>\n <div *ngIf=\"mcFooter || mcOkText || mcCancelText\" class=\"kbq-modal-footer\" [class.kbq-modal-body_bottom-overflow]=\"isBottomOverflow\">\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(mcFooter)\" [ngTemplateOutlet]=\"$any(mcFooter)\"></ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(mcFooter)\">\n <div [innerHTML]=\"mcFooter\"></div>\n </ng-container>\n <ng-container *ngSwitchCase=\"isModalButtons(mcFooter)\">\n <ng-container *ngFor=\"let button of $any(mcFooter)\">\n <button\n kbq-button\n #autoFocusedButton\n [attr.autofocus]=\"button.autoFocus\"\n [attr.kbq-modal-main-action]=\"button.mcModalMainAction\"\n *ngIf=\"getButtonCallableProp(button, 'show')\"\n [disabled]=\"getButtonCallableProp(button, 'disabled')\"\n [class.kbq-progress]=\"getButtonCallableProp(button, 'loading')\"\n (click)=\"onButtonClick(button)\"\n [color]=\"button.type\">\n {{ button.label }}\n </button>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <button\n #autoFocusedButton\n [attr.autofocus]=\"true\"\n *ngIf=\"mcOkText\"\n kbq-button\n [color]=\"themePalette.Primary\"\n (click)=\"onClickOkCancel('ok')\">\n\n {{ okText }}\n </button>\n <button *ngIf=\"mcCancelText\" kbq-button (click)=\"onClickOkCancel('cancel')\">\n {{ cancelText }}\n </button>\n </ng-container>\n </ng-container>\n </div>\n</ng-template>\n<!-- /[Predefined] Default Modal Content -->\n\n<!-- [Predefined] Confirm Modal Content -->\n<ng-template #tplContentConfirm>\n <div class=\"kbq-modal-body\" [ngStyle]=\"mcBodyStyle\">\n <div class=\"kbq-confirm-body-wrapper\">\n <div class=\"kbq-confirm-body\">\n <div class=\"kbq-confirm-content\">\n <ng-container #bodyContainer>\n <ng-container *ngIf=\"!isComponent(mcContent)\" [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(mcContent)\"\n [ngTemplateOutlet]=\"$any(mcContent)\">\n </ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(mcContent)\">\n <div [innerHTML]=\"mcContent\"></div>\n </ng-container>\n <ng-container *ngSwitchDefault [ngTemplateOutlet]=\"tplOriginContent\"></ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n </div> <!-- /.kbq-confirm-body-wrapper -->\n </div>\n <div class=\"kbq-confirm-btns\" *ngIf=\"mcOkText || mcCancelText\">\n <button\n kbq-button\n #autoFocusedButton\n [color]=\"mcOkType\"\n [attr.autofocus]=\"true\"\n *ngIf=\"mcOkText\"\n (click)=\"onClickOkCancel('ok')\">\n\n {{ okText }}\n </button>\n\n <button kbq-button [color]=\"themePalette.Secondary\" *ngIf=\"mcCancelText\" (click)=\"onClickOkCancel('cancel')\">\n {{ cancelText }}\n </button>\n </div>\n</ng-template>\n<!-- /[Predefined] Confirm Modal Content -->\n", styles: [".kbq-confirm .kbq-modal-header,.kbq-confirm .kbq-modal-close{display:none}.kbq-confirm .kbq-modal-body{padding:var(--kbq-modal-confirm-size-padding, 24px)}.kbq-confirm-body-wrapper{zoom:1}.kbq-confirm-body-wrapper:before,.kbq-confirm-body-wrapper:after{content:\"\";display:table}.kbq-confirm-body-wrapper:after{clear:both}.kbq-confirm-body .kbq-confirm-title{display:block;overflow:auto}.kbq-confirm .kbq-confirm-btns{border-radius:var(--kbq-modal-footer-size-border-radius, 0 0 8px 8px);text-align:right}.kbq-confirm .kbq-confirm-btns button+button,.kbq-confirm .kbq-confirm-btns button:only-child{margin:16px}.kbq-modal{box-sizing:border-box;position:relative;top:var(--kbq-modal-size-top, 48px);width:auto;margin:0 auto;list-style:none}.kbq-modal.zoom-enter,.kbq-modal.zoom-appear{animation-duration:.3s;transform:none;opacity:0}.kbq-modal.kbq-modal_small{width:var(--kbq-modal-size-small, 400px)}.kbq-modal.kbq-modal_medium{width:var(--kbq-modal-size-medium, 640px)}.kbq-modal.kbq-modal_large{width:var(--kbq-modal-size-large, 960px)}.kbq-modal .kbq-modal-close{position:absolute;z-index:10;top:0;right:0;width:var(--kbq-modal-size-close-width, 56px);height:var(--kbq-modal-size-close-width, 56px)}.kbq-modal-wrap{position:fixed;z-index:1000;inset:0;overflow:auto;-webkit-overflow-scrolling:touch;outline:0}.kbq-modal-title{margin:0}.kbq-modal-content{position:relative;border-radius:var(--kbq-modal-size-border-radius, 8px);background-clip:padding-box;background-color:#fff}.kbq-modal-header{display:flex;align-items:center;height:var(--kbq-modal-header-size-height, 56px);border-radius:var(--kbq-modal-header-size-border-radius, 8px 8px 0 0);padding:var(--kbq-modal-header-size-padding, 0 16px)}.kbq-modal-body{display:block;overflow-y:auto;max-height:var(--kbq-modal-body-size-max-height, calc(100vh - 260px));padding:var(--kbq-modal-body-size-padding, 16px 24px 24px);word-wrap:break-word}.kbq-modal-footer{display:flex;align-items:center;justify-content:flex-end;height:var(--kbq-modal-footer-size-height, 64px);border-radius:var(--kbq-modal-footer-size-border-radius, 0 0 8px 8px);padding:var(--kbq-modal-footer-size-padding, 0 16px)}.kbq-modal-footer button+button{margin-left:16px;margin-bottom:0}.kbq-modal-mask{position:fixed;z-index:1000;inset:0;height:100%}.kbq-modal-mask.kbq-modal-mask-hidden{display:none}.kbq-modal-open{overflow:hidden}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i3.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i4.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: i5.KbqButton, selector: "[kbq-button]", inputs: ["color", "tabIndex", "kbqStyle", "disabled"] }, { kind: "directive", type: i5.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "component", type: i6.KbqIcon, selector: "[kbq-icon]", inputs: ["color", "small", "autoColor"] }, { kind: "pipe", type: CssUnitPipe, name: "toCssUnit" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
535
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: KbqModalComponent, deps: [{ token: i1.Overlay }, { token: i0.Renderer2 }, { token: i0.ComponentFactoryResolver }, { token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: KbqModalControlService }, { token: i0.ChangeDetectorRef }, { token: i3.FocusMonitor }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
536
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.5", type: KbqModalComponent, selector: "kbq-modal", inputs: { kbqModalType: "kbqModalType", kbqComponent: "kbqComponent", kbqContent: "kbqContent", kbqComponentParams: "kbqComponentParams", kbqFooter: "kbqFooter", kbqVisible: "kbqVisible", kbqZIndex: "kbqZIndex", kbqWidth: "kbqWidth", kbqSize: "kbqSize", kbqWrapClassName: "kbqWrapClassName", kbqClassName: "kbqClassName", kbqStyle: "kbqStyle", kbqTitle: "kbqTitle", kbqCloseByESC: "kbqCloseByESC", kbqClosable: "kbqClosable", kbqMask: "kbqMask", kbqMaskClosable: "kbqMaskClosable", kbqMaskStyle: "kbqMaskStyle", kbqBodyStyle: "kbqBodyStyle", kbqOkText: "kbqOkText", kbqOkType: "kbqOkType", kbqRestoreFocus: "kbqRestoreFocus", kbqOkLoading: "kbqOkLoading", kbqOnOk: "kbqOnOk", kbqCancelText: "kbqCancelText", kbqCancelLoading: "kbqCancelLoading", kbqOnCancel: "kbqOnCancel", kbqGetContainer: "kbqGetContainer" }, outputs: { kbqVisibleChange: "kbqVisibleChange", kbqAfterOpen: "kbqAfterOpen", kbqAfterClose: "kbqAfterClose", kbqOnOk: "kbqOnOk", kbqOnCancel: "kbqOnCancel" }, host: { listeners: { "keydown": "onKeyDown($event)" } }, viewQueries: [{ propertyName: "modalContainer", first: true, predicate: ["modalContainer"], descendants: true, static: true }, { propertyName: "bodyContainer", first: true, predicate: ["bodyContainer"], descendants: true, read: ViewContainerRef }, { propertyName: "modalBody", first: true, predicate: ["modalBody"], descendants: true }, { propertyName: "autoFocusedButtons", predicate: ["autoFocusedButton"], descendants: true, read: ElementRef }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<!-- Compatible: the <ng-content> can appear only once -->\n<ng-template #tplOriginContent>\n <ng-content></ng-content>\n</ng-template>\n\n<div>\n <div *ngIf=\"kbqMask\"\n class=\"kbq-modal-mask\"\n [ngClass]=\"maskAnimationClassMap\"\n [class.kbq-modal-mask-hidden]=\"hidden\"\n [ngStyle]=\"kbqMaskStyle\"\n [style.zIndex]=\"kbqZIndex\">\n </div>\n\n <div (mousedown)=\"onClickMask($event)\"\n class=\"kbq-modal-wrap {{ kbqWrapClassName }}\"\n [style.zIndex]=\"kbqZIndex\"\n [style.display]=\"hidden ? 'none' : ''\"\n tabindex=\"-1\">\n\n <div #modalContainer\n class=\"kbq-modal {{ kbqClassName }} kbq-modal_{{ kbqSize }}\"\n [ngClass]=\"modalAnimationClassMap\"\n [class.kbq-modal_no-footer]=\"!kbqFooter\"\n [ngStyle]=\"kbqStyle\"\n [style.width]=\"kbqWidth | toCssUnit\"\n [style.transform-origin]=\"transformOrigin\">\n\n <div class=\"kbq-modal-content\" cdkTrapFocus>\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isModalType('default')\"\n [ngTemplateOutlet]=\"tplContentDefault\"></ng-container>\n <ng-container *ngSwitchCase=\"isModalType('confirm')\"\n [ngTemplateOutlet]=\"tplContentConfirm\"></ng-container>\n <ng-container *ngSwitchCase=\"isModalType('custom')\"\n [ngTemplateOutlet]=\"tplContentCustom\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #tplContentCustom>\n <ng-container #bodyContainer></ng-container>\n</ng-template>\n\n\n<!-- [Predefined] Default Modal Content -->\n<ng-template #tplContentDefault>\n <div *ngIf=\"kbqTitle\" class=\"kbq-modal-header\" kbq-title>\n <div class=\"kbq-modal-title\">\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(kbqTitle)\" [ngTemplateOutlet]=\"$any(kbqTitle)\"></ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(kbqTitle)\">\n <div [innerHTML]=\"kbqTitle\"></div>\n </ng-container>\n </ng-container>\n </div>\n\n <button *ngIf=\"kbqClosable\"\n kbq-button\n [color]=\"'contrast'\"\n (click)=\"onClickCloseBtn()\"\n class=\"kbq-modal-close kbq-button_transparent\">\n <i kbq-icon=\"mc-close-L_16\" [color]=\"componentColors.Contrast\"></i>\n </button>\n </div>\n <div class=\"kbq-modal-body kbq-scrollbar\" #modalBody [ngStyle]=\"kbqBodyStyle\">\n <ng-container #bodyContainer>\n <ng-container *ngIf=\"!isComponent(kbqContent)\" [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(kbqContent)\" [ngTemplateOutlet]=\"$any(kbqContent)\"></ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(kbqContent)\">\n <div [innerHTML]=\"kbqContent\"></div>\n </ng-container>\n <ng-container *ngSwitchDefault [ngTemplateOutlet]=\"tplOriginContent\"></ng-container>\n </ng-container>\n </ng-container>\n </div>\n <div *ngIf=\"kbqFooter || kbqOkText || kbqCancelText\" class=\"kbq-modal-footer\">\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(kbqFooter)\" [ngTemplateOutlet]=\"$any(kbqFooter)\"></ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(kbqFooter)\">\n <div [innerHTML]=\"kbqFooter\"></div>\n </ng-container>\n <ng-container *ngSwitchCase=\"isModalButtons(kbqFooter)\">\n <ng-container *ngFor=\"let button of $any(kbqFooter)\">\n <button\n kbq-button\n [attr.autofocus]=\"button.autoFocus\"\n [attr.kbq-modal-main-action]=\"button.kbqModalMainAction\"\n *ngIf=\"getButtonCallableProp(button, 'show')\"\n [disabled]=\"getButtonCallableProp(button, 'disabled')\"\n [class.kbq-progress]=\"getButtonCallableProp(button, 'loading')\"\n (click)=\"onButtonClick(button)\"\n [color]=\"button.type\">\n {{ button.label }}\n </button>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <button\n [attr.autofocus]=\"true\"\n *ngIf=\"kbqOkText\"\n kbq-button\n [color]=\"componentColors.Contrast\"\n (click)=\"onClickOkCancel('ok')\">\n\n {{ okText }}\n </button>\n <button *ngIf=\"kbqCancelText\" kbq-button (click)=\"onClickOkCancel('cancel')\">\n {{ cancelText }}\n </button>\n </ng-container>\n </ng-container>\n </div>\n</ng-template>\n<!-- /[Predefined] Default Modal Content -->\n\n<!-- [Predefined] Confirm Modal Content -->\n<ng-template #tplContentConfirm>\n <div class=\"kbq-modal-body\" [ngStyle]=\"kbqBodyStyle\">\n <ng-container #bodyContainer>\n <ng-container *ngIf=\"!isComponent(kbqContent)\" [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(kbqContent)\"\n [ngTemplateOutlet]=\"$any(kbqContent)\">\n </ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(kbqContent)\">\n <div [innerHTML]=\"kbqContent\"></div>\n </ng-container>\n <ng-container *ngSwitchDefault [ngTemplateOutlet]=\"tplOriginContent\"></ng-container>\n </ng-container>\n </ng-container>\n </div>\n <div class=\"kbq-confirm-footer\" *ngIf=\"kbqOkText || kbqCancelText\">\n <button\n kbq-button\n [color]=\"kbqOkType\"\n [attr.autofocus]=\"true\"\n *ngIf=\"kbqOkText\"\n (click)=\"onClickOkCancel('ok')\">\n\n {{ okText }}\n </button>\n\n <button kbq-button *ngIf=\"kbqCancelText\" (click)=\"onClickOkCancel('cancel')\">\n {{ cancelText }}\n </button>\n </div>\n</ng-template>\n<!-- /[Predefined] Confirm Modal Content -->\n", styles: [".kbq-confirm .kbq-modal-close{display:none}.kbq-confirm .kbq-confirm-footer{display:flex;gap:var(--kbq-modal-size-footer-content-gap-horizontal, 16px)}.kbq-modal{box-sizing:border-box;position:relative;top:48px;border-radius:var(--kbq-modal-size-border-radius, 8px);width:auto;margin:0 auto;list-style:none}.kbq-modal.zoom-enter,.kbq-modal.zoom-appear{animation-duration:.3s;transform:none;opacity:0}.kbq-modal.kbq-modal_small{width:var(--kbq-modal-size-small-width, 400px)}.kbq-modal.kbq-modal_medium{width:var(--kbq-modal-size-medium-width, 640px)}.kbq-modal.kbq-modal_large{width:var(--kbq-modal-size-large-width, 960px)}.kbq-modal .kbq-modal-close{position:absolute;top:16px;right:8px}.kbq-modal-wrap{position:fixed;z-index:1000;inset:0;overflow:auto;-webkit-overflow-scrolling:touch;outline:0}.kbq-modal-content{position:relative;border-radius:var(--kbq-modal-size-border-radius, 8px);background-clip:padding-box}.kbq-modal-header{display:flex;align-items:center;justify-content:space-between;padding:var(--kbq-modal-size-header-padding-vertical, 16px) var(--kbq-modal-size-header-padding-right, 48px) var(--kbq-modal-size-header-padding-vertical, 16px) var(--kbq-modal-size-header-padding-left, 24px)}.kbq-modal-header+.kbq-modal-body{padding-top:var(--kbq-modal-size-content-padding-top, 0)}.kbq-modal-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.kbq-modal-body{display:block;overflow-y:auto;max-height:calc(100vh - 260px);padding:var(--kbq-modal-size-content-padding-top-without-header, 24px) var(--kbq-modal-size-content-padding-horizontal, 24px) var(--kbq-modal-size-content-padding-bottom, 8px) var(--kbq-modal-size-content-padding-horizontal, 24px);word-wrap:break-word}.kbq-modal-footer,.kbq-confirm-footer{display:flex;align-items:center;padding:var(--kbq-modal-size-footer-padding-vertical, 20px) var(--kbq-modal-size-footer-padding-horizontal, 24px);gap:var(--kbq-modal-size-footer-content-gap-horizontal, 16px)}.kbq-modal-mask{position:fixed;z-index:1000;inset:0;height:100%}.kbq-modal-mask.kbq-modal-mask-hidden{display:none}.kbq-modal-open{overflow:hidden}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i4.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i3.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: i5.KbqButton, selector: "[kbq-button]", inputs: ["color", "tabIndex", "kbqStyle", "disabled"] }, { kind: "directive", type: i5.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "component", type: i6.KbqIcon, selector: "[kbq-icon]", inputs: ["color", "small", "autoColor"] }, { kind: "directive", type: i7.KbqTitleDirective, selector: "[kbq-title]", exportAs: ["kbqTitle"] }, { kind: "pipe", type: CssUnitPipe, name: "toCssUnit" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
545
537
|
}
|
|
546
538
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: KbqModalComponent, decorators: [{
|
|
547
539
|
type: Component,
|
|
548
540
|
args: [{ selector: 'kbq-modal', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
549
541
|
'(keydown)': 'onKeyDown($event)'
|
|
550
|
-
}, template: "<!-- Compatible: the <ng-content> can appear only once -->\n<ng-template #tplOriginContent>\n <ng-content></ng-content>\n</ng-template>\n\n<div>\n <div *ngIf=\"
|
|
551
|
-
}], ctorParameters: function () { return [{ type: i1.Overlay }, { type: i0.Renderer2 }, { type: i0.ComponentFactoryResolver }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: KbqModalControlService }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
|
|
542
|
+
}, template: "<!-- Compatible: the <ng-content> can appear only once -->\n<ng-template #tplOriginContent>\n <ng-content></ng-content>\n</ng-template>\n\n<div>\n <div *ngIf=\"kbqMask\"\n class=\"kbq-modal-mask\"\n [ngClass]=\"maskAnimationClassMap\"\n [class.kbq-modal-mask-hidden]=\"hidden\"\n [ngStyle]=\"kbqMaskStyle\"\n [style.zIndex]=\"kbqZIndex\">\n </div>\n\n <div (mousedown)=\"onClickMask($event)\"\n class=\"kbq-modal-wrap {{ kbqWrapClassName }}\"\n [style.zIndex]=\"kbqZIndex\"\n [style.display]=\"hidden ? 'none' : ''\"\n tabindex=\"-1\">\n\n <div #modalContainer\n class=\"kbq-modal {{ kbqClassName }} kbq-modal_{{ kbqSize }}\"\n [ngClass]=\"modalAnimationClassMap\"\n [class.kbq-modal_no-footer]=\"!kbqFooter\"\n [ngStyle]=\"kbqStyle\"\n [style.width]=\"kbqWidth | toCssUnit\"\n [style.transform-origin]=\"transformOrigin\">\n\n <div class=\"kbq-modal-content\" cdkTrapFocus>\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isModalType('default')\"\n [ngTemplateOutlet]=\"tplContentDefault\"></ng-container>\n <ng-container *ngSwitchCase=\"isModalType('confirm')\"\n [ngTemplateOutlet]=\"tplContentConfirm\"></ng-container>\n <ng-container *ngSwitchCase=\"isModalType('custom')\"\n [ngTemplateOutlet]=\"tplContentCustom\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #tplContentCustom>\n <ng-container #bodyContainer></ng-container>\n</ng-template>\n\n\n<!-- [Predefined] Default Modal Content -->\n<ng-template #tplContentDefault>\n <div *ngIf=\"kbqTitle\" class=\"kbq-modal-header\" kbq-title>\n <div class=\"kbq-modal-title\">\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(kbqTitle)\" [ngTemplateOutlet]=\"$any(kbqTitle)\"></ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(kbqTitle)\">\n <div [innerHTML]=\"kbqTitle\"></div>\n </ng-container>\n </ng-container>\n </div>\n\n <button *ngIf=\"kbqClosable\"\n kbq-button\n [color]=\"'contrast'\"\n (click)=\"onClickCloseBtn()\"\n class=\"kbq-modal-close kbq-button_transparent\">\n <i kbq-icon=\"mc-close-L_16\" [color]=\"componentColors.Contrast\"></i>\n </button>\n </div>\n <div class=\"kbq-modal-body kbq-scrollbar\" #modalBody [ngStyle]=\"kbqBodyStyle\">\n <ng-container #bodyContainer>\n <ng-container *ngIf=\"!isComponent(kbqContent)\" [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(kbqContent)\" [ngTemplateOutlet]=\"$any(kbqContent)\"></ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(kbqContent)\">\n <div [innerHTML]=\"kbqContent\"></div>\n </ng-container>\n <ng-container *ngSwitchDefault [ngTemplateOutlet]=\"tplOriginContent\"></ng-container>\n </ng-container>\n </ng-container>\n </div>\n <div *ngIf=\"kbqFooter || kbqOkText || kbqCancelText\" class=\"kbq-modal-footer\">\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(kbqFooter)\" [ngTemplateOutlet]=\"$any(kbqFooter)\"></ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(kbqFooter)\">\n <div [innerHTML]=\"kbqFooter\"></div>\n </ng-container>\n <ng-container *ngSwitchCase=\"isModalButtons(kbqFooter)\">\n <ng-container *ngFor=\"let button of $any(kbqFooter)\">\n <button\n kbq-button\n [attr.autofocus]=\"button.autoFocus\"\n [attr.kbq-modal-main-action]=\"button.kbqModalMainAction\"\n *ngIf=\"getButtonCallableProp(button, 'show')\"\n [disabled]=\"getButtonCallableProp(button, 'disabled')\"\n [class.kbq-progress]=\"getButtonCallableProp(button, 'loading')\"\n (click)=\"onButtonClick(button)\"\n [color]=\"button.type\">\n {{ button.label }}\n </button>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <button\n [attr.autofocus]=\"true\"\n *ngIf=\"kbqOkText\"\n kbq-button\n [color]=\"componentColors.Contrast\"\n (click)=\"onClickOkCancel('ok')\">\n\n {{ okText }}\n </button>\n <button *ngIf=\"kbqCancelText\" kbq-button (click)=\"onClickOkCancel('cancel')\">\n {{ cancelText }}\n </button>\n </ng-container>\n </ng-container>\n </div>\n</ng-template>\n<!-- /[Predefined] Default Modal Content -->\n\n<!-- [Predefined] Confirm Modal Content -->\n<ng-template #tplContentConfirm>\n <div class=\"kbq-modal-body\" [ngStyle]=\"kbqBodyStyle\">\n <ng-container #bodyContainer>\n <ng-container *ngIf=\"!isComponent(kbqContent)\" [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(kbqContent)\"\n [ngTemplateOutlet]=\"$any(kbqContent)\">\n </ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(kbqContent)\">\n <div [innerHTML]=\"kbqContent\"></div>\n </ng-container>\n <ng-container *ngSwitchDefault [ngTemplateOutlet]=\"tplOriginContent\"></ng-container>\n </ng-container>\n </ng-container>\n </div>\n <div class=\"kbq-confirm-footer\" *ngIf=\"kbqOkText || kbqCancelText\">\n <button\n kbq-button\n [color]=\"kbqOkType\"\n [attr.autofocus]=\"true\"\n *ngIf=\"kbqOkText\"\n (click)=\"onClickOkCancel('ok')\">\n\n {{ okText }}\n </button>\n\n <button kbq-button *ngIf=\"kbqCancelText\" (click)=\"onClickOkCancel('cancel')\">\n {{ cancelText }}\n </button>\n </div>\n</ng-template>\n<!-- /[Predefined] Confirm Modal Content -->\n", styles: [".kbq-confirm .kbq-modal-close{display:none}.kbq-confirm .kbq-confirm-footer{display:flex;gap:var(--kbq-modal-size-footer-content-gap-horizontal, 16px)}.kbq-modal{box-sizing:border-box;position:relative;top:48px;border-radius:var(--kbq-modal-size-border-radius, 8px);width:auto;margin:0 auto;list-style:none}.kbq-modal.zoom-enter,.kbq-modal.zoom-appear{animation-duration:.3s;transform:none;opacity:0}.kbq-modal.kbq-modal_small{width:var(--kbq-modal-size-small-width, 400px)}.kbq-modal.kbq-modal_medium{width:var(--kbq-modal-size-medium-width, 640px)}.kbq-modal.kbq-modal_large{width:var(--kbq-modal-size-large-width, 960px)}.kbq-modal .kbq-modal-close{position:absolute;top:16px;right:8px}.kbq-modal-wrap{position:fixed;z-index:1000;inset:0;overflow:auto;-webkit-overflow-scrolling:touch;outline:0}.kbq-modal-content{position:relative;border-radius:var(--kbq-modal-size-border-radius, 8px);background-clip:padding-box}.kbq-modal-header{display:flex;align-items:center;justify-content:space-between;padding:var(--kbq-modal-size-header-padding-vertical, 16px) var(--kbq-modal-size-header-padding-right, 48px) var(--kbq-modal-size-header-padding-vertical, 16px) var(--kbq-modal-size-header-padding-left, 24px)}.kbq-modal-header+.kbq-modal-body{padding-top:var(--kbq-modal-size-content-padding-top, 0)}.kbq-modal-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.kbq-modal-body{display:block;overflow-y:auto;max-height:calc(100vh - 260px);padding:var(--kbq-modal-size-content-padding-top-without-header, 24px) var(--kbq-modal-size-content-padding-horizontal, 24px) var(--kbq-modal-size-content-padding-bottom, 8px) var(--kbq-modal-size-content-padding-horizontal, 24px);word-wrap:break-word}.kbq-modal-footer,.kbq-confirm-footer{display:flex;align-items:center;padding:var(--kbq-modal-size-footer-padding-vertical, 20px) var(--kbq-modal-size-footer-padding-horizontal, 24px);gap:var(--kbq-modal-size-footer-content-gap-horizontal, 16px)}.kbq-modal-mask{position:fixed;z-index:1000;inset:0;height:100%}.kbq-modal-mask.kbq-modal-mask-hidden{display:none}.kbq-modal-open{overflow:hidden}\n"] }]
|
|
543
|
+
}], ctorParameters: function () { return [{ type: i1.Overlay }, { type: i0.Renderer2 }, { type: i0.ComponentFactoryResolver }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: KbqModalControlService }, { type: i0.ChangeDetectorRef }, { type: i3.FocusMonitor }, { type: undefined, decorators: [{
|
|
552
544
|
type: Inject,
|
|
553
545
|
args: [DOCUMENT]
|
|
554
|
-
}] }]; }, propDecorators: {
|
|
546
|
+
}] }]; }, propDecorators: { kbqModalType: [{
|
|
555
547
|
type: Input
|
|
556
|
-
}],
|
|
548
|
+
}], kbqComponent: [{
|
|
557
549
|
type: Input
|
|
558
|
-
}],
|
|
550
|
+
}], kbqContent: [{
|
|
559
551
|
type: Input
|
|
560
|
-
}],
|
|
552
|
+
}], kbqComponentParams: [{
|
|
561
553
|
type: Input
|
|
562
|
-
}],
|
|
554
|
+
}], kbqFooter: [{
|
|
563
555
|
type: Input
|
|
564
|
-
}],
|
|
556
|
+
}], kbqVisible: [{
|
|
565
557
|
type: Input
|
|
566
|
-
}],
|
|
558
|
+
}], kbqVisibleChange: [{
|
|
567
559
|
type: Output
|
|
568
|
-
}],
|
|
560
|
+
}], kbqZIndex: [{
|
|
569
561
|
type: Input
|
|
570
|
-
}],
|
|
562
|
+
}], kbqWidth: [{
|
|
571
563
|
type: Input
|
|
572
|
-
}],
|
|
564
|
+
}], kbqSize: [{
|
|
573
565
|
type: Input
|
|
574
|
-
}],
|
|
566
|
+
}], kbqWrapClassName: [{
|
|
575
567
|
type: Input
|
|
576
|
-
}],
|
|
568
|
+
}], kbqClassName: [{
|
|
577
569
|
type: Input
|
|
578
|
-
}],
|
|
570
|
+
}], kbqStyle: [{
|
|
579
571
|
type: Input
|
|
580
|
-
}],
|
|
572
|
+
}], kbqTitle: [{
|
|
581
573
|
type: Input
|
|
582
|
-
}],
|
|
574
|
+
}], kbqCloseByESC: [{
|
|
583
575
|
type: Input
|
|
584
|
-
}],
|
|
576
|
+
}], kbqClosable: [{
|
|
585
577
|
type: Input
|
|
586
|
-
}],
|
|
578
|
+
}], kbqMask: [{
|
|
587
579
|
type: Input
|
|
588
|
-
}],
|
|
580
|
+
}], kbqMaskClosable: [{
|
|
589
581
|
type: Input
|
|
590
|
-
}],
|
|
582
|
+
}], kbqMaskStyle: [{
|
|
591
583
|
type: Input
|
|
592
|
-
}],
|
|
584
|
+
}], kbqBodyStyle: [{
|
|
593
585
|
type: Input
|
|
594
|
-
}],
|
|
586
|
+
}], kbqAfterOpen: [{
|
|
595
587
|
type: Output
|
|
596
|
-
}],
|
|
588
|
+
}], kbqAfterClose: [{
|
|
597
589
|
type: Output
|
|
598
|
-
}],
|
|
590
|
+
}], kbqOkText: [{
|
|
599
591
|
type: Input
|
|
600
|
-
}],
|
|
592
|
+
}], kbqOkType: [{
|
|
601
593
|
type: Input
|
|
602
|
-
}],
|
|
594
|
+
}], kbqRestoreFocus: [{
|
|
603
595
|
type: Input
|
|
604
|
-
}],
|
|
596
|
+
}], kbqOkLoading: [{
|
|
605
597
|
type: Input
|
|
606
|
-
}],
|
|
598
|
+
}], kbqOnOk: [{
|
|
607
599
|
type: Input
|
|
608
600
|
}, {
|
|
609
601
|
type: Output
|
|
610
|
-
}],
|
|
602
|
+
}], kbqCancelText: [{
|
|
611
603
|
type: Input
|
|
612
|
-
}],
|
|
604
|
+
}], kbqCancelLoading: [{
|
|
613
605
|
type: Input
|
|
614
|
-
}],
|
|
606
|
+
}], kbqOnCancel: [{
|
|
615
607
|
type: Input
|
|
616
608
|
}, {
|
|
617
609
|
type: Output
|
|
@@ -627,7 +619,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.5", ngImpor
|
|
|
627
619
|
}], modalBody: [{
|
|
628
620
|
type: ViewChild,
|
|
629
621
|
args: ['modalBody']
|
|
630
|
-
}],
|
|
622
|
+
}], kbqGetContainer: [{
|
|
631
623
|
type: Input
|
|
632
624
|
}] } });
|
|
633
625
|
////////////
|
|
@@ -694,18 +686,18 @@ class ModalBuilderForService {
|
|
|
694
686
|
constructor(overlay, options = {}) {
|
|
695
687
|
this.overlay = overlay;
|
|
696
688
|
this.createModal();
|
|
697
|
-
if (!('
|
|
698
|
-
options.
|
|
689
|
+
if (!('kbqGetContainer' in options)) {
|
|
690
|
+
options.kbqGetContainer = undefined;
|
|
699
691
|
}
|
|
700
692
|
this.changeProps(options);
|
|
701
693
|
this.modalRef.instance.open();
|
|
702
|
-
this.modalRef.instance.
|
|
694
|
+
this.modalRef.instance.kbqAfterClose.subscribe(() => this.destroyModal());
|
|
703
695
|
this.overlayRef.keydownEvents()
|
|
704
696
|
.pipe(filter((event) => {
|
|
705
697
|
// tslint:disable-next-line:deprecation replacement .key isn't supported in Edge
|
|
706
|
-
return !!(event.keyCode === ESCAPE && options.
|
|
698
|
+
return !!(event.keyCode === ESCAPE && options.kbqCloseByESC);
|
|
707
699
|
}))
|
|
708
|
-
.subscribe(() => this.
|
|
700
|
+
.subscribe(() => this.getInstance()?.handleCloseResult('cancel', () => true));
|
|
709
701
|
}
|
|
710
702
|
getInstance() {
|
|
711
703
|
return this.modalRef && this.modalRef.instance;
|
|
@@ -746,44 +738,44 @@ class KbqModalService {
|
|
|
746
738
|
this.modalControl.closeAll();
|
|
747
739
|
}
|
|
748
740
|
create(options = {}) {
|
|
749
|
-
if (typeof options.
|
|
741
|
+
if (typeof options.kbqOnCancel !== 'function') {
|
|
750
742
|
// Leave a empty function to close this modal by default
|
|
751
743
|
// tslint:disable-next-line
|
|
752
|
-
options.
|
|
744
|
+
options.kbqOnCancel = () => { };
|
|
753
745
|
}
|
|
754
|
-
if (!('
|
|
755
|
-
options.
|
|
746
|
+
if (!('kbqCloseByESC' in options)) {
|
|
747
|
+
options.kbqCloseByESC = true;
|
|
756
748
|
}
|
|
757
749
|
// Remove the Cancel button if the user not specify a Cancel button
|
|
758
|
-
if (!('
|
|
759
|
-
options.
|
|
750
|
+
if (!('kbqCancelText' in options)) {
|
|
751
|
+
options.kbqCancelText = undefined;
|
|
760
752
|
}
|
|
761
753
|
// Remove the Ok button if the user not specify a Ok button
|
|
762
|
-
if (!('
|
|
763
|
-
options.
|
|
754
|
+
if (!('kbqOkText' in options)) {
|
|
755
|
+
options.kbqOkText = undefined;
|
|
764
756
|
}
|
|
765
757
|
// Remove the footer if the user not specify a footer
|
|
766
|
-
if (!('
|
|
767
|
-
options.
|
|
758
|
+
if (!('kbqFooter' in options)) {
|
|
759
|
+
options.kbqFooter = undefined;
|
|
768
760
|
}
|
|
769
761
|
return new ModalBuilderForService(this.overlay, options).getInstance();
|
|
770
762
|
}
|
|
771
763
|
confirm(options = {}, confirmType = 'confirm') {
|
|
772
|
-
if ('
|
|
773
|
-
console.warn(`The Confirm-Modal doesn't support "
|
|
764
|
+
if ('kbqFooter' in options) {
|
|
765
|
+
console.warn(`The Confirm-Modal doesn't support "kbqFooter", this property will be ignored.`);
|
|
774
766
|
}
|
|
775
767
|
// NOTE: only support function currently by calling confirm()
|
|
776
|
-
if (typeof options.
|
|
768
|
+
if (typeof options.kbqOnOk !== 'function') {
|
|
777
769
|
// Leave a empty function to close this modal by default
|
|
778
770
|
// tslint:disable-next-line
|
|
779
|
-
options.
|
|
771
|
+
options.kbqOnOk = () => { };
|
|
780
772
|
}
|
|
781
|
-
options.
|
|
782
|
-
options.
|
|
773
|
+
options.kbqModalType = 'confirm';
|
|
774
|
+
options.kbqClassName = `kbq-confirm kbq-confirm-${confirmType} ${options.kbqClassName || ''}`;
|
|
783
775
|
return this.create(options);
|
|
784
776
|
}
|
|
785
777
|
open(options = {}) {
|
|
786
|
-
options.
|
|
778
|
+
options.kbqModalType = 'custom';
|
|
787
779
|
return this.create(options);
|
|
788
780
|
}
|
|
789
781
|
success(options = {}) {
|
|
@@ -814,19 +806,22 @@ class KbqModalModule {
|
|
|
814
806
|
OverlayModule,
|
|
815
807
|
A11yModule,
|
|
816
808
|
KbqButtonModule,
|
|
817
|
-
KbqIconModule
|
|
809
|
+
KbqIconModule,
|
|
810
|
+
KbqTitleModule], exports: [KbqModalComponent,
|
|
818
811
|
KbqModalTitle,
|
|
819
812
|
KbqModalBody,
|
|
820
813
|
KbqModalFooter,
|
|
821
814
|
KbqModalMainAction] }); }
|
|
822
815
|
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: KbqModalModule, providers: [
|
|
823
816
|
KbqModalControlService,
|
|
824
|
-
KbqModalService
|
|
817
|
+
KbqModalService,
|
|
818
|
+
{ provide: FocusTrapFactory, useClass: ConfigurableFocusTrapFactory }
|
|
825
819
|
], imports: [CommonModule,
|
|
826
820
|
OverlayModule,
|
|
827
821
|
A11yModule,
|
|
828
822
|
KbqButtonModule,
|
|
829
|
-
KbqIconModule
|
|
823
|
+
KbqIconModule,
|
|
824
|
+
KbqTitleModule] }); }
|
|
830
825
|
}
|
|
831
826
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: KbqModalModule, decorators: [{
|
|
832
827
|
type: NgModule,
|
|
@@ -836,7 +831,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.5", ngImpor
|
|
|
836
831
|
OverlayModule,
|
|
837
832
|
A11yModule,
|
|
838
833
|
KbqButtonModule,
|
|
839
|
-
KbqIconModule
|
|
834
|
+
KbqIconModule,
|
|
835
|
+
KbqTitleModule
|
|
840
836
|
],
|
|
841
837
|
exports: [
|
|
842
838
|
KbqModalComponent,
|
|
@@ -855,7 +851,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.5", ngImpor
|
|
|
855
851
|
],
|
|
856
852
|
providers: [
|
|
857
853
|
KbqModalControlService,
|
|
858
|
-
KbqModalService
|
|
854
|
+
KbqModalService,
|
|
855
|
+
{ provide: FocusTrapFactory, useClass: ConfigurableFocusTrapFactory }
|
|
859
856
|
]
|
|
860
857
|
}]
|
|
861
858
|
}] });
|