@acorex-platform/module-location-management-client 0.0.33 → 0.0.37

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 (19) hide show
  1. package/fesm2022/acorex-platform-module-location-management-client-assign-existing-location-to-party.command-DECKrIBR.mjs.map +1 -1
  2. package/fesm2022/acorex-platform-module-location-management-client-contracts-entities-geographic-region.mjs.map +1 -1
  3. package/fesm2022/acorex-platform-module-location-management-client-contracts-entities-location-assignment.mjs.map +1 -1
  4. package/fesm2022/acorex-platform-module-location-management-client-contracts-entities-location-role.mjs.map +1 -1
  5. package/fesm2022/acorex-platform-module-location-management-client-contracts-entities-location-type.mjs.map +1 -1
  6. package/fesm2022/acorex-platform-module-location-management-client-contracts-entities-location.mjs.map +1 -1
  7. package/fesm2022/acorex-platform-module-location-management-client-contracts-entity-catalog-acorex-platform-module-location-management-client-contracts-entity-catalog-B1rJccHr.mjs.map +1 -1
  8. package/fesm2022/acorex-platform-module-location-management-client-contracts-entity-catalog-geographic-region.entity-CUhM4K8a.mjs.map +1 -1
  9. package/fesm2022/acorex-platform-module-location-management-client-contracts-entity-catalog-location-assignment.entity-Cw46YCj9.mjs.map +1 -1
  10. package/fesm2022/acorex-platform-module-location-management-client-contracts-entity-catalog-location-assignment.utils-CfwbSQiM.mjs.map +1 -1
  11. package/fesm2022/acorex-platform-module-location-management-client-contracts-entity-catalog-location-role.entity-CEtJEhCf.mjs.map +1 -1
  12. package/fesm2022/acorex-platform-module-location-management-client-contracts-entity-catalog-location-type.entity-BXuQ_A7h.mjs.map +1 -1
  13. package/fesm2022/acorex-platform-module-location-management-client-contracts-entity-catalog-location.entity-CmnVKTG-.mjs.map +1 -1
  14. package/fesm2022/acorex-platform-module-location-management-client-contracts.mjs.map +1 -1
  15. package/fesm2022/acorex-platform-module-location-management-client-create-location-with-assignment.command-Cl6KfruM.mjs.map +1 -1
  16. package/fesm2022/acorex-platform-module-location-management-client-local-entities.mjs.map +1 -1
  17. package/fesm2022/acorex-platform-module-location-management-client.mjs +1 -1
  18. package/fesm2022/acorex-platform-module-location-management-client.mjs.map +1 -1
  19. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-location-management-client-contracts.mjs","sources":["../../../../libs/modules/location-management/contracts/src/features.keys.ts","../../../../libs/modules/location-management/contracts/src/root-config.ts","../../../../libs/modules/location-management/contracts/src/location-assignment.actions.ts","../../../../libs/modules/location-management/contracts/src/location-assignment.utils.ts","../../../../libs/modules/location-management/contracts/src/menu.keys.ts","../../../../libs/modules/location-management/contracts/src/permission.keys.ts","../../../../libs/modules/location-management/contracts/src/entities/location-assignment/location-assignment.types.ts","../../../../libs/modules/location-management/contracts/src/index.ts","../../../../libs/modules/location-management/contracts/src/acorex-platform-module-location-management-client-contracts.ts"],"sourcesContent":["// Management feature removed - module name is used directly as feature key\nexport const AXMLocationManagementFeatureKeys = {} as const;\n\n","const config = {\n i18n: 'location-management',\n};\n\nexport const RootConfig = {\n config,\n module: {\n name: 'LocationManagement',\n title: '@location-management:module.title',\n icon: 'fa-light fa-map-marker-alt',\n },\n entities: {\n location: {\n name: 'Location',\n title: '@location-management:locations.entities.location.title',\n titlePlural: '@location-management:locations.entities.location.plural',\n icon: 'fa-light fa-map-marker-alt',\n },\n\n locationType: {\n name: 'LocationType',\n title: '@location-management:location-types.entities.location-type.title',\n titlePlural: '@location-management:location-types.entities.location-type.plural',\n icon: 'fa-light fa-tags',\n },\n locationRole: {\n name: 'LocationRole',\n title: '@location-management:location-roles.entities.location-role.title',\n titlePlural: '@location-management:location-roles.entities.location-role.plural',\n icon: 'fa-light fa-map-pin',\n },\n geographicRegion: {\n name: 'GeographicRegion',\n title: '@location-management:geographic-regions.entities.geographic-region.title',\n titlePlural: '@location-management:geographic-regions.entities.geographic-region.plural',\n icon: 'fa-light fa-globe',\n },\n locationAssignment: {\n name: 'LocationAssignment',\n title: `@${config.i18n}:location-assignments.entities.location-assignment.title`,\n titlePlural: `@${config.i18n}:location-assignments.entities.location-assignment.plural`,\n icon: 'fa-light fa-building-user',\n },\n },\n} as const;\n","import { AXPSystemActionType } from '@acorex-platform/framework-shared/core';\nimport {\n AXPEntityAction,\n AXPEntityCommandScope,\n entityDetailsEditAction,\n entityMasterBulkDeleteAction,\n entityMasterCreateAction,\n entityMasterDeleteAction,\n entityMasterViewAction,\n entityOverrideDetailsViewAction,\n} from '@acorex-platform/framework-shared/entity';\n\nimport { RootConfig } from './root-config';\n\n//#region ---- Command keys ----\n\nconst ASSIGN_EXISTING_LOCATION = `${RootConfig.module.name}.${RootConfig.entities.locationAssignment.name}:AssignExistingLocation`;\nconst CREATE_WITH_NEW_LOCATION = `${RootConfig.module.name}.${RootConfig.entities.locationAssignment.name}:CreateWithNewLocation`;\n\n//#endregion\n\n//#region ---- Location assignment related-entity actions ----\n\nconst assigneeProcessOptions = () => ({\n process: {\n redirect: false,\n canCreateNewOne: true,\n data: {\n 'ownerRef.type': '{{ host.entity() }}',\n 'ownerRef.id': '{{ host.eval(\"id\") }}',\n 'ownerRef.title': '{{ host.eval(\"party.title\") }}',\n },\n },\n});\n\n/** Read-only assignments list on Location detail (no create/update/delete). */\nexport function locationAssignmentReadOnlyRelatedActions(): AXPEntityAction[] {\n return [\n { ...entityMasterCreateAction(), hidden: true },\n { ...entityMasterBulkDeleteAction(), hidden: true },\n { ...entityMasterDeleteAction(), hidden: true },\n { ...entityMasterViewAction(), hidden: true },\n ];\n}\n\nfunction locationAssignmentPartyCreateAction(): AXPEntityAction {\n const assigneeOptions = assigneeProcessOptions();\n\n return {\n name: 'Create',\n title: '@general:actions.create.title',\n command: { name: 'Entity:Create' },\n icon: 'fa-light fa-plus',\n priority: 'primary',\n type: AXPSystemActionType.Create,\n scope: AXPEntityCommandScope.TypeLevel,\n items: [\n {\n name: 'AssignExistingLocation',\n title: '@location-management:location-assignments.actions.assign-existing-location.title',\n command: { name: ASSIGN_EXISTING_LOCATION, options: assigneeOptions },\n icon: 'fa-light fa-map-marker-alt',\n priority: 'primary',\n type: AXPSystemActionType.Create,\n scope: AXPEntityCommandScope.TypeLevel,\n },\n {\n name: 'CreateWithNewLocation',\n title: '@location-management:location-assignments.actions.create-with-new-location.title',\n command: { name: CREATE_WITH_NEW_LOCATION, options: assigneeOptions },\n icon: 'fa-light fa-location-plus',\n priority: 'primary',\n type: AXPSystemActionType.Create,\n scope: AXPEntityCommandScope.TypeLevel,\n },\n ],\n };\n}\n\n/**\n * Actions for LocationAssignment when shown from Party/Customer/Supplier.\n * Create menu: assign existing location or create new location with assignee prefilled.\n */\nexport function locationAssignmentDetailsCrudActionsForPartyContext(\n _partyIdContextPath = 'id',\n): AXPEntityAction[] {\n return [\n { ...entityMasterCreateAction(), hidden: true },\n locationAssignmentPartyCreateAction(),\n entityDetailsEditAction(),\n entityOverrideDetailsViewAction(),\n ];\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport {\n AXPWidgetsList,\n formatAddressData,\n resolveMultiLanguageString,\n type AXPMultiLanguageString,\n} from '@acorex-platform/framework-shared/core';\nimport type { AXPEntityProperty, AXPQueryFilter } from '@acorex-platform/framework-shared/entity';\n\n//#endregion\n\n//#region ---- Types ----\n\ntype LocationAssignmentLocationSnapshot = {\n id: string;\n title: string;\n fullAddress?: string;\n street1?: string;\n street2?: string;\n postalCode?: string;\n city?: { title: string };\n state?: { title: string };\n country?: { title: string };\n};\n\ntype LocationAssignmentPersonSnapshot = {\n id: string;\n fullName?: string;\n phones?: unknown[];\n emails?: unknown[];\n};\n\n//#endregion\n\n//#region ---- Constants ----\n\n/** Canonical assignee type for party-scoped location assignment links. */\nexport const LOCATION_ASSIGNMENT_PARTY_TYPE = 'BusinessCore.Party';\n\n//#endregion\n\n//#region ---- Display helpers ----\n\n/** Resolves assignee display title from host/process data (plain string or multi-language object). */\nexport function resolveLocationAssignmentDisplayTitle(locale: string, ...candidates: unknown[]): string {\n for (const candidate of candidates) {\n if (candidate == null || candidate === '') {\n continue;\n }\n\n const resolved = resolveMultiLanguageString(\n candidate as string | AXPMultiLanguageString | null | undefined,\n locale,\n ).trim();\n if (resolved) {\n return resolved;\n }\n }\n\n return '';\n}\n\n/** Builds a location snapshot for nested LocationAssignment display fields. */\nexport function buildLocationAssignmentLocationSnapshot(\n locationRow: Record<string, unknown>,\n locationId: string,\n): LocationAssignmentLocationSnapshot {\n const fullAddress =\n (locationRow['fullAddress'] as string | undefined)?.trim() || formatAddressData(locationRow)?.trim() || undefined;\n\n const toRegionRef = (value: unknown) => {\n if (value == null) {\n return undefined;\n }\n if (typeof value === 'object') {\n const record = value as Record<string, unknown>;\n const title = record['title'];\n if (title == null) {\n return undefined;\n }\n if (typeof title === 'string') {\n return { title };\n }\n if (typeof title === 'object') {\n return {\n title: resolveMultiLanguageString(title as AXPMultiLanguageString, 'en-US'),\n };\n }\n return undefined;\n }\n return { title: String(value) };\n };\n\n return {\n id: locationId,\n title: locationRow['title'] as string,\n fullAddress,\n street1: locationRow['street1'] as string | undefined,\n street2: locationRow['street2'] as string | undefined,\n postalCode: locationRow['postalCode'] as string | undefined,\n city: toRegionRef(locationRow['city']),\n state: toRegionRef(locationRow['state']),\n country: toRegionRef(locationRow['country']),\n };\n}\n\n/** Builds a person snapshot for nested LocationAssignment site-contact fields. */\nexport function buildLocationAssignmentPersonSnapshot(\n personRow: Record<string, unknown>,\n personId: string,\n): LocationAssignmentPersonSnapshot {\n const fullName =\n (personRow['fullName'] as string | undefined) ??\n [personRow['firstName'], personRow['lastName']].filter(Boolean).join(' ').trim();\n\n return {\n id: personId,\n fullName: fullName || undefined,\n phones: personRow['phones'] as unknown[] | undefined,\n emails: personRow['emails'] as unknown[] | undefined,\n };\n}\n\n//#endregion\n\n//#region ---- Filter helpers ----\n\n/** Filters LocationAssignment rows for a location detail context. */\nexport function locationAssignmentLocationConditions(locationIdContextPath = 'id'): AXPQueryFilter[] {\n return [\n {\n name: 'locationId',\n operator: { type: 'equal' },\n value: `{{context.eval(\"${locationIdContextPath}\")}}`,\n },\n ];\n}\n\n/** Filters LocationAssignment rows for the current details-view host entity. */\nexport function locationAssignmentPartyConditions(hostIdContextPath = 'id'): AXPQueryFilter[] {\n return [\n {\n name: 'ownerRef.type',\n operator: { type: 'equal' },\n value: '{{ host.entity() }}',\n },\n {\n name: 'ownerRef.id',\n operator: { type: 'equal' },\n value: `{{ host.eval(\"${hostIdContextPath}\") }}`,\n },\n ];\n}\n\n//#endregion\n\n//#region ---- Form layout helpers ----\n\n/** Assignee lookup omitted when injected from party/customer/supplier context. */\nexport const LOCATION_ASSIGNMENT_REF_PROPERTY_NAMES = ['ownerRef.id', 'ownerRef.type'] as const;\n\n/** Location lookup omitted when injected from location detail context. */\nexport const LOCATION_ASSIGNMENT_LOCATION_PROPERTY_NAMES = ['locationId'] as const;\n\ntype PropertyLayoutRef = { name: string; layout?: Record<string, unknown> };\n\nexport function omitLocationAssignmentRefFromEditLayouts<T extends PropertyLayoutRef>(layouts: T[]): T[] {\n return layouts.filter(\n (layout) =>\n !LOCATION_ASSIGNMENT_REF_PROPERTY_NAMES.includes(\n layout.name as (typeof LOCATION_ASSIGNMENT_REF_PROPERTY_NAMES)[number],\n ),\n );\n}\n\nexport function omitLocationAssignmentLocationFromEditLayouts<T extends PropertyLayoutRef>(layouts: T[]): T[] {\n return layouts.filter(\n (layout) =>\n !LOCATION_ASSIGNMENT_LOCATION_PROPERTY_NAMES.includes(\n layout.name as (typeof LOCATION_ASSIGNMENT_LOCATION_PROPERTY_NAMES)[number],\n ),\n );\n}\n\n//#endregion\n\n//#region ---- Property factories ----\n\n/** Polymorphic assignee lookup (AssessmentCase subjectRef pattern). */\nexport function createLocationAssignmentOwnerRefLookupProperty(\n groupId: string,\n options: { readonly?: boolean } = {},\n): AXPEntityProperty {\n const readonly = options.readonly ?? false;\n\n return {\n name: 'ownerRef.id',\n title: '@location-management:location-assignments.entities.location-assignment.fields.assignee.title',\n groupId,\n options: readonly\n ? { sort: { enabled: false }, filter: { advance: { enabled: false }, inline: { enabled: false } } }\n : { sort: { enabled: true }, filter: { advance: { enabled: true }, inline: { enabled: true } } },\n schema: {\n dataType: 'string',\n readonly,\n interface: {\n type: AXPWidgetsList.Editors.LookupBox,\n options: {\n readonly,\n entity: \"{{ context.eval('ownerRef.type') }}\",\n textField: 'title',\n valueField: 'id',\n expose: [\n { source: 'id', target: 'ownerRef.id' },\n { source: 'title', target: 'ownerRef.title' },\n ],\n triggers: [{ event: \"{{ events.context('ownerRef.type') }}\", action: '{{ widget.refresh() }}' }],\n },\n },\n },\n validations: [{ rule: 'required' }],\n };\n}\n\n/** Hidden assignee type field; defaults to BusinessCore.Party. */\nexport function createLocationAssignmentOwnerRefTypeProperty(groupId: string): AXPEntityProperty {\n return {\n name: 'ownerRef.type',\n title: '@location-management:location-assignments.entities.location-assignment.fields.assignee-type.title',\n groupId,\n schema: {\n dataType: 'string',\n visible: false,\n defaultValue: LOCATION_ASSIGNMENT_PARTY_TYPE,\n interface: { type: AXPWidgetsList.Editors.TextBox },\n },\n };\n}\n\n//#endregion\n","export const AXPLocationManagementMenuKeys = {\n Root: 'location-management:menu',\n Locations: 'location-management:menu:locations',\n Divider1: 'location-management:menu:divider-1',\n LocationTypes: 'location-management:menu:location-types',\n LocationRoles: 'location-management:menu:location-roles',\n GeographicRegions: 'location-management:menu:geographic-regions',\n} as const;\n\n","/**\n * People & Organization capabilities used by this module.\n * Domain capability keys for this module. Root groups live in `AXPCommonPermissionGroupKeys` (common contracts).\n */\nexport const AXPPeopleOrganizationPermissionKeys = {\n Access: 'PeopleOrganization:Permission:Access',\n ViewOrganization: 'PeopleOrganization:Permission:ViewOrganization',\n MaintainOrganization: 'PeopleOrganization:Permission:MaintainOrganization',\n MaintainTeams: 'PeopleOrganization:Permission:MaintainTeams',\n MaintainEmployees: 'PeopleOrganization:Permission:MaintainEmployees',\n ManageEmployeeActions: 'PeopleOrganization:Permission:ManageEmployeeActions',\n MaintainPersons: 'PeopleOrganization:Permission:MaintainPersons',\n MaintainAttendance: 'PeopleOrganization:Permission:MaintainAttendance',\n ManageAttendanceActions: 'PeopleOrganization:Permission:ManageAttendanceActions',\n DesignJobs: 'PeopleOrganization:Permission:DesignJobs',\n Setup: 'PeopleOrganization:Permission:Setup',\n} as const;\n\n/**\n * @deprecated Prefer {@link AXPPeopleOrganizationPermissionKeys}.\n * Legacy nested shape kept so existing imports compile during migration.\n */\nexport const AXMLocationManagementPermissionsKeys = {\n LocationManagement: {\n Management: AXPPeopleOrganizationPermissionKeys.Setup,\n Locations: {\n Management: AXPPeopleOrganizationPermissionKeys.Setup,\n View: AXPPeopleOrganizationPermissionKeys.Setup,\n Edit: AXPPeopleOrganizationPermissionKeys.Setup,\n Delete: AXPPeopleOrganizationPermissionKeys.Setup,\n Create: AXPPeopleOrganizationPermissionKeys.Setup,\n },\n LocationTypes: {\n Management: AXPPeopleOrganizationPermissionKeys.Setup,\n View: AXPPeopleOrganizationPermissionKeys.Setup,\n Edit: AXPPeopleOrganizationPermissionKeys.Setup,\n Delete: AXPPeopleOrganizationPermissionKeys.Setup,\n Create: AXPPeopleOrganizationPermissionKeys.Setup,\n },\n LocationRoles: {\n Management: AXPPeopleOrganizationPermissionKeys.Setup,\n View: AXPPeopleOrganizationPermissionKeys.Setup,\n Edit: AXPPeopleOrganizationPermissionKeys.Setup,\n Delete: AXPPeopleOrganizationPermissionKeys.Setup,\n Create: AXPPeopleOrganizationPermissionKeys.Setup,\n },\n GeographicRegions: {\n Management: AXPPeopleOrganizationPermissionKeys.Setup,\n View: AXPPeopleOrganizationPermissionKeys.Setup,\n Edit: AXPPeopleOrganizationPermissionKeys.Setup,\n Delete: AXPPeopleOrganizationPermissionKeys.Setup,\n Create: AXPPeopleOrganizationPermissionKeys.Setup,\n },\n },\n} as const;\n","import type { AXPEntityReference } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityModel } from '@acorex-platform/framework-shared/entity';\n\n//#region ---- Types ----\n\nexport interface AXMLocationManagementLocationAssignmentEntityModel extends AXPEntityModel<string> {\n locationId: string;\n ownerRef: AXPEntityReference;\n roleId: string;\n personId?: string;\n location?: {\n id: string;\n title: string;\n fullAddress?: string;\n street1?: string;\n street2?: string;\n postalCode?: string;\n city?: { title: string };\n state?: { title: string };\n country?: { title: string };\n };\n role?: { id: string; title: string };\n person?: { id: string; fullName?: string; phones?: unknown[]; emails?: unknown[] };\n}\n\n//#endregion\n","//#region ---- Contracts barrel ----\n\nexport * from './features.keys';\nexport * from './location-assignment.actions';\nexport * from './location-assignment.utils';\nexport * from './menu.keys';\nexport * from './permission.keys';\n\nexport * from './root-config';\n\n//#endregion\n\nexport * from './entities';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAA;AACO,MAAM,gCAAgC,GAAG;;ACDhD,MAAM,MAAM,GAAG;AACb,IAAA,IAAI,EAAE,qBAAqB;CAC5B;AAEM,MAAM,UAAU,GAAG;IACxB,MAAM;AACN,IAAA,MAAM,EAAE;AACN,QAAA,IAAI,EAAE,oBAAoB;AAC1B,QAAA,KAAK,EAAE,mCAAmC;AAC1C,QAAA,IAAI,EAAE,4BAA4B;AACnC,KAAA;AACD,IAAA,QAAQ,EAAE;AACR,QAAA,QAAQ,EAAE;AACR,YAAA,IAAI,EAAE,UAAU;AAChB,YAAA,KAAK,EAAE,wDAAwD;AAC/D,YAAA,WAAW,EAAE,yDAAyD;AACtE,YAAA,IAAI,EAAE,4BAA4B;AACnC,SAAA;AAED,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,cAAc;AACpB,YAAA,KAAK,EAAE,kEAAkE;AACzE,YAAA,WAAW,EAAE,mEAAmE;AAChF,YAAA,IAAI,EAAE,kBAAkB;AACzB,SAAA;AACD,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,cAAc;AACpB,YAAA,KAAK,EAAE,kEAAkE;AACzE,YAAA,WAAW,EAAE,mEAAmE;AAChF,YAAA,IAAI,EAAE,qBAAqB;AAC5B,SAAA;AACD,QAAA,gBAAgB,EAAE;AA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EAAE,mCAAmC,CAAC,KAAK;YACjD,MAAM,EAAE,mCAAmC,CAAC,KAAK;AAClD,SAAA;AACD,QAAA,aAAa,EAAE;YACb,UAAU,EAAE,mCAAmC,CAAC,KAAK;YACrD,IAAI,EAAE,mCAAmC,CAAC,KAAK;YAC/C,IAAI,EAAE,mCAAmC,CAAC,KAAK;YAC/C,MAAM,EAAE,mCAAmC,CAAC,KAAK;YACjD,MAAM,EAAE,mCAAmC,CAAC,KAAK;AAClD,SAAA;AACD,QAAA,iBAAiB,EAAE;YACjB,UAAU,EAAE,mCAAmC,CAAC,KAAK;YACrD,IAAI,EAAE,mCAAmC,CAAC,KAAK;YAC/C,IAAI,EAAE,mCAAmC,CAAC,KAAK;YAC/C,MAAM,EAAE,mCAAmC,CAAC,KAAK;YACjD,MAAM,EAAE,mCAAmC,CAAC,KAAK;AAClD,SAAA;AACF,KAAA;;;AC5BH;;ACzBA;;ACAA;;AAEG;;;;"}
