@idevs/corelib 1.0.5 → 1.1.1

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 (80) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/MIGRATION.md +143 -0
  3. package/README.md +46 -0
  4. package/dist/editors/checkboxButtonEditor.d.ts +7 -13
  5. package/dist/editors/checkboxButtonEditor.d.ts.map +1 -1
  6. package/dist/editors/checkboxButtonEditor.js +6 -9
  7. package/dist/editors/checkboxButtonEditor.js.map +1 -1
  8. package/dist/editors/dateMonthEditor.js +1 -1
  9. package/dist/editors/dateMonthEditor.js.map +1 -1
  10. package/dist/formatters/formatterHelper.d.ts +30 -0
  11. package/dist/formatters/formatterHelper.d.ts.map +1 -0
  12. package/dist/formatters/formatterHelper.js +67 -0
  13. package/dist/formatters/formatterHelper.js.map +1 -0
  14. package/dist/formatters/formatters.d.ts +1 -1
  15. package/dist/formatters/formatters.d.ts.map +1 -1
  16. package/dist/formatters/formatters.js +18 -21
  17. package/dist/formatters/formatters.js.map +1 -1
  18. package/dist/formatters/index.d.ts +1 -0
  19. package/dist/formatters/index.d.ts.map +1 -1
  20. package/dist/formatters/index.js +1 -0
  21. package/dist/formatters/index.js.map +1 -1
  22. package/dist/globals/index.d.ts.map +1 -1
  23. package/dist/globals/index.js +30 -20
  24. package/dist/globals/index.js.map +1 -1
  25. package/dist/helpers/dialogHelper.d.ts.map +1 -1
  26. package/dist/helpers/dialogHelper.js +4 -5
  27. package/dist/helpers/dialogHelper.js.map +1 -1
  28. package/dist/helpers/excelExportHelper.d.ts +2 -2
  29. package/dist/helpers/excelExportHelper.d.ts.map +1 -1
  30. package/dist/helpers/excelExportHelper.js +4 -1
  31. package/dist/helpers/excelExportHelper.js.map +1 -1
  32. package/dist/helpers/gridHelper.js +2 -2
  33. package/dist/helpers/gridHelper.js.map +1 -1
  34. package/dist/helpers/index.d.ts +3 -1
  35. package/dist/helpers/index.d.ts.map +1 -1
  36. package/dist/helpers/index.js +5 -1
  37. package/dist/helpers/index.js.map +1 -1
  38. package/dist/helpers/pdfExportHelper.d.ts +2 -2
  39. package/dist/helpers/pdfExportHelper.d.ts.map +1 -1
  40. package/dist/helpers/pdfExportHelper.js +109 -85
  41. package/dist/helpers/pdfExportHelper.js.map +1 -1
  42. package/dist/helpers/processQueryButtons.d.ts +10 -0
  43. package/dist/helpers/processQueryButtons.d.ts.map +1 -0
  44. package/dist/helpers/processQueryButtons.js +27 -0
  45. package/dist/helpers/processQueryButtons.js.map +1 -0
  46. package/dist/helpers/windowHelper.d.ts +2 -0
  47. package/dist/helpers/windowHelper.d.ts.map +1 -0
  48. package/dist/helpers/windowHelper.js +8 -0
  49. package/dist/helpers/windowHelper.js.map +1 -0
  50. package/dist/index.d.ts +12 -0
  51. package/dist/index.d.ts.map +1 -1
  52. package/dist/index.js +12 -1
  53. package/dist/index.js.map +1 -1
  54. package/dist/types/export.d.ts +37 -1
  55. package/dist/types/export.d.ts.map +1 -1
  56. package/dist/types/export.js.map +1 -1
  57. package/dist/types/gridEditableMode.d.ts +9 -0
  58. package/dist/types/gridEditableMode.d.ts.map +1 -0
  59. package/dist/types/gridEditableMode.js +3 -0
  60. package/dist/types/gridEditableMode.js.map +1 -0
  61. package/dist/types/index.d.ts +1 -0
  62. package/dist/types/index.d.ts.map +1 -1
  63. package/dist/types/index.js +1 -0
  64. package/dist/types/index.js.map +1 -1
  65. package/dist/ui/DropdownToolButton.d.ts.map +1 -1
  66. package/dist/ui/DropdownToolButton.js +158 -44
  67. package/dist/ui/DropdownToolButton.js.map +1 -1
  68. package/dist/ui/ToggleToolButton.d.ts.map +1 -1
  69. package/dist/ui/ToggleToolButton.js +7 -4
  70. package/dist/ui/ToggleToolButton.js.map +1 -1
  71. package/dist/ui/index.d.ts +1 -1
  72. package/dist/ui/index.d.ts.map +1 -1
  73. package/dist/ui/index.js +3 -1
  74. package/dist/ui/index.js.map +1 -1
  75. package/dist/utils/date.d.ts.map +1 -1
  76. package/dist/utils/date.js +8 -6
  77. package/dist/utils/date.js.map +1 -1
  78. package/dist/utils/format.js +1 -1
  79. package/dist/utils/format.js.map +1 -1
  80. package/package.json +38 -8
