@spring-systems/core 0.8.0

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 (101) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/LICENSE +8 -0
  3. package/README.md +77 -0
  4. package/dist/adapters/index.d.ts +246 -0
  5. package/dist/adapters/index.js +56 -0
  6. package/dist/adapters/index.js.map +1 -0
  7. package/dist/auth/index.d.ts +17 -0
  8. package/dist/auth/index.js +19 -0
  9. package/dist/auth/index.js.map +1 -0
  10. package/dist/chunk-5D6XE7NJ.js +16 -0
  11. package/dist/chunk-5D6XE7NJ.js.map +1 -0
  12. package/dist/chunk-EFUBAQCV.js +94 -0
  13. package/dist/chunk-EFUBAQCV.js.map +1 -0
  14. package/dist/chunk-F2SIMWZ5.js +173 -0
  15. package/dist/chunk-F2SIMWZ5.js.map +1 -0
  16. package/dist/chunk-F7WUQJH7.js +399 -0
  17. package/dist/chunk-F7WUQJH7.js.map +1 -0
  18. package/dist/chunk-GON7Q32Q.js +176 -0
  19. package/dist/chunk-GON7Q32Q.js.map +1 -0
  20. package/dist/chunk-GXU75LQX.js +182 -0
  21. package/dist/chunk-GXU75LQX.js.map +1 -0
  22. package/dist/chunk-HFELOXDQ.js +110 -0
  23. package/dist/chunk-HFELOXDQ.js.map +1 -0
  24. package/dist/chunk-KX32MU3I.js +190 -0
  25. package/dist/chunk-KX32MU3I.js.map +1 -0
  26. package/dist/chunk-MEWPYTWC.js +284 -0
  27. package/dist/chunk-MEWPYTWC.js.map +1 -0
  28. package/dist/chunk-N2L4TUC4.js +34 -0
  29. package/dist/chunk-N2L4TUC4.js.map +1 -0
  30. package/dist/chunk-NQQIVCLX.js +47 -0
  31. package/dist/chunk-NQQIVCLX.js.map +1 -0
  32. package/dist/chunk-OSSX443T.js +146 -0
  33. package/dist/chunk-OSSX443T.js.map +1 -0
  34. package/dist/chunk-PT4DIYUK.js +78 -0
  35. package/dist/chunk-PT4DIYUK.js.map +1 -0
  36. package/dist/chunk-QAVWXARR.js +51 -0
  37. package/dist/chunk-QAVWXARR.js.map +1 -0
  38. package/dist/chunk-RRWKDFAB.js +143 -0
  39. package/dist/chunk-RRWKDFAB.js.map +1 -0
  40. package/dist/chunk-RUCXSQEY.js +42 -0
  41. package/dist/chunk-RUCXSQEY.js.map +1 -0
  42. package/dist/chunk-S6RPCN5H.js +64 -0
  43. package/dist/chunk-S6RPCN5H.js.map +1 -0
  44. package/dist/chunk-S7MKRNMI.js +153 -0
  45. package/dist/chunk-S7MKRNMI.js.map +1 -0
  46. package/dist/chunk-SQB4F3EF.js +55 -0
  47. package/dist/chunk-SQB4F3EF.js.map +1 -0
  48. package/dist/chunk-U5OH3GAI.js +399 -0
  49. package/dist/chunk-U5OH3GAI.js.map +1 -0
  50. package/dist/chunk-UDT2RPX2.js +43 -0
  51. package/dist/chunk-UDT2RPX2.js.map +1 -0
  52. package/dist/config/index.d.ts +63 -0
  53. package/dist/config/index.js +109 -0
  54. package/dist/config/index.js.map +1 -0
  55. package/dist/devtools/index.d.ts +54 -0
  56. package/dist/devtools/index.js +67 -0
  57. package/dist/devtools/index.js.map +1 -0
  58. package/dist/errors/index.d.ts +39 -0
  59. package/dist/errors/index.js +21 -0
  60. package/dist/errors/index.js.map +1 -0
  61. package/dist/events/index.d.ts +153 -0
  62. package/dist/events/index.js +12 -0
  63. package/dist/events/index.js.map +1 -0
  64. package/dist/form-types-D3MdGpjA.d.ts +290 -0
  65. package/dist/framework-config-types-DeUbx4bu.d.ts +574 -0
  66. package/dist/i18n/index.d.ts +37 -0
  67. package/dist/i18n/index.js +7 -0
  68. package/dist/i18n/index.js.map +1 -0
  69. package/dist/index.d.ts +9 -0
  70. package/dist/index.js +42 -0
  71. package/dist/index.js.map +1 -0
  72. package/dist/instance/index.d.ts +112 -0
  73. package/dist/instance/index.js +37 -0
  74. package/dist/instance/index.js.map +1 -0
  75. package/dist/logger/index.d.ts +44 -0
  76. package/dist/logger/index.js +27 -0
  77. package/dist/logger/index.js.map +1 -0
  78. package/dist/middleware/index.d.ts +91 -0
  79. package/dist/middleware/index.js +23 -0
  80. package/dist/middleware/index.js.map +1 -0
  81. package/dist/middleware-registry-DT002qRd.d.ts +60 -0
  82. package/dist/middleware-types-DVG9C1qJ.d.ts +85 -0
  83. package/dist/plugins/index.d.ts +104 -0
  84. package/dist/plugins/index.js +16 -0
  85. package/dist/plugins/index.js.map +1 -0
  86. package/dist/runtime-env-config-CajOEJCP.d.ts +148 -0
  87. package/dist/security-sanitize-Bb0PExM6.d.ts +9 -0
  88. package/dist/spring-instance-EbUh4mQb.d.ts +119 -0
  89. package/dist/testing/index.d.ts +129 -0
  90. package/dist/testing/index.js +171 -0
  91. package/dist/testing/index.js.map +1 -0
  92. package/dist/types/index.d.ts +85 -0
  93. package/dist/types/index.js +72 -0
  94. package/dist/types/index.js.map +1 -0
  95. package/dist/utils/index.d.ts +143 -0
  96. package/dist/utils/index.js +786 -0
  97. package/dist/utils/index.js.map +1 -0
  98. package/dist/validation/index.d.ts +48 -0
  99. package/dist/validation/index.js +147 -0
  100. package/dist/validation/index.js.map +1 -0
  101. package/package.json +142 -0
