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
package/src/lib/lib/atomix-form/atomix-form-autocomplete/atomix-form-autocomplete.component.spec.ts
DELETED
|
@@ -1,169 +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 { AtomixFormAutocompleteComponent } from './atomix-form-autocomplete.component';
|
|
5
|
-
|
|
6
|
-
describe('AtomixFormAutocompleteComponent', () => {
|
|
7
|
-
let component: AtomixFormAutocompleteComponent;
|
|
8
|
-
let fixture: ComponentFixture<AtomixFormAutocompleteComponent>;
|
|
9
|
-
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
TestBed.configureTestingModule({
|
|
12
|
-
declarations: [AtomixFormAutocompleteComponent],
|
|
13
|
-
imports: [ReactiveFormsModule],
|
|
14
|
-
schemas: [NO_ERRORS_SCHEMA],
|
|
15
|
-
});
|
|
16
|
-
fixture = TestBed.createComponent(AtomixFormAutocompleteComponent);
|
|
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('test value');
|
|
38
|
-
expect(component.control.value).toBe('test value');
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
describe('suggestions input', () => {
|
|
43
|
-
it('should have default suggestions as empty array', () => {
|
|
44
|
-
expect(component.suggestions).toEqual([]);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('should accept suggestions input', () => {
|
|
48
|
-
const suggestions = [{ name: 'Option 1' }, { name: 'Option 2' }];
|
|
49
|
-
component.suggestions = suggestions;
|
|
50
|
-
expect(component.suggestions).toEqual(suggestions);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it('should accept string suggestions', () => {
|
|
54
|
-
const suggestions = ['Apple', 'Banana', 'Cherry'];
|
|
55
|
-
component.suggestions = suggestions;
|
|
56
|
-
expect(component.suggestions).toEqual(suggestions);
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
describe('selection updating form control', () => {
|
|
61
|
-
it('should update form control value when a selection is made', () => {
|
|
62
|
-
const selectedValue = { name: 'Selected Option' };
|
|
63
|
-
component.control.setValue(selectedValue);
|
|
64
|
-
expect(component.form.get('testField')!.value).toEqual(selectedValue);
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it('should update form control value with a string selection', () => {
|
|
68
|
-
component.control.setValue('Selected String');
|
|
69
|
-
expect(component.form.get('testField')!.value).toBe('Selected String');
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it('should clear form control value when cleared', () => {
|
|
73
|
-
component.control.setValue('some value');
|
|
74
|
-
component.control.setValue('');
|
|
75
|
-
expect(component.form.get('testField')!.value).toBe('');
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
describe('output events', () => {
|
|
80
|
-
it('should emit queryEvent when onQuery is called', () => {
|
|
81
|
-
jest.spyOn(component.queryEvent, 'emit');
|
|
82
|
-
const event = { query: 'search term' } as any;
|
|
83
|
-
component.onQuery(event);
|
|
84
|
-
expect(component.queryEvent.emit).toHaveBeenCalledWith('search term');
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
it('should emit onSelect when onOptionSelected is called', () => {
|
|
88
|
-
jest.spyOn(component.onSelect, 'emit');
|
|
89
|
-
const event = { value: { name: 'Option 1' } } as any;
|
|
90
|
-
component.onOptionSelected(event);
|
|
91
|
-
expect(component.onSelect.emit).toHaveBeenCalledWith(event);
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
describe('input properties', () => {
|
|
96
|
-
it('should have default label as empty string', () => {
|
|
97
|
-
expect(component.label).toBe('');
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
it('should accept label input', () => {
|
|
101
|
-
component.label = 'Search';
|
|
102
|
-
expect(component.label).toBe('Search');
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
it('should have default placeholder as empty string', () => {
|
|
106
|
-
expect(component.placeholder).toBe('');
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
it('should accept placeholder input', () => {
|
|
110
|
-
component.placeholder = 'Type to search';
|
|
111
|
-
expect(component.placeholder).toBe('Type to search');
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
it('should have default type as text', () => {
|
|
115
|
-
expect(component.type).toBe('text');
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
it('should accept type input', () => {
|
|
119
|
-
component.type = 'email';
|
|
120
|
-
expect(component.type).toBe('email');
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
it('should accept tooltip input', () => {
|
|
124
|
-
component.tooltip = 'Search for items';
|
|
125
|
-
expect(component.tooltip).toBe('Search for items');
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
it('should have default tooltipPosition as bottom', () => {
|
|
129
|
-
expect(component.tooltipPosition).toBe('bottom');
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
it('should accept tooltipPosition input', () => {
|
|
133
|
-
component.tooltipPosition = 'top';
|
|
134
|
-
expect(component.tooltipPosition).toBe('top');
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
it('should accept styleClass input', () => {
|
|
138
|
-
component.styleClass = 'custom-autocomplete';
|
|
139
|
-
expect(component.styleClass).toBe('custom-autocomplete');
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
it('should have default isLabelRequired as false', () => {
|
|
143
|
-
expect(component.isLabelRequired).toBe(false);
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
it('should accept isLabelRequired input', () => {
|
|
147
|
-
component.isLabelRequired = true;
|
|
148
|
-
expect(component.isLabelRequired).toBe(true);
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
it('should have default field as empty string', () => {
|
|
152
|
-
expect(component.field).toBe('');
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
it('should accept field input', () => {
|
|
156
|
-
component.field = 'name';
|
|
157
|
-
expect(component.field).toBe('name');
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
it('should have default dropdown as true', () => {
|
|
161
|
-
expect(component.dropdown).toBe(true);
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
it('should accept dropdown input', () => {
|
|
165
|
-
component.dropdown = false;
|
|
166
|
-
expect(component.dropdown).toBe(false);
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
});
|
package/src/lib/lib/atomix-form/atomix-form-autocomplete/atomix-form-autocomplete.component.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
-
import { FormControl, FormGroup } from '@angular/forms';
|
|
3
|
-
import {
|
|
4
|
-
AutoCompleteCompleteEvent,
|
|
5
|
-
AutoCompleteSelectEvent,
|
|
6
|
-
} from 'primeng/autocomplete';
|
|
7
|
-
|
|
8
|
-
@Component({
|
|
9
|
-
selector: 'atomix-form-autocomplete',
|
|
10
|
-
templateUrl: './atomix-form-autocomplete.component.html',
|
|
11
|
-
styleUrls: ['./atomix-form-autocomplete.component.scss'],
|
|
12
|
-
})
|
|
13
|
-
export class AtomixFormAutocompleteComponent {
|
|
14
|
-
@Input() controlName!: string;
|
|
15
|
-
@Input() form!: FormGroup;
|
|
16
|
-
@Input() label = '';
|
|
17
|
-
@Input() suggestions: any[] = [];
|
|
18
|
-
@Input() placeholder = '';
|
|
19
|
-
@Input() type = 'text';
|
|
20
|
-
@Input() tooltip!: string;
|
|
21
|
-
@Input() styleClass!: string;
|
|
22
|
-
@Input() isLabelRequired: boolean = false;
|
|
23
|
-
@Input() tooltipPosition: 'right' | 'left' | 'top' | 'bottom' = 'bottom';
|
|
24
|
-
@Input() field: string = '';
|
|
25
|
-
@Input() dropdown = true;
|
|
26
|
-
@Output() queryEvent = new EventEmitter<string>();
|
|
27
|
-
@Output() onSelect = new EventEmitter<AutoCompleteSelectEvent | Event>();
|
|
28
|
-
|
|
29
|
-
onQuery(event: AutoCompleteCompleteEvent) {
|
|
30
|
-
this.queryEvent.emit(event.query);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
onOptionSelected(event: AutoCompleteSelectEvent) {
|
|
34
|
-
console.log('lib', event);
|
|
35
|
-
this.onSelect.emit(event);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
get control() {
|
|
39
|
-
return this.form.get(this.controlName) as FormControl;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<label *ngIf="label" [for]="controlName"
|
|
2
|
-
>{{ label }}
|
|
3
|
-
<span *ngIf="isLabelRequired" class="error-asterisk">*</span></label
|
|
4
|
-
>
|
|
5
|
-
<p-calendar
|
|
6
|
-
[formControl]="control"
|
|
7
|
-
id="calendar"
|
|
8
|
-
tooltipPosition="top"
|
|
9
|
-
[view]="view"
|
|
10
|
-
[dateFormat]="dateFormat"
|
|
11
|
-
[maxDate]="maxDate"
|
|
12
|
-
[minDate]="minDate"
|
|
13
|
-
[selectionMode]="selectionMode"
|
|
14
|
-
[readonlyInput]="true"
|
|
15
|
-
[placeholder]="placeholder"
|
|
16
|
-
(onClose)="dateSelectHandler.emit()"
|
|
17
|
-
[inputStyleClass]="inputStyleClass"
|
|
18
|
-
[styleClass]="styleClass + ' form-calendar'"
|
|
19
|
-
appendTo="body"
|
|
20
|
-
(onSelect)="dateChangeHandler.emit($event)"
|
|
21
|
-
/>
|
|
@@ -1,142 +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 { AtomixFormCalendarComponent } from './atomix-form-calendar.component';
|
|
5
|
-
|
|
6
|
-
describe('AtomixFormCalendarComponent', () => {
|
|
7
|
-
let component: AtomixFormCalendarComponent;
|
|
8
|
-
let fixture: ComponentFixture<AtomixFormCalendarComponent>;
|
|
9
|
-
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
TestBed.configureTestingModule({
|
|
12
|
-
declarations: [AtomixFormCalendarComponent],
|
|
13
|
-
imports: [ReactiveFormsModule],
|
|
14
|
-
schemas: [NO_ERRORS_SCHEMA],
|
|
15
|
-
});
|
|
16
|
-
fixture = TestBed.createComponent(AtomixFormCalendarComponent);
|
|
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('2024-01-15');
|
|
38
|
-
expect(component.control.value).toBe('2024-01-15');
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
describe('date selection updating form control', () => {
|
|
43
|
-
it('should update form control value when set programmatically', () => {
|
|
44
|
-
const date = new Date(2024, 5, 15);
|
|
45
|
-
component.control.setValue(date);
|
|
46
|
-
expect(component.form.get('testField')!.value).toBe(date);
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it('should emit dateSelectHandler on calendar close', () => {
|
|
50
|
-
const emitSpy = jest.fn();
|
|
51
|
-
component.dateSelectHandler.subscribe(emitSpy);
|
|
52
|
-
|
|
53
|
-
component.dateSelectHandler.emit();
|
|
54
|
-
|
|
55
|
-
expect(emitSpy).toHaveBeenCalled();
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it('should emit dateChangeHandler on date select', () => {
|
|
59
|
-
const emitSpy = jest.fn();
|
|
60
|
-
component.dateChangeHandler.subscribe(emitSpy);
|
|
61
|
-
|
|
62
|
-
const mockDate = new Date(2024, 5, 15);
|
|
63
|
-
component.dateChangeHandler.emit(mockDate);
|
|
64
|
-
|
|
65
|
-
expect(emitSpy).toHaveBeenCalledWith(mockDate);
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
describe('input properties', () => {
|
|
70
|
-
it('should have default label as empty string', () => {
|
|
71
|
-
expect(component.label).toBe('');
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
it('should accept label input', () => {
|
|
75
|
-
component.label = 'Start Date';
|
|
76
|
-
expect(component.label).toBe('Start Date');
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
it('should have default isLabelRequired as false', () => {
|
|
80
|
-
expect(component.isLabelRequired).toBe(false);
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it('should accept isLabelRequired input', () => {
|
|
84
|
-
component.isLabelRequired = true;
|
|
85
|
-
expect(component.isLabelRequired).toBe(true);
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
it('should have default placeholder as empty string', () => {
|
|
89
|
-
expect(component.placeholder).toBe('');
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
it('should accept placeholder input', () => {
|
|
93
|
-
component.placeholder = 'Select a date';
|
|
94
|
-
expect(component.placeholder).toBe('Select a date');
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
it('should accept view input', () => {
|
|
98
|
-
component.view = 'month';
|
|
99
|
-
expect(component.view).toBe('month');
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
it('should accept dateFormat input', () => {
|
|
103
|
-
component.dateFormat = 'mm/dd/yy';
|
|
104
|
-
expect(component.dateFormat).toBe('mm/dd/yy');
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
it('should accept maxDate input', () => {
|
|
108
|
-
const maxDate = new Date(2025, 11, 31);
|
|
109
|
-
component.maxDate = maxDate;
|
|
110
|
-
expect(component.maxDate).toBe(maxDate);
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
it('should accept minDate input', () => {
|
|
114
|
-
const minDate = new Date(2020, 0, 1);
|
|
115
|
-
component.minDate = minDate;
|
|
116
|
-
expect(component.minDate).toBe(minDate);
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
it('should accept selectionMode input', () => {
|
|
120
|
-
component.selectionMode = 'range';
|
|
121
|
-
expect(component.selectionMode).toBe('range');
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
it('should have default styleClass as empty string', () => {
|
|
125
|
-
expect(component.styleClass).toBe('');
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
it('should accept styleClass input', () => {
|
|
129
|
-
component.styleClass = 'custom-calendar';
|
|
130
|
-
expect(component.styleClass).toBe('custom-calendar');
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
it('should have default inputStyleClass as empty string', () => {
|
|
134
|
-
expect(component.inputStyleClass).toBe('');
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
it('should accept inputStyleClass input', () => {
|
|
138
|
-
component.inputStyleClass = 'custom-input';
|
|
139
|
-
expect(component.inputStyleClass).toBe('custom-input');
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
-
import { FormControl, FormGroup } from '@angular/forms';
|
|
3
|
-
import { CalendarTypeView } from 'primeng/calendar';
|
|
4
|
-
|
|
5
|
-
@Component({
|
|
6
|
-
selector: 'atomix-form-calendar',
|
|
7
|
-
templateUrl: './atomix-form-calendar.component.html',
|
|
8
|
-
styleUrls: ['./atomix-form-calendar.component.scss'],
|
|
9
|
-
})
|
|
10
|
-
export class AtomixFormCalendarComponent {
|
|
11
|
-
@Input() controlName!: string;
|
|
12
|
-
@Input() form!: FormGroup;
|
|
13
|
-
@Input() view!: CalendarTypeView;
|
|
14
|
-
@Input() dateFormat!: string;
|
|
15
|
-
@Input() label = '';
|
|
16
|
-
@Input() isLabelRequired: boolean = false;
|
|
17
|
-
|
|
18
|
-
@Input() maxDate!: Date;
|
|
19
|
-
@Input() minDate!: Date;
|
|
20
|
-
@Input() selectionMode!: 'single' | 'multiple' | 'range' | undefined;
|
|
21
|
-
@Input() placeholder = '';
|
|
22
|
-
|
|
23
|
-
@Input() styleClass = '';
|
|
24
|
-
@Input() inputStyleClass = '';
|
|
25
|
-
|
|
26
|
-
@Output() dateSelectHandler = new EventEmitter<any>();
|
|
27
|
-
@Output() dateChangeHandler = new EventEmitter<any>();
|
|
28
|
-
|
|
29
|
-
get control() {
|
|
30
|
-
return this.form.get(this.controlName) as FormControl;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<div [ngClass]="inline ? 'checkbox-item-inline' : 'checkbox-item'">
|
|
2
|
-
<label [htmlFor]="controlName" *ngIf="label" [htmlFor]="controlName">{{
|
|
3
|
-
label
|
|
4
|
-
}}</label>
|
|
5
|
-
<p-checkbox
|
|
6
|
-
[binary]="true"
|
|
7
|
-
[formControl]="control"
|
|
8
|
-
[inputId]="controlName"
|
|
9
|
-
[pTooltip]="tooltip"
|
|
10
|
-
[tooltipPosition]="tooltipPosition"
|
|
11
|
-
(onChange)="onChange($event)"
|
|
12
|
-
></p-checkbox>
|
|
13
|
-
</div>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
.checkbox-item {
|
|
2
|
-
min-height: 72px !important;
|
|
3
|
-
display: flex;
|
|
4
|
-
justify-content: space-evenly;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
gap: 0.5rem;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.checkbox-item-inline {
|
|
10
|
-
display: flex;
|
|
11
|
-
justify-content: flex-end;
|
|
12
|
-
flex-direction: row-reverse;
|
|
13
|
-
gap: 0.5rem;
|
|
14
|
-
}
|
|
@@ -1,112 +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 { AtomixFormCheckboxComponent } from './atomix-form-checkbox.component';
|
|
5
|
-
|
|
6
|
-
describe('AtomixFormCheckboxComponent', () => {
|
|
7
|
-
let component: AtomixFormCheckboxComponent;
|
|
8
|
-
let fixture: ComponentFixture<AtomixFormCheckboxComponent>;
|
|
9
|
-
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
TestBed.configureTestingModule({
|
|
12
|
-
declarations: [AtomixFormCheckboxComponent],
|
|
13
|
-
imports: [ReactiveFormsModule],
|
|
14
|
-
schemas: [NO_ERRORS_SCHEMA],
|
|
15
|
-
});
|
|
16
|
-
fixture = TestBed.createComponent(AtomixFormCheckboxComponent);
|
|
17
|
-
component = fixture.componentInstance;
|
|
18
|
-
component.form = new FormGroup({ testField: new FormControl(false) });
|
|
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(true);
|
|
38
|
-
expect(component.control.value).toBe(true);
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
describe('checkbox toggle updating form control', () => {
|
|
43
|
-
it('should update form control value when toggled to true', () => {
|
|
44
|
-
component.control.setValue(true);
|
|
45
|
-
expect(component.form.get('testField')!.value).toBe(true);
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it('should update form control value when toggled to false', () => {
|
|
49
|
-
component.control.setValue(true);
|
|
50
|
-
component.control.setValue(false);
|
|
51
|
-
expect(component.form.get('testField')!.value).toBe(false);
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
it('should emit valueChange on onChange', () => {
|
|
55
|
-
const emitSpy = jest.fn();
|
|
56
|
-
component.valueChange.subscribe(emitSpy);
|
|
57
|
-
|
|
58
|
-
const mockEvent = { checked: true };
|
|
59
|
-
component.onChange(mockEvent);
|
|
60
|
-
|
|
61
|
-
expect(emitSpy).toHaveBeenCalledWith(mockEvent);
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
describe('input properties', () => {
|
|
66
|
-
it('should have default binary as false', () => {
|
|
67
|
-
expect(component.binary).toBe(false);
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
it('should accept binary input', () => {
|
|
71
|
-
component.binary = true;
|
|
72
|
-
expect(component.binary).toBe(true);
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
it('should have default inline as false', () => {
|
|
76
|
-
expect(component.inline).toBe(false);
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
it('should accept inline input', () => {
|
|
80
|
-
component.inline = true;
|
|
81
|
-
expect(component.inline).toBe(true);
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
it('should have default label as empty string', () => {
|
|
85
|
-
expect(component.label).toBe('');
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
it('should accept label input', () => {
|
|
89
|
-
component.label = 'Accept Terms';
|
|
90
|
-
expect(component.label).toBe('Accept Terms');
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
it('should accept tooltip input', () => {
|
|
94
|
-
component.tooltip = 'Check to agree';
|
|
95
|
-
expect(component.tooltip).toBe('Check to agree');
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
it('should have default tooltipPosition as bottom', () => {
|
|
99
|
-
expect(component.tooltipPosition).toBe('bottom');
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
it('should accept tooltipPosition input', () => {
|
|
103
|
-
component.tooltipPosition = 'top';
|
|
104
|
-
expect(component.tooltipPosition).toBe('top');
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
it('should accept value input', () => {
|
|
108
|
-
component.value = 'option1';
|
|
109
|
-
expect(component.value).toBe('option1');
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
-
import { FormControl, FormGroup } from '@angular/forms';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'atomix-form-checkbox',
|
|
6
|
-
templateUrl: './atomix-form-checkbox.component.html',
|
|
7
|
-
styleUrls: ['./atomix-form-checkbox.component.scss'],
|
|
8
|
-
})
|
|
9
|
-
export class AtomixFormCheckboxComponent {
|
|
10
|
-
@Input() binary = false;
|
|
11
|
-
@Input() controlName!: string;
|
|
12
|
-
@Input() form!: FormGroup;
|
|
13
|
-
@Input() inline = false;
|
|
14
|
-
@Input() label = '';
|
|
15
|
-
@Input() tooltip!: string;
|
|
16
|
-
@Input() tooltipPosition: 'right' | 'left' | 'top' | 'bottom' = 'bottom';
|
|
17
|
-
@Input() value!: string;
|
|
18
|
-
|
|
19
|
-
@Output() valueChange = new EventEmitter();
|
|
20
|
-
|
|
21
|
-
get control() {
|
|
22
|
-
return this.form.get(this.controlName) as FormControl;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
onChange(event: any) {
|
|
26
|
-
this.valueChange.emit(event);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<div class="item flex flex-column">
|
|
2
|
-
<label *ngIf="label" [htmlFor]="controlName"
|
|
3
|
-
>{{ label }}
|
|
4
|
-
<i
|
|
5
|
-
*ngIf="isLabelIconRequired"
|
|
6
|
-
[class]="isLabelIconData?.iconClass + ' ml-2'"
|
|
7
|
-
[pTooltip]="isLabelIconData?.tooltip"
|
|
8
|
-
></i
|
|
9
|
-
></label>
|
|
10
|
-
<p-chips
|
|
11
|
-
separator=","
|
|
12
|
-
placeholder="Separate values with a comma or enter."
|
|
13
|
-
[formControl]="control"
|
|
14
|
-
[id]="controlName"
|
|
15
|
-
[pTooltip]="tooltip"
|
|
16
|
-
[tooltipPosition]="tooltipPosition"
|
|
17
|
-
[styleClass]="styleClass + ' lib-form-chips'"
|
|
18
|
-
[allowDuplicate]="allowDuplicate"
|
|
19
|
-
></p-chips>
|
|
20
|
-
</div>
|