@citizenplane/pimp 8.26.0 → 8.27.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/dist/{IconAccompaniedMinorEach-DDeSlaA_.js → IconAccompaniedMinorEach-BJYaPpW3.js} +1 -1
- package/dist/{IconAccompaniedMinorNone-BKs1gk1K.js → IconAccompaniedMinorNone-D1JR2Qpd.js} +1 -1
- package/dist/{IconAccompaniedMinorOne-CpL8FNve.js → IconAccompaniedMinorOne-BJ3jzEDZ.js} +1 -1
- package/dist/{IconAddReceipt-DLH3pqjA.js → IconAddReceipt-BX_va94f.js} +1 -1
- package/dist/{IconAirportTerminal-Cc4CU6MC.js → IconAirportTerminal-Dzr98nfc.js} +1 -1
- package/dist/{IconArrival-CdtUsRVo.js → IconArrival-Ced9HrJH.js} +1 -1
- package/dist/{IconBroadcast-QjMZtFA9.js → IconBroadcast-BYX44Wak.js} +1 -1
- package/dist/{IconCabinBag-xVC6mOQF.js → IconCabinBag-D1Qs952U.js} +1 -1
- package/dist/{IconCheckedBaggage-I_1h49TJ.js → IconCheckedBaggage-Q4_SQL9l.js} +1 -1
- package/dist/{IconCheckedBaggage20-CyPcsqrn.js → IconCheckedBaggage20-DVH1-A0V.js} +1 -1
- package/dist/{IconCheckedBaggage30-s5htbUIA.js → IconCheckedBaggage30-DYOAf-7Z.js} +1 -1
- package/dist/{IconChild-DL43kbm1.js → IconChild-BeCLAr8Y.js} +1 -1
- package/dist/{IconContact-FdhTr03q.js → IconContact-B3r39fyI.js} +1 -1
- package/dist/{IconDeparture-DNR3OGPD.js → IconDeparture-BflKZUiE.js} +1 -1
- package/dist/{IconDistribution-Cl8L6177.js → IconDistribution-CBxQ7UWb.js} +1 -1
- package/dist/{IconDistributionClosed-DBT6wR78.js → IconDistributionClosed-BWp_k24K.js} +1 -1
- package/dist/{IconDistributionExclusivePair-CkRG6yNV.js → IconDistributionExclusivePair-erLbcLps.js} +1 -1
- package/dist/{IconDistributionSided-D_wdvDNf.js → IconDistributionSided-y000n4qB.js} +1 -1
- package/dist/{IconDistributionSupplySided-C3VcE8Dw.js → IconDistributionSupplySided-7kCvGwnz.js} +1 -1
- package/dist/{IconDynamicContent-Ct1HRd3s.js → IconDynamicContent-SwBxkPMB.js} +1 -1
- package/dist/{IconFares-dIGVrtE4.js → IconFares-DTm0Q_RI.js} +1 -1
- package/dist/{IconFaresOutlined-bd8kT44f.js → IconFaresOutlined-BFMo_x9Q.js} +1 -1
- package/dist/{IconFemale-CMeYHrDy.js → IconFemale-Ma0KeaEM.js} +1 -1
- package/dist/{IconFindConversation-BdN2Yd3R.js → IconFindConversation-CpsDYPgD.js} +1 -1
- package/dist/{IconFire-obwuluyJ.js → IconFire-DECrDnLM.js} +1 -1
- package/dist/{IconFlight-B_6tJxB3.js → IconFlight-D5M0A0CM.js} +1 -1
- package/dist/{IconFlightReturn-BEO97PwR.js → IconFlightReturn-CTvqEFME.js} +1 -1
- package/dist/{IconHandHeart-hs0yFSEL.js → IconHandHeart-ChgdfXQa.js} +1 -1
- package/dist/{IconHistory-CT-jOMRt.js → IconHistory-DpIXDYI5.js} +1 -1
- package/dist/{IconHourGlass-CF940vmy.js → IconHourGlass-CIRkFUSM.js} +1 -1
- package/dist/{IconIdCard-DKkU58Ix.js → IconIdCard-UD5VZsUi.js} +1 -1
- package/dist/{IconInfant-DIUT-6_4.js → IconInfant-CmLUvWpO.js} +1 -1
- package/dist/{IconItinerary-D7mOGUmj.js → IconItinerary-CY8irele.js} +1 -1
- package/dist/{IconLeave-BExl4uyV.js → IconLeave-C3bpPz6L.js} +1 -1
- package/dist/{IconMale-eHGH5XBz.js → IconMale-x4xdulWB.js} +1 -1
- package/dist/{IconMultiSegments-KkrKiZrK.js → IconMultiSegments-BhTMfvhQ.js} +1 -1
- package/dist/{IconNoPassport-PJ2QqqoI.js → IconNoPassport-_Xm76k6b.js} +1 -1
- package/dist/{IconNoRefund-W47AQisu.js → IconNoRefund-B78s0oyF.js} +1 -1
- package/dist/{IconNotion-CCnhatKK.js → IconNotion-C22PTLTU.js} +1 -1
- package/dist/{IconOffline-3wunTEJG.js → IconOffline-BDzikWE9.js} +1 -1
- package/dist/{IconOneWay-BQ5K41Bu.js → IconOneWay-DlTVxokv.js} +2 -2
- package/dist/{IconPaid-zwDwWzF8.js → IconPaid-DmGERe85.js} +1 -1
- package/dist/{IconPassport-IxhNLS8P.js → IconPassport-6VOlXjxJ.js} +1 -1
- package/dist/{IconPayout-BNSON3dj.js → IconPayout-abr6BXCd.js} +1 -1
- package/dist/{IconReceipt-DOosYtgi.js → IconReceipt-BnTaihcq.js} +1 -1
- package/dist/{IconRecurrence-B8i5kO2Q.js → IconRecurrence-C5TPG2ht.js} +1 -1
- package/dist/{IconRefund-DkjF9lEI.js → IconRefund-Ysv8pyMJ.js} +1 -1
- package/dist/{IconRoundTrip-BZvhS65z.js → IconRoundTrip-CIVDw8LK.js} +1 -1
- package/dist/{IconRouteNoStop-CeSlfnpx.js → IconRouteNoStop-DQrq4gW5.js} +1 -1
- package/dist/{IconRouteOneStop-aP1Mj-Bv.js → IconRouteOneStop-pzisj4i4.js} +1 -1
- package/dist/{IconScheduleChange-QQ4AMAMI.js → IconScheduleChange-BONs1AAT.js} +1 -1
- package/dist/{IconSeatEmpty-DgVBD165.js → IconSeatEmpty-CHij3aGA.js} +1 -1
- package/dist/{IconSeatSold-BGBwNZUa.js → IconSeatSold-QspS_zCh.js} +1 -1
- package/dist/{IconSeatTotal-Dq9uXccZ.js → IconSeatTotal-DTZ1TcAX.js} +1 -1
- package/dist/{IconTemplate-BgruEhjI.js → IconTemplate-BDmmr-9L.js} +1 -1
- package/dist/{IconTicket-BTaYnuPt.js → IconTicket--vVn61Ey.js} +1 -1
- package/dist/{IconTimer-CyJzne5T.js → IconTimer-CspKpwqZ.js} +1 -1
- package/dist/{IconTrafficControl-BeQtpwhK.js → IconTrafficControl-DBamcJNe.js} +1 -1
- package/dist/{index-B8RNa4cx.js → index-C3oHnZQk.js} +9152 -10064
- package/dist/pimp.es.js +1 -1
- package/dist/pimp.umd.js +17 -17
- package/dist/style.css +1 -1
- package/package.json +2 -1
- package/src/components/atomic-elements/CpAirlineLogo.vue +9 -10
- package/src/components/atomic-elements/CpBadge.vue +33 -41
- package/src/components/atomic-elements/CpDialog.vue +14 -9
- package/src/components/atomic-elements/CpPartnerBadge.vue +12 -20
- package/src/components/atomic-elements/CpTooltip.vue +12 -11
- package/src/components/buttons/CpButton.vue +63 -104
- package/src/components/core/BaseInputLabel.vue +9 -15
- package/src/components/core/BaseSelectClearButton.vue +1 -1
- package/src/components/date-pickers/CpCalendar.vue +154 -153
- package/src/components/date-pickers/CpDate.vue +202 -212
- package/src/components/date-pickers/CpDatepicker.vue +112 -138
- package/src/components/feedback-indicators/CpAlert.vue +16 -27
- package/src/components/feedback-indicators/CpLoader.vue +7 -8
- package/src/components/feedback-indicators/CpToaster.vue +197 -192
- package/src/components/helpers-utilities/TransitionExpand.vue +31 -33
- package/src/components/icons/IconOneWay.vue +1 -1
- package/src/components/index.ts +28 -40
- package/src/components/inputs/CpInput.vue +40 -57
- package/src/components/inputs/CpTextarea.vue +30 -50
- package/src/components/lists-and-table/CpTable.vue +165 -114
- package/src/components/lists-and-table/CpTableEmptyState.vue +5 -8
- package/src/components/selects/CpMultiselect.vue +58 -89
- package/src/components/selects/CpSelect.vue +70 -90
- package/src/components/selects/CpSelectMenu.vue +94 -96
- package/src/components/toggles/CpCheckbox.vue +45 -54
- package/src/components/toggles/CpRadio.vue +47 -58
- package/src/components/toggles/CpSwitch.vue +51 -67
- package/src/components/typography/CpHeading.vue +11 -31
- package/src/components/visual/CpIcon.vue +2 -1
- package/src/constants/{src/CpCustomIcons.ts → CpCustomIcons.ts} +1 -1
- 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 +1 -0
- package/src/stories/CpAlert.stories.ts +1 -0
- package/src/stories/CpBadge.stories.ts +18 -0
- package/src/stories/CpCheckbox.stories.ts +3 -1
- package/src/stories/CpDate.stories.ts +3 -1
- package/src/stories/CpDatepicker.stories.ts +3 -1
- package/src/stories/CpDialog.stories.ts +2 -1
- package/src/stories/CpHeading.stories.ts +1 -0
- package/src/stories/CpIcon.stories.ts +2 -0
- package/src/stories/CpInput.stories.ts +3 -1
- package/src/stories/CpLoader.stories.ts +1 -0
- package/src/stories/CpMultiselect.stories.ts +2 -1
- package/src/stories/CpPartnerBadge.stories.ts +1 -1
- package/src/stories/CpRadio.stories.ts +3 -1
- package/src/stories/CpSelect.stories.ts +3 -1
- package/src/stories/CpSelectMenu.stories.ts +3 -1
- package/src/stories/CpSwitch.stories.ts +3 -1
- package/src/stories/CpTable.stories.ts +8 -1
- package/src/stories/CpTableEmptyState.stories.ts +1 -0
- package/src/stories/CpTextarea.stories.ts +3 -1
- package/src/stories/CpToaster.stories.ts +1 -0
- package/src/stories/CpTooltip.stories.ts +1 -0
- package/src/stories/TransitionExpand.stories.ts +3 -1
- package/src/types/luxon.d.ts +1 -0
- package/src/vendors/ff-polyfill.ts +38 -0
- package/vitest.workspace.js +1 -3
- 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/helpers/string/{index.js → index.ts} +0 -0
|
@@ -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
62
|
import BaseInputLabel from '@/components/core/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
|
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
</div>
|
|
28
28
|
</template>
|
|
29
29
|
|
|
30
|
-
<script setup>
|
|
30
|
+
<script setup lang="ts">
|
|
31
31
|
import { ref, computed } from 'vue'
|
|
32
32
|
|
|
33
33
|
import BaseInputLabel from '@/components/core/BaseInputLabel.vue'
|
|
@@ -35,57 +35,37 @@ import TransitionExpand from '@/components/helpers-utilities/TransitionExpand.vu
|
|
|
35
35
|
|
|
36
36
|
import { randomString, capitalizeFirstLetter } from '@/helpers'
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
label
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
required:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
type: String,
|
|
61
|
-
default: '',
|
|
62
|
-
required: false,
|
|
63
|
-
},
|
|
64
|
-
disabled: {
|
|
65
|
-
type: Boolean,
|
|
66
|
-
default: false,
|
|
67
|
-
required: false,
|
|
68
|
-
},
|
|
69
|
-
isInvalid: {
|
|
70
|
-
type: Boolean,
|
|
71
|
-
default: false,
|
|
72
|
-
required: false,
|
|
73
|
-
},
|
|
74
|
-
errorMessage: {
|
|
75
|
-
type: String,
|
|
76
|
-
default: '',
|
|
77
|
-
required: false,
|
|
78
|
-
},
|
|
79
|
-
height: {
|
|
80
|
-
type: Number,
|
|
81
|
-
default: 200,
|
|
82
|
-
required: false,
|
|
83
|
-
},
|
|
38
|
+
interface Props {
|
|
39
|
+
disabled?: boolean
|
|
40
|
+
errorMessage?: string
|
|
41
|
+
height?: number
|
|
42
|
+
inputId?: string
|
|
43
|
+
isInvalid?: boolean
|
|
44
|
+
label?: string
|
|
45
|
+
modelValue?: string
|
|
46
|
+
placeholder?: string
|
|
47
|
+
required?: boolean
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
51
|
+
modelValue: '',
|
|
52
|
+
label: '',
|
|
53
|
+
placeholder: '',
|
|
54
|
+
required: false,
|
|
55
|
+
inputId: '',
|
|
56
|
+
disabled: false,
|
|
57
|
+
isInvalid: false,
|
|
58
|
+
errorMessage: '',
|
|
59
|
+
height: 200,
|
|
84
60
|
})
|
|
85
61
|
|
|
86
|
-
|
|
62
|
+
interface Emits {
|
|
63
|
+
(e: 'update:modelValue', value: string): void
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const emit = defineEmits<Emits>()
|
|
87
67
|
|
|
88
|
-
const textareaModel = defineModel({
|
|
68
|
+
const textareaModel = defineModel<string>({
|
|
89
69
|
type: String,
|
|
90
70
|
default: '',
|
|
91
71
|
required: false,
|
|
@@ -101,7 +81,7 @@ const capitalizedLabel = computed(() => capitalizeFirstLetter(props.label))
|
|
|
101
81
|
|
|
102
82
|
const displayErrorMessage = computed(() => props.isInvalid && props.errorMessage.length)
|
|
103
83
|
|
|
104
|
-
const handleChange = (newValue) => emit('update:modelValue', newValue)
|
|
84
|
+
const handleChange = (newValue: string) => emit('update:modelValue', newValue)
|
|
105
85
|
</script>
|
|
106
86
|
|
|
107
87
|
<style lang="scss">
|