@wssto2/vue-core 0.1.0 → 0.3.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/README.md +53 -9
- package/dist/AccessGate.vue_vue_type_script_setup_true_lang-DKX3PH2n.js +22 -0
- package/dist/AccountMenuItem.vue_vue_type_script_setup_true_lang-DIGqTLwd.js +76 -0
- package/dist/ActionRow.vue_vue_type_script_setup_true_lang-B7Lpfkf6.js +45 -0
- package/dist/Activity-DviO0VQ8.js +156 -0
- package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-CKghARkW.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-CvAnzdc1.js} +48 -47
- package/dist/{AlertDialog.vue_vue_type_script_setup_true_lang-BZb4qKXo.js → AlertDialog.vue_vue_type_script_setup_true_lang-CJsMUIUg.js} +2 -2
- package/dist/{AsyncSection.vue_vue_type_script_setup_true_lang-B82bl36A.js → AsyncSection.vue_vue_type_script_setup_true_lang-CCtthMRd.js} +4 -4
- package/dist/Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js +51 -0
- package/dist/{Banner.vue_vue_type_script_setup_true_lang-n_wGPIIu.js → Banner.vue_vue_type_script_setup_true_lang-Cib_YYpr.js} +1 -1
- package/dist/{BottomDock.vue_vue_type_script_setup_true_lang-DhlMnPC2.js → BottomDock.vue_vue_type_script_setup_true_lang-CjN7xYEr.js} +1 -1
- package/dist/Button.vue_vue_type_script_setup_true_lang-CYil8h9z.js +182 -0
- package/dist/Changes-DlT5mN9G.js +129 -0
- package/dist/CollectionPage.vue_vue_type_script_setup_true_lang-CXILftEc.js +1481 -0
- package/dist/CountryFlag.vue_vue_type_script_setup_true_lang-Kry_vPPZ.js +299 -0
- package/dist/DataTable.vue_vue_type_script_setup_true_lang-DSYgS9lC.js +52 -0
- package/dist/DateField.vue_vue_type_script_setup_true_lang-DMVjNsaM.js +1099 -0
- package/dist/{DiscardChangesModal.vue_vue_type_script_setup_true_lang-Bx5O1RZJ.js → DiscardChangesModal.vue_vue_type_script_setup_true_lang-Cb3xJI1x.js} +1 -1
- package/dist/{EmptyState.vue_vue_type_script_setup_true_lang-BeGpHMUP.js → EmptyState.vue_vue_type_script_setup_true_lang-C2ZYIT9F.js} +1 -1
- package/dist/FormErrors.vue_vue_type_script_setup_true_lang-DVgNBQ8p.js +276 -0
- package/dist/FormGroup.vue_vue_type_script_setup_true_lang-0mfG8TkU.js +136 -0
- package/dist/FormView.vue_vue_type_script_setup_true_lang-Bz2m3AtF.js +38 -0
- package/dist/General-BD-Hcz0a.js +145 -0
- package/dist/{Icon.vue_vue_type_script_lang-DtC4_mkz.js → Icon.vue_vue_type_script_lang-VvcV2Bzo.js} +46 -33
- package/dist/{IconTile.vue_vue_type_script_setup_true_lang-Csfv6Sel.js → IconTile.vue_vue_type_script_setup_true_lang-D7QgnUyN.js} +1 -1
- package/dist/KeyValue.vue_vue_type_script_setup_true_lang-wcZcvnow.js +35 -0
- package/dist/{LeaveGuardRoot.vue_vue_type_script_setup_true_lang-DH6EB8br.js → LeaveGuardRoot.vue_vue_type_script_setup_true_lang-C2udmeEA.js} +2 -2
- package/dist/{Menu.vue_vue_type_script_setup_true_lang-D44EHXQZ.js → Menu.vue_vue_type_script_setup_true_lang-BNAjx9tj.js} +61 -57
- package/dist/{Modal.vue_vue_type_script_setup_true_lang-DYQgaUtj.js → Modal.vue_vue_type_script_setup_true_lang-D7SwVPpL.js} +139 -129
- package/dist/NewRolePage-Dla4YnMs.js +42 -0
- package/dist/NoAccess.vue_vue_type_script_setup_true_lang-8m9cNptR.js +31 -0
- package/dist/NumberField.vue_vue_type_script_setup_true_lang-CYRg7Kfg.js +113 -0
- package/dist/OtpInput.vue_vue_type_script_setup_true_lang-gp4FfWAH.js +95 -0
- package/dist/PageBar.vue_vue_type_script_setup_true_lang-Cfr5xsJx.js +47 -0
- package/dist/{Panel.vue_vue_type_script_setup_true_lang-BQmv3cLb.js → Panel.vue_vue_type_script_setup_true_lang-BCRxRK4D.js} +1 -1
- package/dist/{PhotoViewer.vue_vue_type_script_setup_true_lang-DDVQXJRB.js → PhotoViewer.vue_vue_type_script_setup_true_lang-B3Q4dhqJ.js} +2 -2
- package/dist/Popover.vue_vue_type_script_setup_true_lang-Dx-tDhNE.js +125 -0
- package/dist/ProfilePage-OJMQ8cr8.js +691 -0
- package/dist/{ProgressTrack.vue_vue_type_script_setup_true_lang-1DDaNs2W.js → ProgressTrack.vue_vue_type_script_setup_true_lang-B6Prw9hi.js} +2 -2
- package/dist/RecordHeader.vue_vue_type_script_setup_true_lang-DKsaKlAq.js +64 -0
- package/dist/ResourcePage.vue_vue_type_script_setup_true_lang-CJcKa9SW.js +173 -0
- package/dist/RoleEditor.vue_vue_type_script_setup_true_lang-DuEPOmjI.js +299 -0
- package/dist/RolePage-bZzv_E4l.js +315 -0
- package/dist/RolesPage-BniZv0nB.js +115 -0
- package/dist/SectionIntro.vue_vue_type_script_setup_true_lang-CZtPrmXD.js +23 -0
- package/dist/SectionList.vue_vue_type_script_setup_true_lang-BKP_bge8.js +148 -0
- package/dist/SectionNavigator.vue_vue_type_script_setup_true_lang-BgGEGxSI.js +314 -0
- package/dist/SegmentedField.vue_vue_type_script_setup_true_lang-BZ9UdgA1.js +58 -0
- package/dist/SelectField.vue_vue_type_script_setup_true_lang-BiGaEKBQ.js +422 -0
- package/dist/SessionList.vue_vue_type_script_setup_true_lang-DUQpr7gb.js +111 -0
- package/dist/Sessions-Co5-xdeb.js +96 -0
- package/dist/Sheet.vue_vue_type_script_setup_true_lang-bHYzx7-J.js +142 -0
- package/dist/SignIn-BWwFbxki.js +140 -0
- package/dist/SignInPage-FnLtoi2q.js +60 -0
- package/dist/SignInTable.vue_vue_type_script_setup_true_lang-Dnx3T_42.js +79 -0
- package/dist/SignIns-3UcI64_h.js +66 -0
- package/dist/SwipeActions.vue_vue_type_script_setup_true_lang-4I8m27ol.js +93 -0
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-BeGaydRr.js +155 -0
- package/dist/TextField.vue_vue_type_script_setup_true_lang-C_FMf3Vc.js +269 -0
- package/dist/TextareaField.vue_vue_type_script_setup_true_lang-CU3KTKIJ.js +127 -0
- package/dist/{Timestamp.vue_vue_type_script_setup_true_lang-CSY_mMm1.js → Timestamp.vue_vue_type_script_setup_true_lang-1RJGKxbD.js} +1 -1
- package/dist/{Tooltip.vue_vue_type_script_setup_true_lang-BJWPVyfT.js → Tooltip.vue_vue_type_script_setup_true_lang-OOD_XNWx.js} +1 -1
- package/dist/UserRecord-Ci8HfwbX.js +267 -0
- package/dist/UsersList-vEJ-cgkT.js +155 -0
- package/dist/ViewTabs.vue_vue_type_script_setup_true_lang-ByqTU2JT.js +28 -0
- package/dist/access/AddRoleDialog.vue.d.ts +19 -0
- package/dist/access/BindingRow.vue.d.ts +19 -0
- package/dist/access/EffectiveAccess.vue.d.ts +12 -0
- package/dist/access/NewRolePage.vue.d.ts +2 -0
- package/dist/access/PermissionTree.vue.d.ts +13 -0
- package/dist/access/PersonAccess.vue.d.ts +21 -0
- package/dist/access/ReplaceRoleDialog.vue.d.ts +17 -0
- package/dist/access/RoleCompareDialog.vue.d.ts +14 -0
- package/dist/access/RoleEditor.vue.d.ts +28 -0
- package/dist/access/RolePage.vue.d.ts +2 -0
- package/dist/access/RolesPage.vue.d.ts +2 -0
- package/dist/access/api.d.ts +26 -0
- package/dist/access/catalogue.d.ts +64 -0
- package/dist/access/context.d.ts +20 -0
- package/dist/access/effective.d.ts +42 -0
- package/dist/access/feature.d.ts +27 -0
- package/dist/access/index.d.ts +13 -0
- package/dist/access/index.js +15 -0
- package/dist/access/labels.d.ts +35 -0
- package/dist/access/refusals.d.ts +6 -0
- package/dist/access/routes.d.ts +45 -0
- package/dist/access/scopes.d.ts +20 -0
- package/dist/app/application.d.ts +5 -0
- package/dist/app/contributions.d.ts +1 -1
- package/dist/app/environment.d.ts +2 -0
- package/dist/app/feature.d.ts +8 -0
- package/dist/app/index.js +260 -294
- package/dist/bottomDock-BZEiOPYZ.js +12 -0
- package/dist/button/Button.vue.d.ts +3 -3
- package/dist/button/index.d.ts +1 -1
- package/dist/button/index.js +5 -3
- package/dist/button/shortcut.d.ts +28 -2
- package/dist/chrome-BS3xJcad.js +93 -0
- package/dist/client/client.d.ts +13 -0
- package/dist/client/index.d.ts +3 -1
- package/dist/client/index.js +19 -138
- package/dist/client/route.d.ts +59 -0
- package/dist/client-Bw0aM5Gu.js +147 -0
- package/dist/closeOverlays-CjVsIrpL.js +8 -0
- package/dist/collection/CollectionPage.vue.d.ts +1 -0
- package/dist/collection/CollectionRows.vue.d.ts +59 -0
- package/dist/collection/CollectionTable.vue.d.ts +1 -1
- package/dist/collection/DataTable.vue.d.ts +47 -0
- package/dist/collection/RowActions.vue.d.ts +19 -0
- package/dist/collection/columns.d.ts +2 -0
- package/dist/collection/http.d.ts +4 -2
- package/dist/collection/index.d.ts +4 -2
- package/dist/collection/index.js +87 -2299
- package/dist/collection/rowLayout.d.ts +10 -0
- package/dist/collection/slots.d.ts +6 -3
- package/dist/content/index.js +37 -66
- package/dist/contributions-CDDg3fKp.js +26 -0
- package/dist/controls/DateButton.vue.d.ts +1 -1
- package/dist/controls/PopupButton.vue.d.ts +1 -1
- package/dist/controls/index.js +11 -10
- package/dist/defineRoutes-BGAdiIrt.js +19 -0
- package/dist/describeError-Ctga6GcS.js +41 -0
- package/dist/dialogStack-DZZg55w0.js +31 -0
- package/dist/environment-Dva-SG8D.js +6 -0
- package/dist/{error-Bb_dr_Ay.js → error-CD7x0Jrz.js} +2 -2
- package/dist/feature-DdUAfyi4.js +25 -0
- package/dist/fieldMessages-C3Rpbktw.js +25 -0
- package/dist/form/CheckboxField.vue.d.ts +1 -1
- package/dist/form/CommandDialog.vue.d.ts +13 -2
- package/dist/form/DateField.vue.d.ts +1 -1
- package/dist/form/DateTimeField.vue.d.ts +1 -1
- package/dist/form/EditorPage.vue.d.ts +1 -1
- package/dist/form/Field.vue.d.ts +1 -1
- package/dist/form/FileField.vue.d.ts +1 -1
- package/dist/form/FormGroup.vue.d.ts +1 -1
- package/dist/form/FormGroupButton.vue.d.ts +1 -1
- package/dist/form/FormRow.vue.d.ts +1 -1
- package/dist/form/I18nField.vue.d.ts +3 -3
- package/dist/form/MoneyField.vue.d.ts +1 -1
- package/dist/form/MonthYearField.vue.d.ts +1 -1
- package/dist/form/MultiSelectField.vue.d.ts +4 -1
- package/dist/form/NumberCell.vue.d.ts +1 -1
- package/dist/form/NumberField.vue.d.ts +8 -2
- package/dist/form/OptionList.vue.d.ts +6 -2
- package/dist/form/OtpInput.vue.d.ts +2 -2
- package/dist/form/PhotoField.vue.d.ts +1 -1
- package/dist/form/SelectField.vue.d.ts +4 -1
- package/dist/form/SwitchField.vue.d.ts +1 -1
- package/dist/form/TextField.vue.d.ts +3 -3
- package/dist/form/TextareaField.vue.d.ts +3 -3
- package/dist/form/TimeField.vue.d.ts +1 -1
- package/dist/form/date/DatePickerSheet.vue.d.ts +1 -1
- package/dist/form/date/MonthYearPanel.vue.d.ts +1 -1
- package/dist/form/index.d.ts +2 -0
- package/dist/form/index.js +1273 -3509
- package/dist/form/suggestions.d.ts +11 -0
- package/dist/form/useOptions.d.ts +60 -0
- package/dist/guards-Cd1V28oG.js +51 -0
- package/dist/http-DGGSKWvU.js +193 -0
- package/dist/i18n/describeError.d.ts +31 -0
- package/dist/i18n/index.d.ts +307 -0
- package/dist/i18n/index.js +54 -52
- package/dist/icon/core.d.ts +13 -0
- package/dist/icon/index.js +1 -1
- package/dist/identity/ImpersonationBanner.vue.d.ts +2 -0
- package/dist/identity/LocaleSync.vue.d.ts +2 -0
- package/dist/identity/SessionExpiry.vue.d.ts +2 -0
- package/dist/identity/SignInAsButton.vue.d.ts +15 -0
- package/dist/identity/SignInPage.vue.d.ts +2 -0
- package/dist/identity/context.d.ts +7 -0
- package/dist/identity/feature.d.ts +16 -0
- package/dist/identity/fieldMessages.d.ts +15 -0
- package/dist/identity/index.d.ts +16 -0
- package/dist/identity/index.js +18 -0
- package/dist/identity/profile/DetailsPanel.vue.d.ts +11 -0
- package/dist/identity/profile/EmailChangeDialog.vue.d.ts +14 -0
- package/dist/identity/profile/EmailPanel.vue.d.ts +11 -0
- package/dist/identity/profile/PanelActions.vue.d.ts +17 -0
- package/dist/identity/profile/PasswordPanel.vue.d.ts +2 -0
- package/dist/identity/profile/ProfileMenuItem.vue.d.ts +2 -0
- package/dist/identity/profile/ProfilePage.vue.d.ts +2 -0
- package/dist/identity/profile/SessionsPanel.vue.d.ts +2 -0
- package/dist/identity/profile/SignInsPanel.vue.d.ts +2 -0
- package/dist/identity/profile/VerifyCode.vue.d.ts +49 -0
- package/dist/identity/profile/routes.d.ts +13 -0
- package/dist/identity/session.d.ts +30 -0
- package/dist/identity/shared/ActionRow.vue.d.ts +20 -0
- package/dist/identity/shared/ChangeFeed.vue.d.ts +11 -0
- package/dist/identity/shared/PageBar.vue.d.ts +12 -0
- package/dist/identity/shared/SectionIntro.vue.d.ts +16 -0
- package/dist/identity/shared/SessionList.vue.d.ts +19 -0
- package/dist/{phone/CountryFlag.vue.d.ts → identity/shared/SignInTable.vue.d.ts} +5 -4
- package/dist/identity/shared/ViewTabs.vue.d.ts +23 -0
- package/dist/identity/shared/signInEvents.d.ts +9 -0
- package/dist/identity/signIn.d.ts +27 -0
- package/dist/identity/useSignInForm.d.ts +20 -0
- package/dist/identity/user.d.ts +6 -0
- package/dist/identity/users/DeactivateDialog.vue.d.ts +18 -0
- package/dist/identity/users/NewUserDialog.vue.d.ts +9 -0
- package/dist/identity/users/SetPasswordDialog.vue.d.ts +16 -0
- package/dist/identity/users/UserRecord.vue.d.ts +2 -0
- package/dist/identity/users/UsersList.vue.d.ts +2 -0
- package/dist/identity/users/access.d.ts +4 -0
- package/dist/identity/users/context.d.ts +9 -0
- package/dist/identity/users/feature.d.ts +34 -0
- package/dist/identity/users/languages.d.ts +4 -0
- package/dist/identity/users/list.d.ts +8 -0
- package/dist/identity/users/person.d.ts +26 -0
- package/dist/identity/users/personSections.d.ts +22 -0
- package/dist/identity/users/routes.d.ts +22 -0
- package/dist/identity/users/sections/Activity.vue.d.ts +2 -0
- package/dist/identity/users/sections/Changes.vue.d.ts +2 -0
- package/dist/identity/users/sections/General.vue.d.ts +2 -0
- package/dist/identity/users/sections/Sessions.vue.d.ts +2 -0
- package/dist/identity/users/sections/SignIn.vue.d.ts +2 -0
- package/dist/identity/users/sections/SignIns.vue.d.ts +2 -0
- package/dist/identity/users/status.d.ts +4 -0
- package/dist/index-B2dbYZR9.js +706 -0
- package/dist/index-BAcl44SC.js +459 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/CountryFlag.vue.d.ts +10 -0
- package/dist/internal/languageName.d.ts +2 -0
- package/dist/keepAlive-WYQGRhuz.js +48 -0
- package/dist/languageName-CItV_SOv.js +11 -0
- package/dist/languages-BShG9LpE.js +10 -0
- package/dist/leaveGuard-Cc8yeLxM.js +72 -0
- package/dist/modal/Modal.vue.d.ts +4 -0
- package/dist/modal/ShortcutHelp.vue.d.ts +2 -0
- package/dist/modal/index.d.ts +2 -0
- package/dist/modal/index.js +64 -6
- package/dist/modal/placement.d.ts +22 -0
- package/dist/modules/access/entities.d.ts +112 -0
- package/dist/modules/access/routes.d.ts +67 -0
- package/dist/modules/access/schemas.d.ts +73 -0
- package/dist/modules/identity/entities.d.ts +150 -0
- package/dist/modules/identity/routes.d.ts +118 -0
- package/dist/modules/identity/schemas.d.ts +145 -0
- package/dist/{navigation-B33ikiCS.js → navigation-BPWa63ge.js} +21 -20
- package/dist/neighbors-D0WRBxXI.js +86 -0
- package/dist/{options-CjSz2dQK.js → options-BXkMR63B.js} +48 -49
- package/dist/overlay/AlertDialog.vue.d.ts +3 -3
- package/dist/overlay/Popover.vue.d.ts +4 -1
- package/dist/overlay/closeOverlays.d.ts +7 -0
- package/dist/overlay/dialogStack.d.ts +9 -0
- package/dist/overlay/index.d.ts +1 -1
- package/dist/overlay/index.js +20 -18
- package/dist/page/AdaptivePageShell.vue.d.ts +2 -2
- package/dist/page/ResourceHeader.vue.d.ts +2 -2
- package/dist/page/index.js +99 -457
- package/dist/phone/PhoneField.vue.d.ts +2 -2
- package/dist/phone/index.js +247 -540
- package/dist/platform/AccessGate.vue.d.ts +50 -0
- package/dist/platform/index.d.ts +4 -2
- package/dist/platform/index.js +38 -35
- package/dist/platform/platform.d.ts +2 -2
- package/dist/platform/session.d.ts +22 -1
- package/dist/platform-hunMqFdB.js +255 -0
- package/dist/resource/index.js +8 -248
- package/dist/routeResource-DstM0hvf.js +82 -0
- package/dist/router/guards.d.ts +7 -1
- package/dist/router/index.js +23 -37
- package/dist/router/navigation.d.ts +1 -1
- package/dist/rowLayout-BI7a3Kom.js +603 -0
- package/dist/sectionIndex-BS0ic5W7.js +86 -0
- package/dist/{sections-LtxV5Mtk.js → sections-BEqW1dOc.js} +1 -1
- package/dist/shell/AccountMenuItem.vue.d.ts +4 -1
- package/dist/shell/BackofficeShell.vue.d.ts +2 -2
- package/dist/shell/ShellBrand.vue.d.ts +1 -1
- package/dist/shell/backofficeShell.d.ts +1 -1
- package/dist/shell/identity.d.ts +1 -1
- package/dist/shell/index.js +476 -532
- package/dist/state/Badge.vue.d.ts +17 -10
- package/dist/state/ProgressTrack.vue.d.ts +1 -1
- package/dist/state/hue.d.ts +8 -0
- package/dist/state/index.d.ts +2 -0
- package/dist/state/index.js +34 -31
- package/dist/state/useLoad.d.ts +41 -0
- package/dist/status-C9aXR-Jb.js +33 -0
- package/dist/styles.css +1 -1
- package/dist/suggestions-BJAqOj4c.js +138 -0
- package/dist/testing/app.d.ts +61 -0
- package/dist/testing/async.d.ts +12 -0
- package/dist/testing/collection.d.ts +18 -0
- package/dist/testing/format.d.ts +9 -0
- package/dist/testing/i18n.d.ts +16 -0
- package/dist/testing/index.d.ts +14 -0
- package/dist/testing/index.js +178 -0
- package/dist/testing/media.d.ts +23 -0
- package/dist/testing/platform.d.ts +40 -0
- package/dist/testing/transport.d.ts +40 -0
- package/dist/toast-D9Z5To38.js +13 -0
- package/dist/useCommand-BgRwnYlV.js +135 -0
- package/dist/{useDialog-wmyNx2j_.js → useDialog-CXR3hN0G.js} +1 -1
- package/dist/useLoad-CYRVx6HW.js +39 -0
- package/dist/useResourceForm-Bgc9jMcu.js +52 -0
- package/dist/useSaveChrome-chi6D3HY.js +25 -0
- package/dist/useSheetDrag-OsD6Eb6I.js +72 -0
- package/package.json +26 -5
- package/src/styles/theme.css +60 -0
- package/dist/Badge.vue_vue_type_script_setup_true_lang-DKc6ugmr.js +0 -31
- package/dist/Button.vue_vue_type_script_setup_true_lang-3f0emVNU.js +0 -141
- package/dist/NoAccess.vue_vue_type_script_setup_true_lang-OKW8pKYU.js +0 -78
- package/dist/SectionList.vue_vue_type_script_setup_true_lang-DGcKX_OJ.js +0 -230
- package/dist/SelectField.vue_vue_type_script_setup_true_lang-SyFWE33A.js +0 -422
- package/dist/Sheet.vue_vue_type_script_setup_true_lang-BLBD5ps8.js +0 -210
- package/dist/SwipeActions.vue_vue_type_script_setup_true_lang-CGTuEnTv.js +0 -243
- package/dist/chrome-D9pwD6iS.js +0 -101
- package/dist/dialogStack-DiTG1rZc.js +0 -26
- package/dist/environment-D3nozt9a.js +0 -75
- package/dist/feature-DyDtyMLU.js +0 -47
- package/dist/platform-jqlKVJ2e.js +0 -244
- package/dist/toast-BTeX0r66.js +0 -129
- /package/dist/{phone → internal}/flagLoaders.d.ts +0 -0
package/dist/collection/index.js
CHANGED
|
@@ -1,2323 +1,111 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { _
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import { _ as Nt } from "../Badge.vue_vue_type_script_setup_true_lang-DKc6ugmr.js";
|
|
17
|
-
import { _ as It } from "../Timestamp.vue_vue_type_script_setup_true_lang-CSY_mMm1.js";
|
|
18
|
-
import { _ as ht, t as je } from "../toast-BTeX0r66.js";
|
|
19
|
-
import { _ as Ft, a as qt } from "../SelectField.vue_vue_type_script_setup_true_lang-SyFWE33A.js";
|
|
20
|
-
import { _ as Dt } from "../Sheet.vue_vue_type_script_setup_true_lang-BLBD5ps8.js";
|
|
21
|
-
const Ut = [5, 8, 10, 15, 25, 50, 100], et = 25;
|
|
22
|
-
function us(t) {
|
|
23
|
-
const e = `defineCollection("${t.id}")`;
|
|
24
|
-
if (typeof t.id != "string" || t.id.trim() === "") throw new Error("defineCollection: `id` must be a non-empty string.");
|
|
25
|
-
if (!Number.isInteger(t.stateVersion) || t.stateVersion < 1) throw new Error(`${e}: \`stateVersion\` must be a positive integer.`);
|
|
26
|
-
if (typeof t.load != "function") throw new Error(`${e}: \`load\` must be a function.`);
|
|
27
|
-
if (typeof t.key != "function") throw new Error(`${e}: \`key\` must be a function.`);
|
|
28
|
-
const l = {
|
|
29
|
-
sorts: t.query?.sorts ? [...t.query.sorts] : null,
|
|
30
|
-
filters: t.query?.filters ? [...t.query.filters] : null,
|
|
31
|
-
views: t.query?.views ? [...t.query.views] : null,
|
|
32
|
-
sensitive: [...t.query?.sensitive ?? []],
|
|
33
|
-
pageSizes: [...t.query?.pageSizes ?? Ut]
|
|
1
|
+
import { D as M, L as O, a as V, h as j, l as U, r as G } from "../http-DGGSKWvU.js";
|
|
2
|
+
import { _ as Z, a as q, u as H } from "../CollectionPage.vue_vue_type_script_setup_true_lang-CXILftEc.js";
|
|
3
|
+
import { u as K } from "../neighbors-D0WRBxXI.js";
|
|
4
|
+
import { a as W, b as Y } from "../rowLayout-BI7a3Kom.js";
|
|
5
|
+
import { _ as te } from "../DataTable.vue_vue_type_script_setup_true_lang-DSYgS9lC.js";
|
|
6
|
+
import { defineComponent as y, openBlock as c, createElementBlock as d, Fragment as h, renderList as v, createBlock as k, unref as u, withCtx as C, normalizeClass as m, createVNode as p, createCommentVNode as g } from "vue";
|
|
7
|
+
import { _ } from "../Icon.vue_vue_type_script_lang-VvcV2Bzo.js";
|
|
8
|
+
import { _ as w } from "../Tooltip.vue_vue_type_script_setup_true_lang-OOD_XNWx.js";
|
|
9
|
+
import { useI18n as E } from "vue-i18n";
|
|
10
|
+
function R(r = {}) {
|
|
11
|
+
const s = new Map(Object.entries(r).map(([t, e]) => [t, [...e]]));
|
|
12
|
+
let n = 1;
|
|
13
|
+
const o = (t) => {
|
|
14
|
+
let e = s.get(t);
|
|
15
|
+
return e || s.set(t, e = []), e;
|
|
34
16
|
};
|
|
35
|
-
if (l.pageSizes.length === 0 || l.pageSizes.some((x) => !Number.isInteger(x) || x < 1))
|
|
36
|
-
throw new Error(`${e}: \`query.pageSizes\` must list positive integers.`);
|
|
37
|
-
for (const x of l.sensitive)
|
|
38
|
-
if (l.filters && !l.filters.includes(x)) throw new Error(`${e}: sensitive filter "${x}" is not in \`query.filters\`.`);
|
|
39
|
-
const s = t.defaults ?? {}, r = s.pageSize ?? (l.pageSizes.includes(et) ? et : l.pageSizes[0]);
|
|
40
|
-
if (!l.pageSizes.includes(r)) throw new Error(`${e}: default page size ${r} is not one of ${l.pageSizes.join(", ")}.`);
|
|
41
|
-
const a = s.sort ?? null;
|
|
42
|
-
if (a !== null && l.sorts && !l.sorts.includes(a)) throw new Error(`${e}: default sort "${a}" is not in \`query.sorts\`.`);
|
|
43
|
-
const c = s.view ?? null;
|
|
44
|
-
if (c !== null && l.views && !l.views.includes(c)) throw new Error(`${e}: default view "${c}" is not in \`query.views\`.`);
|
|
45
|
-
const f = Object.fromEntries(Object.entries(s.filters ?? {}).filter(([, x]) => x !== void 0 && x !== ""));
|
|
46
|
-
for (const x of Object.keys(f))
|
|
47
|
-
if (l.filters && !l.filters.includes(x)) throw new Error(`${e}: default filter "${x}" is not in \`query.filters\`.`);
|
|
48
|
-
const b = s.page ?? 1;
|
|
49
|
-
if (!Number.isInteger(b) || b < 1) throw new Error(`${e}: default page must be a positive integer.`);
|
|
50
|
-
const v = s.direction ?? "asc";
|
|
51
|
-
if (v !== "asc" && v !== "desc") throw new Error(`${e}: default direction must be "asc" or "desc".`);
|
|
52
|
-
return Object.freeze({
|
|
53
|
-
id: t.id,
|
|
54
|
-
stateVersion: t.stateVersion,
|
|
55
|
-
load: t.load,
|
|
56
|
-
key: t.key,
|
|
57
|
-
defaults: Object.freeze({
|
|
58
|
-
page: b,
|
|
59
|
-
pageSize: r,
|
|
60
|
-
sort: a,
|
|
61
|
-
direction: v,
|
|
62
|
-
search: s.search ?? "",
|
|
63
|
-
view: c,
|
|
64
|
-
filters: Object.freeze(f)
|
|
65
|
-
}),
|
|
66
|
-
contract: Object.freeze(l),
|
|
67
|
-
migrate: t.migrate
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
const ye = (t) => t == null || t === "";
|
|
71
|
-
function yt(t) {
|
|
72
|
-
if (!t) return [null, null];
|
|
73
|
-
const [e = "", l = ""] = String(t).split(",");
|
|
74
|
-
return [e.trim() || null, l.trim() || null];
|
|
75
|
-
}
|
|
76
|
-
function Bt(t, e) {
|
|
77
|
-
const l = ye(t) ? "" : String(t), s = ye(e) ? "" : String(e);
|
|
78
|
-
return l === "" && s === "" ? null : `${l},${s}`;
|
|
79
|
-
}
|
|
80
|
-
function Ht(t, e) {
|
|
81
|
-
const l = ye(e) ? null : new Set(String(e).split(",")), s = (t.options ?? []).filter(
|
|
82
|
-
(a) => !t.dependsOn || !l || a.parentValue !== void 0 && l.has(String(a.parentValue))
|
|
83
|
-
), r = /* @__PURE__ */ new Map();
|
|
84
|
-
for (const a of s) {
|
|
85
|
-
const c = r.get(a.label) ?? [], f = String(a.value);
|
|
86
|
-
c.includes(f) || c.push(f), r.set(a.label, c);
|
|
87
|
-
}
|
|
88
|
-
return [...r.entries()].map(([a, c]) => ({ label: a, value: c.join(",") }));
|
|
89
|
-
}
|
|
90
|
-
function Kt(t, e, l) {
|
|
91
|
-
if (ye(e)) return null;
|
|
92
|
-
if (t.type === "range") {
|
|
93
|
-
const [r, a] = yt(String(e)), c = t.unit ? ` ${t.unit}` : "", f = (b) => `${t.unit ? l.formatNumber(Number(b)) : b}${c}`;
|
|
94
|
-
return r !== null && a !== null ? `${f(r)} – ${f(a)}` : r !== null ? `${l.from.toLowerCase()} ${f(r)}` : a !== null ? `${l.until.toLowerCase()} ${f(a)}` : null;
|
|
95
|
-
}
|
|
96
|
-
const s = new Set(String(e).split(","));
|
|
97
|
-
return (t.options ?? []).find((r) => s.has(String(r.value)))?.label ?? String(e);
|
|
98
|
-
}
|
|
99
|
-
function _t(t, e, l) {
|
|
100
|
-
const s = new Set(t.map((c) => c.key)), r = (c) => t.find((f) => f.dependsOn === c), a = [];
|
|
101
|
-
for (const c of t.filter((f) => !f.dependsOn || !s.has(f.dependsOn))) {
|
|
102
|
-
const f = [];
|
|
103
|
-
for (let v = c; v && !f.includes(v); v = r(v.key)) f.push(v);
|
|
104
|
-
const b = f.map((v) => ({ filter: v, value: Kt(v, e[v.key], l) })).filter((v) => v.value !== null);
|
|
105
|
-
b.length !== 0 && a.push({
|
|
106
|
-
key: c.key,
|
|
107
|
-
label: b.length === 1 ? b[0].filter.label : null,
|
|
108
|
-
values: b.map((v) => v.value),
|
|
109
|
-
clears: f.map((v) => v.key)
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
return a;
|
|
113
|
-
}
|
|
114
|
-
function Xt(t, e) {
|
|
115
|
-
return t.filter((l) => !ye(e[l.key])).length;
|
|
116
|
-
}
|
|
117
|
-
const ze = "from";
|
|
118
|
-
function Gt(t, e) {
|
|
119
|
-
if (typeof t == "string") {
|
|
120
|
-
const l = new URLSearchParams(e).toString(), s = t.indexOf("#"), r = s === -1 ? t : t.slice(0, s);
|
|
121
|
-
return `${r}${r.includes("?") ? "&" : "?"}${l}${s === -1 ? "" : t.slice(s)}`;
|
|
122
|
-
}
|
|
123
|
-
return { ...t, query: { ...t.query, ...e } };
|
|
124
|
-
}
|
|
125
|
-
function wt(t) {
|
|
126
|
-
if (!dt()) return;
|
|
127
|
-
const e = ft(Tt, null);
|
|
128
|
-
e && Ae(
|
|
129
|
-
() => {
|
|
130
|
-
const l = e.session.state.value;
|
|
131
|
-
return l.status === "authenticated" ? l.user.id : null;
|
|
132
|
-
},
|
|
133
|
-
t,
|
|
134
|
-
{ flush: "sync" }
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
const Jt = 4096, Wt = 200, Yt = 32, Qt = 1e6, qe = /^[A-Za-z0-9_.-]{1,64}$/;
|
|
138
|
-
function Zt(t) {
|
|
139
|
-
let e = "";
|
|
140
|
-
for (const l of new TextEncoder().encode(t)) e += String.fromCharCode(l);
|
|
141
|
-
return btoa(e).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
142
|
-
}
|
|
143
|
-
function el(t) {
|
|
144
|
-
const e = t.replace(/-/g, "+").replace(/_/g, "/"), l = atob(e.padEnd(Math.ceil(e.length / 4) * 4, "="));
|
|
145
|
-
return new TextDecoder("utf-8", { fatal: !0 }).decode(Uint8Array.from(l, (s) => s.charCodeAt(0)));
|
|
146
|
-
}
|
|
147
|
-
const Be = (t) => typeof t == "object" && t !== null && !Array.isArray(t);
|
|
148
|
-
function Oe(t, e = Wt) {
|
|
149
|
-
return typeof t == "string" && t.length <= e ? t : null;
|
|
150
|
-
}
|
|
151
|
-
function tt(t, e) {
|
|
152
|
-
const { defaults: l, contract: s } = t, r = typeof e.p == "number" && Number.isInteger(e.p) && e.p >= 1 && e.p <= Qt ? e.p : l.page, a = typeof e.l == "number" && s.pageSizes.includes(e.l) ? e.l : l.pageSize;
|
|
153
|
-
let c = l.sort;
|
|
154
|
-
const f = Oe(e.c, 64);
|
|
155
|
-
f !== null && (s.sorts ? s.sorts.includes(f) : qe.test(f)) && (c = f);
|
|
156
|
-
const b = e.d === "asc" || e.d === "desc" ? e.d : l.direction, v = Oe(e.s) ?? l.search;
|
|
157
|
-
let x = l.view;
|
|
158
|
-
const S = Oe(e.w, 64);
|
|
159
|
-
S !== null && (s.views ? s.views.includes(S) : qe.test(S)) && (x = S);
|
|
160
|
-
const D = Be(e.f) ? {} : { ...l.filters };
|
|
161
|
-
if (Be(e.f)) {
|
|
162
|
-
let P = 0;
|
|
163
|
-
for (const [j, A] of Object.entries(e.f)) {
|
|
164
|
-
if (++P > Yt) break;
|
|
165
|
-
if (!(s.filters ? s.filters.includes(j) : qe.test(j)) || s.sensitive.includes(j)) continue;
|
|
166
|
-
const k = typeof A == "number" || typeof A == "boolean" ? String(A) : Oe(A);
|
|
167
|
-
k !== null && k !== "" && (D[j] = k);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
return { page: r, pageSize: a, sort: c, direction: b, search: v, view: x, filters: D };
|
|
171
|
-
}
|
|
172
|
-
function Pe(t, e) {
|
|
173
|
-
const l = { v: t.stateVersion, p: e.page, l: e.pageSize };
|
|
174
|
-
e.sort && (l.c = e.sort), l.d = e.direction, e.search && (l.s = e.search), e.view && (l.w = e.view);
|
|
175
|
-
const s = Object.fromEntries(
|
|
176
|
-
Object.entries(e.filters).filter(([r, a]) => a !== void 0 && a !== "" && !t.contract.sensitive.includes(r))
|
|
177
|
-
);
|
|
178
|
-
return (Object.keys(s).length > 0 || Object.keys(t.defaults.filters).length > 0) && (l.f = s), Zt(JSON.stringify(l));
|
|
179
|
-
}
|
|
180
|
-
function kt(t, e) {
|
|
181
|
-
const l = e.v === void 0 ? t.stateVersion : e.v;
|
|
182
|
-
if (typeof l != "number" || !Number.isInteger(l)) return null;
|
|
183
|
-
if (l === t.stateVersion) return tt(t, e);
|
|
184
|
-
const s = t.migrate?.(e, l);
|
|
185
|
-
return s ? tt(t, s) : null;
|
|
186
|
-
}
|
|
187
|
-
function He(t, e) {
|
|
188
|
-
if (typeof e != "string" || e === "" || e.length > Jt) return null;
|
|
189
|
-
let l;
|
|
190
|
-
try {
|
|
191
|
-
l = JSON.parse(el(e));
|
|
192
|
-
} catch {
|
|
193
|
-
return null;
|
|
194
|
-
}
|
|
195
|
-
return Be(l) ? kt(t, l) : null;
|
|
196
|
-
}
|
|
197
|
-
function tl(t) {
|
|
198
|
-
return JSON.stringify([
|
|
199
|
-
t.page,
|
|
200
|
-
t.pageSize,
|
|
201
|
-
t.sort,
|
|
202
|
-
t.direction,
|
|
203
|
-
t.search,
|
|
204
|
-
t.view,
|
|
205
|
-
Object.entries(t.filters).sort(([e], [l]) => e.localeCompare(l))
|
|
206
|
-
]);
|
|
207
|
-
}
|
|
208
|
-
const lt = /* @__PURE__ */ new WeakMap();
|
|
209
|
-
function ll(t, e, l, s) {
|
|
210
|
-
let r = lt.get(t);
|
|
211
|
-
r || lt.set(t, r = /* @__PURE__ */ new Map());
|
|
212
|
-
const a = `${l}\0${s}`, c = r.get(a);
|
|
213
|
-
if (c && c.id !== e)
|
|
214
|
-
throw new Error(
|
|
215
|
-
`useCollection("${e}"): the URL state key "${s}" is already used by the list "${c.id}" on this page. Two lists on one page each need their own \`state: { kind: "url", key }\`, or they overwrite each other's state.`
|
|
216
|
-
);
|
|
217
|
-
const f = c ?? { id: e, count: 0 };
|
|
218
|
-
return f.count++, r.set(a, f), () => {
|
|
219
|
-
--f.count <= 0 && r.delete(a);
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
const De = (t) => t.status === "loaded" || t.status === "refreshing" || t.status === "stale", ot = (t) => t instanceof Error && t.message !== "" ? t.message : String(t);
|
|
223
|
-
function ds(t, e) {
|
|
224
|
-
const l = `useCollection("${t.id}")`, s = e.state;
|
|
225
|
-
let r = null, a = "", c = "", f = () => {
|
|
226
|
-
};
|
|
227
|
-
if (s.kind === "url") {
|
|
228
|
-
if (r = dt() ? ft(Et, null) : null, !r) throw new Error(`${l}: a URL state needs the application's router. Call it while a component is being set up, with the router installed, or use \`state: { kind: "memory" }\`.`);
|
|
229
|
-
if (!s.key) throw new Error(`${l}: \`state.key\` must not be empty.`);
|
|
230
|
-
c = s.key, a = r.currentRoute.value.path, f = ll(r, t.id, a, c);
|
|
231
|
-
}
|
|
232
|
-
const b = (() => {
|
|
233
|
-
if (!r) return t.defaults;
|
|
234
|
-
const o = r.currentRoute.value.query[c];
|
|
235
|
-
return He(t, Array.isArray(o) ? o[0] : o) ?? t.defaults;
|
|
236
|
-
})(), v = $e(b), x = $e({ status: "loading" }), S = $e(null), D = $e(null), P = _(() => De(x.value) ? x.value.value : D.value);
|
|
237
|
-
let j = !1, A = null, U = 0, k = !1;
|
|
238
|
-
const R = [];
|
|
239
|
-
r && e.linked && H(r.currentRoute.value.query, e.linked);
|
|
240
|
-
function H(o, u) {
|
|
241
|
-
let V = v.value;
|
|
242
|
-
const X = (ee) => {
|
|
243
|
-
const G = o[ee], fe = Array.isArray(G) ? G[0] : G;
|
|
244
|
-
return typeof fe == "string" && fe !== "" ? fe : null;
|
|
245
|
-
};
|
|
246
|
-
if (u.view) {
|
|
247
|
-
const ee = X(u.view), G = ee !== null && (t.contract.views ? t.contract.views.includes(ee) : !0);
|
|
248
|
-
ee !== null && G && (V = { ...V, view: ee, page: 1 }, R.push(u.view));
|
|
249
|
-
}
|
|
250
|
-
for (const [ee, G] of Object.entries(u.params ?? {})) {
|
|
251
|
-
const fe = X(ee);
|
|
252
|
-
if (fe === null) continue;
|
|
253
|
-
const K = typeof G == "string" ? G : G.filter, Q = typeof G == "string" ? fe : G.value(fe), se = { ...V.filters };
|
|
254
|
-
Q === null || Q === "any" || Q === "" ? delete se[K] : se[K] = String(Q), V = { ...V, filters: se, page: 1 }, R.push(ee);
|
|
255
|
-
}
|
|
256
|
-
if (R.length > 0) {
|
|
257
|
-
for (const ee of u.consume ?? []) ee in o && R.push(ee);
|
|
258
|
-
v.value = V;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
async function Y(o) {
|
|
262
|
-
if (j) return;
|
|
263
|
-
A?.abort();
|
|
264
|
-
const u = ++U, V = A = new AbortController(), X = x.value, ee = v.value;
|
|
265
|
-
x.value = o && De(X) ? { status: "refreshing", value: X.value } : { status: "loading" };
|
|
266
|
-
try {
|
|
267
|
-
const G = await t.load(ee, { signal: V.signal });
|
|
268
|
-
if (u !== U) return;
|
|
269
|
-
if (G.lastPage >= 1 && ee.page > G.lastPage) {
|
|
270
|
-
v.value = { ...ee, page: G.lastPage }, N(), Y(!1);
|
|
271
|
-
return;
|
|
272
|
-
}
|
|
273
|
-
S.value = null, D.value = G, x.value = { status: "loaded", value: G };
|
|
274
|
-
} catch (G) {
|
|
275
|
-
if (u !== U || V.signal.aborted || Me(G)) return;
|
|
276
|
-
S.value = G, x.value = o && De(X) ? { status: "stale", value: X.value, error: ot(G) } : { status: "failed", error: ot(G) };
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
function F() {
|
|
280
|
-
N(), !(k || j) && (k = !0, queueMicrotask(() => {
|
|
281
|
-
k && (k = !1, Y(!1));
|
|
282
|
-
}));
|
|
283
|
-
}
|
|
284
|
-
function re() {
|
|
285
|
-
return k = !1, Y(!0);
|
|
286
|
-
}
|
|
287
|
-
let te = !1, C = !1, T = !1;
|
|
288
|
-
function N() {
|
|
289
|
-
!r || te || j || (te = !0, queueMicrotask(() => {
|
|
290
|
-
te = !1, E();
|
|
291
|
-
}));
|
|
292
|
-
}
|
|
293
|
-
async function E() {
|
|
294
|
-
if (r) {
|
|
295
|
-
if (C) {
|
|
296
|
-
T = !0;
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
299
|
-
C = !0;
|
|
300
|
-
try {
|
|
301
|
-
do {
|
|
302
|
-
T = !1;
|
|
303
|
-
const o = r.currentRoute.value;
|
|
304
|
-
if (j || o.path !== a) return;
|
|
305
|
-
const u = Pe(t, v.value), V = { ...o.query };
|
|
306
|
-
for (const X of R.splice(0)) delete V[X];
|
|
307
|
-
o.query[c] === u && Object.keys(V).length === Object.keys(o.query).length || await r.replace({ query: { ...V, [c]: u }, hash: o.hash });
|
|
308
|
-
} while (T);
|
|
309
|
-
} catch {
|
|
310
|
-
} finally {
|
|
311
|
-
C = !1;
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
const z = r ? Ae(
|
|
316
|
-
() => r.currentRoute.value.query[c],
|
|
317
|
-
(o) => {
|
|
318
|
-
const u = r.currentRoute.value;
|
|
319
|
-
if (j || C || u.path !== a) return;
|
|
320
|
-
const V = Array.isArray(o) ? o[0] : o, X = He(t, V) ?? t.defaults;
|
|
321
|
-
JSON.stringify(X) !== JSON.stringify(v.value) ? (v.value = X, F()) : N();
|
|
322
|
-
}
|
|
323
|
-
) : () => {
|
|
324
|
-
}, q = (o, u = !1) => {
|
|
325
|
-
v.value = { ...v.value, ...o, ...u ? { page: 1 } : {} }, F();
|
|
326
|
-
}, de = (o) => {
|
|
327
|
-
const u = { ...v.value.filters };
|
|
328
|
-
for (const [V, X] of Object.entries(o))
|
|
329
|
-
X == null || ye(X) ? delete u[V] : u[V] = String(X);
|
|
330
|
-
return u;
|
|
331
|
-
}, me = _(() => v.value.search !== "" || Object.values(v.value.filters).some((o) => !ye(o))), ve = _(() => P.value?.rows ?? []), ae = _(() => {
|
|
332
|
-
const o = x.value;
|
|
333
|
-
return o.status === "loading" ? "loading" : o.status === "failed" ? "failed" : o.value.rows.length > 0 ? "rows" : me.value ? "no-matches" : "empty";
|
|
334
|
-
}), ge = _(() => {
|
|
335
|
-
const o = new Map((P.value?.views ?? []).map((u) => [u.key, u.count]));
|
|
336
|
-
return (Ie(e.views) ?? []).map((u) => o.has(u.key) ? { ...u, count: o.get(u.key) } : u);
|
|
337
|
-
});
|
|
338
|
-
let oe = () => {
|
|
339
|
-
};
|
|
340
|
-
const ie = e.savedViews ? h(e.savedViews) : null;
|
|
341
|
-
function ce(o) {
|
|
342
|
-
const u = { v: o.state.version, f: o.state.filters, s: o.state.search, w: o.state.view ?? void 0 };
|
|
343
|
-
return kt(t, u);
|
|
344
|
-
}
|
|
345
|
-
function h(o) {
|
|
346
|
-
const u = ue([]), V = ue("idle");
|
|
347
|
-
let X = null;
|
|
348
|
-
const ee = (K, Q) => K.name.localeCompare(Q.name), G = _(() => u.value.filter((K) => ce(K) !== null));
|
|
349
|
-
oe = () => {
|
|
350
|
-
X?.abort(), u.value = [], V.value = "idle";
|
|
351
|
-
};
|
|
352
|
-
const fe = () => ({
|
|
353
|
-
version: t.stateVersion,
|
|
354
|
-
filters: Object.fromEntries(Object.entries(v.value.filters).filter(([K, Q]) => Q !== void 0 && !t.contract.sensitive.includes(K))),
|
|
355
|
-
search: v.value.search,
|
|
356
|
-
view: v.value.view
|
|
357
|
-
});
|
|
358
|
-
return {
|
|
359
|
-
items: G,
|
|
360
|
-
status: V,
|
|
361
|
-
async load() {
|
|
362
|
-
X?.abort();
|
|
363
|
-
const K = X = new AbortController();
|
|
364
|
-
V.value = "loading";
|
|
365
|
-
try {
|
|
366
|
-
const Q = await o.list(t.id, { signal: K.signal });
|
|
367
|
-
if (K.signal.aborted) return;
|
|
368
|
-
u.value = [...Q].sort(ee), V.value = "ready";
|
|
369
|
-
} catch (Q) {
|
|
370
|
-
if (K.signal.aborted || Me(Q)) return;
|
|
371
|
-
V.value = "failed";
|
|
372
|
-
}
|
|
373
|
-
},
|
|
374
|
-
current: fe,
|
|
375
|
-
async save(K, Q) {
|
|
376
|
-
const se = await o.save(t.id, K, { ...fe(), ...Q });
|
|
377
|
-
return u.value = [...u.value.filter((Ee) => Ee.id !== se.id), se].sort(ee), se;
|
|
378
|
-
},
|
|
379
|
-
apply(K) {
|
|
380
|
-
const Q = ce(K);
|
|
381
|
-
Q && q({ filters: Q.filters, search: Q.search, view: K.state.view ? Q.view : v.value.view }, !0);
|
|
382
|
-
},
|
|
383
|
-
stageRemoval(K) {
|
|
384
|
-
const Q = u.value.find((se) => se.id === K) ?? null;
|
|
385
|
-
return u.value = u.value.filter((se) => se.id !== K), {
|
|
386
|
-
revert() {
|
|
387
|
-
Q && !u.value.some((se) => se.id === K) && (u.value = [...u.value, Q].sort(ee));
|
|
388
|
-
},
|
|
389
|
-
// Saved again under the same name while the toast was up: the server replaced that very row, it must not be deleted now.
|
|
390
|
-
async commit() {
|
|
391
|
-
u.value.some((se) => se.id === K) || await o.remove(t.id, K);
|
|
392
|
-
}
|
|
393
|
-
};
|
|
394
|
-
}
|
|
395
|
-
};
|
|
396
|
-
}
|
|
397
|
-
function w() {
|
|
398
|
-
j || (j = !0, A?.abort(), U++, z(), f());
|
|
399
|
-
}
|
|
400
|
-
return Ke() && Xe(w), wt((o) => {
|
|
401
|
-
A?.abort(), U++, x.value = { status: "loading" }, D.value = null, S.value = null, oe(), o !== null && F();
|
|
402
|
-
}), F(), {
|
|
403
|
-
id: t.id,
|
|
404
|
-
pageSizes: t.contract.pageSizes,
|
|
405
|
-
rowKey: (o) => t.key(o),
|
|
406
|
-
state: x,
|
|
407
|
-
query: v,
|
|
408
|
-
page: P,
|
|
409
|
-
rows: ve,
|
|
410
|
-
total: _(() => P.value?.total ?? 0),
|
|
411
|
-
display: ae,
|
|
412
|
-
isFiltered: me,
|
|
413
|
-
error: S,
|
|
414
|
-
columns: _(() => {
|
|
415
|
-
const o = Ie(e.columns) ?? [], u = t.contract.sorts;
|
|
416
|
-
if (u) {
|
|
417
|
-
for (const V of o) if (V.sort !== void 0 && !u.includes(V.sort)) throw new Error(`${l}: column "${V.key}" sorts by "${V.sort}", which is not in the query contract's sorts (${u.join(", ")}).`);
|
|
418
|
-
}
|
|
419
|
-
return o;
|
|
420
|
-
}),
|
|
421
|
-
filters: _(() => Ie(e.filters) ?? []),
|
|
422
|
-
views: ge,
|
|
423
|
-
savedViews: ie,
|
|
424
|
-
refresh: re,
|
|
425
|
-
goToPage: (o) => {
|
|
426
|
-
Number.isInteger(o) && o >= 1 && o !== v.value.page && q({ page: o });
|
|
427
|
-
},
|
|
428
|
-
nextPage: () => {
|
|
429
|
-
const o = P.value?.lastPage ?? 0;
|
|
430
|
-
v.value.page < o && q({ page: v.value.page + 1 });
|
|
431
|
-
},
|
|
432
|
-
previousPage: () => {
|
|
433
|
-
v.value.page > 1 && q({ page: v.value.page - 1 });
|
|
434
|
-
},
|
|
435
|
-
setPageSize: (o) => {
|
|
436
|
-
t.contract.pageSizes.includes(o) && o !== v.value.pageSize && q({ pageSize: o }, !0);
|
|
437
|
-
},
|
|
438
|
-
sortBy: (o, u = "asc") => {
|
|
439
|
-
if (t.contract.sorts && !t.contract.sorts.includes(o)) throw new Error(`${l}: "${o}" is not in the query contract's sorts.`);
|
|
440
|
-
q({ sort: o, direction: u });
|
|
441
|
-
},
|
|
442
|
-
toggleSort: (o) => {
|
|
443
|
-
const u = v.value;
|
|
444
|
-
q({ sort: o, direction: u.sort === o && u.direction === "asc" ? "desc" : "asc" });
|
|
445
|
-
},
|
|
446
|
-
search: (o) => q({ search: o }, !0),
|
|
447
|
-
setFilter: (o, u) => q({ filters: de({ [o]: u }) }, !0),
|
|
448
|
-
setFilters: (o) => q({ filters: de(o) }, !0),
|
|
449
|
-
clearFilters: () => q({ filters: {}, search: "" }, !0),
|
|
450
|
-
setView: (o) => q({ view: o }, !0),
|
|
451
|
-
reset: () => {
|
|
452
|
-
v.value = t.defaults, F();
|
|
453
|
-
},
|
|
454
|
-
recordLocation: (o) => {
|
|
455
|
-
const u = e.recordRoute?.(o);
|
|
456
|
-
return u ? r ? Gt(u, { [ze]: Pe(t, v.value) }) : u : null;
|
|
457
|
-
},
|
|
458
|
-
linkContext: () => r ? { [ze]: Pe(t, v.value) } : {}
|
|
459
|
-
};
|
|
460
|
-
}
|
|
461
|
-
const Le = (t) => typeof t == "object" && t !== null && !Array.isArray(t), xe = (...t) => {
|
|
462
|
-
for (const e of t) if (typeof e == "number" && Number.isFinite(e)) return e;
|
|
463
|
-
return null;
|
|
464
|
-
};
|
|
465
|
-
function ol(t) {
|
|
466
|
-
return {
|
|
467
|
-
// Filters first: the reserved names below always win, a filter called "page" cannot break paging.
|
|
468
|
-
...t.filters,
|
|
469
|
-
page: t.page,
|
|
470
|
-
per_page: t.pageSize,
|
|
471
|
-
order_col: t.sort,
|
|
472
|
-
order_dir: t.sort ? t.direction : null,
|
|
473
|
-
search: t.search,
|
|
474
|
-
view: t.view
|
|
475
|
-
};
|
|
476
|
-
}
|
|
477
|
-
function nl(t, e) {
|
|
478
|
-
const l = t.data, s = Le(l) && Array.isArray(l.data), r = Array.isArray(l) ? l : s ? l.data : [], a = s ? l : {}, c = Le(t.meta) ? t.meta : Le(a.meta) ? a.meta : {}, f = xe(a.per_page, c.per_page) ?? e.pageSize, b = xe(a.total, c.total) ?? r.length, v = xe(a.current_page, c.page, c.current_page) ?? e.page, x = xe(a.last_page, c.last_page) ?? (b === 0 ? 0 : Math.ceil(b / Math.max(1, f))), S = xe(a.from, c.from) ?? (r.length === 0 ? 0 : (v - 1) * f + 1), D = xe(a.to, c.to) ?? (r.length === 0 ? 0 : S + r.length - 1), P = Array.isArray(c.views) ? c.views : Array.isArray(a.views) ? a.views : void 0;
|
|
479
17
|
return {
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
page: v,
|
|
483
|
-
pageSize: f,
|
|
484
|
-
lastPage: x,
|
|
485
|
-
from: S,
|
|
486
|
-
to: D,
|
|
487
|
-
views: P?.filter(Le).flatMap((j) => typeof j.key == "string" ? [{ key: j.key, count: xe(j.count) ?? void 0 }] : []),
|
|
488
|
-
meta: c,
|
|
489
|
-
requestId: t.requestId
|
|
490
|
-
};
|
|
491
|
-
}
|
|
492
|
-
function fs(t, e, l = {}) {
|
|
493
|
-
return async (s, { signal: r }) => {
|
|
494
|
-
const a = await t.get(e, { query: l.params ? l.params(s) : ol(s), signal: r });
|
|
495
|
-
return nl(a, s);
|
|
496
|
-
};
|
|
497
|
-
}
|
|
498
|
-
const sl = 8;
|
|
499
|
-
function ps(t, e) {
|
|
500
|
-
const l = jt(), s = e.from ?? (() => typeof l.query[ze] == "string" ? l.query[ze] : null), r = e.stateKey ?? "query", a = ue(null), c = ue(0), f = $e(null), b = $e(null), v = ue(!1), x = $e(null), S = /* @__PURE__ */ new Map();
|
|
501
|
-
let D = 0, P = new AbortController(), j = !1;
|
|
502
|
-
function A(F, re, te) {
|
|
503
|
-
const C = { ...F, page: re }, T = tl(C);
|
|
504
|
-
let N = S.get(T);
|
|
505
|
-
for (N ? S.delete(T) : (N = (async () => t.load(C, { signal: te }))(), N.catch(() => {
|
|
506
|
-
S.get(T) === N && S.delete(T);
|
|
507
|
-
})), S.set(T, N); S.size > sl; ) S.delete(S.keys().next().value);
|
|
508
|
-
return N.catch((E) => {
|
|
509
|
-
if (Me(E)) throw E;
|
|
510
|
-
return null;
|
|
511
|
-
});
|
|
512
|
-
}
|
|
513
|
-
function U() {
|
|
514
|
-
a.value = null, f.value = null, b.value = null, c.value = 0, x.value = null;
|
|
515
|
-
}
|
|
516
|
-
async function k() {
|
|
517
|
-
const F = ++D, re = P.signal, te = He(t, s()), C = e.current();
|
|
518
|
-
if (!te || C === null || C === void 0 || C === "") {
|
|
519
|
-
U(), v.value = !1;
|
|
520
|
-
return;
|
|
521
|
-
}
|
|
522
|
-
v.value = !0, f.value = null, b.value = null;
|
|
523
|
-
const T = (E) => E ? E.rows.findIndex((z) => String(t.key(z)) === String(C)) : -1, N = (E, z) => {
|
|
524
|
-
const q = Pe(t, { ...te, page: E });
|
|
525
|
-
return { key: z, to: { name: l.name ?? void 0, params: { ...l.params, [e.param]: String(z) }, query: { ...l.query, [ze]: q }, hash: l.hash } };
|
|
526
|
-
};
|
|
527
|
-
try {
|
|
528
|
-
let E = te.page, z = await A(te, E, re), q = T(z);
|
|
529
|
-
for (const oe of [E - 1, E + 1]) {
|
|
530
|
-
if (q !== -1 || !z || oe < 1 || oe > z.lastPage) continue;
|
|
531
|
-
const ie = await A(te, oe, re), ce = T(ie);
|
|
532
|
-
ie && ce !== -1 && (E = oe, z = ie, q = ce);
|
|
533
|
-
}
|
|
534
|
-
if (F !== D) return;
|
|
535
|
-
if (!z || q === -1) {
|
|
536
|
-
U();
|
|
537
|
-
return;
|
|
538
|
-
}
|
|
539
|
-
const de = z.pageSize || te.pageSize, me = z.rows;
|
|
540
|
-
let ve = null;
|
|
541
|
-
if (q > 0) ve = N(E, t.key(me[q - 1]));
|
|
542
|
-
else if (E > 1) {
|
|
543
|
-
const oe = await A(te, E - 1, re), ie = oe?.rows[oe.rows.length - 1];
|
|
544
|
-
ie !== void 0 && (ve = N(E - 1, t.key(ie)));
|
|
545
|
-
}
|
|
546
|
-
let ae = null;
|
|
547
|
-
if (q < me.length - 1) ae = N(E, t.key(me[q + 1]));
|
|
548
|
-
else if (E < z.lastPage) {
|
|
549
|
-
const ie = (await A(te, E + 1, re))?.rows[0];
|
|
550
|
-
ie !== void 0 && (ae = N(E + 1, t.key(ie)));
|
|
551
|
-
}
|
|
552
|
-
if (F !== D) return;
|
|
553
|
-
c.value = z.total, a.value = (E - 1) * de + q + 1, f.value = ve, b.value = ae;
|
|
554
|
-
const ge = e.list;
|
|
555
|
-
x.value = typeof ge == "string" ? ge : { ...ge, query: { ...ge.query, [r]: Pe(t, { ...te, page: E }) } };
|
|
556
|
-
} catch (E) {
|
|
557
|
-
if (!Me(E)) throw E;
|
|
558
|
-
} finally {
|
|
559
|
-
F === D && (v.value = !1);
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
const R = Ae([s, e.current], k, { immediate: !0 });
|
|
563
|
-
function H() {
|
|
564
|
-
j || (j = !0, D++, P.abort(), R(), S.clear());
|
|
565
|
-
}
|
|
566
|
-
return Ke() && Xe(H), wt(() => {
|
|
567
|
-
P.abort(), P = new AbortController(), S.clear(), k();
|
|
568
|
-
}), { position: a, total: c, previous: f, next: b, loading: v, listRoute: x, context: {
|
|
569
|
-
get back() {
|
|
570
|
-
return { label: typeof e.backLabel == "function" ? e.backLabel() : e.backLabel, to: x.value ?? e.list };
|
|
18
|
+
async list(t) {
|
|
19
|
+
return [...o(t)];
|
|
571
20
|
},
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
} };
|
|
576
|
-
}
|
|
577
|
-
function vs(t = {}) {
|
|
578
|
-
const e = new Map(Object.entries(t).map(([r, a]) => [r, [...a]]));
|
|
579
|
-
let l = 1;
|
|
580
|
-
const s = (r) => {
|
|
581
|
-
let a = e.get(r);
|
|
582
|
-
return a || e.set(r, a = []), a;
|
|
583
|
-
};
|
|
584
|
-
return {
|
|
585
|
-
async list(r) {
|
|
586
|
-
return [...s(r)];
|
|
587
|
-
},
|
|
588
|
-
async save(r, a, c) {
|
|
589
|
-
const f = s(r), b = f.findIndex((x) => x.name === a), v = { id: b === -1 ? `view-${l++}` : f[b].id, name: a, state: c };
|
|
590
|
-
return b === -1 ? f.push(v) : f[b] = v, v;
|
|
21
|
+
async save(t, e, i) {
|
|
22
|
+
const a = o(t), l = a.findIndex((x) => x.name === e), f = { id: l === -1 ? `view-${n++}` : a[l].id, name: e, state: i };
|
|
23
|
+
return l === -1 ? a.push(f) : a[l] = f, f;
|
|
591
24
|
},
|
|
592
|
-
async remove(
|
|
593
|
-
const
|
|
594
|
-
|
|
25
|
+
async remove(t, e) {
|
|
26
|
+
const i = o(t), a = i.findIndex((l) => l.id === e);
|
|
27
|
+
a !== -1 && i.splice(a, 1);
|
|
595
28
|
}
|
|
596
29
|
};
|
|
597
30
|
}
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
const rl = { class: "flex min-w-0 flex-col" }, il = {
|
|
605
|
-
key: 1,
|
|
606
|
-
class: "truncate text-row-title"
|
|
607
|
-
}, cl = ["data-row-click-ignore"], nt = "rounded-sm bg-status-warning-surface text-status-warning-content", st = /* @__PURE__ */ we({
|
|
608
|
-
__name: "RecordIdentity",
|
|
31
|
+
const S = {
|
|
32
|
+
key: 0,
|
|
33
|
+
class: "flex items-center justify-center gap-1",
|
|
34
|
+
"data-test": "row-actions"
|
|
35
|
+
}, T = ["href", "target", "rel", "aria-label", "data-action"], A = ["aria-label", "data-action", "disabled", "onClick"], b = "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus", $ = /* @__PURE__ */ y({
|
|
36
|
+
__name: "RowActions",
|
|
609
37
|
props: {
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
to: { default: null },
|
|
613
|
-
subtitleSelectable: { type: Boolean, default: !1 },
|
|
614
|
-
highlight: { default: null }
|
|
38
|
+
actions: {},
|
|
39
|
+
disabled: { type: Boolean, default: !1 }
|
|
615
40
|
},
|
|
616
|
-
setup(
|
|
617
|
-
const
|
|
618
|
-
return (
|
|
619
|
-
|
|
620
|
-
key:
|
|
621
|
-
|
|
622
|
-
|
|
41
|
+
setup(r) {
|
|
42
|
+
const s = r, n = (o) => o.tone === "critical" ? "text-status-danger-content hover:bg-status-danger-surface" : "text-content-link hover:bg-tint-soft";
|
|
43
|
+
return (o, t) => s.actions.length > 0 ? (c(), d("div", S, [
|
|
44
|
+
(c(!0), d(h, null, v(s.actions, (e) => (c(), k(u(w), {
|
|
45
|
+
key: e.key,
|
|
46
|
+
text: e.label,
|
|
47
|
+
side: "left"
|
|
623
48
|
}, {
|
|
624
|
-
default:
|
|
625
|
-
|
|
626
|
-
a.match ? (i(), d("mark", {
|
|
627
|
-
key: 0,
|
|
628
|
-
class: le(nt)
|
|
629
|
-
}, y(a.text), 1)) : (i(), d(I, { key: 1 }, [
|
|
630
|
-
ne(y(a.text), 1)
|
|
631
|
-
], 64))
|
|
632
|
-
], 64))), 128))
|
|
633
|
-
]),
|
|
634
|
-
_: 1
|
|
635
|
-
}, 8, ["to"])) : (i(), d("span", il, [
|
|
636
|
-
(i(!0), d(I, null, Z(l.value, (a, c) => (i(), d(I, { key: c }, [
|
|
637
|
-
a.match ? (i(), d("mark", {
|
|
49
|
+
default: C(() => [
|
|
50
|
+
e.href && !s.disabled ? (c(), d("a", {
|
|
638
51
|
key: 0,
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
e.subtitle ? (i(), d("span", {
|
|
646
|
-
key: 2,
|
|
647
|
-
"data-row-click-ignore": e.subtitleSelectable ? "" : void 0,
|
|
648
|
-
class: le(["truncate text-row-subtitle", { "w-fit cursor-text select-text": e.subtitleSelectable }])
|
|
649
|
-
}, y(e.subtitle), 11, cl)) : L("", !0)
|
|
650
|
-
]));
|
|
651
|
-
}
|
|
652
|
-
});
|
|
653
|
-
function xt(t, e) {
|
|
654
|
-
let l = t;
|
|
655
|
-
for (const s of String(e).split(".")) {
|
|
656
|
-
if (typeof l != "object" || l === null) return;
|
|
657
|
-
l = l[s];
|
|
658
|
-
}
|
|
659
|
-
return l;
|
|
660
|
-
}
|
|
661
|
-
const ul = {
|
|
662
|
-
key: 0,
|
|
663
|
-
class: "flex items-center gap-3"
|
|
664
|
-
}, dl = ["datetime"], fl = {
|
|
665
|
-
key: 2,
|
|
666
|
-
class: "tabular-nums"
|
|
667
|
-
}, pl = {
|
|
668
|
-
key: 3,
|
|
669
|
-
class: "tabular-nums"
|
|
670
|
-
}, Te = /* @__PURE__ */ we({
|
|
671
|
-
__name: "CollectionCell",
|
|
672
|
-
props: {
|
|
673
|
-
column: {},
|
|
674
|
-
item: {},
|
|
675
|
-
compact: { type: Boolean },
|
|
676
|
-
to: {},
|
|
677
|
-
search: {}
|
|
678
|
-
},
|
|
679
|
-
setup(t) {
|
|
680
|
-
const e = t, l = Ve(), s = _(() => xt(e.item, e.column.key)), r = _(() => s.value), a = _(() => s.value === null || s.value === void 0 ? "" : String(s.value)), c = _(() => typeof s.value == "number" ? s.value : typeof s.value == "string" && s.value.trim() !== "" ? Number(s.value) : null);
|
|
681
|
-
return (f, b) => e.column.kind === "identity" ? (i(), d(I, { key: 0 }, [
|
|
682
|
-
!e.compact && f.$slots.leading ? (i(), d("div", ul, [
|
|
683
|
-
pe(f.$slots, "leading"),
|
|
684
|
-
O(st, {
|
|
685
|
-
to: e.to,
|
|
686
|
-
title: e.column.title?.(e.item) ?? a.value,
|
|
687
|
-
subtitle: e.column.subtitle?.(e.item),
|
|
688
|
-
highlight: e.search,
|
|
689
|
-
"subtitle-selectable": ""
|
|
690
|
-
}, null, 8, ["to", "title", "subtitle", "highlight"])
|
|
691
|
-
])) : (i(), W(st, {
|
|
692
|
-
key: 1,
|
|
693
|
-
to: e.to,
|
|
694
|
-
title: e.column.title?.(e.item) ?? a.value,
|
|
695
|
-
subtitle: e.column.subtitle?.(e.item),
|
|
696
|
-
highlight: e.search,
|
|
697
|
-
"subtitle-selectable": ""
|
|
698
|
-
}, null, 8, ["to", "title", "subtitle", "highlight"]))
|
|
699
|
-
], 64)) : e.column.kind === "timestamp" ? (i(), d(I, { key: 1 }, [
|
|
700
|
-
e.compact && r.value ? (i(), d("time", {
|
|
701
|
-
key: 0,
|
|
702
|
-
class: "tabular-nums",
|
|
703
|
-
datetime: String(s.value)
|
|
704
|
-
}, y(e.column.precision === "date" ? n(l).date(r.value) : n(l).dateTime(r.value)), 9, dl)) : e.compact ? L("", !0) : (i(), W(n(It), {
|
|
705
|
-
key: 1,
|
|
706
|
-
value: r.value,
|
|
707
|
-
precision: e.column.precision ?? "dateTime"
|
|
708
|
-
}, null, 8, ["value", "precision"]))
|
|
709
|
-
], 64)) : e.column.kind === "number" ? (i(), d("span", fl, y(n(l).number(c.value, e.column.format)), 1)) : e.column.kind === "money" ? (i(), d("span", pl, y(n(l).money(c.value, typeof e.column.currency == "function" ? e.column.currency(e.item) : e.column.currency)), 1)) : e.column.kind === "badge" ? (i(), W(n(Nt), {
|
|
710
|
-
key: 4,
|
|
711
|
-
tone: e.column.tone(e.item),
|
|
712
|
-
dot: ""
|
|
713
|
-
}, {
|
|
714
|
-
default: B(() => [
|
|
715
|
-
ne(y(e.column.text?.(e.item) ?? a.value), 1)
|
|
716
|
-
]),
|
|
717
|
-
_: 1
|
|
718
|
-
}, 8, ["tone"])) : (i(), d(I, { key: 5 }, [
|
|
719
|
-
ne(y(a.value), 1)
|
|
720
|
-
], 64));
|
|
721
|
-
}
|
|
722
|
-
}), vl = {
|
|
723
|
-
class: "mx-auto max-w-xl py-8 text-center",
|
|
724
|
-
"data-test": "collection-empty-filtered"
|
|
725
|
-
}, ml = { class: "mt-3 mb-1 text-headline font-semibold text-content-strong" }, gl = { class: "text-sm text-content-muted" }, bl = { class: "mt-4 flex flex-wrap justify-center gap-2" }, hl = {
|
|
726
|
-
key: 0,
|
|
727
|
-
class: "shrink-0 text-content-muted"
|
|
728
|
-
}, yl = ["title"], _l = ["aria-label", "onClick"], wl = { class: "mt-5 flex flex-wrap justify-center gap-2" }, at = /* @__PURE__ */ we({
|
|
729
|
-
__name: "CollectionEmptyResult",
|
|
730
|
-
props: {
|
|
731
|
-
chips: {},
|
|
732
|
-
lastChip: {}
|
|
733
|
-
},
|
|
734
|
-
emits: ["remove", "clearAll"],
|
|
735
|
-
setup(t, { emit: e }) {
|
|
736
|
-
const l = t, s = e, { t: r } = Ce();
|
|
737
|
-
return (a, c) => (i(), d("div", vl, [
|
|
738
|
-
O(n(J), {
|
|
739
|
-
name: "filter3",
|
|
740
|
-
size: 32,
|
|
741
|
-
class: "mx-auto text-content-disabled"
|
|
742
|
-
}),
|
|
743
|
-
p("h3", ml, y(n(r)("core.collection.empty.title")), 1),
|
|
744
|
-
p("p", gl, y(n(r)("core.collection.empty.description")), 1),
|
|
745
|
-
p("ul", bl, [
|
|
746
|
-
(i(!0), d(I, null, Z(l.chips, (f) => (i(), d("li", {
|
|
747
|
-
key: f.key,
|
|
748
|
-
class: "inline-flex h-7 max-w-full min-w-0 items-center gap-1.5 rounded-control bg-surface-cell pr-0.5 pl-2.5 text-sm shadow-group ring-1 ring-inset ring-border-separator"
|
|
749
|
-
}, [
|
|
750
|
-
f.label ? (i(), d("span", hl, y(f.label), 1)) : L("", !0),
|
|
751
|
-
p("span", {
|
|
752
|
-
class: "min-w-0 truncate font-medium text-content-strong",
|
|
753
|
-
title: f.values.join(" › ")
|
|
754
|
-
}, y(f.values.join(" › ")), 9, yl),
|
|
755
|
-
p("button", {
|
|
756
|
-
type: "button",
|
|
757
|
-
class: "shrink-0 cursor-pointer rounded p-1 text-content-disabled hover:bg-fill hover:text-content-strong",
|
|
758
|
-
"aria-label": `${n(r)("core.collection.clear")}: ${f.label ?? f.values.join(" › ")}`,
|
|
759
|
-
onClick: (b) => s("remove", f)
|
|
52
|
+
href: e.href,
|
|
53
|
+
target: e.external ? "_blank" : void 0,
|
|
54
|
+
rel: e.external ? "noopener" : void 0,
|
|
55
|
+
"aria-label": e.label,
|
|
56
|
+
"data-action": e.key,
|
|
57
|
+
class: m(["inline-flex rounded-md p-1.5 transition-colors", [n(e), b]])
|
|
760
58
|
}, [
|
|
761
|
-
|
|
762
|
-
name:
|
|
763
|
-
size:
|
|
764
|
-
})
|
|
765
|
-
],
|
|
766
|
-
]))), 128))
|
|
767
|
-
]),
|
|
768
|
-
p("div", wl, [
|
|
769
|
-
l.lastChip ? (i(), W(he, Se({ key: 0 }, { "data-test": "collection-empty-remove-last" }, {
|
|
770
|
-
prominence: "secondary",
|
|
771
|
-
size: "sm",
|
|
772
|
-
onClick: c[0] || (c[0] = (f) => s("remove", l.lastChip))
|
|
773
|
-
}), {
|
|
774
|
-
default: B(() => [
|
|
775
|
-
ne(y(n(r)("core.collection.empty.remove_last", { filter: l.lastChip.values.join(" › ") })), 1)
|
|
776
|
-
]),
|
|
777
|
-
_: 1
|
|
778
|
-
}, 16)) : L("", !0),
|
|
779
|
-
O(he, Se({ "data-test": "collection-empty-clear-all" }, {
|
|
780
|
-
size: "sm",
|
|
781
|
-
onClick: c[1] || (c[1] = (f) => s("clearAll"))
|
|
782
|
-
}), {
|
|
783
|
-
default: B(() => [
|
|
784
|
-
ne(y(n(r)("core.collection.empty.clear_all")), 1)
|
|
785
|
-
]),
|
|
786
|
-
_: 1
|
|
787
|
-
}, 16)
|
|
788
|
-
])
|
|
789
|
-
]));
|
|
790
|
-
}
|
|
791
|
-
}), kl = ["aria-label"], xl = ["disabled"], $l = { class: "sr-only" }, Sl = {
|
|
792
|
-
class: "text-subheadline tabular-nums text-content-muted",
|
|
793
|
-
"aria-live": "polite"
|
|
794
|
-
}, Cl = ["disabled"], zl = { class: "sr-only" }, Pl = {
|
|
795
|
-
key: 1,
|
|
796
|
-
class: "flex select-none flex-col items-center justify-between gap-3 border-t border-border-separator px-4 py-2.5 md:flex-row"
|
|
797
|
-
}, Al = { class: "flex flex-col items-center gap-x-4 text-footnote tabular-nums text-content-muted md:flex-row" }, El = {
|
|
798
|
-
key: 0,
|
|
799
|
-
"aria-live": "polite"
|
|
800
|
-
}, jl = { class: "flex items-center" }, Ol = { class: "mr-2" }, Ll = ["value"], Tl = ["value"], Rl = ["aria-label"], Ml = ["disabled"], Vl = { class: "sr-only" }, Nl = {
|
|
801
|
-
key: 0,
|
|
802
|
-
class: "px-1.5 text-content-disabled"
|
|
803
|
-
}, Il = ["aria-current", "onClick"], Fl = ["disabled"], ql = { class: "sr-only" }, Dl = /* @__PURE__ */ we({
|
|
804
|
-
__name: "CollectionPager",
|
|
805
|
-
props: {
|
|
806
|
-
collection: {},
|
|
807
|
-
compact: { type: Boolean },
|
|
808
|
-
flat: { type: Boolean }
|
|
809
|
-
},
|
|
810
|
-
emits: ["turned"],
|
|
811
|
-
setup(t, { emit: e }) {
|
|
812
|
-
const l = t, s = e, { t: r } = Ce(), a = Ve(), c = _(() => l.collection.query.value.page), f = _(() => l.collection.page.value?.lastPage ?? 0), b = _(() => l.collection.page.value), v = _(() => {
|
|
813
|
-
if (f.value <= 1) return f.value === 1 ? [1] : [];
|
|
814
|
-
const P = [1], j = Math.max(2, c.value - 2), A = Math.min(f.value - 1, c.value + 2);
|
|
815
|
-
j > 2 && P.push(null);
|
|
816
|
-
for (let U = j; U <= A; U++) P.push(U);
|
|
817
|
-
return A < f.value - 1 && P.push(null), P.push(f.value), P;
|
|
818
|
-
});
|
|
819
|
-
function x(P) {
|
|
820
|
-
P === 1 ? l.collection.nextPage() : l.collection.previousPage(), s("turned");
|
|
821
|
-
}
|
|
822
|
-
const S = (P) => [
|
|
823
|
-
"hit-target inline-flex h-7 min-w-7 cursor-pointer items-center justify-center rounded-button px-2 transition-colors duration-motion-fast disabled:cursor-not-allowed disabled:opacity-40",
|
|
824
|
-
P ? "bg-tint font-semibold text-content-on-tint" : "text-content-strong hover:bg-fill disabled:hover:bg-transparent"
|
|
825
|
-
].join(" ");
|
|
826
|
-
function D(P) {
|
|
827
|
-
l.collection.setPageSize(Number(P.target.value));
|
|
828
|
-
}
|
|
829
|
-
return (P, j) => l.compact && f.value > 1 ? (i(), d("nav", {
|
|
830
|
-
key: 0,
|
|
831
|
-
"aria-label": n(r)("core.collection.page.label"),
|
|
832
|
-
class: le(["flex select-none items-center justify-between gap-3 px-1 py-2", l.flat ? "mt-1" : "border-t border-border-separator"]),
|
|
833
|
-
"data-test": "collection-pager-compact"
|
|
834
|
-
}, [
|
|
835
|
-
p("button", {
|
|
836
|
-
type: "button",
|
|
837
|
-
class: "inline-flex size-11 cursor-pointer items-center justify-center rounded-full text-content-link active:bg-fill disabled:cursor-not-allowed disabled:text-content-disabled",
|
|
838
|
-
disabled: c.value <= 1,
|
|
839
|
-
onClick: j[0] || (j[0] = (A) => x(-1))
|
|
840
|
-
}, [
|
|
841
|
-
O(n(J), {
|
|
842
|
-
name: "arrowLeftSLine",
|
|
843
|
-
size: 20
|
|
844
|
-
}),
|
|
845
|
-
p("span", $l, y(n(r)("core.collection.page.previous")), 1)
|
|
846
|
-
], 8, xl),
|
|
847
|
-
p("span", Sl, y(n(r)("core.collection.page.page_of", { current: n(a).number(c.value), total: n(a).number(f.value) })), 1),
|
|
848
|
-
p("button", {
|
|
849
|
-
type: "button",
|
|
850
|
-
class: "inline-flex size-11 cursor-pointer items-center justify-center rounded-full text-content-link active:bg-fill disabled:cursor-not-allowed disabled:text-content-disabled",
|
|
851
|
-
disabled: c.value >= f.value,
|
|
852
|
-
onClick: j[1] || (j[1] = (A) => x(1))
|
|
853
|
-
}, [
|
|
854
|
-
O(n(J), {
|
|
855
|
-
name: "arrowRightSLine",
|
|
856
|
-
size: 20
|
|
857
|
-
}),
|
|
858
|
-
p("span", zl, y(n(r)("core.collection.page.next")), 1)
|
|
859
|
-
], 8, Cl)
|
|
860
|
-
], 10, kl)) : l.compact ? L("", !0) : (i(), d("div", Pl, [
|
|
861
|
-
p("div", Al, [
|
|
862
|
-
b.value ? (i(), d("span", El, y(n(r)("core.collection.page.total", { from: n(a).number(b.value.from), to: n(a).number(b.value.to), total: n(a).number(b.value.total) })), 1)) : L("", !0),
|
|
863
|
-
p("label", jl, [
|
|
864
|
-
p("span", Ol, y(n(r)("core.collection.page.per_page")) + ":", 1),
|
|
865
|
-
p("select", {
|
|
866
|
-
value: l.collection.query.value.pageSize,
|
|
867
|
-
class: "cursor-pointer rounded-control bg-transparent py-0.5 pr-1 font-semibold text-content-strong hover:bg-fill",
|
|
868
|
-
onChange: D
|
|
869
|
-
}, [
|
|
870
|
-
(i(!0), d(I, null, Z(l.collection.pageSizes, (A) => (i(), d("option", {
|
|
871
|
-
key: A,
|
|
872
|
-
value: A
|
|
873
|
-
}, y(A), 9, Tl))), 128))
|
|
874
|
-
], 40, Ll)
|
|
875
|
-
])
|
|
876
|
-
]),
|
|
877
|
-
p("nav", {
|
|
878
|
-
"aria-label": n(r)("core.collection.page.label"),
|
|
879
|
-
class: "flex items-center gap-0.5 text-subheadline tabular-nums"
|
|
880
|
-
}, [
|
|
881
|
-
p("button", {
|
|
882
|
-
type: "button",
|
|
883
|
-
class: le(S(!1)),
|
|
884
|
-
disabled: c.value <= 1,
|
|
885
|
-
onClick: j[2] || (j[2] = (A) => x(-1))
|
|
886
|
-
}, [
|
|
887
|
-
O(n(J), {
|
|
888
|
-
name: "arrowLeftSLine",
|
|
889
|
-
size: 16
|
|
890
|
-
}),
|
|
891
|
-
p("span", Vl, y(n(r)("core.collection.page.previous")), 1)
|
|
892
|
-
], 10, Ml),
|
|
893
|
-
(i(!0), d(I, null, Z(v.value, (A, U) => (i(), d(I, { key: U }, [
|
|
894
|
-
A === null ? (i(), d("span", Nl, "…")) : (i(), d("button", {
|
|
59
|
+
p(u(_), {
|
|
60
|
+
name: e.icon,
|
|
61
|
+
size: 18
|
|
62
|
+
}, null, 8, ["name"])
|
|
63
|
+
], 10, T)) : (c(), d("button", {
|
|
895
64
|
key: 1,
|
|
896
65
|
type: "button",
|
|
897
|
-
|
|
898
|
-
"
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
p("button", {
|
|
903
|
-
type: "button",
|
|
904
|
-
class: le(S(!1)),
|
|
905
|
-
disabled: c.value >= f.value,
|
|
906
|
-
onClick: j[3] || (j[3] = (A) => x(1))
|
|
907
|
-
}, [
|
|
908
|
-
O(n(J), {
|
|
909
|
-
name: "arrowRightSLine",
|
|
910
|
-
size: 16
|
|
911
|
-
}),
|
|
912
|
-
p("span", ql, y(n(r)("core.collection.page.next")), 1)
|
|
913
|
-
], 10, Fl)
|
|
914
|
-
], 8, Rl)
|
|
915
|
-
]));
|
|
916
|
-
}
|
|
917
|
-
}), Ul = ["onClick"], Bl = { class: "max-w-56 truncate" }, Hl = { class: "flex flex-col gap-1.5 text-footnote font-medium text-content-muted" }, Kl = ["placeholder"], Xl = { class: "flex items-center justify-between gap-2" }, Gl = {
|
|
918
|
-
type: "submit",
|
|
919
|
-
class: "cursor-pointer rounded-control bg-tint px-3 py-1.5 text-footnote font-semibold text-content-on-tint"
|
|
920
|
-
}, Jl = ["onClick"], Wl = { class: "max-w-56 truncate" }, rt = "inline-flex shrink-0 cursor-pointer items-center gap-x-2 rounded-button px-3 py-1.5 text-subheadline transition-colors duration-motion-fast focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus", Yl = /* @__PURE__ */ we({
|
|
921
|
-
__name: "CollectionFilterMenu",
|
|
922
|
-
props: {
|
|
923
|
-
filter: {},
|
|
924
|
-
value: {}
|
|
925
|
-
},
|
|
926
|
-
emits: ["update"],
|
|
927
|
-
setup(t, { emit: e }) {
|
|
928
|
-
const l = t, s = e, { t: r } = Ce(), a = _(() => ye(l.value) ? null : String(l.value)), c = _(() => l.filter.options?.find((k) => String(k.value) === a.value) ?? null), f = _(() => [
|
|
929
|
-
...l.filter.withoutDefaultOption ? [] : [{ id: "__all", label: l.filter.defaultOptionTitle ?? r("core.collection.filters.show_all"), checked: a.value === null, onSelect: () => s("update", null) }],
|
|
930
|
-
...(l.filter.options ?? []).map((R) => ({
|
|
931
|
-
id: `option-${String(R.value)}`,
|
|
932
|
-
label: R.label,
|
|
933
|
-
icon: R.icon,
|
|
934
|
-
checked: a.value === String(R.value),
|
|
935
|
-
onSelect: () => s("update", String(R.value))
|
|
936
|
-
}))
|
|
937
|
-
]), b = _(() => l.filter.type === "text" && a.value ? `${l.filter.label}: ${a.value}` : c.value?.label ?? l.filter.label), v = _(() => a.value !== null), x = _(
|
|
938
|
-
() => v.value ? "bg-tint-soft font-semibold text-content-link" : "bg-surface-cell font-medium text-content-strong ring-1 ring-inset ring-border-separator hover:bg-fill"
|
|
939
|
-
), S = ue(""), D = _e("popover");
|
|
940
|
-
Ae(a, (k) => S.value = k ?? "", { immediate: !0 });
|
|
941
|
-
function P() {
|
|
942
|
-
const k = S.value.trim();
|
|
943
|
-
s("update", k === "" ? null : k), D.value?.dismiss();
|
|
944
|
-
}
|
|
945
|
-
function j() {
|
|
946
|
-
S.value = "", s("update", null), D.value?.dismiss();
|
|
947
|
-
}
|
|
948
|
-
const A = _e("field");
|
|
949
|
-
async function U() {
|
|
950
|
-
await pt(), A.value?.focus();
|
|
951
|
-
}
|
|
952
|
-
return (k, R) => l.filter.type === "text" ? (i(), W(n(ht), {
|
|
953
|
-
key: 0,
|
|
954
|
-
ref_key: "popover",
|
|
955
|
-
ref: D,
|
|
956
|
-
label: l.filter.label,
|
|
957
|
-
width: "md",
|
|
958
|
-
placement: "bottom-start",
|
|
959
|
-
onPresented: U
|
|
960
|
-
}, {
|
|
961
|
-
trigger: B(({ toggle: H, attrs: Y }) => [
|
|
962
|
-
p("button", Se(Y, {
|
|
963
|
-
type: "button",
|
|
964
|
-
class: [rt, x.value],
|
|
965
|
-
onClick: H
|
|
966
|
-
}), [
|
|
967
|
-
l.filter.icon ? (i(), W(n(J), {
|
|
968
|
-
key: 0,
|
|
969
|
-
name: l.filter.icon,
|
|
970
|
-
size: 16
|
|
971
|
-
}, null, 8, ["name"])) : L("", !0),
|
|
972
|
-
p("span", Bl, y(b.value), 1),
|
|
973
|
-
O(n(J), {
|
|
974
|
-
name: "arrowDownSLine",
|
|
975
|
-
size: 16,
|
|
976
|
-
class: "text-content-muted"
|
|
977
|
-
})
|
|
978
|
-
], 16, Ul)
|
|
979
|
-
]),
|
|
980
|
-
default: B(() => [
|
|
981
|
-
p("form", {
|
|
982
|
-
class: "flex flex-col gap-3",
|
|
983
|
-
onSubmit: Re(P, ["prevent"])
|
|
984
|
-
}, [
|
|
985
|
-
p("label", Hl, [
|
|
986
|
-
ne(y(l.filter.label) + " ", 1),
|
|
987
|
-
Ge(p("input", {
|
|
988
|
-
ref_key: "field",
|
|
989
|
-
ref: A,
|
|
990
|
-
"onUpdate:modelValue": R[0] || (R[0] = (H) => S.value = H),
|
|
991
|
-
type: "text",
|
|
992
|
-
autocomplete: "off",
|
|
993
|
-
placeholder: n(r)("core.collection.filters.type_to_filter"),
|
|
994
|
-
class: "rounded-control bg-fill px-2.5 py-1.5 text-body text-content-strong outline-none placeholder:text-content-disabled focus:bg-surface-cell focus:ring-[1.5px] focus:ring-inset focus:ring-border-focus"
|
|
995
|
-
}, null, 8, Kl), [
|
|
996
|
-
[Je, S.value]
|
|
997
|
-
])
|
|
998
|
-
]),
|
|
999
|
-
p("div", Xl, [
|
|
1000
|
-
p("button", {
|
|
1001
|
-
type: "button",
|
|
1002
|
-
class: "cursor-pointer rounded-control px-2 py-1 text-footnote text-content-muted hover:text-content-strong",
|
|
1003
|
-
onClick: j
|
|
1004
|
-
}, y(n(r)("core.collection.filters.clear")), 1),
|
|
1005
|
-
p("button", Gl, y(n(r)("core.collection.filters.apply")), 1)
|
|
1006
|
-
])
|
|
1007
|
-
], 32)
|
|
1008
|
-
]),
|
|
1009
|
-
_: 1
|
|
1010
|
-
}, 8, ["label"])) : (i(), W(n(We), {
|
|
1011
|
-
key: 1,
|
|
1012
|
-
items: f.value,
|
|
1013
|
-
label: l.filter.label,
|
|
1014
|
-
placement: "bottom-start"
|
|
1015
|
-
}, {
|
|
1016
|
-
trigger: B(({ toggle: H, attrs: Y }) => [
|
|
1017
|
-
p("button", Se(Y, {
|
|
1018
|
-
type: "button",
|
|
1019
|
-
class: [rt, x.value],
|
|
1020
|
-
onClick: H
|
|
1021
|
-
}), [
|
|
1022
|
-
l.filter.icon ? (i(), W(n(J), {
|
|
1023
|
-
key: 0,
|
|
1024
|
-
name: l.filter.icon,
|
|
1025
|
-
size: 16
|
|
1026
|
-
}, null, 8, ["name"])) : L("", !0),
|
|
1027
|
-
p("span", Wl, y(b.value), 1),
|
|
1028
|
-
O(n(J), {
|
|
1029
|
-
name: "arrowDownSLine",
|
|
1030
|
-
size: 16,
|
|
1031
|
-
class: "text-content-muted"
|
|
1032
|
-
})
|
|
1033
|
-
], 16, Jl)
|
|
1034
|
-
]),
|
|
1035
|
-
_: 1
|
|
1036
|
-
}, 8, ["items", "label"]));
|
|
1037
|
-
}
|
|
1038
|
-
}), Ql = {
|
|
1039
|
-
key: 0,
|
|
1040
|
-
"data-test": "filter-drilldown"
|
|
1041
|
-
}, Zl = { class: "mb-3 text-headline font-semibold" }, eo = ["aria-label"], to = ["aria-selected", "onClick"], lo = { class: "min-w-0 truncate" }, oo = {
|
|
1042
|
-
key: 0,
|
|
1043
|
-
class: "mb-5 border-b border-border-separator pb-5",
|
|
1044
|
-
"data-test": "saved-filters"
|
|
1045
|
-
}, no = { class: "mb-2 text-footnote font-medium text-content-muted" }, so = { class: "flex flex-wrap gap-2" }, ao = ["onClick"], ro = ["aria-label", "title", "onClick"], io = { class: "space-y-5" }, co = { key: 0 }, uo = { class: "mb-1.5 text-footnote font-medium text-content-muted" }, fo = ["aria-label"], po = { class: "mb-1.5 text-footnote font-medium text-content-muted" }, vo = {
|
|
1046
|
-
key: 0,
|
|
1047
|
-
class: "grid grid-cols-2 gap-3"
|
|
1048
|
-
}, mo = ["aria-label"], go = { class: "mb-2 text-footnote font-medium text-content-muted" }, bo = { class: "flex flex-wrap gap-2" }, ho = ["aria-pressed", "onClick"], yo = ["disabled", "onClick"], _o = { class: "shrink-0 text-subheadline font-medium" }, wo = { class: "flex items-center justify-between gap-2" }, ko = { class: "flex items-center gap-2" }, xo = ["title"], $o = { class: "sm:hidden" }, So = { class: "hidden sm:inline" }, Co = { class: "flex flex-col gap-1.5 text-footnote font-medium text-content-muted" }, zo = ["placeholder"], Po = {
|
|
1049
|
-
key: 0,
|
|
1050
|
-
class: "text-footnote text-status-warning-content",
|
|
1051
|
-
"data-test": "saved-filter-replace-hint"
|
|
1052
|
-
}, Ao = { class: "flex justify-end gap-2" }, Eo = 8, jo = 18, it = 6e3, Oo = /* @__PURE__ */ we({
|
|
1053
|
-
__name: "CollectionFilterPanel",
|
|
1054
|
-
props: {
|
|
1055
|
-
collection: {},
|
|
1056
|
-
filters: {}
|
|
1057
|
-
},
|
|
1058
|
-
emits: ["touched"],
|
|
1059
|
-
setup(t, { expose: e, emit: l }) {
|
|
1060
|
-
const s = t, r = l, { t: a } = Ce(), c = _e("sheet"), f = bt("(max-width: 1023px), (pointer: coarse)"), b = ue({}), v = ue({}), x = ue(null), S = _(() => s.filters.find((h) => h.key === x.value) ?? null);
|
|
1061
|
-
function D() {
|
|
1062
|
-
const h = {}, w = {};
|
|
1063
|
-
for (const o of s.filters) {
|
|
1064
|
-
const u = s.collection.query.value.filters[o.key];
|
|
1065
|
-
if (h[o.key] = ye(u) ? null : String(u), o.type === "range") {
|
|
1066
|
-
const [V, X] = yt(h[o.key]);
|
|
1067
|
-
w[o.key] = { min: V ?? "", max: X ?? "" };
|
|
1068
|
-
}
|
|
1069
|
-
}
|
|
1070
|
-
b.value = h, v.value = w, x.value = null, c.value?.present();
|
|
1071
|
-
}
|
|
1072
|
-
function P(h, w) {
|
|
1073
|
-
const o = ye(w) ? null : String(w);
|
|
1074
|
-
if (b.value[h] !== o) {
|
|
1075
|
-
b.value = { ...b.value, [h]: o };
|
|
1076
|
-
for (const u of s.filters.filter((V) => V.dependsOn === h)) P(u.key, null);
|
|
1077
|
-
}
|
|
1078
|
-
}
|
|
1079
|
-
function j() {
|
|
1080
|
-
for (const h of s.filters)
|
|
1081
|
-
b.value[h.key] = null, h.type === "range" && (v.value[h.key] = { min: "", max: "" });
|
|
1082
|
-
}
|
|
1083
|
-
const A = (h) => h.replace(/[^\d.,-]/g, "").replace(",", "."), U = (h, w) => {
|
|
1084
|
-
const o = v.value[h]?.[w] ?? "", u = o === "" ? Number.NaN : Number(A(o));
|
|
1085
|
-
return Number.isNaN(u) ? null : u;
|
|
1086
|
-
};
|
|
1087
|
-
function k(h, w, o) {
|
|
1088
|
-
const u = v.value[h];
|
|
1089
|
-
u && (u[w] = o === null ? "" : String(o));
|
|
1090
|
-
}
|
|
1091
|
-
function R() {
|
|
1092
|
-
const h = {};
|
|
1093
|
-
for (const w of s.filters) {
|
|
1094
|
-
const o = v.value[w.key];
|
|
1095
|
-
h[w.key] = w.type === "range" ? Bt(o ? A(o.min) : null, o ? A(o.max) : null) : b.value[w.key] ?? null;
|
|
1096
|
-
}
|
|
1097
|
-
return h;
|
|
1098
|
-
}
|
|
1099
|
-
function H() {
|
|
1100
|
-
const h = R(), w = Object.keys(h).filter((o) => (s.collection.query.value.filters[o] ?? null) !== h[o]);
|
|
1101
|
-
r("touched", w), s.collection.setFilters(h), c.value?.dismiss();
|
|
1102
|
-
}
|
|
1103
|
-
const Y = (h) => Ht(h, h.dependsOn ? b.value[h.dependsOn] : null), F = (h) => h.defaultOptionTitle ?? a("core.collection.filters.show_all");
|
|
1104
|
-
function re(h) {
|
|
1105
|
-
const w = b.value[h.key];
|
|
1106
|
-
return w == null ? F(h) : Y(h).find((o) => o.value === w)?.label ?? w;
|
|
1107
|
-
}
|
|
1108
|
-
const te = (h) => [
|
|
1109
|
-
{ value: "", label: F(h) },
|
|
1110
|
-
...Y(h).map((w) => ({ value: String(w.value), label: w.label }))
|
|
1111
|
-
], C = (h) => [
|
|
1112
|
-
{ value: "", label: F(h) },
|
|
1113
|
-
...(h.options ?? []).map((w) => ({ value: String(w.value), label: w.label }))
|
|
1114
|
-
];
|
|
1115
|
-
function T(h) {
|
|
1116
|
-
const w = Y(h);
|
|
1117
|
-
return !h.dependsOn && w.length > 0 && w.length <= Eo && w.every((o) => o.label.length <= jo);
|
|
1118
|
-
}
|
|
1119
|
-
const N = _(() => f.value && S.value !== null), E = _(() => s.collection.savedViews), z = ue(""), q = ue(!1), de = _e("savePopover");
|
|
1120
|
-
function me() {
|
|
1121
|
-
const h = new Set(s.filters.map((o) => o.key)), w = {};
|
|
1122
|
-
for (const [o, u] of Object.entries(s.collection.query.value.filters))
|
|
1123
|
-
!h.has(o) && u !== void 0 && u !== "" && (w[o] = String(u));
|
|
1124
|
-
for (const [o, u] of Object.entries(R())) u !== null && (w[o] = u);
|
|
1125
|
-
return { filters: w, search: s.collection.query.value.search };
|
|
1126
|
-
}
|
|
1127
|
-
const ve = _(() => {
|
|
1128
|
-
const h = me();
|
|
1129
|
-
return Object.keys(h.filters).length > 0 || h.search.trim() !== "";
|
|
1130
|
-
}), ae = _(() => {
|
|
1131
|
-
const h = z.value.trim();
|
|
1132
|
-
return h ? E.value?.items.value.find((w) => w.name === h) ?? null : null;
|
|
1133
|
-
}), ge = (h, w) => Lt(h) && h.message ? h.message : w;
|
|
1134
|
-
async function oe() {
|
|
1135
|
-
const h = z.value.trim(), w = E.value;
|
|
1136
|
-
if (!(!w || !h || q.value || !ve.value)) {
|
|
1137
|
-
q.value = !0;
|
|
1138
|
-
try {
|
|
1139
|
-
const o = await w.save(h, me());
|
|
1140
|
-
z.value = "", de.value?.dismiss(), je.success(a("core.collection.saved.saved_toast", { name: o.name })), w.apply(o), r("touched", []), c.value?.dismiss();
|
|
1141
|
-
} catch (o) {
|
|
1142
|
-
je.error(ge(o, a("core.collection.saved.save_failed")));
|
|
1143
|
-
} finally {
|
|
1144
|
-
q.value = !1;
|
|
1145
|
-
}
|
|
1146
|
-
}
|
|
1147
|
-
}
|
|
1148
|
-
function ie(h) {
|
|
1149
|
-
E.value?.apply(h), r("touched", []), c.value?.dismiss();
|
|
1150
|
-
}
|
|
1151
|
-
function ce(h) {
|
|
1152
|
-
const w = E.value;
|
|
1153
|
-
if (!w) return;
|
|
1154
|
-
const { revert: o, commit: u } = w.stageRemoval(h.id), V = setTimeout(() => {
|
|
1155
|
-
u().catch((X) => {
|
|
1156
|
-
o(), je.error(ge(X, a("core.collection.saved.delete_failed")));
|
|
1157
|
-
});
|
|
1158
|
-
}, it);
|
|
1159
|
-
je.success(a("core.collection.saved.deleted_toast", { name: h.name }), {
|
|
1160
|
-
duration: it,
|
|
1161
|
-
action: {
|
|
1162
|
-
label: a("core.collection.saved.undo"),
|
|
1163
|
-
onClick: () => {
|
|
1164
|
-
clearTimeout(V), o();
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
});
|
|
1168
|
-
}
|
|
1169
|
-
return e({ present: D }), (h, w) => (i(), W(n(Dt), {
|
|
1170
|
-
ref_key: "sheet",
|
|
1171
|
-
ref: c,
|
|
1172
|
-
title: n(a)("core.collection.filters.panel_title"),
|
|
1173
|
-
grouped: N.value
|
|
1174
|
-
}, {
|
|
1175
|
-
footer: B(() => [
|
|
1176
|
-
p("div", wo, [
|
|
1177
|
-
O(he, {
|
|
1178
|
-
prominence: "standard",
|
|
1179
|
-
class: "whitespace-nowrap",
|
|
1180
|
-
onClick: j
|
|
1181
|
-
}, {
|
|
1182
|
-
default: B(() => [
|
|
1183
|
-
ne(y(n(a)("core.collection.filters.reset_all")), 1)
|
|
1184
|
-
]),
|
|
1185
|
-
_: 1
|
|
1186
|
-
}),
|
|
1187
|
-
p("div", ko, [
|
|
1188
|
-
E.value ? (i(), W(n(ht), {
|
|
1189
|
-
key: 0,
|
|
1190
|
-
ref_key: "savePopover",
|
|
1191
|
-
ref: de,
|
|
1192
|
-
placement: "top-end",
|
|
1193
|
-
label: n(a)("core.collection.saved.save_button")
|
|
1194
|
-
}, {
|
|
1195
|
-
trigger: B(({ toggle: o, attrs: u }) => [
|
|
1196
|
-
p("span", {
|
|
1197
|
-
title: ve.value ? void 0 : n(a)("core.collection.saved.nothing_to_save")
|
|
1198
|
-
}, [
|
|
1199
|
-
O(he, Se({ ...u, "data-test": "saved-filter-open" }, {
|
|
1200
|
-
prominence: "standard",
|
|
1201
|
-
icon: "save",
|
|
1202
|
-
class: "whitespace-nowrap",
|
|
1203
|
-
disabled: !ve.value,
|
|
1204
|
-
onClick: o
|
|
1205
|
-
}), {
|
|
1206
|
-
default: B(() => [
|
|
1207
|
-
p("span", $o, y(n(a)("core.collection.saved.save")), 1),
|
|
1208
|
-
p("span", So, y(n(a)("core.collection.saved.save_button")), 1)
|
|
1209
|
-
]),
|
|
1210
|
-
_: 1
|
|
1211
|
-
}, 16, ["disabled", "onClick"])
|
|
1212
|
-
], 8, xo)
|
|
1213
|
-
]),
|
|
1214
|
-
default: B(() => [
|
|
1215
|
-
p("form", {
|
|
1216
|
-
class: "flex flex-col gap-3",
|
|
1217
|
-
"data-test": "saved-filter-form",
|
|
1218
|
-
onSubmit: Re(oe, ["prevent"])
|
|
1219
|
-
}, [
|
|
1220
|
-
p("label", Co, [
|
|
1221
|
-
ne(y(n(a)("core.collection.saved.name_label")) + " ", 1),
|
|
1222
|
-
Ge(p("input", {
|
|
1223
|
-
"onUpdate:modelValue": w[1] || (w[1] = (o) => z.value = o),
|
|
1224
|
-
type: "text",
|
|
1225
|
-
maxlength: "60",
|
|
1226
|
-
autocomplete: "off",
|
|
1227
|
-
placeholder: n(a)("core.collection.saved.name_placeholder"),
|
|
1228
|
-
class: "rounded-control bg-fill px-2.5 py-1.5 text-body text-content-strong outline-none placeholder:text-content-disabled focus:bg-surface-cell focus:ring-[1.5px] focus:ring-inset focus:ring-border-focus"
|
|
1229
|
-
}, null, 8, zo), [
|
|
1230
|
-
[Je, z.value]
|
|
1231
|
-
])
|
|
1232
|
-
]),
|
|
1233
|
-
ae.value ? (i(), d("p", Po, y(n(a)("core.collection.saved.replace_hint", { name: ae.value.name })), 1)) : L("", !0),
|
|
1234
|
-
p("div", Ao, [
|
|
1235
|
-
O(he, {
|
|
1236
|
-
size: "sm",
|
|
1237
|
-
onClick: w[2] || (w[2] = (o) => de.value?.dismiss())
|
|
1238
|
-
}, {
|
|
1239
|
-
default: B(() => [
|
|
1240
|
-
ne(y(n(a)("core.actions.cancel")), 1)
|
|
1241
|
-
]),
|
|
1242
|
-
_: 1
|
|
1243
|
-
}),
|
|
1244
|
-
O(he, Se({ "data-test": "saved-filter-save" }, {
|
|
1245
|
-
type: "submit",
|
|
1246
|
-
prominence: "primary",
|
|
1247
|
-
size: "sm",
|
|
1248
|
-
processing: q.value,
|
|
1249
|
-
disabled: !z.value.trim()
|
|
1250
|
-
}), {
|
|
1251
|
-
default: B(() => [
|
|
1252
|
-
ne(y(ae.value ? n(a)("core.collection.saved.replace") : n(a)("core.collection.saved.save")), 1)
|
|
1253
|
-
]),
|
|
1254
|
-
_: 1
|
|
1255
|
-
}, 16, ["processing", "disabled"])
|
|
1256
|
-
])
|
|
1257
|
-
], 32)
|
|
1258
|
-
]),
|
|
1259
|
-
_: 1
|
|
1260
|
-
}, 8, ["label"])) : L("", !0),
|
|
1261
|
-
O(he, {
|
|
1262
|
-
prominence: "primary",
|
|
1263
|
-
icon: "filter3",
|
|
1264
|
-
class: "whitespace-nowrap",
|
|
1265
|
-
onClick: H
|
|
1266
|
-
}, {
|
|
1267
|
-
default: B(() => [
|
|
1268
|
-
ne(y(n(a)("core.collection.filters.apply")), 1)
|
|
1269
|
-
]),
|
|
1270
|
-
_: 1
|
|
1271
|
-
})
|
|
1272
|
-
])
|
|
1273
|
-
])
|
|
1274
|
-
]),
|
|
1275
|
-
default: B(() => [
|
|
1276
|
-
n(f) && S.value ? (i(), d("div", Ql, [
|
|
1277
|
-
p("button", {
|
|
1278
|
-
type: "button",
|
|
1279
|
-
"data-test": "filter-drilldown-back",
|
|
1280
|
-
class: "-mx-2 -mt-2 mb-1 inline-flex h-10 cursor-pointer items-center gap-0.5 rounded-control px-2 text-body font-medium text-content-link active:bg-tint-soft",
|
|
1281
|
-
onClick: w[0] || (w[0] = (o) => x.value = null)
|
|
1282
|
-
}, [
|
|
1283
|
-
O(n(J), {
|
|
1284
|
-
name: "arrowLeftSLine",
|
|
1285
|
-
size: 20
|
|
1286
|
-
}),
|
|
1287
|
-
ne(" " + y(n(a)("core.collection.filters.panel_title")), 1)
|
|
1288
|
-
]),
|
|
1289
|
-
p("p", Zl, y(S.value.label), 1),
|
|
1290
|
-
p("ul", {
|
|
1291
|
-
class: "overflow-hidden rounded-group bg-surface-cell shadow-group",
|
|
1292
|
-
role: "listbox",
|
|
1293
|
-
"aria-label": S.value.label
|
|
1294
|
-
}, [
|
|
1295
|
-
(i(!0), d(I, null, Z([{ value: null, label: F(S.value) }, ...Y(S.value)], (o) => (i(), d("li", {
|
|
1296
|
-
key: String(o.value),
|
|
1297
|
-
role: "presentation"
|
|
1298
|
-
}, [
|
|
1299
|
-
p("button", {
|
|
1300
|
-
type: "button",
|
|
1301
|
-
role: "option",
|
|
1302
|
-
"aria-selected": (b.value[S.value.key] ?? null) === o.value,
|
|
1303
|
-
class: "flex min-h-11 w-full cursor-pointer items-center justify-between gap-3 px-row-inset text-left text-body active:bg-fill",
|
|
1304
|
-
onClick: (u) => {
|
|
1305
|
-
P(S.value.key, o.value), x.value = null;
|
|
1306
|
-
}
|
|
1307
|
-
}, [
|
|
1308
|
-
p("span", lo, y(o.label), 1),
|
|
1309
|
-
(b.value[S.value.key] ?? null) === o.value ? (i(), W(n(J), {
|
|
1310
|
-
key: 0,
|
|
1311
|
-
name: "checkboxCircleFill",
|
|
1312
|
-
size: 18,
|
|
1313
|
-
class: "shrink-0 text-content-link"
|
|
1314
|
-
})) : L("", !0)
|
|
1315
|
-
], 8, to)
|
|
1316
|
-
]))), 128))
|
|
1317
|
-
], 8, eo)
|
|
1318
|
-
])) : (i(), d(I, { key: 1 }, [
|
|
1319
|
-
E.value && E.value.items.value.length > 0 ? (i(), d("section", oo, [
|
|
1320
|
-
p("p", no, y(n(a)("core.collection.saved.title")), 1),
|
|
1321
|
-
p("div", so, [
|
|
1322
|
-
(i(!0), d(I, null, Z(E.value.items.value, (o) => (i(), d("span", {
|
|
1323
|
-
key: o.id,
|
|
1324
|
-
class: "inline-flex h-8 items-center rounded-control bg-surface-cell text-subheadline shadow-group ring-1 ring-inset ring-border-separator"
|
|
1325
|
-
}, [
|
|
1326
|
-
p("button", {
|
|
1327
|
-
type: "button",
|
|
1328
|
-
"data-test": "saved-filter-apply",
|
|
1329
|
-
class: "inline-flex h-full cursor-pointer items-center gap-1.5 rounded-l-control pr-1.5 pl-2.5 font-medium text-content-strong hover:bg-fill",
|
|
1330
|
-
onClick: (u) => ie(o)
|
|
1331
|
-
}, [
|
|
1332
|
-
O(n(J), {
|
|
1333
|
-
name: "starFill",
|
|
1334
|
-
size: 12,
|
|
1335
|
-
class: "text-status-warning-content"
|
|
1336
|
-
}),
|
|
1337
|
-
ne(" " + y(o.name), 1)
|
|
1338
|
-
], 8, ao),
|
|
1339
|
-
p("button", {
|
|
1340
|
-
type: "button",
|
|
1341
|
-
"data-test": "saved-filter-delete",
|
|
1342
|
-
"aria-label": n(a)("core.collection.saved.delete", { name: o.name }),
|
|
1343
|
-
title: n(a)("core.collection.saved.delete", { name: o.name }),
|
|
1344
|
-
class: "h-full cursor-pointer rounded-r-control px-1.5 text-content-muted hover:bg-fill hover:text-content-destructive",
|
|
1345
|
-
onClick: (u) => ce(o)
|
|
1346
|
-
}, [
|
|
1347
|
-
O(n(J), {
|
|
1348
|
-
name: "close",
|
|
1349
|
-
size: 12
|
|
1350
|
-
})
|
|
1351
|
-
], 8, ro)
|
|
1352
|
-
]))), 128))
|
|
1353
|
-
])
|
|
1354
|
-
])) : L("", !0),
|
|
1355
|
-
p("div", io, [
|
|
1356
|
-
(i(!0), d(I, null, Z(s.filters, (o) => (i(), d(I, {
|
|
1357
|
-
key: o.key
|
|
1358
|
-
}, [
|
|
1359
|
-
o.type === "segmented" ? (i(), d("div", co, [
|
|
1360
|
-
p("p", uo, y(o.label), 1),
|
|
1361
|
-
O(n(gt), {
|
|
1362
|
-
"model-value": b.value[o.key] ?? "",
|
|
1363
|
-
tabs: C(o),
|
|
1364
|
-
label: o.label,
|
|
1365
|
-
stretch: "",
|
|
1366
|
-
"onUpdate:modelValue": (u) => P(o.key, u === null ? null : String(u))
|
|
1367
|
-
}, null, 8, ["model-value", "tabs", "label", "onUpdate:modelValue"])
|
|
1368
|
-
])) : o.type === "range" ? (i(), d("div", {
|
|
1369
|
-
key: 1,
|
|
1370
|
-
role: "group",
|
|
1371
|
-
"aria-label": o.label
|
|
1372
|
-
}, [
|
|
1373
|
-
p("p", po, y(o.label), 1),
|
|
1374
|
-
v.value[o.key] ? (i(), d("div", vo, [
|
|
1375
|
-
(i(), d(I, null, Z(["min", "max"], (u) => O(Ft, {
|
|
1376
|
-
key: u,
|
|
1377
|
-
"model-value": U(o.key, u),
|
|
1378
|
-
name: `${o.key}_${u}`,
|
|
1379
|
-
width: "full",
|
|
1380
|
-
decimals: o.decimals ?? 0,
|
|
1381
|
-
suffix: o.unit,
|
|
1382
|
-
label: n(a)(u === "min" ? "core.collection.filters.range_from" : "core.collection.filters.range_until"),
|
|
1383
|
-
"onUpdate:modelValue": (V) => k(o.key, u, V)
|
|
1384
|
-
}, null, 8, ["model-value", "name", "decimals", "suffix", "label", "onUpdate:modelValue"])), 64))
|
|
1385
|
-
])) : L("", !0)
|
|
1386
|
-
], 8, fo)) : n(f) && T(o) ? (i(), d("div", {
|
|
1387
|
-
key: 2,
|
|
1388
|
-
role: "group",
|
|
1389
|
-
"aria-label": o.label,
|
|
1390
|
-
"data-test": "filter-chips"
|
|
1391
|
-
}, [
|
|
1392
|
-
p("p", go, y(o.label), 1),
|
|
1393
|
-
p("div", bo, [
|
|
1394
|
-
(i(!0), d(I, null, Z([{ value: null, label: F(o) }, ...Y(o)], (u) => (i(), d("button", {
|
|
1395
|
-
key: String(u.value),
|
|
1396
|
-
type: "button",
|
|
1397
|
-
"aria-pressed": (b.value[o.key] ?? null) === u.value,
|
|
1398
|
-
class: le(["min-h-9 cursor-pointer rounded-full px-3.5 text-subheadline ring-1 ring-inset transition-colors", (b.value[o.key] ?? null) === u.value ? "bg-tint-soft font-semibold text-content-link ring-border-selected" : "bg-surface-cell text-content ring-border-separator active:bg-fill"]),
|
|
1399
|
-
onClick: (V) => P(o.key, u.value)
|
|
1400
|
-
}, y(u.label), 11, ho))), 128))
|
|
1401
|
-
])
|
|
1402
|
-
], 8, mo)) : n(f) ? (i(), d("button", {
|
|
1403
|
-
key: 3,
|
|
1404
|
-
type: "button",
|
|
1405
|
-
"data-test": "filter-row",
|
|
1406
|
-
disabled: !!o.dependsOn && Y(o).length === 0,
|
|
1407
|
-
class: "flex min-h-12 w-full cursor-pointer items-center gap-3 rounded-group bg-surface-cell px-3 text-left ring-1 ring-inset ring-border-separator active:bg-fill disabled:cursor-not-allowed disabled:opacity-50",
|
|
1408
|
-
onClick: (u) => x.value = o.key
|
|
1409
|
-
}, [
|
|
1410
|
-
p("span", _o, y(o.label), 1),
|
|
1411
|
-
p("span", {
|
|
1412
|
-
class: le(["min-w-0 flex-1 truncate text-right text-subheadline", b.value[o.key] == null ? "text-content-disabled" : "font-medium text-content-link"])
|
|
1413
|
-
}, y(re(o)), 3),
|
|
1414
|
-
O(n(J), {
|
|
1415
|
-
name: "arrowRightSLine",
|
|
1416
|
-
size: 18,
|
|
1417
|
-
class: "shrink-0 text-content-muted"
|
|
1418
|
-
})
|
|
1419
|
-
], 8, yo)) : (i(), W(qt, {
|
|
1420
|
-
key: 4,
|
|
1421
|
-
"model-value": b.value[o.key] ?? "",
|
|
1422
|
-
label: o.label,
|
|
1423
|
-
options: te(o),
|
|
1424
|
-
disabled: !!o.dependsOn && Y(o).length === 0,
|
|
1425
|
-
"onUpdate:modelValue": (u) => P(o.key, u === "" ? null : u)
|
|
1426
|
-
}, null, 8, ["model-value", "label", "options", "disabled", "onUpdate:modelValue"]))
|
|
1427
|
-
], 64))), 128))
|
|
1428
|
-
])
|
|
1429
|
-
], 64))
|
|
1430
|
-
]),
|
|
1431
|
-
_: 1
|
|
1432
|
-
}, 8, ["title", "grouped"]));
|
|
1433
|
-
}
|
|
1434
|
-
}), Lo = { class: "flex flex-col items-start gap-2 lg:flex-row" }, To = { class: "flex h-9 w-full items-center rounded-control bg-fill px-2.5 text-content-muted transition-colors duration-motion-fast focus-within:outline-2 focus-within:outline-offset-1 focus-within:outline-border-focus lg:w-72 compact:h-10" }, Ro = ["placeholder", "aria-label"], Mo = ["aria-label"], Vo = ["title"], No = {
|
|
1435
|
-
key: 0,
|
|
1436
|
-
class: "min-w-4.5 rounded-full bg-tint px-1 text-center text-caption font-semibold leading-4.5 text-content-on-tint"
|
|
1437
|
-
}, Io = ["onClick"], Fo = {
|
|
1438
|
-
key: 0,
|
|
1439
|
-
class: "mt-2.5 flex flex-wrap items-center gap-2",
|
|
1440
|
-
"data-test": "collection-filter-chips"
|
|
1441
|
-
}, qo = {
|
|
1442
|
-
key: 0,
|
|
1443
|
-
class: "shrink-0 opacity-80"
|
|
1444
|
-
}, Do = { class: "flex min-w-0 flex-wrap items-center gap-1 font-semibold" }, Uo = { class: "break-words" }, Bo = ["aria-label", "onClick"], ct = "__search", Ho = 3, Ko = 300, Xo = /* @__PURE__ */ we({
|
|
1445
|
-
__name: "CollectionToolbar",
|
|
1446
|
-
props: {
|
|
1447
|
-
collection: {},
|
|
1448
|
-
narrow: { type: Boolean },
|
|
1449
|
-
flat: { type: Boolean }
|
|
1450
|
-
},
|
|
1451
|
-
emits: ["touched"],
|
|
1452
|
-
setup(t, { emit: e }) {
|
|
1453
|
-
const l = t, s = e, { t: r } = Ce(), a = Ve(), c = ue(l.collection.query.value.search), f = _e("field");
|
|
1454
|
-
let b = null;
|
|
1455
|
-
Ae(() => l.collection.query.value.search, (C) => {
|
|
1456
|
-
C !== c.value.trim() && (c.value = C);
|
|
1457
|
-
});
|
|
1458
|
-
function v() {
|
|
1459
|
-
b && clearTimeout(b);
|
|
1460
|
-
const C = c.value;
|
|
1461
|
-
C.length > 0 && C.length < Ho || (b = setTimeout(() => {
|
|
1462
|
-
b = null, C !== l.collection.query.value.search && (s("touched", [ct]), l.collection.search(C));
|
|
1463
|
-
}, Ko));
|
|
1464
|
-
}
|
|
1465
|
-
function x() {
|
|
1466
|
-
b && clearTimeout(b), c.value = "", s("touched", [ct]), l.collection.search(""), f.value?.focus();
|
|
1467
|
-
}
|
|
1468
|
-
Ct(() => b && clearTimeout(b));
|
|
1469
|
-
const S = (C) => C.placement === "panel" || l.narrow && C.type !== "text", D = _(() => l.collection.filters.value.filter((C) => !S(C))), P = _(() => l.collection.filters.value.filter(S)), j = _(() => l.collection.query.value.filters), A = _(
|
|
1470
|
-
() => _t(P.value, j.value, {
|
|
1471
|
-
formatNumber: (C) => a.number(C),
|
|
1472
|
-
from: r("core.collection.filters.range_from"),
|
|
1473
|
-
until: r("core.collection.filters.range_until")
|
|
1474
|
-
})
|
|
1475
|
-
), U = _(() => Xt(P.value, j.value));
|
|
1476
|
-
function k(C, T) {
|
|
1477
|
-
s("touched", [C]), l.collection.setFilter(C, T);
|
|
1478
|
-
}
|
|
1479
|
-
function R(C) {
|
|
1480
|
-
l.collection.setFilters(Object.fromEntries(C.map((T) => [T, null])));
|
|
1481
|
-
}
|
|
1482
|
-
const H = _e("panel"), Y = _e("panelButton"), F = (C) => !!C && (typeof C.checkVisibility != "function" || C.checkVisibility());
|
|
1483
|
-
Qe({ key: "/" }, () => {
|
|
1484
|
-
if (!F(f.value)) return !1;
|
|
1485
|
-
f.value?.focus(), f.value?.select();
|
|
1486
|
-
}), Qe({ key: "f" }, () => {
|
|
1487
|
-
if (P.value.length === 0 || !F(Y.value)) return !1;
|
|
1488
|
-
H.value?.present();
|
|
1489
|
-
});
|
|
1490
|
-
const re = _(() => l.collection.savedViews);
|
|
1491
|
-
zt(() => void re.value?.load());
|
|
1492
|
-
const te = _(
|
|
1493
|
-
() => (re.value?.items.value ?? []).map((C) => ({
|
|
1494
|
-
id: `saved-${C.id}`,
|
|
1495
|
-
label: C.name,
|
|
1496
|
-
icon: "starFill",
|
|
1497
|
-
onSelect: () => {
|
|
1498
|
-
s("touched", []), re.value?.apply(C);
|
|
1499
|
-
}
|
|
1500
|
-
}))
|
|
1501
|
-
);
|
|
1502
|
-
return (C, T) => (i(), d("div", {
|
|
1503
|
-
class: le([l.flat ? "pb-3" : "border-b border-border-separator px-3 py-2.5", "select-none"]),
|
|
1504
|
-
"data-test": "collection-toolbar"
|
|
1505
|
-
}, [
|
|
1506
|
-
p("div", Lo, [
|
|
1507
|
-
p("div", To, [
|
|
1508
|
-
O(n(J), {
|
|
1509
|
-
name: "search",
|
|
1510
|
-
size: 16
|
|
1511
|
-
}),
|
|
1512
|
-
Ge(p("input", {
|
|
1513
|
-
ref_key: "field",
|
|
1514
|
-
ref: f,
|
|
1515
|
-
"onUpdate:modelValue": T[0] || (T[0] = (N) => c.value = N),
|
|
1516
|
-
type: "text",
|
|
1517
|
-
name: "collection-search",
|
|
1518
|
-
autocomplete: "off",
|
|
1519
|
-
placeholder: n(r)("core.collection.search.placeholder"),
|
|
1520
|
-
"aria-label": n(r)("core.collection.search.label"),
|
|
1521
|
-
class: "peer block min-w-0 flex-1 bg-transparent px-2 py-1.5 text-body text-content-strong outline-0 placeholder:text-content-disabled",
|
|
1522
|
-
onInput: v
|
|
1523
|
-
}, null, 40, Ro), [
|
|
1524
|
-
[Je, c.value]
|
|
1525
|
-
]),
|
|
1526
|
-
T[4] || (T[4] = p("kbd", {
|
|
1527
|
-
"aria-hidden": "true",
|
|
1528
|
-
class: "rounded border border-border-separator px-1.5 font-mono text-2xs leading-5 text-content-disabled peer-focus:hidden peer-[:not(:placeholder-shown)]:hidden [@media(pointer:coarse)]:hidden"
|
|
1529
|
-
}, "/", -1)),
|
|
1530
|
-
c.value !== "" ? (i(), d("button", {
|
|
1531
|
-
key: 0,
|
|
1532
|
-
type: "button",
|
|
1533
|
-
"aria-label": n(r)("core.collection.clear"),
|
|
1534
|
-
class: "cursor-pointer rounded-full text-content-disabled hover:text-content-muted",
|
|
1535
|
-
onClick: x
|
|
66
|
+
"aria-label": e.label,
|
|
67
|
+
"data-action": e.key,
|
|
68
|
+
disabled: s.disabled,
|
|
69
|
+
class: m(["inline-flex cursor-pointer rounded-md p-1.5 transition-colors disabled:pointer-events-none disabled:opacity-40", [n(e), b]]),
|
|
70
|
+
onClick: (i) => e.onSelect?.()
|
|
1536
71
|
}, [
|
|
1537
|
-
|
|
1538
|
-
name:
|
|
1539
|
-
size:
|
|
1540
|
-
})
|
|
1541
|
-
],
|
|
72
|
+
p(u(_), {
|
|
73
|
+
name: e.icon,
|
|
74
|
+
size: 18
|
|
75
|
+
}, null, 8, ["name"])
|
|
76
|
+
], 10, A))
|
|
1542
77
|
]),
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
P.value.length > 0 ? (i(), d("button", {
|
|
1547
|
-
key: 0,
|
|
1548
|
-
ref_key: "panelButton",
|
|
1549
|
-
ref: Y,
|
|
1550
|
-
type: "button",
|
|
1551
|
-
"data-test": "collection-filter-panel-button",
|
|
1552
|
-
title: `${n(r)("core.collection.filters.panel_button")} (F)`,
|
|
1553
|
-
class: le(["hit-target inline-flex h-8 shrink-0 cursor-pointer items-center gap-x-1.5 rounded-button px-3 text-subheadline font-semibold transition-colors duration-motion-fast compact:h-9", U.value > 0 ? "bg-tint-soft text-content-link" : "bg-surface-cell text-content-strong shadow-group ring-1 ring-inset ring-border-separator hover:bg-fill"]),
|
|
1554
|
-
onClick: T[1] || (T[1] = (N) => H.value?.present())
|
|
1555
|
-
}, [
|
|
1556
|
-
O(n(J), {
|
|
1557
|
-
name: "filter3",
|
|
1558
|
-
size: 16
|
|
1559
|
-
}),
|
|
1560
|
-
ne(" " + y(n(r)("core.collection.filters.panel_button")) + " ", 1),
|
|
1561
|
-
U.value > 0 ? (i(), d("span", No, y(U.value), 1)) : L("", !0)
|
|
1562
|
-
], 10, Vo)) : L("", !0),
|
|
1563
|
-
te.value.length > 0 ? (i(), W(n(We), {
|
|
1564
|
-
key: 1,
|
|
1565
|
-
items: te.value,
|
|
1566
|
-
label: n(r)("core.collection.saved.menu"),
|
|
1567
|
-
placement: "bottom-start"
|
|
1568
|
-
}, {
|
|
1569
|
-
trigger: B(({ toggle: N, attrs: E }) => [
|
|
1570
|
-
p("button", Se(E, {
|
|
1571
|
-
type: "button",
|
|
1572
|
-
"data-test": "saved-filters-menu",
|
|
1573
|
-
class: "inline-flex shrink-0 cursor-pointer items-center gap-1.5 rounded-button bg-surface-cell px-3 py-1.5 text-subheadline font-semibold text-content-strong shadow-group ring-1 ring-inset ring-border-separator transition-colors hover:bg-fill",
|
|
1574
|
-
onClick: N
|
|
1575
|
-
}), [
|
|
1576
|
-
O(n(J), {
|
|
1577
|
-
name: "starFill",
|
|
1578
|
-
size: 14,
|
|
1579
|
-
class: "text-status-warning-content"
|
|
1580
|
-
}),
|
|
1581
|
-
ne(" " + y(n(r)("core.collection.saved.menu")), 1)
|
|
1582
|
-
], 16, Io)
|
|
1583
|
-
]),
|
|
1584
|
-
_: 1
|
|
1585
|
-
}, 8, ["items", "label"])) : L("", !0),
|
|
1586
|
-
(i(!0), d(I, null, Z(D.value, (N) => (i(), W(Yl, {
|
|
1587
|
-
key: N.key,
|
|
1588
|
-
filter: N,
|
|
1589
|
-
value: j.value[N.key],
|
|
1590
|
-
onUpdate: (E) => k(N.key, E)
|
|
1591
|
-
}, null, 8, ["filter", "value", "onUpdate"]))), 128))
|
|
1592
|
-
], 2),
|
|
1593
|
-
pe(C.$slots, "default")
|
|
1594
|
-
]),
|
|
1595
|
-
A.value.length > 0 ? (i(), d("div", Fo, [
|
|
1596
|
-
(i(!0), d(I, null, Z(A.value, (N) => (i(), d("span", {
|
|
1597
|
-
key: N.key,
|
|
1598
|
-
class: "inline-flex min-h-7 max-w-full items-center gap-1.5 rounded-control bg-tint-soft py-0.5 pr-0.5 pl-2.5 text-subheadline text-content-link"
|
|
1599
|
-
}, [
|
|
1600
|
-
N.label ? (i(), d("span", qo, y(N.label), 1)) : L("", !0),
|
|
1601
|
-
p("span", Do, [
|
|
1602
|
-
(i(!0), d(I, null, Z(N.values, (E, z) => (i(), d(I, { key: z }, [
|
|
1603
|
-
z > 0 ? (i(), W(n(J), {
|
|
1604
|
-
key: 0,
|
|
1605
|
-
name: "arrowRightSLine",
|
|
1606
|
-
size: 12,
|
|
1607
|
-
class: "opacity-60"
|
|
1608
|
-
})) : L("", !0),
|
|
1609
|
-
p("span", Uo, y(E), 1)
|
|
1610
|
-
], 64))), 128))
|
|
1611
|
-
]),
|
|
1612
|
-
p("button", {
|
|
1613
|
-
type: "button",
|
|
1614
|
-
class: "hit-target flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-full hover:bg-tint/15",
|
|
1615
|
-
"aria-label": n(r)("core.collection.clear"),
|
|
1616
|
-
onClick: (E) => R(N.clears)
|
|
1617
|
-
}, [
|
|
1618
|
-
O(n(J), {
|
|
1619
|
-
name: "close",
|
|
1620
|
-
size: 12
|
|
1621
|
-
})
|
|
1622
|
-
], 8, Bo)
|
|
1623
|
-
]))), 128)),
|
|
1624
|
-
A.value.length > 1 ? (i(), d("button", {
|
|
1625
|
-
key: 0,
|
|
1626
|
-
type: "button",
|
|
1627
|
-
class: "cursor-pointer px-2 text-subheadline text-content-muted hover:text-content-strong hover:underline",
|
|
1628
|
-
onClick: T[2] || (T[2] = (N) => R(P.value.map((E) => E.key)))
|
|
1629
|
-
}, y(n(r)("core.collection.filters.reset_all")), 1)) : L("", !0)
|
|
1630
|
-
])) : L("", !0),
|
|
1631
|
-
P.value.length > 0 ? (i(), W(Oo, {
|
|
1632
|
-
key: 1,
|
|
1633
|
-
ref_key: "panel",
|
|
1634
|
-
ref: H,
|
|
1635
|
-
collection: l.collection,
|
|
1636
|
-
filters: P.value,
|
|
1637
|
-
onTouched: T[3] || (T[3] = (N) => s("touched", N))
|
|
1638
|
-
}, null, 8, ["collection", "filters"])) : L("", !0)
|
|
1639
|
-
], 2));
|
|
1640
|
-
}
|
|
1641
|
-
}), Go = 'a, button, input, select, textarea, label, [role="button"], [data-row-click-ignore]', Jo = 500, Wo = 8;
|
|
1642
|
-
function Yo(t) {
|
|
1643
|
-
const e = Ot(), l = ue([]), s = ue("");
|
|
1644
|
-
let r = !1, a = null, c = { x: 0, y: 0 };
|
|
1645
|
-
const f = (k) => t.actions()?.(k) ?? [];
|
|
1646
|
-
function b(k) {
|
|
1647
|
-
return f(k).filter((R) => R.href).map((R) => ({ key: R.key, label: R.label, icon: R.icon, href: R.href, tone: R.tone ?? "neutral", external: R.external }));
|
|
1648
|
-
}
|
|
1649
|
-
function v(k, R, H) {
|
|
1650
|
-
const Y = f(k);
|
|
1651
|
-
return Y.length === 0 ? !1 : (s.value = t.label()?.(k) ?? t.moreLabel(), l.value = Y.map((F) => ({
|
|
1652
|
-
id: F.key,
|
|
1653
|
-
label: F.label,
|
|
1654
|
-
icon: F.icon,
|
|
1655
|
-
section: F.section,
|
|
1656
|
-
tone: F.tone === "critical" ? "critical" : void 0,
|
|
1657
|
-
onSelect: () => {
|
|
1658
|
-
F.onSelect ? F.onSelect() : F.href && (F.external ? window.open(F.href, "_blank", "noopener") : window.location.assign(F.href));
|
|
1659
|
-
}
|
|
1660
|
-
})), pt(() => t.presentMenu(R, H)), !0);
|
|
1661
|
-
}
|
|
1662
|
-
function x(k, R) {
|
|
1663
|
-
const H = k.currentTarget.getBoundingClientRect();
|
|
1664
|
-
v(R, H.left, H.bottom);
|
|
1665
|
-
}
|
|
1666
|
-
function S(k, R) {
|
|
1667
|
-
!t.actions() || k.target.closest("a") || v(R, k.clientX, k.clientY) && (k.preventDefault(), r = !0);
|
|
1668
|
-
}
|
|
1669
|
-
function D() {
|
|
1670
|
-
a && clearTimeout(a), a = null;
|
|
1671
|
-
}
|
|
1672
|
-
function P(k, R) {
|
|
1673
|
-
r = !1, !(k.pointerType !== "touch" || !t.actions()) && (c = { x: k.clientX, y: k.clientY }, D(), a = setTimeout(() => {
|
|
1674
|
-
a = null, v(R, c.x, c.y) && (r = !0, navigator.vibrate?.(10));
|
|
1675
|
-
}, Jo));
|
|
1676
|
-
}
|
|
1677
|
-
function j(k) {
|
|
1678
|
-
a && Math.hypot(k.clientX - c.x, k.clientY - c.y) > Wo && D();
|
|
1679
|
-
}
|
|
1680
|
-
function A(k) {
|
|
1681
|
-
r && (r = !1, k.preventDefault(), k.stopPropagation());
|
|
1682
|
-
}
|
|
1683
|
-
function U(k, R) {
|
|
1684
|
-
const H = t.target(R);
|
|
1685
|
-
if (!(!H || k.target.closest(Go)) && !window.getSelection()?.toString()) {
|
|
1686
|
-
if (k.metaKey || k.ctrlKey) {
|
|
1687
|
-
window.open(e.resolve(H).href, "_blank");
|
|
1688
|
-
return;
|
|
1689
|
-
}
|
|
1690
|
-
e.push(H);
|
|
1691
|
-
}
|
|
1692
|
-
}
|
|
1693
|
-
return Ke() && Xe(D), { menuItems: l, menuLabel: s, swipeActions: b, openMenuFrom: x, onContextMenu: S, onPointerDown: P, onPointerMove: j, cancelPress: D, onClickCapture: A, onClick: U, actionsOf: f };
|
|
1694
|
-
}
|
|
1695
|
-
const Qo = ["aria-busy"], Zo = {
|
|
1696
|
-
key: 0,
|
|
1697
|
-
class: "mb-3 select-none"
|
|
1698
|
-
}, en = {
|
|
1699
|
-
key: 0,
|
|
1700
|
-
role: "status",
|
|
1701
|
-
"data-test": "collection-refreshing",
|
|
1702
|
-
class: "m-2 flex w-fit max-w-full items-center gap-2 rounded-group bg-fill py-1 pr-3 pl-3 text-footnote text-content-muted"
|
|
1703
|
-
}, tn = {
|
|
1704
|
-
key: 1,
|
|
1705
|
-
class: "m-2",
|
|
1706
|
-
"data-test": "collection-stale"
|
|
1707
|
-
}, ln = { class: "flex flex-wrap items-center justify-between gap-3" }, on = {
|
|
1708
|
-
key: 2,
|
|
1709
|
-
class: "overflow-hidden rounded-group bg-surface-cell shadow-group",
|
|
1710
|
-
"data-test": "collection-mobile-rows"
|
|
1711
|
-
}, nn = { class: "flex flex-1 flex-col gap-2 pt-1" }, sn = ["onClick", "onContextmenu", "onPointerdown"], an = { class: "flex items-start gap-3" }, rn = {
|
|
1712
|
-
key: 0,
|
|
1713
|
-
class: "shrink-0 pt-0.5"
|
|
1714
|
-
}, cn = { class: "flex min-w-0 flex-1 flex-col gap-1" }, un = { class: "flex min-w-0 items-start gap-3" }, dn = { class: "min-w-0 flex-1" }, fn = {
|
|
1715
|
-
key: 1,
|
|
1716
|
-
class: "block truncate text-row-title"
|
|
1717
|
-
}, pn = {
|
|
1718
|
-
key: 0,
|
|
1719
|
-
class: "flex shrink-0 items-center gap-2 pt-0.5"
|
|
1720
|
-
}, vn = ["aria-label", "onClick"], mn = {
|
|
1721
|
-
key: 0,
|
|
1722
|
-
class: "flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1 text-row-meta"
|
|
1723
|
-
}, gn = {
|
|
1724
|
-
key: 1,
|
|
1725
|
-
class: "truncate"
|
|
1726
|
-
}, bn = {
|
|
1727
|
-
key: 2,
|
|
1728
|
-
class: "px-4 py-6",
|
|
1729
|
-
"data-test": "collection-failed"
|
|
1730
|
-
}, hn = { class: "flex flex-wrap items-center justify-between gap-3" }, yn = { class: "font-semibold" }, _n = {
|
|
1731
|
-
key: 3,
|
|
1732
|
-
class: "px-4 py-2 text-center",
|
|
1733
|
-
"data-test": "collection-empty"
|
|
1734
|
-
}, wn = {
|
|
1735
|
-
key: 3,
|
|
1736
|
-
class: "inline-block w-full align-middle"
|
|
1737
|
-
}, kn = { class: "border-b border-border-separator" }, xn = ["aria-sort"], $n = ["onClick"], Sn = { key: 1 }, Cn = {
|
|
1738
|
-
key: 0,
|
|
1739
|
-
class: "px-4 pt-2.5 pb-2",
|
|
1740
|
-
style: { width: "20px" }
|
|
1741
|
-
}, zn = { class: "sr-only" }, Pn = {
|
|
1742
|
-
key: 0,
|
|
1743
|
-
class: "size-8 shrink-0 rounded-full bg-fill"
|
|
1744
|
-
}, An = { class: "flex flex-1 flex-col gap-1.5" }, En = { key: 0 }, jn = ["onClick", "onContextmenu", "onPointerdown"], On = { key: 0 }, Ln = { class: "flex items-center justify-center gap-1" }, Tn = ["aria-label", "onClick"], Rn = {
|
|
1745
|
-
key: 2,
|
|
1746
|
-
"data-test": "collection-failed"
|
|
1747
|
-
}, Mn = ["colspan"], Vn = { class: "flex flex-wrap items-center justify-between gap-3" }, Nn = { class: "font-semibold" }, In = {
|
|
1748
|
-
key: 3,
|
|
1749
|
-
"data-test": "collection-empty"
|
|
1750
|
-
}, Fn = ["colspan"], ut = "__search", qn = 37, Dn = /* @__PURE__ */ we({
|
|
1751
|
-
__name: "CollectionTable",
|
|
1752
|
-
props: {
|
|
1753
|
-
collection: {},
|
|
1754
|
-
rowActions: { type: Function, default: void 0 },
|
|
1755
|
-
rowLabel: { type: Function, default: void 0 },
|
|
1756
|
-
rowHeight: { default: void 0 },
|
|
1757
|
-
density: { default: "regular" },
|
|
1758
|
-
viewsPresentation: { default: "segmented" },
|
|
1759
|
-
actionsVisible: { type: Boolean, default: !1 }
|
|
1760
|
-
},
|
|
1761
|
-
setup(t) {
|
|
1762
|
-
const e = t, l = Ue(), { t: s } = Ce(), r = Ve(), a = Ue(), c = bt("(max-width: 1023px)"), f = _(() => e.collection.columns.value), b = _(() => f.value.some((g) => g.mobile && g.mobile !== "hidden")), v = _(() => c.value && b.value), x = (g) => f.value.filter((M) => M.mobile === g), S = _(() => x("primary")), D = _(() => x("accessory")), P = _(() => x("meta")), j = (g) => `cell-${String(g.key).replace(/\./g, "_")}`, A = (g) => !!a[j(g)], U = (g, M) => xt(g, M.key), k = (g) => g == null || g === "", R = { md: "hidden md:table-cell", xl: "hidden xl:table-cell", "2xl": "hidden 2xl:table-cell" }, H = (g) => g.hideBelow ? [R[g.hideBelow]] : [], Y = (g) => ["text-nowrap px-4 pt-2.5 pb-2 text-footnote font-normal text-content-muted", ...H(g)], F = { start: "text-left", center: "text-center", end: "text-right" }, re = (g) => [...H(g), F[g.align ?? "start"]], te = { start: "justify-start", center: "justify-center", end: "justify-end" }, C = _(() => e.collection.rows.value), T = (g) => e.collection.recordLocation(g), N = _(() => C.value.length > 0 && T(C.value[0]) !== null), E = _e("rowMenu"), z = Yo({
|
|
1763
|
-
actions: () => e.rowActions,
|
|
1764
|
-
label: () => e.rowLabel,
|
|
1765
|
-
target: T,
|
|
1766
|
-
presentMenu: (g, M) => E.value?.presentAt(g, M),
|
|
1767
|
-
moreLabel: () => s("core.page.more_actions")
|
|
1768
|
-
}), q = _(() => !!e.rowActions && (e.actionsVisible || !l.actions && !N.value)), de = _(() => !!l.actions || N.value || q.value), me = (g) => e.rowLabel ? `${s("core.page.more_actions")}: ${e.rowLabel(g)}` : s("core.page.more_actions"), ve = (g) => z.actionsOf(g).length > 0, ae = _(() => e.collection.query.value.search), ge = _(() => e.collection.views.value.map((g) => ({ value: g.key, label: g.label, icon: g.icon, badge: g.count }))), oe = ue([]), ie = (g) => oe.value = [...oe.value.filter((M) => !g.includes(M)), ...g], ce = _(() => {
|
|
1769
|
-
const g = _t(e.collection.filters.value, e.collection.query.value.filters, {
|
|
1770
|
-
formatNumber: (m) => r.number(m),
|
|
1771
|
-
from: s("core.collection.filters.range_from"),
|
|
1772
|
-
until: s("core.collection.filters.range_until")
|
|
1773
|
-
}), M = e.collection.query.value.search;
|
|
1774
|
-
return M && g.push({ key: ut, label: s("core.collection.empty.search"), values: [M], clears: [] }), g;
|
|
1775
|
-
}), h = _(() => {
|
|
1776
|
-
for (const g of [...oe.value].reverse()) {
|
|
1777
|
-
const M = ce.value.find((m) => m.key === g || m.clears.includes(g));
|
|
1778
|
-
if (M) return M;
|
|
1779
|
-
}
|
|
1780
|
-
return ce.value[ce.value.length - 1] ?? null;
|
|
1781
|
-
});
|
|
1782
|
-
function w(g) {
|
|
1783
|
-
oe.value = oe.value.filter((M) => M !== g.key && !g.clears.includes(M)), g.key === ut ? e.collection.search("") : e.collection.setFilters(Object.fromEntries(g.clears.map((M) => [M, null])));
|
|
1784
|
-
}
|
|
1785
|
-
function o() {
|
|
1786
|
-
oe.value = [], e.collection.clearFilters();
|
|
1787
|
-
}
|
|
1788
|
-
const u = (g) => g.sort !== void 0 && e.collection.query.value.sort === g.sort, V = (g) => g.sort === void 0 ? void 0 : u(g) ? e.collection.query.value.direction === "asc" ? "ascending" : "descending" : "none", X = (g) => u(g) ? e.collection.query.value.direction === "asc" ? "arrowUpSLine" : "arrowDownSLine" : "expandUpDownLine", ee = _e("card"), G = () => ee.value?.scrollIntoView?.({ block: "start", behavior: "smooth" }), fe = (g) => ({ animationDelay: `${Math.min(g, 8) * 30}ms` }), K = _(() => e.collection.display.value === "loading"), Q = _(() => K.value ? `${e.collection.query.value.pageSize * (e.rowHeight ?? 40) + qn}px` : void 0), se = _(() => e.collection.query.value.pageSize), Ee = _(() => e.collection.state.value.status === "refreshing"), $t = _(() => e.collection.state.value.status === "stale"), Ye = _(() => e.collection.state.value.status === "failed"), Ne = _(() => {
|
|
1789
|
-
const g = e.collection.state.value;
|
|
1790
|
-
return g.status === "failed" || g.status === "stale" ? g.error ?? "" : "";
|
|
1791
|
-
});
|
|
1792
|
-
return (g, M) => (i(), d("div", {
|
|
1793
|
-
class: "collection",
|
|
1794
|
-
"aria-busy": K.value || Ee.value || void 0,
|
|
1795
|
-
"data-test": "collection"
|
|
1796
|
-
}, [
|
|
1797
|
-
ge.value.length > 0 ? (i(), d("div", Zo, [
|
|
1798
|
-
O(n(gt), {
|
|
1799
|
-
"model-value": e.collection.query.value.view,
|
|
1800
|
-
tabs: ge.value,
|
|
1801
|
-
presentation: e.viewsPresentation,
|
|
1802
|
-
label: n(s)("core.collection.views_label"),
|
|
1803
|
-
"onUpdate:modelValue": M[0] || (M[0] = (m) => e.collection.setView(m === null ? null : String(m)))
|
|
1804
|
-
}, null, 8, ["model-value", "tabs", "presentation", "label"])
|
|
1805
|
-
])) : L("", !0),
|
|
1806
|
-
p("div", {
|
|
1807
|
-
ref_key: "card",
|
|
1808
|
-
ref: ee,
|
|
1809
|
-
class: le(["scroll-mt-16", v.value ? "" : "rounded-group bg-surface-cell shadow-group"])
|
|
1810
|
-
}, [
|
|
1811
|
-
O(Xo, {
|
|
1812
|
-
collection: e.collection,
|
|
1813
|
-
narrow: n(c),
|
|
1814
|
-
flat: v.value,
|
|
1815
|
-
onTouched: ie
|
|
1816
|
-
}, {
|
|
1817
|
-
default: B(() => [
|
|
1818
|
-
pe(g.$slots, "toolbar")
|
|
1819
|
-
]),
|
|
1820
|
-
_: 3
|
|
1821
|
-
}, 8, ["collection", "narrow", "flat"]),
|
|
1822
|
-
Ee.value ? (i(), d("div", en, [
|
|
1823
|
-
O(n(J), {
|
|
1824
|
-
name: "loader4Line",
|
|
1825
|
-
size: 14,
|
|
1826
|
-
class: "animate-spin motion-reduce:animate-none"
|
|
1827
|
-
}),
|
|
1828
|
-
ne(" " + y(n(s)("core.state.refreshing")), 1)
|
|
1829
|
-
])) : L("", !0),
|
|
1830
|
-
$t.value ? (i(), d("div", tn, [
|
|
1831
|
-
O(n(Fe), {
|
|
1832
|
-
tone: "warning",
|
|
1833
|
-
role: "alert"
|
|
1834
|
-
}, {
|
|
1835
|
-
default: B(() => [
|
|
1836
|
-
p("div", ln, [
|
|
1837
|
-
p("div", null, [
|
|
1838
|
-
p("p", null, y(Ne.value), 1),
|
|
1839
|
-
p("p", null, y(n(s)("core.state.stale")), 1)
|
|
1840
|
-
]),
|
|
1841
|
-
O(he, {
|
|
1842
|
-
prominence: "secondary",
|
|
1843
|
-
size: "sm",
|
|
1844
|
-
onClick: M[1] || (M[1] = (m) => e.collection.refresh())
|
|
1845
|
-
}, {
|
|
1846
|
-
default: B(() => [
|
|
1847
|
-
ne(y(n(s)("core.actions.retry")), 1)
|
|
1848
|
-
]),
|
|
1849
|
-
_: 1
|
|
1850
|
-
})
|
|
1851
|
-
])
|
|
1852
|
-
]),
|
|
1853
|
-
_: 1
|
|
1854
|
-
})
|
|
1855
|
-
])) : L("", !0),
|
|
1856
|
-
v.value ? (i(), d("ul", on, [
|
|
1857
|
-
K.value ? (i(!0), d(I, { key: 0 }, Z(se.value, (m) => (i(), d("li", {
|
|
1858
|
-
key: `skeleton-${m}`,
|
|
1859
|
-
"aria-hidden": "true",
|
|
1860
|
-
class: "relative flex animate-pulse items-start gap-3 px-row-inset py-3 motion-reduce:animate-none not-first:before:absolute not-first:before:top-0 not-first:before:right-0 not-first:before:left-row-inset not-first:before:h-px not-first:before:bg-border-separator",
|
|
1861
|
-
style: be({ animationDelay: `${m * 60}ms` })
|
|
1862
|
-
}, [
|
|
1863
|
-
M[9] || (M[9] = p("span", { class: "size-9 shrink-0 rounded-full bg-fill" }, null, -1)),
|
|
1864
|
-
p("span", nn, [
|
|
1865
|
-
p("span", {
|
|
1866
|
-
class: "h-2.5 rounded-full bg-fill-strong",
|
|
1867
|
-
style: be({ width: `${45 + m * 13 % 30}%` })
|
|
1868
|
-
}, null, 4),
|
|
1869
|
-
p("span", {
|
|
1870
|
-
class: "h-2 rounded-full bg-fill",
|
|
1871
|
-
style: be({ width: `${60 + m * 7 % 25}%` })
|
|
1872
|
-
}, null, 4)
|
|
1873
|
-
])
|
|
1874
|
-
], 4))), 128)) : L("", !0),
|
|
1875
|
-
e.collection.display.value === "rows" ? (i(!0), d(I, { key: 1 }, Z(C.value, (m, ke) => (i(), d("li", {
|
|
1876
|
-
key: e.collection.rowKey(m),
|
|
1877
|
-
style: be(fe(ke)),
|
|
1878
|
-
"data-test": "collection-row",
|
|
1879
|
-
class: le(["relative animate-row-in transition-colors duration-motion-fast active:bg-fill not-first:before:absolute not-first:before:top-0 not-first:before:right-0 not-first:before:left-row-inset not-first:before:z-10 not-first:before:h-px not-first:before:bg-border-separator", T(m) ? "cursor-pointer" : void 0]),
|
|
1880
|
-
onClickCapture: M[2] || (M[2] = //@ts-ignore
|
|
1881
|
-
(...$) => n(z).onClickCapture && n(z).onClickCapture(...$)),
|
|
1882
|
-
onClick: ($) => n(z).onClick($, m),
|
|
1883
|
-
onContextmenu: ($) => n(z).onContextMenu($, m),
|
|
1884
|
-
onPointerdown: ($) => n(z).onPointerDown($, m),
|
|
1885
|
-
onPointermove: M[3] || (M[3] = //@ts-ignore
|
|
1886
|
-
(...$) => n(z).onPointerMove && n(z).onPointerMove(...$)),
|
|
1887
|
-
onPointerup: M[4] || (M[4] = //@ts-ignore
|
|
1888
|
-
(...$) => n(z).cancelPress && n(z).cancelPress(...$)),
|
|
1889
|
-
onPointercancel: M[5] || (M[5] = //@ts-ignore
|
|
1890
|
-
(...$) => n(z).cancelPress && n(z).cancelPress(...$))
|
|
1891
|
-
}, [
|
|
1892
|
-
O(n(Mt), {
|
|
1893
|
-
actions: n(z).swipeActions(m),
|
|
1894
|
-
"content-class": "px-row-inset py-2.5"
|
|
1895
|
-
}, {
|
|
1896
|
-
default: B(() => [
|
|
1897
|
-
p("div", an, [
|
|
1898
|
-
l.leading ? (i(), d("div", rn, [
|
|
1899
|
-
pe(g.$slots, "leading", {
|
|
1900
|
-
item: m,
|
|
1901
|
-
compact: !0
|
|
1902
|
-
})
|
|
1903
|
-
])) : L("", !0),
|
|
1904
|
-
p("div", cn, [
|
|
1905
|
-
p("div", un, [
|
|
1906
|
-
p("div", dn, [
|
|
1907
|
-
(i(!0), d(I, null, Z(S.value, ($) => (i(), d(I, {
|
|
1908
|
-
key: String($.key)
|
|
1909
|
-
}, [
|
|
1910
|
-
A($) ? pe(g.$slots, j($), {
|
|
1911
|
-
item: m,
|
|
1912
|
-
value: U(m, $),
|
|
1913
|
-
compact: !0,
|
|
1914
|
-
to: T(m),
|
|
1915
|
-
search: ae.value
|
|
1916
|
-
}, void 0, void 0, 0) : (i(), d("span", fn, [
|
|
1917
|
-
O(Te, {
|
|
1918
|
-
column: $,
|
|
1919
|
-
item: m,
|
|
1920
|
-
compact: !0,
|
|
1921
|
-
to: T(m),
|
|
1922
|
-
search: ae.value
|
|
1923
|
-
}, null, 8, ["column", "item", "to", "search"])
|
|
1924
|
-
]))
|
|
1925
|
-
], 64))), 128))
|
|
1926
|
-
]),
|
|
1927
|
-
D.value.length || q.value && ve(m) ? (i(), d("div", pn, [
|
|
1928
|
-
(i(!0), d(I, null, Z(D.value, ($) => (i(), d(I, {
|
|
1929
|
-
key: String($.key)
|
|
1930
|
-
}, [
|
|
1931
|
-
A($) ? pe(g.$slots, j($), {
|
|
1932
|
-
item: m,
|
|
1933
|
-
value: U(m, $),
|
|
1934
|
-
compact: !0,
|
|
1935
|
-
to: T(m),
|
|
1936
|
-
search: ae.value
|
|
1937
|
-
}, void 0, void 0, 0) : (i(), W(Te, {
|
|
1938
|
-
key: 1,
|
|
1939
|
-
column: $,
|
|
1940
|
-
item: m,
|
|
1941
|
-
compact: !0,
|
|
1942
|
-
to: T(m),
|
|
1943
|
-
search: ae.value
|
|
1944
|
-
}, null, 8, ["column", "item", "to", "search"]))
|
|
1945
|
-
], 64))), 128)),
|
|
1946
|
-
q.value && ve(m) ? (i(), d("button", {
|
|
1947
|
-
key: 0,
|
|
1948
|
-
type: "button",
|
|
1949
|
-
"data-test": "collection-row-more",
|
|
1950
|
-
"aria-label": me(m),
|
|
1951
|
-
class: "hit-target -my-1 -mr-1 flex size-8 cursor-pointer items-center justify-center rounded-full text-content-muted active:bg-fill",
|
|
1952
|
-
onClick: Re(($) => n(z).openMenuFrom($, m), ["stop"])
|
|
1953
|
-
}, [
|
|
1954
|
-
O(n(J), {
|
|
1955
|
-
name: "moreLine",
|
|
1956
|
-
size: 20
|
|
1957
|
-
})
|
|
1958
|
-
], 8, vn)) : L("", !0)
|
|
1959
|
-
])) : L("", !0)
|
|
1960
|
-
]),
|
|
1961
|
-
P.value.length ? (i(), d("div", mn, [
|
|
1962
|
-
(i(!0), d(I, null, Z(P.value, ($) => (i(), d(I, {
|
|
1963
|
-
key: String($.key)
|
|
1964
|
-
}, [
|
|
1965
|
-
A($) ? pe(g.$slots, j($), {
|
|
1966
|
-
item: m,
|
|
1967
|
-
value: U(m, $),
|
|
1968
|
-
compact: !0,
|
|
1969
|
-
to: T(m),
|
|
1970
|
-
search: ae.value
|
|
1971
|
-
}, void 0, void 0, 0) : k(U(m, $)) ? L("", !0) : (i(), d("span", gn, [
|
|
1972
|
-
O(Te, {
|
|
1973
|
-
column: $,
|
|
1974
|
-
item: m,
|
|
1975
|
-
compact: !0,
|
|
1976
|
-
to: T(m),
|
|
1977
|
-
search: ae.value
|
|
1978
|
-
}, null, 8, ["column", "item", "to", "search"])
|
|
1979
|
-
]))
|
|
1980
|
-
], 64))), 128))
|
|
1981
|
-
])) : L("", !0)
|
|
1982
|
-
])
|
|
1983
|
-
])
|
|
1984
|
-
]),
|
|
1985
|
-
_: 2
|
|
1986
|
-
}, 1032, ["actions"])
|
|
1987
|
-
], 46, sn))), 128)) : L("", !0),
|
|
1988
|
-
Ye.value ? (i(), d("li", bn, [
|
|
1989
|
-
O(n(Fe), {
|
|
1990
|
-
tone: "warning",
|
|
1991
|
-
role: "alert"
|
|
1992
|
-
}, {
|
|
1993
|
-
default: B(() => [
|
|
1994
|
-
p("div", hn, [
|
|
1995
|
-
p("div", null, [
|
|
1996
|
-
p("p", yn, y(n(s)("core.collection.failed.title")), 1),
|
|
1997
|
-
p("p", null, y(Ne.value), 1)
|
|
1998
|
-
]),
|
|
1999
|
-
O(he, {
|
|
2000
|
-
prominence: "secondary",
|
|
2001
|
-
size: "sm",
|
|
2002
|
-
onClick: M[6] || (M[6] = (m) => e.collection.refresh())
|
|
2003
|
-
}, {
|
|
2004
|
-
default: B(() => [
|
|
2005
|
-
ne(y(n(s)("core.actions.retry")), 1)
|
|
2006
|
-
]),
|
|
2007
|
-
_: 1
|
|
2008
|
-
})
|
|
2009
|
-
])
|
|
2010
|
-
]),
|
|
2011
|
-
_: 1
|
|
2012
|
-
})
|
|
2013
|
-
])) : L("", !0),
|
|
2014
|
-
e.collection.display.value === "empty" || e.collection.display.value === "no-matches" ? (i(), d("li", _n, [
|
|
2015
|
-
e.collection.display.value === "empty" && l.empty ? pe(g.$slots, "empty", {}, void 0, void 0, 0) : ce.value.length > 0 ? (i(), W(at, {
|
|
2016
|
-
key: 1,
|
|
2017
|
-
chips: ce.value,
|
|
2018
|
-
"last-chip": h.value,
|
|
2019
|
-
onRemove: w,
|
|
2020
|
-
onClearAll: o
|
|
2021
|
-
}, null, 8, ["chips", "last-chip"])) : (i(), W(n(Ze), {
|
|
2022
|
-
key: 2,
|
|
2023
|
-
title: n(s)("core.collection.no_data"),
|
|
2024
|
-
description: n(s)("core.collection.no_results")
|
|
2025
|
-
}, null, 8, ["title", "description"]))
|
|
2026
|
-
])) : L("", !0)
|
|
2027
|
-
])) : (i(), d("div", wn, [
|
|
2028
|
-
p("div", {
|
|
2029
|
-
class: "overflow-x-auto",
|
|
2030
|
-
style: be({ minHeight: Q.value })
|
|
2031
|
-
}, [
|
|
2032
|
-
p("table", {
|
|
2033
|
-
class: le(["collection-grid w-full", { condensed: e.density === "condensed" }])
|
|
2034
|
-
}, [
|
|
2035
|
-
p("thead", kn, [
|
|
2036
|
-
p("tr", null, [
|
|
2037
|
-
(i(!0), d(I, null, Z(f.value, (m) => (i(), d("th", {
|
|
2038
|
-
key: String(m.key),
|
|
2039
|
-
scope: "col",
|
|
2040
|
-
class: le(Y(m)),
|
|
2041
|
-
style: be({ width: m.width ? `${m.width}px` : void 0, textAlign: m.align ?? "start" }),
|
|
2042
|
-
"aria-sort": V(m)
|
|
2043
|
-
}, [
|
|
2044
|
-
p("div", {
|
|
2045
|
-
class: le(["flex", te[m.align ?? "start"]])
|
|
2046
|
-
}, [
|
|
2047
|
-
m.sort !== void 0 ? (i(), d("button", {
|
|
2048
|
-
key: 0,
|
|
2049
|
-
type: "button",
|
|
2050
|
-
class: le(["group inline-flex cursor-pointer items-center gap-1 rounded-sm transition-colors hover:text-content-strong focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus", [u(m) ? "font-semibold text-content-strong" : "", m.align === "end" ? "flex-row-reverse" : ""]]),
|
|
2051
|
-
onClick: (ke) => e.collection.toggleSort(m.sort)
|
|
2052
|
-
}, [
|
|
2053
|
-
p("span", null, y(m.label), 1),
|
|
2054
|
-
O(n(J), {
|
|
2055
|
-
name: X(m),
|
|
2056
|
-
size: 14,
|
|
2057
|
-
class: le(u(m) ? "text-content-muted" : "text-content-disabled opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100")
|
|
2058
|
-
}, null, 8, ["name", "class"])
|
|
2059
|
-
], 10, $n)) : (i(), d("span", Sn, y(m.label), 1))
|
|
2060
|
-
], 2)
|
|
2061
|
-
], 14, xn))), 128)),
|
|
2062
|
-
de.value ? (i(), d("th", Cn, [
|
|
2063
|
-
p("span", zn, y(n(s)("core.actions.more")), 1)
|
|
2064
|
-
])) : L("", !0)
|
|
2065
|
-
])
|
|
2066
|
-
]),
|
|
2067
|
-
p("tbody", null, [
|
|
2068
|
-
K.value ? (i(!0), d(I, { key: 0 }, Z(se.value, (m) => (i(), d("tr", {
|
|
2069
|
-
key: `skeleton-${m}`,
|
|
2070
|
-
"aria-hidden": "true",
|
|
2071
|
-
style: be(e.rowHeight ? { height: `${e.rowHeight}px` } : void 0)
|
|
2072
|
-
}, [
|
|
2073
|
-
(i(!0), d(I, null, Z(f.value, (ke, $) => (i(), d("td", {
|
|
2074
|
-
key: String(ke.key),
|
|
2075
|
-
class: le(H(ke))
|
|
2076
|
-
}, [
|
|
2077
|
-
p("div", {
|
|
2078
|
-
class: "flex animate-pulse items-center gap-3 motion-reduce:animate-none",
|
|
2079
|
-
style: be({ animationDelay: `${m * 60}ms` })
|
|
2080
|
-
}, [
|
|
2081
|
-
$ === 0 ? (i(), d("span", Pn)) : L("", !0),
|
|
2082
|
-
p("span", An, [
|
|
2083
|
-
p("span", {
|
|
2084
|
-
class: "h-2.5 rounded-full bg-fill-strong",
|
|
2085
|
-
style: be({ width: `${55 + (m * 7 + $ * 13) % 35}%` })
|
|
2086
|
-
}, null, 4),
|
|
2087
|
-
p("span", {
|
|
2088
|
-
class: "h-2 rounded-full bg-fill",
|
|
2089
|
-
style: be({ width: `${30 + (m * 11 + $ * 5) % 30}%` })
|
|
2090
|
-
}, null, 4)
|
|
2091
|
-
])
|
|
2092
|
-
], 4)
|
|
2093
|
-
], 2))), 128)),
|
|
2094
|
-
de.value ? (i(), d("td", En, [...M[10] || (M[10] = [
|
|
2095
|
-
p("div", { class: "mx-auto h-6 w-6 animate-pulse rounded-full bg-fill motion-reduce:animate-none" }, null, -1)
|
|
2096
|
-
])])) : L("", !0)
|
|
2097
|
-
], 4))), 128)) : L("", !0),
|
|
2098
|
-
e.collection.display.value === "rows" ? (i(!0), d(I, { key: 1 }, Z(C.value, (m, ke) => (i(), d("tr", {
|
|
2099
|
-
key: e.collection.rowKey(m),
|
|
2100
|
-
class: le(["animate-row-in", T(m) ? "cursor-pointer" : void 0]),
|
|
2101
|
-
"data-test": "collection-row",
|
|
2102
|
-
style: be([e.rowHeight ? { height: `${e.rowHeight}px` } : {}, fe(ke)]),
|
|
2103
|
-
onClickCapture: M[7] || (M[7] = //@ts-ignore
|
|
2104
|
-
(...$) => n(z).onClickCapture && n(z).onClickCapture(...$)),
|
|
2105
|
-
onClick: ($) => n(z).onClick($, m),
|
|
2106
|
-
onContextmenu: ($) => n(z).onContextMenu($, m),
|
|
2107
|
-
onPointerdown: ($) => n(z).onPointerDown($, m)
|
|
2108
|
-
}, [
|
|
2109
|
-
(i(!0), d(I, null, Z(f.value, ($, St) => (i(), d("td", {
|
|
2110
|
-
key: String($.key),
|
|
2111
|
-
class: le(re($))
|
|
2112
|
-
}, [
|
|
2113
|
-
pe(g.$slots, j($), {
|
|
2114
|
-
item: m,
|
|
2115
|
-
value: U(m, $),
|
|
2116
|
-
compact: !1,
|
|
2117
|
-
to: T(m)
|
|
2118
|
-
}, () => [
|
|
2119
|
-
O(Te, {
|
|
2120
|
-
column: $,
|
|
2121
|
-
item: m,
|
|
2122
|
-
compact: !1,
|
|
2123
|
-
to: T(m),
|
|
2124
|
-
search: ae.value
|
|
2125
|
-
}, vt({ _: 2 }, [
|
|
2126
|
-
l.leading && St === 0 ? {
|
|
2127
|
-
name: "leading",
|
|
2128
|
-
fn: B(() => [
|
|
2129
|
-
pe(g.$slots, "leading", {
|
|
2130
|
-
item: m,
|
|
2131
|
-
compact: !1
|
|
2132
|
-
})
|
|
2133
|
-
]),
|
|
2134
|
-
key: "0"
|
|
2135
|
-
} : void 0
|
|
2136
|
-
]), 1032, ["column", "item", "to", "search"])
|
|
2137
|
-
])
|
|
2138
|
-
], 2))), 128)),
|
|
2139
|
-
de.value ? (i(), d("td", On, [
|
|
2140
|
-
pe(g.$slots, "actions", { item: m }, () => [
|
|
2141
|
-
p("div", Ln, [
|
|
2142
|
-
T(m) ? (i(), W(n(Vt), {
|
|
2143
|
-
key: 0,
|
|
2144
|
-
text: n(s)("core.collection.open_record"),
|
|
2145
|
-
side: "left"
|
|
2146
|
-
}, {
|
|
2147
|
-
default: B(() => [
|
|
2148
|
-
O(n(mt), {
|
|
2149
|
-
to: T(m),
|
|
2150
|
-
"aria-label": `${n(s)("core.collection.open_record")}${e.rowLabel ? `: ${e.rowLabel(m)}` : ""}`,
|
|
2151
|
-
class: "inline-flex rounded-md p-1.5 text-content-link transition-colors hover:bg-tint-soft focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus"
|
|
2152
|
-
}, {
|
|
2153
|
-
default: B(() => [
|
|
2154
|
-
O(n(J), {
|
|
2155
|
-
name: "eye",
|
|
2156
|
-
size: 18
|
|
2157
|
-
})
|
|
2158
|
-
]),
|
|
2159
|
-
_: 1
|
|
2160
|
-
}, 8, ["to", "aria-label"])
|
|
2161
|
-
]),
|
|
2162
|
-
_: 2
|
|
2163
|
-
}, 1032, ["text"])) : L("", !0),
|
|
2164
|
-
q.value && ve(m) ? (i(), d("button", {
|
|
2165
|
-
key: 1,
|
|
2166
|
-
type: "button",
|
|
2167
|
-
"data-test": "collection-row-more",
|
|
2168
|
-
"aria-label": me(m),
|
|
2169
|
-
class: "hit-target flex size-8 cursor-pointer items-center justify-center rounded-full bg-fill text-content-strong transition-colors duration-motion-fast hover:bg-fill-strong focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
|
|
2170
|
-
onClick: Re(($) => n(z).openMenuFrom($, m), ["stop"])
|
|
2171
|
-
}, [
|
|
2172
|
-
O(n(J), {
|
|
2173
|
-
name: "moreLine",
|
|
2174
|
-
size: 18
|
|
2175
|
-
})
|
|
2176
|
-
], 8, Tn)) : L("", !0)
|
|
2177
|
-
])
|
|
2178
|
-
])
|
|
2179
|
-
])) : L("", !0)
|
|
2180
|
-
], 46, jn))), 128)) : L("", !0),
|
|
2181
|
-
Ye.value ? (i(), d("tr", Rn, [
|
|
2182
|
-
p("td", {
|
|
2183
|
-
colspan: f.value.length + (de.value ? 1 : 0),
|
|
2184
|
-
class: "!whitespace-normal py-6"
|
|
2185
|
-
}, [
|
|
2186
|
-
O(n(Fe), {
|
|
2187
|
-
tone: "warning",
|
|
2188
|
-
role: "alert"
|
|
2189
|
-
}, {
|
|
2190
|
-
default: B(() => [
|
|
2191
|
-
p("div", Vn, [
|
|
2192
|
-
p("div", null, [
|
|
2193
|
-
p("p", Nn, y(n(s)("core.collection.failed.title")), 1),
|
|
2194
|
-
p("p", null, y(Ne.value), 1)
|
|
2195
|
-
]),
|
|
2196
|
-
O(he, {
|
|
2197
|
-
prominence: "secondary",
|
|
2198
|
-
size: "sm",
|
|
2199
|
-
onClick: M[8] || (M[8] = (m) => e.collection.refresh())
|
|
2200
|
-
}, {
|
|
2201
|
-
default: B(() => [
|
|
2202
|
-
ne(y(n(s)("core.actions.retry")), 1)
|
|
2203
|
-
]),
|
|
2204
|
-
_: 1
|
|
2205
|
-
})
|
|
2206
|
-
])
|
|
2207
|
-
]),
|
|
2208
|
-
_: 1
|
|
2209
|
-
})
|
|
2210
|
-
], 8, Mn)
|
|
2211
|
-
])) : L("", !0),
|
|
2212
|
-
e.collection.display.value === "empty" || e.collection.display.value === "no-matches" ? (i(), d("tr", In, [
|
|
2213
|
-
p("td", {
|
|
2214
|
-
colspan: f.value.length + (de.value ? 1 : 0),
|
|
2215
|
-
class: "!whitespace-normal py-6 text-center"
|
|
2216
|
-
}, [
|
|
2217
|
-
e.collection.display.value === "empty" && l.empty ? pe(g.$slots, "empty", {}, void 0, void 0, 0) : ce.value.length > 0 ? (i(), W(at, {
|
|
2218
|
-
key: 1,
|
|
2219
|
-
chips: ce.value,
|
|
2220
|
-
"last-chip": h.value,
|
|
2221
|
-
onRemove: w,
|
|
2222
|
-
onClearAll: o
|
|
2223
|
-
}, null, 8, ["chips", "last-chip"])) : (i(), W(n(Ze), {
|
|
2224
|
-
key: 2,
|
|
2225
|
-
title: n(s)("core.collection.no_data"),
|
|
2226
|
-
description: n(s)("core.collection.no_results")
|
|
2227
|
-
}, null, 8, ["title", "description"]))
|
|
2228
|
-
], 8, Fn)
|
|
2229
|
-
])) : L("", !0)
|
|
2230
|
-
])
|
|
2231
|
-
], 2)
|
|
2232
|
-
], 4)
|
|
2233
|
-
])),
|
|
2234
|
-
O(Dl, {
|
|
2235
|
-
collection: e.collection,
|
|
2236
|
-
compact: n(c),
|
|
2237
|
-
flat: v.value,
|
|
2238
|
-
onTurned: G
|
|
2239
|
-
}, null, 8, ["collection", "compact", "flat"])
|
|
2240
|
-
], 2),
|
|
2241
|
-
e.rowActions ? (i(), W(n(We), {
|
|
2242
|
-
key: 1,
|
|
2243
|
-
ref_key: "rowMenu",
|
|
2244
|
-
ref: E,
|
|
2245
|
-
items: n(z).menuItems.value,
|
|
2246
|
-
label: n(z).menuLabel.value
|
|
2247
|
-
}, null, 8, ["items", "label"])) : L("", !0)
|
|
2248
|
-
], 8, Qo));
|
|
2249
|
-
}
|
|
2250
|
-
}), ms = /* @__PURE__ */ we({
|
|
2251
|
-
__name: "CollectionPage",
|
|
2252
|
-
props: {
|
|
2253
|
-
collection: {},
|
|
2254
|
-
title: {},
|
|
2255
|
-
description: { default: void 0 },
|
|
2256
|
-
icon: { default: void 0 },
|
|
2257
|
-
actions: { default: () => [] },
|
|
2258
|
-
rowActions: { type: Function, default: void 0 },
|
|
2259
|
-
rowLabel: { type: Function, default: void 0 },
|
|
2260
|
-
rowHeight: { default: void 0 },
|
|
2261
|
-
density: { default: "regular" },
|
|
2262
|
-
viewsPresentation: { default: "segmented" },
|
|
2263
|
-
actionsVisible: { type: Boolean, default: !1 }
|
|
2264
|
-
},
|
|
2265
|
-
setup(t) {
|
|
2266
|
-
const e = t, l = _(() => Object.keys(Ue()).filter((r) => r !== "default")), s = _(() => e.collection.total.value || null);
|
|
2267
|
-
return (r, a) => (i(), W(n(Rt), {
|
|
2268
|
-
title: e.title,
|
|
2269
|
-
description: e.description,
|
|
2270
|
-
icon: e.icon,
|
|
2271
|
-
count: s.value,
|
|
2272
|
-
actions: e.actions
|
|
2273
|
-
}, {
|
|
2274
|
-
default: B(() => [
|
|
2275
|
-
O(Dn, {
|
|
2276
|
-
collection: e.collection,
|
|
2277
|
-
"row-actions": e.rowActions,
|
|
2278
|
-
"row-label": e.rowLabel,
|
|
2279
|
-
"row-height": e.rowHeight,
|
|
2280
|
-
density: e.density,
|
|
2281
|
-
"views-presentation": e.viewsPresentation,
|
|
2282
|
-
"actions-visible": e.actionsVisible
|
|
2283
|
-
}, vt({ _: 2 }, [
|
|
2284
|
-
Z(l.value, (c) => ({
|
|
2285
|
-
name: c,
|
|
2286
|
-
fn: B((f) => [
|
|
2287
|
-
pe(r.$slots, c, Pt(At(f ?? {})))
|
|
2288
|
-
])
|
|
2289
|
-
}))
|
|
2290
|
-
]), 1032, ["collection", "row-actions", "row-label", "row-height", "density", "views-presentation", "actions-visible"]),
|
|
2291
|
-
pe(r.$slots, "default")
|
|
2292
|
-
]),
|
|
2293
|
-
_: 3
|
|
2294
|
-
}, 8, ["title", "description", "icon", "count", "actions"]));
|
|
78
|
+
_: 2
|
|
79
|
+
}, 1032, ["text"]))), 128))
|
|
80
|
+
])) : g("", !0);
|
|
2295
81
|
}
|
|
2296
|
-
}),
|
|
2297
|
-
function
|
|
2298
|
-
const { t:
|
|
82
|
+
}), P = ["today", "yesterday", "this_week", "last_week", "this_month", "last_month", "this_year", "last_year"];
|
|
83
|
+
function B(r, s) {
|
|
84
|
+
const { t: n } = E();
|
|
2299
85
|
return {
|
|
2300
|
-
key:
|
|
86
|
+
key: r,
|
|
2301
87
|
icon: "calendarEventFill",
|
|
2302
|
-
label:
|
|
88
|
+
label: s ?? n("core.collection.date_presets.label"),
|
|
2303
89
|
type: "select",
|
|
2304
|
-
options:
|
|
90
|
+
options: P.map((o) => ({ value: o, label: n(`core.collection.date_presets.options.${o}`) }))
|
|
2305
91
|
};
|
|
2306
92
|
}
|
|
2307
93
|
export {
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
94
|
+
W as CollectionCell,
|
|
95
|
+
Z as CollectionPage,
|
|
96
|
+
q as CollectionTable,
|
|
97
|
+
P as DATE_PRESETS,
|
|
98
|
+
M as DEFAULT_PAGE_SIZES,
|
|
99
|
+
te as DataTable,
|
|
100
|
+
O as LIST_CONTEXT_PARAM,
|
|
101
|
+
Y as RecordIdentity,
|
|
102
|
+
$ as RowActions,
|
|
103
|
+
R as createMemorySavedViews,
|
|
104
|
+
V as defineCollection,
|
|
105
|
+
j as httpList,
|
|
106
|
+
U as listParams,
|
|
107
|
+
G as readListPage,
|
|
108
|
+
H as useCollection,
|
|
109
|
+
K as useCollectionNeighbors,
|
|
110
|
+
B as useDatePresetFilter
|
|
2323
111
|
};
|