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