@sdcorejs/angular 21.0.3 → 21.0.5

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 (56) hide show
  1. package/assets/{scss/README.md → STYLE-GUIDE.md} +3 -0
  2. package/fesm2022/sdcorejs-angular-components-button.mjs +2 -4
  3. package/fesm2022/sdcorejs-angular-components-button.mjs.map +1 -1
  4. package/fesm2022/sdcorejs-angular-components-form-generic.mjs +7 -11
  5. package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
  6. package/fesm2022/sdcorejs-angular-components-org-chart.mjs +110 -0
  7. package/fesm2022/sdcorejs-angular-components-org-chart.mjs.map +1 -0
  8. package/fesm2022/sdcorejs-angular-components-query-bar.mjs +37 -8
  9. package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
  10. package/fesm2022/sdcorejs-angular-components-query-builder.mjs +867 -57
  11. package/fesm2022/sdcorejs-angular-components-query-builder.mjs.map +1 -1
  12. package/fesm2022/sdcorejs-angular-components-section.mjs +9 -8
  13. package/fesm2022/sdcorejs-angular-components-section.mjs.map +1 -1
  14. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +2 -4
  15. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
  16. package/fesm2022/sdcorejs-angular-components-splitter.mjs +24 -13
  17. package/fesm2022/sdcorejs-angular-components-splitter.mjs.map +1 -1
  18. package/fesm2022/sdcorejs-angular-components-stepper.mjs +2 -4
  19. package/fesm2022/sdcorejs-angular-components-stepper.mjs.map +1 -1
  20. package/fesm2022/sdcorejs-angular-components-tab.mjs +2 -4
  21. package/fesm2022/sdcorejs-angular-components-tab.mjs.map +1 -1
  22. package/fesm2022/sdcorejs-angular-components-table.mjs +8 -6
  23. package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
  24. package/fesm2022/sdcorejs-angular-components-tree.mjs +526 -0
  25. package/fesm2022/sdcorejs-angular-components-tree.mjs.map +1 -0
  26. package/fesm2022/sdcorejs-angular-components-upload-file.mjs +15 -4
  27. package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
  28. package/fesm2022/sdcorejs-angular-components.mjs +2 -0
  29. package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
  30. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +9 -4
  31. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
  32. package/fesm2022/sdcorejs-angular-forms-input-number.mjs +9 -3
  33. package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
  34. package/fesm2022/sdcorejs-angular-forms-input.mjs +2 -2
  35. package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
  36. package/fesm2022/sdcorejs-angular-forms-select.mjs +34 -4
  37. package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
  38. package/fesm2022/sdcorejs-angular-services-notify.mjs +26 -8
  39. package/fesm2022/sdcorejs-angular-services-notify.mjs.map +1 -1
  40. package/package.json +9 -1
  41. package/types/sdcorejs-angular-components-button.d.ts +1 -2
  42. package/types/sdcorejs-angular-components-form-generic.d.ts +3 -4
  43. package/types/sdcorejs-angular-components-org-chart.d.ts +67 -0
  44. package/types/sdcorejs-angular-components-query-bar.d.ts +37 -2
  45. package/types/sdcorejs-angular-components-query-builder.d.ts +313 -23
  46. package/types/sdcorejs-angular-components-section.d.ts +5 -3
  47. package/types/sdcorejs-angular-components-side-drawer.d.ts +1 -2
  48. package/types/sdcorejs-angular-components-splitter.d.ts +20 -1
  49. package/types/sdcorejs-angular-components-stepper.d.ts +1 -2
  50. package/types/sdcorejs-angular-components-tab.d.ts +1 -2
  51. package/types/sdcorejs-angular-components-table.d.ts +3 -2
  52. package/types/sdcorejs-angular-components-tree.d.ts +253 -0
  53. package/types/sdcorejs-angular-components-upload-file.d.ts +2 -0
  54. package/types/sdcorejs-angular-components.d.ts +2 -0
  55. package/types/sdcorejs-angular-forms-select.d.ts +9 -1
  56. package/types/sdcorejs-angular-services-notify.d.ts +17 -0
@@ -1,30 +1,320 @@
1
- import * as i0 from '@angular/core';
2
- import { EventEmitter } from '@angular/core';
1
+ import * as _sdcorejs_angular_components_query_builder from '@sdcorejs/angular/components/query-builder';
2
+ import * as _angular_core from '@angular/core';
3
+ import { Operator, DateRelative, Filter } from '@sdcorejs/utils/models';
3
4
 
