@sd-angular/core 1.3.126 → 1.3.128
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/assets/img/file-types/eps/001-file.eps +143 -143
- package/assets/img/file-types/eps/002-file-1.eps +136 -136
- package/assets/img/file-types/eps/003-file-2.eps +130 -130
- package/assets/img/file-types/eps/004-file-3.eps +127 -127
- package/assets/img/file-types/eps/005-file-4.eps +120 -120
- package/assets/img/file-types/eps/006-file-5.eps +133 -133
- package/assets/img/file-types/eps/007-file-6.eps +133 -133
- package/assets/img/file-types/eps/008-file-7.eps +144 -144
- package/assets/img/file-types/eps/009-file-8.eps +150 -150
- package/assets/img/file-types/eps/010-file-9.eps +155 -155
- package/assets/img/file-types/eps/011-file-10.eps +124 -124
- package/assets/img/file-types/eps/012-file-11.eps +147 -147
- package/assets/img/file-types/eps/013-file-12.eps +125 -125
- package/assets/img/file-types/eps/014-file-13.eps +129 -129
- package/assets/img/file-types/eps/015-file-14.eps +143 -143
- package/assets/img/file-types/eps/016-file-15.eps +130 -130
- package/assets/img/file-types/eps/017-file-16.eps +197 -197
- package/assets/img/file-types/eps/018-file-17.eps +146 -146
- package/assets/img/file-types/eps/019-file-18.eps +131 -131
- package/assets/img/file-types/eps/020-file-19.eps +137 -137
- package/assets/img/file-types/eps/021-file-20.eps +134 -134
- package/assets/img/file-types/eps/022-file-21.eps +130 -130
- package/assets/img/file-types/eps/023-file-22.eps +161 -161
- package/assets/img/file-types/eps/024-file-23.eps +144 -144
- package/assets/img/file-types/eps/025-file-24.eps +164 -164
- package/assets/img/file-types/eps/026-file-25.eps +135 -135
- package/assets/img/file-types/eps/027-file-26.eps +124 -124
- package/assets/img/file-types/eps/028-file-27.eps +120 -120
- package/assets/img/file-types/eps/029-file-28.eps +141 -141
- package/assets/img/file-types/eps/030-file-29.eps +130 -130
- package/assets/img/file-types/eps/031-file-30.eps +157 -157
- package/assets/img/file-types/eps/032-file-31.eps +139 -139
- package/assets/img/file-types/eps/033-file-32.eps +139 -139
- package/assets/img/file-types/eps/034-file-33.eps +189 -189
- package/assets/img/file-types/eps/035-file-34.eps +162 -162
- package/assets/img/file-types/eps/036-file-35.eps +142 -142
- package/assets/img/file-types/eps/037-file-36.eps +123 -123
- package/assets/img/file-types/eps/038-file-37.eps +127 -127
- package/assets/img/file-types/eps/039-file-38.eps +146 -146
- package/assets/img/file-types/eps/040-file-39.eps +126 -126
- package/assets/img/file-types/eps/041-file-40.eps +117 -117
- package/assets/img/file-types/eps/042-file-41.eps +156 -156
- package/assets/img/file-types/eps/043-file-42.eps +118 -118
- package/assets/img/file-types/eps/044-file-43.eps +172 -172
- package/assets/img/file-types/eps/045-file-44.eps +201 -201
- package/assets/img/file-types/eps/046-file-45.eps +94 -94
- package/assets/img/file-types/eps/047-file-46.eps +176 -176
- package/assets/img/file-types/eps/048-file-47.eps +238 -238
- package/assets/img/file-types/eps/049-file-48.eps +187 -187
- package/assets/img/file-types/eps/050-file-49.eps +137 -137
- package/bundles/sd-angular-core-chip.umd.js +4 -2
- package/bundles/sd-angular-core-chip.umd.js.map +1 -1
- package/bundles/sd-angular-core-chip.umd.min.js +1 -1
- package/bundles/sd-angular-core-chip.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-pdf.umd.js +35 -18
- package/bundles/sd-angular-core-pdf.umd.js.map +1 -1
- package/bundles/sd-angular-core-pdf.umd.min.js +2 -2
- package/bundles/sd-angular-core-pdf.umd.min.js.map +1 -1
- package/esm2015/api/index.js +1 -1
- package/esm2015/api/sd-angular-core-api.js +1 -1
- package/esm2015/api/src/lib/api.model.js +1 -1
- package/esm2015/api/src/lib/api.module.js +1 -1
- package/esm2015/api/src/lib/api.service.js +1 -1
- package/esm2015/api/src/lib/http.interceptor.js +1 -1
- package/esm2015/api/src/lib/http.service.js +1 -1
- package/esm2015/api/src/lib/token.service.js +1 -1
- package/esm2015/api/src/public-api.js +1 -1
- package/esm2015/autocomplete/index.js +1 -1
- package/esm2015/autocomplete/sd-angular-core-autocomplete.js +1 -1
- package/esm2015/autocomplete/src/lib/autocomplete-display-def.directive.js +1 -1
- package/esm2015/autocomplete/src/lib/autocomplete.component.js +1 -1
- package/esm2015/autocomplete/src/lib/autocomplete.module.js +1 -1
- package/esm2015/autocomplete/src/public-api.js +1 -1
- package/esm2015/badge/index.js +1 -1
- package/esm2015/badge/sd-angular-core-badge.js +1 -1
- package/esm2015/badge/src/lib/badge.component.js +1 -1
- package/esm2015/badge/src/lib/badge.module.js +1 -1
- package/esm2015/badge/src/public-api.js +1 -1
- package/esm2015/button/index.js +1 -1
- package/esm2015/button/sd-angular-core-button.js +1 -1
- package/esm2015/button/src/lib/button.component.js +1 -1
- package/esm2015/button/src/lib/button.module.js +1 -1
- package/esm2015/button/src/public-api.js +1 -1
- package/esm2015/cache/index.js +1 -1
- package/esm2015/cache/sd-angular-core-cache.js +1 -1
- package/esm2015/cache/src/lib/cache.model.js +1 -1
- package/esm2015/cache/src/lib/cache.service.js +1 -1
- package/esm2015/cache/src/public-api.js +1 -1
- package/esm2015/chart/index.js +1 -1
- package/esm2015/chart/sd-angular-core-chart.js +1 -1
- package/esm2015/chart/src/lib/chart.component.js +1 -1
- package/esm2015/chart/src/lib/chart.model.js +1 -1
- package/esm2015/chart/src/lib/chart.module.js +1 -1
- package/esm2015/chart/src/public-api.js +1 -1
- package/esm2015/checkbox/index.js +1 -1
- package/esm2015/checkbox/sd-angular-core-checkbox.js +1 -1
- package/esm2015/checkbox/src/lib/checkbox.component.js +1 -1
- package/esm2015/checkbox/src/lib/checkbox.module.js +1 -1
- package/esm2015/checkbox/src/public-api.js +1 -1
- package/esm2015/chip/index.js +1 -1
- package/esm2015/chip/sd-angular-core-chip.js +1 -1
- package/esm2015/chip/src/lib/chip.component.js +5 -3
- package/esm2015/chip/src/lib/chip.model.js +1 -1
- package/esm2015/chip/src/lib/chip.module.js +1 -1
- package/esm2015/chip/src/lib/directives/sd-chip-display-def.directive.js +1 -1
- package/esm2015/chip/src/lib/pipes/removable-chip.pipe.js +1 -1
- package/esm2015/chip/src/public-api.js +1 -1
- package/esm2015/comment/index.js +1 -1
- package/esm2015/comment/sd-angular-core-comment.js +1 -1
- package/esm2015/comment/src/lib/comment.component.js +1 -1
- package/esm2015/comment/src/lib/comment.model.js +1 -1
- package/esm2015/comment/src/lib/comment.module.js +1 -1
- package/esm2015/comment/src/public-api.js +1 -1
- package/esm2015/common/index.js +1 -1
- package/esm2015/common/sd-angular-core-common.js +1 -1
- package/esm2015/common/src/lib/common.module.js +1 -1
- package/esm2015/common/src/lib/configurations/firebase.configuration.js +1 -1
- package/esm2015/common/src/lib/configurations/form.configuration.js +1 -1
- package/esm2015/common/src/lib/directives/sd-lable.directive.js +1 -1
- package/esm2015/common/src/lib/directives/sd-let.directive.js +1 -1
- package/esm2015/common/src/lib/directives/sd-scroll.directive.js +1 -1
- package/esm2015/common/src/lib/directives/sd-suffix.directive.js +1 -1
- package/esm2015/common/src/lib/directives/view-def.directive.js +1 -1
- package/esm2015/common/src/lib/models/sd-form-control.js +1 -1
- package/esm2015/common/src/lib/others/detectIncognito.js +1 -1
- package/esm2015/common/src/lib/services/browser.service.js +1 -1
- package/esm2015/common/src/lib/typings/array.extension.js +1 -1
- package/esm2015/common/src/lib/typings/date.extension.js +1 -1
- package/esm2015/common/src/lib/typings/index.js +1 -1
- package/esm2015/common/src/lib/typings/number.extension.js +1 -1
- package/esm2015/common/src/lib/typings/string.extension.js +1 -1
- package/esm2015/common/src/lib/typings/utility.extension.js +1 -1
- package/esm2015/common/src/public-api.js +1 -1
- package/esm2015/confirm/index.js +1 -1
- package/esm2015/confirm/sd-angular-core-confirm.js +1 -1
- package/esm2015/confirm/src/lib/components/dialog-confirm/dialog-confirm.component.js +1 -1
- package/esm2015/confirm/src/lib/confirm.module.js +1 -1
- package/esm2015/confirm/src/lib/confirm.service.js +1 -1
- package/esm2015/confirm/src/public-api.js +1 -1
- package/esm2015/date-month/index.js +1 -1
- package/esm2015/date-month/sd-angular-core-date-month.js +1 -1
- package/esm2015/date-month/src/lib/date-month.component.js +1 -1
- package/esm2015/date-month/src/lib/date-month.module.js +1 -1
- package/esm2015/date-month/src/public-api.js +1 -1
- package/esm2015/date-range/index.js +1 -1
- package/esm2015/date-range/sd-angular-core-date-range.js +1 -1
- package/esm2015/date-range/src/lib/date-range.component.js +1 -1
- package/esm2015/date-range/src/lib/date-range.module.js +1 -1
- package/esm2015/date-range/src/public-api.js +1 -1
- package/esm2015/date-time/index.js +1 -1
- package/esm2015/date-time/sd-angular-core-date-time.js +1 -1
- package/esm2015/date-time/src/lib/date-time.component.js +1 -1
- package/esm2015/date-time/src/lib/date-time.module.js +1 -1
- package/esm2015/date-time/src/public-api.js +1 -1
- package/esm2015/db/index.js +1 -1
- package/esm2015/db/sd-angular-core-db.js +1 -1
- package/esm2015/db/src/lib/db.model.js +1 -1
- package/esm2015/db/src/lib/db.service.js +1 -1
- package/esm2015/db/src/public-api.js +1 -1
- package/esm2015/dynamic-report/index.js +1 -1
- package/esm2015/dynamic-report/sd-angular-core-dynamic-report.js +1 -1
- package/esm2015/dynamic-report/src/lib/dynamic-report.component.js +1 -1
- package/esm2015/dynamic-report/src/lib/dynamic-report.module.js +1 -1
- package/esm2015/dynamic-report/src/public-api.js +1 -1
- package/esm2015/editor/index.js +1 -1
- package/esm2015/editor/sd-angular-core-editor.js +1 -1
- package/esm2015/editor/src/lib/constant.js +1 -1
- package/esm2015/editor/src/lib/editor.component.js +1 -1
- package/esm2015/editor/src/lib/editor.model.js +1 -1
- package/esm2015/editor/src/lib/editor.module.js +1 -1
- package/esm2015/editor/src/public-api.js +1 -1
- package/esm2015/export/index.js +1 -1
- package/esm2015/export/sd-angular-core-export.js +1 -1
- package/esm2015/export/src/lib/excel.model.js +1 -1
- package/esm2015/export/src/lib/export.model.js +1 -1
- package/esm2015/export/src/lib/export.service.js +1 -1
- package/esm2015/export/src/public-api.js +1 -1
- package/esm2015/filter/index.js +1 -1
- package/esm2015/filter/sd-angular-core-filter.js +1 -1
- package/esm2015/filter/src/lib/directives/sd-filter-def.directive.js +1 -1
- package/esm2015/filter/src/lib/filter.component.js +1 -1
- package/esm2015/filter/src/lib/filter.model.js +1 -1
- package/esm2015/filter/src/lib/filter.module.js +1 -1
- package/esm2015/filter/src/lib/filter.service.js +1 -1
- package/esm2015/filter/src/lib/pipes/values-local.pipe.js +1 -1
- package/esm2015/filter/src/lib/pipes/values-server.pipe.js +1 -1
- package/esm2015/filter/src/public-api.js +1 -1
- package/esm2015/form/index.js +1 -1
- package/esm2015/form/sd-angular-core-form.js +1 -1
- package/esm2015/form/src/lib/form.module.js +1 -1
- package/esm2015/form/src/public-api.js +1 -1
- package/esm2015/grid/index.js +1 -1
- package/esm2015/grid/sd-angular-core-grid.js +1 -1
- package/esm2015/grid/src/lib/components/grid-config/grid-config.component.js +1 -1
- package/esm2015/grid/src/lib/components/grid-config/grid-config.model.js +1 -1
- package/esm2015/grid/src/lib/components/grid-desktop-column-children-view/grid-desktop-column-children-view.component.js +1 -1
- package/esm2015/grid/src/lib/components/grid-desktop-column-edit/grid-desktop-column-edit.component.js +1 -1
- package/esm2015/grid/src/lib/components/grid-desktop-column-view/grid-desktop-column-view.component.js +1 -1
- package/esm2015/grid/src/lib/components/grid-desktop-inline-filter/grid-desktop-inline-filter.component.js +1 -1
- package/esm2015/grid/src/lib/components/grid-import-excel/grid-import-excel.component.js +1 -1
- package/esm2015/grid/src/lib/components/grid-mobile-item-view/grid-mobile-item-view.component.js +1 -1
- package/esm2015/grid/src/lib/components/grid-popup-editor/grid-popup-editor.component.js +1 -1
- package/esm2015/grid/src/lib/components/grid-popup-export-excel/grid-popup-export-excel.component.js +1 -1
- package/esm2015/grid/src/lib/components/grid-popup-export-excel/grid-popup-export-excel.model.js +1 -1
- package/esm2015/grid/src/lib/components/grid-popup-filter/grid-popup-filter.component.js +1 -1
- package/esm2015/grid/src/lib/components/grid-popup-filter/grid-popup-filter.model.js +1 -1
- package/esm2015/grid/src/lib/components/grid-popup-quick-filter-detail/grid-popup-quick-filter-detail.component.js +1 -1
- package/esm2015/grid/src/lib/components/grid-sub-information/grid-sub-information.component.js +1 -1
- package/esm2015/grid/src/lib/directives/cell-def.directive.js +1 -1
- package/esm2015/grid/src/lib/directives/cell-editor-def.directive.js +1 -1
- package/esm2015/grid/src/lib/directives/cell-footer-def.directive.js +1 -1
- package/esm2015/grid/src/lib/directives/sub-information-header-def.directive.js +1 -1
- package/esm2015/grid/src/lib/grid.component.js +1 -1
- package/esm2015/grid/src/lib/grid.model.js +1 -1
- package/esm2015/grid/src/lib/grid.module.js +1 -1
- package/esm2015/grid/src/lib/models/filter-info.model.js +1 -1
- package/esm2015/grid/src/lib/models/grid-configuration.model.js +1 -1
- package/esm2015/grid/src/lib/models/handler-dotnet.js +1 -1
- package/esm2015/grid/src/lib/models/handler-local.js +1 -1
- package/esm2015/grid/src/lib/models/handler.js +1 -1
- package/esm2015/grid/src/lib/pipes/cell-desktop-class-name.pipe.js +1 -1
- package/esm2015/grid/src/lib/pipes/cell-mobile-class-name.pipe.js +1 -1
- package/esm2015/grid/src/lib/pipes/column-command-filter.pipe.js +1 -1
- package/esm2015/grid/src/lib/pipes/column-html-template.pipe.js +1 -1
- package/esm2015/grid/src/lib/pipes/column-title.pipe.js +1 -1
- package/esm2015/grid/src/lib/pipes/column-values.pipe.js +1 -1
- package/esm2015/grid/src/lib/pipes/command-disabled.pipe.js +1 -1
- package/esm2015/grid/src/lib/pipes/command-filter.pipe.js +1 -1
- package/esm2015/grid/src/lib/pipes/command-hidden.pipe.js +1 -1
- package/esm2015/grid/src/lib/pipes/command-icon.pipe.js +1 -1
- package/esm2015/grid/src/lib/pipes/command-title.pipe.js +1 -1
- package/esm2015/grid/src/lib/pipes/dynamic-items.pipe.js +1 -1
- package/esm2015/grid/src/lib/pipes/editor-dynamic-item.pipe.js +1 -1
- package/esm2015/grid/src/lib/pipes/editor-handler.pipe.js +1 -1
- package/esm2015/grid/src/lib/pipes/editor-popup-visible.pipe.js +1 -1
- package/esm2015/grid/src/lib/pipes/editor-sub-information-handler.pipe.js +1 -1
- package/esm2015/grid/src/lib/pipes/editor-validate.pipe.js +1 -1
- package/esm2015/grid/src/lib/pipes/filter-mobile.pipe.js +1 -1
- package/esm2015/grid/src/lib/pipes/mobile-command-filter.js +1 -1
- package/esm2015/grid/src/lib/pipes/mobile-view-html-template.pipe.js +1 -1
- package/esm2015/grid/src/lib/pipes/value-transform.pipe.js +1 -1
- package/esm2015/grid/src/public-api.js +1 -1
- package/esm2015/grid-material/index.js +1 -1
- package/esm2015/grid-material/sd-angular-core-grid-material.js +1 -1
- package/esm2015/grid-material/src/lib/components/column-inline-filter/column-inline-filter.component.js +1 -1
- package/esm2015/grid-material/src/lib/components/desktop-cell/desktop-cell.component.js +1 -1
- package/esm2015/grid-material/src/lib/components/desktop-cell-children-view/desktop-cell-children-view.component.js +1 -1
- package/esm2015/grid-material/src/lib/components/desktop-cell-editor/desktop-cell-editor.component.js +1 -1
- package/esm2015/grid-material/src/lib/components/desktop-cell-view/desktop-cell-view.component.js +1 -1
- package/esm2015/grid-material/src/lib/components/desktop-command/desktop-command.component.js +1 -1
- package/esm2015/grid-material/src/lib/components/desktop-editor-validation/desktop-editor-validation.component.js +1 -1
- package/esm2015/grid-material/src/lib/components/dynamic-column/dynamic-column.component.js +1 -1
- package/esm2015/grid-material/src/lib/components/grid-filter/grid-filter.component.js +1 -1
- package/esm2015/grid-material/src/lib/components/popup-export/popup-export.component.js +1 -1
- package/esm2015/grid-material/src/lib/components/popup-filter/popup-filter.component.js +1 -1
- package/esm2015/grid-material/src/lib/components/popup-grid-configuration/popup-grid-configuration.component.js +1 -1
- package/esm2015/grid-material/src/lib/components/quick-action/quick-action.component.js +1 -1
- package/esm2015/grid-material/src/lib/directives/sd-material-cell-def.directive.js +1 -1
- package/esm2015/grid-material/src/lib/directives/sd-material-empty-data-def.directive.js +1 -1
- package/esm2015/grid-material/src/lib/directives/sd-material-filter-def.directive.js +1 -1
- package/esm2015/grid-material/src/lib/directives/sd-material-footer-def.directive.js +1 -1
- package/esm2015/grid-material/src/lib/directives/sd-material-sub-information-def.directive.js +1 -1
- package/esm2015/grid-material/src/lib/functions/calculate-sd-id.js +1 -1
- package/esm2015/grid-material/src/lib/grid-material.component.js +1 -1
- package/esm2015/grid-material/src/lib/grid-material.module.js +1 -1
- package/esm2015/grid-material/src/lib/models/grid-action.model.js +1 -1
- package/esm2015/grid-material/src/lib/models/grid-cell.model.js +1 -1
- package/esm2015/grid-material/src/lib/models/grid-column.model.js +1 -1
- package/esm2015/grid-material/src/lib/models/grid-command.model.js +1 -1
- package/esm2015/grid-material/src/lib/models/grid-config.model.js +1 -1
- package/esm2015/grid-material/src/lib/models/grid-configuration.model.js +1 -1
- package/esm2015/grid-material/src/lib/models/grid-editor.model.js +1 -1
- package/esm2015/grid-material/src/lib/models/grid-export.model.js +1 -1
- package/esm2015/grid-material/src/lib/models/grid-group.model.js +1 -1
- package/esm2015/grid-material/src/lib/models/grid-option.model.js +1 -1
- package/esm2015/grid-material/src/lib/models/grid-reload.model.js +1 -1
- package/esm2015/grid-material/src/lib/models/grid-selection.model.js +1 -1
- package/esm2015/grid-material/src/lib/models/grid-style.model.js +1 -1
- package/esm2015/grid-material/src/lib/models/grid-sub-information.model.js +1 -1
- package/esm2015/grid-material/src/lib/models/grid.model.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/cell-view.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/column-badge.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/column-children-filter.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/column-html-template.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/column-title.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/column-tooltip.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/column-transform.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/column-values.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/command-disable.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/command-filter.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/command-icon.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/command-title.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/editor-handler-column.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/editor-handler-row.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/editor-validate.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/filter-column.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/filter-external.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/grid-configuration-result.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/sd-group.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/selection-action-filter.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/selection-disable.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/selection-visible-select-all.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/selection-visible.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/style-row-css.pipe.js +1 -1
- package/esm2015/grid-material/src/lib/services/generated-column/generated-column.model.js +1 -1
- package/esm2015/grid-material/src/lib/services/generated-column/generated-column.service.js +1 -1
- package/esm2015/grid-material/src/lib/services/grid-configuration.service.js +1 -1
- package/esm2015/grid-material/src/lib/services/grid-filter/grid-filter.model.js +1 -1
- package/esm2015/grid-material/src/lib/services/grid-filter/grid-filter.service.js +1 -1
- package/esm2015/grid-material/src/public-api.js +1 -1
- package/esm2015/group/index.js +1 -1
- package/esm2015/group/sd-angular-core-group.js +1 -1
- package/esm2015/group/src/lib/group.component.js +1 -1
- package/esm2015/group/src/lib/group.module.js +1 -1
- package/esm2015/group/src/public-api.js +1 -1
- package/esm2015/header-title/index.js +1 -1
- package/esm2015/header-title/sd-angular-core-header-title.js +1 -1
- package/esm2015/header-title/src/lib/header-title.component.js +1 -1
- package/esm2015/header-title/src/lib/header-title.module.js +1 -1
- package/esm2015/header-title/src/public-api.js +1 -1
- package/esm2015/image-preview/index.js +1 -1
- package/esm2015/image-preview/sd-angular-core-image-preview.js +1 -1
- package/esm2015/image-preview/src/lib/directives/image-preview.directive.js +1 -1
- package/esm2015/image-preview/src/lib/image-preview/image-preview-sdmodal.component.js +1 -1
- package/esm2015/image-preview/src/lib/image-preview/image-preview.component.js +1 -1
- package/esm2015/image-preview/src/lib/image-preview/image-preview.module.js +1 -1
- package/esm2015/image-preview/src/lib/models/image-preview.model.js +1 -1
- package/esm2015/image-preview/src/public-api.js +1 -1
- package/esm2015/input/index.js +1 -1
- package/esm2015/input/sd-angular-core-input.js +1 -1
- package/esm2015/input/src/lib/directives/input-suffix.directive.js +1 -1
- package/esm2015/input/src/lib/directives/touch.directive.js +1 -1
- package/esm2015/input/src/lib/input-tooltip.pipe.js +1 -1
- package/esm2015/input/src/lib/input.component.js +1 -1
- package/esm2015/input/src/lib/input.module.js +1 -1
- package/esm2015/input/src/public-api.js +1 -1
- package/esm2015/input-currency/index.js +1 -1
- package/esm2015/input-currency/sd-angular-core-input-currency.js +1 -1
- package/esm2015/input-currency/src/lib/input-currency-tooltip.pipe.js +1 -1
- package/esm2015/input-currency/src/lib/input-currency.component.js +1 -1
- package/esm2015/input-currency/src/lib/input-currency.module.js +1 -1
- package/esm2015/input-currency/src/public-api.js +1 -1
- package/esm2015/input-dropdown/index.js +1 -1
- package/esm2015/input-dropdown/sd-angular-core-input-dropdown.js +1 -1
- package/esm2015/input-dropdown/src/lib/input-tooltip.pipe.js +1 -1
- package/esm2015/input-dropdown/src/lib/input.component.js +1 -1
- package/esm2015/input-dropdown/src/lib/input.module.js +1 -1
- package/esm2015/input-dropdown/src/public-api.js +1 -1
- package/esm2015/input-number/index.js +1 -1
- package/esm2015/input-number/sd-angular-core-input-number.js +1 -1
- package/esm2015/input-number/src/lib/input-number.component.js +1 -1
- package/esm2015/input-number/src/lib/input-number.module.js +1 -1
- package/esm2015/input-number/src/public-api.js +1 -1
- package/esm2015/input-upload-file/index.js +1 -1
- package/esm2015/input-upload-file/sd-angular-core-input-upload-file.js +1 -1
- package/esm2015/input-upload-file/src/lib/input-upload-file.component.js +1 -1
- package/esm2015/input-upload-file/src/lib/input-upload-file.module.js +1 -1
- package/esm2015/input-upload-file/src/public-api.js +1 -1
- package/esm2015/json-editor/index.js +1 -1
- package/esm2015/json-editor/sd-angular-core-json-editor.js +1 -1
- package/esm2015/json-editor/src/lib/json-editor.component.js +1 -1
- package/esm2015/json-editor/src/lib/json-editor.module.js +1 -1
- package/esm2015/json-editor/src/public-api.js +1 -1
- package/esm2015/konva/index.js +1 -1
- package/esm2015/konva/sd-angular-core-konva.js +1 -1
- package/esm2015/konva/src/lib/konva.module.js +1 -1
- package/esm2015/konva/src/lib/merge-images/merge-images.component.js +1 -1
- package/esm2015/konva/src/public-api.js +1 -1
- package/esm2015/label/index.js +1 -1
- package/esm2015/label/sd-angular-core-label.js +1 -1
- package/esm2015/label/src/lib/label.component.js +1 -1
- package/esm2015/label/src/lib/label.module.js +1 -1
- package/esm2015/label/src/public-api.js +1 -1
- package/esm2015/lib/core.module.js +1 -1
- package/esm2015/lib/material.module.js +1 -1
- package/esm2015/loading/index.js +1 -1
- package/esm2015/loading/sd-angular-core-loading.js +1 -1
- package/esm2015/loading/src/lib/loading.service.js +1 -1
- package/esm2015/loading/src/public-api.js +1 -1
- package/esm2015/modal/index.js +1 -1
- package/esm2015/modal/sd-angular-core-modal.js +1 -1
- package/esm2015/modal/src/lib/bottom-sheet/bottom-sheet-body/bottom-sheet-body.component.js +1 -1
- package/esm2015/modal/src/lib/bottom-sheet/bottom-sheet-footer/bottom-sheet-footer.component.js +1 -1
- package/esm2015/modal/src/lib/bottom-sheet/bottom-sheet-header/bottom-sheet-header.component.js +1 -1
- package/esm2015/modal/src/lib/bottom-sheet/bottom-sheet.component.js +1 -1
- package/esm2015/modal/src/lib/modal/modal-body/modal-body.component.js +1 -1
- package/esm2015/modal/src/lib/modal/modal-footer/modal-footer.component.js +1 -1
- package/esm2015/modal/src/lib/modal/modal-header/modal-header.component.js +1 -1
- package/esm2015/modal/src/lib/modal/modal.component.js +1 -1
- package/esm2015/modal/src/lib/modal.module.js +1 -1
- package/esm2015/modal/src/public-api.js +1 -1
- package/esm2015/modal-resizable/index.js +1 -1
- package/esm2015/modal-resizable/sd-angular-core-modal-resizable.js +1 -1
- package/esm2015/modal-resizable/src/lib/modal-resizable/modal-resizable.component.js +1 -1
- package/esm2015/modal-resizable/src/lib/modal-resizable.module.js +1 -1
- package/esm2015/modal-resizable/src/public-api.js +1 -1
- package/esm2015/notify/index.js +1 -1
- package/esm2015/notify/sd-angular-core-notify.js +1 -1
- package/esm2015/notify/src/lib/components/dialog-confirm/dialog-confirm.component.js +1 -1
- package/esm2015/notify/src/lib/configurations/notify.configuration.js +1 -1
- package/esm2015/notify/src/lib/notify.module.js +1 -1
- package/esm2015/notify/src/lib/notify.service.js +1 -1
- package/esm2015/notify/src/public-api.js +1 -1
- package/esm2015/pdf/index.js +1 -1
- package/esm2015/pdf/sd-angular-core-pdf.js +1 -1
- package/esm2015/pdf/src/lib/pdf.module.js +1 -1
- package/esm2015/pdf/src/lib/pdf.service.js +20 -4
- package/esm2015/pdf/src/public-api.js +1 -1
- package/esm2015/popover/index.js +1 -1
- package/esm2015/popover/sd-angular-core-popover.js +1 -1
- package/esm2015/popover/src/lib/directives/popover-content.directive.js +1 -1
- package/esm2015/popover/src/lib/directives/popover-trigger.directive.js +1 -1
- package/esm2015/popover/src/lib/popover/popover.component.js +1 -1
- package/esm2015/popover/src/lib/popover.model.js +1 -1
- package/esm2015/popover/src/lib/popover.module.js +1 -1
- package/esm2015/popover/src/public-api.js +1 -1
- package/esm2015/print/index.js +1 -1
- package/esm2015/print/sd-angular-core-print.js +1 -1
- package/esm2015/print/src/lib/fonts/times/bold-italic.js +1 -1
- package/esm2015/print/src/lib/fonts/times/bold.js +1 -1
- package/esm2015/print/src/lib/fonts/times/italic.js +1 -1
- package/esm2015/print/src/lib/fonts/times/normal.js +1 -1
- package/esm2015/print/src/lib/print.component.js +1 -1
- package/esm2015/print/src/lib/print.module.js +1 -1
- package/esm2015/print/src/public-api.js +1 -1
- package/esm2015/public-api.js +1 -1
- package/esm2015/quick-action/index.js +1 -1
- package/esm2015/quick-action/sd-angular-core-quick-action.js +1 -1
- package/esm2015/quick-action/src/lib/quick-action.component.js +1 -1
- package/esm2015/quick-action/src/lib/quick-action.module.js +1 -1
- package/esm2015/quick-action/src/public-api.js +1 -1
- package/esm2015/radio/index.js +1 -1
- package/esm2015/radio/sd-angular-core-radio.js +1 -1
- package/esm2015/radio/src/lib/radio.component.js +1 -1
- package/esm2015/radio/src/lib/radio.module.js +1 -1
- package/esm2015/radio/src/public-api.js +1 -1
- package/esm2015/sd-angular-core.js +1 -1
- package/esm2015/select/index.js +1 -1
- package/esm2015/select/sd-angular-core-select.js +1 -1
- package/esm2015/select/src/lib/select-display-def.directive.js +1 -1
- package/esm2015/select/src/lib/select.component.js +1 -1
- package/esm2015/select/src/lib/select.module.js +1 -1
- package/esm2015/select/src/public-api.js +1 -1
- package/esm2015/select-badge/index.js +1 -1
- package/esm2015/select-badge/sd-angular-core-select-badge.js +1 -1
- package/esm2015/select-badge/src/lib/select-badge-display-def.directive.js +1 -1
- package/esm2015/select-badge/src/lib/select-badge.component.js +1 -1
- package/esm2015/select-badge/src/lib/select-badge.module.js +1 -1
- package/esm2015/select-badge/src/public-api.js +1 -1
- package/esm2015/select-editor/index.js +1 -1
- package/esm2015/select-editor/sd-angular-core-select-editor.js +1 -1
- package/esm2015/select-editor/src/lib/select-editor.component.js +1 -1
- package/esm2015/select-editor/src/lib/select-editor.module.js +1 -1
- package/esm2015/select-editor/src/public-api.js +1 -1
- package/esm2015/service/index.js +1 -1
- package/esm2015/service/sd-angular-core-service.js +1 -1
- package/esm2015/service/src/lib/service.module.js +1 -1
- package/esm2015/service/src/public-api.js +1 -1
- package/esm2015/setting/index.js +1 -1
- package/esm2015/setting/sd-angular-core-setting.js +1 -1
- package/esm2015/setting/src/lib/setting.model.js +1 -1
- package/esm2015/setting/src/lib/setting.service.js +1 -1
- package/esm2015/setting/src/public-api.js +1 -1
- package/esm2015/side-drawer/index.js +1 -1
- package/esm2015/side-drawer/sd-angular-core-side-drawer.js +1 -1
- package/esm2015/side-drawer/src/lib/side-drawer/side-drawer.component.js +1 -1
- package/esm2015/side-drawer/src/lib/side-drawer.module.js +1 -1
- package/esm2015/side-drawer/src/public-api.js +1 -1
- package/esm2015/switch/index.js +1 -1
- package/esm2015/switch/sd-angular-core-switch.js +1 -1
- package/esm2015/switch/src/lib/switch.component.js +1 -1
- package/esm2015/switch/src/lib/switch.module.js +1 -1
- package/esm2015/switch/src/public-api.js +1 -1
- package/esm2015/tab-router/index.js +1 -1
- package/esm2015/tab-router/sd-angular-core-tab-router.js +1 -1
- package/esm2015/tab-router/src/lib/actions/tab-router.action.js +1 -1
- package/esm2015/tab-router/src/lib/components/tab-router-item/tab-router-item.component.js +1 -1
- package/esm2015/tab-router/src/lib/components/tab-router-nav/tab-router-nav.component.js +1 -1
- package/esm2015/tab-router/src/lib/components/tab-router-outlet/tab-router-outlet.component.js +1 -1
- package/esm2015/tab-router/src/lib/decorators/tab.decorator.js +1 -1
- package/esm2015/tab-router/src/lib/directives/router-link-mouse-down.directive.js +1 -1
- package/esm2015/tab-router/src/lib/events/tab-router.event.js +1 -1
- package/esm2015/tab-router/src/lib/models/tab-router.model.js +1 -1
- package/esm2015/tab-router/src/lib/pipes/tab-info.pipe.js +1 -1
- package/esm2015/tab-router/src/lib/services/tab-decorator.service.js +1 -1
- package/esm2015/tab-router/src/lib/services/tab-router.service.js +1 -1
- package/esm2015/tab-router/src/lib/tab-router.module.js +1 -1
- package/esm2015/tab-router/src/public-api.js +1 -1
- package/esm2015/textarea/index.js +1 -1
- package/esm2015/textarea/sd-angular-core-textarea.js +1 -1
- package/esm2015/textarea/src/lib/textarea.component.js +1 -1
- package/esm2015/textarea/src/lib/textarea.module.js +1 -1
- package/esm2015/textarea/src/public-api.js +1 -1
- package/esm2015/time/index.js +1 -1
- package/esm2015/time/sd-angular-core-time.js +1 -1
- package/esm2015/time/src/lib/time.component.js +1 -1
- package/esm2015/time/src/lib/time.module.js +1 -1
- package/esm2015/time/src/public-api.js +1 -1
- package/esm2015/timeline/index.js +1 -1
- package/esm2015/timeline/sd-angular-core-timeline.js +1 -1
- package/esm2015/timeline/src/lib/components/timeline.component.js +1 -1
- package/esm2015/timeline/src/lib/directives/timeline-def.directive.js +1 -1
- package/esm2015/timeline/src/lib/timeline.module.js +1 -1
- package/esm2015/timeline/src/public-api.js +1 -1
- package/esm2015/translate/index.js +1 -1
- package/esm2015/translate/sd-angular-core-translate.js +1 -1
- package/esm2015/translate/src/lib/translate.model.js +1 -1
- package/esm2015/translate/src/lib/translate.module.js +1 -1
- package/esm2015/translate/src/lib/translate.pipe.js +1 -1
- package/esm2015/translate/src/lib/translate.service.js +1 -1
- package/esm2015/upload-excel/index.js +1 -1
- package/esm2015/upload-excel/sd-angular-core-upload-excel.js +1 -1
- package/esm2015/upload-excel/src/lib/pipes/columm-hidden.pipe.js +1 -1
- package/esm2015/upload-excel/src/lib/pipes/column-transform.pipe.js +1 -1
- package/esm2015/upload-excel/src/lib/upload-excel.component.js +1 -1
- package/esm2015/upload-excel/src/lib/upload-excel.model.js +1 -1
- package/esm2015/upload-excel/src/lib/upload-excel.module.js +1 -1
- package/esm2015/upload-excel/src/public-api.js +1 -1
- package/esm2015/upload-file/index.js +1 -1
- package/esm2015/upload-file/sd-angular-core-upload-file.js +1 -1
- package/esm2015/upload-file/src/lib/upload-file.component.js +1 -1
- package/esm2015/upload-file/src/lib/upload-file.module.js +1 -1
- package/esm2015/upload-file/src/public-api.js +1 -1
- package/esm2015/utility/index.js +1 -1
- package/esm2015/utility/sd-angular-core-utility.js +1 -1
- package/esm2015/utility/src/lib/directives/desktop.directive.js +1 -1
- package/esm2015/utility/src/lib/directives/mobile-tablet.directive.js +1 -1
- package/esm2015/utility/src/lib/directives/mobile.directive.js +1 -1
- package/esm2015/utility/src/lib/directives/tablet.directive.js +1 -1
- package/esm2015/utility/src/lib/pipes/currency.pipe.js +1 -1
- package/esm2015/utility/src/lib/pipes/safe-html.pipe.js +1 -1
- package/esm2015/utility/src/lib/pipes/time-different.pipe.js +1 -1
- package/esm2015/utility/src/lib/utility.module.js +1 -1
- package/esm2015/utility/src/lib/utility.service.js +1 -1
- package/esm2015/utility/src/public-api.js +1 -1
- package/esm2015/view/index.js +1 -1
- package/esm2015/view/sd-angular-core-view.js +1 -1
- package/esm2015/view/src/lib/view.module.js +1 -1
- package/esm2015/view/src/public-api.js +1 -1
- package/esm2015/zip/index.js +1 -1
- package/esm2015/zip/sd-angular-core-zip.js +1 -1
- package/esm2015/zip/src/lib/zip.module.js +1 -1
- package/esm2015/zip/src/lib/zip.service.js +1 -1
- package/esm2015/zip/src/public-api.js +1 -1
- package/fesm2015/sd-angular-core-chip.js +4 -2
- package/fesm2015/sd-angular-core-chip.js.map +1 -1
- package/fesm2015/sd-angular-core-pdf.js +19 -3
- package/fesm2015/sd-angular-core-pdf.js.map +1 -1
- package/package.json +1 -1
- package/pdf/sd-angular-core-pdf.metadata.json +1 -1
- package/pdf/src/lib/pdf.service.d.ts +13 -1
- package/{sd-angular-core-1.3.126.tgz → sd-angular-core-1.3.128.tgz} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-angular-core-chip.js","sources":["../../../../projects/sd-core/chip/src/lib/directives/sd-chip-display-def.directive.ts","../../../../projects/sd-core/chip/src/lib/chip.component.ts","../../../../projects/sd-core/chip/src/lib/pipes/removable-chip.pipe.ts","../../../../projects/sd-core/chip/src/lib/chip.module.ts","../../../../projects/sd-core/chip/src/public-api.ts","../../../../projects/sd-core/chip/sd-angular-core-chip.ts"],"sourcesContent":["import { Directive, Input, TemplateRef } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[sdChipDisplayDef]'\r\n})\r\nexport class SdChipDisplayDef {\r\n constructor(public templateRef: TemplateRef<any>) { }\r\n}\r\n","import {\r\n Component,\r\n Input,\r\n ViewChild,\r\n Output,\r\n EventEmitter,\r\n OnInit, OnDestroy,\r\n AfterViewInit,\r\n ChangeDetectorRef,\r\n ElementRef,\r\n ContentChild,\r\n ChangeDetectionStrategy,\r\n Inject,\r\n Optional\r\n} from '@angular/core';\r\nimport { COMMA, ENTER } from '@angular/cdk/keycodes';\r\nimport { debounceTime, map, startWith, switchMap } from 'rxjs/operators';\r\n\r\nimport * as uuid from 'uuid';\r\nimport hash from 'object-hash';\r\nimport { NgForm, FormControl, FormGroup, ValidatorFn, AsyncValidatorFn, Validators, FormGroupDirective } from '@angular/forms';\r\nimport { Observable, Subscription, BehaviorSubject, combineLatest } from 'rxjs';\r\nimport { MatChipInputEvent, MatChipList } from '@angular/material/chips';\r\nimport { MatAutocomplete, MatAutocompleteSelectedEvent, MatAutocompleteTrigger } from '@angular/material/autocomplete';\r\nimport { SdChipUpdate } from './chip.model';\r\nimport { ErrorStateMatcher } from '@angular/material/core';\r\nimport { SdChipDisplayDef } from './directives/sd-chip-display-def.directive';\r\nimport { FORM_CONFIG, IFormConfiguration, SdFormControl, SdViewDefDirective } from '@sd-angular/core/common';\r\nimport { MatFormFieldAppearance } from '@angular/material/form-field';\r\nimport { SdLabelDefDirective } from '@sd-angular/core/common';\r\n\r\nclass SdChipErrotStateMatcher implements ErrorStateMatcher {\r\n constructor(private formControl: FormControl) { }\r\n isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean {\r\n const isSubmitted = form && form.submitted;\r\n return !!(this.formControl?.invalid && (this.formControl?.dirty || this.formControl?.touched || isSubmitted));\r\n }\r\n}\r\n\r\n@Component({\r\n selector: 'sd-chip',\r\n templateUrl: './chip.component.html',\r\n styleUrls: ['./chip.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SdChip implements OnInit, OnDestroy, AfterViewInit {\r\n #name = uuid.v4();\r\n @Input() set name(val: string) {\r\n if (val) {\r\n this.#name = val;\r\n }\r\n }\r\n @Input() appearance: MatFormFieldAppearance;\r\n separatorKeysCodes: number[] = [ENTER, COMMA];\r\n selectable = true;\r\n @Input() size: 'sm' | 'lg';\r\n #form: FormGroup;\r\n @Input() set form(val: NgForm | FormGroup) {\r\n if (val) {\r\n if (val instanceof NgForm) {\r\n this.#form = val.form;\r\n } else {\r\n this.#form = val;\r\n }\r\n }\r\n }\r\n #addable: boolean;\r\n @Input() set addable(val: '' | boolean) {\r\n this.#addable = (val === '') || val;\r\n }\r\n @Input() label: string;\r\n @Input() valueField: string;\r\n @Input() displayField: string;\r\n @Input() placeholder: string;\r\n removable: boolean | ((item: any) => boolean) = true;\r\n @Input('removable') set _removable(val: '' | boolean | ((item: any) => boolean)) {\r\n this.removable = (val === '') || val;\r\n }\r\n disableErrorMessage = false;\r\n @Input('disableErrorMessage') set _disableErrorMessage(val: boolean | '') {\r\n this.disableErrorMessage = (val === '') || val;\r\n }\r\n // Server search\r\n loading = false;\r\n #allItems: Observable<any[]>;\r\n #allItem: {\r\n [key: string]: any\r\n } = {};\r\n #cache: {\r\n [key: string]: any[]\r\n } = {};\r\n #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\r\n #itemsChanges = new BehaviorSubject<any[] | SearchFunc>([]);\r\n @Input() set items(items: undefined | any[] | SearchFunc) {\r\n this.#delay = 0;\r\n if (!items) {\r\n this.#itemsChanges.next([]);\r\n } else if (Array.isArray(items)) {\r\n this.#itemsChanges.next(items.filter(e => e !== null && e !== undefined));\r\n } else {\r\n this.#delay = 500;\r\n this.#itemsChanges.next(items);\r\n }\r\n this.formControl.updateValueAndValidity();\r\n }\r\n @Input() limit = 50;\r\n selectedItems: Observable<any[]>;\r\n #selectedItems: any[] = [];\r\n filteredItems: Observable<any[]>;\r\n #filteredItems: any[];\r\n @Input() cacheChecksum: any;\r\n ipt: any;\r\n\r\n // model\r\n @Input() set model(values: undefined | (string | number)[]) {\r\n if (!Array.isArray(values)) {\r\n values = [];\r\n }\r\n this.formControl.setValue(values);\r\n }\r\n // Validator\r\n required = false;\r\n @Input('required') set _required(val: boolean | '') {\r\n this.required = (val === '') || val;\r\n this.#updateValidator();\r\n }\r\n\r\n min: number;\r\n @Input('min') set pMin(val: number | string) {\r\n this.min = +val || 0;\r\n this.#updateValidator();\r\n }\r\n max: number;\r\n @Input('max') set pMax(val: number | string) {\r\n this.max = +val || 0;\r\n this.#updateValidator();\r\n }\r\n @Output() modelChange = new EventEmitter();\r\n\r\n // Optional\r\n @Input() set disabled(val: boolean | '') {\r\n val = (val === '') || val;\r\n if (val) {\r\n this.formControl.disable();\r\n this.inputControl.disable();\r\n } else {\r\n this.formControl.enable();\r\n this.inputControl.enable();\r\n }\r\n }\r\n\r\n @Output() sdChange = new EventEmitter<any[]>();\r\n @Output() sdUpdate = new EventEmitter<SdChipUpdate>();\r\n @Output() chipSelected = new EventEmitter<any>();\r\n\r\n @ViewChild('input') input: ElementRef<HTMLInputElement>;\r\n @ViewChild('auto') matAutocomplete: MatAutocomplete;\r\n @ViewChild('chipList', { static: true }) chipList: MatChipList;\r\n @ViewChild(MatAutocompleteTrigger, { read: MatAutocompleteTrigger }) autocompleteTrigger: MatAutocompleteTrigger;\r\n @ContentChild(SdViewDefDirective) sdView: SdViewDefDirective;\r\n @ContentChild(SdChipDisplayDef) sdChipDisplay: SdChipDisplayDef;\r\n @ContentChild(SdLabelDefDirective) sdLabelDef: SdLabelDefDirective;\r\n isBluring = false;\r\n isFocused = false;\r\n inputControl = new FormControl();\r\n formControl = new SdFormControl();\r\n matcher = new SdChipErrotStateMatcher(this.formControl);\r\n #subscription = new Subscription();\r\n constructor(\r\n private ref: ChangeDetectorRef,\r\n @Inject(FORM_CONFIG) @Optional() private formConfig: IFormConfiguration) {\r\n }\r\n\r\n ngOnInit() {\r\n this.appearance = this.appearance || this.formConfig?.appearance;\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.#subscription.add(this.formControl.sdChanges.subscribe(() => {\r\n this.ref.markForCheck();\r\n }));\r\n this.#allItems = combineLatest([\r\n this.#itemsChanges.asObservable(),\r\n this.inputControl.valueChanges.pipe(startWith(''), debounceTime(this.#delay)),\r\n this.formControl.valueChanges.pipe(startWith(this.formControl.value))]).pipe(\r\n switchMap(async ([items]) => {\r\n const val = this.inputControl.value;\r\n const values = this.formControl.value || [];\r\n if (typeof (items) === 'function') {\r\n return await this.#loadItems(val, items);\r\n }\r\n this.#allItem = items.toObject(this.valueField);\r\n const hasFields = !!this.valueField && !!this.displayField;\r\n this.#filteredItems = items.filter(item => {\r\n const value = hasFields ? item[this.valueField] : item;\r\n const display = hasFields ? item[this.displayField] : item;\r\n if (String.aliasIncludes(value, val) || String.aliasIncludes(display, val)) {\r\n return true;\r\n }\r\n return values.some(e => e === value);\r\n });\r\n return this.#filteredItems;\r\n }));\r\n this.selectedItems = combineLatest([\r\n this.#itemsChanges.asObservable(),\r\n this.formControl.valueChanges.pipe(startWith(this.formControl.value))])\r\n .pipe(\r\n switchMap(async ([items, val]) => {\r\n // Vì một số lý do chưa xác định mà khi sử dụng sdViewDef thì khi chuyển sang dạng view sẽ trigger val = null\r\n // Nhưng formControl.value vẫn có giá trị đúng nên thực hiện gán val = this.formControl.value;\r\n val = this.formControl.value;\r\n if (!this.valueField) {\r\n this.#selectedItems = this.formControl.value;\r\n return this.#selectedItems;\r\n }\r\n if (typeof (items) === 'function') {\r\n this.#selectedItems = await this.#loadSelectedItems(val, items);\r\n return this.#selectedItems;\r\n }\r\n this.#selectedItems = (this.formControl.value || [])?.map(value => {\r\n return items?.find(item => item[this.valueField] === value) || {\r\n [this.valueField]: value,\r\n [this.displayField]: value\r\n };\r\n });\r\n return this.#selectedItems;\r\n })\r\n );\r\n this.filteredItems = this.#allItems.pipe(map(allItems => allItems.filter(item => {\r\n const values = this.formControl.value || [];\r\n if (this.valueField) {\r\n return !values.includes(item?.[this.valueField]);\r\n }\r\n return !values.includes(item);\r\n }).paging(this.limit)));\r\n // this.display = this.selectedItems.pipe(\r\n // map(selectedItems => selectedItems?.map(item => this.displayField ? item[this.displayField] : item)?.join(', ')));\r\n // this.#subscription.add(this.formControl.valueChanges.subscribe(() => {\r\n // const values: (string | number)[] = this.formControl.value || [];\r\n // this.selectedItems = this.#items.filter(item => values.findIndex(value => value === item?.[this.valueField]) !== -1);\r\n // this.modelChange.emit(values);\r\n // this.sdChange.emit(values);\r\n // setTimeout(() => {\r\n // this.#form?.markAsDirty();\r\n // }, 0);\r\n // }));\r\n // this.#subscription.add(this.#itemChanges.pipe(startWith(this.#items)).subscribe(() => {\r\n // const values: (string | number)[] = this.formControl.value || [];\r\n // this.selectedItems = [];\r\n // for (const value of values) {\r\n // const item = this.#items.find(e => e?.[this.valueField] === value) || {};\r\n // this.selectedItems.push({\r\n // ...item,\r\n // [this.valueField]: value\r\n // });\r\n // }\r\n // }));\r\n this.#form?.addControl(this.#name, this.formControl);\r\n }\r\n\r\n ngOnDestroy() {\r\n this.#form?.removeControl(this.#name);\r\n this.#subscription.unsubscribe();\r\n }\r\n\r\n #updateValidator = () => {\r\n this.formControl.clearValidators();\r\n this.formControl.clearAsyncValidators();\r\n const validators: ValidatorFn[] = [];\r\n const asyncValidators: AsyncValidatorFn[] = [];\r\n if (this.required) {\r\n validators.push(Validators.required);\r\n }\r\n if (this.min > 0) {\r\n validators.push(Validators.minLength(this.min));\r\n }\r\n if (this.max > 0) {\r\n validators.push(Validators.maxLength(this.max));\r\n }\r\n this.formControl.setValidators(validators);\r\n this.formControl.setAsyncValidators(asyncValidators);\r\n this.formControl.updateValueAndValidity();\r\n }\r\n\r\n #loadItems = async (searchText: string, items: SearchFunc) => {\r\n searchText = searchText?.toString() || '';\r\n const key = hash({\r\n checksum: this.cacheChecksum || null,\r\n searchText\r\n })\r\n if (this.#cache[key] === undefined) {\r\n this.loading = true;\r\n const results = await items(searchText).catch(() => []).finally(() => this.loading = false);\r\n const objItem = Array.toObject(results, this.valueField);\r\n this.#allItem = {\r\n ...this.#allItem,\r\n ...objItem\r\n };\r\n this.#cache[key] = results.union(this.valueField);\r\n }\r\n // if (!this.multiple) {\r\n // return this.#cache[searchText];\r\n // }\r\n const selectedItems = await this.#loadSelectedItems(this.formControl.value, items);\r\n // Đưa những selectedItems lên đầu nếu không mat-select-trigger sẽ không work\r\n return [...selectedItems, ...this.#cache[key]].union(this.valueField);\r\n }\r\n\r\n #loadSelectedItems = async (value: string | string[], items: SearchFunc) => {\r\n if (!value?.toString()) {\r\n return [];\r\n }\r\n const values = Array.isArray(value) ? value : [value];\r\n if (!this.valueField && !this.displayField) {\r\n return values;\r\n }\r\n this.loading = true;\r\n if (values.some(val => this.#allItem[val] === undefined)) {\r\n const results = await items(value, true).catch(() => []).finally(() => this.loading = false);\r\n const objItem = Array.toObject(results, this.valueField);\r\n const objValue = Array.toObject(\r\n values.map(val => ({ [val?.toString()]: { [this.valueField]: val, [this.displayField]: val } })), this.valueField);\r\n this.#allItem = {\r\n ...objValue,\r\n ...this.#allItem,\r\n ...objItem\r\n };\r\n }\r\n return values.map(val => this.#allItem[val?.toString()] ?? { [this.valueField]: val, [this.displayField]: val });\r\n }\r\n\r\n onAdd = (event: MatChipInputEvent): void => {\r\n // Add item only when MatAutocomplete is not open\r\n // To make sure this does not conflict with OptionSelected Event\r\n // if (!this.matAutocomplete.isOpen) {\r\n // const value = (event.value ?? '').toString().trim();\r\n // if (value) {\r\n // if (this.valueField && this.displayField) {\r\n // const item = this.#filteredItems.find(e => e[this.displayField] === value);\r\n // if (item) {\r\n // const values: (string | number)[] = this.formControl.value ?? [];\r\n // values.push(item[this.valueField]);\r\n // this.formControl.setValue(values);\r\n // } else if (this.#addable) {\r\n // const values: (string | number)[] = this.formControl.value ?? [];\r\n // values.push(value);\r\n // this.formControl.setValue(values);\r\n // }\r\n // } else {\r\n // console.log(value);\r\n // console.log(this.#filteredItems);\r\n // const item = this.#filteredItems.find(item => item === value);\r\n // if (item) {\r\n // const values: (string | number)[] = this.formControl.value ?? [];\r\n // values.push(item);\r\n // this.formControl.setValue(values);\r\n // } else if (this.#addable) {\r\n // const values: (string | number)[] = this.formControl.value ?? [];\r\n // values.push(value);\r\n // this.formControl.setValue(values);\r\n // }\r\n // }\r\n // }\r\n // this.inputControl.setValue('');\r\n // }\r\n const value = (event.value ?? '').toString().trim();\r\n if (value) {\r\n if (this.valueField && this.displayField) {\r\n const item = this.#filteredItems.find(e => e[this.displayField] === value);\r\n if (item) {\r\n const values: (string | number)[] = this.formControl.value ?? [];\r\n values.push(item[this.valueField]);\r\n this.formControl.setValue(values);\r\n this.modelChange.emit(this.formControl.value);\r\n this.sdChange.emit(this.formControl.value);\r\n } else if (this.#addable) {\r\n const values: (string | number)[] = this.formControl.value ?? [];\r\n values.push(value);\r\n this.formControl.setValue(values);\r\n this.modelChange.emit(this.formControl.value);\r\n this.sdChange.emit(this.formControl.value);\r\n }\r\n } else {\r\n const item = this.#filteredItems.find(item => item === value);\r\n if (item) {\r\n const values: (string | number)[] = this.formControl.value ?? [];\r\n values.push(item);\r\n this.formControl.setValue(values);\r\n this.modelChange.emit(this.formControl.value);\r\n this.sdChange.emit(this.formControl.value);\r\n } else if (this.#addable) {\r\n const values: (string | number)[] = this.formControl.value ?? [];\r\n values.push(value);\r\n this.formControl.setValue(values);\r\n this.modelChange.emit(this.formControl.value);\r\n this.sdChange.emit(this.formControl.value);\r\n }\r\n }\r\n }\r\n this.input.nativeElement.value = '';\r\n this.inputControl.setValue('');\r\n }\r\n\r\n // andn1 viết để xử lý tạm us B2B1D-18289 ở S69\r\n onAdd2 = (event: MatChipInputEvent): void => {\r\n\r\n const value = (event.value ?? '').toString().toLowerCase().trim();\r\n if (value) {\r\n const item = this.#filteredItems.find(e => e[this.valueField]\r\n && e[this.valueField].toString().toLowerCase().trim() === value);\r\n\r\n if (item) {\r\n const values: (string | number)[] = this.formControl.value ?? [];\r\n if (!values.includes(item[this.valueField])) {\r\n values.push(item[this.valueField]);\r\n }\r\n this.formControl.setValue(values);\r\n }\r\n }\r\n this.inputControl.setValue('');\r\n }\r\n\r\n onClickChip = ($event: Event, item: any) => {\r\n $event.stopPropagation();\r\n $event.stopImmediatePropagation();\r\n item.isSelected = !item.isSelected;\r\n this.focus();\r\n }\r\n\r\n onRemove = (item: any): void => {\r\n const values: (string | number)[] = this.formControl.value ?? [];\r\n if (typeof (item) === 'string' || typeof (item) === 'number') {\r\n this.formControl.setValue(values.filter(value => item !== value));\r\n this.modelChange.emit(this.formControl.value);\r\n this.sdChange.emit(this.formControl.value);\r\n } else if (this.valueField) {\r\n this.formControl.setValue(values.filter(value => item?.[this.valueField] !== value));\r\n this.modelChange.emit(this.formControl.value);\r\n this.sdChange.emit(this.formControl.value);\r\n }\r\n this.inputControl.setValue('');\r\n this.focus();\r\n }\r\n\r\n select = (item: any): void => {\r\n this.chipSelected.emit(item);\r\n this.focus();\r\n }\r\n\r\n // onSelect = (event: MatAutocompleteSelectedEvent) => {\r\n // const value = (event.option.value?.[this.valueField] ?? '').toString().trim();\r\n // if (value) {\r\n // const item = this.#items.find(e => e[this.valueField]\r\n // && e[this.valueField].toString().trim() === value);\r\n // if (item) {\r\n // const values: (string | number)[] = this.formControl.value ?? [];\r\n // values.push(item[this.valueField]);\r\n // this.formControl.setValue(values);\r\n // this.input.nativeElement.value = '';\r\n // this.inputControl.setValue('');\r\n // setTimeout(() => {\r\n // this.autocompleteTrigger?.openPanel();\r\n // }, 0);\r\n // }\r\n // }\r\n // }\r\n\r\n onSelect = (event: MatAutocompleteSelectedEvent) => {\r\n const item = event.option.value;\r\n const values: (string | number)[] = this.formControl.value ?? [];\r\n if (item) {\r\n if (typeof (item) === 'string' || typeof (item) === 'number') {\r\n if (!values.includes(item)) {\r\n values.push(item);\r\n this.formControl.setValue(values);\r\n this.modelChange.emit(this.formControl.value);\r\n this.sdChange.emit(this.formControl.value);\r\n setTimeout(() => {\r\n this.autocompleteTrigger?.openPanel();\r\n }, 0);\r\n }\r\n } else if (this.valueField) {\r\n const val = item?.[this.valueField] || null;\r\n if (!values.includes(val)) {\r\n values.push(val);\r\n this.formControl.setValue(values);\r\n this.modelChange.emit(this.formControl.value);\r\n this.sdChange.emit(this.formControl.value);\r\n setTimeout(() => {\r\n this.autocompleteTrigger?.openPanel();\r\n }, 0);\r\n }\r\n }\r\n this.input.nativeElement.value = '';\r\n this.inputControl.setValue('', {\r\n emitEvent: false\r\n });\r\n }\r\n }\r\n\r\n // displayFn = (value: string | { [key: string]: string }): string | undefined => {\r\n // if (typeof value === 'string') {\r\n // if (!this.#items) {\r\n // return undefined;\r\n // }\r\n // const selectedItem = this.#items.find(item => item[this.valueField] === value);\r\n // if (selectedItem) {\r\n // return selectedItem[this.displayField];\r\n // }\r\n // if (this.#items.some(item => item[this.displayField].toLowerCase().indexOf(value.toLowerCase()) !== -1)) {\r\n // return value;\r\n // } else {\r\n // return undefined;\r\n // }\r\n // } else {\r\n // return value ? value[this.displayField] : undefined;\r\n // }\r\n // }\r\n\r\n onFocus = () => {\r\n this.isFocused = true;\r\n this.isBluring = false;\r\n this.inputControl.setValue('');\r\n // this.inputControl.updateValueAndValidity();\r\n }\r\n\r\n onBlur = () => {\r\n this.isBluring = true;\r\n setTimeout(() => {\r\n if(this.isBluring) {\r\n this.isFocused = false;\r\n this.inputControl.setValue('', {\r\n emitEvent: false\r\n });\r\n }\r\n }, 100);\r\n }\r\n\r\n onClick = () => {\r\n if (this.sdView?.templateRef) {\r\n if (!this.formControl.disabled && !this.isFocused) {\r\n this.focus();\r\n }\r\n }\r\n }\r\n\r\n focus = () => {\r\n this.isFocused = true;\r\n this.isBluring = false;\r\n setTimeout(() => {\r\n this.autocompleteTrigger?.openPanel();\r\n this.input?.nativeElement?.focus();\r\n }, 100);\r\n }\r\n\r\n onClear = ($event?: any) => {\r\n $event?.stopPropagation();\r\n this.inputControl.setValue('');\r\n this.formControl.setValue([]);\r\n this.modelChange.emit(this.formControl.value);\r\n this.sdChange.emit(this.formControl.value);\r\n this.autocompleteTrigger?.openPanel();\r\n this.ref.detectChanges();\r\n }\r\n\r\n getSelectedItems = () => this.#selectedItems;\r\n}\r\n\r\ntype SearchFunc = (searchText?: string | string[], isFormValue?: boolean) => Promise<any[]>;","import { Pipe, PipeTransform } from '@angular/core';\r\n@Pipe({\r\n name: 'sdRemovableChip'\r\n})\r\nexport class SdRemovableChipPipe implements PipeTransform {\r\n constructor() { }\r\n transform(item: any, removable: boolean | ((item: any) => boolean)): boolean {\r\n if(typeof(removable) === 'boolean') {\r\n return removable;\r\n }\r\n return removable(item);\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\r\nimport { SdChip } from './chip.component';\r\nimport { SdChipDisplayDef } from './directives/sd-chip-display-def.directive';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatAutocompleteModule } from '@angular/material/autocomplete';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { SdTranslateModule } from '@sd-angular/core/translate';\r\nimport { MatChipsModule } from '@angular/material/chips';\r\nimport { SdRemovableChipPipe } from './pipes/removable-chip.pipe';\r\nimport { SdCommonModule } from '@sd-angular/core/common';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n MatInputModule,\r\n MatTooltipModule,\r\n MatFormFieldModule,\r\n MatAutocompleteModule,\r\n MatIconModule,\r\n MatProgressSpinnerModule,\r\n MatChipsModule,\r\n SdTranslateModule,\r\n SdCommonModule\r\n ],\r\n declarations: [\r\n SdChip,\r\n SdChipDisplayDef,\r\n SdRemovableChipPipe\r\n ],\r\n exports: [\r\n SdCommonModule,\r\n SdChip,\r\n SdChipDisplayDef,\r\n ]\r\n})\r\nexport class SdChipModule { }\r\n","/*\r\n * Public API Surface of superdev-angular-core\r\n */\r\n\r\nexport * from './lib/chip.module';\r\nexport * from './lib/chip.component';\r\nexport * from './lib/chip.model';\r\nexport * from './lib/directives/sd-chip-display-def.directive';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {SdRemovableChipPipe as ɵa} from './src/lib/pipes/removable-chip.pipe';"],"names":["uuid.v4"],"mappings":";;;;;;;;;;;;;;;;;;;MAKa,gBAAgB;IAC3B,YAAmB,WAA6B;QAA7B,gBAAW,GAAX,WAAW,CAAkB;KAAK;;;YAJtD,SAAS,SAAC;gBACT,QAAQ,EAAE,oBAAoB;aAC/B;;;YAJ0B,WAAW;;;;AC+BtC,MAAM,uBAAuB;IAC3B,YAAoB,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;KAAK;IACjD,YAAY,CAAC,OAA2B,EAAE,IAAwC;;QAChF,MAAM,WAAW,GAAG,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC;QAC3C,OAAO,CAAC,EAAE,OAAA,IAAI,CAAC,WAAW,0CAAE,OAAO,MAAK,OAAA,IAAI,CAAC,WAAW,0CAAE,KAAK,YAAI,IAAI,CAAC,WAAW,0CAAE,OAAO,CAAA,IAAI,WAAW,CAAC,CAAC,CAAC;KAC/G;CACF;MAQY,MAAM;IA2HjB,YACU,GAAsB,EACW,UAA8B;QAD/D,QAAG,GAAH,GAAG,CAAmB;QACW,eAAU,GAAV,UAAU,CAAoB;QA5HzE,gBAAQA,EAAO,EAAE,EAAC;QAOlB,uBAAkB,GAAa,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC9C,eAAU,GAAG,IAAI,CAAC;QAElB,wBAAiB;QAUjB,2BAAkB;QAQlB,cAAS,GAAuC,IAAI,CAAC;QAIrD,wBAAmB,GAAG,KAAK,CAAC;;QAK5B,YAAO,GAAG,KAAK,CAAC;QAChB,4BAA6B;QAC7B,mBAEI,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AY,SAAC,gBAAgB;yBAC7B,YAAY,SAAC,mBAAmB;;;MC7JtB,mBAAmB;IAC9B,iBAAiB;IACjB,SAAS,CAAC,IAAS,EAAE,SAA6C;QAChE,IAAG,QAAO,SAAS,CAAC,KAAK,SAAS,EAAE;YAClC,OAAO,SAAS,CAAC;SAClB;QACD,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;KACxB;;;YAVF,IAAI,SAAC;gBACJ,IAAI,EAAE,iBAAiB;aACxB;;;;MCuCY,YAAY;;;YA1BxB,QAAQ,SAAC;gBACR,OAAO,EAAE;oBACP,YAAY;oBACZ,WAAW;oBACX,mBAAmB;oBACnB,cAAc;oBACd,gBAAgB;oBAChB,kBAAkB;oBAClB,qBAAqB;oBACrB,aAAa;oBACb,wBAAwB;oBACxB,cAAc;oBACd,iBAAiB;oBACjB,cAAc;iBACf;gBACD,YAAY,EAAE;oBACZ,MAAM;oBACN,gBAAgB;oBAChB,mBAAmB;iBACpB;gBACD,OAAO,EAAE;oBACP,cAAc;oBACd,MAAM;oBACN,gBAAgB;iBACjB;aACF;;;ACzCD;;;;ACAA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"sd-angular-core-chip.js","sources":["../../../../projects/sd-core/chip/src/lib/directives/sd-chip-display-def.directive.ts","../../../../projects/sd-core/chip/src/lib/chip.component.ts","../../../../projects/sd-core/chip/src/lib/pipes/removable-chip.pipe.ts","../../../../projects/sd-core/chip/src/lib/chip.module.ts","../../../../projects/sd-core/chip/src/public-api.ts","../../../../projects/sd-core/chip/sd-angular-core-chip.ts"],"sourcesContent":["import { Directive, Input, TemplateRef } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[sdChipDisplayDef]'\r\n})\r\nexport class SdChipDisplayDef {\r\n constructor(public templateRef: TemplateRef<any>) { }\r\n}\r\n","import {\r\n Component,\r\n Input,\r\n ViewChild,\r\n Output,\r\n EventEmitter,\r\n OnInit, OnDestroy,\r\n AfterViewInit,\r\n ChangeDetectorRef,\r\n ElementRef,\r\n ContentChild,\r\n ChangeDetectionStrategy,\r\n Inject,\r\n Optional\r\n} from '@angular/core';\r\nimport { COMMA, ENTER } from '@angular/cdk/keycodes';\r\nimport { debounceTime, map, startWith, switchMap } from 'rxjs/operators';\r\n\r\nimport * as uuid from 'uuid';\r\nimport hash from 'object-hash';\r\nimport { NgForm, FormControl, FormGroup, ValidatorFn, AsyncValidatorFn, Validators, FormGroupDirective } from '@angular/forms';\r\nimport { Observable, Subscription, BehaviorSubject, combineLatest } from 'rxjs';\r\nimport { MatChipInputEvent, MatChipList } from '@angular/material/chips';\r\nimport { MatAutocomplete, MatAutocompleteSelectedEvent, MatAutocompleteTrigger } from '@angular/material/autocomplete';\r\nimport { SdChipUpdate } from './chip.model';\r\nimport { ErrorStateMatcher } from '@angular/material/core';\r\nimport { SdChipDisplayDef } from './directives/sd-chip-display-def.directive';\r\nimport { FORM_CONFIG, IFormConfiguration, SdFormControl, SdViewDefDirective } from '@sd-angular/core/common';\r\nimport { MatFormFieldAppearance } from '@angular/material/form-field';\r\nimport { SdLabelDefDirective } from '@sd-angular/core/common';\r\n\r\nclass SdChipErrotStateMatcher implements ErrorStateMatcher {\r\n constructor(private formControl: FormControl) { }\r\n isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean {\r\n const isSubmitted = form && form.submitted;\r\n return !!(this.formControl?.invalid && (this.formControl?.dirty || this.formControl?.touched || isSubmitted));\r\n }\r\n}\r\n\r\n@Component({\r\n selector: 'sd-chip',\r\n templateUrl: './chip.component.html',\r\n styleUrls: ['./chip.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SdChip implements OnInit, OnDestroy, AfterViewInit {\r\n #name = uuid.v4();\r\n @Input() set name(val: string) {\r\n if (val) {\r\n this.#name = val;\r\n }\r\n }\r\n @Input() appearance: MatFormFieldAppearance;\r\n separatorKeysCodes: number[] = [ENTER, COMMA];\r\n selectable = true;\r\n @Input() size: 'sm' | 'lg';\r\n #form: FormGroup;\r\n @Input() set form(val: NgForm | FormGroup) {\r\n if (val) {\r\n if (val instanceof NgForm) {\r\n this.#form = val.form;\r\n } else {\r\n this.#form = val;\r\n }\r\n }\r\n }\r\n #addable: boolean;\r\n @Input() set addable(val: '' | boolean) {\r\n this.#addable = (val === '') || val;\r\n }\r\n @Input() label: string;\r\n @Input() valueField: string;\r\n @Input() displayField: string;\r\n @Input() placeholder: string;\r\n removable: boolean | ((item: any) => boolean) = true;\r\n @Input('removable') set _removable(val: '' | boolean | ((item: any) => boolean)) {\r\n this.removable = (val === '') || val;\r\n }\r\n disableErrorMessage = false;\r\n @Input('disableErrorMessage') set _disableErrorMessage(val: boolean | '') {\r\n this.disableErrorMessage = (val === '') || val;\r\n }\r\n // Server search\r\n loading = false;\r\n #allItems: Observable<any[]>;\r\n #allItem: {\r\n [key: string]: any\r\n } = {};\r\n #cache: {\r\n [key: string]: any[]\r\n } = {};\r\n #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\r\n #itemsChanges = new BehaviorSubject<any[] | SearchFunc>([]);\r\n @Input() set items(items: undefined | any[] | SearchFunc) {\r\n this.#delay = 0;\r\n if (!items) {\r\n this.#itemsChanges.next([]);\r\n } else if (Array.isArray(items)) {\r\n this.#itemsChanges.next(items.filter(e => e !== null && e !== undefined));\r\n } else {\r\n this.#delay = 500;\r\n this.#itemsChanges.next(items);\r\n }\r\n this.formControl.updateValueAndValidity();\r\n }\r\n @Input() limit = 50;\r\n selectedItems: Observable<any[]>;\r\n #selectedItems: any[] = [];\r\n filteredItems: Observable<any[]>;\r\n #filteredItems: any[];\r\n @Input() cacheChecksum: any;\r\n ipt: any;\r\n\r\n // model\r\n @Input() set model(values: undefined | (string | number)[]) {\r\n if (!Array.isArray(values)) {\r\n values = [];\r\n }\r\n this.formControl.setValue(values);\r\n }\r\n // Validator\r\n required = false;\r\n @Input('required') set _required(val: boolean | '') {\r\n this.required = (val === '') || val;\r\n this.#updateValidator();\r\n }\r\n\r\n min: number;\r\n @Input('min') set pMin(val: number | string) {\r\n this.min = +val || 0;\r\n this.#updateValidator();\r\n }\r\n max: number;\r\n @Input('max') set pMax(val: number | string) {\r\n this.max = +val || 0;\r\n this.#updateValidator();\r\n }\r\n @Output() modelChange = new EventEmitter();\r\n\r\n // Optional\r\n @Input() set disabled(val: boolean | '') {\r\n val = (val === '') || val;\r\n if (val) {\r\n this.formControl.disable();\r\n this.inputControl.disable();\r\n } else {\r\n this.formControl.enable();\r\n this.inputControl.enable();\r\n }\r\n }\r\n\r\n @Output() sdChange = new EventEmitter<any[]>();\r\n @Output() sdUpdate = new EventEmitter<SdChipUpdate>();\r\n @Output() chipSelected = new EventEmitter<any>();\r\n\r\n @ViewChild('input') input: ElementRef<HTMLInputElement>;\r\n @ViewChild('auto') matAutocomplete: MatAutocomplete;\r\n @ViewChild('chipList', { static: true }) chipList: MatChipList;\r\n @ViewChild(MatAutocompleteTrigger, { read: MatAutocompleteTrigger }) autocompleteTrigger: MatAutocompleteTrigger;\r\n @ContentChild(SdViewDefDirective) sdView: SdViewDefDirective;\r\n @ContentChild(SdChipDisplayDef) sdChipDisplay: SdChipDisplayDef;\r\n @ContentChild(SdLabelDefDirective) sdLabelDef: SdLabelDefDirective;\r\n isBluring = false;\r\n isFocused = false;\r\n inputControl = new FormControl();\r\n formControl = new SdFormControl();\r\n matcher = new SdChipErrotStateMatcher(this.formControl);\r\n #subscription = new Subscription();\r\n constructor(\r\n private ref: ChangeDetectorRef,\r\n @Inject(FORM_CONFIG) @Optional() private formConfig: IFormConfiguration) {\r\n }\r\n\r\n ngOnInit() {\r\n this.appearance = this.appearance || this.formConfig?.appearance;\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.#subscription.add(this.formControl.sdChanges.subscribe(() => {\r\n this.ref.markForCheck();\r\n }));\r\n this.#allItems = combineLatest([\r\n this.#itemsChanges.asObservable(),\r\n this.inputControl.valueChanges.pipe(startWith(''), debounceTime(this.#delay)),\r\n this.formControl.valueChanges.pipe(startWith(this.formControl.value))]).pipe(\r\n switchMap(async ([items]) => {\r\n const val = this.inputControl.value;\r\n const values = this.formControl.value || [];\r\n if (typeof (items) === 'function') {\r\n return await this.#loadItems(val, items);\r\n }\r\n this.#allItem = items.toObject(this.valueField);\r\n const hasFields = !!this.valueField && !!this.displayField;\r\n this.#filteredItems = items.filter(item => {\r\n const value = hasFields ? item[this.valueField] : item;\r\n const display = hasFields ? item[this.displayField] : item;\r\n if (String.aliasIncludes(value, val) || String.aliasIncludes(display, val)) {\r\n return true;\r\n }\r\n return values.some(e => e === value);\r\n });\r\n return this.#filteredItems;\r\n }));\r\n this.selectedItems = combineLatest([\r\n this.#itemsChanges.asObservable(),\r\n this.formControl.valueChanges.pipe(startWith(this.formControl.value))])\r\n .pipe(\r\n switchMap(async ([items, val]) => {\r\n // Vì một số lý do chưa xác định mà khi sử dụng sdViewDef thì khi chuyển sang dạng view sẽ trigger val = null\r\n // Nhưng formControl.value vẫn có giá trị đúng nên thực hiện gán val = this.formControl.value;\r\n val = this.formControl.value;\r\n if (!this.valueField) {\r\n this.#selectedItems = this.formControl.value;\r\n return this.#selectedItems;\r\n }\r\n if (typeof (items) === 'function') {\r\n this.#selectedItems = await this.#loadSelectedItems(val, items);\r\n return this.#selectedItems;\r\n }\r\n this.#selectedItems = (this.formControl.value || [])?.map(value => {\r\n return items?.find(item => item[this.valueField] === value) || {\r\n [this.valueField]: value,\r\n [this.displayField]: value\r\n };\r\n });\r\n return this.#selectedItems;\r\n })\r\n );\r\n this.filteredItems = this.#allItems.pipe(map(allItems => allItems.filter(item => {\r\n const values = this.formControl.value || [];\r\n if (this.valueField) {\r\n return !values.includes(item?.[this.valueField]);\r\n }\r\n return !values.includes(item);\r\n }).paging(this.limit)));\r\n // this.display = this.selectedItems.pipe(\r\n // map(selectedItems => selectedItems?.map(item => this.displayField ? item[this.displayField] : item)?.join(', ')));\r\n // this.#subscription.add(this.formControl.valueChanges.subscribe(() => {\r\n // const values: (string | number)[] = this.formControl.value || [];\r\n // this.selectedItems = this.#items.filter(item => values.findIndex(value => value === item?.[this.valueField]) !== -1);\r\n // this.modelChange.emit(values);\r\n // this.sdChange.emit(values);\r\n // setTimeout(() => {\r\n // this.#form?.markAsDirty();\r\n // }, 0);\r\n // }));\r\n // this.#subscription.add(this.#itemChanges.pipe(startWith(this.#items)).subscribe(() => {\r\n // const values: (string | number)[] = this.formControl.value || [];\r\n // this.selectedItems = [];\r\n // for (const value of values) {\r\n // const item = this.#items.find(e => e?.[this.valueField] === value) || {};\r\n // this.selectedItems.push({\r\n // ...item,\r\n // [this.valueField]: value\r\n // });\r\n // }\r\n // }));\r\n this.#form?.addControl(this.#name, this.formControl);\r\n }\r\n\r\n ngOnDestroy() {\r\n this.#form?.removeControl(this.#name);\r\n this.#subscription.unsubscribe();\r\n }\r\n\r\n #updateValidator = () => {\r\n this.formControl.clearValidators();\r\n this.formControl.clearAsyncValidators();\r\n const validators: ValidatorFn[] = [];\r\n const asyncValidators: AsyncValidatorFn[] = [];\r\n if (this.required) {\r\n validators.push(Validators.required);\r\n }\r\n if (this.min > 0) {\r\n validators.push(Validators.minLength(this.min));\r\n }\r\n if (this.max > 0) {\r\n validators.push(Validators.maxLength(this.max));\r\n }\r\n this.formControl.setValidators(validators);\r\n this.formControl.setAsyncValidators(asyncValidators);\r\n this.formControl.updateValueAndValidity();\r\n }\r\n\r\n #loadItems = async (searchText: string, items: SearchFunc) => {\r\n searchText = searchText?.toString() || '';\r\n const key = hash({\r\n checksum: this.cacheChecksum || null,\r\n searchText\r\n })\r\n if (this.#cache[key] === undefined) {\r\n this.loading = true;\r\n const results = await items(searchText).catch(() => []).finally(() => this.loading = false);\r\n const objItem = Array.toObject(results, this.valueField);\r\n this.#allItem = {\r\n ...this.#allItem,\r\n ...objItem\r\n };\r\n this.#cache[key] = results.union(this.valueField);\r\n }\r\n // if (!this.multiple) {\r\n // return this.#cache[searchText];\r\n // }\r\n const selectedItems = await this.#loadSelectedItems(this.formControl.value, items);\r\n // Đưa những selectedItems lên đầu nếu không mat-select-trigger sẽ không work\r\n return [...selectedItems, ...this.#cache[key]].union(this.valueField);\r\n }\r\n\r\n #loadSelectedItems = async (value: string | string[], items: SearchFunc) => {\r\n if (!value?.toString()) {\r\n return [];\r\n }\r\n const values = Array.isArray(value) ? value : [value];\r\n if (!this.valueField && !this.displayField) {\r\n return values;\r\n }\r\n this.loading = true;\r\n if (values.some(val => this.#allItem[val] === undefined)) {\r\n const results = await items(value, true).catch(() => []).finally(() => this.loading = false);\r\n const objItem = Array.toObject(results, this.valueField);\r\n const objValue = Array.toObject(\r\n values.map(val => ({ [val?.toString()]: { [this.valueField]: val, [this.displayField]: val } })), this.valueField);\r\n this.#allItem = {\r\n ...objValue,\r\n ...this.#allItem,\r\n ...objItem\r\n };\r\n }\r\n return values.map(val => this.#allItem[val?.toString()] ?? { [this.valueField]: val, [this.displayField]: val });\r\n }\r\n\r\n onAdd = (event: MatChipInputEvent): void => {\r\n // Add item only when MatAutocomplete is not open\r\n // To make sure this does not conflict with OptionSelected Event\r\n // if (!this.matAutocomplete.isOpen) {\r\n // const value = (event.value ?? '').toString().trim();\r\n // if (value) {\r\n // if (this.valueField && this.displayField) {\r\n // const item = this.#filteredItems.find(e => e[this.displayField] === value);\r\n // if (item) {\r\n // const values: (string | number)[] = this.formControl.value ?? [];\r\n // values.push(item[this.valueField]);\r\n // this.formControl.setValue(values);\r\n // } else if (this.#addable) {\r\n // const values: (string | number)[] = this.formControl.value ?? [];\r\n // values.push(value);\r\n // this.formControl.setValue(values);\r\n // }\r\n // } else {\r\n // console.log(value);\r\n // console.log(this.#filteredItems);\r\n // const item = this.#filteredItems.find(item => item === value);\r\n // if (item) {\r\n // const values: (string | number)[] = this.formControl.value ?? [];\r\n // values.push(item);\r\n // this.formControl.setValue(values);\r\n // } else if (this.#addable) {\r\n // const values: (string | number)[] = this.formControl.value ?? [];\r\n // values.push(value);\r\n // this.formControl.setValue(values);\r\n // }\r\n // }\r\n // }\r\n // this.inputControl.setValue('');\r\n // }\r\n const value = (event.value ?? '').toString().trim();\r\n if (value) {\r\n if (this.valueField && this.displayField) {\r\n const item = this.#filteredItems.find(e => e[this.displayField] === value);\r\n if (item) {\r\n const values: (string | number)[] = this.formControl.value ?? [];\r\n values.push(item[this.valueField]);\r\n this.formControl.setValue(values);\r\n this.modelChange.emit(this.formControl.value);\r\n this.sdChange.emit(this.formControl.value);\r\n } else if (this.#addable) {\r\n const values: (string | number)[] = this.formControl.value ?? [];\r\n values.push(value);\r\n this.formControl.setValue(values);\r\n this.modelChange.emit(this.formControl.value);\r\n this.sdChange.emit(this.formControl.value);\r\n }\r\n } else {\r\n const item = this.#filteredItems.find(item => item === value);\r\n if (item) {\r\n const values: (string | number)[] = this.formControl.value ?? [];\r\n values.push(item);\r\n this.formControl.setValue(values);\r\n this.modelChange.emit(this.formControl.value);\r\n this.sdChange.emit(this.formControl.value);\r\n } else if (this.#addable) {\r\n const values: (string | number)[] = this.formControl.value ?? [];\r\n values.push(value);\r\n this.formControl.setValue(values);\r\n this.modelChange.emit(this.formControl.value);\r\n this.sdChange.emit(this.formControl.value);\r\n }\r\n }\r\n }\r\n this.input.nativeElement.value = '';\r\n this.inputControl.setValue('');\r\n }\r\n\r\n // andn1 viết để xử lý tạm us B2B1D-18289 ở S69\r\n onAdd2 = (event: MatChipInputEvent): void => {\r\n\r\n const value = (event.value ?? '').toString().toLowerCase().trim();\r\n if (value) {\r\n const item = this.#filteredItems.find(e => e[this.valueField]\r\n && e[this.valueField].toString().toLowerCase().trim() === value);\r\n\r\n if (item) {\r\n const values: (string | number)[] = this.formControl.value ?? [];\r\n if (!values.includes(item[this.valueField])) {\r\n values.push(item[this.valueField]);\r\n }\r\n this.formControl.setValue(values);\r\n }\r\n }\r\n this.inputControl.setValue('');\r\n }\r\n\r\n onClickChip = ($event: Event, item: any) => {\r\n $event.stopPropagation();\r\n $event.stopImmediatePropagation();\r\n if (!this.formControl.disabled) {\r\n item.isSelected = !item.isSelected;\r\n this.focus();\r\n }\r\n }\r\n\r\n onRemove = (item: any): void => {\r\n const values: (string | number)[] = this.formControl.value ?? [];\r\n if (typeof (item) === 'string' || typeof (item) === 'number') {\r\n this.formControl.setValue(values.filter(value => item !== value));\r\n this.modelChange.emit(this.formControl.value);\r\n this.sdChange.emit(this.formControl.value);\r\n } else if (this.valueField) {\r\n this.formControl.setValue(values.filter(value => item?.[this.valueField] !== value));\r\n this.modelChange.emit(this.formControl.value);\r\n this.sdChange.emit(this.formControl.value);\r\n }\r\n this.inputControl.setValue('');\r\n this.focus();\r\n }\r\n\r\n select = (item: any): void => {\r\n this.chipSelected.emit(item);\r\n this.focus();\r\n }\r\n\r\n // onSelect = (event: MatAutocompleteSelectedEvent) => {\r\n // const value = (event.option.value?.[this.valueField] ?? '').toString().trim();\r\n // if (value) {\r\n // const item = this.#items.find(e => e[this.valueField]\r\n // && e[this.valueField].toString().trim() === value);\r\n // if (item) {\r\n // const values: (string | number)[] = this.formControl.value ?? [];\r\n // values.push(item[this.valueField]);\r\n // this.formControl.setValue(values);\r\n // this.input.nativeElement.value = '';\r\n // this.inputControl.setValue('');\r\n // setTimeout(() => {\r\n // this.autocompleteTrigger?.openPanel();\r\n // }, 0);\r\n // }\r\n // }\r\n // }\r\n\r\n onSelect = (event: MatAutocompleteSelectedEvent) => {\r\n const item = event.option.value;\r\n const values: (string | number)[] = this.formControl.value ?? [];\r\n if (item) {\r\n if (typeof (item) === 'string' || typeof (item) === 'number') {\r\n if (!values.includes(item)) {\r\n values.push(item);\r\n this.formControl.setValue(values);\r\n this.modelChange.emit(this.formControl.value);\r\n this.sdChange.emit(this.formControl.value);\r\n setTimeout(() => {\r\n this.autocompleteTrigger?.openPanel();\r\n }, 0);\r\n }\r\n } else if (this.valueField) {\r\n const val = item?.[this.valueField] || null;\r\n if (!values.includes(val)) {\r\n values.push(val);\r\n this.formControl.setValue(values);\r\n this.modelChange.emit(this.formControl.value);\r\n this.sdChange.emit(this.formControl.value);\r\n setTimeout(() => {\r\n this.autocompleteTrigger?.openPanel();\r\n }, 0);\r\n }\r\n }\r\n this.input.nativeElement.value = '';\r\n this.inputControl.setValue('', {\r\n emitEvent: false\r\n });\r\n }\r\n }\r\n\r\n // displayFn = (value: string | { [key: string]: string }): string | undefined => {\r\n // if (typeof value === 'string') {\r\n // if (!this.#items) {\r\n // return undefined;\r\n // }\r\n // const selectedItem = this.#items.find(item => item[this.valueField] === value);\r\n // if (selectedItem) {\r\n // return selectedItem[this.displayField];\r\n // }\r\n // if (this.#items.some(item => item[this.displayField].toLowerCase().indexOf(value.toLowerCase()) !== -1)) {\r\n // return value;\r\n // } else {\r\n // return undefined;\r\n // }\r\n // } else {\r\n // return value ? value[this.displayField] : undefined;\r\n // }\r\n // }\r\n\r\n onFocus = () => {\r\n this.isFocused = true;\r\n this.isBluring = false;\r\n this.inputControl.setValue('');\r\n // this.inputControl.updateValueAndValidity();\r\n }\r\n\r\n onBlur = () => {\r\n this.isBluring = true;\r\n setTimeout(() => {\r\n if(this.isBluring) {\r\n this.isFocused = false;\r\n this.inputControl.setValue('', {\r\n emitEvent: false\r\n });\r\n }\r\n }, 100);\r\n }\r\n\r\n onClick = () => {\r\n if (this.sdView?.templateRef) {\r\n if (!this.formControl.disabled && !this.isFocused) {\r\n this.focus();\r\n }\r\n }\r\n }\r\n\r\n focus = () => {\r\n this.isFocused = true;\r\n this.isBluring = false;\r\n setTimeout(() => {\r\n this.autocompleteTrigger?.openPanel();\r\n this.input?.nativeElement?.focus();\r\n }, 100);\r\n }\r\n\r\n onClear = ($event?: any) => {\r\n $event?.stopPropagation();\r\n this.inputControl.setValue('');\r\n this.formControl.setValue([]);\r\n this.modelChange.emit(this.formControl.value);\r\n this.sdChange.emit(this.formControl.value);\r\n this.autocompleteTrigger?.openPanel();\r\n this.ref.detectChanges();\r\n }\r\n\r\n getSelectedItems = () => this.#selectedItems;\r\n}\r\n\r\ntype SearchFunc = (searchText?: string | string[], isFormValue?: boolean) => Promise<any[]>;","import { Pipe, PipeTransform } from '@angular/core';\r\n@Pipe({\r\n name: 'sdRemovableChip'\r\n})\r\nexport class SdRemovableChipPipe implements PipeTransform {\r\n constructor() { }\r\n transform(item: any, removable: boolean | ((item: any) => boolean)): boolean {\r\n if(typeof(removable) === 'boolean') {\r\n return removable;\r\n }\r\n return removable(item);\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\r\nimport { SdChip } from './chip.component';\r\nimport { SdChipDisplayDef } from './directives/sd-chip-display-def.directive';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatAutocompleteModule } from '@angular/material/autocomplete';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { SdTranslateModule } from '@sd-angular/core/translate';\r\nimport { MatChipsModule } from '@angular/material/chips';\r\nimport { SdRemovableChipPipe } from './pipes/removable-chip.pipe';\r\nimport { SdCommonModule } from '@sd-angular/core/common';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n MatInputModule,\r\n MatTooltipModule,\r\n MatFormFieldModule,\r\n MatAutocompleteModule,\r\n MatIconModule,\r\n MatProgressSpinnerModule,\r\n MatChipsModule,\r\n SdTranslateModule,\r\n SdCommonModule\r\n ],\r\n declarations: [\r\n SdChip,\r\n SdChipDisplayDef,\r\n SdRemovableChipPipe\r\n ],\r\n exports: [\r\n SdCommonModule,\r\n SdChip,\r\n SdChipDisplayDef,\r\n ]\r\n})\r\nexport class SdChipModule { }\r\n","/*\r\n * Public API Surface of superdev-angular-core\r\n */\r\n\r\nexport * from './lib/chip.module';\r\nexport * from './lib/chip.component';\r\nexport * from './lib/chip.model';\r\nexport * from './lib/directives/sd-chip-display-def.directive';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {SdRemovableChipPipe as ɵa} from './src/lib/pipes/removable-chip.pipe';"],"names":["uuid.v4"],"mappings":";;;;;;;;;;;;;;;;;;;MAKa,gBAAgB;IAC3B,YAAmB,WAA6B;QAA7B,gBAAW,GAAX,WAAW,CAAkB;KAAK;;;YAJtD,SAAS,SAAC;gBACT,QAAQ,EAAE,oBAAoB;aAC/B;;;YAJ0B,WAAW;;;;AC+BtC,MAAM,uBAAuB;IAC3B,YAAoB,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;KAAK;IACjD,YAAY,CAAC,OAA2B,EAAE,IAAwC;;QAChF,MAAM,WAAW,GAAG,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC;QAC3C,OAAO,CAAC,EAAE,OAAA,IAAI,CAAC,WAAW,0CAAE,OAAO,MAAK,OAAA,IAAI,CAAC,WAAW,0CAAE,KAAK,YAAI,IAAI,CAAC,WAAW,0CAAE,OAAO,CAAA,IAAI,WAAW,CAAC,CAAC,CAAC;KAC/G;CACF;MAQY,MAAM;IA2HjB,YACU,GAAsB,EACW,UAA8B;QAD/D,QAAG,GAAH,GAAG,CAAmB;QACW,eAAU,GAAV,UAAU,CAAoB;QA5HzE,gBAAQA,EAAO,EAAE,EAAC;QAOlB,uBAAkB,GAAa,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC9C,eAAU,GAAG,IAAI,CAAC;QAElB,wBAAiB;QAUjB,2BAAkB;QAQlB,cAAS,GAAuC,IAAI,CAAC;QAIrD,wBAAmB,GAAG,KAAK,CAAC;;QAK5B,YAAO,GAAG,KAAK,CAAC;QAChB,4BAA6B;QAC7B,mBAEI,EAAE,EAAC;QACP,iBAEI,EAAE,EAAC;QACP,iBAAS,GAAG,EAAC;QACb,wBAAgB,IAAI,eAAe,CAAqB,EAAE,CAAC,EAAC;QAanD,UAAK,GAAG,EAAE,CAAC;QAEpB,yBAAwB,EAAE,EAAC;QAE3B,iCAAs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;QAChE,IAAG,QAAO,SAAS,CAAC,KAAK,SAAS,EAAE;YAClC,OAAO,SAAS,CAAC;SAClB;QACD,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;KACxB;;;YAVF,IAAI,SAAC;gBACJ,IAAI,EAAE,iBAAiB;aACxB;;;;MCuCY,YAAY;;;YA1BxB,QAAQ,SAAC;gBACR,OAAO,EAAE;oBACP,YAAY;oBACZ,WAAW;oBACX,mBAAmB;oBACnB,cAAc;oBACd,gBAAgB;oBAChB,kBAAkB;oBAClB,qBAAqB;oBACrB,aAAa;oBACb,wBAAwB;oBACxB,cAAc;oBACd,iBAAiB;oBACjB,cAAc;iBACf;gBACD,YAAY,EAAE;oBACZ,MAAM;oBACN,gBAAgB;oBAChB,mBAAmB;iBACpB;gBACD,OAAO,EAAE;oBACP,cAAc;oBACd,MAAM;oBACN,gBAAgB;iBACjB;aACF;;;ACzCD;;;;ACAA;;;;;;"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { SdCommonModule } from '@sd-angular/core/common';
|
|
2
|
-
import { __awaiter } from 'tslib';
|
|
2
|
+
import { __awaiter, __classPrivateFieldGet } from 'tslib';
|
|
3
3
|
import { Injectable, NgModule } from '@angular/core';
|
|
4
4
|
import { v4 } from 'uuid';
|
|
5
5
|
import { PDFDocument } from 'pdf-lib';
|
|
6
6
|
import { CommonModule } from '@angular/common';
|
|
7
7
|
|
|
8
|
+
var _drawPageFooter;
|
|
8
9
|
class SdPdfService {
|
|
9
10
|
constructor() {
|
|
10
|
-
this.merge = (urls,
|
|
11
|
+
this.merge = (urls, option = { download: true }) => __awaiter(this, void 0, void 0, function* () {
|
|
11
12
|
const mergedPdf = yield PDFDocument.create();
|
|
12
13
|
for (const url of urls) {
|
|
13
14
|
const existingPdfBytes = yield fetch(url).then(res => res.arrayBuffer());
|
|
@@ -15,15 +16,30 @@ class SdPdfService {
|
|
|
15
16
|
const copied = yield mergedPdf.copyPages(file, file.getPageIndices());
|
|
16
17
|
copied.forEach((page) => mergedPdf.addPage(page));
|
|
17
18
|
}
|
|
19
|
+
if ((option === null || option === void 0 ? void 0 : option.isInsertFooter) && (option === null || option === void 0 ? void 0 : option.footerOption)) {
|
|
20
|
+
__classPrivateFieldGet(this, _drawPageFooter).call(this, mergedPdf, option.footerOption);
|
|
21
|
+
}
|
|
18
22
|
const mergedPdfFile = yield mergedPdf.save();
|
|
19
23
|
const blob = new Blob([mergedPdfFile], { type: 'application/pdf' });
|
|
20
|
-
if (download) {
|
|
24
|
+
if (option === null || option === void 0 ? void 0 : option.download) {
|
|
21
25
|
SdUtility.downloadBlob(blob, v4());
|
|
22
26
|
}
|
|
23
27
|
return blob;
|
|
24
28
|
});
|
|
29
|
+
_drawPageFooter.set(this, (pdf, option) => {
|
|
30
|
+
const numberOfPages = pdf.getPageCount();
|
|
31
|
+
pdf.getPages().forEach((page, idx) => {
|
|
32
|
+
var _a, _b, _c;
|
|
33
|
+
page.drawText(`${idx + 1}/${numberOfPages}`, {
|
|
34
|
+
x: (_a = option === null || option === void 0 ? void 0 : option.offsetX) !== null && _a !== void 0 ? _a : 15,
|
|
35
|
+
y: (_b = option === null || option === void 0 ? void 0 : option.offsetY) !== null && _b !== void 0 ? _b : 15,
|
|
36
|
+
size: (_c = option === null || option === void 0 ? void 0 : option.size) !== null && _c !== void 0 ? _c : 9,
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
});
|
|
25
40
|
}
|
|
26
41
|
}
|
|
42
|
+
_drawPageFooter = new WeakMap();
|
|
27
43
|
SdPdfService.decorators = [
|
|
28
44
|
{ type: Injectable }
|
|
29
45
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-angular-core-pdf.js","sources":["../../../../projects/sd-core/pdf/src/lib/pdf.service.ts","../../../../projects/sd-core/pdf/src/lib/pdf.module.ts","../../../../projects/sd-core/pdf/sd-angular-core-pdf.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport * as uuid from 'uuid';\r\nimport { PDFDocument } from 'pdf-lib';\r\n\r\n@Injectable()\r\nexport class SdPdfService {\r\n constructor() {\r\n }\r\n\r\n merge = async (urls: string[],
|
|
1
|
+
{"version":3,"file":"sd-angular-core-pdf.js","sources":["../../../../projects/sd-core/pdf/src/lib/pdf.service.ts","../../../../projects/sd-core/pdf/src/lib/pdf.module.ts","../../../../projects/sd-core/pdf/sd-angular-core-pdf.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport * as uuid from 'uuid';\r\nimport { PDFDocument } from 'pdf-lib';\r\n\r\n@Injectable()\r\nexport class SdPdfService {\r\n constructor() {\r\n }\r\n\r\n merge = async (urls: string[], option:PDFMergeOption = {download:true}) => {\r\n const mergedPdf = await PDFDocument.create();\r\n for (const url of urls) {\r\n const existingPdfBytes = await fetch(url).then(res => res.arrayBuffer())\r\n const file = await PDFDocument.load(existingPdfBytes);\r\n \r\n const copied = await mergedPdf.copyPages(file, file.getPageIndices());\r\n copied.forEach((page) => mergedPdf.addPage(page));\r\n }\r\n if (option?.isInsertFooter && option?.footerOption){\r\n this.#drawPageFooter(mergedPdf,option.footerOption); \r\n }\r\n const mergedPdfFile = await mergedPdf.save();\r\n const blob = new Blob([mergedPdfFile], { type: 'application/pdf' });\r\n if (option?.download) {\r\n SdUtility.downloadBlob(blob, uuid.v4());\r\n }\r\n return blob;\r\n }\r\n\r\n #drawPageFooter = (pdf:PDFDocument,option:FooterOption) => {\r\n const numberOfPages = pdf.getPageCount()\r\n pdf.getPages().forEach( (page,idx) => {\r\n page.drawText(`${idx+1}/${numberOfPages}`,{\r\n x:option?.offsetX ?? 15,\r\n y:option?.offsetY ?? 15,\r\n size:option?.size ?? 9,\r\n })\r\n })\r\n }\r\n}\r\n\r\nexport interface IExportInfo {\r\n data: any[];\r\n sheetName?: string;\r\n fileName?: string;\r\n}\r\nexport interface PDFMergeOption{\r\n download?:boolean,\r\n isInsertFooter?:boolean\r\n footerOption?:FooterOption,\r\n}\r\n\r\nexport interface FooterOption{\r\n \r\n offsetX?:number,\r\n offsetY?:number,\r\n size?:number,\r\n font?:string,\r\n}","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdPdfService } from './pdf.service';\r\nimport { SdCommonModule } from '@sd-angular/core/common';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n SdCommonModule\r\n ],\r\n declarations: [\r\n ],\r\n exports: [\r\n ],\r\n providers: [\r\n SdPdfService\r\n ]\r\n})\r\nexport class SdPdfModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["uuid.v4"],"mappings":";;;;;;;;MAKa,YAAY;IACvB;QAGA,UAAK,GAAG,CAAO,IAAc,EAAE,SAAwB,EAAC,QAAQ,EAAC,IAAI,EAAC;YACpE,MAAM,SAAS,GAAG,MAAM,WAAW,CAAC,MAAM,EAAE,CAAC;YAC7C,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;gBACtB,MAAM,gBAAgB,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,WAAW,EAAE,CAAC,CAAA;gBACxE,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;gBAEtD,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;gBACtE,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;aACnD;YACD,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,cAAc,MAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,CAAA,EAAC;gBAClD,mDAAA,IAAI,EAAiB,SAAS,EAAC,MAAM,CAAC,YAAY,CAAC,CAAC;aACpD;YACD,MAAM,aAAa,GAAG,MAAM,SAAS,CAAC,IAAI,EAAE,CAAC;YAC7C,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,aAAa,CAAC,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC,CAAC;YACpE,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,EAAE;gBACpB,SAAS,CAAC,YAAY,CAAC,IAAI,EAAEA,EAAO,EAAE,CAAC,CAAC;aACzC;YACD,OAAO,IAAI,CAAC;SACb,CAAA,CAAA;QAED,0BAAkB,CAAC,GAAe,EAAC,MAAmB;YACpD,MAAM,aAAa,GAAG,GAAG,CAAC,YAAY,EAAE,CAAA;YACxC,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAE,CAAC,IAAI,EAAC,GAAG;;gBAC/B,IAAI,CAAC,QAAQ,CAAC,GAAG,GAAG,GAAC,CAAC,IAAI,aAAa,EAAE,EAAC;oBACxC,CAAC,QAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,mCAAI,EAAE;oBACvB,CAAC,QAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,mCAAI,EAAE;oBACvB,IAAI,QAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,mCAAI,CAAC;iBACvB,CAAC,CAAA;aACH,CAAC,CAAA;SACH,EAAA;KA/BA;;;;YAHF,UAAU;;;;MCcE,WAAW;;;YAbvB,QAAQ,SAAC;gBACR,OAAO,EAAE;oBACP,YAAY;oBACZ,cAAc;iBACf;gBACD,YAAY,EAAE,EACb;gBACD,OAAO,EAAE,EACR;gBACD,SAAS,EAAE;oBACT,YAAY;iBACb;aACF;;;ACjBD;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"SdPdfService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":4,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"IExportInfo":{"__symbolic":"interface"},"SdPdfModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":5,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":7,"character":4},{"__symbolic":"reference","module":"@sd-angular/core/common","name":"SdCommonModule","line":8,"character":4}],"declarations":[],"exports":[],"providers":[{"__symbolic":"reference","name":"SdPdfService"}]}]}],"members":{}}},"origins":{"SdPdfService":"./src/lib/pdf.service","IExportInfo":"./src/lib/pdf.service","SdPdfModule":"./src/lib/pdf.module"},"importAs":"@sd-angular/core/pdf"}
|
|
1
|
+
{"__symbolic":"module","version":4,"metadata":{"SdPdfService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":4,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"IExportInfo":{"__symbolic":"interface"},"PDFMergeOption":{"__symbolic":"interface"},"FooterOption":{"__symbolic":"interface"},"SdPdfModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":5,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":7,"character":4},{"__symbolic":"reference","module":"@sd-angular/core/common","name":"SdCommonModule","line":8,"character":4}],"declarations":[],"exports":[],"providers":[{"__symbolic":"reference","name":"SdPdfService"}]}]}],"members":{}}},"origins":{"SdPdfService":"./src/lib/pdf.service","IExportInfo":"./src/lib/pdf.service","PDFMergeOption":"./src/lib/pdf.service","FooterOption":"./src/lib/pdf.service","SdPdfModule":"./src/lib/pdf.module"},"importAs":"@sd-angular/core/pdf"}
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
export declare class SdPdfService {
|
|
2
|
+
#private;
|
|
2
3
|
constructor();
|
|
3
|
-
merge: (urls: string[],
|
|
4
|
+
merge: (urls: string[], option?: PDFMergeOption) => Promise<Blob>;
|
|
4
5
|
}
|
|
5
6
|
export interface IExportInfo {
|
|
6
7
|
data: any[];
|
|
7
8
|
sheetName?: string;
|
|
8
9
|
fileName?: string;
|
|
9
10
|
}
|
|
11
|
+
export interface PDFMergeOption {
|
|
12
|
+
download?: boolean;
|
|
13
|
+
isInsertFooter?: boolean;
|
|
14
|
+
footerOption?: FooterOption;
|
|
15
|
+
}
|
|
16
|
+
export interface FooterOption {
|
|
17
|
+
offsetX?: number;
|
|
18
|
+
offsetY?: number;
|
|
19
|
+
size?: number;
|
|
20
|
+
font?: string;
|
|
21
|
+
}
|
|
index 076371f..7df5f93 100644
|
|
|
Binary file
|