@citizenplane/pimp 8.26.1 → 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-CUq3oXbX.js → IconAccompaniedMinorEach-BJYaPpW3.js} +1 -1
- package/dist/{IconAccompaniedMinorNone-nZ4eSfTj.js → IconAccompaniedMinorNone-D1JR2Qpd.js} +1 -1
- package/dist/{IconAccompaniedMinorOne-CDMqq14b.js → IconAccompaniedMinorOne-BJ3jzEDZ.js} +1 -1
- package/dist/{IconAddReceipt-DRpGiWBU.js → IconAddReceipt-BX_va94f.js} +1 -1
- package/dist/{IconAirportTerminal-8k-3lKjb.js → IconAirportTerminal-Dzr98nfc.js} +1 -1
- package/dist/{IconArrival-m6HnOVje.js → IconArrival-Ced9HrJH.js} +1 -1
- package/dist/{IconBroadcast-B13UworG.js → IconBroadcast-BYX44Wak.js} +1 -1
- package/dist/{IconCabinBag-CNnzHz2B.js → IconCabinBag-D1Qs952U.js} +1 -1
- package/dist/{IconCheckedBaggage-CkxUDHe9.js → IconCheckedBaggage-Q4_SQL9l.js} +1 -1
- package/dist/{IconCheckedBaggage20-DEtphLSa.js → IconCheckedBaggage20-DVH1-A0V.js} +1 -1
- package/dist/{IconCheckedBaggage30-CmAddx5h.js → IconCheckedBaggage30-DYOAf-7Z.js} +1 -1
- package/dist/{IconChild-OReHyUco.js → IconChild-BeCLAr8Y.js} +1 -1
- package/dist/{IconContact-D2N23RZ5.js → IconContact-B3r39fyI.js} +1 -1
- package/dist/{IconDeparture-D10LaXRX.js → IconDeparture-BflKZUiE.js} +1 -1
- package/dist/{IconDistribution-SpPiru9I.js → IconDistribution-CBxQ7UWb.js} +1 -1
- package/dist/{IconDistributionClosed-Bzqe7nju.js → IconDistributionClosed-BWp_k24K.js} +1 -1
- package/dist/{IconDistributionExclusivePair-CjPM-_R1.js → IconDistributionExclusivePair-erLbcLps.js} +1 -1
- package/dist/{IconDistributionSided-DehjCN0D.js → IconDistributionSided-y000n4qB.js} +1 -1
- package/dist/{IconDistributionSupplySided-DWCyXqd1.js → IconDistributionSupplySided-7kCvGwnz.js} +1 -1
- package/dist/{IconDynamicContent-BvzbgXvW.js → IconDynamicContent-SwBxkPMB.js} +1 -1
- package/dist/{IconFares-zARDpPNl.js → IconFares-DTm0Q_RI.js} +1 -1
- package/dist/{IconFaresOutlined-DLFV8nwg.js → IconFaresOutlined-BFMo_x9Q.js} +1 -1
- package/dist/{IconFemale-Ba4uoI-S.js → IconFemale-Ma0KeaEM.js} +1 -1
- package/dist/{IconFindConversation-d0pP3wG9.js → IconFindConversation-CpsDYPgD.js} +1 -1
- package/dist/{IconFire-CXzWKoMB.js → IconFire-DECrDnLM.js} +1 -1
- package/dist/{IconFlight-Cof8M5dO.js → IconFlight-D5M0A0CM.js} +1 -1
- package/dist/{IconFlightReturn-CA9iGMcW.js → IconFlightReturn-CTvqEFME.js} +1 -1
- package/dist/{IconHandHeart-CCLKnMOm.js → IconHandHeart-ChgdfXQa.js} +1 -1
- package/dist/{IconHistory-DI6WD_3J.js → IconHistory-DpIXDYI5.js} +1 -1
- package/dist/{IconHourGlass-BorNLEca.js → IconHourGlass-CIRkFUSM.js} +1 -1
- package/dist/{IconIdCard-DhbhBkul.js → IconIdCard-UD5VZsUi.js} +1 -1
- package/dist/{IconInfant-D4EztT9g.js → IconInfant-CmLUvWpO.js} +1 -1
- package/dist/{IconItinerary-Bhj_lgG2.js → IconItinerary-CY8irele.js} +1 -1
- package/dist/{IconLeave-BvpY7gdD.js → IconLeave-C3bpPz6L.js} +1 -1
- package/dist/{IconMale-RMd_9ZSg.js → IconMale-x4xdulWB.js} +1 -1
- package/dist/{IconMultiSegments-DROUj0t5.js → IconMultiSegments-BhTMfvhQ.js} +1 -1
- package/dist/{IconNoPassport-DBmaQH_g.js → IconNoPassport-_Xm76k6b.js} +1 -1
- package/dist/{IconNoRefund-yNAZr7uX.js → IconNoRefund-B78s0oyF.js} +1 -1
- package/dist/{IconNotion-CpZhGILz.js → IconNotion-C22PTLTU.js} +1 -1
- package/dist/{IconOffline-Bf1mw_1N.js → IconOffline-BDzikWE9.js} +1 -1
- package/dist/{IconOneWay-6oGoLo57.js → IconOneWay-DlTVxokv.js} +2 -2
- package/dist/{IconPaid-B3dvioAR.js → IconPaid-DmGERe85.js} +1 -1
- package/dist/{IconPassport-5SwUf6_R.js → IconPassport-6VOlXjxJ.js} +1 -1
- package/dist/{IconPayout-b3TcXwjA.js → IconPayout-abr6BXCd.js} +1 -1
- package/dist/{IconReceipt-Dh454941.js → IconReceipt-BnTaihcq.js} +1 -1
- package/dist/{IconRecurrence-CXVkBJ3i.js → IconRecurrence-C5TPG2ht.js} +1 -1
- package/dist/{IconRefund-D-FNjukU.js → IconRefund-Ysv8pyMJ.js} +1 -1
- package/dist/{IconRoundTrip-BqVPrNwg.js → IconRoundTrip-CIVDw8LK.js} +1 -1
- package/dist/{IconRouteNoStop-CZ_QeOIY.js → IconRouteNoStop-DQrq4gW5.js} +1 -1
- package/dist/{IconRouteOneStop-DGpLAQmQ.js → IconRouteOneStop-pzisj4i4.js} +1 -1
- package/dist/{IconScheduleChange-CEIGEhU4.js → IconScheduleChange-BONs1AAT.js} +1 -1
- package/dist/{IconSeatEmpty-BwyVwYQZ.js → IconSeatEmpty-CHij3aGA.js} +1 -1
- package/dist/{IconSeatSold-B_SNoTs-.js → IconSeatSold-QspS_zCh.js} +1 -1
- package/dist/{IconSeatTotal-DUEF7k6I.js → IconSeatTotal-DTZ1TcAX.js} +1 -1
- package/dist/{IconTemplate-D1ACYaHI.js → IconTemplate-BDmmr-9L.js} +1 -1
- package/dist/{IconTicket-5Z4b83BP.js → IconTicket--vVn61Ey.js} +1 -1
- package/dist/{IconTimer-DbcddAPo.js → IconTimer-CspKpwqZ.js} +1 -1
- package/dist/{IconTrafficControl-CEzhRpZt.js → IconTrafficControl-DBamcJNe.js} +1 -1
- package/dist/{index-DbgX3-2I.js → index-C3oHnZQk.js} +9166 -10083
- 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 +27 -44
- 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 +159 -113
- 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/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
|
@@ -25,155 +25,129 @@
|
|
|
25
25
|
:locale="locale"
|
|
26
26
|
class="cpDatepicker__datepicker"
|
|
27
27
|
:class="{ 'cpDatepicker__datepicker--isInline': isInline }"
|
|
28
|
-
@date-one-selected="
|
|
29
|
-
@date-two-selected="
|
|
28
|
+
@date-one-selected="onDateOneSelected"
|
|
29
|
+
@date-two-selected="onDateTwoSelected"
|
|
30
30
|
@opened="() => (isDisabled = true)"
|
|
31
|
-
@closed="() => (isDisabled =
|
|
31
|
+
@closed="() => (isDisabled = false)"
|
|
32
32
|
/>
|
|
33
33
|
</div>
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
|
-
<script>
|
|
37
|
-
import
|
|
36
|
+
<script setup lang="ts">
|
|
37
|
+
import { DateTime } from 'luxon'
|
|
38
|
+
import { ref, computed, watch } from 'vue'
|
|
39
|
+
|
|
38
40
|
import CpInput from '@/components/inputs/CpInput.vue'
|
|
41
|
+
|
|
39
42
|
import { randomString, formatDates } from '@/helpers'
|
|
40
|
-
import
|
|
43
|
+
import CoreDatepicker from '@/libs/CoreDatepicker.vue'
|
|
41
44
|
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
dateTwo: this.mode === 'range' ? this.initDateTwo : '',
|
|
132
|
-
isDisabled: null,
|
|
133
|
-
datePickerReferenceId: this.triggerElementId || randomString(),
|
|
45
|
+
type DatepickerMode = 'range' | 'single'
|
|
46
|
+
|
|
47
|
+
interface Props {
|
|
48
|
+
allowPastDates?: boolean
|
|
49
|
+
closeAfterSelect?: boolean
|
|
50
|
+
errorMessage?: string
|
|
51
|
+
initDateOne?: string
|
|
52
|
+
initDateTwo?: string
|
|
53
|
+
inputValue?: string
|
|
54
|
+
isError?: boolean
|
|
55
|
+
isInline?: boolean
|
|
56
|
+
label?: string
|
|
57
|
+
locale?: string
|
|
58
|
+
maxDate?: string | Date
|
|
59
|
+
minDate?: string | Date
|
|
60
|
+
mode?: DatepickerMode
|
|
61
|
+
placeholder?: string
|
|
62
|
+
singleMonth?: boolean
|
|
63
|
+
triggerElementId?: string
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
interface Emits {
|
|
67
|
+
(e: 'dates', dates: string[]): void
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
71
|
+
triggerElementId: '',
|
|
72
|
+
mode: 'single',
|
|
73
|
+
closeAfterSelect: true,
|
|
74
|
+
label: '',
|
|
75
|
+
placeholder: 'Select a date',
|
|
76
|
+
inputValue: '',
|
|
77
|
+
isError: false,
|
|
78
|
+
errorMessage: '',
|
|
79
|
+
initDateOne: '',
|
|
80
|
+
initDateTwo: '',
|
|
81
|
+
minDate: () => DateTime.local().toISODate(),
|
|
82
|
+
maxDate: '',
|
|
83
|
+
allowPastDates: false,
|
|
84
|
+
isInline: false,
|
|
85
|
+
singleMonth: false,
|
|
86
|
+
locale: () => navigator.language,
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
const emit = defineEmits<Emits>()
|
|
90
|
+
|
|
91
|
+
const humanFormat = 'EEE DD'
|
|
92
|
+
const dateOne = ref(props.initDateOne || '')
|
|
93
|
+
const dateTwo = ref(props.mode === 'range' ? props.initDateTwo : '')
|
|
94
|
+
const isDisabled = ref(false)
|
|
95
|
+
const datePickerReferenceId = ref(props.triggerElementId || randomString())
|
|
96
|
+
|
|
97
|
+
const inputComputedValue = computed(() => {
|
|
98
|
+
if (props.inputValue) return props.inputValue
|
|
99
|
+
|
|
100
|
+
return formatDates({
|
|
101
|
+
dateOne: dateOne.value,
|
|
102
|
+
dateTwo: dateTwo.value,
|
|
103
|
+
format: humanFormat,
|
|
104
|
+
locale: props.locale,
|
|
105
|
+
})
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
const numberOfMonths = computed(() => {
|
|
109
|
+
return props.singleMonth ? 1 : 2
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
const computedMinDate = computed(() => {
|
|
113
|
+
return props.allowPastDates ? '' : props.minDate
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
const onDateOneSelected = (date: string) => selectDate('dateOne', date)
|
|
117
|
+
const onDateTwoSelected = (date: string) => selectDate('dateTwo', date)
|
|
118
|
+
|
|
119
|
+
const selectDate = (dateType: 'dateOne' | 'dateTwo', dateValue: string): void => {
|
|
120
|
+
if (dateType === 'dateOne') {
|
|
121
|
+
dateOne.value = dateValue
|
|
122
|
+
} else {
|
|
123
|
+
dateTwo.value = dateValue
|
|
124
|
+
}
|
|
125
|
+
emit('dates', [dateOne.value, ...(dateTwo.value ? [dateTwo.value] : [])])
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const updateDateValue = (date: 'dateOne' | 'dateTwo', newValue: string, oldValue: string): void => {
|
|
129
|
+
if (newValue !== oldValue) {
|
|
130
|
+
if (date === 'dateOne') {
|
|
131
|
+
dateOne.value = newValue
|
|
132
|
+
} else {
|
|
133
|
+
dateTwo.value = newValue
|
|
134
134
|
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
watch(
|
|
139
|
+
() => props.initDateOne,
|
|
140
|
+
(newValue, oldValue) => {
|
|
141
|
+
updateDateValue('dateOne', newValue, oldValue)
|
|
135
142
|
},
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
dateTwo: this.dateTwo,
|
|
143
|
-
format: this.humanFormat,
|
|
144
|
-
locale: this.locale,
|
|
145
|
-
})
|
|
146
|
-
},
|
|
147
|
-
numberOfMonths() {
|
|
148
|
-
return this.singleMonth ? 1 : 2
|
|
149
|
-
},
|
|
150
|
-
computedMinDate() {
|
|
151
|
-
return this.allowPastDates ? '' : this.minDate
|
|
152
|
-
},
|
|
153
|
-
dynamicClasses() {
|
|
154
|
-
return { 'cpDatepicker__datepicker--isInline': this.isInline }
|
|
155
|
-
},
|
|
156
|
-
},
|
|
157
|
-
watch: {
|
|
158
|
-
initDateOne(newValue, oldValue) {
|
|
159
|
-
this.updateDateValue('dateOne', newValue, oldValue)
|
|
160
|
-
},
|
|
161
|
-
initDateTwo(newValue, oldValue) {
|
|
162
|
-
this.updateDateValue('dateTwo', newValue, oldValue)
|
|
163
|
-
},
|
|
164
|
-
},
|
|
165
|
-
methods: {
|
|
166
|
-
selectDate(dateType, dateValue) {
|
|
167
|
-
this[dateType] = dateValue
|
|
168
|
-
this.$emit('dates', [this.dateOne, ...(this.dateTwo && [this.dateTwo])])
|
|
169
|
-
},
|
|
170
|
-
updateDateValue(date, newValue, oldValue) {
|
|
171
|
-
if (newValue !== oldValue) {
|
|
172
|
-
this[date] = newValue
|
|
173
|
-
}
|
|
174
|
-
},
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
watch(
|
|
146
|
+
() => props.initDateTwo,
|
|
147
|
+
(newValue, oldValue) => {
|
|
148
|
+
updateDateValue('dateTwo', newValue, oldValue)
|
|
175
149
|
},
|
|
176
|
-
|
|
150
|
+
)
|
|
177
151
|
</script>
|
|
178
152
|
|
|
179
153
|
<style lang="scss">
|
|
@@ -16,31 +16,20 @@
|
|
|
16
16
|
</div>
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
|
-
<script setup>
|
|
19
|
+
<script setup lang="ts">
|
|
20
20
|
import { ref, computed, useSlots } from 'vue'
|
|
21
21
|
|
|
22
|
-
import { Intent } from '@/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
intent:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
title: {
|
|
35
|
-
type: String,
|
|
36
|
-
required: false,
|
|
37
|
-
default: '',
|
|
38
|
-
},
|
|
39
|
-
isClosable: {
|
|
40
|
-
type: Boolean,
|
|
41
|
-
required: false,
|
|
42
|
-
default: false,
|
|
43
|
-
},
|
|
22
|
+
import { Intent } from '@/constants'
|
|
23
|
+
|
|
24
|
+
interface Props {
|
|
25
|
+
intent: (typeof Intent)[keyof typeof Intent]['value']
|
|
26
|
+
isClosable?: boolean
|
|
27
|
+
title?: string
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
31
|
+
title: '',
|
|
32
|
+
isClosable: false,
|
|
44
33
|
})
|
|
45
34
|
|
|
46
35
|
const slots = useSlots()
|
|
@@ -49,7 +38,7 @@ const isDisplayed = ref(true)
|
|
|
49
38
|
|
|
50
39
|
const alertIcon = computed(() => {
|
|
51
40
|
const intentValues = Object.values(Intent)
|
|
52
|
-
return intentValues.find((intentItem) => intentItem.value === props.intent)
|
|
41
|
+
return intentValues.find((intentItem) => intentItem.value === props.intent)?.icon
|
|
53
42
|
})
|
|
54
43
|
|
|
55
44
|
const hasIconSlot = computed(() => !!slots.icon)
|
|
@@ -116,12 +105,12 @@ const dismissAlert = () => (isDisplayed.value = false)
|
|
|
116
105
|
}
|
|
117
106
|
|
|
118
107
|
&__icon,
|
|
119
|
-
&__content
|
|
120
|
-
&__title {
|
|
108
|
+
&__content {
|
|
121
109
|
line-height: fn.px-to-rem(19);
|
|
122
110
|
}
|
|
123
111
|
|
|
124
|
-
&
|
|
112
|
+
&__body > .cpHeading {
|
|
113
|
+
line-height: fn.px-to-rem(19);
|
|
125
114
|
color: inherit;
|
|
126
115
|
font-weight: 600;
|
|
127
116
|
|
|
@@ -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>
|