@declarion/react 0.61.1 → 0.63.0
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-lib/ActionDialog-uiuse5W8.js +374 -0
- package/dist-lib/ActionResultDialog.impl-BUBm9Ck3.js +273 -0
- package/dist-lib/ActionRunner-DAxgnKB3.js +1440 -0
- package/dist-lib/AdminCatalogPage.impl-BJGn7EvA.js +441 -0
- package/dist-lib/{AgentChatPanel.impl-rgkewyMl.js → AgentChatPanel.impl-8bw8J-xV.js} +358 -319
- package/dist-lib/AgentOpenFollower.impl-Cga1q7_e.js +81 -0
- package/dist-lib/AssociatedBlock-D6qDYmRO.js +1515 -0
- package/dist-lib/AuthShell-DdiughRT.js +361 -0
- package/dist-lib/ChangePasswordDialog-DFe7lVQg.js +12 -0
- package/dist-lib/ChangePasswordDialog.impl-DtSIaP-A.js +194 -0
- package/dist-lib/CommandPalette.impl-Db3AFA5w.js +383 -0
- package/dist-lib/CopyButton-C0iEvaT1.js +119 -0
- package/dist-lib/DirtyTabsCloseDialog.impl-DWaFaWKn.js +191 -0
- package/dist-lib/{DraggableChildrenTable-DruYOxKm.js → DraggableChildrenTable-Cy8uevS_.js} +45 -44
- package/dist-lib/DynamicIcon-DuBSz6TZ.js +133 -0
- package/dist-lib/FieldRow-BXBBFOZh.js +157 -0
- package/dist-lib/FilterChips-8fMDBXHp.js +1031 -0
- package/dist-lib/Forgot.impl-CmT5A__V.js +105 -0
- package/dist-lib/{Grid-Dsf3I0xG.js → Grid-Cg29k0jv.js} +98 -99
- package/dist-lib/Icons-Dzl-AkD_.d.ts +159 -0
- package/dist-lib/Icons-lt-7lhYR.js +151 -0
- package/dist-lib/ImpersonationBanner.impl-CBJJx6an.js +76 -0
- package/dist-lib/ImpersonationStartModal.impl-RaZcsJpG.js +158 -0
- package/dist-lib/Kbd-CNttVu0z.js +23 -0
- package/dist-lib/{LayoutRenderer-QN7Wp2W6.js → LayoutRenderer-DEHtYtzV.js} +965 -942
- package/dist-lib/{ListCardsBody-CNaZ0xwz.js → ListCardsBody-BAwFR3yO.js} +46 -52
- package/dist-lib/{MarkdownRenderer-BuO5hYJh.js → MarkdownRenderer-kNEMr6K_.js} +15 -16
- package/dist-lib/MenuItem-CfkVXPvC.js +140 -0
- package/dist-lib/NotFoundPage.impl-ZSBn4WWb.js +68 -0
- package/dist-lib/PageHeader-tw4pX3lI.js +71 -0
- package/dist-lib/PageShell-tI-mm0C5.js +47 -0
- package/dist-lib/Pill-D-wsfRhx.js +42 -0
- package/dist-lib/Preferences.impl-BG9XBZDf.js +162 -0
- package/dist-lib/Profile.impl-CbzSzxyG.js +527 -0
- package/dist-lib/PropertyGridEditor-BTjscqfz.js +4378 -0
- package/dist-lib/RecordHeader-Bv9nJXnG.js +217 -0
- package/dist-lib/RecordIdBadge-C3MgoZvt.js +25 -0
- package/dist-lib/RefreshControl-Ce-T_wSQ.js +195 -0
- package/dist-lib/Reset.impl-Cesyqt5p.js +168 -0
- package/dist-lib/SSOCallbackPage.impl-BC_W9nQA.js +31 -0
- package/dist-lib/SectionCard-VonaiLrx.js +150 -0
- package/dist-lib/SignUp.impl-C1KCQbfZ.js +212 -0
- package/dist-lib/SmartDetailPage.impl-8iOAMYQh.js +1609 -0
- package/dist-lib/SmartListPage.impl-Cc4Zwz5f.js +2818 -0
- package/dist-lib/SmartRecordListPage.impl-xTSohkqG.js +795 -0
- package/dist-lib/{SortHeaderMenu-BV-aQbPy.js → SortHeaderMenu-BKTrq0Wb.js} +23 -23
- package/dist-lib/TenantParamsPage.impl-DMuSs3eP.js +306 -0
- package/dist-lib/TwoFA.impl-BClZ3ndk.js +125 -0
- package/dist-lib/{cardProjection-BnmWukxk.js → cardProjection-Cr7fG6wJ.js} +134 -133
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/format-count-CSEFw2ht.js +943 -0
- package/dist-lib/headerActionZone-bef-tZZ7.js +14 -0
- package/dist-lib/{stores/icon-registry.d.ts → icon-registry-CUT4eF63.d.ts} +14 -11
- package/dist-lib/icons.d.ts +20 -4
- package/dist-lib/icons.js +3 -2
- package/dist-lib/index.d.ts +2516 -150
- package/dist-lib/index.js +1588 -5117
- package/dist-lib/page-inset-D_kkVwwN.js +9 -0
- package/dist-lib/page-state-eA6J_KIR.js +124 -0
- package/dist-lib/param-editors-9yJr7xmN.js +201 -0
- package/dist-lib/payload-B2wODLAX.js +86 -0
- package/dist-lib/{peekDraftStore-Dk1Ha5u3.js → peekDraftStore-D4GRsRKW.js} +44 -43
- package/dist-lib/registry-BpzE8-h8.js +119 -0
- package/dist-lib/screen-back-Cs4kzeqD.js +44 -0
- package/dist-lib/testing.d.ts +53 -56
- package/dist-lib/testing.js +54 -55
- package/dist-lib/use-filter-value-labels-DuqvAIVG.js +413 -0
- package/dist-lib/{useAgentConversation-nT5UypJX.js → useAgentConversation-D210VDCQ.js} +158 -169
- package/dist-lib/useAuth-CR2YKKXb.js +49 -0
- package/dist-lib/useBranding-Ckp_AuJb.js +41 -0
- package/dist-lib/useBrandingChrome-bKTXXDLy.js +170 -0
- package/dist-lib/useCurrentLocation-BdngVeQv.js +22 -0
- package/dist-lib/useCurrentScreen--UovgvRj.js +2511 -0
- package/dist-lib/useImpersonation-DNV23Ks1.js +35 -0
- package/dist-lib/useObject-1OCeV34A.js +26 -0
- package/dist-lib/useOwnRefresh-DkOuM4yo.js +435 -0
- package/dist-lib/useParams-ei6w4I7w.js +133 -0
- package/dist-lib/useProperties-CbdhlhZd.js +81 -0
- package/dist-lib/useResponsiveMode-DIR1bZfo.d.ts +1786 -0
- package/dist-lib/useScreenBack-J861tbwn.js +71 -0
- package/dist-lib/useTabNavigate-BZiW4q3M.js +78 -0
- package/dist-lib/useTabTitle-CZZnWIQi.js +22 -0
- package/dist-lib/utils-D_QDpB8_.js +11 -0
- package/dist-lib/{value-Dwfyghtj.js → value-CDCeHgOv.js} +8 -22
- package/dist-lib/{action-dispatch-gWmOYjOP.js → variants-CbAwl3Mn.js} +734 -740
- package/dist-lib/vite/index.d.ts +42 -16
- package/dist-lib/window-election-CHIvIZwx.js +45 -0
- package/package.json +16 -23
- package/dist-lib/DetailAuditStrip-CSXZoy7v.js +0 -288
- package/dist-lib/DynamicIcon-DW5krHuX.js +0 -280
- package/dist-lib/RefreshControl-DO9rYcdq.js +0 -399
- package/dist-lib/SmartDetailPage.impl-DFIIx80b.js +0 -1565
- package/dist-lib/SmartListPage.impl-D694R32H.js +0 -3051
- package/dist-lib/SmartRecordListPage.impl-CB5cuQJV.js +0 -780
- package/dist-lib/api/agents.d.ts +0 -140
- package/dist-lib/api/auth-redirect.d.ts +0 -3
- package/dist-lib/api/auth.d.ts +0 -26
- package/dist-lib/api/batch.d.ts +0 -25
- package/dist-lib/api/client.d.ts +0 -51
- package/dist-lib/api/data.d.ts +0 -153
- package/dist-lib/api/entities.d.ts +0 -149
- package/dist-lib/api/events.d.ts +0 -91
- package/dist-lib/api/params.d.ts +0 -28
- package/dist-lib/api/properties.d.ts +0 -3
- package/dist-lib/api/schema.d.ts +0 -2
- package/dist-lib/api/status.d.ts +0 -2
- package/dist-lib/app.d.ts +0 -1
- package/dist-lib/components/actions/ActionButton.d.ts +0 -18
- package/dist-lib/components/actions/ActionDialog.d.ts +0 -20
- package/dist-lib/components/actions/ActionResultDialog.d.ts +0 -22
- package/dist-lib/components/actions/ActionRunner.d.ts +0 -62
- package/dist-lib/components/actions/ObjectActionBar.d.ts +0 -29
- package/dist-lib/components/actions/PropertyGridEditor.d.ts +0 -20
- package/dist-lib/components/actions/ResponsiveActionBar.d.ts +0 -259
- package/dist-lib/components/actions/RowActionsKebab.d.ts +0 -20
- package/dist-lib/components/agents/AgentChatPanel.d.ts +0 -3
- package/dist-lib/components/agents/AgentChatPanel.impl.d.ts +0 -14
- package/dist-lib/components/agents/AgentConversationDrawer.d.ts +0 -11
- package/dist-lib/components/agents/AgentElicitForm.d.ts +0 -27
- package/dist-lib/components/agents/AgentPicker.d.ts +0 -8
- package/dist-lib/components/agents/transcript-runs.d.ts +0 -29
- package/dist-lib/components/chrome/AssociationTabs.d.ts +0 -9
- package/dist-lib/components/chrome/AuditMetaStrip.d.ts +0 -11
- package/dist-lib/components/chrome/Breadcrumbs.d.ts +0 -14
- package/dist-lib/components/chrome/HighlightsStrip.d.ts +0 -10
- package/dist-lib/components/chrome/PageHeader.d.ts +0 -16
- package/dist-lib/components/chrome/PageShell.d.ts +0 -7
- package/dist-lib/components/chrome/RecordHeader.d.ts +0 -17
- package/dist-lib/components/chrome/headerActionZone.d.ts +0 -27
- package/dist-lib/components/detail-layout/AssociatedBlock.d.ts +0 -20
- package/dist-lib/components/detail-layout/AssociatedToolbar.d.ts +0 -13
- package/dist-lib/components/detail-layout/ChildrenBlock.d.ts +0 -16
- package/dist-lib/components/detail-layout/ChildrenCards.d.ts +0 -2
- package/dist-lib/components/detail-layout/ChildrenList.d.ts +0 -2
- package/dist-lib/components/detail-layout/ChildrenTable.d.ts +0 -2
- package/dist-lib/components/detail-layout/ChildrenTimeline.d.ts +0 -2
- package/dist-lib/components/detail-layout/DetailAuditStrip.d.ts +0 -12
- package/dist-lib/components/detail-layout/DetailHighlights.d.ts +0 -14
- package/dist-lib/components/detail-layout/DraggableChildrenTable.d.ts +0 -16
- package/dist-lib/components/detail-layout/EditableChildrenTable.d.ts +0 -16
- package/dist-lib/components/detail-layout/ErrorSummary.d.ts +0 -11
- package/dist-lib/components/detail-layout/EvidenceBlock.d.ts +0 -6
- package/dist-lib/components/detail-layout/FieldRow.d.ts +0 -23
- package/dist-lib/components/detail-layout/FieldsBlock.d.ts +0 -8
- package/dist-lib/components/detail-layout/LayoutColumn.d.ts +0 -9
- package/dist-lib/components/detail-layout/LayoutRenderer.d.ts +0 -46
- package/dist-lib/components/detail-layout/LayoutRow.d.ts +0 -8
- package/dist-lib/components/detail-layout/LayoutTabs.d.ts +0 -8
- package/dist-lib/components/detail-layout/PropertiesBlock.d.ts +0 -8
- package/dist-lib/components/detail-layout/QuickAddForm.d.ts +0 -10
- package/dist-lib/components/detail-layout/SectionBlock.d.ts +0 -8
- package/dist-lib/components/detail-layout/StatusesBlock.d.ts +0 -8
- package/dist-lib/components/detail-layout/TimelineComposer.d.ts +0 -10
- package/dist-lib/components/detail-layout/blockMeta.d.ts +0 -5
- package/dist-lib/components/detail-layout/index.d.ts +0 -21
- package/dist-lib/components/detail-layout/useManualColumnResize.d.ts +0 -25
- package/dist-lib/components/detail-layout/useQuickAdd.d.ts +0 -16
- package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.d.ts +0 -2
- package/dist-lib/components/detail-layout/widgets/JsonDiffWidget.d.ts +0 -2
- package/dist-lib/components/detail-layout/widgets/MonacoJson.d.ts +0 -9
- package/dist-lib/components/detail-layout/widgets/WidgetHost.d.ts +0 -9
- package/dist-lib/components/detail-layout/widgets/builtins.d.ts +0 -1
- package/dist-lib/components/detail-layout/widgets/canonicalizeJson.d.ts +0 -1
- package/dist-lib/components/detail-layout/widgets/monacoBootstrap.d.ts +0 -1
- package/dist-lib/components/detail-layout/widgets/registry.d.ts +0 -14
- package/dist-lib/components/fields/BoolField.d.ts +0 -2
- package/dist-lib/components/fields/EmailField.d.ts +0 -2
- package/dist-lib/components/fields/EnumField.d.ts +0 -2
- package/dist-lib/components/fields/IntArrayField.d.ts +0 -2
- package/dist-lib/components/fields/JsonEditor.d.ts +0 -10
- package/dist-lib/components/fields/JsonField.d.ts +0 -3
- package/dist-lib/components/fields/MultilangArrayField.d.ts +0 -2
- package/dist-lib/components/fields/MultilangField.d.ts +0 -2
- package/dist-lib/components/fields/MultilangTextField.d.ts +0 -2
- package/dist-lib/components/fields/NumberField.d.ts +0 -2
- package/dist-lib/components/fields/PasswordField.d.ts +0 -2
- package/dist-lib/components/fields/PhoneField.d.ts +0 -2
- package/dist-lib/components/fields/RefCombobox.d.ts +0 -45
- package/dist-lib/components/fields/RefField.d.ts +0 -2
- package/dist-lib/components/fields/RichTextField.d.ts +0 -2
- package/dist-lib/components/fields/SecretField.d.ts +0 -2
- package/dist-lib/components/fields/StringArrayField.d.ts +0 -2
- package/dist-lib/components/fields/StringField.d.ts +0 -2
- package/dist-lib/components/fields/StructureField.d.ts +0 -2
- package/dist-lib/components/fields/TextField.d.ts +0 -2
- package/dist-lib/components/fields/TimestampField.d.ts +0 -2
- package/dist-lib/components/fields/UrlField.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/badge.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/boolPill.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/code.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/date.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/email.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/emptyCell.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/host-icons.d.ts +0 -17
- package/dist-lib/components/fields/cells/factories/json.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/link.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/markdown.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/markdownPreview.d.ts +0 -9
- package/dist-lib/components/fields/cells/factories/money.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/multilangInline.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/nextRun.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/number.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/passwordMask.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/phone.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/refLink.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/richTextPreview.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/statusPill.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/tagList.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/text.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/timestamp.d.ts +0 -3
- package/dist-lib/components/fields/cells/factories/url-helpers.d.ts +0 -12
- package/dist-lib/components/fields/cells/factories/url.d.ts +0 -2
- package/dist-lib/components/fields/cells/registry.d.ts +0 -21
- package/dist-lib/components/fields/index.d.ts +0 -28
- package/dist-lib/components/fields/langMap.d.ts +0 -2
- package/dist-lib/components/fields/secretValue.d.ts +0 -2
- package/dist-lib/components/file-widgets/CircleImage.d.ts +0 -2
- package/dist-lib/components/file-widgets/DocumentCard.d.ts +0 -2
- package/dist-lib/components/file-widgets/FileList.d.ts +0 -2
- package/dist-lib/components/file-widgets/Grid.d.ts +0 -2
- package/dist-lib/components/file-widgets/GridLazy.d.ts +0 -2
- package/dist-lib/components/file-widgets/ImageWidget.d.ts +0 -12
- package/dist-lib/components/file-widgets/LabeledSlots.d.ts +0 -2
- package/dist-lib/components/file-widgets/SquareImage.d.ts +0 -2
- package/dist-lib/components/file-widgets/UnknownFileWidget.d.ts +0 -3
- package/dist-lib/components/file-widgets/UploadFailureText.d.ts +0 -4
- package/dist-lib/components/file-widgets/WideBanner.d.ts +0 -2
- package/dist-lib/components/file-widgets/builtins.d.ts +0 -1
- package/dist-lib/components/file-widgets/cropper.d.ts +0 -14
- package/dist-lib/components/file-widgets/draft-scope.d.ts +0 -22
- package/dist-lib/components/file-widgets/helpers.d.ts +0 -15
- package/dist-lib/components/file-widgets/host.d.ts +0 -28
- package/dist-lib/components/file-widgets/index.d.ts +0 -16
- package/dist-lib/components/file-widgets/payload.d.ts +0 -21
- package/dist-lib/components/file-widgets/registry.d.ts +0 -5
- package/dist-lib/components/file-widgets/types.d.ts +0 -17
- package/dist-lib/components/file-widgets/upload.d.ts +0 -45
- package/dist-lib/components/file-widgets/useEmbedFileSrc.d.ts +0 -42
- package/dist-lib/components/file-widgets/value.d.ts +0 -4
- package/dist-lib/components/filters/FilterChips.d.ts +0 -14
- package/dist-lib/components/filters/FilterDrawer.d.ts +0 -32
- package/dist-lib/components/filters/filter-op-label.d.ts +0 -3
- package/dist-lib/components/layout/CommandPalette.d.ts +0 -21
- package/dist-lib/components/layout/DirtyTabsCloseDialog.d.ts +0 -9
- package/dist-lib/components/layout/ImpersonationBanner.d.ts +0 -11
- package/dist-lib/components/layout/ImpersonationFrame.d.ts +0 -11
- package/dist-lib/components/layout/ImpersonationStartModal.d.ts +0 -22
- package/dist-lib/components/layout/Layout.d.ts +0 -6
- package/dist-lib/components/layout/Rail.d.ts +0 -22
- package/dist-lib/components/layout/Sidebar.d.ts +0 -12
- package/dist-lib/components/layout/TabStrip.d.ts +0 -6
- package/dist-lib/components/layout/TenantChip.d.ts +0 -26
- package/dist-lib/components/layout/TopBar.d.ts +0 -22
- package/dist-lib/components/layout/tab-close.d.ts +0 -13
- package/dist-lib/components/list/ColumnPicker.d.ts +0 -20
- package/dist-lib/components/list/InlineEditCell.d.ts +0 -15
- package/dist-lib/components/list/PeekFieldCell.d.ts +0 -16
- package/dist-lib/components/list/QuickPeek.d.ts +0 -59
- package/dist-lib/components/list/ViewSwitcher.d.ts +0 -24
- package/dist-lib/components/list/peekDraftStore.d.ts +0 -6
- package/dist-lib/components/pages/AdminCatalogPage.d.ts +0 -1
- package/dist-lib/components/pages/DocumentsMenu.d.ts +0 -21
- package/dist-lib/components/pages/ExportMenu.d.ts +0 -30
- package/dist-lib/components/pages/NotFoundPage.d.ts +0 -1
- package/dist-lib/components/pages/RecordDocumentsPanel.d.ts +0 -41
- package/dist-lib/components/pages/SSOCallbackPage.d.ts +0 -1
- package/dist-lib/components/pages/SmartDetailPage.d.ts +0 -2
- package/dist-lib/components/pages/SmartDetailPage.impl.d.ts +0 -4
- package/dist-lib/components/pages/SmartListPage.d.ts +0 -2
- package/dist-lib/components/pages/SmartListPage.impl.d.ts +0 -4
- package/dist-lib/components/pages/SmartRecordListPage.d.ts +0 -2
- package/dist-lib/components/pages/SmartRecordListPage.impl.d.ts +0 -4
- package/dist-lib/components/pages/auth/AuthShell.d.ts +0 -18
- package/dist-lib/components/pages/auth/Forgot.d.ts +0 -1
- package/dist-lib/components/pages/auth/Reset.d.ts +0 -1
- package/dist-lib/components/pages/auth/SignIn.d.ts +0 -1
- package/dist-lib/components/pages/auth/SignUp.d.ts +0 -1
- package/dist-lib/components/pages/auth/TwoFA.d.ts +0 -1
- package/dist-lib/components/pages/auth/icons.d.ts +0 -6
- package/dist-lib/components/pages/exportRequest.d.ts +0 -69
- package/dist-lib/components/pages/list/DataCell.d.ts +0 -4
- package/dist-lib/components/pages/list/DeleteViewDialog.d.ts +0 -8
- package/dist-lib/components/pages/list/ListCardRow.d.ts +0 -39
- package/dist-lib/components/pages/list/ListCardsBody.d.ts +0 -33
- package/dist-lib/components/pages/list/ListFloatbar.d.ts +0 -29
- package/dist-lib/components/pages/list/ListFooter.d.ts +0 -26
- package/dist-lib/components/pages/list/ListHeader.d.ts +0 -26
- package/dist-lib/components/pages/list/ListNoRows.d.ts +0 -31
- package/dist-lib/components/pages/list/ListTable.d.ts +0 -33
- package/dist-lib/components/pages/list/ListTableRow.d.ts +0 -17
- package/dist-lib/components/pages/list/ListToolbar.d.ts +0 -46
- package/dist-lib/components/pages/list/ListUrlBanner.d.ts +0 -10
- package/dist-lib/components/pages/list/RowActionsCell.d.ts +0 -34
- package/dist-lib/components/pages/list/RowContextMenu.d.ts +0 -28
- package/dist-lib/components/pages/list/SaveViewDialog.d.ts +0 -10
- package/dist-lib/components/pages/list/SortHeaderMenu.d.ts +0 -14
- package/dist-lib/components/pages/list/cardProjection.d.ts +0 -67
- package/dist-lib/components/pages/list/column-sizing.d.ts +0 -14
- package/dist-lib/components/pages/list/columns.d.ts +0 -46
- package/dist-lib/components/pages/list/filter-meta.d.ts +0 -25
- package/dist-lib/components/pages/list/page-size.d.ts +0 -3
- package/dist-lib/components/pages/list/sortable-header.d.ts +0 -2
- package/dist-lib/components/pages/list/table-features.d.ts +0 -14
- package/dist-lib/components/pages/list/use-filter-value-labels.d.ts +0 -24
- package/dist-lib/components/pages/list/useActiveView.d.ts +0 -45
- package/dist-lib/components/pages/list/useHeaderReorder.d.ts +0 -26
- package/dist-lib/components/pages/list/useListColumnLayout.d.ts +0 -38
- package/dist-lib/components/pages/list/useListQuery.d.ts +0 -67
- package/dist-lib/components/pages/list/useListRowInteraction.d.ts +0 -61
- package/dist-lib/components/pages/list/useListSelection.d.ts +0 -31
- package/dist-lib/components/pages/list/useListSort.d.ts +0 -46
- package/dist-lib/components/pages/list/useListViews.d.ts +0 -57
- package/dist-lib/components/pages/list/useRowMenu.d.ts +0 -46
- package/dist-lib/components/pages/profile/Preferences.d.ts +0 -1
- package/dist-lib/components/pages/profile/Profile.d.ts +0 -7
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.d.ts +0 -2
- package/dist-lib/components/params/ParamsBlock.d.ts +0 -13
- package/dist-lib/components/params/param-editors.d.ts +0 -20
- package/dist-lib/components/primitives/Avatar.d.ts +0 -6
- package/dist-lib/components/primitives/BoolToggle.d.ts +0 -7
- package/dist-lib/components/primitives/BrandGlyph.d.ts +0 -8
- package/dist-lib/components/primitives/BrandLogo.d.ts +0 -12
- package/dist-lib/components/primitives/Btn.d.ts +0 -19
- package/dist-lib/components/primitives/Check.d.ts +0 -7
- package/dist-lib/components/primitives/Chip.d.ts +0 -9
- package/dist-lib/components/primitives/ClassifiedFieldLocked.d.ts +0 -9
- package/dist-lib/components/primitives/Dropdown.d.ts +0 -20
- package/dist-lib/components/primitives/Fields.d.ts +0 -111
- package/dist-lib/components/primitives/HoverCard.d.ts +0 -15
- package/dist-lib/components/primitives/IconBtn.d.ts +0 -11
- package/dist-lib/components/primitives/Icons.d.ts +0 -136
- package/dist-lib/components/primitives/Kbd.d.ts +0 -4
- package/dist-lib/components/primitives/MenuItem.d.ts +0 -14
- package/dist-lib/components/primitives/Pill.d.ts +0 -11
- package/dist-lib/components/primitives/RecordIdBadge.d.ts +0 -8
- package/dist-lib/components/primitives/RowField.d.ts +0 -10
- package/dist-lib/components/primitives/SectionCard.d.ts +0 -24
- package/dist-lib/components/primitives/Spinner.d.ts +0 -3
- package/dist-lib/components/primitives/Tooltip.d.ts +0 -34
- package/dist-lib/components/primitives/dataTableStyles.d.ts +0 -4
- package/dist-lib/components/primitives/index.d.ts +0 -37
- package/dist-lib/components/shared/ChangePasswordDialog.d.ts +0 -9
- package/dist-lib/components/shared/ConfirmDialog.d.ts +0 -11
- package/dist-lib/components/shared/CopyButton.d.ts +0 -8
- package/dist-lib/components/shared/DynamicIcon.d.ts +0 -20
- package/dist-lib/components/shared/EmptyState.d.ts +0 -9
- package/dist-lib/components/shared/ErrorBoundary.d.ts +0 -17
- package/dist-lib/components/shared/LoadingSkeleton.d.ts +0 -6
- package/dist-lib/components/shared/LucideIcon.d.ts +0 -16
- package/dist-lib/components/shared/Markdown.d.ts +0 -3
- package/dist-lib/components/shared/MarkdownRenderer.d.ts +0 -11
- package/dist-lib/components/shared/RefreshControl.d.ts +0 -25
- package/dist-lib/components/shared/StatusGroupsDisplay.d.ts +0 -11
- package/dist-lib/components/shared/StatusStepper.d.ts +0 -13
- package/dist-lib/components/shared/toast/DeclarionToast.d.ts +0 -31
- package/dist-lib/components/shared/useOwnRefresh.d.ts +0 -9
- package/dist-lib/embed/EmbedAuthBootstrap.d.ts +0 -8
- package/dist-lib/embed/EmbedContext.d.ts +0 -50
- package/dist-lib/embed/EmbedDirtyReporter.d.ts +0 -10
- package/dist-lib/embed/EmbedHistoryTracker.d.ts +0 -1
- package/dist-lib/embed/EmbedLocationReporter.d.ts +0 -8
- package/dist-lib/embed/EmbedResizeReporter.d.ts +0 -6
- package/dist-lib/embed/EmbedUnsavedGuard.d.ts +0 -7
- package/dist-lib/embed/embed-dirty.d.ts +0 -24
- package/dist-lib/embed/embed-history.d.ts +0 -19
- package/dist-lib/embed/embed-nav-guard.d.ts +0 -20
- package/dist-lib/embed/file-src.d.ts +0 -63
- package/dist-lib/embed/handshake.d.ts +0 -57
- package/dist-lib/embed/index.d.ts +0 -19
- package/dist-lib/embed/params.d.ts +0 -75
- package/dist-lib/embed/protocol.d.ts +0 -165
- package/dist-lib/embed/screen-location.d.ts +0 -50
- package/dist-lib/embed/theme.d.ts +0 -34
- package/dist-lib/embed/token.d.ts +0 -57
- package/dist-lib/embed/useEmbedNavigate.d.ts +0 -48
- package/dist-lib/embed/useGlobalLinkInterceptor.d.ts +0 -66
- package/dist-lib/failure-BUxXuP4c.js +0 -158
- package/dist-lib/format-count-bXVfHzbI.js +0 -1771
- package/dist-lib/hooks/useActionData.d.ts +0 -61
- package/dist-lib/hooks/useAgentConversation.d.ts +0 -24
- package/dist-lib/hooks/useAllEntityData.d.ts +0 -16
- package/dist-lib/hooks/useAssociatedData.d.ts +0 -10
- package/dist-lib/hooks/useAuth.d.ts +0 -22
- package/dist-lib/hooks/useBranding.d.ts +0 -8
- package/dist-lib/hooks/useBrandingChrome.d.ts +0 -59
- package/dist-lib/hooks/useChildrenData.d.ts +0 -3
- package/dist-lib/hooks/useColumns.d.ts +0 -13
- package/dist-lib/hooks/useCurrentScreen.d.ts +0 -34
- package/dist-lib/hooks/useCursorEntityData.d.ts +0 -79
- package/dist-lib/hooks/useDebounce.d.ts +0 -1
- package/dist-lib/hooks/useEntity.d.ts +0 -2
- package/dist-lib/hooks/useEntityData.d.ts +0 -41
- package/dist-lib/hooks/useFilters.d.ts +0 -14
- package/dist-lib/hooks/useImpersonation.d.ts +0 -23
- package/dist-lib/hooks/useLanguage.d.ts +0 -4
- package/dist-lib/hooks/useLiveObject.d.ts +0 -9
- package/dist-lib/hooks/useLongPress.d.ts +0 -29
- package/dist-lib/hooks/useMutations.d.ts +0 -13
- package/dist-lib/hooks/useObject.d.ts +0 -11
- package/dist-lib/hooks/useObjectStatus.d.ts +0 -5
- package/dist-lib/hooks/usePageState.d.ts +0 -32
- package/dist-lib/hooks/usePageStateRuntime.d.ts +0 -27
- package/dist-lib/hooks/usePageStateTtl.d.ts +0 -11
- package/dist-lib/hooks/useParams.d.ts +0 -49
- package/dist-lib/hooks/useProperties.d.ts +0 -5
- package/dist-lib/hooks/useRealtimeThresholds.d.ts +0 -1
- package/dist-lib/hooks/useRegisterScreenTab.d.ts +0 -11
- package/dist-lib/hooks/useResponsiveMode.d.ts +0 -27
- package/dist-lib/hooks/useSSE.d.ts +0 -31
- package/dist-lib/hooks/useSchema.d.ts +0 -1
- package/dist-lib/hooks/useScreen.d.ts +0 -2
- package/dist-lib/hooks/useScreenBack.d.ts +0 -21
- package/dist-lib/hooks/useScreenTab.d.ts +0 -10
- package/dist-lib/hooks/useTabNavigate.d.ts +0 -34
- package/dist-lib/hooks/useTabSearchMirror.d.ts +0 -1
- package/dist-lib/hooks/useTabTitle.d.ts +0 -2
- package/dist-lib/hooks/useText.d.ts +0 -3
- package/dist-lib/hooks/useTimelineData.d.ts +0 -10
- package/dist-lib/hooks/useVersionWatcher.d.ts +0 -30
- package/dist-lib/hooks/useViews.d.ts +0 -26
- package/dist-lib/lib/action-dispatch.d.ts +0 -8
- package/dist-lib/lib/actions.d.ts +0 -254
- package/dist-lib/lib/anchor.d.ts +0 -36
- package/dist-lib/lib/brand-tokens.d.ts +0 -43
- package/dist-lib/lib/branding.d.ts +0 -20
- package/dist-lib/lib/canonical-url.d.ts +0 -27
- package/dist-lib/lib/capabilityPrefetch.d.ts +0 -6
- package/dist-lib/lib/child-config.d.ts +0 -24
- package/dist-lib/lib/children-validation.d.ts +0 -5
- package/dist-lib/lib/decimal-text.d.ts +0 -1
- package/dist-lib/lib/display-value.d.ts +0 -1
- package/dist-lib/lib/document-templates.d.ts +0 -11
- package/dist-lib/lib/download.d.ts +0 -21
- package/dist-lib/lib/evidence-verdict.d.ts +0 -11
- package/dist-lib/lib/failure.d.ts +0 -2
- package/dist-lib/lib/field-classification.d.ts +0 -61
- package/dist-lib/lib/field-regions.d.ts +0 -8
- package/dist-lib/lib/filter-evaluator.d.ts +0 -16
- package/dist-lib/lib/filters.d.ts +0 -93
- package/dist-lib/lib/format-count.d.ts +0 -41
- package/dist-lib/lib/html-state.d.ts +0 -11
- package/dist-lib/lib/language.d.ts +0 -19
- package/dist-lib/lib/longPressGesture.d.ts +0 -55
- package/dist-lib/lib/mass-edit.d.ts +0 -32
- package/dist-lib/lib/page-inset.d.ts +0 -3
- package/dist-lib/lib/quick-add.d.ts +0 -2
- package/dist-lib/lib/realtime-query-keys.d.ts +0 -22
- package/dist-lib/lib/realtime-reconcile.d.ts +0 -33
- package/dist-lib/lib/realtime-resync.d.ts +0 -23
- package/dist-lib/lib/record-documents-key.d.ts +0 -1
- package/dist-lib/lib/rich-text.d.ts +0 -14
- package/dist-lib/lib/rowClickGesture.d.ts +0 -26
- package/dist-lib/lib/safe-url.d.ts +0 -15
- package/dist-lib/lib/schema-routing.d.ts +0 -3
- package/dist-lib/lib/screen-back.d.ts +0 -70
- package/dist-lib/lib/scroll-restoration.d.ts +0 -90
- package/dist-lib/lib/size-value.d.ts +0 -16
- package/dist-lib/lib/sort.d.ts +0 -72
- package/dist-lib/lib/timestamp.d.ts +0 -53
- package/dist-lib/lib/toast.d.ts +0 -49
- package/dist-lib/lib/ui-actions.d.ts +0 -12
- package/dist-lib/lib/utils.d.ts +0 -9
- package/dist-lib/lib/variants.d.ts +0 -7
- package/dist-lib/lib/versionTracker.d.ts +0 -72
- package/dist-lib/lib/viewport-category.d.ts +0 -44
- package/dist-lib/main.d.ts +0 -1
- package/dist-lib/registry-nSeHd5si.js +0 -1956
- package/dist-lib/safe-url-oSJw5pzO.js +0 -34
- package/dist-lib/stores/auth.d.ts +0 -16
- package/dist-lib/stores/list-layout.d.ts +0 -85
- package/dist-lib/stores/page-state.d.ts +0 -61
- package/dist-lib/stores/preferences.d.ts +0 -37
- package/dist-lib/stores/realtime.d.ts +0 -96
- package/dist-lib/stores/screen-registry.d.ts +0 -17
- package/dist-lib/stores/tabs.d.ts +0 -73
- package/dist-lib/types/api.d.ts +0 -579
- package/dist-lib/types/fieldType.d.ts +0 -2
- package/dist-lib/types/files.d.ts +0 -79
- package/dist-lib/types/ordmap.d.ts +0 -39
- package/dist-lib/types/schema.d.ts +0 -1089
- package/dist-lib/useCurrentScreen-0WBj7wT6.js +0 -7860
- package/dist-lib/useListQuery-C7dq_sEo.js +0 -103
- package/dist-lib/useOwnRefresh-q80kCMMh.js +0 -1167
- package/dist-lib/useProperties-CeGKtq7Q.js +0 -83
- package/dist-lib/useTabSearchMirror-CzNAj82Q.js +0 -175
- package/dist-lib/useText-BsedsJ-J.js +0 -952
- package/dist-lib/vite/fingerprint-plugin.d.ts +0 -44
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { Dt as e, Et as t, Nt as n, V as r, k as i, on as a, sn as o, wt as s, z as c } from "./useCurrentScreen--UovgvRj.js";
|
|
2
|
+
import { t as l } from "./Icons-lt-7lhYR.js";
|
|
3
|
+
import { n as u, r as d } from "./CopyButton-C0iEvaT1.js";
|
|
4
|
+
import { n as f, t as p } from "./MenuItem-CfkVXPvC.js";
|
|
5
|
+
import { C as m, O as h, Q as g, S as _, T as v, b as y, f as b, g as x, l as S, s as C, v as w, w as T, x as E, y as D } from "./PropertyGridEditor-BTjscqfz.js";
|
|
6
|
+
import { t as O } from "./DynamicIcon-DuBSz6TZ.js";
|
|
7
|
+
import { a as k, c as A, d as j, f as M, i as N, l as ee, m as P, n as F, o as I, p as L, r as te, s as R, t as z, u as ne } from "./value-CDCeHgOv.js";
|
|
8
|
+
import { Fragment as B, Suspense as V, lazy as H, useCallback as U, useEffect as W, useLayoutEffect as re, useMemo as ie, useRef as G, useState as K } from "react";
|
|
6
9
|
import { Fragment as q, jsx as J, jsxs as Y } from "react/jsx-runtime";
|
|
7
10
|
//#region src/components/file-widgets/registry.ts
|
|
8
11
|
var X = /* @__PURE__ */ new Map();
|
|
@@ -36,30 +39,30 @@ function de(e) {
|
|
|
36
39
|
let t = e.trim().split(/\s+/).filter(Boolean);
|
|
37
40
|
return t.length === 1 ? t[0].slice(0, 2).toUpperCase() : (t[0][0] + t[1][0]).toUpperCase();
|
|
38
41
|
}
|
|
39
|
-
function fe(
|
|
40
|
-
let { field:
|
|
41
|
-
|
|
42
|
+
function fe(n) {
|
|
43
|
+
let { field: r, fieldName: i, value: a, onChange: o, mode: c, alt: l, recordTitle: u, disabled: d, visual: f, uploadFieldCode: p, uploadSlotCode: h } = n, g = F(a), [v, y] = K("idle"), [b, S] = K(null), [C, O] = K(null), [k, A] = K(null), [I, te] = K(!1), z = G(null), ne = G(!1), B = G(null), { register: V, unregister: H, isDraft: re } = x(), q = s(), X = s("errors");
|
|
44
|
+
W(() => () => {
|
|
42
45
|
z.current && z.current.abort();
|
|
43
46
|
}, []);
|
|
44
|
-
let Z =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
let Z = e(), ae = t(), oe = ie(() => M(g, l, i, Z, ae), [
|
|
48
|
+
l,
|
|
49
|
+
i,
|
|
50
|
+
g,
|
|
48
51
|
Z,
|
|
49
52
|
ae
|
|
50
|
-
]), se =
|
|
51
|
-
let
|
|
52
|
-
if (
|
|
53
|
-
O(
|
|
53
|
+
]), se = r.display?.initials ? u?.trim() : void 0, ce = (r.accepts ?? ["image/*"]).join(","), le = U(async (e) => {
|
|
54
|
+
let t = T(e, r.accepts, r.max_size_bytes);
|
|
55
|
+
if (t) {
|
|
56
|
+
O(E(q, X, t)), y("error");
|
|
54
57
|
return;
|
|
55
58
|
}
|
|
56
|
-
let
|
|
57
|
-
if (
|
|
58
|
-
let { blob:
|
|
59
|
-
file:
|
|
60
|
-
aspectRatio: ge(
|
|
59
|
+
let a = e;
|
|
60
|
+
if (r.display?.crop_on_upload) try {
|
|
61
|
+
let { blob: t, filename: n } = await Q()({
|
|
62
|
+
file: e,
|
|
63
|
+
aspectRatio: ge(r.display.aspect_ratio)
|
|
61
64
|
});
|
|
62
|
-
|
|
65
|
+
a = new File([t], n, { type: t.type || e.type });
|
|
63
66
|
} catch {
|
|
64
67
|
O({
|
|
65
68
|
code: "file.crop_failed",
|
|
@@ -69,155 +72,155 @@ function fe(e) {
|
|
|
69
72
|
}
|
|
70
73
|
O(null), ne.current = !1, y("uploading"), S({
|
|
71
74
|
loaded: 0,
|
|
72
|
-
total:
|
|
75
|
+
total: a.size,
|
|
73
76
|
pct: 0
|
|
74
77
|
});
|
|
75
78
|
let s = new AbortController();
|
|
76
79
|
z.current = s;
|
|
77
80
|
try {
|
|
78
|
-
let
|
|
79
|
-
file:
|
|
80
|
-
entityCode:
|
|
81
|
-
fieldCode:
|
|
82
|
-
slotCode:
|
|
81
|
+
let e = await m({
|
|
82
|
+
file: a,
|
|
83
|
+
entityCode: n.entityCode,
|
|
84
|
+
fieldCode: p ?? i,
|
|
85
|
+
slotCode: h,
|
|
83
86
|
signal: s.signal,
|
|
84
87
|
onProgress: S
|
|
85
88
|
});
|
|
86
89
|
if (ne.current) {
|
|
87
|
-
|
|
90
|
+
D(e.id).catch(() => {}), H(e.id);
|
|
88
91
|
return;
|
|
89
92
|
}
|
|
90
|
-
|
|
91
|
-
let
|
|
92
|
-
id:
|
|
93
|
-
filename:
|
|
94
|
-
content_type:
|
|
95
|
-
size_bytes:
|
|
96
|
-
sha256:
|
|
97
|
-
width:
|
|
98
|
-
height:
|
|
99
|
-
url:
|
|
100
|
-
metadata:
|
|
93
|
+
g && re(g.id) && (D(g.id).catch(() => {}), H(g.id)), V(e.id, () => D(e.id)), A(e.id), y("idle"), S(null);
|
|
94
|
+
let t = {
|
|
95
|
+
id: e.id,
|
|
96
|
+
filename: e.filename,
|
|
97
|
+
content_type: e.content_type,
|
|
98
|
+
size_bytes: e.size_bytes,
|
|
99
|
+
sha256: e.sha256,
|
|
100
|
+
width: e.width,
|
|
101
|
+
height: e.height,
|
|
102
|
+
url: e.url,
|
|
103
|
+
metadata: e.metadata
|
|
101
104
|
};
|
|
102
|
-
|
|
105
|
+
o?.(r.mode === "array" ? [t] : t);
|
|
103
106
|
} catch (e) {
|
|
104
|
-
if (e instanceof
|
|
105
|
-
O(
|
|
107
|
+
if (e instanceof w && e.code === "ABORTED") return;
|
|
108
|
+
O(_(q, X, e)), y("error"), S(null);
|
|
106
109
|
}
|
|
107
110
|
}, [
|
|
108
111
|
X,
|
|
109
112
|
q,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
n,
|
|
113
|
+
r.accepts,
|
|
114
|
+
r.max_size_bytes,
|
|
115
|
+
r.display?.crop_on_upload,
|
|
116
|
+
r.display?.aspect_ratio,
|
|
117
|
+
r.mode,
|
|
116
118
|
i,
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
W,
|
|
120
|
-
p,
|
|
119
|
+
o,
|
|
120
|
+
n.entityCode,
|
|
121
121
|
V,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
122
|
+
re,
|
|
123
|
+
g,
|
|
124
|
+
H,
|
|
125
|
+
p,
|
|
126
|
+
h
|
|
127
|
+
]), de = U(() => {
|
|
128
|
+
v === "uploading" && z.current && (ne.current = !0, z.current.abort(), z.current = null, y("idle"), S(null)), k && (D(k).catch(() => {}), H(k), A(null));
|
|
126
129
|
}, [
|
|
127
|
-
|
|
130
|
+
v,
|
|
128
131
|
k,
|
|
129
|
-
|
|
130
|
-
]), fe =
|
|
131
|
-
|
|
132
|
+
H
|
|
133
|
+
]), fe = U(() => {
|
|
134
|
+
g && re(g.id) && (D(g.id).catch(() => {}), H(g.id), A(null)), o?.(r.mode === "array" ? [] : null);
|
|
132
135
|
}, [
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
]), ye =
|
|
139
|
-
O(null), y("idle"),
|
|
140
|
-
}, []), be =
|
|
141
|
-
|
|
142
|
-
}, [
|
|
143
|
-
|
|
144
|
-
}, [
|
|
145
|
-
|
|
146
|
-
}, [
|
|
147
|
-
if (
|
|
136
|
+
g,
|
|
137
|
+
r.mode,
|
|
138
|
+
re,
|
|
139
|
+
o,
|
|
140
|
+
H
|
|
141
|
+
]), ye = U(() => {
|
|
142
|
+
O(null), y("idle"), B.current?.click();
|
|
143
|
+
}, []), be = U(() => {
|
|
144
|
+
d || B.current?.click();
|
|
145
|
+
}, [d]), xe = U((e) => {
|
|
146
|
+
d || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), be());
|
|
147
|
+
}, [d, be]), Se = U((e) => {
|
|
148
|
+
d || (e.preventDefault(), e.dataTransfer.dropEffect = "copy");
|
|
149
|
+
}, [d]), Ce = U((e) => {
|
|
150
|
+
if (d) return;
|
|
148
151
|
e.preventDefault();
|
|
149
152
|
let t = e.dataTransfer.files?.[0];
|
|
150
153
|
t && le(t);
|
|
151
|
-
}, [
|
|
154
|
+
}, [d, le]), we = U((e) => {
|
|
152
155
|
let t = e.target.files?.[0];
|
|
153
156
|
e.target.value = "", t && le(t);
|
|
154
|
-
}, [le]), Te =
|
|
157
|
+
}, [le]), Te = f.aspectRatio ?? he(f.shape, r.display?.aspect_ratio), Ee = j(g), De = {
|
|
155
158
|
aspectRatio: Te,
|
|
156
|
-
width:
|
|
157
|
-
}, Oe = !!
|
|
158
|
-
e.stopPropagation(),
|
|
159
|
-
}, []), Pe =
|
|
160
|
-
if (!
|
|
161
|
-
let
|
|
162
|
-
x: Math.max(0, Math.min(1,
|
|
163
|
-
y: Math.max(0, Math.min(1,
|
|
159
|
+
width: f.width ?? (f.shape === "wide" ? "100%" : "120px")
|
|
160
|
+
}, Oe = !!g, ke = ue(g, r.display?.listable_thumbnail), Ae = ee(g, r.display?.listable_thumbnail), je = N(g?.id, Ae, ke), Me = c === "display", Ne = U((e) => {
|
|
161
|
+
e.stopPropagation(), te((e) => !e);
|
|
162
|
+
}, []), Pe = U((e) => {
|
|
163
|
+
if (!g || !I) return;
|
|
164
|
+
let t = e.currentTarget.getBoundingClientRect(), n = t.width > 0 ? (e.clientX - t.left) / t.width : .5, i = t.height > 0 ? (e.clientY - t.top) / t.height : .5, a = L(g, {
|
|
165
|
+
x: Math.max(0, Math.min(1, n)),
|
|
166
|
+
y: Math.max(0, Math.min(1, i))
|
|
164
167
|
});
|
|
165
|
-
|
|
168
|
+
o?.(r.mode === "array" ? [a] : a), te(!1);
|
|
166
169
|
}, [
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
170
|
+
r.mode,
|
|
171
|
+
g,
|
|
172
|
+
I,
|
|
173
|
+
o
|
|
171
174
|
]);
|
|
172
175
|
return Me ? /* @__PURE__ */ J("div", {
|
|
173
|
-
className: pe(
|
|
176
|
+
className: pe(f.shape, !1),
|
|
174
177
|
style: De,
|
|
175
178
|
"aria-label": oe,
|
|
176
179
|
children: Oe && je ? /* @__PURE__ */ J("img", {
|
|
177
180
|
src: je,
|
|
178
181
|
alt: oe,
|
|
179
|
-
className: me(
|
|
182
|
+
className: me(f.shape),
|
|
180
183
|
style: { objectPosition: R(Ee) },
|
|
181
184
|
loading: "lazy"
|
|
182
185
|
}) : /* @__PURE__ */ J(_e, {
|
|
183
|
-
shape:
|
|
186
|
+
shape: f.shape,
|
|
184
187
|
initialsTitle: se
|
|
185
188
|
})
|
|
186
189
|
}) : /* @__PURE__ */ Y("div", {
|
|
187
|
-
className: pe(
|
|
190
|
+
className: pe(f.shape, !d),
|
|
188
191
|
style: De,
|
|
189
|
-
tabIndex:
|
|
192
|
+
tabIndex: d ? -1 : 0,
|
|
190
193
|
role: "button",
|
|
191
194
|
"aria-label": oe,
|
|
192
|
-
"aria-disabled":
|
|
193
|
-
"aria-busy":
|
|
194
|
-
"aria-invalid":
|
|
195
|
-
onClick:
|
|
196
|
-
onMouseDown:
|
|
195
|
+
"aria-disabled": d || void 0,
|
|
196
|
+
"aria-busy": v === "uploading" || void 0,
|
|
197
|
+
"aria-invalid": v === "error" || void 0,
|
|
198
|
+
onClick: v === "idle" && !Oe ? be : void 0,
|
|
199
|
+
onMouseDown: I ? Pe : void 0,
|
|
197
200
|
onKeyDown: xe,
|
|
198
201
|
onDragOver: Se,
|
|
199
202
|
onDrop: Ce,
|
|
200
|
-
"data-testid":
|
|
203
|
+
"data-testid": I ? "focal-point-target" : `file-widget-${i}`,
|
|
201
204
|
children: [
|
|
202
205
|
/* @__PURE__ */ J("input", {
|
|
203
|
-
ref:
|
|
206
|
+
ref: B,
|
|
204
207
|
type: "file",
|
|
205
208
|
accept: ce,
|
|
206
209
|
onChange: we,
|
|
207
210
|
style: { display: "none" },
|
|
208
|
-
"data-testid": `file-input-${
|
|
211
|
+
"data-testid": `file-input-${i}`
|
|
209
212
|
}),
|
|
210
213
|
Oe && je ? /* @__PURE__ */ J("img", {
|
|
211
214
|
src: je,
|
|
212
215
|
alt: oe,
|
|
213
|
-
className: me(
|
|
216
|
+
className: me(f.shape),
|
|
214
217
|
style: { objectPosition: R(Ee) },
|
|
215
218
|
loading: "lazy"
|
|
216
|
-
}) :
|
|
217
|
-
shape:
|
|
219
|
+
}) : v === "uploading" ? null : /* @__PURE__ */ J(_e, {
|
|
220
|
+
shape: f.shape,
|
|
218
221
|
initialsTitle: se
|
|
219
222
|
}),
|
|
220
|
-
|
|
223
|
+
v === "uploading" && /* @__PURE__ */ J(ve, {
|
|
221
224
|
pct: b?.pct ?? 0,
|
|
222
225
|
label: q("file.upload.progress", "Uploading {pct}%", { pct: Math.round(b?.pct ?? 0) })
|
|
223
226
|
}),
|
|
@@ -226,15 +229,15 @@ function fe(e) {
|
|
|
226
229
|
"aria-hidden": "true",
|
|
227
230
|
"data-testid": "draft-indicator"
|
|
228
231
|
}),
|
|
229
|
-
Oe &&
|
|
232
|
+
Oe && v === "idle" && !d && /* @__PURE__ */ Y("div", {
|
|
230
233
|
className: "absolute inset-0 flex items-center justify-center gap-2 bg-black/40 opacity-0 transition-opacity hover:opacity-100 focus-within:opacity-100",
|
|
231
234
|
children: [
|
|
232
|
-
|
|
235
|
+
r.display?.focal_point && /* @__PURE__ */ J("button", {
|
|
233
236
|
type: "button",
|
|
234
237
|
className: "rounded-sm border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-surface-2",
|
|
235
238
|
onClick: Ne,
|
|
236
239
|
"data-testid": "focal-point-toggle",
|
|
237
|
-
children:
|
|
240
|
+
children: I ? q("file.image.focus_cancel", "Cancel focus") : q("file.image.focus_set", "Set focus")
|
|
238
241
|
}),
|
|
239
242
|
/* @__PURE__ */ J("button", {
|
|
240
243
|
type: "button",
|
|
@@ -262,7 +265,7 @@ function fe(e) {
|
|
|
262
265
|
},
|
|
263
266
|
"data-testid": "focal-point-marker"
|
|
264
267
|
}),
|
|
265
|
-
|
|
268
|
+
v === "uploading" && /* @__PURE__ */ J("button", {
|
|
266
269
|
type: "button",
|
|
267
270
|
className: "absolute bottom-1 right-1 rounded-sm border border-border bg-card px-2 py-0.5 text-xs",
|
|
268
271
|
onClick: (e) => {
|
|
@@ -271,13 +274,13 @@ function fe(e) {
|
|
|
271
274
|
"data-testid": "cancel-upload",
|
|
272
275
|
children: q("file.upload.cancel", "Cancel")
|
|
273
276
|
}),
|
|
274
|
-
|
|
277
|
+
v === "error" && C && /* @__PURE__ */ Y("div", {
|
|
275
278
|
className: "absolute inset-x-0 bottom-0 flex items-center justify-between gap-2 bg-destructive-soft px-2 py-1 text-xs text-destructive",
|
|
276
279
|
role: "alert",
|
|
277
280
|
children: [/* @__PURE__ */ J("span", {
|
|
278
281
|
className: "truncate",
|
|
279
|
-
title:
|
|
280
|
-
children: /* @__PURE__ */ J(
|
|
282
|
+
title: C.message,
|
|
283
|
+
children: /* @__PURE__ */ J(P, { failure: C })
|
|
281
284
|
}), /* @__PURE__ */ J("button", {
|
|
282
285
|
type: "button",
|
|
283
286
|
className: "underline",
|
|
@@ -312,7 +315,7 @@ function ge(e) {
|
|
|
312
315
|
if (n && r) return n / r;
|
|
313
316
|
}
|
|
314
317
|
function _e({ shape: e, initialsTitle: t }) {
|
|
315
|
-
let n =
|
|
318
|
+
let n = s();
|
|
316
319
|
return t ? /* @__PURE__ */ J("div", {
|
|
317
320
|
className: "flex h-full w-full items-center justify-center bg-surface-3 text-text-3",
|
|
318
321
|
children: /* @__PURE__ */ J("span", {
|
|
@@ -395,12 +398,12 @@ function xe(e) {
|
|
|
395
398
|
}
|
|
396
399
|
//#endregion
|
|
397
400
|
//#region src/components/file-widgets/GridLazy.tsx
|
|
398
|
-
var Se =
|
|
401
|
+
var Se = H(() => import("./Grid-Cg29k0jv.js").then((e) => ({ default: e.Grid })));
|
|
399
402
|
function Ce() {
|
|
400
403
|
return /* @__PURE__ */ J("div", { className: "h-24 w-full rounded-md bg-muted animate-pulse" });
|
|
401
404
|
}
|
|
402
405
|
function we(e) {
|
|
403
|
-
return /* @__PURE__ */ J(
|
|
406
|
+
return /* @__PURE__ */ J(V, {
|
|
404
407
|
fallback: /* @__PURE__ */ J(Ce, {}),
|
|
405
408
|
children: /* @__PURE__ */ J(Se, { ...e })
|
|
406
409
|
});
|
|
@@ -408,119 +411,119 @@ function we(e) {
|
|
|
408
411
|
//#endregion
|
|
409
412
|
//#region src/components/file-widgets/DocumentCard.tsx
|
|
410
413
|
function Te({ contentType: e }) {
|
|
411
|
-
let t =
|
|
414
|
+
let t = s(), n = e ? e.includes("pdf") ? "PDF" : e.includes("word") ? "DOC" : e.includes("sheet") || e.includes("excel") ? "XLS" : e.startsWith("image/") ? "IMG" : e.split("/")[1]?.slice(0, 4).toUpperCase() ?? t("file.document.type_other", "FILE") : t("file.document.type_other", "FILE");
|
|
412
415
|
return /* @__PURE__ */ J("div", {
|
|
413
416
|
className: "flex h-16 w-16 flex-none items-center justify-center rounded-md border border-border bg-surface-3 text-xs font-medium text-muted-foreground",
|
|
414
417
|
children: n
|
|
415
418
|
});
|
|
416
419
|
}
|
|
417
420
|
function Ee(e) {
|
|
418
|
-
let { field: t, fieldName:
|
|
419
|
-
|
|
421
|
+
let { field: t, fieldName: r, value: i, onChange: a, mode: o, disabled: c, uploadFieldCode: l, uploadSlotCode: u } = e, d = F(i), [f, p] = K("idle"), [h, g] = K(null), [v, b] = K(null), [S, C] = K(!1), [O, A] = K(d?.filename ?? ""), j = G(null), M = G(!1), N = G(null), { register: ee, unregister: L, isDraft: R } = x(), z = s(), B = s("errors"), { open: V } = te();
|
|
422
|
+
W(() => () => {
|
|
420
423
|
j.current && j.current.abort();
|
|
421
|
-
}, []),
|
|
422
|
-
A(
|
|
423
|
-
}, [
|
|
424
|
-
let
|
|
425
|
-
let
|
|
426
|
-
if (
|
|
427
|
-
|
|
424
|
+
}, []), W(() => {
|
|
425
|
+
A(d?.filename ?? "");
|
|
426
|
+
}, [d?.filename]);
|
|
427
|
+
let H = (t.accepts ?? []).join(","), re = U(async (n) => {
|
|
428
|
+
let i = T(n, t.accepts, t.max_size_bytes);
|
|
429
|
+
if (i) {
|
|
430
|
+
b(E(z, B, i)), p("error");
|
|
428
431
|
return;
|
|
429
432
|
}
|
|
430
|
-
|
|
433
|
+
b(null), M.current = !1, p("uploading"), g({
|
|
431
434
|
loaded: 0,
|
|
432
|
-
total:
|
|
435
|
+
total: n.size,
|
|
433
436
|
pct: 0
|
|
434
437
|
});
|
|
435
438
|
let o = new AbortController();
|
|
436
439
|
j.current = o;
|
|
437
440
|
try {
|
|
438
|
-
let
|
|
439
|
-
file:
|
|
441
|
+
let i = await m({
|
|
442
|
+
file: n,
|
|
440
443
|
entityCode: e.entityCode,
|
|
441
|
-
fieldCode:
|
|
442
|
-
slotCode:
|
|
444
|
+
fieldCode: l ?? r,
|
|
445
|
+
slotCode: u,
|
|
443
446
|
signal: o.signal,
|
|
444
|
-
onProgress:
|
|
447
|
+
onProgress: g
|
|
445
448
|
});
|
|
446
449
|
if (M.current) {
|
|
447
|
-
|
|
450
|
+
D(i.id).catch(() => {}), L(i.id);
|
|
448
451
|
return;
|
|
449
452
|
}
|
|
450
|
-
|
|
451
|
-
let
|
|
452
|
-
id:
|
|
453
|
-
filename:
|
|
454
|
-
content_type:
|
|
455
|
-
size_bytes:
|
|
456
|
-
sha256:
|
|
457
|
-
width:
|
|
458
|
-
height:
|
|
459
|
-
url:
|
|
460
|
-
metadata:
|
|
453
|
+
d && R(d.id) && (D(d.id).catch(() => {}), L(d.id)), ee(i.id, () => D(i.id)), p("idle"), g(null);
|
|
454
|
+
let s = {
|
|
455
|
+
id: i.id,
|
|
456
|
+
filename: i.filename,
|
|
457
|
+
content_type: i.content_type,
|
|
458
|
+
size_bytes: i.size_bytes,
|
|
459
|
+
sha256: i.sha256,
|
|
460
|
+
width: i.width,
|
|
461
|
+
height: i.height,
|
|
462
|
+
url: i.url,
|
|
463
|
+
metadata: i.metadata
|
|
461
464
|
};
|
|
462
|
-
|
|
465
|
+
a?.(t.mode === "array" ? [s] : s);
|
|
463
466
|
} catch (e) {
|
|
464
|
-
if (e instanceof
|
|
465
|
-
|
|
467
|
+
if (e instanceof w && e.code === "ABORTED") return;
|
|
468
|
+
b(_(z, B, e)), p("error"), g(null);
|
|
466
469
|
}
|
|
467
470
|
}, [
|
|
468
|
-
|
|
471
|
+
B,
|
|
469
472
|
z,
|
|
470
473
|
t.accepts,
|
|
471
474
|
t.max_size_bytes,
|
|
472
475
|
t.mode,
|
|
473
|
-
|
|
474
|
-
|
|
476
|
+
r,
|
|
477
|
+
d,
|
|
475
478
|
R,
|
|
476
|
-
|
|
479
|
+
a,
|
|
477
480
|
e.entityCode,
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
]), ie =
|
|
483
|
-
|
|
484
|
-
}, [
|
|
481
|
+
ee,
|
|
482
|
+
L,
|
|
483
|
+
l,
|
|
484
|
+
u
|
|
485
|
+
]), ie = U(() => {
|
|
486
|
+
c || N.current?.click();
|
|
487
|
+
}, [c]), X = U((e) => {
|
|
485
488
|
let t = e.target.files?.[0];
|
|
486
|
-
e.target.value = "", t &&
|
|
487
|
-
}, [
|
|
488
|
-
|
|
489
|
+
e.target.value = "", t && re(t);
|
|
490
|
+
}, [re]), Z = U(() => {
|
|
491
|
+
d && R(d.id) && (D(d.id).catch(() => {}), L(d.id)), a?.(t.mode === "array" ? [] : null);
|
|
489
492
|
}, [
|
|
490
|
-
|
|
493
|
+
d,
|
|
491
494
|
t.mode,
|
|
492
495
|
R,
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
]), ae =
|
|
496
|
-
|
|
497
|
-
}, [
|
|
498
|
-
|
|
499
|
-
}, [
|
|
500
|
-
|
|
501
|
-
}, [
|
|
502
|
-
if (!
|
|
503
|
-
|
|
496
|
+
a,
|
|
497
|
+
L
|
|
498
|
+
]), ae = U(() => {
|
|
499
|
+
f === "uploading" && j.current && (M.current = !0, j.current.abort(), j.current = null, p("idle"), g(null));
|
|
500
|
+
}, [f]), oe = U(() => {
|
|
501
|
+
d && V(d.id, "download", I(d));
|
|
502
|
+
}, [d, V]), se = d ? k(d) : !1, ce = U(() => {
|
|
503
|
+
d && k(d) && V(d.id, "preview", ne(d));
|
|
504
|
+
}, [d, V]), le = U(() => {
|
|
505
|
+
if (!d) {
|
|
506
|
+
C(!1);
|
|
504
507
|
return;
|
|
505
508
|
}
|
|
506
|
-
let e =
|
|
507
|
-
if (
|
|
508
|
-
A(
|
|
509
|
+
let e = O.trim();
|
|
510
|
+
if (C(!1), !e || e === d.filename) {
|
|
511
|
+
A(d.filename);
|
|
509
512
|
return;
|
|
510
513
|
}
|
|
511
514
|
let n = {
|
|
512
|
-
...
|
|
515
|
+
...d,
|
|
513
516
|
filename: e
|
|
514
517
|
};
|
|
515
|
-
|
|
518
|
+
a?.(t.mode === "array" ? [n] : n);
|
|
516
519
|
}, [
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
+
O,
|
|
521
|
+
d,
|
|
522
|
+
a,
|
|
520
523
|
t.mode
|
|
521
|
-
]), Q =
|
|
522
|
-
return !
|
|
523
|
-
"data-testid": `file-widget-${
|
|
524
|
+
]), Q = o === "display";
|
|
525
|
+
return !d && f !== "uploading" ? /* @__PURE__ */ Y("div", {
|
|
526
|
+
"data-testid": `file-widget-${r}`,
|
|
524
527
|
className: "flex items-center gap-3 rounded-md border border-dashed border-border bg-surface p-3",
|
|
525
528
|
children: [
|
|
526
529
|
/* @__PURE__ */ J(Te, {}),
|
|
@@ -533,90 +536,90 @@ function Ee(e) {
|
|
|
533
536
|
type: "button",
|
|
534
537
|
className: "self-start rounded-sm border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-surface-2",
|
|
535
538
|
onClick: ie,
|
|
536
|
-
disabled:
|
|
539
|
+
disabled: c,
|
|
537
540
|
"data-testid": "upload",
|
|
538
541
|
children: z("file.document.upload", "Upload")
|
|
539
542
|
})]
|
|
540
543
|
}),
|
|
541
544
|
!Q && /* @__PURE__ */ J("input", {
|
|
542
|
-
ref:
|
|
545
|
+
ref: N,
|
|
543
546
|
type: "file",
|
|
544
|
-
accept:
|
|
547
|
+
accept: H || void 0,
|
|
545
548
|
onChange: X,
|
|
546
549
|
style: { display: "none" },
|
|
547
|
-
"data-testid": `file-input-${
|
|
550
|
+
"data-testid": `file-input-${r}`
|
|
548
551
|
}),
|
|
549
|
-
|
|
552
|
+
f === "error" && v && /* @__PURE__ */ J("div", {
|
|
550
553
|
className: "ml-auto text-xs text-destructive",
|
|
551
554
|
role: "alert",
|
|
552
|
-
children: /* @__PURE__ */ J(
|
|
555
|
+
children: /* @__PURE__ */ J(P, { failure: v })
|
|
553
556
|
})
|
|
554
557
|
]
|
|
555
558
|
}) : /* @__PURE__ */ Y("div", {
|
|
556
|
-
"data-testid": `file-widget-${
|
|
559
|
+
"data-testid": `file-widget-${r}`,
|
|
557
560
|
className: "flex items-center gap-3 rounded-md border border-border bg-surface p-3",
|
|
558
|
-
"aria-busy":
|
|
559
|
-
"aria-invalid":
|
|
561
|
+
"aria-busy": f === "uploading" || void 0,
|
|
562
|
+
"aria-invalid": f === "error" || void 0,
|
|
560
563
|
children: [
|
|
561
|
-
/* @__PURE__ */ J(Te, { contentType:
|
|
564
|
+
/* @__PURE__ */ J(Te, { contentType: d?.content_type }),
|
|
562
565
|
/* @__PURE__ */ Y("div", {
|
|
563
566
|
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
564
567
|
children: [
|
|
565
|
-
|
|
568
|
+
S && d ? /* @__PURE__ */ J("input", {
|
|
566
569
|
type: "text",
|
|
567
570
|
className: "rounded-sm border border-border bg-card px-1 py-0.5 text-sm text-foreground",
|
|
568
|
-
value:
|
|
571
|
+
value: O,
|
|
569
572
|
autoFocus: !0,
|
|
570
573
|
onChange: (e) => A(e.target.value),
|
|
571
574
|
onBlur: le,
|
|
572
575
|
onKeyDown: (e) => {
|
|
573
|
-
e.key === "Enter" ? le() : e.key === "Escape" && (
|
|
576
|
+
e.key === "Enter" ? le() : e.key === "Escape" && (C(!1), A(d.filename));
|
|
574
577
|
},
|
|
575
578
|
"data-testid": "filename-input"
|
|
576
579
|
}) : /* @__PURE__ */ J("button", {
|
|
577
580
|
type: "button",
|
|
578
581
|
className: "truncate text-left text-sm font-medium text-foreground hover:underline",
|
|
579
|
-
onClick: () => !Q &&
|
|
580
|
-
disabled: Q ||
|
|
581
|
-
title:
|
|
582
|
+
onClick: () => !Q && d && C(!0),
|
|
583
|
+
disabled: Q || c || !d,
|
|
584
|
+
title: d?.filename,
|
|
582
585
|
"data-testid": "filename",
|
|
583
|
-
children:
|
|
586
|
+
children: d?.filename ?? z("file.document.uploading", "Uploading…")
|
|
584
587
|
}),
|
|
585
588
|
/* @__PURE__ */ Y("div", {
|
|
586
589
|
className: "flex flex-wrap gap-2 text-xs text-muted-foreground",
|
|
587
590
|
children: [
|
|
588
|
-
|
|
589
|
-
|
|
591
|
+
d && /* @__PURE__ */ J("span", { children: y(d.size_bytes) }),
|
|
592
|
+
d?.page_count != null && /* @__PURE__ */ J("span", { children: n(z, "file.document.pages", d.page_count, {
|
|
590
593
|
one: "{count} page",
|
|
591
594
|
other: "{count} pages"
|
|
592
595
|
}) }),
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
+
d?.uploaded_at && /* @__PURE__ */ J("span", { children: De(d.uploaded_at) }),
|
|
597
|
+
d?.uploaded_by && /* @__PURE__ */ J("span", { children: z("file.document.uploaded_by", "by {user}", { user: d.uploaded_by }) }),
|
|
598
|
+
d?.version?.number != null && /* @__PURE__ */ J("span", {
|
|
596
599
|
"data-testid": "version-badge",
|
|
597
|
-
children: z("file.document.version", "v{number}", { number:
|
|
600
|
+
children: z("file.document.version", "v{number}", { number: d.version.number })
|
|
598
601
|
})
|
|
599
602
|
]
|
|
600
603
|
}),
|
|
601
|
-
|
|
604
|
+
f === "uploading" && /* @__PURE__ */ J("div", {
|
|
602
605
|
className: "text-xs text-muted-foreground",
|
|
603
606
|
role: "progressbar",
|
|
604
|
-
"aria-valuenow":
|
|
607
|
+
"aria-valuenow": h?.pct ?? 0,
|
|
605
608
|
"aria-valuemin": 0,
|
|
606
609
|
"aria-valuemax": 100,
|
|
607
610
|
"data-testid": "upload-progress",
|
|
608
|
-
children: z("file.upload.progress", "Uploading {pct}%", { pct:
|
|
611
|
+
children: z("file.upload.progress", "Uploading {pct}%", { pct: h?.pct ?? 0 })
|
|
609
612
|
}),
|
|
610
|
-
|
|
613
|
+
f === "error" && v && /* @__PURE__ */ J("div", {
|
|
611
614
|
className: "text-xs text-destructive",
|
|
612
615
|
role: "alert",
|
|
613
|
-
children: /* @__PURE__ */ J(
|
|
616
|
+
children: /* @__PURE__ */ J(P, { failure: v })
|
|
614
617
|
})
|
|
615
618
|
]
|
|
616
619
|
}),
|
|
617
620
|
/* @__PURE__ */ Y("div", {
|
|
618
621
|
className: "flex flex-none items-center gap-1",
|
|
619
|
-
children: [
|
|
622
|
+
children: [d && f !== "uploading" && /* @__PURE__ */ Y(q, { children: [
|
|
620
623
|
/* @__PURE__ */ J("button", {
|
|
621
624
|
type: "button",
|
|
622
625
|
className: "rounded-sm border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-surface-2",
|
|
@@ -637,18 +640,18 @@ function Ee(e) {
|
|
|
637
640
|
type: "button",
|
|
638
641
|
className: "rounded-sm border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-surface-2",
|
|
639
642
|
onClick: ie,
|
|
640
|
-
disabled:
|
|
643
|
+
disabled: c,
|
|
641
644
|
"data-testid": "replace",
|
|
642
645
|
children: z("file.document.replace", "Replace")
|
|
643
646
|
}), /* @__PURE__ */ J("button", {
|
|
644
647
|
type: "button",
|
|
645
648
|
className: "rounded-sm border border-border bg-card px-2 py-1 text-xs text-destructive hover:bg-surface-2",
|
|
646
649
|
onClick: Z,
|
|
647
|
-
disabled:
|
|
650
|
+
disabled: c,
|
|
648
651
|
"data-testid": "remove",
|
|
649
652
|
children: z("file.remove", "Remove")
|
|
650
653
|
})] })
|
|
651
|
-
] }),
|
|
654
|
+
] }), f === "uploading" && /* @__PURE__ */ J("button", {
|
|
652
655
|
type: "button",
|
|
653
656
|
className: "rounded-sm border border-border bg-card px-2 py-1 text-xs",
|
|
654
657
|
onClick: ae,
|
|
@@ -657,12 +660,12 @@ function Ee(e) {
|
|
|
657
660
|
})]
|
|
658
661
|
}),
|
|
659
662
|
!Q && /* @__PURE__ */ J("input", {
|
|
660
|
-
ref:
|
|
663
|
+
ref: N,
|
|
661
664
|
type: "file",
|
|
662
|
-
accept:
|
|
665
|
+
accept: H || void 0,
|
|
663
666
|
onChange: X,
|
|
664
667
|
style: { display: "none" },
|
|
665
|
-
"data-testid": `file-input-${
|
|
668
|
+
"data-testid": `file-input-${r}`
|
|
666
669
|
})
|
|
667
670
|
]
|
|
668
671
|
});
|
|
@@ -677,104 +680,103 @@ function Oe(e) {
|
|
|
677
680
|
return e ? (e.split("/")[1] ?? e).toUpperCase().slice(0, 6) : "";
|
|
678
681
|
}
|
|
679
682
|
function ke(e) {
|
|
680
|
-
let { field: t, fieldName: n, value: r, onChange: i, mode: a, disabled: o } = e,
|
|
681
|
-
|
|
682
|
-
let
|
|
683
|
-
|
|
684
|
-
let { open: O } =
|
|
685
|
-
|
|
686
|
-
|
|
683
|
+
let { field: t, fieldName: n, value: r, onChange: i, mode: a, disabled: o } = e, c = z(r), [l, u] = K([]), { register: d, unregister: f, isDraft: p } = x(), h = s(), g = s("errors"), v = G(c);
|
|
684
|
+
v.current = c;
|
|
685
|
+
let b = G(null), S = G(/* @__PURE__ */ new Set()), C = G([]);
|
|
686
|
+
C.current = l;
|
|
687
|
+
let { open: O } = te();
|
|
688
|
+
W(() => () => {
|
|
689
|
+
C.current.forEach((e) => e.abort());
|
|
687
690
|
}, []);
|
|
688
|
-
let k = (t.accepts ?? []).join(","), A = a === "display", j =
|
|
689
|
-
let a =
|
|
690
|
-
if (a) {
|
|
691
|
-
l((e) => [...e, {
|
|
692
|
-
localId: o,
|
|
693
|
-
filename: r.name,
|
|
694
|
-
progress: null,
|
|
695
|
-
error: f(y, b, a),
|
|
696
|
-
abort: () => {}
|
|
697
|
-
}]);
|
|
698
|
-
return;
|
|
699
|
-
}
|
|
700
|
-
l((e) => [...e, {
|
|
691
|
+
let k = (t.accepts ?? []).join(","), A = a === "display", j = U(async (r) => {
|
|
692
|
+
let a = T(r, t.accepts, t.max_size_bytes), o = `row-${Math.random().toString(36).slice(2)}-${Date.now()}`, s = new AbortController();
|
|
693
|
+
if (a) u((e) => [...e, {
|
|
701
694
|
localId: o,
|
|
702
695
|
filename: r.name,
|
|
703
|
-
progress:
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
pct: 0
|
|
707
|
-
},
|
|
708
|
-
error: null,
|
|
709
|
-
abort: () => s.abort()
|
|
696
|
+
progress: null,
|
|
697
|
+
error: E(h, g, a),
|
|
698
|
+
abort: () => {}
|
|
710
699
|
}]);
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
700
|
+
else {
|
|
701
|
+
u((e) => [...e, {
|
|
702
|
+
localId: o,
|
|
703
|
+
filename: r.name,
|
|
704
|
+
progress: {
|
|
705
|
+
loaded: 0,
|
|
706
|
+
total: r.size,
|
|
707
|
+
pct: 0
|
|
708
|
+
},
|
|
709
|
+
error: null,
|
|
710
|
+
abort: () => s.abort()
|
|
711
|
+
}]);
|
|
712
|
+
try {
|
|
713
|
+
let t = await m({
|
|
714
|
+
file: r,
|
|
715
|
+
entityCode: e.entityCode,
|
|
716
|
+
fieldCode: n,
|
|
717
|
+
signal: s.signal,
|
|
718
|
+
onProgress: (e) => u((t) => t.map((t) => t.localId === o ? {
|
|
719
|
+
...t,
|
|
720
|
+
progress: e
|
|
721
|
+
} : t))
|
|
722
|
+
});
|
|
723
|
+
if (S.current.delete(o)) {
|
|
724
|
+
D(t.id).catch(() => {}), f(t.id);
|
|
725
|
+
return;
|
|
726
|
+
}
|
|
727
|
+
d(t.id, () => D(t.id));
|
|
728
|
+
let a = {
|
|
729
|
+
id: t.id,
|
|
730
|
+
filename: t.filename,
|
|
731
|
+
content_type: t.content_type,
|
|
732
|
+
size_bytes: t.size_bytes,
|
|
733
|
+
sha256: t.sha256,
|
|
734
|
+
width: t.width,
|
|
735
|
+
height: t.height,
|
|
736
|
+
url: t.url,
|
|
737
|
+
metadata: t.metadata
|
|
738
|
+
}, c = [...v.current, a];
|
|
739
|
+
v.current = c, i?.(c), u((e) => e.filter((e) => e.localId !== o));
|
|
740
|
+
} catch (e) {
|
|
741
|
+
if (e instanceof w && e.code === "ABORTED") {
|
|
742
|
+
u((e) => e.filter((e) => e.localId !== o));
|
|
743
|
+
return;
|
|
744
|
+
}
|
|
745
|
+
let t = _(h, g, e);
|
|
746
|
+
u((e) => e.map((e) => e.localId === o ? {
|
|
747
|
+
...e,
|
|
748
|
+
error: t,
|
|
749
|
+
progress: null,
|
|
750
|
+
abort: () => {}
|
|
751
|
+
} : e));
|
|
743
752
|
}
|
|
744
|
-
let t = v(y, b, e);
|
|
745
|
-
l((e) => e.map((e) => e.localId === o ? {
|
|
746
|
-
...e,
|
|
747
|
-
error: t,
|
|
748
|
-
progress: null,
|
|
749
|
-
abort: () => {}
|
|
750
|
-
} : e));
|
|
751
753
|
}
|
|
752
754
|
}, [
|
|
753
|
-
|
|
754
|
-
|
|
755
|
+
g,
|
|
756
|
+
h,
|
|
755
757
|
t.accepts,
|
|
756
758
|
t.max_size_bytes,
|
|
757
759
|
n,
|
|
758
760
|
i,
|
|
759
761
|
e.entityCode,
|
|
760
762
|
d,
|
|
761
|
-
|
|
762
|
-
]), M =
|
|
763
|
+
f
|
|
764
|
+
]), M = U((e) => {
|
|
763
765
|
Array.from(e).forEach((e) => void j(e));
|
|
764
|
-
}, [j]),
|
|
765
|
-
o ||
|
|
766
|
-
}, [o]),
|
|
766
|
+
}, [j]), N = U(() => {
|
|
767
|
+
o || b.current?.click();
|
|
768
|
+
}, [o]), ee = U((e) => {
|
|
767
769
|
let t = e.target.files;
|
|
768
770
|
e.target.value = "", t && t.length > 0 && M(t);
|
|
769
|
-
}, [M]),
|
|
770
|
-
|
|
771
|
+
}, [M]), F = U((e) => {
|
|
772
|
+
p(e) && (D(e).catch(() => {}), f(e)), i?.(c.filter((t) => t.id !== e));
|
|
771
773
|
}, [
|
|
772
|
-
|
|
773
|
-
|
|
774
|
+
p,
|
|
775
|
+
c,
|
|
774
776
|
i,
|
|
775
|
-
|
|
776
|
-
]),
|
|
777
|
-
O(e.id, "download",
|
|
777
|
+
f
|
|
778
|
+
]), L = U((e) => {
|
|
779
|
+
O(e.id, "download", I(e));
|
|
778
780
|
}, [O]);
|
|
779
781
|
return /* @__PURE__ */ Y("div", {
|
|
780
782
|
"data-testid": `file-widget-${n}`,
|
|
@@ -782,11 +784,11 @@ function ke(e) {
|
|
|
782
784
|
children: [/* @__PURE__ */ Y("ul", {
|
|
783
785
|
className: "flex flex-col divide-y divide-divider rounded-md border border-border bg-surface",
|
|
784
786
|
children: [
|
|
785
|
-
|
|
787
|
+
c.length === 0 && l.length === 0 && /* @__PURE__ */ J("li", {
|
|
786
788
|
className: "px-3 py-4 text-center text-sm text-muted-foreground",
|
|
787
|
-
children:
|
|
789
|
+
children: h(t.display?.placeholder) || h("file.list.empty", "No files")
|
|
788
790
|
}),
|
|
789
|
-
|
|
791
|
+
c.map((e) => /* @__PURE__ */ Y("li", {
|
|
790
792
|
className: "flex items-center gap-3 px-3 py-2",
|
|
791
793
|
"data-testid": `row-${e.id}`,
|
|
792
794
|
children: [
|
|
@@ -796,33 +798,33 @@ function ke(e) {
|
|
|
796
798
|
}),
|
|
797
799
|
/* @__PURE__ */ J("button", {
|
|
798
800
|
type: "button",
|
|
799
|
-
onClick: () =>
|
|
801
|
+
onClick: () => L(e),
|
|
800
802
|
className: "min-w-0 flex-1 truncate text-left text-sm text-foreground hover:underline",
|
|
801
803
|
title: e.filename,
|
|
802
804
|
children: e.filename
|
|
803
805
|
}),
|
|
804
806
|
/* @__PURE__ */ J("span", {
|
|
805
807
|
className: "flex-none text-xs text-muted-foreground",
|
|
806
|
-
children:
|
|
808
|
+
children: y(e.size_bytes)
|
|
807
809
|
}),
|
|
808
810
|
/* @__PURE__ */ J("button", {
|
|
809
811
|
type: "button",
|
|
810
812
|
className: "flex-none rounded-sm border border-border bg-card px-2 py-0.5 text-xs text-foreground hover:bg-surface-2",
|
|
811
|
-
onClick: () =>
|
|
813
|
+
onClick: () => L(e),
|
|
812
814
|
"data-testid": `download-${e.id}`,
|
|
813
|
-
children:
|
|
815
|
+
children: h("file.download", "Download")
|
|
814
816
|
}),
|
|
815
817
|
!A && /* @__PURE__ */ J("button", {
|
|
816
818
|
type: "button",
|
|
817
819
|
className: "flex-none rounded-sm border border-border bg-card px-2 py-0.5 text-xs text-destructive hover:bg-surface-2",
|
|
818
|
-
onClick: () =>
|
|
820
|
+
onClick: () => F(e.id),
|
|
819
821
|
disabled: o,
|
|
820
822
|
"data-testid": `remove-${e.id}`,
|
|
821
|
-
children:
|
|
823
|
+
children: h("file.remove", "Remove")
|
|
822
824
|
})
|
|
823
825
|
]
|
|
824
826
|
}, e.id)),
|
|
825
|
-
|
|
827
|
+
l.map((e) => /* @__PURE__ */ Y("li", {
|
|
826
828
|
className: "flex items-center gap-3 px-3 py-2",
|
|
827
829
|
"data-testid": `pending-row-${e.localId}`,
|
|
828
830
|
"aria-busy": !e.error,
|
|
@@ -837,7 +839,7 @@ function ke(e) {
|
|
|
837
839
|
e.error ? /* @__PURE__ */ J("span", {
|
|
838
840
|
role: "alert",
|
|
839
841
|
className: "text-xs text-destructive",
|
|
840
|
-
children: /* @__PURE__ */ J(
|
|
842
|
+
children: /* @__PURE__ */ J(P, { failure: e.error })
|
|
841
843
|
}) : /* @__PURE__ */ Y("span", {
|
|
842
844
|
className: "text-xs text-muted-foreground",
|
|
843
845
|
role: "progressbar",
|
|
@@ -850,9 +852,9 @@ function ke(e) {
|
|
|
850
852
|
type: "button",
|
|
851
853
|
className: "flex-none rounded-sm border border-border bg-card px-2 py-0.5 text-xs",
|
|
852
854
|
onClick: () => {
|
|
853
|
-
e.abort(),
|
|
855
|
+
e.abort(), S.current.add(e.localId), u((t) => t.filter((t) => t.localId !== e.localId));
|
|
854
856
|
},
|
|
855
|
-
children: e.error ?
|
|
857
|
+
children: e.error ? h("file.upload.dismiss", "Dismiss") : h("file.upload.cancel", "Cancel")
|
|
856
858
|
})
|
|
857
859
|
]
|
|
858
860
|
}, e.localId))
|
|
@@ -860,16 +862,16 @@ function ke(e) {
|
|
|
860
862
|
}), !A && /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J("button", {
|
|
861
863
|
type: "button",
|
|
862
864
|
className: "self-start rounded-sm border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-surface-2",
|
|
863
|
-
onClick:
|
|
865
|
+
onClick: N,
|
|
864
866
|
disabled: o,
|
|
865
867
|
"data-testid": "add-files",
|
|
866
|
-
children:
|
|
868
|
+
children: h("file.list.add", "Add files")
|
|
867
869
|
}), /* @__PURE__ */ J("input", {
|
|
868
|
-
ref:
|
|
870
|
+
ref: b,
|
|
869
871
|
type: "file",
|
|
870
872
|
accept: k || void 0,
|
|
871
873
|
multiple: !0,
|
|
872
|
-
onChange:
|
|
874
|
+
onChange: ee,
|
|
873
875
|
style: { display: "none" },
|
|
874
876
|
"data-testid": `file-input-${n}`
|
|
875
877
|
})] })]
|
|
@@ -878,7 +880,7 @@ function ke(e) {
|
|
|
878
880
|
//#endregion
|
|
879
881
|
//#region src/components/file-widgets/UnknownFileWidget.tsx
|
|
880
882
|
function Ae({ widgetCode: e }) {
|
|
881
|
-
let t =
|
|
883
|
+
let t = s(), n = s("errors");
|
|
882
884
|
return e ? /* @__PURE__ */ Y("span", {
|
|
883
885
|
className: "text-sm text-muted-foreground",
|
|
884
886
|
children: [
|
|
@@ -918,32 +920,32 @@ function Ne(e, t, n, r) {
|
|
|
918
920
|
};
|
|
919
921
|
}
|
|
920
922
|
function Pe(e) {
|
|
921
|
-
let { field: t, fieldName: n, entityCode: r, value: i, recordTitle: a, onChange: o, mode:
|
|
922
|
-
return
|
|
923
|
+
let { field: t, fieldName: n, entityCode: r, value: i, recordTitle: a, onChange: o, mode: c, disabled: l } = e, u = Object.entries(t.slots ?? {}), d = je(i), f = s();
|
|
924
|
+
return u.length === 0 ? /* @__PURE__ */ J("span", {
|
|
923
925
|
className: "text-sm text-muted-foreground",
|
|
924
|
-
children:
|
|
926
|
+
children: f("file.slots.empty", "No slots configured")
|
|
925
927
|
}) : /* @__PURE__ */ J("div", {
|
|
926
928
|
className: "grid gap-3",
|
|
927
|
-
children:
|
|
928
|
-
let
|
|
929
|
+
children: u.map(([e, i]) => {
|
|
930
|
+
let s = d[e] ?? null, u = Ne(t, e, i, s), p = u.display?.widget ?? "document_card", m = ae(p);
|
|
929
931
|
return m ? /* @__PURE__ */ Y("div", {
|
|
930
932
|
className: "grid gap-1.5",
|
|
931
933
|
children: [/* @__PURE__ */ J("div", {
|
|
932
934
|
className: "text-xs font-semibold text-text-2",
|
|
933
|
-
children:
|
|
935
|
+
children: f(i.name)
|
|
934
936
|
}), /* @__PURE__ */ J(m, {
|
|
935
|
-
field:
|
|
937
|
+
field: u,
|
|
936
938
|
fieldName: e,
|
|
937
939
|
entityCode: r,
|
|
938
|
-
value:
|
|
940
|
+
value: s,
|
|
939
941
|
recordTitle: a,
|
|
940
|
-
mode:
|
|
941
|
-
disabled:
|
|
942
|
+
mode: c,
|
|
943
|
+
disabled: l,
|
|
942
944
|
uploadFieldCode: n,
|
|
943
945
|
uploadSlotCode: e,
|
|
944
946
|
onChange: (t) => {
|
|
945
947
|
o && o({
|
|
946
|
-
...
|
|
948
|
+
...d,
|
|
947
949
|
[e]: t ?? null
|
|
948
950
|
});
|
|
949
951
|
}
|
|
@@ -952,7 +954,7 @@ function Pe(e) {
|
|
|
952
954
|
className: "grid gap-1.5",
|
|
953
955
|
children: [/* @__PURE__ */ J("div", {
|
|
954
956
|
className: "text-xs font-semibold text-text-2",
|
|
955
|
-
children:
|
|
957
|
+
children: f(i.name)
|
|
956
958
|
}), /* @__PURE__ */ J(Ae, { widgetCode: p })]
|
|
957
959
|
}, e);
|
|
958
960
|
})
|
|
@@ -976,19 +978,23 @@ function Re(e, t) {
|
|
|
976
978
|
function ze(e, t, n) {
|
|
977
979
|
if (Le(e, n)) return Re(t, n);
|
|
978
980
|
let r = e.fields.get(n);
|
|
979
|
-
return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ?
|
|
981
|
+
return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ? v(t[n], Re(t, n)) : t[n];
|
|
980
982
|
}
|
|
981
983
|
function Be(e, t, n) {
|
|
984
|
+
let r = ze(e, t, n);
|
|
985
|
+
return r == null || r === "" ? !1 : Array.isArray(r) ? r.length > 0 : typeof r != "object" || Object.keys(r).length > 0;
|
|
986
|
+
}
|
|
987
|
+
function Ve(e, t, n) {
|
|
982
988
|
let r = e.fields.get(t);
|
|
983
|
-
return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ?
|
|
989
|
+
return r?.type === "rich_text" && r.files?.mode === "rich_text_inline" ? h(n) : n;
|
|
984
990
|
}
|
|
985
|
-
function
|
|
986
|
-
let
|
|
987
|
-
if (
|
|
991
|
+
function He(e, t, n, r) {
|
|
992
|
+
let i = Le(t, n);
|
|
993
|
+
if (i) return i.name || n;
|
|
988
994
|
let o = t.fields.get(n);
|
|
989
|
-
return o ?
|
|
995
|
+
return o ? a(e, o, n, r) : n;
|
|
990
996
|
}
|
|
991
|
-
function
|
|
997
|
+
function Ue(e) {
|
|
992
998
|
let { entity: t, entityCode: n, fieldName: r, record: i, mode: a, onChange: s, refs: c, disabled: l, surface: u, entities: d, screens: f, t: p, fieldId: m, labelId: h, structure: g, detailScreen: _ } = e, v = Le(t, r);
|
|
993
999
|
if (v) {
|
|
994
1000
|
let e = v.display?.widget ?? "", c = ae(e);
|
|
@@ -1028,70 +1034,63 @@ function He(e) {
|
|
|
1028
1034
|
}) : null;
|
|
1029
1035
|
}
|
|
1030
1036
|
//#endregion
|
|
1037
|
+
//#region src/lib/action-dispatch.ts
|
|
1038
|
+
function We(e, t, n, r, i) {
|
|
1039
|
+
return S(n) ? (C(e, n.ui_steps, r), null) : n.entity ? `${n.entity}.${t}` : i ? `${i}.${t}` : t;
|
|
1040
|
+
}
|
|
1041
|
+
//#endregion
|
|
1031
1042
|
//#region src/components/actions/ResponsiveActionBar.tsx
|
|
1032
|
-
function
|
|
1043
|
+
function Ge(e, t) {
|
|
1033
1044
|
return e.replace(/\$\{([^}]+)\}/g, (e, n) => Object.prototype.hasOwnProperty.call(t, n) ? t[n] : e);
|
|
1034
1045
|
}
|
|
1035
|
-
function
|
|
1046
|
+
function Ke(e) {
|
|
1036
1047
|
return e.widget ? "widget" : e.href ? "href" : e.handler ? "handler" : e.association ? "association" : e.ui_steps && e.ui_steps.length > 0 ? "ui_steps" : "unknown";
|
|
1037
1048
|
}
|
|
1038
|
-
function
|
|
1039
|
-
let
|
|
1040
|
-
if (e === "__peek") return
|
|
1049
|
+
function qe(e, t, n, i, a) {
|
|
1050
|
+
let o = Ke(t), s = r(n, i?.entity), c = i?.entityCode ?? "";
|
|
1051
|
+
if (e === "__peek") return a?.({
|
|
1041
1052
|
code: e,
|
|
1042
|
-
entity:
|
|
1053
|
+
entity: c,
|
|
1043
1054
|
mode: "peek",
|
|
1044
|
-
rowId:
|
|
1045
|
-
}),
|
|
1046
|
-
if (
|
|
1055
|
+
rowId: s
|
|
1056
|
+
}), i?.openPeek?.(n), !0;
|
|
1057
|
+
if (a?.({
|
|
1047
1058
|
code: e,
|
|
1048
|
-
entity:
|
|
1049
|
-
mode:
|
|
1050
|
-
rowId:
|
|
1051
|
-
}),
|
|
1052
|
-
if (
|
|
1053
|
-
let e =
|
|
1054
|
-
entity:
|
|
1055
|
-
id: encodeURIComponent(
|
|
1056
|
-
}),
|
|
1057
|
-
return
|
|
1059
|
+
entity: c,
|
|
1060
|
+
mode: o,
|
|
1061
|
+
rowId: s
|
|
1062
|
+
}), o === "widget") return console.warn(`[ResponsiveActionBar] widget "${t.widget}" requested for action "${e}" but the SDK has no widget registry yet; falling back to onRun.`), !1;
|
|
1063
|
+
if (o === "href" && i) {
|
|
1064
|
+
let n = e === "__open" || e === "__edit" ? i.recordHref?.(s) : null, r = n ? e === "__edit" ? `${n}?edit=true` : n : Ge(t.href ?? "", {
|
|
1065
|
+
entity: c,
|
|
1066
|
+
id: encodeURIComponent(s)
|
|
1067
|
+
}), a = r.indexOf("?");
|
|
1068
|
+
return a === -1 ? i.tabNavigate(r) : i.tabNavigate(r.slice(0, a), { search: r.slice(a + 1) }), !0;
|
|
1058
1069
|
}
|
|
1059
|
-
return
|
|
1070
|
+
return o === "handler" || o === "association" || o === "ui_steps" || o === "unknown" && console.warn(`[ResponsiveActionBar] no dispatch mode set on action "${e}" (none of handler/association/widget/href/ui_steps).`), !1;
|
|
1060
1071
|
}
|
|
1061
|
-
function
|
|
1072
|
+
function Je(e) {
|
|
1062
1073
|
let t = 0;
|
|
1063
|
-
for (let n of e) n.kind === "action" ? t++ : t +=
|
|
1074
|
+
for (let n of e) n.kind === "action" ? t++ : t += Je(n.items);
|
|
1064
1075
|
return t;
|
|
1065
1076
|
}
|
|
1066
|
-
function
|
|
1077
|
+
function Ye(e, t, n) {
|
|
1067
1078
|
let r = [], i = [];
|
|
1068
|
-
for (let a of e) a.kind === "action" &&
|
|
1079
|
+
for (let a of e) a.kind === "action" && Ze(a.code, t, n)?.destructive ? i.push(a) : r.push(a);
|
|
1069
1080
|
return {
|
|
1070
1081
|
normal: r,
|
|
1071
1082
|
destructive: i
|
|
1072
1083
|
};
|
|
1073
1084
|
}
|
|
1074
|
-
function
|
|
1085
|
+
function Xe(e, t, n) {
|
|
1075
1086
|
let r = [], i = [], a = [];
|
|
1076
1087
|
for (let o of e) {
|
|
1077
1088
|
if (o.kind !== "action") {
|
|
1078
1089
|
i.push(o);
|
|
1079
1090
|
continue;
|
|
1080
1091
|
}
|
|
1081
|
-
let e =
|
|
1082
|
-
|
|
1083
|
-
console.warn(`[ResponsiveActionBar] action "${o.code}" declares both primary and destructive; treating as destructive.`), a.push(o);
|
|
1084
|
-
continue;
|
|
1085
|
-
}
|
|
1086
|
-
if (s) {
|
|
1087
|
-
a.push(o);
|
|
1088
|
-
continue;
|
|
1089
|
-
}
|
|
1090
|
-
if (c) {
|
|
1091
|
-
r.push(o);
|
|
1092
|
-
continue;
|
|
1093
|
-
}
|
|
1094
|
-
i.push(o);
|
|
1092
|
+
let e = Ze(o.code, t, n), s = e?.destructive === !0, c = e?.display?.primary === !0;
|
|
1093
|
+
s && c ? (console.warn(`[ResponsiveActionBar] action "${o.code}" declares both primary and destructive; treating as destructive.`), a.push(o)) : s ? a.push(o) : c ? r.push(o) : i.push(o);
|
|
1095
1094
|
}
|
|
1096
1095
|
return {
|
|
1097
1096
|
primary: r,
|
|
@@ -1099,40 +1098,40 @@ function Je(e, t, n) {
|
|
|
1099
1098
|
destructive: a
|
|
1100
1099
|
};
|
|
1101
1100
|
}
|
|
1102
|
-
function
|
|
1101
|
+
function Ze(e, t, n) {
|
|
1103
1102
|
if (t && e in t) return t[e];
|
|
1104
1103
|
if (n && e in n) return n[e];
|
|
1105
1104
|
}
|
|
1106
|
-
function
|
|
1107
|
-
return e(
|
|
1105
|
+
function Qe(e, t, n, r) {
|
|
1106
|
+
return e(Ze(t, n, r)?.display?.name) || t;
|
|
1108
1107
|
}
|
|
1109
|
-
function
|
|
1110
|
-
return
|
|
1108
|
+
function $e(e, t, n) {
|
|
1109
|
+
return Ze(e, t, n)?.display?.icon || void 0;
|
|
1111
1110
|
}
|
|
1112
|
-
function
|
|
1111
|
+
function et(e) {
|
|
1113
1112
|
return `action-tooltip-${e}`;
|
|
1114
1113
|
}
|
|
1115
|
-
function
|
|
1116
|
-
let
|
|
1117
|
-
if (!(!_ || S ||
|
|
1118
|
-
|
|
1114
|
+
function tt({ leaf: e, entityActions: t, globalActions: n, onRun: r, loading: a, onLoadingChange: o, measureRef: c, style: l, row: u, widgetContext: f, onActionClick: p, iconOnly: m = !1 }) {
|
|
1115
|
+
let h = s(), _ = Ze(e.code, t, n), v = Qe(h, e.code, t, n), y = $e(e.code, t, n), b = _?.destructive ?? !1, x = !b && _?.display?.primary === !0, S = !e.enabled, C = S ? et(e.code) : void 0, w = U(async () => {
|
|
1116
|
+
if (!(!_ || S || a)) {
|
|
1117
|
+
o(!0);
|
|
1119
1118
|
try {
|
|
1120
|
-
|
|
1119
|
+
qe(e.code, _, u, f, p) || await Promise.resolve(r(e.code, _));
|
|
1121
1120
|
} finally {
|
|
1122
|
-
|
|
1121
|
+
o(!1);
|
|
1123
1122
|
}
|
|
1124
1123
|
}
|
|
1125
1124
|
}, [
|
|
1126
1125
|
_,
|
|
1127
1126
|
S,
|
|
1128
|
-
o,
|
|
1129
1127
|
a,
|
|
1128
|
+
r,
|
|
1130
1129
|
e.code,
|
|
1131
|
-
|
|
1130
|
+
o,
|
|
1131
|
+
u,
|
|
1132
1132
|
f,
|
|
1133
|
-
p
|
|
1134
|
-
|
|
1135
|
-
]), T = o ? /* @__PURE__ */ J(d, { size: 12 }) : y ? /* @__PURE__ */ J(t, {
|
|
1133
|
+
p
|
|
1134
|
+
]), T = a ? /* @__PURE__ */ J(g, { size: 12 }) : y ? /* @__PURE__ */ J(O, {
|
|
1136
1135
|
name: y,
|
|
1137
1136
|
size: 12
|
|
1138
1137
|
}) : null;
|
|
@@ -1147,40 +1146,40 @@ function $e({ leaf: e, entityActions: n, globalActions: r, onRun: a, loading: o,
|
|
|
1147
1146
|
clip: "rect(0,0,0,0)"
|
|
1148
1147
|
},
|
|
1149
1148
|
children: e.reason
|
|
1150
|
-
}), /* @__PURE__ */ J(
|
|
1151
|
-
ref:
|
|
1149
|
+
}), /* @__PURE__ */ J(d, {
|
|
1150
|
+
ref: c,
|
|
1152
1151
|
kind: x ? "primary" : "default",
|
|
1153
1152
|
danger: b,
|
|
1154
1153
|
icon: T,
|
|
1155
|
-
disabled: S ||
|
|
1154
|
+
disabled: S || a,
|
|
1156
1155
|
"aria-disabled": S ? "true" : void 0,
|
|
1157
1156
|
"aria-describedby": C,
|
|
1158
|
-
"aria-label":
|
|
1159
|
-
title:
|
|
1157
|
+
"aria-label": m ? v : void 0,
|
|
1158
|
+
title: i(h, _, v, S, e.reason, m),
|
|
1160
1159
|
onClick: w,
|
|
1161
|
-
style:
|
|
1162
|
-
children:
|
|
1160
|
+
style: l,
|
|
1161
|
+
children: m ? null : v
|
|
1163
1162
|
})] });
|
|
1164
1163
|
}
|
|
1165
|
-
function
|
|
1166
|
-
let
|
|
1167
|
-
_.current = e,
|
|
1168
|
-
}, [
|
|
1169
|
-
return /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(
|
|
1164
|
+
function nt({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i, onLoadingChange: a, measureRef: o, style: c, row: u, widgetContext: p, onActionClick: m }) {
|
|
1165
|
+
let h = s(), _ = G(null), [v, y] = K(!1), b = e.name ? h(e.name) : h("action.menu.title", "Actions"), x = U((e) => {
|
|
1166
|
+
_.current = e, o?.(e);
|
|
1167
|
+
}, [o]), S = U((e, t) => (y(!1), r(e, t)), [r]);
|
|
1168
|
+
return /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(d, {
|
|
1170
1169
|
ref: x,
|
|
1171
1170
|
kind: "default",
|
|
1172
|
-
icon:
|
|
1173
|
-
name:
|
|
1171
|
+
icon: i == null ? e.icon ? /* @__PURE__ */ J(O, {
|
|
1172
|
+
name: e.icon,
|
|
1174
1173
|
size: 12
|
|
1175
|
-
}) : void 0 : /* @__PURE__ */ J(
|
|
1176
|
-
iconRight: /* @__PURE__ */ J(
|
|
1174
|
+
}) : void 0 : /* @__PURE__ */ J(g, { size: 12 }),
|
|
1175
|
+
iconRight: /* @__PURE__ */ J(l.down, { size: 10 }),
|
|
1177
1176
|
"aria-haspopup": "menu",
|
|
1178
1177
|
"aria-expanded": v ? "true" : "false",
|
|
1179
1178
|
title: b,
|
|
1180
1179
|
onClick: () => y((e) => !e),
|
|
1181
|
-
style:
|
|
1180
|
+
style: c,
|
|
1182
1181
|
children: b
|
|
1183
|
-
}), /* @__PURE__ */ J(
|
|
1182
|
+
}), /* @__PURE__ */ J(f, {
|
|
1184
1183
|
open: v,
|
|
1185
1184
|
anchor: _.current,
|
|
1186
1185
|
onClose: () => y(!1),
|
|
@@ -1189,33 +1188,33 @@ function et({ group: n, entityActions: r, globalActions: a, onRun: o, loading: s
|
|
|
1189
1188
|
children: /* @__PURE__ */ J("div", {
|
|
1190
1189
|
role: "menu",
|
|
1191
1190
|
"aria-label": b,
|
|
1192
|
-
children:
|
|
1191
|
+
children: e.items.map((e) => e.kind === "action" ? /* @__PURE__ */ J(rt, {
|
|
1193
1192
|
leaf: e,
|
|
1194
|
-
entityActions:
|
|
1195
|
-
globalActions:
|
|
1193
|
+
entityActions: t,
|
|
1194
|
+
globalActions: n,
|
|
1196
1195
|
onRun: S,
|
|
1197
|
-
loading:
|
|
1198
|
-
onLoadingChange: (t) =>
|
|
1199
|
-
row:
|
|
1200
|
-
widgetContext:
|
|
1201
|
-
onActionClick:
|
|
1202
|
-
}, e.code) : /* @__PURE__ */ J(
|
|
1196
|
+
loading: i === e.code,
|
|
1197
|
+
onLoadingChange: (t) => a(t ? e.code : null),
|
|
1198
|
+
row: u,
|
|
1199
|
+
widgetContext: p,
|
|
1200
|
+
onActionClick: m
|
|
1201
|
+
}, e.code) : /* @__PURE__ */ J(it, {
|
|
1203
1202
|
group: e,
|
|
1204
|
-
entityActions:
|
|
1205
|
-
globalActions:
|
|
1203
|
+
entityActions: t,
|
|
1204
|
+
globalActions: n,
|
|
1206
1205
|
onRun: S,
|
|
1207
|
-
loading:
|
|
1208
|
-
onLoadingChange:
|
|
1209
|
-
row:
|
|
1210
|
-
widgetContext:
|
|
1211
|
-
onActionClick:
|
|
1206
|
+
loading: i,
|
|
1207
|
+
onLoadingChange: a,
|
|
1208
|
+
row: u,
|
|
1209
|
+
widgetContext: p,
|
|
1210
|
+
onActionClick: m
|
|
1212
1211
|
}, e.items[0]?.kind === "action" ? e.items[0].code : e.icon ?? "group"))
|
|
1213
1212
|
})
|
|
1214
1213
|
})] });
|
|
1215
1214
|
}
|
|
1216
|
-
function
|
|
1217
|
-
let
|
|
1218
|
-
name:
|
|
1215
|
+
function rt({ leaf: e, entityActions: t, globalActions: n, onRun: r, loading: a, onLoadingChange: o, row: c, widgetContext: l, onActionClick: u }) {
|
|
1216
|
+
let d = s(), f = Ze(e.code, t, n), p = Qe(d, e.code, t, n), m = $e(e.code, t, n), h = f?.destructive ?? !1, _ = !e.enabled, v = _ ? et(e.code) : void 0, y = a ? /* @__PURE__ */ J(g, { size: 12 }) : m ? /* @__PURE__ */ J(O, {
|
|
1217
|
+
name: m,
|
|
1219
1218
|
size: 12
|
|
1220
1219
|
}) : null;
|
|
1221
1220
|
return /* @__PURE__ */ Y(q, { children: [v && e.reason && /* @__PURE__ */ J("span", {
|
|
@@ -1233,12 +1232,12 @@ function tt({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
|
|
|
1233
1232
|
role: "menuitem",
|
|
1234
1233
|
"aria-disabled": _ ? "true" : void 0,
|
|
1235
1234
|
"aria-describedby": v,
|
|
1236
|
-
title:
|
|
1235
|
+
title: i(d, f, p, _, e.reason),
|
|
1237
1236
|
onClick: async () => {
|
|
1238
|
-
if (!(!
|
|
1237
|
+
if (!(!f || _ || a)) {
|
|
1239
1238
|
o(!0);
|
|
1240
1239
|
try {
|
|
1241
|
-
|
|
1240
|
+
qe(e.code, f, c, l, u) || await Promise.resolve(r(e.code, f));
|
|
1242
1241
|
} finally {
|
|
1243
1242
|
o(!1);
|
|
1244
1243
|
}
|
|
@@ -1251,7 +1250,7 @@ function tt({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
|
|
|
1251
1250
|
padding: "6px 10px",
|
|
1252
1251
|
borderRadius: 5,
|
|
1253
1252
|
fontSize: 12.5,
|
|
1254
|
-
color:
|
|
1253
|
+
color: h ? "var(--danger)" : _ ? "var(--text-3)" : "var(--text-2)",
|
|
1255
1254
|
cursor: _ ? "not-allowed" : "pointer",
|
|
1256
1255
|
opacity: _ ? .6 : 1
|
|
1257
1256
|
},
|
|
@@ -1263,19 +1262,19 @@ function tt({ leaf: e, entityActions: n, globalActions: r, onRun: i, loading: a,
|
|
|
1263
1262
|
},
|
|
1264
1263
|
children: [y && /* @__PURE__ */ J("span", {
|
|
1265
1264
|
style: {
|
|
1266
|
-
color:
|
|
1265
|
+
color: h ? "var(--danger)" : "var(--text-3)",
|
|
1267
1266
|
display: "flex"
|
|
1268
1267
|
},
|
|
1269
1268
|
children: y
|
|
1270
1269
|
}), /* @__PURE__ */ J("span", {
|
|
1271
1270
|
style: { flex: 1 },
|
|
1272
|
-
children:
|
|
1271
|
+
children: p
|
|
1273
1272
|
})]
|
|
1274
1273
|
})] });
|
|
1275
1274
|
}
|
|
1276
|
-
function
|
|
1277
|
-
let
|
|
1278
|
-
return /* @__PURE__ */ Y(q, { children: [
|
|
1275
|
+
function it({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i, onLoadingChange: a, row: o, widgetContext: c, onActionClick: l }) {
|
|
1276
|
+
let u = s(), d = e.name ? u(e.name) : void 0;
|
|
1277
|
+
return /* @__PURE__ */ Y(q, { children: [d && /* @__PURE__ */ J("div", {
|
|
1279
1278
|
style: {
|
|
1280
1279
|
padding: "4px 10px 2px",
|
|
1281
1280
|
fontSize: 10.5,
|
|
@@ -1284,8 +1283,8 @@ function nt({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i
|
|
|
1284
1283
|
textTransform: "uppercase",
|
|
1285
1284
|
letterSpacing: "0.05em"
|
|
1286
1285
|
},
|
|
1287
|
-
children:
|
|
1288
|
-
}), e.items.map((e) => e.kind === "action" ? /* @__PURE__ */ J(
|
|
1286
|
+
children: d
|
|
1287
|
+
}), e.items.map((e) => e.kind === "action" ? /* @__PURE__ */ J(rt, {
|
|
1289
1288
|
leaf: e,
|
|
1290
1289
|
entityActions: t,
|
|
1291
1290
|
globalActions: n,
|
|
@@ -1293,9 +1292,9 @@ function nt({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i
|
|
|
1293
1292
|
loading: i === e.code,
|
|
1294
1293
|
onLoadingChange: (t) => a(t ? e.code : null),
|
|
1295
1294
|
row: o,
|
|
1296
|
-
widgetContext:
|
|
1297
|
-
onActionClick:
|
|
1298
|
-
}, e.code) : /* @__PURE__ */ J(
|
|
1295
|
+
widgetContext: c,
|
|
1296
|
+
onActionClick: l
|
|
1297
|
+
}, e.code) : /* @__PURE__ */ J(it, {
|
|
1299
1298
|
group: e,
|
|
1300
1299
|
entityActions: t,
|
|
1301
1300
|
globalActions: n,
|
|
@@ -1303,52 +1302,52 @@ function nt({ group: e, entityActions: t, globalActions: n, onRun: r, loading: i
|
|
|
1303
1302
|
loading: i,
|
|
1304
1303
|
onLoadingChange: a,
|
|
1305
1304
|
row: o,
|
|
1306
|
-
widgetContext:
|
|
1307
|
-
onActionClick:
|
|
1305
|
+
widgetContext: c,
|
|
1306
|
+
onActionClick: l
|
|
1308
1307
|
}, e.icon ?? "nested"))] });
|
|
1309
1308
|
}
|
|
1310
|
-
function
|
|
1311
|
-
let c =
|
|
1312
|
-
return
|
|
1313
|
-
"data-open":
|
|
1309
|
+
function at({ layout: e, entityActions: t, globalActions: n, onRun: r, row: i, widgetContext: a, onActionClick: o }) {
|
|
1310
|
+
let c = s(), d = G(null), [p, m] = K(!1), [h, _] = K(null), v = U((e, t) => (m(!1), r(e, t)), [r]);
|
|
1311
|
+
return Je(e) === 0 ? null : /* @__PURE__ */ Y("div", {
|
|
1312
|
+
"data-open": p ? "true" : void 0,
|
|
1314
1313
|
style: {
|
|
1315
1314
|
display: "inline-flex",
|
|
1316
1315
|
alignItems: "center"
|
|
1317
1316
|
},
|
|
1318
|
-
children: [/* @__PURE__ */ J(
|
|
1319
|
-
ref:
|
|
1320
|
-
icon: J(
|
|
1317
|
+
children: [/* @__PURE__ */ J(u, {
|
|
1318
|
+
ref: d,
|
|
1319
|
+
icon: J(h == null ? l.more : g, { size: 14 }),
|
|
1321
1320
|
title: c("action.menu.title", "Actions"),
|
|
1322
1321
|
size: 28,
|
|
1323
|
-
onClick: () =>
|
|
1324
|
-
}), /* @__PURE__ */ J(
|
|
1325
|
-
open:
|
|
1326
|
-
anchor:
|
|
1327
|
-
onClose: () =>
|
|
1322
|
+
onClick: () => m((e) => !e)
|
|
1323
|
+
}), /* @__PURE__ */ J(f, {
|
|
1324
|
+
open: p,
|
|
1325
|
+
anchor: d.current,
|
|
1326
|
+
onClose: () => m(!1),
|
|
1328
1327
|
align: "end",
|
|
1329
1328
|
width: 220,
|
|
1330
|
-
children: /* @__PURE__ */ J(
|
|
1331
|
-
layout:
|
|
1332
|
-
entityActions:
|
|
1333
|
-
globalActions:
|
|
1334
|
-
onRun:
|
|
1335
|
-
loading:
|
|
1336
|
-
onLoadingChange:
|
|
1337
|
-
row:
|
|
1338
|
-
widgetContext:
|
|
1339
|
-
onActionClick:
|
|
1329
|
+
children: /* @__PURE__ */ J(st, {
|
|
1330
|
+
layout: e,
|
|
1331
|
+
entityActions: t,
|
|
1332
|
+
globalActions: n,
|
|
1333
|
+
onRun: v,
|
|
1334
|
+
loading: h,
|
|
1335
|
+
onLoadingChange: _,
|
|
1336
|
+
row: i,
|
|
1337
|
+
widgetContext: a,
|
|
1338
|
+
onActionClick: o
|
|
1340
1339
|
})
|
|
1341
1340
|
})]
|
|
1342
1341
|
});
|
|
1343
1342
|
}
|
|
1344
|
-
function
|
|
1343
|
+
function ot(e) {
|
|
1345
1344
|
let t = 0;
|
|
1346
|
-
for (let
|
|
1345
|
+
for (let n of e) if (n.kind === "action" && c(n.code)) t++;
|
|
1347
1346
|
else break;
|
|
1348
1347
|
return t;
|
|
1349
1348
|
}
|
|
1350
|
-
function
|
|
1351
|
-
let
|
|
1349
|
+
function st({ layout: e, entityActions: t, globalActions: n, onRun: r, loading: i, onLoadingChange: a, row: o, widgetContext: c, onActionClick: l, ariaLabel: u }) {
|
|
1350
|
+
let d = s(), { normal: f, destructive: m } = Ye(e, t, n), h = ot(f), g = f.slice(0, h), _ = f.slice(h), v = m.length > 0, y = _.length > 0, b = (e) => /* @__PURE__ */ J(rt, {
|
|
1352
1351
|
leaf: e,
|
|
1353
1352
|
entityActions: t,
|
|
1354
1353
|
globalActions: n,
|
|
@@ -1356,16 +1355,16 @@ function at({ layout: e, entityActions: t, globalActions: n, onRun: r, loading:
|
|
|
1356
1355
|
loading: i === e.code,
|
|
1357
1356
|
onLoadingChange: (t) => a(t ? e.code : null),
|
|
1358
1357
|
row: o,
|
|
1359
|
-
widgetContext:
|
|
1360
|
-
onActionClick:
|
|
1358
|
+
widgetContext: c,
|
|
1359
|
+
onActionClick: l
|
|
1361
1360
|
}, e.code);
|
|
1362
1361
|
return /* @__PURE__ */ Y("div", {
|
|
1363
1362
|
role: "menu",
|
|
1364
|
-
"aria-label":
|
|
1363
|
+
"aria-label": u ?? d("action.menu.row_actions", "Row actions"),
|
|
1365
1364
|
children: [
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1365
|
+
g.map((e) => e.kind === "action" ? b(e) : null),
|
|
1366
|
+
g.length > 0 && y && /* @__PURE__ */ J(p, { divider: !0 }),
|
|
1367
|
+
_.map((e) => e.kind === "action" ? b(e) : /* @__PURE__ */ J(it, {
|
|
1369
1368
|
group: e,
|
|
1370
1369
|
entityActions: t,
|
|
1371
1370
|
globalActions: n,
|
|
@@ -1373,50 +1372,50 @@ function at({ layout: e, entityActions: t, globalActions: n, onRun: r, loading:
|
|
|
1373
1372
|
loading: i,
|
|
1374
1373
|
onLoadingChange: a,
|
|
1375
1374
|
row: o,
|
|
1376
|
-
widgetContext:
|
|
1377
|
-
onActionClick:
|
|
1375
|
+
widgetContext: c,
|
|
1376
|
+
onActionClick: l
|
|
1378
1377
|
}, e.icon ?? "group")),
|
|
1379
|
-
|
|
1380
|
-
|
|
1378
|
+
v && /* @__PURE__ */ J(p, { divider: !0 }),
|
|
1379
|
+
m.map((e) => b(e))
|
|
1381
1380
|
]
|
|
1382
1381
|
});
|
|
1383
1382
|
}
|
|
1384
|
-
var
|
|
1385
|
-
function
|
|
1383
|
+
var ct = "__overflow_trigger__", lt = 90, ut = 4, dt = 8;
|
|
1384
|
+
function ft(e) {
|
|
1386
1385
|
return `icon:${$(e)}`;
|
|
1387
1386
|
}
|
|
1388
|
-
function
|
|
1389
|
-
return
|
|
1387
|
+
function pt() {
|
|
1388
|
+
return dt;
|
|
1390
1389
|
}
|
|
1391
|
-
function
|
|
1390
|
+
function mt(e, t, n) {
|
|
1392
1391
|
return [
|
|
1393
1392
|
...e,
|
|
1394
1393
|
...t,
|
|
1395
1394
|
...n
|
|
1396
1395
|
];
|
|
1397
1396
|
}
|
|
1398
|
-
var
|
|
1399
|
-
function
|
|
1397
|
+
var ht = () => {}, gt = () => Promise.resolve();
|
|
1398
|
+
function _t(e) {
|
|
1400
1399
|
return (t) => {
|
|
1401
1400
|
t && (t.setAttribute("data-node-key", e), t.setAttribute("tabindex", "-1"));
|
|
1402
1401
|
};
|
|
1403
1402
|
}
|
|
1404
|
-
function
|
|
1403
|
+
function vt(e, t) {
|
|
1405
1404
|
if (e.size !== t.size) return !1;
|
|
1406
1405
|
for (let [n, r] of t) if (e.get(n) !== r) return !1;
|
|
1407
1406
|
return !0;
|
|
1408
1407
|
}
|
|
1409
|
-
function
|
|
1408
|
+
function yt(e, t) {
|
|
1410
1409
|
return t.get($(e)) ?? 0;
|
|
1411
1410
|
}
|
|
1412
|
-
function
|
|
1413
|
-
return t.get(
|
|
1411
|
+
function bt(e, t) {
|
|
1412
|
+
return t.get(ft(e));
|
|
1414
1413
|
}
|
|
1415
|
-
function
|
|
1416
|
-
let { primary: l, regular: u, destructive: d } =
|
|
1414
|
+
function xt(e, t, n, r, i, a, o, s, c) {
|
|
1415
|
+
let { primary: l, regular: u, destructive: d } = Xe(e, i, a), f = ut, p = r.get(ct) ?? lt, m = t - n, h = mt(l, u, d), g = /* @__PURE__ */ new Set(), _ = /* @__PURE__ */ new Set();
|
|
1417
1416
|
if (o) for (let e of h) o(e) && g.add($(e));
|
|
1418
1417
|
else {
|
|
1419
|
-
let e = (e, t) => t ?
|
|
1418
|
+
let e = (e, t) => t ? bt(e, r) ?? yt(e, r) : yt(e, r), t = (e) => s ? e.filter((e) => !s.has($(e))).length * pt() : 0, n = (e, t) => c ? e.slice(0, t).filter((e) => c.has($(e))).length * pt() : 0, i = (r, i) => {
|
|
1420
1419
|
let a = r.length < h.length ? p + f : 0, o = r.length > 1 ? (r.length - 1) * f : 0;
|
|
1421
1420
|
return r.reduce((t, n, r) => t + e(n, r >= i), 0) + o + a + t(r) + n(r, i) <= m;
|
|
1422
1421
|
}, a = 0, o = !1;
|
|
@@ -1444,149 +1443,149 @@ function yt(e, t, n, r, i, a, o, s, c) {
|
|
|
1444
1443
|
function $(e) {
|
|
1445
1444
|
return e.kind === "action" ? `action:${e.code}` : `group:${JSON.stringify(e.name ?? {})}`;
|
|
1446
1445
|
}
|
|
1447
|
-
function
|
|
1446
|
+
function St(e) {
|
|
1448
1447
|
let t = e.parentElement;
|
|
1449
1448
|
for (; t && getComputedStyle(t).display === "contents";) t = t.parentElement;
|
|
1450
1449
|
if (!t) return !1;
|
|
1451
1450
|
let n = getComputedStyle(t);
|
|
1452
1451
|
return !(parseFloat(n.flexGrow) > 0 || n.display === "block" || n.display === "flow-root" || n.width !== "auto" || n.maxWidth !== "none");
|
|
1453
1452
|
}
|
|
1454
|
-
function
|
|
1455
|
-
let
|
|
1456
|
-
|
|
1453
|
+
function Ct({ layout: e, entityActions: t, globalActions: n, onRun: r, reservedRightWidth: i = 0, measurementOverride: a, ariaLabel: o, align: c = "trailing", constrain: u = !0, row: m, widgetContext: h, onActionClick: g }) {
|
|
1454
|
+
let _ = s(), v = G(null), y = G(null), [b, x] = K(0), [S, C] = K(/* @__PURE__ */ new Map()), [w, T] = K(!1), [E, D] = K(null), [O, k] = K(() => typeof document < "u" && document.documentElement.dir === "rtl");
|
|
1455
|
+
W(() => {
|
|
1457
1456
|
if (typeof MutationObserver > "u") return;
|
|
1458
1457
|
let e = new MutationObserver((e) => {
|
|
1459
|
-
for (let t of e) t.attributeName === "dir" && k(document.documentElement.dir === "rtl"), t.attributeName === "lang" &&
|
|
1458
|
+
for (let t of e) t.attributeName === "dir" && k(document.documentElement.dir === "rtl"), t.attributeName === "lang" && T(!1);
|
|
1460
1459
|
});
|
|
1461
1460
|
return e.observe(document.documentElement, {
|
|
1462
1461
|
attributes: !0,
|
|
1463
1462
|
attributeFilter: ["dir", "lang"]
|
|
1464
1463
|
}), () => e.disconnect();
|
|
1465
1464
|
}, []);
|
|
1466
|
-
let A = G(null), [j, M] = K(!1),
|
|
1467
|
-
if (
|
|
1468
|
-
let e = Array.from(
|
|
1465
|
+
let A = G(null), [j, M] = K(!1), N = U((e, t) => (M(!1), r(e, t)), [r]), ee = Je(e), P = !!a, F = U(() => {
|
|
1466
|
+
if (P || !y.current) return;
|
|
1467
|
+
let e = Array.from(y.current.children), t = /* @__PURE__ */ new Map();
|
|
1469
1468
|
e.forEach((e) => {
|
|
1470
1469
|
let n = e.dataset.nodeKey;
|
|
1471
1470
|
n && t.set(n, e.getBoundingClientRect().width || e.offsetWidth);
|
|
1472
|
-
}),
|
|
1473
|
-
}, [
|
|
1474
|
-
|
|
1475
|
-
if (
|
|
1476
|
-
let e =
|
|
1471
|
+
}), C((e) => vt(e, t) ? e : t), T(!0);
|
|
1472
|
+
}, [P]), I = ie(() => JSON.stringify(e.map((e) => $(e))), [e]);
|
|
1473
|
+
W(() => {
|
|
1474
|
+
if (P) return;
|
|
1475
|
+
let e = y.current;
|
|
1477
1476
|
if (!e || typeof ResizeObserver > "u") return;
|
|
1478
|
-
let t = new ResizeObserver(() =>
|
|
1477
|
+
let t = new ResizeObserver(() => F());
|
|
1479
1478
|
t.observe(e);
|
|
1480
1479
|
for (let n of Array.from(e.children)) t.observe(n);
|
|
1481
1480
|
return () => t.disconnect();
|
|
1482
1481
|
}, [
|
|
1482
|
+
F,
|
|
1483
1483
|
P,
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
w(!0);
|
|
1484
|
+
I
|
|
1485
|
+
]), re(() => {
|
|
1486
|
+
if (P) {
|
|
1487
|
+
T(!0);
|
|
1489
1488
|
return;
|
|
1490
1489
|
}
|
|
1491
|
-
|
|
1490
|
+
T(!1);
|
|
1492
1491
|
let e = requestAnimationFrame(() => {
|
|
1493
|
-
|
|
1492
|
+
F();
|
|
1494
1493
|
});
|
|
1495
1494
|
return () => cancelAnimationFrame(e);
|
|
1496
1495
|
}, [
|
|
1496
|
+
I,
|
|
1497
1497
|
F,
|
|
1498
|
-
P
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
if (N || C) return;
|
|
1498
|
+
P
|
|
1499
|
+
]), W(() => {
|
|
1500
|
+
if (P || w) return;
|
|
1502
1501
|
let e = setTimeout(() => {
|
|
1503
|
-
|
|
1502
|
+
F(), T(!0);
|
|
1504
1503
|
}, 16);
|
|
1505
1504
|
return () => clearTimeout(e);
|
|
1506
1505
|
}, [
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
]),
|
|
1511
|
-
if (
|
|
1512
|
-
let e =
|
|
1513
|
-
if (!e || !
|
|
1506
|
+
w,
|
|
1507
|
+
F,
|
|
1508
|
+
P
|
|
1509
|
+
]), W(() => {
|
|
1510
|
+
if (P || !u || !w || b === 0) return;
|
|
1511
|
+
let e = v.current;
|
|
1512
|
+
if (!e || !St(e)) return;
|
|
1514
1513
|
let t = [...e.children].filter((e) => e.getAttribute("aria-hidden") !== "true"), n = t.length > 1 ? (t.length - 1) * 4 : 0, r = t.reduce((e, t) => e + t.getBoundingClientRect().width, 0) + n;
|
|
1515
|
-
r > 0 && Math.abs(
|
|
1514
|
+
r > 0 && Math.abs(b - r) < 1 && console.error(`[declarion] ResponsiveActionBar is measuring itself: its container is ${Math.round(b)}px, exactly the width of what it just rendered. The slot holding this bar is sized by its own content, so it cannot tell the bar how much room there is. Give that slot \`flex: 1 1 auto; min-width: 0\` (and justify its content to the edge the buttons sit on), or pass \`constrain={false}\` if it genuinely has no row to take space from.`);
|
|
1516
1515
|
}, [
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
]),
|
|
1523
|
-
if (
|
|
1524
|
-
let e =
|
|
1516
|
+
P,
|
|
1517
|
+
u,
|
|
1518
|
+
w,
|
|
1519
|
+
b,
|
|
1520
|
+
S
|
|
1521
|
+
]), W(() => {
|
|
1522
|
+
if (P) return;
|
|
1523
|
+
let e = v.current;
|
|
1525
1524
|
if (!e) return;
|
|
1526
1525
|
if (typeof ResizeObserver > "u") {
|
|
1527
|
-
|
|
1526
|
+
x(e.getBoundingClientRect().width);
|
|
1528
1527
|
return;
|
|
1529
1528
|
}
|
|
1530
1529
|
let t = new ResizeObserver((e) => {
|
|
1531
1530
|
let t = e[0];
|
|
1532
|
-
t &&
|
|
1531
|
+
t && x(t.contentRect.width);
|
|
1533
1532
|
});
|
|
1534
|
-
return t.observe(e),
|
|
1535
|
-
}, [
|
|
1536
|
-
let
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
}, [
|
|
1540
|
-
let R = ie(() =>
|
|
1533
|
+
return t.observe(e), x(e.getBoundingClientRect().width), () => t.disconnect();
|
|
1534
|
+
}, [P]);
|
|
1535
|
+
let L = G(void 0), te = G(void 0);
|
|
1536
|
+
W(() => {
|
|
1537
|
+
L.current = void 0, te.current = void 0;
|
|
1538
|
+
}, [I]);
|
|
1539
|
+
let R = ie(() => P || !u ? xt(e, 2 ** 53 - 1, i, S, t, n, a) : w ? b === 0 ? xt(e, 2 ** 53 - 1, i, S, t, n, a) : xt(e, b, i, S, t, n, a, L.current, te.current) : {
|
|
1541
1540
|
primaryInline: [],
|
|
1542
1541
|
inline: [],
|
|
1543
1542
|
overflow: [],
|
|
1544
1543
|
destructiveInline: [],
|
|
1545
1544
|
iconOnly: /* @__PURE__ */ new Set()
|
|
1546
1545
|
}, [
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1546
|
+
P,
|
|
1547
|
+
u,
|
|
1548
|
+
w,
|
|
1549
|
+
b,
|
|
1550
|
+
e,
|
|
1551
|
+
i,
|
|
1552
|
+
S,
|
|
1551
1553
|
t,
|
|
1552
|
-
o,
|
|
1553
|
-
x,
|
|
1554
1554
|
n,
|
|
1555
|
-
|
|
1556
|
-
s
|
|
1555
|
+
a
|
|
1557
1556
|
]);
|
|
1558
|
-
if (
|
|
1559
|
-
(
|
|
1557
|
+
if (W(() => {
|
|
1558
|
+
(w || P) && (L.current = new Set([
|
|
1560
1559
|
...R.primaryInline,
|
|
1561
1560
|
...R.inline,
|
|
1562
1561
|
...R.destructiveInline
|
|
1563
|
-
].map($)),
|
|
1562
|
+
].map($)), te.current = new Set(R.iconOnly));
|
|
1564
1563
|
}, [
|
|
1565
1564
|
R,
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
]),
|
|
1569
|
-
let z = R.overflow.length > 0, { normal: ne, destructive:
|
|
1565
|
+
w,
|
|
1566
|
+
P
|
|
1567
|
+
]), ee === 0) return null;
|
|
1568
|
+
let z = R.overflow.length > 0, { normal: ne, destructive: V } = Ye(R.overflow, t, n);
|
|
1570
1569
|
return /* @__PURE__ */ Y("div", {
|
|
1571
|
-
ref:
|
|
1570
|
+
ref: v,
|
|
1572
1571
|
role: "toolbar",
|
|
1573
|
-
"aria-label":
|
|
1572
|
+
"aria-label": o ?? _("action.menu.title", "Actions"),
|
|
1574
1573
|
style: {
|
|
1575
1574
|
display: "flex",
|
|
1576
1575
|
flexDirection: O ? "row-reverse" : "row",
|
|
1577
1576
|
alignItems: "center",
|
|
1578
|
-
gap:
|
|
1577
|
+
gap: ut,
|
|
1579
1578
|
flexWrap: "wrap",
|
|
1580
|
-
visibility:
|
|
1579
|
+
visibility: w || P ? "visible" : "hidden",
|
|
1581
1580
|
position: "relative",
|
|
1582
|
-
flex:
|
|
1583
|
-
justifyContent:
|
|
1581
|
+
flex: u ? "1 1 auto" : "0 1 auto",
|
|
1582
|
+
justifyContent: c === "trailing" ? "flex-end" : "flex-start",
|
|
1584
1583
|
minWidth: 0,
|
|
1585
1584
|
boxSizing: "border-box"
|
|
1586
1585
|
},
|
|
1587
1586
|
children: [
|
|
1588
1587
|
/* @__PURE__ */ Y("div", {
|
|
1589
|
-
ref:
|
|
1588
|
+
ref: y,
|
|
1590
1589
|
"aria-hidden": "true",
|
|
1591
1590
|
inert: !0,
|
|
1592
1591
|
style: {
|
|
@@ -1600,94 +1599,94 @@ function xt({ layout: t, entityActions: n, globalActions: r, onRun: a, reservedR
|
|
|
1600
1599
|
width: "max-content",
|
|
1601
1600
|
flexWrap: "nowrap"
|
|
1602
1601
|
},
|
|
1603
|
-
children: [/* @__PURE__ */ J(
|
|
1604
|
-
"data-node-key":
|
|
1605
|
-
iconRight: /* @__PURE__ */ J(
|
|
1602
|
+
children: [/* @__PURE__ */ J(d, {
|
|
1603
|
+
"data-node-key": ct,
|
|
1604
|
+
iconRight: /* @__PURE__ */ J(l.down, { size: 10 }),
|
|
1606
1605
|
tabIndex: -1,
|
|
1607
|
-
children:
|
|
1608
|
-
},
|
|
1609
|
-
let
|
|
1610
|
-
return e.kind === "action" ? /* @__PURE__ */ Y(
|
|
1606
|
+
children: _("action.menu.title", "Actions")
|
|
1607
|
+
}, ct), e.map((e) => {
|
|
1608
|
+
let r = $(e);
|
|
1609
|
+
return e.kind === "action" ? /* @__PURE__ */ Y(B, { children: [/* @__PURE__ */ J(tt, {
|
|
1611
1610
|
leaf: e,
|
|
1612
|
-
entityActions:
|
|
1613
|
-
globalActions:
|
|
1614
|
-
onRun:
|
|
1611
|
+
entityActions: t,
|
|
1612
|
+
globalActions: n,
|
|
1613
|
+
onRun: gt,
|
|
1615
1614
|
loading: !1,
|
|
1616
|
-
onLoadingChange:
|
|
1617
|
-
row:
|
|
1618
|
-
widgetContext:
|
|
1619
|
-
measureRef:
|
|
1620
|
-
}),
|
|
1615
|
+
onLoadingChange: ht,
|
|
1616
|
+
row: m,
|
|
1617
|
+
widgetContext: h,
|
|
1618
|
+
measureRef: _t(r)
|
|
1619
|
+
}), $e(e.code, t, n) && /* @__PURE__ */ J(tt, {
|
|
1621
1620
|
leaf: e,
|
|
1622
|
-
entityActions:
|
|
1623
|
-
globalActions:
|
|
1624
|
-
onRun:
|
|
1621
|
+
entityActions: t,
|
|
1622
|
+
globalActions: n,
|
|
1623
|
+
onRun: gt,
|
|
1625
1624
|
loading: !1,
|
|
1626
|
-
onLoadingChange:
|
|
1627
|
-
row:
|
|
1628
|
-
widgetContext:
|
|
1625
|
+
onLoadingChange: ht,
|
|
1626
|
+
row: m,
|
|
1627
|
+
widgetContext: h,
|
|
1629
1628
|
iconOnly: !0,
|
|
1630
|
-
measureRef:
|
|
1631
|
-
})] },
|
|
1629
|
+
measureRef: _t(ft(e))
|
|
1630
|
+
})] }, r) : /* @__PURE__ */ J(nt, {
|
|
1632
1631
|
group: e,
|
|
1633
|
-
entityActions:
|
|
1634
|
-
globalActions:
|
|
1635
|
-
onRun:
|
|
1632
|
+
entityActions: t,
|
|
1633
|
+
globalActions: n,
|
|
1634
|
+
onRun: gt,
|
|
1636
1635
|
loading: null,
|
|
1637
|
-
onLoadingChange:
|
|
1638
|
-
row:
|
|
1639
|
-
widgetContext:
|
|
1640
|
-
onActionClick:
|
|
1641
|
-
measureRef:
|
|
1642
|
-
},
|
|
1636
|
+
onLoadingChange: ht,
|
|
1637
|
+
row: m,
|
|
1638
|
+
widgetContext: h,
|
|
1639
|
+
onActionClick: g,
|
|
1640
|
+
measureRef: _t(r)
|
|
1641
|
+
}, r);
|
|
1643
1642
|
})]
|
|
1644
1643
|
}),
|
|
1645
|
-
R.primaryInline.map((e) => /* @__PURE__ */ J(
|
|
1644
|
+
R.primaryInline.map((e) => /* @__PURE__ */ J(tt, {
|
|
1646
1645
|
leaf: e,
|
|
1647
|
-
entityActions:
|
|
1648
|
-
globalActions:
|
|
1649
|
-
onRun:
|
|
1650
|
-
loading:
|
|
1651
|
-
onLoadingChange: (t) =>
|
|
1652
|
-
row:
|
|
1653
|
-
widgetContext:
|
|
1654
|
-
onActionClick:
|
|
1646
|
+
entityActions: t,
|
|
1647
|
+
globalActions: n,
|
|
1648
|
+
onRun: r,
|
|
1649
|
+
loading: E === e.code,
|
|
1650
|
+
onLoadingChange: (t) => D(t ? e.code : null),
|
|
1651
|
+
row: m,
|
|
1652
|
+
widgetContext: h,
|
|
1653
|
+
onActionClick: g,
|
|
1655
1654
|
iconOnly: R.iconOnly.has($(e))
|
|
1656
1655
|
}, $(e))),
|
|
1657
1656
|
R.inline.map((e) => {
|
|
1658
|
-
let
|
|
1659
|
-
return e.kind === "action" ? /* @__PURE__ */ J(
|
|
1657
|
+
let i = $(e);
|
|
1658
|
+
return e.kind === "action" ? /* @__PURE__ */ J(tt, {
|
|
1660
1659
|
leaf: e,
|
|
1661
|
-
entityActions:
|
|
1662
|
-
globalActions:
|
|
1663
|
-
onRun:
|
|
1664
|
-
loading:
|
|
1665
|
-
onLoadingChange: (t) =>
|
|
1666
|
-
row:
|
|
1667
|
-
widgetContext:
|
|
1668
|
-
onActionClick:
|
|
1669
|
-
iconOnly: R.iconOnly.has(
|
|
1670
|
-
},
|
|
1660
|
+
entityActions: t,
|
|
1661
|
+
globalActions: n,
|
|
1662
|
+
onRun: r,
|
|
1663
|
+
loading: E === e.code,
|
|
1664
|
+
onLoadingChange: (t) => D(t ? e.code : null),
|
|
1665
|
+
row: m,
|
|
1666
|
+
widgetContext: h,
|
|
1667
|
+
onActionClick: g,
|
|
1668
|
+
iconOnly: R.iconOnly.has(i)
|
|
1669
|
+
}, i) : /* @__PURE__ */ J(nt, {
|
|
1671
1670
|
group: e,
|
|
1672
|
-
entityActions:
|
|
1673
|
-
globalActions:
|
|
1674
|
-
onRun:
|
|
1675
|
-
loading:
|
|
1676
|
-
onLoadingChange:
|
|
1677
|
-
row:
|
|
1678
|
-
widgetContext:
|
|
1679
|
-
onActionClick:
|
|
1680
|
-
},
|
|
1671
|
+
entityActions: t,
|
|
1672
|
+
globalActions: n,
|
|
1673
|
+
onRun: r,
|
|
1674
|
+
loading: E,
|
|
1675
|
+
onLoadingChange: D,
|
|
1676
|
+
row: m,
|
|
1677
|
+
widgetContext: h,
|
|
1678
|
+
onActionClick: g
|
|
1679
|
+
}, i);
|
|
1681
1680
|
}),
|
|
1682
|
-
z && /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(
|
|
1681
|
+
z && /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(d, {
|
|
1683
1682
|
ref: A,
|
|
1684
1683
|
kind: "default",
|
|
1685
|
-
iconRight: /* @__PURE__ */ J(
|
|
1684
|
+
iconRight: /* @__PURE__ */ J(l.down, { size: 10 }),
|
|
1686
1685
|
"aria-haspopup": "menu",
|
|
1687
1686
|
"aria-expanded": j ? "true" : "false",
|
|
1688
1687
|
onClick: () => M((e) => !e),
|
|
1689
|
-
children:
|
|
1690
|
-
}), /* @__PURE__ */ J(
|
|
1688
|
+
children: _("action.menu.title", "Actions")
|
|
1689
|
+
}), /* @__PURE__ */ J(f, {
|
|
1691
1690
|
open: j,
|
|
1692
1691
|
anchor: A.current,
|
|
1693
1692
|
onClose: () => M(!1),
|
|
@@ -1695,50 +1694,50 @@ function xt({ layout: t, entityActions: n, globalActions: r, onRun: a, reservedR
|
|
|
1695
1694
|
width: 220,
|
|
1696
1695
|
children: /* @__PURE__ */ J("div", {
|
|
1697
1696
|
role: "menu",
|
|
1698
|
-
"aria-label":
|
|
1697
|
+
"aria-label": _("action.menu.more", "More actions"),
|
|
1699
1698
|
children: [
|
|
1700
1699
|
...ne,
|
|
1701
|
-
...
|
|
1702
|
-
...
|
|
1703
|
-
].map((e,
|
|
1700
|
+
...V.length > 0 ? [null] : [],
|
|
1701
|
+
...V
|
|
1702
|
+
].map((e, r) => e === null ? /* @__PURE__ */ J(p, { divider: !0 }, "destructive-divider") : e.kind === "action" ? /* @__PURE__ */ J(rt, {
|
|
1704
1703
|
leaf: e,
|
|
1705
|
-
entityActions:
|
|
1706
|
-
globalActions:
|
|
1707
|
-
onRun:
|
|
1708
|
-
loading:
|
|
1709
|
-
onLoadingChange: (t) =>
|
|
1710
|
-
row:
|
|
1711
|
-
widgetContext:
|
|
1712
|
-
onActionClick:
|
|
1713
|
-
}, e.code) : /* @__PURE__ */ J(
|
|
1704
|
+
entityActions: t,
|
|
1705
|
+
globalActions: n,
|
|
1706
|
+
onRun: N,
|
|
1707
|
+
loading: E === e.code,
|
|
1708
|
+
onLoadingChange: (t) => D(t ? e.code : null),
|
|
1709
|
+
row: m,
|
|
1710
|
+
widgetContext: h,
|
|
1711
|
+
onActionClick: g
|
|
1712
|
+
}, e.code) : /* @__PURE__ */ J(it, {
|
|
1714
1713
|
group: e,
|
|
1715
|
-
entityActions:
|
|
1716
|
-
globalActions:
|
|
1717
|
-
onRun:
|
|
1718
|
-
loading:
|
|
1719
|
-
onLoadingChange:
|
|
1720
|
-
row:
|
|
1721
|
-
widgetContext:
|
|
1722
|
-
onActionClick:
|
|
1723
|
-
}, `${$(e)}-${
|
|
1714
|
+
entityActions: t,
|
|
1715
|
+
globalActions: n,
|
|
1716
|
+
onRun: N,
|
|
1717
|
+
loading: E,
|
|
1718
|
+
onLoadingChange: D,
|
|
1719
|
+
row: m,
|
|
1720
|
+
widgetContext: h,
|
|
1721
|
+
onActionClick: g
|
|
1722
|
+
}, `${$(e)}-${r}`))
|
|
1724
1723
|
})
|
|
1725
1724
|
})] }),
|
|
1726
|
-
R.destructiveInline.map((e) => /* @__PURE__ */ J(
|
|
1725
|
+
R.destructiveInline.map((e) => /* @__PURE__ */ J(tt, {
|
|
1727
1726
|
leaf: e,
|
|
1728
|
-
entityActions:
|
|
1729
|
-
globalActions:
|
|
1730
|
-
onRun:
|
|
1731
|
-
loading:
|
|
1732
|
-
onLoadingChange: (t) =>
|
|
1733
|
-
row:
|
|
1734
|
-
widgetContext:
|
|
1735
|
-
onActionClick:
|
|
1727
|
+
entityActions: t,
|
|
1728
|
+
globalActions: n,
|
|
1729
|
+
onRun: r,
|
|
1730
|
+
loading: E === e.code,
|
|
1731
|
+
onLoadingChange: (t) => D(t ? e.code : null),
|
|
1732
|
+
row: m,
|
|
1733
|
+
widgetContext: h,
|
|
1734
|
+
onActionClick: g,
|
|
1736
1735
|
iconOnly: R.iconOnly.has($(e))
|
|
1737
1736
|
}, $(e)))
|
|
1738
1737
|
]
|
|
1739
1738
|
});
|
|
1740
1739
|
}
|
|
1741
|
-
function
|
|
1740
|
+
function wt({ layout: e, rowSelection: t = [], ...n }) {
|
|
1742
1741
|
let r = t.length > 0;
|
|
1743
1742
|
return /* @__PURE__ */ Y("div", {
|
|
1744
1743
|
style: {
|
|
@@ -1754,7 +1753,7 @@ function St({ layout: e, rowSelection: t = [], ...n }) {
|
|
|
1754
1753
|
flex: "1 1 auto",
|
|
1755
1754
|
minWidth: 0
|
|
1756
1755
|
},
|
|
1757
|
-
children: /* @__PURE__ */ J(
|
|
1756
|
+
children: /* @__PURE__ */ J(Ct, {
|
|
1758
1757
|
layout: e,
|
|
1759
1758
|
rowSelection: [],
|
|
1760
1759
|
...n
|
|
@@ -1766,7 +1765,7 @@ function St({ layout: e, rowSelection: t = [], ...n }) {
|
|
|
1766
1765
|
flex: "1 1 auto",
|
|
1767
1766
|
minWidth: 0
|
|
1768
1767
|
},
|
|
1769
|
-
children: /* @__PURE__ */ J(
|
|
1768
|
+
children: /* @__PURE__ */ J(Ct, {
|
|
1770
1769
|
layout: e,
|
|
1771
1770
|
rowSelection: t,
|
|
1772
1771
|
...n
|
|
@@ -1774,9 +1773,9 @@ function St({ layout: e, rowSelection: t = [], ...n }) {
|
|
|
1774
1773
|
})]
|
|
1775
1774
|
});
|
|
1776
1775
|
}
|
|
1777
|
-
function
|
|
1778
|
-
let m =
|
|
1779
|
-
return a === "row" ? /* @__PURE__ */ J(
|
|
1776
|
+
function Tt({ layout: e, row: t, rowSelection: n, onRun: r, reservedRightWidth: i = 0, kind: a = "toolbar", align: o = "trailing", constrain: s = !0, measurementOverride: c, entityActions: l, globalActions: u, ariaLabel: d, widgetContext: f, onActionClick: p }) {
|
|
1777
|
+
let m = Je(e);
|
|
1778
|
+
return a === "row" ? /* @__PURE__ */ J(at, {
|
|
1780
1779
|
layout: e,
|
|
1781
1780
|
entityActions: l,
|
|
1782
1781
|
globalActions: u,
|
|
@@ -1784,7 +1783,7 @@ function Ct({ layout: e, row: t, rowSelection: n, onRun: r, reservedRightWidth:
|
|
|
1784
1783
|
row: t,
|
|
1785
1784
|
widgetContext: f,
|
|
1786
1785
|
onActionClick: p
|
|
1787
|
-
}) : m === 0 ? null : J(a === "toolbar" ?
|
|
1786
|
+
}) : m === 0 ? null : J(a === "toolbar" ? wt : Ct, {
|
|
1788
1787
|
layout: e,
|
|
1789
1788
|
row: t,
|
|
1790
1789
|
rowSelection: n,
|
|
@@ -1802,94 +1801,94 @@ function Ct({ layout: e, row: t, rowSelection: n, onRun: r, reservedRightWidth:
|
|
|
1802
1801
|
}
|
|
1803
1802
|
//#endregion
|
|
1804
1803
|
//#region src/lib/filter-evaluator.ts
|
|
1805
|
-
var
|
|
1804
|
+
var Et = /* @__PURE__ */ new Set([
|
|
1806
1805
|
"string",
|
|
1807
1806
|
"text",
|
|
1808
1807
|
"rich_text",
|
|
1809
1808
|
"email",
|
|
1810
1809
|
"url",
|
|
1811
1810
|
"phone"
|
|
1812
|
-
]),
|
|
1811
|
+
]), Dt = /* @__PURE__ */ new Set([
|
|
1813
1812
|
"int",
|
|
1814
1813
|
"float",
|
|
1815
1814
|
"decimal"
|
|
1816
|
-
]),
|
|
1815
|
+
]), Ot = /* @__PURE__ */ new Set([
|
|
1817
1816
|
"date",
|
|
1818
1817
|
"timestamp",
|
|
1819
1818
|
"time"
|
|
1820
|
-
]),
|
|
1821
|
-
string:
|
|
1822
|
-
text:
|
|
1823
|
-
rich_text:
|
|
1824
|
-
email:
|
|
1825
|
-
url:
|
|
1826
|
-
phone:
|
|
1827
|
-
enum:
|
|
1828
|
-
int:
|
|
1829
|
-
float:
|
|
1830
|
-
decimal:
|
|
1831
|
-
date:
|
|
1832
|
-
timestamp:
|
|
1833
|
-
time:
|
|
1819
|
+
]), kt = /^(?:eq|not_eq|contains|starts_with|is_empty|is_not_empty)$/, At = /^(?:eq|not_eq|in|not_in|is_empty|is_not_empty)$/, jt = /^(?:eq|not_eq|gt|gte|lt|lte|between|is_empty|is_not_empty)$/, Mt = {
|
|
1820
|
+
string: kt,
|
|
1821
|
+
text: kt,
|
|
1822
|
+
rich_text: kt,
|
|
1823
|
+
email: kt,
|
|
1824
|
+
url: kt,
|
|
1825
|
+
phone: kt,
|
|
1826
|
+
enum: At,
|
|
1827
|
+
int: jt,
|
|
1828
|
+
float: jt,
|
|
1829
|
+
decimal: jt,
|
|
1830
|
+
date: jt,
|
|
1831
|
+
timestamp: jt,
|
|
1832
|
+
time: jt,
|
|
1834
1833
|
bool: /^(?:eq|is_empty)$/,
|
|
1835
1834
|
ref: /^(?:eq|not_eq|is_empty|is_not_empty)$/,
|
|
1836
1835
|
uuid: /^(?:eq|not_eq|is_empty|is_not_empty)$/
|
|
1837
1836
|
};
|
|
1838
|
-
function
|
|
1839
|
-
return e.every((e) =>
|
|
1837
|
+
function Nt(e, t, n) {
|
|
1838
|
+
return e.every((e) => Pt(e, t, n));
|
|
1840
1839
|
}
|
|
1841
|
-
function
|
|
1842
|
-
if (e.and) return e.and.every((e) =>
|
|
1843
|
-
if (e.or) return e.or.some((e) =>
|
|
1840
|
+
function Pt(e, t, n) {
|
|
1841
|
+
if (e.and) return e.and.every((e) => Pt(e, t, n));
|
|
1842
|
+
if (e.or) return e.or.some((e) => Pt(e, t, n));
|
|
1844
1843
|
if (!e.field || !e.op) return !1;
|
|
1845
1844
|
let r = t[e.field];
|
|
1846
|
-
return !r || !
|
|
1845
|
+
return !r || !Mt[r.type]?.test(e.op) ? !1 : Ft(e, r.type, n[e.field]);
|
|
1847
1846
|
}
|
|
1848
|
-
function
|
|
1849
|
-
let r =
|
|
1847
|
+
function Ft(e, t, n) {
|
|
1848
|
+
let r = It(n);
|
|
1850
1849
|
if (e.op === "is_empty") return r;
|
|
1851
1850
|
if (e.op === "is_not_empty") return !r;
|
|
1852
1851
|
if (r) return !1;
|
|
1853
1852
|
let i = e.value;
|
|
1854
1853
|
switch (e.op) {
|
|
1855
|
-
case "eq": return
|
|
1856
|
-
case "not_eq": return !
|
|
1857
|
-
case "in": return Array.isArray(i) && i.some((e) =>
|
|
1858
|
-
case "not_in": return Array.isArray(i) && i.every((e) =>
|
|
1854
|
+
case "eq": return Lt(t, n, i);
|
|
1855
|
+
case "not_eq": return !Lt(t, n, i) && Rt(t, n, i);
|
|
1856
|
+
case "in": return Array.isArray(i) && i.some((e) => Lt(t, n, e));
|
|
1857
|
+
case "not_in": return Array.isArray(i) && i.every((e) => Rt(t, n, e) && !Lt(t, n, e));
|
|
1859
1858
|
case "contains": return typeof n == "string" && typeof i == "string" && n.toLowerCase().includes(i.toLowerCase());
|
|
1860
1859
|
case "starts_with": return typeof n == "string" && typeof i == "string" && n.toLowerCase().startsWith(i.toLowerCase());
|
|
1861
|
-
case "gt": return
|
|
1862
|
-
case "gte": return
|
|
1863
|
-
case "lt": return
|
|
1864
|
-
case "lte": return
|
|
1860
|
+
case "gt": return zt(t, n, i, (e, t) => e > t);
|
|
1861
|
+
case "gte": return zt(t, n, i, (e, t) => e >= t);
|
|
1862
|
+
case "lt": return zt(t, n, i, (e, t) => e < t);
|
|
1863
|
+
case "lte": return zt(t, n, i, (e, t) => e <= t);
|
|
1865
1864
|
case "between": {
|
|
1866
1865
|
if (!Array.isArray(i) || i.length !== 2) return !1;
|
|
1867
|
-
let e =
|
|
1866
|
+
let e = Bt(t, n, i[0]), r = Bt(t, n, i[1]);
|
|
1868
1867
|
return e === void 0 || r === void 0 ? !1 : e >= 0 && r <= 0;
|
|
1869
1868
|
}
|
|
1870
1869
|
default: return !1;
|
|
1871
1870
|
}
|
|
1872
1871
|
}
|
|
1873
|
-
function
|
|
1872
|
+
function It(e) {
|
|
1874
1873
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
1875
1874
|
}
|
|
1876
|
-
function
|
|
1877
|
-
return
|
|
1875
|
+
function Lt(e, t, n) {
|
|
1876
|
+
return Rt(e, t, n) ? Ot.has(e) ? Bt(e, t, n) === 0 : t === n : !1;
|
|
1878
1877
|
}
|
|
1879
|
-
function
|
|
1880
|
-
return
|
|
1878
|
+
function Rt(e, t, n) {
|
|
1879
|
+
return Bt(e, t, n) !== void 0;
|
|
1881
1880
|
}
|
|
1882
|
-
function
|
|
1883
|
-
let i =
|
|
1881
|
+
function zt(e, t, n, r) {
|
|
1882
|
+
let i = Bt(e, t, n);
|
|
1884
1883
|
return i !== void 0 && r(i, 0);
|
|
1885
1884
|
}
|
|
1886
|
-
function
|
|
1887
|
-
if (
|
|
1888
|
-
if (
|
|
1889
|
-
if (
|
|
1885
|
+
function Bt(e, t, n) {
|
|
1886
|
+
if (Dt.has(e)) return typeof t != "number" || typeof n != "number" || !Number.isFinite(t) || !Number.isFinite(n) ? void 0 : t === n ? 0 : t < n ? -1 : 1;
|
|
1887
|
+
if (Ot.has(e)) return typeof t != "string" || typeof n != "string" || !Vt(e, t) || !Vt(e, n) ? void 0 : t === n ? 0 : t < n ? -1 : 1;
|
|
1888
|
+
if (Et.has(e) || e === "enum" || e === "ref" || e === "uuid") return typeof t != "string" || typeof n != "string" ? void 0 : t === n ? 0 : t < n ? -1 : 1;
|
|
1890
1889
|
if (e === "bool") return typeof t != "boolean" || typeof n != "boolean" ? void 0 : t === n ? 0 : t ? 1 : -1;
|
|
1891
1890
|
}
|
|
1892
|
-
function
|
|
1891
|
+
function Vt(e, t) {
|
|
1893
1892
|
switch (e) {
|
|
1894
1893
|
case "date": return /^\d{4}-\d{2}-\d{2}$/.test(t);
|
|
1895
1894
|
case "time": return /^\d{2}:\d{2}:\d{2}(?:\.\d+)?$/.test(t);
|
|
@@ -1899,23 +1898,23 @@ function zt(e, t) {
|
|
|
1899
1898
|
}
|
|
1900
1899
|
//#endregion
|
|
1901
1900
|
//#region src/lib/variants.ts
|
|
1902
|
-
function
|
|
1901
|
+
function Ht(e, t) {
|
|
1903
1902
|
let n = e.variants;
|
|
1904
1903
|
if (!n || n.length === 0) return;
|
|
1905
1904
|
let r = {};
|
|
1906
1905
|
for (let [t, n] of e.fields) r[t] = n;
|
|
1907
|
-
for (let [e, i] of n) if (e !== "default" && i.when &&
|
|
1906
|
+
for (let [e, i] of n) if (e !== "default" && i.when && Nt(i.when, r, t)) return e;
|
|
1908
1907
|
return n.has("default") ? "default" : void 0;
|
|
1909
1908
|
}
|
|
1910
|
-
function
|
|
1909
|
+
function Ut(e, t) {
|
|
1911
1910
|
let n = e?.variants;
|
|
1912
1911
|
if (!n || !n.items().some((e) => e.actions !== void 0)) return;
|
|
1913
|
-
let r =
|
|
1912
|
+
let r = Ht(e, t), i = n.get("default"), a = (r ? n.get(r)?.actions : void 0) ?? i?.actions ?? [];
|
|
1914
1913
|
return new Set(a);
|
|
1915
1914
|
}
|
|
1916
|
-
function
|
|
1915
|
+
function Wt(e, t) {
|
|
1917
1916
|
if (t.length === 0) return;
|
|
1918
|
-
let n = t.map((t) =>
|
|
1917
|
+
let n = t.map((t) => Ut(e, t));
|
|
1919
1918
|
if (n.every((e) => e === void 0)) return;
|
|
1920
1919
|
let r = n[0] ?? /* @__PURE__ */ new Set(), i = new Set(r);
|
|
1921
1920
|
for (let e of n.slice(1)) {
|
|
@@ -1927,18 +1926,18 @@ function Ht(e, t) {
|
|
|
1927
1926
|
}
|
|
1928
1927
|
return i;
|
|
1929
1928
|
}
|
|
1930
|
-
function
|
|
1929
|
+
function Gt(e, t, n) {
|
|
1931
1930
|
if (!t.variants || t.variants.length === 0) return;
|
|
1932
1931
|
if (e.variants) {
|
|
1933
|
-
let r =
|
|
1932
|
+
let r = Ht(e, n) ?? "default";
|
|
1934
1933
|
return t.variants.has(r) ? r : "default";
|
|
1935
1934
|
}
|
|
1936
1935
|
let r = {};
|
|
1937
1936
|
for (let [t, n] of e.fields) r[t] = n;
|
|
1938
|
-
for (let [e, i] of t.variants) if (e !== "default" && i.when &&
|
|
1937
|
+
for (let [e, i] of t.variants) if (e !== "default" && i.when && Nt(i.when, r, n)) return e;
|
|
1939
1938
|
return "default";
|
|
1940
1939
|
}
|
|
1941
|
-
var
|
|
1940
|
+
var Kt = [
|
|
1942
1941
|
"items",
|
|
1943
1942
|
"sidebar",
|
|
1944
1943
|
"sidebar_width",
|
|
@@ -1950,18 +1949,13 @@ var Wt = [
|
|
|
1950
1949
|
"card",
|
|
1951
1950
|
"quick_peek"
|
|
1952
1951
|
];
|
|
1953
|
-
function
|
|
1952
|
+
function qt(e, t, n) {
|
|
1954
1953
|
if (!e || !t?.variants) return t;
|
|
1955
|
-
let r =
|
|
1954
|
+
let r = Gt(e, t, n), i = r ? t.variants.get(r) : void 0;
|
|
1956
1955
|
if (!i) return t;
|
|
1957
1956
|
let a = { ...t };
|
|
1958
|
-
for (let e of
|
|
1957
|
+
for (let e of Kt) i[e] !== void 0 && (a[e] = i[e]);
|
|
1959
1958
|
return a;
|
|
1960
1959
|
}
|
|
1961
1960
|
//#endregion
|
|
1962
|
-
|
|
1963
|
-
function Kt(e, t, n, r, i) {
|
|
1964
|
-
return s(n) ? (a(e, n.ui_steps, r), null) : n.entity ? `${n.entity}.${t}` : i ? `${i}.${t}` : t;
|
|
1965
|
-
}
|
|
1966
|
-
//#endregion
|
|
1967
|
-
export { Z as C, oe as S, be as _, Ut as a, le as b, Ct as c, Re as d, ze as f, xe as g, Be as h, Bt as i, at as l, Ve as m, Ht as n, Vt as o, He as p, Gt as r, jt as s, Kt as t, Le as u, ye as v, ae as x, Q as y };
|
|
1961
|
+
export { oe as C, ae as S, xe as _, Ut as a, Q as b, st as c, Re as d, ze as f, Ve as g, Be as h, Gt as i, We as l, He as m, qt as n, Nt as o, Ue as p, Ht as r, Tt as s, Wt as t, Le as u, be as v, Z as w, le as x, ye as y };
|