cmat 0.0.6 → 0.0.8
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/components/adapter/dayjs-datetime-adapter.d.ts +1 -1
- package/components/breadcrumb/breadcrumb.service.d.ts +1 -1
- package/components/breadcrumb/public-api.d.ts +2 -0
- package/components/card/card.component.d.ts +1 -1
- package/components/card/public-api.d.ts +1 -0
- package/components/cascade/cascade-list/cascade-list.component.d.ts +45 -21
- package/components/cascade/public-api.d.ts +1 -0
- package/components/chip-input/chip-input.component.d.ts +39 -12
- package/components/custom-formly/extension/addons.extension.d.ts +2 -0
- package/components/custom-formly/index.d.ts +5 -0
- package/components/custom-formly/public-api.d.ts +21 -0
- package/components/custom-formly/types/button/button.component.d.ts +18 -0
- package/components/custom-formly/types/checklist/checklist.component.d.ts +41 -0
- package/components/custom-formly/types/chips/chips.component.d.ts +27 -0
- package/components/custom-formly/types/multicheckbox/multicheckbox.component.d.ts +44 -0
- package/components/custom-formly/types/number/number.component.d.ts +20 -0
- package/components/custom-formly/types/radio/radio.component.d.ts +44 -0
- package/components/custom-formly/types/rating/rating.component.d.ts +24 -0
- package/components/custom-formly/types/repeat/repeat.component.d.ts +16 -0
- package/components/custom-formly/types/select/select.component.d.ts +54 -0
- package/components/custom-formly/types/select-tree/select-tree.component.d.ts +43 -0
- package/components/custom-formly/types/stepper/horizontal/stepper.component.d.ts +9 -0
- package/components/custom-formly/types/stepper/stepper.type.d.ts +6 -0
- package/components/custom-formly/types/stepper/vertical/stepper.component.d.ts +9 -0
- package/components/custom-formly/types/table/table.component.d.ts +43 -0
- package/components/custom-formly/types/tabs/tab.component.d.ts +8 -0
- package/components/custom-formly/types/tags/tags.component.d.ts +41 -0
- package/components/custom-formly/types/textarea/textarea.component.d.ts +13 -0
- package/components/custom-formly/wrappers/addons/addons.component.d.ts +10 -0
- package/components/custom-formly/wrappers/card/card.component.d.ts +6 -0
- package/components/custom-formly/wrappers/expansion/expansion.component.d.ts +6 -0
- package/components/custom-formly/wrappers/panel/panel.component.d.ts +6 -0
- package/components/date-range/date-range.component.d.ts +8 -6
- package/components/drawer/drawer.component.d.ts +2 -2
- package/components/fullscreen/fullscreen.component.d.ts +2 -9
- package/components/fullscreen/public-api.d.ts +0 -1
- package/components/material-color-picker/material-color-picker.component.d.ts +8 -4
- package/components/material-datetimepicker/calendar.d.ts +2 -2
- package/components/material-datetimepicker/clock.d.ts +1 -1
- package/components/material-datetimepicker/datetimepicker-input.d.ts +1 -1
- package/components/material-datetimepicker/datetimepicker-toggle.d.ts +1 -1
- package/components/material-datetimepicker/datetimepicker.d.ts +5 -10
- package/components/material-datetimepicker/month-view.d.ts +1 -2
- package/components/material-datetimepicker/multi-year-view.d.ts +1 -1
- package/components/material-datetimepicker/public-api.d.ts +1 -0
- package/components/material-datetimepicker/time.d.ts +2 -2
- package/components/material-datetimepicker/year-view.d.ts +1 -1
- package/components/navigation/horizontal/components/basic/basic.component.d.ts +1 -1
- package/components/navigation/horizontal/components/branch/branch.component.d.ts +1 -1
- package/components/navigation/horizontal/horizontal.component.d.ts +2 -2
- package/components/navigation/vertical/components/aside/aside.component.d.ts +1 -1
- package/components/navigation/vertical/components/basic/basic.component.d.ts +1 -7
- package/components/navigation/vertical/components/collapsable/collapsable.component.d.ts +1 -1
- package/components/navigation/vertical/components/group/group.component.d.ts +1 -1
- package/components/navigation/vertical/vertical.component.d.ts +5 -5
- package/components/pagination/public-api.d.ts +1 -0
- package/components/popover/popover-trigger.d.ts +121 -0
- package/components/popover/popover.component.d.ts +3 -3
- package/components/popover/popover.target.d.ts +8 -0
- package/components/popover/public-api.d.ts +3 -0
- package/components/rating/rating.component.d.ts +38 -9
- package/components/select-search/select-search.component.d.ts +4 -4
- package/components/select-tree/public-api.d.ts +2 -0
- package/components/select-tree/select-tree.component.d.ts +50 -21
- package/components/toast/public-api.d.ts +4 -0
- package/components/toast/toast.component.d.ts +4 -4
- package/components/transfer-picker/filter/filter.component.d.ts +1 -1
- package/components/transfer-picker/transfer-picker-source/transfer-picker-source.component.d.ts +2 -2
- package/components/transfer-picker/transfer-picker.component.d.ts +1 -1
- package/components/upload/files.type.d.ts +22 -0
- package/components/upload/files.util.service.d.ts +20 -0
- package/components/upload/index.d.ts +5 -0
- package/components/upload/public-api.d.ts +4 -0
- package/components/upload/upload-queue/upload-queue.component.d.ts +39 -0
- package/components/upload/upload.component.d.ts +32 -0
- package/esm2022/animations/public-api.mjs +2 -2
- package/esm2022/components/adapter/dayjs-date-adapter.mjs +6 -6
- package/esm2022/components/adapter/dayjs-datetime-adapter.mjs +5 -5
- package/esm2022/components/adapter/native-datetime-adapter.mjs +3 -3
- package/esm2022/components/breadcrumb/breadcrumb-item.directive.mjs +3 -3
- package/esm2022/components/breadcrumb/breadcrumb.component.mjs +6 -6
- package/esm2022/components/breadcrumb/breadcrumb.service.mjs +5 -5
- package/esm2022/components/breadcrumb/public-api.mjs +3 -1
- package/esm2022/components/card/card.component.mjs +5 -5
- package/esm2022/components/card/public-api.mjs +2 -1
- package/esm2022/components/cascade/cascade-bottom-sheet/cascade-bottom-sheet.component.mjs +7 -7
- package/esm2022/components/cascade/cascade-list/cascade-list.component.mjs +207 -114
- package/esm2022/components/cascade/cascade-menu/cascade-menu.component.mjs +4 -4
- package/esm2022/components/cascade/public-api.mjs +2 -1
- package/esm2022/components/chip-input/chip-input.component.mjs +152 -49
- package/esm2022/components/custom-formly/cmat-components-custom-formly.mjs +5 -0
- package/esm2022/components/custom-formly/extension/addons.extension.mjs +13 -0
- package/esm2022/components/custom-formly/public-api.mjs +22 -0
- package/esm2022/components/custom-formly/types/button/button.component.mjs +39 -0
- package/esm2022/components/custom-formly/types/checklist/checklist.component.mjs +161 -0
- package/esm2022/components/custom-formly/types/chips/chips.component.mjs +55 -0
- package/esm2022/components/custom-formly/types/multicheckbox/multicheckbox.component.mjs +89 -0
- package/esm2022/components/custom-formly/types/number/number.component.mjs +27 -0
- package/esm2022/components/custom-formly/types/radio/radio.component.mjs +88 -0
- package/esm2022/components/custom-formly/types/rating/rating.component.mjs +27 -0
- package/esm2022/components/custom-formly/types/repeat/repeat.component.mjs +28 -0
- package/esm2022/components/custom-formly/types/select/select.component.mjs +169 -0
- package/esm2022/components/custom-formly/types/select-tree/select-tree.component.mjs +66 -0
- package/esm2022/components/custom-formly/types/stepper/horizontal/stepper.component.mjs +31 -0
- package/esm2022/components/custom-formly/types/stepper/stepper.type.mjs +2 -0
- package/esm2022/components/custom-formly/types/stepper/vertical/stepper.component.mjs +31 -0
- package/esm2022/components/custom-formly/types/table/table.component.mjs +116 -0
- package/esm2022/components/custom-formly/types/tabs/tab.component.mjs +19 -0
- package/esm2022/components/custom-formly/types/tags/tags.component.mjs +149 -0
- package/esm2022/components/custom-formly/types/textarea/textarea.component.mjs +25 -0
- package/esm2022/components/custom-formly/wrappers/addons/addons.component.mjs +92 -0
- package/esm2022/components/custom-formly/wrappers/card/card.component.mjs +14 -0
- package/esm2022/components/custom-formly/wrappers/expansion/expansion.component.mjs +14 -0
- package/esm2022/components/custom-formly/wrappers/panel/panel.component.mjs +12 -0
- package/esm2022/components/date-range/date-range.component.mjs +26 -17
- package/esm2022/components/drawer/drawer.component.mjs +5 -5
- package/esm2022/components/drawer/drawer.service.mjs +3 -3
- package/esm2022/components/fullscreen/fullscreen.component.mjs +16 -73
- package/esm2022/components/fullscreen/public-api.mjs +1 -2
- package/esm2022/components/highlight/highlight.component.mjs +5 -5
- package/esm2022/components/highlight/highlight.service.mjs +3 -3
- package/esm2022/components/json-editor/json-editor.component.mjs +3 -3
- package/esm2022/components/masonry/masonry.component.mjs +5 -5
- package/esm2022/components/material-color-picker/material-color-picker.component.mjs +22 -12
- package/esm2022/components/material-datetimepicker/calendar-body.mjs +3 -3
- package/esm2022/components/material-datetimepicker/calendar.mjs +11 -12
- package/esm2022/components/material-datetimepicker/clock.mjs +5 -5
- package/esm2022/components/material-datetimepicker/datetimepicker-input.mjs +4 -5
- package/esm2022/components/material-datetimepicker/datetimepicker-intl.mjs +3 -3
- package/esm2022/components/material-datetimepicker/datetimepicker-toggle.mjs +9 -9
- package/esm2022/components/material-datetimepicker/datetimepicker.mjs +17 -22
- package/esm2022/components/material-datetimepicker/month-view.mjs +5 -6
- package/esm2022/components/material-datetimepicker/multi-year-view.mjs +7 -8
- package/esm2022/components/material-datetimepicker/public-api.mjs +2 -1
- package/esm2022/components/material-datetimepicker/time.mjs +8 -8
- package/esm2022/components/material-datetimepicker/year-view.mjs +7 -8
- package/esm2022/components/navigation/horizontal/components/basic/basic.component.mjs +8 -8
- package/esm2022/components/navigation/horizontal/components/branch/branch.component.mjs +8 -8
- package/esm2022/components/navigation/horizontal/components/divider/divider.component.mjs +5 -5
- package/esm2022/components/navigation/horizontal/components/spacer/spacer.component.mjs +6 -6
- package/esm2022/components/navigation/horizontal/horizontal.component.mjs +6 -6
- package/esm2022/components/navigation/navigation.service.mjs +3 -3
- package/esm2022/components/navigation/vertical/components/aside/aside.component.mjs +11 -11
- package/esm2022/components/navigation/vertical/components/basic/basic.component.mjs +7 -24
- package/esm2022/components/navigation/vertical/components/collapsable/collapsable.component.mjs +10 -10
- package/esm2022/components/navigation/vertical/components/divider/divider.component.mjs +5 -5
- package/esm2022/components/navigation/vertical/components/group/group.component.mjs +9 -9
- package/esm2022/components/navigation/vertical/components/spacer/spacer.component.mjs +6 -6
- package/esm2022/components/navigation/vertical/vertical.component.mjs +11 -11
- package/esm2022/components/pagination/pagination.component.mjs +10 -10
- package/esm2022/components/pagination/pagination.directive.mjs +4 -4
- package/esm2022/components/pagination/pagination.pipe.mjs +4 -4
- package/esm2022/components/pagination/pagination.service.mjs +3 -3
- package/esm2022/components/pagination/public-api.mjs +2 -1
- package/esm2022/components/password-strength/mat-pass-toggle-visibility/mat-pass-toggle-visibility.component.mjs +6 -6
- package/esm2022/components/password-strength/mat-password-strength/mat-password-strength.component.mjs +5 -5
- package/esm2022/components/password-strength/mat-password-strength-info/mat-password-strength-info.component.mjs +6 -6
- package/esm2022/components/popover/popover-trigger.mjs +444 -0
- package/esm2022/components/popover/popover.component.mjs +8 -9
- package/esm2022/components/popover/popover.target.mjs +18 -0
- package/esm2022/components/popover/public-api.mjs +4 -1
- package/esm2022/components/progress-bar/progress-bar.component.mjs +6 -6
- package/esm2022/components/rating/rating.component.mjs +122 -23
- package/esm2022/components/select-search/select-no-entries-found.directive.mjs +3 -3
- package/esm2022/components/select-search/select-search-clear.directive.mjs +3 -3
- package/esm2022/components/select-search/select-search.component.mjs +15 -15
- package/esm2022/components/select-tree/public-api.mjs +3 -1
- package/esm2022/components/select-tree/select-tree.component.mjs +281 -157
- package/esm2022/components/timeline/timeline-item/timeline-item.component.mjs +9 -9
- package/esm2022/components/timeline/timeline.component.mjs +5 -5
- package/esm2022/components/toast/public-api.mjs +5 -1
- package/esm2022/components/toast/toast-modal.component.mjs +5 -5
- package/esm2022/components/toast/toast.component.mjs +6 -6
- package/esm2022/components/toast/toast.service.mjs +3 -3
- package/esm2022/components/transfer-picker/filter/filter.component.mjs +9 -9
- package/esm2022/components/transfer-picker/search/search.component.mjs +6 -6
- package/esm2022/components/transfer-picker/transfer-picker-source/transfer-picker-source.component.mjs +11 -11
- package/esm2022/components/transfer-picker/transfer-picker-target/transfer-picker-target.component.mjs +5 -5
- package/esm2022/components/transfer-picker/transfer-picker.component.mjs +7 -7
- package/esm2022/components/transfer-picker/transfer-picker.service.mjs +4 -4
- package/esm2022/components/upload/cmat-components-upload.mjs +5 -0
- package/esm2022/components/upload/files.type.mjs +2 -0
- package/esm2022/components/upload/files.util.service.mjs +100 -0
- package/esm2022/components/upload/public-api.mjs +5 -0
- package/esm2022/components/upload/upload-queue/upload-queue.component.mjs +154 -0
- package/esm2022/components/upload/upload.component.mjs +118 -0
- package/esm2022/directives/animate-on-scroll/animate-on-scroll.directive.mjs +3 -3
- package/esm2022/directives/animate-on-scroll/scroll.service.mjs +3 -3
- package/esm2022/directives/autofocus/autofocus.directive.mjs +3 -3
- package/esm2022/directives/debounce/abstract-debounce.directive.mjs +3 -3
- package/esm2022/directives/debounce/debounce-click.directive.mjs +3 -3
- package/esm2022/directives/debounce/debounce-keyup.directive.mjs +3 -3
- package/esm2022/directives/digit-only/digit-only.directive.mjs +3 -3
- package/esm2022/directives/digit-only/mask.directive.mjs +3 -3
- package/esm2022/directives/equal-validator/equal-validator.directive.mjs +3 -3
- package/esm2022/lib/mock-api/mock-api.interceptor.mjs +5 -5
- package/esm2022/lib/mock-api/mock-api.service.mjs +3 -3
- package/esm2022/pipes/bytes/bytes.pipe.mjs +3 -3
- package/esm2022/pipes/date-format/date-format.pipe.mjs +3 -3
- package/esm2022/pipes/find-by-key/find-by-key.pipe.mjs +3 -3
- package/esm2022/pipes/group-by/group-by.pipe.mjs +3 -3
- package/esm2022/pipes/keys/keys.pipe.mjs +3 -3
- package/esm2022/pipes/secure/secure-pipe.mjs +5 -5
- package/esm2022/pipes/uppercase/uppercase.pipe.mjs +3 -3
- package/esm2022/public-api.mjs +1 -1
- package/esm2022/services/alert/alert.service.mjs +7 -7
- package/esm2022/services/alert/enum.mjs +2 -2
- package/esm2022/services/config/config.service.mjs +5 -5
- package/esm2022/services/config/urlStateConfig.service.mjs +5 -5
- package/esm2022/services/confirmation/confirmation.service.mjs +5 -5
- package/esm2022/services/confirmation/dialog/dialog.component.mjs +7 -7
- package/esm2022/services/data/data.service.mjs +5 -5
- package/esm2022/services/loading/loading.interceptor.mjs +4 -4
- package/esm2022/services/loading/loading.service.mjs +3 -3
- package/esm2022/services/local-storage/local-storage.service.mjs +3 -3
- package/esm2022/services/media-watcher/media-watcher.service.mjs +5 -5
- package/esm2022/services/platform/platform.service.mjs +4 -4
- package/esm2022/services/splash-screen/splash-screen.service.mjs +6 -6
- package/esm2022/services/title/title.service.mjs +4 -4
- package/esm2022/services/translation/translation.service.mjs +3 -3
- package/esm2022/services/utils/utils.service.mjs +54 -9
- package/fesm2022/cmat-animations.mjs +15 -15
- package/fesm2022/cmat-animations.mjs.map +1 -1
- package/fesm2022/cmat-components-adapter.mjs +11 -11
- package/fesm2022/cmat-components-adapter.mjs.map +1 -1
- package/fesm2022/cmat-components-breadcrumb.mjs +11 -11
- package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/cmat-components-card.mjs +4 -4
- package/fesm2022/cmat-components-card.mjs.map +1 -1
- package/fesm2022/cmat-components-cascade.mjs +215 -123
- package/fesm2022/cmat-components-cascade.mjs.map +1 -1
- package/fesm2022/cmat-components-chip-input.mjs +153 -50
- package/fesm2022/cmat-components-chip-input.mjs.map +1 -1
- package/fesm2022/cmat-components-custom-formly.mjs +1141 -0
- package/fesm2022/cmat-components-custom-formly.mjs.map +1 -0
- package/fesm2022/cmat-components-date-range.mjs +27 -18
- package/fesm2022/cmat-components-date-range.mjs.map +1 -1
- package/fesm2022/cmat-components-drawer.mjs +8 -8
- package/fesm2022/cmat-components-drawer.mjs.map +1 -1
- package/fesm2022/cmat-components-fullscreen.mjs +16 -73
- package/fesm2022/cmat-components-fullscreen.mjs.map +1 -1
- package/fesm2022/cmat-components-highlight.mjs +7 -7
- package/fesm2022/cmat-components-highlight.mjs.map +1 -1
- package/fesm2022/cmat-components-json-editor.mjs +3 -3
- package/fesm2022/cmat-components-masonry.mjs +4 -4
- package/fesm2022/cmat-components-masonry.mjs.map +1 -1
- package/fesm2022/cmat-components-material-color-picker.mjs +21 -11
- package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-material-datetimepicker.mjs +189 -195
- package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
- package/fesm2022/cmat-components-navigation.mjs +166 -183
- package/fesm2022/cmat-components-navigation.mjs.map +1 -1
- package/fesm2022/cmat-components-pagination.mjs +20 -20
- package/fesm2022/cmat-components-pagination.mjs.map +1 -1
- package/fesm2022/cmat-components-password-strength.mjs +13 -13
- package/fesm2022/cmat-components-password-strength.mjs.map +1 -1
- package/fesm2022/cmat-components-popover.mjs +464 -10
- package/fesm2022/cmat-components-popover.mjs.map +1 -1
- package/fesm2022/cmat-components-progress-bar.mjs +6 -6
- package/fesm2022/cmat-components-progress-bar.mjs.map +1 -1
- package/fesm2022/cmat-components-rating.mjs +121 -22
- package/fesm2022/cmat-components-rating.mjs.map +1 -1
- package/fesm2022/cmat-components-select-search.mjs +41 -41
- package/fesm2022/cmat-components-select-search.mjs.map +1 -1
- package/fesm2022/cmat-components-select-tree.mjs +285 -158
- package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
- package/fesm2022/cmat-components-timeline.mjs +12 -12
- package/fesm2022/cmat-components-timeline.mjs.map +1 -1
- package/fesm2022/cmat-components-toast.mjs +12 -12
- package/fesm2022/cmat-components-toast.mjs.map +1 -1
- package/fesm2022/cmat-components-transfer-picker.mjs +33 -33
- package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
- package/fesm2022/cmat-components-upload.mjs +366 -0
- package/fesm2022/cmat-components-upload.mjs.map +1 -0
- package/fesm2022/cmat-directives-animate-on-scroll.mjs +6 -6
- package/fesm2022/cmat-directives-autofocus.mjs +3 -3
- package/fesm2022/cmat-directives-debounce.mjs +9 -9
- package/fesm2022/cmat-directives-digit-only.mjs +6 -6
- package/fesm2022/cmat-directives-equal-validator.mjs +3 -3
- package/fesm2022/cmat-lib-mock-api.mjs +6 -6
- package/fesm2022/cmat-lib-mock-api.mjs.map +1 -1
- package/fesm2022/cmat-pipes-bytes.mjs +3 -3
- package/fesm2022/cmat-pipes-date-format.mjs +3 -3
- package/fesm2022/cmat-pipes-find-by-key.mjs +3 -3
- package/fesm2022/cmat-pipes-group-by.mjs +3 -3
- package/fesm2022/cmat-pipes-keys.mjs +3 -3
- package/fesm2022/cmat-pipes-secure.mjs +4 -4
- package/fesm2022/cmat-pipes-secure.mjs.map +1 -1
- package/fesm2022/cmat-pipes-uppercase.mjs +3 -3
- package/fesm2022/cmat-services-alert.mjs +6 -6
- package/fesm2022/cmat-services-alert.mjs.map +1 -1
- package/fesm2022/cmat-services-config.mjs +7 -7
- package/fesm2022/cmat-services-config.mjs.map +1 -1
- package/fesm2022/cmat-services-confirmation.mjs +11 -11
- package/fesm2022/cmat-services-confirmation.mjs.map +1 -1
- package/fesm2022/cmat-services-data.mjs +5 -5
- package/fesm2022/cmat-services-data.mjs.map +1 -1
- package/fesm2022/cmat-services-loading.mjs +6 -6
- package/fesm2022/cmat-services-loading.mjs.map +1 -1
- package/fesm2022/cmat-services-local-storage.mjs +3 -3
- package/fesm2022/cmat-services-media-watcher.mjs +4 -4
- package/fesm2022/cmat-services-media-watcher.mjs.map +1 -1
- package/fesm2022/cmat-services-platform.mjs +3 -3
- package/fesm2022/cmat-services-platform.mjs.map +1 -1
- package/fesm2022/cmat-services-splash-screen.mjs +5 -5
- package/fesm2022/cmat-services-splash-screen.mjs.map +1 -1
- package/fesm2022/cmat-services-title.mjs +3 -3
- package/fesm2022/cmat-services-title.mjs.map +1 -1
- package/fesm2022/cmat-services-translation.mjs +3 -3
- package/fesm2022/cmat-services-utils.mjs +53 -8
- package/fesm2022/cmat-services-utils.mjs.map +1 -1
- package/package.json +75 -63
- package/pipes/secure/secure-pipe.d.ts +1 -1
- package/services/alert/enum.d.ts +1 -1
- package/services/confirmation/confirmation.service.d.ts +1 -1
- package/services/data/data.service.d.ts +1 -1
- package/services/media-watcher/media-watcher.service.d.ts +1 -1
- package/services/title/title.service.d.ts +1 -1
- package/services/utils/utils.service.d.ts +1 -0
- package/styles/components/bundle.scss +18 -5
- package/styles/overrides/angular-material.scss +51 -52
- package/styles/tailwind.scss +2 -8
- package/styles/themes.scss +7 -7
- package/styles/user-themes.scss +1 -1
- package/tailwind/plugins/utilities.js +1 -1
- package/components/fullscreen/fullscreen.types.d.ts +0 -13
- package/esm2022/components/fullscreen/fullscreen.types.mjs +0 -2
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
1
|
+
import * as i2 from '@angular/cdk/a11y';
|
|
2
|
+
import { A11yModule, isFakeMousedownFromScreenReader } from '@angular/cdk/a11y';
|
|
3
3
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
4
|
-
import { cmatAnimations } from 'cmat/animations';
|
|
5
4
|
import { NgStyle, NgClass } from '@angular/common';
|
|
6
|
-
import * as
|
|
7
|
-
import {
|
|
5
|
+
import * as i0 from '@angular/core';
|
|
6
|
+
import { EventEmitter, TemplateRef, Component, ChangeDetectionStrategy, ViewEncapsulation, Optional, Output, ViewChild, HostBinding, Input, Directive, HostListener } from '@angular/core';
|
|
7
|
+
import { cmatAnimations } from 'cmat/animations';
|
|
8
8
|
import * as i1 from '@angular/cdk/bidi';
|
|
9
|
+
import * as i1$1 from '@angular/cdk/overlay';
|
|
10
|
+
import { OverlayConfig } from '@angular/cdk/overlay';
|
|
11
|
+
import { TemplatePortal } from '@angular/cdk/portal';
|
|
12
|
+
import { Subject } from 'rxjs';
|
|
13
|
+
import { takeUntil } from 'rxjs/operators';
|
|
9
14
|
|
|
10
15
|
/**
|
|
11
16
|
* Throws an exception for the case when popover trigger doesn't have a valid cmat-popover instance
|
|
@@ -34,7 +39,6 @@ function throwCmatPopoverInvalidPositionEnd() {
|
|
|
34
39
|
Example: <cmat-popover [position]="['below', 'after']" #popover="cmatPopover"></cmat-popover>`);
|
|
35
40
|
}
|
|
36
41
|
|
|
37
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
38
42
|
class CmatPopoverComponent {
|
|
39
43
|
constructor(_dir, _elementRef, zone) {
|
|
40
44
|
this._dir = _dir;
|
|
@@ -317,10 +321,10 @@ class CmatPopoverComponent {
|
|
|
317
321
|
this.classList['cmat-popover-below-center'] = pos[0] === 'below' && pos[1] === 'center';
|
|
318
322
|
this.classList['cmat-popover-below-after'] = pos[0] === 'below' && pos[1] === 'after';
|
|
319
323
|
}
|
|
320
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
321
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.
|
|
324
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: CmatPopoverComponent, deps: [{ token: i1.Directionality, optional: true }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
325
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.7", type: CmatPopoverComponent, isStandalone: true, selector: "cmat-popover", inputs: { popoverPanelStyles: "popoverPanelStyles", popoverArrowStyles: "popoverArrowStyles", popoverContentStyles: "popoverContentStyles", position: "position", triggerEvent: "triggerEvent", scrollStrategy: "scrollStrategy", enterDelay: "enterDelay", leaveDelay: "leaveDelay", xOffset: "xOffset", yOffset: "yOffset", arrowOffsetX: "arrowOffsetX", arrowOffsetY: "arrowOffsetY", arrowWidth: "arrowWidth", arrowHeight: "arrowHeight", closeOnPanelClick: "closeOnPanelClick", closeOnBackdropClick: "closeOnBackdropClick", disableAnimation: "disableAnimation", focusTrapEnabled: "focusTrapEnabled", focusTrapAutoCaptureEnabled: "focusTrapAutoCaptureEnabled", panelClass: "panelClass" }, outputs: { closed: "closed" }, host: { properties: { "attr.role": "this.role" } }, viewQueries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true }], exportAs: ["cmatPopover"], ngImport: i0, template: "<ng-template>\r\n <div class=\"cmat-popover-panel shadow\" role=\"dialog\" [ngClass]=\"classList\" [ngStyle]=\"popoverPanelStyles\"\r\n (keydown)=\"handleKeydown($event)\" (click)=\"onClick()\" (focus)=\"onFocus()\" (mouseover)=\"onMouseOver()\" (mouseleave)=\"onMouseLeave()\"\r\n [@.disabled]=\"disableAnimation\" [@transform]=\"'enter'\">\r\n <div class=\"cmat-popover-direction-arrow\" [ngStyle]=\"popoverArrowStyles\"></div>\r\n <div class=\"cmat-popover-content\" [ngStyle]=\"popoverContentStyles\" [cdkTrapFocus]=\"focusTrapEnabled\"\r\n [cdkTrapFocusAutoCapture]=\"focusTrapAutoCaptureEnabled\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n</ng-template>", styles: [".cmat-popover-panel{max-height:calc(100vh - 48px);padding:.5rem;border-radius:.5rem;font-size:1rem}.cmat-popover-panel[class*=cmat-popover-below]{margin-top:calc(.5em + 2px)}.cmat-popover-panel[class*=cmat-popover-above]{margin-bottom:calc(.5em + 2px)}.cmat-popover-panel[class*=cmat-popover-before]{margin-right:calc(.5em + 2px)}[dir=rtl] .cmat-popover-panel[class*=cmat-popover-before]{margin-right:auto;margin-left:calc(.5em + 2px)}.cmat-popover-panel[class*=cmat-popover-after]{margin-left:calc(.5em + 2px)}[dir=rtl] .cmat-popover-panel[class*=cmat-popover-after]{margin-left:auto;margin-right:calc(.5em + 2px)}.cmat-popover-direction-arrow{position:absolute}.cmat-popover-direction-arrow:before,.cmat-popover-direction-arrow:after{position:absolute;display:inline-block;border-style:solid;content:\"\"}.cmat-popover-direction-arrow:before{border-width:.5em;border-color:var(--cmat-divider)}.cmat-popover-direction-arrow:after{border-width:calc(.5em - 1px);border-color:var(--cmat-bg-card)}[class*=cmat-popover-below] .cmat-popover-direction-arrow,[class*=cmat-popover-above] .cmat-popover-direction-arrow{width:1em}[class*=cmat-popover-below] .cmat-popover-direction-arrow:after,[class*=cmat-popover-above] .cmat-popover-direction-arrow:after{left:1px}[dir=rtl] [class*=cmat-popover-below] .cmat-popover-direction-arrow:after,[dir=rtl] [class*=cmat-popover-above] .cmat-popover-direction-arrow:after{right:1px;left:auto}[class*=cmat-popover-below] .cmat-popover-direction-arrow:before,[class*=cmat-popover-below] .cmat-popover-direction-arrow:after,[class*=cmat-popover-above] .cmat-popover-direction-arrow:before,[class*=cmat-popover-above] .cmat-popover-direction-arrow:after{border-left-color:transparent;border-right-color:transparent}[class*=cmat-popover-below] .cmat-popover-direction-arrow{top:0}[class*=cmat-popover-below] .cmat-popover-direction-arrow:before,[class*=cmat-popover-below] .cmat-popover-direction-arrow:after{bottom:0;border-top-width:0}[class*=cmat-popover-above] .cmat-popover-direction-arrow{bottom:0}[class*=cmat-popover-above] .cmat-popover-direction-arrow:before,[class*=cmat-popover-above] .cmat-popover-direction-arrow:after{top:0;border-bottom-width:0}[class*=cmat-popover-before] .cmat-popover-direction-arrow,[class*=cmat-popover-after] .cmat-popover-direction-arrow{height:1em}[class*=cmat-popover-before] .cmat-popover-direction-arrow:after,[class*=cmat-popover-after] .cmat-popover-direction-arrow:after{top:1px}[class*=cmat-popover-before] .cmat-popover-direction-arrow:before,[class*=cmat-popover-before] .cmat-popover-direction-arrow:after,[class*=cmat-popover-after] .cmat-popover-direction-arrow:before,[class*=cmat-popover-after] .cmat-popover-direction-arrow:after{border-top-color:transparent;border-bottom-color:transparent}[class*=cmat-popover-before] .cmat-popover-direction-arrow{right:0}[class*=cmat-popover-before] .cmat-popover-direction-arrow:before,[class*=cmat-popover-before] .cmat-popover-direction-arrow:after{left:0;border-right-width:0}[dir=rtl] [class*=cmat-popover-before] .cmat-popover-direction-arrow{right:auto;left:0}[dir=rtl] [class*=cmat-popover-before] .cmat-popover-direction-arrow:before,[dir=rtl] [class*=cmat-popover-before] .cmat-popover-direction-arrow:after{left:auto;right:0;border-left-width:0}[dir=rtl] [class*=cmat-popover-before] .cmat-popover-direction-arrow:before{border-right-width:.5em}[dir=rtl] [class*=cmat-popover-before] .cmat-popover-direction-arrow:after{border-right-width:calc(.5em - 1px)}[class*=cmat-popover-after] .cmat-popover-direction-arrow{left:0}[class*=cmat-popover-after] .cmat-popover-direction-arrow:before,[class*=cmat-popover-after] .cmat-popover-direction-arrow:after{right:0;border-left-width:0}[dir=rtl] [class*=cmat-popover-after] .cmat-popover-direction-arrow{left:auto;right:0}[dir=rtl] [class*=cmat-popover-after] .cmat-popover-direction-arrow:before,[dir=rtl] [class*=cmat-popover-after] .cmat-popover-direction-arrow:after{right:auto;left:0;border-right-width:0}[dir=rtl] [class*=cmat-popover-after] .cmat-popover-direction-arrow:before{border-left-width:.5em}[dir=rtl] [class*=cmat-popover-after] .cmat-popover-direction-arrow:after{border-left-width:calc(.5em - 1px)}\n"], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }], animations: [cmatAnimations], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
322
326
|
}
|
|
323
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
327
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: CmatPopoverComponent, decorators: [{
|
|
324
328
|
type: Component,
|
|
325
329
|
args: [{ selector: 'cmat-popover', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, animations: [cmatAnimations], exportAs: 'cmatPopover', standalone: true, imports: [NgStyle, NgClass, A11yModule], template: "<ng-template>\r\n <div class=\"cmat-popover-panel shadow\" role=\"dialog\" [ngClass]=\"classList\" [ngStyle]=\"popoverPanelStyles\"\r\n (keydown)=\"handleKeydown($event)\" (click)=\"onClick()\" (focus)=\"onFocus()\" (mouseover)=\"onMouseOver()\" (mouseleave)=\"onMouseLeave()\"\r\n [@.disabled]=\"disableAnimation\" [@transform]=\"'enter'\">\r\n <div class=\"cmat-popover-direction-arrow\" [ngStyle]=\"popoverArrowStyles\"></div>\r\n <div class=\"cmat-popover-content\" [ngStyle]=\"popoverContentStyles\" [cdkTrapFocus]=\"focusTrapEnabled\"\r\n [cdkTrapFocusAutoCapture]=\"focusTrapAutoCaptureEnabled\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n</ng-template>", styles: [".cmat-popover-panel{max-height:calc(100vh - 48px);padding:.5rem;border-radius:.5rem;font-size:1rem}.cmat-popover-panel[class*=cmat-popover-below]{margin-top:calc(.5em + 2px)}.cmat-popover-panel[class*=cmat-popover-above]{margin-bottom:calc(.5em + 2px)}.cmat-popover-panel[class*=cmat-popover-before]{margin-right:calc(.5em + 2px)}[dir=rtl] .cmat-popover-panel[class*=cmat-popover-before]{margin-right:auto;margin-left:calc(.5em + 2px)}.cmat-popover-panel[class*=cmat-popover-after]{margin-left:calc(.5em + 2px)}[dir=rtl] .cmat-popover-panel[class*=cmat-popover-after]{margin-left:auto;margin-right:calc(.5em + 2px)}.cmat-popover-direction-arrow{position:absolute}.cmat-popover-direction-arrow:before,.cmat-popover-direction-arrow:after{position:absolute;display:inline-block;border-style:solid;content:\"\"}.cmat-popover-direction-arrow:before{border-width:.5em;border-color:var(--cmat-divider)}.cmat-popover-direction-arrow:after{border-width:calc(.5em - 1px);border-color:var(--cmat-bg-card)}[class*=cmat-popover-below] .cmat-popover-direction-arrow,[class*=cmat-popover-above] .cmat-popover-direction-arrow{width:1em}[class*=cmat-popover-below] .cmat-popover-direction-arrow:after,[class*=cmat-popover-above] .cmat-popover-direction-arrow:after{left:1px}[dir=rtl] [class*=cmat-popover-below] .cmat-popover-direction-arrow:after,[dir=rtl] [class*=cmat-popover-above] .cmat-popover-direction-arrow:after{right:1px;left:auto}[class*=cmat-popover-below] .cmat-popover-direction-arrow:before,[class*=cmat-popover-below] .cmat-popover-direction-arrow:after,[class*=cmat-popover-above] .cmat-popover-direction-arrow:before,[class*=cmat-popover-above] .cmat-popover-direction-arrow:after{border-left-color:transparent;border-right-color:transparent}[class*=cmat-popover-below] .cmat-popover-direction-arrow{top:0}[class*=cmat-popover-below] .cmat-popover-direction-arrow:before,[class*=cmat-popover-below] .cmat-popover-direction-arrow:after{bottom:0;border-top-width:0}[class*=cmat-popover-above] .cmat-popover-direction-arrow{bottom:0}[class*=cmat-popover-above] .cmat-popover-direction-arrow:before,[class*=cmat-popover-above] .cmat-popover-direction-arrow:after{top:0;border-bottom-width:0}[class*=cmat-popover-before] .cmat-popover-direction-arrow,[class*=cmat-popover-after] .cmat-popover-direction-arrow{height:1em}[class*=cmat-popover-before] .cmat-popover-direction-arrow:after,[class*=cmat-popover-after] .cmat-popover-direction-arrow:after{top:1px}[class*=cmat-popover-before] .cmat-popover-direction-arrow:before,[class*=cmat-popover-before] .cmat-popover-direction-arrow:after,[class*=cmat-popover-after] .cmat-popover-direction-arrow:before,[class*=cmat-popover-after] .cmat-popover-direction-arrow:after{border-top-color:transparent;border-bottom-color:transparent}[class*=cmat-popover-before] .cmat-popover-direction-arrow{right:0}[class*=cmat-popover-before] .cmat-popover-direction-arrow:before,[class*=cmat-popover-before] .cmat-popover-direction-arrow:after{left:0;border-right-width:0}[dir=rtl] [class*=cmat-popover-before] .cmat-popover-direction-arrow{right:auto;left:0}[dir=rtl] [class*=cmat-popover-before] .cmat-popover-direction-arrow:before,[dir=rtl] [class*=cmat-popover-before] .cmat-popover-direction-arrow:after{left:auto;right:0;border-left-width:0}[dir=rtl] [class*=cmat-popover-before] .cmat-popover-direction-arrow:before{border-right-width:.5em}[dir=rtl] [class*=cmat-popover-before] .cmat-popover-direction-arrow:after{border-right-width:calc(.5em - 1px)}[class*=cmat-popover-after] .cmat-popover-direction-arrow{left:0}[class*=cmat-popover-after] .cmat-popover-direction-arrow:before,[class*=cmat-popover-after] .cmat-popover-direction-arrow:after{right:0;border-left-width:0}[dir=rtl] [class*=cmat-popover-after] .cmat-popover-direction-arrow{left:auto;right:0}[dir=rtl] [class*=cmat-popover-after] .cmat-popover-direction-arrow:before,[dir=rtl] [class*=cmat-popover-after] .cmat-popover-direction-arrow:after{right:auto;left:0;border-right-width:0}[dir=rtl] [class*=cmat-popover-after] .cmat-popover-direction-arrow:before{border-left-width:.5em}[dir=rtl] [class*=cmat-popover-after] .cmat-popover-direction-arrow:after{border-left-width:calc(.5em - 1px)}\n"] }]
|
|
326
330
|
}], ctorParameters: () => [{ type: i1.Directionality, decorators: [{
|
|
@@ -375,9 +379,459 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImpor
|
|
|
375
379
|
type: Input
|
|
376
380
|
}] } });
|
|
377
381
|
|
|
382
|
+
/**
|
|
383
|
+
* This directive is intended to be used in conjunction with an cmat-popover tag. It is
|
|
384
|
+
* responsible for toggling the display of the provided popover instance.
|
|
385
|
+
*/
|
|
386
|
+
class CmatPopoverTriggerDirective {
|
|
387
|
+
constructor(_overlay, _elementRef, _viewContainerRef, _dir, _changeDetectorRef) {
|
|
388
|
+
this._overlay = _overlay;
|
|
389
|
+
this._elementRef = _elementRef;
|
|
390
|
+
this._viewContainerRef = _viewContainerRef;
|
|
391
|
+
this._dir = _dir;
|
|
392
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
393
|
+
this.ariaHaspopup = true;
|
|
394
|
+
/** Event emitted when the associated popover is opened. */
|
|
395
|
+
this.popoverOpened = new EventEmitter();
|
|
396
|
+
/** Event emitted when the associated popover is closed. */
|
|
397
|
+
this.popoverClosed = new EventEmitter();
|
|
398
|
+
this.popoverOpened$ = new Subject();
|
|
399
|
+
this.popoverClosed$ = new Subject();
|
|
400
|
+
this._overlayRef = null;
|
|
401
|
+
this._popoverOpen = false;
|
|
402
|
+
this._halt = false;
|
|
403
|
+
// tracking input type is necessary so it's possible to only auto-focus
|
|
404
|
+
// the first item of the list when the popover is opened via the keyboard
|
|
405
|
+
this._openedByMouse = false;
|
|
406
|
+
this._onDestroy = new Subject();
|
|
407
|
+
}
|
|
408
|
+
/** Whether the popover is open. */
|
|
409
|
+
get popoverOpen() {
|
|
410
|
+
return this._popoverOpen;
|
|
411
|
+
}
|
|
412
|
+
/** The text direction of the containing app. */
|
|
413
|
+
get dir() {
|
|
414
|
+
return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
|
|
415
|
+
}
|
|
416
|
+
onClick() {
|
|
417
|
+
if (this.popover.triggerEvent === 'click') {
|
|
418
|
+
this.togglePopover();
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
onMouseEnter() {
|
|
422
|
+
this._halt = false;
|
|
423
|
+
if (this.popover.triggerEvent === 'hover') {
|
|
424
|
+
this._mouseoverTimer = setTimeout(() => {
|
|
425
|
+
this.openPopover();
|
|
426
|
+
}, this.popover.enterDelay);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
onMouseLeave() {
|
|
430
|
+
if (this.popover.triggerEvent === 'hover') {
|
|
431
|
+
if (this._mouseoverTimer) {
|
|
432
|
+
clearTimeout(this._mouseoverTimer);
|
|
433
|
+
this._mouseoverTimer = null;
|
|
434
|
+
}
|
|
435
|
+
if (this._popoverOpen) {
|
|
436
|
+
setTimeout(() => {
|
|
437
|
+
if (!this.popover.closeDisabled) {
|
|
438
|
+
this.closePopover();
|
|
439
|
+
}
|
|
440
|
+
}, this.popover.leaveDelay);
|
|
441
|
+
}
|
|
442
|
+
else {
|
|
443
|
+
this._halt = true;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
handleMousedown(event) {
|
|
448
|
+
if (event && !isFakeMousedownFromScreenReader(event)) {
|
|
449
|
+
this._openedByMouse = true;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
ngAfterViewInit() {
|
|
453
|
+
this._checkPopover();
|
|
454
|
+
this._setCurrentConfig();
|
|
455
|
+
this.popover.closed.subscribe(() => this.closePopover());
|
|
456
|
+
}
|
|
457
|
+
ngOnDestroy() {
|
|
458
|
+
this.destroyPopover();
|
|
459
|
+
}
|
|
460
|
+
/** Toggles the popover between the open and closed states. */
|
|
461
|
+
togglePopover() {
|
|
462
|
+
return this._popoverOpen ? this.closePopover() : this.openPopover();
|
|
463
|
+
}
|
|
464
|
+
/** Opens the popover. */
|
|
465
|
+
openPopover() {
|
|
466
|
+
if (!this._popoverOpen && !this._halt) {
|
|
467
|
+
this._createOverlay().attach(this._portal);
|
|
468
|
+
this._subscribeToBackdrop();
|
|
469
|
+
this._subscribeToDetachments();
|
|
470
|
+
this._initPopover();
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
/** Closes the popover. */
|
|
474
|
+
closePopover() {
|
|
475
|
+
if (this._overlayRef) {
|
|
476
|
+
this._overlayRef.detach();
|
|
477
|
+
this._resetPopover();
|
|
478
|
+
}
|
|
479
|
+
this.destroyPopover();
|
|
480
|
+
}
|
|
481
|
+
/** Removes the popover from the DOM. */
|
|
482
|
+
destroyPopover() {
|
|
483
|
+
if (this._mouseoverTimer) {
|
|
484
|
+
clearTimeout(this._mouseoverTimer);
|
|
485
|
+
this._mouseoverTimer = null;
|
|
486
|
+
}
|
|
487
|
+
if (this._overlayRef) {
|
|
488
|
+
this._overlayRef.dispose();
|
|
489
|
+
this._overlayRef = null;
|
|
490
|
+
this._cleanUpSubscriptions();
|
|
491
|
+
}
|
|
492
|
+
this._onDestroy.next();
|
|
493
|
+
this._onDestroy.complete();
|
|
494
|
+
}
|
|
495
|
+
/** Focuses the popover trigger. */
|
|
496
|
+
focus() {
|
|
497
|
+
this._elementRef.nativeElement.focus();
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* This method ensures that the popover closes when the overlay backdrop is clicked.
|
|
501
|
+
* We do not use first() here because doing so would not catch clicks from within
|
|
502
|
+
* the popover, and it would fail to unsubscribe properly. Instead, we unsubscribe
|
|
503
|
+
* explicitly when the popover is closed or destroyed.
|
|
504
|
+
*/
|
|
505
|
+
_subscribeToBackdrop() {
|
|
506
|
+
if (this._overlayRef) {
|
|
507
|
+
/** Only subscribe to backdrop if trigger event is click */
|
|
508
|
+
if (this.triggerEvent === 'click' && this.popover.closeOnBackdropClick === true) {
|
|
509
|
+
this._overlayRef
|
|
510
|
+
.backdropClick()
|
|
511
|
+
.pipe(takeUntil(this.popoverClosed$), takeUntil(this._onDestroy))
|
|
512
|
+
.subscribe(() => {
|
|
513
|
+
this.popover.emitCloseEvent();
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
_subscribeToDetachments() {
|
|
519
|
+
if (this._overlayRef) {
|
|
520
|
+
this._overlayRef
|
|
521
|
+
.detachments()
|
|
522
|
+
.pipe(takeUntil(this.popoverClosed$), takeUntil(this._onDestroy))
|
|
523
|
+
.subscribe(() => {
|
|
524
|
+
this._setPopoverClosed();
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* This method sets the popover state to open and focuses the first item if
|
|
530
|
+
* the popover was opened via the keyboard.
|
|
531
|
+
*/
|
|
532
|
+
_initPopover() {
|
|
533
|
+
this._setPopoverOpened();
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* This method resets the popover when it's closed, most importantly restoring
|
|
537
|
+
* focus to the popover trigger if the popover was opened via the keyboard.
|
|
538
|
+
*/
|
|
539
|
+
_resetPopover() {
|
|
540
|
+
this._setPopoverClosed();
|
|
541
|
+
// Focus only needs to be reset to the host element if the popover was opened
|
|
542
|
+
// by the keyboard and manually shifted to the first popover item.
|
|
543
|
+
if (!this._openedByMouse) {
|
|
544
|
+
this.focus();
|
|
545
|
+
}
|
|
546
|
+
this._openedByMouse = false;
|
|
547
|
+
}
|
|
548
|
+
/** set state rather than toggle to support triggers sharing a popover */
|
|
549
|
+
_setPopoverOpened() {
|
|
550
|
+
if (!this._popoverOpen) {
|
|
551
|
+
this._popoverOpen = true;
|
|
552
|
+
this.popoverOpened$.next();
|
|
553
|
+
this.popoverOpened.emit();
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
/** set state rather than toggle to support triggers sharing a popover */
|
|
557
|
+
_setPopoverClosed() {
|
|
558
|
+
if (this._popoverOpen) {
|
|
559
|
+
this._popoverOpen = false;
|
|
560
|
+
this.popoverClosed$.next();
|
|
561
|
+
this.popoverClosed.emit();
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* This method checks that a valid instance of MdPopover has been passed into
|
|
566
|
+
* mdPopoverTriggerFor. If not, an exception is thrown.
|
|
567
|
+
*/
|
|
568
|
+
_checkPopover() {
|
|
569
|
+
if (!this.popover) {
|
|
570
|
+
throwCmatPopoverMissingError();
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* This method creates the overlay from the provided popover's template and saves its
|
|
575
|
+
* OverlayRef so that it can be attached to the DOM when openPopover is called.
|
|
576
|
+
*/
|
|
577
|
+
_createOverlay() {
|
|
578
|
+
if (!this._overlayRef) {
|
|
579
|
+
this._portal = new TemplatePortal(this.popover.templateRef, this._viewContainerRef);
|
|
580
|
+
const config = this._getOverlayConfig();
|
|
581
|
+
this._subscribeToPositions(config.positionStrategy);
|
|
582
|
+
this._overlayRef = this._overlay.create(config);
|
|
583
|
+
}
|
|
584
|
+
return this._overlayRef;
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* This method builds the configuration object needed to create the overlay, the OverlayConfig.
|
|
588
|
+
*
|
|
589
|
+
* @returns OverlayConfig
|
|
590
|
+
*/
|
|
591
|
+
_getOverlayConfig() {
|
|
592
|
+
const overlayState = new OverlayConfig();
|
|
593
|
+
overlayState.positionStrategy = this._getPosition();
|
|
594
|
+
/** Display overlay backdrop if trigger event is click */
|
|
595
|
+
if (this.triggerEvent === 'click') {
|
|
596
|
+
overlayState.hasBackdrop = true;
|
|
597
|
+
overlayState.backdropClass = 'cdk-overlay-transparent-backdrop';
|
|
598
|
+
}
|
|
599
|
+
overlayState.direction = this._dir;
|
|
600
|
+
overlayState.scrollStrategy = this._getOverlayScrollStrategy(this.popover.scrollStrategy);
|
|
601
|
+
return overlayState;
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* This method returns the scroll strategy used by the cdk/overlay.
|
|
605
|
+
*/
|
|
606
|
+
_getOverlayScrollStrategy(strategy) {
|
|
607
|
+
switch (strategy) {
|
|
608
|
+
case 'noop':
|
|
609
|
+
return this._overlay.scrollStrategies.noop();
|
|
610
|
+
case 'close':
|
|
611
|
+
return this._overlay.scrollStrategies.close();
|
|
612
|
+
case 'block':
|
|
613
|
+
return this._overlay.scrollStrategies.block();
|
|
614
|
+
case 'reposition':
|
|
615
|
+
default:
|
|
616
|
+
return this._overlay.scrollStrategies.reposition();
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* Listens to changes in the position of the overlay and sets the correct classes
|
|
621
|
+
* on the popover based on the new position. This ensures the animation origin is always
|
|
622
|
+
* correct, even if a fallback position is used for the overlay.
|
|
623
|
+
*/
|
|
624
|
+
_subscribeToPositions(position) {
|
|
625
|
+
this._positionSubscription = position.positionChanges.subscribe((change) => {
|
|
626
|
+
const posX = change.connectionPair.overlayX === 'start'
|
|
627
|
+
? 'after'
|
|
628
|
+
: change.connectionPair.overlayX === 'end'
|
|
629
|
+
? 'before'
|
|
630
|
+
: 'center';
|
|
631
|
+
const posY = change.connectionPair.overlayY === 'top'
|
|
632
|
+
? 'below'
|
|
633
|
+
: change.connectionPair.overlayY === 'bottom'
|
|
634
|
+
? 'above'
|
|
635
|
+
: 'center';
|
|
636
|
+
const pos = this.popover.position[0] === 'above' || this.popover.position[0] === 'below'
|
|
637
|
+
? [posY, posX]
|
|
638
|
+
: [posX, posY];
|
|
639
|
+
// required for ChangeDetectionStrategy.OnPush
|
|
640
|
+
this._changeDetectorRef.markForCheck();
|
|
641
|
+
this.popover.zone.run(() => {
|
|
642
|
+
this.popover.setCurrentStyles(pos);
|
|
643
|
+
this.popover.setPositionClasses(pos);
|
|
644
|
+
});
|
|
645
|
+
});
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* This method builds the position strategy for the overlay, so the popover is properly connected
|
|
649
|
+
* to the trigger.
|
|
650
|
+
*
|
|
651
|
+
* @returns ConnectedPositionStrategy
|
|
652
|
+
*/
|
|
653
|
+
_getPosition() {
|
|
654
|
+
const [originX, origin2ndX, origin3rdX] = this.popover.position[0] === 'before' || this.popover.position[1] === 'after'
|
|
655
|
+
? ['start', 'center', 'end']
|
|
656
|
+
: this.popover.position[0] === 'after' || this.popover.position[1] === 'before'
|
|
657
|
+
? ['end', 'center', 'start']
|
|
658
|
+
: ['center', 'start', 'end'];
|
|
659
|
+
const [originY, origin2ndY, origin3rdY] = this.popover.position[0] === 'above' || this.popover.position[1] === 'below'
|
|
660
|
+
? ['top', 'center', 'bottom']
|
|
661
|
+
: this.popover.position[0] === 'below' || this.popover.position[1] === 'above'
|
|
662
|
+
? ['bottom', 'center', 'top']
|
|
663
|
+
: ['center', 'top', 'bottom'];
|
|
664
|
+
const [overlayX, overlayFallbackX] = this.popover.position[0] === 'below' || this.popover.position[0] === 'above'
|
|
665
|
+
? [originX, originX]
|
|
666
|
+
: this.popover.position[0] === 'before'
|
|
667
|
+
? ['end', 'start']
|
|
668
|
+
: ['start', 'end'];
|
|
669
|
+
const [overlayY, overlayFallbackY] = this.popover.position[0] === 'before' || this.popover.position[0] === 'after'
|
|
670
|
+
? [originY, originY]
|
|
671
|
+
: this.popover.position[0] === 'below'
|
|
672
|
+
? ['top', 'bottom']
|
|
673
|
+
: ['bottom', 'top'];
|
|
674
|
+
const originFallbackX = overlayX;
|
|
675
|
+
const originFallbackY = overlayY;
|
|
676
|
+
const offsetX = this.popover.xOffset && !isNaN(Number(this.popover.xOffset))
|
|
677
|
+
? Number(this.dir === 'ltr' ? this.popover.xOffset : -this.popover.xOffset)
|
|
678
|
+
: 0;
|
|
679
|
+
const offsetY = this.popover.yOffset && !isNaN(Number(this.popover.yOffset))
|
|
680
|
+
? Number(this.popover.yOffset)
|
|
681
|
+
: 0;
|
|
682
|
+
/**
|
|
683
|
+
* For overriding position element, when `cmatPopoverTargetAt` has a valid element reference.
|
|
684
|
+
* Useful for sticking popover to parent element and offsetting arrow to trigger element.
|
|
685
|
+
* If undefined defaults to the trigger element reference.
|
|
686
|
+
*/
|
|
687
|
+
let element = this._elementRef;
|
|
688
|
+
if (typeof this.targetElement !== 'undefined') {
|
|
689
|
+
this.popover.containerPositioning = true;
|
|
690
|
+
element = this.targetElement._elementRef;
|
|
691
|
+
}
|
|
692
|
+
let positions = [{ originX, originY, overlayX, overlayY }];
|
|
693
|
+
if (this.popover.position[0] === 'above' || this.popover.position[0] === 'below') {
|
|
694
|
+
positions = [
|
|
695
|
+
{ originX, originY, overlayX, overlayY, offsetY },
|
|
696
|
+
{ originX: origin2ndX, originY, overlayX: origin2ndX, overlayY, offsetY },
|
|
697
|
+
{ originX: origin3rdX, originY, overlayX: origin3rdX, overlayY, offsetY },
|
|
698
|
+
{
|
|
699
|
+
originX,
|
|
700
|
+
originY: originFallbackY,
|
|
701
|
+
overlayX,
|
|
702
|
+
overlayY: overlayFallbackY,
|
|
703
|
+
offsetY: -offsetY,
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
originX: origin2ndX,
|
|
707
|
+
originY: originFallbackY,
|
|
708
|
+
overlayX: origin2ndX,
|
|
709
|
+
overlayY: overlayFallbackY,
|
|
710
|
+
offsetY: -offsetY,
|
|
711
|
+
},
|
|
712
|
+
{
|
|
713
|
+
originX: origin3rdX,
|
|
714
|
+
originY: originFallbackY,
|
|
715
|
+
overlayX: origin3rdX,
|
|
716
|
+
overlayY: overlayFallbackY,
|
|
717
|
+
offsetY: -offsetY,
|
|
718
|
+
},
|
|
719
|
+
];
|
|
720
|
+
}
|
|
721
|
+
if (this.popover.position[0] === 'before' || this.popover.position[0] === 'after') {
|
|
722
|
+
positions = [
|
|
723
|
+
{ originX, originY, overlayX, overlayY, offsetX },
|
|
724
|
+
{ originX, originY: origin2ndY, overlayX, overlayY: origin2ndY, offsetX },
|
|
725
|
+
{ originX, originY: origin3rdY, overlayX, overlayY: origin3rdY, offsetX },
|
|
726
|
+
{
|
|
727
|
+
originX: originFallbackX,
|
|
728
|
+
originY,
|
|
729
|
+
overlayX: overlayFallbackX,
|
|
730
|
+
overlayY,
|
|
731
|
+
offsetX: -offsetX,
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
originX: originFallbackX,
|
|
735
|
+
originY: origin2ndY,
|
|
736
|
+
overlayX: overlayFallbackX,
|
|
737
|
+
overlayY: origin2ndY,
|
|
738
|
+
offsetX: -offsetX,
|
|
739
|
+
},
|
|
740
|
+
{
|
|
741
|
+
originX: originFallbackX,
|
|
742
|
+
originY: origin3rdY,
|
|
743
|
+
overlayX: overlayFallbackX,
|
|
744
|
+
overlayY: origin3rdY,
|
|
745
|
+
offsetX: -offsetX,
|
|
746
|
+
},
|
|
747
|
+
];
|
|
748
|
+
}
|
|
749
|
+
return this._overlay
|
|
750
|
+
.position()
|
|
751
|
+
.flexibleConnectedTo(element)
|
|
752
|
+
.withLockedPosition()
|
|
753
|
+
.withPositions(positions)
|
|
754
|
+
.withDefaultOffsetX(offsetX)
|
|
755
|
+
.withDefaultOffsetY(offsetY);
|
|
756
|
+
}
|
|
757
|
+
_cleanUpSubscriptions() {
|
|
758
|
+
if (this._backdropSubscription) {
|
|
759
|
+
this._backdropSubscription.unsubscribe();
|
|
760
|
+
}
|
|
761
|
+
if (this._positionSubscription) {
|
|
762
|
+
this._positionSubscription.unsubscribe();
|
|
763
|
+
}
|
|
764
|
+
if (this._detachmentsSubscription) {
|
|
765
|
+
this._detachmentsSubscription.unsubscribe();
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
_setCurrentConfig() {
|
|
769
|
+
if (this.triggerEvent) {
|
|
770
|
+
this.popover.triggerEvent = this.triggerEvent;
|
|
771
|
+
}
|
|
772
|
+
this.popover.setCurrentStyles();
|
|
773
|
+
}
|
|
774
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: CmatPopoverTriggerDirective, deps: [{ token: i1$1.Overlay }, { token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: i1.Directionality, optional: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
775
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.7", type: CmatPopoverTriggerDirective, isStandalone: true, selector: "[cmatPopoverTriggerFor],[cmatPopoverTargetAt],[cmatPopoverTriggerOn]", inputs: { popover: ["cmatPopoverTriggerFor", "popover"], targetElement: ["cmatPopoverTargetAt", "targetElement"], triggerEvent: ["cmatPopoverTriggerOn", "triggerEvent"] }, outputs: { popoverOpened: "popoverOpened", popoverClosed: "popoverClosed" }, host: { listeners: { "click": "onClick($event)", "mouseenter": "onMouseEnter($event)", "mouseleave": "onMouseLeave($event)", "mousedown": "handleMousedown($event)" }, properties: { "attr.aria-haspopup": "this.ariaHaspopup" } }, exportAs: ["cmatPopoverTrigger"], ngImport: i0 }); }
|
|
776
|
+
}
|
|
777
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: CmatPopoverTriggerDirective, decorators: [{
|
|
778
|
+
type: Directive,
|
|
779
|
+
args: [{
|
|
780
|
+
selector: '[cmatPopoverTriggerFor],[cmatPopoverTargetAt],[cmatPopoverTriggerOn]',
|
|
781
|
+
standalone: true,
|
|
782
|
+
exportAs: 'cmatPopoverTrigger'
|
|
783
|
+
}]
|
|
784
|
+
}], ctorParameters: () => [{ type: i1$1.Overlay }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: i1.Directionality, decorators: [{
|
|
785
|
+
type: Optional
|
|
786
|
+
}] }, { type: i0.ChangeDetectorRef }], propDecorators: { ariaHaspopup: [{
|
|
787
|
+
type: HostBinding,
|
|
788
|
+
args: ['attr.aria-haspopup']
|
|
789
|
+
}], popover: [{
|
|
790
|
+
type: Input,
|
|
791
|
+
args: ['cmatPopoverTriggerFor']
|
|
792
|
+
}], targetElement: [{
|
|
793
|
+
type: Input,
|
|
794
|
+
args: ['cmatPopoverTargetAt']
|
|
795
|
+
}], triggerEvent: [{
|
|
796
|
+
type: Input,
|
|
797
|
+
args: ['cmatPopoverTriggerOn']
|
|
798
|
+
}], popoverOpened: [{
|
|
799
|
+
type: Output
|
|
800
|
+
}], popoverClosed: [{
|
|
801
|
+
type: Output
|
|
802
|
+
}], onClick: [{
|
|
803
|
+
type: HostListener,
|
|
804
|
+
args: ['click', ['$event']]
|
|
805
|
+
}], onMouseEnter: [{
|
|
806
|
+
type: HostListener,
|
|
807
|
+
args: ['mouseenter', ['$event']]
|
|
808
|
+
}], onMouseLeave: [{
|
|
809
|
+
type: HostListener,
|
|
810
|
+
args: ['mouseleave', ['$event']]
|
|
811
|
+
}], handleMousedown: [{
|
|
812
|
+
type: HostListener,
|
|
813
|
+
args: ['mousedown', ['$event']]
|
|
814
|
+
}] } });
|
|
815
|
+
|
|
816
|
+
class CmatPopoverTargetDirective {
|
|
817
|
+
constructor(elementRef) {
|
|
818
|
+
this.elementRef = elementRef;
|
|
819
|
+
}
|
|
820
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: CmatPopoverTargetDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
821
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.7", type: CmatPopoverTargetDirective, isStandalone: true, selector: "cmat-popover-target, [cmatPopoverTarget]", exportAs: ["cmatPopoverTarget"], ngImport: i0 }); }
|
|
822
|
+
}
|
|
823
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: CmatPopoverTargetDirective, decorators: [{
|
|
824
|
+
type: Directive,
|
|
825
|
+
args: [{
|
|
826
|
+
selector: 'cmat-popover-target, [cmatPopoverTarget]',
|
|
827
|
+
standalone: true,
|
|
828
|
+
exportAs: 'cmatPopoverTarget',
|
|
829
|
+
}]
|
|
830
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }] });
|
|
831
|
+
|
|
378
832
|
/**
|
|
379
833
|
* Generated bundle index. Do not edit.
|
|
380
834
|
*/
|
|
381
835
|
|
|
382
|
-
export { CmatPopoverComponent };
|
|
836
|
+
export { CmatPopoverComponent, CmatPopoverTargetDirective, CmatPopoverTriggerDirective };
|
|
383
837
|
//# sourceMappingURL=cmat-components-popover.mjs.map
|