@acorex/platform 19.3.0-next.2 → 19.3.0-next.3

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 (69) hide show
  1. package/auth/lib/application/application.types.d.ts +1 -1
  2. package/auth/lib/tenant/tenant.types.d.ts +1 -1
  3. package/common/index.d.ts +1 -0
  4. package/common/lib/app/application.types.d.ts +1 -1
  5. package/common/lib/app/index.d.ts +1 -0
  6. package/common/lib/configs/app.config.d.ts +1 -1
  7. package/common/lib/home-page/home-page-settings.key.d.ts +3 -0
  8. package/common/lib/home-page/home-page-settings.provider.d.ts +12 -0
  9. package/common/lib/home-page/home-page.module.d.ts +6 -0
  10. package/common/lib/home-page/home-page.routes.d.ts +2 -0
  11. package/common/lib/home-page/home-page.service.d.ts +24 -0
  12. package/common/lib/home-page/home-page.types.d.ts +9 -0
  13. package/common/lib/home-page/index.d.ts +4 -0
  14. package/common/lib/layout/logo/index.d.ts +0 -1
  15. package/common/lib/settings/setting.builder.d.ts +1 -1
  16. package/core/lib/data/data-generator.d.ts +2 -1
  17. package/core/lib/types/index.d.ts +4 -3
  18. package/core/lib/utils/object-util.d.ts +1 -0
  19. package/fesm2022/acorex-platform-auth.mjs +0 -1
  20. package/fesm2022/acorex-platform-auth.mjs.map +1 -1
  21. package/fesm2022/acorex-platform-common.mjs +1556 -1393
  22. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  23. package/fesm2022/acorex-platform-core.mjs +173 -113
  24. package/fesm2022/acorex-platform-core.mjs.map +1 -1
  25. package/fesm2022/acorex-platform-layout-builder.mjs +2 -0
  26. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  27. package/fesm2022/acorex-platform-layout-entity.mjs +25 -37
  28. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  29. package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-BqMlSX6b.mjs → acorex-platform-themes-default-entity-master-list-view.component-CuyWAi6X.mjs} +31 -20
  30. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-CuyWAi6X.mjs.map +1 -0
  31. package/fesm2022/acorex-platform-themes-default.mjs +95 -47
  32. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  33. package/fesm2022/{acorex-platform-themes-shared-setting.provider-CXiRmniv.mjs → acorex-platform-themes-shared-settings.provider-CXiRmniv.mjs} +1 -1
  34. package/fesm2022/acorex-platform-themes-shared-settings.provider-CXiRmniv.mjs.map +1 -0
  35. package/fesm2022/acorex-platform-themes-shared.mjs +2 -2
  36. package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
  37. package/fesm2022/acorex-platform-widgets.mjs +571 -41
  38. package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
  39. package/layout/builder/lib/builder/widget-map.d.ts +2 -0
  40. package/layout/builder/lib/builder/widget.types.d.ts +2 -2
  41. package/layout/entity/lib/widgets/lookup-widget/lookup-widget-edit.component.d.ts +2 -1
  42. package/package.json +1 -1
  43. package/themes/default/lib/layouts/base/base-page.component.d.ts +9 -4
  44. package/themes/default/lib/layouts/base/base-page.types.d.ts +3 -2
  45. package/themes/default/lib/layouts/base/page-layout/page-layout.component.d.ts +9 -2
  46. package/themes/default/lib/layouts/entity-layouts/entity-category/entity-category.component.d.ts +2 -1
  47. package/themes/default/lib/layouts/entity-layouts/entity-master-list-view/entity-master-list-view.component.d.ts +1 -0
  48. package/themes/default/lib/layouts/entity-layouts/entity-master-toolbar-view/entity-master-toolbar-view.component.d.ts +62 -0
  49. package/themes/default/lib/layouts/root-layout/components/header/header.component.d.ts +3 -3
  50. package/themes/default/lib/layouts/root-layout/horizontal/horizontal-layout.component.d.ts +3 -3
  51. package/themes/default/lib/layouts/root-layout/root-layout.component.d.ts +4 -1
  52. package/themes/default/lib/layouts/root-layout/vertical/vertical-layout.component.d.ts +3 -3
  53. package/themes/default/lib/layouts/view-layouts/layout-detail-view/layout-detail-view.component.d.ts +1 -1
  54. package/themes/shared/index.d.ts +1 -1
  55. package/widgets/lib/widgets/charts/notification/index.d.ts +3 -0
  56. package/widgets/lib/widgets/charts/notification/notification-widget.component.d.ts +54 -0
  57. package/widgets/lib/widgets/charts/notification/notification-widget.config.d.ts +10 -0
  58. package/widgets/lib/widgets/charts/notification/notification.type.d.ts +47 -0
  59. package/widgets/lib/widgets/charts/sticky-note/sticky-note-widget.component.d.ts +3 -3
  60. package/widgets/lib/widgets/charts/tasklist/index.d.ts +3 -0
  61. package/widgets/lib/widgets/charts/tasklist/tasklist-widget.component.d.ts +34 -0
  62. package/widgets/lib/widgets/charts/tasklist/tasklist-widget.config.d.ts +7 -0
  63. package/widgets/lib/widgets/charts/tasklist/tasklist.type.d.ts +36 -0
  64. package/widgets/lib/widgets/index.d.ts +3 -0
  65. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-BqMlSX6b.mjs.map +0 -1
  66. package/fesm2022/acorex-platform-themes-shared-setting.provider-CXiRmniv.mjs.map +0 -1
  67. /package/{common/lib/layout/logo → core/lib/types}/logo.types.d.ts +0 -0
  68. /package/themes/shared/lib/{setting.keys.d.ts → settings.keys.d.ts} +0 -0
  69. /package/themes/shared/lib/{setting.provider.d.ts → settings.provider.d.ts} +0 -0