package/CHANGELOG.md CHANGED
@@ -5,6 +5,52 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.1.1] - 2026-05-24
9
+
10
+ ### Added
11
+ - **Csi/UI port — batch 1/4** (primitives from PowerACC):
12
+ - `helpers/windowHelper.ts` — `isSmallDevice()` responsive media-query check.
13
+ - `helpers/processQueryButtons.ts` — `addProcessQueryButtons()` factory for paired Query/Clear toolbar buttons.
14
+ - `types/gridEditableMode.ts` — `GridEditableMode` discriminated union (`Full` / `Off` / `Some`).
15
+ - `formatters/formatterHelper.ts` — `customerCodeFormatter`, `isNumericTemplate`, `isNumericInput` (filename fixes the original `Formater` typo).
16
+ - 22 new unit tests covering the three modules above.
17
+
18
+ ## [1.1.0] - 2026-05-23
19
+
20
+ ### Added
21
+ - **Vitest test harness** with jsdom environment; unit tests for `utils/format`, `utils/dom`, `globals` date proxy helpers, `DropdownToolButton`, and `pdfExportHelper`.
22
+ - **GitHub Actions CI** (`.github/workflows/ci.yml`) running typecheck, lint, test, and build on PRs and pushes to `main`.
23
+ - **`@idevs/corelib/globals` subpath export** for opt-in prototype patches. Prepares for the 2.0.0 removal of the implicit side-effect import from the root entry.
24
+ - **`IdevsContentResponse.DownloadName`** field matching the .NET DTO. The existing `FileName` is preserved as a `@deprecated` alias.
25
+ - **`PdfExportOptions` / `ExcelExportOptions`** typed variants of `IdevsExportOptions` documenting which client-only flags apply to each path.
26
+ - **`MIGRATION.md`** with the deprecation guide and the 2.0.0 outlook.
27
+
28
+ ### Changed
29
+ - `doExportPdf` and `doExportExcel` now return `Promise<void>` and surface server errors. Existing callers continue to work but should `await` (or `.catch`) to capture failures.
30
+ - `prepublishOnly` now gates publish behind typecheck, lint, and tests.
31
+ - `@serenity-is/corelib` and `@serenity-is/sleekgrid` are now `peerDependencies` (range `>=8.8.6 <9` / `>=1.9.6 <2`) instead of regular `dependencies`. `jquery` and `jspdf` are declared as optional peers.
32
+ - TypeScript `strictNullChecks` is now enabled. The rest of the strict-family flags remain off pending further migration.
33
+
34
+ ### Fixed
35
+ - **XSS** in `DropdownToolButton.addSideButtonItem` — replaced HTML template interpolation with DOM-API construction (`buildSideButtonElement`), with invalid CSS-class tokens dropped as defense-in-depth.
36
+ - **XSS** in `pdfExportHelper.showFluentPdfPreview` — dialog title now uses `textContent` via the new `__buildPreviewDialog` helper. Bonus: the close-button glyph also moved from `innerHTML` to `textContent`.
37
+ - **Filename injection** in `doExportPdf` download — `options.reportName` is sanitized before use as `<a download>` via the new `__sanitizeDownloadName` helper.
38
+ - **Unhandled promise rejection** in `doExportPdf` — `serviceCall(...)` rejections are now propagated to the caller (function returns `Promise<void>` instead of `void`).
39
+ - **Null-deref risk** in `addDateProxyInput` and `updateDateProxyValue` when DOM queries return `null`. Note: `addDateProxyInput` now throws `Error('addDateProxyInput: input[name="..."] not found')` instead of crashing with a TypeError when the source input is missing.
40
+ - **Duplicate Blob/objectURL** creation in `doExportPdf` download branch.
41
+ - Replaced `any` with typed signatures in `IdevsExportOptions.onClick` (`(e: Event) => void`), `LookupFormatter.format(src: unknown, ...)`, and `CheckboxButtonEditor` lookup items (`Record<string, unknown>`).
42
+ - Stale `toastr` entry removed from `tsconfig.types` (the `@types/toastr` package wasn't installed and broke `tsc --noEmit`).
43
+
44
+ ### Deprecated
45
+ - `IdevsContentResponse.FileName` — use `DownloadName` (matches the server DTO). Removal in 2.0.0.
46
+ - Implicit `import './globals'` in the root entry — opt in via `import '@idevs/corelib/globals'` instead. Removal in 2.0.0.
47
+
48
+ ### Compatibility
49
+ - **No breaking changes.** Consumers on `^1.0.5` upgrade by running `npm update @idevs/corelib`.
50
+ - A future 2.0.0 will remove the deprecated paths and align wire DTO casing with the .NET DTO (`viewName` → `ViewName`, etc.). See `MIGRATION.md`.
51
+
52
+ ---
53
+
8
54
  ## [1.0.5] - 2025-01-26
9
55
 
10
56
  ### Changed
package/MIGRATION.md ADDED
@@ -0,0 +1,143 @@
1
+ # Migration Guide
2
+
3
+ ## 1.0.x → 1.1.0
4
+
5
+ **No runtime breaking changes.** All changes from 1.0.5 preserve the runtime
6
+ behaviour of existing code paths. One TypeScript-signature change is worth
7
+ noting: `doExportPdf` and `doExportExcel` now return `Promise<void>` instead
8
+ of `void`. Existing call sites that did not previously expect a return value
9
+ still work at runtime (the promise is dropped), but callers whose code passes
10
+ either function to a `() => void` callback slot will see a TS error because
11
+ `() => Promise<void>` is no longer assignable. Either await the call, attach
12
+ `.catch()`, or wrap in a void-returning lambda.
13
+
14
+ This release is otherwise a foundation update — strict TS slice enabled,
15
+ Vitest harness, GitHub Actions CI, XSS fixes, async export helpers, and
16
+ additive wire-contract fixes. Consumers on `^1.0.5` upgrade with
17
+ `npm update @idevs/corelib`.
18
+
19
+ ### Recommended migration steps
20
+
21
+ #### 1. Use `DownloadName` instead of `FileName`
22
+
23
+ `IdevsContentResponse.FileName` is now `@deprecated`. The server (Idevs.Net.CoreLib)
24
+ emits `DownloadName`; the `FileName` field has always been `undefined` at runtime.
25
+
26
+ ```ts
27
+ // before
28
+ const name = response.FileName ?? 'report.pdf'
29
+ // after
30
+ const name = response.DownloadName ?? 'report.pdf'
31
+ ```
32
+
33
+ #### 2. Opt in to prototype extensions explicitly
34
+
35
+ For backwards compatibility, `import '@idevs/corelib'` still applies the global
36
+ prototype extensions to `Date.prototype`, `Number.prototype`, and
37
+ `String.prototype`. This will be removed in 2.0.0.
38
+
39
+ Prepare today:
40
+
41
+ ```ts
42
+ // In your app entry point, replace any reliance on the implicit side-effect
43
+ // with one of these patterns:
44
+
45
+ // (A) Use the utility functions directly (preferred):
46
+ import { toSqlDateString, toTimeString, truncateString } from '@idevs/corelib'
47
+ const sql = toSqlDateString(new Date())
48
+
49
+ // (B) Opt in to the prototype patches explicitly:
50
+ import '@idevs/corelib/globals'
51
+ // Now `new Date().toSqlDate()` is available throughout the app.
52
+ ```
53
+
54
+ #### 3. Await `doExportPdf` / `doExportExcel`
55
+
56
+ Both helpers now return `Promise<void>` and reject on server failure. Existing
57
+ calls (`doExportPdf(opts)`) still work but leak unhandled rejections.
58
+
59
+ ```ts
60
+ // before
61
+ doExportPdf({ service: '/api/Foo/Export', ... })
62
+ // after
63
+ await doExportPdf({ service: '/api/Foo/Export', ... })
64
+ // or
65
+ doExportPdf({ ... }).catch(err => Q.notifyError(err.message))
66
+ ```
67
+
68
+ #### 4. Note: `addDateProxyInput` now throws when the source input is missing
69
+
70
+ Previously it would crash with an opaque `TypeError`. Now it throws
71
+ `Error('addDateProxyInput: input[name="..."] not found')`. Wrap calls in
72
+ try/catch if you wire date proxies on conditionally-rendered forms.
73
+
74
+ #### 5. Declare Serenity as a peer
75
+
76
+ If your `package.json` does not already list `@serenity-is/corelib`,
77
+ `npm install` will now warn. Add the peers explicitly:
78
+
79
+ ```jsonc
80
+ "dependencies": {
81
+ "@serenity-is/corelib": "^8.8.6",
82
+ "@serenity-is/sleekgrid": "^1.9.6"
83
+ }
84
+ ```
85
+
86
+ > Note: you usually do **not** add `@idevs/corelib` to your `package.json`
87
+ > yourself — the `Idevs.Net.CoreLib` NuGet package's `.targets` file installs
88
+ > it for you on `dotnet build` (pinned to the matching npm major). Add it
89
+ > manually only if you've set `<IdevsCoreLibInstallNpmPackage>false</IdevsCoreLibInstallNpmPackage>`
90
+ > to opt out of the auto-install.
91
+
92
+ ---
93
+
94
+ ## 1.x → 2.0.0 (planned)
95
+
96
+ The 2.0.0 release is not yet scheduled. It will be a Serenity-10 / .NET-10
97
+ relaunch in lockstep with `Idevs.Net.CoreLib` 0.8+, plus the breaking-cleanup
98
+ of items deprecated in 1.1.0.
99
+
100
+ ### Compatibility direction
101
+
102
+ | | 1.x lane (current) | 2.x lane (future) |
103
+ |---|---|---|
104
+ | `Idevs.Net.CoreLib` | 0.7.x | 0.8+ (planned) |
105
+ | .NET TFM | `net8.0` | `net10.0` |
106
+ | `Serenity.Net.Services` | `8.8.9` | `10.x` |
107
+ | `@serenity-is/corelib` | `>=8.8.6 <9` | `>=10.0.0 <11` |
108
+ | Visual Studio | 2022 | 2026 |
109
+
110
+ Serenity 9.x is intentionally skipped — the project follows Serenity's own
111
+ ".NET 8 stays on the 8.x lane; .NET 10 moves to 10.x" guidance.
112
+
113
+ ### Planned 2.0.0 changes
114
+
115
+ **Deprecation removals (from 1.1.0):**
116
+ - Remove `IdevsContentResponse.FileName` (use `DownloadName`).
117
+ - Remove implicit `import './globals'` from the root entry (use the subpath).
118
+
119
+ **Wire-contract alignment with .NET DTOs:**
120
+ - Rename camelCase wire fields to PascalCase to match the .NET DTO:
121
+ `viewName` → `ViewName`, `companyName` → `CompanyName`,
122
+ `reportName` → `ReportName`, `selectionRange` → `SelectionRange`,
123
+ `conditionRange` → `ConditionRange`, `logo` → `Logo`, `entity` → `Entity`,
124
+ `pageSize` → `PageSize`, `margin` → `Margin`.
125
+ - Drop the `render` / `openPrintDialog` flags from `IdevsExportRequest` (the
126
+ wire DTO) — they remain on `PdfExportOptions` (the client-side options type).
127
+
128
+ **Serenity 10 modernization:**
129
+ - Replace `@Decorators.registerEditor(...)` / `@Decorators.registerFormatter(...)`
130
+ / `@Decorators.option()` with `static [Symbol.typeInfo] = this.registerClass(...)`
131
+ in every editor and formatter (Serenity 9+ deprecated decorator registration).
132
+ - Rewrite `DropdownToolButton` to use Serenity 10's `Fluent` / `@serenity-is/domwise`
133
+ instead of jQuery `$(...)` HTML templates.
134
+ - Audit `pdfExportHelper.showFluentPdfPreview` for strict-CSP compatibility
135
+ (Serenity 10's StartSharp template enables strict CSP by default) — move
136
+ inline `cssText` blobs into the `css/` folder.
137
+ - Drop `@types/jquery`, `@types/jquery.validation`, `@types/jqueryui` from
138
+ `tsconfig.types`.
139
+
140
+ **General cleanup:**
141
+ - Enable full TypeScript strict mode.
142
+ - Consider dropping CommonJS in favor of ESM-only, aligned with the modern
143
+ Serenity 10 toolchain.
package/README.md CHANGED
@@ -20,6 +20,52 @@ A comprehensive library of extended components and utilities for the Serenity Fr
20
20
  npm install @idevs/corelib
21
21
  ```
22
22
 
23
+ ## Runtime dependencies
24
+
25
+ `@idevs/corelib` ships against the following peers, declared in your app's
26
+ `package.json`:
27
+
28
+ | Package | Range | Required |
29
+ |---|---|---|
30
+ | `@serenity-is/corelib` | `>=8.8.6 <9` | yes |
31
+ | `@serenity-is/sleekgrid` | `>=1.9.6 <2` | yes |
32
+ | `jquery` | `>=3.5` | optional (used by UI helpers) |
33
+ | `jspdf` | `>=3` | optional (used by PDF helpers) |
34
+
35
+ ### Compatibility matrix
36
+
37
+ `@idevs/corelib` tracks the same Serenity major as its server-side
38
+ companion [Idevs.Net.CoreLib](https://www.nuget.org/packages/Idevs.Net.CoreLib).
39
+ Serenity 9.x is intentionally skipped — pick the lane that matches your
40
+ target framework:
41
+
42
+ | Lane | `Idevs.Net.CoreLib` | .NET TFM | `Serenity.Net.Services` | `@serenity-is/corelib` | `@idevs/corelib` |
43
+ |---|---|---|---|---|---|
44
+ | **Current** | 0.7.x | `net8.0` | `8.8.9` | `>=8.8.6 <9` | **1.x** |
45
+ | **Future** | 0.8+ (planned) | `net10.0` | `10.x` | `>=10.0.0 <11` | **2.x** (planned) |
46
+
47
+ The TS DTOs in `@idevs/corelib/types/export` mirror the .NET `Idevs.Models.*`
48
+ DTOs; see [MIGRATION.md](./MIGRATION.md) for naming changes between versions.
49
+
50
+ ### Install bridge
51
+
52
+ You normally do **not** run `npm install @idevs/corelib` yourself. The
53
+ `Idevs.Net.CoreLib` NuGet package ships an MSBuild `.targets` file that runs
54
+ the npm install for you on first `dotnet build`, pinned to the npm major
55
+ matching your `Idevs.Net.CoreLib` version (see the matrix above). It also
56
+ copies CSS assets from `node_modules/@idevs/corelib/css/` into
57
+ `wwwroot/lib/Idevs/Content/`.
58
+
59
+ To opt out (e.g., air-gapped CI), set in your `.csproj`:
60
+
61
+ ```xml
62
+ <PropertyGroup>
63
+ <IdevsCoreLibInstallNpmPackage>false</IdevsCoreLibInstallNpmPackage>
64
+ </PropertyGroup>
65
+ ```
66
+
67
+ …and provision `@idevs/corelib` manually.
68
+
23
69
  ## Quick Start
24
70
 
25
71
  ### Basic Usage
@@ -1,8 +1,9 @@
1
1
  import { EditorWidget, IReadOnly } from '@serenity-is/corelib';
2
2
  import type { EditorProps } from '@serenity-is/corelib';
3
+ type LookupItem = Record<string, unknown>;
3
4
  export type CheckboxButtonEditorOptions = {
4
5
  enumKey?: string;
5
- enumType?: any;
6
+ enumType?: unknown;
6
7
  lookupKey?: string;
7
8
  isStringId?: boolean;
8
9
  };
@@ -16,18 +17,10 @@ export declare class CheckboxButtonEditor<P extends CheckboxButtonEditorOptions
16
17
  constructor(props: EditorProps<P>);
17
18
  protected renderCheckboxes(): void;
18
19
  protected addCheckbox(value: string, text: string): void;
19
- get_items(): Array<{
20
- [key: string]: any;
21
- }>;
22
- get items(): Array<{
23
- [key: string]: any;
24
- }>;
25
- set_items(value: Array<{
26
- [key: string]: any;
27
- }>): void;
28
- set items(v: Array<{
29
- [key: string]: any;
30
- }>);
20
+ get_items(): LookupItem[];
21
+ get items(): LookupItem[];
22
+ set_items(value: LookupItem[]): void;
23
+ set items(v: LookupItem[]);
31
24
  get_value(): string;
32
25
  get value(): string;
33
26
  set_value(value: string): void;
@@ -38,4 +31,5 @@ export declare class CheckboxButtonEditor<P extends CheckboxButtonEditorOptions
38
31
  export declare class idevsEditors {
39
32
  static load(): void;
40
33
  }
34
+ export {};
41
35
  //# sourceMappingURL=checkboxButtonEditor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkboxButtonEditor.d.ts","sourceRoot":"","sources":["../../src/editors/checkboxButtonEditor.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,YAAY,EAKZ,SAAS,EAMV,MAAM,sBAAsB,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AAE;IAK7B,IAAI,KAAK,CAAC,CAAC,EAAE,UAAU,EAAE,EAExB;IAED,SAAS;IAWT,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAoB9B,IAAI,KAAK,CAAC,CAAC,EAAE,MAAM,EAElB;IAED,YAAY,IAAI,OAAO;IAIvB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;CAenC;AAED,qBAAa,YAAY;WACT,IAAI;CACnB"}
@@ -1,6 +1,4 @@
1
1
  "use strict";
2
- /* eslint-disable @typescript-eslint/no-explicit-any */
3
- /* eslint-disable @typescript-eslint/adjacent-overload-signatures */
4
2
  // reference: https://github-wiki-see.page/m/serenity-is/Serenity/wiki/CheckBox-Group-Editor
5
3
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
6
4
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -20,20 +18,20 @@ let CheckboxButtonEditor = class CheckboxButtonEditor extends corelib_1.EditorWi
20
18
  }
21
19
  constructor(props) {
22
20
  super(props);
23
- if ((0, corelib_1.isEmptyOrNull)(this.options.enumKey) &&
21
+ if ((0, corelib_1.isEmptyOrNull)(this.options.enumKey ?? '') &&
24
22
  this.options.enumType == null &&
25
- (0, corelib_1.isEmptyOrNull)(this.options.lookupKey)) {
23
+ (0, corelib_1.isEmptyOrNull)(this.options.lookupKey ?? '')) {
26
24
  return;
27
25
  }
28
- this._isStringId = this.options.isStringId;
29
- if (!(0, corelib_1.isEmptyOrNull)(this.options.lookupKey)) {
30
- const lookup = (0, corelib_1.getLookup)(this.options.lookupKey);
26
+ this._isStringId = this.options.isStringId ?? false;
27
+ if (!(0, corelib_1.isEmptyOrNull)(this.options.lookupKey ?? '')) {
28
+ const lookup = (0, corelib_1.getLookup)(this.options.lookupKey ?? '');
31
29
  this._idField = lookup.idField;
32
30
  this._textField = lookup.textField;
33
31
  this.set_items(lookup.items);
34
32
  }
35
33
  else {
36
- const enumType = this.options.enumType || corelib_1.EnumTypeRegistry.get(this.options.enumKey);
34
+ const enumType = this.options.enumType || corelib_1.EnumTypeRegistry.get(this.options.enumKey ?? '');
37
35
  let enumKey = this.options.enumKey;
38
36
  if (enumKey == null && enumType != null) {
39
37
  const enumKeyAttr = (0, corelib_1.getCustomAttributes)(enumType, corelib_1.EnumKeyAttribute, false);
@@ -145,7 +143,6 @@ exports.CheckboxButtonEditor = CheckboxButtonEditor = __decorate([
145
143
  __metadata("design:paramtypes", [Object])
146
144
  ], CheckboxButtonEditor);
147
145
  class idevsEditors {
148
- // eslint-disable-next-line @typescript-eslint/no-empty-function
149
146
  static load() { }
150
147
  }
151
148
  exports.idevsEditors = idevsEditors;
@@ -1 +1 @@
1
- {"version":3,"file":"checkboxButtonEditor.js","sourceRoot":"","sources":["../../src/editors/checkboxButtonEditor.ts"],"names":[],"mappings":";AAAA,uDAAuD;AACvD,oEAAoE;AACpE,4FAA4F;;;;;;;;;;;;AAE5F,kDAa6B;AAWtB,IAAM,oBAAoB,GAA1B,MAAM,oBAGX,SAAQ,sBAAe;IAQvB,MAAM,CAAU,oBAAoB;QAClC,OAAO,IAAA,gBAAM,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAA;IAChC,CAAC;IAGD,YAAY,KAAqB;QAC/B,KAAK,CAAC,KAAK,CAAC,CAAA;QAEZ,IACE,IAAA,uBAAa,EAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;YACnC,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,IAAI;YAC7B,IAAA,uBAAa,EAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EACrC,CAAC;YACD,OAAM;QACR,CAAC;QAED,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAA;QAE1C,IAAI,CAAC,IAAA,uBAAa,EAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CA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,UAAU,CAAC,CAAA;gBACjD,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAmB,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;oBACvE,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;gBAC5C,CAAC,CAAC,CAAA;YACJ,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAA;gBACxC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAmB,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;oBACvE,KAAK,CAAC,eAAe,CAAC,UAAU,CAAC,CAAA;gBACnC,CAAC,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AA5JY,oDAAoB;+BAApB,oBAAoB;IADhC,oBAAU,CAAC,cAAc,CAAC,sBAAsB,CAAC;;GACrC,oBAAoB,CA4JhC;AAED,MAAa,YAAY;IAChB,MAAM,CAAC,IAAI,KAAI,CAAC;CACxB;AAFD,oCAEC"}
@@ -17,7 +17,7 @@ let DateMonthEditor = class DateMonthEditor extends corelib_1.SelectEditor {
17
17
  this.updateItems();
18
18
  }
19
19
  get valueAsMonth() {
20
- return (0, corelib_1.indexOf)(this.months, x => x == this.value);
20
+ return (0, corelib_1.indexOf)(this.months, x => x === this.value);
21
21
  }
22
22
  getItems() {
23
23
  const opt = this.options;
@@ -1 +1 @@
1
- {"version":3,"file":"dateMonthEditor.js","sourceRoot":"","sources":["../../src/editors/dateMonthEditor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA6F;AAItF,IAAM,eAAe,GAArB,MAAM,eAEX,SAAQ,sBAAe;IAGvB,YAAY,KAAqB;QAC/B,KAAK,CAAC,KAAK,CAAC,CAAA;QAEZ,IAAI,CAAC,WAAW,EAAE,CAAA;IACpB,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAA,iBAAO,EAAC,IAAI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,CAAA;QACrB,CAAC;QAED,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;CACF,CAAA;AAtCY,0CAAe;0BAAf,eAAe;IAD3B,oBAAU,CAAC,cAAc,CAAC,iBAAiB,CAAC;;GAChC,eAAe,CAsC3B"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Apply a pattern mask to a value.
3
+ * - '0' and 'x' placeholders both consume the next alphanumeric character from
4
+ * the value; they differ only in their padding char when the value is shorter
5
+ * ('0' pads with '0', 'x' pads with a space).
6
+ * - All other pattern characters are literal separators copied through.
7
+ *
8
+ * Early-return guard: the input is first stripped of non-alphanumerics. If the
9
+ * pattern is composed entirely of '0' characters (no separators, e.g. "0000")
10
+ * AND the stripped value is not a pure digit string, the original value is
11
+ * returned untouched. That covers two cases:
12
+ * - the stripped value contains a letter (e.g. "AB12")
13
+ * - the stripped value is empty (raw input was empty or separators-only)
14
+ * Numeric masks that contain separators (e.g. "0000-00000-0") do NOT trigger
15
+ * this guard — this is the inherited behavior from the original PowerACC
16
+ * implementation.
17
+ */
18
+ export declare function customerCodeFormatter(value: string, pattern: string): string;
19
+ /**
20
+ * True when the pattern, after removing all '0' characters, contains only
21
+ * digits, whitespace, or the common separators (`. _ -`). In practice this
22
+ * means the pattern has no 'x' (letter) placeholders. Note: patterns
23
+ * consisting solely of separators (e.g. "-") or solely of literal digits
24
+ * (e.g. "123") also return true; the check is "no letter placeholders",
25
+ * not "has at least one '0' placeholder".
26
+ */
27
+ export declare function isNumericTemplate(pattern: string): boolean;
28
+ /** True when the value consists of digits once common separators (- _ . space) are stripped. */
29
+ export declare function isNumericInput(value: string): boolean;
30
+ //# sourceMappingURL=formatterHelper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatterHelper.d.ts","sourceRoot":"","sources":["../../src/formatters/formatterHelper.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAwB5E;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED,gGAAgG;AAChG,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAErD"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.customerCodeFormatter = customerCodeFormatter;
4
+ exports.isNumericTemplate = isNumericTemplate;
5
+ exports.isNumericInput = isNumericInput;
6
+ const ALPHANUMERIC_STRIP = /[^0-9a-zA-Z]/g;
7
+ const DIGITS_ONLY = /^\d+$/;
8
+ const NUMERIC_TEMPLATE_RESIDUE = /^[0-9\s._-]+$/;
9
+ const COMMON_SEPARATORS = /[\s._-]/g;
10
+ /**
11
+ * Apply a pattern mask to a value.
12
+ * - '0' and 'x' placeholders both consume the next alphanumeric character from
13
+ * the value; they differ only in their padding char when the value is shorter
14
+ * ('0' pads with '0', 'x' pads with a space).
15
+ * - All other pattern characters are literal separators copied through.
16
+ *
17
+ * Early-return guard: the input is first stripped of non-alphanumerics. If the
18
+ * pattern is composed entirely of '0' characters (no separators, e.g. "0000")
19
+ * AND the stripped value is not a pure digit string, the original value is
20
+ * returned untouched. That covers two cases:
21
+ * - the stripped value contains a letter (e.g. "AB12")
22
+ * - the stripped value is empty (raw input was empty or separators-only)
23
+ * Numeric masks that contain separators (e.g. "0000-00000-0") do NOT trigger
24
+ * this guard — this is the inherited behavior from the original PowerACC
25
+ * implementation.
26
+ */
27
+ function customerCodeFormatter(value, pattern) {
28
+ const cleanValue = value.replace(ALPHANUMERIC_STRIP, '');
29
+ const isAllZerosPattern = pattern.replace(/[^0-9]/g, '') === '0'.repeat(pattern.length);
30
+ const isNumericValue = DIGITS_ONLY.test(cleanValue);
31
+ if (isAllZerosPattern && !isNumericValue) {
32
+ return value;
33
+ }
34
+ let result = '';
35
+ let valueIndex = 0;
36
+ for (let i = 0; i < pattern.length; i++) {
37
+ const patternChar = pattern.charAt(i);
38
+ if (patternChar === '0' || patternChar === 'x') {
39
+ if (valueIndex < cleanValue.length) {
40
+ result += cleanValue.charAt(valueIndex++);
41
+ }
42
+ else {
43
+ result += patternChar === '0' ? '0' : ' ';
44
+ }
45
+ }
46
+ else {
47
+ result += patternChar;
48
+ }
49
+ }
50
+ return result;
51
+ }
52
+ /**
53
+ * True when the pattern, after removing all '0' characters, contains only
54
+ * digits, whitespace, or the common separators (`. _ -`). In practice this
55
+ * means the pattern has no 'x' (letter) placeholders. Note: patterns
56
+ * consisting solely of separators (e.g. "-") or solely of literal digits
57
+ * (e.g. "123") also return true; the check is "no letter placeholders",
58
+ * not "has at least one '0' placeholder".
59
+ */
60
+ function isNumericTemplate(pattern) {
61
+ return NUMERIC_TEMPLATE_RESIDUE.test(pattern.replace(/0/g, ''));
62
+ }
63
+ /** True when the value consists of digits once common separators (- _ . space) are stripped. */
64
+ function isNumericInput(value) {
65
+ return DIGITS_ONLY.test(value.replace(COMMON_SEPARATORS, ''));
66
+ }
67
+ //# sourceMappingURL=formatterHelper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatterHelper.js","sourceRoot":"","sources":["../../src/formatters/formatterHelper.ts"],"names":[],"mappings":";;AAsBA,sDAwBC;AAUD,8CAEC;AAGD,wCAEC;AA/DD,MAAM,kBAAkB,GAAG,eAAe,CAAA;AAC1C,MAAM,WAAW,GAAG,OAAO,CAAA;AAC3B,MAAM,wBAAwB,GAAG,eAAe,CAAA;AAChD,MAAM,iBAAiB,GAAG,UAAU,CAAA;AAEpC;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,qBAAqB,CAAC,KAAa,EAAE,OAAe;IAClE,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAA;IACxD,MAAM,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC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atter implements Formatter {
52
52
  get lookupKey(): string;
53
53
  set lookupKey(value: string);
54
54
  format(ctx: FormatterContext): string;
55
- static format(src: any, lookupKey?: string): string;
55
+ static format(src: unknown, lookupKey?: string): string;
56
56
  }
57
57
  export declare class DateMonthFormatter implements Formatter {
58
58
  display: '2-digit' | 'short' | 'long';
@@ -1 +1 @@
1
- {"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../src/formatters/formatters.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAGzD,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,CAAC,GAAG,EAAE,gBAAgB,GAAG,MAAM,CAAA;CACtC,CAAA;AAED,qBACa,oBAAqB,YAAW,SAAS;aACxB,KAAK,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE;gBAA/B,KAAK,GAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAO;IAKhE,IAAI,WAAW,IAGQ,MAAM,CAD5B;IACD,IAAI,WAAW,CAAC,KAAK,EAAE,MAAM,EAE5B;IAED,MAAM,CAAC,GAAG,EAAE,gBAAgB,GAAG,MAAM;IAIrC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM;CAQzD;AAED,qBACa,iBAAkB,YAAW,SAAS;aAE/B,KAAK,EAAE;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,aAAa,CAAC,EAAE,MAAM,CAAA;QACtB,cAAc,CAAC,EAAE,MAAM,CAAA;KACxB;gBANe,KAAK,EAAE;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,aAAa,CAAC,EAAE,MAAM,C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AAED,qBAAa,eAAe;WACZ,IAAI;CACnB"}
@@ -21,7 +21,7 @@ let ZeroDisplayFormatter = ZeroDisplayFormatter_1 = class ZeroDisplayFormatter {
21
21
  (_a = this.props).displayText ?? (_a.displayText = '');
22
22
  }
23
23
  get displayText() {
24
- return this.props.displayText;
24
+ return this.props.displayText ?? '';
25
25
  }
26
26
  set displayText(value) {
27
27
  this.props.displayText = value;
@@ -31,8 +31,8 @@ let ZeroDisplayFormatter = ZeroDisplayFormatter_1 = class ZeroDisplayFormatter {
31
31
  }
32
32
  static format(src, displayText) {
33
33
  const value = parseFloat(String(src || '0').replace(',', ''));
34
- if (value == 0) {
35
- return (0, corelib_2.htmlEncode)(displayText);
34
+ if (value === 0) {
35
+ return (0, corelib_2.htmlEncode)(displayText ?? '');
36
36
  }
37
37
  return (0, corelib_2.htmlEncode)(src);
38
38
  }
@@ -53,31 +53,31 @@ let CheckboxFormatter = CheckboxFormatter_1 = class CheckboxFormatter {
53
53
  (_e = this.props).falseValueIcon ?? (_e.falseValueIcon = 'mdi mdi-checkbox-blank-outline');
54
54
  }
55
55
  get cssClass() {
56
- return this.props.cssClass;
56
+ return this.props.cssClass ?? '';
57
57
  }
58
58
  set cssClass(value) {
59
59
  this.props.cssClass = value;
60
60
  }
61
61
  get trueText() {
62
- return this.props.trueText;
62
+ return this.props.trueText ?? '';
63
63
  }
64
64
  set trueText(value) {
65
65
  this.props.trueText = value;
66
66
  }
67
67
  get falseText() {
68
- return this.props.falseText;
68
+ return this.props.falseText ?? '';
69
69
  }
70
70
  set falseText(value) {
71
71
  this.props.falseText = value;
72
72
  }
73
73
  get trueValueIcon() {
74
- return this.props.trueValueIcon;
74
+ return this.props.trueValueIcon ?? '';
75
75
  }
76
76
  set trueValueIcon(value) {
77
77
  this.props.trueValueIcon = value;
78
78
  }
79
79
  get falseValueIcon() {
80
- return this.props.falseValueIcon;
80
+ return this.props.falseValueIcon ?? '';
81
81
  }
82
82
  set falseValueIcon(value) {
83
83
  this.props.falseValueIcon = value;
@@ -86,10 +86,10 @@ let CheckboxFormatter = CheckboxFormatter_1 = class CheckboxFormatter {
86
86
  return CheckboxFormatter_1.format(ctx.value, this.cssClass, this.trueText, this.falseText, this.trueValueIcon, this.falseValueIcon);
87
87
  }
88
88
  static format(src, cssClass, trueText, falseText, trueValueIcon, falseValueIcon) {
89
- if (src == trueText) {
89
+ if (src === trueText) {
90
90
  return `<i class="${trueValueIcon} ${cssClass}"></i>`;
91
91
  }
92
- else if (src == falseText) {
92
+ else if (src === falseText) {
93
93
  return `<i class="${falseValueIcon} ${cssClass}"></i>`;
94
94
  }
95
95
  else {
@@ -108,7 +108,7 @@ let LookupFormatter = LookupFormatter_1 = class LookupFormatter {
108
108
  this.props ?? (this.props = {});
109
109
  }
110
110
  get lookupKey() {
111
- return this.props.lookupKey;
111
+ return this.props.lookupKey ?? '';
112
112
  }
113
113
  set lookupKey(value) {
114
114
  this.props.lookupKey = value;
@@ -116,27 +116,25 @@ let LookupFormatter = LookupFormatter_1 = class LookupFormatter {
116
116
  format(ctx) {
117
117
  return LookupFormatter_1.format(ctx.value, this.lookupKey);
118
118
  }
119
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
120
119
  static format(src, lookupKey) {
121
120
  if (!src)
122
121
  return '';
122
+ const key = String(src);
123
123
  if (!lookupKey)
124
- return src;
124
+ return key;
125
125
  const lookup = (0, corelib_2.getLookup)(lookupKey);
126
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
127
126
  const items = lookup.items;
128
127
  const idField = lookup.idField;
129
128
  const textField = lookup.textField;
130
- const idList = src.toString().split(',');
131
- return (idList
132
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
133
- .map((x) => {
134
- const g = items.find(i => i[idField] == x);
129
+ const idList = key.split(',');
130
+ return idList
131
+ .map(x => {
132
+ const g = items.find(i => String(i[idField]) === x);
135
133
  if (!g)
136
134
  return x;
137
135
  return (0, corelib_2.htmlEncode)(g[textField]);
138
136
  })
139
- .join(', '));
137
+ .join(', ');
140
138
  }
141
139
  };
142
140
  exports.LookupFormatter = LookupFormatter;
@@ -167,7 +165,6 @@ exports.DateMonthFormatter = DateMonthFormatter = __decorate([
167
165
  corelib_1.Decorators.registerFormatter('Idevs.DateMonthFormatter')
168
166
  ], DateMonthFormatter);
169
167
  class idevsFormatters {
170
- // eslint-disable-next-line @typescript-eslint/no-empty-function
171
168
  static load() { }
172
169
  }
173
170
  exports.idevsFormatters = idevsFormatters;