primekit 1.0.9 → 1.0.10
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/ng-package.json +8 -0
- package/package.json +12 -25
- package/src/assets/images/empty-table.svg +25 -25
- package/src/lib/lib/atomix-alert/atomix-alert.component.css +67 -0
- package/src/lib/lib/atomix-alert/atomix-alert.component.html +7 -0
- package/src/lib/lib/atomix-alert/atomix-alert.component.spec.ts +154 -0
- package/src/lib/lib/atomix-alert/atomix-alert.component.ts +75 -0
- package/src/lib/lib/atomix-autocomplete/atomix-autocomplete.component.html +35 -0
- package/src/lib/lib/atomix-autocomplete/atomix-autocomplete.component.scss +72 -0
- package/src/lib/lib/atomix-autocomplete/atomix-autocomplete.component.spec.ts +210 -0
- package/src/lib/lib/atomix-autocomplete/atomix-autocomplete.component.ts +70 -0
- package/src/lib/lib/atomix-button/atomix-button.component.css +70 -0
- package/src/lib/lib/atomix-button/atomix-button.component.html +20 -0
- package/src/lib/lib/atomix-button/atomix-button.component.spec.ts +135 -0
- package/src/lib/lib/atomix-button/atomix-button.component.ts +28 -0
- package/{lib/lib/atomix-button/atomix-button.models.d.ts → src/lib/lib/atomix-button/atomix-button.models.ts} +2 -2
- package/src/lib/lib/atomix-calendar/atomix-calendar.component.css +5 -0
- package/src/lib/lib/atomix-calendar/atomix-calendar.component.html +20 -0
- package/src/lib/lib/atomix-calendar/atomix-calendar.component.spec.ts +145 -0
- package/src/lib/lib/atomix-calendar/atomix-calendar.component.ts +71 -0
- package/src/lib/lib/atomix-card/atomix-card.component.css +4 -0
- package/src/lib/lib/atomix-card/atomix-card.component.html +3 -0
- package/src/lib/lib/atomix-card/atomix-card.component.spec.ts +63 -0
- package/src/lib/lib/atomix-card/atomix-card.component.ts +13 -0
- package/src/lib/lib/atomix-confirmation-dialog/atomix-confirmation-dialog.component.css +12 -0
- package/src/lib/lib/atomix-confirmation-dialog/atomix-confirmation-dialog.component.html +9 -0
- package/src/lib/lib/atomix-confirmation-dialog/atomix-confirmation-dialog.component.spec.ts +63 -0
- package/src/lib/lib/atomix-confirmation-dialog/atomix-confirmation-dialog.component.ts +22 -0
- package/src/lib/lib/atomix-daterange-calendar/atomix-daterange-calendar.component.html +233 -0
- package/src/lib/lib/atomix-daterange-calendar/atomix-daterange-calendar.component.scss +266 -0
- package/src/lib/lib/atomix-daterange-calendar/atomix-daterange-calendar.component.spec.ts +1465 -0
- package/src/lib/lib/atomix-daterange-calendar/atomix-daterange-calendar.component.ts +717 -0
- package/src/lib/lib/atomix-divider/atomix-divider.component.css +0 -0
- package/src/lib/lib/atomix-divider/atomix-divider.component.html +7 -0
- package/src/lib/lib/atomix-divider/atomix-divider.component.spec.ts +91 -0
- package/src/lib/lib/atomix-divider/atomix-divider.component.ts +17 -0
- package/src/lib/lib/atomix-dropdown/atomix-dropdown.component.css +25 -0
- package/src/lib/lib/atomix-dropdown/atomix-dropdown.component.html +37 -0
- package/src/lib/lib/atomix-dropdown/atomix-dropdown.component.spec.ts +178 -0
- package/src/lib/lib/atomix-dropdown/atomix-dropdown.component.ts +89 -0
- 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 +128 -0
- package/src/lib/lib/atomix-dynamic-dialog/atomix-dynamic-dialog.component.ts +42 -0
- package/src/lib/lib/atomix-dynamic-dialog/atomix-dynamic-dialog.models.ts +12 -0
- package/src/lib/lib/atomix-form/atomix-form-autocomplete/atomix-form-autocomplete.component.html +20 -0
- package/src/lib/lib/atomix-form/atomix-form-autocomplete/atomix-form-autocomplete.component.scss +7 -0
- package/src/lib/lib/atomix-form/atomix-form-autocomplete/atomix-form-autocomplete.component.spec.ts +169 -0
- package/src/lib/lib/atomix-form/atomix-form-autocomplete/atomix-form-autocomplete.component.ts +41 -0
- package/src/lib/lib/atomix-form/atomix-form-calendar/atomix-form-calendar.component.html +21 -0
- package/src/lib/lib/atomix-form/atomix-form-calendar/atomix-form-calendar.component.scss +7 -0
- package/src/lib/lib/atomix-form/atomix-form-calendar/atomix-form-calendar.component.spec.ts +142 -0
- package/src/lib/lib/atomix-form/atomix-form-calendar/atomix-form-calendar.component.ts +32 -0
- package/src/lib/lib/atomix-form/atomix-form-checkbox/atomix-form-checkbox.component.html +13 -0
- package/src/lib/lib/atomix-form/atomix-form-checkbox/atomix-form-checkbox.component.scss +14 -0
- package/src/lib/lib/atomix-form/atomix-form-checkbox/atomix-form-checkbox.component.spec.ts +112 -0
- package/src/lib/lib/atomix-form/atomix-form-checkbox/atomix-form-checkbox.component.ts +28 -0
- package/src/lib/lib/atomix-form/atomix-form-chips/atomix-form-chips.component.html +20 -0
- package/src/lib/lib/atomix-form/atomix-form-chips/atomix-form-chips.component.scss +3 -0
- package/src/lib/lib/atomix-form/atomix-form-chips/atomix-form-chips.component.spec.ts +153 -0
- package/src/lib/lib/atomix-form/atomix-form-chips/atomix-form-chips.component.ts +28 -0
- package/src/lib/lib/atomix-form/atomix-form-chips/form.chips.models.ts +5 -0
- package/src/lib/lib/atomix-form/atomix-form-dropdown/atomix-form-dropdown.component.html +24 -0
- package/src/lib/lib/atomix-form/atomix-form-dropdown/atomix-form-dropdown.component.scss +15 -0
- package/src/lib/lib/atomix-form/atomix-form-dropdown/atomix-form-dropdown.component.spec.ts +156 -0
- package/src/lib/lib/atomix-form/atomix-form-dropdown/atomix-form-dropdown.component.ts +36 -0
- package/src/lib/lib/atomix-form/atomix-form-input-component/atomix-form-input-component.component.html +33 -0
- package/src/lib/lib/atomix-form/atomix-form-input-component/atomix-form-input-component.component.scss +32 -0
- package/src/lib/lib/atomix-form/atomix-form-input-component/atomix-form-input-component.component.spec.ts +156 -0
- package/src/lib/lib/atomix-form/atomix-form-input-component/atomix-form-input-component.component.ts +42 -0
- package/src/lib/lib/atomix-form/atomix-form-inputmask-component/atomix-form-inputmask-component.component.html +14 -0
- 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 +104 -0
- package/src/lib/lib/atomix-form/atomix-form-inputmask-component/atomix-form-inputmask-component.component.ts +24 -0
- package/src/lib/lib/atomix-form/atomix-form-password-component/atomix-form-password-component.component.html +16 -0
- 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 +92 -0
- package/src/lib/lib/atomix-form/atomix-form-password-component/atomix-form-password-component.component.ts +24 -0
- package/src/lib/lib/atomix-form/atomix-form-radio-button/atomix-radio-button.component.html +23 -0
- package/src/lib/lib/atomix-form/atomix-form-radio-button/atomix-radio-button.component.scss +3 -0
- package/src/lib/lib/atomix-form/atomix-form-radio-button/atomix-radio-button.component.spec.ts +126 -0
- package/src/lib/lib/atomix-form/atomix-form-radio-button/atomix-radio-button.component.ts +26 -0
- package/src/lib/lib/atomix-form/atomix-form-textarea/atomix-form-textarea.component.html +17 -0
- package/src/lib/lib/atomix-form/atomix-form-textarea/atomix-form-textarea.component.scss +6 -0
- package/src/lib/lib/atomix-form/atomix-form-textarea/atomix-form-textarea.component.spec.ts +120 -0
- package/src/lib/lib/atomix-form/atomix-form-textarea/atomix-form-textarea.component.ts +24 -0
- package/src/lib/lib/atomix-input/atomix-input.component.css +52 -0
- package/src/lib/lib/atomix-input/atomix-input.component.html +45 -0
- package/src/lib/lib/atomix-input/atomix-input.component.spec.ts +229 -0
- package/src/lib/lib/atomix-input/atomix-input.component.ts +64 -0
- package/src/lib/lib/atomix-input-switch/atomix-input-switch.component.css +12 -0
- package/src/lib/lib/atomix-input-switch/atomix-input-switch.component.html +17 -0
- package/src/lib/lib/atomix-input-switch/atomix-input-switch.component.spec.ts +173 -0
- package/src/lib/lib/atomix-input-switch/atomix-input-switch.component.ts +62 -0
- package/src/lib/lib/atomix-loading-overlay/atomix-loading-overlay.component.html +47 -0
- package/src/lib/lib/atomix-loading-overlay/atomix-loading-overlay.component.scss +14 -0
- package/src/lib/lib/atomix-loading-overlay/atomix-loading-overlay.component.spec.ts +21 -0
- package/src/lib/lib/atomix-loading-overlay/atomix-loading-overlay.component.ts +25 -0
- package/src/lib/lib/atomix-messages/messages.component.css +0 -0
- package/src/lib/lib/atomix-messages/messages.component.html +9 -0
- package/src/lib/lib/atomix-messages/messages.component.spec.ts +115 -0
- package/src/lib/lib/atomix-messages/messages.component.ts +17 -0
- package/src/lib/lib/atomix-pagination/atomix-pagination.component.css +19 -0
- package/src/lib/lib/atomix-pagination/atomix-pagination.component.html +24 -0
- package/src/lib/lib/atomix-pagination/atomix-pagination.component.spec.ts +98 -0
- package/src/lib/lib/atomix-pagination/atomix-pagination.component.ts +36 -0
- 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 +7 -0
- package/src/lib/lib/atomix-radio-button/atomix-radio-button.component.spec.ts +116 -0
- package/src/lib/lib/atomix-radio-button/atomix-radio-button.component.ts +37 -0
- package/src/lib/lib/atomix-search-dropdown/atomix-search-dropdown.component.css +49 -0
- package/src/lib/lib/atomix-search-dropdown/atomix-search-dropdown.component.html +68 -0
- package/src/lib/lib/atomix-search-dropdown/atomix-search-dropdown.component.spec.ts +282 -0
- package/src/lib/lib/atomix-search-dropdown/atomix-search-dropdown.component.ts +119 -0
- package/{lib/lib/atomix-select-button/atomix-select-button-models.d.ts → src/lib/lib/atomix-select-button/atomix-select-button-models.ts} +4 -4
- package/src/lib/lib/atomix-select-button/atomix-select-button.component.css +5 -0
- package/src/lib/lib/atomix-select-button/atomix-select-button.component.html +7 -0
- package/src/lib/lib/atomix-select-button/atomix-select-button.component.spec.ts +73 -0
- package/src/lib/lib/atomix-select-button/atomix-select-button.component.ts +19 -0
- package/src/lib/lib/atomix-snackbar/atomix-snackbar.component.css +30 -0
- package/src/lib/lib/atomix-snackbar/atomix-snackbar.component.html +4 -0
- package/src/lib/lib/atomix-snackbar/atomix-snackbar.component.spec.ts +60 -0
- package/src/lib/lib/atomix-snackbar/atomix-snackbar.component.ts +27 -0
- package/src/lib/lib/atomix-spinner/atomix-spinner.component.css +0 -0
- package/src/lib/lib/atomix-spinner/atomix-spinner.component.html +7 -0
- package/src/lib/lib/atomix-spinner/atomix-spinner.component.spec.ts +70 -0
- package/src/lib/lib/atomix-spinner/atomix-spinner.component.ts +13 -0
- package/src/lib/lib/atomix-steps/atomix-steps.component.html +9 -0
- package/src/lib/lib/atomix-steps/atomix-steps.component.scss +0 -0
- package/src/lib/lib/atomix-steps/atomix-steps.component.spec.ts +120 -0
- package/src/lib/lib/atomix-steps/atomix-steps.component.ts +32 -0
- package/src/lib/lib/atomix-tabMenu/atomix-tabMenu.component.css +0 -0
- package/src/lib/lib/atomix-tabMenu/atomix-tabMenu.component.html +26 -0
- package/src/lib/lib/atomix-tabMenu/atomix-tabMenu.component.spec.ts +106 -0
- package/src/lib/lib/atomix-tabMenu/atomix-tabMenu.component.ts +36 -0
- package/src/lib/lib/atomix-table/atomix-table.component.css +152 -0
- package/src/lib/lib/atomix-table/atomix-table.component.html +647 -0
- package/src/lib/lib/atomix-table/atomix-table.component.spec.ts +1648 -0
- package/src/lib/lib/atomix-table/atomix-table.component.ts +422 -0
- package/src/lib/lib/atomix-table/atomix-table.models.ts +39 -0
- package/src/lib/lib/atomix-tag/atomix-tag.component.css +0 -0
- package/src/lib/lib/atomix-tag/atomix-tag.component.html +6 -0
- package/src/lib/lib/atomix-tag/atomix-tag.component.spec.ts +47 -0
- package/src/lib/lib/atomix-tag/atomix-tag.component.ts +13 -0
- package/src/lib/lib/utils/prime-icons.util.spec.ts +21 -0
- package/src/lib/lib/utils/prime-icons.util.ts +11 -0
- package/src/lib/primekit.component.spec.ts +19 -0
- package/src/lib/primekit.component.ts +10 -0
- package/src/lib/primekit.module.spec.ts +155 -0
- package/src/lib/primekit.module.ts +183 -0
- package/src/lib/primekit.service.spec.ts +17 -0
- package/src/lib/primekit.service.ts +8 -0
- package/{public-api.d.ts → src/public-api.ts} +47 -37
- package/tsconfig.lib.json +13 -0
- package/tsconfig.lib.prod.json +11 -0
- package/tsconfig.spec.json +10 -0
- package/esm2022/lib/lib/atomix-alert/atomix-alert.component.mjs +0 -76
- package/esm2022/lib/lib/atomix-autocomplete/atomix-autocomplete.component.mjs +0 -108
- package/esm2022/lib/lib/atomix-button/atomix-button.component.mjs +0 -49
- package/esm2022/lib/lib/atomix-button/atomix-button.models.mjs +0 -2
- package/esm2022/lib/lib/atomix-calendar/atomix-calendar.component.mjs +0 -90
- package/esm2022/lib/lib/atomix-card/atomix-card.component.mjs +0 -24
- package/esm2022/lib/lib/atomix-confirmation-dialog/atomix-confirmation-dialog.component.mjs +0 -28
- package/esm2022/lib/lib/atomix-daterange-calendar/atomix-daterange-calendar.component.mjs +0 -648
- package/esm2022/lib/lib/atomix-divider/atomix-divider.component.mjs +0 -27
- package/esm2022/lib/lib/atomix-dropdown/atomix-dropdown.component.mjs +0 -105
- package/esm2022/lib/lib/atomix-dynamic-dialog/atomix-dynamic-dialog.component.mjs +0 -38
- package/esm2022/lib/lib/atomix-dynamic-dialog/atomix-dynamic-dialog.models.mjs +0 -2
- package/esm2022/lib/lib/atomix-form/atomix-form-autocomplete/atomix-form-autocomplete.component.mjs +0 -67
- package/esm2022/lib/lib/atomix-form/atomix-form-calendar/atomix-form-calendar.component.mjs +0 -59
- package/esm2022/lib/lib/atomix-form/atomix-form-checkbox/atomix-form-checkbox.component.mjs +0 -48
- package/esm2022/lib/lib/atomix-form/atomix-form-chips/atomix-form-chips.component.mjs +0 -54
- package/esm2022/lib/lib/atomix-form/atomix-form-chips/form.chips.models.mjs +0 -2
- package/esm2022/lib/lib/atomix-form/atomix-form-dropdown/atomix-form-dropdown.component.mjs +0 -70
- package/esm2022/lib/lib/atomix-form/atomix-form-input-component/atomix-form-input-component.component.mjs +0 -80
- package/esm2022/lib/lib/atomix-form/atomix-form-inputmask-component/atomix-form-inputmask-component.component.mjs +0 -48
- package/esm2022/lib/lib/atomix-form/atomix-form-password-component/atomix-form-password-component.component.mjs +0 -48
- package/esm2022/lib/lib/atomix-form/atomix-form-radio-button/atomix-radio-button.component.mjs +0 -46
- package/esm2022/lib/lib/atomix-form/atomix-form-textarea/atomix-form-textarea.component.mjs +0 -46
- package/esm2022/lib/lib/atomix-input/atomix-input.component.mjs +0 -94
- package/esm2022/lib/lib/atomix-input-switch/atomix-input-switch.component.mjs +0 -85
- package/esm2022/lib/lib/atomix-messages/messages.component.mjs +0 -33
- package/esm2022/lib/lib/atomix-pagination/atomix-pagination.component.mjs +0 -48
- package/esm2022/lib/lib/atomix-radio-button/atomix-radio-button.component.mjs +0 -50
- package/esm2022/lib/lib/atomix-search-dropdown/atomix-search-dropdown.component.mjs +0 -149
- package/esm2022/lib/lib/atomix-select-button/atomix-select-button-models.mjs +0 -2
- package/esm2022/lib/lib/atomix-select-button/atomix-select-button.component.mjs +0 -25
- package/esm2022/lib/lib/atomix-snackbar/atomix-snackbar.component.mjs +0 -29
- package/esm2022/lib/lib/atomix-spinner/atomix-spinner.component.mjs +0 -24
- package/esm2022/lib/lib/atomix-steps/atomix-steps.component.mjs +0 -41
- package/esm2022/lib/lib/atomix-tabMenu/atomix-tabMenu.component.mjs +0 -51
- package/esm2022/lib/lib/atomix-table/atomix-table.component.mjs +0 -454
- package/esm2022/lib/lib/atomix-table/atomix-table.models.mjs +0 -2
- package/esm2022/lib/lib/atomix-tag/atomix-tag.component.mjs +0 -24
- package/esm2022/lib/lib/utils/prime-icons.util.mjs +0 -10
- package/esm2022/lib/primekit.component.mjs +0 -11
- package/esm2022/lib/primekit.module.mjs +0 -313
- package/esm2022/lib/primekit.service.mjs +0 -14
- package/esm2022/primekit.mjs +0 -5
- package/esm2022/public-api.mjs +0 -43
- package/fesm2022/primekit.mjs +0 -3041
- package/fesm2022/primekit.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/lib/atomix-alert/atomix-alert.component.d.ts +0 -22
- package/lib/lib/atomix-autocomplete/atomix-autocomplete.component.d.ts +0 -34
- package/lib/lib/atomix-button/atomix-button.component.d.ts +0 -19
- package/lib/lib/atomix-calendar/atomix-calendar.component.d.ts +0 -27
- package/lib/lib/atomix-card/atomix-card.component.d.ts +0 -9
- package/lib/lib/atomix-confirmation-dialog/atomix-confirmation-dialog.component.d.ts +0 -12
- package/lib/lib/atomix-daterange-calendar/atomix-daterange-calendar.component.d.ts +0 -72
- package/lib/lib/atomix-divider/atomix-divider.component.d.ts +0 -12
- package/lib/lib/atomix-dropdown/atomix-dropdown.component.d.ts +0 -50
- package/lib/lib/atomix-dynamic-dialog/atomix-dynamic-dialog.component.d.ts +0 -15
- package/lib/lib/atomix-dynamic-dialog/atomix-dynamic-dialog.models.d.ts +0 -11
- package/lib/lib/atomix-form/atomix-form-autocomplete/atomix-form-autocomplete.component.d.ts +0 -25
- package/lib/lib/atomix-form/atomix-form-calendar/atomix-form-calendar.component.d.ts +0 -23
- package/lib/lib/atomix-form/atomix-form-checkbox/atomix-form-checkbox.component.d.ts +0 -18
- package/lib/lib/atomix-form/atomix-form-chips/atomix-form-chips.component.d.ts +0 -19
- package/lib/lib/atomix-form/atomix-form-chips/form.chips.models.d.ts +0 -5
- package/lib/lib/atomix-form/atomix-form-dropdown/atomix-form-dropdown.component.d.ts +0 -25
- package/lib/lib/atomix-form/atomix-form-input-component/atomix-form-input-component.component.d.ts +0 -28
- package/lib/lib/atomix-form/atomix-form-inputmask-component/atomix-form-inputmask-component.component.d.ts +0 -17
- package/lib/lib/atomix-form/atomix-form-password-component/atomix-form-password-component.component.d.ts +0 -17
- package/lib/lib/atomix-form/atomix-form-radio-button/atomix-radio-button.component.d.ts +0 -19
- package/lib/lib/atomix-form/atomix-form-textarea/atomix-form-textarea.component.d.ts +0 -17
- package/lib/lib/atomix-input/atomix-input.component.d.ts +0 -29
- package/lib/lib/atomix-input-switch/atomix-input-switch.component.d.ts +0 -30
- package/lib/lib/atomix-messages/messages.component.d.ts +0 -13
- package/lib/lib/atomix-pagination/atomix-pagination.component.d.ts +0 -19
- package/lib/lib/atomix-radio-button/atomix-radio-button.component.d.ts +0 -15
- package/lib/lib/atomix-search-dropdown/atomix-search-dropdown.component.d.ts +0 -60
- package/lib/lib/atomix-select-button/atomix-select-button.component.d.ts +0 -12
- package/lib/lib/atomix-snackbar/atomix-snackbar.component.d.ts +0 -12
- package/lib/lib/atomix-spinner/atomix-spinner.component.d.ts +0 -9
- package/lib/lib/atomix-steps/atomix-steps.component.d.ts +0 -19
- package/lib/lib/atomix-tabMenu/atomix-tabMenu.component.d.ts +0 -19
- package/lib/lib/atomix-table/atomix-table.component.d.ts +0 -119
- package/lib/lib/atomix-table/atomix-table.models.d.ts +0 -43
- package/lib/lib/atomix-tag/atomix-tag.component.d.ts +0 -9
- package/lib/lib/utils/prime-icons.util.d.ts +0 -3
- package/lib/primekit.component.d.ts +0 -5
- package/lib/primekit.module.d.ts +0 -70
- package/lib/primekit.service.d.ts +0 -6
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectorRef,
|
|
3
|
+
Component,
|
|
4
|
+
contentChild,
|
|
5
|
+
ContentChild,
|
|
6
|
+
EventEmitter,
|
|
7
|
+
Input,
|
|
8
|
+
OnChanges,
|
|
9
|
+
Output,
|
|
10
|
+
SimpleChanges,
|
|
11
|
+
TemplateRef,
|
|
12
|
+
ViewChild,
|
|
13
|
+
} from '@angular/core';
|
|
14
|
+
import type {
|
|
15
|
+
Table,
|
|
16
|
+
TablePageEvent,
|
|
17
|
+
TableRowReorderEvent,
|
|
18
|
+
} from 'primeng/table';
|
|
19
|
+
import { Column, Row, TableActionButton } from './atomix-table.models';
|
|
20
|
+
import { ConfirmationService } from 'primeng/api';
|
|
21
|
+
import { DatePipe } from '@angular/common';
|
|
22
|
+
import { AtomixSnackbarComponent } from '../atomix-snackbar/atomix-snackbar.component';
|
|
23
|
+
import { CheckboxChangeEvent } from 'primeng/checkbox';
|
|
24
|
+
|
|
25
|
+
@Component({
|
|
26
|
+
selector: 'atomix-table',
|
|
27
|
+
templateUrl: './atomix-table.component.html',
|
|
28
|
+
styleUrls: ['./atomix-table.component.css'],
|
|
29
|
+
})
|
|
30
|
+
export class AtomixTableComponent implements OnChanges {
|
|
31
|
+
@ViewChild(AtomixSnackbarComponent)
|
|
32
|
+
atomixSnackbarComponent!: AtomixSnackbarComponent;
|
|
33
|
+
@Input() rows!: Row[];
|
|
34
|
+
|
|
35
|
+
// The selected table rows passed from primeng
|
|
36
|
+
selectedTableRows: Row[] | undefined;
|
|
37
|
+
|
|
38
|
+
@Input() cols!: Column[];
|
|
39
|
+
@Input() size: number = 25;
|
|
40
|
+
@Input() currentPage: number = 0;
|
|
41
|
+
@Input() expandedColumns: Column[] = [];
|
|
42
|
+
|
|
43
|
+
@Input() emptyExpandableRowMessage = '';
|
|
44
|
+
|
|
45
|
+
@Input() secondaryRowsKey = '';
|
|
46
|
+
|
|
47
|
+
@Input() title = '';
|
|
48
|
+
|
|
49
|
+
@Input() enablePaginator = false;
|
|
50
|
+
|
|
51
|
+
@Input() reorderableColumns = true;
|
|
52
|
+
|
|
53
|
+
@Input() enableReorderableRow = false;
|
|
54
|
+
|
|
55
|
+
// Empty state properties
|
|
56
|
+
@Input() emptyStateMessage: string = 'No records found';
|
|
57
|
+
|
|
58
|
+
// TODO: Enable checkboxes if we can use checkboxes and press anywhere on row.
|
|
59
|
+
// @Input() enableCheckboxes: boolean = false;
|
|
60
|
+
|
|
61
|
+
// Enables multiselect without checkboxes
|
|
62
|
+
@Input() enableMultiselect = false;
|
|
63
|
+
|
|
64
|
+
// Enables an expandable row that another table fits inside of
|
|
65
|
+
@Input() enableExpandableRow = false;
|
|
66
|
+
|
|
67
|
+
// Enables an selecting all rows when the rows are initialized
|
|
68
|
+
@Input() enableSelectAllOnInit = false;
|
|
69
|
+
|
|
70
|
+
// Enables each column to have a filter checkbox. Also adds a "Clear All" button to remove all filters.
|
|
71
|
+
@Input() enableColumnFilters = false;
|
|
72
|
+
|
|
73
|
+
@Input() isLoading: boolean = false;
|
|
74
|
+
|
|
75
|
+
@Input() pageSize = 25;
|
|
76
|
+
|
|
77
|
+
// Required as only used when totalRecords must be set
|
|
78
|
+
@Input() totalRecords!: number;
|
|
79
|
+
|
|
80
|
+
// Hide main row actions when the row has child rows (useful for expandable tables)
|
|
81
|
+
@Input() hideMainRowActionsWhenExpanded = false;
|
|
82
|
+
|
|
83
|
+
// Disable expand button for rows without child rows (when using secondaryRowsKey)
|
|
84
|
+
@Input() disableExpandWhenNoChildren = false;
|
|
85
|
+
|
|
86
|
+
// Emits the rows the user has selected
|
|
87
|
+
@Output() selectedRows: EventEmitter<Row[]> = new EventEmitter();
|
|
88
|
+
|
|
89
|
+
@Output() pageChange: EventEmitter<{ page: number; size: number }> =
|
|
90
|
+
new EventEmitter();
|
|
91
|
+
|
|
92
|
+
@Output() filterChange: EventEmitter<any> = new EventEmitter();
|
|
93
|
+
|
|
94
|
+
@Input() enableEditButtons = false;
|
|
95
|
+
@Input() enableDeleteButtons = false;
|
|
96
|
+
@Input() actionButtonConfig: {
|
|
97
|
+
enabled: boolean;
|
|
98
|
+
icon: string;
|
|
99
|
+
message?: string;
|
|
100
|
+
confirmation?: boolean;
|
|
101
|
+
class?: string;
|
|
102
|
+
} = {
|
|
103
|
+
enabled: false,
|
|
104
|
+
icon: '',
|
|
105
|
+
message: '',
|
|
106
|
+
confirmation: true,
|
|
107
|
+
class: 'p-button-rounded p-button-help',
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
@Output() editRow: EventEmitter<any> = new EventEmitter();
|
|
111
|
+
@Output() actionRow: EventEmitter<any> = new EventEmitter();
|
|
112
|
+
@Output() deleteRow: EventEmitter<any> = new EventEmitter();
|
|
113
|
+
@Output() actionButton: EventEmitter<Row> = new EventEmitter();
|
|
114
|
+
@Output() expandedRow: EventEmitter<Row> = new EventEmitter();
|
|
115
|
+
@Output() dropdownSelectionChanged: EventEmitter<{
|
|
116
|
+
field: string;
|
|
117
|
+
value: any;
|
|
118
|
+
}> = new EventEmitter();
|
|
119
|
+
@Output() rowReordered: EventEmitter<{
|
|
120
|
+
previousIndex: number;
|
|
121
|
+
currentIndex: number;
|
|
122
|
+
}> = new EventEmitter();
|
|
123
|
+
@Output() logButton: EventEmitter<any> = new EventEmitter();
|
|
124
|
+
@Output() pageDropdownChange = new EventEmitter<any>();
|
|
125
|
+
@Output() childRowAction = new EventEmitter<any>();
|
|
126
|
+
@ContentChild(TemplateRef) rowDataOutlet!: TemplateRef<any>;
|
|
127
|
+
|
|
128
|
+
// Sort Functionality
|
|
129
|
+
@Input() sortBy: string = '';
|
|
130
|
+
@Input() orderBy: string = '';
|
|
131
|
+
@Input() isEnableSorting: boolean = false;
|
|
132
|
+
@Output() sortHandler = new EventEmitter<any>();
|
|
133
|
+
|
|
134
|
+
// Pagination Functionality
|
|
135
|
+
options = [
|
|
136
|
+
{ label: 10, value: 10 },
|
|
137
|
+
{ label: 25, value: 25 },
|
|
138
|
+
{ label: 50, value: 50 },
|
|
139
|
+
{ label: 75, value: 75 },
|
|
140
|
+
{ label: 100, value: 100 },
|
|
141
|
+
{ label: 500, value: 500 },
|
|
142
|
+
];
|
|
143
|
+
first2: number = 0;
|
|
144
|
+
rows2: number = 10;
|
|
145
|
+
|
|
146
|
+
page: number = 0;
|
|
147
|
+
@Input() showPagination: boolean = true;
|
|
148
|
+
@Input() childRowsActionButtonsData: TableActionButton[] = [];
|
|
149
|
+
|
|
150
|
+
// Action Column
|
|
151
|
+
@Input() showActionsColumn: boolean = false;
|
|
152
|
+
@Input() showExpandedActionsColumn: boolean = false;
|
|
153
|
+
@Input() actionButtonsData!: TableActionButton[];
|
|
154
|
+
@ViewChild('dt1') dt1!: Table;
|
|
155
|
+
|
|
156
|
+
@Input() getChipCss: (type: string) => string = () => '';
|
|
157
|
+
@Input() getChipIcon: (type: string) => string = () => '';
|
|
158
|
+
constructor(
|
|
159
|
+
private confirmationService: ConfirmationService,
|
|
160
|
+
private datePipe: DatePipe,
|
|
161
|
+
private cdr: ChangeDetectorRef
|
|
162
|
+
) {}
|
|
163
|
+
|
|
164
|
+
onRowsInit() {
|
|
165
|
+
if (this.rows.length === 0) return;
|
|
166
|
+
|
|
167
|
+
this.selectedTableRows = this.enableSelectAllOnInit ? this.rows : undefined;
|
|
168
|
+
this.selectedRows.emit(this.selectedTableRows);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
ngOnChanges(changes: SimpleChanges) {
|
|
172
|
+
this.onRowsInit();
|
|
173
|
+
// if (changes['isLoading']) {
|
|
174
|
+
// this.cdr.detectChanges(); // Force UI update
|
|
175
|
+
// }
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
onRowSelect() {
|
|
179
|
+
this.selectedRows.emit(this.selectedTableRows);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
onRowUnselect() {
|
|
183
|
+
this.selectedRows.emit(this.selectedTableRows);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
onCheckboxSelect() {
|
|
187
|
+
this.selectedRows.emit(this.selectedTableRows);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
clearFilters() {
|
|
191
|
+
if (this.dt1) {
|
|
192
|
+
this.dt1.clear();
|
|
193
|
+
this.filterChange.emit({});
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
onPage(event: TablePageEvent) {
|
|
198
|
+
const page = event.first === 0 ? 0 : event.first / event.rows;
|
|
199
|
+
const size = event.rows;
|
|
200
|
+
this.pageChange.emit({ page, size });
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
filterResults(event: any) {
|
|
204
|
+
const filteredFilters: any = {};
|
|
205
|
+
for (const field of Object?.keys(event.filters)) {
|
|
206
|
+
const filtersArray = event.filters[field];
|
|
207
|
+
const nonNullFilters = filtersArray?.filter(
|
|
208
|
+
(item: any) => item.value !== null
|
|
209
|
+
);
|
|
210
|
+
|
|
211
|
+
if (nonNullFilters?.length > 0) {
|
|
212
|
+
// Convert Date objects to formatted string for date filters
|
|
213
|
+
const processedFilters = nonNullFilters.map((item: any) => {
|
|
214
|
+
if (item.value instanceof Date) {
|
|
215
|
+
return {
|
|
216
|
+
...item,
|
|
217
|
+
matchMode: 'equals',
|
|
218
|
+
value: this.datePipe.transform(item.value, 'yyyy-MM-dd'),
|
|
219
|
+
operator: 'and',
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
// Handle date range filters (array of dates)
|
|
223
|
+
if (
|
|
224
|
+
Array.isArray(item.value) &&
|
|
225
|
+
item.value.length === 2 &&
|
|
226
|
+
item.value.every((v: unknown) => v instanceof Date)
|
|
227
|
+
) {
|
|
228
|
+
return {
|
|
229
|
+
...item,
|
|
230
|
+
matchMode: 'between',
|
|
231
|
+
value: item.value.map((date: Date) =>
|
|
232
|
+
this.datePipe.transform(date, 'yyyy-MM-dd')
|
|
233
|
+
),
|
|
234
|
+
operator: 'and',
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
// For date filter strings, also normalize to equals matchMode
|
|
238
|
+
if (item.matchMode === 'dateIs') {
|
|
239
|
+
return {
|
|
240
|
+
...item,
|
|
241
|
+
matchMode: 'equals',
|
|
242
|
+
operator: 'and',
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
return item;
|
|
246
|
+
});
|
|
247
|
+
filteredFilters[field] = processedFilters;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
this.filterChange.emit(filteredFilters);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
deleteRowConfirmation(rowData: any) {
|
|
254
|
+
this.confirmationService.confirm({
|
|
255
|
+
message: 'Delete this item?',
|
|
256
|
+
accept: () => {
|
|
257
|
+
this.deleteRow.emit(rowData);
|
|
258
|
+
},
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
actionRowConfirmation(rowData: Row) {
|
|
263
|
+
if (this.actionButtonConfig.confirmation) {
|
|
264
|
+
this.confirmationService.confirm({
|
|
265
|
+
message: this.actionButtonConfig.message,
|
|
266
|
+
accept: () => {
|
|
267
|
+
this.actionButton.emit(rowData);
|
|
268
|
+
},
|
|
269
|
+
});
|
|
270
|
+
} else {
|
|
271
|
+
this.actionButton.emit(rowData);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
onRowReorder(event: TableRowReorderEvent) {
|
|
276
|
+
this.rowReordered.emit({
|
|
277
|
+
previousIndex: event.dragIndex as number,
|
|
278
|
+
currentIndex: event.dropIndex as number,
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
getRowDataValue(rowData: any, field: string, type: string) {
|
|
283
|
+
let value = field
|
|
284
|
+
.split('.')
|
|
285
|
+
.reduce((acc, part) => acc && acc[part], rowData);
|
|
286
|
+
|
|
287
|
+
if (type === 'date') {
|
|
288
|
+
value = this.datePipe.transform(value, 'MM/dd/yyyy');
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
return value;
|
|
292
|
+
}
|
|
293
|
+
copyHandler(event: Event, element: any) {
|
|
294
|
+
event.stopPropagation();
|
|
295
|
+
navigator.clipboard.writeText(element);
|
|
296
|
+
this.atomixSnackbarComponent.showSnackbar(`Copied ${element} to clipboard`);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
customSort(columnName: any) {
|
|
300
|
+
let direction =
|
|
301
|
+
this.sortBy !== columnName
|
|
302
|
+
? 'asc'
|
|
303
|
+
: this.orderBy === 'asc'
|
|
304
|
+
? 'desc'
|
|
305
|
+
: this.orderBy === 'desc'
|
|
306
|
+
? ''
|
|
307
|
+
: 'asc';
|
|
308
|
+
|
|
309
|
+
this.sortBy = columnName;
|
|
310
|
+
this.orderBy = direction;
|
|
311
|
+
this.sortHandler.emit({ columnName, direction });
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
handlePageChange(event: any) {
|
|
315
|
+
this.pageChange.emit(event);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
dropdownHandler(event: any) {
|
|
319
|
+
this.pageDropdownChange.emit(event?.value);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
handleActionClick(action: any, rowData: any) {
|
|
323
|
+
if (action.click) {
|
|
324
|
+
action.click(rowData); // Call the passed function with the row data
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
handleChildActionClick(action: any, rowData: any) {
|
|
329
|
+
if (action.click) {
|
|
330
|
+
// If the action provides a custom click handler, call it
|
|
331
|
+
action.click(rowData);
|
|
332
|
+
} else {
|
|
333
|
+
// Normalize the action to a string if action.action exists
|
|
334
|
+
const actionName = action?.action || action?.tooltip || action;
|
|
335
|
+
// Emit using the expected shape: { action, childRow }
|
|
336
|
+
this.childRowAction.emit({ action: actionName, childRow: rowData });
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
shouldShowAction(action: any, rowData: any): boolean {
|
|
341
|
+
if (!action) return true;
|
|
342
|
+
if (action.showOnlyWhen) {
|
|
343
|
+
return Object.entries(action.showOnlyWhen).every(([key, value]) => {
|
|
344
|
+
const rowVal = (rowData?.[key] ?? '')?.toString();
|
|
345
|
+
if (!rowVal) return false;
|
|
346
|
+
return rowVal.toLowerCase() === String(value).toLowerCase();
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
return true;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
@Input() isAllSelected: boolean = false;
|
|
353
|
+
@Output() headerCheckboxHandler = new EventEmitter<boolean>();
|
|
354
|
+
@Output() checkboxHandler = new EventEmitter<any>();
|
|
355
|
+
isAnyRowSelected(): boolean {
|
|
356
|
+
if (this.rows?.every((row) => row?.isSelected)) {
|
|
357
|
+
this.isAllSelected = true;
|
|
358
|
+
return false;
|
|
359
|
+
} else if (this.rows?.some((row: any) => row.isSelected)) {
|
|
360
|
+
this.isAllSelected = true;
|
|
361
|
+
return true;
|
|
362
|
+
} else {
|
|
363
|
+
this.isAllSelected = false;
|
|
364
|
+
return false;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
toggleAllRows(event: CheckboxChangeEvent) {
|
|
369
|
+
this.rows?.forEach((row) => {
|
|
370
|
+
row.isSelected = this.isAllSelected;
|
|
371
|
+
});
|
|
372
|
+
this.headerCheckboxHandler.emit(this.isAllSelected);
|
|
373
|
+
this.checkboxHandler.emit();
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
singleCheckboxHandler(event: CheckboxChangeEvent, row: any) {
|
|
377
|
+
this.isAllSelected = true;
|
|
378
|
+
this.headerCheckboxHandler.emit(false);
|
|
379
|
+
this.checkboxHandler.emit();
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
isString(value: any): boolean {
|
|
383
|
+
return typeof value === 'string';
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
handleDateRangeFilter(
|
|
387
|
+
value: any,
|
|
388
|
+
filterCallback: (value: any) => void
|
|
389
|
+
): void {
|
|
390
|
+
// Only apply filter when both dates are selected (array with 2 dates)
|
|
391
|
+
if (
|
|
392
|
+
Array.isArray(value) &&
|
|
393
|
+
value.length === 2 &&
|
|
394
|
+
value.every((v) => v instanceof Date)
|
|
395
|
+
) {
|
|
396
|
+
filterCallback(value);
|
|
397
|
+
} else if (value === null) {
|
|
398
|
+
// Clear the filter when value is null (e.g., when cross icon is clicked)
|
|
399
|
+
filterCallback(null);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
hasChildRows(rowData: any): boolean {
|
|
404
|
+
if (!this.secondaryRowsKey) {
|
|
405
|
+
return false;
|
|
406
|
+
}
|
|
407
|
+
const childRows = rowData[this.secondaryRowsKey];
|
|
408
|
+
return Array.isArray(childRows) && childRows.length > 0;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
shouldShowActionButton(action: any, rowData: any): boolean {
|
|
412
|
+
if (this.hideMainRowActionsWhenExpanded && this.hasChildRows(rowData)) {
|
|
413
|
+
return false;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
if (action.showOnlyWhenNoChildRows && this.hasChildRows(rowData)) {
|
|
417
|
+
return false;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
return true;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TODO: Move this to models folder
|
|
3
|
+
*/
|
|
4
|
+
export interface Row {
|
|
5
|
+
id: string;
|
|
6
|
+
[k: string]: unknown;
|
|
7
|
+
isSelected?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* TODO: Move this to models folder
|
|
11
|
+
*/
|
|
12
|
+
export interface Column {
|
|
13
|
+
name: string;
|
|
14
|
+
field: string;
|
|
15
|
+
type?: string;
|
|
16
|
+
isEditable?: boolean;
|
|
17
|
+
isRequired?: boolean;
|
|
18
|
+
filterDisabled?: boolean;
|
|
19
|
+
hideFilter?: boolean;
|
|
20
|
+
isHide?: boolean;
|
|
21
|
+
filterByDropdown?: { value: string; label: string }[];
|
|
22
|
+
filterByDate?: boolean;
|
|
23
|
+
filterByDateRange?: boolean;
|
|
24
|
+
hideAdvancedFilters?: boolean;
|
|
25
|
+
copyIcon?: boolean;
|
|
26
|
+
chip?: boolean;
|
|
27
|
+
chipIcon?: boolean;
|
|
28
|
+
progress?: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type SortDirection = 'asc' | 'desc' | '';
|
|
32
|
+
export interface TableActionButton {
|
|
33
|
+
icon?: string;
|
|
34
|
+
class?: string;
|
|
35
|
+
tooltip?: string;
|
|
36
|
+
click?: (event: any) => void;
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
showOnlyWhen?: { [k: string]: string };
|
|
39
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
|
2
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
3
|
+
import { AtomixTagComponent } from './atomix-tag.component';
|
|
4
|
+
|
|
5
|
+
describe('AtomixTagComponent', () => {
|
|
6
|
+
let component: AtomixTagComponent;
|
|
7
|
+
let fixture: ComponentFixture<AtomixTagComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [AtomixTagComponent],
|
|
12
|
+
schemas: [NO_ERRORS_SCHEMA],
|
|
13
|
+
});
|
|
14
|
+
fixture = TestBed.createComponent(AtomixTagComponent);
|
|
15
|
+
component = fixture.componentInstance;
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should create', () => {
|
|
19
|
+
expect(component).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
describe('input bindings', () => {
|
|
23
|
+
it('should accept value input', () => {
|
|
24
|
+
component.value = 'Active';
|
|
25
|
+
fixture.detectChanges();
|
|
26
|
+
expect(component.value).toBe('Active');
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('should accept rounded input', () => {
|
|
30
|
+
component.rounded = true;
|
|
31
|
+
fixture.detectChanges();
|
|
32
|
+
expect(component.rounded).toBe(true);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('should accept icon input', () => {
|
|
36
|
+
component.icon = 'pi pi-check';
|
|
37
|
+
fixture.detectChanges();
|
|
38
|
+
expect(component.icon).toBe('pi pi-check');
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('should accept styleClass input', () => {
|
|
42
|
+
component.styleClass = 'custom-tag';
|
|
43
|
+
fixture.detectChanges();
|
|
44
|
+
expect(component.styleClass).toBe('custom-tag');
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'atomix-tag',
|
|
5
|
+
templateUrl: './atomix-tag.component.html',
|
|
6
|
+
styleUrls: ['./atomix-tag.component.css'],
|
|
7
|
+
})
|
|
8
|
+
export class AtomixTagComponent {
|
|
9
|
+
@Input() value!: string;
|
|
10
|
+
@Input() rounded!: boolean;
|
|
11
|
+
@Input() icon!: string;
|
|
12
|
+
@Input() styleClass!: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { getEditIcon, getTrashIcon, getPowerOffIcon } from './prime-icons.util';
|
|
2
|
+
|
|
3
|
+
describe('prime-icons.util', () => {
|
|
4
|
+
describe('getEditIcon', () => {
|
|
5
|
+
it('should return the pencil icon class', () => {
|
|
6
|
+
expect(getEditIcon()).toBe('pi pi-pencil');
|
|
7
|
+
});
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
describe('getTrashIcon', () => {
|
|
11
|
+
it('should return the trash icon class', () => {
|
|
12
|
+
expect(getTrashIcon()).toBe('pi pi-trash');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
describe('getPowerOffIcon', () => {
|
|
17
|
+
it('should return the power-off icon class', () => {
|
|
18
|
+
expect(getPowerOffIcon()).toBe('pi pi-power-off');
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { PrimekitComponent } from './primekit.component';
|
|
3
|
+
|
|
4
|
+
describe('PrimekitComponent', () => {
|
|
5
|
+
let component: PrimekitComponent;
|
|
6
|
+
let fixture: ComponentFixture<PrimekitComponent>;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
TestBed.configureTestingModule({
|
|
10
|
+
imports: [PrimekitComponent],
|
|
11
|
+
});
|
|
12
|
+
fixture = TestBed.createComponent(PrimekitComponent);
|
|
13
|
+
component = fixture.componentInstance;
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('should create', () => {
|
|
17
|
+
expect(component).toBeTruthy();
|
|
18
|
+
});
|
|
19
|
+
});
|