@@ -1,7 +1,6 @@
1
- import isNil from 'lodash-es/isNil';
1
+ import { get, isPlainObject, set, isArray, merge, isNil, isObjectLike, isUndefined, isEmpty, endsWith, startsWith, includes, lte, gte, lt, gt, isEqual, orderBy } from 'lodash-es';
2
2
  import * as i0 from '@angular/core';
3
3
  import { input, effect, Directive, EventEmitter, HostListener, Output, Injectable, inject, signal, Pipe } from '@angular/core';
4
- import { set, get, isUndefined, isPlainObject, isArray, merge, isNil as isNil$1, isEmpty, endsWith, startsWith, includes, lte, gte, lt, gt, isEqual, orderBy } from 'lodash-es';
5
4
  import { Subject, interval } from 'rxjs';
6
5
  import { AXCalendarService } from '@acorex/core/date-time';
7
6
  import { startWith, map } from 'rxjs/operators';
@@ -74,9 +73,46 @@ class AXPDataGenerator {
74
73
  static item(array = []) {
75
74
  return array.length > 0 ? array[Math.floor(Math.random() * array.length)] : undefined;
76
75
  }
77
- static color() {
78
- const color = Math.floor(Math.random() * 16777215).toString(16);
79
- return `#${color.padStart(6, '0')}`;
76
+ static color(format = 'hex') {
77
+ // Generate HSL values with safe ranges for good contrast
78
+ const h = Math.floor(Math.random() * 360);
79
+ const s = Math.floor(Math.random() * 20) + 60; // 60% - 80%
80
+ const l = Math.floor(Math.random() * 20) + 40; // 40% - 60%
81
+ if (format === 'hsl') {
82
+ return `hsl(${h}, ${s}%, ${l}%)`;
83
+ }
84
+ // Convert HSL to RGB
85
+ const { r, g, b } = this.hslToRgb(h, s / 100, l / 100);
86
+ if (format === 'rgb') {
87
+ return `rgb(${r}, ${g}, ${b})`;
88
+ }
89
+ // Convert RGB to HEX
90
+ const toHex = (val) => val.toString(16).padStart(2, '0');
91
+ return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
92
+ }
93
+ //TODO: move or read from utils
94
+ static hslToRgb(h, s, l) {
95
+ const c = (1 - Math.abs(2 * l - 1)) * s;
96
+ const x = c * (1 - Math.abs((h / 60) % 2 - 1));
97
+ const m = l - c / 2;
98
+ let r = 0, g = 0, b = 0;
99
+ if (h < 60)
100
+ [r, g, b] = [c, x, 0];
101
+ else if (h < 120)
102
+ [r, g, b] = [x, c, 0];
103
+ else if (h < 180)
104
+ [r, g, b] = [0, c, x];
105
+ else if (h < 240)
106
+ [r, g, b] = [0, x, c];
107
+ else if (h < 300)
108
+ [r, g, b] = [x, 0, c];
109
+ else
110
+ [r, g, b] = [c, 0, x];
111
+ return {
112
+ r: Math.round((r + m) * 255),
113
+ g: Math.round((g + m) * 255),
114
+ b: Math.round((b + m) * 255)
115
+ };
80
116
  }
81
117
  static alphanumeric(length = 10) {
82
118
  const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
@@ -140,17 +176,118 @@ class AXPDataGenerator {
140
176
  }
141
177
  }
142
178
 
179
+ function extractNestedFieldsWildcard(obj, basePath, fields) {
180
+ const result = {};
181
+ if (fields.length === 1 && fields[0] === '*') {
182
+ const fullObj = get(obj, basePath);
183
+ return isPlainObject(fullObj) ? fullObj : {};
184
+ }
185
+ for (const field of fields) {
186
+ const fullPath = basePath ? `${basePath}.${field}` : field;
187
+ const value = get(obj, fullPath);
188
+ set(result, field, value);
189
+ }
190
+ return result;
191
+ }
192
+ function setSmart(obj, smartPath, value) {
193
+ const pathParts = smartPath.split('.');
194
+ const lastPart = pathParts[pathParts.length - 1];
195
+ const fieldMatch = lastPart.match(/^\{(.+)\}$/);
196
+ if (!fieldMatch) {
197
+ set(obj, smartPath, value);
198
+ return obj;
199
+ }
200
+ const fields = fieldMatch[1].split(',').map((f) => f.trim());
201
+ const basePath = pathParts.slice(0, -1).join('.');
202
+ const [arrayKey, ...restPath] = basePath.split('.');
203
+ // Make sure the array exists
204
+ if (!obj[arrayKey])
205
+ obj[arrayKey] = [];
206
+ // 🟡 Case A: value is array (normal set)
207
+ if (isArray(value)) {
208
+ for (let i = 0; i < value.length; i++) {
209
+ const item = value[i];
210
+ const targetItem = obj[arrayKey][i] ?? {};
211
+ const nested = {};
212
+ if (restPath.length > 0) {
213
+ const picked = extractNestedFieldsWildcard(item, restPath.join('.'), fields);
214
+ set(nested, restPath.join('.'), picked);
215
+ }
216
+ else {
217
+ const picked = extractNestedFieldsWildcard(item, '', fields);
218
+ Object.assign(nested, picked);
219
+ }
220
+ obj[arrayKey][i] = merge({}, targetItem, nested);
221
+ }
222
+ }
223
+ // 🟢 Case B: value is a single value → broadcast
224
+ else {
225
+ for (let i = 0; i < obj[arrayKey].length; i++) {
226
+ const targetItem = obj[arrayKey][i] ?? {};
227
+ const nested = {};
228
+ if (restPath.length > 0) {
229
+ for (const field of fields) {
230
+ set(nested, `${restPath.join('.')}.${field}`, value);
231
+ }
232
+ }
233
+ else {
234
+ for (const field of fields) {
235
+ set(nested, field, value);
236
+ }
237
+ }
238
+ obj[arrayKey][i] = merge({}, targetItem, nested);
239
+ }
240
+ }
241
+ return obj;
242
+ }
243
+ function extractFieldsFromPath(obj, basePath, fields) {
244
+ if (fields.length === 1 && fields[0] === '*') {
245
+ const fullObj = basePath ? get(obj, basePath) : obj;
246
+ return isPlainObject(fullObj) ? fullObj : {};
247
+ }
248
+ const result = {};
249
+ for (const field of fields) {
250
+ const fullPath = basePath ? `${basePath}.${field}` : field;
251
+ const val = get(obj, fullPath);
252
+ if (val !== undefined) {
253
+ result[field] = val;
254
+ }
255
+ }
256
+ return result;
257
+ }
258
+ function getSmart(obj, smartPath) {
259
+ const pathParts = smartPath.split('.');
260
+ const lastPart = pathParts[pathParts.length - 1];
261
+ const fieldMatch = lastPart.match(/^\{(.+)\}$/);
262
+ // Simple get (no fields)
263
+ if (!fieldMatch) {
264
+ return get(obj, smartPath);
265
+ }
266
+ const fields = fieldMatch[1].split(',').map((f) => f.trim());
267
+ const basePath = pathParts.slice(0, -1).join('.');
268
+ const items = get(obj, basePath);
269
+ if (!isArray(items))
270
+ return [];
271
+ const nestedPath = basePath.includes('.') ? basePath.split('.').slice(1).join('.') : '';
272
+ return items.map((item) => {
273
+ return extractFieldsFromPath(item, nestedPath, fields);
274
+ });
275
+ }
276
+ function extractValue(value, key = 'id') {
277
+ if (isNil(value)) {
278
+ return null;
279
+ }
280
+ ;
281
+ return isObjectLike(value) ? get(value, key) : value;
282
+ }
283
+
143
284
  function objectKeyValueTransforms(keyName) {
144
285
  return {
145
286
  getter: (value) => {
146
- if (isNil(value))
147
- return undefined;
148
- return typeof value == 'object' ? value[keyName] : value;
287
+ return extractValue(value, keyName);
149
288
  },
150
289
  setter: (value) => {
151
- if (isNil(value))
152
- return undefined;
153
- return typeof value == 'object' ? value[keyName] : value;
290
+ return extractValue(value, keyName);
154
291
  },
155
292
  };
156
293
  }
@@ -501,104 +638,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
501
638
  }]
