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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChildCountBadges.mjs","names":["useContext","useMemo","useState","QueryClient","QueryClientContext","useQueries","buildBulkChildCountRequests","buildBulkCountAggregateData","buildCountChipClaims","buildCountChipDescriptor","bulkChildCountRequestKey","collectBulkChildCounts","findCountChipChildConfig","sumBulkCountsForClaims","getCountThresholdStatus","SeverityTypeEnums","executeQueryAdHoc","inquiryKeys","SEVERITY_TO_BADGE_COLOR","Success","Error","Warning","Info","severityBadge","severity","color","appearance","FLUSH_DELAY_MS","COUNT_STALE_MS","pendingBuckets","Map","flushTimer","failedRequests","Set","aggregatesUnsupported","aggregateSettled","isServerError","error","status","response","bulkRequestKeyOf","claim","apiMethodId","keyField","filterKey","flushPending","buckets","Array","from","values","clear","forEach","bucket","requestKey","waiters","keys","settle","countOf","resolvers","value","resolve","has","data","filterElements","isFirstAggregate","then","counts","keyValues","add","catch","loadCount","Promise","get","set","keyValue","push","setTimeout","fallbackClient","useMenuQueryClient","provided","countQueryOf","queryKey","bulkChildCount","String","queryFn","staleTime","query","state","Infinity","retry","networkMode","uniqueClaimsOf","claimLists","byKey","dataOfQueries","results","map","result","useClaimCounts","claims","$","_c","client","t0","uniqueByKey","t1","entries","unique","t2","queries","_temp","combine","t3","index","key","claimKeyOf","useChildCountBadges","items","filter","_temp2","targets","_temp3","claimsByNodeId","Object","flat","allClaims","badges","zeroIds","item_1","item","id","length","byRequest","count","undefined","total","content","useCountChipBadges","treeStructureArr","catalogObjects","promotedEntities","claimMemory","_temp4","_temp5","resolved","item_0","node","childKey","properties","countChip","hasLazy","lazyLoadChildrenArr","some","sm","parentNodeRefKey","countChipChildrenArr","childConfig","catalogReturnObject","descriptor","nodeObj","claimByNodeId","fresh","item_2","claim_0","thresholds","synthetic","lazyLoad","completedLoadingChildren"],"sources":["../../../../../src/inquiry/v2/tree/fluentTreeMenu/useChildCountBadges.js"],"sourcesContent":["import { useContext, useMemo, useState } from 'react';\nimport {\n QueryClient,\n QueryClientContext,\n useQueries\n} from '@tanstack/react-query';\nimport {\n buildBulkChildCountRequests,\n buildBulkCountAggregateData,\n buildCountChipClaims,\n buildCountChipDescriptor,\n bulkChildCountRequestKey,\n collectBulkChildCounts,\n findCountChipChildConfig,\n sumBulkCountsForClaims\n} from '../../../../domain/inquiryTree/lazyLoad';\nimport { getCountThresholdStatus } from '../../../../UI/utilityDisplay/utilities/aggregateUtils';\nimport { SeverityTypeEnums } from '../../../../enums/unitySystemEnums';\nimport { executeQueryAdHoc } from '../../../../udp/utilities/methodUtils';\nimport { inquiryKeys } from '../../api/queries';\n\n/**\n * Severity → UdpBadge color, shared by every tree-row badge producer (the\n * aggregate badges import it from here — this module is already their\n * dependency, the other direction would cycle).\n */\nexport const SEVERITY_TO_BADGE_COLOR = {\n [SeverityTypeEnums.Success]: 'success',\n [SeverityTypeEnums.Error]: 'danger',\n [SeverityTypeEnums.Warning]: 'warning',\n [SeverityTypeEnums.Info]: 'informative'\n};\n\n/**\n * A threshold severity's badge look: tinted when banded, ghost when not.\n * @returns {{ color: 'success' | 'danger' | 'warning' | 'informative', appearance: 'tint' | 'ghost' }}\n */\nexport const severityBadge = (severity) => ({\n color: SEVERITY_TO_BADGE_COLOR[severity] || 'informative',\n appearance: severity ? 'tint' : 'ghost'\n});\n\n/**\n * Bulk child counts for lazy tree rows — ONE aggregate query per\n * (child method × parent-ref field) covering every parent visible in the\n * same render burst (`IN` + `GROUP BY` + count), instead of a count call per\n * row.\n *\n * Caching, dedup and stale-while-revalidate belong to TanStack Query: each\n * (request × parent value) is one cache entry, so a resolved count stays on\n * screen while a background refetch replaces it — a chip can never blink out\n * on a re-render. The ONLY hand-rolled piece is the 30ms coalescer below,\n * because sibling roots mount as separate menu components and their values\n * must land in one request; TanStack has no cross-hook request batching.\n *\n * Returns `{ badges, zeroIds }`:\n * - badges: `{ [itemId]: { content, color, appearance } }` — a quiet count\n * badge for rows whose children are known to exist;\n * - zeroIds: item ids whose child count resolved to ZERO — the menu\n * de-lazies them (no chevron) so \"nothing there\" stops masquerading as\n * \"expand to find out\".\n *\n * Failure is a value, not an error: a count that can't be answered resolves\n * `null` (\"unavailable\" — no badge, keep the optimistic chevron) and is kept\n * for the session (`staleTime: Infinity` for null data), so a broken bucket is\n * attempted once, not hammered. A 5xx on the session's FIRST aggregate means\n * the backend has no aggregate support at all — a session latch answers every\n * later count with `null` without a request.\n */\n\nconst FLUSH_DELAY_MS = 30;\nconst COUNT_STALE_MS = 60_000;\n\n/** requestKey -> { apiMethodId, keyField, filterKey, filterElements,\n * waiters: Map<value, resolve[]> } */\nconst pendingBuckets = new Map();\nlet flushTimer = null;\n/** Buckets whose aggregate failed — answered `null` without a request. */\nconst failedRequests = new Set();\nlet aggregatesUnsupported = false;\nlet aggregateSettled = false;\n\n/** Axios rejects with the response attached; a 5xx is the backend saying no. */\nconst isServerError = (error) => {\n const status = error?.response?.status ?? error?.status;\n return typeof status === 'number' && status >= 500;\n};\n\nconst bulkRequestKeyOf = (claim) =>\n bulkChildCountRequestKey({\n apiMethodId: claim.apiMethodId,\n keyField: claim.keyField,\n filterKey: claim.filterKey\n });\n\nconst flushPending = () => {\n flushTimer = null;\n const buckets = Array.from(pendingBuckets.values());\n pendingBuckets.clear();\n\n buckets.forEach((bucket) => {\n const requestKey = bulkRequestKeyOf(bucket);\n const values = Array.from(bucket.waiters.keys());\n const settle = (countOf) =>\n bucket.waiters.forEach((resolvers, value) =>\n resolvers.forEach((resolve) => resolve(countOf(value)))\n );\n if (aggregatesUnsupported || failedRequests.has(requestKey)) {\n settle(() => null);\n return;\n }\n\n const data = buildBulkCountAggregateData(\n bucket.keyField,\n values,\n bucket.filterElements\n );\n const isFirstAggregate = !aggregateSettled;\n\n executeQueryAdHoc({ data }, bucket.apiMethodId)\n .then((response) => {\n aggregateSettled = true;\n const counts = collectBulkChildCounts(\n {\n apiMethodId: bucket.apiMethodId,\n keyField: bucket.keyField,\n keyValues: values,\n filterKey: bucket.filterKey,\n data\n },\n response\n );\n if (counts === null) {\n failedRequests.add(requestKey);\n settle(() => null);\n return;\n }\n settle((value) => counts[value] ?? 0);\n })\n .catch((error) => {\n // A 5xx on the session's first aggregate = no aggregate support here;\n // stop asking entirely. Anything else is one bad bucket (or a blip).\n if (isFirstAggregate && isServerError(error)) {\n aggregatesUnsupported = true;\n }\n aggregateSettled = true;\n failedRequests.add(requestKey);\n settle(() => null);\n });\n });\n};\n\n/** The coalescer: joins this claim's value into its bucket's next flush and\n * resolves with the value's count — or `null` when it can't be answered. */\nconst loadCount = (claim) =>\n new Promise((resolve) => {\n const requestKey = bulkRequestKeyOf(claim);\n if (aggregatesUnsupported || failedRequests.has(requestKey)) {\n resolve(null);\n return;\n }\n const bucket =\n pendingBuckets.get(requestKey) ??\n pendingBuckets\n .set(requestKey, {\n apiMethodId: claim.apiMethodId,\n keyField: claim.keyField,\n filterKey: claim.filterKey,\n filterElements: claim.filterElements ?? [],\n waiters: new Map()\n })\n .get(requestKey);\n const resolvers = bucket.waiters.get(claim.keyValue) ?? [];\n resolvers.push(resolve);\n bucket.waiters.set(claim.keyValue, resolvers);\n if (!flushTimer) {\n flushTimer = setTimeout(flushPending, FLUSH_DELAY_MS);\n }\n });\n\n/**\n * Legacy hosts (InquiryContainer under apps that don't mount UdpAppProvider)\n * carry no QueryClientProvider; the menu then runs on one module-scope client\n * so the cache semantics are identical either way.\n */\nlet fallbackClient = null;\nconst useMenuQueryClient = () => {\n const provided = useContext(QueryClientContext);\n if (provided) return provided;\n fallbackClient ??= new QueryClient();\n return fallbackClient;\n};\n\n/** One TanStack query per (bucket × parent value); `null` data = unavailable\n * this session (never refetched), a number ages out after COUNT_STALE_MS and\n * revalidates in the background while the old one stays rendered. */\nconst countQueryOf = (claim) => ({\n queryKey: inquiryKeys.bulkChildCount(\n bulkRequestKeyOf(claim),\n String(claim.keyValue)\n ),\n queryFn: () => loadCount(claim),\n staleTime: (query) =>\n query.state.data === null ? Infinity : COUNT_STALE_MS,\n // Counts are decoration: one shot, never parked behind focus/online gates.\n retry: false,\n networkMode: 'always'\n});\n\n/** Dedupe claims to one query per (bucket × value); returns [claims, keyOf]. */\nconst uniqueClaimsOf = (claimLists) => {\n const byKey = new Map();\n claimLists.forEach((claim) => {\n byKey.set(`${bulkRequestKeyOf(claim)}::${claim.keyValue}`, claim);\n });\n return byKey;\n};\n\n/** Each query's data only — structurally shared, so it is stable across\n * renders until a count actually changes. */\nexport const dataOfQueries = (results) => results.map((result) => result.data);\n\n/** items × claims → the resolved count per claim key, straight off TanStack. */\nconst useClaimCounts = (claims) => {\n const client = useMenuQueryClient();\n const uniqueByKey = useMemo(() => uniqueClaimsOf(claims), [claims]);\n const unique = useMemo(() => Array.from(uniqueByKey.entries()), [uniqueByKey]);\n const data = useQueries(\n {\n queries: unique.map(([, claim]) => countQueryOf(claim)),\n combine: dataOfQueries\n },\n client\n );\n return useMemo(() => {\n const counts = new Map();\n unique.forEach(([key], index) => {\n counts.set(key, data[index]);\n });\n return counts;\n }, [unique, data]);\n};\n\nconst claimKeyOf = (claim) =>\n `${bulkRequestKeyOf(claim)}::${claim.keyValue}`;\n\nexport const useChildCountBadges = (items) => {\n const targets = useMemo(\n () =>\n items.filter(\n (item) =>\n !item.synthetic &&\n item.node?.properties?.lazyLoad &&\n !item.node.completedLoadingChildren &&\n item.node.lazyLoadChildrenArr?.length\n ),\n [items]\n );\n\n const { claimsByNodeId } = useMemo(\n () =>\n buildBulkChildCountRequests(\n targets.map((item) => ({\n id: item.id,\n lazyLoadChildrenArr: item.node.lazyLoadChildrenArr\n }))\n ),\n [targets]\n );\n\n const allClaims = useMemo(\n () => Object.values(claimsByNodeId).flat(),\n [claimsByNodeId]\n );\n const counts = useClaimCounts(allClaims);\n\n return useMemo(() => {\n const badges = {};\n const zeroIds = [];\n targets.forEach((item) => {\n const claims = claimsByNodeId[item.id];\n if (!claims?.length) return;\n const byRequest = new Map();\n for (const claim of claims) {\n const count = counts.get(claimKeyOf(claim));\n // undefined = still loading, null = unavailable — no badge either way.\n if (count === undefined || count === null) return;\n const requestKey = bulkRequestKeyOf(claim);\n const bucket = byRequest.get(requestKey) ?? {};\n bucket[claim.keyValue] = count;\n byRequest.set(requestKey, bucket);\n }\n const total = sumBulkCountsForClaims(claims, byRequest);\n if (total === null) return;\n if (total === 0) {\n zeroIds.push(item.id);\n return;\n }\n badges[item.id] = {\n content: total,\n color: 'informative',\n appearance: 'ghost'\n };\n });\n return { badges, zeroIds };\n }, [targets, claimsByNodeId, counts]);\n};\n\n/**\n * Configured count chips (`properties.countChip`): each row shows how many\n * child records it has for ONE child binding, optionally narrowed by an AND of\n * conditions. Shares query keys with the implicit child counts above, so a\n * chip with no conditions is answered by the aggregate the chevron already\n * fetched — no extra request. A filtered chip adds one aggregate per\n * (method × key field × filter hash) for the whole page of rows.\n *\n * Returns `{ [itemId]: { content, color, appearance } }`; a row stays chip-less\n * until its count resolves, and a resolved zero renders as \"0\".\n *\n * The child search is derived HERE rather than at display-tree build time,\n * because rows reach this menu from four different producers (the domain\n * preloaded/eager builders, the legacy lazy-paging fetcher, search-loaded\n * records, group synthesis) and only the lazy ones carry descriptors. Deriving\n * per render also means late-arriving catalog metadata simply re-derives —\n * there is no build the chip can miss.\n */\nexport const useCountChipBadges = (\n items,\n { treeStructureArr, catalogObjects, promotedEntities } = {}\n) => {\n // A row's claim is derived from its lazy-load descriptors, which the menu\n // clears once a row is known childless — remembering the claim keeps a\n // resolved chip (including \"0\") on screen instead of flickering out.\n const [claimMemory] = useState(() => new Map());\n\n const targets = useMemo(\n () =>\n items.filter(\n (item) => !item.synthetic && item.node?.properties?.countChip?.childKey\n ),\n [items]\n );\n\n const claimByNodeId = useMemo(() => {\n const { claimByNodeId: fresh } = buildCountChipClaims(\n targets.map((item) => {\n const node = item.node;\n const childKey = node.properties.countChip.childKey;\n // Lazy levels already carry the child search; every other row derives\n // it from the tree config + catalog association.\n const hasLazy = node.lazyLoadChildrenArr?.some(\n (sm) => sm.parentNodeRefKey === childKey\n );\n let countChipChildrenArr;\n if (!hasLazy) {\n const childConfig = findCountChipChildConfig(\n treeStructureArr,\n node.properties.catalogReturnObject,\n childKey\n );\n const descriptor = buildCountChipDescriptor(\n node,\n node.nodeObj,\n childConfig,\n catalogObjects,\n promotedEntities\n );\n if (descriptor) countChipChildrenArr = [descriptor];\n }\n return {\n id: item.id,\n countChip: node.properties.countChip,\n lazyLoadChildrenArr: node.lazyLoadChildrenArr,\n countChipChildrenArr\n };\n })\n );\n const resolved = {};\n targets.forEach((item) => {\n const claim = fresh[item.id] ?? claimMemory.get(item.id);\n if (!claim) return;\n claimMemory.set(item.id, claim);\n resolved[item.id] = claim;\n });\n return resolved;\n }, [claimMemory, targets, treeStructureArr, catalogObjects, promotedEntities]);\n\n const allClaims = useMemo(\n () => Object.values(claimByNodeId),\n [claimByNodeId]\n );\n const counts = useClaimCounts(allClaims);\n\n return useMemo(() => {\n const badges = {};\n targets.forEach((item) => {\n const claim = claimByNodeId[item.id];\n if (!claim) return;\n const count = counts.get(claimKeyOf(claim));\n if (count === undefined || count === null) return;\n // Optional severity bands color the chip from the value already fetched\n // — pure client-side evaluation, no extra request. No band matched (or\n // none configured) keeps the quiet informative chip.\n const severity = getCountThresholdStatus(\n item.node.properties.countChip?.thresholds,\n count\n );\n badges[item.id] = {\n content: String(count),\n color: severity ? SEVERITY_TO_BADGE_COLOR[severity] : 'informative',\n appearance: 'tint'\n };\n });\n return badges;\n }, [targets, claimByNodeId, counts]);\n};\n\nexport { useMenuQueryClient };\n"],"mappings":";;;;;;;;;;;;;;AA0BA,MAAakB,0BAA0B;EACpCH,kBAAkBI,UAAU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AAA;AAAA,QAgBJ;EAAAf,IACjBD,OAAIC;EAAGqB,qBACUtB,OAAIiB,KAAKK;EAC/B;;AA6DyB,SAAAT,SAAA;AAAA,wBAOK,IAAIhH,KAAK;;AAPd,SAAAiH,OAAAd,MAAA;AAAA,QAYhB,CAACA,KAAIoC,aAAcpC,KAAIiB,MAAiBE,YAAWC,WAAUF"}
|
|
1
|
+
{"version":3,"file":"useChildCountBadges.mjs","names":["useContext","useMemo","useState","QueryClient","QueryClientContext","useQueries","buildBulkChildCountRequests","buildBulkCountAggregateData","buildCountChipClaims","buildCountChipDescriptor","bulkChildCountRequestKey","collectBulkChildCounts","sumBulkCountsForClaims","hasUnloadedChildren","entityLevelName","countChipsOf","getCountThresholdStatus","SeverityTypeEnums","executeQueryAdHoc","inquiryKeys","SEVERITY_TO_BADGE_COLOR","Success","Error","Warning","Info","severityBadge","severity","color","appearance","FLUSH_DELAY_MS","COUNT_STALE_MS","pendingBuckets","Map","flushTimer","failedRequests","Set","aggregatesUnsupported","aggregateSettled","isServerError","error","status","response","bulkRequestKeyOf","claim","apiMethodId","keyField","filterKey","flushPending","buckets","Array","from","values","clear","forEach","bucket","requestKey","waiters","keys","settle","countOf","resolvers","value","resolve","has","data","filterElements","isFirstAggregate","then","counts","keyValues","add","catch","loadCount","Promise","get","set","keyValue","push","setTimeout","fallbackClient","useMenuQueryClient","provided","countQueryOf","queryKey","bulkChildCount","String","queryFn","staleTime","query","state","Infinity","retry","networkMode","uniqueClaimsOf","claimLists","byKey","dataOfQueries","results","map","result","useClaimCounts","claims","$","_c","client","t0","uniqueByKey","t1","entries","unique","t2","queries","_temp","combine","t3","index","key","claimKeyOf","useChildCountBadges","items","filter","_temp2","targets","_temp3","claimsByNodeId","Object","flat","allClaims","badges","zeroIds","item_1","item","id","byRequest","count","undefined","total","content","countedLevelOf","findLevel","node","childKey","configNodeId","children","find","level","properties","catalogObjectKey","useCountChipBadges","catalogObjects","promotedEntities","claimMemory","synthetic","flatMap","chip","claimByKey","claimByNodeId","fresh","hasLazy","lazyLoadChildrenArr","some","sm","parentNodeRefKey","countChipChildrenArr","descriptor","nodeObj","countChip","resolved","Boolean","thresholds","counted","title","length","item_0"],"sources":["../../../../../src/inquiry/v2/tree/fluentTreeMenu/useChildCountBadges.js"],"sourcesContent":["import { useContext, useMemo, useState } from 'react';\nimport {\n QueryClient,\n QueryClientContext,\n useQueries\n} from '@tanstack/react-query';\nimport {\n buildBulkChildCountRequests,\n buildBulkCountAggregateData,\n buildCountChipClaims,\n buildCountChipDescriptor,\n bulkChildCountRequestKey,\n collectBulkChildCounts,\n sumBulkCountsForClaims\n} from '../../../../domain/inquiryTree/lazyLoad';\nimport { hasUnloadedChildren } from '../../../../domain/inquiryTree/displayTree';\nimport { entityLevelName } from '../../../../domain/inquiryTree/names';\nimport { countChipsOf } from '../../../../domain/inquiryTree/types';\nimport { getCountThresholdStatus } from '../../../../UI/utilityDisplay/utilities/aggregateUtils';\nimport { SeverityTypeEnums } from '../../../../enums/unitySystemEnums';\nimport { executeQueryAdHoc } from '../../../../udp/utilities/methodUtils';\nimport { inquiryKeys } from '../../api/queries';\n\n/**\n * Severity → UdpBadge color, shared by every tree-row badge producer (the\n * aggregate badges import it from here — this module is already their\n * dependency, the other direction would cycle).\n */\nexport const SEVERITY_TO_BADGE_COLOR = {\n [SeverityTypeEnums.Success]: 'success',\n [SeverityTypeEnums.Error]: 'danger',\n [SeverityTypeEnums.Warning]: 'warning',\n [SeverityTypeEnums.Info]: 'informative'\n};\n\n/**\n * A threshold severity's badge look: the tinted chip every row number wears, in\n * the band's color — the quiet informative one when no band matched.\n * @returns {{ color: 'success' | 'danger' | 'warning' | 'informative', appearance: 'tint' }}\n */\nexport const severityBadge = (severity) => ({\n color: SEVERITY_TO_BADGE_COLOR[severity] || 'informative',\n appearance: 'tint'\n});\n\n/**\n * Bulk child counts for lazy tree rows — ONE aggregate query per\n * (child method × parent-ref field) covering every parent visible in the\n * same render burst (`IN` + `GROUP BY` + count), instead of a count call per\n * row.\n *\n * Caching, dedup and stale-while-revalidate belong to TanStack Query: each\n * (request × parent value) is one cache entry, so a resolved count stays on\n * screen while a background refetch replaces it — a chip can never blink out\n * on a re-render. The ONLY hand-rolled piece is the 30ms coalescer below,\n * because sibling roots mount as separate menu components and their values\n * must land in one request; TanStack has no cross-hook request batching.\n *\n * Returns `{ badges, zeroIds }`:\n * - badges: `{ [itemId]: { content, color, appearance } }` — a quiet count\n * badge for rows whose children are known to exist;\n * - zeroIds: item ids whose child count resolved to ZERO — the menu\n * de-lazies them (no chevron) so \"nothing there\" stops masquerading as\n * \"expand to find out\".\n *\n * Failure is a value, not an error: a count that can't be answered resolves\n * `null` (\"unavailable\" — no badge, keep the optimistic chevron) and is kept\n * for the session (`staleTime: Infinity` for null data), so a broken bucket is\n * attempted once, not hammered. A 5xx on the session's FIRST aggregate means\n * the backend has no aggregate support at all — a session latch answers every\n * later count with `null` without a request.\n */\n\nconst FLUSH_DELAY_MS = 30;\nconst COUNT_STALE_MS = 60_000;\n\n/** requestKey -> { apiMethodId, keyField, filterKey, filterElements,\n * waiters: Map<value, resolve[]> } */\nconst pendingBuckets = new Map();\nlet flushTimer = null;\n/** Buckets whose aggregate failed — answered `null` without a request. */\nconst failedRequests = new Set();\nlet aggregatesUnsupported = false;\nlet aggregateSettled = false;\n\n/** Axios rejects with the response attached; a 5xx is the backend saying no. */\nconst isServerError = (error) => {\n const status = error?.response?.status ?? error?.status;\n return typeof status === 'number' && status >= 500;\n};\n\nconst bulkRequestKeyOf = (claim) =>\n bulkChildCountRequestKey({\n apiMethodId: claim.apiMethodId,\n keyField: claim.keyField,\n filterKey: claim.filterKey\n });\n\nconst flushPending = () => {\n flushTimer = null;\n const buckets = Array.from(pendingBuckets.values());\n pendingBuckets.clear();\n\n buckets.forEach((bucket) => {\n const requestKey = bulkRequestKeyOf(bucket);\n const values = Array.from(bucket.waiters.keys());\n const settle = (countOf) =>\n bucket.waiters.forEach((resolvers, value) =>\n resolvers.forEach((resolve) => resolve(countOf(value)))\n );\n if (aggregatesUnsupported || failedRequests.has(requestKey)) {\n settle(() => null);\n return;\n }\n\n const data = buildBulkCountAggregateData(\n bucket.keyField,\n values,\n bucket.filterElements\n );\n const isFirstAggregate = !aggregateSettled;\n\n executeQueryAdHoc({ data }, bucket.apiMethodId)\n .then((response) => {\n aggregateSettled = true;\n const counts = collectBulkChildCounts(\n {\n apiMethodId: bucket.apiMethodId,\n keyField: bucket.keyField,\n keyValues: values,\n filterKey: bucket.filterKey,\n data\n },\n response\n );\n if (counts === null) {\n failedRequests.add(requestKey);\n settle(() => null);\n return;\n }\n settle((value) => counts[value] ?? 0);\n })\n .catch((error) => {\n // A 5xx on the session's first aggregate = no aggregate support here;\n // stop asking entirely. Anything else is one bad bucket (or a blip).\n if (isFirstAggregate && isServerError(error)) {\n aggregatesUnsupported = true;\n }\n aggregateSettled = true;\n failedRequests.add(requestKey);\n settle(() => null);\n });\n });\n};\n\n/** The coalescer: joins this claim's value into its bucket's next flush and\n * resolves with the value's count — or `null` when it can't be answered. */\nconst loadCount = (claim) =>\n new Promise((resolve) => {\n const requestKey = bulkRequestKeyOf(claim);\n if (aggregatesUnsupported || failedRequests.has(requestKey)) {\n resolve(null);\n return;\n }\n const bucket =\n pendingBuckets.get(requestKey) ??\n pendingBuckets\n .set(requestKey, {\n apiMethodId: claim.apiMethodId,\n keyField: claim.keyField,\n filterKey: claim.filterKey,\n filterElements: claim.filterElements ?? [],\n waiters: new Map()\n })\n .get(requestKey);\n const resolvers = bucket.waiters.get(claim.keyValue) ?? [];\n resolvers.push(resolve);\n bucket.waiters.set(claim.keyValue, resolvers);\n if (!flushTimer) {\n flushTimer = setTimeout(flushPending, FLUSH_DELAY_MS);\n }\n });\n\n/**\n * Legacy hosts (InquiryContainer under apps that don't mount UdpAppProvider)\n * carry no QueryClientProvider; the menu then runs on one module-scope client\n * so the cache semantics are identical either way.\n */\nlet fallbackClient = null;\nconst useMenuQueryClient = () => {\n const provided = useContext(QueryClientContext);\n if (provided) return provided;\n fallbackClient ??= new QueryClient();\n return fallbackClient;\n};\n\n/** One TanStack query per (bucket × parent value); `null` data = unavailable\n * this session (never refetched), a number ages out after COUNT_STALE_MS and\n * revalidates in the background while the old one stays rendered. */\nconst countQueryOf = (claim) => ({\n queryKey: inquiryKeys.bulkChildCount(\n bulkRequestKeyOf(claim),\n String(claim.keyValue)\n ),\n queryFn: () => loadCount(claim),\n staleTime: (query) =>\n query.state.data === null ? Infinity : COUNT_STALE_MS,\n // Counts are decoration: one shot, never parked behind focus/online gates.\n retry: false,\n networkMode: 'always'\n});\n\n/** Dedupe claims to one query per (bucket × value); returns [claims, keyOf]. */\nconst uniqueClaimsOf = (claimLists) => {\n const byKey = new Map();\n claimLists.forEach((claim) => {\n byKey.set(`${bulkRequestKeyOf(claim)}::${claim.keyValue}`, claim);\n });\n return byKey;\n};\n\n/** Each query's data only — structurally shared, so it is stable across\n * renders until a count actually changes. */\nexport const dataOfQueries = (results) => results.map((result) => result.data);\n\n/** items × claims → the resolved count per claim key, straight off TanStack. */\nconst useClaimCounts = (claims) => {\n const client = useMenuQueryClient();\n const uniqueByKey = useMemo(() => uniqueClaimsOf(claims), [claims]);\n const unique = useMemo(() => Array.from(uniqueByKey.entries()), [uniqueByKey]);\n const data = useQueries(\n {\n queries: unique.map(([, claim]) => countQueryOf(claim)),\n combine: dataOfQueries\n },\n client\n );\n return useMemo(() => {\n const counts = new Map();\n unique.forEach(([key], index) => {\n counts.set(key, data[index]);\n });\n return counts;\n }, [unique, data]);\n};\n\nconst claimKeyOf = (claim) =>\n `${bulkRequestKeyOf(claim)}::${claim.keyValue}`;\n\nexport const useChildCountBadges = (items) => {\n const targets = useMemo(\n () =>\n items.filter(\n (item) =>\n !item.synthetic &&\n hasUnloadedChildren(item.node) &&\n item.node.lazyLoadChildrenArr?.length\n ),\n [items]\n );\n\n const { claimsByNodeId } = useMemo(\n () =>\n buildBulkChildCountRequests(\n targets.map((item) => ({\n id: item.id,\n lazyLoadChildrenArr: item.node.lazyLoadChildrenArr\n }))\n ),\n [targets]\n );\n\n const allClaims = useMemo(\n () => Object.values(claimsByNodeId).flat(),\n [claimsByNodeId]\n );\n const counts = useClaimCounts(allClaims);\n\n return useMemo(() => {\n const badges = {};\n const zeroIds = [];\n targets.forEach((item) => {\n const claims = claimsByNodeId[item.id];\n if (!claims) return;\n const byRequest = new Map();\n for (const claim of claims) {\n const count = counts.get(claimKeyOf(claim));\n // undefined = still loading, null = unavailable — no badge either way.\n if (count === undefined || count === null) return;\n const requestKey = bulkRequestKeyOf(claim);\n const bucket = byRequest.get(requestKey) ?? {};\n bucket[claim.keyValue] = count;\n byRequest.set(requestKey, bucket);\n }\n const total = sumBulkCountsForClaims(claims, byRequest);\n if (total === null) return;\n if (total === 0) {\n zeroIds.push(item.id);\n return;\n }\n // The same chip a configured count wears: a bare number beside the label\n // read as stray text.\n badges[item.id] = {\n content: total,\n color: 'informative',\n appearance: 'tint'\n };\n });\n return { badges, zeroIds };\n }, [targets, claimsByNodeId, counts]);\n};\n\n/** The config level a count counts: the row's level's child bound by `childKey`. */\nconst countedLevelOf = (findLevel, node, childKey) =>\n findLevel?.(node.configNodeId)?.children?.find(\n (level) => level.properties?.catalogObjectKey === childKey\n );\n\n/**\n * Configured counts (`countChipsOf(properties)`): each row shows, per count,\n * how many child records it has for that count's child binding, optionally\n * narrowed by an AND of conditions. Shares query keys with the implicit child\n * counts above, so a count with no conditions is answered by the aggregate the\n * chevron already fetched — no extra request. A filtered count adds one\n * aggregate per (method × key field × filter hash) for the whole page of rows,\n * so two counts cost at most two requests, never one per row.\n *\n * Returns `{ [itemId]: Array<{ content, title, color, appearance }> }` in the\n * level's count order; a count stays off the row until it resolves, and a\n * resolved zero renders as \"0\". The counted level's name is the badge's\n * tooltip — with several counts on a row the bare numbers say nothing of what\n * each one counts.\n *\n * The child search is derived HERE rather than at display-tree build time,\n * because only rows whose child levels load lazily carry descriptors. Deriving\n * per render also means late-arriving catalog metadata simply re-derives —\n * there is no build a count can miss. `findLevel` is the menu's config-level\n * lookup by a row's `configNodeId`.\n */\nexport const useCountChipBadges = (\n items,\n { findLevel, catalogObjects, promotedEntities } = {}\n) => {\n // A row's claim is derived from its lazy-load descriptors, which the menu\n // clears once a row is known childless — remembering the claim keeps a\n // resolved count (including \"0\") on screen instead of flickering out.\n const [claimMemory] = useState(() => new Map());\n\n /** One target per (row × count), keyed `${itemId}::${index}`. */\n const targets = useMemo(\n () =>\n items\n .filter((item) => !item.synthetic)\n .flatMap((item) =>\n countChipsOf(item.node?.properties)\n .map((chip, index) => ({ item, chip, key: `${item.id}::${index}` }))\n .filter(({ chip }) => chip?.childKey)\n ),\n [items]\n );\n\n const claimByKey = useMemo(() => {\n const { claimByNodeId: fresh } = buildCountChipClaims(\n targets.map(({ item, chip, key }) => {\n const node = item.node;\n // Lazy levels already carry the child search; every other row derives\n // it from its own config level's child + the catalog association.\n const hasLazy = node.lazyLoadChildrenArr?.some(\n (sm) => sm.parentNodeRefKey === chip.childKey\n );\n let countChipChildrenArr;\n if (!hasLazy) {\n const descriptor = buildCountChipDescriptor(\n node,\n node.nodeObj,\n countedLevelOf(findLevel, node, chip.childKey),\n catalogObjects,\n promotedEntities\n );\n if (descriptor) countChipChildrenArr = [descriptor];\n }\n return {\n id: key,\n countChip: chip,\n lazyLoadChildrenArr: node.lazyLoadChildrenArr,\n countChipChildrenArr\n };\n })\n );\n // A null claim is a known zero (blank parent key) — kept like any other.\n const resolved = {};\n targets.forEach(({ key }) => {\n const claim = key in fresh ? fresh[key] : claimMemory.get(key);\n if (claim === undefined) return;\n claimMemory.set(key, claim);\n resolved[key] = claim;\n });\n return resolved;\n }, [claimMemory, targets, findLevel, catalogObjects, promotedEntities]);\n\n const allClaims = useMemo(\n () => Object.values(claimByKey).filter(Boolean),\n [claimByKey]\n );\n const counts = useClaimCounts(allClaims);\n\n return useMemo(() => {\n const badges = {};\n targets.forEach(({ item, chip, key }) => {\n const claim = claimByKey[key];\n if (claim === undefined) return;\n const count = claim === null ? 0 : counts.get(claimKeyOf(claim));\n if (count === undefined || count === null) return;\n // Optional severity bands color the count from the value already\n // fetched — pure client-side evaluation, no extra request. No band\n // matched (or none configured) keeps the quiet informative badge.\n const severity = getCountThresholdStatus(chip.thresholds, count);\n const counted = countedLevelOf(findLevel, item.node, chip.childKey);\n (badges[item.id] ??= []).push({\n content: String(count),\n title: counted ? entityLevelName(counted.properties) : undefined,\n color: severity ? SEVERITY_TO_BADGE_COLOR[severity] : 'informative',\n appearance: 'tint'\n });\n });\n return badges;\n }, [targets, claimByKey, counts, findLevel]);\n};\n\nexport { useMenuQueryClient };\n"],"mappings":";;;;;;;;;;;;;;;;;AA4BA,MAAaoB,0BAA0B;EACpCH,kBAAkBI,UAAU;EAC5BJ,kBAAkBK,QAAQ;EAC1BL,kBAAkBM,UAAU;EAC5BN,kBAAkBO,OAAO;CAC3B;;;;;;AAOD,MAAaC,iBAAiBC,cAAc;CAC1CC,OAAOP,wBAAwBM,aAAa;CAC5CE,YAAY;CACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BD,MAAMC,iBAAiB;AACvB,MAAMC,iBAAiB;;;AAIvB,MAAMC,iCAAiB,IAAIC,KAAK;AAChC,IAAIC,aAAa;;AAEjB,MAAMC,iCAAiB,IAAIC,KAAK;AAChC,IAAIC,wBAAwB;AAC5B,IAAIC,mBAAmB;;AAGvB,MAAMC,iBAAiBC,UAAU;CAC/B,MAAMC,SAASD,OAAOE,UAAUD,UAAUD,OAAOC;AACjD,QAAO,OAAOA,WAAW,YAAYA,UAAU;;AAGjD,MAAME,oBAAoBC,UACxBjC,yBAAyB;CACvBkC,aAAaD,MAAMC;CACnBC,UAAUF,MAAME;CAChBC,WAAWH,MAAMG;CAClB,CAAC;AAEJ,MAAMC,qBAAqB;AACzBd,cAAa;CACb,MAAMe,UAAUC,MAAMC,KAAKnB,eAAeoB,QAAQ,CAAC;AACnDpB,gBAAeqB,OAAO;AAEtBJ,SAAQK,SAASC,WAAW;EAC1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J;EAAAzC,IACjBD,OAAIC;EAAG2B,qBACU5B,OAAIS,KAAKmB;EAC/B"}
|
|
@@ -20,7 +20,17 @@ import type { DisplayNode } from '../../../domain/inquiryTree/displayTree';
|
|
|
20
20
|
/** Depth-first search of one root's subtree for the first node `match` accepts. */
|
|
21
21
|
export declare const findDisplayNode: (node: DisplayNode, match: (node: DisplayNode) => boolean) => DisplayNode;
|
|
22
22
|
/** Depth-first lookup by display id within one root's subtree. */
|
|
23
|
-
export declare const findNodeById: (node: DisplayNode, id: string) => DisplayNode;
|
|
23
|
+
export declare const findNodeById: (node: DisplayNode, id: string | number) => DisplayNode;
|
|
24
|
+
/**
|
|
25
|
+
* Path copy: `patch` edits a shallow copy of each node whose id is in `ids`
|
|
26
|
+
* (returning false to discard it), and only the ancestors of a patched node are
|
|
27
|
+
* copied — every untouched subtree keeps its identity. Unchanged → same node.
|
|
28
|
+
*/
|
|
29
|
+
export declare const patchNodes: (node: DisplayNode, ids: Set<unknown>, patch: (copy: DisplayNode) => boolean) => DisplayNode;
|
|
30
|
+
/** patchNodes over a menu entry, which is one root or a list of roots. */
|
|
31
|
+
export declare const patchMenuEntry: <T extends DisplayNode[] | DisplayNode>(entry: T, ids: Set<unknown>, patch: (copy: DisplayNode) => boolean) => T;
|
|
32
|
+
/** The ids of every row above the row `id` names under `root`, top down. */
|
|
33
|
+
export declare const ancestorIdsOf: (root: DisplayNode, id: string | number) => unknown[];
|
|
24
34
|
/** Where a row lives in the menu list: its menu, the root above it, itself. */
|
|
25
35
|
export interface MenuLocation {
|
|
26
36
|
menuIndex: number;
|
|
@@ -38,4 +48,11 @@ export declare const locateNodeById: (menus: DisplayNode[][], id: string) => Men
|
|
|
38
48
|
* parent is not in this menu.
|
|
39
49
|
*/
|
|
40
50
|
export declare const findRecordParent: (roots: DisplayNode[], node: DisplayNode) => DisplayNode;
|
|
51
|
+
/**
|
|
52
|
+
* The topmost RECORD on the path from `root` down to the row `id` names — the
|
|
53
|
+
* record a refresh re-reads. It is `root` itself unless the root is a group
|
|
54
|
+
* heading, in which case it is the first record below it. Null when `id` is not
|
|
55
|
+
* under `root` or the path holds no record.
|
|
56
|
+
*/
|
|
57
|
+
export declare const findRecordRoot: (root: DisplayNode, id: string | number) => DisplayNode;
|
|
41
58
|
//# sourceMappingURL=lineageModel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lineageModel.d.ts","sourceRoot":"","sources":["../../../../src/inquiry/v2/tree/lineageModel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAE3E,mFAAmF;AACnF,eAAO,MAAM,eAAe,2EAW3B,CAAC;AAEF,kEAAkE;AAClE,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"lineageModel.d.ts","sourceRoot":"","sources":["../../../../src/inquiry/v2/tree/lineageModel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAE3E,mFAAmF;AACnF,eAAO,MAAM,eAAe,2EAW3B,CAAC;AAEF,kEAAkE;AAClE,eAAO,MAAM,YAAY,yDAMsC,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,UAAU,8FAetB,CAAC;AAEF,0EAA0E;AAC1E,eAAO,MAAM,cAAc,GAAI,CAAC,8GAQ/B,CAAC;AAeF,4EAA4E;AAC5E,eAAO,MAAM,aAAa,uDAMlB,CAAC;AAET,+EAA+E;AAC/E,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,mFAAmF;AACnF,eAAO,MAAM,aAAa,iFAWzB,CAAC;AAEF,oDAAoD;AACpD,eAAO,MAAM,cAAc,sDAI2C,CAAC;AAEvE;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,0DAW5B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,yDAW1B,CAAC"}
|
|
@@ -13,7 +13,57 @@ export const findDisplayNode = (node, match) => {
|
|
|
13
13
|
return null;
|
|
14
14
|
};
|
|
15
15
|
/** Depth-first lookup by display id within one root's subtree. */
|
|
16
|
-
export const findNodeById = (node, id) =>
|
|
16
|
+
export const findNodeById = (node, id) => id == null || id === ''
|
|
17
|
+
? null
|
|
18
|
+
: findDisplayNode(node, (n) => String(n.id) === String(id));
|
|
19
|
+
/**
|
|
20
|
+
* Path copy: `patch` edits a shallow copy of each node whose id is in `ids`
|
|
21
|
+
* (returning false to discard it), and only the ancestors of a patched node are
|
|
22
|
+
* copied — every untouched subtree keeps its identity. Unchanged → same node.
|
|
23
|
+
*/
|
|
24
|
+
export const patchNodes = (node, ids, patch) => {
|
|
25
|
+
var _a;
|
|
26
|
+
if (!node)
|
|
27
|
+
return node;
|
|
28
|
+
const children = (_a = node.children) === null || _a === void 0 ? void 0 : _a.map((child) => patchNodes(child, ids, patch));
|
|
29
|
+
let next = (children === null || children === void 0 ? void 0 : children.some((child, index) => {
|
|
30
|
+
var _a;
|
|
31
|
+
return child !== ((_a = node.children) === null || _a === void 0 ? void 0 : _a[index]);
|
|
32
|
+
}))
|
|
33
|
+
? Object.assign(Object.assign({}, node), { children }) : node;
|
|
34
|
+
if (ids.has(node.id)) {
|
|
35
|
+
const copy = Object.assign({}, next);
|
|
36
|
+
if (patch(copy))
|
|
37
|
+
next = copy;
|
|
38
|
+
}
|
|
39
|
+
return next;
|
|
40
|
+
};
|
|
41
|
+
/** patchNodes over a menu entry, which is one root or a list of roots. */
|
|
42
|
+
export const patchMenuEntry = (entry, ids, patch) => {
|
|
43
|
+
if (!Array.isArray(entry))
|
|
44
|
+
return patchNodes(entry, ids, patch);
|
|
45
|
+
const next = entry.map((root) => patchNodes(root, ids, patch));
|
|
46
|
+
return (next.some((root, index) => root !== entry[index]) ? next : entry);
|
|
47
|
+
};
|
|
48
|
+
/** The rows from `node` down to the row `id` names, or null when it is not there. */
|
|
49
|
+
const pathTo = (node, id) => {
|
|
50
|
+
var _a;
|
|
51
|
+
if (String(node.id) === String(id))
|
|
52
|
+
return [node];
|
|
53
|
+
for (const child of (_a = node.children) !== null && _a !== void 0 ? _a : []) {
|
|
54
|
+
const path = pathTo(child, id);
|
|
55
|
+
if (path)
|
|
56
|
+
return [node, ...path];
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
};
|
|
60
|
+
/** The ids of every row above the row `id` names under `root`, top down. */
|
|
61
|
+
export const ancestorIdsOf = (root, id) => {
|
|
62
|
+
var _a;
|
|
63
|
+
return root && id != null
|
|
64
|
+
? ((_a = pathTo(root, id)) !== null && _a !== void 0 ? _a : []).slice(0, -1).map((node) => node.id)
|
|
65
|
+
: [];
|
|
66
|
+
};
|
|
17
67
|
/** The first row `match` accepts across every menu, menu by menu, root by root. */
|
|
18
68
|
export const locateInMenus = (menus, match) => {
|
|
19
69
|
for (let menuIndex = 0; menuIndex < menus.length; menuIndex += 1) {
|
|
@@ -38,10 +88,29 @@ export const findRecordParent = (roots, node) => {
|
|
|
38
88
|
if (!parentId)
|
|
39
89
|
return null;
|
|
40
90
|
for (const root of roots !== null && roots !== void 0 ? roots : []) {
|
|
41
|
-
const match = findNodeById(root,
|
|
91
|
+
const match = findNodeById(root, parentId);
|
|
42
92
|
if (match)
|
|
43
93
|
return match.isGroupNode ? null : match;
|
|
44
94
|
}
|
|
45
95
|
return null;
|
|
46
96
|
};
|
|
97
|
+
/**
|
|
98
|
+
* The topmost RECORD on the path from `root` down to the row `id` names — the
|
|
99
|
+
* record a refresh re-reads. It is `root` itself unless the root is a group
|
|
100
|
+
* heading, in which case it is the first record below it. Null when `id` is not
|
|
101
|
+
* under `root` or the path holds no record.
|
|
102
|
+
*/
|
|
103
|
+
export const findRecordRoot = (root, id) => {
|
|
104
|
+
var _a;
|
|
105
|
+
if (!root || id == null)
|
|
106
|
+
return null;
|
|
107
|
+
if (!root.isGroupNode)
|
|
108
|
+
return findNodeById(root, id) ? root : null;
|
|
109
|
+
for (const child of (_a = root.children) !== null && _a !== void 0 ? _a : []) {
|
|
110
|
+
const found = findRecordRoot(child, id);
|
|
111
|
+
if (found)
|
|
112
|
+
return found;
|
|
113
|
+
}
|
|
114
|
+
return null;
|
|
115
|
+
};
|
|
47
116
|
//# sourceMappingURL=lineageModel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lineageModel.js","sourceRoot":"","sources":["../../../../src/inquiry/v2/tree/lineageModel.ts"],"names":[],"mappings":"AAoBA,mFAAmF;AACnF,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,IAAoC,EACpC,KAAqC,EACjB,EAAE,CAAC;;IACvB,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IACvB,IAAI,KAAK,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7B,KAAK,MAAM,KAAK,UAAI,IAAI,CAAC,QAAQ,mCAAI,EAAE,EAAE,CAAC;QACxC,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC5C,IAAI,KAAK;YAAE,OAAO,KAAK,CAAC;IAC1B,CAAC;IACD,OAAO,IAAI,CAAC;AAAA,CACb,CAAC;AAEF,kEAAkE;AAClE,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,IAAoC,EACpC,
|
|
1
|
+
{"version":3,"file":"lineageModel.js","sourceRoot":"","sources":["../../../../src/inquiry/v2/tree/lineageModel.ts"],"names":[],"mappings":"AAoBA,mFAAmF;AACnF,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,IAAoC,EACpC,KAAqC,EACjB,EAAE,CAAC;;IACvB,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IACvB,IAAI,KAAK,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7B,KAA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AAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ,CAAA,CAAC;IAC5D,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC3B,KAAK,MAAM,IAAI,IAAI,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC3C,IAAI,KAAK;YAAE,OAAO,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;IACrD,CAAC;IACD,OAAO,IAAI,CAAC;AAAA,CACb,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,IAAoC,EACpC,EAAsC,EAClB,EAAE,CAAC;;IACvB,IAAI,CAAC,IAAI,IAAI,EAAE,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IACrC,IAAI,CAAC,IAAI,CAAC,WAAW;QAAE,OAAO,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IACnE,KAAK,MAAM,KAAK,UAAI,IAAI,CAAC,QAAQ,mCAAI,EAAE,EAAE,CAAC;QACxC,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACxC,IAAI,KAAK;YAAE,OAAO,KAAK,CAAC;IAC1B,CAAC;IACD,OAAO,IAAI,CAAC;AAAA,CACb,CAAC"}
|
|
@@ -10,7 +10,42 @@ const findDisplayNode = (node, match) => {
|
|
|
10
10
|
return null;
|
|
11
11
|
};
|
|
12
12
|
/** Depth-first lookup by display id within one root's subtree. */
|
|
13
|
-
const findNodeById = (node, id) => findDisplayNode(node, (n) => String(n.id) === id);
|
|
13
|
+
const findNodeById = (node, id) => id == null || id === "" ? null : findDisplayNode(node, (n) => String(n.id) === String(id));
|
|
14
|
+
/**
|
|
15
|
+
* Path copy: `patch` edits a shallow copy of each node whose id is in `ids`
|
|
16
|
+
* (returning false to discard it), and only the ancestors of a patched node are
|
|
17
|
+
* copied — every untouched subtree keeps its identity. Unchanged → same node.
|
|
18
|
+
*/
|
|
19
|
+
const patchNodes = (node, ids, patch) => {
|
|
20
|
+
if (!node) return node;
|
|
21
|
+
const children = node.children?.map((child) => patchNodes(child, ids, patch));
|
|
22
|
+
let next = children?.some((child, index) => child !== node.children?.[index]) ? {
|
|
23
|
+
...node,
|
|
24
|
+
children
|
|
25
|
+
} : node;
|
|
26
|
+
if (ids.has(node.id)) {
|
|
27
|
+
const copy = { ...next };
|
|
28
|
+
if (patch(copy)) next = copy;
|
|
29
|
+
}
|
|
30
|
+
return next;
|
|
31
|
+
};
|
|
32
|
+
/** patchNodes over a menu entry, which is one root or a list of roots. */
|
|
33
|
+
const patchMenuEntry = (entry, ids, patch) => {
|
|
34
|
+
if (!Array.isArray(entry)) return patchNodes(entry, ids, patch);
|
|
35
|
+
const next = entry.map((root) => patchNodes(root, ids, patch));
|
|
36
|
+
return next.some((root, index) => root !== entry[index]) ? next : entry;
|
|
37
|
+
};
|
|
38
|
+
/** The rows from `node` down to the row `id` names, or null when it is not there. */
|
|
39
|
+
const pathTo = (node, id) => {
|
|
40
|
+
if (String(node.id) === String(id)) return [node];
|
|
41
|
+
for (const child of node.children ?? []) {
|
|
42
|
+
const path = pathTo(child, id);
|
|
43
|
+
if (path) return [node, ...path];
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
};
|
|
47
|
+
/** The ids of every row above the row `id` names under `root`, top down. */
|
|
48
|
+
const ancestorIdsOf = (root, id) => root && id != null ? (pathTo(root, id) ?? []).slice(0, -1).map((node) => node.id) : [];
|
|
14
49
|
/** The first row `match` accepts across every menu, menu by menu, root by root. */
|
|
15
50
|
const locateInMenus = (menus, match) => {
|
|
16
51
|
for (let menuIndex = 0; menuIndex < menus.length; menuIndex += 1) for (const root of menus[menuIndex]) {
|
|
@@ -35,12 +70,27 @@ const findRecordParent = (roots, node) => {
|
|
|
35
70
|
const parentId = node?.entityNodeParentId || node?.parentId;
|
|
36
71
|
if (!parentId) return null;
|
|
37
72
|
for (const root of roots ?? []) {
|
|
38
|
-
const match = findNodeById(root,
|
|
73
|
+
const match = findNodeById(root, parentId);
|
|
39
74
|
if (match) return match.isGroupNode ? null : match;
|
|
40
75
|
}
|
|
41
76
|
return null;
|
|
42
77
|
};
|
|
78
|
+
/**
|
|
79
|
+
* The topmost RECORD on the path from `root` down to the row `id` names — the
|
|
80
|
+
* record a refresh re-reads. It is `root` itself unless the root is a group
|
|
81
|
+
* heading, in which case it is the first record below it. Null when `id` is not
|
|
82
|
+
* under `root` or the path holds no record.
|
|
83
|
+
*/
|
|
84
|
+
const findRecordRoot = (root, id) => {
|
|
85
|
+
if (!root || id == null) return null;
|
|
86
|
+
if (!root.isGroupNode) return findNodeById(root, id) ? root : null;
|
|
87
|
+
for (const child of root.children ?? []) {
|
|
88
|
+
const found = findRecordRoot(child, id);
|
|
89
|
+
if (found) return found;
|
|
90
|
+
}
|
|
91
|
+
return null;
|
|
92
|
+
};
|
|
43
93
|
//#endregion
|
|
44
|
-
export { findNodeById, findRecordParent, locateInMenus, locateNodeById };
|
|
94
|
+
export { ancestorIdsOf, findDisplayNode, findNodeById, findRecordParent, findRecordRoot, locateInMenus, locateNodeById, patchMenuEntry };
|
|
45
95
|
|
|
46
96
|
//# sourceMappingURL=lineageModel.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lineageModel.mjs","names":["DisplayNode","findDisplayNode","node","match","child","children","found","findNodeById","id","n","String","
|
|
1
|
+
{"version":3,"file":"lineageModel.mjs","names":["DisplayNode","findDisplayNode","node","match","child","children","found","findNodeById","id","n","String","patchNodes","ids","Set","patch","copy","map","next","some","index","has","patchMenuEntry","entry","T","Array","isArray","root","pathTo","path","ancestorIdsOf","slice","MenuLocation","menuIndex","locateInMenus","menus","length","locateNodeById","findRecordParent","roots","parentId","entityNodeParentId","isGroupNode","findRecordRoot"],"sources":["../../../../src/inquiry/v2/tree/lineageModel.ts"],"sourcesContent":["/**\n * Record lineage over a composed menu — the parent a row hangs off.\n *\n * v1 STAMPED it at click time: the shared tree menu wrote\n * `selectedNode.parentNode` inside its own click handler\n * (InquiryFluentTreeMenu.jsx:528-534), so the lineage a page widget or an action\n * page read existed only for rows the user had personally clicked, and vanished\n * on every menu rebuild, expand-all and filter pass (all three clone the nodes).\n * v2 DERIVES it from the same rule instead, so a row reached by a deep link, by\n * filter stepping, or by the default selection carries the same lineage a\n * clicked one does.\n *\n * The rule is v1's, unchanged: a row's parent is the node its\n * `entityNodeParentId` names — the nearest RECORD-bearing ancestor, stamped by\n * the display-tree composer as it walks past group rows\n * (domain/inquiryTree/displayTree.ts:1109-1113) — falling back to `parentId`\n * where a level has none.\n */\nimport type { DisplayNode } from '../../../domain/inquiryTree/displayTree';\n\n/** Depth-first search of one root's subtree for the first node `match` accepts. */\nexport const findDisplayNode = (\n node: DisplayNode | null | undefined,\n match: (node: DisplayNode) => boolean\n): DisplayNode | null => {\n if (!node) return null;\n if (match(node)) return node;\n for (const child of node.children ?? []) {\n const found = findDisplayNode(child, match);\n if (found) return found;\n }\n return null;\n};\n\n/** Depth-first lookup by display id within one root's subtree. */\nexport const findNodeById = (\n node: DisplayNode | null | undefined,\n id: string | number | null | undefined\n): DisplayNode | null =>\n id == null || id === ''\n ? null\n : findDisplayNode(node, (n) => String(n.id) === String(id));\n\n/**\n * Path copy: `patch` edits a shallow copy of each node whose id is in `ids`\n * (returning false to discard it), and only the ancestors of a patched node are\n * copied — every untouched subtree keeps its identity. Unchanged → same node.\n */\nexport const patchNodes = (\n node: DisplayNode,\n ids: Set<unknown>,\n patch: (copy: DisplayNode) => boolean\n): DisplayNode => {\n if (!node) return node;\n const children = node.children?.map((child) => patchNodes(child, ids, patch));\n let next = children?.some((child, index) => child !== node.children?.[index])\n ? { ...node, children }\n : node;\n if (ids.has(node.id)) {\n const copy = { ...next };\n if (patch(copy)) next = copy;\n }\n return next;\n};\n\n/** patchNodes over a menu entry, which is one root or a list of roots. */\nexport const patchMenuEntry = <T extends DisplayNode | DisplayNode[]>(\n entry: T,\n ids: Set<unknown>,\n patch: (copy: DisplayNode) => boolean\n): T => {\n if (!Array.isArray(entry)) return patchNodes(entry, ids, patch) as T;\n const next = entry.map((root) => patchNodes(root, ids, patch));\n return (next.some((root, index) => root !== entry[index]) ? next : entry) as T;\n};\n\n/** The rows from `node` down to the row `id` names, or null when it is not there. */\nconst pathTo = (\n node: DisplayNode,\n id: string | number\n): DisplayNode[] | null => {\n if (String(node.id) === String(id)) return [node];\n for (const child of node.children ?? []) {\n const path = pathTo(child, id);\n if (path) return [node, ...path];\n }\n return null;\n};\n\n/** The ids of every row above the row `id` names under `root`, top down. */\nexport const ancestorIdsOf = (\n root: DisplayNode | null | undefined,\n id: string | number | null | undefined\n): unknown[] =>\n root && id != null\n ? (pathTo(root, id) ?? []).slice(0, -1).map((node) => node.id)\n : [];\n\n/** Where a row lives in the menu list: its menu, the root above it, itself. */\nexport interface MenuLocation {\n menuIndex: number;\n root: DisplayNode;\n node: DisplayNode;\n}\n\n/** The first row `match` accepts across every menu, menu by menu, root by root. */\nexport const locateInMenus = (\n menus: DisplayNode[][],\n match: (node: DisplayNode) => boolean\n): MenuLocation | null => {\n for (let menuIndex = 0; menuIndex < menus.length; menuIndex += 1) {\n for (const root of menus[menuIndex]) {\n const node = findDisplayNode(root, match);\n if (node) return { menuIndex, root, node };\n }\n }\n return null;\n};\n\n/** A display id's location across the menu list. */\nexport const locateNodeById = (\n menus: DisplayNode[][],\n id: string | null | undefined\n): MenuLocation | null =>\n id == null ? null : locateInMenus(menus, (n) => String(n.id) === id);\n\n/**\n * The record parent of a row, looked up across one menu's roots. Null for a\n * root, for a row whose named parent is a group (a group carries no record, so\n * v1's `parentNode.nodeObj` was undefined there anyway), and for a row whose\n * parent is not in this menu.\n */\nexport const findRecordParent = (\n roots: DisplayNode[] | undefined,\n node: DisplayNode | null | undefined\n): DisplayNode | null => {\n const parentId = node?.entityNodeParentId || node?.parentId;\n if (!parentId) return null;\n for (const root of roots ?? []) {\n const match = findNodeById(root, parentId);\n if (match) return match.isGroupNode ? null : match;\n }\n return null;\n};\n\n/**\n * The topmost RECORD on the path from `root` down to the row `id` names — the\n * record a refresh re-reads. It is `root` itself unless the root is a group\n * heading, in which case it is the first record below it. Null when `id` is not\n * under `root` or the path holds no record.\n */\nexport const findRecordRoot = (\n root: DisplayNode | null | undefined,\n id: string | number | null | undefined\n): DisplayNode | null => {\n if (!root || id == null) return null;\n if (!root.isGroupNode) return findNodeById(root, id) ? root : null;\n for (const child of root.children ?? []) {\n const found = findRecordRoot(child, id);\n if (found) return found;\n }\n return null;\n};\n"],"mappings":";;AAqBA,MAAaC,mBACXC,MACAC,UACuB;AACvB,KAAI,CAACD,KAAM,QAAO;AAClB,KAAIC,MAAMD,KAAK,CAAE,QAAOA;AACxB,MAAK,MAAME,SAASF,KAAKG,YAAY,EAAE,EAAE;EACvC,MAAMC,QAAQL,gBAAgBG,OAAOD,MAAM;AAC3C,MAAIG,MAAO,QAAOA;;AAEpB,QAAO;;;AAIT,MAAaC,gBACXL,MACAM,OAEAA,MAAM,QAAQA,OAAO,KACjB,OACAP,gBAAgBC,OAAOO,MAAMC,OAAOD,EAAED,GAAG,KAAKE,OAAOF,GAAG,CAAC;;;;;;AAO/D,MAAaG,cACXT,MACAU,KACAE,UACgB;AAChB,KAAI,CAACZ,KAAM,QAAOA;CAClB,MAAMG,WAAWH,KAAKG,UAAUW,KAAKZ,UAAUO,WAAWP,OAAOQ,KAAKE,MAAM,CAAC;CAC7E,IAAIG,OAAOZ,UAAUa,MAAMd,OAAOe,UAAUf,UAAUF,KAAKG,WAAWc,OAAO,GACzE;EAAE,GAAGjB;EAAMG;EAAU,GACrBH;AACJ,KAAIU,IAAIQ,IAAIlB,KAAKM,GAAG,EAAE;EACpB,MAAMO,OAAO,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BAAsBtC,MAAMqC;AACnD,KAAI,CAACA,SAAU,QAAO;AACtB,MAAK,MAAMb,QAAQY,SAAS,EAAE,EAAE;EAC9B,MAAMnC,QAAQI,aAAamB,MAAMa,SAAS;AAC1C,MAAIpC,MAAO,QAAOA,MAAMsC,cAAc,OAAOtC;;AAE/C,QAAO;;;;;;;;AAST,MAAauC,kBACXhB,MACAlB,OACuB;AACvB,KAAI,CAACkB,QAAQlB,MAAM,KAAM,QAAO;AAChC,KAAI,CAACkB,KAAKe,YAAa,QAAOlC,aAAamB,MAAMlB,GAAG,GAAGkB,OAAO;AAC9D,MAAK,MAAMtB,SAASsB,KAAKrB,YAAY,EAAE,EAAE;EACvC,MAAMC,QAAQoC,eAAetC,OAAOI,GAAG;AACvC,MAAIF,MAAO,QAAOA;;AAEpB,QAAO"}
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
* stale data the user asked to replace.
|
|
18
18
|
*
|
|
19
19
|
* A rebuild only happens when the root page ANSWERS DIFFERENTLY, though, and a
|
|
20
|
-
* mutation on a child record leaves the root rows byte-identical.
|
|
21
|
-
*
|
|
22
|
-
* without disturbing anything around them.
|
|
20
|
+
* mutation on a child record leaves the root rows byte-identical. Refreshing
|
|
21
|
+
* the branch that mutation touched is branchRefreshModel's job.
|
|
23
22
|
*/
|
|
24
23
|
import type { DisplayNode } from '../../../domain/inquiryTree/displayTree';
|
|
25
24
|
/** One menu = the roots it renders as depth-0 siblings. */
|
|
26
25
|
export type MenuRoots = DisplayNode[];
|
|
26
|
+
export declare const stableKeyOf: (node: DisplayNode) => string;
|
|
27
27
|
/** Every row's `isExpanded`, keyed by its stable path. */
|
|
28
28
|
export declare const collectExpansion: (list: MenuRoots[]) => Map<string, boolean>;
|
|
29
29
|
/**
|
|
@@ -37,37 +37,20 @@ export declare const applyExpansion: (list: MenuRoots[], snapshot: Map<string, b
|
|
|
37
37
|
* Carry the user's workspace onto a fresh build of the seeded page.
|
|
38
38
|
*
|
|
39
39
|
* `loadedRoots` are the roots the user brought in themselves (+ Load, a deep
|
|
40
|
-
* link, a widget's loadInquiryNode)
|
|
41
|
-
*
|
|
42
|
-
*
|
|
40
|
+
* link, a widget's loadInquiryNode), already recomposed against the current
|
|
41
|
+
* config by the caller — the refetched page has no reason to contain them, so
|
|
42
|
+
* they are re-appended, in load order, minus any the page now carries on its
|
|
43
|
+
* own. A SEEDED root that vanished from the refetch is not
|
|
43
44
|
* re-added: it is gone because the record is gone, and that is the refresh
|
|
44
45
|
* working.
|
|
45
46
|
*
|
|
46
|
-
* `droppedPages` are the page roots Load_Inquiry_Page drops built
|
|
47
|
-
* (droppedPageModel) — no query owns them
|
|
48
|
-
* own menu at the top, where the drop put it.
|
|
47
|
+
* `droppedPages` are the page roots Load_Inquiry_Page drops built, rebuilt
|
|
48
|
+
* from their drops (droppedPageModel.rebuildDroppedPage) — no query owns them
|
|
49
|
+
* either, so each comes back as its own menu at the top, where the drop put it.
|
|
49
50
|
*
|
|
50
51
|
* Expansion is replayed last so the carried-over roots — which already hold
|
|
51
52
|
* their own state — and the rebuilt rows settle from one snapshot.
|
|
52
53
|
*/
|
|
53
|
-
/**
|
|
54
|
-
* Swap the RECORD behind rows the menu already holds — the half of a refresh a
|
|
55
|
-
* rebuild cannot reach.
|
|
56
|
-
*
|
|
57
|
-
* A lazily expanded level's rows are grafted into menu STATE. No query observes
|
|
58
|
-
* them, so invalidating the child-batch cache refetches nothing and the row goes
|
|
59
|
-
* on showing the record it was built from: its label, its icon, the header stat
|
|
60
|
-
* beside it and the form it seeds all keep the value the user just changed. This
|
|
61
|
-
* walks the live menus and, for every record row a fresh row names by
|
|
62
|
-
* businessObjectKey, re-derives everything the RECORD determines — `enrich` runs
|
|
63
|
-
* the same composer the row was built with — while keeping everything the tree
|
|
64
|
-
* put around it: the display id the selection is held by, its children, its
|
|
65
|
-
* expansion and its paging.
|
|
66
|
-
*
|
|
67
|
-
* `list` comes back by reference when nothing matched, so a refresh over records
|
|
68
|
-
* this menu doesn't hold costs no re-render.
|
|
69
|
-
*/
|
|
70
|
-
export declare const restampMenuRecords: (list: MenuRoots[], rows: Record<string, unknown>[], enrich: (node: DisplayNode, row: Record<string, unknown>) => DisplayNode) => MenuRoots[];
|
|
71
54
|
export declare const preserveMenuWorkspace: ({ fresh, previous, loadedRoots, droppedPages }: {
|
|
72
55
|
fresh: MenuRoots[];
|
|
73
56
|
previous: MenuRoots[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menuRebuildModel.d.ts","sourceRoot":"","sources":["../../../../src/inquiry/v2/tree/menuRebuildModel.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"menuRebuildModel.d.ts","sourceRoot":"","sources":["../../../../src/inquiry/v2/tree/menuRebuildModel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAE3E,2DAA2D;AAC3D,MAAM,MAAM,SAAS,GAAG,WAAW,EAAE,CAAC;AAWtC,eAAO,MAAM,WAAW,+BAG+B,CAAC;AAcxD,0DAA0D;AAC1D,eAAO,MAAM,gBAAgB,6CAI5B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,6DAQ1B,CAAC;AAYF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,qBAAqB;;;;;iBA4BjC,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* one opened them all after a refresh; the path prefix is what separates them.
|
|
6
6
|
*/
|
|
7
7
|
const asKeyText = (value) => typeof value === 'string' || typeof value === 'number' ? String(value) : '';
|
|
8
|
-
const stableKeyOf = (node) => {
|
|
8
|
+
export const stableKeyOf = (node) => {
|
|
9
9
|
var _a, _b;
|
|
10
10
|
return node.isGroupNode
|
|
11
11
|
? `g:${asKeyText((_a = node.properties) === null || _a === void 0 ? void 0 : _a['label'])}`
|
|
@@ -53,70 +53,20 @@ const businessObjectKeysIn = (list) => {
|
|
|
53
53
|
* Carry the user's workspace onto a fresh build of the seeded page.
|
|
54
54
|
*
|
|
55
55
|
* `loadedRoots` are the roots the user brought in themselves (+ Load, a deep
|
|
56
|
-
* link, a widget's loadInquiryNode)
|
|
57
|
-
*
|
|
58
|
-
*
|
|
56
|
+
* link, a widget's loadInquiryNode), already recomposed against the current
|
|
57
|
+
* config by the caller — the refetched page has no reason to contain them, so
|
|
58
|
+
* they are re-appended, in load order, minus any the page now carries on its
|
|
59
|
+
* own. A SEEDED root that vanished from the refetch is not
|
|
59
60
|
* re-added: it is gone because the record is gone, and that is the refresh
|
|
60
61
|
* working.
|
|
61
62
|
*
|
|
62
|
-
* `droppedPages` are the page roots Load_Inquiry_Page drops built
|
|
63
|
-
* (droppedPageModel) — no query owns them
|
|
64
|
-
* own menu at the top, where the drop put it.
|
|
63
|
+
* `droppedPages` are the page roots Load_Inquiry_Page drops built, rebuilt
|
|
64
|
+
* from their drops (droppedPageModel.rebuildDroppedPage) — no query owns them
|
|
65
|
+
* either, so each comes back as its own menu at the top, where the drop put it.
|
|
65
66
|
*
|
|
66
67
|
* Expansion is replayed last so the carried-over roots — which already hold
|
|
67
68
|
* their own state — and the rebuilt rows settle from one snapshot.
|
|
68
69
|
*/
|
|
69
|
-
/**
|
|
70
|
-
* Swap the RECORD behind rows the menu already holds — the half of a refresh a
|
|
71
|
-
* rebuild cannot reach.
|
|
72
|
-
*
|
|
73
|
-
* A lazily expanded level's rows are grafted into menu STATE. No query observes
|
|
74
|
-
* them, so invalidating the child-batch cache refetches nothing and the row goes
|
|
75
|
-
* on showing the record it was built from: its label, its icon, the header stat
|
|
76
|
-
* beside it and the form it seeds all keep the value the user just changed. This
|
|
77
|
-
* walks the live menus and, for every record row a fresh row names by
|
|
78
|
-
* businessObjectKey, re-derives everything the RECORD determines — `enrich` runs
|
|
79
|
-
* the same composer the row was built with — while keeping everything the tree
|
|
80
|
-
* put around it: the display id the selection is held by, its children, its
|
|
81
|
-
* expansion and its paging.
|
|
82
|
-
*
|
|
83
|
-
* `list` comes back by reference when nothing matched, so a refresh over records
|
|
84
|
-
* this menu doesn't hold costs no re-render.
|
|
85
|
-
*/
|
|
86
|
-
export const restampMenuRecords = (list, rows, enrich) => {
|
|
87
|
-
const rowsByKey = new Map();
|
|
88
|
-
for (const row of rows) {
|
|
89
|
-
if ((row === null || row === void 0 ? void 0 : row.businessObjectKey) != null) {
|
|
90
|
-
rowsByKey.set(row.businessObjectKey, row);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
if (!rowsByKey.size)
|
|
94
|
-
return list;
|
|
95
|
-
let changed = false;
|
|
96
|
-
const restamp = (node) => {
|
|
97
|
-
var _a, _b;
|
|
98
|
-
const row = node.isGroupNode
|
|
99
|
-
? undefined
|
|
100
|
-
: rowsByKey.get((_a = node.nodeObj) === null || _a === void 0 ? void 0 : _a.businessObjectKey);
|
|
101
|
-
const children = (_b = node.children) === null || _b === void 0 ? void 0 : _b.map(restamp);
|
|
102
|
-
const childrenChanged = !!(children === null || children === void 0 ? void 0 : children.some((child, index) => {
|
|
103
|
-
var _a;
|
|
104
|
-
return child !== ((_a = node.children) === null || _a === void 0 ? void 0 : _a[index]);
|
|
105
|
-
}));
|
|
106
|
-
const fresh = row ? enrich(node, row) : null;
|
|
107
|
-
if (!fresh && !childrenChanged)
|
|
108
|
-
return node;
|
|
109
|
-
changed = true;
|
|
110
|
-
return Object.assign(Object.assign(Object.assign({}, node), (childrenChanged ? { children } : null)), (fresh
|
|
111
|
-
? {
|
|
112
|
-
nodeObj: fresh.nodeObj,
|
|
113
|
-
properties: Object.assign(Object.assign({}, node.properties), fresh.properties)
|
|
114
|
-
}
|
|
115
|
-
: null));
|
|
116
|
-
};
|
|
117
|
-
const next = list.map((menu) => menu.map(restamp));
|
|
118
|
-
return changed ? next : list;
|
|
119
|
-
};
|
|
120
70
|
export const preserveMenuWorkspace = ({ fresh, previous, loadedRoots, droppedPages = [] }) => {
|
|
121
71
|
const present = businessObjectKeysIn(fresh);
|
|
122
72
|
const carried = loadedRoots.filter((root) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menuRebuildModel.js","sourceRoot":"","sources":["../../../../src/inquiry/v2/tree/menuRebuildModel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"menuRebuildModel.js","sourceRoot":"","sources":["../../../../src/inquiry/v2/tree/menuRebuildModel.ts"],"names":[],"mappings":"AA2BA;;;;;GAKG;AACH,MAAM,SAAS,GAAG,CAAC,KAAc,EAAU,EAAE,CAC3C,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAE9E,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAiB,EAAU,EAAE;;WACvD,IAAI,CAAC,WAAW;QACd,CAAC,CAAC,KAAK,SAAS,CAAC,MAAA,IAAI,CAAC,UAAU,0CAAG,OAAO,CAAC,CAAC,EAAE;QAC9C,CAAC,CAAC,KAAK,SAAS,CAAC,MAAA,IAAI,CAAC,OAAO,0CAAE,iBAAiB,CAAC,EAAE;CAAA,CAAC;AAExD,MAAM,SAAS,GAAG,CAChB,IAAiB,EACjB,KAAgD,EAC1C,EAAE,CAAC;IACT,MAAM,OAAO,GAAG,CAAC,IAAiB,EAAE,UAAkB,EAAQ,EAAE,CAAC;;QAC/D,MAAM,IAAI,GAAG,GAAG,UAAU,IAAI,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAClB,OAAC,IAAI,CAAC,QAAQ,mCAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;IAAA,CAChE,CAAC;IACF,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EA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