@acorex/platform 20.3.0-next.19 → 20.3.0-next.20

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.
@@ -1,11 +1,11 @@
1
1
  import { AXToastService } from '@acorex/components/toast';
2
2
  import * as i0 from '@angular/core';
3
3
  import { inject, Injectable } from '@angular/core';
4
- import { AXPEntityDynamicFormDialogService, AXPEntityDefinitionRegistryService } from './acorex-platform-layout-entity.mjs';
4
+ import { AXPEntityDynamicDialogService, AXPEntityDefinitionRegistryService } from './acorex-platform-layout-entity.mjs';
5
5
 
6
6
  class AXPCreateEntityCommand {
7
7
  constructor() {
8
- this.entityForm = inject(AXPEntityDynamicFormDialogService);
8
+ this.entityForm = inject(AXPEntityDynamicDialogService);
9
9
  this.entityService = inject(AXPEntityDefinitionRegistryService);
10
10
  this.toastService = inject(AXToastService);
11
11
  this.context = {};
@@ -49,4 +49,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
49
49
  }] });
50
50
 
51
51
  export { AXPCreateEntityCommand };
52
- //# sourceMappingURL=acorex-platform-layout-entity-create-entity.command-CFBqiwfy.mjs.map
52
+ //# sourceMappingURL=acorex-platform-layout-entity-create-entity.command-BXExgI3W.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-layout-entity-create-entity.command-BXExgI3W.mjs","sources":["../tmp-esm2022/layout/entity/lib/commands/create-entity.command.js"],"sourcesContent":["import { AXToastService } from '@acorex/components/toast';\nimport { inject, Injectable } from '@angular/core';\nimport { AXPEntityDefinitionRegistryService } from '../entity-registery.service';\nimport { AXPEntityDynamicDialogService } from '../services/entity-forms/entity-dynamic-form-dialog.service';\nimport * as i0 from \"@angular/core\";\nexport class AXPCreateEntityCommand {\n constructor() {\n this.entityForm = inject(AXPEntityDynamicDialogService);\n this.entityService = inject(AXPEntityDefinitionRegistryService);\n this.toastService = inject(AXToastService);\n this.context = {};\n }\n async execute(input) {\n const { entity, entityInfo, data, options, metadata } = input;\n const [moduleName, entityName] = (entity || '').split('.');\n const entityRef = await this.entityService.resolve(moduleName, entityName);\n console.log({ input });\n try {\n let chain = this.entityForm.entity(`${moduleName}.${entityName}`).create();\n if (entityInfo?.title) {\n chain = chain.title(`Create ${entityInfo.title}`);\n }\n if (data) {\n chain = chain.context(data);\n }\n const dialogRef = await chain.show();\n dialogRef.setLoading(true);\n const context = dialogRef.context();\n const createFn = entityRef.commands?.create?.execute;\n const result = await createFn(context);\n if (result) {\n dialogRef.close();\n }\n dialogRef.setLoading(false);\n return result;\n }\n catch (error) {\n throw error;\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"20.3.3\", ngImport: i0, type: AXPCreateEntityCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }\n static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"20.3.3\", ngImport: i0, type: AXPCreateEntityCommand, providedIn: 'root' }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"20.3.3\", ngImport: i0, type: AXPCreateEntityCommand, decorators: [{\n type: Injectable,\n args: [{\n providedIn: 'root',\n }]\n }] });\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JlYXRlLWVudGl0eS5jb21tYW5kLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9wbGF0Zm9ybS9sYXlvdXQvZW50aXR5L3NyYy9saWIvY29tbWFuZHMvY3JlYXRlLWVudGl0eS5jb21tYW5kLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUUxRCxPQUFPLEVBQUUsTUFBTSxFQUFFLFVBQVUsRUFBRSxNQUFNLGVB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EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC;AAChK;AACA,EAAE,CAAC,wBAAwB,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,sBAAsB,EAAE,UAAU,EAAE,CAAC;AAChI,YAAY,IAAI,EAAE,UAAU;AAC5B,YAAY,IAAI,EAAE,CAAC;AACnB,oBAAoB,UAAU,EAAE,MAAM;AACtC,iBAAiB;AACjB,SAAS,CAAC,EAAE,CAAC;;;;"}
@@ -50,7 +50,8 @@ import * as i6$2 from '@acorex/components/search-box';
50
50
  import { AXSearchBoxComponent, AXSearchBoxModule } from '@acorex/components/search-box';