502
639
  }] });
503
640
 
504
- function extractNestedFieldsWildcard(obj, basePath, fields) {
505
- const result = {};
506
- if (fields.length === 1 && fields[0] === '*') {
507
- const fullObj = get(obj, basePath);
508
- return isPlainObject(fullObj) ? fullObj : {};
509
- }
510
- for (const field of fields) {
511
- const fullPath = basePath ? `${basePath}.${field}` : field;
512
- const value = get(obj, fullPath);
513
- set(result, field, value);
514
- }
515
- return result;
516
- }
517
- function setSmart(obj, smartPath, value) {
518
- const pathParts = smartPath.split('.');
519
- const lastPart = pathParts[pathParts.length - 1];
520
- const fieldMatch = lastPart.match(/^\{(.+)\}$/);
521
- if (!fieldMatch) {
522
- set(obj, smartPath, value);
523
- return obj;
524
- }
525
- const fields = fieldMatch[1].split(',').map((f) => f.trim());
526
- const basePath = pathParts.slice(0, -1).join('.');
527
- const [arrayKey, ...restPath] = basePath.split('.');
528
- // Make sure the array exists
529
- if (!obj[arrayKey])
530
- obj[arrayKey] = [];
531
- // 🟡 Case A: value is array (normal set)
532
- if (isArray(value)) {
533
- for (let i = 0; i < value.length; i++) {
534
- const item = value[i];
535
- const targetItem = obj[arrayKey][i] ?? {};
536
- const nested = {};
537
- if (restPath.length > 0) {
538
- const picked = extractNestedFieldsWildcard(item, restPath.join('.'), fields);
539
- set(nested, restPath.join('.'), picked);
540
- }
541
- else {
542
- const picked = extractNestedFieldsWildcard(item, '', fields);
543
- Object.assign(nested, picked);
544
- }
545
- obj[arrayKey][i] = merge({}, targetItem, nested);
546
- }
547
- }
548
- // 🟢 Case B: value is a single value → broadcast
549
- else {
550
- for (let i = 0; i < obj[arrayKey].length; i++) {
551
- const targetItem = obj[arrayKey][i] ?? {};
552
- const nested = {};
553
- if (restPath.length > 0) {
554
- for (const field of fields) {
555
- set(nested, `${restPath.join('.')}.${field}`, value);
556
- }
557
- }
558
- else {
559
- for (const field of fields) {
560
- set(nested, field, value);
561
- }
562
- }
563
- obj[arrayKey][i] = merge({}, targetItem, nested);
564
- }
565
- }
566
- return obj;
567
- }
568
- function extractFieldsFromPath(obj, basePath, fields) {
569
- if (fields.length === 1 && fields[0] === '*') {
570
- const fullObj = basePath ? get(obj, basePath) : obj;
571
- return isPlainObject(fullObj) ? fullObj : {};
572
- }
573
- const result = {};
574
- for (const field of fields) {
575
- const fullPath = basePath ? `${basePath}.${field}` : field;
576
- const val = get(obj, fullPath);
577
- if (val !== undefined) {
578
- result[field] = val;
579
- }
580
- }
581
- return result;
582
- }
583
- function getSmart(obj, smartPath) {
584
- const pathParts = smartPath.split('.');
585
- const lastPart = pathParts[pathParts.length - 1];
586
- const fieldMatch = lastPart.match(/^\{(.+)\}$/);
587
- // Simple get (no fields)
588
- if (!fieldMatch) {
589
- return get(obj, smartPath);
590
- }
591
- const fields = fieldMatch[1].split(',').map((f) => f.trim());
592
- const basePath = pathParts.slice(0, -1).join('.');
593
- const items = get(obj, basePath);
594
- if (!isArray(items))
595
- return [];
596
- const nestedPath = basePath.includes('.') ? basePath.split('.').slice(1).join('.') : '';
597
- return items.map((item) => {
598
- return extractFieldsFromPath(item, nestedPath, fields);
599
- });
600
- }
601
-
602
641
  const loggingEnabled = false; // Set to true to enable logging, false to disable
