@sdcorejs/angular 19.2.7 → 19.2.9

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.
Files changed (51) hide show
  1. package/README.md +4 -2
  2. package/assets/STYLE-GUIDE.md +2 -0
  3. package/assets/scss/core/form.scss +6 -0
  4. package/components/form-generic/src/models/form-generic-component.model.d.ts +1 -0
  5. package/components/index.d.ts +0 -1
  6. package/components/query-builder/src/query-builder.component.d.ts +3 -0
  7. package/components/table/src/components/action-menu/action-menu.d.ts +10 -0
  8. package/components/table/src/components/command/desktop-command.component.d.ts +1 -0
  9. package/components/table/src/table.component.d.ts +1 -1
  10. package/components/upload-file/src/upload-file.component.d.ts +1 -2
  11. package/fesm2022/sdcorejs-angular-components-data-state.mjs +2 -2
  12. package/fesm2022/sdcorejs-angular-components-data-state.mjs.map +1 -1
  13. package/fesm2022/sdcorejs-angular-components-form-generic.mjs +6 -6
  14. package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
  15. package/fesm2022/sdcorejs-angular-components-modal.mjs +2 -2
  16. package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
  17. package/fesm2022/sdcorejs-angular-components-query-builder.mjs +35 -2
  18. package/fesm2022/sdcorejs-angular-components-query-builder.mjs.map +1 -1
  19. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +2 -2
  20. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
  21. package/fesm2022/sdcorejs-angular-components-tab.mjs +2 -2
  22. package/fesm2022/sdcorejs-angular-components-tab.mjs.map +1 -1
  23. package/fesm2022/sdcorejs-angular-components-table.mjs +223 -84
  24. package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
  25. package/fesm2022/sdcorejs-angular-components-upload-file.mjs +2 -3
  26. package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
  27. package/fesm2022/sdcorejs-angular-components.mjs +0 -1
  28. package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
  29. package/fesm2022/sdcorejs-angular-directives.mjs +49 -11
  30. package/fesm2022/sdcorejs-angular-directives.mjs.map +1 -1
  31. package/fesm2022/sdcorejs-angular-forms-switch.mjs +4 -2
  32. package/fesm2022/sdcorejs-angular-forms-switch.mjs.map +1 -1
  33. package/fesm2022/sdcorejs-angular-i18n.mjs +5 -0
  34. package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
  35. package/fesm2022/sdcorejs-angular-modules-layout.mjs +54 -12
  36. package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
  37. package/fesm2022/sdcorejs-angular-services-loading.mjs +9 -4
  38. package/fesm2022/sdcorejs-angular-services-loading.mjs.map +1 -1
  39. package/forms/switch/src/switch.component.d.ts +3 -2
  40. package/i18n/src/en.d.ts +1 -0
  41. package/modules/layout/components/shared/menu-tree/menu-tree.component.d.ts +14 -1
  42. package/modules/layout/components/shared/search-field/search-field.component.d.ts +2 -1
  43. package/modules/layout/components/sidebar-v3/main.component.d.ts +1 -0
  44. package/package.json +1 -7
  45. package/components/chart/index.d.ts +0 -4
  46. package/components/chart/src/bar-chart.component.d.ts +0 -18
  47. package/components/chart/src/doughnut-chart.component.d.ts +0 -16
  48. package/components/chart/src/line-chart.component.d.ts +0 -18
  49. package/components/chart/src/pie-chart.component.d.ts +0 -16
  50. package/fesm2022/sdcorejs-angular-components-chart.mjs +0 -290
  51. package/fesm2022/sdcorejs-angular-components-chart.mjs.map +0 -1
package/README.md CHANGED
@@ -91,18 +91,20 @@ Replace the timer with your typed service call and reset `saving` in a `finally`
91
91
 
92
92
  | Area | Representative APIs |
93
93
  | ----------------- | ------------------------------------------------------------------------------------------------------------------------------- |
94
- | UI components | Navigation/data state, PDF preview, job progress, audit diff, modals, drawers, tabs, charts, editors, and document tooling |
94
+ | UI components | Navigation/data state, PDF preview, job progress, audit diff, modals, drawers, tabs, editors, and document tooling |
95
95
  | Data and workflow | Local/server tables, entity/tree pickers, query builders, unsaved-change guards, background tasks, upload, and Excel import |
96
96
  | Form controls | Text/mask, number, time/time range, date/date range, datetime, select, autocomplete, checkbox, radio, switch, chip, and color |
97
97
  | Services | Typed API/retry/cancel, ref-counted loading, graph-safe persistence/cache/storage, viewport signals, notifications, and exports |
98
98
  | Portal modules | Auth, Keycloak, permission, layout, and icon modules |
99
99
  | Localization | Built-in `vi`, `en`, `ja`, `ko`, and `zh` catalogs, plus a synchronous custom-catalog provider |
100
100
 