4
- interface QueryRule {
5
- field: string;
6
- operator: string;
5
+ /** Field kinds the builder understands. Drives the operator set + value editor. */
6
+ type SdQueryBuilderFieldType = 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'values';
7
+ /** One option for a `values`-type field (enum / lookup). */
8
+ interface SdQueryBuilderFieldOption {
9
+ /** Stored value (sent inside the `Filter`). */
7
10
  value: any;
11
+ /** Human-readable label shown in the select + view-mode string. */
12
+ display: string;
8
13
  }
9
- interface QueryGroup {
10
- condition: 'AND' | 'OR';
11
- rules: (QueryRule | QueryGroup)[];
12
- isOpen?: boolean;
14
+ /**
15
+ * One filterable field. `key` matches `Filter.field` (dot-notation allowed);
16
+ * `label` is what the view-mode raw string renders (field token = label).
17
+ */
18
+ interface SdQueryBuilderField {
19
+ /** Dot-notation field path — written to `Filter.field`. */
20
+ key: string;
21
+ /** Human label — shown in the field picker AND as the view-mode field token. */
22
+ label: string;
23
+ /** Field type — picks the default operator set + value editor control. */
24
+ type: SdQueryBuilderFieldType;
25
+ /** Material icon shown before the label in the field picker; falls back to `QB_TYPE_ICON[type]` then `'tune'`. */
26
+ icon?: string;
27
+ /** Override the allowed operator set (otherwise `QB_OPERATORS_BY_TYPE[type]`). */
28
+ operators?: Operator[];
29
+ /** Override the starting operator (otherwise `QB_DEFAULT_OPERATOR_BY_TYPE[type]`). */
30
+ defaultOperator?: Operator;
31
+ /** Options for `type: 'values'` — the select list + display-label lookup. */
32
+ values?: SdQueryBuilderFieldOption[];
33
+ /** Label for the `true` branch of a boolean field (default `'Có'`). */
34
+ trueLabel?: string;
35
+ /** Label for the `false` branch of a boolean field (default `'Không'`). */
36
+ falseLabel?: string;
37
+ /** Lower bound for number / date value editors. */
38
+ min?: number | string;
39
+ /** Upper bound for number / date value editors. */
40
+ max?: number | string;
41
+ /** Optional domain guard for field-to-field comparison candidates. */
42
+ compareGroup?: string;
43
+ /** Set false to hide this field from field-to-field comparison. */
44
+ allowFieldCompare?: boolean;
13
45
  }
46
+ interface SdQueryBuilderOption {
47
+ autoId?: string;
48
+ fields: SdQueryBuilderField[];
49
+ mode?: 'edit' | 'view';
50
+ comparisonMode?: QbComparisonMode;
51
+ disabled?: boolean;
52
+ value?: Filter | null;
53
+ filters?: Filter[];
54
+ rootLogic?: 'AND' | 'OR';
55
+ onValueChange?: (value: Filter | null) => void;
56
+ onFiltersChange?: (filters: Filter[]) => void;
57
+ onRootLogicChange?: (logic: 'AND' | 'OR') => void;
58
+ }
59
+ type QbNode = QbGroup | QbRule;
60
+ /** Component-level capability for right-hand operands. */
61
+ type QbComparisonMode = 'value-only' | 'value-or-field';
62
+ /** Per-rule right-hand operand source. */
63
+ type QbValueSource = 'literal' | 'field';
64
+ /** A logical group of nodes joined by AND / OR. Maps to `FilterAndOr`. */
65
+ interface QbGroup {
66
+ id: string;
67
+ kind: 'group';
68
+ logic: 'AND' | 'OR';
69
+ children: QbNode[];
70
+ /** UI-only: whether this group's "+" dropdown is open. */
71
+ open?: boolean;
72
+ }
73
+ /** A single `field operator value` condition. Maps to a leaf `Filter`. */
74
+ interface QbRule {
75
+ id: string;
76
+ kind: 'rule';
77
+ field?: string;
78
+ operator?: Operator;
79
+ /** Single value, `{ from, to }` for BETWEEN, or an array for IN / NOT_IN. */
80
+ value?: any;
81
+ /** Internal UI state: literal input or a same-type field reference. */
82
+ valueSource?: QbValueSource;
83
+ /** Right-hand field key when `valueSource` is `'field'`. */
84
+ compareField?: string;
85
+ }
86
+ /** Type guard — narrows a `QbNode` to a `QbGroup`. */
87
+ declare function isQbGroup(node: QbNode): node is QbGroup;
88
+ type QbTokenKind = 'field' | 'op' | 'value' | 'logic' | 'paren' | 'plain';
89
+ /** One piece of the rendered raw query string, tagged for highlight styling. */
90
+ interface QbToken {
91
+ text: string;
92
+ kind: QbTokenKind;
93
+ }
94
+ /** Allowed operators per field type — used when `field.operators` is not set. */
95
+ declare const QB_OPERATORS_BY_TYPE: Record<SdQueryBuilderFieldType, Operator[]>;
96
+ /** Default operator when a rule is first created for a field. */
97
+ declare const QB_DEFAULT_OPERATOR_BY_TYPE: Record<SdQueryBuilderFieldType, Operator>;
98
+ /** Operators with no value payload — the value editor is hidden for these. */
99
+ declare const QB_NO_DATA_OPERATORS: Operator[];
100
+ /** Operators whose value is an array — the value editor offers multi-select. */
101
+ declare const QB_MULTI_OPERATORS: Operator[];
102
+ /** Operators allowed for `field` — explicit override wins, else the per-type set. */
103
+ declare function qbAllowedOperators(field: SdQueryBuilderField | undefined): Operator[];
104
+ /** Starting operator for a new rule on `field` — falls back to the per-type default. */
105
+ declare function qbDefaultOperator(field: SdQueryBuilderField | undefined): Operator | undefined;
106
+ /** True when `op` is NULL / NOT_NULL (no value editor). */
107
+ declare function qbIsNoDataOperator(op: Operator | undefined): boolean;
108
+ /** True when `op` is IN / NOT_IN (array value). */
109
+ declare function qbIsMultiOperator(op: Operator | undefined): boolean;
110
+ /** True when the operator accepts one right-hand operand, including a field reference. */
111
+ declare function qbSupportsFieldCompareOperator(op: Operator | undefined): boolean;
112
+ /**
113
+ * Icon fallback per field type when `SdQueryBuilderField.icon` is not set.
114
+ * Mirrors query-bar's `SD_QUERY_TYPE_ICON` so the two components read consistently,
115
+ * but kept local so query-builder has no dependency on the query-bar package.
116
+ */
117
+ declare const QB_TYPE_ICON: Record<SdQueryBuilderFieldType, string>;
118
+ /**
119
+ * Icon shown before a field in the field picker / selected trigger.
120
+ * Priority: `field.icon` → `QB_TYPE_ICON[field.type]` → `'tune'` (default, like query-bar).
121
+ */
122
+ declare function qbFieldIcon(field: SdQueryBuilderField | undefined): string;
123
+ /** Next stable node id with the given prefix. */
124
+ declare function qbId(prefix?: string): string;
125
+ /** Build a fresh rule node (optionally pre-filled). */
126
+ declare function qbNewRule(field?: string, operator?: Operator, value?: any, valueSource?: QbValueSource, compareField?: string): QbRule;
127
+ /** Build a fresh group node. */
128
+ declare function qbNewGroup(logic?: 'AND' | 'OR', children?: QbNode[]): QbGroup;
129
+ /** Offset unit for a relative date — re-exported from the utils `DateRelative` model. */
130
+ type SdQbRelativeUnit = DateRelative['unit'];
131
+ /** Offset direction for a relative date — re-exported from the utils `DateRelative` model. */
132
+ type SdQbRelativeDirection = DateRelative['direction'];
133
+ /** Sentinel held as a rule value (and emitted as `data`) for the "today" date mode. */
134
+ declare const QB_TODAY = "TODAY";
135
+ /** The `'TODAY'` sentinel type (matches the utils `date-today` data literal). */
136
+ type QbToday = typeof QB_TODAY;
137
+ /** Date value editor mode for a date/datetime rule (derived from the rule value). */
138
+ type QbDateMode = 'absolute' | 'now' | 'relative';
139
+ /** Type guard — narrows a rule value to a utils `DateRelative` (offset spec). */
140
+ declare const qbIsRelativeDate: (v: any) => v is DateRelative;
141
+ /** Type guard — narrows a rule value to the `'TODAY'` sentinel ("now"/today mode). */
142
+ declare function qbIsToday(v: any): v is QbToday;
143
+ /** Starting relative value when a rule first switches to "relative" mode. */
144
+ declare function qbDefaultRelative(): DateRelative;
145
+ /** One date-mode option — carries a Material icon shown in the dropdown + selected trigger. */
146
+ interface QbDateModeOption {
147
+ value: QbDateMode;
148
+ display: string;
149
+ /** Material icon name (outlined set). */
150
+ icon: string;
151
+ }
152
+ /** Stable option list for the date-mode select (module ref — never reallocated). */
153
+ declare const QB_DATE_MODES: ReadonlyArray<QbDateModeOption>;
154
+ /** One value-source option for field-to-field comparison UI. */
155
+ interface QbValueSourceOption {
156
+ value: QbValueSource;
157
+ display: string;
158
+ /** Material icon name (outlined set). */
159
+ icon: string;
160
+ }
161
+ /** Stable option list for choosing between a literal value and another field. */
162
+ declare const QB_VALUE_SOURCE_OPTIONS: ReadonlyArray<QbValueSourceOption>;
163
+ /** Stable combined direction×unit option list (token `'unit:direction'`). */
164
+ declare const QB_RELATIVE_UNIT_OPTIONS: ReadonlyArray<{
165
+ value: string;
166
+ display: string;
167
+ }>;
168
+ /** Shared empty option array — stable ref for fallbacks (avoids per-call allocation). */
169
+ declare const QB_EMPTY_OPTIONS: SdQueryBuilderFieldOption[];
170
+
171
+ /**
172
+ * Visual filter / rule builder. Compose nested AND / OR groups of
173
+ * `field operator value` conditions; emits the canonical `Filter` (root is a
174
+ * `FilterAndOr` tree) via `[(value)]`, plus a flat `[(filters)]` mirror of the
175
+ * root group's direct children. `mode="view"` renders a read-only SQL-ish raw
176
+ * string with highlighted operators + values.
177
+ */
14
178
  declare class SdQueryBuilder {
15
- group: QueryGroup;
16
- groupChange: EventEmitter<QueryGroup>;
17
- isGroup(item: any): item is QueryGroup;
18
- toggleCondition(group: QueryGroup, condition: 'AND' | 'OR'): void;
19
- toggleDropdown(group: QueryGroup, event: Event): void;
20
- closeAll(): void;
21
- closeAllDropdowns(group: QueryGroup): void;
22
- addRule(group: QueryGroup): void;
23
- addGroup(group: QueryGroup): void;
24
- removeItem(parentGroup: QueryGroup, index: number): void;
25
- static ɵfac: i0.ɵɵFactoryDeclaration<SdQueryBuilder, never>;
26
- static ɵcmp: i0.ɵɵComponentDeclaration<SdQueryBuilder, "sd-query-builder", never, { "group": { "alias": "group"; "required": false; }; }, { "groupChange": "groupChange"; }, never, never, true, never>;
179
+ #private;
180
+ /** Main option object. Prefer this API for new usage; individual inputs stay as a migration bridge. */
181
+ readonly option: _angular_core.InputSignal<SdQueryBuilderOption | undefined>;
182
+ /** Filterable fields each declares a `type` that drives the operator set + value editor. */
183
+ readonly fields: _angular_core.InputSignal<SdQueryBuilderField[]>;
184
+ /** `'edit'` (default) = interactive tree · `'view'` = read-only raw-query string. */
185
+ readonly mode: _angular_core.InputSignal<"edit" | "view">;
186
+ /** `value-only` = literal operands only · `value-or-field` = each rule may compare against another field. */
187
+ readonly comparisonMode: _angular_core.InputSignal<QbComparisonMode>;
188
+ /** Disable all editing controls. */
189
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
190
+ /** Prefix for `data-autoid` on inner controls (E2E selectors). */
191
+ readonly autoId: _angular_core.InputSignal<string | undefined>;
192
+ /** Canonical output — the root `FilterAndOr` tree, or `null` when empty. `[(value)]`. */
193
+ readonly value: _angular_core.ModelSignal<Filter | null>;
194
+ /** Convenience mirror — the root group's direct children. `[(filters)]`. */
195
+ readonly filters: _angular_core.ModelSignal<Filter[]>;
196
+ /** Root group's logical connector. `[(rootLogic)]`. */
197
+ readonly rootLogic: _angular_core.ModelSignal<"AND" | "OR">;
198
+ readonly tree: _angular_core.Signal<QbGroup>;
199
+ /** `field.key` → field, for fast lookup from a rule. */
200
+ readonly resolvedFields: _angular_core.Signal<SdQueryBuilderField[]>;
201
+ readonly resolvedMode: _angular_core.Signal<"edit" | "view">;
202
+ readonly resolvedComparisonMode: _angular_core.Signal<QbComparisonMode>;
203
+ readonly resolvedDisabled: _angular_core.Signal<boolean>;
204
+ readonly resolvedAutoId: _angular_core.Signal<string | undefined>;
205
+ readonly fieldByKey: _angular_core.Signal<Record<string, SdQueryBuilderField>>;
206
+ /** Stable option list for the date-mode select. */
207
+ readonly dateModes: readonly _sdcorejs_angular_components_query_builder.QbDateModeOption[];
208
+ /** Stable option list for the literal-vs-field operand select. */
209
+ readonly valueSourceOptions: readonly _sdcorejs_angular_components_query_builder.QbValueSourceOption[];
210
+ /** Stable combined unit×direction option list for the relative select. */
211
+ readonly relativeUnitOptions: readonly {
212
+ value: string;
213
+ display: string;
214
+ }[];
215
+ /** View-mode token stream — recomputed from the emitted value. */
216
+ readonly tokens: _angular_core.Signal<QbToken[]>;
217
+ readonly isView: _angular_core.Signal<boolean>;
218
+ /** Expose the type-guard to the template. */
219
+ readonly isGroup: typeof isQbGroup;
220
+ /** Resolve the leading icon for a field (own `icon` → per-type → `'tune'`) — used by the field picker. */
221
+ readonly fieldIcon: typeof qbFieldIcon;
222
+ constructor();
223
+ /** Switch a group's AND/OR connector and re-emit. No-op when disabled or unchanged. */
224
+ setGroupLogic(group: QbGroup, logic: 'AND' | 'OR'): void;
225
+ /** Open this group's "+" menu (closing any other open one). UI-only — does not emit. */
226
+ toggleDropdown(group: QbGroup, event: Event): void;
227
+ closeAllDropdowns(): void;
228
+ /** Append a blank rule to `group`. */
229
+ addRule(group: QbGroup): void;
230
+ /** Append a nested sub-group (seeded with one blank rule) to `group`. */
231
+ addGroup(group: QbGroup): void;
232
+ /** Remove the child at `index` from `parent` (a rule or a whole sub-group). */
233
+ removeNode(parent: QbGroup, index: number): void;
234
+ /**
235
+ * Point `rule` at a new field. Resets operator to the field's default and the value
236
+ * to that operator's empty shape — the old operator/value rarely fit the new type.
237
+ *
238
+ * @param rule - the rule being edited.
239
+ * @param key - the chosen field key (from the field picker). Swap-only: a null / undefined
240
+ * key is a no-op — the field can be changed but never cleared (issue #2).
241
+ */
242
+ setField(rule: QbRule, key: any): void;
243
+ /** Change `rule`'s operator and reshape its value to fit the new operator (array / range / none). */
244
+ setOperator(rule: QbRule, op: Operator | undefined): void;
245
+ /** Set a single-value rule's value (coercing numeric fields to `number`). */
246
+ setScalar(rule: QbRule, raw: any): void;
247
+ /** Set the lower bound of a BETWEEN rule's `{ from, to }` value. */
248
+ setBetweenFrom(rule: QbRule, raw: any): void;
249
+ /** Set the upper bound of a BETWEEN rule's `{ from, to }` value. */
250
+ setBetweenTo(rule: QbRule, raw: any): void;
251
+ setValueSource(rule: QbRule, source: QbValueSource): void;
252
+ setCompareField(rule: QbRule, key: any): void;
253
+ /** The field metadata for a rule's current `field` key (or undefined if unset). */
254
+ fieldOf(rule: QbRule): SdQueryBuilderField | undefined;
255
+ /** Operators allowed for a rule, derived from its field's type / override. */
256
+ allowedOperators(rule: QbRule): Operator[];
257
+ /** Whether to render the operator picker — hidden when only one operator is allowed. */
258
+ showOperatorSelector(rule: QbRule): boolean;
259
+ compareFields(rule: QbRule): SdQueryBuilderField[];
260
+ canCompareWithField(rule: QbRule): boolean;
261
+ showValueSourceSelector(rule: QbRule): boolean;
262
+ valueSourceOf(rule: QbRule): QbValueSource;
263
+ isFieldSource(rule: QbRule): boolean;
264
+ /** True for NULL / NOT_NULL — the template then renders no value editor. */
265
+ isNoData(op: Operator | undefined): boolean;
266
+ /** True for IN / NOT_IN — the template then renders a multi-select value editor. */
267
+ isMulti(op: Operator | undefined): boolean;
268
+ /** `[true/false]` option list for a boolean field's value select (stable reference). */
269
+ booleanItems(field: SdQueryBuilderField): SdQueryBuilderFieldOption[];
270
+ /** Current date-value mode of a rule, derived from its value (no separate state). */
271
+ dateMode(rule: QbRule): QbDateMode;
272
+ /** Switch a date/datetime rule's value mode, reseeding the value for the new mode. */
273
+ setDateMode(rule: QbRule, mode: QbDateMode): void;
274
+ /** Read the offset amount of a relative rule (default 1). */
275
+ relativeAmount(rule: QbRule): number;
276
+ /** Set the offset amount (clamped to an integer >= 1). */
277
+ setRelativeAmount(rule: QbRule, raw: any): void;
278
+ /** Read the `'unit:direction'` token of a relative rule (default `'day:previous'`). */
279
+ relativeUnitDirValue(rule: QbRule): string;
280
+ /** Set the offset unit + direction from a `'unit:direction'` token. */
281
+ setRelativeUnitDir(rule: QbRule, token: string): void;
282
+ /** Build a `data-autoid` for an inner control under this builder's `autoId` prefix. */
283
+ autoIdFor(suffix: string): string;
284
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdQueryBuilder, never>;
285
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdQueryBuilder, "sd-query-builder", never, { "option": { "alias": "option"; "required": false; "isSignal": true; }; "fields": { "alias": "fields"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "comparisonMode": { "alias": "comparisonMode"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "autoId": { "alias": "autoId"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "filters": { "alias": "filters"; "required": false; "isSignal": true; }; "rootLogic": { "alias": "rootLogic"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "filters": "filtersChange"; "rootLogic": "rootLogicChange"; }, never, never, true, never>;
27
286
  }
28
287
 
29
- export { SdQueryBuilder };
30
- export type { QueryGroup, QueryRule };
288
+ /**
289
+ * Map the internal builder tree to the public `Filter` (the root is always a
290
+ * `FilterAndOr`). Rules missing field / operator / value — and empty nested
291
+ * groups — are dropped so the result is always a valid `Filter`.
292
+ *
293
+ * @param group - the editable tree's root group.
294
+ * @returns the canonical nested `Filter`, or `null` when no complete rule survives.
295
+ */
296
+ declare function treeToFilter(group: QbGroup): Filter | null;
297
+ /**
298
+ * Inverse of {@link treeToFilter} — rebuild the editable tree from a `Filter` so a
299
+ * consumer can seed `[value]`. A non-group (bare) filter is wrapped in an AND root;
300
+ * `null` yields an empty AND root.
301
+ *
302
+ * @param filter - a `Filter` (group or leaf), or `null` / `undefined` for an empty tree.
303
+ * @returns a fresh root `QbGroup` mirroring the filter's structure.
304
+ */
305
+ declare function filterToTree(filter: Filter | null | undefined): QbGroup;
306
+ /**
307
+ * Render a `Filter` to a SQL-ish token stream for view mode. Field tokens use the
308
+ * matching field's `label`; operators map to SQL syntax (`= != like between is null …`);
309
+ * `and` / `or` are lowercase; nested multi-child groups are wrapped in parentheses.
310
+ * Returns a token stream (not a string) so the template can wrap each piece in a
311
+ * highlight `<span>` keyed by `QbToken.kind`.
312
+ *
313
+ * @param filter - the `Filter` to render, or `null` / `undefined`.
314
+ * @param fields - field metadata, used to resolve each field key to its display label + value formatting.
315
+ * @returns the ordered tokens, or `[]` when `filter` is empty.
316
+ */
317
+ declare function filterToTokens(filter: Filter | null | undefined, fields: SdQueryBuilderField[]): QbToken[];
318
+
319
+ export { QB_DATE_MODES, QB_DEFAULT_OPERATOR_BY_TYPE, QB_EMPTY_OPTIONS, QB_MULTI_OPERATORS, QB_NO_DATA_OPERATORS, QB_OPERATORS_BY_TYPE, QB_RELATIVE_UNIT_OPTIONS, QB_TODAY, QB_TYPE_ICON, QB_VALUE_SOURCE_OPTIONS, SdQueryBuilder, filterToTokens, filterToTree, isQbGroup, qbAllowedOperators, qbDefaultOperator, qbDefaultRelative, qbFieldIcon, qbId, qbIsMultiOperator, qbIsNoDataOperator, qbIsRelativeDate, qbIsToday, qbNewGroup, qbNewRule, qbSupportsFieldCompareOperator, treeToFilter };
320
+ export type { QbComparisonMode, QbDateMode, QbDateModeOption, QbGroup, QbNode, QbRule, QbToday, QbToken, QbTokenKind, QbValueSource, QbValueSourceOption, SdQbRelativeDirection, SdQbRelativeUnit, SdQueryBuilderField, SdQueryBuilderFieldOption, SdQueryBuilderFieldType, SdQueryBuilderOption };
@@ -1,21 +1,23 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { SdBaseSecureComponent } from '@sdcorejs/angular/components/base';
3
2
  import { Color } from '@sdcorejs/utils/models';
4
3
 
5
- declare class SdSection extends SdBaseSecureComponent {
4
+ declare class SdSection {
6
5
  #private;
7
6
  title: _angular_core.InputSignal<string | null | undefined>;
8
7
  subTitle: _angular_core.InputSignal<string | null | undefined>;
9
8
  icon: _angular_core.InputSignal<string | null | undefined>;
10
9
  iconColor: _angular_core.InputSignal<Color>;
11
10
  collapsed: _angular_core.ModelSignal<boolean>;
11
+ collapsible: _angular_core.InputSignalWithTransform<boolean, unknown>;
12
+ /** @deprecated Use `collapsible` instead. */
12
13
  collapsable: _angular_core.InputSignalWithTransform<boolean, unknown>;
14
+ readonly isCollapsible: _angular_core.Signal<boolean>;
13
15
  hideHeader: _angular_core.InputSignalWithTransform<boolean, unknown>;
14
16
  noPaddingBody: _angular_core.InputSignalWithTransform<boolean, unknown>;
15
17
  constructor();
16
18
  toggleCollapse: () => void;
17
19
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdSection, never>;
18
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdSection, "sd-section", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "subTitle": { "alias": "subTitle"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "iconColor": { "alias": "iconColor"; "required": false; "isSignal": true; }; "collapsed": { "alias": "collapsed"; "required": false; "isSignal": true; }; "collapsable": { "alias": "collapsable"; "required": false; "isSignal": true; }; "hideHeader": { "alias": "hideHeader"; "required": false; "isSignal": true; }; "noPaddingBody": { "alias": "noPaddingBody"; "required": false; "isSignal": true; }; }, { "collapsed": "collapsedChange"; }, never, ["[sdHeaderLeft]", "[sdHeaderRight]", "*"], true, never>;
20
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdSection, "sd-section", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "subTitle": { "alias": "subTitle"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "iconColor": { "alias": "iconColor"; "required": false; "isSignal": true; }; "collapsed": { "alias": "collapsed"; "required": false; "isSignal": true; }; "collapsible": { "alias": "collapsible"; "required": false; "isSignal": true; }; "collapsable": { "alias": "collapsable"; "required": false; "isSignal": true; }; "hideHeader": { "alias": "hideHeader"; "required": false; "isSignal": true; }; "noPaddingBody": { "alias": "noPaddingBody"; "required": false; "isSignal": true; }; }, { "collapsed": "collapsedChange"; }, never, ["[sdHeaderLeft]", "[sdHeaderRight]", "*"], true, never>;
19
21
  }
20
22
 
21
23
  declare class SdSectionItem {
@@ -1,9 +1,8 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { CdkPortal } from '@angular/cdk/portal';
3
- import { SdBaseSecureComponent } from '@sdcorejs/angular/components/base';
4
3
  import { Observable } from 'rxjs';
5
4
 
6
- declare class SdSideDrawer extends SdBaseSecureComponent {
5
+ declare class SdSideDrawer {
7
6
  #private;
8
7
  id: string;
9
8
  portal: _angular_core.Signal<CdkPortal>;
@@ -13,6 +13,19 @@ interface SplitterLayoutState {
13
13
  v: 1;
14
14
  panels: SplitterPanelState[];
15
15
  }
16
+ interface SdSplitterOption {
17
+ orientation?: SplitterOrientation;
18
+ disabled?: boolean;
19
+ storageKey?: string;
20
+ snapThreshold?: number;
21
+ keyboardStep?: number;
22
+ onResizeEnd?: (state: SplitterLayoutState) => void;
23
+ onCollapsedChange?: (event: {
24
+ panelId: string | number;
25
+ collapsed: boolean;
26
+ }) => void;
27
+ onLayoutChange?: (state: SplitterLayoutState) => void;
28
+ }
16
29
 
17
30
  declare class SdSplitterPanelComponent {
18
31
  readonly elementRef: ElementRef<HTMLElement>;
@@ -30,11 +43,17 @@ declare class SdSplitterPanelComponent {
30
43
 
31
44
  declare class SdSplitterComponent {
32
45
  #private;
46
+ option: _angular_core.InputSignal<SdSplitterOption | undefined>;
33
47
  orientation: _angular_core.InputSignal<SplitterOrientation>;
34
48
  disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
35
49
  storageKey: _angular_core.InputSignal<string | undefined>;
36
50
  snapThreshold: _angular_core.InputSignalWithTransform<number, unknown>;
37
51
  keyboardStep: _angular_core.InputSignalWithTransform<number, unknown>;
52
+ resolvedOrientation: _angular_core.Signal<SplitterOrientation>;
53
+ resolvedDisabled: _angular_core.Signal<boolean>;
54
+ resolvedStorageKey: _angular_core.Signal<string | undefined>;
55
+ resolvedSnapThreshold: _angular_core.Signal<number>;
56
+ resolvedKeyboardStep: _angular_core.Signal<number>;
38
57
  readonly resizeEnd: _angular_core.OutputEmitterRef<SplitterLayoutState>;
39
58
  readonly collapsedChange: _angular_core.OutputEmitterRef<{
40
59
  panelId: string | number;
@@ -51,7 +70,7 @@ declare class SdSplitterComponent {
51
70
  toggle(target: number | string): void;
52
71
  resizePanel(target: number | string, size: number): void;
53
72
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdSplitterComponent, never>;
54
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdSplitterComponent, "sd-splitter", never, { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "storageKey": { "alias": "storageKey"; "required": false; "isSignal": true; }; "snapThreshold": { "alias": "snapThreshold"; "required": false; "isSignal": true; }; "keyboardStep": { "alias": "keyboardStep"; "required": false; "isSignal": true; }; }, { "resizeEnd": "resizeEnd"; "collapsedChange": "collapsedChange"; "layoutChange": "layoutChange"; }, ["panels"], ["sd-splitter-panel"], true, never>;
73
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdSplitterComponent, "sd-splitter", never, { "option": { "alias": "option"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "storageKey": { "alias": "storageKey"; "required": false; "isSignal": true; }; "snapThreshold": { "alias": "snapThreshold"; "required": false; "isSignal": true; }; "keyboardStep": { "alias": "keyboardStep"; "required": false; "isSignal": true; }; }, { "resizeEnd": "resizeEnd"; "collapsedChange": "collapsedChange"; "layoutChange": "layoutChange"; }, ["panels"], ["sd-splitter-panel"], true, never>;
55
74
  }
56
75
 
57
76
  export { SdSplitterComponent, SdSplitterPanelComponent };
@@ -3,7 +3,6 @@ import { TemplateRef } from '@angular/core';
3
3
  import { AbstractControl } from '@angular/forms';
4
4
  import { StepperSelectionEvent } from '@angular/cdk/stepper';
5
5
  import { MatStepper } from '@angular/material/stepper';
6
- import { SdBaseSecureComponent } from '@sdcorejs/angular/components/base';
7
6
  import { Color } from '@sdcorejs/utils/models';
8
7
 
9
8
  type SdStepState = 'pending' | 'active' | 'completed' | 'error' | string;
@@ -21,7 +20,7 @@ declare class SdStep {
21
20
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdStep, "sd-step", never, { "label": { "alias": "label"; "required": true; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "optional": { "alias": "optional"; "required": false; "isSignal": true; }; "editable": { "alias": "editable"; "required": false; "isSignal": true; }; "stepControl": { "alias": "stepControl"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; }, { "selectChange": "selectChange"; }, never, ["*"], true, never>;
22
21
  }
23
22
 
24
- declare class SdStepper extends SdBaseSecureComponent {
23
+ declare class SdStepper {
25
24
  steps: _angular_core.Signal<readonly SdStep[]>;
26
25
  selectedIndex: _angular_core.ModelSignal<number>;
27
26
  linear: _angular_core.InputSignalWithTransform<boolean, unknown>;
@@ -1,7 +1,6 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { TemplateRef } from '@angular/core';
3
3
  import { MatTabGroup } from '@angular/material/tabs';
4
- import { SdBaseSecureComponent } from '@sdcorejs/angular/components/base';
5
4
  import { Color } from '@sdcorejs/utils/models';
6
5
 
7
6
  declare class SdTab {
@@ -20,7 +19,7 @@ interface SdTabClosedEvent {
20
19
  index: number;
21
20
  tab: SdTab;
22
21
  }
23
- declare class SdTabGroup extends SdBaseSecureComponent {
22
+ declare class SdTabGroup {
24
23
  tabs: _angular_core.Signal<readonly SdTab[]>;
25
24
  selectedIndex: _angular_core.ModelSignal<number>;
26
25
  variant: _angular_core.InputSignal<"line" | "pills" | "segmented">;
@@ -11,7 +11,6 @@ import { SdExcelColumn, SdLoadingService, SdExcelService, SdNotifyService, SdCon
11
11
  import { Observable } from 'rxjs';
12
12
  import { SdButton } from '@sdcorejs/angular/components/button';
13
13
  import { CdkDrag, CdkDropList, CdkDragDrop } from '@angular/cdk/drag-drop';
14
- import { SdBaseSecureComponent } from '@sdcorejs/angular/components/base';
15
14
  import { SdQuickAction } from '@sdcorejs/angular/components/quick-action';
16
15
  import { SdScrollDirective } from '@sdcorejs/angular/directives';
17
16
  import { FormGroup } from '@angular/forms';
@@ -340,6 +339,8 @@ interface SdTableOptionFilter<T = any> {
340
339
  /** Chế độ thủ công: phải nhấn nút áp dụng mới gửi filter */
341
340
  manualFilter?: boolean;
342
341
  /** Có thể thu gọn bộ lọc hay không */
342
+ collapsible?: boolean;
343
+ /** @deprecated Use `collapsible` instead. */
343
344
  collapsable?: boolean;
344
345
  /** Ẩn toolbar (xóa bộ lọc, thiết lập) của external filter, khi có ít external filter user không cần chức năng này */
345
346
  hideExternalFilterToolbar?: boolean;
@@ -1145,7 +1146,7 @@ declare class MatPaginatorIntlCro extends MatPaginatorIntl {
1145
1146
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<MatPaginatorIntlCro, never>;
1146
1147
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<MatPaginatorIntlCro>;
1147
1148
  }
1148
- declare class SdTable<T = unknown> extends SdBaseSecureComponent implements OnInit, AfterViewInit, OnDestroy {
1149
+ declare class SdTable<T = unknown> implements OnInit, AfterViewInit, OnDestroy {
1149
1150
  #private;
1150
1151
  autoIdInput: _angular_core.InputSignal<string | null | undefined>;
1151
1152
  autoId: _angular_core.Signal<string | undefined>;