@acorex/platform 19.2.7 → 19.2.9

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 (97) hide show
  1. package/common/lib/app/application.types.d.ts +8 -0
  2. package/common/lib/utils/index.d.ts +2 -0
  3. package/common/lib/utils/regional-util.service.d.ts +15 -0
  4. package/common/lib/utils/regional.types.d.ts +55 -0
  5. package/fesm2022/acorex-platform-common.mjs +4 -2
  6. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  7. package/fesm2022/acorex-platform-core.mjs +35 -16
  8. package/fesm2022/acorex-platform-core.mjs.map +1 -1
  9. package/fesm2022/acorex-platform-layout-builder.mjs +83 -23
  10. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  11. package/fesm2022/acorex-platform-layout-designer.mjs +27 -26
  12. package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
  13. package/fesm2022/acorex-platform-layout-entity.mjs +123 -63
  14. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  15. package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-Bl9f4Rtk.mjs → acorex-platform-themes-default-entity-master-create-view.component-BK8BItxL.mjs} +2 -2
  16. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-BK8BItxL.mjs.map +1 -0
  17. package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-B4aBmc5H.mjs → acorex-platform-themes-default-entity-master-single-view.component-BGUrwL2P.mjs} +3 -3
  18. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-BGUrwL2P.mjs.map +1 -0
  19. package/fesm2022/acorex-platform-themes-default-setting-page.component-CN2NCgUv.mjs +74 -0
  20. package/fesm2022/acorex-platform-themes-default-setting-page.component-CN2NCgUv.mjs.map +1 -0
  21. package/fesm2022/acorex-platform-themes-default-setting-view.component-CsCug3Vu.mjs +71 -0
  22. package/fesm2022/acorex-platform-themes-default-setting-view.component-CsCug3Vu.mjs.map +1 -0
  23. package/fesm2022/acorex-platform-themes-default.mjs +24 -14
  24. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  25. package/fesm2022/acorex-platform-themes-shared.mjs +10 -1
  26. package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
  27. package/fesm2022/acorex-platform-widgets-tabular-data-edit-popup.component-BiCinIok.mjs +274 -0
  28. package/fesm2022/acorex-platform-widgets-tabular-data-edit-popup.component-BiCinIok.mjs.map +1 -0
  29. package/fesm2022/{acorex-platform-widgets-tabular-data-view-popup.component-BBRVgZLu.mjs → acorex-platform-widgets-tabular-data-view-popup.component-BaslkAPS.mjs} +16 -1
  30. package/fesm2022/acorex-platform-widgets-tabular-data-view-popup.component-BaslkAPS.mjs.map +1 -0
  31. package/fesm2022/acorex-platform-widgets.mjs +512 -342
  32. package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
  33. package/layout/builder/lib/builder/datasource-provider.service.d.ts +3 -1
  34. package/layout/builder/lib/builder/widget-renderer.directive.d.ts +3 -0
  35. package/layout/builder/lib/builder/widget.types.d.ts +2 -0
  36. package/layout/designer/lib/property-viewer/widget-property-viewer.component.d.ts +2 -0
  37. package/layout/entity/lib/entity-detail-list.viewmodel.d.ts +3 -0
  38. package/layout/entity/lib/entity-master-create.viewmodel.d.ts +3 -1
  39. package/layout/entity/lib/entity-master-single.viewmodel.d.ts +1 -1
  40. package/layout/entity/lib/entity.viewmodel.d.ts +1 -0
  41. package/layout/entity/lib/widgets/lookup-widget/lookup-widget-edit.component.d.ts +0 -2
  42. package/layout/entity/lib/widgets/widget-selector/widget-selector-widget-edit.component.d.ts +0 -2
  43. package/layout/setting/lib/setting.viewmodel.d.ts +3 -0
  44. package/package.json +5 -5
  45. package/themes/default/lib/layouts/base/simple-page/simple-page.layout.d.ts +3 -0
  46. package/themes/default/lib/layouts/entity-layouts/entity-detail-list-view/entity-detail-list-view.component.d.ts +3 -0
  47. package/themes/default/lib/layouts/entity-layouts/entity-master-list-view/entity-master-list-view.component.d.ts +3 -0
  48. package/themes/default/lib/layouts/entity-layouts/entity-master-single-view/entity-master-single-view.component.d.ts +3 -0
  49. package/themes/default/lib/layouts/root-layout/components/header/header.component.d.ts +3 -0
  50. package/themes/default/lib/layouts/root-layout/root-layout.component.d.ts +6 -0
  51. package/themes/default/lib/layouts/root-layout/root-layout.module.d.ts +2 -1
  52. package/themes/default/lib/layouts/setting-layout/setting-view/setting-view.component.d.ts +3 -0
  53. package/themes/default/lib/pages/theme-palette-preview/theme-palette-preview.page.d.ts +3 -0
  54. package/themes/shared/lib/components/slots/theme-slot.component.d.ts +3 -0
  55. package/themes/shared/lib/setting.keys.d.ts +2 -1
  56. package/themes/shared/lib/theme.service.d.ts +3 -0
  57. package/widgets/lib/properties/data-source.props.d.ts +3 -0
  58. package/widgets/lib/properties/editors.props.d.ts +0 -1
  59. package/widgets/lib/properties/index.d.ts +1 -0
  60. package/widgets/lib/widgets/charts/bar-chart/bar-chart-widget-edit.component.d.ts +18 -3
  61. package/widgets/lib/widgets/charts/bar-chart/bar-chart.type.d.ts +20 -6
  62. package/widgets/lib/widgets/editors/checkbox/checkbox-widget-edit.component.d.ts +0 -2
  63. package/widgets/lib/widgets/editors/color/color-box-widget-edit.component.d.ts +0 -2
  64. package/widgets/lib/widgets/editors/contact/contact-widget-edit.component.d.ts +0 -4
  65. package/widgets/lib/widgets/editors/date-time/date-time-box-widget-edit.component.d.ts +0 -4
  66. package/widgets/lib/widgets/editors/email/email-box-widget-edit.component.d.ts +0 -4
  67. package/widgets/lib/widgets/editors/large-text/large-text-widget-edit.component.d.ts +0 -2
  68. package/widgets/lib/widgets/editors/link/link-widget-edit.component.d.ts +0 -4
  69. package/widgets/lib/widgets/editors/number/number-box-widget-edit.component.d.ts +0 -2
  70. package/widgets/lib/widgets/editors/phone/phone-box-widget-edit.component.d.ts +0 -4
  71. package/widgets/lib/widgets/editors/rich-text/rich-text-widget-edit.component.d.ts +4 -3
  72. package/widgets/lib/widgets/editors/select/select-box-widget-edit.component.d.ts +0 -2
  73. package/widgets/lib/widgets/editors/selection-list/selection-list-widget-edit.component.d.ts +0 -2
  74. package/widgets/lib/widgets/editors/tabular-data/tabular-data-edit-popup.component.d.ts +11 -3
  75. package/widgets/lib/widgets/editors/tabular-data/tabular-data-view-popup.component.d.ts +3 -1
  76. package/widgets/lib/widgets/editors/tabular-data/tabular-data-widget-edit.component.d.ts +1 -1
  77. package/widgets/lib/widgets/editors/tabular-data/tabular-data-widget-view.component.d.ts +0 -2
  78. package/widgets/lib/widgets/editors/text/text-box-widget-edit.component.d.ts +0 -2
  79. package/widgets/lib/widgets/validations/base-validation/base-validation.d.ts +3 -2
  80. package/widgets/lib/widgets/validations/between-validation/between-validation-widget-edit.component.d.ts +1 -7
  81. package/widgets/lib/widgets/validations/callback-validation/callback-validation-widget-edit.component.d.ts +1 -7
  82. package/widgets/lib/widgets/validations/equal-validation/equal-validation-widget-edit.component.d.ts +1 -7
  83. package/widgets/lib/widgets/validations/greater-than-validation/greater-than-validation-widget-edit.component.d.ts +1 -7
  84. package/widgets/lib/widgets/validations/less-than-validation/less-than-validation-widget-edit.component.d.ts +1 -7
  85. package/widgets/lib/widgets/validations/max-length-validation/max-length-validation-widget-edit.component.d.ts +1 -7
  86. package/widgets/lib/widgets/validations/min-length-validation/min-length-validation-widget-edit.component.d.ts +1 -7
  87. package/widgets/lib/widgets/validations/regular-expression-validation/regular-expression-validation-widget-edit.component.d.ts +1 -7
  88. package/widgets/lib/widgets/validations/required-validation/required-validation-widget-edit.component.d.ts +1 -7
  89. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Bl9f4Rtk.mjs.map +0 -1
  90. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-B4aBmc5H.mjs.map +0 -1
  91. package/fesm2022/acorex-platform-themes-default-setting-page.component-BERYnJnp.mjs +0 -74
  92. package/fesm2022/acorex-platform-themes-default-setting-page.component-BERYnJnp.mjs.map +0 -1
  93. package/fesm2022/acorex-platform-themes-default-setting-view.component-BagAWM4W.mjs +0 -71
  94. package/fesm2022/acorex-platform-themes-default-setting-view.component-BagAWM4W.mjs.map +0 -1
  95. package/fesm2022/acorex-platform-widgets-tabular-data-edit-popup.component-D2-nHqYy.mjs +0 -144
  96. package/fesm2022/acorex-platform-widgets-tabular-data-edit-popup.component-D2-nHqYy.mjs.map +0 -1
  97. package/fesm2022/acorex-platform-widgets-tabular-data-view-popup.component-BBRVgZLu.mjs.map +0 -1
