@acorex/modules 19.1.2 → 19.1.4

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 (60) hide show
  1. package/application-management/lib/layouts/module-entity-detail-view/module-entity-detail-view.component.d.ts +15 -5
  2. package/auth/lib/account/profile/profile-slot.component.d.ts +1 -0
  3. package/conversation/lib/entities/comments/comment.module.d.ts +4 -3
  4. package/fesm2022/acorex-modules-application-management.mjs +3 -3
  5. package/fesm2022/acorex-modules-application-management.mjs.map +1 -1
  6. package/fesm2022/{acorex-modules-auth-acorex-modules-auth-D8WcF6Jp.mjs → acorex-modules-auth-acorex-modules-auth-BuSxsqTx.mjs} +38 -26
  7. package/fesm2022/acorex-modules-auth-acorex-modules-auth-BuSxsqTx.mjs.map +1 -0
  8. package/fesm2022/{acorex-modules-auth-app-chooser.component-0TpgRa-v.mjs → acorex-modules-auth-app-chooser.component-B3yFTcfb.mjs} +5 -5
  9. package/fesm2022/{acorex-modules-auth-app-chooser.component-0TpgRa-v.mjs.map → acorex-modules-auth-app-chooser.component-B3yFTcfb.mjs.map} +1 -1
  10. package/fesm2022/{acorex-modules-auth-login.module-CziF_sE7.mjs → acorex-modules-auth-login.module-BwbsBdZm.mjs} +4 -4
  11. package/fesm2022/{acorex-modules-auth-login.module-CziF_sE7.mjs.map → acorex-modules-auth-login.module-BwbsBdZm.mjs.map} +1 -1
  12. package/fesm2022/{acorex-modules-auth-master.layout-Ds4LxKSf.mjs → acorex-modules-auth-master.layout-BIwGGzl9.mjs} +2 -2
  13. package/fesm2022/{acorex-modules-auth-master.layout-Ds4LxKSf.mjs.map → acorex-modules-auth-master.layout-BIwGGzl9.mjs.map} +1 -1
  14. package/fesm2022/{acorex-modules-auth-password.component-9TFb-AHn.mjs → acorex-modules-auth-password.component-Ce57WfMX.mjs} +2 -2
  15. package/fesm2022/{acorex-modules-auth-password.component-9TFb-AHn.mjs.map → acorex-modules-auth-password.component-Ce57WfMX.mjs.map} +1 -1
  16. package/fesm2022/{acorex-modules-auth-password.component-BVVvl8So.mjs → acorex-modules-auth-password.component-CquAxSV0.mjs} +4 -4
  17. package/fesm2022/{acorex-modules-auth-password.component-BVVvl8So.mjs.map → acorex-modules-auth-password.component-CquAxSV0.mjs.map} +1 -1
  18. package/fesm2022/{acorex-modules-auth-routes-TdAn72Pa.mjs → acorex-modules-auth-routes-CbA94Lwp.mjs} +2 -2
  19. package/fesm2022/{acorex-modules-auth-routes-TdAn72Pa.mjs.map → acorex-modules-auth-routes-CbA94Lwp.mjs.map} +1 -1
  20. package/fesm2022/{acorex-modules-auth-tenant-chooser.component-CorZ4Z7h.mjs → acorex-modules-auth-tenant-chooser.component-CFT3i6iA.mjs} +5 -5
  21. package/fesm2022/{acorex-modules-auth-tenant-chooser.component-CorZ4Z7h.mjs.map → acorex-modules-auth-tenant-chooser.component-CFT3i6iA.mjs.map} +1 -1
  22. package/fesm2022/{acorex-modules-auth-two-factor.module-BE2uEne7.mjs → acorex-modules-auth-two-factor.module-DiN9uKFz.mjs} +2 -2
  23. package/fesm2022/{acorex-modules-auth-two-factor.module-BE2uEne7.mjs.map → acorex-modules-auth-two-factor.module-DiN9uKFz.mjs.map} +1 -1
  24. package/fesm2022/acorex-modules-auth.mjs +1 -1
  25. package/fesm2022/acorex-modules-conversation.mjs +20 -11
  26. package/fesm2022/acorex-modules-conversation.mjs.map +1 -1
  27. package/fesm2022/{acorex-modules-form-template-management-category.entity-xUkZHVgy.mjs → acorex-modules-form-template-management-category.entity-Cqu3urCo.mjs} +50 -2
  28. package/fesm2022/acorex-modules-form-template-management-category.entity-Cqu3urCo.mjs.map +1 -0
  29. package/fesm2022/acorex-modules-form-template-management-template-picker.component-CsGnikzF.mjs +126 -0
  30. package/fesm2022/acorex-modules-form-template-management-template-picker.component-CsGnikzF.mjs.map +1 -0
  31. package/fesm2022/{acorex-modules-form-template-management-template-widget-edit.component-DQw5qvib.mjs → acorex-modules-form-template-management-template-widget-edit.component-CVyFN7D9.mjs} +19 -7
  32. package/fesm2022/acorex-modules-form-template-management-template-widget-edit.component-CVyFN7D9.mjs.map +1 -0
  33. package/fesm2022/acorex-modules-form-template-management.mjs +23 -12
  34. package/fesm2022/acorex-modules-form-template-management.mjs.map +1 -1
  35. package/fesm2022/{acorex-modules-platform-management-regional-formats-BSMV12dQ.mjs → acorex-modules-platform-management-regional-formats-BaHofjWg.mjs} +3 -3
  36. package/fesm2022/{acorex-modules-platform-management-regional-formats-BSMV12dQ.mjs.map → acorex-modules-platform-management-regional-formats-BaHofjWg.mjs.map} +1 -1
  37. package/fesm2022/acorex-modules-platform-management-timezones-BoScbn0h.mjs +15 -0
  38. package/fesm2022/acorex-modules-platform-management-timezones-BoScbn0h.mjs.map +1 -0
  39. package/fesm2022/acorex-modules-platform-management.mjs +355 -122
  40. package/fesm2022/acorex-modules-platform-management.mjs.map +1 -1
  41. package/fesm2022/acorex-modules-text-template-management.mjs +3 -3
  42. package/fesm2022/acorex-modules-text-template-management.mjs.map +1 -1
  43. package/form-template-management/lib/components/widgets/template/index.d.ts +1 -1
  44. package/form-template-management/lib/components/widgets/template/template-widget-edit.component.d.ts +2 -0
  45. package/form-template-management/lib/components/widgets/{template/template-picker → template-picker}/template-picker.component.d.ts +2 -2
  46. package/form-template-management/lib/entities/template/template.types.d.ts +1 -0
  47. package/package.json +8 -8
  48. package/platform-management/lib/common/organizarion/setting.keys.d.ts +16 -0
  49. package/platform-management/lib/common/organizarion/settings.provider.d.ts +5 -0
  50. package/platform-management/lib/common/regional/language-slot/language-slot.component.d.ts +2 -7
  51. package/platform-management/lib/common/regional/regional-store.service.d.ts +1 -8
  52. package/platform-management/lib/common/regional/regional-util.service.d.ts +12 -0
  53. package/platform-management/lib/common/regional/setting.provider.d.ts +2 -13
  54. package/platform-management/lib/menu.provider.d.ts +1 -0
  55. package/fesm2022/acorex-modules-auth-acorex-modules-auth-D8WcF6Jp.mjs.map +0 -1
  56. package/fesm2022/acorex-modules-form-template-management-category.entity-xUkZHVgy.mjs.map +0 -1
  57. package/fesm2022/acorex-modules-form-template-management-template-picker.component-BXOyKuAt.mjs +0 -123
  58. package/fesm2022/acorex-modules-form-template-management-template-picker.component-BXOyKuAt.mjs.map +0 -1
  59. package/fesm2022/acorex-modules-form-template-management-template-widget-edit.component-DQw5qvib.mjs.map +0 -1
  60. /package/form-template-management/lib/components/widgets/{template → template-picker}/template.provider.d.ts +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-modules-form-template-management-category.entity-Cqu3urCo.mjs","sources":["../../../../libs/modules/form-template-management/src/lib/entities/category/category.entity.ts"],"sourcesContent":["import { AXPEntity, AXPEntityCommandScope, AXPEntityQueryType } from '@acorex/platform/common';\nimport { AXPWidgetsCatalog } from '@acorex/platform/layout/builder';\nimport { Injector } from '@angular/core';\n\nimport { AXMFormTemplateManagementModuleConst } from '../../const';\nimport { AXMFormTemplateManagementCategoryEntityService } from './category.service';\nimport { applyFilterArray, applySortArray } from '@acorex/platform/core';\n\nexport async function factory(injector: Injector): Promise<AXPEntity | null> {\n const dataService = injector.get(AXMFormTemplateManagementCategoryEntityService);\n const i18n = AXMFormTemplateManagementModuleConst.i18n;\n\n const entityDef: AXPEntity = {\n module: AXMFormTemplateManagementModuleConst.moduleName,\n name: AXMFormTemplateManagementModuleConst.categoryEntity,\n parentKey: 'parentId',\n source: '',\n title: `t(\"category\", { scope: \"common\" })`,\n formats: {\n individual: `t(\"category\", { scope: \"common\" })`,\n plural: `t(\"categories\", { scope: \"common\" })`,\n },\n relatedEntities: [],\n groups: [\n {\n id: 'section',\n title: `t(\"category\", { scope: \"common\" })`,\n },\n ],\n properties: [\n {\n name: 'title',\n title: 't(\"title\", { scope: \"common\" })',\n groupId: 'section',\n schema: {\n dataType: 'string',\n interface: {\n type: AXPWidgetsCatalog.text,\n options: {\n width: \"400px\"\n }\n },\n },\n validations: [\n {\n rule: 'required',\n },\n ],\n },\n {\n name: 'parentId',\n title: 'Parent',\n groupId: 'section',\n schema: {\n dataType: 'string',\n interface: {\n type: AXPWidgetsCatalog.lookup,\n options: {\n entity: `${AXMFormTemplateManagementModuleConst.moduleName}.${AXMFormTemplateManagementModuleConst.categoryEntity}`,\n },\n },\n },\n },\n ],\n columns: [{ name: 'title' }],\n commands: {\n create: {\n execute: async (data: any) => {\n const res = await dataService.insertOne(data);\n return { id: res };\n },\n },\n delete: {\n execute: async (id: any) => {\n return await dataService.deleteOne(id);\n },\n },\n update: {\n execute: async (data: any) => {\n return await dataService.updateOne(data.id, data);\n },\n },\n },\n queries: {\n byKey: {\n execute: async (id: string) => {\n return await dataService.getOne(id);\n },\n type: AXPEntityQueryType.Single,\n },\n list: {\n execute: async (e: any) => {\n const list = (await dataService.query({ skip: e.skip, take: e.take, filter: e.filter, sort: e.sort })).items;\n const sortedItems = applySortArray(list, e.sort);\n const filteredItems = applyFilterArray(sortedItems, e.filter ? [e.filter] : []);\n if (e.filter?.field === 'parentId') {\n return {\n items: filteredItems,\n total: filteredItems.length,\n };\n }\n\n return {\n total: filteredItems.filter((i) => !i.parentId).length,\n items: filteredItems.filter((i) => !i.parentId).slice(e.skip, (e.skip ?? 0) + (e.take ?? 0)),\n };\n },\n type: AXPEntityQueryType.List,\n },\n },\n interfaces: {\n master: {\n create: {\n sections: [\n {\n id: 'section',\n },\n ],\n properties: [\n {\n name: 'title',\n layout: {\n positions: {\n lg: {\n colSpan: 12,\n },\n },\n },\n },\n {\n name: 'parentId',\n layout: {\n positions: {\n lg: {\n colSpan: 12,\n },\n },\n },\n },\n ],\n },\n update: {\n sections: [\n {\n id: 'section',\n },\n ],\n properties: [\n {\n name: 'title',\n layout: {\n positions: {\n lg: {\n colSpan: 12,\n },\n },\n },\n },\n {\n name: 'parentId',\n layout: {\n positions: {\n lg: {\n colSpan: 12,\n },\n },\n },\n },\n ],\n },\n single: {\n title: '{{title}}',\n sections: [\n {\n id: 'section',\n layout: {\n positions: {\n lg: {\n colSpan: 12,\n },\n },\n },\n },\n ],\n properties: [\n {\n name: 'title',\n layout: {\n positions: {\n lg: {\n colSpan: 6,\n },\n },\n },\n },\n ],\n actions: [],\n },\n list: {\n actions: [\n {\n title: `t(\"create\", { scope: \"common\" })`,\n command: 'create-entity',\n priority: 'primary',\n type: 'create',\n scope: AXPEntityCommandScope.TypeLevel,\n },\n {\n title: 't(\"deleteItems\", { scope: \"common\" })',\n command: 'delete-entity',\n priority: 'primary',\n type: 'delete',\n scope: AXPEntityCommandScope.Selected,\n },\n {\n title: 't(\"detail\", { scope: \"common\" })',\n command: 'open-entity',\n priority: 'secondary',\n type: 'view',\n scope: AXPEntityCommandScope.Individual,\n },\n {\n title: 't(\"delete\", { scope: \"common\" })',\n command: 'delete-entity',\n priority: 'secondary',\n type: 'delete',\n scope: AXPEntityCommandScope.Individual,\n },\n ],\n views: [\n {\n name: 'all',\n title: 't(\"allItem\", { scope: \"common\" })',\n fixed: true,\n columns: [],\n conditions: [],\n sorts: [],\n },\n ],\n },\n },\n },\n };\n\n return entityDef;\n}\n"],"names":[],"mappings":";;;;;AAQO,eAAe,OAAO,CAAC,QAAkB,EAAA;IAC9C,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,CAAC,8CAA8C,CAAC;AAChF,IAAA,MAAM,IAAI,GAAG,oCAAoC,CAAC,IAAI;AAEtD,IAAA,MAAM,SAAS,GAAc;QAC3B,MAAM,EAAE,oCAAoC,CAAC,UAAU;QACvD,IAAI,EAAE,oCAAoC,CAAC,cAAc;AACzD,QAAA,SAAS,EAAE,UAAU;AACrB,QAAA,MAAM,EAAE,EAAE;AACV,QAAA,KAAK,EAAE,CAAoC,kCAAA,CAAA;AAC3C,QAAA,OAAO,EAAE;AACP,YAAA,UAAU,EAAE,CAAoC,kCAAA,CAAA;AAChD,YAAA,MAAM,EAAE,CAAsC,oCAAA,CAAA;AAC/C,SAAA;AACD,QAAA,eAAe,EAAE,EAAE;AACnB,QAAA,MAAM,EAAE;AACN,YAAA;AACE,gBAAA,EAAE,EAAE,SAAS;AACb,gBAAA,KA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AQ;AACtC,yBAAA;AACD,wBAAA;AACE,4BAAA,KAAK,EAAE,kCAAkC;AACzC,4BAAA,OAAO,EAAE,aAAa;AACtB,4BAAA,QAAQ,EAAE,WAAW;AACrB,4BAAA,IAAI,EAAE,MAAM;4BACZ,KAAK,EAAE,qBAAqB,CAAC,UAAU;AACxC,yBAAA;AACD,wBAAA;AACE,4BAAA,KAAK,EAAE,kCAAkC;AACzC,4BAAA,OAAO,EAAE,eAAe;AACxB,4BAAA,QAAQ,EAAE,WAAW;AACrB,4BAAA,IAAI,EAAE,QAAQ;4BACd,KAAK,EAAE,qBAAqB,CAAC,UAAU;AACxC,yBAAA;AACF,qBAAA;AACD,oBAAA,KAAK,EAAE;AACL,wBAAA;AACE,4BAAA,IAAI,EAAE,KAAK;AACX,4BAAA,KAAK,EAAE,mCAAmC;AAC1C,4BAAA,KAAK,EAAE,IAAI;AACX,4BAAA,OAAO,EAAE,EAAE;AACX,4BAAA,UAAU,EAAE,EAAE;AACd,4BAAA,KAAK,EAAE,EAAE;AACV,yBAAA;AACF,qBAAA;AACF,iBAAA;AACF,aAAA;AACF,SAAA;KACF;AAED,IAAA,OAAO,SAAS;AAClB;;;;"}
@@ -0,0 +1,126 @@
1
+ import * as i4 from '@acorex/components/button';
2
+ import { AXButtonModule } from '@acorex/components/button';
3
+ import * as i2 from '@acorex/components/common';
4
+ import { AXCommonModule } from '@acorex/components/common';
5
+ import * as i5 from '@acorex/components/decorators';
6
+ import { AXDecoratorModule } from '@acorex/components/decorators';
7
+ import { AXBasePageComponent } from '@acorex/components/page';
8
+ import * as i7 from '@acorex/components/search-box';
9
+ import { AXSearchBoxModule } from '@acorex/components/search-box';
10
+ import * as i6 from '@acorex/components/tabs';
11
+ import { AXTabsModule } from '@acorex/components/tabs';
12
+ import { AXPSettingValueProviderService, AXPSettingScope, AXPStickyDirective } from '@acorex/platform/common';
13
+ import * as i1 from '@angular/common';
14
+ import { CommonModule } from '@angular/common';
15
+ import * as i0 from '@angular/core';
16
+ import { inject, model, signal, computed, Component, ViewEncapsulation } from '@angular/core';
17
+ import * as i3 from '@angular/forms';
18
+ import { FormsModule } from '@angular/forms';
19
+ import { orderBy, uniqBy } from 'lodash-es';
20
+
21
+ class AXPTemplateWidgetPickerComponent extends AXBasePageComponent {
22
+ constructor() {
23
+ super(...arguments);
24
+ this.settingService = inject(AXPSettingValueProviderService);
25
+ this.pinnedSettingKey = 'forms:templates:picker:pinned';
26
+ this.searchTerm = model('');
27
+ // Signals
28
+ this.widgets = [];
29
+ this.displayWidgets = signal([]);
30
+ // Signal to track selected widgets
31
+ this.selectedWidgets = signal([]);
32
+ // Computed for filtered and ordered widget list
33
+ this.orderedList = computed(() => {
34
+ const search = this.searchTerm().toLowerCase();
35
+ const selectedTabName = this.selectedTab().name;
36
+ return orderBy(this.displayWidgets().filter((w) => {
37
+ const matchesTab = selectedTabName === 'all' || w.group.name === selectedTabName;
38
+ const matchesSearch = !search || w.title.toLowerCase().includes(search) || w.description?.toLowerCase().includes(search);
39
+ return matchesTab && matchesSearch;
40
+ }), ['pinned', 'title'], ['desc', 'asc']);
41
+ });
42
+ // Pinned and regular lists
43
+ this.pinnedList = computed(() => this.orderedList().filter((c) => c.pinned));
44
+ this.regularList = computed(() => this.orderedList().filter((c) => !c.pinned));
45
+ this.tabs = computed(() => {
46
+ const uniqueOrderedWidgets = orderBy(uniqBy([{ name: 'all', title: 'All', order: 0 }, ...this.widgets.map(c => c.group)], (c) => c.name // or another property to ensure uniqueness
47
+ ), (c) => c.order);
48
+ return uniqueOrderedWidgets;
49
+ });
50
+ this.currentTabIndex = signal(0);
51
+ this.selectedTab = computed(() => this.tabs()[this.currentTabIndex()]);
52
+ }
53
+ async ngOnInit() {
54
+ super.ngOnInit();
55
+ const pinnedWidgets = (await this.settingService.get(this.pinnedSettingKey)) || [];
56
+ this.displayWidgets.set(this.widgets.map((c) => ({ ...c, pinned: pinnedWidgets.includes(c.id), icon: c.icon ?? 'fa-solid fa-file-invoice' })));
57
+ }
58
+ handleTabChange(event) {
59
+ const indx = event.index;
60
+ if (this.currentTabIndex() != indx) {
61
+ this.currentTabIndex.set(indx);
62
+ }
63
+ }
64
+ handleClick(event, widget) {
65
+ if (event.ctrlKey) {
66
+ const currentSelection = this.selectedWidgets();
67
+ const isAlreadySelected = currentSelection.some((w) => w === widget);
68
+ if (isAlreadySelected) {
69
+ // Deselect widget if already selected
70
+ this.selectedWidgets.set(currentSelection.filter((w) => w !== widget));
71
+ }
72
+ else {
73
+ // Add widget to selection
74
+ this.selectedWidgets.set([...currentSelection, widget]);
75
+ }
76
+ }
77
+ else {
78
+ // If CTRL is not pressed, select only the clicked widget
79
+ this.close({ widgets: [widget] });
80
+ }
81
+ }
82
+ async handlePinClick(e, widget) {
83
+ e.stopPropagation();
84
+ widget.pinned = !widget.pinned;
85
+ // Get the current list of pinned widgets from settings
86
+ let pinnedWidgets = (await this.settingService.get(this.pinnedSettingKey)) || [];
87
+ // Update the list of pinned widgets based on the pinned status
88
+ if (widget.pinned) {
89
+ if (!pinnedWidgets.includes(widget.id)) {
90
+ pinnedWidgets.push(widget.id);
91
+ }
92
+ }
93
+ else {
94
+ pinnedWidgets = pinnedWidgets.filter((name) => name !== widget.id);
95
+ }
96
+ // Save the updated list of pinned widgets
97
+ await this.settingService.scope(AXPSettingScope.User).set(this.pinnedSettingKey, pinnedWidgets);
98
+ // Trigger a re-render of the widgets
99
+ this.displayWidgets.set([...this.displayWidgets()]);
100
+ }
101
+ // Check if a widget is selected
102
+ isWidgetSelected(widget) {
103
+ return this.selectedWidgets().includes(widget);
104
+ }
105
+ handleConfirmSelection() {
106
+ this.close({ widgets: this.selectedWidgets() });
107
+ }
108
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPTemplateWidgetPickerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
109
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXPTemplateWidgetPickerComponent, isStandalone: true, selector: "ng-component", inputs: { searchTerm: { classPropertyName: "searchTerm", publicName: "searchTerm", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { searchTerm: "searchTermChange" }, usesInheritance: true, ngImport: i0, template: "<div class=\"ax-flex ax-flex-col lg:ax-h-[75vh]\">\n <div>\n <ax-tabs [look]=\"'with-line'\" (onActiveTabChanged)=\"handleTabChange($event)\">\n @for(w of tabs();track $index)\n {\n <ax-tab-item [text]=\"w.title\" [key]=\"$index.toString()\"\n [active]=\"currentTabIndex() === $index\"></ax-tab-item>\n }\n </ax-tabs>\n </div>\n <div class=\"ax-overflow-auto\" #content>\n <div class=\"ax-p-4 ax-sticky ax-top-0 ax-z-10 ax-transition-all \" #sticky=\"axpSticky\"\n [axpSticky]=\"'ax-bg-surface ax-shadow-xl'\" [stickyParent]=\"content\" [stickyOffset]=\"10\">\n <ax-search-box look=\"fill\" placeholder=\"e.g. Button, Text, ...\" [(ngModel)]=\"searchTerm\" [delayTime]=\"300\"\n [axAutoFocus]=\"true\">\n <ax-clear-button></ax-clear-button>\n </ax-search-box>\n </div>\n <div class=\"ax-flex ax-flex-col ax-p-4 ax-pt-0\">\n <ng-template #itemTpl let-w>\n <div (click)=\"handleClick($event,w)\"\n class=\"ax-py-2 ax-px-3 ax-rounded-md ax-flex ax-gap-3 ax-items-center ax-group hover:ax-bg-primary-100 dark:hover:ax-bg-primary-800 ax-cursor-pointer\"\n [class.ax-bg-primary-100]=\"isWidgetSelected(w)\">\n <div class=\"ax-w-10 ax-h-10 ax-flex ax-items-center ax-justify-center ax-rounded-md ax-border ax-border-neutral-200 ax-text-neutral-500 ax-bg-on-surface group-hover:ax-bg-primary-200\"\n [class.ax-bg-primary-200]=\"isWidgetSelected(w)\">\n <i [ngClass]=\"w.icon\" class=\"ax-text-lg group-hover:ax-text-primary-700 ax-text-on-surface-fore\"\n [class.ax-text-primary-700]=\"isWidgetSelected(w)\"></i>\n </div>\n <div class=\"ax-flex ax-flex-col ax-gap-1 ax-flex-1\">\n <div class=\"ax-flex ax-items-center ax-gap-2\">\n <div class=\"ax-font-semibold ax-text-sm\">{{w.title}}</div>\n <div (click)=\"handlePinClick($event,w)\">\n @if (w.pinned) {\n <i class=\"fa-solid fa-thumbtack ax-text-sm ax-text-neutral-500 ax-rotate-45\"></i>\n }\n @else {\n <i\n class=\"fa-light fa-thumbtack ax-text-sm ax-text-neutral-500 ax-rotate-45 ax-invisible group-hover:ax-visible\"></i>\n }\n </div>\n </div>\n <span class=\"ax-text-xs ax-text-neutral-400 ax-truncate\">\n {{w.description}}\n </span>\n </div>\n </div>\n </ng-template>\n <div class=\"ax-grid ax-grid-cols-2 ax-gap-2 \">\n @for(w of pinnedList();track $index)\n {\n <ng-container *ngTemplateOutlet=\"itemTpl;context:{ $implicit: w}\"></ng-container>\n }\n </div>\n @if(pinnedList().length)\n {\n <hr class=\"ax-my-4 ax-border-dashed\">\n }\n <div class=\"ax-grid ax-grid-cols-2 ax-gap-2 \">\n @for(w of regularList();track $index)\n {\n <ng-container *ngTemplateOutlet=\"itemTpl;context:{ $implicit: w}\"></ng-container>\n }\n </div>\n </div>\n </div>\n</div>\n@if(selectedWidgets().length)\n{\n<ax-footer>\n <ax-suffix>\n <ax-button look=\"solid\" color=\"primary\" text=\"{{ selectedWidgets().length }} Selected\"\n (onClick)=\"handleConfirmSelection()\"></ax-button>\n </ax-suffix>\n</ax-footer>\n}", styles: [".selected-widget{border-width:1px;--tw-border-opacity: 1;border-color:rgba(var(--ax-color-primary-500),var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgba(var(--ax-color-primary-100),var(--tw-bg-opacity, 1))}.selected-widget i{--tw-text-opacity: 1;color:rgba(var(--ax-color-primary-500),var(--tw-text-opacity, 1))}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: AXCommonModule }, { kind: "directive", type: i2.AXAutoFocusDirective, selector: "[axAutoFocus]", inputs: ["axAutoFocus", "axAutoFocusTime"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i4.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i5.AXDecoratorClearButtonComponent, selector: "ax-clear-button", inputs: ["icon"] }, { kind: "component", type: i5.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXTabsModule }, { kind: "component", type: i6.AXTabsComponent, selector: "ax-tabs", inputs: ["look", "location", "fitParent", "minWidth", "content"], outputs: ["onActiveTabChanged"] }, { kind: "component", type: i6.AXTabItemComponent, selector: "ax-tab-item", inputs: ["disabled", "text", "key", "headerTemplate", "active"], outputs: ["disabledChange", "onClick", "onBlur", "onFocus", "activeChange"] }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type: i7.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "delayTime"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "directive", type: AXPStickyDirective, selector: "[axpSticky]", inputs: ["axpSticky", "stickyOffset", "stickyParent", "stickyTarget"], outputs: ["isStickyChange"], exportAs: ["axpSticky"] }], encapsulation: i0.ViewEncapsulation.None }); }
110
+ }
111
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPTemplateWidgetPickerComponent, decorators: [{
112
+ type: Component,
113
+ args: [{ imports: [
114
+ CommonModule,
115
+ AXCommonModule,
116
+ FormsModule,
117
+ AXButtonModule,
118
+ AXDecoratorModule,
119
+ AXTabsModule,
120
+ AXSearchBoxModule,
121
+ AXPStickyDirective,
122
+ ], encapsulation: ViewEncapsulation.None, template: "<div class=\"ax-flex ax-flex-col lg:ax-h-[75vh]\">\n <div>\n <ax-tabs [look]=\"'with-line'\" (onActiveTabChanged)=\"handleTabChange($event)\">\n @for(w of tabs();track $index)\n {\n <ax-tab-item [text]=\"w.title\" [key]=\"$index.toString()\"\n [active]=\"currentTabIndex() === $index\"></ax-tab-item>\n }\n </ax-tabs>\n </div>\n <div class=\"ax-overflow-auto\" #content>\n <div class=\"ax-p-4 ax-sticky ax-top-0 ax-z-10 ax-transition-all \" #sticky=\"axpSticky\"\n [axpSticky]=\"'ax-bg-surface ax-shadow-xl'\" [stickyParent]=\"content\" [stickyOffset]=\"10\">\n <ax-search-box look=\"fill\" placeholder=\"e.g. Button, Text, ...\" [(ngModel)]=\"searchTerm\" [delayTime]=\"300\"\n [axAutoFocus]=\"true\">\n <ax-clear-button></ax-clear-button>\n </ax-search-box>\n </div>\n <div class=\"ax-flex ax-flex-col ax-p-4 ax-pt-0\">\n <ng-template #itemTpl let-w>\n <div (click)=\"handleClick($event,w)\"\n class=\"ax-py-2 ax-px-3 ax-rounded-md ax-flex ax-gap-3 ax-items-center ax-group hover:ax-bg-primary-100 dark:hover:ax-bg-primary-800 ax-cursor-pointer\"\n [class.ax-bg-primary-100]=\"isWidgetSelected(w)\">\n <div class=\"ax-w-10 ax-h-10 ax-flex ax-items-center ax-justify-center ax-rounded-md ax-border ax-border-neutral-200 ax-text-neutral-500 ax-bg-on-surface group-hover:ax-bg-primary-200\"\n [class.ax-bg-primary-200]=\"isWidgetSelected(w)\">\n <i [ngClass]=\"w.icon\" class=\"ax-text-lg group-hover:ax-text-primary-700 ax-text-on-surface-fore\"\n [class.ax-text-primary-700]=\"isWidgetSelected(w)\"></i>\n </div>\n <div class=\"ax-flex ax-flex-col ax-gap-1 ax-flex-1\">\n <div class=\"ax-flex ax-items-center ax-gap-2\">\n <div class=\"ax-font-semibold ax-text-sm\">{{w.title}}</div>\n <div (click)=\"handlePinClick($event,w)\">\n @if (w.pinned) {\n <i class=\"fa-solid fa-thumbtack ax-text-sm ax-text-neutral-500 ax-rotate-45\"></i>\n }\n @else {\n <i\n class=\"fa-light fa-thumbtack ax-text-sm ax-text-neutral-500 ax-rotate-45 ax-invisible group-hover:ax-visible\"></i>\n }\n </div>\n </div>\n <span class=\"ax-text-xs ax-text-neutral-400 ax-truncate\">\n {{w.description}}\n </span>\n </div>\n </div>\n </ng-template>\n <div class=\"ax-grid ax-grid-cols-2 ax-gap-2 \">\n @for(w of pinnedList();track $index)\n {\n <ng-container *ngTemplateOutlet=\"itemTpl;context:{ $implicit: w}\"></ng-container>\n }\n </div>\n @if(pinnedList().length)\n {\n <hr class=\"ax-my-4 ax-border-dashed\">\n }\n <div class=\"ax-grid ax-grid-cols-2 ax-gap-2 \">\n @for(w of regularList();track $index)\n {\n <ng-container *ngTemplateOutlet=\"itemTpl;context:{ $implicit: w}\"></ng-container>\n }\n </div>\n </div>\n </div>\n</div>\n@if(selectedWidgets().length)\n{\n<ax-footer>\n <ax-suffix>\n <ax-button look=\"solid\" color=\"primary\" text=\"{{ selectedWidgets().length }} Selected\"\n (onClick)=\"handleConfirmSelection()\"></ax-button>\n </ax-suffix>\n</ax-footer>\n}", styles: [".selected-widget{border-width:1px;--tw-border-opacity: 1;border-color:rgba(var(--ax-color-primary-500),var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgba(var(--ax-color-primary-100),var(--tw-bg-opacity, 1))}.selected-widget i{--tw-text-opacity: 1;color:rgba(var(--ax-color-primary-500),var(--tw-text-opacity, 1))}\n"] }]
123
+ }] });
124
+
125
+ export { AXPTemplateWidgetPickerComponent };
126
+ //# sourceMappingURL=acorex-modules-form-template-management-template-picker.component-CsGnikzF.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-modules-form-template-management-template-picker.component-CsGnikzF.mjs","sources":["../../../../libs/modules/form-template-management/src/lib/components/widgets/template-picker/template-picker.component.ts","../../../../libs/modules/form-template-management/src/lib/components/widgets/template-picker/template-picker.component.html"],"sourcesContent":["import { AXButtonModule } from '@acorex/components/button';\nimport { AXCommonModule } from '@acorex/components/common';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXBasePageComponent } from '@acorex/components/page';\nimport { AXSearchBoxModule } from '@acorex/components/search-box';\nimport { AXTabsModule, AXTabStripChangedEvent } from '@acorex/components/tabs';\nimport { AXPSettingScope, AXPSettingValueProviderService, AXPStickyDirective } from '@acorex/platform/common';\nimport { AXPWidgetGroup } from '@acorex/platform/layout/builder';\nimport { CommonModule } from '@angular/common';\nimport { Component, computed, inject, model, signal, ViewEncapsulation } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { orderBy, uniqBy } from 'lodash-es';\nimport { AXPTemplateWidgetListItem } from './template.provider';\n\nexport interface AXPDisplayWidgetProvided extends AXPTemplateWidgetListItem {\n pinned: boolean;\n}\n\n@Component({\n imports: [\n CommonModule,\n AXCommonModule,\n FormsModule,\n AXButtonModule,\n AXDecoratorModule,\n AXTabsModule,\n AXSearchBoxModule,\n AXPStickyDirective,\n ],\n templateUrl: './template-picker.component.html',\n encapsulation: ViewEncapsulation.None,\n styleUrls: ['./template-picker.component.scss']\n})\nexport class AXPTemplateWidgetPickerComponent extends AXBasePageComponent {\n private settingService = inject(AXPSettingValueProviderService);\n\n private readonly pinnedSettingKey = 'forms:templates:picker:pinned';\n\n protected searchTerm = model('');\n\n // Signals\n private widgets: AXPDisplayWidgetProvided[] = [];\n private displayWidgets = signal<AXPDisplayWidgetProvided[]>([]);\n\n // Signal to track selected widgets\n protected selectedWidgets = signal<AXPDisplayWidgetProvided[]>([]);\n\n // Computed for filtered and ordered widget list\n private orderedList = computed(() => {\n const search = this.searchTerm().toLowerCase();\n const selectedTabName = this.selectedTab().name;\n\n return orderBy(\n this.displayWidgets().filter((w) => {\n const matchesTab = selectedTabName === 'all' || w.group.name === selectedTabName;\n const matchesSearch =\n !search || w.title.toLowerCase().includes(search) || w.description?.toLowerCase().includes(search);\n return matchesTab && matchesSearch;\n }),\n ['pinned', 'title'],\n ['desc', 'asc']\n );\n });\n\n // Pinned and regular lists\n protected pinnedList = computed(() => this.orderedList().filter((c) => c.pinned));\n protected regularList = computed(() => this.orderedList().filter((c) => !c.pinned));\n\n protected tabs = computed<AXPWidgetGroup[]>(() => {\n const uniqueOrderedWidgets = orderBy(\n uniqBy(\n [{ name: 'all', title: 'All', order: 0 }, ...this.widgets.map(c => c.group)],\n (c) => c.name // or another property to ensure uniqueness\n ),\n (c) => c.order\n );\n return uniqueOrderedWidgets;\n })\n protected currentTabIndex = signal(0);\n protected selectedTab = computed(() => this.tabs()[this.currentTabIndex()]);\n\n protected override async ngOnInit() {\n super.ngOnInit();\n const pinnedWidgets = (await this.settingService.get<string[]>(this.pinnedSettingKey)) || [];\n this.displayWidgets.set(this.widgets.map((c) => ({ ...c, pinned: pinnedWidgets.includes(c.id), icon: c.icon ?? 'fa-solid fa-file-invoice' })));\n }\n\n protected handleTabChange(event: AXTabStripChangedEvent): void {\n const indx = event.index;\n if (this.currentTabIndex() != indx) {\n this.currentTabIndex.set(indx);\n }\n }\n\n protected handleClick(event: MouseEvent, widget: AXPDisplayWidgetProvided) {\n if (event.ctrlKey) {\n const currentSelection = this.selectedWidgets();\n const isAlreadySelected = currentSelection.some((w) => w === widget);\n\n if (isAlreadySelected) {\n // Deselect widget if already selected\n this.selectedWidgets.set(currentSelection.filter((w) => w !== widget));\n } else {\n // Add widget to selection\n this.selectedWidgets.set([...currentSelection, widget]);\n }\n } else {\n // If CTRL is not pressed, select only the clicked widget\n this.close({ widgets: [widget] });\n }\n }\n\n protected async handlePinClick(e: MouseEvent, widget: AXPDisplayWidgetProvided) {\n e.stopPropagation();\n widget.pinned = !widget.pinned;\n // Get the current list of pinned widgets from settings\n let pinnedWidgets = (await this.settingService.get<string[]>(this.pinnedSettingKey)) || [];\n\n // Update the list of pinned widgets based on the pinned status\n if (widget.pinned) {\n if (!pinnedWidgets.includes(widget.id)) {\n pinnedWidgets.push(widget.id);\n }\n } else {\n pinnedWidgets = pinnedWidgets.filter((name) => name !== widget.id);\n }\n\n // Save the updated list of pinned widgets\n await this.settingService.scope(AXPSettingScope.User).set(this.pinnedSettingKey, pinnedWidgets);\n\n // Trigger a re-render of the widgets\n this.displayWidgets.set([...this.displayWidgets()]);\n }\n\n // Check if a widget is selected\n protected isWidgetSelected(widget: AXPDisplayWidgetProvided): boolean {\n return this.selectedWidgets().includes(widget);\n }\n\n protected handleConfirmSelection(): void {\n this.close({ widgets: this.selectedWidgets() });\n }\n}\n","<div class=\"ax-flex ax-flex-col lg:ax-h-[75vh]\">\n <div>\n <ax-tabs [look]=\"'with-line'\" (onActiveTabChanged)=\"handleTabChange($event)\">\n @for(w of tabs();track $index)\n {\n <ax-tab-item [text]=\"w.title\" [key]=\"$index.toString()\"\n [active]=\"currentTabIndex() === $index\"></ax-tab-item>\n }\n </ax-tabs>\n </div>\n <div class=\"ax-overflow-auto\" #content>\n <div class=\"ax-p-4 ax-sticky ax-top-0 ax-z-10 ax-transition-all \" #sticky=\"axpSticky\"\n [axpSticky]=\"'ax-bg-surface ax-shadow-xl'\" [stickyParent]=\"content\" [stickyOffset]=\"10\">\n <ax-search-box look=\"fill\" placeholder=\"e.g. Button, Text, ...\" [(ngModel)]=\"searchTerm\" [delayTime]=\"300\"\n [axAutoFocus]=\"true\">\n <ax-clear-button></ax-clear-button>\n </ax-search-box>\n </div>\n <div class=\"ax-flex ax-flex-col ax-p-4 ax-pt-0\">\n <ng-template #itemTpl let-w>\n <div (click)=\"handleClick($event,w)\"\n class=\"ax-py-2 ax-px-3 ax-rounded-md ax-flex ax-gap-3 ax-items-center ax-group hover:ax-bg-primary-100 dark:hover:ax-bg-primary-800 ax-cursor-pointer\"\n [class.ax-bg-primary-100]=\"isWidgetSelected(w)\">\n <div class=\"ax-w-10 ax-h-10 ax-flex ax-items-center ax-justify-center ax-rounded-md ax-border ax-border-neutral-200 ax-text-neutral-500 ax-bg-on-surface group-hover:ax-bg-primary-200\"\n [class.ax-bg-primary-200]=\"isWidgetSelected(w)\">\n <i [ngClass]=\"w.icon\" class=\"ax-text-lg group-hover:ax-text-primary-700 ax-text-on-surface-fore\"\n [class.ax-text-primary-700]=\"isWidgetSelected(w)\"></i>\n </div>\n <div class=\"ax-flex ax-flex-col ax-gap-1 ax-flex-1\">\n <div class=\"ax-flex ax-items-center ax-gap-2\">\n <div class=\"ax-font-semibold ax-text-sm\">{{w.title}}</div>\n <div (click)=\"handlePinClick($event,w)\">\n @if (w.pinned) {\n <i class=\"fa-solid fa-thumbtack ax-text-sm ax-text-neutral-500 ax-rotate-45\"></i>\n }\n @else {\n <i\n class=\"fa-light fa-thumbtack ax-text-sm ax-text-neutral-500 ax-rotate-45 ax-invisible group-hover:ax-visible\"></i>\n }\n </div>\n </div>\n <span class=\"ax-text-xs ax-text-neutral-400 ax-truncate\">\n {{w.description}}\n </span>\n </div>\n </div>\n </ng-template>\n <div class=\"ax-grid ax-grid-cols-2 ax-gap-2 \">\n @for(w of pinnedList();track $index)\n {\n <ng-container *ngTemplateOutlet=\"itemTpl;context:{ $implicit: w}\"></ng-container>\n }\n </div>\n @if(pinnedList().length)\n {\n <hr class=\"ax-my-4 ax-border-dashed\">\n }\n <div class=\"ax-grid ax-grid-cols-2 ax-gap-2 \">\n @for(w of regularList();track $index)\n {\n <ng-container *ngTemplateOutlet=\"itemTpl;context:{ $implicit: w}\"></ng-container>\n }\n </div>\n </div>\n </div>\n</div>\n@if(selectedWidgets().length)\n{\n<ax-footer>\n <ax-suffix>\n <ax-button look=\"solid\" color=\"primary\" text=\"{{ selectedWidgets().length }} Selected\"\n (onClick)=\"handleConfirmSelection()\"></ax-button>\n </ax-suffix>\n</ax-footer>\n}"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAiCM,MAAO,gCAAiC,SAAQ,mBAAmB,CAAA;AAfzE,IAAA,WAAA,GAAA;;AAgBU,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,8BAA8B,CAAC;QAE9C,IAAgB,CAAA,gBAAA,GAAG,+BAA+B;AAEzD,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAC,EAAE,CAAC;;QAGxB,IAAO,CAAA,OAAA,GAA+B,EAAE;AACxC,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAA6B,EAAE,CAAC;;AAGrD,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAA6B,EAAE,CAAC;;AAG1D,QAAA,IAAA,CAAA,WAAW,GAAG,QAAQ,CAAC,MAAK;YAClC,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC,WAAW,EAAE;YAC9C,MAAM,eAAe,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,IAAI;AAE/C,YAAA,OAAO,OAAO,CACZ,IAAI,CAAC,cAAc,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,KAAI;AACjC,gBAAA,MAAM,UAAU,GAAG,eAAe,KAAK,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,eAAe;AAChF,gBAAA,MAAM,aAAa,GACjB,CAAC,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC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,EAAA,MAAA,EAAA,CAAA,gVAAA,CAAA,EAAA;;;;;"}
@@ -16,6 +16,10 @@ class AXPTemplateWidgetEditComponent extends AXPWidgetComponent {
16
16
  this.templateProvider = inject(AXPTemplateWidgetProviderService);
17
17
  this.templateId = computed(() => this.options()['templateId']);
18
18
  this.nodes = signal([]);
19
+ this.allowRemove = computed(() => this.options()['allowRemove'] ?? false);
20
+ this.showRemove = computed(() => {
21
+ return this.allowRemove() && this.parent?.config.name != 'template';
22
+ });
19
23
  //
20
24
  effect(async () => {
21
25
  this.nodes.set([]);
@@ -44,7 +48,7 @@ class AXPTemplateWidgetEditComponent extends AXPWidgetComponent {
44
48
  }
45
49
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPTemplateWidgetEditComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
46
50
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXPTemplateWidgetEditComponent, isStandalone: true, selector: "axp-template-widget-edit", usesInheritance: true, ngImport: i0, template: `
47
- @if(nodes()) {
51
+ @if(nodes().length>0) {
48
52
  <ng-container>
49
53
  @for (node of nodes(); track $index) {
50
54
  <ng-container axp-widget-renderer
@@ -54,14 +58,18 @@ class AXPTemplateWidgetEditComponent extends AXPWidgetComponent {
54
58
  >
55
59
  </ng-container>
56
60
  }
61
+ </ng-container>
62
+ @if(showRemove())
63
+ {
57
64
  <div
58
65
  class="ax-text-danger-500 hover:ax-text-danger-800 ax-mt-2 ax-text-xs ax-cursor-pointer"
59
66
  (click)="handleRemoveClick()"
60
67
  >
61
68
  {{ 'remove-template' | translate : { scope: 'form-template-management' } | async }}
62
69
  </div>
63
- </ng-container>
64
- } @else {
70
+ }
71
+ }
72
+ @else {
65
73
  <span
66
74
  class="ax-underline ax-decoration-dotted ax-underline-offset-8 hover:ax-text-primary-500 ax-cursor-pointer"
67
75
  (click)="handleSelectClick()"
@@ -76,7 +84,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
76
84
  args: [{
77
85
  selector: 'axp-template-widget-edit',
78
86
  template: `
79
- @if(nodes()) {
87
+ @if(nodes().length>0) {
80
88
  <ng-container>
81
89
  @for (node of nodes(); track $index) {
82
90
  <ng-container axp-widget-renderer
@@ -86,14 +94,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
86
94
  >
87
95
  </ng-container>
88
96
  }
97
+ </ng-container>
98
+ @if(showRemove())
99
+ {
89
100
  <div
90
101
  class="ax-text-danger-500 hover:ax-text-danger-800 ax-mt-2 ax-text-xs ax-cursor-pointer"
91
102
  (click)="handleRemoveClick()"
92
103
  >
93
104
  {{ 'remove-template' | translate : { scope: 'form-template-management' } | async }}
94
105
  </div>
95
- </ng-container>
96
- } @else {
106
+ }
107
+ }
108
+ @else {
97
109
  <span
98
110
  class="ax-underline ax-decoration-dotted ax-underline-offset-8 hover:ax-text-primary-500 ax-cursor-pointer"
99
111
  (click)="handleSelectClick()"
@@ -108,4 +120,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
108
120
  }], ctorParameters: () => [] });
109
121
 
110
122
  export { AXPTemplateWidgetEditComponent };
111
- //# sourceMappingURL=acorex-modules-form-template-management-template-widget-edit.component-DQw5qvib.mjs.map
123
+ //# sourceMappingURL=acorex-modules-form-template-management-template-widget-edit.component-CVyFN7D9.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-modules-form-template-management-template-widget-edit.component-CVyFN7D9.mjs","sources":["../../../../libs/modules/form-template-management/src/lib/components/widgets/template/template-widget-edit.component.ts"],"sourcesContent":["import { AXTranslationModule } from '@acorex/core/translation';\nimport { AXPLayoutBuilderModule, AXPWidgetComponent, AXPWidgetNode } from '@acorex/platform/layout/builder';\nimport { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, effect, inject, signal } from '@angular/core';\nimport { get, set } from 'lodash-es';\nimport { AXPTemplateWidgetProviderService } from '../template-picker/template.provider';\n\n@Component({\n selector: 'axp-template-widget-edit',\n template: `\n @if(nodes().length>0) {\n <ng-container>\n @for (node of nodes(); track $index) {\n <ng-container axp-widget-renderer\n [node]=\"node\"\n [parentNode]=\"this\"\n [mode]=\"this.mode\"\n >\n </ng-container>\n }\n </ng-container>\n @if(showRemove())\n {\n <div\n class=\"ax-text-danger-500 hover:ax-text-danger-800 ax-mt-2 ax-text-xs ax-cursor-pointer\"\n (click)=\"handleRemoveClick()\"\n >\n {{ 'remove-template' | translate : { scope: 'form-template-management' } | async }}\n </div>\n }\n } \n @else {\n <span\n class=\"ax-underline ax-decoration-dotted ax-underline-offset-8 hover:ax-text-primary-500 ax-cursor-pointer\"\n (click)=\"handleSelectClick()\"\n >\n {{ 'choose-template' | translate : { scope: 'form-template-management' } | async }}\n </span>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [CommonModule, AXPLayoutBuilderModule, AXTranslationModule]\n})\nexport class AXPTemplateWidgetEditComponent extends AXPWidgetComponent<any> {\n private metaKey = '__meta__';\n\n private templateProvider = inject(AXPTemplateWidgetProviderService);\n protected templateId = computed<string>(() => this.options()['templateId'] as string);\n protected nodes = signal<AXPWidgetNode[]>([]);\n protected allowRemove = computed<boolean>(() => this.options()['allowRemove'] as boolean ?? false);\n\n\n protected showRemove = computed(() => {\n return this.allowRemove() && this.parent?.config.name != 'template';\n });\n\n constructor() {\n super();\n //\n effect(\n async () => {\n this.nodes.set([]);\n const value = this.getValue();\n const templateId = get(value, `${this.metaKey}.templateId`) ?? this.templateId();\n if (templateId) {\n const item = await this.templateProvider.get(templateId);\n if (item) {\n this.nodes.set(item.nodes);\n }\n }\n }\n );\n }\n\n protected async handleSelectClick() {\n const result = await this.templateProvider.chooseTemplate();\n if (result) {\n this.setOptions({ templateId: result.id });\n const value = this.getValue() ?? {};\n set(value, this.metaKey, { templateId: result.id });\n this.setValue(value);\n }\n }\n\n protected async handleRemoveClick() {\n this.setOptions({ templateId: null });\n this.setValue(null);\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AA2CM,MAAO,8BAA+B,SAAQ,kBAAuB,CAAA;AAazE,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;QAbD,IAAO,CAAA,OAAA,GAAG,UAAU;AAEpB,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,gCAAgC,CAAC;AACzD,QAAA,IAAA,CAAA,UAAU,GAAG,QAAQ,CAAS,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC,YAAY,CAAW,CAAC;AAC3E,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAkB,EAAE,CAAC;AACnC,QAAA,IAAA,CAAA,WAAW,GAAG,QAAQ,CAAU,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC,aAAa,CAAY,IAAI,KAAK,CAAC;AAGxF,QAAA,IAAA,CAAA,UAAU,GAAG,QAAQ,CAAC,MAAK;AACnC,YAAA,OAAO,IAAI,CAAC,WAAW,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,IAAI,UAAU;AACrE,SAAC,CAAC;;QAKA,MAAM,CACJ,YAAW;AACT,YAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;AAClB,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE;AAC7B,YAAA,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,EAAE,CAAG,EAAA,IAAI,CAAC,OAAO,aAAa,CAAC,IAAI,IAAI,CAAC,UAAU,EAAE;YAChF,IAAI,UAAU,EAAE;gBACd,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,UAAU,CAAC;gBACxD,IAAI,IAAI,EAAE;oBACR,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC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AAA,EAAA,UAAA,EAAA,IAAA,EAAE,sBAAsB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,0BAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,CAAA,YAAA,EAAA,OAAA,EAAA,MAAA,EAAA,MAAA,CAAA,EAAA,QAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,mBAAmB,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,EAAA,CAAA,gBAAA,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAExD,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBApC1C,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,0BAA0B;AACpC,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BT,EAAA,CAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,sBAAsB,EAAE,mBAAmB;AACpE,iBAAA;;;;;"}
@@ -14,7 +14,7 @@ import { AXPWorkflowService, AXPWorkflowAction, AXPWorkflowModule } from '@acore
14
14
  import * as i1 from '@angular/common';
15
15
  import { CommonModule } from '@angular/common';
16
16
  import { AXPDesignerConnector, AXPDesignerService, AXPWidgetDesignerRendererDirective, AXPDesignerAddWidgetMiniButtonComponent } from '@acorex/platform/layout/designer';
17
- import { sortBy, get } from 'lodash-es';
17
+ import { get, sortBy } from 'lodash-es';
18
18
  import { AXPopupService } from '@acorex/components/popup';
19
19
 
20
20
  const AXMFormTemplateManagementModuleConst = {
@@ -103,7 +103,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
103
103
 
104
104
  const AXMFormTemplateTypes = {
105
105
  Form: { id: 10, title: 'Form Template' },
106
- Widget: { id: 20, title: 'Widgets Template' }
106
+ Widget: { id: 20, title: 'Widget Template' },
107
107
  };
108
108
 
109
109
  class AXMFormTemplateManagementModuleEntityProvider {
@@ -114,7 +114,7 @@ class AXMFormTemplateManagementModuleEntityProvider {
114
114
  if (moduleName == AXMFormTemplateManagementModuleConst.moduleName) {
115
115
  switch (entityName) {
116
116
  case AXMFormTemplateManagementModuleConst.categoryEntity:
117
- return (await import('./acorex-modules-form-template-management-category.entity-xUkZHVgy.mjs')).factory(this.injector);
117
+ return (await import('./acorex-modules-form-template-management-category.entity-Cqu3urCo.mjs')).factory(this.injector);
118
118
  case AXMFormTemplateManagementModuleConst.templateEntity:
119
119
  return (await import('./acorex-modules-form-template-management-template.entity-CGhbmYel.mjs')).factory(this.injector);
120
120
  }
@@ -241,7 +241,7 @@ const AXMCreateFormTemplateWorkflow = {
241
241
  input: {
242
242
  title: 'Confirm Action',
243
243
  message: `Would you like to proceed with starting template design?`,
244
- type: 'info',
244
+ type: 'primary',
245
245
  },
246
246
  nextSteps: [
247
247
  {
@@ -341,9 +341,9 @@ class AXPTemplateWidgetProviderImpl {
341
341
  id: c.id,
342
342
  title: c.title,
343
343
  group: {
344
- name: 'other',
344
+ name: c.categoryId,
345
345
  order: 2,
346
- title: "Saved"
346
+ title: get(c, 'category.title') ?? 'Custom'
347
347
  },
348
348
  description: c.description
349
349
  }));
@@ -357,7 +357,7 @@ class AXPTemplateWidgetProviderImpl {
357
357
  return {
358
358
  id: item.id,
359
359
  nodes: page?.children ?? [],
360
- title: item.title
360
+ title: item.title,
361
361
  };
362
362
  }
363
363
  else {
@@ -399,7 +399,7 @@ class AXPTemplateWidgetProviderService {
399
399
  return null;
400
400
  }
401
401
  async chooseTemplate() {
402
- const com = await import('./acorex-modules-form-template-management-template-picker.component-BXOyKuAt.mjs').then((c) => c.AXPTemplateWidgetPickerComponent);
402
+ const com = await import('./acorex-modules-form-template-management-template-picker.component-CsGnikzF.mjs').then((c) => c.AXPTemplateWidgetPickerComponent);
403
403
  const widgets = await this.items({
404
404
  skip: 0,
405
405
  take: 100,
@@ -665,7 +665,7 @@ const AXPTemplateWidget = {
665
665
  component: () => Promise.resolve().then(function () { return templateWidgetView_component; }).then((c) => c.AXPTemplateWidgetViewComponent),
666
666
  },
667
667
  edit: {
668
- component: () => import('./acorex-modules-form-template-management-template-widget-edit.component-DQw5qvib.mjs').then((c) => c.AXPTemplateWidgetEditComponent),
668
+ component: () => import('./acorex-modules-form-template-management-template-widget-edit.component-CVyFN7D9.mjs').then((c) => c.AXPTemplateWidgetEditComponent),
669
669
  },
670
670
  print: {
671
671
  component: () => Promise.resolve().then(function () { return templateWidgetView_component; }).then((c) => c.AXPTemplateWidgetViewComponent),
@@ -693,6 +693,11 @@ class AXMSettingProvider {
693
693
  type: AXPWidgetsCatalog.toggle,
694
694
  },
695
695
  description: 'Enable or disable the history panel for forms.',
696
+ validationRules: [
697
+ {
698
+ rule: 'required',
699
+ },
700
+ ],
696
701
  })
697
702
  .endSection()
698
703
  // Start Saving Section
@@ -701,8 +706,8 @@ class AXMSettingProvider {
701
706
  key: 'auto-save',
702
707
  title: 'Auto Save',
703
708
  scope: 'U',
704
- defaultValue: 3000,
705
709
  isInherited: true,
710
+ defaultValue: false,
706
711
  widget: {
707
712
  type: AXPWidgetsCatalog.toggle,
708
713
  },
@@ -712,12 +717,18 @@ class AXMSettingProvider {
712
717
  key: 'auto-save-interval',
713
718
  title: 'Auto Save Interval',
714
719
  scope: 'U',
715
- defaultValue: 3000,
716
720
  isInherited: true,
721
+ defaultValue: 1,
717
722
  widget: {
718
723
  type: AXPWidgetsCatalog.number,
724
+ options: {
725
+ visibility: `{{ context.eval('auto-save') }}`,
726
+ hasClearButton: false,
727
+ minValue: 1,
728
+ maxValue: 60,
729
+ }
719
730
  },
720
- description: 'Set the time interval (in seconds) for auto-saving form data.',
731
+ description: 'Set the time interval (in minites) for auto-saving form data.',
721
732
  })
722
733
  .endSection()
723
734
  // End Form Template Group