603
642
  function applyCondition(item, condition) {
604
643
  const rawValue = condition.field ? get(item, condition.field) : null;
@@ -611,7 +650,7 @@ function applyCondition(item, condition) {
611
650
  console.log('Condition Value:', conditionValue);
612
651
  }
613
652
  let result;
614
- const valueToCompare = isNil$1(condition.field) || condition.field === '' ? conditionValue : itemValue;
653
+ const valueToCompare = isNil(condition.field) || condition.field === '' ? conditionValue : itemValue;
615
654
  const conditionType = condition?.operator?.type;
616
655
  if (!conditionType) {
617
656
  return true;
@@ -700,7 +739,7 @@ function applyCondition(item, condition) {
700
739
  }
701
740
  break;
702
741
  case 'isNull':
703
- result = isNil$1(valueToCompare);
742
+ result = isNil(valueToCompare);
704
743
  if (loggingEnabled) {
705
744
  console.log('Is null check result:', result);
706
745
  }
@@ -712,7 +751,7 @@ function applyCondition(item, condition) {
712
751
  }
713
752
  break;
714
753
  case 'between':
715
- result = !isNil$1(valueToCompare) && valueToCompare >= condition.value.from && valueToCompare <= condition.value.to;
754
+ result = !isNil(valueToCompare) && valueToCompare >= condition.value.from && valueToCompare <= condition.value.to;
716
755
  if (loggingEnabled) {
717
756
  console.log('Between check result:', result);
718
757
  }
@@ -921,6 +960,27 @@ function getNestedKeys(obj, prefix = '') {
921
960
  return keys;
922
961
  }
923
962
 
963
+ class AXPTextLogoConfig {
964
+ constructor(text) {
965
+ this.text = text;
966
+ }
967
+ }
968
+ class AXPImageUrlLogoConfig {
969
+ constructor(url) {
970
+ this.url = url;
971
+ }
972
+ }
973
+ class AXPFontIconLogoConfig {
974
+ constructor(iconClass) {
975
+ this.iconClass = iconClass;
976
+ }
977
+ }
978
+ class AXPComponentLogoConfig {
979
+ constructor(component) {
980
+ this.component = component;
981
+ }
982
+ }
983
+
924
984
  var AXPPlatformScope;
925
985
  (function (AXPPlatformScope) {
926
986
  AXPPlatformScope["Environment"] = "C";
@@ -955,5 +1015,5 @@ function resolvePlatformScopeName(scope) {
955
1015
  * Generated bundle index. Do not edit.
956
1016
  */
957
1017
 
958
- export { AXHighlightService, AXPBroadcastEventService, AXPCountdownPipe, AXPDataGenerator, AXPDblClickDirective, AXPElementDataDirective, AXPExpressionEvaluatorService, AXPGridLayoutDirective, AXPHtmlUtils, AXPPlatformScope, applyFilterArray, applyPagination, applyQueryArray, applySortArray, extractNestedFieldsWildcard, getNestedKeys, getSmart, objectKeyValueTransforms, resolvePlatformScopeKey, resolvePlatformScopeName, setSmart };
1018
+ export { AXHighlightService, AXPBroadcastEventService, AXPComponentLogoConfig, AXPCountdownPipe, AXPDataGenerator, AXPDblClickDirective, AXPElementDataDirective, AXPExpressionEvaluatorService, AXPFontIconLogoConfig, AXPGridLayoutDirective, AXPHtmlUtils, AXPImageUrlLogoConfig, AXPPlatformScope, AXPTextLogoConfig, applyFilterArray, applyPagination, applyQueryArray, applySortArray, extractNestedFieldsWildcard, extractValue, getNestedKeys, getSmart, objectKeyValueTransforms, resolvePlatformScopeKey, resolvePlatformScopeName, setSmart };
959
1019
  //# sourceMappingURL=acorex-platform-core.mjs.map