@citizenplane/pimp 8.30.0 → 8.32.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/.lintstagedrc.json +1 -1
- package/dist/pimp.es.js +21219 -2
- package/dist/pimp.umd.js +18 -18
- package/dist/style.css +1 -1
- package/package.json +7 -4
- package/src/components/BaseInputLabel.vue +4 -0
- package/src/components/CpBadge.vue +18 -11
- package/src/components/CpButton.vue +2 -17
- package/src/components/CpCheckbox.vue +1 -0
- package/src/components/CpDate.vue +7 -7
- package/src/components/CpDatepicker.vue +1 -0
- package/src/components/CpHeading.vue +4 -0
- package/src/components/CpInput.vue +5 -5
- package/src/components/CpMultiselect.vue +9 -16
- package/src/components/CpSelect.vue +4 -5
- package/src/components/CpSelectMenu.vue +1 -0
- package/src/components/CpTable.vue +8 -8
- package/src/components/CpTextarea.vue +4 -4
- package/src/constants/Button.ts +16 -0
- package/src/constants/CpCustomIcons.ts +154 -80
- package/src/constants/index.ts +2 -0
- package/src/libs/CoreDatepicker.vue +20 -12
- package/src/stories/CpBadge.stories.ts +12 -5
- package/src/stories/CpDate.stories.ts +1 -1
- package/src/stories/CpMultiselect.stories.ts +7 -5
- package/dist/IconAccompaniedMinorEach-Chvln7ks.js +0 -18
- package/dist/IconAccompaniedMinorNone-BlEBLGOE.js +0 -19
- package/dist/IconAccompaniedMinorOne-DIRpn5zm.js +0 -18
- package/dist/IconAddReceipt-DaXDrYon.js +0 -22
- package/dist/IconAirportTerminal-pU0mx9bq.js +0 -23
- package/dist/IconArrival-uqa1cUzO.js +0 -23
- package/dist/IconBaggageCabinNone-SnFrcMwI.js +0 -22
- package/dist/IconBaggageCheckedNone-4ZGeJX-T.js +0 -22
- package/dist/IconBaggagePersonalNone-JVlWXsIc.js +0 -20
- package/dist/IconBroadcast-B7gcYIky.js +0 -20
- package/dist/IconCabinBag-8gdUsqru.js +0 -20
- package/dist/IconCalendar-RehatmPo.js +0 -30
- package/dist/IconCalendarDelay-Du3a9TaA.js +0 -22
- package/dist/IconCheckedBaggage20-BaRTS3Dm.js +0 -20
- package/dist/IconCheckedBaggage30-DfnJcICl.js +0 -20
- package/dist/IconChild-BiRe6plt.js +0 -21
- package/dist/IconContact-B2q3Oix6.js +0 -20
- package/dist/IconDeparture-CqOsm1p3.js +0 -23
- package/dist/IconDistribution-BtAjLOH1.js +0 -20
- package/dist/IconDistributionClosed-DvKcmH9O.js +0 -20
- package/dist/IconDistributionExclusivePair-C0EBa4Yz.js +0 -18
- package/dist/IconDistributionSided-CoSkKfc5.js +0 -31
- package/dist/IconDistributionSupplySided-DsAhZSkC.js +0 -31
- package/dist/IconDynamicContent-DK6fNt00.js +0 -21
- package/dist/IconEndDate-Ct8mj0Ej.js +0 -22
- package/dist/IconFares-D3e_h14B.js +0 -18
- package/dist/IconFaresOutlined-BXDgpilA.js +0 -23
- package/dist/IconFemale-ctrm9N3Z.js +0 -33
- package/dist/IconFindConversation-uAMWFXlW.js +0 -24
- package/dist/IconFire-DZoDNAyw.js +0 -22
- package/dist/IconFlight-C7O_qHJA.js +0 -23
- package/dist/IconFlightReturn-BNjLtbO6.js +0 -18
- package/dist/IconFlightSchedule-WpBNLs2y.js +0 -28
- package/dist/IconHandHeart-C_E0cCXP.js +0 -21
- package/dist/IconHistory-BqwHTTWY.js +0 -19
- package/dist/IconHourGlass-DOwuG_3m.js +0 -31
- package/dist/IconIdCard-BNskK5uB.js +0 -22
- package/dist/IconInfant-BQYVIka1.js +0 -18
- package/dist/IconItinerary-BKUEvJ4N.js +0 -22
- package/dist/IconLeave-DUomSUyI.js +0 -22
- package/dist/IconMale-l4XJPya-.js +0 -21
- package/dist/IconMultiSegments-DyTODoLE.js +0 -18
- package/dist/IconNoPassport-hOO36EG3.js +0 -22
- package/dist/IconNoRefund-BAEjDfuQ.js +0 -18
- package/dist/IconNoSeat-hPRh86Qu.js +0 -23
- package/dist/IconNotion-BdbLBTUX.js +0 -18
- package/dist/IconOffline-Cuw_8YAe.js +0 -20
- package/dist/IconOneWay-B9BR28Bh.js +0 -17
- package/dist/IconPaid-ComZJkK7.js +0 -23
- package/dist/IconPassport-wqREy6VU.js +0 -37
- package/dist/IconPayout-BVbxGgeq.js +0 -20
- package/dist/IconPlug-DoqFsBC5.js +0 -22
- package/dist/IconPlugOff-D01qKq6o.js +0 -23
- package/dist/IconReceipt-C7nXDJWw.js +0 -25
- package/dist/IconRecurrence-C6Bcbzej.js +0 -22
- package/dist/IconRefund-C4AU90vx.js +0 -19
- package/dist/IconRoundTrip-JiO6XN3l.js +0 -20
- package/dist/IconRouteNoStop-B9B7Lsho.js +0 -18
- package/dist/IconRouteOneStop-BUC7J7oa.js +0 -18
- package/dist/IconScheduleChange-fbuvLH__.js +0 -22
- package/dist/IconSeatEmpty-CstmVSzb.js +0 -25
- package/dist/IconSeatSold-DELO-Pvo.js +0 -22
- package/dist/IconSeatTotal-836DH38g.js +0 -22
- package/dist/IconStartDate-BEDLfvts.js +0 -22
- package/dist/IconTemplate-B6d3ILRN.js +0 -23
- package/dist/IconTicket-CvynjvU9.js +0 -22
- package/dist/IconTimer-Cd-3mYao.js +0 -23
- package/dist/IconTrafficControl-CXNIPHel.js +0 -24
- package/dist/index-CSEBCA97.js +0 -20167
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
<base-input-label v-if="label" :required="required" class="cpMultiselect__label">
|
|
4
4
|
{{ label }}
|
|
5
5
|
</base-input-label>
|
|
6
|
-
|
|
7
|
-
<AutoComplete
|
|
6
|
+
<auto-complete
|
|
8
7
|
ref="multiselect"
|
|
9
8
|
v-model="selectModel"
|
|
10
9
|
:suggestions="options"
|
|
@@ -29,7 +28,6 @@
|
|
|
29
28
|
<div class="cpMultiselect__empty">{{ emptyMessage }}</div>
|
|
30
29
|
</slot>
|
|
31
30
|
</template>
|
|
32
|
-
|
|
33
31
|
<template #chip="{ value, removeCallback }">
|
|
34
32
|
<slot name="selected-option" :option="value" :remove="removeCallback">
|
|
35
33
|
<cp-badge is-clearable size="sm" @on-clear="removeCallback()">
|
|
@@ -40,25 +38,20 @@
|
|
|
40
38
|
</cp-badge>
|
|
41
39
|
</slot>
|
|
42
40
|
</template>
|
|
43
|
-
|
|
44
41
|
<template #option="{ option }">
|
|
45
42
|
<slot name="option" :option="option" />
|
|
46
43
|
</template>
|
|
47
|
-
|
|
48
44
|
<template #dropdown>
|
|
49
45
|
<div v-if="displayPrefix" class="cpMultiselect__prefix">
|
|
50
46
|
<slot name="prefix" />
|
|
51
47
|
</div>
|
|
52
|
-
|
|
53
48
|
<cp-loader v-if="isLoading" class="cpMultiselect__loader" color="#B2B2BD" />
|
|
54
49
|
<button v-else :disabled="disabled" type="button" class="cpMultiselect__toggle" @click.stop="toggleDropdown">
|
|
55
50
|
<cp-icon type="chevron-down" class="cpMultiselect__dropdownIcon" :class="chevronDynamicClass" />
|
|
56
51
|
</button>
|
|
57
|
-
|
|
58
52
|
<base-select-clear-button v-if="displayClearButton" class="cpMultiselect__clear" @click="handleClear" />
|
|
59
53
|
</template>
|
|
60
|
-
</
|
|
61
|
-
|
|
54
|
+
</auto-complete>
|
|
62
55
|
<transition-expand>
|
|
63
56
|
<p v-if="isInvalid" class="cpMultiselect__error">
|
|
64
57
|
{{ errorMessage }}
|
|
@@ -78,6 +71,13 @@ import TransitionExpand from '@/components/TransitionExpand.vue'
|
|
|
78
71
|
|
|
79
72
|
import { isEmpty } from '@/helpers/object'
|
|
80
73
|
|
|
74
|
+
interface Emits {
|
|
75
|
+
(e: 'search', query: string): void
|
|
76
|
+
(e: 'select', option: Record<string, unknown>): void
|
|
77
|
+
(e: 'clear'): void
|
|
78
|
+
(e: 'update:modelValue', value: Record<string, unknown> | Record<string, unknown>[] | null): void
|
|
79
|
+
}
|
|
80
|
+
|
|
81
81
|
interface Props {
|
|
82
82
|
disabled?: boolean
|
|
83
83
|
emptyMessage?: string
|
|
@@ -114,13 +114,6 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
114
114
|
modelValue: null,
|
|
115
115
|
})
|
|
116
116
|
|
|
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
117
|
const emit = defineEmits<Emits>()
|
|
125
118
|
|
|
126
119
|
const selectModel = computed({
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
<div class="cpSelect__container">
|
|
7
7
|
<select
|
|
8
8
|
:id="selectReferenceId"
|
|
9
|
-
ref="cpSelect"
|
|
10
9
|
:value="modelValue"
|
|
11
10
|
:disabled="disabled"
|
|
12
11
|
:required="required"
|
|
@@ -40,6 +39,10 @@ import TransitionExpand from '@/components/TransitionExpand.vue'
|
|
|
40
39
|
|
|
41
40
|
import { randomString, capitalizeFirstLetter } from '@/helpers'
|
|
42
41
|
|
|
42
|
+
interface Emits {
|
|
43
|
+
(e: 'update:modelValue', value: string): void
|
|
44
|
+
}
|
|
45
|
+
|
|
43
46
|
interface SelectOption {
|
|
44
47
|
label: string
|
|
45
48
|
value: string | number
|
|
@@ -60,10 +63,6 @@ interface Props {
|
|
|
60
63
|
required?: boolean
|
|
61
64
|
}
|
|
62
65
|
|
|
63
|
-
interface Emits {
|
|
64
|
-
(e: 'update:modelValue', value: string): void
|
|
65
|
-
}
|
|
66
|
-
|
|
67
66
|
const props = withDefaults(defineProps<Props>(), {
|
|
68
67
|
label: '',
|
|
69
68
|
modelValue: '',
|
|
@@ -78,6 +78,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
78
78
|
dropdownTitle: 'Select value',
|
|
79
79
|
dropdownFilterPlaceholder: 'Filter...',
|
|
80
80
|
dropdownEmptyViewPlaceholder: 'No option found',
|
|
81
|
+
// eslint-disable-next-line vue/no-boolean-default
|
|
81
82
|
closeOnSelect: true,
|
|
82
83
|
})
|
|
83
84
|
|
|
@@ -121,7 +121,12 @@ import { camelize, decamelize } from '@/helpers/string'
|
|
|
121
121
|
import { PAGINATION_FORMATS, RESERVED_KEYS, VISIBLE_ROWS_MAX } from '@/constants'
|
|
122
122
|
import { randomString } from '@/helpers'
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
interface Emits {
|
|
125
|
+
(e: 'onRowClick', data: Record<string, unknown>): void
|
|
126
|
+
(e: 'onRowRightClick', payload: { data: Record<string, unknown>; event: Event }): void
|
|
127
|
+
(e: 'onNextClick'): void
|
|
128
|
+
(e: 'onPreviousClick'): void
|
|
129
|
+
}
|
|
125
130
|
|
|
126
131
|
interface ColumnDefinition {
|
|
127
132
|
id: string
|
|
@@ -183,15 +188,10 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
183
188
|
rowOptions: () => [],
|
|
184
189
|
})
|
|
185
190
|
|
|
186
|
-
interface Emits {
|
|
187
|
-
(e: 'onRowClick', data: Record<string, unknown>): void
|
|
188
|
-
(e: 'onRowRightClick', payload: { data: Record<string, unknown>; event: Event }): void
|
|
189
|
-
(e: 'onNextClick'): void
|
|
190
|
-
(e: 'onPreviousClick'): void
|
|
191
|
-
}
|
|
192
|
-
|
|
193
191
|
const emit = defineEmits<Emits>()
|
|
194
192
|
|
|
193
|
+
const LoaderColor = '#5341F9'
|
|
194
|
+
|
|
195
195
|
const uniqueId = ref(randomString())
|
|
196
196
|
const pageNumber = ref(0)
|
|
197
197
|
const cpTableContainer = ref<HTMLElement | null>(null)
|
|
@@ -35,6 +35,10 @@ import TransitionExpand from '@/components/TransitionExpand.vue'
|
|
|
35
35
|
|
|
36
36
|
import { randomString, capitalizeFirstLetter } from '@/helpers'
|
|
37
37
|
|
|
38
|
+
interface Emits {
|
|
39
|
+
(e: 'update:modelValue', value: string): void
|
|
40
|
+
}
|
|
41
|
+
|
|
38
42
|
interface Props {
|
|
39
43
|
disabled?: boolean
|
|
40
44
|
errorMessage?: string
|
|
@@ -59,10 +63,6 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
59
63
|
height: 200,
|
|
60
64
|
})
|
|
61
65
|
|
|
62
|
-
interface Emits {
|
|
63
|
-
(e: 'update:modelValue', value: string): void
|
|
64
|
-
}
|
|
65
|
-
|
|
66
66
|
const emit = defineEmits<Emits>()
|
|
67
67
|
|
|
68
68
|
const textareaModel = defineModel<string>({
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export enum ButtonAppearances {
|
|
2
|
+
DEFAULT = 'default',
|
|
3
|
+
PRIMARY = 'primary',
|
|
4
|
+
MINIMAL = 'minimal',
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export enum ButtonTags {
|
|
8
|
+
BUTTON = 'button',
|
|
9
|
+
A = 'a',
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export enum ButtonTypes {
|
|
13
|
+
BUTTON = 'button',
|
|
14
|
+
SUBMIT = 'submit',
|
|
15
|
+
RESET = 'reset',
|
|
16
|
+
}
|
|
@@ -1,83 +1,157 @@
|
|
|
1
|
-
import
|
|
1
|
+
import IconAccompaniedMinorEach from '@/components/icons/IconAccompaniedMinorEach.vue'
|
|
2
|
+
import IconAccompaniedMinorNone from '@/components/icons/IconAccompaniedMinorNone.vue'
|
|
3
|
+
import IconAccompaniedMinorOne from '@/components/icons/IconAccompaniedMinorOne.vue'
|
|
4
|
+
import IconAddReceipt from '@/components/icons/IconAddReceipt.vue'
|
|
5
|
+
import IconAirline from '@/components/icons/IconAirline.vue'
|
|
6
|
+
import IconAirportTerminal from '@/components/icons/IconAirportTerminal.vue'
|
|
7
|
+
import IconArrival from '@/components/icons/IconArrival.vue'
|
|
8
|
+
import IconBaggageCabinNone from '@/components/icons/IconBaggageCabinNone.vue'
|
|
9
|
+
import IconBaggageCheckedNone from '@/components/icons/IconBaggageCheckedNone.vue'
|
|
10
|
+
import IconBaggagePersonalNone from '@/components/icons/IconBaggagePersonalNone.vue'
|
|
11
|
+
import IconBroadcast from '@/components/icons/IconBroadcast.vue'
|
|
12
|
+
import IconCabinBag from '@/components/icons/IconCabinBag.vue'
|
|
13
|
+
import IconCalendar from '@/components/icons/IconCalendar.vue'
|
|
14
|
+
import IconCalendarDelay from '@/components/icons/IconCalendarDelay.vue'
|
|
15
|
+
import IconCheckedBaggage20 from '@/components/icons/IconCheckedBaggage20.vue'
|
|
16
|
+
import IconCheckedBaggage30 from '@/components/icons/IconCheckedBaggage30.vue'
|
|
17
|
+
import IconCheckList from '@/components/icons/IconCheckList.vue'
|
|
18
|
+
import IconChild from '@/components/icons/IconChild.vue'
|
|
19
|
+
import IconCollapse from '@/components/icons/IconCollapse.vue'
|
|
20
|
+
import IconContact from '@/components/icons/IconContact.vue'
|
|
21
|
+
import IconDeparture from '@/components/icons/IconDeparture.vue'
|
|
22
|
+
import IconDistribution from '@/components/icons/IconDistribution.vue'
|
|
23
|
+
import IconDistributionClosed from '@/components/icons/IconDistributionClosed.vue'
|
|
24
|
+
import IconDistributionExclusivePair from '@/components/icons/IconDistributionExclusivePair.vue'
|
|
25
|
+
import IconDistributionSided from '@/components/icons/IconDistributionSided.vue'
|
|
26
|
+
import IconDistributionSupplySided from '@/components/icons/IconDistributionSupplySided.vue'
|
|
27
|
+
import IconDynamicContent from '@/components/icons/IconDynamicContent.vue'
|
|
28
|
+
import IconEndDate from '@/components/icons/IconEndDate.vue'
|
|
29
|
+
import IconExpand from '@/components/icons/IconExpand.vue'
|
|
30
|
+
import IconFares from '@/components/icons/IconFares.vue'
|
|
31
|
+
import IconFaresOutlined from '@/components/icons/IconFaresOutlined.vue'
|
|
32
|
+
import IconFemale from '@/components/icons/IconFemale.vue'
|
|
33
|
+
import IconFindConversation from '@/components/icons/IconFindConversation.vue'
|
|
34
|
+
import IconFire from '@/components/icons/IconFire.vue'
|
|
35
|
+
import IconFlight from '@/components/icons/IconFlight.vue'
|
|
36
|
+
import IconFlightReturn from '@/components/icons/IconFlightReturn.vue'
|
|
37
|
+
import IconFlightSchedule from '@/components/icons/IconFlightSchedule.vue'
|
|
38
|
+
import IconGroupBy from '@/components/icons/IconGroupBy.vue'
|
|
39
|
+
import IconHandHeart from '@/components/icons/IconHandHeart.vue'
|
|
40
|
+
import IconHistory from '@/components/icons/IconHistory.vue'
|
|
41
|
+
import IconHourGlass from '@/components/icons/IconHourGlass.vue'
|
|
42
|
+
import IconIdCard from '@/components/icons/IconIdCard.vue'
|
|
43
|
+
import IconInfant from '@/components/icons/IconInfant.vue'
|
|
44
|
+
import IconItinerary from '@/components/icons/IconItinerary.vue'
|
|
45
|
+
import IconLeave from '@/components/icons/IconLeave.vue'
|
|
46
|
+
import IconMale from '@/components/icons/IconMale.vue'
|
|
47
|
+
import IconMultiSegments from '@/components/icons/IconMultiSegments.vue'
|
|
48
|
+
import IconNoPassport from '@/components/icons/IconNoPassport.vue'
|
|
49
|
+
import IconNoRefund from '@/components/icons/IconNoRefund.vue'
|
|
50
|
+
import IconNoSeat from '@/components/icons/IconNoSeat.vue'
|
|
51
|
+
import IconNotion from '@/components/icons/IconNotion.vue'
|
|
52
|
+
import IconOffline from '@/components/icons/IconOffline.vue'
|
|
53
|
+
import IconOneWay from '@/components/icons/IconOneWay.vue'
|
|
54
|
+
import IconOta from '@/components/icons/IconOta.vue'
|
|
55
|
+
import IconPaid from '@/components/icons/IconPaid.vue'
|
|
56
|
+
import IconPassport from '@/components/icons/IconPassport.vue'
|
|
57
|
+
import IconPayout from '@/components/icons/IconPayout.vue'
|
|
58
|
+
import IconPlug from '@/components/icons/IconPlug.vue'
|
|
59
|
+
import IconPlugOff from '@/components/icons/IconPlugOff.vue'
|
|
60
|
+
import IconReceipt from '@/components/icons/IconReceipt.vue'
|
|
61
|
+
import IconRecurrence from '@/components/icons/IconRecurrence.vue'
|
|
62
|
+
import IconRefund from '@/components/icons/IconRefund.vue'
|
|
63
|
+
import IconRoundTrip from '@/components/icons/IconRoundTrip.vue'
|
|
64
|
+
import IconRouteNoStop from '@/components/icons/IconRouteNoStop.vue'
|
|
65
|
+
import IconRouteOneStop from '@/components/icons/IconRouteOneStop.vue'
|
|
66
|
+
import IconScheduleChange from '@/components/icons/IconScheduleChange.vue'
|
|
67
|
+
import IconSeatEmpty from '@/components/icons/IconSeatEmpty.vue'
|
|
68
|
+
import IconSeatSold from '@/components/icons/IconSeatSold.vue'
|
|
69
|
+
import IconSeatTotal from '@/components/icons/IconSeatTotal.vue'
|
|
70
|
+
import IconStartDate from '@/components/icons/IconStartDate.vue'
|
|
71
|
+
import IconSupplier from '@/components/icons/IconSupplier.vue'
|
|
72
|
+
import IconTemplate from '@/components/icons/IconTemplate.vue'
|
|
73
|
+
import IconThirdParty from '@/components/icons/IconThirdParty.vue'
|
|
74
|
+
import IconTicket from '@/components/icons/IconTicket.vue'
|
|
75
|
+
import IconTimer from '@/components/icons/IconTimer.vue'
|
|
76
|
+
import IconTooltip from '@/components/icons/IconTooltip.vue'
|
|
77
|
+
import IconTrafficControl from '@/components/icons/IconTrafficControl.vue'
|
|
2
78
|
|
|
3
79
|
export const CustomCpIcons = {
|
|
4
|
-
'accompanied-minor-each':
|
|
5
|
-
'accompanied-minor-none':
|
|
6
|
-
'accompanied-minor-one':
|
|
7
|
-
'add-receipt':
|
|
8
|
-
airline:
|
|
9
|
-
'airport-terminal':
|
|
10
|
-
arrival:
|
|
11
|
-
'baggage-cabin-none':
|
|
12
|
-
'baggage-checked-none':
|
|
13
|
-
'baggage-personal-none':
|
|
14
|
-
broadcast:
|
|
15
|
-
'calendar-2':
|
|
16
|
-
'calendar-delay':
|
|
17
|
-
'cabin-bag':
|
|
18
|
-
'check-list':
|
|
19
|
-
'checked-baggage-20':
|
|
20
|
-
'checked-baggage-30':
|
|
21
|
-
child:
|
|
22
|
-
collapse:
|
|
23
|
-
contact:
|
|
24
|
-
departure:
|
|
25
|
-
distribution:
|
|
26
|
-
'distribution-closed':
|
|
27
|
-
'distribution-exclusive-pair':
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
'
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
flight:
|
|
41
|
-
'
|
|
42
|
-
'
|
|
43
|
-
|
|
44
|
-
'
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
'
|
|
53
|
-
'no-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
'
|
|
69
|
-
'
|
|
70
|
-
'
|
|
71
|
-
'
|
|
72
|
-
'seat-
|
|
73
|
-
'
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
tooltip: defineAsyncComponent(() => import('@/components/icons/IconTooltip.vue')),
|
|
82
|
-
'traffic-control': defineAsyncComponent(() => import('@/components/icons/IconTrafficControl.vue')),
|
|
80
|
+
'accompanied-minor-each': IconAccompaniedMinorEach,
|
|
81
|
+
'accompanied-minor-none': IconAccompaniedMinorNone,
|
|
82
|
+
'accompanied-minor-one': IconAccompaniedMinorOne,
|
|
83
|
+
'add-receipt': IconAddReceipt,
|
|
84
|
+
airline: IconAirline,
|
|
85
|
+
'airport-terminal': IconAirportTerminal,
|
|
86
|
+
arrival: IconArrival,
|
|
87
|
+
'baggage-cabin-none': IconBaggageCabinNone,
|
|
88
|
+
'baggage-checked-none': IconBaggageCheckedNone,
|
|
89
|
+
'baggage-personal-none': IconBaggagePersonalNone,
|
|
90
|
+
broadcast: IconBroadcast,
|
|
91
|
+
'calendar-2': IconCalendar,
|
|
92
|
+
'calendar-delay': IconCalendarDelay,
|
|
93
|
+
'cabin-bag': IconCabinBag,
|
|
94
|
+
'check-list': IconCheckList,
|
|
95
|
+
'checked-baggage-20': IconCheckedBaggage20,
|
|
96
|
+
'checked-baggage-30': IconCheckedBaggage30,
|
|
97
|
+
child: IconChild,
|
|
98
|
+
collapse: IconCollapse,
|
|
99
|
+
contact: IconContact,
|
|
100
|
+
departure: IconDeparture,
|
|
101
|
+
distribution: IconDistribution,
|
|
102
|
+
'distribution-closed': IconDistributionClosed,
|
|
103
|
+
'distribution-exclusive-pair': IconDistributionExclusivePair,
|
|
104
|
+
'distribution-sided': IconDistributionSided,
|
|
105
|
+
'distribution-supply-sided': IconDistributionSupplySided,
|
|
106
|
+
'dynamic-content': IconDynamicContent,
|
|
107
|
+
'end-date': IconEndDate,
|
|
108
|
+
expand: IconExpand,
|
|
109
|
+
fares: IconFares,
|
|
110
|
+
'fares-outlined': IconFaresOutlined,
|
|
111
|
+
female: IconFemale,
|
|
112
|
+
'find-conversation': IconFindConversation,
|
|
113
|
+
fire: IconFire,
|
|
114
|
+
flight: IconFlight,
|
|
115
|
+
'flight-return': IconFlightReturn,
|
|
116
|
+
'flight-schedule': IconFlightSchedule,
|
|
117
|
+
'group-by': IconGroupBy,
|
|
118
|
+
'hand-heart': IconHandHeart,
|
|
119
|
+
history: IconHistory,
|
|
120
|
+
'hour-glass': IconHourGlass,
|
|
121
|
+
'id-card': IconIdCard,
|
|
122
|
+
infant: IconInfant,
|
|
123
|
+
itinerary: IconItinerary,
|
|
124
|
+
leave: IconLeave,
|
|
125
|
+
male: IconMale,
|
|
126
|
+
'multi-segments': IconMultiSegments,
|
|
127
|
+
'no-passport': IconNoPassport,
|
|
128
|
+
'no-refund': IconNoRefund,
|
|
129
|
+
'no-seat': IconNoSeat,
|
|
130
|
+
notion: IconNotion,
|
|
131
|
+
offline: IconOffline,
|
|
132
|
+
'one-way': IconOneWay,
|
|
133
|
+
ota: IconOta,
|
|
134
|
+
paid: IconPaid,
|
|
135
|
+
passport: IconPassport,
|
|
136
|
+
payout: IconPayout,
|
|
137
|
+
plug: IconPlug,
|
|
138
|
+
'plug-off': IconPlugOff,
|
|
139
|
+
receipt: IconReceipt,
|
|
140
|
+
recurrence: IconRecurrence,
|
|
141
|
+
refund: IconRefund,
|
|
142
|
+
'round-trip': IconRoundTrip,
|
|
143
|
+
'route-no-stop': IconRouteNoStop,
|
|
144
|
+
'route-one-stop': IconRouteOneStop,
|
|
145
|
+
'schedule-change': IconScheduleChange,
|
|
146
|
+
'seat-empty': IconSeatEmpty,
|
|
147
|
+
'seat-sold': IconSeatSold,
|
|
148
|
+
'seat-total': IconSeatTotal,
|
|
149
|
+
'start-date': IconStartDate,
|
|
150
|
+
supplier: IconSupplier,
|
|
151
|
+
template: IconTemplate,
|
|
152
|
+
'third-party': IconThirdParty,
|
|
153
|
+
ticket: IconTicket,
|
|
154
|
+
timer: IconTimer,
|
|
155
|
+
tooltip: IconTooltip,
|
|
156
|
+
'traffic-control': IconTrafficControl,
|
|
83
157
|
}
|
package/src/constants/index.ts
CHANGED
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
>
|
|
80
80
|
<option
|
|
81
81
|
v-if="years.indexOf(month.year) === -1"
|
|
82
|
-
:key="`month-${monthIndex}-${year}`"
|
|
82
|
+
:key="`month-${monthIndex}-${month.year}`"
|
|
83
83
|
:value="month.year"
|
|
84
84
|
:disabled="true"
|
|
85
85
|
>
|
|
@@ -246,15 +246,16 @@ export default {
|
|
|
246
246
|
},
|
|
247
247
|
isTest: {
|
|
248
248
|
type: Boolean,
|
|
249
|
+
// eslint-disable-next-line vue/no-boolean-default
|
|
249
250
|
default: () => process.env.NODE_ENV === 'test',
|
|
250
251
|
},
|
|
251
252
|
},
|
|
252
253
|
emits: [
|
|
253
|
-
'
|
|
254
|
-
'
|
|
255
|
-
'
|
|
256
|
-
'
|
|
257
|
-
'
|
|
254
|
+
'dateOneSelected',
|
|
255
|
+
'dateTwoSelected',
|
|
256
|
+
'isInline',
|
|
257
|
+
'previousMonth',
|
|
258
|
+
'nextMonth',
|
|
258
259
|
'opened',
|
|
259
260
|
'cancelled',
|
|
260
261
|
'closed',
|
|
@@ -382,11 +383,11 @@ export default {
|
|
|
382
383
|
watch: {
|
|
383
384
|
selectedDate1(newValue) {
|
|
384
385
|
const newDate = !newValue || newValue === '' ? '' : newValue
|
|
385
|
-
this.$emit('
|
|
386
|
+
this.$emit('dateOneSelected', newDate)
|
|
386
387
|
},
|
|
387
388
|
selectedDate2(newValue) {
|
|
388
389
|
const newDate = !newValue || newValue === '' ? '' : newValue
|
|
389
|
-
this.$emit('
|
|
390
|
+
this.$emit('dateTwoSelected', newDate)
|
|
390
391
|
},
|
|
391
392
|
mode() {
|
|
392
393
|
this.setStartDates()
|
|
@@ -408,7 +409,7 @@ export default {
|
|
|
408
409
|
}
|
|
409
410
|
if (this.isDateTwoBeforeDateOne) {
|
|
410
411
|
this.selectedDate2 = ''
|
|
411
|
-
this.$emit('
|
|
412
|
+
this.$emit('dateTwoSelected', '')
|
|
412
413
|
}
|
|
413
414
|
},
|
|
414
415
|
trigger(newValue) {
|
|
@@ -442,11 +443,15 @@ export default {
|
|
|
442
443
|
this.openDatepicker()
|
|
443
444
|
}
|
|
444
445
|
|
|
446
|
+
// eslint-disable-next-line vue/no-undef-properties
|
|
445
447
|
this.triggerElement.addEventListener('click', this._handleWindowClickEvent)
|
|
446
448
|
},
|
|
447
449
|
unmounted() {
|
|
450
|
+
// eslint-disable-next-line vue/no-undef-properties
|
|
448
451
|
window.removeEventListener('resize', this._handleWindowResizeEvent)
|
|
452
|
+
|
|
449
453
|
window.removeEventListener('click', this._handleWindowClickEvent)
|
|
454
|
+
|
|
450
455
|
this.triggerElement.removeEventListener('click', this._handleWindowClickEvent)
|
|
451
456
|
},
|
|
452
457
|
methods: {
|
|
@@ -456,7 +461,7 @@ export default {
|
|
|
456
461
|
this._handleWindowResizeEvent = this.debounce(() => {
|
|
457
462
|
if (this.inline) this.openDatepicker()
|
|
458
463
|
else this.closeDatepicker()
|
|
459
|
-
this.$emit('
|
|
464
|
+
this.$emit('isInline', this.inline)
|
|
460
465
|
this.positionDatepicker()
|
|
461
466
|
this.setStartDates()
|
|
462
467
|
}, 200)
|
|
@@ -878,7 +883,7 @@ export default {
|
|
|
878
883
|
|
|
879
884
|
this.months.unshift(this.getMonth(this.startingDate))
|
|
880
885
|
this.months.splice(this.months.length - 1, 1)
|
|
881
|
-
this.$emit('
|
|
886
|
+
this.$emit('previousMonth', this.visibleMonths)
|
|
882
887
|
this.resetFocusedDate(false)
|
|
883
888
|
},
|
|
884
889
|
nextMonth() {
|
|
@@ -886,7 +891,7 @@ export default {
|
|
|
886
891
|
this.startingDate = this.addMonths(this.months[this.months.length - 1].firstDateOfMonth)
|
|
887
892
|
this.months.push(this.getMonth(this.startingDate))
|
|
888
893
|
this.months.splice(0, 1)
|
|
889
|
-
this.$emit('
|
|
894
|
+
this.$emit('nextMonth', this.visibleMonths)
|
|
890
895
|
this.resetFocusedDate(true)
|
|
891
896
|
},
|
|
892
897
|
subtractMonths(date) {
|
|
@@ -922,7 +927,9 @@ export default {
|
|
|
922
927
|
this.setStartDates()
|
|
923
928
|
this.triggerElement.classList.add('datepicker-open')
|
|
924
929
|
this.showDatepicker = true
|
|
930
|
+
// eslint-disable-next-line vue/no-undef-properties
|
|
925
931
|
this.initialDate1 = this.dateOne
|
|
932
|
+
// eslint-disable-next-line vue/no-undef-properties
|
|
926
933
|
this.initialDate2 = this.dateTwo
|
|
927
934
|
this.$emit('opened')
|
|
928
935
|
this.$nextTick(() => {
|
|
@@ -988,6 +995,7 @@ export default {
|
|
|
988
995
|
},
|
|
989
996
|
}
|
|
990
997
|
</script>
|
|
998
|
+
|
|
991
999
|
<style lang="scss">
|
|
992
1000
|
$tablet: 768px;
|
|
993
1001
|
|
|
@@ -62,6 +62,8 @@ export const Default: Story = {
|
|
|
62
62
|
size: Sizes.MD,
|
|
63
63
|
isStroked: false,
|
|
64
64
|
isSquare: false,
|
|
65
|
+
isClearable: false,
|
|
66
|
+
isDisabled: false,
|
|
65
67
|
leadingIcon: '',
|
|
66
68
|
trailingIcon: '',
|
|
67
69
|
label: 'Badge',
|
|
@@ -103,6 +105,11 @@ export const WithSizes: Story = {
|
|
|
103
105
|
}),
|
|
104
106
|
}
|
|
105
107
|
|
|
108
|
+
export const WithIcons: Story = {
|
|
109
|
+
args: { ...Default.args, leadingIcon: 'check', trailingIcon: 'arrow-right', label: 'Both Icons' },
|
|
110
|
+
render: defaultRender,
|
|
111
|
+
}
|
|
112
|
+
|
|
106
113
|
export const WithLeadingIcon: Story = {
|
|
107
114
|
args: { ...Default.args, leadingIcon: 'check', label: 'Leading Icon' },
|
|
108
115
|
render: defaultRender,
|
|
@@ -138,11 +145,6 @@ export const IsStroked: Story = {
|
|
|
138
145
|
}),
|
|
139
146
|
}
|
|
140
147
|
|
|
141
|
-
export const WithIcons: Story = {
|
|
142
|
-
args: { ...Default.args, leadingIcon: 'check', trailingIcon: 'arrow-right', label: 'Both Icons' },
|
|
143
|
-
render: defaultRender,
|
|
144
|
-
}
|
|
145
|
-
|
|
146
148
|
export const IsSquare: Story = {
|
|
147
149
|
args: { ...Default.args, isSquare: true, label: 'Square' },
|
|
148
150
|
render: defaultRender,
|
|
@@ -153,6 +155,11 @@ export const IsClearable: Story = {
|
|
|
153
155
|
render: defaultRender,
|
|
154
156
|
}
|
|
155
157
|
|
|
158
|
+
export const IsDisabled: Story = {
|
|
159
|
+
args: { ...Default.args, isDisabled: true, label: 'Disabled' },
|
|
160
|
+
render: defaultRender,
|
|
161
|
+
}
|
|
162
|
+
|
|
156
163
|
export const WithSlot: Story = {
|
|
157
164
|
render: (args: Args) => ({
|
|
158
165
|
components: { CpBadge },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref } from 'vue'
|
|
1
|
+
import { ref, toValue } from 'vue'
|
|
2
2
|
|
|
3
3
|
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
4
4
|
|
|
@@ -87,7 +87,7 @@ export const Single: Story = {
|
|
|
87
87
|
const isLoading = ref(false)
|
|
88
88
|
|
|
89
89
|
const originalOptions = ref(args.options)
|
|
90
|
-
const dynamicOptions = ref(originalOptions
|
|
90
|
+
const dynamicOptions = ref(toValue(originalOptions))
|
|
91
91
|
|
|
92
92
|
const handleSearch = async (query: string) => {
|
|
93
93
|
isLoading.value = true
|
|
@@ -97,7 +97,8 @@ export const Single: Story = {
|
|
|
97
97
|
|
|
98
98
|
await new Promise((resolve) => setTimeout(resolve, 500))
|
|
99
99
|
|
|
100
|
-
dynamicOptions.value = dynamicOptions.value
|
|
100
|
+
dynamicOptions.value = dynamicOptions.value?.filter((option) => {
|
|
101
|
+
// @ts-expect-error option is unknown
|
|
101
102
|
return option.name.toLowerCase().includes(searchQuery.value.toLowerCase())
|
|
102
103
|
})
|
|
103
104
|
|
|
@@ -165,7 +166,7 @@ export const Multiple: Story = {
|
|
|
165
166
|
const isLoading = ref(false)
|
|
166
167
|
|
|
167
168
|
const originalOptions = ref(args.options)
|
|
168
|
-
const dynamicOptions = ref(originalOptions
|
|
169
|
+
const dynamicOptions = ref(toValue(originalOptions))
|
|
169
170
|
|
|
170
171
|
const handleSearch = async (query: string) => {
|
|
171
172
|
isLoading.value = true
|
|
@@ -175,7 +176,8 @@ export const Multiple: Story = {
|
|
|
175
176
|
|
|
176
177
|
await new Promise((resolve) => setTimeout(resolve, 500))
|
|
177
178
|
|
|
178
|
-
dynamicOptions.value = dynamicOptions.value
|
|
179
|
+
dynamicOptions.value = dynamicOptions.value?.filter((option) => {
|
|
180
|
+
// @ts-expect-error option is unknown
|
|
179
181
|
return option.name.toLowerCase().includes(searchQuery.value.toLowerCase())
|
|
180
182
|
})
|
|
181
183
|
|