ngwr 2.2.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -7
- package/alert/alert-type.d.ts +7 -0
- package/alert/alert.component.d.ts +21 -0
- package/alert/alert.module.d.ts +7 -0
- package/alert/index.d.ts +5 -0
- package/alert/public-api.d.ts +9 -0
- package/alert/styles/_index.scss +58 -0
- package/alert/styles/theming.scss +26 -0
- package/alert/styles/vars.scss +11 -0
- package/avatar/avatar.component.d.ts +27 -0
- package/avatar/avatar.module.d.ts +7 -0
- package/avatar/index.d.ts +5 -0
- package/avatar/public-api.d.ts +8 -0
- package/avatar/styles/_index.scss +39 -0
- package/button/button-group.component.d.ts +12 -0
- package/button/button.component.d.ts +26 -58
- package/button/button.module.d.ts +2 -1
- package/button/index.d.ts +5 -2
- package/button/public-api.d.ts +9 -0
- package/button/styles/_index.scss +187 -0
- package/button/styles/vars.scss +13 -0
- package/{core/abstract/base.d.ts → cdk/base.directive.d.ts} +7 -1
- package/cdk/index.d.ts +5 -0
- package/cdk/public-api.d.ts +7 -0
- package/cdk/rxjs/index.d.ts +5 -0
- package/cdk/rxjs/is-array.d.ts +8 -0
- package/cdk/rxjs/is-defined.d.ts +8 -0
- package/cdk/rxjs/is-not-empty-array.d.ts +8 -0
- package/cdk/rxjs/is-observable.d.ts +9 -0
- package/cdk/rxjs/public-api.d.ts +10 -0
- package/cdk/types/index.d.ts +5 -0
- package/cdk/types/maybe.d.ts +7 -0
- package/cdk/types/public-api.d.ts +9 -0
- package/cdk/types/safe-any.d.ts +7 -0
- package/{core/color/color.d.ts → cdk/types/theme-color.d.ts} +6 -0
- package/cdk/utils/generate-random-id.d.ts +12 -0
- package/cdk/utils/index.d.ts +5 -0
- package/cdk/utils/public-api.d.ts +7 -0
- package/checkbox/checkbox.component.d.ts +24 -45
- package/checkbox/checkbox.module.d.ts +1 -1
- package/checkbox/index.d.ts +5 -2
- package/checkbox/public-api.d.ts +8 -0
- package/checkbox/styles/_index.scss +86 -0
- package/checkbox/styles/vars.scss +16 -0
- package/dialog/dialog-animations.d.ts +7 -1
- package/dialog/{dialog-base.d.ts → dialog-base.directive.d.ts} +13 -7
- package/dialog/dialog-close.directive.d.ts +9 -0
- package/dialog/dialog-content.directive.d.ts +6 -0
- package/dialog/dialog-data.token.d.ts +8 -0
- package/dialog/dialog-footer.directive.d.ts +8 -0
- package/dialog/dialog-options.d.ts +19 -0
- package/dialog/dialog-ref.d.ts +19 -13
- package/dialog/dialog-title.directive.d.ts +6 -0
- package/dialog/dialog.component.d.ts +28 -0
- package/dialog/dialog.module.d.ts +11 -0
- package/dialog/dialog.service.d.ts +28 -0
- package/dialog/index.d.ts +5 -9
- package/dialog/public-api.d.ts +18 -0
- package/dialog/{dialog.scss → styles/_index.scss} +2 -0
- package/dialog/styles/vars.scss +7 -0
- package/divider/divider.component.d.ts +8 -35
- package/divider/divider.module.d.ts +1 -1
- package/divider/index.d.ts +5 -2
- package/divider/public-api.d.ts +8 -0
- package/divider/{divider.scss → styles/_index.scss} +1 -1
- package/esm2022/alert/alert-type.mjs +8 -0
- package/esm2022/alert/alert.component.mjs +54 -0
- package/esm2022/alert/alert.module.mjs +22 -0
- package/esm2022/alert/ngwr-alert.mjs +5 -0
- package/esm2022/alert/public-api.mjs +10 -0
- package/esm2022/avatar/avatar.component.mjs +77 -0
- package/esm2022/avatar/avatar.module.mjs +22 -0
- package/esm2022/avatar/ngwr-avatar.mjs +5 -0
- package/esm2022/avatar/public-api.mjs +9 -0
- package/esm2022/button/button-group.component.mjs +36 -0
- package/esm2022/button/button.component.mjs +55 -163
- package/esm2022/button/button.module.mjs +15 -8
- package/esm2022/button/ngwr-button.mjs +2 -2
- package/esm2022/button/public-api.mjs +10 -0
- package/esm2022/cdk/base.directive.mjs +27 -0
- package/esm2022/cdk/ngwr-cdk.mjs +5 -0
- package/esm2022/cdk/public-api.mjs +8 -0
- package/esm2022/cdk/rxjs/is-array.mjs +10 -0
- package/esm2022/cdk/rxjs/is-defined.mjs +10 -0
- package/esm2022/cdk/rxjs/is-not-empty-array.mjs +10 -0
- package/esm2022/cdk/rxjs/is-observable.mjs +10 -0
- package/esm2022/cdk/rxjs/ngwr-cdk-rxjs.mjs +5 -0
- package/esm2022/cdk/rxjs/public-api.mjs +11 -0
- package/esm2022/cdk/types/maybe.mjs +8 -0
- package/esm2022/cdk/types/ngwr-cdk-types.mjs +5 -0
- package/esm2022/cdk/types/public-api.mjs +10 -0
- package/esm2022/cdk/types/safe-any.mjs +8 -0
- package/esm2022/cdk/types/theme-color.mjs +17 -0
- package/esm2022/cdk/utils/generate-random-id.mjs +17 -0
- package/esm2022/cdk/utils/ngwr-cdk-utils.mjs +5 -0
- package/esm2022/cdk/utils/public-api.mjs +8 -0
- package/esm2022/checkbox/checkbox.component.mjs +54 -120
- package/esm2022/checkbox/checkbox.module.mjs +14 -8
- package/esm2022/checkbox/ngwr-checkbox.mjs +2 -2
- package/esm2022/checkbox/public-api.mjs +9 -0
- package/esm2022/dialog/dialog-animations.mjs +8 -2
- package/esm2022/dialog/dialog-base.directive.mjs +95 -0
- package/esm2022/dialog/dialog-close.directive.mjs +33 -0
- package/esm2022/dialog/dialog-content.directive.mjs +25 -0
- package/esm2022/dialog/dialog-data.token.mjs +9 -0
- package/esm2022/dialog/dialog-footer.directive.mjs +36 -0
- package/esm2022/dialog/dialog-options.mjs +9 -0
- package/esm2022/dialog/dialog-ref.mjs +22 -16
- package/esm2022/dialog/dialog-title.directive.mjs +25 -0
- package/esm2022/dialog/dialog.component.mjs +57 -0
- package/esm2022/dialog/dialog.module.mjs +38 -0
- package/esm2022/dialog/dialog.service.mjs +107 -0
- package/esm2022/dialog/ngwr-dialog.mjs +2 -2
- package/esm2022/dialog/public-api.mjs +19 -0
- package/esm2022/divider/divider.component.mjs +16 -57
- package/esm2022/divider/divider.module.mjs +8 -8
- package/esm2022/divider/ngwr-divider.mjs +2 -2
- package/esm2022/divider/public-api.mjs +9 -0
- package/esm2022/form/form-error.component.mjs +33 -0
- package/esm2022/form/form-item.component.mjs +43 -0
- package/esm2022/form/form.module.mjs +23 -0
- package/esm2022/form/ngwr-form.mjs +2 -2
- package/esm2022/form/public-api.mjs +10 -0
- package/esm2022/icon/icon.component.mjs +82 -0
- package/esm2022/icon/icon.module.mjs +22 -0
- package/esm2022/icon/icon.service.mjs +40 -0
- package/esm2022/icon/icons.mjs +289 -279
- package/esm2022/icon/ngwr-icon.mjs +2 -2
- package/esm2022/icon/provide-wr-icons.mjs +17 -0
- package/esm2022/icon/public-api.mjs +12 -0
- package/esm2022/input/input-types.mjs +1 -1
- package/esm2022/input/input.component.mjs +119 -0
- package/esm2022/input/input.module.mjs +22 -0
- package/esm2022/input/ngwr-input.mjs +2 -2
- package/esm2022/input/public-api.mjs +10 -0
- package/esm2022/ngwr.mjs +2 -2
- package/esm2022/pipes/new-array.pipe.mjs +23 -0
- package/esm2022/pipes/ngwr-pipes.mjs +5 -0
- package/esm2022/pipes/pipes.module.mjs +22 -0
- package/esm2022/pipes/public-api.mjs +9 -0
- package/esm2022/progress/ngwr-progress.mjs +5 -0
- package/esm2022/progress/progress.component.mjs +42 -0
- package/esm2022/progress/progress.module.mjs +22 -0
- package/esm2022/progress/public-api.mjs +9 -0
- package/esm2022/public-api.mjs +3 -0
- package/esm2022/qr/generator.mjs +84 -0
- package/esm2022/qr/ngwr-qr.mjs +5 -0
- package/esm2022/qr/public-api.mjs +9 -0
- package/esm2022/qr/qr.component.mjs +90 -0
- package/esm2022/qr/qr.module.mjs +22 -0
- package/esm2022/qr/qrcodegen.mjs +872 -0
- package/esm2022/skeleton/index.mjs +3 -3
- package/esm2022/skeleton/skeleton.component.mjs +43 -0
- package/esm2022/skeleton/skeleton.module.mjs +16 -0
- package/esm2022/spinner/index.mjs +3 -3
- package/esm2022/spinner/spinner.component.mjs +33 -0
- package/esm2022/spinner/spinner.module.mjs +22 -0
- package/esm2022/tag/ngwr-tag.mjs +2 -2
- package/esm2022/tag/public-api.mjs +9 -0
- package/esm2022/tag/tag.component.mjs +74 -0
- package/esm2022/tag/tag.module.mjs +16 -0
- package/fesm2022/ngwr-alert.mjs +94 -0
- package/fesm2022/ngwr-alert.mjs.map +1 -0
- package/fesm2022/ngwr-avatar.mjs +110 -0
- package/fesm2022/ngwr-avatar.mjs.map +1 -0
- package/fesm2022/ngwr-button.mjs +108 -169
- package/fesm2022/ngwr-button.mjs.map +1 -1
- package/fesm2022/ngwr-cdk-rxjs.mjs +53 -0
- package/fesm2022/ngwr-cdk-rxjs.mjs.map +1 -0
- package/fesm2022/ngwr-cdk-types.mjs +44 -0
- package/fesm2022/ngwr-cdk-types.mjs.map +1 -0
- package/fesm2022/ngwr-cdk-utils.mjs +30 -0
- package/fesm2022/ngwr-cdk-utils.mjs.map +1 -0
- package/fesm2022/ngwr-cdk.mjs +41 -0
- package/fesm2022/ngwr-cdk.mjs.map +1 -0
- package/fesm2022/ngwr-checkbox.mjs +73 -126
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-dialog.mjs +225 -165
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-divider.mjs +29 -63
- package/fesm2022/ngwr-divider.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs +72 -54
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-icon.mjs +445 -368
- package/fesm2022/ngwr-icon.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +97 -208
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +56 -0
- package/fesm2022/ngwr-pipes.mjs.map +1 -0
- package/fesm2022/ngwr-progress.mjs +75 -0
- package/fesm2022/ngwr-progress.mjs.map +1 -0
- package/fesm2022/{ngwr-qrcode.mjs → ngwr-qr.mjs} +72 -113
- package/fesm2022/ngwr-qr.mjs.map +1 -0
- package/fesm2022/ngwr-skeleton.mjs +19 -22
- package/fesm2022/ngwr-skeleton.mjs.map +1 -1
- package/fesm2022/ngwr-spinner.mjs +35 -19
- package/fesm2022/ngwr-spinner.mjs.map +1 -1
- package/fesm2022/ngwr-tag.mjs +46 -49
- package/fesm2022/ngwr-tag.mjs.map +1 -1
- package/fesm2022/ngwr.mjs +1 -1
- package/fesm2022/ngwr.mjs.map +1 -1
- package/form/form-error.component.d.ts +11 -0
- package/form/form-item.component.d.ts +14 -0
- package/form/form.module.d.ts +8 -0
- package/form/index.d.ts +5 -3
- package/form/public-api.d.ts +9 -0
- package/icon/icon.component.d.ts +19 -0
- package/icon/icon.module.d.ts +7 -0
- package/icon/icon.service.d.ts +23 -0
- package/icon/icons.d.ts +115 -101
- package/icon/index.d.ts +5 -4
- package/icon/provide-wr-icons.d.ts +9 -0
- package/icon/public-api.d.ts +11 -0
- package/icon/{icon.scss → styles/_index.scss} +4 -2
- package/icon/styles/vars.scss +3 -0
- package/index.d.ts +5 -2
- package/input/index.d.ts +5 -2
- package/input/input-types.d.ts +0 -2
- package/input/input.component.d.ts +43 -0
- package/input/input.module.d.ts +7 -0
- package/input/public-api.d.ts +9 -0
- package/input/styles/_index.scss +107 -0
- package/input/styles/vars.scss +16 -0
- package/package.json +110 -57
- package/pipes/index.d.ts +5 -0
- package/pipes/new-array.pipe.d.ts +13 -0
- package/pipes/pipes.module.d.ts +7 -0
- package/pipes/public-api.d.ts +8 -0
- package/progress/index.d.ts +5 -0
- package/progress/progress.component.d.ts +10 -0
- package/progress/progress.module.d.ts +7 -0
- package/progress/public-api.d.ts +8 -0
- package/progress/styles/_index.scss +24 -0
- package/progress/styles/theming.scss +8 -0
- package/progress/styles/vars.scss +6 -0
- package/public-api.d.ts +2 -0
- package/qr/index.d.ts +5 -0
- package/qr/public-api.d.ts +8 -0
- package/qr/qr.component.d.ts +31 -0
- package/qr/qr.module.d.ts +7 -0
- package/skeleton/index.d.ts +2 -2
- package/skeleton/skeleton.component.d.ts +10 -0
- package/skeleton/{skeleton-module.d.ts → skeleton.module.d.ts} +2 -3
- package/skeleton/{skeleton.scss → styles/_index.scss} +1 -1
- package/spinner/index.d.ts +2 -2
- package/spinner/spinner.component.d.ts +11 -0
- package/spinner/{spinner-module.d.ts → spinner.module.d.ts} +2 -2
- package/spinner/{spinner.scss → styles/_index.scss} +2 -1
- package/styles/animations.scss +4 -4
- package/styles/cdk.scss +4 -0
- package/styles/colors.scss +72 -0
- package/styles/grid.scss +1 -2
- package/styles/reset.scss +2 -2
- package/styles/variables.scss +78 -0
- package/styles.scss +23 -0
- package/tag/index.d.ts +5 -2
- package/tag/public-api.d.ts +8 -0
- package/tag/styles/_index.scss +32 -0
- package/tag/styles/theming.scss +21 -0
- package/tag/styles/vars.scss +12 -0
- package/tag/tag.component.d.ts +21 -0
- package/tag/tag.module.d.ts +7 -0
- package/_grid.scss +0 -2
- package/_index.scss +0 -31
- package/backdrop/backdrop.scss +0 -3
- package/button/button.scss +0 -160
- package/checkbox/checkbox.scss +0 -103
- package/core/abstract/index.d.ts +0 -1
- package/core/color/index.d.ts +0 -2
- package/core/color/is-theme-color.d.ts +0 -2
- package/core/decorators/index.d.ts +0 -1
- package/core/decorators/input-boolean.d.ts +0 -1
- package/core/overlay/connected-overlay-directive.d.ts +0 -16
- package/core/overlay/get-placement-name.d.ts +0 -2
- package/core/overlay/index.d.ts +0 -5
- package/core/overlay/overlay-module.d.ts +0 -7
- package/core/overlay/overlay.scss +0 -9
- package/core/overlay/position-map.d.ts +0 -17
- package/core/overlay/position-type.d.ts +0 -2
- package/core/types/index.d.ts +0 -3
- package/core/types/on-change-type.d.ts +0 -2
- package/core/types/on-touched-type.d.ts +0 -2
- package/core/types/safe-any.d.ts +0 -1
- package/dialog/dialog-config.d.ts +0 -11
- package/dialog/dialog-container.d.ts +0 -22
- package/dialog/dialog-content-directives.d.ts +0 -31
- package/dialog/dialog-module.d.ts +0 -12
- package/dialog/dialog-service.d.ts +0 -27
- package/dialog/dialog-tokens.d.ts +0 -2
- package/esm2022/button/index.mjs +0 -3
- package/esm2022/checkbox/index.mjs +0 -3
- package/esm2022/core/abstract/base.mjs +0 -18
- package/esm2022/core/abstract/index.mjs +0 -2
- package/esm2022/core/abstract/ngwr-core-abstract.mjs +0 -5
- package/esm2022/core/color/color.mjs +0 -11
- package/esm2022/core/color/index.mjs +0 -3
- package/esm2022/core/color/is-theme-color.mjs +0 -9
- package/esm2022/core/color/ngwr-core-color.mjs +0 -5
- package/esm2022/core/decorators/index.mjs +0 -2
- package/esm2022/core/decorators/input-boolean.mjs +0 -15
- package/esm2022/core/decorators/ngwr-core-decorators.mjs +0 -5
- package/esm2022/core/overlay/connected-overlay-directive.mjs +0 -98
- package/esm2022/core/overlay/get-placement-name.mjs +0 -13
- package/esm2022/core/overlay/index.mjs +0 -5
- package/esm2022/core/overlay/ngwr-core-overlay.mjs +0 -5
- package/esm2022/core/overlay/overlay-module.mjs +0 -16
- package/esm2022/core/overlay/position-map.mjs +0 -18
- package/esm2022/core/overlay/position-type.mjs +0 -2
- package/esm2022/core/types/index.mjs +0 -4
- package/esm2022/core/types/ngwr-core-types.mjs +0 -5
- package/esm2022/core/types/on-change-type.mjs +0 -2
- package/esm2022/core/types/on-touched-type.mjs +0 -2
- package/esm2022/core/types/safe-any.mjs +0 -2
- package/esm2022/dialog/dialog-base.mjs +0 -92
- package/esm2022/dialog/dialog-config.mjs +0 -3
- package/esm2022/dialog/dialog-container.mjs +0 -58
- package/esm2022/dialog/dialog-content-directives.mjs +0 -98
- package/esm2022/dialog/dialog-module.mjs +0 -24
- package/esm2022/dialog/dialog-service.mjs +0 -109
- package/esm2022/dialog/dialog-tokens.mjs +0 -3
- package/esm2022/dialog/index.mjs +0 -10
- package/esm2022/divider/index.mjs +0 -3
- package/esm2022/form/form-error.mjs +0 -23
- package/esm2022/form/form-item.mjs +0 -46
- package/esm2022/form/form-module.mjs +0 -19
- package/esm2022/form/index.mjs +0 -4
- package/esm2022/icon/icon-module.mjs +0 -21
- package/esm2022/icon/icon-service.mjs +0 -21
- package/esm2022/icon/icon.mjs +0 -60
- package/esm2022/icon/index.mjs +0 -5
- package/esm2022/index.mjs +0 -3
- package/esm2022/input/index.mjs +0 -3
- package/esm2022/input/input-module.mjs +0 -20
- package/esm2022/input/input.mjs +0 -240
- package/esm2022/qrcode/generator.mjs +0 -84
- package/esm2022/qrcode/index.mjs +0 -3
- package/esm2022/qrcode/ngwr-qrcode.mjs +0 -5
- package/esm2022/qrcode/qrcode-module.mjs +0 -19
- package/esm2022/qrcode/qrcode.mjs +0 -142
- package/esm2022/qrcode/qrcodegen.mjs +0 -872
- package/esm2022/skeleton/skeleton-module.mjs +0 -18
- package/esm2022/skeleton/skeleton.mjs +0 -44
- package/esm2022/spinner/spinner-module.mjs +0 -16
- package/esm2022/spinner/spinner.mjs +0 -23
- package/esm2022/tag/index.mjs +0 -3
- package/esm2022/tag/tag-module.mjs +0 -20
- package/esm2022/tag/tag.mjs +0 -80
- package/esm2022/tooltip/index.mjs +0 -5
- package/esm2022/tooltip/ngwr-tooltip.mjs +0 -5
- package/esm2022/tooltip/tooltip-component.mjs +0 -93
- package/esm2022/tooltip/tooltip-default-positions.mjs +0 -8
- package/esm2022/tooltip/tooltip-directive.mjs +0 -85
- package/esm2022/tooltip/tooltip-module.mjs +0 -21
- package/esm2022/tooltip/tooltip-trigger.mjs +0 -2
- package/fesm2022/ngwr-core-abstract.mjs +0 -25
- package/fesm2022/ngwr-core-abstract.mjs.map +0 -1
- package/fesm2022/ngwr-core-color.mjs +0 -25
- package/fesm2022/ngwr-core-color.mjs.map +0 -1
- package/fesm2022/ngwr-core-decorators.mjs +0 -22
- package/fesm2022/ngwr-core-decorators.mjs.map +0 -1
- package/fesm2022/ngwr-core-overlay.mjs +0 -146
- package/fesm2022/ngwr-core-overlay.mjs.map +0 -1
- package/fesm2022/ngwr-core-types.mjs +0 -4
- package/fesm2022/ngwr-core-types.mjs.map +0 -1
- package/fesm2022/ngwr-qrcode.mjs.map +0 -1
- package/fesm2022/ngwr-tooltip.mjs +0 -204
- package/fesm2022/ngwr-tooltip.mjs.map +0 -1
- package/form/form-error.d.ts +0 -6
- package/form/form-item.d.ts +0 -15
- package/form/form-module.d.ts +0 -9
- package/icon/icon-module.d.ts +0 -9
- package/icon/icon-service.d.ts +0 -8
- package/icon/icon.d.ts +0 -20
- package/input/input-module.d.ts +0 -10
- package/input/input.d.ts +0 -65
- package/input/input.scss +0 -163
- package/qrcode/index.d.ts +0 -2
- package/qrcode/qrcode-module.d.ts +0 -9
- package/qrcode/qrcode.d.ts +0 -46
- package/skeleton/skeleton.d.ts +0 -11
- package/spinner/spinner.d.ts +0 -6
- package/styles/root.scss +0 -172
- package/tag/tag-module.d.ts +0 -10
- package/tag/tag.d.ts +0 -18
- package/tag/tag.scss +0 -106
- package/tooltip/index.d.ts +0 -5
- package/tooltip/tooltip-component.d.ts +0 -31
- package/tooltip/tooltip-default-positions.d.ts +0 -1
- package/tooltip/tooltip-directive.d.ts +0 -22
- package/tooltip/tooltip-module.d.ts +0 -11
- package/tooltip/tooltip-trigger.d.ts +0 -1
- package/tooltip/tooltip.scss +0 -67
- /package/form/{form.scss → styles/_index.scss} +0 -0
- /package/{qrcode → qr}/generator.d.ts +0 -0
- /package/{qrcode → qr}/qrcodegen.d.ts +0 -0
- /package/{qrcode/qrcode.scss → qr/styles/_index.scss} +0 -0
package/fesm2022/ngwr-dialog.mjs
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as i3 from '@angular/cdk/portal';
|
|
3
|
-
import { BasePortalOutlet, CdkPortalOutlet, ComponentPortal, PortalModule } from '@angular/cdk/portal';
|
|
1
|
+
import { BasePortalOutlet, CdkPortalOutlet, ComponentPortal } from '@angular/cdk/portal';
|
|
4
2
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { EventEmitter, Directive, Component, ViewEncapsulation, ViewChild, HostBinding, HostListener, Optional, Input, InjectionToken, Injector, Injectable,
|
|
3
|
+
import { EventEmitter, Directive, Component, ChangeDetectionStrategy, ViewEncapsulation, ViewChild, HostBinding, HostListener, Optional, Input, InjectionToken, inject, Injector, Injectable, NgModule } from '@angular/core';
|
|
4
|
+
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
6
5
|
import { Subject, filter, take, takeUntil } from 'rxjs';
|
|
7
6
|
import * as i2 from '@angular/cdk/overlay';
|
|
8
|
-
import { OverlayConfig, OverlayRef
|
|
7
|
+
import { Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';
|
|
9
8
|
import { hasModifierKey } from '@angular/cdk/keycodes';
|
|
10
|
-
import { WrAbstractBase } from 'ngwr/
|
|
11
|
-
import {
|
|
12
|
-
import { WrIconModule } from 'ngwr/icon';
|
|
9
|
+
import { WrAbstractBase } from 'ngwr/cdk';
|
|
10
|
+
import { generateRandomId } from 'ngwr/cdk/utils';
|
|
13
11
|
|
|
12
|
+
/**
|
|
13
|
+
* @license
|
|
14
|
+
*
|
|
15
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
16
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
17
|
+
*/
|
|
14
18
|
const WR_ANIMATION_ZOOM_CLASS_NAME_MAP = {
|
|
15
19
|
enter: 'wr-animation-zoom-enter',
|
|
16
20
|
enterActive: 'wr-animation-zoom-enter--active',
|
|
@@ -24,7 +28,7 @@ const WR_ANIMATION_FADE_CLASS_NAME_MAP = {
|
|
|
24
28
|
leaveActive: 'wr-animation-fade-leave--active',
|
|
25
29
|
};
|
|
26
30
|
const wrDialogAnimations = {
|
|
27
|
-
|
|
31
|
+
dialogComponent: trigger('dialogComponent', [
|
|
28
32
|
state('void, exit', style({})),
|
|
29
33
|
state('enter', style({})),
|
|
30
34
|
transition('* => enter', animate('.24s', style({}))),
|
|
@@ -32,14 +36,20 @@ const wrDialogAnimations = {
|
|
|
32
36
|
]),
|
|
33
37
|
};
|
|
34
38
|
|
|
35
|
-
|
|
39
|
+
/**
|
|
40
|
+
* @license
|
|
41
|
+
*
|
|
42
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
43
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
44
|
+
*/
|
|
45
|
+
class WrDialogOptions {
|
|
36
46
|
}
|
|
37
47
|
|
|
38
|
-
class
|
|
39
|
-
constructor(cdr,
|
|
48
|
+
class WrDialogBaseDirective extends BasePortalOutlet {
|
|
49
|
+
constructor(cdr, options, overlayRef) {
|
|
40
50
|
super();
|
|
41
51
|
this.cdr = cdr;
|
|
42
|
-
this.
|
|
52
|
+
this.options = options;
|
|
43
53
|
this.overlayRef = overlayRef;
|
|
44
54
|
this.containerClick = new EventEmitter();
|
|
45
55
|
this.animationStateChanged = new EventEmitter();
|
|
@@ -113,14 +123,17 @@ class WrDialogBase extends BasePortalOutlet {
|
|
|
113
123
|
this.state = 'exit';
|
|
114
124
|
this.cdr.markForCheck();
|
|
115
125
|
}
|
|
116
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
117
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
126
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrDialogBaseDirective, deps: [{ token: i0.ChangeDetectorRef }, { token: WrDialogOptions }, { token: i2.OverlayRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
127
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.4", type: WrDialogBaseDirective, isStandalone: true, usesInheritance: true, ngImport: i0 }); }
|
|
118
128
|
}
|
|
119
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
120
|
-
type: Directive
|
|
121
|
-
|
|
129
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrDialogBaseDirective, decorators: [{
|
|
130
|
+
type: Directive,
|
|
131
|
+
args: [{
|
|
132
|
+
standalone: true,
|
|
133
|
+
}]
|
|
134
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: WrDialogOptions }, { type: i2.OverlayRef }] });
|
|
122
135
|
|
|
123
|
-
class
|
|
136
|
+
class WrDialogComponent extends WrDialogBaseDirective {
|
|
124
137
|
onAnimationStart(event) {
|
|
125
138
|
super.onAnimationStart(event);
|
|
126
139
|
}
|
|
@@ -136,18 +149,18 @@ class WrDialogContainer extends WrDialogBase {
|
|
|
136
149
|
'wr-dialog': true,
|
|
137
150
|
};
|
|
138
151
|
}
|
|
139
|
-
constructor(cdr,
|
|
140
|
-
super(cdr,
|
|
141
|
-
this.
|
|
152
|
+
constructor(cdr, options, overlayRef) {
|
|
153
|
+
super(cdr, options, overlayRef);
|
|
154
|
+
this.options = options;
|
|
142
155
|
this.state = 'enter';
|
|
143
156
|
}
|
|
144
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
145
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
157
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrDialogComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: WrDialogOptions }, { token: i2.OverlayRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
158
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.4", type: WrDialogComponent, isStandalone: true, selector: "wr-dialog", host: { listeners: { "@dialogComponent.start": "onAnimationStart($event)", "@dialogComponent.done": "onAnimationDone($event)", "click": "onContainerClick($event)" }, properties: { "@dialogComponent": "this.state", "class": "this.elClasses" } }, viewQueries: [{ propertyName: "portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true, static: true }, { propertyName: "dialogElementRef", first: true, predicate: ["dialogElement"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"wr-dialog__wrapper\" #dialogElement>\n <ng-template cdkPortalOutlet></ng-template>\n</div>\n", dependencies: [{ kind: "directive", type: CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], animations: [wrDialogAnimations.dialogComponent], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
146
159
|
}
|
|
147
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
160
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrDialogComponent, decorators: [{
|
|
148
161
|
type: Component,
|
|
149
|
-
args: [{ selector: 'wr-dialog
|
|
150
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type:
|
|
162
|
+
args: [{ standalone: true, selector: 'wr-dialog', animations: [wrDialogAnimations.dialogComponent], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [CdkPortalOutlet], template: "<div class=\"wr-dialog__wrapper\" #dialogElement>\n <ng-template cdkPortalOutlet></ng-template>\n</div>\n" }]
|
|
163
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: WrDialogOptions }, { type: i2.OverlayRef }], propDecorators: { portalOutlet: [{
|
|
151
164
|
type: ViewChild,
|
|
152
165
|
args: [CdkPortalOutlet, { static: true }]
|
|
153
166
|
}], dialogElementRef: [{
|
|
@@ -155,13 +168,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
|
|
|
155
168
|
args: ['dialogElement', { static: true }]
|
|
156
169
|
}], state: [{
|
|
157
170
|
type: HostBinding,
|
|
158
|
-
args: ['@
|
|
171
|
+
args: ['@dialogComponent']
|
|
159
172
|
}], onAnimationStart: [{
|
|
160
173
|
type: HostListener,
|
|
161
|
-
args: ['@
|
|
174
|
+
args: ['@dialogComponent.start', ['$event']]
|
|
162
175
|
}], onAnimationDone: [{
|
|
163
176
|
type: HostListener,
|
|
164
|
-
args: ['@
|
|
177
|
+
args: ['@dialogComponent.done', ['$event']]
|
|
165
178
|
}], onContainerClick: [{
|
|
166
179
|
type: HostListener,
|
|
167
180
|
args: ['click', ['$event']]
|
|
@@ -170,30 +183,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
|
|
|
170
183
|
args: ['class']
|
|
171
184
|
}] } });
|
|
172
185
|
|
|
186
|
+
/**
|
|
187
|
+
* @license
|
|
188
|
+
*
|
|
189
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
190
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
191
|
+
*/
|
|
173
192
|
class WrDialogRef extends WrAbstractBase {
|
|
174
|
-
constructor(
|
|
193
|
+
constructor(overlayRef, options, baseInstance) {
|
|
175
194
|
super();
|
|
176
|
-
this.config = config;
|
|
177
195
|
this.overlayRef = overlayRef;
|
|
178
|
-
this.
|
|
196
|
+
this.options = options;
|
|
197
|
+
this.baseInstance = baseInstance;
|
|
179
198
|
this.componentInstance = null;
|
|
180
|
-
this.afterClosed = new Subject();
|
|
181
199
|
this.afterOpened = new Subject();
|
|
182
|
-
this.
|
|
183
|
-
|
|
184
|
-
|
|
200
|
+
this.afterClosed = new Subject();
|
|
201
|
+
this.id = options.id || `wr__modal__${generateRandomId()}`;
|
|
202
|
+
baseInstance.animationStateChanged
|
|
203
|
+
.pipe(filter(evt => evt.phaseName === 'done' && evt.toState === 'enter'), take(1))
|
|
185
204
|
.subscribe(() => {
|
|
186
205
|
this.afterOpened.next();
|
|
187
206
|
this.afterOpened.complete();
|
|
188
207
|
});
|
|
189
|
-
|
|
190
|
-
.pipe(filter(
|
|
208
|
+
baseInstance.animationStateChanged
|
|
209
|
+
.pipe(filter(evt => evt.phaseName === 'done' && evt.toState === 'exit'), take(1))
|
|
191
210
|
.subscribe(() => {
|
|
192
211
|
clearTimeout(this.closeTimeout);
|
|
193
212
|
this._finishDialogClose();
|
|
194
213
|
});
|
|
195
|
-
|
|
196
|
-
this.close(
|
|
214
|
+
baseInstance.containerClick.pipe(takeUntil(this.destroyed$)).subscribe(() => {
|
|
215
|
+
this.close();
|
|
197
216
|
});
|
|
198
217
|
overlayRef.backdropClick().subscribe(() => this.close(undefined));
|
|
199
218
|
overlayRef.keydownEvents().subscribe(event => {
|
|
@@ -211,16 +230,15 @@ class WrDialogRef extends WrAbstractBase {
|
|
|
211
230
|
}
|
|
212
231
|
close(result) {
|
|
213
232
|
this.result = result;
|
|
214
|
-
this.
|
|
233
|
+
this.baseInstance.animationStateChanged
|
|
215
234
|
.pipe(filter(event => event.phaseName === 'start'), take(1))
|
|
216
235
|
.subscribe(event => {
|
|
217
236
|
this.overlayRef.detachBackdrop();
|
|
218
|
-
// @ts-ignore
|
|
219
237
|
this.closeTimeout = setTimeout(() => {
|
|
220
238
|
this._finishDialogClose();
|
|
221
239
|
}, event.totalTime + 100);
|
|
222
240
|
});
|
|
223
|
-
this.
|
|
241
|
+
this.baseInstance.startExitAnimation();
|
|
224
242
|
}
|
|
225
243
|
_finishDialogClose() {
|
|
226
244
|
this.overlayRef.dispose();
|
|
@@ -228,7 +246,13 @@ class WrDialogRef extends WrAbstractBase {
|
|
|
228
246
|
}
|
|
229
247
|
}
|
|
230
248
|
|
|
231
|
-
|
|
249
|
+
/**
|
|
250
|
+
* @license
|
|
251
|
+
*
|
|
252
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
253
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
254
|
+
*/
|
|
255
|
+
class WrDialogCloseDirective {
|
|
232
256
|
_onButtonClick(event) {
|
|
233
257
|
event.preventDefault();
|
|
234
258
|
this.dialogRef.close(undefined);
|
|
@@ -236,14 +260,14 @@ class WrDialogClose {
|
|
|
236
260
|
constructor(dialogRef) {
|
|
237
261
|
this.dialogRef = dialogRef;
|
|
238
262
|
}
|
|
239
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
240
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
263
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrDialogCloseDirective, deps: [{ token: WrDialogRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
264
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.4", type: WrDialogCloseDirective, isStandalone: true, selector: "[wrDialogClose]", host: { listeners: { "click": "_onButtonClick($event)" } }, ngImport: i0 }); }
|
|
241
265
|
}
|
|
242
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
266
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrDialogCloseDirective, decorators: [{
|
|
243
267
|
type: Directive,
|
|
244
268
|
args: [{
|
|
245
|
-
|
|
246
|
-
|
|
269
|
+
standalone: true,
|
|
270
|
+
selector: `[wrDialogClose]`,
|
|
247
271
|
}]
|
|
248
272
|
}], ctorParameters: () => [{ type: WrDialogRef, decorators: [{
|
|
249
273
|
type: Optional
|
|
@@ -251,50 +275,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
|
|
|
251
275
|
type: HostListener,
|
|
252
276
|
args: ['click', ['$event']]
|
|
253
277
|
}] } });
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
type: Directive,
|
|
265
|
-
args: [{
|
|
266
|
-
selector: '[wr-dialog-title], [wrDialogTitle]',
|
|
267
|
-
exportAs: 'wrtDialogTitle',
|
|
268
|
-
}]
|
|
269
|
-
}], propDecorators: { elClasses: [{
|
|
270
|
-
type: HostBinding,
|
|
271
|
-
args: ['class']
|
|
272
|
-
}] } });
|
|
273
|
-
class WrDialogContent {
|
|
274
|
-
get elClasses() {
|
|
275
|
-
return {
|
|
276
|
-
'wr-dialog__content': true,
|
|
277
|
-
};
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* @license
|
|
281
|
+
*
|
|
282
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
283
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
284
|
+
*/
|
|
285
|
+
class WrDialogContentDirective {
|
|
286
|
+
constructor() {
|
|
287
|
+
this.class = 'wr-dialog__content';
|
|
278
288
|
}
|
|
279
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
280
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
289
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrDialogContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
290
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.4", type: WrDialogContentDirective, isStandalone: true, selector: "[wrDialogContent]", host: { properties: { "class": "this.class" } }, ngImport: i0 }); }
|
|
281
291
|
}
|
|
282
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
292
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrDialogContentDirective, decorators: [{
|
|
283
293
|
type: Directive,
|
|
284
294
|
args: [{
|
|
285
|
-
|
|
295
|
+
standalone: true,
|
|
296
|
+
selector: `[wrDialogContent]`,
|
|
286
297
|
}]
|
|
287
|
-
}], propDecorators: {
|
|
288
|
-
type: HostBinding
|
|
289
|
-
args: ['class']
|
|
298
|
+
}], propDecorators: { class: [{
|
|
299
|
+
type: HostBinding
|
|
290
300
|
}] } });
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* @license
|
|
304
|
+
*
|
|
305
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
306
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
307
|
+
*/
|
|
308
|
+
class WrDialogFooterDirective {
|
|
309
|
+
constructor() {
|
|
310
|
+
this.position = 'end';
|
|
298
311
|
}
|
|
299
312
|
get elClasses() {
|
|
300
313
|
return {
|
|
@@ -304,28 +317,72 @@ class WrDialogFooter {
|
|
|
304
317
|
'wr-dialog__footer--end': this.position === 'end',
|
|
305
318
|
};
|
|
306
319
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
this._position = 'end';
|
|
310
|
-
}
|
|
311
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: WrDialogFooter, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
312
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.3", type: WrDialogFooter, selector: "[wr-dialog-footer], wr-dialog-footer, [wrDialogFooter]", inputs: { position: "position" }, host: { properties: { "class": "this.elClasses" } }, ngImport: i0 }); }
|
|
320
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrDialogFooterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
321
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.4", type: WrDialogFooterDirective, isStandalone: true, selector: "[wrDialogFooter]", inputs: { position: "position" }, host: { properties: { "class": "this.elClasses" } }, ngImport: i0 }); }
|
|
313
322
|
}
|
|
314
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
323
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrDialogFooterDirective, decorators: [{
|
|
315
324
|
type: Directive,
|
|
316
325
|
args: [{
|
|
317
|
-
|
|
326
|
+
standalone: true,
|
|
327
|
+
selector: '[wrDialogFooter]',
|
|
318
328
|
}]
|
|
319
|
-
}],
|
|
329
|
+
}], propDecorators: { position: [{
|
|
320
330
|
type: Input
|
|
321
331
|
}], elClasses: [{
|
|
322
332
|
type: HostBinding,
|
|
323
333
|
args: ['class']
|
|
324
334
|
}] } });
|
|
325
335
|
|
|
336
|
+
/**
|
|
337
|
+
* @license
|
|
338
|
+
*
|
|
339
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
340
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
341
|
+
*/
|
|
342
|
+
class WrDialogTitleDirective {
|
|
343
|
+
constructor() {
|
|
344
|
+
this.class = 'wr-dialog__title';
|
|
345
|
+
}
|
|
346
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrDialogTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
347
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.4", type: WrDialogTitleDirective, isStandalone: true, selector: "[wrDialogTitle]", host: { properties: { "class": "this.class" } }, ngImport: i0 }); }
|
|
348
|
+
}
|
|
349
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrDialogTitleDirective, decorators: [{
|
|
350
|
+
type: Directive,
|
|
351
|
+
args: [{
|
|
352
|
+
standalone: true,
|
|
353
|
+
selector: '[wrDialogTitle]',
|
|
354
|
+
}]
|
|
355
|
+
}], propDecorators: { class: [{
|
|
356
|
+
type: HostBinding
|
|
357
|
+
}] } });
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* @license
|
|
361
|
+
*
|
|
362
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
363
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
364
|
+
*/
|
|
326
365
|
const WR_DIALOG_DATA = new InjectionToken('WR_DIALOG_DATA');
|
|
327
366
|
|
|
367
|
+
/**
|
|
368
|
+
* @license
|
|
369
|
+
*
|
|
370
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
371
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
372
|
+
*/
|
|
373
|
+
/**
|
|
374
|
+
* NGWR dialog service.
|
|
375
|
+
*
|
|
376
|
+
* {@tutorial} [How to use wr-dialog]{@link http://ngwr.dev/docs/components/dialog}
|
|
377
|
+
*/
|
|
328
378
|
class WrDialogService {
|
|
379
|
+
constructor() {
|
|
380
|
+
this.overlay = inject(Overlay);
|
|
381
|
+
this.injector = inject(Injector);
|
|
382
|
+
this.parentModal = inject(WrDialogService, { optional: true, skipSelf: true });
|
|
383
|
+
this.openedDialogsAtThisLevel = [];
|
|
384
|
+
this.afterAllClosedAtThisLevel = new Subject();
|
|
385
|
+
}
|
|
329
386
|
get openedDialogs() {
|
|
330
387
|
return this.parentModal ? this.parentModal.openedDialogs : this.openedDialogsAtThisLevel;
|
|
331
388
|
}
|
|
@@ -333,115 +390,118 @@ class WrDialogService {
|
|
|
333
390
|
const parent = this.parentModal;
|
|
334
391
|
return parent ? parent._afterAllClosed : this.afterAllClosedAtThisLevel;
|
|
335
392
|
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
this.
|
|
345
|
-
this.afterAllClosedAtThisLevel.complete();
|
|
346
|
-
}
|
|
347
|
-
open(config) {
|
|
348
|
-
const _config = config || new WrDialogConfig();
|
|
349
|
-
const positionStrategy = _config?.positionStrategy || this._defaultPositionStrategy();
|
|
350
|
-
const overlayRef = this._createOverlay(positionStrategy);
|
|
351
|
-
const dialogContainer = this._attachDialogContainer(overlayRef, _config);
|
|
352
|
-
const dialogRef = this._attachDialogContent(dialogContainer, overlayRef, _config);
|
|
393
|
+
open(options) {
|
|
394
|
+
const _options = options || new WrDialogOptions();
|
|
395
|
+
const positionStrategy = _options?.positionStrategy || this._defaultPositionStrategy();
|
|
396
|
+
const scrollStrategy = _options?.scrollStrategy || this._defaultScrollStrategy();
|
|
397
|
+
const hasBackdrop = _options?.hasBackdrop || true;
|
|
398
|
+
const backdropClass = _options?.backdropClass || 'wr-backdrop';
|
|
399
|
+
const overlayRef = this._createOverlay(positionStrategy, scrollStrategy, hasBackdrop, backdropClass);
|
|
400
|
+
const dialogContainer = this._attachDialogContainer(overlayRef, _options);
|
|
401
|
+
const dialogRef = this._attachDialogContent(dialogContainer, overlayRef, _options);
|
|
353
402
|
dialogContainer.dialogRef = dialogRef;
|
|
354
|
-
this.
|
|
355
|
-
dialogRef.afterClosed.subscribe(() => this.
|
|
403
|
+
this.openedDialogsAtThisLevel.push(dialogRef);
|
|
404
|
+
dialogRef.afterClosed.subscribe(() => this._removeOpenedModal(dialogRef));
|
|
356
405
|
return dialogRef;
|
|
357
406
|
}
|
|
358
|
-
removeOpenModal(dialogRef) {
|
|
359
|
-
const index = this.openedDialogs.indexOf(dialogRef);
|
|
360
|
-
if (index > -1) {
|
|
361
|
-
this.openedDialogs.splice(index, 1);
|
|
362
|
-
if (!this.openedDialogs.length) {
|
|
363
|
-
this._afterAllClosed.next();
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
closeModals(dialogs) {
|
|
368
|
-
let i = dialogs.length;
|
|
369
|
-
while (i--) {
|
|
370
|
-
dialogs[i].close();
|
|
371
|
-
if (!this.openedDialogs.length) {
|
|
372
|
-
this._afterAllClosed.next();
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
407
|
_defaultPositionStrategy() {
|
|
377
|
-
return this.overlay.position().global().
|
|
408
|
+
return this.overlay.position().global().centerVertically().centerHorizontally();
|
|
378
409
|
}
|
|
379
|
-
|
|
410
|
+
_defaultScrollStrategy() {
|
|
411
|
+
return this.overlay.scrollStrategies.block();
|
|
412
|
+
}
|
|
413
|
+
_createOverlay(positionStrategy, scrollStrategy, hasBackdrop, backdropClass) {
|
|
380
414
|
const overlayConfig = new OverlayConfig({
|
|
381
415
|
positionStrategy,
|
|
382
|
-
hasBackdrop
|
|
383
|
-
backdropClass
|
|
384
|
-
scrollStrategy
|
|
385
|
-
disposeOnNavigation: true,
|
|
416
|
+
hasBackdrop,
|
|
417
|
+
backdropClass,
|
|
418
|
+
scrollStrategy,
|
|
386
419
|
});
|
|
387
420
|
return this.overlay.create(overlayConfig);
|
|
388
421
|
}
|
|
389
|
-
_attachDialogContainer(overlayRef,
|
|
390
|
-
const userInjector =
|
|
422
|
+
_attachDialogContainer(overlayRef, options) {
|
|
423
|
+
const userInjector = options && options.viewContainerRef && options.viewContainerRef.injector;
|
|
391
424
|
const injector = Injector.create({
|
|
392
425
|
parent: userInjector || this.injector,
|
|
393
426
|
providers: [
|
|
394
427
|
{ provide: OverlayRef, useValue: overlayRef },
|
|
395
|
-
{ provide:
|
|
428
|
+
{ provide: WrDialogOptions, useValue: options },
|
|
396
429
|
],
|
|
397
430
|
});
|
|
398
|
-
const containerPortal = new ComponentPortal(
|
|
431
|
+
const containerPortal = new ComponentPortal(WrDialogComponent, options?.viewContainerRef, injector);
|
|
399
432
|
const containerRef = overlayRef.attach(containerPortal);
|
|
400
433
|
return containerRef.instance;
|
|
401
434
|
}
|
|
402
|
-
_attachDialogContent(
|
|
403
|
-
const dialogRef = new WrDialogRef(
|
|
404
|
-
const userInjector =
|
|
435
|
+
_attachDialogContent(container, overlayRef, options) {
|
|
436
|
+
const dialogRef = new WrDialogRef(overlayRef, options, container);
|
|
437
|
+
const userInjector = options && options.viewContainerRef && options.viewContainerRef?.injector;
|
|
405
438
|
const injector = Injector.create({
|
|
406
439
|
parent: userInjector || this.injector,
|
|
407
440
|
providers: [
|
|
408
441
|
{ provide: WrDialogRef, useValue: dialogRef },
|
|
409
|
-
{ provide: WR_DIALOG_DATA, useValue:
|
|
442
|
+
{ provide: WR_DIALOG_DATA, useValue: options?.data },
|
|
410
443
|
],
|
|
411
444
|
});
|
|
412
|
-
const contentRef =
|
|
445
|
+
const contentRef = container.attachComponentPortal(new ComponentPortal(options?.component, options?.viewContainerRef, injector));
|
|
413
446
|
dialogRef.componentInstance = contentRef.instance;
|
|
414
447
|
return dialogRef;
|
|
415
448
|
}
|
|
416
|
-
|
|
417
|
-
|
|
449
|
+
_removeOpenedModal(dialogRef) {
|
|
450
|
+
const index = this.openedDialogs.indexOf(dialogRef);
|
|
451
|
+
if (index > -1) {
|
|
452
|
+
this.openedDialogs.splice(index, 1);
|
|
453
|
+
if (!this.openedDialogs.length) {
|
|
454
|
+
this._afterAllClosed.next();
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
459
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrDialogService }); }
|
|
418
460
|
}
|
|
419
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
461
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrDialogService, decorators: [{
|
|
420
462
|
type: Injectable
|
|
421
|
-
}]
|
|
422
|
-
type: Optional
|
|
423
|
-
}, {
|
|
424
|
-
type: SkipSelf
|
|
425
|
-
}] }] });
|
|
463
|
+
}] });
|
|
426
464
|
|
|
465
|
+
/**
|
|
466
|
+
* @license
|
|
467
|
+
*
|
|
468
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
469
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
470
|
+
*/
|
|
427
471
|
class WrDialogModule {
|
|
428
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
429
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
430
|
-
|
|
472
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
473
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.4", ngImport: i0, type: WrDialogModule, imports: [WrDialogComponent,
|
|
474
|
+
WrDialogFooterDirective,
|
|
475
|
+
WrDialogContentDirective,
|
|
476
|
+
WrDialogCloseDirective,
|
|
477
|
+
WrDialogTitleDirective], exports: [WrDialogCloseDirective, WrDialogFooterDirective, WrDialogContentDirective, WrDialogTitleDirective] }); }
|
|
478
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrDialogModule, providers: [WrDialogService] }); }
|
|
431
479
|
}
|
|
432
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
480
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrDialogModule, decorators: [{
|
|
433
481
|
type: NgModule,
|
|
434
482
|
args: [{
|
|
435
|
-
imports: [
|
|
436
|
-
|
|
437
|
-
|
|
483
|
+
imports: [
|
|
484
|
+
WrDialogComponent,
|
|
485
|
+
WrDialogFooterDirective,
|
|
486
|
+
WrDialogContentDirective,
|
|
487
|
+
WrDialogCloseDirective,
|
|
488
|
+
WrDialogTitleDirective,
|
|
489
|
+
],
|
|
490
|
+
exports: [WrDialogCloseDirective, WrDialogFooterDirective, WrDialogContentDirective, WrDialogTitleDirective],
|
|
438
491
|
providers: [WrDialogService],
|
|
439
492
|
}]
|
|
440
493
|
}] });
|
|
441
494
|
|
|
495
|
+
/**
|
|
496
|
+
* @license
|
|
497
|
+
*
|
|
498
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
499
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
500
|
+
*/
|
|
501
|
+
|
|
442
502
|
/**
|
|
443
503
|
* Generated bundle index. Do not edit.
|
|
444
504
|
*/
|
|
445
505
|
|
|
446
|
-
export { WR_ANIMATION_FADE_CLASS_NAME_MAP, WR_ANIMATION_ZOOM_CLASS_NAME_MAP, WR_DIALOG_DATA,
|
|
506
|
+
export { WR_ANIMATION_FADE_CLASS_NAME_MAP, WR_ANIMATION_ZOOM_CLASS_NAME_MAP, WR_DIALOG_DATA, WrDialogBaseDirective, WrDialogCloseDirective, WrDialogComponent, WrDialogContentDirective, WrDialogFooterDirective, WrDialogModule, WrDialogOptions, WrDialogRef, WrDialogService, WrDialogTitleDirective, wrDialogAnimations };
|
|
447
507
|
//# sourceMappingURL=ngwr-dialog.mjs.map
|