101
+ Charting libraries are selected, installed, and configured by the consuming application. Core UI does not bundle a chart engine; `sd-org-chart` remains available for organizational hierarchies.
102
+
101
103
  The [live showcase](https://sdcorejs.github.io/sdcorejs-angular/) demonstrates components, forms, and services. The [latest API manifest](https://sdcorejs.github.io/sdcorejs-angular/docs/latest/index.json) lists every published reference document without duplicating the full API here.
102
104
 
103
105
  ## Standalone and subpath imports
104
106
 
105
- Prefer public leaf entry points so dependencies stay explicit and unused entry points can be removed from the application graph. The package declares `sideEffects: false`.
107
+ Prefer public leaf entry points so dependencies stay explicit and unused entry points can be removed from the application graph. Stylesheets and editor registration entry points are retained as side effects.
106
108
 
107
109
  ```ts
108
110
  import { SdButton } from '@sdcorejs/angular/components/button';
@@ -39,6 +39,8 @@
39
39
 
40
40
  `sd-core.scss` là entry point duy nhất — auto-load reset, utilities, color theme, form overrides, scrollbar, Angular Material theme. Không cần import partial nào riêng lẻ.
41
41
 
42
+ Control `size="sm"` dùng khung 32px. Floating label ở trạng thái rỗng/chưa focus được căn giữa dòng đầu bằng style dùng chung, kể cả label có wrapper `sd-form-field-label`. Khi focus hoặc có giá trị, label vẫn nổi theo Angular Material; textarea nhiều dòng giữ label ở dòng đầu.
43
+
42
44
  > Convention chung: **mọi utility class đều có `!important`** để đảm bảo override được Angular Material (thường có specificity cao).
43
45
 
44
46
  ---
@@ -224,6 +224,12 @@
224
224
  --mat-form-field-container-height: 32px;
225
225
  --mat-form-field-container-vertical-padding: 3px;
226
226
 
227
+ // why: inline-flex + vertical-align: middle tạo khoảng baseline dưới label,
228
+ // khiến chữ thấp hơn tâm của field 32px. Flex block giữ nguyên transform float của Material.
229
+ .sd-form-field-label {
230
+ display: flex;
231
+ }
232
+
227
233
  &.mat-form-field-appearance-outline {
228
234
  .mat-mdc-form-field-infix {
229
235
  border-top-width: 6px;
@@ -150,6 +150,7 @@ export interface SdFormGenericGroup {
150
150
  properties: {
151
151
  icon: string;
152
152
  color: Color;
153
+ collapsible?: boolean;
153
154
  hidden?: boolean;
154
155
  hiddenWhenExpression?: SdFormGenericExpression;
155
156
  visibleWhenExpression?: SdFormGenericExpression;
@@ -22,7 +22,6 @@ export * from '@sdcorejs/angular/components/import-excel';
22
22
  export * from '@sdcorejs/angular/components/mini-editor';
23
23
  export * from '@sdcorejs/angular/components/view';
24
24
  export * from '@sdcorejs/angular/components/code-editor';
25
- export * from '@sdcorejs/angular/components/chart';
26
25
  export * from '@sdcorejs/angular/components/editor';
27
26
  export * from '@sdcorejs/angular/components/splitter';
28
27
  export * from '@sdcorejs/angular/components/preview';
@@ -1,3 +1,4 @@
1
+ import { ConnectedPosition } from '@angular/cdk/overlay';
1
2
  import { Filter, Operator } from '@sdcorejs/utils/models';
2
3
  import { sdIsQbGroup, SdQbComparisonMode, SdQbDateMode, SdQbGroup, SdQbRule, SdQbToken, SdQbValueSource, sdQbFieldIcon, SdQueryBuilderField, SdQueryBuilderFieldOption, SdQueryBuilderOption } from './query-builder.model';
3
4
  import * as i0 from "@angular/core";
@@ -10,6 +11,7 @@ import * as i0 from "@angular/core";
10
11
  */
11
12
  export declare class SdQueryBuilder {
12
13
  #private;
14
+ protected readonly addMenuPositions: ConnectedPosition[];
13
15
  /** Main option object. Prefer this API for new usage; individual inputs stay as a migration bridge. */
14
16
  readonly option: import("@angular/core").InputSignal<SdQueryBuilderOption | undefined>;
15
17
  /** Filterable fields — each declares a `type` that drives the operator set + value editor. */
@@ -80,6 +82,7 @@ export declare class SdQueryBuilder {
80
82
  /** Open this group's "+" menu (closing any other open one). UI-only — does not emit. */
81
83
  toggleDropdown(group: SdQbGroup, event: Event): void;
82
84
  closeAllDropdowns(): void;
85
+ protected onAddMenuKeydown(event: KeyboardEvent): void;
83
86
  /** Append a blank rule to `group`. */
84
87
  addRule(group: SdQbGroup): void;
85
88
  /** Append a nested sub-group (seeded with one blank rule) to `group`. */
@@ -0,0 +1,10 @@
1
+ import { ConnectedPosition } from '@angular/cdk/overlay';
2
+ import * as i0 from "@angular/core";
3
+ import * as i1 from "@angular/cdk/menu";
4
+ export declare const TABLE_ACTION_MENU_POSITIONS: ConnectedPosition[];
5
+ export declare class SdTableMenuButtonDirective {
6
+ #private;
7
+ constructor();
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<SdTableMenuButtonDirective, never>;
9
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SdTableMenuButtonDirective, "sd-button[sdTableMenuButton]", never, {}, {}, never, never, true, [{ directive: typeof i1.CdkMenuTrigger; inputs: { "cdkMenuTriggerFor": "sdTableMenuButton"; }; outputs: {}; }]>;
10
+ }
@@ -2,6 +2,7 @@ import { SdTableCommand } from '../../models/table-command.model';
2
2
  import { SdTableItem } from '../../models/table-item.model';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class DesktopCommand {
5
+ readonly menuPositions: import("@angular/cdk/overlay").ConnectedPosition[];
5
6
  readonly autoIdInput: import("@angular/core").InputSignal<string | null | undefined>;
6
7
  readonly item: import("@angular/core").InputSignal<SdTableItem<any>>;
7
8
  readonly itemIndex: import("@angular/core").InputSignal<number>;
@@ -140,7 +140,7 @@ export declare class SdTable<T = unknown> implements AfterViewInit, OnDestroy {
140
140
  ngAfterViewInit(): void;
141
141
  ngOnDestroy(): void;
142
142
  getFilterRequest: () => SdTableFilterRequest;
143
- /** Retry only the still-valid failed server request, without resetting filters or paging. */
143
+ /** Retry current hydration or the still-valid failed server request, without resetting filters or paging. */
144
144
  retryRead: () => Promise<void>;
145
145
  reload: (force?: boolean, scrollTop?: boolean) => Promise<void>;
146
146
  exportExcel: (columns?: SdExcelColumn[]) => void;
@@ -28,7 +28,6 @@ export declare class SdUploadFile<TArgs = unknown> {
28
28
  readonly label: import("@angular/core").InputSignal<string | undefined>;
29
29
  readonly key: import("@angular/core").InputSignal<string | undefined>;
30
30
  readonly description: import("@angular/core").InputSignal<string | undefined>;
31
- readonly appearance: import("@angular/core").InputSignal<"dropzone" | "compact">;
32
31
  readonly previewWidth: import("@angular/core").InputSignal<string>;
33
32
  readonly previewHeight: import("@angular/core").InputSignal<string>;
34
33
  readonly align: import("@angular/core").InputSignal<"left" | "center">;
@@ -90,5 +89,5 @@ export declare class SdUploadFile<TArgs = unknown> {
90
89
  onDownload: (previewFile: PreviewFile) => void;
91
90
  isLastVisibleOverlay(fileIndex: number): boolean;
92
91
  static ɵfac: i0.ɵɵFactoryDeclaration<SdUploadFile<any>, never>;
93
- static ɵcmp: i0.ɵɵComponentDeclaration<SdUploadFile<any>, "sd-upload-file", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "args": { "alias": "args"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "key": { "alias": "key"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "appearance": { "alias": "appearance"; "required": false; "isSignal": true; }; "previewWidth": { "alias": "previewWidth"; "required": false; "isSignal": true; }; "previewHeight": { "alias": "previewHeight"; "required": false; "isSignal": true; }; "align": { "alias": "align"; "required": false; "isSignal": true; }; "uploadInput": { "alias": "upload"; "required": false; "isSignal": true; }; "details": { "alias": "details"; "required": false; "isSignal": true; }; "downloadInput": { "alias": "download"; "required": false; "isSignal": true; }; "imageValidator": { "alias": "imageValidator"; "required": false; "isSignal": true; }; "maxSize": { "alias": "maxSize"; "required": false; "isSignal": true; }; "maxWidth": { "alias": "maxWidth"; "required": false; "isSignal": true; }; "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; "scaleToPixel": { "alias": "scaleToPixel"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; "nameInput": { "alias": "name"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "helperText": { "alias": "helperText"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "maxOfImage": { "alias": "maxOfImage"; "required": false; "isSignal": true; }; "extensions": { "alias": "extensions"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "model": { "alias": "model"; "required": false; "isSignal": true; }; }, { "loaded": "loaded"; "filesChanged": "filesChanged"; "model": "modelChange"; }, ["sdLabelDef"], never, true, never>;
92
+ static ɵcmp: i0.ɵɵComponentDeclaration<SdUploadFile<any>, "sd-upload-file", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "args": { "alias": "args"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "key": { "alias": "key"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "previewWidth": { "alias": "previewWidth"; "required": false; "isSignal": true; }; "previewHeight": { "alias": "previewHeight"; "required": false; "isSignal": true; }; "align": { "alias": "align"; "required": false; "isSignal": true; }; "uploadInput": { "alias": "upload"; "required": false; "isSignal": true; }; "details": { "alias": "details"; "required": false; "isSignal": true; }; "downloadInput": { "alias": "download"; "required": false; "isSignal": true; }; "imageValidator": { "alias": "imageValidator"; "required": false; "isSignal": true; }; "maxSize": { "alias": "maxSize"; "required": false; "isSignal": true; }; "maxWidth": { "alias": "maxWidth"; "required": false; "isSignal": true; }; "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; "scaleToPixel": { "alias": "scaleToPixel"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; "nameInput": { "alias": "name"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "helperText": { "alias": "helperText"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "maxOfImage": { "alias": "maxOfImage"; "required": false; "isSignal": true; }; "extensions": { "alias": "extensions"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "model": { "alias": "model"; "required": false; "isSignal": true; }; }, { "loaded": "loaded"; "filesChanged": "filesChanged"; "model": "modelChange"; }, ["sdLabelDef"], never, true, never>;
94
93
  }
@@ -54,11 +54,11 @@ class SdDataState {
54
54
  action: this.action,
55
55
  }));
56
56
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdDataState, deps: [], target: i0.ɵɵFactoryTarget.Component });
57
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: SdDataState, isStandalone: true, selector: "sd-data-state", inputs: { state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, fontSet: { classPropertyName: "fontSet", publicName: "fontSet", isSignal: true, isRequired: false, transformFunction: null }, retryable: { classPropertyName: "retryable", publicName: "retryable", isSignal: true, isRequired: false, transformFunction: null }, retryLabel: { classPropertyName: "retryLabel", publicName: "retryLabel", isSignal: true, isRequired: false, transformFunction: null }, actionLabel: { classPropertyName: "actionLabel", publicName: "actionLabel", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, fullPage: { classPropertyName: "fullPage", publicName: "fullPage", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sdRetry: "sdRetry", sdAction: "sdAction" }, queries: [{ propertyName: "customTemplate", first: true, predicate: SdDataStateTemplateDirective, descendants: true, isSignal: true }], ngImport: i0, template: "@let _compact = compact();\n@let currentState = state();\n@let template = customTemplate();\n@let _role = role();\n@let _retryable = retryable();\n@let _actionLabel = actionLabel();\n@let currentIcon = effectiveIcon();\n\n@if (currentState === 'success') {\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template.template\" [ngTemplateOutletContext]=\"templateContext()\"></ng-container>\n } @else {\n <ng-content></ng-content>\n }\n} @else if (template) {\n <ng-container [ngTemplateOutlet]=\"template.template\" [ngTemplateOutletContext]=\"templateContext()\"></ng-container>\n} @else {\n <section\n class=\"sd-data-state\"\n [class.sd-data-state--compact]=\"_compact\"\n [class.sd-data-state--full-page]=\"fullPage()\"\n [class.sd-data-state--with-icon]=\"!!currentIcon\"\n [attr.data-state]=\"currentState\"\n [attr.role]=\"_role\"\n [attr.aria-busy]=\"currentState === 'loading' ? 'true' : null\"\n [attr.aria-live]=\"_role === 'alert' ? 'assertive' : 'polite'\">\n @if (currentIcon) {\n <span class=\"sd-data-state__symbol\" aria-hidden=\"true\">\n <sd-icon class=\"sd-data-state__icon\" [name]=\"currentIcon\" [fontSet]=\"fontSet()\" [size]=\"_compact ? '22px' : '32px'\"></sd-icon>\n </span>\n }\n\n <div class=\"sd-data-state__title\">{{ title() ?? (titleKey() | sdTranslate) }}</div>\n <div class=\"sd-data-state__message\">{{ message() ?? (messageKey() | sdTranslate) }}</div>\n\n @if (_retryable || _actionLabel) {\n <div class=\"sd-data-state__actions\">\n @if (_retryable) {\n <sd-button\n data-state-retry\n type=\"light\"\n color=\"primary\"\n size=\"sm\"\n htmlType=\"button\"\n width=\"100%\"\n prefixIcon=\"refresh\"\n fontSet=\"material-icons-outlined\"\n [title]=\"retryLabel() || ('core.component.data-state.retry' | sdTranslate)\"\n (click)=\"retry()\"></sd-button>\n }\n @if (_actionLabel; as label) {\n <sd-button\n data-state-action\n type=\"fill\"\n color=\"primary\"\n size=\"sm\"\n htmlType=\"button\"\n width=\"100%\"\n [title]=\"label\"\n (click)=\"action()\"></sd-button>\n }\n </div>\n }\n </section>\n}\n", styles: [":host{display:contents}.sd-data-state{box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;min-width:0;min-height:240px;padding:32px;text-align:center;color:var(--sd-text)}.sd-data-state__symbol{display:grid;place-items:center;flex-shrink:0;width:56px;height:56px;margin-bottom:16px;border-radius:50%;background:var(--sd-surface-muted)}.sd-data-state__icon{width:32px;height:32px;font-size:32px;line-height:1;color:var(--sd-text-secondary)}.sd-data-state[data-state=error] .sd-data-state__symbol,.sd-data-state[data-state=forbidden] .sd-data-state__symbol{background:color-mix(in srgb,var(--sd-error-light) 40%,transparent)}.sd-data-state[data-state=error] .sd-data-state__icon,.sd-data-state[data-state=forbidden] .sd-data-state__icon{color:var(--sd-error)}.sd-data-state[data-state=loading] .sd-data-state__icon{color:var(--sd-primary);animation:sd-data-state-spin 1s linear infinite}.sd-data-state[data-state=loading] .sd-data-state__symbol{background:var(--sd-primary-light)}.sd-data-state[data-state=empty] .sd-data-state__symbol{background:var(--sd-warning-light)}.sd-data-state[data-state=empty] .sd-data-state__icon{color:var(--sd-warning-dark)}.sd-data-state__title{max-width:100%;font-size:16px;font-weight:600;line-height:24px;overflow-wrap:anywhere}.sd-data-state__message{max-width:440px;margin-top:4px;color:var(--sd-text-secondary);font-size:14px;line-height:22px;overflow-wrap:anywhere}.sd-data-state__message:empty,.sd-data-state__title:empty{display:none}.sd-data-state__actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px;max-width:100%;margin-top:16px}.sd-data-state__actions sd-button{min-width:0;max-width:100%}.sd-data-state--compact{display:grid;grid-template-columns:minmax(0,1fr);align-content:center;align-items:start;column-gap:12px;min-height:120px;padding:16px;text-align:start}.sd-data-state--compact.sd-data-state--with-icon{grid-template-columns:32px minmax(0,1fr)}.sd-data-state--compact .sd-data-state__symbol{grid-column:1;grid-row:1/span 2;width:32px;height:32px;margin:0}.sd-data-state--compact .sd-data-state__icon{width:22px;height:22px;font-size:22px}.sd-data-state--compact .sd-data-state__title,.sd-data-state--compact .sd-data-state__message,.sd-data-state--compact .sd-data-state__actions{grid-column:-2}.sd-data-state--compact .sd-data-state__title{font-size:14px;line-height:20px}.sd-data-state--compact .sd-data-state__message{margin-top:2px;font-size:13px;line-height:20px}.sd-data-state--compact .sd-data-state__actions{justify-content:flex-start;margin-top:10px}.sd-data-state--full-page{min-height:100dvh}@keyframes sd-data-state-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.sd-data-state[data-state=loading] .sd-data-state__icon{animation:none}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "loading", "block", "htmlType"], outputs: ["click"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
57
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: SdDataState, isStandalone: true, selector: "sd-data-state", inputs: { state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, fontSet: { classPropertyName: "fontSet", publicName: "fontSet", isSignal: true, isRequired: false, transformFunction: null }, retryable: { classPropertyName: "retryable", publicName: "retryable", isSignal: true, isRequired: false, transformFunction: null }, retryLabel: { classPropertyName: "retryLabel", publicName: "retryLabel", isSignal: true, isRequired: false, transformFunction: null }, actionLabel: { classPropertyName: "actionLabel", publicName: "actionLabel", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, fullPage: { classPropertyName: "fullPage", publicName: "fullPage", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sdRetry: "sdRetry", sdAction: "sdAction" }, queries: [{ propertyName: "customTemplate", first: true, predicate: SdDataStateTemplateDirective, descendants: true, isSignal: true }], ngImport: i0, template: "@let _compact = compact();\n@let currentState = state();\n@let template = customTemplate();\n@let _role = role();\n@let _retryable = retryable();\n@let _actionLabel = actionLabel();\n@let currentIcon = effectiveIcon();\n\n@if (currentState === 'success') {\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template.template\" [ngTemplateOutletContext]=\"templateContext()\"></ng-container>\n } @else {\n <ng-content></ng-content>\n }\n} @else if (template) {\n <ng-container [ngTemplateOutlet]=\"template.template\" [ngTemplateOutletContext]=\"templateContext()\"></ng-container>\n} @else {\n <section\n class=\"sd-data-state\"\n [class.sd-data-state--compact]=\"_compact\"\n [class.sd-data-state--full-page]=\"fullPage()\"\n [class.sd-data-state--with-icon]=\"!!currentIcon\"\n [attr.data-state]=\"currentState\"\n [attr.role]=\"_role\"\n [attr.aria-busy]=\"currentState === 'loading' ? 'true' : null\"\n [attr.aria-live]=\"_role === 'alert' ? 'assertive' : 'polite'\">\n @if (currentIcon) {\n <span class=\"sd-data-state__symbol\" aria-hidden=\"true\">\n <sd-icon class=\"sd-data-state__icon\" [name]=\"currentIcon\" [fontSet]=\"fontSet()\" [size]=\"_compact ? '22px' : '32px'\"></sd-icon>\n </span>\n }\n\n <div class=\"sd-data-state__title\">{{ title() ?? (titleKey() | sdTranslate) }}</div>\n <div class=\"sd-data-state__message\">{{ message() ?? (messageKey() | sdTranslate) }}</div>\n\n @if (_retryable || _actionLabel) {\n <div class=\"sd-data-state__actions\">\n @if (_retryable) {\n <sd-button\n data-state-retry\n type=\"light\"\n color=\"primary\"\n size=\"sm\"\n htmlType=\"button\"\n width=\"100%\"\n prefixIcon=\"refresh\"\n fontSet=\"material-icons-outlined\"\n [title]=\"retryLabel() || ('core.component.data-state.retry' | sdTranslate)\"\n (click)=\"retry()\"></sd-button>\n }\n @if (_actionLabel; as label) {\n <sd-button\n data-state-action\n type=\"fill\"\n color=\"primary\"\n size=\"sm\"\n htmlType=\"button\"\n width=\"100%\"\n [title]=\"label\"\n (click)=\"action()\"></sd-button>\n }\n </div>\n }\n </section>\n}\n", styles: [":host{display:contents}.sd-data-state{box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;min-width:0;min-height:240px;padding:32px;text-align:center;color:var(--sd-text)}.sd-data-state__symbol{display:grid;place-items:center;flex-shrink:0;width:56px;height:56px;margin-bottom:16px;border-radius:50%;background:var(--sd-surface-muted)}.sd-data-state__icon{width:32px;height:32px;font-size:32px;line-height:1;color:var(--sd-text-secondary)}.sd-data-state[data-state=error] .sd-data-state__symbol,.sd-data-state[data-state=forbidden] .sd-data-state__symbol{background:color-mix(in srgb,var(--sd-error-light) 40%,transparent)}.sd-data-state[data-state=error] .sd-data-state__icon,.sd-data-state[data-state=forbidden] .sd-data-state__icon{color:var(--sd-error)}.sd-data-state[data-state=loading] .sd-data-state__icon{color:var(--sd-primary);animation:sd-data-state-spin 1s linear infinite}.sd-data-state[data-state=loading] .sd-data-state__symbol{background:var(--sd-primary-light)}.sd-data-state__title{max-width:100%;font-size:16px;font-weight:600;line-height:24px;overflow-wrap:anywhere}.sd-data-state__message{max-width:440px;margin-top:4px;color:var(--sd-text-secondary);font-size:14px;line-height:22px;overflow-wrap:anywhere}.sd-data-state__message:empty,.sd-data-state__title:empty{display:none}.sd-data-state__actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px;max-width:100%;margin-top:16px}.sd-data-state__actions sd-button{min-width:0;max-width:100%}.sd-data-state--compact{display:grid;grid-template-columns:minmax(0,1fr);align-content:center;align-items:start;column-gap:12px;min-height:120px;padding:16px;text-align:start}.sd-data-state--compact.sd-data-state--with-icon{grid-template-columns:32px minmax(0,1fr)}.sd-data-state--compact .sd-data-state__symbol{grid-column:1;grid-row:1/span 2;width:32px;height:32px;margin:0}.sd-data-state--compact .sd-data-state__icon{width:22px;height:22px;font-size:22px}.sd-data-state--compact .sd-data-state__title,.sd-data-state--compact .sd-data-state__message,.sd-data-state--compact .sd-data-state__actions{grid-column:-2}.sd-data-state--compact .sd-data-state__title{font-size:14px;line-height:20px}.sd-data-state--compact .sd-data-state__message{margin-top:2px;font-size:13px;line-height:20px}.sd-data-state--compact .sd-data-state__actions{justify-content:flex-start;margin-top:10px}.sd-data-state--full-page{min-height:100dvh}@keyframes sd-data-state-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.sd-data-state[data-state=loading] .sd-data-state__icon{animation:none}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "loading", "block", "htmlType"], outputs: ["click"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
58
58
  }
59
59
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdDataState, decorators: [{
60
60
  type: Component,
61
- args: [{ selector: 'sd-data-state', standalone: true, imports: [NgTemplateOutlet, SdTranslatePipe, SdIcon, SdButton], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let _compact = compact();\n@let currentState = state();\n@let template = customTemplate();\n@let _role = role();\n@let _retryable = retryable();\n@let _actionLabel = actionLabel();\n@let currentIcon = effectiveIcon();\n\n@if (currentState === 'success') {\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template.template\" [ngTemplateOutletContext]=\"templateContext()\"></ng-container>\n } @else {\n <ng-content></ng-content>\n }\n} @else if (template) {\n <ng-container [ngTemplateOutlet]=\"template.template\" [ngTemplateOutletContext]=\"templateContext()\"></ng-container>\n} @else {\n <section\n class=\"sd-data-state\"\n [class.sd-data-state--compact]=\"_compact\"\n [class.sd-data-state--full-page]=\"fullPage()\"\n [class.sd-data-state--with-icon]=\"!!currentIcon\"\n [attr.data-state]=\"currentState\"\n [attr.role]=\"_role\"\n [attr.aria-busy]=\"currentState === 'loading' ? 'true' : null\"\n [attr.aria-live]=\"_role === 'alert' ? 'assertive' : 'polite'\">\n @if (currentIcon) {\n <span class=\"sd-data-state__symbol\" aria-hidden=\"true\">\n <sd-icon class=\"sd-data-state__icon\" [name]=\"currentIcon\" [fontSet]=\"fontSet()\" [size]=\"_compact ? '22px' : '32px'\"></sd-icon>\n </span>\n }\n\n <div class=\"sd-data-state__title\">{{ title() ?? (titleKey() | sdTranslate) }}</div>\n <div class=\"sd-data-state__message\">{{ message() ?? (messageKey() | sdTranslate) }}</div>\n\n @if (_retryable || _actionLabel) {\n <div class=\"sd-data-state__actions\">\n @if (_retryable) {\n <sd-button\n data-state-retry\n type=\"light\"\n color=\"primary\"\n size=\"sm\"\n htmlType=\"button\"\n width=\"100%\"\n prefixIcon=\"refresh\"\n fontSet=\"material-icons-outlined\"\n [title]=\"retryLabel() || ('core.component.data-state.retry' | sdTranslate)\"\n (click)=\"retry()\"></sd-button>\n }\n @if (_actionLabel; as label) {\n <sd-button\n data-state-action\n type=\"fill\"\n color=\"primary\"\n size=\"sm\"\n htmlType=\"button\"\n width=\"100%\"\n [title]=\"label\"\n (click)=\"action()\"></sd-button>\n }\n </div>\n }\n </section>\n}\n", styles: [":host{display:contents}.sd-data-state{box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;min-width:0;min-height:240px;padding:32px;text-align:center;color:var(--sd-text)}.sd-data-state__symbol{display:grid;place-items:center;flex-shrink:0;width:56px;height:56px;margin-bottom:16px;border-radius:50%;background:var(--sd-surface-muted)}.sd-data-state__icon{width:32px;height:32px;font-size:32px;line-height:1;color:var(--sd-text-secondary)}.sd-data-state[data-state=error] .sd-data-state__symbol,.sd-data-state[data-state=forbidden] .sd-data-state__symbol{background:color-mix(in srgb,var(--sd-error-light) 40%,transparent)}.sd-data-state[data-state=error] .sd-data-state__icon,.sd-data-state[data-state=forbidden] .sd-data-state__icon{color:var(--sd-error)}.sd-data-state[data-state=loading] .sd-data-state__icon{color:var(--sd-primary);animation:sd-data-state-spin 1s linear infinite}.sd-data-state[data-state=loading] .sd-data-state__symbol{background:var(--sd-primary-light)}.sd-data-state[data-state=empty] .sd-data-state__symbol{background:var(--sd-warning-light)}.sd-data-state[data-state=empty] .sd-data-state__icon{color:var(--sd-warning-dark)}.sd-data-state__title{max-width:100%;font-size:16px;font-weight:600;line-height:24px;overflow-wrap:anywhere}.sd-data-state__message{max-width:440px;margin-top:4px;color:var(--sd-text-secondary);font-size:14px;line-height:22px;overflow-wrap:anywhere}.sd-data-state__message:empty,.sd-data-state__title:empty{display:none}.sd-data-state__actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px;max-width:100%;margin-top:16px}.sd-data-state__actions sd-button{min-width:0;max-width:100%}.sd-data-state--compact{display:grid;grid-template-columns:minmax(0,1fr);align-content:center;align-items:start;column-gap:12px;min-height:120px;padding:16px;text-align:start}.sd-data-state--compact.sd-data-state--with-icon{grid-template-columns:32px minmax(0,1fr)}.sd-data-state--compact .sd-data-state__symbol{grid-column:1;grid-row:1/span 2;width:32px;height:32px;margin:0}.sd-data-state--compact .sd-data-state__icon{width:22px;height:22px;font-size:22px}.sd-data-state--compact .sd-data-state__title,.sd-data-state--compact .sd-data-state__message,.sd-data-state--compact .sd-data-state__actions{grid-column:-2}.sd-data-state--compact .sd-data-state__title{font-size:14px;line-height:20px}.sd-data-state--compact .sd-data-state__message{margin-top:2px;font-size:13px;line-height:20px}.sd-data-state--compact .sd-data-state__actions{justify-content:flex-start;margin-top:10px}.sd-data-state--full-page{min-height:100dvh}@keyframes sd-data-state-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.sd-data-state[data-state=loading] .sd-data-state__icon{animation:none}}\n"] }]
61
+ args: [{ selector: 'sd-data-state', standalone: true, imports: [NgTemplateOutlet, SdTranslatePipe, SdIcon, SdButton], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let _compact = compact();\n@let currentState = state();\n@let template = customTemplate();\n@let _role = role();\n@let _retryable = retryable();\n@let _actionLabel = actionLabel();\n@let currentIcon = effectiveIcon();\n\n@if (currentState === 'success') {\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template.template\" [ngTemplateOutletContext]=\"templateContext()\"></ng-container>\n } @else {\n <ng-content></ng-content>\n }\n} @else if (template) {\n <ng-container [ngTemplateOutlet]=\"template.template\" [ngTemplateOutletContext]=\"templateContext()\"></ng-container>\n} @else {\n <section\n class=\"sd-data-state\"\n [class.sd-data-state--compact]=\"_compact\"\n [class.sd-data-state--full-page]=\"fullPage()\"\n [class.sd-data-state--with-icon]=\"!!currentIcon\"\n [attr.data-state]=\"currentState\"\n [attr.role]=\"_role\"\n [attr.aria-busy]=\"currentState === 'loading' ? 'true' : null\"\n [attr.aria-live]=\"_role === 'alert' ? 'assertive' : 'polite'\">\n @if (currentIcon) {\n <span class=\"sd-data-state__symbol\" aria-hidden=\"true\">\n <sd-icon class=\"sd-data-state__icon\" [name]=\"currentIcon\" [fontSet]=\"fontSet()\" [size]=\"_compact ? '22px' : '32px'\"></sd-icon>\n </span>\n }\n\n <div class=\"sd-data-state__title\">{{ title() ?? (titleKey() | sdTranslate) }}</div>\n <div class=\"sd-data-state__message\">{{ message() ?? (messageKey() | sdTranslate) }}</div>\n\n @if (_retryable || _actionLabel) {\n <div class=\"sd-data-state__actions\">\n @if (_retryable) {\n <sd-button\n data-state-retry\n type=\"light\"\n color=\"primary\"\n size=\"sm\"\n htmlType=\"button\"\n width=\"100%\"\n prefixIcon=\"refresh\"\n fontSet=\"material-icons-outlined\"\n [title]=\"retryLabel() || ('core.component.data-state.retry' | sdTranslate)\"\n (click)=\"retry()\"></sd-button>\n }\n @if (_actionLabel; as label) {\n <sd-button\n data-state-action\n type=\"fill\"\n color=\"primary\"\n size=\"sm\"\n htmlType=\"button\"\n width=\"100%\"\n [title]=\"label\"\n (click)=\"action()\"></sd-button>\n }\n </div>\n }\n </section>\n}\n", styles: [":host{display:contents}.sd-data-state{box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;min-width:0;min-height:240px;padding:32px;text-align:center;color:var(--sd-text)}.sd-data-state__symbol{display:grid;place-items:center;flex-shrink:0;width:56px;height:56px;margin-bottom:16px;border-radius:50%;background:var(--sd-surface-muted)}.sd-data-state__icon{width:32px;height:32px;font-size:32px;line-height:1;color:var(--sd-text-secondary)}.sd-data-state[data-state=error] .sd-data-state__symbol,.sd-data-state[data-state=forbidden] .sd-data-state__symbol{background:color-mix(in srgb,var(--sd-error-light) 40%,transparent)}.sd-data-state[data-state=error] .sd-data-state__icon,.sd-data-state[data-state=forbidden] .sd-data-state__icon{color:var(--sd-error)}.sd-data-state[data-state=loading] .sd-data-state__icon{color:var(--sd-primary);animation:sd-data-state-spin 1s linear infinite}.sd-data-state[data-state=loading] .sd-data-state__symbol{background:var(--sd-primary-light)}.sd-data-state__title{max-width:100%;font-size:16px;font-weight:600;line-height:24px;overflow-wrap:anywhere}.sd-data-state__message{max-width:440px;margin-top:4px;color:var(--sd-text-secondary);font-size:14px;line-height:22px;overflow-wrap:anywhere}.sd-data-state__message:empty,.sd-data-state__title:empty{display:none}.sd-data-state__actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px;max-width:100%;margin-top:16px}.sd-data-state__actions sd-button{min-width:0;max-width:100%}.sd-data-state--compact{display:grid;grid-template-columns:minmax(0,1fr);align-content:center;align-items:start;column-gap:12px;min-height:120px;padding:16px;text-align:start}.sd-data-state--compact.sd-data-state--with-icon{grid-template-columns:32px minmax(0,1fr)}.sd-data-state--compact .sd-data-state__symbol{grid-column:1;grid-row:1/span 2;width:32px;height:32px;margin:0}.sd-data-state--compact .sd-data-state__icon{width:22px;height:22px;font-size:22px}.sd-data-state--compact .sd-data-state__title,.sd-data-state--compact .sd-data-state__message,.sd-data-state--compact .sd-data-state__actions{grid-column:-2}.sd-data-state--compact .sd-data-state__title{font-size:14px;line-height:20px}.sd-data-state--compact .sd-data-state__message{margin-top:2px;font-size:13px;line-height:20px}.sd-data-state--compact .sd-data-state__actions{justify-content:flex-start;margin-top:10px}.sd-data-state--full-page{min-height:100dvh}@keyframes sd-data-state-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.sd-data-state[data-state=loading] .sd-data-state__icon{animation:none}}\n"] }]
62
62
  }] });
63
63
 
64
64
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sdcorejs-angular-components-data-state.mjs","sources":["../../../projects/sdcorejs-angular/components/data-state/src/data-state.component.ts","../../../projects/sdcorejs-angular/components/data-state/src/data-state.component.html","../../../projects/sdcorejs-angular/components/data-state/sdcorejs-angular-components-data-state.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n Directive,\n TemplateRef,\n booleanAttribute,\n computed,\n contentChild,\n inject,\n input,\n output,\n} from '@angular/core';\nimport { SdTranslatePipe } from '@sdcorejs/angular/i18n';\nimport { SdButton } from '@sdcorejs/angular/components/button';\nimport { SdIcon, SdIconSet } from '@sdcorejs/angular/modules/icon';\n\nexport type SdDataStateKind = 'loading' | 'empty' | 'error' | 'forbidden' | 'success';\n\nexport interface SdDataStateTemplateContext {\n readonly $implicit: SdDataStateKind;\n readonly state: SdDataStateKind;\n readonly retry: () => void;\n readonly action: () => void;\n}\n\n@Directive({\n selector: 'ng-template[sdDataStateTemplate]',\n standalone: true,\n})\nexport class SdDataStateTemplateDirective {\n readonly template = inject<TemplateRef<SdDataStateTemplateContext>>(TemplateRef);\n\n static ngTemplateContextGuard(_directive: SdDataStateTemplateDirective, _context: unknown): _context is SdDataStateTemplateContext {\n return true;\n }\n}\n\nconst DEFAULT_ICON: Readonly<Record<SdDataStateKind, string | null>> = {\n loading: 'autorenew',\n empty: 'inbox',\n error: 'error_outline',\n forbidden: 'lock',\n success: null,\n};\n\n@Component({\n selector: 'sd-data-state',\n standalone: true,\n imports: [NgTemplateOutlet, SdTranslatePipe, SdIcon, SdButton],\n templateUrl: './data-state.component.html',\n styleUrl: './data-state.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SdDataState {\n readonly state = input<SdDataStateKind>('success');\n readonly title = input<string | null | undefined>();\n readonly message = input<string | null | undefined>();\n readonly icon = input<string | null | undefined>();\n readonly fontSet = input<SdIconSet | undefined>();\n readonly retryable = input(false, { transform: booleanAttribute });\n readonly retryLabel = input<string | null | undefined>();\n readonly actionLabel = input<string | null | undefined>();\n readonly compact = input(false, { transform: booleanAttribute });\n readonly fullPage = input(false, { transform: booleanAttribute });\n readonly sdRetry = output<void>();\n readonly sdAction = output<void>();\n\n protected readonly customTemplate = contentChild(SdDataStateTemplateDirective);\n protected readonly effectiveIcon = computed(() => this.icon() ?? DEFAULT_ICON[this.state()]);\n protected readonly titleKey = computed(() => `core.component.data-state.${this.state()}.title`);\n protected readonly messageKey = computed(() => `core.component.data-state.${this.state()}.message`);\n protected readonly role = computed<'alert' | 'status'>(() =>\n this.state() === 'error' || this.state() === 'forbidden' ? 'alert' : 'status'\n );\n\n protected readonly retry = (): void => this.sdRetry.emit();\n protected readonly action = (): void => this.sdAction.emit();\n protected readonly templateContext = computed<SdDataStateTemplateContext>(() => ({\n $implicit: this.state(),\n state: this.state(),\n retry: this.retry,\n action: this.action,\n }));\n}\n","@let _compact = compact();\n@let currentState = state();\n@let template = customTemplate();\n@let _role = role();\n@let _retryable = retryable();\n@let _actionLabel = actionLabel();\n@let currentIcon = effectiveIcon();\n\n@if (currentState === 'success') {\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template.template\" [ngTemplateOutletContext]=\"templateContext()\"></ng-container>\n } @else {\n <ng-content></ng-content>\n }\n} @else if (template) {\n <ng-container [ngTemplateOutlet]=\"template.template\" [ngTemplateOutletContext]=\"templateContext()\"></ng-container>\n} @else {\n <section\n class=\"sd-data-state\"\n [class.sd-data-state--compact]=\"_compact\"\n [class.sd-data-state--full-page]=\"fullPage()\"\n [class.sd-data-state--with-icon]=\"!!currentIcon\"\n [attr.data-state]=\"currentState\"\n [attr.role]=\"_role\"\n [attr.aria-busy]=\"currentState === 'loading' ? 'true' : null\"\n [attr.aria-live]=\"_role === 'alert' ? 'assertive' : 'polite'\">\n @if (currentIcon) {\n <span class=\"sd-data-state__symbol\" aria-hidden=\"true\">\n <sd-icon class=\"sd-data-state__icon\" [name]=\"currentIcon\" [fontSet]=\"fontSet()\" [size]=\"_compact ? '22px' : '32px'\"></sd-icon>\n </span>\n }\n\n <div class=\"sd-data-state__title\">{{ title() ?? (titleKey() | sdTranslate) }}</div>\n <div class=\"sd-data-state__message\">{{ message() ?? (messageKey() | sdTranslate) }}</div>\n\n @if (_retryable || _actionLabel) {\n <div class=\"sd-data-state__actions\">\n @if (_retryable) {\n <sd-button\n data-state-retry\n type=\"light\"\n color=\"primary\"\n size=\"sm\"\n htmlType=\"button\"\n width=\"100%\"\n prefixIcon=\"refresh\"\n fontSet=\"material-icons-outlined\"\n [title]=\"retryLabel() || ('core.component.data-state.retry' | sdTranslate)\"\n (click)=\"retry()\"></sd-button>\n }\n @if (_actionLabel; as label) {\n <sd-button\n data-state-action\n type=\"fill\"\n color=\"primary\"\n size=\"sm\"\n htmlType=\"button\"\n width=\"100%\"\n [title]=\"label\"\n (click)=\"action()\"></sd-button>\n }\n </div>\n }\n </section>\n}\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EAAA,UAAA,EAAA,SAAA,EAAA,OAAA,EAAA,UAAA,CAAA,EAAA,OAAA,EAAA,CAAA,OAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAKlD,WAAW,EAAA,UAAA,EAAA,CAAA;kBARvB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,EAAA,UAAA,EACb,IAAI,EAAA,OAAA,EACP,CAAC,gBAAgB,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAA,eAAA,EAG7C,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,s0EAAA,EAAA,MAAA,EAAA,CAAA,qwFAAA,CAAA,EAAA;;;AEpDjD;;AAEG;;;;"}
1
+ {"version":3,"file":"sdcorejs-angular-components-data-state.mjs","sources":["../../../projects/sdcorejs-angular/components/data-state/src/data-state.component.ts","../../../projects/sdcorejs-angular/components/data-state/src/data-state.component.html","../../../projects/sdcorejs-angular/components/data-state/sdcorejs-angular-components-data-state.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n Directive,\n TemplateRef,\n booleanAttribute,\n computed,\n contentChild,\n inject,\n input,\n output,\n} from '@angular/core';\nimport { SdTranslatePipe } from '@sdcorejs/angular/i18n';\nimport { SdButton } from '@sdcorejs/angular/components/button';\nimport { SdIcon, SdIconSet } from '@sdcorejs/angular/modules/icon';\n\nexport type SdDataStateKind = 'loading' | 'empty' | 'error' | 'forbidden' | 'success';\n\nexport interface SdDataStateTemplateContext {\n readonly $implicit: SdDataStateKind;\n readonly state: SdDataStateKind;\n readonly retry: () => void;\n readonly action: () => void;\n}\n\n@Directive({\n selector: 'ng-template[sdDataStateTemplate]',\n standalone: true,\n})\nexport class SdDataStateTemplateDirective {\n readonly template = inject<TemplateRef<SdDataStateTemplateContext>>(TemplateRef);\n\n static ngTemplateContextGuard(_directive: SdDataStateTemplateDirective, _context: unknown): _context is SdDataStateTemplateContext {\n return true;\n }\n}\n\nconst DEFAULT_ICON: Readonly<Record<SdDataStateKind, string | null>> = {\n loading: 'autorenew',\n empty: 'inbox',\n error: 'error_outline',\n forbidden: 'lock',\n success: null,\n};\n\n@Component({\n selector: 'sd-data-state',\n standalone: true,\n imports: [NgTemplateOutlet, SdTranslatePipe, SdIcon, SdButton],\n templateUrl: './data-state.component.html',\n styleUrl: './data-state.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SdDataState {\n readonly state = input<SdDataStateKind>('success');\n readonly title = input<string | null | undefined>();\n readonly message = input<string | null | undefined>();\n readonly icon = input<string | null | undefined>();\n readonly fontSet = input<SdIconSet | undefined>();\n readonly retryable = input(false, { transform: booleanAttribute });\n readonly retryLabel = input<string | null | undefined>();\n readonly actionLabel = input<string | null | undefined>();\n readonly compact = input(false, { transform: booleanAttribute });\n readonly fullPage = input(false, { transform: booleanAttribute });\n readonly sdRetry = output<void>();\n readonly sdAction = output<void>();\n\n protected readonly customTemplate = contentChild(SdDataStateTemplateDirective);\n protected readonly effectiveIcon = computed(() => this.icon() ?? DEFAULT_ICON[this.state()]);\n protected readonly titleKey = computed(() => `core.component.data-state.${this.state()}.title`);\n protected readonly messageKey = computed(() => `core.component.data-state.${this.state()}.message`);\n protected readonly role = computed<'alert' | 'status'>(() =>\n this.state() === 'error' || this.state() === 'forbidden' ? 'alert' : 'status'\n );\n\n protected readonly retry = (): void => this.sdRetry.emit();\n protected readonly action = (): void => this.sdAction.emit();\n protected readonly templateContext = computed<SdDataStateTemplateContext>(() => ({\n $implicit: this.state(),\n state: this.state(),\n retry: this.retry,\n action: this.action,\n }));\n}\n","@let _compact = compact();\n@let currentState = state();\n@let template = customTemplate();\n@let _role = role();\n@let _retryable = retryable();\n@let _actionLabel = actionLabel();\n@let currentIcon = effectiveIcon();\n\n@if (currentState === 'success') {\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template.template\" [ngTemplateOutletContext]=\"templateContext()\"></ng-container>\n } @else {\n <ng-content></ng-content>\n }\n} @else if (template) {\n <ng-container [ngTemplateOutlet]=\"template.template\" [ngTemplateOutletContext]=\"templateContext()\"></ng-container>\n} @else {\n <section\n class=\"sd-data-state\"\n [class.sd-data-state--compact]=\"_compact\"\n [class.sd-data-state--full-page]=\"fullPage()\"\n [class.sd-data-state--with-icon]=\"!!currentIcon\"\n [attr.data-state]=\"currentState\"\n [attr.role]=\"_role\"\n [attr.aria-busy]=\"currentState === 'loading' ? 'true' : null\"\n [attr.aria-live]=\"_role === 'alert' ? 'assertive' : 'polite'\">\n @if (currentIcon) {\n <span class=\"sd-data-state__symbol\" aria-hidden=\"true\">\n <sd-icon class=\"sd-data-state__icon\" [name]=\"currentIcon\" [fontSet]=\"fontSet()\" [size]=\"_compact ? '22px' : '32px'\"></sd-icon>\n </span>\n }\n\n <div class=\"sd-data-state__title\">{{ title() ?? (titleKey() | sdTranslate) }}</div>\n <div class=\"sd-data-state__message\">{{ message() ?? (messageKey() | sdTranslate) }}</div>\n\n @if (_retryable || _actionLabel) {\n <div class=\"sd-data-state__actions\">\n @if (_retryable) {\n <sd-button\n data-state-retry\n type=\"light\"\n color=\"primary\"\n size=\"sm\"\n htmlType=\"button\"\n width=\"100%\"\n prefixIcon=\"refresh\"\n fontSet=\"material-icons-outlined\"\n [title]=\"retryLabel() || ('core.component.data-state.retry' | sdTranslate)\"\n (click)=\"retry()\"></sd-button>\n }\n @if (_actionLabel; as label) {\n <sd-button\n data-state-action\n type=\"fill\"\n color=\"primary\"\n size=\"sm\"\n htmlType=\"button\"\n width=\"100%\"\n [title]=\"label\"\n (click)=\"action()\"></sd-button>\n }\n </div>\n }\n </section>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MA8Ba,4BAA4B,CAAA;AAC9B,IAAA,QAAQ,GAAG,MAAM,CAA0C,WAAW,CAAC;AAEhF,IAAA,OAA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AAA;;4FAKlD,WAAW,EAAA,UAAA,EAAA,CAAA;kBARvB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,EAAA,UAAA,EACb,IAAI,EAAA,OAAA,EACP,CAAC,gBAAgB,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAA,eAAA,EAG7C,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,s0EAAA,EAAA,MAAA,EAAA,CAAA,ulFAAA,CAAA,EAAA;;;AEpDjD;;AAEG;;;;"}
@@ -2212,7 +2212,7 @@ class UploadComponent {
2212
2212
  return await this.sdUploadFile?.upload();
2213
2213
  };
2214
2214
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: UploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2215
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: UploadComponent, isStandalone: true, selector: "lib-upload", inputs: { setVariables: { classPropertyName: "setVariables", publicName: "setVariables", isSignal: true, isRequired: true, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, _entity: { classPropertyName: "_entity", publicName: "entity", isSignal: false, isRequired: true, transformFunction: null }, _component: { classPropertyName: "_component", publicName: "component", isSignal: false, isRequired: true, transformFunction: null }, _disabled: { classPropertyName: "_disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, _required: { classPropertyName: "_required", publicName: "required", isSignal: false, isRequired: false, transformFunction: null }, _viewed: { classPropertyName: "_viewed", publicName: "viewed", isSignal: false, isRequired: false, transformFunction: null }, _validator: { classPropertyName: "_validator", publicName: "validator", isSignal: false, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "sdUploadFile", first: true, predicate: SdUploadFile, descendants: true }], ngImport: i0, template: "@if (component && entity) {\n @if (viewed || component.properties?.viewed) {\n <div class=\"text-secondary\">{{ component.label || component.key }}</div>\n <sd-upload-file\n [type]=\"component.properties?.type\"\n [form]=\"form()\"\n [model]=\"entity[component.key!]\"\n align=\"left\"\n [args]=\"component.properties?.args\"\n disabled\n previewWidth=\"50px\"\n previewHeight=\"50px\"></sd-upload-file>\n } @else {\n <sd-upload-file\n [type]=\"component.properties?.type\"\n [form]=\"form()\"\n [label]=\"component.label || component.key\"\n [(model)]=\"entity[component.key!]\"\n [max]=\"component.properties?.max\"\n [maxSize]=\"component.properties?.maxSize\"\n [extensions]=\"component.properties?.extensions\"\n [args]=\"component.properties?.args\"\n align=\"left\"\n [required]=\"component.validate?.required || required\"\n [disabled]=\"disabled\"\n previewWidth=\"50px\"\n previewHeight=\"50px\"></sd-upload-file>\n }\n}\n", styles: [":host{display:contents;width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: SdUploadFile, selector: "sd-upload-file", inputs: ["autoId", "args", "label", "key", "description", "appearance", "previewWidth", "previewHeight", "align", "upload", "details", "download", "imageValidator", "maxSize", "maxWidth", "maxHeight", "scaleToPixel", "form", "name", "required", "type", "helperText", "max", "maxOfImage", "extensions", "disabled", "model"], outputs: ["loaded", "filesChanged", "modelChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2215
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: UploadComponent, isStandalone: true, selector: "lib-upload", inputs: { setVariables: { classPropertyName: "setVariables", publicName: "setVariables", isSignal: true, isRequired: true, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, _entity: { classPropertyName: "_entity", publicName: "entity", isSignal: false, isRequired: true, transformFunction: null }, _component: { classPropertyName: "_component", publicName: "component", isSignal: false, isRequired: true, transformFunction: null }, _disabled: { classPropertyName: "_disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, _required: { classPropertyName: "_required", publicName: "required", isSignal: false, isRequired: false, transformFunction: null }, _viewed: { classPropertyName: "_viewed", publicName: "viewed", isSignal: false, isRequired: false, transformFunction: null }, _validator: { classPropertyName: "_validator", publicName: "validator", isSignal: false, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "sdUploadFile", first: true, predicate: SdUploadFile, descendants: true }], ngImport: i0, template: "@if (component && entity) {\n @if (viewed || component.properties?.viewed) {\n <div class=\"text-secondary\">{{ component.label || component.key }}</div>\n <sd-upload-file\n [type]=\"component.properties?.type\"\n [form]=\"form()\"\n [model]=\"entity[component.key!]\"\n align=\"left\"\n [args]=\"component.properties?.args\"\n disabled\n previewWidth=\"50px\"\n previewHeight=\"50px\"></sd-upload-file>\n } @else {\n <sd-upload-file\n [type]=\"component.properties?.type\"\n [form]=\"form()\"\n [label]=\"component.label || component.key\"\n [(model)]=\"entity[component.key!]\"\n [max]=\"component.properties?.max\"\n [maxSize]=\"component.properties?.maxSize\"\n [extensions]=\"component.properties?.extensions\"\n [args]=\"component.properties?.args\"\n align=\"left\"\n [required]=\"component.validate?.required || required\"\n [disabled]=\"disabled\"\n previewWidth=\"50px\"\n previewHeight=\"50px\"></sd-upload-file>\n }\n}\n", styles: [":host{display:contents;width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: SdUploadFile, selector: "sd-upload-file", inputs: ["autoId", "args", "label", "key", "description", "previewWidth", "previewHeight", "align", "upload", "details", "download", "imageValidator", "maxSize", "maxWidth", "maxHeight", "scaleToPixel", "form", "name", "required", "type", "helperText", "max", "maxOfImage", "extensions", "disabled", "model"], outputs: ["loaded", "filesChanged", "modelChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2216
2216
  }
2217
2217
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: UploadComponent, decorators: [{
2218
2218
  type: Component,
@@ -2599,7 +2599,7 @@ class TableComponent {
2599
2599
  }
2600
2600
  };
2601
2601
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2602
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: TableComponent, isStandalone: true, selector: "lib-table", inputs: { setVariables: { classPropertyName: "setVariables", publicName: "setVariables", isSignal: true, isRequired: true, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, _component: { classPropertyName: "_component", publicName: "component", isSignal: false, isRequired: true, transformFunction: null }, _required: { classPropertyName: "_required", publicName: "required", isSignal: false, isRequired: false, transformFunction: null }, _viewed: { classPropertyName: "_viewed", publicName: "viewed", isSignal: false, isRequired: false, transformFunction: null }, _model: { classPropertyName: "_model", publicName: "model", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { modelChange: "modelChange" }, viewQueries: [{ propertyName: "table", first: true, predicate: SdTable, descendants: true }, { propertyName: "sideDrawer", first: true, predicate: SdSideDrawer, descendants: true }, { propertyName: "uploadFiles", predicate: SdUploadFile, descendants: true }], ngImport: i0, template: "@if(component && tableOption) {\n <div style=\"width: 100%\">\n <sd-table [option]=\"tableOption\">\n <!-- why: n\u00FAt th\u00EAm d\u00F2ng n\u1EB1m \u1EDF \u00F4 header c\u1EE7a c\u1ED9t command \u2014 \u00F4 \u0111\u00F3 v\u1ED1n \u0111\u1EC3 tr\u1ED1ng, v\u00E0 \u0111\u1EB7t \u1EDF \u0111\u00E2y th\u00EC\n h\u00E0nh \u0111\u1ED9ng \"th\u00EAm\" \u0111\u1EE9ng ngay tr\u00EAn c\u1EE5m s\u1EEDa/xo\u00E1 c\u1EE7a t\u1EEBng d\u00F2ng thay v\u00EC chi\u1EBFm th\u00EAm m\u1ED9t d\u1EA3i\n ri\u00EAng d\u01B0\u1EDBi b\u1EA3ng. -->\n <!-- why: KH\u00D4NG b\u1ECDc ng-template trong @if \u2014 contentChild ch\u1EC9 qu\u00E9t n\u1ED9i dung chi\u1EBFu v\u00E0o t\u0129nh, c\u00F2n\n @if d\u1EF1ng m\u1ED9t embedded view n\u00EAn template s\u1EBD kh\u00F4ng bao gi\u1EDD \u0111\u01B0\u1EE3c nh\u00ECn th\u1EA5y v\u00E0 n\u00FAt bi\u1EBFn m\u1EA5t.\n Template lu\u00F4n t\u1ED3n t\u1EA1i; \u0111i\u1EC1u ki\u1EC7n n\u1EB1m B\u00CAN TRONG. -->\n <ng-template sdTableCommandHeaderDef>\n @if(!viewed && !component.properties?.viewed) {\n <sd-button\n prefixIcon=\"add\"\n type=\"text\"\n color=\"primary\"\n (click)=\"onDetail()\"\n [title]=\"''\"\n [tooltip]=\"component.properties?.titleButtonCreate || ('core.component.form-builder.add-new' | sdTranslate)\"></sd-button>\n }\n </ng-template>\n @for(key of imageKeys; track key) {\n <ng-template [sdTableCellDef]=\"key\" let-item=\"item\">\n <sd-upload-file\n type=\"image\"\n [model]=\"item[key]\"\n [args]=\"getArgs(key)\"\n (modelChange)=\"onFileUploadChange(item, key, $event)\"\n align=\"left\"\n disabled\n previewWidth=\"50px\"\n previewHeight=\"50px\"></sd-upload-file>\n </ng-template>\n }\n @for(key of fileKeys; track key) {\n <ng-template [sdTableCellDef]=\"key\" let-item=\"item\">\n <sd-upload-file\n [model]=\"item[key]\"\n [args]=\"getArgs(key)\"\n (modelChange)=\"onFileUploadChange(item, key, $event)\"\n align=\"left\"\n disabled\n previewWidth=\"50px\"\n previewHeight=\"50px\"></sd-upload-file>\n </ng-template>\n }\n </sd-table>\n @if(!viewed && !component.properties?.viewed) {\n <!-- why: `sdTitle` / `sdBody` KH\u00D4NG ph\u1EA3i slot c\u1EE7a sd-side-drawer (n\u00F3 ch\u1EC9 c\u00F3 sdHeaderLeft /\n sdHeaderRight / sdFooterLeft / sdFooterRight + ng-content m\u1EB7c \u0111\u1ECBnh), n\u00EAn hai kh\u1ED1i \u0111\u00F3\n tr\u01B0\u1EDBc \u0111\u00E2y r\u01A1i th\u1EB3ng v\u00E0o th\u00E2n drawer \u2014 \"T\u1EA1o m\u1EDBi/c\u1EADp nh\u1EADt\" hi\u1EC7n trong body c\u00F2n ti\u00EAu \u0111\u1EC1 k\u1EB9t\n \u1EDF \"Chi ti\u1EBFt\". D\u00F9ng [title] \u0111\u1ED9ng theo t\u00E1c v\u1EE5 v\u00E0 \u0111\u1EC3 n\u1ED9i dung \u1EDF content m\u1EB7c \u0111\u1ECBnh. -->\n <sd-side-drawer [title]=\"detailTitle\" width=\"500px\">\n <div class=\"c-table-create-update\">\n @if(!!component.columns?.length) {\n <div class=\"c-drawer-fields\">\n @for(column of component.columns;track column.key) {\n @let validate = formRenderColumn[column.key].validate;\n <div>\n @if(column.type === 'string') {\n <sd-input\n [form]=\"form()\"\n [label]=\"column.label\"\n [(model)]=\"row[column.key]\"\n [required]=\"validate?.required\"\n [pattern]=\"column.validate?.pattern\"\n [patternErrorMessage]=\"column.validate?.patternErrorMessage\"></sd-input>\n }@else if(column.type === 'number') {\n <sd-input-number\n [form]=\"form()\"\n [label]=\"column.label\"\n [(model)]=\"row[column.key]\"\n [required]=\"validate?.required\"\n [min]=\"column.validate?.min\"></sd-input-number>\n }@else if(column.type === 'radio') {\n <sd-radio\n [form]=\"form()\"\n [label]=\"column.label\"\n [name]=\"column.key\"\n [items]=\"column.values\"\n valueField=\"value\"\n displayField=\"display\"\n [required]=\"validate?.required\"></sd-radio>\n }@else if(column.type === 'values') {\n <sd-autocomplete\n [form]=\"form()\"\n [label]=\"column.label\"\n [(model)]=\"row[column.key]\"\n [items]=\"columnValues[column.key]\"\n valueField=\"value\"\n displayField=\"display\"\n [required]=\"validate?.required\"></sd-autocomplete>\n }@else if(column.type === 'date') {\n <sd-date\n [form]=\"form()\"\n [label]=\"column.label\"\n [(model)]=\"row[column.key]\"\n [required]=\"validate?.required\"></sd-date>\n }@else if(column.type === 'datetime') {\n <sd-datetime\n [form]=\"form()\"\n [label]=\"column.label\"\n [(model)]=\"row[column.key]\"\n [required]=\"validate?.required\"></sd-datetime>\n }@else if(column.type === 'image') {\n <sd-upload-file\n [label]=\"column.label\"\n type=\"image\"\n [(model)]=\"row[column.key]\"\n [args]=\"column.args\"\n previewWidth=\"50px\"\n previewHeight=\"50px\"\n align=\"left\"></sd-upload-file>\n }@else if (column.type === 'file') {\n <sd-upload-file\n [label]=\"column.label\"\n type=\"file\"\n [(model)]=\"row[column.key]\"\n [args]=\"column.args\"\n previewWidth=\"50px\"\n previewHeight=\"50px\"\n align=\"left\"></sd-upload-file>\n }\n </div>\n }\n </div>\n }\n \n </div>\n <!-- why: `.sd-side-drawer-footer` \u0111\u00E3 c\u00F3 padding 16px \u2014 m\u1ECDi consumer sdFooterRight kh\u00E1c trong\n lib \u0111\u1EC1u d\u1EF1a v\u00E0o \u0111\u00F3. `pr-16` \u1EDF \u0111\u00E2y c\u1ED9ng th\u00EAm 16px n\u1EEFa, \u0111\u1EA9y n\u00FAt L\u01B0u v\u00E0o trong; `text-right`\n th\u00EC v\u00F4 t\u00E1c d\u1EE5ng v\u00EC slot \u0111\u00E3 l\u00E0 flex justify-end. -->\n <div sdFooterRight>\n <sd-button [title]=\"'core.component.form-builder.save' | sdTranslate\" prefixIcon=\"save\" color=\"primary\" type=\"fill\" (click)=\"onAccept()\"></sd-button>\n </div>\n </sd-side-drawer>\n }\n </div>\n}\n\n", styles: [":host{display:contents}.c-table-create-update{padding:16px}.c-drawer-fields{display:flex;flex-direction:column;gap:12px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: SdInput, selector: "sd-input", inputs: ["autoId", "name", "appearance", "floatLabel", "size", "form", "label", "helperText", "placeholder", "type", "mask", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "minlength", "maxlength", "pattern", "patternErrorMessage", "validator", "inlineError", "hyperlink", "model"], outputs: ["modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }, { kind: "component", type: SdInputNumber$1, selector: "sd-input-number", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "type", "precision", "format", "min", "max", "validator", "inlineError", "hyperlink", "appearance", "floatLabel", "model"], outputs: ["modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }, { kind: "component", type: SdAutocomplete, selector: "sd-autocomplete", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "valueField", "displayField", "disabledField", "limit", "cacheChecksum", "hyperlink", "items", "hideInlineError", "hideReadError", "addable", "required", "disabled", "viewed", "clearable", "validator", "inlineError", "appearance", "model"], outputs: ["sdReadStateChange", "modelChange", "sdChange", "sdSelection", "sdAdd"] }, { kind: "component", type: SdUploadFile, selector: "sd-upload-file", inputs: ["autoId", "args", "label", "key", "description", "appearance", "previewWidth", "previewHeight", "align", "upload", "details", "download", "imageValidator", "maxSize", "maxWidth", "maxHeight", "scaleToPixel", "form", "name", "required", "type", "helperText", "max", "maxOfImage", "extensions", "disabled", "model"], outputs: ["loaded", "filesChanged", "modelChange"] }, { kind: "component", type: SdTable, selector: "sd-table", inputs: ["autoId", "option", "hideReadError"], outputs: ["sdReadStateChange"] }, { kind: "directive", type: SdTableCellDefDirective, selector: "[sdTableCellDef]", inputs: ["sdTableCellDef"] }, { kind: "directive", type: SdTableCommandHeaderDefDirective, selector: "[sdTableCommandHeaderDef]" }, { kind: "component", type: SdSideDrawer, selector: "sd-side-drawer", inputs: ["title", "width", "hideClose", "disableBackdropClose", "beforeClose", "drawerClass", "autoId"], outputs: ["sdClosed", "sdCloseError"] }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "loading", "block", "htmlType"], outputs: ["click"] }, { kind: "component", type: SdRadio, selector: "sd-radio", inputs: ["autoId", "name", "form", "label", "placeholder", "display", "items", "valueField", "displayField", "required", "inlineError", "disabled", "viewed", "color", "hyperlink", "model"], outputs: ["modelChange", "sdChange", "sdSelection"] }, { kind: "component", type: SdDate, selector: "sd-date", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "hideInlineError", "required", "disabled", "viewed", "clearable", "inlineError", "hyperlink", "appearance", "floatLabel", "min", "minDate", "max", "maxDate", "transform", "model"], outputs: ["modelChange", "sdChange", "sdFocus"] }, { kind: "component", type: SdDatetime, selector: "sd-datetime", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "hideInlineError", "required", "disabled", "viewed", "showSeconds", "clearable", "inlineError", "hyperlink", "appearance", "floatLabel", "min", "minDate", "max", "maxDate", "transform", "model"], outputs: ["modelChange", "sdChange", "sdFocus"] }, { kind: "pipe", type:
2602
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: TableComponent, isStandalone: true, selector: "lib-table", inputs: { setVariables: { classPropertyName: "setVariables", publicName: "setVariables", isSignal: true, isRequired: true, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, _component: { classPropertyName: "_component", publicName: "component", isSignal: false, isRequired: true, transformFunction: null }, _required: { classPropertyName: "_required", publicName: "required", isSignal: false, isRequired: false, transformFunction: null }, _viewed: { classPropertyName: "_viewed", publicName: "viewed", isSignal: false, isRequired: false, transformFunction: null }, _model: { classPropertyName: "_model", publicName: "model", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { modelChange: "modelChange" }, viewQueries: [{ propertyName: "table", first: true, predicate: SdTable, descendants: true }, { propertyName: "sideDrawer", first: true, predicate: SdSideDrawer, descendants: true }, { propertyName: "uploadFiles", predicate: SdUploadFile, descendants: true }], ngImport: i0, template: "@if(component && tableOption) {\n <div style=\"width: 100%\">\n <sd-table [option]=\"tableOption\">\n <!-- why: n\u00FAt th\u00EAm d\u00F2ng n\u1EB1m \u1EDF \u00F4 header c\u1EE7a c\u1ED9t command \u2014 \u00F4 \u0111\u00F3 v\u1ED1n \u0111\u1EC3 tr\u1ED1ng, v\u00E0 \u0111\u1EB7t \u1EDF \u0111\u00E2y th\u00EC\n h\u00E0nh \u0111\u1ED9ng \"th\u00EAm\" \u0111\u1EE9ng ngay tr\u00EAn c\u1EE5m s\u1EEDa/xo\u00E1 c\u1EE7a t\u1EEBng d\u00F2ng thay v\u00EC chi\u1EBFm th\u00EAm m\u1ED9t d\u1EA3i\n ri\u00EAng d\u01B0\u1EDBi b\u1EA3ng. -->\n <!-- why: KH\u00D4NG b\u1ECDc ng-template trong @if \u2014 contentChild ch\u1EC9 qu\u00E9t n\u1ED9i dung chi\u1EBFu v\u00E0o t\u0129nh, c\u00F2n\n @if d\u1EF1ng m\u1ED9t embedded view n\u00EAn template s\u1EBD kh\u00F4ng bao gi\u1EDD \u0111\u01B0\u1EE3c nh\u00ECn th\u1EA5y v\u00E0 n\u00FAt bi\u1EBFn m\u1EA5t.\n Template lu\u00F4n t\u1ED3n t\u1EA1i; \u0111i\u1EC1u ki\u1EC7n n\u1EB1m B\u00CAN TRONG. -->\n <ng-template sdTableCommandHeaderDef>\n @if(!viewed && !component.properties?.viewed) {\n <sd-button\n prefixIcon=\"add\"\n type=\"text\"\n color=\"primary\"\n (click)=\"onDetail()\"\n [title]=\"''\"\n [tooltip]=\"component.properties?.titleButtonCreate || ('core.component.form-builder.add-new' | sdTranslate)\"></sd-button>\n }\n </ng-template>\n @for(key of imageKeys; track key) {\n <ng-template [sdTableCellDef]=\"key\" let-item=\"item\">\n <sd-upload-file\n type=\"image\"\n [model]=\"item[key]\"\n [args]=\"getArgs(key)\"\n (modelChange)=\"onFileUploadChange(item, key, $event)\"\n align=\"left\"\n disabled\n previewWidth=\"50px\"\n previewHeight=\"50px\"></sd-upload-file>\n </ng-template>\n }\n @for(key of fileKeys; track key) {\n <ng-template [sdTableCellDef]=\"key\" let-item=\"item\">\n <sd-upload-file\n [model]=\"item[key]\"\n [args]=\"getArgs(key)\"\n (modelChange)=\"onFileUploadChange(item, key, $event)\"\n align=\"left\"\n disabled\n previewWidth=\"50px\"\n previewHeight=\"50px\"></sd-upload-file>\n </ng-template>\n }\n </sd-table>\n @if(!viewed && !component.properties?.viewed) {\n <!-- why: `sdTitle` / `sdBody` KH\u00D4NG ph\u1EA3i slot c\u1EE7a sd-side-drawer (n\u00F3 ch\u1EC9 c\u00F3 sdHeaderLeft /\n sdHeaderRight / sdFooterLeft / sdFooterRight + ng-content m\u1EB7c \u0111\u1ECBnh), n\u00EAn hai kh\u1ED1i \u0111\u00F3\n tr\u01B0\u1EDBc \u0111\u00E2y r\u01A1i th\u1EB3ng v\u00E0o th\u00E2n drawer \u2014 \"T\u1EA1o m\u1EDBi/c\u1EADp nh\u1EADt\" hi\u1EC7n trong body c\u00F2n ti\u00EAu \u0111\u1EC1 k\u1EB9t\n \u1EDF \"Chi ti\u1EBFt\". D\u00F9ng [title] \u0111\u1ED9ng theo t\u00E1c v\u1EE5 v\u00E0 \u0111\u1EC3 n\u1ED9i dung \u1EDF content m\u1EB7c \u0111\u1ECBnh. -->\n <sd-side-drawer [title]=\"detailTitle\" width=\"500px\">\n <div class=\"c-table-create-update\">\n @if(!!component.columns?.length) {\n <div class=\"c-drawer-fields\">\n @for(column of component.columns;track column.key) {\n @let validate = formRenderColumn[column.key].validate;\n <div>\n @if(column.type === 'string') {\n <sd-input\n [form]=\"form()\"\n [label]=\"column.label\"\n [(model)]=\"row[column.key]\"\n [required]=\"validate?.required\"\n [pattern]=\"column.validate?.pattern\"\n [patternErrorMessage]=\"column.validate?.patternErrorMessage\"></sd-input>\n }@else if(column.type === 'number') {\n <sd-input-number\n [form]=\"form()\"\n [label]=\"column.label\"\n [(model)]=\"row[column.key]\"\n [required]=\"validate?.required\"\n [min]=\"column.validate?.min\"></sd-input-number>\n }@else if(column.type === 'radio') {\n <sd-radio\n [form]=\"form()\"\n [label]=\"column.label\"\n [name]=\"column.key\"\n [items]=\"column.values\"\n valueField=\"value\"\n displayField=\"display\"\n [required]=\"validate?.required\"></sd-radio>\n }@else if(column.type === 'values') {\n <sd-autocomplete\n [form]=\"form()\"\n [label]=\"column.label\"\n [(model)]=\"row[column.key]\"\n [items]=\"columnValues[column.key]\"\n valueField=\"value\"\n displayField=\"display\"\n [required]=\"validate?.required\"></sd-autocomplete>\n }@else if(column.type === 'date') {\n <sd-date\n [form]=\"form()\"\n [label]=\"column.label\"\n [(model)]=\"row[column.key]\"\n [required]=\"validate?.required\"></sd-date>\n }@else if(column.type === 'datetime') {\n <sd-datetime\n [form]=\"form()\"\n [label]=\"column.label\"\n [(model)]=\"row[column.key]\"\n [required]=\"validate?.required\"></sd-datetime>\n }@else if(column.type === 'image') {\n <sd-upload-file\n [label]=\"column.label\"\n type=\"image\"\n [(model)]=\"row[column.key]\"\n [args]=\"column.args\"\n previewWidth=\"50px\"\n previewHeight=\"50px\"\n align=\"left\"></sd-upload-file>\n }@else if (column.type === 'file') {\n <sd-upload-file\n [label]=\"column.label\"\n type=\"file\"\n [(model)]=\"row[column.key]\"\n [args]=\"column.args\"\n previewWidth=\"50px\"\n previewHeight=\"50px\"\n align=\"left\"></sd-upload-file>\n }\n </div>\n }\n </div>\n }\n \n </div>\n <!-- why: `.sd-side-drawer-footer` \u0111\u00E3 c\u00F3 padding 16px \u2014 m\u1ECDi consumer sdFooterRight kh\u00E1c trong\n lib \u0111\u1EC1u d\u1EF1a v\u00E0o \u0111\u00F3. `pr-16` \u1EDF \u0111\u00E2y c\u1ED9ng th\u00EAm 16px n\u1EEFa, \u0111\u1EA9y n\u00FAt L\u01B0u v\u00E0o trong; `text-right`\n th\u00EC v\u00F4 t\u00E1c d\u1EE5ng v\u00EC slot \u0111\u00E3 l\u00E0 flex justify-end. -->\n <div sdFooterRight>\n <sd-button [title]=\"'core.component.form-builder.save' | sdTranslate\" prefixIcon=\"save\" color=\"primary\" type=\"fill\" (click)=\"onAccept()\"></sd-button>\n </div>\n </sd-side-drawer>\n }\n </div>\n}\n\n", styles: [":host{display:contents}.c-table-create-update{padding:16px}.c-drawer-fields{display:flex;flex-direction:column;gap:12px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: SdInput, selector: "sd-input", inputs: ["autoId", "name", "appearance", "floatLabel", "size", "form", "label", "helperText", "placeholder", "type", "mask", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "minlength", "maxlength", "pattern", "patternErrorMessage", "validator", "inlineError", "hyperlink", "model"], outputs: ["modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }, { kind: "component", type: SdInputNumber$1, selector: "sd-input-number", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "type", "precision", "format", "min", "max", "validator", "inlineError", "hyperlink", "appearance", "floatLabel", "model"], outputs: ["modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }, { kind: "component", type: SdAutocomplete, selector: "sd-autocomplete", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "valueField", "displayField", "disabledField", "limit", "cacheChecksum", "hyperlink", "items", "hideInlineError", "hideReadError", "addable", "required", "disabled", "viewed", "clearable", "validator", "inlineError", "appearance", "model"], outputs: ["sdReadStateChange", "modelChange", "sdChange", "sdSelection", "sdAdd"] }, { kind: "component", type: SdUploadFile, selector: "sd-upload-file", inputs: ["autoId", "args", "label", "key", "description", "previewWidth", "previewHeight", "align", "upload", "details", "download", "imageValidator", "maxSize", "maxWidth", "maxHeight", "scaleToPixel", "form", "name", "required", "type", "helperText", "max", "maxOfImage", "extensions", "disabled", "model"], outputs: ["loaded", "filesChanged", "modelChange"] }, { kind: "component", type: SdTable, selector: "sd-table", inputs: ["autoId", "option", "hideReadError"], outputs: ["sdReadStateChange"] }, { kind: "directive", type: SdTableCellDefDirective, selector: "[sdTableCellDef]", inputs: ["sdTableCellDef"] }, { kind: "directive", type: SdTableCommandHeaderDefDirective, selector: "[sdTableCommandHeaderDef]" }, { kind: "component", type: SdSideDrawer, selector: "sd-side-drawer", inputs: ["title", "width", "hideClose", "disableBackdropClose", "beforeClose", "drawerClass", "autoId"], outputs: ["sdClosed", "sdCloseError"] }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "loading", "block", "htmlType"], outputs: ["click"] }, { kind: "component", type: SdRadio, selector: "sd-radio", inputs: ["autoId", "name", "form", "label", "placeholder", "display", "items", "valueField", "displayField", "required", "inlineError", "disabled", "viewed", "color", "hyperlink", "model"], outputs: ["modelChange", "sdChange", "sdSelection"] }, { kind: "component", type: SdDate, selector: "sd-date", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "hideInlineError", "required", "disabled", "viewed", "clearable", "inlineError", "hyperlink", "appearance", "floatLabel", "min", "minDate", "max", "maxDate", "transform", "model"], outputs: ["modelChange", "sdChange", "sdFocus"] }, { kind: "component", type: SdDatetime, selector: "sd-datetime", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "hideInlineError", "required", "disabled", "viewed", "showSeconds", "clearable", "inlineError", "hyperlink", "appearance", "floatLabel", "min", "minDate", "max", "maxDate", "transform", "model"], outputs: ["modelChange", "sdChange", "sdFocus"] }, { kind: "pipe", type:
2603
2603
  // Pipe cho phần viewed
2604
2604
  SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2605
2605
  }
@@ -3115,11 +3115,11 @@ class SdFormRender {
3115
3115
  });
3116
3116
  }
3117
3117
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdFormRender, deps: [], target: i0.ɵɵFactoryTarget.Component });
3118
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: SdFormRender, isStandalone: true, selector: "sd-form-render", inputs: { form: "form", _configuration: ["configuration", "_configuration"], _default: ["defaultEntity", "_default"], _entity: ["entity", "_entity"], _properties: ["properties", "_properties"], _viewed: ["viewed", "_viewed"] }, viewQueries: [{ propertyName: "formRenderItems", predicate: LibItemComponent, descendants: true }], ngImport: i0, template: "@if (form && loadCompleted && hashedValues) {\n <div class=\"row mx-0\">\n @for (component of configuration.components; track component.id) {\n @let expression = hashedValues | whenExpression: component : formValue;\n @if (!expression.hidden) {\n @if (component.type === 'group') {\n @if (!!component.components.length) {\n <div class=\"col-12 mt-16\">\n <sd-section [title]=\"component.label\" [icon]=\"component.properties.icon\">\n <!-- why: `.sd-section-body` \u0111\u1EC3 padding 0 (m\u1ED7i n\u1ED9i dung t\u1EF1 quy\u1EBFt), n\u00EAn c\u00E1c field ch\u1EC9\n c\u00F2n px-8/py-8 c\u1EE7a ri\u00EAng ch\u00FAng v\u00E0 d\u00EDnh s\u00E1t khung section. Group t\u1EF1 ch\u1EEBa l\u1EC1. -->\n <div class=\"row mx-0 c-group-body\">\n @for (childComponent of component.components; track childComponent.id) {\n @let childExpression = hashedValues | whenExpression: childComponent : formValue;\n @if (!childExpression.hidden) {\n <lib-item\n [setVariables]=\"setVariables\"\n [form]=\"form\"\n [entity]=\"entity\"\n [component]=\"childComponent\"\n [required]=\"childExpression.required\"\n [disabled]=\"childExpression.disabled\"\n [viewed]=\"viewed\"></lib-item>\n }\n }\n </div>\n </sd-section>\n </div>\n }\n } @else {\n <lib-item\n [setVariables]=\"setVariables\"\n [form]=\"form\"\n [entity]=\"entity\"\n [component]=\"component\"\n [required]=\"expression.required\"\n [disabled]=\"expression.disabled\"\n [viewed]=\"viewed\"></lib-item>\n }\n }\n }\n <variable [variables]=\"configuration.variables\" [setVariables]=\"setVariables\" [form]=\"form\" [entity]=\"entity\" ></variable>\n </div>\n}\n", styles: [":host{display:contents}.c-group-body{padding:8px 8px 12px}\n"], dependencies: [{ kind: "component", type: SdSection, selector: "sd-section", inputs: ["title", "subTitle", "icon", "iconColor", "collapsed", "collapsible", "hideHeader"], outputs: ["collapsedChange"] }, { kind: "component", type: LibItemComponent, selector: "lib-item", inputs: ["setVariables", "form", "entity", "component", "disabled", "required", "viewed", "validator"] }, { kind: "pipe", type: WhenExpressionPipe, name: "whenExpression" }, { kind: "component", type: VariableComponent, selector: "variable", inputs: ["variables", "setVariables", "form", "entity"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3118
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: SdFormRender, isStandalone: true, selector: "sd-form-render", inputs: { form: "form", _configuration: ["configuration", "_configuration"], _default: ["defaultEntity", "_default"], _entity: ["entity", "_entity"], _properties: ["properties", "_properties"], _viewed: ["viewed", "_viewed"] }, viewQueries: [{ propertyName: "formRenderItems", predicate: LibItemComponent, descendants: true }], ngImport: i0, template: "@if (form && loadCompleted && hashedValues) {\n <div class=\"row mx-0\">\n @for (component of configuration.components; track component.id) {\n @let expression = hashedValues | whenExpression: component : formValue;\n @if (!expression.hidden) {\n @if (component.type === 'group') {\n @if (!!component.components.length) {\n <div class=\"col-12 mt-16\">\n <sd-section [title]=\"component.label\" [icon]=\"component.properties.icon\" [collapsible]=\"component.properties.collapsible ?? false\">\n <!-- why: `.sd-section-body` \u0111\u1EC3 padding 0 (m\u1ED7i n\u1ED9i dung t\u1EF1 quy\u1EBFt), n\u00EAn c\u00E1c field ch\u1EC9\n c\u00F2n px-8/py-8 c\u1EE7a ri\u00EAng ch\u00FAng v\u00E0 d\u00EDnh s\u00E1t khung section. Group t\u1EF1 ch\u1EEBa l\u1EC1. -->\n <div class=\"row mx-0 c-group-body\">\n @for (childComponent of component.components; track childComponent.id) {\n @let childExpression = hashedValues | whenExpression: childComponent : formValue;\n @if (!childExpression.hidden) {\n <lib-item\n [setVariables]=\"setVariables\"\n [form]=\"form\"\n [entity]=\"entity\"\n [component]=\"childComponent\"\n [required]=\"childExpression.required\"\n [disabled]=\"childExpression.disabled\"\n [viewed]=\"viewed\"></lib-item>\n }\n }\n </div>\n </sd-section>\n </div>\n }\n } @else {\n <lib-item\n [setVariables]=\"setVariables\"\n [form]=\"form\"\n [entity]=\"entity\"\n [component]=\"component\"\n [required]=\"expression.required\"\n [disabled]=\"expression.disabled\"\n [viewed]=\"viewed\"></lib-item>\n }\n }\n }\n <variable [variables]=\"configuration.variables\" [setVariables]=\"setVariables\" [form]=\"form\" [entity]=\"entity\" ></variable>\n </div>\n}\n", styles: [":host{display:contents}.c-group-body{padding:8px 8px 12px}\n"], dependencies: [{ kind: "component", type: SdSection, selector: "sd-section", inputs: ["title", "subTitle", "icon", "iconColor", "collapsed", "collapsible", "hideHeader"], outputs: ["collapsedChange"] }, { kind: "component", type: LibItemComponent, selector: "lib-item", inputs: ["setVariables", "form", "entity", "component", "disabled", "required", "viewed", "validator"] }, { kind: "pipe", type: WhenExpressionPipe, name: "whenExpression" }, { kind: "component", type: VariableComponent, selector: "variable", inputs: ["variables", "setVariables", "form", "entity"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3119
3119
  }
3120
3120
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdFormRender, decorators: [{
3121
3121
  type: Component,
3122
- args: [{ selector: 'sd-form-render', changeDetection: ChangeDetectionStrategy.OnPush, imports: [SdSection, LibItemComponent, WhenExpressionPipe, VariableComponent], template: "@if (form && loadCompleted && hashedValues) {\n <div class=\"row mx-0\">\n @for (component of configuration.components; track component.id) {\n @let expression = hashedValues | whenExpression: component : formValue;\n @if (!expression.hidden) {\n @if (component.type === 'group') {\n @if (!!component.components.length) {\n <div class=\"col-12 mt-16\">\n <sd-section [title]=\"component.label\" [icon]=\"component.properties.icon\">\n <!-- why: `.sd-section-body` \u0111\u1EC3 padding 0 (m\u1ED7i n\u1ED9i dung t\u1EF1 quy\u1EBFt), n\u00EAn c\u00E1c field ch\u1EC9\n c\u00F2n px-8/py-8 c\u1EE7a ri\u00EAng ch\u00FAng v\u00E0 d\u00EDnh s\u00E1t khung section. Group t\u1EF1 ch\u1EEBa l\u1EC1. -->\n <div class=\"row mx-0 c-group-body\">\n @for (childComponent of component.components; track childComponent.id) {\n @let childExpression = hashedValues | whenExpression: childComponent : formValue;\n @if (!childExpression.hidden) {\n <lib-item\n [setVariables]=\"setVariables\"\n [form]=\"form\"\n [entity]=\"entity\"\n [component]=\"childComponent\"\n [required]=\"childExpression.required\"\n [disabled]=\"childExpression.disabled\"\n [viewed]=\"viewed\"></lib-item>\n }\n }\n </div>\n </sd-section>\n </div>\n }\n } @else {\n <lib-item\n [setVariables]=\"setVariables\"\n [form]=\"form\"\n [entity]=\"entity\"\n [component]=\"component\"\n [required]=\"expression.required\"\n [disabled]=\"expression.disabled\"\n [viewed]=\"viewed\"></lib-item>\n }\n }\n }\n <variable [variables]=\"configuration.variables\" [setVariables]=\"setVariables\" [form]=\"form\" [entity]=\"entity\" ></variable>\n </div>\n}\n", styles: [":host{display:contents}.c-group-body{padding:8px 8px 12px}\n"] }]
3122
+ args: [{ selector: 'sd-form-render', changeDetection: ChangeDetectionStrategy.OnPush, imports: [SdSection, LibItemComponent, WhenExpressionPipe, VariableComponent], template: "@if (form && loadCompleted && hashedValues) {\n <div class=\"row mx-0\">\n @for (component of configuration.components; track component.id) {\n @let expression = hashedValues | whenExpression: component : formValue;\n @if (!expression.hidden) {\n @if (component.type === 'group') {\n @if (!!component.components.length) {\n <div class=\"col-12 mt-16\">\n <sd-section [title]=\"component.label\" [icon]=\"component.properties.icon\" [collapsible]=\"component.properties.collapsible ?? false\">\n <!-- why: `.sd-section-body` \u0111\u1EC3 padding 0 (m\u1ED7i n\u1ED9i dung t\u1EF1 quy\u1EBFt), n\u00EAn c\u00E1c field ch\u1EC9\n c\u00F2n px-8/py-8 c\u1EE7a ri\u00EAng ch\u00FAng v\u00E0 d\u00EDnh s\u00E1t khung section. Group t\u1EF1 ch\u1EEBa l\u1EC1. -->\n <div class=\"row mx-0 c-group-body\">\n @for (childComponent of component.components; track childComponent.id) {\n @let childExpression = hashedValues | whenExpression: childComponent : formValue;\n @if (!childExpression.hidden) {\n <lib-item\n [setVariables]=\"setVariables\"\n [form]=\"form\"\n [entity]=\"entity\"\n [component]=\"childComponent\"\n [required]=\"childExpression.required\"\n [disabled]=\"childExpression.disabled\"\n [viewed]=\"viewed\"></lib-item>\n }\n }\n </div>\n </sd-section>\n </div>\n }\n } @else {\n <lib-item\n [setVariables]=\"setVariables\"\n [form]=\"form\"\n [entity]=\"entity\"\n [component]=\"component\"\n [required]=\"expression.required\"\n [disabled]=\"expression.disabled\"\n [viewed]=\"viewed\"></lib-item>\n }\n }\n }\n <variable [variables]=\"configuration.variables\" [setVariables]=\"setVariables\" [form]=\"form\" [entity]=\"entity\" ></variable>\n </div>\n}\n", styles: [":host{display:contents}.c-group-body{padding:8px 8px 12px}\n"] }]
3123
3123
  }], propDecorators: { formRenderItems: [{
3124
3124
  type: ViewChildren,
3125
3125
  args: [LibItemComponent]
@@ -5413,11 +5413,11 @@ class GroupAttribute {
5413
5413
  return 'label' in c ? c.label : c.key || c.id;
5414
5414
  };
5415
5415
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: GroupAttribute, deps: [], target: i0.ɵɵFactoryTarget.Component });
5416
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: GroupAttribute, isStandalone: true, selector: "group-attribute", inputs: { group: { classPropertyName: "group", publicName: "group", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@let _group = group();\n\n<details class=\"fb-section\" open>\n <summary class=\"fb-section__head\">\n <span class=\"msi\">info</span>\n <span class=\"fb-section__title\">{{ 'core.component.form-builder.general' | sdTranslate }}</span>\n <span class=\"msi chev\">chevron_right</span>\n </summary>\n <div class=\"fb-section__body\">\n <attribute-input [form]=\"form\" [(model)]=\"_group.label\" [label]=\"'core.component.form-builder.label' | sdTranslate\"></attribute-input>\n\n <div class=\"fb-field\">\n <div class=\"fb-field__label\">{{ 'core.component.form-builder.group-icon' | sdTranslate }}</div>\n <div class=\"fb-icon-picker\">\n @for (icon of iconPresets; track icon) {\n <button type=\"button\" class=\"fb-icon-picker__btn\"\n [class.is-active]=\"_group.properties.icon === icon\"\n (click)=\"pickIcon(icon)\">\n <span class=\"msi\">{{ icon }}</span>\n </button>\n }\n </div>\n </div>\n\n <div class=\"fb-field\">\n <div class=\"fb-field__label\">{{ 'core.component.form-builder.group-accent-color' | sdTranslate }}</div>\n <div class=\"fb-color-swatches\">\n <!-- why: \u00F4 m\u00E0u l\u00E0 control ch\u1ECDn m\u00E0u TH\u1EACT nh\u01B0ng l\u1EA1i l\u00E0 <span (click)> \u2014 kh\u00F4ng nh\u1EADn focus,\n Enter/Space kh\u00F4ng ch\u1ECDn \u0111\u01B0\u1EE3c, v\u00E0 tr\u1EA1ng th\u00E1i \"\u0111ang ch\u1ECDn\" ch\u1EC9 t\u1ED3n t\u1EA1i \u1EDF CSS. \u0110\u1ED5i sang\n <button type=\"button\"> (t\u1EF1 focusable + Enter/Space) v\u00E0 khai aria-pressed \u0111\u1EC3 screen\n reader bi\u1EBFt \u00F4 n\u00E0o \u0111ang \u0111\u01B0\u1EE3c ch\u1ECDn. -->\n @for (color of colorPresets; track color) {\n <button\n type=\"button\"\n class=\"fb-color-swatch\"\n [class]=\"color\"\n [class.is-active]=\"_group.properties.color === color\"\n [attr.aria-pressed]=\"_group.properties.color === color\"\n (click)=\"pickColor(color)\"\n [attr.aria-label]=\"color\"></button>\n }\n </div>\n </div>\n </div>\n</details>\n\n<details class=\"fb-section\" open>\n <summary class=\"fb-section__head\">\n <span class=\"msi\">account_tree</span>\n <span class=\"fb-section__title\">{{ 'core.component.form-builder.group-children' | sdTranslate }}</span>\n <span class=\"msi chev\">chevron_right</span>\n </summary>\n <div class=\"fb-section__body\">\n @if (!_group.components?.length) {\n <div class=\"fb-children-empty\">{{ 'core.component.form-builder.group-no-children' | sdTranslate }}</div>\n } @else {\n <div class=\"fb-children-list\">\n @for (child of _group.components; track child.id) {\n <div class=\"fb-child-row\">\n <span class=\"fb-child-row__icon\"><span class=\"msi\">{{ symbolForChild(child) }}</span></span>\n <span class=\"fb-child-row__label\">{{ labelForChild(child) }}</span>\n <span class=\"fb-child-row__key\">{{ child.key }}</span>\n </div>\n }\n </div>\n }\n </div>\n</details>\n\n<details class=\"fb-section\" open>\n <summary class=\"fb-section__head\">\n <span class=\"msi\">visibility</span>\n <span class=\"fb-section__title\">{{ 'core.component.form-builder.display' | sdTranslate }}</span>\n <span class=\"msi chev\">chevron_right</span>\n </summary>\n <div class=\"fb-section__body\">\n <attribute-expression\n [components]=\"[]\"\n [variables]=\"[]\"\n [(model)]=\"_group.properties.visibleWhenExpression\"\n [label]=\"'core.component.form-builder.visible-when' | sdTranslate\">\n </attribute-expression>\n <attribute-expression\n [components]=\"[]\"\n [variables]=\"[]\"\n [(model)]=\"_group.properties.hiddenWhenExpression\"\n [label]=\"'core.component.form-builder.hidden-when' | sdTranslate\">\n </attribute-expression>\n </div>\n</details>\n", styles: [":host{display:block}.fb-children-empty{font-size:12px;color:var(--md-sys-color-on-surface-variant);font-style:italic;padding:8px 0}\n"], dependencies: [{ kind: "component", type: AttributeInput, selector: "attribute-input", inputs: ["form", "label", "disabled", "model"], outputs: ["modelChange", "sdChange"] }, { kind: "component", type: AttributeExpression, selector: "attribute-expression", inputs: ["components", "variables", "label", "model"], outputs: ["modelChange", "sdChange"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
5416
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: GroupAttribute, isStandalone: true, selector: "group-attribute", inputs: { group: { classPropertyName: "group", publicName: "group", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@let _group = group();\n\n<details class=\"fb-section\" open>\n <summary class=\"fb-section__head\">\n <span class=\"msi\">info</span>\n <span class=\"fb-section__title\">{{ 'core.component.form-builder.general' | sdTranslate }}</span>\n <span class=\"msi chev\">chevron_right</span>\n </summary>\n <div class=\"fb-section__body\">\n <attribute-input [form]=\"form\" [(model)]=\"_group.label\" [label]=\"'core.component.form-builder.label' | sdTranslate\"></attribute-input>\n <attribute-switch\n [form]=\"form\"\n [(model)]=\"_group.properties.collapsible\"\n [label]=\"'core.component.form-builder.collapsible' | sdTranslate\"></attribute-switch>\n\n <div class=\"fb-field\">\n <div class=\"fb-field__label\">{{ 'core.component.form-builder.group-icon' | sdTranslate }}</div>\n <div class=\"fb-icon-picker\">\n @for (icon of iconPresets; track icon) {\n <button type=\"button\" class=\"fb-icon-picker__btn\"\n [class.is-active]=\"_group.properties.icon === icon\"\n (click)=\"pickIcon(icon)\">\n <span class=\"msi\">{{ icon }}</span>\n </button>\n }\n </div>\n </div>\n\n <div class=\"fb-field\">\n <div class=\"fb-field__label\">{{ 'core.component.form-builder.group-accent-color' | sdTranslate }}</div>\n <div class=\"fb-color-swatches\">\n <!-- why: \u00F4 m\u00E0u l\u00E0 control ch\u1ECDn m\u00E0u TH\u1EACT nh\u01B0ng l\u1EA1i l\u00E0 <span (click)> \u2014 kh\u00F4ng nh\u1EADn focus,\n Enter/Space kh\u00F4ng ch\u1ECDn \u0111\u01B0\u1EE3c, v\u00E0 tr\u1EA1ng th\u00E1i \"\u0111ang ch\u1ECDn\" ch\u1EC9 t\u1ED3n t\u1EA1i \u1EDF CSS. \u0110\u1ED5i sang\n <button type=\"button\"> (t\u1EF1 focusable + Enter/Space) v\u00E0 khai aria-pressed \u0111\u1EC3 screen\n reader bi\u1EBFt \u00F4 n\u00E0o \u0111ang \u0111\u01B0\u1EE3c ch\u1ECDn. -->\n @for (color of colorPresets; track color) {\n <button\n type=\"button\"\n class=\"fb-color-swatch\"\n [class]=\"color\"\n [class.is-active]=\"_group.properties.color === color\"\n [attr.aria-pressed]=\"_group.properties.color === color\"\n (click)=\"pickColor(color)\"\n [attr.aria-label]=\"color\"></button>\n }\n </div>\n </div>\n </div>\n</details>\n\n<details class=\"fb-section\" open>\n <summary class=\"fb-section__head\">\n <span class=\"msi\">account_tree</span>\n <span class=\"fb-section__title\">{{ 'core.component.form-builder.group-children' | sdTranslate }}</span>\n <span class=\"msi chev\">chevron_right</span>\n </summary>\n <div class=\"fb-section__body\">\n @if (!_group.components?.length) {\n <div class=\"fb-children-empty\">{{ 'core.component.form-builder.group-no-children' | sdTranslate }}</div>\n } @else {\n <div class=\"fb-children-list\">\n @for (child of _group.components; track child.id) {\n <div class=\"fb-child-row\">\n <span class=\"fb-child-row__icon\"><span class=\"msi\">{{ symbolForChild(child) }}</span></span>\n <span class=\"fb-child-row__label\">{{ labelForChild(child) }}</span>\n <span class=\"fb-child-row__key\">{{ child.key }}</span>\n </div>\n }\n </div>\n }\n </div>\n</details>\n\n<details class=\"fb-section\" open>\n <summary class=\"fb-section__head\">\n <span class=\"msi\">visibility</span>\n <span class=\"fb-section__title\">{{ 'core.component.form-builder.display' | sdTranslate }}</span>\n <span class=\"msi chev\">chevron_right</span>\n </summary>\n <div class=\"fb-section__body\">\n <attribute-expression\n [components]=\"[]\"\n [variables]=\"[]\"\n [(model)]=\"_group.properties.visibleWhenExpression\"\n [label]=\"'core.component.form-builder.visible-when' | sdTranslate\">\n </attribute-expression>\n <attribute-expression\n [components]=\"[]\"\n [variables]=\"[]\"\n [(model)]=\"_group.properties.hiddenWhenExpression\"\n [label]=\"'core.component.form-builder.hidden-when' | sdTranslate\">\n </attribute-expression>\n </div>\n</details>\n", styles: [":host{display:block}.fb-children-empty{font-size:12px;color:var(--md-sys-color-on-surface-variant);font-style:italic;padding:8px 0}\n"], dependencies: [{ kind: "component", type: AttributeInput, selector: "attribute-input", inputs: ["form", "label", "disabled", "model"], outputs: ["modelChange", "sdChange"] }, { kind: "component", type: AttributeExpression, selector: "attribute-expression", inputs: ["components", "variables", "label", "model"], outputs: ["modelChange", "sdChange"] }, { kind: "component", type: AttributeSwitch, selector: "attribute-switch", inputs: ["form", "label", "model"], outputs: ["modelChange"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
5417
5417
  }
5418
5418
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: GroupAttribute, decorators: [{
5419
5419
  type: Component,
5420
- args: [{ selector: 'group-attribute', changeDetection: ChangeDetectionStrategy.OnPush, imports: [AttributeInput, AttributeExpression, SdTranslatePipe], template: "@let _group = group();\n\n<details class=\"fb-section\" open>\n <summary class=\"fb-section__head\">\n <span class=\"msi\">info</span>\n <span class=\"fb-section__title\">{{ 'core.component.form-builder.general' | sdTranslate }}</span>\n <span class=\"msi chev\">chevron_right</span>\n </summary>\n <div class=\"fb-section__body\">\n <attribute-input [form]=\"form\" [(model)]=\"_group.label\" [label]=\"'core.component.form-builder.label' | sdTranslate\"></attribute-input>\n\n <div class=\"fb-field\">\n <div class=\"fb-field__label\">{{ 'core.component.form-builder.group-icon' | sdTranslate }}</div>\n <div class=\"fb-icon-picker\">\n @for (icon of iconPresets; track icon) {\n <button type=\"button\" class=\"fb-icon-picker__btn\"\n [class.is-active]=\"_group.properties.icon === icon\"\n (click)=\"pickIcon(icon)\">\n <span class=\"msi\">{{ icon }}</span>\n </button>\n }\n </div>\n </div>\n\n <div class=\"fb-field\">\n <div class=\"fb-field__label\">{{ 'core.component.form-builder.group-accent-color' | sdTranslate }}</div>\n <div class=\"fb-color-swatches\">\n <!-- why: \u00F4 m\u00E0u l\u00E0 control ch\u1ECDn m\u00E0u TH\u1EACT nh\u01B0ng l\u1EA1i l\u00E0 <span (click)> \u2014 kh\u00F4ng nh\u1EADn focus,\n Enter/Space kh\u00F4ng ch\u1ECDn \u0111\u01B0\u1EE3c, v\u00E0 tr\u1EA1ng th\u00E1i \"\u0111ang ch\u1ECDn\" ch\u1EC9 t\u1ED3n t\u1EA1i \u1EDF CSS. \u0110\u1ED5i sang\n <button type=\"button\"> (t\u1EF1 focusable + Enter/Space) v\u00E0 khai aria-pressed \u0111\u1EC3 screen\n reader bi\u1EBFt \u00F4 n\u00E0o \u0111ang \u0111\u01B0\u1EE3c ch\u1ECDn. -->\n @for (color of colorPresets; track color) {\n <button\n type=\"button\"\n class=\"fb-color-swatch\"\n [class]=\"color\"\n [class.is-active]=\"_group.properties.color === color\"\n [attr.aria-pressed]=\"_group.properties.color === color\"\n (click)=\"pickColor(color)\"\n [attr.aria-label]=\"color\"></button>\n }\n </div>\n </div>\n </div>\n</details>\n\n<details class=\"fb-section\" open>\n <summary class=\"fb-section__head\">\n <span class=\"msi\">account_tree</span>\n <span class=\"fb-section__title\">{{ 'core.component.form-builder.group-children' | sdTranslate }}</span>\n <span class=\"msi chev\">chevron_right</span>\n </summary>\n <div class=\"fb-section__body\">\n @if (!_group.components?.length) {\n <div class=\"fb-children-empty\">{{ 'core.component.form-builder.group-no-children' | sdTranslate }}</div>\n } @else {\n <div class=\"fb-children-list\">\n @for (child of _group.components; track child.id) {\n <div class=\"fb-child-row\">\n <span class=\"fb-child-row__icon\"><span class=\"msi\">{{ symbolForChild(child) }}</span></span>\n <span class=\"fb-child-row__label\">{{ labelForChild(child) }}</span>\n <span class=\"fb-child-row__key\">{{ child.key }}</span>\n </div>\n }\n </div>\n }\n </div>\n</details>\n\n<details class=\"fb-section\" open>\n <summary class=\"fb-section__head\">\n <span class=\"msi\">visibility</span>\n <span class=\"fb-section__title\">{{ 'core.component.form-builder.display' | sdTranslate }}</span>\n <span class=\"msi chev\">chevron_right</span>\n </summary>\n <div class=\"fb-section__body\">\n <attribute-expression\n [components]=\"[]\"\n [variables]=\"[]\"\n [(model)]=\"_group.properties.visibleWhenExpression\"\n [label]=\"'core.component.form-builder.visible-when' | sdTranslate\">\n </attribute-expression>\n <attribute-expression\n [components]=\"[]\"\n [variables]=\"[]\"\n [(model)]=\"_group.properties.hiddenWhenExpression\"\n [label]=\"'core.component.form-builder.hidden-when' | sdTranslate\">\n </attribute-expression>\n </div>\n</details>\n", styles: [":host{display:block}.fb-children-empty{font-size:12px;color:var(--md-sys-color-on-surface-variant);font-style:italic;padding:8px 0}\n"] }]
5420
+ args: [{ selector: 'group-attribute', changeDetection: ChangeDetectionStrategy.OnPush, imports: [AttributeInput, AttributeExpression, AttributeSwitch, SdTranslatePipe], template: "@let _group = group();\n\n<details class=\"fb-section\" open>\n <summary class=\"fb-section__head\">\n <span class=\"msi\">info</span>\n <span class=\"fb-section__title\">{{ 'core.component.form-builder.general' | sdTranslate }}</span>\n <span class=\"msi chev\">chevron_right</span>\n </summary>\n <div class=\"fb-section__body\">\n <attribute-input [form]=\"form\" [(model)]=\"_group.label\" [label]=\"'core.component.form-builder.label' | sdTranslate\"></attribute-input>\n <attribute-switch\n [form]=\"form\"\n [(model)]=\"_group.properties.collapsible\"\n [label]=\"'core.component.form-builder.collapsible' | sdTranslate\"></attribute-switch>\n\n <div class=\"fb-field\">\n <div class=\"fb-field__label\">{{ 'core.component.form-builder.group-icon' | sdTranslate }}</div>\n <div class=\"fb-icon-picker\">\n @for (icon of iconPresets; track icon) {\n <button type=\"button\" class=\"fb-icon-picker__btn\"\n [class.is-active]=\"_group.properties.icon === icon\"\n (click)=\"pickIcon(icon)\">\n <span class=\"msi\">{{ icon }}</span>\n </button>\n }\n </div>\n </div>\n\n <div class=\"fb-field\">\n <div class=\"fb-field__label\">{{ 'core.component.form-builder.group-accent-color' | sdTranslate }}</div>\n <div class=\"fb-color-swatches\">\n <!-- why: \u00F4 m\u00E0u l\u00E0 control ch\u1ECDn m\u00E0u TH\u1EACT nh\u01B0ng l\u1EA1i l\u00E0 <span (click)> \u2014 kh\u00F4ng nh\u1EADn focus,\n Enter/Space kh\u00F4ng ch\u1ECDn \u0111\u01B0\u1EE3c, v\u00E0 tr\u1EA1ng th\u00E1i \"\u0111ang ch\u1ECDn\" ch\u1EC9 t\u1ED3n t\u1EA1i \u1EDF CSS. \u0110\u1ED5i sang\n <button type=\"button\"> (t\u1EF1 focusable + Enter/Space) v\u00E0 khai aria-pressed \u0111\u1EC3 screen\n reader bi\u1EBFt \u00F4 n\u00E0o \u0111ang \u0111\u01B0\u1EE3c ch\u1ECDn. -->\n @for (color of colorPresets; track color) {\n <button\n type=\"button\"\n class=\"fb-color-swatch\"\n [class]=\"color\"\n [class.is-active]=\"_group.properties.color === color\"\n [attr.aria-pressed]=\"_group.properties.color === color\"\n (click)=\"pickColor(color)\"\n [attr.aria-label]=\"color\"></button>\n }\n </div>\n </div>\n </div>\n</details>\n\n<details class=\"fb-section\" open>\n <summary class=\"fb-section__head\">\n <span class=\"msi\">account_tree</span>\n <span class=\"fb-section__title\">{{ 'core.component.form-builder.group-children' | sdTranslate }}</span>\n <span class=\"msi chev\">chevron_right</span>\n </summary>\n <div class=\"fb-section__body\">\n @if (!_group.components?.length) {\n <div class=\"fb-children-empty\">{{ 'core.component.form-builder.group-no-children' | sdTranslate }}</div>\n } @else {\n <div class=\"fb-children-list\">\n @for (child of _group.components; track child.id) {\n <div class=\"fb-child-row\">\n <span class=\"fb-child-row__icon\"><span class=\"msi\">{{ symbolForChild(child) }}</span></span>\n <span class=\"fb-child-row__label\">{{ labelForChild(child) }}</span>\n <span class=\"fb-child-row__key\">{{ child.key }}</span>\n </div>\n }\n </div>\n }\n </div>\n</details>\n\n<details class=\"fb-section\" open>\n <summary class=\"fb-section__head\">\n <span class=\"msi\">visibility</span>\n <span class=\"fb-section__title\">{{ 'core.component.form-builder.display' | sdTranslate }}</span>\n <span class=\"msi chev\">chevron_right</span>\n </summary>\n <div class=\"fb-section__body\">\n <attribute-expression\n [components]=\"[]\"\n [variables]=\"[]\"\n [(model)]=\"_group.properties.visibleWhenExpression\"\n [label]=\"'core.component.form-builder.visible-when' | sdTranslate\">\n </attribute-expression>\n <attribute-expression\n [components]=\"[]\"\n [variables]=\"[]\"\n [(model)]=\"_group.properties.hiddenWhenExpression\"\n [label]=\"'core.component.form-builder.hidden-when' | sdTranslate\">\n </attribute-expression>\n </div>\n</details>\n", styles: [":host{display:block}.fb-children-empty{font-size:12px;color:var(--md-sys-color-on-surface-variant);font-style:italic;padding:8px 0}\n"] }]
5421
5421
  }], ctorParameters: () => [] });
5422
5422
 
5423
5423
  // Component xây dựng Expression dựa vào SdFormGenericExpression