@sdcorejs/angular 19.1.5 → 19.1.6

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 (27) hide show
  1. package/README.md +2 -4
  2. package/components/preview/src/preview-pdf/pdf-worker-inline.generated.d.ts +7 -0
  3. package/components/table/src/services/table-export/table-export.service.d.ts +3 -1
  4. package/components/table/src/table.component.d.ts +1 -1
  5. package/fesm2022/sdcorejs-angular-components-preview.mjs +31 -2
  6. package/fesm2022/sdcorejs-angular-components-preview.mjs.map +1 -1
  7. package/fesm2022/sdcorejs-angular-components-table.mjs +18 -3
  8. package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
  9. package/fesm2022/sdcorejs-angular-forms-date-range.mjs +3 -4
  10. package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
  11. package/fesm2022/sdcorejs-angular-forms-date.mjs +122 -27
  12. package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
  13. package/fesm2022/sdcorejs-angular-forms-models.mjs +54 -2
  14. package/fesm2022/sdcorejs-angular-forms-models.mjs.map +1 -1
  15. package/fesm2022/sdcorejs-angular-i18n.mjs +20 -0
  16. package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
  17. package/fesm2022/sdcorejs-angular-modules-layout.mjs +110 -25
  18. package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
  19. package/forms/date/src/date-input.util.d.ts +18 -0
  20. package/forms/date/src/date.component.d.ts +8 -1
  21. package/forms/models/index.d.ts +1 -0
  22. package/forms/models/src/sd-strict-date-adapter.d.ts +26 -0
  23. package/i18n/src/en.d.ts +4 -0
  24. package/modules/layout/index.d.ts +1 -0
  25. package/modules/layout/utils/index.d.ts +1 -0
  26. package/modules/layout/utils/tab-name.util.d.ts +8 -0
  27. package/package.json +13 -5
@@ -0,0 +1,18 @@
1
+ export declare const DATE_DISPLAY_FORMAT = "dd/MM/yyyy";
2
+ export declare const DATE_DISPLAY_PATTERN: RegExp;
3
+ export declare const DATE_INPUT_MAX_DIGITS = 8;
4
+ /** Chèn `/` vào chuỗi số người dùng đang gõ: `22081991` → `22/08/1991`. */
5
+ export declare function formatDateInput(value: string, addTrailingSeparator: boolean): string;
6
+ /** Chuỗi còn dở dang (đang gõ) — chưa đủ `dd/MM/yyyy` nhưng vẫn đúng khuôn. */
7
+ export declare function isPartialDateInput(value: string): boolean;
8
+ /**
9
+ * Chỉ nhận đúng `dd/MM/yyyy` ĐẦY ĐỦ và có thật trên lịch.
10
+ *
11
+ * WHY chặt tay như vậy: `date-fns.parse(value, 'dd/MM/yyyy')` rất dễ dãi — nó
12
+ * nhận cả năm thiếu chữ số, nên `11/12/2` ra năm 0002 còn `11/12/20` ra năm
13
+ * 0020. Nếu để lọt, người dùng mới gõ nửa chừng đã bị coi là nhập xong.
14
+ */
15
+ export declare function parseDateInput(value: string): Date | null;
16
+ /** Giữ con trỏ đứng đúng chỗ sau khi chuỗi được chèn thêm `/`. */
17
+ export declare function getCaretPosition(value: string, selectionStart: number, formattedValue: string, addTrailingSeparator: boolean): number;
18
+ export declare function dateControlsEqual(left: Date | null, right: Date | null): boolean;
@@ -7,6 +7,11 @@ import { SdFormControl, SdViewed, SdViewedInput } from '@sdcorejs/angular/forms/
7
7
  import { Size } from '@sdcorejs/utils/models';
8
8
  import * as i0 from "@angular/core";
9
9
  type SdDateModelValue = string | number | Date | undefined | null;
