cja-phoenix 0.6.0 → 0.6.2
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/dist/cja-phoenix.es.js +3816 -4306
- package/dist/style.css +1 -0
- package/dist/types/components/composite/CheckoutCrossSell.vue.d.ts +29 -0
- package/dist/types/components/composite/CheckoutLayout.vue.d.ts +23 -0
- package/dist/types/components/composite/CheckoutMilestones.vue.d.ts +16 -0
- package/dist/types/components/composite/CjaFooter.vue.d.ts +34 -0
- package/dist/types/components/composite/CjaMenuBar.vue.d.ts +52 -0
- package/dist/types/components/composite/FunnelLayout.vue.d.ts +35 -0
- package/dist/types/components/composite/FunnelSubmit.vue.d.ts +26 -0
- package/dist/types/components/composite/FunnelSummary.vue.d.ts +77 -0
- package/dist/types/components/composite/FunnelTitle.vue.d.ts +19 -0
- package/dist/types/components/composite/InfoShowcase.vue.d.ts +25 -0
- package/dist/types/components/composite/JourneyMacroSteps.vue.d.ts +16 -0
- package/dist/types/components/composite/ResultsSidebar.vue.d.ts +9 -0
- package/dist/types/components/forms/CheckboxInput.vue.d.ts +41 -0
- package/dist/types/components/forms/CurrencyInput.vue.d.ts +65 -0
- package/dist/types/components/forms/FileInput.vue.d.ts +89 -0
- package/dist/types/components/forms/NumberInput.vue.d.ts +58 -0
- package/dist/types/components/forms/PhoneInput.vue.d.ts +69 -0
- package/dist/types/components/forms/RadioInput.vue.d.ts +43 -0
- package/dist/types/components/forms/RadioInputList.vue.d.ts +65 -0
- package/dist/types/components/forms/SelectInput.vue.d.ts +80 -0
- package/dist/types/components/forms/SelectionTiles.vue.d.ts +51 -0
- package/dist/types/components/forms/TextInput.vue.d.ts +76 -0
- package/dist/types/components/forms/TileCheckboxInput.vue.d.ts +23 -0
- package/dist/types/components/forms/ToggleInput.vue.d.ts +51 -0
- package/dist/types/components/forms/structure/InputContainer.vue.d.ts +22 -0
- package/dist/types/components/forms/structure/InputError.vue.d.ts +15 -0
- package/dist/types/components/forms/structure/InputTitle.vue.d.ts +21 -0
- package/dist/types/components/structural/CjaButton.vue.d.ts +59 -0
- package/dist/types/components/structural/CollapseContainer.vue.d.ts +51 -0
- package/dist/{components → types/components}/structural/ContentTabs.vue.d.ts +17 -20
- package/dist/types/components/structural/FixedContainer.vue.d.ts +68 -0
- package/dist/types/components/structural/GridContainer.vue.d.ts +36 -0
- package/dist/types/components/structural/GridItem.vue.d.ts +26 -0
- package/dist/types/components/structural/InfoMessage.vue.d.ts +30 -0
- package/dist/types/components/structural/LoadingSpinner.vue.d.ts +17 -0
- package/dist/types/components/structural/Modal.vue.d.ts +65 -0
- package/dist/types/components/structural/Scaffold.vue.d.ts +9 -0
- package/dist/types/index.d.ts +16 -7
- package/dist/types/stories/CjaButton.story.vue.d.ts +2 -0
- package/dist/types/stories/ContentTabs.story.vue.d.ts +2 -0
- package/dist/types/stories/Modal.story.vue.d.ts +2 -0
- package/dist/types/stories/RadioInputList.story.vue.d.ts +2 -0
- package/dist/types/{Router.d.ts → types/Router.d.ts} +1 -0
- package/dist/types/types/index.d.ts +7 -0
- package/dist/{utils → types/utils}/formValidations.d.ts +3 -0
- package/package.json +21 -30
- package/src/assets/backdrop.scss +10 -0
- package/src/assets/breakpoints.scss +12 -0
- package/src/assets/fonts.scss +1 -0
- package/src/assets/forms.scss +97 -0
- package/src/assets/grid.scss +14 -0
- package/src/assets/iconia/Read Me.txt +7 -0
- package/src/assets/iconia/demo-files/demo.css +155 -0
- package/src/assets/iconia/demo-files/demo.js +30 -0
- package/src/assets/iconia/demo.html +7055 -0
- package/src/assets/iconia/fonts/CGG-icomoon.eot +0 -0
- package/src/assets/iconia/fonts/CGG-icomoon.svg +513 -0
- package/src/assets/iconia/fonts/CGG-icomoon.ttf +0 -0
- package/src/assets/iconia/fonts/CGG-icomoon.woff +0 -0
- package/src/assets/iconia/selection.json +1 -0
- package/src/assets/iconia/style.css +1547 -0
- package/src/assets/iconia/style.scss +2556 -0
- package/src/assets/iconia/variables.scss +507 -0
- package/src/assets/main.scss +30 -0
- package/src/assets/radioOld.scss +52 -0
- package/src/assets/shadows.scss +3 -0
- package/src/assets/tippy.scss +45 -0
- package/src/assets/vars/development.scss +4 -0
- package/src/assets/vars/production.scss +4 -0
- package/src/components/composite/CheckoutCrossSell.vue +478 -0
- package/src/components/composite/CheckoutLayout.vue +59 -0
- package/src/components/composite/CheckoutMilestones.vue +161 -0
- package/src/components/composite/CjaFooter.vue +223 -0
- package/src/components/composite/CjaMenuBar.vue +543 -0
- package/src/components/composite/FunnelLayout.vue +197 -0
- package/src/components/composite/FunnelSubmit.vue +53 -0
- package/src/components/composite/FunnelSummary.vue +198 -0
- package/src/components/composite/FunnelTitle.vue +59 -0
- package/src/components/composite/InfoShowcase.vue +87 -0
- package/src/components/composite/JourneyMacroSteps.vue +104 -0
- package/src/components/composite/ProductDetails.vue +149 -0
- package/src/components/composite/ResultsLayout.vue +156 -0
- package/src/components/composite/ResultsSidebar.vue +74 -0
- package/src/components/forms/CheckboxInput.vue +103 -0
- package/src/components/forms/CurrencyInput.vue +126 -0
- package/src/components/forms/FileInput.vue +250 -0
- package/src/components/forms/NumberInput.vue +165 -0
- package/src/components/forms/PhoneInput.vue +122 -0
- package/src/components/forms/RadioInput.vue +98 -0
- package/src/components/forms/RadioInputList.vue +156 -0
- package/src/components/forms/SelectInput.vue +392 -0
- package/src/components/forms/SelectionTiles.vue +196 -0
- package/src/components/forms/TextInput.vue +144 -0
- package/src/components/forms/TileCheckboxInput.vue +96 -0
- package/src/components/forms/ToggleInput.vue +88 -0
- package/src/components/forms/structure/InputContainer.vue +28 -0
- package/src/components/forms/structure/InputError.vue +26 -0
- package/src/components/forms/structure/InputTitle.vue +52 -0
- package/src/components/index.ts +73 -0
- package/src/components/structural/CjaButton.vue +332 -0
- package/src/components/structural/CollapseContainer.vue +141 -0
- package/src/components/structural/ContentTabs.vue +105 -0
- package/src/components/structural/FixedContainer.vue +107 -0
- package/src/components/structural/GridContainer.vue +70 -0
- package/src/components/structural/GridItem.vue +47 -0
- package/src/components/structural/InfoMessage.vue +105 -0
- package/src/components/structural/LoadingSpinner.vue +39 -0
- package/src/components/structural/Modal.vue +209 -0
- package/src/components/structural/Scaffold.vue +3 -0
- package/src/constants/MyConstants.ts +1 -0
- package/src/constants/index.ts +5 -0
- package/src/env.d.ts +11 -0
- package/src/index.ts +31 -0
- package/src/stories/CjaButton.story.vue +192 -0
- package/src/stories/ContentTabs.story.vue +59 -0
- package/src/stories/Modal.story.vue +127 -0
- package/src/stories/RadioInputList.story.vue +61 -0
- package/src/types/CheckoutMilestone.ts +5 -0
- package/src/types/Footer.ts +17 -0
- package/src/types/Menu.ts +19 -0
- package/src/types/RadioOption.ts +7 -0
- package/src/types/Router.ts +19 -0
- package/src/types/SelectOption.ts +6 -0
- package/src/types/StoreDataValue.ts +12 -0
- package/src/types/Storyblok.ts +10 -0
- package/src/types/TileOption.ts +8 -0
- package/src/types/index.ts +19 -0
- package/src/utils/cjaRouter.ts +74 -0
- package/src/utils/cjaStore.ts +43 -0
- package/src/utils/findScrollAncestor.ts +16 -0
- package/src/utils/formValidations.ts +192 -0
- package/src/utils/generateRoutes.ts +36 -0
- package/src/utils/getFromUrl.ts +25 -0
- package/src/utils/getMessages.ts +23 -0
- package/src/utils/gtm.ts +158 -0
- package/src/utils/index.ts +31 -0
- package/src/utils/jsonReviver.ts +20 -0
- package/src/utils/storyblokLink.ts +4 -0
- package/src/utils/updateForm.ts +40 -0
- package/src/utils/uploadFile.ts +25 -0
- package/src/utils/useGlobalProperties.ts +11 -0
- package/src/utils/useViewportDetector.ts +35 -0
- package/dist/cja-phoenix.cjs.js +0 -44
- package/dist/cja-phoenix.d.ts +0 -3
- package/dist/cja-phoenix.umd.js +0 -45
- package/dist/components/composite/CheckoutCrossSell.vue.d.ts +0 -36
- package/dist/components/composite/CheckoutLayout.vue.d.ts +0 -20
- package/dist/components/composite/CheckoutMilestones.vue.d.ts +0 -13
- package/dist/components/composite/CjaFooter.vue.d.ts +0 -29
- package/dist/components/composite/CjaMenuBar.vue.d.ts +0 -53
- package/dist/components/composite/FunnelLayout.vue.d.ts +0 -38
- package/dist/components/composite/FunnelSubmit.vue.d.ts +0 -25
- package/dist/components/composite/FunnelSummary.vue.d.ts +0 -76
- package/dist/components/composite/FunnelTitle.vue.d.ts +0 -24
- package/dist/components/composite/InfoShowcase.vue.d.ts +0 -28
- package/dist/components/composite/JourneyMacroSteps.vue.d.ts +0 -13
- package/dist/components/forms/CheckboxInput.vue.d.ts +0 -38
- package/dist/components/forms/CurrencyInput.vue.d.ts +0 -92
- package/dist/components/forms/FileInput.vue.d.ts +0 -118
- package/dist/components/forms/NumberInput.vue.d.ts +0 -73
- package/dist/components/forms/PhoneInput.vue.d.ts +0 -104
- package/dist/components/forms/RadioInputList.vue.d.ts +0 -96
- package/dist/components/forms/SelectInput.vue.d.ts +0 -121
- package/dist/components/forms/SelectionTiles.vue.d.ts +0 -64
- package/dist/components/forms/TextInput.vue.d.ts +0 -127
- package/dist/components/forms/TileCheckboxInput.vue.d.ts +0 -34
- package/dist/components/forms/ToggleInput.vue.d.ts +0 -70
- package/dist/components/forms/structure/InputContainer.vue.d.ts +0 -17
- package/dist/components/forms/structure/InputError.vue.d.ts +0 -12
- package/dist/components/forms/structure/InputTitle.vue.d.ts +0 -30
- package/dist/components/structural/CjaButton.vue.d.ts +0 -66
- package/dist/components/structural/CollapseContainer.vue.d.ts +0 -40
- package/dist/components/structural/FixedContainer.vue.d.ts +0 -69
- package/dist/components/structural/GridContainer.vue.d.ts +0 -21
- package/dist/components/structural/GridItem.vue.d.ts +0 -29
- package/dist/components/structural/InfoMessage.vue.d.ts +0 -39
- package/dist/components/structural/LoadingSpinner.vue.d.ts +0 -16
- package/dist/components/structural/Modal.vue.d.ts +0 -50
- package/dist/components/structural/Scaffold.vue.d.ts +0 -3
- package/dist/components/structural/Scaffold.vue.d.ts.map +0 -1
- package/dist/index.d.ts +0 -14
- package/dist/src/components/composite/CheckoutCrossSell.vue.d.ts +0 -5
- package/dist/src/components/composite/CheckoutCrossSell.vue.d.ts.map +0 -1
- package/dist/src/components/composite/CheckoutLayout.vue.d.ts +0 -5
- package/dist/src/components/composite/CheckoutLayout.vue.d.ts.map +0 -1
- package/dist/src/components/composite/CheckoutMilestones.vue.d.ts +0 -5
- package/dist/src/components/composite/CheckoutMilestones.vue.d.ts.map +0 -1
- package/dist/src/components/composite/CjaFooter.vue.d.ts +0 -5
- package/dist/src/components/composite/CjaFooter.vue.d.ts.map +0 -1
- package/dist/src/components/composite/CjaMenuBar.vue.d.ts +0 -5
- package/dist/src/components/composite/CjaMenuBar.vue.d.ts.map +0 -1
- package/dist/src/components/composite/FunnelLayout.vue.d.ts +0 -5
- package/dist/src/components/composite/FunnelLayout.vue.d.ts.map +0 -1
- package/dist/src/components/composite/FunnelSubmit.vue.d.ts +0 -5
- package/dist/src/components/composite/FunnelSubmit.vue.d.ts.map +0 -1
- package/dist/src/components/composite/FunnelSummary.vue.d.ts +0 -5
- package/dist/src/components/composite/FunnelSummary.vue.d.ts.map +0 -1
- package/dist/src/components/composite/FunnelTitle.vue.d.ts +0 -5
- package/dist/src/components/composite/FunnelTitle.vue.d.ts.map +0 -1
- package/dist/src/components/composite/InfoShowcase.vue.d.ts +0 -5
- package/dist/src/components/composite/InfoShowcase.vue.d.ts.map +0 -1
- package/dist/src/components/composite/JourneyMacroSteps.vue.d.ts +0 -5
- package/dist/src/components/composite/JourneyMacroSteps.vue.d.ts.map +0 -1
- package/dist/src/components/composite/ProductDetails.vue.d.ts +0 -5
- package/dist/src/components/composite/ProductDetails.vue.d.ts.map +0 -1
- package/dist/src/components/composite/ResultsLayout.vue.d.ts +0 -5
- package/dist/src/components/composite/ResultsLayout.vue.d.ts.map +0 -1
- package/dist/src/components/forms/CheckboxInput.vue.d.ts +0 -5
- package/dist/src/components/forms/CheckboxInput.vue.d.ts.map +0 -1
- package/dist/src/components/forms/CurrencyInput.vue.d.ts +0 -5
- package/dist/src/components/forms/CurrencyInput.vue.d.ts.map +0 -1
- package/dist/src/components/forms/FileInput.vue.d.ts +0 -5
- package/dist/src/components/forms/FileInput.vue.d.ts.map +0 -1
- package/dist/src/components/forms/NumberInput.vue.d.ts +0 -5
- package/dist/src/components/forms/NumberInput.vue.d.ts.map +0 -1
- package/dist/src/components/forms/PhoneInput.vue.d.ts +0 -5
- package/dist/src/components/forms/PhoneInput.vue.d.ts.map +0 -1
- package/dist/src/components/forms/RadioInputList.vue.d.ts +0 -5
- package/dist/src/components/forms/RadioInputList.vue.d.ts.map +0 -1
- package/dist/src/components/forms/SelectInput.vue.d.ts +0 -5
- package/dist/src/components/forms/SelectInput.vue.d.ts.map +0 -1
- package/dist/src/components/forms/SelectionTiles.vue.d.ts +0 -5
- package/dist/src/components/forms/SelectionTiles.vue.d.ts.map +0 -1
- package/dist/src/components/forms/TextInput.vue.d.ts +0 -5
- package/dist/src/components/forms/TextInput.vue.d.ts.map +0 -1
- package/dist/src/components/forms/TileCheckboxInput.vue.d.ts +0 -5
- package/dist/src/components/forms/TileCheckboxInput.vue.d.ts.map +0 -1
- package/dist/src/components/forms/ToggleInput.vue.d.ts +0 -5
- package/dist/src/components/forms/ToggleInput.vue.d.ts.map +0 -1
- package/dist/src/components/forms/structure/InputContainer.vue.d.ts +0 -5
- package/dist/src/components/forms/structure/InputContainer.vue.d.ts.map +0 -1
- package/dist/src/components/forms/structure/InputError.vue.d.ts +0 -5
- package/dist/src/components/forms/structure/InputError.vue.d.ts.map +0 -1
- package/dist/src/components/forms/structure/InputTitle.vue.d.ts +0 -5
- package/dist/src/components/forms/structure/InputTitle.vue.d.ts.map +0 -1
- package/dist/src/components/structural/CjaButton.vue.d.ts +0 -5
- package/dist/src/components/structural/CjaButton.vue.d.ts.map +0 -1
- package/dist/src/components/structural/CollapseContainer.vue.d.ts +0 -5
- package/dist/src/components/structural/CollapseContainer.vue.d.ts.map +0 -1
- package/dist/src/components/structural/ContentTabs.vue.d.ts +0 -5
- package/dist/src/components/structural/ContentTabs.vue.d.ts.map +0 -1
- package/dist/src/components/structural/FixedContainer.vue.d.ts +0 -5
- package/dist/src/components/structural/FixedContainer.vue.d.ts.map +0 -1
- package/dist/src/components/structural/GridContainer.vue.d.ts +0 -5
- package/dist/src/components/structural/GridContainer.vue.d.ts.map +0 -1
- package/dist/src/components/structural/GridItem.vue.d.ts +0 -5
- package/dist/src/components/structural/GridItem.vue.d.ts.map +0 -1
- package/dist/src/components/structural/InfoMessage.vue.d.ts +0 -5
- package/dist/src/components/structural/InfoMessage.vue.d.ts.map +0 -1
- package/dist/src/components/structural/LoadingSpinner.vue.d.ts +0 -5
- package/dist/src/components/structural/LoadingSpinner.vue.d.ts.map +0 -1
- package/dist/src/components/structural/Modal.vue.d.ts +0 -5
- package/dist/src/components/structural/Modal.vue.d.ts.map +0 -1
- package/dist/styles.css +0 -1
- /package/dist/{components → types/components}/composite/ProductDetails.vue.d.ts +0 -0
- /package/dist/{components → types/components}/composite/ResultsLayout.vue.d.ts +0 -0
- /package/dist/{components → types/components}/index.d.ts +0 -0
- /package/dist/{constants → types/constants}/MyConstants.d.ts +0 -0
- /package/dist/{constants → types/constants}/index.d.ts +0 -0
- /package/dist/types/{CheckoutMilestone.d.ts → types/CheckoutMilestone.d.ts} +0 -0
- /package/dist/types/{Footer.d.ts → types/Footer.d.ts} +0 -0
- /package/dist/types/{Menu.d.ts → types/Menu.d.ts} +0 -0
- /package/dist/types/{RadioOption.d.ts → types/RadioOption.d.ts} +0 -0
- /package/dist/types/{SelectOption.d.ts → types/SelectOption.d.ts} +0 -0
- /package/dist/types/{StoreDataValue.d.ts → types/StoreDataValue.d.ts} +0 -0
- /package/dist/types/{Storyblok.d.ts → types/Storyblok.d.ts} +0 -0
- /package/dist/types/{TileOption.d.ts → types/TileOption.d.ts} +0 -0
- /package/dist/{utils → types/utils}/cjaRouter.d.ts +0 -0
- /package/dist/{utils → types/utils}/cjaStore.d.ts +0 -0
- /package/dist/{utils → types/utils}/findScrollAncestor.d.ts +0 -0
- /package/dist/{utils → types/utils}/generateRoutes.d.ts +0 -0
- /package/dist/{utils → types/utils}/getFromUrl.d.ts +0 -0
- /package/dist/{utils → types/utils}/getMessages.d.ts +0 -0
- /package/dist/{utils → types/utils}/gtm.d.ts +0 -0
- /package/dist/{utils → types/utils}/index.d.ts +0 -0
- /package/dist/{utils → types/utils}/jsonReviver.d.ts +0 -0
- /package/dist/{utils → types/utils}/storyblokLink.d.ts +0 -0
- /package/dist/{utils → types/utils}/updateForm.d.ts +0 -0
- /package/dist/{utils → types/utils}/uploadFile.d.ts +0 -0
- /package/dist/{utils → types/utils}/useGlobalProperties.d.ts +0 -0
- /package/dist/{utils → types/utils}/useViewportDetector.d.ts +0 -0
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<InputContainer v-bind="{ layout }">
|
|
3
|
+
<InputTitle v-bind="{ title, tooltip, size, disabled }" v-if="title" />
|
|
4
|
+
|
|
5
|
+
<div
|
|
6
|
+
ref="inputEl"
|
|
7
|
+
class="input-wrapper"
|
|
8
|
+
:class="[
|
|
9
|
+
`size-${size}`,
|
|
10
|
+
{
|
|
11
|
+
error: errorMessage,
|
|
12
|
+
success: value && !loading,
|
|
13
|
+
loading: loading,
|
|
14
|
+
},
|
|
15
|
+
]"
|
|
16
|
+
@click="handleInput"
|
|
17
|
+
>
|
|
18
|
+
<span class="input-text">
|
|
19
|
+
{{
|
|
20
|
+
!loading
|
|
21
|
+
? value
|
|
22
|
+
? `${value.name}.${value.extension}`
|
|
23
|
+
: placeholder
|
|
24
|
+
: customText.loading
|
|
25
|
+
}}
|
|
26
|
+
</span>
|
|
27
|
+
<div class="icon-wrapper">
|
|
28
|
+
<span class="spinner" v-if="loading"></span>
|
|
29
|
+
<span v-else-if="!value" class="m-cgg-icon--upload"></span>
|
|
30
|
+
<Scaffold v-else>
|
|
31
|
+
<span v-if="errorMessage" class="m-cgg-icon--cross-cja"></span>
|
|
32
|
+
<span v-else class="m-cgg-icon--check-cja"></span>
|
|
33
|
+
<span class="m-cgg-icon--trash" @click.stop="deleteFile"></span>
|
|
34
|
+
</Scaffold>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<div class="input-description" v-if="description">
|
|
39
|
+
{{ description }}
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<input
|
|
43
|
+
ref="inputElement"
|
|
44
|
+
type="file"
|
|
45
|
+
name="file-input"
|
|
46
|
+
@change="updateFile"
|
|
47
|
+
/>
|
|
48
|
+
|
|
49
|
+
<InputError :error="errorMessage" v-if="errorMessage && errorDisplay" />
|
|
50
|
+
</InputContainer>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<script lang="ts" setup>
|
|
54
|
+
import { ref } from "vue";
|
|
55
|
+
import Scaffold from "../structural/Scaffold.vue";
|
|
56
|
+
import InputContainer from "./structure/InputContainer.vue";
|
|
57
|
+
import InputError from "./structure/InputError.vue";
|
|
58
|
+
import InputTitle from "./structure/InputTitle.vue";
|
|
59
|
+
import { useField } from "vee-validate";
|
|
60
|
+
import { onMounted } from "vue";
|
|
61
|
+
import { onUnmounted } from "vue";
|
|
62
|
+
import { InputHTMLAttributes } from "vue";
|
|
63
|
+
|
|
64
|
+
const props = withDefaults(
|
|
65
|
+
defineProps<{
|
|
66
|
+
layout?: "vertical" | "horizontal";
|
|
67
|
+
size?: "sm" | "md" | "lg";
|
|
68
|
+
title?: string;
|
|
69
|
+
tooltip?: string;
|
|
70
|
+
placeholder?: string;
|
|
71
|
+
errorDisplay?: boolean;
|
|
72
|
+
loading?: boolean;
|
|
73
|
+
description?: string;
|
|
74
|
+
disabled?: InputHTMLAttributes["disabled"];
|
|
75
|
+
modelValue?: {
|
|
76
|
+
name: string;
|
|
77
|
+
extension: string;
|
|
78
|
+
};
|
|
79
|
+
validation?: any;
|
|
80
|
+
customText?: {
|
|
81
|
+
loading?: string;
|
|
82
|
+
};
|
|
83
|
+
}>(),
|
|
84
|
+
{
|
|
85
|
+
layout: "vertical",
|
|
86
|
+
size: "md",
|
|
87
|
+
placeholder: "Anexar ficheiro",
|
|
88
|
+
errorDisplay: true,
|
|
89
|
+
customText: () => ({
|
|
90
|
+
loading: "A carregar ficheiro",
|
|
91
|
+
}),
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
const inputEl = ref();
|
|
96
|
+
|
|
97
|
+
const emit = defineEmits(["update:modelValue", "update:delete"]);
|
|
98
|
+
|
|
99
|
+
const sizeReset = () => {
|
|
100
|
+
const displayEl = inputEl.value.querySelector(".input-text") as HTMLElement;
|
|
101
|
+
|
|
102
|
+
displayEl.style.whiteSpace = "";
|
|
103
|
+
displayEl.style.width = "";
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
107
|
+
window.requestAnimationFrame(() => {
|
|
108
|
+
const displayEl = entries[0].target.querySelector(
|
|
109
|
+
".input-text"
|
|
110
|
+
) as HTMLElement;
|
|
111
|
+
|
|
112
|
+
displayEl.style.width = `${displayEl.getBoundingClientRect().width}px`;
|
|
113
|
+
displayEl.style.whiteSpace = "nowrap";
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
onMounted(() => {
|
|
118
|
+
resizeObserver.observe(inputEl.value);
|
|
119
|
+
|
|
120
|
+
window.addEventListener("resize", sizeReset);
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
onUnmounted(() => {
|
|
124
|
+
window.removeEventListener("resize", sizeReset);
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
const loading = ref(false);
|
|
128
|
+
const inputElement = ref();
|
|
129
|
+
|
|
130
|
+
const { value, errorMessage, meta, validate } = useField(
|
|
131
|
+
"input",
|
|
132
|
+
props.validation,
|
|
133
|
+
{ initialValue: props.modelValue }
|
|
134
|
+
);
|
|
135
|
+
defineExpose({ errorMessage, meta, validate });
|
|
136
|
+
|
|
137
|
+
const handleInput = () => {
|
|
138
|
+
if (!props.modelValue) {
|
|
139
|
+
inputElement.value.click();
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const updateFile = () => {
|
|
144
|
+
const file = inputElement.value.files[0];
|
|
145
|
+
|
|
146
|
+
emit("update:modelValue", {
|
|
147
|
+
name: file.name.match(/^.+(?=\..+)/g)[0],
|
|
148
|
+
extension: file.name.match(/[^.]+$/g)[0],
|
|
149
|
+
file: file,
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const deleteFile = () => {
|
|
154
|
+
inputElement.value.value = null;
|
|
155
|
+
emit("update:delete");
|
|
156
|
+
};
|
|
157
|
+
</script>
|
|
158
|
+
|
|
159
|
+
<style lang="scss" scoped>
|
|
160
|
+
@import "../../assets/forms.scss";
|
|
161
|
+
|
|
162
|
+
.input-wrapper {
|
|
163
|
+
@include input-template;
|
|
164
|
+
|
|
165
|
+
cursor: pointer;
|
|
166
|
+
display: flex;
|
|
167
|
+
justify-content: space-between;
|
|
168
|
+
align-items: center;
|
|
169
|
+
gap: 10px;
|
|
170
|
+
|
|
171
|
+
&.success {
|
|
172
|
+
cursor: auto;
|
|
173
|
+
border-color: #076b9c;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
&.loading {
|
|
177
|
+
pointer-events: none;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
&.error {
|
|
181
|
+
border-color: #ff533f;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.input-text {
|
|
185
|
+
flex-grow: 1;
|
|
186
|
+
text-overflow: ellipsis;
|
|
187
|
+
overflow: hidden;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.icon-wrapper {
|
|
191
|
+
display: flex;
|
|
192
|
+
flex-direction: row;
|
|
193
|
+
justify-content: flex-end;
|
|
194
|
+
gap: 10px;
|
|
195
|
+
flex-basis: 43px;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.spinner {
|
|
199
|
+
width: 10px;
|
|
200
|
+
height: 10px;
|
|
201
|
+
border: 3px solid #b5e187;
|
|
202
|
+
border-top-color: #f3f7ef;
|
|
203
|
+
border-radius: 50%;
|
|
204
|
+
animation: spin 1s infinite;
|
|
205
|
+
animation-timing-function: linear;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.m-cgg-icon--upload {
|
|
209
|
+
color: #076b9c;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.m-cgg-icon--trash {
|
|
213
|
+
cursor: pointer;
|
|
214
|
+
color: #9fabbc;
|
|
215
|
+
transition: all 0.2s ease-in-out;
|
|
216
|
+
|
|
217
|
+
&:hover {
|
|
218
|
+
color: #076b9c;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.m-cgg-icon--cross-cja {
|
|
223
|
+
color: #ff533f;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.m-cgg-icon--check-cja {
|
|
227
|
+
color: #77aa43;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.input-description {
|
|
232
|
+
font-size: 12px;
|
|
233
|
+
line-height: 12px;
|
|
234
|
+
color: #312f2e;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
input[type="file"] {
|
|
238
|
+
display: none;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
@keyframes spin {
|
|
242
|
+
from {
|
|
243
|
+
transform: rotate(0deg);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
to {
|
|
247
|
+
transform: rotate(360deg);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
</style>
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="number-input-container">
|
|
3
|
+
<div class="text-container" v-if="title">
|
|
4
|
+
<div class="title">
|
|
5
|
+
{{ title }}
|
|
6
|
+
</div>
|
|
7
|
+
<div class="description" v-if="description">
|
|
8
|
+
{{ description }}
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="controls-container">
|
|
12
|
+
<button
|
|
13
|
+
class="btn-minus"
|
|
14
|
+
:disabled="value - step < min"
|
|
15
|
+
@click="$emit('update:modelValue', value - step)"
|
|
16
|
+
></button>
|
|
17
|
+
<div class="value">{{ value }}</div>
|
|
18
|
+
<button
|
|
19
|
+
class="btn-plus"
|
|
20
|
+
:disabled="max ? value + step > max : false"
|
|
21
|
+
@click="$emit('update:modelValue', value + step)"
|
|
22
|
+
></button>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
<InputError :error="errorMessage" v-if="errorMessage && errorDisplay" />
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script setup lang="ts">
|
|
29
|
+
import { useField } from "vee-validate";
|
|
30
|
+
import InputError from "./structure/InputError.vue";
|
|
31
|
+
|
|
32
|
+
const props = withDefaults(
|
|
33
|
+
defineProps<{
|
|
34
|
+
title?: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
modelValue: number;
|
|
37
|
+
max?: number;
|
|
38
|
+
min?: number;
|
|
39
|
+
step?: number;
|
|
40
|
+
validation?: any;
|
|
41
|
+
errorDisplay?: boolean;
|
|
42
|
+
}>(),
|
|
43
|
+
{
|
|
44
|
+
modelValue: 0,
|
|
45
|
+
min: 0,
|
|
46
|
+
step: 1,
|
|
47
|
+
errorDisplay: true,
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
defineEmits(["update:modelValue"]);
|
|
52
|
+
|
|
53
|
+
const { value, errorMessage, meta, validate } = useField(
|
|
54
|
+
"input",
|
|
55
|
+
props.validation,
|
|
56
|
+
{ initialValue: props.modelValue }
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
defineExpose({ errorMessage, meta, validate });
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<style lang="scss" scoped>
|
|
63
|
+
.number-input-container {
|
|
64
|
+
display: flex;
|
|
65
|
+
justify-content: space-between;
|
|
66
|
+
align-items: center;
|
|
67
|
+
gap: 30px;
|
|
68
|
+
padding: 20px;
|
|
69
|
+
border: 1px solid #dedede;
|
|
70
|
+
box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.06);
|
|
71
|
+
border-radius: 8px;
|
|
72
|
+
|
|
73
|
+
.text-container {
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: column;
|
|
76
|
+
gap: 5px;
|
|
77
|
+
|
|
78
|
+
.title {
|
|
79
|
+
font-weight: 700;
|
|
80
|
+
font-size: 15px;
|
|
81
|
+
line-height: 18px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.description {
|
|
85
|
+
font-size: 12px;
|
|
86
|
+
line-height: 12px;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.controls-container {
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
gap: 10px;
|
|
94
|
+
|
|
95
|
+
button {
|
|
96
|
+
position: relative;
|
|
97
|
+
width: 32px;
|
|
98
|
+
height: 32px;
|
|
99
|
+
background: none;
|
|
100
|
+
border-width: 2px;
|
|
101
|
+
border-style: solid;
|
|
102
|
+
border-color: #979290;
|
|
103
|
+
border-radius: 50%;
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
transition: all 0.2s ease-in-out;
|
|
106
|
+
|
|
107
|
+
&:before,
|
|
108
|
+
&:after {
|
|
109
|
+
position: absolute;
|
|
110
|
+
left: 50%;
|
|
111
|
+
transform: translateX(-50%);
|
|
112
|
+
width: 12px;
|
|
113
|
+
height: 2px;
|
|
114
|
+
background-color: #979290;
|
|
115
|
+
transition: all 0.2s ease-in-out;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&:hover {
|
|
119
|
+
border-color: #0d2745;
|
|
120
|
+
|
|
121
|
+
&:before,
|
|
122
|
+
&:after {
|
|
123
|
+
background-color: #0d2745;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&:disabled {
|
|
128
|
+
cursor: auto;
|
|
129
|
+
border-color: #cccbc8;
|
|
130
|
+
|
|
131
|
+
&:before,
|
|
132
|
+
&:after {
|
|
133
|
+
background-color: #cccbc8;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&.btn-minus {
|
|
138
|
+
&:before {
|
|
139
|
+
content: "";
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&.btn-plus {
|
|
144
|
+
&:before {
|
|
145
|
+
content: "";
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&:after {
|
|
149
|
+
content: "";
|
|
150
|
+
transform: translateX(-50%) rotate(90deg);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.value {
|
|
156
|
+
width: 20px;
|
|
157
|
+
text-align: center;
|
|
158
|
+
font-size: 18px;
|
|
159
|
+
line-height: 22px;
|
|
160
|
+
color: #979290;
|
|
161
|
+
user-select: none;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
</style>
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<InputContainer v-bind="{ layout }">
|
|
3
|
+
<InputTitle v-bind="{ title, tooltip, size, disabled }" v-if="title" />
|
|
4
|
+
|
|
5
|
+
<div class="input-wrapper" :class="{ error: errorMessage }">
|
|
6
|
+
<input
|
|
7
|
+
:class="[`size-${size}`]"
|
|
8
|
+
ref="inputEl"
|
|
9
|
+
:id="id"
|
|
10
|
+
v-maska
|
|
11
|
+
data-maska="#########"
|
|
12
|
+
:placeholder="placeholder && placeholder"
|
|
13
|
+
:disabled="disabled"
|
|
14
|
+
type="tel"
|
|
15
|
+
:value="value"
|
|
16
|
+
:autocomplete="autocomplete"
|
|
17
|
+
@input="
|
|
18
|
+
emit('update:modelValue', (<HTMLInputElement>$event.target).value)
|
|
19
|
+
"
|
|
20
|
+
/>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<InputError :error="errorMessage" v-if="errorMessage && errorDisplay" />
|
|
24
|
+
</InputContainer>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script lang="ts" setup>
|
|
28
|
+
import { useField } from "vee-validate";
|
|
29
|
+
import intlTelInput from "intl-tel-input";
|
|
30
|
+
import { ref, onMounted, InputHTMLAttributes } from "vue";
|
|
31
|
+
import { vMaska } from "maska";
|
|
32
|
+
import InputTitle from "./structure/InputTitle.vue";
|
|
33
|
+
import InputError from "./structure/InputError.vue";
|
|
34
|
+
import InputContainer from "./structure/InputContainer.vue";
|
|
35
|
+
|
|
36
|
+
const props = withDefaults(
|
|
37
|
+
defineProps<{
|
|
38
|
+
title?: string;
|
|
39
|
+
tooltip?: string;
|
|
40
|
+
placeholder?: InputHTMLAttributes["placeholder"];
|
|
41
|
+
layout?: "vertical" | "horizontal";
|
|
42
|
+
size?: "sm" | "md" | "lg";
|
|
43
|
+
error?: string;
|
|
44
|
+
validation?: any;
|
|
45
|
+
errorDisplay?: boolean;
|
|
46
|
+
modelValue: InputHTMLAttributes["value"];
|
|
47
|
+
id?: InputHTMLAttributes["id"];
|
|
48
|
+
disabled?: InputHTMLAttributes["disabled"];
|
|
49
|
+
phoneCountryCode?: number;
|
|
50
|
+
autocomplete?: InputHTMLAttributes["autocomplete"];
|
|
51
|
+
}>(),
|
|
52
|
+
{
|
|
53
|
+
layout: "vertical",
|
|
54
|
+
size: "md",
|
|
55
|
+
errorDisplay: true,
|
|
56
|
+
phoneCountryCode: 351,
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
const inputEl = ref();
|
|
61
|
+
|
|
62
|
+
const { value, errorMessage, meta, validate } = useField(
|
|
63
|
+
"input",
|
|
64
|
+
props.validation,
|
|
65
|
+
{ initialValue: props.modelValue }
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
defineExpose({ errorMessage, meta, validate });
|
|
69
|
+
|
|
70
|
+
const emit = defineEmits(["update:modelValue", "update:phoneCountryCode"]);
|
|
71
|
+
|
|
72
|
+
onMounted(() => {
|
|
73
|
+
inputEl.value.addEventListener("countrychange", () =>
|
|
74
|
+
emit(
|
|
75
|
+
"update:phoneCountryCode",
|
|
76
|
+
//@ts-ignore
|
|
77
|
+
window.intlTelInputGlobals
|
|
78
|
+
.getInstance(inputEl.value)
|
|
79
|
+
.getSelectedCountryData().dialCode
|
|
80
|
+
)
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
intlTelInput(inputEl.value, {
|
|
84
|
+
initialCountry: props.phoneCountryCode
|
|
85
|
+
? //@ts-ignore
|
|
86
|
+
window.intlTelInputGlobals
|
|
87
|
+
.getCountryData()
|
|
88
|
+
.find((c) => Number(c.dialCode) == props.phoneCountryCode)?.iso2
|
|
89
|
+
: "pt",
|
|
90
|
+
preferredCountries: ["pt"],
|
|
91
|
+
separateDialCode: true,
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
</script>
|
|
95
|
+
|
|
96
|
+
<style lang="scss" scoped>
|
|
97
|
+
@import "../../assets/forms.scss";
|
|
98
|
+
|
|
99
|
+
.input-wrapper {
|
|
100
|
+
input {
|
|
101
|
+
@include input-template;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&.error {
|
|
105
|
+
input {
|
|
106
|
+
@include input-error;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
:deep(.iti) {
|
|
111
|
+
display: block;
|
|
112
|
+
|
|
113
|
+
.iti__flag {
|
|
114
|
+
background-image: url($assets_url + "images/general/flags.png") !important;
|
|
115
|
+
|
|
116
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
117
|
+
background-image: url($assets_url + "images/general/flags@2x.png") !important;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
</style>
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="input-container">
|
|
3
|
+
<div class="input-container-radio">
|
|
4
|
+
<label>
|
|
5
|
+
<input
|
|
6
|
+
type="radio"
|
|
7
|
+
:name="name"
|
|
8
|
+
:checked="modelValue == value"
|
|
9
|
+
@change="handleChange"
|
|
10
|
+
/>
|
|
11
|
+
<div class="radio-icon"></div>
|
|
12
|
+
<div
|
|
13
|
+
class="text-container"
|
|
14
|
+
:class="[`size-${size}`]"
|
|
15
|
+
v-html="label"
|
|
16
|
+
></div>
|
|
17
|
+
</label>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<InputError :error="error" v-if="error && errorDisplay" />
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script lang="ts" setup>
|
|
25
|
+
import InputError from "./structure/InputError.vue";
|
|
26
|
+
|
|
27
|
+
const props = withDefaults(
|
|
28
|
+
defineProps<{
|
|
29
|
+
name: string;
|
|
30
|
+
value: any;
|
|
31
|
+
label: string;
|
|
32
|
+
modelValue?: any;
|
|
33
|
+
size?: "sm" | "md" | "lg";
|
|
34
|
+
error?: string;
|
|
35
|
+
errorDisplay?: boolean;
|
|
36
|
+
}>(),
|
|
37
|
+
{
|
|
38
|
+
errorDisplay: true,
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const handleChange = (event: any) => {
|
|
43
|
+
if (event.target.checked) {
|
|
44
|
+
emit("update:modelValue", props.value);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<style lang="scss" scoped>
|
|
52
|
+
@import "../../assets/forms.scss";
|
|
53
|
+
|
|
54
|
+
.input-container-radio {
|
|
55
|
+
label {
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-direction: row;
|
|
58
|
+
align-items: center;
|
|
59
|
+
flex-wrap: nowrap;
|
|
60
|
+
gap: 15px;
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
margin: 0;
|
|
63
|
+
font-weight: 400;
|
|
64
|
+
|
|
65
|
+
input {
|
|
66
|
+
display: none;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.radio-icon {
|
|
70
|
+
width: 20px;
|
|
71
|
+
height: 20px;
|
|
72
|
+
flex-shrink: 0;
|
|
73
|
+
border: 1px solid #64748b;
|
|
74
|
+
border-radius: 50%;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
input:checked + .radio-icon {
|
|
78
|
+
border: 6px solid #076b9c;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.text-container {
|
|
82
|
+
@include input-title;
|
|
83
|
+
|
|
84
|
+
user-select: none;
|
|
85
|
+
|
|
86
|
+
a {
|
|
87
|
+
color: inherit;
|
|
88
|
+
font-weight: 700;
|
|
89
|
+
text-decoration: underline;
|
|
90
|
+
|
|
91
|
+
&:hover {
|
|
92
|
+
text-decoration: none;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
</style>
|