@sdcorejs/angular 22.3.3 → 22.3.4
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/fesm2022/sdcorejs-angular-components-query-bar.mjs +489 -42
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-table.mjs +1258 -114
- package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-i18n.mjs +140 -5
- package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-layout.mjs +87 -5
- package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-base-api.service-Cfmr0L_5.mjs → sdcorejs-angular-modules-pattern-base-api.service-C2o5xPVB.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-base-api.service-Cfmr0L_5.mjs.map → sdcorejs-angular-modules-pattern-base-api.service-C2o5xPVB.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-create-side-drawer.component-CxgmaNod.mjs → sdcorejs-angular-modules-pattern-create-side-drawer.component-CRc9T7rb.mjs} +18 -4
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-CRc9T7rb.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-create-side-drawer.component-C7-itJqB.mjs → sdcorejs-angular-modules-pattern-create-side-drawer.component-Cz-MjRG0.mjs} +18 -4
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-Cz-MjRG0.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-create.component-C2GdGhkJ.mjs → sdcorejs-angular-modules-pattern-create.component-CxicczH7.mjs} +19 -5
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-CxicczH7.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-create.component-DIivNX4o.mjs → sdcorejs-angular-modules-pattern-create.component-D3MzNJ3F.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-create.component-DIivNX4o.mjs.map → sdcorejs-angular-modules-pattern-create.component-D3MzNJ3F.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-create.component-CzJh4LMR.mjs → sdcorejs-angular-modules-pattern-create.component-RBvVv88D.mjs} +36 -12
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-RBvVv88D.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-customer.service-B0nhFd_M.mjs → sdcorejs-angular-modules-pattern-customer.service-3hWkJClX.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-customer.service-B0nhFd_M.mjs.map → sdcorejs-angular-modules-pattern-customer.service-3hWkJClX.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-detail-side-drawer.component-D1dqsKX0.mjs → sdcorejs-angular-modules-pattern-detail-side-drawer.component-DzDAX3B7.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-detail-side-drawer.component-D1dqsKX0.mjs.map → sdcorejs-angular-modules-pattern-detail-side-drawer.component-DzDAX3B7.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-detail.component-WK0AcxNJ.mjs → sdcorejs-angular-modules-pattern-detail.component-CEhbU12j.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-detail.component-WK0AcxNJ.mjs.map → sdcorejs-angular-modules-pattern-detail.component-CEhbU12j.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-detail.component-Dkmm0a2Y.mjs → sdcorejs-angular-modules-pattern-detail.component-CcpYULut.mjs} +28 -11
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CcpYULut.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-flow.component-BvhEMUgY.mjs → sdcorejs-angular-modules-pattern-flow.component-G5lHfG81.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-flow.component-BvhEMUgY.mjs.map → sdcorejs-angular-modules-pattern-flow.component-G5lHfG81.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-general-information-form.component-cxNRkeRU.mjs → sdcorejs-angular-modules-pattern-general-information-form.component-BJaYcNzf.mjs} +3 -3
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-BJaYcNzf.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-index.component-D1zWXyN6.mjs → sdcorejs-angular-modules-pattern-index.component-CosbQK0W.mjs} +4 -4
- package/fesm2022/sdcorejs-angular-modules-pattern-index.component-CosbQK0W.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-lines-table-form.component-DmmVKrgM.mjs +836 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-lines-table-form.component-DmmVKrgM.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-CaXgC8wK.mjs → sdcorejs-angular-modules-pattern-list.component-BjehcQEk.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-CaXgC8wK.mjs.map → sdcorejs-angular-modules-pattern-list.component-BjehcQEk.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-1Xn1WaAP.mjs → sdcorejs-angular-modules-pattern-list.component-CNVqk3JC.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-1Xn1WaAP.mjs.map → sdcorejs-angular-modules-pattern-list.component-CNVqk3JC.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-Bv_l7vnz.mjs → sdcorejs-angular-modules-pattern-list.component-C_pVqRcC.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-Bv_l7vnz.mjs.map → sdcorejs-angular-modules-pattern-list.component-C_pVqRcC.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-ChwTb4BU.mjs → sdcorejs-angular-modules-pattern-list.component-EaNDEtCn.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-ChwTb4BU.mjs.map → sdcorejs-angular-modules-pattern-list.component-EaNDEtCn.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-B6Ndq542.mjs → sdcorejs-angular-modules-pattern-list.component-jB3E20UF.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-B6Ndq542.mjs.map → sdcorejs-angular-modules-pattern-list.component-jB3E20UF.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-mock-backend.factory-DKK3NmbN.mjs → sdcorejs-angular-modules-pattern-mock-backend.factory-CFljqhjv.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-mock-backend.factory-DKK3NmbN.mjs.map → sdcorejs-angular-modules-pattern-mock-backend.factory-CFljqhjv.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-pattern-source-viewer-BpLQaYP5.mjs → sdcorejs-angular-modules-pattern-pattern-source-viewer-BqHwKfoc.mjs} +9 -2
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-BqHwKfoc.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-pattern-source.generated-BrejHvB2.mjs → sdcorejs-angular-modules-pattern-pattern-source.generated-CIiLOizq.mjs} +21 -19
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-CIiLOizq.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-product.service-GSlXwL2Z.mjs → sdcorejs-angular-modules-pattern-product.service-DitXmlr1.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-product.service-GSlXwL2Z.mjs.map → sdcorejs-angular-modules-pattern-product.service-DitXmlr1.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-profile.component-DPBwMafn.mjs → sdcorejs-angular-modules-pattern-profile.component-Dxw7Ix9d.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-profile.component-DPBwMafn.mjs.map → sdcorejs-angular-modules-pattern-profile.component-Dxw7Ix9d.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-B6z9lJYB.mjs → sdcorejs-angular-modules-pattern-routes-BOiWZHqg.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-B6z9lJYB.mjs.map → sdcorejs-angular-modules-pattern-routes-BOiWZHqg.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-h66efEeH.mjs → sdcorejs-angular-modules-pattern-routes-BWZxOMhB.mjs} +7 -7
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-h66efEeH.mjs.map → sdcorejs-angular-modules-pattern-routes-BWZxOMhB.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-DeThmv4f.mjs → sdcorejs-angular-modules-pattern-routes-BxXgJVsW.mjs} +4 -4
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-DeThmv4f.mjs.map → sdcorejs-angular-modules-pattern-routes-BxXgJVsW.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-t3O2L2J5.mjs → sdcorejs-angular-modules-pattern-routes-C43Q4Wtq.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-t3O2L2J5.mjs.map → sdcorejs-angular-modules-pattern-routes-C43Q4Wtq.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-D1fsRfRB.mjs → sdcorejs-angular-modules-pattern-routes-CJ-RAMa5.mjs} +5 -5
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-D1fsRfRB.mjs.map → sdcorejs-angular-modules-pattern-routes-CJ-RAMa5.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-DdCFCwxY.mjs → sdcorejs-angular-modules-pattern-routes-CWixJ2If.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-DdCFCwxY.mjs.map → sdcorejs-angular-modules-pattern-routes-CWixJ2If.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-1kifjm82.mjs → sdcorejs-angular-modules-pattern-routes-CophQH_L.mjs} +5 -5
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-1kifjm82.mjs.map → sdcorejs-angular-modules-pattern-routes-CophQH_L.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-bQpdxKlY.mjs → sdcorejs-angular-modules-pattern-routes-w4VY9P_H.mjs} +9 -9
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-bQpdxKlY.mjs.map → sdcorejs-angular-modules-pattern-routes-w4VY9P_H.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-B6w4N6wo.mjs → sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-BQCWgQsr.mjs} +12 -12
- package/fesm2022/{sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-B6w4N6wo.mjs.map → sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-BQCWgQsr.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-shell.component-BIYHlzVQ.mjs → sdcorejs-angular-modules-pattern-shell.component-BOjJteMd.mjs} +4 -4
- package/fesm2022/{sdcorejs-angular-modules-pattern-shell.component-BIYHlzVQ.mjs.map → sdcorejs-angular-modules-pattern-shell.component-BOjJteMd.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-update-side-drawer.component-nnldn2cz.mjs → sdcorejs-angular-modules-pattern-update-side-drawer.component-BT2PzXTG.mjs} +4 -4
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-BT2PzXTG.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-update-side-drawer.component-DKgmhJT2.mjs → sdcorejs-angular-modules-pattern-update-side-drawer.component-qmGn2tCI.mjs} +4 -4
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-qmGn2tCI.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-update.component-p9R5-eou.mjs → sdcorejs-angular-modules-pattern-update.component-CS3jlV-R.mjs} +5 -5
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-CS3jlV-R.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-update.component-C0Bewuwz.mjs → sdcorejs-angular-modules-pattern-update.component-CUgQPcR4.mjs} +22 -12
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-CUgQPcR4.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-update.component-Qlh3Lm2p.mjs → sdcorejs-angular-modules-pattern-update.component-lGwicZKW.mjs} +12 -10
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-lGwicZKW.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern.mjs +1 -1
- package/fesm2022/sdcorejs-angular-services-api.mjs +11 -11
- package/fesm2022/sdcorejs-angular-services-api.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-cache.mjs +7 -5
- package/fesm2022/sdcorejs-angular-services-cache.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-storage.mjs +6 -4
- package/fesm2022/sdcorejs-angular-services-storage.mjs.map +1 -1
- package/modules/pattern/docs/drawer.md +1 -1
- package/modules/pattern/docs/form.md +445 -148
- package/modules/pattern/docs/header-actions.md +14 -12
- package/modules/pattern/docs/select.md +9 -1
- package/modules/pattern/features/category/components/create-side-drawer/create-side-drawer.component.ts +8 -1
- package/modules/pattern/features/category/components/update-side-drawer/update-side-drawer.component.ts +1 -1
- package/modules/pattern/features/customer/components/create-side-drawer/create-side-drawer.component.ts +8 -1
- package/modules/pattern/features/customer/components/update-side-drawer/update-side-drawer.component.ts +1 -1
- package/modules/pattern/features/order/components/general-information-form/general-information-form.component.ts +1 -1
- package/modules/pattern/features/order/components/lines-form/lines-form.component.ts +124 -147
- package/modules/pattern/features/order/components/lines-form/order-lines.ts +101 -0
- package/modules/pattern/features/order/components/lines-table-form/lines-table-form.component.ts +196 -0
- package/modules/pattern/features/order/pages/create/create.component.ts +18 -4
- package/modules/pattern/features/order/pages/detail/detail.component.ts +14 -12
- package/modules/pattern/features/order/pages/update/update.component.ts +11 -4
- package/modules/pattern/features/product/components/general-information-form/general-information-form.component.ts +1 -1
- package/modules/pattern/features/product/components/product-select/product-select.component.ts +9 -1
- package/modules/pattern/features/product/pages/create/create.component.ts +8 -1
- package/modules/pattern/features/product/pages/update/update.component.ts +1 -1
- package/modules/pattern/features/settings/pages/update/update.component.ts +5 -4
- package/package.json +1 -1
- package/types/sdcorejs-angular-components-query-bar.d.ts +126 -11
- package/types/sdcorejs-angular-components-table.d.ts +174 -13
- package/types/sdcorejs-angular-i18n.d.ts +28 -1
- package/types/sdcorejs-angular-services-api.d.ts +5 -5
- package/types/sdcorejs-angular-services-cache.d.ts +4 -2
- package/types/sdcorejs-angular-services-storage.d.ts +3 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-C7-itJqB.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-CxgmaNod.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-C2GdGhkJ.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-CzJh4LMR.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-Dkmm0a2Y.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-cxNRkeRU.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-index.component-D1zWXyN6.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-lines-form.component-BK__9Mzb.mjs +0 -541
- package/fesm2022/sdcorejs-angular-modules-pattern-lines-form.component-BK__9Mzb.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-BpLQaYP5.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-BrejHvB2.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-DKgmhJT2.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-nnldn2cz.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-C0Bewuwz.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-Qlh3Lm2p.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-p9R5-eou.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, inject, TemplateRef, Directive, booleanAttribute, Pipe, isSignal, output, signal, computed, effect, untracked, ChangeDetectionStrategy, Component, viewChild, ElementRef, afterRenderEffect, isDevMode, Input, contentChildren, DestroyRef, ChangeDetectorRef, afterNextRender, model, InjectionToken, Injectable, ViewChild, Renderer2, NgZone,
|
|
2
|
+
import { input, inject, TemplateRef, Directive, booleanAttribute, Pipe, isSignal, output, signal, computed, effect, untracked, ChangeDetectionStrategy, Component, viewChild, ElementRef, afterRenderEffect, isDevMode, Input, contentChildren, DestroyRef, ChangeDetectorRef, afterNextRender, model, InjectionToken, Injectable, viewChildren, Injector, ViewChild, Renderer2, NgZone, contentChild } from '@angular/core';
|
|
3
3
|
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
4
4
|
import * as i3$3 from '@angular/material/paginator';
|
|
5
5
|
import { MatPaginatorIntl, MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
|
|
@@ -15,10 +15,11 @@ import { NgTemplateOutlet, AsyncPipe, DOCUMENT, NgStyle, CommonModule, DatePipe,
|
|
|
15
15
|
import * as i1 from '@angular/material/tooltip';
|
|
16
16
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
17
17
|
import { SdViewportService } from '@sdcorejs/angular/services/viewport';
|
|
18
|
-
import { ɵSdSearchField as _SdSearchField, ɵSdSearchFieldInputDirective as _SdSearchFieldInputDirective } from '@sdcorejs/angular/forms/directives';
|
|
18
|
+
import { ɵSdSearchField as _SdSearchField, ɵSdSearchFieldInputDirective as _SdSearchFieldInputDirective, SdSuffixDefDirective } from '@sdcorejs/angular/forms/directives';
|
|
19
19
|
import { SdSelect } from '@sdcorejs/angular/forms/select';
|
|
20
20
|
import { SdTranslatePipe, I18nService } from '@sdcorejs/angular/i18n';
|
|
21
21
|
import { Utilities, FilterUtilities, StringUtilities, DateUtilities, NumberUtilities, BrowserUtilities, ArrayUtilities } from '@sdcorejs/utils/fns';
|
|
22
|
+
import { SdQueryBar } from '@sdcorejs/angular/components/query-bar';
|
|
22
23
|
import * as i2 from '@angular/material/button';
|
|
23
24
|
import { MatButtonModule } from '@angular/material/button';
|
|
24
25
|
import { SdQuickAction } from '@sdcorejs/angular/components/quick-action';
|
|
@@ -37,7 +38,7 @@ import * as i2$1 from '@angular/material/form-field';
|
|
|
37
38
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
38
39
|
import * as i3$1 from '@angular/material/select';
|
|
39
40
|
import { MatSelectModule } from '@angular/material/select';
|
|
40
|
-
import {
|
|
41
|
+
import { CdkColumnDef } from '@angular/cdk/table';
|
|
41
42
|
import * as i2$3 from '@angular/forms';
|
|
42
43
|
import { FormGroup, FormsModule } from '@angular/forms';
|
|
43
44
|
import { SdDataStateTemplateDirective, SdDataState } from '@sdcorejs/angular/components/data-state';
|
|
@@ -58,6 +59,7 @@ import { SdSection } from '@sdcorejs/angular/components/section';
|
|
|
58
59
|
import { SdCheckbox } from '@sdcorejs/angular/forms/checkbox';
|
|
59
60
|
import { SdDatetime } from '@sdcorejs/angular/forms/datetime';
|
|
60
61
|
import { SdConfirmService } from '@sdcorejs/angular/services/confirm';
|
|
62
|
+
import { sdNormalizeSearchText } from '@sdcorejs/angular/utilities/extensions';
|
|
61
63
|
import * as i3$2 from '@angular/material/chips';
|
|
62
64
|
import { MatChipsModule } from '@angular/material/chips';
|
|
63
65
|
|
|
@@ -705,6 +707,517 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
705
707
|
], template: "@let _option = option();\n@let _value = value();\n@let _valid = valid();\n@let _autoId = autoId();\n@let _inputId = inputId();\n@let _term = term();\n@let _enterHint = 'core.component.table.quick-search.enter' | sdTranslate;\n<div class=\"sd-quick-search-row\">\n <div class=\"sd-quick-search-controls\" role=\"search\" [attr.aria-label]=\"'core.component.table.search' | sdTranslate\">\n @for (control of controls(); track control.item.field) {\n @let item = control.item;\n @let items = item.type === 'values' ? (item.option.items | filterValues | async) : item.option.items;\n <sd-select\n class=\"sd-quick-search-dropdown\"\n [autoId]=\"_autoId ? _autoId + '-quick-search-' + item.field : undefined\"\n [label]=\"item.title\"\n [items]=\"items\"\n [valueField]=\"item.option.valueField\"\n [displayField]=\"item.option.displayField\"\n [model]=\"_value.filters[item.field]\"\n [multiple]=\"item.option.selection === 'MULTIPLE' || item.option.selection === 'MULTIPLEAUTOCOMPLETE'\"\n [required]=\"!!item.required\"\n [disabled]=\"control.disabled\"\n (sdChange)=\"onFilterChange(item, $event)\"\n appearance=\"outline\"\n [size]=\"isMobile() ? 'md' : 'sm'\"\n hideInlineError />\n }\n <div class=\"sd-quick-search-keyword\">\n <sd-search-field\n class=\"sd-quick-search-field\"\n size=\"sm\"\n clearable\n [clearLabel]=\"'core.component.table.quick-search.clear' | sdTranslate\"\n [autoId]=\"_autoId ? _autoId + '-quick-search' : undefined\"\n (cleared)=\"clear(searchInput)\">\n <input\n #searchInput\n sdSearchFieldInput\n [id]=\"_inputId\"\n type=\"text\"\n enterkeyhint=\"search\"\n autocomplete=\"off\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-quick-search-term' : null\"\n [attr.aria-label]=\"'core.component.table.search' | sdTranslate\"\n [attr.aria-describedby]=\"_inputId + (_valid ? '-hint' : '-required')\"\n [placeholder]=\"_option.placeholder || ('core.component.table.quick-search.placeholder' | sdTranslate)\"\n [disabled]=\"!_valid\"\n [value]=\"_term\"\n (input)=\"onInput($event)\"\n (keydown)=\"onKeydown($event)\" />\n <span sdSearchFieldEnd class=\"sd-quick-search-enter\" [matTooltip]=\"_enterHint\" aria-hidden=\"true\">\u21B5</span>\n </sd-search-field>\n </div>\n </div>\n @if (rightTemplate(); as template) {\n <div class=\"sd-quick-search-right\"><ng-container [ngTemplateOutlet]=\"template\" /></div>\n }\n</div>\n<span [id]=\"_inputId + '-hint'\" hidden>{{ _enterHint }}</span>\n@if (!_valid) {\n <p class=\"sd-quick-search-hint\" [id]=\"_inputId + '-required'\">\n {{ 'core.component.table.quick-search.required' | sdTranslate }}\n </p>\n}\n", styles: [":host{display:block;flex:0 0 auto;container-type:inline-size;box-sizing:border-box;padding:12px 16px;background:var(--sd-table-bg, #ffffff);--sd-control-label-bg: var(--sd-table-bg, #ffffff)}.sd-quick-search-row{display:flex;align-items:flex-end;flex-wrap:wrap;gap:12px 20px}.sd-quick-search-controls{display:flex;flex:1 1 460px;flex-wrap:wrap;align-items:flex-end;gap:12px;min-width:0}.sd-quick-search-dropdown{display:block;flex:0 1 180px;min-width:140px;max-width:100%}.sd-quick-search-keyword{flex:0 1 360px;min-width:220px;max-width:100%}.sd-quick-search-field:not(.sd-disabled){background:var(--sd-table-bg, #ffffff)}.sd-quick-search-enter{font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-18, 18px);padding:0 4px;border:1px solid var(--sd-border, #e0e3e8);border-radius:var(--sd-radius-4, 4px)}.sd-quick-search-right{margin-left:auto;max-width:100%;min-width:0}.sd-quick-search-hint{margin:6px 0 0;font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-18, 18px);color:var(--sd-text-secondary, #626872)}@container (max-width: 550px){.sd-quick-search-controls{flex-basis:100%}.sd-quick-search-dropdown,.sd-quick-search-keyword{flex:1 1 100%;min-width:0}.sd-quick-search-right{margin-left:0;flex-basis:100%}.sd-quick-search-field{min-height:var(--sd-control-height-coarse, 44px);font-size:var(--sd-font-size-16, 16px);--sd-search-field-clear-size: 40px}}\n"] }]
|
|
706
708
|
}], ctorParameters: () => [], propDecorators: { option: [{ type: i0.Input, args: [{ isSignal: true, alias: "option", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], rightTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "rightTemplate", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
|
|
707
709
|
|
|
710
|
+
/**
|
|
711
|
+
* Leaf columns: each grouped header (`type: 'children'`) is replaced by its children. Filtering, sorting and the
|
|
712
|
+
* filter defaults work on leaves — a grouped header has no value of its own.
|
|
713
|
+
*/
|
|
714
|
+
const leafColumns = (columns) => (columns ?? []).flatMap(column => (column.type === 'children' ? column.children : [column]));
|
|
715
|
+
|
|
716
|
+
/** Kiểu cột mà column-filter render control mặc định (nhận chip operator — thiết kế đợt 2 · G). */
|
|
717
|
+
const CONTROL_FILTER_TYPES = new Set([
|
|
718
|
+
'string',
|
|
719
|
+
'number',
|
|
720
|
+
'boolean',
|
|
721
|
+
'values',
|
|
722
|
+
'lazy-values',
|
|
723
|
+
'date',
|
|
724
|
+
'datetime',
|
|
725
|
+
'time',
|
|
726
|
+
]);
|
|
727
|
+
/**
|
|
728
|
+
* Cột lọc bằng control mặc định: không có template `filterDef`, không phải `split-number` / `split-date` (hai ô).
|
|
729
|
+
* Chỉ ở đây operator nằm trong control và control khoá ô khi chọn `NULL` / `NOT_NULL`.
|
|
730
|
+
*/
|
|
731
|
+
const isDefaultControlFilter = (column) => {
|
|
732
|
+
const filter = column.filter;
|
|
733
|
+
return CONTROL_FILTER_TYPES.has(column.type) && !filter?.filterDef && filter?.type !== 'split-number' && filter?.type !== 'split-date';
|
|
734
|
+
};
|
|
735
|
+
/**
|
|
736
|
+
* `NULL` / `NOT_NULL` trên control mặc định: ô bị khoá và để trống, nên filter có hiệu lực mà không cần giá trị.
|
|
737
|
+
* Template custom và filter split giữ cách cũ (chỉ lọc khi có giá trị).
|
|
738
|
+
*/
|
|
739
|
+
const isNoDataColumnOperator = (column, operator) => (operator === 'NULL' || operator === 'NOT_NULL') && isDefaultControlFilter(column);
|
|
740
|
+
|
|
741
|
+
const NO_DATA = ['NULL', 'NOT_NULL'];
|
|
742
|
+
/** Column operators the raw record cannot hold for one value. */
|
|
743
|
+
const NOT_SCALAR = ['BETWEEN', 'IN', 'NOT_IN'];
|
|
744
|
+
const SINGLE_VALUE = ['EQUAL', 'NOT_EQUAL', 'NULL', 'NOT_NULL'];
|
|
745
|
+
const hasValue$1 = (value) => value !== undefined && value !== null && value !== '';
|
|
746
|
+
const isNoData = (operator) => !!operator && NO_DATA.includes(operator);
|
|
747
|
+
const read = (value) => (isSignal(value) ? value() : value);
|
|
748
|
+
/** `selection: 'MULTIPLE' | 'MULTIPLEAUTOCOMPLETE'` — the controls that store an array. */
|
|
749
|
+
const isMultiple = (selection) => !!selection && selection.includes('MULTIPLE');
|
|
750
|
+
const toArray = (value) => (Array.isArray(value) ? [...value] : hasValue$1(value) ? [value] : []);
|
|
751
|
+
const toRange = (value) => {
|
|
752
|
+
if (value && typeof value === 'object' && !Array.isArray(value) && !(value instanceof Date)) {
|
|
753
|
+
const range = value;
|
|
754
|
+
return { from: hasValue$1(range.from) ? range.from : null, to: hasValue$1(range.to) ? range.to : null };
|
|
755
|
+
}
|
|
756
|
+
// why: một ngày đơn trên cột khoảng ngày — converter lọc cả ngày đó, đúng như khoảng [v, v].
|
|
757
|
+
return hasValue$1(value) ? { from: value, to: value } : { from: null, to: null };
|
|
758
|
+
};
|
|
759
|
+
/** Same truthiness as `SdConvertToPagingReq` for boolean filters. */
|
|
760
|
+
const toBoolean = (value) => {
|
|
761
|
+
if (value === true || value === 1 || value === 'true' || value === '1')
|
|
762
|
+
return true;
|
|
763
|
+
if (value === false || value === 0 || value === 'false' || value === '0')
|
|
764
|
+
return false;
|
|
765
|
+
return null;
|
|
766
|
+
};
|
|
767
|
+
const stringify = (value) => {
|
|
768
|
+
try {
|
|
769
|
+
return Utilities.canonicalStringify(value);
|
|
770
|
+
}
|
|
771
|
+
catch {
|
|
772
|
+
return String(value);
|
|
773
|
+
}
|
|
774
|
+
};
|
|
775
|
+
/** The value in the comparable form of its shape: equivalent raw values compare equal. */
|
|
776
|
+
const normalize = (shape, value) => {
|
|
777
|
+
switch (shape) {
|
|
778
|
+
case 'multi':
|
|
779
|
+
return toArray(value);
|
|
780
|
+
case 'range':
|
|
781
|
+
return toRange(value);
|
|
782
|
+
case 'boolean':
|
|
783
|
+
case 'flag':
|
|
784
|
+
return toBoolean(value);
|
|
785
|
+
default:
|
|
786
|
+
return hasValue$1(value) ? value : null;
|
|
787
|
+
}
|
|
788
|
+
};
|
|
789
|
+
const sameRaw = (shape, left, right) => stringify(normalize(shape, left)) === stringify(normalize(shape, right));
|
|
790
|
+
const titleOf = (column) => (typeof column.title === 'string' ? column.title : column.title?.title) || column.field;
|
|
791
|
+
/** `values` / `lazy-values` field options; lazy `items` (an `SdSearch`) becomes the bar's `option.search`. */
|
|
792
|
+
const valuesField = (type, option, items = option.items) => type === 'lazy-values'
|
|
793
|
+
? {
|
|
794
|
+
type,
|
|
795
|
+
option: {
|
|
796
|
+
search: option.items,
|
|
797
|
+
valueField: option.valueField,
|
|
798
|
+
displayField: option.displayField,
|
|
799
|
+
...(option.views ? { views: option.views } : {}),
|
|
800
|
+
},
|
|
801
|
+
}
|
|
802
|
+
: { type, option: { items, valueField: option.valueField, displayField: option.displayField } };
|
|
803
|
+
/**
|
|
804
|
+
* Fields of the query bar for a table (handoff section 3): keys, groups, pinned chips, operators, and the filters
|
|
805
|
+
* left out. Order: `quickSearch.filters`, `externalFilters`, then the leaf columns given (children flattened).
|
|
806
|
+
*/
|
|
807
|
+
const sdTableQueryFields = (args) => {
|
|
808
|
+
const { labels } = args;
|
|
809
|
+
const exclude = new Set(args.queryBar?.exclude ?? []);
|
|
810
|
+
const filterDefs = new Set(args.filterDefs ?? []);
|
|
811
|
+
const pinnedList = args.queryBar?.pinned ? new Set(args.queryBar.pinned) : undefined;
|
|
812
|
+
const result = {
|
|
813
|
+
fields: [],
|
|
814
|
+
sources: new Map(),
|
|
815
|
+
excluded: [],
|
|
816
|
+
covered: [],
|
|
817
|
+
columnKeys: new Map(),
|
|
818
|
+
search: !!args.quickSearch,
|
|
819
|
+
quickSearch: !!args.quickSearch,
|
|
820
|
+
};
|
|
821
|
+
const add = (source, field) => {
|
|
822
|
+
result.sources.set(source.key, source);
|
|
823
|
+
result.fields.push({ ...field, key: source.key, defaultOperator: source.operator });
|
|
824
|
+
};
|
|
825
|
+
const skip = (key, reason) => {
|
|
826
|
+
result.excluded.push({ field: key, reason });
|
|
827
|
+
};
|
|
828
|
+
const pin = (field, byDefault, required) => required || (pinnedList ? pinnedList.has(field) : byDefault);
|
|
829
|
+
for (const item of args.quickSearch?.filters ?? []) {
|
|
830
|
+
const key = `quick:${item.field}`;
|
|
831
|
+
if (read(item.hidden)) {
|
|
832
|
+
skip(key, 'hidden quick filter (its value and required check still apply)');
|
|
833
|
+
continue;
|
|
834
|
+
}
|
|
835
|
+
if (exclude.has(item.field)) {
|
|
836
|
+
skip(key, 'listed in filter.queryBar.exclude');
|
|
837
|
+
continue;
|
|
838
|
+
}
|
|
839
|
+
const multi = isMultiple(item.option.selection);
|
|
840
|
+
const operator = multi ? 'IN' : item.defaultOperator || 'EQUAL';
|
|
841
|
+
add({ key, source: 'quick', field: item.field, quick: item, shape: multi ? 'multi' : 'scalar', operator, operatorMode: 'none' }, {
|
|
842
|
+
...valuesField(item.type, item.option),
|
|
843
|
+
label: item.title,
|
|
844
|
+
operators: [operator],
|
|
845
|
+
group: labels.filters,
|
|
846
|
+
pinned: pin(item.field, true, !!item.required),
|
|
847
|
+
required: !!item.required,
|
|
848
|
+
disabled: !!read(item.disabled),
|
|
849
|
+
});
|
|
850
|
+
}
|
|
851
|
+
const externalKeys = new Set();
|
|
852
|
+
for (const item of args.externalFilters ?? []) {
|
|
853
|
+
const key = `external:${item.field}`;
|
|
854
|
+
if (item.type === 'custom') {
|
|
855
|
+
skip(key, 'custom external filter');
|
|
856
|
+
continue;
|
|
857
|
+
}
|
|
858
|
+
if (filterDefs.has(item.field)) {
|
|
859
|
+
skip(key, 'sdTableFilterDef template');
|
|
860
|
+
continue;
|
|
861
|
+
}
|
|
862
|
+
if (exclude.has(item.field)) {
|
|
863
|
+
skip(key, 'listed in filter.queryBar.exclude');
|
|
864
|
+
continue;
|
|
865
|
+
}
|
|
866
|
+
if ((item.type === 'date' || item.type === 'datetime') &&
|
|
867
|
+
item.defaultOperator !== 'GREATER_OR_EQUAL' &&
|
|
868
|
+
item.defaultOperator !== 'LESS_OR_EQUAL') {
|
|
869
|
+
skip(key, 'date external filter without defaultOperator GREATER_OR_EQUAL or LESS_OR_EQUAL (sends no condition)');
|
|
870
|
+
continue;
|
|
871
|
+
}
|
|
872
|
+
const base = {
|
|
873
|
+
label: item.title,
|
|
874
|
+
group: labels.filters,
|
|
875
|
+
pinned: pin(item.field, !!args.inlineExternal[item.field], !!item.required),
|
|
876
|
+
required: !!item.required,
|
|
877
|
+
};
|
|
878
|
+
const source = { key, source: 'external', field: item.field, external: item, operatorMode: 'none' };
|
|
879
|
+
switch (item.type) {
|
|
880
|
+
case 'string': {
|
|
881
|
+
const operator = item.defaultOperator || 'CONTAIN';
|
|
882
|
+
add({ ...source, shape: 'scalar', operator }, { ...base, type: 'string', operators: [operator] });
|
|
883
|
+
break;
|
|
884
|
+
}
|
|
885
|
+
case 'number': {
|
|
886
|
+
const operator = item.defaultOperator || 'EQUAL';
|
|
887
|
+
add({ ...source, shape: 'scalar', operator }, { ...base, type: 'number', operators: [operator] });
|
|
888
|
+
break;
|
|
889
|
+
}
|
|
890
|
+
case 'boolean':
|
|
891
|
+
add({ ...source, shape: 'boolean', operator: 'EQUAL' }, { ...base, type: 'boolean', operators: ['EQUAL'], trueLabel: item.option?.displayOnTrue, falseLabel: item.option?.displayOnFalse });
|
|
892
|
+
break;
|
|
893
|
+
case 'date':
|
|
894
|
+
case 'datetime':
|
|
895
|
+
add({ ...source, shape: 'scalar', operator: item.defaultOperator }, { ...base, type: item.type, operators: [item.defaultOperator], min: item.minDate, max: item.maxDate });
|
|
896
|
+
break;
|
|
897
|
+
case 'daterange':
|
|
898
|
+
// why: control cũ (sd-date-range) chỉ chọn ngày và converter cắt về đầu/cuối ngày, kể cả với `enableTime`.
|
|
899
|
+
add({ ...source, shape: 'range', operator: 'BETWEEN' }, { ...base, type: 'date', operators: ['BETWEEN'], min: item.minDate, max: item.maxDate });
|
|
900
|
+
break;
|
|
901
|
+
case 'values':
|
|
902
|
+
case 'lazy-values': {
|
|
903
|
+
const multi = isMultiple(item.option.selection);
|
|
904
|
+
const operator = multi ? 'IN' : item.defaultOperator || 'EQUAL';
|
|
905
|
+
add({ ...source, shape: multi ? 'multi' : 'scalar', operator }, { ...base, ...valuesField(item.type, item.option), operators: [operator] });
|
|
906
|
+
break;
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
if (result.sources.has(key))
|
|
910
|
+
externalKeys.add(item.field);
|
|
911
|
+
}
|
|
912
|
+
if (args.hideColumns)
|
|
913
|
+
return result;
|
|
914
|
+
for (const column of leafColumns(args.columns)) {
|
|
915
|
+
const key = `column:${column.field}`;
|
|
916
|
+
if (externalKeys.has(column.field)) {
|
|
917
|
+
result.covered.push(column.field);
|
|
918
|
+
result.columnKeys.set(column.field, `external:${column.field}`);
|
|
919
|
+
continue;
|
|
920
|
+
}
|
|
921
|
+
const filter = column.filter;
|
|
922
|
+
const reason = column.hidden
|
|
923
|
+
? 'hidden column'
|
|
924
|
+
: column.type === 'time'
|
|
925
|
+
? 'time column'
|
|
926
|
+
: filter?.disabled
|
|
927
|
+
? 'filter.disabled'
|
|
928
|
+
: filter?.filterDef || filterDefs.has(column.field)
|
|
929
|
+
? 'filterDef template'
|
|
930
|
+
: exclude.has(column.field)
|
|
931
|
+
? 'listed in filter.queryBar.exclude'
|
|
932
|
+
: undefined;
|
|
933
|
+
if (reason) {
|
|
934
|
+
skip(key, reason);
|
|
935
|
+
continue;
|
|
936
|
+
}
|
|
937
|
+
const operator = filter?.operator;
|
|
938
|
+
const enabled = !!operator?.enable;
|
|
939
|
+
const list = enabled ? (operator?.list ?? []) : [];
|
|
940
|
+
// why: NULL / NOT_NULL chỉ có nghĩa trên control mặc định (converter: isNoDataColumnOperator).
|
|
941
|
+
const noData = enabled && isDefaultControlFilter(column) ? list.filter(op => NO_DATA.includes(op)) : [];
|
|
942
|
+
const base = { label: titleOf(column), group: labels.columns, pinned: pin(column.field, false, false) };
|
|
943
|
+
const source = { key, source: 'column', field: column.field, column };
|
|
944
|
+
switch (column.type) {
|
|
945
|
+
case 'string':
|
|
946
|
+
case 'number': {
|
|
947
|
+
if (column.type === 'number' && column.filter?.type === 'split-number') {
|
|
948
|
+
add({ ...source, shape: 'range', operator: 'BETWEEN', operatorMode: 'none' }, { ...base, type: 'number', operators: ['BETWEEN'] });
|
|
949
|
+
break;
|
|
950
|
+
}
|
|
951
|
+
const fallback = operator?.default ?? (column.type === 'string' ? 'CONTAIN' : 'EQUAL');
|
|
952
|
+
const choices = list.filter(op => !NOT_SCALAR.includes(op));
|
|
953
|
+
add({ ...source, shape: 'scalar', operator: fallback, operatorMode: enabled ? 'chip' : 'none' }, { ...base, type: column.type, operators: choices.length ? choices : [fallback] });
|
|
954
|
+
break;
|
|
955
|
+
}
|
|
956
|
+
case 'boolean':
|
|
957
|
+
add({ ...source, shape: 'flag', operator: 'EQUAL', operatorMode: enabled ? 'no-data' : 'none' }, {
|
|
958
|
+
...base,
|
|
959
|
+
type: 'boolean',
|
|
960
|
+
operators: ['EQUAL', ...noData],
|
|
961
|
+
trueLabel: column.option?.displayOnTrue,
|
|
962
|
+
falseLabel: column.option?.displayOnFalse,
|
|
963
|
+
});
|
|
964
|
+
break;
|
|
965
|
+
case 'values':
|
|
966
|
+
case 'lazy-values': {
|
|
967
|
+
const option = column.option;
|
|
968
|
+
const items = column.type === 'values' && typeof option.items === 'function' && !isSignal(option.items)
|
|
969
|
+
? (args.cacheValues?.[column.field] ?? option.items)
|
|
970
|
+
: option.items;
|
|
971
|
+
const field = valuesField(column.type, option, items);
|
|
972
|
+
if (isMultiple(option.selection)) {
|
|
973
|
+
add({ ...source, shape: 'multi', operator: 'IN', operatorMode: enabled ? 'no-data' : 'none' }, { ...base, ...field, operators: ['IN', ...noData] });
|
|
974
|
+
break;
|
|
975
|
+
}
|
|
976
|
+
const fallback = operator?.default ?? 'EQUAL';
|
|
977
|
+
const choices = list.filter(op => SINGLE_VALUE.includes(op));
|
|
978
|
+
add({ ...source, shape: 'scalar', operator: fallback, operatorMode: enabled ? 'chip' : 'none' }, { ...base, ...field, operators: choices.length ? choices : [fallback] });
|
|
979
|
+
break;
|
|
980
|
+
}
|
|
981
|
+
case 'date':
|
|
982
|
+
case 'datetime':
|
|
983
|
+
// why: control cũ chỉ chọn ngày (sd-date / sd-date-range) và converter lọc theo cả ngày, nên field là `date`.
|
|
984
|
+
if (column.filter?.type === 'date') {
|
|
985
|
+
add({ ...source, shape: 'scalar', operator: 'EQUAL', operatorMode: enabled ? 'no-data' : 'none' }, { ...base, type: 'date', operators: ['EQUAL', ...noData] });
|
|
986
|
+
}
|
|
987
|
+
else {
|
|
988
|
+
add({ ...source, shape: 'range', operator: 'BETWEEN', operatorMode: enabled ? 'no-data' : 'none' }, { ...base, type: 'date', operators: ['BETWEEN', ...noData] });
|
|
989
|
+
}
|
|
990
|
+
break;
|
|
991
|
+
}
|
|
992
|
+
if (result.sources.has(key))
|
|
993
|
+
result.columnKeys.set(column.field, key);
|
|
994
|
+
}
|
|
995
|
+
return result;
|
|
996
|
+
};
|
|
997
|
+
const readRaw = (source, value) => {
|
|
998
|
+
if (source.source === 'quick')
|
|
999
|
+
return value.quickSearch?.filters?.[source.field];
|
|
1000
|
+
if (source.source === 'external')
|
|
1001
|
+
return value.externalFilter?.[source.field];
|
|
1002
|
+
return value.columnFilter?.[source.field];
|
|
1003
|
+
};
|
|
1004
|
+
/** Chip of a source for a raw record: operator, data and whether it filters anything. */
|
|
1005
|
+
const chipOf = (source, value) => {
|
|
1006
|
+
const columnOperator = source.source === 'column' ? value.columnOperator?.[source.field] : undefined;
|
|
1007
|
+
if (source.operatorMode !== 'none' && isNoData(columnOperator) && isNoDataColumnOperator(source.column, columnOperator)) {
|
|
1008
|
+
return { operator: columnOperator, data: null, active: true };
|
|
1009
|
+
}
|
|
1010
|
+
const raw = readRaw(source, value);
|
|
1011
|
+
const operator = source.operatorMode === 'chip' ? (columnOperator ?? source.operator) : source.operator;
|
|
1012
|
+
switch (source.shape) {
|
|
1013
|
+
case 'multi': {
|
|
1014
|
+
const data = toArray(raw);
|
|
1015
|
+
return { operator, data, active: data.length > 0 };
|
|
1016
|
+
}
|
|
1017
|
+
case 'range': {
|
|
1018
|
+
const data = toRange(raw);
|
|
1019
|
+
return { operator, data, active: hasValue$1(data.from) || hasValue$1(data.to) };
|
|
1020
|
+
}
|
|
1021
|
+
case 'boolean':
|
|
1022
|
+
case 'flag': {
|
|
1023
|
+
const data = toBoolean(raw);
|
|
1024
|
+
return { operator, data, active: data !== null };
|
|
1025
|
+
}
|
|
1026
|
+
default: {
|
|
1027
|
+
const data = hasValue$1(raw) ? raw : null;
|
|
1028
|
+
return { operator, data, active: data !== null };
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
};
|
|
1032
|
+
/** Raw value a chip stores; no chip stores the empty value of the shape. */
|
|
1033
|
+
const rawOf = (source, chip) => {
|
|
1034
|
+
if (!chip)
|
|
1035
|
+
return source.shape === 'range' ? { from: null, to: null } : null;
|
|
1036
|
+
if (isNoData(chip.operator))
|
|
1037
|
+
return null;
|
|
1038
|
+
const data = chip.data;
|
|
1039
|
+
switch (source.shape) {
|
|
1040
|
+
case 'multi':
|
|
1041
|
+
return toArray(data);
|
|
1042
|
+
case 'range':
|
|
1043
|
+
// why: popover BETWEEN chỉ điền một đầu thì data thiếu hẳn khoá kia (`{ from }`); converter của daterange cần đủ
|
|
1044
|
+
// cả `from` lẫn `to`.
|
|
1045
|
+
return toRange(data);
|
|
1046
|
+
case 'boolean':
|
|
1047
|
+
return toBoolean(data);
|
|
1048
|
+
case 'flag': {
|
|
1049
|
+
const flag = toBoolean(data);
|
|
1050
|
+
return flag === null ? null : flag ? '1' : '0';
|
|
1051
|
+
}
|
|
1052
|
+
default:
|
|
1053
|
+
return hasValue$1(data) ? data : null;
|
|
1054
|
+
}
|
|
1055
|
+
};
|
|
1056
|
+
/** Column operator after the edit; `undefined` removes the key. */
|
|
1057
|
+
const operatorOf = (source, chip, current, ctx) => {
|
|
1058
|
+
const operator = chip?.operator;
|
|
1059
|
+
if (isNoData(operator))
|
|
1060
|
+
return operator;
|
|
1061
|
+
if (chip && source.operatorMode === 'chip')
|
|
1062
|
+
return operator;
|
|
1063
|
+
// why: không còn chip, hoặc toán tử của chip suy từ dạng giá trị (IN / BETWEEN): chỉ rời khỏi NULL / NOT_NULL mới
|
|
1064
|
+
// đổi columnOperator, về toán tử mặc định của cột.
|
|
1065
|
+
return isNoData(current) ? (ctx.defaultColumnOperator?.[source.field] ?? source.column?.filter?.operator?.default) : current;
|
|
1066
|
+
};
|
|
1067
|
+
/**
|
|
1068
|
+
* Raw record → bar query (handoff section 5). Chips: every pinned field, then unpinned fields that filter something,
|
|
1069
|
+
* in the order of `prev` and then declaration order. A chip whose operator and data equal the one in `prev` is that
|
|
1070
|
+
* same object — sd-query-bar tracks chips by identity.
|
|
1071
|
+
*/
|
|
1072
|
+
const tableFilterToQuery = (value, ctx, prev = []) => {
|
|
1073
|
+
const previous = new Map();
|
|
1074
|
+
const order = new Map();
|
|
1075
|
+
prev.forEach((filter, index) => {
|
|
1076
|
+
const key = filter.field;
|
|
1077
|
+
if (key === undefined || previous.has(key))
|
|
1078
|
+
return;
|
|
1079
|
+
previous.set(key, filter);
|
|
1080
|
+
order.set(key, index);
|
|
1081
|
+
});
|
|
1082
|
+
const pinned = [];
|
|
1083
|
+
const rest = [];
|
|
1084
|
+
for (const field of ctx.fields) {
|
|
1085
|
+
const key = field.key;
|
|
1086
|
+
const source = ctx.sources.get(key);
|
|
1087
|
+
if (!source)
|
|
1088
|
+
continue;
|
|
1089
|
+
const chip = chipOf(source, value);
|
|
1090
|
+
if (!field.pinned && !chip.active)
|
|
1091
|
+
continue;
|
|
1092
|
+
const before = previous.get(key);
|
|
1093
|
+
const next =
|
|
1094
|
+
// why: so theo dạng chuẩn — popover gửi khoảng một đầu là `{ from }`, raw dựng lại là `{ from, to: null }`; coi là một
|
|
1095
|
+
// chip để không dựng lại DOM (và mất focus) ngay sau khi menu trả focus về chip.
|
|
1096
|
+
before && before.operator === chip.operator && sameRaw(source.shape, before.data, chip.data)
|
|
1097
|
+
? before
|
|
1098
|
+
: { field: key, operator: chip.operator, data: chip.data };
|
|
1099
|
+
(field.pinned ? pinned : rest).push(next);
|
|
1100
|
+
}
|
|
1101
|
+
const rank = (filter) => order.get(filter.field) ?? Number.MAX_SAFE_INTEGER;
|
|
1102
|
+
// why: chip thêm giữ thứ tự người dùng thêm trong phiên (thứ tự trên thanh); chip mới đến từ raw xếp sau.
|
|
1103
|
+
const ordered = rest
|
|
1104
|
+
.map((filter, index) => ({ filter, index }))
|
|
1105
|
+
.sort((a, b) => rank(a.filter) - rank(b.filter) || a.index - b.index)
|
|
1106
|
+
.map(entry => entry.filter);
|
|
1107
|
+
return {
|
|
1108
|
+
filters: [...pinned, ...ordered],
|
|
1109
|
+
logic: 'AND',
|
|
1110
|
+
...(ctx.search ? { search: value.quickSearch?.term ?? '' } : {}),
|
|
1111
|
+
};
|
|
1112
|
+
};
|
|
1113
|
+
/** Keys of the bar fields whose applied value filters something — header icons show them as filtering. */
|
|
1114
|
+
const sdTableActiveQueryKeys = (value, ctx) => {
|
|
1115
|
+
const keys = new Set();
|
|
1116
|
+
for (const [key, source] of ctx.sources)
|
|
1117
|
+
if (chipOf(source, value).active)
|
|
1118
|
+
keys.add(key);
|
|
1119
|
+
return keys;
|
|
1120
|
+
};
|
|
1121
|
+
/**
|
|
1122
|
+
* Folds a change of the applied state into a bar that holds unapplied edits (manualFilter, or a chip edited while the
|
|
1123
|
+
* state changed). A key whose applied chip did not change between `before` and `after` keeps its draft — edited,
|
|
1124
|
+
* added or removed by the user. A key that changed takes the applied chip: the outside change wins for that field.
|
|
1125
|
+
* New applied chips go after the draft ones.
|
|
1126
|
+
*/
|
|
1127
|
+
const mergeQueryDraft = (draft, before, after) => {
|
|
1128
|
+
const keyOf = (filter) => filter.field;
|
|
1129
|
+
const was = new Map(before.map(filter => [keyOf(filter), filter]));
|
|
1130
|
+
const now = new Map(after.map(filter => [keyOf(filter), filter]));
|
|
1131
|
+
const unchanged = (key) => {
|
|
1132
|
+
const left = was.get(key);
|
|
1133
|
+
const right = now.get(key);
|
|
1134
|
+
if (!left || !right)
|
|
1135
|
+
return !left && !right;
|
|
1136
|
+
return (left.operator === right.operator && stringify(left.data) === stringify(right.data));
|
|
1137
|
+
};
|
|
1138
|
+
const result = [];
|
|
1139
|
+
const seen = new Set();
|
|
1140
|
+
for (const filter of draft) {
|
|
1141
|
+
const key = keyOf(filter);
|
|
1142
|
+
seen.add(key);
|
|
1143
|
+
if (unchanged(key))
|
|
1144
|
+
result.push(filter);
|
|
1145
|
+
else if (now.has(key))
|
|
1146
|
+
result.push(now.get(key));
|
|
1147
|
+
}
|
|
1148
|
+
for (const filter of after)
|
|
1149
|
+
if (!seen.has(keyOf(filter)) && !unchanged(keyOf(filter)))
|
|
1150
|
+
result.push(filter);
|
|
1151
|
+
return result;
|
|
1152
|
+
};
|
|
1153
|
+
/**
|
|
1154
|
+
* Bar query → raw record (handoff section 5). Every field of the bar is written: its chip, or the empty value when
|
|
1155
|
+
* it has none. Covered columns are cleared; excluded fields are left alone. A value equivalent to the stored one
|
|
1156
|
+
* (`[]` and `null`, `'1'` and `true`, …) keeps the stored representation, so a round trip changes nothing.
|
|
1157
|
+
*/
|
|
1158
|
+
const queryToTableFilter = (query, ctx, current) => {
|
|
1159
|
+
const chips = new Map();
|
|
1160
|
+
for (const filter of query.filters) {
|
|
1161
|
+
const key = filter.field;
|
|
1162
|
+
if (key !== undefined && !chips.has(key))
|
|
1163
|
+
chips.set(key, filter);
|
|
1164
|
+
}
|
|
1165
|
+
const quickFilters = { ...current.quickSearch?.filters };
|
|
1166
|
+
const externalFilter = { ...current.externalFilter };
|
|
1167
|
+
const columnFilter = { ...current.columnFilter };
|
|
1168
|
+
const columnOperator = { ...current.columnOperator };
|
|
1169
|
+
const changed = [];
|
|
1170
|
+
for (const [key, source] of ctx.sources) {
|
|
1171
|
+
const chip = chips.get(key);
|
|
1172
|
+
const store = source.source === 'quick' ? quickFilters : source.source === 'external' ? externalFilter : columnFilter;
|
|
1173
|
+
const before = store[source.field];
|
|
1174
|
+
const next = rawOf(source, chip);
|
|
1175
|
+
const valueChanged = !sameRaw(source.shape, before, next);
|
|
1176
|
+
if (valueChanged)
|
|
1177
|
+
store[source.field] = next;
|
|
1178
|
+
let operator;
|
|
1179
|
+
let operatorChanged = false;
|
|
1180
|
+
if (source.source === 'column' && source.operatorMode !== 'none') {
|
|
1181
|
+
const stored = current.columnOperator?.[source.field];
|
|
1182
|
+
operator = operatorOf(source, chip, stored, ctx);
|
|
1183
|
+
if (operator !== stored) {
|
|
1184
|
+
operatorChanged = true;
|
|
1185
|
+
if (operator === undefined)
|
|
1186
|
+
delete columnOperator[source.field];
|
|
1187
|
+
else
|
|
1188
|
+
columnOperator[source.field] = operator;
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
if (valueChanged || operatorChanged) {
|
|
1192
|
+
changed.push({ key, value: valueChanged ? next : before, valueChanged, ...(operatorChanged && operator ? { operator } : {}) });
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
// why: cột bị external cùng field che không có control nào trên thanh; xoá để không còn điều kiện ẩn từ cache cũ.
|
|
1196
|
+
for (const field of ctx.covered) {
|
|
1197
|
+
columnFilter[field] = null;
|
|
1198
|
+
// why: NULL / NOT_NULL lọc cả khi không có giá trị — trả operator về mặc định, nếu không điều kiện vẫn gửi đi.
|
|
1199
|
+
if (isNoData(columnOperator[field])) {
|
|
1200
|
+
const fallback = ctx.defaultColumnOperator?.[field];
|
|
1201
|
+
if (fallback && !isNoData(fallback))
|
|
1202
|
+
columnOperator[field] = fallback;
|
|
1203
|
+
else
|
|
1204
|
+
delete columnOperator[field];
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
const term = ctx.search ? (query.search ?? '').trim() : (current.quickSearch?.term ?? '');
|
|
1208
|
+
return {
|
|
1209
|
+
patch: {
|
|
1210
|
+
...(ctx.quickSearch
|
|
1211
|
+
? { quickSearch: { term, filters: quickFilters } }
|
|
1212
|
+
: {}),
|
|
1213
|
+
externalFilter,
|
|
1214
|
+
columnFilter,
|
|
1215
|
+
columnOperator,
|
|
1216
|
+
},
|
|
1217
|
+
changed,
|
|
1218
|
+
};
|
|
1219
|
+
};
|
|
1220
|
+
|
|
708
1221
|
class SdTableMobileActionsComponent {
|
|
709
1222
|
actions = input.required(/* @ts-ignore */
|
|
710
1223
|
...(ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []));
|
|
@@ -1503,7 +2016,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
1503
2016
|
], template: "@let _table = table();\n@let _option = option();\n@let _selectionMode = selectionMode();\n@let _autoId = _table.autoId();\n@let _commands = resolvedCommands();\n@let _actions = actions();\n@let _active = active();\n@let _expandTemplate = _table.sdSubInformation();\n@let _skeletonCards = skeletonCards();\n\n@if (_option.selector?.visible) {\n <span class=\"sd-mobile-sr-only\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">{{ selectionSummary() }}</span>\n}\n\n<div\n class=\"sd-mobile-list\"\n [class.sd-mobile-list--dim]=\"dimmed()\"\n [attr.role]=\"_skeletonCards.length ? null : 'list'\"\n cdkDropList\n [cdkDropListData]=\"dataRows() ?? rows()\"\n [cdkDropListDisabled]=\"!_option.rowReorder?.enabled\"\n [cdkDropListSortPredicate]=\"_table.reorderSortPredicate\"\n (cdkDropListDropped)=\"_table.onReorderDrop($event)\">\n <!-- why: khung x\u01B0\u01A1ng ch\u1EC9 c\u00F3 khi ch\u01B0a c\u00F3 th\u1EBB n\u00E0o, n\u1EB1m trong c\u00F9ng danh s\u00E1ch \u0111\u1EC3 gi\u1EEF gap/\u0111\u1EC7m; trang tr\u00ED n\u00EAn aria-hidden\n (v\u00F9ng .sd-table-live c\u1EE7a b\u1EA3ng b\u00E1o \"\u0111ang t\u1EA3i\"). -->\n @for (index of _skeletonCards; track index) {\n <div class=\"sd-mobile-skeleton-card\" aria-hidden=\"true\">\n <div class=\"sd-mobile-skeleton-body\">\n <span class=\"sd-mobile-skeleton-bar\"></span>\n <span class=\"sd-mobile-skeleton-bar\"></span>\n <span class=\"sd-mobile-skeleton-bar\"></span>\n </div>\n </div>\n }\n @for (card of cards(); track card.row.meta.id) {\n @let _row = card.row;\n @let _meta = _row.meta;\n @if (_table.aggregateRenderHost.rows.get(_row); as summary) {\n <div role=\"listitem\">\n <ng-container *ngTemplateOutlet=\"aggregateTemplate() ?? null; context: { summary: summary }\"></ng-container>\n </div>\n } @else if (_meta.group?.isGroupHeader) {\n <div class=\"sd-mobile-group\" role=\"listitem\">\n <ng-container *ngTemplateOutlet=\"groupTemplate(); context: { item: _row }\"></ng-container>\n </div>\n } @else {\n <article\n class=\"sd-mobile-card\"\n role=\"listitem\"\n tabindex=\"0\"\n [attr.aria-label]=\"card.label\"\n [attr.data-autoid]=\"card.context.autoId\"\n [class.selected]=\"_meta.selector?.isSelected\"\n [class.sd-mobile-card-commandable]=\"!_selectionMode && _commands.get(_row)?.length\"\n [class.sd-mobile-card-active]=\"_active?.row === _row\"\n [ngStyle]=\"_meta.rowStyle\"\n [style.margin-inline-start.px]=\"_option.tree ? (_meta.tree?.level ?? 0) * (_option.tree?.indentSize ?? 20) : 0\"\n (click)=\"onCardClick(card, $event)\"\n (keydown)=\"onCardKey(card, $event)\"\n (pointerdown)=\"pointerStart($event)\"\n (pointermove)=\"pointerMove($event)\"\n (pointercancel)=\"cancelPointer()\"\n cdkDrag\n [cdkDragData]=\"_row\"\n [cdkDragDisabled]=\"!_option.rowReorder?.enabled || card.reorderDisabled\"\n (cdkDragStarted)=\"dragStart()\">\n <div class=\"sd-mobile-card-controls d-flex align-items-center gap-8\">\n @if (_option.selector?.visible && _meta.selector?.visible) {\n @if (_option.selector?.single) {\n <mat-radio-button\n class=\"sd-mobile-card-selector\"\n [checked]=\"_meta.selector?.isSelected\"\n [disabled]=\"_meta.selector?.disabled\"\n [aria-label]=\"card.selectLabel\"\n (change)=\"select(card)\"></mat-radio-button>\n } @else {\n <mat-checkbox\n class=\"sd-mobile-card-selector\"\n [checked]=\"_meta.selector?.isSelected\"\n [disabled]=\"_meta.selector?.disabled\"\n [aria-label]=\"card.selectLabel\"\n (change)=\"select(card)\"></mat-checkbox>\n }\n }\n @if (_option.tree) {\n <span class=\"sd-mobile-sr-only\">{{ card.treeLabel }}</span>\n @if (_meta.tree?.hasChildren) {\n <button\n mat-icon-button\n type=\"button\"\n [disabled]=\"_meta.tree?.isExpanding\"\n [attr.aria-busy]=\"_meta.tree?.isExpanding ? 'true' : null\"\n [attr.aria-label]=\"card.expandLabel\"\n [attr.aria-expanded]=\"_meta.tree?.isExpanded\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-tree-toggle-' + _meta.id : null\"\n (click)=\"_table.onTreeToggle(_row)\">\n @if (_meta.tree?.isExpanding) {\n <span class=\"sd-table-spinner\" aria-hidden=\"true\"></span>\n } @else {\n <sd-icon [name]=\"_meta.tree?.isExpanded ? 'expand_more' : 'chevron_right'\"></sd-icon>\n }\n </button>\n }\n @if (_option.index?.enabled) {\n <span>{{ _meta.tree?.indexPath?.join('.') }}</span>\n }\n }\n @if (_option.rowReorder?.enabled) {\n <button\n mat-icon-button\n type=\"button\"\n cdkDragHandle\n [disabled]=\"card.reorderDisabled\"\n [attr.aria-label]=\"'core.component.table.mobile.reorder' | sdTranslate\">\n <sd-icon [name]=\"_option.rowReorder?.icon || 'drag_indicator'\"></sd-icon>\n </button>\n }\n <span class=\"flex-1\"></span>\n </div>\n <div class=\"sd-mobile-card-body\">\n <ng-container *ngTemplateOutlet=\"_table.sdRowMobileDef()!.templateRef; context: card.context\"></ng-container>\n </div>\n @if ((_expandTemplate && !_option.expand?.always) || (!_selectionMode && _commands.get(_row)?.length)) {\n <div class=\"sd-mobile-card-actions\">\n @if (_expandTemplate && !_option.expand?.always) {\n <button\n mat-button\n type=\"button\"\n [disabled]=\"card.expandDisabled || _meta.expand?.isExpanding\"\n [attr.aria-busy]=\"_meta.expand?.isExpanding ? 'true' : null\"\n [attr.aria-expanded]=\"_meta.expand?.isExpanded\"\n [attr.aria-label]=\"card.expandLabel\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-expand-' + _meta.id : null\"\n (click)=\"_table.onExpand(_row)\">\n @if (_meta.expand?.isExpanding) {\n <span class=\"sd-table-spinner\" aria-hidden=\"true\"></span>\n } @else {\n <sd-icon [name]=\"_meta.expand?.isExpanded ? 'expand_less' : 'expand_more'\"></sd-icon>\n }\n {{ 'core.component.table.mobile.details' | sdTranslate }}\n </button>\n }\n @if (!_selectionMode && _commands.get(_row)?.length) {\n <button\n mat-icon-button\n type=\"button\"\n class=\"sd-mobile-command-trigger\"\n aria-haspopup=\"dialog\"\n (click)=\"openCommand(card, $event)\"\n [attr.aria-label]=\"card.commandLabel\"\n [attr.aria-expanded]=\"_active?.row === _row\"\n [attr.data-autoid]=\"card.context.autoId ? card.context.autoId + '-commands' : null\">\n <sd-icon name=\"more_horiz\"></sd-icon>\n </button>\n }\n </div>\n }\n @if (_expandTemplate && (_option.expand?.always || _meta.expand?.isExpanded)) {\n <div class=\"sd-mobile-expand\">\n <ng-container *ngTemplateOutlet=\"_expandTemplate.templateRef; context: { item: _row }\"></ng-container>\n </div>\n }\n </article>\n }\n }\n</div>\n@if (containerOpen() && (_actions.length || _selectionMode)) {\n <sd-table-mobile-actions\n [class.sd-mobile-floating]=\"_selectionMode\"\n [actions]=\"_actions\"\n [title]=\"actionTitle()\"\n [selection]=\"_selectionMode\"\n [autoId]=\"_autoId\"\n [count]=\"selected().length\"\n (end)=\"endActions()\"></sd-table-mobile-actions>\n}\n", styles: [":host{display:block;min-width:0}.sd-mobile-list{display:flex;flex-direction:column;gap:24px;padding:20px 20px 8px;transition:opacity var(--sd-duration-fast, .12s)}@media(prefers-reduced-motion:reduce){.sd-mobile-list{transition:none}}.sd-mobile-list--dim{opacity:var(--sd-table-loading-dim, .55)}.sd-mobile-list--dim,.sd-mobile-list--dim *{pointer-events:none!important}.sd-mobile-card,.sd-mobile-skeleton-card{position:relative;border:1px solid var(--sd-border);border-radius:var(--sd-radius-8, 8px);background:var(--sd-surface);color:var(--sd-text);min-width:0;padding:8px 12px;overflow-wrap:anywhere}.sd-mobile-card.selected{border-color:var(--sd-primary);background:color-mix(in srgb,var(--sd-primary) 10%,var(--sd-surface))}.sd-mobile-card-active{border-color:var(--sd-primary)}.sd-mobile-card:focus-visible,button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-mobile-card-commandable{min-height:76px}.sd-mobile-card-selector{position:absolute;z-index:1;top:-20px;inset-inline-end:-20px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;--mdc-checkbox-state-layer-size: 40px;--mat-checkbox-state-layer-size: 40px;--mdc-radio-state-layer-size: 40px;--mat-radio-state-layer-size: 40px}.sd-mobile-card-selector:before{content:\"\";position:absolute;inset:8px;border:1px solid var(--sd-border);border-radius:50%;background:var(--sd-surface)}.sd-mobile-card-actions{display:flex;align-items:center;justify-content:space-between;gap:8px}.sd-mobile-command-trigger{flex:0 0 44px;margin-inline-start:auto;width:44px;height:44px}:host ::ng-deep .sd-mobile-card-selector .mdc-checkbox__background{width:14px;height:14px;top:13px;left:13px}:host ::ng-deep .sd-mobile-card-selector .mdc-radio__background{transform:scale(.7)}:host ::ng-deep .sd-mobile-card-selector .mat-mdc-checkbox-touch-target,:host ::ng-deep .sd-mobile-card-selector .mat-mdc-radio-touch-target{width:40px;height:40px}:host ::ng-deep .sd-mobile-card-selector .mdc-checkbox__ripple,:host ::ng-deep .sd-mobile-card-selector .mat-mdc-checkbox-ripple,:host ::ng-deep .sd-mobile-card-selector .mat-mdc-radio-ripple{width:24px;height:24px;inset:8px}.sd-mobile-card-body{padding:4px 0;min-width:0}@keyframes sd-table-spin{to{transform:rotate(360deg)}}.sd-table-spinner{display:inline-block;flex:0 0 auto;vertical-align:middle;box-sizing:border-box;width:16px;height:16px;border:2px solid var(--sd-table-progress-track);border-top-color:var(--sd-table-spinner);border-radius:50%;animation:sd-table-spin .8s linear infinite}@media(prefers-reduced-motion:reduce){.sd-table-spinner{animation:none}}@media(forced-colors:active){.sd-table-spinner{forced-color-adjust:none;border-color:GrayText;border-top-color:Highlight}}@keyframes sd-table-skeleton-sweep{to{background-position:480px 0}}.sd-mobile-skeleton-body{display:flex;flex-direction:column;gap:8px;padding:4px 0}.sd-mobile-skeleton-bar{display:block;height:12px;border-radius:var(--sd-radius-4, 4px);background:linear-gradient(90deg,var(--sd-table-skeleton-bg) 0,var(--sd-table-skeleton-highlight) 40%,var(--sd-table-skeleton-bg) 80%) 0 0/480px 100%;animation:sd-table-skeleton-sweep 1.4s linear infinite}@media(prefers-reduced-motion:reduce){.sd-mobile-skeleton-bar{animation:none}}@media(forced-colors:active){.sd-mobile-skeleton-bar{forced-color-adjust:none;background:GrayText}}.sd-mobile-skeleton-bar:nth-child(1){width:60%;height:14px}.sd-mobile-skeleton-bar:nth-child(2){width:85%}.sd-mobile-skeleton-bar:nth-child(3){width:40%}.sd-mobile-group{overflow-wrap:anywhere}.sd-mobile-expand{padding:12px 0;border-top:1px solid var(--sd-border)}.sd-mobile-floating{position:sticky;bottom:0;padding-bottom:var(--sd-table-mobile-bottom-offset, 0px);z-index:2}button{min-width:44px;min-height:44px;height:auto}[cdkDragHandle]{touch-action:none;cursor:grab}.sd-mobile-sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.cdk-drag-placeholder{opacity:.3}\n"] }]
|
|
1504
2017
|
}], ctorParameters: () => [], propDecorators: { table: [{ type: i0.Input, args: [{ isSignal: true, alias: "table", required: true }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: true }] }], dataRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataRows", required: false }] }], aggregateTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "aggregateTemplate", required: false }] }], groupTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupTemplate", required: true }] }] } });
|
|
1505
2018
|
|
|
1506
|
-
let nextId = 0;
|
|
2019
|
+
let nextId$1 = 0;
|
|
1507
2020
|
/**
|
|
1508
2021
|
* @internal Paginator of `<sd-table>` for `paginate.total: 'unknown'`.
|
|
1509
2022
|
*
|
|
@@ -1524,7 +2037,7 @@ class SdTableUnknownTotalPaginator {
|
|
|
1524
2037
|
...(ngDevMode ? [undefined, { debugName: "autoId" }] : /* istanbul ignore next */ []));
|
|
1525
2038
|
page = output();
|
|
1526
2039
|
intl = inject(MatPaginatorIntl);
|
|
1527
|
-
pageSizeLabelId = `sd-table-unknown-total-page-size-${nextId++}`;
|
|
2040
|
+
pageSizeLabelId = `sd-table-unknown-total-page-size-${nextId$1++}`;
|
|
1528
2041
|
displayedPageSizeOptions = computed(() => {
|
|
1529
2042
|
const options = new Set((this.pageSizeOptions() ?? []).filter(size => size > 0));
|
|
1530
2043
|
options.add(this.state().pageSize);
|
|
@@ -1604,31 +2117,6 @@ function samePagePosition(a, b) {
|
|
|
1604
2117
|
return !!a && !!b && a.pageIndex === b.pageIndex && a.pageSize === b.pageSize;
|
|
1605
2118
|
}
|
|
1606
2119
|
|
|
1607
|
-
/** Kiểu cột mà column-filter render control mặc định (nhận chip operator — thiết kế đợt 2 · G). */
|
|
1608
|
-
const CONTROL_FILTER_TYPES = new Set([
|
|
1609
|
-
'string',
|
|
1610
|
-
'number',
|
|
1611
|
-
'boolean',
|
|
1612
|
-
'values',
|
|
1613
|
-
'lazy-values',
|
|
1614
|
-
'date',
|
|
1615
|
-
'datetime',
|
|
1616
|
-
'time',
|
|
1617
|
-
]);
|
|
1618
|
-
/**
|
|
1619
|
-
* Cột lọc bằng control mặc định: không có template `filterDef`, không phải `split-number` / `split-date` (hai ô).
|
|
1620
|
-
* Chỉ ở đây operator nằm trong control và control khoá ô khi chọn `NULL` / `NOT_NULL`.
|
|
1621
|
-
*/
|
|
1622
|
-
const isDefaultControlFilter = (column) => {
|
|
1623
|
-
const filter = column.filter;
|
|
1624
|
-
return CONTROL_FILTER_TYPES.has(column.type) && !filter?.filterDef && filter?.type !== 'split-number' && filter?.type !== 'split-date';
|
|
1625
|
-
};
|
|
1626
|
-
/**
|
|
1627
|
-
* `NULL` / `NOT_NULL` trên control mặc định: ô bị khoá và để trống, nên filter có hiệu lực mà không cần giá trị.
|
|
1628
|
-
* Template custom và filter split giữ cách cũ (chỉ lọc khi có giá trị).
|
|
1629
|
-
*/
|
|
1630
|
-
const isNoDataColumnOperator = (column, operator) => (operator === 'NULL' || operator === 'NOT_NULL') && isDefaultControlFilter(column);
|
|
1631
|
-
|
|
1632
2120
|
/**
|
|
1633
2121
|
* Machine-zone date math, exactly the payload sent before time zones: the local bounds of
|
|
1634
2122
|
* `SdDateTimeService`, and a datetime still read by `new Date(value)`.
|
|
@@ -1785,8 +2273,8 @@ const SdConvertToPagingReq = (filterRequest, args) => {
|
|
|
1785
2273
|
}
|
|
1786
2274
|
}
|
|
1787
2275
|
}
|
|
1788
|
-
// Xử lý column filter
|
|
1789
|
-
for (const column of columns
|
|
2276
|
+
// Xử lý column filter — cột lá: cột con của header nhóm có filter riêng, header nhóm thì không.
|
|
2277
|
+
for (const column of leafColumns(columns)) {
|
|
1790
2278
|
const value = rawColumnFilter?.[column.field];
|
|
1791
2279
|
const field = fieldMapping?.[column.field] || column.field;
|
|
1792
2280
|
const operator = columnOperator?.[column.field] || column.filter?.operator?.default;
|
|
@@ -2433,6 +2921,18 @@ class ColumnFilterComponent {
|
|
|
2433
2921
|
this.#emitFilterOnChange();
|
|
2434
2922
|
this.filterChange.emit();
|
|
2435
2923
|
};
|
|
2924
|
+
/**
|
|
2925
|
+
* Ghi một đầu của filter tách đôi (split-number / split-date) vào columnFilter dùng chung. Ghi tại chỗ vào object
|
|
2926
|
+
* { from, to } đang có; nếu bảng đã đặt lại columnFilter (xoá lọc, setFilter) làm mất object đó thì tạo lại.
|
|
2927
|
+
*/
|
|
2928
|
+
setRangeEnd(field, end, value) {
|
|
2929
|
+
const filter = this.columnFilter();
|
|
2930
|
+
const range = filter[field];
|
|
2931
|
+
if (range && typeof range === 'object')
|
|
2932
|
+
range[end] = value;
|
|
2933
|
+
else
|
|
2934
|
+
filter[field] = { from: null, to: null, [end]: value };
|
|
2935
|
+
}
|
|
2436
2936
|
// Blur input: commit giá trị KHÔNG trigger reload.
|
|
2437
2937
|
onFilterCommit = () => {
|
|
2438
2938
|
this.#emitFilterOnChange();
|
|
@@ -2452,11 +2952,11 @@ class ColumnFilterComponent {
|
|
|
2452
2952
|
};
|
|
2453
2953
|
#filterValueHash = (value) => Utilities.hash({ value });
|
|
2454
2954
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: ColumnFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2455
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: ColumnFilterComponent, isStandalone: true, selector: "column-filter", inputs: { autoIdInput: { classPropertyName: "autoIdInput", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: true, transformFunction: null }, columnFilter: { classPropertyName: "columnFilter", publicName: "columnFilter", isSignal: true, isRequired: false, transformFunction: null }, cacheValues: { classPropertyName: "cacheValues", publicName: "cacheValues", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, operator: { classPropertyName: "operator", publicName: "operator", isSignal: true, isRequired: false, transformFunction: null }, isMobile: { classPropertyName: "isMobile", publicName: "isMobile", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { operator: "operatorChange", filterChange: "filterChange", filterCommit: "filterCommit" }, ngImport: i0, template: "@let _column = column();\n@let _columnFilter = columnFilter();\n@let _autoId = autoId();\n@let _templateRef = templateRef();\n@let _operators = operators();\n@let _controlOperators = controlOperators();\n@let _items = items();\n@let _label = label();\n@let _context = { columnFilter: _columnFilter, autoId: _autoId };\n\n<div class=\"d-flex c-inline-column align-items-center\" style=\"width: 100%; max-width: 100%\">\n @if (\n _column.type === 'string' ||\n _column.type === 'number' ||\n _column.type === 'boolean' ||\n _column.type === 'values' ||\n _column.type === 'lazy-values' ||\n _column.type === 'date' ||\n _column.type === 'datetime' ||\n _column.type === 'time'\n ) {\n <!-- Operator: chip trong control m\u1EB7c \u0111\u1ECBnh (thi\u1EBFt k\u1EBF \u0111\u1EE3t 2 \u00B7 G). Template custom (filterDef) v\u00E0 filter split\n (hai control) kh\u00F4ng ch\u00E8n chip \u0111\u01B0\u1EE3c n\u00EAn gi\u1EEF sd-operator r\u1EDDi nh\u01B0 c\u0169. -->\n @if (_operators.length && !operatorInControl()) {\n <!-- Chip 24px nh\u01B0 chip trong control; tint primary khi c\u1ED9t \u0111ang c\u00F3 gi\u00E1 tr\u1ECB. Ch\u01B0a c\u00F3 operator: ph\u1EC5u x\u00E1m, kh\u00F4ng g\u00E1n\n m\u1EB7c \u0111\u1ECBnh (handoff sd-operator B5, ph\u01B0\u01A1ng \u00E1n b). -->\n <sd-operator class=\"mr-4\" size=\"sm\" [active]=\"hasFilterValue()\" [(model)]=\"operator\" [operators]=\"operatorValues()\" />\n }\n\n <!-- N\u1EBFu filter nh\u1EADn v\u00E0o template -->\n @if (_templateRef) {\n <ng-container *ngTemplateOutlet=\"_templateRef; context: _context\"></ng-container>\n }\n <!-- M\u1EB7c \u0111\u1ECBnh theo type v\u00E0 gi\u00E1 tr\u1ECB values defined c\u1EE7a column -->\n @else {\n @if (_column.type === 'string') {\n <sd-input\n [autoId]=\"_autoId\"\n style=\"flex: 1 1 0%; min-width: 0\"\n size=\"sm\"\n type=\"text\"\n [label]=\"_label\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (keyupEnter)=\"onFilterChange()\"\n (sdBlur)=\"onFilterCommit()\"\n (cleared)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n clearable\n hideInlineError>\n </sd-input>\n } @else if (_column.type === 'number') {\n @if (!_column.filter?.type) {\n <sd-input-number\n [autoId]=\"_autoId\"\n style=\"flex: 1 1 0%; min-width: 0\"\n size=\"sm\"\n [label]=\"_label\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (keyupEnter)=\"onFilterChange()\"\n (sdBlur)=\"onFilterCommit()\"\n (cleared)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n clearable\n hideInlineError>\n </sd-input-number>\n } @else if (_column.filter?.type === 'split-number') {\n <ng-container *ngTemplateOutlet=\"splitNumberTpl; context: { field: _column.field, disabled: _column.filter?.disabled }\">\n </ng-container>\n }\n } @else if (_column.type === 'boolean') {\n <sd-select\n minWidthPanel=\"200px\"\n [autoId]=\"_autoId\"\n style=\"flex: 1 1 0%; min-width: 0\"\n [style.width]=\"'100%'\"\n size=\"sm\"\n [label]=\"_label\"\n [items]=\"[\n { value: '1', display: _column.option?.displayOnTrue || 'True' },\n { value: '0', display: _column.option?.displayOnFalse || 'False' },\n ]\"\n valueField=\"value\"\n displayField=\"display\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n hideInlineError>\n <ng-template sdItemDef let-item=\"item\">\n @if (item.value === '1') {\n <sd-badge color=\"success\" [title]=\"_column.option?.displayOnTrue || 'True'\"> </sd-badge>\n } @else {\n <sd-badge color=\"error\" [title]=\"_column.option?.displayOnFalse || 'False'\"> </sd-badge>\n }\n </ng-template>\n </sd-select>\n } @else if (_column.type === 'values') {\n <sd-select\n minWidthPanel=\"200px\"\n [autoId]=\"_autoId\"\n style=\"flex: 1 1 0%; min-width: 0\"\n [style.width]=\"'100%'\"\n size=\"sm\"\n [label]=\"_label\"\n [items]=\"_items\"\n [valueField]=\"_column.option.valueField\"\n [displayField]=\"_column.option.displayField\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n [multiple]=\"_column.option.selection === 'MULTIPLE'\"\n hideInlineError>\n </sd-select>\n } @else if (_column.type === 'lazy-values') {\n <sd-select\n minWidthPanel=\"200px\"\n [autoId]=\"_autoId\"\n style=\"flex: 1 1 0%; min-width: 0\"\n [style.width]=\"'100%'\"\n size=\"sm\"\n [label]=\"_label\"\n [items]=\"_items\"\n [valueField]=\"_column.option.valueField\"\n [displayField]=\"_column.option.displayField\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n [multiple]=\"_column.option.selection === 'MULTIPLE'\"\n hideInlineError>\n </sd-select>\n } @else if (_column.type === 'date' || _column.type === 'datetime' || _column.type === 'time') {\n @if (!_column.filter?.type || _column.filter?.type === 'daterange') {\n <sd-date-range\n style=\"flex: 1 1 0%; min-width: 0\"\n size=\"sm\"\n [label]=\"_label\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n hideInlineError>\n </sd-date-range>\n } @else if (_column.filter?.type === 'date') {\n <sd-date\n [autoId]=\"_autoId\"\n style=\"flex: 1 1 0%; min-width: 0\"\n type=\"date\"\n size=\"sm\"\n [label]=\"_label\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n clearable\n hideInlineError>\n </sd-date>\n } @else if (_column.filter?.type === 'split-date') {\n <ng-container *ngTemplateOutlet=\"splitDateTpl; context: { field: _column.field, disabled: _column.filter?.disabled }\">\n </ng-container>\n }\n }\n }\n } @else {\n <sd-input [autoId]=\"_autoId\" style=\"flex: 1 1 0%; min-width: 0\" type=\"text\" size=\"sm\" disabled></sd-input>\n }\n</div>\n\n<!-- ================================================ -->\n<!-- Split from/to templates (\u0111\u01B0a xu\u1ED1ng cu\u1ED1i file) -->\n<!-- ================================================ -->\n<ng-template #splitNumberTpl let-field=\"field\" let-disabled=\"disabled\">\n <div class=\"d-flex align-items-center\" style=\"flex: 1 1 0%; min-width: 0\">\n <sd-input-number\n [autoId]=\"_autoId + '-from'\"\n style=\"flex: 1 1 0%; min-width: 0\"\n size=\"sm\"\n [label]=\"_label\"\n [(model)]=\"_columnFilter[field].from\"\n (sdChange)=\"onFilterChange()\"\n (sdBlur)=\"onFilterCommit()\"\n (cleared)=\"onFilterChange()\"\n [disabled]=\"disabled\"\n clearable\n hideInlineError>\n </sd-input-number>\n <div class=\"mx-4\">-</div>\n <sd-input-number\n [autoId]=\"_autoId + '-to'\"\n style=\"flex: 1 1 0%; min-width: 0\"\n size=\"sm\"\n [(model)]=\"_columnFilter[field].to\"\n (sdChange)=\"onFilterChange()\"\n (sdBlur)=\"onFilterCommit()\"\n (cleared)=\"onFilterChange()\"\n [disabled]=\"disabled\"\n clearable\n hideInlineError>\n </sd-input-number>\n </div>\n</ng-template>\n\n<ng-template #splitDateTpl let-field=\"field\" let-disabled=\"disabled\">\n <div class=\"d-flex align-items-center\" style=\"flex: 1 1 0%; min-width: 0\">\n <sd-date\n [autoId]=\"_autoId + '-from'\"\n style=\"flex: 1 1 0%; min-width: 0\"\n type=\"date\"\n size=\"sm\"\n [label]=\"_label\"\n [(model)]=\"_columnFilter[field].from\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"disabled\"\n clearable\n hideInlineError>\n </sd-date>\n <div class=\"mx-4\">-</div>\n <sd-date\n [autoId]=\"_autoId + '-to'\"\n style=\"flex: 1 1 0%; min-width: 0\"\n type=\"date\"\n size=\"sm\"\n [(model)]=\"_columnFilter[field].to\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"disabled\"\n clearable\n hideInlineError>\n </sd-date>\n </div>\n</ng-template>\n", styles: [":host ::ng-deep .c-inline-column{--sd-control-label-bg: var(--sd-table-bg, #ffffff)}:host ::ng-deep .c-inline-column .mat-mdc-text-field-wrapper{background-color:var(--sd-table-bg, #ffffff)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SdOperator, selector: "sd-operator", inputs: ["model", "operators", "disabled", "autoId", "size", "readonly", "active", "showCode"], outputs: ["modelChange"] }, { kind: "component", type: SdInput, selector: "sd-input", inputs: ["autoId", "name", "appearance", "floatLabel", "labelPlacement", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "type", "mask", "inputmode", "autocomplete", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "minlength", "maxlength", "pattern", "patternErrorMessage", "validator", "inlineError", "hyperlink", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }, { kind: "component", type: SdInputNumber, selector: "sd-input-number", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "type", "precision", "format", "min", "max", "validator", "inlineError", "hyperlink", "appearance", "floatLabel", "labelPlacement", "inputmode", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }, { kind: "component", type: SdSelect, selector: "sd-select", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "valueField", "displayField", "disabledField", "cacheChecksum", "limit", "virtualScroll", "itemSize", "hyperlink", "minWidthPanel", "hideInlineError", "hideReadError", "required", "disabled", "viewed", "multiple", "showSelectAll", "clearable", "validator", "inlineError", "appearance", "floatLabel", "labelPlacement", "items", "model"], outputs: ["operatorChange", "sdReadStateChange", "modelChange", "sdChange", "sdSelection"] }, { kind: "component", type: SdDate, selector: "sd-date", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "hideInlineError", "required", "disabled", "viewed", "clearable", "inlineError", "hyperlink", "appearance", "floatLabel", "labelPlacement", "min", "minDate", "max", "maxDate", "transform", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus"] }, { kind: "component", type: SdDateRange, selector: "sd-date-range", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "hideInlineError", "required", "disabled", "viewed", "clearable", "appearance", "floatLabel", "min", "max", "transform", "model"], outputs: ["operatorChange", "modelChange", "sdChange"] }, { kind: "component", type: SdBadge, selector: "sd-badge", inputs: ["type", "color", "primary", "secondary", "success", "info", "warning", "error", "fontSet", "title", "label", "description", "tooltip", "icon", "size", "pulse"], outputs: ["click"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2955
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: ColumnFilterComponent, isStandalone: true, selector: "column-filter", inputs: { autoIdInput: { classPropertyName: "autoIdInput", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: true, transformFunction: null }, columnFilter: { classPropertyName: "columnFilter", publicName: "columnFilter", isSignal: true, isRequired: false, transformFunction: null }, cacheValues: { classPropertyName: "cacheValues", publicName: "cacheValues", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, operator: { classPropertyName: "operator", publicName: "operator", isSignal: true, isRequired: false, transformFunction: null }, isMobile: { classPropertyName: "isMobile", publicName: "isMobile", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { operator: "operatorChange", filterChange: "filterChange", filterCommit: "filterCommit" }, ngImport: i0, template: "@let _column = column();\n@let _columnFilter = columnFilter();\n@let _autoId = autoId();\n@let _templateRef = templateRef();\n@let _operators = operators();\n@let _controlOperators = controlOperators();\n@let _items = items();\n@let _label = label();\n@let _context = { columnFilter: _columnFilter, autoId: _autoId };\n\n<div class=\"d-flex c-inline-column align-items-center\" style=\"width: 100%; max-width: 100%\">\n @if (\n _column.type === 'string' ||\n _column.type === 'number' ||\n _column.type === 'boolean' ||\n _column.type === 'values' ||\n _column.type === 'lazy-values' ||\n _column.type === 'date' ||\n _column.type === 'datetime' ||\n _column.type === 'time'\n ) {\n <!-- Operator: chip trong control m\u1EB7c \u0111\u1ECBnh (thi\u1EBFt k\u1EBF \u0111\u1EE3t 2 \u00B7 G). Template custom (filterDef) v\u00E0 filter split\n (hai control) kh\u00F4ng ch\u00E8n chip \u0111\u01B0\u1EE3c n\u00EAn gi\u1EEF sd-operator r\u1EDDi nh\u01B0 c\u0169. -->\n @if (_operators.length && !operatorInControl()) {\n <!-- Chip 24px nh\u01B0 chip trong control; tint primary khi c\u1ED9t \u0111ang c\u00F3 gi\u00E1 tr\u1ECB. Ch\u01B0a c\u00F3 operator: ph\u1EC5u x\u00E1m, kh\u00F4ng g\u00E1n\n m\u1EB7c \u0111\u1ECBnh (handoff sd-operator B5, ph\u01B0\u01A1ng \u00E1n b). -->\n <sd-operator class=\"mr-4\" size=\"sm\" [active]=\"hasFilterValue()\" [(model)]=\"operator\" [operators]=\"operatorValues()\" />\n }\n\n <!-- N\u1EBFu filter nh\u1EADn v\u00E0o template -->\n @if (_templateRef) {\n <ng-container *ngTemplateOutlet=\"_templateRef; context: _context\"></ng-container>\n }\n <!-- M\u1EB7c \u0111\u1ECBnh theo type v\u00E0 gi\u00E1 tr\u1ECB values defined c\u1EE7a column -->\n @else {\n @if (_column.type === 'string') {\n <sd-input\n [autoId]=\"_autoId\"\n style=\"flex: 1 1 0%; min-width: 0\"\n size=\"sm\"\n type=\"text\"\n [label]=\"_label\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (keyupEnter)=\"onFilterChange()\"\n (sdBlur)=\"onFilterCommit()\"\n (cleared)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n clearable\n hideInlineError>\n </sd-input>\n } @else if (_column.type === 'number') {\n @if (!_column.filter?.type) {\n <sd-input-number\n [autoId]=\"_autoId\"\n style=\"flex: 1 1 0%; min-width: 0\"\n size=\"sm\"\n [label]=\"_label\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (keyupEnter)=\"onFilterChange()\"\n (sdBlur)=\"onFilterCommit()\"\n (cleared)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n clearable\n hideInlineError>\n </sd-input-number>\n } @else if (_column.filter?.type === 'split-number') {\n <ng-container *ngTemplateOutlet=\"splitNumberTpl; context: { field: _column.field, disabled: _column.filter?.disabled }\">\n </ng-container>\n }\n } @else if (_column.type === 'boolean') {\n <sd-select\n minWidthPanel=\"200px\"\n [autoId]=\"_autoId\"\n style=\"flex: 1 1 0%; min-width: 0\"\n [style.width]=\"'100%'\"\n size=\"sm\"\n [label]=\"_label\"\n [items]=\"[\n { value: '1', display: _column.option?.displayOnTrue || 'True' },\n { value: '0', display: _column.option?.displayOnFalse || 'False' },\n ]\"\n valueField=\"value\"\n displayField=\"display\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n hideInlineError>\n <ng-template sdItemDef let-item=\"item\">\n @if (item.value === '1') {\n <sd-badge color=\"success\" [title]=\"_column.option?.displayOnTrue || 'True'\"> </sd-badge>\n } @else {\n <sd-badge color=\"error\" [title]=\"_column.option?.displayOnFalse || 'False'\"> </sd-badge>\n }\n </ng-template>\n </sd-select>\n } @else if (_column.type === 'values') {\n <sd-select\n minWidthPanel=\"200px\"\n [autoId]=\"_autoId\"\n style=\"flex: 1 1 0%; min-width: 0\"\n [style.width]=\"'100%'\"\n size=\"sm\"\n [label]=\"_label\"\n [items]=\"_items\"\n [valueField]=\"_column.option.valueField\"\n [displayField]=\"_column.option.displayField\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n [multiple]=\"_column.option.selection === 'MULTIPLE'\"\n hideInlineError>\n </sd-select>\n } @else if (_column.type === 'lazy-values') {\n <sd-select\n minWidthPanel=\"200px\"\n [autoId]=\"_autoId\"\n style=\"flex: 1 1 0%; min-width: 0\"\n [style.width]=\"'100%'\"\n size=\"sm\"\n [label]=\"_label\"\n [items]=\"_items\"\n [valueField]=\"_column.option.valueField\"\n [displayField]=\"_column.option.displayField\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n [multiple]=\"_column.option.selection === 'MULTIPLE'\"\n hideInlineError>\n </sd-select>\n } @else if (_column.type === 'date' || _column.type === 'datetime' || _column.type === 'time') {\n @if (!_column.filter?.type || _column.filter?.type === 'daterange') {\n <sd-date-range\n style=\"flex: 1 1 0%; min-width: 0\"\n size=\"sm\"\n [label]=\"_label\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n hideInlineError>\n </sd-date-range>\n } @else if (_column.filter?.type === 'date') {\n <sd-date\n [autoId]=\"_autoId\"\n style=\"flex: 1 1 0%; min-width: 0\"\n type=\"date\"\n size=\"sm\"\n [label]=\"_label\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n clearable\n hideInlineError>\n </sd-date>\n } @else if (_column.filter?.type === 'split-date') {\n <ng-container *ngTemplateOutlet=\"splitDateTpl; context: { field: _column.field, disabled: _column.filter?.disabled }\">\n </ng-container>\n }\n }\n }\n } @else {\n <sd-input [autoId]=\"_autoId\" style=\"flex: 1 1 0%; min-width: 0\" type=\"text\" size=\"sm\" disabled></sd-input>\n }\n</div>\n\n<!-- ================================================ -->\n<!-- Split from/to templates (\u0111\u01B0a xu\u1ED1ng cu\u1ED1i file) -->\n<!-- ================================================ -->\n<!-- why: `[model]` \u0111\u1ECDc `?.` v\u00E0 `(modelChange)` qua setRangeEnd \u2014 b\u1EA3ng c\u00F3 th\u1EC3 \u0111\u1EB7t l\u1EA1i columnFilter t\u1EA1i ch\u1ED7 (xo\u00E1 l\u1ECDc,\n setFilter) l\u00E0m m\u1EA5t object { from, to }; `[(model)]=\"\u2026[field].from\"` khi \u0111\u00F3 \u0111\u1ECDc / ghi v\u00E0o undefined v\u00E0 n\u00E9m l\u1ED7i. -->\n<ng-template #splitNumberTpl let-field=\"field\" let-disabled=\"disabled\">\n <div class=\"d-flex align-items-center\" style=\"flex: 1 1 0%; min-width: 0\">\n <sd-input-number\n [autoId]=\"_autoId + '-from'\"\n style=\"flex: 1 1 0%; min-width: 0\"\n size=\"sm\"\n [label]=\"_label\"\n [model]=\"_columnFilter[field]?.from\"\n (modelChange)=\"setRangeEnd(field, 'from', $event)\"\n (sdChange)=\"onFilterChange()\"\n (sdBlur)=\"onFilterCommit()\"\n (cleared)=\"onFilterChange()\"\n [disabled]=\"disabled\"\n clearable\n hideInlineError>\n </sd-input-number>\n <div class=\"mx-4\">-</div>\n <sd-input-number\n [autoId]=\"_autoId + '-to'\"\n style=\"flex: 1 1 0%; min-width: 0\"\n size=\"sm\"\n [model]=\"_columnFilter[field]?.to\"\n (modelChange)=\"setRangeEnd(field, 'to', $event)\"\n (sdChange)=\"onFilterChange()\"\n (sdBlur)=\"onFilterCommit()\"\n (cleared)=\"onFilterChange()\"\n [disabled]=\"disabled\"\n clearable\n hideInlineError>\n </sd-input-number>\n </div>\n</ng-template>\n\n<ng-template #splitDateTpl let-field=\"field\" let-disabled=\"disabled\">\n <div class=\"d-flex align-items-center\" style=\"flex: 1 1 0%; min-width: 0\">\n <sd-date\n [autoId]=\"_autoId + '-from'\"\n style=\"flex: 1 1 0%; min-width: 0\"\n type=\"date\"\n size=\"sm\"\n [label]=\"_label\"\n [model]=\"_columnFilter[field]?.from\"\n (modelChange)=\"setRangeEnd(field, 'from', $event)\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"disabled\"\n clearable\n hideInlineError>\n </sd-date>\n <div class=\"mx-4\">-</div>\n <sd-date\n [autoId]=\"_autoId + '-to'\"\n style=\"flex: 1 1 0%; min-width: 0\"\n type=\"date\"\n size=\"sm\"\n [model]=\"_columnFilter[field]?.to\"\n (modelChange)=\"setRangeEnd(field, 'to', $event)\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"disabled\"\n clearable\n hideInlineError>\n </sd-date>\n </div>\n</ng-template>\n", styles: [":host ::ng-deep .c-inline-column{--sd-control-label-bg: var(--sd-table-bg, #ffffff)}:host ::ng-deep .c-inline-column .mat-mdc-text-field-wrapper{background-color:var(--sd-table-bg, #ffffff)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SdOperator, selector: "sd-operator", inputs: ["model", "operators", "disabled", "autoId", "size", "readonly", "active", "showCode"], outputs: ["modelChange"] }, { kind: "component", type: SdInput, selector: "sd-input", inputs: ["autoId", "name", "appearance", "floatLabel", "labelPlacement", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "type", "mask", "inputmode", "autocomplete", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "minlength", "maxlength", "pattern", "patternErrorMessage", "validator", "inlineError", "hyperlink", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }, { kind: "component", type: SdInputNumber, selector: "sd-input-number", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "type", "precision", "format", "min", "max", "validator", "inlineError", "hyperlink", "appearance", "floatLabel", "labelPlacement", "inputmode", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }, { kind: "component", type: SdSelect, selector: "sd-select", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "valueField", "displayField", "disabledField", "cacheChecksum", "limit", "virtualScroll", "itemSize", "hyperlink", "minWidthPanel", "hideInlineError", "hideReadError", "required", "disabled", "viewed", "multiple", "showSelectAll", "clearable", "validator", "inlineError", "appearance", "floatLabel", "labelPlacement", "items", "model"], outputs: ["operatorChange", "sdReadStateChange", "modelChange", "sdChange", "sdSelection"] }, { kind: "component", type: SdDate, selector: "sd-date", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "hideInlineError", "required", "disabled", "viewed", "clearable", "inlineError", "hyperlink", "appearance", "floatLabel", "labelPlacement", "min", "minDate", "max", "maxDate", "transform", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus"] }, { kind: "component", type: SdDateRange, selector: "sd-date-range", inputs: ["autoId", "name", "size", "operators", "operator", "form", "label", "helperText", "hideInlineError", "required", "disabled", "viewed", "clearable", "appearance", "floatLabel", "min", "max", "transform", "model"], outputs: ["operatorChange", "modelChange", "sdChange"] }, { kind: "component", type: SdBadge, selector: "sd-badge", inputs: ["type", "color", "primary", "secondary", "success", "info", "warning", "error", "fontSet", "title", "label", "description", "tooltip", "icon", "size", "pulse"], outputs: ["click"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2456
2956
|
}
|
|
2457
2957
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: ColumnFilterComponent, decorators: [{
|
|
2458
2958
|
type: Component,
|
|
2459
|
-
args: [{ selector: 'column-filter', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [CommonModule, SdOperator, SdInput, SdInputNumber, SdSelect, SdDate, SdDateRange, SdBadge], template: "@let _column = column();\n@let _columnFilter = columnFilter();\n@let _autoId = autoId();\n@let _templateRef = templateRef();\n@let _operators = operators();\n@let _controlOperators = controlOperators();\n@let _items = items();\n@let _label = label();\n@let _context = { columnFilter: _columnFilter, autoId: _autoId };\n\n<div class=\"d-flex c-inline-column align-items-center\" style=\"width: 100%; max-width: 100%\">\n @if (\n _column.type === 'string' ||\n _column.type === 'number' ||\n _column.type === 'boolean' ||\n _column.type === 'values' ||\n _column.type === 'lazy-values' ||\n _column.type === 'date' ||\n _column.type === 'datetime' ||\n _column.type === 'time'\n ) {\n <!-- Operator: chip trong control m\u1EB7c \u0111\u1ECBnh (thi\u1EBFt k\u1EBF \u0111\u1EE3t 2 \u00B7 G). Template custom (filterDef) v\u00E0 filter split\n (hai control) kh\u00F4ng ch\u00E8n chip \u0111\u01B0\u1EE3c n\u00EAn gi\u1EEF sd-operator r\u1EDDi nh\u01B0 c\u0169. -->\n @if (_operators.length && !operatorInControl()) {\n <!-- Chip 24px nh\u01B0 chip trong control; tint primary khi c\u1ED9t \u0111ang c\u00F3 gi\u00E1 tr\u1ECB. Ch\u01B0a c\u00F3 operator: ph\u1EC5u x\u00E1m, kh\u00F4ng g\u00E1n\n m\u1EB7c \u0111\u1ECBnh (handoff sd-operator B5, ph\u01B0\u01A1ng \u00E1n b). -->\n <sd-operator class=\"mr-4\" size=\"sm\" [active]=\"hasFilterValue()\" [(model)]=\"operator\" [operators]=\"operatorValues()\" />\n }\n\n <!-- N\u1EBFu filter nh\u1EADn v\u00E0o template -->\n @if (_templateRef) {\n <ng-container *ngTemplateOutlet=\"_templateRef; context: _context\"></ng-container>\n }\n <!-- M\u1EB7c \u0111\u1ECBnh theo type v\u00E0 gi\u00E1 tr\u1ECB values defined c\u1EE7a column -->\n @else {\n @if (_column.type === 'string') {\n <sd-input\n [autoId]=\"_autoId\"\n style=\"flex: 1 1 0%; min-width: 0\"\n size=\"sm\"\n type=\"text\"\n [label]=\"_label\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (keyupEnter)=\"onFilterChange()\"\n (sdBlur)=\"onFilterCommit()\"\n (cleared)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n clearable\n hideInlineError>\n </sd-input>\n } @else if (_column.type === 'number') {\n @if (!_column.filter?.type) {\n <sd-input-number\n [autoId]=\"_autoId\"\n style=\"flex: 1 1 0%; min-width: 0\"\n size=\"sm\"\n [label]=\"_label\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (keyupEnter)=\"onFilterChange()\"\n (sdBlur)=\"onFilterCommit()\"\n (cleared)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n clearable\n hideInlineError>\n </sd-input-number>\n } @else if (_column.filter?.type === 'split-number') {\n <ng-container *ngTemplateOutlet=\"splitNumberTpl; context: { field: _column.field, disabled: _column.filter?.disabled }\">\n </ng-container>\n }\n } @else if (_column.type === 'boolean') {\n <sd-select\n minWidthPanel=\"200px\"\n [autoId]=\"_autoId\"\n style=\"flex: 1 1 0%; min-width: 0\"\n [style.width]=\"'100%'\"\n size=\"sm\"\n [label]=\"_label\"\n [items]=\"[\n { value: '1', display: _column.option?.displayOnTrue || 'True' },\n { value: '0', display: _column.option?.displayOnFalse || 'False' },\n ]\"\n valueField=\"value\"\n displayField=\"display\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n hideInlineError>\n <ng-template sdItemDef let-item=\"item\">\n @if (item.value === '1') {\n <sd-badge color=\"success\" [title]=\"_column.option?.displayOnTrue || 'True'\"> </sd-badge>\n } @else {\n <sd-badge color=\"error\" [title]=\"_column.option?.displayOnFalse || 'False'\"> </sd-badge>\n }\n </ng-template>\n </sd-select>\n } @else if (_column.type === 'values') {\n <sd-select\n minWidthPanel=\"200px\"\n [autoId]=\"_autoId\"\n style=\"flex: 1 1 0%; min-width: 0\"\n [style.width]=\"'100%'\"\n size=\"sm\"\n [label]=\"_label\"\n [items]=\"_items\"\n [valueField]=\"_column.option.valueField\"\n [displayField]=\"_column.option.displayField\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n [multiple]=\"_column.option.selection === 'MULTIPLE'\"\n hideInlineError>\n </sd-select>\n } @else if (_column.type === 'lazy-values') {\n <sd-select\n minWidthPanel=\"200px\"\n [autoId]=\"_autoId\"\n style=\"flex: 1 1 0%; min-width: 0\"\n [style.width]=\"'100%'\"\n size=\"sm\"\n [label]=\"_label\"\n [items]=\"_items\"\n [valueField]=\"_column.option.valueField\"\n [displayField]=\"_column.option.displayField\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n [multiple]=\"_column.option.selection === 'MULTIPLE'\"\n hideInlineError>\n </sd-select>\n } @else if (_column.type === 'date' || _column.type === 'datetime' || _column.type === 'time') {\n @if (!_column.filter?.type || _column.filter?.type === 'daterange') {\n <sd-date-range\n style=\"flex: 1 1 0%; min-width: 0\"\n size=\"sm\"\n [label]=\"_label\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n hideInlineError>\n </sd-date-range>\n } @else if (_column.filter?.type === 'date') {\n <sd-date\n [autoId]=\"_autoId\"\n style=\"flex: 1 1 0%; min-width: 0\"\n type=\"date\"\n size=\"sm\"\n [label]=\"_label\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n clearable\n hideInlineError>\n </sd-date>\n } @else if (_column.filter?.type === 'split-date') {\n <ng-container *ngTemplateOutlet=\"splitDateTpl; context: { field: _column.field, disabled: _column.filter?.disabled }\">\n </ng-container>\n }\n }\n }\n } @else {\n <sd-input [autoId]=\"_autoId\" style=\"flex: 1 1 0%; min-width: 0\" type=\"text\" size=\"sm\" disabled></sd-input>\n }\n</div>\n\n<!-- ================================================ -->\n<!-- Split from/to templates (\u0111\u01B0a xu\u1ED1ng cu\u1ED1i file) -->\n<!-- ================================================ -->\n<ng-template #splitNumberTpl let-field=\"field\" let-disabled=\"disabled\">\n <div class=\"d-flex align-items-center\" style=\"flex: 1 1 0%; min-width: 0\">\n <sd-input-number\n [autoId]=\"_autoId + '-from'\"\n style=\"flex: 1 1 0%; min-width: 0\"\n size=\"sm\"\n [label]=\"_label\"\n [(model)]=\"_columnFilter[field].from\"\n (sdChange)=\"onFilterChange()\"\n (sdBlur)=\"onFilterCommit()\"\n (cleared)=\"onFilterChange()\"\n [disabled]=\"disabled\"\n clearable\n hideInlineError>\n </sd-input-number>\n <div class=\"mx-4\">-</div>\n <sd-input-number\n [autoId]=\"_autoId + '-to'\"\n style=\"flex: 1 1 0%; min-width: 0\"\n size=\"sm\"\n [(model)]=\"_columnFilter[field].to\"\n (sdChange)=\"onFilterChange()\"\n (sdBlur)=\"onFilterCommit()\"\n (cleared)=\"onFilterChange()\"\n [disabled]=\"disabled\"\n clearable\n hideInlineError>\n </sd-input-number>\n </div>\n</ng-template>\n\n<ng-template #splitDateTpl let-field=\"field\" let-disabled=\"disabled\">\n <div class=\"d-flex align-items-center\" style=\"flex: 1 1 0%; min-width: 0\">\n <sd-date\n [autoId]=\"_autoId + '-from'\"\n style=\"flex: 1 1 0%; min-width: 0\"\n type=\"date\"\n size=\"sm\"\n [label]=\"_label\"\n [(model)]=\"_columnFilter[field].from\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"disabled\"\n clearable\n hideInlineError>\n </sd-date>\n <div class=\"mx-4\">-</div>\n <sd-date\n [autoId]=\"_autoId + '-to'\"\n style=\"flex: 1 1 0%; min-width: 0\"\n type=\"date\"\n size=\"sm\"\n [(model)]=\"_columnFilter[field].to\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"disabled\"\n clearable\n hideInlineError>\n </sd-date>\n </div>\n</ng-template>\n", styles: [":host ::ng-deep .c-inline-column{--sd-control-label-bg: var(--sd-table-bg, #ffffff)}:host ::ng-deep .c-inline-column .mat-mdc-text-field-wrapper{background-color:var(--sd-table-bg, #ffffff)}\n"] }]
|
|
2959
|
+
args: [{ selector: 'column-filter', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [CommonModule, SdOperator, SdInput, SdInputNumber, SdSelect, SdDate, SdDateRange, SdBadge], template: "@let _column = column();\n@let _columnFilter = columnFilter();\n@let _autoId = autoId();\n@let _templateRef = templateRef();\n@let _operators = operators();\n@let _controlOperators = controlOperators();\n@let _items = items();\n@let _label = label();\n@let _context = { columnFilter: _columnFilter, autoId: _autoId };\n\n<div class=\"d-flex c-inline-column align-items-center\" style=\"width: 100%; max-width: 100%\">\n @if (\n _column.type === 'string' ||\n _column.type === 'number' ||\n _column.type === 'boolean' ||\n _column.type === 'values' ||\n _column.type === 'lazy-values' ||\n _column.type === 'date' ||\n _column.type === 'datetime' ||\n _column.type === 'time'\n ) {\n <!-- Operator: chip trong control m\u1EB7c \u0111\u1ECBnh (thi\u1EBFt k\u1EBF \u0111\u1EE3t 2 \u00B7 G). Template custom (filterDef) v\u00E0 filter split\n (hai control) kh\u00F4ng ch\u00E8n chip \u0111\u01B0\u1EE3c n\u00EAn gi\u1EEF sd-operator r\u1EDDi nh\u01B0 c\u0169. -->\n @if (_operators.length && !operatorInControl()) {\n <!-- Chip 24px nh\u01B0 chip trong control; tint primary khi c\u1ED9t \u0111ang c\u00F3 gi\u00E1 tr\u1ECB. Ch\u01B0a c\u00F3 operator: ph\u1EC5u x\u00E1m, kh\u00F4ng g\u00E1n\n m\u1EB7c \u0111\u1ECBnh (handoff sd-operator B5, ph\u01B0\u01A1ng \u00E1n b). -->\n <sd-operator class=\"mr-4\" size=\"sm\" [active]=\"hasFilterValue()\" [(model)]=\"operator\" [operators]=\"operatorValues()\" />\n }\n\n <!-- N\u1EBFu filter nh\u1EADn v\u00E0o template -->\n @if (_templateRef) {\n <ng-container *ngTemplateOutlet=\"_templateRef; context: _context\"></ng-container>\n }\n <!-- M\u1EB7c \u0111\u1ECBnh theo type v\u00E0 gi\u00E1 tr\u1ECB values defined c\u1EE7a column -->\n @else {\n @if (_column.type === 'string') {\n <sd-input\n [autoId]=\"_autoId\"\n style=\"flex: 1 1 0%; min-width: 0\"\n size=\"sm\"\n type=\"text\"\n [label]=\"_label\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (keyupEnter)=\"onFilterChange()\"\n (sdBlur)=\"onFilterCommit()\"\n (cleared)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n clearable\n hideInlineError>\n </sd-input>\n } @else if (_column.type === 'number') {\n @if (!_column.filter?.type) {\n <sd-input-number\n [autoId]=\"_autoId\"\n style=\"flex: 1 1 0%; min-width: 0\"\n size=\"sm\"\n [label]=\"_label\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (keyupEnter)=\"onFilterChange()\"\n (sdBlur)=\"onFilterCommit()\"\n (cleared)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n clearable\n hideInlineError>\n </sd-input-number>\n } @else if (_column.filter?.type === 'split-number') {\n <ng-container *ngTemplateOutlet=\"splitNumberTpl; context: { field: _column.field, disabled: _column.filter?.disabled }\">\n </ng-container>\n }\n } @else if (_column.type === 'boolean') {\n <sd-select\n minWidthPanel=\"200px\"\n [autoId]=\"_autoId\"\n style=\"flex: 1 1 0%; min-width: 0\"\n [style.width]=\"'100%'\"\n size=\"sm\"\n [label]=\"_label\"\n [items]=\"[\n { value: '1', display: _column.option?.displayOnTrue || 'True' },\n { value: '0', display: _column.option?.displayOnFalse || 'False' },\n ]\"\n valueField=\"value\"\n displayField=\"display\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n hideInlineError>\n <ng-template sdItemDef let-item=\"item\">\n @if (item.value === '1') {\n <sd-badge color=\"success\" [title]=\"_column.option?.displayOnTrue || 'True'\"> </sd-badge>\n } @else {\n <sd-badge color=\"error\" [title]=\"_column.option?.displayOnFalse || 'False'\"> </sd-badge>\n }\n </ng-template>\n </sd-select>\n } @else if (_column.type === 'values') {\n <sd-select\n minWidthPanel=\"200px\"\n [autoId]=\"_autoId\"\n style=\"flex: 1 1 0%; min-width: 0\"\n [style.width]=\"'100%'\"\n size=\"sm\"\n [label]=\"_label\"\n [items]=\"_items\"\n [valueField]=\"_column.option.valueField\"\n [displayField]=\"_column.option.displayField\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n [multiple]=\"_column.option.selection === 'MULTIPLE'\"\n hideInlineError>\n </sd-select>\n } @else if (_column.type === 'lazy-values') {\n <sd-select\n minWidthPanel=\"200px\"\n [autoId]=\"_autoId\"\n style=\"flex: 1 1 0%; min-width: 0\"\n [style.width]=\"'100%'\"\n size=\"sm\"\n [label]=\"_label\"\n [items]=\"_items\"\n [valueField]=\"_column.option.valueField\"\n [displayField]=\"_column.option.displayField\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n [multiple]=\"_column.option.selection === 'MULTIPLE'\"\n hideInlineError>\n </sd-select>\n } @else if (_column.type === 'date' || _column.type === 'datetime' || _column.type === 'time') {\n @if (!_column.filter?.type || _column.filter?.type === 'daterange') {\n <sd-date-range\n style=\"flex: 1 1 0%; min-width: 0\"\n size=\"sm\"\n [label]=\"_label\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n hideInlineError>\n </sd-date-range>\n } @else if (_column.filter?.type === 'date') {\n <sd-date\n [autoId]=\"_autoId\"\n style=\"flex: 1 1 0%; min-width: 0\"\n type=\"date\"\n size=\"sm\"\n [label]=\"_label\"\n [(model)]=\"_columnFilter[_column.field]\"\n [operators]=\"_controlOperators\"\n [(operator)]=\"operator\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"_column.filter?.disabled\"\n clearable\n hideInlineError>\n </sd-date>\n } @else if (_column.filter?.type === 'split-date') {\n <ng-container *ngTemplateOutlet=\"splitDateTpl; context: { field: _column.field, disabled: _column.filter?.disabled }\">\n </ng-container>\n }\n }\n }\n } @else {\n <sd-input [autoId]=\"_autoId\" style=\"flex: 1 1 0%; min-width: 0\" type=\"text\" size=\"sm\" disabled></sd-input>\n }\n</div>\n\n<!-- ================================================ -->\n<!-- Split from/to templates (\u0111\u01B0a xu\u1ED1ng cu\u1ED1i file) -->\n<!-- ================================================ -->\n<!-- why: `[model]` \u0111\u1ECDc `?.` v\u00E0 `(modelChange)` qua setRangeEnd \u2014 b\u1EA3ng c\u00F3 th\u1EC3 \u0111\u1EB7t l\u1EA1i columnFilter t\u1EA1i ch\u1ED7 (xo\u00E1 l\u1ECDc,\n setFilter) l\u00E0m m\u1EA5t object { from, to }; `[(model)]=\"\u2026[field].from\"` khi \u0111\u00F3 \u0111\u1ECDc / ghi v\u00E0o undefined v\u00E0 n\u00E9m l\u1ED7i. -->\n<ng-template #splitNumberTpl let-field=\"field\" let-disabled=\"disabled\">\n <div class=\"d-flex align-items-center\" style=\"flex: 1 1 0%; min-width: 0\">\n <sd-input-number\n [autoId]=\"_autoId + '-from'\"\n style=\"flex: 1 1 0%; min-width: 0\"\n size=\"sm\"\n [label]=\"_label\"\n [model]=\"_columnFilter[field]?.from\"\n (modelChange)=\"setRangeEnd(field, 'from', $event)\"\n (sdChange)=\"onFilterChange()\"\n (sdBlur)=\"onFilterCommit()\"\n (cleared)=\"onFilterChange()\"\n [disabled]=\"disabled\"\n clearable\n hideInlineError>\n </sd-input-number>\n <div class=\"mx-4\">-</div>\n <sd-input-number\n [autoId]=\"_autoId + '-to'\"\n style=\"flex: 1 1 0%; min-width: 0\"\n size=\"sm\"\n [model]=\"_columnFilter[field]?.to\"\n (modelChange)=\"setRangeEnd(field, 'to', $event)\"\n (sdChange)=\"onFilterChange()\"\n (sdBlur)=\"onFilterCommit()\"\n (cleared)=\"onFilterChange()\"\n [disabled]=\"disabled\"\n clearable\n hideInlineError>\n </sd-input-number>\n </div>\n</ng-template>\n\n<ng-template #splitDateTpl let-field=\"field\" let-disabled=\"disabled\">\n <div class=\"d-flex align-items-center\" style=\"flex: 1 1 0%; min-width: 0\">\n <sd-date\n [autoId]=\"_autoId + '-from'\"\n style=\"flex: 1 1 0%; min-width: 0\"\n type=\"date\"\n size=\"sm\"\n [label]=\"_label\"\n [model]=\"_columnFilter[field]?.from\"\n (modelChange)=\"setRangeEnd(field, 'from', $event)\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"disabled\"\n clearable\n hideInlineError>\n </sd-date>\n <div class=\"mx-4\">-</div>\n <sd-date\n [autoId]=\"_autoId + '-to'\"\n style=\"flex: 1 1 0%; min-width: 0\"\n type=\"date\"\n size=\"sm\"\n [model]=\"_columnFilter[field]?.to\"\n (modelChange)=\"setRangeEnd(field, 'to', $event)\"\n (sdChange)=\"onFilterChange()\"\n [disabled]=\"disabled\"\n clearable\n hideInlineError>\n </sd-date>\n </div>\n</ng-template>\n", styles: [":host ::ng-deep .c-inline-column{--sd-control-label-bg: var(--sd-table-bg, #ffffff)}:host ::ng-deep .c-inline-column .mat-mdc-text-field-wrapper{background-color:var(--sd-table-bg, #ffffff)}\n"] }]
|
|
2460
2960
|
}], ctorParameters: () => [], propDecorators: { autoIdInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], column: [{ type: i0.Input, args: [{ isSignal: true, alias: "column", required: true }] }], columnFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnFilter", required: false }] }], cacheValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "cacheValues", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], operator: [{ type: i0.Input, args: [{ isSignal: true, alias: "operator", required: false }] }, { type: i0.Output, args: ["operatorChange"] }], isMobile: [{ type: i0.Input, args: [{ isSignal: true, alias: "isMobile", required: false }] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }], filterCommit: [{ type: i0.Output, args: ["filterCommit"] }] } });
|
|
2461
2961
|
|
|
2462
2962
|
class ExternalFilterComponent {
|
|
@@ -2815,6 +3315,54 @@ const SD_TABLE_CONFIGURATION = new InjectionToken('sd-table.configuration');
|
|
|
2815
3315
|
|
|
2816
3316
|
const SD_TABLE_LAYOUT = new InjectionToken('SD_TABLE_LAYOUT');
|
|
2817
3317
|
|
|
3318
|
+
/** The column setup of an option before anyone changes it: every column that is not `hidden`, in option order. */
|
|
3319
|
+
const defaultConfiguredTable = (option) => ({
|
|
3320
|
+
columns: option?.columns
|
|
3321
|
+
?.filter(e => !e.hidden)
|
|
3322
|
+
.map(e => ({
|
|
3323
|
+
origin: {
|
|
3324
|
+
field: e.field,
|
|
3325
|
+
title: typeof e.title === 'string' ? e.title : e.title?.title,
|
|
3326
|
+
width: e.width,
|
|
3327
|
+
invisible: e.invisible,
|
|
3328
|
+
fixed: e.fixed,
|
|
3329
|
+
truncate: e?.cell?.truncate?.enable,
|
|
3330
|
+
},
|
|
3331
|
+
title: typeof e.title === 'string' ? e.title : e.title?.title,
|
|
3332
|
+
width: e.width,
|
|
3333
|
+
invisible: e.invisible,
|
|
3334
|
+
fixed: e.fixed,
|
|
3335
|
+
truncate: e?.cell?.truncate?.enable,
|
|
3336
|
+
})) || [],
|
|
3337
|
+
});
|
|
3338
|
+
// why: so với `origin` đã lưu chứ không với option hiện tại — tiêu đề dịch theo ngôn ngữ hay đổi trong code không
|
|
3339
|
+
// phải là thiết lập của người dùng. Giá trị rỗng nghĩa là "dùng giá trị gốc", như `loadConfigurationResult` đọc.
|
|
3340
|
+
const changedFromOrigin = (column) => {
|
|
3341
|
+
const { origin } = column;
|
|
3342
|
+
return ((column.title || origin.title) !== origin.title ||
|
|
3343
|
+
(column.width || origin.width) !== origin.width ||
|
|
3344
|
+
!!column.invisible !== !!origin.invisible ||
|
|
3345
|
+
!!column.fixed !== !!origin.fixed ||
|
|
3346
|
+
!!(column.truncate ?? origin.truncate) !== !!origin.truncate);
|
|
3347
|
+
};
|
|
3348
|
+
/**
|
|
3349
|
+
* Whether the table uses a setup of its own: the stored columns differ from the defaults in order, visibility, title,
|
|
3350
|
+
* width (the settings modal or a resize on the table), fixed or truncate, or the inline external filters differ from
|
|
3351
|
+
* `defaultShowing`. Columns added to or removed from the option since the setup was stored do not count.
|
|
3352
|
+
*/
|
|
3353
|
+
const sdTableHasCustomSetup = ({ option, configuration, inlineExternal, }) => {
|
|
3354
|
+
const defaults = defaultConfiguredTable(option).columns.map(column => column.origin.field);
|
|
3355
|
+
const known = new Set(defaults);
|
|
3356
|
+
const stored = (configuration?.columns ?? []).filter(column => known.has(column.origin.field));
|
|
3357
|
+
const storedFields = new Set(stored.map(column => column.origin.field));
|
|
3358
|
+
const order = defaults.filter(field => storedFields.has(field));
|
|
3359
|
+
if (stored.some((column, index) => column.origin.field !== order[index] || changedFromOrigin(column)))
|
|
3360
|
+
return true;
|
|
3361
|
+
if (!inlineExternal || option?.filter?.disabled)
|
|
3362
|
+
return false;
|
|
3363
|
+
return (option?.filter?.externalFilters ?? []).some(filter => !!inlineExternal[filter.field] !== !!filter.defaultShowing);
|
|
3364
|
+
};
|
|
3365
|
+
|
|
2818
3366
|
// Aggregate templates contain Angular view references; they must never enter the storage-key hash.
|
|
2819
3367
|
function storageColumns(columns) {
|
|
2820
3368
|
return columns.map(({ aggregate: _aggregate, ...column }) => column.type === 'children' ? { ...column, children: storageColumns(column.children) } : column);
|
|
@@ -3020,28 +3568,8 @@ class ConfigService {
|
|
|
3020
3568
|
this.#storage.setSilent({ ...current, columns });
|
|
3021
3569
|
this.#widthChange.next({ field, width });
|
|
3022
3570
|
};
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
?.filter(e => !e.hidden)
|
|
3026
|
-
.map(e => ({
|
|
3027
|
-
origin: {
|
|
3028
|
-
field: e.field,
|
|
3029
|
-
title: typeof e.title === 'string' ? e.title : e.title?.title,
|
|
3030
|
-
width: e.width,
|
|
3031
|
-
invisible: e.invisible,
|
|
3032
|
-
fixed: e.fixed,
|
|
3033
|
-
truncate: e?.cell?.truncate?.enable,
|
|
3034
|
-
},
|
|
3035
|
-
title: typeof e.title === 'string' ? e.title : e.title?.title,
|
|
3036
|
-
width: e.width,
|
|
3037
|
-
invisible: e.invisible,
|
|
3038
|
-
fixed: e.fixed,
|
|
3039
|
-
truncate: e?.cell?.truncate?.enable,
|
|
3040
|
-
})) || [];
|
|
3041
|
-
return {
|
|
3042
|
-
columns,
|
|
3043
|
-
};
|
|
3044
|
-
};
|
|
3571
|
+
// why: bảng dùng cùng hàm để biết thiết lập đang lưu có khác mặc định không (chấm trên nút Thiết lập).
|
|
3572
|
+
#default = (tableOption) => defaultConfiguredTable(tableOption);
|
|
3045
3573
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: ConfigService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3046
3574
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: ConfigService });
|
|
3047
3575
|
}
|
|
@@ -3049,6 +3577,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
3049
3577
|
type: Injectable
|
|
3050
3578
|
}], ctorParameters: () => [] });
|
|
3051
3579
|
|
|
3580
|
+
// why: độ rộng cột là chuỗi CSS tự do ('120px', '20%', '12rem'). Modal chỉ sửa được px bằng số; mọi đơn vị khác hiện
|
|
3581
|
+
// nguyên văn. Một số trần cũng coi là px, vì đó là cái người dùng gõ vào ô số.
|
|
3582
|
+
const PX_WIDTH = /^\s*(\d+(?:\.\d+)?)\s*(?:px)?\s*$/i;
|
|
3583
|
+
/** The px value of a width, `undefined` when it is empty or uses another unit. */
|
|
3584
|
+
const configWidthPx = (value) => {
|
|
3585
|
+
const match = PX_WIDTH.exec(value ?? '');
|
|
3586
|
+
return match ? Number(match[1]) : undefined;
|
|
3587
|
+
};
|
|
3588
|
+
// A number as an `<input type="number">` may hold it: sign, decimals, exponent, optional px.
|
|
3589
|
+
const NUMBER_INPUT = /^[-+]?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?\s*(?:px)?$/i;
|
|
3590
|
+
/**
|
|
3591
|
+
* What the width field stores: a positive number becomes `${n}px`, zero or a negative number and an empty field become
|
|
3592
|
+
* `undefined`, anything else (`20%`, `12rem`) stays verbatim.
|
|
3593
|
+
*/
|
|
3594
|
+
const configWidthFromInput = (value) => {
|
|
3595
|
+
const text = String(value ?? '').trim();
|
|
3596
|
+
if (!text)
|
|
3597
|
+
return undefined;
|
|
3598
|
+
if (!NUMBER_INPUT.test(text))
|
|
3599
|
+
return text;
|
|
3600
|
+
const px = Number(text.replace(/px$/i, '').trim());
|
|
3601
|
+
return Number.isFinite(px) && px > 0 ? `${px}px` : undefined;
|
|
3602
|
+
};
|
|
3603
|
+
/** Rounds a px width and keeps it inside the px `minWidth` / `maxWidth`; bounds in another unit cannot be compared. */
|
|
3604
|
+
const configWidthClamp = (width, min, max) => {
|
|
3605
|
+
const px = configWidthPx(width);
|
|
3606
|
+
if (px === undefined)
|
|
3607
|
+
return width;
|
|
3608
|
+
const low = configWidthPx(min);
|
|
3609
|
+
const high = configWidthPx(max);
|
|
3610
|
+
let value = Math.round(px);
|
|
3611
|
+
if (low !== undefined)
|
|
3612
|
+
value = Math.max(value, low);
|
|
3613
|
+
if (high !== undefined)
|
|
3614
|
+
value = Math.min(value, high);
|
|
3615
|
+
return `${value}px`;
|
|
3616
|
+
};
|
|
3617
|
+
|
|
3618
|
+
/** The find box shows only past this many columns. */
|
|
3619
|
+
const FIND_THRESHOLD = 8;
|
|
3620
|
+
let nextId = 0;
|
|
3052
3621
|
class ConfigComponent {
|
|
3053
3622
|
// ==========================================
|
|
3054
3623
|
// 1. SIGNAL INPUTS / OUTPUTS
|
|
@@ -3057,6 +3626,8 @@ class ConfigComponent {
|
|
|
3057
3626
|
tableOption = input(undefined, /* @ts-ignore */
|
|
3058
3627
|
...(ngDevMode ? [{ debugName: "tableOption" }] : /* istanbul ignore next */ []));
|
|
3059
3628
|
changes = output();
|
|
3629
|
+
/** Restore defaults was confirmed and the stored setup removed. */
|
|
3630
|
+
defaultsRestored = output();
|
|
3060
3631
|
// Base autoId (đã là `components-table-<scope>` từ parent), '' khi parent không set.
|
|
3061
3632
|
autoId = computed(() => this.autoIdInput() || '', /* @ts-ignore */
|
|
3062
3633
|
...(ngDevMode ? [{ debugName: "autoId" }] : /* istanbul ignore next */ []));
|
|
@@ -3065,8 +3636,9 @@ class ConfigComponent {
|
|
|
3065
3636
|
// ==========================================
|
|
3066
3637
|
modal = viewChild(SdModal, /* @ts-ignore */
|
|
3067
3638
|
...(ngDevMode ? [{ debugName: "modal" }] : /* istanbul ignore next */ []));
|
|
3068
|
-
|
|
3069
|
-
|
|
3639
|
+
// why: signal query không đặt được trên member `#private`.
|
|
3640
|
+
handles = viewChildren('handle', /* @ts-ignore */
|
|
3641
|
+
...(ngDevMode ? [{ debugName: "handles" }] : /* istanbul ignore next */ []));
|
|
3070
3642
|
// ==========================================
|
|
3071
3643
|
// 3. INJECT
|
|
3072
3644
|
// ==========================================
|
|
@@ -3074,26 +3646,64 @@ class ConfigComponent {
|
|
|
3074
3646
|
#confirmService = inject(SdConfirmService);
|
|
3075
3647
|
#configService = inject(ConfigService);
|
|
3076
3648
|
#i18n = inject(I18nService);
|
|
3649
|
+
#injector = inject(Injector);
|
|
3077
3650
|
// ==========================================
|
|
3078
3651
|
// 4. STATE
|
|
3079
3652
|
// ==========================================
|
|
3653
|
+
// why: mỗi lần sửa thay object cột (không mutate) — giá trị lấy từ storage không bị đổi khi người dùng bấm Bỏ qua,
|
|
3654
|
+
// và các computed bên dưới tự tính lại.
|
|
3080
3655
|
configuration = signal(undefined, /* @ts-ignore */
|
|
3081
3656
|
...(ngDevMode ? [{ debugName: "configuration" }] : /* istanbul ignore next */ []));
|
|
3082
|
-
|
|
3083
|
-
|
|
3657
|
+
/** Text of the find box. */
|
|
3658
|
+
query = signal('', /* @ts-ignore */
|
|
3659
|
+
...(ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []));
|
|
3660
|
+
/** Field of the open row; one row at a time. */
|
|
3661
|
+
expanded = signal(null, /* @ts-ignore */
|
|
3662
|
+
...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
3663
|
+
// why: ô độ rộng đang ở chế độ chữ (giá trị %/rem…) giữ nguyên chế độ đó tới khi blur, để gõ "1.5rem" không bị đổi
|
|
3664
|
+
// sang ô số ngay ở ký tự "1".
|
|
3665
|
+
#textWidthField = signal(null, /* @ts-ignore */
|
|
3666
|
+
...(ngDevMode ? [{ debugName: "#textWidthField" }] : /* istanbul ignore next */ []));
|
|
3667
|
+
#id = `sd-table-config-${nextId++}`;
|
|
3668
|
+
hintId = `${this.#id}-hint`;
|
|
3084
3669
|
#setting;
|
|
3670
|
+
/** Widths as opened; only an edited width is rounded and clamped (an untouched `120.5px` stays as it is). */
|
|
3671
|
+
#openedWidths = new Map();
|
|
3672
|
+
/** Row lifted from the keyboard, and the order Escape goes back to. */
|
|
3673
|
+
picked = signal(null, /* @ts-ignore */
|
|
3674
|
+
...(ngDevMode ? [{ debugName: "picked" }] : /* istanbul ignore next */ []));
|
|
3675
|
+
/** Text of the live region: each keyboard reorder step. */
|
|
3676
|
+
announcement = signal('', /* @ts-ignore */
|
|
3677
|
+
...(ngDevMode ? [{ debugName: "announcement" }] : /* istanbul ignore next */ []));
|
|
3678
|
+
// why: @for dời node DOM khi đổi thứ tự nên handle có thể mất focus giữa chừng; blur lúc đó không phải người dùng rời
|
|
3679
|
+
// handle, không được coi là thả.
|
|
3680
|
+
#refocusing = false;
|
|
3681
|
+
#allColumns = computed(() => this.configuration()?.columns ?? [], /* @ts-ignore */
|
|
3682
|
+
...(ngDevMode ? [{ debugName: "#allColumns" }] : /* istanbul ignore next */ []));
|
|
3683
|
+
searchable = computed(() => this.#allColumns().length > FIND_THRESHOLD, /* @ts-ignore */
|
|
3684
|
+
...(ngDevMode ? [{ debugName: "searchable" }] : /* istanbul ignore next */ []));
|
|
3685
|
+
#term = computed(() => (this.searchable() ? sdNormalizeSearchText(this.query()) : ''), /* @ts-ignore */
|
|
3686
|
+
...(ngDevMode ? [{ debugName: "#term" }] : /* istanbul ignore next */ []));
|
|
3687
|
+
/** Reordering is off while a search narrows the list: the hidden rows would make the drop index ambiguous. */
|
|
3688
|
+
searching = computed(() => !!this.#term(), /* @ts-ignore */
|
|
3689
|
+
...(ngDevMode ? [{ debugName: "searching" }] : /* istanbul ignore next */ []));
|
|
3690
|
+
/** Rows on screen: every column, or those whose current or original title matches the search. */
|
|
3691
|
+
columns = computed(() => {
|
|
3692
|
+
const term = this.#term();
|
|
3693
|
+
const columns = this.#allColumns();
|
|
3694
|
+
if (!term)
|
|
3695
|
+
return columns;
|
|
3696
|
+
return columns.filter(column => [column.title, column.origin.title].some(title => sdNormalizeSearchText(title).includes(term)));
|
|
3697
|
+
}, /* @ts-ignore */
|
|
3698
|
+
...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
3699
|
+
totalCount = computed(() => this.#allColumns().length, /* @ts-ignore */
|
|
3700
|
+
...(ngDevMode ? [{ debugName: "totalCount" }] : /* istanbul ignore next */ []));
|
|
3701
|
+
shownCount = computed(() => this.#allColumns().filter(column => !column.invisible).length, /* @ts-ignore */
|
|
3702
|
+
...(ngDevMode ? [{ debugName: "shownCount" }] : /* istanbul ignore next */ []));
|
|
3703
|
+
allShown = computed(() => this.shownCount() === this.totalCount(), /* @ts-ignore */
|
|
3704
|
+
...(ngDevMode ? [{ debugName: "allShown" }] : /* istanbul ignore next */ []));
|
|
3085
3705
|
// ==========================================
|
|
3086
|
-
// 5.
|
|
3087
|
-
// ==========================================
|
|
3088
|
-
constructor() {
|
|
3089
|
-
fromEvent(window, 'mouseup')
|
|
3090
|
-
.pipe(takeUntilDestroyed())
|
|
3091
|
-
.subscribe(() => {
|
|
3092
|
-
this.dragDisabled = true;
|
|
3093
|
-
});
|
|
3094
|
-
}
|
|
3095
|
-
// ==========================================
|
|
3096
|
-
// 6. PUBLIC API
|
|
3706
|
+
// 5. PUBLIC API
|
|
3097
3707
|
// ==========================================
|
|
3098
3708
|
open = async () => {
|
|
3099
3709
|
const opt = this.tableOption();
|
|
@@ -3101,6 +3711,12 @@ class ConfigComponent {
|
|
|
3101
3711
|
return;
|
|
3102
3712
|
this.#setting = this.#configService.init(opt);
|
|
3103
3713
|
this.configuration.set(this.#setting?.get());
|
|
3714
|
+
this.#openedWidths = new Map(this.configuration()?.columns?.map(column => [column.origin.field, column.width]));
|
|
3715
|
+
this.query.set('');
|
|
3716
|
+
this.expanded.set(null);
|
|
3717
|
+
this.#textWidthField.set(null);
|
|
3718
|
+
this.picked.set(null);
|
|
3719
|
+
this.announcement.set('');
|
|
3104
3720
|
this.modal()?.open();
|
|
3105
3721
|
};
|
|
3106
3722
|
close = () => {
|
|
@@ -3109,54 +3725,206 @@ class ConfigComponent {
|
|
|
3109
3725
|
onSave = () => {
|
|
3110
3726
|
const cfg = this.configuration();
|
|
3111
3727
|
if (cfg)
|
|
3112
|
-
this.#setting?.set(cfg);
|
|
3728
|
+
this.#setting?.set({ ...cfg, columns: cfg.columns?.map(column => ({ ...column, width: this.#settledWidth(column) })) });
|
|
3113
3729
|
this.modal()?.close();
|
|
3114
3730
|
this.#ref.detectChanges();
|
|
3115
3731
|
};
|
|
3116
3732
|
onReset = async () => {
|
|
3117
3733
|
this.#confirmService.confirm(this.#i18n.t('core.component.table.config.confirm-reset')).then(() => {
|
|
3118
3734
|
this.#setting?.remove();
|
|
3735
|
+
this.defaultsRestored.emit();
|
|
3119
3736
|
this.modal()?.close();
|
|
3120
3737
|
this.#ref.detectChanges();
|
|
3121
3738
|
});
|
|
3122
3739
|
};
|
|
3123
3740
|
/**
|
|
3124
|
-
* Cột đang tắt hiển thị thì tiêu đề / độ rộng / cố định /
|
|
3125
|
-
*
|
|
3741
|
+
* Cột đang tắt hiển thị thì tiêu đề / độ rộng / cố định / rút gọn đều vô nghĩa — khoá phần chi tiết lại, chỉ chừa
|
|
3742
|
+
* ô "Hiện" để bật lại.
|
|
3126
3743
|
*/
|
|
3127
3744
|
isRowDisabled = (item) => !!item?.invisible;
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3745
|
+
// ==========================================
|
|
3746
|
+
// 6. LIST
|
|
3747
|
+
// ==========================================
|
|
3748
|
+
onFind = (value) => {
|
|
3749
|
+
this.query.set(String(value ?? ''));
|
|
3750
|
+
// why: dòng đang mở mà bị lọc mất thì đóng lại — không để phần chi tiết treo ở trạng thái không nhìn thấy.
|
|
3751
|
+
const open = this.expanded();
|
|
3752
|
+
if (open && !this.columns().some(column => column.origin.field === open))
|
|
3753
|
+
this.expanded.set(null);
|
|
3754
|
+
};
|
|
3755
|
+
toggleRow = (field) => this.expanded.update(current => (current === field ? null : field));
|
|
3756
|
+
/**
|
|
3757
|
+
* Pressing the handle of the open row closes it first, so its preview is the summary row. Another open row stays open:
|
|
3758
|
+
* closing it would move the pressed row away from the pointer before CDK measures.
|
|
3759
|
+
*/
|
|
3760
|
+
onHandlePointerDown = (field) => {
|
|
3761
|
+
if (this.expanded() === field)
|
|
3762
|
+
this.expanded.set(null);
|
|
3763
|
+
};
|
|
3764
|
+
drop = (event) => {
|
|
3765
|
+
this.picked.set(null);
|
|
3766
|
+
if (this.searching() || event.previousIndex === event.currentIndex)
|
|
3131
3767
|
return;
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
}
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3768
|
+
const columns = [...this.#allColumns()];
|
|
3769
|
+
moveItemInArray(columns, event.previousIndex, event.currentIndex);
|
|
3770
|
+
this.configuration.update(cfg => cfg && { ...cfg, columns });
|
|
3771
|
+
};
|
|
3772
|
+
showAll = () => this.#update(column => (column.invisible ? { ...column, invisible: false } : column));
|
|
3773
|
+
setShown = (field, shown) => this.#patch(field, { invisible: !shown });
|
|
3774
|
+
setFixed = (field, fixed) => this.#patch(field, { fixed });
|
|
3775
|
+
setTruncate = (field, truncate) => this.#patch(field, { truncate });
|
|
3776
|
+
// ==========================================
|
|
3777
|
+
// 7. KEYBOARD REORDER
|
|
3778
|
+
// ==========================================
|
|
3779
|
+
/** Space / Enter picks up and drops, ↑ / ↓ move the picked row, Escape puts the order back. */
|
|
3780
|
+
onHandleKeydown = (event, field) => {
|
|
3781
|
+
const picked = this.picked();
|
|
3782
|
+
switch (event.key) {
|
|
3783
|
+
case ' ':
|
|
3784
|
+
case 'Enter':
|
|
3785
|
+
if (picked?.field === field)
|
|
3786
|
+
this.#dropPicked();
|
|
3787
|
+
else
|
|
3788
|
+
this.#pick(field);
|
|
3789
|
+
break;
|
|
3790
|
+
case 'ArrowUp':
|
|
3791
|
+
case 'ArrowDown':
|
|
3792
|
+
if (picked?.field !== field)
|
|
3793
|
+
return;
|
|
3794
|
+
this.#movePicked(field, event.key === 'ArrowUp' ? -1 : 1);
|
|
3795
|
+
break;
|
|
3796
|
+
case 'Escape':
|
|
3797
|
+
if (!picked)
|
|
3798
|
+
return;
|
|
3799
|
+
this.#cancelPick(picked);
|
|
3800
|
+
break;
|
|
3801
|
+
default:
|
|
3802
|
+
return;
|
|
3803
|
+
}
|
|
3804
|
+
// why: khi đang giữ dòng, Escape không được đóng modal và ↑ ↓ không được cuộn danh sách.
|
|
3805
|
+
event.preventDefault();
|
|
3806
|
+
event.stopPropagation();
|
|
3807
|
+
};
|
|
3808
|
+
/** Leaving the handle while a row is held drops it where it is. */
|
|
3809
|
+
onHandleBlur = (field) => {
|
|
3810
|
+
if (!this.#refocusing && this.picked()?.field === field)
|
|
3811
|
+
this.#dropPicked();
|
|
3812
|
+
};
|
|
3813
|
+
#pick = (field) => {
|
|
3814
|
+
if (this.searching())
|
|
3815
|
+
return;
|
|
3816
|
+
const order = this.#allColumns();
|
|
3817
|
+
this.picked.set({ field, order });
|
|
3818
|
+
this.#announce('core.component.table.config.reorder-picked', field, { total: order.length });
|
|
3819
|
+
};
|
|
3820
|
+
#movePicked = (field, delta) => {
|
|
3821
|
+
const columns = [...this.#allColumns()];
|
|
3822
|
+
const from = columns.findIndex(column => column.origin.field === field);
|
|
3823
|
+
const to = from + delta;
|
|
3824
|
+
if (from < 0 || to < 0 || to >= columns.length)
|
|
3825
|
+
return;
|
|
3826
|
+
moveItemInArray(columns, from, to);
|
|
3827
|
+
this.configuration.update(cfg => cfg && { ...cfg, columns });
|
|
3828
|
+
this.#announce('core.component.table.config.reorder-moved', field, { total: columns.length });
|
|
3829
|
+
this.#refocus(field);
|
|
3830
|
+
};
|
|
3831
|
+
#dropPicked = () => {
|
|
3832
|
+
const field = this.picked()?.field;
|
|
3833
|
+
this.picked.set(null);
|
|
3834
|
+
if (field)
|
|
3835
|
+
this.#announce('core.component.table.config.reorder-dropped', field);
|
|
3836
|
+
};
|
|
3837
|
+
#cancelPick = (picked) => {
|
|
3838
|
+
this.picked.set(null);
|
|
3839
|
+
this.configuration.update(cfg => cfg && { ...cfg, columns: picked.order });
|
|
3840
|
+
this.announcement.set(this.#i18n.t('core.component.table.config.reorder-cancelled'));
|
|
3841
|
+
this.#refocus(picked.field);
|
|
3842
|
+
};
|
|
3843
|
+
/** Announces a step with the row's title and its 1-based position in the current order. */
|
|
3844
|
+
#announce = (key, field, params = {}) => {
|
|
3845
|
+
const columns = this.#allColumns();
|
|
3846
|
+
const index = columns.findIndex(column => column.origin.field === field);
|
|
3847
|
+
const column = columns[index];
|
|
3848
|
+
if (!column)
|
|
3849
|
+
return;
|
|
3850
|
+
this.announcement.set(this.#i18n.t(key, { title: this.titleOf(column), index: index + 1, ...params }));
|
|
3851
|
+
};
|
|
3852
|
+
#refocus = (field) => {
|
|
3853
|
+
this.#refocusing = true;
|
|
3854
|
+
afterNextRender(() => {
|
|
3855
|
+
this.handles()
|
|
3856
|
+
.find(handle => handle.nativeElement.closest('.c-item')?.getAttribute('data-field') === field)
|
|
3857
|
+
?.nativeElement.focus();
|
|
3858
|
+
this.#refocusing = false;
|
|
3859
|
+
}, { injector: this.#injector });
|
|
3860
|
+
};
|
|
3861
|
+
// ==========================================
|
|
3862
|
+
// 8. TITLE
|
|
3863
|
+
// ==========================================
|
|
3864
|
+
titleOf = (item) => item.title || item.origin.title;
|
|
3865
|
+
renamed = (item) => !!item.title && item.title !== item.origin.title;
|
|
3866
|
+
setTitle = (field, value) => this.#patch(field, { title: String(value ?? '') || undefined });
|
|
3867
|
+
restoreTitle = (field) => this.#patch(field, { title: undefined });
|
|
3868
|
+
// ==========================================
|
|
3869
|
+
// 9. WIDTH
|
|
3870
|
+
// ==========================================
|
|
3871
|
+
/** A width in another unit than px is edited as text, verbatim. */
|
|
3872
|
+
widthIsText = (item) => this.#textWidthField() === item.origin.field || (!!item.width && configWidthPx(item.width) === undefined);
|
|
3873
|
+
widthValue = (item) => {
|
|
3874
|
+
if (this.widthIsText(item))
|
|
3875
|
+
return item.width ?? '';
|
|
3876
|
+
const px = configWidthPx(item.width);
|
|
3877
|
+
return px === undefined ? '' : String(px);
|
|
3878
|
+
};
|
|
3879
|
+
/** Empty falls back to the original width, so that is the placeholder; "auto" when the option has none. */
|
|
3880
|
+
widthPlaceholder = (item) => {
|
|
3881
|
+
const origin = item.origin.width;
|
|
3882
|
+
if (!origin)
|
|
3883
|
+
return this.#i18n.t('core.component.table.config.width-auto');
|
|
3884
|
+
const px = configWidthPx(origin);
|
|
3885
|
+
return px === undefined ? origin : String(px);
|
|
3886
|
+
};
|
|
3887
|
+
widthSummary = (item) => {
|
|
3888
|
+
if (item.invisible)
|
|
3889
|
+
return this.#i18n.t('core.component.table.config.hidden');
|
|
3890
|
+
const width = item.width || item.origin.width;
|
|
3891
|
+
if (!width)
|
|
3892
|
+
return this.#i18n.t('core.component.table.config.width-auto');
|
|
3893
|
+
const px = configWidthPx(width);
|
|
3894
|
+
return px === undefined ? width : `${px} px`;
|
|
3895
|
+
};
|
|
3896
|
+
onWidthFocus = (item) => {
|
|
3897
|
+
if (this.widthIsText(item))
|
|
3898
|
+
this.#textWidthField.set(item.origin.field);
|
|
3899
|
+
};
|
|
3900
|
+
setWidth = (field, value) => {
|
|
3901
|
+
// why: chế độ chữ giữ nguyên chuỗi đang gõ; chuyển sang px (và kẹp) khi blur.
|
|
3902
|
+
const width = this.#textWidthField() === field ? String(value ?? '').trim() || undefined : configWidthFromInput(value);
|
|
3903
|
+
this.#patch(field, { width });
|
|
3904
|
+
};
|
|
3905
|
+
commitWidth = (field) => {
|
|
3906
|
+
this.#textWidthField.set(null);
|
|
3907
|
+
const column = this.#allColumns().find(item => item.origin.field === field);
|
|
3908
|
+
if (column)
|
|
3909
|
+
this.#patch(field, { width: this.#settledWidth(column) });
|
|
3910
|
+
};
|
|
3911
|
+
detailsId = (field) => `${this.#id}-${field.replace(/[^\w-]/g, '_')}`;
|
|
3912
|
+
/** Number → px, then rounded and kept within the column's px `minWidth` / `maxWidth`. */
|
|
3913
|
+
#settledWidth = (column) => {
|
|
3914
|
+
if (column.width === this.#openedWidths.get(column.origin.field))
|
|
3915
|
+
return column.width;
|
|
3916
|
+
const option = this.tableOption()?.columns?.find(item => item.field === column.origin.field);
|
|
3917
|
+
return configWidthClamp(configWidthFromInput(column.width), option?.minWidth, option?.maxWidth);
|
|
3918
|
+
};
|
|
3919
|
+
#patch = (field, patch) => this.#update(column => (column.origin.field === field ? { ...column, ...patch } : column));
|
|
3920
|
+
#update = (map) => this.configuration.update(cfg => cfg && { ...cfg, columns: cfg.columns?.map(map) });
|
|
3141
3921
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: ConfigComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3142
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: ConfigComponent, isStandalone: true, selector: "config", inputs: { autoIdInput: { classPropertyName: "autoIdInput", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, tableOption: { classPropertyName: "tableOption", publicName: "tableOption", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changes: "changes" }, providers: [ConfigService], viewQueries: [{ propertyName: "modal", first: true, predicate: SdModal, descendants: true, isSignal: true }, { propertyName: "table", first: true, predicate: MatTable, descendants: true, isSignal: true }], ngImport: i0, template: "@let _configuration = configuration();\n@let _autoId = autoId();\n@let _columns = ['invisible', 'title', 'width', 'fixed', 'truncate'];\n\n<sd-modal width=\"sm\" [title]=\"'core.component.table.setup' | sdTranslate\" #modal>\n @if (_configuration) {\n <div class=\"c-container sd-table-config\">\n <!-- why: drag handle l\u00E0 affordance duy nh\u1EA5t cho vi\u1EC7c \u0111\u1ED5i th\u1EE9 t\u1EF1 c\u1ED9t, v\u00E0 n\u00F3 kh\u00F4ng t\u1EF1 n\u00F3i ra\n \u0111i\u1EC1u \u0111\u00F3 \u2014 m\u1ED9t d\u00F2ng hint tr\u00E1nh vi\u1EC7c ng\u01B0\u1EDDi d\u00F9ng kh\u00F4ng bao gi\u1EDD ph\u00E1t hi\u1EC7n t\u00EDnh n\u0103ng.\n K\u00FD hi\u1EC7u \u283F n\u1EB1m S\u1EB4N trong chu\u1ED7i i18n (\u0111\u00FAng v\u1ECB tr\u00ED trong c\u00E2u), n\u00EAn kh\u00F4ng k\u00E8m icon ri\u00EAng. -->\n <p class=\"c-hint\">{{ 'core.component.table.config.drag-hint' | sdTranslate }}</p>\n\n <div class=\"c-table\">\n <table\n mat-table\n [dataSource]=\"_configuration.columns!\"\n cdkDropList\n [cdkDropListData]=\"_configuration.columns\"\n (cdkDropListDropped)=\"dropTable($event)\">\n <ng-container matColumnDef=\"invisible\">\n <th mat-header-cell class=\"c-th\" *matHeaderCellDef>\n {{ 'core.component.form-builder.display' | sdTranslate }}\n </th>\n <td mat-cell *matCellDef=\"let item\">\n <div class=\"c-display-cell\">\n <button\n type=\"button\"\n class=\"c-handle\"\n [title]=\"'core.component.table.config.drag-handle' | sdTranslate\"\n [attr.aria-label]=\"'core.component.table.config.drag-handle' | sdTranslate\"\n (mousedown)=\"handleMouseDown()\"\n (mouseup)=\"handleMouseUp()\">\n <sd-icon name=\"drag_indicator\" aria-hidden=\"true\"></sd-icon>\n </button>\n <!-- why: \u00F4 \"Hi\u1EC3n th\u1ECB\" KH\u00D4NG bao gi\u1EDD b\u1ECB kho\u00E1 \u2014 n\u00F3 l\u00E0 \u0111\u01B0\u1EDDng duy nh\u1EA5t \u0111\u1EC3 b\u1EADt l\u1EA1i m\u1ED9t\n c\u1ED9t \u0111\u00E3 t\u1EAFt. -->\n <sd-checkbox [model]=\"!item.invisible\" (modelChange)=\"item.invisible = !item.invisible\" />\n </div>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"title\">\n <th mat-header-cell class=\"c-th\" *matHeaderCellDef>\n {{ 'core.component.table.column-header' | sdTranslate }}\n </th>\n <td mat-cell *matCellDef=\"let item\">\n <sd-input\n size=\"sm\"\n [placeholder]=\"item?.origin?.title\"\n [(model)]=\"item.title\"\n [disabled]=\"isRowDisabled(item)\"\n hideInlineError></sd-input>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"width\">\n <th mat-header-cell class=\"c-th c-col-width\" *matHeaderCellDef>\n {{ 'core.component.table.width' | sdTranslate }}\n </th>\n <td mat-cell class=\"c-col-width\" *matCellDef=\"let item\">\n <sd-input\n size=\"sm\"\n [placeholder]=\"item?.origin?.width\"\n [(model)]=\"item.width\"\n [disabled]=\"isRowDisabled(item)\"\n hideInlineError></sd-input>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"fixed\">\n <th mat-header-cell class=\"c-th c-col-toggle\" *matHeaderCellDef>\n {{ 'core.component.table.fixed' | sdTranslate }}\n </th>\n <td mat-cell class=\"c-col-toggle\" *matCellDef=\"let item\">\n <sd-checkbox [(model)]=\"item.fixed\" [disabled]=\"isRowDisabled(item)\" />\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"truncate\">\n <th mat-header-cell class=\"c-th c-col-toggle\" *matHeaderCellDef>\n {{ 'core.component.table.char-limit' | sdTranslate }}\n </th>\n <td mat-cell class=\"c-col-toggle\" *matCellDef=\"let item\">\n <sd-checkbox [(model)]=\"item.truncate\" [disabled]=\"isRowDisabled(item)\" />\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"_columns; sticky: true\"></tr>\n <tr\n mat-row\n *matRowDef=\"let row; columns: _columns\"\n [class.c-row-hidden]=\"isRowDisabled(row)\"\n cdkDrag\n [cdkDragData]=\"row\"\n cdkDragLockAxis=\"y\"\n [cdkDragDisabled]=\"dragDisabled\">\n </tr>\n </table>\n </div>\n </div>\n }\n <ng-container sdFooterRight>\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-config-skip' : null\"\n (click)=\"close()\"\n [title]=\"'core.component.table.skip' | sdTranslate\"\n color=\"secondary\">\n </sd-button>\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-config-reset' : null\"\n (click)=\"onReset()\"\n [title]=\"'core.component.form-builder.default' | sdTranslate\"\n color=\"primary\">\n </sd-button>\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-config-apply' : null\"\n (click)=\"onSave()\"\n [title]=\"'core.component.table.apply' | sdTranslate\"\n type=\"fill\"\n color=\"primary\">\n </sd-button>\n </ng-container>\n</sd-modal>\n", styles: [".c-container{position:relative;min-height:200px}.c-hint{margin:0 0 12px;color:var(--sd-text-secondary, #6b7280);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-18, 18px)}.c-table{position:relative;overflow:auto;max-height:60vh;border:1px solid var(--sd-border, rgba(0, 0, 0, .08));border-radius:var(--sd-radius-8, 8px)}.c-table table{--mat-table-header-container-height: 40px;--mat-table-row-item-container-height: 48px;width:100%;background:transparent}.c-table .c-th{font-weight:var(--sd-font-weight-medium, 500);font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px);color:var(--sd-text-secondary, #6b7280);background:var(--sd-surface, #f7f8fa);white-space:nowrap}.c-table .mat-mdc-header-cell,.c-table .mat-mdc-cell{padding:4px 12px;vertical-align:middle;border-bottom-color:var(--sd-border, rgba(0, 0, 0, .08))}.c-table .mat-mdc-header-cell:first-of-type,.c-table .mat-mdc-cell:first-of-type{padding-left:12px}.c-table .mat-mdc-row:last-of-type .mat-mdc-cell{border-bottom:none}.c-table .mat-mdc-row:hover .mat-mdc-cell{background:var(--sd-surface, rgba(0, 0, 0, .02))}.c-table .c-col-width{width:104px}.c-table .c-col-toggle{width:88px;text-align:center}sd-checkbox{display:inline-flex;align-items:center;vertical-align:middle}sd-checkbox ::ng-deep .mat-mdc-checkbox{display:flex}sd-checkbox ::ng-deep .mat-internal-form-field{margin:0}sd-checkbox ::ng-deep .mat-mdc-checkbox .mdc-label{padding:0}.c-display-cell{display:flex;align-items:center;gap:8px}.c-handle{display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;background:none;color:var(--sd-text-disabled, #b6bcc6);cursor:grab;transition:color .15s ease}.c-handle:hover,.c-handle:focus-visible{color:var(--sd-text-secondary, #6b7280);outline:none}.c-handle:active{cursor:grabbing}.c-row-hidden .mat-mdc-cell{background:var(--sd-surface, rgba(0, 0, 0, .015))}.c-row-hidden sd-input,.c-row-hidden .c-col-toggle sd-checkbox{opacity:.55}.cdk-drag-preview{display:table;border-radius:var(--sd-radius-8, 8px);background:var(--sd-surface, #fff);outline:1px solid var(--sd-primary, #2a66f4);box-shadow:0 12px 28px #00000029,0 2px 8px #00000014;opacity:.98}.cdk-drag-preview .mat-mdc-cell{border-bottom:none;padding:4px 12px;vertical-align:middle}.cdk-drag-preview .c-handle{color:var(--sd-primary, #2a66f4);cursor:grabbing}.cdk-drag-placeholder .mat-mdc-cell{background:var(--sd-primary-light, rgba(42, 102, 244, .06));border-bottom:none;box-shadow:inset 0 1px 0 var(--sd-primary, #2a66f4),inset 0 -1px 0 var(--sd-primary, #2a66f4)}.cdk-drag-placeholder .mat-mdc-cell>*{visibility:hidden}.cdk-drag-animating,.c-table.cdk-drop-list-dragging .mat-mdc-row:not(.cdk-drag-placeholder){transition:transform .22s cubic-bezier(0,0,.2,1)}.c-table.cdk-drop-list-dragging .mat-mdc-row:hover .mat-mdc-cell{background:transparent}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i4$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i4$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i4$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i4$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i4$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i4$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i4$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i4$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i4$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i4$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "ngmodule", type: CdkTableModule }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i1$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i1$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType", "indicator", "indicatorColor", "indicatorMax", "indicatorLabel"], outputs: ["click"] }, { kind: "component", type: SdCheckbox, selector: "sd-checkbox", inputs: ["autoId", "name", "form", "label", "color", "disabled", "size", "viewed", "inlineError", "model"], outputs: ["modelChange", "sdChange"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdInput, selector: "sd-input", inputs: ["autoId", "name", "appearance", "floatLabel", "labelPlacement", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "type", "mask", "inputmode", "autocomplete", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "minlength", "maxlength", "pattern", "patternErrorMessage", "validator", "inlineError", "hyperlink", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }, { kind: "component", type: SdModal, selector: "sd-modal", inputs: ["autoId", "title", "color", "width", "height", "view", "modalClass", "lazyLoadContent", "hideClose", "disableBackdropClose", "beforeClose"], outputs: ["sdClosed", "sdCloseError"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
3922
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: ConfigComponent, isStandalone: true, selector: "config", inputs: { autoIdInput: { classPropertyName: "autoIdInput", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, tableOption: { classPropertyName: "tableOption", publicName: "tableOption", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changes: "changes", defaultsRestored: "defaultsRestored" }, providers: [ConfigService], viewQueries: [{ propertyName: "modal", first: true, predicate: SdModal, descendants: true, isSignal: true }, { propertyName: "handles", predicate: ["handle"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _configuration = configuration();\n@let _autoId = autoId();\n@let _searching = searching();\n@let _expanded = expanded();\n\n<sd-modal width=\"sm\" [title]=\"'core.component.table.setup' | sdTranslate\" #modal>\n @if (_configuration) {\n <div class=\"c-container sd-table-config\">\n <div class=\"c-toolbar\">\n @if (searchable()) {\n <sd-input\n class=\"c-find\"\n size=\"sm\"\n hideInlineError\n [autoId]=\"_autoId ? _autoId + '-config-find' : null\"\n [placeholder]=\"'core.component.table.config.find-column' | sdTranslate\"\n [model]=\"query()\"\n (modelChange)=\"onFind($event)\">\n <ng-template sdSuffixDef>\n <sd-icon class=\"c-find-icon\" name=\"search\" size=\"18px\" aria-hidden=\"true\"></sd-icon>\n </ng-template>\n </sd-input>\n }\n <div class=\"c-toolbar-end\">\n <span class=\"c-shown-count\">\n {{ 'core.component.table.config.shown-count' | sdTranslate: { shown: shownCount(), total: totalCount() } }}\n </span>\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-config-show-all' : null\"\n type=\"text\"\n color=\"primary\"\n size=\"sm\"\n [title]=\"'core.component.table.config.show-all' | sdTranslate\"\n [disabled]=\"allShown()\"\n (click)=\"showAll()\">\n </sd-button>\n </div>\n </div>\n\n <!-- why: handle \u283F l\u00E0 c\u00E1ch duy nh\u1EA5t \u0111\u1EC3 \u0111\u1ED5i th\u1EE9 t\u1EF1 c\u1ED9t v\u00E0 t\u1EF1 n\u00F3 kh\u00F4ng n\u00F3i ra \u0111i\u1EC1u \u0111\u00F3 \u2014 d\u00F2ng g\u1EE3i \u00FD tr\u00E1nh vi\u1EC7c ng\u01B0\u1EDDi\n d\u00F9ng kh\u00F4ng bao gi\u1EDD ph\u00E1t hi\u1EC7n t\u00EDnh n\u0103ng. K\u00FD hi\u1EC7u \u283F n\u1EB1m s\u1EB5n trong chu\u1ED7i i18n n\u00EAn kh\u00F4ng k\u00E8m icon ri\u00EAng. -->\n <p class=\"c-hint\" [id]=\"hintId\">\n {{ (_searching ? 'core.component.table.config.drag-disabled-search' : 'core.component.table.config.drag-hint') | sdTranslate }}\n </p>\n\n <!-- why: v\u00F9ng live n\u1EB1m TRONG modal \u2014 v\u00F9ng n\u1EB1m ngo\u00E0i m\u1ED9t h\u1ED9p tho\u1EA1i aria-modal c\u00F3 th\u1EC3 b\u1ECB tr\u00ECnh \u0111\u1ECDc m\u00E0n h\u00ECnh b\u1ECF qua. -->\n <div class=\"c-live sd-visually-hidden\" aria-live=\"assertive\" aria-atomic=\"true\">{{ announcement() }}</div>\n\n <div\n class=\"c-list\"\n cdkDropList\n cdkDropListLockAxis=\"y\"\n [cdkDropListData]=\"columns()\"\n [cdkDropListDisabled]=\"_searching\"\n (cdkDropListDropped)=\"drop($event)\">\n @for (item of columns(); track item.origin.field) {\n @let _field = item.origin.field;\n @let _open = _expanded === _field;\n @let _hidden = isRowDisabled(item);\n @let _title = titleOf(item);\n <div\n class=\"c-item\"\n cdkDrag\n [cdkDragData]=\"item\"\n [attr.data-field]=\"_field\"\n [class.c-item--open]=\"_open\"\n [class.c-item--hidden]=\"_hidden\"\n [class.c-item--picked]=\"picked()?.field === _field\">\n <div class=\"c-row\">\n <button\n #handle\n type=\"button\"\n class=\"c-handle\"\n cdkDragHandle\n [disabled]=\"_searching\"\n [title]=\"'core.component.table.config.drag-handle' | sdTranslate\"\n [attr.aria-label]=\"('core.component.table.config.drag-handle' | sdTranslate) + ': ' + _title\"\n [attr.aria-describedby]=\"hintId\"\n (pointerdown)=\"onHandlePointerDown(_field)\"\n (keydown)=\"onHandleKeydown($event, _field)\"\n (blur)=\"onHandleBlur(_field)\">\n <sd-icon name=\"drag_indicator\" size=\"20px\" aria-hidden=\"true\"></sd-icon>\n </button>\n <!-- why: \u00F4 \"Hi\u1EC7n\" KH\u00D4NG bao gi\u1EDD b\u1ECB kho\u00E1 \u2014 n\u00F3 l\u00E0 \u0111\u01B0\u1EDDng duy nh\u1EA5t \u0111\u1EC3 b\u1EADt l\u1EA1i m\u1ED9t c\u1ED9t \u0111\u00E3 t\u1EAFt. Nh\u00E3n b\u1ECB \u1EA9n\n kh\u1ECFi m\u00E0n h\u00ECnh nh\u01B0ng v\u1EABn l\u00E0 t\u00EAn c\u1EE7a \u00F4 cho tr\u00ECnh \u0111\u1ECDc m\u00E0n h\u00ECnh. -->\n <sd-checkbox\n class=\"c-show\"\n [label]=\"('core.component.form-builder.display' | sdTranslate) + ': ' + _title\"\n [model]=\"!item.invisible\"\n (modelChange)=\"setShown(_field, !!$event)\">\n </sd-checkbox>\n <button\n type=\"button\"\n class=\"c-toggle\"\n [attr.aria-expanded]=\"_open\"\n [attr.aria-controls]=\"_open ? detailsId(_field) : null\"\n (click)=\"toggleRow(_field)\">\n <span class=\"c-title\">{{ _title }}</span>\n @if (!_hidden && item.fixed) {\n @let _fixedLabel = 'core.component.table.config.fixed-label' | sdTranslate;\n <sd-icon class=\"c-pin\" name=\"push_pin\" size=\"16px\" [title]=\"_fixedLabel\" [ariaLabel]=\"_fixedLabel\"></sd-icon>\n }\n @if (!_hidden && (item.truncate ?? item.origin.truncate)) {\n @let _truncateLabel = 'core.component.table.config.truncate-label' | sdTranslate;\n <sd-icon class=\"c-trunc\" name=\"short_text\" size=\"16px\" [title]=\"_truncateLabel\" [ariaLabel]=\"_truncateLabel\"></sd-icon>\n }\n <span class=\"c-width-meta\">{{ widthSummary(item) }}</span>\n <sd-icon class=\"c-chevron\" size=\"20px\" [name]=\"_open ? 'expand_less' : 'expand_more'\" aria-hidden=\"true\"></sd-icon>\n </button>\n </div>\n\n @if (_open) {\n <div class=\"c-details\" [id]=\"detailsId(_field)\">\n <div class=\"c-fields\">\n <div class=\"c-field-title\">\n <sd-input\n size=\"sm\"\n hideInlineError\n [label]=\"'core.component.table.column-header' | sdTranslate\"\n [placeholder]=\"item.origin.title\"\n [model]=\"item.title\"\n [disabled]=\"_hidden\"\n (modelChange)=\"setTitle(_field, $event)\">\n </sd-input>\n @if (renamed(item)) {\n <div class=\"c-origin\">\n {{ 'core.component.table.config.origin' | sdTranslate: { title: item.origin.title } }} \u00B7\n <button type=\"button\" class=\"c-restore\" [disabled]=\"_hidden\" (click)=\"restoreTitle(_field)\">\n {{ 'core.component.table.config.restore' | sdTranslate }}\n </button>\n </div>\n }\n </div>\n <div class=\"c-field-width\">\n @let _textWidth = widthIsText(item);\n <sd-input\n size=\"sm\"\n hideInlineError\n [type]=\"_textWidth ? 'text' : 'number'\"\n [label]=\"'core.component.table.width' | sdTranslate\"\n [placeholder]=\"widthPlaceholder(item)\"\n [model]=\"widthValue(item)\"\n [disabled]=\"_hidden\"\n (sdFocus)=\"onWidthFocus(item)\"\n (modelChange)=\"setWidth(_field, $event)\"\n (sdBlur)=\"commitWidth(_field)\">\n @if (!_textWidth) {\n <ng-template sdSuffixDef><span class=\"c-px\">px</span></ng-template>\n }\n </sd-input>\n </div>\n </div>\n <div class=\"c-checks\">\n <sd-checkbox\n class=\"c-fixed\"\n [label]=\"'core.component.table.config.fixed-label' | sdTranslate\"\n [model]=\"!!item.fixed\"\n [disabled]=\"_hidden\"\n (modelChange)=\"setFixed(_field, !!$event)\">\n </sd-checkbox>\n <div class=\"c-truncate-field\">\n <sd-checkbox\n class=\"c-truncate\"\n [label]=\"'core.component.table.config.truncate-label' | sdTranslate\"\n [model]=\"!!(item.truncate ?? item.origin.truncate)\"\n [disabled]=\"_hidden\"\n (modelChange)=\"setTruncate(_field, !!$event)\">\n </sd-checkbox>\n <span class=\"c-check-hint\">{{ 'core.component.table.config.truncate-hint' | sdTranslate }}</span>\n </div>\n </div>\n </div>\n }\n </div>\n }\n </div>\n </div>\n }\n <ng-container sdFooterLeft>\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-config-reset' : null\"\n type=\"text\"\n color=\"primary\"\n size=\"sm\"\n prefixIcon=\"restart_alt\"\n [title]=\"'core.component.table.config.reset' | sdTranslate\"\n (click)=\"onReset()\">\n </sd-button>\n </ng-container>\n <ng-container sdFooterRight>\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-config-skip' : null\"\n type=\"outline\"\n size=\"sm\"\n [title]=\"'core.component.table.skip' | sdTranslate\"\n (click)=\"close()\">\n </sd-button>\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-config-apply' : null\"\n type=\"fill\"\n color=\"primary\"\n size=\"sm\"\n [title]=\"'core.component.table.apply' | sdTranslate\"\n (click)=\"onSave()\">\n </sd-button>\n </ng-container>\n</sd-modal>\n", styles: [".c-container{position:relative;display:flex;flex-direction:column;gap:10px;min-height:200px}.c-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;min-height:32px}.c-find{flex:none;width:220px}.c-find-icon{color:var(--sd-text-secondary)}.c-toolbar-end{display:flex;align-items:center;gap:8px;margin-left:auto}.c-shown-count{color:var(--sd-text-secondary);font-size:var(--sd-font-size-13);font-variant-numeric:tabular-nums;white-space:nowrap}.c-hint{margin:0;color:var(--sd-text-secondary);font-size:var(--sd-font-size-12);line-height:var(--sd-line-height-18)}.c-list{overflow-x:hidden;overflow-y:auto;max-height:min(400px,50vh);border:1px solid var(--sd-border);border-radius:var(--sd-radius-8)}.c-item+.c-item{border-top:1px solid var(--sd-border)}.c-item--open{background:color-mix(in srgb,var(--sd-text) 4%,transparent)}.c-row{display:flex;align-items:center;gap:10px;box-sizing:border-box;height:44px;padding:0 8px 0 12px}.c-handle{position:relative;z-index:1;display:inline-flex;flex:none;align-items:center;justify-content:center;padding:0;border:0;border-radius:var(--sd-radius-4);background:none;color:var(--sd-disabled-text);cursor:grab;transition:color var(--sd-duration-fast) var(--sd-ease-standard)}.c-handle:hover:not(:disabled),.c-handle:focus-visible{color:var(--sd-text-secondary)}.c-handle:focus-visible{outline:2px solid var(--sd-focus-ring-color);outline-offset:2px}.c-handle:active:not(:disabled){cursor:grabbing}.c-handle:disabled{cursor:default;opacity:.5}sd-checkbox{display:inline-flex;align-items:center}sd-checkbox ::ng-deep .mat-mdc-checkbox{display:flex}sd-checkbox ::ng-deep .mat-internal-form-field{margin:0}.c-show{flex:none}.c-show ::ng-deep .mdc-checkbox{margin:0 -11px}.c-show ::ng-deep .mdc-label{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.c-toggle{position:relative;z-index:1;display:flex;flex:1;align-items:center;gap:8px;min-width:0;height:44px;padding:0 4px 0 2px;border:0;border-radius:var(--sd-radius-4);background:transparent;color:var(--sd-text);font:inherit;font-size:var(--sd-font-size-14);text-align:left;cursor:pointer}.c-toggle:focus-visible{outline:2px solid var(--sd-focus-ring-color);outline-offset:-2px}.c-toggle:hover .c-chevron{color:var(--sd-text)}.c-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.c-item--hidden .c-title{color:var(--sd-disabled-text)}@media(forced-colors:active){.c-item--hidden .c-title{color:GrayText}}.c-pin{flex:none;color:var(--sd-primary)}.c-trunc{flex:none;color:var(--sd-text-secondary)}.c-width-meta{flex:none;min-width:58px;color:var(--sd-text-secondary);font-size:var(--sd-font-size-12);font-variant-numeric:tabular-nums;text-align:right;white-space:nowrap}.c-chevron{flex:none;color:var(--sd-text-secondary)}.c-details{display:flex;flex-direction:column;gap:12px;padding:8px 16px 14px 62px}.c-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,112px);gap:12px;align-items:start}.c-origin{margin-top:4px;padding-left:2px;color:var(--sd-text-secondary);font-size:var(--sd-font-size-12);line-height:var(--sd-line-height-16)}.c-restore{padding:0;border:0;border-radius:var(--sd-radius-2);background:none;color:var(--sd-primary);font:inherit;font-weight:var(--sd-font-weight-medium);cursor:pointer}.c-restore:hover:not(:disabled){text-decoration:underline}.c-restore:focus-visible{outline:2px solid var(--sd-focus-ring-color);outline-offset:2px}.c-restore:disabled{color:var(--sd-disabled-text);cursor:default}.c-px{padding-right:8px;color:var(--sd-text-secondary);font-size:var(--sd-font-size-12)}.c-checks{display:flex;flex-wrap:wrap;gap:8px 24px}.c-truncate-field{display:flex;flex-direction:column}.c-check-hint{padding-left:40px;color:var(--sd-text-secondary);font-size:var(--sd-font-size-12);line-height:var(--sd-line-height-16)}.cdk-drag-preview.c-item{box-sizing:border-box;border-radius:var(--sd-radius-8);background:var(--sd-surface);outline:1px solid var(--sd-primary);box-shadow:var(--sd-shadow-lg);opacity:.98}.cdk-drag-preview.c-item .c-handle{color:var(--sd-primary);cursor:grabbing}.cdk-drag-placeholder.c-item{background:var(--sd-primary-light);box-shadow:inset 0 1px 0 var(--sd-primary),inset 0 -1px 0 var(--sd-primary)}.cdk-drag-placeholder.c-item>*{visibility:hidden}.c-item--picked{position:relative;z-index:2;border-radius:var(--sd-radius-4);background:var(--sd-surface);outline:1px solid var(--sd-primary);outline-offset:-1px;box-shadow:var(--sd-shadow-md)}.c-item--picked .c-handle{color:var(--sd-primary)}.cdk-drag-animating,.c-list.cdk-drop-list-dragging .c-item:not(.cdk-drag-placeholder){transition:transform .22s cubic-bezier(0,0,.2,1)}@media(prefers-reduced-motion:reduce){.c-handle,.cdk-drag-animating,.c-list.cdk-drop-list-dragging .c-item:not(.cdk-drag-placeholder){transition:none}}\n"], dependencies: [{ kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i1$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i1$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i1$1.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType", "indicator", "indicatorColor", "indicatorMax", "indicatorLabel"], outputs: ["click"] }, { kind: "component", type: SdCheckbox, selector: "sd-checkbox", inputs: ["autoId", "name", "form", "label", "color", "disabled", "size", "viewed", "inlineError", "model"], outputs: ["modelChange", "sdChange"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdInput, selector: "sd-input", inputs: ["autoId", "name", "appearance", "floatLabel", "labelPlacement", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "type", "mask", "inputmode", "autocomplete", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "minlength", "maxlength", "pattern", "patternErrorMessage", "validator", "inlineError", "hyperlink", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }, { kind: "component", type: SdModal, selector: "sd-modal", inputs: ["autoId", "title", "color", "width", "height", "view", "modalClass", "lazyLoadContent", "hideClose", "disableBackdropClose", "beforeClose"], outputs: ["sdClosed", "sdCloseError"] }, { kind: "directive", type: SdSuffixDefDirective, selector: "[sdSuffixDef]" }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
3143
3923
|
}
|
|
3144
3924
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: ConfigComponent, decorators: [{
|
|
3145
3925
|
type: Component,
|
|
3146
|
-
args: [{ changeDetection: ChangeDetectionStrategy.Eager, selector: 'config', standalone: true, imports: [
|
|
3147
|
-
|
|
3148
|
-
FormsModule,
|
|
3149
|
-
MatTableModule,
|
|
3150
|
-
CdkTableModule,
|
|
3151
|
-
DragDropModule,
|
|
3152
|
-
SdButton,
|
|
3153
|
-
SdCheckbox,
|
|
3154
|
-
SdIcon,
|
|
3155
|
-
SdInput,
|
|
3156
|
-
SdModal,
|
|
3157
|
-
SdTranslatePipe,
|
|
3158
|
-
], providers: [ConfigService], template: "@let _configuration = configuration();\n@let _autoId = autoId();\n@let _columns = ['invisible', 'title', 'width', 'fixed', 'truncate'];\n\n<sd-modal width=\"sm\" [title]=\"'core.component.table.setup' | sdTranslate\" #modal>\n @if (_configuration) {\n <div class=\"c-container sd-table-config\">\n <!-- why: drag handle l\u00E0 affordance duy nh\u1EA5t cho vi\u1EC7c \u0111\u1ED5i th\u1EE9 t\u1EF1 c\u1ED9t, v\u00E0 n\u00F3 kh\u00F4ng t\u1EF1 n\u00F3i ra\n \u0111i\u1EC1u \u0111\u00F3 \u2014 m\u1ED9t d\u00F2ng hint tr\u00E1nh vi\u1EC7c ng\u01B0\u1EDDi d\u00F9ng kh\u00F4ng bao gi\u1EDD ph\u00E1t hi\u1EC7n t\u00EDnh n\u0103ng.\n K\u00FD hi\u1EC7u \u283F n\u1EB1m S\u1EB4N trong chu\u1ED7i i18n (\u0111\u00FAng v\u1ECB tr\u00ED trong c\u00E2u), n\u00EAn kh\u00F4ng k\u00E8m icon ri\u00EAng. -->\n <p class=\"c-hint\">{{ 'core.component.table.config.drag-hint' | sdTranslate }}</p>\n\n <div class=\"c-table\">\n <table\n mat-table\n [dataSource]=\"_configuration.columns!\"\n cdkDropList\n [cdkDropListData]=\"_configuration.columns\"\n (cdkDropListDropped)=\"dropTable($event)\">\n <ng-container matColumnDef=\"invisible\">\n <th mat-header-cell class=\"c-th\" *matHeaderCellDef>\n {{ 'core.component.form-builder.display' | sdTranslate }}\n </th>\n <td mat-cell *matCellDef=\"let item\">\n <div class=\"c-display-cell\">\n <button\n type=\"button\"\n class=\"c-handle\"\n [title]=\"'core.component.table.config.drag-handle' | sdTranslate\"\n [attr.aria-label]=\"'core.component.table.config.drag-handle' | sdTranslate\"\n (mousedown)=\"handleMouseDown()\"\n (mouseup)=\"handleMouseUp()\">\n <sd-icon name=\"drag_indicator\" aria-hidden=\"true\"></sd-icon>\n </button>\n <!-- why: \u00F4 \"Hi\u1EC3n th\u1ECB\" KH\u00D4NG bao gi\u1EDD b\u1ECB kho\u00E1 \u2014 n\u00F3 l\u00E0 \u0111\u01B0\u1EDDng duy nh\u1EA5t \u0111\u1EC3 b\u1EADt l\u1EA1i m\u1ED9t\n c\u1ED9t \u0111\u00E3 t\u1EAFt. -->\n <sd-checkbox [model]=\"!item.invisible\" (modelChange)=\"item.invisible = !item.invisible\" />\n </div>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"title\">\n <th mat-header-cell class=\"c-th\" *matHeaderCellDef>\n {{ 'core.component.table.column-header' | sdTranslate }}\n </th>\n <td mat-cell *matCellDef=\"let item\">\n <sd-input\n size=\"sm\"\n [placeholder]=\"item?.origin?.title\"\n [(model)]=\"item.title\"\n [disabled]=\"isRowDisabled(item)\"\n hideInlineError></sd-input>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"width\">\n <th mat-header-cell class=\"c-th c-col-width\" *matHeaderCellDef>\n {{ 'core.component.table.width' | sdTranslate }}\n </th>\n <td mat-cell class=\"c-col-width\" *matCellDef=\"let item\">\n <sd-input\n size=\"sm\"\n [placeholder]=\"item?.origin?.width\"\n [(model)]=\"item.width\"\n [disabled]=\"isRowDisabled(item)\"\n hideInlineError></sd-input>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"fixed\">\n <th mat-header-cell class=\"c-th c-col-toggle\" *matHeaderCellDef>\n {{ 'core.component.table.fixed' | sdTranslate }}\n </th>\n <td mat-cell class=\"c-col-toggle\" *matCellDef=\"let item\">\n <sd-checkbox [(model)]=\"item.fixed\" [disabled]=\"isRowDisabled(item)\" />\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"truncate\">\n <th mat-header-cell class=\"c-th c-col-toggle\" *matHeaderCellDef>\n {{ 'core.component.table.char-limit' | sdTranslate }}\n </th>\n <td mat-cell class=\"c-col-toggle\" *matCellDef=\"let item\">\n <sd-checkbox [(model)]=\"item.truncate\" [disabled]=\"isRowDisabled(item)\" />\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"_columns; sticky: true\"></tr>\n <tr\n mat-row\n *matRowDef=\"let row; columns: _columns\"\n [class.c-row-hidden]=\"isRowDisabled(row)\"\n cdkDrag\n [cdkDragData]=\"row\"\n cdkDragLockAxis=\"y\"\n [cdkDragDisabled]=\"dragDisabled\">\n </tr>\n </table>\n </div>\n </div>\n }\n <ng-container sdFooterRight>\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-config-skip' : null\"\n (click)=\"close()\"\n [title]=\"'core.component.table.skip' | sdTranslate\"\n color=\"secondary\">\n </sd-button>\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-config-reset' : null\"\n (click)=\"onReset()\"\n [title]=\"'core.component.form-builder.default' | sdTranslate\"\n color=\"primary\">\n </sd-button>\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-config-apply' : null\"\n (click)=\"onSave()\"\n [title]=\"'core.component.table.apply' | sdTranslate\"\n type=\"fill\"\n color=\"primary\">\n </sd-button>\n </ng-container>\n</sd-modal>\n", styles: [".c-container{position:relative;min-height:200px}.c-hint{margin:0 0 12px;color:var(--sd-text-secondary, #6b7280);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-18, 18px)}.c-table{position:relative;overflow:auto;max-height:60vh;border:1px solid var(--sd-border, rgba(0, 0, 0, .08));border-radius:var(--sd-radius-8, 8px)}.c-table table{--mat-table-header-container-height: 40px;--mat-table-row-item-container-height: 48px;width:100%;background:transparent}.c-table .c-th{font-weight:var(--sd-font-weight-medium, 500);font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px);color:var(--sd-text-secondary, #6b7280);background:var(--sd-surface, #f7f8fa);white-space:nowrap}.c-table .mat-mdc-header-cell,.c-table .mat-mdc-cell{padding:4px 12px;vertical-align:middle;border-bottom-color:var(--sd-border, rgba(0, 0, 0, .08))}.c-table .mat-mdc-header-cell:first-of-type,.c-table .mat-mdc-cell:first-of-type{padding-left:12px}.c-table .mat-mdc-row:last-of-type .mat-mdc-cell{border-bottom:none}.c-table .mat-mdc-row:hover .mat-mdc-cell{background:var(--sd-surface, rgba(0, 0, 0, .02))}.c-table .c-col-width{width:104px}.c-table .c-col-toggle{width:88px;text-align:center}sd-checkbox{display:inline-flex;align-items:center;vertical-align:middle}sd-checkbox ::ng-deep .mat-mdc-checkbox{display:flex}sd-checkbox ::ng-deep .mat-internal-form-field{margin:0}sd-checkbox ::ng-deep .mat-mdc-checkbox .mdc-label{padding:0}.c-display-cell{display:flex;align-items:center;gap:8px}.c-handle{display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;background:none;color:var(--sd-text-disabled, #b6bcc6);cursor:grab;transition:color .15s ease}.c-handle:hover,.c-handle:focus-visible{color:var(--sd-text-secondary, #6b7280);outline:none}.c-handle:active{cursor:grabbing}.c-row-hidden .mat-mdc-cell{background:var(--sd-surface, rgba(0, 0, 0, .015))}.c-row-hidden sd-input,.c-row-hidden .c-col-toggle sd-checkbox{opacity:.55}.cdk-drag-preview{display:table;border-radius:var(--sd-radius-8, 8px);background:var(--sd-surface, #fff);outline:1px solid var(--sd-primary, #2a66f4);box-shadow:0 12px 28px #00000029,0 2px 8px #00000014;opacity:.98}.cdk-drag-preview .mat-mdc-cell{border-bottom:none;padding:4px 12px;vertical-align:middle}.cdk-drag-preview .c-handle{color:var(--sd-primary, #2a66f4);cursor:grabbing}.cdk-drag-placeholder .mat-mdc-cell{background:var(--sd-primary-light, rgba(42, 102, 244, .06));border-bottom:none;box-shadow:inset 0 1px 0 var(--sd-primary, #2a66f4),inset 0 -1px 0 var(--sd-primary, #2a66f4)}.cdk-drag-placeholder .mat-mdc-cell>*{visibility:hidden}.cdk-drag-animating,.c-table.cdk-drop-list-dragging .mat-mdc-row:not(.cdk-drag-placeholder){transition:transform .22s cubic-bezier(0,0,.2,1)}.c-table.cdk-drop-list-dragging .mat-mdc-row:hover .mat-mdc-cell{background:transparent}\n"] }]
|
|
3159
|
-
}], ctorParameters: () => [], propDecorators: { autoIdInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], tableOption: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableOption", required: false }] }], changes: [{ type: i0.Output, args: ["changes"] }], modal: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdModal), { isSignal: true }] }], table: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatTable), { isSignal: true }] }] } });
|
|
3926
|
+
args: [{ changeDetection: ChangeDetectionStrategy.Eager, selector: 'config', standalone: true, imports: [DragDropModule, SdButton, SdCheckbox, SdIcon, SdInput, SdModal, SdSuffixDefDirective, SdTranslatePipe], providers: [ConfigService], template: "@let _configuration = configuration();\n@let _autoId = autoId();\n@let _searching = searching();\n@let _expanded = expanded();\n\n<sd-modal width=\"sm\" [title]=\"'core.component.table.setup' | sdTranslate\" #modal>\n @if (_configuration) {\n <div class=\"c-container sd-table-config\">\n <div class=\"c-toolbar\">\n @if (searchable()) {\n <sd-input\n class=\"c-find\"\n size=\"sm\"\n hideInlineError\n [autoId]=\"_autoId ? _autoId + '-config-find' : null\"\n [placeholder]=\"'core.component.table.config.find-column' | sdTranslate\"\n [model]=\"query()\"\n (modelChange)=\"onFind($event)\">\n <ng-template sdSuffixDef>\n <sd-icon class=\"c-find-icon\" name=\"search\" size=\"18px\" aria-hidden=\"true\"></sd-icon>\n </ng-template>\n </sd-input>\n }\n <div class=\"c-toolbar-end\">\n <span class=\"c-shown-count\">\n {{ 'core.component.table.config.shown-count' | sdTranslate: { shown: shownCount(), total: totalCount() } }}\n </span>\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-config-show-all' : null\"\n type=\"text\"\n color=\"primary\"\n size=\"sm\"\n [title]=\"'core.component.table.config.show-all' | sdTranslate\"\n [disabled]=\"allShown()\"\n (click)=\"showAll()\">\n </sd-button>\n </div>\n </div>\n\n <!-- why: handle \u283F l\u00E0 c\u00E1ch duy nh\u1EA5t \u0111\u1EC3 \u0111\u1ED5i th\u1EE9 t\u1EF1 c\u1ED9t v\u00E0 t\u1EF1 n\u00F3 kh\u00F4ng n\u00F3i ra \u0111i\u1EC1u \u0111\u00F3 \u2014 d\u00F2ng g\u1EE3i \u00FD tr\u00E1nh vi\u1EC7c ng\u01B0\u1EDDi\n d\u00F9ng kh\u00F4ng bao gi\u1EDD ph\u00E1t hi\u1EC7n t\u00EDnh n\u0103ng. K\u00FD hi\u1EC7u \u283F n\u1EB1m s\u1EB5n trong chu\u1ED7i i18n n\u00EAn kh\u00F4ng k\u00E8m icon ri\u00EAng. -->\n <p class=\"c-hint\" [id]=\"hintId\">\n {{ (_searching ? 'core.component.table.config.drag-disabled-search' : 'core.component.table.config.drag-hint') | sdTranslate }}\n </p>\n\n <!-- why: v\u00F9ng live n\u1EB1m TRONG modal \u2014 v\u00F9ng n\u1EB1m ngo\u00E0i m\u1ED9t h\u1ED9p tho\u1EA1i aria-modal c\u00F3 th\u1EC3 b\u1ECB tr\u00ECnh \u0111\u1ECDc m\u00E0n h\u00ECnh b\u1ECF qua. -->\n <div class=\"c-live sd-visually-hidden\" aria-live=\"assertive\" aria-atomic=\"true\">{{ announcement() }}</div>\n\n <div\n class=\"c-list\"\n cdkDropList\n cdkDropListLockAxis=\"y\"\n [cdkDropListData]=\"columns()\"\n [cdkDropListDisabled]=\"_searching\"\n (cdkDropListDropped)=\"drop($event)\">\n @for (item of columns(); track item.origin.field) {\n @let _field = item.origin.field;\n @let _open = _expanded === _field;\n @let _hidden = isRowDisabled(item);\n @let _title = titleOf(item);\n <div\n class=\"c-item\"\n cdkDrag\n [cdkDragData]=\"item\"\n [attr.data-field]=\"_field\"\n [class.c-item--open]=\"_open\"\n [class.c-item--hidden]=\"_hidden\"\n [class.c-item--picked]=\"picked()?.field === _field\">\n <div class=\"c-row\">\n <button\n #handle\n type=\"button\"\n class=\"c-handle\"\n cdkDragHandle\n [disabled]=\"_searching\"\n [title]=\"'core.component.table.config.drag-handle' | sdTranslate\"\n [attr.aria-label]=\"('core.component.table.config.drag-handle' | sdTranslate) + ': ' + _title\"\n [attr.aria-describedby]=\"hintId\"\n (pointerdown)=\"onHandlePointerDown(_field)\"\n (keydown)=\"onHandleKeydown($event, _field)\"\n (blur)=\"onHandleBlur(_field)\">\n <sd-icon name=\"drag_indicator\" size=\"20px\" aria-hidden=\"true\"></sd-icon>\n </button>\n <!-- why: \u00F4 \"Hi\u1EC7n\" KH\u00D4NG bao gi\u1EDD b\u1ECB kho\u00E1 \u2014 n\u00F3 l\u00E0 \u0111\u01B0\u1EDDng duy nh\u1EA5t \u0111\u1EC3 b\u1EADt l\u1EA1i m\u1ED9t c\u1ED9t \u0111\u00E3 t\u1EAFt. Nh\u00E3n b\u1ECB \u1EA9n\n kh\u1ECFi m\u00E0n h\u00ECnh nh\u01B0ng v\u1EABn l\u00E0 t\u00EAn c\u1EE7a \u00F4 cho tr\u00ECnh \u0111\u1ECDc m\u00E0n h\u00ECnh. -->\n <sd-checkbox\n class=\"c-show\"\n [label]=\"('core.component.form-builder.display' | sdTranslate) + ': ' + _title\"\n [model]=\"!item.invisible\"\n (modelChange)=\"setShown(_field, !!$event)\">\n </sd-checkbox>\n <button\n type=\"button\"\n class=\"c-toggle\"\n [attr.aria-expanded]=\"_open\"\n [attr.aria-controls]=\"_open ? detailsId(_field) : null\"\n (click)=\"toggleRow(_field)\">\n <span class=\"c-title\">{{ _title }}</span>\n @if (!_hidden && item.fixed) {\n @let _fixedLabel = 'core.component.table.config.fixed-label' | sdTranslate;\n <sd-icon class=\"c-pin\" name=\"push_pin\" size=\"16px\" [title]=\"_fixedLabel\" [ariaLabel]=\"_fixedLabel\"></sd-icon>\n }\n @if (!_hidden && (item.truncate ?? item.origin.truncate)) {\n @let _truncateLabel = 'core.component.table.config.truncate-label' | sdTranslate;\n <sd-icon class=\"c-trunc\" name=\"short_text\" size=\"16px\" [title]=\"_truncateLabel\" [ariaLabel]=\"_truncateLabel\"></sd-icon>\n }\n <span class=\"c-width-meta\">{{ widthSummary(item) }}</span>\n <sd-icon class=\"c-chevron\" size=\"20px\" [name]=\"_open ? 'expand_less' : 'expand_more'\" aria-hidden=\"true\"></sd-icon>\n </button>\n </div>\n\n @if (_open) {\n <div class=\"c-details\" [id]=\"detailsId(_field)\">\n <div class=\"c-fields\">\n <div class=\"c-field-title\">\n <sd-input\n size=\"sm\"\n hideInlineError\n [label]=\"'core.component.table.column-header' | sdTranslate\"\n [placeholder]=\"item.origin.title\"\n [model]=\"item.title\"\n [disabled]=\"_hidden\"\n (modelChange)=\"setTitle(_field, $event)\">\n </sd-input>\n @if (renamed(item)) {\n <div class=\"c-origin\">\n {{ 'core.component.table.config.origin' | sdTranslate: { title: item.origin.title } }} \u00B7\n <button type=\"button\" class=\"c-restore\" [disabled]=\"_hidden\" (click)=\"restoreTitle(_field)\">\n {{ 'core.component.table.config.restore' | sdTranslate }}\n </button>\n </div>\n }\n </div>\n <div class=\"c-field-width\">\n @let _textWidth = widthIsText(item);\n <sd-input\n size=\"sm\"\n hideInlineError\n [type]=\"_textWidth ? 'text' : 'number'\"\n [label]=\"'core.component.table.width' | sdTranslate\"\n [placeholder]=\"widthPlaceholder(item)\"\n [model]=\"widthValue(item)\"\n [disabled]=\"_hidden\"\n (sdFocus)=\"onWidthFocus(item)\"\n (modelChange)=\"setWidth(_field, $event)\"\n (sdBlur)=\"commitWidth(_field)\">\n @if (!_textWidth) {\n <ng-template sdSuffixDef><span class=\"c-px\">px</span></ng-template>\n }\n </sd-input>\n </div>\n </div>\n <div class=\"c-checks\">\n <sd-checkbox\n class=\"c-fixed\"\n [label]=\"'core.component.table.config.fixed-label' | sdTranslate\"\n [model]=\"!!item.fixed\"\n [disabled]=\"_hidden\"\n (modelChange)=\"setFixed(_field, !!$event)\">\n </sd-checkbox>\n <div class=\"c-truncate-field\">\n <sd-checkbox\n class=\"c-truncate\"\n [label]=\"'core.component.table.config.truncate-label' | sdTranslate\"\n [model]=\"!!(item.truncate ?? item.origin.truncate)\"\n [disabled]=\"_hidden\"\n (modelChange)=\"setTruncate(_field, !!$event)\">\n </sd-checkbox>\n <span class=\"c-check-hint\">{{ 'core.component.table.config.truncate-hint' | sdTranslate }}</span>\n </div>\n </div>\n </div>\n }\n </div>\n }\n </div>\n </div>\n }\n <ng-container sdFooterLeft>\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-config-reset' : null\"\n type=\"text\"\n color=\"primary\"\n size=\"sm\"\n prefixIcon=\"restart_alt\"\n [title]=\"'core.component.table.config.reset' | sdTranslate\"\n (click)=\"onReset()\">\n </sd-button>\n </ng-container>\n <ng-container sdFooterRight>\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-config-skip' : null\"\n type=\"outline\"\n size=\"sm\"\n [title]=\"'core.component.table.skip' | sdTranslate\"\n (click)=\"close()\">\n </sd-button>\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-config-apply' : null\"\n type=\"fill\"\n color=\"primary\"\n size=\"sm\"\n [title]=\"'core.component.table.apply' | sdTranslate\"\n (click)=\"onSave()\">\n </sd-button>\n </ng-container>\n</sd-modal>\n", styles: [".c-container{position:relative;display:flex;flex-direction:column;gap:10px;min-height:200px}.c-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;min-height:32px}.c-find{flex:none;width:220px}.c-find-icon{color:var(--sd-text-secondary)}.c-toolbar-end{display:flex;align-items:center;gap:8px;margin-left:auto}.c-shown-count{color:var(--sd-text-secondary);font-size:var(--sd-font-size-13);font-variant-numeric:tabular-nums;white-space:nowrap}.c-hint{margin:0;color:var(--sd-text-secondary);font-size:var(--sd-font-size-12);line-height:var(--sd-line-height-18)}.c-list{overflow-x:hidden;overflow-y:auto;max-height:min(400px,50vh);border:1px solid var(--sd-border);border-radius:var(--sd-radius-8)}.c-item+.c-item{border-top:1px solid var(--sd-border)}.c-item--open{background:color-mix(in srgb,var(--sd-text) 4%,transparent)}.c-row{display:flex;align-items:center;gap:10px;box-sizing:border-box;height:44px;padding:0 8px 0 12px}.c-handle{position:relative;z-index:1;display:inline-flex;flex:none;align-items:center;justify-content:center;padding:0;border:0;border-radius:var(--sd-radius-4);background:none;color:var(--sd-disabled-text);cursor:grab;transition:color var(--sd-duration-fast) var(--sd-ease-standard)}.c-handle:hover:not(:disabled),.c-handle:focus-visible{color:var(--sd-text-secondary)}.c-handle:focus-visible{outline:2px solid var(--sd-focus-ring-color);outline-offset:2px}.c-handle:active:not(:disabled){cursor:grabbing}.c-handle:disabled{cursor:default;opacity:.5}sd-checkbox{display:inline-flex;align-items:center}sd-checkbox ::ng-deep .mat-mdc-checkbox{display:flex}sd-checkbox ::ng-deep .mat-internal-form-field{margin:0}.c-show{flex:none}.c-show ::ng-deep .mdc-checkbox{margin:0 -11px}.c-show ::ng-deep .mdc-label{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.c-toggle{position:relative;z-index:1;display:flex;flex:1;align-items:center;gap:8px;min-width:0;height:44px;padding:0 4px 0 2px;border:0;border-radius:var(--sd-radius-4);background:transparent;color:var(--sd-text);font:inherit;font-size:var(--sd-font-size-14);text-align:left;cursor:pointer}.c-toggle:focus-visible{outline:2px solid var(--sd-focus-ring-color);outline-offset:-2px}.c-toggle:hover .c-chevron{color:var(--sd-text)}.c-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.c-item--hidden .c-title{color:var(--sd-disabled-text)}@media(forced-colors:active){.c-item--hidden .c-title{color:GrayText}}.c-pin{flex:none;color:var(--sd-primary)}.c-trunc{flex:none;color:var(--sd-text-secondary)}.c-width-meta{flex:none;min-width:58px;color:var(--sd-text-secondary);font-size:var(--sd-font-size-12);font-variant-numeric:tabular-nums;text-align:right;white-space:nowrap}.c-chevron{flex:none;color:var(--sd-text-secondary)}.c-details{display:flex;flex-direction:column;gap:12px;padding:8px 16px 14px 62px}.c-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,112px);gap:12px;align-items:start}.c-origin{margin-top:4px;padding-left:2px;color:var(--sd-text-secondary);font-size:var(--sd-font-size-12);line-height:var(--sd-line-height-16)}.c-restore{padding:0;border:0;border-radius:var(--sd-radius-2);background:none;color:var(--sd-primary);font:inherit;font-weight:var(--sd-font-weight-medium);cursor:pointer}.c-restore:hover:not(:disabled){text-decoration:underline}.c-restore:focus-visible{outline:2px solid var(--sd-focus-ring-color);outline-offset:2px}.c-restore:disabled{color:var(--sd-disabled-text);cursor:default}.c-px{padding-right:8px;color:var(--sd-text-secondary);font-size:var(--sd-font-size-12)}.c-checks{display:flex;flex-wrap:wrap;gap:8px 24px}.c-truncate-field{display:flex;flex-direction:column}.c-check-hint{padding-left:40px;color:var(--sd-text-secondary);font-size:var(--sd-font-size-12);line-height:var(--sd-line-height-16)}.cdk-drag-preview.c-item{box-sizing:border-box;border-radius:var(--sd-radius-8);background:var(--sd-surface);outline:1px solid var(--sd-primary);box-shadow:var(--sd-shadow-lg);opacity:.98}.cdk-drag-preview.c-item .c-handle{color:var(--sd-primary);cursor:grabbing}.cdk-drag-placeholder.c-item{background:var(--sd-primary-light);box-shadow:inset 0 1px 0 var(--sd-primary),inset 0 -1px 0 var(--sd-primary)}.cdk-drag-placeholder.c-item>*{visibility:hidden}.c-item--picked{position:relative;z-index:2;border-radius:var(--sd-radius-4);background:var(--sd-surface);outline:1px solid var(--sd-primary);outline-offset:-1px;box-shadow:var(--sd-shadow-md)}.c-item--picked .c-handle{color:var(--sd-primary)}.cdk-drag-animating,.c-list.cdk-drop-list-dragging .c-item:not(.cdk-drag-placeholder){transition:transform .22s cubic-bezier(0,0,.2,1)}@media(prefers-reduced-motion:reduce){.c-handle,.cdk-drag-animating,.c-list.cdk-drop-list-dragging .c-item:not(.cdk-drag-placeholder){transition:none}}\n"] }]
|
|
3927
|
+
}], propDecorators: { autoIdInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], tableOption: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableOption", required: false }] }], changes: [{ type: i0.Output, args: ["changes"] }], defaultsRestored: [{ type: i0.Output, args: ["defaultsRestored"] }], modal: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdModal), { isSignal: true }] }], handles: [{ type: i0.ViewChildren, args: ['handle', { isSignal: true }] }] } });
|
|
3160
3928
|
|
|
3161
3929
|
class ToStringPipe {
|
|
3162
3930
|
transform(value) {
|
|
@@ -3865,6 +4633,10 @@ class SdColumnResizeDirective {
|
|
|
3865
4633
|
#onMouseup = () => {
|
|
3866
4634
|
const finalPx = `${Math.round(this.#currentWidth)}px`;
|
|
3867
4635
|
this.#cleanupDrag();
|
|
4636
|
+
// why: bấm vào tay nắm mà không đổi độ rộng thì không có gì để lưu — trước đây nó ghi độ rộng đang hiển thị (kể cả
|
|
4637
|
+
// cột auto / %) vào thiết lập của bảng.
|
|
4638
|
+
if (Math.round(this.#currentWidth) === Math.round(this.#startWidth))
|
|
4639
|
+
return;
|
|
3868
4640
|
// emit trong Angular zone để consumer chạy CD bình thường
|
|
3869
4641
|
this.#zone.run(() => this.resizeEnd.emit(finalPx));
|
|
3870
4642
|
};
|
|
@@ -4900,7 +5672,8 @@ const matchesColumnFilter = (data, columns = [], rawColumnFilter = {}, columnOpe
|
|
|
4900
5672
|
return true;
|
|
4901
5673
|
};
|
|
4902
5674
|
const filterLocalItems = (localItems, option, filterInfo) => {
|
|
4903
|
-
|
|
5675
|
+
// why: cột con của header nhóm mới có giá trị để lọc / sort; header nhóm thì không.
|
|
5676
|
+
const columns = leafColumns(option.columns);
|
|
4904
5677
|
const { rawColumnFilter, orderBy, orderDirection, pageSize, pageNumber } = filterInfo;
|
|
4905
5678
|
const quickSearch = option.filter?.disabled ? undefined : option.filter?.quickSearch;
|
|
4906
5679
|
const matchesData = (data) => matchesColumnFilter(data, columns, rawColumnFilter, filterInfo.columnOperator, option.dateTime) &&
|
|
@@ -5266,6 +6039,12 @@ class SdTableFilterService {
|
|
|
5266
6039
|
remove: () => {
|
|
5267
6040
|
activeFilterValue.set(this.#defaultValue(args));
|
|
5268
6041
|
},
|
|
6042
|
+
default: () => {
|
|
6043
|
+
const value = this.#defaultValue(args);
|
|
6044
|
+
// why: `#defaultValue` trả về chính object `args.columnOperator` (dùng chung với bảng) — tách ra để người
|
|
6045
|
+
// đọc không sửa nhầm vào đó.
|
|
6046
|
+
return { ...value, columnOperator: { ...value.columnOperator } };
|
|
6047
|
+
},
|
|
5269
6048
|
observer: activeFilterValue.observer.pipe(
|
|
5270
6049
|
// Sử dụng mặc định nếu bị reset
|
|
5271
6050
|
map(value => value || this.#defaultValue(args))),
|
|
@@ -5324,8 +6103,8 @@ class SdTableFilterService {
|
|
|
5324
6103
|
const externalFilter = {};
|
|
5325
6104
|
const columnOperator = args.columnOperator || {};
|
|
5326
6105
|
const { columns, externalFilters } = args;
|
|
5327
|
-
// Filter column
|
|
5328
|
-
for (const item of columns
|
|
6106
|
+
// Filter column — cột lá, kể cả cột con của header nhóm.
|
|
6107
|
+
for (const item of leafColumns(columns)) {
|
|
5329
6108
|
columnFilter[item.field] = item?.filter?.default;
|
|
5330
6109
|
if (item?.filter?.operator?.enable && item?.filter?.operator?.default) {
|
|
5331
6110
|
columnOperator[item.field] = item.filter.operator.default;
|
|
@@ -5368,8 +6147,8 @@ class SdTableFilterService {
|
|
|
5368
6147
|
const externalFilter = {};
|
|
5369
6148
|
const columnOperator = args.columnOperator || {};
|
|
5370
6149
|
const { columns, externalFilters } = args;
|
|
5371
|
-
// Filter column
|
|
5372
|
-
for (const item of columns
|
|
6150
|
+
// Filter column — cột lá, kể cả cột con của header nhóm.
|
|
6151
|
+
for (const item of leafColumns(columns)) {
|
|
5373
6152
|
// why: null is a deliberate cached clear from SD controls; only a missing key should fall back to default.
|
|
5374
6153
|
columnFilter[item.field] = this.#hasOwnValue(value?.columnFilter, item.field)
|
|
5375
6154
|
? value?.columnFilter?.[item.field]
|
|
@@ -5449,6 +6228,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
5449
6228
|
type: Input,
|
|
5450
6229
|
args: [{ required: true, alias: 'sdTableSortHeader' }]
|
|
5451
6230
|
}] } });
|
|
6231
|
+
/** A raw filter value that filters something — the rule of `#isFiltered`: a non-empty array, a range with an end, a value. */
|
|
6232
|
+
const isRawFilterSet = (value) => {
|
|
6233
|
+
if (Array.isArray(value))
|
|
6234
|
+
return value.length > 0;
|
|
6235
|
+
if (value && typeof value === 'object' && ('from' in value || 'to' in value)) {
|
|
6236
|
+
const range = value;
|
|
6237
|
+
return !!range.from || !!range.to;
|
|
6238
|
+
}
|
|
6239
|
+
return value !== undefined && value !== null && value !== '';
|
|
6240
|
+
};
|
|
6241
|
+
const isNoDataOperator = (operator) => operator === 'NULL' || operator === 'NOT_NULL';
|
|
5452
6242
|
class SdTablePaginatorIntl extends MatPaginatorIntl {
|
|
5453
6243
|
// i18n labels resolved at construction. Reads VI/EN from I18nService.
|
|
5454
6244
|
#i18n = inject(I18nService);
|
|
@@ -5539,6 +6329,16 @@ class SdTable {
|
|
|
5539
6329
|
isMobile = inject(SdViewportService).isMobile;
|
|
5540
6330
|
mobileCards = computed(() => this.isMobile() && !!this.sdRowMobileDef(), /* @ts-ignore */
|
|
5541
6331
|
...(ngDevMode ? [{ debugName: "mobileCards" }] : /* istanbul ignore next */ []));
|
|
6332
|
+
/**
|
|
6333
|
+
* The footer settings button carries a dot while the table uses a setup of its own: stored columns that differ from
|
|
6334
|
+
* the option (settings modal or a resize on the table) or inline external filters that differ from `defaultShowing`.
|
|
6335
|
+
*/
|
|
6336
|
+
hasCustomSetup = computed(() => sdTableHasCustomSetup({
|
|
6337
|
+
option: this.tableOption(),
|
|
6338
|
+
configuration: this.#configuredTable(),
|
|
6339
|
+
inlineExternal: this.#inlineExternalSetup(),
|
|
6340
|
+
}), /* @ts-ignore */
|
|
6341
|
+
...(ngDevMode ? [{ debugName: "hasCustomSetup" }] : /* istanbul ignore next */ []));
|
|
5542
6342
|
// ==========================================
|
|
5543
6343
|
// 3. COMPUTED FROM QUERIES
|
|
5544
6344
|
// ==========================================
|
|
@@ -5884,6 +6684,168 @@ class SdTable {
|
|
|
5884
6684
|
...(ngDevMode ? [{ debugName: "quickSearchValid" }] : /* istanbul ignore next */ []));
|
|
5885
6685
|
#filterRegisterRevision = signal(0, /* @ts-ignore */
|
|
5886
6686
|
...(ngDevMode ? [{ debugName: "#filterRegisterRevision" }] : /* istanbul ignore next */ []));
|
|
6687
|
+
// ==========================================
|
|
6688
|
+
// QUERY BAR (`filter.mode: 'query-bar'`) — một lớp hiển thị trên cùng TableFilterValue (handoff table-query-bar)
|
|
6689
|
+
// ==========================================
|
|
6690
|
+
/** `filter.mode` sau khi gộp `SD_TABLE_CONFIGURATION.filter.mode`. */
|
|
6691
|
+
filterMode = computed(() => this.tableOption()?.filter?.mode ?? 'default', /* @ts-ignore */
|
|
6692
|
+
...(ngDevMode ? [{ debugName: "filterMode" }] : /* istanbul ignore next */ []));
|
|
6693
|
+
/** Giao diện lọc đang hiển thị: mobile luôn dùng giao diện mặc định; giá trị lọc không đổi khi đổi viewport. */
|
|
6694
|
+
effectiveFilterMode = computed(() => (this.isMobile() ? 'default' : this.filterMode()), /* @ts-ignore */
|
|
6695
|
+
...(ngDevMode ? [{ debugName: "effectiveFilterMode" }] : /* istanbul ignore next */ []));
|
|
6696
|
+
/** Thanh query bar thay quick search, external filter và filter dưới cột. */
|
|
6697
|
+
queryBarMode = computed(() => this.effectiveFilterMode() === 'query-bar' && !this.tableOption()?.filter?.disabled, /* @ts-ignore */
|
|
6698
|
+
...(ngDevMode ? [{ debugName: "queryBarMode" }] : /* istanbul ignore next */ []));
|
|
6699
|
+
queryBar = viewChild(SdQueryBar, /* @ts-ignore */
|
|
6700
|
+
...(ngDevMode ? [{ debugName: "queryBar" }] : /* istanbul ignore next */ []));
|
|
6701
|
+
/** Chip trên thanh (nháp của thanh) và ô tìm — gắn hai chiều với `sd-query-bar`. */
|
|
6702
|
+
barFilters = signal([], /* @ts-ignore */
|
|
6703
|
+
...(ngDevMode ? [{ debugName: "barFilters" }] : /* istanbul ignore next */ []));
|
|
6704
|
+
barSearch = signal('', /* @ts-ignore */
|
|
6705
|
+
...(ngDevMode ? [{ debugName: "barSearch" }] : /* istanbul ignore next */ []));
|
|
6706
|
+
queryBarHintId = `sd-table-${Utilities.generateUuid()}-query-bar-hint`;
|
|
6707
|
+
/** Giá trị lọc đã áp dụng, theo lần phát gần nhất của filter register. */
|
|
6708
|
+
#appliedFilter = signal(undefined, /* @ts-ignore */
|
|
6709
|
+
...(ngDevMode ? [{ debugName: "#appliedFilter" }] : /* istanbul ignore next */ []));
|
|
6710
|
+
#inlineExternal = signal({}, /* @ts-ignore */
|
|
6711
|
+
...(ngDevMode ? [{ debugName: "#inlineExternal" }] : /* istanbul ignore next */ []));
|
|
6712
|
+
// why: tách khỏi #inlineExternal (mặc định {}) — trước khi filter register phát lần đầu thì chưa biết, không được
|
|
6713
|
+
// coi là "khác defaultShowing" mà bật chấm trên nút Thiết lập.
|
|
6714
|
+
#inlineExternalSetup = signal(undefined, /* @ts-ignore */
|
|
6715
|
+
...(ngDevMode ? [{ debugName: "#inlineExternalSetup" }] : /* istanbul ignore next */ []));
|
|
6716
|
+
/** Column setup the table reads from storage; the settings button dot compares it with the option. */
|
|
6717
|
+
#configuredTable = signal(undefined, /* @ts-ignore */
|
|
6718
|
+
...(ngDevMode ? [{ debugName: "#configuredTable" }] : /* istanbul ignore next */ []));
|
|
6719
|
+
#configStorage;
|
|
6720
|
+
#filterConfigurationSubscription;
|
|
6721
|
+
/** Chip dựng từ giá trị đã áp dụng ở lần đồng bộ trước — để phân biệt nháp với giá trị đã áp dụng. */
|
|
6722
|
+
#barDerived = [];
|
|
6723
|
+
/** Mảng ghi vào `barFilters` lần cuối; khác mảng đang có nghĩa là người dùng đã sửa thanh. */
|
|
6724
|
+
#barWritten = this.barFilters();
|
|
6725
|
+
#barTerm;
|
|
6726
|
+
#barActive = false;
|
|
6727
|
+
#barPending = false;
|
|
6728
|
+
#barApplying = false;
|
|
6729
|
+
/** The last bar apply left out the search text being typed (a chip change): keep that text in the box. */
|
|
6730
|
+
#barKeepSearch = false;
|
|
6731
|
+
#barWarned = false;
|
|
6732
|
+
/** Cột bị ẩn qua cấu hình mà vẫn còn giá trị lọc: chip của nó ở lại thanh tới khi bị xoá. */
|
|
6733
|
+
#hiddenFilteredColumns = computed(() => {
|
|
6734
|
+
const config = this.configuration();
|
|
6735
|
+
const value = this.#appliedFilter();
|
|
6736
|
+
const option = this.tableOption();
|
|
6737
|
+
if (!config || !value || !option || !this.queryBarMode())
|
|
6738
|
+
return [];
|
|
6739
|
+
const shown = new Set(leafColumns([...config.firstColumns, ...config.secondColumns]).map(column => column.field));
|
|
6740
|
+
return leafColumns(option.columns)
|
|
6741
|
+
.filter(column => !column.hidden &&
|
|
6742
|
+
!shown.has(column.field) &&
|
|
6743
|
+
(isRawFilterSet(value.columnFilter?.[column.field]) || isNoDataOperator(value.columnOperator?.[column.field])))
|
|
6744
|
+
.map(column => column.field);
|
|
6745
|
+
}, { ...(ngDevMode ? { debugName: "#hiddenFilteredColumns" } : /* istanbul ignore next */ {}), equal: (a, b) => a.length === b.length && a.every((field, index) => field === b[index]) });
|
|
6746
|
+
/** Field của thanh và bảng tra nguồn; `undefined` khi không ở mode query-bar. */
|
|
6747
|
+
queryBarModel = computed(() => {
|
|
6748
|
+
if (!this.queryBarMode())
|
|
6749
|
+
return undefined;
|
|
6750
|
+
const option = this.tableOption();
|
|
6751
|
+
const config = this.configuration();
|
|
6752
|
+
if (!option || !config)
|
|
6753
|
+
return undefined;
|
|
6754
|
+
this.#filterRegisterRevision();
|
|
6755
|
+
const filter = option.filter ?? {};
|
|
6756
|
+
const hidden = new Set(this.#hiddenFilteredColumns());
|
|
6757
|
+
const fields = sdTableQueryFields({
|
|
6758
|
+
columns: [...config.firstColumns, ...leafColumns(option.columns).filter(column => hidden.has(column.field))],
|
|
6759
|
+
externalFilters: filter.externalFilters,
|
|
6760
|
+
quickSearch: this.quickSearchOption(),
|
|
6761
|
+
inlineExternal: this.#inlineExternal(),
|
|
6762
|
+
queryBar: filter.queryBar,
|
|
6763
|
+
hideColumns: filter.hideInlineFilter === true,
|
|
6764
|
+
labels: {
|
|
6765
|
+
filters: this.#i18n.t('core.component.table.query-bar.filters'),
|
|
6766
|
+
columns: this.#i18n.t('core.component.table.query-bar.columns'),
|
|
6767
|
+
},
|
|
6768
|
+
filterDefs: this.sdFilterDefs().map(def => def.sdTableFilterDef()),
|
|
6769
|
+
cacheValues: this.cacheValues,
|
|
6770
|
+
});
|
|
6771
|
+
return { ...fields, defaultColumnOperator: untracked(() => this.filterRegister?.value.default?.().columnOperator) };
|
|
6772
|
+
}, /* @ts-ignore */
|
|
6773
|
+
...(ngDevMode ? [{ debugName: "queryBarModel" }] : /* istanbul ignore next */ []));
|
|
6774
|
+
/** Giá trị đã áp dụng khác default (so trên các field của thanh) — bật nút Xoá lọc. */
|
|
6775
|
+
#queryBarDirty = computed(() => {
|
|
6776
|
+
const ctx = this.queryBarModel();
|
|
6777
|
+
const value = this.#appliedFilter();
|
|
6778
|
+
const defaults = this.filterRegister?.value.default?.();
|
|
6779
|
+
if (!ctx || !value || !defaults)
|
|
6780
|
+
return false;
|
|
6781
|
+
const snapshot = (input) => {
|
|
6782
|
+
const query = tableFilterToQuery(input, ctx);
|
|
6783
|
+
return Utilities.canonicalStringify({
|
|
6784
|
+
filters: query.filters.map(filter => [filter.field, filter.operator, filter.data]),
|
|
6785
|
+
search: query.search ?? '',
|
|
6786
|
+
});
|
|
6787
|
+
};
|
|
6788
|
+
return snapshot(value) !== snapshot(defaults);
|
|
6789
|
+
}, /* @ts-ignore */
|
|
6790
|
+
...(ngDevMode ? [{ debugName: "#queryBarDirty" }] : /* istanbul ignore next */ []));
|
|
6791
|
+
queryBarOption = computed(() => {
|
|
6792
|
+
const ctx = this.queryBarModel();
|
|
6793
|
+
const filter = this.tableOption()?.filter;
|
|
6794
|
+
if (!ctx || !filter)
|
|
6795
|
+
return undefined;
|
|
6796
|
+
const autoId = this.autoId();
|
|
6797
|
+
return {
|
|
6798
|
+
autoId: autoId ? `${autoId}-query-bar` : undefined,
|
|
6799
|
+
fields: ctx.fields,
|
|
6800
|
+
mode: filter.queryBar?.editor ?? 'popover',
|
|
6801
|
+
density: 'compact',
|
|
6802
|
+
showSearch: ctx.search,
|
|
6803
|
+
searchPlaceholder: this.quickSearchOption()?.placeholder,
|
|
6804
|
+
showOperatorOnChip: 'auto',
|
|
6805
|
+
applyOn: filter.manualFilter ? 'search' : 'commit',
|
|
6806
|
+
appearance: 'flush',
|
|
6807
|
+
onClearAll: this.#clearQueryBar,
|
|
6808
|
+
clearDisabled: !this.#queryBarDirty(),
|
|
6809
|
+
invalidHintId: this.queryBarHintId,
|
|
6810
|
+
};
|
|
6811
|
+
}, /* @ts-ignore */
|
|
6812
|
+
...(ngDevMode ? [{ debugName: "queryBarOption" }] : /* istanbul ignore next */ []));
|
|
6813
|
+
/** Khoá thanh của các field đang lọc theo giá trị đã áp dụng — icon lọc ở header của chúng luôn hiện. */
|
|
6814
|
+
queryBarActiveKeys = computed(() => {
|
|
6815
|
+
const ctx = this.queryBarModel();
|
|
6816
|
+
const value = this.#appliedFilter();
|
|
6817
|
+
return ctx && value ? sdTableActiveQueryKeys(value, ctx) : new Set();
|
|
6818
|
+
}, /* @ts-ignore */
|
|
6819
|
+
...(ngDevMode ? [{ debugName: "queryBarActiveKeys" }] : /* istanbul ignore next */ []));
|
|
6820
|
+
/** `aria-label` của icon lọc ở header: "Lọc theo …" / "Đang lọc theo …". */
|
|
6821
|
+
filterTriggerLabel(column, active) {
|
|
6822
|
+
const title = typeof column.title === 'string' ? column.title : column.title?.title || column.field;
|
|
6823
|
+
return this.#i18n.t(active ? 'core.component.table.filtering-by' : 'core.component.table.filter-by', { title });
|
|
6824
|
+
}
|
|
6825
|
+
/** Icon lọc ở header: mở chip của field trên thanh (tạo chip nếu chưa có); đóng popover thì focus về icon. */
|
|
6826
|
+
openQueryBarField(key, trigger) {
|
|
6827
|
+
this.queryBar()?.openField(key, trigger instanceof HTMLElement ? trigger : undefined);
|
|
6828
|
+
}
|
|
6829
|
+
/** Dòng nhắc dưới thanh: field bắt buộc còn rỗng, kể cả quick filter bị ẩn (vẫn chặn đọc). */
|
|
6830
|
+
queryBarHint = computed(() => {
|
|
6831
|
+
const labels = (this.queryBar()?.invalidFields() ?? []).map(field => field.label);
|
|
6832
|
+
const value = this.quickSearchValue();
|
|
6833
|
+
for (const item of this.quickSearchOption()?.filters ?? []) {
|
|
6834
|
+
const hidden = isSignal(item.hidden) ? item.hidden() : item.hidden;
|
|
6835
|
+
if (item.required && hidden && !hasQuickSearchValue(value.filters?.[item.field]))
|
|
6836
|
+
labels.push(item.title);
|
|
6837
|
+
}
|
|
6838
|
+
// why: external bắt buộc mà thanh không hiện được (custom, filterDef, exclude…) vẫn chặn đọc — phải nói ra.
|
|
6839
|
+
const sources = this.queryBarModel()?.sources;
|
|
6840
|
+
const external = this.#appliedFilter()?.externalFilter;
|
|
6841
|
+
for (const item of this.tableOption()?.filter?.externalFilters ?? []) {
|
|
6842
|
+
if (item.required && sources && !sources.has(`external:${item.field}`) && !isRawFilterSet(external?.[item.field])) {
|
|
6843
|
+
labels.push(item.title);
|
|
6844
|
+
}
|
|
6845
|
+
}
|
|
6846
|
+
return labels.length ? this.#i18n.t('core.component.query-bar.required', { label: labels.join(', ') }) : '';
|
|
6847
|
+
}, /* @ts-ignore */
|
|
6848
|
+
...(ngDevMode ? [{ debugName: "queryBarHint" }] : /* istanbul ignore next */ []));
|
|
5887
6849
|
key = Utilities.generateUuid();
|
|
5888
6850
|
columnOperator = {};
|
|
5889
6851
|
columnFilter = {};
|
|
@@ -6089,8 +7051,10 @@ class SdTable {
|
|
|
6089
7051
|
this.tableOption.set(initOpt);
|
|
6090
7052
|
this.#loadCompleted = false;
|
|
6091
7053
|
const storage = this.#configService.init(initOpt);
|
|
7054
|
+
this.#configStorage = storage;
|
|
6092
7055
|
this.#configurationSubscription?.unsubscribe();
|
|
6093
7056
|
this.#configurationSubscription = storage.observer.subscribe(configuration => {
|
|
7057
|
+
this.#configuredTable.set(configuration);
|
|
6094
7058
|
const configurationRevision = ++this.#configurationRevision;
|
|
6095
7059
|
const valid = () => !this.#destroyed &&
|
|
6096
7060
|
optionRevision === this.#optionRevision &&
|
|
@@ -6121,6 +7085,39 @@ class SdTable {
|
|
|
6121
7085
|
this.filterRegister.value.set({ quickSearch: { ...current, filters } });
|
|
6122
7086
|
});
|
|
6123
7087
|
});
|
|
7088
|
+
// Query bar: field đổi (cột, inlineExternal, ngôn ngữ) thì đồng bộ lại; vừa vào mode (desktop) thì dựng lại từ raw.
|
|
7089
|
+
effect(() => {
|
|
7090
|
+
const ctx = this.queryBarModel();
|
|
7091
|
+
untracked(() => {
|
|
7092
|
+
if (!ctx) {
|
|
7093
|
+
this.#barActive = false;
|
|
7094
|
+
return;
|
|
7095
|
+
}
|
|
7096
|
+
if (!this.filterRegister)
|
|
7097
|
+
return;
|
|
7098
|
+
const rebuild = !this.#barActive;
|
|
7099
|
+
this.#barActive = true;
|
|
7100
|
+
this.#syncQueryBar(this.filterRegister.value.get(), rebuild);
|
|
7101
|
+
});
|
|
7102
|
+
});
|
|
7103
|
+
// Query bar: raw đổi trong lúc popover đang mở / chip đang dựng thì hoãn; đóng xong mới đồng bộ.
|
|
7104
|
+
effect(() => {
|
|
7105
|
+
const bar = this.queryBar();
|
|
7106
|
+
if (bar && (bar.editingIndex() !== null || bar.building()))
|
|
7107
|
+
return;
|
|
7108
|
+
untracked(() => {
|
|
7109
|
+
if (this.#barPending && this.filterRegister)
|
|
7110
|
+
this.#syncQueryBar(this.filterRegister.value.get(), false);
|
|
7111
|
+
});
|
|
7112
|
+
});
|
|
7113
|
+
// Query bar: field không lên được thanh vẫn gửi giá trị — báo cho dev một lần mỗi bảng.
|
|
7114
|
+
effect(() => {
|
|
7115
|
+
const excluded = this.queryBarModel()?.excluded;
|
|
7116
|
+
if (!excluded?.length || this.#barWarned || !isDevMode())
|
|
7117
|
+
return;
|
|
7118
|
+
this.#barWarned = true;
|
|
7119
|
+
console.warn('[sd-table] filter.mode "query-bar": these filters are not on the query bar. Their values are still sent; keep filter.mode "default" if users must edit them.', excluded);
|
|
7120
|
+
});
|
|
6124
7121
|
effect(onCleanup => {
|
|
6125
7122
|
const paginator = this.paginator();
|
|
6126
7123
|
if (paginator) {
|
|
@@ -6158,6 +7155,8 @@ class SdTable {
|
|
|
6158
7155
|
items.forEach((item, idx) => this.#itemIndexMap.set(item, idx));
|
|
6159
7156
|
});
|
|
6160
7157
|
this.#subscription.add(this.#configService.widthChange$.subscribe(({ field, width }) => {
|
|
7158
|
+
// why: persistColumnWidth ghi storage im lặng (observer không phát) nên đọc lại để chấm trên nút Thiết lập bật.
|
|
7159
|
+
this.#configuredTable.set(this.#configStorage?.get());
|
|
6161
7160
|
// Update configuration signal local — KHÔNG gọi loadValues/reload
|
|
6162
7161
|
const conf = this.configuration();
|
|
6163
7162
|
if (!conf)
|
|
@@ -6344,8 +7343,20 @@ class SdTable {
|
|
|
6344
7343
|
this.#configurationSubscription = undefined;
|
|
6345
7344
|
this.#filterRegisterSubscription?.unsubscribe();
|
|
6346
7345
|
this.#filterRegisterSubscription = undefined;
|
|
7346
|
+
this.#filterConfigurationSubscription?.unsubscribe();
|
|
7347
|
+
this.#filterConfigurationSubscription = undefined;
|
|
6347
7348
|
this.filterRegister = undefined;
|
|
6348
7349
|
this.quickSearchValue.set({ term: '', filters: {} });
|
|
7350
|
+
this.#appliedFilter.set(undefined);
|
|
7351
|
+
this.#inlineExternal.set({});
|
|
7352
|
+
this.#inlineExternalSetup.set(undefined);
|
|
7353
|
+
this.#barDerived = [];
|
|
7354
|
+
this.barFilters.set([]);
|
|
7355
|
+
this.#barWritten = this.barFilters();
|
|
7356
|
+
this.barSearch.set('');
|
|
7357
|
+
this.#barTerm = undefined;
|
|
7358
|
+
this.#barActive = false;
|
|
7359
|
+
this.#barPending = false;
|
|
6349
7360
|
this.#tableId = Utilities.generateUuid();
|
|
6350
7361
|
this.key = Utilities.generateUuid();
|
|
6351
7362
|
this.#loadCompleted = false;
|
|
@@ -6400,7 +7411,14 @@ class SdTable {
|
|
|
6400
7411
|
option.filter.manualFilter = option?.filter?.manualFilter ?? this.tableConfiguration?.filter?.manualFilter;
|
|
6401
7412
|
option.filter.hideExternalFilterToolbar =
|
|
6402
7413
|
option?.filter?.hideExternalFilterToolbar ?? this.tableConfiguration?.filter?.hideExternalFilterToolbar;
|
|
6403
|
-
|
|
7414
|
+
// why: chỉ ghi khi configuration có giá trị — bảng không dùng mode mới giữ nguyên object filter của consumer.
|
|
7415
|
+
const filterConfiguration = this.tableConfiguration?.filter;
|
|
7416
|
+
if (option.filter.mode === undefined && filterConfiguration?.mode)
|
|
7417
|
+
option.filter.mode = filterConfiguration.mode;
|
|
7418
|
+
if (filterConfiguration?.queryBar)
|
|
7419
|
+
option.filter.queryBar = { ...filterConfiguration.queryBar, ...option.filter.queryBar };
|
|
7420
|
+
// why: cột con của header nhóm cũng có filter và operator riêng.
|
|
7421
|
+
for (const column of leafColumns(option.columns)) {
|
|
6404
7422
|
if (column.filter?.operator?.enable) {
|
|
6405
7423
|
if (!column.filter?.operator?.list?.length) {
|
|
6406
7424
|
column.filter.operator.list = this.tableConfiguration?.filter?.operator?.list?.[column.type] || [];
|
|
@@ -6431,7 +7449,8 @@ class SdTable {
|
|
|
6431
7449
|
// why: lookup cũ có thể hoàn tất sau cấu hình/scope mới; chỉ commit cache của lần hydrate còn hiệu lực.
|
|
6432
7450
|
const values = cloneReadRequest(this.cacheValues);
|
|
6433
7451
|
const objectValues = cloneReadRequest(this.#cacheObjValues);
|
|
6434
|
-
|
|
7452
|
+
// why: cột lá — cột `values` nằm dưới header nhóm (`type: 'children'`) cũng cần danh sách để hiện nhãn và để lọc.
|
|
7453
|
+
await this.#tableFormatService.loadValues(leafColumns(option.columns).filter(column => result.displayedColumns.includes(column.field)), values, objectValues);
|
|
6435
7454
|
if (!valid())
|
|
6436
7455
|
return;
|
|
6437
7456
|
this.cacheValues = values;
|
|
@@ -6472,11 +7491,22 @@ class SdTable {
|
|
|
6472
7491
|
columnOperator: this.columnOperator,
|
|
6473
7492
|
force: true,
|
|
6474
7493
|
});
|
|
7494
|
+
// Query bar: chip ghim theo inlineExternal (người dùng đổi ở mode default). Đăng ký trước value để lần đồng bộ đầu
|
|
7495
|
+
// đã có giá trị này.
|
|
7496
|
+
this.#filterConfigurationSubscription?.unsubscribe();
|
|
7497
|
+
this.#filterConfigurationSubscription = this.filterRegister.configuration.observer.subscribe(configuration => {
|
|
7498
|
+
this.#inlineExternal.set(configuration.inlineExternal || {});
|
|
7499
|
+
this.#inlineExternalSetup.set(configuration.inlineExternal || {});
|
|
7500
|
+
});
|
|
7501
|
+
this.#subscription.add(this.#filterConfigurationSubscription);
|
|
6475
7502
|
this.#filterRegisterSubscription?.unsubscribe();
|
|
6476
7503
|
this.#filterRegisterSubscription = this.filterRegister.value.observer.subscribe(value => {
|
|
6477
7504
|
this.quickSearchValue.set(value.quickSearch || { term: '', filters: {} });
|
|
6478
7505
|
this.columnOperator = value.columnOperator || {};
|
|
6479
7506
|
this.#syncColumnFilterInPlace(value.columnFilter || {});
|
|
7507
|
+
this.#appliedFilter.set(value);
|
|
7508
|
+
// why: lần phát do thanh áp dụng thì dựng lại thanh từ raw (nháp đã nằm trong raw); lần phát từ ngoài thì giữ nháp.
|
|
7509
|
+
this.#syncQueryBar(value, this.#barApplying);
|
|
6480
7510
|
// why: hydrate ban đầu và onFilter chuẩn bị chính request hiện tại; không phát lịch đọc tự hủy nhánh đang chờ render.
|
|
6481
7511
|
if (!this.#configurationReady)
|
|
6482
7512
|
return;
|
|
@@ -6582,6 +7612,15 @@ class SdTable {
|
|
|
6582
7612
|
}
|
|
6583
7613
|
return false;
|
|
6584
7614
|
};
|
|
7615
|
+
/**
|
|
7616
|
+
* External filter `required` có giá trị chưa. Mode default đọc form của `ExternalFilterComponent` như trước; mode
|
|
7617
|
+
* query-bar không có form đó nên kiểm tra trên giá trị đã áp dụng.
|
|
7618
|
+
*/
|
|
7619
|
+
#externalFilterValid = (filterReq) => {
|
|
7620
|
+
if (!this.queryBarMode())
|
|
7621
|
+
return !this.externalFilter()?.form?.invalid;
|
|
7622
|
+
return (this.tableOption()?.filter?.externalFilters ?? []).every(item => !item.required || isRawFilterSet(filterReq.rawExternalFilter?.[item.field]));
|
|
7623
|
+
};
|
|
6585
7624
|
#checkFilter = (filterReq) => {
|
|
6586
7625
|
this.isFiltered.set(this.#isFiltered(filterReq));
|
|
6587
7626
|
this.requireFiltered.set(!!this.tableOption()?.filter?.externalFilters?.some(e => e.required) || !this.quickSearchValid());
|
|
@@ -6605,7 +7644,7 @@ class SdTable {
|
|
|
6605
7644
|
try {
|
|
6606
7645
|
try {
|
|
6607
7646
|
onFilter?.(filterReq, {
|
|
6608
|
-
externalFilterValid:
|
|
7647
|
+
externalFilterValid: this.#externalFilterValid(filterReq),
|
|
6609
7648
|
quickSearchValid: validQuickSearch,
|
|
6610
7649
|
});
|
|
6611
7650
|
}
|
|
@@ -6622,7 +7661,7 @@ class SdTable {
|
|
|
6622
7661
|
// why: onFilter có thể hydrate tenant/filter từ URL trước khi chụp snapshot; kiểm tra giá trị đã áp dụng.
|
|
6623
7662
|
validQuickSearch = quickSearchValid(this.quickSearchOption(), filterReq.quickSearch);
|
|
6624
7663
|
this.#checkFilter(filterReq);
|
|
6625
|
-
if (this
|
|
7664
|
+
if (!this.#externalFilterValid(filterReq) || !validQuickSearch) {
|
|
6626
7665
|
this.#read.invalidate();
|
|
6627
7666
|
this.#failedRead = undefined;
|
|
6628
7667
|
this.loading.set(false);
|
|
@@ -7067,6 +8106,105 @@ class SdTable {
|
|
|
7067
8106
|
onQuickSearchChange = (value) => {
|
|
7068
8107
|
this.filterRegister.value.set({ quickSearch: value });
|
|
7069
8108
|
};
|
|
8109
|
+
/**
|
|
8110
|
+
* Query bar `(apply)`: ghi cả thanh vào filter register trong một lần `value.set`, rồi gọi callback của các filter
|
|
8111
|
+
* vừa đổi như control mặc định. Reload, cache, `filtered` đi đường cũ.
|
|
8112
|
+
*/
|
|
8113
|
+
onQueryBarApply = (query) => {
|
|
8114
|
+
const ctx = this.queryBarModel();
|
|
8115
|
+
if (!ctx || !this.filterRegister)
|
|
8116
|
+
return;
|
|
8117
|
+
const current = this.filterRegister.value.get();
|
|
8118
|
+
// why: lần áp dụng do đổi chip bỏ qua chữ đang gõ dở trong ô tìm (thanh gửi từ khoá cũ) — giữ từ khoá đã áp dụng, như
|
|
8119
|
+
// quick search ở mode mặc định, và để nguyên chữ đang gõ trong ô.
|
|
8120
|
+
const typing = ctx.search && (query.search ?? '') !== untracked(() => this.barSearch());
|
|
8121
|
+
const applied = typing ? { ...query, search: current.quickSearch?.term ?? '' } : query;
|
|
8122
|
+
const { patch, changed } = queryToTableFilter(applied, ctx, current);
|
|
8123
|
+
const termChanged = (patch.quickSearch?.term ?? '') !== (current.quickSearch?.term ?? '');
|
|
8124
|
+
// why: như column-filter — đổi toán tử của cột đang trống (không phải NULL / NOT_NULL) chỉ lưu, không đọc lại.
|
|
8125
|
+
const silent = !termChanged &&
|
|
8126
|
+
changed.length > 0 &&
|
|
8127
|
+
changed.every(change => {
|
|
8128
|
+
const field = ctx.sources.get(change.key)?.field ?? '';
|
|
8129
|
+
return (!change.valueChanged &&
|
|
8130
|
+
!isNoDataOperator(change.operator) &&
|
|
8131
|
+
!isNoDataOperator(current.columnOperator?.[field]) &&
|
|
8132
|
+
!isRawFilterSet(change.value));
|
|
8133
|
+
});
|
|
8134
|
+
this.#barApplying = true;
|
|
8135
|
+
this.#barKeepSearch = !!typing;
|
|
8136
|
+
try {
|
|
8137
|
+
this.filterRegister.value.set(silent ? { ...patch, notReload: true } : patch);
|
|
8138
|
+
}
|
|
8139
|
+
finally {
|
|
8140
|
+
this.#barApplying = false;
|
|
8141
|
+
this.#barKeepSearch = false;
|
|
8142
|
+
}
|
|
8143
|
+
this.#runQueryBarCallbacks(changed, ctx);
|
|
8144
|
+
};
|
|
8145
|
+
/** `filter.onChange` / `operatorChange` của cột, `onChange` của external và quick filter — chỉ khi người dùng đổi. */
|
|
8146
|
+
#runQueryBarCallbacks = (changed, ctx) => {
|
|
8147
|
+
const filter = this.tableOption()?.filter;
|
|
8148
|
+
for (const change of changed) {
|
|
8149
|
+
const source = ctx.sources.get(change.key);
|
|
8150
|
+
if (!source)
|
|
8151
|
+
continue;
|
|
8152
|
+
if (source.column) {
|
|
8153
|
+
if (change.operator)
|
|
8154
|
+
filter?.operatorChange?.(source.column, change.operator);
|
|
8155
|
+
if (change.valueChanged)
|
|
8156
|
+
source.column.filter?.onChange?.(change.value, source.column, this.columnFilter);
|
|
8157
|
+
}
|
|
8158
|
+
else if (change.valueChanged) {
|
|
8159
|
+
if (source.external)
|
|
8160
|
+
source.external.onChange?.(change.value);
|
|
8161
|
+
else
|
|
8162
|
+
source.quick?.onChange?.(change.value);
|
|
8163
|
+
}
|
|
8164
|
+
}
|
|
8165
|
+
};
|
|
8166
|
+
/** Nút Xoá lọc của thanh: về giá trị default như nút xoá của external filter, đọc lại một lần. */
|
|
8167
|
+
#clearQueryBar = () => {
|
|
8168
|
+
if (!this.filterRegister)
|
|
8169
|
+
return;
|
|
8170
|
+
this.#barApplying = true;
|
|
8171
|
+
try {
|
|
8172
|
+
this.clearFilter();
|
|
8173
|
+
}
|
|
8174
|
+
finally {
|
|
8175
|
+
this.#barApplying = false;
|
|
8176
|
+
}
|
|
8177
|
+
this.tableOption()?.filter?.onClearFilter?.();
|
|
8178
|
+
};
|
|
8179
|
+
/**
|
|
8180
|
+
* Raw → thanh. Không đặt lại `barFilters` khi kết quả y hệt (chip giữ identity, không vòng lặp: thanh chỉ phát
|
|
8181
|
+
* `apply` khi người dùng thao tác). Đang mở popover / dựng chip thì hoãn tới khi đóng.
|
|
8182
|
+
*/
|
|
8183
|
+
#syncQueryBar = (value, rebuild) => {
|
|
8184
|
+
const ctx = untracked(() => this.queryBarModel());
|
|
8185
|
+
if (!ctx)
|
|
8186
|
+
return;
|
|
8187
|
+
const bar = untracked(() => this.queryBar());
|
|
8188
|
+
if (bar && untracked(() => bar.editingIndex() !== null || !!bar.building())) {
|
|
8189
|
+
this.#barPending = true;
|
|
8190
|
+
return;
|
|
8191
|
+
}
|
|
8192
|
+
this.#barPending = false;
|
|
8193
|
+
const draft = untracked(() => this.barFilters());
|
|
8194
|
+
const derived = tableFilterToQuery(value, ctx, draft).filters;
|
|
8195
|
+
// why: thanh còn nháp (manualFilter, hoặc chip sửa trong lúc raw đổi từ ngoài) thì chỉ field đổi từ ngoài mới lấy raw.
|
|
8196
|
+
const next = !rebuild && draft !== this.#barWritten ? mergeQueryDraft(draft, this.#barDerived, derived) : derived;
|
|
8197
|
+
this.#barDerived = derived;
|
|
8198
|
+
if (next.length !== draft.length || next.some((filter, index) => filter !== draft[index]))
|
|
8199
|
+
this.barFilters.set(next);
|
|
8200
|
+
this.#barWritten = untracked(() => this.barFilters());
|
|
8201
|
+
const term = value.quickSearch?.term ?? '';
|
|
8202
|
+
// why: chỉ đẩy từ khoá khi từ khoá đã áp dụng đổi — không xoá phần đang gõ dở khi chip khác đổi.
|
|
8203
|
+
if ((rebuild && !this.#barKeepSearch) || term !== this.#barTerm) {
|
|
8204
|
+
this.#barTerm = term;
|
|
8205
|
+
this.barSearch.set(term);
|
|
8206
|
+
}
|
|
8207
|
+
};
|
|
7070
8208
|
// Blur input filter: chỉ commit giá trị vào filterRegister, KHÔNG trigger reload.
|
|
7071
8209
|
// Reload chỉ chạy khi user enter hoặc bấm nút tải lại.
|
|
7072
8210
|
onFilterCommit = () => {
|
|
@@ -7379,6 +8517,10 @@ class SdTable {
|
|
|
7379
8517
|
this.#updateSelectedItems();
|
|
7380
8518
|
this.#syncSelectAllState();
|
|
7381
8519
|
};
|
|
8520
|
+
/** Restore defaults in the settings modal also puts the inline external filters back to `defaultShowing`. */
|
|
8521
|
+
onConfigDefaultsRestored = () => {
|
|
8522
|
+
this.filterRegister?.configuration.remove();
|
|
8523
|
+
};
|
|
7382
8524
|
onColumnResize = (field, width) => {
|
|
7383
8525
|
// persistColumnWidth ghi storage (silent) và emit widthChange$,
|
|
7384
8526
|
// subscriber trong constructor đã update configuration() signal đồng bộ.
|
|
@@ -7462,7 +8604,7 @@ class SdTable {
|
|
|
7462
8604
|
this.#refreshAggregate();
|
|
7463
8605
|
}
|
|
7464
8606
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdTable, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7465
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: SdTable, isStandalone: true, selector: "sd-table", inputs: { autoIdInput: { classPropertyName: "autoIdInput", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, option: { classPropertyName: "option", publicName: "option", isSignal: true, isRequired: true, transformFunction: null }, hideReadError: { classPropertyName: "hideReadError", publicName: "hideReadError", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sdReadStateChange: "sdReadStateChange" }, host: { attributes: { "tabindex": "0" }, properties: { "attr.data-autoid": "autoId()", "attr.data-loading": "loading() ? \"true\" : \"false\"", "attr.data-loading-view": "loadingView()", "class.sd-table--fill": "fill()" } }, providers: [
|
|
8607
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: SdTable, isStandalone: true, selector: "sd-table", inputs: { autoIdInput: { classPropertyName: "autoIdInput", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null }, option: { classPropertyName: "option", publicName: "option", isSignal: true, isRequired: true, transformFunction: null }, hideReadError: { classPropertyName: "hideReadError", publicName: "hideReadError", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sdReadStateChange: "sdReadStateChange" }, host: { attributes: { "tabindex": "0" }, properties: { "attr.data-autoid": "autoId()", "attr.data-loading": "loading() ? \"true\" : \"false\"", "attr.data-loading-view": "loadingView()", "attr.data-filter-mode": "effectiveFilterMode()", "class.sd-table--fill": "fill()" } }, providers: [
|
|
7466
8608
|
DatePipe,
|
|
7467
8609
|
DecimalPipe,
|
|
7468
8610
|
CdkColumnDef,
|
|
@@ -7474,7 +8616,7 @@ class SdTable {
|
|
|
7474
8616
|
provide: MatPaginatorIntl,
|
|
7475
8617
|
useClass: SdTablePaginatorIntl,
|
|
7476
8618
|
},
|
|
7477
|
-
], queries: [{ propertyName: "dataStateTemplate", first: true, predicate: SdDataStateTemplateDirective, descendants: true, isSignal: true }, { propertyName: "sdSubInformation", first: true, predicate: SdTableExpandDefDirective, descendants: true, isSignal: true }, { propertyName: "sdGroupDef", first: true, predicate: SdTableGroupDefDirective, descendants: true, isSignal: true }, { propertyName: "sdCellDefs", predicate: SdTableCellDefDirective, isSignal: true }, { propertyName: "sdCommandHeaderDef", first: true, predicate: SdTableCommandHeaderDefDirective, descendants: true, isSignal: true }, { propertyName: "sdQuickSearchRightDef", first: true, predicate: SdTableQuickSearchRightDefDirective, descendants: true, isSignal: true }, { propertyName: "sdFooterDefs", predicate: SdMaterialFooterDefDirective, isSignal: true }, { propertyName: "sdFilterDefs", predicate: SdTableFilterDefDirective, isSignal: true }, { propertyName: "sdTitleDefs", predicate: SdTableTitleDefDirective, isSignal: true }, { propertyName: "sdRowMobileDef", first: true, predicate: SdTableRowMobileDefDirective, isSignal: true }], viewQueries: [{ propertyName: "table", first: true, predicate: MatTable, descendants: true, isSignal: true }, { propertyName: "configComponent", first: true, predicate: ConfigComponent, descendants: true, isSignal: true }, { propertyName: "sdPopupExport", first: true, predicate: SdPopupExport, descendants: true, isSignal: true }, { propertyName: "scroll", first: true, predicate: SdScrollDirective, descendants: true, isSignal: true }, { propertyName: "quickAction", first: true, predicate: SdQuickAction, descendants: true, isSignal: true }, { propertyName: "externalFilter", first: true, predicate: ExternalFilterComponent, descendants: true, isSignal: true }, { propertyName: "mobileFilter", first: true, predicate: MobileFilterComponent, descendants: true, isSignal: true }, { propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true, isSignal: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true, isSignal: true }, { propertyName: "quickSearchControl", first: true, predicate: TableQuickSearchComponent, descendants: true, isSignal: true }], ngImport: i0, template: "@let _visibleSelectAll = visibleSelectAll();\n@let _isSelectIndeterminate = isSelectIndeterminate();\n@let _isSelectAll = isSelectAll();\n@let _configuration = configuration();\n@let _tableOption = tableOption()!;\n@let _loading = loading();\n@let _loadingView = loadingView();\n@let _readState = readState();\n@let _hideReadError = hideReadError();\n@let _dataStateTemplate = dataStateTemplate();\n@let _items = items();\n@let _total = total();\n@let _isFiltered = isFiltered();\n@let _requireFiltered = requireFiltered();\n@let _export = _tableOption?.export;\n@let _exporting = exporting();\n@let _titleDef = titleDef();\n@let _autoId = autoId();\n@let _exportTitle = exportTitle();\n@let _cellDef = cellDef();\n@let _footerDef = footerDef();\n@let _sdSubInformation = sdSubInformation();\n@let _configComponent = configComponent();\n@let _mobileFilter = mobileFilter();\n@let _selectedTableItems = selectedTableItems();\n@let _rowCommands = rowCommands();\n@let _mobileCards = mobileCards();\n@let _isMobile = isMobile();\n@let _showInlineFilter =\n !_isMobile &&\n !_tableOption?.filter?.disabled &&\n _tableOption?.filter?.hideInlineFilter !== true &&\n !(_tableOption?.filter?.hideInlineFilter === 'auto' && !_isFiltered && knownRowCount()! <= 10);\n@let _commandHeaderDef = sdCommandHeaderDef();\n@let _quickSearch = quickSearchOption();\n@let _aggregate = aggregateSnapshot();\n@let _aggregateColumns = aggregateColumns();\n@let _aggregateColumnIds = aggregateColumnIds();\n@let _headerFilterColumns = headerFilterColumns();\n<!-- why: tree kh\u00F4ng c\u00F2n c\u1ED9t ri\u00EAng \u2014 khi KH\u00D4NG c\u00F3 c\u1ED9t Index, icon expand nh\u00FAng v\u00E0o\n c\u1ED9t data \u0111\u1EA7u ti\u00EAn. \u0110\u00E2y l\u00E0 field c\u1EE7a c\u1ED9t \u0111\u00F3 (null n\u1EBFu c\u00F3 Index ho\u1EB7c kh\u00F4ng tree). -->\n@let _treeFirstField = _tableOption?.tree && !_tableOption.index?.enabled ? _configuration?.firstColumns?.[0]?.field : null;\n\n<!-- why: v\u00F9ng status lu\u00F4n c\u00F3 trong DOM, k\u1EC3 c\u1EA3 tr\u01B0\u1EDBc khi c\u00F3 configuration. V\u00F9ng ch\u1EC9 render trong l\u00FAc t\u1EA3i b\u1ECB g\u1EE1\n tr\u01B0\u1EDBc khi screen reader k\u1ECBp \u0111\u1ECDc v\u00E0 kh\u00F4ng b\u00E1o \u0111\u01B0\u1EE3c \"\u0111\u00E3 t\u1EA3i xong\". -->\n<span class=\"sd-table-live\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">{{ liveMessage() }}</span>\n@if (_configuration) {\n @if (!_mobileCards && !_tableOption.filter?.disabled && !!_tableOption.filter?.externalFilters?.length && filterRegister) {\n <external-filter\n class=\"mb-16\"\n [autoId]=\"_autoId\"\n [filterRegister]=\"filterRegister\"\n [filter]=\"_tableOption.filter!\"\n [externalFilters]=\"_tableOption.filter?.externalFilters!\"\n [collapsedByDefault]=\"externalFilterCollapsedByDefault()\">\n </external-filter>\n }\n @let groupedItems = _items | sdTree: _tableOption.tree : treeRevision() | sdGroup: _tableOption : groupExpandState : groupHost;\n @let renderItems = groupedItems | sdAggregateRows: _aggregate : _tableOption : aggregateRenderHost;\n\n <ng-template #aggregateCell let-cell>\n @if (cell) {\n @if (cell.templateRef) {\n <ng-container *ngTemplateOutlet=\"cell.templateRef; context: cell.context\"></ng-container>\n } @else {\n <span [attr.data-complete]=\"cell.context.isComplete\">{{ cell.text }}</span>\n }\n }\n </ng-template>\n <ng-template #inlineColumnFilter let-column>\n <column-filter\n [autoId]=\"_autoId\"\n [value]=\"columnFilter?.[column.field!]!\"\n [operator]=\"columnOperator[column.field]\"\n (operatorChange)=\"columnOperator[column.field] = $event!; onOperatorChange(column, $event)\"\n [columnFilter]=\"columnFilter!\"\n [cacheValues]=\"cacheValues\"\n [column]=\"column\"\n (filterChange)=\"onFilterChange()\"\n (filterCommit)=\"onFilterCommit()\">\n </column-filter>\n </ng-template>\n <ng-template #mobileAggregate let-summary=\"summary\">\n <div class=\"sd-mobile-aggregate p-12\" role=\"region\" [attr.aria-label]=\"'core.component.table.mobile.summary' | sdTranslate\">\n @for (entry of _aggregateColumns; track entry.field) {\n @let cell = summary.cells.get(entry.field);\n @if (cell && entry.column) {\n <div class=\"d-flex align-items-center flex-wrap gap-8 py-8\">\n <column-title [column]=\"entry.column\" [titleDef]=\"_titleDef[entry.field]\"></column-title>\n <ng-container *ngTemplateOutlet=\"aggregateCell; context: { $implicit: cell }\"></ng-container>\n </div>\n }\n }\n </div>\n </ng-template>\n\n <!-- Tree toggle d\u00F9ng chung: indent (theo c\u1EA5p) + slot chevron/spinner. Nh\u00FAng v\u00E0o\n c\u1ED9t Index ho\u1EB7c c\u1ED9t data \u0111\u1EA7u qua *ngTemplateOutlet (context: { row }). -->\n <ng-template #sdTreeToggle let-row=\"row\">\n @let _tree = row?.meta?.tree;\n @if (_tree) {\n <span class=\"sd-tree-indent\" [style.width.px]=\"(_tree.level ?? 0) * (_tableOption.tree?.indentSize ?? 20)\"></span>\n <span class=\"sd-tree-toggle-slot\">\n @if (_tree.hasChildren) {\n @let _aid = _autoId;\n @let _expanding = !!_tree.isExpanding;\n <!-- why: n\u00FAt lu\u00F4n n\u1EB1m trong DOM, ch\u1EC9 \u0111\u1ED5i icon th\u00E0nh spinner khi \u0111ang t\u1EA3i con; g\u1EE1 n\u00FAt l\u00E0m focus b\u00E0n ph\u00EDm r\u01A1i\n v\u1EC1 body. Click trong l\u00FAc t\u1EA3i b\u1ECB onTreeToggle b\u1ECF qua. -->\n <button\n type=\"button\"\n class=\"sd-tree-toggle-btn\"\n [attr.data-autoid]=\"_aid ? _aid + '-tree-toggle-' + row.meta.id : null\"\n [attr.aria-label]=\"'core.component.table.tree-toggle' | sdTranslate\"\n [attr.aria-expanded]=\"!!_tree.isExpanded\"\n [attr.aria-busy]=\"_expanding ? 'true' : null\"\n [attr.aria-disabled]=\"_expanding ? 'true' : null\"\n (click)=\"onTreeToggle(row); $event.stopPropagation()\">\n @if (_expanding) {\n <span class=\"sd-table-spinner\" aria-hidden=\"true\"></span>\n } @else {\n <sd-icon [name]=\"_tree.isExpanded ? 'expand_more' : 'chevron_right'\"></sd-icon>\n }\n </button>\n }\n </span>\n }\n </ng-template>\n\n <ng-template #sdGroupHeader let-item=\"item\">\n <div class=\"sd-group-row d-flex align-items-center py-8\">\n @if (_tableOption.selector?.visible && !_tableOption.selector?.single) {\n <div class=\"sd-group-selection-slot d-flex align-items-center justify-content-center\">\n <mat-checkbox\n class=\"c-selection\"\n color=\"primary\"\n [checked]=\"isGroupAllSelected(item)\"\n [indeterminate]=\"isGroupIndeterminate(item)\"\n (change)=\"onSelectGroup(item, $event.checked)\">\n </mat-checkbox>\n </div>\n } @else {\n <div class=\"sd-group-selection-slot\"></div>\n }\n @if (_tableOption.group?.collapsible) {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-group-toggle-' + (item.meta.group?.key || item.meta.id) : null\"\n type=\"text\"\n [prefixIcon]=\"item.meta.group.isExpanded ? 'expand_more' : 'chevron_right'\"\n width=\"32px\"\n (click)=\"toggleGroupExpand(item)\">\n </sd-button>\n }\n @if (sdGroupDef()?.templateRef; as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl; context: groupContext(item)\"></ng-container>\n } @else {\n <span class=\"T14R\">{{ item.meta.group.values | json }}</span>\n }\n </div>\n </ng-template>\n\n <ng-content select=\"[sdTableTop]\"></ng-content>\n <div class=\"sd-table-surface\" [class.sd-table-surface--quick-search]=\"!!_quickSearch\">\n @if (_quickSearch) {\n <sd-table-quick-search\n [option]=\"_quickSearch\"\n [value]=\"quickSearchValue()\"\n [autoId]=\"_autoId\"\n [rightTemplate]=\"sdQuickSearchRightDef()?.templateRef\"\n (valueChange)=\"onQuickSearchChange($event)\" />\n }\n <div class=\"c-container\" [class.sd-table-mobile]=\"_mobileCards\">\n <!-- why: l\u1EDBp loading kh\u00F4ng ph\u1EE7 l\u00EAn b\u1EA3ng: header, filter, sort v\u00E0 thanh cu\u1ED9n lu\u00F4n d\u00F9ng \u0111\u01B0\u1EE3c. Ch\u01B0a c\u00F3 d\u00F2ng th\u00EC\n khung x\u01B0\u01A1ng (matNoDataRow); \u0111\u00E3 c\u00F3 d\u00F2ng th\u00EC gi\u1EEF d\u00F2ng c\u0169, qu\u00E1 showDelay m\u1EDBi l\u00E0m m\u1EDD d\u00F2ng v\u00E0 hi\u1EC7n thanh ti\u1EBFn\n tr\u00ECnh. aria-busy v\u1EABn theo loading() th\u1EADt; v\u00F9ng .sd-table-live b\u00E1o \"\u0111ang t\u1EA3i\"/\"\u0111\u00E3 t\u1EA3i xong\". -->\n <div\n class=\"c-table\"\n sdScroll\n stickyShadow\n matSort\n [matSortDisabled]=\"!_tableOption.sort?.enable\"\n [class.c-table--dim]=\"_loadingView === 'refresh' && loadingSettings().dim\"\n [attr.aria-busy]=\"_loading ? 'true' : null\"\n [style.max-height]=\"_tableOption.style?.maxHeight\"\n [style.min-height]=\"_tableOption.style?.minHeight\">\n @if (_mobileCards) {\n @if (_commandHeaderDef) {\n <div class=\"sd-mobile-command-header\"><ng-container *ngTemplateOutlet=\"_commandHeaderDef.templateRef\"></ng-container></div>\n }\n @if (_loadingView === 'refresh') {\n <!-- Mobile: kh\u00F4ng c\u00F3 header b\u1EA3ng; thanh n\u1EB1m \u1EDF m\u00E9p tr\u00EAn danh s\u00E1ch th\u1EBB, d\u01B0\u1EDBi command header. Anchor cao 0\n n\u00EAn thanh hi\u1EC7n/\u1EA9n kh\u00F4ng \u0111\u1EA9y th\u1EBB. -->\n <div class=\"sd-table-progress-anchor\">\n <div class=\"sd-table-progress\" aria-hidden=\"true\"></div>\n </div>\n }\n <sd-table-mobile-cards\n [table]=\"this\"\n [rows]=\"renderItems\"\n [dataRows]=\"groupedItems\"\n [groupTemplate]=\"sdGroupHeader\"\n [aggregateTemplate]=\"mobileAggregate\"></sd-table-mobile-cards>\n @if (_aggregate.total; as summary) {\n <ng-container *ngTemplateOutlet=\"mobileAggregate; context: { summary: summary }\"></ng-container>\n }\n @if (hasFooter()) {\n <div class=\"sd-mobile-footer p-12\" role=\"region\" [attr.aria-label]=\"'core.component.table.mobile.summary' | sdTranslate\">\n @for (column of mobileFooterColumns(); track column.field) {\n <div class=\"d-flex align-items-center flex-wrap gap-8 py-8\">\n <column-title [column]=\"column\" [titleDef]=\"_titleDef[column.field]\"></column-title>\n <ng-container\n *ngTemplateOutlet=\"_footerDef[column.field].templateRef; context: { items: _items, column: column }\"></ng-container>\n </div>\n }\n </div>\n }\n } @else {\n <table\n mat-table\n [class.sd-table-grouped-header]=\"_configuration.multipleHeader\"\n sdAggregateLayout\n [dataSource]=\"renderItems\"\n [trackBy]=\"trackBy\"\n multiTemplateDataRows\n cdkDropList\n [cdkDropListData]=\"groupedItems\"\n [cdkDropListDisabled]=\"!_tableOption.rowReorder?.enabled\"\n [cdkDropListSortPredicate]=\"reorderSortPredicate\"\n (cdkDropListDropped)=\"onReorderDrop($event)\">\n @if (_tableOption.rowReorder?.enabled) {\n <ng-container matColumnDef=\"sdReorder\">\n <th mat-header-cell *matHeaderCellDef class=\"sd-reorder-header\" [attr.rowspan]=\"_configuration.multipleHeader ? 2 : 1\"></th>\n <td mat-cell *matCellDef=\"let row\" class=\"sd-reorder-cell\">\n @if (!row.meta?.group?.items?.length) {\n <sd-icon\n cdkDragHandle\n [class.sd-reorder-disabled]=\"isReorderDisabled(row)\"\n [name]=\"_tableOption.rowReorder?.icon || 'drag_indicator'\"></sd-icon>\n }\n </td>\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n }\n\n <ng-container matColumnDef=\"sdSubInformation\" sticky>\n <td class=\"p-0\" mat-cell *matCellDef=\"let item\" [attr.colspan]=\"_configuration.displayedColumns.length\">\n @if (_sdSubInformation?.templateRef) {\n @if (_tableOption.expand?.always) {\n <ng-container *ngTemplateOutlet=\"_sdSubInformation?.templateRef!; context: { item: item }\"> </ng-container>\n } @else {\n <div [@detailExpand]=\"item.meta.expand?.isExpanded ? 'expanded' : 'collapsed'\">\n @if (item.meta.expand?.isExpanded) {\n <ng-container *ngTemplateOutlet=\"_sdSubInformation?.templateRef!; context: { item: item }\"> </ng-container>\n }\n </div>\n }\n }\n </td>\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"sdSubInformationAction\" stickyEnd>\n <th\n class=\"p-0\"\n mat-header-cell\n *matHeaderCellDef\n style=\"width: 1px\"\n [attr.rowspan]=\"_configuration.multipleHeader ? 2 : 1\"></th>\n <td mat-cell *matCellDef=\"let element\">\n @if (!_tableOption.expand?.always) {\n @let _expanding = !!element.meta.expand?.isExpanding;\n <!-- why: n\u00FAt 35px gi\u1EEF nguy\u00EAn khi \u0111ang t\u1EA3i ([loading] thay prefix icon b\u1EB1ng spinner) \u0111\u1EC3 focus b\u00E0n ph\u00EDm\n kh\u00F4ng m\u1EA5t; onExpand b\u1ECF qua click trong l\u00FAc t\u1EA3i. color primary ch\u1EC9 \u0111\u1EC3 spinner theo m\u00E0u nh\u1EA5n. -->\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-expand-' + element.meta.id : null\"\n type=\"text\"\n [color]=\"_expanding ? 'primary' : null\"\n [loading]=\"_expanding\"\n [attr.aria-busy]=\"_expanding ? 'true' : null\"\n [prefixIcon]=\"element.meta.expand?.isExpanded ? 'expand_less' : 'expand_more'\"\n (click)=\"onExpand(element)\"\n width=\"35px\">\n </sd-button>\n }\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"sdSelection\" sticky>\n <th class=\"sd-selection-cell p-0\" mat-header-cell *matHeaderCellDef [attr.rowspan]=\"_configuration.multipleHeader ? 2 : 1\">\n @if (_visibleSelectAll) {\n <mat-checkbox\n class=\"c-selection px-8\"\n color=\"primary\"\n [indeterminate]=\"_isSelectIndeterminate\"\n [ngModel]=\"_isSelectAll\"\n (ngModelChange)=\"isSelectAll.set($event)\"\n (change)=\"onSelectAll()\">\n </mat-checkbox>\n }\n </th>\n\n <td class=\"sd-selection-cell p-0\" mat-cell *matCellDef=\"let item\">\n @let visible = item.meta.selector?.visible;\n @if (visible) {\n @if (_tableOption.selector?.single) {\n <mat-radio-button\n class=\"c-selection px-8\"\n color=\"primary\"\n [checked]=\"item.meta.selector.isSelected\"\n (change)=\"item.meta.selector.isSelected = true; onSelect(item)\"\n [disabled]=\"item.meta.selector?.disabled\">\n </mat-radio-button>\n } @else {\n <mat-checkbox\n class=\"c-selection px-8\"\n color=\"primary\"\n [(ngModel)]=\"item.meta.selector.isSelected\"\n (change)=\"onSelect(item)\"\n [disabled]=\"item.meta.selector?.disabled\">\n </mat-checkbox>\n }\n }\n </td>\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n @if (_tableOption.index?.enabled) {\n @let _pageOffset = pageOffset();\n @let _indexWidth = _tableOption.index?.width || '50px';\n <!-- why: khi tree, c\u1ED9t Index \"\u00F4m\" th\u00EAm chevron + indent. D\u00F9ng width:1px +\n nowrap (.sd-tree-index-cell) \u0111\u1EC3 c\u1ED9t co S\u00C1T n\u1ED9i dung, kh\u00F4ng chi\u1EBFm ch\u1ED7\n th\u1EEBa; header \"#\" canh tr\u00E1i l\u00F9i v\u00E0o (.sd-tree-index-header) cho th\u1EB3ng s\u1ED1. -->\n @let _treeIndex = !!_tableOption.tree;\n <ng-container matColumnDef=\"sdIndex\" sticky>\n <th\n [class.p-0]=\"!_treeIndex\"\n [class.text-center]=\"!_treeIndex\"\n [class.sd-tree-index-cell]=\"_treeIndex\"\n [class.sd-tree-index-header]=\"_treeIndex\"\n mat-header-cell\n *matHeaderCellDef\n [style.width]=\"_treeIndex ? '1px' : _indexWidth\"\n [style.min-width]=\"_treeIndex ? null : _indexWidth\"\n [style.max-width]=\"_treeIndex ? null : _indexWidth\"\n [attr.rowspan]=\"_configuration.multipleHeader ? 2 : 1\">\n {{ _tableOption.index?.title || '#' }}\n </th>\n <td\n [class.px-4]=\"!_treeIndex\"\n [class.text-center]=\"!_treeIndex\"\n [class.sd-tree-index-cell]=\"_treeIndex\"\n mat-cell\n *matCellDef=\"let item; let i = dataIndex\"\n [style.width]=\"_treeIndex ? '1px' : null\"\n [style.min-width]=\"_treeIndex ? null : _indexWidth\"\n [style.max-width]=\"_treeIndex ? null : _indexWidth\">\n @if (!item?.meta?.group?.isGroupHeader) {\n @if (_treeIndex) {\n <!-- why: tree \u2192 chevron + indent + STT ph\u00E2n c\u1EA5p (1, 1.2, 1.2.1). T\u00F4 \u0111\u1EADm root (level 0). -->\n <span class=\"sd-tree-line\">\n <ng-container *ngTemplateOutlet=\"sdTreeToggle; context: { row: item }\"></ng-container>\n @if (item?.meta?.tree?.indexPath?.length) {\n <span class=\"sd-tree-stt\" [class.sd-stt-root]=\"(item.meta.tree.level ?? 0) === 0\">\n {{ item.meta.tree.indexPath.join('.') }}\n </span>\n }\n </span>\n } @else {\n {{ _pageOffset + (aggregateRenderHost.indices.get(item) ?? i) + 1 }}\n }\n }\n </td>\n <td\n mat-footer-cell\n *matFooterCellDef\n [style.width]=\"_treeIndex ? '1px' : null\"\n [style.min-width]=\"_treeIndex ? null : _indexWidth\"\n [style.max-width]=\"_treeIndex ? null : _indexWidth\"></td>\n </ng-container>\n }\n <ng-container\n matColumnDef=\"sdCommand\"\n [sticky]=\"_tableOption.command?.align !== 'right'\"\n [stickyEnd]=\"_tableOption.command?.align === 'right'\">\n <!-- why: \u00F4 header c\u1EE7a c\u1ED9t command v\u1ED1n \u0111\u1EC3 tr\u1ED1ng. Cho consumer chi\u1EBFm ch\u1ED7 \u0111\u00F3 b\u1EB1ng\n `sdTableCommandHeaderDef` (th\u01B0\u1EDDng l\u00E0 n\u00FAt th\u00EAm d\u00F2ng) th\u00EC h\u00E0nh \u0111\u1ED9ng c\u1EA5p b\u1EA3ng n\u1EB1m ngay\n tr\u00EAn c\u1EE5m n\u00FAt c\u1EE7a t\u1EEBng d\u00F2ng, thay v\u00EC ph\u1EA3i d\u1EF1ng th\u00EAm m\u1ED9t d\u1EA3i ri\u00EAng d\u01B0\u1EDBi b\u1EA3ng. -->\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 50px\" [attr.rowspan]=\"_configuration.multipleHeader ? 2 : 1\">\n @if (_commandHeaderDef) {\n <div class=\"sd-command-header d-flex align-items-center justify-content-center\">\n <ng-container *ngTemplateOutlet=\"_commandHeaderDef.templateRef\"></ng-container>\n </div>\n }\n </th>\n <!-- why: `dataIndex` do CDK c\u1EA5p s\u1EB5n. B\u1EA3n c\u0169 d\u00F9ng `groupedItems.indexOf(item)` \u2014\n qu\u00E9t to\u00E0n m\u1EA3ng cho M\u1ED6I d\u00F2ng render \u1EDF M\u1ED6I CD pass (O(n\u00B2) tr\u00EAn \u0111\u01B0\u1EDDng render),\n v\u00E0 c\u00F2n tr\u1EA3 sai index khi 2 d\u00F2ng tr\u00F9ng reference. -->\n <td class=\"px-8\" mat-cell *matCellDef=\"let item; let i = dataIndex\">\n <desktop-command\n [autoId]=\"_autoId\"\n [commands]=\"_rowCommands\"\n [item]=\"item\"\n [itemIndex]=\"aggregateRenderHost.indices.get(item) ?? i\"></desktop-command>\n </td>\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n <!-- why: group header row d\u00F9ng matRowDef RI\u00CANG v\u1EDBi column list ['sdGroupHeader']\n qua predicate when:isGroupHeaderRow. Cell colspan = displayedColumns.length \u0111\u1EC3\n span TO\u00C0N B\u1ED8 width data row. Tr\u00E1nh colspan trick overflow row khi c\u00E1c TD kh\u00E1c render. -->\n <ng-container matColumnDef=\"sdGroupHeader\">\n <td class=\"p-0 sd-group-header-cell\" mat-cell *matCellDef=\"let item\" [attr.colspan]=\"sdGroupColspan()\">\n <ng-container *ngTemplateOutlet=\"sdGroupHeader; context: { item: item }\"></ng-container>\n </td>\n </ng-container>\n <!-- why: filler column \u1EDF cu\u1ED1i h\u1EA5p th\u1EE5 leftover space khi t\u1ED5ng width c\u00E1c c\u1ED9t data < container \u2014 gi\u1EEF cho selection/STT/command kh\u00F4ng b\u1ECB d\u00E3n. -->\n <ng-container matColumnDef=\"sdFiller\">\n <th class=\"sd-filler-cell p-0\" mat-header-cell *matHeaderCellDef [attr.rowspan]=\"_configuration.multipleHeader ? 2 : 1\"></th>\n <td class=\"sd-filler-cell p-0\" mat-cell *matCellDef=\"let item\"></td>\n <td class=\"sd-filler-cell p-0\" mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n @for (column of _configuration.firstColumns; track column.field) {\n <ng-container [matColumnDef]=\"column.field\" [sticky]=\"_configuration.fixedColumn[column.field]\">\n <th\n mat-header-cell\n *matHeaderCellDef\n class=\"px-8 c-th\"\n [class.sd-column-group]=\"column.type === 'children'\"\n [attr.scope]=\"column.type === 'children' ? 'colgroup' : 'col'\"\n [sdColumnResize]=\"!!_tableOption.config?.resizable && column.type !== 'children'\"\n [minWidth]=\"column.minWidth\"\n [maxWidth]=\"column.maxWidth\"\n (resizeEnd)=\"onColumnResize(column.field, $event)\"\n [style.width]=\"column.width\"\n [style.min-width]=\"column.minWidth || column.width\"\n [style.max-width]=\"column.maxWidth\"\n [attr.rowspan]=\"_configuration.multipleHeader && column.type !== 'children' ? 2 : 1\"\n [attr.colspan]=\"column.type === 'children' ? column.children.length : 1\"\n [attr.aria-sort]=\"\n _tableOption.sort?.enable && column.type !== 'children' && column.sortable ? getSortAria(column.field) : null\n \">\n <div>\n <!-- why: sort control ch\u1EC9 \u00F4m title; filter l\u00E0 sibling n\u00EAn kh\u00F4ng th\u00E0nh interactive\n descendant. aria-sort thu\u1ED9c semantic <th>, kh\u00F4ng thu\u1ED9c control n\u00E0y. -->\n @if (column.type === 'children') {\n <div class=\"c-header-title sd-column-group-title\">\n <column-title [column]=\"column\" [titleDef]=\"_titleDef[column.field]\"></column-title>\n </div>\n } @else {\n @if (_tableOption.sort?.enable && column.sortable) {\n <div\n [sdTableSortHeader]=\"column.field\"\n class=\"c-header-title\"\n [class.justify-content-end]=\"column.align === 'right'\"\n [class.text-right]=\"column.align === 'right'\">\n <column-title [column]=\"column\" [titleDef]=\"_titleDef[column.field]\"></column-title>\n </div>\n } @else {\n <div\n class=\"c-header-title\"\n [class.justify-content-end]=\"column.align === 'right'\"\n [class.text-right]=\"column.align === 'right'\">\n <column-title [column]=\"column\" [titleDef]=\"_titleDef[column.field]\"></column-title>\n </div>\n }\n @if (_showInlineFilter && !_configuration.multipleHeader) {\n <ng-container *ngTemplateOutlet=\"inlineColumnFilter; context: { $implicit: column }\"></ng-container>\n }\n }\n </div>\n </th>\n <td\n class=\"c-td px-0\"\n [class.d-none]=\"column.type === 'children'\"\n mat-cell\n *matCellDef=\"let item\"\n [sdHoverCopy]=\"(item.data && item.data[column.field]) || ''\"\n [sdHoverCopyDisabled]=\"!column.cell?.copiable\">\n @if (column.type !== 'children' && !item?.meta?.group?.isGroupHeader) {\n @if (_treeFirstField && column.field === _treeFirstField) {\n <!-- why: kh\u00F4ng c\u00F3 c\u1ED9t Index \u2192 chevron + indent nh\u00FAng v\u00E0o c\u1ED9t data \u0111\u1EA7u (nh\u01B0 file explorer). -->\n <span class=\"sd-tree-line px-8\">\n <ng-container *ngTemplateOutlet=\"sdTreeToggle; context: { row: item }\"></ng-container>\n <desktop-cell class=\"d-block\" [column]=\"column\" [item]=\"item\" [cellDef]=\"_cellDef\"></desktop-cell>\n </span>\n } @else {\n <desktop-cell class=\"d-block px-8\" [column]=\"column\" [item]=\"item\" [cellDef]=\"_cellDef\"> </desktop-cell>\n }\n }\n </td>\n <td mat-footer-cell *matFooterCellDef [class.d-none]=\"column.type === 'children'\">\n <ng-container *ngIf=\"_footerDef[column.field]\">\n <ng-container *ngTemplateOutlet=\"_footerDef[column.field].templateRef; context: { items: _items, column: column }\">\n </ng-container>\n </ng-container>\n </td>\n </ng-container>\n }\n @for (column of _configuration.secondColumns; track column.field) {\n <ng-container [matColumnDef]=\"column.field\" [sticky]=\"_configuration.fixedColumn[column.field]\">\n <th\n mat-header-cell\n *matHeaderCellDef\n class=\"c-th px-8\"\n scope=\"col\"\n [style.width]=\"column.width\"\n [style.min-width]=\"column.minWidth || column.width\"\n [style.max-width]=\"column.maxWidth\"\n [attr.aria-sort]=\"_tableOption.sort?.enable && column.sortable ? getSortAria(column.field) : null\">\n <div>\n @if (_tableOption.sort?.enable && column.sortable) {\n <div\n [sdTableSortHeader]=\"column.field\"\n class=\"c-header-title\"\n [class.justify-content-end]=\"column.align === 'right'\"\n [class.text-right]=\"column.align === 'right'\">\n <column-title [column]=\"column\" [titleDef]=\"_titleDef[column.field]\"></column-title>\n </div>\n } @else {\n <div\n class=\"c-header-title\"\n [class.justify-content-end]=\"column.align === 'right'\"\n [class.text-right]=\"column.align === 'right'\">\n <column-title [column]=\"column\" [titleDef]=\"_titleDef[column.field]\"></column-title>\n </div>\n }\n </div>\n </th>\n <td\n class=\"c-td px-0\"\n mat-cell\n *matCellDef=\"let item\"\n [sdHoverCopy]=\"item[column.field]\"\n [sdHoverCopyDisabled]=\"!column.cell?.copiable\">\n @if (column.type !== 'children') {\n <desktop-cell class=\"d-block px-8\" [column]=\"column\" [item]=\"item\" [cellDef]=\"_cellDef\"> </desktop-cell>\n }\n </td>\n <td mat-footer-cell *matFooterCellDef>\n <ng-container *ngIf=\"_footerDef[column.field]\">\n <ng-container *ngTemplateOutlet=\"_footerDef[column.field].templateRef; context: { items: _items, column: column }\">\n </ng-container>\n </ng-container>\n </td>\n </ng-container>\n }\n <tr class=\"c-first-header\" mat-header-row *matHeaderRowDef=\"_configuration.firstHeaders; sticky: true\"></tr>\n @for (entry of _aggregateColumns; track entry.id) {\n <ng-container [matColumnDef]=\"entry.id\" [sticky]=\"entry.sticky\" [stickyEnd]=\"entry.stickyEnd\">\n <td\n mat-cell\n *matCellDef=\"let row\"\n class=\"sd-aggregate-cell px-8 py-8\"\n [class.d-none]=\"entry.hidden\"\n [style.text-align]=\"entry.column?.align\"\n [style.width]=\"entry.column?.width\"\n [style.min-width]=\"entry.column?.minWidth || entry.column?.width\">\n <ng-container\n *ngTemplateOutlet=\"\n aggregateCell;\n context: { $implicit: aggregateRenderHost.rows.get(row)?.cells?.get(entry.field) }\n \"></ng-container>\n </td>\n <td\n mat-footer-cell\n *matFooterCellDef\n class=\"sd-aggregate-cell px-8 py-8\"\n [class.d-none]=\"entry.hidden\"\n [style.text-align]=\"entry.column?.align\"\n [style.width]=\"entry.column?.width\"\n [style.min-width]=\"entry.column?.minWidth || entry.column?.width\">\n <ng-container\n *ngTemplateOutlet=\"aggregateCell; context: { $implicit: _aggregate.total?.cells?.get(entry.field) }\"></ng-container>\n </td>\n </ng-container>\n }\n <tr mat-row *matRowDef=\"let row; columns: _aggregateColumnIds; when: isAggregateRow\" class=\"sd-aggregate-row\"></tr>\n @if (!!_configuration.secondHeaders.length) {\n <tr class=\"c-second-header\" mat-header-row *matHeaderRowDef=\"_configuration.secondHeaders; sticky: true\"></tr>\n }\n @if (_configuration.multipleHeader) {\n @for (entry of _headerFilterColumns; track entry.id) {\n <ng-container [matColumnDef]=\"entry.id\" [sticky]=\"entry.sticky\" [stickyEnd]=\"entry.stickyEnd\">\n <th\n mat-header-cell\n *matHeaderCellDef\n class=\"c-th sd-filter-header\"\n [class.px-8]=\"!!entry.column\"\n [class.p-0]=\"!entry.column\"\n [class.sd-filler-cell]=\"entry.field === 'sdFiller'\"\n scope=\"col\">\n @if (_showInlineFilter && entry.column) {\n <ng-container *ngTemplateOutlet=\"inlineColumnFilter; context: { $implicit: entry.column }\"></ng-container>\n }\n </th>\n </ng-container>\n }\n <!-- why: gi\u1EEF row definition \u1ED5n \u0111\u1ECBnh; CDK c\u1EADp nh\u1EADt columns \u0111\u1EC3 b\u1ECF controls/sticky offsets khi \u1EA9n filter. -->\n <tr\n class=\"c-filter-header\"\n [style.display]=\"_showInlineFilter ? null : 'none'\"\n mat-header-row\n *matHeaderRowDef=\"_showInlineFilter ? headerFilterColumnIds() : []; sticky: _showInlineFilter\"></tr>\n }\n <!-- Group header row \u2014 ch\u1EC9 1 cell sdGroupHeader colspan to\u00E0n width. -->\n <tr mat-row *matRowDef=\"let row; columns: ['sdGroupHeader']; when: isGroupHeaderRow\" class=\"c-group-row-tr\"></tr>\n\n <!-- Data row \u2014 d\u00F9ng displayedColumns \u0111\u1EA7y \u0111\u1EE7; when isDataRow \u0111\u1EC3 lo\u1EA1i tr\u1EEB group header. -->\n <!-- why: [ngStyle] \u0111\u1ECDc meta.rowStyle \u2014 style.rowCss \u0111\u00E3 \u0111\u01B0\u1EE3c resolve 1 l\u1EA7n m\u1ED7i l\u1EA7n\n render. B\u1EA3n c\u0169 g\u1ECDi rowStyle(row) ngay trong binding \u2192 ch\u1EA1y callback c\u1EE7a consumer\n cho T\u1EEANG d\u00F2ng \u1EDF M\u1ED6I CD pass, v\u00E0 v\u00EC tr\u1EA3 object M\u1EDAI n\u00EAn NgStyle ph\u1EA3i ch\u1EA1y l\u1EA1i\n KeyValueDiffer tr\u00EAn m\u1ECDi d\u00F2ng \u1EDF m\u1ECDi pass. -->\n <tr\n mat-row\n cdkDrag\n [cdkDragData]=\"row\"\n [cdkDragDisabled]=\"\n !_tableOption.rowReorder?.enabled ||\n !!row.meta?.group?.items?.length ||\n (row.meta?.tree?.level ?? 0) > 0 ||\n isReorderDisabled(row)\n \"\n *matRowDef=\"let row; columns: _configuration.displayedColumns; when: isDataRow\"\n matRipple\n class=\"c-row\"\n [class.sd-tree-row]=\"!!_tableOption.tree\"\n [ngClass]=\"_tableOption.tree ? 'sd-tree-level-' + (row.meta?.tree?.level ?? 0) : null\"\n [ngStyle]=\"row.meta.rowStyle\"\n [class.selected]=\"row.meta.selector.isSelected\"></tr>\n\n <!-- Sub-information row \u2014 also gated b\u1EDFi isDataRow \u0111\u1EC3 KH\u00D4NG render empty expand row d\u01B0\u1EDBi group header. -->\n <tr mat-row *matRowDef=\"let row; columns: ['sdSubInformation']; when: isDataRow\" class=\"c-detail-row\"></tr>\n @if (_aggregate.total) {\n <tr mat-footer-row *sdTableFooterRowDef=\"_aggregateColumnIds; sticky: true\" class=\"sd-aggregate-total\"></tr>\n }\n @if (hasFooter() && !!_configuration.displayedFooters.length) {\n <tr mat-footer-row *sdTableFooterRowDef=\"_configuration.displayedFooters; sticky: true\"></tr>\n }\n <!-- why: khung x\u01B0\u01A1ng l\u00E0 d\u00F2ng th\u1EADt trong tbody (matNoDataRow ch\u1EC9 hi\u1EC7n khi kh\u00F4ng c\u00F3 d\u00F2ng d\u1EEF li\u1EC7u) n\u00EAn \u00F4 th\u1EB3ng\n c\u1ED9t v\u1EDBi header, k\u1EC3 c\u1EA3 header nh\u00F3m, m\u00E0 kh\u00F4ng ph\u1EA3i \u0111o; footer v\u1EABn n\u1EB1m d\u01B0\u1EDBi; dataSource kh\u00F4ng \u0111\u1ED5i. -->\n <ng-template matNoDataRow>\n @for (cells of skeleton(); track $index) {\n <tr class=\"sd-table-skeleton-row\" aria-hidden=\"true\">\n @for (cell of cells; track cell.field) {\n <td class=\"sd-table-skeleton-cell\" [class.d-none]=\"cell.hidden\">\n @if (cell.shape !== 'none') {\n <span\n class=\"sd-table-skeleton-bar\"\n [attr.data-shape]=\"cell.shape\"\n [attr.data-align]=\"cell.align\"\n [style.width]=\"cell.width\"\n [style.max-width]=\"cell.maxWidth\"></span>\n }\n </td>\n }\n </tr>\n }\n </ng-template>\n </table>\n }\n @let _readError = _readState.status === 'error';\n <!-- why: d\u00F2ng c\u0169 b\u1ECB g\u1EE1 khi l\u1EA7n \u0111\u1ECDc hi\u1EC7n h\u00E0nh l\u1ED7i, n\u00EAn v\u00F9ng l\u1ED7i/empty ch\u1EC9 hi\u1EC7n khi b\u1EA3ng kh\u00F4ng c\u00F2n d\u00F2ng n\u00E0o\n \u2014 end user kh\u00F4ng bao gi\u1EDD th\u1EA5y d\u1EEF li\u1EC7u v\u00E0 l\u1ED7i c\u00F9ng l\u00FAc (NSP-4877). -->\n @let _noRows = !_readError && !_loading && !_total && !_items.length && _loadingView === 'none';\n @if ((_readError && !_hideReadError) || (_noRows && _readState.status === 'empty' && !!_dataStateTemplate)) {\n <sd-data-state [state]=\"_readError ? 'error' : 'empty'\" [retryable]=\"_readError\" (sdRetry)=\"retryRead()\">\n @if (_dataStateTemplate; as custom) {\n <ng-template sdDataStateTemplate let-current let-retry=\"retry\" let-action=\"action\">\n <ng-container\n [ngTemplateOutlet]=\"custom.template\"\n [ngTemplateOutletContext]=\"{ $implicit: current, state: current, retry: retry, action: action }\"></ng-container>\n </ng-template>\n }\n </sd-data-state>\n } @else if (!_loading && loadError() && !_hideReadError) {\n <!-- why: b\u1EA3ng local l\u1ED7i d\u00F9ng c\u00F9ng giao di\u1EC7n l\u1ED7i v\u1EDBi b\u1EA3ng server (sd-data-state, role=\"alert\") v\u00E0 c\u00F9ng\n sdDataStateTemplate; th\u1EED l\u1EA1i = reload() v\u00EC local kh\u00F4ng c\u00F3 snapshot \u0111\u1ECDc \u0111\u1EC3 retryRead(). -->\n <sd-data-state state=\"error\" [retryable]=\"true\" (sdRetry)=\"reload()\">\n @if (_dataStateTemplate; as custom) {\n <ng-template sdDataStateTemplate let-current let-retry=\"retry\" let-action=\"action\">\n <ng-container\n [ngTemplateOutlet]=\"custom.template\"\n [ngTemplateOutletContext]=\"{ $implicit: current, state: current, retry: retry, action: action }\"></ng-container>\n </ng-template>\n }\n </sd-data-state>\n } @else if (_noRows && !loadError()) {\n <!-- why: empty m\u1EB7c \u0111\u1ECBnh gi\u1EEF 3 tr\u1EA1ng th\u00E1i (filter kh\u00F4ng c\u00F3 k\u1EBFt qu\u1EA3 / ch\u01B0a ch\u1ECDn filter b\u1EAFt bu\u1ED9c / ch\u01B0a c\u00F3 d\u1EEF li\u1EC7u)\n c\u00F9ng \u1EA3nh c\u1EA5u h\u00ECnh qua SD_TABLE_CONFIGURATION.images, cho c\u1EA3 b\u1EA3ng server (NSP-5551). Kh\u00F4ng c\u00F3 role live:\n v\u00F9ng .sd-table-live (lu\u00F4n c\u00F3 trong DOM) \u0111\u1ECDc ti\u00EAu \u0111\u1EC1 c\u1EE7a kh\u1ED1i n\u00E0y. -->\n <div class=\"c-no-data-row\">\n @if (_isFiltered) {\n @if (tableConfiguration?.images?.filterEmpty) {\n <img class=\"c-image\" [src]=\"tableConfiguration!.images!.filterEmpty\" alt=\"filter-empty\" />\n } @else {\n <img class=\"c-image sd-image-filter-empty\" alt=\"filter-empty\" />\n }\n <div class=\"T16M\">{{ 'core.component.table.no-results' | sdTranslate }}</div>\n <div class=\"T16R text-secondary\">{{ 'core.component.table.no-results-hint' | sdTranslate }}</div>\n } @else {\n @if (_requireFiltered) {\n @if (tableConfiguration?.images?.filterRequired) {\n <img class=\"c-image\" [src]=\"tableConfiguration!.images!.filterRequired\" alt=\"filter-required\" />\n } @else {\n <img class=\"c-image sd-image-filter-required\" alt=\"filter-required\" />\n }\n <div class=\"T16R text-secondary\">{{ 'core.component.table.choose-filter-hint' | sdTranslate }}</div>\n } @else {\n @if (tableConfiguration?.images?.dataEmpty) {\n <img class=\"c-image\" [src]=\"tableConfiguration!.images!.dataEmpty\" alt=\"data-empty\" />\n } @else {\n <img class=\"c-image sd-image-data-empty\" alt=\"data-empty\" />\n }\n <div class=\"T16R text-secondary\">{{ 'core.component.table.no-data' | sdTranslate }}</div>\n }\n }\n </div>\n }\n </div>\n @if (_loadingView === 'refresh' && !_mobileCards) {\n <!-- N\u1EB1m trong .c-container, kh\u00F4ng trong .c-table, \u0111\u1EC3 kh\u00F4ng cu\u1ED9n ngang theo b\u1EA3ng; top = --sd-table-head-h (\u0111o). -->\n <div class=\"sd-table-progress\" aria-hidden=\"true\"></div>\n }\n @if (!_mobileCards) {\n <selector-action\n [autoId]=\"_autoId\"\n [tableOption]=\"_tableOption\"\n [selectedTableItems]=\"_selectedTableItems\"\n (clear)=\"onClearSelection()\" />\n }\n <div class=\"c-paginator\">\n <div class=\"c-action\">\n @if (_mobileCards) {\n @let _tools = mobileToolsActions();\n @if (_tools.length) {\n <button\n mat-button\n type=\"button\"\n class=\"sd-mobile-tools-trigger\"\n aria-haspopup=\"dialog\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-mobile-tools' : null\"\n (click)=\"mobileTools.openMore()\">\n <sd-icon name=\"tune\"></sd-icon><span>{{ 'core.component.table.mobile.tools' | sdTranslate }}</span>\n </button>\n <sd-table-mobile-actions\n #mobileTools\n [actions]=\"_tools\"\n [autoOpen]=\"false\"\n [title]=\"'core.component.table.mobile.tools-title' | sdTranslate\"\n [autoId]=\"_autoId\"></sd-table-mobile-actions>\n }\n } @else {\n @if (_tableOption.reload?.visible) {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-reload' : null\"\n class=\"mr-8\"\n [title]=\"'core.component.table.reload' | sdTranslate\"\n prefixIcon=\"refresh\"\n (click)=\"reload()\"\n type=\"text\">\n </sd-button>\n }\n @if (_export && _items.length) {\n @if (_export.type === 'custom') {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-export' : null\"\n class=\"mr-8\"\n [title]=\"_exportTitle\"\n prefixIcon=\"get_app\"\n (click)=\"exportCustom()\"\n type=\"text\">\n </sd-button>\n } @else {\n @if (_export.visible) {\n @if (_exporting) {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-export' : null\"\n class=\"mr-8\"\n [loading]=\"_exporting\"\n [title]=\"_exportTitle\"\n prefixIcon=\"get_app\"\n type=\"text\">\n </sd-button>\n } @else {\n @if (_export.visible === 'ALL' || !_export.visible) {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-export' : null\"\n class=\"mr-8\"\n [title]=\"_exportTitle\"\n prefixIcon=\"get_app\"\n type=\"text\">\n <sd-button-item\n [autoId]=\"_autoId ? _autoId + '-export-excel' : null\"\n prefixIcon=\"file_download\"\n (click)=\"exportExcel()\"\n >{{ 'core.component.table.export-excel' | sdTranslate }}</sd-button-item\n >\n <sd-button-item\n [autoId]=\"_autoId ? _autoId + '-export-csv' : null\"\n prefixIcon=\"file_download\"\n (click)=\"exportCSV()\"\n >{{ 'core.component.table.export-csv' | sdTranslate }}</sd-button-item\n >\n </sd-button>\n } @else if (_export.visible === 'EXCEL') {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-export-excel' : null\"\n class=\"mr-8\"\n [title]=\"_exportTitle\"\n prefixIcon=\"get_app\"\n (click)=\"exportExcel()\"\n type=\"text\">\n </sd-button>\n } @else if (_export.visible === 'CSV') {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-export-csv' : null\"\n class=\"mr-8\"\n [title]=\"_exportTitle\"\n prefixIcon=\"get_app\"\n (click)=\"exportCSV()\"\n type=\"text\">\n </sd-button>\n }\n }\n }\n }\n }\n\n @if (_configComponent) {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-config' : null\"\n class=\"mr-8\"\n [title]=\"'core.component.table.setup-short' | sdTranslate\"\n prefixIcon=\"settings\"\n (click)=\"_configComponent.open()\"\n type=\"text\">\n </sd-button>\n }\n <!-- Mobile: n\u00FAt Filter m\u1EDF mobile-filter drawer (inline filter \u1EA9n tr\u00EAn mobile) -->\n @if (_isMobile) {\n @if (!_tableOption.filter?.disabled && _mobileFilter) {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-mobile-filter-open' : null\"\n class=\"mr-8\"\n prefixIcon=\"filter_alt\"\n [title]=\"_mobileCards ? ('core.component.table.filter' | sdTranslate) : undefined\"\n (click)=\"_mobileFilter.open()\"\n type=\"text\">\n </sd-button>\n }\n }\n }\n </div>\n @let _unknownTotalPager = unknownTotalPager();\n @if (_unknownTotalPager) {\n <!-- paginate.total 'unknown': no total exists, so mat-paginator (which derives Next/Last and the\n range from `length`) is replaced by a pager that renders only the rows actually shown. -->\n @if (!_tableOption.paginate?.hidden && unknownTotalPagerVisible()) {\n <sd-table-unknown-total-paginator\n [class.sd-mobile-paginator]=\"_mobileCards\"\n [state]=\"_unknownTotalPager\"\n [pageSizeOptions]=\"_tableOption.paginate?.pages\"\n [hidePageSize]=\"_isMobile || !!_tableOption.paginate?.hidePageSize\"\n [showFirstButton]=\"!_isMobile && !!_tableOption.paginate?.showFirstLastButtons\"\n [autoId]=\"_autoId\"\n (page)=\"onUnknownTotalPage($event)\"></sd-table-unknown-total-paginator>\n } @else if (!_isMobile && !_tableOption.paginate?.hidden && unknownTotalSingleCount()) {\n <div class=\"T14R c-summary\">\n {{ 'core.component.table.showing' | sdTranslate }} <span class=\"T14M ml-2\">1-{{ unknownTotalSingleCount() }}</span>\n </div>\n }\n } @else {\n @let hidePaginator = !_tableOption.paginate?.pageSize || _total === undefined || _total <= _tableOption.paginate?.pageSize!;\n <mat-paginator\n [class.sd-mobile-paginator]=\"_mobileCards\"\n [class.d-none]=\"_tableOption.paginate?.hidden || hidePaginator\"\n [length]=\"_total\"\n [pageSize]=\"_tableOption.paginate?.pageSize\"\n [pageSizeOptions]=\"_tableOption.paginate?.pages!\"\n [showFirstLastButtons]=\"!_isMobile && _tableOption.paginate?.showFirstLastButtons\"\n [hidePageSize]=\"_isMobile || _tableOption.paginate?.hidePageSize\"\n [selectConfig]=\"{ panelClass: ['sd-select-panel', 'sd-table-page-size-panel'] }\"></mat-paginator>\n <!-- \"\u0110ang hi\u1EC3n th\u1ECB...\" ch\u1EC9 desktop -->\n @if (!_isMobile) {\n @if (!_tableOption.paginate?.hidden && hidePaginator && _total !== undefined && _total > 0) {\n <div class=\"T14R c-summary\">\n {{ 'core.component.table.showing' | sdTranslate }} <span class=\"T14M ml-2\">1-{{ _total }}/{{ _total }}</span>\n </div>\n }\n }\n }\n </div>\n </div>\n </div>\n\n @if (_tableOption.config?.visible) {\n <config [autoId]=\"_autoId\" [tableOption]=\"_tableOption\" />\n }\n <!-- Mobile filter drawer \u2014 ch\u1EC9 instantiate khi c\u1EA7n render tr\u00EAn mobile -->\n @if (!_tableOption.filter?.disabled && filterRegister) {\n <mobile-filter\n [autoId]=\"_autoId\"\n [filter]=\"_tableOption.filter!\"\n [externalFilters]=\"_tableOption.filter?.externalFilters!\"\n [columns]=\"mobileColumns()\"\n [filterDefs]=\"sdFilterDefs()\"\n [filterRegister]=\"filterRegister\"\n [cacheValues]=\"cacheValues\">\n </mobile-filter>\n }\n} @else if (_readState.status === 'error' && !_hideReadError) {\n <!-- why: lookup c\u00F3 th\u1EC3 l\u1ED7i tr\u01B0\u1EDBc khi c\u00F3 configuration; v\u1EABn ph\u1EA3i c\u00F3 l\u1ED1i retry v\u00E0 custom error template. -->\n <sd-data-state state=\"error\" [retryable]=\"true\" (sdRetry)=\"retryRead()\">\n @if (_dataStateTemplate; as custom) {\n <ng-template sdDataStateTemplate let-current let-retry=\"retry\" let-action=\"action\">\n <ng-container\n [ngTemplateOutlet]=\"custom.template\"\n [ngTemplateOutletContext]=\"{ $implicit: current, state: current, retry: retry, action: action }\"></ng-container>\n </ng-template>\n }\n </sd-data-state>\n} @else if (_loadingView === 'skeleton') {\n <!-- why: lookup c\u1ED9t (values/lazy-values) c\u00F3 th\u1EC3 ch\u1EADm; ch\u01B0a c\u00F3 configuration n\u00EAn ch\u01B0a bi\u1EBFt c\u1ED9t, v\u1EBD khung x\u01B0\u01A1ng chung\n thay v\u00EC \u0111\u1EC3 tr\u1ED1ng. Hydrate kh\u00F4ng c\u00F3 lookup xong trong microtask n\u00EAn kh\u1ED1i n\u00E0y kh\u00F4ng k\u1ECBp hi\u1EC7n. -->\n <div class=\"sd-table-skeleton-block\" aria-hidden=\"true\">\n @for (cells of genericSkeleton; track $index) {\n <div class=\"sd-table-skeleton-block-row\">\n @for (cell of cells; track cell.field) {\n <span class=\"sd-table-skeleton-cell\">\n <span class=\"sd-table-skeleton-bar\" [style.width]=\"cell.width\" [style.max-width]=\"cell.maxWidth\"></span>\n </span>\n }\n </div>\n }\n </div>\n}\n", styles: [":host:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}:host{display:flex;flex-direction:column;overflow:auto;width:100%;height:100%;--mat-table-row-item-container-height: 36px}:host .sd-table-live{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}:host .c-header-title{height:40px;display:flex;align-items:center}:host .sd-table-surface{display:flex;flex:1;flex-direction:column;min-width:0;min-height:0;background:var(--sd-surface, #fff);border-radius:var(--sd-radius-6, 6px)}:host .c-container{position:relative;min-height:50px;display:flex;flex-direction:column;flex:1;isolation:isolate}:host .c-container .c-table{position:relative;flex:1;display:flex;flex-direction:column}:host .c-container .c-table table{border-collapse:separate;width:100%}:host .c-container .c-table table tr.c-first-header.mat-mdc-header-row{height:40px}:host .c-container .c-table table tr.c-second-header.mat-mdc-header-row{height:40px}:host .c-container .c-table table.sd-table-grouped-header th.c-th{vertical-align:middle;padding-block:4px}:host .c-container .c-table table.sd-table-grouped-header tr.c-first-header.mat-mdc-header-row{height:32px}:host .c-container .c-table table.sd-table-grouped-header tr.c-filter-header.mat-mdc-header-row{height:auto}:host .c-container .c-table table.sd-table-grouped-header th.sd-filter-header{padding-block:0 8px;vertical-align:bottom}:host .c-container .c-table table.sd-table-grouped-header column-filter{display:flex;align-items:center;min-height:36px}:host .c-container .c-table table.sd-table-grouped-header th.sd-column-group{padding-block:4px;vertical-align:middle;background-color:color-mix(in srgb,var(--sd-border, #c4c6d0) 18%,var(--sd-table-group-header-mix, #f2f3f4));box-shadow:inset 0 -1px var(--sd-border, #c4c6d0)}:host .c-container .c-table table.sd-table-grouped-header th.sd-column-group .sd-column-group-title{height:auto;min-height:24px;justify-content:center;text-align:center;font-weight:var(--sd-font-weight-semibold, 600)}:host .c-container .c-table table tr.c-detail-row{height:0}:host .c-container .c-table table tr.c-row.activated{background-color:var(--sd-table-row-activated-bg, #e5ecff)}:host .c-container .c-table table tr.c-row.selected{background-color:var(--sd-table-row-selected-bg, #eef2ff)}:host .c-container .c-table table tr.c-row:not(.selected):not(.activated):hover{background-color:var(--sd-table-row-hover-bg, #f5f5f5)}:host .c-container .c-table table tr.c-row td{border-bottom-width:0}:host .c-container .c-table table tr.c-row.c-expandable{cursor:pointer}:host .c-container .c-table table tr.c-row.c-expandable:hover{background:var(--sd-table-row-hover-bg, #f5f5f5)}:host .c-container .c-table table th.mat-mdc-header-cell{background-color:var(--sd-table-header-bg, #f2f3f4);border-bottom:0!important}:host .c-container .c-table table td.mat-mdc-cell,:host .c-container .c-table table td.mat-mdc-footer-cell,:host .c-container .c-table table th.mat-mdc-header-cell{border-bottom-color:var(--sd-table-row-divider, #f2f2f2)!important}:host .c-container .c-table .c-th{vertical-align:middle;padding-block:8px;font-weight:var(--sd-font-weight-medium, 500);font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px);color:var(--sd-table-header-text, #212121)}:host .c-container .c-table .c-th.sd-col-resize-host{position:relative}:host .c-container .c-table .c-th.sd-resizing{-webkit-user-select:none;user-select:none}:host .c-container .c-table .c-th .sd-col-resize-handle{position:absolute;top:0;right:0;width:6px;height:100%;cursor:col-resize;-webkit-user-select:none;user-select:none;z-index:2}:host .c-container .c-table .c-th .sd-col-resize-handle:hover{background:color-mix(in srgb,var(--sd-text) 8%,transparent)}:host .c-container .c-table .c-td:first{padding-left:10px}:host .c-container .c-table .c-no-data-row{flex:1;width:100%;position:sticky;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center}:host .c-container .c-table .c-no-data-row .c-image{margin-bottom:16px;width:96px}:host .c-container .c-paginator{display:flex;flex-direction:row;justify-content:space-between;align-items:center;background-color:var(--sd-table-bg, #ffffff)}:host .c-container .c-paginator .mat-mdc-paginator{background:transparent;--mat-paginator-container-size: 40px;--mat-icon-button-state-layer-size: 32px;--mdc-icon-button-state-layer-size: 32px;--mdc-icon-button-icon-size: 20px}:host .c-container .c-paginator .c-action{padding:0}:host .c-container .c-paginator .c-action sd-button{margin:8px 5px}:host .c-container .c-paginator .c-summary{padding:8px 16px}:host .c-container .c-empty{text-align:center;background-color:var(--sd-table-bg, #ffffff);border:none!important}:host .c-container .c-empty sd-icon{font-size:150px;margin-top:30px;margin-bottom:30px;opacity:.2;width:auto;height:auto}:host button.c-btn-add{background-color:var(--sd-table-bg, #ffffff);box-shadow:var(--sd-shadow-sm)}:host .sd-reorder-header,:host .sd-reorder-cell{width:40px;min-width:40px;padding:0 4px;box-sizing:border-box}:host .sd-reorder-cell sd-icon{cursor:grab;color:var(--sd-text-muted);display:flex;align-items:center}:host .sd-reorder-cell sd-icon:active{cursor:grabbing}:host .sd-reorder-cell sd-icon.sd-reorder-disabled{opacity:.3;cursor:not-allowed;pointer-events:none}:host ::ng-deep .sd-mobile-paginator .mat-mdc-paginator-range-label{margin-inline:4px;white-space:nowrap}:host .c-container:not(.sd-table-mobile)>.c-table{border-radius:6px 6px 0 0}:host .c-container:not(.sd-table-mobile)>.c-paginator{border-radius:0}:host .sd-mobile-command-header{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px;padding:4px}:host .c-container.sd-table-mobile .c-paginator{flex-wrap:wrap;gap:4px}:host .c-container.sd-table-mobile .c-action{display:flex;align-items:center;min-width:0}:host .c-container.sd-table-mobile .sd-mobile-tools-trigger{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px}:host .c-container.sd-table-mobile .sd-mobile-paginator{margin-inline-start:auto}:host .c-container.sd-table-mobile .c-paginator,:host .c-container.sd-table-mobile .c-empty{background-color:var(--sd-surface);color:var(--sd-text)}:host .c-container.sd-table-mobile .c-paginator{background-color:var(--sd-table-bg, #ffffff)}:host ::ng-deep .sd-table-mobile .c-paginator button{min-width:44px;min-height:44px}:host .c-container.sd-table-mobile .c-paginator .sd-mobile-paginator{--mat-icon-button-state-layer-size: 44px;--mdc-icon-button-state-layer-size: 44px}:host ::ng-deep .mat-select-arrow{color:var(--sd-table-select-arrow, #a6a6a6)}:host ::ng-deep .sd-table-sort-header{cursor:pointer;outline:none}:host ::ng-deep .sd-table-sort-header:focus-visible{border-bottom:solid 1px currentColor}:host ::ng-deep th[aria-sort] .sd-table-sort-header{position:relative;padding-right:24px}:host ::ng-deep th[aria-sort] .sd-table-sort-header:after{content:\"\";position:absolute;top:50%;right:0;width:16px;height:16px;transform:translateY(-50%);background-color:var(--sd-text-secondary);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-size:16px 16px;mask-size:16px 16px;pointer-events:none}:host ::ng-deep th[aria-sort=ascending] .sd-table-sort-header:after,:host ::ng-deep th[aria-sort=descending] .sd-table-sort-header:after{background-color:var(--sd-text)}:host ::ng-deep th[aria-sort=none] .sd-table-sort-header:after{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M12 5.83L15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9 12 5.83zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15 12 18.17z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M12 5.83L15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9 12 5.83zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15 12 18.17z'/%3E%3C/svg%3E\")}:host ::ng-deep th[aria-sort=ascending] .sd-table-sort-header:after{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z'/%3E%3C/svg%3E\")}:host ::ng-deep th[aria-sort=descending] .sd-table-sort-header:after{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z'/%3E%3C/svg%3E\")}:host ::ng-deep .c-paginator .mat-mdc-paginator-range-label{margin:0 4px}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size{align-items:center}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select{--mat-select-trigger-text-size: var(--sd-font-size-14, 14px);--mat-paginator-select-trigger-text-size: var(--sd-font-size-14, 14px)}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select .mat-mdc-form-field-infix{display:flex;align-items:center;height:32px;min-height:32px;padding-top:0;padding-bottom:0}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select.mat-mdc-form-field .mat-mdc-form-field-infix mat-select.mat-mdc-select{margin-top:0}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select .mat-mdc-text-field-wrapper{padding-right:8px}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select .mat-mdc-select-arrow-wrapper{width:20px;justify-content:center}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select .mat-mdc-select-arrow{width:16px;height:16px;color:var(--sd-text-secondary);background-color:currentColor;-webkit-mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z'/%3E%3C/svg%3E\") center/16px 16px no-repeat;mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z'/%3E%3C/svg%3E\") center/16px 16px no-repeat}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select .mat-mdc-select-arrow svg{display:none}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select .mat-mdc-form-field-flex:hover .mat-mdc-select-arrow{color:var(--sd-text)}::ng-deep .mat-mdc-select-panel.sd-select-panel.sd-table-page-size-panel .mat-mdc-option{min-height:36px;padding:7px 12px}:host ::ng-deep .cdk-drag-preview{box-shadow:var(--sd-shadow-md);background:var(--sd-table-bg);display:table;width:100%}:host ::ng-deep .cdk-drag-preview td{padding:0 8px;border-bottom:1px solid var(--sd-table-row-divider)}:host ::ng-deep .cdk-drag-placeholder{opacity:0}:host ::ng-deep .cdk-drop-list-dragging tr.c-row:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}:host ::ng-deep .sd-selection-cell{width:42px;min-width:42px;max-width:42px}:host ::ng-deep .sd-filler-cell{width:auto;min-width:0;padding:0!important;border:0}:host ::ng-deep .sd-group-header-cell{background:var(--sd-table-group-row-bg, #f5f7fc);border-top:1px solid var(--sd-table-group-row-border, #e6e9f2);border-bottom:1px solid var(--sd-table-group-row-border, #e6e9f2)}:host ::ng-deep .sd-group-row{min-height:36px}:host ::ng-deep .sd-group-selection-slot{width:42px;min-width:42px;max-width:42px}:host ::ng-deep .c-selection{transform:scale(.85);transform-origin:center}:host ::ng-deep .sd-tree-line{display:inline-flex;align-items:center;min-height:32px}:host ::ng-deep .sd-tree-indent{flex:0 0 auto}:host ::ng-deep .sd-tree-toggle-slot{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px}:host ::ng-deep .sd-tree-toggle-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;background:transparent;border-radius:50%;cursor:pointer;color:var(--sd-text-secondary, #5b6472);transition:background-color .15s ease}:host ::ng-deep .sd-tree-toggle-btn sd-icon{font-size:var(--sd-font-size-18, 18px);width:18px;height:18px;line-height:var(--sd-line-height-18, 18px)}:host ::ng-deep .sd-tree-toggle-btn:hover{background-color:color-mix(in srgb,var(--sd-text) 8%,transparent)}:host ::ng-deep .sd-tree-toggle-btn[aria-busy=true]{cursor:progress}:host ::ng-deep .sd-tree-stt{margin-left:2px;white-space:nowrap}:host ::ng-deep .sd-tree-index-cell{text-align:left!important;white-space:nowrap;padding-left:8px;padding-right:8px}:host ::ng-deep .sd-tree-index-header{padding-left:32px}:host ::ng-deep tr.c-row.sd-tree-row.sd-tree-level-0{background:var(--sd-table-tree-level-0-bg, #fbfcfe)}:host ::ng-deep tr.c-row.sd-tree-row.sd-tree-level-0>td{font-weight:var(--sd-font-weight-medium, 500)}:host ::ng-deep tr.c-row.sd-tree-row.sd-tree-level-1{background:var(--sd-table-tree-level-1-bg, #ffffff)}:host ::ng-deep tr.c-row.sd-tree-row.sd-tree-level-2{background:var(--sd-table-tree-level-2-bg, #fafbfd)}:host ::ng-deep tr.c-row.sd-tree-row.sd-tree-level-3{background:var(--sd-table-tree-level-3-bg, #f6f8fb)}:host ::ng-deep .sd-stt-root{font-weight:var(--sd-font-weight-bold, 700);color:var(--sd-table-tree-root-text, #1f2330)}:host ::ng-deep .sd-mobile-tools-trigger .mdc-button__label{display:inline-flex;align-items:center;gap:6px}:host .sd-table-surface--quick-search>.c-container:not(.sd-table-mobile)>.c-table{border-top-left-radius:0;border-top-right-radius:0}@keyframes sd-table-skeleton-sweep{to{background-position:480px 0}}@keyframes sd-table-progress-run{0%{transform:translate(-100%)}to{transform:translate(285.7142857143%)}}@keyframes sd-table-spin{to{transform:rotate(360deg)}}:host tr.sd-table-skeleton-row{height:var(--mat-table-row-item-container-height, 36px)}:host .sd-table-skeleton-cell{padding:0 8px;border-bottom:1px solid var(--sd-table-row-divider);vertical-align:middle}:host .sd-table-skeleton-bar{display:block;height:12px;border-radius:var(--sd-radius-4, 4px);background:linear-gradient(90deg,var(--sd-table-skeleton-bg) 0,var(--sd-table-skeleton-highlight) 40%,var(--sd-table-skeleton-bg) 80%) 0 0/480px 100%;animation:sd-table-skeleton-sweep 1.4s linear infinite}@media(prefers-reduced-motion:reduce){:host .sd-table-skeleton-bar{animation:none}}@media(forced-colors:active){:host .sd-table-skeleton-bar{forced-color-adjust:none;background:GrayText}}:host .sd-table-skeleton-bar[data-align=end]{margin-inline-start:auto}:host .sd-table-skeleton-bar[data-align=center]{margin-inline:auto}:host .sd-table-skeleton-bar[data-shape=pill]{height:20px;border-radius:999px}:host .sd-table-skeleton-bar[data-shape=box]{width:14px;height:14px;border-radius:3px}:host .sd-table-skeleton-block{overflow:hidden;border-radius:var(--sd-radius-6, 6px);background:var(--sd-surface)}:host .sd-table-skeleton-block-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:center;height:var(--mat-table-row-item-container-height, 36px);border-bottom:1px solid var(--sd-table-row-divider)}:host .sd-table-skeleton-block-row>.sd-table-skeleton-cell{border-bottom:0}:host .c-table>table>::ng-deep tbody{transition:opacity var(--sd-duration-fast, .12s)}@media(prefers-reduced-motion:reduce){:host .c-table>table>::ng-deep tbody{transition:none}}:host .c-table.c-table--dim{cursor:progress}:host .c-table.c-table--dim>table>::ng-deep thead,:host .c-table.c-table--dim>table>::ng-deep tfoot{cursor:auto}:host .c-table.c-table--dim>table>::ng-deep tbody{opacity:var(--sd-table-loading-dim, .55)}:host .c-table.c-table--dim>table>::ng-deep tbody,:host .c-table.c-table--dim>table>::ng-deep tbody *{pointer-events:none!important}:host .sd-table-progress{position:absolute;top:var(--sd-table-head-h, 0px);right:0;left:0;z-index:20;height:2px;overflow:hidden;pointer-events:none;background:var(--sd-table-progress-track)}:host .sd-table-progress:before{content:\"\";position:absolute;inset:0 auto 0 0;width:35%;background:var(--sd-table-spinner);animation:sd-table-progress-run 1.1s ease-in-out infinite}@media(prefers-reduced-motion:reduce){:host .sd-table-progress:before{width:100%;opacity:.6;animation:none}}@media(forced-colors:active){:host .sd-table-progress{forced-color-adjust:none;box-sizing:content-box;border:1px solid CanvasText;background:Canvas}:host .sd-table-progress:before{background:Highlight}}:host .sd-table-spinner{display:inline-block;flex:0 0 auto;vertical-align:middle;box-sizing:border-box;width:16px;height:16px;border:2px solid var(--sd-table-progress-track);border-top-color:var(--sd-table-spinner);border-radius:50%;animation:sd-table-spin .8s linear infinite}@media(prefers-reduced-motion:reduce){:host .sd-table-spinner{animation:none}}@media(forced-colors:active){:host .sd-table-spinner{forced-color-adjust:none;border-color:GrayText;border-top-color:Highlight}}:host .sd-table-progress-anchor{position:sticky;top:0;z-index:20;height:0}:host .sd-table-progress-anchor>.sd-table-progress{top:0}.sd-aggregate-row,.sd-aggregate-total,.sd-mobile-aggregate{background:color-mix(in srgb,var(--sd-surface-muted) 35%,var(--sd-surface));color:var(--sd-text);font-weight:var(--sd-font-weight-medium, 500)}.sd-aggregate-cell{background:inherit;border-top:1px solid var(--sd-border)}:host(.sd-table--fill){flex:1 1 0;height:auto;min-height:var(--sd-table-fill-min, 0px);overflow:visible}:host(.sd-table--fill) .c-container{min-height:0}:host(.sd-table--fill) .c-container>.c-table{min-height:calc(var(--sd-table-fill-head, 40px) + 5 * var(--mat-table-row-item-container-height, 36px))}:host(.sd-table--fill) .c-container>.c-paginator{flex:none;min-height:48px}\n", ":host ::ng-deep .sticky-shadow-right{overflow:visible!important}:host ::ng-deep .sticky-shadow-right:after{content:\"\";position:absolute;top:0;right:0;bottom:0;width:8px;transform:translate(100%);background:linear-gradient(to right,rgba(0,0,0,.12),transparent);pointer-events:none}:host ::ng-deep .sticky-shadow-left{overflow:visible!important}:host ::ng-deep .sticky-shadow-left:after{content:\"\";position:absolute;top:0;left:0;bottom:0;width:8px;transform:translate(-100%);background:linear-gradient(to left,rgba(0,0,0,.12),transparent);pointer-events:none}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdDataState, selector: "sd-data-state", inputs: ["state", "title", "message", "icon", "fontSet", "iconShape", "retryable", "retryLabel", "actionLabel", "compact", "fullPage"], outputs: ["sdRetry", "sdAction"] }, { kind: "directive", type: SdDataStateTemplateDirective, selector: "ng-template[sdDataStateTemplate]" }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i3$3.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i4$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i4$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i4$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i4$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i4$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i4$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i4$1.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i4$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i4$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i4$1.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i4$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i4$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i4$1.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "directive", type: i4$1.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i5.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i3.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatRadioModule }, { kind: "component", type: i4.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i1$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i1$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i1$1.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType", "indicator", "indicatorColor", "indicatorMax", "indicatorLabel"], outputs: ["click"] }, { kind: "component", type: SdButtonItem, selector: "sd-button-item", inputs: ["color", "prefixIcon", "suffixIcon", "fontSet", "disabled", "tooltip", "autoId"], outputs: ["click"] }, { kind: "component", type: DesktopCommand, selector: "desktop-command", inputs: ["autoId", "item", "itemIndex", "commands"] }, { kind: "component", type: DesktopCellComponent, selector: "desktop-cell", inputs: ["column", "item", "cellDef"] }, { kind: "component", type: ColumnTitleComponent, selector: "column-title", inputs: ["column", "titleDef"] }, { kind: "component", type: ExternalFilterComponent, selector: "external-filter", inputs: ["autoId", "filter", "externalFilters", "filterRegister", "collapsedByDefault"] }, { kind: "component", type: TableQuickSearchComponent, selector: "sd-table-quick-search", inputs: ["option", "value", "autoId", "rightTemplate"], outputs: ["valueChange"] }, { kind: "component", type: ConfigComponent, selector: "config", inputs: ["autoId", "tableOption"], outputs: ["changes"] }, { kind: "component", type: ColumnFilterComponent, selector: "column-filter", inputs: ["autoId", "column", "columnFilter", "cacheValues", "value", "operator", "isMobile"], outputs: ["operatorChange", "filterChange", "filterCommit"] }, { kind: "component", type: MobileFilterComponent, selector: "mobile-filter", inputs: ["autoId", "filter", "externalFilters", "columns", "filterDefs", "filterRegister", "cacheValues"] }, { kind: "directive", type: SdAggregateLayoutDirective, selector: "table[sdAggregateLayout]" }, { kind: "directive", type: SdTableFooterRowDefDirective, selector: "[sdTableFooterRowDef]", inputs: ["sdTableFooterRowDef", "sdTableFooterRowDefSticky"] }, { kind: "directive", type: SdScrollDirective, selector: "[sdScroll]" }, { kind: "directive", type: SdHoverCopyDirective, selector: "[sdHoverCopy]", inputs: ["sdHoverCopy", "sdHoverCopyDisabled"] }, { kind: "component", type: SelectorActionComponent, selector: "selector-action", inputs: ["autoId", "tableOption", "selectedTableItems"], outputs: ["clear"] }, { kind: "directive", type: StickyShadowDirective, selector: "[stickyShadow]" }, { kind: "directive", type: SdColumnResizeDirective, selector: "[sdColumnResize]", inputs: ["sdColumnResize", "minWidth", "maxWidth"], outputs: ["resizeEnd"] }, { kind: "directive", type: SdTableSortHeaderDirective, selector: "[sdTableSortHeader]", inputs: ["sdTableSortHeader"] }, { kind: "component", type: SdTableMobileCardsComponent, selector: "sd-table-mobile-cards", inputs: ["table", "rows", "dataRows", "aggregateTemplate", "groupTemplate"] }, { kind: "component", type: SdTableMobileActionsComponent, selector: "sd-table-mobile-actions", inputs: ["actions", "title", "selection", "count", "autoOpen", "autoId"], outputs: ["end"] }, { kind: "component", type: SdTableUnknownTotalPaginator, selector: "sd-table-unknown-total-paginator", inputs: ["state", "pageSizeOptions", "hidePageSize", "showFirstButton", "autoId"], outputs: ["page"] }, { kind: "pipe", type: i1$2.JsonPipe, name: "json" }, { kind: "pipe", type: SdGroupPipe, name: "sdGroup" }, { kind: "pipe", type: SdTreePipe, name: "sdTree" }, { kind: "pipe", type: SdAggregateRowsPipe, name: "sdAggregateRows" }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], animations: [
|
|
8619
|
+
], queries: [{ propertyName: "dataStateTemplate", first: true, predicate: SdDataStateTemplateDirective, descendants: true, isSignal: true }, { propertyName: "sdSubInformation", first: true, predicate: SdTableExpandDefDirective, descendants: true, isSignal: true }, { propertyName: "sdGroupDef", first: true, predicate: SdTableGroupDefDirective, descendants: true, isSignal: true }, { propertyName: "sdCellDefs", predicate: SdTableCellDefDirective, isSignal: true }, { propertyName: "sdCommandHeaderDef", first: true, predicate: SdTableCommandHeaderDefDirective, descendants: true, isSignal: true }, { propertyName: "sdQuickSearchRightDef", first: true, predicate: SdTableQuickSearchRightDefDirective, descendants: true, isSignal: true }, { propertyName: "sdFooterDefs", predicate: SdMaterialFooterDefDirective, isSignal: true }, { propertyName: "sdFilterDefs", predicate: SdTableFilterDefDirective, isSignal: true }, { propertyName: "sdTitleDefs", predicate: SdTableTitleDefDirective, isSignal: true }, { propertyName: "sdRowMobileDef", first: true, predicate: SdTableRowMobileDefDirective, isSignal: true }], viewQueries: [{ propertyName: "table", first: true, predicate: MatTable, descendants: true, isSignal: true }, { propertyName: "configComponent", first: true, predicate: ConfigComponent, descendants: true, isSignal: true }, { propertyName: "sdPopupExport", first: true, predicate: SdPopupExport, descendants: true, isSignal: true }, { propertyName: "scroll", first: true, predicate: SdScrollDirective, descendants: true, isSignal: true }, { propertyName: "quickAction", first: true, predicate: SdQuickAction, descendants: true, isSignal: true }, { propertyName: "externalFilter", first: true, predicate: ExternalFilterComponent, descendants: true, isSignal: true }, { propertyName: "mobileFilter", first: true, predicate: MobileFilterComponent, descendants: true, isSignal: true }, { propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true, isSignal: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true, isSignal: true }, { propertyName: "quickSearchControl", first: true, predicate: TableQuickSearchComponent, descendants: true, isSignal: true }, { propertyName: "queryBar", first: true, predicate: SdQueryBar, descendants: true, isSignal: true }], ngImport: i0, template: "@let _visibleSelectAll = visibleSelectAll();\n@let _isSelectIndeterminate = isSelectIndeterminate();\n@let _isSelectAll = isSelectAll();\n@let _configuration = configuration();\n@let _tableOption = tableOption()!;\n@let _loading = loading();\n@let _loadingView = loadingView();\n@let _readState = readState();\n@let _hideReadError = hideReadError();\n@let _dataStateTemplate = dataStateTemplate();\n@let _items = items();\n@let _total = total();\n@let _isFiltered = isFiltered();\n@let _requireFiltered = requireFiltered();\n@let _export = _tableOption?.export;\n@let _exporting = exporting();\n@let _titleDef = titleDef();\n@let _autoId = autoId();\n@let _exportTitle = exportTitle();\n@let _cellDef = cellDef();\n@let _footerDef = footerDef();\n@let _sdSubInformation = sdSubInformation();\n@let _configComponent = configComponent();\n@let _mobileFilter = mobileFilter();\n@let _selectedTableItems = selectedTableItems();\n@let _rowCommands = rowCommands();\n@let _mobileCards = mobileCards();\n@let _isMobile = isMobile();\n@let _queryBarMode = queryBarMode();\n@let _queryBarKeys = queryBarModel()?.columnKeys;\n@let _queryBarActive = queryBarActiveKeys();\n@let _showInlineFilter =\n !_queryBarMode &&\n !_isMobile &&\n !_tableOption?.filter?.disabled &&\n _tableOption?.filter?.hideInlineFilter !== true &&\n !(_tableOption?.filter?.hideInlineFilter === 'auto' && !_isFiltered && knownRowCount()! <= 10);\n@let _commandHeaderDef = sdCommandHeaderDef();\n@let _quickSearch = quickSearchOption();\n@let _aggregate = aggregateSnapshot();\n@let _aggregateColumns = aggregateColumns();\n@let _aggregateColumnIds = aggregateColumnIds();\n@let _headerFilterColumns = headerFilterColumns();\n<!-- why: tree kh\u00F4ng c\u00F2n c\u1ED9t ri\u00EAng \u2014 khi KH\u00D4NG c\u00F3 c\u1ED9t Index, icon expand nh\u00FAng v\u00E0o\n c\u1ED9t data \u0111\u1EA7u ti\u00EAn. \u0110\u00E2y l\u00E0 field c\u1EE7a c\u1ED9t \u0111\u00F3 (null n\u1EBFu c\u00F3 Index ho\u1EB7c kh\u00F4ng tree). -->\n@let _treeFirstField = _tableOption?.tree && !_tableOption.index?.enabled ? _configuration?.firstColumns?.[0]?.field : null;\n\n<!-- why: v\u00F9ng status lu\u00F4n c\u00F3 trong DOM, k\u1EC3 c\u1EA3 tr\u01B0\u1EDBc khi c\u00F3 configuration. V\u00F9ng ch\u1EC9 render trong l\u00FAc t\u1EA3i b\u1ECB g\u1EE1\n tr\u01B0\u1EDBc khi screen reader k\u1ECBp \u0111\u1ECDc v\u00E0 kh\u00F4ng b\u00E1o \u0111\u01B0\u1EE3c \"\u0111\u00E3 t\u1EA3i xong\". -->\n<span class=\"sd-table-live\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">{{ liveMessage() }}</span>\n@if (_configuration) {\n @if (!_queryBarMode && !_mobileCards && !_tableOption.filter?.disabled && !!_tableOption.filter?.externalFilters?.length && filterRegister) {\n <external-filter\n class=\"mb-16\"\n [autoId]=\"_autoId\"\n [filterRegister]=\"filterRegister\"\n [filter]=\"_tableOption.filter!\"\n [externalFilters]=\"_tableOption.filter?.externalFilters!\"\n [collapsedByDefault]=\"externalFilterCollapsedByDefault()\">\n </external-filter>\n }\n @let groupedItems = _items | sdTree: _tableOption.tree : treeRevision() | sdGroup: _tableOption : groupExpandState : groupHost;\n @let renderItems = groupedItems | sdAggregateRows: _aggregate : _tableOption : aggregateRenderHost;\n\n <ng-template #aggregateCell let-cell>\n @if (cell) {\n @if (cell.templateRef) {\n <ng-container *ngTemplateOutlet=\"cell.templateRef; context: cell.context\"></ng-container>\n } @else {\n <span [attr.data-complete]=\"cell.context.isComplete\">{{ cell.text }}</span>\n }\n }\n </ng-template>\n <ng-template #inlineColumnFilter let-column>\n <column-filter\n [autoId]=\"_autoId\"\n [value]=\"columnFilter?.[column.field!]!\"\n [operator]=\"columnOperator[column.field]\"\n (operatorChange)=\"columnOperator[column.field] = $event!; onOperatorChange(column, $event)\"\n [columnFilter]=\"columnFilter!\"\n [cacheValues]=\"cacheValues\"\n [column]=\"column\"\n (filterChange)=\"onFilterChange()\"\n (filterCommit)=\"onFilterCommit()\">\n </column-filter>\n </ng-template>\n <!-- Icon l\u1ECDc \u1EDF header c\u1ED9t (mode query-bar): m\u1EDF chip c\u1EE7a field tr\u00EAn thanh. why: n\u1EB1m c\u1EA1nh .c-header-title ch\u1EE9 kh\u00F4ng\n n\u1EB1m trong \u2014 title sort \u0111\u01B0\u1EE3c l\u00E0 role=button v\u00E0 b\u1EAFt Enter, l\u1ED3ng button v\u00E0o s\u1EBD th\u00E0nh nested-interactive v\u00E0 Enter\n tr\u00EAn icon s\u1EBD sort. Ch\u1EB7n mousedown/click \u0111\u1EC3 kh\u00F4ng sort, kh\u00F4ng b\u1EAFt \u0111\u1EA7u k\u00E9o c\u1ED9t. -->\n <ng-template #queryBarTrigger let-column>\n @let _triggerKey = _queryBarKeys?.get(column.field);\n @if (_triggerKey) {\n @let _triggerActive = _queryBarActive.has(_triggerKey);\n <button\n type=\"button\"\n class=\"sd-table-filter-trigger\"\n [class.sd-table-filter-trigger--active]=\"_triggerActive\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-filter-trigger-' + column.field : null\"\n [attr.aria-label]=\"filterTriggerLabel(column, _triggerActive)\"\n aria-haspopup=\"menu\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"$event.stopPropagation(); openQueryBarField(_triggerKey, $event.currentTarget)\">\n <sd-icon name=\"filter_alt\" aria-hidden=\"true\"></sd-icon>\n </button>\n }\n </ng-template>\n <ng-template #mobileAggregate let-summary=\"summary\">\n <div class=\"sd-mobile-aggregate p-12\" role=\"region\" [attr.aria-label]=\"'core.component.table.mobile.summary' | sdTranslate\">\n @for (entry of _aggregateColumns; track entry.field) {\n @let cell = summary.cells.get(entry.field);\n @if (cell && entry.column) {\n <div class=\"d-flex align-items-center flex-wrap gap-8 py-8\">\n <column-title [column]=\"entry.column\" [titleDef]=\"_titleDef[entry.field]\"></column-title>\n <ng-container *ngTemplateOutlet=\"aggregateCell; context: { $implicit: cell }\"></ng-container>\n </div>\n }\n }\n </div>\n </ng-template>\n\n <!-- Tree toggle d\u00F9ng chung: indent (theo c\u1EA5p) + slot chevron/spinner. Nh\u00FAng v\u00E0o\n c\u1ED9t Index ho\u1EB7c c\u1ED9t data \u0111\u1EA7u qua *ngTemplateOutlet (context: { row }). -->\n <ng-template #sdTreeToggle let-row=\"row\">\n @let _tree = row?.meta?.tree;\n @if (_tree) {\n <span class=\"sd-tree-indent\" [style.width.px]=\"(_tree.level ?? 0) * (_tableOption.tree?.indentSize ?? 20)\"></span>\n <span class=\"sd-tree-toggle-slot\">\n @if (_tree.hasChildren) {\n @let _aid = _autoId;\n @let _expanding = !!_tree.isExpanding;\n <!-- why: n\u00FAt lu\u00F4n n\u1EB1m trong DOM, ch\u1EC9 \u0111\u1ED5i icon th\u00E0nh spinner khi \u0111ang t\u1EA3i con; g\u1EE1 n\u00FAt l\u00E0m focus b\u00E0n ph\u00EDm r\u01A1i\n v\u1EC1 body. Click trong l\u00FAc t\u1EA3i b\u1ECB onTreeToggle b\u1ECF qua. -->\n <button\n type=\"button\"\n class=\"sd-tree-toggle-btn\"\n [attr.data-autoid]=\"_aid ? _aid + '-tree-toggle-' + row.meta.id : null\"\n [attr.aria-label]=\"'core.component.table.tree-toggle' | sdTranslate\"\n [attr.aria-expanded]=\"!!_tree.isExpanded\"\n [attr.aria-busy]=\"_expanding ? 'true' : null\"\n [attr.aria-disabled]=\"_expanding ? 'true' : null\"\n (click)=\"onTreeToggle(row); $event.stopPropagation()\">\n @if (_expanding) {\n <span class=\"sd-table-spinner\" aria-hidden=\"true\"></span>\n } @else {\n <sd-icon [name]=\"_tree.isExpanded ? 'expand_more' : 'chevron_right'\"></sd-icon>\n }\n </button>\n }\n </span>\n }\n </ng-template>\n\n <ng-template #sdGroupHeader let-item=\"item\">\n <div class=\"sd-group-row d-flex align-items-center py-8\">\n @if (_tableOption.selector?.visible && !_tableOption.selector?.single) {\n <div class=\"sd-group-selection-slot d-flex align-items-center justify-content-center\">\n <mat-checkbox\n class=\"c-selection\"\n color=\"primary\"\n [checked]=\"isGroupAllSelected(item)\"\n [indeterminate]=\"isGroupIndeterminate(item)\"\n (change)=\"onSelectGroup(item, $event.checked)\">\n </mat-checkbox>\n </div>\n } @else {\n <div class=\"sd-group-selection-slot\"></div>\n }\n @if (_tableOption.group?.collapsible) {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-group-toggle-' + (item.meta.group?.key || item.meta.id) : null\"\n type=\"text\"\n [prefixIcon]=\"item.meta.group.isExpanded ? 'expand_more' : 'chevron_right'\"\n width=\"32px\"\n (click)=\"toggleGroupExpand(item)\">\n </sd-button>\n }\n @if (sdGroupDef()?.templateRef; as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl; context: groupContext(item)\"></ng-container>\n } @else {\n <span class=\"T14R\">{{ item.meta.group.values | json }}</span>\n }\n </div>\n </ng-template>\n\n <ng-content select=\"[sdTableTop]\"></ng-content>\n @let _queryBarOption = queryBarOption();\n <div\n class=\"sd-table-surface\"\n [class.sd-table-surface--quick-search]=\"!!_quickSearch && !_queryBarMode\"\n [class.sd-table-surface--query-bar]=\"_queryBarMode && !!_queryBarOption\">\n @if (_queryBarMode) {\n <!-- why: thanh n\u1EB1m tr\u00EAn .c-container, ngo\u00E0i l\u1EDBp loading (l\u00E0m m\u1EDD .c-table) \u2014 lu\u00F4n b\u1EA5m \u0111\u01B0\u1EE3c khi \u0111ang t\u1EA3i. -->\n @if (_queryBarOption) {\n @let _queryBarHint = queryBarHint();\n <sd-query-bar\n class=\"sd-table-query-bar\"\n role=\"search\"\n [attr.aria-label]=\"'core.component.table.filter' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-query-bar' : null\"\n [option]=\"_queryBarOption\"\n [(filters)]=\"barFilters\"\n [(search)]=\"barSearch\"\n (apply)=\"onQueryBarApply($event)\">\n @if (sdQuickSearchRightDef(); as _right) {\n <div sdQueryBarEnd class=\"sd-table-query-bar-end\"><ng-container [ngTemplateOutlet]=\"_right.templateRef\" /></div>\n }\n </sd-query-bar>\n @if (_queryBarHint) {\n <p class=\"sd-table-query-bar-hint\" [id]=\"queryBarHintId\">\n <sd-icon name=\"error_outline\" aria-hidden=\"true\"></sd-icon>\n <span>{{ _queryBarHint }}</span>\n </p>\n }\n }\n } @else if (_quickSearch) {\n <sd-table-quick-search\n [option]=\"_quickSearch\"\n [value]=\"quickSearchValue()\"\n [autoId]=\"_autoId\"\n [rightTemplate]=\"sdQuickSearchRightDef()?.templateRef\"\n (valueChange)=\"onQuickSearchChange($event)\" />\n }\n <div class=\"c-container\" [class.sd-table-mobile]=\"_mobileCards\">\n <!-- why: l\u1EDBp loading kh\u00F4ng ph\u1EE7 l\u00EAn b\u1EA3ng: header, filter, sort v\u00E0 thanh cu\u1ED9n lu\u00F4n d\u00F9ng \u0111\u01B0\u1EE3c. Ch\u01B0a c\u00F3 d\u00F2ng th\u00EC\n khung x\u01B0\u01A1ng (matNoDataRow); \u0111\u00E3 c\u00F3 d\u00F2ng th\u00EC gi\u1EEF d\u00F2ng c\u0169, qu\u00E1 showDelay m\u1EDBi l\u00E0m m\u1EDD d\u00F2ng v\u00E0 hi\u1EC7n thanh ti\u1EBFn\n tr\u00ECnh. aria-busy v\u1EABn theo loading() th\u1EADt; v\u00F9ng .sd-table-live b\u00E1o \"\u0111ang t\u1EA3i\"/\"\u0111\u00E3 t\u1EA3i xong\". -->\n <div\n class=\"c-table\"\n sdScroll\n stickyShadow\n matSort\n [matSortDisabled]=\"!_tableOption.sort?.enable\"\n [class.c-table--dim]=\"_loadingView === 'refresh' && loadingSettings().dim\"\n [attr.aria-busy]=\"_loading ? 'true' : null\"\n [style.max-height]=\"_tableOption.style?.maxHeight\"\n [style.min-height]=\"_tableOption.style?.minHeight\">\n @if (_mobileCards) {\n @if (_commandHeaderDef) {\n <div class=\"sd-mobile-command-header\"><ng-container *ngTemplateOutlet=\"_commandHeaderDef.templateRef\"></ng-container></div>\n }\n @if (_loadingView === 'refresh') {\n <!-- Mobile: kh\u00F4ng c\u00F3 header b\u1EA3ng; thanh n\u1EB1m \u1EDF m\u00E9p tr\u00EAn danh s\u00E1ch th\u1EBB, d\u01B0\u1EDBi command header. Anchor cao 0\n n\u00EAn thanh hi\u1EC7n/\u1EA9n kh\u00F4ng \u0111\u1EA9y th\u1EBB. -->\n <div class=\"sd-table-progress-anchor\">\n <div class=\"sd-table-progress\" aria-hidden=\"true\"></div>\n </div>\n }\n <sd-table-mobile-cards\n [table]=\"this\"\n [rows]=\"renderItems\"\n [dataRows]=\"groupedItems\"\n [groupTemplate]=\"sdGroupHeader\"\n [aggregateTemplate]=\"mobileAggregate\"></sd-table-mobile-cards>\n @if (_aggregate.total; as summary) {\n <ng-container *ngTemplateOutlet=\"mobileAggregate; context: { summary: summary }\"></ng-container>\n }\n @if (hasFooter()) {\n <div class=\"sd-mobile-footer p-12\" role=\"region\" [attr.aria-label]=\"'core.component.table.mobile.summary' | sdTranslate\">\n @for (column of mobileFooterColumns(); track column.field) {\n <div class=\"d-flex align-items-center flex-wrap gap-8 py-8\">\n <column-title [column]=\"column\" [titleDef]=\"_titleDef[column.field]\"></column-title>\n <ng-container\n *ngTemplateOutlet=\"_footerDef[column.field].templateRef; context: { items: _items, column: column }\"></ng-container>\n </div>\n }\n </div>\n }\n } @else {\n <table\n mat-table\n [class.sd-table-grouped-header]=\"_configuration.multipleHeader\"\n sdAggregateLayout\n [dataSource]=\"renderItems\"\n [trackBy]=\"trackBy\"\n multiTemplateDataRows\n cdkDropList\n [cdkDropListData]=\"groupedItems\"\n [cdkDropListDisabled]=\"!_tableOption.rowReorder?.enabled\"\n [cdkDropListSortPredicate]=\"reorderSortPredicate\"\n (cdkDropListDropped)=\"onReorderDrop($event)\">\n @if (_tableOption.rowReorder?.enabled) {\n <ng-container matColumnDef=\"sdReorder\">\n <th mat-header-cell *matHeaderCellDef class=\"sd-reorder-header\" [attr.rowspan]=\"_configuration.multipleHeader ? 2 : 1\"></th>\n <td mat-cell *matCellDef=\"let row\" class=\"sd-reorder-cell\">\n @if (!row.meta?.group?.items?.length) {\n <sd-icon\n cdkDragHandle\n [class.sd-reorder-disabled]=\"isReorderDisabled(row)\"\n [name]=\"_tableOption.rowReorder?.icon || 'drag_indicator'\"></sd-icon>\n }\n </td>\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n }\n\n <ng-container matColumnDef=\"sdSubInformation\" sticky>\n <td class=\"p-0\" mat-cell *matCellDef=\"let item\" [attr.colspan]=\"_configuration.displayedColumns.length\">\n @if (_sdSubInformation?.templateRef) {\n @if (_tableOption.expand?.always) {\n <ng-container *ngTemplateOutlet=\"_sdSubInformation?.templateRef!; context: { item: item }\"> </ng-container>\n } @else {\n <div [@detailExpand]=\"item.meta.expand?.isExpanded ? 'expanded' : 'collapsed'\">\n @if (item.meta.expand?.isExpanded) {\n <ng-container *ngTemplateOutlet=\"_sdSubInformation?.templateRef!; context: { item: item }\"> </ng-container>\n }\n </div>\n }\n }\n </td>\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"sdSubInformationAction\" stickyEnd>\n <th\n class=\"p-0\"\n mat-header-cell\n *matHeaderCellDef\n style=\"width: 1px\"\n [attr.rowspan]=\"_configuration.multipleHeader ? 2 : 1\"></th>\n <td mat-cell *matCellDef=\"let element\">\n @if (!_tableOption.expand?.always) {\n @let _expanding = !!element.meta.expand?.isExpanding;\n <!-- why: n\u00FAt 35px gi\u1EEF nguy\u00EAn khi \u0111ang t\u1EA3i ([loading] thay prefix icon b\u1EB1ng spinner) \u0111\u1EC3 focus b\u00E0n ph\u00EDm\n kh\u00F4ng m\u1EA5t; onExpand b\u1ECF qua click trong l\u00FAc t\u1EA3i. color primary ch\u1EC9 \u0111\u1EC3 spinner theo m\u00E0u nh\u1EA5n. -->\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-expand-' + element.meta.id : null\"\n type=\"text\"\n [color]=\"_expanding ? 'primary' : null\"\n [loading]=\"_expanding\"\n [attr.aria-busy]=\"_expanding ? 'true' : null\"\n [prefixIcon]=\"element.meta.expand?.isExpanded ? 'expand_less' : 'expand_more'\"\n (click)=\"onExpand(element)\"\n width=\"35px\">\n </sd-button>\n }\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"sdSelection\" sticky>\n <th class=\"sd-selection-cell p-0\" mat-header-cell *matHeaderCellDef [attr.rowspan]=\"_configuration.multipleHeader ? 2 : 1\">\n @if (_visibleSelectAll) {\n <mat-checkbox\n class=\"c-selection px-8\"\n color=\"primary\"\n [indeterminate]=\"_isSelectIndeterminate\"\n [ngModel]=\"_isSelectAll\"\n (ngModelChange)=\"isSelectAll.set($event)\"\n (change)=\"onSelectAll()\">\n </mat-checkbox>\n }\n </th>\n\n <td class=\"sd-selection-cell p-0\" mat-cell *matCellDef=\"let item\">\n @let visible = item.meta.selector?.visible;\n @if (visible) {\n @if (_tableOption.selector?.single) {\n <mat-radio-button\n class=\"c-selection px-8\"\n color=\"primary\"\n [checked]=\"item.meta.selector.isSelected\"\n (change)=\"item.meta.selector.isSelected = true; onSelect(item)\"\n [disabled]=\"item.meta.selector?.disabled\">\n </mat-radio-button>\n } @else {\n <mat-checkbox\n class=\"c-selection px-8\"\n color=\"primary\"\n [(ngModel)]=\"item.meta.selector.isSelected\"\n (change)=\"onSelect(item)\"\n [disabled]=\"item.meta.selector?.disabled\">\n </mat-checkbox>\n }\n }\n </td>\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n @if (_tableOption.index?.enabled) {\n @let _pageOffset = pageOffset();\n @let _indexWidth = _tableOption.index?.width || '50px';\n <!-- why: khi tree, c\u1ED9t Index \"\u00F4m\" th\u00EAm chevron + indent. D\u00F9ng width:1px +\n nowrap (.sd-tree-index-cell) \u0111\u1EC3 c\u1ED9t co S\u00C1T n\u1ED9i dung, kh\u00F4ng chi\u1EBFm ch\u1ED7\n th\u1EEBa; header \"#\" canh tr\u00E1i l\u00F9i v\u00E0o (.sd-tree-index-header) cho th\u1EB3ng s\u1ED1. -->\n @let _treeIndex = !!_tableOption.tree;\n <ng-container matColumnDef=\"sdIndex\" sticky>\n <th\n [class.p-0]=\"!_treeIndex\"\n [class.text-center]=\"!_treeIndex\"\n [class.sd-tree-index-cell]=\"_treeIndex\"\n [class.sd-tree-index-header]=\"_treeIndex\"\n mat-header-cell\n *matHeaderCellDef\n [style.width]=\"_treeIndex ? '1px' : _indexWidth\"\n [style.min-width]=\"_treeIndex ? null : _indexWidth\"\n [style.max-width]=\"_treeIndex ? null : _indexWidth\"\n [attr.rowspan]=\"_configuration.multipleHeader ? 2 : 1\">\n {{ _tableOption.index?.title || '#' }}\n </th>\n <td\n [class.px-4]=\"!_treeIndex\"\n [class.text-center]=\"!_treeIndex\"\n [class.sd-tree-index-cell]=\"_treeIndex\"\n mat-cell\n *matCellDef=\"let item; let i = dataIndex\"\n [style.width]=\"_treeIndex ? '1px' : null\"\n [style.min-width]=\"_treeIndex ? null : _indexWidth\"\n [style.max-width]=\"_treeIndex ? null : _indexWidth\">\n @if (!item?.meta?.group?.isGroupHeader) {\n @if (_treeIndex) {\n <!-- why: tree \u2192 chevron + indent + STT ph\u00E2n c\u1EA5p (1, 1.2, 1.2.1). T\u00F4 \u0111\u1EADm root (level 0). -->\n <span class=\"sd-tree-line\">\n <ng-container *ngTemplateOutlet=\"sdTreeToggle; context: { row: item }\"></ng-container>\n @if (item?.meta?.tree?.indexPath?.length) {\n <span class=\"sd-tree-stt\" [class.sd-stt-root]=\"(item.meta.tree.level ?? 0) === 0\">\n {{ item.meta.tree.indexPath.join('.') }}\n </span>\n }\n </span>\n } @else {\n {{ _pageOffset + (aggregateRenderHost.indices.get(item) ?? i) + 1 }}\n }\n }\n </td>\n <td\n mat-footer-cell\n *matFooterCellDef\n [style.width]=\"_treeIndex ? '1px' : null\"\n [style.min-width]=\"_treeIndex ? null : _indexWidth\"\n [style.max-width]=\"_treeIndex ? null : _indexWidth\"></td>\n </ng-container>\n }\n <ng-container\n matColumnDef=\"sdCommand\"\n [sticky]=\"_tableOption.command?.align !== 'right'\"\n [stickyEnd]=\"_tableOption.command?.align === 'right'\">\n <!-- why: \u00F4 header c\u1EE7a c\u1ED9t command v\u1ED1n \u0111\u1EC3 tr\u1ED1ng. Cho consumer chi\u1EBFm ch\u1ED7 \u0111\u00F3 b\u1EB1ng\n `sdTableCommandHeaderDef` (th\u01B0\u1EDDng l\u00E0 n\u00FAt th\u00EAm d\u00F2ng) th\u00EC h\u00E0nh \u0111\u1ED9ng c\u1EA5p b\u1EA3ng n\u1EB1m ngay\n tr\u00EAn c\u1EE5m n\u00FAt c\u1EE7a t\u1EEBng d\u00F2ng, thay v\u00EC ph\u1EA3i d\u1EF1ng th\u00EAm m\u1ED9t d\u1EA3i ri\u00EAng d\u01B0\u1EDBi b\u1EA3ng. -->\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 50px\" [attr.rowspan]=\"_configuration.multipleHeader ? 2 : 1\">\n @if (_commandHeaderDef) {\n <div class=\"sd-command-header d-flex align-items-center justify-content-center\">\n <ng-container *ngTemplateOutlet=\"_commandHeaderDef.templateRef\"></ng-container>\n </div>\n }\n </th>\n <!-- why: `dataIndex` do CDK c\u1EA5p s\u1EB5n. B\u1EA3n c\u0169 d\u00F9ng `groupedItems.indexOf(item)` \u2014\n qu\u00E9t to\u00E0n m\u1EA3ng cho M\u1ED6I d\u00F2ng render \u1EDF M\u1ED6I CD pass (O(n\u00B2) tr\u00EAn \u0111\u01B0\u1EDDng render),\n v\u00E0 c\u00F2n tr\u1EA3 sai index khi 2 d\u00F2ng tr\u00F9ng reference. -->\n <td class=\"px-8\" mat-cell *matCellDef=\"let item; let i = dataIndex\">\n <desktop-command\n [autoId]=\"_autoId\"\n [commands]=\"_rowCommands\"\n [item]=\"item\"\n [itemIndex]=\"aggregateRenderHost.indices.get(item) ?? i\"></desktop-command>\n </td>\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n <!-- why: group header row d\u00F9ng matRowDef RI\u00CANG v\u1EDBi column list ['sdGroupHeader']\n qua predicate when:isGroupHeaderRow. Cell colspan = displayedColumns.length \u0111\u1EC3\n span TO\u00C0N B\u1ED8 width data row. Tr\u00E1nh colspan trick overflow row khi c\u00E1c TD kh\u00E1c render. -->\n <ng-container matColumnDef=\"sdGroupHeader\">\n <td class=\"p-0 sd-group-header-cell\" mat-cell *matCellDef=\"let item\" [attr.colspan]=\"sdGroupColspan()\">\n <ng-container *ngTemplateOutlet=\"sdGroupHeader; context: { item: item }\"></ng-container>\n </td>\n </ng-container>\n <!-- why: filler column \u1EDF cu\u1ED1i h\u1EA5p th\u1EE5 leftover space khi t\u1ED5ng width c\u00E1c c\u1ED9t data < container \u2014 gi\u1EEF cho selection/STT/command kh\u00F4ng b\u1ECB d\u00E3n. -->\n <ng-container matColumnDef=\"sdFiller\">\n <th class=\"sd-filler-cell p-0\" mat-header-cell *matHeaderCellDef [attr.rowspan]=\"_configuration.multipleHeader ? 2 : 1\"></th>\n <td class=\"sd-filler-cell p-0\" mat-cell *matCellDef=\"let item\"></td>\n <td class=\"sd-filler-cell p-0\" mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n @for (column of _configuration.firstColumns; track column.field) {\n <ng-container [matColumnDef]=\"column.field\" [sticky]=\"_configuration.fixedColumn[column.field]\">\n <th\n mat-header-cell\n *matHeaderCellDef\n class=\"px-8 c-th\"\n [class.sd-column-group]=\"column.type === 'children'\"\n [attr.scope]=\"column.type === 'children' ? 'colgroup' : 'col'\"\n [sdColumnResize]=\"!!_tableOption.config?.resizable && column.type !== 'children'\"\n [minWidth]=\"column.minWidth\"\n [maxWidth]=\"column.maxWidth\"\n (resizeEnd)=\"onColumnResize(column.field, $event)\"\n [style.width]=\"column.width\"\n [style.min-width]=\"column.minWidth || column.width\"\n [style.max-width]=\"column.maxWidth\"\n [attr.rowspan]=\"_configuration.multipleHeader && column.type !== 'children' ? 2 : 1\"\n [attr.colspan]=\"column.type === 'children' ? column.children.length : 1\"\n [attr.aria-sort]=\"\n _tableOption.sort?.enable && column.type !== 'children' && column.sortable ? getSortAria(column.field) : null\n \">\n <div\n [class.sd-table-header-cell--trigger]=\"_queryBarMode && column.type !== 'children'\"\n [class.sd-table-header-cell--end]=\"_queryBarMode && column.align === 'right'\">\n <!-- why: sort control ch\u1EC9 \u00F4m title; filter l\u00E0 sibling n\u00EAn kh\u00F4ng th\u00E0nh interactive\n descendant. aria-sort thu\u1ED9c semantic <th>, kh\u00F4ng thu\u1ED9c control n\u00E0y. -->\n @if (column.type === 'children') {\n <div class=\"c-header-title sd-column-group-title\">\n <column-title [column]=\"column\" [titleDef]=\"_titleDef[column.field]\"></column-title>\n </div>\n } @else {\n @if (_tableOption.sort?.enable && column.sortable) {\n <div\n [sdTableSortHeader]=\"column.field\"\n class=\"c-header-title\"\n [class.justify-content-end]=\"column.align === 'right'\"\n [class.text-right]=\"column.align === 'right'\">\n <column-title [column]=\"column\" [titleDef]=\"_titleDef[column.field]\"></column-title>\n </div>\n } @else {\n <div\n class=\"c-header-title\"\n [class.justify-content-end]=\"column.align === 'right'\"\n [class.text-right]=\"column.align === 'right'\">\n <column-title [column]=\"column\" [titleDef]=\"_titleDef[column.field]\"></column-title>\n </div>\n }\n @if (_queryBarMode) {\n <ng-container *ngTemplateOutlet=\"queryBarTrigger; context: { $implicit: column }\"></ng-container>\n }\n @if (_showInlineFilter && !_configuration.multipleHeader) {\n <ng-container *ngTemplateOutlet=\"inlineColumnFilter; context: { $implicit: column }\"></ng-container>\n }\n }\n </div>\n </th>\n <td\n class=\"c-td px-0\"\n [class.d-none]=\"column.type === 'children'\"\n mat-cell\n *matCellDef=\"let item\"\n [sdHoverCopy]=\"(item.data && item.data[column.field]) || ''\"\n [sdHoverCopyDisabled]=\"!column.cell?.copiable\">\n @if (column.type !== 'children' && !item?.meta?.group?.isGroupHeader) {\n @if (_treeFirstField && column.field === _treeFirstField) {\n <!-- why: kh\u00F4ng c\u00F3 c\u1ED9t Index \u2192 chevron + indent nh\u00FAng v\u00E0o c\u1ED9t data \u0111\u1EA7u (nh\u01B0 file explorer). -->\n <span class=\"sd-tree-line px-8\">\n <ng-container *ngTemplateOutlet=\"sdTreeToggle; context: { row: item }\"></ng-container>\n <desktop-cell class=\"d-block\" [column]=\"column\" [item]=\"item\" [cellDef]=\"_cellDef\"></desktop-cell>\n </span>\n } @else {\n <desktop-cell class=\"d-block px-8\" [column]=\"column\" [item]=\"item\" [cellDef]=\"_cellDef\"> </desktop-cell>\n }\n }\n </td>\n <td mat-footer-cell *matFooterCellDef [class.d-none]=\"column.type === 'children'\">\n <ng-container *ngIf=\"_footerDef[column.field]\">\n <ng-container *ngTemplateOutlet=\"_footerDef[column.field].templateRef; context: { items: _items, column: column }\">\n </ng-container>\n </ng-container>\n </td>\n </ng-container>\n }\n @for (column of _configuration.secondColumns; track column.field) {\n <ng-container [matColumnDef]=\"column.field\" [sticky]=\"_configuration.fixedColumn[column.field]\">\n <th\n mat-header-cell\n *matHeaderCellDef\n class=\"c-th px-8\"\n scope=\"col\"\n [style.width]=\"column.width\"\n [style.min-width]=\"column.minWidth || column.width\"\n [style.max-width]=\"column.maxWidth\"\n [attr.aria-sort]=\"_tableOption.sort?.enable && column.sortable ? getSortAria(column.field) : null\">\n <div\n [class.sd-table-header-cell--trigger]=\"_queryBarMode\"\n [class.sd-table-header-cell--end]=\"_queryBarMode && column.align === 'right'\">\n @if (_tableOption.sort?.enable && column.sortable) {\n <div\n [sdTableSortHeader]=\"column.field\"\n class=\"c-header-title\"\n [class.justify-content-end]=\"column.align === 'right'\"\n [class.text-right]=\"column.align === 'right'\">\n <column-title [column]=\"column\" [titleDef]=\"_titleDef[column.field]\"></column-title>\n </div>\n } @else {\n <div\n class=\"c-header-title\"\n [class.justify-content-end]=\"column.align === 'right'\"\n [class.text-right]=\"column.align === 'right'\">\n <column-title [column]=\"column\" [titleDef]=\"_titleDef[column.field]\"></column-title>\n </div>\n }\n @if (_queryBarMode) {\n <ng-container *ngTemplateOutlet=\"queryBarTrigger; context: { $implicit: column }\"></ng-container>\n }\n </div>\n </th>\n <td\n class=\"c-td px-0\"\n mat-cell\n *matCellDef=\"let item\"\n [sdHoverCopy]=\"item[column.field]\"\n [sdHoverCopyDisabled]=\"!column.cell?.copiable\">\n @if (column.type !== 'children') {\n <desktop-cell class=\"d-block px-8\" [column]=\"column\" [item]=\"item\" [cellDef]=\"_cellDef\"> </desktop-cell>\n }\n </td>\n <td mat-footer-cell *matFooterCellDef>\n <ng-container *ngIf=\"_footerDef[column.field]\">\n <ng-container *ngTemplateOutlet=\"_footerDef[column.field].templateRef; context: { items: _items, column: column }\">\n </ng-container>\n </ng-container>\n </td>\n </ng-container>\n }\n <tr class=\"c-first-header\" mat-header-row *matHeaderRowDef=\"_configuration.firstHeaders; sticky: true\"></tr>\n @for (entry of _aggregateColumns; track entry.id) {\n <ng-container [matColumnDef]=\"entry.id\" [sticky]=\"entry.sticky\" [stickyEnd]=\"entry.stickyEnd\">\n <td\n mat-cell\n *matCellDef=\"let row\"\n class=\"sd-aggregate-cell px-8 py-8\"\n [class.d-none]=\"entry.hidden\"\n [style.text-align]=\"entry.column?.align\"\n [style.width]=\"entry.column?.width\"\n [style.min-width]=\"entry.column?.minWidth || entry.column?.width\">\n <ng-container\n *ngTemplateOutlet=\"\n aggregateCell;\n context: { $implicit: aggregateRenderHost.rows.get(row)?.cells?.get(entry.field) }\n \"></ng-container>\n </td>\n <td\n mat-footer-cell\n *matFooterCellDef\n class=\"sd-aggregate-cell px-8 py-8\"\n [class.d-none]=\"entry.hidden\"\n [style.text-align]=\"entry.column?.align\"\n [style.width]=\"entry.column?.width\"\n [style.min-width]=\"entry.column?.minWidth || entry.column?.width\">\n <ng-container\n *ngTemplateOutlet=\"aggregateCell; context: { $implicit: _aggregate.total?.cells?.get(entry.field) }\"></ng-container>\n </td>\n </ng-container>\n }\n <tr mat-row *matRowDef=\"let row; columns: _aggregateColumnIds; when: isAggregateRow\" class=\"sd-aggregate-row\"></tr>\n @if (!!_configuration.secondHeaders.length) {\n <tr class=\"c-second-header\" mat-header-row *matHeaderRowDef=\"_configuration.secondHeaders; sticky: true\"></tr>\n }\n @if (_configuration.multipleHeader) {\n @for (entry of _headerFilterColumns; track entry.id) {\n <ng-container [matColumnDef]=\"entry.id\" [sticky]=\"entry.sticky\" [stickyEnd]=\"entry.stickyEnd\">\n <th\n mat-header-cell\n *matHeaderCellDef\n class=\"c-th sd-filter-header\"\n [class.px-8]=\"!!entry.column\"\n [class.p-0]=\"!entry.column\"\n [class.sd-filler-cell]=\"entry.field === 'sdFiller'\"\n scope=\"col\">\n @if (_showInlineFilter && entry.column) {\n <ng-container *ngTemplateOutlet=\"inlineColumnFilter; context: { $implicit: entry.column }\"></ng-container>\n }\n </th>\n </ng-container>\n }\n <!-- why: gi\u1EEF row definition \u1ED5n \u0111\u1ECBnh; CDK c\u1EADp nh\u1EADt columns \u0111\u1EC3 b\u1ECF controls/sticky offsets khi \u1EA9n filter. -->\n <tr\n class=\"c-filter-header\"\n [style.display]=\"_showInlineFilter ? null : 'none'\"\n mat-header-row\n *matHeaderRowDef=\"_showInlineFilter ? headerFilterColumnIds() : []; sticky: _showInlineFilter\"></tr>\n }\n <!-- Group header row \u2014 ch\u1EC9 1 cell sdGroupHeader colspan to\u00E0n width. -->\n <tr mat-row *matRowDef=\"let row; columns: ['sdGroupHeader']; when: isGroupHeaderRow\" class=\"c-group-row-tr\"></tr>\n\n <!-- Data row \u2014 d\u00F9ng displayedColumns \u0111\u1EA7y \u0111\u1EE7; when isDataRow \u0111\u1EC3 lo\u1EA1i tr\u1EEB group header. -->\n <!-- why: [ngStyle] \u0111\u1ECDc meta.rowStyle \u2014 style.rowCss \u0111\u00E3 \u0111\u01B0\u1EE3c resolve 1 l\u1EA7n m\u1ED7i l\u1EA7n\n render. B\u1EA3n c\u0169 g\u1ECDi rowStyle(row) ngay trong binding \u2192 ch\u1EA1y callback c\u1EE7a consumer\n cho T\u1EEANG d\u00F2ng \u1EDF M\u1ED6I CD pass, v\u00E0 v\u00EC tr\u1EA3 object M\u1EDAI n\u00EAn NgStyle ph\u1EA3i ch\u1EA1y l\u1EA1i\n KeyValueDiffer tr\u00EAn m\u1ECDi d\u00F2ng \u1EDF m\u1ECDi pass. -->\n <tr\n mat-row\n cdkDrag\n [cdkDragData]=\"row\"\n [cdkDragDisabled]=\"\n !_tableOption.rowReorder?.enabled ||\n !!row.meta?.group?.items?.length ||\n (row.meta?.tree?.level ?? 0) > 0 ||\n isReorderDisabled(row)\n \"\n *matRowDef=\"let row; columns: _configuration.displayedColumns; when: isDataRow\"\n matRipple\n class=\"c-row\"\n [class.sd-tree-row]=\"!!_tableOption.tree\"\n [ngClass]=\"_tableOption.tree ? 'sd-tree-level-' + (row.meta?.tree?.level ?? 0) : null\"\n [ngStyle]=\"row.meta.rowStyle\"\n [class.selected]=\"row.meta.selector.isSelected\"></tr>\n\n <!-- Sub-information row \u2014 also gated b\u1EDFi isDataRow \u0111\u1EC3 KH\u00D4NG render empty expand row d\u01B0\u1EDBi group header. -->\n <tr mat-row *matRowDef=\"let row; columns: ['sdSubInformation']; when: isDataRow\" class=\"c-detail-row\"></tr>\n @if (_aggregate.total) {\n <tr mat-footer-row *sdTableFooterRowDef=\"_aggregateColumnIds; sticky: true\" class=\"sd-aggregate-total\"></tr>\n }\n @if (hasFooter() && !!_configuration.displayedFooters.length) {\n <tr mat-footer-row *sdTableFooterRowDef=\"_configuration.displayedFooters; sticky: true\"></tr>\n }\n <!-- why: khung x\u01B0\u01A1ng l\u00E0 d\u00F2ng th\u1EADt trong tbody (matNoDataRow ch\u1EC9 hi\u1EC7n khi kh\u00F4ng c\u00F3 d\u00F2ng d\u1EEF li\u1EC7u) n\u00EAn \u00F4 th\u1EB3ng\n c\u1ED9t v\u1EDBi header, k\u1EC3 c\u1EA3 header nh\u00F3m, m\u00E0 kh\u00F4ng ph\u1EA3i \u0111o; footer v\u1EABn n\u1EB1m d\u01B0\u1EDBi; dataSource kh\u00F4ng \u0111\u1ED5i. -->\n <ng-template matNoDataRow>\n @for (cells of skeleton(); track $index) {\n <tr class=\"sd-table-skeleton-row\" aria-hidden=\"true\">\n @for (cell of cells; track cell.field) {\n <td class=\"sd-table-skeleton-cell\" [class.d-none]=\"cell.hidden\">\n @if (cell.shape !== 'none') {\n <span\n class=\"sd-table-skeleton-bar\"\n [attr.data-shape]=\"cell.shape\"\n [attr.data-align]=\"cell.align\"\n [style.width]=\"cell.width\"\n [style.max-width]=\"cell.maxWidth\"></span>\n }\n </td>\n }\n </tr>\n }\n </ng-template>\n </table>\n }\n @let _readError = _readState.status === 'error';\n <!-- why: d\u00F2ng c\u0169 b\u1ECB g\u1EE1 khi l\u1EA7n \u0111\u1ECDc hi\u1EC7n h\u00E0nh l\u1ED7i, n\u00EAn v\u00F9ng l\u1ED7i/empty ch\u1EC9 hi\u1EC7n khi b\u1EA3ng kh\u00F4ng c\u00F2n d\u00F2ng n\u00E0o\n \u2014 end user kh\u00F4ng bao gi\u1EDD th\u1EA5y d\u1EEF li\u1EC7u v\u00E0 l\u1ED7i c\u00F9ng l\u00FAc (NSP-4877). -->\n @let _noRows = !_readError && !_loading && !_total && !_items.length && _loadingView === 'none';\n @if ((_readError && !_hideReadError) || (_noRows && _readState.status === 'empty' && !!_dataStateTemplate)) {\n <sd-data-state [state]=\"_readError ? 'error' : 'empty'\" [retryable]=\"_readError\" (sdRetry)=\"retryRead()\">\n @if (_dataStateTemplate; as custom) {\n <ng-template sdDataStateTemplate let-current let-retry=\"retry\" let-action=\"action\">\n <ng-container\n [ngTemplateOutlet]=\"custom.template\"\n [ngTemplateOutletContext]=\"{ $implicit: current, state: current, retry: retry, action: action }\"></ng-container>\n </ng-template>\n }\n </sd-data-state>\n } @else if (!_loading && loadError() && !_hideReadError) {\n <!-- why: b\u1EA3ng local l\u1ED7i d\u00F9ng c\u00F9ng giao di\u1EC7n l\u1ED7i v\u1EDBi b\u1EA3ng server (sd-data-state, role=\"alert\") v\u00E0 c\u00F9ng\n sdDataStateTemplate; th\u1EED l\u1EA1i = reload() v\u00EC local kh\u00F4ng c\u00F3 snapshot \u0111\u1ECDc \u0111\u1EC3 retryRead(). -->\n <sd-data-state state=\"error\" [retryable]=\"true\" (sdRetry)=\"reload()\">\n @if (_dataStateTemplate; as custom) {\n <ng-template sdDataStateTemplate let-current let-retry=\"retry\" let-action=\"action\">\n <ng-container\n [ngTemplateOutlet]=\"custom.template\"\n [ngTemplateOutletContext]=\"{ $implicit: current, state: current, retry: retry, action: action }\"></ng-container>\n </ng-template>\n }\n </sd-data-state>\n } @else if (_noRows && !loadError()) {\n <!-- why: empty m\u1EB7c \u0111\u1ECBnh gi\u1EEF 3 tr\u1EA1ng th\u00E1i (filter kh\u00F4ng c\u00F3 k\u1EBFt qu\u1EA3 / ch\u01B0a ch\u1ECDn filter b\u1EAFt bu\u1ED9c / ch\u01B0a c\u00F3 d\u1EEF li\u1EC7u)\n c\u00F9ng \u1EA3nh c\u1EA5u h\u00ECnh qua SD_TABLE_CONFIGURATION.images, cho c\u1EA3 b\u1EA3ng server (NSP-5551). Kh\u00F4ng c\u00F3 role live:\n v\u00F9ng .sd-table-live (lu\u00F4n c\u00F3 trong DOM) \u0111\u1ECDc ti\u00EAu \u0111\u1EC1 c\u1EE7a kh\u1ED1i n\u00E0y. -->\n <div class=\"c-no-data-row\">\n @if (_isFiltered) {\n @if (tableConfiguration?.images?.filterEmpty) {\n <img class=\"c-image\" [src]=\"tableConfiguration!.images!.filterEmpty\" alt=\"filter-empty\" />\n } @else {\n <img class=\"c-image sd-image-filter-empty\" alt=\"filter-empty\" />\n }\n <div class=\"T16M\">{{ 'core.component.table.no-results' | sdTranslate }}</div>\n <div class=\"T16R text-secondary\">{{ 'core.component.table.no-results-hint' | sdTranslate }}</div>\n } @else {\n @if (_requireFiltered) {\n @if (tableConfiguration?.images?.filterRequired) {\n <img class=\"c-image\" [src]=\"tableConfiguration!.images!.filterRequired\" alt=\"filter-required\" />\n } @else {\n <img class=\"c-image sd-image-filter-required\" alt=\"filter-required\" />\n }\n <div class=\"T16R text-secondary\">{{ 'core.component.table.choose-filter-hint' | sdTranslate }}</div>\n } @else {\n @if (tableConfiguration?.images?.dataEmpty) {\n <img class=\"c-image\" [src]=\"tableConfiguration!.images!.dataEmpty\" alt=\"data-empty\" />\n } @else {\n <img class=\"c-image sd-image-data-empty\" alt=\"data-empty\" />\n }\n <div class=\"T16R text-secondary\">{{ 'core.component.table.no-data' | sdTranslate }}</div>\n }\n }\n </div>\n }\n </div>\n @if (_loadingView === 'refresh' && !_mobileCards) {\n <!-- N\u1EB1m trong .c-container, kh\u00F4ng trong .c-table, \u0111\u1EC3 kh\u00F4ng cu\u1ED9n ngang theo b\u1EA3ng; top = --sd-table-head-h (\u0111o). -->\n <div class=\"sd-table-progress\" aria-hidden=\"true\"></div>\n }\n @if (!_mobileCards) {\n <selector-action\n [autoId]=\"_autoId\"\n [tableOption]=\"_tableOption\"\n [selectedTableItems]=\"_selectedTableItems\"\n (clear)=\"onClearSelection()\" />\n }\n <div class=\"c-paginator\">\n <div class=\"c-action\">\n @if (_mobileCards) {\n @let _tools = mobileToolsActions();\n @if (_tools.length) {\n <button\n mat-button\n type=\"button\"\n class=\"sd-mobile-tools-trigger\"\n aria-haspopup=\"dialog\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-mobile-tools' : null\"\n (click)=\"mobileTools.openMore()\">\n <sd-icon name=\"tune\"></sd-icon><span>{{ 'core.component.table.mobile.tools' | sdTranslate }}</span>\n </button>\n <sd-table-mobile-actions\n #mobileTools\n [actions]=\"_tools\"\n [autoOpen]=\"false\"\n [title]=\"'core.component.table.mobile.tools-title' | sdTranslate\"\n [autoId]=\"_autoId\"></sd-table-mobile-actions>\n }\n } @else {\n @if (_tableOption.reload?.visible) {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-reload' : null\"\n class=\"mr-8\"\n [title]=\"'core.component.table.reload' | sdTranslate\"\n prefixIcon=\"refresh\"\n (click)=\"reload()\"\n type=\"text\">\n </sd-button>\n }\n @if (_export && _items.length) {\n @if (_export.type === 'custom') {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-export' : null\"\n class=\"mr-8\"\n [title]=\"_exportTitle\"\n prefixIcon=\"get_app\"\n (click)=\"exportCustom()\"\n type=\"text\">\n </sd-button>\n } @else {\n @if (_export.visible) {\n @if (_exporting) {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-export' : null\"\n class=\"mr-8\"\n [loading]=\"_exporting\"\n [title]=\"_exportTitle\"\n prefixIcon=\"get_app\"\n type=\"text\">\n </sd-button>\n } @else {\n @if (_export.visible === 'ALL' || !_export.visible) {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-export' : null\"\n class=\"mr-8\"\n [title]=\"_exportTitle\"\n prefixIcon=\"get_app\"\n type=\"text\">\n <sd-button-item\n [autoId]=\"_autoId ? _autoId + '-export-excel' : null\"\n prefixIcon=\"file_download\"\n (click)=\"exportExcel()\"\n >{{ 'core.component.table.export-excel' | sdTranslate }}</sd-button-item\n >\n <sd-button-item\n [autoId]=\"_autoId ? _autoId + '-export-csv' : null\"\n prefixIcon=\"file_download\"\n (click)=\"exportCSV()\"\n >{{ 'core.component.table.export-csv' | sdTranslate }}</sd-button-item\n >\n </sd-button>\n } @else if (_export.visible === 'EXCEL') {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-export-excel' : null\"\n class=\"mr-8\"\n [title]=\"_exportTitle\"\n prefixIcon=\"get_app\"\n (click)=\"exportExcel()\"\n type=\"text\">\n </sd-button>\n } @else if (_export.visible === 'CSV') {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-export-csv' : null\"\n class=\"mr-8\"\n [title]=\"_exportTitle\"\n prefixIcon=\"get_app\"\n (click)=\"exportCSV()\"\n type=\"text\">\n </sd-button>\n }\n }\n }\n }\n }\n\n @if (_configComponent) {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-config' : null\"\n class=\"mr-8\"\n [title]=\"'core.component.table.setup-short' | sdTranslate\"\n prefixIcon=\"settings\"\n [indicator]=\"!_isMobile && hasCustomSetup()\"\n indicatorColor=\"primary\"\n [indicatorLabel]=\"'core.component.table.config.customized' | sdTranslate\"\n (click)=\"_configComponent.open()\"\n type=\"text\">\n </sd-button>\n }\n <!-- Mobile: n\u00FAt Filter m\u1EDF mobile-filter drawer (inline filter \u1EA9n tr\u00EAn mobile) -->\n @if (_isMobile) {\n @if (!_tableOption.filter?.disabled && _mobileFilter) {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-mobile-filter-open' : null\"\n class=\"mr-8\"\n prefixIcon=\"filter_alt\"\n [title]=\"_mobileCards ? ('core.component.table.filter' | sdTranslate) : undefined\"\n (click)=\"_mobileFilter.open()\"\n type=\"text\">\n </sd-button>\n }\n }\n }\n </div>\n @let _unknownTotalPager = unknownTotalPager();\n @if (_unknownTotalPager) {\n <!-- paginate.total 'unknown': no total exists, so mat-paginator (which derives Next/Last and the\n range from `length`) is replaced by a pager that renders only the rows actually shown. -->\n @if (!_tableOption.paginate?.hidden && unknownTotalPagerVisible()) {\n <sd-table-unknown-total-paginator\n [class.sd-mobile-paginator]=\"_mobileCards\"\n [state]=\"_unknownTotalPager\"\n [pageSizeOptions]=\"_tableOption.paginate?.pages\"\n [hidePageSize]=\"_isMobile || !!_tableOption.paginate?.hidePageSize\"\n [showFirstButton]=\"!_isMobile && !!_tableOption.paginate?.showFirstLastButtons\"\n [autoId]=\"_autoId\"\n (page)=\"onUnknownTotalPage($event)\"></sd-table-unknown-total-paginator>\n } @else if (!_isMobile && !_tableOption.paginate?.hidden && unknownTotalSingleCount()) {\n <div class=\"T14R c-summary\">\n {{ 'core.component.table.showing' | sdTranslate }} <span class=\"T14M ml-2\">1-{{ unknownTotalSingleCount() }}</span>\n </div>\n }\n } @else {\n @let hidePaginator = !_tableOption.paginate?.pageSize || _total === undefined || _total <= _tableOption.paginate?.pageSize!;\n <mat-paginator\n [class.sd-mobile-paginator]=\"_mobileCards\"\n [class.d-none]=\"_tableOption.paginate?.hidden || hidePaginator\"\n [length]=\"_total\"\n [pageSize]=\"_tableOption.paginate?.pageSize\"\n [pageSizeOptions]=\"_tableOption.paginate?.pages!\"\n [showFirstLastButtons]=\"!_isMobile && _tableOption.paginate?.showFirstLastButtons\"\n [hidePageSize]=\"_isMobile || _tableOption.paginate?.hidePageSize\"\n [selectConfig]=\"{ panelClass: ['sd-select-panel', 'sd-table-page-size-panel'] }\"></mat-paginator>\n <!-- \"\u0110ang hi\u1EC3n th\u1ECB...\" ch\u1EC9 desktop -->\n @if (!_isMobile) {\n @if (!_tableOption.paginate?.hidden && hidePaginator && _total !== undefined && _total > 0) {\n <div class=\"T14R c-summary\">\n {{ 'core.component.table.showing' | sdTranslate }} <span class=\"T14M ml-2\">1-{{ _total }}/{{ _total }}</span>\n </div>\n }\n }\n }\n </div>\n </div>\n </div>\n\n @if (_tableOption.config?.visible) {\n <config [autoId]=\"_autoId\" [tableOption]=\"_tableOption\" (defaultsRestored)=\"onConfigDefaultsRestored()\" />\n }\n <!-- Mobile filter drawer \u2014 ch\u1EC9 instantiate khi c\u1EA7n render tr\u00EAn mobile -->\n @if (!_tableOption.filter?.disabled && filterRegister) {\n <mobile-filter\n [autoId]=\"_autoId\"\n [filter]=\"_tableOption.filter!\"\n [externalFilters]=\"_tableOption.filter?.externalFilters!\"\n [columns]=\"mobileColumns()\"\n [filterDefs]=\"sdFilterDefs()\"\n [filterRegister]=\"filterRegister\"\n [cacheValues]=\"cacheValues\">\n </mobile-filter>\n }\n} @else if (_readState.status === 'error' && !_hideReadError) {\n <!-- why: lookup c\u00F3 th\u1EC3 l\u1ED7i tr\u01B0\u1EDBc khi c\u00F3 configuration; v\u1EABn ph\u1EA3i c\u00F3 l\u1ED1i retry v\u00E0 custom error template. -->\n <sd-data-state state=\"error\" [retryable]=\"true\" (sdRetry)=\"retryRead()\">\n @if (_dataStateTemplate; as custom) {\n <ng-template sdDataStateTemplate let-current let-retry=\"retry\" let-action=\"action\">\n <ng-container\n [ngTemplateOutlet]=\"custom.template\"\n [ngTemplateOutletContext]=\"{ $implicit: current, state: current, retry: retry, action: action }\"></ng-container>\n </ng-template>\n }\n </sd-data-state>\n} @else if (_loadingView === 'skeleton') {\n <!-- why: lookup c\u1ED9t (values/lazy-values) c\u00F3 th\u1EC3 ch\u1EADm; ch\u01B0a c\u00F3 configuration n\u00EAn ch\u01B0a bi\u1EBFt c\u1ED9t, v\u1EBD khung x\u01B0\u01A1ng chung\n thay v\u00EC \u0111\u1EC3 tr\u1ED1ng. Hydrate kh\u00F4ng c\u00F3 lookup xong trong microtask n\u00EAn kh\u1ED1i n\u00E0y kh\u00F4ng k\u1ECBp hi\u1EC7n. -->\n <div class=\"sd-table-skeleton-block\" aria-hidden=\"true\">\n @for (cells of genericSkeleton; track $index) {\n <div class=\"sd-table-skeleton-block-row\">\n @for (cell of cells; track cell.field) {\n <span class=\"sd-table-skeleton-cell\">\n <span class=\"sd-table-skeleton-bar\" [style.width]=\"cell.width\" [style.max-width]=\"cell.maxWidth\"></span>\n </span>\n }\n </div>\n }\n </div>\n}\n", styles: [":host:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}:host{display:flex;flex-direction:column;overflow:auto;width:100%;height:100%;--mat-table-row-item-container-height: 36px}:host .sd-table-live{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}:host .c-header-title{height:40px;display:flex;align-items:center}:host .sd-table-surface{display:flex;flex:1;flex-direction:column;min-width:0;min-height:0;background:var(--sd-surface, #fff);border-radius:var(--sd-radius-6, 6px)}:host .c-container{position:relative;min-height:50px;display:flex;flex-direction:column;flex:1;isolation:isolate}:host .c-container .c-table{position:relative;flex:1;display:flex;flex-direction:column}:host .c-container .c-table table{border-collapse:separate;width:100%}:host .c-container .c-table table tr.c-first-header.mat-mdc-header-row{height:40px}:host .c-container .c-table table tr.c-second-header.mat-mdc-header-row{height:40px}:host .c-container .c-table table.sd-table-grouped-header th.c-th{vertical-align:middle;padding-block:4px}:host .c-container .c-table table.sd-table-grouped-header tr.c-first-header.mat-mdc-header-row{height:32px}:host .c-container .c-table table.sd-table-grouped-header tr.c-filter-header.mat-mdc-header-row{height:auto}:host .c-container .c-table table.sd-table-grouped-header th.sd-filter-header{padding-block:0 8px;vertical-align:bottom}:host .c-container .c-table table.sd-table-grouped-header column-filter{display:flex;align-items:center;min-height:36px}:host .c-container .c-table table.sd-table-grouped-header th.sd-column-group{padding-block:4px;vertical-align:middle;background-color:color-mix(in srgb,var(--sd-border, #c4c6d0) 18%,var(--sd-table-group-header-mix, #f2f3f4));box-shadow:inset 0 -1px var(--sd-border, #c4c6d0)}:host .c-container .c-table table.sd-table-grouped-header th.sd-column-group .sd-column-group-title{height:auto;min-height:24px;justify-content:center;text-align:center;font-weight:var(--sd-font-weight-semibold, 600)}:host .c-container .c-table table tr.c-detail-row{height:0}:host .c-container .c-table table tr.c-row.activated{background-color:var(--sd-table-row-activated-bg, #e5ecff)}:host .c-container .c-table table tr.c-row.selected{background-color:var(--sd-table-row-selected-bg, #eef2ff)}:host .c-container .c-table table tr.c-row:not(.selected):not(.activated):hover{background-color:var(--sd-table-row-hover-bg, #f5f5f5)}:host .c-container .c-table table tr.c-row td{border-bottom-width:0}:host .c-container .c-table table tr.c-row.c-expandable{cursor:pointer}:host .c-container .c-table table tr.c-row.c-expandable:hover{background:var(--sd-table-row-hover-bg, #f5f5f5)}:host .c-container .c-table table th.mat-mdc-header-cell{background-color:var(--sd-table-header-bg, #f2f3f4);border-bottom:0!important}:host .c-container .c-table table td.mat-mdc-cell,:host .c-container .c-table table td.mat-mdc-footer-cell,:host .c-container .c-table table th.mat-mdc-header-cell{border-bottom-color:var(--sd-table-row-divider, #f2f2f2)!important}:host .c-container .c-table .c-th{vertical-align:middle;padding-block:8px;font-weight:var(--sd-font-weight-medium, 500);font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px);color:var(--sd-table-header-text, #212121)}:host .c-container .c-table .c-th.sd-col-resize-host{position:relative}:host .c-container .c-table .c-th.sd-resizing{-webkit-user-select:none;user-select:none}:host .c-container .c-table .c-th .sd-col-resize-handle{position:absolute;top:0;right:0;width:6px;height:100%;cursor:col-resize;-webkit-user-select:none;user-select:none;z-index:2}:host .c-container .c-table .c-th .sd-col-resize-handle:hover{background:color-mix(in srgb,var(--sd-text) 8%,transparent)}:host .c-container .c-table .c-td:first{padding-left:10px}:host .c-container .c-table .c-no-data-row{flex:1;width:100%;position:sticky;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center}:host .c-container .c-table .c-no-data-row .c-image{margin-bottom:16px;width:96px}:host .c-container .c-paginator{display:flex;flex-direction:row;justify-content:space-between;align-items:center;background-color:var(--sd-table-bg, #ffffff)}:host .c-container .c-paginator .mat-mdc-paginator{background:transparent;--mat-paginator-container-size: 40px;--mat-icon-button-state-layer-size: 32px;--mdc-icon-button-state-layer-size: 32px;--mdc-icon-button-icon-size: 20px}:host .c-container .c-paginator .c-action{padding:0}:host .c-container .c-paginator .c-action sd-button{margin:8px 5px}:host .c-container .c-paginator .c-summary{padding:8px 16px}:host .c-container .c-empty{text-align:center;background-color:var(--sd-table-bg, #ffffff);border:none!important}:host .c-container .c-empty sd-icon{font-size:150px;margin-top:30px;margin-bottom:30px;opacity:.2;width:auto;height:auto}:host button.c-btn-add{background-color:var(--sd-table-bg, #ffffff);box-shadow:var(--sd-shadow-sm)}:host .sd-reorder-header,:host .sd-reorder-cell{width:40px;min-width:40px;padding:0 4px;box-sizing:border-box}:host .sd-reorder-cell sd-icon{cursor:grab;color:var(--sd-text-muted);display:flex;align-items:center}:host .sd-reorder-cell sd-icon:active{cursor:grabbing}:host .sd-reorder-cell sd-icon.sd-reorder-disabled{opacity:.3;cursor:not-allowed;pointer-events:none}:host ::ng-deep .sd-mobile-paginator .mat-mdc-paginator-range-label{margin-inline:4px;white-space:nowrap}:host .c-container:not(.sd-table-mobile)>.c-table{border-radius:6px 6px 0 0}:host .c-container:not(.sd-table-mobile)>.c-paginator{border-radius:0}:host .sd-mobile-command-header{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px;padding:4px}:host .c-container.sd-table-mobile .c-paginator{flex-wrap:wrap;gap:4px}:host .c-container.sd-table-mobile .c-action{display:flex;align-items:center;min-width:0}:host .c-container.sd-table-mobile .sd-mobile-tools-trigger{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px}:host .c-container.sd-table-mobile .sd-mobile-paginator{margin-inline-start:auto}:host .c-container.sd-table-mobile .c-paginator,:host .c-container.sd-table-mobile .c-empty{background-color:var(--sd-surface);color:var(--sd-text)}:host .c-container.sd-table-mobile .c-paginator{background-color:var(--sd-table-bg, #ffffff)}:host ::ng-deep .sd-table-mobile .c-paginator button{min-width:44px;min-height:44px}:host .c-container.sd-table-mobile .c-paginator .sd-mobile-paginator{--mat-icon-button-state-layer-size: 44px;--mdc-icon-button-state-layer-size: 44px}:host ::ng-deep .mat-select-arrow{color:var(--sd-table-select-arrow, #a6a6a6)}:host ::ng-deep .sd-table-sort-header{cursor:pointer;outline:none}:host ::ng-deep .sd-table-sort-header:focus-visible{border-bottom:solid 1px currentColor}:host ::ng-deep th[aria-sort] .sd-table-sort-header{position:relative;padding-right:24px}:host ::ng-deep th[aria-sort] .sd-table-sort-header:after{content:\"\";position:absolute;top:50%;right:0;width:16px;height:16px;transform:translateY(-50%);background-color:var(--sd-text-secondary);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-size:16px 16px;mask-size:16px 16px;pointer-events:none}:host ::ng-deep th[aria-sort=ascending] .sd-table-sort-header:after,:host ::ng-deep th[aria-sort=descending] .sd-table-sort-header:after{background-color:var(--sd-text)}:host ::ng-deep th[aria-sort=none] .sd-table-sort-header:after{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M12 5.83L15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9 12 5.83zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15 12 18.17z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M12 5.83L15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9 12 5.83zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15 12 18.17z'/%3E%3C/svg%3E\")}:host ::ng-deep th[aria-sort=ascending] .sd-table-sort-header:after{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z'/%3E%3C/svg%3E\")}:host ::ng-deep th[aria-sort=descending] .sd-table-sort-header:after{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z'/%3E%3C/svg%3E\")}:host ::ng-deep .c-paginator .mat-mdc-paginator-range-label{margin:0 4px}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size{align-items:center}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select{--mat-select-trigger-text-size: var(--sd-font-size-14, 14px);--mat-paginator-select-trigger-text-size: var(--sd-font-size-14, 14px)}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select .mat-mdc-form-field-infix{display:flex;align-items:center;height:32px;min-height:32px;padding-top:0;padding-bottom:0}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select.mat-mdc-form-field .mat-mdc-form-field-infix mat-select.mat-mdc-select{margin-top:0}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select .mat-mdc-text-field-wrapper{padding-right:8px}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select .mat-mdc-select-arrow-wrapper{width:20px;justify-content:center}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select .mat-mdc-select-arrow{width:16px;height:16px;color:var(--sd-text-secondary);background-color:currentColor;-webkit-mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z'/%3E%3C/svg%3E\") center/16px 16px no-repeat;mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z'/%3E%3C/svg%3E\") center/16px 16px no-repeat}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select .mat-mdc-select-arrow svg{display:none}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select .mat-mdc-form-field-flex:hover .mat-mdc-select-arrow{color:var(--sd-text)}::ng-deep .mat-mdc-select-panel.sd-select-panel.sd-table-page-size-panel .mat-mdc-option{min-height:36px;padding:7px 12px}:host ::ng-deep .cdk-drag-preview{box-shadow:var(--sd-shadow-md);background:var(--sd-table-bg);display:table;width:100%}:host ::ng-deep .cdk-drag-preview td{padding:0 8px;border-bottom:1px solid var(--sd-table-row-divider)}:host ::ng-deep .cdk-drag-placeholder{opacity:0}:host ::ng-deep .cdk-drop-list-dragging tr.c-row:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}:host ::ng-deep .sd-selection-cell{width:42px;min-width:42px;max-width:42px}:host ::ng-deep .sd-filler-cell{width:auto;min-width:0;padding:0!important;border:0}:host ::ng-deep .sd-group-header-cell{background:var(--sd-table-group-row-bg, #f5f7fc);border-top:1px solid var(--sd-table-group-row-border, #e6e9f2);border-bottom:1px solid var(--sd-table-group-row-border, #e6e9f2)}:host ::ng-deep .sd-group-row{min-height:36px}:host ::ng-deep .sd-group-selection-slot{width:42px;min-width:42px;max-width:42px}:host ::ng-deep .c-selection{transform:scale(.85);transform-origin:center}:host ::ng-deep .sd-tree-line{display:inline-flex;align-items:center;min-height:32px}:host ::ng-deep .sd-tree-indent{flex:0 0 auto}:host ::ng-deep .sd-tree-toggle-slot{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px}:host ::ng-deep .sd-tree-toggle-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;background:transparent;border-radius:50%;cursor:pointer;color:var(--sd-text-secondary, #5b6472);transition:background-color .15s ease}:host ::ng-deep .sd-tree-toggle-btn sd-icon{font-size:var(--sd-font-size-18, 18px);width:18px;height:18px;line-height:var(--sd-line-height-18, 18px)}:host ::ng-deep .sd-tree-toggle-btn:hover{background-color:color-mix(in srgb,var(--sd-text) 8%,transparent)}:host ::ng-deep .sd-tree-toggle-btn[aria-busy=true]{cursor:progress}:host ::ng-deep .sd-tree-stt{margin-left:2px;white-space:nowrap}:host ::ng-deep .sd-tree-index-cell{text-align:left!important;white-space:nowrap;padding-left:8px;padding-right:8px}:host ::ng-deep .sd-tree-index-header{padding-left:32px}:host ::ng-deep tr.c-row.sd-tree-row.sd-tree-level-0{background:var(--sd-table-tree-level-0-bg, #fbfcfe)}:host ::ng-deep tr.c-row.sd-tree-row.sd-tree-level-0>td{font-weight:var(--sd-font-weight-medium, 500)}:host ::ng-deep tr.c-row.sd-tree-row.sd-tree-level-1{background:var(--sd-table-tree-level-1-bg, #ffffff)}:host ::ng-deep tr.c-row.sd-tree-row.sd-tree-level-2{background:var(--sd-table-tree-level-2-bg, #fafbfd)}:host ::ng-deep tr.c-row.sd-tree-row.sd-tree-level-3{background:var(--sd-table-tree-level-3-bg, #f6f8fb)}:host ::ng-deep .sd-stt-root{font-weight:var(--sd-font-weight-bold, 700);color:var(--sd-table-tree-root-text, #1f2330)}:host ::ng-deep .sd-mobile-tools-trigger .mdc-button__label{display:inline-flex;align-items:center;gap:6px}:host .sd-table-surface--quick-search>.c-container:not(.sd-table-mobile)>.c-table,:host .sd-table-surface--query-bar>.c-container:not(.sd-table-mobile)>.c-table{border-top-left-radius:0;border-top-right-radius:0}:host .sd-table-query-bar{display:block;flex:0 0 auto;min-width:0;background:var(--sd-table-bg, #ffffff);border-top-left-radius:var(--sd-radius-6, 6px);border-top-right-radius:var(--sd-radius-6, 6px);--sd-control-label-bg: var(--sd-table-bg, #ffffff)}:host .sd-table-query-bar-end{flex:none;display:flex;align-items:center;align-self:flex-start;padding-left:8px}:host .sd-table-header-cell--trigger{display:flex;align-items:center;gap:4px;min-width:0}:host .sd-table-header-cell--trigger>.c-header-title{flex:0 1 auto;min-width:0}:host .sd-table-header-cell--trigger.sd-table-header-cell--end{flex-direction:row-reverse;justify-content:flex-start}:host .sd-table-filter-trigger{flex:none;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:var(--sd-text-secondary);cursor:pointer;opacity:0;transition:opacity var(--sd-duration-fast, .12s) ease,background-color var(--sd-duration-fast, .12s) ease}:host .sd-table-filter-trigger sd-icon{width:15px;height:15px;font-size:15px}:host .sd-table-filter-trigger:hover{background:var(--sd-table-row-hover-bg)}:host .sd-table-filter-trigger:focus-visible{opacity:1;outline:2px solid var(--sd-focus-ring-color);outline-offset:1px}:host .sd-table-filter-trigger.sd-table-filter-trigger--active{opacity:1;color:var(--sd-primary)}:host th:hover .sd-table-filter-trigger,:host th:focus-within .sd-table-filter-trigger{opacity:1}@media(pointer:coarse){:host .sd-table-filter-trigger{opacity:1}}@media(prefers-reduced-motion:reduce){:host .sd-table-filter-trigger{transition:none}}@media(forced-colors:active){:host .sd-table-filter-trigger{color:ButtonText}:host .sd-table-filter-trigger--active{color:Highlight}}:host .sd-table-query-bar-hint{display:flex;align-items:center;gap:6px;margin:0;padding:0 12px 8px;background:var(--sd-table-bg, #ffffff);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-18, 18px);color:var(--sd-error)}:host .sd-table-query-bar-hint sd-icon{flex:none;width:16px;height:16px;font-size:var(--sd-font-size-16, 16px)}@keyframes sd-table-skeleton-sweep{to{background-position:480px 0}}@keyframes sd-table-progress-run{0%{transform:translate(-100%)}to{transform:translate(285.7142857143%)}}@keyframes sd-table-spin{to{transform:rotate(360deg)}}:host tr.sd-table-skeleton-row{height:var(--mat-table-row-item-container-height, 36px)}:host .sd-table-skeleton-cell{padding:0 8px;border-bottom:1px solid var(--sd-table-row-divider);vertical-align:middle}:host .sd-table-skeleton-bar{display:block;height:12px;border-radius:var(--sd-radius-4, 4px);background:linear-gradient(90deg,var(--sd-table-skeleton-bg) 0,var(--sd-table-skeleton-highlight) 40%,var(--sd-table-skeleton-bg) 80%) 0 0/480px 100%;animation:sd-table-skeleton-sweep 1.4s linear infinite}@media(prefers-reduced-motion:reduce){:host .sd-table-skeleton-bar{animation:none}}@media(forced-colors:active){:host .sd-table-skeleton-bar{forced-color-adjust:none;background:GrayText}}:host .sd-table-skeleton-bar[data-align=end]{margin-inline-start:auto}:host .sd-table-skeleton-bar[data-align=center]{margin-inline:auto}:host .sd-table-skeleton-bar[data-shape=pill]{height:20px;border-radius:999px}:host .sd-table-skeleton-bar[data-shape=box]{width:14px;height:14px;border-radius:3px}:host .sd-table-skeleton-block{overflow:hidden;border-radius:var(--sd-radius-6, 6px);background:var(--sd-surface)}:host .sd-table-skeleton-block-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:center;height:var(--mat-table-row-item-container-height, 36px);border-bottom:1px solid var(--sd-table-row-divider)}:host .sd-table-skeleton-block-row>.sd-table-skeleton-cell{border-bottom:0}:host .c-table>table>::ng-deep tbody{transition:opacity var(--sd-duration-fast, .12s)}@media(prefers-reduced-motion:reduce){:host .c-table>table>::ng-deep tbody{transition:none}}:host .c-table.c-table--dim{cursor:progress}:host .c-table.c-table--dim>table>::ng-deep thead,:host .c-table.c-table--dim>table>::ng-deep tfoot{cursor:auto}:host .c-table.c-table--dim>table>::ng-deep tbody{opacity:var(--sd-table-loading-dim, .55)}:host .c-table.c-table--dim>table>::ng-deep tbody,:host .c-table.c-table--dim>table>::ng-deep tbody *{pointer-events:none!important}:host .sd-table-progress{position:absolute;top:var(--sd-table-head-h, 0px);right:0;left:0;z-index:20;height:2px;overflow:hidden;pointer-events:none;background:var(--sd-table-progress-track)}:host .sd-table-progress:before{content:\"\";position:absolute;inset:0 auto 0 0;width:35%;background:var(--sd-table-spinner);animation:sd-table-progress-run 1.1s ease-in-out infinite}@media(prefers-reduced-motion:reduce){:host .sd-table-progress:before{width:100%;opacity:.6;animation:none}}@media(forced-colors:active){:host .sd-table-progress{forced-color-adjust:none;box-sizing:content-box;border:1px solid CanvasText;background:Canvas}:host .sd-table-progress:before{background:Highlight}}:host .sd-table-spinner{display:inline-block;flex:0 0 auto;vertical-align:middle;box-sizing:border-box;width:16px;height:16px;border:2px solid var(--sd-table-progress-track);border-top-color:var(--sd-table-spinner);border-radius:50%;animation:sd-table-spin .8s linear infinite}@media(prefers-reduced-motion:reduce){:host .sd-table-spinner{animation:none}}@media(forced-colors:active){:host .sd-table-spinner{forced-color-adjust:none;border-color:GrayText;border-top-color:Highlight}}:host .sd-table-progress-anchor{position:sticky;top:0;z-index:20;height:0}:host .sd-table-progress-anchor>.sd-table-progress{top:0}.sd-aggregate-row,.sd-aggregate-total,.sd-mobile-aggregate{background:color-mix(in srgb,var(--sd-surface-muted) 35%,var(--sd-surface));color:var(--sd-text);font-weight:var(--sd-font-weight-medium, 500)}.sd-aggregate-cell{background:inherit;border-top:1px solid var(--sd-border)}:host(.sd-table--fill){flex:1 1 0;height:auto;min-height:var(--sd-table-fill-min, 0px);overflow:visible}:host(.sd-table--fill) .c-container{min-height:0}:host(.sd-table--fill) .c-container>.c-table{min-height:calc(var(--sd-table-fill-head, 40px) + 5 * var(--mat-table-row-item-container-height, 36px))}:host(.sd-table--fill) .c-container>.c-paginator{flex:none;min-height:48px}\n", ":host ::ng-deep .sticky-shadow-right{overflow:visible!important}:host ::ng-deep .sticky-shadow-right:after{content:\"\";position:absolute;top:0;right:0;bottom:0;width:8px;transform:translate(100%);background:linear-gradient(to right,rgba(0,0,0,.12),transparent);pointer-events:none}:host ::ng-deep .sticky-shadow-left{overflow:visible!important}:host ::ng-deep .sticky-shadow-left:after{content:\"\";position:absolute;top:0;left:0;bottom:0;width:8px;transform:translate(-100%);background:linear-gradient(to left,rgba(0,0,0,.12),transparent);pointer-events:none}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdDataState, selector: "sd-data-state", inputs: ["state", "title", "message", "icon", "fontSet", "iconShape", "retryable", "retryLabel", "actionLabel", "compact", "fullPage"], outputs: ["sdRetry", "sdAction"] }, { kind: "directive", type: SdDataStateTemplateDirective, selector: "ng-template[sdDataStateTemplate]" }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i3$3.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i4$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i4$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i4$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i4$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i4$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i4$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i4$1.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i4$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i4$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i4$1.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i4$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i4$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i4$1.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "directive", type: i4$1.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i5.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i3.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatRadioModule }, { kind: "component", type: i4.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i1$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i1$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i1$1.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType", "indicator", "indicatorColor", "indicatorMax", "indicatorLabel"], outputs: ["click"] }, { kind: "component", type: SdButtonItem, selector: "sd-button-item", inputs: ["color", "prefixIcon", "suffixIcon", "fontSet", "disabled", "tooltip", "autoId"], outputs: ["click"] }, { kind: "component", type: DesktopCommand, selector: "desktop-command", inputs: ["autoId", "item", "itemIndex", "commands"] }, { kind: "component", type: DesktopCellComponent, selector: "desktop-cell", inputs: ["column", "item", "cellDef"] }, { kind: "component", type: ColumnTitleComponent, selector: "column-title", inputs: ["column", "titleDef"] }, { kind: "component", type: ExternalFilterComponent, selector: "external-filter", inputs: ["autoId", "filter", "externalFilters", "filterRegister", "collapsedByDefault"] }, { kind: "component", type: TableQuickSearchComponent, selector: "sd-table-quick-search", inputs: ["option", "value", "autoId", "rightTemplate"], outputs: ["valueChange"] }, { kind: "component", type: SdQueryBar, selector: "sd-query-bar", inputs: ["option", "autoId", "fields", "filters", "logic", "search", "mode", "density", "showSearch", "showSavedFilters", "savedFiltersKey", "showLogicToggle", "showClearAll", "showOperatorOnChip"], outputs: ["filtersChange", "logicChange", "searchChange", "queryChange", "apply"] }, { kind: "component", type: ConfigComponent, selector: "config", inputs: ["autoId", "tableOption"], outputs: ["changes", "defaultsRestored"] }, { kind: "component", type: ColumnFilterComponent, selector: "column-filter", inputs: ["autoId", "column", "columnFilter", "cacheValues", "value", "operator", "isMobile"], outputs: ["operatorChange", "filterChange", "filterCommit"] }, { kind: "component", type: MobileFilterComponent, selector: "mobile-filter", inputs: ["autoId", "filter", "externalFilters", "columns", "filterDefs", "filterRegister", "cacheValues"] }, { kind: "directive", type: SdAggregateLayoutDirective, selector: "table[sdAggregateLayout]" }, { kind: "directive", type: SdTableFooterRowDefDirective, selector: "[sdTableFooterRowDef]", inputs: ["sdTableFooterRowDef", "sdTableFooterRowDefSticky"] }, { kind: "directive", type: SdScrollDirective, selector: "[sdScroll]" }, { kind: "directive", type: SdHoverCopyDirective, selector: "[sdHoverCopy]", inputs: ["sdHoverCopy", "sdHoverCopyDisabled"] }, { kind: "component", type: SelectorActionComponent, selector: "selector-action", inputs: ["autoId", "tableOption", "selectedTableItems"], outputs: ["clear"] }, { kind: "directive", type: StickyShadowDirective, selector: "[stickyShadow]" }, { kind: "directive", type: SdColumnResizeDirective, selector: "[sdColumnResize]", inputs: ["sdColumnResize", "minWidth", "maxWidth"], outputs: ["resizeEnd"] }, { kind: "directive", type: SdTableSortHeaderDirective, selector: "[sdTableSortHeader]", inputs: ["sdTableSortHeader"] }, { kind: "component", type: SdTableMobileCardsComponent, selector: "sd-table-mobile-cards", inputs: ["table", "rows", "dataRows", "aggregateTemplate", "groupTemplate"] }, { kind: "component", type: SdTableMobileActionsComponent, selector: "sd-table-mobile-actions", inputs: ["actions", "title", "selection", "count", "autoOpen", "autoId"], outputs: ["end"] }, { kind: "component", type: SdTableUnknownTotalPaginator, selector: "sd-table-unknown-total-paginator", inputs: ["state", "pageSizeOptions", "hidePageSize", "showFirstButton", "autoId"], outputs: ["page"] }, { kind: "pipe", type: i1$2.JsonPipe, name: "json" }, { kind: "pipe", type: SdGroupPipe, name: "sdGroup" }, { kind: "pipe", type: SdTreePipe, name: "sdTree" }, { kind: "pipe", type: SdAggregateRowsPipe, name: "sdAggregateRows" }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], animations: [
|
|
7478
8620
|
trigger('detailExpand', [
|
|
7479
8621
|
state('collapsed', style({ height: '0', minHeight: '0', visibility: 'hidden' })),
|
|
7480
8622
|
state('expanded', style({ height: '*', visibility: 'visible' })),
|
|
@@ -7495,6 +8637,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
7495
8637
|
tabindex: '0',
|
|
7496
8638
|
'[attr.data-loading]': 'loading() ? "true" : "false"',
|
|
7497
8639
|
'[attr.data-loading-view]': 'loadingView()',
|
|
8640
|
+
'[attr.data-filter-mode]': 'effectiveFilterMode()',
|
|
7498
8641
|
'[class.sd-table--fill]': 'fill()',
|
|
7499
8642
|
}, providers: [
|
|
7500
8643
|
DatePipe,
|
|
@@ -7528,6 +8671,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
7528
8671
|
ColumnTitleComponent,
|
|
7529
8672
|
ExternalFilterComponent,
|
|
7530
8673
|
TableQuickSearchComponent,
|
|
8674
|
+
SdQueryBar,
|
|
7531
8675
|
ConfigComponent,
|
|
7532
8676
|
ColumnFilterComponent,
|
|
7533
8677
|
MobileFilterComponent,
|
|
@@ -7547,8 +8691,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
|
|
|
7547
8691
|
SdTableMobileCardsComponent,
|
|
7548
8692
|
SdTableMobileActionsComponent,
|
|
7549
8693
|
SdTableUnknownTotalPaginator,
|
|
7550
|
-
], template: "@let _visibleSelectAll = visibleSelectAll();\n@let _isSelectIndeterminate = isSelectIndeterminate();\n@let _isSelectAll = isSelectAll();\n@let _configuration = configuration();\n@let _tableOption = tableOption()!;\n@let _loading = loading();\n@let _loadingView = loadingView();\n@let _readState = readState();\n@let _hideReadError = hideReadError();\n@let _dataStateTemplate = dataStateTemplate();\n@let _items = items();\n@let _total = total();\n@let _isFiltered = isFiltered();\n@let _requireFiltered = requireFiltered();\n@let _export = _tableOption?.export;\n@let _exporting = exporting();\n@let _titleDef = titleDef();\n@let _autoId = autoId();\n@let _exportTitle = exportTitle();\n@let _cellDef = cellDef();\n@let _footerDef = footerDef();\n@let _sdSubInformation = sdSubInformation();\n@let _configComponent = configComponent();\n@let _mobileFilter = mobileFilter();\n@let _selectedTableItems = selectedTableItems();\n@let _rowCommands = rowCommands();\n@let _mobileCards = mobileCards();\n@let _isMobile = isMobile();\n@let _showInlineFilter =\n !_isMobile &&\n !_tableOption?.filter?.disabled &&\n _tableOption?.filter?.hideInlineFilter !== true &&\n !(_tableOption?.filter?.hideInlineFilter === 'auto' && !_isFiltered && knownRowCount()! <= 10);\n@let _commandHeaderDef = sdCommandHeaderDef();\n@let _quickSearch = quickSearchOption();\n@let _aggregate = aggregateSnapshot();\n@let _aggregateColumns = aggregateColumns();\n@let _aggregateColumnIds = aggregateColumnIds();\n@let _headerFilterColumns = headerFilterColumns();\n<!-- why: tree kh\u00F4ng c\u00F2n c\u1ED9t ri\u00EAng \u2014 khi KH\u00D4NG c\u00F3 c\u1ED9t Index, icon expand nh\u00FAng v\u00E0o\n c\u1ED9t data \u0111\u1EA7u ti\u00EAn. \u0110\u00E2y l\u00E0 field c\u1EE7a c\u1ED9t \u0111\u00F3 (null n\u1EBFu c\u00F3 Index ho\u1EB7c kh\u00F4ng tree). -->\n@let _treeFirstField = _tableOption?.tree && !_tableOption.index?.enabled ? _configuration?.firstColumns?.[0]?.field : null;\n\n<!-- why: v\u00F9ng status lu\u00F4n c\u00F3 trong DOM, k\u1EC3 c\u1EA3 tr\u01B0\u1EDBc khi c\u00F3 configuration. V\u00F9ng ch\u1EC9 render trong l\u00FAc t\u1EA3i b\u1ECB g\u1EE1\n tr\u01B0\u1EDBc khi screen reader k\u1ECBp \u0111\u1ECDc v\u00E0 kh\u00F4ng b\u00E1o \u0111\u01B0\u1EE3c \"\u0111\u00E3 t\u1EA3i xong\". -->\n<span class=\"sd-table-live\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">{{ liveMessage() }}</span>\n@if (_configuration) {\n @if (!_mobileCards && !_tableOption.filter?.disabled && !!_tableOption.filter?.externalFilters?.length && filterRegister) {\n <external-filter\n class=\"mb-16\"\n [autoId]=\"_autoId\"\n [filterRegister]=\"filterRegister\"\n [filter]=\"_tableOption.filter!\"\n [externalFilters]=\"_tableOption.filter?.externalFilters!\"\n [collapsedByDefault]=\"externalFilterCollapsedByDefault()\">\n </external-filter>\n }\n @let groupedItems = _items | sdTree: _tableOption.tree : treeRevision() | sdGroup: _tableOption : groupExpandState : groupHost;\n @let renderItems = groupedItems | sdAggregateRows: _aggregate : _tableOption : aggregateRenderHost;\n\n <ng-template #aggregateCell let-cell>\n @if (cell) {\n @if (cell.templateRef) {\n <ng-container *ngTemplateOutlet=\"cell.templateRef; context: cell.context\"></ng-container>\n } @else {\n <span [attr.data-complete]=\"cell.context.isComplete\">{{ cell.text }}</span>\n }\n }\n </ng-template>\n <ng-template #inlineColumnFilter let-column>\n <column-filter\n [autoId]=\"_autoId\"\n [value]=\"columnFilter?.[column.field!]!\"\n [operator]=\"columnOperator[column.field]\"\n (operatorChange)=\"columnOperator[column.field] = $event!; onOperatorChange(column, $event)\"\n [columnFilter]=\"columnFilter!\"\n [cacheValues]=\"cacheValues\"\n [column]=\"column\"\n (filterChange)=\"onFilterChange()\"\n (filterCommit)=\"onFilterCommit()\">\n </column-filter>\n </ng-template>\n <ng-template #mobileAggregate let-summary=\"summary\">\n <div class=\"sd-mobile-aggregate p-12\" role=\"region\" [attr.aria-label]=\"'core.component.table.mobile.summary' | sdTranslate\">\n @for (entry of _aggregateColumns; track entry.field) {\n @let cell = summary.cells.get(entry.field);\n @if (cell && entry.column) {\n <div class=\"d-flex align-items-center flex-wrap gap-8 py-8\">\n <column-title [column]=\"entry.column\" [titleDef]=\"_titleDef[entry.field]\"></column-title>\n <ng-container *ngTemplateOutlet=\"aggregateCell; context: { $implicit: cell }\"></ng-container>\n </div>\n }\n }\n </div>\n </ng-template>\n\n <!-- Tree toggle d\u00F9ng chung: indent (theo c\u1EA5p) + slot chevron/spinner. Nh\u00FAng v\u00E0o\n c\u1ED9t Index ho\u1EB7c c\u1ED9t data \u0111\u1EA7u qua *ngTemplateOutlet (context: { row }). -->\n <ng-template #sdTreeToggle let-row=\"row\">\n @let _tree = row?.meta?.tree;\n @if (_tree) {\n <span class=\"sd-tree-indent\" [style.width.px]=\"(_tree.level ?? 0) * (_tableOption.tree?.indentSize ?? 20)\"></span>\n <span class=\"sd-tree-toggle-slot\">\n @if (_tree.hasChildren) {\n @let _aid = _autoId;\n @let _expanding = !!_tree.isExpanding;\n <!-- why: n\u00FAt lu\u00F4n n\u1EB1m trong DOM, ch\u1EC9 \u0111\u1ED5i icon th\u00E0nh spinner khi \u0111ang t\u1EA3i con; g\u1EE1 n\u00FAt l\u00E0m focus b\u00E0n ph\u00EDm r\u01A1i\n v\u1EC1 body. Click trong l\u00FAc t\u1EA3i b\u1ECB onTreeToggle b\u1ECF qua. -->\n <button\n type=\"button\"\n class=\"sd-tree-toggle-btn\"\n [attr.data-autoid]=\"_aid ? _aid + '-tree-toggle-' + row.meta.id : null\"\n [attr.aria-label]=\"'core.component.table.tree-toggle' | sdTranslate\"\n [attr.aria-expanded]=\"!!_tree.isExpanded\"\n [attr.aria-busy]=\"_expanding ? 'true' : null\"\n [attr.aria-disabled]=\"_expanding ? 'true' : null\"\n (click)=\"onTreeToggle(row); $event.stopPropagation()\">\n @if (_expanding) {\n <span class=\"sd-table-spinner\" aria-hidden=\"true\"></span>\n } @else {\n <sd-icon [name]=\"_tree.isExpanded ? 'expand_more' : 'chevron_right'\"></sd-icon>\n }\n </button>\n }\n </span>\n }\n </ng-template>\n\n <ng-template #sdGroupHeader let-item=\"item\">\n <div class=\"sd-group-row d-flex align-items-center py-8\">\n @if (_tableOption.selector?.visible && !_tableOption.selector?.single) {\n <div class=\"sd-group-selection-slot d-flex align-items-center justify-content-center\">\n <mat-checkbox\n class=\"c-selection\"\n color=\"primary\"\n [checked]=\"isGroupAllSelected(item)\"\n [indeterminate]=\"isGroupIndeterminate(item)\"\n (change)=\"onSelectGroup(item, $event.checked)\">\n </mat-checkbox>\n </div>\n } @else {\n <div class=\"sd-group-selection-slot\"></div>\n }\n @if (_tableOption.group?.collapsible) {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-group-toggle-' + (item.meta.group?.key || item.meta.id) : null\"\n type=\"text\"\n [prefixIcon]=\"item.meta.group.isExpanded ? 'expand_more' : 'chevron_right'\"\n width=\"32px\"\n (click)=\"toggleGroupExpand(item)\">\n </sd-button>\n }\n @if (sdGroupDef()?.templateRef; as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl; context: groupContext(item)\"></ng-container>\n } @else {\n <span class=\"T14R\">{{ item.meta.group.values | json }}</span>\n }\n </div>\n </ng-template>\n\n <ng-content select=\"[sdTableTop]\"></ng-content>\n <div class=\"sd-table-surface\" [class.sd-table-surface--quick-search]=\"!!_quickSearch\">\n @if (_quickSearch) {\n <sd-table-quick-search\n [option]=\"_quickSearch\"\n [value]=\"quickSearchValue()\"\n [autoId]=\"_autoId\"\n [rightTemplate]=\"sdQuickSearchRightDef()?.templateRef\"\n (valueChange)=\"onQuickSearchChange($event)\" />\n }\n <div class=\"c-container\" [class.sd-table-mobile]=\"_mobileCards\">\n <!-- why: l\u1EDBp loading kh\u00F4ng ph\u1EE7 l\u00EAn b\u1EA3ng: header, filter, sort v\u00E0 thanh cu\u1ED9n lu\u00F4n d\u00F9ng \u0111\u01B0\u1EE3c. Ch\u01B0a c\u00F3 d\u00F2ng th\u00EC\n khung x\u01B0\u01A1ng (matNoDataRow); \u0111\u00E3 c\u00F3 d\u00F2ng th\u00EC gi\u1EEF d\u00F2ng c\u0169, qu\u00E1 showDelay m\u1EDBi l\u00E0m m\u1EDD d\u00F2ng v\u00E0 hi\u1EC7n thanh ti\u1EBFn\n tr\u00ECnh. aria-busy v\u1EABn theo loading() th\u1EADt; v\u00F9ng .sd-table-live b\u00E1o \"\u0111ang t\u1EA3i\"/\"\u0111\u00E3 t\u1EA3i xong\". -->\n <div\n class=\"c-table\"\n sdScroll\n stickyShadow\n matSort\n [matSortDisabled]=\"!_tableOption.sort?.enable\"\n [class.c-table--dim]=\"_loadingView === 'refresh' && loadingSettings().dim\"\n [attr.aria-busy]=\"_loading ? 'true' : null\"\n [style.max-height]=\"_tableOption.style?.maxHeight\"\n [style.min-height]=\"_tableOption.style?.minHeight\">\n @if (_mobileCards) {\n @if (_commandHeaderDef) {\n <div class=\"sd-mobile-command-header\"><ng-container *ngTemplateOutlet=\"_commandHeaderDef.templateRef\"></ng-container></div>\n }\n @if (_loadingView === 'refresh') {\n <!-- Mobile: kh\u00F4ng c\u00F3 header b\u1EA3ng; thanh n\u1EB1m \u1EDF m\u00E9p tr\u00EAn danh s\u00E1ch th\u1EBB, d\u01B0\u1EDBi command header. Anchor cao 0\n n\u00EAn thanh hi\u1EC7n/\u1EA9n kh\u00F4ng \u0111\u1EA9y th\u1EBB. -->\n <div class=\"sd-table-progress-anchor\">\n <div class=\"sd-table-progress\" aria-hidden=\"true\"></div>\n </div>\n }\n <sd-table-mobile-cards\n [table]=\"this\"\n [rows]=\"renderItems\"\n [dataRows]=\"groupedItems\"\n [groupTemplate]=\"sdGroupHeader\"\n [aggregateTemplate]=\"mobileAggregate\"></sd-table-mobile-cards>\n @if (_aggregate.total; as summary) {\n <ng-container *ngTemplateOutlet=\"mobileAggregate; context: { summary: summary }\"></ng-container>\n }\n @if (hasFooter()) {\n <div class=\"sd-mobile-footer p-12\" role=\"region\" [attr.aria-label]=\"'core.component.table.mobile.summary' | sdTranslate\">\n @for (column of mobileFooterColumns(); track column.field) {\n <div class=\"d-flex align-items-center flex-wrap gap-8 py-8\">\n <column-title [column]=\"column\" [titleDef]=\"_titleDef[column.field]\"></column-title>\n <ng-container\n *ngTemplateOutlet=\"_footerDef[column.field].templateRef; context: { items: _items, column: column }\"></ng-container>\n </div>\n }\n </div>\n }\n } @else {\n <table\n mat-table\n [class.sd-table-grouped-header]=\"_configuration.multipleHeader\"\n sdAggregateLayout\n [dataSource]=\"renderItems\"\n [trackBy]=\"trackBy\"\n multiTemplateDataRows\n cdkDropList\n [cdkDropListData]=\"groupedItems\"\n [cdkDropListDisabled]=\"!_tableOption.rowReorder?.enabled\"\n [cdkDropListSortPredicate]=\"reorderSortPredicate\"\n (cdkDropListDropped)=\"onReorderDrop($event)\">\n @if (_tableOption.rowReorder?.enabled) {\n <ng-container matColumnDef=\"sdReorder\">\n <th mat-header-cell *matHeaderCellDef class=\"sd-reorder-header\" [attr.rowspan]=\"_configuration.multipleHeader ? 2 : 1\"></th>\n <td mat-cell *matCellDef=\"let row\" class=\"sd-reorder-cell\">\n @if (!row.meta?.group?.items?.length) {\n <sd-icon\n cdkDragHandle\n [class.sd-reorder-disabled]=\"isReorderDisabled(row)\"\n [name]=\"_tableOption.rowReorder?.icon || 'drag_indicator'\"></sd-icon>\n }\n </td>\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n }\n\n <ng-container matColumnDef=\"sdSubInformation\" sticky>\n <td class=\"p-0\" mat-cell *matCellDef=\"let item\" [attr.colspan]=\"_configuration.displayedColumns.length\">\n @if (_sdSubInformation?.templateRef) {\n @if (_tableOption.expand?.always) {\n <ng-container *ngTemplateOutlet=\"_sdSubInformation?.templateRef!; context: { item: item }\"> </ng-container>\n } @else {\n <div [@detailExpand]=\"item.meta.expand?.isExpanded ? 'expanded' : 'collapsed'\">\n @if (item.meta.expand?.isExpanded) {\n <ng-container *ngTemplateOutlet=\"_sdSubInformation?.templateRef!; context: { item: item }\"> </ng-container>\n }\n </div>\n }\n }\n </td>\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"sdSubInformationAction\" stickyEnd>\n <th\n class=\"p-0\"\n mat-header-cell\n *matHeaderCellDef\n style=\"width: 1px\"\n [attr.rowspan]=\"_configuration.multipleHeader ? 2 : 1\"></th>\n <td mat-cell *matCellDef=\"let element\">\n @if (!_tableOption.expand?.always) {\n @let _expanding = !!element.meta.expand?.isExpanding;\n <!-- why: n\u00FAt 35px gi\u1EEF nguy\u00EAn khi \u0111ang t\u1EA3i ([loading] thay prefix icon b\u1EB1ng spinner) \u0111\u1EC3 focus b\u00E0n ph\u00EDm\n kh\u00F4ng m\u1EA5t; onExpand b\u1ECF qua click trong l\u00FAc t\u1EA3i. color primary ch\u1EC9 \u0111\u1EC3 spinner theo m\u00E0u nh\u1EA5n. -->\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-expand-' + element.meta.id : null\"\n type=\"text\"\n [color]=\"_expanding ? 'primary' : null\"\n [loading]=\"_expanding\"\n [attr.aria-busy]=\"_expanding ? 'true' : null\"\n [prefixIcon]=\"element.meta.expand?.isExpanded ? 'expand_less' : 'expand_more'\"\n (click)=\"onExpand(element)\"\n width=\"35px\">\n </sd-button>\n }\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"sdSelection\" sticky>\n <th class=\"sd-selection-cell p-0\" mat-header-cell *matHeaderCellDef [attr.rowspan]=\"_configuration.multipleHeader ? 2 : 1\">\n @if (_visibleSelectAll) {\n <mat-checkbox\n class=\"c-selection px-8\"\n color=\"primary\"\n [indeterminate]=\"_isSelectIndeterminate\"\n [ngModel]=\"_isSelectAll\"\n (ngModelChange)=\"isSelectAll.set($event)\"\n (change)=\"onSelectAll()\">\n </mat-checkbox>\n }\n </th>\n\n <td class=\"sd-selection-cell p-0\" mat-cell *matCellDef=\"let item\">\n @let visible = item.meta.selector?.visible;\n @if (visible) {\n @if (_tableOption.selector?.single) {\n <mat-radio-button\n class=\"c-selection px-8\"\n color=\"primary\"\n [checked]=\"item.meta.selector.isSelected\"\n (change)=\"item.meta.selector.isSelected = true; onSelect(item)\"\n [disabled]=\"item.meta.selector?.disabled\">\n </mat-radio-button>\n } @else {\n <mat-checkbox\n class=\"c-selection px-8\"\n color=\"primary\"\n [(ngModel)]=\"item.meta.selector.isSelected\"\n (change)=\"onSelect(item)\"\n [disabled]=\"item.meta.selector?.disabled\">\n </mat-checkbox>\n }\n }\n </td>\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n @if (_tableOption.index?.enabled) {\n @let _pageOffset = pageOffset();\n @let _indexWidth = _tableOption.index?.width || '50px';\n <!-- why: khi tree, c\u1ED9t Index \"\u00F4m\" th\u00EAm chevron + indent. D\u00F9ng width:1px +\n nowrap (.sd-tree-index-cell) \u0111\u1EC3 c\u1ED9t co S\u00C1T n\u1ED9i dung, kh\u00F4ng chi\u1EBFm ch\u1ED7\n th\u1EEBa; header \"#\" canh tr\u00E1i l\u00F9i v\u00E0o (.sd-tree-index-header) cho th\u1EB3ng s\u1ED1. -->\n @let _treeIndex = !!_tableOption.tree;\n <ng-container matColumnDef=\"sdIndex\" sticky>\n <th\n [class.p-0]=\"!_treeIndex\"\n [class.text-center]=\"!_treeIndex\"\n [class.sd-tree-index-cell]=\"_treeIndex\"\n [class.sd-tree-index-header]=\"_treeIndex\"\n mat-header-cell\n *matHeaderCellDef\n [style.width]=\"_treeIndex ? '1px' : _indexWidth\"\n [style.min-width]=\"_treeIndex ? null : _indexWidth\"\n [style.max-width]=\"_treeIndex ? null : _indexWidth\"\n [attr.rowspan]=\"_configuration.multipleHeader ? 2 : 1\">\n {{ _tableOption.index?.title || '#' }}\n </th>\n <td\n [class.px-4]=\"!_treeIndex\"\n [class.text-center]=\"!_treeIndex\"\n [class.sd-tree-index-cell]=\"_treeIndex\"\n mat-cell\n *matCellDef=\"let item; let i = dataIndex\"\n [style.width]=\"_treeIndex ? '1px' : null\"\n [style.min-width]=\"_treeIndex ? null : _indexWidth\"\n [style.max-width]=\"_treeIndex ? null : _indexWidth\">\n @if (!item?.meta?.group?.isGroupHeader) {\n @if (_treeIndex) {\n <!-- why: tree \u2192 chevron + indent + STT ph\u00E2n c\u1EA5p (1, 1.2, 1.2.1). T\u00F4 \u0111\u1EADm root (level 0). -->\n <span class=\"sd-tree-line\">\n <ng-container *ngTemplateOutlet=\"sdTreeToggle; context: { row: item }\"></ng-container>\n @if (item?.meta?.tree?.indexPath?.length) {\n <span class=\"sd-tree-stt\" [class.sd-stt-root]=\"(item.meta.tree.level ?? 0) === 0\">\n {{ item.meta.tree.indexPath.join('.') }}\n </span>\n }\n </span>\n } @else {\n {{ _pageOffset + (aggregateRenderHost.indices.get(item) ?? i) + 1 }}\n }\n }\n </td>\n <td\n mat-footer-cell\n *matFooterCellDef\n [style.width]=\"_treeIndex ? '1px' : null\"\n [style.min-width]=\"_treeIndex ? null : _indexWidth\"\n [style.max-width]=\"_treeIndex ? null : _indexWidth\"></td>\n </ng-container>\n }\n <ng-container\n matColumnDef=\"sdCommand\"\n [sticky]=\"_tableOption.command?.align !== 'right'\"\n [stickyEnd]=\"_tableOption.command?.align === 'right'\">\n <!-- why: \u00F4 header c\u1EE7a c\u1ED9t command v\u1ED1n \u0111\u1EC3 tr\u1ED1ng. Cho consumer chi\u1EBFm ch\u1ED7 \u0111\u00F3 b\u1EB1ng\n `sdTableCommandHeaderDef` (th\u01B0\u1EDDng l\u00E0 n\u00FAt th\u00EAm d\u00F2ng) th\u00EC h\u00E0nh \u0111\u1ED9ng c\u1EA5p b\u1EA3ng n\u1EB1m ngay\n tr\u00EAn c\u1EE5m n\u00FAt c\u1EE7a t\u1EEBng d\u00F2ng, thay v\u00EC ph\u1EA3i d\u1EF1ng th\u00EAm m\u1ED9t d\u1EA3i ri\u00EAng d\u01B0\u1EDBi b\u1EA3ng. -->\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 50px\" [attr.rowspan]=\"_configuration.multipleHeader ? 2 : 1\">\n @if (_commandHeaderDef) {\n <div class=\"sd-command-header d-flex align-items-center justify-content-center\">\n <ng-container *ngTemplateOutlet=\"_commandHeaderDef.templateRef\"></ng-container>\n </div>\n }\n </th>\n <!-- why: `dataIndex` do CDK c\u1EA5p s\u1EB5n. B\u1EA3n c\u0169 d\u00F9ng `groupedItems.indexOf(item)` \u2014\n qu\u00E9t to\u00E0n m\u1EA3ng cho M\u1ED6I d\u00F2ng render \u1EDF M\u1ED6I CD pass (O(n\u00B2) tr\u00EAn \u0111\u01B0\u1EDDng render),\n v\u00E0 c\u00F2n tr\u1EA3 sai index khi 2 d\u00F2ng tr\u00F9ng reference. -->\n <td class=\"px-8\" mat-cell *matCellDef=\"let item; let i = dataIndex\">\n <desktop-command\n [autoId]=\"_autoId\"\n [commands]=\"_rowCommands\"\n [item]=\"item\"\n [itemIndex]=\"aggregateRenderHost.indices.get(item) ?? i\"></desktop-command>\n </td>\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n <!-- why: group header row d\u00F9ng matRowDef RI\u00CANG v\u1EDBi column list ['sdGroupHeader']\n qua predicate when:isGroupHeaderRow. Cell colspan = displayedColumns.length \u0111\u1EC3\n span TO\u00C0N B\u1ED8 width data row. Tr\u00E1nh colspan trick overflow row khi c\u00E1c TD kh\u00E1c render. -->\n <ng-container matColumnDef=\"sdGroupHeader\">\n <td class=\"p-0 sd-group-header-cell\" mat-cell *matCellDef=\"let item\" [attr.colspan]=\"sdGroupColspan()\">\n <ng-container *ngTemplateOutlet=\"sdGroupHeader; context: { item: item }\"></ng-container>\n </td>\n </ng-container>\n <!-- why: filler column \u1EDF cu\u1ED1i h\u1EA5p th\u1EE5 leftover space khi t\u1ED5ng width c\u00E1c c\u1ED9t data < container \u2014 gi\u1EEF cho selection/STT/command kh\u00F4ng b\u1ECB d\u00E3n. -->\n <ng-container matColumnDef=\"sdFiller\">\n <th class=\"sd-filler-cell p-0\" mat-header-cell *matHeaderCellDef [attr.rowspan]=\"_configuration.multipleHeader ? 2 : 1\"></th>\n <td class=\"sd-filler-cell p-0\" mat-cell *matCellDef=\"let item\"></td>\n <td class=\"sd-filler-cell p-0\" mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n @for (column of _configuration.firstColumns; track column.field) {\n <ng-container [matColumnDef]=\"column.field\" [sticky]=\"_configuration.fixedColumn[column.field]\">\n <th\n mat-header-cell\n *matHeaderCellDef\n class=\"px-8 c-th\"\n [class.sd-column-group]=\"column.type === 'children'\"\n [attr.scope]=\"column.type === 'children' ? 'colgroup' : 'col'\"\n [sdColumnResize]=\"!!_tableOption.config?.resizable && column.type !== 'children'\"\n [minWidth]=\"column.minWidth\"\n [maxWidth]=\"column.maxWidth\"\n (resizeEnd)=\"onColumnResize(column.field, $event)\"\n [style.width]=\"column.width\"\n [style.min-width]=\"column.minWidth || column.width\"\n [style.max-width]=\"column.maxWidth\"\n [attr.rowspan]=\"_configuration.multipleHeader && column.type !== 'children' ? 2 : 1\"\n [attr.colspan]=\"column.type === 'children' ? column.children.length : 1\"\n [attr.aria-sort]=\"\n _tableOption.sort?.enable && column.type !== 'children' && column.sortable ? getSortAria(column.field) : null\n \">\n <div>\n <!-- why: sort control ch\u1EC9 \u00F4m title; filter l\u00E0 sibling n\u00EAn kh\u00F4ng th\u00E0nh interactive\n descendant. aria-sort thu\u1ED9c semantic <th>, kh\u00F4ng thu\u1ED9c control n\u00E0y. -->\n @if (column.type === 'children') {\n <div class=\"c-header-title sd-column-group-title\">\n <column-title [column]=\"column\" [titleDef]=\"_titleDef[column.field]\"></column-title>\n </div>\n } @else {\n @if (_tableOption.sort?.enable && column.sortable) {\n <div\n [sdTableSortHeader]=\"column.field\"\n class=\"c-header-title\"\n [class.justify-content-end]=\"column.align === 'right'\"\n [class.text-right]=\"column.align === 'right'\">\n <column-title [column]=\"column\" [titleDef]=\"_titleDef[column.field]\"></column-title>\n </div>\n } @else {\n <div\n class=\"c-header-title\"\n [class.justify-content-end]=\"column.align === 'right'\"\n [class.text-right]=\"column.align === 'right'\">\n <column-title [column]=\"column\" [titleDef]=\"_titleDef[column.field]\"></column-title>\n </div>\n }\n @if (_showInlineFilter && !_configuration.multipleHeader) {\n <ng-container *ngTemplateOutlet=\"inlineColumnFilter; context: { $implicit: column }\"></ng-container>\n }\n }\n </div>\n </th>\n <td\n class=\"c-td px-0\"\n [class.d-none]=\"column.type === 'children'\"\n mat-cell\n *matCellDef=\"let item\"\n [sdHoverCopy]=\"(item.data && item.data[column.field]) || ''\"\n [sdHoverCopyDisabled]=\"!column.cell?.copiable\">\n @if (column.type !== 'children' && !item?.meta?.group?.isGroupHeader) {\n @if (_treeFirstField && column.field === _treeFirstField) {\n <!-- why: kh\u00F4ng c\u00F3 c\u1ED9t Index \u2192 chevron + indent nh\u00FAng v\u00E0o c\u1ED9t data \u0111\u1EA7u (nh\u01B0 file explorer). -->\n <span class=\"sd-tree-line px-8\">\n <ng-container *ngTemplateOutlet=\"sdTreeToggle; context: { row: item }\"></ng-container>\n <desktop-cell class=\"d-block\" [column]=\"column\" [item]=\"item\" [cellDef]=\"_cellDef\"></desktop-cell>\n </span>\n } @else {\n <desktop-cell class=\"d-block px-8\" [column]=\"column\" [item]=\"item\" [cellDef]=\"_cellDef\"> </desktop-cell>\n }\n }\n </td>\n <td mat-footer-cell *matFooterCellDef [class.d-none]=\"column.type === 'children'\">\n <ng-container *ngIf=\"_footerDef[column.field]\">\n <ng-container *ngTemplateOutlet=\"_footerDef[column.field].templateRef; context: { items: _items, column: column }\">\n </ng-container>\n </ng-container>\n </td>\n </ng-container>\n }\n @for (column of _configuration.secondColumns; track column.field) {\n <ng-container [matColumnDef]=\"column.field\" [sticky]=\"_configuration.fixedColumn[column.field]\">\n <th\n mat-header-cell\n *matHeaderCellDef\n class=\"c-th px-8\"\n scope=\"col\"\n [style.width]=\"column.width\"\n [style.min-width]=\"column.minWidth || column.width\"\n [style.max-width]=\"column.maxWidth\"\n [attr.aria-sort]=\"_tableOption.sort?.enable && column.sortable ? getSortAria(column.field) : null\">\n <div>\n @if (_tableOption.sort?.enable && column.sortable) {\n <div\n [sdTableSortHeader]=\"column.field\"\n class=\"c-header-title\"\n [class.justify-content-end]=\"column.align === 'right'\"\n [class.text-right]=\"column.align === 'right'\">\n <column-title [column]=\"column\" [titleDef]=\"_titleDef[column.field]\"></column-title>\n </div>\n } @else {\n <div\n class=\"c-header-title\"\n [class.justify-content-end]=\"column.align === 'right'\"\n [class.text-right]=\"column.align === 'right'\">\n <column-title [column]=\"column\" [titleDef]=\"_titleDef[column.field]\"></column-title>\n </div>\n }\n </div>\n </th>\n <td\n class=\"c-td px-0\"\n mat-cell\n *matCellDef=\"let item\"\n [sdHoverCopy]=\"item[column.field]\"\n [sdHoverCopyDisabled]=\"!column.cell?.copiable\">\n @if (column.type !== 'children') {\n <desktop-cell class=\"d-block px-8\" [column]=\"column\" [item]=\"item\" [cellDef]=\"_cellDef\"> </desktop-cell>\n }\n </td>\n <td mat-footer-cell *matFooterCellDef>\n <ng-container *ngIf=\"_footerDef[column.field]\">\n <ng-container *ngTemplateOutlet=\"_footerDef[column.field].templateRef; context: { items: _items, column: column }\">\n </ng-container>\n </ng-container>\n </td>\n </ng-container>\n }\n <tr class=\"c-first-header\" mat-header-row *matHeaderRowDef=\"_configuration.firstHeaders; sticky: true\"></tr>\n @for (entry of _aggregateColumns; track entry.id) {\n <ng-container [matColumnDef]=\"entry.id\" [sticky]=\"entry.sticky\" [stickyEnd]=\"entry.stickyEnd\">\n <td\n mat-cell\n *matCellDef=\"let row\"\n class=\"sd-aggregate-cell px-8 py-8\"\n [class.d-none]=\"entry.hidden\"\n [style.text-align]=\"entry.column?.align\"\n [style.width]=\"entry.column?.width\"\n [style.min-width]=\"entry.column?.minWidth || entry.column?.width\">\n <ng-container\n *ngTemplateOutlet=\"\n aggregateCell;\n context: { $implicit: aggregateRenderHost.rows.get(row)?.cells?.get(entry.field) }\n \"></ng-container>\n </td>\n <td\n mat-footer-cell\n *matFooterCellDef\n class=\"sd-aggregate-cell px-8 py-8\"\n [class.d-none]=\"entry.hidden\"\n [style.text-align]=\"entry.column?.align\"\n [style.width]=\"entry.column?.width\"\n [style.min-width]=\"entry.column?.minWidth || entry.column?.width\">\n <ng-container\n *ngTemplateOutlet=\"aggregateCell; context: { $implicit: _aggregate.total?.cells?.get(entry.field) }\"></ng-container>\n </td>\n </ng-container>\n }\n <tr mat-row *matRowDef=\"let row; columns: _aggregateColumnIds; when: isAggregateRow\" class=\"sd-aggregate-row\"></tr>\n @if (!!_configuration.secondHeaders.length) {\n <tr class=\"c-second-header\" mat-header-row *matHeaderRowDef=\"_configuration.secondHeaders; sticky: true\"></tr>\n }\n @if (_configuration.multipleHeader) {\n @for (entry of _headerFilterColumns; track entry.id) {\n <ng-container [matColumnDef]=\"entry.id\" [sticky]=\"entry.sticky\" [stickyEnd]=\"entry.stickyEnd\">\n <th\n mat-header-cell\n *matHeaderCellDef\n class=\"c-th sd-filter-header\"\n [class.px-8]=\"!!entry.column\"\n [class.p-0]=\"!entry.column\"\n [class.sd-filler-cell]=\"entry.field === 'sdFiller'\"\n scope=\"col\">\n @if (_showInlineFilter && entry.column) {\n <ng-container *ngTemplateOutlet=\"inlineColumnFilter; context: { $implicit: entry.column }\"></ng-container>\n }\n </th>\n </ng-container>\n }\n <!-- why: gi\u1EEF row definition \u1ED5n \u0111\u1ECBnh; CDK c\u1EADp nh\u1EADt columns \u0111\u1EC3 b\u1ECF controls/sticky offsets khi \u1EA9n filter. -->\n <tr\n class=\"c-filter-header\"\n [style.display]=\"_showInlineFilter ? null : 'none'\"\n mat-header-row\n *matHeaderRowDef=\"_showInlineFilter ? headerFilterColumnIds() : []; sticky: _showInlineFilter\"></tr>\n }\n <!-- Group header row \u2014 ch\u1EC9 1 cell sdGroupHeader colspan to\u00E0n width. -->\n <tr mat-row *matRowDef=\"let row; columns: ['sdGroupHeader']; when: isGroupHeaderRow\" class=\"c-group-row-tr\"></tr>\n\n <!-- Data row \u2014 d\u00F9ng displayedColumns \u0111\u1EA7y \u0111\u1EE7; when isDataRow \u0111\u1EC3 lo\u1EA1i tr\u1EEB group header. -->\n <!-- why: [ngStyle] \u0111\u1ECDc meta.rowStyle \u2014 style.rowCss \u0111\u00E3 \u0111\u01B0\u1EE3c resolve 1 l\u1EA7n m\u1ED7i l\u1EA7n\n render. B\u1EA3n c\u0169 g\u1ECDi rowStyle(row) ngay trong binding \u2192 ch\u1EA1y callback c\u1EE7a consumer\n cho T\u1EEANG d\u00F2ng \u1EDF M\u1ED6I CD pass, v\u00E0 v\u00EC tr\u1EA3 object M\u1EDAI n\u00EAn NgStyle ph\u1EA3i ch\u1EA1y l\u1EA1i\n KeyValueDiffer tr\u00EAn m\u1ECDi d\u00F2ng \u1EDF m\u1ECDi pass. -->\n <tr\n mat-row\n cdkDrag\n [cdkDragData]=\"row\"\n [cdkDragDisabled]=\"\n !_tableOption.rowReorder?.enabled ||\n !!row.meta?.group?.items?.length ||\n (row.meta?.tree?.level ?? 0) > 0 ||\n isReorderDisabled(row)\n \"\n *matRowDef=\"let row; columns: _configuration.displayedColumns; when: isDataRow\"\n matRipple\n class=\"c-row\"\n [class.sd-tree-row]=\"!!_tableOption.tree\"\n [ngClass]=\"_tableOption.tree ? 'sd-tree-level-' + (row.meta?.tree?.level ?? 0) : null\"\n [ngStyle]=\"row.meta.rowStyle\"\n [class.selected]=\"row.meta.selector.isSelected\"></tr>\n\n <!-- Sub-information row \u2014 also gated b\u1EDFi isDataRow \u0111\u1EC3 KH\u00D4NG render empty expand row d\u01B0\u1EDBi group header. -->\n <tr mat-row *matRowDef=\"let row; columns: ['sdSubInformation']; when: isDataRow\" class=\"c-detail-row\"></tr>\n @if (_aggregate.total) {\n <tr mat-footer-row *sdTableFooterRowDef=\"_aggregateColumnIds; sticky: true\" class=\"sd-aggregate-total\"></tr>\n }\n @if (hasFooter() && !!_configuration.displayedFooters.length) {\n <tr mat-footer-row *sdTableFooterRowDef=\"_configuration.displayedFooters; sticky: true\"></tr>\n }\n <!-- why: khung x\u01B0\u01A1ng l\u00E0 d\u00F2ng th\u1EADt trong tbody (matNoDataRow ch\u1EC9 hi\u1EC7n khi kh\u00F4ng c\u00F3 d\u00F2ng d\u1EEF li\u1EC7u) n\u00EAn \u00F4 th\u1EB3ng\n c\u1ED9t v\u1EDBi header, k\u1EC3 c\u1EA3 header nh\u00F3m, m\u00E0 kh\u00F4ng ph\u1EA3i \u0111o; footer v\u1EABn n\u1EB1m d\u01B0\u1EDBi; dataSource kh\u00F4ng \u0111\u1ED5i. -->\n <ng-template matNoDataRow>\n @for (cells of skeleton(); track $index) {\n <tr class=\"sd-table-skeleton-row\" aria-hidden=\"true\">\n @for (cell of cells; track cell.field) {\n <td class=\"sd-table-skeleton-cell\" [class.d-none]=\"cell.hidden\">\n @if (cell.shape !== 'none') {\n <span\n class=\"sd-table-skeleton-bar\"\n [attr.data-shape]=\"cell.shape\"\n [attr.data-align]=\"cell.align\"\n [style.width]=\"cell.width\"\n [style.max-width]=\"cell.maxWidth\"></span>\n }\n </td>\n }\n </tr>\n }\n </ng-template>\n </table>\n }\n @let _readError = _readState.status === 'error';\n <!-- why: d\u00F2ng c\u0169 b\u1ECB g\u1EE1 khi l\u1EA7n \u0111\u1ECDc hi\u1EC7n h\u00E0nh l\u1ED7i, n\u00EAn v\u00F9ng l\u1ED7i/empty ch\u1EC9 hi\u1EC7n khi b\u1EA3ng kh\u00F4ng c\u00F2n d\u00F2ng n\u00E0o\n \u2014 end user kh\u00F4ng bao gi\u1EDD th\u1EA5y d\u1EEF li\u1EC7u v\u00E0 l\u1ED7i c\u00F9ng l\u00FAc (NSP-4877). -->\n @let _noRows = !_readError && !_loading && !_total && !_items.length && _loadingView === 'none';\n @if ((_readError && !_hideReadError) || (_noRows && _readState.status === 'empty' && !!_dataStateTemplate)) {\n <sd-data-state [state]=\"_readError ? 'error' : 'empty'\" [retryable]=\"_readError\" (sdRetry)=\"retryRead()\">\n @if (_dataStateTemplate; as custom) {\n <ng-template sdDataStateTemplate let-current let-retry=\"retry\" let-action=\"action\">\n <ng-container\n [ngTemplateOutlet]=\"custom.template\"\n [ngTemplateOutletContext]=\"{ $implicit: current, state: current, retry: retry, action: action }\"></ng-container>\n </ng-template>\n }\n </sd-data-state>\n } @else if (!_loading && loadError() && !_hideReadError) {\n <!-- why: b\u1EA3ng local l\u1ED7i d\u00F9ng c\u00F9ng giao di\u1EC7n l\u1ED7i v\u1EDBi b\u1EA3ng server (sd-data-state, role=\"alert\") v\u00E0 c\u00F9ng\n sdDataStateTemplate; th\u1EED l\u1EA1i = reload() v\u00EC local kh\u00F4ng c\u00F3 snapshot \u0111\u1ECDc \u0111\u1EC3 retryRead(). -->\n <sd-data-state state=\"error\" [retryable]=\"true\" (sdRetry)=\"reload()\">\n @if (_dataStateTemplate; as custom) {\n <ng-template sdDataStateTemplate let-current let-retry=\"retry\" let-action=\"action\">\n <ng-container\n [ngTemplateOutlet]=\"custom.template\"\n [ngTemplateOutletContext]=\"{ $implicit: current, state: current, retry: retry, action: action }\"></ng-container>\n </ng-template>\n }\n </sd-data-state>\n } @else if (_noRows && !loadError()) {\n <!-- why: empty m\u1EB7c \u0111\u1ECBnh gi\u1EEF 3 tr\u1EA1ng th\u00E1i (filter kh\u00F4ng c\u00F3 k\u1EBFt qu\u1EA3 / ch\u01B0a ch\u1ECDn filter b\u1EAFt bu\u1ED9c / ch\u01B0a c\u00F3 d\u1EEF li\u1EC7u)\n c\u00F9ng \u1EA3nh c\u1EA5u h\u00ECnh qua SD_TABLE_CONFIGURATION.images, cho c\u1EA3 b\u1EA3ng server (NSP-5551). Kh\u00F4ng c\u00F3 role live:\n v\u00F9ng .sd-table-live (lu\u00F4n c\u00F3 trong DOM) \u0111\u1ECDc ti\u00EAu \u0111\u1EC1 c\u1EE7a kh\u1ED1i n\u00E0y. -->\n <div class=\"c-no-data-row\">\n @if (_isFiltered) {\n @if (tableConfiguration?.images?.filterEmpty) {\n <img class=\"c-image\" [src]=\"tableConfiguration!.images!.filterEmpty\" alt=\"filter-empty\" />\n } @else {\n <img class=\"c-image sd-image-filter-empty\" alt=\"filter-empty\" />\n }\n <div class=\"T16M\">{{ 'core.component.table.no-results' | sdTranslate }}</div>\n <div class=\"T16R text-secondary\">{{ 'core.component.table.no-results-hint' | sdTranslate }}</div>\n } @else {\n @if (_requireFiltered) {\n @if (tableConfiguration?.images?.filterRequired) {\n <img class=\"c-image\" [src]=\"tableConfiguration!.images!.filterRequired\" alt=\"filter-required\" />\n } @else {\n <img class=\"c-image sd-image-filter-required\" alt=\"filter-required\" />\n }\n <div class=\"T16R text-secondary\">{{ 'core.component.table.choose-filter-hint' | sdTranslate }}</div>\n } @else {\n @if (tableConfiguration?.images?.dataEmpty) {\n <img class=\"c-image\" [src]=\"tableConfiguration!.images!.dataEmpty\" alt=\"data-empty\" />\n } @else {\n <img class=\"c-image sd-image-data-empty\" alt=\"data-empty\" />\n }\n <div class=\"T16R text-secondary\">{{ 'core.component.table.no-data' | sdTranslate }}</div>\n }\n }\n </div>\n }\n </div>\n @if (_loadingView === 'refresh' && !_mobileCards) {\n <!-- N\u1EB1m trong .c-container, kh\u00F4ng trong .c-table, \u0111\u1EC3 kh\u00F4ng cu\u1ED9n ngang theo b\u1EA3ng; top = --sd-table-head-h (\u0111o). -->\n <div class=\"sd-table-progress\" aria-hidden=\"true\"></div>\n }\n @if (!_mobileCards) {\n <selector-action\n [autoId]=\"_autoId\"\n [tableOption]=\"_tableOption\"\n [selectedTableItems]=\"_selectedTableItems\"\n (clear)=\"onClearSelection()\" />\n }\n <div class=\"c-paginator\">\n <div class=\"c-action\">\n @if (_mobileCards) {\n @let _tools = mobileToolsActions();\n @if (_tools.length) {\n <button\n mat-button\n type=\"button\"\n class=\"sd-mobile-tools-trigger\"\n aria-haspopup=\"dialog\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-mobile-tools' : null\"\n (click)=\"mobileTools.openMore()\">\n <sd-icon name=\"tune\"></sd-icon><span>{{ 'core.component.table.mobile.tools' | sdTranslate }}</span>\n </button>\n <sd-table-mobile-actions\n #mobileTools\n [actions]=\"_tools\"\n [autoOpen]=\"false\"\n [title]=\"'core.component.table.mobile.tools-title' | sdTranslate\"\n [autoId]=\"_autoId\"></sd-table-mobile-actions>\n }\n } @else {\n @if (_tableOption.reload?.visible) {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-reload' : null\"\n class=\"mr-8\"\n [title]=\"'core.component.table.reload' | sdTranslate\"\n prefixIcon=\"refresh\"\n (click)=\"reload()\"\n type=\"text\">\n </sd-button>\n }\n @if (_export && _items.length) {\n @if (_export.type === 'custom') {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-export' : null\"\n class=\"mr-8\"\n [title]=\"_exportTitle\"\n prefixIcon=\"get_app\"\n (click)=\"exportCustom()\"\n type=\"text\">\n </sd-button>\n } @else {\n @if (_export.visible) {\n @if (_exporting) {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-export' : null\"\n class=\"mr-8\"\n [loading]=\"_exporting\"\n [title]=\"_exportTitle\"\n prefixIcon=\"get_app\"\n type=\"text\">\n </sd-button>\n } @else {\n @if (_export.visible === 'ALL' || !_export.visible) {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-export' : null\"\n class=\"mr-8\"\n [title]=\"_exportTitle\"\n prefixIcon=\"get_app\"\n type=\"text\">\n <sd-button-item\n [autoId]=\"_autoId ? _autoId + '-export-excel' : null\"\n prefixIcon=\"file_download\"\n (click)=\"exportExcel()\"\n >{{ 'core.component.table.export-excel' | sdTranslate }}</sd-button-item\n >\n <sd-button-item\n [autoId]=\"_autoId ? _autoId + '-export-csv' : null\"\n prefixIcon=\"file_download\"\n (click)=\"exportCSV()\"\n >{{ 'core.component.table.export-csv' | sdTranslate }}</sd-button-item\n >\n </sd-button>\n } @else if (_export.visible === 'EXCEL') {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-export-excel' : null\"\n class=\"mr-8\"\n [title]=\"_exportTitle\"\n prefixIcon=\"get_app\"\n (click)=\"exportExcel()\"\n type=\"text\">\n </sd-button>\n } @else if (_export.visible === 'CSV') {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-export-csv' : null\"\n class=\"mr-8\"\n [title]=\"_exportTitle\"\n prefixIcon=\"get_app\"\n (click)=\"exportCSV()\"\n type=\"text\">\n </sd-button>\n }\n }\n }\n }\n }\n\n @if (_configComponent) {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-config' : null\"\n class=\"mr-8\"\n [title]=\"'core.component.table.setup-short' | sdTranslate\"\n prefixIcon=\"settings\"\n (click)=\"_configComponent.open()\"\n type=\"text\">\n </sd-button>\n }\n <!-- Mobile: n\u00FAt Filter m\u1EDF mobile-filter drawer (inline filter \u1EA9n tr\u00EAn mobile) -->\n @if (_isMobile) {\n @if (!_tableOption.filter?.disabled && _mobileFilter) {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-mobile-filter-open' : null\"\n class=\"mr-8\"\n prefixIcon=\"filter_alt\"\n [title]=\"_mobileCards ? ('core.component.table.filter' | sdTranslate) : undefined\"\n (click)=\"_mobileFilter.open()\"\n type=\"text\">\n </sd-button>\n }\n }\n }\n </div>\n @let _unknownTotalPager = unknownTotalPager();\n @if (_unknownTotalPager) {\n <!-- paginate.total 'unknown': no total exists, so mat-paginator (which derives Next/Last and the\n range from `length`) is replaced by a pager that renders only the rows actually shown. -->\n @if (!_tableOption.paginate?.hidden && unknownTotalPagerVisible()) {\n <sd-table-unknown-total-paginator\n [class.sd-mobile-paginator]=\"_mobileCards\"\n [state]=\"_unknownTotalPager\"\n [pageSizeOptions]=\"_tableOption.paginate?.pages\"\n [hidePageSize]=\"_isMobile || !!_tableOption.paginate?.hidePageSize\"\n [showFirstButton]=\"!_isMobile && !!_tableOption.paginate?.showFirstLastButtons\"\n [autoId]=\"_autoId\"\n (page)=\"onUnknownTotalPage($event)\"></sd-table-unknown-total-paginator>\n } @else if (!_isMobile && !_tableOption.paginate?.hidden && unknownTotalSingleCount()) {\n <div class=\"T14R c-summary\">\n {{ 'core.component.table.showing' | sdTranslate }} <span class=\"T14M ml-2\">1-{{ unknownTotalSingleCount() }}</span>\n </div>\n }\n } @else {\n @let hidePaginator = !_tableOption.paginate?.pageSize || _total === undefined || _total <= _tableOption.paginate?.pageSize!;\n <mat-paginator\n [class.sd-mobile-paginator]=\"_mobileCards\"\n [class.d-none]=\"_tableOption.paginate?.hidden || hidePaginator\"\n [length]=\"_total\"\n [pageSize]=\"_tableOption.paginate?.pageSize\"\n [pageSizeOptions]=\"_tableOption.paginate?.pages!\"\n [showFirstLastButtons]=\"!_isMobile && _tableOption.paginate?.showFirstLastButtons\"\n [hidePageSize]=\"_isMobile || _tableOption.paginate?.hidePageSize\"\n [selectConfig]=\"{ panelClass: ['sd-select-panel', 'sd-table-page-size-panel'] }\"></mat-paginator>\n <!-- \"\u0110ang hi\u1EC3n th\u1ECB...\" ch\u1EC9 desktop -->\n @if (!_isMobile) {\n @if (!_tableOption.paginate?.hidden && hidePaginator && _total !== undefined && _total > 0) {\n <div class=\"T14R c-summary\">\n {{ 'core.component.table.showing' | sdTranslate }} <span class=\"T14M ml-2\">1-{{ _total }}/{{ _total }}</span>\n </div>\n }\n }\n }\n </div>\n </div>\n </div>\n\n @if (_tableOption.config?.visible) {\n <config [autoId]=\"_autoId\" [tableOption]=\"_tableOption\" />\n }\n <!-- Mobile filter drawer \u2014 ch\u1EC9 instantiate khi c\u1EA7n render tr\u00EAn mobile -->\n @if (!_tableOption.filter?.disabled && filterRegister) {\n <mobile-filter\n [autoId]=\"_autoId\"\n [filter]=\"_tableOption.filter!\"\n [externalFilters]=\"_tableOption.filter?.externalFilters!\"\n [columns]=\"mobileColumns()\"\n [filterDefs]=\"sdFilterDefs()\"\n [filterRegister]=\"filterRegister\"\n [cacheValues]=\"cacheValues\">\n </mobile-filter>\n }\n} @else if (_readState.status === 'error' && !_hideReadError) {\n <!-- why: lookup c\u00F3 th\u1EC3 l\u1ED7i tr\u01B0\u1EDBc khi c\u00F3 configuration; v\u1EABn ph\u1EA3i c\u00F3 l\u1ED1i retry v\u00E0 custom error template. -->\n <sd-data-state state=\"error\" [retryable]=\"true\" (sdRetry)=\"retryRead()\">\n @if (_dataStateTemplate; as custom) {\n <ng-template sdDataStateTemplate let-current let-retry=\"retry\" let-action=\"action\">\n <ng-container\n [ngTemplateOutlet]=\"custom.template\"\n [ngTemplateOutletContext]=\"{ $implicit: current, state: current, retry: retry, action: action }\"></ng-container>\n </ng-template>\n }\n </sd-data-state>\n} @else if (_loadingView === 'skeleton') {\n <!-- why: lookup c\u1ED9t (values/lazy-values) c\u00F3 th\u1EC3 ch\u1EADm; ch\u01B0a c\u00F3 configuration n\u00EAn ch\u01B0a bi\u1EBFt c\u1ED9t, v\u1EBD khung x\u01B0\u01A1ng chung\n thay v\u00EC \u0111\u1EC3 tr\u1ED1ng. Hydrate kh\u00F4ng c\u00F3 lookup xong trong microtask n\u00EAn kh\u1ED1i n\u00E0y kh\u00F4ng k\u1ECBp hi\u1EC7n. -->\n <div class=\"sd-table-skeleton-block\" aria-hidden=\"true\">\n @for (cells of genericSkeleton; track $index) {\n <div class=\"sd-table-skeleton-block-row\">\n @for (cell of cells; track cell.field) {\n <span class=\"sd-table-skeleton-cell\">\n <span class=\"sd-table-skeleton-bar\" [style.width]=\"cell.width\" [style.max-width]=\"cell.maxWidth\"></span>\n </span>\n }\n </div>\n }\n </div>\n}\n", styles: [":host:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}:host{display:flex;flex-direction:column;overflow:auto;width:100%;height:100%;--mat-table-row-item-container-height: 36px}:host .sd-table-live{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}:host .c-header-title{height:40px;display:flex;align-items:center}:host .sd-table-surface{display:flex;flex:1;flex-direction:column;min-width:0;min-height:0;background:var(--sd-surface, #fff);border-radius:var(--sd-radius-6, 6px)}:host .c-container{position:relative;min-height:50px;display:flex;flex-direction:column;flex:1;isolation:isolate}:host .c-container .c-table{position:relative;flex:1;display:flex;flex-direction:column}:host .c-container .c-table table{border-collapse:separate;width:100%}:host .c-container .c-table table tr.c-first-header.mat-mdc-header-row{height:40px}:host .c-container .c-table table tr.c-second-header.mat-mdc-header-row{height:40px}:host .c-container .c-table table.sd-table-grouped-header th.c-th{vertical-align:middle;padding-block:4px}:host .c-container .c-table table.sd-table-grouped-header tr.c-first-header.mat-mdc-header-row{height:32px}:host .c-container .c-table table.sd-table-grouped-header tr.c-filter-header.mat-mdc-header-row{height:auto}:host .c-container .c-table table.sd-table-grouped-header th.sd-filter-header{padding-block:0 8px;vertical-align:bottom}:host .c-container .c-table table.sd-table-grouped-header column-filter{display:flex;align-items:center;min-height:36px}:host .c-container .c-table table.sd-table-grouped-header th.sd-column-group{padding-block:4px;vertical-align:middle;background-color:color-mix(in srgb,var(--sd-border, #c4c6d0) 18%,var(--sd-table-group-header-mix, #f2f3f4));box-shadow:inset 0 -1px var(--sd-border, #c4c6d0)}:host .c-container .c-table table.sd-table-grouped-header th.sd-column-group .sd-column-group-title{height:auto;min-height:24px;justify-content:center;text-align:center;font-weight:var(--sd-font-weight-semibold, 600)}:host .c-container .c-table table tr.c-detail-row{height:0}:host .c-container .c-table table tr.c-row.activated{background-color:var(--sd-table-row-activated-bg, #e5ecff)}:host .c-container .c-table table tr.c-row.selected{background-color:var(--sd-table-row-selected-bg, #eef2ff)}:host .c-container .c-table table tr.c-row:not(.selected):not(.activated):hover{background-color:var(--sd-table-row-hover-bg, #f5f5f5)}:host .c-container .c-table table tr.c-row td{border-bottom-width:0}:host .c-container .c-table table tr.c-row.c-expandable{cursor:pointer}:host .c-container .c-table table tr.c-row.c-expandable:hover{background:var(--sd-table-row-hover-bg, #f5f5f5)}:host .c-container .c-table table th.mat-mdc-header-cell{background-color:var(--sd-table-header-bg, #f2f3f4);border-bottom:0!important}:host .c-container .c-table table td.mat-mdc-cell,:host .c-container .c-table table td.mat-mdc-footer-cell,:host .c-container .c-table table th.mat-mdc-header-cell{border-bottom-color:var(--sd-table-row-divider, #f2f2f2)!important}:host .c-container .c-table .c-th{vertical-align:middle;padding-block:8px;font-weight:var(--sd-font-weight-medium, 500);font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px);color:var(--sd-table-header-text, #212121)}:host .c-container .c-table .c-th.sd-col-resize-host{position:relative}:host .c-container .c-table .c-th.sd-resizing{-webkit-user-select:none;user-select:none}:host .c-container .c-table .c-th .sd-col-resize-handle{position:absolute;top:0;right:0;width:6px;height:100%;cursor:col-resize;-webkit-user-select:none;user-select:none;z-index:2}:host .c-container .c-table .c-th .sd-col-resize-handle:hover{background:color-mix(in srgb,var(--sd-text) 8%,transparent)}:host .c-container .c-table .c-td:first{padding-left:10px}:host .c-container .c-table .c-no-data-row{flex:1;width:100%;position:sticky;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center}:host .c-container .c-table .c-no-data-row .c-image{margin-bottom:16px;width:96px}:host .c-container .c-paginator{display:flex;flex-direction:row;justify-content:space-between;align-items:center;background-color:var(--sd-table-bg, #ffffff)}:host .c-container .c-paginator .mat-mdc-paginator{background:transparent;--mat-paginator-container-size: 40px;--mat-icon-button-state-layer-size: 32px;--mdc-icon-button-state-layer-size: 32px;--mdc-icon-button-icon-size: 20px}:host .c-container .c-paginator .c-action{padding:0}:host .c-container .c-paginator .c-action sd-button{margin:8px 5px}:host .c-container .c-paginator .c-summary{padding:8px 16px}:host .c-container .c-empty{text-align:center;background-color:var(--sd-table-bg, #ffffff);border:none!important}:host .c-container .c-empty sd-icon{font-size:150px;margin-top:30px;margin-bottom:30px;opacity:.2;width:auto;height:auto}:host button.c-btn-add{background-color:var(--sd-table-bg, #ffffff);box-shadow:var(--sd-shadow-sm)}:host .sd-reorder-header,:host .sd-reorder-cell{width:40px;min-width:40px;padding:0 4px;box-sizing:border-box}:host .sd-reorder-cell sd-icon{cursor:grab;color:var(--sd-text-muted);display:flex;align-items:center}:host .sd-reorder-cell sd-icon:active{cursor:grabbing}:host .sd-reorder-cell sd-icon.sd-reorder-disabled{opacity:.3;cursor:not-allowed;pointer-events:none}:host ::ng-deep .sd-mobile-paginator .mat-mdc-paginator-range-label{margin-inline:4px;white-space:nowrap}:host .c-container:not(.sd-table-mobile)>.c-table{border-radius:6px 6px 0 0}:host .c-container:not(.sd-table-mobile)>.c-paginator{border-radius:0}:host .sd-mobile-command-header{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px;padding:4px}:host .c-container.sd-table-mobile .c-paginator{flex-wrap:wrap;gap:4px}:host .c-container.sd-table-mobile .c-action{display:flex;align-items:center;min-width:0}:host .c-container.sd-table-mobile .sd-mobile-tools-trigger{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px}:host .c-container.sd-table-mobile .sd-mobile-paginator{margin-inline-start:auto}:host .c-container.sd-table-mobile .c-paginator,:host .c-container.sd-table-mobile .c-empty{background-color:var(--sd-surface);color:var(--sd-text)}:host .c-container.sd-table-mobile .c-paginator{background-color:var(--sd-table-bg, #ffffff)}:host ::ng-deep .sd-table-mobile .c-paginator button{min-width:44px;min-height:44px}:host .c-container.sd-table-mobile .c-paginator .sd-mobile-paginator{--mat-icon-button-state-layer-size: 44px;--mdc-icon-button-state-layer-size: 44px}:host ::ng-deep .mat-select-arrow{color:var(--sd-table-select-arrow, #a6a6a6)}:host ::ng-deep .sd-table-sort-header{cursor:pointer;outline:none}:host ::ng-deep .sd-table-sort-header:focus-visible{border-bottom:solid 1px currentColor}:host ::ng-deep th[aria-sort] .sd-table-sort-header{position:relative;padding-right:24px}:host ::ng-deep th[aria-sort] .sd-table-sort-header:after{content:\"\";position:absolute;top:50%;right:0;width:16px;height:16px;transform:translateY(-50%);background-color:var(--sd-text-secondary);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-size:16px 16px;mask-size:16px 16px;pointer-events:none}:host ::ng-deep th[aria-sort=ascending] .sd-table-sort-header:after,:host ::ng-deep th[aria-sort=descending] .sd-table-sort-header:after{background-color:var(--sd-text)}:host ::ng-deep th[aria-sort=none] .sd-table-sort-header:after{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M12 5.83L15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9 12 5.83zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15 12 18.17z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M12 5.83L15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9 12 5.83zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15 12 18.17z'/%3E%3C/svg%3E\")}:host ::ng-deep th[aria-sort=ascending] .sd-table-sort-header:after{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z'/%3E%3C/svg%3E\")}:host ::ng-deep th[aria-sort=descending] .sd-table-sort-header:after{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z'/%3E%3C/svg%3E\")}:host ::ng-deep .c-paginator .mat-mdc-paginator-range-label{margin:0 4px}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size{align-items:center}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select{--mat-select-trigger-text-size: var(--sd-font-size-14, 14px);--mat-paginator-select-trigger-text-size: var(--sd-font-size-14, 14px)}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select .mat-mdc-form-field-infix{display:flex;align-items:center;height:32px;min-height:32px;padding-top:0;padding-bottom:0}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select.mat-mdc-form-field .mat-mdc-form-field-infix mat-select.mat-mdc-select{margin-top:0}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select .mat-mdc-text-field-wrapper{padding-right:8px}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select .mat-mdc-select-arrow-wrapper{width:20px;justify-content:center}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select .mat-mdc-select-arrow{width:16px;height:16px;color:var(--sd-text-secondary);background-color:currentColor;-webkit-mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z'/%3E%3C/svg%3E\") center/16px 16px no-repeat;mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z'/%3E%3C/svg%3E\") center/16px 16px no-repeat}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select .mat-mdc-select-arrow svg{display:none}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select .mat-mdc-form-field-flex:hover .mat-mdc-select-arrow{color:var(--sd-text)}::ng-deep .mat-mdc-select-panel.sd-select-panel.sd-table-page-size-panel .mat-mdc-option{min-height:36px;padding:7px 12px}:host ::ng-deep .cdk-drag-preview{box-shadow:var(--sd-shadow-md);background:var(--sd-table-bg);display:table;width:100%}:host ::ng-deep .cdk-drag-preview td{padding:0 8px;border-bottom:1px solid var(--sd-table-row-divider)}:host ::ng-deep .cdk-drag-placeholder{opacity:0}:host ::ng-deep .cdk-drop-list-dragging tr.c-row:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}:host ::ng-deep .sd-selection-cell{width:42px;min-width:42px;max-width:42px}:host ::ng-deep .sd-filler-cell{width:auto;min-width:0;padding:0!important;border:0}:host ::ng-deep .sd-group-header-cell{background:var(--sd-table-group-row-bg, #f5f7fc);border-top:1px solid var(--sd-table-group-row-border, #e6e9f2);border-bottom:1px solid var(--sd-table-group-row-border, #e6e9f2)}:host ::ng-deep .sd-group-row{min-height:36px}:host ::ng-deep .sd-group-selection-slot{width:42px;min-width:42px;max-width:42px}:host ::ng-deep .c-selection{transform:scale(.85);transform-origin:center}:host ::ng-deep .sd-tree-line{display:inline-flex;align-items:center;min-height:32px}:host ::ng-deep .sd-tree-indent{flex:0 0 auto}:host ::ng-deep .sd-tree-toggle-slot{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px}:host ::ng-deep .sd-tree-toggle-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;background:transparent;border-radius:50%;cursor:pointer;color:var(--sd-text-secondary, #5b6472);transition:background-color .15s ease}:host ::ng-deep .sd-tree-toggle-btn sd-icon{font-size:var(--sd-font-size-18, 18px);width:18px;height:18px;line-height:var(--sd-line-height-18, 18px)}:host ::ng-deep .sd-tree-toggle-btn:hover{background-color:color-mix(in srgb,var(--sd-text) 8%,transparent)}:host ::ng-deep .sd-tree-toggle-btn[aria-busy=true]{cursor:progress}:host ::ng-deep .sd-tree-stt{margin-left:2px;white-space:nowrap}:host ::ng-deep .sd-tree-index-cell{text-align:left!important;white-space:nowrap;padding-left:8px;padding-right:8px}:host ::ng-deep .sd-tree-index-header{padding-left:32px}:host ::ng-deep tr.c-row.sd-tree-row.sd-tree-level-0{background:var(--sd-table-tree-level-0-bg, #fbfcfe)}:host ::ng-deep tr.c-row.sd-tree-row.sd-tree-level-0>td{font-weight:var(--sd-font-weight-medium, 500)}:host ::ng-deep tr.c-row.sd-tree-row.sd-tree-level-1{background:var(--sd-table-tree-level-1-bg, #ffffff)}:host ::ng-deep tr.c-row.sd-tree-row.sd-tree-level-2{background:var(--sd-table-tree-level-2-bg, #fafbfd)}:host ::ng-deep tr.c-row.sd-tree-row.sd-tree-level-3{background:var(--sd-table-tree-level-3-bg, #f6f8fb)}:host ::ng-deep .sd-stt-root{font-weight:var(--sd-font-weight-bold, 700);color:var(--sd-table-tree-root-text, #1f2330)}:host ::ng-deep .sd-mobile-tools-trigger .mdc-button__label{display:inline-flex;align-items:center;gap:6px}:host .sd-table-surface--quick-search>.c-container:not(.sd-table-mobile)>.c-table{border-top-left-radius:0;border-top-right-radius:0}@keyframes sd-table-skeleton-sweep{to{background-position:480px 0}}@keyframes sd-table-progress-run{0%{transform:translate(-100%)}to{transform:translate(285.7142857143%)}}@keyframes sd-table-spin{to{transform:rotate(360deg)}}:host tr.sd-table-skeleton-row{height:var(--mat-table-row-item-container-height, 36px)}:host .sd-table-skeleton-cell{padding:0 8px;border-bottom:1px solid var(--sd-table-row-divider);vertical-align:middle}:host .sd-table-skeleton-bar{display:block;height:12px;border-radius:var(--sd-radius-4, 4px);background:linear-gradient(90deg,var(--sd-table-skeleton-bg) 0,var(--sd-table-skeleton-highlight) 40%,var(--sd-table-skeleton-bg) 80%) 0 0/480px 100%;animation:sd-table-skeleton-sweep 1.4s linear infinite}@media(prefers-reduced-motion:reduce){:host .sd-table-skeleton-bar{animation:none}}@media(forced-colors:active){:host .sd-table-skeleton-bar{forced-color-adjust:none;background:GrayText}}:host .sd-table-skeleton-bar[data-align=end]{margin-inline-start:auto}:host .sd-table-skeleton-bar[data-align=center]{margin-inline:auto}:host .sd-table-skeleton-bar[data-shape=pill]{height:20px;border-radius:999px}:host .sd-table-skeleton-bar[data-shape=box]{width:14px;height:14px;border-radius:3px}:host .sd-table-skeleton-block{overflow:hidden;border-radius:var(--sd-radius-6, 6px);background:var(--sd-surface)}:host .sd-table-skeleton-block-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:center;height:var(--mat-table-row-item-container-height, 36px);border-bottom:1px solid var(--sd-table-row-divider)}:host .sd-table-skeleton-block-row>.sd-table-skeleton-cell{border-bottom:0}:host .c-table>table>::ng-deep tbody{transition:opacity var(--sd-duration-fast, .12s)}@media(prefers-reduced-motion:reduce){:host .c-table>table>::ng-deep tbody{transition:none}}:host .c-table.c-table--dim{cursor:progress}:host .c-table.c-table--dim>table>::ng-deep thead,:host .c-table.c-table--dim>table>::ng-deep tfoot{cursor:auto}:host .c-table.c-table--dim>table>::ng-deep tbody{opacity:var(--sd-table-loading-dim, .55)}:host .c-table.c-table--dim>table>::ng-deep tbody,:host .c-table.c-table--dim>table>::ng-deep tbody *{pointer-events:none!important}:host .sd-table-progress{position:absolute;top:var(--sd-table-head-h, 0px);right:0;left:0;z-index:20;height:2px;overflow:hidden;pointer-events:none;background:var(--sd-table-progress-track)}:host .sd-table-progress:before{content:\"\";position:absolute;inset:0 auto 0 0;width:35%;background:var(--sd-table-spinner);animation:sd-table-progress-run 1.1s ease-in-out infinite}@media(prefers-reduced-motion:reduce){:host .sd-table-progress:before{width:100%;opacity:.6;animation:none}}@media(forced-colors:active){:host .sd-table-progress{forced-color-adjust:none;box-sizing:content-box;border:1px solid CanvasText;background:Canvas}:host .sd-table-progress:before{background:Highlight}}:host .sd-table-spinner{display:inline-block;flex:0 0 auto;vertical-align:middle;box-sizing:border-box;width:16px;height:16px;border:2px solid var(--sd-table-progress-track);border-top-color:var(--sd-table-spinner);border-radius:50%;animation:sd-table-spin .8s linear infinite}@media(prefers-reduced-motion:reduce){:host .sd-table-spinner{animation:none}}@media(forced-colors:active){:host .sd-table-spinner{forced-color-adjust:none;border-color:GrayText;border-top-color:Highlight}}:host .sd-table-progress-anchor{position:sticky;top:0;z-index:20;height:0}:host .sd-table-progress-anchor>.sd-table-progress{top:0}.sd-aggregate-row,.sd-aggregate-total,.sd-mobile-aggregate{background:color-mix(in srgb,var(--sd-surface-muted) 35%,var(--sd-surface));color:var(--sd-text);font-weight:var(--sd-font-weight-medium, 500)}.sd-aggregate-cell{background:inherit;border-top:1px solid var(--sd-border)}:host(.sd-table--fill){flex:1 1 0;height:auto;min-height:var(--sd-table-fill-min, 0px);overflow:visible}:host(.sd-table--fill) .c-container{min-height:0}:host(.sd-table--fill) .c-container>.c-table{min-height:calc(var(--sd-table-fill-head, 40px) + 5 * var(--mat-table-row-item-container-height, 36px))}:host(.sd-table--fill) .c-container>.c-paginator{flex:none;min-height:48px}\n", ":host ::ng-deep .sticky-shadow-right{overflow:visible!important}:host ::ng-deep .sticky-shadow-right:after{content:\"\";position:absolute;top:0;right:0;bottom:0;width:8px;transform:translate(100%);background:linear-gradient(to right,rgba(0,0,0,.12),transparent);pointer-events:none}:host ::ng-deep .sticky-shadow-left{overflow:visible!important}:host ::ng-deep .sticky-shadow-left:after{content:\"\";position:absolute;top:0;left:0;bottom:0;width:8px;transform:translate(-100%);background:linear-gradient(to left,rgba(0,0,0,.12),transparent);pointer-events:none}\n"] }]
|
|
7551
|
-
}], ctorParameters: () => [], propDecorators: { autoIdInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], option: [{ type: i0.Input, args: [{ isSignal: true, alias: "option", required: true }] }], hideReadError: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideReadError", required: false }] }], sdReadStateChange: [{ type: i0.Output, args: ["sdReadStateChange"] }], dataStateTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdDataStateTemplateDirective), { isSignal: true }] }], table: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatTable), { isSignal: true }] }], configComponent: [{ type: i0.ViewChild, args: [i0.forwardRef(() => ConfigComponent), { isSignal: true }] }], sdPopupExport: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdPopupExport), { isSignal: true }] }], scroll: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdScrollDirective), { isSignal: true }] }], quickAction: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdQuickAction), { isSignal: true }] }], externalFilter: [{ type: i0.ViewChild, args: [i0.forwardRef(() => ExternalFilterComponent), { isSignal: true }] }], mobileFilter: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MobileFilterComponent), { isSignal: true }] }], paginator: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatPaginator), { isSignal: true }] }], sort: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatSort), { isSignal: true }] }], sdSubInformation: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdTableExpandDefDirective), { isSignal: true }] }], sdGroupDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdTableGroupDefDirective), { isSignal: true }] }], sdCellDefs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SdTableCellDefDirective), { isSignal: true }] }], sdCommandHeaderDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdTableCommandHeaderDefDirective), { isSignal: true }] }], sdQuickSearchRightDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdTableQuickSearchRightDefDirective), { isSignal: true }] }], sdFooterDefs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SdMaterialFooterDefDirective), { isSignal: true }] }], sdFilterDefs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SdTableFilterDefDirective), { isSignal: true }] }], sdTitleDefs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SdTableTitleDefDirective), { isSignal: true }] }], sdRowMobileDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdTableRowMobileDefDirective), { ...{ descendants: false }, isSignal: true }] }], quickSearchControl: [{ type: i0.ViewChild, args: [i0.forwardRef(() => TableQuickSearchComponent), { isSignal: true }] }] } });
|
|
8694
|
+
], template: "@let _visibleSelectAll = visibleSelectAll();\n@let _isSelectIndeterminate = isSelectIndeterminate();\n@let _isSelectAll = isSelectAll();\n@let _configuration = configuration();\n@let _tableOption = tableOption()!;\n@let _loading = loading();\n@let _loadingView = loadingView();\n@let _readState = readState();\n@let _hideReadError = hideReadError();\n@let _dataStateTemplate = dataStateTemplate();\n@let _items = items();\n@let _total = total();\n@let _isFiltered = isFiltered();\n@let _requireFiltered = requireFiltered();\n@let _export = _tableOption?.export;\n@let _exporting = exporting();\n@let _titleDef = titleDef();\n@let _autoId = autoId();\n@let _exportTitle = exportTitle();\n@let _cellDef = cellDef();\n@let _footerDef = footerDef();\n@let _sdSubInformation = sdSubInformation();\n@let _configComponent = configComponent();\n@let _mobileFilter = mobileFilter();\n@let _selectedTableItems = selectedTableItems();\n@let _rowCommands = rowCommands();\n@let _mobileCards = mobileCards();\n@let _isMobile = isMobile();\n@let _queryBarMode = queryBarMode();\n@let _queryBarKeys = queryBarModel()?.columnKeys;\n@let _queryBarActive = queryBarActiveKeys();\n@let _showInlineFilter =\n !_queryBarMode &&\n !_isMobile &&\n !_tableOption?.filter?.disabled &&\n _tableOption?.filter?.hideInlineFilter !== true &&\n !(_tableOption?.filter?.hideInlineFilter === 'auto' && !_isFiltered && knownRowCount()! <= 10);\n@let _commandHeaderDef = sdCommandHeaderDef();\n@let _quickSearch = quickSearchOption();\n@let _aggregate = aggregateSnapshot();\n@let _aggregateColumns = aggregateColumns();\n@let _aggregateColumnIds = aggregateColumnIds();\n@let _headerFilterColumns = headerFilterColumns();\n<!-- why: tree kh\u00F4ng c\u00F2n c\u1ED9t ri\u00EAng \u2014 khi KH\u00D4NG c\u00F3 c\u1ED9t Index, icon expand nh\u00FAng v\u00E0o\n c\u1ED9t data \u0111\u1EA7u ti\u00EAn. \u0110\u00E2y l\u00E0 field c\u1EE7a c\u1ED9t \u0111\u00F3 (null n\u1EBFu c\u00F3 Index ho\u1EB7c kh\u00F4ng tree). -->\n@let _treeFirstField = _tableOption?.tree && !_tableOption.index?.enabled ? _configuration?.firstColumns?.[0]?.field : null;\n\n<!-- why: v\u00F9ng status lu\u00F4n c\u00F3 trong DOM, k\u1EC3 c\u1EA3 tr\u01B0\u1EDBc khi c\u00F3 configuration. V\u00F9ng ch\u1EC9 render trong l\u00FAc t\u1EA3i b\u1ECB g\u1EE1\n tr\u01B0\u1EDBc khi screen reader k\u1ECBp \u0111\u1ECDc v\u00E0 kh\u00F4ng b\u00E1o \u0111\u01B0\u1EE3c \"\u0111\u00E3 t\u1EA3i xong\". -->\n<span class=\"sd-table-live\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">{{ liveMessage() }}</span>\n@if (_configuration) {\n @if (!_queryBarMode && !_mobileCards && !_tableOption.filter?.disabled && !!_tableOption.filter?.externalFilters?.length && filterRegister) {\n <external-filter\n class=\"mb-16\"\n [autoId]=\"_autoId\"\n [filterRegister]=\"filterRegister\"\n [filter]=\"_tableOption.filter!\"\n [externalFilters]=\"_tableOption.filter?.externalFilters!\"\n [collapsedByDefault]=\"externalFilterCollapsedByDefault()\">\n </external-filter>\n }\n @let groupedItems = _items | sdTree: _tableOption.tree : treeRevision() | sdGroup: _tableOption : groupExpandState : groupHost;\n @let renderItems = groupedItems | sdAggregateRows: _aggregate : _tableOption : aggregateRenderHost;\n\n <ng-template #aggregateCell let-cell>\n @if (cell) {\n @if (cell.templateRef) {\n <ng-container *ngTemplateOutlet=\"cell.templateRef; context: cell.context\"></ng-container>\n } @else {\n <span [attr.data-complete]=\"cell.context.isComplete\">{{ cell.text }}</span>\n }\n }\n </ng-template>\n <ng-template #inlineColumnFilter let-column>\n <column-filter\n [autoId]=\"_autoId\"\n [value]=\"columnFilter?.[column.field!]!\"\n [operator]=\"columnOperator[column.field]\"\n (operatorChange)=\"columnOperator[column.field] = $event!; onOperatorChange(column, $event)\"\n [columnFilter]=\"columnFilter!\"\n [cacheValues]=\"cacheValues\"\n [column]=\"column\"\n (filterChange)=\"onFilterChange()\"\n (filterCommit)=\"onFilterCommit()\">\n </column-filter>\n </ng-template>\n <!-- Icon l\u1ECDc \u1EDF header c\u1ED9t (mode query-bar): m\u1EDF chip c\u1EE7a field tr\u00EAn thanh. why: n\u1EB1m c\u1EA1nh .c-header-title ch\u1EE9 kh\u00F4ng\n n\u1EB1m trong \u2014 title sort \u0111\u01B0\u1EE3c l\u00E0 role=button v\u00E0 b\u1EAFt Enter, l\u1ED3ng button v\u00E0o s\u1EBD th\u00E0nh nested-interactive v\u00E0 Enter\n tr\u00EAn icon s\u1EBD sort. Ch\u1EB7n mousedown/click \u0111\u1EC3 kh\u00F4ng sort, kh\u00F4ng b\u1EAFt \u0111\u1EA7u k\u00E9o c\u1ED9t. -->\n <ng-template #queryBarTrigger let-column>\n @let _triggerKey = _queryBarKeys?.get(column.field);\n @if (_triggerKey) {\n @let _triggerActive = _queryBarActive.has(_triggerKey);\n <button\n type=\"button\"\n class=\"sd-table-filter-trigger\"\n [class.sd-table-filter-trigger--active]=\"_triggerActive\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-filter-trigger-' + column.field : null\"\n [attr.aria-label]=\"filterTriggerLabel(column, _triggerActive)\"\n aria-haspopup=\"menu\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"$event.stopPropagation(); openQueryBarField(_triggerKey, $event.currentTarget)\">\n <sd-icon name=\"filter_alt\" aria-hidden=\"true\"></sd-icon>\n </button>\n }\n </ng-template>\n <ng-template #mobileAggregate let-summary=\"summary\">\n <div class=\"sd-mobile-aggregate p-12\" role=\"region\" [attr.aria-label]=\"'core.component.table.mobile.summary' | sdTranslate\">\n @for (entry of _aggregateColumns; track entry.field) {\n @let cell = summary.cells.get(entry.field);\n @if (cell && entry.column) {\n <div class=\"d-flex align-items-center flex-wrap gap-8 py-8\">\n <column-title [column]=\"entry.column\" [titleDef]=\"_titleDef[entry.field]\"></column-title>\n <ng-container *ngTemplateOutlet=\"aggregateCell; context: { $implicit: cell }\"></ng-container>\n </div>\n }\n }\n </div>\n </ng-template>\n\n <!-- Tree toggle d\u00F9ng chung: indent (theo c\u1EA5p) + slot chevron/spinner. Nh\u00FAng v\u00E0o\n c\u1ED9t Index ho\u1EB7c c\u1ED9t data \u0111\u1EA7u qua *ngTemplateOutlet (context: { row }). -->\n <ng-template #sdTreeToggle let-row=\"row\">\n @let _tree = row?.meta?.tree;\n @if (_tree) {\n <span class=\"sd-tree-indent\" [style.width.px]=\"(_tree.level ?? 0) * (_tableOption.tree?.indentSize ?? 20)\"></span>\n <span class=\"sd-tree-toggle-slot\">\n @if (_tree.hasChildren) {\n @let _aid = _autoId;\n @let _expanding = !!_tree.isExpanding;\n <!-- why: n\u00FAt lu\u00F4n n\u1EB1m trong DOM, ch\u1EC9 \u0111\u1ED5i icon th\u00E0nh spinner khi \u0111ang t\u1EA3i con; g\u1EE1 n\u00FAt l\u00E0m focus b\u00E0n ph\u00EDm r\u01A1i\n v\u1EC1 body. Click trong l\u00FAc t\u1EA3i b\u1ECB onTreeToggle b\u1ECF qua. -->\n <button\n type=\"button\"\n class=\"sd-tree-toggle-btn\"\n [attr.data-autoid]=\"_aid ? _aid + '-tree-toggle-' + row.meta.id : null\"\n [attr.aria-label]=\"'core.component.table.tree-toggle' | sdTranslate\"\n [attr.aria-expanded]=\"!!_tree.isExpanded\"\n [attr.aria-busy]=\"_expanding ? 'true' : null\"\n [attr.aria-disabled]=\"_expanding ? 'true' : null\"\n (click)=\"onTreeToggle(row); $event.stopPropagation()\">\n @if (_expanding) {\n <span class=\"sd-table-spinner\" aria-hidden=\"true\"></span>\n } @else {\n <sd-icon [name]=\"_tree.isExpanded ? 'expand_more' : 'chevron_right'\"></sd-icon>\n }\n </button>\n }\n </span>\n }\n </ng-template>\n\n <ng-template #sdGroupHeader let-item=\"item\">\n <div class=\"sd-group-row d-flex align-items-center py-8\">\n @if (_tableOption.selector?.visible && !_tableOption.selector?.single) {\n <div class=\"sd-group-selection-slot d-flex align-items-center justify-content-center\">\n <mat-checkbox\n class=\"c-selection\"\n color=\"primary\"\n [checked]=\"isGroupAllSelected(item)\"\n [indeterminate]=\"isGroupIndeterminate(item)\"\n (change)=\"onSelectGroup(item, $event.checked)\">\n </mat-checkbox>\n </div>\n } @else {\n <div class=\"sd-group-selection-slot\"></div>\n }\n @if (_tableOption.group?.collapsible) {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-group-toggle-' + (item.meta.group?.key || item.meta.id) : null\"\n type=\"text\"\n [prefixIcon]=\"item.meta.group.isExpanded ? 'expand_more' : 'chevron_right'\"\n width=\"32px\"\n (click)=\"toggleGroupExpand(item)\">\n </sd-button>\n }\n @if (sdGroupDef()?.templateRef; as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl; context: groupContext(item)\"></ng-container>\n } @else {\n <span class=\"T14R\">{{ item.meta.group.values | json }}</span>\n }\n </div>\n </ng-template>\n\n <ng-content select=\"[sdTableTop]\"></ng-content>\n @let _queryBarOption = queryBarOption();\n <div\n class=\"sd-table-surface\"\n [class.sd-table-surface--quick-search]=\"!!_quickSearch && !_queryBarMode\"\n [class.sd-table-surface--query-bar]=\"_queryBarMode && !!_queryBarOption\">\n @if (_queryBarMode) {\n <!-- why: thanh n\u1EB1m tr\u00EAn .c-container, ngo\u00E0i l\u1EDBp loading (l\u00E0m m\u1EDD .c-table) \u2014 lu\u00F4n b\u1EA5m \u0111\u01B0\u1EE3c khi \u0111ang t\u1EA3i. -->\n @if (_queryBarOption) {\n @let _queryBarHint = queryBarHint();\n <sd-query-bar\n class=\"sd-table-query-bar\"\n role=\"search\"\n [attr.aria-label]=\"'core.component.table.filter' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-query-bar' : null\"\n [option]=\"_queryBarOption\"\n [(filters)]=\"barFilters\"\n [(search)]=\"barSearch\"\n (apply)=\"onQueryBarApply($event)\">\n @if (sdQuickSearchRightDef(); as _right) {\n <div sdQueryBarEnd class=\"sd-table-query-bar-end\"><ng-container [ngTemplateOutlet]=\"_right.templateRef\" /></div>\n }\n </sd-query-bar>\n @if (_queryBarHint) {\n <p class=\"sd-table-query-bar-hint\" [id]=\"queryBarHintId\">\n <sd-icon name=\"error_outline\" aria-hidden=\"true\"></sd-icon>\n <span>{{ _queryBarHint }}</span>\n </p>\n }\n }\n } @else if (_quickSearch) {\n <sd-table-quick-search\n [option]=\"_quickSearch\"\n [value]=\"quickSearchValue()\"\n [autoId]=\"_autoId\"\n [rightTemplate]=\"sdQuickSearchRightDef()?.templateRef\"\n (valueChange)=\"onQuickSearchChange($event)\" />\n }\n <div class=\"c-container\" [class.sd-table-mobile]=\"_mobileCards\">\n <!-- why: l\u1EDBp loading kh\u00F4ng ph\u1EE7 l\u00EAn b\u1EA3ng: header, filter, sort v\u00E0 thanh cu\u1ED9n lu\u00F4n d\u00F9ng \u0111\u01B0\u1EE3c. Ch\u01B0a c\u00F3 d\u00F2ng th\u00EC\n khung x\u01B0\u01A1ng (matNoDataRow); \u0111\u00E3 c\u00F3 d\u00F2ng th\u00EC gi\u1EEF d\u00F2ng c\u0169, qu\u00E1 showDelay m\u1EDBi l\u00E0m m\u1EDD d\u00F2ng v\u00E0 hi\u1EC7n thanh ti\u1EBFn\n tr\u00ECnh. aria-busy v\u1EABn theo loading() th\u1EADt; v\u00F9ng .sd-table-live b\u00E1o \"\u0111ang t\u1EA3i\"/\"\u0111\u00E3 t\u1EA3i xong\". -->\n <div\n class=\"c-table\"\n sdScroll\n stickyShadow\n matSort\n [matSortDisabled]=\"!_tableOption.sort?.enable\"\n [class.c-table--dim]=\"_loadingView === 'refresh' && loadingSettings().dim\"\n [attr.aria-busy]=\"_loading ? 'true' : null\"\n [style.max-height]=\"_tableOption.style?.maxHeight\"\n [style.min-height]=\"_tableOption.style?.minHeight\">\n @if (_mobileCards) {\n @if (_commandHeaderDef) {\n <div class=\"sd-mobile-command-header\"><ng-container *ngTemplateOutlet=\"_commandHeaderDef.templateRef\"></ng-container></div>\n }\n @if (_loadingView === 'refresh') {\n <!-- Mobile: kh\u00F4ng c\u00F3 header b\u1EA3ng; thanh n\u1EB1m \u1EDF m\u00E9p tr\u00EAn danh s\u00E1ch th\u1EBB, d\u01B0\u1EDBi command header. Anchor cao 0\n n\u00EAn thanh hi\u1EC7n/\u1EA9n kh\u00F4ng \u0111\u1EA9y th\u1EBB. -->\n <div class=\"sd-table-progress-anchor\">\n <div class=\"sd-table-progress\" aria-hidden=\"true\"></div>\n </div>\n }\n <sd-table-mobile-cards\n [table]=\"this\"\n [rows]=\"renderItems\"\n [dataRows]=\"groupedItems\"\n [groupTemplate]=\"sdGroupHeader\"\n [aggregateTemplate]=\"mobileAggregate\"></sd-table-mobile-cards>\n @if (_aggregate.total; as summary) {\n <ng-container *ngTemplateOutlet=\"mobileAggregate; context: { summary: summary }\"></ng-container>\n }\n @if (hasFooter()) {\n <div class=\"sd-mobile-footer p-12\" role=\"region\" [attr.aria-label]=\"'core.component.table.mobile.summary' | sdTranslate\">\n @for (column of mobileFooterColumns(); track column.field) {\n <div class=\"d-flex align-items-center flex-wrap gap-8 py-8\">\n <column-title [column]=\"column\" [titleDef]=\"_titleDef[column.field]\"></column-title>\n <ng-container\n *ngTemplateOutlet=\"_footerDef[column.field].templateRef; context: { items: _items, column: column }\"></ng-container>\n </div>\n }\n </div>\n }\n } @else {\n <table\n mat-table\n [class.sd-table-grouped-header]=\"_configuration.multipleHeader\"\n sdAggregateLayout\n [dataSource]=\"renderItems\"\n [trackBy]=\"trackBy\"\n multiTemplateDataRows\n cdkDropList\n [cdkDropListData]=\"groupedItems\"\n [cdkDropListDisabled]=\"!_tableOption.rowReorder?.enabled\"\n [cdkDropListSortPredicate]=\"reorderSortPredicate\"\n (cdkDropListDropped)=\"onReorderDrop($event)\">\n @if (_tableOption.rowReorder?.enabled) {\n <ng-container matColumnDef=\"sdReorder\">\n <th mat-header-cell *matHeaderCellDef class=\"sd-reorder-header\" [attr.rowspan]=\"_configuration.multipleHeader ? 2 : 1\"></th>\n <td mat-cell *matCellDef=\"let row\" class=\"sd-reorder-cell\">\n @if (!row.meta?.group?.items?.length) {\n <sd-icon\n cdkDragHandle\n [class.sd-reorder-disabled]=\"isReorderDisabled(row)\"\n [name]=\"_tableOption.rowReorder?.icon || 'drag_indicator'\"></sd-icon>\n }\n </td>\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n }\n\n <ng-container matColumnDef=\"sdSubInformation\" sticky>\n <td class=\"p-0\" mat-cell *matCellDef=\"let item\" [attr.colspan]=\"_configuration.displayedColumns.length\">\n @if (_sdSubInformation?.templateRef) {\n @if (_tableOption.expand?.always) {\n <ng-container *ngTemplateOutlet=\"_sdSubInformation?.templateRef!; context: { item: item }\"> </ng-container>\n } @else {\n <div [@detailExpand]=\"item.meta.expand?.isExpanded ? 'expanded' : 'collapsed'\">\n @if (item.meta.expand?.isExpanded) {\n <ng-container *ngTemplateOutlet=\"_sdSubInformation?.templateRef!; context: { item: item }\"> </ng-container>\n }\n </div>\n }\n }\n </td>\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n\n <ng-container matColumnDef=\"sdSubInformationAction\" stickyEnd>\n <th\n class=\"p-0\"\n mat-header-cell\n *matHeaderCellDef\n style=\"width: 1px\"\n [attr.rowspan]=\"_configuration.multipleHeader ? 2 : 1\"></th>\n <td mat-cell *matCellDef=\"let element\">\n @if (!_tableOption.expand?.always) {\n @let _expanding = !!element.meta.expand?.isExpanding;\n <!-- why: n\u00FAt 35px gi\u1EEF nguy\u00EAn khi \u0111ang t\u1EA3i ([loading] thay prefix icon b\u1EB1ng spinner) \u0111\u1EC3 focus b\u00E0n ph\u00EDm\n kh\u00F4ng m\u1EA5t; onExpand b\u1ECF qua click trong l\u00FAc t\u1EA3i. color primary ch\u1EC9 \u0111\u1EC3 spinner theo m\u00E0u nh\u1EA5n. -->\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-expand-' + element.meta.id : null\"\n type=\"text\"\n [color]=\"_expanding ? 'primary' : null\"\n [loading]=\"_expanding\"\n [attr.aria-busy]=\"_expanding ? 'true' : null\"\n [prefixIcon]=\"element.meta.expand?.isExpanded ? 'expand_less' : 'expand_more'\"\n (click)=\"onExpand(element)\"\n width=\"35px\">\n </sd-button>\n }\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"sdSelection\" sticky>\n <th class=\"sd-selection-cell p-0\" mat-header-cell *matHeaderCellDef [attr.rowspan]=\"_configuration.multipleHeader ? 2 : 1\">\n @if (_visibleSelectAll) {\n <mat-checkbox\n class=\"c-selection px-8\"\n color=\"primary\"\n [indeterminate]=\"_isSelectIndeterminate\"\n [ngModel]=\"_isSelectAll\"\n (ngModelChange)=\"isSelectAll.set($event)\"\n (change)=\"onSelectAll()\">\n </mat-checkbox>\n }\n </th>\n\n <td class=\"sd-selection-cell p-0\" mat-cell *matCellDef=\"let item\">\n @let visible = item.meta.selector?.visible;\n @if (visible) {\n @if (_tableOption.selector?.single) {\n <mat-radio-button\n class=\"c-selection px-8\"\n color=\"primary\"\n [checked]=\"item.meta.selector.isSelected\"\n (change)=\"item.meta.selector.isSelected = true; onSelect(item)\"\n [disabled]=\"item.meta.selector?.disabled\">\n </mat-radio-button>\n } @else {\n <mat-checkbox\n class=\"c-selection px-8\"\n color=\"primary\"\n [(ngModel)]=\"item.meta.selector.isSelected\"\n (change)=\"onSelect(item)\"\n [disabled]=\"item.meta.selector?.disabled\">\n </mat-checkbox>\n }\n }\n </td>\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n @if (_tableOption.index?.enabled) {\n @let _pageOffset = pageOffset();\n @let _indexWidth = _tableOption.index?.width || '50px';\n <!-- why: khi tree, c\u1ED9t Index \"\u00F4m\" th\u00EAm chevron + indent. D\u00F9ng width:1px +\n nowrap (.sd-tree-index-cell) \u0111\u1EC3 c\u1ED9t co S\u00C1T n\u1ED9i dung, kh\u00F4ng chi\u1EBFm ch\u1ED7\n th\u1EEBa; header \"#\" canh tr\u00E1i l\u00F9i v\u00E0o (.sd-tree-index-header) cho th\u1EB3ng s\u1ED1. -->\n @let _treeIndex = !!_tableOption.tree;\n <ng-container matColumnDef=\"sdIndex\" sticky>\n <th\n [class.p-0]=\"!_treeIndex\"\n [class.text-center]=\"!_treeIndex\"\n [class.sd-tree-index-cell]=\"_treeIndex\"\n [class.sd-tree-index-header]=\"_treeIndex\"\n mat-header-cell\n *matHeaderCellDef\n [style.width]=\"_treeIndex ? '1px' : _indexWidth\"\n [style.min-width]=\"_treeIndex ? null : _indexWidth\"\n [style.max-width]=\"_treeIndex ? null : _indexWidth\"\n [attr.rowspan]=\"_configuration.multipleHeader ? 2 : 1\">\n {{ _tableOption.index?.title || '#' }}\n </th>\n <td\n [class.px-4]=\"!_treeIndex\"\n [class.text-center]=\"!_treeIndex\"\n [class.sd-tree-index-cell]=\"_treeIndex\"\n mat-cell\n *matCellDef=\"let item; let i = dataIndex\"\n [style.width]=\"_treeIndex ? '1px' : null\"\n [style.min-width]=\"_treeIndex ? null : _indexWidth\"\n [style.max-width]=\"_treeIndex ? null : _indexWidth\">\n @if (!item?.meta?.group?.isGroupHeader) {\n @if (_treeIndex) {\n <!-- why: tree \u2192 chevron + indent + STT ph\u00E2n c\u1EA5p (1, 1.2, 1.2.1). T\u00F4 \u0111\u1EADm root (level 0). -->\n <span class=\"sd-tree-line\">\n <ng-container *ngTemplateOutlet=\"sdTreeToggle; context: { row: item }\"></ng-container>\n @if (item?.meta?.tree?.indexPath?.length) {\n <span class=\"sd-tree-stt\" [class.sd-stt-root]=\"(item.meta.tree.level ?? 0) === 0\">\n {{ item.meta.tree.indexPath.join('.') }}\n </span>\n }\n </span>\n } @else {\n {{ _pageOffset + (aggregateRenderHost.indices.get(item) ?? i) + 1 }}\n }\n }\n </td>\n <td\n mat-footer-cell\n *matFooterCellDef\n [style.width]=\"_treeIndex ? '1px' : null\"\n [style.min-width]=\"_treeIndex ? null : _indexWidth\"\n [style.max-width]=\"_treeIndex ? null : _indexWidth\"></td>\n </ng-container>\n }\n <ng-container\n matColumnDef=\"sdCommand\"\n [sticky]=\"_tableOption.command?.align !== 'right'\"\n [stickyEnd]=\"_tableOption.command?.align === 'right'\">\n <!-- why: \u00F4 header c\u1EE7a c\u1ED9t command v\u1ED1n \u0111\u1EC3 tr\u1ED1ng. Cho consumer chi\u1EBFm ch\u1ED7 \u0111\u00F3 b\u1EB1ng\n `sdTableCommandHeaderDef` (th\u01B0\u1EDDng l\u00E0 n\u00FAt th\u00EAm d\u00F2ng) th\u00EC h\u00E0nh \u0111\u1ED9ng c\u1EA5p b\u1EA3ng n\u1EB1m ngay\n tr\u00EAn c\u1EE5m n\u00FAt c\u1EE7a t\u1EEBng d\u00F2ng, thay v\u00EC ph\u1EA3i d\u1EF1ng th\u00EAm m\u1ED9t d\u1EA3i ri\u00EAng d\u01B0\u1EDBi b\u1EA3ng. -->\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 50px\" [attr.rowspan]=\"_configuration.multipleHeader ? 2 : 1\">\n @if (_commandHeaderDef) {\n <div class=\"sd-command-header d-flex align-items-center justify-content-center\">\n <ng-container *ngTemplateOutlet=\"_commandHeaderDef.templateRef\"></ng-container>\n </div>\n }\n </th>\n <!-- why: `dataIndex` do CDK c\u1EA5p s\u1EB5n. B\u1EA3n c\u0169 d\u00F9ng `groupedItems.indexOf(item)` \u2014\n qu\u00E9t to\u00E0n m\u1EA3ng cho M\u1ED6I d\u00F2ng render \u1EDF M\u1ED6I CD pass (O(n\u00B2) tr\u00EAn \u0111\u01B0\u1EDDng render),\n v\u00E0 c\u00F2n tr\u1EA3 sai index khi 2 d\u00F2ng tr\u00F9ng reference. -->\n <td class=\"px-8\" mat-cell *matCellDef=\"let item; let i = dataIndex\">\n <desktop-command\n [autoId]=\"_autoId\"\n [commands]=\"_rowCommands\"\n [item]=\"item\"\n [itemIndex]=\"aggregateRenderHost.indices.get(item) ?? i\"></desktop-command>\n </td>\n <td mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n <!-- why: group header row d\u00F9ng matRowDef RI\u00CANG v\u1EDBi column list ['sdGroupHeader']\n qua predicate when:isGroupHeaderRow. Cell colspan = displayedColumns.length \u0111\u1EC3\n span TO\u00C0N B\u1ED8 width data row. Tr\u00E1nh colspan trick overflow row khi c\u00E1c TD kh\u00E1c render. -->\n <ng-container matColumnDef=\"sdGroupHeader\">\n <td class=\"p-0 sd-group-header-cell\" mat-cell *matCellDef=\"let item\" [attr.colspan]=\"sdGroupColspan()\">\n <ng-container *ngTemplateOutlet=\"sdGroupHeader; context: { item: item }\"></ng-container>\n </td>\n </ng-container>\n <!-- why: filler column \u1EDF cu\u1ED1i h\u1EA5p th\u1EE5 leftover space khi t\u1ED5ng width c\u00E1c c\u1ED9t data < container \u2014 gi\u1EEF cho selection/STT/command kh\u00F4ng b\u1ECB d\u00E3n. -->\n <ng-container matColumnDef=\"sdFiller\">\n <th class=\"sd-filler-cell p-0\" mat-header-cell *matHeaderCellDef [attr.rowspan]=\"_configuration.multipleHeader ? 2 : 1\"></th>\n <td class=\"sd-filler-cell p-0\" mat-cell *matCellDef=\"let item\"></td>\n <td class=\"sd-filler-cell p-0\" mat-footer-cell *matFooterCellDef></td>\n </ng-container>\n @for (column of _configuration.firstColumns; track column.field) {\n <ng-container [matColumnDef]=\"column.field\" [sticky]=\"_configuration.fixedColumn[column.field]\">\n <th\n mat-header-cell\n *matHeaderCellDef\n class=\"px-8 c-th\"\n [class.sd-column-group]=\"column.type === 'children'\"\n [attr.scope]=\"column.type === 'children' ? 'colgroup' : 'col'\"\n [sdColumnResize]=\"!!_tableOption.config?.resizable && column.type !== 'children'\"\n [minWidth]=\"column.minWidth\"\n [maxWidth]=\"column.maxWidth\"\n (resizeEnd)=\"onColumnResize(column.field, $event)\"\n [style.width]=\"column.width\"\n [style.min-width]=\"column.minWidth || column.width\"\n [style.max-width]=\"column.maxWidth\"\n [attr.rowspan]=\"_configuration.multipleHeader && column.type !== 'children' ? 2 : 1\"\n [attr.colspan]=\"column.type === 'children' ? column.children.length : 1\"\n [attr.aria-sort]=\"\n _tableOption.sort?.enable && column.type !== 'children' && column.sortable ? getSortAria(column.field) : null\n \">\n <div\n [class.sd-table-header-cell--trigger]=\"_queryBarMode && column.type !== 'children'\"\n [class.sd-table-header-cell--end]=\"_queryBarMode && column.align === 'right'\">\n <!-- why: sort control ch\u1EC9 \u00F4m title; filter l\u00E0 sibling n\u00EAn kh\u00F4ng th\u00E0nh interactive\n descendant. aria-sort thu\u1ED9c semantic <th>, kh\u00F4ng thu\u1ED9c control n\u00E0y. -->\n @if (column.type === 'children') {\n <div class=\"c-header-title sd-column-group-title\">\n <column-title [column]=\"column\" [titleDef]=\"_titleDef[column.field]\"></column-title>\n </div>\n } @else {\n @if (_tableOption.sort?.enable && column.sortable) {\n <div\n [sdTableSortHeader]=\"column.field\"\n class=\"c-header-title\"\n [class.justify-content-end]=\"column.align === 'right'\"\n [class.text-right]=\"column.align === 'right'\">\n <column-title [column]=\"column\" [titleDef]=\"_titleDef[column.field]\"></column-title>\n </div>\n } @else {\n <div\n class=\"c-header-title\"\n [class.justify-content-end]=\"column.align === 'right'\"\n [class.text-right]=\"column.align === 'right'\">\n <column-title [column]=\"column\" [titleDef]=\"_titleDef[column.field]\"></column-title>\n </div>\n }\n @if (_queryBarMode) {\n <ng-container *ngTemplateOutlet=\"queryBarTrigger; context: { $implicit: column }\"></ng-container>\n }\n @if (_showInlineFilter && !_configuration.multipleHeader) {\n <ng-container *ngTemplateOutlet=\"inlineColumnFilter; context: { $implicit: column }\"></ng-container>\n }\n }\n </div>\n </th>\n <td\n class=\"c-td px-0\"\n [class.d-none]=\"column.type === 'children'\"\n mat-cell\n *matCellDef=\"let item\"\n [sdHoverCopy]=\"(item.data && item.data[column.field]) || ''\"\n [sdHoverCopyDisabled]=\"!column.cell?.copiable\">\n @if (column.type !== 'children' && !item?.meta?.group?.isGroupHeader) {\n @if (_treeFirstField && column.field === _treeFirstField) {\n <!-- why: kh\u00F4ng c\u00F3 c\u1ED9t Index \u2192 chevron + indent nh\u00FAng v\u00E0o c\u1ED9t data \u0111\u1EA7u (nh\u01B0 file explorer). -->\n <span class=\"sd-tree-line px-8\">\n <ng-container *ngTemplateOutlet=\"sdTreeToggle; context: { row: item }\"></ng-container>\n <desktop-cell class=\"d-block\" [column]=\"column\" [item]=\"item\" [cellDef]=\"_cellDef\"></desktop-cell>\n </span>\n } @else {\n <desktop-cell class=\"d-block px-8\" [column]=\"column\" [item]=\"item\" [cellDef]=\"_cellDef\"> </desktop-cell>\n }\n }\n </td>\n <td mat-footer-cell *matFooterCellDef [class.d-none]=\"column.type === 'children'\">\n <ng-container *ngIf=\"_footerDef[column.field]\">\n <ng-container *ngTemplateOutlet=\"_footerDef[column.field].templateRef; context: { items: _items, column: column }\">\n </ng-container>\n </ng-container>\n </td>\n </ng-container>\n }\n @for (column of _configuration.secondColumns; track column.field) {\n <ng-container [matColumnDef]=\"column.field\" [sticky]=\"_configuration.fixedColumn[column.field]\">\n <th\n mat-header-cell\n *matHeaderCellDef\n class=\"c-th px-8\"\n scope=\"col\"\n [style.width]=\"column.width\"\n [style.min-width]=\"column.minWidth || column.width\"\n [style.max-width]=\"column.maxWidth\"\n [attr.aria-sort]=\"_tableOption.sort?.enable && column.sortable ? getSortAria(column.field) : null\">\n <div\n [class.sd-table-header-cell--trigger]=\"_queryBarMode\"\n [class.sd-table-header-cell--end]=\"_queryBarMode && column.align === 'right'\">\n @if (_tableOption.sort?.enable && column.sortable) {\n <div\n [sdTableSortHeader]=\"column.field\"\n class=\"c-header-title\"\n [class.justify-content-end]=\"column.align === 'right'\"\n [class.text-right]=\"column.align === 'right'\">\n <column-title [column]=\"column\" [titleDef]=\"_titleDef[column.field]\"></column-title>\n </div>\n } @else {\n <div\n class=\"c-header-title\"\n [class.justify-content-end]=\"column.align === 'right'\"\n [class.text-right]=\"column.align === 'right'\">\n <column-title [column]=\"column\" [titleDef]=\"_titleDef[column.field]\"></column-title>\n </div>\n }\n @if (_queryBarMode) {\n <ng-container *ngTemplateOutlet=\"queryBarTrigger; context: { $implicit: column }\"></ng-container>\n }\n </div>\n </th>\n <td\n class=\"c-td px-0\"\n mat-cell\n *matCellDef=\"let item\"\n [sdHoverCopy]=\"item[column.field]\"\n [sdHoverCopyDisabled]=\"!column.cell?.copiable\">\n @if (column.type !== 'children') {\n <desktop-cell class=\"d-block px-8\" [column]=\"column\" [item]=\"item\" [cellDef]=\"_cellDef\"> </desktop-cell>\n }\n </td>\n <td mat-footer-cell *matFooterCellDef>\n <ng-container *ngIf=\"_footerDef[column.field]\">\n <ng-container *ngTemplateOutlet=\"_footerDef[column.field].templateRef; context: { items: _items, column: column }\">\n </ng-container>\n </ng-container>\n </td>\n </ng-container>\n }\n <tr class=\"c-first-header\" mat-header-row *matHeaderRowDef=\"_configuration.firstHeaders; sticky: true\"></tr>\n @for (entry of _aggregateColumns; track entry.id) {\n <ng-container [matColumnDef]=\"entry.id\" [sticky]=\"entry.sticky\" [stickyEnd]=\"entry.stickyEnd\">\n <td\n mat-cell\n *matCellDef=\"let row\"\n class=\"sd-aggregate-cell px-8 py-8\"\n [class.d-none]=\"entry.hidden\"\n [style.text-align]=\"entry.column?.align\"\n [style.width]=\"entry.column?.width\"\n [style.min-width]=\"entry.column?.minWidth || entry.column?.width\">\n <ng-container\n *ngTemplateOutlet=\"\n aggregateCell;\n context: { $implicit: aggregateRenderHost.rows.get(row)?.cells?.get(entry.field) }\n \"></ng-container>\n </td>\n <td\n mat-footer-cell\n *matFooterCellDef\n class=\"sd-aggregate-cell px-8 py-8\"\n [class.d-none]=\"entry.hidden\"\n [style.text-align]=\"entry.column?.align\"\n [style.width]=\"entry.column?.width\"\n [style.min-width]=\"entry.column?.minWidth || entry.column?.width\">\n <ng-container\n *ngTemplateOutlet=\"aggregateCell; context: { $implicit: _aggregate.total?.cells?.get(entry.field) }\"></ng-container>\n </td>\n </ng-container>\n }\n <tr mat-row *matRowDef=\"let row; columns: _aggregateColumnIds; when: isAggregateRow\" class=\"sd-aggregate-row\"></tr>\n @if (!!_configuration.secondHeaders.length) {\n <tr class=\"c-second-header\" mat-header-row *matHeaderRowDef=\"_configuration.secondHeaders; sticky: true\"></tr>\n }\n @if (_configuration.multipleHeader) {\n @for (entry of _headerFilterColumns; track entry.id) {\n <ng-container [matColumnDef]=\"entry.id\" [sticky]=\"entry.sticky\" [stickyEnd]=\"entry.stickyEnd\">\n <th\n mat-header-cell\n *matHeaderCellDef\n class=\"c-th sd-filter-header\"\n [class.px-8]=\"!!entry.column\"\n [class.p-0]=\"!entry.column\"\n [class.sd-filler-cell]=\"entry.field === 'sdFiller'\"\n scope=\"col\">\n @if (_showInlineFilter && entry.column) {\n <ng-container *ngTemplateOutlet=\"inlineColumnFilter; context: { $implicit: entry.column }\"></ng-container>\n }\n </th>\n </ng-container>\n }\n <!-- why: gi\u1EEF row definition \u1ED5n \u0111\u1ECBnh; CDK c\u1EADp nh\u1EADt columns \u0111\u1EC3 b\u1ECF controls/sticky offsets khi \u1EA9n filter. -->\n <tr\n class=\"c-filter-header\"\n [style.display]=\"_showInlineFilter ? null : 'none'\"\n mat-header-row\n *matHeaderRowDef=\"_showInlineFilter ? headerFilterColumnIds() : []; sticky: _showInlineFilter\"></tr>\n }\n <!-- Group header row \u2014 ch\u1EC9 1 cell sdGroupHeader colspan to\u00E0n width. -->\n <tr mat-row *matRowDef=\"let row; columns: ['sdGroupHeader']; when: isGroupHeaderRow\" class=\"c-group-row-tr\"></tr>\n\n <!-- Data row \u2014 d\u00F9ng displayedColumns \u0111\u1EA7y \u0111\u1EE7; when isDataRow \u0111\u1EC3 lo\u1EA1i tr\u1EEB group header. -->\n <!-- why: [ngStyle] \u0111\u1ECDc meta.rowStyle \u2014 style.rowCss \u0111\u00E3 \u0111\u01B0\u1EE3c resolve 1 l\u1EA7n m\u1ED7i l\u1EA7n\n render. B\u1EA3n c\u0169 g\u1ECDi rowStyle(row) ngay trong binding \u2192 ch\u1EA1y callback c\u1EE7a consumer\n cho T\u1EEANG d\u00F2ng \u1EDF M\u1ED6I CD pass, v\u00E0 v\u00EC tr\u1EA3 object M\u1EDAI n\u00EAn NgStyle ph\u1EA3i ch\u1EA1y l\u1EA1i\n KeyValueDiffer tr\u00EAn m\u1ECDi d\u00F2ng \u1EDF m\u1ECDi pass. -->\n <tr\n mat-row\n cdkDrag\n [cdkDragData]=\"row\"\n [cdkDragDisabled]=\"\n !_tableOption.rowReorder?.enabled ||\n !!row.meta?.group?.items?.length ||\n (row.meta?.tree?.level ?? 0) > 0 ||\n isReorderDisabled(row)\n \"\n *matRowDef=\"let row; columns: _configuration.displayedColumns; when: isDataRow\"\n matRipple\n class=\"c-row\"\n [class.sd-tree-row]=\"!!_tableOption.tree\"\n [ngClass]=\"_tableOption.tree ? 'sd-tree-level-' + (row.meta?.tree?.level ?? 0) : null\"\n [ngStyle]=\"row.meta.rowStyle\"\n [class.selected]=\"row.meta.selector.isSelected\"></tr>\n\n <!-- Sub-information row \u2014 also gated b\u1EDFi isDataRow \u0111\u1EC3 KH\u00D4NG render empty expand row d\u01B0\u1EDBi group header. -->\n <tr mat-row *matRowDef=\"let row; columns: ['sdSubInformation']; when: isDataRow\" class=\"c-detail-row\"></tr>\n @if (_aggregate.total) {\n <tr mat-footer-row *sdTableFooterRowDef=\"_aggregateColumnIds; sticky: true\" class=\"sd-aggregate-total\"></tr>\n }\n @if (hasFooter() && !!_configuration.displayedFooters.length) {\n <tr mat-footer-row *sdTableFooterRowDef=\"_configuration.displayedFooters; sticky: true\"></tr>\n }\n <!-- why: khung x\u01B0\u01A1ng l\u00E0 d\u00F2ng th\u1EADt trong tbody (matNoDataRow ch\u1EC9 hi\u1EC7n khi kh\u00F4ng c\u00F3 d\u00F2ng d\u1EEF li\u1EC7u) n\u00EAn \u00F4 th\u1EB3ng\n c\u1ED9t v\u1EDBi header, k\u1EC3 c\u1EA3 header nh\u00F3m, m\u00E0 kh\u00F4ng ph\u1EA3i \u0111o; footer v\u1EABn n\u1EB1m d\u01B0\u1EDBi; dataSource kh\u00F4ng \u0111\u1ED5i. -->\n <ng-template matNoDataRow>\n @for (cells of skeleton(); track $index) {\n <tr class=\"sd-table-skeleton-row\" aria-hidden=\"true\">\n @for (cell of cells; track cell.field) {\n <td class=\"sd-table-skeleton-cell\" [class.d-none]=\"cell.hidden\">\n @if (cell.shape !== 'none') {\n <span\n class=\"sd-table-skeleton-bar\"\n [attr.data-shape]=\"cell.shape\"\n [attr.data-align]=\"cell.align\"\n [style.width]=\"cell.width\"\n [style.max-width]=\"cell.maxWidth\"></span>\n }\n </td>\n }\n </tr>\n }\n </ng-template>\n </table>\n }\n @let _readError = _readState.status === 'error';\n <!-- why: d\u00F2ng c\u0169 b\u1ECB g\u1EE1 khi l\u1EA7n \u0111\u1ECDc hi\u1EC7n h\u00E0nh l\u1ED7i, n\u00EAn v\u00F9ng l\u1ED7i/empty ch\u1EC9 hi\u1EC7n khi b\u1EA3ng kh\u00F4ng c\u00F2n d\u00F2ng n\u00E0o\n \u2014 end user kh\u00F4ng bao gi\u1EDD th\u1EA5y d\u1EEF li\u1EC7u v\u00E0 l\u1ED7i c\u00F9ng l\u00FAc (NSP-4877). -->\n @let _noRows = !_readError && !_loading && !_total && !_items.length && _loadingView === 'none';\n @if ((_readError && !_hideReadError) || (_noRows && _readState.status === 'empty' && !!_dataStateTemplate)) {\n <sd-data-state [state]=\"_readError ? 'error' : 'empty'\" [retryable]=\"_readError\" (sdRetry)=\"retryRead()\">\n @if (_dataStateTemplate; as custom) {\n <ng-template sdDataStateTemplate let-current let-retry=\"retry\" let-action=\"action\">\n <ng-container\n [ngTemplateOutlet]=\"custom.template\"\n [ngTemplateOutletContext]=\"{ $implicit: current, state: current, retry: retry, action: action }\"></ng-container>\n </ng-template>\n }\n </sd-data-state>\n } @else if (!_loading && loadError() && !_hideReadError) {\n <!-- why: b\u1EA3ng local l\u1ED7i d\u00F9ng c\u00F9ng giao di\u1EC7n l\u1ED7i v\u1EDBi b\u1EA3ng server (sd-data-state, role=\"alert\") v\u00E0 c\u00F9ng\n sdDataStateTemplate; th\u1EED l\u1EA1i = reload() v\u00EC local kh\u00F4ng c\u00F3 snapshot \u0111\u1ECDc \u0111\u1EC3 retryRead(). -->\n <sd-data-state state=\"error\" [retryable]=\"true\" (sdRetry)=\"reload()\">\n @if (_dataStateTemplate; as custom) {\n <ng-template sdDataStateTemplate let-current let-retry=\"retry\" let-action=\"action\">\n <ng-container\n [ngTemplateOutlet]=\"custom.template\"\n [ngTemplateOutletContext]=\"{ $implicit: current, state: current, retry: retry, action: action }\"></ng-container>\n </ng-template>\n }\n </sd-data-state>\n } @else if (_noRows && !loadError()) {\n <!-- why: empty m\u1EB7c \u0111\u1ECBnh gi\u1EEF 3 tr\u1EA1ng th\u00E1i (filter kh\u00F4ng c\u00F3 k\u1EBFt qu\u1EA3 / ch\u01B0a ch\u1ECDn filter b\u1EAFt bu\u1ED9c / ch\u01B0a c\u00F3 d\u1EEF li\u1EC7u)\n c\u00F9ng \u1EA3nh c\u1EA5u h\u00ECnh qua SD_TABLE_CONFIGURATION.images, cho c\u1EA3 b\u1EA3ng server (NSP-5551). Kh\u00F4ng c\u00F3 role live:\n v\u00F9ng .sd-table-live (lu\u00F4n c\u00F3 trong DOM) \u0111\u1ECDc ti\u00EAu \u0111\u1EC1 c\u1EE7a kh\u1ED1i n\u00E0y. -->\n <div class=\"c-no-data-row\">\n @if (_isFiltered) {\n @if (tableConfiguration?.images?.filterEmpty) {\n <img class=\"c-image\" [src]=\"tableConfiguration!.images!.filterEmpty\" alt=\"filter-empty\" />\n } @else {\n <img class=\"c-image sd-image-filter-empty\" alt=\"filter-empty\" />\n }\n <div class=\"T16M\">{{ 'core.component.table.no-results' | sdTranslate }}</div>\n <div class=\"T16R text-secondary\">{{ 'core.component.table.no-results-hint' | sdTranslate }}</div>\n } @else {\n @if (_requireFiltered) {\n @if (tableConfiguration?.images?.filterRequired) {\n <img class=\"c-image\" [src]=\"tableConfiguration!.images!.filterRequired\" alt=\"filter-required\" />\n } @else {\n <img class=\"c-image sd-image-filter-required\" alt=\"filter-required\" />\n }\n <div class=\"T16R text-secondary\">{{ 'core.component.table.choose-filter-hint' | sdTranslate }}</div>\n } @else {\n @if (tableConfiguration?.images?.dataEmpty) {\n <img class=\"c-image\" [src]=\"tableConfiguration!.images!.dataEmpty\" alt=\"data-empty\" />\n } @else {\n <img class=\"c-image sd-image-data-empty\" alt=\"data-empty\" />\n }\n <div class=\"T16R text-secondary\">{{ 'core.component.table.no-data' | sdTranslate }}</div>\n }\n }\n </div>\n }\n </div>\n @if (_loadingView === 'refresh' && !_mobileCards) {\n <!-- N\u1EB1m trong .c-container, kh\u00F4ng trong .c-table, \u0111\u1EC3 kh\u00F4ng cu\u1ED9n ngang theo b\u1EA3ng; top = --sd-table-head-h (\u0111o). -->\n <div class=\"sd-table-progress\" aria-hidden=\"true\"></div>\n }\n @if (!_mobileCards) {\n <selector-action\n [autoId]=\"_autoId\"\n [tableOption]=\"_tableOption\"\n [selectedTableItems]=\"_selectedTableItems\"\n (clear)=\"onClearSelection()\" />\n }\n <div class=\"c-paginator\">\n <div class=\"c-action\">\n @if (_mobileCards) {\n @let _tools = mobileToolsActions();\n @if (_tools.length) {\n <button\n mat-button\n type=\"button\"\n class=\"sd-mobile-tools-trigger\"\n aria-haspopup=\"dialog\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-mobile-tools' : null\"\n (click)=\"mobileTools.openMore()\">\n <sd-icon name=\"tune\"></sd-icon><span>{{ 'core.component.table.mobile.tools' | sdTranslate }}</span>\n </button>\n <sd-table-mobile-actions\n #mobileTools\n [actions]=\"_tools\"\n [autoOpen]=\"false\"\n [title]=\"'core.component.table.mobile.tools-title' | sdTranslate\"\n [autoId]=\"_autoId\"></sd-table-mobile-actions>\n }\n } @else {\n @if (_tableOption.reload?.visible) {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-reload' : null\"\n class=\"mr-8\"\n [title]=\"'core.component.table.reload' | sdTranslate\"\n prefixIcon=\"refresh\"\n (click)=\"reload()\"\n type=\"text\">\n </sd-button>\n }\n @if (_export && _items.length) {\n @if (_export.type === 'custom') {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-export' : null\"\n class=\"mr-8\"\n [title]=\"_exportTitle\"\n prefixIcon=\"get_app\"\n (click)=\"exportCustom()\"\n type=\"text\">\n </sd-button>\n } @else {\n @if (_export.visible) {\n @if (_exporting) {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-export' : null\"\n class=\"mr-8\"\n [loading]=\"_exporting\"\n [title]=\"_exportTitle\"\n prefixIcon=\"get_app\"\n type=\"text\">\n </sd-button>\n } @else {\n @if (_export.visible === 'ALL' || !_export.visible) {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-export' : null\"\n class=\"mr-8\"\n [title]=\"_exportTitle\"\n prefixIcon=\"get_app\"\n type=\"text\">\n <sd-button-item\n [autoId]=\"_autoId ? _autoId + '-export-excel' : null\"\n prefixIcon=\"file_download\"\n (click)=\"exportExcel()\"\n >{{ 'core.component.table.export-excel' | sdTranslate }}</sd-button-item\n >\n <sd-button-item\n [autoId]=\"_autoId ? _autoId + '-export-csv' : null\"\n prefixIcon=\"file_download\"\n (click)=\"exportCSV()\"\n >{{ 'core.component.table.export-csv' | sdTranslate }}</sd-button-item\n >\n </sd-button>\n } @else if (_export.visible === 'EXCEL') {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-export-excel' : null\"\n class=\"mr-8\"\n [title]=\"_exportTitle\"\n prefixIcon=\"get_app\"\n (click)=\"exportExcel()\"\n type=\"text\">\n </sd-button>\n } @else if (_export.visible === 'CSV') {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-export-csv' : null\"\n class=\"mr-8\"\n [title]=\"_exportTitle\"\n prefixIcon=\"get_app\"\n (click)=\"exportCSV()\"\n type=\"text\">\n </sd-button>\n }\n }\n }\n }\n }\n\n @if (_configComponent) {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-config' : null\"\n class=\"mr-8\"\n [title]=\"'core.component.table.setup-short' | sdTranslate\"\n prefixIcon=\"settings\"\n [indicator]=\"!_isMobile && hasCustomSetup()\"\n indicatorColor=\"primary\"\n [indicatorLabel]=\"'core.component.table.config.customized' | sdTranslate\"\n (click)=\"_configComponent.open()\"\n type=\"text\">\n </sd-button>\n }\n <!-- Mobile: n\u00FAt Filter m\u1EDF mobile-filter drawer (inline filter \u1EA9n tr\u00EAn mobile) -->\n @if (_isMobile) {\n @if (!_tableOption.filter?.disabled && _mobileFilter) {\n <sd-button\n [autoId]=\"_autoId ? _autoId + '-mobile-filter-open' : null\"\n class=\"mr-8\"\n prefixIcon=\"filter_alt\"\n [title]=\"_mobileCards ? ('core.component.table.filter' | sdTranslate) : undefined\"\n (click)=\"_mobileFilter.open()\"\n type=\"text\">\n </sd-button>\n }\n }\n }\n </div>\n @let _unknownTotalPager = unknownTotalPager();\n @if (_unknownTotalPager) {\n <!-- paginate.total 'unknown': no total exists, so mat-paginator (which derives Next/Last and the\n range from `length`) is replaced by a pager that renders only the rows actually shown. -->\n @if (!_tableOption.paginate?.hidden && unknownTotalPagerVisible()) {\n <sd-table-unknown-total-paginator\n [class.sd-mobile-paginator]=\"_mobileCards\"\n [state]=\"_unknownTotalPager\"\n [pageSizeOptions]=\"_tableOption.paginate?.pages\"\n [hidePageSize]=\"_isMobile || !!_tableOption.paginate?.hidePageSize\"\n [showFirstButton]=\"!_isMobile && !!_tableOption.paginate?.showFirstLastButtons\"\n [autoId]=\"_autoId\"\n (page)=\"onUnknownTotalPage($event)\"></sd-table-unknown-total-paginator>\n } @else if (!_isMobile && !_tableOption.paginate?.hidden && unknownTotalSingleCount()) {\n <div class=\"T14R c-summary\">\n {{ 'core.component.table.showing' | sdTranslate }} <span class=\"T14M ml-2\">1-{{ unknownTotalSingleCount() }}</span>\n </div>\n }\n } @else {\n @let hidePaginator = !_tableOption.paginate?.pageSize || _total === undefined || _total <= _tableOption.paginate?.pageSize!;\n <mat-paginator\n [class.sd-mobile-paginator]=\"_mobileCards\"\n [class.d-none]=\"_tableOption.paginate?.hidden || hidePaginator\"\n [length]=\"_total\"\n [pageSize]=\"_tableOption.paginate?.pageSize\"\n [pageSizeOptions]=\"_tableOption.paginate?.pages!\"\n [showFirstLastButtons]=\"!_isMobile && _tableOption.paginate?.showFirstLastButtons\"\n [hidePageSize]=\"_isMobile || _tableOption.paginate?.hidePageSize\"\n [selectConfig]=\"{ panelClass: ['sd-select-panel', 'sd-table-page-size-panel'] }\"></mat-paginator>\n <!-- \"\u0110ang hi\u1EC3n th\u1ECB...\" ch\u1EC9 desktop -->\n @if (!_isMobile) {\n @if (!_tableOption.paginate?.hidden && hidePaginator && _total !== undefined && _total > 0) {\n <div class=\"T14R c-summary\">\n {{ 'core.component.table.showing' | sdTranslate }} <span class=\"T14M ml-2\">1-{{ _total }}/{{ _total }}</span>\n </div>\n }\n }\n }\n </div>\n </div>\n </div>\n\n @if (_tableOption.config?.visible) {\n <config [autoId]=\"_autoId\" [tableOption]=\"_tableOption\" (defaultsRestored)=\"onConfigDefaultsRestored()\" />\n }\n <!-- Mobile filter drawer \u2014 ch\u1EC9 instantiate khi c\u1EA7n render tr\u00EAn mobile -->\n @if (!_tableOption.filter?.disabled && filterRegister) {\n <mobile-filter\n [autoId]=\"_autoId\"\n [filter]=\"_tableOption.filter!\"\n [externalFilters]=\"_tableOption.filter?.externalFilters!\"\n [columns]=\"mobileColumns()\"\n [filterDefs]=\"sdFilterDefs()\"\n [filterRegister]=\"filterRegister\"\n [cacheValues]=\"cacheValues\">\n </mobile-filter>\n }\n} @else if (_readState.status === 'error' && !_hideReadError) {\n <!-- why: lookup c\u00F3 th\u1EC3 l\u1ED7i tr\u01B0\u1EDBc khi c\u00F3 configuration; v\u1EABn ph\u1EA3i c\u00F3 l\u1ED1i retry v\u00E0 custom error template. -->\n <sd-data-state state=\"error\" [retryable]=\"true\" (sdRetry)=\"retryRead()\">\n @if (_dataStateTemplate; as custom) {\n <ng-template sdDataStateTemplate let-current let-retry=\"retry\" let-action=\"action\">\n <ng-container\n [ngTemplateOutlet]=\"custom.template\"\n [ngTemplateOutletContext]=\"{ $implicit: current, state: current, retry: retry, action: action }\"></ng-container>\n </ng-template>\n }\n </sd-data-state>\n} @else if (_loadingView === 'skeleton') {\n <!-- why: lookup c\u1ED9t (values/lazy-values) c\u00F3 th\u1EC3 ch\u1EADm; ch\u01B0a c\u00F3 configuration n\u00EAn ch\u01B0a bi\u1EBFt c\u1ED9t, v\u1EBD khung x\u01B0\u01A1ng chung\n thay v\u00EC \u0111\u1EC3 tr\u1ED1ng. Hydrate kh\u00F4ng c\u00F3 lookup xong trong microtask n\u00EAn kh\u1ED1i n\u00E0y kh\u00F4ng k\u1ECBp hi\u1EC7n. -->\n <div class=\"sd-table-skeleton-block\" aria-hidden=\"true\">\n @for (cells of genericSkeleton; track $index) {\n <div class=\"sd-table-skeleton-block-row\">\n @for (cell of cells; track cell.field) {\n <span class=\"sd-table-skeleton-cell\">\n <span class=\"sd-table-skeleton-bar\" [style.width]=\"cell.width\" [style.max-width]=\"cell.maxWidth\"></span>\n </span>\n }\n </div>\n }\n </div>\n}\n", styles: [":host:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}:host{display:flex;flex-direction:column;overflow:auto;width:100%;height:100%;--mat-table-row-item-container-height: 36px}:host .sd-table-live{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}:host .c-header-title{height:40px;display:flex;align-items:center}:host .sd-table-surface{display:flex;flex:1;flex-direction:column;min-width:0;min-height:0;background:var(--sd-surface, #fff);border-radius:var(--sd-radius-6, 6px)}:host .c-container{position:relative;min-height:50px;display:flex;flex-direction:column;flex:1;isolation:isolate}:host .c-container .c-table{position:relative;flex:1;display:flex;flex-direction:column}:host .c-container .c-table table{border-collapse:separate;width:100%}:host .c-container .c-table table tr.c-first-header.mat-mdc-header-row{height:40px}:host .c-container .c-table table tr.c-second-header.mat-mdc-header-row{height:40px}:host .c-container .c-table table.sd-table-grouped-header th.c-th{vertical-align:middle;padding-block:4px}:host .c-container .c-table table.sd-table-grouped-header tr.c-first-header.mat-mdc-header-row{height:32px}:host .c-container .c-table table.sd-table-grouped-header tr.c-filter-header.mat-mdc-header-row{height:auto}:host .c-container .c-table table.sd-table-grouped-header th.sd-filter-header{padding-block:0 8px;vertical-align:bottom}:host .c-container .c-table table.sd-table-grouped-header column-filter{display:flex;align-items:center;min-height:36px}:host .c-container .c-table table.sd-table-grouped-header th.sd-column-group{padding-block:4px;vertical-align:middle;background-color:color-mix(in srgb,var(--sd-border, #c4c6d0) 18%,var(--sd-table-group-header-mix, #f2f3f4));box-shadow:inset 0 -1px var(--sd-border, #c4c6d0)}:host .c-container .c-table table.sd-table-grouped-header th.sd-column-group .sd-column-group-title{height:auto;min-height:24px;justify-content:center;text-align:center;font-weight:var(--sd-font-weight-semibold, 600)}:host .c-container .c-table table tr.c-detail-row{height:0}:host .c-container .c-table table tr.c-row.activated{background-color:var(--sd-table-row-activated-bg, #e5ecff)}:host .c-container .c-table table tr.c-row.selected{background-color:var(--sd-table-row-selected-bg, #eef2ff)}:host .c-container .c-table table tr.c-row:not(.selected):not(.activated):hover{background-color:var(--sd-table-row-hover-bg, #f5f5f5)}:host .c-container .c-table table tr.c-row td{border-bottom-width:0}:host .c-container .c-table table tr.c-row.c-expandable{cursor:pointer}:host .c-container .c-table table tr.c-row.c-expandable:hover{background:var(--sd-table-row-hover-bg, #f5f5f5)}:host .c-container .c-table table th.mat-mdc-header-cell{background-color:var(--sd-table-header-bg, #f2f3f4);border-bottom:0!important}:host .c-container .c-table table td.mat-mdc-cell,:host .c-container .c-table table td.mat-mdc-footer-cell,:host .c-container .c-table table th.mat-mdc-header-cell{border-bottom-color:var(--sd-table-row-divider, #f2f2f2)!important}:host .c-container .c-table .c-th{vertical-align:middle;padding-block:8px;font-weight:var(--sd-font-weight-medium, 500);font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px);color:var(--sd-table-header-text, #212121)}:host .c-container .c-table .c-th.sd-col-resize-host{position:relative}:host .c-container .c-table .c-th.sd-resizing{-webkit-user-select:none;user-select:none}:host .c-container .c-table .c-th .sd-col-resize-handle{position:absolute;top:0;right:0;width:6px;height:100%;cursor:col-resize;-webkit-user-select:none;user-select:none;z-index:2}:host .c-container .c-table .c-th .sd-col-resize-handle:hover{background:color-mix(in srgb,var(--sd-text) 8%,transparent)}:host .c-container .c-table .c-td:first{padding-left:10px}:host .c-container .c-table .c-no-data-row{flex:1;width:100%;position:sticky;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center}:host .c-container .c-table .c-no-data-row .c-image{margin-bottom:16px;width:96px}:host .c-container .c-paginator{display:flex;flex-direction:row;justify-content:space-between;align-items:center;background-color:var(--sd-table-bg, #ffffff)}:host .c-container .c-paginator .mat-mdc-paginator{background:transparent;--mat-paginator-container-size: 40px;--mat-icon-button-state-layer-size: 32px;--mdc-icon-button-state-layer-size: 32px;--mdc-icon-button-icon-size: 20px}:host .c-container .c-paginator .c-action{padding:0}:host .c-container .c-paginator .c-action sd-button{margin:8px 5px}:host .c-container .c-paginator .c-summary{padding:8px 16px}:host .c-container .c-empty{text-align:center;background-color:var(--sd-table-bg, #ffffff);border:none!important}:host .c-container .c-empty sd-icon{font-size:150px;margin-top:30px;margin-bottom:30px;opacity:.2;width:auto;height:auto}:host button.c-btn-add{background-color:var(--sd-table-bg, #ffffff);box-shadow:var(--sd-shadow-sm)}:host .sd-reorder-header,:host .sd-reorder-cell{width:40px;min-width:40px;padding:0 4px;box-sizing:border-box}:host .sd-reorder-cell sd-icon{cursor:grab;color:var(--sd-text-muted);display:flex;align-items:center}:host .sd-reorder-cell sd-icon:active{cursor:grabbing}:host .sd-reorder-cell sd-icon.sd-reorder-disabled{opacity:.3;cursor:not-allowed;pointer-events:none}:host ::ng-deep .sd-mobile-paginator .mat-mdc-paginator-range-label{margin-inline:4px;white-space:nowrap}:host .c-container:not(.sd-table-mobile)>.c-table{border-radius:6px 6px 0 0}:host .c-container:not(.sd-table-mobile)>.c-paginator{border-radius:0}:host .sd-mobile-command-header{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px;padding:4px}:host .c-container.sd-table-mobile .c-paginator{flex-wrap:wrap;gap:4px}:host .c-container.sd-table-mobile .c-action{display:flex;align-items:center;min-width:0}:host .c-container.sd-table-mobile .sd-mobile-tools-trigger{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px}:host .c-container.sd-table-mobile .sd-mobile-paginator{margin-inline-start:auto}:host .c-container.sd-table-mobile .c-paginator,:host .c-container.sd-table-mobile .c-empty{background-color:var(--sd-surface);color:var(--sd-text)}:host .c-container.sd-table-mobile .c-paginator{background-color:var(--sd-table-bg, #ffffff)}:host ::ng-deep .sd-table-mobile .c-paginator button{min-width:44px;min-height:44px}:host .c-container.sd-table-mobile .c-paginator .sd-mobile-paginator{--mat-icon-button-state-layer-size: 44px;--mdc-icon-button-state-layer-size: 44px}:host ::ng-deep .mat-select-arrow{color:var(--sd-table-select-arrow, #a6a6a6)}:host ::ng-deep .sd-table-sort-header{cursor:pointer;outline:none}:host ::ng-deep .sd-table-sort-header:focus-visible{border-bottom:solid 1px currentColor}:host ::ng-deep th[aria-sort] .sd-table-sort-header{position:relative;padding-right:24px}:host ::ng-deep th[aria-sort] .sd-table-sort-header:after{content:\"\";position:absolute;top:50%;right:0;width:16px;height:16px;transform:translateY(-50%);background-color:var(--sd-text-secondary);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-size:16px 16px;mask-size:16px 16px;pointer-events:none}:host ::ng-deep th[aria-sort=ascending] .sd-table-sort-header:after,:host ::ng-deep th[aria-sort=descending] .sd-table-sort-header:after{background-color:var(--sd-text)}:host ::ng-deep th[aria-sort=none] .sd-table-sort-header:after{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M12 5.83L15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9 12 5.83zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15 12 18.17z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M12 5.83L15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9 12 5.83zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15 12 18.17z'/%3E%3C/svg%3E\")}:host ::ng-deep th[aria-sort=ascending] .sd-table-sort-header:after{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z'/%3E%3C/svg%3E\")}:host ::ng-deep th[aria-sort=descending] .sd-table-sort-header:after{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 0 24 24' width='24px' fill='%23000000'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath fill='%237A7A7A' d='M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z'/%3E%3C/svg%3E\")}:host ::ng-deep .c-paginator .mat-mdc-paginator-range-label{margin:0 4px}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size{align-items:center}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select{--mat-select-trigger-text-size: var(--sd-font-size-14, 14px);--mat-paginator-select-trigger-text-size: var(--sd-font-size-14, 14px)}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select .mat-mdc-form-field-infix{display:flex;align-items:center;height:32px;min-height:32px;padding-top:0;padding-bottom:0}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select.mat-mdc-form-field .mat-mdc-form-field-infix mat-select.mat-mdc-select{margin-top:0}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select .mat-mdc-text-field-wrapper{padding-right:8px}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select .mat-mdc-select-arrow-wrapper{width:20px;justify-content:center}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select .mat-mdc-select-arrow{width:16px;height:16px;color:var(--sd-text-secondary);background-color:currentColor;-webkit-mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z'/%3E%3C/svg%3E\") center/16px 16px no-repeat;mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z'/%3E%3C/svg%3E\") center/16px 16px no-repeat}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select .mat-mdc-select-arrow svg{display:none}:host ::ng-deep .c-paginator .mat-mdc-paginator-page-size-select .mat-mdc-form-field-flex:hover .mat-mdc-select-arrow{color:var(--sd-text)}::ng-deep .mat-mdc-select-panel.sd-select-panel.sd-table-page-size-panel .mat-mdc-option{min-height:36px;padding:7px 12px}:host ::ng-deep .cdk-drag-preview{box-shadow:var(--sd-shadow-md);background:var(--sd-table-bg);display:table;width:100%}:host ::ng-deep .cdk-drag-preview td{padding:0 8px;border-bottom:1px solid var(--sd-table-row-divider)}:host ::ng-deep .cdk-drag-placeholder{opacity:0}:host ::ng-deep .cdk-drop-list-dragging tr.c-row:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}:host ::ng-deep .sd-selection-cell{width:42px;min-width:42px;max-width:42px}:host ::ng-deep .sd-filler-cell{width:auto;min-width:0;padding:0!important;border:0}:host ::ng-deep .sd-group-header-cell{background:var(--sd-table-group-row-bg, #f5f7fc);border-top:1px solid var(--sd-table-group-row-border, #e6e9f2);border-bottom:1px solid var(--sd-table-group-row-border, #e6e9f2)}:host ::ng-deep .sd-group-row{min-height:36px}:host ::ng-deep .sd-group-selection-slot{width:42px;min-width:42px;max-width:42px}:host ::ng-deep .c-selection{transform:scale(.85);transform-origin:center}:host ::ng-deep .sd-tree-line{display:inline-flex;align-items:center;min-height:32px}:host ::ng-deep .sd-tree-indent{flex:0 0 auto}:host ::ng-deep .sd-tree-toggle-slot{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px}:host ::ng-deep .sd-tree-toggle-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;background:transparent;border-radius:50%;cursor:pointer;color:var(--sd-text-secondary, #5b6472);transition:background-color .15s ease}:host ::ng-deep .sd-tree-toggle-btn sd-icon{font-size:var(--sd-font-size-18, 18px);width:18px;height:18px;line-height:var(--sd-line-height-18, 18px)}:host ::ng-deep .sd-tree-toggle-btn:hover{background-color:color-mix(in srgb,var(--sd-text) 8%,transparent)}:host ::ng-deep .sd-tree-toggle-btn[aria-busy=true]{cursor:progress}:host ::ng-deep .sd-tree-stt{margin-left:2px;white-space:nowrap}:host ::ng-deep .sd-tree-index-cell{text-align:left!important;white-space:nowrap;padding-left:8px;padding-right:8px}:host ::ng-deep .sd-tree-index-header{padding-left:32px}:host ::ng-deep tr.c-row.sd-tree-row.sd-tree-level-0{background:var(--sd-table-tree-level-0-bg, #fbfcfe)}:host ::ng-deep tr.c-row.sd-tree-row.sd-tree-level-0>td{font-weight:var(--sd-font-weight-medium, 500)}:host ::ng-deep tr.c-row.sd-tree-row.sd-tree-level-1{background:var(--sd-table-tree-level-1-bg, #ffffff)}:host ::ng-deep tr.c-row.sd-tree-row.sd-tree-level-2{background:var(--sd-table-tree-level-2-bg, #fafbfd)}:host ::ng-deep tr.c-row.sd-tree-row.sd-tree-level-3{background:var(--sd-table-tree-level-3-bg, #f6f8fb)}:host ::ng-deep .sd-stt-root{font-weight:var(--sd-font-weight-bold, 700);color:var(--sd-table-tree-root-text, #1f2330)}:host ::ng-deep .sd-mobile-tools-trigger .mdc-button__label{display:inline-flex;align-items:center;gap:6px}:host .sd-table-surface--quick-search>.c-container:not(.sd-table-mobile)>.c-table,:host .sd-table-surface--query-bar>.c-container:not(.sd-table-mobile)>.c-table{border-top-left-radius:0;border-top-right-radius:0}:host .sd-table-query-bar{display:block;flex:0 0 auto;min-width:0;background:var(--sd-table-bg, #ffffff);border-top-left-radius:var(--sd-radius-6, 6px);border-top-right-radius:var(--sd-radius-6, 6px);--sd-control-label-bg: var(--sd-table-bg, #ffffff)}:host .sd-table-query-bar-end{flex:none;display:flex;align-items:center;align-self:flex-start;padding-left:8px}:host .sd-table-header-cell--trigger{display:flex;align-items:center;gap:4px;min-width:0}:host .sd-table-header-cell--trigger>.c-header-title{flex:0 1 auto;min-width:0}:host .sd-table-header-cell--trigger.sd-table-header-cell--end{flex-direction:row-reverse;justify-content:flex-start}:host .sd-table-filter-trigger{flex:none;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:var(--sd-text-secondary);cursor:pointer;opacity:0;transition:opacity var(--sd-duration-fast, .12s) ease,background-color var(--sd-duration-fast, .12s) ease}:host .sd-table-filter-trigger sd-icon{width:15px;height:15px;font-size:15px}:host .sd-table-filter-trigger:hover{background:var(--sd-table-row-hover-bg)}:host .sd-table-filter-trigger:focus-visible{opacity:1;outline:2px solid var(--sd-focus-ring-color);outline-offset:1px}:host .sd-table-filter-trigger.sd-table-filter-trigger--active{opacity:1;color:var(--sd-primary)}:host th:hover .sd-table-filter-trigger,:host th:focus-within .sd-table-filter-trigger{opacity:1}@media(pointer:coarse){:host .sd-table-filter-trigger{opacity:1}}@media(prefers-reduced-motion:reduce){:host .sd-table-filter-trigger{transition:none}}@media(forced-colors:active){:host .sd-table-filter-trigger{color:ButtonText}:host .sd-table-filter-trigger--active{color:Highlight}}:host .sd-table-query-bar-hint{display:flex;align-items:center;gap:6px;margin:0;padding:0 12px 8px;background:var(--sd-table-bg, #ffffff);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-18, 18px);color:var(--sd-error)}:host .sd-table-query-bar-hint sd-icon{flex:none;width:16px;height:16px;font-size:var(--sd-font-size-16, 16px)}@keyframes sd-table-skeleton-sweep{to{background-position:480px 0}}@keyframes sd-table-progress-run{0%{transform:translate(-100%)}to{transform:translate(285.7142857143%)}}@keyframes sd-table-spin{to{transform:rotate(360deg)}}:host tr.sd-table-skeleton-row{height:var(--mat-table-row-item-container-height, 36px)}:host .sd-table-skeleton-cell{padding:0 8px;border-bottom:1px solid var(--sd-table-row-divider);vertical-align:middle}:host .sd-table-skeleton-bar{display:block;height:12px;border-radius:var(--sd-radius-4, 4px);background:linear-gradient(90deg,var(--sd-table-skeleton-bg) 0,var(--sd-table-skeleton-highlight) 40%,var(--sd-table-skeleton-bg) 80%) 0 0/480px 100%;animation:sd-table-skeleton-sweep 1.4s linear infinite}@media(prefers-reduced-motion:reduce){:host .sd-table-skeleton-bar{animation:none}}@media(forced-colors:active){:host .sd-table-skeleton-bar{forced-color-adjust:none;background:GrayText}}:host .sd-table-skeleton-bar[data-align=end]{margin-inline-start:auto}:host .sd-table-skeleton-bar[data-align=center]{margin-inline:auto}:host .sd-table-skeleton-bar[data-shape=pill]{height:20px;border-radius:999px}:host .sd-table-skeleton-bar[data-shape=box]{width:14px;height:14px;border-radius:3px}:host .sd-table-skeleton-block{overflow:hidden;border-radius:var(--sd-radius-6, 6px);background:var(--sd-surface)}:host .sd-table-skeleton-block-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:center;height:var(--mat-table-row-item-container-height, 36px);border-bottom:1px solid var(--sd-table-row-divider)}:host .sd-table-skeleton-block-row>.sd-table-skeleton-cell{border-bottom:0}:host .c-table>table>::ng-deep tbody{transition:opacity var(--sd-duration-fast, .12s)}@media(prefers-reduced-motion:reduce){:host .c-table>table>::ng-deep tbody{transition:none}}:host .c-table.c-table--dim{cursor:progress}:host .c-table.c-table--dim>table>::ng-deep thead,:host .c-table.c-table--dim>table>::ng-deep tfoot{cursor:auto}:host .c-table.c-table--dim>table>::ng-deep tbody{opacity:var(--sd-table-loading-dim, .55)}:host .c-table.c-table--dim>table>::ng-deep tbody,:host .c-table.c-table--dim>table>::ng-deep tbody *{pointer-events:none!important}:host .sd-table-progress{position:absolute;top:var(--sd-table-head-h, 0px);right:0;left:0;z-index:20;height:2px;overflow:hidden;pointer-events:none;background:var(--sd-table-progress-track)}:host .sd-table-progress:before{content:\"\";position:absolute;inset:0 auto 0 0;width:35%;background:var(--sd-table-spinner);animation:sd-table-progress-run 1.1s ease-in-out infinite}@media(prefers-reduced-motion:reduce){:host .sd-table-progress:before{width:100%;opacity:.6;animation:none}}@media(forced-colors:active){:host .sd-table-progress{forced-color-adjust:none;box-sizing:content-box;border:1px solid CanvasText;background:Canvas}:host .sd-table-progress:before{background:Highlight}}:host .sd-table-spinner{display:inline-block;flex:0 0 auto;vertical-align:middle;box-sizing:border-box;width:16px;height:16px;border:2px solid var(--sd-table-progress-track);border-top-color:var(--sd-table-spinner);border-radius:50%;animation:sd-table-spin .8s linear infinite}@media(prefers-reduced-motion:reduce){:host .sd-table-spinner{animation:none}}@media(forced-colors:active){:host .sd-table-spinner{forced-color-adjust:none;border-color:GrayText;border-top-color:Highlight}}:host .sd-table-progress-anchor{position:sticky;top:0;z-index:20;height:0}:host .sd-table-progress-anchor>.sd-table-progress{top:0}.sd-aggregate-row,.sd-aggregate-total,.sd-mobile-aggregate{background:color-mix(in srgb,var(--sd-surface-muted) 35%,var(--sd-surface));color:var(--sd-text);font-weight:var(--sd-font-weight-medium, 500)}.sd-aggregate-cell{background:inherit;border-top:1px solid var(--sd-border)}:host(.sd-table--fill){flex:1 1 0;height:auto;min-height:var(--sd-table-fill-min, 0px);overflow:visible}:host(.sd-table--fill) .c-container{min-height:0}:host(.sd-table--fill) .c-container>.c-table{min-height:calc(var(--sd-table-fill-head, 40px) + 5 * var(--mat-table-row-item-container-height, 36px))}:host(.sd-table--fill) .c-container>.c-paginator{flex:none;min-height:48px}\n", ":host ::ng-deep .sticky-shadow-right{overflow:visible!important}:host ::ng-deep .sticky-shadow-right:after{content:\"\";position:absolute;top:0;right:0;bottom:0;width:8px;transform:translate(100%);background:linear-gradient(to right,rgba(0,0,0,.12),transparent);pointer-events:none}:host ::ng-deep .sticky-shadow-left{overflow:visible!important}:host ::ng-deep .sticky-shadow-left:after{content:\"\";position:absolute;top:0;left:0;bottom:0;width:8px;transform:translate(-100%);background:linear-gradient(to left,rgba(0,0,0,.12),transparent);pointer-events:none}\n"] }]
|
|
8695
|
+
}], ctorParameters: () => [], propDecorators: { autoIdInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], option: [{ type: i0.Input, args: [{ isSignal: true, alias: "option", required: true }] }], hideReadError: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideReadError", required: false }] }], sdReadStateChange: [{ type: i0.Output, args: ["sdReadStateChange"] }], dataStateTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdDataStateTemplateDirective), { isSignal: true }] }], table: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatTable), { isSignal: true }] }], configComponent: [{ type: i0.ViewChild, args: [i0.forwardRef(() => ConfigComponent), { isSignal: true }] }], sdPopupExport: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdPopupExport), { isSignal: true }] }], scroll: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdScrollDirective), { isSignal: true }] }], quickAction: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdQuickAction), { isSignal: true }] }], externalFilter: [{ type: i0.ViewChild, args: [i0.forwardRef(() => ExternalFilterComponent), { isSignal: true }] }], mobileFilter: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MobileFilterComponent), { isSignal: true }] }], paginator: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatPaginator), { isSignal: true }] }], sort: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatSort), { isSignal: true }] }], sdSubInformation: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdTableExpandDefDirective), { isSignal: true }] }], sdGroupDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdTableGroupDefDirective), { isSignal: true }] }], sdCellDefs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SdTableCellDefDirective), { isSignal: true }] }], sdCommandHeaderDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdTableCommandHeaderDefDirective), { isSignal: true }] }], sdQuickSearchRightDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdTableQuickSearchRightDefDirective), { isSignal: true }] }], sdFooterDefs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SdMaterialFooterDefDirective), { isSignal: true }] }], sdFilterDefs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SdTableFilterDefDirective), { isSignal: true }] }], sdTitleDefs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SdTableTitleDefDirective), { isSignal: true }] }], sdRowMobileDef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdTableRowMobileDefDirective), { ...{ descendants: false }, isSignal: true }] }], quickSearchControl: [{ type: i0.ViewChild, args: [i0.forwardRef(() => TableQuickSearchComponent), { isSignal: true }] }], queryBar: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdQueryBar), { isSignal: true }] }] } });
|
|
7552
8696
|
|
|
7553
8697
|
/**
|
|
7554
8698
|
* Generated bundle index. Do not edit.
|