mis-crystal-design-system 2.4.8 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/action-list/action-list.component.d.ts +50 -0
- package/action-list/action-list.module.d.ts +4 -0
- package/action-list/index.d.ts +1 -0
- package/action-list/mis-crystal-design-system-action-list.d.ts +4 -0
- package/action-list/mis-crystal-design-system-action-list.metadata.json +1 -0
- package/action-list/package.json +11 -0
- package/action-list/public_api.d.ts +2 -0
- package/async-search-dropdown/async-dropdown.component.d.ts +4 -4
- package/async-search-dropdown/index.d.ts +1 -1
- package/async-search-dropdown/mis-crystal-design-system-async-search-dropdown.metadata.json +1 -1
- package/async-search-dropdown/public_api.d.ts +2 -2
- package/bundles/mis-crystal-design-system-action-list.umd.js +516 -0
- package/bundles/mis-crystal-design-system-action-list.umd.js.map +1 -0
- package/bundles/mis-crystal-design-system-action-list.umd.min.js +16 -0
- package/bundles/mis-crystal-design-system-action-list.umd.min.js.map +1 -0
- package/bundles/mis-crystal-design-system-async-search-dropdown.umd.js +15 -15
- package/bundles/mis-crystal-design-system-async-search-dropdown.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-async-search-dropdown.umd.min.js +1 -1
- package/bundles/mis-crystal-design-system-async-search-dropdown.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-button.umd.js +25 -25
- package/bundles/mis-crystal-design-system-button.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-button.umd.min.js +1 -1
- package/bundles/mis-crystal-design-system-button.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-checkbox.umd.js +6 -7
- package/bundles/mis-crystal-design-system-checkbox.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-checkbox.umd.min.js +1 -1
- package/bundles/mis-crystal-design-system-checkbox.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-chip.umd.js +6 -7
- package/bundles/mis-crystal-design-system-chip.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-chip.umd.min.js +1 -1
- package/bundles/mis-crystal-design-system-chip.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-datepicker_v2.umd.js +22 -30
- package/bundles/mis-crystal-design-system-datepicker_v2.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-datepicker_v2.umd.min.js +2 -2
- package/bundles/mis-crystal-design-system-datepicker_v2.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-daterangepicker_v2.umd.js +26 -49
- package/bundles/mis-crystal-design-system-daterangepicker_v2.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-daterangepicker_v2.umd.min.js +1 -1
- package/bundles/mis-crystal-design-system-daterangepicker_v2.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-drawer.umd.js +9 -12
- package/bundles/mis-crystal-design-system-drawer.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-drawer.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-dropdown.umd.js +384 -22
- package/bundles/mis-crystal-design-system-dropdown.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-dropdown.umd.min.js +15 -1
- package/bundles/mis-crystal-design-system-dropdown.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-fab.umd.js +11 -14
- package/bundles/mis-crystal-design-system-fab.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-fab.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-input.umd.js +7 -7
- package/bundles/mis-crystal-design-system-input.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-input.umd.min.js +1 -1
- package/bundles/mis-crystal-design-system-input.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-loader.umd.js +3 -4
- package/bundles/mis-crystal-design-system-loader.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-loader.umd.min.js +1 -1
- package/bundles/mis-crystal-design-system-loader.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-menu.umd.js +119 -0
- package/bundles/mis-crystal-design-system-menu.umd.js.map +1 -0
- package/bundles/mis-crystal-design-system-menu.umd.min.js +2 -0
- package/bundles/mis-crystal-design-system-menu.umd.min.js.map +1 -0
- package/bundles/mis-crystal-design-system-modal.umd.js +8 -12
- package/bundles/mis-crystal-design-system-modal.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-modal.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-multi-select-dropdown.umd.js +61 -22
- package/bundles/mis-crystal-design-system-multi-select-dropdown.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-multi-select-dropdown.umd.min.js +2 -2
- package/bundles/mis-crystal-design-system-multi-select-dropdown.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-nested-multi-select-dropdown.umd.js +72 -26
- package/bundles/mis-crystal-design-system-nested-multi-select-dropdown.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-nested-multi-select-dropdown.umd.min.js +2 -2
- package/bundles/mis-crystal-design-system-nested-multi-select-dropdown.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-radio-button.umd.js +6 -7
- package/bundles/mis-crystal-design-system-radio-button.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-radio-button.umd.min.js +1 -1
- package/bundles/mis-crystal-design-system-radio-button.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-switch.umd.js +3 -4
- package/bundles/mis-crystal-design-system-switch.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-switch.umd.min.js +1 -1
- package/bundles/mis-crystal-design-system-switch.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-table.umd.js +40 -58
- package/bundles/mis-crystal-design-system-table.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-table.umd.min.js +1 -1
- package/bundles/mis-crystal-design-system-table.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-toast.umd.js +28 -33
- package/bundles/mis-crystal-design-system-toast.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-toast.umd.min.js +1 -1
- package/bundles/mis-crystal-design-system-toast.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system.umd.js.map +1 -1
- package/button/button.component.d.ts +4 -4
- package/button/button.directive.d.ts +3 -3
- package/button/button.directive.scss +1 -1
- package/button/button.module.d.ts +1 -1
- package/button/index.d.ts +1 -1
- package/button/mis-crystal-design-system-button.metadata.json +1 -1
- package/button/public_api.d.ts +2 -2
- package/checkbox/checkbox.component.d.ts +3 -3
- package/checkbox/checkbox.module.d.ts +1 -1
- package/checkbox/index.d.ts +1 -1
- package/checkbox/mis-crystal-design-system-checkbox.metadata.json +1 -1
- package/checkbox/public_api.d.ts +2 -2
- package/chip/chip.component.d.ts +2 -2
- package/chip/chip.module.d.ts +1 -1
- package/chip/index.d.ts +1 -1
- package/chip/mis-crystal-design-system-chip.metadata.json +1 -1
- package/chip/public_api.d.ts +2 -2
- package/datepicker_v2/index.d.ts +1 -1
- package/datepicker_v2/mis-crystal-design-system-datepicker_v2.metadata.json +1 -1
- package/datepicker_v2/public_api.d.ts +3 -3
- package/datepicker_v2/tz-datepicker.directive.d.ts +0 -1
- package/daterangepicker_v2/index.d.ts +1 -1
- package/daterangepicker_v2/mis-crystal-design-system-daterangepicker_v2.metadata.json +1 -1
- package/daterangepicker_v2/public_api.d.ts +3 -3
- package/drawer/index.d.ts +1 -1
- package/drawer/mis-crystal-design-system-drawer.metadata.json +1 -1
- package/drawer/public_api.d.ts +4 -4
- package/dropdown/dropdown.component.d.ts +10 -3
- package/dropdown/dropdown.module.d.ts +1 -1
- package/dropdown/index.d.ts +1 -1
- package/dropdown/mis-crystal-design-system-dropdown.metadata.json +1 -1
- package/dropdown/public_api.d.ts +2 -2
- package/esm2015/action-list/action-list.component.js +168 -0
- package/esm2015/action-list/action-list.module.js +18 -0
- package/esm2015/action-list/index.js +2 -0
- package/esm2015/action-list/mis-crystal-design-system-action-list.js +5 -0
- package/esm2015/action-list/public_api.js +3 -0
- package/esm2015/async-search-dropdown/async-dropdown.component.js +25 -25
- package/esm2015/async-search-dropdown/async-dropdown.module.js +7 -7
- package/esm2015/async-search-dropdown/index.js +2 -2
- package/esm2015/async-search-dropdown/public_api.js +3 -3
- package/esm2015/button/button.component.js +10 -10
- package/esm2015/button/button.directive.js +19 -19
- package/esm2015/button/button.module.js +5 -5
- package/esm2015/button/index.js +2 -2
- package/esm2015/button/public_api.js +3 -3
- package/esm2015/checkbox/checkbox.component.js +9 -10
- package/esm2015/checkbox/checkbox.module.js +5 -5
- package/esm2015/checkbox/index.js +2 -2
- package/esm2015/checkbox/public_api.js +3 -3
- package/esm2015/chip/chip.component.js +8 -9
- package/esm2015/chip/chip.module.js +4 -4
- package/esm2015/chip/index.js +2 -2
- package/esm2015/chip/public_api.js +3 -3
- package/esm2015/datepicker_v2/datepicker-constants.js +2 -2
- package/esm2015/datepicker_v2/datepicker.module.js +3 -3
- package/esm2015/datepicker_v2/index.js +2 -2
- package/esm2015/datepicker_v2/models/dp-config.model.js +1 -1
- package/esm2015/datepicker_v2/public_api.js +3 -3
- package/esm2015/datepicker_v2/tz-datepicker.directive.js +2 -13
- package/esm2015/datepicker_v2/tz-dp-container/tz-dp-container.component.js +12 -9
- package/esm2015/datepicker_v2/utils/index.js +13 -13
- package/esm2015/daterangepicker_v2/daterangepicker-constants.js +2 -2
- package/esm2015/daterangepicker_v2/daterangepicker.module.js +2 -2
- package/esm2015/daterangepicker_v2/index.js +2 -2
- package/esm2015/daterangepicker_v2/public_api.js +3 -3
- package/esm2015/daterangepicker_v2/tz-drp-container/tz-drp-container.component.js +15 -38
- package/esm2015/daterangepicker_v2/utils/index.js +13 -13
- package/esm2015/drawer/drawer-body/drawer-body.component.js +4 -7
- package/esm2015/drawer/drawer.module.js +4 -4
- package/esm2015/drawer/drawer.service.js +4 -4
- package/esm2015/drawer/index.js +2 -2
- package/esm2015/drawer/public_api.js +5 -5
- package/esm2015/dropdown/dropdown.component.js +68 -20
- package/esm2015/dropdown/dropdown.module.js +5 -5
- package/esm2015/dropdown/index.js +2 -2
- package/esm2015/dropdown/public_api.js +3 -3
- package/esm2015/fab/fab.component.js +11 -14
- package/esm2015/fab/fab.module.js +3 -3
- package/esm2015/fab/index.js +2 -2
- package/esm2015/fab/public_api.js +3 -3
- package/esm2015/index.js +2 -2
- package/esm2015/input/directives/input/input.directive.js +7 -7
- package/esm2015/input/index.js +2 -2
- package/esm2015/input/mis-input.component.js +8 -8
- package/esm2015/input/mis-input.module.js +7 -7
- package/esm2015/input/public_api.js +4 -4
- package/esm2015/loader/index.js +2 -2
- package/esm2015/loader/loader.component.js +5 -6
- package/esm2015/loader/loader.module.js +4 -4
- package/esm2015/loader/public_api.js +3 -3
- package/esm2015/menu/index.js +2 -0
- package/esm2015/menu/menu-close.directive.js +18 -0
- package/esm2015/menu/menu.directive.js +70 -0
- package/esm2015/menu/menu.module.js +17 -0
- package/esm2015/menu/mis-crystal-design-system-menu.js +5 -0
- package/esm2015/menu/public_api.js +4 -0
- package/esm2015/modal/index.js +2 -2
- package/esm2015/modal/modal.module.js +10 -14
- package/esm2015/modal/modal.service.js +3 -3
- package/esm2015/modal/module-wrapper/module-wrapper.component.js +4 -4
- package/esm2015/modal/public_api.js +5 -5
- package/esm2015/multi-select-dropdown/index.js +2 -2
- package/esm2015/multi-select-dropdown/multi-select-dropdown.component.js +81 -38
- package/esm2015/multi-select-dropdown/multi-select-dropdown.module.js +7 -7
- package/esm2015/multi-select-dropdown/public_api.js +3 -3
- package/esm2015/nested-multi-select-dropdown/index.js +2 -2
- package/esm2015/nested-multi-select-dropdown/nested-multi-select-dropdown.component.js +74 -24
- package/esm2015/nested-multi-select-dropdown/nested-multi-select-dropdown.module.js +7 -7
- package/esm2015/nested-multi-select-dropdown/public_api.js +3 -3
- package/esm2015/public-api.js +1 -1
- package/esm2015/radio-button/index.js +2 -2
- package/esm2015/radio-button/public_api.js +3 -3
- package/esm2015/radio-button/radio-button.component.js +9 -10
- package/esm2015/radio-button/radio-button.module.js +5 -5
- package/esm2015/switch/index.js +2 -2
- package/esm2015/switch/public_api.js +3 -3
- package/esm2015/switch/switch.component.js +6 -7
- package/esm2015/switch/switch.module.js +5 -5
- package/esm2015/table/custom-table-cell.directive.js +3 -3
- package/esm2015/table/filter/filter.component.js +11 -13
- package/esm2015/table/index.js +2 -2
- package/esm2015/table/public_api.js +5 -5
- package/esm2015/table/sub-table/sub-table.component.js +12 -13
- package/esm2015/table/table.component.js +21 -22
- package/esm2015/table/table.module.js +7 -21
- package/esm2015/toast/index.js +2 -2
- package/esm2015/toast/toast.component.js +12 -14
- package/esm2015/toast/toast.data.service.js +3 -3
- package/esm2015/toast/toast.module.js +9 -9
- package/esm2015/toast/toast.service.js +23 -26
- package/fab/index.d.ts +1 -1
- package/fab/mis-crystal-design-system-fab.metadata.json +1 -1
- package/fab/public_api.d.ts +2 -2
- package/fesm2015/mis-crystal-design-system-action-list.js +191 -0
- package/fesm2015/mis-crystal-design-system-action-list.js.map +1 -0
- package/fesm2015/mis-crystal-design-system-async-search-dropdown.js +20 -20
- package/fesm2015/mis-crystal-design-system-async-search-dropdown.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-button.js +25 -25
- package/fesm2015/mis-crystal-design-system-button.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-checkbox.js +6 -7
- package/fesm2015/mis-crystal-design-system-checkbox.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-chip.js +6 -7
- package/fesm2015/mis-crystal-design-system-chip.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-datepicker_v2.js +25 -33
- package/fesm2015/mis-crystal-design-system-datepicker_v2.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-daterangepicker_v2.js +28 -51
- package/fesm2015/mis-crystal-design-system-daterangepicker_v2.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-drawer.js +9 -12
- package/fesm2015/mis-crystal-design-system-drawer.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-dropdown.js +67 -19
- package/fesm2015/mis-crystal-design-system-dropdown.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-fab.js +11 -14
- package/fesm2015/mis-crystal-design-system-fab.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-input.js +8 -8
- package/fesm2015/mis-crystal-design-system-input.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-loader.js +3 -4
- package/fesm2015/mis-crystal-design-system-loader.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-menu.js +106 -0
- package/fesm2015/mis-crystal-design-system-menu.js.map +1 -0
- package/fesm2015/mis-crystal-design-system-modal.js +8 -12
- package/fesm2015/mis-crystal-design-system-modal.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-multi-select-dropdown.js +80 -37
- package/fesm2015/mis-crystal-design-system-multi-select-dropdown.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-nested-multi-select-dropdown.js +73 -23
- package/fesm2015/mis-crystal-design-system-nested-multi-select-dropdown.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-radio-button.js +6 -7
- package/fesm2015/mis-crystal-design-system-radio-button.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-switch.js +3 -4
- package/fesm2015/mis-crystal-design-system-switch.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-table.js +42 -60
- package/fesm2015/mis-crystal-design-system-table.js.map +1 -1
- package/fesm2015/mis-crystal-design-system-toast.js +28 -33
- package/fesm2015/mis-crystal-design-system-toast.js.map +1 -1
- package/fesm2015/mis-crystal-design-system.js.map +1 -1
- package/index.d.ts +1 -1
- package/input/directives/input/input.directive.d.ts +3 -3
- package/input/index.d.ts +1 -1
- package/input/mis-crystal-design-system-input.metadata.json +1 -1
- package/input/mis-input.component.d.ts +4 -4
- package/input/public_api.d.ts +3 -3
- package/loader/index.d.ts +1 -1
- package/loader/loader.component.d.ts +1 -1
- package/loader/loader.module.d.ts +1 -1
- package/loader/mis-crystal-design-system-loader.metadata.json +1 -1
- package/loader/public_api.d.ts +2 -2
- package/menu/index.d.ts +1 -0
- package/menu/menu-close.directive.d.ts +6 -0
- package/menu/menu.directive.d.ts +18 -0
- package/menu/menu.module.d.ts +3 -0
- package/menu/mis-crystal-design-system-menu.d.ts +4 -0
- package/menu/mis-crystal-design-system-menu.metadata.json +1 -0
- package/menu/package.json +11 -0
- package/menu/public_api.d.ts +3 -0
- package/modal/index.d.ts +1 -1
- package/modal/mis-crystal-design-system-modal.metadata.json +1 -1
- package/modal/modal.module.d.ts +1 -1
- package/modal/public_api.d.ts +4 -4
- package/multi-select-dropdown/index.d.ts +1 -1
- package/multi-select-dropdown/mis-crystal-design-system-multi-select-dropdown.metadata.json +1 -1
- package/multi-select-dropdown/multi-select-dropdown.component.d.ts +10 -3
- package/multi-select-dropdown/multi-select-dropdown.module.d.ts +1 -1
- package/multi-select-dropdown/public_api.d.ts +2 -2
- package/nested-multi-select-dropdown/index.d.ts +1 -1
- package/nested-multi-select-dropdown/mis-crystal-design-system-nested-multi-select-dropdown.metadata.json +1 -1
- package/nested-multi-select-dropdown/nested-multi-select-dropdown.component.d.ts +11 -4
- package/nested-multi-select-dropdown/nested-multi-select-dropdown.module.d.ts +1 -1
- package/nested-multi-select-dropdown/public_api.d.ts +2 -2
- package/package.json +1 -1
- package/radio-button/index.d.ts +1 -1
- package/radio-button/mis-crystal-design-system-radio-button.metadata.json +1 -1
- package/radio-button/public_api.d.ts +2 -2
- package/radio-button/radio-button.component.d.ts +2 -2
- package/radio-button/radio-button.module.d.ts +1 -1
- package/switch/index.d.ts +1 -1
- package/switch/mis-crystal-design-system-switch.metadata.json +1 -1
- package/switch/public_api.d.ts +2 -2
- package/switch/switch.component.d.ts +2 -2
- package/switch/switch.module.d.ts +1 -1
- package/table/custom-table-cell.directive.d.ts +1 -1
- package/table/filter/filter.component.d.ts +1 -1
- package/table/index.d.ts +1 -1
- package/table/mis-crystal-design-system-table.metadata.json +1 -1
- package/table/public_api.d.ts +7 -7
- package/table/sub-table/sub-table.component.d.ts +6 -6
- package/table/table.component.d.ts +6 -6
- package/toast/index.d.ts +1 -1
- package/toast/mis-crystal-design-system-toast.metadata.json +1 -1
- package/toast/toast.component.d.ts +1 -1
- package/toast/toast.module.d.ts +1 -1
- package/toast/toast.service.d.ts +3 -3
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/overlay'), require('@angular/cdk/portal'), require('@angular/core'), require('rxjs/operators'), require('@angular/common')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('mis-crystal-design-system/menu', ['exports', '@angular/cdk/overlay', '@angular/cdk/portal', '@angular/core', 'rxjs/operators', '@angular/common'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['mis-crystal-design-system'] = global['mis-crystal-design-system'] || {}, global['mis-crystal-design-system'].menu = {}), global.ng.cdk.overlay, global.ng.cdk.portal, global.ng.core, global.rxjs.operators, global.ng.common));
|
|
5
|
+
}(this, (function (exports, overlay, portal, core, operators, common) { 'use strict';
|
|
6
|
+
|
|
7
|
+
/** @format */
|
|
8
|
+
var MenuDirective = /** @class */ (function () {
|
|
9
|
+
function MenuDirective(overlay, element, viewContainerRef) {
|
|
10
|
+
this.overlay = overlay;
|
|
11
|
+
this.element = element;
|
|
12
|
+
this.viewContainerRef = viewContainerRef;
|
|
13
|
+
this.positionX = "start";
|
|
14
|
+
this.positionY = "bottom";
|
|
15
|
+
this.offsetX = 0;
|
|
16
|
+
this.offsetY = 0;
|
|
17
|
+
}
|
|
18
|
+
MenuDirective.prototype.onClick = function (event) {
|
|
19
|
+
this.menuShow();
|
|
20
|
+
};
|
|
21
|
+
MenuDirective.prototype.menuShow = function () {
|
|
22
|
+
var _this = this;
|
|
23
|
+
var positionStrategy = this.overlay
|
|
24
|
+
.position()
|
|
25
|
+
.flexibleConnectedTo(this.element)
|
|
26
|
+
.withPositions([
|
|
27
|
+
new overlay.ConnectionPositionPair({ originX: this.positionX, originY: this.positionY }, { overlayX: this.positionX, overlayY: this.positionY === "bottom" ? "top" : "bottom" }, this.offsetX, this.offsetY),
|
|
28
|
+
new overlay.ConnectionPositionPair({ originX: "start", originY: "bottom" }, { overlayX: "start", overlayY: "top" }, this.offsetX, this.offsetY),
|
|
29
|
+
new overlay.ConnectionPositionPair({ originX: "end", originY: "top" }, { overlayX: "end", overlayY: "bottom" }, this.offsetX, this.offsetY)
|
|
30
|
+
])
|
|
31
|
+
.withPush(true);
|
|
32
|
+
var config = new overlay.OverlayConfig({
|
|
33
|
+
hasBackdrop: true,
|
|
34
|
+
positionStrategy: positionStrategy,
|
|
35
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
36
|
+
backdropClass: "cdk-overlay-transparent-backdrop"
|
|
37
|
+
});
|
|
38
|
+
this.overlayRef = this.overlay.create(config);
|
|
39
|
+
var tempRef = new portal.TemplatePortal(this.menu, this.viewContainerRef);
|
|
40
|
+
this.overlayRef.attach(tempRef);
|
|
41
|
+
this.overlayRef
|
|
42
|
+
.backdropClick()
|
|
43
|
+
.pipe(operators.take(1))
|
|
44
|
+
.subscribe(function (res) {
|
|
45
|
+
_this.close();
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
MenuDirective.prototype.close = function () {
|
|
49
|
+
var _a, _b;
|
|
50
|
+
(_a = this.overlayRef) === null || _a === void 0 ? void 0 : _a.detach();
|
|
51
|
+
(_b = this.overlayRef) === null || _b === void 0 ? void 0 : _b.dispose();
|
|
52
|
+
};
|
|
53
|
+
return MenuDirective;
|
|
54
|
+
}());
|
|
55
|
+
MenuDirective.decorators = [
|
|
56
|
+
{ type: core.Directive, args: [{
|
|
57
|
+
selector: "[misMenu]",
|
|
58
|
+
exportAs: "misMenu"
|
|
59
|
+
},] }
|
|
60
|
+
];
|
|
61
|
+
MenuDirective.ctorParameters = function () { return [
|
|
62
|
+
{ type: overlay.Overlay },
|
|
63
|
+
{ type: core.ElementRef },
|
|
64
|
+
{ type: core.ViewContainerRef }
|
|
65
|
+
]; };
|
|
66
|
+
MenuDirective.propDecorators = {
|
|
67
|
+
menu: [{ type: core.Input, args: ["misMenu",] }],
|
|
68
|
+
positionX: [{ type: core.Input }],
|
|
69
|
+
positionY: [{ type: core.Input }],
|
|
70
|
+
offsetX: [{ type: core.Input }],
|
|
71
|
+
offsetY: [{ type: core.Input }],
|
|
72
|
+
onClick: [{ type: core.HostListener, args: ["click", ["$event"],] }]
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
var MenuCloseDirective = /** @class */ (function () {
|
|
76
|
+
function MenuCloseDirective() {
|
|
77
|
+
}
|
|
78
|
+
MenuCloseDirective.prototype.closeMenu = function () {
|
|
79
|
+
this.menu.close();
|
|
80
|
+
};
|
|
81
|
+
return MenuCloseDirective;
|
|
82
|
+
}());
|
|
83
|
+
MenuCloseDirective.decorators = [
|
|
84
|
+
{ type: core.Directive, args: [{
|
|
85
|
+
selector: "[misMenuClose]"
|
|
86
|
+
},] }
|
|
87
|
+
];
|
|
88
|
+
MenuCloseDirective.ctorParameters = function () { return []; };
|
|
89
|
+
MenuCloseDirective.propDecorators = {
|
|
90
|
+
menu: [{ type: core.Input, args: ["misMenuClose",] }],
|
|
91
|
+
closeMenu: [{ type: core.HostListener, args: ["click", [],] }]
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/** @format */
|
|
95
|
+
var MisMenuModule = /** @class */ (function () {
|
|
96
|
+
function MisMenuModule() {
|
|
97
|
+
}
|
|
98
|
+
return MisMenuModule;
|
|
99
|
+
}());
|
|
100
|
+
MisMenuModule.decorators = [
|
|
101
|
+
{ type: core.NgModule, args: [{
|
|
102
|
+
declarations: [MenuDirective, MenuCloseDirective],
|
|
103
|
+
imports: [common.CommonModule, overlay.OverlayModule, portal.PortalModule],
|
|
104
|
+
exports: [MenuDirective, MenuCloseDirective]
|
|
105
|
+
},] }
|
|
106
|
+
];
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Generated bundle index. Do not edit.
|
|
110
|
+
*/
|
|
111
|
+
|
|
112
|
+
exports.MenuCloseDirective = MenuCloseDirective;
|
|
113
|
+
exports.MenuDirective = MenuDirective;
|
|
114
|
+
exports.MisMenuModule = MisMenuModule;
|
|
115
|
+
|
|
116
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
117
|
+
|
|
118
|
+
})));
|
|
119
|
+
//# sourceMappingURL=mis-crystal-design-system-menu.umd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mis-crystal-design-system-menu.umd.js","sources":["../../../projects/mis-components/menu/menu.directive.ts","../../../projects/mis-components/menu/menu-close.directive.ts","../../../projects/mis-components/menu/menu.module.ts","../../../projects/mis-components/menu/mis-crystal-design-system-menu.ts"],"sourcesContent":["/** @format */\n\nimport { ConnectionPositionPair, Overlay, OverlayConfig, OverlayRef } from \"@angular/cdk/overlay\";\nimport { TemplatePortal } from \"@angular/cdk/portal\";\nimport { Directive, ElementRef, HostListener, Input, TemplateRef, ViewContainerRef } from \"@angular/core\";\nimport { take } from \"rxjs/operators\";\n\n@Directive({\n selector: \"[misMenu]\",\n exportAs: \"misMenu\"\n})\nexport class MenuDirective {\n @Input(\"misMenu\") menu: TemplateRef<ElementRef>;\n @Input() positionX: \"start\" | \"end\" = \"start\";\n @Input() positionY: \"top\" | \"bottom\" = \"bottom\";\n @Input() offsetX = 0;\n @Input() offsetY = 0;\n private overlayRef: OverlayRef;\n\n constructor(private overlay: Overlay, private element: ElementRef, private viewContainerRef: ViewContainerRef) {}\n @HostListener(\"click\", [\"$event\"]) onClick(event) {\n this.menuShow();\n }\n private menuShow() {\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.element)\n .withPositions([\n new ConnectionPositionPair(\n { originX: this.positionX, originY: this.positionY },\n { overlayX: this.positionX, overlayY: this.positionY === \"bottom\" ? \"top\" : \"bottom\" },\n this.offsetX,\n this.offsetY\n ),\n new ConnectionPositionPair({ originX: \"start\", originY: \"bottom\" }, { overlayX: \"start\", overlayY: \"top\" }, this.offsetX, this.offsetY),\n new ConnectionPositionPair({ originX: \"end\", originY: \"top\" }, { overlayX: \"end\", overlayY: \"bottom\" }, this.offsetX, this.offsetY)\n ])\n .withPush(true);\n const config = new OverlayConfig({\n hasBackdrop: true,\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n backdropClass: \"cdk-overlay-transparent-backdrop\"\n });\n this.overlayRef = this.overlay.create(config);\n\n const tempRef = new TemplatePortal(this.menu, this.viewContainerRef);\n this.overlayRef.attach(tempRef);\n this.overlayRef\n .backdropClick()\n .pipe(take(1))\n .subscribe(res => {\n this.close();\n });\n }\n\n close(): void {\n this.overlayRef?.detach();\n this.overlayRef?.dispose();\n }\n}\n","import { Directive, HostListener, Input } from \"@angular/core\";\nimport { MenuDirective } from \"./menu.directive\";\n\n@Directive({\n selector: \"[misMenuClose]\"\n})\nexport class MenuCloseDirective {\n @Input(\"misMenuClose\") menu: MenuDirective;\n constructor() {}\n\n @HostListener(\"click\", []) closeMenu() {\n this.menu.close();\n }\n}\n","/** @format */\n\nimport { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { MenuDirective } from \"./menu.directive\";\nimport { OverlayModule } from \"@angular/cdk/overlay\";\nimport { PortalModule } from \"@angular/cdk/portal\";\nimport { MenuCloseDirective } from \"./menu-close.directive\";\n\n@NgModule({\n declarations: [MenuDirective, MenuCloseDirective],\n imports: [CommonModule, OverlayModule, PortalModule],\n exports: [MenuDirective, MenuCloseDirective]\n})\nexport class MisMenuModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["ConnectionPositionPair","OverlayConfig","TemplatePortal","take","Directive","Overlay","ElementRef","ViewContainerRef","Input","HostListener","NgModule","CommonModule","OverlayModule","PortalModule"],"mappings":";;;;;;IAAA;;QAmBE,uBAAoB,OAAgB,EAAU,OAAmB,EAAU,gBAAkC;YAAzF,YAAO,GAAP,OAAO,CAAS;YAAU,YAAO,GAAP,OAAO,CAAY;YAAU,qBAAgB,GAAhB,gBAAgB,CAAkB;YANpG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E,CAACC,mBAAY,EAAEC,qBAAa,EAAEC,mBAAY,CAAC;oBACpD,OAAO,EAAE,CAAC,aAAa,EAAE,kBAAkB,CAAC;iBAC7C;;;ICbD;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/overlay"),require("@angular/cdk/portal"),require("@angular/core"),require("rxjs/operators"),require("@angular/common")):"function"==typeof define&&define.amd?define("mis-crystal-design-system/menu",["exports","@angular/cdk/overlay","@angular/cdk/portal","@angular/core","rxjs/operators","@angular/common"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self)["mis-crystal-design-system"]=e["mis-crystal-design-system"]||{},e["mis-crystal-design-system"].menu={}),e.ng.cdk.overlay,e.ng.cdk.portal,e.ng.core,e.rxjs.operators,e.ng.common)}(this,(function(e,t,o,i,r,s){"use strict";var n=function(){function e(e,t,o){this.overlay=e,this.element=t,this.viewContainerRef=o,this.positionX="start",this.positionY="bottom",this.offsetX=0,this.offsetY=0}return e.prototype.onClick=function(e){this.menuShow()},e.prototype.menuShow=function(){var e=this,i=this.overlay.position().flexibleConnectedTo(this.element).withPositions([new t.ConnectionPositionPair({originX:this.positionX,originY:this.positionY},{overlayX:this.positionX,overlayY:"bottom"===this.positionY?"top":"bottom"},this.offsetX,this.offsetY),new t.ConnectionPositionPair({originX:"start",originY:"bottom"},{overlayX:"start",overlayY:"top"},this.offsetX,this.offsetY),new t.ConnectionPositionPair({originX:"end",originY:"top"},{overlayX:"end",overlayY:"bottom"},this.offsetX,this.offsetY)]).withPush(!0),s=new t.OverlayConfig({hasBackdrop:!0,positionStrategy:i,scrollStrategy:this.overlay.scrollStrategies.reposition(),backdropClass:"cdk-overlay-transparent-backdrop"});this.overlayRef=this.overlay.create(s);var n=new o.TemplatePortal(this.menu,this.viewContainerRef);this.overlayRef.attach(n),this.overlayRef.backdropClick().pipe(r.take(1)).subscribe((function(t){e.close()}))},e.prototype.close=function(){var e,t;null===(e=this.overlayRef)||void 0===e||e.detach(),null===(t=this.overlayRef)||void 0===t||t.dispose()},e}();n.decorators=[{type:i.Directive,args:[{selector:"[misMenu]",exportAs:"misMenu"}]}],n.ctorParameters=function(){return[{type:t.Overlay},{type:i.ElementRef},{type:i.ViewContainerRef}]},n.propDecorators={menu:[{type:i.Input,args:["misMenu"]}],positionX:[{type:i.Input}],positionY:[{type:i.Input}],offsetX:[{type:i.Input}],offsetY:[{type:i.Input}],onClick:[{type:i.HostListener,args:["click",["$event"]]}]};var a=function(){function e(){}return e.prototype.closeMenu=function(){this.menu.close()},e}();a.decorators=[{type:i.Directive,args:[{selector:"[misMenuClose]"}]}],a.ctorParameters=function(){return[]},a.propDecorators={menu:[{type:i.Input,args:["misMenuClose"]}],closeMenu:[{type:i.HostListener,args:["click",[]]}]};var l=function(){};l.decorators=[{type:i.NgModule,args:[{declarations:[n,a],imports:[s.CommonModule,t.OverlayModule,o.PortalModule],exports:[n,a]}]}],e.MenuCloseDirective=a,e.MenuDirective=n,e.MisMenuModule=l,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
2
|
+
//# sourceMappingURL=mis-crystal-design-system-menu.umd.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../projects/mis-components/menu/menu.directive.ts","../../../projects/mis-components/menu/menu-close.directive.ts","../../../projects/mis-components/menu/menu.module.ts"],"names":["MenuDirective","overlay","element","viewContainerRef","this","positionX","positionY","offsetX","offsetY","prototype","onClick","event","menuShow","_this","positionStrategy","position","flexibleConnectedTo","withPositions","ConnectionPositionPair","originX","originY","overlayX","overlayY","withPush","config","OverlayConfig","hasBackdrop","scrollStrategy","scrollStrategies","reposition","backdropClass","overlayRef","create","tempRef","TemplatePortal","menu","attach","backdropClick","pipe","take","subscribe","res","close","_a","detach","_b","dispose","Directive","args","selector","exportAs","Overlay","ElementRef","ViewContainerRef","Input","HostListener","MenuCloseDirective","closeMenu","NgModule","declarations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KAAK2B,kBAAU,IAAAY,GAAAA,EAAEC,SACF,QAAfC,EAAAzC,KAAK2B,kBAAU,IAAAc,GAAAA,EAAEC,oCAnDpBC,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,YACVC,SAAU,uDAPqBC,EAAAA,eAEbC,EAAAA,kBAA8CC,EAAAA,kDAQ/DC,EAAAA,MAAKN,KAAA,CAAC,8BACNM,EAAAA,yBACAA,EAAAA,uBACAA,EAAAA,uBACAA,EAAAA,uBAIAC,EAAAA,aAAYP,KAAA,CAAC,QAAS,CAAC,+BCZxB,SAAAQ,YAE2BA,EAAA/C,UAAAgD,UAAA,WACzBrD,KAAK+B,KAAKO,kCARbK,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,yFAGTK,EAAAA,MAAKN,KAAA,CAAC,mCAGNO,EAAAA,aAAYP,KAAA,CAAC,QAAS,aCIzB,iCALCU,EAAAA,SAAQV,KAAA,CAAC,CACRW,aAAc,CAAC3D,EAAewD,GAC9BI,QAAS,CAACC,EAAAA,aAAcC,EAAAA,cAAeC,EAAAA,cACvCC,QAAS,CAAChE,EAAewD","sourcesContent":["/** @format */\n\nimport { ConnectionPositionPair, Overlay, OverlayConfig, OverlayRef } from \"@angular/cdk/overlay\";\nimport { TemplatePortal } from \"@angular/cdk/portal\";\nimport { Directive, ElementRef, HostListener, Input, TemplateRef, ViewContainerRef } from \"@angular/core\";\nimport { take } from \"rxjs/operators\";\n\n@Directive({\n selector: \"[misMenu]\",\n exportAs: \"misMenu\"\n})\nexport class MenuDirective {\n @Input(\"misMenu\") menu: TemplateRef<ElementRef>;\n @Input() positionX: \"start\" | \"end\" = \"start\";\n @Input() positionY: \"top\" | \"bottom\" = \"bottom\";\n @Input() offsetX = 0;\n @Input() offsetY = 0;\n private overlayRef: OverlayRef;\n\n constructor(private overlay: Overlay, private element: ElementRef, private viewContainerRef: ViewContainerRef) {}\n @HostListener(\"click\", [\"$event\"]) onClick(event) {\n this.menuShow();\n }\n private menuShow() {\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.element)\n .withPositions([\n new ConnectionPositionPair(\n { originX: this.positionX, originY: this.positionY },\n { overlayX: this.positionX, overlayY: this.positionY === \"bottom\" ? \"top\" : \"bottom\" },\n this.offsetX,\n this.offsetY\n ),\n new ConnectionPositionPair({ originX: \"start\", originY: \"bottom\" }, { overlayX: \"start\", overlayY: \"top\" }, this.offsetX, this.offsetY),\n new ConnectionPositionPair({ originX: \"end\", originY: \"top\" }, { overlayX: \"end\", overlayY: \"bottom\" }, this.offsetX, this.offsetY)\n ])\n .withPush(true);\n const config = new OverlayConfig({\n hasBackdrop: true,\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n backdropClass: \"cdk-overlay-transparent-backdrop\"\n });\n this.overlayRef = this.overlay.create(config);\n\n const tempRef = new TemplatePortal(this.menu, this.viewContainerRef);\n this.overlayRef.attach(tempRef);\n this.overlayRef\n .backdropClick()\n .pipe(take(1))\n .subscribe(res => {\n this.close();\n });\n }\n\n close(): void {\n this.overlayRef?.detach();\n this.overlayRef?.dispose();\n }\n}\n","import { Directive, HostListener, Input } from \"@angular/core\";\nimport { MenuDirective } from \"./menu.directive\";\n\n@Directive({\n selector: \"[misMenuClose]\"\n})\nexport class MenuCloseDirective {\n @Input(\"misMenuClose\") menu: MenuDirective;\n constructor() {}\n\n @HostListener(\"click\", []) closeMenu() {\n this.menu.close();\n }\n}\n","/** @format */\n\nimport { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { MenuDirective } from \"./menu.directive\";\nimport { OverlayModule } from \"@angular/cdk/overlay\";\nimport { PortalModule } from \"@angular/cdk/portal\";\nimport { MenuCloseDirective } from \"./menu-close.directive\";\n\n@NgModule({\n declarations: [MenuDirective, MenuCloseDirective],\n imports: [CommonModule, OverlayModule, PortalModule],\n exports: [MenuDirective, MenuCloseDirective]\n})\nexport class MisMenuModule {}\n"]}
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
animations.trigger("slideInOut", [
|
|
43
43
|
animations.transition(":enter", [
|
|
44
44
|
animations.style({ transform: "translateY(-30%)", opacity: 0 }),
|
|
45
|
-
animations.animate("200ms ease-out", animations.style({ transform: "translatey(0%)", opacity: 1 }))
|
|
45
|
+
animations.animate("200ms ease-out", animations.style({ transform: "translatey(0%)", opacity: 1 }))
|
|
46
46
|
]),
|
|
47
|
-
animations.transition(":leave", [animations.animate("200ms ease-out", animations.style({ transform: "translatey(-30%)", opacity: 0 }))])
|
|
48
|
-
])
|
|
47
|
+
animations.transition(":leave", [animations.animate("200ms ease-out", animations.style({ transform: "translatey(-30%)", opacity: 0 }))])
|
|
48
|
+
])
|
|
49
49
|
],
|
|
50
50
|
styles: [".mis-modal-body{display:block;width:100%;height:100%;background-color:transparent;border-radius:12px;box-shadow:0 12px 24px rgba(0,0,0,.12),0 4px 8px rgba(0,0,0,.12);overflow:hidden}"]
|
|
51
51
|
},] }
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
width: width,
|
|
71
71
|
height: height,
|
|
72
72
|
panelClass: "mis-modal",
|
|
73
|
-
backdropClass: "mis-modal-overlay"
|
|
73
|
+
backdropClass: "mis-modal-overlay"
|
|
74
74
|
});
|
|
75
75
|
var overlayRef = this.overlay.create(config);
|
|
76
76
|
var modalRef = new ModalRef(overlayRef);
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
ModalService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ModalService_Factory() { return new ModalService(i0.ɵɵinject(i1.Overlay), i0.ɵɵinject(i0.INJECTOR)); }, token: ModalService, providedIn: "root" });
|
|
113
113
|
ModalService.decorators = [
|
|
114
114
|
{ type: i0.Injectable, args: [{
|
|
115
|
-
providedIn: "root"
|
|
115
|
+
providedIn: "root"
|
|
116
116
|
},] }
|
|
117
117
|
];
|
|
118
118
|
ModalService.ctorParameters = function () { return [
|
|
@@ -126,13 +126,13 @@
|
|
|
126
126
|
ModalModule.forRoot = function () {
|
|
127
127
|
return {
|
|
128
128
|
ngModule: ModalModule,
|
|
129
|
-
providers: [ModalService]
|
|
129
|
+
providers: [ModalService]
|
|
130
130
|
};
|
|
131
131
|
};
|
|
132
132
|
ModalModule.forChild = function () {
|
|
133
133
|
return {
|
|
134
134
|
ngModule: ModalModule,
|
|
135
|
-
providers: [ModalService]
|
|
135
|
+
providers: [ModalService]
|
|
136
136
|
};
|
|
137
137
|
};
|
|
138
138
|
return ModalModule;
|
|
@@ -140,11 +140,7 @@
|
|
|
140
140
|
ModalModule.decorators = [
|
|
141
141
|
{ type: i0.NgModule, args: [{
|
|
142
142
|
declarations: [ModuleWrapperComponent],
|
|
143
|
-
imports: [
|
|
144
|
-
common.CommonModule,
|
|
145
|
-
i1.OverlayModule,
|
|
146
|
-
portal.PortalModule
|
|
147
|
-
],
|
|
143
|
+
imports: [common.CommonModule, i1.OverlayModule, portal.PortalModule],
|
|
148
144
|
entryComponents: [ModuleWrapperComponent]
|
|
149
145
|
},] }
|
|
150
146
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mis-crystal-design-system-modal.umd.js","sources":["../../../projects/mis-components/modal/modal-constants.ts","../../../projects/mis-components/modal/modal-ref.ts","../../../projects/mis-components/modal/module-wrapper/module-wrapper.component.ts","../../../projects/mis-components/modal/modal.service.ts","../../../projects/mis-components/modal/modal.module.ts","../../../projects/mis-components/modal/mis-crystal-design-system-modal.ts"],"sourcesContent":["/** @format */\n\nimport { InjectionToken } from \"@angular/core\";\n\nexport const MODAL_DATA_VAR = new InjectionToken<any>(\"MISModalDataInjectionToken\");\n","/** @format */\n\nimport { OverlayRef } from \"@angular/cdk/overlay\";\nimport { Injectable } from \"@angular/core\";\nimport { Subject } from \"rxjs\";\n\nexport class ModalRef {\n private afterClosed$ = new Subject<unknown>();\n afterClosed = this.afterClosed$.asObservable();\n\n constructor(public overlay: OverlayRef) {}\n\n close(data?: unknown): void {\n this.overlay.detach();\n this.overlay.dispose();\n this.afterClosed$.next(data);\n this.afterClosed$.complete();\n }\n}\n","import { trigger, transition, style, animate } from \"@angular/animations\";\nimport { ComponentPortal, PortalInjector } from \"@angular/cdk/portal\";\nimport { Component, Injector, OnInit, ViewChild, ViewContainerRef } from \"@angular/core\";\nimport { ModalRef } from \"../modal-ref\";\n\n@Component({\n selector: \"mis-module-wrapper\",\n templateUrl: \"./module-wrapper.component.html\",\n styleUrls: [\"./module-wrapper.component.scss\"],\n animations: [\n trigger(\"slideInOut\", [\n transition(\":enter\", [\n style({ transform: \"translateY(-30%)\", opacity: 0 }),\n animate(\"200ms ease-out\", style({ transform: \"translatey(0%)\", opacity: 1 }))
|
|
1
|
+
{"version":3,"file":"mis-crystal-design-system-modal.umd.js","sources":["../../../projects/mis-components/modal/modal-constants.ts","../../../projects/mis-components/modal/modal-ref.ts","../../../projects/mis-components/modal/module-wrapper/module-wrapper.component.ts","../../../projects/mis-components/modal/modal.service.ts","../../../projects/mis-components/modal/modal.module.ts","../../../projects/mis-components/modal/mis-crystal-design-system-modal.ts"],"sourcesContent":["/** @format */\n\nimport { InjectionToken } from \"@angular/core\";\n\nexport const MODAL_DATA_VAR = new InjectionToken<any>(\"MISModalDataInjectionToken\");\n","/** @format */\n\nimport { OverlayRef } from \"@angular/cdk/overlay\";\nimport { Injectable } from \"@angular/core\";\nimport { Subject } from \"rxjs\";\n\nexport class ModalRef {\n private afterClosed$ = new Subject<unknown>();\n afterClosed = this.afterClosed$.asObservable();\n\n constructor(public overlay: OverlayRef) {}\n\n close(data?: unknown): void {\n this.overlay.detach();\n this.overlay.dispose();\n this.afterClosed$.next(data);\n this.afterClosed$.complete();\n }\n}\n","import { trigger, transition, style, animate } from \"@angular/animations\";\nimport { ComponentPortal, PortalInjector } from \"@angular/cdk/portal\";\nimport { Component, Injector, OnInit, ViewChild, ViewContainerRef } from \"@angular/core\";\nimport { ModalRef } from \"../modal-ref\";\n\n@Component({\n selector: \"mis-module-wrapper\",\n templateUrl: \"./module-wrapper.component.html\",\n styleUrls: [\"./module-wrapper.component.scss\"],\n animations: [\n trigger(\"slideInOut\", [\n transition(\":enter\", [\n style({ transform: \"translateY(-30%)\", opacity: 0 }),\n animate(\"200ms ease-out\", style({ transform: \"translatey(0%)\", opacity: 1 }))\n ]),\n transition(\":leave\", [animate(\"200ms ease-out\", style({ transform: \"translatey(-30%)\", opacity: 0 }))])\n ])\n ]\n})\nexport class ModuleWrapperComponent {\n modalPortal: ComponentPortal<any>;\n constructor() {}\n\n @ViewChild(\"place\", { static: false, read: ViewContainerRef }) place: ViewContainerRef;\n\n bindComponent(type: any, injector: PortalInjector) {\n this.initComponent(type, injector);\n }\n\n private initComponent(type: any, injector: PortalInjector) {\n this.modalPortal = new ComponentPortal(type, this.place, injector);\n }\n}\n","import { ComponentType, Overlay, OverlayConfig } from \"@angular/cdk/overlay\";\nimport { ComponentPortal, PortalInjector } from \"@angular/cdk/portal\";\nimport { ComponentRef, Injectable, Injector } from \"@angular/core\";\nimport { MODAL_DATA_VAR } from \"./modal-constants\";\nimport { ModalRef } from \"./modal-ref\";\nimport { ModuleWrapperComponent } from \"./module-wrapper/module-wrapper.component\";\n\ninterface IModalOptions {\n width?: string;\n height?: string;\n top?: string;\n right?: string;\n bottom?: string;\n left?: string;\n closeOnBackdropClick?: boolean;\n}\n@Injectable({\n providedIn: \"root\"\n})\nexport class ModalService {\n private componentInstance: ComponentRef<ModuleWrapperComponent>;\n\n constructor(private overlay: Overlay, private injector: Injector) {}\n\n show<T, D>(component: ComponentType<T>, data?: D, options?: IModalOptions): ModalRef {\n const positionStrategy = this.calculatePosition(options);\n const { width, height } = options || {};\n const config = new OverlayConfig({\n hasBackdrop: true,\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.noop(),\n width: width,\n height,\n panelClass: \"mis-modal\",\n backdropClass: \"mis-modal-overlay\"\n });\n const overlayRef = this.overlay.create(config);\n const modalRef = new ModalRef(overlayRef);\n const injector = this.createInjector(modalRef, this.injector, data);\n const portal = new ComponentPortal(ModuleWrapperComponent, null);\n this.componentInstance = overlayRef.attach(portal);\n if (options?.closeOnBackdropClick) {\n overlayRef.backdropClick().subscribe(() => modalRef.close());\n }\n this.componentInstance.instance.bindComponent(component, injector);\n return modalRef;\n }\n private createInjector<D>(ref: ModalRef, inj: Injector, data?: D): PortalInjector {\n const injectorTokens = new WeakMap();\n injectorTokens.set(ModalRef, ref);\n injectorTokens.set(MODAL_DATA_VAR, data);\n return new PortalInjector(inj, injectorTokens);\n }\n\n private calculatePosition(options: IModalOptions) {\n const position = this.overlay.position().global().centerHorizontally().centerVertically();\n if (options && screen.width > 600) {\n if (options.top) {\n position.top(options.top);\n }\n if (options.left) {\n position.left(options.left);\n }\n if (options.right) {\n position.right(options.right);\n }\n if (options.bottom) {\n position.bottom(options.bottom);\n }\n }\n return position;\n }\n}\n","import { ModuleWithProviders, NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { OverlayModule } from \"@angular/cdk/overlay\";\nimport { PortalModule } from \"@angular/cdk/portal\";\nimport { ModuleWrapperComponent } from \"./module-wrapper/module-wrapper.component\";\nimport { ModalService } from \"./modal.service\";\n\n@NgModule({\n declarations: [ModuleWrapperComponent],\n imports: [CommonModule, OverlayModule, PortalModule],\n entryComponents: [ModuleWrapperComponent]\n})\nexport class ModalModule {\n static forRoot(): ModuleWithProviders<ModalModule> {\n return {\n ngModule: ModalModule,\n providers: [ModalService]\n };\n }\n\n static forChild(): ModuleWithProviders<ModalModule> {\n return {\n ngModule: ModalModule,\n providers: [ModalService]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {ModuleWrapperComponent as ɵa} from './module-wrapper/module-wrapper.component';"],"names":["InjectionToken","Subject","ComponentPortal","Component","trigger","transition","style","animate","ViewChild","ViewContainerRef","OverlayConfig","portal","PortalInjector","Injectable","Overlay","Injector","NgModule","CommonModule","OverlayModule","PortalModule"],"mappings":";;;;;;IAAA;QAIa,cAAc,GAAG,IAAIA,iBAAc,CAAM,4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V,UAAU,EAAE,MAAM;iBACnB;;;gBAlBuBC,UAAO;gBAEIC,WAAQ;;;;QCU3C;;QACS,mBAAO,GAAd;YACE,OAAO;gBACL,QAAQ,EAAE,WAAW;gBACrB,SAAS,EAAE,CAAC,YAAY,CAAC;aAC1B,CAAC;SACH;QAEM,oBAAQ,GAAf;YACE,OAAO;gBACL,QAAQ,EAAE,WAAW;gBACrB,SAAS,EAAE,CAAC,YAAY,CAAC;aAC1B,CAAC;SACH;;;;gBAlBFC,WAAQ,SAAC;oBACR,YAAY,EAAE,CAAC,sBAAsB,CAAC;oBACtC,OAAO,EAAE,CAACC,mBAAY,EAAEC,gBAAa,EAAEC,mBAAY,CAAC;oBACpD,eAAe,EAAE,CAAC,sBAAsB,CAAC;iBAC1C;;;ICXD;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../projects/mis-components/modal/modal-constants.ts","../../../projects/mis-components/modal/modal-ref.ts","../../../projects/mis-components/modal/module-wrapper/module-wrapper.component.ts","../../../projects/mis-components/modal/modal.service.ts","../../../projects/mis-components/modal/modal.module.ts"],"names":["MODAL_DATA_VAR","InjectionToken","ModalRef","overlay","this","afterClosed$","Subject","afterClosed","asObservable","prototype","close","data","detach","dispose","next","complete","ModuleWrapperComponent","bindComponent","type","injector","initComponent","modalPortal","ComponentPortal","place","Component","args","selector","template","animations","trigger","transition","style","transform","opacity","animate","ViewChild","static","read","ViewContainerRef","ModalService","show","component","options","positionStrategy","calculatePosition","_a","width","height","config","OverlayConfig","hasBackdrop","scrollStrategy","scrollStrategies","noop","panelClass","backdropClass","overlayRef","create","modalRef","createInjector","portal","componentInstance","attach","closeOnBackdropClick","backdropClick","subscribe","instance","ref","inj","injectorTokens","WeakMap","set","PortalInjector","position","global","centerHorizontally","centerVertically","screen","top","left","right","bottom","Injectable","providedIn","Overlay","Injector","ModalModule","forRoot","ngModule","providers","forChild","NgModule","declarations","imports","CommonModule","OverlayModule","PortalModule","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P,iBAAgBA,EAChBQ,eAAgB/C,KAAKD,QAAQiD,iBAAiBC,OAC9CP,MAAOA,EACPC,OAAMA,EACNO,WAAY,YACZC,cAAe,sBAEXC,EAAapD,KAAKD,QAAQsD,OAAOT,GACjCU,EAAW,IAAIxD,EAASsD,GACxBrC,EAAWf,KAAKuD,eAAeD,EAAUtD,KAAKe,SAAUR,GACxDiD,EAAS,IAAItC,EAAAA,gBAAgBN,EAAwB,MAM3D,OALAZ,KAAKyD,kBAAoBL,EAAWM,OAAOF,IACvClB,MAAAA,OAAO,EAAPA,EAASqB,uBACXP,EAAWQ,gBAAgBC,WAAU,WAAM,OAAAP,EAAShD,WAEtDN,KAAKyD,kBAAkBK,SAASjD,cAAcwB,EAAWtB,GAClDuC,GAEDnB,EAAA9B,UAAAkD,eAAA,SAAkBQ,EAAeC,EAAezD,GACtD,IAAM0D,EAAiB,IAAIC,QAG3B,OAFAD,EAAeE,IAAIrE,EAAUiE,GAC7BE,EAAeE,IAAIvE,EAAgBW,GAC5B,IAAI6D,EAAAA,eAAeJ,EAAKC,IAGzB9B,EAAA9B,UAAAmC,kBAAA,SAAkBF,GACxB,IAAM+B,EAAWrE,KAAKD,QAAQsE,WAAWC,SAASC,qBAAqBC,mBAevE,OAdIlC,GAAWmC,OAAO/B,MAAQ,MACxBJ,EAAQoC,KACVL,EAASK,IAAIpC,EAAQoC,KAEnBpC,EAAQqC,MACVN,EAASM,KAAKrC,EAAQqC,MAEpBrC,EAAQsC,OACVP,EAASO,MAAMtC,EAAQsC,OAErBtC,EAAQuC,QACVR,EAASQ,OAAOvC,EAAQuC,SAGrBR,qKAtDVS,EAAAA,WAAUzD,KAAA,CAAC,CACV0D,WAAY,oDAjBUC,EAAAA,eAEWC,EAAAA,
|
|
1
|
+
{"version":3,"sources":["../../../projects/mis-components/modal/modal-constants.ts","../../../projects/mis-components/modal/modal-ref.ts","../../../projects/mis-components/modal/module-wrapper/module-wrapper.component.ts","../../../projects/mis-components/modal/modal.service.ts","../../../projects/mis-components/modal/modal.module.ts"],"names":["MODAL_DATA_VAR","InjectionToken","ModalRef","overlay","this","afterClosed$","Subject","afterClosed","asObservable","prototype","close","data","detach","dispose","next","complete","ModuleWrapperComponent","bindComponent","type","injector","initComponent","modalPortal","ComponentPortal","place","Component","args","selector","template","animations","trigger","transition","style","transform","opacity","animate","ViewChild","static","read","ViewContainerRef","ModalService","show","component","options","positionStrategy","calculatePosition","_a","width","height","config","OverlayConfig","hasBackdrop","scrollStrategy","scrollStrategies","noop","panelClass","backdropClass","overlayRef","create","modalRef","createInjector","portal","componentInstance","attach","closeOnBackdropClick","backdropClick","subscribe","instance","ref","inj","injectorTokens","WeakMap","set","PortalInjector","position","global","centerHorizontally","centerVertically","screen","top","left","right","bottom","Injectable","providedIn","Overlay","Injector","ModalModule","forRoot","ngModule","providers","forChild","NgModule","declarations","imports","CommonModule","OverlayModule","PortalModule","entryComponents"],"mappings":"4tBAIaA,EAAiB,IAAIC,EAAAA,eAAoB,2CCMpD,SAAAC,EAAmBC,GAAAC,KAAAD,QAAAA,EAHXC,KAAAC,aAAe,IAAIC,EAAAA,QAC3BF,KAAAG,YAAcH,KAAKC,aAAaG,sBAIhCN,EAAAO,UAAAC,MAAA,SAAMC,GACJP,KAAKD,QAAQS,SACbR,KAAKD,QAAQU,UACbT,KAAKC,aAAaS,KAAKH,GACvBP,KAAKC,aAAaU,8BCKpB,SAAAC,YAIAA,EAAAP,UAAAQ,cAAA,SAAcC,EAAWC,GACvBf,KAAKgB,cAAcF,EAAMC,IAGnBH,EAAAP,UAAAW,cAAA,SAAcF,EAAWC,GAC/Bf,KAAKiB,YAAc,IAAIC,EAAAA,gBAAgBJ,EAAMd,KAAKmB,MAAOJ,6BAzB5DK,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,qBACVC,SAAA,2HAEAC,WAAY,CACVC,EAAAA,QAAQ,aAAc,CACpBC,EAAAA,WAAW,SAAU,CACnBC,EAAAA,MAAM,CAAEC,UAAW,mBAAoBC,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B,UAAAmC,kBAAA,SAAkBF,GACxB,IAAM+B,EAAWrE,KAAKD,QAAQsE,WAAWC,SAASC,qBAAqBC,mBAevE,OAdIlC,GAAWmC,OAAO/B,MAAQ,MACxBJ,EAAQoC,KACVL,EAASK,IAAIpC,EAAQoC,KAEnBpC,EAAQqC,MACVN,EAASM,KAAKrC,EAAQqC,MAEpBrC,EAAQsC,OACVP,EAASO,MAAMtC,EAAQsC,OAErBtC,EAAQuC,QACVR,EAASQ,OAAOvC,EAAQuC,SAGrBR,qKAtDVS,EAAAA,WAAUzD,KAAA,CAAC,CACV0D,WAAY,oDAjBUC,EAAAA,eAEWC,EAAAA,6BCUnC,SAAAC,YACSA,EAAAC,QAAP,WACE,MAAO,CACLC,SAAUF,EACVG,UAAW,CAAClD,KAIT+C,EAAAI,SAAP,WACE,MAAO,CACLF,SAAUF,EACVG,UAAW,CAAClD,8BAhBjBoD,EAAAA,SAAQlE,KAAA,CAAC,CACRmE,aAAc,CAAC5E,GACf6E,QAAS,CAACC,EAAAA,aAAcC,EAAAA,cAAeC,EAAAA,cACvCC,gBAAiB,CAACjF","sourcesContent":["/** @format */\n\nimport { InjectionToken } from \"@angular/core\";\n\nexport const MODAL_DATA_VAR = new InjectionToken<any>(\"MISModalDataInjectionToken\");\n","/** @format */\n\nimport { OverlayRef } from \"@angular/cdk/overlay\";\nimport { Injectable } from \"@angular/core\";\nimport { Subject } from \"rxjs\";\n\nexport class ModalRef {\n private afterClosed$ = new Subject<unknown>();\n afterClosed = this.afterClosed$.asObservable();\n\n constructor(public overlay: OverlayRef) {}\n\n close(data?: unknown): void {\n this.overlay.detach();\n this.overlay.dispose();\n this.afterClosed$.next(data);\n this.afterClosed$.complete();\n }\n}\n","import { trigger, transition, style, animate } from \"@angular/animations\";\nimport { ComponentPortal, PortalInjector } from \"@angular/cdk/portal\";\nimport { Component, Injector, OnInit, ViewChild, ViewContainerRef } from \"@angular/core\";\nimport { ModalRef } from \"../modal-ref\";\n\n@Component({\n selector: \"mis-module-wrapper\",\n templateUrl: \"./module-wrapper.component.html\",\n styleUrls: [\"./module-wrapper.component.scss\"],\n animations: [\n trigger(\"slideInOut\", [\n transition(\":enter\", [\n style({ transform: \"translateY(-30%)\", opacity: 0 }),\n animate(\"200ms ease-out\", style({ transform: \"translatey(0%)\", opacity: 1 }))\n ]),\n transition(\":leave\", [animate(\"200ms ease-out\", style({ transform: \"translatey(-30%)\", opacity: 0 }))])\n ])\n ]\n})\nexport class ModuleWrapperComponent {\n modalPortal: ComponentPortal<any>;\n constructor() {}\n\n @ViewChild(\"place\", { static: false, read: ViewContainerRef }) place: ViewContainerRef;\n\n bindComponent(type: any, injector: PortalInjector) {\n this.initComponent(type, injector);\n }\n\n private initComponent(type: any, injector: PortalInjector) {\n this.modalPortal = new ComponentPortal(type, this.place, injector);\n }\n}\n","import { ComponentType, Overlay, OverlayConfig } from \"@angular/cdk/overlay\";\nimport { ComponentPortal, PortalInjector } from \"@angular/cdk/portal\";\nimport { ComponentRef, Injectable, Injector } from \"@angular/core\";\nimport { MODAL_DATA_VAR } from \"./modal-constants\";\nimport { ModalRef } from \"./modal-ref\";\nimport { ModuleWrapperComponent } from \"./module-wrapper/module-wrapper.component\";\n\ninterface IModalOptions {\n width?: string;\n height?: string;\n top?: string;\n right?: string;\n bottom?: string;\n left?: string;\n closeOnBackdropClick?: boolean;\n}\n@Injectable({\n providedIn: \"root\"\n})\nexport class ModalService {\n private componentInstance: ComponentRef<ModuleWrapperComponent>;\n\n constructor(private overlay: Overlay, private injector: Injector) {}\n\n show<T, D>(component: ComponentType<T>, data?: D, options?: IModalOptions): ModalRef {\n const positionStrategy = this.calculatePosition(options);\n const { width, height } = options || {};\n const config = new OverlayConfig({\n hasBackdrop: true,\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.noop(),\n width: width,\n height,\n panelClass: \"mis-modal\",\n backdropClass: \"mis-modal-overlay\"\n });\n const overlayRef = this.overlay.create(config);\n const modalRef = new ModalRef(overlayRef);\n const injector = this.createInjector(modalRef, this.injector, data);\n const portal = new ComponentPortal(ModuleWrapperComponent, null);\n this.componentInstance = overlayRef.attach(portal);\n if (options?.closeOnBackdropClick) {\n overlayRef.backdropClick().subscribe(() => modalRef.close());\n }\n this.componentInstance.instance.bindComponent(component, injector);\n return modalRef;\n }\n private createInjector<D>(ref: ModalRef, inj: Injector, data?: D): PortalInjector {\n const injectorTokens = new WeakMap();\n injectorTokens.set(ModalRef, ref);\n injectorTokens.set(MODAL_DATA_VAR, data);\n return new PortalInjector(inj, injectorTokens);\n }\n\n private calculatePosition(options: IModalOptions) {\n const position = this.overlay.position().global().centerHorizontally().centerVertically();\n if (options && screen.width > 600) {\n if (options.top) {\n position.top(options.top);\n }\n if (options.left) {\n position.left(options.left);\n }\n if (options.right) {\n position.right(options.right);\n }\n if (options.bottom) {\n position.bottom(options.bottom);\n }\n }\n return position;\n }\n}\n","import { ModuleWithProviders, NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { OverlayModule } from \"@angular/cdk/overlay\";\nimport { PortalModule } from \"@angular/cdk/portal\";\nimport { ModuleWrapperComponent } from \"./module-wrapper/module-wrapper.component\";\nimport { ModalService } from \"./modal.service\";\n\n@NgModule({\n declarations: [ModuleWrapperComponent],\n imports: [CommonModule, OverlayModule, PortalModule],\n entryComponents: [ModuleWrapperComponent]\n})\nexport class ModalModule {\n static forRoot(): ModuleWithProviders<ModalModule> {\n return {\n ngModule: ModalModule,\n providers: [ModalService]\n };\n }\n\n static forChild(): ModuleWithProviders<ModalModule> {\n return {\n ngModule: ModalModule,\n providers: [ModalService]\n };\n }\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('mis-crystal-design-system/checkbox'), require('mis-crystal-design-system/button')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('mis-crystal-design-system/multi-select-dropdown', ['exports', '@angular/core', '@angular/common', '@angular/forms', 'mis-crystal-design-system/checkbox', 'mis-crystal-design-system/button'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['mis-crystal-design-system'] = global['mis-crystal-design-system'] || {}, global['mis-crystal-design-system']['multi-select-dropdown'] = {}), global.ng.core, global.ng.common, global.ng.forms, global['mis-crystal-design-system'].checkbox, global['mis-crystal-design-system'].button));
|
|
5
|
-
}(this, (function (exports, core, common, forms, checkbox, button) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/cdk/portal'), require('@angular/cdk/overlay'), require('@angular/common'), require('@angular/forms'), require('mis-crystal-design-system/checkbox'), require('mis-crystal-design-system/button')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('mis-crystal-design-system/multi-select-dropdown', ['exports', '@angular/core', '@angular/cdk/portal', '@angular/cdk/overlay', '@angular/common', '@angular/forms', 'mis-crystal-design-system/checkbox', 'mis-crystal-design-system/button'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['mis-crystal-design-system'] = global['mis-crystal-design-system'] || {}, global['mis-crystal-design-system']['multi-select-dropdown'] = {}), global.ng.core, global.ng.cdk.portal, global.ng.cdk.overlay, global.ng.common, global.ng.forms, global['mis-crystal-design-system'].checkbox, global['mis-crystal-design-system'].button));
|
|
5
|
+
}(this, (function (exports, core, portal, overlay, common, forms, checkbox, button) { 'use strict';
|
|
6
6
|
|
|
7
7
|
/*! *****************************************************************************
|
|
8
8
|
Copyright (c) Microsoft Corporation.
|
|
@@ -323,8 +323,10 @@
|
|
|
323
323
|
}
|
|
324
324
|
|
|
325
325
|
var MultiSelectDropdownComponent = /** @class */ (function () {
|
|
326
|
-
function MultiSelectDropdownComponent(eRef) {
|
|
326
|
+
function MultiSelectDropdownComponent(eRef, overlay, viewContainerRef) {
|
|
327
327
|
this.eRef = eRef;
|
|
328
|
+
this.overlay = overlay;
|
|
329
|
+
this.viewContainerRef = viewContainerRef;
|
|
328
330
|
this.searchInput = "";
|
|
329
331
|
this.isOpen = false;
|
|
330
332
|
this.localSelectedItems = [];
|
|
@@ -343,7 +345,7 @@
|
|
|
343
345
|
this.showSelectedCount = false;
|
|
344
346
|
this.noDataMessage = "No Data";
|
|
345
347
|
this.options = {
|
|
346
|
-
sortLabels: true
|
|
348
|
+
sortLabels: true
|
|
347
349
|
};
|
|
348
350
|
this.hideApplyButton = false;
|
|
349
351
|
this.onChange = new core.EventEmitter();
|
|
@@ -364,19 +366,18 @@
|
|
|
364
366
|
enumerable: false,
|
|
365
367
|
configurable: true
|
|
366
368
|
});
|
|
369
|
+
MultiSelectDropdownComponent.prototype.ngOnInit = function () { };
|
|
367
370
|
MultiSelectDropdownComponent.prototype.clickout = function (event) {
|
|
368
371
|
var isClickedOutside = !this.eRef.nativeElement.contains(event.target);
|
|
369
372
|
if (isClickedOutside) {
|
|
370
373
|
this.onCancel();
|
|
371
374
|
}
|
|
372
375
|
};
|
|
373
|
-
MultiSelectDropdownComponent.prototype.ngOnInit = function () { };
|
|
374
376
|
MultiSelectDropdownComponent.prototype.handlerSetLocalSelectedItems = function (values) {
|
|
375
377
|
var _this = this;
|
|
376
378
|
this.localSelectedItems = values;
|
|
377
379
|
this.localData = this.localData.map(function (item) {
|
|
378
|
-
if (item.value === _this.SELECT_ALL_ENUM &&
|
|
379
|
-
_this.localData.every(function (a) { return a.checked; })) {
|
|
380
|
+
if (item.value === _this.SELECT_ALL_ENUM && _this.localData.every(function (a) { return a.checked; })) {
|
|
380
381
|
return Object.assign(Object.assign({}, item), { checked: true });
|
|
381
382
|
}
|
|
382
383
|
if (values.some(function (base) { return base.value === item.value; })) {
|
|
@@ -402,6 +403,42 @@
|
|
|
402
403
|
this.handlerSetLocalSelectedItems(this.localSelectedItems);
|
|
403
404
|
this.localData = this.formatValues(this.localData);
|
|
404
405
|
}
|
|
406
|
+
if (this.isOpen)
|
|
407
|
+
this.openDropdown(this.popupContainer, this.selectElement.nativeElement);
|
|
408
|
+
else
|
|
409
|
+
this.onCancel();
|
|
410
|
+
};
|
|
411
|
+
MultiSelectDropdownComponent.prototype.openDropdown = function (template, origin) {
|
|
412
|
+
var _this = this;
|
|
413
|
+
var positionsBottom = [
|
|
414
|
+
new overlay.ConnectionPositionPair({ originX: "start", originY: "bottom" }, { overlayX: "start", overlayY: "top" }, 0, 4),
|
|
415
|
+
new overlay.ConnectionPositionPair({ originX: "end", originY: "bottom" }, { overlayX: "end", overlayY: "top" }, 0, 4)
|
|
416
|
+
];
|
|
417
|
+
var positionsTop = [
|
|
418
|
+
new overlay.ConnectionPositionPair({ originX: "start", originY: "top" }, { overlayX: "start", overlayY: "bottom" }, 0, -4),
|
|
419
|
+
new overlay.ConnectionPositionPair({ originX: "end", originY: "top" }, { overlayX: "end", overlayY: "bottom" }, 0, -4)
|
|
420
|
+
];
|
|
421
|
+
var positionStrategy = this.overlay
|
|
422
|
+
.position()
|
|
423
|
+
.flexibleConnectedTo(origin)
|
|
424
|
+
.withPositions(__spread((this.dropdownListPosition === "Right" ? positionsBottom.reverse() : positionsBottom), (this.dropdownListPosition === "Right" ? positionsTop.reverse() : positionsTop)))
|
|
425
|
+
.withPush(true);
|
|
426
|
+
var configs = new overlay.OverlayConfig({
|
|
427
|
+
hasBackdrop: true,
|
|
428
|
+
backdropClass: "cdk-overlay-transparent-backdrop",
|
|
429
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
430
|
+
positionStrategy: positionStrategy,
|
|
431
|
+
width: origin.clientWidth
|
|
432
|
+
});
|
|
433
|
+
this.overlayRef = this.overlay.create(configs);
|
|
434
|
+
if (this.dropdownListWidth)
|
|
435
|
+
this.overlayRef.updateSize({ width: this.dropdownListWidth });
|
|
436
|
+
if (this.dropdownListHeight)
|
|
437
|
+
this.overlayRef.updateSize({ height: this.dropdownListHeight });
|
|
438
|
+
this.overlayRef.attach(new portal.TemplatePortal(template, this.viewContainerRef));
|
|
439
|
+
this.overlayRef.backdropClick().subscribe(function (res) {
|
|
440
|
+
_this.onCancel();
|
|
441
|
+
});
|
|
405
442
|
};
|
|
406
443
|
MultiSelectDropdownComponent.prototype.filterByValue = function (array, string) {
|
|
407
444
|
return array.filter(function (o) { return o.label.toLowerCase().includes(string.toLowerCase()); });
|
|
@@ -422,19 +459,17 @@
|
|
|
422
459
|
if (this.options.sortLabels) {
|
|
423
460
|
var checkedValues = array
|
|
424
461
|
.filter(function (a) { return a.checked; })
|
|
425
|
-
.sort(function (a, b) { return a.label > b.label ? 1 : b.label > a.label ? -1 : 0; });
|
|
462
|
+
.sort(function (a, b) { return (a.label > b.label ? 1 : b.label > a.label ? -1 : 0); });
|
|
426
463
|
var unCheckedValues = array
|
|
427
464
|
.filter(function (a) { return !a.checked; })
|
|
428
|
-
.sort(function (a, b) { return a.label > b.label ? 1 : b.label > a.label ? -1 : 0; });
|
|
465
|
+
.sort(function (a, b) { return (a.label > b.label ? 1 : b.label > a.label ? -1 : 0); });
|
|
429
466
|
sortedArray = __spread(checkedValues, unCheckedValues).filter(function (t) { return t.value !== _this.SELECT_ALL_ENUM; });
|
|
430
467
|
}
|
|
431
|
-
if (!sortedArray.some(function (option) { return option.value === _this.SELECT_ALL_ENUM; }) &&
|
|
432
|
-
this.enableSelectAll &&
|
|
433
|
-
sortedArray.length > 0) {
|
|
468
|
+
if (!sortedArray.some(function (option) { return option.value === _this.SELECT_ALL_ENUM; }) && this.enableSelectAll && sortedArray.length > 0) {
|
|
434
469
|
sortedArray.unshift({
|
|
435
470
|
label: "Select all",
|
|
436
471
|
value: this.SELECT_ALL_ENUM,
|
|
437
|
-
checked: sortedArray.every(function (y) { return y.checked; })
|
|
472
|
+
checked: sortedArray.every(function (y) { return y.checked; })
|
|
438
473
|
});
|
|
439
474
|
}
|
|
440
475
|
return sortedArray;
|
|
@@ -464,10 +499,7 @@
|
|
|
464
499
|
}
|
|
465
500
|
return a;
|
|
466
501
|
}));
|
|
467
|
-
if (this.enableSelectAll &&
|
|
468
|
-
this.localData
|
|
469
|
-
.filter(function (r) { return r.value !== _this.SELECT_ALL_ENUM; })
|
|
470
|
-
.every(function (t) { return t.checked; })) {
|
|
502
|
+
if (this.enableSelectAll && this.localData.filter(function (r) { return r.value !== _this.SELECT_ALL_ENUM; }).every(function (t) { return t.checked; })) {
|
|
471
503
|
this.localData = __spread(this.localData.map(function (a) {
|
|
472
504
|
if (a.value === _this.SELECT_ALL_ENUM) {
|
|
473
505
|
return Object.assign(Object.assign({}, a), { checked: true });
|
|
@@ -505,6 +537,7 @@
|
|
|
505
537
|
};
|
|
506
538
|
MultiSelectDropdownComponent.prototype.onCancel = function () {
|
|
507
539
|
var _this = this;
|
|
540
|
+
var _a;
|
|
508
541
|
this.isSearchInputFocused = false;
|
|
509
542
|
this.localData = this.localData.map(function (a) {
|
|
510
543
|
if (_this.localSelectedItems.some(function (b) { return b.value === a.value && String(b.checked) !== String(a.checked); })) {
|
|
@@ -516,18 +549,22 @@
|
|
|
516
549
|
});
|
|
517
550
|
this.isOpen = false;
|
|
518
551
|
this.searchInput = "";
|
|
552
|
+
(_a = this.overlayRef) === null || _a === void 0 ? void 0 : _a.detach();
|
|
553
|
+
this.searchInput = "";
|
|
519
554
|
};
|
|
520
555
|
return MultiSelectDropdownComponent;
|
|
521
556
|
}());
|
|
522
557
|
MultiSelectDropdownComponent.decorators = [
|
|
523
558
|
{ type: core.Component, args: [{
|
|
524
559
|
selector: "mis-multi-select-dropdown",
|
|
525
|
-
template: "<div
|
|
526
|
-
styles: [".container{position:relative;display:flex;justify-content:center;align-items:center;flex-wrap:wrap;height:32px;width:256px;font-family:Lato,sans-serif!important}.container .dropdown{height:inherit;border:1px solid #e0e0e0;border-radius:6px;background-color:#fff;cursor:pointer;display:flex;justify-content:space-between;align-items:center;width:100%;padding:0 12px;overflow:hidden}.container .dropdown:hover{background-color:#f5f7fc}.container .dropdown .label{display:flex;justify-content:flex-start;align-items:center;width:calc(100% - 32px)}.container .dropdown .label,.container .dropdown .label .text{font-style:normal;font-weight:400;font-size:14px;line-height:20px;letter-spacing:.2px;color:#181f33}.container .dropdown .label .text{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.container .dropdown .label .count{background-color:#e0e0e0;border-radius:50%;padding:2px 7px;margin:0 0 0 8px;font-style:normal;font-weight:400;font-size:14px;line-height:20px;text-align:center;letter-spacing:.2px;color:#181f33}.container .dropdown .handle{width:24px;height:24px;transition:.3s;position:absolute;right:12px;border-radius:50%;overflow:hidden}.
|
|
560
|
+
template: "<div\n class=\"container\"\n [ngStyle]=\"{\n height: height.length > 0 ? height : '',\n width: width.length > 0 ? width : ''\n }\"\n>\n <div\n class=\"dropdown\"\n #select\n tabindex=\"0\"\n (keyup.enter)=\"toggleDropdown()\"\n (click)=\"toggleDropdown()\"\n [ngStyle]=\"{ background: isOpen ? '#E6EBF7' : '' }\"\n >\n <div class=\"label\">\n <p class=\"text\">{{ label }}</p>\n <p *ngIf=\"showSelectedCount && localSelectedItems?.length > 0\" class=\"count\">\n {{ localSelectedItems?.length }}\n </p>\n </div>\n <svg\n class=\"handle\"\n [ngStyle]=\"{ transform: isOpen ? 'rotate(180deg)' : 'rotate(0deg)' }\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M13.825 7.15845L10 10.9751L6.175 7.15845L5 8.33345L10 13.3334L15 8.33345L13.825 7.15845Z\"\n fill=\"#181F33\"\n />\n </svg>\n </div>\n</div>\n<ng-template #popupContainer>\n <div\n class=\"popup-container\"\n [ngStyle]=\"{\n height: dropdownListHeight,\n width: dropdownListWidth\n }\"\n [ngClass]=\"{\n 'position-left': dropdownListPosition === 'Left',\n 'position-right': dropdownListPosition === 'Right'\n }\"\n >\n <div *ngIf=\"searchEnabled\" class=\"search-container\">\n <svg\n *ngIf=\"!isSearchInputFocused\"\n class=\"search-icon\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M4.21508 11.1456C4.21508 7.3179 7.33722 4.21165 11.1926 4.21165C15.048 4.21165 18.1702 7.3179 18.1702 11.1456C18.1702 12.6931 17.6599 14.1226 16.7972 15.2767L15.3685 16.7013C14.2044 17.5668 12.759 18.0796 11.1926 18.0796C7.33722 18.0796 4.21508 14.9734 4.21508 11.1456ZM15.9421 17.7835C14.6021 18.7329 12.9627 19.2913 11.1926 19.2913C6.66977 19.2913 3 15.6461 3 11.1456C3 6.64512 6.66977 3 11.1926 3C15.7155 3 19.3852 6.64512 19.3852 11.1456C19.3852 12.9371 18.8037 14.5931 17.8184 15.9375L19.8361 17.4048C20.6705 17.912 21.7554 18.6543 20.2454 20.215C18.7353 21.7756 18.0099 20.6663 17.4991 19.8364L15.9421 17.7835Z\"\n fill=\"#6A737D\"\n />\n </svg>\n <input\n [ngModel]=\"searchInput\"\n [ngStyle]=\"{\n paddingLeft: isSearchInputFocused ? '12px' : '45px',\n border: isSearchInputFocused ? '1px solid #0937B2' : '1px solid #e0e0e0',\n paddingRight: isSearchInputFocused ? '45px' : '10px'\n }\"\n (ngModelChange)=\"searchInputOnChange($event)\"\n [placeholder]=\"isSearchInputFocused ? '' : 'Search Keyword'\"\n (focus)=\"searchInputFocused(true)\"\n class=\"search-input\"\n />\n <svg\n *ngIf=\"isSearchInputFocused\"\n class=\"cancel-icon\"\n (click)=\"searchInputCanceled($event)\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M8.87446 7.32144C8.44588 6.89285 7.751 6.89285 7.32242 7.32144C6.89383 7.75002 6.89383 8.4449 7.32242 8.87349L10.4488 11.9999L7.32357 15.1252C6.89498 15.5538 6.89498 16.2486 7.32357 16.6772C7.75215 17.1058 8.44703 17.1058 8.87561 16.6772L12.0009 13.552L15.1261 16.6772C15.5547 17.1058 16.2496 17.1058 16.6781 16.6772C17.1067 16.2486 17.1067 15.5537 16.6781 15.1251L13.5529 11.9999L16.6793 8.87354C17.1079 8.44496 17.1079 7.75008 16.6793 7.3215C16.2507 6.89291 15.5558 6.89291 15.1273 7.3215L12.0009 10.4479L8.87446 7.32144Z\"\n fill=\"#6A737D\"\n />\n </svg>\n </div>\n <div class=\"items\">\n <div\n class=\"item\"\n tabindex=\"0\"\n (keyup.enter)=\"toggleSelectedItems($event, item)\"\n (click)=\"toggleSelectedItems($event, item)\"\n *ngFor=\"let item of searchInput ? searchData : localData\"\n >\n <div class=\"checkbox-container-wrapper\">\n <div class=\"checkbox-container\">\n <mis-checkbox [checked]=\"item.checked\" tabindex=\"-1\"></mis-checkbox>\n </div>\n <p class=\"label\">\n {{ item.label }}\n </p>\n </div>\n <div class=\"icon-container\" *ngIf=\"item.icon\">\n <img class=\"icon\" [src]=\"item.icon\" alt=\"no img\" />\n </div>\n </div>\n <div class=\"noData\" *ngIf=\"(searchInput ? searchData : localData).length === 0\">\n {{ searchInput === \"\" ? noDataMessage : \"No results\" }}\n </div>\n </div>\n <div *ngIf=\"localData.length !== 0 && !hideApplyButton\" class=\"actions-container\">\n <div style=\"width: calc(50% - 4px)\">\n <mis-button [name]=\"'Reset'\" [type]=\"'Text'\" [width]=\"'100%'\" (click)=\"onReset()\"></mis-button>\n </div>\n <div style=\"width: calc(50% - 4px)\">\n <mis-button [name]=\"'Apply'\" [type]=\"'Solid'\" [width]=\"'100%'\" (click)=\"applyFilters()\"></mis-button>\n </div>\n </div>\n </div>\n</ng-template>\n",
|
|
561
|
+
styles: [".container{position:relative;display:flex;justify-content:center;align-items:center;flex-wrap:wrap;height:32px;width:256px;font-family:Lato,sans-serif!important}.container .dropdown{height:inherit;border:1px solid #e0e0e0;border-radius:6px;background-color:#fff;cursor:pointer;display:flex;justify-content:space-between;align-items:center;width:100%;padding:0 12px;overflow:hidden}.container .dropdown:focus-visible,.container .dropdown:hover{background-color:#f5f7fc;outline:none}.container .dropdown .label{display:flex;justify-content:flex-start;align-items:center;width:calc(100% - 32px)}.container .dropdown .label,.container .dropdown .label .text{font-style:normal;font-weight:400;font-size:14px;line-height:20px;letter-spacing:.2px;color:#181f33}.container .dropdown .label .text{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.container .dropdown .label .count{background-color:#e0e0e0;border-radius:50%;padding:2px 7px;margin:0 0 0 8px;font-style:normal;font-weight:400;font-size:14px;line-height:20px;text-align:center;letter-spacing:.2px;color:#181f33}.container .dropdown .handle{width:24px;height:24px;transition:.3s;position:absolute;right:12px;border-radius:50%;overflow:hidden}.popup-container{width:100%;max-height:340px;padding-bottom:0;border:1px solid #e0e0e0;border-radius:8px;background-color:#fff;box-shadow:0 12px 24px 0 rgba(0,0,0,.12);display:flex;flex-direction:column;overflow:hidden;justify-content:space-between}.popup-container::-webkit-scrollbar{width:0;height:0}.popup-container .search-container{position:relative;box-sizing:border-box;padding:8px}.popup-container .search-container .search-icon{position:absolute;width:24px;height:24px;top:50%;transform:translateY(-50%);left:18px;z-index:1}.popup-container .search-container .search-input{height:40px;width:100%;padding:12px;border:1px solid #e0e0e0;box-sizing:border-box;border-radius:8px;outline:none;caret-color:#0937b2;font-style:normal;font-weight:400;font-size:12px;line-height:18px;display:flex;align-items:center;letter-spacing:.2px;color:#181f33}.popup-container .search-container .cancel-icon{position:absolute;cursor:pointer;width:24px;height:24px;top:50%;transform:translateY(-50%);right:18px;z-index:1}.popup-container .items{padding:8px 0 8px 8px;overflow-y:scroll}.popup-container .items::-webkit-scrollbar{width:5px;height:0}.popup-container .items::-webkit-scrollbar-thumb{background:#9aa7b4;border-radius:10px}.popup-container .items .noData{display:flex;justify-content:center;align-items:center;font-style:normal;font-weight:400;font-size:14px;line-height:20px;letter-spacing:.2px;color:#181f33}.popup-container .items .item{cursor:pointer;display:flex;justify-content:flex-start;align-items:center;padding:8px 12px;border-radius:6px;height:auto}.popup-container .items .item:focus-visible,.popup-container .items .item:hover{background-color:#f5f7fc;outline:none}.popup-container .items .item .checkbox-container-wrapper{display:flex;justify-content:flex-start;align-items:center;width:90%}.popup-container .items .item .checkbox-container-wrapper .checkbox-container{display:block;position:relative;cursor:pointer;font-size:22px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.popup-container .items .item .checkbox-container-wrapper .checkbox-container input{position:absolute;opacity:0;cursor:pointer;height:0;width:0}.popup-container .items .item .checkbox-container-wrapper .checkbox-container input:checked~.checkmark:after{display:block}.popup-container .items .item .checkbox-container-wrapper .checkbox-container .checkmark{position:absolute;top:-8px;left:0;height:15px;width:15px;border-radius:4px;background-color:#0079f1;border:1px solid #6a737d}.popup-container .items .item .checkbox-container-wrapper .checkbox-container .checkmark:after{content:\"\";position:absolute;display:none;left:5px;top:2px;width:3px;height:6px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg)}.popup-container .items .item .checkbox-container-wrapper .label{margin:0 0 0 8px;line-height:20px;font-size:14px;font-style:normal;font-weight:400;letter-spacing:.2;text-overflow:ellipsis;overflow:hidden}.popup-container .items .item .icon-container{width:10%;display:flex;justify-content:flex-end}.popup-container .items .item .icon-container .icon{width:20px;height:20px}.popup-container .actions-container{display:flex;justify-content:space-between;bottom:0;align-items:center;position:-webkit-sticky;position:sticky;padding:16px;background-color:#fff;border-top:1px solid #e0e0e0}.popup-container .actions-container .cancel{cursor:pointer;padding:10px 32px;text-align:center;font-size:16px;line-height:24px;border-radius:8px}.popup-container .actions-container .cancel:hover{background:rgba(9,55,178,.04)}.popup-container .actions-container .apply{cursor:pointer;padding:10px 32px;text-align:center;color:#fff;font-size:16px;line-height:24px;background:#0937b2;border-radius:8px}"]
|
|
527
562
|
},] }
|
|
528
563
|
];
|
|
529
564
|
MultiSelectDropdownComponent.ctorParameters = function () { return [
|
|
530
|
-
{ type: core.ElementRef }
|
|
565
|
+
{ type: core.ElementRef },
|
|
566
|
+
{ type: overlay.Overlay },
|
|
567
|
+
{ type: core.ViewContainerRef }
|
|
531
568
|
]; };
|
|
532
569
|
MultiSelectDropdownComponent.propDecorators = {
|
|
533
570
|
data: [{ type: core.Input }],
|
|
@@ -545,6 +582,8 @@
|
|
|
545
582
|
selectedItems: [{ type: core.Input }],
|
|
546
583
|
hideApplyButton: [{ type: core.Input }],
|
|
547
584
|
onChange: [{ type: core.Output }],
|
|
585
|
+
selectElement: [{ type: core.ViewChild, args: ["select", { static: false },] }],
|
|
586
|
+
popupContainer: [{ type: core.ViewChild, args: ["popupContainer", { static: false },] }],
|
|
548
587
|
clickout: [{ type: core.HostListener, args: ["document:click", ["$event"],] }]
|
|
549
588
|
};
|
|
550
589
|
|