@sd-angular/core 19.0.44 → 19.0.46
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/README.md +6 -0
- package/assets/scss/core/form.scss +21 -11
- package/assets/scss/core/view.scss +24 -0
- package/assets/scss/sd-core.scss +1 -0
- package/assets/scss/themes/_material-tokens.scss +56 -0
- package/assets/scss/themes/default.scss +10 -0
- package/components/form-generic/src/components/form-builder/components/expression-builder/expression-builder.component.d.ts +1 -0
- package/components/form-generic/src/models/form-generic-expression.model.d.ts +10 -4
- package/components/form-generic/src/pipes/component-viewed.pipe.d.ts +1 -0
- package/components/import-excel/src/pipes/column-transform.pipe.d.ts +1 -0
- package/components/inform/src/inform.component.d.ts +12 -3
- package/components/table/src/services/table-export/table-export.service.d.ts +1 -1
- package/components/table/src/services/table-filter/table-filter.model.d.ts +7 -0
- package/components/table/src/services/table-local/table-local-sort.util.d.ts +8 -2
- package/components/table/src/services/table-local/table-local.util.d.ts +6 -1
- package/components/table/src/table.component.d.ts +1 -1
- package/components/timeline/pipes/view-date.pipe.d.ts +1 -0
- package/configurations/src/sd-core.configuration.d.ts +7 -0
- package/fesm2022/sd-angular-core-components-form-generic.mjs +44 -31
- package/fesm2022/sd-angular-core-components-form-generic.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-import-excel.mjs +19 -5
- package/fesm2022/sd-angular-core-components-import-excel.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-inform.mjs +16 -2
- package/fesm2022/sd-angular-core-components-inform.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-section.mjs +2 -2
- package/fesm2022/sd-angular-core-components-section.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-table.mjs +174 -66
- package/fesm2022/sd-angular-core-components-table.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-timeline.mjs +4 -1
- package/fesm2022/sd-angular-core-components-timeline.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-view.mjs +2 -2
- package/fesm2022/sd-angular-core-components-view.mjs.map +1 -1
- package/fesm2022/sd-angular-core-configurations.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-checkbox.mjs +2 -2
- package/fesm2022/sd-angular-core-forms-checkbox.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-date-range.mjs +15 -2
- package/fesm2022/sd-angular-core-forms-date-range.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-date.mjs +11 -1
- package/fesm2022/sd-angular-core-forms-date.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-datetime.mjs +43 -9
- package/fesm2022/sd-angular-core-forms-datetime.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-models.mjs +6 -0
- package/fesm2022/sd-angular-core-forms-models.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-radio.mjs +2 -2
- package/fesm2022/sd-angular-core-forms-radio.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-switch.mjs +2 -2
- package/fesm2022/sd-angular-core-forms-switch.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-textarea.mjs +2 -2
- package/fesm2022/sd-angular-core-forms-textarea.mjs.map +1 -1
- package/fesm2022/sd-angular-core-pipes.mjs +26 -10
- package/fesm2022/sd-angular-core-pipes.mjs.map +1 -1
- package/fesm2022/sd-angular-core-services-date-time.mjs +143 -0
- package/fesm2022/sd-angular-core-services-date-time.mjs.map +1 -0
- package/fesm2022/sd-angular-core-services.mjs +1 -0
- package/fesm2022/sd-angular-core-services.mjs.map +1 -1
- package/fesm2022/sd-angular-core-utilities-models.mjs.map +1 -1
- package/forms/datetime/src/datetime-time-zone.adapter.d.ts +15 -0
- package/forms/models/src/sd-strict-date-adapter.d.ts +3 -0
- package/package.json +17 -13
- package/pipes/src/time-different.pipe.d.ts +1 -0
- package/services/date-time/index.d.ts +1 -0
- package/services/date-time/src/date-time.service.d.ts +54 -0
- package/services/date-time/src/public-api.d.ts +1 -0
- package/services/index.d.ts +1 -0
- package/utilities/extensions/src/string.extension.d.ts +1 -0
- package/utilities/models/src/icon.model.d.ts +2 -0
package/README.md
CHANGED
|
@@ -117,6 +117,12 @@ export const appConfig: ApplicationConfig = {
|
|
|
117
117
|
| `--sd-black300` | `#BFBFBF` | Xám trung |
|
|
118
118
|
| `--sd-black200` | `#E6E6E6` | Xám nhạt |
|
|
119
119
|
| `--sd-black100` | `#F2F2F2` | Xám nhạt nhất |
|
|
120
|
+
| `--sd-view-label-color` | `var(--sd-black400)` | Label chỉ-đọc (`sd-view`, control ở `viewed`, `sd-section-item`), class `.sd-view-label` |
|
|
121
|
+
| `--sd-view-value-color` | `var(--sd-black500)` | Giá trị chỉ-đọc, class `.sd-view-value` |
|
|
122
|
+
|
|
123
|
+
`theme()` còn ánh xạ token Material của form field, option và datepicker sang palette này (`assets/scss/themes/_material-tokens.scss`): label/caret/mũi tên select khi focus và option/ngày đang chọn dùng `--sd-primary`. Đổi `primary` trong `theme()` là các trạng thái này đổi theo.
|
|
124
|
+
|
|
125
|
+
Viền (outline) của form field luôn là `--sd-black200` ở mọi trạng thái — nghỉ, hover, focus (chỉ dày hơn) và lỗi (`assets/scss/core/form.scss`, `!important`). Field lỗi báo bằng label, message và dấu `*` màu đỏ; riêng field `hideInlineError` bị lỗi (không có message) có viền `--sd-error`.
|
|
120
126
|
|
|
121
127
|
### Custom Theme / Tuỳ chỉnh theme
|
|
122
128
|
|
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
// Xử lý màu border nhạt bớt
|
|
15
|
+
// why: viền xám ở MỌI trạng thái (nghỉ, hover, focus, lỗi) — focus chỉ dày hơn, lỗi báo bằng label và
|
|
16
|
+
// message đỏ. 19.0.45 từng đổi viền focus sang primary và viền lỗi sang đỏ; 19.0.46 trả lại giao diện
|
|
17
|
+
// cũ vì các app đang dùng không được báo trước thay đổi này.
|
|
15
18
|
.mat-mdc-notch-piece {
|
|
16
19
|
&.mdc-notched-outline__leading {
|
|
17
20
|
border-color: map.get(color.$color_map, 'black200') !important;
|
|
@@ -130,6 +133,7 @@
|
|
|
130
133
|
display: none;
|
|
131
134
|
}
|
|
132
135
|
|
|
136
|
+
// why: không có message lỗi bên dưới nên field lỗi tô viền đỏ — ngoại lệ duy nhất của viền xám ở trên.
|
|
133
137
|
&.mat-form-field-invalid {
|
|
134
138
|
.mat-mdc-notch-piece {
|
|
135
139
|
&.mdc-notched-outline__leading {
|
|
@@ -265,17 +269,15 @@
|
|
|
265
269
|
}
|
|
266
270
|
}
|
|
267
271
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}
|
|
278
|
-
}
|
|
272
|
+
// why: chữ giá trị/placeholder nằm trong line box 24px của control, nên Chrome đặt glyph ở
|
|
273
|
+
// `floor((24 - cao_font) / 2)` — cao_font theo metrics của OS (Roboto: 17px trên Windows, 16px trên
|
|
274
|
+
// Linux/macOS). Label nghỉ dùng `line-height: normal` và căn tâm bằng translateY(-50%), không bị làm
|
|
275
|
+
// tròn như vậy, nên trên Windows nó thấp hơn chữ 1px. Cho label nghỉ cùng line-height với control:
|
|
276
|
+
// line box của label trùng line box của chữ, glyph trùng nhau trên mọi OS. Chỉ trạng thái nghỉ —
|
|
277
|
+
// label đã float giữ `normal` để vị trí trên viền không đổi. (Rule `top` cũ trỏ vào class M2
|
|
278
|
+
// `.mat-mdc-form-field-label` không còn tồn tại nên chưa từng có hiệu lực.)
|
|
279
|
+
.mdc-floating-label:not(.mdc-floating-label--float-above) {
|
|
280
|
+
line-height: var(--mat-form-field-container-text-line-height, var(--mat-sys-body-large-line-height, 24px));
|
|
279
281
|
}
|
|
280
282
|
|
|
281
283
|
// Fix for date range and datetime inputs with small size
|
|
@@ -289,6 +291,14 @@
|
|
|
289
291
|
}
|
|
290
292
|
}
|
|
291
293
|
|
|
294
|
+
// why: chữ option của sd-select / sd-autocomplete 14px, bằng chữ hiển thị trong ô. Option single của
|
|
295
|
+
// Material mặc định là body-large (16px) trong khi trigger/input là 14px. Màu option đang chọn nằm ở
|
|
296
|
+
// themes/_material-tokens.scss.
|
|
297
|
+
.mat-mdc-select-panel.sd-select-panel,
|
|
298
|
+
.mat-mdc-autocomplete-panel.sd-autocomplete-panel {
|
|
299
|
+
--mat-option-label-text-size: 14px;
|
|
300
|
+
}
|
|
301
|
+
|
|
292
302
|
// Override reboot rule `label { margin-bottom: 0.5rem }` cho mat-checkbox layout
|
|
293
303
|
mat-checkbox {
|
|
294
304
|
label.mat-mdc-checkbox-layout {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Read-only label/value pair — <sd-view>, every form control in `viewed` mode and the label of
|
|
2
|
+
// <sd-section-item>. Public classes, so a custom detail layout reads the same as the library:
|
|
3
|
+
//
|
|
4
|
+
// <div class="sd-view-label">Mã hợp đồng</div>
|
|
5
|
+
// <div class="sd-view-value">HD-001</div>
|
|
6
|
+
//
|
|
7
|
+
// why: the value used to inherit the colour of its container, so inside a grey container label and
|
|
8
|
+
// value ended up in the same colour. Both now take a token of theme(): --sd-view-label-color
|
|
9
|
+
// (--sd-black400) and --sd-view-value-color (--sd-black500). Override them on any scope to restyle
|
|
10
|
+
// every read-only field below it.
|
|
11
|
+
|
|
12
|
+
.sd-view-label {
|
|
13
|
+
color: var(--sd-view-label-color, var(--sd-black400, #757575));
|
|
14
|
+
font-size: 14px;
|
|
15
|
+
font-weight: 400;
|
|
16
|
+
line-height: 20px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.sd-view-value {
|
|
20
|
+
color: var(--sd-view-value-color, var(--sd-black500, #212121));
|
|
21
|
+
font-size: 14px;
|
|
22
|
+
font-weight: 500;
|
|
23
|
+
line-height: 20px;
|
|
24
|
+
}
|
package/assets/scss/sd-core.scss
CHANGED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Angular Material component tokens mapped onto the Core palette.
|
|
2
|
+
//
|
|
3
|
+
// why: theme() declares these, so every theme scope resolves them against its palette and a parent of a
|
|
4
|
+
// field can still override a token for its subtree.
|
|
5
|
+
//
|
|
6
|
+
// - Outline: not here. `core/form.scss` forces `--sd-black200` with `!important` on the outline pieces in
|
|
7
|
+
// every state (red only for an invalid `hideInlineError` field). 19.0.45 moved the outline onto the
|
|
8
|
+
// focus/error tokens (primary while focused, red when invalid); 19.0.46 restored the grey outline.
|
|
9
|
+
// - Focus: --sd-primary for the floating label, caret, select arrow, datepicker toggle and the filled
|
|
10
|
+
// active indicator.
|
|
11
|
+
// - Error: Material's own error colours (the Material 2 warn palette of `material-theme.scss`): red label,
|
|
12
|
+
// caret and select arrow; the filled active indicator turns --sd-error.
|
|
13
|
+
// - Options, checkmarks and datepicker: selected state in --sd-primary.
|
|
14
|
+
//
|
|
15
|
+
// Token names are the Material 19 ones (`--mdc-*-text-field-*`, `--mat-{full,minimal}-pseudo-checkbox-*`).
|
|
16
|
+
|
|
17
|
+
$-text-field-prefixes: (
|
|
18
|
+
outlined: '--mdc-outlined-text-field-',
|
|
19
|
+
filled: '--mdc-filled-text-field-',
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
@mixin emit() {
|
|
23
|
+
@each $appearance, $prefix in $-text-field-prefixes {
|
|
24
|
+
#{$prefix}caret-color: var(--sd-primary);
|
|
25
|
+
#{$prefix}focus-label-text-color: var(--sd-primary);
|
|
26
|
+
@if $appearance == filled {
|
|
27
|
+
#{$prefix}focus-active-indicator-color: var(--sd-primary);
|
|
28
|
+
#{$prefix}error-active-indicator-color: var(--sd-error);
|
|
29
|
+
#{$prefix}error-hover-active-indicator-color: var(--sd-error);
|
|
30
|
+
#{$prefix}error-focus-active-indicator-color: var(--sd-error);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
--mat-form-field-focus-select-arrow-color: var(--sd-primary);
|
|
34
|
+
--mat-select-focused-arrow-color: var(--sd-primary);
|
|
35
|
+
--mat-datepicker-toggle-active-state-icon-color: var(--sd-primary);
|
|
36
|
+
|
|
37
|
+
--mat-option-selected-state-label-text-color: var(--sd-primary);
|
|
38
|
+
--mat-option-selected-state-layer-color: var(--sd-primary-light);
|
|
39
|
+
--mat-full-pseudo-checkbox-selected-icon-color: var(--sd-primary);
|
|
40
|
+
--mat-full-pseudo-checkbox-selected-checkmark-color: white;
|
|
41
|
+
--mat-minimal-pseudo-checkbox-selected-checkmark-color: var(--sd-primary);
|
|
42
|
+
|
|
43
|
+
--mat-datepicker-calendar-date-selected-state-background-color: var(--sd-primary);
|
|
44
|
+
--mat-datepicker-calendar-date-selected-state-text-color: white;
|
|
45
|
+
--mat-datepicker-calendar-date-today-outline-color: var(--sd-primary);
|
|
46
|
+
--mat-datepicker-calendar-date-today-selected-state-outline-color: white;
|
|
47
|
+
--mat-datepicker-calendar-date-in-range-state-background-color: var(--sd-primary-light);
|
|
48
|
+
|
|
49
|
+
// Nested rule last: Sass rejects declarations after a nested rule (mixed-decls).
|
|
50
|
+
// The Material 2 theme re-declares the checkmark colours on `.mat-primary` (the class sd-select puts
|
|
51
|
+
// on its panel) with the palette hex, so a custom --sd-primary would not reach them.
|
|
52
|
+
.mat-primary {
|
|
53
|
+
--mat-full-pseudo-checkbox-selected-icon-color: var(--sd-primary);
|
|
54
|
+
--mat-minimal-pseudo-checkbox-selected-checkmark-color: var(--sd-primary);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@use "sass:map";
|
|
2
2
|
@use "../core/color";
|
|
3
|
+
@use "./material-tokens";
|
|
3
4
|
|
|
4
5
|
$default-theme: (
|
|
5
6
|
primary: #2A66F4,
|
|
@@ -42,4 +43,13 @@ $default-theme: (
|
|
|
42
43
|
@each $color in color.$system-colors {
|
|
43
44
|
--sd-#{$color}: #{map.get($theme, $color)};
|
|
44
45
|
}
|
|
46
|
+
|
|
47
|
+
// Read-only label/value pair of <sd-view>, the viewed mode of form controls and <sd-section-item>
|
|
48
|
+
// (classes .sd-view-label / .sd-view-value in core/view.scss). Override on any scope to restyle them.
|
|
49
|
+
--sd-view-label-color: var(--sd-black400);
|
|
50
|
+
--sd-view-value-color: var(--sd-black500);
|
|
51
|
+
|
|
52
|
+
// Material form-field / option / datepicker tokens on the Core palette (themes/_material-tokens.scss).
|
|
53
|
+
// Last: it ends with a nested rule.
|
|
54
|
+
@include material-tokens.emit();
|
|
45
55
|
}
|
|
@@ -4,6 +4,7 @@ import { SdModal } from '@sd-angular/core/components/modal';
|
|
|
4
4
|
import { Attribute, SdFormGenericExpression, SdFormGenericExpressionCondition } from '../../../../models';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export declare class ExpressionBuilderComponent {
|
|
7
|
+
#private;
|
|
7
8
|
private ref;
|
|
8
9
|
modal?: SdModal;
|
|
9
10
|
form: FormGroup<{}>;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { Operator as SdOperator } from '@sdcorejs/utils/models';
|
|
2
2
|
import { SdFormGenericComponent, SdFormGenericGroup } from './form-generic-component.model';
|
|
3
|
+
import { type SdDateTimeService } from '@sd-angular/core/services/date-time';
|
|
4
|
+
/**
|
|
5
|
+
* Clock and formatting of `ISdCoreConfiguration.timeZone` for expressions: pass `inject(SdDateTimeService)`.
|
|
6
|
+
* Omitted or `'local'`: the machine zone, as before.
|
|
7
|
+
*/
|
|
8
|
+
export type SdFormGenericExpressionDateTime = Pick<SdDateTimeService, 'timeZone' | 'toFormat'>;
|
|
3
9
|
export interface SdFormGenericExpression {
|
|
4
10
|
key: string;
|
|
5
11
|
type: 'combinator';
|
|
@@ -52,7 +58,7 @@ export declare const DayInfoPreviouses: {
|
|
|
52
58
|
display: string;
|
|
53
59
|
format: (n: number) => string;
|
|
54
60
|
}[];
|
|
55
|
-
export declare const GetDatetimeValue: (value: string) => string | undefined;
|
|
61
|
+
export declare const GetDatetimeValue: (value: string, dateTime?: SdFormGenericExpressionDateTime) => string | undefined;
|
|
56
62
|
interface AttributeValues {
|
|
57
63
|
value: string;
|
|
58
64
|
display: string;
|
|
@@ -68,7 +74,7 @@ export declare const AttributeOperators: Record<Attribute['type'], {
|
|
|
68
74
|
display: string;
|
|
69
75
|
}[]>;
|
|
70
76
|
export declare const GetAttributes: (components: (SdFormGenericComponent | SdFormGenericGroup)[]) => Attribute[];
|
|
71
|
-
export declare const TemplateToCondition: (template: string | undefined | null, entity: Record<string, any
|
|
72
|
-
export declare const EvaluateExpression: (condition: SdFormGenericExpression | SdFormGenericExpressionCondition, entity: Record<string, any
|
|
73
|
-
export declare const ExpressionToJavascriptExpression: (condition: SdFormGenericExpression | SdFormGenericExpressionCondition) => string | undefined;
|
|
77
|
+
export declare const TemplateToCondition: (template: string | undefined | null, entity: Record<string, any>, dateTime?: SdFormGenericExpressionDateTime) => string | undefined;
|
|
78
|
+
export declare const EvaluateExpression: (condition: SdFormGenericExpression | SdFormGenericExpressionCondition, entity: Record<string, any>, dateTime?: SdFormGenericExpressionDateTime) => boolean | undefined;
|
|
79
|
+
export declare const ExpressionToJavascriptExpression: (condition: SdFormGenericExpression | SdFormGenericExpressionCondition, dateTime?: SdFormGenericExpressionDateTime) => string | undefined;
|
|
74
80
|
export {};
|
|
@@ -4,6 +4,7 @@ import { FormGenericService } from '../services';
|
|
|
4
4
|
import { SdFormatNumberPipe } from '@sd-angular/core/pipes';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export declare class ComponentViewedPipe implements PipeTransform {
|
|
7
|
+
#private;
|
|
7
8
|
private readonly formatNumberPipe;
|
|
8
9
|
private readonly formGenericService;
|
|
9
10
|
constructor(formatNumberPipe: SdFormatNumberPipe, formGenericService: FormGenericService);
|
|
@@ -3,6 +3,7 @@ import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
|
|
3
3
|
import { SdImportExcelItem, SdUploadExcelColumn } from '../import-excel.model';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class ColumnTransformPipe implements PipeTransform {
|
|
6
|
+
#private;
|
|
6
7
|
private sanitizer;
|
|
7
8
|
constructor(sanitizer: DomSanitizer);
|
|
8
9
|
transform(item: SdImportExcelItem, column: SdUploadExcelColumn): Promise<string | SafeHtml>;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { ElementRef } from '@angular/core';
|
|
2
2
|
import { Color } from '@sdcorejs/utils/models';
|
|
3
|
-
import { MaterialIconFontSet } from '@sd-angular/core/utilities/models';
|
|
3
|
+
import { MaterialIconFontSet, SdIconShape } from '@sd-angular/core/utilities/models';
|
|
4
4
|
import { SdInformActionDirective } from './inform-action.directive';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
+
/** `default` = banner thường; `tip` = gợi ý gọn, không phải live region (role="note"). */
|
|
7
|
+
export type SdInformType = 'default' | 'tip';
|
|
6
8
|
export declare class SdInform {
|
|
7
9
|
#private;
|
|
10
|
+
/** Banner thường hoặc gợi ý gọn (`tip`); null/undefined quay về `default`. */
|
|
11
|
+
type: import("@angular/core").InputSignalWithTransform<SdInformType, SdInformType | null | undefined>;
|
|
8
12
|
color: import("@angular/core").InputSignalWithTransform<Color, Color | null | undefined>;
|
|
9
13
|
primary: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
10
14
|
secondary: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
@@ -16,6 +20,11 @@ export declare class SdInform {
|
|
|
16
20
|
description: import("@angular/core").InputSignal<string | undefined>;
|
|
17
21
|
icon: import("@angular/core").InputSignal<string | undefined>;
|
|
18
22
|
hideIcon: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
23
|
+
/**
|
|
24
|
+
* Nền ô icon: `'none'` (mặc định, không nền, giữ kích thước ô), `'square'` (bo 8px) hoặc `'circle'`.
|
|
25
|
+
* Null/undefined quay về `none`. Variant `tip` luôn phẳng, không nền.
|
|
26
|
+
*/
|
|
27
|
+
iconShape: import("@angular/core").InputSignalWithTransform<SdIconShape, SdIconShape | null | undefined>;
|
|
19
28
|
fontSet: import("@angular/core").InputSignalWithTransform<MaterialIconFontSet, MaterialIconFontSet | null | undefined>;
|
|
20
29
|
closable: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
21
30
|
actionLabel: import("@angular/core").InputSignal<string | undefined>;
|
|
@@ -47,7 +56,7 @@ export declare class SdInform {
|
|
|
47
56
|
hasActionSlot: import("@angular/core").Signal<boolean>;
|
|
48
57
|
clampLines: import("@angular/core").Signal<number | null>;
|
|
49
58
|
showToggle: import("@angular/core").Signal<boolean>;
|
|
50
|
-
liveRole: import("@angular/core").Signal<"alert" | "status">;
|
|
59
|
+
liveRole: import("@angular/core").Signal<"alert" | "status" | "note">;
|
|
51
60
|
constructor();
|
|
52
61
|
/** Đo tràn dòng của body; chỉ có ý nghĩa khi đang clamp. */
|
|
53
62
|
measureOverflow(): void;
|
|
@@ -55,5 +64,5 @@ export declare class SdInform {
|
|
|
55
64
|
onClose(event: Event): void;
|
|
56
65
|
onAction(event: Event): void;
|
|
57
66
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdInform, never>;
|
|
58
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SdInform, "sd-inform", never, { "color": { "alias": "color"; "required": false; "isSignal": true; }; "primary": { "alias": "primary"; "required": false; "isSignal": true; }; "secondary": { "alias": "secondary"; "required": false; "isSignal": true; }; "info": { "alias": "info"; "required": false; "isSignal": true; }; "success": { "alias": "success"; "required": false; "isSignal": true; }; "warning": { "alias": "warning"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "hideIcon": { "alias": "hideIcon"; "required": false; "isSignal": true; }; "fontSet": { "alias": "fontSet"; "required": false; "isSignal": true; }; "closable": { "alias": "closable"; "required": false; "isSignal": true; }; "actionLabel": { "alias": "actionLabel"; "required": false; "isSignal": true; }; "lineClamp": { "alias": "lineClamp"; "required": false; "isSignal": true; }; "autoId": { "alias": "autoId"; "required": false; "isSignal": true; }; }, { "sdClosed": "sdClosed"; "sdAction": "sdAction"; }, ["actionSlot"], ["[sdInformAction]"], true, never>;
|
|
67
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdInform, "sd-inform", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "primary": { "alias": "primary"; "required": false; "isSignal": true; }; "secondary": { "alias": "secondary"; "required": false; "isSignal": true; }; "info": { "alias": "info"; "required": false; "isSignal": true; }; "success": { "alias": "success"; "required": false; "isSignal": true; }; "warning": { "alias": "warning"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "hideIcon": { "alias": "hideIcon"; "required": false; "isSignal": true; }; "iconShape": { "alias": "iconShape"; "required": false; "isSignal": true; }; "fontSet": { "alias": "fontSet"; "required": false; "isSignal": true; }; "closable": { "alias": "closable"; "required": false; "isSignal": true; }; "actionLabel": { "alias": "actionLabel"; "required": false; "isSignal": true; }; "lineClamp": { "alias": "lineClamp"; "required": false; "isSignal": true; }; "autoId": { "alias": "autoId"; "required": false; "isSignal": true; }; }, { "sdClosed": "sdClosed"; "sdAction": "sdAction"; }, ["actionSlot"], ["[sdInformAction]", "*"], true, never>;
|
|
59
68
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SdExcelColumn } from '@sd-angular/core/services';
|
|
1
|
+
import { SdExcelColumn } from '@sd-angular/core/services/excel';
|
|
2
2
|
import { ConfiguredTableResult } from '../../models/table-option-config.model';
|
|
3
3
|
import { SdTableOption } from '../../models/table-option.model';
|
|
4
4
|
import { SdTableFilterRequest } from '../table-filter/table-filter.model';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TemplateRef } from '@angular/core';
|
|
2
2
|
import { SdSearch } from '@sd-angular/core/forms';
|
|
3
|
+
import { type SdDateTimeService } from '@sd-angular/core/services/date-time';
|
|
3
4
|
import { NestedKeyOf, Operator, Order, PagingReq } from '@sdcorejs/utils/models';
|
|
4
5
|
import { Observable } from 'rxjs';
|
|
5
6
|
import { SdTableColumn } from '../../models/table-column.model';
|
|
@@ -60,6 +61,12 @@ export declare const SdConvertToPagingReq: (filterRequest: SdTableFilterRequest,
|
|
|
60
61
|
externalFilters?: SdTableExternalFilter[];
|
|
61
62
|
fieldMapping?: Record<string, string>;
|
|
62
63
|
orders?: Order[];
|
|
64
|
+
/**
|
|
65
|
+
* `inject(SdDateTimeService)` makes date filters follow `ISdCoreConfiguration.timeZone`: a day is
|
|
66
|
+
* [its first instant, the first instant of the next calendar day) in the zone, and a zone-less
|
|
67
|
+
* datetime is wall clock there. Omitted or `'local'`: the machine zone, as before.
|
|
68
|
+
*/
|
|
69
|
+
dateTime?: Pick<SdDateTimeService, "timeZone" | "begin" | "end" | "beginOfNextDay" | "parse">;
|
|
63
70
|
}) => PagingReq;
|
|
64
71
|
export declare type SdTableExternalFilter<TData = any> = TextFilter<TData> | DateFilter<TData> | DateTimeFilter<TData> | DateRangeFilter<TData> | NumberFilter<TData> | ValuesFilter<TData> | LazyValuesFilter<TData> | BooleanFilter<TData> | CustomFilter<TData>;
|
|
65
72
|
interface BaseFilter<TData = any> {
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import type { SdDateTimeService } from '@sd-angular/core/services/date-time';
|
|
1
2
|
import type { SdTableColumn } from '../../models/table-column.model';
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
type SortDateTime = Pick<SdDateTimeService, 'timeZone' | 'parse'>;
|
|
4
|
+
/**
|
|
5
|
+
* Internal local-sort comparison; intentionally not exported from the table entry point.
|
|
6
|
+
* `dateTime` reads zone-less dates in `ISdCoreConfiguration.timeZone`; omitted or `'local'` keeps the machine zone.
|
|
7
|
+
*/
|
|
8
|
+
export declare const compareLocalValues: (a: unknown, b: unknown, type: SdTableColumn["type"], direction: "ASC" | "DESC", dateTime?: SortDateTime) => number;
|
|
9
|
+
export {};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type SdDateTimeService } from '@sd-angular/core/services/date-time';
|
|
2
|
+
import { Operator } from '@sdcorejs/utils/models';
|
|
1
3
|
import { SdTableColumn } from '../../models/table-column.model';
|
|
2
4
|
import { SdTableItem } from '../../models/table-item.model';
|
|
3
5
|
import { SdTableOptionTree } from '../../models/table-option-tree.model';
|
|
@@ -6,7 +8,10 @@ export interface FilterLocalItemsOption<T> {
|
|
|
6
8
|
type: 'local' | 'server';
|
|
7
9
|
columns: SdTableColumn<T>[];
|
|
8
10
|
tree?: SdTableOptionTree<T>;
|
|
11
|
+
/** Date math of `ISdCoreConfiguration.timeZone`; omitted or `'local'` keeps the machine zone. */
|
|
12
|
+
dateTime?: LocalDateTime;
|
|
9
13
|
}
|
|
14
|
+
type LocalDateTime = Pick<SdDateTimeService, 'timeZone' | 'begin' | 'end' | 'parse'>;
|
|
10
15
|
export interface FilterLocalItemsResult<T, TItem> {
|
|
11
16
|
items: TItem[];
|
|
12
17
|
total: number;
|
|
@@ -14,6 +19,6 @@ export interface FilterLocalItemsResult<T, TItem> {
|
|
|
14
19
|
}
|
|
15
20
|
type LocalFilterItem<T> = SdTableItem<T> | T;
|
|
16
21
|
export declare const hasActiveColumnFilter: <T>(rawColumnFilter?: Partial<Record<string, any>>, columns?: SdTableColumn<T>[]) => boolean;
|
|
17
|
-
export declare const matchesColumnFilter: <T>(data: T, columns?: SdTableColumn<T>[], rawColumnFilter?: Partial<Record<string, any>>) => boolean;
|
|
22
|
+
export declare const matchesColumnFilter: <T>(data: T, columns?: SdTableColumn<T>[], rawColumnFilter?: Partial<Record<string, any>>, dateTime?: LocalDateTime, columnOperator?: Partial<Record<string, Operator>>) => boolean;
|
|
18
23
|
export declare const filterLocalItems: <T, TItem extends LocalFilterItem<T>>(localItems: TItem[], option: FilterLocalItemsOption<T>, filterInfo: SdTableFilterRequest<T>) => FilterLocalItemsResult<T, TItem>;
|
|
19
24
|
export {};
|
|
@@ -2,7 +2,7 @@ import { AfterViewInit, OnDestroy } from '@angular/core';
|
|
|
2
2
|
import { MatPaginator, MatPaginatorIntl } from '@angular/material/paginator';
|
|
3
3
|
import { MatSort } from '@angular/material/sort';
|
|
4
4
|
import { MatTable } from '@angular/material/table';
|
|
5
|
-
import { SdExcelColumn } from '@sd-angular/core/services';
|
|
5
|
+
import { SdExcelColumn } from '@sd-angular/core/services/excel';
|
|
6
6
|
import { SdTableCellDefDirective } from './directives/sd-table-cell-def.directive';
|
|
7
7
|
import { SdTableExpandDefDirective } from './directives/sd-table-expand-def.directive';
|
|
8
8
|
import { SdTableGroupDefDirective, SdTableGroupDefContext } from './directives/sd-table-group-def.directive';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PipeTransform } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class ViewDateTimePipe implements PipeTransform {
|
|
4
|
+
#private;
|
|
4
5
|
transform(value: any): string;
|
|
5
6
|
static ɵfac: i0.ɵɵFactoryDeclaration<ViewDateTimePipe, never>;
|
|
6
7
|
static ɵpipe: i0.ɵɵPipeDeclaration<ViewDateTimePipe, "viewDateTime", true>;
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { InjectionToken } from "@angular/core";
|
|
2
2
|
import type { Language } from "@sd-angular/core/models";
|
|
3
|
+
/**
|
|
4
|
+
* Time zone the whole app reads and shows dates in: `'local'` (the browser's zone) or an IANA id.
|
|
5
|
+
* The listed ids only drive autocomplete; any IANA id is accepted. Numeric offsets (`'+07:00'`) are
|
|
6
|
+
* rejected because they carry no offset history.
|
|
7
|
+
*/
|
|
8
|
+
export type SdTimeZone = 'local' | 'UTC' | 'Asia/Ho_Chi_Minh' | 'Asia/Bangkok' | 'Asia/Jakarta' | 'Asia/Singapore' | 'Asia/Kuala_Lumpur' | 'Asia/Manila' | 'Asia/Shanghai' | 'Asia/Hong_Kong' | 'Asia/Taipei' | 'Asia/Tokyo' | 'Asia/Seoul' | 'Asia/Kolkata' | 'Asia/Dubai' | 'Australia/Sydney' | 'Europe/London' | 'Europe/Paris' | 'Europe/Berlin' | 'America/New_York' | 'America/Chicago' | 'America/Los_Angeles' | (string & {});
|
|
3
9
|
export interface ISdCoreConfiguration {
|
|
4
10
|
format?: {
|
|
5
11
|
number?: '1,234,567.89' | '1.234.567,89';
|
|
6
12
|
};
|
|
7
13
|
language?: Language | (() => Record<string, string>);
|
|
14
|
+
timeZone?: SdTimeZone;
|
|
8
15
|
}
|
|
9
16
|
export declare const SD_CORE_CONFIGURATION: InjectionToken<ISdCoreConfiguration>;
|