udp-react-enterprise-component-library 27.0.0-next.12 → 27.0.0-next.13
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.
- package/dist/.tsbuildinfo +1 -1
- package/dist/UI/fluent-web-components/UdpIconPicker.d.ts +4 -1
- package/dist/UI/fluent-web-components/UdpIconPicker.d.ts.map +1 -1
- package/dist/UI/fluent-web-components/UdpIconPicker.js +2 -2
- package/dist/UI/fluent-web-components/UdpIconPicker.js.map +1 -1
- package/dist/UI/fluent-web-components/UdpIconPicker.mjs +32 -28
- package/dist/UI/fluent-web-components/UdpIconPicker.mjs.map +1 -1
- package/dist/UI/fluent-web-components/UdpLink.d.ts +6 -0
- package/dist/UI/fluent-web-components/UdpLink.d.ts.map +1 -1
- package/dist/UI/fluent-web-components/UdpLink.js.map +1 -1
- package/dist/UI/fluent-web-components/UdpLink.mjs.map +1 -1
- package/dist/UI/fluent-web-components/types.d.ts +2 -0
- package/dist/UI/fluent-web-components/types.d.ts.map +1 -1
- package/dist/UI/widgets/library/InquiryFindRecordsWidget/InquiryFindRecordsWidget.d.ts +16 -3
- package/dist/UI/widgets/library/InquiryFindRecordsWidget/InquiryFindRecordsWidget.d.ts.map +1 -1
- package/dist/UI/widgets/library/InquiryFindRecordsWidget/InquiryFindRecordsWidget.js +36 -13
- package/dist/UI/widgets/library/InquiryFindRecordsWidget/InquiryFindRecordsWidget.js.map +1 -1
- package/dist/UI/widgets/library/InquiryFindRecordsWidget/InquiryFindRecordsWidget.mjs +119 -62
- package/dist/UI/widgets/library/InquiryFindRecordsWidget/InquiryFindRecordsWidget.mjs.map +1 -1
- package/dist/UI/widgets/library/InquiryFindRecordsWidget/index.mjs +3 -2
- package/dist/UI/widgets/library/InquiryRecentRecordsWidget/InquiryRecentRecordsWidget.d.ts +9 -2
- package/dist/UI/widgets/library/InquiryRecentRecordsWidget/InquiryRecentRecordsWidget.d.ts.map +1 -1
- package/dist/UI/widgets/library/InquiryRecentRecordsWidget/InquiryRecentRecordsWidget.js +18 -18
- package/dist/UI/widgets/library/InquiryRecentRecordsWidget/InquiryRecentRecordsWidget.js.map +1 -1
- package/dist/UI/widgets/library/InquiryRecentRecordsWidget/InquiryRecentRecordsWidget.mjs +79 -67
- package/dist/UI/widgets/library/InquiryRecentRecordsWidget/InquiryRecentRecordsWidget.mjs.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/InquiryRemindersWidget.d.ts +8 -2
- package/dist/UI/widgets/library/InquiryRemindersWidget/InquiryRemindersWidget.d.ts.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/InquiryRemindersWidget.js +32 -16
- package/dist/UI/widgets/library/InquiryRemindersWidget/InquiryRemindersWidget.js.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/InquiryRemindersWidget.mjs +129 -102
- package/dist/UI/widgets/library/InquiryRemindersWidget/InquiryRemindersWidget.mjs.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/reminderRowModel.d.ts +3 -2
- package/dist/UI/widgets/library/InquiryRemindersWidget/reminderRowModel.d.ts.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/reminderRowModel.js +11 -12
- package/dist/UI/widgets/library/InquiryRemindersWidget/reminderRowModel.js.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/reminderRowModel.mjs +6 -4
- package/dist/UI/widgets/library/InquiryRemindersWidget/reminderRowModel.mjs.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/useInquiryReminders.d.ts +2 -19
- package/dist/UI/widgets/library/InquiryRemindersWidget/useInquiryReminders.d.ts.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/useInquiryReminders.js +4 -5
- package/dist/UI/widgets/library/InquiryRemindersWidget/useInquiryReminders.js.map +1 -1
- package/dist/UI/widgets/library/InquiryRemindersWidget/useInquiryReminders.mjs +5 -4
- package/dist/UI/widgets/library/InquiryRemindersWidget/useInquiryReminders.mjs.map +1 -1
- package/dist/actionPanels/index.d.ts +0 -2
- package/dist/actionPanels/index.d.ts.map +1 -1
- package/dist/actionPanels/index.js +0 -2
- package/dist/actionPanels/index.js.map +1 -1
- package/dist/actionPanels/panelActionFields.d.ts +9 -26
- package/dist/actionPanels/panelActionFields.d.ts.map +1 -1
- package/dist/actionPanels/panelActionFields.js +32 -55
- package/dist/actionPanels/panelActionFields.js.map +1 -1
- package/dist/actionPanels/panelActionFields.mjs +159 -375
- package/dist/actionPanels/panelActionFields.mjs.map +1 -1
- package/dist/actionPanels/panelOperations.d.ts +15 -41
- package/dist/actionPanels/panelOperations.d.ts.map +1 -1
- package/dist/actionPanels/panelOperations.js +51 -89
- package/dist/actionPanels/panelOperations.js.map +1 -1
- package/dist/actionPanels/panelOperations.mjs +37 -92
- package/dist/actionPanels/panelOperations.mjs.map +1 -1
- package/dist/domain/actionPanel/actionTypeMeta.d.ts +15 -2
- package/dist/domain/actionPanel/actionTypeMeta.d.ts.map +1 -1
- package/dist/domain/actionPanel/actionTypeMeta.js +21 -2
- package/dist/domain/actionPanel/actionTypeMeta.js.map +1 -1
- package/dist/domain/actionPanel/actionTypeMeta.mjs +18 -3
- package/dist/domain/actionPanel/actionTypeMeta.mjs.map +1 -1
- package/dist/domain/actionPanel/buttonOrder.d.ts +67 -0
- package/dist/domain/actionPanel/buttonOrder.d.ts.map +1 -0
- package/dist/domain/actionPanel/buttonOrder.js +105 -0
- package/dist/domain/actionPanel/buttonOrder.js.map +1 -0
- package/dist/domain/actionPanel/buttonOrder.mjs +90 -0
- package/dist/domain/actionPanel/buttonOrder.mjs.map +1 -0
- package/dist/domain/actionPanel/index.d.ts +1 -0
- package/dist/domain/actionPanel/index.d.ts.map +1 -1
- package/dist/domain/actionPanel/index.js +1 -0
- package/dist/domain/actionPanel/index.js.map +1 -1
- package/dist/domain/actionPanel/index.mjs +4 -3
- package/dist/domain/actionPanel/serialize.d.ts +6 -2
- package/dist/domain/actionPanel/serialize.d.ts.map +1 -1
- package/dist/domain/actionPanel/serialize.js +10 -3
- package/dist/domain/actionPanel/serialize.js.map +1 -1
- package/dist/domain/actionPanel/serialize.mjs +7 -3
- package/dist/domain/actionPanel/serialize.mjs.map +1 -1
- package/dist/domain/actionPanel/types.d.ts +24 -8
- package/dist/domain/actionPanel/types.d.ts.map +1 -1
- package/dist/domain/actionPanel/types.js.map +1 -1
- package/dist/domain/actionPanel/types.mjs.map +1 -1
- package/dist/domain/inquiryTree/describe.d.ts +15 -3
- package/dist/domain/inquiryTree/describe.d.ts.map +1 -1
- package/dist/domain/inquiryTree/describe.js +32 -28
- package/dist/domain/inquiryTree/describe.js.map +1 -1
- package/dist/domain/inquiryTree/describe.mjs +34 -16
- package/dist/domain/inquiryTree/describe.mjs.map +1 -1
- package/dist/domain/inquiryTree/displayTree.d.ts +75 -97
- package/dist/domain/inquiryTree/displayTree.d.ts.map +1 -1
- package/dist/domain/inquiryTree/displayTree.js +418 -551
- package/dist/domain/inquiryTree/displayTree.js.map +1 -1
- package/dist/domain/inquiryTree/displayTree.mjs +345 -414
- package/dist/domain/inquiryTree/displayTree.mjs.map +1 -1
- package/dist/domain/inquiryTree/groups.d.ts +2 -0
- package/dist/domain/inquiryTree/groups.d.ts.map +1 -1
- package/dist/domain/inquiryTree/groups.js.map +1 -1
- package/dist/domain/inquiryTree/groups.mjs.map +1 -1
- package/dist/domain/inquiryTree/index.d.ts +1 -1
- package/dist/domain/inquiryTree/index.d.ts.map +1 -1
- package/dist/domain/inquiryTree/index.js +1 -1
- package/dist/domain/inquiryTree/index.js.map +1 -1
- package/dist/domain/inquiryTree/index.mjs +12 -12
- package/dist/domain/inquiryTree/lazyLoad.d.ts +20 -129
- package/dist/domain/inquiryTree/lazyLoad.d.ts.map +1 -1
- package/dist/domain/inquiryTree/lazyLoad.js +48 -233
- package/dist/domain/inquiryTree/lazyLoad.js.map +1 -1
- package/dist/domain/inquiryTree/lazyLoad.mjs +32 -187
- package/dist/domain/inquiryTree/lazyLoad.mjs.map +1 -1
- package/dist/domain/inquiryTree/legalChildren.d.ts +13 -14
- package/dist/domain/inquiryTree/legalChildren.d.ts.map +1 -1
- package/dist/domain/inquiryTree/legalChildren.js +21 -42
- package/dist/domain/inquiryTree/legalChildren.js.map +1 -1
- package/dist/domain/inquiryTree/legalChildren.mjs +19 -37
- package/dist/domain/inquiryTree/legalChildren.mjs.map +1 -1
- package/dist/domain/inquiryTree/names.d.ts +38 -0
- package/dist/domain/inquiryTree/names.d.ts.map +1 -0
- package/dist/domain/inquiryTree/names.js +64 -0
- package/dist/domain/inquiryTree/names.js.map +1 -0
- package/dist/domain/inquiryTree/names.mjs +56 -0
- package/dist/domain/inquiryTree/names.mjs.map +1 -0
- package/dist/domain/inquiryTree/operations.d.ts +6 -2
- package/dist/domain/inquiryTree/operations.d.ts.map +1 -1
- package/dist/domain/inquiryTree/operations.js +17 -16
- package/dist/domain/inquiryTree/operations.js.map +1 -1
- package/dist/domain/inquiryTree/operations.mjs +14 -11
- package/dist/domain/inquiryTree/operations.mjs.map +1 -1
- package/dist/domain/inquiryTree/rules.d.ts +3 -4
- package/dist/domain/inquiryTree/rules.d.ts.map +1 -1
- package/dist/domain/inquiryTree/rules.js +3 -13
- package/dist/domain/inquiryTree/rules.js.map +1 -1
- package/dist/domain/inquiryTree/rules.mjs +3 -9
- package/dist/domain/inquiryTree/rules.mjs.map +1 -1
- package/dist/domain/inquiryTree/runtime.d.ts +23 -16
- package/dist/domain/inquiryTree/runtime.d.ts.map +1 -1
- package/dist/domain/inquiryTree/runtime.js +46 -54
- package/dist/domain/inquiryTree/runtime.js.map +1 -1
- package/dist/domain/inquiryTree/runtime.mjs +31 -26
- package/dist/domain/inquiryTree/runtime.mjs.map +1 -1
- package/dist/domain/inquiryTree/serialize.d.ts +20 -29
- package/dist/domain/inquiryTree/serialize.d.ts.map +1 -1
- package/dist/domain/inquiryTree/serialize.js +93 -205
- package/dist/domain/inquiryTree/serialize.js.map +1 -1
- package/dist/domain/inquiryTree/serialize.mjs +89 -180
- package/dist/domain/inquiryTree/serialize.mjs.map +1 -1
- package/dist/domain/inquiryTree/types.d.ts +146 -65
- package/dist/domain/inquiryTree/types.d.ts.map +1 -1
- package/dist/domain/inquiryTree/types.js +5 -0
- package/dist/domain/inquiryTree/types.js.map +1 -1
- package/dist/domain/inquiryTree/types.mjs +3 -1
- package/dist/domain/inquiryTree/types.mjs.map +1 -1
- package/dist/domain/inquiryTree/validate.d.ts +9 -2
- package/dist/domain/inquiryTree/validate.d.ts.map +1 -1
- package/dist/domain/inquiryTree/validate.js +30 -58
- package/dist/domain/inquiryTree/validate.js.map +1 -1
- package/dist/domain/inquiryTree/validate.mjs +29 -44
- package/dist/domain/inquiryTree/validate.mjs.map +1 -1
- package/dist/domain/inquiryTree/view.d.ts +8 -12
- package/dist/domain/inquiryTree/view.d.ts.map +1 -1
- package/dist/domain/inquiryTree/view.js +40 -66
- package/dist/domain/inquiryTree/view.js.map +1 -1
- package/dist/domain/inquiryTree/view.mjs +30 -60
- package/dist/domain/inquiryTree/view.mjs.map +1 -1
- package/dist/domain/inquiryTree/waveLoad.d.ts +32 -48
- package/dist/domain/inquiryTree/waveLoad.d.ts.map +1 -1
- package/dist/domain/inquiryTree/waveLoad.js +75 -90
- package/dist/domain/inquiryTree/waveLoad.js.map +1 -1
- package/dist/domain/inquiryTree/waveLoad.mjs +54 -60
- package/dist/domain/inquiryTree/waveLoad.mjs.map +1 -1
- package/dist/domain/inquiryTree/wireString.d.ts +5 -0
- package/dist/domain/inquiryTree/wireString.d.ts.map +1 -1
- package/dist/domain/inquiryTree/wireString.js +11 -0
- package/dist/domain/inquiryTree/wireString.js.map +1 -1
- package/dist/domain/inquiryTree/wireString.mjs +10 -1
- package/dist/domain/inquiryTree/wireString.mjs.map +1 -1
- package/dist/domain/nodeView/index.mjs +2 -2
- package/dist/domain/nodeView/model.d.ts +35 -30
- package/dist/domain/nodeView/model.d.ts.map +1 -1
- package/dist/domain/nodeView/model.js +108 -69
- package/dist/domain/nodeView/model.js.map +1 -1
- package/dist/domain/nodeView/model.mjs +86 -36
- package/dist/domain/nodeView/model.mjs.map +1 -1
- package/dist/icons/legacyIconNames.d.ts.map +1 -1
- package/dist/icons/legacyIconNames.js +46 -1
- package/dist/icons/legacyIconNames.js.map +1 -1
- package/dist/icons/legacyIconNames.mjs +46 -1
- package/dist/icons/legacyIconNames.mjs.map +1 -1
- package/dist/index.mjs +10 -12
- package/dist/inquiry/Inquiry.d.ts +3 -0
- package/dist/inquiry/Inquiry.d.ts.map +1 -1
- package/dist/inquiry/Inquiry.js +3 -0
- package/dist/inquiry/Inquiry.js.map +1 -1
- package/dist/inquiry/Inquiry.mjs +3 -0
- package/dist/inquiry/Inquiry.mjs.map +1 -1
- package/dist/inquiry/v2/InquiryV2.d.ts +8 -6
- package/dist/inquiry/v2/InquiryV2.d.ts.map +1 -1
- package/dist/inquiry/v2/InquiryV2.js +45 -24
- package/dist/inquiry/v2/InquiryV2.js.map +1 -1
- package/dist/inquiry/v2/InquiryV2.mjs +108 -61
- package/dist/inquiry/v2/InquiryV2.mjs.map +1 -1
- package/dist/inquiry/v2/InquiryV2.module.css +60 -15
- package/dist/inquiry/v2/InquiryWorkspace.d.ts +9 -9
- package/dist/inquiry/v2/InquiryWorkspace.d.ts.map +1 -1
- package/dist/inquiry/v2/InquiryWorkspace.js +531 -408
- package/dist/inquiry/v2/InquiryWorkspace.js.map +1 -1
- package/dist/inquiry/v2/InquiryWorkspace.mjs +524 -408
- package/dist/inquiry/v2/InquiryWorkspace.mjs.map +1 -1
- package/dist/inquiry/v2/ai/InquiryV2Copilot.d.ts +3 -2
- package/dist/inquiry/v2/ai/InquiryV2Copilot.d.ts.map +1 -1
- package/dist/inquiry/v2/ai/InquiryV2Copilot.js +20 -37
- package/dist/inquiry/v2/ai/InquiryV2Copilot.js.map +1 -1
- package/dist/inquiry/v2/ai/InquiryV2Copilot.mjs +19 -31
- package/dist/inquiry/v2/ai/InquiryV2Copilot.mjs.map +1 -1
- package/dist/inquiry/v2/ai/copilotModel.d.ts +6 -14
- package/dist/inquiry/v2/ai/copilotModel.d.ts.map +1 -1
- package/dist/inquiry/v2/ai/copilotModel.js +35 -87
- package/dist/inquiry/v2/ai/copilotModel.js.map +1 -1
- package/dist/inquiry/v2/ai/copilotModel.mjs +23 -47
- package/dist/inquiry/v2/ai/copilotModel.mjs.map +1 -1
- package/dist/inquiry/v2/api/queries.d.ts +46 -73
- package/dist/inquiry/v2/api/queries.d.ts.map +1 -1
- package/dist/inquiry/v2/api/queries.js +151 -210
- package/dist/inquiry/v2/api/queries.js.map +1 -1
- package/dist/inquiry/v2/api/queries.mjs +227 -183
- package/dist/inquiry/v2/api/queries.mjs.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/ActionsCapability.d.ts.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/ActionsCapability.js +103 -32
- package/dist/inquiry/v2/capabilities/actions/ActionsCapability.js.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/ActionsCapability.mjs +92 -32
- package/dist/inquiry/v2/capabilities/actions/ActionsCapability.mjs.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/ActionsCapability.module.css +8 -1
- package/dist/inquiry/v2/capabilities/actions/EntityFormSurface.d.ts +20 -16
- package/dist/inquiry/v2/capabilities/actions/EntityFormSurface.d.ts.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/EntityFormSurface.js +111 -68
- package/dist/inquiry/v2/capabilities/actions/EntityFormSurface.js.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/EntityFormSurface.mjs +108 -142
- package/dist/inquiry/v2/capabilities/actions/EntityFormSurface.mjs.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/RetrieveSurface.mjs +1 -1
- package/dist/inquiry/v2/capabilities/actions/actionModel.d.ts +66 -50
- package/dist/inquiry/v2/capabilities/actions/actionModel.d.ts.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/actionModel.js +141 -66
- package/dist/inquiry/v2/capabilities/actions/actionModel.js.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/actionModel.mjs +115 -53
- package/dist/inquiry/v2/capabilities/actions/actionModel.mjs.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/parentKeyDefaults.d.ts +26 -0
- package/dist/inquiry/v2/capabilities/actions/parentKeyDefaults.d.ts.map +1 -0
- package/dist/inquiry/v2/capabilities/actions/parentKeyDefaults.js +36 -0
- package/dist/inquiry/v2/capabilities/actions/parentKeyDefaults.js.map +1 -0
- package/dist/inquiry/v2/capabilities/actions/parentKeyDefaults.mjs +41 -0
- package/dist/inquiry/v2/capabilities/actions/parentKeyDefaults.mjs.map +1 -0
- package/dist/inquiry/v2/capabilities/actions/runAction.d.ts +3 -2
- package/dist/inquiry/v2/capabilities/actions/runAction.d.ts.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/runAction.js +27 -23
- package/dist/inquiry/v2/capabilities/actions/runAction.js.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/runAction.mjs +26 -20
- package/dist/inquiry/v2/capabilities/actions/runAction.mjs.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/useHeaderFold.d.ts +20 -0
- package/dist/inquiry/v2/capabilities/actions/useHeaderFold.d.ts.map +1 -0
- package/dist/inquiry/v2/capabilities/actions/useHeaderFold.js +112 -0
- package/dist/inquiry/v2/capabilities/actions/useHeaderFold.js.map +1 -0
- package/dist/inquiry/v2/capabilities/actions/useHeaderFold.mjs +118 -0
- package/dist/inquiry/v2/capabilities/actions/useHeaderFold.mjs.map +1 -0
- package/dist/inquiry/v2/capabilities/actions/useSheetPanel.d.ts +25 -1
- package/dist/inquiry/v2/capabilities/actions/useSheetPanel.d.ts.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/useSheetPanel.js +7 -4
- package/dist/inquiry/v2/capabilities/actions/useSheetPanel.js.map +1 -1
- package/dist/inquiry/v2/capabilities/actions/useSheetPanel.mjs +9 -4
- package/dist/inquiry/v2/capabilities/actions/useSheetPanel.mjs.map +1 -1
- package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.d.ts +5 -3
- package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.d.ts.map +1 -1
- package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.js +11 -8
- package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.js.map +1 -1
- package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.mjs +13 -7
- package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.mjs.map +1 -1
- package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.module.css +4 -4
- package/dist/inquiry/v2/capabilities/header/HeaderCapability.d.ts +1 -1
- package/dist/inquiry/v2/capabilities/header/HeaderCapability.d.ts.map +1 -1
- package/dist/inquiry/v2/capabilities/header/HeaderCapability.js +20 -17
- package/dist/inquiry/v2/capabilities/header/HeaderCapability.js.map +1 -1
- package/dist/inquiry/v2/capabilities/header/HeaderCapability.mjs +101 -111
- package/dist/inquiry/v2/capabilities/header/HeaderCapability.mjs.map +1 -1
- package/dist/inquiry/v2/capabilities/header/HeaderCapability.module.css +9 -6
- package/dist/inquiry/v2/capabilities/tabs/TabsCapability.d.ts +2 -1
- package/dist/inquiry/v2/capabilities/tabs/TabsCapability.d.ts.map +1 -1
- package/dist/inquiry/v2/capabilities/tabs/TabsCapability.js +9 -2
- package/dist/inquiry/v2/capabilities/tabs/TabsCapability.js.map +1 -1
- package/dist/inquiry/v2/capabilities/tabs/TabsCapability.mjs +18 -15
- package/dist/inquiry/v2/capabilities/tabs/TabsCapability.mjs.map +1 -1
- package/dist/inquiry/v2/index.d.ts +0 -1
- package/dist/inquiry/v2/index.d.ts.map +1 -1
- package/dist/inquiry/v2/index.js.map +1 -1
- package/dist/inquiry/v2/kernel/ActionRunnerContext.d.ts +3 -3
- package/dist/inquiry/v2/kernel/ActionRunnerContext.d.ts.map +1 -1
- package/dist/inquiry/v2/kernel/ActionRunnerContext.js +11 -5
- package/dist/inquiry/v2/kernel/ActionRunnerContext.js.map +1 -1
- package/dist/inquiry/v2/kernel/ActionRunnerContext.mjs +15 -12
- package/dist/inquiry/v2/kernel/ActionRunnerContext.mjs.map +1 -1
- package/dist/inquiry/v2/kernel/ReadOnlyContext.d.ts +3 -0
- package/dist/inquiry/v2/kernel/ReadOnlyContext.d.ts.map +1 -0
- package/dist/inquiry/v2/kernel/ReadOnlyContext.js +14 -0
- package/dist/inquiry/v2/kernel/ReadOnlyContext.js.map +1 -0
- package/dist/inquiry/v2/kernel/ReadOnlyContext.mjs +20 -0
- package/dist/inquiry/v2/kernel/ReadOnlyContext.mjs.map +1 -0
- package/dist/inquiry/v2/kernel/RecordContext.d.ts +2 -0
- package/dist/inquiry/v2/kernel/RecordContext.d.ts.map +1 -1
- package/dist/inquiry/v2/kernel/RecordContext.js.map +1 -1
- package/dist/inquiry/v2/kernel/RecordContext.mjs.map +1 -1
- package/dist/inquiry/v2/kernel/UdpNodeView.d.ts.map +1 -1
- package/dist/inquiry/v2/kernel/UdpNodeView.js +18 -13
- package/dist/inquiry/v2/kernel/UdpNodeView.js.map +1 -1
- package/dist/inquiry/v2/kernel/UdpNodeView.mjs +177 -140
- package/dist/inquiry/v2/kernel/UdpNodeView.mjs.map +1 -1
- package/dist/inquiry/v2/kernel/UdpNodeView.module.css +56 -5
- package/dist/inquiry/v2/kernel/capabilities.d.ts +0 -2
- package/dist/inquiry/v2/kernel/capabilities.d.ts.map +1 -1
- package/dist/inquiry/v2/kernel/capabilities.js.map +1 -1
- package/dist/inquiry/v2/kernel/capabilities.mjs.map +1 -1
- package/dist/inquiry/v2/landing/InquiryExplorePage.d.ts +26 -37
- package/dist/inquiry/v2/landing/InquiryExplorePage.d.ts.map +1 -1
- package/dist/inquiry/v2/landing/InquiryExplorePage.js +48 -57
- package/dist/inquiry/v2/landing/InquiryExplorePage.js.map +1 -1
- package/dist/inquiry/v2/landing/InquiryExplorePage.mjs +102 -106
- package/dist/inquiry/v2/landing/InquiryExplorePage.mjs.map +1 -1
- package/dist/inquiry/v2/landing/InquiryExplorePage.module.css +58 -6
- package/dist/inquiry/v2/landing/InquiryLanding.d.ts +3 -3
- package/dist/inquiry/v2/landing/InquiryLanding.d.ts.map +1 -1
- package/dist/inquiry/v2/landing/InquiryLanding.js +8 -3
- package/dist/inquiry/v2/landing/InquiryLanding.js.map +1 -1
- package/dist/inquiry/v2/landing/InquiryLanding.mjs +51 -35
- package/dist/inquiry/v2/landing/InquiryLanding.mjs.map +1 -1
- package/dist/inquiry/v2/landing/InquiryLanding.module.css +8 -0
- package/dist/inquiry/v2/page/UdpPageRenderer.d.ts +5 -1
- package/dist/inquiry/v2/page/UdpPageRenderer.d.ts.map +1 -1
- package/dist/inquiry/v2/page/UdpPageRenderer.js +13 -1
- package/dist/inquiry/v2/page/UdpPageRenderer.js.map +1 -1
- package/dist/inquiry/v2/page/UdpPageRenderer.mjs +36 -7
- package/dist/inquiry/v2/page/UdpPageRenderer.mjs.map +1 -1
- package/dist/inquiry/v2/search/InquirySearchPanel.d.ts +1 -7
- package/dist/inquiry/v2/search/InquirySearchPanel.d.ts.map +1 -1
- package/dist/inquiry/v2/search/InquirySearchPanel.js +6 -13
- package/dist/inquiry/v2/search/InquirySearchPanel.js.map +1 -1
- package/dist/inquiry/v2/search/InquirySearchPanel.mjs +4 -8
- package/dist/inquiry/v2/search/InquirySearchPanel.mjs.map +1 -1
- package/dist/inquiry/v2/search/RecordFinder.d.ts +30 -1
- package/dist/inquiry/v2/search/RecordFinder.d.ts.map +1 -1
- package/dist/inquiry/v2/search/RecordFinder.js +43 -20
- package/dist/inquiry/v2/search/RecordFinder.js.map +1 -1
- package/dist/inquiry/v2/search/RecordFinder.mjs +68 -42
- package/dist/inquiry/v2/search/RecordFinder.mjs.map +1 -1
- package/dist/inquiry/v2/search/index.d.ts +3 -3
- package/dist/inquiry/v2/search/index.d.ts.map +1 -1
- package/dist/inquiry/v2/search/index.js +1 -1
- package/dist/inquiry/v2/search/index.js.map +1 -1
- package/dist/inquiry/v2/search/searchModel.d.ts +130 -23
- package/dist/inquiry/v2/search/searchModel.d.ts.map +1 -1
- package/dist/inquiry/v2/search/searchModel.js +237 -36
- package/dist/inquiry/v2/search/searchModel.js.map +1 -1
- package/dist/inquiry/v2/search/searchModel.mjs +207 -34
- package/dist/inquiry/v2/search/searchModel.mjs.map +1 -1
- package/dist/inquiry/v2/search/useInquirySearch.d.ts.map +1 -1
- package/dist/inquiry/v2/search/useInquirySearch.js +46 -19
- package/dist/inquiry/v2/search/useInquirySearch.js.map +1 -1
- package/dist/inquiry/v2/search/useInquirySearch.mjs +83 -84
- package/dist/inquiry/v2/search/useInquirySearch.mjs.map +1 -1
- package/dist/inquiry/v2/tree/InquiryFluentTreeMenu.d.ts +4 -1
- package/dist/inquiry/v2/tree/InquiryFluentTreeMenu.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/InquiryFluentTreeMenu.js +174 -166
- package/dist/inquiry/v2/tree/InquiryFluentTreeMenu.js.map +1 -1
- package/dist/inquiry/v2/tree/InquiryFluentTreeMenu.mjs +343 -325
- package/dist/inquiry/v2/tree/InquiryFluentTreeMenu.mjs.map +1 -1
- package/dist/inquiry/v2/tree/InquiryMenuToolbar.d.ts +3 -1
- package/dist/inquiry/v2/tree/InquiryMenuToolbar.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/InquiryMenuToolbar.js +8 -7
- package/dist/inquiry/v2/tree/InquiryMenuToolbar.js.map +1 -1
- package/dist/inquiry/v2/tree/InquiryMenuToolbar.mjs +68 -72
- package/dist/inquiry/v2/tree/InquiryMenuToolbar.mjs.map +1 -1
- package/dist/inquiry/v2/tree/LoadRecordDialog.d.ts +3 -3
- package/dist/inquiry/v2/tree/LoadRecordDialog.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/LoadRecordDialog.js +12 -7
- package/dist/inquiry/v2/tree/LoadRecordDialog.js.map +1 -1
- package/dist/inquiry/v2/tree/LoadRecordDialog.mjs +48 -33
- package/dist/inquiry/v2/tree/LoadRecordDialog.mjs.map +1 -1
- package/dist/inquiry/v2/tree/NodeList.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/NodeList.js +17 -6
- package/dist/inquiry/v2/tree/NodeList.js.map +1 -1
- package/dist/inquiry/v2/tree/NodeList.mjs +49 -36
- package/dist/inquiry/v2/tree/NodeList.mjs.map +1 -1
- package/dist/inquiry/v2/tree/arrivalModel.d.ts +15 -0
- package/dist/inquiry/v2/tree/arrivalModel.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/arrivalModel.js +14 -1
- package/dist/inquiry/v2/tree/arrivalModel.js.map +1 -1
- package/dist/inquiry/v2/tree/arrivalModel.mjs +12 -1
- package/dist/inquiry/v2/tree/arrivalModel.mjs.map +1 -1
- package/dist/inquiry/v2/tree/branchRefreshModel.d.ts +32 -0
- package/dist/inquiry/v2/tree/branchRefreshModel.d.ts.map +1 -0
- package/dist/inquiry/v2/tree/branchRefreshModel.js +62 -0
- package/dist/inquiry/v2/tree/branchRefreshModel.js.map +1 -0
- package/dist/inquiry/v2/tree/branchRefreshModel.mjs +60 -0
- package/dist/inquiry/v2/tree/branchRefreshModel.mjs.map +1 -0
- package/dist/inquiry/v2/tree/droppedPageModel.d.ts +23 -1
- package/dist/inquiry/v2/tree/droppedPageModel.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/droppedPageModel.js +53 -26
- package/dist/inquiry/v2/tree/droppedPageModel.js.map +1 -1
- package/dist/inquiry/v2/tree/droppedPageModel.mjs +48 -20
- package/dist/inquiry/v2/tree/droppedPageModel.mjs.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/treeMenuVisuals.d.ts +7 -12
- package/dist/inquiry/v2/tree/fluentTreeMenu/treeMenuVisuals.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/treeMenuVisuals.js +44 -15
- package/dist/inquiry/v2/tree/fluentTreeMenu/treeMenuVisuals.js.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/treeMenuVisuals.mjs +34 -15
- package/dist/inquiry/v2/tree/fluentTreeMenu/treeMenuVisuals.mjs.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/useAggregateBadges.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/useAggregateBadges.js +7 -18
- package/dist/inquiry/v2/tree/fluentTreeMenu/useAggregateBadges.js.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/useAggregateBadges.mjs +6 -14
- package/dist/inquiry/v2/tree/fluentTreeMenu/useAggregateBadges.mjs.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/useChildCountBadges.d.ts +20 -16
- package/dist/inquiry/v2/tree/fluentTreeMenu/useChildCountBadges.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/useChildCountBadges.js +77 -55
- package/dist/inquiry/v2/tree/fluentTreeMenu/useChildCountBadges.js.map +1 -1
- package/dist/inquiry/v2/tree/fluentTreeMenu/useChildCountBadges.mjs +85 -106
- package/dist/inquiry/v2/tree/fluentTreeMenu/useChildCountBadges.mjs.map +1 -1
- package/dist/inquiry/v2/tree/lineageModel.d.ts +18 -1
- package/dist/inquiry/v2/tree/lineageModel.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/lineageModel.js +71 -2
- package/dist/inquiry/v2/tree/lineageModel.js.map +1 -1
- package/dist/inquiry/v2/tree/lineageModel.mjs +53 -3
- package/dist/inquiry/v2/tree/lineageModel.mjs.map +1 -1
- package/dist/inquiry/v2/tree/menuRebuildModel.d.ts +10 -27
- package/dist/inquiry/v2/tree/menuRebuildModel.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/menuRebuildModel.js +8 -58
- package/dist/inquiry/v2/tree/menuRebuildModel.js.map +1 -1
- package/dist/inquiry/v2/tree/menuRebuildModel.mjs +8 -51
- package/dist/inquiry/v2/tree/menuRebuildModel.mjs.map +1 -1
- package/dist/inquiry/v2/tree/pagedChildrenModel.d.ts +26 -0
- package/dist/inquiry/v2/tree/pagedChildrenModel.d.ts.map +1 -0
- package/dist/inquiry/v2/tree/pagedChildrenModel.js +56 -0
- package/dist/inquiry/v2/tree/pagedChildrenModel.js.map +1 -0
- package/dist/inquiry/v2/tree/pagedChildrenModel.mjs +43 -0
- package/dist/inquiry/v2/tree/pagedChildrenModel.mjs.map +1 -0
- package/dist/inquiry/v2/tree/rootRemovalModel.d.ts +7 -0
- package/dist/inquiry/v2/tree/rootRemovalModel.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/rootRemovalModel.js +31 -5
- package/dist/inquiry/v2/tree/rootRemovalModel.js.map +1 -1
- package/dist/inquiry/v2/tree/rootRemovalModel.mjs +21 -4
- package/dist/inquiry/v2/tree/rootRemovalModel.mjs.map +1 -1
- package/dist/inquiry/v2/tree/treeFilterModel.d.ts +0 -2
- package/dist/inquiry/v2/tree/treeFilterModel.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/treeFilterModel.js +0 -7
- package/dist/inquiry/v2/tree/treeFilterModel.js.map +1 -1
- package/dist/inquiry/v2/tree/treeFilterModel.mjs.map +1 -1
- package/dist/inquiry/v2/tree/useInquiryMenu.d.ts +16 -7
- package/dist/inquiry/v2/tree/useInquiryMenu.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/useInquiryMenu.js +401 -163
- package/dist/inquiry/v2/tree/useInquiryMenu.js.map +1 -1
- package/dist/inquiry/v2/tree/useInquiryMenu.mjs +511 -310
- package/dist/inquiry/v2/tree/useInquiryMenu.mjs.map +1 -1
- package/dist/inquiry/v2/tree/waveLoader.d.ts +10 -11
- package/dist/inquiry/v2/tree/waveLoader.d.ts.map +1 -1
- package/dist/inquiry/v2/tree/waveLoader.js +78 -72
- package/dist/inquiry/v2/tree/waveLoader.js.map +1 -1
- package/dist/inquiry/v2/tree/waveLoader.mjs +79 -68
- package/dist/inquiry/v2/tree/waveLoader.mjs.map +1 -1
- package/dist/inquiry/v2/widgets/listRow.module.css +27 -0
- package/dist/inquiry/v2/widgets/widgetRowModel.d.ts +6 -2
- package/dist/inquiry/v2/widgets/widgetRowModel.d.ts.map +1 -1
- package/dist/inquiry/v2/widgets/widgetRowModel.js +49 -14
- package/dist/inquiry/v2/widgets/widgetRowModel.js.map +1 -1
- package/dist/inquiry/v2/widgets/widgetRowModel.mjs +36 -12
- package/dist/inquiry/v2/widgets/widgetRowModel.mjs.map +1 -1
- package/dist/maintenance/UdpTaggedRecordsPage.mjs +1 -1
- package/dist/maintenance/api/lookupApi.mjs +1 -1
- package/dist/maintenance/api/tagsApi.mjs +1 -1
- package/dist/maintenance/config/nodeDefaults.d.ts.map +1 -1
- package/dist/maintenance/config/nodeDefaults.js +16 -5
- package/dist/maintenance/config/nodeDefaults.js.map +1 -1
- package/dist/maintenance/config/nodeDefaults.mjs +14 -5
- package/dist/maintenance/config/nodeDefaults.mjs.map +1 -1
- package/dist/maintenance/config/useEntityConfig.mjs +1 -1
- package/dist/maintenance/config/useLinkedLabels.mjs +1 -1
- package/dist/maintenance/grid/MaintenanceGrid.mjs +1 -1
- package/dist/maintenance/metadata/useEntityMetadata.mjs +1 -1
- package/dist/maintenance/record/ChildTab.mjs +1 -1
- package/dist/maintenance/record/DeleteRecordDialog.mjs +1 -1
- package/dist/maintenance/record/LinkRecordsSheet.mjs +1 -1
- package/dist/maintenance/record/RecordFacts.mjs +1 -1
- package/dist/maintenance/record/RecordSheet.mjs +2 -2
- package/dist/maintenance/record/displayValue.mjs +1 -1
- package/dist/maintenance/record/stampDisplayText.mjs +1 -1
- package/dist/maintenance/settings/useEntityCatalog.mjs +1 -1
- package/dist/maintenanceEngine/tableBrowser/TableColumnDefs.d.ts +4 -5
- package/dist/maintenanceEngine/tableBrowser/TableColumnDefs.d.ts.map +1 -1
- package/dist/stores/inquiryStore.d.ts +2 -1
- package/dist/stores/inquiryStore.d.ts.map +1 -1
- package/dist/stores/inquiryStore.js +4 -3
- package/dist/stores/inquiryStore.js.map +1 -1
- package/dist/stores/inquiryStore.mjs +18 -11
- package/dist/stores/inquiryStore.mjs.map +1 -1
- package/dist/udp/pages/UdpMaintenanceEnginePage/UdpMaintenanceEnginePage.d.ts.map +1 -1
- package/dist/udp/pages/UdpMaintenanceEnginePage/UdpMaintenanceEnginePage.js +1 -1
- package/dist/udp/pages/UdpMaintenanceEnginePage/UdpMaintenanceEnginePage.js.map +1 -1
- package/dist/udp/pages/UdpMaintenanceEnginePage/UdpMaintenanceEnginePage.mjs +2 -1
- package/dist/udp/pages/UdpMaintenanceEnginePage/UdpMaintenanceEnginePage.mjs.map +1 -1
- package/dist/udp/pages/UdpMaintenanceEnginePage/components/EntitiyTimeLine.mjs +1 -1
- package/dist/udp/utilities/useDateStringColumnDef.d.ts +1 -1
- package/dist/utilities/i18n/locales/es-US.json +23 -5
- package/dist/utilities/i18n/locales/es-US.mjs +24 -4
- package/dist/utilities/i18n/locales/fr-CA.json +23 -5
- package/dist/utilities/i18n/locales/fr-CA.mjs +24 -4
- package/package.json +30 -18
- package/dist/actionPanels/PanelActionForm.d.ts +0 -56
- package/dist/actionPanels/PanelActionForm.d.ts.map +0 -1
- package/dist/actionPanels/PanelActionForm.js +0 -30
- package/dist/actionPanels/PanelActionForm.js.map +0 -1
- package/dist/actionPanels/PanelActionForm.mjs +0 -168
- package/dist/actionPanels/PanelActionForm.mjs.map +0 -1
- package/dist/actionPanels/PanelEditor.d.ts +0 -44
- package/dist/actionPanels/PanelEditor.d.ts.map +0 -1
- package/dist/actionPanels/PanelEditor.js +0 -78
- package/dist/actionPanels/PanelEditor.js.map +0 -1
- package/dist/actionPanels/PanelEditor.mjs +0 -345
- package/dist/actionPanels/PanelEditor.mjs.map +0 -1
- package/dist/actionPanels/panelActionFields.module.css +0 -18
- package/dist/domain/inquiryTree/ruleBindings.d.ts +0 -10
- package/dist/domain/inquiryTree/ruleBindings.d.ts.map +0 -1
- package/dist/domain/inquiryTree/ruleBindings.js +0 -20
- package/dist/domain/inquiryTree/ruleBindings.js.map +0 -1
- package/dist/domain/inquiryTree/ruleBindings.mjs +0 -21
- package/dist/domain/inquiryTree/ruleBindings.mjs.map +0 -1
- package/dist/inquiry/v2/kernel/readOnlyModel.d.ts +0 -17
- package/dist/inquiry/v2/kernel/readOnlyModel.d.ts.map +0 -1
- package/dist/inquiry/v2/kernel/readOnlyModel.js +0 -19
- package/dist/inquiry/v2/kernel/readOnlyModel.js.map +0 -1
- package/dist/inquiry/v2/kernel/readOnlyModel.mjs +0 -21
- package/dist/inquiry/v2/kernel/readOnlyModel.mjs.map +0 -1
|
@@ -1,83 +1,126 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The create/update sheet's
|
|
2
|
+
* The create/update sheet's default body: the MAINTENANCE RECORD FORM.
|
|
3
3
|
*
|
|
4
|
-
* An Update/Create action with no page configured
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* edits the record instead of apologising.
|
|
4
|
+
* An Update/Create action with no page configured edits the record in the
|
|
5
|
+
* form the maintenance pages show for its entity — the same `RecordForm`, over
|
|
6
|
+
* the same metadata and resolved settings (`useEntityPage`: labels, order,
|
|
7
|
+
* groups, required fields, pickers). A field is set up once, in Maintenance
|
|
8
|
+
* settings, and reads the same here.
|
|
10
9
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
10
|
+
* Two things are the sheet's own:
|
|
11
|
+
* · the SAVE goes through the action's method — the sheet panel's guarded
|
|
12
|
+
* `onCreate`/`onUpdate`, which refresh the record and the tree;
|
|
13
|
+
* · the BUTTON is the drawer's footer button, registered the way a page
|
|
14
|
+
* registers its own, so the sheet has one primary and it is the platform's.
|
|
15
15
|
*/
|
|
16
|
-
import React, {
|
|
17
|
-
import {
|
|
16
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
17
|
+
import { useTranslation } from 'react-i18next';
|
|
18
18
|
import { UdpSpinner } from '../../../../UI/fluent-web-components/UdpSpinner';
|
|
19
19
|
import { UdpText } from '../../../../UI/fluent-web-components/UdpText';
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
20
|
+
import { getEntityFull } from '../../../../maintenance/api/entityApi';
|
|
21
|
+
import { RecordForm } from '../../../../maintenance/record/RecordForm';
|
|
22
|
+
import { formGroups, keyValuesOf, toRequestBody, validateRecord } from '../../../../maintenance/record/recordModel';
|
|
23
|
+
import { useEntityPage } from '../../../../maintenance/useEntityPage';
|
|
23
24
|
import { getPathObject } from '../../../../utilities/maintenanceEngine/CrudBrowserUtilities';
|
|
24
|
-
import {
|
|
25
|
+
import { parentKeyDefaults } from './parentKeyDefaults';
|
|
25
26
|
import styles from './EntityFormSurface.module.css';
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
27
|
+
export const EntityFormSurface = ({ surface, nodeObj, closeSurface, onCreate, onUpdate, parents, footer, unavailableMessage }) => {
|
|
28
|
+
const { t } = useTranslation();
|
|
29
|
+
const { entityName, updateMethod } = surface;
|
|
30
|
+
const mode = surface.mode === 'create' ? 'new' : 'edit';
|
|
31
|
+
const { meta, config, promoted, loading } = useEntityPage(entityName);
|
|
32
|
+
const groups = useMemo(() => (meta && config ? formGroups(meta, config, mode) : []), [meta, config, mode]);
|
|
33
|
+
// A new record's parent key, pre-filled and locked as a maintenance
|
|
34
|
+
// drill-down's Add does it.
|
|
35
|
+
const prefill = useMemo(() => mode === 'new' && meta ? parentKeyDefaults(meta, parents) : undefined,
|
|
36
|
+
// The sources are the record the sheet opened on: fixed for its life.
|
|
37
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
38
|
+
[mode, meta]);
|
|
39
|
+
// An update starts from the WHOLE record: the tree's row holds only what
|
|
40
|
+
// its query returns, and the save sends every field. Where the record can't
|
|
41
|
+
// be re-read (no promoted Get), the row is what there is.
|
|
42
|
+
const [entered, setValues] = useState(mode === 'new' ? {} : undefined);
|
|
43
|
+
const values = useMemo(() => (entered && prefill ? Object.assign(Object.assign({}, entered), prefill.defaults) : entered), [entered, prefill]);
|
|
44
|
+
// Loaded ONCE: the sheet edits the record it opened on. The row's object is
|
|
45
|
+
// replaced whenever the tree behind the sheet rebuilds, and reading it again
|
|
46
|
+
// then would put the fetched record over what has been typed.
|
|
47
|
+
const loaded = entered !== undefined;
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (mode === 'new' || loading || !meta || loaded)
|
|
50
|
+
return undefined;
|
|
51
|
+
let live = true;
|
|
52
|
+
const fromRow = () => live && setValues(Object.assign({}, nodeObj));
|
|
53
|
+
if (!promoted)
|
|
54
|
+
fromRow();
|
|
55
|
+
else
|
|
56
|
+
getEntityFull(promoted, keyValuesOf(meta, nodeObj)).then((record) => live && setValues(record), fromRow);
|
|
57
|
+
return () => {
|
|
58
|
+
live = false;
|
|
59
|
+
};
|
|
60
|
+
}, [mode, loading, meta, promoted, nodeObj, loaded]);
|
|
61
|
+
const [errors, setErrors] = useState({});
|
|
62
|
+
const change = (field, value) => {
|
|
63
|
+
setValues((current) => (Object.assign(Object.assign({}, current), { [field]: value })));
|
|
64
|
+
setErrors((current) => {
|
|
65
|
+
const next = Object.assign({}, current);
|
|
66
|
+
delete next[field];
|
|
67
|
+
return next;
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
const { setSideSheetButtonLabel, setSideSheetOnSubmit, setSideSheetProps } = footer;
|
|
71
|
+
const [saving, setSaving] = useState(false);
|
|
72
|
+
const submit = async () => {
|
|
73
|
+
var _a;
|
|
74
|
+
if (!meta || !values)
|
|
75
|
+
return;
|
|
76
|
+
const found = validateRecord(groups, values);
|
|
77
|
+
setErrors(found);
|
|
78
|
+
if (Object.keys(found).length > 0)
|
|
79
|
+
return;
|
|
80
|
+
const requestBody = toRequestBody(meta, values, mode);
|
|
81
|
+
setSaving(true);
|
|
82
|
+
setSideSheetProps({ progress: true });
|
|
83
|
+
try {
|
|
84
|
+
const response = mode === 'new'
|
|
85
|
+
? await onCreate({ data: { requestBody } })
|
|
86
|
+
: await onUpdate({
|
|
87
|
+
data: Object.assign(Object.assign({}, ((updateMethod === null || updateMethod === void 0 ? void 0 : updateMethod.pathParameters)
|
|
88
|
+
? getPathObject(updateMethod.pathParameters, keyValuesOf(meta, values))
|
|
89
|
+
: {})), { requestBody })
|
|
90
|
+
});
|
|
91
|
+
const status = (_a = response === null || response === void 0 ? void 0 : response.status) !== null && _a !== void 0 ? _a : 0;
|
|
92
|
+
if (status >= 200 && status < 300)
|
|
93
|
+
closeSurface();
|
|
63
94
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
|
|
95
|
+
catch (_b) {
|
|
96
|
+
// onCreate/onUpdate have already told the user; the form stays open.
|
|
97
|
+
}
|
|
98
|
+
finally {
|
|
99
|
+
setSaving(false);
|
|
100
|
+
setSideSheetProps({ progress: false });
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
// The footer button runs the latest submit, registered once the form shows.
|
|
104
|
+
const ready = groups.length > 0 && !!values;
|
|
105
|
+
const submitRef = useRef(submit);
|
|
106
|
+
submitRef.current = submit;
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
if (!ready)
|
|
109
|
+
return;
|
|
110
|
+
// A registration, as a mounted page makes: the footer button is the
|
|
111
|
+
// drawer's, and only this form knows what it is called and what it runs.
|
|
112
|
+
setSideSheetButtonLabel(mode === 'new'
|
|
113
|
+
? t('common.add', { defaultValue: 'Add' })
|
|
114
|
+
: t('common.save', { defaultValue: 'Save' }));
|
|
115
|
+
// eslint-disable-next-line react-you-might-not-need-an-effect/no-pass-live-state-to-parent
|
|
116
|
+
setSideSheetOnSubmit(() => () => submitRef.current());
|
|
117
|
+
}, [ready, mode, t, setSideSheetButtonLabel, setSideSheetOnSubmit]);
|
|
118
|
+
if (loading || (meta && config && groups.length > 0 && !values)) {
|
|
76
119
|
return (React.createElement("div", { className: styles.centered }, React.createElement(UdpSpinner, null)));
|
|
77
120
|
}
|
|
78
|
-
if (!
|
|
121
|
+
if (!meta || !ready) {
|
|
79
122
|
return React.createElement(UdpText, { variant: "body1" }, unavailableMessage);
|
|
80
123
|
}
|
|
81
|
-
return (React.createElement(
|
|
124
|
+
return (React.createElement(RecordForm, { meta: meta, groups: groups, values: values, errors: errors, onChange: change, disabled: saving, locked: prefill === null || prefill === void 0 ? void 0 : prefill.locked }));
|
|
82
125
|
};
|
|
83
126
|
//# sourceMappingURL=EntityFormSurface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityFormSurface.js","sourceRoot":"","sources":["../../../../../src/inquiry/v2/capabilities/actions/EntityFormSurface.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"EntityFormSurface.js","sourceRoot":"","sources":["../../../../../src/inquiry/v2/capabilities/actions/EntityFormSurface.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAC;AAC7E,OAAO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AAE,MAAM,EAAE,CAAC,CAC/C,CAAC;QACF,2FAA2F;QAC3F,oBAAoB,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;IAAA,CACvD,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,uBAAuB,EAAE,oBAAoB,CAAC,CAAC,CAAC;IAEpE,IAAI,OAAO,IAAI,CAAC,IAAI,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QAChE,OAAO,CACL,6BAAK,SAAS,EAAE,MAAM,CAAC,QAAQ,IAC7B,oBAAC,UAAU,OAAG,CACV,CACP,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QACpB,OAAO,oBAAC,OAAO,IAAC,OAAO,EAAC,OAAO,IAAE,kBAAkB,CAAW,CAAC;IACjE,CAAC;IAED,OAAO,CACL,oBAAC,UAAU,IACT,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,GACvB,CACH,CAAC;AAAA,CACH,CAAC"}
|
|
@@ -1,156 +1,122 @@
|
|
|
1
|
-
import { c } from "../../../../reactCompilerRuntime.mjs";
|
|
2
1
|
import { getPathObject } from "../../../../utilities/maintenanceEngine/CrudBrowserUtilities.mjs";
|
|
3
2
|
import { UdpSpinner } from "../../../../UI/fluent-web-components/UdpSpinner.mjs";
|
|
4
3
|
import { UdpText } from "../../../../UI/fluent-web-components/UdpText.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
4
|
+
import { getEntityFull } from "../../../../maintenance/api/entityApi.mjs";
|
|
5
|
+
import { useEntityPage } from "../../../../maintenance/useEntityPage.mjs";
|
|
6
|
+
import { formGroups, keyValuesOf, toRequestBody, validateRecord } from "../../../../maintenance/record/recordModel.mjs";
|
|
7
|
+
import { RecordForm } from "../../../../maintenance/record/RecordForm.mjs";
|
|
8
|
+
import { parentKeyDefaults } from "./parentKeyDefaults.mjs";
|
|
9
|
+
import React, { useEffect, useMemo, useRef, useState } from "react";
|
|
10
|
+
import { useTranslation } from "react-i18next";
|
|
11
11
|
import styles from "./EntityFormSurface.module.css";
|
|
12
12
|
//#region src/inquiry/v2/capabilities/actions/EntityFormSurface.tsx
|
|
13
13
|
/**
|
|
14
|
-
* The create/update sheet's
|
|
14
|
+
* The create/update sheet's default body: the MAINTENANCE RECORD FORM.
|
|
15
15
|
*
|
|
16
|
-
* An Update/Create action with no page configured
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* edits the record instead of apologising.
|
|
16
|
+
* An Update/Create action with no page configured edits the record in the
|
|
17
|
+
* form the maintenance pages show for its entity — the same `RecordForm`, over
|
|
18
|
+
* the same metadata and resolved settings (`useEntityPage`: labels, order,
|
|
19
|
+
* groups, required fields, pickers). A field is set up once, in Maintenance
|
|
20
|
+
* settings, and reads the same here.
|
|
22
21
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
22
|
+
* Two things are the sheet's own:
|
|
23
|
+
* · the SAVE goes through the action's method — the sheet panel's guarded
|
|
24
|
+
* `onCreate`/`onUpdate`, which refresh the record and the tree;
|
|
25
|
+
* · the BUTTON is the drawer's footer button, registered the way a page
|
|
26
|
+
* registers its own, so the sheet has one primary and it is the platform's.
|
|
27
27
|
*/
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
};
|
|
54
|
-
const { foreignKeyData, entitiesMissingGetAll } = await fetchForeignKeyData(catalogId, attributes, fieldSearchApiId);
|
|
55
|
-
for (const missing of entitiesMissingGetAll) console.warn(`[inquiry-v2 actions] ${missing}'s Get-All method is not promoted — its field has no options`);
|
|
56
|
-
return {
|
|
57
|
-
entityAttributes,
|
|
58
|
-
udpFieldInfos,
|
|
59
|
-
foreignKeyData
|
|
60
|
-
};
|
|
28
|
+
const EntityFormSurface = ({ surface, nodeObj, closeSurface, onCreate, onUpdate, parents, footer, unavailableMessage }) => {
|
|
29
|
+
const { t } = useTranslation();
|
|
30
|
+
const { entityName, updateMethod } = surface;
|
|
31
|
+
const mode = surface.mode === "create" ? "new" : "edit";
|
|
32
|
+
const { meta, config, promoted, loading } = useEntityPage(entityName);
|
|
33
|
+
const groups = useMemo(() => meta && config ? formGroups(meta, config, mode) : [], [
|
|
34
|
+
meta,
|
|
35
|
+
config,
|
|
36
|
+
mode
|
|
37
|
+
]);
|
|
38
|
+
const prefill = useMemo(() => mode === "new" && meta ? parentKeyDefaults(meta, parents) : void 0, [mode, meta]);
|
|
39
|
+
const [entered, setValues] = useState(mode === "new" ? {} : void 0);
|
|
40
|
+
const values = useMemo(() => entered && prefill ? {
|
|
41
|
+
...entered,
|
|
42
|
+
...prefill.defaults
|
|
43
|
+
} : entered, [entered, prefill]);
|
|
44
|
+
const loaded = entered !== void 0;
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (mode === "new" || loading || !meta || loaded) return void 0;
|
|
47
|
+
let live = true;
|
|
48
|
+
const fromRow = () => live && setValues({ ...nodeObj });
|
|
49
|
+
if (!promoted) fromRow();
|
|
50
|
+
else getEntityFull(promoted, keyValuesOf(meta, nodeObj)).then((record) => live && setValues(record), fromRow);
|
|
51
|
+
return () => {
|
|
52
|
+
live = false;
|
|
61
53
|
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
queryFn: t3
|
|
76
|
-
};
|
|
77
|
-
$[7] = t1;
|
|
78
|
-
$[8] = t2;
|
|
79
|
-
$[9] = t3;
|
|
80
|
-
$[10] = t4;
|
|
81
|
-
} else t4 = $[10];
|
|
82
|
-
const { data: inputs, isPending } = useQuery(t4);
|
|
83
|
-
let t5;
|
|
84
|
-
if ($[11] !== onCreate) {
|
|
85
|
-
t5 = (values) => onCreate({ data: { requestBody: values } });
|
|
86
|
-
$[11] = onCreate;
|
|
87
|
-
$[12] = t5;
|
|
88
|
-
} else t5 = $[12];
|
|
89
|
-
const handleCreate = t5;
|
|
90
|
-
let t6;
|
|
91
|
-
if ($[13] !== onUpdate || $[14] !== updateMethod) {
|
|
92
|
-
t6 = (values_0, primaryKeyValues) => {
|
|
93
|
-
return onUpdate({ data: {
|
|
94
|
-
...updateMethod?.pathParameters ? getPathObject(updateMethod.pathParameters, primaryKeyValues ?? []) : {},
|
|
95
|
-
requestBody: values_0
|
|
96
|
-
} });
|
|
97
|
-
};
|
|
98
|
-
$[13] = onUpdate;
|
|
99
|
-
$[14] = updateMethod;
|
|
100
|
-
$[15] = t6;
|
|
101
|
-
} else t6 = $[15];
|
|
102
|
-
const handleUpdate = t6;
|
|
103
|
-
if (loadingFieldMethod || !!fieldSearchApiId && isPending) {
|
|
104
|
-
let t7;
|
|
105
|
-
if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
|
|
106
|
-
t7 = /* @__PURE__ */ React.createElement("div", { className: styles.centered }, /* @__PURE__ */ React.createElement(UdpSpinner, null));
|
|
107
|
-
$[16] = t7;
|
|
108
|
-
} else t7 = $[16];
|
|
109
|
-
return t7;
|
|
110
|
-
}
|
|
111
|
-
if (!inputs?.entityAttributes?.length) {
|
|
112
|
-
let t7;
|
|
113
|
-
if ($[17] !== unavailableMessage) {
|
|
114
|
-
t7 = /* @__PURE__ */ React.createElement(UdpText, { variant: "body1" }, unavailableMessage);
|
|
115
|
-
$[17] = unavailableMessage;
|
|
116
|
-
$[18] = t7;
|
|
117
|
-
} else t7 = $[18];
|
|
118
|
-
return t7;
|
|
119
|
-
}
|
|
120
|
-
let t7;
|
|
121
|
-
if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
|
|
122
|
-
t7 = /* @__PURE__ */ React.createElement("div", { className: styles.centered }, /* @__PURE__ */ React.createElement(UdpSpinner, null));
|
|
123
|
-
$[19] = t7;
|
|
124
|
-
} else t7 = $[19];
|
|
125
|
-
const t8 = mode === "create";
|
|
126
|
-
const t9 = mode === "create" ? null : nodeObj;
|
|
127
|
-
const t10 = mode === "create" ? handleCreate : void 0;
|
|
128
|
-
const t11 = mode === "create" ? void 0 : handleUpdate;
|
|
129
|
-
let t12;
|
|
130
|
-
if ($[20] !== closeSurface || $[21] !== entityName || $[22] !== inputs.entityAttributes || $[23] !== inputs.foreignKeyData || $[24] !== inputs.udpFieldInfos || $[25] !== t10 || $[26] !== t11 || $[27] !== t8 || $[28] !== t9) {
|
|
131
|
-
t12 = /* @__PURE__ */ React.createElement(Suspense, { fallback: t7 }, /* @__PURE__ */ React.createElement(CrudForm, {
|
|
132
|
-
entityName,
|
|
133
|
-
entityAttributes: inputs.entityAttributes,
|
|
134
|
-
udpFieldInfos: inputs.udpFieldInfos,
|
|
135
|
-
foreignKeyData: inputs.foreignKeyData,
|
|
136
|
-
isNewEntry: t8,
|
|
137
|
-
crudTableEditionData: t9,
|
|
138
|
-
onCreate: t10,
|
|
139
|
-
onUpdate: t11,
|
|
140
|
-
closeSideSheet: closeSurface
|
|
54
|
+
}, [
|
|
55
|
+
mode,
|
|
56
|
+
loading,
|
|
57
|
+
meta,
|
|
58
|
+
promoted,
|
|
59
|
+
nodeObj,
|
|
60
|
+
loaded
|
|
61
|
+
]);
|
|
62
|
+
const [errors, setErrors] = useState({});
|
|
63
|
+
const change = (field, value) => {
|
|
64
|
+
setValues((current) => ({
|
|
65
|
+
...current,
|
|
66
|
+
[field]: value
|
|
141
67
|
}));
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
68
|
+
setErrors((current) => {
|
|
69
|
+
const next = { ...current };
|
|
70
|
+
delete next[field];
|
|
71
|
+
return next;
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
const { setSideSheetButtonLabel, setSideSheetOnSubmit, setSideSheetProps } = footer;
|
|
75
|
+
const [saving, setSaving] = useState(false);
|
|
76
|
+
const submit = async () => {
|
|
77
|
+
if (!meta || !values) return;
|
|
78
|
+
const found = validateRecord(groups, values);
|
|
79
|
+
setErrors(found);
|
|
80
|
+
if (Object.keys(found).length > 0) return;
|
|
81
|
+
const requestBody = toRequestBody(meta, values, mode);
|
|
82
|
+
setSaving(true);
|
|
83
|
+
setSideSheetProps({ progress: true });
|
|
84
|
+
try {
|
|
85
|
+
const status = (mode === "new" ? await onCreate({ data: { requestBody } }) : await onUpdate({ data: {
|
|
86
|
+
...updateMethod?.pathParameters ? getPathObject(updateMethod.pathParameters, keyValuesOf(meta, values)) : {},
|
|
87
|
+
requestBody
|
|
88
|
+
} }))?.status ?? 0;
|
|
89
|
+
if (status >= 200 && status < 300) closeSurface();
|
|
90
|
+
} catch {} finally {
|
|
91
|
+
setSaving(false);
|
|
92
|
+
setSideSheetProps({ progress: false });
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
const ready = groups.length > 0 && !!values;
|
|
96
|
+
const submitRef = useRef(submit);
|
|
97
|
+
submitRef.current = submit;
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
if (!ready) return;
|
|
100
|
+
setSideSheetButtonLabel(mode === "new" ? t("common.add", { defaultValue: "Add" }) : t("common.save", { defaultValue: "Save" }));
|
|
101
|
+
setSideSheetOnSubmit(() => () => submitRef.current());
|
|
102
|
+
}, [
|
|
103
|
+
ready,
|
|
104
|
+
mode,
|
|
105
|
+
t,
|
|
106
|
+
setSideSheetButtonLabel,
|
|
107
|
+
setSideSheetOnSubmit
|
|
108
|
+
]);
|
|
109
|
+
if (loading || meta && config && groups.length > 0 && !values) return /* @__PURE__ */ React.createElement("div", { className: styles.centered }, /* @__PURE__ */ React.createElement(UdpSpinner, null));
|
|
110
|
+
if (!meta || !ready) return /* @__PURE__ */ React.createElement(UdpText, { variant: "body1" }, unavailableMessage);
|
|
111
|
+
return /* @__PURE__ */ React.createElement(RecordForm, {
|
|
112
|
+
meta,
|
|
113
|
+
groups,
|
|
114
|
+
values,
|
|
115
|
+
errors,
|
|
116
|
+
onChange: change,
|
|
117
|
+
disabled: saving,
|
|
118
|
+
locked: prefill?.locked
|
|
119
|
+
});
|
|
154
120
|
};
|
|
155
121
|
//#endregion
|
|
156
122
|
export { EntityFormSurface };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityFormSurface.mjs","names":["React","Suspense","lazy","useCallback","useQuery","useQueryClient","UdpSpinner","UdpText","mergeEntityAttributes","EntityAttribute","crudFormAttributes","fetchForeignKeyData","fetchUdpFieldInfos","usePromotedMethodEntity","getPathObject","fetchEntityMeta","inquiryKeys","SheetSurface","styles","CrudForm","then","module","default","SubmitResponse","status","data","EntityFormSurfaceProps","surface","catalogId","nodeObj","Record","closeSurface","onCreate","Promise","onUpdate","unavailableMessage","EntityFormSurface","t0","$","_c","queryClient","entityName","mode","updateMethod","udpObjectFieldInfo","loading","loadingFieldMethod","unityBaseSearchMethod","apiMethodId","fieldSearchApiId","t1","entityForm","t2","t3","meta","udpFieldInfos","all","attributes","entityAttributes","length","foreignKeyData","entitiesMissingGetAll","missing","console","warn","t4","queryKey","enabled","staleTime","retry","queryFn","inputs","isPending","t5","values","requestBody","handleCreate","t6","values_0","primaryKeyValues","pathObject","pathParameters","handleUpdate","t7","Symbol","for","centered","t8","t9","t10","undefined","t11","t12"],"sources":["../../../../../src/inquiry/v2/capabilities/actions/EntityFormSurface.tsx"],"sourcesContent":["/**\n * The create/update sheet's fallback body: the PLATFORM'S DEFAULT entity form.\n *\n * An Update/Create action with no page configured used to print \"No page is\n * configured…\" — but the platform already has a default form for every entity\n * it can describe, and the Maintenance Engine's side sheet has always mounted\n * it. This mounts the SAME `CrudForm` from the SAME inputs\n * (`maintenanceEngine/entityFormInputs`), so an action with no page behind it\n * edits the record instead of apologising.\n *\n * `CrudForm` renders its own submit (React Final Form's `SubmitButton`), so the\n * drawer footer stays empty here — one primary per surface. It is a legacy MUI\n * island like Notes/Reminders, and it is lazily imported so its input renderers\n * (date pickers, colour pickers) never sit in the actions chunk.\n */\nimport React, { Suspense, lazy, useCallback } from 'react';\nimport { useQuery, useQueryClient } from '@tanstack/react-query';\nimport { UdpSpinner } from '../../../../UI/fluent-web-components/UdpSpinner';\nimport { UdpText } from '../../../../UI/fluent-web-components/UdpText';\nimport {\n mergeEntityAttributes,\n type EntityAttribute\n} from '../../../../domain/entityForm/entityFormModel';\nimport {\n crudFormAttributes,\n fetchForeignKeyData,\n fetchUdpFieldInfos\n} from '../../../../maintenanceEngine/entityFormInputs';\nimport { usePromotedMethodEntity } from '../../../../hooks/usePromotedMethodEntity';\nimport { getPathObject } from '../../../../utilities/maintenanceEngine/CrudBrowserUtilities';\nimport { fetchEntityMeta, inquiryKeys } from '../../api/queries';\nimport type { SheetSurface } from './runAction';\nimport styles from './EntityFormSurface.module.css';\n\nconst CrudForm = lazy(() =>\n import('../../../../UI/forms/CrudForm').then((module) => ({\n default: module.CrudForm\n }))\n);\n\n/** The response shape `CrudForm` reads back off a submit. */\ntype SubmitResponse = { status?: number; data?: unknown } | undefined;\n\nexport interface EntityFormSurfaceProps {\n surface: SheetSurface;\n catalogId: string;\n /** The selected record — the update form's starting values. */\n nodeObj: Record<string, unknown>;\n closeSurface: () => void;\n /** The sheet panel's create/update executors (guarded + invalidating). */\n onCreate: (data: unknown) => Promise<SubmitResponse>;\n onUpdate: (data: unknown) => Promise<SubmitResponse>;\n /** Printed when this entity has no form to assemble (the honest fallback). */\n unavailableMessage: string;\n}\n\nexport const EntityFormSurface = ({\n surface,\n catalogId,\n nodeObj,\n closeSurface,\n onCreate,\n onUpdate,\n unavailableMessage\n}: EntityFormSurfaceProps) => {\n const queryClient = useQueryClient();\n const { entityName, mode, updateMethod } = surface;\n\n // UdpObjectFieldInfo's own promoted search method — the read that yields\n // every entity's field config. Same hook (and same cache) the Maintenance\n // Engine uses, so the two surfaces share one lookup.\n const { data: udpObjectFieldInfo, loading: loadingFieldMethod } =\n usePromotedMethodEntity('UdpObjectFieldInfo', true, catalogId) as {\n data?: { unityBaseSearchMethod?: { apiMethodId?: string } };\n loading: boolean;\n };\n const fieldSearchApiId =\n udpObjectFieldInfo?.unityBaseSearchMethod?.apiMethodId ?? null;\n\n const { data: inputs, isPending } = useQuery({\n queryKey: inquiryKeys.entityForm(entityName),\n enabled: !!catalogId && !!entityName && !!fieldSearchApiId,\n staleTime: 30 * 60 * 1000,\n // Config-shaped and interactive: a failed assembly falls through to the\n // unavailable message rather than parking behind a retry delay.\n retry: false,\n queryFn: async () => {\n const [meta, udpFieldInfos] = await Promise.all([\n fetchEntityMeta(queryClient, catalogId, entityName),\n fetchUdpFieldInfos(fieldSearchApiId, entityName)\n ]);\n // Foreign keys resolve off the FULL attribute list (the maintenance\n // page's order), the form renders the editable subset of it.\n const attributes = mergeEntityAttributes(\n meta.attributes as EntityAttribute[],\n udpFieldInfos\n );\n const entityAttributes = crudFormAttributes(attributes, entityName);\n if (!entityAttributes?.length) {\n return { entityAttributes: null, udpFieldInfos, foreignKeyData: [] };\n }\n const { foreignKeyData, entitiesMissingGetAll } =\n await fetchForeignKeyData(catalogId, attributes, fieldSearchApiId);\n for (const missing of entitiesMissingGetAll) {\n console.warn(\n `[inquiry-v2 actions] ${missing}'s Get-All method is not promoted — its field has no options`\n );\n }\n return { entityAttributes, udpFieldInfos, foreignKeyData };\n }\n });\n\n const handleCreate = useCallback(\n (values: Record<string, unknown>) => onCreate({ data: { requestBody: values } }),\n [onCreate]\n );\n\n const handleUpdate = useCallback(\n (values: Record<string, unknown>, primaryKeyValues: unknown[]) => {\n // v1's ActionSideSheet.handleOnUpdate (:203-207): the promoted method's\n // path parameters take the record's identifier values.\n const pathObject = updateMethod?.pathParameters\n ? (getPathObject(\n updateMethod.pathParameters,\n primaryKeyValues ?? []\n ) as Record<string, unknown>)\n : {};\n return onUpdate({ data: { ...pathObject, requestBody: values } });\n },\n [onUpdate, updateMethod]\n );\n\n const loading = loadingFieldMethod || (!!fieldSearchApiId && isPending);\n if (loading) {\n return (\n <div className={styles.centered}>\n <UdpSpinner />\n </div>\n );\n }\n if (!inputs?.entityAttributes?.length) {\n return <UdpText variant='body1'>{unavailableMessage}</UdpText>;\n }\n\n return (\n <Suspense\n fallback={\n <div className={styles.centered}>\n <UdpSpinner />\n </div>\n }\n >\n <CrudForm\n entityName={entityName}\n entityAttributes={inputs.entityAttributes}\n udpFieldInfos={inputs.udpFieldInfos}\n foreignKeyData={inputs.foreignKeyData}\n isNewEntry={mode === 'create'}\n crudTableEditionData={mode === 'create' ? null : nodeObj}\n onCreate={mode === 'create' ? handleCreate : undefined}\n onUpdate={mode === 'create' ? undefined : handleUpdate}\n closeSideSheet={closeSurface}\n />\n </Suspense>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAMmB,WAAWjB,WACf,OAAO,qCAAiCkB,MAAMC,YAAY,EACxDC,SAASD,OAAOF,UACjB,EACH,CAAC;AAkBD,MAAaiB,qBAAoBC,OAAA;CAAA,M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AAA,MAAAiC,OAAAb;AAAApB,IAAA,MAAAiC,OAAAX;AAAAtB,IAAA,MAAAiC,OAAAhB;AAAAjB,IAAA,MAAAmD;AAAAnD,IAAA,MAAAqD;AAAArD,IAAA,MAAAiD;AAAAjD,IAAA,MAAAkD;AAAAlD,IAAA,MAAAsD;OAAAA,OAAAtD,EAAA;AAAA,QAlBXsD"}
|
|
1
|
+
{"version":3,"file":"EntityFormSurface.mjs","names":["React","useEffect","useMemo","useRef","useState","useTranslation","UdpSpinner","UdpText","getEntityFull","RecordForm","formGroups","keyValuesOf","toRequestBody","validateRecord","RecordValues","useEntityPage","getPathObject","parentKeyDefaults","ParentSource","SheetSurface","SheetPanelBridge","styles","SubmitResponse","status","EntityFormSurfaceProps","surface","nodeObj","Record","closeSurface","onCreate","data","Promise","onUpdate","parents","footer","unavailableMessage","EntityFormSurface","t","entityName","updateMethod","mode","meta","config","promoted","loading","groups","prefill","undefined","entered","setValues","values","defaults","loaded","live","fromRow","then","record","errors","setErrors","change","field","value","current","next","setSideSheetButtonLabel","setSideSheetOnSubmit","setSideSheetProps","saving","setSaving","submit","found","Object","keys","length","requestBody","progress","response","pathParameters","ready","submitRef","defaultValue","centered","locked"],"sources":["../../../../../src/inquiry/v2/capabilities/actions/EntityFormSurface.tsx"],"sourcesContent":["/**\n * The create/update sheet's default body: the MAINTENANCE RECORD FORM.\n *\n * An Update/Create action with no page configured edits the record in the\n * form the maintenance pages show for its entity — the same `RecordForm`, over\n * the same metadata and resolved settings (`useEntityPage`: labels, order,\n * groups, required fields, pickers). A field is set up once, in Maintenance\n * settings, and reads the same here.\n *\n * Two things are the sheet's own:\n * · the SAVE goes through the action's method — the sheet panel's guarded\n * `onCreate`/`onUpdate`, which refresh the record and the tree;\n * · the BUTTON is the drawer's footer button, registered the way a page\n * registers its own, so the sheet has one primary and it is the platform's.\n */\nimport React, { useEffect, useMemo, useRef, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { UdpSpinner } from '../../../../UI/fluent-web-components/UdpSpinner';\nimport { UdpText } from '../../../../UI/fluent-web-components/UdpText';\nimport { getEntityFull } from '../../../../maintenance/api/entityApi';\nimport { RecordForm } from '../../../../maintenance/record/RecordForm';\nimport {\n formGroups,\n keyValuesOf,\n toRequestBody,\n validateRecord,\n type RecordValues\n} from '../../../../maintenance/record/recordModel';\nimport { useEntityPage } from '../../../../maintenance/useEntityPage';\nimport { getPathObject } from '../../../../utilities/maintenanceEngine/CrudBrowserUtilities';\nimport { parentKeyDefaults, type ParentSource } from './parentKeyDefaults';\nimport type { SheetSurface } from './runAction';\nimport type { SheetPanelBridge } from './useSheetPanel';\nimport styles from './EntityFormSurface.module.css';\n\n/** The response shape the sheet panel's executors answer with. */\ntype SubmitResponse = { status?: number } | undefined;\n\nexport interface EntityFormSurfaceProps {\n surface: SheetSurface;\n /** The selected record — an update's key, and its values if it can't be re-read. */\n nodeObj: Record<string, unknown>;\n closeSurface: () => void;\n /** The sheet panel's create/update executors (guarded + invalidating). */\n onCreate: (data: unknown) => Promise<SubmitResponse>;\n onUpdate: (data: unknown) => Promise<SubmitResponse>;\n /** A new record's possible parents, nearest first (parentKeyDefaults). */\n parents: ParentSource[];\n /** The drawer footer's registrations (useSheetPanel `footer`). */\n footer: SheetPanelBridge['footer'];\n /** Printed when this entity has no form to assemble (the honest fallback). */\n unavailableMessage: string;\n}\n\nexport const EntityFormSurface = ({\n surface,\n nodeObj,\n closeSurface,\n onCreate,\n onUpdate,\n parents,\n footer,\n unavailableMessage\n}: EntityFormSurfaceProps) => {\n const { t } = useTranslation();\n const { entityName, updateMethod } = surface;\n const mode = surface.mode === 'create' ? 'new' : 'edit';\n const { meta, config, promoted, loading } = useEntityPage(entityName);\n const groups = useMemo(\n () => (meta && config ? formGroups(meta, config, mode) : []),\n [meta, config, mode]\n );\n\n // A new record's parent key, pre-filled and locked as a maintenance\n // drill-down's Add does it.\n const prefill = useMemo(\n () =>\n mode === 'new' && meta ? parentKeyDefaults(meta, parents) : undefined,\n // The sources are the record the sheet opened on: fixed for its life.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [mode, meta]\n );\n\n // An update starts from the WHOLE record: the tree's row holds only what\n // its query returns, and the save sends every field. Where the record can't\n // be re-read (no promoted Get), the row is what there is.\n const [entered, setValues] = useState<RecordValues | undefined>(\n mode === 'new' ? {} : undefined\n );\n const values = useMemo(\n () => (entered && prefill ? { ...entered, ...prefill.defaults } : entered),\n [entered, prefill]\n );\n // Loaded ONCE: the sheet edits the record it opened on. The row's object is\n // replaced whenever the tree behind the sheet rebuilds, and reading it again\n // then would put the fetched record over what has been typed.\n const loaded = entered !== undefined;\n useEffect(() => {\n if (mode === 'new' || loading || !meta || loaded) return undefined;\n let live = true;\n const fromRow = () => live && setValues({ ...nodeObj });\n if (!promoted) fromRow();\n else\n getEntityFull<RecordValues>(promoted, keyValuesOf(meta, nodeObj)).then(\n (record) => live && setValues(record),\n fromRow\n );\n return () => {\n live = false;\n };\n }, [mode, loading, meta, promoted, nodeObj, loaded]);\n\n const [errors, setErrors] = useState<Record<string, string>>({});\n const change = (field: string, value: unknown) => {\n setValues((current) => ({ ...current, [field]: value }));\n setErrors((current) => {\n const next = { ...current };\n delete next[field];\n return next;\n });\n };\n\n const { setSideSheetButtonLabel, setSideSheetOnSubmit, setSideSheetProps } =\n footer;\n const [saving, setSaving] = useState(false);\n const submit = async () => {\n if (!meta || !values) return;\n const found = validateRecord(groups, values);\n setErrors(found);\n if (Object.keys(found).length > 0) return;\n const requestBody = toRequestBody(meta, values, mode);\n setSaving(true);\n setSideSheetProps({ progress: true });\n try {\n const response =\n mode === 'new'\n ? await onCreate({ data: { requestBody } })\n : await onUpdate({\n data: {\n // The promoted method's path parameters take the record's key.\n ...(updateMethod?.pathParameters\n ? (getPathObject(\n updateMethod.pathParameters,\n keyValuesOf(meta, values)\n ) as Record<string, unknown>)\n : {}),\n requestBody\n }\n });\n const status = response?.status ?? 0;\n if (status >= 200 && status < 300) closeSurface();\n } catch {\n // onCreate/onUpdate have already told the user; the form stays open.\n } finally {\n setSaving(false);\n setSideSheetProps({ progress: false });\n }\n };\n\n // The footer button runs the latest submit, registered once the form shows.\n const ready = groups.length > 0 && !!values;\n const submitRef = useRef(submit);\n submitRef.current = submit;\n useEffect(() => {\n if (!ready) return;\n // A registration, as a mounted page makes: the footer button is the\n // drawer's, and only this form knows what it is called and what it runs.\n setSideSheetButtonLabel(\n mode === 'new'\n ? t('common.add', { defaultValue: 'Add' })\n : t('common.save', { defaultValue: 'Save' })\n );\n // eslint-disable-next-line react-you-might-not-need-an-effect/no-pass-live-state-to-parent\n setSideSheetOnSubmit(() => () => submitRef.current());\n }, [ready, mode, t, setSideSheetButtonLabel, setSideSheetOnSubmit]);\n\n if (loading || (meta && config && groups.length > 0 && !values)) {\n return (\n <div className={styles.centered}>\n <UdpSpinner />\n </div>\n );\n }\n if (!meta || !ready) {\n return <UdpText variant='body1'>{unavailableMessage}</UdpText>;\n }\n\n return (\n <RecordForm\n meta={meta}\n groups={groups}\n values={values}\n errors={errors}\n onChange={change}\n disabled={saving}\n locked={prefill?.locked}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,MAAaoC,qBAAqB,EAChCX,SACAC,SACAE,cACAC,UACAG,UACAC,SACAC,QACAC,yBAC4B;CAC5B,MAAM,EAAEE,MAAMhC,gBAAgB;CAC9B,MAAM,EAAEiC,YAAYC,iBAAiBd;CACrC,MAAMe,OAAOf,QAAQe,SAAS,WAAW,QAAQ;CACjD,MAAM,EAAEC,MAAMC,QAAQC,UAAUC,YAAY7B,cAAcuB,WAAW;CACrE,MAAMO,SAAS3C,cACNuC,QAAQC,SAAShC,WAAW+B,MAAMC,QAAQF,KAAK,GAAG,EAAG,EAC5D;EAACC;EAAMC;EAAQF;EACjB,CAAC;CAID,MAAMM,UAAU5C,cAEZsC,SAAS,SAASC,OAAOxB,kBAAkBwB,MAAMR,QAAQ,GAAGc,KAAAA,GAG9D,CAACP,MAAMC,KACT,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StringUtilities.mj
|
|
|
3
3
|
import { UdpMessageBar } from "../../../../UI/fluent-web-components/UdpMessageBar.mjs";
|
|
4
4
|
import { UdpSpinner } from "../../../../UI/fluent-web-components/UdpSpinner.mjs";
|
|
5
5
|
import { UdpText } from "../../../../UI/fluent-web-components/UdpText.mjs";
|
|
6
|
-
import { executeApiMethodWithParameters } from "../../api/queries.mjs";
|
|
7
6
|
import { humanizeFieldName } from "../../search/searchModel.mjs";
|
|
7
|
+
import { executeApiMethodWithParameters } from "../../api/queries.mjs";
|
|
8
8
|
import React, { useEffect, useState } from "react";
|
|
9
9
|
import { useTranslation } from "react-i18next";
|
|
10
10
|
import styles from "./RetrieveSurface.module.css";
|