ngwr 3.0.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-input.mjs
CHANGED
|
@@ -1,263 +1,152 @@
|
|
|
1
|
-
import { __decorate } from 'tslib';
|
|
2
|
-
import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
|
|
3
1
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { forwardRef, Component, ChangeDetectionStrategy, ViewEncapsulation, Input,
|
|
5
|
-
import * as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { InputBoolean } from 'ngwr/core/decorators';
|
|
11
|
-
import * as i1 from '@angular/cdk/a11y';
|
|
12
|
-
import * as i2 from '@angular/common';
|
|
13
|
-
import { CommonModule } from '@angular/common';
|
|
14
|
-
import * as i4 from 'ngwr/icon';
|
|
15
|
-
import { WrIconModule } from 'ngwr/icon';
|
|
2
|
+
import { signal, booleanAttribute, forwardRef, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { FormControl, NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import { noop, debounceTime, tap, takeUntil } from 'rxjs';
|
|
6
|
+
import { WrAbstractBase } from 'ngwr/cdk';
|
|
7
|
+
import { provideWrIcons, eye, eyeOff, WrIconComponent } from 'ngwr/icon';
|
|
16
8
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
this.
|
|
42
|
-
|
|
43
|
-
get required() {
|
|
44
|
-
return this._required;
|
|
45
|
-
}
|
|
46
|
-
set required(required) {
|
|
47
|
-
this._required = coerceBooleanProperty(required);
|
|
48
|
-
}
|
|
49
|
-
get autofocus() {
|
|
50
|
-
return this._autofocus;
|
|
51
|
-
}
|
|
52
|
-
set autofocus(autofocus) {
|
|
53
|
-
this._autofocus = coerceBooleanProperty(autofocus);
|
|
54
|
-
}
|
|
55
|
-
get autocomplete() {
|
|
56
|
-
return this._autocomplete;
|
|
9
|
+
/**
|
|
10
|
+
* @license
|
|
11
|
+
*
|
|
12
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
13
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* NGWR input component.
|
|
17
|
+
*
|
|
18
|
+
* {@tutorial} [How to use wr-alert]{@link http://ngwr.dev/docs/components/input}
|
|
19
|
+
*/
|
|
20
|
+
class WrInputComponent extends WrAbstractBase {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.formControl = new FormControl();
|
|
24
|
+
this.eyeOn = signal(true);
|
|
25
|
+
this.isFocused = signal(false);
|
|
26
|
+
this.onChange = noop;
|
|
27
|
+
this.onTouch = noop;
|
|
28
|
+
this.placeholder = '';
|
|
29
|
+
this.prefix = null;
|
|
30
|
+
this.suffix = null;
|
|
31
|
+
this.rounded = false;
|
|
32
|
+
this.passwordIcons = false;
|
|
33
|
+
this.readonly = false;
|
|
34
|
+
this.type = 'text';
|
|
57
35
|
}
|
|
58
|
-
|
|
59
|
-
this.
|
|
36
|
+
registerOnChange(fn) {
|
|
37
|
+
this.onChange = fn;
|
|
60
38
|
}
|
|
61
|
-
|
|
62
|
-
|
|
39
|
+
registerOnTouched(fn) {
|
|
40
|
+
this.onTouch = fn;
|
|
63
41
|
}
|
|
64
|
-
|
|
65
|
-
if (
|
|
66
|
-
this.
|
|
67
|
-
this.onChangeCallback(this.value);
|
|
42
|
+
setDisabledState(isDisabled) {
|
|
43
|
+
if (isDisabled) {
|
|
44
|
+
return this.formControl.disable();
|
|
68
45
|
}
|
|
46
|
+
return this.formControl.enable();
|
|
69
47
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
return '';
|
|
73
|
-
return String(this._value);
|
|
74
|
-
}
|
|
75
|
-
get valueAsNumber() {
|
|
76
|
-
return coerceNumberProperty(this._value);
|
|
48
|
+
writeValue(value) {
|
|
49
|
+
this.formControl.setValue(value, { emitEvent: false });
|
|
77
50
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
51
|
+
ngOnInit() {
|
|
52
|
+
this.formControl.valueChanges
|
|
53
|
+
.pipe(debounceTime(200), tap(value => this.onChange(value)), takeUntil(this.destroyed$))
|
|
54
|
+
.subscribe();
|
|
81
55
|
}
|
|
82
56
|
get elClasses() {
|
|
83
57
|
return {
|
|
84
58
|
'wr-input': true,
|
|
59
|
+
'wr-input--rounded': this.rounded,
|
|
85
60
|
'wr-input--has-prefix': this.prefix,
|
|
86
61
|
'wr-input--has-suffix': this.suffix,
|
|
87
62
|
'wr-input--password': this.passwordIcons,
|
|
88
|
-
'wr-input--disabled': this.disabled,
|
|
63
|
+
'wr-input--disabled': this.formControl.disabled,
|
|
64
|
+
'wr-input--focused': this.isFocused(),
|
|
89
65
|
};
|
|
90
66
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
this.focusMonitor = focusMonitor;
|
|
96
|
-
this.ngZone = ngZone;
|
|
97
|
-
this.placeholder = '';
|
|
98
|
-
this.prefix = null;
|
|
99
|
-
this.suffix = null;
|
|
100
|
-
this.passwordIcons = false;
|
|
101
|
-
this.eyeOn = true;
|
|
102
|
-
this._value = '';
|
|
103
|
-
this._disabled = false;
|
|
104
|
-
this._readonly = false;
|
|
105
|
-
this._required = false;
|
|
106
|
-
this._autofocus = false;
|
|
107
|
-
this._focused = false;
|
|
108
|
-
this._autocomplete = 'off';
|
|
109
|
-
this._type = 'text';
|
|
110
|
-
this._mode = 'text';
|
|
111
|
-
this.onChangeCallback = () => { };
|
|
112
|
-
this.onTouchedCallback = () => { };
|
|
113
|
-
}
|
|
114
|
-
ngOnInit() {
|
|
115
|
-
this.ngZone.runOutsideAngular(() => {
|
|
116
|
-
fromEvent(this.elRef.nativeElement, 'click')
|
|
117
|
-
.pipe(takeUntil(this.destroyed$))
|
|
118
|
-
.subscribe(event => {
|
|
119
|
-
event.preventDefault();
|
|
120
|
-
this.onFocus();
|
|
121
|
-
if (this.disabled) {
|
|
122
|
-
event.stopImmediatePropagation();
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
fromEvent(this.inputElement.nativeElement, 'click')
|
|
127
|
-
.pipe(takeUntil(this.destroyed$))
|
|
128
|
-
.subscribe(event => event.stopPropagation());
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
ngAfterViewInit() {
|
|
132
|
-
if (this.autofocus) {
|
|
133
|
-
this.onFocus();
|
|
134
|
-
this.cdr.markForCheck();
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
ngOnDestroy() {
|
|
138
|
-
super.ngOnDestroy();
|
|
139
|
-
this.focusMonitor.stopMonitoring(this.elRef);
|
|
140
|
-
}
|
|
141
|
-
onFocus(event) {
|
|
142
|
-
if (event) {
|
|
143
|
-
event.stopPropagation();
|
|
144
|
-
}
|
|
145
|
-
this._focused = true;
|
|
146
|
-
this.focusMonitor.focusVia(this.inputElement, 'keyboard');
|
|
147
|
-
}
|
|
148
|
-
onBlur(event) {
|
|
149
|
-
if (event) {
|
|
150
|
-
event.stopPropagation();
|
|
67
|
+
onPasswordVisibilityChange() {
|
|
68
|
+
if (this.type === 'password') {
|
|
69
|
+
this.type = 'text';
|
|
70
|
+
this.eyeOn.set(false);
|
|
151
71
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
validate(control) {
|
|
157
|
-
return {
|
|
158
|
-
...(this.isBadInput ? { badInput: true } : null),
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
writeValue(value) {
|
|
162
|
-
if (value !== this._value) {
|
|
163
|
-
this._value = value;
|
|
72
|
+
else {
|
|
73
|
+
this.type = 'password';
|
|
74
|
+
this.eyeOn.set(true);
|
|
164
75
|
}
|
|
165
|
-
this.cdr.markForCheck();
|
|
166
|
-
}
|
|
167
|
-
registerOnChange(fn) {
|
|
168
|
-
this.onChangeCallback = fn;
|
|
169
76
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
onPasswordVisibilityChange() {
|
|
174
|
-
this.type === 'password' ? (this.type = 'text') : (this.type = 'password');
|
|
175
|
-
this.eyeOn = !this.eyeOn;
|
|
176
|
-
this.onFocus();
|
|
177
|
-
}
|
|
178
|
-
setDisabledState(isDisabled) {
|
|
179
|
-
this.disabled = coerceBooleanProperty(isDisabled);
|
|
180
|
-
}
|
|
181
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: WrInput, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i1.FocusMonitor }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
182
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: WrInput, selector: "wr-input", inputs: { placeholder: "placeholder", prefix: "prefix", suffix: "suffix", passwordIcons: "passwordIcons", type: "type", inputmode: "inputmode", disabled: "disabled", readonly: "readonly", required: "required", autofocus: "autofocus", autocomplete: "autocomplete", value: "value" }, host: { properties: { "class": "this.elClasses" } }, providers: [
|
|
77
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
78
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.4", type: WrInputComponent, isStandalone: true, selector: "wr-input", inputs: { placeholder: "placeholder", prefix: "prefix", suffix: "suffix", rounded: ["rounded", "rounded", booleanAttribute], passwordIcons: ["passwordIcons", "passwordIcons", booleanAttribute], readonly: ["readonly", "readonly", booleanAttribute], type: "type" }, host: { properties: { "class": "this.elClasses" } }, providers: [
|
|
79
|
+
provideWrIcons([eye, eyeOff]),
|
|
183
80
|
{
|
|
184
81
|
provide: NG_VALUE_ACCESSOR,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
provide: NG_VALIDATORS,
|
|
190
|
-
useExisting: forwardRef(() => WrInput),
|
|
82
|
+
// eslint-disable-next-line @angular-eslint/no-forward-ref
|
|
83
|
+
useExisting: forwardRef(() => WrInputComponent),
|
|
191
84
|
multi: true,
|
|
192
85
|
},
|
|
193
|
-
],
|
|
86
|
+
], usesInheritance: true, ngImport: i0, template: "@if (prefix) {\n <div class=\"wr-input-prefix\">\n <span class=\"wr-input-prefix__text\">{{ prefix }}</span>\n </div>\n}\n\n<input\n class=\"wr-input__native\"\n [type]=\"type\"\n [placeholder]=\"placeholder\"\n [readonly]=\"readonly\"\n [formControl]=\"formControl\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false)\"\n/>\n\n@if (passwordIcons) {\n <div class=\"wr-input-icon\" [class.wr-input-icon--disabled]=\"formControl.disabled\" (click)=\"onPasswordVisibilityChange()\">\n <wr-icon class=\"wr-input-icon__icon\" [name]=\"eyeOn() ? 'eye' : 'eye-off'\" />\n </div>\n}\n\n@if (suffix) {\n <div class=\"wr-input-suffix\">\n <span class=\"wr-input-suffix__text\">{{ suffix }}</span>\n </div>\n}\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: WrIconComponent, selector: "wr-icon", inputs: ["name"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
194
87
|
}
|
|
195
|
-
|
|
196
|
-
InputBoolean()
|
|
197
|
-
], WrInput.prototype, "passwordIcons", void 0);
|
|
198
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: WrInput, decorators: [{
|
|
88
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrInputComponent, decorators: [{
|
|
199
89
|
type: Component,
|
|
200
|
-
args: [{ selector: 'wr-input',
|
|
90
|
+
args: [{ standalone: true, selector: 'wr-input', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [FormsModule, ReactiveFormsModule, WrIconComponent], providers: [
|
|
91
|
+
provideWrIcons([eye, eyeOff]),
|
|
201
92
|
{
|
|
202
93
|
provide: NG_VALUE_ACCESSOR,
|
|
203
|
-
|
|
94
|
+
// eslint-disable-next-line @angular-eslint/no-forward-ref
|
|
95
|
+
useExisting: forwardRef(() => WrInputComponent),
|
|
204
96
|
multi: true,
|
|
205
97
|
},
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
useExisting: forwardRef(() => WrInput),
|
|
209
|
-
multi: true,
|
|
210
|
-
},
|
|
211
|
-
], template: "<div class=\"wr-input-prefix\" *ngIf=\"prefix\">\n <span class=\"wr-input-prefix__text\">{{ prefix }}</span>\n</div>\n<div class=\"wr-input-el\">\n <div *ngIf=\"passwordIcons\" class=\"wr-input-el-icon\" (click)=\"onPasswordVisibilityChange()\">\n <wr-icon class=\"wr-input-el-icon__icon\" [name]=\"eyeOn ? 'eye' : 'eye-off'\"></wr-icon>\n </div>\n <input\n #inputElement\n class=\"wr-input-el__native\"\n [ngModel]=\"valueAsString\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [type]=\"type\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.inputmode]=\"inputmode\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n (ngModelChange)=\"value = $event\"\n />\n</div>\n<div class=\"wr-input-suffix\" *ngIf=\"suffix\">\n <span class=\"wr-input-suffix__text\">{{ suffix }}</span>\n</div>\n" }]
|
|
212
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i1.FocusMonitor }, { type: i0.NgZone }], propDecorators: { placeholder: [{
|
|
98
|
+
], template: "@if (prefix) {\n <div class=\"wr-input-prefix\">\n <span class=\"wr-input-prefix__text\">{{ prefix }}</span>\n </div>\n}\n\n<input\n class=\"wr-input__native\"\n [type]=\"type\"\n [placeholder]=\"placeholder\"\n [readonly]=\"readonly\"\n [formControl]=\"formControl\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false)\"\n/>\n\n@if (passwordIcons) {\n <div class=\"wr-input-icon\" [class.wr-input-icon--disabled]=\"formControl.disabled\" (click)=\"onPasswordVisibilityChange()\">\n <wr-icon class=\"wr-input-icon__icon\" [name]=\"eyeOn() ? 'eye' : 'eye-off'\" />\n </div>\n}\n\n@if (suffix) {\n <div class=\"wr-input-suffix\">\n <span class=\"wr-input-suffix__text\">{{ suffix }}</span>\n </div>\n}\n" }]
|
|
99
|
+
}], propDecorators: { placeholder: [{
|
|
213
100
|
type: Input
|
|
214
101
|
}], prefix: [{
|
|
215
102
|
type: Input
|
|
216
103
|
}], suffix: [{
|
|
217
104
|
type: Input
|
|
105
|
+
}], rounded: [{
|
|
106
|
+
type: Input,
|
|
107
|
+
args: [{ transform: booleanAttribute }]
|
|
218
108
|
}], passwordIcons: [{
|
|
219
|
-
type: Input
|
|
220
|
-
|
|
221
|
-
type: Input
|
|
222
|
-
}], inputmode: [{
|
|
223
|
-
type: Input
|
|
224
|
-
}], disabled: [{
|
|
225
|
-
type: Input
|
|
109
|
+
type: Input,
|
|
110
|
+
args: [{ transform: booleanAttribute }]
|
|
226
111
|
}], readonly: [{
|
|
112
|
+
type: Input,
|
|
113
|
+
args: [{ transform: booleanAttribute }]
|
|
114
|
+
}], type: [{
|
|
227
115
|
type: Input
|
|
228
|
-
}], required: [{
|
|
229
|
-
type: Input
|
|
230
|
-
}], autofocus: [{
|
|
231
|
-
type: Input
|
|
232
|
-
}], autocomplete: [{
|
|
233
|
-
type: Input
|
|
234
|
-
}], value: [{
|
|
235
|
-
type: Input
|
|
236
|
-
}], inputElement: [{
|
|
237
|
-
type: ViewChild,
|
|
238
|
-
args: ['inputElement', { static: true }]
|
|
239
116
|
}], elClasses: [{
|
|
240
117
|
type: HostBinding,
|
|
241
118
|
args: ['class']
|
|
242
119
|
}] } });
|
|
243
120
|
|
|
121
|
+
/**
|
|
122
|
+
* @license
|
|
123
|
+
*
|
|
124
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
125
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
126
|
+
*/
|
|
244
127
|
class WrInputModule {
|
|
245
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
246
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
247
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
128
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
129
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.4", ngImport: i0, type: WrInputModule, imports: [WrInputComponent], exports: [WrInputComponent] }); }
|
|
130
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrInputModule, imports: [WrInputComponent] }); }
|
|
248
131
|
}
|
|
249
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
132
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrInputModule, decorators: [{
|
|
250
133
|
type: NgModule,
|
|
251
134
|
args: [{
|
|
252
|
-
imports: [
|
|
253
|
-
|
|
254
|
-
exports: [WrInput],
|
|
135
|
+
imports: [WrInputComponent],
|
|
136
|
+
exports: [WrInputComponent],
|
|
255
137
|
}]
|
|
256
138
|
}] });
|
|
257
139
|
|
|
140
|
+
/**
|
|
141
|
+
* @license
|
|
142
|
+
*
|
|
143
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
144
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
145
|
+
*/
|
|
146
|
+
|
|
258
147
|
/**
|
|
259
148
|
* Generated bundle index. Do not edit.
|
|
260
149
|
*/
|
|
261
150
|
|
|
262
|
-
export {
|
|
151
|
+
export { WrInputComponent, WrInputModule };
|
|
263
152
|
//# sourceMappingURL=ngwr-input.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-input.mjs","sources":["../../../projects/lib/input/input.ts","../../../projects/lib/input/input.html","../../../projects/lib/input/input-module.ts","../../../projects/lib/input/ngwr-input.ts"],"sourcesContent":["import { FocusMonitor } from '@angular/cdk/a11y';\nimport { BooleanInput, coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n forwardRef,\n HostBinding,\n Input,\n NgZone,\n OnDestroy,\n OnInit,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n AbstractControl,\n ControlValueAccessor,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n ValidationErrors,\n Validator,\n} from '@angular/forms';\nimport { fromEvent } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { WrAbstractBase } from 'ngwr/core/abstract';\nimport { InputBoolean } from 'ngwr/core/decorators';\nimport { OnChangeType, OnTouchedType, SafeAny } from 'ngwr/core/types';\n\nimport { WrInputAutocomplete, WrInputModeType, WrInputType } from './input-types';\n\n@Component({\n selector: 'wr-input',\n exportAs: 'wrInput',\n templateUrl: './input.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => WrInput),\n multi: true,\n },\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => WrInput),\n multi: true,\n },\n ],\n})\nexport class WrInput\n extends WrAbstractBase\n implements ControlValueAccessor, AfterViewInit, OnInit, OnDestroy, Validator\n{\n @Input() placeholder: string = '';\n @Input() prefix: string | null = null;\n @Input() suffix: string | null = null;\n @Input() @InputBoolean() passwordIcons: BooleanInput = false;\n\n @Input()\n get type(): WrInputType {\n return this._type;\n }\n set type(type: WrInputType) {\n this._type = type;\n }\n @Input()\n get inputmode(): WrInputModeType {\n return this._mode;\n }\n set inputmode(mode: WrInputModeType) {\n this._mode = mode;\n }\n @Input()\n get disabled(): boolean {\n return this._disabled;\n }\n set disabled(disabled: BooleanInput) {\n this._disabled = coerceBooleanProperty(disabled);\n this.cdr.markForCheck();\n }\n @Input()\n get readonly(): boolean {\n return this._readonly;\n }\n set readonly(readonly: BooleanInput) {\n this._readonly = coerceBooleanProperty(readonly);\n }\n @Input()\n get required(): boolean {\n return this._required;\n }\n set required(required: BooleanInput) {\n this._required = coerceBooleanProperty(required);\n }\n @Input()\n get autofocus(): boolean {\n return this._autofocus;\n }\n set autofocus(autofocus: BooleanInput) {\n this._autofocus = coerceBooleanProperty(autofocus);\n }\n @Input()\n get autocomplete(): WrInputAutocomplete {\n return this._autocomplete;\n }\n set autocomplete(autofocus: WrInputAutocomplete) {\n this._autocomplete = autofocus;\n }\n @Input()\n get value(): string | number {\n return this.type === 'number' ? this.valueAsNumber : this._value;\n }\n set value(val: string | number) {\n if (val !== this._value) {\n this._value = val;\n this.onChangeCallback(this.value);\n }\n }\n get valueAsString(): string {\n if (this._value == null || typeof this._value === 'undefined') return '';\n return String(this._value);\n }\n get valueAsNumber(): number {\n return coerceNumberProperty(this._value);\n }\n\n get isBadInput(): boolean {\n const validity = this.inputElement?.nativeElement?.validity;\n return validity && validity.badInput;\n }\n\n @ViewChild('inputElement', { static: true }) inputElement!: ElementRef<HTMLInputElement>;\n @HostBinding('class')\n get elClasses(): SafeAny {\n return {\n 'wr-input': true,\n 'wr-input--has-prefix': this.prefix,\n 'wr-input--has-suffix': this.suffix,\n 'wr-input--password': this.passwordIcons,\n 'wr-input--disabled': this.disabled,\n };\n }\n\n eyeOn = true;\n private _value: string | number = '';\n private _disabled: boolean = false;\n private _readonly: boolean = false;\n private _required: boolean = false;\n private _autofocus: boolean = false;\n private _focused: boolean = false;\n private _autocomplete: WrInputAutocomplete = 'off';\n private _type: WrInputType = 'text';\n private _mode: WrInputModeType = 'text';\n private onChangeCallback: OnChangeType = () => {};\n private onTouchedCallback: OnTouchedType = () => {};\n\n constructor(\n private readonly cdr: ChangeDetectorRef,\n private readonly elRef: ElementRef<HTMLInputElement>,\n private readonly focusMonitor: FocusMonitor,\n private readonly ngZone: NgZone\n ) {\n super();\n }\n\n ngOnInit(): void {\n this.ngZone.runOutsideAngular(() => {\n fromEvent<MouseEvent>(this.elRef.nativeElement, 'click')\n .pipe(takeUntil(this.destroyed$))\n .subscribe(event => {\n event.preventDefault();\n this.onFocus();\n if (this.disabled) {\n event.stopImmediatePropagation();\n return;\n }\n });\n fromEvent(this.inputElement.nativeElement, 'click')\n .pipe(takeUntil(this.destroyed$))\n .subscribe(event => event.stopPropagation());\n });\n }\n\n ngAfterViewInit(): void {\n if (this.autofocus) {\n this.onFocus();\n this.cdr.markForCheck();\n }\n }\n\n override ngOnDestroy(): void {\n super.ngOnDestroy();\n this.focusMonitor.stopMonitoring(this.elRef);\n }\n\n onFocus(event?: FocusEvent): void {\n if (event) {\n event.stopPropagation();\n }\n this._focused = true;\n this.focusMonitor.focusVia(this.inputElement, 'keyboard');\n }\n\n onBlur(event?: Event): void {\n if (event) {\n event.stopPropagation();\n }\n this._focused = false;\n // this.inputElement.nativeElement.blur();\n this.onTouchedCallback();\n }\n\n validate(control: AbstractControl): ValidationErrors | null {\n return {\n ...(this.isBadInput ? { badInput: true } : null),\n };\n }\n\n writeValue(value: string): void {\n if (value !== this._value) {\n this._value = value;\n }\n this.cdr.markForCheck();\n }\n\n registerOnChange(fn: OnChangeType): void {\n this.onChangeCallback = fn;\n }\n\n registerOnTouched(fn: OnTouchedType): void {\n this.onTouchedCallback = fn;\n }\n\n onPasswordVisibilityChange(): void {\n this.type === 'password' ? (this.type = 'text') : (this.type = 'password');\n this.eyeOn = !this.eyeOn;\n this.onFocus();\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = coerceBooleanProperty(isDisabled);\n }\n}\n","<div class=\"wr-input-prefix\" *ngIf=\"prefix\">\n <span class=\"wr-input-prefix__text\">{{ prefix }}</span>\n</div>\n<div class=\"wr-input-el\">\n <div *ngIf=\"passwordIcons\" class=\"wr-input-el-icon\" (click)=\"onPasswordVisibilityChange()\">\n <wr-icon class=\"wr-input-el-icon__icon\" [name]=\"eyeOn ? 'eye' : 'eye-off'\"></wr-icon>\n </div>\n <input\n #inputElement\n class=\"wr-input-el__native\"\n [ngModel]=\"valueAsString\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [type]=\"type\"\n [attr.autocomplete]=\"autocomplete\"\n [attr.inputmode]=\"inputmode\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n (ngModelChange)=\"value = $event\"\n />\n</div>\n<div class=\"wr-input-suffix\" *ngIf=\"suffix\">\n <span class=\"wr-input-suffix__text\">{{ suffix }}</span>\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\nimport { WrIconModule } from 'ngwr/icon';\n\nimport { WrInput } from './input';\n\n@NgModule({\n imports: [CommonModule, FormsModule, WrIconModule],\n declarations: [WrInput],\n exports: [WrInput],\n})\nexport class WrInputModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\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AY,EAAE,WAAW,EAAE,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAItC,aAAa,EAAA,UAAA,EAAA,CAAA;kBALzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,YAAY,CAAC;oBAClD,YAAY,EAAE,CAAC,OAAO,CAAC;oBACvB,OAAO,EAAE,CAAC,OAAO,CAAC;AACnB,iBAAA,CAAA;;;ACZD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngwr-input.mjs","sources":["../../../projects/lib/input/input.component.ts","../../../projects/lib/input/input.component.html","../../../projects/lib/input/input.module.ts","../../../projects/lib/input/public-api.ts","../../../projects/lib/input/ngwr-input.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n forwardRef,\n HostBinding,\n Input,\n OnInit,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport { ControlValueAccessor, FormControl, FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';\n\nimport { debounceTime, noop, takeUntil, tap } from 'rxjs';\n\nimport { WrAbstractBase } from 'ngwr/cdk';\nimport { SafeAny } from 'ngwr/cdk/types';\nimport { provideWrIcons, WrIconComponent, eye, eyeOff } from 'ngwr/icon';\n\nimport { WrInputType } from './input-types';\n\n/**\n * NGWR input component.\n *\n * {@tutorial} [How to use wr-alert]{@link http://ngwr.dev/docs/components/input}\n */\n@Component({\n standalone: true,\n selector: 'wr-input',\n templateUrl: './input.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [FormsModule, ReactiveFormsModule, WrIconComponent],\n providers: [\n provideWrIcons([eye, eyeOff]),\n {\n provide: NG_VALUE_ACCESSOR,\n // eslint-disable-next-line @angular-eslint/no-forward-ref\n useExisting: forwardRef(() => WrInputComponent),\n multi: true,\n },\n ],\n})\nexport class WrInputComponent extends WrAbstractBase implements ControlValueAccessor, OnInit {\n formControl: FormControl = new FormControl();\n protected readonly eyeOn = signal(true);\n protected readonly isFocused = signal(false);\n\n onChange: (value: string) => void = noop;\n onTouch: () => void = noop;\n\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouch = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n if (isDisabled) {\n return this.formControl.disable();\n }\n return this.formControl.enable();\n }\n\n writeValue(value: string): void {\n this.formControl.setValue(value, { emitEvent: false });\n }\n\n ngOnInit(): void {\n this.formControl.valueChanges\n .pipe(\n debounceTime(200),\n tap(value => this.onChange(value)),\n takeUntil(this.destroyed$)\n )\n .subscribe();\n }\n\n @Input() placeholder = '';\n @Input() prefix: string | null = null;\n @Input() suffix: string | null = null;\n @Input({ transform: booleanAttribute }) rounded = false;\n @Input({ transform: booleanAttribute }) passwordIcons = false;\n @Input({ transform: booleanAttribute }) readonly = false;\n @Input() type: WrInputType = 'text';\n\n @HostBinding('class')\n get elClasses(): SafeAny {\n return {\n 'wr-input': true,\n 'wr-input--rounded': this.rounded,\n 'wr-input--has-prefix': this.prefix,\n 'wr-input--has-suffix': this.suffix,\n 'wr-input--password': this.passwordIcons,\n 'wr-input--disabled': this.formControl.disabled,\n 'wr-input--focused': this.isFocused(),\n };\n }\n\n onPasswordVisibilityChange(): void {\n if (this.type === 'password') {\n this.type = 'text';\n this.eyeOn.set(false);\n } else {\n this.type = 'password';\n this.eyeOn.set(true);\n }\n }\n}\n","@if (prefix) {\n <div class=\"wr-input-prefix\">\n <span class=\"wr-input-prefix__text\">{{ prefix }}</span>\n </div>\n}\n\n<input\n class=\"wr-input__native\"\n [type]=\"type\"\n [placeholder]=\"placeholder\"\n [readonly]=\"readonly\"\n [formControl]=\"formControl\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false)\"\n/>\n\n@if (passwordIcons) {\n <div class=\"wr-input-icon\" [class.wr-input-icon--disabled]=\"formControl.disabled\" (click)=\"onPasswordVisibilityChange()\">\n <wr-icon class=\"wr-input-icon__icon\" [name]=\"eyeOn() ? 'eye' : 'eye-off'\" />\n </div>\n}\n\n@if (suffix) {\n <div class=\"wr-input-suffix\">\n <span class=\"wr-input-suffix__text\">{{ suffix }}</span>\n </div>\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\nimport { NgModule } from '@angular/core';\n\nimport { WrInputComponent } from './input.component';\n\n@NgModule({\n imports: [WrInputComponent],\n exports: [WrInputComponent],\n})\nexport class WrInputModule {}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport * from './input-types';\nexport * from './input.component';\nexport * from './input.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;AAKG;AAuBH;;;;AAIG;AAkBG,MAAO,gBAAiB,SAAQ,cAAc,CAAA;AAjBpD,IAAA,WAAA,GAAA;;AAkBE,QAAA,IAAA,CAAA,WAAW,GAAgB,IAAI,WAAW,EAAE,CAAC;AAC1B,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AACrB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAE7C,IAAQ,CAAA,QAAA,GAA4B,IAAI,CAAC;QACzC,IAAO,CAAA,OAAA,GAAe,IAAI,CAAC;QA+BlB,IAAW,CAAA,WAAA,GAAG,EAAE,CAAC;QACjB,IAAM,CAAA,MAAA,GAAkB,IAAI,CAAC;QAC7B,IAAM,CAAA,MAAA,GAAkB,IAAI,CAAC;QACE,IAAO,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BAAgB,EAAE,CAAA;gBACE,aAAa,EAAA,CAAA;sBAApD,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAA;gBACE,QAAQ,EAAA,CAAA;sBAA/C,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAA;gBAC7B,IAAI,EAAA,CAAA;sBAAZ,KAAK;gBAGF,SAAS,EAAA,CAAA;sBADZ,WAAW;uBAAC,OAAO,CAAA;;;AE/FtB;;;;;AAKG;MASU,aAAa,CAAA;8GAAb,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;+GAAb,aAAa,EAAA,OAAA,EAAA,CAHd,gBAAgB,CAAA,EAAA,OAAA,EAAA,CAChB,gBAAgB,CAAA,EAAA,CAAA,CAAA,EAAA;AAEf,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,YAHd,gBAAgB,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAGf,aAAa,EAAA,UAAA,EAAA,CAAA;kBAJzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,OAAO,EAAE,CAAC,gBAAgB,CAAC;AAC5B,iBAAA,CAAA;;;ACbD;;;;;AAKG;;ACLH;;AAEG;;;;"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Pipe, NgModule } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @license
|
|
6
|
+
*
|
|
7
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
8
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
9
|
+
*/
|
|
10
|
+
class NewArrayPipe {
|
|
11
|
+
transform(arrayLength) {
|
|
12
|
+
return new Array(arrayLength);
|
|
13
|
+
}
|
|
14
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: NewArrayPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
15
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.0.4", ngImport: i0, type: NewArrayPipe, isStandalone: true, name: "newArray" }); }
|
|
16
|
+
}
|
|
17
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: NewArrayPipe, decorators: [{
|
|
18
|
+
type: Pipe,
|
|
19
|
+
args: [{
|
|
20
|
+
standalone: true,
|
|
21
|
+
name: 'newArray',
|
|
22
|
+
}]
|
|
23
|
+
}] });
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @license
|
|
27
|
+
*
|
|
28
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
29
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
30
|
+
*/
|
|
31
|
+
class WrPipesModule {
|
|
32
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrPipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
33
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.4", ngImport: i0, type: WrPipesModule, imports: [NewArrayPipe], exports: [NewArrayPipe] }); }
|
|
34
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrPipesModule }); }
|
|
35
|
+
}
|
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrPipesModule, decorators: [{
|
|
37
|
+
type: NgModule,
|
|
38
|
+
args: [{
|
|
39
|
+
imports: [NewArrayPipe],
|
|
40
|
+
exports: [NewArrayPipe],
|
|
41
|
+
}]
|
|
42
|
+
}] });
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @license
|
|
46
|
+
*
|
|
47
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
48
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Generated bundle index. Do not edit.
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
export { NewArrayPipe, WrPipesModule };
|
|
56
|
+
//# sourceMappingURL=ngwr-pipes.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngwr-pipes.mjs","sources":["../../../projects/lib/pipes/new-array.pipe.ts","../../../projects/lib/pipes/pipes.module.ts","../../../projects/lib/pipes/public-api.ts","../../../projects/lib/pipes/ngwr-pipes.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n standalone: true,\n name: 'newArray',\n})\nexport class NewArrayPipe implements PipeTransform {\n transform(arrayLength: number): number[] {\n return new Array(arrayLength);\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { NgModule } from '@angular/core';\n\nimport { NewArrayPipe } from './new-array.pipe';\n\n@NgModule({\n imports: [NewArrayPipe],\n exports: [NewArrayPipe],\n})\nexport class WrPipesModule {}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport * from './new-array.pipe';\nexport * from './pipes.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAAA;;;;;AAKG;MAQU,YAAY,CAAA;AACvB,IAAA,SAAS,CAAC,WAAmB,EAAA;AAC3B,QAAA,OAAO,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC;KAC/B;8GAHU,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA,EAAA;4GAAZ,YAAY,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,UAAA,EAAA,CAAA,CAAA,EAAA;;2FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBAJxB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE,UAAU;AACjB,iBAAA,CAAA;;;ACZD;;;;;AAKG;MAUU,aAAa,CAAA;8GAAb,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;+GAAb,aAAa,EAAA,OAAA,EAAA,CAHd,YAAY,CAAA,EAAA,OAAA,EAAA,CACZ,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;+GAEX,aAAa,EAAA,CAAA,CAAA,EAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBAJzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,OAAO,EAAE,CAAC,YAAY,CAAC;AACxB,iBAAA,CAAA;;;ACdD;;;;;AAKG;;ACLH;;AAEG;;;;"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { numberAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding, NgModule } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @license
|
|
6
|
+
*
|
|
7
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
8
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
9
|
+
*/
|
|
10
|
+
class WrProgressComponent {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.color = null;
|
|
13
|
+
this.percent = 0;
|
|
14
|
+
}
|
|
15
|
+
get elClasses() {
|
|
16
|
+
return {
|
|
17
|
+
'wr-progress': true,
|
|
18
|
+
'wr-progress--color-primary': this.color === 'primary',
|
|
19
|
+
'wr-progress--color-secondary': this.color === 'secondary',
|
|
20
|
+
'wr-progress--color-success': this.color === 'success',
|
|
21
|
+
'wr-progress--color-warning': this.color === 'warning',
|
|
22
|
+
'wr-progress--color-danger': this.color === 'danger',
|
|
23
|
+
'wr-progress--color-light': this.color === 'light',
|
|
24
|
+
'wr-progress--color-medium': this.color === 'medium',
|
|
25
|
+
'wr-progress--color-dark': this.color === 'dark',
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrProgressComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
29
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.0.4", type: WrProgressComponent, isStandalone: true, selector: "wr-progress", inputs: { color: "color", percent: ["percent", "percent", numberAttribute] }, host: { properties: { "class": "this.elClasses" } }, ngImport: i0, template: "<div class=\"wr-progress__bg\" [style.width.%]=\"percent\"></div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
30
|
+
}
|
|
31
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrProgressComponent, decorators: [{
|
|
32
|
+
type: Component,
|
|
33
|
+
args: [{ standalone: true, selector: 'wr-progress', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"wr-progress__bg\" [style.width.%]=\"percent\"></div>\n" }]
|
|
34
|
+
}], propDecorators: { color: [{
|
|
35
|
+
type: Input
|
|
36
|
+
}], percent: [{
|
|
37
|
+
type: Input,
|
|
38
|
+
args: [{ transform: numberAttribute }]
|
|
39
|
+
}], elClasses: [{
|
|
40
|
+
type: HostBinding,
|
|
41
|
+
args: ['class']
|
|
42
|
+
}] } });
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @license
|
|
46
|
+
*
|
|
47
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
48
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
49
|
+
*/
|
|
50
|
+
class WrProgressModule {
|
|
51
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrProgressModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
52
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.4", ngImport: i0, type: WrProgressModule, imports: [WrProgressComponent], exports: [WrProgressComponent] }); }
|
|
53
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrProgressModule }); }
|
|
54
|
+
}
|
|
55
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImport: i0, type: WrProgressModule, decorators: [{
|
|
56
|
+
type: NgModule,
|
|
57
|
+
args: [{
|
|
58
|
+
imports: [WrProgressComponent],
|
|
59
|
+
exports: [WrProgressComponent],
|
|
60
|
+
}]
|
|
61
|
+
}] });
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @license
|
|
65
|
+
*
|
|
66
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
67
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
68
|
+
*/
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Generated bundle index. Do not edit.
|
|
72
|
+
*/
|
|
73
|
+
|
|
74
|
+
export { WrProgressComponent, WrProgressModule };
|
|
75
|
+
//# sourceMappingURL=ngwr-progress.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngwr-progress.mjs","sources":["../../../projects/lib/progress/progress.component.ts","../../../projects/lib/progress/progress.component.html","../../../projects/lib/progress/progress.module.ts","../../../projects/lib/progress/public-api.ts","../../../projects/lib/progress/ngwr-progress.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ChangeDetectionStrategy, Component, HostBinding, Input, numberAttribute, ViewEncapsulation } from '@angular/core';\n\nimport { SafeAny, WrThemeColor } from 'ngwr/cdk/types';\n\n@Component({\n standalone: true,\n selector: 'wr-progress',\n templateUrl: './progress.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class WrProgressComponent {\n @Input() color: WrThemeColor | null = null;\n @Input({ transform: numberAttribute }) percent: number = 0;\n\n @HostBinding('class')\n get elClasses(): SafeAny {\n return {\n 'wr-progress': true,\n 'wr-progress--color-primary': this.color === 'primary',\n 'wr-progress--color-secondary': this.color === 'secondary',\n 'wr-progress--color-success': this.color === 'success',\n 'wr-progress--color-warning': this.color === 'warning',\n 'wr-progress--color-danger': this.color === 'danger',\n 'wr-progress--color-light': this.color === 'light',\n 'wr-progress--color-medium': this.color === 'medium',\n 'wr-progress--color-dark': this.color === 'dark',\n };\n }\n}\n","<div class=\"wr-progress__bg\" [style.width.%]=\"percent\"></div>\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { NgModule } from '@angular/core';\n\nimport { WrProgressComponent } from './progress.component';\n\n@NgModule({\n imports: [WrProgressComponent],\n exports: [WrProgressComponent],\n})\nexport class WrProgressModule {}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport * from './progress.component';\nexport * from './progress.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAAA;;;;;AAKG;MAaU,mBAAmB,CAAA;AAPhC,IAAA,WAAA,GAAA;QAQW,IAAK,CAAA,KAAA,GAAwB,IAAI,CAAC;QACJ,IAAO,CAAA,OAAA,GAAW,CAAC,CAAC;AAgB5D,KAAA;AAdC,IAAA,IACI,SAAS,GAAA;QACX,OAAO;AACL,YAAA,aAAa,EAAE,IAAI;AACnB,YAAA,4BAA4B,EAAE,IAAI,CAAC,KAAK,KAAK,SAAS;AACtD,YAAA,8BAA8B,EAAE,IAAI,CAAC,KAAK,KAAK,WAAW;AAC1D,YAAA,4BAA4B,EAAE,IAAI,CAAC,KAAK,KAAK,SAAS;AACtD,YAAA,4BAA4B,EAAE,IAAI,CAAC,KAAK,KAAK,SAAS;AACtD,YAAA,2BAA2B,EAAE,IAAI,CAAC,KAAK,KAAK,QAAQ;AACpD,YAAA,0BAA0B,EAAE,IAAI,CAAC,KAAK,KAAK,OAAO;AAClD,YAAA,2BAA2B,EAAE,IAAI,CAAC,KAAK,KAAK,QAAQ;AACpD,YAAA,yBAAyB,EAAE,IAAI,CAAC,KAAK,KAAK,MAAM;SACjD,CAAC;KACH;8GAjBU,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;kGAAnB,mBAAmB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAA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