@@ -76,36 +76,46 @@ function applyCondition(item, condition) {
76
76
  }
77
77
  let result;
78
78
  const valueToCompare = isNil(condition.field) || condition.field === '' ? conditionValue : itemValue;
79
- switch (condition.operator.type) {
79
+ const conditionType = condition?.operator?.type;
80
+ if (!conditionType) {
81
+ return true;
82
+ }
83
+ switch (conditionType) {
80
84
  case 'equal':
81
85
  result = isEqual(valueToCompare, conditionValue);
82
- if (loggingEnabled)
86
+ if (loggingEnabled) {
83
87
  console.log('Equal check result:', result);
88
+ }
84
89
  break;
85
90
  case 'notEqual':
86
91
  result = !isEqual(valueToCompare, conditionValue);
87
- if (loggingEnabled)
92
+ if (loggingEnabled) {
88
93
  console.log('Not equal check result:', result);
94
+ }
89
95
  break;
90
96
  case 'greaterThan':
91
97
  result = gt(valueToCompare, conditionValue);
92
- if (loggingEnabled)
98
+ if (loggingEnabled) {
93
99
  console.log('Greater than check result:', result);
100
+ }
94
101
  break;
95
102
  case 'lessThan':
96
103
  result = lt(valueToCompare, conditionValue);
97
- if (loggingEnabled)
104
+ if (loggingEnabled) {
98
105
  console.log('Less than check result:', result);
106
+ }
99
107
  break;
100
108
  case 'greaterThanOrEqual':
101
109
  result = gte(valueToCompare, conditionValue);
102
- if (loggingEnabled)
110
+ if (loggingEnabled) {
103
111
  console.log('Greater than or equal check result:', result);
112
+ }
104
113
  break;
105
114
  case 'lessThanOrEqual':
106
115
  result = lte(valueToCompare, conditionValue);
107
- if (loggingEnabled)
116
+ if (loggingEnabled) {
108
117
  console.log('Less than or equal check result:', result);
118
+ }
109
119
  break;
110
120
  case 'contains':
111
121
  if (typeof valueToCompare === 'string') {
@@ -117,8 +127,9 @@ function applyCondition(item, condition) {
117
127
  else {
118
128
  result = false;
119
129
  }
120
- if (loggingEnabled)
130
+ if (loggingEnabled) {
121
131
  console.log('Contains check result:', result);
132
+ }
122
133
  break;
123
134
  case 'notContains':
124
135
  if (typeof valueToCompare === 'string') {
@@ -130,43 +141,51 @@ function applyCondition(item, condition) {
130
141
  else {
131
142
  result = false;
132
143
  }
133
- if (loggingEnabled)
144
+ if (loggingEnabled) {
134
145
  console.log('Not contains check result:', result);
146
+ }
135
147
  break;
136
148
  case 'startsWith':
137
149
  result = typeof valueToCompare === 'string' && startsWith(valueToCompare, conditionValue);
138
- if (loggingEnabled)
150
+ if (loggingEnabled) {
139
151
  console.log('Starts with check result:', result);
152
+ }
140
153
  break;
141
154
  case 'endsWith':
142
155
  result = typeof valueToCompare === 'string' && endsWith(valueToCompare, conditionValue);
143
- if (loggingEnabled)
156
+ if (loggingEnabled) {
144
157
  console.log('Ends with check result:', result);
158
+ }
145
159
  break;
146
160
  case 'isEmpty':
147
161
  result = isEmpty(valueToCompare);
148
- if (loggingEnabled)
162
+ if (loggingEnabled) {
149
163
  console.log('Is empty check result:', result);
164
+ }
150
165
  break;
151
166
  case 'isNull':
152
167
  result = isNil(valueToCompare);
153
- if (loggingEnabled)
168
+ if (loggingEnabled) {
154
169
  console.log('Is null check result:', result);
170
+ }
155
171
  break;
156
172
  case 'isNotEmpty':
157
173
  result = !isEmpty(valueToCompare);
158
- if (loggingEnabled)
174
+ if (loggingEnabled) {
159
175
  console.log('Is not empty check result:', result);
176
+ }
160
177
  break;
161
178
  case 'between':
162
179
  result = !isNil(valueToCompare) && valueToCompare >= condition.value.from && valueToCompare <= condition.value.to;
163
- if (loggingEnabled)
180
+ if (loggingEnabled) {
164
181
  console.log('Between check result:', result);
182
+ }
165
183
  break;
166
184
  default:
167
185
  result = true;
168
- if (loggingEnabled)
186
+ if (loggingEnabled) {
169
187
  console.log('Default case, returning true');
188
+ }
170
189
  }
171
190
  return result;
172
191
  }
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-core.mjs","sources":["../../../../libs/platform/core/src/lib/types.ts","../../../../libs/platform/core/src/utils/countdown-timer.ts","../../../../libs/platform/core/src/utils/data-conditioner.ts","../../../../libs/platform/core/src/utils/html-utils.ts","../../../../libs/platform/core/src/utils/highlighter.ts","../../../../libs/platform/core/src/acorex-platform-core.ts"],"sourcesContent":["import { Type } from '@angular/core';\nimport { NavigationExtras } from '@angular/router';\n\nexport type AXPPartialNested<T> = {\n [K in keyof T]?: T[K] extends object ? AXPPartialNested<T[K]> : T[K];\n};\n\nexport type AXPMetaData = Record<string, any>;\n\nexport type AXPOptionsData = Record<string, any>;\n\nexport type AXPValidationRule = {\n rule: string;\n message?: string;\n options?: any;\n disabled?: boolean;\n};\n\nexport type AXPValidationRules = AXPValidationRule[];\n\nexport function getNestedKeys(obj: any, prefix: string = ''): string[] {\n let keys: string[] = [];\n for (const key in obj) {\n if (typeof obj[key] === 'object' && obj[key] !== null && !Array.isArray(obj[key])) {\n keys = [...keys, ...getNestedKeys(obj[key], prefix + key + '.')];\n } else {\n keys.push(prefix + key);\n }\n }\n return keys;\n}\n\nexport type AXPNavigateActionOptions = {\n router: {\n path: string;\n extras?: NavigationExtras & { target?: string };\n };\n modal: {\n component: Type<any>;\n title: string;\n options?: any;\n };\n};\n\nexport interface AXPNavigateActionCommand<T extends keyof AXPNavigateActionOptions> {\n type: T;\n options: AXPNavigateActionOptions[T];\n}\n","import { AXCalendarService } from '@acorex/core/date-time';\nimport { inject, Pipe, PipeTransform, signal } from '@angular/core';\nimport { interval, Observable } from 'rxjs';\nimport { map, startWith } from 'rxjs/operators';\n\n@Pipe({\n name: 'countdown',\n pure: false,\n standalone: true,\n})\nexport class AXPCountdownPipe implements PipeTransform {\n private calendarService = inject(AXCalendarService);\n\n private countdownSignal = signal(this.setupTimer());\n\n private targetDate: number = 0;\n private prevValue = 0;\n\n transform(value: number): Observable<string> {\n if (this.prevValue != value) {\n this.prevValue = value;\n const expireTime = this.calendarService.calendar.add(new Date(), 'second', value).date;\n this.updateTargetDate(expireTime.toISOString());\n }\n return this.countdownSignal();\n }\n\n private setupTimer() {\n return interval(1000).pipe(\n startWith(0),\n map(() => {\n const diff = this.targetDate - new Date().getTime();\n if (diff < 0) {\n return \"Time's up!\";\n }\n\n const times = [86400, 3600, 60, 1].map((seconds) => Math.floor((diff / 1000 / seconds) % (seconds === 1 ? 60 : 24)));\n const labels = ['d', 'h', 'm', 's'];\n return times\n .map((t, i) => (t > 0 || i === 3 ? `${t}${labels[i]}` : ''))\n .join(' ')\n .trim();\n })\n );\n }\n\n private updateTargetDate(value: string) {\n this.targetDate = new Date(value).getTime();\n }\n}\n","import { AXDataSourceFilterOption, AXDataSourceSortOption } from '@acorex/components/common';\nimport { endsWith, get, gt, gte, includes, isEmpty, isEqual, isNil, lt, lte, orderBy, startsWith } from 'lodash-es';\n\nconst loggingEnabled = false; // Set to true to enable logging, false to disable\n\nfunction applyCondition(item: any, condition: any) {\n const rawValue = condition.field ? get(item, condition.field) : null;\n const itemValue = typeof rawValue === 'string' ? rawValue.toLowerCase() : rawValue;\n const conditionValue = typeof condition.value === 'string' ? condition.value.toLowerCase() : condition.value;\n\n // Conditional Logging for debugging\n if (loggingEnabled) {\n console.log('Condition:', condition);\n console.log('Item Value:', itemValue);\n console.log('Condition Value:', conditionValue);\n }\n\n let result: boolean;\n const valueToCompare = isNil(condition.field) || condition.field === '' ? conditionValue : itemValue;\n\n switch (condition.operator.type) {\n case 'equal':\n result = isEqual(valueToCompare, conditionValue);\n if (loggingEnabled) console.log('Equal check result:', result);\n break;\n case 'notEqual':\n result = !isEqual(valueToCompare, conditionValue);\n if (loggingEnabled) console.log('Not equal check result:', result);\n break;\n case 'greaterThan':\n result = gt(valueToCompare, conditionValue);\n if (loggingEnabled) console.log('Greater than check result:', result);\n break;\n case 'lessThan':\n result = lt(valueToCompare, conditionValue);\n if (loggingEnabled) console.log('Less than check result:', result);\n break;\n case 'greaterThanOrEqual':\n result = gte(valueToCompare, conditionValue);\n if (loggingEnabled) console.log('Greater than or equal check result:', result);\n break;\n case 'lessThanOrEqual':\n result = lte(valueToCompare, conditionValue);\n if (loggingEnabled) console.log('Less than or equal check result:', result);\n break;\n case 'contains':\n if (typeof valueToCompare === 'string') {\n result = includes(valueToCompare, conditionValue);\n } else if (Array.isArray(valueToCompare)) {\n result = includes(\n valueToCompare.map((val) => val.toString().toLowerCase()),\n conditionValue\n );\n } else {\n result = false;\n }\n if (loggingEnabled) console.log('Contains check result:', result);\n break;\n case 'notContains':\n if (typeof valueToCompare === 'string') {\n result = !includes(valueToCompare, conditionValue);\n } else if (Array.isArray(valueToCompare)) {\n result = !includes(\n valueToCompare.map((val) => val.toString().toLowerCase()),\n conditionValue\n );\n } else {\n result = false;\n }\n if (loggingEnabled) console.log('Not contains check result:', result);\n break;\n case 'startsWith':\n result = typeof valueToCompare === 'string' && startsWith(valueToCompare, conditionValue);\n if (loggingEnabled) console.log('Starts with check result:', result);\n break;\n case 'endsWith':\n result = typeof valueToCompare === 'string' && endsWith(valueToCompare, conditionValue);\n if (loggingEnabled) console.log('Ends with check result:', result);\n break;\n case 'isEmpty':\n result = isEmpty(valueToCompare);\n if (loggingEnabled) console.log('Is empty check result:', result);\n break;\n case 'isNull':\n result = isNil(valueToCompare);\n if (loggingEnabled) console.log('Is null check result:', result);\n break;\n case 'isNotEmpty':\n result = !isEmpty(valueToCompare);\n if (loggingEnabled) console.log('Is not empty check result:', result);\n break;\n case 'between':\n result = !isNil(valueToCompare) && valueToCompare >= condition.value.from && valueToCompare <= condition.value.to;\n if (loggingEnabled) console.log('Between check result:', result);\n break;\n default:\n result = true;\n if (loggingEnabled) console.log('Default case, returning true');\n }\n\n return result;\n}\n\nexport function applyFilterArray(\n dataArray: any[],\n filters?: AXDataSourceFilterOption[],\n logic: 'and' | 'or' = 'and'\n): any[] {\n if (filters && filters.length) {\n return dataArray.filter((item) => {\n if (logic === 'and') {\n return filters.every((f) => {\n return f.filters ? applyFilterArray([item], f.filters, f.logic).length > 0 : applyCondition(item, f);\n });\n } else {\n // logic === 'or'\n return filters.some((f) => {\n return f.filters ? applyFilterArray([item], f.filters, f.logic).length > 0 : applyCondition(item, f);\n });\n }\n });\n } else {\n return dataArray;\n }\n}\n\nexport function applySortArray(dataArray: any, sorts: AXDataSourceSortOption[]) {\n if (sorts && sorts.length > 0) {\n const sortFields = sorts.map((s) => s.field);\n const sortOrders = sorts.map((s) => s.dir);\n return orderBy(dataArray, sortFields, sortOrders);\n } else return dataArray;\n}\n","import { inject, Injectable } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\n\n@Injectable({ providedIn: 'root' })\nexport class AXPHtmlUtils {\n private sanitizer = inject(DomSanitizer);\n getTextFromHTML(html: string | undefined | null): string {\n if (!html) return '';\n const tempElement = document.createElement('div');\n tempElement.innerHTML = html;\n return tempElement.innerText || tempElement.textContent || '';\n }\n getSafeHTMLfromHTML(html: string | undefined | null): SafeHtml | null {\n if (!html) return null;\n return this.sanitizer.bypassSecurityTrustHtml(html);\n }\n}\n","import { Injectable } from '@angular/core';\n\n/**\n * Service for applying and resetting text highlighting within specified HTML elements.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class AXHighlightService {\n private querySelector: string | null;\n private searchValue: string | null;\n\n constructor() { }\n\n /**\n * Highlights all occurrences of a search value within the elements matching the provided query selector.\n *\n * @param querySelector - CSS selector to identify target elements.\n * @param searchValue - Text to search and highlight.\n */\n highlight(querySelector: string, searchValue: string): void {\n this.clear();\n if (!querySelector || !searchValue) {\n return;\n }\n this.querySelector = querySelector;\n this.searchValue = searchValue;\n const elements = document.querySelectorAll(querySelector);\n elements.forEach((element) => {\n this.applyHighlight(element as HTMLElement);\n });\n }\n\n /**\n * Resets all highlighted text within the elements matching the previously used query selector.\n */\n public clear(): void {\n const elements = document.querySelectorAll(`${this.querySelector} .ax-highlight-text`);\n elements.forEach((element) => {\n let combinedText = '';\n element.querySelectorAll('span').forEach((span) => {\n combinedText += span.textContent;\n });\n\n const mergedSpan = document.createElement('span');\n mergedSpan.textContent = combinedText;\n\n element?.parentNode?.replaceChild(mergedSpan, element);\n });\n }\n\n /**\n * Applies highlighting to a specific element by matching text against the search value.\n *\n * @param element - The HTML element to apply highlights to.\n */\n private applyHighlight(element: HTMLElement): void {\n const searchRegex = new RegExp(`(${this.searchValue})`, 'gi');\n this.recursivelyHighlight(element, searchRegex);\n }\n\n /**\n * Recursively applies highlighting to text nodes within an element.\n *\n * @param element - The current node being processed.\n * @param searchRegex - Regular expression for matching text to highlight.\n */\n private recursivelyHighlight(element: Node, searchRegex: RegExp): void {\n const childNodes = Array.from(element.childNodes);\n\n childNodes.forEach((node) => {\n if (node.nodeType === Node.TEXT_NODE) {\n const textContent = node.textContent || '';\n if (textContent.match(searchRegex)) {\n const highlightedHTML = this.createHighlightedHTML(textContent, searchRegex);\n const tempContainer = document.createElement('div');\n tempContainer.innerHTML = highlightedHTML;\n\n const fragment = document.createDocumentFragment();\n Array.from(tempContainer.childNodes).forEach((child) => fragment.appendChild(child));\n\n node.replaceWith(fragment);\n }\n } else if (node.nodeType === Node.ELEMENT_NODE) {\n this.recursivelyHighlight(node, searchRegex);\n }\n });\n }\n\n /**\n * Generates the HTML structure for highlighted text.\n *\n * @param textContent - The original text content to process.\n * @param searchRegex - Regular expression for matching text to highlight.\n * @returns A string of HTML with highlighted portions wrapped in span elements.\n */\n private createHighlightedHTML(textContent: string, searchRegex: RegExp): string {\n let parts: string[] = [];\n let match;\n let lastIndex = 0;\n let resultHTML = '<span class=\"ax-highlight-text\">';\n\n while ((match = searchRegex.exec(textContent)) !== null) {\n if (match.index > lastIndex) {\n resultHTML += `<span>${textContent.slice(lastIndex, match.index)}</span>`;\n }\n resultHTML += `<span class=\"ax-highlight\">${match[0]}</span>`;\n lastIndex = searchRegex.lastIndex;\n }\n\n if (lastIndex < textContent.length) {\n resultHTML += `<span>${textContent.slice(lastIndex)}</span>`;\n }\n\n resultHTML += '</span>';\n\n return resultHTML;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;SAoBgB,aAAa,CAAC,GAAQ,EAAE,SAAiB,EAAE,EAAA;IACzD,IAAI,IAAI,GAAa,EAAE;AACvB,IAAA,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE;QACrB,IAAI,OAAO,GAAG,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE;YACjF,IAAI,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;;aAC3D;AACL,YAAA,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;;;AAG3B,IAAA,OAAO,IAAI;AACb;;MCpBa,gBAAgB,CAAA;AAL7B,IAAA,WAAA,GAAA;AAMU,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,iBAAiB,CAAC;QAE3C,IAAe,CAAA,eAAA,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;QAE3C,IAAU,CAAA,UAAA,GAAW,CAAC;QACtB,IAAS,CAAA,SAAA,GAAG,CAAC;AAiCtB;AA/BC,IAAA,SAAS,CAAC,KAAa,EAAA;AACrB,QAAA,IAAI,IAAI,CAAC,SAAS,IAAI,KAAK,EAAE;AAC3B,YAAA,IAAI,CAAC,SAAS,GAAG,KAAK;YACtB,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,IAAI;YACtF,IAAI,CAAC,gBA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,kBAAkB,cAFjB,MAAM,EAAA,CAAA,CAAA;;2FAEP,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAH9B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACPD;;AAEG;;;;"}
1
+ {"version":3,"file":"acorex-platform-core.mjs","sources":["../../../../libs/platform/core/src/lib/types.ts","../../../../libs/platform/core/src/utils/countdown-timer.ts","../../../../libs/platform/core/src/utils/data-conditioner.ts","../../../../libs/platform/core/src/utils/html-utils.ts","../../../../libs/platform/core/src/utils/highlighter.ts","../../../../libs/platform/core/src/acorex-platform-core.ts"],"sourcesContent":["import { Type } from '@angular/core';\nimport { NavigationExtras } from '@angular/router';\n\nexport type AXPPartialNested<T> = {\n [K in keyof T]?: T[K] extends object ? AXPPartialNested<T[K]> : T[K];\n};\n\nexport type AXPMetaData = Record<string, any>;\n\nexport type AXPOptionsData = Record<string, any>;\n\nexport type AXPValidationRule = {\n rule: string;\n message?: string;\n options?: any;\n disabled?: boolean;\n};\n\nexport type AXPValidationRules = AXPValidationRule[];\n\nexport function getNestedKeys(obj: any, prefix: string = ''): string[] {\n let keys: string[] = [];\n for (const key in obj) {\n if (typeof obj[key] === 'object' && obj[key] !== null && !Array.isArray(obj[key])) {\n keys = [...keys, ...getNestedKeys(obj[key], prefix + key + '.')];\n } else {\n keys.push(prefix + key);\n }\n }\n return keys;\n}\n\nexport type AXPNavigateActionOptions = {\n router: {\n path: string;\n extras?: NavigationExtras & { target?: string };\n };\n modal: {\n component: Type<any>;\n title: string;\n options?: any;\n };\n};\n\nexport interface AXPNavigateActionCommand<T extends keyof AXPNavigateActionOptions> {\n type: T;\n options: AXPNavigateActionOptions[T];\n}\n","import { AXCalendarService } from '@acorex/core/date-time';\nimport { inject, Pipe, PipeTransform, signal } from '@angular/core';\nimport { interval, Observable } from 'rxjs';\nimport { map, startWith } from 'rxjs/operators';\n\n@Pipe({\n name: 'countdown',\n pure: false,\n standalone: true,\n})\nexport class AXPCountdownPipe implements PipeTransform {\n private calendarService = inject(AXCalendarService);\n\n private countdownSignal = signal(this.setupTimer());\n\n private targetDate: number = 0;\n private prevValue = 0;\n\n transform(value: number): Observable<string> {\n if (this.prevValue != value) {\n this.prevValue = value;\n const expireTime = this.calendarService.calendar.add(new Date(), 'second', value).date;\n this.updateTargetDate(expireTime.toISOString());\n }\n return this.countdownSignal();\n }\n\n private setupTimer() {\n return interval(1000).pipe(\n startWith(0),\n map(() => {\n const diff = this.targetDate - new Date().getTime();\n if (diff < 0) {\n return \"Time's up!\";\n }\n\n const times = [86400, 3600, 60, 1].map((seconds) => Math.floor((diff / 1000 / seconds) % (seconds === 1 ? 60 : 24)));\n const labels = ['d', 'h', 'm', 's'];\n return times\n .map((t, i) => (t > 0 || i === 3 ? `${t}${labels[i]}` : ''))\n .join(' ')\n .trim();\n })\n );\n }\n\n private updateTargetDate(value: string) {\n this.targetDate = new Date(value).getTime();\n }\n}\n","import { AXDataSourceFilterOption, AXDataSourceSortOption } from '@acorex/components/common';\nimport { endsWith, get, gt, gte, includes, isEmpty, isEqual, isNil, lt, lte, orderBy, startsWith } from 'lodash-es';\n\nconst loggingEnabled = false; // Set to true to enable logging, false to disable\n\nfunction applyCondition(item: any, condition: any) {\n const rawValue = condition.field ? get(item, condition.field) : null;\n const itemValue = typeof rawValue === 'string' ? rawValue.toLowerCase() : rawValue;\n const conditionValue = typeof condition.value === 'string' ? condition.value.toLowerCase() : condition.value;\n\n // Conditional Logging for debugging\n if (loggingEnabled) {\n console.log('Condition:', condition);\n console.log('Item Value:', itemValue);\n console.log('Condition Value:', conditionValue);\n }\n\n let result: boolean;\n const valueToCompare = isNil(condition.field) || condition.field === '' ? conditionValue : itemValue;\n const conditionType = condition?.operator?.type;\n if (!conditionType) {\n return true;\n }\n\n switch (conditionType) {\n case 'equal':\n result = isEqual(valueToCompare, conditionValue);\n if (loggingEnabled) {\n console.log('Equal check result:', result);\n }\n break;\n case 'notEqual':\n result = !isEqual(valueToCompare, conditionValue);\n if (loggingEnabled) {\n console.log('Not equal check result:', result);\n }\n break;\n case 'greaterThan':\n result = gt(valueToCompare, conditionValue);\n if (loggingEnabled) {\n console.log('Greater than check result:', result);\n }\n break;\n case 'lessThan':\n result = lt(valueToCompare, conditionValue);\n if (loggingEnabled) {\n console.log('Less than check result:', result);\n }\n break;\n case 'greaterThanOrEqual':\n result = gte(valueToCompare, conditionValue);\n if (loggingEnabled) {\n console.log('Greater than or equal check result:', result);\n }\n break;\n case 'lessThanOrEqual':\n result = lte(valueToCompare, conditionValue);\n if (loggingEnabled) {\n console.log('Less than or equal check result:', result);\n }\n break;\n case 'contains':\n if (typeof valueToCompare === 'string') {\n result = includes(valueToCompare, conditionValue);\n } else if (Array.isArray(valueToCompare)) {\n result = includes(\n valueToCompare.map((val) => val.toString().toLowerCase()),\n conditionValue\n );\n } else {\n result = false;\n }\n if (loggingEnabled) {\n console.log('Contains check result:', result);\n }\n break;\n case 'notContains':\n if (typeof valueToCompare === 'string') {\n result = !includes(valueToCompare, conditionValue);\n } else if (Array.isArray(valueToCompare)) {\n result = !includes(\n valueToCompare.map((val) => val.toString().toLowerCase()),\n conditionValue\n );\n } else {\n result = false;\n }\n if (loggingEnabled) {\n console.log('Not contains check result:', result);\n }\n break;\n case 'startsWith':\n result = typeof valueToCompare === 'string' && startsWith(valueToCompare, conditionValue);\n if (loggingEnabled) {\n console.log('Starts with check result:', result);\n }\n break;\n case 'endsWith':\n result = typeof valueToCompare === 'string' && endsWith(valueToCompare, conditionValue);\n if (loggingEnabled) {\n console.log('Ends with check result:', result);\n }\n break;\n case 'isEmpty':\n result = isEmpty(valueToCompare);\n if (loggingEnabled) {\n console.log('Is empty check result:', result);\n }\n break;\n case 'isNull':\n result = isNil(valueToCompare);\n if (loggingEnabled) {\n console.log('Is null check result:', result);\n }\n break;\n case 'isNotEmpty':\n result = !isEmpty(valueToCompare);\n if (loggingEnabled) {\n console.log('Is not empty check result:', result);\n }\n break;\n case 'between':\n result = !isNil(valueToCompare) && valueToCompare >= condition.value.from && valueToCompare <= condition.value.to;\n if (loggingEnabled) {\n console.log('Between check result:', result);\n }\n break;\n default:\n result = true;\n if (loggingEnabled) {\n console.log('Default case, returning true');\n }\n }\n\n return result;\n}\n\nexport function applyFilterArray(\n dataArray: any[],\n filters?: AXDataSourceFilterOption[],\n logic: 'and' | 'or' = 'and'\n): any[] {\n if (filters && filters.length) {\n return dataArray.filter((item) => {\n if (logic === 'and') {\n return filters.every((f) => {\n return f.filters ? applyFilterArray([item], f.filters, f.logic).length > 0 : applyCondition(item, f);\n });\n } else {\n // logic === 'or'\n return filters.some((f) => {\n return f.filters ? applyFilterArray([item], f.filters, f.logic).length > 0 : applyCondition(item, f);\n });\n }\n });\n } else {\n return dataArray;\n }\n}\n\nexport function applySortArray(dataArray: any, sorts: AXDataSourceSortOption[]) {\n if (sorts && sorts.length > 0) {\n const sortFields = sorts.map((s) => s.field);\n const sortOrders = sorts.map((s) => s.dir);\n return orderBy(dataArray, sortFields, sortOrders);\n } else return dataArray;\n}\n","import { inject, Injectable } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\n\n@Injectable({ providedIn: 'root' })\nexport class AXPHtmlUtils {\n private sanitizer = inject(DomSanitizer);\n getTextFromHTML(html: string | undefined | null): string {\n if (!html) return '';\n const tempElement = document.createElement('div');\n tempElement.innerHTML = html;\n return tempElement.innerText || tempElement.textContent || '';\n }\n getSafeHTMLfromHTML(html: string | undefined | null): SafeHtml | null {\n if (!html) return null;\n return this.sanitizer.bypassSecurityTrustHtml(html);\n }\n}\n","import { Injectable } from '@angular/core';\n\n/**\n * Service for applying and resetting text highlighting within specified HTML elements.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class AXHighlightService {\n private querySelector: string | null;\n private searchValue: string | null;\n\n constructor() { }\n\n /**\n * Highlights all occurrences of a search value within the elements matching the provided query selector.\n *\n * @param querySelector - CSS selector to identify target elements.\n * @param searchValue - Text to search and highlight.\n */\n highlight(querySelector: string, searchValue: string): void {\n this.clear();\n if (!querySelector || !searchValue) {\n return;\n }\n this.querySelector = querySelector;\n this.searchValue = searchValue;\n const elements = document.querySelectorAll(querySelector);\n elements.forEach((element) => {\n this.applyHighlight(element as HTMLElement);\n });\n }\n\n /**\n * Resets all highlighted text within the elements matching the previously used query selector.\n */\n public clear(): void {\n const elements = document.querySelectorAll(`${this.querySelector} .ax-highlight-text`);\n elements.forEach((element) => {\n let combinedText = '';\n element.querySelectorAll('span').forEach((span) => {\n combinedText += span.textContent;\n });\n\n const mergedSpan = document.createElement('span');\n mergedSpan.textContent = combinedText;\n\n element?.parentNode?.replaceChild(mergedSpan, element);\n });\n }\n\n /**\n * Applies highlighting to a specific element by matching text against the search value.\n *\n * @param element - The HTML element to apply highlights to.\n */\n private applyHighlight(element: HTMLElement): void {\n const searchRegex = new RegExp(`(${this.searchValue})`, 'gi');\n this.recursivelyHighlight(element, searchRegex);\n }\n\n /**\n * Recursively applies highlighting to text nodes within an element.\n *\n * @param element - The current node being processed.\n * @param searchRegex - Regular expression for matching text to highlight.\n */\n private recursivelyHighlight(element: Node, searchRegex: RegExp): void {\n const childNodes = Array.from(element.childNodes);\n\n childNodes.forEach((node) => {\n if (node.nodeType === Node.TEXT_NODE) {\n const textContent = node.textContent || '';\n if (textContent.match(searchRegex)) {\n const highlightedHTML = this.createHighlightedHTML(textContent, searchRegex);\n const tempContainer = document.createElement('div');\n tempContainer.innerHTML = highlightedHTML;\n\n const fragment = document.createDocumentFragment();\n Array.from(tempContainer.childNodes).forEach((child) => fragment.appendChild(child));\n\n node.replaceWith(fragment);\n }\n } else if (node.nodeType === Node.ELEMENT_NODE) {\n this.recursivelyHighlight(node, searchRegex);\n }\n });\n }\n\n /**\n * Generates the HTML structure for highlighted text.\n *\n * @param textContent - The original text content to process.\n * @param searchRegex - Regular expression for matching text to highlight.\n * @returns A string of HTML with highlighted portions wrapped in span elements.\n */\n private createHighlightedHTML(textContent: string, searchRegex: RegExp): string {\n let parts: string[] = [];\n let match;\n let lastIndex = 0;\n let resultHTML = '<span class=\"ax-highlight-text\">';\n\n while ((match = searchRegex.exec(textContent)) !== null) {\n if (match.index > lastIndex) {\n resultHTML += `<span>${textContent.slice(lastIndex, match.index)}</span>`;\n }\n resultHTML += `<span class=\"ax-highlight\">${match[0]}</span>`;\n lastIndex = searchRegex.lastIndex;\n }\n\n if (lastIndex < textContent.length) {\n resultHTML += `<span>${textContent.slice(lastIndex)}</span>`;\n }\n\n resultHTML += '</span>';\n\n return resultHTML;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;SAoBgB,aAAa,CAAC,GAAQ,EAAE,SAAiB,EAAE,EAAA;IACzD,IAAI,IAAI,GAAa,EAAE;AACvB,IAAA,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE;QACrB,IAAI,OAAO,GAAG,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE;YACjF,IAAI,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;;aAC3D;AACL,YAAA,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;;;AAG3B,IAAA,OAAO,IAAI;AACb;;MCpBa,gBAAgB,CAAA;AAL7B,IAAA,WAAA,GAAA;AAMU,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,iBAAiB,CAAC;QAE3C,IAAe,CAAA,eAAA,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;QAE3C,IAAU,CAAA,UAAA,GAAW,CAAC;QACtB,IAAS,CAAA,SAAA,GAAG,CAAC;AAiCtB;AA/BC,IAAA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ClC,UAAU,IAAI,SAAS,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA,OAAA,CAAS;;QAG9D,UAAU,IAAI,SAAS;AAEvB,QAAA,OAAO,UAAU;;8GA5GR,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAlB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,cAFjB,MAAM,EAAA,CAAA,CAAA;;2FAEP,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAH9B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACPD;;AAEG;;;;"}
@@ -10,6 +10,7 @@ import { set, merge, cloneDeep, get, isEqual, isNil, isUndefined, sum } from 'lo
10
10
  import { Subject, BehaviorSubject, filter } from 'rxjs';
11
11
  import { convertArrayToDataSource, AXDataSource } from '@acorex/components/common';
12
12
  import { signalStore, withState, withComputed, withMethods, patchState } from '@ngrx/signals';
13
+ import { AXTranslationService } from '@acorex/core/translation';
13
14
  import { AXUnsubscriber } from '@acorex/core/utils';
14
15
 
15
16
  var AXPPageStatus;
@@ -446,6 +447,18 @@ class AXPWidgetComponent extends AXPLayoutElement {
446
447
  this.getValue = computed(() => {
447
448
  return this.fullPath() ? this.extractValue(this.fullPath()) : null;
448
449
  });
450
+ this.validationRules = computed(() => {
451
+ const validationsRaw = this.options()['validations'];
452
+ if (validationsRaw == null) {
453
+ return [];
454
+ }
455
+ ;
456
+ return Object.values(this.options()['validations']).filter(c => c != null).map((c) => ({
457
+ rule: c.rule,
458
+ message: c.message,
459
+ options: c.options
460
+ }));
461
+ });
449
462
  }
450
463
  get id() {
451
464
  return this._id;
@@ -568,38 +581,56 @@ class AXPDataListWidgetComponent extends AXPWidgetComponent {
568
581
  this.textField = computed(() => this.options()['textField'] ?? 'title');
569
582
  this.valueField = computed(() => this.options()['valueField'] ?? 'id');
570
583
  this.selectedItems = signal([]);
571
- this.rf = effect(() => {
584
+ this.rf = effect(async () => {
572
585
  const rawValue = this.options()['dataSource'];
573
586
  // static datasource class
574
587
  if (rawValue instanceof AXDataSource) {
575
588
  this.dataSource.set(rawValue);
576
- } // static array datasource
589
+ }
590
+ // static array datasource
577
591
  else if (Array.isArray(rawValue)) {
578
- this.dataSource.set(convertArrayToDataSource(rawValue, {
592
+ const ds = new AXDataSource({
579
593
  key: this.valueField(),
580
- pageSize: 100,
581
- }));
582
- } // resolve data source by name
594
+ pageSize: 10,
595
+ load: async (e) => {
596
+ const raw = this.options()['dataSource'];
597
+ return {
598
+ items: raw,
599
+ total: raw.length,
600
+ };
601
+ },
602
+ byKey: (key) => {
603
+ const raw = this.options()['dataSource'];
604
+ const item = raw.filter((c) => c[this.valueField()] == key);
605
+ return Promise.resolve(item[0]);
606
+ }
607
+ });
608
+ this.dataSource.set(ds);
609
+ }
610
+ // resolve data source by name
583
611
  else if (rawValue && (typeof rawValue == 'string' || typeof rawValue == 'object')) {
584
- const name = typeof rawValue == 'object' ? rawValue[this.valueField()] : rawValue;
585
- this.dataService.get(name).then((c) => {
586
- if (this.mode == 'designer' && c?.samples?.length) {
587
- this.dataSource.set(convertArrayToDataSource(c.samples, {
588
- key: this.valueField(),
589
- pageSize: 500,
590
- }));
612
+ const id = typeof rawValue == 'object' ? rawValue['id'] : rawValue;
613
+ const c = await this.dataService.get(id);
614
+ if (this.mode == 'designer' && c?.samples?.length) {
615
+ this.dataSource.set(convertArrayToDataSource(c.samples, {
616
+ key: this.valueField(),
617
+ pageSize: 500,
618
+ }));
619
+ }
620
+ else {
621
+ const ds = c?.source();
622
+ if (ds && ds instanceof Promise) {
623
+ const d = await ds;
624
+ this.dataSource.set(d);
625
+ }
626
+ else if (ds) {
627
+ this.dataSource.set(ds);
591
628
  }
629
+ // empty datasource
592
630
  else {
593
- const ds = c?.source();
594
- if (ds) {
595
- this.dataSource.set(ds);
596
- }
597
- // empty datasource
598
- else {
599
- this.dataSource.set(convertArrayToDataSource([]));
600
- }
631
+ this.dataSource.set(convertArrayToDataSource([]));
601
632
  }
602
- });
633
+ }
603
634
  }
604
635
  // empty datasource
605
636
  else {
@@ -875,6 +906,8 @@ class AXPWidgetRendererDirective {
875
906
  this.contextService = inject(AXPLayoutBuilderContextStore);
876
907
  this.widgetRegistery = inject(AXPWidgetRegistryService);
877
908
  this.unsubscriber = inject(AXUnsubscriber);
909
+ this.translateService = inject(AXTranslationService);
910
+ this.widgetService = inject(AXPWidgetRegistryService);
878
911
  this.viewContainerRef = inject(ViewContainerRef);
879
912
  this.isLoading = signal(false);
880
913
  this.expressionCache = new Map();
@@ -1097,7 +1130,25 @@ class AXPWidgetRendererDirective {
1097
1130
  }
1098
1131
  getEventScope() {
1099
1132
  const scope = {};
1100
- set(scope, 'context', (path) => this.onContextChanged.pipe(filter((c) => c.path == path)));
1133
+ set(scope, 'context', (path) => {
1134
+ return this.onContextChanged.pipe(filter((c) => {
1135
+ if (path == null) {
1136
+ return true;
1137
+ }
1138
+ if (path.endsWith('*')) {
1139
+ return c.path.startsWith(path.substring(0, path.length - 1));
1140
+ }
1141
+ else if (path.startsWith('*')) {
1142
+ return c.path.startsWith(path.substring(1, path.length));
1143
+ }
1144
+ else {
1145
+ return path == c.path;
1146
+ }
1147
+ // const regexPattern = `^${path.replace(/\.\*/g, '(\\.|\\[\\d+\\])[^.]*')}$`;
1148
+ // const regex = new RegExp(regexPattern);
1149
+ // return regex.test(c.path);
1150
+ }));
1151
+ });
1101
1152
  set(scope, 'from', (event) => get(this.instance.api(), event));
1102
1153
  return scope;
1103
1154
  }
@@ -1122,6 +1173,12 @@ class AXPWidgetRendererDirective {
1122
1173
  set(scope, 'sum', (values) => {
1123
1174
  return sum(values);
1124
1175
  });
1176
+ set(scope, 'translate', (text, options) => {
1177
+ return this.translateService.translateAsync(text, options);
1178
+ });
1179
+ set(scope, 'widgetInfo', (name) => {
1180
+ return this.widgetService.resolve(name);
1181
+ });
1125
1182
  Object.entries(this.builderService.functions).forEach((i) => {
1126
1183
  set(scope, i[0], (...args) => {
1127
1184
  return i[1](...args);
@@ -1280,16 +1337,19 @@ const AXP_WIDGETS_FILTER_GROUP = {
1280
1337
  name: 'filter',
1281
1338
  order: 5,
1282
1339
  title: 'Filters',
1340
+ hidden: true
1283
1341
  };
1284
1342
  const AXP_WIDGETS_CHART_GROUP = {
1285
1343
  name: 'chart',
1286
1344
  order: 6,
1287
1345
  title: 'charts',
1346
+ hidden: true
1288
1347
  };
1289
1348
  const AXP_WIDGETS_VALIDATION_GROUP = {
1290
1349
  name: 'validation',
1291
1350
  order: 7,
1292
1351
  title: 'validations',
1352
+ hidden: true,
1293
1353
  };
1294
1354
  const AXP_WIDGETS_GROUPS = [
1295
1355
  AXP_WIDGETS_LAYOUT_GROUP,