@@ -0,0 +1,85 @@
1
+ import { P as Permission, b as FormStoreState } from '../form-types-D3MdGpjA.js';
2
+ export { A as ApiErrorLike, C as ColumnLayout, c as ColumnType, d as CombinedSettingData, e as ComparisonFunction, D as DefaultFilter, f as FilterFieldValue, g as FilterNode, h as FormChangedPath, i as FormChangesApi, j as FormChangesSnapshot, k as FormCollectionActions, l as FormCollectionItem, a as FormDataValue, m as FormDetailFields, F as FormDetailRuntime, n as FormFieldCore, o as FormFieldDefinitionRuntime, p as FormFieldLifecycle, q as FormFieldMutation, r as FormFieldRuntime, s as FormFieldValidation, t as FormFieldValue, u as FormFieldVisibility, v as FormLifecycle, w as FormManagerBase, x as FormManagerRef, y as FormStoreApi, z as FormStoreInstance, B as FormStructureDef, I as Identifiable, E as Indexable, G as IndexedFormData, L as ListManagerLoadable, H as LogicOperator, R as ReadOnlyField, S as SavedLayout, J as SystemFilterRecord, V as ValidatorFn, K as getField, M as getIdentifiableId, N as getStoreValue, O as getSubState, Q as isColumnLayout, T as isCombinedSettingData, U as isFilterNode, W as isFormFieldRuntime, X as isPermission, Y as storeBoundary, Z as toFormDataValue } from '../form-types-D3MdGpjA.js';
3
+
4
+ /**
5
+ * Branded types for nominal type safety.
6
+ * Prevents accidental interchange of structurally identical string types.
7
+ * @module branded
8
+ */
9
+ declare const __brand: unique symbol;
10
+ /** Brands a base type `T` with a nominal tag `B`. */
11
+ type Brand<T, B extends string> = T & {
12
+ readonly [__brand]: B;
13
+ };
14
+ /** A GUID / UUID string. */
15
+ type Guid = Brand<string, "Guid">;
16
+ /** A public entity identifier. */
17
+ type IdPublic = Brand<string, "IdPublic">;
18
+ /** A resource/translation key. */
19
+ type ResourceKey = Brand<string, "ResourceKey">;
20
+ /** An API route path. */
21
+ type ApiRoute = Brand<string, "ApiRoute">;
22
+ /** Cast a plain string to a Guid (boundary cast). */
23
+ declare function toGuid(value: string): Guid;
24
+ /** Cast a plain string to an IdPublic (boundary cast). */
25
+ declare function toIdPublic(value: string): IdPublic;
26
+ /** Cast a plain string to a ResourceKey (boundary cast). */
27
+ declare function toResourceKey(value: string): ResourceKey;
28
+ /** Cast a plain string to an ApiRoute (boundary cast). */
29
+ declare function toApiRoute(value: string): ApiRoute;
30
+
31
+ /**
32
+ * List types — pure type definitions extracted from shared/lists/lists.ts.
33
+ * @module list-types
34
+ */
35
+
36
+ /** Comparison operators used in format conditions (conditional formatting). */
37
+ type FormatOperator = "==" | "===" | "!=" | "!==" | ">" | ">=" | "<" | "<=";
38
+ interface FormatCondition {
39
+ value?: string | number | boolean | null;
40
+ background?: string;
41
+ color?: string;
42
+ column?: string;
43
+ field: string;
44
+ operator?: FormatOperator;
45
+ className?: string;
46
+ }
47
+ declare const FormatType: {
48
+ readonly Badge: 1;
49
+ readonly Color: 2;
50
+ readonly Background: 3;
51
+ readonly RowBackground: 4;
52
+ readonly Icon: 5;
53
+ readonly Detail: 6;
54
+ };
55
+ type FormatType = (typeof FormatType)[keyof typeof FormatType];
56
+ interface Pagination {
57
+ page?: number;
58
+ per_page?: number;
59
+ object_count: number;
60
+ }
61
+ interface ListResponse<T> {
62
+ data: T[];
63
+ message: string | null;
64
+ pagination: Pagination;
65
+ permissions?: Permission;
66
+ format_conditions: FormatCondition[];
67
+ params?: FormStoreState;
68
+ }
69
+
70
+ /**
71
+ * Shared utility types for the SPRING framework.
72
+ * @module utility-types
73
+ */
74
+ /** Extracts the element type from an array or readonly array type. */
75
+ type ArrayItem<T> = T extends readonly (infer U)[] ? U : T;
76
+ /** Makes specific keys of T required while keeping the rest unchanged. */
77
+ type RequireKeys<T, K extends keyof T> = T & Required<Pick<T, K>>;
78
+ /** Deep-readonly version of T — recursively marks all nested properties as readonly. */
79
+ type DeepReadonly<T> = T extends Date | RegExp ? T : T extends (...args: unknown[]) => unknown ? T : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepReadonly<U>> : T extends object ? {
80
+ readonly [K in keyof T]: DeepReadonly<T[K]>;
81
+ } : T;
82
+ /** Excludes null and undefined from T. */
83
+ type Defined<T> = Exclude<T, null | undefined>;
84
+
85
+ export { type ApiRoute, type ArrayItem, type Brand, type DeepReadonly, type Defined, FormStoreState, type FormatCondition, type FormatOperator, FormatType, type Guid, type IdPublic, type ListResponse, type Pagination, Permission, type RequireKeys, type ResourceKey, toApiRoute, toGuid, toIdPublic, toResourceKey };
@@ -0,0 +1,72 @@
1
+ import {
2
+ getField,
3
+ getIdentifiableId,
4
+ getStoreValue,
5
+ getSubState,
6
+ isFormFieldRuntime,
7
+ storeBoundary,
8
+ toFormDataValue
9
+ } from "../chunk-QAVWXARR.js";
10
+
11
+ // src/types/branded.ts
12
+ function toGuid(value) {
13
+ return value;
14
+ }
15
+ function toIdPublic(value) {
16
+ return value;
17
+ }
18
+ function toResourceKey(value) {
19
+ return value;
20
+ }
21
+ function toApiRoute(value) {
22
+ return value;
23
+ }
24
+
25
+ // src/types/grid-types.ts
26
+ function isFilterNode(val) {
27
+ if (typeof val !== "object" || val === null || Array.isArray(val)) return false;
28
+ return "logic" in val && "filters" in val || "field" in val && "operator" in val;
29
+ }
30
+ function isCombinedSettingData(val) {
31
+ if (typeof val !== "object" || val === null || Array.isArray(val)) return false;
32
+ return "user_filter" in val || "layout" in val;
33
+ }
34
+ function isPermission(val) {
35
+ if (typeof val !== "object" || val === null || Array.isArray(val)) return false;
36
+ const obj = val;
37
+ return typeof obj.read === "boolean" && typeof obj.list === "boolean" && typeof obj.delete === "boolean" && typeof obj.insert === "boolean" && typeof obj.update === "boolean";
38
+ }
39
+ function isColumnLayout(val) {
40
+ if (typeof val !== "object" || val === null || Array.isArray(val)) return false;
41
+ const obj = val;
42
+ return typeof obj.key === "string" && typeof obj.order === "number" && typeof obj.show === "boolean";
43
+ }
44
+
45
+ // src/types/list-types.ts
46
+ var FormatType = {
47
+ Badge: 1,
48
+ Color: 2,
49
+ Background: 3,
50
+ RowBackground: 4,
51
+ Icon: 5,
52
+ Detail: 6
53
+ };
54
+ export {
55
+ FormatType,
56
+ getField,
57
+ getIdentifiableId,
58
+ getStoreValue,
59
+ getSubState,
60
+ isColumnLayout,
61
+ isCombinedSettingData,
62
+ isFilterNode,
63
+ isFormFieldRuntime,
64
+ isPermission,
65
+ storeBoundary,
66
+ toApiRoute,
67
+ toFormDataValue,
68
+ toGuid,
69
+ toIdPublic,
70
+ toResourceKey
71
+ };
72
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/branded.ts","../../src/types/grid-types.ts","../../src/types/list-types.ts"],"sourcesContent":["/**\n * Branded types for nominal type safety.\n * Prevents accidental interchange of structurally identical string types.\n * @module branded\n */\n\ndeclare const __brand: unique symbol;\n\n/** Brands a base type `T` with a nominal tag `B`. */\nexport type Brand<T, B extends string> = T & { readonly [__brand]: B };\n\n/** A GUID / UUID string. */\nexport type Guid = Brand<string, \"Guid\">;\n\n/** A public entity identifier. */\nexport type IdPublic = Brand<string, \"IdPublic\">;\n\n/** A resource/translation key. */\nexport type ResourceKey = Brand<string, \"ResourceKey\">;\n\n/** An API route path. */\nexport type ApiRoute = Brand<string, \"ApiRoute\">;\n\n/** Cast a plain string to a Guid (boundary cast). */\nexport function toGuid(value: string): Guid {\n return value as Guid;\n}\n\n/** Cast a plain string to an IdPublic (boundary cast). */\nexport function toIdPublic(value: string): IdPublic {\n return value as IdPublic;\n}\n\n/** Cast a plain string to a ResourceKey (boundary cast). */\nexport function toResourceKey(value: string): ResourceKey {\n return value as ResourceKey;\n}\n\n/** Cast a plain string to an ApiRoute (boundary cast). */\nexport function toApiRoute(value: string): ApiRoute {\n return value as ApiRoute;\n}\n","/**\n * Shared types used by both List and TreeList grids.\n * Single source of truth — re-exported from lists.ts and treelists.ts.\n * @module grid-types\n */\n\nexport interface Permission {\n delete: boolean;\n insert: boolean;\n list: boolean;\n read: boolean;\n update: boolean;\n /** Allows projects to add custom permission fields (e.g., { export: true, approve: false }) */\n [key: string]: boolean;\n}\n\nexport type LogicOperator = \"and\" | \"or\";\n\n/** Node structure for tree-based filter. */\nexport interface FilterNode {\n field?: string;\n operator?: string;\n value?: string | number | boolean | null;\n logic?: LogicOperator;\n filters?: FilterNode[];\n negate?: boolean;\n}\n\n/** Simple key-value system filter (normalized into FilterNode by the engine). */\nexport interface SystemFilterRecord {\n [key: string]: string | number | boolean | Date | null | undefined;\n}\n\nexport type ColumnType = \"string\" | \"number\" | \"date\" | \"datetime\" | \"time\" | \"boolean\" | \"object\" | \"color\";\n\n/** Column layout for saving into user settings. */\nexport interface ColumnLayout {\n key: string;\n order: number;\n width?: number;\n show: boolean;\n}\n\nexport interface DefaultFilter {\n domain_name: string;\n id_public: string;\n is_default: boolean;\n json_data: string;\n name: string;\n user_setting_type_code: \"user\" | \"fixed\" | \"layout\";\n version: number;\n}\n\nexport interface SavedLayout {\n domain_name: string;\n id_public: string;\n is_default: boolean;\n json_data: string;\n name: string;\n user_setting_type_code: \"layout\";\n version: number;\n}\n\n/** Combined structure for json_data in user-settings — filter + layout in one JSON. */\nexport interface CombinedSettingData {\n user_filter?: FilterNode | null;\n layout?: ColumnLayout[];\n}\n\n/** Type guard for FilterNode — checks for tree-filter or leaf-filter shape. */\nexport function isFilterNode(val: unknown): val is FilterNode {\n if (typeof val !== \"object\" || val === null || Array.isArray(val)) return false;\n return (\"logic\" in val && \"filters\" in val) || (\"field\" in val && \"operator\" in val);\n}\n\n/** Type guard for CombinedSettingData — checks for user_filter or layout property. */\nexport function isCombinedSettingData(val: unknown): val is CombinedSettingData {\n if (typeof val !== \"object\" || val === null || Array.isArray(val)) return false;\n return \"user_filter\" in val || \"layout\" in val;\n}\n\n/** Type guard for Permission — checks for all 5 required CRUD boolean keys. */\nexport function isPermission(val: unknown): val is Permission {\n if (typeof val !== \"object\" || val === null || Array.isArray(val)) return false;\n const obj = val as Record<string, unknown>;\n return (\n typeof obj.read === \"boolean\" &&\n typeof obj.list === \"boolean\" &&\n typeof obj.delete === \"boolean\" &&\n typeof obj.insert === \"boolean\" &&\n typeof obj.update === \"boolean\"\n );\n}\n\n/** Type guard for ColumnLayout — checks for required key, order, show properties. */\nexport function isColumnLayout(val: unknown): val is ColumnLayout {\n if (typeof val !== \"object\" || val === null || Array.isArray(val)) return false;\n const obj = val as Record<string, unknown>;\n return typeof obj.key === \"string\" && typeof obj.order === \"number\" && typeof obj.show === \"boolean\";\n}\n","/**\n * List types — pure type definitions extracted from shared/lists/lists.ts.\n * @module list-types\n */\n\nimport type { FormStoreState } from \"./form-types\";\nimport type { Permission } from \"./grid-types\";\n\n/** Comparison operators used in format conditions (conditional formatting). */\nexport type FormatOperator = \"==\" | \"===\" | \"!=\" | \"!==\" | \">\" | \">=\" | \"<\" | \"<=\";\n\nexport interface FormatCondition {\n value?: string | number | boolean | null;\n background?: string;\n color?: string;\n column?: string;\n field: string;\n operator?: FormatOperator;\n className?: string;\n}\n\nexport const FormatType = {\n Badge: 1,\n Color: 2,\n Background: 3,\n RowBackground: 4,\n Icon: 5,\n Detail: 6,\n} as const;\nexport type FormatType = (typeof FormatType)[keyof typeof FormatType];\n\nexport interface Pagination {\n page?: number;\n per_page?: number;\n object_count: number;\n}\n\nexport interface ListResponse<T> {\n data: T[];\n message: string | null;\n pagination: Pagination;\n permissions?: Permission;\n format_conditions: FormatCondition[];\n params?: FormStoreState;\n}\n"],"mappings":";;;;;;;;;;;AAwBO,SAAS,OAAO,OAAqB;AACxC,SAAO;AACX;AAGO,SAAS,WAAW,OAAyB;AAChD,SAAO;AACX;AAGO,SAAS,cAAc,OAA4B;AACtD,SAAO;AACX;AAGO,SAAS,WAAW,OAAyB;AAChD,SAAO;AACX;;;AC6BO,SAAS,aAAa,KAAiC;AAC1D,MAAI,OAAO,QAAQ,YAAY,QAAQ,QAAQ,MAAM,QAAQ,GAAG,EAAG,QAAO;AAC1E,SAAQ,WAAW,OAAO,aAAa,OAAS,WAAW,OAAO,cAAc;AACpF;AAGO,SAAS,sBAAsB,KAA0C;AAC5E,MAAI,OAAO,QAAQ,YAAY,QAAQ,QAAQ,MAAM,QAAQ,GAAG,EAAG,QAAO;AAC1E,SAAO,iBAAiB,OAAO,YAAY;AAC/C;AAGO,SAAS,aAAa,KAAiC;AAC1D,MAAI,OAAO,QAAQ,YAAY,QAAQ,QAAQ,MAAM,QAAQ,GAAG,EAAG,QAAO;AAC1E,QAAM,MAAM;AACZ,SACI,OAAO,IAAI,SAAS,aACpB,OAAO,IAAI,SAAS,aACpB,OAAO,IAAI,WAAW,aACtB,OAAO,IAAI,WAAW,aACtB,OAAO,IAAI,WAAW;AAE9B;AAGO,SAAS,eAAe,KAAmC;AAC9D,MAAI,OAAO,QAAQ,YAAY,QAAQ,QAAQ,MAAM,QAAQ,GAAG,EAAG,QAAO;AAC1E,QAAM,MAAM;AACZ,SAAO,OAAO,IAAI,QAAQ,YAAY,OAAO,IAAI,UAAU,YAAY,OAAO,IAAI,SAAS;AAC/F;;;AC9EO,IAAM,aAAa;AAAA,EACtB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,MAAM;AAAA,EACN,QAAQ;AACZ;","names":[]}
@@ -0,0 +1,143 @@
1
+ import { a as FormDataValue, b as FormStoreState, E as Indexable, g as FilterNode, f as FilterFieldValue, c as ColumnType } from '../form-types-D3MdGpjA.js';
2
+ import dayjs from 'dayjs';
3
+ export { S as SecurityLogData, a as SecurityLogScalar, b as SecurityLogValue, i as isSensitiveSecurityKey, s as sanitizeSecurityData } from '../security-sanitize-Bb0PExM6.js';
4
+
5
+ interface KeyActivateEvent {
6
+ key: string;
7
+ preventDefault(): void;
8
+ }
9
+ declare function onKeyActivate<E extends KeyActivateEvent = KeyActivateEvent>(handler?: ((e: E) => void) | (() => void) | null): ((e: E) => void) | undefined;
10
+ declare function prefersReducedMotion(): boolean;
11
+
12
+ declare function getBrightness(r: number, g: number, b: number): number;
13
+ declare function hexToRgb(hex: string): [number, number, number];
14
+ declare function rgbToHex(rgb: string): string;
15
+ declare function getContrastYIQ(hex: string): string;
16
+ declare function getHexColorFromClass(className: string): string;
17
+
18
+ declare function isValueNotEmpty(value: string | number | boolean | null | undefined | FormDataValue[]): boolean;
19
+ /** Returns a deep copy of an object, removing unwanted references. */
20
+ declare function deepCopy<T>(obj: T, hash?: WeakMap<WeakKey, unknown>): T;
21
+ /**
22
+ * Performs deep comparison of two objects.
23
+ * Treats `null` and `""` as equivalent — this is intentional because the backend
24
+ * API returns `null` for empty fields while form inputs produce `""`.
25
+ */
26
+ declare function deepEqual(a: FormDataValue | FormStoreState, b: FormDataValue | FormStoreState): boolean;
27
+ declare function deepMerge<T extends Indexable>(target: T, source: Partial<T>): T;
28
+ declare function getValueByPath(obj: FormStoreState, path: string): FormDataValue;
29
+ /** Normalizes a string for comparison without diacritics, in lowercase */
30
+ declare function normalizeString(str: string): string;
31
+ declare function generateGUID(): string;
32
+ declare function setDefaultStructure(data: {
33
+ field?: string;
34
+ type?: string;
35
+ }[]): Record<string, string | number | boolean | null | undefined>;
36
+ declare function parseJSONSafely(value: string | number | boolean | null | undefined | object): string | number | boolean | null | undefined | object;
37
+ type ValueType = "string" | "date" | "number" | "boolean" | "object";
38
+ declare function getValueType(value: string | number | boolean | null | undefined | object): ValueType;
39
+
40
+ /**
41
+ * Set the dayjs locale at runtime.
42
+ * The locale package must be imported before calling this (e.g., `import "dayjs/locale/en"`).
43
+ */
44
+ declare function setDateLocale(locale: string): void;
45
+ declare const dateManager: {
46
+ formatDateCustom(value: Date | null, format: string): string;
47
+ formatDate(value: Date | null): string;
48
+ formatDateTime(value: Date | null): string;
49
+ formatTime(value: Date | null): string;
50
+ formatDateRange(dateFrom: Date, dateTo: Date, format?: string): string;
51
+ formatDateTimeWithSeconds(value: Date | null): string;
52
+ /** Formats a value as date with time, or time only if it is today */
53
+ formatDateTimeShort(value: Date | null): string;
54
+ getAgeFromDate(value: Date): number;
55
+ formatMonthName(value: Date, format: string): string;
56
+ formatMonthNumber(value: Date): number;
57
+ getPreviousMonth(date: Date, numberOfMonth: number): Date;
58
+ setTimeFromString(date: Date, time: string, onlyMinutes?: boolean): Date;
59
+ formatDateString(value: string): Date | null;
60
+ getDuration(date: Date | null, date2: Date | null, type: dayjs.ManipulateType): number | null;
61
+ getStartOfDate(date: Date, unitOfTime: dayjs.OpUnitType): Date;
62
+ getEndOfDay(date: Date): Date;
63
+ getDateRange(date: Date, unitOfTime: dayjs.OpUnitType): {
64
+ dateFrom: Date;
65
+ dateTo: Date;
66
+ };
67
+ isDateInRange(startDate: Date, endDate: Date, dateToCheck: Date): boolean;
68
+ /** Adds a number of days (or other unit) to a date */
69
+ add(value: Date, count: number, type?: dayjs.ManipulateType): Date;
70
+ substractDaysFromDate(numberOfDays: number, date: Date): Date;
71
+ };
72
+
73
+ /**
74
+ * Runtime deprecation warnings for the SPRING framework.
75
+ * Warns once per session per deprecation to avoid console spam.
76
+ * @module deprecation
77
+ */
78
+ declare function springDeprecate(name: string, alternative: string, removeVersion?: string): void;
79
+ /** Clear all tracked deprecation warnings. Intended for testing. */
80
+ declare function clearDeprecationWarnings(): void;
81
+
82
+ /**
83
+ * Dev-mode validation helpers.
84
+ * In development: throws errors / logs warnings for invalid usage.
85
+ * In production: silent (no runtime cost beyond a single boolean check).
86
+ * @module dev-warnings
87
+ */
88
+ declare const __DEV__: boolean;
89
+ /**
90
+ * Log a warning in development mode only.
91
+ * No-op in production.
92
+ */
93
+ declare function devWarn(context: string, message: string): void;
94
+ /**
95
+ * Throw an error in development mode, log a warning in production.
96
+ * Use for invalid API usage that should be caught during development.
97
+ */
98
+ declare function devThrow(context: string, message: string): void;
99
+ /**
100
+ * Assert a condition in development mode.
101
+ * Throws if condition is false in dev, no-op in production.
102
+ */
103
+ declare function devAssert(condition: boolean, context: string, message: string): void;
104
+
105
+ declare function parseFilter(value: string | number | boolean | Date | null | undefined | FilterFieldValue[] | object): string | boolean;
106
+ /** Normalizes system filter — string/object to FilterNode. */
107
+ declare function normalizeSystemFilter(input: Record<string, string | number | boolean | Date | null | undefined> | FilterNode | null | undefined): FilterNode | null;
108
+ declare function getFilterFieldType(fieldKey: string, defaultListFilter: Record<string, {
109
+ type?: string;
110
+ }> | null | undefined, value: string | number | boolean | null | undefined | object): string;
111
+
112
+ interface FormatColumn<T> {
113
+ field: string & keyof T;
114
+ type: ColumnType;
115
+ decimals?: number;
116
+ textField?: string;
117
+ }
118
+ /** Strips all HTML tags from content */
119
+ declare function sanitizeContent(content: string): string;
120
+ /** Sanitizes HTML output from WYSIWYG editor — allows formatting tags, removes scripts */
121
+ declare function sanitizeEditorContent(content: string): string;
122
+ declare function truncateString(value: string, maxLength: number): string;
123
+ declare function toNumber(value: string | number, decimals?: number): string;
124
+ declare function setColumnBodyType<T extends FormStoreState>(item: T, obj: FormatColumn<T>): T[string & keyof T] | string | number | undefined;
125
+
126
+ /**
127
+ * Shared utilities for tree structures (Tree and TreeList).
128
+ * @module tree-utils
129
+ */
130
+ interface BaseTreeNode {
131
+ id_public: string;
132
+ childrenNodes?: BaseTreeNode[];
133
+ }
134
+ /** Safe access to node children — encapsulates dynamic property access + cast */
135
+ declare function getChildren<T>(node: T, field: string): T[] | undefined;
136
+ declare function findNode<T extends BaseTreeNode>(nodes: T[], id: string, childrenField?: string): T | null;
137
+ declare function getAllIds<T extends BaseTreeNode>(nodes: T[], childrenField?: string): string[];
138
+ declare function updateNode<T extends BaseTreeNode>(nodes: T[], id: string, updater: (node: T) => T, childrenField?: string): T[];
139
+ declare function removeNode<T extends BaseTreeNode>(nodes: T[], id: string, childrenField?: string): T[];
140
+ declare function addNode<T extends BaseTreeNode>(nodes: T[], parentId: string | null, newNode: T, childrenField?: string): T[];
141
+ declare function findParentId<T extends BaseTreeNode>(nodes: T[], id: string, childrenField?: string, parentId?: string | null): string | null;
142
+
143
+ export { type BaseTreeNode, type ValueType, __DEV__, addNode, clearDeprecationWarnings, dateManager, deepCopy, deepEqual, deepMerge, devAssert, devThrow, devWarn, findNode, findParentId, generateGUID, getAllIds, getBrightness, getChildren, getContrastYIQ, getFilterFieldType, getHexColorFromClass, getValueByPath, getValueType, hexToRgb, isValueNotEmpty, normalizeString, normalizeSystemFilter, onKeyActivate, parseFilter, parseJSONSafely, prefersReducedMotion, removeNode, rgbToHex, sanitizeContent, sanitizeEditorContent, setColumnBodyType, setDateLocale, setDefaultStructure, springDeprecate, toNumber, truncateString, updateNode };