@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/phone/index.js
CHANGED
|
@@ -1,73 +1,74 @@
|
|
|
1
|
-
import { defineComponent as fe, useModel as me, useTemplateRef as F, ref as B, computed as g, watch as ne, nextTick as A, openBlock as w, createElementBlock as $, createElementVNode as f, normalizeClass as P, unref as i, createVNode as M, toDisplayString as T, normalizeStyle as ge, Fragment as ee, renderList as le, createCommentVNode as J, withModifiers as xe, withDirectives as we, vModelText as _e, mergeModels as
|
|
1
|
+
import { defineComponent as fe, useModel as me, useTemplateRef as F, ref as B, computed as g, watch as ne, nextTick as A, openBlock as w, createElementBlock as $, createElementVNode as f, normalizeClass as P, unref as i, createVNode as M, toDisplayString as T, normalizeStyle as ge, Fragment as ee, renderList as le, createCommentVNode as J, withModifiers as xe, withDirectives as we, vModelText as _e, mergeModels as re, inject as ke, shallowRef as Ce, onBeforeUnmount as $e, createBlock as De, mergeProps as Me, createSlots as Te, withCtx as se, createTextVNode as Se, renderSlot as Ne, mergeDefaults as Ie } from "vue";
|
|
2
2
|
import { useI18n as pe } from "vue-i18n";
|
|
3
3
|
import { b as Pe } from "../controlSurface-t7OEFESJ.js";
|
|
4
|
-
import {
|
|
5
|
-
import { _ as q } from "../Icon.vue_vue_type_script_lang-
|
|
6
|
-
import { _ as
|
|
4
|
+
import { a as Ve, c as Oe, _ as Re, f as Ee, b as Be } from "../control-7EP4tjYy.js";
|
|
5
|
+
import { _ as q } from "../Icon.vue_vue_type_script_lang-D7oC-d-S.js";
|
|
6
|
+
import { _ as ie } from "../CountryFlag.vue_vue_type_script_setup_true_lang-Kry_vPPZ.js";
|
|
7
7
|
import { u as ze } from "../anchored-Cj4--8dT.js";
|
|
8
8
|
import { AsYouType as L, validatePhoneNumberLength as Fe, parsePhoneNumberFromString as ve, getCountries as qe, getCountryCallingCode as Ae } from "libphonenumber-js/max";
|
|
9
9
|
import Le from "libphonenumber-js/max/metadata";
|
|
10
|
+
import { f as ue } from "../options-Ba_0uLWN.js";
|
|
10
11
|
const ce = ["HR", "BA", "SI", "RS"], We = 15;
|
|
11
12
|
function he(t) {
|
|
12
13
|
return Le.country_calling_codes[t]?.[0];
|
|
13
14
|
}
|
|
14
15
|
const W = (t) => Ae(t), de = (t) => `+${W(t)}`, te = () => qe();
|
|
15
|
-
function Ke(t,
|
|
16
|
+
function Ke(t, r) {
|
|
16
17
|
const o = `+${t}`;
|
|
17
|
-
return new L().input(`${o}${
|
|
18
|
+
return new L().input(`${o}${r}`).slice(o.length).trim();
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
-
const
|
|
21
|
-
return
|
|
20
|
+
function ae(t, r, o) {
|
|
21
|
+
const a = o.slice(0, Math.max(0, We - r.length));
|
|
22
|
+
return a === "" ? { country: t, e164: "", text: "" } : { country: t, e164: `+${r}${a}`, text: Ke(r, a) };
|
|
22
23
|
}
|
|
23
|
-
function oe(t,
|
|
24
|
+
function oe(t, r) {
|
|
24
25
|
const o = t.trim().replace(/^00(?=\d)/, "+");
|
|
25
26
|
if (o.startsWith("+")) {
|
|
26
27
|
const l = new L();
|
|
27
28
|
l.input(o);
|
|
28
29
|
const x = l.getCallingCode();
|
|
29
|
-
if (!x) return { country:
|
|
30
|
-
const p = l.getCountry() ?? (W(
|
|
31
|
-
return
|
|
30
|
+
if (!x) return { country: r, e164: "", text: o.replace(/[^\d+]/g, "") };
|
|
31
|
+
const p = l.getCountry() ?? (W(r) === x ? r : he(x) ?? r);
|
|
32
|
+
return ae(p, x, l.getNumber()?.nationalNumber ?? "");
|
|
32
33
|
}
|
|
33
|
-
const
|
|
34
|
-
return
|
|
34
|
+
const a = new L(r);
|
|
35
|
+
return a.input(o.replace(/\D/g, "")), ae(r, W(r), a.getNumber()?.nationalNumber ?? "");
|
|
35
36
|
}
|
|
36
|
-
function Ue(t,
|
|
37
|
-
return
|
|
37
|
+
function Ue(t, r) {
|
|
38
|
+
return ae(r, W(r), t.text.replace(/\D/g, ""));
|
|
38
39
|
}
|
|
39
40
|
function je(t) {
|
|
40
41
|
return t.startsWith("+") ? new L().input(t) : t;
|
|
41
42
|
}
|
|
42
43
|
const He = { MOBILE: "mobile", FIXED_LINE: "landline", TOLL_FREE: "toll_free", PREMIUM_RATE: "premium_rate", VOIP: "voip" };
|
|
43
44
|
function Ge(t) {
|
|
44
|
-
const
|
|
45
|
+
const r = t ? ve(t) : void 0, o = r?.isValid() ? r.getType() : void 0;
|
|
45
46
|
return o ? He[o] : void 0;
|
|
46
47
|
}
|
|
47
48
|
function Xe(t) {
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
const o =
|
|
51
|
-
return
|
|
49
|
+
const r = new L();
|
|
50
|
+
r.input(t);
|
|
51
|
+
const o = r.getCallingCode();
|
|
52
|
+
return r.getCountry() ?? (o ? he(o) : void 0);
|
|
52
53
|
}
|
|
53
54
|
function ye(t) {
|
|
54
55
|
if (t === "") return null;
|
|
55
|
-
const
|
|
56
|
-
return o === "TOO_SHORT" ? { kind: "too_short", country:
|
|
56
|
+
const r = Xe(t), o = Fe(t);
|
|
57
|
+
return o === "TOO_SHORT" ? { kind: "too_short", country: r } : o === "TOO_LONG" ? { kind: "too_long", country: r } : o !== void 0 ? { kind: "invalid", country: r } : ve(t)?.isValid() ? null : { kind: "invalid", country: r };
|
|
57
58
|
}
|
|
58
|
-
const
|
|
59
|
-
function be(t,
|
|
59
|
+
const $t = (t) => ye(t) === null;
|
|
60
|
+
function be(t, r) {
|
|
60
61
|
try {
|
|
61
|
-
return new Intl.DisplayNames([
|
|
62
|
+
return new Intl.DisplayNames([r], { type: "region" }).of(t) ?? t;
|
|
62
63
|
} catch {
|
|
63
64
|
return t;
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
|
-
function Ye(t,
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
69
|
-
const l =
|
|
70
|
-
return o.filter((h) => _ ? W(h).startsWith(l) : p(h).includes(
|
|
67
|
+
function Ye(t, r, o) {
|
|
68
|
+
const a = ue(t.trim());
|
|
69
|
+
if (a === "") return o;
|
|
70
|
+
const l = a.replace(/\D/g, ""), x = new Intl.DisplayNames([r], { type: "region" }), p = (h) => ue(x.of(h) ?? h), _ = a.startsWith("+") || /^\d+$/.test(a);
|
|
71
|
+
return o.filter((h) => _ ? W(h).startsWith(l) : p(h).includes(a) || h.toLowerCase() === a);
|
|
71
72
|
}
|
|
72
73
|
const Je = ["id", "disabled", "aria-label", "aria-expanded"], Qe = { class: "tabular-nums" }, Ze = ["id", "aria-label"], et = {
|
|
73
74
|
key: 0,
|
|
@@ -77,9 +78,9 @@ const Je = ["id", "disabled", "aria-label", "aria-expanded"], Qe = { class: "tab
|
|
|
77
78
|
key: 0,
|
|
78
79
|
class: "px-3 py-2 text-footnote text-content-muted",
|
|
79
80
|
role: "status"
|
|
80
|
-
},
|
|
81
|
+
}, rt = { class: "border-t border-border-separator px-3 py-2" }, at = ["aria-controls", "aria-activedescendant", "aria-label", "placeholder"], lt = /* @__PURE__ */ fe({
|
|
81
82
|
__name: "CountryPicker",
|
|
82
|
-
props: /* @__PURE__ */
|
|
83
|
+
props: /* @__PURE__ */ re({
|
|
83
84
|
id: {},
|
|
84
85
|
common: {},
|
|
85
86
|
disabled: { type: Boolean },
|
|
@@ -88,21 +89,21 @@ const Je = ["id", "disabled", "aria-label", "aria-expanded"], Qe = { class: "tab
|
|
|
88
89
|
modelValue: { required: !0 },
|
|
89
90
|
modelModifiers: {}
|
|
90
91
|
}),
|
|
91
|
-
emits: /* @__PURE__ */
|
|
92
|
-
setup(t, { expose:
|
|
93
|
-
const
|
|
92
|
+
emits: /* @__PURE__ */ re(["picked"], ["update:modelValue"]),
|
|
93
|
+
setup(t, { expose: r, emit: o }) {
|
|
94
|
+
const a = t, l = me(t, "modelValue"), x = o, { t: p, locale: _ } = pe(), h = F("root"), V = F("trigger"), k = F("panel"), K = F("search"), C = B(!1), v = B(""), d = B(0), O = g(() => {
|
|
94
95
|
const e = /* @__PURE__ */ new Map();
|
|
95
96
|
for (const s of te()) e.set(s, be(s, _.value));
|
|
96
97
|
return e;
|
|
97
98
|
}), S = (e) => O.value.get(e) ?? e, D = g(() => {
|
|
98
|
-
const e =
|
|
99
|
+
const e = a.common.filter((c) => O.value.has(c));
|
|
99
100
|
if (v.value.trim() !== "") {
|
|
100
101
|
const c = Ye(v.value, _.value, te());
|
|
101
102
|
return [{ title: null, countries: [...c.filter((n) => e.includes(n)), ...c.filter((n) => !e.includes(n))] }];
|
|
102
103
|
}
|
|
103
104
|
const s = te().filter((c) => !e.includes(c)).sort((c, n) => S(c).localeCompare(S(n), _.value));
|
|
104
105
|
return [{ title: p("core.form.phone.common"), countries: e }, { title: p("core.form.phone.all"), countries: s }].filter((c) => c.countries.length > 0);
|
|
105
|
-
}), y = g(() => D.value.flatMap((e) => e.countries)), z = g(() => D.value.map((e, s) => D.value.slice(0, s).reduce((c, n) => c + n.countries.length, 0))), U = (e) => `${
|
|
106
|
+
}), y = g(() => D.value.flatMap((e) => e.countries)), z = g(() => D.value.map((e, s) => D.value.slice(0, s).reduce((c, n) => c + n.countries.length, 0))), U = (e) => `${a.id}-country-${e}`, { style: Q } = ze(k, {
|
|
106
107
|
reference: () => V.value,
|
|
107
108
|
placement: () => "bottom-start",
|
|
108
109
|
offset: 4,
|
|
@@ -112,7 +113,7 @@ const Je = ["id", "disabled", "aria-label", "aria-expanded"], Qe = { class: "tab
|
|
|
112
113
|
}
|
|
113
114
|
});
|
|
114
115
|
async function j() {
|
|
115
|
-
|
|
116
|
+
a.disabled || C.value || (v.value = "", d.value = Math.max(0, y.value.indexOf(l.value)), C.value = !0, await A(), K.value?.focus());
|
|
116
117
|
}
|
|
117
118
|
function N(e) {
|
|
118
119
|
C.value = !1, e && V.value?.focus();
|
|
@@ -138,27 +139,27 @@ const Je = ["id", "disabled", "aria-label", "aria-expanded"], Qe = { class: "tab
|
|
|
138
139
|
function E(e) {
|
|
139
140
|
(e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), j());
|
|
140
141
|
}
|
|
141
|
-
return
|
|
142
|
+
return r({ focus: () => V.value?.focus() }), (e, s) => (w(), $("div", {
|
|
142
143
|
ref_key: "root",
|
|
143
144
|
ref: h,
|
|
144
145
|
class: "shrink-0",
|
|
145
146
|
onFocusout: H
|
|
146
147
|
}, [
|
|
147
148
|
f("button", {
|
|
148
|
-
id: `${
|
|
149
|
+
id: `${a.id}-country`,
|
|
149
150
|
ref_key: "trigger",
|
|
150
151
|
ref: V,
|
|
151
152
|
type: "button",
|
|
152
|
-
disabled:
|
|
153
|
+
disabled: a.disabled,
|
|
153
154
|
"aria-label": i(p)("core.form.phone.country", { country: S(l.value) }),
|
|
154
155
|
"aria-haspopup": "listbox",
|
|
155
156
|
"aria-expanded": C.value,
|
|
156
157
|
"data-test": "country-button",
|
|
157
|
-
class: P(["flex h-full min-h-8 cursor-pointer items-center gap-1.5 whitespace-nowrap text-body font-medium text-content-strong focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus disabled:cursor-not-allowed compact:border-r compact:border-border-separator",
|
|
158
|
+
class: P(["flex h-full min-h-8 cursor-pointer items-center gap-1.5 whitespace-nowrap text-body font-medium text-content-strong focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus disabled:cursor-not-allowed compact:border-r compact:border-border-separator", a.surface]),
|
|
158
159
|
onClick: s[0] || (s[0] = (c) => C.value ? N(!0) : j()),
|
|
159
160
|
onKeydown: E
|
|
160
161
|
}, [
|
|
161
|
-
M(
|
|
162
|
+
M(ie, { country: l.value }, null, 8, ["country"]),
|
|
162
163
|
f("span", Qe, T(i(de)(l.value)), 1),
|
|
163
164
|
M(i(q), {
|
|
164
165
|
name: "arrowDownSLine",
|
|
@@ -175,7 +176,7 @@ const Je = ["id", "disabled", "aria-label", "aria-expanded"], Qe = { class: "tab
|
|
|
175
176
|
class: "z-1000 flex flex-col overflow-hidden rounded-menu bg-surface-overlay shadow-float"
|
|
176
177
|
}, [
|
|
177
178
|
f("div", {
|
|
178
|
-
id: `${
|
|
179
|
+
id: `${a.id}-countries`,
|
|
179
180
|
role: "listbox",
|
|
180
181
|
"aria-label": i(p)("core.form.phone.countries"),
|
|
181
182
|
class: "min-h-0 flex-1 overflow-y-auto p-2"
|
|
@@ -197,7 +198,7 @@ const Je = ["id", "disabled", "aria-label", "aria-expanded"], Qe = { class: "tab
|
|
|
197
198
|
onMouseenter: (m) => d.value = (z.value[n] ?? 0) + b,
|
|
198
199
|
onClick: (m) => R(u)
|
|
199
200
|
}, [
|
|
200
|
-
M(
|
|
201
|
+
M(ie, { country: u }, null, 8, ["country"]),
|
|
201
202
|
f("span", {
|
|
202
203
|
class: P(["min-w-0 flex-1 truncate text-content-strong", u === l.value ? "font-semibold" : ""])
|
|
203
204
|
}, T(S(u)), 3),
|
|
@@ -206,7 +207,7 @@ const Je = ["id", "disabled", "aria-label", "aria-expanded"], Qe = { class: "tab
|
|
|
206
207
|
], 64))), 128)),
|
|
207
208
|
y.value.length === 0 ? (w(), $("p", nt, T(i(p)("core.form.phone.no_match")), 1)) : J("", !0)
|
|
208
209
|
], 8, Ze),
|
|
209
|
-
f("div",
|
|
210
|
+
f("div", rt, [
|
|
210
211
|
we(f("input", {
|
|
211
212
|
ref_key: "search",
|
|
212
213
|
ref: K,
|
|
@@ -216,14 +217,14 @@ const Je = ["id", "disabled", "aria-label", "aria-expanded"], Qe = { class: "tab
|
|
|
216
217
|
autocomplete: "off",
|
|
217
218
|
"aria-autocomplete": "list",
|
|
218
219
|
"aria-expanded": "true",
|
|
219
|
-
"aria-controls": `${
|
|
220
|
+
"aria-controls": `${a.id}-countries`,
|
|
220
221
|
"aria-activedescendant": y.value[d.value] ? U(y.value[d.value]) : void 0,
|
|
221
222
|
"aria-label": i(p)("core.form.phone.search"),
|
|
222
223
|
placeholder: i(p)("core.form.phone.search"),
|
|
223
224
|
"data-test": "country-search",
|
|
224
225
|
class: "block w-full border-0 bg-transparent p-0 text-body text-content-strong placeholder:text-content-muted focus:outline-none focus:ring-0",
|
|
225
226
|
onKeydown: G
|
|
226
|
-
}, null, 40,
|
|
227
|
+
}, null, 40, at), [
|
|
227
228
|
[_e, v.value]
|
|
228
229
|
])
|
|
229
230
|
])
|
|
@@ -237,9 +238,9 @@ const Je = ["id", "disabled", "aria-label", "aria-expanded"], Qe = { class: "tab
|
|
|
237
238
|
}, dt = ["href", "aria-label", "title"], ft = ["href", "aria-label", "title"], mt = ["aria-label", "title"], pt = {
|
|
238
239
|
class: "sr-only",
|
|
239
240
|
role: "status"
|
|
240
|
-
},
|
|
241
|
+
}, Dt = /* @__PURE__ */ fe({
|
|
241
242
|
__name: "PhoneField",
|
|
242
|
-
props: /* @__PURE__ */
|
|
243
|
+
props: /* @__PURE__ */ re(/* @__PURE__ */ Ie({
|
|
243
244
|
label: {},
|
|
244
245
|
hint: {},
|
|
245
246
|
error: {},
|
|
@@ -258,17 +259,17 @@ const Je = ["id", "disabled", "aria-label", "aria-expanded"], Qe = { class: "tab
|
|
|
258
259
|
modelModifiers: {}
|
|
259
260
|
}),
|
|
260
261
|
emits: ["update:modelValue"],
|
|
261
|
-
setup(t, { expose:
|
|
262
|
-
const o = t,
|
|
262
|
+
setup(t, { expose: r }) {
|
|
263
|
+
const o = t, a = me(t, "modelValue"), { t: l, locale: x } = pe(), p = ke(st, {}), _ = !!Ve(), h = Oe("text", () => o.error || R.value ? "error" : o.disabled ? "locked" : "rest"), V = g(() => _ ? Pe(o.width) : "w-full"), k = F("input"), K = g(() => o.defaultCountry ?? p.defaultCountry ?? (o.commonCountries ?? p.commonCountries ?? ce)[0] ?? "HR"), C = g(() => o.commonCountries ?? p.commonCountries ?? ce), v = Ce(K.value), d = B("");
|
|
263
264
|
let O = null;
|
|
264
265
|
function S(n) {
|
|
265
266
|
v.value = n.country, d.value = n.text;
|
|
266
267
|
}
|
|
267
|
-
ne(() =>
|
|
268
|
+
ne(() => a.value, (n) => {
|
|
268
269
|
n !== O && (O = null, S(oe(n, v.value)));
|
|
269
270
|
}, { immediate: !0 });
|
|
270
271
|
function D(n) {
|
|
271
|
-
S(n), O = n.e164,
|
|
272
|
+
S(n), O = n.e164, a.value = n.e164;
|
|
272
273
|
}
|
|
273
274
|
const y = (n) => n.replace(/\D/g, "").length;
|
|
274
275
|
async function z(n) {
|
|
@@ -295,13 +296,13 @@ const Je = ["id", "disabled", "aria-label", "aria-expanded"], Qe = { class: "tab
|
|
|
295
296
|
/^(\+|00)\d/.test(u) && (n.preventDefault(), D(oe(u, v.value)), A(() => k.value?.setSelectionRange(d.value.length, d.value.length)));
|
|
296
297
|
}
|
|
297
298
|
function j(n) {
|
|
298
|
-
D(Ue({ country: v.value, e164:
|
|
299
|
+
D(Ue({ country: v.value, e164: a.value, text: d.value }, n)), A(() => k.value?.focus());
|
|
299
300
|
}
|
|
300
|
-
const N = B(!1), R = g(() => N.value &&
|
|
301
|
+
const N = B(!1), R = g(() => N.value && a.value !== "" ? ye(a.value) : null), H = g(() => {
|
|
301
302
|
const n = R.value;
|
|
302
303
|
if (n)
|
|
303
304
|
return n.country ? l(`core.form.phone.${n.kind}`, { country: be(n.country, x.value) }) : l("core.form.phone.invalid_any");
|
|
304
|
-
}), G = g(() =>
|
|
305
|
+
}), G = g(() => a.value !== "" && !R.value ? Ge(a.value) : void 0), E = g(() => je(a.value)), e = B(!1);
|
|
305
306
|
let s = null;
|
|
306
307
|
async function c() {
|
|
307
308
|
try {
|
|
@@ -311,8 +312,8 @@ const Je = ["id", "disabled", "aria-label", "aria-expanded"], Qe = { class: "tab
|
|
|
311
312
|
}
|
|
312
313
|
e.value = !0, s && clearTimeout(s), s = setTimeout(() => e.value = !1, 1800);
|
|
313
314
|
}
|
|
314
|
-
return $e(() => s && clearTimeout(s)),
|
|
315
|
-
value:
|
|
315
|
+
return $e(() => s && clearTimeout(s)), r({ focus: () => k.value?.focus() }), (n, u) => (w(), De(Re, Me({ ...i(Ee)(o), error: o.error ?? H.value }, {
|
|
316
|
+
value: a.value === "" ? null : E.value,
|
|
316
317
|
"value-style": "numeric"
|
|
317
318
|
}), Te({
|
|
318
319
|
default: se(({ id: b, describedby: m, invalid: I }) => [
|
|
@@ -366,7 +367,7 @@ const Je = ["id", "disabled", "aria-label", "aria-expanded"], Qe = { class: "tab
|
|
|
366
367
|
]),
|
|
367
368
|
_: 2
|
|
368
369
|
}, [
|
|
369
|
-
|
|
370
|
+
a.value !== "" ? {
|
|
370
371
|
name: "readonly",
|
|
371
372
|
fn: se(() => [
|
|
372
373
|
f("div", {
|
|
@@ -377,7 +378,7 @@ const Je = ["id", "disabled", "aria-label", "aria-expanded"], Qe = { class: "tab
|
|
|
377
378
|
class: P(["flex-auto whitespace-nowrap text-body tabular-nums text-content-strong", _ ? "text-right" : ""])
|
|
378
379
|
}, T(E.value), 3),
|
|
379
380
|
f("a", {
|
|
380
|
-
href: `tel:${
|
|
381
|
+
href: `tel:${a.value}`,
|
|
381
382
|
"aria-label": i(l)("core.form.phone.call"),
|
|
382
383
|
title: i(l)("core.form.phone.call"),
|
|
383
384
|
"data-test": "phone-call",
|
|
@@ -389,7 +390,7 @@ const Je = ["id", "disabled", "aria-label", "aria-expanded"], Qe = { class: "tab
|
|
|
389
390
|
})
|
|
390
391
|
], 8, dt),
|
|
391
392
|
f("a", {
|
|
392
|
-
href: `sms:${
|
|
393
|
+
href: `sms:${a.value}`,
|
|
393
394
|
"aria-label": i(l)("core.form.phone.message"),
|
|
394
395
|
title: i(l)("core.form.phone.message"),
|
|
395
396
|
"data-test": "phone-message",
|
|
@@ -401,7 +402,7 @@ const Je = ["id", "disabled", "aria-label", "aria-expanded"], Qe = { class: "tab
|
|
|
401
402
|
})
|
|
402
403
|
], 8, ft),
|
|
403
404
|
Ne(n.$slots, "actions", {
|
|
404
|
-
number:
|
|
405
|
+
number: a.value,
|
|
405
406
|
formatted: E.value
|
|
406
407
|
}),
|
|
407
408
|
f("button", {
|
|
@@ -427,11 +428,11 @@ const Je = ["id", "disabled", "aria-label", "aria-expanded"], Qe = { class: "tab
|
|
|
427
428
|
});
|
|
428
429
|
export {
|
|
429
430
|
ce as COMMON_COUNTRIES,
|
|
430
|
-
|
|
431
|
+
Dt as PhoneField,
|
|
431
432
|
be as countryName,
|
|
432
433
|
de as dialCode,
|
|
433
434
|
je as formatInternational,
|
|
434
|
-
|
|
435
|
+
$t as isValidPhone,
|
|
435
436
|
Xe as phoneCountry,
|
|
436
437
|
st as phoneDefaultsKey,
|
|
437
438
|
Ge as phoneKind,
|
package/dist/platform/index.d.ts
CHANGED
|
@@ -9,8 +9,8 @@ export { httpSessionAdapter, parseSessionPayload } from "./httpSession";
|
|
|
9
9
|
export type { HttpSessionOptions, UserParser } from "./httpSession";
|
|
10
10
|
export { createPlatform, installPlatform, platformKey, usePlatform } from "./platform";
|
|
11
11
|
export type { Platform, PlatformOptions } from "./platform";
|
|
12
|
-
export { beforeSignOutTimeout, createSession } from "./session";
|
|
13
|
-
export type { BeforeSignOutHook, Session, SessionAdapter, SessionEnd, SessionOptions, SessionSnapshot, SessionState, SessionUser } from "./session";
|
|
12
|
+
export { beforeSignOutTimeout, createSession, heldSession } from "./session";
|
|
13
|
+
export type { BeforeSignOutHook, Session, SessionAdapter, SessionEnd, SessionImpersonator, SessionOptions, SessionSnapshot, SessionState, SessionUser } from "./session";
|
|
14
14
|
/**
|
|
15
15
|
* The permission identifiers of the application. The library declares none: an app adds its own by
|
|
16
16
|
* augmenting this interface (declaration merging, like `IconRegistry`), so route metadata and
|
package/dist/platform/index.js
CHANGED
|
@@ -1,128 +1,111 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var N = Object.defineProperty;
|
|
2
|
+
var B = (s) => {
|
|
3
3
|
throw TypeError(s);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var $ = (s, t, e) =>
|
|
7
|
-
var
|
|
8
|
-
import { u as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
super(n.length > 0 ? `${e}: ${n.join("; ")}` : e);
|
|
5
|
+
var E = (s, t, e) => t in s ? N(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
6
|
+
var $ = (s, t, e) => E(s, typeof t != "symbol" ? t + "" : t, e), w = (s, t, e) => t.has(s) || B("Cannot " + e);
|
|
7
|
+
var o = (s, t, e) => (w(s, t, "read from private field"), e ? e.call(s) : t.get(s)), h = (s, t, e) => t.has(s) ? B("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), f = (s, t, e, r) => (w(s, t, "write to private field"), r ? r.call(s, e) : t.set(s, e), e), u = (s, t, e) => (w(s, t, "access private method"), e);
|
|
8
|
+
import { b as J, c as L, a as M, d as T, h as q, e as F, i as G, p as K, f as _, g as z, u as D } from "../platform-q3cjODLx.js";
|
|
9
|
+
import { M as Q, d as R } from "../context-Ch1r4fdN.js";
|
|
10
|
+
import { _ as V } from "../AccessGate.vue_vue_type_script_setup_true_lang-DcbZBINh.js";
|
|
11
|
+
class d extends Error {
|
|
12
|
+
constructor(e, r = [], n) {
|
|
13
|
+
super(r.length > 0 ? `${e}: ${r.join("; ")}` : e);
|
|
15
14
|
$(this, "issues");
|
|
16
15
|
$(this, "cause");
|
|
17
|
-
this.name = "BootstrapError", this.issues =
|
|
16
|
+
this.name = "BootstrapError", this.issues = r, this.cause = n?.cause;
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
|
-
const
|
|
21
|
-
var a, c, p,
|
|
19
|
+
const x = (s) => s === null ? "null" : Array.isArray(s) ? "array" : typeof s, S = (s) => typeof s == "object" && s !== null && !Array.isArray(s);
|
|
20
|
+
var a, c, p, m, l, g;
|
|
22
21
|
const b = class b {
|
|
23
22
|
/** @internal use the `fields` passed to `extend`. */
|
|
24
|
-
constructor(t, e,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
constructor(t, e, r, n = !1) {
|
|
24
|
+
h(this, l);
|
|
25
|
+
h(this, a);
|
|
26
|
+
h(this, c);
|
|
27
|
+
h(this, p);
|
|
28
|
+
h(this, m);
|
|
29
|
+
f(this, a, t), f(this, c, e), f(this, p, r), f(this, m, n);
|
|
31
30
|
}
|
|
32
31
|
/** Records a problem with `key`; for values `raw` returns that the application validates itself. */
|
|
33
32
|
fail(t, e) {
|
|
34
|
-
|
|
33
|
+
o(this, m) || o(this, p).push(`${o(this, c)}${t}: ${e}`);
|
|
35
34
|
}
|
|
36
35
|
/** The value as sent, unchecked. Validate it and report with `fail`. */
|
|
37
36
|
raw(t) {
|
|
38
|
-
return
|
|
37
|
+
return o(this, a)[t];
|
|
39
38
|
}
|
|
40
39
|
string(t, ...e) {
|
|
41
|
-
return
|
|
40
|
+
return u(this, l, g).call(this, t, "string", (r) => typeof r == "string", e);
|
|
42
41
|
}
|
|
43
42
|
number(t, ...e) {
|
|
44
|
-
return
|
|
43
|
+
return u(this, l, g).call(this, t, "number", (r) => typeof r == "number" && Number.isFinite(r), e);
|
|
45
44
|
}
|
|
46
45
|
boolean(t, ...e) {
|
|
47
|
-
return
|
|
46
|
+
return u(this, l, g).call(this, t, "boolean", (r) => typeof r == "boolean", e);
|
|
48
47
|
}
|
|
49
48
|
stringList(t, ...e) {
|
|
50
|
-
return
|
|
49
|
+
return u(this, l, g).call(this, t, "array of strings", (r) => Array.isArray(r) && r.every((n) => typeof n == "string"), e);
|
|
51
50
|
}
|
|
52
51
|
/** A nested object, read with the same checks; issues are reported as `parent.child`. */
|
|
53
52
|
section(t) {
|
|
54
|
-
const e =
|
|
55
|
-
return S(e) ? new b(e, `${
|
|
53
|
+
const e = o(this, a)[t];
|
|
54
|
+
return S(e) ? new b(e, `${o(this, c)}${t}.`, o(this, p)) : (this.fail(t, `expected object, got ${x(e)}`), new b({}, `${o(this, c)}${t}.`, o(this, p), !0));
|
|
56
55
|
}
|
|
57
56
|
};
|
|
58
|
-
a = new WeakMap(), c = new WeakMap(), p = new WeakMap(),
|
|
59
|
-
const
|
|
60
|
-
return
|
|
57
|
+
a = new WeakMap(), c = new WeakMap(), p = new WeakMap(), m = new WeakMap(), l = new WeakSet(), g = function(t, e, r, n) {
|
|
58
|
+
const i = o(this, a)[t];
|
|
59
|
+
return i === void 0 && n.length > 0 ? n[0] : r(i) ? i : (this.fail(t, `expected ${e}, got ${i === void 0 ? "nothing (missing)" : x(i)}`), null);
|
|
61
60
|
};
|
|
62
|
-
let
|
|
63
|
-
function
|
|
61
|
+
let A = b;
|
|
62
|
+
function O(s, t) {
|
|
64
63
|
if (!S(s))
|
|
65
|
-
throw new
|
|
66
|
-
const e = [],
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
apiBase:
|
|
70
|
-
locale:
|
|
71
|
-
appName:
|
|
72
|
-
capabilities:
|
|
73
|
-
}, y = t?.(
|
|
74
|
-
if (e.length > 0) throw new
|
|
75
|
-
return { ...y, ...
|
|
64
|
+
throw new d("Invalid bootstrap config", [`expected a JSON object, got ${x(s)}`]);
|
|
65
|
+
const e = [], r = new A(s, "", e), n = r.string("locale");
|
|
66
|
+
n === "" && r.fail("locale", "must not be empty");
|
|
67
|
+
const i = {
|
|
68
|
+
apiBase: r.string("api_base", ""),
|
|
69
|
+
locale: n,
|
|
70
|
+
appName: r.string("app_name", null),
|
|
71
|
+
capabilities: r.stringList("capabilities", [])
|
|
72
|
+
}, y = t?.(r) ?? {};
|
|
73
|
+
if (e.length > 0) throw new d("Invalid bootstrap config", e);
|
|
74
|
+
return { ...y, ...i };
|
|
76
75
|
}
|
|
77
|
-
function
|
|
78
|
-
const { element: t = "app-state", extend: e } = s,
|
|
79
|
-
if (!
|
|
80
|
-
throw new
|
|
81
|
-
`Bootstrap config not found: the page has no ${
|
|
76
|
+
function C(s = {}) {
|
|
77
|
+
const { element: t = "app-state", extend: e } = s, r = typeof t == "string" ? document.getElementById(t) : t, n = typeof t == "string" ? `#${t}` : "the given element";
|
|
78
|
+
if (!r)
|
|
79
|
+
throw new d(
|
|
80
|
+
`Bootstrap config not found: the page has no ${n} element (expected <script id="app-state" type="application/json">)`
|
|
82
81
|
);
|
|
83
|
-
const
|
|
84
|
-
if (
|
|
82
|
+
const i = r.textContent?.trim() ?? "";
|
|
83
|
+
if (i === "") throw new d(`Bootstrap config is empty: ${n} has no content`);
|
|
85
84
|
let y;
|
|
86
85
|
try {
|
|
87
|
-
y = JSON.parse(
|
|
86
|
+
y = JSON.parse(i);
|
|
88
87
|
} catch (j) {
|
|
89
|
-
throw new
|
|
88
|
+
throw new d(`Bootstrap config in ${n} is not valid JSON`, [], { cause: j });
|
|
90
89
|
}
|
|
91
|
-
return
|
|
90
|
+
return O(y, e);
|
|
92
91
|
}
|
|
93
|
-
const M = /* @__PURE__ */ O({
|
|
94
|
-
__name: "AccessGate",
|
|
95
|
-
props: {
|
|
96
|
-
permission: {},
|
|
97
|
-
any: {},
|
|
98
|
-
all: {}
|
|
99
|
-
},
|
|
100
|
-
setup(s) {
|
|
101
|
-
const t = s, e = C().access, n = P(() => {
|
|
102
|
-
if (t.permission !== void 0) return e.can(t.permission);
|
|
103
|
-
if (t.any !== void 0) return e.canAny(t.any);
|
|
104
|
-
if (t.all !== void 0) return e.canAll(t.all);
|
|
105
|
-
throw new Error("AccessGate needs one of the props permission, any or all.");
|
|
106
|
-
});
|
|
107
|
-
return (o, r) => n.value ? B(o.$slots, "default", {}, void 0, void 0, 0) : B(o.$slots, "fallback", {}, void 0, void 0, 1);
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
92
|
export {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
C as
|
|
93
|
+
V as AccessGate,
|
|
94
|
+
d as BootstrapError,
|
|
95
|
+
A as BootstrapFields,
|
|
96
|
+
Q as MissingContextError,
|
|
97
|
+
J as beforeSignOutTimeout,
|
|
98
|
+
L as createAccessClient,
|
|
99
|
+
M as createPlatform,
|
|
100
|
+
T as createSession,
|
|
101
|
+
R as defineFeatureContext,
|
|
102
|
+
q as heldSession,
|
|
103
|
+
F as httpSessionAdapter,
|
|
104
|
+
G as installPlatform,
|
|
105
|
+
O as parseBootstrap,
|
|
106
|
+
K as parseNavigation,
|
|
107
|
+
_ as parseSessionPayload,
|
|
108
|
+
z as platformKey,
|
|
109
|
+
C as readBootstrap,
|
|
110
|
+
D as usePlatform
|
|
128
111
|
};
|
|
@@ -27,11 +27,11 @@ export interface PlatformOptions<U extends SessionUser, C extends BootstrapConfi
|
|
|
27
27
|
session?: SessionAdapter<U> | ((http: HttpClient) => SessionAdapter<U>);
|
|
28
28
|
/**
|
|
29
29
|
* Called once when a request is answered 401 while signed in, before the session is given up
|
|
30
|
-
* (concurrent 401s share one call). Renew it (for example a refresh-token call, then
|
|
30
|
+
* (concurrent 401s share one call). Renew it with the platform's client (for example a refresh-token call, then
|
|
31
31
|
* `session.refresh()`) and return true: the failed request is sent again. False or a throw expires
|
|
32
32
|
* the session. Without it a 401 expires the session at once.
|
|
33
33
|
*/
|
|
34
|
-
renewSession?: (session: Session<U
|
|
34
|
+
renewSession?: (session: Session<U>, http: HttpClient) => Promise<boolean>;
|
|
35
35
|
/** Called after a 401 expired a signed-in session: the application decides (usually: go to the login page). */
|
|
36
36
|
onSessionExpired?: () => void;
|
|
37
37
|
/** Called with the failure of a session load or of a before-sign-out hook. */
|
|
@@ -5,9 +5,16 @@ import type { NavigationNode } from "./navigation";
|
|
|
5
5
|
export interface SessionUser {
|
|
6
6
|
readonly id: number | string;
|
|
7
7
|
}
|
|
8
|
+
/** The real person behind a session in which somebody signed in as another (go-core `login-as`). */
|
|
9
|
+
export interface SessionImpersonator {
|
|
10
|
+
readonly id: number | string;
|
|
11
|
+
readonly name: string;
|
|
12
|
+
}
|
|
8
13
|
/** What the server says about a session. */
|
|
9
14
|
export interface SessionSnapshot<U extends SessionUser = SessionUser> {
|
|
10
15
|
readonly user: U;
|
|
16
|
+
/** Set while the user was signed in as by somebody else: who that really is. Absent for a person's own session. */
|
|
17
|
+
readonly impersonator?: SessionImpersonator;
|
|
11
18
|
/** When the session's access token expires, if the server says; renewing it is the application's effect. */
|
|
12
19
|
readonly expiresAt: Date | null;
|
|
13
20
|
readonly access: AccessSnapshot;
|
|
@@ -25,9 +32,12 @@ export type SessionState<U extends SessionUser = SessionUser> =
|
|
|
25
32
|
readonly status: "unknown";
|
|
26
33
|
} | {
|
|
27
34
|
readonly status: "loading";
|
|
28
|
-
}
|
|
35
|
+
}
|
|
36
|
+
/** `previous` is what the session was, kept when it `expired` while someone was working: the page may stay on screen while they sign in again. */
|
|
37
|
+
| {
|
|
29
38
|
readonly status: "anonymous";
|
|
30
39
|
readonly reason: SessionEnd;
|
|
40
|
+
readonly previous?: SessionSnapshot<U>;
|
|
31
41
|
} | ({
|
|
32
42
|
readonly status: "authenticated";
|
|
33
43
|
} & SessionSnapshot<U>)
|
|
@@ -36,6 +46,11 @@ export type SessionState<U extends SessionUser = SessionUser> =
|
|
|
36
46
|
readonly status: "failed";
|
|
37
47
|
readonly error: unknown;
|
|
38
48
|
};
|
|
49
|
+
/**
|
|
50
|
+
* The session as the page around it should still show it: the signed-in one, or the one that just
|
|
51
|
+
* expired (its user, access and menu stay on screen while the person signs in again); null otherwise.
|
|
52
|
+
*/
|
|
53
|
+
export declare function heldSession<U extends SessionUser>(state: SessionState<U>): SessionSnapshot<U> | null;
|
|
39
54
|
/** The seam to a backend: how to ask who is signed in and how to end the session. */
|
|
40
55
|
export interface SessionAdapter<U extends SessionUser = SessionUser> {
|
|
41
56
|
/** The current session, or null when there is none (not signed in). Reject for failures; honour `signal`. */
|
|
@@ -70,6 +85,12 @@ export interface Session<U extends SessionUser = SessionUser> {
|
|
|
70
85
|
* ends the session on the server; rejects if that call fails. Concurrent calls share one sign-out.
|
|
71
86
|
*/
|
|
72
87
|
signOut(): Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* Whether an expired session keeps what it was (`previous` on the anonymous state), so the page and its shell can
|
|
90
|
+
* stay on screen while the person signs in again. Off by default; `createApplication` turns it on when a feature
|
|
91
|
+
* has a prompt for it (`holdsExpiredSession`).
|
|
92
|
+
*/
|
|
93
|
+
holdExpired(enabled: boolean): void;
|
|
73
94
|
/**
|
|
74
95
|
* Adds a hook `signOut()` runs while the user is still signed in. Returns the function that removes it: a
|
|
75
96
|
* session effect returns it as its stop, so the hook lives exactly as long as the effect.
|