nira-falcon 0.1.21 → 0.1.23
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 +24 -24
- package/ng-package.json +7 -0
- package/package copy.json +13 -0
- package/package.json +13 -26
- package/src/assets/images/hub-dashboard-title-bg.png +0 -0
- package/src/assets/images/iran.png +0 -0
- package/src/environments/environment.ts +7 -0
- package/src/lib/core-auto-complete/core-auto-complete.component.html +30 -0
- package/src/lib/core-auto-complete/core-auto-complete.component.scss +89 -0
- package/src/lib/core-auto-complete/core-auto-complete.component.ts +92 -0
- package/src/lib/core-btn/core-btn-bluebird.component.html +21 -0
- package/src/lib/core-btn/core-btn-bluebird.component.scss +123 -0
- package/src/lib/core-btn/core-btn-falcon.component.html +20 -0
- package/src/lib/core-btn/core-btn-falcon.component.scss +115 -0
- package/src/lib/core-btn/core-btn.component.ts +54 -0
- package/src/lib/core-card/core-card.component.html +3 -0
- package/src/lib/core-card/core-card.component.scss +0 -0
- package/src/lib/core-card/core-card.component.ts +10 -0
- package/src/lib/core-checkbox/core-checkbox.component.html +9 -0
- package/src/lib/core-checkbox/core-checkbox.component.scss +60 -0
- package/src/lib/core-checkbox/core-checkbox.component.ts +19 -0
- package/src/lib/core-confirm-dialog/core-confirm-dialog.component.html +28 -0
- package/src/lib/core-confirm-dialog/core-confirm-dialog.component.scss +131 -0
- package/src/lib/core-confirm-dialog/core-confirm-dialog.component.ts +29 -0
- package/src/lib/core-date-picker/core-date-picker-bluebird.component.html +15 -0
- package/src/lib/core-date-picker/core-date-picker-bluebird.component.scss +0 -0
- package/src/lib/core-date-picker/core-date-picker-falcon.component.html +14 -0
- package/src/lib/core-date-picker/core-date-picker-falcon.component.scss +0 -0
- package/src/lib/core-date-picker/core-date-picker.component.ts +44 -0
- package/src/lib/core-input/core-input-bluebird.component.html +95 -0
- package/src/lib/core-input/core-input-bluebird.component.scss +152 -0
- package/src/lib/core-input/core-input-falcon.component.html +90 -0
- package/src/lib/core-input/core-input-falcon.component.scss +141 -0
- package/src/lib/core-input/core-input.component.ts +112 -0
- package/src/lib/core-multi-select/core-multi-select-row/core-multi-select-row.component.html +3 -0
- package/src/lib/core-multi-select/core-multi-select-row/core-multi-select-row.component.scss +15 -0
- package/src/lib/core-multi-select/core-multi-select-row/core-multi-select-row.component.ts +19 -0
- package/src/lib/core-multi-select/core-multi-select.component.html +41 -0
- package/src/lib/core-multi-select/core-multi-select.component.scss +119 -0
- package/src/lib/core-multi-select/core-multi-select.component.ts +139 -0
- package/src/lib/core-number/core-number.component.html +3 -0
- package/src/lib/core-number/core-number.component.scss +1 -0
- package/src/lib/core-number/core-number.component.ts +45 -0
- package/src/lib/core-page-title/core-page-title.component.html +14 -0
- package/src/lib/core-page-title/core-page-title.component.scss +16 -0
- package/src/lib/core-page-title/core-page-title.component.ts +11 -0
- package/src/lib/core-radio-buttons/core-radio-buttons.component.html +17 -0
- package/src/lib/core-radio-buttons/core-radio-buttons.component.scss +46 -0
- package/src/lib/core-radio-buttons/core-radio-buttons.component.spec.ts +21 -0
- package/src/lib/core-radio-buttons/core-radio-buttons.component.ts +64 -0
- package/src/lib/core-search-box/core-search-box.component.html +14 -0
- package/src/lib/core-search-box/core-search-box.component.scss +37 -0
- package/src/lib/core-search-box/core-search-box.component.ts +15 -0
- package/src/lib/core-select/core-select-bluebird.component.html +57 -0
- package/src/lib/core-select/core-select-bluebird.component.scss +129 -0
- package/src/lib/core-select/core-select-falcon.component.html +56 -0
- package/src/lib/core-select/core-select-falcon.component.scss +123 -0
- package/src/lib/core-select/core-select.component.spec.ts +21 -0
- package/src/lib/core-select/core-select.component.ts +93 -0
- package/src/lib/core-spinner/core-spinner.component.html +14 -0
- package/src/lib/core-spinner/core-spinner.component.scss +162 -0
- package/src/lib/core-spinner/core-spinner.component.ts +13 -0
- package/src/lib/core-switch/core-switch.component.html +13 -0
- package/src/lib/core-switch/core-switch.component.scss +58 -0
- package/src/lib/core-switch/core-switch.component.spec.ts +21 -0
- package/src/lib/core-switch/core-switch.component.ts +28 -0
- package/src/lib/core-table/core-column-date-picker/core-column-date-picker.component.html +21 -0
- package/src/lib/core-table/core-column-date-picker/core-column-date-picker.component.scss +3 -0
- package/src/lib/core-table/core-column-date-picker/core-column-date-picker.component.ts +55 -0
- package/src/lib/core-table/core-column-input/core-column-input.component.html +17 -0
- package/src/lib/core-table/core-column-input/core-column-input.component.scss +21 -0
- package/src/lib/core-table/core-column-input/core-column-input.component.ts +23 -0
- package/src/lib/core-table/core-column-selector/core-column-selector.component.html +47 -0
- package/src/lib/core-table/core-column-selector/core-column-selector.component.scss +113 -0
- package/src/lib/core-table/core-column-selector/core-column-selector.component.ts +94 -0
- package/src/lib/core-table/core-row-pelak/core-row-pelak.component.html +12 -0
- package/src/lib/core-table/core-row-pelak/core-row-pelak.component.scss +21 -0
- package/src/lib/core-table/core-row-pelak/core-row-pelak.component.ts +12 -0
- package/src/lib/core-table/core-table/core-table.component.html +168 -0
- package/src/lib/core-table/core-table/core-table.component.scss +65 -0
- package/src/lib/core-table/core-table/core-table.component.ts +179 -0
- package/src/lib/core-table/core-table-action-buttons-column/core-table-action-buttons-column.component.html +10 -0
- package/src/lib/core-table/core-table-action-buttons-column/core-table-action-buttons-column.component.scss +3 -0
- package/src/lib/core-table/core-table-action-buttons-column/core-table-action-buttons-column.component.ts +24 -0
- package/src/lib/core-table/core-table-action-column/core-table-action-column.component.html +6 -0
- package/src/lib/core-table/core-table-action-column/core-table-action-column.component.scss +3 -0
- package/src/lib/core-table/core-table-action-column/core-table-action-column.component.ts +19 -0
- package/src/lib/core-table/core-table-card-manager/core-table-card-manager.component.html +94 -0
- package/src/lib/core-table/core-table-card-manager/core-table-card-manager.component.scss +0 -0
- package/src/lib/core-table/core-table-card-manager/core-table-card-manager.component.ts +58 -0
- package/src/lib/core-table/core-table-column-manager/core-table-column-manager.component.html +99 -0
- package/src/lib/core-table/core-table-column-manager/core-table-column-manager.component.scss +0 -0
- package/src/lib/core-table/core-table-column-manager/core-table-column-manager.component.ts +59 -0
- package/src/lib/core-table/core-table-detail-viewer-for-report/core-table-detail-viewer-for-report.component.html +5 -0
- package/src/lib/core-table/core-table-detail-viewer-for-report/core-table-detail-viewer-for-report.component.scss +8 -0
- package/src/lib/core-table/core-table-detail-viewer-for-report/core-table-detail-viewer-for-report.component.ts +28 -0
- package/src/lib/core-table/core-table-filter-dialog/core-table-filter-dialog/core-table-filter-dialog.component.html +24 -0
- package/src/lib/core-table/core-table-filter-dialog/core-table-filter-dialog/core-table-filter-dialog.component.scss +10 -0
- package/src/lib/core-table/core-table-filter-dialog/core-table-filter-dialog/core-table-filter-dialog.component.ts +76 -0
- package/src/lib/core-table/core-table-no-content/core-table-no-content.component.html +6 -0
- package/src/lib/core-table/core-table-no-content/core-table-no-content.component.scss +7 -0
- package/src/lib/core-table/core-table-no-content/core-table-no-content.component.ts +14 -0
- package/src/lib/core-table/core-table-no-content/core-table-no-content.label.ts +14 -0
- package/src/lib/core-table/core-table-row-selector-column/core-table-row-selector-column.component.html +5 -0
- package/src/lib/core-table/core-table-row-selector-column/core-table-row-selector-column.component.scss +0 -0
- package/src/lib/core-table/core-table-row-selector-column/core-table-row-selector-column.component.ts +60 -0
- package/src/lib/core-table/core-table-shamsi-date/core-table-shamsi-date.component.html +3 -0
- package/src/lib/core-table/core-table-shamsi-date/core-table-shamsi-date.component.scss +0 -0
- package/src/lib/core-table/core-table-shamsi-date/core-table-shamsi-date.component.ts +24 -0
- package/src/lib/core-table/core-table-status-active-column/core-table-status-active-column.component.html +3 -0
- package/src/lib/core-table/core-table-status-active-column/core-table-status-active-column.component.scss +14 -0
- package/src/lib/core-table/core-table-status-active-column/core-table-status-active-column.component.ts +14 -0
- package/src/lib/core-table/core-table-status-column/core-table-status-column.component.html +3 -0
- package/src/lib/core-table/core-table-status-column/core-table-status-column.component.scss +14 -0
- package/src/lib/core-table/core-table-status-column/core-table-status-column.component.ts +11 -0
- package/src/lib/core-textarea/core-textarea.component.html +18 -0
- package/src/lib/core-textarea/core-textarea.component.scss +62 -0
- package/src/lib/core-textarea/core-textarea.component.ts +31 -0
- package/src/lib/core-time-picker/core-time-picker.component.html +51 -0
- package/src/lib/core-time-picker/core-time-picker.component.scss +144 -0
- package/src/lib/core-time-picker/core-time-picker.component.ts +102 -0
- package/src/lib/core-time-picker/time-picker-modal/time-picker-modal.component.html +50 -0
- package/src/lib/core-time-picker/time-picker-modal/time-picker-modal.component.scss +424 -0
- package/src/lib/core-time-picker/time-picker-modal/time-picker-modal.component.spec.ts +21 -0
- package/src/lib/core-time-picker/time-picker-modal/time-picker-modal.component.ts +172 -0
- package/src/lib/falcon-lib.module.ts +157 -0
- package/src/lib/falconTypes.ts +35 -0
- package/src/lib/pipes/digit-group.pipe.ts +10 -0
- package/src/lib/pipes/form-control.pipe.ts +11 -0
- package/src/lib/pipes/persian-digits.pipe.ts +33 -0
- package/src/lib/pipes/price-format.pipe.ts +20 -0
- package/src/lib/pipes/shamsi-date.pipe.ts +24 -0
- package/src/lib/pipes/time-format.pipe.ts +21 -0
- package/src/lib/pipes/weight.pipe.ts +10 -0
- package/src/lib/wordify.ts +116 -0
- package/{public-api.d.ts → src/public-api.ts} +31 -27
- package/src/svg-icon/arrow-down-icon/arrow-down-icon.component.html +8 -0
- package/src/svg-icon/arrow-down-icon/arrow-down-icon.component.scss +0 -0
- package/src/svg-icon/arrow-down-icon/arrow-down-icon.component.ts +8 -0
- package/src/svg-icon/calendar-icon/calendar-icon.component.html +10 -0
- package/src/svg-icon/calendar-icon/calendar-icon.component.scss +0 -0
- package/src/svg-icon/calendar-icon/calendar-icon.component.ts +8 -0
- package/src/svg-icon/caret-up-icon/caret-up-icon.component.html +16 -0
- package/src/svg-icon/caret-up-icon/caret-up-icon.component.scss +0 -0
- package/src/svg-icon/caret-up-icon/caret-up-icon.component.ts +10 -0
- package/src/svg-icon/close-icon/close-icon.component.html +10 -0
- package/src/svg-icon/close-icon/close-icon.component.scss +0 -0
- package/src/svg-icon/close-icon/close-icon.component.ts +8 -0
- package/src/svg-icon/edit-square-icon/edit-square-icon.component.html +10 -0
- package/src/svg-icon/edit-square-icon/edit-square-icon.component.scss +0 -0
- package/src/svg-icon/edit-square-icon/edit-square-icon.component.ts +8 -0
- package/src/svg-icon/pelak-icon/pelak-icon.component.html +32 -0
- package/src/svg-icon/pelak-icon/pelak-icon.component.scss +0 -0
- package/src/svg-icon/pelak-icon/pelak-icon.component.ts +8 -0
- package/src/svg-icon/search-icon/search-icon.component.html +10 -0
- package/src/svg-icon/search-icon/search-icon.component.scss +0 -0
- package/src/svg-icon/search-icon/search-icon.component.spec.ts +21 -0
- package/src/svg-icon/search-icon/search-icon.component.ts +8 -0
- package/src/svg-icon/sort-down-icon/sort-down-icon.component.html +5 -0
- package/src/svg-icon/sort-down-icon/sort-down-icon.component.scss +0 -0
- package/src/svg-icon/sort-down-icon/sort-down-icon.component.ts +10 -0
- package/src/svg-icon/sort-solid-icon/sort-solid-icon.component.html +5 -0
- package/src/svg-icon/sort-solid-icon/sort-solid-icon.component.scss +0 -0
- package/src/svg-icon/sort-solid-icon/sort-solid-icon.component.ts +8 -0
- package/src/svg-icon/sort-up-icon/sort-up-icon.component.html +5 -0
- package/src/svg-icon/sort-up-icon/sort-up-icon.component.scss +0 -0
- package/src/svg-icon/sort-up-icon/sort-up-icon.component.ts +8 -0
- package/src/svg-icon/time-icon/time-icon.component.html +10 -0
- package/src/svg-icon/time-icon/time-icon.component.scss +0 -0
- package/src/svg-icon/time-icon/time-icon.component.ts +8 -0
- package/src/svg-icon/warning-icon/warning-icon.component.html +10 -0
- package/src/svg-icon/warning-icon/warning-icon.component.scss +0 -0
- package/src/svg-icon/warning-icon/warning-icon.component.ts +10 -0
- package/src/utils/constants.ts +182 -0
- package/src/utils/directives/detail-viewer-manager.directive.ts +78 -0
- package/src/utils/directives/filterTableDirective.ts +36 -0
- package/src/utils/directives/table-detail-viewer-manager.directive.ts +57 -0
- package/src/utils/interfaces.ts +0 -0
- package/src/utils/jsonparser.ts +49 -0
- package/src/utils/links.ts +67 -0
- package/src/utils/toast.ts +35 -0
- package/src/utils/types.ts +20 -0
- package/src/utils/util.ts +32 -0
- package/styles.css +1 -1
- package/tsconfig.lib.json +14 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +14 -0
- package/environments/environment.d.ts +0 -4
- package/esm2022/environments/environment.mjs +0 -7
- package/esm2022/lib/core-auto-complete/core-auto-complete.component.mjs +0 -82
- package/esm2022/lib/core-btn/core-btn.component.mjs +0 -68
- package/esm2022/lib/core-card/core-card.component.mjs +0 -16
- package/esm2022/lib/core-checkbox/core-checkbox.component.mjs +0 -33
- package/esm2022/lib/core-confirm-dialog/core-confirm-dialog.component.mjs +0 -31
- package/esm2022/lib/core-date-picker/core-date-picker.component.mjs +0 -46
- package/esm2022/lib/core-input/core-input.component.mjs +0 -132
- package/esm2022/lib/core-multi-select/core-multi-select-row/core-multi-select-row.component.mjs +0 -28
- package/esm2022/lib/core-multi-select/core-multi-select.component.mjs +0 -145
- package/esm2022/lib/core-number/core-number.component.mjs +0 -64
- package/esm2022/lib/core-page-title/core-page-title.component.mjs +0 -19
- package/esm2022/lib/core-radio-buttons/core-radio-buttons.component.mjs +0 -75
- package/esm2022/lib/core-search-box/core-search-box.component.mjs +0 -25
- package/esm2022/lib/core-select/core-select.component.mjs +0 -92
- package/esm2022/lib/core-spinner/core-spinner.component.mjs +0 -23
- package/esm2022/lib/core-switch/core-switch.component.mjs +0 -33
- package/esm2022/lib/core-table/core-column-date-picker/core-column-date-picker.component.mjs +0 -62
- package/esm2022/lib/core-table/core-column-input/core-column-input.component.mjs +0 -43
- package/esm2022/lib/core-table/core-column-selector/core-column-selector.component.mjs +0 -100
- package/esm2022/lib/core-table/core-row-pelak/core-row-pelak.component.mjs +0 -21
- package/esm2022/lib/core-table/core-table/core-table.component.mjs +0 -182
- package/esm2022/lib/core-table/core-table-action-buttons-column/core-table-action-buttons-column.component.mjs +0 -34
- package/esm2022/lib/core-table/core-table-action-column/core-table-action-column.component.mjs +0 -27
- package/esm2022/lib/core-table/core-table-card-manager/core-table-card-manager.component.mjs +0 -83
- package/esm2022/lib/core-table/core-table-column-manager/core-table-column-manager.component.mjs +0 -85
- package/esm2022/lib/core-table/core-table-detail-viewer-for-report/core-table-detail-viewer-for-report.component.mjs +0 -29
- package/esm2022/lib/core-table/core-table-filter-dialog/core-table-filter-dialog/core-table-filter-dialog.component.mjs +0 -82
- package/esm2022/lib/core-table/core-table-no-content/core-table-no-content.component.mjs +0 -23
- package/esm2022/lib/core-table/core-table-no-content/core-table-no-content.label.mjs +0 -9
- package/esm2022/lib/core-table/core-table-row-selector-column/core-table-row-selector-column.component.mjs +0 -68
- package/esm2022/lib/core-table/core-table-shamsi-date/core-table-shamsi-date.component.mjs +0 -28
- package/esm2022/lib/core-table/core-table-status-active-column/core-table-status-active-column.component.mjs +0 -20
- package/esm2022/lib/core-table/core-table-status-column/core-table-status-column.component.mjs +0 -18
- package/esm2022/lib/core-textarea/core-textarea.component.mjs +0 -47
- package/esm2022/lib/core-time-picker/core-time-picker.component.mjs +0 -118
- package/esm2022/lib/core-time-picker/time-picker-modal/time-picker-modal.component.mjs +0 -147
- package/esm2022/lib/falcon-lib.module.mjs +0 -252
- package/esm2022/lib/falconTypes.mjs +0 -9
- package/esm2022/lib/pipes/digit-group.pipe.mjs +0 -16
- package/esm2022/lib/pipes/form-control.pipe.mjs +0 -16
- package/esm2022/lib/pipes/persian-digits.pipe.mjs +0 -40
- package/esm2022/lib/pipes/price-format.pipe.mjs +0 -23
- package/esm2022/lib/pipes/shamsi-date.pipe.mjs +0 -24
- package/esm2022/lib/pipes/time-format.pipe.mjs +0 -28
- package/esm2022/lib/pipes/weight.pipe.mjs +0 -16
- package/esm2022/lib/wordify.mjs +0 -109
- package/esm2022/nira-falcon.mjs +0 -5
- package/esm2022/public-api.mjs +0 -31
- package/esm2022/svg-icon/arrow-down-icon/arrow-down-icon.component.mjs +0 -11
- package/esm2022/svg-icon/calendar-icon/calendar-icon.component.mjs +0 -11
- package/esm2022/svg-icon/caret-up-icon/caret-up-icon.component.mjs +0 -11
- package/esm2022/svg-icon/close-icon/close-icon.component.mjs +0 -11
- package/esm2022/svg-icon/edit-square-icon/edit-square-icon.component.mjs +0 -11
- package/esm2022/svg-icon/pelak-icon/pelak-icon.component.mjs +0 -11
- package/esm2022/svg-icon/search-icon/search-icon.component.mjs +0 -11
- package/esm2022/svg-icon/sort-down-icon/sort-down-icon.component.mjs +0 -11
- package/esm2022/svg-icon/sort-solid-icon/sort-solid-icon.component.mjs +0 -11
- package/esm2022/svg-icon/sort-up-icon/sort-up-icon.component.mjs +0 -11
- package/esm2022/svg-icon/time-icon/time-icon.component.mjs +0 -11
- package/esm2022/svg-icon/warning-icon/warning-icon.component.mjs +0 -11
- package/esm2022/utils/constants.mjs +0 -184
- package/esm2022/utils/directives/detail-viewer-manager.directive.mjs +0 -71
- package/esm2022/utils/directives/table-detail-viewer-manager.directive.mjs +0 -49
- package/esm2022/utils/util.mjs +0 -26
- package/fesm2022/nira-falcon.mjs +0 -2863
- package/fesm2022/nira-falcon.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/core-auto-complete/core-auto-complete.component.d.ts +0 -30
- package/lib/core-btn/core-btn.component.d.ts +0 -22
- package/lib/core-card/core-card.component.d.ts +0 -6
- package/lib/core-checkbox/core-checkbox.component.d.ts +0 -13
- package/lib/core-confirm-dialog/core-confirm-dialog.component.d.ts +0 -14
- package/lib/core-date-picker/core-date-picker.component.d.ts +0 -20
- package/lib/core-input/core-input.component.d.ts +0 -28
- package/lib/core-multi-select/core-multi-select-row/core-multi-select-row.component.d.ts +0 -11
- package/lib/core-multi-select/core-multi-select.component.d.ts +0 -43
- package/lib/core-number/core-number.component.d.ts +0 -12
- package/lib/core-page-title/core-page-title.component.d.ts +0 -7
- package/lib/core-radio-buttons/core-radio-buttons.component.d.ts +0 -29
- package/lib/core-search-box/core-search-box.component.d.ts +0 -10
- package/lib/core-select/core-select.component.d.ts +0 -36
- package/lib/core-spinner/core-spinner.component.d.ts +0 -9
- package/lib/core-switch/core-switch.component.d.ts +0 -17
- package/lib/core-table/core-column-date-picker/core-column-date-picker.component.d.ts +0 -21
- package/lib/core-table/core-column-input/core-column-input.component.d.ts +0 -16
- package/lib/core-table/core-column-selector/core-column-selector.component.d.ts +0 -35
- package/lib/core-table/core-row-pelak/core-row-pelak.component.d.ts +0 -8
- package/lib/core-table/core-table/core-table.component.d.ts +0 -42
- package/lib/core-table/core-table-action-buttons-column/core-table-action-buttons-column.component.d.ts +0 -11
- package/lib/core-table/core-table-action-column/core-table-action-column.component.d.ts +0 -11
- package/lib/core-table/core-table-card-manager/core-table-card-manager.component.d.ts +0 -24
- package/lib/core-table/core-table-column-manager/core-table-column-manager.component.d.ts +0 -24
- package/lib/core-table/core-table-detail-viewer-for-report/core-table-detail-viewer-for-report.component.d.ts +0 -11
- package/lib/core-table/core-table-filter-dialog/core-table-filter-dialog/core-table-filter-dialog.component.d.ts +0 -22
- package/lib/core-table/core-table-no-content/core-table-no-content.component.d.ts +0 -9
- package/lib/core-table/core-table-no-content/core-table-no-content.label.d.ts +0 -5
- package/lib/core-table/core-table-row-selector-column/core-table-row-selector-column.component.d.ts +0 -14
- package/lib/core-table/core-table-shamsi-date/core-table-shamsi-date.component.d.ts +0 -11
- package/lib/core-table/core-table-status-active-column/core-table-status-active-column.component.d.ts +0 -8
- package/lib/core-table/core-table-status-column/core-table-status-column.component.d.ts +0 -7
- package/lib/core-textarea/core-textarea.component.d.ts +0 -13
- package/lib/core-time-picker/core-time-picker.component.d.ts +0 -26
- package/lib/core-time-picker/time-picker-modal/time-picker-modal.component.d.ts +0 -35
- package/lib/falcon-lib.module.d.ts +0 -66
- package/lib/falconTypes.d.ts +0 -23
- package/lib/pipes/digit-group.pipe.d.ts +0 -7
- package/lib/pipes/form-control.pipe.d.ts +0 -8
- package/lib/pipes/persian-digits.pipe.d.ts +0 -7
- package/lib/pipes/price-format.pipe.d.ts +0 -7
- package/lib/pipes/shamsi-date.pipe.d.ts +0 -9
- package/lib/pipes/time-format.pipe.d.ts +0 -7
- package/lib/pipes/weight.pipe.d.ts +0 -7
- package/lib/wordify.d.ts +0 -2
- package/svg-icon/arrow-down-icon/arrow-down-icon.component.d.ts +0 -5
- package/svg-icon/calendar-icon/calendar-icon.component.d.ts +0 -5
- package/svg-icon/caret-up-icon/caret-up-icon.component.d.ts +0 -5
- package/svg-icon/close-icon/close-icon.component.d.ts +0 -5
- package/svg-icon/edit-square-icon/edit-square-icon.component.d.ts +0 -5
- package/svg-icon/pelak-icon/pelak-icon.component.d.ts +0 -5
- package/svg-icon/search-icon/search-icon.component.d.ts +0 -5
- package/svg-icon/sort-down-icon/sort-down-icon.component.d.ts +0 -5
- package/svg-icon/sort-solid-icon/sort-solid-icon.component.d.ts +0 -5
- package/svg-icon/sort-up-icon/sort-up-icon.component.d.ts +0 -5
- package/svg-icon/time-icon/time-icon.component.d.ts +0 -5
- package/svg-icon/warning-icon/warning-icon.component.d.ts +0 -5
- package/utils/constants.d.ts +0 -70
- package/utils/directives/detail-viewer-manager.directive.d.ts +0 -18
- package/utils/directives/table-detail-viewer-manager.directive.d.ts +0 -16
- package/utils/util.d.ts +0 -11
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectorRef,
|
|
3
|
+
Component,
|
|
4
|
+
EventEmitter,
|
|
5
|
+
Input,
|
|
6
|
+
Output,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
import { FormControl } from '@angular/forms';
|
|
9
|
+
import { MenuItem } from '../../falconTypes';
|
|
10
|
+
import { ACTIVE_OPTIONS } from '../../../utils/constants';
|
|
11
|
+
|
|
12
|
+
@Component({
|
|
13
|
+
selector: 'core-column-selector',
|
|
14
|
+
templateUrl: './core-column-selector.component.html',
|
|
15
|
+
styleUrls: ['./core-column-selector.component.scss'],
|
|
16
|
+
})
|
|
17
|
+
export class CoreColumnSelectorComponent<T> {
|
|
18
|
+
selectedItem: MenuItem<T> = {} as MenuItem<T>;
|
|
19
|
+
newItems: MenuItem<T>[] = [];
|
|
20
|
+
isOpenMenu = false;
|
|
21
|
+
_items: any[] = [];
|
|
22
|
+
// _items: any[] = ACTIVE_OPTIONS;
|
|
23
|
+
@Input() set items(data: any) {
|
|
24
|
+
this._items = data;
|
|
25
|
+
this.hasItems = true;
|
|
26
|
+
this.init();
|
|
27
|
+
}
|
|
28
|
+
_defaultValue = undefined;
|
|
29
|
+
_titleKey!: T;
|
|
30
|
+
_valueKey!: T;
|
|
31
|
+
initCounter = 0;
|
|
32
|
+
hasTitleKey = false;
|
|
33
|
+
hasValueKey = false;
|
|
34
|
+
hasItems = false;
|
|
35
|
+
hasDefaultValue = false;
|
|
36
|
+
@Input() set titleKey(data: T) {
|
|
37
|
+
this._titleKey = data;
|
|
38
|
+
this.hasTitleKey = true;
|
|
39
|
+
this.init();
|
|
40
|
+
}
|
|
41
|
+
@Input() set valueKey(data: T) {
|
|
42
|
+
this._valueKey = data;
|
|
43
|
+
this.hasValueKey = true;
|
|
44
|
+
this.init();
|
|
45
|
+
}
|
|
46
|
+
@Input() label: string = '';
|
|
47
|
+
@Output() onItemSelected = new EventEmitter<any>();
|
|
48
|
+
@Input() inputFormControl: FormControl = new FormControl('', []);
|
|
49
|
+
constructor(private cdr: ChangeDetectorRef) {}
|
|
50
|
+
init() {
|
|
51
|
+
if (this.hasTitleKey && this.hasValueKey && this.hasItems) {
|
|
52
|
+
this.newItems = this.changeItemsType(this._items);
|
|
53
|
+
const item = this.newItems.find(
|
|
54
|
+
(item) => item.value == this._defaultValue
|
|
55
|
+
);
|
|
56
|
+
if (!this._defaultValue || this._defaultValue === null) return;
|
|
57
|
+
this.inputFormControl.setValue(this._defaultValue);
|
|
58
|
+
this.onItemSelect(
|
|
59
|
+
this.newItems.find((item) => item.value == this._defaultValue)!,
|
|
60
|
+
false
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
ngAfterViewInit(): void {
|
|
65
|
+
this.cdr.detectChanges();
|
|
66
|
+
}
|
|
67
|
+
changeItemsType(items: any[]): MenuItem<T>[] {
|
|
68
|
+
return items.map((item) => {
|
|
69
|
+
return {
|
|
70
|
+
title: item[this._titleKey],
|
|
71
|
+
value: item[this._valueKey],
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
openMenuClick() {
|
|
76
|
+
this.isOpenMenu = !this.isOpenMenu;
|
|
77
|
+
}
|
|
78
|
+
onItemSelect(selectedItem: MenuItem<T>, isFromUi: boolean): void {
|
|
79
|
+
if (isFromUi) this.inputFormControl.markAsTouched();
|
|
80
|
+
this.isOpenMenu = false;
|
|
81
|
+
this.selectedItem = selectedItem;
|
|
82
|
+
this.inputFormControl.setValue(selectedItem.value);
|
|
83
|
+
this.onItemSelected.emit(selectedItem.value);
|
|
84
|
+
}
|
|
85
|
+
focusOut() {
|
|
86
|
+
this.isOpenMenu = false;
|
|
87
|
+
this.inputFormControl.markAsTouched();
|
|
88
|
+
}
|
|
89
|
+
removedText() {
|
|
90
|
+
this.selectedItem = {} as MenuItem<T>;
|
|
91
|
+
this.inputFormControl.setValue('');
|
|
92
|
+
this.onItemSelected.emit('');
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<div class="flex gap-1" *ngIf="data.register">
|
|
2
|
+
<div class="row w-12">
|
|
3
|
+
<img class="img-iran p-1" src="../../../assets/images/iran.png" />
|
|
4
|
+
<span class="row1">{{ data[column.key].columnFour | persianDigits }}</span>
|
|
5
|
+
</div>
|
|
6
|
+
<span class="row w-9">{{
|
|
7
|
+
data[column.key].columnThree | persianDigits
|
|
8
|
+
}}</span>
|
|
9
|
+
<span class="row w-5">{{ data[column.key].columnTwo | persianDigits }}</span>
|
|
10
|
+
<span class="row w-6">{{ data[column.key].columnOne | persianDigits }}</span>
|
|
11
|
+
<pelak-icon class="h-8 w-6"></pelak-icon>
|
|
12
|
+
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.row {
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 32px;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
align-items: center;
|
|
6
|
+
background: #80808026;
|
|
7
|
+
padding-inline: 4px;
|
|
8
|
+
border-radius: 6px;
|
|
9
|
+
}
|
|
10
|
+
.row1 {
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
align-items: center;
|
|
14
|
+
padding-inline: 4px;
|
|
15
|
+
border-radius: 6px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.img-iran {
|
|
19
|
+
height: 28px;
|
|
20
|
+
border-left: 2px solid #33333375;
|
|
21
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'app-core-row-pelak',
|
|
5
|
+
templateUrl: './core-row-pelak.component.html',
|
|
6
|
+
styleUrls: ['./core-row-pelak.component.scss'],
|
|
7
|
+
})
|
|
8
|
+
export class CoreRowPelakComponent {
|
|
9
|
+
@Input({ required: true }) data!: any;
|
|
10
|
+
@Input({ required: true }) column!: any;
|
|
11
|
+
ngOnInit(): void {}
|
|
12
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
<div class="p-2 overflow-x-auto">
|
|
2
|
+
<table *ngIf="!isRunningOnSmallScreen || !responsive; else smallDeviceCard">
|
|
3
|
+
<tr>
|
|
4
|
+
<th
|
|
5
|
+
class="cursor-pointer text-center"
|
|
6
|
+
*ngFor="let column of activeColumnsSchema()"
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
class="grid"
|
|
10
|
+
[ngClass]="[canFilter ? 'grid-rows-2' : 'grid-rows-1']"
|
|
11
|
+
>
|
|
12
|
+
<span
|
|
13
|
+
class="p-2 relative"
|
|
14
|
+
(click)="sortByHeader(column)"
|
|
15
|
+
[ngStyle]="{
|
|
16
|
+
minWidth:
|
|
17
|
+
column.type === columnsTypes.ACTION_BUTTONS
|
|
18
|
+
? column.data.length * 30 + 'px'
|
|
19
|
+
: '',
|
|
20
|
+
display:
|
|
21
|
+
column.type === columnsTypes.ACTION_BUTTONS
|
|
22
|
+
? 'inline-block'
|
|
23
|
+
: ''
|
|
24
|
+
}"
|
|
25
|
+
>{{ column.label }}
|
|
26
|
+
<app-sort-down-icon
|
|
27
|
+
class="sort-icon w-2 h-2 inline-block absolute top-3 right-[-3px]"
|
|
28
|
+
*ngIf="
|
|
29
|
+
sortDetail?.key == column.key && sortDetail?.sort === 'asc'
|
|
30
|
+
"
|
|
31
|
+
></app-sort-down-icon>
|
|
32
|
+
<app-sort-up-icon
|
|
33
|
+
class="sort-icon w-2 h-2 inline-block absolute top-3 right-[-3px]"
|
|
34
|
+
*ngIf="
|
|
35
|
+
sortDetail?.key == column.key && sortDetail?.sort === 'desc'
|
|
36
|
+
"
|
|
37
|
+
></app-sort-up-icon>
|
|
38
|
+
<app-sort-solid-icon
|
|
39
|
+
class="sort-icon w-2 h-2 inline-block absolute top-3 right-[-3px]"
|
|
40
|
+
*ngIf="sortDetail?.key !== column.key"
|
|
41
|
+
></app-sort-solid-icon>
|
|
42
|
+
</span>
|
|
43
|
+
<core-column-date-picker
|
|
44
|
+
*ngIf="canFilter && column.type == columnsTypes.SHAMSI_DATE"
|
|
45
|
+
[canSelectToday]="true"
|
|
46
|
+
(onChange)="tableDataFiltered($event, column)"
|
|
47
|
+
>
|
|
48
|
+
</core-column-date-picker>
|
|
49
|
+
<core-column-input
|
|
50
|
+
*ngIf="
|
|
51
|
+
canFilter &&
|
|
52
|
+
column.type !== columnsTypes.ACTION &&
|
|
53
|
+
column.type !== columnsTypes.STATUS &&
|
|
54
|
+
column.type !== columnsTypes.SHAMSI_DATE &&
|
|
55
|
+
column.type !== columnsTypes.ROW_SELECTOR &&
|
|
56
|
+
column.type !== columnsTypes.STATUS_ACTIVE &&
|
|
57
|
+
column.type !== columnsTypes.ACTION_BUTTONS
|
|
58
|
+
"
|
|
59
|
+
(onChange)="tableDataFiltered($event, column)"
|
|
60
|
+
></core-column-input>
|
|
61
|
+
<core-column-selector
|
|
62
|
+
*ngIf="
|
|
63
|
+
(canFilter && column.type == columnsTypes.STATUS) ||
|
|
64
|
+
(canFilter && column.type == columnsTypes.STATUS_ACTIVE)
|
|
65
|
+
"
|
|
66
|
+
[titleKey]="'title'"
|
|
67
|
+
[valueKey]="'value'"
|
|
68
|
+
[items]="
|
|
69
|
+
column.type == columnsTypes.STATUS
|
|
70
|
+
? ACTIVE_OPTIONS
|
|
71
|
+
: YES_NO_OPTIONS
|
|
72
|
+
"
|
|
73
|
+
(onItemSelected)="tableDataFiltered($event, column)"
|
|
74
|
+
></core-column-selector>
|
|
75
|
+
</div>
|
|
76
|
+
</th>
|
|
77
|
+
</tr>
|
|
78
|
+
<tr *ngFor="let data of sortedTableData">
|
|
79
|
+
<td
|
|
80
|
+
*ngFor="let column of activeColumnsSchema()"
|
|
81
|
+
[class]="styleFilter ? styleFilter(data) : ''"
|
|
82
|
+
>
|
|
83
|
+
<app-core-table-column-manager
|
|
84
|
+
*ngIf="column.type != columnsTypes.MULTI_COLUMN; else elseBlock"
|
|
85
|
+
[rowSelector]="rowSelector"
|
|
86
|
+
(onColumnClicked)="columnClicked($event)"
|
|
87
|
+
[allTableData]="sortedTableData"
|
|
88
|
+
[data]="data"
|
|
89
|
+
[column]="column"
|
|
90
|
+
></app-core-table-column-manager>
|
|
91
|
+
<ng-template #elseBlock>
|
|
92
|
+
<app-core-table-column-manager
|
|
93
|
+
*ngFor="let childColumn of column.columns; let i = index"
|
|
94
|
+
[rowSelector]="rowSelector"
|
|
95
|
+
(onColumnClicked)="columnClicked($event)"
|
|
96
|
+
[data]="data"
|
|
97
|
+
[allTableData]="sortedTableData"
|
|
98
|
+
[column]="childColumn"
|
|
99
|
+
>
|
|
100
|
+
<span *ngIf="i > 0">-</span>
|
|
101
|
+
</app-core-table-column-manager>
|
|
102
|
+
</ng-template>
|
|
103
|
+
</td>
|
|
104
|
+
</tr>
|
|
105
|
+
</table>
|
|
106
|
+
<ng-template #smallDeviceCard>
|
|
107
|
+
<div>
|
|
108
|
+
<core-card
|
|
109
|
+
*ngFor="let data of sortedTableData"
|
|
110
|
+
[cardClass]="'background-card m-4 p-4 relative'"
|
|
111
|
+
>
|
|
112
|
+
<div
|
|
113
|
+
class="leading-8"
|
|
114
|
+
*ngFor="let column of activeColumnsSchema()"
|
|
115
|
+
[class]="
|
|
116
|
+
column.type === columnsTypes.ACTION_BUTTONS
|
|
117
|
+
? 'actionButtons'
|
|
118
|
+
: column.type === columnsTypes.ROW_SELECTOR
|
|
119
|
+
? 'selectRow'
|
|
120
|
+
: ''
|
|
121
|
+
"
|
|
122
|
+
>
|
|
123
|
+
<span
|
|
124
|
+
*ngIf="
|
|
125
|
+
column.type !== columnsTypes.ACTION_BUTTONS &&
|
|
126
|
+
column.type !== columnsTypes.ROW_SELECTOR
|
|
127
|
+
"
|
|
128
|
+
class="secondary-text-color"
|
|
129
|
+
>
|
|
130
|
+
{{ column.label }} :
|
|
131
|
+
</span>
|
|
132
|
+
<span class="primary-text-color font-semibold">
|
|
133
|
+
<app-core-table-card-manager
|
|
134
|
+
*ngIf="
|
|
135
|
+
column.type != columnsTypes.MULTI_COLUMN;
|
|
136
|
+
else cardManagerElseBlock
|
|
137
|
+
"
|
|
138
|
+
[rowSelector]="rowSelector"
|
|
139
|
+
(onColumnClicked)="columnClicked($event)"
|
|
140
|
+
[data]="data"
|
|
141
|
+
[allTableData]="sortedTableData"
|
|
142
|
+
[column]="column"
|
|
143
|
+
>
|
|
144
|
+
</app-core-table-card-manager>
|
|
145
|
+
|
|
146
|
+
<ng-template #cardManagerElseBlock>
|
|
147
|
+
<app-core-table-card-manager
|
|
148
|
+
*ngFor="let childColumn of column.columns; let i = index"
|
|
149
|
+
[rowSelector]="rowSelector"
|
|
150
|
+
(onColumnClicked)="columnClicked($event)"
|
|
151
|
+
[data]="data"
|
|
152
|
+
[allTableData]="sortedTableData"
|
|
153
|
+
[column]="childColumn"
|
|
154
|
+
>
|
|
155
|
+
<span *ngIf="i > 0">-</span>
|
|
156
|
+
</app-core-table-card-manager>
|
|
157
|
+
</ng-template>
|
|
158
|
+
</span>
|
|
159
|
+
</div>
|
|
160
|
+
</core-card>
|
|
161
|
+
</div>
|
|
162
|
+
</ng-template>
|
|
163
|
+
<core-table-no-content
|
|
164
|
+
*ngIf="!loading"
|
|
165
|
+
[tableData]="sortedTableData"
|
|
166
|
+
[loading]="loading"
|
|
167
|
+
></core-table-no-content>
|
|
168
|
+
</div>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
table {
|
|
2
|
+
border-collapse: collapse;
|
|
3
|
+
width: 100%;
|
|
4
|
+
text-align: start;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
table td,
|
|
8
|
+
table th {
|
|
9
|
+
padding-top: 12px;
|
|
10
|
+
padding-bottom: 12px;
|
|
11
|
+
padding-inline-start: 8px;
|
|
12
|
+
}
|
|
13
|
+
table td {
|
|
14
|
+
font-size: small;
|
|
15
|
+
color: var(--default-table-td-text-color);
|
|
16
|
+
}
|
|
17
|
+
table tr:nth-child(even) {
|
|
18
|
+
background-color: var(--default-table-tr-child-background-color);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
table tr:hover {
|
|
22
|
+
background-color: var(--default-table-tr-hover-background-color);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
table th {
|
|
26
|
+
background-color: var(--default-table-th-background-color);
|
|
27
|
+
text-align: start;
|
|
28
|
+
color: #1d1d1d;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.actionButtons {
|
|
32
|
+
position: absolute;
|
|
33
|
+
bottom: 0;
|
|
34
|
+
background: var(--default-table-action-buttons-background-color);
|
|
35
|
+
left: 0;
|
|
36
|
+
right: 0;
|
|
37
|
+
text-align: left;
|
|
38
|
+
border-radius: 0.5rem;
|
|
39
|
+
border-top-right-radius: 0;
|
|
40
|
+
border-top-left-radius: 0;
|
|
41
|
+
padding-top: 4px;
|
|
42
|
+
padding-left: 16px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.selectRow {
|
|
46
|
+
position: absolute;
|
|
47
|
+
left: 0;
|
|
48
|
+
top: 18px;
|
|
49
|
+
}
|
|
50
|
+
.desc-sort-icon {
|
|
51
|
+
transform: rotate(180deg);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.sort-icon {
|
|
55
|
+
fill: var(--default-table-sort-icon-color);
|
|
56
|
+
}
|
|
57
|
+
.background-card {
|
|
58
|
+
background-color: var(--default-table-background-card-color);
|
|
59
|
+
}
|
|
60
|
+
.secondary-text-color {
|
|
61
|
+
color: var(--default-table-secondary-text-color);
|
|
62
|
+
}
|
|
63
|
+
.primary-text-color {
|
|
64
|
+
color: var(--default-table-primary-text-color);
|
|
65
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AfterContentChecked,
|
|
3
|
+
Component,
|
|
4
|
+
EventEmitter,
|
|
5
|
+
Input,
|
|
6
|
+
Output,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
import { BehaviorSubject } from 'rxjs';
|
|
9
|
+
|
|
10
|
+
import { NgxIndexedDBService } from 'ngx-indexed-db';
|
|
11
|
+
import { orderBy } from 'lodash';
|
|
12
|
+
import {
|
|
13
|
+
ACTIVE_OPTIONS,
|
|
14
|
+
COLUMNS_TYPES,
|
|
15
|
+
YES_NO_OPTIONS,
|
|
16
|
+
} from '../../../utils/constants';
|
|
17
|
+
import { Util } from '../../../utils/util';
|
|
18
|
+
@Component({
|
|
19
|
+
selector: 'core-table',
|
|
20
|
+
templateUrl: './core-table.component.html',
|
|
21
|
+
styleUrls: ['./core-table.component.scss'],
|
|
22
|
+
})
|
|
23
|
+
export class CoreTableComponent {
|
|
24
|
+
@Input({ required: false }) key: string | undefined;
|
|
25
|
+
@Input({ required: true }) columnsSchema: any;
|
|
26
|
+
@Input({ required: true }) tableData: BehaviorSubject<any[]> =
|
|
27
|
+
new BehaviorSubject<any[]>([]);
|
|
28
|
+
@Input({ required: false }) responsive: boolean = true;
|
|
29
|
+
@Input({ required: true }) loading: any;
|
|
30
|
+
@Input() canFilter: boolean = false;
|
|
31
|
+
@Input({ required: false }) styleFilter: ((data: any) => string) | undefined;
|
|
32
|
+
@Input({ required: false }) rowSelector: BehaviorSubject<any> | undefined =
|
|
33
|
+
undefined;
|
|
34
|
+
@Output() onColumnClicked: EventEmitter<any> = new EventEmitter();
|
|
35
|
+
ACTIVE_OPTIONS = ACTIVE_OPTIONS;
|
|
36
|
+
YES_NO_OPTIONS = YES_NO_OPTIONS;
|
|
37
|
+
sortDetail: { key: string; sort: 'asc' | 'desc' } | undefined;
|
|
38
|
+
sortedTableData: any[] = [];
|
|
39
|
+
dbTableFilter: any;
|
|
40
|
+
get columnsTypes() {
|
|
41
|
+
return COLUMNS_TYPES;
|
|
42
|
+
}
|
|
43
|
+
get isRunningOnSmallScreen() {
|
|
44
|
+
return Util.isRunningOnSmallScreen();
|
|
45
|
+
}
|
|
46
|
+
constructor(private dbService: NgxIndexedDBService) {}
|
|
47
|
+
|
|
48
|
+
ngOnInit(): void {
|
|
49
|
+
this.tableData.subscribe((val: any) => {
|
|
50
|
+
this.sortedTableData = val;
|
|
51
|
+
});
|
|
52
|
+
if (this.key) {
|
|
53
|
+
this.dbService
|
|
54
|
+
.getByIndex('tableFilter', 'key', this.key)
|
|
55
|
+
.subscribe((data: any) => {
|
|
56
|
+
this.dbTableFilter = data;
|
|
57
|
+
if (this.dbTableFilter) {
|
|
58
|
+
this.setTableFilter();
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
setTableFilter() {
|
|
64
|
+
this.columnsSchema.map((column: any) => {
|
|
65
|
+
JSON.parse(this.dbTableFilter.columnsSchema).forEach(
|
|
66
|
+
(dbColumnsSchema: any) => {
|
|
67
|
+
if (dbColumnsSchema.key === column.key) {
|
|
68
|
+
column.active = dbColumnsSchema.active;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
return column;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
columnClicked(val: any) {
|
|
77
|
+
this.onColumnClicked.emit(val);
|
|
78
|
+
}
|
|
79
|
+
sortByHeader(column: any) {
|
|
80
|
+
if (this.sortDetail && this.sortDetail.key == column.key) {
|
|
81
|
+
if (this.sortDetail.sort == 'desc') {
|
|
82
|
+
this.sortDetail = { key: column.key, sort: 'asc' };
|
|
83
|
+
} else {
|
|
84
|
+
this.sortDetail = { key: column.key, sort: 'desc' };
|
|
85
|
+
}
|
|
86
|
+
} else {
|
|
87
|
+
this.sortDetail = { key: column.key, sort: 'asc' };
|
|
88
|
+
}
|
|
89
|
+
if (
|
|
90
|
+
column.type == COLUMNS_TYPES.TEXT ||
|
|
91
|
+
column.type == COLUMNS_TYPES.NUMBER
|
|
92
|
+
) {
|
|
93
|
+
this.sortedTableData = orderBy(
|
|
94
|
+
this.sortedTableData,
|
|
95
|
+
[column.key],
|
|
96
|
+
[this.sortDetail.sort]
|
|
97
|
+
);
|
|
98
|
+
} else if (column.type == COLUMNS_TYPES.SELECTOR) {
|
|
99
|
+
this.sortedTableData = orderBy(
|
|
100
|
+
this.sortedTableData,
|
|
101
|
+
[(c) => c[column.key][column.data.key]],
|
|
102
|
+
[this.sortDetail.sort]
|
|
103
|
+
);
|
|
104
|
+
} else if (column.type == COLUMNS_TYPES.SHAMSI_DATE) {
|
|
105
|
+
this.sortedTableData = orderBy(
|
|
106
|
+
this.sortedTableData,
|
|
107
|
+
[(c) => new Date(c[column.key]).getTime()],
|
|
108
|
+
[this.sortDetail.sort]
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
activeColumnsSchema(): any[] {
|
|
114
|
+
return this.columnsSchema.filter(
|
|
115
|
+
(column: any) => column.active === undefined || column.active
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
tableDataFiltered(text: String | boolean, column: any) {
|
|
120
|
+
this.columnsSchema.map((columnSchema: any) => {
|
|
121
|
+
if (columnSchema.key === column.key) {
|
|
122
|
+
columnSchema.columnFilter = text;
|
|
123
|
+
}
|
|
124
|
+
return columnSchema;
|
|
125
|
+
});
|
|
126
|
+
this.tableData.subscribe((tableData) => {
|
|
127
|
+
this.sortedTableData = tableData.filter((data: any) => {
|
|
128
|
+
let result = true;
|
|
129
|
+
this.columnsSchema.forEach((columnSchema: any) => {
|
|
130
|
+
if (
|
|
131
|
+
columnSchema.type === this.columnsTypes.ROW_SELECTOR ||
|
|
132
|
+
columnSchema.type === this.columnsTypes.ACTION ||
|
|
133
|
+
columnSchema.type === this.columnsTypes.ACTION_BUTTONS ||
|
|
134
|
+
columnSchema.columnFilter === undefined ||
|
|
135
|
+
!result
|
|
136
|
+
) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
if (columnSchema.type === this.columnsTypes.SELECTOR) {
|
|
140
|
+
result = data[columnSchema.key][columnSchema.data.key]
|
|
141
|
+
.toLowerCase()
|
|
142
|
+
.includes(columnSchema.columnFilter.toString().toLowerCase());
|
|
143
|
+
} else if (columnSchema.type === this.columnsTypes.SHAMSI_DATE) {
|
|
144
|
+
if (columnSchema.columnFilter === '') {
|
|
145
|
+
result = true;
|
|
146
|
+
} else {
|
|
147
|
+
result = data[columnSchema.key]
|
|
148
|
+
.toLowerCase()
|
|
149
|
+
.includes(
|
|
150
|
+
Util.shamsiToMiladi(
|
|
151
|
+
columnSchema.columnFilter.toString(),
|
|
152
|
+
'YYYY-MM-DD'
|
|
153
|
+
)
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
} else if (columnSchema.type === this.columnsTypes.MULTI_COLUMN) {
|
|
157
|
+
result = columnSchema.columns.some((item: any) => {
|
|
158
|
+
return data[item.key][item.data.key]
|
|
159
|
+
.toLowerCase()
|
|
160
|
+
.includes(columnSchema.columnFilter?.toString()?.toLowerCase());
|
|
161
|
+
});
|
|
162
|
+
} else if (columnSchema.type === this.columnsTypes.STATUS) {
|
|
163
|
+
if (columnSchema.columnFilter === '') {
|
|
164
|
+
result = true;
|
|
165
|
+
} else {
|
|
166
|
+
result = data[columnSchema.key] === columnSchema.columnFilter;
|
|
167
|
+
}
|
|
168
|
+
} else {
|
|
169
|
+
result = data[columnSchema.key]
|
|
170
|
+
.toString()
|
|
171
|
+
.toLowerCase()
|
|
172
|
+
.includes(columnSchema.columnFilter?.toString()?.toLowerCase());
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
return result;
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<span *ngFor="let data of column.data">
|
|
2
|
+
<span
|
|
3
|
+
*ngIf="checkFilter(data)"
|
|
4
|
+
[title]="data.title"
|
|
5
|
+
class="icon-color cursor-pointer h-5 inline-block icon-color m-1"
|
|
6
|
+
(click)="clicked(data.key)"
|
|
7
|
+
>
|
|
8
|
+
<ng-container *ngComponentOutlet="data.component" />
|
|
9
|
+
</span>
|
|
10
|
+
</span>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'app-core-table-action-buttons-column',
|
|
5
|
+
templateUrl: './core-table-action-buttons-column.component.html',
|
|
6
|
+
styleUrls: ['./core-table-action-buttons-column.component.scss'],
|
|
7
|
+
})
|
|
8
|
+
export class CoreTableActionButtonsColumnComponent {
|
|
9
|
+
@Input({ required: true }) data!: any;
|
|
10
|
+
@Input({ required: true }) column!: any;
|
|
11
|
+
@Output() onClick: EventEmitter<any> = new EventEmitter();
|
|
12
|
+
|
|
13
|
+
clicked(key: string) {
|
|
14
|
+
this.onClick.emit({ data: this.data, key: key });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
checkFilter(column: any) {
|
|
18
|
+
if (column.filter) {
|
|
19
|
+
return column.filter(this.data);
|
|
20
|
+
} else {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
import { NiraModalService } from 'nira-modal';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'app-core-table-action-column',
|
|
6
|
+
templateUrl: './core-table-action-column.component.html',
|
|
7
|
+
styleUrls: ['./core-table-action-column.component.scss'],
|
|
8
|
+
})
|
|
9
|
+
export class CoreTableActionColumnComponent {
|
|
10
|
+
@Input({ required: true }) data!: any;
|
|
11
|
+
@Input({ required: true }) column!: any;
|
|
12
|
+
constructor(private niraModalService: NiraModalService) {}
|
|
13
|
+
|
|
14
|
+
openDialog() {
|
|
15
|
+
this.niraModalService.open(this.column.data.component, {
|
|
16
|
+
data: this.data[this.column.data.key],
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|