primekit 1.0.10 → 1.0.12
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/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 +674 -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 +3115 -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 +72 -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 -12
- package/{src/public-api.ts → public-api.d.ts} +38 -47
- 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,153 +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 { AtomixFormChipsComponent } from './atomix-form-chips.component';
|
|
5
|
-
|
|
6
|
-
describe('AtomixFormChipsComponent', () => {
|
|
7
|
-
let component: AtomixFormChipsComponent;
|
|
8
|
-
let fixture: ComponentFixture<AtomixFormChipsComponent>;
|
|
9
|
-
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
TestBed.configureTestingModule({
|
|
12
|
-
declarations: [AtomixFormChipsComponent],
|
|
13
|
-
imports: [ReactiveFormsModule],
|
|
14
|
-
schemas: [NO_ERRORS_SCHEMA],
|
|
15
|
-
});
|
|
16
|
-
fixture = TestBed.createComponent(AtomixFormChipsComponent);
|
|
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(['chip1', 'chip2']);
|
|
38
|
-
expect(component.control.value).toEqual(['chip1', 'chip2']);
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
describe('chip add/remove updating form control', () => {
|
|
43
|
-
it('should update form control value when a chip is added', () => {
|
|
44
|
-
component.control.setValue(['chip1']);
|
|
45
|
-
expect(component.form.get('testField')!.value).toEqual(['chip1']);
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it('should update form control value when multiple chips are added', () => {
|
|
49
|
-
component.control.setValue(['chip1', 'chip2', 'chip3']);
|
|
50
|
-
expect(component.form.get('testField')!.value).toEqual(['chip1', 'chip2', 'chip3']);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it('should update form control value when a chip is removed', () => {
|
|
54
|
-
component.control.setValue(['chip1', 'chip2', 'chip3']);
|
|
55
|
-
component.control.setValue(['chip1', 'chip3']);
|
|
56
|
-
expect(component.form.get('testField')!.value).toEqual(['chip1', 'chip3']);
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it('should update form control to empty array when all chips are removed', () => {
|
|
60
|
-
component.control.setValue(['chip1', 'chip2']);
|
|
61
|
-
component.control.setValue([]);
|
|
62
|
-
expect(component.form.get('testField')!.value).toEqual([]);
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
describe('input properties', () => {
|
|
67
|
-
it('should have default label as empty string', () => {
|
|
68
|
-
expect(component.label).toBe('');
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
it('should accept label input', () => {
|
|
72
|
-
component.label = 'Tags';
|
|
73
|
-
expect(component.label).toBe('Tags');
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
it('should have default placeholder as empty string', () => {
|
|
77
|
-
expect(component.placeholder).toBe('');
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
it('should accept placeholder input', () => {
|
|
81
|
-
component.placeholder = 'Add a tag';
|
|
82
|
-
expect(component.placeholder).toBe('Add a tag');
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
it('should accept tooltip input', () => {
|
|
86
|
-
component.tooltip = 'Enter tags separated by comma';
|
|
87
|
-
expect(component.tooltip).toBe('Enter tags separated by comma');
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
it('should have default tooltipPosition as bottom', () => {
|
|
91
|
-
expect(component.tooltipPosition).toBe('bottom');
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
it('should accept tooltipPosition input', () => {
|
|
95
|
-
component.tooltipPosition = 'top';
|
|
96
|
-
expect(component.tooltipPosition).toBe('top');
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
it('should have default type as text', () => {
|
|
100
|
-
expect(component.type).toBe('text');
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
it('should accept type input', () => {
|
|
104
|
-
component.type = 'email';
|
|
105
|
-
expect(component.type).toBe('email');
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
it('should have default styleClass as empty string', () => {
|
|
109
|
-
expect(component.styleClass).toBe('');
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
it('should accept styleClass input', () => {
|
|
113
|
-
component.styleClass = 'custom-class';
|
|
114
|
-
expect(component.styleClass).toBe('custom-class');
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
it('should have default allowDuplicate as false', () => {
|
|
118
|
-
expect(component.allowDuplicate).toBe(false);
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
it('should accept allowDuplicate input', () => {
|
|
122
|
-
component.allowDuplicate = true;
|
|
123
|
-
expect(component.allowDuplicate).toBe(true);
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
it('should have default isLabelIconRequired as false', () => {
|
|
127
|
-
expect(component.isLabelIconRequired).toBe(false);
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
it('should accept isLabelIconRequired input', () => {
|
|
131
|
-
component.isLabelIconRequired = true;
|
|
132
|
-
expect(component.isLabelIconRequired).toBe(true);
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
it('should have default isLabelIconData with empty values', () => {
|
|
136
|
-
expect(component.isLabelIconData).toEqual({
|
|
137
|
-
iconClass: '',
|
|
138
|
-
tooltip: '',
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
it('should accept isLabelIconData input', () => {
|
|
143
|
-
component.isLabelIconData = {
|
|
144
|
-
iconClass: 'pi pi-info-circle',
|
|
145
|
-
tooltip: 'Help text',
|
|
146
|
-
};
|
|
147
|
-
expect(component.isLabelIconData).toEqual({
|
|
148
|
-
iconClass: 'pi pi-info-circle',
|
|
149
|
-
tooltip: 'Help text',
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
});
|
|
153
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Component, Input } from '@angular/core';
|
|
2
|
-
import { FormControl, FormGroup } from '@angular/forms';
|
|
3
|
-
import { LabelIconData } from './form.chips.models';
|
|
4
|
-
|
|
5
|
-
@Component({
|
|
6
|
-
selector: 'atomix-form-chips',
|
|
7
|
-
templateUrl: './atomix-form-chips.component.html',
|
|
8
|
-
styleUrls: ['./atomix-form-chips.component.scss'],
|
|
9
|
-
})
|
|
10
|
-
export class AtomixFormChipsComponent {
|
|
11
|
-
@Input() controlName!: string;
|
|
12
|
-
@Input() form!: FormGroup;
|
|
13
|
-
@Input() label = '';
|
|
14
|
-
@Input() placeholder = '';
|
|
15
|
-
@Input() tooltip!: string;
|
|
16
|
-
@Input() tooltipPosition: 'right' | 'left' | 'top' | 'bottom' = 'bottom';
|
|
17
|
-
@Input() type = 'text';
|
|
18
|
-
@Input() styleClass = '';
|
|
19
|
-
@Input() allowDuplicate: boolean = false;
|
|
20
|
-
@Input() isLabelIconData: LabelIconData = {
|
|
21
|
-
iconClass: '',
|
|
22
|
-
tooltip: '',
|
|
23
|
-
};
|
|
24
|
-
@Input() isLabelIconRequired: boolean = false;
|
|
25
|
-
get control() {
|
|
26
|
-
return this.form.get(this.controlName) as FormControl;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<label *ngIf="label" [for]="controlName"
|
|
2
|
-
>{{ label }}
|
|
3
|
-
<span *ngIf="isLabelRequired" class="lib-error-asterisk">*</span>
|
|
4
|
-
<i
|
|
5
|
-
*ngIf="isLabelIconData.required"
|
|
6
|
-
[class]="isLabelIconData?.iconClass"
|
|
7
|
-
[pTooltip]="isLabelIconData?.tooltip"
|
|
8
|
-
></i
|
|
9
|
-
></label>
|
|
10
|
-
<p-dropdown
|
|
11
|
-
[filter]="filterResults"
|
|
12
|
-
[formControl]="control"
|
|
13
|
-
[placeholder]="placeholder"
|
|
14
|
-
[options]="options"
|
|
15
|
-
[optionLabel]="optionLabel"
|
|
16
|
-
[optionValue]="optionValue"
|
|
17
|
-
[showClear]="showClear"
|
|
18
|
-
[pTooltip]="tooltip"
|
|
19
|
-
[tooltipPosition]="tooltipPosition"
|
|
20
|
-
(onChange)="selectionChange.emit($event)"
|
|
21
|
-
[styleClass]="styleClass + ' form-dropdown'"
|
|
22
|
-
appendTo="body"
|
|
23
|
-
>
|
|
24
|
-
</p-dropdown>
|
|
@@ -1,156 +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 { AtomixFormDropdownComponent } from './atomix-form-dropdown.component';
|
|
5
|
-
|
|
6
|
-
describe('AtomixFormDropdownComponent', () => {
|
|
7
|
-
let component: AtomixFormDropdownComponent;
|
|
8
|
-
let fixture: ComponentFixture<AtomixFormDropdownComponent>;
|
|
9
|
-
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
TestBed.configureTestingModule({
|
|
12
|
-
declarations: [AtomixFormDropdownComponent],
|
|
13
|
-
imports: [ReactiveFormsModule],
|
|
14
|
-
schemas: [NO_ERRORS_SCHEMA],
|
|
15
|
-
});
|
|
16
|
-
fixture = TestBed.createComponent(AtomixFormDropdownComponent);
|
|
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('options input', () => {
|
|
43
|
-
it('should accept options input', () => {
|
|
44
|
-
const options = [
|
|
45
|
-
{ label: 'Option A', value: 'a' },
|
|
46
|
-
{ label: 'Option B', value: 'b' },
|
|
47
|
-
];
|
|
48
|
-
component.options = options;
|
|
49
|
-
expect(component.options).toEqual(options);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it('should accept optionLabel input', () => {
|
|
53
|
-
component.optionLabel = 'name';
|
|
54
|
-
expect(component.optionLabel).toBe('name');
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it('should accept optionValue input', () => {
|
|
58
|
-
component.optionValue = 'id';
|
|
59
|
-
expect(component.optionValue).toBe('id');
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
describe('selection updating form control', () => {
|
|
64
|
-
it('should emit selectionChange when selection occurs', () => {
|
|
65
|
-
const emitSpy = jest.fn();
|
|
66
|
-
component.selectionChange.subscribe(emitSpy);
|
|
67
|
-
|
|
68
|
-
const mockEvent = { value: 'selectedValue' };
|
|
69
|
-
component.selectionChange.emit(mockEvent);
|
|
70
|
-
|
|
71
|
-
expect(emitSpy).toHaveBeenCalledWith(mockEvent);
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
it('should update form control value when set programmatically', () => {
|
|
75
|
-
component.control.setValue('newSelection');
|
|
76
|
-
expect(component.form.get('testField')!.value).toBe('newSelection');
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
describe('input properties', () => {
|
|
81
|
-
it('should have default label as empty string', () => {
|
|
82
|
-
expect(component.label).toBe('');
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
it('should accept label input', () => {
|
|
86
|
-
component.label = 'Select Country';
|
|
87
|
-
expect(component.label).toBe('Select Country');
|
|
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 = 'Choose an option';
|
|
96
|
-
expect(component.placeholder).toBe('Choose an option');
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
it('should have default filterResults as false', () => {
|
|
100
|
-
expect(component.filterResults).toBe(false);
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
it('should accept filterResults input', () => {
|
|
104
|
-
component.filterResults = true;
|
|
105
|
-
expect(component.filterResults).toBe(true);
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
it('should have default showClear as true', () => {
|
|
109
|
-
expect(component.showClear).toBe(true);
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
it('should accept showClear input', () => {
|
|
113
|
-
component.showClear = false;
|
|
114
|
-
expect(component.showClear).toBe(false);
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
it('should have default tooltipPosition as bottom', () => {
|
|
118
|
-
expect(component.tooltipPosition).toBe('bottom');
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
it('should accept tooltipPosition input', () => {
|
|
122
|
-
component.tooltipPosition = 'top';
|
|
123
|
-
expect(component.tooltipPosition).toBe('top');
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
it('should have default isLabelRequired as false', () => {
|
|
127
|
-
expect(component.isLabelRequired).toBe(false);
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
it('should accept isLabelRequired input', () => {
|
|
131
|
-
component.isLabelRequired = true;
|
|
132
|
-
expect(component.isLabelRequired).toBe(true);
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
it('should accept styleClass input', () => {
|
|
136
|
-
component.styleClass = 'custom-class';
|
|
137
|
-
expect(component.styleClass).toBe('custom-class');
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
it('should accept tooltip input', () => {
|
|
141
|
-
component.tooltip = 'Help text';
|
|
142
|
-
expect(component.tooltip).toBe('Help text');
|
|
143
|
-
});
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
describe('filterEvent output', () => {
|
|
147
|
-
it('should emit filterEvent when triggered', () => {
|
|
148
|
-
const emitSpy = jest.fn();
|
|
149
|
-
component.filterEvent.subscribe(emitSpy);
|
|
150
|
-
|
|
151
|
-
component.filterEvent.emit('search term');
|
|
152
|
-
|
|
153
|
-
expect(emitSpy).toHaveBeenCalledWith('search term');
|
|
154
|
-
});
|
|
155
|
-
});
|
|
156
|
-
});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Component, EventEmitter, Input, Output } 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-dropdown',
|
|
7
|
-
templateUrl: './atomix-form-dropdown.component.html',
|
|
8
|
-
styleUrls: ['./atomix-form-dropdown.component.scss'],
|
|
9
|
-
})
|
|
10
|
-
export class AtomixFormDropdownComponent {
|
|
11
|
-
@Input() controlName!: string;
|
|
12
|
-
@Input() filterResults = false;
|
|
13
|
-
@Input() form!: FormGroup;
|
|
14
|
-
@Input() label = '';
|
|
15
|
-
@Input() optionLabel = '';
|
|
16
|
-
@Input() optionValue = '';
|
|
17
|
-
@Input() options!: any;
|
|
18
|
-
@Input() placeholder = '';
|
|
19
|
-
@Input() showClear = true;
|
|
20
|
-
@Input() tooltip!: string;
|
|
21
|
-
@Input() tooltipPosition: 'right' | 'left' | 'top' | 'bottom' = 'bottom';
|
|
22
|
-
@Input() isLabelRequired: boolean = false;
|
|
23
|
-
@Input() styleClass!: string;
|
|
24
|
-
@Input() isLabelIconData: LabelIconData = {
|
|
25
|
-
iconClass: '',
|
|
26
|
-
tooltip: '',
|
|
27
|
-
required: false,
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
@Output() selectionChange = new EventEmitter();
|
|
31
|
-
@Output() filterEvent = new EventEmitter<string>();
|
|
32
|
-
|
|
33
|
-
get control() {
|
|
34
|
-
return this.form.get(this.controlName) as FormControl;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
<label *ngIf="label" [for]="controlName"
|
|
2
|
-
>{{ label }} <span *ngIf="isLabelRequired" class="error-asterisk">*</span
|
|
3
|
-
><i
|
|
4
|
-
*ngIf="isLabelIconRequired"
|
|
5
|
-
[class]="isLabelIconData?.iconClass + ' ml-2'"
|
|
6
|
-
[pTooltip]="isLabelIconData?.tooltip"
|
|
7
|
-
></i
|
|
8
|
-
></label>
|
|
9
|
-
<div class="input-wrapper">
|
|
10
|
-
<input
|
|
11
|
-
pInputText
|
|
12
|
-
[id]="controlName"
|
|
13
|
-
[formControl]="control"
|
|
14
|
-
[placeholder]="placeholder"
|
|
15
|
-
[maxlength]="max"
|
|
16
|
-
[min]="min"
|
|
17
|
-
(input)="onInput($event)"
|
|
18
|
-
[pTooltip]="tooltip"
|
|
19
|
-
[type]="type"
|
|
20
|
-
[tooltipPosition]="tooltipPosition"
|
|
21
|
-
[ngClass]="class + ' lib-input-field' + (buttonText ? ' with-button' : '')"
|
|
22
|
-
autocomplete="new-password"
|
|
23
|
-
[style]="style"
|
|
24
|
-
/>
|
|
25
|
-
<button
|
|
26
|
-
*ngIf="buttonText"
|
|
27
|
-
(click)="buttonClick.emit()"
|
|
28
|
-
class="inline-button"
|
|
29
|
-
[type]="buttonType"
|
|
30
|
-
>
|
|
31
|
-
{{ buttonText }}
|
|
32
|
-
</button>
|
|
33
|
-
</div>
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
::ng-deep .lib-input-field {
|
|
2
|
-
border-radius: var(--global-border-radius);
|
|
3
|
-
margin-top: 0.2rem;
|
|
4
|
-
}
|
|
5
|
-
::ng-deep .lib-input-field.with-button {
|
|
6
|
-
padding-right: 6rem;
|
|
7
|
-
}
|
|
8
|
-
.error-asterisk {
|
|
9
|
-
color: red;
|
|
10
|
-
}
|
|
11
|
-
.input-wrapper {
|
|
12
|
-
position: relative;
|
|
13
|
-
}
|
|
14
|
-
.inline-button {
|
|
15
|
-
position: absolute;
|
|
16
|
-
right: 5px;
|
|
17
|
-
background-color: transparent;
|
|
18
|
-
color: #63b77e;
|
|
19
|
-
font-weight: 700;
|
|
20
|
-
border: none;
|
|
21
|
-
cursor: pointer;
|
|
22
|
-
font-size: 0.875rem;
|
|
23
|
-
height: 95%;
|
|
24
|
-
margin-top: 0.2rem;
|
|
25
|
-
border-left: 1px solid grey;
|
|
26
|
-
&:focus {
|
|
27
|
-
outline: none;
|
|
28
|
-
}
|
|
29
|
-
&:hover {
|
|
30
|
-
background-color: transparent;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1,156 +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 { AtomixFormInputComponent } from './atomix-form-input-component.component';
|
|
5
|
-
|
|
6
|
-
describe('AtomixFormInputComponent', () => {
|
|
7
|
-
let component: AtomixFormInputComponent;
|
|
8
|
-
let fixture: ComponentFixture<AtomixFormInputComponent>;
|
|
9
|
-
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
TestBed.configureTestingModule({
|
|
12
|
-
declarations: [AtomixFormInputComponent],
|
|
13
|
-
imports: [ReactiveFormsModule],
|
|
14
|
-
schemas: [NO_ERRORS_SCHEMA],
|
|
15
|
-
});
|
|
16
|
-
fixture = TestBed.createComponent(AtomixFormInputComponent);
|
|
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');
|
|
38
|
-
expect(component.control.value).toBe('hello');
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
describe('input properties', () => {
|
|
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 = 'Username';
|
|
49
|
-
fixture.detectChanges();
|
|
50
|
-
expect(component.label).toBe('Username');
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it('should have default placeholder as empty string', () => {
|
|
54
|
-
expect(component.placeholder).toBe('');
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it('should accept placeholder input', () => {
|
|
58
|
-
component.placeholder = 'Enter value';
|
|
59
|
-
fixture.detectChanges();
|
|
60
|
-
expect(component.placeholder).toBe('Enter value');
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
it('should have default type as text', () => {
|
|
64
|
-
expect(component.type).toBe('text');
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it('should accept type input', () => {
|
|
68
|
-
component.type = 'number';
|
|
69
|
-
fixture.detectChanges();
|
|
70
|
-
expect(component.type).toBe('number');
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
it('should have default tooltipPosition as bottom', () => {
|
|
74
|
-
expect(component.tooltipPosition).toBe('bottom');
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
it('should accept tooltipPosition input', () => {
|
|
78
|
-
component.tooltipPosition = 'top';
|
|
79
|
-
fixture.detectChanges();
|
|
80
|
-
expect(component.tooltipPosition).toBe('top');
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it('should have default buttonText as empty string', () => {
|
|
84
|
-
expect(component.buttonText).toBe('');
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
it('should accept buttonText input', () => {
|
|
88
|
-
component.buttonText = 'Submit';
|
|
89
|
-
fixture.detectChanges();
|
|
90
|
-
expect(component.buttonText).toBe('Submit');
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
it('should have default buttonType as button', () => {
|
|
94
|
-
expect(component.buttonType).toBe('button');
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
it('should accept buttonType input', () => {
|
|
98
|
-
component.buttonType = 'submit';
|
|
99
|
-
fixture.detectChanges();
|
|
100
|
-
expect(component.buttonType).toBe('submit');
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
it('should have default isLabelRequired as false', () => {
|
|
104
|
-
expect(component.isLabelRequired).toBe(false);
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
it('should accept isLabelRequired input', () => {
|
|
108
|
-
component.isLabelRequired = true;
|
|
109
|
-
fixture.detectChanges();
|
|
110
|
-
expect(component.isLabelRequired).toBe(true);
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
it('should have default isLabelIconRequired as false', () => {
|
|
114
|
-
expect(component.isLabelIconRequired).toBe(false);
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
it('should accept isLabelIconRequired input', () => {
|
|
118
|
-
component.isLabelIconRequired = true;
|
|
119
|
-
fixture.detectChanges();
|
|
120
|
-
expect(component.isLabelIconRequired).toBe(true);
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
describe('changeValueHandler emission', () => {
|
|
125
|
-
it('should emit changeValueHandler when onInput is called', () => {
|
|
126
|
-
const emitSpy = jest.fn();
|
|
127
|
-
component.changeValueHandler.subscribe(emitSpy);
|
|
128
|
-
|
|
129
|
-
const mockEvent = { target: { value: 'new value' } } as unknown as Event;
|
|
130
|
-
component.onInput(mockEvent);
|
|
131
|
-
|
|
132
|
-
expect(emitSpy).toHaveBeenCalledWith('new value');
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
it('should emit empty string when input is cleared', () => {
|
|
136
|
-
const emitSpy = jest.fn();
|
|
137
|
-
component.changeValueHandler.subscribe(emitSpy);
|
|
138
|
-
|
|
139
|
-
const mockEvent = { target: { value: '' } } as unknown as Event;
|
|
140
|
-
component.onInput(mockEvent);
|
|
141
|
-
|
|
142
|
-
expect(emitSpy).toHaveBeenCalledWith('');
|
|
143
|
-
});
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
describe('buttonClick emission', () => {
|
|
147
|
-
it('should emit buttonClick when triggered', () => {
|
|
148
|
-
const emitSpy = jest.fn();
|
|
149
|
-
component.buttonClick.subscribe(emitSpy);
|
|
150
|
-
|
|
151
|
-
component.buttonClick.emit();
|
|
152
|
-
|
|
153
|
-
expect(emitSpy).toHaveBeenCalled();
|
|
154
|
-
});
|
|
155
|
-
});
|
|
156
|
-
});
|
package/src/lib/lib/atomix-form/atomix-form-input-component/atomix-form-input-component.component.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Component, EventEmitter, Input, Output } 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-input',
|
|
7
|
-
templateUrl: './atomix-form-input-component.component.html',
|
|
8
|
-
styleUrls: ['./atomix-form-input-component.component.scss'],
|
|
9
|
-
})
|
|
10
|
-
export class AtomixFormInputComponent {
|
|
11
|
-
@Input() controlName!: string;
|
|
12
|
-
@Input() form!: FormGroup;
|
|
13
|
-
@Input() label = '';
|
|
14
|
-
@Input() max!: number | null;
|
|
15
|
-
@Input() min!: number;
|
|
16
|
-
@Input() placeholder = '';
|
|
17
|
-
@Input() type = 'text';
|
|
18
|
-
@Input() tooltip!: string;
|
|
19
|
-
@Input() class!: string;
|
|
20
|
-
@Input() style: any;
|
|
21
|
-
@Input() isLabelIconData: LabelIconData = {
|
|
22
|
-
iconClass: '',
|
|
23
|
-
tooltip: '',
|
|
24
|
-
};
|
|
25
|
-
@Input() isLabelIconRequired: boolean = false;
|
|
26
|
-
@Input() isLabelRequired: boolean = false;
|
|
27
|
-
@Input() tooltipPosition: 'right' | 'left' | 'top' | 'bottom' = 'bottom';
|
|
28
|
-
@Input() buttonText: string = '';
|
|
29
|
-
@Input() buttonType: 'button' | 'submit' = 'button';
|
|
30
|
-
@Output() changeValueHandler = new EventEmitter<string>();
|
|
31
|
-
@Output() buttonClick = new EventEmitter<void>();
|
|
32
|
-
|
|
33
|
-
get control() {
|
|
34
|
-
return this.form.get(this.controlName) as FormControl;
|
|
35
|
-
}
|
|
36
|
-
onInput(event: Event): void {
|
|
37
|
-
console.log(this.buttonType);
|
|
38
|
-
const input = event.target as HTMLInputElement;
|
|
39
|
-
|
|
40
|
-
this.changeValueHandler.emit(input.value);
|
|
41
|
-
}
|
|
42
|
-
}
|