@propelinc/citrus-ui 0.6.0 → 1.0.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 +54 -60
- package/dist/colors/colors.d.ts +31 -0
- package/dist/colors/theme.d.ts +2 -11
- package/dist/colors/util-classes.d.ts +11 -0
- package/dist/components/CAccordion.vue.d.ts +21 -0
- package/dist/components/CAccordionItem.vue.d.ts +41 -0
- package/dist/components/CAppBar.vue.d.ts +156 -0
- package/dist/components/CBadge.vue.d.ts +52 -0
- package/dist/components/CBottomSheet.vue.d.ts +226 -0
- package/dist/components/CButton/CButton.vue.d.ts +231 -0
- package/dist/components/CButton/types.d.ts +5 -0
- package/dist/components/CButtonStack.vue.d.ts +24 -0
- package/dist/components/CCard.vue.d.ts +107 -0
- package/dist/components/CCardFooter.vue.d.ts +26 -0
- package/dist/components/CCardHeader.vue.d.ts +3 -0
- package/dist/components/CCardSection.vue.d.ts +17 -0
- package/dist/components/CCheckbox.vue.d.ts +145 -0
- package/dist/components/CCol.vue.d.ts +21 -0
- package/dist/components/CDivider.vue.d.ts +17 -0
- package/dist/components/CDobField.vue.d.ts +2109 -0
- package/dist/components/CDobSelect.vue.d.ts +398 -0
- package/dist/components/CEmailField.vue.d.ts +699 -0
- package/dist/components/CExpandTransition.vue.d.ts +19 -0
- package/dist/components/CFadeTransition.vue.d.ts +3 -0
- package/dist/components/CFileInput.vue.d.ts +98 -0
- package/dist/components/CFixedPageFooter.vue.d.ts +106 -0
- package/dist/components/CForm.vue.d.ts +29 -0
- package/dist/components/CFormFieldCounter.vue.d.ts +42 -0
- package/dist/components/CIconButton.vue.d.ts +390 -0
- package/dist/components/CLabel.vue.d.ts +32 -0
- package/dist/components/CListItem.vue.d.ts +208 -0
- package/dist/components/CListItemContent.vue.d.ts +27 -0
- package/dist/components/CListItemIcon.vue.d.ts +54 -0
- package/dist/components/CLoader.vue.d.ts +73 -0
- package/dist/components/CLogo.vue.d.ts +19 -0
- package/dist/components/CMaskedTextField.vue.d.ts +2012 -0
- package/dist/components/CMenu.vue.d.ts +6 -0
- package/dist/components/CMenuItem.vue.d.ts +170 -0
- package/dist/components/CMenuLabel.vue.d.ts +3 -0
- package/dist/components/CModal.vue.d.ts +206 -0
- package/dist/components/CModalLoading.vue.d.ts +230 -0
- package/dist/components/CNotification.vue.d.ts +589 -0
- package/dist/components/CPhoneField.vue.d.ts +2088 -0
- package/dist/components/CPill.vue.d.ts +42 -0
- package/dist/components/CPillGroup.vue.d.ts +70 -0
- package/dist/components/CPopup.vue.d.ts +21 -0
- package/dist/components/CProgressLinear.vue.d.ts +61 -0
- package/dist/components/CProgressRing.vue.d.ts +103 -0
- package/dist/components/CRadio.vue.d.ts +73 -0
- package/dist/components/CRadioGroup.vue.d.ts +123 -0
- package/dist/components/CRebrand.vue.d.ts +28 -0
- package/dist/components/CRow.vue.d.ts +67 -0
- package/dist/components/CSafeArea.vue.d.ts +18 -0
- package/dist/components/CSectionHeader.vue.d.ts +28 -0
- package/dist/components/CSelect.vue.d.ts +293 -0
- package/dist/components/CSkeleton.vue.d.ts +3 -0
- package/dist/components/CSkeletonLoaderCard.vue.d.ts +21 -0
- package/dist/components/CSkeletonLoaderCircle.vue.d.ts +5 -0
- package/dist/components/CSkeletonLoaderText.vue.d.ts +44 -0
- package/dist/components/CSlideFadeTransition.vue.d.ts +58 -0
- package/dist/components/CSplitInput.vue.d.ts +2131 -0
- package/dist/components/CSquaredIcon.vue.d.ts +47 -0
- package/dist/components/CSsnField.vue.d.ts +2083 -0
- package/dist/components/CStatusDot.vue.d.ts +27 -0
- package/dist/components/CSwitch.vue.d.ts +54 -0
- package/dist/components/CSwitchListItem.vue.d.ts +392 -0
- package/dist/components/CTextArea.vue.d.ts +240 -0
- package/dist/components/CTextField.vue.d.ts +647 -0
- package/dist/components/CTextLink.vue.d.ts +55 -0
- package/dist/components/CThirdPartyLogo.vue.d.ts +128 -0
- package/dist/components/CTimeago.vue.d.ts +12 -0
- package/dist/components/CToast.vue.d.ts +458 -0
- package/dist/components/CToastsList.vue.d.ts +430 -0
- package/dist/components/CValidationMessage.vue.d.ts +45 -0
- package/dist/components/CZipcodeField.vue.d.ts +2080 -0
- package/dist/components/index.d.ts +66 -25
- package/dist/components/internal/CCloseButton.vue.d.ts +14 -0
- package/dist/composables/accessibility.d.ts +1 -0
- package/dist/composables/animation.d.ts +12 -0
- package/dist/composables/binding.d.ts +19 -0
- package/dist/composables/colors.d.ts +13 -0
- package/dist/composables/elements.d.ts +3 -0
- package/dist/composables/fields.d.ts +9 -0
- package/dist/composables/gestures.d.ts +53 -0
- package/dist/composables/i18n.d.ts +3 -0
- package/dist/composables/id.d.ts +11 -0
- package/dist/composables/input-mask.d.ts +18 -0
- package/dist/composables/router.d.ts +30 -0
- package/dist/composables/slots.d.ts +2 -0
- package/dist/composables/toast.d.ts +21 -0
- package/dist/composables/validations.d.ts +77 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.mjs +11738 -0
- package/dist/index.mjs.map +1 -0
- package/dist/plugin.d.ts +2 -2
- package/dist/services/animation.d.ts +17 -0
- package/dist/services/directives/index.d.ts +2 -0
- package/dist/services/directives/scroll-into-view.d.ts +7 -0
- package/dist/services/directives/tap-animation.d.ts +6 -0
- package/dist/services/id.d.ts +22 -0
- package/dist/services/injections/accordions.d.ts +3 -0
- package/dist/services/injections/animations.d.ts +2 -0
- package/dist/services/injections/buttons.d.ts +4 -0
- package/dist/services/injections/forms.d.ts +6 -0
- package/dist/services/injections/icon-buttons.d.ts +3 -0
- package/dist/services/injections/pills.d.ts +4 -0
- package/dist/services/injections/radio.d.ts +10 -0
- package/dist/styles/main.css +3002 -0
- package/dist/styles/utils.css +2319 -0
- package/dist/theme/icons.d.ts +35 -2
- package/dist/types/CForm.d.ts +12 -0
- package/dist/types/font-awesome.d.ts +5 -0
- package/dist/types.d.ts +12 -0
- package/index.ts +2 -0
- package/package.json +60 -45
- package/src/assets/fonts/grenette-regular.woff2 +0 -0
- package/src/assets/fonts/grenette-semibold.woff2 +0 -0
- package/src/assets/fonts/polymath.woff2 +0 -0
- package/src/assets/logos/propel/icon.svg +15 -0
- package/src/assets/logos/propel/lockup.svg +11 -0
- package/src/colors/colors.ts +173 -0
- package/src/colors/theme.ts +8 -14
- package/src/colors/util-classes.ts +49 -0
- package/src/componentResolver.js +33 -0
- package/src/components/CAccordion.vue +32 -7
- package/src/components/CAccordionItem.vue +109 -36
- package/src/components/CAppBar.vue +237 -0
- package/src/components/CBadge.vue +74 -0
- package/src/components/CBottomSheet.vue +430 -0
- package/src/components/CButton/CButton.vue +347 -0
- package/src/components/CButton/types.ts +5 -0
- package/src/components/CButtonStack.vue +36 -0
- package/src/components/CCard.vue +149 -41
- package/src/components/CCardFooter.vue +11 -27
- package/src/components/CCardHeader.vue +30 -21
- package/src/components/CCardSection.vue +23 -12
- package/src/components/CCheckbox.vue +191 -21
- package/src/components/CCol.vue +55 -0
- package/src/components/CDivider.vue +46 -0
- package/src/components/CDobField.vue +153 -0
- package/src/components/CDobSelect.vue +274 -0
- package/src/components/CEmailField.vue +61 -0
- package/src/components/CExpandTransition.vue +55 -0
- package/src/components/CFadeTransition.vue +23 -0
- package/src/components/CFileInput.vue +186 -0
- package/src/components/CFixedPageFooter.vue +76 -0
- package/src/components/CForm.vue +86 -0
- package/src/components/CFormFieldCounter.vue +40 -0
- package/src/components/CIconButton.vue +175 -59
- package/src/components/CLabel.vue +52 -0
- package/src/components/CListItem.vue +149 -45
- package/src/components/CListItemContent.vue +60 -0
- package/src/components/CListItemIcon.vue +27 -31
- package/src/components/CLoader.vue +156 -0
- package/src/components/CLogo.vue +23 -0
- package/src/components/CMaskedTextField.vue +118 -0
- package/src/components/CMenu.vue +24 -0
- package/src/components/CMenuItem.vue +106 -0
- package/src/components/CMenuLabel.vue +26 -0
- package/src/components/CModal.vue +198 -79
- package/src/components/CModalLoading.vue +27 -9
- package/src/components/CNotification.vue +86 -53
- package/src/components/CPhoneField.vue +69 -0
- package/src/components/CPill.vue +162 -0
- package/src/components/CPillGroup.vue +73 -0
- package/src/components/CPopup.vue +66 -0
- package/src/components/CProgressLinear.vue +52 -0
- package/src/components/CProgressRing.vue +126 -0
- package/src/components/CRadio.vue +138 -0
- package/src/components/CRadioGroup.vue +142 -0
- package/src/components/CRebrand.vue +28 -0
- package/src/components/CRow.vue +62 -0
- package/src/components/CSafeArea.vue +23 -0
- package/src/components/CSectionHeader.vue +50 -0
- package/src/components/CSelect.vue +223 -74
- package/src/components/CSkeleton.vue +65 -0
- package/src/components/CSkeletonLoaderCard.vue +29 -0
- package/src/components/CSkeletonLoaderCircle.vue +18 -14
- package/src/components/CSkeletonLoaderText.vue +127 -17
- package/src/components/CSlideFadeTransition.vue +100 -0
- package/src/components/CSplitInput.vue +111 -0
- package/src/components/CSquaredIcon.vue +83 -0
- package/src/components/CSsnField.vue +86 -0
- package/src/components/CStatusDot.vue +70 -0
- package/src/components/CSwitch.vue +125 -0
- package/src/components/CSwitchListItem.vue +110 -0
- package/src/components/CTextArea.vue +193 -47
- package/src/components/CTextField.vue +450 -93
- package/src/components/CTextLink.vue +48 -38
- package/src/components/CThirdPartyLogo.vue +127 -0
- package/src/components/CTimeago.vue +63 -0
- package/src/components/CToast.vue +259 -0
- package/src/components/CToastsList.vue +32 -0
- package/src/components/CValidationMessage.vue +70 -0
- package/src/components/CZipcodeField.vue +69 -0
- package/src/components/index.ts +66 -25
- package/src/components/internal/CCloseButton.vue +57 -0
- package/src/composables/accessibility.ts +29 -0
- package/src/composables/animation.ts +95 -0
- package/src/composables/binding.ts +34 -0
- package/src/composables/colors.ts +59 -0
- package/src/composables/elements.ts +72 -0
- package/src/composables/fields.ts +19 -0
- package/src/composables/gestures.ts +197 -0
- package/src/composables/i18n.ts +13 -0
- package/src/composables/id.ts +23 -0
- package/src/composables/input-mask.ts +139 -0
- package/src/composables/router.ts +64 -0
- package/src/composables/slots.ts +57 -0
- package/src/composables/toast.ts +64 -0
- package/src/composables/validations.ts +214 -0
- package/src/index.ts +7 -7
- package/src/plugin.ts +13 -6
- package/src/services/animation.ts +101 -0
- package/src/services/directives/index.ts +2 -0
- package/src/services/directives/scroll-into-view.ts +86 -0
- package/src/services/directives/tap-animation.ts +71 -0
- package/src/services/id.ts +31 -0
- package/src/services/injections/accordions.ts +4 -0
- package/src/services/injections/animations.ts +3 -0
- package/src/services/injections/buttons.ts +5 -0
- package/src/services/injections/forms.ts +8 -0
- package/src/services/injections/icon-buttons.ts +4 -0
- package/src/services/injections/pills.ts +7 -0
- package/src/services/injections/radio.ts +12 -0
- package/src/shims-vue.d.ts +6 -3
- package/src/styles/_animation.scss +19 -0
- package/src/styles/_button.scss +61 -0
- package/src/styles/_colors.scss +58 -11
- package/src/styles/_core.scss +248 -87
- package/src/styles/_form-fields.scss +68 -15
- package/src/styles/_grenette.scss +13 -0
- package/src/styles/_polymath.scss +14 -0
- package/src/styles/_reset.scss +105 -0
- package/src/styles/_shoelace.scss +46 -0
- package/src/styles/_typography.scss +40 -10
- package/src/styles/main.scss +6 -3
- package/src/styles/utils/a11y.scss +18 -0
- package/src/styles/utils/typography.scss +13 -0
- package/src/styles/utils.scss +560 -0
- package/src/styles/variables.scss +27 -15
- package/src/theme/icons.ts +16 -5
- package/src/types/CForm.ts +15 -0
- package/src/types/font-awesome.ts +6 -0
- package/src/types.ts +15 -0
- package/.browserslistrc +0 -3
- package/.eslintrc.js +0 -4
- package/.stylelintrc.js +0 -3
- package/babel.config.js +0 -3
- package/dist/citrus-ui.common.js +0 -43434
- package/dist/citrus-ui.common.js.map +0 -1
- package/dist/citrus-ui.css +0 -1
- package/dist/citrus-ui.umd.js +0 -43444
- package/dist/citrus-ui.umd.js.map +0 -1
- package/dist/citrus-ui.umd.min.js +0 -27
- package/dist/citrus-ui.umd.min.js.map +0 -1
- package/dist/demo.html +0 -10
- package/dist/fonts/Blitz-Script.85ed9abe.woff2 +0 -0
- package/dist/fonts/ObjectSans-Bold.5492f3d5.woff2 +0 -0
- package/dist/fonts/ObjectSans-BoldSlanted.29e2a87e.woff2 +0 -0
- package/dist/fonts/ObjectSans-Heavy.d0b2f035.woff2 +0 -0
- package/dist/fonts/ObjectSans-HeavySlanted.45e9c063.woff2 +0 -0
- package/dist/fonts/ObjectSans-Light.f885dec3.woff2 +0 -0
- package/dist/fonts/ObjectSans-LightSlanted.b8eb7c12.woff2 +0 -0
- package/dist/fonts/ObjectSans-Regular.e4ea0b90.woff2 +0 -0
- package/dist/fonts/ObjectSans-Slanted.57a90be9.woff2 +0 -0
- package/dist/fonts/ObjectSans-Thin.86d44227.woff2 +0 -0
- package/dist/fonts/ObjectSans-ThinSlanted.20342160.woff2 +0 -0
- package/jest.config.js +0 -9
- package/plopfile.js +0 -67
- package/project.json +0 -69
- package/src/assets/fonts/Blitz-Script.woff2 +0 -0
- package/src/assets/fonts/ObjectSans-Bold.woff2 +0 -0
- package/src/assets/fonts/ObjectSans-BoldSlanted.woff2 +0 -0
- package/src/assets/fonts/ObjectSans-Heavy.woff2 +0 -0
- package/src/assets/fonts/ObjectSans-HeavySlanted.woff2 +0 -0
- package/src/assets/fonts/ObjectSans-Light.woff2 +0 -0
- package/src/assets/fonts/ObjectSans-LightSlanted.woff2 +0 -0
- package/src/assets/fonts/ObjectSans-Regular.woff2 +0 -0
- package/src/assets/fonts/ObjectSans-Slanted.woff2 +0 -0
- package/src/assets/fonts/ObjectSans-Thin.woff2 +0 -0
- package/src/assets/fonts/ObjectSans-ThinSlanted.woff2 +0 -0
- package/src/components/CAlert.vue +0 -78
- package/src/components/CBanner.vue +0 -47
- package/src/components/CButton.vue +0 -146
- package/src/components/CListItemAction.vue +0 -29
- package/src/components/CSegmentedButton.vue +0 -47
- package/src/components/CSegmentedButtonOption.vue +0 -42
- package/src/components/helpers/FormField.vue +0 -48
- package/src/components/helpers/SelectInput.vue +0 -115
- package/src/shims-scss.d.ts +0 -4
- package/src/shims-vuetify.d.ts +0 -4
- package/src/styles/_blitz.scss +0 -8
- package/src/styles/_object-sans.scss +0 -23
- package/storybook-static/0.799c368cbe88266827ba.manager.bundle.js +0 -1
- package/storybook-static/0.a9f0a9ad.iframe.bundle.js +0 -3
- package/storybook-static/0.a9f0a9ad.iframe.bundle.js.LICENSE.txt +0 -8
- package/storybook-static/0.a9f0a9ad.iframe.bundle.js.map +0 -1
- package/storybook-static/1.0438fd8d.iframe.bundle.js +0 -3
- package/storybook-static/1.0438fd8d.iframe.bundle.js.LICENSE.txt +0 -17
- package/storybook-static/1.0438fd8d.iframe.bundle.js.map +0 -1
- package/storybook-static/1.9ebd2fb519f6726108de.manager.bundle.js +0 -1
- package/storybook-static/10.348d8814.iframe.bundle.js +0 -3
- package/storybook-static/10.348d8814.iframe.bundle.js.LICENSE.txt +0 -30
- package/storybook-static/10.348d8814.iframe.bundle.js.map +0 -1
- package/storybook-static/10.a85ea1a67689be8e19ff.manager.bundle.js +0 -1
- package/storybook-static/11.f4e922583ae35da460f3.manager.bundle.js +0 -2
- package/storybook-static/11.f4e922583ae35da460f3.manager.bundle.js.LICENSE.txt +0 -12
- package/storybook-static/12.1415460941f0bdcb8fa8.manager.bundle.js +0 -1
- package/storybook-static/2.75a17459.iframe.bundle.js +0 -3
- package/storybook-static/2.75a17459.iframe.bundle.js.LICENSE.txt +0 -26
- package/storybook-static/2.75a17459.iframe.bundle.js.map +0 -1
- package/storybook-static/5.f459d151315e6780c20f.manager.bundle.js +0 -2
- package/storybook-static/5.f459d151315e6780c20f.manager.bundle.js.LICENSE.txt +0 -8
- package/storybook-static/6.3bd64d820f3745f262ff.manager.bundle.js +0 -1
- package/storybook-static/6.ce8d99b4.iframe.bundle.js +0 -1
- package/storybook-static/7.3d04765dbf3f1dcd706c.manager.bundle.js +0 -1
- package/storybook-static/7.6633a922.iframe.bundle.js +0 -3
- package/storybook-static/7.6633a922.iframe.bundle.js.LICENSE.txt +0 -12
- package/storybook-static/7.6633a922.iframe.bundle.js.map +0 -1
- package/storybook-static/8.b541eadfcb9164835dfc.manager.bundle.js +0 -1
- package/storybook-static/8.fc5e1ebf.iframe.bundle.js +0 -1
- package/storybook-static/9.411ac8e451bbb10926c7.manager.bundle.js +0 -1
- package/storybook-static/9.724ac3ed.iframe.bundle.js +0 -3
- package/storybook-static/9.724ac3ed.iframe.bundle.js.LICENSE.txt +0 -15
- package/storybook-static/9.724ac3ed.iframe.bundle.js.map +0 -1
- package/storybook-static/css/main.95216119.css +0 -1
- package/storybook-static/css/vendors~main.02dc89bf.css +0 -1
- package/storybook-static/favicon.ico +0 -0
- package/storybook-static/fonts/Blitz-Script.85ed9abe.woff2 +0 -0
- package/storybook-static/fonts/ObjectSans-Bold.5492f3d5.woff2 +0 -0
- package/storybook-static/fonts/ObjectSans-BoldSlanted.29e2a87e.woff2 +0 -0
- package/storybook-static/fonts/ObjectSans-Heavy.d0b2f035.woff2 +0 -0
- package/storybook-static/fonts/ObjectSans-HeavySlanted.45e9c063.woff2 +0 -0
- package/storybook-static/fonts/ObjectSans-Light.f885dec3.woff2 +0 -0
- package/storybook-static/fonts/ObjectSans-LightSlanted.b8eb7c12.woff2 +0 -0
- package/storybook-static/fonts/ObjectSans-Regular.e4ea0b90.woff2 +0 -0
- package/storybook-static/fonts/ObjectSans-Slanted.57a90be9.woff2 +0 -0
- package/storybook-static/fonts/ObjectSans-Thin.86d44227.woff2 +0 -0
- package/storybook-static/fonts/ObjectSans-ThinSlanted.20342160.woff2 +0 -0
- package/storybook-static/iframe.html +0 -348
- package/storybook-static/index.html +0 -51
- package/storybook-static/main.7b4aec9c4352d4bb535b.manager.bundle.js +0 -1
- package/storybook-static/main.9e8c64c7.iframe.bundle.js +0 -1
- package/storybook-static/runtime~main.91a0c7330ab317d35c4a.manager.bundle.js +0 -1
- package/storybook-static/runtime~main.e4da100f.iframe.bundle.js +0 -1
- package/storybook-static/vendors~main.6660eda6.iframe.bundle.js +0 -7
- package/storybook-static/vendors~main.6660eda6.iframe.bundle.js.LICENSE.txt +0 -80
- package/storybook-static/vendors~main.6660eda6.iframe.bundle.js.map +0 -1
- package/storybook-static/vendors~main.f7f16cebbf3aa96a4f89.manager.bundle.js +0 -2
- package/storybook-static/vendors~main.f7f16cebbf3aa96a4f89.manager.bundle.js.LICENSE.txt +0 -110
- package/tsconfig.dist.json +0 -7
- package/tsconfig.json +0 -24
- package/vue.config.js +0 -5
|
@@ -1,103 +1,222 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
<sl-dialog
|
|
3
|
+
ref="modal"
|
|
4
|
+
:label="dialogLabel"
|
|
5
|
+
no-header
|
|
6
|
+
:open="value"
|
|
7
|
+
class="c-modal"
|
|
8
|
+
:class="{ 'c-modal--fullscreen': fullscreen }"
|
|
9
|
+
:data-loading="loading || undefined"
|
|
10
|
+
:data-state="value ? 'open' : 'closed'"
|
|
11
|
+
:data-test="getDataTestAttr()"
|
|
12
|
+
@sl-hide="$emit('input', false)"
|
|
13
|
+
@sl-request-close="onRequestClose"
|
|
14
|
+
@sl-after-show="isVisible = true"
|
|
15
|
+
@sl-after-hide="isVisible = false"
|
|
8
16
|
>
|
|
9
|
-
<
|
|
10
|
-
<c-
|
|
11
|
-
<div
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
</
|
|
15
|
-
|
|
16
|
-
<div
|
|
17
|
-
v-if="hasLoadingMessage"
|
|
18
|
-
:data-test="value ? `${dataTest}-loading-message` : null"
|
|
19
|
-
class="modal__loading__message"
|
|
20
|
-
>
|
|
21
|
-
{{ loading }}
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
</c-card-section>
|
|
25
|
-
</c-card>
|
|
26
|
-
<c-card v-else key="default" :data-test="value ? dataTest : null">
|
|
27
|
-
<c-card-header :data-test="value ? `${dataTest}-title` : null">
|
|
28
|
-
{{ title }}
|
|
29
|
-
|
|
30
|
-
<template #append>
|
|
31
|
-
<c-icon-button
|
|
17
|
+
<CExpandTransition class="c-modal__wrapper" :disabled="!enableExpandTransition">
|
|
18
|
+
<div v-if="!loading" class="c-modal__body">
|
|
19
|
+
<div :data-test="getDataTestAttr('content')" class="c-modal__content">
|
|
20
|
+
<h2 v-if="title" class="c-modal__title" :data-test="getDataTestAttr('title')">
|
|
21
|
+
{{ title }}
|
|
22
|
+
</h2>
|
|
23
|
+
<button
|
|
32
24
|
v-if="dismissible"
|
|
33
|
-
class="
|
|
34
|
-
:data-test="
|
|
35
|
-
:icon="faTimes"
|
|
25
|
+
class="c-modal__dismiss"
|
|
26
|
+
:data-test="getDataTestAttr('dismiss')"
|
|
36
27
|
@click="$emit('input', false)"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
28
|
+
>
|
|
29
|
+
{{ $t('Dismiss') }}
|
|
30
|
+
</button>
|
|
31
|
+
<slot />
|
|
32
|
+
</div>
|
|
33
|
+
<CButtonStack
|
|
34
|
+
v-if="footerHasContent"
|
|
35
|
+
tag="footer"
|
|
36
|
+
class="c-modal__footer"
|
|
37
|
+
:large="fullscreen || undefined"
|
|
38
|
+
:data-test="getDataTestAttr('footer')"
|
|
39
|
+
>
|
|
40
|
+
<slot name="footer" />
|
|
41
|
+
</CButtonStack>
|
|
42
|
+
</div>
|
|
43
|
+
<div v-else class="c-modal__loading" :data-test="value ? `${dataTest}-loading` : null">
|
|
44
|
+
<div class="c-modal__loading__loader"><CLoader /></div>
|
|
45
|
+
<slot name="loading">
|
|
46
|
+
<div v-if="loadingMessage" :data-test="value ? `${dataTest}-loading-message` : null">
|
|
47
|
+
{{ loadingMessage }}
|
|
48
|
+
</div>
|
|
49
|
+
</slot>
|
|
50
|
+
</div>
|
|
51
|
+
</CExpandTransition>
|
|
52
|
+
</sl-dialog>
|
|
44
53
|
</template>
|
|
45
54
|
|
|
46
55
|
<script lang="ts">
|
|
47
|
-
import
|
|
48
|
-
import
|
|
49
|
-
import {
|
|
56
|
+
import type SlDialog from '@shoelace-style/shoelace/dist/components/dialog/dialog.js';
|
|
57
|
+
import '@shoelace-style/shoelace/dist/components/dialog/dialog.js';
|
|
58
|
+
import type { PropType } from 'vue';
|
|
59
|
+
import { computed, defineComponent, ref } from 'vue';
|
|
50
60
|
|
|
51
|
-
import
|
|
52
|
-
import
|
|
53
|
-
import
|
|
54
|
-
import
|
|
61
|
+
import CButtonStack from '@propelinc/citrus-ui/src/components/CButtonStack.vue';
|
|
62
|
+
import CExpandTransition from '@propelinc/citrus-ui/src/components/CExpandTransition.vue';
|
|
63
|
+
import CLoader from '@propelinc/citrus-ui/src/components/CLoader.vue';
|
|
64
|
+
import { useShoelaceAnimation } from '@propelinc/citrus-ui/src/composables/animation';
|
|
65
|
+
import { useSlotHasContent } from '@propelinc/citrus-ui/src/composables/slots';
|
|
55
66
|
|
|
56
|
-
|
|
67
|
+
export default defineComponent({
|
|
57
68
|
name: 'CModal',
|
|
58
|
-
components: {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
69
|
+
components: { CButtonStack, CLoader, CExpandTransition },
|
|
70
|
+
props: {
|
|
71
|
+
/** Controls whether or not the modal is showing */
|
|
72
|
+
value: { type: Boolean, default: false },
|
|
73
|
+
/** The title of the modal */
|
|
74
|
+
title: { type: String as PropType<string | null>, default: null },
|
|
75
|
+
/** Shows loading state and sets loading message if string */
|
|
76
|
+
loading: { type: [String, Boolean], default: false },
|
|
77
|
+
/** Allows modal to be dismissed */
|
|
78
|
+
dismissible: { type: Boolean, default: true },
|
|
79
|
+
/** Prefix for test selectors */
|
|
80
|
+
dataTest: { type: String, default: 'modal' },
|
|
81
|
+
/** Toggles the open/close animation */
|
|
82
|
+
transition: { type: Boolean, default: true },
|
|
83
|
+
/** Controls whether the modal displays fullscreen */
|
|
84
|
+
fullscreen: { type: Boolean, default: false },
|
|
85
|
+
/** Aria label for the modal. This is required if title is hidden */
|
|
86
|
+
ariaLabel: { type: String, default: '' },
|
|
87
|
+
},
|
|
88
|
+
emits: ['input'],
|
|
89
|
+
setup(props) {
|
|
90
|
+
const onRequestClose = (event: Event): void => {
|
|
91
|
+
if (!props.dismissible) {
|
|
92
|
+
event.preventDefault();
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const modal = ref<SlDialog | null>(null);
|
|
97
|
+
const animation = computed<'default' | null>(() => (props.transition ? 'default' : null));
|
|
98
|
+
useShoelaceAnimation(modal, 'dialog.show', animation);
|
|
99
|
+
useShoelaceAnimation(modal, 'dialog.hide', animation);
|
|
100
|
+
useShoelaceAnimation(modal, 'dialog.overlay.show', animation);
|
|
101
|
+
useShoelaceAnimation(modal, 'dialog.overlay.hide', animation);
|
|
102
|
+
|
|
103
|
+
const isVisible = ref(false);
|
|
104
|
+
// NOTE(mohan): Don't do any expand transitions until the modal is fully
|
|
105
|
+
// open.
|
|
106
|
+
const enableExpandTransition = computed(() => !props.fullscreen && isVisible.value);
|
|
107
|
+
|
|
108
|
+
const getDataTestAttr = (suffix?: string): string => {
|
|
109
|
+
return suffix ? `${props.dataTest}-${suffix}` : props.dataTest;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const loadingMessage = computed(() => {
|
|
113
|
+
return typeof props.loading === 'string' ? props.loading : null;
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
const dialogLabel = computed(() => {
|
|
117
|
+
if (loadingMessage.value) {
|
|
118
|
+
return loadingMessage.value;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return props.title || props.ariaLabel;
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
const footerHasContent = useSlotHasContent('footer');
|
|
125
|
+
|
|
126
|
+
return {
|
|
127
|
+
dialogLabel,
|
|
128
|
+
loadingMessage,
|
|
129
|
+
isVisible,
|
|
130
|
+
enableExpandTransition,
|
|
131
|
+
footerHasContent,
|
|
132
|
+
onRequestClose,
|
|
133
|
+
getDataTestAttr,
|
|
134
|
+
modal,
|
|
135
|
+
};
|
|
136
|
+
},
|
|
137
|
+
});
|
|
78
138
|
</script>
|
|
79
139
|
|
|
80
140
|
<style lang="scss" scoped>
|
|
81
|
-
@import '
|
|
141
|
+
@import '@propelinc/citrus-ui/src/styles/core';
|
|
142
|
+
@import '@propelinc/citrus-ui/src/styles/utils/a11y';
|
|
143
|
+
|
|
144
|
+
.c-modal {
|
|
145
|
+
&::part(body) {
|
|
146
|
+
padding: 24px 24px 16px;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
:deep() {
|
|
150
|
+
.c-card-section {
|
|
151
|
+
padding: 0 !important;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.c-card-footer {
|
|
155
|
+
padding: 24px 0 0;
|
|
156
|
+
}
|
|
82
157
|
|
|
83
|
-
|
|
84
|
-
|
|
158
|
+
// NOTE(slanden): This is a bit of a hack to ensure that the content of the modal
|
|
159
|
+
// stays within the bounds of the page and scrolls rather than continuing on past
|
|
160
|
+
// the bottom of the page and getting lost.
|
|
161
|
+
.c-expand-transition--disabled .c-expand-transition__content {
|
|
162
|
+
height: 100%;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
85
165
|
}
|
|
86
166
|
|
|
87
|
-
.
|
|
88
|
-
|
|
167
|
+
.c-modal__title {
|
|
168
|
+
@include large-headline;
|
|
169
|
+
|
|
170
|
+
padding: 0 0 8px;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.c-modal__dismiss {
|
|
174
|
+
@include sr-only;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.c-modal__body {
|
|
178
|
+
display: flex;
|
|
179
|
+
flex-direction: column;
|
|
180
|
+
height: 100%;
|
|
89
181
|
}
|
|
90
182
|
|
|
91
|
-
.
|
|
92
|
-
|
|
183
|
+
.c-modal__content {
|
|
184
|
+
display: flex;
|
|
185
|
+
flex: auto;
|
|
186
|
+
flex-direction: column;
|
|
187
|
+
max-height: 100%;
|
|
93
188
|
}
|
|
94
189
|
|
|
95
|
-
.
|
|
96
|
-
|
|
97
|
-
|
|
190
|
+
.c-modal__footer {
|
|
191
|
+
flex: none;
|
|
192
|
+
padding: 24px 0 0;
|
|
98
193
|
}
|
|
99
194
|
|
|
100
|
-
.
|
|
101
|
-
|
|
195
|
+
.c-modal__loading {
|
|
196
|
+
padding: 32px 0 24px;
|
|
197
|
+
text-align: center;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.c-modal__loading__loader {
|
|
201
|
+
line-height: 1;
|
|
202
|
+
margin-bottom: 8px;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.c-modal--fullscreen {
|
|
206
|
+
&::part(panel) {
|
|
207
|
+
border-radius: 0;
|
|
208
|
+
height: 100%;
|
|
209
|
+
max-height: none;
|
|
210
|
+
max-width: none;
|
|
211
|
+
width: 100%;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
&::part(body) {
|
|
215
|
+
padding: calc(env(safe-area-inset-top, 0) + 12px) 16px max(env(safe-area-inset-bottom, 0), 12px);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.c-modal__wrapper {
|
|
219
|
+
height: 100%;
|
|
220
|
+
}
|
|
102
221
|
}
|
|
103
222
|
</style>
|
|
@@ -1,16 +1,34 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<CModal
|
|
3
|
+
:value="value"
|
|
4
|
+
:loading="message || true"
|
|
5
|
+
:data-test="dataTest"
|
|
6
|
+
:dismissible="false"
|
|
7
|
+
@input="$emit('input', $event)"
|
|
8
|
+
>
|
|
9
|
+
<template #loading>
|
|
10
|
+
<slot name="loading" />
|
|
11
|
+
</template>
|
|
12
|
+
</CModal>
|
|
3
13
|
</template>
|
|
4
14
|
|
|
5
15
|
<script lang="ts">
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
16
|
+
import type { PropType } from 'vue';
|
|
17
|
+
import { defineComponent } from 'vue';
|
|
8
18
|
|
|
9
|
-
import CModal from '
|
|
19
|
+
import CModal from '@propelinc/citrus-ui/src/components/CModal.vue';
|
|
10
20
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
21
|
+
export default defineComponent({
|
|
22
|
+
name: 'CModalLoading',
|
|
23
|
+
components: { CModal },
|
|
24
|
+
props: {
|
|
25
|
+
/** Controls whether or not the modal is showing */
|
|
26
|
+
value: { type: Boolean, default: false },
|
|
27
|
+
/** Controls the message shown below the Modal Loading icon */
|
|
28
|
+
message: { type: String as PropType<string | null>, default: null },
|
|
29
|
+
/** Prefix for test selectors */
|
|
30
|
+
dataTest: { type: String, default: 'loading-modal' },
|
|
31
|
+
},
|
|
32
|
+
emits: ['input'],
|
|
33
|
+
});
|
|
16
34
|
</script>
|
|
@@ -1,93 +1,126 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
2
|
+
<div
|
|
3
|
+
data-test="notification"
|
|
4
|
+
class="c-notification"
|
|
5
|
+
:class="{
|
|
6
|
+
'c-notification--alert': alert,
|
|
7
|
+
'c-notification--warning': warning,
|
|
8
|
+
}"
|
|
9
|
+
>
|
|
10
|
+
<CIconButton
|
|
4
11
|
v-if="dismissible"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
12
|
+
data-test="notification-dismiss"
|
|
13
|
+
variant="tertiary"
|
|
14
|
+
class="c-notification__close-button"
|
|
15
|
+
:icon="farXmark"
|
|
16
|
+
:aria-label="$t('Dismiss')"
|
|
8
17
|
@click="$emit('dismiss')"
|
|
9
18
|
/>
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
19
|
+
<slot name="title">
|
|
20
|
+
<div v-if="title || titleIcon" class="c-notification__title" data-test="notification-title">
|
|
21
|
+
<font-awesome-icon
|
|
22
|
+
v-if="titleIcon"
|
|
23
|
+
class="c-notification__title-icon"
|
|
24
|
+
data-test="notification-title-icon"
|
|
25
|
+
:icon="titleIcon"
|
|
26
|
+
/>
|
|
27
|
+
<div data-test="notification-title-text" class="c-notification__title-text">
|
|
28
|
+
<strong>{{ title }}</strong>
|
|
29
|
+
</div>
|
|
14
30
|
</div>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
</div>
|
|
19
|
-
<div class="mb-2">
|
|
31
|
+
</slot>
|
|
32
|
+
|
|
33
|
+
<div data-test="notification-body" class="c-notification__text">
|
|
20
34
|
<slot />
|
|
21
35
|
</div>
|
|
22
|
-
|
|
36
|
+
|
|
37
|
+
<CButton
|
|
23
38
|
v-if="hasButton"
|
|
24
|
-
|
|
25
|
-
class="
|
|
39
|
+
data-test="notification-button"
|
|
40
|
+
class="c-notification__button"
|
|
41
|
+
:loading="buttonLoading"
|
|
26
42
|
:to="buttonTo"
|
|
27
43
|
:href="buttonHref"
|
|
28
44
|
:target="buttonTarget"
|
|
45
|
+
@click="$emit('click:button')"
|
|
29
46
|
>
|
|
30
47
|
{{ buttonText }}
|
|
31
|
-
</
|
|
48
|
+
</CButton>
|
|
32
49
|
</div>
|
|
33
50
|
</template>
|
|
34
51
|
|
|
35
52
|
<script lang="ts">
|
|
36
|
-
import {
|
|
37
|
-
import { faTimes } from '@fortawesome/pro-light-svg-icons';
|
|
53
|
+
import { faXmark as farXmark } from '@fortawesome/pro-regular-svg-icons';
|
|
38
54
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
|
39
|
-
import {
|
|
40
|
-
import { RawLocation } from 'vue-router';
|
|
41
|
-
|
|
42
|
-
import CButton from '@/components/CButton.vue';
|
|
43
|
-
import CIconButton from '@/components/CIconButton.vue';
|
|
55
|
+
import { computed, defineComponent } from 'vue';
|
|
44
56
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
faTimes = faTimes;
|
|
57
|
+
import CButton from '@propelinc/citrus-ui/src/components/CButton/CButton.vue';
|
|
58
|
+
import CIconButton from '@propelinc/citrus-ui/src/components/CIconButton.vue';
|
|
48
59
|
|
|
49
|
-
|
|
50
|
-
|
|
60
|
+
export default defineComponent({
|
|
61
|
+
components: { CButton, CIconButton, FontAwesomeIcon },
|
|
62
|
+
props: {
|
|
63
|
+
// TODO(mohan): Make this prop accessible.
|
|
64
|
+
alert: { type: Boolean, default: false },
|
|
65
|
+
warning: { type: Boolean, default: false },
|
|
66
|
+
dismissible: { type: Boolean, default: false },
|
|
67
|
+
title: { type: String, default: '' },
|
|
68
|
+
titleIcon: { type: [String, Array, Object], default: undefined },
|
|
69
|
+
buttonText: { type: String, default: undefined },
|
|
70
|
+
buttonTo: { type: [Object, String], default: undefined },
|
|
71
|
+
buttonHref: { type: String, default: undefined },
|
|
72
|
+
buttonTarget: { type: String, default: undefined },
|
|
73
|
+
buttonLoading: { type: Boolean, default: false },
|
|
74
|
+
},
|
|
75
|
+
emits: ['click:button', 'dismiss'],
|
|
76
|
+
setup(props) {
|
|
77
|
+
const hasButton = computed(() => !!props.buttonText);
|
|
51
78
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
@Prop([String, Array, Object]) titleIcon?: IconDefinition;
|
|
56
|
-
|
|
57
|
-
/** To render a button, provide button text and one way to link it. */
|
|
58
|
-
@Prop(String) buttonText?: string;
|
|
59
|
-
@Prop([Object, String]) buttonTo?: RawLocation;
|
|
60
|
-
@Prop(String) buttonHref?: string;
|
|
61
|
-
@Prop(String) buttonTarget?: string;
|
|
62
|
-
|
|
63
|
-
get hasButton(): boolean {
|
|
64
|
-
return !!(this.buttonText && (this.buttonTo || this.buttonHref || this.buttonTarget));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
79
|
+
return { hasButton, farXmark };
|
|
80
|
+
},
|
|
81
|
+
});
|
|
67
82
|
</script>
|
|
68
83
|
|
|
69
84
|
<style lang="scss" scoped>
|
|
70
|
-
@import '
|
|
85
|
+
@import '@propelinc/citrus-ui/src/styles/core';
|
|
71
86
|
|
|
72
|
-
.notification {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
padding: 16px
|
|
87
|
+
.c-notification {
|
|
88
|
+
background-color: $color-blue-100;
|
|
89
|
+
border-radius: $border-radius-next;
|
|
90
|
+
padding: 16px;
|
|
76
91
|
position: relative;
|
|
77
92
|
}
|
|
78
93
|
|
|
79
|
-
.
|
|
94
|
+
.c-notification--alert {
|
|
95
|
+
background-color: $color-red-100;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.c-notification--warning {
|
|
99
|
+
background-color: $color-gold-100;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.c-notification__close-button {
|
|
80
103
|
float: right;
|
|
81
104
|
font-size: 14px;
|
|
82
105
|
margin-right: -8px;
|
|
83
106
|
margin-top: -8px;
|
|
84
107
|
}
|
|
85
108
|
|
|
86
|
-
.notification__title {
|
|
109
|
+
.c-notification__title {
|
|
110
|
+
align-items: center;
|
|
87
111
|
display: flex;
|
|
112
|
+
margin-bottom: 8px;
|
|
88
113
|
}
|
|
89
114
|
|
|
90
|
-
.notification__title-
|
|
115
|
+
.c-notification__title-icon {
|
|
116
|
+
margin-right: 8px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.c-notification__title-text {
|
|
91
120
|
flex: 1;
|
|
92
121
|
}
|
|
122
|
+
|
|
123
|
+
.c-notification__button {
|
|
124
|
+
margin-top: 12px;
|
|
125
|
+
}
|
|
93
126
|
</style>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<CMaskedTextField
|
|
3
|
+
v-bind="$attrs"
|
|
4
|
+
:id="id"
|
|
5
|
+
ref="field"
|
|
6
|
+
:value="value"
|
|
7
|
+
type="tel"
|
|
8
|
+
:label="label || $t('Phone number')"
|
|
9
|
+
mask="(###) ###-####"
|
|
10
|
+
:minlength="10"
|
|
11
|
+
:maxlength="10"
|
|
12
|
+
:placeholder="placeholder || '(555) 555-5555'"
|
|
13
|
+
:data-test="dataTest"
|
|
14
|
+
:rules="[...defaultRules, ...rules]"
|
|
15
|
+
autocorrect="off"
|
|
16
|
+
autocapitalize="none"
|
|
17
|
+
>
|
|
18
|
+
<template #label>
|
|
19
|
+
<slot name="label" />
|
|
20
|
+
</template>
|
|
21
|
+
<template #message>
|
|
22
|
+
<slot name="message" />
|
|
23
|
+
</template>
|
|
24
|
+
</CMaskedTextField>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script lang="ts">
|
|
28
|
+
import { computed, defineComponent } from 'vue';
|
|
29
|
+
import type { PropType } from 'vue';
|
|
30
|
+
|
|
31
|
+
import CMaskedTextField from '@propelinc/citrus-ui/src/components/CMaskedTextField.vue';
|
|
32
|
+
import { useFocusableField } from '@propelinc/citrus-ui/src/composables/fields';
|
|
33
|
+
import { useTranslation } from '@propelinc/citrus-ui/src/composables/i18n';
|
|
34
|
+
import type { Rules } from '@propelinc/citrus-ui/src/composables/validations';
|
|
35
|
+
import { minLengthRule } from '@propelinc/shared-utils';
|
|
36
|
+
|
|
37
|
+
export default defineComponent({
|
|
38
|
+
name: 'CPhoneField',
|
|
39
|
+
components: { CMaskedTextField },
|
|
40
|
+
props: {
|
|
41
|
+
/** A custom data-test attribute for the input. */
|
|
42
|
+
dataTest: { type: String, default: 'phone-field' },
|
|
43
|
+
/** A unique id for the input. */
|
|
44
|
+
id: { type: String as PropType<string | undefined>, default: undefined },
|
|
45
|
+
/** The input's label. */
|
|
46
|
+
label: { type: String as PropType<string | null>, default: null },
|
|
47
|
+
/** The input's placeholder. */
|
|
48
|
+
placeholder: { type: String, default: '' },
|
|
49
|
+
/** Additional validation rules. */
|
|
50
|
+
rules: { type: Array as PropType<Rules<string>>, default: () => [] },
|
|
51
|
+
/** The value of the input. */
|
|
52
|
+
value: { type: String, default: '' },
|
|
53
|
+
},
|
|
54
|
+
setup(_, { expose }) {
|
|
55
|
+
const { t } = useTranslation();
|
|
56
|
+
|
|
57
|
+
const defaultRules = computed(() => {
|
|
58
|
+
const errorMessage = t('Please enter a valid {inputLabel}', {
|
|
59
|
+
inputLabel: t('phone number'),
|
|
60
|
+
});
|
|
61
|
+
return [minLengthRule(10, errorMessage)];
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const { field } = useFocusableField(expose);
|
|
65
|
+
|
|
66
|
+
return { defaultRules, field };
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
</script>
|