1
+ {"version":3,"file":"acorex-platform-module-location-management-client-contracts.mjs","sources":["../../../../libs/modules/location-management/contracts/src/features.keys.ts","../../../../libs/modules/location-management/contracts/src/root-config.ts","../../../../libs/modules/location-management/contracts/src/location-assignment.actions.ts","../../../../libs/modules/location-management/contracts/src/location-assignment.utils.ts","../../../../libs/modules/location-management/contracts/src/menu.keys.ts","../../../../libs/modules/location-management/contracts/src/permission.keys.ts","../../../../libs/modules/location-management/contracts/src/entities/location-assignment/location-assignment.types.ts","../../../../libs/modules/location-management/contracts/src/index.ts","../../../../libs/modules/location-management/contracts/src/acorex-platform-module-location-management-client-contracts.ts"],"sourcesContent":["// Management feature removed - module name is used directly as feature key\nexport const AXMLocationManagementFeatureKeys = {} as const;\n\n","const config = {\n i18n: 'location-management',\n};\n\nexport const RootConfig = {\n config,\n module: {\n name: 'LocationManagement',\n title: '@location-management:module.title',\n icon: 'fa-light fa-map-marker-alt',\n },\n entities: {\n location: {\n name: 'Location',\n title: '@location-management:locations.entities.location.title',\n titlePlural: '@location-management:locations.entities.location.plural',\n icon: 'fa-light fa-map-marker-alt',\n },\n\n locationType: {\n name: 'LocationType',\n title: '@location-management:location-types.entities.location-type.title',\n titlePlural: '@location-management:location-types.entities.location-type.plural',\n icon: 'fa-light fa-tags',\n },\n locationRole: {\n name: 'LocationRole',\n title: '@location-management:location-roles.entities.location-role.title',\n titlePlural: '@location-management:location-roles.entities.location-role.plural',\n icon: 'fa-light fa-map-pin',\n },\n geographicRegion: {\n name: 'GeographicRegion',\n title: '@location-management:geographic-regions.entities.geographic-region.title',\n titlePlural: '@location-management:geographic-regions.entities.geographic-region.plural',\n icon: 'fa-light fa-globe',\n },\n locationAssignment: {\n name: 'LocationAssignment',\n title: `@${config.i18n}:location-assignments.entities.location-assignment.title`,\n titlePlural: `@${config.i18n}:location-assignments.entities.location-assignment.plural`,\n icon: 'fa-light fa-building-user',\n },\n },\n} as const;\n","import { AXPSystemActionType } from '@acorex-platform/framework-shared/core';\nimport {\n AXPEntityAction,\n AXPEntityCommandScope,\n entityDetailsEditAction,\n entityMasterBulkDeleteAction,\n entityMasterCreateAction,\n entityMasterDeleteAction,\n entityMasterViewAction,\n entityOverrideDetailsViewAction,\n} from '@acorex-platform/framework-shared/entity';\n\nimport { RootConfig } from './root-config';\n\n//#region ---- Command keys ----\n\nconst ASSIGN_EXISTING_LOCATION = `${RootConfig.module.name}.${RootConfig.entities.locationAssignment.name}:AssignExistingLocation`;\nconst CREATE_WITH_NEW_LOCATION = `${RootConfig.module.name}.${RootConfig.entities.locationAssignment.name}:CreateWithNewLocation`;\n\n//#endregion\n\n//#region ---- Location assignment related-entity actions ----\n\nconst assigneeProcessOptions = () => ({\n process: {\n redirect: false,\n canCreateNewOne: true,\n data: {\n 'ownerRef.type': '{{ host.entity() }}',\n 'ownerRef.id': '{{ host.eval(\"id\") }}',\n 'ownerRef.title': '{{ host.eval(\"party.title\") }}',\n },\n },\n});\n\n/** Read-only assignments list on Location detail (no create/update/delete). */\nexport function locationAssignmentReadOnlyRelatedActions(): AXPEntityAction[] {\n return [\n { ...entityMasterCreateAction(), hidden: true },\n { ...entityMasterBulkDeleteAction(), hidden: true },\n { ...entityMasterDeleteAction(), hidden: true },\n { ...entityMasterViewAction(), hidden: true },\n ];\n}\n\nfunction locationAssignmentPartyCreateAction(): AXPEntityAction {\n const assigneeOptions = assigneeProcessOptions();\n\n return {\n name: 'Create',\n title: '@general:actions.create.title',\n command: { name: 'Entity:Create' },\n icon: 'fa-light fa-plus',\n priority: 'primary',\n type: AXPSystemActionType.Create,\n scope: AXPEntityCommandScope.TypeLevel,\n items: [\n {\n name: 'AssignExistingLocation',\n title: '@location-management:location-assignments.actions.assign-existing-location.title',\n command: { name: ASSIGN_EXISTING_LOCATION, options: assigneeOptions },\n icon: 'fa-light fa-map-marker-alt',\n priority: 'primary',\n type: AXPSystemActionType.Create,\n scope: AXPEntityCommandScope.TypeLevel,\n },\n {\n name: 'CreateWithNewLocation',\n title: '@location-management:location-assignments.actions.create-with-new-location.title',\n command: { name: CREATE_WITH_NEW_LOCATION, options: assigneeOptions },\n icon: 'fa-light fa-location-plus',\n priority: 'primary',\n type: AXPSystemActionType.Create,\n scope: AXPEntityCommandScope.TypeLevel,\n },\n ],\n };\n}\n\n/**\n * Actions for LocationAssignment when shown from Party/Customer/Supplier.\n * Create menu: assign existing location or create new location with assignee prefilled.\n */\nexport function locationAssignmentDetailsCrudActionsForPartyContext(\n _partyIdContextPath = 'id',\n): AXPEntityAction[] {\n return [\n { ...entityMasterCreateAction(), hidden: true },\n locationAssignmentPartyCreateAction(),\n entityDetailsEditAction(),\n entityOverrideDetailsViewAction(),\n ];\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport {\n AXPWidgetsList,\n formatAddressData,\n resolveMultiLanguageString,\n type AXPMultiLanguageString,\n} from '@acorex-platform/framework-shared/core';\nimport type { AXPEntityProperty, AXPQueryFilter } from '@acorex-platform/framework-shared/entity';\n\n//#endregion\n\n//#region ---- Types ----\n\ntype LocationAssignmentLocationSnapshot = {\n id: string;\n title: string;\n fullAddress?: string;\n street1?: string;\n street2?: string;\n postalCode?: string;\n city?: { title: string };\n state?: { title: string };\n country?: { title: string };\n};\n\ntype LocationAssignmentPersonSnapshot = {\n id: string;\n fullName?: string;\n phones?: unknown[];\n emails?: unknown[];\n};\n\n//#endregion\n\n//#region ---- Constants ----\n\n/** Canonical assignee type for party-scoped location assignment links. */\nexport const LOCATION_ASSIGNMENT_PARTY_TYPE = 'BusinessCore.Party';\n\n//#endregion\n\n//#region ---- Display helpers ----\n\n/** Resolves assignee display title from host/process data (plain string or multi-language object). */\nexport function resolveLocationAssignmentDisplayTitle(locale: string, ...candidates: unknown[]): string {\n for (const candidate of candidates) {\n if (candidate == null || candidate === '') {\n continue;\n }\n\n const resolved = resolveMultiLanguageString(\n candidate as string | AXPMultiLanguageString | null | undefined,\n locale,\n ).trim();\n if (resolved) {\n return resolved;\n }\n }\n\n return '';\n}\n\n/** Builds a location snapshot for nested LocationAssignment display fields. */\nexport function buildLocationAssignmentLocationSnapshot(\n locationRow: Record<string, unknown>,\n locationId: string,\n): LocationAssignmentLocationSnapshot {\n const fullAddress =\n (locationRow['fullAddress'] as string | undefined)?.trim() || formatAddressData(locationRow)?.trim() || undefined;\n\n const toRegionRef = (value: unknown) => {\n if (value == null) {\n return undefined;\n }\n if (typeof value === 'object') {\n const record = value as Record<string, unknown>;\n const title = record['title'];\n if (title == null) {\n return undefined;\n }\n if (typeof title === 'string') {\n return { title };\n }\n if (typeof title === 'object') {\n return {\n title: resolveMultiLanguageString(title as AXPMultiLanguageString, 'en-US'),\n };\n }\n return undefined;\n }\n return { title: String(value) };\n };\n\n return {\n id: locationId,\n title: locationRow['title'] as string,\n fullAddress,\n street1: locationRow['street1'] as string | undefined,\n street2: locationRow['street2'] as string | undefined,\n postalCode: locationRow['postalCode'] as string | undefined,\n city: toRegionRef(locationRow['city']),\n state: toRegionRef(locationRow['state']),\n country: toRegionRef(locationRow['country']),\n };\n}\n\n/** Builds a person snapshot for nested LocationAssignment site-contact fields. */\nexport function buildLocationAssignmentPersonSnapshot(\n personRow: Record<string, unknown>,\n personId: string,\n): LocationAssignmentPersonSnapshot {\n const fullName =\n (personRow['fullName'] as string | undefined) ??\n [personRow['firstName'], personRow['lastName']].filter(Boolean).join(' ').trim();\n\n return {\n id: personId,\n fullName: fullName || undefined,\n phones: personRow['phones'] as unknown[] | undefined,\n emails: personRow['emails'] as unknown[] | undefined,\n };\n}\n\n//#endregion\n\n//#region ---- Filter helpers ----\n\n/** Filters LocationAssignment rows for a location detail context. */\nexport function locationAssignmentLocationConditions(locationIdContextPath = 'id'): AXPQueryFilter[] {\n return [\n {\n name: 'locationId',\n operator: { type: 'equal' },\n value: `{{context.eval(\"${locationIdContextPath}\")}}`,\n },\n ];\n}\n\n/** Filters LocationAssignment rows for the current details-view host entity. */\nexport function locationAssignmentPartyConditions(hostIdContextPath = 'id'): AXPQueryFilter[] {\n return [\n {\n name: 'ownerRef.type',\n operator: { type: 'equal' },\n value: '{{ host.entity() }}',\n },\n {\n name: 'ownerRef.id',\n operator: { type: 'equal' },\n value: `{{ host.eval(\"${hostIdContextPath}\") }}`,\n },\n ];\n}\n\n//#endregion\n\n//#region ---- Form layout helpers ----\n\n/** Assignee lookup omitted when injected from party/customer/supplier context. */\nexport const LOCATION_ASSIGNMENT_REF_PROPERTY_NAMES = ['ownerRef.id', 'ownerRef.type'] as const;\n\n/** Location lookup omitted when injected from location detail context. */\nexport const LOCATION_ASSIGNMENT_LOCATION_PROPERTY_NAMES = ['locationId'] as const;\n\ntype PropertyLayoutRef = { name: string; layout?: Record<string, unknown> };\n\nexport function omitLocationAssignmentRefFromEditLayouts<T extends PropertyLayoutRef>(layouts: T[]): T[] {\n return layouts.filter(\n (layout) =>\n !LOCATION_ASSIGNMENT_REF_PROPERTY_NAMES.includes(\n layout.name as (typeof LOCATION_ASSIGNMENT_REF_PROPERTY_NAMES)[number],\n ),\n );\n}\n\nexport function omitLocationAssignmentLocationFromEditLayouts<T extends PropertyLayoutRef>(layouts: T[]): T[] {\n return layouts.filter(\n (layout) =>\n !LOCATION_ASSIGNMENT_LOCATION_PROPERTY_NAMES.includes(\n layout.name as (typeof LOCATION_ASSIGNMENT_LOCATION_PROPERTY_NAMES)[number],\n ),\n );\n}\n\n//#endregion\n\n//#region ---- Property factories ----\n\n/** Polymorphic assignee lookup (AssessmentCase subjectRef pattern). */\nexport function createLocationAssignmentOwnerRefLookupProperty(\n groupId: string,\n options: { readonly?: boolean } = {},\n): AXPEntityProperty {\n const readonly = options.readonly ?? false;\n\n return {\n name: 'ownerRef.id',\n title: '@location-management:location-assignments.entities.location-assignment.fields.assignee.title',\n groupId,\n options: readonly\n ? { sort: { enabled: false }, filter: { advance: { enabled: false }, inline: { enabled: false } } }\n : { sort: { enabled: true }, filter: { advance: { enabled: true }, inline: { enabled: true } } },\n schema: {\n dataType: 'string',\n readonly,\n interface: {\n type: AXPWidgetsList.Editors.LookupBox,\n options: {\n readonly,\n entity: \"{{ context.eval('ownerRef.type') }}\",\n textField: 'title',\n valueField: 'id',\n expose: [\n { source: 'id', target: 'ownerRef.id' },\n { source: 'title', target: 'ownerRef.title' },\n ],\n triggers: [{ event: \"{{ events.context('ownerRef.type') }}\", action: '{{ widget.refresh() }}' }],\n },\n },\n },\n validations: [{ rule: 'required' }],\n };\n}\n\n/** Hidden assignee type field; defaults to BusinessCore.Party. */\nexport function createLocationAssignmentOwnerRefTypeProperty(groupId: string): AXPEntityProperty {\n return {\n name: 'ownerRef.type',\n title: '@location-management:location-assignments.entities.location-assignment.fields.assignee-type.title',\n groupId,\n schema: {\n dataType: 'string',\n visible: false,\n defaultValue: LOCATION_ASSIGNMENT_PARTY_TYPE,\n interface: { type: AXPWidgetsList.Editors.TextBox },\n },\n };\n}\n\n//#endregion\n","export const AXPLocationManagementMenuKeys = {\n Root: 'location-management:menu',\n Locations: 'location-management:menu:locations',\n Divider1: 'location-management:menu:divider-1',\n LocationTypes: 'location-management:menu:location-types',\n LocationRoles: 'location-management:menu:location-roles',\n GeographicRegions: 'location-management:menu:geographic-regions',\n} as const;\n\n","/**\n * People & Organization capabilities used by this module.\n * Domain capability keys for this module. Root groups live in `AXPCommonPermissionGroupKeys` (common contracts).\n */\nexport const AXPPeopleOrganizationPermissionKeys = {\n Access: 'PeopleOrganization:Permission:Access',\n ViewOrganization: 'PeopleOrganization:Permission:ViewOrganization',\n MaintainOrganization: 'PeopleOrganization:Permission:MaintainOrganization',\n MaintainTeams: 'PeopleOrganization:Permission:MaintainTeams',\n MaintainEmployees: 'PeopleOrganization:Permission:MaintainEmployees',\n ManageEmployeeActions: 'PeopleOrganization:Permission:ManageEmployeeActions',\n MaintainPersons: 'PeopleOrganization:Permission:MaintainPersons',\n MaintainAttendance: 'PeopleOrganization:Permission:MaintainAttendance',\n ManageAttendanceActions: 'PeopleOrganization:Permission:ManageAttendanceActions',\n DesignJobs: 'PeopleOrganization:Permission:DesignJobs',\n Setup: 'PeopleOrganization:Permission:Setup',\n} as const;\n\n/**\n * @deprecated Prefer {@link AXPPeopleOrganizationPermissionKeys}.\n * Legacy nested shape kept so existing imports compile during migration.\n */\nexport const AXMLocationManagementPermissionsKeys = {\n LocationManagement: {\n Management: AXPPeopleOrganizationPermissionKeys.Setup,\n Locations: {\n Management: AXPPeopleOrganizationPermissionKeys.Setup,\n View: AXPPeopleOrganizationPermissionKeys.Setup,\n Edit: AXPPeopleOrganizationPermissionKeys.Setup,\n Delete: AXPPeopleOrganizationPermissionKeys.Setup,\n Create: AXPPeopleOrganizationPermissionKeys.Setup,\n },\n LocationTypes: {\n Management: AXPPeopleOrganizationPermissionKeys.Setup,\n View: AXPPeopleOrganizationPermissionKeys.Setup,\n Edit: AXPPeopleOrganizationPermissionKeys.Setup,\n Delete: AXPPeopleOrganizationPermissionKeys.Setup,\n Create: AXPPeopleOrganizationPermissionKeys.Setup,\n },\n LocationRoles: {\n Management: AXPPeopleOrganizationPermissionKeys.Setup,\n View: AXPPeopleOrganizationPermissionKeys.Setup,\n Edit: AXPPeopleOrganizationPermissionKeys.Setup,\n Delete: AXPPeopleOrganizationPermissionKeys.Setup,\n Create: AXPPeopleOrganizationPermissionKeys.Setup,\n },\n GeographicRegions: {\n Management: AXPPeopleOrganizationPermissionKeys.Setup,\n View: AXPPeopleOrganizationPermissionKeys.Setup,\n Edit: AXPPeopleOrganizationPermissionKeys.Setup,\n Delete: AXPPeopleOrganizationPermissionKeys.Setup,\n Create: AXPPeopleOrganizationPermissionKeys.Setup,\n },\n },\n} as const;\n","import type { AXPEntityReference } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityModel } from '@acorex-platform/framework-shared/entity';\n\n//#region ---- Types ----\n\nexport interface AXMLocationManagementLocationAssignmentEntityModel extends AXPEntityModel<string> {\n locationId: string;\n ownerRef: AXPEntityReference;\n roleId: string;\n personId?: string;\n location?: {\n id: string;\n title: string;\n fullAddress?: string;\n street1?: string;\n street2?: string;\n postalCode?: string;\n city?: { title: string };\n state?: { title: string };\n country?: { title: string };\n };\n role?: { id: string; title: string };\n person?: { id: string; fullName?: string; phones?: unknown[]; emails?: unknown[] };\n}\n\n//#endregion\n","//#region ---- Contracts barrel ----\n\nexport * from './features.keys';\nexport * from './location-assignment.actions';\nexport * from './location-assignment.utils';\nexport * from './menu.keys';\nexport * from './permission.keys';\n\nexport * from './root-config';\n\n//#endregion\n\nexport * from './entities';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAA;AACO,MAAM,gCAAgC,GAAG;;ACDhD,MAAM,MAAM,GAAG;AACb,IAAA,IAAI,EAAE,qBAAqB;CAC5B;AAEM,MAAM,UAAU,GAAG;IACxB,MAAM;AACN,IAAA,MAAM,EAAE;AACN,QAAA,IAAI,EAAE,oBAAoB;AAC1B,QAAA,KAAK,EAAE,mCAAmC;AAC1C,QAAA,IAAI,EAAE,4BAA4B;AACnC,KAAA;AACD,IAAA,QAAQ,EAAE;AACR,QAAA,QAAQ,EAAE;AACR,YAAA,IAAI,EAA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;AACI,MAAM,oCAAoC,GAAG;AAClD,IAAA,kBAAkB,EAAE;QAClB,UAAU,EAAE,mCAAmC,CAAC,KAAK;AACrD,QAAA,SAAS,EAAE;YACT,UAAU,EAAE,mCAAmC,CAAC,KAAK;YACrD,IAAI,EAAE,mCAAmC,CAAC,KAAK;YAC/C,IAAI,EAAE,mCAAmC,CAAC,KAAK;YAC/C,MAAM,EAAE,mCAAmC,CAAC,KAAK;YACjD,MAAM,EAAE,mCAAmC,CAAC,KAAK;AAClD,SAAA;AACD,QAAA,aAAa,EAAE;YACb,UAAU,EAAE,mCAAmC,CAAC,KAAK;YACrD,IAAI,EAAE,mCAAmC,CAAC,KAAK;YAC/C,IAAI,EAAE,mCAAmC,CAAC,KAAK;YAC/C,MAAM,EAAE,mCAAmC,CAAC,KAAK;YACjD,MAAM,EAAE,mCAAmC,CAAC,KAAK;AAClD,SAAA;AACD,QAAA,aAAa,EAAE;YACb,UAAU,EAAE,mCAAmC,CAAC,KAAK;YACrD,IAAI,EAAE,mCAAmC,CAAC,KAAK;YAC/C,IAAI,EAAE,mCAAmC,CAAC,KAAK;YAC/C,MAAM,EAAE,mCAAmC,CAAC,KAAK;YACjD,MAAM,EAAE,mCAAmC,CAAC,KAAK;AAClD,SAAA;AACD,QAAA,iBAAiB,EAAE;YACjB,UAAU,EAAE,mCAAmC,CAAC,KAAK;YACrD,IAAI,EAAE,mCAAmC,CAAC,KAAK;YAC/C,IAAI,EAAE,mCAAmC,CAAC,KAAK;YAC/C,MAAM,EAAE,mCAAmC,CAAC,KAAK;YACjD,MAAM,EAAE,mCAAmC,CAAC,KAAK;AAClD,SAAA;AACF,KAAA;;;AC5BH;;ACzBA;;ACAA;;AAEG;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-location-management-client-create-location-with-assignment.command-Cl6KfruM.mjs","sources":["../../../../libs/modules/location-management/client/src/lib/commands/create-location-with-assignment.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPRuntimeCommandResult, runtimeCommandPayloadData} from '@acorex-platform/framework-shared/core';\nimport { inject, Injectable } from '@angular/core';\nimport { get } from 'lodash';\nimport { AXPEntityDefinitionRegistryService, AXPEntityFormBuilderService } from '@acorex-platform/framework-client/layout/entity';\n\nimport { RootConfig, LOCATION_ASSIGNMENT_PARTY_TYPE, resolveLocationAssignmentDisplayTitle, buildLocationAssignmentLocationSnapshot, buildLocationAssignmentPersonSnapshot } from '@acorex-platform/module-location-management-client/contracts';\nimport {\n AXPCommand,\n mergeEntityActionProcessData,\n resolveEntityActionCommandInput,\n type AXPCommandExecuteResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\n\n//#endregion\n\n//#region ---- Command ----\n\n@Injectable({ providedIn: 'root' })\nexport class AXMLocationAssignmentCreateWithNewLocationCommand implements AXPCommand<any, any> {\n private readonly entityForm = inject(AXPEntityFormBuilderService);\n private readonly entityService = inject(AXPEntityDefinitionRegistryService);\n private readonly toastService = inject(AXToastService);\n private readonly translationService = inject(AXTranslationService);\n\n async execute(input: any): AXPCommandExecuteResultPromise<any> {\n const resolved = resolveEntityActionCommandInput(input);\n const processData = mergeEntityActionProcessData(input);\n const entity = resolved.entity;\n const ownerRef = this.resolveOwnerRef(processData);\n if (!ownerRef.id) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync(\n '@location-management:location-assignments.messages.missing-party-context',\n ),\n },\n };\n }\n\n const [assignmentModuleName, assignmentEntityName] = (entity || '').split('.');\n if (!assignmentModuleName || !assignmentEntityName) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.invalid-identifier'),\n },\n };\n }\n\n const locationDialogTitle = await this.translationService.translateAsync(\n '@location-management:location-assignments.actions.create-with-new-location.location-dialog-title',\n );\n\n const locationResult = (await this.entityForm\n .entity(`${RootConfig.module.name}.${RootConfig.entities.location.name}`)\n .create({})\n .title(locationDialogTitle)\n .actions((actions) => {\n actions.cancel('@general:actions.cancel.title');\n actions.submit('@general:actions.create.title');\n })\n .onAction<AXPRuntimeCommandResult<any>>(async (dialogRef) => {\n if (dialogRef.action() === 'cancel') {\n return { success: false };\n }\n\n const locationEntity = await this.entityService.resolve(\n RootConfig.module.name,\n RootConfig.entities.location.name,\n );\n const createLocationFn = locationEntity?.commands?.create?.execute as\n | ((payload: unknown) => AXPCommandExecuteResultPromise<any>)\n | undefined;\n\n if (!createLocationFn) {\n const msg = await this.translationService.translateAsync(\n '@general:messages.entity.create-command-unavailable',\n );\n this.toastService.show({\n color: 'danger',\n title: await this.translationService.translateAsync('@general:messages.generic.error.title'),\n content: msg,\n });\n throw new Error(msg);\n }\n\n dialogRef.setLoading(true);\n try {\n const context = dialogRef.context();\n const createResult = await createLocationFn(context);\n const locationRow = runtimeCommandPayloadData(createResult);\n if (!locationRow?.id && !locationRow?._id) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.create-failed'),\n },\n };\n }\n return { success: true, kind: 'object', data: locationRow };\n } catch (error: unknown) {\n const errorMsg =\n error instanceof Error\n ? error.message\n : await this.translationService.translateAsync('@general:messages.entity.create-failed');\n this.toastService.show({\n color: 'danger',\n title: await this.translationService.translateAsync('@general:messages.generic.error.title'),\n content: errorMsg,\n });\n throw error;\n } finally {\n dialogRef.setLoading(false);\n }\n })\n .show()) as unknown as AXPRuntimeCommandResult<any>;\n\n const locationRow = runtimeCommandPayloadData(locationResult) as Record<string, unknown> | undefined;\n if (!locationRow) {\n return { success: false };\n }\n const locationId = (locationRow['id'] ?? locationRow['_id']) as string;\n const locationSnapshot = buildLocationAssignmentLocationSnapshot(locationRow, locationId);\n\n const assignmentFormTitle = await this.translationService.translateAsync(\n '@location-management:location-assignments.actions.create-with-new-location.assignment-dialog-title',\n );\n\n const assignmentResult = (await this.entityForm\n .entity(`${assignmentModuleName}.${assignmentEntityName}`)\n .create({\n locationId,\n location: locationSnapshot,\n ownerRef,\n })\n .include('roleId', 'personId', 'notes')\n .title(assignmentFormTitle)\n .actions((actions) => {\n actions.cancel('@general:actions.cancel.title');\n actions.submit('@general:actions.create.title');\n })\n .onAction<AXPRuntimeCommandResult<any>>(async (dialogRef) => {\n if (dialogRef.action() === 'cancel') {\n return { success: false };\n }\n\n const locationAssignmentEntity = await this.entityService.resolve(\n assignmentModuleName,\n assignmentEntityName,\n );\n const createAssignmentFn = locationAssignmentEntity?.commands?.create?.execute as\n | ((payload: unknown) => AXPCommandExecuteResultPromise<any>)\n | undefined;\n\n if (!createAssignmentFn) {\n const msg = await this.translationService.translateAsync(\n '@general:messages.entity.create-command-unavailable',\n );\n this.toastService.show({\n color: 'danger',\n title: await this.translationService.translateAsync('@general:messages.generic.error.title'),\n content: msg,\n });\n throw new Error(msg);\n }\n\n dialogRef.setLoading(true);\n try {\n const context = dialogRef.context();\n const personId = (context['personId'] ?? get(context, 'person.id')) as string | undefined;\n const personInContext = get(context, 'person') as Record<string, unknown> | undefined;\n const personSnapshot =\n personId && personInContext\n ? buildLocationAssignmentPersonSnapshot({ ...personInContext, id: personId }, personId)\n : undefined;\n\n const createResult = await createAssignmentFn({\n ...context,\n locationId,\n ownerRef,\n location: locationSnapshot,\n ...(personId ? { personId, person: personSnapshot } : {}),\n });\n const __single_createResult = runtimeCommandPayloadData(createResult);\n if (__single_createResult) {\n return { success: true, kind: 'object',\n data: runtimeCommandPayloadData(createResult),\n message: {\n text: await this.translationService.translateAsync('@general:messages.generic.success.description'),\n },\n };\n }\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.create-failed'),\n },\n };\n } catch (error: unknown) {\n const errorMsg =\n error instanceof Error\n ? error.message\n : await this.translationService.translateAsync('@general:messages.entity.create-failed');\n this.toastService.show({\n color: 'danger',\n title: await this.translationService.translateAsync('@general:messages.generic.error.title'),\n content: errorMsg,\n });\n throw error;\n } finally {\n dialogRef.setLoading(false);\n }\n })\n .show()) as unknown as AXPRuntimeCommandResult<any>;\n\n return assignmentResult;\n }\n\n private resolveOwnerRef(processData: Record<string, unknown>) {\n const nestedOwner = get(processData, 'ownerRef') as { type?: string; id?: string; title?: unknown } | undefined;\n const locale = this.translationService.getActiveLang?.() ?? 'en-US';\n\n return {\n type: (processData['ownerRef.type'] as string) ?? nestedOwner?.type ?? LOCATION_ASSIGNMENT_PARTY_TYPE,\n id: (processData['ownerRef.id'] as string) ?? nestedOwner?.id ?? '',\n title: resolveLocationAssignmentDisplayTitle(\n locale,\n processData['ownerRef.title'],\n nestedOwner?.title,\n get(processData, 'party.title'),\n get(processData, 'title'),\n ),\n };\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;AAAA;AAiBA;AAEA;MAGa,iDAAiD,CAAA;AAD9D,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,2BAA2B,CAAC;AAChD,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,kCAAkC,CAAC;AAC1D,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAqNnE,IAAA;IAnNC,MAAM,OAAO,CAAC,KAAU,EAAA;AACtB,QAAA,MAAM,QAAQ,GAAG,+BAA+B,CAAC,KAAK,CAAC;AACvD,QAAA,MAAM,WAAW,GAAG,4BAA4B,CAAC,KAAK,CAAC;AACvD,QAAA,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM;QAC9B,MAAM,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC;AAClD,QAAA,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;YAChB,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAChD,0EAA0E,CAC3E;AACF,iBAAA;aACF;QACH;AAEA,QAAA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C,eAAe,CAAY,IAAI,WAAW,EAAE,IAAI,IAAI,8BAA8B;YACrG,EAAE,EAAG,WAAW,CAAC,aAAa,CAAY,IAAI,WAAW,EAAE,EAAE,IAAI,EAAE;YACnE,KAAK,EAAE,qCAAqC,CAC1C,MAAM,EACN,WAAW,CAAC,gBAAgB,CAAC,EAC7B,WAAW,EAAE,KAAK,EAClB,GAAG,CAAC,WAAW,EAAE,aAAa,CAAC,EAC/B,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,CAC1B;SACF;IACH;8GAxNW,iDAAiD,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAjD,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,iDAAiD,cADpC,MAAM,EAAA,CAAA,CAAA;;2FACnB,iDAAiD,EAAA,UAAA,EAAA,CAAA;kBAD7D,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
1
+ {"version":3,"file":"acorex-platform-module-location-management-client-create-location-with-assignment.command-Cl6KfruM.mjs","sources":["../../../../libs/modules/location-management/client/src/lib/commands/create-location-with-assignment.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPRuntimeCommandResult, runtimeCommandPayloadData} from '@acorex-platform/framework-shared/core';\nimport { inject, Injectable } from '@angular/core';\nimport { get } from 'lodash';\nimport { AXPEntityDefinitionRegistryService, AXPEntityFormBuilderService } from '@acorex-platform/framework-client/layout/entity';\n\nimport { RootConfig, LOCATION_ASSIGNMENT_PARTY_TYPE, resolveLocationAssignmentDisplayTitle, buildLocationAssignmentLocationSnapshot, buildLocationAssignmentPersonSnapshot } from '@acorex-platform/module-location-management-client/contracts';\nimport {\n AXPCommand,\n mergeEntityActionProcessData,\n resolveEntityActionCommandInput,\n type AXPCommandExecuteResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\n\n//#endregion\n\n//#region ---- Command ----\n\n@Injectable({ providedIn: 'root' })\nexport class AXMLocationAssignmentCreateWithNewLocationCommand implements AXPCommand<any, any> {\n private readonly entityForm = inject(AXPEntityFormBuilderService);\n private readonly entityService = inject(AXPEntityDefinitionRegistryService);\n private readonly toastService = inject(AXToastService);\n private readonly translationService = inject(AXTranslationService);\n\n async execute(input: any): AXPCommandExecuteResultPromise<any> {\n const resolved = resolveEntityActionCommandInput(input);\n const processData = mergeEntityActionProcessData(input);\n const entity = resolved.entity;\n const ownerRef = this.resolveOwnerRef(processData);\n if (!ownerRef.id) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync(\n '@location-management:location-assignments.messages.missing-party-context',\n ),\n },\n };\n }\n\n const [assignmentModuleName, assignmentEntityName] = (entity || '').split('.');\n if (!assignmentModuleName || !assignmentEntityName) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.invalid-identifier'),\n },\n };\n }\n\n const locationDialogTitle = await this.translationService.translateAsync(\n '@location-management:location-assignments.actions.create-with-new-location.location-dialog-title',\n );\n\n const locationResult = (await this.entityForm\n .entity(`${RootConfig.module.name}.${RootConfig.entities.location.name}`)\n .create({})\n .title(locationDialogTitle)\n .actions((actions) => {\n actions.cancel('@general:actions.cancel.title');\n actions.submit('@general:actions.create.title');\n })\n .onAction<AXPRuntimeCommandResult<any>>(async (dialogRef) => {\n if (dialogRef.action() === 'cancel') {\n return { success: false };\n }\n\n const locationEntity = await this.entityService.resolve(\n RootConfig.module.name,\n RootConfig.entities.location.name,\n );\n const createLocationFn = locationEntity?.commands?.create?.execute as\n | ((payload: unknown) => AXPCommandExecuteResultPromise<any>)\n | undefined;\n\n if (!createLocationFn) {\n const msg = await this.translationService.translateAsync(\n '@general:messages.entity.create-command-unavailable',\n );\n this.toastService.show({\n color: 'danger',\n title: await this.translationService.translateAsync('@general:messages.generic.error.title'),\n content: msg,\n });\n throw new Error(msg);\n }\n\n dialogRef.setLoading(true);\n try {\n const context = dialogRef.context();\n const createResult = await createLocationFn(context);\n const locationRow = runtimeCommandPayloadData(createResult);\n if (!locationRow?.id && !locationRow?._id) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.create-failed'),\n },\n };\n }\n return { success: true, kind: 'object', data: locationRow };\n } catch (error: unknown) {\n const errorMsg =\n error instanceof Error\n ? error.message\n : await this.translationService.translateAsync('@general:messages.entity.create-failed');\n this.toastService.show({\n color: 'danger',\n title: await this.translationService.translateAsync('@general:messages.generic.error.title'),\n content: errorMsg,\n });\n throw error;\n } finally {\n dialogRef.setLoading(false);\n }\n })\n .show()) as unknown as AXPRuntimeCommandResult<any>;\n\n const locationRow = runtimeCommandPayloadData(locationResult) as Record<string, unknown> | undefined;\n if (!locationRow) {\n return { success: false };\n }\n const locationId = (locationRow['id'] ?? locationRow['_id']) as string;\n const locationSnapshot = buildLocationAssignmentLocationSnapshot(locationRow, locationId);\n\n const assignmentFormTitle = await this.translationService.translateAsync(\n '@location-management:location-assignments.actions.create-with-new-location.assignment-dialog-title',\n );\n\n const assignmentResult = (await this.entityForm\n .entity(`${assignmentModuleName}.${assignmentEntityName}`)\n .create({\n locationId,\n location: locationSnapshot,\n ownerRef,\n })\n .include('roleId', 'personId', 'notes')\n .title(assignmentFormTitle)\n .actions((actions) => {\n actions.cancel('@general:actions.cancel.title');\n actions.submit('@general:actions.create.title');\n })\n .onAction<AXPRuntimeCommandResult<any>>(async (dialogRef) => {\n if (dialogRef.action() === 'cancel') {\n return { success: false };\n }\n\n const locationAssignmentEntity = await this.entityService.resolve(\n assignmentModuleName,\n assignmentEntityName,\n );\n const createAssignmentFn = locationAssignmentEntity?.commands?.create?.execute as\n | ((payload: unknown) => AXPCommandExecuteResultPromise<any>)\n | undefined;\n\n if (!createAssignmentFn) {\n const msg = await this.translationService.translateAsync(\n '@general:messages.entity.create-command-unavailable',\n );\n this.toastService.show({\n color: 'danger',\n title: await this.translationService.translateAsync('@general:messages.generic.error.title'),\n content: msg,\n });\n throw new Error(msg);\n }\n\n dialogRef.setLoading(true);\n try {\n const context = dialogRef.context();\n const personId = (context['personId'] ?? get(context, 'person.id')) as string | undefined;\n const personInContext = get(context, 'person') as Record<string, unknown> | undefined;\n const personSnapshot =\n personId && personInContext\n ? buildLocationAssignmentPersonSnapshot({ ...personInContext, id: personId }, personId)\n : undefined;\n\n const createResult = await createAssignmentFn({\n ...context,\n locationId,\n ownerRef,\n location: locationSnapshot,\n ...(personId ? { personId, person: personSnapshot } : {}),\n });\n const __single_createResult = runtimeCommandPayloadData(createResult);\n if (__single_createResult) {\n return { success: true, kind: 'object',\n data: runtimeCommandPayloadData(createResult),\n message: {\n text: await this.translationService.translateAsync('@general:messages.generic.success.description'),\n },\n };\n }\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.create-failed'),\n },\n };\n } catch (error: unknown) {\n const errorMsg =\n error instanceof Error\n ? error.message\n : await this.translationService.translateAsync('@general:messages.entity.create-failed');\n this.toastService.show({\n color: 'danger',\n title: await this.translationService.translateAsync('@general:messages.generic.error.title'),\n content: errorMsg,\n });\n throw error;\n } finally {\n dialogRef.setLoading(false);\n }\n })\n .show()) as unknown as AXPRuntimeCommandResult<any>;\n\n return assignmentResult;\n }\n\n private resolveOwnerRef(processData: Record<string, unknown>) {\n const nestedOwner = get(processData, 'ownerRef') as { type?: string; id?: string; title?: unknown } | undefined;\n const locale = this.translationService.getActiveLang?.() ?? 'en-US';\n\n return {\n type: (processData['ownerRef.type'] as string) ?? nestedOwner?.type ?? LOCATION_ASSIGNMENT_PARTY_TYPE,\n id: (processData['ownerRef.id'] as string) ?? nestedOwner?.id ?? '',\n title: resolveLocationAssignmentDisplayTitle(\n locale,\n processData['ownerRef.title'],\n nestedOwner?.title,\n get(processData, 'party.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,iDAAiD,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAjD,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,iDAAiD,cADpC,MAAM,EAAA,CAAA,CAAA;;2FACnB,iDAAiD,EAAA,UAAA,EAAA,CAAA;kBAD7D,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-location-management-client-local-entities.mjs","sources":["../../../../libs/modules/location-management/client/src/lib/provide-local-entities.ts","../../../../libs/modules/location-management/client/src/lib/acorex-platform-module-location-management-client-local-entities.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { provideLocalEntityCatalog } from '@acorex-platform/framework-client/layout/entity';\nimport { RootConfig } from '@acorex-platform/module-location-management-client/contracts';\n\n//#endregion\n\n//#region ----- Provide local entities -----\n\n/**\n * Registers location-management layouts on the client from packaged factories.\n * Each `import()` targets a secondary entry so unused entities stay out of the\n * bundle. Do not add this to the demo app; demo continues to load layouts via\n * `Domain:GetEntityLayout`.\n */\nexport function provideLocationManagementLocalEntities() {\n return provideLocalEntityCatalog({\n moduleName: RootConfig.module.name,\n loaders: {\n [RootConfig.entities.geographicRegion.name]: () =>\n import('@acorex-platform/module-location-management-client/contracts/entities/geographic-region').then((m) => m.geographicRegionFactory()),\n [RootConfig.entities.location.name]: () =>\n import('@acorex-platform/module-location-management-client/contracts/entities/location').then((m) => m.locationFactory()),\n [RootConfig.entities.locationAssignment.name]: () =>\n import('@acorex-platform/module-location-management-client/contracts/entities/location-assignment').then((m) => m.locationAssignmentFactory()),\n [RootConfig.entities.locationRole.name]: () =>\n import('@acorex-platform/module-location-management-client/contracts/entities/location-role').then((m) => m.locationRoleFactory()),\n [RootConfig.entities.locationType.name]: () =>\n import('@acorex-platform/module-location-management-client/contracts/entities/location-type').then((m) => m.locationTypeFactory()),\n },\n });\n}\n\nexport { locationManagementLocalEntityCatalog } from '@acorex-platform/module-location-management-client/contracts/entity-catalog';\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './provide-local-entities';\n"],"names":[],"mappings":";;;;AAAA;AAKA;AAEA;AAEA;;;;;AAKG;SACa,sCAAsC,GAAA;AACpD,IAAA,OAAO,yBAAyB,CAAC;AAC/B,QAAA,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAClC,QAAA,OAAO,EAAE;AACP,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,GAAG,MAC3C,OAAO,yFAAyF,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,uBAAuB,EAAE,CAAC;AAC5I,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,GAAG,MACnC,OAAO,gFAAgF,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,eAAe,EAAE,CAAC;AAC3H,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,kBAAkB,CAAC,IAAI,GAAG,MAC7C,OAAO,2FAA2F,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,yBAAyB,EAAE,CAAC;AAChJ,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,GAAG,MACvC,OAAO,qFAAqF,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,mBAAmB,EAAE,CAAC;AACpI,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,GAAG,MACvC,OAAO,qFAAqF,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,mBAAmB,EAAE,CAAC;AACrI,SAAA;AACF,KAAA,CAAC;AACJ;AAIA;;ACnCA;;AAEG;;;;"}
1
+ {"version":3,"file":"acorex-platform-module-location-management-client-local-entities.mjs","sources":["../../../../libs/modules/location-management/client/src/lib/provide-local-entities.ts","../../../../libs/modules/location-management/client/src/lib/acorex-platform-module-location-management-client-local-entities.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { provideLocalEntityCatalog } from '@acorex-platform/framework-client/layout/entity';\nimport { RootConfig } from '@acorex-platform/module-location-management-client/contracts';\n\n//#endregion\n\n//#region ----- Provide local entities -----\n\n/**\n * Registers location-management layouts on the client from packaged factories.\n * Each `import()` targets a secondary entry so unused entities stay out of the\n * bundle. Do not add this to the demo app; demo continues to load layouts via\n * `Domain:GetEntityLayout`.\n */\nexport function provideLocationManagementLocalEntities() {\n return provideLocalEntityCatalog({\n moduleName: RootConfig.module.name,\n loaders: {\n [RootConfig.entities.geographicRegion.name]: () =>\n import('@acorex-platform/module-location-management-client/contracts/entities/geographic-region').then((m) => m.geographicRegionFactory()),\n [RootConfig.entities.location.name]: () =>\n import('@acorex-platform/module-location-management-client/contracts/entities/location').then((m) => m.locationFactory()),\n [RootConfig.entities.locationAssignment.name]: () =>\n import('@acorex-platform/module-location-management-client/contracts/entities/location-assignment').then((m) => m.locationAssignmentFactory()),\n [RootConfig.entities.locationRole.name]: () =>\n import('@acorex-platform/module-location-management-client/contracts/entities/location-role').then((m) => m.locationRoleFactory()),\n [RootConfig.entities.locationType.name]: () =>\n import('@acorex-platform/module-location-management-client/contracts/entities/location-type').then((m) => m.locationTypeFactory()),\n },\n });\n}\n\nexport { locationManagementLocalEntityCatalog } from '@acorex-platform/module-location-management-client/contracts/entity-catalog';\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './provide-local-entities';\n"],"names":[],"mappings":";;;;AAAA;AAKA;AAEA;AAEA;;;;;AAKG;SACa,sCAAsC,GAAA;AACpD,IAAA,OAAO,yBAAyB,CAAC;AAC/B,QAAA,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAClC,QAAA,OAAO,EAAE;AACP,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,GAAG,MAC3C,OAAO,yFAAyF,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,uBAAuB,EAAE,CAAC;AAC5I,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,GAAG,MACnC,OAAO,gFAAgF,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,eAAe,EAAE,CAAC;AAC3H,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,kBAAkB,CAAC,IAAI,GAAG,MAC7C,OAAO,2FAA2F,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,yBAAyB,EAAE,CAAC;AAChJ,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,GAAG,MACvC,OAAO,qFAAqF,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,mBAAmB,EAAE,CAAC;AACpI,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,GAAG,MACvC,OAAO,qFAAqF,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,mBAAmB,EAAE,CAAC;AACrI,SAAA;AACF,KAAA,CAAC;AACJ;AAIA;;ACnCA;;AAEG;;"}
@@ -1228,7 +1228,7 @@ class AXPAddressWidgetEditComponent extends AXPValueWidgetComponent {
1228
1228
  </div>
1229
1229
  </div>
1230
1230
  }
1231
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXFormModule }, { kind: "directive", type: i3.AXValidationRuleDirective, selector: "ax-validation-rule", inputs: ["rule", "options", "message", "disabled"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i4.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i4.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXTextBoxModule }, { kind: "component", type: i5.AXTextBoxComponent, selector: "ax-text-box", inputs: ["disabled", "tabIndex", "readonly", "value", "state", "name", "id", "placeholder", "maxLength", "allowNull", "type", "autoComplete", "look", "maskPattern", "customTokens", "class"], outputs: ["onBlur", "onFocus", "valueChange", "stateChange", "onValueChanged", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress", "onMaskChanged"] }, { kind: "ngmodule", type: AXValidationModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i6.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXAccordionModule }, { kind: "component", type: i7.AXAccordionItemComponent, selector: "ax-accordion-item", inputs: ["isCollapsed", "icon", "textdecoration", "caption", "isLoading", "headerTemplate", "look", "disabled"], outputs: ["isCollapsedChange", "isLoadingChange", "onClick"] }, { kind: "component", type: i7.AXAccordionGroupComponent, selector: "ax-accordion-group", inputs: ["accordion", "activeIndex", "look", "collapsedOnItemClick"], outputs: ["activeIndexChange"] }, { kind: "component", type: AXPLayoutRendererComponent, selector: "axp-layout-renderer", inputs: ["layout", "context", "look", "mode"], outputs: ["contextChange", "contextInitiated", "validityChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1231
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXFormModule }, { kind: "directive", type: i3.AXValidationRuleDirective, selector: "ax-validation-rule", inputs: ["rule", "options", "message", "disabled"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i4.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i4.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXTextBoxModule }, { kind: "component", type: i5.AXTextBoxComponent, selector: "ax-text-box", inputs: ["disabled", "tabIndex", "readonly", "value", "state", "name", "id", "placeholder", "maxLength", "allowNull", "type", "autoComplete", "look", "maskPattern", "customTokens", "class"], outputs: ["onBlur", "onFocus", "valueChange", "stateChange", "onValueChanged", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress", "onMaskChanged"] }, { kind: "ngmodule", type: AXValidationModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i6.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXAccordionModule }, { kind: "component", type: i7.AXAccordionItemComponent, selector: "ax-accordion-item", inputs: ["isCollapsed", "icon", "textdecoration", "caption", "isLoading", "headerTemplate", "look", "disabled"], outputs: ["isCollapsedChange", "isLoadingChange", "onClick"] }, { kind: "component", type: i7.AXAccordionGroupComponent, selector: "ax-accordion-group", inputs: ["accordion", "activeIndex", "look", "collapsedOnItemClick"], outputs: ["activeIndexChange"] }, { kind: "component", type: AXPLayoutRendererComponent, selector: "axp-layout-renderer", inputs: ["layout", "context", "look", "mode"], outputs: ["contextChange", "contextInitiated", "validityChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1232
1232
  }
1233
1233
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPAddressWidgetEditComponent, decorators: [{
1234
1234
  type: Component,