51
51
  import * as i6$1 from '@acorex/components/tag-box';
52
52
  import { AXTagBoxComponent, AXTagBoxModule } from '@acorex/components/tag-box';
53
- import { AXPDataSelectorService, AXPWidgetPropertyViewerComponent, AXPDynamicFormBuilderService } from '@acorex/platform/layout/components';
53
+ import { AXPDataSelectorService, AXPWidgetPropertyViewerComponent } from '@acorex/platform/layout/components';
54
+ import { AXPLayoutBuilderService } from '@acorex/platform/layout/builder';
54
55
  import { transform, isEqual as isEqual$1 } from 'lodash';
55
56
 
56
57
  //#endregion
@@ -7446,7 +7447,7 @@ class AXPEntityModule {
7446
7447
  },
7447
7448
  {
7448
7449
  key: 'Entity:Create',
7449
- command: () => import('./acorex-platform-layout-entity-create-entity.command-CFBqiwfy.mjs').then((c) => c.AXPCreateEntityCommand),
7450
+ command: () => import('./acorex-platform-layout-entity-create-entity.command-BXExgI3W.mjs').then((c) => c.AXPCreateEntityCommand),
7450
7451
  },
7451
7452
  ]),
7452
7453
  provideQuerySetups([
@@ -7567,7 +7568,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
7567
7568
  },
7568
7569
  {
7569
7570
  key: 'Entity:Create',
7570
- command: () => import('./acorex-platform-layout-entity-create-entity.command-CFBqiwfy.mjs').then((c) => c.AXPCreateEntityCommand),
7571
+ command: () => import('./acorex-platform-layout-entity-create-entity.command-BXExgI3W.mjs').then((c) => c.AXPCreateEntityCommand),
7571
7572
  },
7572
7573
  ]),
7573
7574
  provideQuerySetups([
@@ -7682,44 +7683,44 @@ var getEntityDetails_query = /*#__PURE__*/Object.freeze({
7682
7683
  });
7683
7684
 
7684
7685
  //#endregion
7685
- class AXPEntityDynamicFormDialogService {
7686
+ class AXPEntityDynamicDialogService {
7686
7687
  constructor() {
7687
7688
  //#region ---- Services & Dependencies ----
7688
7689
  this.entityRegistry = inject(AXPEntityDefinitionRegistryService);
7689
- this.formBuilder = inject(AXPDynamicFormBuilderService);
7690
+ this.layoutBuilder = inject(AXPLayoutBuilderService);
7690
7691
  this.layoutTheme = inject(AXPLayoutThemeService);
7691
7692
  }
7692
7693
  //#endregion
7693
7694
  //#region ---- Public API ----
7694
7695
  entity(fullName) {
7695
- return new InterfaceSelector(this.entityRegistry, this.formBuilder, this.layoutTheme, fullName);
7696
+ return new InterfaceSelector(this.entityRegistry, this.layoutBuilder, this.layoutTheme, fullName);
7696
7697
  }
7697
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXPEntityDynamicFormDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
7698
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXPEntityDynamicFormDialogService, providedIn: 'root' }); }
7698
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXPEntityDynamicDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
7699
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXPEntityDynamicDialogService, providedIn: 'root' }); }
7699
7700
  }
