@citizenplane/pimp 18.19.2 → 18.19.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citizenplane/pimp",
3
- "version": "18.19.2",
3
+ "version": "18.19.4",
4
4
  "scripts": {
5
5
  "dev": "storybook dev -p 8081",
6
6
  "build-storybook": "storybook build --output-dir ./docs",
@@ -66,6 +66,7 @@ import CpTransitionExpand from '@/components/CpTransitionExpand.vue'
66
66
  import BaggagesVisual from '@/assets/images/ancillary-categories/baggages.png'
67
67
  import CarbonOffsetVisual from '@/assets/images/ancillary-categories/carbon-offset.png'
68
68
  import InsuranceVisual from '@/assets/images/ancillary-categories/insurance.png'
69
+ import NameChangeVisual from '@/assets/images/ancillary-categories/name-change.png'
69
70
  import PetsVisual from '@/assets/images/ancillary-categories/pets.png'
70
71
  import RestrictedVisual from '@/assets/images/ancillary-categories/restricted.png'
71
72
  import SportEquipmentsVisual from '@/assets/images/ancillary-categories/sport-equipments.png'
@@ -111,6 +112,7 @@ const categoryVisuals: Partial<Record<CpAncillaryCategoryTypes, string>> = {
111
112
  [CpAncillaryCategoryTypes.BAGGAGES]: BaggagesVisual,
112
113
  [CpAncillaryCategoryTypes.CARBON_OFFSET]: CarbonOffsetVisual,
113
114
  [CpAncillaryCategoryTypes.INSURANCE]: InsuranceVisual,
115
+ [CpAncillaryCategoryTypes.NAME_CHANGE]: NameChangeVisual,
114
116
  [CpAncillaryCategoryTypes.PETS]: PetsVisual,
115
117
  [CpAncillaryCategoryTypes.RESTRICTED]: RestrictedVisual,
116
118
  [CpAncillaryCategoryTypes.SPORT_EQUIPMENTS]: SportEquipmentsVisual,
@@ -16,6 +16,7 @@
16
16
  v-model="quantity"
17
17
  class="cpAncillaryItem__counter"
18
18
  :decrease-label="decreaseLabel"
19
+ :disable-animation="disableAnimation"
19
20
  :increase-label="increaseLabel"
20
21
  :max="maxQuantity"
21
22
  />
@@ -63,6 +64,7 @@ import { CpAncillaryItemTypes } from '@/constants/CpAncillaryItemTypes'
63
64
  interface Props {
64
65
  currency?: string
65
66
  description: string
67
+ disableAnimation?: boolean
66
68
  locale?: string
67
69
  maxQuantity?: number | null
68
70
  maxQuantityLabel?: string
@@ -10,6 +10,7 @@
10
10
  role="button"
11
11
  tabindex="0"
12
12
  :type="type"
13
+ @click="handleClick"
13
14
  >
14
15
  <span class="cpButton__body">
15
16
  <span v-if="isLoading" class="cpButton__loader">
@@ -57,6 +58,10 @@ const props = withDefaults(defineProps<Props>(), {
57
58
  size: 'md',
58
59
  })
59
60
 
61
+ const emit = defineEmits<{
62
+ click: [event: MouseEvent]
63
+ }>()
64
+
60
65
  const slots: Slots = useSlots()
61
66
 
62
67
  const capitalizedAppearance = computed(() => capitalizeFirstLetter(props.appearance))
@@ -73,6 +78,11 @@ const isButtonDisabled = computed(() => props.disabled || props.isLoading)
73
78
 
74
79
  const hrefValue = computed(() => (props.tag === 'a' ? props.href : undefined))
75
80
 
81
+ const handleClick = (event: MouseEvent): void => {
82
+ if (isButtonDisabled.value) return
83
+ emit('click', event)
84
+ }
85
+
76
86
  const dynamicClasses = computed(() => {
77
87
  return [
78
88
  `cpButton--is${capitalizedAppearance.value}`,
@@ -3,6 +3,7 @@ export enum CpAncillaryCategoryTypes {
3
3
  BAGGAGES = 'baggages',
4
4
  CARBON_OFFSET = 'carbonOffset',
5
5
  INSURANCE = 'insurance',
6
+ NAME_CHANGE = 'nameChange',
6
7
  ON_BOARD = 'onBoard',
7
8
  PETS = 'pets',
8
9
  RESTRICTED = 'restricted',