nira-falcon 0.1.22 → 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/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/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-mulite-select/core-mulite-select-row/core-mulite-select-row.component.mjs +0 -29
- package/esm2022/lib/core-mulite-select/core-mulite-select.component.mjs +0 -130
- 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 -91
- 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 -37
- package/esm2022/lib/core-table/core-column-selector/core-column-selector.component.mjs +0 -99
- 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 -34
- 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 -246
- 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/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 -2831
- 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-mulite-select/core-mulite-select-row/core-mulite-select-row.component.d.ts +0 -11
- package/lib/core-mulite-select/core-mulite-select.component.d.ts +0 -42
- 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 -15
- 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 -13
- 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 -64
- 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/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,17 @@
|
|
|
1
|
+
<div class="root" [ngClass]="{ 'container-row': layout == 'row' }">
|
|
2
|
+
<div
|
|
3
|
+
class="radio-bottom"
|
|
4
|
+
[ngClass]="{ 'item-row-reverse': layout == 'row' }"
|
|
5
|
+
*ngFor="let item of newItems"
|
|
6
|
+
(click)="onItemClick(item)"
|
|
7
|
+
>
|
|
8
|
+
<input
|
|
9
|
+
type="radio"
|
|
10
|
+
[name]="name"
|
|
11
|
+
[value]="item.value == selectedItem.value"
|
|
12
|
+
[checked]="item.value == selectedItem.value"
|
|
13
|
+
(click)="onItemClick(item)"
|
|
14
|
+
/>
|
|
15
|
+
<span class="label">{{ item.title }}</span>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
@mixin userSelect {
|
|
2
|
+
-webkit-user-select: none;
|
|
3
|
+
-moz-user-select: none;
|
|
4
|
+
-ms-user-select: none;
|
|
5
|
+
user-select: none;
|
|
6
|
+
}
|
|
7
|
+
.root {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
gap: 6px;
|
|
11
|
+
}
|
|
12
|
+
.container-row {
|
|
13
|
+
flex-direction: row;
|
|
14
|
+
}
|
|
15
|
+
.item-row-reverse {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: row-reverse;
|
|
18
|
+
}
|
|
19
|
+
.radio-bottom {
|
|
20
|
+
display: inline-flex;
|
|
21
|
+
flex-direction: row;
|
|
22
|
+
align-items: center;
|
|
23
|
+
margin-left: auto;
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
@include userSelect();
|
|
26
|
+
}
|
|
27
|
+
input[type="radio"] {
|
|
28
|
+
appearance: none;
|
|
29
|
+
width: 18px;
|
|
30
|
+
height: 18px;
|
|
31
|
+
border-radius: 50%;
|
|
32
|
+
background-clip: content-box;
|
|
33
|
+
border: 1px solid var(--default-radio-buttons-input-border-color);
|
|
34
|
+
background-color: var(--default-radio-buttons-input-background-color);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
input[type="radio"]:checked {
|
|
38
|
+
background-color: var(--default-radio-buttons-background-color);
|
|
39
|
+
padding: 4px;
|
|
40
|
+
border: 2px solid var(--default-radio-buttons-border-color);
|
|
41
|
+
}
|
|
42
|
+
.label {
|
|
43
|
+
font-size: small;
|
|
44
|
+
font-weight: 500;
|
|
45
|
+
margin-inline: 4px;
|
|
46
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { CoreRadioButtonsComponent } from './core-radio-buttons.component';
|
|
4
|
+
|
|
5
|
+
describe('CoreRadioButtonsComponent', () => {
|
|
6
|
+
let component: CoreRadioButtonsComponent;
|
|
7
|
+
let fixture: ComponentFixture<CoreRadioButtonsComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [CoreRadioButtonsComponent]
|
|
12
|
+
});
|
|
13
|
+
fixture = TestBed.createComponent(CoreRadioButtonsComponent);
|
|
14
|
+
component = fixture.componentInstance;
|
|
15
|
+
fixture.detectChanges();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should create', () => {
|
|
19
|
+
expect(component).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
|
2
|
+
type MenuItem<T> = {
|
|
3
|
+
title: T;
|
|
4
|
+
value: T;
|
|
5
|
+
};
|
|
6
|
+
type LayoutRadioButtons = 'row' | 'column';
|
|
7
|
+
@Component({
|
|
8
|
+
selector: 'core-radio-buttons',
|
|
9
|
+
templateUrl: './core-radio-buttons.component.html',
|
|
10
|
+
styleUrls: ['./core-radio-buttons.component.scss'],
|
|
11
|
+
})
|
|
12
|
+
export class CoreRadioButtonsComponent<T> {
|
|
13
|
+
selectedItem: MenuItem<T> = {} as MenuItem<T>;
|
|
14
|
+
titleKeyObject!: keyof string | number;
|
|
15
|
+
valueKeyObject!: keyof string | number;
|
|
16
|
+
_defaultValue = undefined;
|
|
17
|
+
newItems: MenuItem<T>[] = [];
|
|
18
|
+
_items: any = [];
|
|
19
|
+
initCounter = 0;
|
|
20
|
+
@Input() set items(data: any) {
|
|
21
|
+
this._items = data;
|
|
22
|
+
this.initCounter++;
|
|
23
|
+
this.init();
|
|
24
|
+
}
|
|
25
|
+
@Input({ required: true }) set defaultValue(data: any) {
|
|
26
|
+
this._defaultValue = data;
|
|
27
|
+
this.initCounter++;
|
|
28
|
+
this.init();
|
|
29
|
+
}
|
|
30
|
+
@Input() titleKey!: string;
|
|
31
|
+
@Input() valueKey!: string;
|
|
32
|
+
@Input() layout: LayoutRadioButtons = 'column';
|
|
33
|
+
@Input() name: string = 'radio';
|
|
34
|
+
@Output() onChange = new EventEmitter<string>();
|
|
35
|
+
changeItemsType(items: any[]): MenuItem<T>[] {
|
|
36
|
+
return items.map((item) => {
|
|
37
|
+
return {
|
|
38
|
+
title: item[this.titleKeyObject],
|
|
39
|
+
value: item[this.valueKeyObject],
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
init() {
|
|
44
|
+
if (this.initCounter !== 2) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
type ObjectKey = (typeof this._items)[0];
|
|
48
|
+
this.titleKeyObject = this.titleKey as ObjectKey;
|
|
49
|
+
this.valueKeyObject = this.valueKey as ObjectKey;
|
|
50
|
+
this.newItems = this.changeItemsType(this._items);
|
|
51
|
+
if (this._defaultValue === undefined) {
|
|
52
|
+
this.onItemClick(this.newItems[0]);
|
|
53
|
+
} else {
|
|
54
|
+
this.onItemClick(
|
|
55
|
+
this.newItems.find((item) => item.value == this._defaultValue)
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
onItemClick(item: MenuItem<T> | undefined): void {
|
|
60
|
+
if (!item) return;
|
|
61
|
+
this.selectedItem = item;
|
|
62
|
+
this.onChange.emit(String(item.value));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<div class="search-box flex">
|
|
2
|
+
<input
|
|
3
|
+
type="search"
|
|
4
|
+
placeholder="{{ placeholder }}"
|
|
5
|
+
[(ngModel)]="value"
|
|
6
|
+
(ngModelChange)="change($event)"
|
|
7
|
+
class="box-border border rounded-r marker:focus:outline-0"
|
|
8
|
+
/>
|
|
9
|
+
<div
|
|
10
|
+
class="search-button bg-white border border-r-0 border-gray-400 rounded fill-secondary-text-color cursor-pointer rounded-l"
|
|
11
|
+
>
|
|
12
|
+
<search-icon></search-icon>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
.search-box {
|
|
2
|
+
width: 100%;
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
|
|
5
|
+
input {
|
|
6
|
+
width: calc(100% - 40px);
|
|
7
|
+
color: var(--default-search-box-text-color);
|
|
8
|
+
font-size: 0.875rem;
|
|
9
|
+
padding: 0.1875rem 0.75rem;
|
|
10
|
+
border-color: var(--default-search-box-border-color);
|
|
11
|
+
&:hover {
|
|
12
|
+
border-color: var(--default-search-box-hover-border-color);
|
|
13
|
+
}
|
|
14
|
+
&:focus {
|
|
15
|
+
border-color: var(--default-search-box-focus-border-color);
|
|
16
|
+
}
|
|
17
|
+
&:hover > input,
|
|
18
|
+
&:hover > .search-button {
|
|
19
|
+
border-color: var(--default-search-box-icon-hover-border-color);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.search-button {
|
|
24
|
+
color: var(--default-search-box-icon-color);
|
|
25
|
+
left: -1px;
|
|
26
|
+
top: 4px;
|
|
27
|
+
height: 1.813rem;
|
|
28
|
+
padding: 0.3125rem 0.65rem;
|
|
29
|
+
border-radius: 0.25rem 0 0 0.25rem;
|
|
30
|
+
transition: 0.15s;
|
|
31
|
+
|
|
32
|
+
&:hover {
|
|
33
|
+
background: var(--default-search-box-icon-hover-border-color);
|
|
34
|
+
fill: var(--default-search-box-icon-hover-color);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'core-search-box',
|
|
5
|
+
templateUrl: './core-search-box.component.html',
|
|
6
|
+
styleUrls: ['./core-search-box.component.scss'],
|
|
7
|
+
})
|
|
8
|
+
export class CoreSearchBoxComponent {
|
|
9
|
+
@Input() placeholder = '';
|
|
10
|
+
@Output() onChange: EventEmitter<string> = new EventEmitter();
|
|
11
|
+
value: string = '';
|
|
12
|
+
change(event: any) {
|
|
13
|
+
this.onChange.emit(event);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<div tabindex="-1" class="dropdown" (focusout)="focusOut()">
|
|
2
|
+
<div
|
|
3
|
+
class="select"
|
|
4
|
+
[ngClass]="{
|
|
5
|
+
'small': size=='small',
|
|
6
|
+
'select-clicked': isOpenMenu,
|
|
7
|
+
'highlight-background':
|
|
8
|
+
canHighlightBackground &&
|
|
9
|
+
(selectedItem | json) === ({} | json) &&
|
|
10
|
+
!(inputFormControl.touched && inputFormControl.errors),
|
|
11
|
+
selectError: inputFormControl.touched && inputFormControl.errors ,
|
|
12
|
+
'disable-selector': disabled,
|
|
13
|
+
|
|
14
|
+
}"
|
|
15
|
+
(click)="openMenuClick()"
|
|
16
|
+
>
|
|
17
|
+
<span
|
|
18
|
+
class="placeholder-top"
|
|
19
|
+
*ngIf="(selectedItem | json) != ({} | json)"
|
|
20
|
+
>{{ label }}</span
|
|
21
|
+
>
|
|
22
|
+
<arrow-down-icon
|
|
23
|
+
class="caret fill-secondary-text-color h-6"
|
|
24
|
+
[ngClass]="{ 'caret-rotate': isOpenMenu }"
|
|
25
|
+
></arrow-down-icon>
|
|
26
|
+
|
|
27
|
+
<span
|
|
28
|
+
[ngClass]="[
|
|
29
|
+
label.length > 0 && (selectedItem | json) == ({} | json)
|
|
30
|
+
? 'placeholder'
|
|
31
|
+
: 'selected'
|
|
32
|
+
]"
|
|
33
|
+
>{{
|
|
34
|
+
label.length > 0 && (selectedItem | json) == ({} | json)
|
|
35
|
+
? label
|
|
36
|
+
: selectedItem.title
|
|
37
|
+
}}</span
|
|
38
|
+
>
|
|
39
|
+
</div>
|
|
40
|
+
<ul class="menu" [ngClass]="{ 'menu-open': isOpenMenu }">
|
|
41
|
+
<li
|
|
42
|
+
*ngFor="let item of newItems"
|
|
43
|
+
[ngClass]="{ active: item == selectedItem }"
|
|
44
|
+
(click)="onItemSelect(item, true)"
|
|
45
|
+
>
|
|
46
|
+
{{ item.title }}
|
|
47
|
+
</li>
|
|
48
|
+
</ul>
|
|
49
|
+
<div class="label-error overflow-hidden">
|
|
50
|
+
<span
|
|
51
|
+
*ngIf="
|
|
52
|
+
inputFormControl.touched &&
|
|
53
|
+
inputFormControl.errors?.['required']"
|
|
54
|
+
>این فیلد خالی است</span
|
|
55
|
+
>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
@mixin userSelect {
|
|
2
|
+
-webkit-user-select: none;
|
|
3
|
+
-moz-user-select: none;
|
|
4
|
+
-ms-user-select: none;
|
|
5
|
+
user-select: none;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.dropdown {
|
|
9
|
+
min-width: 15em;
|
|
10
|
+
position: relative;
|
|
11
|
+
width: 100%;
|
|
12
|
+
min-width: 120px;
|
|
13
|
+
|
|
14
|
+
.disable-selector {
|
|
15
|
+
background-color: #f7f7f7 !important;
|
|
16
|
+
border: 1px dashed #ced4da !important;
|
|
17
|
+
cursor: no-drop !important;
|
|
18
|
+
}
|
|
19
|
+
.highlight-background {
|
|
20
|
+
background-color: #dcf6ff !important;
|
|
21
|
+
}
|
|
22
|
+
.select {
|
|
23
|
+
background: #fff;
|
|
24
|
+
color: #304050;
|
|
25
|
+
display: flex;
|
|
26
|
+
height: 42px;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
flex-direction: row-reverse;
|
|
29
|
+
align-items: center;
|
|
30
|
+
border: 1px solid #ced4da;
|
|
31
|
+
border-radius: 4px;
|
|
32
|
+
padding: 8px;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
transition: background 0.3s;
|
|
35
|
+
font-size: 12px;
|
|
36
|
+
@include userSelect();
|
|
37
|
+
&:hover {
|
|
38
|
+
background: #fbfbfb;
|
|
39
|
+
}
|
|
40
|
+
&.small {
|
|
41
|
+
height: 34px;
|
|
42
|
+
border-radius: 8px;
|
|
43
|
+
.placeholder-top {
|
|
44
|
+
background-color: transparent;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
.selected {
|
|
48
|
+
padding-inline: 12px;
|
|
49
|
+
font-size: 14px;
|
|
50
|
+
color: rgba(0, 0, 0, 0.7);
|
|
51
|
+
@include userSelect();
|
|
52
|
+
}
|
|
53
|
+
.placeholder-top {
|
|
54
|
+
position: absolute;
|
|
55
|
+
right: 13px;
|
|
56
|
+
background: white;
|
|
57
|
+
top: -8px;
|
|
58
|
+
padding-inline: 6px;
|
|
59
|
+
font-size: 11px;
|
|
60
|
+
color: #888;
|
|
61
|
+
}
|
|
62
|
+
.caret {
|
|
63
|
+
color: #595c5f;
|
|
64
|
+
@include userSelect();
|
|
65
|
+
}
|
|
66
|
+
.caret-rotate {
|
|
67
|
+
transform: rotate(180deg);
|
|
68
|
+
}
|
|
69
|
+
.placeholder {
|
|
70
|
+
color: #888;
|
|
71
|
+
padding-inline: 16px;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
.select-clicked {
|
|
75
|
+
border: 1px solid rgba(19, 92, 175, 0.397);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.menu {
|
|
79
|
+
list-style: none;
|
|
80
|
+
padding-inline: 0px;
|
|
81
|
+
background: #fff;
|
|
82
|
+
border: 1px #e3e8f1 solid;
|
|
83
|
+
box-shadow: 0 0.5em 1em rgba(0, 0, 0, 0.2);
|
|
84
|
+
border-radius: 0.5em;
|
|
85
|
+
color: #595c5f;
|
|
86
|
+
position: absolute;
|
|
87
|
+
top: 40px;
|
|
88
|
+
left: 50%;
|
|
89
|
+
width: 100%;
|
|
90
|
+
transform: translateX(-50%);
|
|
91
|
+
opacity: 0;
|
|
92
|
+
display: none;
|
|
93
|
+
transition: 0, 2s;
|
|
94
|
+
z-index: 10;
|
|
95
|
+
max-height: 200px;
|
|
96
|
+
overflow: auto;
|
|
97
|
+
li {
|
|
98
|
+
padding: 0.7em 0.5em;
|
|
99
|
+
margin: 0.3em 0;
|
|
100
|
+
margin-inline: 4px;
|
|
101
|
+
border-radius: 0.5em;
|
|
102
|
+
font-size: 14px;
|
|
103
|
+
text-align: start;
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
&:hover {
|
|
106
|
+
background: #f6f6f6;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
.active {
|
|
110
|
+
background: #ced4da;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
.menu-open {
|
|
114
|
+
display: block;
|
|
115
|
+
opacity: 1;
|
|
116
|
+
}
|
|
117
|
+
.label-error {
|
|
118
|
+
color: red;
|
|
119
|
+
font-size: 13px;
|
|
120
|
+
margin-block-start: 4px;
|
|
121
|
+
min-height: 21px;
|
|
122
|
+
width: 100%;
|
|
123
|
+
display: inline-block !important;
|
|
124
|
+
text-align: start;
|
|
125
|
+
}
|
|
126
|
+
.selectError {
|
|
127
|
+
border: 1px solid #fe5f5f !important;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<div tabindex="-1" class="dropdown" (focusout)="focusOut()">
|
|
2
|
+
<div
|
|
3
|
+
class="select"
|
|
4
|
+
[ngClass]="{
|
|
5
|
+
'select-clicked': isOpenMenu,
|
|
6
|
+
'highlight-background':
|
|
7
|
+
canHighlightBackground &&
|
|
8
|
+
(selectedItem | json) === ({} | json) &&
|
|
9
|
+
!(inputFormControl.touched && inputFormControl.errors),
|
|
10
|
+
selectError: inputFormControl.touched && inputFormControl.errors ,
|
|
11
|
+
'disable-selector': disabled,
|
|
12
|
+
|
|
13
|
+
}"
|
|
14
|
+
(click)="openMenuClick()"
|
|
15
|
+
>
|
|
16
|
+
<span
|
|
17
|
+
class="placeholder-top"
|
|
18
|
+
*ngIf="(selectedItem | json) != ({} | json)"
|
|
19
|
+
>{{ label }}</span
|
|
20
|
+
>
|
|
21
|
+
<arrow-down-icon
|
|
22
|
+
class="caret fill-secondary-text-color h-6"
|
|
23
|
+
[ngClass]="{ 'caret-rotate': isOpenMenu }"
|
|
24
|
+
></arrow-down-icon>
|
|
25
|
+
|
|
26
|
+
<span
|
|
27
|
+
[ngClass]="[
|
|
28
|
+
label.length > 0 && (selectedItem | json) == ({} | json)
|
|
29
|
+
? 'placeholder'
|
|
30
|
+
: 'selected'
|
|
31
|
+
]"
|
|
32
|
+
>{{
|
|
33
|
+
label.length > 0 && (selectedItem | json) == ({} | json)
|
|
34
|
+
? label
|
|
35
|
+
: selectedItem.title
|
|
36
|
+
}}</span
|
|
37
|
+
>
|
|
38
|
+
</div>
|
|
39
|
+
<ul class="menu" [ngClass]="{ 'menu-open': isOpenMenu }">
|
|
40
|
+
<li
|
|
41
|
+
*ngFor="let item of newItems"
|
|
42
|
+
[ngClass]="{ active: item == selectedItem }"
|
|
43
|
+
(click)="onItemSelect(item, true)"
|
|
44
|
+
>
|
|
45
|
+
{{ item.title }}
|
|
46
|
+
</li>
|
|
47
|
+
</ul>
|
|
48
|
+
<div class="label-error overflow-hidden">
|
|
49
|
+
<span
|
|
50
|
+
*ngIf="
|
|
51
|
+
inputFormControl.touched &&
|
|
52
|
+
inputFormControl.errors?.['required']"
|
|
53
|
+
>این فیلد خالی است</span
|
|
54
|
+
>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
@mixin userSelect {
|
|
2
|
+
-webkit-user-select: none;
|
|
3
|
+
-moz-user-select: none;
|
|
4
|
+
-ms-user-select: none;
|
|
5
|
+
user-select: none;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.dropdown {
|
|
9
|
+
min-width: 15em;
|
|
10
|
+
position: relative;
|
|
11
|
+
width: 100%;
|
|
12
|
+
min-width: 120px;
|
|
13
|
+
|
|
14
|
+
.disable-selector {
|
|
15
|
+
background-color: #f7f7f7 !important;
|
|
16
|
+
border: 1px dashed #ced4da !important;
|
|
17
|
+
cursor: no-drop !important;
|
|
18
|
+
}
|
|
19
|
+
.highlight-background {
|
|
20
|
+
background-color: #dcf6ff !important;
|
|
21
|
+
}
|
|
22
|
+
.select {
|
|
23
|
+
background: #fff;
|
|
24
|
+
color: #304050;
|
|
25
|
+
display: flex;
|
|
26
|
+
height: 42px;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
flex-direction: row-reverse;
|
|
29
|
+
align-items: center;
|
|
30
|
+
border: 1px solid #ced4da;
|
|
31
|
+
border-radius: 4px;
|
|
32
|
+
padding: 8px;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
transition: background 0.3s;
|
|
35
|
+
font-size: 12px;
|
|
36
|
+
@include userSelect();
|
|
37
|
+
&:hover {
|
|
38
|
+
background: #fbfbfb;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.selected {
|
|
42
|
+
padding-inline: 12px;
|
|
43
|
+
font-size: 14px;
|
|
44
|
+
color: rgba(0, 0, 0, 0.7);
|
|
45
|
+
@include userSelect();
|
|
46
|
+
}
|
|
47
|
+
.placeholder-top {
|
|
48
|
+
position: absolute;
|
|
49
|
+
right: 13px;
|
|
50
|
+
background: white;
|
|
51
|
+
top: -8px;
|
|
52
|
+
padding-inline: 6px;
|
|
53
|
+
font-size: 11px;
|
|
54
|
+
color: #888;
|
|
55
|
+
}
|
|
56
|
+
.caret {
|
|
57
|
+
color: #595c5f;
|
|
58
|
+
@include userSelect();
|
|
59
|
+
}
|
|
60
|
+
.caret-rotate {
|
|
61
|
+
transform: rotate(180deg);
|
|
62
|
+
}
|
|
63
|
+
.placeholder {
|
|
64
|
+
color: #888;
|
|
65
|
+
padding-inline: 16px;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
.select-clicked {
|
|
69
|
+
border: 1px solid rgba(19, 92, 175, 0.397);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.menu {
|
|
73
|
+
list-style: none;
|
|
74
|
+
padding-inline: 0px;
|
|
75
|
+
background: #fff;
|
|
76
|
+
border: 1px #e3e8f1 solid;
|
|
77
|
+
box-shadow: 0 0.5em 1em rgba(0, 0, 0, 0.2);
|
|
78
|
+
border-radius: 0.5em;
|
|
79
|
+
color: #595c5f;
|
|
80
|
+
position: absolute;
|
|
81
|
+
top: 40px;
|
|
82
|
+
left: 50%;
|
|
83
|
+
width: 100%;
|
|
84
|
+
transform: translateX(-50%);
|
|
85
|
+
opacity: 0;
|
|
86
|
+
display: none;
|
|
87
|
+
transition: 0, 2s;
|
|
88
|
+
z-index: 10;
|
|
89
|
+
max-height: 200px;
|
|
90
|
+
overflow: auto;
|
|
91
|
+
li {
|
|
92
|
+
padding: 0.7em 0.5em;
|
|
93
|
+
margin: 0.3em 0;
|
|
94
|
+
margin-inline: 4px;
|
|
95
|
+
border-radius: 0.5em;
|
|
96
|
+
font-size: 14px;
|
|
97
|
+
text-align: start;
|
|
98
|
+
cursor: pointer;
|
|
99
|
+
&:hover {
|
|
100
|
+
background: #f6f6f6;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
.active {
|
|
104
|
+
background: #ced4da;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
.menu-open {
|
|
108
|
+
display: block;
|
|
109
|
+
opacity: 1;
|
|
110
|
+
}
|
|
111
|
+
.label-error {
|
|
112
|
+
color: red;
|
|
113
|
+
font-size: 13px;
|
|
114
|
+
margin-block-start: 4px;
|
|
115
|
+
min-height: 21px;
|
|
116
|
+
width: 100%;
|
|
117
|
+
display: inline-block !important;
|
|
118
|
+
text-align: start;
|
|
119
|
+
}
|
|
120
|
+
.selectError {
|
|
121
|
+
border: 1px solid #fe5f5f !important;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { CoreSelectComponent } from './core-select.component';
|
|
4
|
+
|
|
5
|
+
describe('CoreSelectComponent', () => {
|
|
6
|
+
let component: CoreSelectComponent;
|
|
7
|
+
let fixture: ComponentFixture<CoreSelectComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [CoreSelectComponent]
|
|
12
|
+
});
|
|
13
|
+
fixture = TestBed.createComponent(CoreSelectComponent);
|
|
14
|
+
component = fixture.componentInstance;
|
|
15
|
+
fixture.detectChanges();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should create', () => {
|
|
19
|
+
expect(component).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectorRef,
|
|
3
|
+
Component,
|
|
4
|
+
EventEmitter,
|
|
5
|
+
Input,
|
|
6
|
+
OnInit,
|
|
7
|
+
Output,
|
|
8
|
+
} from '@angular/core';
|
|
9
|
+
import { FormControl } from '@angular/forms';
|
|
10
|
+
import { environment } from '../../environments/environment';
|
|
11
|
+
type MenuItem<T> = {
|
|
12
|
+
title: T;
|
|
13
|
+
value: T;
|
|
14
|
+
};
|
|
15
|
+
@Component({
|
|
16
|
+
selector: 'core-select',
|
|
17
|
+
templateUrl: './core-select' + environment.tempName,
|
|
18
|
+
styleUrls: ['./core-select' + environment.styleName],
|
|
19
|
+
})
|
|
20
|
+
export class CoreSelectComponent<T> {
|
|
21
|
+
selectedItem: MenuItem<T> = {} as MenuItem<T>;
|
|
22
|
+
titleKeyObject!: keyof string | number;
|
|
23
|
+
valueKeyObject!: keyof string | number;
|
|
24
|
+
newItems: MenuItem<T>[] = [];
|
|
25
|
+
isOpenMenu = false;
|
|
26
|
+
_items: any = [];
|
|
27
|
+
_defaultValue!: T;
|
|
28
|
+
@Input() titleKey!: string;
|
|
29
|
+
@Input() valueKey!: string;
|
|
30
|
+
@Input() size: string='small';
|
|
31
|
+
@Input() canHighlightBackground = false;
|
|
32
|
+
@Input() set items(data: any) {
|
|
33
|
+
this._items = data;
|
|
34
|
+
this.init();
|
|
35
|
+
}
|
|
36
|
+
@Input() set defaultValue(data: T) {
|
|
37
|
+
this._defaultValue = data;
|
|
38
|
+
this.init();
|
|
39
|
+
}
|
|
40
|
+
@Input() label: string = '';
|
|
41
|
+
@Input() disabled: boolean = false;
|
|
42
|
+
@Output() onItemSelected = new EventEmitter<any>();
|
|
43
|
+
@Input() inputFormControl: FormControl = new FormControl('', []);
|
|
44
|
+
|
|
45
|
+
constructor(private cdr: ChangeDetectorRef) {}
|
|
46
|
+
init() {
|
|
47
|
+
type ObjectKey = (typeof this._items)[0];
|
|
48
|
+
this.titleKeyObject = this.titleKey as ObjectKey;
|
|
49
|
+
this.valueKeyObject = this.valueKey as ObjectKey;
|
|
50
|
+
this.newItems = this.changeItemsType(this._items);
|
|
51
|
+
this.inputFormControl.setValue(this._defaultValue);
|
|
52
|
+
this.onItemSelect(
|
|
53
|
+
this.newItems.find((item) => item.value == this._defaultValue),
|
|
54
|
+
false
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
ngOnInit(): void {
|
|
58
|
+
this.init();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
changeItemsType(items: any[]): MenuItem<T>[] {
|
|
62
|
+
return items.map((item) => {
|
|
63
|
+
return {
|
|
64
|
+
title: item[this.titleKeyObject],
|
|
65
|
+
value: item[this.valueKeyObject],
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
openMenuClick() {
|
|
71
|
+
if (this.disabled) return;
|
|
72
|
+
this.isOpenMenu = !this.isOpenMenu;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
onItemSelect(selectedItem: MenuItem<T> | undefined, isFromUi: boolean): void {
|
|
76
|
+
if (isFromUi) this.inputFormControl.markAsTouched();
|
|
77
|
+
this.isOpenMenu = false;
|
|
78
|
+
if (!selectedItem) {
|
|
79
|
+
this.selectedItem = {} as MenuItem<T>;
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
this.selectedItem = selectedItem;
|
|
83
|
+
const mainItem = this._items.find(
|
|
84
|
+
(item: any) => item[this.valueKeyObject] === selectedItem.value
|
|
85
|
+
);
|
|
86
|
+
this.inputFormControl.setValue(selectedItem.value);
|
|
87
|
+
this.onItemSelected.emit(mainItem);
|
|
88
|
+
}
|
|
89
|
+
focusOut() {
|
|
90
|
+
this.isOpenMenu = false;
|
|
91
|
+
this.inputFormControl.markAsTouched();
|
|
92
|
+
}
|
|
93
|
+
}
|