7700
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXPEntityDynamicFormDialogService, decorators: [{
7701
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXPEntityDynamicDialogService, decorators: [{
7701
7702
  type: Injectable,
7702
7703
  args: [{ providedIn: 'root' }]
7703
7704
  }] });
7704
7705
  //#region ---- Builders ----
7705
7706
  class InterfaceSelector {
7706
- constructor(entityRegistry, formBuilder, layoutTheme, fullName) {
7707
+ constructor(entityRegistry, layoutBuilder, layoutTheme, fullName) {
7707
7708
  this.entityRegistry = entityRegistry;
7708
- this.formBuilder = formBuilder;
7709
+ this.layoutBuilder = layoutBuilder;
7709
7710
  this.layoutTheme = layoutTheme;
7710
7711
  this.fullName = fullName;
7711
7712
  }
7712
7713
  create() {
7713
- return new PropertyFilter(this.entityRegistry, this.formBuilder, this.layoutTheme, this.fullName, 'create');
7714
+ return new PropertyFilter(this.entityRegistry, this.layoutBuilder, this.layoutTheme, this.fullName, 'create');
7714
7715
  }
7715
7716
  update(id) {
7716
- return new PropertyFilter(this.entityRegistry, this.formBuilder, this.layoutTheme, this.fullName, 'update', id);
7717
+ return new PropertyFilter(this.entityRegistry, this.layoutBuilder, this.layoutTheme, this.fullName, 'update', id);
7717
7718
  }
7718
7719
  }
7719
7720
  class PropertyFilter {
7720
- constructor(entityRegistry, formBuilder, layoutTheme, fullName, kind, recordId) {
7721
+ constructor(entityRegistry, layoutBuilder, layoutTheme, fullName, kind, recordId) {
7721
7722
  this.entityRegistry = entityRegistry;
7722
- this.formBuilder = formBuilder;
7723
+ this.layoutBuilder = layoutBuilder;
7723
7724
  this.layoutTheme = layoutTheme;
7724
7725
  this.fullName = fullName;
7725
7726
  this.kind = kind;
@@ -7762,6 +7763,10 @@ class PropertyFilter {
7762
7763
  this.extraFieldsByGroup.set(groupId, list);
7763
7764
  return this;
7764
7765
  }
7766
+ mode(mode) {
7767
+ this.externalMode = mode;
7768
+ return this;
7769
+ }
7765
7770
  async show() {
7766
7771
  const { moduleName, entityName } = parseEntityFullName(this.fullName);
7767
7772
  const entity = await this.entityRegistry.resolve(moduleName, entityName);
@@ -7769,62 +7774,68 @@ class PropertyFilter {
7769
7774
  if (!iface) {
7770
7775
  throw new Error(`Entity interface not found: ${entity.module}.${entity.name}.interfaces.master.${this.kind}`);
7771
7776
  }
7772
- // Build dialog using DynamicFormBuilder
7773
- const dialog = this.formBuilder.dialog();
7774
7777
  // Title and size
7775
7778
  const title = this.overrideTitle || entity.formats?.individual || entity.title || `${entity.module}.${entity.name}`;
7776
- dialog.title(title);
7777
- dialog.look('container');
7778
- dialog.size(this.externalSize ?? (this.layoutTheme.isMobileDevice() ? 'full' : 'md'));
7779
- dialog.closeButton(true);
7780
- // Build groups and fields preserving interface section order
7779
+ // Build content using LayoutBuilder
7781
7780
  const sections = (iface.sections ?? []).slice();
7782
7781
  const entityProps = (entity.properties ?? []).slice();
7783
7782
  const nameToViewLayout = buildViewLayoutMap(iface.properties ?? []);
7784
7783
  const allowedNames = this.computeAllowedNames(entityProps.map((p) => p.name));
7785
- for (const section of sections) {
7786
- const groupId = section.id;
7787
- const groupProps = entityProps.filter((p) => p.groupId === groupId && allowedNames.has(p.name));
7788
- const extraFields = this.extraFieldsByGroup.get(groupId) ?? [];
7789
- if (groupProps.length === 0 && extraFields.length === 0) {
7790
- continue;
7791
- }
7792
- dialog.group(groupId, (g) => {
7793
- g.title((getGroupTitle(entity, groupId) || groupId));
7794
- // Preserve properties order as defined in interface.properties (if present), otherwise entity.properties order
7795
- const orderedProps = orderProperties(groupProps, iface.properties ?? []);
7796
- for (const prop of orderedProps) {
7797
- const viewLayout = nameToViewLayout.get(prop.name);
7798
- const fieldPath = buildFieldPath(prop, iface.properties ?? []);
7799
- g.field(fieldPath, (f) => {
7800
- // Title & description
7801
- f.title(prop.title);
7802
- // Options (default/hidden/readonly/disabled)
7803
- f.options({
7804
- defaultValue: prop.schema?.defaultValue,
7805
- hidden: prop.schema?.hidden,
7806
- readonly: prop.schema?.readonly,
7807
- disabled: false,
7808
- });
7809
- // Layout mapping (per-field). Only colSpan is supported by dynamic-form per breakpoint.
7810
- const fieldLayout = toFieldLayout(viewLayout?.layout);
7811
- if (fieldLayout) {
7812
- f.layout(fieldLayout);
7784
+ const dialog = this.layoutBuilder.create().dialog((d) => {
7785
+ d.setTitle(title);
7786
+ d.setSize(this.externalSize ?? (this.layoutTheme.isMobileDevice() ? 'full' : 'md'));
7787
+ d.setCloseButton(true);
7788
+ d.content((layout) => {
7789
+ layout.mode(this.externalMode ?? 'edit');
7790
+ for (const section of sections) {
7791
+ const groupId = section.id;
7792
+ const groupProps = entityProps.filter((p) => p.groupId === groupId && allowedNames.has(p.name));
7793
+ const extraFields = this.extraFieldsByGroup.get(groupId) ?? [];
7794
+ if (groupProps.length === 0 && extraFields.length === 0) {
7795
+ continue;
7796
+ }
7797
+ layout.fieldset((fs) => {
7798
+ fs.setTitle((getGroupTitle(entity, groupId) || groupId));
7799
+ // Preserve properties order as defined in interface.properties (if present), otherwise entity.properties order
7800
+ const orderedProps = orderProperties(groupProps, iface.properties ?? []);
7801
+ for (const prop of orderedProps) {
7802
+ const viewLayout = nameToViewLayout.get(prop.name);
7803
+ const fieldPath = buildFieldPath(prop, iface.properties ?? []);
7804
+ fs.formField(prop.title, (field) => {
7805
+ // Path & field-level visibility/readonly
7806
+ field.path(fieldPath);
7807
+ if (prop.schema?.hidden) {
7808
+ field.visible(false);
7809
+ }
7810
+ if (prop.schema?.readonly) {
7811
+ field.readonly(true);
7812
+ }
7813
+ // Layout mapping (per-field). Only colSpan is supported by dynamic-form per breakpoint.
7814
+ const fieldLayout = toFieldLayout(viewLayout?.layout);
7815
+ if (fieldLayout) {
7816
+ field.layout(fieldLayout);
7817
+ }
7818
+ // Widget mapping (generic to allow all widget types)
7819
+ const widgetType = prop.schema?.interface?.type || '';
7820
+ const widgetOptions = buildWidgetOptions(prop);
7821
+ field.customWidget(widgetType, widgetOptions);
7822
+ });
7823
+ }
7824
+ // Append any extra fields requested by the caller for this group
7825
+ for (const extra of extraFields) {
7826
+ const label = extra.path?.split('.').slice(-1)[0] || extra.path;
7827
+ fs.formField(label, (f) => {
7828
+ const legacy = toCompatFormFieldBuilder(f);
7829
+ legacy.path(extra.path);
7830
+ extra.delegate?.(legacy);
7831
+ });
7813
7832
  }
7814
- // Widget mapping (generic to allow all widget types)
7815
- const widgetType = prop.schema?.interface?.type || '';
7816
- const widgetOptions = buildWidgetOptions(prop);
7817
- f.widget(widgetType, widgetOptions);
7818
7833
  });
7819
7834
  }
7820
- // Append any extra fields requested by the caller for this group
7821
- for (const extra of extraFields) {
7822
- g.field(extra.path, extra.delegate);
7823
- }
7824
7835
  });
7825
- }
7826
- // Actions: external if provided, otherwise default cancel/submit
7827
- dialog.actions(this.externalActionsDelegate ?? ((a) => a.cancel().submit()));
7836
+ // Actions: external if provided, otherwise default cancel/submit
7837
+ d.setActions(this.externalActionsDelegate ?? ((a) => a.cancel().submit()));
7838
+ });
7828
7839
  // Context: load record by id for update and merge with provided context (context overrides)
7829
7840
  let baseContext = {};
7830
7841
  if (this.kind === 'update') {
@@ -7848,8 +7859,9 @@ class PropertyFilter {
7848
7859
  catch {
7849
7860
  baseContext = baseContext ?? {};
7850
7861
  }
7862
+ console.log(this['recordId']);
7851
7863
  const effectiveContext = merge({}, baseContext ?? {}, this.initialContext ?? {});
7852
- dialog.context(effectiveContext);
7864
+ dialog.setContext(effectiveContext);
7853
7865
  return await dialog.show();
7854
7866
  }
7855
7867
  computeAllowedNames(allNames) {
@@ -7937,6 +7949,17 @@ function getGroupTitle(entity, groupId) {
7937
7949
  const g = (entity.groups || []).find((x) => x.id === groupId);
7938
7950
  return g?.title;
7939
7951
  }
7952
+ function toCompatFormFieldBuilder(field) {
7953
+ return {
7954
+ ...field,
7955
+ path: (p) => field.path(p),
7956
+ layout: (c) => field.layout(c),
7957
+ visible: (cond) => field.visible(cond),
7958
+ readonly: (cond) => field.readonly(cond),
7959
+ customWidget: (type, options) => field.customWidget(type, options),
7960
+ mode: (mode) => field.mode(mode),
7961
+ };
7962
+ }
7940
7963
 
7941
7964
  /**
7942
7965
  * Error type that can be thrown by middlewares to abort the chain with a structured payload.
@@ -8257,5 +8280,5 @@ function detectEntityChanges(oldObj, newObj) {
8257
8280
  * Generated bundle index. Do not edit.
8258
8281
  */
8259
8282
 
8260
- export { AXMEntityCrudService, AXMEntityCrudServiceImpl, AXPCreateEntityWorkflow, AXPDataSeederService, AXPDeleteEntityWorkflow, AXPEntityApplyUpdatesAction, AXPEntityCommandTriggerViewModel, AXPEntityCreateEvent, AXPEntityCreatePopupAction, AXPEntityCreateSubmittedAction, AXPEntityCreateViewElementViewModel, AXPEntityCreateViewModelFactory, AXPEntityCreateViewSectionViewModel, AXPEntityDataProvider, AXPEntityDataProviderImpl, AXPEntityDataSelectorService, AXPEntityDefinitionRegistryService, AXPEntityDeletedEvent, AXPEntityDetailListViewModel, AXPEntityDetailPopoverComponent, AXPEntityDetailPopoverService, AXPEntityDetailViewModelFactory, AXPEntityDetailViewModelResolver, AXPEntityDynamicFormDialogService, AXPEntityEventDispatcherService, AXPEntityListTableService, AXPEntityListViewColumnViewModel, AXPEntityListViewModelFactory, AXPEntityListViewModelResolver, AXPEntityListWidget, AXPEntityListWidgetViewComponent, AXPEntityMasterCreateViewModel, AXPEntityMasterListViewModel, AXPEntityMasterListViewQueryViewModel, AXPEntityMasterSingleElementViewModel, AXPEntityMasterSingleViewGroupViewModel, AXPEntityMasterSingleViewModel, AXPEntityMasterUpdateElementViewModel, AXPEntityMasterUpdateViewModel, AXPEntityMasterUpdateViewModelFactory, AXPEntityMiddleware, AXPEntityModifyConfirmedAction, AXPEntityModifyEvent, AXPEntityModifySectionPopupAction, AXPEntityModule, AXPEntityPerformDeleteAction, AXPEntityReferenceWidget, AXPEntityReferenceWidgetColumnComponent, AXPEntityReferenceWidgetDesignerComponent, AXPEntityReferenceWidgetEditComponent, AXPEntityReferenceWidgetPrintComponent, AXPEntityReferenceWidgetViewComponent, AXPEntityResolver, AXPEntityService, AXPEntityStorageService, AXPEntityUpdateViewSectionViewModel, AXPGetEntityDetailsQuery, AXPLookupFilterWidget, AXPLookupFilterWidgetEditComponent, AXPLookupWidget, AXPLookupWidgetColumnComponent, AXPLookupWidgetEditComponent, AXPLookupWidgetViewComponent, AXPMiddlewareAbortError, AXPMiddlewareEntityStorageService, AXPModifyEntitySectionWorkflow, AXPOpenEntityDetailsCommand, AXPQuickEntityModifyPopupAction, AXPQuickModifyEntityWorkflow, AXPShowDetailViewAction, AXPShowDetailsViewWorkflow, AXPShowListViewAction, AXPShowListViewWorkflow, AXPTagableBoxWidget, AXPTagableBoxWidgetColumnComponent, AXPTagableBoxWidgetEditComponent, AXPTagableBoxWidgetFilterComponent, AXPTagableBoxWidgetPrintComponent, AXPTagableBoxWidgetViewComponent, AXPWidgetSelectorWidget, AXPWidgetSelectorWidgetEditComponent, AXPWidgetSelectorWidgetViewComponent, AXP_DATA_SEEDER_TOKEN, AXP_ENTITY_ACTION_PLUGIN, AXP_ENTITY_CONFIG_TOKEN, AXP_ENTITY_DEFINITION_LOADER, AXP_ENTITY_MODIFIER, AXP_ENTITY_STORAGE_BACKEND, AXP_ENTITY_STORAGE_MIDDLEWARE, DEFAULT_COLUMN_WIDTHS, actionExists, columnWidthMiddlewareFactory, columnWidthMiddlewareProvider, createColumnWidthMiddlewareProvider, createModifierContext, detectEntityChanges, ensureListActions, entityDetailsCreateActions, entityDetailsCrudActions, entityDetailsEditAction, entityDetailsReferenceCondition, entityDetailsReferenceCreateActions, entityDetailsSimpleCondition, entityMasterBulkDeleteAction, entityMasterCreateAction, entityMasterCrudActions, entityMasterDeleteAction, entityMasterRecordActions, entityMasterViewAction, entityOverrideDetailsViewAction, eventDispatchMiddleware, isAXPMiddlewareAbortError };
8283
+ export { AXMEntityCrudService, AXMEntityCrudServiceImpl, AXPCreateEntityWorkflow, AXPDataSeederService, AXPDeleteEntityWorkflow, AXPEntityApplyUpdatesAction, AXPEntityCommandTriggerViewModel, AXPEntityCreateEvent, AXPEntityCreatePopupAction, AXPEntityCreateSubmittedAction, AXPEntityCreateViewElementViewModel, AXPEntityCreateViewModelFactory, AXPEntityCreateViewSectionViewModel, AXPEntityDataProvider, AXPEntityDataProviderImpl, AXPEntityDataSelectorService, AXPEntityDefinitionRegistryService, AXPEntityDeletedEvent, AXPEntityDetailListViewModel, AXPEntityDetailPopoverComponent, AXPEntityDetailPopoverService, AXPEntityDetailViewModelFactory, AXPEntityDetailViewModelResolver, AXPEntityDynamicDialogService, AXPEntityEventDispatcherService, AXPEntityListTableService, AXPEntityListViewColumnViewModel, AXPEntityListViewModelFactory, AXPEntityListViewModelResolver, AXPEntityListWidget, AXPEntityListWidgetViewComponent, AXPEntityMasterCreateViewModel, AXPEntityMasterListViewModel, AXPEntityMasterListViewQueryViewModel, AXPEntityMasterSingleElementViewModel, AXPEntityMasterSingleViewGroupViewModel, AXPEntityMasterSingleViewModel, AXPEntityMasterUpdateElementViewModel, AXPEntityMasterUpdateViewModel, AXPEntityMasterUpdateViewModelFactory, AXPEntityMiddleware, AXPEntityModifyConfirmedAction, AXPEntityModifyEvent, AXPEntityModifySectionPopupAction, AXPEntityModule, AXPEntityPerformDeleteAction, AXPEntityReferenceWidget, AXPEntityReferenceWidgetColumnComponent, AXPEntityReferenceWidgetDesignerComponent, AXPEntityReferenceWidgetEditComponent, AXPEntityReferenceWidgetPrintComponent, AXPEntityReferenceWidgetViewComponent, AXPEntityResolver, AXPEntityService, AXPEntityStorageService, AXPEntityUpdateViewSectionViewModel, AXPGetEntityDetailsQuery, AXPLookupFilterWidget, AXPLookupFilterWidgetEditComponent, AXPLookupWidget, AXPLookupWidgetColumnComponent, AXPLookupWidgetEditComponent, AXPLookupWidgetViewComponent, AXPMiddlewareAbortError, AXPMiddlewareEntityStorageService, AXPModifyEntitySectionWorkflow, AXPOpenEntityDetailsCommand, AXPQuickEntityModifyPopupAction, AXPQuickModifyEntityWorkflow, AXPShowDetailViewAction, AXPShowDetailsViewWorkflow, AXPShowListViewAction, AXPShowListViewWorkflow, AXPTagableBoxWidget, AXPTagableBoxWidgetColumnComponent, AXPTagableBoxWidgetEditComponent, AXPTagableBoxWidgetFilterComponent, AXPTagableBoxWidgetPrintComponent, AXPTagableBoxWidgetViewComponent, AXPWidgetSelectorWidget, AXPWidgetSelectorWidgetEditComponent, AXPWidgetSelectorWidgetViewComponent, AXP_DATA_SEEDER_TOKEN, AXP_ENTITY_ACTION_PLUGIN, AXP_ENTITY_CONFIG_TOKEN, AXP_ENTITY_DEFINITION_LOADER, AXP_ENTITY_MODIFIER, AXP_ENTITY_STORAGE_BACKEND, AXP_ENTITY_STORAGE_MIDDLEWARE, DEFAULT_COLUMN_WIDTHS, actionExists, columnWidthMiddlewareFactory, columnWidthMiddlewareProvider, createColumnWidthMiddlewareProvider, createModifierContext, detectEntityChanges, ensureListActions, entityDetailsCreateActions, entityDetailsCrudActions, entityDetailsEditAction, entityDetailsReferenceCondition, entityDetailsReferenceCreateActions, entityDetailsSimpleCondition, entityMasterBulkDeleteAction, entityMasterCreateAction, entityMasterCrudActions, entityMasterDeleteAction, entityMasterRecordActions, entityMasterViewAction, entityOverrideDetailsViewAction, eventDispatchMiddleware, isAXPMiddlewareAbortError };
8261
8284
  //# sourceMappingURL=acorex-platform-layout-entity.mjs.map