@sd-angular/core 1.2.98 → 1.3.0
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/api/package.json +12 -1
- package/api/sd-angular-core-api.d.ts +2 -0
- package/api/sd-angular-core-api.d.ts.__ivy_ngcc_bak +4 -0
- package/api/sd-angular-core-api.d.ts.map +1 -0
- package/autocomplete/package.json +12 -1
- package/autocomplete/sd-angular-core-autocomplete.d.ts +2 -0
- package/autocomplete/sd-angular-core-autocomplete.d.ts.__ivy_ngcc_bak +4 -0
- package/autocomplete/sd-angular-core-autocomplete.d.ts.map +1 -0
- package/badge/package.json +12 -1
- package/badge/sd-angular-core-badge.d.ts +2 -0
- package/badge/sd-angular-core-badge.d.ts.__ivy_ngcc_bak +4 -0
- package/badge/sd-angular-core-badge.d.ts.map +1 -0
- package/bundles/sd-angular-core-api.umd.js +2 -1
- package/bundles/sd-angular-core-api.umd.js.__ivy_ngcc_bak +876 -0
- package/bundles/sd-angular-core-api.umd.js.map +1 -1
- package/bundles/sd-angular-core-api.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-autocomplete.umd.js +2 -1
- package/bundles/sd-angular-core-autocomplete.umd.js.__ivy_ngcc_bak +791 -0
- package/bundles/sd-angular-core-autocomplete.umd.js.map +1 -1
- package/bundles/sd-angular-core-autocomplete.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-badge.umd.js +2 -1
- package/bundles/sd-angular-core-badge.umd.js.__ivy_ngcc_bak +89 -0
- package/bundles/sd-angular-core-badge.umd.js.map +1 -1
- package/bundles/sd-angular-core-badge.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-button.umd.js +2 -1
- package/bundles/sd-angular-core-button.umd.js.__ivy_ngcc_bak +447 -0
- package/bundles/sd-angular-core-button.umd.js.map +1 -1
- package/bundles/sd-angular-core-button.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-cache.umd.js +2 -1
- package/bundles/sd-angular-core-cache.umd.js.__ivy_ngcc_bak +623 -0
- package/bundles/sd-angular-core-cache.umd.js.map +1 -1
- package/bundles/sd-angular-core-cache.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-chart.umd.js +2 -1
- package/bundles/sd-angular-core-chart.umd.js.__ivy_ngcc_bak +1106 -0
- package/bundles/sd-angular-core-chart.umd.js.map +1 -1
- package/bundles/sd-angular-core-chart.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-checkbox.umd.js +2 -1
- package/bundles/sd-angular-core-checkbox.umd.js.__ivy_ngcc_bak +461 -0
- package/bundles/sd-angular-core-checkbox.umd.js.map +1 -1
- package/bundles/sd-angular-core-checkbox.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-chip.umd.js +2 -1
- package/bundles/sd-angular-core-chip.umd.js.__ivy_ngcc_bak +1051 -0
- package/bundles/sd-angular-core-chip.umd.js.map +1 -1
- package/bundles/sd-angular-core-chip.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-comment.umd.js +2 -1
- package/bundles/sd-angular-core-comment.umd.js.__ivy_ngcc_bak +456 -0
- package/bundles/sd-angular-core-comment.umd.js.map +1 -1
- package/bundles/sd-angular-core-comment.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-common.umd.js +2 -1
- package/bundles/sd-angular-core-common.umd.js.__ivy_ngcc_bak +962 -0
- package/bundles/sd-angular-core-common.umd.js.map +1 -1
- package/bundles/sd-angular-core-common.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-confirm.umd.js +2 -1
- package/bundles/sd-angular-core-confirm.umd.js.__ivy_ngcc_bak +159 -0
- package/bundles/sd-angular-core-confirm.umd.js.map +1 -1
- package/bundles/sd-angular-core-confirm.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-date-month.umd.js +2 -1
- package/bundles/sd-angular-core-date-month.umd.js.__ivy_ngcc_bak +650 -0
- package/bundles/sd-angular-core-date-month.umd.js.map +1 -1
- package/bundles/sd-angular-core-date-month.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-date-range.umd.js +2 -1
- package/bundles/sd-angular-core-date-range.umd.js.__ivy_ngcc_bak +660 -0
- package/bundles/sd-angular-core-date-range.umd.js.map +1 -1
- package/bundles/sd-angular-core-date-range.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-date-time.umd.js +2 -1
- package/bundles/sd-angular-core-date-time.umd.js.__ivy_ngcc_bak +734 -0
- package/bundles/sd-angular-core-date-time.umd.js.map +1 -1
- package/bundles/sd-angular-core-date-time.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-db.umd.js +3 -2
- package/bundles/sd-angular-core-db.umd.js.__ivy_ngcc_bak +475 -0
- package/bundles/sd-angular-core-db.umd.js.map +1 -1
- package/bundles/sd-angular-core-db.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-db.umd.min.js +1 -1
- package/bundles/sd-angular-core-db.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-dynamic-report.umd.js +2 -1
- package/bundles/sd-angular-core-dynamic-report.umd.js.__ivy_ngcc_bak +96 -0
- package/bundles/sd-angular-core-dynamic-report.umd.js.map +1 -1
- package/bundles/sd-angular-core-dynamic-report.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-editor.umd.js +2 -1
- package/bundles/sd-angular-core-editor.umd.js.__ivy_ngcc_bak +943 -0
- package/bundles/sd-angular-core-editor.umd.js.map +1 -1
- package/bundles/sd-angular-core-editor.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-excel.umd.js +2 -1
- package/bundles/sd-angular-core-excel.umd.js.__ivy_ngcc_bak +500 -0
- package/bundles/sd-angular-core-excel.umd.js.map +1 -1
- package/bundles/sd-angular-core-excel.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-export.umd.js +2 -1
- package/bundles/sd-angular-core-export.umd.js.__ivy_ngcc_bak +712 -0
- package/bundles/sd-angular-core-export.umd.js.map +1 -1
- package/bundles/sd-angular-core-export.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-filter.umd.js +2 -1
- package/bundles/sd-angular-core-filter.umd.js.__ivy_ngcc_bak +703 -0
- package/bundles/sd-angular-core-filter.umd.js.map +1 -1
- package/bundles/sd-angular-core-filter.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-form.umd.js +2 -1
- package/bundles/sd-angular-core-form.umd.js.__ivy_ngcc_bak +88 -0
- package/bundles/sd-angular-core-form.umd.js.map +1 -1
- package/bundles/sd-angular-core-form.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-grid-material.umd.js +2 -1
- package/bundles/sd-angular-core-grid-material.umd.js.__ivy_ngcc_bak +5029 -0
- package/bundles/sd-angular-core-grid-material.umd.js.map +1 -1
- package/bundles/sd-angular-core-grid-material.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-grid.umd.js +2 -1
- package/bundles/sd-angular-core-grid.umd.js.__ivy_ngcc_bak +5125 -0
- package/bundles/sd-angular-core-grid.umd.js.map +1 -1
- package/bundles/sd-angular-core-grid.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-group.umd.js +2 -1
- package/bundles/sd-angular-core-group.umd.js.__ivy_ngcc_bak +93 -0
- package/bundles/sd-angular-core-group.umd.js.map +1 -1
- package/bundles/sd-angular-core-group.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-header-title.umd.js +2 -1
- package/bundles/sd-angular-core-header-title.umd.js.__ivy_ngcc_bak +56 -0
- package/bundles/sd-angular-core-header-title.umd.js.map +1 -1
- package/bundles/sd-angular-core-header-title.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-image-preview.umd.js +2 -1
- package/bundles/sd-angular-core-image-preview.umd.js.__ivy_ngcc_bak +121 -0
- package/bundles/sd-angular-core-image-preview.umd.js.map +1 -1
- package/bundles/sd-angular-core-image-preview.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-input-currency.umd.js +2 -1
- package/bundles/sd-angular-core-input-currency.umd.js.__ivy_ngcc_bak +737 -0
- package/bundles/sd-angular-core-input-currency.umd.js.map +1 -1
- package/bundles/sd-angular-core-input-currency.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-input-dropdown.umd.js +2 -1
- package/bundles/sd-angular-core-input-dropdown.umd.js.__ivy_ngcc_bak +634 -0
- package/bundles/sd-angular-core-input-dropdown.umd.js.map +1 -1
- package/bundles/sd-angular-core-input-dropdown.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-input-number.umd.js +2 -1
- package/bundles/sd-angular-core-input-number.umd.js.__ivy_ngcc_bak +792 -0
- package/bundles/sd-angular-core-input-number.umd.js.map +1 -1
- package/bundles/sd-angular-core-input-number.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-input-upload-file.umd.js +2 -1
- package/bundles/sd-angular-core-input-upload-file.umd.js.__ivy_ngcc_bak +648 -0
- package/bundles/sd-angular-core-input-upload-file.umd.js.map +1 -1
- package/bundles/sd-angular-core-input-upload-file.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-input.umd.js +2 -1
- package/bundles/sd-angular-core-input.umd.js.__ivy_ngcc_bak +798 -0
- package/bundles/sd-angular-core-input.umd.js.map +1 -1
- package/bundles/sd-angular-core-input.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-json-editor.umd.js +2 -1
- package/bundles/sd-angular-core-json-editor.umd.js.__ivy_ngcc_bak +523 -0
- package/bundles/sd-angular-core-json-editor.umd.js.map +1 -1
- package/bundles/sd-angular-core-json-editor.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-konva.umd.js +2 -1
- package/bundles/sd-angular-core-konva.umd.js.__ivy_ngcc_bak +605 -0
- package/bundles/sd-angular-core-konva.umd.js.map +1 -1
- package/bundles/sd-angular-core-konva.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-label.umd.js +2 -1
- package/bundles/sd-angular-core-label.umd.js.__ivy_ngcc_bak +60 -0
- package/bundles/sd-angular-core-label.umd.js.map +1 -1
- package/bundles/sd-angular-core-label.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-loading.umd.js +2 -1
- package/bundles/sd-angular-core-loading.umd.js.__ivy_ngcc_bak +413 -0
- package/bundles/sd-angular-core-loading.umd.js.map +1 -1
- package/bundles/sd-angular-core-loading.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-modal-resizable.umd.js +2 -1
- package/bundles/sd-angular-core-modal-resizable.umd.js.__ivy_ngcc_bak +487 -0
- package/bundles/sd-angular-core-modal-resizable.umd.js.map +1 -1
- package/bundles/sd-angular-core-modal-resizable.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-modal.umd.js +2 -1
- package/bundles/sd-angular-core-modal.umd.js.__ivy_ngcc_bak +307 -0
- package/bundles/sd-angular-core-modal.umd.js.map +1 -1
- package/bundles/sd-angular-core-modal.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-notify.umd.js +2 -1
- package/bundles/sd-angular-core-notify.umd.js.__ivy_ngcc_bak +719 -0
- package/bundles/sd-angular-core-notify.umd.js.map +1 -1
- package/bundles/sd-angular-core-notify.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-popover.umd.js +2 -1
- package/bundles/sd-angular-core-popover.umd.js.__ivy_ngcc_bak +752 -0
- package/bundles/sd-angular-core-popover.umd.js.map +1 -1
- package/bundles/sd-angular-core-popover.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-quick-action.umd.js +2 -1
- package/bundles/sd-angular-core-quick-action.umd.js.__ivy_ngcc_bak +66 -0
- package/bundles/sd-angular-core-quick-action.umd.js.map +1 -1
- package/bundles/sd-angular-core-quick-action.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-radio.umd.js +2 -1
- package/bundles/sd-angular-core-radio.umd.js.__ivy_ngcc_bak +535 -0
- package/bundles/sd-angular-core-radio.umd.js.map +1 -1
- package/bundles/sd-angular-core-radio.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-select-badge.umd.js +2 -1
- package/bundles/sd-angular-core-select-badge.umd.js.__ivy_ngcc_bak +486 -0
- package/bundles/sd-angular-core-select-badge.umd.js.map +1 -1
- package/bundles/sd-angular-core-select-badge.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-select-editor.umd.js +2 -1
- package/bundles/sd-angular-core-select-editor.umd.js.__ivy_ngcc_bak +431 -0
- package/bundles/sd-angular-core-select-editor.umd.js.map +1 -1
- package/bundles/sd-angular-core-select-editor.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-select.umd.js +2 -1
- package/bundles/sd-angular-core-select.umd.js.__ivy_ngcc_bak +921 -0
- package/bundles/sd-angular-core-select.umd.js.map +1 -1
- package/bundles/sd-angular-core-select.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-service.umd.js +2 -1
- package/bundles/sd-angular-core-service.umd.js.__ivy_ngcc_bak +42 -0
- package/bundles/sd-angular-core-service.umd.js.map +1 -1
- package/bundles/sd-angular-core-service.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-setting.umd.js +2 -1
- package/bundles/sd-angular-core-setting.umd.js.__ivy_ngcc_bak +664 -0
- package/bundles/sd-angular-core-setting.umd.js.map +1 -1
- package/bundles/sd-angular-core-setting.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-side-drawer.umd.js +2 -1
- package/bundles/sd-angular-core-side-drawer.umd.js.__ivy_ngcc_bak +438 -0
- package/bundles/sd-angular-core-side-drawer.umd.js.map +1 -1
- package/bundles/sd-angular-core-side-drawer.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-switch.umd.js +2 -1
- package/bundles/sd-angular-core-switch.umd.js.__ivy_ngcc_bak +454 -0
- package/bundles/sd-angular-core-switch.umd.js.map +1 -1
- package/bundles/sd-angular-core-switch.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-tab-router.umd.js +2 -1
- package/bundles/sd-angular-core-tab-router.umd.js.__ivy_ngcc_bak +941 -0
- package/bundles/sd-angular-core-tab-router.umd.js.map +1 -1
- package/bundles/sd-angular-core-tab-router.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-textarea.umd.js +2 -1
- package/bundles/sd-angular-core-textarea.umd.js.__ivy_ngcc_bak +642 -0
- package/bundles/sd-angular-core-textarea.umd.js.map +1 -1
- package/bundles/sd-angular-core-textarea.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-time.umd.js +2 -1
- package/bundles/sd-angular-core-time.umd.js.__ivy_ngcc_bak +497 -0
- package/bundles/sd-angular-core-time.umd.js.map +1 -1
- package/bundles/sd-angular-core-time.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-timeline.umd.js +2 -1
- package/bundles/sd-angular-core-timeline.umd.js.__ivy_ngcc_bak +102 -0
- package/bundles/sd-angular-core-timeline.umd.js.map +1 -1
- package/bundles/sd-angular-core-timeline.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-translate.umd.js +2 -1
- package/bundles/sd-angular-core-translate.umd.js.__ivy_ngcc_bak +119 -0
- package/bundles/sd-angular-core-translate.umd.js.map +1 -1
- package/bundles/sd-angular-core-translate.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-upload-excel.umd.js +2 -1
- package/bundles/sd-angular-core-upload-excel.umd.js.__ivy_ngcc_bak +1114 -0
- package/bundles/sd-angular-core-upload-excel.umd.js.map +1 -1
- package/bundles/sd-angular-core-upload-excel.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-upload-file.umd.js +2 -1
- package/bundles/sd-angular-core-upload-file.umd.js.__ivy_ngcc_bak +880 -0
- package/bundles/sd-angular-core-upload-file.umd.js.map +1 -1
- package/bundles/sd-angular-core-upload-file.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-utility.umd.js +33 -1
- package/bundles/sd-angular-core-utility.umd.js.__ivy_ngcc_bak +739 -0
- package/bundles/sd-angular-core-utility.umd.js.map +1 -1
- package/bundles/sd-angular-core-utility.umd.js.map.__ivy_ngcc_bak +1 -0
- package/bundles/sd-angular-core-utility.umd.min.js +1 -1
- package/bundles/sd-angular-core-utility.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-view.umd.js +2 -1
- package/bundles/sd-angular-core-view.umd.js.__ivy_ngcc_bak +32 -0
- package/bundles/sd-angular-core-view.umd.js.map +1 -1
- package/bundles/sd-angular-core-view.umd.js.map.__ivy_ngcc_bak +1 -0
- package/button/package.json +12 -1
- package/button/sd-angular-core-button.d.ts +2 -0
- package/button/sd-angular-core-button.d.ts.__ivy_ngcc_bak +4 -0
- package/button/sd-angular-core-button.d.ts.map +1 -0
- package/cache/package.json +12 -1
- package/cache/sd-angular-core-cache.d.ts +2 -0
- package/cache/sd-angular-core-cache.d.ts.__ivy_ngcc_bak +4 -0
- package/cache/sd-angular-core-cache.d.ts.map +1 -0
- package/chart/package.json +12 -1
- package/chart/sd-angular-core-chart.d.ts +2 -0
- package/chart/sd-angular-core-chart.d.ts.__ivy_ngcc_bak +4 -0
- package/chart/sd-angular-core-chart.d.ts.map +1 -0
- package/checkbox/package.json +12 -1
- package/checkbox/sd-angular-core-checkbox.d.ts +2 -0
- package/checkbox/sd-angular-core-checkbox.d.ts.__ivy_ngcc_bak +5 -0
- package/checkbox/sd-angular-core-checkbox.d.ts.map +1 -0
- package/chip/package.json +12 -1
- package/chip/sd-angular-core-chip.d.ts +2 -0
- package/chip/sd-angular-core-chip.d.ts.__ivy_ngcc_bak +5 -0
- package/chip/sd-angular-core-chip.d.ts.map +1 -0
- package/comment/package.json +12 -1
- package/comment/sd-angular-core-comment.d.ts +2 -0
- package/comment/sd-angular-core-comment.d.ts.__ivy_ngcc_bak +4 -0
- package/comment/sd-angular-core-comment.d.ts.map +1 -0
- package/common/package.json +12 -1
- package/common/sd-angular-core-common.d.ts +2 -0
- package/common/sd-angular-core-common.d.ts.__ivy_ngcc_bak +4 -0
- package/common/sd-angular-core-common.d.ts.map +1 -0
- package/confirm/package.json +12 -1
- package/confirm/sd-angular-core-confirm.d.ts +2 -0
- package/confirm/sd-angular-core-confirm.d.ts.__ivy_ngcc_bak +4 -0
- package/confirm/sd-angular-core-confirm.d.ts.map +1 -0
- package/date-month/package.json +12 -1
- package/date-month/sd-angular-core-date-month.d.ts +2 -0
- package/date-month/sd-angular-core-date-month.d.ts.__ivy_ngcc_bak +5 -0
- package/date-month/sd-angular-core-date-month.d.ts.map +1 -0
- package/date-range/package.json +12 -1
- package/date-range/sd-angular-core-date-range.d.ts +2 -0
- package/date-range/sd-angular-core-date-range.d.ts.__ivy_ngcc_bak +4 -0
- package/date-range/sd-angular-core-date-range.d.ts.map +1 -0
- package/date-time/package.json +12 -1
- package/date-time/sd-angular-core-date-time.d.ts +2 -0
- package/date-time/sd-angular-core-date-time.d.ts.__ivy_ngcc_bak +4 -0
- package/date-time/sd-angular-core-date-time.d.ts.map +1 -0
- package/db/package.json +12 -1
- package/db/sd-angular-core-db.d.ts +2 -0
- package/db/sd-angular-core-db.d.ts.__ivy_ngcc_bak +4 -0
- package/db/sd-angular-core-db.d.ts.map +1 -0
- package/db/sd-angular-core-db.metadata.json +1 -1
- package/db/src/lib/db.model.d.ts +10 -2
- package/db/src/lib/db.service.d.ts +6 -9
- package/dynamic-report/package.json +12 -1
- package/dynamic-report/sd-angular-core-dynamic-report.d.ts +2 -0
- package/dynamic-report/sd-angular-core-dynamic-report.d.ts.__ivy_ngcc_bak +4 -0
- package/dynamic-report/sd-angular-core-dynamic-report.d.ts.map +1 -0
- package/editor/package.json +12 -1
- package/editor/sd-angular-core-editor.d.ts +2 -0
- package/editor/sd-angular-core-editor.d.ts.__ivy_ngcc_bak +4 -0
- package/editor/sd-angular-core-editor.d.ts.map +1 -0
- package/esm2015/api/sd-angular-core-api.js +1 -1
- package/esm2015/api/sd-angular-core-api.js.__ivy_ngcc_bak +5 -0
- package/esm2015/autocomplete/sd-angular-core-autocomplete.js +1 -1
- package/esm2015/autocomplete/sd-angular-core-autocomplete.js.__ivy_ngcc_bak +5 -0
- package/esm2015/badge/sd-angular-core-badge.js +1 -1
- package/esm2015/badge/sd-angular-core-badge.js.__ivy_ngcc_bak +5 -0
- package/esm2015/button/sd-angular-core-button.js +1 -1
- package/esm2015/button/sd-angular-core-button.js.__ivy_ngcc_bak +5 -0
- package/esm2015/cache/sd-angular-core-cache.js +1 -1
- package/esm2015/cache/sd-angular-core-cache.js.__ivy_ngcc_bak +5 -0
- package/esm2015/chart/sd-angular-core-chart.js +1 -1
- package/esm2015/chart/sd-angular-core-chart.js.__ivy_ngcc_bak +5 -0
- package/esm2015/checkbox/sd-angular-core-checkbox.js +1 -1
- package/esm2015/checkbox/sd-angular-core-checkbox.js.__ivy_ngcc_bak +6 -0
- package/esm2015/chip/sd-angular-core-chip.js +1 -1
- package/esm2015/chip/sd-angular-core-chip.js.__ivy_ngcc_bak +6 -0
- package/esm2015/comment/sd-angular-core-comment.js +1 -1
- package/esm2015/comment/sd-angular-core-comment.js.__ivy_ngcc_bak +5 -0
- package/esm2015/common/sd-angular-core-common.js +1 -1
- package/esm2015/common/sd-angular-core-common.js.__ivy_ngcc_bak +5 -0
- package/esm2015/confirm/sd-angular-core-confirm.js +1 -1
- package/esm2015/confirm/sd-angular-core-confirm.js.__ivy_ngcc_bak +5 -0
- package/esm2015/date-month/sd-angular-core-date-month.js +1 -1
- package/esm2015/date-month/sd-angular-core-date-month.js.__ivy_ngcc_bak +6 -0
- package/esm2015/date-range/sd-angular-core-date-range.js +1 -1
- package/esm2015/date-range/sd-angular-core-date-range.js.__ivy_ngcc_bak +5 -0
- package/esm2015/date-time/sd-angular-core-date-time.js +1 -1
- package/esm2015/date-time/sd-angular-core-date-time.js.__ivy_ngcc_bak +5 -0
- package/esm2015/db/sd-angular-core-db.js +1 -1
- package/esm2015/db/sd-angular-core-db.js.__ivy_ngcc_bak +5 -0
- package/esm2015/db/src/lib/db.model.js +1 -1
- package/esm2015/db/src/lib/db.service.js +2 -2
- package/esm2015/dynamic-report/sd-angular-core-dynamic-report.js +1 -1
- package/esm2015/dynamic-report/sd-angular-core-dynamic-report.js.__ivy_ngcc_bak +5 -0
- package/esm2015/editor/sd-angular-core-editor.js +1 -1
- package/esm2015/editor/sd-angular-core-editor.js.__ivy_ngcc_bak +5 -0
- package/esm2015/excel/sd-angular-core-excel.js +1 -1
- package/esm2015/excel/sd-angular-core-excel.js.__ivy_ngcc_bak +5 -0
- package/esm2015/export/sd-angular-core-export.js +1 -1
- package/esm2015/export/sd-angular-core-export.js.__ivy_ngcc_bak +5 -0
- package/esm2015/filter/sd-angular-core-filter.js +1 -1
- package/esm2015/filter/sd-angular-core-filter.js.__ivy_ngcc_bak +8 -0
- package/esm2015/form/sd-angular-core-form.js +1 -1
- package/esm2015/form/sd-angular-core-form.js.__ivy_ngcc_bak +5 -0
- package/esm2015/grid/sd-angular-core-grid.js +1 -1
- package/esm2015/grid/sd-angular-core-grid.js.__ivy_ngcc_bak +5 -0
- package/esm2015/grid-material/sd-angular-core-grid-material.js +1 -1
- package/esm2015/grid-material/sd-angular-core-grid-material.js.__ivy_ngcc_bak +47 -0
- package/esm2015/group/sd-angular-core-group.js +1 -1
- package/esm2015/group/sd-angular-core-group.js.__ivy_ngcc_bak +6 -0
- package/esm2015/header-title/sd-angular-core-header-title.js +1 -1
- package/esm2015/header-title/sd-angular-core-header-title.js.__ivy_ngcc_bak +6 -0
- package/esm2015/image-preview/sd-angular-core-image-preview.js +1 -1
- package/esm2015/image-preview/sd-angular-core-image-preview.js.__ivy_ngcc_bak +7 -0
- package/esm2015/input/sd-angular-core-input.js +1 -1
- package/esm2015/input/sd-angular-core-input.js.__ivy_ngcc_bak +6 -0
- package/esm2015/input-currency/sd-angular-core-input-currency.js +1 -1
- package/esm2015/input-currency/sd-angular-core-input-currency.js.__ivy_ngcc_bak +5 -0
- package/esm2015/input-dropdown/sd-angular-core-input-dropdown.js +1 -1
- package/esm2015/input-dropdown/sd-angular-core-input-dropdown.js.__ivy_ngcc_bak +5 -0
- package/esm2015/input-number/sd-angular-core-input-number.js +1 -1
- package/esm2015/input-number/sd-angular-core-input-number.js.__ivy_ngcc_bak +5 -0
- package/esm2015/input-upload-file/sd-angular-core-input-upload-file.js +1 -1
- package/esm2015/input-upload-file/sd-angular-core-input-upload-file.js.__ivy_ngcc_bak +5 -0
- package/esm2015/json-editor/sd-angular-core-json-editor.js +1 -1
- package/esm2015/json-editor/sd-angular-core-json-editor.js.__ivy_ngcc_bak +5 -0
- package/esm2015/konva/sd-angular-core-konva.js +1 -1
- package/esm2015/konva/sd-angular-core-konva.js.__ivy_ngcc_bak +5 -0
- package/esm2015/label/sd-angular-core-label.js +1 -1
- package/esm2015/label/sd-angular-core-label.js.__ivy_ngcc_bak +6 -0
- package/esm2015/loading/sd-angular-core-loading.js +1 -1
- package/esm2015/loading/sd-angular-core-loading.js.__ivy_ngcc_bak +5 -0
- package/esm2015/modal/sd-angular-core-modal.js +1 -1
- package/esm2015/modal/sd-angular-core-modal.js.__ivy_ngcc_bak +5 -0
- package/esm2015/modal-resizable/sd-angular-core-modal-resizable.js +1 -1
- package/esm2015/modal-resizable/sd-angular-core-modal-resizable.js.__ivy_ngcc_bak +5 -0
- package/esm2015/notify/sd-angular-core-notify.js +1 -1
- package/esm2015/notify/sd-angular-core-notify.js.__ivy_ngcc_bak +5 -0
- package/esm2015/popover/sd-angular-core-popover.js +1 -1
- package/esm2015/popover/sd-angular-core-popover.js.__ivy_ngcc_bak +5 -0
- package/esm2015/quick-action/sd-angular-core-quick-action.js +1 -1
- package/esm2015/quick-action/sd-angular-core-quick-action.js.__ivy_ngcc_bak +5 -0
- package/esm2015/radio/sd-angular-core-radio.js +1 -1
- package/esm2015/radio/sd-angular-core-radio.js.__ivy_ngcc_bak +5 -0
- package/esm2015/select/sd-angular-core-select.js +1 -1
- package/esm2015/select/sd-angular-core-select.js.__ivy_ngcc_bak +5 -0
- package/esm2015/select-badge/sd-angular-core-select-badge.js +1 -1
- package/esm2015/select-badge/sd-angular-core-select-badge.js.__ivy_ngcc_bak +5 -0
- package/esm2015/select-editor/sd-angular-core-select-editor.js +1 -1
- package/esm2015/select-editor/sd-angular-core-select-editor.js.__ivy_ngcc_bak +5 -0
- package/esm2015/service/sd-angular-core-service.js +1 -1
- package/esm2015/service/sd-angular-core-service.js.__ivy_ngcc_bak +5 -0
- package/esm2015/setting/sd-angular-core-setting.js +1 -1
- package/esm2015/setting/sd-angular-core-setting.js.__ivy_ngcc_bak +5 -0
- package/esm2015/side-drawer/sd-angular-core-side-drawer.js +1 -1
- package/esm2015/side-drawer/sd-angular-core-side-drawer.js.__ivy_ngcc_bak +5 -0
- package/esm2015/switch/sd-angular-core-switch.js +1 -1
- package/esm2015/switch/sd-angular-core-switch.js.__ivy_ngcc_bak +5 -0
- package/esm2015/tab-router/sd-angular-core-tab-router.js +1 -1
- package/esm2015/tab-router/sd-angular-core-tab-router.js.__ivy_ngcc_bak +7 -0
- package/esm2015/textarea/sd-angular-core-textarea.js +1 -1
- package/esm2015/textarea/sd-angular-core-textarea.js.__ivy_ngcc_bak +5 -0
- package/esm2015/time/sd-angular-core-time.js +1 -1
- package/esm2015/time/sd-angular-core-time.js.__ivy_ngcc_bak +6 -0
- package/esm2015/timeline/sd-angular-core-timeline.js +1 -1
- package/esm2015/timeline/sd-angular-core-timeline.js.__ivy_ngcc_bak +6 -0
- package/esm2015/translate/sd-angular-core-translate.js +1 -1
- package/esm2015/translate/sd-angular-core-translate.js.__ivy_ngcc_bak +5 -0
- package/esm2015/upload-excel/sd-angular-core-upload-excel.js +1 -1
- package/esm2015/upload-excel/sd-angular-core-upload-excel.js.__ivy_ngcc_bak +7 -0
- package/esm2015/upload-file/sd-angular-core-upload-file.js +1 -1
- package/esm2015/upload-file/sd-angular-core-upload-file.js.__ivy_ngcc_bak +5 -0
- package/esm2015/utility/sd-angular-core-utility.js +1 -1
- package/esm2015/utility/sd-angular-core-utility.js.__ivy_ngcc_bak +5 -0
- package/esm2015/utility/src/lib/utility.service.js +22 -2
- package/esm2015/view/sd-angular-core-view.js +1 -1
- package/esm2015/view/sd-angular-core-view.js.__ivy_ngcc_bak +5 -0
- package/excel/package.json +12 -1
- package/excel/sd-angular-core-excel.d.ts +2 -0
- package/excel/sd-angular-core-excel.d.ts.__ivy_ngcc_bak +4 -0
- package/excel/sd-angular-core-excel.d.ts.map +1 -0
- package/export/package.json +12 -1
- package/export/sd-angular-core-export.d.ts +2 -0
- package/export/sd-angular-core-export.d.ts.__ivy_ngcc_bak +4 -0
- package/export/sd-angular-core-export.d.ts.map +1 -0
- package/fesm2015/sd-angular-core-api.js +2 -1
- package/fesm2015/sd-angular-core-api.js.__ivy_ngcc_bak +496 -0
- package/fesm2015/sd-angular-core-api.js.map +1 -1
- package/fesm2015/sd-angular-core-api.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-autocomplete.js +2 -1
- package/fesm2015/sd-angular-core-autocomplete.js.__ivy_ngcc_bak +427 -0
- package/fesm2015/sd-angular-core-autocomplete.js.map +1 -1
- package/fesm2015/sd-angular-core-autocomplete.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-badge.js +2 -1
- package/fesm2015/sd-angular-core-badge.js.__ivy_ngcc_bak +70 -0
- package/fesm2015/sd-angular-core-badge.js.map +1 -1
- package/fesm2015/sd-angular-core-badge.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-button.js +2 -1
- package/fesm2015/sd-angular-core-button.js.__ivy_ngcc_bak +118 -0
- package/fesm2015/sd-angular-core-button.js.map +1 -1
- package/fesm2015/sd-angular-core-button.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-cache.js +2 -1
- package/fesm2015/sd-angular-core-cache.js.__ivy_ngcc_bak +259 -0
- package/fesm2015/sd-angular-core-cache.js.map +1 -1
- package/fesm2015/sd-angular-core-cache.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-chart.js +2 -1
- package/fesm2015/sd-angular-core-chart.js.__ivy_ngcc_bak +727 -0
- package/fesm2015/sd-angular-core-chart.js.map +1 -1
- package/fesm2015/sd-angular-core-chart.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-checkbox.js +2 -1
- package/fesm2015/sd-angular-core-checkbox.js.__ivy_ngcc_bak +120 -0
- package/fesm2015/sd-angular-core-checkbox.js.map +1 -1
- package/fesm2015/sd-angular-core-checkbox.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-chip.js +2 -1
- package/fesm2015/sd-angular-core-chip.js.__ivy_ngcc_bak +632 -0
- package/fesm2015/sd-angular-core-chip.js.map +1 -1
- package/fesm2015/sd-angular-core-chip.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-comment.js +2 -1
- package/fesm2015/sd-angular-core-comment.js.__ivy_ngcc_bak +118 -0
- package/fesm2015/sd-angular-core-comment.js.map +1 -1
- package/fesm2015/sd-angular-core-comment.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-common.js +2 -1
- package/fesm2015/sd-angular-core-common.js.__ivy_ngcc_bak +562 -0
- package/fesm2015/sd-angular-core-common.js.map +1 -1
- package/fesm2015/sd-angular-core-common.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-confirm.js +2 -1
- package/fesm2015/sd-angular-core-confirm.js.__ivy_ngcc_bak +154 -0
- package/fesm2015/sd-angular-core-confirm.js.map +1 -1
- package/fesm2015/sd-angular-core-confirm.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-date-month.js +2 -1
- package/fesm2015/sd-angular-core-date-month.js.__ivy_ngcc_bak +289 -0
- package/fesm2015/sd-angular-core-date-month.js.map +1 -1
- package/fesm2015/sd-angular-core-date-month.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-date-range.js +2 -1
- package/fesm2015/sd-angular-core-date-range.js.__ivy_ngcc_bak +297 -0
- package/fesm2015/sd-angular-core-date-range.js.map +1 -1
- package/fesm2015/sd-angular-core-date-range.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-date-time.js +2 -1
- package/fesm2015/sd-angular-core-date-time.js.__ivy_ngcc_bak +367 -0
- package/fesm2015/sd-angular-core-date-time.js.map +1 -1
- package/fesm2015/sd-angular-core-date-time.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-db.js +3 -2
- package/fesm2015/sd-angular-core-db.js.__ivy_ngcc_bak +102 -0
- package/fesm2015/sd-angular-core-db.js.map +1 -1
- package/fesm2015/sd-angular-core-db.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-dynamic-report.js +2 -1
- package/fesm2015/sd-angular-core-dynamic-report.js.__ivy_ngcc_bak +82 -0
- package/fesm2015/sd-angular-core-dynamic-report.js.map +1 -1
- package/fesm2015/sd-angular-core-dynamic-report.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-editor.js +2 -1
- package/fesm2015/sd-angular-core-editor.js.__ivy_ngcc_bak +576 -0
- package/fesm2015/sd-angular-core-editor.js.map +1 -1
- package/fesm2015/sd-angular-core-editor.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-excel.js +2 -1
- package/fesm2015/sd-angular-core-excel.js.__ivy_ngcc_bak +100 -0
- package/fesm2015/sd-angular-core-excel.js.map +1 -1
- package/fesm2015/sd-angular-core-excel.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-export.js +2 -1
- package/fesm2015/sd-angular-core-export.js.__ivy_ngcc_bak +272 -0
- package/fesm2015/sd-angular-core-export.js.map +1 -1
- package/fesm2015/sd-angular-core-export.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-filter.js +2 -1
- package/fesm2015/sd-angular-core-filter.js.__ivy_ngcc_bak +323 -0
- package/fesm2015/sd-angular-core-filter.js.map +1 -1
- package/fesm2015/sd-angular-core-filter.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-form.js +2 -1
- package/fesm2015/sd-angular-core-form.js.__ivy_ngcc_bak +104 -0
- package/fesm2015/sd-angular-core-form.js.map +1 -1
- package/fesm2015/sd-angular-core-form.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-grid-material.js +2 -1
- package/fesm2015/sd-angular-core-grid-material.js.__ivy_ngcc_bak +3740 -0
- package/fesm2015/sd-angular-core-grid-material.js.map +1 -1
- package/fesm2015/sd-angular-core-grid-material.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-grid.js +2 -1
- package/fesm2015/sd-angular-core-grid.js.__ivy_ngcc_bak +3935 -0
- package/fesm2015/sd-angular-core-grid.js.map +1 -1
- package/fesm2015/sd-angular-core-grid.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-group.js +2 -1
- package/fesm2015/sd-angular-core-group.js.__ivy_ngcc_bak +74 -0
- package/fesm2015/sd-angular-core-group.js.map +1 -1
- package/fesm2015/sd-angular-core-group.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-header-title.js +2 -1
- package/fesm2015/sd-angular-core-header-title.js.__ivy_ngcc_bak +45 -0
- package/fesm2015/sd-angular-core-header-title.js.map +1 -1
- package/fesm2015/sd-angular-core-header-title.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-image-preview.js +2 -1
- package/fesm2015/sd-angular-core-image-preview.js.__ivy_ngcc_bak +107 -0
- package/fesm2015/sd-angular-core-image-preview.js.map +1 -1
- package/fesm2015/sd-angular-core-image-preview.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-input-currency.js +2 -1
- package/fesm2015/sd-angular-core-input-currency.js.__ivy_ngcc_bak +330 -0
- package/fesm2015/sd-angular-core-input-currency.js.map +1 -1
- package/fesm2015/sd-angular-core-input-currency.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-input-dropdown.js +2 -1
- package/fesm2015/sd-angular-core-input-dropdown.js.__ivy_ngcc_bak +268 -0
- package/fesm2015/sd-angular-core-input-dropdown.js.map +1 -1
- package/fesm2015/sd-angular-core-input-dropdown.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-input-number.js +2 -1
- package/fesm2015/sd-angular-core-input-number.js.__ivy_ngcc_bak +415 -0
- package/fesm2015/sd-angular-core-input-number.js.map +1 -1
- package/fesm2015/sd-angular-core-input-number.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-input-upload-file.js +2 -1
- package/fesm2015/sd-angular-core-input-upload-file.js.__ivy_ngcc_bak +274 -0
- package/fesm2015/sd-angular-core-input-upload-file.js.map +1 -1
- package/fesm2015/sd-angular-core-input-upload-file.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-input.js +2 -1
- package/fesm2015/sd-angular-core-input.js.__ivy_ngcc_bak +398 -0
- package/fesm2015/sd-angular-core-input.js.map +1 -1
- package/fesm2015/sd-angular-core-input.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-json-editor.js +2 -1
- package/fesm2015/sd-angular-core-json-editor.js.__ivy_ngcc_bak +180 -0
- package/fesm2015/sd-angular-core-json-editor.js.map +1 -1
- package/fesm2015/sd-angular-core-json-editor.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-konva.js +2 -1
- package/fesm2015/sd-angular-core-konva.js.__ivy_ngcc_bak +237 -0
- package/fesm2015/sd-angular-core-konva.js.map +1 -1
- package/fesm2015/sd-angular-core-konva.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-label.js +2 -1
- package/fesm2015/sd-angular-core-label.js.__ivy_ngcc_bak +49 -0
- package/fesm2015/sd-angular-core-label.js.map +1 -1
- package/fesm2015/sd-angular-core-label.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-loading.js +2 -1
- package/fesm2015/sd-angular-core-loading.js.__ivy_ngcc_bak +83 -0
- package/fesm2015/sd-angular-core-loading.js.map +1 -1
- package/fesm2015/sd-angular-core-loading.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-modal-resizable.js +2 -1
- package/fesm2015/sd-angular-core-modal-resizable.js.__ivy_ngcc_bak +161 -0
- package/fesm2015/sd-angular-core-modal-resizable.js.map +1 -1
- package/fesm2015/sd-angular-core-modal-resizable.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-modal.js +2 -1
- package/fesm2015/sd-angular-core-modal.js.__ivy_ngcc_bak +284 -0
- package/fesm2015/sd-angular-core-modal.js.map +1 -1
- package/fesm2015/sd-angular-core-modal.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-notify.js +2 -1
- package/fesm2015/sd-angular-core-notify.js.__ivy_ngcc_bak +402 -0
- package/fesm2015/sd-angular-core-notify.js.map +1 -1
- package/fesm2015/sd-angular-core-notify.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-popover.js +2 -1
- package/fesm2015/sd-angular-core-popover.js.__ivy_ngcc_bak +415 -0
- package/fesm2015/sd-angular-core-popover.js.map +1 -1
- package/fesm2015/sd-angular-core-popover.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-quick-action.js +2 -1
- package/fesm2015/sd-angular-core-quick-action.js.__ivy_ngcc_bak +53 -0
- package/fesm2015/sd-angular-core-quick-action.js.map +1 -1
- package/fesm2015/sd-angular-core-quick-action.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-radio.js +2 -1
- package/fesm2015/sd-angular-core-radio.js.__ivy_ngcc_bak +188 -0
- package/fesm2015/sd-angular-core-radio.js.map +1 -1
- package/fesm2015/sd-angular-core-radio.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-select-badge.js +2 -1
- package/fesm2015/sd-angular-core-select-badge.js.__ivy_ngcc_bak +156 -0
- package/fesm2015/sd-angular-core-select-badge.js.map +1 -1
- package/fesm2015/sd-angular-core-select-badge.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-select-editor.js +2 -1
- package/fesm2015/sd-angular-core-select-editor.js.__ivy_ngcc_bak +110 -0
- package/fesm2015/sd-angular-core-select-editor.js.map +1 -1
- package/fesm2015/sd-angular-core-select-editor.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-select.js +2 -1
- package/fesm2015/sd-angular-core-select.js.__ivy_ngcc_bak +487 -0
- package/fesm2015/sd-angular-core-select.js.map +1 -1
- package/fesm2015/sd-angular-core-select.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-service.js +2 -1
- package/fesm2015/sd-angular-core-service.js.__ivy_ngcc_bak +36 -0
- package/fesm2015/sd-angular-core-service.js.map +1 -1
- package/fesm2015/sd-angular-core-service.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-setting.js +2 -1
- package/fesm2015/sd-angular-core-setting.js.__ivy_ngcc_bak +290 -0
- package/fesm2015/sd-angular-core-setting.js.map +1 -1
- package/fesm2015/sd-angular-core-setting.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-side-drawer.js +2 -1
- package/fesm2015/sd-angular-core-side-drawer.js.__ivy_ngcc_bak +115 -0
- package/fesm2015/sd-angular-core-side-drawer.js.map +1 -1
- package/fesm2015/sd-angular-core-side-drawer.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-switch.js +2 -1
- package/fesm2015/sd-angular-core-switch.js.__ivy_ngcc_bak +116 -0
- package/fesm2015/sd-angular-core-switch.js.map +1 -1
- package/fesm2015/sd-angular-core-switch.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-tab-router.js +2 -1
- package/fesm2015/sd-angular-core-tab-router.js.__ivy_ngcc_bak +531 -0
- package/fesm2015/sd-angular-core-tab-router.js.map +1 -1
- package/fesm2015/sd-angular-core-tab-router.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-textarea.js +2 -1
- package/fesm2015/sd-angular-core-textarea.js.__ivy_ngcc_bak +266 -0
- package/fesm2015/sd-angular-core-textarea.js.map +1 -1
- package/fesm2015/sd-angular-core-textarea.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-time.js +2 -1
- package/fesm2015/sd-angular-core-time.js.__ivy_ngcc_bak +143 -0
- package/fesm2015/sd-angular-core-time.js.map +1 -1
- package/fesm2015/sd-angular-core-time.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-timeline.js +2 -1
- package/fesm2015/sd-angular-core-timeline.js.__ivy_ngcc_bak +87 -0
- package/fesm2015/sd-angular-core-timeline.js.map +1 -1
- package/fesm2015/sd-angular-core-timeline.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-translate.js +2 -1
- package/fesm2015/sd-angular-core-translate.js.__ivy_ngcc_bak +101 -0
- package/fesm2015/sd-angular-core-translate.js.map +1 -1
- package/fesm2015/sd-angular-core-translate.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-upload-excel.js +2 -1
- package/fesm2015/sd-angular-core-upload-excel.js.__ivy_ngcc_bak +638 -0
- package/fesm2015/sd-angular-core-upload-excel.js.map +1 -1
- package/fesm2015/sd-angular-core-upload-excel.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-upload-file.js +2 -1
- package/fesm2015/sd-angular-core-upload-file.js.__ivy_ngcc_bak +462 -0
- package/fesm2015/sd-angular-core-upload-file.js.map +1 -1
- package/fesm2015/sd-angular-core-upload-file.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-utility.js +23 -2
- package/fesm2015/sd-angular-core-utility.js.__ivy_ngcc_bak +384 -0
- package/fesm2015/sd-angular-core-utility.js.map +1 -1
- package/fesm2015/sd-angular-core-utility.js.map.__ivy_ngcc_bak +1 -0
- package/fesm2015/sd-angular-core-view.js +2 -1
- package/fesm2015/sd-angular-core-view.js.__ivy_ngcc_bak +23 -0
- package/fesm2015/sd-angular-core-view.js.map +1 -1
- package/fesm2015/sd-angular-core-view.js.map.__ivy_ngcc_bak +1 -0
- package/filter/package.json +12 -1
- package/filter/sd-angular-core-filter.d.ts +2 -0
- package/filter/sd-angular-core-filter.d.ts.__ivy_ngcc_bak +7 -0
- package/filter/sd-angular-core-filter.d.ts.map +1 -0
- package/form/package.json +12 -1
- package/form/sd-angular-core-form.d.ts +2 -0
- package/form/sd-angular-core-form.d.ts.__ivy_ngcc_bak +4 -0
- package/form/sd-angular-core-form.d.ts.map +1 -0
- package/grid/package.json +12 -1
- package/grid/sd-angular-core-grid.d.ts +2 -0
- package/grid/sd-angular-core-grid.d.ts.__ivy_ngcc_bak +4 -0
- package/grid/sd-angular-core-grid.d.ts.map +1 -0
- package/grid-material/package.json +12 -1
- package/grid-material/sd-angular-core-grid-material.d.ts +2 -0
- package/grid-material/sd-angular-core-grid-material.d.ts.__ivy_ngcc_bak +46 -0
- package/grid-material/sd-angular-core-grid-material.d.ts.map +1 -0
- package/group/package.json +12 -1
- package/group/sd-angular-core-group.d.ts +2 -0
- package/group/sd-angular-core-group.d.ts.__ivy_ngcc_bak +5 -0
- package/group/sd-angular-core-group.d.ts.map +1 -0
- package/header-title/package.json +12 -1
- package/header-title/sd-angular-core-header-title.d.ts +2 -0
- package/header-title/sd-angular-core-header-title.d.ts.__ivy_ngcc_bak +5 -0
- package/header-title/sd-angular-core-header-title.d.ts.map +1 -0
- package/image-preview/package.json +12 -1
- package/image-preview/sd-angular-core-image-preview.d.ts +2 -0
- package/image-preview/sd-angular-core-image-preview.d.ts.__ivy_ngcc_bak +6 -0
- package/image-preview/sd-angular-core-image-preview.d.ts.map +1 -0
- package/input/package.json +12 -1
- package/input/sd-angular-core-input.d.ts +2 -0
- package/input/sd-angular-core-input.d.ts.__ivy_ngcc_bak +5 -0
- package/input/sd-angular-core-input.d.ts.map +1 -0
- package/input-currency/package.json +12 -1
- package/input-currency/sd-angular-core-input-currency.d.ts +2 -0
- package/input-currency/sd-angular-core-input-currency.d.ts.__ivy_ngcc_bak +4 -0
- package/input-currency/sd-angular-core-input-currency.d.ts.map +1 -0
- package/input-dropdown/package.json +12 -1
- package/input-dropdown/sd-angular-core-input-dropdown.d.ts +2 -0
- package/input-dropdown/sd-angular-core-input-dropdown.d.ts.__ivy_ngcc_bak +4 -0
- package/input-dropdown/sd-angular-core-input-dropdown.d.ts.map +1 -0
- package/input-number/package.json +12 -1
- package/input-number/sd-angular-core-input-number.d.ts +2 -0
- package/input-number/sd-angular-core-input-number.d.ts.__ivy_ngcc_bak +4 -0
- package/input-number/sd-angular-core-input-number.d.ts.map +1 -0
- package/input-upload-file/package.json +12 -1
- package/input-upload-file/sd-angular-core-input-upload-file.d.ts +2 -0
- package/input-upload-file/sd-angular-core-input-upload-file.d.ts.__ivy_ngcc_bak +4 -0
- package/input-upload-file/sd-angular-core-input-upload-file.d.ts.map +1 -0
- package/json-editor/package.json +12 -1
- package/json-editor/sd-angular-core-json-editor.d.ts +2 -0
- package/json-editor/sd-angular-core-json-editor.d.ts.__ivy_ngcc_bak +4 -0
- package/json-editor/sd-angular-core-json-editor.d.ts.map +1 -0
- package/konva/package.json +12 -1
- package/konva/sd-angular-core-konva.d.ts +2 -0
- package/konva/sd-angular-core-konva.d.ts.__ivy_ngcc_bak +4 -0
- package/konva/sd-angular-core-konva.d.ts.map +1 -0
- package/label/package.json +12 -1
- package/label/sd-angular-core-label.d.ts +2 -0
- package/label/sd-angular-core-label.d.ts.__ivy_ngcc_bak +5 -0
- package/label/sd-angular-core-label.d.ts.map +1 -0
- package/loading/package.json +12 -1
- package/loading/sd-angular-core-loading.d.ts +2 -0
- package/loading/sd-angular-core-loading.d.ts.__ivy_ngcc_bak +4 -0
- package/loading/sd-angular-core-loading.d.ts.map +1 -0
- package/modal/package.json +12 -1
- package/modal/sd-angular-core-modal.d.ts +2 -0
- package/modal/sd-angular-core-modal.d.ts.__ivy_ngcc_bak +4 -0
- package/modal/sd-angular-core-modal.d.ts.map +1 -0
- package/modal-resizable/package.json +12 -1
- package/modal-resizable/sd-angular-core-modal-resizable.d.ts +2 -0
- package/modal-resizable/sd-angular-core-modal-resizable.d.ts.__ivy_ngcc_bak +4 -0
- package/modal-resizable/sd-angular-core-modal-resizable.d.ts.map +1 -0
- package/notify/package.json +12 -1
- package/notify/sd-angular-core-notify.d.ts +2 -0
- package/notify/sd-angular-core-notify.d.ts.__ivy_ngcc_bak +4 -0
- package/notify/sd-angular-core-notify.d.ts.map +1 -0
- package/package.json +1 -1
- package/popover/package.json +12 -1
- package/popover/sd-angular-core-popover.d.ts +2 -0
- package/popover/sd-angular-core-popover.d.ts.__ivy_ngcc_bak +4 -0
- package/popover/sd-angular-core-popover.d.ts.map +1 -0
- package/quick-action/package.json +12 -1
- package/quick-action/sd-angular-core-quick-action.d.ts +2 -0
- package/quick-action/sd-angular-core-quick-action.d.ts.__ivy_ngcc_bak +4 -0
- package/quick-action/sd-angular-core-quick-action.d.ts.map +1 -0
- package/radio/package.json +12 -1
- package/radio/sd-angular-core-radio.d.ts +2 -0
- package/radio/sd-angular-core-radio.d.ts.__ivy_ngcc_bak +4 -0
- package/radio/sd-angular-core-radio.d.ts.map +1 -0
- package/sd-angular-core-1.3.0.tgz +0 -0
- package/select/package.json +12 -1
- package/select/sd-angular-core-select.d.ts +2 -0
- package/select/sd-angular-core-select.d.ts.__ivy_ngcc_bak +4 -0
- package/select/sd-angular-core-select.d.ts.map +1 -0
- package/select-badge/package.json +12 -1
- package/select-badge/sd-angular-core-select-badge.d.ts +2 -0
- package/select-badge/sd-angular-core-select-badge.d.ts.__ivy_ngcc_bak +4 -0
- package/select-badge/sd-angular-core-select-badge.d.ts.map +1 -0
- package/select-editor/package.json +12 -1
- package/select-editor/sd-angular-core-select-editor.d.ts +2 -0
- package/select-editor/sd-angular-core-select-editor.d.ts.__ivy_ngcc_bak +4 -0
- package/select-editor/sd-angular-core-select-editor.d.ts.map +1 -0
- package/service/package.json +12 -1
- package/service/sd-angular-core-service.d.ts +2 -0
- package/service/sd-angular-core-service.d.ts.__ivy_ngcc_bak +4 -0
- package/service/sd-angular-core-service.d.ts.map +1 -0
- package/setting/package.json +12 -1
- package/setting/sd-angular-core-setting.d.ts +2 -0
- package/setting/sd-angular-core-setting.d.ts.__ivy_ngcc_bak +4 -0
- package/setting/sd-angular-core-setting.d.ts.map +1 -0
- package/side-drawer/package.json +12 -1
- package/side-drawer/sd-angular-core-side-drawer.d.ts +2 -0
- package/side-drawer/sd-angular-core-side-drawer.d.ts.__ivy_ngcc_bak +4 -0
- package/side-drawer/sd-angular-core-side-drawer.d.ts.map +1 -0
- package/switch/package.json +12 -1
- package/switch/sd-angular-core-switch.d.ts +2 -0
- package/switch/sd-angular-core-switch.d.ts.__ivy_ngcc_bak +4 -0
- package/switch/sd-angular-core-switch.d.ts.map +1 -0
- package/tab-router/package.json +12 -1
- package/tab-router/sd-angular-core-tab-router.d.ts +2 -0
- package/tab-router/sd-angular-core-tab-router.d.ts.__ivy_ngcc_bak +6 -0
- package/tab-router/sd-angular-core-tab-router.d.ts.map +1 -0
- package/textarea/package.json +12 -1
- package/textarea/sd-angular-core-textarea.d.ts +2 -0
- package/textarea/sd-angular-core-textarea.d.ts.__ivy_ngcc_bak +4 -0
- package/textarea/sd-angular-core-textarea.d.ts.map +1 -0
- package/time/package.json +12 -1
- package/time/sd-angular-core-time.d.ts +2 -0
- package/time/sd-angular-core-time.d.ts.__ivy_ngcc_bak +5 -0
- package/time/sd-angular-core-time.d.ts.map +1 -0
- package/timeline/package.json +12 -1
- package/timeline/sd-angular-core-timeline.d.ts +2 -0
- package/timeline/sd-angular-core-timeline.d.ts.__ivy_ngcc_bak +5 -0
- package/timeline/sd-angular-core-timeline.d.ts.map +1 -0
- package/translate/package.json +12 -1
- package/translate/sd-angular-core-translate.d.ts +2 -0
- package/translate/sd-angular-core-translate.d.ts.__ivy_ngcc_bak +4 -0
- package/translate/sd-angular-core-translate.d.ts.map +1 -0
- package/upload-excel/package.json +12 -1
- package/upload-excel/sd-angular-core-upload-excel.d.ts +2 -0
- package/upload-excel/sd-angular-core-upload-excel.d.ts.__ivy_ngcc_bak +6 -0
- package/upload-excel/sd-angular-core-upload-excel.d.ts.map +1 -0
- package/upload-file/package.json +12 -1
- package/upload-file/sd-angular-core-upload-file.d.ts +2 -0
- package/upload-file/sd-angular-core-upload-file.d.ts.__ivy_ngcc_bak +4 -0
- package/upload-file/sd-angular-core-upload-file.d.ts.map +1 -0
- package/utility/package.json +12 -1
- package/utility/sd-angular-core-utility.d.ts +2 -0
- package/utility/sd-angular-core-utility.d.ts.__ivy_ngcc_bak +4 -0
- package/utility/sd-angular-core-utility.d.ts.map +1 -0
- package/utility/src/lib/utility.service.d.ts +4 -0
- package/view/package.json +12 -1
- package/view/sd-angular-core-view.d.ts +2 -0
- package/view/sd-angular-core-view.d.ts.__ivy_ngcc_bak +4 -0
- package/view/sd-angular-core-view.d.ts.map +1 -0
- package/sd-angular-core-1.2.98.tgz +0 -0
|
@@ -0,0 +1,3935 @@
|
|
|
1
|
+
import { Pipe, InjectionToken, Directive, TemplateRef, Input, Injectable, QueryList, Component, ChangeDetectionStrategy, Inject, Optional, ChangeDetectorRef, ViewChildren, ViewChild, ContentChildren, EventEmitter, Output, ViewEncapsulation, NgModule } from '@angular/core';
|
|
2
|
+
import { DatePipe, DecimalPipe, CommonModule } from '@angular/common';
|
|
3
|
+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
4
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
5
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
6
|
+
import { MatInputModule } from '@angular/material/input';
|
|
7
|
+
import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
|
|
8
|
+
import { MatTableModule } from '@angular/material/table';
|
|
9
|
+
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
10
|
+
import { MatMenuModule } from '@angular/material/menu';
|
|
11
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
12
|
+
import { SdServiceModule } from '@sd-angular/core/service';
|
|
13
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
14
|
+
import { MatChipsModule } from '@angular/material/chips';
|
|
15
|
+
import { MatRadioModule } from '@angular/material/radio';
|
|
16
|
+
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
17
|
+
import { __classPrivateFieldGet, __awaiter, __rest, __classPrivateFieldSet } from 'tslib';
|
|
18
|
+
import { DeviceDetectorService } from 'ngx-device-detector';
|
|
19
|
+
import $ from 'jquery';
|
|
20
|
+
import { SdApiService } from '@sd-angular/core/api';
|
|
21
|
+
import { SdExcelService } from '@sd-angular/core/excel';
|
|
22
|
+
import { SdNotifyService } from '@sd-angular/core/notify';
|
|
23
|
+
import { SdLoadingService } from '@sd-angular/core/loading';
|
|
24
|
+
import { SdTranslateService } from '@sd-angular/core/translate';
|
|
25
|
+
import { Subscription, merge } from 'rxjs';
|
|
26
|
+
import { startWith } from 'rxjs/operators';
|
|
27
|
+
import { SdSettingService } from '@sd-angular/core/setting';
|
|
28
|
+
import hash from 'object-hash';
|
|
29
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
30
|
+
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
31
|
+
import { SdUtilityService } from '@sd-angular/core/utility';
|
|
32
|
+
import { SdUploadExcel, SdUploadExcelModule } from '@sd-angular/core/upload-excel';
|
|
33
|
+
import { SdFormModule } from '@sd-angular/core/form';
|
|
34
|
+
|
|
35
|
+
const defaultGridOption = {
|
|
36
|
+
type: undefined,
|
|
37
|
+
items: [],
|
|
38
|
+
filter: {
|
|
39
|
+
type: 'inline',
|
|
40
|
+
disabled: false
|
|
41
|
+
},
|
|
42
|
+
sortable: true,
|
|
43
|
+
paginate: {
|
|
44
|
+
pageSize: 50,
|
|
45
|
+
pageCount: 5
|
|
46
|
+
},
|
|
47
|
+
commands: [],
|
|
48
|
+
columns: []
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
class EditorHandlerPipe {
|
|
52
|
+
transform(value, item, gridOption) {
|
|
53
|
+
const visible = (column) => {
|
|
54
|
+
var _a, _b, _c, _d;
|
|
55
|
+
if (column.type === 'children') {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
let isDisabled = false;
|
|
59
|
+
// Kiểm tra xem có bị disabled hay không?
|
|
60
|
+
if (column.editor) {
|
|
61
|
+
isDisabled = typeof (column.editor.disabled) === 'function' ? column.editor.disabled(item) : column.editor.disabled;
|
|
62
|
+
}
|
|
63
|
+
// Nếu bị disabled return false
|
|
64
|
+
if (isDisabled) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
if (typeof ((_a = gridOption.editor) === null || _a === void 0 ? void 0 : _a.disabled) === 'function') {
|
|
68
|
+
isDisabled = gridOption.editor.disabled(item);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
isDisabled = (_b = gridOption.editor) === null || _b === void 0 ? void 0 : _b.disabled;
|
|
72
|
+
}
|
|
73
|
+
// Nếu bị disabled return false
|
|
74
|
+
if (isDisabled) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
// Hiển thị editor nếu dòng đó:
|
|
78
|
+
// Đang được edit: editingStatus
|
|
79
|
+
return item.editingStatus
|
|
80
|
+
// Được thiết lập alwayDisplay
|
|
81
|
+
|| ((_c = column.editor) === null || _c === void 0 ? void 0 : _c.alwayDisplay)
|
|
82
|
+
// Editable có thuộc tính type inline
|
|
83
|
+
|| ((_d = gridOption.editor) === null || _d === void 0 ? void 0 : _d.type) === 'inline';
|
|
84
|
+
};
|
|
85
|
+
item.editorHandler = item.editorHandler || {};
|
|
86
|
+
for (const column of gridOption.columns) {
|
|
87
|
+
item.editorHandler.disabled = false;
|
|
88
|
+
item.editorHandler[column.field] = {};
|
|
89
|
+
if (typeof (gridOption.editor) === 'object') {
|
|
90
|
+
if (typeof (gridOption.editor.disabled) === 'function') {
|
|
91
|
+
item.editorHandler.disabled = gridOption.editor.disabled(item);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
item.editorHandler.disabled = gridOption.editor.disabled;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
item.editorHandler.disabled = false;
|
|
99
|
+
}
|
|
100
|
+
if (item.editorHandler.disabled) {
|
|
101
|
+
item.editorHandler[column.field].visible = false;
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
item.editorHandler[column.field].visible = visible(column);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
EditorHandlerPipe.decorators = [
|
|
111
|
+
{ type: Pipe, args: [{
|
|
112
|
+
name: 'editorHandler'
|
|
113
|
+
},] }
|
|
114
|
+
];
|
|
115
|
+
|
|
116
|
+
const GRID_CONFIG = new InjectionToken('grid.configuration');
|
|
117
|
+
|
|
118
|
+
class SdCellDefDirective {
|
|
119
|
+
constructor(templateRef) {
|
|
120
|
+
this.templateRef = templateRef;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
SdCellDefDirective.decorators = [
|
|
124
|
+
{ type: Directive, args: [{
|
|
125
|
+
selector: '[sdCellDef]'
|
|
126
|
+
},] }
|
|
127
|
+
];
|
|
128
|
+
SdCellDefDirective.ctorParameters = () => [
|
|
129
|
+
{ type: TemplateRef }
|
|
130
|
+
];
|
|
131
|
+
SdCellDefDirective.propDecorators = {
|
|
132
|
+
sdCellDef: [{ type: Input }]
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
class SdCellFooterDevDirective {
|
|
136
|
+
constructor(templateRef) {
|
|
137
|
+
this.templateRef = templateRef;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
SdCellFooterDevDirective.decorators = [
|
|
141
|
+
{ type: Directive, args: [{
|
|
142
|
+
selector: '[sdCellFooterDef]'
|
|
143
|
+
},] }
|
|
144
|
+
];
|
|
145
|
+
SdCellFooterDevDirective.ctorParameters = () => [
|
|
146
|
+
{ type: TemplateRef }
|
|
147
|
+
];
|
|
148
|
+
SdCellFooterDevDirective.propDecorators = {
|
|
149
|
+
sdCellFooterDef: [{ type: Input }]
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
class SdCellEditorDefDirective {
|
|
153
|
+
constructor(templateRef) {
|
|
154
|
+
this.templateRef = templateRef;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
SdCellEditorDefDirective.decorators = [
|
|
158
|
+
{ type: Directive, args: [{
|
|
159
|
+
selector: '[sdCellEditorDef]'
|
|
160
|
+
},] }
|
|
161
|
+
];
|
|
162
|
+
SdCellEditorDefDirective.ctorParameters = () => [
|
|
163
|
+
{ type: TemplateRef }
|
|
164
|
+
];
|
|
165
|
+
SdCellEditorDefDirective.propDecorators = {
|
|
166
|
+
sdCellEditorDef: [{ type: Input }]
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
class HandlerLocal {
|
|
170
|
+
constructor(datePipe) {
|
|
171
|
+
this.datePipe = datePipe;
|
|
172
|
+
this.filter = (localItems, filterInfo) => {
|
|
173
|
+
const items = localItems.filter(item => {
|
|
174
|
+
for (const column of filterInfo.columns) {
|
|
175
|
+
const filterValue = (filterInfo.rawFilter[column.field] || '').toString().trim().toLowerCase();
|
|
176
|
+
const columnValue = (item[column.field] || '').toString().trim().toLowerCase();
|
|
177
|
+
if (filterValue) {
|
|
178
|
+
if (!columnValue) {
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
if (column.type === 'string') {
|
|
182
|
+
if (columnValue.indexOf(filterValue) === -1) {
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
else if (column.type === 'values' || column.type === 'radio') {
|
|
187
|
+
if (columnValue !== filterValue) {
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
else if (column.type === 'number') {
|
|
192
|
+
const fValue = +filterValue.replace('>=', '').replace('<=', '').replace('>', '').replace('<', '');
|
|
193
|
+
const cValue = +columnValue;
|
|
194
|
+
if (fValue || fValue === 0) {
|
|
195
|
+
if (!cValue && cValue !== 0) {
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
198
|
+
if (filterValue.indexOf('>=') > -1 && cValue < fValue) {
|
|
199
|
+
return false;
|
|
200
|
+
}
|
|
201
|
+
else if (filterValue.indexOf('<=') > -1 && cValue > fValue) {
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
else if (filterValue.indexOf('<') > -1 && cValue >= fValue) {
|
|
205
|
+
return false;
|
|
206
|
+
}
|
|
207
|
+
else if (filterValue.indexOf('>') > -1 && cValue <= fValue) {
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
else if (cValue !== fValue) {
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
else if (column.type === 'bool') {
|
|
216
|
+
if (filterValue === '1' && columnValue !== '1' && columnValue !== 'true') {
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
219
|
+
else if (filterValue === '0' && columnValue !== '0' && columnValue !== 'false') {
|
|
220
|
+
return false;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
else if (column.type === 'date' || column.type === 'datetime') {
|
|
224
|
+
const date = this.datePipe.transform(filterValue, 'yyyy/MM/dd');
|
|
225
|
+
const fromDate = new Date(date);
|
|
226
|
+
const toDate = new Date(date);
|
|
227
|
+
toDate.setDate(toDate.getDate() + 1);
|
|
228
|
+
if (new Date(columnValue).getTime() < fromDate.getTime() || new Date(columnValue).getTime() >= toDate.getTime()) {
|
|
229
|
+
return false;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return true;
|
|
235
|
+
});
|
|
236
|
+
// Sort
|
|
237
|
+
if (filterInfo.orderBy && filterInfo.orderDirection) {
|
|
238
|
+
const column = filterInfo.columns.find(e => e.field === filterInfo.orderBy);
|
|
239
|
+
if (column) {
|
|
240
|
+
const { type, field } = column;
|
|
241
|
+
items.sort((current, next) => {
|
|
242
|
+
if (type === 'number') {
|
|
243
|
+
return (current[field] || 0) - (next[field] || 0);
|
|
244
|
+
}
|
|
245
|
+
if (type === 'date' || type === 'datetime' || type === 'time') {
|
|
246
|
+
const d1 = new Date(current[field] || '').getTime();
|
|
247
|
+
const d2 = new Date(current[field] || '').getTime();
|
|
248
|
+
return d1 - d2;
|
|
249
|
+
}
|
|
250
|
+
const s1 = (current[field] || '').toString();
|
|
251
|
+
const s2 = (next[field] || '').toString();
|
|
252
|
+
if (s1 > s2) {
|
|
253
|
+
return 1;
|
|
254
|
+
}
|
|
255
|
+
if (s1 < s2) {
|
|
256
|
+
return -1;
|
|
257
|
+
}
|
|
258
|
+
return 0;
|
|
259
|
+
});
|
|
260
|
+
if (filterInfo.orderDirection === 'DESC') {
|
|
261
|
+
items.reverse();
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
return {
|
|
266
|
+
items,
|
|
267
|
+
total: items.length
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
HandlerLocal.decorators = [
|
|
273
|
+
{ type: Injectable }
|
|
274
|
+
];
|
|
275
|
+
HandlerLocal.ctorParameters = () => [
|
|
276
|
+
{ type: DatePipe }
|
|
277
|
+
];
|
|
278
|
+
|
|
279
|
+
var _isGuid;
|
|
280
|
+
class HandlerDotnet {
|
|
281
|
+
constructor() {
|
|
282
|
+
this.mapRequest = (filterInfo) => {
|
|
283
|
+
var _a;
|
|
284
|
+
const result = {
|
|
285
|
+
whereClause: '1>0',
|
|
286
|
+
pageSize: filterInfo.pageSize,
|
|
287
|
+
pageNumber: filterInfo.pageNumber,
|
|
288
|
+
orderBy: filterInfo.orderBy,
|
|
289
|
+
orderDirection: filterInfo.orderDirection,
|
|
290
|
+
filter: {},
|
|
291
|
+
externalFilter: {}
|
|
292
|
+
};
|
|
293
|
+
if (filterInfo.customFilter) {
|
|
294
|
+
// Nếu custom filter là string
|
|
295
|
+
if (typeof (filterInfo.customFilter) === 'string') {
|
|
296
|
+
result.whereClause += ` AND ${filterInfo.customFilter}`;
|
|
297
|
+
}
|
|
298
|
+
else if (typeof (filterInfo.customFilter) === 'function') {
|
|
299
|
+
result.whereClause += ` AND ${filterInfo.customFilter()}`;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
const executeColumnNoChildren = (column) => {
|
|
303
|
+
var _a;
|
|
304
|
+
if (!filterInfo.rawFilter[column.field] && filterInfo.rawFilter[column.field] !== 0) {
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
result.filter[column.field] = filterInfo.rawFilter[column.field];
|
|
308
|
+
if (column.type === 'string') {
|
|
309
|
+
const filterValue = ((_a = filterInfo.rawFilter[column.field]) !== null && _a !== void 0 ? _a : '').toString();
|
|
310
|
+
if (__classPrivateFieldGet(this, _isGuid).call(this, filterValue)) {
|
|
311
|
+
result.whereClause += ` AND ${column.field} = GUID("${filterInfo.rawFilter[column.field]}")`;
|
|
312
|
+
}
|
|
313
|
+
else if (filterValue.startsWith('!=')) {
|
|
314
|
+
result.whereClause += ` AND ${column.field} != "${filterValue.substring(2, filterValue.length)}"`;
|
|
315
|
+
}
|
|
316
|
+
else if (filterValue.startsWith('=')) {
|
|
317
|
+
result.whereClause += ` AND ${column.field} = "${filterValue.substring(1, filterValue.length)}"`;
|
|
318
|
+
}
|
|
319
|
+
else if (filterValue.startsWith('%')) {
|
|
320
|
+
result.whereClause += ` AND ${column.field}.EndsWith("${filterValue.substring(1, filterValue.length)}")`;
|
|
321
|
+
}
|
|
322
|
+
else if (filterValue.endsWith('%')) {
|
|
323
|
+
result.whereClause += ` AND ${column.field}.StartsWith("${filterValue.substring(0, filterValue.length - 1)}")`;
|
|
324
|
+
}
|
|
325
|
+
else {
|
|
326
|
+
result.whereClause += ` AND ${column.field}.Contains("${filterValue}")`;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
else if (column.type === 'number') {
|
|
330
|
+
const value = +(filterInfo.rawFilter[column.field].replace('>=', '').replace('<=', '').replace('>', '').replace('<', '').trim());
|
|
331
|
+
if (filterInfo.rawFilter[column.field].indexOf('>=') > -1) {
|
|
332
|
+
result.whereClause += ` AND ${column.field} >= ${value}`;
|
|
333
|
+
}
|
|
334
|
+
else if (filterInfo.rawFilter[column.field].indexOf('<=') > -1) {
|
|
335
|
+
result.whereClause += ` AND ${column.field} <= ${value}`;
|
|
336
|
+
}
|
|
337
|
+
else if (filterInfo.rawFilter[column.field].indexOf('>') > -1) {
|
|
338
|
+
result.whereClause += ` AND ${column.field} > ${value}`;
|
|
339
|
+
}
|
|
340
|
+
else if (filterInfo.rawFilter[column.field].indexOf('<') > -1) {
|
|
341
|
+
result.whereClause += ` AND ${column.field} < ${value}`;
|
|
342
|
+
}
|
|
343
|
+
else {
|
|
344
|
+
result.whereClause += ` AND ${column.field} = ${value}`;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
else if (column.type === 'bool') {
|
|
348
|
+
if (filterInfo.rawFilter[column.field] === '0' || filterInfo.rawFilter[column.field] === '1') {
|
|
349
|
+
result.whereClause += ` AND ${column.field} = ${filterInfo.rawFilter[column.field] === '1' ? 'true' : 'false'}`;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
else if (column.type === 'values') {
|
|
353
|
+
if (filterInfo.rawFilter[column.field]) {
|
|
354
|
+
if (__classPrivateFieldGet(this, _isGuid).call(this, filterInfo.rawFilter[column.field])) {
|
|
355
|
+
result.whereClause += ` AND ${column.field} = GUID("${filterInfo.rawFilter[column.field]}")`;
|
|
356
|
+
}
|
|
357
|
+
else if (typeof (filterInfo.rawFilter[column.field]) === 'string') {
|
|
358
|
+
result.whereClause += ` AND ${column.field} = "${filterInfo.rawFilter[column.field]}"`;
|
|
359
|
+
}
|
|
360
|
+
else {
|
|
361
|
+
result.whereClause += ` AND ${column.field} = ${filterInfo.rawFilter[column.field]}`;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
else if (column.type === 'radio') {
|
|
366
|
+
if (filterInfo.rawFilter[column.field]) {
|
|
367
|
+
result.whereClause += ` AND ${column.field} = "${filterInfo.rawFilter[column.field]}"`;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
else if (column.type === 'date' || column.type === 'datetime') {
|
|
371
|
+
// "DateTime(yyyy,mm,dd,HH,mm,ss)"
|
|
372
|
+
// generate fromDate, toDate
|
|
373
|
+
let date = new Date(filterInfo.rawFilter[column.field]);
|
|
374
|
+
// From Date
|
|
375
|
+
date = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
|
|
376
|
+
result.whereClause += ` AND ${column.field} >= DateTime(${date.getFullYear()},${date.getMonth() + 1},${date.getDate()})`;
|
|
377
|
+
// To Date
|
|
378
|
+
date.setDate(date.getDate() + 1);
|
|
379
|
+
result.whereClause += ` AND ${column.field} < DateTime(${date.getFullYear()},${date.getMonth() + 1},${date.getDate()})`;
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
const executeColumnChildren = (columnChildren) => {
|
|
383
|
+
var _a;
|
|
384
|
+
let flag = false;
|
|
385
|
+
for (const column of columnChildren.children) {
|
|
386
|
+
if (filterInfo.rawFilter[column.field] || filterInfo.rawFilter[column.field] === 0) {
|
|
387
|
+
executeColumnNoChildren(column);
|
|
388
|
+
flag = true;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
if (flag) {
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
if (!filterInfo.rawFilter[columnChildren.field]) {
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
result.filter[columnChildren.field] = filterInfo.rawFilter[columnChildren.field];
|
|
398
|
+
let whereClause = '';
|
|
399
|
+
const filterValue = ((_a = filterInfo.rawFilter[columnChildren.field]) !== null && _a !== void 0 ? _a : '').toString().trim();
|
|
400
|
+
for (const column of columnChildren.children) {
|
|
401
|
+
if (column.type === 'string') {
|
|
402
|
+
if (__classPrivateFieldGet(this, _isGuid).call(this, filterValue)) {
|
|
403
|
+
whereClause += ` OR ${column.field} = GUID("${filterValue}")`;
|
|
404
|
+
}
|
|
405
|
+
else if (filterValue.startsWith('!=')) {
|
|
406
|
+
whereClause += ` OR ${column.field} != "${filterValue.substring(2, filterValue.length)}"`;
|
|
407
|
+
}
|
|
408
|
+
else if (filterValue.startsWith('=')) {
|
|
409
|
+
whereClause += ` OR ${column.field} = "${filterValue.substring(1, filterValue.length)}"`;
|
|
410
|
+
}
|
|
411
|
+
else if (filterValue.startsWith('%')) {
|
|
412
|
+
whereClause += ` OR ${column.field}.EndsWith("${filterValue.substring(1, filterValue.length)}")`;
|
|
413
|
+
}
|
|
414
|
+
else if (filterValue.endsWith('%')) {
|
|
415
|
+
whereClause += ` OR ${column.field}.StartsWith("${filterValue.substring(0, filterValue.length - 1)}")`;
|
|
416
|
+
}
|
|
417
|
+
else {
|
|
418
|
+
whereClause += ` OR ${column.field}.Contains("${filterValue}")`;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
else if (column.type === 'number') {
|
|
422
|
+
const value = +(filterValue.replace('>=', '').replace('<=', '').replace('>', '').replace('<', '').trim());
|
|
423
|
+
if (!Number.isNaN(value)) {
|
|
424
|
+
if (filterValue.indexOf('>=') > -1) {
|
|
425
|
+
whereClause += ` OR ${column.field} >= ${value}`;
|
|
426
|
+
}
|
|
427
|
+
else if (filterValue.indexOf('<=') > -1) {
|
|
428
|
+
whereClause += ` OR ${column.field} <= ${value}`;
|
|
429
|
+
}
|
|
430
|
+
else if (filterValue.indexOf('>') > -1) {
|
|
431
|
+
whereClause += ` OR ${column.field} > ${value}`;
|
|
432
|
+
}
|
|
433
|
+
else if (filterValue.indexOf('<') > -1) {
|
|
434
|
+
whereClause += ` OR ${column.field} < ${value}`;
|
|
435
|
+
}
|
|
436
|
+
else {
|
|
437
|
+
whereClause += ` OR ${column.field} = ${value}`;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
else if (column.type === 'bool') {
|
|
442
|
+
if (filterValue === '0' || filterValue === '1') {
|
|
443
|
+
whereClause += ` OR ${column.field} = ${filterValue === '1' ? 'true' : 'false'}`;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
else if (column.type === 'values') {
|
|
447
|
+
if (__classPrivateFieldGet(this, _isGuid).call(this, filterValue)) {
|
|
448
|
+
whereClause += ` OR ${column.field} = GUID("${filterValue}")`;
|
|
449
|
+
}
|
|
450
|
+
if (typeof (filterInfo.rawFilter[column.field]) === 'string') {
|
|
451
|
+
whereClause += ` OR ${column.field} = "${filterValue}"`;
|
|
452
|
+
}
|
|
453
|
+
else {
|
|
454
|
+
whereClause += ` OR ${column.field} = ${filterValue}`;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
else if (column.type === 'radio') {
|
|
458
|
+
if (filterValue) {
|
|
459
|
+
whereClause += ` OR ${column.field} = "${filterValue}"`;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
else if (column.type === 'date' || column.type === 'datetime') {
|
|
463
|
+
// "DateTime(yyyy,mm,dd,HH,mm,ss)"
|
|
464
|
+
// generate fromDate, toDate
|
|
465
|
+
if (Date.isDate(filterValue)) {
|
|
466
|
+
let date = new Date(filterValue);
|
|
467
|
+
// From Date
|
|
468
|
+
date = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
|
|
469
|
+
whereClause += ` OR (${column.field} >= DateTime(${date.getFullYear()},${date.getMonth() + 1},${date.getDate()})`;
|
|
470
|
+
// To Date
|
|
471
|
+
date.setDate(date.getDate() + 1);
|
|
472
|
+
whereClause += ` AND ${column.field} < DateTime(${date.getFullYear()},${date.getMonth() + 1},${date.getDate()}))`;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
if (whereClause.trim().startsWith('OR')) {
|
|
477
|
+
whereClause = whereClause.trim().substr(2).trim();
|
|
478
|
+
result.whereClause += ` AND(${whereClause})`;
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
filterInfo.columns.forEach(column => {
|
|
482
|
+
if (column.type !== 'children') {
|
|
483
|
+
executeColumnNoChildren(column);
|
|
484
|
+
}
|
|
485
|
+
else {
|
|
486
|
+
executeColumnChildren(column);
|
|
487
|
+
}
|
|
488
|
+
});
|
|
489
|
+
(_a = filterInfo.externalFilters) === null || _a === void 0 ? void 0 : _a.forEach(externalFilter => {
|
|
490
|
+
var _a, _b, _c, _d, _e;
|
|
491
|
+
const { field, type } = externalFilter;
|
|
492
|
+
if (type === 'daterangefull') {
|
|
493
|
+
result.externalFilter[field] = (_a = filterInfo.rawExternalFilter) === null || _a === void 0 ? void 0 : _a[field];
|
|
494
|
+
if (((_b = result.externalFilter[field]) === null || _b === void 0 ? void 0 : _b.from) && ((_c = result.externalFilter[field]) === null || _c === void 0 ? void 0 : _c.to)) {
|
|
495
|
+
const fromDate = new Date((_d = result.externalFilter[field]) === null || _d === void 0 ? void 0 : _d.from);
|
|
496
|
+
const toDate = Date.addDays((_e = result.externalFilter[field]) === null || _e === void 0 ? void 0 : _e.to, 1);
|
|
497
|
+
// tslint:disable-next-line: max-line-length
|
|
498
|
+
result.whereClause += ` AND ${field} >= DateTime(${fromDate.getFullYear()},${fromDate.getMonth() + 1},${fromDate.getDate()})`;
|
|
499
|
+
result.whereClause += ` AND ${field} < DateTime(${toDate.getFullYear()},${toDate.getMonth() + 1},${toDate.getDate()})`;
|
|
500
|
+
}
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
return result;
|
|
505
|
+
};
|
|
506
|
+
this.mapResponse = (res) => {
|
|
507
|
+
const { items, total } = res;
|
|
508
|
+
return {
|
|
509
|
+
items,
|
|
510
|
+
total
|
|
511
|
+
};
|
|
512
|
+
};
|
|
513
|
+
_isGuid.set(this, (key) => {
|
|
514
|
+
const regex = /[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}/i;
|
|
515
|
+
return regex.test(key);
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
_isGuid = new WeakMap();
|
|
520
|
+
HandlerDotnet.decorators = [
|
|
521
|
+
{ type: Injectable }
|
|
522
|
+
];
|
|
523
|
+
|
|
524
|
+
var _numberOfFooterRows, _paginator, _subscription, _setSelectedItems;
|
|
525
|
+
class SdGrid {
|
|
526
|
+
constructor(configuration, ref, deviceService, handlerLocal, handlerDotnet, translateService, datePipe, loadingService, apiService, excelService, notifyService, editorVisiblePipe) {
|
|
527
|
+
this.configuration = configuration;
|
|
528
|
+
this.ref = ref;
|
|
529
|
+
this.handlerLocal = handlerLocal;
|
|
530
|
+
this.handlerDotnet = handlerDotnet;
|
|
531
|
+
this.translateService = translateService;
|
|
532
|
+
this.datePipe = datePipe;
|
|
533
|
+
this.loadingService = loadingService;
|
|
534
|
+
this.apiService = apiService;
|
|
535
|
+
this.excelService = excelService;
|
|
536
|
+
this.notifyService = notifyService;
|
|
537
|
+
this.editorVisiblePipe = editorVisiblePipe;
|
|
538
|
+
this.isMobileOrTablet = false;
|
|
539
|
+
this.displayKey = 'SDCUSTOM';
|
|
540
|
+
this.localItems = [];
|
|
541
|
+
this.items = [];
|
|
542
|
+
this.filter = {};
|
|
543
|
+
this.externalFilter = {};
|
|
544
|
+
this.hiddenPaginate = false;
|
|
545
|
+
this.inlineExternal = {};
|
|
546
|
+
this.inlineColumn = {};
|
|
547
|
+
this.quickFilters = [];
|
|
548
|
+
// Paginate
|
|
549
|
+
this.pages = [1];
|
|
550
|
+
this.pageCount = 5;
|
|
551
|
+
this.totalPage = 1;
|
|
552
|
+
// Loading
|
|
553
|
+
this.isLoading = false;
|
|
554
|
+
this.viewItems = [];
|
|
555
|
+
this.fixedColumns = [];
|
|
556
|
+
this.normalColumns = [];
|
|
557
|
+
this.columns = [];
|
|
558
|
+
this.isCheckedAll = false;
|
|
559
|
+
this.selectedItems = [];
|
|
560
|
+
this.cellDefs = new QueryList();
|
|
561
|
+
this.cellDef = {};
|
|
562
|
+
this.cellEditorDefs = new QueryList();
|
|
563
|
+
this.cellEditorDef = {};
|
|
564
|
+
this.cellFooterDefs = new QueryList();
|
|
565
|
+
this.cellFooterDef = {};
|
|
566
|
+
_numberOfFooterRows.set(this, 0);
|
|
567
|
+
this.footerRows = [];
|
|
568
|
+
_paginator.set(this, void 0);
|
|
569
|
+
this.selectedItem = null;
|
|
570
|
+
_subscription.set(this, new Subscription());
|
|
571
|
+
this.rowHandler = {
|
|
572
|
+
click: (item) => {
|
|
573
|
+
this.selectedItem = item;
|
|
574
|
+
if (this.gridOption.onClickRow) {
|
|
575
|
+
this.gridOption.onClickRow(item);
|
|
576
|
+
}
|
|
577
|
+
},
|
|
578
|
+
dblClick: (item) => {
|
|
579
|
+
this.selectedItem = item;
|
|
580
|
+
if (this.gridOption.onDblClickRow) {
|
|
581
|
+
this.gridOption.onDblClickRow(item);
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
};
|
|
585
|
+
this.setOption = (option) => {
|
|
586
|
+
option = this.initConfiguration(option);
|
|
587
|
+
option = this.initTranslate(option);
|
|
588
|
+
delete this.gridOption;
|
|
589
|
+
this.gridOption = option;
|
|
590
|
+
// Loại bỏ những command bị ẩn
|
|
591
|
+
this.gridOption.commands = this.gridOption.commands.filter(command => {
|
|
592
|
+
const hidden = command.hidden;
|
|
593
|
+
if (hidden !== undefined) {
|
|
594
|
+
if (typeof (hidden) === 'boolean') {
|
|
595
|
+
return !hidden;
|
|
596
|
+
}
|
|
597
|
+
else if (typeof (hidden) === 'function') {
|
|
598
|
+
return !hidden();
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
else {
|
|
602
|
+
return true;
|
|
603
|
+
}
|
|
604
|
+
});
|
|
605
|
+
this.sdGridConfig.setOption({
|
|
606
|
+
key: option.key,
|
|
607
|
+
pageSize: this.gridOption.paginate.pageSize,
|
|
608
|
+
columns: this.gridOption.columns
|
|
609
|
+
});
|
|
610
|
+
this.initExternalFilter();
|
|
611
|
+
this.resize();
|
|
612
|
+
this.detectChanges();
|
|
613
|
+
};
|
|
614
|
+
this.initConfiguration = (option) => {
|
|
615
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
616
|
+
const gridConfiguration = this.configuration;
|
|
617
|
+
// Filter
|
|
618
|
+
if (!((_a = option.filter) === null || _a === void 0 ? void 0 : _a.type) && ((_b = gridConfiguration === null || gridConfiguration === void 0 ? void 0 : gridConfiguration.filter) === null || _b === void 0 ? void 0 : _b.type)) {
|
|
619
|
+
if (!option.filter) {
|
|
620
|
+
option.filter = {
|
|
621
|
+
type: gridConfiguration.filter.type
|
|
622
|
+
};
|
|
623
|
+
}
|
|
624
|
+
else {
|
|
625
|
+
option.filter.type = gridConfiguration.filter.type;
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
if (!((_c = option.filter) === null || _c === void 0 ? void 0 : _c.columnInline) && ((_d = gridConfiguration === null || gridConfiguration === void 0 ? void 0 : gridConfiguration.filter) === null || _d === void 0 ? void 0 : _d.columnInline)) {
|
|
629
|
+
if (!option.filter) {
|
|
630
|
+
option.filter = {
|
|
631
|
+
columnInline: gridConfiguration.filter.columnInline
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
else {
|
|
635
|
+
option.filter.columnInline = gridConfiguration.filter.columnInline;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
if (!((_e = option.filter) === null || _e === void 0 ? void 0 : _e.quickFilterVisibility) && ((_f = gridConfiguration === null || gridConfiguration === void 0 ? void 0 : gridConfiguration.filter) === null || _f === void 0 ? void 0 : _f.quickFilterVisibility)) {
|
|
639
|
+
if (!option.filter) {
|
|
640
|
+
option.filter = {
|
|
641
|
+
quickFilterVisibility: gridConfiguration.filter.quickFilterVisibility
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
else {
|
|
645
|
+
option.filter.quickFilterVisibility = gridConfiguration.filter.quickFilterVisibility;
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
// Translate
|
|
649
|
+
option.translate = (_g = option.translate) !== null && _g !== void 0 ? _g : gridConfiguration === null || gridConfiguration === void 0 ? void 0 : gridConfiguration.translate;
|
|
650
|
+
switch (option.type) {
|
|
651
|
+
case 'local':
|
|
652
|
+
this.handler = this.handlerLocal;
|
|
653
|
+
break;
|
|
654
|
+
case 'dotnet':
|
|
655
|
+
this.handler = this.handlerDotnet;
|
|
656
|
+
break;
|
|
657
|
+
case 'custom':
|
|
658
|
+
this.handler = option.handlerCustom || (gridConfiguration === null || gridConfiguration === void 0 ? void 0 : gridConfiguration.handlerCustom);
|
|
659
|
+
if (!this.handler) {
|
|
660
|
+
this.notifyService.notify.warning(`Handler custom was not found`);
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
break;
|
|
664
|
+
}
|
|
665
|
+
return Object.assign(Object.assign({}, defaultGridOption), option);
|
|
666
|
+
};
|
|
667
|
+
this.initTranslate = (option) => {
|
|
668
|
+
var _a, _b, _c, _d;
|
|
669
|
+
const { translate } = this.translateService;
|
|
670
|
+
(_a = option.commands) === null || _a === void 0 ? void 0 : _a.forEach(command => {
|
|
671
|
+
var _a;
|
|
672
|
+
if (!option.translate) {
|
|
673
|
+
return;
|
|
674
|
+
}
|
|
675
|
+
if (typeof (command.title) === 'string') {
|
|
676
|
+
command.title = translate(command.title);
|
|
677
|
+
}
|
|
678
|
+
if ('children' in command) {
|
|
679
|
+
(_a = command.children) === null || _a === void 0 ? void 0 : _a.forEach(childCommand => {
|
|
680
|
+
if (typeof (childCommand.title) === 'string') {
|
|
681
|
+
childCommand.title = translate(childCommand.title);
|
|
682
|
+
}
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
});
|
|
686
|
+
(_b = option.columns) === null || _b === void 0 ? void 0 : _b.forEach(column => {
|
|
687
|
+
var _a;
|
|
688
|
+
if (column.translate === false) {
|
|
689
|
+
return;
|
|
690
|
+
}
|
|
691
|
+
if (option.translate || column.translate) {
|
|
692
|
+
column.title = translate(column.title);
|
|
693
|
+
}
|
|
694
|
+
if (column.type === 'children') {
|
|
695
|
+
(_a = column === null || column === void 0 ? void 0 : column.children) === null || _a === void 0 ? void 0 : _a.forEach(childColumn => {
|
|
696
|
+
if (childColumn.translate === false) {
|
|
697
|
+
return;
|
|
698
|
+
}
|
|
699
|
+
if (option.translate || childColumn.translate) {
|
|
700
|
+
childColumn.title = translate(childColumn.title);
|
|
701
|
+
}
|
|
702
|
+
});
|
|
703
|
+
}
|
|
704
|
+
});
|
|
705
|
+
(_d = (_c = option.filter) === null || _c === void 0 ? void 0 : _c.externalFilters) === null || _d === void 0 ? void 0 : _d.forEach(externalFilter => {
|
|
706
|
+
if (option.translate) {
|
|
707
|
+
externalFilter.title = translate(externalFilter.title);
|
|
708
|
+
}
|
|
709
|
+
});
|
|
710
|
+
return option;
|
|
711
|
+
};
|
|
712
|
+
this.reload = (gridItems) => __awaiter(this, void 0, void 0, function* () {
|
|
713
|
+
var _a, _b, _c, _d, _e, _f;
|
|
714
|
+
if (this.isLoading) {
|
|
715
|
+
return;
|
|
716
|
+
}
|
|
717
|
+
this.isLoading = true;
|
|
718
|
+
const currentPage = (((_a = __classPrivateFieldGet(this, _paginator)) === null || _a === void 0 ? void 0 : _a.pageIndex) || 0) + 1;
|
|
719
|
+
const pageSize = ((_b = __classPrivateFieldGet(this, _paginator)) === null || _b === void 0 ? void 0 : _b.pageSize) || 50;
|
|
720
|
+
try {
|
|
721
|
+
if (this.gridOption.type !== 'local') {
|
|
722
|
+
const handler = this.handler;
|
|
723
|
+
const filter = handler.mapRequest(this.getFilterInfo(currentPage, pageSize));
|
|
724
|
+
if (this.gridOption.method === 'GET') {
|
|
725
|
+
const queryString = Object.keys(filter).filter(key => filter[key] !== null && filter[key] !== undefined)
|
|
726
|
+
.map(key => key + '=' + filter[key]).join('&');
|
|
727
|
+
const url = this.gridOption.url.includes('?') ? `${this.gridOption.url}&${queryString}` : `${this.gridOption.url}?${queryString}`;
|
|
728
|
+
const response = yield this.apiService.get(url);
|
|
729
|
+
const { items, total } = handler.mapResponse(response);
|
|
730
|
+
this.items = items;
|
|
731
|
+
this.total = total;
|
|
732
|
+
}
|
|
733
|
+
else {
|
|
734
|
+
const response = yield this.apiService.post(this.gridOption.url, filter);
|
|
735
|
+
const { items, total } = handler.mapResponse(response);
|
|
736
|
+
this.items = items;
|
|
737
|
+
this.total = total;
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
else {
|
|
741
|
+
const handler = this.handler;
|
|
742
|
+
if (typeof (this.gridOption.items) === 'function') {
|
|
743
|
+
if (Array.isArray(gridItems)) {
|
|
744
|
+
this.localItems = gridItems;
|
|
745
|
+
}
|
|
746
|
+
else {
|
|
747
|
+
const results = this.gridOption.items();
|
|
748
|
+
if (results instanceof Promise) {
|
|
749
|
+
this.localItems = yield results;
|
|
750
|
+
}
|
|
751
|
+
else {
|
|
752
|
+
this.localItems = results;
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
else {
|
|
757
|
+
this.gridOption.items = gridItems || this.gridOption.items;
|
|
758
|
+
this.localItems = this.gridOption.items;
|
|
759
|
+
}
|
|
760
|
+
const response = handler.filter(this.localItems, {
|
|
761
|
+
customFilter: this.gridOption.filter.customFilter,
|
|
762
|
+
rawFilter: this.filter,
|
|
763
|
+
columns: this.gridOption.columns,
|
|
764
|
+
rawExternalFilter: this.externalFilter,
|
|
765
|
+
externalFilters: (_c = this.gridOption.filter) === null || _c === void 0 ? void 0 : _c.externalFilters,
|
|
766
|
+
orderBy: this.orderBy,
|
|
767
|
+
orderDirection: this.orderDirection,
|
|
768
|
+
pageNumber: currentPage,
|
|
769
|
+
pageSize
|
|
770
|
+
});
|
|
771
|
+
this.items = response.items;
|
|
772
|
+
this.total = response.total;
|
|
773
|
+
}
|
|
774
|
+
this.items.forEach(item => item.originItem = Object.assign({}, item));
|
|
775
|
+
this.isCheckedAll = false;
|
|
776
|
+
__classPrivateFieldGet(this, _setSelectedItems).call(this);
|
|
777
|
+
yield ((_e = (_d = this.gridOption) === null || _d === void 0 ? void 0 : _d.onReloadCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, this.items));
|
|
778
|
+
this.generateViewItems();
|
|
779
|
+
this.generateEditorHandlers();
|
|
780
|
+
$(this.gridBody.nativeElement).scrollTop(0);
|
|
781
|
+
if (currentPage > 1 && !((_f = this.viewItems) === null || _f === void 0 ? void 0 : _f.length)) {
|
|
782
|
+
__classPrivateFieldGet(this, _paginator).firstPage();
|
|
783
|
+
}
|
|
784
|
+
this.detectChanges();
|
|
785
|
+
}
|
|
786
|
+
catch (error) {
|
|
787
|
+
this.notifyService.handle.error(error);
|
|
788
|
+
}
|
|
789
|
+
finally {
|
|
790
|
+
this.isLoading = false;
|
|
791
|
+
}
|
|
792
|
+
});
|
|
793
|
+
this.detectChanges = () => {
|
|
794
|
+
this.ref.detectChanges();
|
|
795
|
+
this.ref.markForCheck();
|
|
796
|
+
};
|
|
797
|
+
this.selectPage = () => {
|
|
798
|
+
if (this.gridOption.type === 'local') {
|
|
799
|
+
this.reload(this.localItems);
|
|
800
|
+
}
|
|
801
|
+
else {
|
|
802
|
+
this.reload();
|
|
803
|
+
}
|
|
804
|
+
};
|
|
805
|
+
this.updateFilter = (param) => {
|
|
806
|
+
this.filter = (param === null || param === void 0 ? void 0 : param.filter) || this.filter;
|
|
807
|
+
this.externalFilter = (param === null || param === void 0 ? void 0 : param.externalFilter) || this.externalFilter;
|
|
808
|
+
__classPrivateFieldGet(this, _paginator).pageIndex = 0;
|
|
809
|
+
if (this.gridOption.type === 'local') {
|
|
810
|
+
this.reload(this.localItems);
|
|
811
|
+
}
|
|
812
|
+
else {
|
|
813
|
+
this.reload();
|
|
814
|
+
}
|
|
815
|
+
};
|
|
816
|
+
//#region Checkable
|
|
817
|
+
_setSelectedItems.set(this, () => {
|
|
818
|
+
this.selectedItems = this.items.filter(item => item.isChecked)
|
|
819
|
+
.map(item => {
|
|
820
|
+
const { temporary, originItem, editorHandler, editingStatus, isChecked, subInformation, blinker } = item, result = __rest(item, ["temporary", "originItem", "editorHandler", "editingStatus", "isChecked", "subInformation", "blinker"]);
|
|
821
|
+
return result;
|
|
822
|
+
});
|
|
823
|
+
});
|
|
824
|
+
this.onCheck = (item, isCheckbox) => {
|
|
825
|
+
var _a, _b;
|
|
826
|
+
if (!this.gridOption.checkable) {
|
|
827
|
+
return;
|
|
828
|
+
}
|
|
829
|
+
if (!isCheckbox) {
|
|
830
|
+
item.isChecked = !item.isChecked;
|
|
831
|
+
}
|
|
832
|
+
this.isCheckedAll = this.items.length === this.items.filter(e => e.isChecked).length;
|
|
833
|
+
(_b = (_a = this.gridOption).onCheck) === null || _b === void 0 ? void 0 : _b.call(_a, this.items.filter(e => e.isChecked), item);
|
|
834
|
+
__classPrivateFieldGet(this, _setSelectedItems).call(this);
|
|
835
|
+
};
|
|
836
|
+
//#endregion
|
|
837
|
+
//#region Sort
|
|
838
|
+
this.sort = (column) => {
|
|
839
|
+
var _a, _b;
|
|
840
|
+
if (column.type === 'children' || column.type === 'image') {
|
|
841
|
+
return;
|
|
842
|
+
}
|
|
843
|
+
const sortable = (_a = this.gridOption.sortable) !== null && _a !== void 0 ? _a : true;
|
|
844
|
+
const columnSortable = (_b = column.sortable) !== null && _b !== void 0 ? _b : true;
|
|
845
|
+
if (!sortable || !columnSortable) {
|
|
846
|
+
return;
|
|
847
|
+
}
|
|
848
|
+
if (this.orderBy === column.field) {
|
|
849
|
+
this.orderDirection = this.orderDirection === 'ASC' ? 'DESC' : 'ASC';
|
|
850
|
+
}
|
|
851
|
+
else {
|
|
852
|
+
this.orderBy = column.field;
|
|
853
|
+
this.orderDirection = 'ASC';
|
|
854
|
+
}
|
|
855
|
+
if (this.gridOption.type === 'local') {
|
|
856
|
+
this.reload(this.localItems);
|
|
857
|
+
}
|
|
858
|
+
else {
|
|
859
|
+
this.reload();
|
|
860
|
+
}
|
|
861
|
+
};
|
|
862
|
+
this.clearFilter = () => {
|
|
863
|
+
this.filter = {};
|
|
864
|
+
this.externalFilter = {};
|
|
865
|
+
this.initFilter();
|
|
866
|
+
this.initExternalFilter();
|
|
867
|
+
if (this.sdGridPopupFilter) {
|
|
868
|
+
this.sdGridPopupFilter.filter = this.filter;
|
|
869
|
+
this.sdGridPopupFilter.externalFilter = this.externalFilter;
|
|
870
|
+
}
|
|
871
|
+
};
|
|
872
|
+
this.onClearFilter = () => {
|
|
873
|
+
this.clearFilter();
|
|
874
|
+
this.reload();
|
|
875
|
+
};
|
|
876
|
+
this.expandOrCollapse = (gridItem) => __awaiter(this, void 0, void 0, function* () {
|
|
877
|
+
var _g, _h;
|
|
878
|
+
const { temporary, originItem, editorHandler, editingStatus, isChecked, subInformation } = gridItem, item = __rest(gridItem, ["temporary", "originItem", "editorHandler", "editingStatus", "isChecked", "subInformation"]);
|
|
879
|
+
if (!this.gridOption.subInformation) {
|
|
880
|
+
return;
|
|
881
|
+
}
|
|
882
|
+
if ((_g = gridItem.subInformation) === null || _g === void 0 ? void 0 : _g.isOpened) {
|
|
883
|
+
gridItem.subInformation.isOpened = false;
|
|
884
|
+
return;
|
|
885
|
+
}
|
|
886
|
+
if (this.gridOption.subInformation.lazyLoading && !((_h = gridItem.subInformation) === null || _h === void 0 ? void 0 : _h.isLoaded)) {
|
|
887
|
+
gridItem.subInformation.isLoading = true;
|
|
888
|
+
try {
|
|
889
|
+
gridItem.subInformation.subItems = yield this.gridOption.subInformation.onLoad(item);
|
|
890
|
+
if (!Array.isArray(gridItem.subInformation.subItems)) {
|
|
891
|
+
this.notifyService.alert.warning(`Data is not an array`);
|
|
892
|
+
gridItem.subInformation.subItems = [];
|
|
893
|
+
}
|
|
894
|
+
gridItem.subInformation.isLoading = false;
|
|
895
|
+
gridItem.subInformation.isLoaded = true;
|
|
896
|
+
gridItem.subInformation.isOpened = true;
|
|
897
|
+
this.ref.detectChanges();
|
|
898
|
+
}
|
|
899
|
+
catch (err) {
|
|
900
|
+
this.notifyService.handle.error(err);
|
|
901
|
+
gridItem.subInformation.isLoading = false;
|
|
902
|
+
this.ref.detectChanges();
|
|
903
|
+
}
|
|
904
|
+
return;
|
|
905
|
+
}
|
|
906
|
+
if (this.gridOption.subInformation.lazyLoading === false && !gridItem.subInformation.isLoaded) {
|
|
907
|
+
gridItem.subInformation.subItems = gridItem[this.gridOption.subInformation.field];
|
|
908
|
+
if (!Array.isArray(gridItem.subInformation.subItems)) {
|
|
909
|
+
this.notifyService.alert.warning(`Data is not an array`);
|
|
910
|
+
gridItem.subInformation.subItems = [];
|
|
911
|
+
}
|
|
912
|
+
gridItem.subInformation.isLoaded = true;
|
|
913
|
+
gridItem.subInformation.isOpened = true;
|
|
914
|
+
return;
|
|
915
|
+
}
|
|
916
|
+
gridItem.subInformation.isOpened = true;
|
|
917
|
+
this.ref.detectChanges();
|
|
918
|
+
});
|
|
919
|
+
//#region Editable
|
|
920
|
+
this.onCreate = () => {
|
|
921
|
+
var _a;
|
|
922
|
+
const { type, editor, columns } = this.gridOption;
|
|
923
|
+
if (!(editor === null || editor === void 0 ? void 0 : editor.addable)) {
|
|
924
|
+
return;
|
|
925
|
+
}
|
|
926
|
+
const item = {};
|
|
927
|
+
// Gán giá trị mặc định
|
|
928
|
+
columns.forEach(column => {
|
|
929
|
+
if (column.type === 'values') {
|
|
930
|
+
item[column.field] = '';
|
|
931
|
+
}
|
|
932
|
+
else if (column.type === 'bool') {
|
|
933
|
+
item[column.field] = true;
|
|
934
|
+
}
|
|
935
|
+
else if (column.type === 'number') {
|
|
936
|
+
item[column.field] = null;
|
|
937
|
+
}
|
|
938
|
+
});
|
|
939
|
+
(_a = editor.onAdd) === null || _a === void 0 ? void 0 : _a.call(editor, item);
|
|
940
|
+
// Đưa item lên dòng đầu tiên nếu type khác popup
|
|
941
|
+
if (editor.type !== 'popup') {
|
|
942
|
+
if (type === 'local') {
|
|
943
|
+
this.items.splice(0, 0, item);
|
|
944
|
+
}
|
|
945
|
+
this.viewItems.splice(0, 0, item);
|
|
946
|
+
}
|
|
947
|
+
this.onUpdate(item, false);
|
|
948
|
+
};
|
|
949
|
+
this.onUpdate = (item, isModified) => {
|
|
950
|
+
const { editor, columns } = this.gridOption;
|
|
951
|
+
item.editingStatus = isModified ? 'update' : 'create';
|
|
952
|
+
item.temporary = Object.assign({}, item);
|
|
953
|
+
this.generateEditorHanlder(item);
|
|
954
|
+
if (editor.type === 'popup') {
|
|
955
|
+
this.sdGridPopupEditor.open(item, columns, isModified);
|
|
956
|
+
}
|
|
957
|
+
this.ref.detectChanges();
|
|
958
|
+
};
|
|
959
|
+
this.onSave = (item) => __awaiter(this, void 0, void 0, function* () {
|
|
960
|
+
const { editor } = this.gridOption;
|
|
961
|
+
try {
|
|
962
|
+
item.editorHandler.saving = true;
|
|
963
|
+
if (editor.validate) {
|
|
964
|
+
const result = editor.validate(item);
|
|
965
|
+
if (result instanceof Promise) {
|
|
966
|
+
const message = yield result;
|
|
967
|
+
if (message) {
|
|
968
|
+
throw message;
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
else {
|
|
972
|
+
if (result) {
|
|
973
|
+
throw result;
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
if (editor.onSave) {
|
|
978
|
+
const result = editor.onSave(item);
|
|
979
|
+
if (result instanceof Promise) {
|
|
980
|
+
yield result;
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
if (item.editingStatus === 'create' && editor.type === 'popup') {
|
|
984
|
+
if (this.gridOption.type === 'local') {
|
|
985
|
+
this.items.splice(0, 0, item);
|
|
986
|
+
}
|
|
987
|
+
this.viewItems.splice(0, 0, item);
|
|
988
|
+
}
|
|
989
|
+
item.editingStatus = undefined;
|
|
990
|
+
this.generateEditorHanlder(item);
|
|
991
|
+
}
|
|
992
|
+
catch (err) {
|
|
993
|
+
this.notifyService.notify.warning(err);
|
|
994
|
+
}
|
|
995
|
+
finally {
|
|
996
|
+
item.editorHandler.saving = false;
|
|
997
|
+
this.ref.detectChanges();
|
|
998
|
+
}
|
|
999
|
+
});
|
|
1000
|
+
this.onCancel = (item) => {
|
|
1001
|
+
const { editor } = this.gridOption;
|
|
1002
|
+
if (editor.type === 'inline') {
|
|
1003
|
+
if (this.gridOption.type === 'local') {
|
|
1004
|
+
const idx1 = this.items.indexOf(item);
|
|
1005
|
+
this.items.splice(idx1, 1);
|
|
1006
|
+
}
|
|
1007
|
+
const idx2 = this.viewItems.indexOf(item);
|
|
1008
|
+
this.viewItems.splice(idx2, 1);
|
|
1009
|
+
return;
|
|
1010
|
+
}
|
|
1011
|
+
if (item.editingStatus === 'create') {
|
|
1012
|
+
if (editor.type !== 'popup') {
|
|
1013
|
+
if (this.gridOption.type === 'local') {
|
|
1014
|
+
this.items.splice(0, 1);
|
|
1015
|
+
}
|
|
1016
|
+
this.viewItems.splice(0, 1);
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
else {
|
|
1020
|
+
Object.assign(item, item.temporary);
|
|
1021
|
+
item.editingStatus = undefined;
|
|
1022
|
+
this.generateEditorHanlder(item);
|
|
1023
|
+
this.ref.detectChanges();
|
|
1024
|
+
}
|
|
1025
|
+
};
|
|
1026
|
+
this.initExternalFilter = () => {
|
|
1027
|
+
var _a, _b;
|
|
1028
|
+
if ((_b = (_a = this.gridOption.filter) === null || _a === void 0 ? void 0 : _a.externalFilters) === null || _b === void 0 ? void 0 : _b.length) {
|
|
1029
|
+
this.gridOption.filter.externalFilters.forEach(externalFilter => {
|
|
1030
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1031
|
+
if (externalFilter.type === 'string') {
|
|
1032
|
+
if (externalFilter.default) {
|
|
1033
|
+
this.externalFilter[externalFilter.field] = (_a = externalFilter.default) !== null && _a !== void 0 ? _a : '';
|
|
1034
|
+
}
|
|
1035
|
+
return;
|
|
1036
|
+
}
|
|
1037
|
+
if (externalFilter.type === 'number') {
|
|
1038
|
+
if (externalFilter.default) {
|
|
1039
|
+
this.externalFilter[externalFilter.field] = (_b = externalFilter.default) !== null && _b !== void 0 ? _b : undefined;
|
|
1040
|
+
}
|
|
1041
|
+
return;
|
|
1042
|
+
}
|
|
1043
|
+
if (externalFilter.type === 'daterange') {
|
|
1044
|
+
this.externalFilter[externalFilter.field] = {
|
|
1045
|
+
from: (_c = externalFilter.defaultFrom) !== null && _c !== void 0 ? _c : undefined,
|
|
1046
|
+
to: (_d = externalFilter.defaultTo) !== null && _d !== void 0 ? _d : undefined
|
|
1047
|
+
};
|
|
1048
|
+
return;
|
|
1049
|
+
}
|
|
1050
|
+
if (externalFilter.type === 'numberrange') {
|
|
1051
|
+
this.externalFilter[externalFilter.field] = {
|
|
1052
|
+
from: (_e = externalFilter.defaultFrom) !== null && _e !== void 0 ? _e : undefined,
|
|
1053
|
+
to: (_f = externalFilter.defaultTo) !== null && _f !== void 0 ? _f : undefined
|
|
1054
|
+
};
|
|
1055
|
+
return;
|
|
1056
|
+
}
|
|
1057
|
+
if (externalFilter.type === 'daterangefull') {
|
|
1058
|
+
this.externalFilter[externalFilter.field] = {
|
|
1059
|
+
from: (_g = externalFilter.defaultFrom) !== null && _g !== void 0 ? _g : undefined,
|
|
1060
|
+
to: (_h = externalFilter.defaultTo) !== null && _h !== void 0 ? _h : undefined
|
|
1061
|
+
};
|
|
1062
|
+
return;
|
|
1063
|
+
}
|
|
1064
|
+
if (externalFilter.type === 'values') { // andn1
|
|
1065
|
+
if (externalFilter.default) {
|
|
1066
|
+
this.externalFilter[externalFilter.field] = (_j = externalFilter.default) !== null && _j !== void 0 ? _j : '';
|
|
1067
|
+
}
|
|
1068
|
+
return;
|
|
1069
|
+
}
|
|
1070
|
+
});
|
|
1071
|
+
}
|
|
1072
|
+
};
|
|
1073
|
+
//#endregion
|
|
1074
|
+
this.onSearch = (searchValue, item, column) => {
|
|
1075
|
+
item[column.field] = searchValue;
|
|
1076
|
+
};
|
|
1077
|
+
this.onFilterConfigurationLoaded = (param) => {
|
|
1078
|
+
var _a, _b;
|
|
1079
|
+
this.quickFilters = param.quickFilters || [];
|
|
1080
|
+
this.selectedQuickFilter = param.selectedQuickFilter || '';
|
|
1081
|
+
if (this.selectedQuickFilter) {
|
|
1082
|
+
const quickFilter = this.quickFilters.find(e => e.code === this.selectedQuickFilter);
|
|
1083
|
+
if (quickFilter) {
|
|
1084
|
+
const f1 = JSON.stringify(quickFilter.filter);
|
|
1085
|
+
const f2 = JSON.stringify(quickFilter.externalFilter);
|
|
1086
|
+
this.filter = JSON.parse(f1);
|
|
1087
|
+
this.externalFilter = this.refreshExternalFilter((_b = (_a = this.gridOption) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.externalFilters, JSON.parse(f2));
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
this.inlineExternal = param.inlineExternal || {};
|
|
1091
|
+
this.inlineColumn = param.inlineColumn || {};
|
|
1092
|
+
this.resize();
|
|
1093
|
+
};
|
|
1094
|
+
this.onSelectQuickFilter = (value) => {
|
|
1095
|
+
var _a, _b, _c;
|
|
1096
|
+
const quickFilter = this.quickFilters.find(e => e.code === value);
|
|
1097
|
+
if (quickFilter === null || quickFilter === void 0 ? void 0 : quickFilter.code) {
|
|
1098
|
+
const f1 = JSON.stringify(quickFilter.filter);
|
|
1099
|
+
const f2 = JSON.stringify(quickFilter.externalFilter);
|
|
1100
|
+
this.selectedQuickFilter = quickFilter === null || quickFilter === void 0 ? void 0 : quickFilter.code;
|
|
1101
|
+
this.filter = JSON.parse(f1);
|
|
1102
|
+
this.externalFilter = this.refreshExternalFilter((_b = (_a = this.gridOption) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.externalFilters, JSON.parse(f2));
|
|
1103
|
+
this.updateFilter();
|
|
1104
|
+
}
|
|
1105
|
+
else {
|
|
1106
|
+
this.selectedQuickFilter = '';
|
|
1107
|
+
this.onClearFilter();
|
|
1108
|
+
}
|
|
1109
|
+
(_c = this.sdGridPopupFilter) === null || _c === void 0 ? void 0 : _c.updateConfiguration(this.selectedQuickFilter);
|
|
1110
|
+
};
|
|
1111
|
+
this.getExportItems = (pageNumber = 1, pageSize = 10000) => __awaiter(this, void 0, void 0, function* () {
|
|
1112
|
+
var _j;
|
|
1113
|
+
if (this.isLoading) {
|
|
1114
|
+
return;
|
|
1115
|
+
}
|
|
1116
|
+
this.isLoading = true;
|
|
1117
|
+
try {
|
|
1118
|
+
if (this.gridOption.type !== 'local') {
|
|
1119
|
+
const handler = this.handler;
|
|
1120
|
+
const filter = handler.mapRequest(this.getFilterInfo(pageNumber, pageSize));
|
|
1121
|
+
if (this.gridOption.method === 'GET') {
|
|
1122
|
+
const queryString = Object.keys(filter).filter(key => filter[key] !== null && filter[key] !== undefined)
|
|
1123
|
+
.map(key => key + '=' + filter[key]).join('&');
|
|
1124
|
+
const url = this.gridOption.url.includes('?') ? `${this.gridOption.url}&${queryString}` : `${this.gridOption.url}?${queryString}`;
|
|
1125
|
+
const response = yield this.apiService.get(url);
|
|
1126
|
+
return handler.mapResponse(response).items;
|
|
1127
|
+
}
|
|
1128
|
+
else {
|
|
1129
|
+
const response = yield this.apiService.post(this.gridOption.url, filter);
|
|
1130
|
+
return handler.mapResponse(response).items;
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
else {
|
|
1134
|
+
let localItems = [];
|
|
1135
|
+
const handler = this.handler;
|
|
1136
|
+
if (typeof (this.gridOption.items) === 'function') {
|
|
1137
|
+
const results = this.gridOption.items();
|
|
1138
|
+
if (results instanceof Promise) {
|
|
1139
|
+
localItems = yield results;
|
|
1140
|
+
}
|
|
1141
|
+
else {
|
|
1142
|
+
localItems = results;
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
else {
|
|
1146
|
+
localItems = this.gridOption.items;
|
|
1147
|
+
}
|
|
1148
|
+
const response = handler.filter(localItems, {
|
|
1149
|
+
customFilter: this.gridOption.filter.customFilter,
|
|
1150
|
+
rawFilter: this.filter,
|
|
1151
|
+
columns: this.gridOption.columns,
|
|
1152
|
+
rawExternalFilter: this.externalFilter,
|
|
1153
|
+
externalFilters: (_j = this.gridOption.filter) === null || _j === void 0 ? void 0 : _j.externalFilters,
|
|
1154
|
+
orderBy: this.orderBy,
|
|
1155
|
+
orderDirection: this.orderDirection,
|
|
1156
|
+
pageNumber,
|
|
1157
|
+
pageSize
|
|
1158
|
+
});
|
|
1159
|
+
return response.items;
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
catch (error) {
|
|
1163
|
+
this.notifyService.handle.error(error);
|
|
1164
|
+
}
|
|
1165
|
+
finally {
|
|
1166
|
+
this.isLoading = false;
|
|
1167
|
+
this.ref.detectChanges();
|
|
1168
|
+
}
|
|
1169
|
+
});
|
|
1170
|
+
this.getFilterInfo = (pageNumber, pageSize) => {
|
|
1171
|
+
var _a;
|
|
1172
|
+
for (const key of Object.keys(this.filter)) {
|
|
1173
|
+
if (typeof (this.filter[key]) === 'string') {
|
|
1174
|
+
this.filter[key] = this.filter[key].trim();
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
for (const key of Object.keys(this.externalFilter)) {
|
|
1178
|
+
if (typeof (this.externalFilter[key]) === 'string') {
|
|
1179
|
+
this.externalFilter[key] = this.externalFilter[key].trim();
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
return {
|
|
1183
|
+
customFilter: this.gridOption.filter.customFilter,
|
|
1184
|
+
rawFilter: this.filter,
|
|
1185
|
+
columns: this.gridOption.columns,
|
|
1186
|
+
rawExternalFilter: this.externalFilter,
|
|
1187
|
+
externalFilters: (_a = this.gridOption.filter) === null || _a === void 0 ? void 0 : _a.externalFilters,
|
|
1188
|
+
orderBy: this.orderBy,
|
|
1189
|
+
orderDirection: this.orderDirection,
|
|
1190
|
+
pageNumber,
|
|
1191
|
+
pageSize
|
|
1192
|
+
};
|
|
1193
|
+
};
|
|
1194
|
+
this.onExportByTemplate = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
1195
|
+
var _k, _l, _m, _o;
|
|
1196
|
+
this.loadingService.start();
|
|
1197
|
+
let exportItems = [];
|
|
1198
|
+
if ((_k = this.gridOption.export) === null || _k === void 0 ? void 0 : _k.items) {
|
|
1199
|
+
exportItems = yield ((_l = this.gridOption.export) === null || _l === void 0 ? void 0 : _l.items(this.getFilterInfo(1, 10000)).finally(this.loadingService.stop));
|
|
1200
|
+
}
|
|
1201
|
+
else {
|
|
1202
|
+
exportItems = yield this.getExportItems().finally(this.loadingService.stop);
|
|
1203
|
+
}
|
|
1204
|
+
if ((_m = this.gridOption.export) === null || _m === void 0 ? void 0 : _m.mapping) {
|
|
1205
|
+
const results = this.gridOption.export.mapping(exportItems, params.excelConfig.name);
|
|
1206
|
+
if (results instanceof Promise) {
|
|
1207
|
+
exportItems = yield results;
|
|
1208
|
+
}
|
|
1209
|
+
else {
|
|
1210
|
+
exportItems = results;
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
const columns = [...this.gridOption.columns, ...(((_o = this.gridOption.export) === null || _o === void 0 ? void 0 : _o.columns) || [])];
|
|
1214
|
+
const items = exportItems.map(item => {
|
|
1215
|
+
const obj = {};
|
|
1216
|
+
const handle = (column) => {
|
|
1217
|
+
if (column.type === 'children') {
|
|
1218
|
+
column.children.forEach(handle);
|
|
1219
|
+
}
|
|
1220
|
+
else if (column.transform) {
|
|
1221
|
+
obj[column.field] = column.transform(item[column.field], item);
|
|
1222
|
+
}
|
|
1223
|
+
else if (item[column.field] === undefined || item[column.field] === null || item[column.field] === '') {
|
|
1224
|
+
obj[column.field] = '';
|
|
1225
|
+
}
|
|
1226
|
+
else if (column.type === 'string' || column.type === 'number' || column.type === 'color') {
|
|
1227
|
+
// Nếu cell là string hoặc number thì gán bằng chính nó
|
|
1228
|
+
obj[column.field] = item[column.field];
|
|
1229
|
+
}
|
|
1230
|
+
else if (column.type === 'bool') {
|
|
1231
|
+
// Nếu là bool thì gán bằng giá trị trueValue và falseValue (nếu có), mặc định là TRUE/FALSE
|
|
1232
|
+
if (item[column.field]) {
|
|
1233
|
+
obj[column.field] = column.trueValue || 'True';
|
|
1234
|
+
}
|
|
1235
|
+
else {
|
|
1236
|
+
obj[column.field] = column.falseValue || 'False';
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
else if (column.type === 'date') {
|
|
1240
|
+
// Nếu là date thì convert theo đúng format
|
|
1241
|
+
const date = new Date(item[column.field]);
|
|
1242
|
+
obj[column.field] = this.datePipe.transform(date, 'dd/MM/yyyy');
|
|
1243
|
+
}
|
|
1244
|
+
else if (column.type === 'datetime') {
|
|
1245
|
+
// Nếu là datetime thì convert theo đúng format
|
|
1246
|
+
const date = new Date(item[column.field]);
|
|
1247
|
+
obj[column.field] = this.datePipe.transform(date, 'dd/MM/yyyy HH:mm:ss');
|
|
1248
|
+
}
|
|
1249
|
+
else if (column.type === 'time') {
|
|
1250
|
+
// Nếu là time thì convert theo đúng format
|
|
1251
|
+
const date = new Date(item[column.field]);
|
|
1252
|
+
obj[column.field] = this.datePipe.transform(date, 'HH:mm:ss');
|
|
1253
|
+
}
|
|
1254
|
+
else if (column.type === 'values') {
|
|
1255
|
+
// Nếu là values thì lấy giá trị của value được chọn
|
|
1256
|
+
const data = column.values.find(e => e.value === item[column.field]);
|
|
1257
|
+
if (data) {
|
|
1258
|
+
obj[column.field] = data.text;
|
|
1259
|
+
}
|
|
1260
|
+
else {
|
|
1261
|
+
obj[column.field] = item[column.field];
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
else if (column.type === 'radio') {
|
|
1265
|
+
const data = column.values.find(e => e[column.valueField] === item[column.field]);
|
|
1266
|
+
if (data) {
|
|
1267
|
+
obj[column.field] = data[column.displayField];
|
|
1268
|
+
}
|
|
1269
|
+
else {
|
|
1270
|
+
obj[column.field] = item[column.field];
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
1273
|
+
};
|
|
1274
|
+
columns.forEach(handle);
|
|
1275
|
+
return obj;
|
|
1276
|
+
});
|
|
1277
|
+
this.excelService.generateExcelDataByTemplate(params.excelConfig.fullPath, params.excelColumns, items, params.excelConfig.name);
|
|
1278
|
+
});
|
|
1279
|
+
this.bigExport = () => __awaiter(this, void 0, void 0, function* () {
|
|
1280
|
+
var _p, _q, _r, _s;
|
|
1281
|
+
const pageSize = 1000;
|
|
1282
|
+
let pageNumber = 1;
|
|
1283
|
+
this.loadingService.start();
|
|
1284
|
+
try {
|
|
1285
|
+
let exportItems = [];
|
|
1286
|
+
let filePath = null;
|
|
1287
|
+
let destination = null;
|
|
1288
|
+
let latestRow = 0;
|
|
1289
|
+
while (true) {
|
|
1290
|
+
if ((_p = this.gridOption.export) === null || _p === void 0 ? void 0 : _p.items) {
|
|
1291
|
+
exportItems = yield ((_q = this.gridOption.export) === null || _q === void 0 ? void 0 : _q.items(this.getFilterInfo(pageNumber, pageSize)).finally(this.loadingService.stop));
|
|
1292
|
+
}
|
|
1293
|
+
else {
|
|
1294
|
+
exportItems = yield this.getExportItems(pageNumber, pageSize).finally(this.loadingService.stop);
|
|
1295
|
+
}
|
|
1296
|
+
if ((_r = this.gridOption.export) === null || _r === void 0 ? void 0 : _r.mapping) {
|
|
1297
|
+
const results = this.gridOption.export.mapping(exportItems);
|
|
1298
|
+
if (results instanceof Promise) {
|
|
1299
|
+
exportItems = yield results;
|
|
1300
|
+
}
|
|
1301
|
+
else {
|
|
1302
|
+
exportItems = results;
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
const columns = [...this.gridOption.columns, ...(((_s = this.gridOption.export) === null || _s === void 0 ? void 0 : _s.columns) || [])];
|
|
1306
|
+
const items = exportItems.map(item => {
|
|
1307
|
+
const obj = {};
|
|
1308
|
+
const handle = (column) => {
|
|
1309
|
+
if (column.type === 'children') {
|
|
1310
|
+
column.children.forEach(handle);
|
|
1311
|
+
}
|
|
1312
|
+
else if (column.transform) {
|
|
1313
|
+
obj[column.field] = column.transform(item[column.field], item);
|
|
1314
|
+
}
|
|
1315
|
+
else if (item[column.field] === undefined || item[column.field] === null || item[column.field] === '') {
|
|
1316
|
+
obj[column.field] = '';
|
|
1317
|
+
}
|
|
1318
|
+
else if (column.type === 'string' || column.type === 'number' || column.type === 'color') {
|
|
1319
|
+
// Nếu cell là string hoặc number thì gán bằng chính nó
|
|
1320
|
+
obj[column.field] = item[column.field];
|
|
1321
|
+
}
|
|
1322
|
+
else if (column.type === 'bool') {
|
|
1323
|
+
// Nếu là bool thì gán bằng giá trị trueValue và falseValue (nếu có), mặc định là TRUE/FALSE
|
|
1324
|
+
if (item[column.field]) {
|
|
1325
|
+
obj[column.field] = column.trueValue || 'True';
|
|
1326
|
+
}
|
|
1327
|
+
else {
|
|
1328
|
+
obj[column.field] = column.falseValue || 'False';
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
else if (column.type === 'date') {
|
|
1332
|
+
// Nếu là date thì convert theo đúng format
|
|
1333
|
+
const date = new Date(item[column.field]);
|
|
1334
|
+
obj[column.field] = this.datePipe.transform(date, 'dd/MM/yyyy');
|
|
1335
|
+
}
|
|
1336
|
+
else if (column.type === 'datetime') {
|
|
1337
|
+
// Nếu là datetime thì convert theo đúng format
|
|
1338
|
+
const date = new Date(item[column.field]);
|
|
1339
|
+
obj[column.field] = this.datePipe.transform(date, 'dd/MM/yyyy HH:mm:ss');
|
|
1340
|
+
}
|
|
1341
|
+
else if (column.type === 'time') {
|
|
1342
|
+
// Nếu là time thì convert theo đúng format
|
|
1343
|
+
const date = new Date(item[column.field]);
|
|
1344
|
+
obj[column.field] = this.datePipe.transform(date, 'HH:mm:ss');
|
|
1345
|
+
}
|
|
1346
|
+
else if (column.type === 'values') {
|
|
1347
|
+
// Nếu là values thì lấy giá trị của value được chọn
|
|
1348
|
+
const data = column.values.find(e => e.value === item[column.field]);
|
|
1349
|
+
if (data) {
|
|
1350
|
+
obj[column.field] = data.text;
|
|
1351
|
+
}
|
|
1352
|
+
else {
|
|
1353
|
+
obj[column.field] = item[column.field];
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
else if (column.type === 'radio') {
|
|
1357
|
+
const data = column.values.find(e => e[column.valueField] === item[column.field]);
|
|
1358
|
+
if (data) {
|
|
1359
|
+
obj[column.field] = data[column.displayField];
|
|
1360
|
+
}
|
|
1361
|
+
else {
|
|
1362
|
+
obj[column.field] = item[column.field];
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
};
|
|
1366
|
+
columns.forEach(handle);
|
|
1367
|
+
return obj;
|
|
1368
|
+
});
|
|
1369
|
+
const result = yield this.excelService.bigExport({
|
|
1370
|
+
columns,
|
|
1371
|
+
items,
|
|
1372
|
+
latestRow,
|
|
1373
|
+
filePath,
|
|
1374
|
+
destination
|
|
1375
|
+
});
|
|
1376
|
+
latestRow = result.latestRow;
|
|
1377
|
+
filePath = result.filePath;
|
|
1378
|
+
destination = result.destination;
|
|
1379
|
+
if ((pageNumber - 1) * pageSize + items.length >= this.total) {
|
|
1380
|
+
yield this.excelService.download(filePath);
|
|
1381
|
+
break;
|
|
1382
|
+
}
|
|
1383
|
+
pageNumber++;
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
finally {
|
|
1387
|
+
this.loadingService.stop();
|
|
1388
|
+
}
|
|
1389
|
+
});
|
|
1390
|
+
this.onEditorChange = () => {
|
|
1391
|
+
this.ref.detectChanges();
|
|
1392
|
+
};
|
|
1393
|
+
this.onSelectPageSize = () => {
|
|
1394
|
+
this.reload();
|
|
1395
|
+
};
|
|
1396
|
+
this.refreshExternalFilter = (externalFilters, externalFilter) => {
|
|
1397
|
+
externalFilter = externalFilter || {};
|
|
1398
|
+
externalFilters = externalFilters || [];
|
|
1399
|
+
externalFilters.forEach(e => {
|
|
1400
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
1401
|
+
if (e.type === 'string') {
|
|
1402
|
+
externalFilter[e.field] = (_b = (_a = externalFilter[e.field]) !== null && _a !== void 0 ? _a : e.default) !== null && _b !== void 0 ? _b : '';
|
|
1403
|
+
return;
|
|
1404
|
+
}
|
|
1405
|
+
if (e.type === 'number') {
|
|
1406
|
+
externalFilter[e.field] = (_d = (_c = externalFilter[e.field]) !== null && _c !== void 0 ? _c : e.default) !== null && _d !== void 0 ? _d : undefined;
|
|
1407
|
+
return;
|
|
1408
|
+
}
|
|
1409
|
+
if (e.type === 'daterange') {
|
|
1410
|
+
externalFilter[e.field] = {
|
|
1411
|
+
from: (_g = (_f = (_e = externalFilter[e.field]) === null || _e === void 0 ? void 0 : _e.from) !== null && _f !== void 0 ? _f : e.defaultFrom) !== null && _g !== void 0 ? _g : undefined,
|
|
1412
|
+
to: (_k = (_j = (_h = externalFilter[e.field]) === null || _h === void 0 ? void 0 : _h.to) !== null && _j !== void 0 ? _j : e.defaultTo) !== null && _k !== void 0 ? _k : undefined
|
|
1413
|
+
};
|
|
1414
|
+
return;
|
|
1415
|
+
}
|
|
1416
|
+
if (e.type === 'numberrange') {
|
|
1417
|
+
externalFilter[e.field] = {
|
|
1418
|
+
from: (_o = (_m = (_l = externalFilter[e.field]) === null || _l === void 0 ? void 0 : _l.from) !== null && _m !== void 0 ? _m : e.defaultFrom) !== null && _o !== void 0 ? _o : undefined,
|
|
1419
|
+
to: (_r = (_q = (_p = externalFilter[e.field]) === null || _p === void 0 ? void 0 : _p.to) !== null && _q !== void 0 ? _q : e.defaultTo) !== null && _r !== void 0 ? _r : undefined
|
|
1420
|
+
};
|
|
1421
|
+
return;
|
|
1422
|
+
}
|
|
1423
|
+
if (e.type === 'daterangefull') {
|
|
1424
|
+
externalFilter[e.field] = {
|
|
1425
|
+
from: (_u = (_t = (_s = externalFilter[e.field]) === null || _s === void 0 ? void 0 : _s.from) !== null && _t !== void 0 ? _t : e.defaultFrom) !== null && _u !== void 0 ? _u : undefined,
|
|
1426
|
+
to: (_x = (_w = (_v = externalFilter[e.field]) === null || _v === void 0 ? void 0 : _v.to) !== null && _w !== void 0 ? _w : e.defaultTo) !== null && _x !== void 0 ? _x : undefined
|
|
1427
|
+
};
|
|
1428
|
+
return;
|
|
1429
|
+
}
|
|
1430
|
+
if (e.type === 'values') { // andn1
|
|
1431
|
+
externalFilter[e.field] = (_y = (externalFilter[e.field] || e.default)) !== null && _y !== void 0 ? _y : '';
|
|
1432
|
+
return;
|
|
1433
|
+
}
|
|
1434
|
+
});
|
|
1435
|
+
return externalFilter;
|
|
1436
|
+
};
|
|
1437
|
+
this.onCreateQuickFilter = (ev) => {
|
|
1438
|
+
var _a, _b, _c;
|
|
1439
|
+
(_a = this.matSelect) === null || _a === void 0 ? void 0 : _a.close();
|
|
1440
|
+
this.onFilterPopup();
|
|
1441
|
+
(_b = this.sdGridPopupFilter) === null || _b === void 0 ? void 0 : _b.close();
|
|
1442
|
+
(_c = this.sdGridPopupFilter) === null || _c === void 0 ? void 0 : _c.onCreateQuickFilter(ev);
|
|
1443
|
+
};
|
|
1444
|
+
this.onEditQuickFilter = (ev, quickFilter) => {
|
|
1445
|
+
var _a, _b, _c;
|
|
1446
|
+
(_a = this.matSelect) === null || _a === void 0 ? void 0 : _a.close();
|
|
1447
|
+
this.onFilterPopup();
|
|
1448
|
+
(_b = this.sdGridPopupFilter) === null || _b === void 0 ? void 0 : _b.close();
|
|
1449
|
+
(_c = this.sdGridPopupFilter) === null || _c === void 0 ? void 0 : _c.onEditQuickFilter(ev, quickFilter);
|
|
1450
|
+
};
|
|
1451
|
+
this.onDeleteQuickFilter = (ev, quickFilter) => {
|
|
1452
|
+
var _a, _b, _c;
|
|
1453
|
+
(_a = this.matSelect) === null || _a === void 0 ? void 0 : _a.close();
|
|
1454
|
+
this.onFilterPopup();
|
|
1455
|
+
(_b = this.sdGridPopupFilter) === null || _b === void 0 ? void 0 : _b.close();
|
|
1456
|
+
(_c = this.sdGridPopupFilter) === null || _c === void 0 ? void 0 : _c.onDeleteQuickFilter(ev, quickFilter);
|
|
1457
|
+
};
|
|
1458
|
+
this.isMobileOrTablet = !deviceService.isDesktop();
|
|
1459
|
+
// this.ref.detach();
|
|
1460
|
+
// setInterval(() => {
|
|
1461
|
+
// this.ref.markForCheck();
|
|
1462
|
+
// }, 1000);
|
|
1463
|
+
// ref.detach();
|
|
1464
|
+
}
|
|
1465
|
+
set paginator(paginator) {
|
|
1466
|
+
if (paginator && __classPrivateFieldGet(this, _paginator) !== paginator) {
|
|
1467
|
+
__classPrivateFieldSet(this, _paginator, paginator);
|
|
1468
|
+
__classPrivateFieldGet(this, _subscription).add(paginator.page.subscribe(this.selectPage));
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
set option(value) {
|
|
1472
|
+
this.setOption(value);
|
|
1473
|
+
}
|
|
1474
|
+
ngAfterViewInit() {
|
|
1475
|
+
__classPrivateFieldGet(this, _subscription).add(this.fixedHeaders.changes.pipe(startWith([])).subscribe(() => {
|
|
1476
|
+
setTimeout(() => {
|
|
1477
|
+
const fixedHeaders = this.fixedHeaders.toArray();
|
|
1478
|
+
if (fixedHeaders.length > 0) {
|
|
1479
|
+
let left = $(fixedHeaders[0].nativeElement).outerWidth(true);
|
|
1480
|
+
for (let i = 1; i < fixedHeaders.length; i++) {
|
|
1481
|
+
$(fixedHeaders[i].nativeElement).css({ left });
|
|
1482
|
+
left += $(fixedHeaders[i].nativeElement).outerWidth(true);
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
}, 100);
|
|
1486
|
+
}));
|
|
1487
|
+
__classPrivateFieldGet(this, _subscription).add(merge(this.fixedBodies.changes, this.cellFooterDefs.changes).pipe(startWith({})).subscribe(() => {
|
|
1488
|
+
setTimeout(() => {
|
|
1489
|
+
const fixedBodies = this.fixedBodies.toArray();
|
|
1490
|
+
if (fixedBodies.length > 0) {
|
|
1491
|
+
const fixedPerRow = this.fixedBodies.length / (this.viewItems.length + __classPrivateFieldGet(this, _numberOfFooterRows));
|
|
1492
|
+
let left = $(fixedBodies[0].nativeElement).outerWidth(true);
|
|
1493
|
+
for (let i = 1; i < fixedBodies.length; i++) {
|
|
1494
|
+
if (i % fixedPerRow === 0) {
|
|
1495
|
+
left = 0;
|
|
1496
|
+
}
|
|
1497
|
+
$(fixedBodies[i].nativeElement).css({ left });
|
|
1498
|
+
left += $(fixedBodies[i].nativeElement).outerWidth(true);
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
const fixedHeaders = this.fixedHeaders.toArray();
|
|
1502
|
+
if (fixedHeaders.length > 0) {
|
|
1503
|
+
let left = $(fixedHeaders[0].nativeElement).outerWidth(true);
|
|
1504
|
+
for (let i = 1; i < fixedHeaders.length; i++) {
|
|
1505
|
+
$(fixedHeaders[i].nativeElement).css({ left });
|
|
1506
|
+
left += $(fixedHeaders[i].nativeElement).outerWidth(true);
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
}, 100);
|
|
1510
|
+
}));
|
|
1511
|
+
__classPrivateFieldGet(this, _subscription).add(this.cellDefs.changes.pipe(startWith([])).subscribe(() => {
|
|
1512
|
+
this.cellDef = {};
|
|
1513
|
+
for (const cellDef of this.cellDefs) {
|
|
1514
|
+
if (cellDef.sdCellDef) {
|
|
1515
|
+
this.cellDef[cellDef.sdCellDef] = cellDef;
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
}));
|
|
1519
|
+
__classPrivateFieldGet(this, _subscription).add(this.cellEditorDefs.changes.pipe(startWith([])).subscribe(() => {
|
|
1520
|
+
this.cellEditorDef = {};
|
|
1521
|
+
for (const cellEditorDef of this.cellEditorDefs) {
|
|
1522
|
+
if (cellEditorDef.sdCellEditorDef) {
|
|
1523
|
+
this.cellEditorDef[cellEditorDef.sdCellEditorDef] = cellEditorDef;
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
}));
|
|
1527
|
+
__classPrivateFieldGet(this, _subscription).add(this.cellFooterDefs.changes.pipe(startWith([])).subscribe(() => {
|
|
1528
|
+
this.cellFooterDef = {};
|
|
1529
|
+
__classPrivateFieldSet(this, _numberOfFooterRows, 0);
|
|
1530
|
+
for (const cellFooterDef of this.cellFooterDefs) {
|
|
1531
|
+
if (cellFooterDef.sdCellFooterDef) {
|
|
1532
|
+
if (!this.cellFooterDef[cellFooterDef.sdCellFooterDef]) {
|
|
1533
|
+
this.cellFooterDef[cellFooterDef.sdCellFooterDef] = [];
|
|
1534
|
+
}
|
|
1535
|
+
this.cellFooterDef[cellFooterDef.sdCellFooterDef].push(cellFooterDef);
|
|
1536
|
+
if (this.cellFooterDef[cellFooterDef.sdCellFooterDef].length > __classPrivateFieldGet(this, _numberOfFooterRows)) {
|
|
1537
|
+
__classPrivateFieldSet(this, _numberOfFooterRows, this.cellFooterDef[cellFooterDef.sdCellFooterDef].length);
|
|
1538
|
+
}
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
this.footerRows = Array(__classPrivateFieldGet(this, _numberOfFooterRows)).fill(0).map((v, i) => i);
|
|
1542
|
+
}));
|
|
1543
|
+
}
|
|
1544
|
+
ngOnDestroy() {
|
|
1545
|
+
__classPrivateFieldGet(this, _subscription).unsubscribe();
|
|
1546
|
+
}
|
|
1547
|
+
reloadItem(data) {
|
|
1548
|
+
Object.keys(data).forEach(id => {
|
|
1549
|
+
const item = this.items.find(e => !!e.id && e.id === id);
|
|
1550
|
+
if (item) {
|
|
1551
|
+
this.gridOption.columns.forEach(column => {
|
|
1552
|
+
if (item[column.field] !== undefined && data[id][column.field] !== undefined && item[column.field] !== data[id][column.field]) {
|
|
1553
|
+
this.blink(item, column.field);
|
|
1554
|
+
}
|
|
1555
|
+
});
|
|
1556
|
+
Object.assign(item, data[id]);
|
|
1557
|
+
this.generateEditorHanlder(item);
|
|
1558
|
+
this.stopBlink();
|
|
1559
|
+
}
|
|
1560
|
+
});
|
|
1561
|
+
}
|
|
1562
|
+
blink(item, field) {
|
|
1563
|
+
item.blinker = item.blinker || {};
|
|
1564
|
+
item.blinker[field] = true;
|
|
1565
|
+
}
|
|
1566
|
+
stopBlink() {
|
|
1567
|
+
setTimeout(() => {
|
|
1568
|
+
this.viewItems.forEach(item => {
|
|
1569
|
+
item.blinker = {};
|
|
1570
|
+
});
|
|
1571
|
+
}, 1500);
|
|
1572
|
+
}
|
|
1573
|
+
generateViewItems() {
|
|
1574
|
+
var _a, _b;
|
|
1575
|
+
const currentPage = (((_a = __classPrivateFieldGet(this, _paginator)) === null || _a === void 0 ? void 0 : _a.pageIndex) || 0) + 1;
|
|
1576
|
+
const pageSize = ((_b = __classPrivateFieldGet(this, _paginator)) === null || _b === void 0 ? void 0 : _b.pageSize) || 50;
|
|
1577
|
+
delete this.viewItems;
|
|
1578
|
+
if (this.gridOption.type === 'local') {
|
|
1579
|
+
this.viewItems = this.items.filter((item, index) => {
|
|
1580
|
+
return index >= (currentPage - 1) * pageSize
|
|
1581
|
+
&& index < currentPage * pageSize;
|
|
1582
|
+
});
|
|
1583
|
+
}
|
|
1584
|
+
else {
|
|
1585
|
+
this.viewItems = this.items;
|
|
1586
|
+
}
|
|
1587
|
+
this.viewItems.forEach(item => {
|
|
1588
|
+
item.blinker = item.blinker || {};
|
|
1589
|
+
item.subInformation = item.subInformation || {};
|
|
1590
|
+
});
|
|
1591
|
+
}
|
|
1592
|
+
get editedItems() {
|
|
1593
|
+
return this.items.filter(item => {
|
|
1594
|
+
if (!item.originItem) {
|
|
1595
|
+
return true;
|
|
1596
|
+
}
|
|
1597
|
+
if (Object.keys(item.originItem).some(key => item.originItem[key] !== item[key])) {
|
|
1598
|
+
return true;
|
|
1599
|
+
}
|
|
1600
|
+
return false;
|
|
1601
|
+
}).map(item => {
|
|
1602
|
+
const { temporary, originItem, editorHandler, editingStatus, isChecked, subInformation, blinker } = item, result = __rest(item, ["temporary", "originItem", "editorHandler", "editingStatus", "isChecked", "subInformation", "blinker"]);
|
|
1603
|
+
return result;
|
|
1604
|
+
});
|
|
1605
|
+
}
|
|
1606
|
+
getItems() {
|
|
1607
|
+
return this.items;
|
|
1608
|
+
}
|
|
1609
|
+
checkAll(isCheckedAll) {
|
|
1610
|
+
this.isCheckedAll = isCheckedAll;
|
|
1611
|
+
this.items.forEach(item => item.isChecked = this.isCheckedAll);
|
|
1612
|
+
if (this.gridOption.onCheck) {
|
|
1613
|
+
this.gridOption.onCheck(this.items.filter(item => item.isChecked));
|
|
1614
|
+
}
|
|
1615
|
+
__classPrivateFieldGet(this, _setSelectedItems).call(this);
|
|
1616
|
+
}
|
|
1617
|
+
//#endregion
|
|
1618
|
+
// #region Resize Grid
|
|
1619
|
+
resize() {
|
|
1620
|
+
this.detectChanges();
|
|
1621
|
+
if (this.gridOption.height) {
|
|
1622
|
+
this.gridBody.nativeElement.style.height = this.gridOption.height;
|
|
1623
|
+
}
|
|
1624
|
+
else {
|
|
1625
|
+
this.gridBody.nativeElement.style.height = `${window.innerHeight - 300}px`;
|
|
1626
|
+
setTimeout(() => {
|
|
1627
|
+
// Lấy offset top để điều chỉnh kích thước Grid vừa với màn hình
|
|
1628
|
+
const top = this.gridBody.nativeElement.getBoundingClientRect().top;
|
|
1629
|
+
// const top = $(this.gridBody.nativeElement).offset().top;
|
|
1630
|
+
const bottom = this.gridOption.hideFooter ? 0 : (this.isMobileOrTablet ? 45 : 55);
|
|
1631
|
+
const height = window.innerHeight - top - bottom;
|
|
1632
|
+
this.gridBody.nativeElement.style.height = `${height}px`;
|
|
1633
|
+
}, 0);
|
|
1634
|
+
setTimeout(() => {
|
|
1635
|
+
// Lấy offset top để điều chỉnh kích thước Grid vừa với màn hình
|
|
1636
|
+
const top = this.gridBody.nativeElement.getBoundingClientRect().top;
|
|
1637
|
+
// const top = $(this.gridBody.nativeElement).offset().top;
|
|
1638
|
+
const bottom = this.gridOption.hideFooter ? 0 : (this.isMobileOrTablet ? 45 : 55);
|
|
1639
|
+
const height = window.innerHeight - top - bottom;
|
|
1640
|
+
this.gridBody.nativeElement.style.height = `${height}px`;
|
|
1641
|
+
}, 200);
|
|
1642
|
+
setTimeout(() => {
|
|
1643
|
+
// Lấy offset top để điều chỉnh kích thước Grid vừa với màn hình
|
|
1644
|
+
const top = this.gridBody.nativeElement.getBoundingClientRect().top;
|
|
1645
|
+
// const top = $(this.gridBody.nativeElement).offset().top;
|
|
1646
|
+
const bottom = this.gridOption.hideFooter ? 0 : (this.isMobileOrTablet ? 45 : 55);
|
|
1647
|
+
const height = window.innerHeight - top - bottom;
|
|
1648
|
+
this.gridBody.nativeElement.style.height = `${height}px`;
|
|
1649
|
+
}, 500);
|
|
1650
|
+
setTimeout(() => {
|
|
1651
|
+
// Lấy offset top để điều chỉnh kích thước Grid vừa với màn hình
|
|
1652
|
+
const top = this.gridBody.nativeElement.getBoundingClientRect().top;
|
|
1653
|
+
// const top = $(this.gridBody.nativeElement).offset().top;
|
|
1654
|
+
const bottom = this.gridOption.hideFooter ? 0 : (this.isMobileOrTablet ? 45 : 55);
|
|
1655
|
+
const height = window.innerHeight - top - bottom;
|
|
1656
|
+
this.gridBody.nativeElement.style.height = `${height}px`;
|
|
1657
|
+
}, 1000);
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
setHeight(height) {
|
|
1661
|
+
this.gridOption.height = height;
|
|
1662
|
+
this.resize();
|
|
1663
|
+
}
|
|
1664
|
+
// #endregion
|
|
1665
|
+
//#region Import, Export, Config
|
|
1666
|
+
loadConfig(configResult) {
|
|
1667
|
+
this.gridOption.paginate.pageSize = configResult.pageSize;
|
|
1668
|
+
this.gridOption.columns = configResult.columns;
|
|
1669
|
+
this.fixedColumns = configResult.fixedColumns;
|
|
1670
|
+
this.normalColumns = configResult.normalColumns;
|
|
1671
|
+
this.columns = [...this.fixedColumns, ...this.normalColumns];
|
|
1672
|
+
this.initFilter();
|
|
1673
|
+
this.initDictionaryColumnValues();
|
|
1674
|
+
this.reload();
|
|
1675
|
+
}
|
|
1676
|
+
initFilter() {
|
|
1677
|
+
this.gridOption.columns.forEach(column => {
|
|
1678
|
+
var _a;
|
|
1679
|
+
// Gán giá trị filter mặc định cho từng cột
|
|
1680
|
+
this.filter[column.field] = (_a = this.filter[column.field]) !== null && _a !== void 0 ? _a : '';
|
|
1681
|
+
});
|
|
1682
|
+
}
|
|
1683
|
+
initDictionaryColumnValues() {
|
|
1684
|
+
this.gridOption.columns.forEach(column => {
|
|
1685
|
+
if (column.type === 'values') {
|
|
1686
|
+
column.dictionary = {};
|
|
1687
|
+
if (column.values) {
|
|
1688
|
+
column.values.forEach(e => {
|
|
1689
|
+
column.dictionary[e.value.toString()] = {
|
|
1690
|
+
text: e.text,
|
|
1691
|
+
icon: e.icon,
|
|
1692
|
+
color: e.color,
|
|
1693
|
+
backgroundColor: e.backgroundColor
|
|
1694
|
+
};
|
|
1695
|
+
});
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
if (column.type === 'children') {
|
|
1699
|
+
column.children.forEach(childColumn => {
|
|
1700
|
+
if (childColumn.type === 'values') {
|
|
1701
|
+
childColumn.dictionary = {};
|
|
1702
|
+
if (childColumn.values) {
|
|
1703
|
+
childColumn.values.forEach(e => {
|
|
1704
|
+
childColumn.dictionary[e.value.toString()] = {
|
|
1705
|
+
text: e.text,
|
|
1706
|
+
icon: e.icon,
|
|
1707
|
+
color: e.color,
|
|
1708
|
+
backgroundColor: e.backgroundColor
|
|
1709
|
+
};
|
|
1710
|
+
});
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
});
|
|
1714
|
+
}
|
|
1715
|
+
});
|
|
1716
|
+
}
|
|
1717
|
+
//#endregion
|
|
1718
|
+
generateEditorHandlers() {
|
|
1719
|
+
this.viewItems.forEach(item => {
|
|
1720
|
+
this.generateEditorHanlder(item);
|
|
1721
|
+
});
|
|
1722
|
+
}
|
|
1723
|
+
generateEditorHanlder(item) {
|
|
1724
|
+
// item.editorHandler = item.editorHandler || {};
|
|
1725
|
+
this.editorVisiblePipe.transform(null, item, this.gridOption);
|
|
1726
|
+
}
|
|
1727
|
+
trackById(index, item) {
|
|
1728
|
+
return item.id;
|
|
1729
|
+
}
|
|
1730
|
+
get isFiltering() {
|
|
1731
|
+
return Object.values(this.filter).some(value => !!value);
|
|
1732
|
+
}
|
|
1733
|
+
onFilterPopup() {
|
|
1734
|
+
var _a;
|
|
1735
|
+
const f1 = JSON.stringify(this.filter);
|
|
1736
|
+
const f2 = JSON.stringify(this.externalFilter);
|
|
1737
|
+
const filter = JSON.parse(f1);
|
|
1738
|
+
const externalFilter = JSON.parse(f2);
|
|
1739
|
+
this.sdGridPopupFilter.open(this.fixedColumns, this.normalColumns, filter, externalFilter, (_a = this.gridOption.filter) === null || _a === void 0 ? void 0 : _a.externalFilters);
|
|
1740
|
+
}
|
|
1741
|
+
get invalidItems() {
|
|
1742
|
+
return this.items.filter(e => { var _a; return (_a = e.editorHandler) === null || _a === void 0 ? void 0 : _a.errorMessage; }).map(e => {
|
|
1743
|
+
const { temporary, originItem, editorHandler, editingStatus, isChecked, subInformation, blinker } = e, item = __rest(e, ["temporary", "originItem", "editorHandler", "editingStatus", "isChecked", "subInformation", "blinker"]);
|
|
1744
|
+
return {
|
|
1745
|
+
item,
|
|
1746
|
+
message: e.editorHandler.errorMessage
|
|
1747
|
+
};
|
|
1748
|
+
});
|
|
1749
|
+
}
|
|
1750
|
+
get gridItems() {
|
|
1751
|
+
return this.items.map(e => {
|
|
1752
|
+
const { temporary, originItem, editorHandler, editingStatus, isChecked, subInformation, blinker } = e, item = __rest(e, ["temporary", "originItem", "editorHandler", "editingStatus", "isChecked", "subInformation", "blinker"]);
|
|
1753
|
+
return item;
|
|
1754
|
+
});
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
_numberOfFooterRows = new WeakMap(), _paginator = new WeakMap(), _subscription = new WeakMap(), _setSelectedItems = new WeakMap();
|
|
1758
|
+
SdGrid.decorators = [
|
|
1759
|
+
{ type: Component, args: [{
|
|
1760
|
+
selector: 'sd-grid',
|
|
1761
|
+
template: "<div class=\"clearfix\"></div>\r\n<ng-container *ngIf=\"!isMobileOrTablet && !gridOption?.filter?.disabled\">\r\n <div class=\"row mx-0 mt-5\">\r\n <div\r\n *ngIf=\"gridOption?.key && gridOption?.filter?.multiple !== false && (!gridOption?.filter?.quickFilterVisibility || gridOption?.filter?.quickFilterVisibility === 'inline')\"\r\n class=\"col-lg-2 col-md-3 col-sm-6 px-4\">\r\n <mat-form-field class=\"sd-md\" appearance=\"outline\" style=\"width: 100%;\">\r\n <mat-label>{{'Quick filters' | sdTranslate}}</mat-label>\r\n <mat-select [(ngModel)]=\"selectedQuickFilter\" (selectionChange)=\"onSelectQuickFilter($event?.value)\" #matSelect>\r\n <mat-option value=\"\">{{'Please select' | sdTranslate}}</mat-option>\r\n <mat-option *ngFor=\"let quickFilter of quickFilters\" [value]=\"quickFilter.code\">\r\n <div style=\"display:flex; justify-content: space-between\">\r\n <span>{{quickFilter.code}}</span>\r\n <div>\r\n <mat-icon class=\"mr-1 c-fa-icon\" (click)=\"onEditQuickFilter($event, quickFilter)\" fontSet=\"fa\"\r\n fontIcon=\"fa-pencil\"></mat-icon>\r\n <mat-icon class=\"mr-0 c-fa-icon\" (click)=\"onDeleteQuickFilter($event, quickFilter)\" fontSet=\"fa\"\r\n fontIcon=\"fa-trash-o\"></mat-icon>\r\n </div>\r\n </div>\r\n </mat-option>\r\n <mat-option>\r\n <div (click)=\"onCreateQuickFilter($event)\">\r\n <mat-icon class=\"mr-1\" fontSet=\"material-icons-outlined\">add</mat-icon>\r\n <span>{{'Create quick filter' | sdTranslate}}</span>\r\n </div>\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n <sd-grid-desktop-inline-filter class=\"c-display-contents\" [columns]=\"gridOption.columns\" [filter]=\"filter\"\r\n [externalFilter]=\"externalFilter\" (sdChange)=\"updateFilter()\" [inlineExternal]=\"inlineExternal\"\r\n [inlineColumn]=\"inlineColumn\" [filterOption]=\"gridOption.filter\">\r\n </sd-grid-desktop-inline-filter>\r\n </div>\r\n</ng-container>\r\n<div *ngIf=\"!isMobileOrTablet; else elseMobileOrTablet\" class=\"sd-box\"\r\n [ngClass]=\"{'box-shadow-none': gridOption.hideFooter}\">\r\n <ng-container *ngTemplateOutlet=\"gridViewContent\"></ng-container>\r\n <div [ngClass]=\"{'d-none': gridOption.hideFooter}\" class=\"sd-box-footer clearfix\">\r\n <div style=\"display: flex; align-items: center; align-content: space-between;\">\r\n <div style=\"flex: 1;\">\r\n <sd-button *ngIf=\"sdGridPopupFilter\" class=\"mr-6\" [title]=\"'Filter' | sdTranslate\" icon=\"filter_list\" size=\"sm\"\r\n (action)=\"onFilterPopup()\"></sd-button>\r\n <sd-button *ngIf=\"!gridOption?.hideReload\" class=\"mr-6\" [title]=\"'Reload' | sdTranslate\" icon=\"refresh\"\r\n size=\"sm\" (action)=\"reload()\"></sd-button>\r\n <sd-button *ngIf=\"gridOption.onImportExcel\" class=\"mr-6\" [title]=\"'Import' | sdTranslate\" icon=\"publish\"\r\n size=\"sm\" (action)=\"sdGridImportExcel.open()\"></sd-button>\r\n <ng-container *ngIf=\"sdGridPopupExportExcel\">\r\n <sd-button *ngIf=\"!gridOption.key\" class=\"mr-6\" [title]=\"'Export' | sdTranslate\" icon=\"get_app\" size=\"sm\"\r\n (action)=\"sdGridPopupExportExcel.exportDefault()\" [disabled]=\"!viewItems?.length\">\r\n </sd-button>\r\n <sd-button *ngIf=\"gridOption.key\" class=\"mr-6\" [title]=\"'Export' | sdTranslate\" icon=\"get_app\" size=\"sm\"\r\n [matMenuTriggerFor]=\"menu\" [disabled]=\"!viewItems?.length\">\r\n </sd-button>\r\n <mat-menu #menu=\"matMenu\">\r\n <button mat-menu-item (click)=\"sdGridPopupExportExcel.exportDefault()\" type=\"button\">\r\n <mat-icon>get_app</mat-icon>\r\n <span> {{'Export all columns' | sdTranslate}}</span>\r\n </button>\r\n <button mat-menu-item (click)=\"sdGridPopupExportExcel.open()\" type=\"button\">\r\n <mat-icon>settings</mat-icon>\r\n <span> {{'Configure' | sdTranslate}}</span>\r\n </button>\r\n </mat-menu>\r\n </ng-container>\r\n <sd-button *ngIf=\"gridOption.export?.bigExport\" class=\"mr-6\" [title]=\"'Big export' | sdTranslate\" icon=\"get_app\"\r\n size=\"sm\" (action)=\"bigExport()\" [disabled]=\"!viewItems?.length\">\r\n </sd-button>\r\n <sd-button *ngIf=\"gridOption.key\" class=\"mr-6\" [title]=\"'Configure' | sdTranslate\" icon=\"settings\" size=\"sm\"\r\n (action)=\"sdGridConfig.open()\"></sd-button>\r\n </div>\r\n <div style=\"flex: 1;\">\r\n <mat-paginator [length]=\"total\" [pageSize]=\"gridOption.paginate?.pageSize\" hidePageSize>\r\n </mat-paginator>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n<ng-template #elseMobileOrTablet>\r\n <div class=\"sd-box c-mobile-box\">\r\n <div *ngIf=\"!gridOption?.mobileOrTablet?.useGridView\" class=\"sd-box-body c-mobile-body\"\r\n [ngClass]=\"{'c-loading': isLoading}\" #gridBody>\r\n <i [ngClass]=\"{'d-none': !isLoading}\" class=\"fa fa-4x fa-spinner fa-pulse c-loading-icon\"></i>\r\n <ng-container *ngFor=\"let item of viewItems\">\r\n <div class=\"c-mobile-item\" [ngClass]=\"{'c-mobile-item-selected':item.isChecked}\">\r\n <sd-grid-mobile-item-view [gridOption]=\"gridOption\" [item]=\"item\" (check)=\"onCheck(item)\">\r\n </sd-grid-mobile-item-view>\r\n <div class=\"p-2\" *ngIf=\"gridOption?.subInformation && item?.subInformation?.isOpened\">\r\n <sd-grid-sub-information [subItems]=\"item?.subInformation?.subItems\" [option]=\"gridOption?.subInformation\">\r\n </sd-grid-sub-information>\r\n </div>\r\n <div class=\"c-mobile-command\">\r\n <div>\r\n <i *ngIf=\"gridOption?.subInformation && item.subInformation?.isLoading\"\r\n class=\"fa fa-spinner fa-spin ml-1 c-mobile-action\" (click)=\"expandOrCollapse(item)\"></i>\r\n <i *ngIf=\"gridOption?.subInformation && !item.subInformation?.isLoading\" class=\"fa ml-1 c-mobile-action\"\r\n [ngClass]=\"{'fa-plus': !item.subInformation?.isOpened, 'fa-minus': item.subInformation?.isOpened}\"\r\n (click)=\"expandOrCollapse(item)\"></i>\r\n </div>\r\n <ng-container *ngIf=\"gridOption.commands | mobileCommandFilter:item | async; $implicit as filteredCommands\">\r\n <div *ngIf=\"filteredCommands.length\">\r\n <button [matMenuTriggerFor]=\"menu\" aria-hidden=\"true\" mat-icon-button type=\"button\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n <!-- <i [matMenuTriggerFor]=\"menu\" class=\"fa fa-navicon fa-fw c-mobile-action\"></i> -->\r\n <mat-menu #menu=\"matMenu\">\r\n <button *ngFor=\"let command of filteredCommands\" mat-menu-item (click)=\"command.click(item)\"\r\n [disabled]=\"command.disabled | commandDisabled:item\" type=\"button\">\r\n <i *ngIf=\"!command.fontSet\" class=\"{{command.icon | commandIcon:item}}\"></i>\r\n <mat-icon *ngIf=\"command.fontSet\" [fontSet]=\"command.fontSet\">{{command.icon | commandIcon:item}}\r\n </mat-icon>\r\n <span> {{command.title | commandTitle:item}}</span>\r\n </button>\r\n </mat-menu>\r\n </div>\r\n </ng-container>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <ng-container *ngIf=\"gridOption?.mobileOrTablet?.useGridView\">\r\n <ng-container *ngTemplateOutlet=\"gridViewContent\"></ng-container>\r\n </ng-container>\r\n <div [ngClass]=\"{'d-none': gridOption.hideFooter}\" class=\"sd-box-footer clearfix\">\r\n <sd-button icon=\"more_horiz\" size=\"sm\" [matMenuTriggerFor]=\"mobileAction\"></sd-button>\r\n <mat-menu #mobileAction=\"matMenu\">\r\n <button *ngIf=\"sdGridPopupFilter\" mat-menu-item (click)=\"onFilterPopup()\" type=\"button\">\r\n <mat-icon>filter_list</mat-icon>\r\n <span> {{'Filter' | sdTranslate}}</span>\r\n </button>\r\n <button *ngIf=\"!gridOption?.hideReload\" mat-menu-item (click)=\"reload()\" type=\"button\">\r\n <mat-icon>refresh</mat-icon>\r\n <span> {{'Reload' | sdTranslate}}</span>\r\n </button>\r\n <button *ngIf=\"gridOption.onImportExcel\" mat-menu-item (click)=\"sdGridImportExcel.open()\" type=\"button\">\r\n <mat-icon>publish</mat-icon>\r\n <span> {{'Import' | sdTranslate}}</span>\r\n </button>\r\n <button *ngIf=\"sdGridPopupExportExcel\" mat-menu-item (click)=\"sdGridPopupExportExcel.open()\" type=\"button\"\r\n [disabled]=\"!viewItems?.length\">\r\n <mat-icon>get_app</mat-icon>\r\n <span> {{'Export' | sdTranslate}}</span>\r\n </button>\r\n <button *ngIf=\"gridOption.key\" mat-menu-item (click)=\"sdGridConfig.open()\" type=\"button\">\r\n <mat-icon>settings</mat-icon>\r\n <span> {{'Configure' | sdTranslate}}</span>\r\n </button>\r\n </mat-menu>\r\n <ng-container *ngIf=\"gridOption?.key && gridOption?.filter?.multiple !== false && !gridOption?.filter?.disabled\">\r\n <sd-button icon=\"filter_list\" size=\"sm\" [matMenuTriggerFor]=\"mobileQuickFilter\"></sd-button>\r\n <mat-menu #mobileQuickFilter=\"matMenu\">\r\n <button mat-menu-item *ngFor=\"let quickFilter of quickFilters\" (click)=\"onSelectQuickFilter(quickFilter.code)\"\r\n type=\"button\" style=\"display:flex; justify-content: space-between\">\r\n <span>{{quickFilter.code}}</span>\r\n <div>\r\n <mat-icon class=\"mr-1\" (click)=\"onEditQuickFilter($event, quickFilter)\">edit</mat-icon>\r\n <mat-icon class=\"mr-0\" (click)=\"onDeleteQuickFilter($event, quickFilter)\">delete</mat-icon>\r\n </div>\r\n </button>\r\n <button mat-menu-item (click)=\"onCreateQuickFilter($event)\" type=\"button\">\r\n <mat-icon class=\"mr-1\" fontSet=\"material-icons-outlined\">add</mat-icon>\r\n <span>{{'Create quick filter' | sdTranslate}}</span>\r\n </button>\r\n </mat-menu>\r\n </ng-container>\r\n <div class=\"row mr-0 ml-0 text-right pull-right\">\r\n <mat-paginator [length]=\"total\" [pageSize]=\"gridOption.paginate?.pageSize\" hidePageSize>\r\n </mat-paginator>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>\r\n<!-- Modal Configure Grid -->\r\n<sd-grid-config (sdChange)=\"loadConfig($event)\" #sdGridConfig></sd-grid-config>\r\n<sd-grid-popup-editor (save)=\"onSave($event)\" #sdGridPopupEditor></sd-grid-popup-editor>\r\n<!-- Import Excel -->\r\n<sd-grid-import-excel *ngIf=\"gridOption?.onImportExcel\" [key]=\"gridOption?.key\" [columns]=\"gridOption?.columns\"\r\n [accept]=\"gridOption?.onImportExcel\" #sdGridImportExcel></sd-grid-import-excel>\r\n<sd-grid-popup-export-excel *ngIf=\"!gridOption.export?.disabled\" [key]=\"gridOption?.key\" [columns]=\"gridOption?.columns\"\r\n [extendColumns]=\"gridOption?.export?.columns\" [fileName]=\"gridOption?.export?.fileName\"\r\n [exportOption]=\"gridOption?.export\" [validator]=\"gridOption?.export?.validator\"\r\n (exportByTemplate)=\"onExportByTemplate($event)\" #sdGridPopupExportExcel>\r\n</sd-grid-popup-export-excel>\r\n<sd-grid-popup-filter\r\n *ngIf=\"!gridOption?.filter?.disabled && (isMobileOrTablet || gridOption?.filter?.type === 'popup')\"\r\n [key]=\"gridOption?.key\" (accept)=\"updateFilter($event)\" [filterOption]=\"gridOption?.filter\" (clear)=\"onClearFilter()\"\r\n (loadInlineFilter)=\"onFilterConfigurationLoaded($event)\" #sdGridPopupFilter>\r\n</sd-grid-popup-filter>\r\n\r\n<ng-template #gridViewContent>\r\n <div class=\"sd-box-body p-0\">\r\n <div class=\"row mx-0\">\r\n <div [ngClass]=\"{'c-loading': isLoading}\" class=\"table-responsive\" #gridBody style=\"position: relative;\">\r\n <i [ngClass]=\"{'d-none': !isLoading}\" class=\"fa fa-5x fa-spinner fa-pulse c-loading-icon\"></i>\r\n <table *ngIf=\"gridOption\" class=\"table c-table\"\r\n [ngClass]=\"{'c-loading-margin': isLoading, 'c-bordered': configuration?.style?.bordered, 'c-stripped': configuration?.style?.bordered}\"\r\n style=\"border:0!important;\">\r\n <thead class=\"thead-light\">\r\n <tr>\r\n <th class=\"position-sticky c-sticky-all align-middle p-0\" style=\"width:4px; min-width: 4px;\" #fixedHeader>\r\n </th>\r\n <th *ngIf=\"configuration?.style?.bordered\" class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-all\"\r\n #fixedHeader></th>\r\n <th *ngIf=\"gridOption?.subInformation\" class=\"position-sticky c-sticky-all align-middle text-center p-0\"\r\n style=\"width:30px;min-width: 30px;line-height: 3rem\" #fixedHeader>\r\n </th>\r\n <th *ngIf=\"gridOption?.subInformation && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-all\" #fixedHeader></th>\r\n <th *ngIf=\"gridOption?.checkable && viewItems?.length\"\r\n class=\"position-sticky c-sticky-all align-middle text-center p-0 w-20\" style=\"width:20px;\" #fixedHeader>\r\n <mat-checkbox [color]=\"'primary'\" [(ngModel)]=\"isCheckedAll\"\r\n (change)=\"checkAll(isCheckedAll)\"></mat-checkbox>\r\n </th>\r\n <th *ngIf=\"gridOption?.checkable && viewItems?.length && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-all\" #fixedHeader></th>\r\n <th *ngIf=\"gridOption?.commands?.length && viewItems?.length\"\r\n class=\"position-sticky align-middle text-center p-0 c-sticky-all c-w-1\" #fixedHeader>\r\n </th>\r\n <th *ngIf=\"gridOption.commands?.length && viewItems?.length && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-all\" #fixedHeader></th>\r\n <th *ngIf=\"gridOption.editor?.addable || gridOption.editor?.editable\"\r\n class=\"position-sticky c-sticky-all align-middle text-center p-0\"\r\n style=\"width:60px;min-width:60px;max-width:60px;line-height: 1.5\" #fixedHeader>\r\n <div *ngIf=\"gridOption.editor.addable\" class=\"align-middle text-center\">\r\n <button *ngIf=\"!gridOption.editor.limit || (gridOption.editor.limit > items.length)\" type=\"button\"\r\n (click)=\"onCreate()\" aria-label=\"Add\" mat-icon-button type=\"button\">\r\n <mat-icon>add</mat-icon>\r\n </button>\r\n </div>\r\n </th>\r\n <th *ngIf=\"gridOption.editor && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-all\" #fixedHeader></th>\r\n <th *ngIf=\"gridOption?.numberable\" class=\"position-sticky c-sticky-all align-middle text-center p-0\"\r\n style=\"width:20px;\" #fixedHeader>\r\n #\r\n </th>\r\n <th *ngIf=\"gridOption?.numberable && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-all\" #fixedHeader></th>\r\n <ng-container *ngFor=\"let column of fixedColumns\">\r\n <th class=\"position-sticky align-middle cursor-pointer c-cell c-sticky-all\" #fixedHeader\r\n [ngStyle]=\"{'width':column.width ? column.width : '','max-width': column.width ? column.width : '','min-width': !column.width || column.width === 'auto' ? '200px' : column.width}\">\r\n <span [title]=\"column.title\" class=\"c-header-title\" (click)=\"sort(column)\">\r\n {{column.title}}\r\n <i *ngIf=\"column.type !== 'children' && column.type !== 'image' && gridOption.sortable !== false && column.sortable !== false && orderBy !== column.field\"\r\n class=\"fa fa-sort fa-fw\"></i>\r\n <i *ngIf=\"orderBy === column.field && orderDirection == 'ASC'\" class=\"fa fa-sort-asc fa-fw\"></i>\r\n <i *ngIf=\"orderBy === column.field && orderDirection == 'DESC'\" class=\"fa fa-sort-desc fa-fw\"></i>\r\n </span>\r\n <ng-container\r\n *ngIf=\"!gridOption?.filter?.disabled && gridOption?.filter?.columnInline !== 'outside' && !column?.filter?.disabled && (inlineColumn[column.field] || gridOption?.filter?.type === 'inline')\">\r\n <sd-input size=\"sm\"\r\n *ngIf=\"column.type === 'string' || column.type === 'number' || column.type === 'children'\"\r\n [(model)]=\"filter[column.field]\" (keyupEnter)=\"updateFilter()\">\r\n </sd-input>\r\n <sd-select *ngIf=\"column.type === 'bool'\" size=\"sm\" [(model)]=\"filter[column.field]\"\r\n (sdChange)=\"updateFilter()\"\r\n [items]=\"[{value: 1, display: column.trueValue || 'TRUE'}, {value: 0, display: column.falseValue || 'FALSE'}]\"\r\n valueField=\"value\" displayField=\"display\">\r\n </sd-select>\r\n <sd-select *ngIf=\"column.type === 'values'\" size=\"sm\" [(model)]=\"filter[column.field]\"\r\n (sdChange)=\"updateFilter()\" [items]=\"column.values\" valueField=\"value\" displayField=\"text\"\r\n [filtered]=\"column?.editor?.autocomplete\">\r\n </sd-select>\r\n <sd-select *ngIf=\"column.type === 'radio'\" size=\"sm\" [(model)]=\"filter[column.field]\"\r\n (sdChange)=\"updateFilter()\" [items]=\"column.values\" [valueField]=\"column.valueField\"\r\n [displayField]=\"column.displayField\">\r\n </sd-select>\r\n <sd-date-time size=\"sm\"\r\n *ngIf=\"column.type === 'date' || column.type === 'datetime' || column.type === 'time'\"\r\n [(model)]=\"filter[column.field]\" (sdChange)=\"updateFilter()\" type=\"date\">\r\n </sd-date-time>\r\n </ng-container>\r\n </th>\r\n <th *ngIf=\"configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-all\" #fixedHeader></th>\r\n </ng-container>\r\n <th *ngFor=\"let column of normalColumns\"\r\n class=\"position-sticky align-middle cursor-pointer border-top-0 border-bottom-0 c-cell c-sticky-top c-normal-column\"\r\n [ngStyle]=\"{'width':column.width ? column.width : '','max-width': column.width ? column.width : '','min-width': !column.width || column.width === 'auto' ? '200px' : column.width}\">\r\n <span [title]=\"column.title\" class=\"c-header-title\" (click)=\"sort(column)\">\r\n {{column.title}}\r\n <i *ngIf=\"column.type !== 'children' && gridOption.sortable !== false && column.sortable !== false && orderBy !== column.field\"\r\n class=\"fa fa-sort fa-fw\"></i>\r\n <i *ngIf=\"orderBy == column.field && orderDirection == 'ASC'\" class=\"fa fa-sort-asc fa-fw\"></i>\r\n <i *ngIf=\"orderBy == column.field && orderDirection == 'DESC'\" class=\"fa fa-sort-desc fa-fw\"></i>\r\n </span>\r\n <ng-container\r\n *ngIf=\"!gridOption?.filter?.disabled && gridOption?.filter?.columnInline !== 'outside' && !column?.filter?.disabled && (inlineColumn[column.field] || gridOption?.filter?.type === 'inline')\">\r\n <sd-input size=\"sm\"\r\n *ngIf=\"column.type === 'string' || column.type === 'number' || column.type === 'children'\"\r\n [(model)]=\"filter[column.field]\" (keyupEnter)=\"updateFilter()\">\r\n </sd-input>\r\n <sd-select *ngIf=\"column.type === 'bool'\" size=\"sm\" [(model)]=\"filter[column.field]\"\r\n (sdChange)=\"updateFilter()\"\r\n [items]=\"[{value: 1, display: column.trueValue || 'TRUE'}, {value: 0, display: column.falseValue || 'FALSE'}]\"\r\n valueField=\"value\" displayField=\"display\">\r\n </sd-select>\r\n <sd-select *ngIf=\"column.type === 'values'\" size=\"sm\" [(model)]=\"filter[column.field]\"\r\n (sdChange)=\"updateFilter()\" [items]=\"column.values\" valueField=\"value\" displayField=\"text\"\r\n [filtered]=\"column?.editor?.autocomplete\">\r\n </sd-select>\r\n <sd-select *ngIf=\"column.type === 'radio'\" size=\"sm\" [(model)]=\"filter[column.field]\"\r\n (sdChange)=\"updateFilter()\" [items]=\"column.values\" [valueField]=\"column.valueField\"\r\n [displayField]=\"column.displayField\">\r\n </sd-select>\r\n <sd-date-time size=\"sm\"\r\n *ngIf=\"column.type === 'date' || column.type === 'datetime' || column.type === 'time'\"\r\n [(model)]=\"filter[column.field]\" (sdChange)=\"updateFilter()\" type=\"date\">\r\n </sd-date-time>\r\n </ng-container>\r\n </th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-container *ngFor=\"let item of viewItems; index as idx; trackBy: trackById\">\r\n <tr>\r\n <td class=\"position-sticky c-sticky-left p-0\"\r\n [ngClass]=\"{'c-error': ((gridOption.editor?.type === 'inline' || item.editingStatus) && item.editorHandler?.errorMessage), \r\n 'c-selected': !((gridOption.editor?.type === 'inline' || item.editingStatus) && item.editorHandler?.errorMessage) && selectedItem === item}\"\r\n style=\"width:4px;min-width: 4px;left:0\" matTooltipPosition=\"after\"\r\n [matTooltip]=\"item.editingStatus ? item.editorHandler?.errorMessage:''\" #fixedBody>\r\n </td>\r\n <td *ngIf=\"configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.subInformation\" class=\"position-sticky text-center align-middle p-0 c-sticky-left\"\r\n style=\"width:30px;min-width: 30px;line-height: 3rem\" #fixedBody>\r\n <button *ngIf=\"!item.editingStatus\" (click)=\"expandOrCollapse(item)\" type=\"button\" class=\"c-btn-icon\">\r\n <i *ngIf=\"item.subInformation?.isLoading\" class=\"fa fa-spinner fa-spin\"></i>\r\n <i *ngIf=\"!item.subInformation?.isLoading\" class=\"fa\"\r\n [ngClass]=\"{'fa-caret-right': !item.subInformation?.isOpened, 'fa-caret-down': item.subInformation?.isOpened}\"></i>\r\n </button>\r\n </td>\r\n <td *ngIf=\"gridOption.subInformation && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.checkable && viewItems?.length\"\r\n class=\"position-sticky c-sticky-left align-middle p-0\" #fixedBody>\r\n <div *ngIf=\"!item.editingStatus\" class=\"align-middle text-center w-20\" style=\"width:20px;\">\r\n <mat-checkbox [color]=\"'primary'\" [(ngModel)]=\"item.isChecked\"\r\n (change)=\"onCheck(item, true)\"></mat-checkbox>\r\n </div>\r\n </td>\r\n <td *ngIf=\"gridOption.checkable && viewItems?.length && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.commands?.length && viewItems?.length\"\r\n class=\"position-sticky align-middle px-2 py-0 c-sticky-left c-w-1\" #fixedBody>\r\n <div *ngIf=\"!item.editingStatus\" class=\"d-flex align-middle text-center justify-content-center\">\r\n <ng-container\r\n *ngIf=\"gridOption.commands | commandFilter:item | async; $implicit as filteredCommands\">\r\n <section *ngFor=\"let command of filteredCommands\">\r\n <ng-container *ngIf=\"!command.children?.length; else elseCommandChildren\">\r\n <button *ngIf=\"!command.fontSet\" (click)=\"command.click(item)\" type=\"button\"\r\n class=\"c-btn-icon\" [matTooltip]=\"command.title | commandTitle:item\"\r\n [disabled]=\"command.disabled | commandDisabled:item\">\r\n <i class=\"{{command.icon | commandIcon:item}}\" aria-hidden=\"true\"></i>\r\n </button>\r\n <button *ngIf=\"command.fontSet\" [matTooltip]=\"command.title | commandTitle:item\"\r\n [disabled]=\"command.disabled | commandDisabled:item\" (click)=\"command.click(item)\"\r\n type=\"button\" aria-hidden=\"true\" mat-icon-button>\r\n <mat-icon [fontSet]=\"command.fontSet\">{{command.icon | commandIcon:item}}</mat-icon>\r\n </button>\r\n </ng-container>\r\n <ng-template #elseCommandChildren>\r\n <button *ngIf=\"command.icon\" [matMenuTriggerFor]=\"menu\" type=\"button\" class=\"c-btn-icon\"\r\n [matTooltip]=\"command.title\" [disabled]=\"command.disabled | commandDisabled:item\">\r\n <i class=\"{{command.icon | commandIcon:item}}\" aria-hidden=\"true\"></i>\r\n </button>\r\n <button *ngIf=\"!command.icon\" mat-icon-button [matMenuTriggerFor]=\"menu\" type=\"button\"\r\n class=\"c-btn-icon-30\" [matTooltip]=\"command.title\"\r\n [disabled]=\"command.disabled | commandDisabled:item\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n <mat-menu #menu=\"matMenu\">\r\n <ng-container *ngFor=\"let childCommand of command.children\">\r\n <button *ngIf=\"!(item | commandHidden:childCommand | async)\" type=\"button\" mat-menu-item\r\n [disabled]=\"childCommand.disabled | commandDisabled:item\"\r\n (click)=\"childCommand.click(item)\">\r\n <i *ngIf=\"!childCommand.fontSet\" class=\"{{childCommand.icon | commandIcon:item}}\"></i>\r\n <mat-icon *ngIf=\"childCommand.fontSet\" [fontSet]=\"childCommand.fontSet\">\r\n {{childCommand.icon | commandIcon:item}}</mat-icon>\r\n <span> {{childCommand.title | commandTitle:item}}</span>\r\n </button>\r\n </ng-container>\r\n </mat-menu>\r\n </ng-template>\r\n </section>\r\n </ng-container>\r\n </div>\r\n </td>\r\n <td *ngIf=\"gridOption.commands?.length && viewItems?.length && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.editor?.addable || gridOption.editor?.editable\"\r\n class=\"position-sticky c-sticky-left align-middle p-0\" #fixedBody>\r\n <div class=\"align-middle text-center\"\r\n style=\"width:60px;min-width:60px;max-width:60px;line-height: 1.5\">\r\n <button\r\n *ngIf=\"!item.editingStatus && gridOption.editor?.type !== 'inline' && gridOption.editor?.editable\"\r\n [disabled]=\"item.editorHandler?.disabled\" (click)=\"onUpdate(item, true)\" aria-label=\"Edit\"\r\n type=\"button\" mat-icon-button>\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n <button *ngIf=\"item.editingStatus && gridOption.editor?.type !== 'inline'\"\r\n [disabled]=\"item.editorHandler?.errorMessage || item.editorHandler?.saving\" (click)=\"onSave(item)\"\r\n type=\"button\" aria-label=\"Save\" mat-icon-button>\r\n <mat-icon>save</mat-icon>\r\n </button>\r\n <button *ngIf=\"item.editingStatus || gridOption.editor?.type === 'inline'\" (click)=\"onCancel(item)\"\r\n aria-label=\"Cancel\" mat-icon-button\r\n [disabled]=\"gridOption.editor?.type === 'inline' && item.editorHandler?.disabled\" type=\"button\">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </div>\r\n </td>\r\n <td *ngIf=\"gridOption.editor && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.numberable\" class=\"position-sticky c-sticky-left align-middle p-0\" #fixedBody>\r\n <div *ngIf=\"!item.editingStatus\" class=\"align-middle text-center\" style=\"width:20px;\">\r\n <!-- {{gridOption.paginate?.pageSize * (currentPage - 1) + idx + 1}} -->\r\n {{idx + 1}}\r\n </div>\r\n </td>\r\n <td *ngIf=\"gridOption.numberable && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <ng-template ngFor let-column [ngForOf]=\"fixedColumns\">\r\n <td class=\"position-sticky align-middle c-cell c-sticky-left\"\r\n [ngClass]=\"{'text-center': column.type !== 'string' && column.type !== 'number' && column.type !== 'children', 'text-right': column.type === 'number'}\"\r\n [ngStyle]=\"{'width':column.width ? column.width : '','min-width': !column.width || column.width === 'auto' ? '200px' : column.width}\"\r\n (click)=\"rowHandler.click(item)\" #fixedBody>\r\n <ng-container *ngIf=\"column.type !== 'children';else elseColumnChildren\">\r\n <ng-container *ngIf=\"item[column.field] | editorHandler:item:gridOption\">\r\n <div\r\n *ngIf=\"item.editorHandler[column.field].visible && gridOption.editor?.validate && !(item[column.field] | editorValidate:item:gridOption.editor.validate | async)\">\r\n </div>\r\n <ng-container *ngIf=\"item.editorHandler[column.field].visible;else columnView\">\r\n <div style=\"width: 100%\">\r\n <ng-container *ngIf=\"cellEditorDef[column.field]\">\r\n <ng-container\r\n *ngTemplateOutlet=\"cellEditorDef[column.field].templateRef;context:{item: item, idx: idx, column:column}\">\r\n </ng-container>\r\n </ng-container>\r\n <sd-grid-desktop-column-edit *ngIf=\"!cellEditorDef[column.field]\" [column]=\"column\"\r\n [item]=\"item\" (sdChange)=\"onEditorChange()\">\r\n </sd-grid-desktop-column-edit>\r\n </div>\r\n </ng-container>\r\n <ng-template #columnView>\r\n <div class=\"align-middle\" (dblclick)=\"rowHandler.dblClick(item)\">\r\n <ng-container *ngIf=\"cellDef[column.field]\">\r\n <ng-container\r\n *ngTemplateOutlet=\"cellDef[column.field].templateRef;context:{item: item, idx: idx, column:column}\">\r\n </ng-container>\r\n </ng-container>\r\n <sd-grid-desktop-column-view *ngIf=\"!cellDef[column.field]\" [column]=\"column\" [item]=\"item\">\r\n </sd-grid-desktop-column-view>\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #elseColumnChildren>\r\n <sd-grid-desktop-column-children-view [column]=\"column\" [item]=\"item\">\r\n </sd-grid-desktop-column-children-view>\r\n </ng-template>\r\n </td>\r\n <td *ngIf=\"configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n </ng-template>\r\n <td *ngFor=\"let column of normalColumns\" class=\"align-middle c-cell c-normal-column\"\r\n (click)=\"rowHandler.click(item)\"\r\n [ngClass]=\"{'text-center': column.type !== 'string' && column.type !== 'number' && column.type !== 'children', 'text-right': column.type === 'number'}\"\r\n (dblclick)=\"rowHandler.dblClick(item)\"\r\n [ngStyle]=\"{'width':column.width ? column.width : '', 'min-width': !column.width || column.width === 'auto' ? '200px' : column.width}\">\r\n <ng-container *ngIf=\"column.type !== 'children';else elseColumnChildren\">\r\n <ng-container *ngIf=\"item[column.field] | editorHandler:item:gridOption\">\r\n <div\r\n *ngIf=\"item.editorHandler[column.field].visible && gridOption.editor?.validate && !(item[column.field] | editorValidate:item:gridOption.editor.validate | async)\">\r\n </div>\r\n <ng-container *ngIf=\"item.editorHandler[column.field].visible;else columnView\">\r\n <div style=\"width: 100%\">\r\n <ng-container *ngIf=\"cellEditorDef[column.field]\">\r\n <ng-container\r\n *ngTemplateOutlet=\"cellEditorDef[column.field].templateRef;context:{item: item, idx: idx, column:column}\">\r\n </ng-container>\r\n </ng-container>\r\n <sd-grid-desktop-column-edit *ngIf=\"!cellEditorDef[column.field]\" [column]=\"column\"\r\n [item]=\"item\" (sdChange)=\"onEditorChange()\">\r\n </sd-grid-desktop-column-edit>\r\n </div>\r\n </ng-container>\r\n <ng-template #columnView>\r\n <div class=\"align-middle\" (dblclick)=\"rowHandler.dblClick(item)\">\r\n <ng-container *ngIf=\"cellDef[column.field]\">\r\n <ng-container\r\n *ngTemplateOutlet=\"cellDef[column.field].templateRef;context:{item: item, idx: idx, column:column}\">\r\n </ng-container>\r\n </ng-container>\r\n <sd-grid-desktop-column-view *ngIf=\"!cellDef[column.field]\" [column]=\"column\" [item]=\"item\">\r\n </sd-grid-desktop-column-view>\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #elseColumnChildren>\r\n <sd-grid-desktop-column-children-view [column]=\"column\" [item]=\"item\">\r\n </sd-grid-desktop-column-children-view>\r\n </ng-template>\r\n </td>\r\n </tr>\r\n <tr *ngIf=\"gridOption?.subInformation && item?.subInformation?.isOpened\" class=\"c-no-hover\">\r\n <td class=\"p-10\" colspan=\"100\">\r\n <sd-grid-sub-information [subItems]=\"item?.subInformation?.subItems\"\r\n [option]=\"gridOption?.subInformation\">\r\n </sd-grid-sub-information>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n <ng-container *ngIf=\"viewItems?.length\">\r\n <ng-container *ngFor=\"let footerIndex of footerRows\">\r\n <tr>\r\n <td class=\"position-sticky c-sticky-left p-0\" style=\"width:4px;min-width: 4px;left:0\" #fixedBody>\r\n </td>\r\n <td *ngIf=\"configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.subInformation\"\r\n class=\"position-sticky text-center align-middle p-0 c-sticky-left\"\r\n style=\"width:30px;min-width: 30px;line-height: 3rem\" #fixedBody>\r\n </td>\r\n <td *ngIf=\"gridOption.subInformation && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.checkable && viewItems?.length\"\r\n class=\"position-sticky c-sticky-left align-middle p-0\" #fixedBody>\r\n </td>\r\n <td *ngIf=\"gridOption.checkable && viewItems?.length && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.commands?.length && viewItems?.length\"\r\n class=\"position-sticky align-middle px-2 py-0 c-sticky-left c-w-1\" #fixedBody>\r\n </td>\r\n <td *ngIf=\"gridOption.commands?.length && viewItems?.length && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.editor?.addable || gridOption.editor?.editable\"\r\n class=\"position-sticky c-sticky-left align-middle p-0\" #fixedBody>\r\n </td>\r\n <td *ngIf=\"gridOption.editor && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <td *ngIf=\"gridOption.numberable\" class=\"position-sticky c-sticky-left align-middle p-0\" #fixedBody>\r\n </td>\r\n <td *ngIf=\"gridOption.numberable && configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n <ng-template ngFor let-column [ngForOf]=\"fixedColumns\">\r\n <td class=\"position-sticky align-middle p-0 c-sticky-left\" #fixedBody>\r\n <ng-container *ngIf=\"cellFooterDef[column.field] && cellFooterDef[column.field][footerIndex]\">\r\n <ng-container\r\n *ngTemplateOutlet=\"cellFooterDef[column.field][footerIndex].templateRef;context:{items: viewItems, column:column}\">\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n <td *ngIf=\"configuration?.style?.bordered\"\r\n class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\" #fixedBody></td>\r\n </ng-template>\r\n <td *ngFor=\"let column of normalColumns\" class=\"align-middle p-0 c-normal-column\">\r\n <ng-container *ngIf=\"cellFooterDef[column.field] && cellFooterDef[column.field][footerIndex]\">\r\n <ng-container\r\n *ngTemplateOutlet=\"cellFooterDef[column.field][footerIndex].templateRef;context:{items: viewItems, column:column}\">\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n </ng-container>\r\n <tr *ngIf=\"!viewItems?.length && !isLoading\">\r\n <td class=\"c-empty\" colspan=\"100\">\r\n <mat-icon>cloud_off</mat-icon>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>",
|
|
1762
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1763
|
+
styles: [".text-black400{color:#757575}.c-table.table{margin-bottom:5px}.c-table.table td.c-empty,.c-table.table th.c-empty{background-color:#fff;border:none!important;text-align:center}.c-table.table td.c-empty mat-icon,.c-table.table th.c-empty mat-icon{font-size:150px;height:auto;margin-bottom:30px;margin-top:30px;opacity:.2;width:auto}.c-table.table.c-bordered,.c-table.table.c-bordered td,.c-table.table.c-bordered th{border:1px solid #dee2e6!important}.c-table.table.c-bordered td.c-empty,.c-table.table.c-bordered th.c-empty{background-color:#fff;border:none!important;text-align:center}.c-table.table.c-bordered td.c-empty mat-icon,.c-table.table.c-bordered th.c-empty mat-icon{font-size:150px;height:auto;margin-bottom:30px;margin-top:30px;opacity:.2;width:auto}.c-table.table.c-bordered td.c-normal-column,.c-table.table.c-bordered th.c-normal-column{border-left:none!important}.c-table.table.c-bordered td.c-sticky-spliter,.c-table.table.c-bordered th.c-sticky-spliter{background-color:#dee2e6!important;border:none!important;display:table-cell;max-width:1px!important;min-width:1px!important;width:1px!important}.c-table.table.c-bordered td.c-sticky-left,.c-table.table.c-bordered th.c-sticky-left{border-left:0!important;border-right:0!important}.c-table.table.c-bordered td.c-sticky-all,.c-table.table.c-bordered th.c-sticky-all{border:0!important}.c-table.table thead.thead-light th{background-color:#eceff1;border-top:none!important;color:#2f3136;font-size:14px!important;height:40px;min-width:0}.c-table.table thead.thead-light th.c-cell{padding:3px 5px!important}.c-table.table thead.thead-light th .mat-checkbox label{margin-bottom:0}.c-table.table tbody tr:not(.c-no-hover):hover,.c-table.table tbody tr:not(.c-no-hover):hover td.c-sticky-left{background-color:#e3f2fd!important}.c-table.table tbody tr:not(.c-no-hover):nth-of-type(odd){background-color:#fafafa}.c-table.table tbody tr:not(.c-no-hover):nth-of-type(odd) .c-sticky-left{background-color:#fafafa!important}.c-table.table tbody tr:not(.c-no-hover):nth-of-type(odd) .c-sticky-left.c-sticky-spliter{background-color:#dee2e6!important;border:none!important}.c-table.table tbody tr:not(.c-no-hover):nth-of-type(odd) .c-sticky-left.c-selected{background-color:#2962ff!important}.c-table.table tbody tr:not(.c-no-hover):nth-of-type(odd) .c-sticky-left.c-error{background-color:#f82c13!important}.c-table.table tbody tr:not(.c-no-hover):nth-of-type(2n){background-color:#fff}.c-table.table tbody tr:not(.c-no-hover):nth-of-type(2n) .c-sticky-left{background-color:#fff!important}.c-table.table tbody tr:not(.c-no-hover):nth-of-type(2n) .c-sticky-left.c-sticky-spliter{background-color:#dee2e6!important;border:none!important}.c-table.table tbody tr:not(.c-no-hover):nth-of-type(2n) .c-sticky-left.c-selected{background-color:#2962ff!important}.c-table.table tbody tr:not(.c-no-hover):nth-of-type(2n) .c-sticky-left.c-error{background-color:#f82c13!important}.c-table.table tbody td{font-size:13px!important;min-height:25px;min-width:0}.c-table.table tbody td.c-cell{padding:3px 5px!important}.grid-header{overflow-x:hidden;overflow-y:hidden}.c-cell-padding{padding:3px 5px!important}.c-header-title{font-weight:500;text-transform:capitalize}span.c-header-title{display:block;overflow:hidden!important;padding:0 .3rem;text-overflow:ellipsis;white-space:nowrap}.status{border-radius:1.5rem;display:inline-block;font-weight:500;padding:4px 8px;text-align:center;text-transform:uppercase}.status.c-desktop-status{width:100%}.status.c-align-left{text-align:left!important}.status-success{color:#43a047}.status-danger{color:#f44336}.page-item{cursor:pointer}.sumarize{background-color:#00bcd4;border-radius:10rem;color:#fff;display:inline-block;font-size:12px;font-weight:500;line-height:1;padding:8px 12px;text-align:center;text-transform:uppercase;white-space:normal}.cursor-pointer{cursor:pointer}.c-overflow-x-hidden{overflow-x:hidden}.c-grid-header,.c-overflow-y-hidden{overflow-y:hidden}.c-grid-header{overflow-x:hidden}.c-input-xs{font-size:13px!important;height:28px!important;line-height:1.5!important;padding:3px!important}.c-sticky-top{top:0!important;z-index:20}.c-sticky-left{left:0;z-index:20}.c-sticky-all{left:0;top:0!important;z-index:30}.c-sticky-spliter{background-color:#dee2e6!important;border:none!important;z-index:40!important}.c-badge:not(.c-children){border-radius:10rem;display:block!important;font-size:12px;font-weight:500;margin:0 auto;max-width:80%;padding:.3rem!important}.c-badge.c-children{font-size:14px;font-weight:500;padding:5px!important}.blinker{-webkit-animation:blinker .5s linear infinite;animation:blinker .5s linear infinite;color:#1c87c9;font-weight:500}@-webkit-keyframes blinker{50%{opacity:0}}@keyframes blinker{50%{opacity:0}}.c-loading{opacity:.4}.c-loading-icon{left:calc(50% - 2.5rem);position:-webkit-sticky;position:sticky;top:calc(50% - 2.5rem)}.c-loading-margin{margin-top:-5rem}fieldset.c-fieldset-mobile{border:1px solid #e0e0e0;border-radius:5px;padding:3px 5px}legend.c-legend-mobile{border-bottom:none;font-size:16px;font-weight:500;margin:0 10px;padding:0 5px;width:auto}.c-mobile-box{border-top:none!important;box-shadow:0 0 3px 0 rgba(0,0,0,.3)}.c-mobile-body{margin-bottom:5px;margin-top:5px;overflow-x:auto}.c-mobile-item{border:1px solid #fff;border-radius:5px;box-shadow:0 0 3px 0 rgba(0,0,0,.3);margin:8px 0;padding:5px}.c-mobile-item.c-mobile-item-selected{border:2px solid #2962ff!important}.c-mobile-item:nth-of-type(odd){background-color:#fafafa}.c-mobile-item:nth-of-type(2n){background-color:#fff}.c-mobile-row{margin-bottom:3px;margin-top:0}.c-desktop-title{font-size:13px;line-height:1.7}.c-desktop-title,.c-mobile-title{color:#212529;font-weight:700;margin-right:3px}.c-mobile-title{font-size:14px}.c-children,.c-mobile-value{color:#212529;font-size:14px;overflow-wrap:break-word}.c-mobile-badge{font-size:14px;font-weight:500;padding:5px!important}.c-mobile-command{align-items:center;border-top:1px solid #f4f4f4;display:flex;justify-content:space-between;padding:5px 3px 0}.c-mobile-action{font-size:18px!important}.c-mobile-checkable{margin:5px 0 5px -5px!important}.c-m-3{margin:3px!important}.c-m-5{margin:5px!important}.c-w-1{min-width:1px;width:1px}.c-display-contents{display:contents}.w-20{width:20px!important}.c-btn-icon-30{height:30px;line-height:30px;width:30px}.c-btn-icon{background:none!important;border:none;display:inline-flex;height:16px;opacity:.8;padding:0 3px}.c-btn-icon:hover{cursor:pointer;opacity:1}.c-btn-icon:disabled{background:none!important;border:none;cursor:not-allowed;opacity:.3}:host td .mat-icon-button,:host th .mat-icon-button{height:24px;line-height:24px;width:24px}:host td .mat-icon-button .material-icons,:host th .mat-icon-button .material-icons{font-size:20px}:host ::ng-deep .mat-paginator-container{height:32px;min-height:32px}:host ::ng-deep .mat-paginator-container .mat-icon-button{height:28px;line-height:28px;width:28px}:host ::ng-deep .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .mat-checkbox label{margin-bottom:0}"]
|
|
1764
|
+
},] }
|
|
1765
|
+
];
|
|
1766
|
+
SdGrid.ctorParameters = () => [
|
|
1767
|
+
{ type: undefined, decorators: [{ type: Inject, args: [GRID_CONFIG,] }, { type: Optional }] },
|
|
1768
|
+
{ type: ChangeDetectorRef },
|
|
1769
|
+
{ type: DeviceDetectorService },
|
|
1770
|
+
{ type: HandlerLocal },
|
|
1771
|
+
{ type: HandlerDotnet },
|
|
1772
|
+
{ type: SdTranslateService },
|
|
1773
|
+
{ type: DatePipe },
|
|
1774
|
+
{ type: SdLoadingService },
|
|
1775
|
+
{ type: SdApiService },
|
|
1776
|
+
{ type: SdExcelService },
|
|
1777
|
+
{ type: SdNotifyService },
|
|
1778
|
+
{ type: EditorHandlerPipe }
|
|
1779
|
+
];
|
|
1780
|
+
SdGrid.propDecorators = {
|
|
1781
|
+
fixedHeaders: [{ type: ViewChildren, args: ['fixedHeader',] }],
|
|
1782
|
+
fixedBodies: [{ type: ViewChildren, args: ['fixedBody',] }],
|
|
1783
|
+
fixedGridContainer: [{ type: ViewChild, args: ['fixedGridContainer',] }],
|
|
1784
|
+
gridFixedBody: [{ type: ViewChild, args: ['gridFixedBody',] }],
|
|
1785
|
+
gridContainer: [{ type: ViewChild, args: ['gridContainer',] }],
|
|
1786
|
+
gridHeader: [{ type: ViewChild, args: ['gridHeader',] }],
|
|
1787
|
+
gridBody: [{ type: ViewChild, args: ['gridBody',] }],
|
|
1788
|
+
sdGridConfig: [{ type: ViewChild, args: ['sdGridConfig', { static: true },] }],
|
|
1789
|
+
sdGridPopupEditor: [{ type: ViewChild, args: ['sdGridPopupEditor',] }],
|
|
1790
|
+
sdGridPopupFilter: [{ type: ViewChild, args: ['sdGridPopupFilter',] }],
|
|
1791
|
+
matSelect: [{ type: ViewChild, args: ['matSelect',] }],
|
|
1792
|
+
sdGridPopupExportExcel: [{ type: ViewChild, args: ['sdGridPopupExportExcel',] }],
|
|
1793
|
+
sdGridImportExcel: [{ type: ViewChild, args: ['sdGridImportExcel',] }],
|
|
1794
|
+
cellDefs: [{ type: ContentChildren, args: [SdCellDefDirective,] }],
|
|
1795
|
+
cellEditorDefs: [{ type: ContentChildren, args: [SdCellEditorDefDirective,] }],
|
|
1796
|
+
cellFooterDefs: [{ type: ContentChildren, args: [SdCellFooterDevDirective,] }],
|
|
1797
|
+
paginator: [{ type: ViewChild, args: [MatPaginator,] }],
|
|
1798
|
+
option: [{ type: Input }]
|
|
1799
|
+
};
|
|
1800
|
+
|
|
1801
|
+
class SdDynamicItems {
|
|
1802
|
+
transform(value, dynamicItems) {
|
|
1803
|
+
return dynamicItems;
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
SdDynamicItems.decorators = [
|
|
1807
|
+
{ type: Pipe, args: [{
|
|
1808
|
+
name: 'sdDynamicItems'
|
|
1809
|
+
},] }
|
|
1810
|
+
];
|
|
1811
|
+
|
|
1812
|
+
var _setting, _initDefault;
|
|
1813
|
+
class SdGridConfig {
|
|
1814
|
+
constructor(ref, notifyService, settingService, translateService) {
|
|
1815
|
+
this.ref = ref;
|
|
1816
|
+
this.notifyService = notifyService;
|
|
1817
|
+
this.settingService = settingService;
|
|
1818
|
+
this.translateService = translateService;
|
|
1819
|
+
this.sdChange = new EventEmitter();
|
|
1820
|
+
_setting.set(this, void 0);
|
|
1821
|
+
_initDefault.set(this, () => {
|
|
1822
|
+
this.storage = {};
|
|
1823
|
+
this.storage.pageSize = this.option.pageSize;
|
|
1824
|
+
this.storage.columnConfigs = [];
|
|
1825
|
+
this.option.columns.forEach(column => {
|
|
1826
|
+
this.storage.columnConfigs.push({
|
|
1827
|
+
originColumn: {
|
|
1828
|
+
field: column.field,
|
|
1829
|
+
title: column.title,
|
|
1830
|
+
width: column.width,
|
|
1831
|
+
fixed: column.fixed
|
|
1832
|
+
},
|
|
1833
|
+
hidden: false,
|
|
1834
|
+
fixed: column.fixed
|
|
1835
|
+
});
|
|
1836
|
+
});
|
|
1837
|
+
});
|
|
1838
|
+
}
|
|
1839
|
+
ngOnInit() {
|
|
1840
|
+
}
|
|
1841
|
+
setOption(option) {
|
|
1842
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1843
|
+
this.ref.detectChanges();
|
|
1844
|
+
this.option = option;
|
|
1845
|
+
if (this.option.key) {
|
|
1846
|
+
__classPrivateFieldSet(this, _setting, this.settingService.create(this.option.key));
|
|
1847
|
+
}
|
|
1848
|
+
else {
|
|
1849
|
+
__classPrivateFieldSet(this, _setting, null);
|
|
1850
|
+
}
|
|
1851
|
+
yield this.init();
|
|
1852
|
+
this.emitOnChange();
|
|
1853
|
+
});
|
|
1854
|
+
}
|
|
1855
|
+
init() {
|
|
1856
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1857
|
+
if (__classPrivateFieldGet(this, _setting)) {
|
|
1858
|
+
const storage = yield __classPrivateFieldGet(this, _setting).get();
|
|
1859
|
+
try {
|
|
1860
|
+
if (!storage) {
|
|
1861
|
+
yield __classPrivateFieldGet(this, _setting).remove();
|
|
1862
|
+
__classPrivateFieldGet(this, _initDefault).call(this);
|
|
1863
|
+
return;
|
|
1864
|
+
}
|
|
1865
|
+
this.storage = storage;
|
|
1866
|
+
// Loại bỏ những column đã bị xóa khỏi originColumns
|
|
1867
|
+
this.storage.columnConfigs = this.storage.columnConfigs
|
|
1868
|
+
.filter(column => this.option.columns.some(e => e.field === column.originColumn.field));
|
|
1869
|
+
// Thêm những column mới vào storage nếu có
|
|
1870
|
+
this.option.columns.forEach(column => {
|
|
1871
|
+
if (!this.storage.columnConfigs.some(e => e.originColumn.field === column.field)) {
|
|
1872
|
+
this.storage.columnConfigs.push({
|
|
1873
|
+
originColumn: {
|
|
1874
|
+
field: column.field,
|
|
1875
|
+
title: column.title,
|
|
1876
|
+
width: column.width,
|
|
1877
|
+
fixed: column.fixed
|
|
1878
|
+
},
|
|
1879
|
+
hidden: false,
|
|
1880
|
+
fixed: column.fixed
|
|
1881
|
+
});
|
|
1882
|
+
}
|
|
1883
|
+
});
|
|
1884
|
+
// Cập nhật originColumn
|
|
1885
|
+
this.storage.columnConfigs.forEach(column => {
|
|
1886
|
+
const originColumn = this.option.columns.find(e => e.field === column.originColumn.field);
|
|
1887
|
+
if (originColumn) {
|
|
1888
|
+
Object.assign(column.originColumn, {
|
|
1889
|
+
title: originColumn.title,
|
|
1890
|
+
width: originColumn.width,
|
|
1891
|
+
fixed: originColumn.fixed
|
|
1892
|
+
});
|
|
1893
|
+
}
|
|
1894
|
+
});
|
|
1895
|
+
}
|
|
1896
|
+
catch (ex) {
|
|
1897
|
+
__classPrivateFieldGet(this, _setting).remove();
|
|
1898
|
+
__classPrivateFieldGet(this, _initDefault).call(this);
|
|
1899
|
+
}
|
|
1900
|
+
}
|
|
1901
|
+
else {
|
|
1902
|
+
__classPrivateFieldGet(this, _initDefault).call(this);
|
|
1903
|
+
}
|
|
1904
|
+
});
|
|
1905
|
+
}
|
|
1906
|
+
open() {
|
|
1907
|
+
this.modal.open();
|
|
1908
|
+
}
|
|
1909
|
+
save() {
|
|
1910
|
+
var _a, _b;
|
|
1911
|
+
if (!Number.isSafeInteger(+this.storage.pageSize)) {
|
|
1912
|
+
this.notifyService.notify.warning(this.translateService.translate('Page size must be an integer'));
|
|
1913
|
+
return;
|
|
1914
|
+
}
|
|
1915
|
+
if (this.storage.pageSize > 200) {
|
|
1916
|
+
this.notifyService.notify.warning(this.translateService.translate('Page size is too large'));
|
|
1917
|
+
return;
|
|
1918
|
+
}
|
|
1919
|
+
(_b = (_a = __classPrivateFieldGet(this, _setting)) === null || _a === void 0 ? void 0 : _a.set) === null || _b === void 0 ? void 0 : _b.call(_a, this.storage);
|
|
1920
|
+
this.emitOnChange();
|
|
1921
|
+
this.modal.close();
|
|
1922
|
+
this.ref.detectChanges();
|
|
1923
|
+
}
|
|
1924
|
+
reset() {
|
|
1925
|
+
var _a, _b;
|
|
1926
|
+
(_b = (_a = __classPrivateFieldGet(this, _setting)) === null || _a === void 0 ? void 0 : _a.remove) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
1927
|
+
__classPrivateFieldGet(this, _initDefault).call(this);
|
|
1928
|
+
this.emitOnChange();
|
|
1929
|
+
this.modal.close();
|
|
1930
|
+
this.ref.detectChanges();
|
|
1931
|
+
}
|
|
1932
|
+
moveColumnUp(index) {
|
|
1933
|
+
const temp = this.storage.columnConfigs[index];
|
|
1934
|
+
this.storage.columnConfigs[index] = this.storage.columnConfigs[index - 1];
|
|
1935
|
+
this.storage.columnConfigs[index - 1] = temp;
|
|
1936
|
+
}
|
|
1937
|
+
moveColumnDown(index) {
|
|
1938
|
+
const temp = this.storage.columnConfigs[index];
|
|
1939
|
+
this.storage.columnConfigs[index] = this.storage.columnConfigs[index + 1];
|
|
1940
|
+
this.storage.columnConfigs[index + 1] = temp;
|
|
1941
|
+
}
|
|
1942
|
+
emitOnChange() {
|
|
1943
|
+
const pageSize = +this.storage.pageSize || this.option.pageSize;
|
|
1944
|
+
const columns = this.option.columns.filter(column => {
|
|
1945
|
+
// Hidden column theo config
|
|
1946
|
+
// Lấy các thuộc tính Title, Width, Fixed từ config
|
|
1947
|
+
const columnConfig = this.storage.columnConfigs.find(e => e.originColumn.field === column.field);
|
|
1948
|
+
if (columnConfig) {
|
|
1949
|
+
column.title = columnConfig.title || column.title;
|
|
1950
|
+
column.width = columnConfig.width || column.width;
|
|
1951
|
+
column.fixed = columnConfig.fixed;
|
|
1952
|
+
return !columnConfig.hidden;
|
|
1953
|
+
}
|
|
1954
|
+
return true;
|
|
1955
|
+
}).sort((current, next) => {
|
|
1956
|
+
// Sắp xếp theo config
|
|
1957
|
+
const currentIndex = this.storage.columnConfigs.findIndex(e => e.originColumn.field === current.field);
|
|
1958
|
+
const nextIndex = this.storage.columnConfigs.findIndex(e => e.originColumn.field === next.field);
|
|
1959
|
+
return currentIndex - nextIndex;
|
|
1960
|
+
}).filter(column => {
|
|
1961
|
+
// Hidden column theo option truyền vào
|
|
1962
|
+
if (column.hidden === undefined) {
|
|
1963
|
+
return true;
|
|
1964
|
+
}
|
|
1965
|
+
if (typeof (column.hidden) === 'boolean') {
|
|
1966
|
+
return !column.hidden;
|
|
1967
|
+
}
|
|
1968
|
+
if (typeof (column.hidden) === 'function') {
|
|
1969
|
+
return !column.hidden();
|
|
1970
|
+
}
|
|
1971
|
+
return false;
|
|
1972
|
+
});
|
|
1973
|
+
const result = {
|
|
1974
|
+
pageSize,
|
|
1975
|
+
columns,
|
|
1976
|
+
fixedColumns: columns.filter(e => e.fixed),
|
|
1977
|
+
normalColumns: columns.filter(e => !e.fixed)
|
|
1978
|
+
};
|
|
1979
|
+
this.sdChange.emit(result);
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
_setting = new WeakMap(), _initDefault = new WeakMap();
|
|
1983
|
+
SdGridConfig.decorators = [
|
|
1984
|
+
{ type: Component, args: [{
|
|
1985
|
+
selector: 'sd-grid-config',
|
|
1986
|
+
template: "<sd-modal [title]=\"'Configuration' | sdTranslate\" #modal>\r\n <sd-modal-body *ngIf=\"storage\">\r\n <div class=\"row\">\r\n <div class=\"col-md-3 col-6\">\r\n <sd-input-currency [label]=\"'Page size' | sdTranslate\" [(model)]=\"storage.pageSize\" step=\"1\">\r\n </sd-input-currency>\r\n </div>\r\n </div>\r\n <div class=\"sd-box sd-box-primary\">\r\n <div class=\"sd-box-body p-0\">\r\n <div class=\"table-responsive\">\r\n <table class=\"table table-striped table-sm table-hover table-bordered c-table\">\r\n <thead class=\"thead-light\">\r\n <tr>\r\n <th class=\"text-center\" style=\"width: 50px\">#</th>\r\n <th *sdDesktop class=\"text-center\" style=\"width: 80px\"></th>\r\n <!-- <th class=\"text-uppercase\" style=\"width: 120px\">Field </th> -->\r\n <th class=\"text-uppercase\">{{'Title' | sdTranslate}}</th>\r\n <th *sdDesktop class=\"text-uppercase\" style=\"width: 80px\">{{'Width' | sdTranslate}}</th>\r\n <th class=\"text-uppercase\" style=\"width: 80px\">{{'Hidden' | sdTranslate}}</th>\r\n <th *sdDesktop class=\"text-uppercase\" style=\"width: 80px\">{{'Freeze' | sdTranslate}}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let column of storage.columnConfigs; let idx = index\">\r\n <td class=\"align-middle text-center\">\r\n {{idx+1}}\r\n </td>\r\n <td *sdDesktop class=\"align-middle text-center\">\r\n <button type=\"button\" [disabled]=\"idx==0\" type=\"button\" class=\"c-btn-icon\" placement=\"top\"\r\n matTooltip=\"Up\" (click)=\"moveColumnUp(idx)\">\r\n <i class=\"fa fa-arrow-up text-primary\" aria-hidden=\"true\"></i>\r\n </button>\r\n <button type=\"button\" [disabled]=\"idx==storage.columnConfigs.length-1\" type=\"button\"\r\n class=\"c-btn-icon\" placement=\"top\" matTooltip=\"Down\" (click)=\"moveColumnDown(idx)\">\r\n <i class=\"fa fa-arrow-down text-primary\" aria-hidden=\"true\"></i>\r\n </button>\r\n </td>\r\n <!-- <td class=\"align-middle\">{{column.originColumn.field}}</td> -->\r\n <td class=\"align-middle\">\r\n <input type=\"text\" placeholder=\"{{column.originColumn.title}}\" [(ngModel)]=\"column.title\"\r\n class=\"form-control form-control-sm\">\r\n </td>\r\n <td *sdDesktop class=\"align-middle\">\r\n <input type=\"text\" placeholder=\"{{column.originColumn.width}}\" [(ngModel)]=\"column.width\"\r\n class=\"form-control form-control-sm\">\r\n </td>\r\n <td class=\"align-middle text-center\">\r\n <mat-slide-toggle [(ngModel)]=\"column.hidden\" color=\"primary\"></mat-slide-toggle>\r\n </td>\r\n <td *sdDesktop class=\"align-middle text-center\">\r\n <mat-slide-toggle [(ngModel)]=\"column.fixed\" color=\"primary\"></mat-slide-toggle>\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n </div>\r\n </div>\r\n </sd-modal-body>\r\n <sd-modal-footer *sdDesktop>\r\n <sd-button class=\"mr-auto\" (action)=\"reset()\" icon=\"refresh\" [title]=\"'Reset' | sdTranslate\" size=\"sm\"></sd-button>\r\n <sd-button (action)=\"save()\" icon=\"save\" [title]=\"'Save' | sdTranslate\" color=\"primary\" size=\"sm\"></sd-button>\r\n </sd-modal-footer>\r\n <sd-modal-footer *sdMobileTablet>\r\n <sd-button style=\"flex: 1; padding-right: 5px;\" (action)=\"reset()\" icon=\"refresh\" [title]=\"'Reset' | sdTranslate\"\r\n width=\"100%\" size=\"sm\"></sd-button>\r\n <sd-button style=\"flex: 1; padding-left: 5px;\" (action)=\"save()\" icon=\"save\" [title]=\"'Save' | sdTranslate\"\r\n color=\"primary\" width=\"100%\" size=\"sm\"></sd-button>\r\n </sd-modal-footer>\r\n</sd-modal>",
|
|
1987
|
+
styles: [".c-btn-icon{background:none!important;border:none;opacity:.8}.c-btn-icon:hover{cursor:pointer;opacity:1}.c-btn-icon:disabled{background:none!important;border:none;cursor:not-allowed;opacity:.3}.table td,.table th{padding:.2rem!important}.c-table.table{margin-bottom:5px}"]
|
|
1988
|
+
},] }
|
|
1989
|
+
];
|
|
1990
|
+
SdGridConfig.ctorParameters = () => [
|
|
1991
|
+
{ type: ChangeDetectorRef },
|
|
1992
|
+
{ type: SdNotifyService },
|
|
1993
|
+
{ type: SdSettingService },
|
|
1994
|
+
{ type: SdTranslateService }
|
|
1995
|
+
];
|
|
1996
|
+
SdGridConfig.propDecorators = {
|
|
1997
|
+
modal: [{ type: ViewChild, args: ['modal',] }],
|
|
1998
|
+
sdChange: [{ type: Output }]
|
|
1999
|
+
};
|
|
2000
|
+
|
|
2001
|
+
class SdGridDesktopColumnEdit {
|
|
2002
|
+
constructor(ref) {
|
|
2003
|
+
this.ref = ref;
|
|
2004
|
+
this.sdChange = new EventEmitter();
|
|
2005
|
+
this.onEditorChange = (column, item, value) => {
|
|
2006
|
+
var _a, _b;
|
|
2007
|
+
if (column.type !== 'children') {
|
|
2008
|
+
(_b = (_a = column.editor) === null || _a === void 0 ? void 0 : _a.change) === null || _b === void 0 ? void 0 : _b.call(_a, item, value);
|
|
2009
|
+
this.ref.detectChanges();
|
|
2010
|
+
this.sdChange.emit();
|
|
2011
|
+
}
|
|
2012
|
+
};
|
|
2013
|
+
this.onAutocompleteChange = (item) => {
|
|
2014
|
+
var _a, _b;
|
|
2015
|
+
if (this.column.type === 'string' || this.column.type === 'values') {
|
|
2016
|
+
(_b = (_a = this.column.editor) === null || _a === void 0 ? void 0 : _a.change) === null || _b === void 0 ? void 0 : _b.call(_a, this.item, this.item[this.column.field], item);
|
|
2017
|
+
this.ref.detectChanges();
|
|
2018
|
+
this.sdChange.emit();
|
|
2019
|
+
}
|
|
2020
|
+
};
|
|
2021
|
+
this.onSelectionChange = (params) => {
|
|
2022
|
+
var _a, _b;
|
|
2023
|
+
if (this.column.type === 'string' || this.column.type === 'values') {
|
|
2024
|
+
(_b = (_a = this.column.editor) === null || _a === void 0 ? void 0 : _a.change) === null || _b === void 0 ? void 0 : _b.call(_a, this.item, params === null || params === void 0 ? void 0 : params.value, (params === null || params === void 0 ? void 0 : params.item) || (params === null || params === void 0 ? void 0 : params.items));
|
|
2025
|
+
this.ref.detectChanges();
|
|
2026
|
+
this.sdChange.emit();
|
|
2027
|
+
}
|
|
2028
|
+
};
|
|
2029
|
+
this.dynamicItems = (value) => __awaiter(this, void 0, void 0, function* () {
|
|
2030
|
+
if ('editor' in this.column && 'item' in this.column.editor) {
|
|
2031
|
+
const items = this.column.editor.item.items || [];
|
|
2032
|
+
if (Array.isArray(items)) {
|
|
2033
|
+
return items;
|
|
2034
|
+
}
|
|
2035
|
+
const results = items(this.item, value);
|
|
2036
|
+
if (results instanceof Promise) {
|
|
2037
|
+
return yield results;
|
|
2038
|
+
}
|
|
2039
|
+
return results;
|
|
2040
|
+
}
|
|
2041
|
+
else {
|
|
2042
|
+
return [];
|
|
2043
|
+
}
|
|
2044
|
+
});
|
|
2045
|
+
}
|
|
2046
|
+
}
|
|
2047
|
+
SdGridDesktopColumnEdit.decorators = [
|
|
2048
|
+
{ type: Component, args: [{
|
|
2049
|
+
selector: 'sd-grid-desktop-column-edit',
|
|
2050
|
+
template: "<ng-container *ngIf=\"column && item\">\r\n <div *ngIf=\"column.type === 'string'\">\r\n <div *ngIf=\"column.editor?.item;else elseUseInput\">\r\n <sd-select *ngIf=\"!column.editor?.autocomplete\" size=\"sm\" [(model)]=\"item[column.field]\"\r\n [items]=\"item[column.editor?.item?.dependOnField] | sdDynamicItems:dynamicItems\"\r\n [valueField]=\"column.editor.item.value\" [displayField]=\"column.editor.item.display\"\r\n (sdSelection)=\"onSelectionChange($event)\" [placeholder]=\"column.title\">\r\n </sd-select>\r\n <sd-autocomplete *ngIf=\"column.editor?.autocomplete\" size=\"sm\" [(model)]=\"item[column.field]\"\r\n [items]=\"item[column.editor?.item?.dependOnField] | sdDynamicItems:dynamicItems\"\r\n [valueField]=\"column.editor.item.value\" [displayField]=\"column.editor.item.display\"\r\n (sdChange)=\"onAutocompleteChange($event)\" [placeholder]=\"column.title\">\r\n </sd-autocomplete>\r\n </div>\r\n <ng-template #elseUseInput>\r\n <sd-input size=\"sm\" *ngIf=\"column.editor?.click\" [(model)]=\"item[column.field]\"\r\n (keyupEnter)=\"column.editor?.keyupEnter && column.editor?.keyupEnter(item)\"\r\n (sdChange)=\"onEditorChange(column,item,item[column.field])\" (sdClick)=\"column.editor.click(item)\"></sd-input>\r\n <sd-input size=\"sm\" *ngIf=\"!column.editor?.click\" [(model)]=\"item[column.field]\"\r\n (keyupEnter)=\"column.editor?.keyupEnter && column.editor?.keyupEnter(item)\"\r\n (sdChange)=\"onEditorChange(column,item,item[column.field])\"></sd-input>\r\n </ng-template>\r\n </div>\r\n <div *ngIf=\"column.type === 'color'\">\r\n <sd-input size=\"sm\" type=\"color\" [(model)]=\"item[column.field]\"\r\n (sdChange)=\"onEditorChange(column,item,item[column.field])\">\r\n </sd-input>\r\n </div>\r\n <div *ngIf=\"column.type === 'number'\">\r\n <sd-input-currency size=\"sm\" [(model)]=\"item[column.field]\"\r\n (keyupEnter)=\"column.editor?.keyupEnter && column.editor?.keyupEnter(item)\"\r\n (sdChange)=\"onEditorChange(column,item,item[column.field])\"></sd-input-currency>\r\n </div>\r\n <div *ngIf=\"column.type === 'date'\">\r\n <sd-date-time size=\"sm\" [(model)]=\"item[column.field]\" type=\"date\"></sd-date-time>\r\n </div>\r\n <div class=\"text-center\" *ngIf=\"column.type === 'datetime'\">\r\n <sd-date-time size=\"sm\" [(model)]=\"item[column.field]\" type=\"datetime\"></sd-date-time>\r\n </div>\r\n <div class=\"text-center\" *ngIf=\"column.type === 'time'\">\r\n <sd-time [(model)]=\"item[column.field]\"></sd-time>\r\n <!-- <sd-grid-date-picker-control [(model)]=\"item[column.field]\" type=\"time\"></sd-grid-date-picker-control> -->\r\n </div>\r\n <div class=\"align-middle text-center\" *ngIf=\"column.type === 'bool'\">\r\n <sd-switch [(model)]=\"item[column.field]\" (sdChange)=\"onEditorChange(column,item,item[column.field])\">\r\n </sd-switch>\r\n </div>\r\n <div *ngIf=\"column.type === 'values'\">\r\n <div *ngIf=\"column.editor?.item;else elseUseValues\">\r\n <sd-select *ngIf=\"!column.editor?.autocomplete\" size=\"sm\" [(model)]=\"item[column.field]\"\r\n [items]=\"item[column.editor?.item?.dependOnField] | sdDynamicItems:dynamicItems\"\r\n [valueField]=\"column.editor.item.value\" [displayField]=\"column.editor.item.display\"\r\n (sdSelection)=\"onSelectionChange($event)\" [placeholder]=\"column.title\">\r\n </sd-select>\r\n <sd-autocomplete *ngIf=\"column.editor?.autocomplete\" size=\"sm\" [(model)]=\"item[column.field]\"\r\n [items]=\"item[column.editor?.item?.dependOnField] | sdDynamicItems:dynamicItems\"\r\n [valueField]=\"column.editor.item.value\" [displayField]=\"column.editor.item.display\"\r\n (sdChange)=\"onAutocompleteChange($event)\" [placeholder]=\"column.title\">\r\n </sd-autocomplete>\r\n </div>\r\n <ng-template #elseUseValues>\r\n <sd-select *ngIf=\"!column.editor?.autocomplete\" size=\"sm\" [(model)]=\"item[column.field]\" [items]=\"column.values\" valueField=\"value\" displayField=\"text\"\r\n (sdSelection)=\"onSelectionChange($event)\" [placeholder]=\"column.title\">\r\n </sd-select>\r\n <sd-autocomplete *ngIf=\"column.editor?.autocomplete\" size=\"sm\" [(model)]=\"item[column.field]\" [items]=\"column.values\" valueField=\"value\" displayField=\"text\"\r\n (sdChange)=\"onAutocompleteChange($event)\" [placeholder]=\"column.title\">\r\n </sd-autocomplete>\r\n </ng-template>\r\n </div>\r\n <div *ngIf=\"column.type === 'radio'\">\r\n <section class=\"mt-5 ml-5\">\r\n <mat-radio-group class=\"d-flex\" [(ngModel)]=\"item[column.field]\"\r\n (change)=\"column.editor?.change && column.editor?.change(item)\">\r\n <mat-radio-button *ngIf=\"!column.editor?.required\" color=\"warn\" class=\"mr-5\" value=\"\">\r\n {{'Please select' | sdTranslate}}\r\n </mat-radio-button>\r\n <mat-radio-button color=\"primary\" class=\"mr-5\" *ngFor=\"let data of column.values\"\r\n [value]=\"data[column.valueField]\">\r\n {{data[column.displayField]}}\r\n </mat-radio-button>\r\n </mat-radio-group>\r\n </section>\r\n </div>\r\n <div class=\"align-middle text-center\" *ngIf=\"column.type === 'image'\">\r\n <img [src]=\"item[column.field]\" [width]=\"column.display?.width\" [height]=\"column.display?.height\"\r\n style=\"margin: 5px 0\" (click)=\"column.click && column.click(item[column.field], item)\">\r\n </div>\r\n</ng-container>",
|
|
2051
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2052
|
+
styles: [".c-input-xs{font-size:13px!important;height:28px!important;line-height:1.5!important;padding:3px!important}"]
|
|
2053
|
+
},] }
|
|
2054
|
+
];
|
|
2055
|
+
SdGridDesktopColumnEdit.ctorParameters = () => [
|
|
2056
|
+
{ type: ChangeDetectorRef }
|
|
2057
|
+
];
|
|
2058
|
+
SdGridDesktopColumnEdit.propDecorators = {
|
|
2059
|
+
column: [{ type: Input }],
|
|
2060
|
+
item: [{ type: Input }],
|
|
2061
|
+
sdChange: [{ type: Output }]
|
|
2062
|
+
};
|
|
2063
|
+
|
|
2064
|
+
class SdGridDesktopColumnView {
|
|
2065
|
+
constructor() { }
|
|
2066
|
+
}
|
|
2067
|
+
SdGridDesktopColumnView.decorators = [
|
|
2068
|
+
{ type: Component, args: [{
|
|
2069
|
+
selector: 'sd-grid-desktop-column-view',
|
|
2070
|
+
template: "<ng-container *ngIf=\"column && item\">\r\n <ng-container *ngIf=\"column.htmlTemplate;else useDefaultView\">\r\n <div (click)=\"column.click && column.click(item[column.field], item)\" [ngClass]=\"{'cursor-pointer':column.click}\"\r\n [innerHTML]=\"(item[column.field] | columnHtmlTemplate:item:column.htmlTemplate) | safeHtml\">\r\n </div>\r\n </ng-container>\r\n <ng-template #useDefaultView>\r\n <div *ngIf=\"column.type === 'string'\">\r\n <span [className]=\"item[column.field] | cellDesktopClassName:item:column\"\r\n [ngClass]=\"{'blinker': item.blinker && item.blinker[column.field]}\">\r\n <a *ngIf=\"column.click\" href=\"javascript:;\"\r\n (click)=\"column.click(item[column.field], item)\">{{item[column.field] | valueTransform:item:column}}</a>\r\n <ng-container *ngIf=\"!column.click\">{{item[column.field] | valueTransform:item:column}}</ng-container>\r\n </span>\r\n <ng-container *ngIf=\"column.commands | columnCommandFilter:item | async; $implicit as filteredColumnCommands\">\r\n <button *ngFor=\"let columnCommand of filteredColumnCommands\" (click)=\"columnCommand.click(item)\" type=\"button\"\r\n class=\"c-btn-icon\" [matTooltip]=\"columnCommand.title | commandTitle:item\">\r\n <i class=\"{{columnCommand.icon | commandIcon:item}}\" aria-hidden=\"true\"></i>\r\n </button>\r\n </ng-container>\r\n </div>\r\n <div *ngIf=\"column.type === 'color'\">\r\n <input disabled=\"true\" type=\"color\" class=\"form-control form-control-sm\" [(ngModel)]=\"item[column.field]\"\r\n (change)=\"column.editor?.change && column.editor.change(item)\">\r\n </div>\r\n <div *ngIf=\"column.type === 'number'\">\r\n <span [className]=\"item[column.field] | cellDesktopClassName:item:column\"\r\n [ngClass]=\"{'blinker': item.blinker && item.blinker[column.field]}\">\r\n <a *ngIf=\"column.click\" href=\"javascript:;\"\r\n (click)=\"column.click(item[column.field], item)\">{{item[column.field] | valueTransform:item:column}}</a>\r\n <ng-container *ngIf=\"!column.click\">\r\n {{item[column.field] | valueTransform:item:column}}</ng-container>\r\n </span>\r\n </div>\r\n <div *ngIf=\"column.type === 'date'\" class=\"text-center\" matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[column.field] | date:'dd/MM/yyyy'\">\r\n {{item[column.field] | sdTimeDifferent:'dd/MM/yyyy':column.timeDifferent | async}}\r\n </div>\r\n <div *ngIf=\"column.type === 'datetime'\" class=\"text-center\" matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[column.field] | date:'dd/MM/yyyy HH:mm'\">\r\n {{item[column.field] | sdTimeDifferent:'dd/MM/yyyy HH:mm':column.timeDifferent | async}}\r\n </div>\r\n <div *ngIf=\"column.type === 'time'\" class=\"text-center\">\r\n {{item[column.field] | date:'HH:mm'}}\r\n </div>\r\n <div class=\"align-middle text-center\" *ngIf=\"column.type === 'bool'\">\r\n <span *ngIf=\"!item.editorHandler[column.field].visible && item[column.field]\"\r\n class=\"status status-success\">{{column.trueValue || 'True'}}</span>\r\n <span *ngIf=\"!item.editorHandler[column.field].visible && !item[column.field]\"\r\n class=\"status status-danger\">{{column.falseValue || 'False'}}</span>\r\n </div>\r\n <div *ngIf=\"column.type === 'values'\">\r\n <ng-container *ngIf=\"item[column.field] | columnValues:column.values; $implicit as valueData\">\r\n <div *ngIf=\"valueData.color || valueData.backgroundColor; else elseNoStatus\" class=\"status\"\r\n [ngStyle]=\"{'color':valueData.color, 'background-color': valueData.backgroundColor}\">\r\n {{valueData.text}}\r\n </div>\r\n <ng-template #elseNoStatus>\r\n <div class=\"text-left\">\r\n {{valueData.text}}\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n </div>\r\n <div *ngIf=\"column.type === 'radio'\">\r\n {{item[column.field]}}\r\n </div>\r\n <div class=\"align-middle text-center\" *ngIf=\"column.type === 'image'\">\r\n <img *ngIf=\"item[column.field]\" [src]=\"item[column.field]\" [width]=\"column.display?.width\"\r\n [height]=\"column.display?.height\" style=\"margin: 5px 0;object-fit: contain;\"\r\n (click)=\"column.click && column.click(item[column.field], item)\" [ngClass]=\"{'c-clickable':column.click}\">\r\n <i *ngIf=\"!item[column.field]\" class=\"fa fa-picture-o fa-fw c-img\" [ngClass]=\"{'c-clickable':column.click}\"\r\n (click)=\"column.click && column.click(item[column.field], item)\"></i>\r\n </div>\r\n </ng-template>\r\n</ng-container>",
|
|
2071
|
+
styles: [".text-black400{color:#757575}.c-badge{border-radius:10rem;display:block!important;font-size:12px;font-weight:500;margin:0 auto;max-width:80%;padding:.3rem!important}.c-badge a{color:#fff}.status{border-radius:1.5rem;display:inline-block;font-weight:500;padding:4px 8px;text-align:center;text-transform:uppercase;width:100%}.status-success{color:#4caf50}.status-danger{color:#f82c13}.c-btn-icon{background:none!important;border:none;display:inline-flex;height:20px;opacity:.8;padding:0 3px}.c-btn-icon:hover{cursor:pointer;opacity:1}.c-btn-icon:disabled{background:none!important;border:none;cursor:not-allowed;opacity:.3}.c-clickable{cursor:pointer}.c-img{font-size:30px;opacity:.5}.c-img.c-clickable:hover{opacity:.9}"]
|
|
2072
|
+
},] }
|
|
2073
|
+
];
|
|
2074
|
+
SdGridDesktopColumnView.ctorParameters = () => [];
|
|
2075
|
+
SdGridDesktopColumnView.propDecorators = {
|
|
2076
|
+
column: [{ type: Input }],
|
|
2077
|
+
item: [{ type: Input }]
|
|
2078
|
+
};
|
|
2079
|
+
|
|
2080
|
+
class SdGridDesktopInlineFilter {
|
|
2081
|
+
constructor() {
|
|
2082
|
+
this.columns = [];
|
|
2083
|
+
this.externalFilter = {};
|
|
2084
|
+
this.filter = {};
|
|
2085
|
+
this.inlineExternal = {};
|
|
2086
|
+
this.inlineColumn = {};
|
|
2087
|
+
this.sdChange = new EventEmitter();
|
|
2088
|
+
this.displayKey = 'SDCUSTOM';
|
|
2089
|
+
this.onUpdateFilter = () => {
|
|
2090
|
+
this.sdChange.emit();
|
|
2091
|
+
};
|
|
2092
|
+
}
|
|
2093
|
+
}
|
|
2094
|
+
SdGridDesktopInlineFilter.decorators = [
|
|
2095
|
+
{ type: Component, args: [{
|
|
2096
|
+
selector: 'sd-grid-desktop-inline-filter',
|
|
2097
|
+
template: "<ng-container *ngIf=\"filterOption?.multiple !== false\">\r\n <ng-container *ngIf=\"columns?.length && filterOption?.columnInline === 'outside'\">\r\n <ng-container *ngFor=\"let item of columns\">\r\n <ng-container\r\n *ngIf=\"item.type !== 'children' && item.type !== 'image' && !item?.filter?.disabled && item.priority !== 'low'\">\r\n <ng-container *ngIf=\"inlineColumn[item.field] || inlineColumn[item.field] === undefined\">\r\n <div class=\"col-lg-2 col-md-3 col-sm-6 px-4\">\r\n <sd-input [label]=\"item.title\" *ngIf=\"item.type === 'string'\" type=\"text\" [(model)]=\"filter[item.field]\"\r\n (keyupEnter)=\"onUpdateFilter()\">\r\n </sd-input>\r\n <sd-input-currency [label]=\"item.title\" *ngIf=\"item.type === 'number'\" [(model)]=\"filter[item.field]\"\r\n (keyupEnter)=\"onUpdateFilter()\">\r\n </sd-input-currency>\r\n <sd-select [label]=\"item.title\" *ngIf=\"item.type === 'bool'\" [items]=\"[{value:'1',display:item.trueValue || 'True' },\r\n {value:'0',display:item.falseValue || 'False' }]\" valueField=\"value\" displayField=\"display\"\r\n [(model)]=\"filter[item.field]\" (sdChange)=\"onUpdateFilter()\">\r\n </sd-select>\r\n <sd-select [label]=\"item.title\" *ngIf=\"item.type === 'radio'\" [items]=\"item.values\"\r\n [valueField]=\"item.valueField\" [displayField]=\"item.displayField\" [(model)]=\"filter[item.field]\"\r\n (sdChange)=\"onUpdateFilter()\">\r\n </sd-select>\r\n <sd-select *ngIf=\"item.type === 'values' && !item?.editor?.autocomplete\" [label]=\"item.title\"\r\n [items]=\"item.values\" valueField=\"value\" displayField=\"text\" [(model)]=\"filter[item.field]\"\r\n (sdChange)=\"onUpdateFilter()\">\r\n </sd-select>\r\n <sd-autocomplete *ngIf=\"item.type === 'values' && item?.editor?.autocomplete\" [items]=\"item.values\"\r\n valueField=\"value\" displayField=\"text\" [(model)]=\"filter[item.field]\" (sdChange)=\"onUpdateFilter()\">\r\n </sd-autocomplete>\r\n <sd-date-time *ngIf=\"item.type === 'date' || item.type === 'datetime' || item.type === 'time'\"\r\n [label]=\"item.title\" [(model)]=\"filter[item.field]\" type=\"date\" (sdChange)=\"onUpdateFilter()\">\r\n </sd-date-time>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container\r\n *ngIf=\"item.type === 'children' && item.children?.length && !item?.filter?.disabled && item.priority !== 'low'\">\r\n <ng-container *ngFor=\"let childColumn of item.children\">\r\n <ng-container\r\n *ngIf=\"inlineColumn[childColumn.field] && !childColumn?.filter?.disabled && childColumn.priority !== 'low' && childColumn.type !== 'image'\">\r\n <div class=\"col-lg-2 col-md-3 col-sm-6 px-4\">\r\n <sd-input [label]=\"childColumn.title\" *ngIf=\"childColumn.type === 'string'\" type=\"text\"\r\n [(model)]=\"filter[childColumn.field]\" (keyupEnter)=\"onUpdateFilter()\">\r\n </sd-input>\r\n <sd-input-currency [label]=\"childColumn.title\" *ngIf=\"childColumn.type === 'number'\"\r\n [(model)]=\"filter[childColumn.field]\" (keyupEnter)=\"onUpdateFilter()\">\r\n </sd-input-currency>\r\n <sd-select [label]=\"childColumn.title\" *ngIf=\"childColumn.type === 'bool'\" [items]=\"[{value:'1',display:childColumn.trueValue || 'True' },\r\n {value:'0',display:childColumn.falseValue || 'False' }]\" valueField=\"value\" displayField=\"display\"\r\n [(model)]=\"filter[childColumn.field]\" (sdChange)=\"onUpdateFilter()\">\r\n </sd-select>\r\n <sd-select [label]=\"childColumn.title\" *ngIf=\"childColumn.type === 'radio'\" [items]=\"childColumn.values\"\r\n [valueField]=\"childColumn.valueField\" [displayField]=\"childColumn.displayField\"\r\n [(model)]=\"filter[childColumn.field]\" (sdChange)=\"onUpdateFilter()\">\r\n </sd-select>\r\n <sd-select *ngIf=\"childColumn.type === 'values' && !item?.editor?.autocomplete\"\r\n [label]=\"childColumn.title\" [items]=\"childColumn.values\" valueField=\"value\" displayField=\"text\"\r\n [(model)]=\"filter[childColumn.field]\" (sdChange)=\"onUpdateFilter()\">\r\n </sd-select>\r\n <sd-autocomplete *ngIf=\"childColumn.type === 'values' && item?.editor?.autocomplete\"\r\n [items]=\"childColumn.values\" valueField=\"value\" displayField=\"text\"\r\n [(model)]=\"filter[childColumn.field]\" (sdChange)=\"onUpdateFilter()\">\r\n </sd-autocomplete>\r\n <sd-date-time\r\n *ngIf=\"childColumn.type === 'date' || childColumn.type === 'datetime' || childColumn.type === 'time'\"\r\n [label]=\"childColumn.title\" [(model)]=\"filter[childColumn.field]\" type=\"date\"\r\n (sdChange)=\"onUpdateFilter()\">\r\n </sd-date-time>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"filterOption?.externalFilters?.length\">\r\n <ng-container *ngFor=\"let item of filterOption.externalFilters\">\r\n <ng-container\r\n *ngIf=\"(inlineExternal[item.field] || inlineExternal[item.field] === undefined) && item.priority !== 'low'\">\r\n <div *ngIf=\"item.type !=='daterange' && item.type !=='numberrange';else elseFilterRange\"\r\n class=\"col-lg-2 col-md-3 col-sm-6 px-4\">\r\n <sd-input [label]=\"item.title\" *ngIf=\"item.type === 'string'\" type=\"text\"\r\n [(model)]=\"externalFilter[item.field]\" (keyupEnter)=\"onUpdateFilter()\">\r\n </sd-input>\r\n <sd-input-currency [label]=\"item.title\" *ngIf=\"item.type === 'number'\" [(model)]=\"externalFilter[item.field]\"\r\n (keyupEnter)=\"onUpdateFilter()\">\r\n </sd-input-currency>\r\n <sd-select [label]=\"item.title\" *ngIf=\"item.type === 'bool'\" [items]=\"[{value:'1',display:item.trueValue || 'True' },\r\n {value:'0',display:item.falseValue || 'False' }]\" valueField=\"value\" displayField=\"display\"\r\n [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onUpdateFilter()\">\r\n </sd-select>\r\n <sd-select [label]=\"item.title\" *ngIf=\"item.type === 'radio'\" [items]=\"item.values\"\r\n [valueField]=\"item.valueField\" [displayField]=\"item.displayField\" [(model)]=\"externalFilter[item.field]\"\r\n (sdChange)=\"onUpdateFilter()\">\r\n </sd-select>\r\n <sd-input [label]=\"item.title\" *ngIf=\"item.type === 'custom'\"\r\n [(model)]=\"externalFilter[displayKey + item.field]\"\r\n (sdFocusForceBlur)=\"item?.onClick(externalFilter, item.field, displayKey + item.field)\"\r\n (sdChange)=\"onUpdateFilter()\">\r\n </sd-input>\r\n <ng-container *ngIf=\"item.type === 'values'\">\r\n <sd-select *ngIf=\"item.selection === 'MULTIPLE'\" [label]=\"item.title\" [items]=\"item.values\"\r\n [valueField]=\"item.valueField\" [displayField]=\"item.displayField\" [(model)]=\"externalFilter[item.field]\"\r\n (sdChange)=\"onUpdateFilter()\" multiple=\"true\">\r\n </sd-select>\r\n <sd-autocomplete *ngIf=\"item.selection === 'AUTOCOMPLETE'\" [label]=\"item.title\" [items]=\"item.values\"\r\n [valueField]=\"item.valueField\" [displayField]=\"item.displayField\" [(model)]=\"externalFilter[item.field]\"\r\n (sdChange)=\"onUpdateFilter()\">\r\n </sd-autocomplete>\r\n <sd-select *ngIf=\"item.selection === 'MULTIPLEAUTOCOMPLETE'\" [label]=\"item.title\" [items]=\"item.values\"\r\n [valueField]=\"item.valueField\" [displayField]=\"item.displayField\" [(model)]=\"externalFilter[item.field]\"\r\n (sdChange)=\"onUpdateFilter()\" filtered=\"true\" multiple=\"true\">\r\n </sd-select>\r\n <sd-select *ngIf=\"!item.selection\" [label]=\"item.title\" [items]=\"item.values\" [valueField]=\"item.valueField\"\r\n [displayField]=\"item.displayField\" [(model)]=\"externalFilter[item.field]\" (sdChange)=\"onUpdateFilter()\">\r\n </sd-select>\r\n </ng-container>\r\n <sd-date-time [label]=\"item.title\" *ngIf=\"item.type ==='date'\" [(model)]=\"externalFilter[item.field]\"\r\n type=\"date\" (sdChange)=\"onUpdateFilter()\">\r\n </sd-date-time>\r\n <sd-date-range [label]=\"item.title\" *ngIf=\"item.type ==='daterangefull'\"\r\n [(from)]=\"externalFilter[item.field].from\" [(to)]=\"externalFilter[item.field].to\" [min]=\"item.minDate\"\r\n [max]=\"item.maxDate\" (sdChange)=\"onUpdateFilter()\">\r\n </sd-date-range>\r\n </div>\r\n <ng-template #elseFilterRange>\r\n <ng-container *ngIf=\"item.type ==='daterange' && externalFilter[item.field]\">\r\n <div class=\"col-lg-2 col-md-3 col-sm-6 px-4\">\r\n <sd-date-time [label]=\"item.fromTitle\" [(model)]=\"externalFilter[item.field].from\"\r\n [type]=\"item.enableTime ? 'datetime' : 'date'\" [minDate]=\"item.minDate\"\r\n [maxDate]=\"externalFilter[item.field].to || item.maxDate\" (sdChange)=\"onUpdateFilter()\">\r\n </sd-date-time>\r\n </div>\r\n <div class=\"col-lg-2 col-md-3 col-sm-6 px-4\">\r\n <sd-date-time [label]=\"item.toTitle\" [(model)]=\"externalFilter[item.field].to\"\r\n [type]=\"item.enableTime ? 'datetime' : 'date'\"\r\n [minDate]=\"item.minDate || externalFilter[item.field].from\" [maxDate]=\"item.maxDate\"\r\n (sdChange)=\"onUpdateFilter()\">\r\n </sd-date-time>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"item.type ==='numberrange' && externalFilter[item.field]\">\r\n <div class=\"col-lg-2 col-md-3 col-sm-6 px-4\">\r\n <sd-input [label]=\"item.fromTitle\" type=\" number\" [(model)]=\"externalFilter[item.field].from\"\r\n (sdChange)=\"onUpdateFilter()\">\r\n </sd-input>\r\n </div>\r\n <div class=\"col-lg-2 col-md-3 col-sm-6 px-4\">\r\n <sd-input [label]=\"item.toTitle\" type=\" number\" [(model)]=\"externalFilter[item.field].to\"\r\n (sdChange)=\"onUpdateFilter()\">\r\n </sd-input>\r\n </div>\r\n </ng-container>\r\n </ng-template>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n</ng-container>",
|
|
2098
|
+
styles: [""]
|
|
2099
|
+
},] }
|
|
2100
|
+
];
|
|
2101
|
+
SdGridDesktopInlineFilter.ctorParameters = () => [];
|
|
2102
|
+
SdGridDesktopInlineFilter.propDecorators = {
|
|
2103
|
+
columns: [{ type: Input }],
|
|
2104
|
+
externalFilter: [{ type: Input }],
|
|
2105
|
+
filter: [{ type: Input }],
|
|
2106
|
+
filterOption: [{ type: Input }],
|
|
2107
|
+
inlineExternal: [{ type: Input }],
|
|
2108
|
+
inlineColumn: [{ type: Input }],
|
|
2109
|
+
sdChange: [{ type: Output }]
|
|
2110
|
+
};
|
|
2111
|
+
|
|
2112
|
+
class SdGridMobileItemView {
|
|
2113
|
+
constructor() {
|
|
2114
|
+
this.check = new EventEmitter();
|
|
2115
|
+
this.onCheck = (item) => {
|
|
2116
|
+
this.check.emit(item);
|
|
2117
|
+
};
|
|
2118
|
+
}
|
|
2119
|
+
}
|
|
2120
|
+
SdGridMobileItemView.decorators = [
|
|
2121
|
+
{ type: Component, args: [{
|
|
2122
|
+
selector: 'sd-grid-mobile-item-view',
|
|
2123
|
+
template: "<ng-container *ngIf=\"gridOption && item\">\r\n <ng-container *ngIf=\"gridOption?.mobileOrTablet?.htmlTemplate\">\r\n <div\r\n [innerHTML]=\"(item | mobileViewHtmlTempate:gridOption.columns:gridOption?.mobileOrTablet?.htmlTemplate) | safeHtml\"\r\n (click)=\"onCheck(item)\">\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"!gridOption?.mobileOrTablet?.htmlTemplate\">\r\n <ng-container *ngFor=\"let column of gridOption.columns | filterMobile:item\">\r\n <div *ngIf=\"column.type !== 'children'\" class=\"row c-row\" (click)=\"onCheck(item)\">\r\n <div class=\"col-5\">\r\n <span class=\"c-title\">\r\n {{item | columnTitle:column.title:column.dynamicTitle | async}}:\r\n </span>\r\n </div>\r\n <div class=\"col-7\">\r\n <ng-container *ngIf=\"column.type === 'string'\">\r\n <span *ngIf=\"!column.htmlTemplate; else elseUseTemplate\"\r\n [className]=\"item[column.field] | cellMobileClassName:item:column\">\r\n <a *ngIf=\"column.click\" href=\"javascript:;\"\r\n (click)=\"column.click(item[column.field], item)\">{{item[column.field]}}</a>\r\n <ng-container *ngIf=\"!column.click\">\r\n {{item[column.field]}}</ng-container>\r\n </span>\r\n <ng-template #elseUseTemplate>\r\n <span class=\"c-value\"\r\n [innerHTML]=\"(item[column.field] | columnHtmlTemplate:item:column.htmlTemplate) | safeHtml\"></span>\r\n </ng-template>\r\n <ng-container\r\n *ngIf=\"column.commands | columnCommandFilter:item | async; $implicit as filteredColumnCommands\">\r\n <button *ngFor=\"let columnCommand of filteredColumnCommands\" (click)=\"columnCommand.click(item)\"\r\n type=\"button\" class=\"c-btn-icon\" [matTooltip]=\"columnCommand.title | commandTitle:item\">\r\n <i class=\"{{columnCommand.icon | commandIcon:item}}\" aria-hidden=\"true\" style=\"font-size: 14px;\"></i>\r\n </button>\r\n </ng-container>\r\n </ng-container>\r\n <span *ngIf=\"column.type === 'number'\" [className]=\"item[column.field] | cellMobileClassName:item:column\">\r\n <a *ngIf=\"column.click\" href=\"javascript:;\"\r\n (click)=\"column.click(item[column.field], item)\">{{item[column.field] | valueTransform:item:column}}</a>\r\n <ng-container *ngIf=\"!column.click\">\r\n {{item[column.field] | valueTransform:item:column}}</ng-container>\r\n </span>\r\n <span *ngIf=\"column.type === 'datetime'\" [className]=\"item[column.field] | cellMobileClassName:item:column\">\r\n <a *ngIf=\"column.click\" href=\"javascript:;\"\r\n (click)=\"column.click(item[column.field], item)\">{{item[column.field] | date:'dd/MM/yyyy HH:mm'}}</a>\r\n <ng-container *ngIf=\"!column.click\">\r\n {{item[column.field] | date:'dd/MM/yyyy HH:mm'}}</ng-container>\r\n </span>\r\n <span *ngIf=\"column.type === 'date'\" [className]=\"item[column.field] | cellMobileClassName:item:column\">\r\n <a *ngIf=\"column.click\" href=\"javascript:;\"\r\n (click)=\"column.click(item[column.field], item)\">{{item[column.field] | date:'dd/MM/yyyy'}}</a>\r\n <ng-container *ngIf=\"!column.click\">\r\n {{item[column.field] | date:'dd/MM/yyyy'}}</ng-container>\r\n </span>\r\n <span *ngIf=\"column.type === 'time'\" [className]=\"item[column.field] | cellMobileClassName:item:column\">\r\n <a *ngIf=\"column.click\" href=\"javascript:;\"\r\n (click)=\"column.click(item[column.field], item)\">{{item[column.field] | date:'HH:mm'}}</a>\r\n <ng-container *ngIf=\"!column.click\">\r\n {{item[column.field] | date:'HH:mm'}}</ng-container>\r\n </span>\r\n <span *ngIf=\"column.type === 'bool'\" [className]=\"item[column.field] | cellMobileClassName:item:column\"\r\n (click)=\"column.click && column.click(item[column.field], item)\">\r\n <strong *ngIf=\"item[column.field]\"\r\n class=\"text-success\">{{column.trueValue || 'True'}}</strong>\r\n <strong *ngIf=\"!item[column.field]\"\r\n class=\"text-danger\">{{column.falseValue || 'False'}}</strong>\r\n </span>\r\n <span *ngIf=\"column.type === 'color'\" class=\"c-value\"><input disabled=\"true\" type=\"color\"\r\n class=\"form-control form-control-sm\" [(ngModel)]=\"item[column.field]\"></span>\r\n <ng-container *ngIf=\"column.type === 'values'\">\r\n <ng-container *ngIf=\"column?.dictionary[item[column.field]] as dic; else elseNotInDic\">\r\n <span *ngIf=\"dic.color || dic.backgroundColor; else elseNoStatus\" class=\"status c-status\"\r\n [ngStyle]=\"{'color':dic.color, 'background-color': dic.backgroundColor}\">\r\n {{dic.text}}\r\n </span>\r\n <ng-template #elseNoStatus>\r\n <span class=\"c-value\">\r\n {{dic.text}}\r\n </span>\r\n </ng-template>\r\n </ng-container>\r\n <ng-template #elseNotInDic>\r\n <span class=\"c-value\">\r\n {{item[column.field]}}\r\n </span>\r\n </ng-template>\r\n </ng-container>\r\n <span *ngIf=\"column.type === 'radio'\" class=\"c-value\">{{item[column.field]}}</span>\r\n <img *ngIf=\"column.type === 'image'\" [src]=\"item[column.field]\" [width]=\"column.display?.width\"\r\n [height]=\"column.display?.height\" style=\"margin: 5px 0\"\r\n (click)=\"column.click && column.click(item[column.field], item)\">\r\n </div>\r\n </div>\r\n <ng-container *ngIf=\"column.type === 'children' && column.children?.length\">\r\n <div class=\"row c-row\" *ngFor=\"let childColumn of column.children | filterMobile:item\" (click)=\"onCheck(item)\">\r\n <div class=\"col-5\">\r\n <span class=\"c-title\">\r\n {{childColumn.title}}:\r\n </span>\r\n </div>\r\n <div class=\"col-7\">\r\n <ng-container *ngIf=\"childColumn.type === 'string'\">\r\n <span *ngIf=\"!childColumn.htmlTemplate; else elseUseTemplate\"\r\n [className]=\"item[childColumn.field] | cellMobileClassName:item:childColumn\"><a\r\n *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field]}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n {{item[childColumn.field]}}</ng-container>\r\n </span>\r\n <ng-template #elseUseTemplate>\r\n <span class=\"c-value\"\r\n [innerHTML]=\"(item[childColumn.field] | columnHtmlTemplate:item:childColumn.htmlTemplate) | safeHtml\"></span>\r\n </ng-template>\r\n </ng-container>\r\n <span *ngIf=\"childColumn.type === 'number'\"\r\n [className]=\"item[childColumn.field] | cellMobileClassName:item:childColumn\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] | valueTransform:item:childColumn}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n {{item[childColumn.field] | valueTransform:item:childColumn}}</ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'datetime'\"\r\n [className]=\"item[childColumn.field] | cellMobileClassName:item:childColumn\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] | date:'dd/MM/yyyy HH:mm'}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n {{item[childColumn.field] | date:'dd/MM/yyyy HH:mm'}}</ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'date'\"\r\n [className]=\"item[childColumn.field] | cellMobileClassName:item:childColumn\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] | date:'dd/MM/yyyy'}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n {{item[childColumn.field] | date:'dd/MM/yyyy'}}</ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'time'\"\r\n [className]=\"item[childColumn.field] | cellMobileClassName:item:childColumn\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] | date:'HH:mm'}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n {{item[childColumn.field] | date:'HH:mm'}}</ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'bool'\"\r\n [className]=\"item[childColumn.field] | cellMobileClassName:item:childColumn\"\r\n (click)=\"childColumn.click && childColumn.click(item[childColumn.field], item)\">\r\n <strong *ngIf=\"item[childColumn.field]\"\r\n class=\"text-success\">{{childColumn.trueValue || 'True'}}</strong>\r\n <strong *ngIf=\"!item[childColumn.field]\"\r\n class=\"text-danger\">{{childColumn.falseValue || 'False'}}</strong>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'color'\"\r\n [className]=\"item[childColumn.field] | cellMobileClassName:item:childColumn\"\r\n (click)=\"childColumn.click && childColumn.click(item[childColumn.field], item)\"><input disabled=\"true\"\r\n type=\"color\" class=\"form-control form-control-sm\" [(ngModel)]=\"item[childColumn.field]\"></span>\r\n <ng-container *ngIf=\"childColumn.type === 'values'\">\r\n <ng-container *ngIf=\"childColumn?.dictionary[item[childColumn.field]] as dic; else elseNotInDic\">\r\n <span *ngIf=\"dic.color || dic.backgroundColor; else elseNoStatus\" class=\"status c-status\"\r\n [ngStyle]=\"{'color':dic.color, 'background-color': dic.backgroundColor}\">\r\n {{dic.text}}\r\n </span>\r\n <ng-template #elseNoStatus>\r\n <span class=\"c-value\">\r\n {{dic.text}}\r\n </span>\r\n </ng-template>\r\n </ng-container>\r\n <ng-template #elseNotInDic>\r\n <span class=\"c-value\">\r\n {{item[childColumn.field]}}\r\n </span>\r\n </ng-template>\r\n </ng-container>\r\n <span *ngIf=\"childColumn.type === 'radio'\" class=\"c-value\">{{item[childColumn.field]}}</span>\r\n <img *ngIf=\"childColumn.type === 'image'\" [src]=\"item[childColumn.field]\"\r\n [width]=\"childColumn.display?.width\" [height]=\"childColumn.display?.height\" style=\"margin: 5px 0\"\r\n (click)=\"column.click && column.click(item[column.field], item)\">\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n</ng-container>",
|
|
2124
|
+
styles: [".c-status{display:inline-block;font-weight:500;text-align:left;text-transform:uppercase}.c-row{margin:0 -8px 3px}.c-title{font-weight:700;margin-right:3px}.c-title,.c-value{color:#212529;font-size:14px}.c-value{overflow-wrap:break-word}.c-badge{font-size:14px;font-weight:500;padding:5px!important}"]
|
|
2125
|
+
},] }
|
|
2126
|
+
];
|
|
2127
|
+
SdGridMobileItemView.ctorParameters = () => [];
|
|
2128
|
+
SdGridMobileItemView.propDecorators = {
|
|
2129
|
+
gridOption: [{ type: Input }],
|
|
2130
|
+
item: [{ type: Input }],
|
|
2131
|
+
check: [{ type: Output }]
|
|
2132
|
+
};
|
|
2133
|
+
|
|
2134
|
+
class SdGridPopupEditor {
|
|
2135
|
+
constructor() {
|
|
2136
|
+
this.save = new EventEmitter();
|
|
2137
|
+
this.columns = [];
|
|
2138
|
+
this.open = (item, columns, isModified) => {
|
|
2139
|
+
this.item = item;
|
|
2140
|
+
this.isModified = isModified !== null && isModified !== void 0 ? isModified : false;
|
|
2141
|
+
this.columns = [];
|
|
2142
|
+
columns.forEach(column => {
|
|
2143
|
+
var _a;
|
|
2144
|
+
if (column.type !== 'image' && column.type !== 'children') {
|
|
2145
|
+
this.columns.push(column);
|
|
2146
|
+
}
|
|
2147
|
+
if (column.type === 'children') {
|
|
2148
|
+
(_a = column.children) === null || _a === void 0 ? void 0 : _a.forEach(childColumn => {
|
|
2149
|
+
if (childColumn.type !== 'image') {
|
|
2150
|
+
this.columns.push(childColumn);
|
|
2151
|
+
}
|
|
2152
|
+
});
|
|
2153
|
+
}
|
|
2154
|
+
});
|
|
2155
|
+
};
|
|
2156
|
+
this.onCancel = () => {
|
|
2157
|
+
this.modal.close();
|
|
2158
|
+
};
|
|
2159
|
+
this.onSave = () => {
|
|
2160
|
+
this.modal.close();
|
|
2161
|
+
this.save.emit(this.item);
|
|
2162
|
+
};
|
|
2163
|
+
}
|
|
2164
|
+
ngOnInit() {
|
|
2165
|
+
}
|
|
2166
|
+
}
|
|
2167
|
+
SdGridPopupEditor.decorators = [
|
|
2168
|
+
{ type: Component, args: [{
|
|
2169
|
+
selector: 'sd-grid-popup-editor',
|
|
2170
|
+
template: "<sd-modal [title]=\"(isModified ? 'Edit' : 'Create')\" width=\"sm\" #modal>\r\n <sd-modal-body *ngIf=\"item && columns?.length\">\r\n <form #formEditor=\"ngForm\">\r\n <ng-container *ngFor=\"let column of columns\">\r\n <div *ngIf=\"column | editorPopupVisible:item\" class=\"row\">\r\n <div class=\"col-12\">\r\n <sd-input *ngIf=\"column.type === 'string'\" [(model)]=\"item[column.field]\"></sd-input>\r\n <sd-input-currency *ngIf=\"column.type === 'number'\" [(model)]=\"item[column.field]\">\r\n </sd-input-currency>\r\n <sd-select *ngIf=\"column.type === 'values'\" [(model)]=\"item[column.field]\" [items]=\"column.values\">\r\n </sd-select>\r\n <sd-switch *ngIf=\"column.type === 'boolean'\" [(model)]=\"item[column.field]\">\r\n </sd-switch>\r\n <sd-select *ngIf=\"column.type === 'radio'\" [(model)]=\"item[column.field]\" [items]=\"column.values\">\r\n </sd-select>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </form>\r\n </sd-modal-body>\r\n <sd-modal-footer *sdDesktop>\r\n <sd-button class=\"mr-auto\" (action)=\"onCancel()\" icon=\"close\" [title]=\"'Cancel' | sdTranslate\" size=\"sm\">\r\n </sd-button>\r\n <sd-button (action)=\"onSave()\" icon=\"save\" [title]=\"'Save' | sdTranslate\" color=\"primary\" size=\"sm\"></sd-button>\r\n </sd-modal-footer>\r\n <sd-modal-footer *sdMobileTablet>\r\n <sd-button style=\"flex: 1; padding-right: 5px;\" (action)=\"onCancel()\" icon=\"close\" [title]=\"'Cancel' | sdTranslate\"\r\n width=\"100%\" size=\"sm\"></sd-button>\r\n <sd-button style=\"flex: 1; padding-left: 5px;\" (action)=\"onSave()\" icon=\"save\" [title]=\"'Save' | sdTranslate\"\r\n color=\"primary\" width=\"100%\" size=\"sm\"></sd-button>\r\n </sd-modal-footer>\r\n</sd-modal>"
|
|
2171
|
+
},] }
|
|
2172
|
+
];
|
|
2173
|
+
SdGridPopupEditor.ctorParameters = () => [];
|
|
2174
|
+
SdGridPopupEditor.propDecorators = {
|
|
2175
|
+
modal: [{ type: ViewChild, args: ['modal',] }],
|
|
2176
|
+
save: [{ type: Output }]
|
|
2177
|
+
};
|
|
2178
|
+
|
|
2179
|
+
class SdGridPopupExportExcel {
|
|
2180
|
+
constructor(ref, loadingService, excelService, notifyService, translateService) {
|
|
2181
|
+
this.ref = ref;
|
|
2182
|
+
this.loadingService = loadingService;
|
|
2183
|
+
this.excelService = excelService;
|
|
2184
|
+
this.notifyService = notifyService;
|
|
2185
|
+
this.translateService = translateService;
|
|
2186
|
+
this.prefix = 'Popup Export Excel';
|
|
2187
|
+
this.newExcelConfig = 'fd8fb5db-a7ad-4398-93ac-cb3350261180';
|
|
2188
|
+
this.key = '';
|
|
2189
|
+
this.columns = [];
|
|
2190
|
+
this.extendColumns = [];
|
|
2191
|
+
this.excelConfigs = [];
|
|
2192
|
+
this.exportByTemplate = new EventEmitter();
|
|
2193
|
+
this.tabIndex = 0;
|
|
2194
|
+
this.selectedExcelConfig = {};
|
|
2195
|
+
this.exportableColumns = [];
|
|
2196
|
+
this.selected = {};
|
|
2197
|
+
this.generateExcelColumns = (columns) => {
|
|
2198
|
+
const excelColumns = [];
|
|
2199
|
+
for (const column of columns) {
|
|
2200
|
+
if (column.type === 'children') {
|
|
2201
|
+
for (const childColumn of column.children) {
|
|
2202
|
+
if (childColumn.type !== 'image') {
|
|
2203
|
+
excelColumns.push({
|
|
2204
|
+
field: childColumn.field,
|
|
2205
|
+
title: childColumn.title,
|
|
2206
|
+
description: childColumn.description,
|
|
2207
|
+
width: childColumn.width
|
|
2208
|
+
});
|
|
2209
|
+
}
|
|
2210
|
+
}
|
|
2211
|
+
}
|
|
2212
|
+
else if (column.type !== 'image') {
|
|
2213
|
+
excelColumns.push({
|
|
2214
|
+
field: column.field,
|
|
2215
|
+
title: column.title,
|
|
2216
|
+
description: column.description,
|
|
2217
|
+
width: column.width
|
|
2218
|
+
});
|
|
2219
|
+
}
|
|
2220
|
+
}
|
|
2221
|
+
return excelColumns;
|
|
2222
|
+
};
|
|
2223
|
+
this.initTemplate = (columns, fileName) => __awaiter(this, void 0, void 0, function* () {
|
|
2224
|
+
var _a;
|
|
2225
|
+
columns = columns || [];
|
|
2226
|
+
const sheets = [];
|
|
2227
|
+
if (Array.isArray((_a = this.exportOption) === null || _a === void 0 ? void 0 : _a.sheets)) {
|
|
2228
|
+
for (const sheet of this.exportOption.sheets) {
|
|
2229
|
+
if (sheet.name && sheet.items && sheet.fields) {
|
|
2230
|
+
if (Array.isArray(sheet.items)) {
|
|
2231
|
+
sheets.push({
|
|
2232
|
+
name: sheet.name,
|
|
2233
|
+
items: sheet.items,
|
|
2234
|
+
fields: sheet.fields
|
|
2235
|
+
});
|
|
2236
|
+
}
|
|
2237
|
+
else {
|
|
2238
|
+
sheets.push({
|
|
2239
|
+
name: sheet.name,
|
|
2240
|
+
items: yield sheet.items(),
|
|
2241
|
+
fields: sheet.fields
|
|
2242
|
+
});
|
|
2243
|
+
}
|
|
2244
|
+
}
|
|
2245
|
+
}
|
|
2246
|
+
}
|
|
2247
|
+
return yield this.excelService.generateExcelTemplate({
|
|
2248
|
+
fileName: fileName || this.fileName,
|
|
2249
|
+
columns: this.generateExcelColumns(columns),
|
|
2250
|
+
sheets
|
|
2251
|
+
});
|
|
2252
|
+
});
|
|
2253
|
+
this.initDefaultTemplate = () => __awaiter(this, void 0, void 0, function* () {
|
|
2254
|
+
const extendColumns = this.extendColumns || [];
|
|
2255
|
+
const columns = [...this.columns, ...extendColumns];
|
|
2256
|
+
return yield this.initTemplate(columns);
|
|
2257
|
+
});
|
|
2258
|
+
this.generateTemplate = () => __awaiter(this, void 0, void 0, function* () {
|
|
2259
|
+
this.loadingService.start();
|
|
2260
|
+
const result = yield this.initDefaultTemplate().finally(this.loadingService.stop);
|
|
2261
|
+
if (result === null || result === void 0 ? void 0 : result.filePath) {
|
|
2262
|
+
this.excelService.downloadTemplate(result.filePath, `${this.fileName}.xlsx`);
|
|
2263
|
+
}
|
|
2264
|
+
});
|
|
2265
|
+
this.generateAndUploadTemplate = (columns, fileName) => __awaiter(this, void 0, void 0, function* () {
|
|
2266
|
+
var _b;
|
|
2267
|
+
const sheets = [];
|
|
2268
|
+
if (Array.isArray((_b = this.exportOption) === null || _b === void 0 ? void 0 : _b.sheets)) {
|
|
2269
|
+
for (const sheet of this.exportOption.sheets) {
|
|
2270
|
+
if (sheet.name && sheet.items && sheet.fields) {
|
|
2271
|
+
if (Array.isArray(sheet.items)) {
|
|
2272
|
+
sheets.push({
|
|
2273
|
+
name: sheet.name,
|
|
2274
|
+
items: sheet.items,
|
|
2275
|
+
fields: sheet.fields
|
|
2276
|
+
});
|
|
2277
|
+
}
|
|
2278
|
+
else {
|
|
2279
|
+
sheets.push({
|
|
2280
|
+
name: sheet.name,
|
|
2281
|
+
items: yield sheet.items(),
|
|
2282
|
+
fields: sheet.fields
|
|
2283
|
+
});
|
|
2284
|
+
}
|
|
2285
|
+
}
|
|
2286
|
+
}
|
|
2287
|
+
}
|
|
2288
|
+
return yield this.excelService.generateAndUploadExcelTemplate(this.fullKey, {
|
|
2289
|
+
fileName: fileName || this.fileName,
|
|
2290
|
+
columns: this.generateExcelColumns(columns),
|
|
2291
|
+
sheets
|
|
2292
|
+
});
|
|
2293
|
+
});
|
|
2294
|
+
this.onExportByTemplate = (excelConfig) => {
|
|
2295
|
+
const extendColumns = this.extendColumns || [];
|
|
2296
|
+
const columns = [...this.columns, ...extendColumns];
|
|
2297
|
+
this.exportByTemplate.emit({
|
|
2298
|
+
excelConfig,
|
|
2299
|
+
excelColumns: this.generateExcelColumns(columns)
|
|
2300
|
+
});
|
|
2301
|
+
this.ref.detectChanges();
|
|
2302
|
+
};
|
|
2303
|
+
this.uploadTemplate = () => __awaiter(this, void 0, void 0, function* () {
|
|
2304
|
+
const excelConfig = yield this.excelService.uploadTemplate(this.fullKey, this.validator);
|
|
2305
|
+
this.excelConfigs.push({
|
|
2306
|
+
name: excelConfig.name,
|
|
2307
|
+
fullPath: excelConfig.fullPath,
|
|
2308
|
+
removable: true
|
|
2309
|
+
});
|
|
2310
|
+
this.ref.detectChanges();
|
|
2311
|
+
});
|
|
2312
|
+
this.downloadTemplate = (excelConfig) => {
|
|
2313
|
+
this.excelService.downloadTemplate(excelConfig.fullPath, excelConfig.name);
|
|
2314
|
+
};
|
|
2315
|
+
this.removeTemplate = (excelConfig) => {
|
|
2316
|
+
this.notifyService.confirm(this.translateService.translate('Remove template')).then(() => __awaiter(this, void 0, void 0, function* () {
|
|
2317
|
+
this.loadingService.start();
|
|
2318
|
+
yield this.excelService.remove(this.fullKey, excelConfig.name).finally(this.loadingService.stop);
|
|
2319
|
+
const idx = this.excelConfigs.indexOf(excelConfig);
|
|
2320
|
+
this.excelConfigs.splice(idx, 1);
|
|
2321
|
+
this.ref.detectChanges();
|
|
2322
|
+
}));
|
|
2323
|
+
};
|
|
2324
|
+
this.exportDefault = () => __awaiter(this, void 0, void 0, function* () {
|
|
2325
|
+
this.loadingService.start();
|
|
2326
|
+
const result = yield this.initDefaultTemplate().finally(this.loadingService.stop);
|
|
2327
|
+
const excelColumns = [];
|
|
2328
|
+
const extendColumns = this.extendColumns || [];
|
|
2329
|
+
const columns = [...this.columns, ...extendColumns];
|
|
2330
|
+
for (const column of columns) {
|
|
2331
|
+
if (column.type === 'children') {
|
|
2332
|
+
for (const childColumn of column.children) {
|
|
2333
|
+
if (childColumn.type !== 'image') {
|
|
2334
|
+
excelColumns.push({
|
|
2335
|
+
field: childColumn.field,
|
|
2336
|
+
title: childColumn.title,
|
|
2337
|
+
width: childColumn.width
|
|
2338
|
+
});
|
|
2339
|
+
}
|
|
2340
|
+
}
|
|
2341
|
+
}
|
|
2342
|
+
else if (column.type !== 'image') {
|
|
2343
|
+
excelColumns.push({
|
|
2344
|
+
field: column.field,
|
|
2345
|
+
title: column.title,
|
|
2346
|
+
width: column.width
|
|
2347
|
+
});
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
this.exportByTemplate.emit({
|
|
2351
|
+
excelConfig: {
|
|
2352
|
+
fullPath: result.filePath,
|
|
2353
|
+
name: `[${this.fullKey}] Default.xlsx`
|
|
2354
|
+
},
|
|
2355
|
+
excelColumns
|
|
2356
|
+
});
|
|
2357
|
+
this.ref.detectChanges();
|
|
2358
|
+
});
|
|
2359
|
+
this.newTemplate = () => {
|
|
2360
|
+
this.notifyService.confirmWithInput(this.translateService.translate('Enter your template name'), {
|
|
2361
|
+
maxlength: 50
|
|
2362
|
+
}).then((fileName) => __awaiter(this, void 0, void 0, function* () {
|
|
2363
|
+
var _a;
|
|
2364
|
+
this.loadingService.start();
|
|
2365
|
+
fileName = fileName + '.xlsx';
|
|
2366
|
+
try {
|
|
2367
|
+
if ((_a = this.validator) === null || _a === void 0 ? void 0 : _a.call(this, fileName)) {
|
|
2368
|
+
this.notifyService.notify.warning(this.validator(fileName));
|
|
2369
|
+
return;
|
|
2370
|
+
}
|
|
2371
|
+
let exportableColumns = this.exportableColumns.filter(column => this.selected[column.field]);
|
|
2372
|
+
if (!exportableColumns.length) {
|
|
2373
|
+
exportableColumns = this.exportableColumns;
|
|
2374
|
+
}
|
|
2375
|
+
const result = yield this.generateAndUploadTemplate(exportableColumns, fileName);
|
|
2376
|
+
if (result === null || result === void 0 ? void 0 : result.filePath) {
|
|
2377
|
+
const excelConfig = {
|
|
2378
|
+
fullPath: result.filePath,
|
|
2379
|
+
name: result.fileName,
|
|
2380
|
+
removable: true
|
|
2381
|
+
};
|
|
2382
|
+
this.excelConfigs.push(excelConfig);
|
|
2383
|
+
this.onExportByTemplate(excelConfig);
|
|
2384
|
+
}
|
|
2385
|
+
}
|
|
2386
|
+
finally {
|
|
2387
|
+
this.loadingService.stop();
|
|
2388
|
+
}
|
|
2389
|
+
}));
|
|
2390
|
+
};
|
|
2391
|
+
this.onChangeRadio = (matRadioChange) => {
|
|
2392
|
+
const selectedExcelConfig = this.excelConfigs.find(e => e.name === matRadioChange.value);
|
|
2393
|
+
if (!selectedExcelConfig) {
|
|
2394
|
+
this.selectedExcelConfig = {
|
|
2395
|
+
name: this.newExcelConfig
|
|
2396
|
+
};
|
|
2397
|
+
}
|
|
2398
|
+
else {
|
|
2399
|
+
this.selectedExcelConfig = selectedExcelConfig;
|
|
2400
|
+
}
|
|
2401
|
+
this.exportableColumns = [...this.columns, ...(this.extendColumns || [])].filter(e => e.type !== 'image');
|
|
2402
|
+
this.selected = {};
|
|
2403
|
+
};
|
|
2404
|
+
}
|
|
2405
|
+
get fullKey() {
|
|
2406
|
+
if (!this.key) {
|
|
2407
|
+
return '';
|
|
2408
|
+
}
|
|
2409
|
+
return hash({
|
|
2410
|
+
prefix: this.prefix,
|
|
2411
|
+
key: this.key
|
|
2412
|
+
});
|
|
2413
|
+
}
|
|
2414
|
+
ngOnInit() {
|
|
2415
|
+
}
|
|
2416
|
+
ngAfterViewInit() {
|
|
2417
|
+
}
|
|
2418
|
+
open() {
|
|
2419
|
+
var _a, _b;
|
|
2420
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2421
|
+
if (!this.fullKey) {
|
|
2422
|
+
yield this.exportDefault();
|
|
2423
|
+
return;
|
|
2424
|
+
}
|
|
2425
|
+
yield this.loadConfiguration();
|
|
2426
|
+
this.exportableColumns = [...this.columns, ...(this.extendColumns || [])].filter(e => e.type !== 'image');
|
|
2427
|
+
this.selected = {};
|
|
2428
|
+
if (!((_a = this.selectedExcelConfig) === null || _a === void 0 ? void 0 : _a.name)) {
|
|
2429
|
+
if (((_b = this.excelConfigs) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
2430
|
+
this.selectedExcelConfig = this.excelConfigs[0];
|
|
2431
|
+
}
|
|
2432
|
+
else {
|
|
2433
|
+
this.selectedExcelConfig = {
|
|
2434
|
+
name: this.newExcelConfig
|
|
2435
|
+
};
|
|
2436
|
+
}
|
|
2437
|
+
}
|
|
2438
|
+
this.modal.open();
|
|
2439
|
+
this.ref.detectChanges();
|
|
2440
|
+
});
|
|
2441
|
+
}
|
|
2442
|
+
loadConfiguration() {
|
|
2443
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2444
|
+
this.excelConfigs = [];
|
|
2445
|
+
this.excelConfigs = yield this.excelService.getFiles(this.fullKey);
|
|
2446
|
+
});
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
SdGridPopupExportExcel.decorators = [
|
|
2450
|
+
{ type: Component, args: [{
|
|
2451
|
+
selector: 'sd-grid-popup-export-excel',
|
|
2452
|
+
template: "<sd-modal width=\"sm\" [title]=\"'Export excel' | sdTranslate\" #modal>\r\n <sd-modal-body>\r\n <mat-radio-group class=\"c-radio-group\" [ngModel]=\"selectedExcelConfig.name\" (change)=\"onChangeRadio($event)\">\r\n <mat-radio-button class=\"c-radio-button\" *ngFor=\"let excelConfig of excelConfigs\" [value]=\"excelConfig.name\"\r\n color=\"primary\">\r\n {{excelConfig.name}}\r\n </mat-radio-button>\r\n <mat-radio-button class=\"c-radio-button\" [value]=\"newExcelConfig\" color=\"accent\">\r\n {{'New template' | sdTranslate}}\r\n </mat-radio-button>\r\n </mat-radio-group>\r\n <div *ngIf=\"selectedExcelConfig.name === newExcelConfig\">\r\n <mat-chip-list selectable=\"true\" multiple=\"true\">\r\n <ng-container *ngFor=\"let column of exportableColumns\">\r\n <mat-chip [selected]=\"selected[column.field]\" (click)=\"selected[column.field] = !selected[column.field]\">\r\n {{column.title}}\r\n </mat-chip>\r\n </ng-container>\r\n </mat-chip-list>\r\n </div>\r\n </sd-modal-body>\r\n <sd-modal-footer>\r\n <ng-container *sdDesktop>\r\n <div class=\"float-right\" *ngIf=\"selectedExcelConfig && selectedExcelConfig.name !== newExcelConfig\">\r\n <sd-button *ngIf=\"selectedExcelConfig.removable\" class=\"mr-5\" [title]=\"'Delete' | sdTranslate\" icon=\"delete\"\r\n (action)=\"removeTemplate(selectedExcelConfig)\" size=\"sm\">\r\n </sd-button>\r\n <sd-button [title]=\"'Export' | sdTranslate\" icon=\"get_app\" (action)=\"onExportByTemplate(selectedExcelConfig)\"\r\n size=\"sm\" color=\"primary\">\r\n </sd-button>\r\n </div>\r\n <div class=\"float-right\" *ngIf=\"selectedExcelConfig?.name === newExcelConfig\">\r\n <sd-button class=\"mr-5\" [title]=\"'Add template' | sdTranslate\" icon=\"add\" (action)=\"uploadTemplate()\" size=\"sm\">\r\n </sd-button>\r\n <sd-button [title]=\"'Download' | sdTranslate\" icon=\"get_app\" (action)=\"newTemplate()\" size=\"sm\" color=\"primary\">\r\n </sd-button>\r\n </div>\r\n </ng-container>\r\n <ng-container *sdMobileTablet>\r\n <ng-container *ngIf=\"selectedExcelConfig && selectedExcelConfig.name !== newExcelConfig\">\r\n <sd-button *ngIf=\"selectedExcelConfig.removable\" style=\"flex: 1; padding-right: 5px;\"\r\n [title]=\"'Delete' | sdTranslate\" icon=\"delete\" (action)=\"removeTemplate(selectedExcelConfig)\" size=\"sm\"\r\n width=\"100%\">\r\n </sd-button>\r\n <sd-button style=\"flex: 1;\" [ngClass]=\"{'pl-5':selectedExcelConfig.removable}\" [title]=\"'Export' | sdTranslate\"\r\n icon=\"get_app\" (action)=\"onExportByTemplate(selectedExcelConfig)\" size=\"sm\" color=\"primary\" width=\"100%\">\r\n </sd-button>\r\n </ng-container>\r\n <ng-container *ngIf=\"selectedExcelConfig?.name === newExcelConfig\">\r\n <sd-button style=\"flex: 1; padding-right: 5px;\" [title]=\"'Add template' | sdTranslate\" icon=\"add\"\r\n (action)=\"uploadTemplate()\" size=\"sm\" width=\"100%\">\r\n </sd-button>\r\n <sd-button style=\"flex: 1; padding-left: 5px;\" [title]=\"'Download' | sdTranslate\" icon=\"get_app\"\r\n (action)=\"newTemplate()\" size=\"sm\" color=\"primary\" width=\"100%\">\r\n </sd-button>\r\n </ng-container>\r\n </ng-container>\r\n </sd-modal-footer>\r\n</sd-modal>",
|
|
2453
|
+
styles: [".c-radio-group{display:flex;flex-direction:column;margin:15px 0}.c-radio-button{margin:5px}"]
|
|
2454
|
+
},] }
|
|
2455
|
+
];
|
|
2456
|
+
SdGridPopupExportExcel.ctorParameters = () => [
|
|
2457
|
+
{ type: ChangeDetectorRef },
|
|
2458
|
+
{ type: SdLoadingService },
|
|
2459
|
+
{ type: SdExcelService },
|
|
2460
|
+
{ type: SdNotifyService },
|
|
2461
|
+
{ type: SdTranslateService }
|
|
2462
|
+
];
|
|
2463
|
+
SdGridPopupExportExcel.propDecorators = {
|
|
2464
|
+
modal: [{ type: ViewChild, args: ['modal',] }],
|
|
2465
|
+
key: [{ type: Input }],
|
|
2466
|
+
columns: [{ type: Input }],
|
|
2467
|
+
extendColumns: [{ type: Input }],
|
|
2468
|
+
fileName: [{ type: Input }],
|
|
2469
|
+
validator: [{ type: Input }],
|
|
2470
|
+
exportOption: [{ type: Input }],
|
|
2471
|
+
exportByTemplate: [{ type: Output }]
|
|
2472
|
+
};
|
|
2473
|
+
|
|
2474
|
+
var _loadConfiguration;
|
|
2475
|
+
class SdGridPopupFilter {
|
|
2476
|
+
constructor(ref, deviceService, settingService, notifyService, translateService) {
|
|
2477
|
+
this.ref = ref;
|
|
2478
|
+
this.settingService = settingService;
|
|
2479
|
+
this.notifyService = notifyService;
|
|
2480
|
+
this.translateService = translateService;
|
|
2481
|
+
this.keyPrefix = 'PopupFilter';
|
|
2482
|
+
this.displayKey = 'SDCUSTOM';
|
|
2483
|
+
this.isMobileOrTablet = false;
|
|
2484
|
+
this.key = '';
|
|
2485
|
+
this.accept = new EventEmitter();
|
|
2486
|
+
this.clear = new EventEmitter();
|
|
2487
|
+
this.loadInlineFilter = new EventEmitter();
|
|
2488
|
+
this.newQuickFilter = 'e1ef1d43-d689-424f-959e-e6cd154cfee7';
|
|
2489
|
+
this.filter = {};
|
|
2490
|
+
this.externalFilter = {};
|
|
2491
|
+
this.columns = [];
|
|
2492
|
+
this.externalFilters = [];
|
|
2493
|
+
this.quickFilters = [];
|
|
2494
|
+
this.maxQuickFilters = 5;
|
|
2495
|
+
this.inlineExternal = {};
|
|
2496
|
+
this.inlineColumn = {};
|
|
2497
|
+
this.open = (fixedColums, normalColumns, filter, externalFilter, externalFilters) => {
|
|
2498
|
+
this.init(fixedColums, normalColumns, filter, externalFilter, externalFilters);
|
|
2499
|
+
this.modal.open();
|
|
2500
|
+
};
|
|
2501
|
+
this.init = (fixedColums, normalColumns, filter, externalFilter, externalFilters) => {
|
|
2502
|
+
this.columns = [...fixedColums, ...normalColumns].filter(e => { var _a; return !((_a = e.filter) === null || _a === void 0 ? void 0 : _a.disabled) && e.type !== 'image'; });
|
|
2503
|
+
this.columns.forEach(column => {
|
|
2504
|
+
if (column.type === 'children') {
|
|
2505
|
+
column.children = column.children.filter(e => { var _a; return !((_a = e.filter) === null || _a === void 0 ? void 0 : _a.disabled) && e.type !== 'image'; });
|
|
2506
|
+
}
|
|
2507
|
+
});
|
|
2508
|
+
if (externalFilters) {
|
|
2509
|
+
this.externalFilters = externalFilters.filter(e => !e.disabled);
|
|
2510
|
+
}
|
|
2511
|
+
else {
|
|
2512
|
+
this.externalFilters = [];
|
|
2513
|
+
}
|
|
2514
|
+
this.filter = filter;
|
|
2515
|
+
this.externalFilter = this.initExternalFilter(externalFilters, externalFilter);
|
|
2516
|
+
for (const eFilter of this.externalFilters) {
|
|
2517
|
+
if (this.inlineExternal[eFilter.field] === undefined) {
|
|
2518
|
+
this.inlineExternal[eFilter.field] = true;
|
|
2519
|
+
}
|
|
2520
|
+
}
|
|
2521
|
+
for (const column of this.columns) {
|
|
2522
|
+
if (this.inlineColumn[column.field] === undefined) {
|
|
2523
|
+
this.inlineColumn[column.field] = true;
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
};
|
|
2527
|
+
this.close = () => {
|
|
2528
|
+
this.modal.close();
|
|
2529
|
+
};
|
|
2530
|
+
_loadConfiguration.set(this, () => __awaiter(this, void 0, void 0, function* () {
|
|
2531
|
+
this.quickFilters = [];
|
|
2532
|
+
if (!this.key) {
|
|
2533
|
+
return;
|
|
2534
|
+
}
|
|
2535
|
+
const { get, has } = this.settingService.create({
|
|
2536
|
+
prefix: this.keyPrefix,
|
|
2537
|
+
key: this.key
|
|
2538
|
+
});
|
|
2539
|
+
if (!(yield has())) {
|
|
2540
|
+
return;
|
|
2541
|
+
}
|
|
2542
|
+
const configuration = yield get();
|
|
2543
|
+
if (Array.isArray(configuration === null || configuration === void 0 ? void 0 : configuration.quickFilters)) {
|
|
2544
|
+
this.quickFilters = configuration.quickFilters;
|
|
2545
|
+
}
|
|
2546
|
+
this.selectedCode = (configuration === null || configuration === void 0 ? void 0 : configuration.selectedQuickFilter) || '';
|
|
2547
|
+
this.inlineExternal = (configuration === null || configuration === void 0 ? void 0 : configuration.inlineExternal) || {};
|
|
2548
|
+
this.inlineColumn = (configuration === null || configuration === void 0 ? void 0 : configuration.inlineColumn) || {};
|
|
2549
|
+
for (const externalFilter of this.externalFilters) {
|
|
2550
|
+
if (this.inlineExternal[externalFilter.field] === undefined) {
|
|
2551
|
+
this.inlineExternal[externalFilter.field] = true;
|
|
2552
|
+
}
|
|
2553
|
+
}
|
|
2554
|
+
for (const column of this.columns) {
|
|
2555
|
+
if (this.inlineColumn[column.field] === undefined) {
|
|
2556
|
+
this.inlineColumn[column.field] = true;
|
|
2557
|
+
}
|
|
2558
|
+
}
|
|
2559
|
+
}));
|
|
2560
|
+
this.onSelectionChange = (change) => {
|
|
2561
|
+
const value = (change === null || change === void 0 ? void 0 : change.value) || '';
|
|
2562
|
+
if (value === this.newQuickFilter) {
|
|
2563
|
+
this.selectedCode = '';
|
|
2564
|
+
this.onCreateQuickFilter();
|
|
2565
|
+
this.ref.detectChanges();
|
|
2566
|
+
}
|
|
2567
|
+
else {
|
|
2568
|
+
const quickFilter = this.quickFilters.find(e => e.code === value);
|
|
2569
|
+
if (quickFilter) {
|
|
2570
|
+
this.onDetailQuickFilter(quickFilter);
|
|
2571
|
+
}
|
|
2572
|
+
}
|
|
2573
|
+
};
|
|
2574
|
+
this.onCreateQuickFilter = (ev) => {
|
|
2575
|
+
var _a;
|
|
2576
|
+
ev === null || ev === void 0 ? void 0 : ev.stopPropagation();
|
|
2577
|
+
ev === null || ev === void 0 ? void 0 : ev.preventDefault();
|
|
2578
|
+
(_a = this.matSelect) === null || _a === void 0 ? void 0 : _a.close();
|
|
2579
|
+
this.popupQuickFilterDetail.open(this.columns, this.externalFilters);
|
|
2580
|
+
};
|
|
2581
|
+
this.onDetailQuickFilter = (quickFilter) => __awaiter(this, void 0, void 0, function* () {
|
|
2582
|
+
if (quickFilter) {
|
|
2583
|
+
this.selectedCode = quickFilter.code;
|
|
2584
|
+
const f1 = JSON.stringify(quickFilter.filter);
|
|
2585
|
+
const f2 = JSON.stringify(quickFilter.externalFilter);
|
|
2586
|
+
this.filter = JSON.parse(f1);
|
|
2587
|
+
this.externalFilter = this.initExternalFilter(this.externalFilters, JSON.parse(f2));
|
|
2588
|
+
yield this.updateConfiguration();
|
|
2589
|
+
}
|
|
2590
|
+
});
|
|
2591
|
+
this.onEditQuickFilter = (ev, quickFilter) => {
|
|
2592
|
+
var _a;
|
|
2593
|
+
ev.stopPropagation();
|
|
2594
|
+
ev.preventDefault();
|
|
2595
|
+
(_a = this.matSelect) === null || _a === void 0 ? void 0 : _a.close();
|
|
2596
|
+
if (quickFilter) {
|
|
2597
|
+
this.popupQuickFilterDetail.open(this.columns, this.externalFilters, quickFilter.filter, quickFilter.externalFilter, quickFilter.code);
|
|
2598
|
+
this.ref.detectChanges();
|
|
2599
|
+
}
|
|
2600
|
+
};
|
|
2601
|
+
this.onDeleteQuickFilter = (ev, quickFilter) => {
|
|
2602
|
+
var _a;
|
|
2603
|
+
ev.stopPropagation();
|
|
2604
|
+
ev.preventDefault();
|
|
2605
|
+
(_a = this.matSelect) === null || _a === void 0 ? void 0 : _a.close();
|
|
2606
|
+
if (quickFilter) {
|
|
2607
|
+
this.notifyService.confirm(this.translateService.translate('Remove filter')).then(() => __awaiter(this, void 0, void 0, function* () {
|
|
2608
|
+
if (quickFilter.code === this.selectedCode) {
|
|
2609
|
+
this.selectedCode = '';
|
|
2610
|
+
}
|
|
2611
|
+
const idx = this.quickFilters.findIndex(e => e.code === quickFilter.code);
|
|
2612
|
+
this.quickFilters.splice(idx, 1);
|
|
2613
|
+
yield this.updateConfiguration();
|
|
2614
|
+
this.ref.detectChanges();
|
|
2615
|
+
}));
|
|
2616
|
+
}
|
|
2617
|
+
};
|
|
2618
|
+
this.onAcceptQuickFilter = (args) => __awaiter(this, void 0, void 0, function* () {
|
|
2619
|
+
const quickFilter = this.quickFilters.find(e => e.code === args.code);
|
|
2620
|
+
if (!quickFilter) {
|
|
2621
|
+
this.quickFilters.push({
|
|
2622
|
+
code: args.code,
|
|
2623
|
+
filter: args.filter,
|
|
2624
|
+
externalFilter: this.initExternalFilter(this.externalFilters, args.externalFilter)
|
|
2625
|
+
});
|
|
2626
|
+
}
|
|
2627
|
+
else {
|
|
2628
|
+
quickFilter.filter = args.filter;
|
|
2629
|
+
quickFilter.externalFilter = this.initExternalFilter(this.externalFilters, args.externalFilter);
|
|
2630
|
+
}
|
|
2631
|
+
yield this.updateConfiguration();
|
|
2632
|
+
});
|
|
2633
|
+
this.onInlineChange = () => {
|
|
2634
|
+
this.updateConfiguration();
|
|
2635
|
+
};
|
|
2636
|
+
this.initExternalFilter = (externalFilters, externalFilter) => {
|
|
2637
|
+
externalFilter = externalFilter || {};
|
|
2638
|
+
externalFilters = externalFilters || [];
|
|
2639
|
+
externalFilters.forEach(e => {
|
|
2640
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
2641
|
+
if (e.type === 'string') {
|
|
2642
|
+
externalFilter[e.field] = (_b = (_a = externalFilter[e.field]) !== null && _a !== void 0 ? _a : e.default) !== null && _b !== void 0 ? _b : '';
|
|
2643
|
+
return;
|
|
2644
|
+
}
|
|
2645
|
+
if (e.type === 'number') {
|
|
2646
|
+
externalFilter[e.field] = (_d = (_c = externalFilter[e.field]) !== null && _c !== void 0 ? _c : e.default) !== null && _d !== void 0 ? _d : undefined;
|
|
2647
|
+
return;
|
|
2648
|
+
}
|
|
2649
|
+
if (e.type === 'daterange') {
|
|
2650
|
+
externalFilter[e.field] = {
|
|
2651
|
+
from: (_g = (_f = (_e = externalFilter[e.field]) === null || _e === void 0 ? void 0 : _e.from) !== null && _f !== void 0 ? _f : e.defaultFrom) !== null && _g !== void 0 ? _g : undefined,
|
|
2652
|
+
to: (_k = (_j = (_h = externalFilter[e.field]) === null || _h === void 0 ? void 0 : _h.to) !== null && _j !== void 0 ? _j : e.defaultTo) !== null && _k !== void 0 ? _k : undefined
|
|
2653
|
+
};
|
|
2654
|
+
return;
|
|
2655
|
+
}
|
|
2656
|
+
if (e.type === 'numberrange') {
|
|
2657
|
+
externalFilter[e.field] = {
|
|
2658
|
+
from: (_o = (_m = (_l = externalFilter[e.field]) === null || _l === void 0 ? void 0 : _l.from) !== null && _m !== void 0 ? _m : e.defaultFrom) !== null && _o !== void 0 ? _o : undefined,
|
|
2659
|
+
to: (_r = (_q = (_p = externalFilter[e.field]) === null || _p === void 0 ? void 0 : _p.to) !== null && _q !== void 0 ? _q : e.defaultTo) !== null && _r !== void 0 ? _r : undefined
|
|
2660
|
+
};
|
|
2661
|
+
return;
|
|
2662
|
+
}
|
|
2663
|
+
if (e.type === 'daterangefull') {
|
|
2664
|
+
externalFilter[e.field] = {
|
|
2665
|
+
from: (_u = (_t = (_s = externalFilter[e.field]) === null || _s === void 0 ? void 0 : _s.from) !== null && _t !== void 0 ? _t : e.defaultFrom) !== null && _u !== void 0 ? _u : undefined,
|
|
2666
|
+
to: (_x = (_w = (_v = externalFilter[e.field]) === null || _v === void 0 ? void 0 : _v.to) !== null && _w !== void 0 ? _w : e.defaultTo) !== null && _x !== void 0 ? _x : undefined
|
|
2667
|
+
};
|
|
2668
|
+
return;
|
|
2669
|
+
}
|
|
2670
|
+
if (e.type === 'values') { // andn1
|
|
2671
|
+
externalFilter[e.field] = (_y = (externalFilter[e.field] || e.default)) !== null && _y !== void 0 ? _y : '';
|
|
2672
|
+
return;
|
|
2673
|
+
}
|
|
2674
|
+
});
|
|
2675
|
+
return externalFilter;
|
|
2676
|
+
};
|
|
2677
|
+
this.isMobileOrTablet = !deviceService.isDesktop();
|
|
2678
|
+
}
|
|
2679
|
+
ngOnInit() {
|
|
2680
|
+
__classPrivateFieldGet(this, _loadConfiguration).call(this).then(() => {
|
|
2681
|
+
this.loadInlineFilter.emit({
|
|
2682
|
+
quickFilters: this.quickFilters || [],
|
|
2683
|
+
selectedQuickFilter: this.selectedCode || '',
|
|
2684
|
+
inlineExternal: this.inlineExternal,
|
|
2685
|
+
inlineColumn: this.inlineColumn
|
|
2686
|
+
});
|
|
2687
|
+
});
|
|
2688
|
+
}
|
|
2689
|
+
ngAfterViewInit() {
|
|
2690
|
+
}
|
|
2691
|
+
onAccept() {
|
|
2692
|
+
var _a;
|
|
2693
|
+
if (((_a = this.filterOption) === null || _a === void 0 ? void 0 : _a.multiple) === false) {
|
|
2694
|
+
if (this.selectedField) {
|
|
2695
|
+
if (this.selectedField.startsWith('column')) {
|
|
2696
|
+
const field = this.selectedField.replace('column', '');
|
|
2697
|
+
this.accept.emit({
|
|
2698
|
+
filter: {
|
|
2699
|
+
[field]: this.filter[field]
|
|
2700
|
+
},
|
|
2701
|
+
externalFilter: {}
|
|
2702
|
+
});
|
|
2703
|
+
}
|
|
2704
|
+
else if (this.selectedField.startsWith('external')) {
|
|
2705
|
+
const field = this.selectedField.replace('external', '');
|
|
2706
|
+
this.accept.emit({
|
|
2707
|
+
filter: {},
|
|
2708
|
+
externalFilter: this.initExternalFilter(this.externalFilters, {
|
|
2709
|
+
[field]: this.externalFilter[field]
|
|
2710
|
+
})
|
|
2711
|
+
});
|
|
2712
|
+
}
|
|
2713
|
+
}
|
|
2714
|
+
}
|
|
2715
|
+
else {
|
|
2716
|
+
this.accept.emit({
|
|
2717
|
+
filter: this.filter,
|
|
2718
|
+
externalFilter: this.externalFilter
|
|
2719
|
+
});
|
|
2720
|
+
}
|
|
2721
|
+
this.modal.close();
|
|
2722
|
+
}
|
|
2723
|
+
onClear() {
|
|
2724
|
+
delete this.selectedCode;
|
|
2725
|
+
this.clear.emit();
|
|
2726
|
+
}
|
|
2727
|
+
updateConfiguration(selectedQuickFilterCode) {
|
|
2728
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2729
|
+
if (!this.key) {
|
|
2730
|
+
return;
|
|
2731
|
+
}
|
|
2732
|
+
if (selectedQuickFilterCode !== undefined) {
|
|
2733
|
+
this.selectedCode = selectedQuickFilterCode;
|
|
2734
|
+
}
|
|
2735
|
+
const { set } = this.settingService.create({
|
|
2736
|
+
prefix: this.keyPrefix,
|
|
2737
|
+
key: this.key
|
|
2738
|
+
});
|
|
2739
|
+
yield set({
|
|
2740
|
+
quickFilters: this.quickFilters,
|
|
2741
|
+
selectedQuickFilter: this.selectedCode,
|
|
2742
|
+
inlineExternal: this.inlineExternal,
|
|
2743
|
+
inlineColumn: this.inlineColumn
|
|
2744
|
+
});
|
|
2745
|
+
this.loadInlineFilter.emit({
|
|
2746
|
+
quickFilters: this.quickFilters || [],
|
|
2747
|
+
selectedQuickFilter: this.selectedCode || '',
|
|
2748
|
+
inlineExternal: this.inlineExternal,
|
|
2749
|
+
inlineColumn: this.inlineColumn
|
|
2750
|
+
});
|
|
2751
|
+
this.ref.detectChanges();
|
|
2752
|
+
});
|
|
2753
|
+
}
|
|
2754
|
+
}
|
|
2755
|
+
_loadConfiguration = new WeakMap();
|
|
2756
|
+
SdGridPopupFilter.decorators = [
|
|
2757
|
+
{ type: Component, args: [{
|
|
2758
|
+
selector: 'sd-grid-popup-filter',
|
|
2759
|
+
template: "<sd-modal width=\"sm\" [title]=\"'Filter' | sdTranslate\" #modal>\r\n <sd-modal-body>\r\n <div\r\n *ngIf=\"key && filterOption?.multiple !== false && (!filterOption?.quickFilterVisibility || filterOption?.quickFilterVisibility === 'popup')\">\r\n <mat-form-field class=\"sd-md\" appearance=\"outline\">\r\n <mat-label>{{'Quick filters' | sdTranslate}}</mat-label>\r\n <mat-select [(ngModel)]=\"selectedCode\" (selectionChange)=\"onSelectionChange($event)\" #matSelect>\r\n <mat-option value=\"\">{{'Please select' | sdTranslate}}</mat-option>\r\n <mat-option *ngFor=\"let quickFilter of quickFilters\" [value]=\"quickFilter.code\">\r\n <div style=\"display:flex; justify-content: space-between\">\r\n <span>{{quickFilter.code}}</span>\r\n <div>\r\n <mat-icon class=\"mr-1 c-fa-icon\" (click)=\"onEditQuickFilter($event, quickFilter)\" fontSet=\"fa\"\r\n fontIcon=\"fa-pencil\"></mat-icon>\r\n <mat-icon class=\"mr-0 c-fa-icon\" (click)=\"onDeleteQuickFilter($event, quickFilter)\" fontSet=\"fa\"\r\n fontIcon=\"fa-trash-o\"></mat-icon>\r\n </div>\r\n </div>\r\n </mat-option>\r\n <mat-option [value]=\"newQuickFilter\">\r\n <div (click)=\"onCreateQuickFilter($event)\">\r\n <mat-icon class=\"mr-1\" fontSet=\"material-icons-outlined\">add</mat-icon>\r\n <span>{{'Create quick filter' | sdTranslate}}</span>\r\n </div>\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n <ng-container *ngIf=\"filterOption?.multiple === false\">\r\n <mat-form-field appearance=\"outline\">\r\n <mat-label>{{'Select field' | sdTranslate}}</mat-label>\r\n <mat-select [(ngModel)]=\"selectedField\">\r\n <mat-option value=\"\">{{'Please select' | sdTranslate}}</mat-option>\r\n <mat-option *ngFor=\"let item of externalFilters\" [value]=\"'external' + item.field\">\r\n {{item.title}}\r\n </mat-option>\r\n <ng-container *ngFor=\"let item of columns\">\r\n <mat-option *ngIf=\"item.type !== 'children'\" [value]=\"'column' + item.field\">\r\n {{item.title}}\r\n </mat-option>\r\n <ng-container *ngIf=\"item.type === 'children' && item.children?.length\">\r\n <ng-container *ngFor=\"let childColumn of item.children\">\r\n <mat-option [value]=\"'column' + childColumn.field\">\r\n {{childColumn.title}}\r\n </mat-option>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n </mat-select>\r\n </mat-form-field>\r\n </ng-container>\r\n <ng-container *ngFor=\"let item of externalFilters\">\r\n <div *ngIf=\"filterOption?.multiple !== false || selectedField === 'external' + item.field\"\r\n class=\"d-flex align-items-baseline\">\r\n <ng-container *ngIf=\"filterOption?.multiple !== false\">\r\n <div *sdDesktop class=\"c-checkable\">\r\n <sd-switch [(model)]=\"inlineExternal[item.field]\" (sdChange)=\"onInlineChange()\">\r\n </sd-switch>\r\n </div>\r\n </ng-container>\r\n <div class=\"c-filterable\">\r\n <sd-input [label]=\"item.title\" *ngIf=\"item.type === 'string'\" type=\"text\"\r\n [(model)]=\"externalFilter[item.field]\">\r\n </sd-input>\r\n <sd-input-currency [label]=\"item.title\" *ngIf=\"item.type === 'number'\" [(model)]=\"externalFilter[item.field]\">\r\n </sd-input-currency>\r\n <sd-select [label]=\"item.title\" *ngIf=\"item.type === 'bool'\" [items]=\" [{value:'1',display:item.trueValue || 'True' },\r\n {value:'0',display:item.falseValue || 'False' }]\" valueField=\"value\" displayField=\"display\"\r\n [(model)]=\"externalFilter[item.field]\">\r\n </sd-select>\r\n <sd-select [label]=\"item.title\" *ngIf=\"item.type === 'radio'\" [items]=\"item.values\"\r\n [valueField]=\"item.valueField\" [displayField]=\"item.displayField\" [(model)]=\"externalFilter[item.field]\">\r\n </sd-select>\r\n <ng-container *ngIf=\"item.type === 'values'\">\r\n <sd-select *ngIf=\"item.selection === 'MULTIPLE'\" [label]=\"item.title\" [items]=\"item.values\"\r\n [valueField]=\"item.valueField\" [displayField]=\"item.displayField\" [(model)]=\"externalFilter[item.field]\"\r\n multiple=\"true\">\r\n </sd-select>\r\n <sd-autocomplete *ngIf=\"item.selection === 'AUTOCOMPLETE'\" [label]=\"item.title\" [items]=\"item.values\"\r\n [valueField]=\"item.valueField\" [displayField]=\"item.displayField\" [(model)]=\"externalFilter[item.field]\">\r\n </sd-autocomplete>\r\n <sd-select *ngIf=\"item.selection === 'MULTIPLEAUTOCOMPLETE'\" [label]=\"item.title\" [items]=\"item.values\"\r\n [valueField]=\"item.valueField\" [displayField]=\"item.displayField\" [(model)]=\"externalFilter[item.field]\"\r\n filtered=\"true\" multiple=\"true\">\r\n </sd-select>\r\n <sd-select *ngIf=\"!item.selection\" [label]=\"item.title\" [items]=\"item.values\" [valueField]=\"item.valueField\"\r\n [displayField]=\"item.displayField\" [(model)]=\"externalFilter[item.field]\">\r\n </sd-select>\r\n </ng-container>\r\n <sd-input *ngIf=\"item.type === 'custom'\" [label]=\"item.title\"\r\n [(model)]=\"externalFilter[displayKey + item.field]\"\r\n (sdFocusForceBlur)=\"item?.onClick(externalFilter, item.field, displayKey + item.field)\">\r\n </sd-input>\r\n <sd-date-time [label]=\"item.title\" *ngIf=\"item.type ==='date'\" [(model)]=\"externalFilter[item.field]\"\r\n type=\"date\">\r\n </sd-date-time>\r\n <sd-date-range [label]=\"item.title\" *ngIf=\"item.type ==='daterangefull'\"\r\n [(from)]=\"externalFilter[item.field].from\" [(to)]=\"externalFilter[item.field].to\" [min]=\"item.minDate\"\r\n [max]=\"item.maxDate\">\r\n </sd-date-range>\r\n <ng-container *ngIf=\"item.type ==='daterange'\">\r\n <div class=\"row\">\r\n <div class=\"col-6\">\r\n <sd-date-time [label]=\"item.fromTitle\" [(model)]=\"externalFilter[item.field].from\"\r\n [type]=\"item.enableTime ? 'datetime' : 'date'\" [minDate]=\"item.minDate\"\r\n [maxDate]=\"externalFilter[item.field].to || item.maxDate\">\r\n </sd-date-time>\r\n </div>\r\n <div class=\"col-6\">\r\n <sd-date-time [label]=\"item.toTitle\" [(model)]=\"externalFilter[item.field].to\"\r\n [type]=\"item.enableTime ? 'datetime' : 'date'\"\r\n [minDate]=\"item.minDate || externalFilter[item.field].from\" [maxDate]=\"item.maxDate\">\r\n </sd-date-time>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"row\" *ngIf=\"item.type ==='numberrange'\">\r\n <div class=\"col-6\">\r\n <sd-input [label]=\"item.fromTitle\" type=\" number\" [(model)]=\"externalFilter[item.field].from\">\r\n </sd-input>\r\n </div>\r\n <div class=\"col-6\">\r\n <sd-input [label]=\"item.toTitle\" type=\" number\" [(model)]=\"externalFilter[item.field].to\">\r\n </sd-input>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of columns\">\r\n <div class=\"d-flex align-items-baseline\"\r\n *ngIf=\"column.type !== 'children' && (filterOption?.multiple !== false || selectedField === 'column' + column.field)\">\r\n <ng-container *ngIf=\"filterOption?.multiple !== false\">\r\n <div *sdDesktop class=\"c-checkable\">\r\n <sd-switch [(model)]=\"inlineColumn[column.field]\" (sdChange)=\"onInlineChange()\">\r\n </sd-switch>\r\n </div>\r\n </ng-container>\r\n <div class=\"c-filterable\">\r\n <sd-input *ngIf=\"column.type === 'string'\" [label]=\"column.title\" type=\"text\"\r\n [(model)]=\"filter[column.field]\">\r\n </sd-input>\r\n <sd-input *ngIf=\"column.type === 'number'\" [label]=\"column.title\" type=\" number\"\r\n [(model)]=\"filter[column.field]\">\r\n </sd-input>\r\n <sd-select *ngIf=\"column.type === 'bool'\" [label]=\"column.title\" [items]=\"[{value:'1',display:column.trueValue || 'True' },\r\n {value:'0',display:column.falseValue || 'False' }]\" [(model)]=\"filter[column.field]\">\r\n </sd-select>\r\n <sd-select *ngIf=\"column.type === 'radio'\" [label]=\"column.title\" [items]=\"column.values\"\r\n [valueField]=\"column.valueField\" [displayField]=\"column.displayField\" [(model)]=\"filter[column.field]\">\r\n </sd-select>\r\n <sd-select *ngIf=\"column.type === 'values' && !column?.editor?.autocomplete\" [label]=\"column.title\"\r\n [items]=\"column.values\" valueField=\"value\" displayField=\"text\" [(model)]=\"filter[column.field]\">\r\n </sd-select>\r\n <sd-autocomplete *ngIf=\"column.type === 'values' && column?.editor?.autocomplete\" [label]=\"column.title\"\r\n [items]=\"column.values\" valueField=\"value\" displayField=\"text\" [(model)]=\"filter[column.field]\">\r\n </sd-autocomplete>\r\n <sd-date-time *ngIf=\"column.type ==='date' || column.type==='datetime' ||\r\n column.type==='time'\" [label]=\"column.title\" [(model)]=\" filter[column.field]\" type=\"date\">\r\n </sd-date-time>\r\n </div>\r\n </div>\r\n <ng-container *ngIf=\"column.type === 'children' && column.children?.length\">\r\n <ng-container *ngFor=\"let childColumn of column.children\">\r\n <div class=\"d-flex align-items-baseline\"\r\n *ngIf=\"filterOption?.multiple !== false || selectedField === 'column' + childColumn.field\">\r\n <ng-container *ngIf=\"filterOption?.multiple !== false\">\r\n <div *sdDesktop class=\"c-checkable\">\r\n <sd-switch [(model)]=\"inlineColumn[childColumn.field]\" (sdChange)=\"onInlineChange()\">\r\n </sd-switch>\r\n </div>\r\n </ng-container>\r\n <div class=\"c-filterable\">\r\n <sd-input [label]=\"childColumn.title\" *ngIf=\"childColumn.type === 'string'\" type=\"text\"\r\n [(model)]=\"filter[childColumn.field]\">\r\n </sd-input>\r\n <sd-input [label]=\"childColumn.title\" *ngIf=\"childColumn.type === 'number'\" type=\" number\"\r\n [(model)]=\"filter[childColumn.field]\">\r\n </sd-input>\r\n <sd-select [label]=\"childColumn.title\" *ngIf=\"childColumn.type === 'bool'\" [items]=\"[{value:'1',display:column.trueValue || 'True' },\r\n {value:'0',display:childColumn.falseValue || 'False' }]\" [(model)]=\"filter[childColumn.field]\">\r\n </sd-select>\r\n <sd-select [label]=\"childColumn.title\" *ngIf=\"childColumn.type === 'radio'\" [items]=\"childColumn.values\"\r\n [valueField]=\"childColumn.valueField\" [displayField]=\"childColumn.displayField\"\r\n [(model)]=\"filter[childColumn.field]\">\r\n </sd-select>\r\n <sd-autocomplete [label]=\"childColumn.title\" *ngIf=\"childColumn.type === 'values'\"\r\n [items]=\"childColumn.values\" valueField=\"value\" displayField=\"text\"\r\n [(model)]=\"filter[childColumn.field]\">\r\n </sd-autocomplete>\r\n <sd-date-time [label]=\"childColumn.title\" *ngIf=\"childColumn.type ==='date' || childColumn.type==='datetime' ||\r\n childColumn.type==='time'\" [(model)]=\" filter[childColumn.field]\" type=\"date\">\r\n </sd-date-time>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n </sd-modal-body>\r\n <sd-modal-footer *sdDesktop>\r\n <sd-button class=\"mr-auto\" (action)=\"onClear()\" icon=\"clear\" [title]=\"'Clear filter' | sdTranslate\" size=\"sm\">\r\n </sd-button>\r\n <sd-button (action)=\"onAccept()\" icon=\"done\" [title]=\"'Accept' | sdTranslate\" color=\"primary\" size=\"sm\"></sd-button>\r\n </sd-modal-footer>\r\n <sd-modal-footer *sdMobileTablet>\r\n <sd-button style=\"flex: 1; padding-right: 5px;\" (action)=\"onClear()\" icon=\"clear\"\r\n [title]=\"'Clear filter' | sdTranslate\" width=\"100%\" size=\"sm\"></sd-button>\r\n <sd-button style=\"flex: 1; padding-left: 5px;\" (action)=\"onAccept()\" icon=\"done\" [title]=\"'Accept' | sdTranslate\"\r\n color=\"primary\" width=\"100%\" size=\"sm\"></sd-button>\r\n </sd-modal-footer>\r\n</sd-modal>\r\n<sd-grid-popup-quick-filter-detail #popupQuickFilterDetail (accept)=\"onAcceptQuickFilter($event)\">\r\n</sd-grid-popup-quick-filter-detail>",
|
|
2760
|
+
encapsulation: ViewEncapsulation.None,
|
|
2761
|
+
styles: [".c-fa-icon{color:grey;font-size:20px}.c-checkable{width:50px}.c-filterable{flex:1}"]
|
|
2762
|
+
},] }
|
|
2763
|
+
];
|
|
2764
|
+
SdGridPopupFilter.ctorParameters = () => [
|
|
2765
|
+
{ type: ChangeDetectorRef },
|
|
2766
|
+
{ type: DeviceDetectorService },
|
|
2767
|
+
{ type: SdSettingService },
|
|
2768
|
+
{ type: SdNotifyService },
|
|
2769
|
+
{ type: SdTranslateService }
|
|
2770
|
+
];
|
|
2771
|
+
SdGridPopupFilter.propDecorators = {
|
|
2772
|
+
modal: [{ type: ViewChild, args: ['modal',] }],
|
|
2773
|
+
popupQuickFilterDetail: [{ type: ViewChild, args: ['popupQuickFilterDetail',] }],
|
|
2774
|
+
matSelect: [{ type: ViewChild, args: ['matSelect',] }],
|
|
2775
|
+
key: [{ type: Input }],
|
|
2776
|
+
filterOption: [{ type: Input }],
|
|
2777
|
+
accept: [{ type: Output }],
|
|
2778
|
+
clear: [{ type: Output }],
|
|
2779
|
+
loadInlineFilter: [{ type: Output }],
|
|
2780
|
+
inlineExternal: [{ type: Input }],
|
|
2781
|
+
inlineColumn: [{ type: Input }]
|
|
2782
|
+
};
|
|
2783
|
+
|
|
2784
|
+
class SdGridPopupQuickFilterDetail {
|
|
2785
|
+
constructor(deviceService, notifyService, translateService) {
|
|
2786
|
+
this.notifyService = notifyService;
|
|
2787
|
+
this.translateService = translateService;
|
|
2788
|
+
this.displayKey = 'SDCUSTOM';
|
|
2789
|
+
this.isMobileOrTablet = false;
|
|
2790
|
+
this.accept = new EventEmitter();
|
|
2791
|
+
this.fields = [];
|
|
2792
|
+
this.selectableFields = [];
|
|
2793
|
+
this.columns = [];
|
|
2794
|
+
this.externalFilters = [];
|
|
2795
|
+
this.filter = {};
|
|
2796
|
+
this.externalFilter = {};
|
|
2797
|
+
this.selectedField = {};
|
|
2798
|
+
this.page = 1;
|
|
2799
|
+
this.onAccept = () => {
|
|
2800
|
+
const execute = () => {
|
|
2801
|
+
const filter = {};
|
|
2802
|
+
const externalFilter = {};
|
|
2803
|
+
Object.keys(this.filter).forEach(key => {
|
|
2804
|
+
if (this.filter[key] === undefined || this.filter[key] === null || this.filter[key] === '') {
|
|
2805
|
+
return;
|
|
2806
|
+
}
|
|
2807
|
+
if (!this.fields.some(e => e.group === 'column' && e.code === key)) {
|
|
2808
|
+
return;
|
|
2809
|
+
}
|
|
2810
|
+
filter[key] = this.filter[key];
|
|
2811
|
+
});
|
|
2812
|
+
Object.keys(this.externalFilter).forEach(key => {
|
|
2813
|
+
if (this.externalFilter[key] === undefined || this.externalFilter[key] === null || this.externalFilter[key] === '') {
|
|
2814
|
+
return;
|
|
2815
|
+
}
|
|
2816
|
+
externalFilter[key] = this.externalFilter[key];
|
|
2817
|
+
});
|
|
2818
|
+
this.accept.emit({
|
|
2819
|
+
code: this.code,
|
|
2820
|
+
filter,
|
|
2821
|
+
externalFilter
|
|
2822
|
+
});
|
|
2823
|
+
this.modal.close();
|
|
2824
|
+
};
|
|
2825
|
+
if (!this.code) {
|
|
2826
|
+
this.notifyService.confirmWithInput('Enter your quick filter name').then((value) => {
|
|
2827
|
+
var _a;
|
|
2828
|
+
if (value) {
|
|
2829
|
+
if ((_a = this.quickFilters) === null || _a === void 0 ? void 0 : _a.some(e => e.code === value)) {
|
|
2830
|
+
this.notifyService.notify.warning(this.translateService.translate('Code is existed'));
|
|
2831
|
+
return;
|
|
2832
|
+
}
|
|
2833
|
+
this.code = value;
|
|
2834
|
+
execute();
|
|
2835
|
+
}
|
|
2836
|
+
});
|
|
2837
|
+
}
|
|
2838
|
+
else {
|
|
2839
|
+
execute();
|
|
2840
|
+
}
|
|
2841
|
+
};
|
|
2842
|
+
this.onCancel = () => {
|
|
2843
|
+
this.modal.close();
|
|
2844
|
+
};
|
|
2845
|
+
this.onSelectField = (values) => {
|
|
2846
|
+
this.fields = this.selectableFields.filter(e => values.some(v => e.code === v));
|
|
2847
|
+
for (const field of this.fields) {
|
|
2848
|
+
if (field.group === 'external' && field.type.includes('range')) {
|
|
2849
|
+
this.externalFilter[field.code] = this.externalFilter[field.code] || {};
|
|
2850
|
+
}
|
|
2851
|
+
}
|
|
2852
|
+
};
|
|
2853
|
+
this.onSelectFields = () => {
|
|
2854
|
+
this.fields = this.selectableFields.filter(e => this.selectedField[e.id]);
|
|
2855
|
+
for (const field of this.fields) {
|
|
2856
|
+
if (field.group === 'external' && field.type.includes('range')) {
|
|
2857
|
+
this.externalFilter[field.code] = this.externalFilter[field.code] || {};
|
|
2858
|
+
}
|
|
2859
|
+
}
|
|
2860
|
+
};
|
|
2861
|
+
this.isMobileOrTablet = !deviceService.isDesktop();
|
|
2862
|
+
}
|
|
2863
|
+
ngOnInit() {
|
|
2864
|
+
}
|
|
2865
|
+
ngAfterViewInit() {
|
|
2866
|
+
}
|
|
2867
|
+
open(columns, externalFilters, filter, externalFilter, code) {
|
|
2868
|
+
this.fields = [];
|
|
2869
|
+
this.filter = {};
|
|
2870
|
+
this.externalFilter = {};
|
|
2871
|
+
this.columns = columns;
|
|
2872
|
+
this.externalFilters = externalFilters;
|
|
2873
|
+
this.code = code;
|
|
2874
|
+
if (filter) {
|
|
2875
|
+
Object.keys(filter).forEach(key => {
|
|
2876
|
+
if (filter[key] === undefined || filter[key] === null || filter[key] === '') {
|
|
2877
|
+
return;
|
|
2878
|
+
}
|
|
2879
|
+
const column = columns.find(e => e.field === key);
|
|
2880
|
+
if (!column) {
|
|
2881
|
+
return;
|
|
2882
|
+
}
|
|
2883
|
+
this.filter[key] = filter[key];
|
|
2884
|
+
this.fields.push(Object.assign(Object.assign({}, column), { id: 'column' + column.field, group: 'column', type: column.type, code: column.field, title: column.title }));
|
|
2885
|
+
});
|
|
2886
|
+
}
|
|
2887
|
+
if (externalFilter) {
|
|
2888
|
+
Object.keys(externalFilter).forEach(key => {
|
|
2889
|
+
var _a, _b, _c, _d;
|
|
2890
|
+
if (externalFilter[key] === undefined || externalFilter[key] === null || externalFilter[key] === '') {
|
|
2891
|
+
return;
|
|
2892
|
+
}
|
|
2893
|
+
if (key.startsWith(this.displayKey)) {
|
|
2894
|
+
this.externalFilter[key] = externalFilter[key];
|
|
2895
|
+
return;
|
|
2896
|
+
}
|
|
2897
|
+
const item = externalFilters.find(e => e.field === key);
|
|
2898
|
+
if (!item) {
|
|
2899
|
+
return;
|
|
2900
|
+
}
|
|
2901
|
+
if (item.type === 'daterange' || item.type === 'numberrange') {
|
|
2902
|
+
this.externalFilter[key] = Object.assign({}, externalFilter[key]);
|
|
2903
|
+
if (!((_a = externalFilter[key]) === null || _a === void 0 ? void 0 : _a.from) && !((_b = externalFilter[key]) === null || _b === void 0 ? void 0 : _b.to)) {
|
|
2904
|
+
return;
|
|
2905
|
+
}
|
|
2906
|
+
this.fields.push(Object.assign(Object.assign({}, item), { id: 'external' + item.field, group: 'external', type: item.type, code: item.field, title: item.title, fromTitle: item.fromTitle, toTitle: item.toTitle }));
|
|
2907
|
+
}
|
|
2908
|
+
else if (item.type === 'daterangefull') {
|
|
2909
|
+
this.externalFilter[key] = Object.assign({}, externalFilter[key]);
|
|
2910
|
+
if (!((_c = externalFilter[key]) === null || _c === void 0 ? void 0 : _c.from) && !((_d = externalFilter[key]) === null || _d === void 0 ? void 0 : _d.to)) {
|
|
2911
|
+
return;
|
|
2912
|
+
}
|
|
2913
|
+
this.fields.push(Object.assign(Object.assign({}, item), { id: 'external' + item.field, group: 'external', type: item.type, code: item.field, title: item.title }));
|
|
2914
|
+
}
|
|
2915
|
+
else {
|
|
2916
|
+
this.externalFilter[key] = externalFilter[key];
|
|
2917
|
+
this.fields.push(Object.assign(Object.assign({}, item), { id: 'external' + item.field, group: 'external', type: item.type, code: item.field, title: item.title }));
|
|
2918
|
+
}
|
|
2919
|
+
});
|
|
2920
|
+
}
|
|
2921
|
+
const externalFields = (externalFilters === null || externalFilters === void 0 ? void 0 : externalFilters.map(e => (Object.assign(Object.assign({}, e), { id: 'external' + e.field, group: 'external', code: e.field, type: e.type, title: e.title })))) || [];
|
|
2922
|
+
const columnFields = [];
|
|
2923
|
+
columns === null || columns === void 0 ? void 0 : columns.filter(e => e.type !== 'image').forEach(column => {
|
|
2924
|
+
var _a;
|
|
2925
|
+
if ('children' in column) {
|
|
2926
|
+
(_a = column.children) === null || _a === void 0 ? void 0 : _a.filter(e => e.type !== 'image').forEach(e => {
|
|
2927
|
+
columnFields.push(Object.assign(Object.assign({}, e), { id: 'column' + e.field, group: 'column', code: e.field, type: e.type, title: e.title }));
|
|
2928
|
+
});
|
|
2929
|
+
}
|
|
2930
|
+
else {
|
|
2931
|
+
columnFields.push(Object.assign(Object.assign({}, column), { id: 'column' + column.field, group: 'column', code: column.field, type: column.type, title: column.title }));
|
|
2932
|
+
}
|
|
2933
|
+
});
|
|
2934
|
+
this.selectableFields = [...externalFields, ...columnFields];
|
|
2935
|
+
this.selectedField = {};
|
|
2936
|
+
this.fields.forEach(e => this.selectedField[e.id] = true);
|
|
2937
|
+
this.page = this.fields.length > 0 ? 2 : 1;
|
|
2938
|
+
this.modal.open();
|
|
2939
|
+
}
|
|
2940
|
+
}
|
|
2941
|
+
SdGridPopupQuickFilterDetail.decorators = [
|
|
2942
|
+
{ type: Component, args: [{
|
|
2943
|
+
selector: 'sd-grid-popup-quick-filter-detail',
|
|
2944
|
+
template: "<sd-modal width=\"sm\" [title]=\"(page === 1 ? 'Select filtered fields':'Input filtered fields') | sdTranslate\" #modal>\r\n <sd-modal-body>\r\n <div class=\"row\">\r\n <ng-container *ngIf=\"page === 1\">\r\n <div *ngFor=\"let field of selectableFields\" class=\"col-12\">\r\n <sd-switch [(model)]=\"selectedField[field.id]\" [label]=\"field.title\" (sdChange)=\"onSelectFields()\">\r\n </sd-switch>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"page === 2\">\r\n <div class=\"col-12\" *ngFor=\"let item of fields\">\r\n <ng-container *ngIf=\"item.group === 'external'\">\r\n <sd-input [label]=\"item.title\" *ngIf=\"item.type === 'string'\" type=\"text\"\r\n [(model)]=\"externalFilter[item.code]\">\r\n </sd-input>\r\n <sd-input-currency [label]=\"item.title\" *ngIf=\"item.type === 'number'\" [(model)]=\"externalFilter[item.code]\">\r\n </sd-input-currency>\r\n <sd-select [label]=\"item.title\" *ngIf=\"item.type === 'bool'\" [items]=\" [{value:'1',display:item.trueValue || 'True' },\r\n {value:'0',display:item.falseValue || 'False' }]\" valueField=\"value\" displayField=\"display\"\r\n [(model)]=\"externalFilter[item.code]\">\r\n </sd-select>\r\n <sd-select [label]=\"item.title\" *ngIf=\"item.type === 'radio'\" [items]=\"item.values\"\r\n [valueField]=\"item.valueField\" [displayField]=\"item.displayField\" [(model)]=\"externalFilter[item.code]\">\r\n </sd-select>\r\n <ng-container *ngIf=\"item.type === 'values'\">\r\n <sd-select *ngIf=\"item.selection === 'MULTIPLE'\" [label]=\"item.title\" [items]=\"item.values\"\r\n [valueField]=\"item.valueField\" [displayField]=\"item.displayField\" [(model)]=\"externalFilter[item.code]\"\r\n multiple=\"true\">\r\n </sd-select>\r\n <sd-autocomplete *ngIf=\"item.selection === 'AUTOCOMPLETE'\" [label]=\"item.title\" [items]=\"item.values\"\r\n [valueField]=\"item.valueField\" [displayField]=\"item.displayField\" [(model)]=\"externalFilter[item.code]\">\r\n </sd-autocomplete>\r\n <sd-select *ngIf=\"item.selection === 'MULTIPLEAUTOCOMPLETE'\" [label]=\"item.title\" [items]=\"item.values\"\r\n [valueField]=\"item.valueField\" [displayField]=\"item.displayField\" [(model)]=\"externalFilter[item.code]\"\r\n filtered=\"true\" multiple=\"true\">\r\n </sd-select>\r\n <sd-select *ngIf=\"!item.selection\" [label]=\"item.title\" [items]=\"item.values\"\r\n [valueField]=\"item.valueField\" [displayField]=\"item.displayField\" [(model)]=\"externalFilter[item.code]\">\r\n </sd-select>\r\n </ng-container>\r\n <sd-input *ngIf=\"item.type === 'custom'\" [label]=\"item.title\"\r\n [(model)]=\"externalFilter[displayKey + item.code]\"\r\n (sdFocusForceBlur)=\"item?.onClick(externalFilter, item.code, displayKey + item.code)\">\r\n </sd-input>\r\n <sd-date-time [label]=\"item.title\" *ngIf=\"item.type ==='date'\" [(model)]=\"externalFilter[item.code]\"\r\n type=\"date\">\r\n </sd-date-time>\r\n <sd-date-range [label]=\"item.title\" *ngIf=\"item.type ==='daterangefull'\"\r\n [(from)]=\"externalFilter[item.code].from\" [(to)]=\"externalFilter[item.code].to\" [min]=\"item.minDate\"\r\n [max]=\"item.maxDate\">\r\n </sd-date-range>\r\n <ng-container *ngIf=\"item.type ==='daterange'\">\r\n <div class=\"row\">\r\n <div class=\"col-6\">\r\n <sd-date-time [label]=\"item.fromTitle\" [(model)]=\"externalFilter[item.code].from\"\r\n [type]=\"item.enableTime ? 'datetime' : 'date'\" [minDate]=\"item.minDate\"\r\n [maxDate]=\"externalFilter[item.code].to || item.maxDate\">\r\n </sd-date-time>\r\n </div>\r\n <div class=\"col-6\">\r\n <sd-date-time [label]=\"item.toTitle\" [(model)]=\"externalFilter[item.code].to\"\r\n [type]=\"item.enableTime ? 'datetime' : 'date'\"\r\n [minDate]=\"item.minDate || externalFilter[item.code].from\" [maxDate]=\"item.maxDate\">\r\n </sd-date-time>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"row\" *ngIf=\"item.type ==='numberrange'\">\r\n <div class=\"col-6\">\r\n <sd-input [label]=\"item.fromTitle\" type=\" number\" [(model)]=\"externalFilter[item.code].from\">\r\n </sd-input>\r\n </div>\r\n <div class=\"col-6\">\r\n <sd-input [label]=\"item.toTitle\" type=\" number\" [(model)]=\"externalFilter[item.code].to\">\r\n </sd-input>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"item.group === 'column'\">\r\n <sd-input *ngIf=\"item.type === 'string'\" [label]=\"item.title\" type=\"text\" [(model)]=\"filter[item.code]\">\r\n </sd-input>\r\n <sd-input *ngIf=\"item.type === 'number'\" [label]=\"item.title\" type=\" number\" [(model)]=\"filter[item.code]\">\r\n </sd-input>\r\n <sd-select *ngIf=\"item.type === 'bool'\" [label]=\"item.title\" [items]=\"[{value:'1',display:item.trueValue || 'True' },\r\n {value:'0',display:item.falseValue || 'False' }]\" [(model)]=\"filter[item.code]\">\r\n </sd-select>\r\n <sd-select *ngIf=\"item.type === 'radio'\" [label]=\"item.title\" [items]=\"item.values\"\r\n [valueField]=\"item.valueField\" [displayField]=\"item.displayField\" [(model)]=\"filter[item.code]\">\r\n </sd-select>\r\n <sd-autocomplete *ngIf=\"item.type === 'values' && item.editor?.autocomplete\" [label]=\"item.title\"\r\n [items]=\"item.values\" valueField=\"value\" displayField=\"text\" [(model)]=\"filter[item.code]\">\r\n </sd-autocomplete>\r\n <sd-select *ngIf=\"item.type === 'values' && !item.editor?.autocomplete\" [label]=\"item.title\"\r\n [items]=\"item.values\" valueField=\"value\" displayField=\"text\" [(model)]=\"filter[item.code]\">\r\n </sd-select>\r\n <sd-date-time *ngIf=\"item.type ==='date' || item.type==='datetime' ||\r\n item.type==='time'\" [label]=\"item.title\" [(model)]=\" filter[item.code]\" type=\"date\">\r\n </sd-date-time>\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n </div>\r\n </sd-modal-body>\r\n <ng-container *ngIf=\"page === 1\">\r\n <sd-modal-footer *sdDesktop>\r\n <sd-button class=\"mr-auto\" (action)=\"onCancel()\" icon=\"clear\" [title]=\"'Cancel' | sdTranslate\" size=\"sm\">\r\n </sd-button>\r\n <sd-button (action)=\"page = 2\" icon=\"arrow_forward\" [title]=\"'Next' | sdTranslate\" color=\"primary\"\r\n iconSuffix=\"true\" [disabled]=\"!fields.length\" size=\"sm\"></sd-button>\r\n </sd-modal-footer>\r\n <sd-modal-footer *sdMobileTablet>\r\n <sd-button style=\"flex: 1; padding-right: 5px;\" (action)=\"onCancel()\" icon=\"clear\"\r\n [title]=\"'Cancel' | sdTranslate\" width=\"100%\" size=\"sm\"></sd-button>\r\n <sd-button style=\"flex: 1; padding-left: 5px;\" (action)=\"page = 2\" icon=\"arrow_forward\"\r\n [title]=\"'Next' | sdTranslate\" color=\"primary\" width=\"100%\" iconSuffix=\"true\" [disabled]=\"!fields.length\"\r\n size=\"sm\">\r\n </sd-button>\r\n </sd-modal-footer>\r\n </ng-container>\r\n <ng-container *ngIf=\"page === 2\">\r\n <sd-modal-footer *sdDesktop>\r\n <sd-button class=\"mr-auto\" (action)=\"page = 1\" icon=\"arrow_back\" [title]=\"'Back' | sdTranslate\" size=\"sm\">\r\n </sd-button>\r\n <sd-button (action)=\"onAccept()\" icon=\"done\" [title]=\"'Accept' | sdTranslate\" color=\"primary\" size=\"sm\">\r\n </sd-button>\r\n </sd-modal-footer>\r\n <sd-modal-footer *sdMobileTablet>\r\n <sd-button style=\"flex: 1; padding-right: 5px;\" (action)=\"page = 1\" icon=\"arrow_back\"\r\n [title]=\"'Back' | sdTranslate\" width=\"100%\" size=\"sm\"></sd-button>\r\n <sd-button style=\"flex: 1; padding-left: 5px;\" (action)=\"onAccept()\" icon=\"done\" [title]=\"'Accept' | sdTranslate\"\r\n color=\"primary\" width=\"100%\" size=\"sm\"></sd-button>\r\n </sd-modal-footer>\r\n </ng-container>\r\n</sd-modal>",
|
|
2945
|
+
styles: [""]
|
|
2946
|
+
},] }
|
|
2947
|
+
];
|
|
2948
|
+
SdGridPopupQuickFilterDetail.ctorParameters = () => [
|
|
2949
|
+
{ type: DeviceDetectorService },
|
|
2950
|
+
{ type: SdNotifyService },
|
|
2951
|
+
{ type: SdTranslateService }
|
|
2952
|
+
];
|
|
2953
|
+
SdGridPopupQuickFilterDetail.propDecorators = {
|
|
2954
|
+
modal: [{ type: ViewChild, args: ['modal',] }],
|
|
2955
|
+
quickFilters: [{ type: Input }],
|
|
2956
|
+
accept: [{ type: Output }]
|
|
2957
|
+
};
|
|
2958
|
+
|
|
2959
|
+
class SdGridSubInformation {
|
|
2960
|
+
constructor(ref, deviceService) {
|
|
2961
|
+
this.ref = ref;
|
|
2962
|
+
this.height = 'auto';
|
|
2963
|
+
this.subItems = [];
|
|
2964
|
+
this.filter = {};
|
|
2965
|
+
this.onEditorChange = () => {
|
|
2966
|
+
this.ref.detectChanges();
|
|
2967
|
+
};
|
|
2968
|
+
this.isMobileOrTablet = !deviceService.isDesktop();
|
|
2969
|
+
}
|
|
2970
|
+
ngOnInit() {
|
|
2971
|
+
}
|
|
2972
|
+
ngAfterViewInit() {
|
|
2973
|
+
}
|
|
2974
|
+
updateFilter() {
|
|
2975
|
+
}
|
|
2976
|
+
trackById(index, item) {
|
|
2977
|
+
return item.id;
|
|
2978
|
+
}
|
|
2979
|
+
}
|
|
2980
|
+
SdGridSubInformation.decorators = [
|
|
2981
|
+
{ type: Component, args: [{
|
|
2982
|
+
selector: 'sd-grid-sub-information',
|
|
2983
|
+
template: "<div class=\"clearfix\"></div>\r\n<ng-container *ngIf=\"option?.columns\">\r\n <div *ngIf=\"!isMobileOrTablet\" class=\"sd-box box-shadow-none\">\r\n <div class=\"sd-box-body p-0\">\r\n <div class=\"row mx-0\">\r\n <div class=\"table-responsive\" style=\"position: relative;\" [ngStyle]=\"{'height': height}\">\r\n <table class=\"table table-hover table-striped table-bordered c-table\">\r\n <thead class=\"thead-light\">\r\n <tr>\r\n <th class=\"position-sticky c-sticky-all align-middle p-0\" style=\"width:4px; min-width: 4px;\">\r\n </th>\r\n <th class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-all\"></th>\r\n <th *ngIf=\"option?.commands?.length\"\r\n class=\"position-sticky align-middle text-center p-0 c-sticky-top c-w-1\">\r\n </th>\r\n <th *ngFor=\"let column of option.columns\" class=\"position-sticky c-sticky-top\"\r\n [ngStyle]=\"{'width':column.width ? column.width : '','min-width':column.width ? column.width : '300px'}\">\r\n <span [title]=\"column.title\" class=\"c-header-title cursor-pointer\"\r\n [ngStyle]=\"{'width':column.width ? column.width : ''}\">\r\n {{column.title | sdTranslate}}\r\n </span>\r\n </th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-container *ngFor=\"let item of subItems; trackBy: trackById\">\r\n <tr>\r\n <td class=\"position-sticky c-sticky-left p-0\">\r\n </td>\r\n <td class=\"position-sticky h-100 p-0 c-sticky-spliter c-sticky-left\"></td>\r\n <td *ngIf=\"option.commands?.length\" class=\"align-middle px-2 py-0 c-w-1\">\r\n <div class=\"d-flex align-middle text-center justify-content-center\">\r\n <ng-container\r\n *ngIf=\"option.commands | commandFilter:item | async; $implicit as filteredCommands\">\r\n <section *ngFor=\"let command of filteredCommands\">\r\n <ng-container *ngIf=\"!command.children?.length; else elseCommandChildren\">\r\n <button *ngIf=\"!command.fontSet\" (click)=\"command.click(item)\" type=\"button\"\r\n class=\"c-btn-icon\" [matTooltip]=\"command.title | commandTitle:item\"\r\n [disabled]=\"command.disabled | commandDisabled:item\">\r\n <i class=\"{{command.icon | commandIcon:item}}\" aria-hidden=\"true\"></i>\r\n </button>\r\n <button *ngIf=\"command.fontSet\" [matTooltip]=\"command.title | commandTitle:item\"\r\n [disabled]=\"command.disabled | commandDisabled:item\" (click)=\"command.click(item)\"\r\n aria-hidden=\"true\" mat-icon-button>\r\n <mat-icon [fontSet]=\"command.fontSet\">{{command.icon | commandIcon:item}}</mat-icon>\r\n </button>\r\n </ng-container>\r\n <ng-template #elseCommandChildren>\r\n <button *ngIf=\"command.icon\" [matMenuTriggerFor]=\"menu\" type=\"button\" class=\"c-btn-icon\"\r\n [matTooltip]=\"command.title\" [disabled]=\"command.disabled | commandDisabled:item\">\r\n <i class=\"{{command.icon | commandIcon:item}}\" aria-hidden=\"true\"></i>\r\n </button>\r\n <button *ngIf=\"!command.icon\" mat-icon-button [matMenuTriggerFor]=\"menu\" type=\"button\"\r\n class=\"c-btn-icon-30\" [matTooltip]=\"command.title\"\r\n [disabled]=\"command.disabled | commandDisabled:item\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n <mat-menu #menu=\"matMenu\">\r\n <ng-container *ngFor=\"let childCommand of command.children\">\r\n <button *ngIf=\"!(item | commandHidden:childCommand | async)\" mat-menu-item\r\n [disabled]=\"childCommand.disabled | commandDisabled:item\"\r\n (click)=\"childCommand.click(item)\">\r\n <i *ngIf=\"!childCommand.fontSet\" class=\"{{childCommand.icon | commandIcon:item}}\"></i>\r\n <mat-icon *ngIf=\"childCommand.fontSet\" [fontSet]=\"childCommand.fontSet\">\r\n {{childCommand.icon | commandIcon:item}}</mat-icon>\r\n <span> {{childCommand.title | commandTitle:item}}</span>\r\n </button>\r\n </ng-container>\r\n </mat-menu>\r\n </ng-template>\r\n </section>\r\n </ng-container>\r\n </div>\r\n </td>\r\n <td *ngFor=\"let column of option.columns\" class=\"align-middle\"\r\n [ngClass]=\"{'text-center': column.type !== 'string' && column.type !== 'number', 'text-right': column.type === 'number'}\"\r\n [ngStyle]=\"{'width':column.width ? column.width : '', 'min-width':column.width ? column.width : '300px'}\">\r\n <ng-container *ngIf=\"!column.children?.length\">\r\n <ng-container *ngIf=\"item[column.field] | editorSubInformationHandler:item:option.columns\">\r\n <ng-container *ngIf=\"item.editorHandler[column.field].visible;else columnView\">\r\n <sd-grid-desktop-column-edit [column]=\"column\" [item]=\"item\" (sdChange)=\"onEditorChange()\">\r\n </sd-grid-desktop-column-edit>\r\n </ng-container>\r\n <ng-template #columnView>\r\n <sd-grid-desktop-column-view [column]=\"column\" [item]=\"item\"></sd-grid-desktop-column-view>\r\n </ng-template>\r\n </ng-container>\r\n </ng-container>\r\n <div *ngIf=\"column.children?.length\" class=\"row mx-0\">\r\n <div *ngFor=\"let childColumn of column.children | filterMobile:item\"\r\n [ngClass]=\"{'col-sm-6': childColumn?.colSpan === 1, 'col-sm-12': !childColumn?.colSpan || childColumn?.colSpan === 2}\">\r\n <span class=\"c-mobile-title\">\u2022 {{childColumn.title}}:</span>\r\n <span *ngIf=\"childColumn.type === 'string'\" class=\"c-mobile-value\"\r\n [ngClass]=\"{'badge': item.badge && item.badge[childColumn.field], 'c-mobile-badge':item.badge && item.badge[childColumn.field], \r\n 'badge-primary':item.badge && item.badge[childColumn.field] === 'PRIMARY', \r\n 'badge-secondary':item.badge && item.badge[childColumn.field] === 'SECONDARY', \r\n 'badge-info':item.badge && item.badge[childColumn.field] === 'INFO', \r\n 'badge-success':item.badge && item.badge[childColumn.field] === 'SUCCESS', \r\n 'badge-warning':item.badge && item.badge[childColumn.field] === 'WARNING', \r\n 'badge-danger':item.badge && item.badge[childColumn.field] === 'DANGER',\r\n 'badge-light':item.badge && item.badge[childColumn.field] === 'LIGHT',\r\n 'badge-dark':item.badge && item.badge[childColumn.field] === 'DARK',\r\n 'blinker': item.blinker && item.blinker[childColumn.field]}\">{{item[childColumn.field]}}</span>\r\n <span *ngIf=\"childColumn.type === 'number'\" class=\"c-mobile-value\"\r\n [ngClass]=\"{'badge': item.badge && item.badge[childColumn.field], 'c-mobile-badge':item.badge && item.badge[childColumn.field], \r\n 'badge-primary':item.badge && item.badge[childColumn.field] === 'PRIMARY', \r\n 'badge-secondary':item.badge && item.badge[childColumn.field] === 'SECONDARY', \r\n 'badge-info':item.badge && item.badge[childColumn.field] === 'INFO', \r\n 'badge-success':item.badge && item.badge[childColumn.field] === 'SUCCESS', \r\n 'badge-warning':item.badge && item.badge[childColumn.field] === 'WARNING', \r\n 'badge-danger':item.badge && item.badge[childColumn.field] === 'DANGER',\r\n 'badge-light':item.badge && item.badge[childColumn.field] === 'LIGHT',\r\n 'badge-dark':item.badge && item.badge[childColumn.field] === 'DARK',\r\n 'blinker': item.blinker && item.blinker[childColumn.field]}\">{{item[childColumn.field] | valueTransform:item:childColumn}}</span>\r\n <span *ngIf=\"childColumn.type === 'datetime'\"\r\n class=\"c-mobile-value\">{{item[childColumn.field] | date:'dd/MM/yyyy HH:mm'}}</span>\r\n <span *ngIf=\"childColumn.type === 'date'\"\r\n class=\"c-mobile-value\">{{item[childColumn.field] | date:'dd/MM/yyyy'}}</span>\r\n <span *ngIf=\"childColumn.type === 'time'\"\r\n class=\"c-mobile-value\">{{item[childColumn.field] | date:'HH:mm'}}</span>\r\n <span *ngIf=\"childColumn.type === 'bool'\" class=\"c-mobile-value\">\r\n <span *ngIf=\"item[childColumn.field]\"\r\n class=\"status status-success\">{{childColumn.trueValue || 'True'}}</span>\r\n <span *ngIf=\"!item[childColumn.field]\"\r\n class=\"status status-danger\">{{childColumn.falseValue || 'False'}}</span>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'color'\" class=\"c-mobile-value\"><input disabled=\"true\"\r\n type=\"color\" class=\"form-control form-control-sm\"\r\n [(ngModel)]=\"item[childColumn.field]\"></span>\r\n <span *ngIf=\"childColumn.type === 'values'\" class=\"status c-mobile-value\"\r\n [ngStyle]=\"{'color':childColumn?.dictionary[item[childColumn.field]]?.color}\">\r\n {{!!childColumn?.dictionary[item[childColumn.field]] ? childColumn?.dictionary[item[childColumn.field]]?.text : item[childColumn.field]}}\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'radio'\"\r\n class=\"c-mobile-value\">{{item[childColumn.field]}}</span>\r\n <img *ngIf=\"childColumn.type === 'image'\" [src]=\"item[childColumn.field]\"\r\n [width]=\"childColumn.display?.width\" [height]=\"childColumn.display?.height\"\r\n style=\"margin: 5px 0\">\r\n </div>\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div *ngIf=\"isMobileOrTablet\" class=\"sd-box c-mobile-box\">\r\n <div class=\"sd-box-body c-mobile-body\" [ngStyle]=\"{'height': height}\">\r\n <ng-container *ngFor=\"let item of subItems\">\r\n <div class=\"c-mobile-item\">\r\n <ng-container *ngFor=\"let column of option.columns | filterMobile:item\">\r\n <div *ngIf=\"item[column.field]\" class=\"c-mobile-row\">\r\n <span class=\"c-mobile-title\">\u2022 {{column.title}}:</span>\r\n <span *ngIf=\"column.type === 'string'\" class=\"c-mobile-value\" [ngClass]=\"{'badge': item.badge && item.badge[column.field], 'c-mobile-badge':item.badge && item.badge[column.field], \r\n 'badge-primary':item.badge && item.badge[column.field] === 'PRIMARY', \r\n 'badge-secondary':item.badge && item.badge[column.field] === 'SECONDARY', \r\n 'badge-info':item.badge && item.badge[column.field] === 'INFO', \r\n 'badge-success':item.badge && item.badge[column.field] === 'SUCCESS', \r\n 'badge-warning':item.badge && item.badge[column.field] === 'WARNING', \r\n 'badge-danger':item.badge && item.badge[column.field] === 'DANGER',\r\n 'badge-light':item.badge && item.badge[column.field] === 'LIGHT',\r\n 'badge-dark':item.badge && item.badge[column.field] === 'DARK',\r\n 'blinker': item.blinker && item.blinker[column.field]}\">{{item[column.field]}}</span>\r\n <span *ngIf=\"column.type === 'number'\" class=\"c-mobile-value\" [ngClass]=\"{'badge': item.badge && item.badge[column.field], 'c-mobile-badge':item.badge && item.badge[column.field], \r\n 'badge-primary':item.badge && item.badge[column.field] === 'PRIMARY', \r\n 'badge-secondary':item.badge && item.badge[column.field] === 'SECONDARY', \r\n 'badge-info':item.badge && item.badge[column.field] === 'INFO', \r\n 'badge-success':item.badge && item.badge[column.field] === 'SUCCESS', \r\n 'badge-warning':item.badge && item.badge[column.field] === 'WARNING', \r\n 'badge-danger':item.badge && item.badge[column.field] === 'DANGER',\r\n 'badge-light':item.badge && item.badge[column.field] === 'LIGHT',\r\n 'badge-dark':item.badge && item.badge[column.field] === 'DARK',\r\n 'blinker': item.blinker && item.blinker[column.field]}\">{{item[column.field] | number : '1.0-2'}}</span>\r\n <span *ngIf=\"column.type === 'datetime'\"\r\n class=\"c-mobile-value\">{{item[column.field] | date:'dd/MM/yyyy HH:mm'}}</span>\r\n <span *ngIf=\"column.type === 'date'\"\r\n class=\"c-mobile-value\">{{item[column.field] | date:'dd/MM/yyyy'}}</span>\r\n <span *ngIf=\"column.type === 'time'\" class=\"c-mobile-value\">{{item[column.field] | date:'HH:mm'}}</span>\r\n <span *ngIf=\"column.type === 'bool'\" class=\"c-mobile-value\">\r\n <span *ngIf=\"item[column.field]\" class=\"status status-success\">{{column.trueValue || 'True'}}</span>\r\n <span *ngIf=\"!item[column.field]\" class=\"status status-danger\">{{column.falseValue || 'False'}}</span>\r\n </span>\r\n <span *ngIf=\"column.type === 'color'\" class=\"c-mobile-value\"><input disabled=\"true\" type=\"color\"\r\n class=\"form-control form-control-sm\" [(ngModel)]=\"item[column.field]\"></span>\r\n <span *ngIf=\"column.type === 'values'\" class=\"status c-mobile-value\"\r\n [ngStyle]=\"{'color':column?.dictionary[item[column.field]]?.color}\">\r\n {{!!column?.dictionary[item[column.field]] ? column?.dictionary[item[column.field]]?.text : item[column.field]}}\r\n </span>\r\n <span *ngIf=\"column.type === 'radio'\" class=\"c-mobile-value\">{{item[column.field]}}</span>\r\n <img *ngIf=\"column.type === 'image'\" [src]=\"item[column.field]\" [width]=\"column.display?.width\"\r\n [height]=\"column.display?.height\" style=\"margin: 5px 0\">\r\n </div>\r\n <ng-container *ngIf=\"column.children?.length\">\r\n <div class=\"c-mobile-row\" *ngFor=\"let childColumn of column.children | filterMobile:item\">\r\n <span class=\"c-mobile-title\">\u2022 {{childColumn.title}}:</span>\r\n <span *ngIf=\"childColumn.type === 'string'\" class=\"c-mobile-value\" [ngClass]=\"{'badge': item.badge && item.badge[childColumn.field], 'c-mobile-badge':item.badge && item.badge[childColumn.field], \r\n 'badge-primary':item.badge && item.badge[childColumn.field] === 'PRIMARY', \r\n 'badge-secondary':item.badge && item.badge[childColumn.field] === 'SECONDARY', \r\n 'badge-info':item.badge && item.badge[childColumn.field] === 'INFO', \r\n 'badge-success':item.badge && item.badge[childColumn.field] === 'SUCCESS', \r\n 'badge-warning':item.badge && item.badge[childColumn.field] === 'WARNING', \r\n 'badge-danger':item.badge && item.badge[childColumn.field] === 'DANGER',\r\n 'badge-light':item.badge && item.badge[childColumn.field] === 'LIGHT',\r\n 'badge-dark':item.badge && item.badge[childColumn.field] === 'DARK',\r\n 'blinker': item.blinker && item.blinker[childColumn.field]}\">{{item[childColumn.field]}}</span>\r\n <span *ngIf=\"childColumn.type === 'number'\" class=\"c-mobile-value\"\r\n [ngClass]=\"{'badge': item.badge && item.badge[childColumn.field], 'c-mobile-badge':item.badge && item.badge[childColumn.field], \r\n 'badge-primary':item.badge && item.badge[childColumn.field] === 'PRIMARY', \r\n 'badge-secondary':item.badge && item.badge[childColumn.field] === 'SECONDARY', \r\n 'badge-info':item.badge && item.badge[childColumn.field] === 'INFO', \r\n 'badge-success':item.badge && item.badge[childColumn.field] === 'SUCCESS', \r\n 'badge-warning':item.badge && item.badge[childColumn.field] === 'WARNING', \r\n 'badge-danger':item.badge && item.badge[childColumn.field] === 'DANGER',\r\n 'badge-light':item.badge && item.badge[childColumn.field] === 'LIGHT',\r\n 'badge-dark':item.badge && item.badge[childColumn.field] === 'DARK',\r\n 'blinker': item.blinker && item.blinker[childColumn.field]}\">{{item[childColumn.field] | number : '1.0-2'}}</span>\r\n <span *ngIf=\"childColumn.type === 'datetime'\"\r\n class=\"c-mobile-value\">{{item[childColumn.field] | date:'dd/MM/yyyy HH:mm'}}</span>\r\n <span *ngIf=\"childColumn.type === 'date'\"\r\n class=\"c-mobile-value\">{{item[childColumn.field] | date:'dd/MM/yyyy'}}</span>\r\n <span *ngIf=\"childColumn.type === 'time'\"\r\n class=\"c-mobile-value\">{{item[childColumn.field] | date:'HH:mm'}}</span>\r\n <span *ngIf=\"childColumn.type === 'bool'\" class=\"c-mobile-value\">\r\n <span *ngIf=\"item[childColumn.field]\"\r\n class=\"status status-success\">{{childColumn.trueValue || 'True'}}</span>\r\n <span *ngIf=\"!item[childColumn.field]\"\r\n class=\"status status-danger\">{{childColumn.falseValue || 'False'}}</span>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'color'\" class=\"c-mobile-value\"><input disabled=\"true\" type=\"color\"\r\n class=\"form-control form-control-sm\" [(ngModel)]=\"item[childColumn.field]\"></span>\r\n <span *ngIf=\"childColumn.type === 'values'\" class=\"status c-mobile-value\"\r\n [ngStyle]=\"{'color':childColumn?.dictionary[item[childColumn.field]]?.color}\">\r\n {{!!childColumn?.dictionary[item[childColumn.field]] ? childColumn?.dictionary[item[childColumn.field]]?.text : item[childColumn.field]}}\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'radio'\" class=\"c-mobile-value\">{{item[childColumn.field]}}</span>\r\n <img *ngIf=\"childColumn.type === 'image'\" [src]=\"item[childColumn.field]\"\r\n [width]=\"childColumn.display?.width\" [height]=\"childColumn.display?.height\" style=\"margin: 5px 0\">\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</ng-container>",
|
|
2984
|
+
styles: [".grid-header{overflow-x:hidden;overflow-y:hidden}.c-table.table{margin-bottom:5px}td,th{font-size:13px;min-width:0;padding:3px 5px}.c-cell-padding{padding:3px 5px!important}.c-header-title{font-weight:500;text-transform:capitalize}span.c-header-title{display:block;overflow:hidden!important;padding:0 .3rem;text-overflow:ellipsis;white-space:nowrap}thead th{border-top:none;height:auto;min-height:20px;padding:5px}tbody td{height:25px;min-height:25px}.status{border-radius:1.5rem;color:#16759b;display:inline-block;font-weight:500;padding:2px 5px;text-align:center;text-transform:uppercase}.status-success{color:#43a047}.status-danger{color:#f44336}.cursor-pointer{cursor:pointer}label.custom-control.custom-checkbox{margin:0}.c-overflow-x-hidden{overflow-x:hidden}.c-grid-header,.c-overflow-y-hidden{overflow-y:hidden}.c-grid-header{overflow-x:hidden}.c-th-xs{height:49px;min-height:49px}.c-td-xs,.c-th-xs{font-size:.8rem;line-height:1.15;min-width:0;padding:.1rem!important}.c-td-xs{height:1.5rem;min-height:1.5rem}.c-input-xs{font-size:13px!important;height:28px!important;line-height:1.5!important;padding:3px!important}.c-sticky-top{top:0!important;z-index:20}.c-sticky-left{z-index:20}.c-sticky-all,.c-sticky-left{border-left:none!important;border-right:none!important;left:0!important}.c-sticky-all{top:0!important;z-index:30}.c-sticky-spliter{background-color:#dee2e6;border:none;min-width:1px;width:1px;z-index:40}.table-striped tbody tr:nth-of-type(2n) .c-sticky-left{background-color:#fff}.table-striped tbody tr:nth-of-type(odd) .c-sticky-left{background-color:#f2f2f2}.table-responsive>.table-bordered{border:1px solid #dee2e6!important}.c-badge{border-radius:10rem;display:block!important;font-size:.8rem;font-weight:500;padding:.3rem!important}.c-m-3{margin:3px!important}.c-m-5{margin:5px!important}.c-w-1{width:1px}.c-btn-icon{background:none!important;border:none;display:inline-flex;height:16px;opacity:.8;padding:0 3px}.c-btn-icon:hover{cursor:pointer;opacity:1}.c-btn-icon:disabled{background:none!important;border:none;cursor:not-allowed;opacity:.3}"]
|
|
2985
|
+
},] }
|
|
2986
|
+
];
|
|
2987
|
+
SdGridSubInformation.ctorParameters = () => [
|
|
2988
|
+
{ type: ChangeDetectorRef },
|
|
2989
|
+
{ type: DeviceDetectorService }
|
|
2990
|
+
];
|
|
2991
|
+
SdGridSubInformation.propDecorators = {
|
|
2992
|
+
height: [{ type: Input }],
|
|
2993
|
+
option: [{ type: Input }],
|
|
2994
|
+
subItems: [{ type: Input }]
|
|
2995
|
+
};
|
|
2996
|
+
|
|
2997
|
+
class GridDesktopColumnChildrenViewComponent {
|
|
2998
|
+
constructor() { }
|
|
2999
|
+
}
|
|
3000
|
+
GridDesktopColumnChildrenViewComponent.decorators = [
|
|
3001
|
+
{ type: Component, args: [{
|
|
3002
|
+
selector: 'sd-grid-desktop-column-children-view',
|
|
3003
|
+
template: "<ng-container *ngIf=\"column.children?.length\">\r\n <div class=\"row mx-n2 c-cell-padding\">\r\n <div *ngFor=\"let childColumn of column.children | filterMobile:item\" class=\"px-2\"\r\n [ngClass]=\"{'col-sm-6': childColumn?.colSpan === 1, 'col-sm-12': !childColumn?.colSpan || childColumn?.colSpan === 2}\">\r\n <span class=\"c-title\">\r\n {{item | columnTitle:childColumn.title:childColumn.dynamicTitle | async}}:\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'string'\"\r\n [className]=\"item[childColumn.field] | cellDesktopClassName:item:childColumn:true\"\r\n [ngClass]=\"{'blinker': item.blinker && item.blinker[childColumn.field]}\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] | valueTransform:item:childColumn}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n {{item[childColumn.field] | valueTransform:item:childColumn}}</ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'number'\"\r\n [className]=\"item[childColumn.field] | cellDesktopClassName:item:childColumn:true\"\r\n [ngClass]=\"{'blinker': item.blinker && item.blinker[childColumn.field]}\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] | valueTransform:item:childColumn}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n {{item[childColumn.field] | valueTransform:item:childColumn}}\r\n </ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'datetime'\"\r\n [className]=\"item[childColumn.field] | cellDesktopClassName:item:childColumn:true\"\r\n [ngClass]=\"{'blinker': item.blinker && item.blinker[childColumn.field]}\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] | sdTimeDifferent:'dd/MM/yyyy HH:mm':childColumn.timeDifferent | async}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n <span matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[childColumn.field] | date:'dd/MM/yyyy HH:mm'\">{{item[childColumn.field] | sdTimeDifferent:'dd/MM/yyyy HH:mm':childColumn.timeDifferent | async}}</span>\r\n </ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'date'\"\r\n [className]=\"item[childColumn.field] | cellDesktopClassName:item:childColumn:true\"\r\n [ngClass]=\"{'blinker': item.blinker && item.blinker[childColumn.field]}\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] | sdTimeDifferent:'dd/MM/yyyy':childColumn.timeDifferent | async}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n <span matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[childColumn.field] | date:'dd/MM/yyyy'\">{{item[childColumn.field] | sdTimeDifferent:'dd/MM/yyyy':childColumn.timeDifferent | async}}</span>\r\n </ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'time'\"\r\n [className]=\"item[childColumn.field] | cellDesktopClassName:item:childColumn:true\"\r\n [ngClass]=\"{'blinker': item.blinker && item.blinker[childColumn.field]}\">\r\n <a *ngIf=\"childColumn.click\" href=\"javascript:;\"\r\n (click)=\"childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field] | date:'HH:mm'}}</a>\r\n <ng-container *ngIf=\"!childColumn.click\">\r\n {{item[childColumn.field] | date:'HH:mm'}}\r\n </ng-container>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'bool'\"\r\n [className]=\"item[childColumn.field] | cellDesktopClassName:item:childColumn:true\"\r\n [ngClass]=\"{'blinker': item.blinker && item.blinker[childColumn.field]}\"\r\n (click)=\"childColumn.click && childColumn.click(item[childColumn.field], item)\">\r\n <strong *ngIf=\"item[childColumn.field]\" class=\"text-success\">{{childColumn.trueValue || 'True'}}</strong>\r\n <strong *ngIf=\"!item[childColumn.field]\" class=\"text-danger\">{{childColumn.falseValue || 'False'}}</strong>\r\n </span>\r\n <span *ngIf=\"childColumn.type === 'color'\"\r\n [className]=\"item[childColumn.field] | cellDesktopClassName:item:childColumn:true\"\r\n [ngClass]=\"{'blinker': item.blinker && item.blinker[childColumn.field]}\"\r\n (click)=\"childColumn.click && childColumn.click(item[childColumn.field], item)\"><input disabled=\"true\"\r\n type=\"color\" class=\"form-control form-control-sm\" [(ngModel)]=\"item[childColumn.field]\"></span>\r\n <ng-container *ngIf=\"childColumn.type === 'values'\">\r\n <ng-container *ngIf=\"childColumn?.dictionary[item[childColumn.field]] as dic; else elseNotInDic\">\r\n <span *ngIf=\"dic.color || dic.backgroundColor; else elseNoStatus\" class=\"status c-children\"\r\n [ngStyle]=\"{'color':dic.color, 'background-color': dic.backgroundColor}\">\r\n {{dic.text}}\r\n </span>\r\n <ng-template #elseNoStatus>\r\n <span [className]=\"item[childColumn.field] | cellDesktopClassName:item:childColumn:true\"\r\n [ngClass]=\"{'blinker': item.blinker && item.blinker[childColumn.field]}\"\r\n (click)=\"childColumn.click && childColumn.click(item[childColumn.field], item)\">\r\n {{dic.text}}\r\n </span>\r\n </ng-template>\r\n </ng-container>\r\n <ng-template #elseNotInDic>\r\n <span [className]=\"item[childColumn.field] | cellDesktopClassName:item:childColumn:true\"\r\n [ngClass]=\"{'blinker': item.blinker && item.blinker[childColumn.field]}\"\r\n (click)=\"childColumn.click && childColumn.click(item[childColumn.field], item)\">\r\n {{item[childColumn.field]}}\r\n </span>\r\n </ng-template>\r\n </ng-container>\r\n <span *ngIf=\"childColumn.type === 'radio'\"\r\n [className]=\"item[childColumn.field] | cellDesktopClassName:item:childColumn:true\"\r\n [ngClass]=\"{'blinker': item.blinker && item.blinker[childColumn.field]}\"\r\n (click)=\"childColumn.click && childColumn.click(item[childColumn.field], item)\">{{item[childColumn.field]}}</span>\r\n <img *ngIf=\"childColumn.type === 'image'\" [src]=\"item[childColumn.field]\" [width]=\"childColumn.display?.width\"\r\n [height]=\"childColumn.display?.height\" style=\"margin: 5px 0\"\r\n (click)=\"column.click && column.click(item[column.field], item)\">\r\n </div>\r\n </div>\r\n</ng-container>",
|
|
3004
|
+
styles: [".text-black400{color:#757575}.c-title{color:#212529;font-size:13px;font-weight:700;line-height:1.7;margin-right:3px}.c-badge{border-radius:10rem;color:#212529;display:block!important;font-size:14px;font-weight:500;margin:0 auto;max-width:80%;padding:5px!important}.c-badge a{color:#fff}.c-children{color:#212529;font-size:14px;overflow-wrap:break-word}.status{border-radius:1.5rem;display:inline-block;font-weight:500;padding:4px 8px;text-align:left!important;text-transform:uppercase}.status-success{color:#4caf50}.status-danger{color:#f82c13}.c-btn-icon{background:none!important;border:none;display:inline-flex;height:20px;opacity:.8;padding:0 3px}.c-btn-icon:hover{cursor:pointer;opacity:1}.c-btn-icon:disabled{background:none!important;border:none;cursor:not-allowed;opacity:.3}"]
|
|
3005
|
+
},] }
|
|
3006
|
+
];
|
|
3007
|
+
GridDesktopColumnChildrenViewComponent.ctorParameters = () => [];
|
|
3008
|
+
GridDesktopColumnChildrenViewComponent.propDecorators = {
|
|
3009
|
+
column: [{ type: Input }],
|
|
3010
|
+
item: [{ type: Input }]
|
|
3011
|
+
};
|
|
3012
|
+
|
|
3013
|
+
class CellDesktopClassNamePipe {
|
|
3014
|
+
transform(value, rowData, column, isChildren) {
|
|
3015
|
+
const classNames = [];
|
|
3016
|
+
if (column.click) {
|
|
3017
|
+
classNames.push('cursor-pointer');
|
|
3018
|
+
}
|
|
3019
|
+
if (isChildren) {
|
|
3020
|
+
classNames.push('c-children');
|
|
3021
|
+
}
|
|
3022
|
+
if (column.badge) {
|
|
3023
|
+
const badge = column.badge(rowData, value);
|
|
3024
|
+
if (badge) {
|
|
3025
|
+
classNames.push('c-badge');
|
|
3026
|
+
classNames.push('badge');
|
|
3027
|
+
if (badge === 'PRIMARY') {
|
|
3028
|
+
classNames.push('badge-primary');
|
|
3029
|
+
}
|
|
3030
|
+
else if (badge === 'SECONDARY') {
|
|
3031
|
+
classNames.push('badge-secondary');
|
|
3032
|
+
}
|
|
3033
|
+
else if (badge === 'WARNING') {
|
|
3034
|
+
classNames.push('badge-warning');
|
|
3035
|
+
}
|
|
3036
|
+
else if (badge === 'SUCCESS') {
|
|
3037
|
+
classNames.push('badge-success');
|
|
3038
|
+
}
|
|
3039
|
+
else if (badge === 'DANGER') {
|
|
3040
|
+
classNames.push('badge-danger');
|
|
3041
|
+
}
|
|
3042
|
+
else if (badge === 'LIGHT') {
|
|
3043
|
+
classNames.push('badge-light');
|
|
3044
|
+
}
|
|
3045
|
+
else if (badge === 'DARK') {
|
|
3046
|
+
classNames.push('badge-dark');
|
|
3047
|
+
}
|
|
3048
|
+
}
|
|
3049
|
+
}
|
|
3050
|
+
return classNames.join(' ');
|
|
3051
|
+
}
|
|
3052
|
+
}
|
|
3053
|
+
CellDesktopClassNamePipe.decorators = [
|
|
3054
|
+
{ type: Pipe, args: [{
|
|
3055
|
+
name: 'cellDesktopClassName'
|
|
3056
|
+
},] }
|
|
3057
|
+
];
|
|
3058
|
+
|
|
3059
|
+
class CellMobileClassNamePipe {
|
|
3060
|
+
transform(value, rowData, column) {
|
|
3061
|
+
const classNames = [];
|
|
3062
|
+
if (column.click) {
|
|
3063
|
+
classNames.push('cursor-pointer');
|
|
3064
|
+
}
|
|
3065
|
+
if (column.badge) {
|
|
3066
|
+
const badge = column.badge(rowData, value);
|
|
3067
|
+
if (badge) {
|
|
3068
|
+
classNames.push('badge');
|
|
3069
|
+
classNames.push('c-badge');
|
|
3070
|
+
if (badge === 'PRIMARY') {
|
|
3071
|
+
classNames.push('badge-primary');
|
|
3072
|
+
}
|
|
3073
|
+
else if (badge === 'SECONDARY') {
|
|
3074
|
+
classNames.push('badge-secondary');
|
|
3075
|
+
}
|
|
3076
|
+
else if (badge === 'WARNING') {
|
|
3077
|
+
classNames.push('badge-warning');
|
|
3078
|
+
}
|
|
3079
|
+
else if (badge === 'SUCCESS') {
|
|
3080
|
+
classNames.push('badge-success');
|
|
3081
|
+
}
|
|
3082
|
+
else if (badge === 'DANGER') {
|
|
3083
|
+
classNames.push('badge-danger');
|
|
3084
|
+
}
|
|
3085
|
+
else if (badge === 'LIGHT') {
|
|
3086
|
+
classNames.push('badge-light');
|
|
3087
|
+
}
|
|
3088
|
+
else if (badge === 'DARK') {
|
|
3089
|
+
classNames.push('badge-dark');
|
|
3090
|
+
}
|
|
3091
|
+
}
|
|
3092
|
+
}
|
|
3093
|
+
return classNames.join(' ');
|
|
3094
|
+
}
|
|
3095
|
+
}
|
|
3096
|
+
CellMobileClassNamePipe.decorators = [
|
|
3097
|
+
{ type: Pipe, args: [{
|
|
3098
|
+
name: 'cellMobileClassName'
|
|
3099
|
+
},] }
|
|
3100
|
+
];
|
|
3101
|
+
|
|
3102
|
+
class ColumnCommandFilterPipe {
|
|
3103
|
+
transform(commands, item) {
|
|
3104
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3105
|
+
const results = [];
|
|
3106
|
+
if (!commands) {
|
|
3107
|
+
return results;
|
|
3108
|
+
}
|
|
3109
|
+
for (const command of commands) {
|
|
3110
|
+
const { hiddenByItem } = command;
|
|
3111
|
+
if (!hiddenByItem) {
|
|
3112
|
+
results.push(command);
|
|
3113
|
+
}
|
|
3114
|
+
else {
|
|
3115
|
+
const hidden = hiddenByItem(item);
|
|
3116
|
+
if (hidden instanceof Promise) {
|
|
3117
|
+
if (!(yield hidden)) {
|
|
3118
|
+
results.push(command);
|
|
3119
|
+
}
|
|
3120
|
+
}
|
|
3121
|
+
else {
|
|
3122
|
+
if (!hidden) {
|
|
3123
|
+
results.push(command);
|
|
3124
|
+
}
|
|
3125
|
+
}
|
|
3126
|
+
}
|
|
3127
|
+
}
|
|
3128
|
+
return results;
|
|
3129
|
+
});
|
|
3130
|
+
}
|
|
3131
|
+
}
|
|
3132
|
+
ColumnCommandFilterPipe.decorators = [
|
|
3133
|
+
{ type: Pipe, args: [{
|
|
3134
|
+
name: 'columnCommandFilter'
|
|
3135
|
+
},] }
|
|
3136
|
+
];
|
|
3137
|
+
|
|
3138
|
+
class ColumnHtmlTemplatePipe {
|
|
3139
|
+
constructor(deviceService) {
|
|
3140
|
+
this.isMobileOrTablet = false;
|
|
3141
|
+
this.isMobileOrTablet = !deviceService.isDesktop();
|
|
3142
|
+
}
|
|
3143
|
+
transform(value, rowData, htmlTemplate) {
|
|
3144
|
+
if (typeof (htmlTemplate) !== 'function') {
|
|
3145
|
+
return value;
|
|
3146
|
+
}
|
|
3147
|
+
return htmlTemplate(value, rowData, this.isMobileOrTablet);
|
|
3148
|
+
}
|
|
3149
|
+
}
|
|
3150
|
+
ColumnHtmlTemplatePipe.decorators = [
|
|
3151
|
+
{ type: Pipe, args: [{
|
|
3152
|
+
name: 'columnHtmlTemplate'
|
|
3153
|
+
},] }
|
|
3154
|
+
];
|
|
3155
|
+
ColumnHtmlTemplatePipe.ctorParameters = () => [
|
|
3156
|
+
{ type: DeviceDetectorService }
|
|
3157
|
+
];
|
|
3158
|
+
|
|
3159
|
+
class ColumnTitlePipe {
|
|
3160
|
+
transform(item, title, dynamicTitle) {
|
|
3161
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3162
|
+
if (!title) {
|
|
3163
|
+
return '';
|
|
3164
|
+
}
|
|
3165
|
+
if (dynamicTitle) {
|
|
3166
|
+
const result = dynamicTitle(item);
|
|
3167
|
+
if (result instanceof Promise) {
|
|
3168
|
+
return (yield result) || title;
|
|
3169
|
+
}
|
|
3170
|
+
return result || title;
|
|
3171
|
+
}
|
|
3172
|
+
return title;
|
|
3173
|
+
});
|
|
3174
|
+
}
|
|
3175
|
+
}
|
|
3176
|
+
ColumnTitlePipe.decorators = [
|
|
3177
|
+
{ type: Pipe, args: [{
|
|
3178
|
+
name: 'columnTitle'
|
|
3179
|
+
},] }
|
|
3180
|
+
];
|
|
3181
|
+
|
|
3182
|
+
class ColumnValuesPipe {
|
|
3183
|
+
constructor(utilityService) {
|
|
3184
|
+
this.utilityService = utilityService;
|
|
3185
|
+
}
|
|
3186
|
+
transform(value, values) {
|
|
3187
|
+
const hashKey = hash(values);
|
|
3188
|
+
if (!ColumnValuesPipe.cache[hashKey]) {
|
|
3189
|
+
ColumnValuesPipe.cache[hashKey] = {
|
|
3190
|
+
values,
|
|
3191
|
+
obj: this.utilityService.arrayToObject(values, 'value')
|
|
3192
|
+
};
|
|
3193
|
+
}
|
|
3194
|
+
if (!ColumnValuesPipe.cache[hashKey].obj[value]) {
|
|
3195
|
+
return {
|
|
3196
|
+
value,
|
|
3197
|
+
text: value
|
|
3198
|
+
};
|
|
3199
|
+
}
|
|
3200
|
+
return ColumnValuesPipe.cache[hashKey].obj[value];
|
|
3201
|
+
}
|
|
3202
|
+
}
|
|
3203
|
+
ColumnValuesPipe.cache = {};
|
|
3204
|
+
ColumnValuesPipe.decorators = [
|
|
3205
|
+
{ type: Pipe, args: [{
|
|
3206
|
+
name: 'columnValues'
|
|
3207
|
+
},] }
|
|
3208
|
+
];
|
|
3209
|
+
ColumnValuesPipe.ctorParameters = () => [
|
|
3210
|
+
{ type: SdUtilityService }
|
|
3211
|
+
];
|
|
3212
|
+
|
|
3213
|
+
class CommandDisabledPipe {
|
|
3214
|
+
transform(disabled, item) {
|
|
3215
|
+
if (!disabled) {
|
|
3216
|
+
return false;
|
|
3217
|
+
}
|
|
3218
|
+
if (typeof (disabled) === 'boolean') {
|
|
3219
|
+
return disabled;
|
|
3220
|
+
}
|
|
3221
|
+
return disabled(item);
|
|
3222
|
+
}
|
|
3223
|
+
}
|
|
3224
|
+
CommandDisabledPipe.decorators = [
|
|
3225
|
+
{ type: Pipe, args: [{
|
|
3226
|
+
name: 'commandDisabled'
|
|
3227
|
+
},] }
|
|
3228
|
+
];
|
|
3229
|
+
|
|
3230
|
+
class CommandFilterPipe {
|
|
3231
|
+
transform(commands, item) {
|
|
3232
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3233
|
+
const results = [];
|
|
3234
|
+
if (!commands) {
|
|
3235
|
+
return results;
|
|
3236
|
+
}
|
|
3237
|
+
for (const command of commands) {
|
|
3238
|
+
if ('children' in command) {
|
|
3239
|
+
let flag = true;
|
|
3240
|
+
const { hiddenByItem } = command;
|
|
3241
|
+
if (hiddenByItem) {
|
|
3242
|
+
const hidden = hiddenByItem(item);
|
|
3243
|
+
if (hidden instanceof Promise) {
|
|
3244
|
+
if (yield hidden) {
|
|
3245
|
+
flag = false;
|
|
3246
|
+
}
|
|
3247
|
+
}
|
|
3248
|
+
else {
|
|
3249
|
+
if (hidden) {
|
|
3250
|
+
flag = false;
|
|
3251
|
+
}
|
|
3252
|
+
}
|
|
3253
|
+
}
|
|
3254
|
+
if (flag) {
|
|
3255
|
+
const children = [];
|
|
3256
|
+
for (const childCommand of command.children) {
|
|
3257
|
+
if (!childCommand.hiddenByItem) {
|
|
3258
|
+
children.push(childCommand);
|
|
3259
|
+
}
|
|
3260
|
+
else {
|
|
3261
|
+
const hidden = childCommand.hiddenByItem(item);
|
|
3262
|
+
if (hidden instanceof Promise) {
|
|
3263
|
+
if (!(yield hidden)) {
|
|
3264
|
+
children.push(childCommand);
|
|
3265
|
+
}
|
|
3266
|
+
}
|
|
3267
|
+
else {
|
|
3268
|
+
if (!hidden) {
|
|
3269
|
+
children.push(childCommand);
|
|
3270
|
+
}
|
|
3271
|
+
}
|
|
3272
|
+
}
|
|
3273
|
+
}
|
|
3274
|
+
if (children.length) {
|
|
3275
|
+
results.push(Object.assign(Object.assign({}, command), { children }));
|
|
3276
|
+
}
|
|
3277
|
+
}
|
|
3278
|
+
}
|
|
3279
|
+
else {
|
|
3280
|
+
const { hiddenByItem } = command;
|
|
3281
|
+
if (!hiddenByItem) {
|
|
3282
|
+
results.push(command);
|
|
3283
|
+
}
|
|
3284
|
+
else {
|
|
3285
|
+
const hidden = hiddenByItem(item);
|
|
3286
|
+
if (hidden instanceof Promise) {
|
|
3287
|
+
if (!(yield hidden)) {
|
|
3288
|
+
results.push(command);
|
|
3289
|
+
}
|
|
3290
|
+
}
|
|
3291
|
+
else {
|
|
3292
|
+
if (!hidden) {
|
|
3293
|
+
results.push(command);
|
|
3294
|
+
}
|
|
3295
|
+
}
|
|
3296
|
+
}
|
|
3297
|
+
}
|
|
3298
|
+
}
|
|
3299
|
+
return results;
|
|
3300
|
+
});
|
|
3301
|
+
}
|
|
3302
|
+
}
|
|
3303
|
+
CommandFilterPipe.decorators = [
|
|
3304
|
+
{ type: Pipe, args: [{
|
|
3305
|
+
name: 'commandFilter'
|
|
3306
|
+
},] }
|
|
3307
|
+
];
|
|
3308
|
+
|
|
3309
|
+
class CommandHidden {
|
|
3310
|
+
transform(item, command) {
|
|
3311
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3312
|
+
const { hidden, hiddenByItem } = command;
|
|
3313
|
+
if (hidden) {
|
|
3314
|
+
return true;
|
|
3315
|
+
}
|
|
3316
|
+
if (hiddenByItem) {
|
|
3317
|
+
const hiddenResult = hiddenByItem(item);
|
|
3318
|
+
if (hiddenResult instanceof Promise) {
|
|
3319
|
+
if (yield hiddenResult) {
|
|
3320
|
+
return true;
|
|
3321
|
+
}
|
|
3322
|
+
}
|
|
3323
|
+
else {
|
|
3324
|
+
if (hiddenResult) {
|
|
3325
|
+
return true;
|
|
3326
|
+
}
|
|
3327
|
+
}
|
|
3328
|
+
}
|
|
3329
|
+
if ('children' in command) {
|
|
3330
|
+
const results = [];
|
|
3331
|
+
for (const childCommand of command.children) {
|
|
3332
|
+
const { hidden: childHidden, hiddenByItem: childHiddenByItem } = childCommand;
|
|
3333
|
+
if (!childHidden && !childHiddenByItem) {
|
|
3334
|
+
results.push(childCommand);
|
|
3335
|
+
}
|
|
3336
|
+
else {
|
|
3337
|
+
if (childHiddenByItem) {
|
|
3338
|
+
const hiddenResult = childHiddenByItem(item);
|
|
3339
|
+
if (hiddenResult instanceof Promise) {
|
|
3340
|
+
if (!(yield hiddenResult)) {
|
|
3341
|
+
results.push(childCommand);
|
|
3342
|
+
}
|
|
3343
|
+
}
|
|
3344
|
+
else {
|
|
3345
|
+
if (!hiddenResult) {
|
|
3346
|
+
results.push(childCommand);
|
|
3347
|
+
}
|
|
3348
|
+
}
|
|
3349
|
+
}
|
|
3350
|
+
}
|
|
3351
|
+
}
|
|
3352
|
+
if (results.length === 0) {
|
|
3353
|
+
return true;
|
|
3354
|
+
}
|
|
3355
|
+
}
|
|
3356
|
+
return false;
|
|
3357
|
+
});
|
|
3358
|
+
}
|
|
3359
|
+
}
|
|
3360
|
+
CommandHidden.decorators = [
|
|
3361
|
+
{ type: Pipe, args: [{
|
|
3362
|
+
name: 'commandHidden'
|
|
3363
|
+
},] }
|
|
3364
|
+
];
|
|
3365
|
+
|
|
3366
|
+
class CommandIconPipe {
|
|
3367
|
+
transform(icon, item) {
|
|
3368
|
+
if (!icon) {
|
|
3369
|
+
return '';
|
|
3370
|
+
}
|
|
3371
|
+
if (typeof (icon) === 'string') {
|
|
3372
|
+
return icon;
|
|
3373
|
+
}
|
|
3374
|
+
return icon(item);
|
|
3375
|
+
}
|
|
3376
|
+
}
|
|
3377
|
+
CommandIconPipe.decorators = [
|
|
3378
|
+
{ type: Pipe, args: [{
|
|
3379
|
+
name: 'commandIcon'
|
|
3380
|
+
},] }
|
|
3381
|
+
];
|
|
3382
|
+
|
|
3383
|
+
class CommandTitlePipe {
|
|
3384
|
+
transform(title, item) {
|
|
3385
|
+
if (!title) {
|
|
3386
|
+
return '';
|
|
3387
|
+
}
|
|
3388
|
+
if (typeof (title) === 'string') {
|
|
3389
|
+
return title;
|
|
3390
|
+
}
|
|
3391
|
+
return title(item);
|
|
3392
|
+
}
|
|
3393
|
+
}
|
|
3394
|
+
CommandTitlePipe.decorators = [
|
|
3395
|
+
{ type: Pipe, args: [{
|
|
3396
|
+
name: 'commandTitle'
|
|
3397
|
+
},] }
|
|
3398
|
+
];
|
|
3399
|
+
|
|
3400
|
+
class EditorDynamicItemPipe {
|
|
3401
|
+
constructor() {
|
|
3402
|
+
this.previousResults = [];
|
|
3403
|
+
this.delay = 200; // Sau khoảng thời gian delay nếu không có thay đổi thì thì mới bắt đầu thực hiện gọi hàm
|
|
3404
|
+
}
|
|
3405
|
+
transform(value, item, editor) {
|
|
3406
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3407
|
+
if (!editor.dependOnField) {
|
|
3408
|
+
return editor.items || [];
|
|
3409
|
+
}
|
|
3410
|
+
this.previous = new Date();
|
|
3411
|
+
yield new Promise(resolve => setTimeout(resolve, this.delay));
|
|
3412
|
+
const now = new Date();
|
|
3413
|
+
const dif = now.getTime() - this.previous.getTime();
|
|
3414
|
+
if (dif < this.delay) {
|
|
3415
|
+
return this.previousResults;
|
|
3416
|
+
}
|
|
3417
|
+
const items = editor.items || [];
|
|
3418
|
+
if (typeof (items) === 'function') {
|
|
3419
|
+
const results = items(item, value);
|
|
3420
|
+
if (results instanceof Promise) {
|
|
3421
|
+
this.previousResults = yield results;
|
|
3422
|
+
}
|
|
3423
|
+
else {
|
|
3424
|
+
this.previousResults = results;
|
|
3425
|
+
}
|
|
3426
|
+
}
|
|
3427
|
+
else {
|
|
3428
|
+
this.previousResults = items;
|
|
3429
|
+
}
|
|
3430
|
+
this.previousResults = this.previousResults || [];
|
|
3431
|
+
return this.previousResults;
|
|
3432
|
+
});
|
|
3433
|
+
}
|
|
3434
|
+
}
|
|
3435
|
+
EditorDynamicItemPipe.decorators = [
|
|
3436
|
+
{ type: Pipe, args: [{
|
|
3437
|
+
name: 'editorDynamicItem'
|
|
3438
|
+
},] }
|
|
3439
|
+
];
|
|
3440
|
+
|
|
3441
|
+
class EditorSubInformationHandlerPipe {
|
|
3442
|
+
transform(value, item, columns) {
|
|
3443
|
+
const visible = (column) => {
|
|
3444
|
+
if (column.type === 'children') {
|
|
3445
|
+
return false;
|
|
3446
|
+
}
|
|
3447
|
+
let isDisabled = false;
|
|
3448
|
+
// Kiểm tra xem có bị disabled hay không?
|
|
3449
|
+
if (column.editor) {
|
|
3450
|
+
isDisabled = typeof (column.editor.disabled) === 'function' ? column.editor.disabled(item) : column.editor.disabled;
|
|
3451
|
+
}
|
|
3452
|
+
// Nếu bị disabled return false
|
|
3453
|
+
if (isDisabled) {
|
|
3454
|
+
return false;
|
|
3455
|
+
}
|
|
3456
|
+
// Nếu bị disabled return false
|
|
3457
|
+
if (isDisabled) {
|
|
3458
|
+
return false;
|
|
3459
|
+
}
|
|
3460
|
+
// Hiển thị editor nếu dòng đó:
|
|
3461
|
+
// Đang được edit: editingStatus
|
|
3462
|
+
return item.editingStatus
|
|
3463
|
+
// Được thiết lập alwayDisplay
|
|
3464
|
+
|| (column.editor && column.editor.alwayDisplay);
|
|
3465
|
+
};
|
|
3466
|
+
item.editorHandler = item.editorHandler || {};
|
|
3467
|
+
for (const column of columns) {
|
|
3468
|
+
item.editorHandler.disabled = false;
|
|
3469
|
+
item.editorHandler[column.field] = {};
|
|
3470
|
+
if (item.editorHandler.disabled) {
|
|
3471
|
+
item.editorHandler[column.field].visible = false;
|
|
3472
|
+
}
|
|
3473
|
+
else {
|
|
3474
|
+
item.editorHandler[column.field].visible = visible(column);
|
|
3475
|
+
}
|
|
3476
|
+
}
|
|
3477
|
+
return true;
|
|
3478
|
+
}
|
|
3479
|
+
}
|
|
3480
|
+
EditorSubInformationHandlerPipe.decorators = [
|
|
3481
|
+
{ type: Pipe, args: [{
|
|
3482
|
+
name: 'editorSubInformationHandler'
|
|
3483
|
+
},] }
|
|
3484
|
+
];
|
|
3485
|
+
|
|
3486
|
+
class EditorValidatePipe {
|
|
3487
|
+
constructor() {
|
|
3488
|
+
this.delay = 1000; // Sau khoảng thời gian delay nếu không có thay đổi thì thì mới bắt đầu thực hiện validate
|
|
3489
|
+
}
|
|
3490
|
+
transform(value, item, validate) {
|
|
3491
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3492
|
+
this.previous = new Date();
|
|
3493
|
+
yield new Promise(resolve => setTimeout(resolve, this.delay));
|
|
3494
|
+
const now = new Date();
|
|
3495
|
+
const dif = now.getTime() - this.previous.getTime();
|
|
3496
|
+
if (dif < this.delay) {
|
|
3497
|
+
return true;
|
|
3498
|
+
}
|
|
3499
|
+
item.editorHandler = item.editorHandler || {};
|
|
3500
|
+
if (!validate) {
|
|
3501
|
+
item.editorHandler.errorMessage = null;
|
|
3502
|
+
return true;
|
|
3503
|
+
}
|
|
3504
|
+
const result = validate(item);
|
|
3505
|
+
if (result instanceof Promise) {
|
|
3506
|
+
item.editorHandler.errorMessage = yield result;
|
|
3507
|
+
return true;
|
|
3508
|
+
}
|
|
3509
|
+
else {
|
|
3510
|
+
item.editorHandler.errorMessage = result;
|
|
3511
|
+
return true;
|
|
3512
|
+
}
|
|
3513
|
+
});
|
|
3514
|
+
}
|
|
3515
|
+
}
|
|
3516
|
+
EditorValidatePipe.decorators = [
|
|
3517
|
+
{ type: Pipe, args: [{
|
|
3518
|
+
name: 'editorValidate'
|
|
3519
|
+
},] }
|
|
3520
|
+
];
|
|
3521
|
+
|
|
3522
|
+
class FilterMobilePipe {
|
|
3523
|
+
transform(columns, item) {
|
|
3524
|
+
// Những giá trị undefined, null và rỗng sẽ bỏ qua khi hiển thị trên mobile
|
|
3525
|
+
return columns.filter(column => {
|
|
3526
|
+
var _a;
|
|
3527
|
+
return (item[column.field] !== undefined
|
|
3528
|
+
&& item[column.field] !== null
|
|
3529
|
+
&& item[column.field] !== '')
|
|
3530
|
+
|| column.htmlTemplate
|
|
3531
|
+
|| column.type === 'children'
|
|
3532
|
+
|| (column.type === 'string' && ((_a = column.commands) === null || _a === void 0 ? void 0 : _a.length) > 0);
|
|
3533
|
+
});
|
|
3534
|
+
}
|
|
3535
|
+
}
|
|
3536
|
+
FilterMobilePipe.decorators = [
|
|
3537
|
+
{ type: Pipe, args: [{
|
|
3538
|
+
name: 'filterMobile',
|
|
3539
|
+
pure: false
|
|
3540
|
+
},] }
|
|
3541
|
+
];
|
|
3542
|
+
|
|
3543
|
+
class MobileCommandFilterPipe {
|
|
3544
|
+
transform(commands, item) {
|
|
3545
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3546
|
+
const results = [];
|
|
3547
|
+
if (!commands) {
|
|
3548
|
+
return results;
|
|
3549
|
+
}
|
|
3550
|
+
for (const command of commands) {
|
|
3551
|
+
if ('children' in command) {
|
|
3552
|
+
let flag = true;
|
|
3553
|
+
const { hiddenByItem } = command;
|
|
3554
|
+
if (hiddenByItem) {
|
|
3555
|
+
const hidden = hiddenByItem(item);
|
|
3556
|
+
if (hidden instanceof Promise) {
|
|
3557
|
+
if (yield hidden) {
|
|
3558
|
+
flag = false;
|
|
3559
|
+
}
|
|
3560
|
+
}
|
|
3561
|
+
else {
|
|
3562
|
+
if (hidden) {
|
|
3563
|
+
flag = false;
|
|
3564
|
+
}
|
|
3565
|
+
}
|
|
3566
|
+
}
|
|
3567
|
+
if (flag) {
|
|
3568
|
+
for (const childCommand of command.children) {
|
|
3569
|
+
if (!childCommand.hiddenByItem) {
|
|
3570
|
+
results.push(childCommand);
|
|
3571
|
+
}
|
|
3572
|
+
else {
|
|
3573
|
+
const hidden = childCommand.hiddenByItem(item);
|
|
3574
|
+
if (hidden instanceof Promise) {
|
|
3575
|
+
if (!(yield hidden)) {
|
|
3576
|
+
results.push(childCommand);
|
|
3577
|
+
}
|
|
3578
|
+
}
|
|
3579
|
+
else {
|
|
3580
|
+
if (!hidden) {
|
|
3581
|
+
results.push(childCommand);
|
|
3582
|
+
}
|
|
3583
|
+
}
|
|
3584
|
+
}
|
|
3585
|
+
}
|
|
3586
|
+
}
|
|
3587
|
+
}
|
|
3588
|
+
else {
|
|
3589
|
+
const { hiddenByItem } = command;
|
|
3590
|
+
if (!hiddenByItem) {
|
|
3591
|
+
results.push(command);
|
|
3592
|
+
}
|
|
3593
|
+
else {
|
|
3594
|
+
const hidden = hiddenByItem(item);
|
|
3595
|
+
if (hidden instanceof Promise) {
|
|
3596
|
+
if (!(yield hidden)) {
|
|
3597
|
+
results.push(command);
|
|
3598
|
+
}
|
|
3599
|
+
}
|
|
3600
|
+
else {
|
|
3601
|
+
if (!hidden) {
|
|
3602
|
+
results.push(command);
|
|
3603
|
+
}
|
|
3604
|
+
}
|
|
3605
|
+
}
|
|
3606
|
+
}
|
|
3607
|
+
}
|
|
3608
|
+
return results;
|
|
3609
|
+
});
|
|
3610
|
+
}
|
|
3611
|
+
}
|
|
3612
|
+
MobileCommandFilterPipe.decorators = [
|
|
3613
|
+
{ type: Pipe, args: [{
|
|
3614
|
+
name: 'mobileCommandFilter'
|
|
3615
|
+
},] }
|
|
3616
|
+
];
|
|
3617
|
+
|
|
3618
|
+
class MobileViewHtmlTemplatePipe {
|
|
3619
|
+
transform(rowData, columns, htmlTemplate) {
|
|
3620
|
+
return htmlTemplate(rowData, columns);
|
|
3621
|
+
}
|
|
3622
|
+
}
|
|
3623
|
+
MobileViewHtmlTemplatePipe.decorators = [
|
|
3624
|
+
{ type: Pipe, args: [{
|
|
3625
|
+
name: 'mobileViewHtmlTempate'
|
|
3626
|
+
},] }
|
|
3627
|
+
];
|
|
3628
|
+
|
|
3629
|
+
class ValueTransformPipe {
|
|
3630
|
+
constructor(decimalPipe) {
|
|
3631
|
+
this.decimalPipe = decimalPipe;
|
|
3632
|
+
}
|
|
3633
|
+
transform(value, rowData, column) {
|
|
3634
|
+
if (column.transform) {
|
|
3635
|
+
return column.transform(value, rowData);
|
|
3636
|
+
}
|
|
3637
|
+
else if (column.type === 'number' && Number.isNumber(value)) {
|
|
3638
|
+
return this.decimalPipe.transform(value, '1.0-2');
|
|
3639
|
+
}
|
|
3640
|
+
return value;
|
|
3641
|
+
}
|
|
3642
|
+
}
|
|
3643
|
+
ValueTransformPipe.decorators = [
|
|
3644
|
+
{ type: Pipe, args: [{
|
|
3645
|
+
name: 'valueTransform'
|
|
3646
|
+
},] }
|
|
3647
|
+
];
|
|
3648
|
+
ValueTransformPipe.ctorParameters = () => [
|
|
3649
|
+
{ type: DecimalPipe }
|
|
3650
|
+
];
|
|
3651
|
+
|
|
3652
|
+
class EditorPopupVisiblePipe {
|
|
3653
|
+
transform(column, item) {
|
|
3654
|
+
var _a, _b;
|
|
3655
|
+
if (column.type === 'children') {
|
|
3656
|
+
return false;
|
|
3657
|
+
}
|
|
3658
|
+
if (typeof ((_a = column.editor) === null || _a === void 0 ? void 0 : _a.hidden) === 'boolean' && column.editor.hidden) {
|
|
3659
|
+
return false;
|
|
3660
|
+
}
|
|
3661
|
+
if (typeof ((_b = column.editor) === null || _b === void 0 ? void 0 : _b.hidden) === 'function' && column.editor.hidden(item)) {
|
|
3662
|
+
return false;
|
|
3663
|
+
}
|
|
3664
|
+
return true;
|
|
3665
|
+
}
|
|
3666
|
+
}
|
|
3667
|
+
EditorPopupVisiblePipe.decorators = [
|
|
3668
|
+
{ type: Pipe, args: [{
|
|
3669
|
+
name: 'editorPopupVisible'
|
|
3670
|
+
},] }
|
|
3671
|
+
];
|
|
3672
|
+
|
|
3673
|
+
class SdSubHeaderDefDirective {
|
|
3674
|
+
constructor(templateRef) {
|
|
3675
|
+
this.templateRef = templateRef;
|
|
3676
|
+
}
|
|
3677
|
+
}
|
|
3678
|
+
SdSubHeaderDefDirective.decorators = [
|
|
3679
|
+
{ type: Directive, args: [{
|
|
3680
|
+
selector: '[sdSubHeaderDef]'
|
|
3681
|
+
},] }
|
|
3682
|
+
];
|
|
3683
|
+
SdSubHeaderDefDirective.ctorParameters = () => [
|
|
3684
|
+
{ type: TemplateRef }
|
|
3685
|
+
];
|
|
3686
|
+
|
|
3687
|
+
class SdGridImportExcel {
|
|
3688
|
+
constructor() {
|
|
3689
|
+
this.open = () => {
|
|
3690
|
+
var _a;
|
|
3691
|
+
(_a = this.control) === null || _a === void 0 ? void 0 : _a.open();
|
|
3692
|
+
};
|
|
3693
|
+
}
|
|
3694
|
+
set columns(gridColumns) {
|
|
3695
|
+
const columns = [];
|
|
3696
|
+
gridColumns.forEach(column => {
|
|
3697
|
+
var _a;
|
|
3698
|
+
if (column.ignoreImport) {
|
|
3699
|
+
return;
|
|
3700
|
+
}
|
|
3701
|
+
if (column.type === 'string' || column.type === 'color') {
|
|
3702
|
+
columns.push({
|
|
3703
|
+
type: 'string',
|
|
3704
|
+
field: column.field,
|
|
3705
|
+
title: column.title,
|
|
3706
|
+
width: column.width
|
|
3707
|
+
});
|
|
3708
|
+
}
|
|
3709
|
+
else if (column.type === 'number') {
|
|
3710
|
+
columns.push({
|
|
3711
|
+
type: 'number',
|
|
3712
|
+
field: column.field,
|
|
3713
|
+
title: column.title,
|
|
3714
|
+
width: column.width
|
|
3715
|
+
});
|
|
3716
|
+
}
|
|
3717
|
+
else if (column.type === 'bool') {
|
|
3718
|
+
columns.push({
|
|
3719
|
+
type: 'bool',
|
|
3720
|
+
field: column.field,
|
|
3721
|
+
title: column.title,
|
|
3722
|
+
width: column.width
|
|
3723
|
+
});
|
|
3724
|
+
}
|
|
3725
|
+
else if (column.type === 'date') {
|
|
3726
|
+
columns.push({
|
|
3727
|
+
type: 'date',
|
|
3728
|
+
field: column.field,
|
|
3729
|
+
title: column.title,
|
|
3730
|
+
width: column.width
|
|
3731
|
+
});
|
|
3732
|
+
}
|
|
3733
|
+
else if (column.type === 'datetime' || column.type === 'time') {
|
|
3734
|
+
columns.push({
|
|
3735
|
+
type: 'datetime',
|
|
3736
|
+
field: column.field,
|
|
3737
|
+
title: column.title,
|
|
3738
|
+
width: column.width
|
|
3739
|
+
});
|
|
3740
|
+
}
|
|
3741
|
+
else if (column.type === 'values') {
|
|
3742
|
+
columns.push({
|
|
3743
|
+
type: 'values',
|
|
3744
|
+
field: column.field,
|
|
3745
|
+
title: column.title,
|
|
3746
|
+
width: column.width,
|
|
3747
|
+
values: column.values.map(e => e.value),
|
|
3748
|
+
});
|
|
3749
|
+
}
|
|
3750
|
+
else if (column.type === 'radio') {
|
|
3751
|
+
columns.push({
|
|
3752
|
+
type: 'radio',
|
|
3753
|
+
field: column.field,
|
|
3754
|
+
title: column.title,
|
|
3755
|
+
width: column.width,
|
|
3756
|
+
values: column.values.map(e => e[column.valueField])
|
|
3757
|
+
});
|
|
3758
|
+
}
|
|
3759
|
+
if (column.type === 'children' && ((_a = column.children) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
3760
|
+
column.children.forEach(childColumn => {
|
|
3761
|
+
if (childColumn.ignoreImport) {
|
|
3762
|
+
return;
|
|
3763
|
+
}
|
|
3764
|
+
if (childColumn.type === 'string' || childColumn.type === 'color') {
|
|
3765
|
+
columns.push({
|
|
3766
|
+
type: 'string',
|
|
3767
|
+
field: childColumn.field,
|
|
3768
|
+
title: childColumn.title,
|
|
3769
|
+
width: childColumn.width
|
|
3770
|
+
});
|
|
3771
|
+
}
|
|
3772
|
+
else if (childColumn.type === 'number') {
|
|
3773
|
+
columns.push({
|
|
3774
|
+
type: 'number',
|
|
3775
|
+
field: childColumn.field,
|
|
3776
|
+
title: childColumn.title,
|
|
3777
|
+
width: childColumn.width
|
|
3778
|
+
});
|
|
3779
|
+
}
|
|
3780
|
+
else if (childColumn.type === 'bool') {
|
|
3781
|
+
columns.push({
|
|
3782
|
+
type: 'bool',
|
|
3783
|
+
field: childColumn.field,
|
|
3784
|
+
title: childColumn.title,
|
|
3785
|
+
width: childColumn.width
|
|
3786
|
+
});
|
|
3787
|
+
}
|
|
3788
|
+
else if (childColumn.type === 'date') {
|
|
3789
|
+
columns.push({
|
|
3790
|
+
type: 'date',
|
|
3791
|
+
field: childColumn.field,
|
|
3792
|
+
title: childColumn.title,
|
|
3793
|
+
width: childColumn.width
|
|
3794
|
+
});
|
|
3795
|
+
}
|
|
3796
|
+
else if (childColumn.type === 'datetime' || childColumn.type === 'time') {
|
|
3797
|
+
columns.push({
|
|
3798
|
+
type: 'datetime',
|
|
3799
|
+
field: childColumn.field,
|
|
3800
|
+
title: childColumn.title,
|
|
3801
|
+
width: childColumn.width
|
|
3802
|
+
});
|
|
3803
|
+
}
|
|
3804
|
+
else if (childColumn.type === 'values') {
|
|
3805
|
+
columns.push({
|
|
3806
|
+
type: 'values',
|
|
3807
|
+
field: childColumn.field,
|
|
3808
|
+
title: childColumn.title,
|
|
3809
|
+
width: childColumn.width,
|
|
3810
|
+
values: childColumn.values.map(e => e.value),
|
|
3811
|
+
});
|
|
3812
|
+
}
|
|
3813
|
+
else if (childColumn.type === 'radio') {
|
|
3814
|
+
columns.push({
|
|
3815
|
+
type: 'radio',
|
|
3816
|
+
field: childColumn.field,
|
|
3817
|
+
title: childColumn.title,
|
|
3818
|
+
width: childColumn.width,
|
|
3819
|
+
values: childColumn.values.map(e => e[childColumn.valueField])
|
|
3820
|
+
});
|
|
3821
|
+
}
|
|
3822
|
+
});
|
|
3823
|
+
}
|
|
3824
|
+
});
|
|
3825
|
+
this.option = {
|
|
3826
|
+
key: `GridImport${this.key}`,
|
|
3827
|
+
columns,
|
|
3828
|
+
onAccept: this.accept
|
|
3829
|
+
};
|
|
3830
|
+
}
|
|
3831
|
+
}
|
|
3832
|
+
SdGridImportExcel.decorators = [
|
|
3833
|
+
{ type: Component, args: [{
|
|
3834
|
+
selector: 'sd-grid-import-excel',
|
|
3835
|
+
template: "<sd-upload-excel *ngIf=\"option\" [option]=\"option\" #control></sd-upload-excel>"
|
|
3836
|
+
},] }
|
|
3837
|
+
];
|
|
3838
|
+
SdGridImportExcel.ctorParameters = () => [];
|
|
3839
|
+
SdGridImportExcel.propDecorators = {
|
|
3840
|
+
key: [{ type: Input }],
|
|
3841
|
+
accept: [{ type: Input }],
|
|
3842
|
+
columns: [{ type: Input }],
|
|
3843
|
+
control: [{ type: ViewChild, args: [SdUploadExcel,] }]
|
|
3844
|
+
};
|
|
3845
|
+
|
|
3846
|
+
class SdGridModule {
|
|
3847
|
+
}
|
|
3848
|
+
SdGridModule.decorators = [
|
|
3849
|
+
{ type: NgModule, args: [{
|
|
3850
|
+
imports: [
|
|
3851
|
+
CommonModule,
|
|
3852
|
+
FormsModule,
|
|
3853
|
+
ReactiveFormsModule,
|
|
3854
|
+
MatInputModule,
|
|
3855
|
+
MatFormFieldModule,
|
|
3856
|
+
MatPaginatorModule,
|
|
3857
|
+
MatTableModule,
|
|
3858
|
+
MatMenuModule,
|
|
3859
|
+
MatIconModule,
|
|
3860
|
+
MatButtonModule,
|
|
3861
|
+
MatTooltipModule,
|
|
3862
|
+
MatProgressSpinnerModule,
|
|
3863
|
+
MatChipsModule,
|
|
3864
|
+
MatRadioModule,
|
|
3865
|
+
MatSlideToggleModule,
|
|
3866
|
+
MatSelectModule,
|
|
3867
|
+
MatCheckboxModule,
|
|
3868
|
+
SdUploadExcelModule,
|
|
3869
|
+
SdFormModule,
|
|
3870
|
+
SdServiceModule
|
|
3871
|
+
],
|
|
3872
|
+
declarations: [
|
|
3873
|
+
SdGrid,
|
|
3874
|
+
SdGridConfig,
|
|
3875
|
+
SdGridDesktopColumnEdit,
|
|
3876
|
+
SdGridDesktopColumnView,
|
|
3877
|
+
SdGridDesktopInlineFilter,
|
|
3878
|
+
SdGridMobileItemView,
|
|
3879
|
+
SdGridPopupEditor,
|
|
3880
|
+
SdGridPopupExportExcel,
|
|
3881
|
+
SdGridPopupFilter,
|
|
3882
|
+
SdGridPopupQuickFilterDetail,
|
|
3883
|
+
SdGridSubInformation,
|
|
3884
|
+
SdGridImportExcel,
|
|
3885
|
+
GridDesktopColumnChildrenViewComponent,
|
|
3886
|
+
CellDesktopClassNamePipe,
|
|
3887
|
+
CellMobileClassNamePipe,
|
|
3888
|
+
ColumnCommandFilterPipe,
|
|
3889
|
+
ColumnHtmlTemplatePipe,
|
|
3890
|
+
ColumnTitlePipe,
|
|
3891
|
+
ColumnValuesPipe,
|
|
3892
|
+
CommandDisabledPipe,
|
|
3893
|
+
CommandFilterPipe,
|
|
3894
|
+
CommandHidden,
|
|
3895
|
+
CommandIconPipe,
|
|
3896
|
+
CommandTitlePipe,
|
|
3897
|
+
SdDynamicItems,
|
|
3898
|
+
EditorDynamicItemPipe,
|
|
3899
|
+
EditorHandlerPipe,
|
|
3900
|
+
EditorSubInformationHandlerPipe,
|
|
3901
|
+
EditorValidatePipe,
|
|
3902
|
+
FilterMobilePipe,
|
|
3903
|
+
MobileCommandFilterPipe,
|
|
3904
|
+
MobileViewHtmlTemplatePipe,
|
|
3905
|
+
ValueTransformPipe,
|
|
3906
|
+
EditorPopupVisiblePipe,
|
|
3907
|
+
SdCellDefDirective,
|
|
3908
|
+
SdCellEditorDefDirective,
|
|
3909
|
+
SdCellFooterDevDirective,
|
|
3910
|
+
SdSubHeaderDefDirective,
|
|
3911
|
+
],
|
|
3912
|
+
exports: [
|
|
3913
|
+
SdGrid,
|
|
3914
|
+
SdCellDefDirective,
|
|
3915
|
+
SdCellEditorDefDirective,
|
|
3916
|
+
SdCellFooterDevDirective,
|
|
3917
|
+
SdSubHeaderDefDirective,
|
|
3918
|
+
],
|
|
3919
|
+
providers: [
|
|
3920
|
+
HandlerLocal,
|
|
3921
|
+
HandlerDotnet,
|
|
3922
|
+
EditorHandlerPipe
|
|
3923
|
+
]
|
|
3924
|
+
},] }
|
|
3925
|
+
];
|
|
3926
|
+
|
|
3927
|
+
class QuickFilter {
|
|
3928
|
+
}
|
|
3929
|
+
|
|
3930
|
+
/**
|
|
3931
|
+
* Generated bundle index. Do not edit.
|
|
3932
|
+
*/
|
|
3933
|
+
|
|
3934
|
+
export { CellDesktopClassNamePipe, CellMobileClassNamePipe, ColumnCommandFilterPipe, ColumnHtmlTemplatePipe, ColumnTitlePipe, ColumnValuesPipe, CommandDisabledPipe, CommandFilterPipe, CommandHidden, CommandIconPipe, CommandTitlePipe, EditorDynamicItemPipe, EditorHandlerPipe, EditorPopupVisiblePipe, EditorSubInformationHandlerPipe, EditorValidatePipe, FilterMobilePipe, GRID_CONFIG, GridDesktopColumnChildrenViewComponent, HandlerDotnet, HandlerLocal, MobileCommandFilterPipe, MobileViewHtmlTemplatePipe, QuickFilter, SdCellDefDirective, SdCellEditorDefDirective, SdCellFooterDevDirective, SdDynamicItems, SdGrid, SdGridConfig, SdGridDesktopColumnEdit, SdGridDesktopColumnView, SdGridDesktopInlineFilter, SdGridImportExcel, SdGridMobileItemView, SdGridModule, SdGridPopupEditor, SdGridPopupExportExcel, SdGridPopupFilter, SdGridPopupQuickFilterDetail, SdGridSubInformation, SdSubHeaderDefDirective, ValueTransformPipe, defaultGridOption };
|
|
3935
|
+
//# sourceMappingURL=sd-angular-core-grid.js.map
|