@sdcorejs/angular 21.0.3 → 21.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/sdcorejs-angular-components-button.mjs +2 -4
- package/fesm2022/sdcorejs-angular-components-button.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs +6 -10
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-builder.mjs +669 -57
- package/fesm2022/sdcorejs-angular-components-query-builder.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-section.mjs +2 -4
- package/fesm2022/sdcorejs-angular-components-section.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +2 -4
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-stepper.mjs +2 -4
- package/fesm2022/sdcorejs-angular-components-stepper.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tab.mjs +2 -4
- package/fesm2022/sdcorejs-angular-components-tab.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-table.mjs +2 -4
- package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs +15 -4
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +7 -2
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs +9 -3
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-notify.mjs +26 -8
- package/fesm2022/sdcorejs-angular-services-notify.mjs.map +1 -1
- package/package.json +1 -1
- package/types/sdcorejs-angular-components-button.d.ts +1 -2
- package/types/sdcorejs-angular-components-form-generic.d.ts +3 -4
- package/types/sdcorejs-angular-components-query-builder.d.ts +247 -23
- package/types/sdcorejs-angular-components-section.d.ts +1 -2
- package/types/sdcorejs-angular-components-side-drawer.d.ts +1 -2
- package/types/sdcorejs-angular-components-stepper.d.ts +1 -2
- package/types/sdcorejs-angular-components-tab.d.ts +1 -2
- package/types/sdcorejs-angular-components-table.d.ts +1 -2
- package/types/sdcorejs-angular-components-upload-file.d.ts +2 -0
- package/types/sdcorejs-angular-services-notify.d.ts +17 -0
|
@@ -1,30 +1,254 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { Operator, Filter } from '@sdcorejs/utils/models';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
/** Field kinds the builder understands. Drives the operator set + value editor. */
|
|
5
|
+
type SdQueryBuilderFieldType = 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'values';
|
|
6
|
+
/** One option for a `values`-type field (enum / lookup). */
|
|
7
|
+
interface SdQueryBuilderFieldOption {
|
|
8
|
+
/** Stored value (sent inside the `Filter`). */
|
|
7
9
|
value: any;
|
|
10
|
+
/** Human-readable label shown in the select + view-mode string. */
|
|
11
|
+
display: string;
|
|
8
12
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
/**
|
|
14
|
+
* One filterable field. `key` matches `Filter.field` (dot-notation allowed);
|
|
15
|
+
* `label` is what the view-mode raw string renders (field token = label).
|
|
16
|
+
*/
|
|
17
|
+
interface SdQueryBuilderField {
|
|
18
|
+
/** Dot-notation field path — written to `Filter.field`. */
|
|
19
|
+
key: string;
|
|
20
|
+
/** Human label — shown in the field picker AND as the view-mode field token. */
|
|
21
|
+
label: string;
|
|
22
|
+
/** Field type — picks the default operator set + value editor control. */
|
|
23
|
+
type: SdQueryBuilderFieldType;
|
|
24
|
+
/** Override the allowed operator set (otherwise `QB_OPERATORS_BY_TYPE[type]`). */
|
|
25
|
+
operators?: Operator[];
|
|
26
|
+
/** Override the starting operator (otherwise `QB_DEFAULT_OPERATOR_BY_TYPE[type]`). */
|
|
27
|
+
defaultOperator?: Operator;
|
|
28
|
+
/** Options for `type: 'values'` — the select list + display-label lookup. */
|
|
29
|
+
values?: SdQueryBuilderFieldOption[];
|
|
30
|
+
/** Label for the `true` branch of a boolean field (default `'Có'`). */
|
|
31
|
+
trueLabel?: string;
|
|
32
|
+
/** Label for the `false` branch of a boolean field (default `'Không'`). */
|
|
33
|
+
falseLabel?: string;
|
|
34
|
+
/** Lower bound for number / date value editors. */
|
|
35
|
+
min?: number | string;
|
|
36
|
+
/** Upper bound for number / date value editors. */
|
|
37
|
+
max?: number | string;
|
|
13
38
|
}
|
|
39
|
+
type QbNode = QbGroup | QbRule;
|
|
40
|
+
/** A logical group of nodes joined by AND / OR. Maps to `FilterAndOr`. */
|
|
41
|
+
interface QbGroup {
|
|
42
|
+
id: string;
|
|
43
|
+
kind: 'group';
|
|
44
|
+
logic: 'AND' | 'OR';
|
|
45
|
+
children: QbNode[];
|
|
46
|
+
/** UI-only: whether this group's "+" dropdown is open. */
|
|
47
|
+
open?: boolean;
|
|
48
|
+
}
|
|
49
|
+
/** A single `field operator value` condition. Maps to a leaf `Filter`. */
|
|
50
|
+
interface QbRule {
|
|
51
|
+
id: string;
|
|
52
|
+
kind: 'rule';
|
|
53
|
+
field?: string;
|
|
54
|
+
operator?: Operator;
|
|
55
|
+
/** Single value, `{ from, to }` for BETWEEN, or an array for IN / NOT_IN. */
|
|
56
|
+
value?: any;
|
|
57
|
+
}
|
|
58
|
+
/** Type guard — narrows a `QbNode` to a `QbGroup`. */
|
|
59
|
+
declare function isQbGroup(node: QbNode): node is QbGroup;
|
|
60
|
+
type QbTokenKind = 'field' | 'op' | 'value' | 'logic' | 'paren' | 'plain';
|
|
61
|
+
/** One piece of the rendered raw query string, tagged for highlight styling. */
|
|
62
|
+
interface QbToken {
|
|
63
|
+
text: string;
|
|
64
|
+
kind: QbTokenKind;
|
|
65
|
+
}
|
|
66
|
+
/** Allowed operators per field type — used when `field.operators` is not set. */
|
|
67
|
+
declare const QB_OPERATORS_BY_TYPE: Record<SdQueryBuilderFieldType, Operator[]>;
|
|
68
|
+
/** Default operator when a rule is first created for a field. */
|
|
69
|
+
declare const QB_DEFAULT_OPERATOR_BY_TYPE: Record<SdQueryBuilderFieldType, Operator>;
|
|
70
|
+
/** Operators with no value payload — the value editor is hidden for these. */
|
|
71
|
+
declare const QB_NO_DATA_OPERATORS: Operator[];
|
|
72
|
+
/** Operators whose value is an array — the value editor offers multi-select. */
|
|
73
|
+
declare const QB_MULTI_OPERATORS: Operator[];
|
|
74
|
+
/** Operators allowed for `field` — explicit override wins, else the per-type set. */
|
|
75
|
+
declare function qbAllowedOperators(field: SdQueryBuilderField | undefined): Operator[];
|
|
76
|
+
/** Starting operator for a new rule on `field` — falls back to the per-type default. */
|
|
77
|
+
declare function qbDefaultOperator(field: SdQueryBuilderField | undefined): Operator | undefined;
|
|
78
|
+
/** True when `op` is NULL / NOT_NULL (no value editor). */
|
|
79
|
+
declare function qbIsNoDataOperator(op: Operator | undefined): boolean;
|
|
80
|
+
/** True when `op` is IN / NOT_IN (array value). */
|
|
81
|
+
declare function qbIsMultiOperator(op: Operator | undefined): boolean;
|
|
82
|
+
/** Next stable node id with the given prefix. */
|
|
83
|
+
declare function qbId(prefix?: string): string;
|
|
84
|
+
/** Build a fresh rule node (optionally pre-filled). */
|
|
85
|
+
declare function qbNewRule(field?: string, operator?: Operator, value?: any): QbRule;
|
|
86
|
+
/** Build a fresh group node. */
|
|
87
|
+
declare function qbNewGroup(logic?: 'AND' | 'OR', children?: QbNode[]): QbGroup;
|
|
88
|
+
/** Offset unit for a relative date. */
|
|
89
|
+
type SdQbRelativeUnit = 'day' | 'week' | 'month';
|
|
90
|
+
/** Offset direction for a relative date. */
|
|
91
|
+
type SdQbRelativeDirection = 'previous' | 'next';
|
|
92
|
+
/** A relative (resolved-at-query-time) date value stored in `Filter.data`. */
|
|
93
|
+
interface SdQbRelativeDate {
|
|
94
|
+
/** `'now'` = current moment / today · `'offset'` = now ± amount × unit. */
|
|
95
|
+
rel: 'now' | 'offset';
|
|
96
|
+
/** Offset unit — only for `rel: 'offset'`. */
|
|
97
|
+
unit?: SdQbRelativeUnit;
|
|
98
|
+
/** Offset magnitude (>= 1) — only for `rel: 'offset'`. */
|
|
99
|
+
amount?: number;
|
|
100
|
+
/** Offset direction — only for `rel: 'offset'`. */
|
|
101
|
+
direction?: SdQbRelativeDirection;
|
|
102
|
+
}
|
|
103
|
+
/** Date value editor mode for a date/datetime rule (derived from the rule value). */
|
|
104
|
+
type QbDateMode = 'absolute' | 'now' | 'relative';
|
|
105
|
+
/** Type guard — narrows an arbitrary value to a relative-date spec. */
|
|
106
|
+
declare function qbIsRelativeDate(v: any): v is SdQbRelativeDate;
|
|
107
|
+
/** Starting relative value when a rule first switches to "relative" mode. */
|
|
108
|
+
declare function qbDefaultRelative(): SdQbRelativeDate;
|
|
109
|
+
/** Stable option list for the date-mode select (module ref — never reallocated). */
|
|
110
|
+
declare const QB_DATE_MODES: ReadonlyArray<{
|
|
111
|
+
value: QbDateMode;
|
|
112
|
+
display: string;
|
|
113
|
+
}>;
|
|
114
|
+
/** Stable combined direction×unit option list (token `'unit:direction'`). */
|
|
115
|
+
declare const QB_RELATIVE_UNIT_OPTIONS: ReadonlyArray<{
|
|
116
|
+
value: string;
|
|
117
|
+
display: string;
|
|
118
|
+
}>;
|
|
119
|
+
/** Shared empty option array — stable ref for fallbacks (avoids per-call allocation). */
|
|
120
|
+
declare const QB_EMPTY_OPTIONS: SdQueryBuilderFieldOption[];
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Visual filter / rule builder. Compose nested AND / OR groups of
|
|
124
|
+
* `field operator value` conditions; emits the canonical `Filter` (root is a
|
|
125
|
+
* `FilterAndOr` tree) via `[(value)]`, plus a flat `[(filters)]` mirror of the
|
|
126
|
+
* root group's direct children. `mode="view"` renders a read-only SQL-ish raw
|
|
127
|
+
* string with highlighted operators + values.
|
|
128
|
+
*/
|
|
14
129
|
declare class SdQueryBuilder {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
130
|
+
#private;
|
|
131
|
+
/** Filterable fields — each declares a `type` that drives the operator set + value editor. */
|
|
132
|
+
readonly fields: _angular_core.InputSignal<SdQueryBuilderField[]>;
|
|
133
|
+
/** `'edit'` (default) = interactive tree · `'view'` = read-only raw-query string. */
|
|
134
|
+
readonly mode: _angular_core.InputSignal<"edit" | "view">;
|
|
135
|
+
/** Disable all editing controls. */
|
|
136
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
137
|
+
/** Prefix for `data-autoid` on inner controls (E2E selectors). */
|
|
138
|
+
readonly autoId: _angular_core.InputSignal<string | undefined>;
|
|
139
|
+
/** Canonical output — the root `FilterAndOr` tree, or `null` when empty. `[(value)]`. */
|
|
140
|
+
readonly value: _angular_core.ModelSignal<Filter | null>;
|
|
141
|
+
/** Convenience mirror — the root group's direct children. `[(filters)]`. */
|
|
142
|
+
readonly filters: _angular_core.ModelSignal<Filter[]>;
|
|
143
|
+
/** Root group's logical connector. `[(rootLogic)]`. */
|
|
144
|
+
readonly rootLogic: _angular_core.ModelSignal<"AND" | "OR">;
|
|
145
|
+
readonly tree: _angular_core.Signal<QbGroup>;
|
|
146
|
+
/** `field.key` → field, for fast lookup from a rule. */
|
|
147
|
+
readonly fieldByKey: _angular_core.Signal<Record<string, SdQueryBuilderField>>;
|
|
148
|
+
/** Stable option list for the date-mode select. */
|
|
149
|
+
readonly dateModes: readonly {
|
|
150
|
+
value: QbDateMode;
|
|
151
|
+
display: string;
|
|
152
|
+
}[];
|
|
153
|
+
/** Stable combined unit×direction option list for the relative select. */
|
|
154
|
+
readonly relativeUnitOptions: readonly {
|
|
155
|
+
value: string;
|
|
156
|
+
display: string;
|
|
157
|
+
}[];
|
|
158
|
+
/** View-mode token stream — recomputed from the emitted value. */
|
|
159
|
+
readonly tokens: _angular_core.Signal<QbToken[]>;
|
|
160
|
+
readonly isView: _angular_core.Signal<boolean>;
|
|
161
|
+
/** Expose the type-guard to the template. */
|
|
162
|
+
readonly isGroup: typeof isQbGroup;
|
|
163
|
+
constructor();
|
|
164
|
+
/** Switch a group's AND/OR connector and re-emit. No-op when disabled or unchanged. */
|
|
165
|
+
setGroupLogic(group: QbGroup, logic: 'AND' | 'OR'): void;
|
|
166
|
+
/** Open this group's "+" menu (closing any other open one). UI-only — does not emit. */
|
|
167
|
+
toggleDropdown(group: QbGroup, event: Event): void;
|
|
168
|
+
closeAllDropdowns(): void;
|
|
169
|
+
/** Append a blank rule to `group`. */
|
|
170
|
+
addRule(group: QbGroup): void;
|
|
171
|
+
/** Append a nested sub-group (seeded with one blank rule) to `group`. */
|
|
172
|
+
addGroup(group: QbGroup): void;
|
|
173
|
+
/** Remove the child at `index` from `parent` (a rule or a whole sub-group). */
|
|
174
|
+
removeNode(parent: QbGroup, index: number): void;
|
|
175
|
+
/**
|
|
176
|
+
* Point `rule` at a new field. Resets operator to the field's default and the value
|
|
177
|
+
* to that operator's empty shape — the old operator/value rarely fit the new type.
|
|
178
|
+
*
|
|
179
|
+
* @param rule - the rule being edited.
|
|
180
|
+
* @param key - the chosen field key (from the field picker). Swap-only: a null / undefined
|
|
181
|
+
* key is a no-op — the field can be changed but never cleared (issue #2).
|
|
182
|
+
*/
|
|
183
|
+
setField(rule: QbRule, key: any): void;
|
|
184
|
+
/** Change `rule`'s operator and reshape its value to fit the new operator (array / range / none). */
|
|
185
|
+
setOperator(rule: QbRule, op: Operator | undefined): void;
|
|
186
|
+
/** Set a single-value rule's value (coercing numeric fields to `number`). */
|
|
187
|
+
setScalar(rule: QbRule, raw: any): void;
|
|
188
|
+
/** Set the lower bound of a BETWEEN rule's `{ from, to }` value. */
|
|
189
|
+
setBetweenFrom(rule: QbRule, raw: any): void;
|
|
190
|
+
/** Set the upper bound of a BETWEEN rule's `{ from, to }` value. */
|
|
191
|
+
setBetweenTo(rule: QbRule, raw: any): void;
|
|
192
|
+
/** The field metadata for a rule's current `field` key (or undefined if unset). */
|
|
193
|
+
fieldOf(rule: QbRule): SdQueryBuilderField | undefined;
|
|
194
|
+
/** Operators allowed for a rule, derived from its field's type / override. */
|
|
195
|
+
allowedOperators(rule: QbRule): Operator[];
|
|
196
|
+
/** Whether to render the operator picker — hidden when only one operator is allowed. */
|
|
197
|
+
showOperatorSelector(rule: QbRule): boolean;
|
|
198
|
+
/** True for NULL / NOT_NULL — the template then renders no value editor. */
|
|
199
|
+
isNoData(op: Operator | undefined): boolean;
|
|
200
|
+
/** True for IN / NOT_IN — the template then renders a multi-select value editor. */
|
|
201
|
+
isMulti(op: Operator | undefined): boolean;
|
|
202
|
+
/** `[true/false]` option list for a boolean field's value select (stable reference). */
|
|
203
|
+
booleanItems(field: SdQueryBuilderField): SdQueryBuilderFieldOption[];
|
|
204
|
+
/** Current date-value mode of a rule, derived from its value (no separate state). */
|
|
205
|
+
dateMode(rule: QbRule): QbDateMode;
|
|
206
|
+
/** Switch a date/datetime rule's value mode, reseeding the value for the new mode. */
|
|
207
|
+
setDateMode(rule: QbRule, mode: QbDateMode): void;
|
|
208
|
+
/** Read the offset amount of a relative rule (default 1). */
|
|
209
|
+
relativeAmount(rule: QbRule): number;
|
|
210
|
+
/** Set the offset amount (clamped to an integer >= 1). */
|
|
211
|
+
setRelativeAmount(rule: QbRule, raw: any): void;
|
|
212
|
+
/** Read the `'unit:direction'` token of a relative rule (default `'day:previous'`). */
|
|
213
|
+
relativeUnitDirValue(rule: QbRule): string;
|
|
214
|
+
/** Set the offset unit + direction from a `'unit:direction'` token. */
|
|
215
|
+
setRelativeUnitDir(rule: QbRule, token: string): void;
|
|
216
|
+
/** Build a `data-autoid` for an inner control under this builder's `autoId` prefix. */
|
|
217
|
+
autoIdFor(suffix: string): string;
|
|
218
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdQueryBuilder, never>;
|
|
219
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdQueryBuilder, "sd-query-builder", never, { "fields": { "alias": "fields"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "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
220
|
}
|
|
28
221
|
|
|
29
|
-
|
|
30
|
-
|
|
222
|
+
/**
|
|
223
|
+
* Map the internal builder tree to the public `Filter` (the root is always a
|
|
224
|
+
* `FilterAndOr`). Rules missing field / operator / value — and empty nested
|
|
225
|
+
* groups — are dropped so the result is always a valid `Filter`.
|
|
226
|
+
*
|
|
227
|
+
* @param group - the editable tree's root group.
|
|
228
|
+
* @returns the canonical nested `Filter`, or `null` when no complete rule survives.
|
|
229
|
+
*/
|
|
230
|
+
declare function treeToFilter(group: QbGroup): Filter | null;
|
|
231
|
+
/**
|
|
232
|
+
* Inverse of {@link treeToFilter} — rebuild the editable tree from a `Filter` so a
|
|
233
|
+
* consumer can seed `[value]`. A non-group (bare) filter is wrapped in an AND root;
|
|
234
|
+
* `null` yields an empty AND root.
|
|
235
|
+
*
|
|
236
|
+
* @param filter - a `Filter` (group or leaf), or `null` / `undefined` for an empty tree.
|
|
237
|
+
* @returns a fresh root `QbGroup` mirroring the filter's structure.
|
|
238
|
+
*/
|
|
239
|
+
declare function filterToTree(filter: Filter | null | undefined): QbGroup;
|
|
240
|
+
/**
|
|
241
|
+
* Render a `Filter` to a SQL-ish token stream for view mode. Field tokens use the
|
|
242
|
+
* matching field's `label`; operators map to SQL syntax (`= != like between is null …`);
|
|
243
|
+
* `and` / `or` are lowercase; nested multi-child groups are wrapped in parentheses.
|
|
244
|
+
* Returns a token stream (not a string) so the template can wrap each piece in a
|
|
245
|
+
* highlight `<span>` keyed by `QbToken.kind`.
|
|
246
|
+
*
|
|
247
|
+
* @param filter - the `Filter` to render, or `null` / `undefined`.
|
|
248
|
+
* @param fields - field metadata, used to resolve each field key to its display label + value formatting.
|
|
249
|
+
* @returns the ordered tokens, or `[]` when `filter` is empty.
|
|
250
|
+
*/
|
|
251
|
+
declare function filterToTokens(filter: Filter | null | undefined, fields: SdQueryBuilderField[]): QbToken[];
|
|
252
|
+
|
|
253
|
+
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, SdQueryBuilder, filterToTokens, filterToTree, isQbGroup, qbAllowedOperators, qbDefaultOperator, qbDefaultRelative, qbId, qbIsMultiOperator, qbIsNoDataOperator, qbIsRelativeDate, qbNewGroup, qbNewRule, treeToFilter };
|
|
254
|
+
export type { QbDateMode, QbGroup, QbNode, QbRule, QbToken, QbTokenKind, SdQbRelativeDate, SdQbRelativeDirection, SdQbRelativeUnit, SdQueryBuilderField, SdQueryBuilderFieldOption, SdQueryBuilderFieldType };
|
|
@@ -1,8 +1,7 @@
|
|
|
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
|
|
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>;
|
|
@@ -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
|
|
5
|
+
declare class SdSideDrawer {
|
|
7
6
|
#private;
|
|
8
7
|
id: string;
|
|
9
8
|
portal: _angular_core.Signal<CdkPortal>;
|
|
@@ -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
|
|
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
|
|
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';
|
|
@@ -1145,7 +1144,7 @@ declare class MatPaginatorIntlCro extends MatPaginatorIntl {
|
|
|
1145
1144
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MatPaginatorIntlCro, never>;
|
|
1146
1145
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<MatPaginatorIntlCro>;
|
|
1147
1146
|
}
|
|
1148
|
-
declare class SdTable<T = unknown>
|
|
1147
|
+
declare class SdTable<T = unknown> implements OnInit, AfterViewInit, OnDestroy {
|
|
1149
1148
|
#private;
|
|
1150
1149
|
autoIdInput: _angular_core.InputSignal<string | null | undefined>;
|
|
1151
1150
|
autoId: _angular_core.Signal<string | undefined>;
|
|
@@ -92,6 +92,8 @@ declare class SdUploadFile<TArgs = any> {
|
|
|
92
92
|
#private;
|
|
93
93
|
readonly id: string;
|
|
94
94
|
readonly formControl: SdFormControl;
|
|
95
|
+
/** Hiển thị message "vui lòng upload": không disabled + đã touched + còn lỗi required. */
|
|
96
|
+
readonly showRequiredError: _angular_core.Signal<boolean>;
|
|
95
97
|
readonly previewFiles: _angular_core.WritableSignal<PreviewFile[]>;
|
|
96
98
|
readonly selectedFile: _angular_core.WritableSignal<PreviewFile | null | undefined>;
|
|
97
99
|
readonly previewFileComponent: _angular_core.Signal<PreviewComponent | undefined>;
|
|
@@ -10,12 +10,29 @@ interface ToastData {
|
|
|
10
10
|
duration: number;
|
|
11
11
|
actionLabel?: string;
|
|
12
12
|
onAction?: () => void;
|
|
13
|
+
/**
|
|
14
|
+
* Render `message` dưới dạng HTML thay vì text.
|
|
15
|
+
* - `false` (mặc định): message render dạng TEXT (auto-escape) — an toàn tuyệt đối.
|
|
16
|
+
* - `true`: message render dạng HTML, đã được `DomSanitizer.sanitize(HTML)`
|
|
17
|
+
* (strip `<script>`, event handler, `javascript:` URL). CHỈ dùng cho markup
|
|
18
|
+
* TIN CẬY (do dev tự viết); KHÔNG truyền data người dùng vào đây.
|
|
19
|
+
*/
|
|
20
|
+
html?: boolean;
|
|
13
21
|
}
|
|
14
22
|
interface NotifyOption {
|
|
15
23
|
duration?: number;
|
|
16
24
|
title?: string;
|
|
17
25
|
actionLabel?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Callback khi bấm nút action — do APP tự cung cấp (không phải input không tin cậy).
|
|
28
|
+
* Chỉ được gọi khi user bấm `actionLabel`.
|
|
29
|
+
*/
|
|
18
30
|
onAction?: () => void;
|
|
31
|
+
/**
|
|
32
|
+
* Render message dạng HTML đã sanitize (mặc định `false` = text an toàn).
|
|
33
|
+
* Chỉ dùng cho markup tin cậy. Xem `ToastData.html`.
|
|
34
|
+
*/
|
|
35
|
+
html?: boolean;
|
|
19
36
|
}
|
|
20
37
|
|
|
21
38
|
declare class SdNotifyService {
|