primekit 1.0.11 → 1.0.13
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 +25 -25
- package/esm2022/lib/lib/atomix-alert/atomix-alert.component.mjs +76 -0
- package/esm2022/lib/lib/atomix-autocomplete/atomix-autocomplete.component.mjs +108 -0
- package/esm2022/lib/lib/atomix-button/atomix-button.component.mjs +49 -0
- package/esm2022/lib/lib/atomix-button/atomix-button.models.mjs +2 -0
- package/esm2022/lib/lib/atomix-calendar/atomix-calendar.component.mjs +90 -0
- package/esm2022/lib/lib/atomix-card/atomix-card.component.mjs +24 -0
- package/esm2022/lib/lib/atomix-confirmation-dialog/atomix-confirmation-dialog.component.mjs +28 -0
- package/esm2022/lib/lib/atomix-daterange-calendar/atomix-daterange-calendar.component.mjs +717 -0
- package/esm2022/lib/lib/atomix-divider/atomix-divider.component.mjs +27 -0
- package/esm2022/lib/lib/atomix-dropdown/atomix-dropdown.component.mjs +105 -0
- package/esm2022/lib/lib/atomix-dynamic-dialog/atomix-dynamic-dialog.component.mjs +38 -0
- package/esm2022/lib/lib/atomix-dynamic-dialog/atomix-dynamic-dialog.models.mjs +2 -0
- package/esm2022/lib/lib/atomix-form/atomix-form-autocomplete/atomix-form-autocomplete.component.mjs +67 -0
- package/esm2022/lib/lib/atomix-form/atomix-form-calendar/atomix-form-calendar.component.mjs +59 -0
- package/esm2022/lib/lib/atomix-form/atomix-form-checkbox/atomix-form-checkbox.component.mjs +48 -0
- package/esm2022/lib/lib/atomix-form/atomix-form-chips/atomix-form-chips.component.mjs +54 -0
- package/esm2022/lib/lib/atomix-form/atomix-form-chips/form.chips.models.mjs +2 -0
- package/esm2022/lib/lib/atomix-form/atomix-form-dropdown/atomix-form-dropdown.component.mjs +70 -0
- package/esm2022/lib/lib/atomix-form/atomix-form-input-component/atomix-form-input-component.component.mjs +80 -0
- package/esm2022/lib/lib/atomix-form/atomix-form-inputmask-component/atomix-form-inputmask-component.component.mjs +48 -0
- package/esm2022/lib/lib/atomix-form/atomix-form-password-component/atomix-form-password-component.component.mjs +48 -0
- package/esm2022/lib/lib/atomix-form/atomix-form-radio-button/atomix-radio-button.component.mjs +46 -0
- package/esm2022/lib/lib/atomix-form/atomix-form-textarea/atomix-form-textarea.component.mjs +46 -0
- package/esm2022/lib/lib/atomix-input/atomix-input.component.mjs +94 -0
- package/esm2022/lib/lib/atomix-input-switch/atomix-input-switch.component.mjs +85 -0
- package/esm2022/lib/lib/atomix-loading-overlay/atomix-loading-overlay.component.mjs +44 -0
- package/esm2022/lib/lib/atomix-messages/messages.component.mjs +33 -0
- package/esm2022/lib/lib/atomix-pagination/atomix-pagination.component.mjs +48 -0
- package/esm2022/lib/lib/atomix-radio-button/atomix-radio-button.component.mjs +50 -0
- package/esm2022/lib/lib/atomix-search-dropdown/atomix-search-dropdown.component.mjs +149 -0
- package/esm2022/lib/lib/atomix-select-button/atomix-select-button-models.mjs +2 -0
- package/esm2022/lib/lib/atomix-select-button/atomix-select-button.component.mjs +25 -0
- package/esm2022/lib/lib/atomix-snackbar/atomix-snackbar.component.mjs +29 -0
- package/esm2022/lib/lib/atomix-spinner/atomix-spinner.component.mjs +24 -0
- package/esm2022/lib/lib/atomix-steps/atomix-steps.component.mjs +41 -0
- package/esm2022/lib/lib/atomix-tabMenu/atomix-tabMenu.component.mjs +51 -0
- package/esm2022/lib/lib/atomix-table/atomix-table.component.mjs +454 -0
- package/esm2022/lib/lib/atomix-table/atomix-table.models.mjs +2 -0
- package/esm2022/lib/lib/atomix-tag/atomix-tag.component.mjs +24 -0
- package/esm2022/lib/lib/utils/prime-icons.util.mjs +10 -0
- package/esm2022/lib/primekit.component.mjs +11 -0
- package/esm2022/lib/primekit.module.mjs +322 -0
- package/esm2022/lib/primekit.service.mjs +14 -0
- package/esm2022/primekit.mjs +5 -0
- package/esm2022/public-api.mjs +44 -0
- package/fesm2022/primekit.mjs +3158 -0
- package/fesm2022/primekit.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/lib/atomix-alert/atomix-alert.component.d.ts +22 -0
- package/lib/lib/atomix-autocomplete/atomix-autocomplete.component.d.ts +34 -0
- package/lib/lib/atomix-button/atomix-button.component.d.ts +19 -0
- package/{src/lib/lib/atomix-button/atomix-button.models.ts → lib/lib/atomix-button/atomix-button.models.d.ts} +2 -2
- package/lib/lib/atomix-calendar/atomix-calendar.component.d.ts +27 -0
- package/lib/lib/atomix-card/atomix-card.component.d.ts +9 -0
- package/lib/lib/atomix-confirmation-dialog/atomix-confirmation-dialog.component.d.ts +12 -0
- package/lib/lib/atomix-daterange-calendar/atomix-daterange-calendar.component.d.ts +79 -0
- package/lib/lib/atomix-divider/atomix-divider.component.d.ts +12 -0
- package/lib/lib/atomix-dropdown/atomix-dropdown.component.d.ts +50 -0
- package/lib/lib/atomix-dynamic-dialog/atomix-dynamic-dialog.component.d.ts +15 -0
- package/lib/lib/atomix-dynamic-dialog/atomix-dynamic-dialog.models.d.ts +11 -0
- package/lib/lib/atomix-form/atomix-form-autocomplete/atomix-form-autocomplete.component.d.ts +25 -0
- package/lib/lib/atomix-form/atomix-form-calendar/atomix-form-calendar.component.d.ts +23 -0
- package/lib/lib/atomix-form/atomix-form-checkbox/atomix-form-checkbox.component.d.ts +18 -0
- package/lib/lib/atomix-form/atomix-form-chips/atomix-form-chips.component.d.ts +19 -0
- package/lib/lib/atomix-form/atomix-form-chips/form.chips.models.d.ts +5 -0
- package/lib/lib/atomix-form/atomix-form-dropdown/atomix-form-dropdown.component.d.ts +25 -0
- package/lib/lib/atomix-form/atomix-form-input-component/atomix-form-input-component.component.d.ts +28 -0
- package/lib/lib/atomix-form/atomix-form-inputmask-component/atomix-form-inputmask-component.component.d.ts +17 -0
- package/lib/lib/atomix-form/atomix-form-password-component/atomix-form-password-component.component.d.ts +17 -0
- package/lib/lib/atomix-form/atomix-form-radio-button/atomix-radio-button.component.d.ts +19 -0
- package/lib/lib/atomix-form/atomix-form-textarea/atomix-form-textarea.component.d.ts +17 -0
- package/lib/lib/atomix-input/atomix-input.component.d.ts +29 -0
- package/lib/lib/atomix-input-switch/atomix-input-switch.component.d.ts +30 -0
- package/lib/lib/atomix-loading-overlay/atomix-loading-overlay.component.d.ts +16 -0
- package/lib/lib/atomix-messages/messages.component.d.ts +13 -0
- package/lib/lib/atomix-pagination/atomix-pagination.component.d.ts +19 -0
- package/lib/lib/atomix-radio-button/atomix-radio-button.component.d.ts +15 -0
- package/lib/lib/atomix-search-dropdown/atomix-search-dropdown.component.d.ts +60 -0
- package/{src/lib/lib/atomix-select-button/atomix-select-button-models.ts → lib/lib/atomix-select-button/atomix-select-button-models.d.ts} +4 -4
- package/lib/lib/atomix-select-button/atomix-select-button.component.d.ts +12 -0
- package/lib/lib/atomix-snackbar/atomix-snackbar.component.d.ts +12 -0
- package/lib/lib/atomix-spinner/atomix-spinner.component.d.ts +9 -0
- package/lib/lib/atomix-steps/atomix-steps.component.d.ts +19 -0
- package/lib/lib/atomix-tabMenu/atomix-tabMenu.component.d.ts +19 -0
- package/lib/lib/atomix-table/atomix-table.component.d.ts +119 -0
- package/lib/lib/atomix-table/atomix-table.models.d.ts +43 -0
- package/lib/lib/atomix-tag/atomix-tag.component.d.ts +9 -0
- package/lib/lib/utils/prime-icons.util.d.ts +3 -0
- package/lib/primekit.component.d.ts +5 -0
- package/lib/primekit.module.d.ts +72 -0
- package/lib/primekit.service.d.ts +6 -0
- package/package.json +28 -15
- package/{src/public-api.ts → public-api.d.ts} +38 -47
- package/src/assets/images/empty-table.svg +25 -25
- package/ng-package.json +0 -8
- package/src/lib/lib/atomix-alert/atomix-alert.component.css +0 -67
- package/src/lib/lib/atomix-alert/atomix-alert.component.html +0 -7
- package/src/lib/lib/atomix-alert/atomix-alert.component.spec.ts +0 -154
- package/src/lib/lib/atomix-alert/atomix-alert.component.ts +0 -75
- package/src/lib/lib/atomix-autocomplete/atomix-autocomplete.component.html +0 -35
- package/src/lib/lib/atomix-autocomplete/atomix-autocomplete.component.scss +0 -72
- package/src/lib/lib/atomix-autocomplete/atomix-autocomplete.component.spec.ts +0 -210
- package/src/lib/lib/atomix-autocomplete/atomix-autocomplete.component.ts +0 -70
- package/src/lib/lib/atomix-button/atomix-button.component.css +0 -70
- package/src/lib/lib/atomix-button/atomix-button.component.html +0 -20
- package/src/lib/lib/atomix-button/atomix-button.component.spec.ts +0 -135
- package/src/lib/lib/atomix-button/atomix-button.component.ts +0 -28
- package/src/lib/lib/atomix-calendar/atomix-calendar.component.css +0 -5
- package/src/lib/lib/atomix-calendar/atomix-calendar.component.html +0 -20
- package/src/lib/lib/atomix-calendar/atomix-calendar.component.spec.ts +0 -145
- package/src/lib/lib/atomix-calendar/atomix-calendar.component.ts +0 -71
- package/src/lib/lib/atomix-card/atomix-card.component.css +0 -4
- package/src/lib/lib/atomix-card/atomix-card.component.html +0 -3
- package/src/lib/lib/atomix-card/atomix-card.component.spec.ts +0 -63
- package/src/lib/lib/atomix-card/atomix-card.component.ts +0 -13
- package/src/lib/lib/atomix-confirmation-dialog/atomix-confirmation-dialog.component.css +0 -12
- package/src/lib/lib/atomix-confirmation-dialog/atomix-confirmation-dialog.component.html +0 -9
- package/src/lib/lib/atomix-confirmation-dialog/atomix-confirmation-dialog.component.spec.ts +0 -63
- package/src/lib/lib/atomix-confirmation-dialog/atomix-confirmation-dialog.component.ts +0 -22
- package/src/lib/lib/atomix-daterange-calendar/atomix-daterange-calendar.component.html +0 -233
- package/src/lib/lib/atomix-daterange-calendar/atomix-daterange-calendar.component.scss +0 -266
- package/src/lib/lib/atomix-daterange-calendar/atomix-daterange-calendar.component.spec.ts +0 -1465
- package/src/lib/lib/atomix-daterange-calendar/atomix-daterange-calendar.component.ts +0 -717
- package/src/lib/lib/atomix-divider/atomix-divider.component.css +0 -0
- package/src/lib/lib/atomix-divider/atomix-divider.component.html +0 -7
- package/src/lib/lib/atomix-divider/atomix-divider.component.spec.ts +0 -91
- package/src/lib/lib/atomix-divider/atomix-divider.component.ts +0 -17
- package/src/lib/lib/atomix-dropdown/atomix-dropdown.component.css +0 -25
- package/src/lib/lib/atomix-dropdown/atomix-dropdown.component.html +0 -37
- package/src/lib/lib/atomix-dropdown/atomix-dropdown.component.spec.ts +0 -178
- package/src/lib/lib/atomix-dropdown/atomix-dropdown.component.ts +0 -89
- package/src/lib/lib/atomix-dynamic-dialog/atomix-dynamic-dialog.component.css +0 -0
- package/src/lib/lib/atomix-dynamic-dialog/atomix-dynamic-dialog.component.html +0 -0
- package/src/lib/lib/atomix-dynamic-dialog/atomix-dynamic-dialog.component.spec.ts +0 -128
- package/src/lib/lib/atomix-dynamic-dialog/atomix-dynamic-dialog.component.ts +0 -42
- package/src/lib/lib/atomix-dynamic-dialog/atomix-dynamic-dialog.models.ts +0 -12
- package/src/lib/lib/atomix-form/atomix-form-autocomplete/atomix-form-autocomplete.component.html +0 -20
- package/src/lib/lib/atomix-form/atomix-form-autocomplete/atomix-form-autocomplete.component.scss +0 -7
- package/src/lib/lib/atomix-form/atomix-form-autocomplete/atomix-form-autocomplete.component.spec.ts +0 -169
- package/src/lib/lib/atomix-form/atomix-form-autocomplete/atomix-form-autocomplete.component.ts +0 -41
- package/src/lib/lib/atomix-form/atomix-form-calendar/atomix-form-calendar.component.html +0 -21
- package/src/lib/lib/atomix-form/atomix-form-calendar/atomix-form-calendar.component.scss +0 -7
- package/src/lib/lib/atomix-form/atomix-form-calendar/atomix-form-calendar.component.spec.ts +0 -142
- package/src/lib/lib/atomix-form/atomix-form-calendar/atomix-form-calendar.component.ts +0 -32
- package/src/lib/lib/atomix-form/atomix-form-checkbox/atomix-form-checkbox.component.html +0 -13
- package/src/lib/lib/atomix-form/atomix-form-checkbox/atomix-form-checkbox.component.scss +0 -14
- package/src/lib/lib/atomix-form/atomix-form-checkbox/atomix-form-checkbox.component.spec.ts +0 -112
- package/src/lib/lib/atomix-form/atomix-form-checkbox/atomix-form-checkbox.component.ts +0 -28
- package/src/lib/lib/atomix-form/atomix-form-chips/atomix-form-chips.component.html +0 -20
- package/src/lib/lib/atomix-form/atomix-form-chips/atomix-form-chips.component.scss +0 -3
- package/src/lib/lib/atomix-form/atomix-form-chips/atomix-form-chips.component.spec.ts +0 -153
- package/src/lib/lib/atomix-form/atomix-form-chips/atomix-form-chips.component.ts +0 -28
- package/src/lib/lib/atomix-form/atomix-form-chips/form.chips.models.ts +0 -5
- package/src/lib/lib/atomix-form/atomix-form-dropdown/atomix-form-dropdown.component.html +0 -24
- package/src/lib/lib/atomix-form/atomix-form-dropdown/atomix-form-dropdown.component.scss +0 -15
- package/src/lib/lib/atomix-form/atomix-form-dropdown/atomix-form-dropdown.component.spec.ts +0 -156
- package/src/lib/lib/atomix-form/atomix-form-dropdown/atomix-form-dropdown.component.ts +0 -36
- package/src/lib/lib/atomix-form/atomix-form-input-component/atomix-form-input-component.component.html +0 -33
- package/src/lib/lib/atomix-form/atomix-form-input-component/atomix-form-input-component.component.scss +0 -32
- package/src/lib/lib/atomix-form/atomix-form-input-component/atomix-form-input-component.component.spec.ts +0 -156
- package/src/lib/lib/atomix-form/atomix-form-input-component/atomix-form-input-component.component.ts +0 -42
- package/src/lib/lib/atomix-form/atomix-form-inputmask-component/atomix-form-inputmask-component.component.html +0 -14
- package/src/lib/lib/atomix-form/atomix-form-inputmask-component/atomix-form-inputmask-component.component.scss +0 -0
- package/src/lib/lib/atomix-form/atomix-form-inputmask-component/atomix-form-inputmask-component.component.spec.ts +0 -104
- package/src/lib/lib/atomix-form/atomix-form-inputmask-component/atomix-form-inputmask-component.component.ts +0 -24
- package/src/lib/lib/atomix-form/atomix-form-password-component/atomix-form-password-component.component.html +0 -16
- package/src/lib/lib/atomix-form/atomix-form-password-component/atomix-form-password-component.component.scss +0 -0
- package/src/lib/lib/atomix-form/atomix-form-password-component/atomix-form-password-component.component.spec.ts +0 -92
- package/src/lib/lib/atomix-form/atomix-form-password-component/atomix-form-password-component.component.ts +0 -24
- package/src/lib/lib/atomix-form/atomix-form-radio-button/atomix-radio-button.component.html +0 -23
- package/src/lib/lib/atomix-form/atomix-form-radio-button/atomix-radio-button.component.scss +0 -3
- package/src/lib/lib/atomix-form/atomix-form-radio-button/atomix-radio-button.component.spec.ts +0 -126
- package/src/lib/lib/atomix-form/atomix-form-radio-button/atomix-radio-button.component.ts +0 -26
- package/src/lib/lib/atomix-form/atomix-form-textarea/atomix-form-textarea.component.html +0 -17
- package/src/lib/lib/atomix-form/atomix-form-textarea/atomix-form-textarea.component.scss +0 -6
- package/src/lib/lib/atomix-form/atomix-form-textarea/atomix-form-textarea.component.spec.ts +0 -120
- package/src/lib/lib/atomix-form/atomix-form-textarea/atomix-form-textarea.component.ts +0 -24
- package/src/lib/lib/atomix-input/atomix-input.component.css +0 -52
- package/src/lib/lib/atomix-input/atomix-input.component.html +0 -45
- package/src/lib/lib/atomix-input/atomix-input.component.spec.ts +0 -229
- package/src/lib/lib/atomix-input/atomix-input.component.ts +0 -64
- package/src/lib/lib/atomix-input-switch/atomix-input-switch.component.css +0 -12
- package/src/lib/lib/atomix-input-switch/atomix-input-switch.component.html +0 -17
- package/src/lib/lib/atomix-input-switch/atomix-input-switch.component.spec.ts +0 -173
- package/src/lib/lib/atomix-input-switch/atomix-input-switch.component.ts +0 -62
- package/src/lib/lib/atomix-loading-overlay/atomix-loading-overlay.component.html +0 -47
- package/src/lib/lib/atomix-loading-overlay/atomix-loading-overlay.component.scss +0 -14
- package/src/lib/lib/atomix-loading-overlay/atomix-loading-overlay.component.spec.ts +0 -21
- package/src/lib/lib/atomix-loading-overlay/atomix-loading-overlay.component.ts +0 -25
- package/src/lib/lib/atomix-messages/messages.component.css +0 -0
- package/src/lib/lib/atomix-messages/messages.component.html +0 -9
- package/src/lib/lib/atomix-messages/messages.component.spec.ts +0 -115
- package/src/lib/lib/atomix-messages/messages.component.ts +0 -17
- package/src/lib/lib/atomix-pagination/atomix-pagination.component.css +0 -19
- package/src/lib/lib/atomix-pagination/atomix-pagination.component.html +0 -24
- package/src/lib/lib/atomix-pagination/atomix-pagination.component.spec.ts +0 -98
- package/src/lib/lib/atomix-pagination/atomix-pagination.component.ts +0 -36
- package/src/lib/lib/atomix-radio-button/atomix-radio-button.component.css +0 -0
- package/src/lib/lib/atomix-radio-button/atomix-radio-button.component.html +0 -7
- package/src/lib/lib/atomix-radio-button/atomix-radio-button.component.spec.ts +0 -116
- package/src/lib/lib/atomix-radio-button/atomix-radio-button.component.ts +0 -37
- package/src/lib/lib/atomix-search-dropdown/atomix-search-dropdown.component.css +0 -49
- package/src/lib/lib/atomix-search-dropdown/atomix-search-dropdown.component.html +0 -68
- package/src/lib/lib/atomix-search-dropdown/atomix-search-dropdown.component.spec.ts +0 -282
- package/src/lib/lib/atomix-search-dropdown/atomix-search-dropdown.component.ts +0 -119
- package/src/lib/lib/atomix-select-button/atomix-select-button.component.css +0 -5
- package/src/lib/lib/atomix-select-button/atomix-select-button.component.html +0 -7
- package/src/lib/lib/atomix-select-button/atomix-select-button.component.spec.ts +0 -73
- package/src/lib/lib/atomix-select-button/atomix-select-button.component.ts +0 -19
- package/src/lib/lib/atomix-snackbar/atomix-snackbar.component.css +0 -30
- package/src/lib/lib/atomix-snackbar/atomix-snackbar.component.html +0 -4
- package/src/lib/lib/atomix-snackbar/atomix-snackbar.component.spec.ts +0 -60
- package/src/lib/lib/atomix-snackbar/atomix-snackbar.component.ts +0 -27
- package/src/lib/lib/atomix-spinner/atomix-spinner.component.css +0 -0
- package/src/lib/lib/atomix-spinner/atomix-spinner.component.html +0 -7
- package/src/lib/lib/atomix-spinner/atomix-spinner.component.spec.ts +0 -70
- package/src/lib/lib/atomix-spinner/atomix-spinner.component.ts +0 -13
- package/src/lib/lib/atomix-steps/atomix-steps.component.html +0 -9
- package/src/lib/lib/atomix-steps/atomix-steps.component.scss +0 -0
- package/src/lib/lib/atomix-steps/atomix-steps.component.spec.ts +0 -120
- package/src/lib/lib/atomix-steps/atomix-steps.component.ts +0 -32
- package/src/lib/lib/atomix-tabMenu/atomix-tabMenu.component.css +0 -0
- package/src/lib/lib/atomix-tabMenu/atomix-tabMenu.component.html +0 -26
- package/src/lib/lib/atomix-tabMenu/atomix-tabMenu.component.spec.ts +0 -106
- package/src/lib/lib/atomix-tabMenu/atomix-tabMenu.component.ts +0 -36
- package/src/lib/lib/atomix-table/atomix-table.component.css +0 -152
- package/src/lib/lib/atomix-table/atomix-table.component.html +0 -647
- package/src/lib/lib/atomix-table/atomix-table.component.spec.ts +0 -1648
- package/src/lib/lib/atomix-table/atomix-table.component.ts +0 -422
- package/src/lib/lib/atomix-table/atomix-table.models.ts +0 -39
- package/src/lib/lib/atomix-tag/atomix-tag.component.css +0 -0
- package/src/lib/lib/atomix-tag/atomix-tag.component.html +0 -6
- package/src/lib/lib/atomix-tag/atomix-tag.component.spec.ts +0 -47
- package/src/lib/lib/atomix-tag/atomix-tag.component.ts +0 -13
- package/src/lib/lib/utils/prime-icons.util.spec.ts +0 -21
- package/src/lib/lib/utils/prime-icons.util.ts +0 -11
- package/src/lib/primekit.component.spec.ts +0 -19
- package/src/lib/primekit.component.ts +0 -10
- package/src/lib/primekit.module.spec.ts +0 -155
- package/src/lib/primekit.module.ts +0 -183
- package/src/lib/primekit.service.spec.ts +0 -17
- package/src/lib/primekit.service.ts +0 -8
- package/tsconfig.lib.json +0 -13
- package/tsconfig.lib.prod.json +0 -11
- package/tsconfig.spec.json +0 -10
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<label *ngIf="label" [for]="controlName"
|
|
2
|
-
>{{ label }}
|
|
3
|
-
<span *ngIf="isLabelRequired" class="error-asterisk">*</span></label
|
|
4
|
-
>
|
|
5
|
-
<p-inputMask
|
|
6
|
-
[formControl]="control"
|
|
7
|
-
[id]="controlName"
|
|
8
|
-
[mask]="mask"
|
|
9
|
-
[placeholder]="placeholder"
|
|
10
|
-
[pTooltip]="tooltip"
|
|
11
|
-
[slotChar]="slotChar"
|
|
12
|
-
[tooltipPosition]="tooltipPosition"
|
|
13
|
-
[ngClass]="class"
|
|
14
|
-
/>
|
|
File without changes
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
|
2
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
3
|
-
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
4
|
-
import { AtomixFormInputmaskComponent } from './atomix-form-inputmask-component.component';
|
|
5
|
-
|
|
6
|
-
describe('AtomixFormInputmaskComponent', () => {
|
|
7
|
-
let component: AtomixFormInputmaskComponent;
|
|
8
|
-
let fixture: ComponentFixture<AtomixFormInputmaskComponent>;
|
|
9
|
-
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
TestBed.configureTestingModule({
|
|
12
|
-
declarations: [AtomixFormInputmaskComponent],
|
|
13
|
-
imports: [ReactiveFormsModule],
|
|
14
|
-
schemas: [NO_ERRORS_SCHEMA],
|
|
15
|
-
});
|
|
16
|
-
fixture = TestBed.createComponent(AtomixFormInputmaskComponent);
|
|
17
|
-
component = fixture.componentInstance;
|
|
18
|
-
component.form = new FormGroup({ testField: new FormControl('') });
|
|
19
|
-
component.controlName = 'testField';
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
expect(component).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
describe('FormGroup binding', () => {
|
|
27
|
-
it('should return the correct FormControl from the form via control accessor', () => {
|
|
28
|
-
const control = component.control;
|
|
29
|
-
expect(control).toBe(component.form.get('testField'));
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it('should return a FormControl instance', () => {
|
|
33
|
-
expect(component.control).toBeInstanceOf(FormControl);
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it('should reflect the form control value', () => {
|
|
37
|
-
component.form.get('testField')!.setValue('12345');
|
|
38
|
-
expect(component.control.value).toBe('12345');
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
describe('mask pattern application', () => {
|
|
43
|
-
it('should have default mask as text', () => {
|
|
44
|
-
expect(component.mask).toBe('text');
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('should accept a custom mask pattern', () => {
|
|
48
|
-
component.mask = '(999) 999-9999';
|
|
49
|
-
expect(component.mask).toBe('(999) 999-9999');
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it('should accept a date mask pattern', () => {
|
|
53
|
-
component.mask = '99/99/9999';
|
|
54
|
-
expect(component.mask).toBe('99/99/9999');
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
describe('input properties', () => {
|
|
59
|
-
it('should have default label as empty string', () => {
|
|
60
|
-
expect(component.label).toBe('');
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
it('should accept label input', () => {
|
|
64
|
-
component.label = 'Phone Number';
|
|
65
|
-
expect(component.label).toBe('Phone Number');
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
it('should have default placeholder as empty string', () => {
|
|
69
|
-
expect(component.placeholder).toBe('');
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it('should accept placeholder input', () => {
|
|
73
|
-
component.placeholder = '(___) ___-____';
|
|
74
|
-
expect(component.placeholder).toBe('(___) ___-____');
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
it('should have default slotChar as empty string', () => {
|
|
78
|
-
expect(component.slotChar).toBe('');
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
it('should accept slotChar input', () => {
|
|
82
|
-
component.slotChar = '_';
|
|
83
|
-
expect(component.slotChar).toBe('_');
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
it('should have default tooltipPosition as bottom', () => {
|
|
87
|
-
expect(component.tooltipPosition).toBe('bottom');
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
it('should accept tooltipPosition input', () => {
|
|
91
|
-
component.tooltipPosition = 'top';
|
|
92
|
-
expect(component.tooltipPosition).toBe('top');
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
it('should have default isLabelRequired as false', () => {
|
|
96
|
-
expect(component.isLabelRequired).toBe(false);
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
it('should accept isLabelRequired input', () => {
|
|
100
|
-
component.isLabelRequired = true;
|
|
101
|
-
expect(component.isLabelRequired).toBe(true);
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Component, Input } from '@angular/core';
|
|
2
|
-
import { FormControl, FormGroup } from '@angular/forms';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'atomix-form-inputmask',
|
|
6
|
-
templateUrl: './atomix-form-inputmask-component.component.html',
|
|
7
|
-
styleUrls: ['./atomix-form-inputmask-component.component.scss'],
|
|
8
|
-
})
|
|
9
|
-
export class AtomixFormInputmaskComponent {
|
|
10
|
-
@Input() controlName!: string;
|
|
11
|
-
@Input() form!: FormGroup;
|
|
12
|
-
@Input() mask = 'text';
|
|
13
|
-
@Input() label = '';
|
|
14
|
-
@Input() placeholder = '';
|
|
15
|
-
@Input() slotChar = '';
|
|
16
|
-
@Input() tooltip!: string;
|
|
17
|
-
@Input() tooltipPosition: 'right' | 'left' | 'top' | 'bottom' = 'bottom';
|
|
18
|
-
@Input() isLabelRequired: boolean = false;
|
|
19
|
-
@Input() class!: string;
|
|
20
|
-
|
|
21
|
-
get control() {
|
|
22
|
-
return this.form.get(this.controlName) as FormControl;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<label *ngIf="label" [for]="controlName"
|
|
2
|
-
>{{ label }}
|
|
3
|
-
<span *ngIf="isLabelRequired" class="error-asterisk">*</span></label
|
|
4
|
-
>
|
|
5
|
-
<p-password
|
|
6
|
-
[id]="controlName"
|
|
7
|
-
[formControl]="control"
|
|
8
|
-
[placeholder]="placeholder"
|
|
9
|
-
[pTooltip]="tooltip"
|
|
10
|
-
[tooltipPosition]="tooltipPosition"
|
|
11
|
-
[ngClass]="class"
|
|
12
|
-
autocomplete="off"
|
|
13
|
-
[feedback]="feedback"
|
|
14
|
-
[toggleMask]="true"
|
|
15
|
-
autocomplete="new-password"
|
|
16
|
-
/>
|
|
File without changes
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
|
2
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
3
|
-
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
4
|
-
import { AtomixFormPasswordComponent } from './atomix-form-password-component.component';
|
|
5
|
-
|
|
6
|
-
describe('AtomixFormPasswordComponent', () => {
|
|
7
|
-
let component: AtomixFormPasswordComponent;
|
|
8
|
-
let fixture: ComponentFixture<AtomixFormPasswordComponent>;
|
|
9
|
-
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
TestBed.configureTestingModule({
|
|
12
|
-
declarations: [AtomixFormPasswordComponent],
|
|
13
|
-
imports: [ReactiveFormsModule],
|
|
14
|
-
schemas: [NO_ERRORS_SCHEMA],
|
|
15
|
-
});
|
|
16
|
-
fixture = TestBed.createComponent(AtomixFormPasswordComponent);
|
|
17
|
-
component = fixture.componentInstance;
|
|
18
|
-
component.form = new FormGroup({ testField: new FormControl('') });
|
|
19
|
-
component.controlName = 'testField';
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
expect(component).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
describe('FormGroup binding', () => {
|
|
27
|
-
it('should return the correct FormControl from the form via control accessor', () => {
|
|
28
|
-
const control = component.control;
|
|
29
|
-
expect(control).toBe(component.form.get('testField'));
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it('should return a FormControl instance', () => {
|
|
33
|
-
expect(component.control).toBeInstanceOf(FormControl);
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it('should reflect the form control value', () => {
|
|
37
|
-
component.form.get('testField')!.setValue('secret123');
|
|
38
|
-
expect(component.control.value).toBe('secret123');
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
describe('password input rendering', () => {
|
|
43
|
-
it('should have default label as empty string', () => {
|
|
44
|
-
expect(component.label).toBe('');
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('should accept label input', () => {
|
|
48
|
-
component.label = 'Password';
|
|
49
|
-
expect(component.label).toBe('Password');
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it('should have default placeholder as empty string', () => {
|
|
53
|
-
expect(component.placeholder).toBe('');
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
it('should accept placeholder input', () => {
|
|
57
|
-
component.placeholder = 'Enter password';
|
|
58
|
-
expect(component.placeholder).toBe('Enter password');
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it('should have default type as text', () => {
|
|
62
|
-
expect(component.type).toBe('text');
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
it('should have default feedback as false', () => {
|
|
66
|
-
expect(component.feedback).toBe(false);
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
it('should accept feedback input', () => {
|
|
70
|
-
component.feedback = true;
|
|
71
|
-
expect(component.feedback).toBe(true);
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
it('should have default isLabelRequired as false', () => {
|
|
75
|
-
expect(component.isLabelRequired).toBe(false);
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
it('should accept isLabelRequired input', () => {
|
|
79
|
-
component.isLabelRequired = true;
|
|
80
|
-
expect(component.isLabelRequired).toBe(true);
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it('should have default tooltipPosition as bottom', () => {
|
|
84
|
-
expect(component.tooltipPosition).toBe('bottom');
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
it('should accept tooltipPosition input', () => {
|
|
88
|
-
component.tooltipPosition = 'top';
|
|
89
|
-
expect(component.tooltipPosition).toBe('top');
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Component, Input } from '@angular/core';
|
|
2
|
-
import { FormControl, FormGroup } from '@angular/forms';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'atomix-form-password',
|
|
6
|
-
templateUrl: './atomix-form-password-component.component.html',
|
|
7
|
-
styleUrls: ['./atomix-form-password-component.component.scss'],
|
|
8
|
-
})
|
|
9
|
-
export class AtomixFormPasswordComponent {
|
|
10
|
-
@Input() controlName!: string;
|
|
11
|
-
@Input() form!: FormGroup;
|
|
12
|
-
@Input() label = '';
|
|
13
|
-
@Input() placeholder = '';
|
|
14
|
-
@Input() type = 'text';
|
|
15
|
-
@Input() tooltip!: string;
|
|
16
|
-
@Input() class!: string;
|
|
17
|
-
@Input() feedback: boolean = false;
|
|
18
|
-
@Input() isLabelRequired: boolean = false;
|
|
19
|
-
@Input() tooltipPosition: 'right' | 'left' | 'top' | 'bottom' = 'bottom';
|
|
20
|
-
|
|
21
|
-
get control() {
|
|
22
|
-
return this.form.get(this.controlName) as FormControl;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<div>
|
|
2
|
-
<label *ngIf="label" [for]="controlName"
|
|
3
|
-
>{{ label }} <span *ngIf="isLabelRequired" class="error-asterisk">*</span>
|
|
4
|
-
<i
|
|
5
|
-
*ngIf="labelIconData?.required"
|
|
6
|
-
[class]="labelIconData?.iconClass + ' ml-2'"
|
|
7
|
-
[pTooltip]="labelIconData?.tooltip"
|
|
8
|
-
></i
|
|
9
|
-
></label>
|
|
10
|
-
</div>
|
|
11
|
-
<div style="margin-top: 0.2rem" [class]="radioButtonContainerClass">
|
|
12
|
-
<span
|
|
13
|
-
*ngFor="let option of radioGroupOptions; let i = index"
|
|
14
|
-
[ngClass]="{ indented: i > 0 }"
|
|
15
|
-
>
|
|
16
|
-
<p-radioButton
|
|
17
|
-
[formControl]="control"
|
|
18
|
-
[inputId]="controlName"
|
|
19
|
-
[value]="option.key"
|
|
20
|
-
></p-radioButton>
|
|
21
|
-
<label [for]="controlName" class="ml-2">{{ option.name }}</label>
|
|
22
|
-
</span>
|
|
23
|
-
</div>
|
package/src/lib/lib/atomix-form/atomix-form-radio-button/atomix-radio-button.component.spec.ts
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
|
2
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
3
|
-
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
4
|
-
import { AtomixFormRadioButtonComponent } from './atomix-radio-button.component';
|
|
5
|
-
|
|
6
|
-
describe('AtomixFormRadioButtonComponent', () => {
|
|
7
|
-
let component: AtomixFormRadioButtonComponent;
|
|
8
|
-
let fixture: ComponentFixture<AtomixFormRadioButtonComponent>;
|
|
9
|
-
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
TestBed.configureTestingModule({
|
|
12
|
-
declarations: [AtomixFormRadioButtonComponent],
|
|
13
|
-
imports: [ReactiveFormsModule],
|
|
14
|
-
schemas: [NO_ERRORS_SCHEMA],
|
|
15
|
-
});
|
|
16
|
-
fixture = TestBed.createComponent(AtomixFormRadioButtonComponent);
|
|
17
|
-
component = fixture.componentInstance;
|
|
18
|
-
component.form = new FormGroup({ testField: new FormControl('') });
|
|
19
|
-
component.controlName = 'testField';
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
expect(component).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
describe('FormGroup binding', () => {
|
|
27
|
-
it('should return the correct FormControl from the form via control accessor', () => {
|
|
28
|
-
const control = component.control;
|
|
29
|
-
expect(control).toBe(component.form.get('testField'));
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it('should return a FormControl instance', () => {
|
|
33
|
-
expect(component.control).toBeInstanceOf(FormControl);
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it('should reflect the form control value', () => {
|
|
37
|
-
component.form.get('testField')!.setValue('optionA');
|
|
38
|
-
expect(component.control.value).toBe('optionA');
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
describe('radio selection updating form control', () => {
|
|
43
|
-
it('should update form control value when a radio option is selected', () => {
|
|
44
|
-
component.control.setValue('optionB');
|
|
45
|
-
expect(component.form.get('testField')!.value).toBe('optionB');
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it('should update form control value when selection changes', () => {
|
|
49
|
-
component.control.setValue('optionA');
|
|
50
|
-
expect(component.form.get('testField')!.value).toBe('optionA');
|
|
51
|
-
component.control.setValue('optionC');
|
|
52
|
-
expect(component.form.get('testField')!.value).toBe('optionC');
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('should clear form control value when set to empty', () => {
|
|
56
|
-
component.control.setValue('optionA');
|
|
57
|
-
component.control.setValue('');
|
|
58
|
-
expect(component.form.get('testField')!.value).toBe('');
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
describe('input properties', () => {
|
|
63
|
-
it('should have default label as empty string', () => {
|
|
64
|
-
expect(component.label).toBe('');
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it('should accept label input', () => {
|
|
68
|
-
component.label = 'Select an option';
|
|
69
|
-
expect(component.label).toBe('Select an option');
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it('should have default isLabelRequired as false', () => {
|
|
73
|
-
expect(component.isLabelRequired).toBe(false);
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
it('should accept isLabelRequired input', () => {
|
|
77
|
-
component.isLabelRequired = true;
|
|
78
|
-
expect(component.isLabelRequired).toBe(true);
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
it('should have default value with empty name and key', () => {
|
|
82
|
-
expect(component.value).toEqual({ name: '', key: '' });
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
it('should accept value input', () => {
|
|
86
|
-
component.value = { name: 'Option A', key: 'optionA' };
|
|
87
|
-
expect(component.value).toEqual({ name: 'Option A', key: 'optionA' });
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
it('should accept radioGroupOptions input', () => {
|
|
91
|
-
const options = [
|
|
92
|
-
{ name: 'Option A', key: 'optionA' },
|
|
93
|
-
{ name: 'Option B', key: 'optionB' },
|
|
94
|
-
];
|
|
95
|
-
component.radioGroupOptions = options;
|
|
96
|
-
expect(component.radioGroupOptions).toEqual(options);
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
it('should have default labelIconData with empty values', () => {
|
|
100
|
-
expect(component.labelIconData).toEqual({
|
|
101
|
-
iconClass: '',
|
|
102
|
-
tooltip: '',
|
|
103
|
-
required: false,
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
it('should accept labelIconData input', () => {
|
|
108
|
-
const iconData = {
|
|
109
|
-
iconClass: 'pi pi-info-circle',
|
|
110
|
-
tooltip: 'Help text',
|
|
111
|
-
required: true,
|
|
112
|
-
};
|
|
113
|
-
component.labelIconData = iconData;
|
|
114
|
-
expect(component.labelIconData).toEqual(iconData);
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
it('should have default radioButtonContainerClass as empty string', () => {
|
|
118
|
-
expect(component.radioButtonContainerClass).toBe('');
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
it('should accept radioButtonContainerClass input', () => {
|
|
122
|
-
component.radioButtonContainerClass = 'flex-row';
|
|
123
|
-
expect(component.radioButtonContainerClass).toBe('flex-row');
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Component, Input } from '@angular/core';
|
|
2
|
-
import { FormControl, FormGroup } from '@angular/forms';
|
|
3
|
-
import { LabelIconData } from '../atomix-form-chips/form.chips.models';
|
|
4
|
-
|
|
5
|
-
@Component({
|
|
6
|
-
selector: 'atomix-form-radio-group',
|
|
7
|
-
templateUrl: './atomix-radio-button.component.html',
|
|
8
|
-
styleUrls: ['./atomix-radio-button.component.scss'],
|
|
9
|
-
})
|
|
10
|
-
export class AtomixFormRadioButtonComponent {
|
|
11
|
-
@Input() controlName!: string;
|
|
12
|
-
@Input() form!: FormGroup;
|
|
13
|
-
@Input() value: { name: string; key: string } = { name: '', key: '' };
|
|
14
|
-
@Input() label = '';
|
|
15
|
-
@Input() isLabelRequired: boolean = false;
|
|
16
|
-
@Input() radioGroupOptions!: any;
|
|
17
|
-
@Input() labelIconData: LabelIconData = {
|
|
18
|
-
iconClass: '',
|
|
19
|
-
tooltip: '',
|
|
20
|
-
required: false,
|
|
21
|
-
};
|
|
22
|
-
@Input() radioButtonContainerClass = '';
|
|
23
|
-
get control() {
|
|
24
|
-
return this.form.get(this.controlName) as FormControl;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<label *ngIf="label"
|
|
2
|
-
>{{ label }}
|
|
3
|
-
<span *ngIf="isLabelRequired" class="error-asterisk">*</span></label
|
|
4
|
-
>
|
|
5
|
-
<textarea
|
|
6
|
-
variant="filled"
|
|
7
|
-
pInputTextarea
|
|
8
|
-
[rows]="rows"
|
|
9
|
-
[id]="controlName"
|
|
10
|
-
[cols]="cols"
|
|
11
|
-
[ngClass]="class + ' atomix-form-textarea'"
|
|
12
|
-
[disabled]="disabled"
|
|
13
|
-
autocomplete="new-password"
|
|
14
|
-
[formControl]="control"
|
|
15
|
-
[placeholder]="placeholder"
|
|
16
|
-
[style.height]="height"
|
|
17
|
-
></textarea>
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
|
2
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
3
|
-
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
4
|
-
import { AtomixFormTextareaComponent } from './atomix-form-textarea.component';
|
|
5
|
-
|
|
6
|
-
describe('AtomixFormTextareaComponent', () => {
|
|
7
|
-
let component: AtomixFormTextareaComponent;
|
|
8
|
-
let fixture: ComponentFixture<AtomixFormTextareaComponent>;
|
|
9
|
-
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
TestBed.configureTestingModule({
|
|
12
|
-
declarations: [AtomixFormTextareaComponent],
|
|
13
|
-
imports: [ReactiveFormsModule],
|
|
14
|
-
schemas: [NO_ERRORS_SCHEMA],
|
|
15
|
-
});
|
|
16
|
-
fixture = TestBed.createComponent(AtomixFormTextareaComponent);
|
|
17
|
-
component = fixture.componentInstance;
|
|
18
|
-
component.form = new FormGroup({ testField: new FormControl('') });
|
|
19
|
-
component.controlName = 'testField';
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
expect(component).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
describe('FormGroup binding', () => {
|
|
27
|
-
it('should return the correct FormControl from the form via control accessor', () => {
|
|
28
|
-
const control = component.control;
|
|
29
|
-
expect(control).toBe(component.form.get('testField'));
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it('should return a FormControl instance', () => {
|
|
33
|
-
expect(component.control).toBeInstanceOf(FormControl);
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it('should reflect the form control value', () => {
|
|
37
|
-
component.form.get('testField')!.setValue('hello world');
|
|
38
|
-
expect(component.control.value).toBe('hello world');
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it('should update form control value programmatically', () => {
|
|
42
|
-
component.control.setValue('updated text');
|
|
43
|
-
expect(component.form.get('testField')!.value).toBe('updated text');
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
describe('textarea-specific properties', () => {
|
|
48
|
-
it('should have default rows of 5', () => {
|
|
49
|
-
expect(component.rows).toBe(5);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it('should accept rows input', () => {
|
|
53
|
-
component.rows = 10;
|
|
54
|
-
fixture.detectChanges();
|
|
55
|
-
expect(component.rows).toBe(10);
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it('should have default cols of 30', () => {
|
|
59
|
-
expect(component.cols).toBe(30);
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it('should accept cols input', () => {
|
|
63
|
-
component.cols = 50;
|
|
64
|
-
fixture.detectChanges();
|
|
65
|
-
expect(component.cols).toBe(50);
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
it('should have default height as empty string', () => {
|
|
69
|
-
expect(component.height).toBe('');
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it('should accept height input', () => {
|
|
73
|
-
component.height = '200px';
|
|
74
|
-
fixture.detectChanges();
|
|
75
|
-
expect(component.height).toBe('200px');
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
describe('input properties', () => {
|
|
80
|
-
it('should have default label as empty string', () => {
|
|
81
|
-
expect(component.label).toBe('');
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
it('should accept label input', () => {
|
|
85
|
-
component.label = 'Description';
|
|
86
|
-
fixture.detectChanges();
|
|
87
|
-
expect(component.label).toBe('Description');
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
it('should have default placeholder as empty string', () => {
|
|
91
|
-
expect(component.placeholder).toBe('');
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
it('should accept placeholder input', () => {
|
|
95
|
-
component.placeholder = 'Enter description';
|
|
96
|
-
fixture.detectChanges();
|
|
97
|
-
expect(component.placeholder).toBe('Enter description');
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
it('should have default disabled as false', () => {
|
|
101
|
-
expect(component.disabled).toBe(false);
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
it('should accept disabled input', () => {
|
|
105
|
-
component.disabled = true;
|
|
106
|
-
fixture.detectChanges();
|
|
107
|
-
expect(component.disabled).toBe(true);
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
it('should have default isLabelRequired as false', () => {
|
|
111
|
-
expect(component.isLabelRequired).toBe(false);
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
it('should accept isLabelRequired input', () => {
|
|
115
|
-
component.isLabelRequired = true;
|
|
116
|
-
fixture.detectChanges();
|
|
117
|
-
expect(component.isLabelRequired).toBe(true);
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Component, Input } from '@angular/core';
|
|
2
|
-
import { FormControl, FormGroup } from '@angular/forms';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'atomix-form-textarea',
|
|
6
|
-
templateUrl: './atomix-form-textarea.component.html',
|
|
7
|
-
styleUrls: ['./atomix-form-textarea.component.scss'],
|
|
8
|
-
})
|
|
9
|
-
export class AtomixFormTextareaComponent {
|
|
10
|
-
@Input() controlName!: string;
|
|
11
|
-
@Input() form!: FormGroup;
|
|
12
|
-
@Input() label = '';
|
|
13
|
-
@Input() rows: number = 5;
|
|
14
|
-
@Input() cols: number = 30;
|
|
15
|
-
@Input() placeholder = '';
|
|
16
|
-
@Input() disabled: boolean = false;
|
|
17
|
-
@Input() class!: string;
|
|
18
|
-
@Input() isLabelRequired: boolean = false;
|
|
19
|
-
@Input() height: string = '';
|
|
20
|
-
|
|
21
|
-
get control() {
|
|
22
|
-
return this.form.get(this.controlName) as FormControl;
|
|
23
|
-
}
|
|
24
|
-
}
|