@citizenplane/pimp 8.26.1 → 8.28.1
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/{IconAccompaniedMinorEach-CUq3oXbX.js → IconAccompaniedMinorEach-MkIJAypb.js} +1 -1
- package/dist/{IconAccompaniedMinorNone-nZ4eSfTj.js → IconAccompaniedMinorNone-DMb-bSCG.js} +1 -1
- package/dist/{IconAccompaniedMinorOne-CDMqq14b.js → IconAccompaniedMinorOne-C9ORHm66.js} +1 -1
- package/dist/{IconAddReceipt-DRpGiWBU.js → IconAddReceipt-CeJlKuX2.js} +1 -1
- package/dist/{IconAirportTerminal-8k-3lKjb.js → IconAirportTerminal-D3p4CRpN.js} +1 -1
- package/dist/{IconArrival-m6HnOVje.js → IconArrival-C3oPAqgQ.js} +1 -1
- package/dist/IconBaggageCabinNone-valcCKfd.js +22 -0
- package/dist/IconBaggageCheckedNone-oq4yx5cO.js +22 -0
- package/dist/IconBaggagePersonalNone-BovIoK0M.js +20 -0
- package/dist/{IconBroadcast-B13UworG.js → IconBroadcast-CqdgVQaO.js} +1 -1
- package/dist/{IconCabinBag-CNnzHz2B.js → IconCabinBag-CMrtn-s6.js} +1 -1
- package/dist/IconCalendar-DmUZ-Du1.js +30 -0
- package/dist/IconCalendarDelay-DHaiharm.js +22 -0
- package/dist/{IconCheckedBaggage-CkxUDHe9.js → IconCheckedBaggage-OeOjHxe7.js} +1 -1
- package/dist/{IconCheckedBaggage20-DEtphLSa.js → IconCheckedBaggage20-CXeWuJgc.js} +1 -1
- package/dist/{IconCheckedBaggage30-CmAddx5h.js → IconCheckedBaggage30-Cartaaei.js} +1 -1
- package/dist/{IconChild-OReHyUco.js → IconChild-ChjkS7Gd.js} +1 -1
- package/dist/{IconContact-D2N23RZ5.js → IconContact-CtOxYQIs.js} +1 -1
- package/dist/{IconDeparture-D10LaXRX.js → IconDeparture-DJxClL94.js} +1 -1
- package/dist/{IconDistribution-SpPiru9I.js → IconDistribution-BmCLzb9p.js} +1 -1
- package/dist/{IconDistributionClosed-Bzqe7nju.js → IconDistributionClosed-BMjqoyt9.js} +1 -1
- package/dist/{IconDistributionExclusivePair-CjPM-_R1.js → IconDistributionExclusivePair-D71kgwyk.js} +1 -1
- package/dist/{IconDistributionSided-DehjCN0D.js → IconDistributionSided-Du56cPXR.js} +1 -1
- package/dist/{IconDistributionSupplySided-DWCyXqd1.js → IconDistributionSupplySided-BY9ACIGQ.js} +1 -1
- package/dist/{IconDynamicContent-BvzbgXvW.js → IconDynamicContent-DoYbB86x.js} +1 -1
- package/dist/IconEndDate-CVABdl-P.js +22 -0
- package/dist/{IconFares-zARDpPNl.js → IconFares-BXnx8WJa.js} +1 -1
- package/dist/{IconFaresOutlined-DLFV8nwg.js → IconFaresOutlined-CjJhZUKX.js} +1 -1
- package/dist/{IconFemale-Ba4uoI-S.js → IconFemale-D4lMoNKt.js} +1 -1
- package/dist/{IconFindConversation-d0pP3wG9.js → IconFindConversation-CYdB5hW8.js} +1 -1
- package/dist/{IconFire-CXzWKoMB.js → IconFire-Bh3vQ1A3.js} +1 -1
- package/dist/{IconFlight-Cof8M5dO.js → IconFlight-RyDIRwoI.js} +1 -1
- package/dist/{IconFlightReturn-CA9iGMcW.js → IconFlightReturn-DN7K5zxX.js} +1 -1
- package/dist/IconFlightSchedule-DAX_cnvF.js +28 -0
- package/dist/{IconHandHeart-CCLKnMOm.js → IconHandHeart-C5jxr29k.js} +1 -1
- package/dist/{IconHistory-DI6WD_3J.js → IconHistory-CuJwcjfY.js} +1 -1
- package/dist/{IconHourGlass-BorNLEca.js → IconHourGlass-DyrZPbXz.js} +1 -1
- package/dist/{IconIdCard-DhbhBkul.js → IconIdCard-lBDLYRPq.js} +1 -1
- package/dist/{IconInfant-D4EztT9g.js → IconInfant-E19ozPuk.js} +1 -1
- package/dist/{IconItinerary-Bhj_lgG2.js → IconItinerary-5AEG0f9f.js} +1 -1
- package/dist/{IconLeave-BvpY7gdD.js → IconLeave-XuFJRd-0.js} +1 -1
- package/dist/{IconMale-RMd_9ZSg.js → IconMale-R2ZgQj0s.js} +1 -1
- package/dist/{IconMultiSegments-DROUj0t5.js → IconMultiSegments-DfiqdUEm.js} +1 -1
- package/dist/IconNoPassport-h-6DjTcc.js +22 -0
- package/dist/{IconNoRefund-yNAZr7uX.js → IconNoRefund-C5R_Zxke.js} +1 -1
- package/dist/IconNoSeat-C-XnWQk8.js +23 -0
- package/dist/{IconNotion-CpZhGILz.js → IconNotion-pdx45QBU.js} +1 -1
- package/dist/{IconOffline-Bf1mw_1N.js → IconOffline-EG6mJ-Fs.js} +1 -1
- package/dist/{IconOneWay-6oGoLo57.js → IconOneWay-CX6CckSB.js} +2 -2
- package/dist/{IconPaid-B3dvioAR.js → IconPaid-BJhBGPy9.js} +1 -1
- package/dist/IconPassport-C6THdLYf.js +37 -0
- package/dist/{IconPayout-b3TcXwjA.js → IconPayout-MS-qRRR0.js} +1 -1
- package/dist/IconPlug-yYpQdJgj.js +22 -0
- package/dist/IconPlugOff-DSGcBog-.js +23 -0
- package/dist/{IconReceipt-Dh454941.js → IconReceipt-ChU6nBry.js} +1 -1
- package/dist/IconRecurrence-DtwCmoXo.js +22 -0
- package/dist/{IconRefund-D-FNjukU.js → IconRefund-D1wQXsZj.js} +1 -1
- package/dist/{IconRoundTrip-BqVPrNwg.js → IconRoundTrip-DhPU15r6.js} +1 -1
- package/dist/{IconRouteNoStop-CZ_QeOIY.js → IconRouteNoStop-C5b0NI9V.js} +1 -1
- package/dist/{IconRouteOneStop-DGpLAQmQ.js → IconRouteOneStop-CDL4AJoN.js} +1 -1
- package/dist/IconScheduleChange-CasvbB9p.js +22 -0
- package/dist/{IconSeatEmpty-BwyVwYQZ.js → IconSeatEmpty-CUDMQzqk.js} +1 -1
- package/dist/{IconSeatSold-B_SNoTs-.js → IconSeatSold-mwtkmlhT.js} +1 -1
- package/dist/{IconSeatTotal-DUEF7k6I.js → IconSeatTotal-BPegCOjA.js} +1 -1
- package/dist/IconStartDate-DoPJpEly.js +22 -0
- package/dist/{IconTemplate-D1ACYaHI.js → IconTemplate-CQH8r3U7.js} +1 -1
- package/dist/{IconTicket-5Z4b83BP.js → IconTicket-mONYGHBg.js} +1 -1
- package/dist/{IconTimer-DbcddAPo.js → IconTimer-BxR1ymxu.js} +1 -1
- package/dist/{IconTrafficControl-CEzhRpZt.js → IconTrafficControl-AcQHu-Dm.js} +1 -1
- package/dist/{index-DbgX3-2I.js → index-CjeXy6n3.js} +17600 -18506
- package/dist/pimp.es.js +1 -1
- package/dist/pimp.umd.js +23 -23
- package/dist/style.css +1 -1
- package/package.json +2 -1
- package/src/components/{core/BaseInputLabel.vue → BaseInputLabel.vue} +9 -15
- package/src/components/{core/BaseSelectClearButton.vue → BaseSelectClearButton.vue} +2 -2
- package/src/components/{atomic-elements/CpAirlineLogo.vue → CpAirlineLogo.vue} +9 -10
- package/src/components/{feedback-indicators/CpAlert.vue → CpAlert.vue} +16 -27
- package/src/components/{atomic-elements/CpBadge.vue → CpBadge.vue} +27 -44
- package/src/components/{buttons/CpButton.vue → CpButton.vue} +63 -104
- package/src/components/{date-pickers/CpCalendar.vue → CpCalendar.vue} +157 -156
- package/src/components/{toggles/CpCheckbox.vue → CpCheckbox.vue} +45 -54
- package/src/components/{date-pickers/CpDate.vue → CpDate.vue} +202 -212
- package/src/components/CpDatepicker.vue +203 -0
- package/src/components/{atomic-elements/CpDialog.vue → CpDialog.vue} +14 -9
- package/src/components/{typography/CpHeading.vue → CpHeading.vue} +11 -31
- package/src/components/{visual/CpIcon.vue → CpIcon.vue} +2 -1
- package/src/components/{inputs/CpInput.vue → CpInput.vue} +41 -58
- package/src/components/{feedback-indicators/CpLoader.vue → CpLoader.vue} +7 -8
- package/src/components/{selects/CpMultiselect.vue → CpMultiselect.vue} +60 -91
- package/src/components/{atomic-elements/CpPartnerBadge.vue → CpPartnerBadge.vue} +12 -20
- package/src/components/{toggles/CpRadio.vue → CpRadio.vue} +47 -58
- package/src/components/{selects/CpSelect.vue → CpSelect.vue} +74 -94
- package/src/components/{selects/CpSelectMenu.vue → CpSelectMenu.vue} +94 -96
- package/src/components/{toggles/CpSwitch.vue → CpSwitch.vue} +51 -67
- package/src/components/{lists-and-table/CpTable.vue → CpTable.vue} +159 -113
- package/src/components/{lists-and-table/CpTableEmptyState.vue → CpTableEmptyState.vue} +5 -8
- package/src/components/{inputs/CpTextarea.vue → CpTextarea.vue} +32 -52
- package/src/components/CpToaster.vue +377 -0
- package/src/components/{atomic-elements/CpTooltip.vue → CpTooltip.vue} +12 -11
- package/src/components/TransitionExpand.vue +70 -0
- package/src/components/icons/IconBaggageCabinNone.vue +24 -0
- package/src/components/icons/IconBaggageCheckedNone.vue +25 -0
- package/src/components/icons/IconBaggagePersonalNone.vue +33 -0
- package/src/components/icons/IconCalendar.vue +17 -0
- package/src/components/icons/IconCalendarDelay.vue +21 -0
- package/src/components/icons/IconEndDate.vue +19 -0
- package/src/components/icons/IconFlightSchedule.vue +23 -0
- package/src/components/icons/IconNoPassport.vue +23 -24
- package/src/components/icons/IconNoSeat.vue +18 -0
- package/src/components/icons/IconOneWay.vue +1 -1
- package/src/components/icons/IconPassport.vue +15 -22
- package/src/components/icons/IconPlug.vue +17 -0
- package/src/components/icons/IconPlugOff.vue +18 -0
- package/src/components/icons/IconRecurrence.vue +17 -8
- package/src/components/icons/IconScheduleChange.vue +17 -26
- package/src/components/icons/IconStartDate.vue +19 -0
- package/src/components/index.ts +43 -55
- package/src/constants/{src/CpCustomIcons.ts → CpCustomIcons.ts} +13 -2
- package/src/constants/CpTableConfig.ts +12 -0
- package/src/constants/Heading.ts +8 -0
- package/src/{utils/constants/src/Intent.js → constants/Intent.ts} +1 -1
- package/src/constants/PartnerTypes.ts +6 -0
- package/src/constants/Position.ts +10 -0
- package/src/constants/Sizes.ts +5 -0
- package/src/constants/colors/Colors.ts +10 -0
- package/src/constants/colors/ToggleColors.ts +6 -0
- package/src/constants/index.ts +10 -5
- package/src/directives/ClickOutside.ts +17 -0
- package/src/directives/{ResizeSelect.js → ResizeSelect.ts} +3 -3
- package/src/helpers/{dom.js → dom.ts} +13 -9
- package/src/helpers/{index.js → index.ts} +13 -3
- package/src/helpers/object.ts +9 -0
- package/src/helpers/string/src/camelize.ts +6 -0
- package/src/helpers/string/src/{decamelize.js → decamelize.ts} +1 -1
- package/src/libs/CoreDatepicker.vue +4 -4
- package/src/plugins/toaster.ts +71 -0
- package/src/stories/BaseInputLabel.stories.ts +2 -1
- package/src/stories/CpAirlineLogo.stories.ts +1 -1
- package/src/stories/CpAlert.stories.ts +2 -1
- package/src/stories/CpBadge.stories.ts +1 -1
- package/src/stories/CpButton.stories.ts +1 -1
- package/src/stories/CpCheckbox.stories.ts +4 -2
- package/src/stories/CpDate.stories.ts +4 -2
- package/src/stories/CpDatepicker.stories.ts +4 -2
- package/src/stories/CpDialog.stories.ts +3 -2
- package/src/stories/CpHeading.stories.ts +2 -1
- package/src/stories/CpIcon.stories.ts +3 -1
- package/src/stories/CpInput.stories.ts +4 -2
- package/src/stories/CpLoader.stories.ts +2 -1
- package/src/stories/CpMultiselect.stories.ts +3 -2
- package/src/stories/CpPartnerBadge.stories.ts +2 -2
- package/src/stories/CpRadio.stories.ts +4 -2
- package/src/stories/CpSelect.stories.ts +4 -2
- package/src/stories/CpSelectMenu.stories.ts +4 -2
- package/src/stories/CpSwitch.stories.ts +4 -2
- package/src/stories/CpTable.stories.ts +9 -2
- package/src/stories/CpTableEmptyState.stories.ts +2 -1
- package/src/stories/CpTextarea.stories.ts +4 -2
- package/src/stories/CpToaster.stories.ts +2 -1
- package/src/stories/CpTooltip.stories.ts +2 -1
- package/src/stories/TransitionExpand.stories.ts +4 -2
- package/src/types/luxon.d.ts +1 -0
- package/src/vendors/ff-polyfill.ts +38 -0
- package/vitest.workspace.js +1 -3
- package/dist/IconNoPassport-DBmaQH_g.js +0 -18
- package/dist/IconPassport-5SwUf6_R.js +0 -20
- package/dist/IconRecurrence-CXVkBJ3i.js +0 -24
- package/dist/IconScheduleChange-CEIGEhU4.js +0 -19
- package/src/components/date-pickers/CpDatepicker.vue +0 -229
- package/src/components/feedback-indicators/CpToaster.vue +0 -372
- package/src/components/helpers-utilities/TransitionExpand.vue +0 -72
- package/src/constants/src/CpTableConfig.ts +0 -14
- package/src/constants/src/Position.ts +0 -10
- package/src/constants/src/colors/Colors.ts +0 -10
- package/src/constants/src/colors/ToggleColors.ts +0 -6
- package/src/directives/ClickOutside.js +0 -13
- package/src/helpers/object.js +0 -9
- package/src/helpers/string/src/camelize.js +0 -6
- package/src/plugins/toaster.js +0 -61
- package/src/utils/constants/index.js +0 -3
- package/src/utils/constants/src/PartnerTypes.js +0 -6
- package/src/utils/constants/src/Sizes.js +0 -5
- package/src/vendors/ff-polyfill.js +0 -36
- /package/src/components/{atomic-elements/CpDialogWrapper.vue → CpDialogWrapper.vue} +0 -0
- /package/src/components/{logo/Pimp.vue → Pimp.vue} +0 -0
- /package/src/helpers/string/{index.js → index.ts} +0 -0
|
@@ -4,42 +4,24 @@
|
|
|
4
4
|
</component>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
|
-
<script>
|
|
8
|
-
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import { HeadingLevels } from '@/constants'
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
type HeadingSize = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
type: String,
|
|
16
|
-
default: headingLevels[0],
|
|
17
|
-
validator: (value) => {
|
|
18
|
-
return headingLevels.includes(value)
|
|
19
|
-
},
|
|
20
|
-
required: false,
|
|
21
|
-
},
|
|
22
|
-
size: {
|
|
23
|
-
type: Number,
|
|
24
|
-
default: sizes[4],
|
|
25
|
-
validator: (value) => {
|
|
26
|
-
return sizes.includes(value)
|
|
27
|
-
},
|
|
28
|
-
required: false,
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
data() {
|
|
32
|
-
return {
|
|
33
|
-
headingLevels,
|
|
34
|
-
}
|
|
35
|
-
},
|
|
12
|
+
interface Props {
|
|
13
|
+
headingLevel?: HeadingLevels
|
|
14
|
+
size?: HeadingSize
|
|
36
15
|
}
|
|
16
|
+
|
|
17
|
+
withDefaults(defineProps<Props>(), {
|
|
18
|
+
headingLevel: HeadingLevels.H1,
|
|
19
|
+
size: 500,
|
|
20
|
+
})
|
|
37
21
|
</script>
|
|
38
22
|
|
|
39
23
|
<style lang="scss">
|
|
40
24
|
.cpHeading {
|
|
41
|
-
color: colors.$neutral-dark;
|
|
42
|
-
|
|
43
25
|
&:first-letter {
|
|
44
26
|
text-transform: capitalize;
|
|
45
27
|
}
|
|
@@ -49,14 +31,12 @@ export default {
|
|
|
49
31
|
font-weight: 400;
|
|
50
32
|
line-height: fn.px-to-rem(16);
|
|
51
33
|
letter-spacing: fn.px-to-em(0.6);
|
|
52
|
-
color: colors.$neutral-dark-1;
|
|
53
34
|
}
|
|
54
35
|
|
|
55
36
|
&--200 {
|
|
56
37
|
font-size: fn.px-to-rem(12);
|
|
57
38
|
font-weight: 600;
|
|
58
39
|
line-height: fn.px-to-rem(16);
|
|
59
|
-
color: colors.$neutral-dark-1;
|
|
60
40
|
}
|
|
61
41
|
|
|
62
42
|
&--300 {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
{{ capitalizedLabel }} <span v-if="isRequired" class="u-asterisk">*</span>
|
|
5
5
|
<cp-tooltip v-if="tooltip" :content="tooltip">
|
|
6
6
|
<button type="button" class="cpInput__tooltip">
|
|
7
|
-
<cp-icon class="cpInput__tooltipIcon" type="
|
|
7
|
+
<cp-icon class="cpInput__tooltipIcon" type="tooltip" />
|
|
8
8
|
</button>
|
|
9
9
|
</cp-tooltip>
|
|
10
10
|
</base-input-label>
|
|
@@ -56,72 +56,55 @@
|
|
|
56
56
|
</div>
|
|
57
57
|
</template>
|
|
58
58
|
|
|
59
|
-
<script setup>
|
|
59
|
+
<script setup lang="ts">
|
|
60
60
|
import { ref, useAttrs, useSlots, computed, nextTick, onMounted, useId } from 'vue'
|
|
61
61
|
|
|
62
|
-
import BaseInputLabel from '@/components/
|
|
62
|
+
import BaseInputLabel from '@/components/BaseInputLabel.vue'
|
|
63
63
|
|
|
64
64
|
import { randomString, capitalizeFirstLetter } from '@/helpers'
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
errorMessage:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
hideInvalidityIcon: {
|
|
96
|
-
type: Boolean,
|
|
97
|
-
default: false,
|
|
98
|
-
},
|
|
99
|
-
removeBorder: {
|
|
100
|
-
type: Boolean,
|
|
101
|
-
default: false,
|
|
102
|
-
},
|
|
103
|
-
isLarge: {
|
|
104
|
-
type: Boolean,
|
|
105
|
-
default: false,
|
|
106
|
-
},
|
|
107
|
-
isSearch: {
|
|
108
|
-
type: Boolean,
|
|
109
|
-
default: false,
|
|
110
|
-
},
|
|
111
|
-
help: {
|
|
112
|
-
type: String,
|
|
113
|
-
default: '',
|
|
114
|
-
},
|
|
66
|
+
interface Props {
|
|
67
|
+
errorMessage?: string
|
|
68
|
+
help?: string
|
|
69
|
+
hideInvalidityIcon?: boolean
|
|
70
|
+
inputId?: string | null
|
|
71
|
+
isInvalid?: boolean
|
|
72
|
+
isLarge?: boolean
|
|
73
|
+
isSearch?: boolean
|
|
74
|
+
label?: string
|
|
75
|
+
mask?: string | Record<string, unknown> | null
|
|
76
|
+
modelValue?: string | number | boolean
|
|
77
|
+
removeBorder?: boolean
|
|
78
|
+
tooltip?: string
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
82
|
+
modelValue: '',
|
|
83
|
+
tooltip: '',
|
|
84
|
+
label: '',
|
|
85
|
+
inputId: null,
|
|
86
|
+
isInvalid: false,
|
|
87
|
+
errorMessage: '',
|
|
88
|
+
mask: null,
|
|
89
|
+
hideInvalidityIcon: false,
|
|
90
|
+
removeBorder: false,
|
|
91
|
+
isLarge: false,
|
|
92
|
+
isSearch: false,
|
|
93
|
+
help: '',
|
|
115
94
|
})
|
|
116
95
|
|
|
117
|
-
|
|
96
|
+
interface Emits {
|
|
97
|
+
(e: 'update:modelValue', value: string | number | boolean): void
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const emit = defineEmits<Emits>()
|
|
118
101
|
|
|
119
102
|
defineOptions({ inheritAttrs: false })
|
|
120
103
|
|
|
121
104
|
const attrs = useAttrs()
|
|
122
105
|
|
|
123
106
|
// class is a reserved word, we can't remove 'class' property from attrs
|
|
124
|
-
|
|
107
|
+
|
|
125
108
|
const { ['class']: value, id, ...restAttributes } = attrs
|
|
126
109
|
|
|
127
110
|
const inputIdentifier = ref(id || randomString())
|
|
@@ -135,7 +118,7 @@ const slots = useSlots()
|
|
|
135
118
|
|
|
136
119
|
const capitalizedLabel = computed(() => capitalizeFirstLetter(props.label))
|
|
137
120
|
|
|
138
|
-
const inputModel = defineModel({
|
|
121
|
+
const inputModel = defineModel<string | number | boolean>({
|
|
139
122
|
type: [String, Number, Boolean],
|
|
140
123
|
default: '',
|
|
141
124
|
set(newValue) {
|
|
@@ -181,11 +164,11 @@ const iconInvalidityClasses = computed(() => {
|
|
|
181
164
|
const DOMElement = computed(() => cpInputContainer.value.children.namedItem(inputIdentifier.value))
|
|
182
165
|
|
|
183
166
|
const displayErrorMessage = computed(() => isInputInvalid.value && props.errorMessage.length)
|
|
184
|
-
const isClearButtonVisible = computed(() => props.isSearch && inputModel.value.length)
|
|
167
|
+
const isClearButtonVisible = computed(() => props.isSearch && inputModel.value.toString().length)
|
|
185
168
|
|
|
186
169
|
const displayHelp = computed(() => props.help?.length && !displayErrorMessage.value)
|
|
187
170
|
|
|
188
|
-
const handleChange = (newValue) => {
|
|
171
|
+
const handleChange = (newValue: string | number | boolean) => {
|
|
189
172
|
emit('update:modelValue', newValue)
|
|
190
173
|
checkInputValidity()
|
|
191
174
|
}
|
|
@@ -203,7 +186,7 @@ const checkInputValidity = () => {
|
|
|
203
186
|
(DOMElement.value.validity && DOMElement.value.validity.valueMissing)
|
|
204
187
|
}
|
|
205
188
|
|
|
206
|
-
const checkAttribute = (attribute) => attrs[attribute] === '' || attrs[attribute] === true
|
|
189
|
+
const checkAttribute = (attribute: string) => attrs[attribute] === '' || attrs[attribute] === true
|
|
207
190
|
|
|
208
191
|
const clearInputValue = () => emit('update:modelValue', '')
|
|
209
192
|
|
|
@@ -33,13 +33,12 @@
|
|
|
33
33
|
</svg>
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
|
-
<script>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
color: {
|
|
40
|
-
type: String,
|
|
41
|
-
default: '#ff6700',
|
|
42
|
-
},
|
|
43
|
-
},
|
|
36
|
+
<script setup lang="ts">
|
|
37
|
+
interface Props {
|
|
38
|
+
color?: string
|
|
44
39
|
}
|
|
40
|
+
|
|
41
|
+
withDefaults(defineProps<Props>(), {
|
|
42
|
+
color: '#ff6700',
|
|
43
|
+
})
|
|
45
44
|
</script>
|
|
@@ -67,96 +67,61 @@
|
|
|
67
67
|
</div>
|
|
68
68
|
</template>
|
|
69
69
|
|
|
70
|
-
<script setup>
|
|
71
|
-
import { ref, computed, onMounted } from 'vue'
|
|
72
|
-
import AutoComplete from 'primevue/autocomplete'
|
|
73
|
-
|
|
70
|
+
<script setup lang="ts">
|
|
74
71
|
import { absolutePosition, getOuterWidth } from '@primeuix/utils/dom'
|
|
72
|
+
import AutoComplete from 'primevue/autocomplete'
|
|
73
|
+
import { ref, computed, onMounted } from 'vue'
|
|
75
74
|
|
|
76
|
-
import BaseInputLabel from '@/components/
|
|
77
|
-
import
|
|
78
|
-
import
|
|
75
|
+
import BaseInputLabel from '@/components/BaseInputLabel.vue'
|
|
76
|
+
import BaseSelectClearButton from '@/components/BaseSelectClearButton.vue'
|
|
77
|
+
import TransitionExpand from '@/components/TransitionExpand.vue'
|
|
79
78
|
|
|
80
79
|
import { isEmpty } from '@/helpers/object'
|
|
81
80
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
default: false,
|
|
117
|
-
},
|
|
118
|
-
disabled: {
|
|
119
|
-
type: Boolean,
|
|
120
|
-
required: false,
|
|
121
|
-
default: false,
|
|
122
|
-
},
|
|
123
|
-
multiple: {
|
|
124
|
-
type: Boolean,
|
|
125
|
-
required: false,
|
|
126
|
-
default: false,
|
|
127
|
-
},
|
|
128
|
-
options: {
|
|
129
|
-
type: Array,
|
|
130
|
-
required: false,
|
|
131
|
-
default: () => [],
|
|
132
|
-
},
|
|
133
|
-
optionLabel: {
|
|
134
|
-
type: String,
|
|
135
|
-
required: false,
|
|
136
|
-
default: 'name',
|
|
137
|
-
},
|
|
138
|
-
trackBy: {
|
|
139
|
-
type: String,
|
|
140
|
-
required: false,
|
|
141
|
-
default: 'id',
|
|
142
|
-
},
|
|
143
|
-
emptyMessage: {
|
|
144
|
-
type: String,
|
|
145
|
-
required: false,
|
|
146
|
-
default: 'No results found',
|
|
147
|
-
},
|
|
148
|
-
errorMessage: {
|
|
149
|
-
type: String,
|
|
150
|
-
required: false,
|
|
151
|
-
default: '',
|
|
152
|
-
},
|
|
153
|
-
modelValue: {
|
|
154
|
-
type: [Array, Object],
|
|
155
|
-
required: false,
|
|
156
|
-
},
|
|
81
|
+
interface Props {
|
|
82
|
+
disabled?: boolean
|
|
83
|
+
emptyMessage?: string
|
|
84
|
+
errorMessage?: string
|
|
85
|
+
isClearable?: boolean
|
|
86
|
+
isInvalid?: boolean
|
|
87
|
+
isLoading?: boolean
|
|
88
|
+
label?: string
|
|
89
|
+
modelValue?: Record<string, unknown>[] | Record<string, unknown> | null
|
|
90
|
+
multiple?: boolean
|
|
91
|
+
name?: string
|
|
92
|
+
optionLabel?: string
|
|
93
|
+
options?: unknown[]
|
|
94
|
+
placeholder?: string
|
|
95
|
+
required?: boolean
|
|
96
|
+
trackBy?: string
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
100
|
+
label: '',
|
|
101
|
+
required: false,
|
|
102
|
+
name: '',
|
|
103
|
+
placeholder: '',
|
|
104
|
+
isInvalid: false,
|
|
105
|
+
isClearable: false,
|
|
106
|
+
isLoading: false,
|
|
107
|
+
disabled: false,
|
|
108
|
+
multiple: false,
|
|
109
|
+
options: () => [],
|
|
110
|
+
optionLabel: 'name',
|
|
111
|
+
trackBy: 'id',
|
|
112
|
+
emptyMessage: 'No results found',
|
|
113
|
+
errorMessage: '',
|
|
114
|
+
modelValue: null,
|
|
157
115
|
})
|
|
158
116
|
|
|
159
|
-
|
|
117
|
+
interface Emits {
|
|
118
|
+
(e: 'search', query: string): void
|
|
119
|
+
(e: 'select', option: Record<string, unknown>): void
|
|
120
|
+
(e: 'clear'): void
|
|
121
|
+
(e: 'update:modelValue', value: Record<string, unknown> | Record<string, unknown>[] | null): void
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const emit = defineEmits<Emits>()
|
|
160
125
|
|
|
161
126
|
const selectModel = computed({
|
|
162
127
|
get() {
|
|
@@ -183,7 +148,7 @@ const passThroughConfig = {
|
|
|
183
148
|
loader: { class: 'cpMultiselect__hidden' },
|
|
184
149
|
}
|
|
185
150
|
|
|
186
|
-
const multiselect = ref(null)
|
|
151
|
+
const multiselect = ref<InstanceType<typeof AutoComplete> | null>(null)
|
|
187
152
|
|
|
188
153
|
const isDropdownOpen = computed(() => multiselect.value?.overlayVisible)
|
|
189
154
|
|
|
@@ -203,29 +168,33 @@ const displayClearButton = computed(() => {
|
|
|
203
168
|
return props.isClearable && !isEmpty(selectModel.value)
|
|
204
169
|
})
|
|
205
170
|
|
|
206
|
-
const handleSearch = (event) => emit('search', event.query)
|
|
171
|
+
const handleSearch = (event: { query: string }) => emit('search', event.query)
|
|
207
172
|
const handleClear = () => (selectModel.value = null)
|
|
208
173
|
|
|
209
174
|
const toggleDropdown = () => {
|
|
210
175
|
if (isDropdownOpen.value) {
|
|
211
|
-
multiselect.value
|
|
176
|
+
multiselect.value?.hide()
|
|
212
177
|
} else {
|
|
213
|
-
multiselect.value
|
|
178
|
+
multiselect.value?.show()
|
|
214
179
|
}
|
|
215
180
|
}
|
|
216
181
|
|
|
217
|
-
const handleUpdateModelValue = (value) => {
|
|
182
|
+
const handleUpdateModelValue = (value: Record<string, unknown> | null) => {
|
|
218
183
|
// Autocomplete will set the model value to the query string if not blocked
|
|
219
184
|
if (!value || typeof value === 'string') {
|
|
220
185
|
return
|
|
221
186
|
}
|
|
222
187
|
}
|
|
223
188
|
|
|
224
|
-
const overrideAlignOverlay = () =>
|
|
189
|
+
const overrideAlignOverlay = () => {
|
|
190
|
+
if (multiselect.value) {
|
|
191
|
+
multiselect.value.alignOverlay = alignOverlay
|
|
192
|
+
}
|
|
193
|
+
}
|
|
225
194
|
|
|
226
195
|
const alignOverlay = () => {
|
|
227
|
-
const target = multiselect.value
|
|
228
|
-
if (!multiselect.value
|
|
196
|
+
const target = multiselect.value?.$el
|
|
197
|
+
if (!multiselect.value?.overlay || !target) return
|
|
229
198
|
|
|
230
199
|
multiselect.value.overlay.style.width = `${getOuterWidth(target)}px`
|
|
231
200
|
|
|
@@ -6,32 +6,24 @@
|
|
|
6
6
|
</div>
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
|
-
<script setup>
|
|
9
|
+
<script setup lang="ts">
|
|
10
10
|
import { computed } from 'vue'
|
|
11
11
|
|
|
12
|
-
import { PartnerTypes, Sizes } from '@/utils/constants'
|
|
13
|
-
|
|
14
|
-
import IconOta from '@/components/icons/IconOta.vue'
|
|
15
12
|
import IconAirline from '@/components/icons/IconAirline.vue'
|
|
13
|
+
import IconOta from '@/components/icons/IconOta.vue'
|
|
16
14
|
import IconSupplier from '@/components/icons/IconSupplier.vue'
|
|
17
15
|
import IconThirdParty from '@/components/icons/IconThirdParty.vue'
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
type:
|
|
29
|
-
type: String,
|
|
30
|
-
required: true,
|
|
31
|
-
validator(value) {
|
|
32
|
-
return Object.values(PartnerTypes).includes(value)
|
|
33
|
-
},
|
|
34
|
-
},
|
|
17
|
+
import { PartnerTypes, Sizes } from '@/constants'
|
|
18
|
+
|
|
19
|
+
interface Props {
|
|
20
|
+
size?: Sizes
|
|
21
|
+
type?: PartnerTypes
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
25
|
+
size: Sizes.MD,
|
|
26
|
+
type: PartnerTypes.THIRDPARTY,
|
|
35
27
|
})
|
|
36
28
|
|
|
37
29
|
const dynamicBadgeProps = computed(() => {
|
|
@@ -28,67 +28,56 @@
|
|
|
28
28
|
</div>
|
|
29
29
|
</template>
|
|
30
30
|
|
|
31
|
-
<script>
|
|
32
|
-
import {
|
|
31
|
+
<script setup lang="ts">
|
|
32
|
+
import { ref } from 'vue'
|
|
33
|
+
|
|
33
34
|
import { ToggleColors } from '@/constants'
|
|
35
|
+
import { capitalizeFirstLetter, randomString } from '@/helpers'
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
getRadioId(index) {
|
|
77
|
-
return `${this.radioUniqueId}${index}`
|
|
78
|
-
},
|
|
79
|
-
isActive(value) {
|
|
80
|
-
return value === this.modelValue
|
|
81
|
-
},
|
|
82
|
-
computedClasses({ value, disabled }) {
|
|
83
|
-
return [
|
|
84
|
-
{
|
|
85
|
-
'cpRadio--isActive': this.isActive(value),
|
|
86
|
-
'cpRadio--isDisabled': disabled,
|
|
87
|
-
},
|
|
88
|
-
`cpRadio--is${capitalizeFirstLetter(this.color)}`,
|
|
89
|
-
]
|
|
37
|
+
interface RadioOption {
|
|
38
|
+
additionalData?: string
|
|
39
|
+
description?: string
|
|
40
|
+
disabled?: boolean
|
|
41
|
+
label: string
|
|
42
|
+
value: string
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface Props {
|
|
46
|
+
autofocus?: boolean
|
|
47
|
+
color?: string
|
|
48
|
+
groupName?: string
|
|
49
|
+
modelValue: string
|
|
50
|
+
options: RadioOption[]
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
interface Emits {
|
|
54
|
+
(e: 'update:modelValue', value: string): void
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
58
|
+
groupName: '',
|
|
59
|
+
color: ToggleColors.BLUE,
|
|
60
|
+
autofocus: false,
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
const emit = defineEmits<Emits>()
|
|
64
|
+
|
|
65
|
+
const radioUniqueId = ref(randomString())
|
|
66
|
+
|
|
67
|
+
const onChange = (value: string): void => emit('update:modelValue', value)
|
|
68
|
+
|
|
69
|
+
const getRadioId = (index: number): string => `${radioUniqueId.value}${index}`
|
|
70
|
+
|
|
71
|
+
const isActive = (value: string): boolean => value === props.modelValue
|
|
72
|
+
|
|
73
|
+
const computedClasses = ({ value, disabled }: { disabled?: boolean; value: string }) => {
|
|
74
|
+
return [
|
|
75
|
+
{
|
|
76
|
+
'cpRadio--isActive': isActive(value),
|
|
77
|
+
'cpRadio--isDisabled': disabled,
|
|
90
78
|
},
|
|
91
|
-
|
|
79
|
+
`cpRadio--is${capitalizeFirstLetter(props.color)}`,
|
|
80
|
+
]
|
|
92
81
|
}
|
|
93
82
|
</script>
|
|
94
83
|
|