10
+ type SdDateKeyupEvent = Event | {
11
+ target?: {
12
+ value?: string | null;
13
+ };
14
+ };
10
15
  export declare class SdDate implements OnDestroy, OnInit {
11
16
  #private;
12
17
  id: string;
@@ -80,7 +85,9 @@ export declare class SdDate implements OnDestroy, OnInit {
80
85
  open: () => void;
81
86
  focusInputElement(): void;
82
87
  onKeyDown: (event: KeyboardEvent) => boolean;
83
- onKeyup: (event: any) => void;
88
+ onInput: (event: Event) => void;
89
+ /** Kept as a compatibility entry point for callers that used the old keyup handler. */
90
+ onKeyup: (event: SdDateKeyupEvent) => void;
84
91
  onChange: (event: MatDatepickerInputEvent<Date>) => void;
85
92
  clear: ($event: any) => void;
86
93
  static ɵfac: i0.ɵɵFactoryDeclaration<SdDate, never>;
@@ -6,3 +6,4 @@ export type * from './src/sd-search.model';
6
6
  export * from './src/form-control-state';
7
7
  export * from './src/sd-viewed';
8
8
  export * from './src/sd-form-control-connector';
9
+ export * from './src/sd-strict-date-adapter';
@@ -0,0 +1,26 @@
1
+ import { Provider } from '@angular/core';
2
+ import { DateFnsAdapter } from '@angular/material-date-fns-adapter';
3
+ import { MatDateFormats } from '@angular/material/core';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * DateAdapter từ chối mọi chuỗi người dùng chưa gõ xong.
7
+ *
8
+ * WHY cần đến mức này: `<input matInput [matDatepicker]>` khiến Material tự
9
+ * `parse()` lại ô nhập SAU MỖI PHÍM GÕ rồi ghi thẳng kết quả vào form control.
10
+ * Adapter mặc định quá dễ dãi trên hai đường:
11
+ *
12
+ * 1. `date-fns.parse` nhận năm thiếu chữ số → `11/12/2` thành năm 0002,
13
+ * `11/12/20` thành năm 0020. Ô nhập vừa gõ dở đã bị coi là hợp lệ (cờ lỗi
14
+ * bị xoá) và control ôm một ngày rác.
15
+ * 2. `parseISO` coi chuỗi 2 chữ số là thế kỷ → xoá lùi còn `11` ra năm 1100.
16
+ *
17
+ * Cả hai đường đều bị chặn ở đây: control chỉ nhận giá trị khi người dùng thực
18
+ * sự gõ xong.
19
+ */
20
+ export declare class SdStrictDateFnsAdapter extends DateFnsAdapter {
21
+ parse(value: unknown, parseFormat: string | string[]): Date | null;
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<SdStrictDateFnsAdapter, never>;
23
+ static ɵprov: i0.ɵɵInjectableDeclaration<SdStrictDateFnsAdapter>;
24
+ }
25
+ /** `provideDateFnsAdapter` + ép dùng adapter parse chặt ở trên. */
26
+ export declare function provideSdStrictDateFnsAdapter(formats: MatDateFormats): Provider[];
package/i18n/src/en.d.ts CHANGED
@@ -458,6 +458,8 @@ export declare const EN_MESSAGES: {
458
458
  readonly 'core.component.table.choose-filter-hint': "Please choose a filter to start";
459
459
  readonly 'core.component.table.no-data': "No data";
460
460
  readonly 'core.component.table.export-excel': "Export Excel";
461
+ readonly 'core.component.table.exporting': "Exporting...{percent}%";
462
+ readonly 'core.component.table.export': "Export";
461
463
  readonly 'core.component.table.export-csv': "Export CSV";
462
464
  readonly 'core.component.table.showing': "Showing:";
463
465
  readonly 'core.component.table.paginator.first-page': "First page";
@@ -512,6 +514,8 @@ export declare const EN_MESSAGES: {
512
514
  readonly 'core.module.layout.not-found.message': "The page you're looking for doesn't exist or has been removed. Please check the URL or go back to the home page to continue.";
513
515
  readonly 'core.module.layout.not-found.back': "Go back";
514
516
  readonly 'core.module.layout.home.tab-name': "Home";
517
+ readonly 'core.module.layout.not-found.tab-name': "Page Not Found";
518
+ readonly 'core.module.layout.forbidden.tab-name': "Access Denied";
515
519
  readonly 'core.module.layout.home.feature.data': "Data";
516
520
  readonly 'core.module.layout.home.feature.reports': "Reports";
517
521
  readonly 'core.module.layout.home.feature.users': "Users";
@@ -2,5 +2,6 @@ export * from './modules';
2
2
  export * from './services';
3
3
  export * from './components';
4
4
  export * from './configurations';
5
+ export * from './utils';
5
6
  export * from './pipes';
6
7
  export * from './layout.module';
@@ -0,0 +1 @@
1
+ export * from './tab-name.util';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Resolve a translated tab name for `@SdTabComponent`.
3
+ *
4
+ * WHY not I18nService: the decorator runs at module-evaluation time, before
5
+ * Angular's DI exists, so the service cannot be injected. We read the language
6
+ * the app persisted and look the key up in the static catalog instead.
7
+ */
8
+ export declare function resolveTabName(key: string): string;
package/package.json CHANGED
@@ -1,7 +1,15 @@
1
1
  {
2
2
  "name": "@sdcorejs/angular",
3
- "version": "19.1.5",
3
+ "version": "19.1.6",
4
4
  "license": "MIT",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/sdcorejs/sdcorejs-angular.git"
8
+ },
9
+ "homepage": "https://sdcorejs.github.io/sdcorejs-angular/",
10
+ "bugs": {
11
+ "url": "https://github.com/sdcorejs/sdcorejs-angular/issues"
12
+ },
5
13
  "peerDependencies": {
6
14
  "@angular/common": "^19.0.0 || ^20.0.0 || ^21.0.0",
7
15
  "@angular/core": "^19.0.0 || ^20.0.0 || ^21.0.0",
@@ -35,14 +43,14 @@
35
43
  "types": "./index.d.ts",
36
44
  "default": "./fesm2022/sdcorejs-angular.mjs"
37
45
  },
38
- "./components": {
39
- "types": "./components/index.d.ts",
40
- "default": "./fesm2022/sdcorejs-angular-components.mjs"
41
- },
42
46
  "./configurations": {
43
47
  "types": "./configurations/index.d.ts",
44
48
  "default": "./fesm2022/sdcorejs-angular-configurations.mjs"
45
49
  },
50
+ "./components": {
51
+ "types": "./components/index.d.ts",
52
+ "default": "./fesm2022/sdcorejs-angular-components.mjs"
53
+ },
46
54
  "./directives": {
47
55
  "types": "./directives/index.d.ts",
48
56
  "default": "./fesm2022/sdcorejs-angular-directives.mjs"