@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
|
@@ -38,15 +38,15 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
38
38
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
39
39
|
onClick?: ((event: KeyboardEvent | MouseEvent) => any) | undefined;
|
|
40
40
|
}>, {
|
|
41
|
-
|
|
41
|
+
to: RouteLocationRaw;
|
|
42
|
+
disabled: boolean;
|
|
42
43
|
type: "button" | "submit";
|
|
44
|
+
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
43
45
|
prominence: "primary" | "secondary" | "standard" | "plain" | "link";
|
|
44
46
|
tone: "critical";
|
|
45
47
|
icon: IconName;
|
|
46
48
|
trailingIcon: IconName;
|
|
47
|
-
to: RouteLocationRaw;
|
|
48
49
|
href: string;
|
|
49
|
-
disabled: boolean;
|
|
50
50
|
processing: boolean;
|
|
51
51
|
keyboardShortcut: KeyboardShortcut;
|
|
52
52
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
package/dist/button/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as a, m as o, s as r, u, a as e } from "../Button.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { _ as a, m as o, s as r, u, a as e } from "../Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
|
|
2
2
|
export {
|
|
3
3
|
a as Button,
|
|
4
4
|
o as matchesShortcut,
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { getCurrentInstance as p, inject as w, ref as c, shallowRef as T, computed as m, watch as C, toValue as s, onBeforeUnmount as M } from "vue";
|
|
2
|
+
import { d as k } from "./context-Ch1r4fdN.js";
|
|
3
|
+
const y = 30;
|
|
4
|
+
function O() {
|
|
5
|
+
const l = c(null), a = c(""), u = c(!0), n = T(/* @__PURE__ */ new Map()), v = c(0), r = /* @__PURE__ */ new Map();
|
|
6
|
+
let f = null, o = null;
|
|
7
|
+
const d = m(() => Array.from(n.value.values())), h = m(() => d.value.flatMap((e) => e.actions)), i = (e) => m(() => d.value.map((t) => t[e]).filter((t) => t != null).pop() ?? null);
|
|
8
|
+
return {
|
|
9
|
+
back: l,
|
|
10
|
+
title: a,
|
|
11
|
+
titleInView: u,
|
|
12
|
+
actions: h,
|
|
13
|
+
leading: i("leading"),
|
|
14
|
+
status: i("status"),
|
|
15
|
+
navTitle: i("navTitle"),
|
|
16
|
+
documentTitle: i("documentTitle"),
|
|
17
|
+
hasShell: m(() => v.value > 0),
|
|
18
|
+
claimShell() {
|
|
19
|
+
v.value++;
|
|
20
|
+
let e = !1;
|
|
21
|
+
return () => {
|
|
22
|
+
e || v.value--, e = !0;
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
claim() {
|
|
26
|
+
const e = Symbol("page-chrome-owner");
|
|
27
|
+
return {
|
|
28
|
+
setBack(t) {
|
|
29
|
+
f = e, l.value = t;
|
|
30
|
+
},
|
|
31
|
+
clearBack() {
|
|
32
|
+
f === e && (f = null, l.value = null);
|
|
33
|
+
},
|
|
34
|
+
setTitle(t) {
|
|
35
|
+
o !== e && (u.value = !0), o = e, a.value = t;
|
|
36
|
+
},
|
|
37
|
+
setTitleInView(t) {
|
|
38
|
+
o === e && (u.value = t);
|
|
39
|
+
},
|
|
40
|
+
clearTitle() {
|
|
41
|
+
o === e && (o = null, a.value = "", u.value = !0);
|
|
42
|
+
},
|
|
43
|
+
setRegistration(t) {
|
|
44
|
+
n.value = new Map(n.value).set(e, t);
|
|
45
|
+
},
|
|
46
|
+
clearRegistration() {
|
|
47
|
+
if (!n.value.has(e)) return;
|
|
48
|
+
const t = new Map(n.value);
|
|
49
|
+
t.delete(e), n.value = t;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
focusMemory: {
|
|
54
|
+
take(e) {
|
|
55
|
+
const t = r.get(e);
|
|
56
|
+
return r.delete(e), t;
|
|
57
|
+
},
|
|
58
|
+
put(e, t) {
|
|
59
|
+
r.delete(e), r.set(e, t), r.size > y && r.delete(r.keys().next().value ?? "");
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
const [g, R] = k("vue-core.pageChrome");
|
|
65
|
+
function P(l) {
|
|
66
|
+
const a = O();
|
|
67
|
+
return l.provide(g, a), a;
|
|
68
|
+
}
|
|
69
|
+
function b() {
|
|
70
|
+
return p() ? w(g, null) : null;
|
|
71
|
+
}
|
|
72
|
+
function S(l) {
|
|
73
|
+
const u = R().claim();
|
|
74
|
+
C(
|
|
75
|
+
() => ({
|
|
76
|
+
actions: s(l.actions) ?? [],
|
|
77
|
+
leading: s(l.leading) ?? null,
|
|
78
|
+
status: s(l.status) ?? null,
|
|
79
|
+
navTitle: s(l.navTitle) ?? null,
|
|
80
|
+
documentTitle: s(l.documentTitle) ?? null
|
|
81
|
+
}),
|
|
82
|
+
(n) => u.setRegistration(n),
|
|
83
|
+
{ immediate: !0, deep: !0 }
|
|
84
|
+
), M(() => u.clearRegistration());
|
|
85
|
+
}
|
|
86
|
+
export {
|
|
87
|
+
R as a,
|
|
88
|
+
b,
|
|
89
|
+
O as c,
|
|
90
|
+
P as i,
|
|
91
|
+
g as p,
|
|
92
|
+
S as u
|
|
93
|
+
};
|
package/dist/client/client.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type QueryValue } from "./encode";
|
|
2
2
|
import { type ApiResult } from "./envelope";
|
|
3
3
|
import { ApiError } from "./error";
|
|
4
|
+
import type { ApiRoute } from "./route";
|
|
4
5
|
import { type Transport } from "./transport";
|
|
5
6
|
export interface RequestOptions {
|
|
6
7
|
query?: Readonly<Record<string, QueryValue>>;
|
|
@@ -34,7 +35,18 @@ export interface HttpClientOptions {
|
|
|
34
35
|
*/
|
|
35
36
|
onUnauthorized?: (context: UnauthorizedContext) => UnauthorizedDecision | Promise<UnauthorizedDecision>;
|
|
36
37
|
}
|
|
38
|
+
/** A route that takes no input (`void`, or an empty object) needs no second argument. */
|
|
39
|
+
type RequestArguments<In> = [In] extends [void] ? [input?: undefined, options?: RequestOptions] : [In] extends [Record<string, never>] ? [input?: In, options?: RequestOptions] : [input: In, options?: RequestOptions];
|
|
40
|
+
/** A route declared `void` has no body: its data is `null`. */
|
|
41
|
+
export type RouteResult<Out> = ApiResult<[Out] extends [void] ? null : Out>;
|
|
37
42
|
export interface HttpClient {
|
|
43
|
+
/**
|
|
44
|
+
* Calls a declared route: `:name` segments of the path are filled from `input` (encoded), the rest of
|
|
45
|
+
* `input` is the query for GET and DELETE and the JSON body for POST, PUT and PATCH. A missing path
|
|
46
|
+
* parameter rejects with a plain `Error` (a bug in the caller, not an answer from the server) before
|
|
47
|
+
* anything is sent. Abort, request ids and 401 handling are those of `get` and `post`.
|
|
48
|
+
*/
|
|
49
|
+
request<In, Out>(route: ApiRoute<In, Out>, ...args: RequestArguments<In>): Promise<RouteResult<Out>>;
|
|
38
50
|
get<TData = unknown, TMeta = unknown>(path: string, options?: RequestOptions): Promise<ApiResult<TData, TMeta>>;
|
|
39
51
|
post<TData = unknown, TMeta = unknown>(path: string, body?: unknown, options?: RequestOptions): Promise<ApiResult<TData, TMeta>>;
|
|
40
52
|
put<TData = unknown, TMeta = unknown>(path: string, body?: unknown, options?: RequestOptions): Promise<ApiResult<TData, TMeta>>;
|
|
@@ -43,3 +55,4 @@ export interface HttpClient {
|
|
|
43
55
|
}
|
|
44
56
|
/** A client over a transport. Nothing is global: every call of this factory is independent. */
|
|
45
57
|
export declare function createHttpClient(options?: HttpClientOptions): HttpClient;
|
|
58
|
+
export {};
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { createHttpClient } from "./client";
|
|
2
|
-
export type { HttpClient, HttpClientOptions, RequestOptions, UnauthorizedContext, UnauthorizedDecision } from "./client";
|
|
2
|
+
export type { HttpClient, RouteResult, HttpClientOptions, RequestOptions, UnauthorizedContext, UnauthorizedDecision } from "./client";
|
|
3
3
|
export type { QueryValue } from "./encode";
|
|
4
4
|
export { REQUEST_ID_HEADER } from "./envelope";
|
|
5
5
|
export type { ApiResult } from "./envelope";
|
|
@@ -7,3 +7,5 @@ export { ApiError, isAborted, isApiError } from "./error";
|
|
|
7
7
|
export type { ApiErrorInit, ApiErrorKind, FieldErrors } from "./error";
|
|
8
8
|
export { fetchTransport } from "./transport";
|
|
9
9
|
export type { Transport } from "./transport";
|
|
10
|
+
export { route } from "./route";
|
|
11
|
+
export type { HttpMethod, ListResult, RawRoute, ApiRoute, RouteOptions, ViewCount } from "./route";
|
package/dist/client/index.js
CHANGED
|
@@ -1,140 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const e = new URLSearchParams();
|
|
6
|
-
for (const [n, r] of Object.entries(t))
|
|
7
|
-
if (!(r == null || r === ""))
|
|
8
|
-
if (Array.isArray(r)) for (const i of r) e.append(n, String(i));
|
|
9
|
-
else e.append(n, String(r));
|
|
10
|
-
return e.toString();
|
|
11
|
-
}
|
|
12
|
-
const h = (t) => typeof Blob < "u" && t instanceof Blob;
|
|
13
|
-
function D(t) {
|
|
14
|
-
const e = new FormData();
|
|
15
|
-
for (const [n, r] of Object.entries(t))
|
|
16
|
-
if (r != null)
|
|
17
|
-
if (Array.isArray(r))
|
|
18
|
-
for (const i of r) e.append(`${n}[]`, T(i));
|
|
19
|
-
else
|
|
20
|
-
e.append(n, T(r));
|
|
21
|
-
return e;
|
|
22
|
-
}
|
|
23
|
-
function T(t) {
|
|
24
|
-
return h(t) ? t : t instanceof Date ? t.toISOString() : typeof t == "object" && t !== null ? JSON.stringify(t) : String(t);
|
|
25
|
-
}
|
|
26
|
-
function O(t) {
|
|
27
|
-
if (t === void 0) return { body: void 0, contentType: null };
|
|
28
|
-
if (typeof t == "string" || t instanceof FormData || t instanceof URLSearchParams || t instanceof ArrayBuffer || ArrayBuffer.isView(t) || h(t))
|
|
29
|
-
return { body: t, contentType: null };
|
|
30
|
-
if (typeof t == "object" && t !== null && !Array.isArray(t)) {
|
|
31
|
-
const e = t;
|
|
32
|
-
if (Object.values(e).some((n) => h(n) || Array.isArray(n) && n.some(h)))
|
|
33
|
-
return { body: D(e), contentType: null };
|
|
34
|
-
}
|
|
35
|
-
return { body: JSON.stringify(t), contentType: "application/json" };
|
|
36
|
-
}
|
|
37
|
-
function q() {
|
|
38
|
-
const t = new Uint8Array(16);
|
|
39
|
-
return globalThis.crypto.getRandomValues(t), Array.from(t, (e) => e.toString(16).padStart(2, "0")).join("");
|
|
40
|
-
}
|
|
41
|
-
const g = "X-Request-ID", A = (t) => typeof t == "object" && t !== null && !Array.isArray(t), m = (t) => typeof t == "string" && t !== "" ? t : null;
|
|
42
|
-
function B(t) {
|
|
43
|
-
const e = t?.errors ?? t?.fields;
|
|
44
|
-
if (!A(e)) return {};
|
|
45
|
-
const n = {};
|
|
46
|
-
for (const [r, i] of Object.entries(e))
|
|
47
|
-
Array.isArray(i) ? n[r] = i.map(String) : i != null && (n[r] = [String(i)]);
|
|
48
|
-
return n;
|
|
49
|
-
}
|
|
50
|
-
async function z(t) {
|
|
51
|
-
const e = await t.text();
|
|
52
|
-
if (e.trim() === "") return { payload: null, readable: !0 };
|
|
53
|
-
try {
|
|
54
|
-
return { payload: JSON.parse(e), readable: !0 };
|
|
55
|
-
} catch {
|
|
56
|
-
return { payload: null, readable: !1 };
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
async function x(t, e) {
|
|
60
|
-
const n = t.headers.get(g) ?? e, { payload: r, readable: i } = await z(t), o = A(r) ? r : null;
|
|
61
|
-
if (!t.ok) {
|
|
62
|
-
const a = B(o), s = o?.params;
|
|
63
|
-
throw new p({
|
|
64
|
-
kind: U(t.status, Object.keys(a).length > 0),
|
|
65
|
-
message: m(o?.error) ?? m(o?.message) ?? `Request failed with status ${t.status}`,
|
|
66
|
-
status: t.status,
|
|
67
|
-
fields: a,
|
|
68
|
-
code: m(o?.code),
|
|
69
|
-
params: A(s) ? s : null,
|
|
70
|
-
requestId: n,
|
|
71
|
-
payload: r
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
if (!i)
|
|
75
|
-
throw new p({
|
|
76
|
-
kind: "malformed",
|
|
77
|
-
message: `The server answered ${t.status} with a body that is not JSON`,
|
|
78
|
-
status: t.status,
|
|
79
|
-
requestId: n
|
|
80
|
-
});
|
|
81
|
-
return o !== null && typeof o.success == "boolean" ? {
|
|
82
|
-
data: o.data ?? null,
|
|
83
|
-
meta: o.meta ?? null,
|
|
84
|
-
message: m(o.message),
|
|
85
|
-
status: t.status,
|
|
86
|
-
requestId: n
|
|
87
|
-
} : { data: r, meta: null, message: null, status: t.status, requestId: n };
|
|
88
|
-
}
|
|
89
|
-
const F = (t, e) => globalThis.fetch(t, e), H = (t) => /^[a-z][a-z0-9+.-]*:\/\//i.test(t);
|
|
90
|
-
function P(t, e, n) {
|
|
91
|
-
const r = H(e) || t === "" ? e : `${t.replace(/\/+$/, "")}/${e.replace(/^\/+/, "")}`;
|
|
92
|
-
return n === "" ? r : `${r}${r.includes("?") ? "&" : "?"}${n}`;
|
|
93
|
-
}
|
|
94
|
-
const S = (t, e) => new p({ kind: "aborted", message: "The request was cancelled", requestId: t, cause: e });
|
|
95
|
-
function J(t = {}) {
|
|
96
|
-
const { baseUrl: e = "", transport: n = F, credentials: r = "include" } = t;
|
|
97
|
-
async function i(a, s, u, d) {
|
|
98
|
-
const { signal: f } = d, l = t.requestId === !1 ? null : (t.requestId ?? q)();
|
|
99
|
-
if (f?.aborted) throw S(l, f.reason);
|
|
100
|
-
const w = O(u), y = new Headers({ Accept: "application/json" }), E = t.headers ? await t.headers() : void 0;
|
|
101
|
-
for (const c of [E, d.headers])
|
|
102
|
-
c && new Headers(c).forEach((I, R) => y.set(R, I));
|
|
103
|
-
l !== null && !y.has(g) && y.set(g, l), w.contentType !== null && !y.has("Content-Type") && y.set("Content-Type", w.contentType);
|
|
104
|
-
const j = { method: a, headers: y, credentials: r, body: w.body, signal: f }, k = P(e, s, $(d.query));
|
|
105
|
-
try {
|
|
106
|
-
const c = await n(k, j);
|
|
107
|
-
return await x(c, l);
|
|
108
|
-
} catch (c) {
|
|
109
|
-
throw b(c) ? c : f?.aborted || c instanceof Error && c.name === "AbortError" ? S(l, c) : new p({
|
|
110
|
-
kind: "network",
|
|
111
|
-
message: c instanceof Error ? c.message : "The server could not be reached",
|
|
112
|
-
requestId: l,
|
|
113
|
-
cause: c
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
async function o(a, s, u, d = {}) {
|
|
118
|
-
try {
|
|
119
|
-
return await i(a, s, u, d);
|
|
120
|
-
} catch (f) {
|
|
121
|
-
if (!b(f) || f.kind !== "unauthorized" || d.handleUnauthorized === !1 || !t.onUnauthorized || await t.onUnauthorized({ error: f, method: a, path: s }) !== "retry") throw f;
|
|
122
|
-
return i(a, s, u, d);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
return {
|
|
126
|
-
get: (a, s) => o("GET", a, void 0, s),
|
|
127
|
-
post: (a, s, u) => o("POST", a, s, u),
|
|
128
|
-
put: (a, s, u) => o("PUT", a, s, u),
|
|
129
|
-
patch: (a, s, u) => o("PATCH", a, s, u),
|
|
130
|
-
delete: (a, s) => o("DELETE", a, void 0, s)
|
|
131
|
-
};
|
|
132
|
-
}
|
|
1
|
+
import { R as t, c as a } from "../client-k9euDWF4.js";
|
|
2
|
+
import { A as s, i as p, a as f } from "../error-CD7x0Jrz.js";
|
|
3
|
+
import { f as E } from "../transport-BnP7WC0Y.js";
|
|
4
|
+
import { r as m } from "../route-goWMxDUN.js";
|
|
133
5
|
export {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
6
|
+
s as ApiError,
|
|
7
|
+
t as REQUEST_ID_HEADER,
|
|
8
|
+
a as createHttpClient,
|
|
9
|
+
E as fetchTransport,
|
|
10
|
+
p as isAborted,
|
|
11
|
+
f as isApiError,
|
|
12
|
+
m as route
|
|
140
13
|
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
declare const types: unique symbol;
|
|
2
|
+
export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
3
|
+
export interface RouteOptions {
|
|
4
|
+
/** The permission the route needs (`"tickets.ticket:view"`); the server enforces it, the client can read it for links and menus. */
|
|
5
|
+
readonly permission?: string;
|
|
6
|
+
/** True for routes that need no session. */
|
|
7
|
+
readonly public?: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface RouteBase {
|
|
10
|
+
readonly method: HttpMethod;
|
|
11
|
+
/** Versioned and relative to the client's `baseUrl`; `:name` segments are filled from the input. */
|
|
12
|
+
readonly path: string;
|
|
13
|
+
readonly permission?: string;
|
|
14
|
+
readonly public: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** A typed call: `In` is what `client.request` takes, `Out` what it resolves to (`void`: no body). */
|
|
17
|
+
export interface ApiRoute<In, Out> extends RouteBase {
|
|
18
|
+
readonly raw: false;
|
|
19
|
+
/** Type-only; never set. */
|
|
20
|
+
readonly [types]?: {
|
|
21
|
+
readonly in: In;
|
|
22
|
+
readonly out: Out;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/** A route without a JSON answer (an event stream, a file): it keeps method and path for links, `client.request` refuses it. */
|
|
26
|
+
export interface RawRoute extends RouteBase {
|
|
27
|
+
readonly raw: true;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Declares one endpoint. go-core's generator writes these; the types come from the Go input and response.
|
|
31
|
+
*
|
|
32
|
+
* route<ShowInput, Ticket>("GET", "/v1/tickets/:id", { permission: "tickets.ticket:view" })
|
|
33
|
+
*/
|
|
34
|
+
export declare function route<In, Out>(method: HttpMethod, path: string, options?: RouteOptions): ApiRoute<In, Out>;
|
|
35
|
+
export declare namespace route {
|
|
36
|
+
var raw: (method: HttpMethod, path: string, options?: RouteOptions) => RawRoute;
|
|
37
|
+
}
|
|
38
|
+
/** One tab's count in `meta.views` (go-core `datatable.ViewCount`). */
|
|
39
|
+
export interface ViewCount {
|
|
40
|
+
readonly key: string;
|
|
41
|
+
readonly count: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The wire shape of go-core's `datatable.DatatableResult[T]`: a page of rows with its numbers.
|
|
45
|
+
* `readListPage` (`/collection`) reads it into a `ListPage` with no glue.
|
|
46
|
+
*/
|
|
47
|
+
export interface ListResult<Row> {
|
|
48
|
+
readonly data: readonly Row[];
|
|
49
|
+
readonly meta?: Readonly<Record<string, unknown>> & {
|
|
50
|
+
readonly views?: readonly ViewCount[];
|
|
51
|
+
};
|
|
52
|
+
readonly total: number;
|
|
53
|
+
readonly per_page: number;
|
|
54
|
+
readonly current_page: number;
|
|
55
|
+
readonly last_page: number;
|
|
56
|
+
readonly from: number;
|
|
57
|
+
readonly to: number;
|
|
58
|
+
}
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { A, k as I, a as S } from "./error-CD7x0Jrz.js";
|
|
2
|
+
import { f as U } from "./transport-BnP7WC0Y.js";
|
|
3
|
+
function D(t) {
|
|
4
|
+
if (!t) return "";
|
|
5
|
+
const e = new URLSearchParams();
|
|
6
|
+
for (const [a, r] of Object.entries(t))
|
|
7
|
+
if (!(r == null || r === ""))
|
|
8
|
+
if (Array.isArray(r)) for (const i of r) e.append(a, String(i));
|
|
9
|
+
else e.append(a, String(r));
|
|
10
|
+
return e.toString();
|
|
11
|
+
}
|
|
12
|
+
const g = (t) => typeof Blob < "u" && t instanceof Blob;
|
|
13
|
+
function z(t) {
|
|
14
|
+
const e = new FormData();
|
|
15
|
+
for (const [a, r] of Object.entries(t))
|
|
16
|
+
if (r != null)
|
|
17
|
+
if (Array.isArray(r))
|
|
18
|
+
for (const i of r) e.append(`${a}[]`, E(i));
|
|
19
|
+
else
|
|
20
|
+
e.append(a, E(r));
|
|
21
|
+
return e;
|
|
22
|
+
}
|
|
23
|
+
function E(t) {
|
|
24
|
+
return g(t) ? t : t instanceof Date ? t.toISOString() : typeof t == "object" && t !== null ? JSON.stringify(t) : String(t);
|
|
25
|
+
}
|
|
26
|
+
function v(t) {
|
|
27
|
+
if (t === void 0) return { body: void 0, contentType: null };
|
|
28
|
+
if (typeof t == "string" || t instanceof FormData || t instanceof URLSearchParams || t instanceof ArrayBuffer || ArrayBuffer.isView(t) || g(t))
|
|
29
|
+
return { body: t, contentType: null };
|
|
30
|
+
if (typeof t == "object" && t !== null && !Array.isArray(t)) {
|
|
31
|
+
const e = t;
|
|
32
|
+
if (Object.values(e).some((a) => g(a) || Array.isArray(a) && a.some(g)))
|
|
33
|
+
return { body: z(e), contentType: null };
|
|
34
|
+
}
|
|
35
|
+
return { body: JSON.stringify(t), contentType: "application/json" };
|
|
36
|
+
}
|
|
37
|
+
function B() {
|
|
38
|
+
const t = new Uint8Array(16);
|
|
39
|
+
return globalThis.crypto.getRandomValues(t), Array.from(t, (e) => e.toString(16).padStart(2, "0")).join("");
|
|
40
|
+
}
|
|
41
|
+
const b = "X-Request-ID", T = (t) => typeof t == "object" && t !== null && !Array.isArray(t), w = (t) => typeof t == "string" && t !== "" ? t : null;
|
|
42
|
+
function O(t) {
|
|
43
|
+
const e = t?.errors ?? t?.fields;
|
|
44
|
+
if (!T(e)) return {};
|
|
45
|
+
const a = {};
|
|
46
|
+
for (const [r, i] of Object.entries(e))
|
|
47
|
+
Array.isArray(i) ? a[r] = i.map(String) : i != null && (a[r] = [String(i)]);
|
|
48
|
+
return a;
|
|
49
|
+
}
|
|
50
|
+
async function C(t) {
|
|
51
|
+
const e = await t.text();
|
|
52
|
+
if (e.trim() === "") return { payload: null, readable: !0 };
|
|
53
|
+
try {
|
|
54
|
+
return { payload: JSON.parse(e), readable: !0 };
|
|
55
|
+
} catch {
|
|
56
|
+
return { payload: null, readable: !1 };
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
async function F(t, e) {
|
|
60
|
+
const a = t.headers.get(b) ?? e, { payload: r, readable: i } = await C(t), o = T(r) ? r : null;
|
|
61
|
+
if (!t.ok) {
|
|
62
|
+
const m = O(o), n = o?.params;
|
|
63
|
+
throw new A({
|
|
64
|
+
kind: I(t.status, Object.keys(m).length > 0),
|
|
65
|
+
message: w(o?.error) ?? w(o?.message) ?? `Request failed with status ${t.status}`,
|
|
66
|
+
status: t.status,
|
|
67
|
+
fields: m,
|
|
68
|
+
code: w(o?.code),
|
|
69
|
+
params: T(n) ? n : null,
|
|
70
|
+
requestId: a,
|
|
71
|
+
payload: r
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
if (!i)
|
|
75
|
+
throw new A({
|
|
76
|
+
kind: "malformed",
|
|
77
|
+
message: `The server answered ${t.status} with a body that is not JSON`,
|
|
78
|
+
status: t.status,
|
|
79
|
+
requestId: a
|
|
80
|
+
});
|
|
81
|
+
return o !== null && typeof o.success == "boolean" ? {
|
|
82
|
+
data: o.data ?? null,
|
|
83
|
+
meta: o.meta ?? null,
|
|
84
|
+
message: w(o.message),
|
|
85
|
+
status: t.status,
|
|
86
|
+
requestId: a
|
|
87
|
+
} : { data: r, meta: null, message: null, status: t.status, requestId: a };
|
|
88
|
+
}
|
|
89
|
+
const H = (t) => /^[a-z][a-z0-9+.-]*:\/\//i.test(t);
|
|
90
|
+
function P(t, e, a) {
|
|
91
|
+
const r = H(e) || t === "" ? e : `${t.replace(/\/+$/, "")}/${e.replace(/^\/+/, "")}`;
|
|
92
|
+
return a === "" ? r : `${r}${r.includes("?") ? "&" : "?"}${a}`;
|
|
93
|
+
}
|
|
94
|
+
const j = (t, e) => new A({ kind: "aborted", message: "The request was cancelled", requestId: t, cause: e });
|
|
95
|
+
function J(t = {}) {
|
|
96
|
+
const { baseUrl: e = "", transport: a = U, credentials: r = "include" } = t;
|
|
97
|
+
async function i(n, s, c, u) {
|
|
98
|
+
const { signal: f } = u, y = t.requestId === !1 ? null : (t.requestId ?? B)();
|
|
99
|
+
if (f?.aborted) throw j(y, f.reason);
|
|
100
|
+
const p = v(c), l = new Headers({ Accept: "application/json" }), h = t.headers ? await t.headers() : void 0;
|
|
101
|
+
for (const d of [h, u.headers])
|
|
102
|
+
d && new Headers(d).forEach(($, q) => l.set(q, $));
|
|
103
|
+
y !== null && !l.has(b) && l.set(b, y), p.contentType !== null && !l.has("Content-Type") && l.set("Content-Type", p.contentType);
|
|
104
|
+
const k = { method: n, headers: l, credentials: r, body: p.body, signal: f }, R = P(e, s, D(u.query));
|
|
105
|
+
try {
|
|
106
|
+
const d = await a(R, k);
|
|
107
|
+
return await F(d, y);
|
|
108
|
+
} catch (d) {
|
|
109
|
+
throw S(d) ? d : f?.aborted || d instanceof Error && d.name === "AbortError" ? j(y, d) : new A({
|
|
110
|
+
kind: "network",
|
|
111
|
+
message: d instanceof Error ? d.message : "The server could not be reached",
|
|
112
|
+
requestId: y,
|
|
113
|
+
cause: d
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
async function o(n, s, c, u = {}) {
|
|
118
|
+
try {
|
|
119
|
+
return await i(n, s, c, u);
|
|
120
|
+
} catch (f) {
|
|
121
|
+
if (!S(f) || f.kind !== "unauthorized" || u.handleUnauthorized === !1 || !t.onUnauthorized || await t.onUnauthorized({ error: f, method: n, path: s }) !== "retry") throw f;
|
|
122
|
+
return i(n, s, c, u);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
async function m(n, s, c = {}) {
|
|
126
|
+
const u = typeof s == "object" && s !== null && !Array.isArray(s) ? { ...s } : {}, f = n.path.replace(/:([A-Za-z_][A-Za-z0-9_]*)/g, (p, l) => {
|
|
127
|
+
const h = u[l];
|
|
128
|
+
if (h == null || h === "")
|
|
129
|
+
throw new Error(`${n.method} ${n.path}: the input has no value for the path parameter "${l}"`);
|
|
130
|
+
return delete u[l], encodeURIComponent(String(h));
|
|
131
|
+
}), y = Object.keys(u).length > 0;
|
|
132
|
+
return n.method === "GET" || n.method === "DELETE" ? o(n.method, f, void 0, { ...c, query: { ...u, ...c.query } }) : o(n.method, f, y ? u : void 0, c);
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
// the rest-tuple overload is the public contract; the implementation takes its arguments positionally
|
|
136
|
+
request: m,
|
|
137
|
+
get: (n, s) => o("GET", n, void 0, s),
|
|
138
|
+
post: (n, s, c) => o("POST", n, s, c),
|
|
139
|
+
put: (n, s, c) => o("PUT", n, s, c),
|
|
140
|
+
patch: (n, s, c) => o("PATCH", n, s, c),
|
|
141
|
+
delete: (n, s) => o("DELETE", n, void 0, s)
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
export {
|
|
145
|
+
b as R,
|
|
146
|
+
J as c
|
|
147
|
+
};
|
|
@@ -21,6 +21,8 @@ export interface QueryContract<Sort extends string, Filter extends string, View
|
|
|
21
21
|
readonly sensitive?: readonly Filter[];
|
|
22
22
|
/** Default: `DEFAULT_PAGE_SIZES`. */
|
|
23
23
|
readonly pageSizes?: readonly number[];
|
|
24
|
+
/** Whether the backend searches by text. `false` leaves the search field out of the toolbar (a list the server only filters). Default true. */
|
|
25
|
+
readonly search?: boolean;
|
|
24
26
|
}
|
|
25
27
|
export type CollectionDefaults<Sort extends string, Filter extends string, View extends string> = Partial<CollectionQuery<Sort, Filter, View>>;
|
|
26
28
|
/** The state a stored version of a list's state (a link, a saved view) is migrated from. */
|
|
@@ -56,6 +58,7 @@ export interface CollectionDefinition<Row, Sort extends string = string, Filter
|
|
|
56
58
|
readonly views: readonly View[] | null;
|
|
57
59
|
readonly sensitive: readonly Filter[];
|
|
58
60
|
readonly pageSizes: readonly number[];
|
|
61
|
+
readonly search: boolean;
|
|
59
62
|
};
|
|
60
63
|
readonly migrate?: (stored: StoredState, version: number) => StoredState | null;
|
|
61
64
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ApiResult, HttpClient, QueryValue } from "../client";
|
|
1
|
+
import type { ApiResult, HttpClient, ListResult, QueryValue } from "../client";
|
|
2
2
|
import type { CollectionLoader, ListPage, CollectionQuery } from "./types";
|
|
3
3
|
/**
|
|
4
4
|
* The query parameters go-core's datatable reads: `page`, `per_page`, `order_col`, `order_dir`,
|
|
@@ -8,9 +8,11 @@ export declare function listParams(query: CollectionQuery): Record<string, Query
|
|
|
8
8
|
/**
|
|
9
9
|
* Reads a list answer into a `ListPage`. Understands go-core's envelope (`data` is the rows,
|
|
10
10
|
* `meta` has `total`, `page`, `per_page`, `last_page`, `from`, `to`, and may carry `views` and lookups)
|
|
11
|
-
* and
|
|
11
|
+
* and the shape with the numbers next to `data` (`current_page`), which is `ListResult<Row>`: pass a typed
|
|
12
|
+
* route's result (`client.request(route, input)`) and `Row` is inferred. Missing numbers are derived
|
|
12
13
|
* from what is there rather than becoming 0; `query` supplies the page and size that were asked for.
|
|
13
14
|
*/
|
|
15
|
+
export declare function readListPage<Row>(result: ApiResult<ListResult<Row>, unknown>, query: Pick<CollectionQuery, "page" | "pageSize">): ListPage<Row>;
|
|
14
16
|
export declare function readListPage<Row>(result: ApiResult<unknown, unknown>, query: Pick<CollectionQuery, "page" | "pageSize">): ListPage<Row>;
|
|
15
17
|
/**
|
|
16
18
|
* The loader of a go-core list endpoint: the common case of a feature's `api.list`.
|