@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.
Files changed (187) hide show
  1. package/dist/{IconAccompaniedMinorEach-CUq3oXbX.js → IconAccompaniedMinorEach-MkIJAypb.js} +1 -1
  2. package/dist/{IconAccompaniedMinorNone-nZ4eSfTj.js → IconAccompaniedMinorNone-DMb-bSCG.js} +1 -1
  3. package/dist/{IconAccompaniedMinorOne-CDMqq14b.js → IconAccompaniedMinorOne-C9ORHm66.js} +1 -1
  4. package/dist/{IconAddReceipt-DRpGiWBU.js → IconAddReceipt-CeJlKuX2.js} +1 -1
  5. package/dist/{IconAirportTerminal-8k-3lKjb.js → IconAirportTerminal-D3p4CRpN.js} +1 -1
  6. package/dist/{IconArrival-m6HnOVje.js → IconArrival-C3oPAqgQ.js} +1 -1
  7. package/dist/IconBaggageCabinNone-valcCKfd.js +22 -0
  8. package/dist/IconBaggageCheckedNone-oq4yx5cO.js +22 -0
  9. package/dist/IconBaggagePersonalNone-BovIoK0M.js +20 -0
  10. package/dist/{IconBroadcast-B13UworG.js → IconBroadcast-CqdgVQaO.js} +1 -1
  11. package/dist/{IconCabinBag-CNnzHz2B.js → IconCabinBag-CMrtn-s6.js} +1 -1
  12. package/dist/IconCalendar-DmUZ-Du1.js +30 -0
  13. package/dist/IconCalendarDelay-DHaiharm.js +22 -0
  14. package/dist/{IconCheckedBaggage-CkxUDHe9.js → IconCheckedBaggage-OeOjHxe7.js} +1 -1
  15. package/dist/{IconCheckedBaggage20-DEtphLSa.js → IconCheckedBaggage20-CXeWuJgc.js} +1 -1
  16. package/dist/{IconCheckedBaggage30-CmAddx5h.js → IconCheckedBaggage30-Cartaaei.js} +1 -1
  17. package/dist/{IconChild-OReHyUco.js → IconChild-ChjkS7Gd.js} +1 -1
  18. package/dist/{IconContact-D2N23RZ5.js → IconContact-CtOxYQIs.js} +1 -1
  19. package/dist/{IconDeparture-D10LaXRX.js → IconDeparture-DJxClL94.js} +1 -1
  20. package/dist/{IconDistribution-SpPiru9I.js → IconDistribution-BmCLzb9p.js} +1 -1
  21. package/dist/{IconDistributionClosed-Bzqe7nju.js → IconDistributionClosed-BMjqoyt9.js} +1 -1
  22. package/dist/{IconDistributionExclusivePair-CjPM-_R1.js → IconDistributionExclusivePair-D71kgwyk.js} +1 -1
  23. package/dist/{IconDistributionSided-DehjCN0D.js → IconDistributionSided-Du56cPXR.js} +1 -1
  24. package/dist/{IconDistributionSupplySided-DWCyXqd1.js → IconDistributionSupplySided-BY9ACIGQ.js} +1 -1
  25. package/dist/{IconDynamicContent-BvzbgXvW.js → IconDynamicContent-DoYbB86x.js} +1 -1
  26. package/dist/IconEndDate-CVABdl-P.js +22 -0
  27. package/dist/{IconFares-zARDpPNl.js → IconFares-BXnx8WJa.js} +1 -1
  28. package/dist/{IconFaresOutlined-DLFV8nwg.js → IconFaresOutlined-CjJhZUKX.js} +1 -1
  29. package/dist/{IconFemale-Ba4uoI-S.js → IconFemale-D4lMoNKt.js} +1 -1
  30. package/dist/{IconFindConversation-d0pP3wG9.js → IconFindConversation-CYdB5hW8.js} +1 -1
  31. package/dist/{IconFire-CXzWKoMB.js → IconFire-Bh3vQ1A3.js} +1 -1
  32. package/dist/{IconFlight-Cof8M5dO.js → IconFlight-RyDIRwoI.js} +1 -1
  33. package/dist/{IconFlightReturn-CA9iGMcW.js → IconFlightReturn-DN7K5zxX.js} +1 -1
  34. package/dist/IconFlightSchedule-DAX_cnvF.js +28 -0
  35. package/dist/{IconHandHeart-CCLKnMOm.js → IconHandHeart-C5jxr29k.js} +1 -1
  36. package/dist/{IconHistory-DI6WD_3J.js → IconHistory-CuJwcjfY.js} +1 -1
  37. package/dist/{IconHourGlass-BorNLEca.js → IconHourGlass-DyrZPbXz.js} +1 -1
  38. package/dist/{IconIdCard-DhbhBkul.js → IconIdCard-lBDLYRPq.js} +1 -1
  39. package/dist/{IconInfant-D4EztT9g.js → IconInfant-E19ozPuk.js} +1 -1
  40. package/dist/{IconItinerary-Bhj_lgG2.js → IconItinerary-5AEG0f9f.js} +1 -1
  41. package/dist/{IconLeave-BvpY7gdD.js → IconLeave-XuFJRd-0.js} +1 -1
  42. package/dist/{IconMale-RMd_9ZSg.js → IconMale-R2ZgQj0s.js} +1 -1
  43. package/dist/{IconMultiSegments-DROUj0t5.js → IconMultiSegments-DfiqdUEm.js} +1 -1
  44. package/dist/IconNoPassport-h-6DjTcc.js +22 -0
  45. package/dist/{IconNoRefund-yNAZr7uX.js → IconNoRefund-C5R_Zxke.js} +1 -1
  46. package/dist/IconNoSeat-C-XnWQk8.js +23 -0
  47. package/dist/{IconNotion-CpZhGILz.js → IconNotion-pdx45QBU.js} +1 -1
  48. package/dist/{IconOffline-Bf1mw_1N.js → IconOffline-EG6mJ-Fs.js} +1 -1
  49. package/dist/{IconOneWay-6oGoLo57.js → IconOneWay-CX6CckSB.js} +2 -2
  50. package/dist/{IconPaid-B3dvioAR.js → IconPaid-BJhBGPy9.js} +1 -1
  51. package/dist/IconPassport-C6THdLYf.js +37 -0
  52. package/dist/{IconPayout-b3TcXwjA.js → IconPayout-MS-qRRR0.js} +1 -1
  53. package/dist/IconPlug-yYpQdJgj.js +22 -0
  54. package/dist/IconPlugOff-DSGcBog-.js +23 -0
  55. package/dist/{IconReceipt-Dh454941.js → IconReceipt-ChU6nBry.js} +1 -1
  56. package/dist/IconRecurrence-DtwCmoXo.js +22 -0
  57. package/dist/{IconRefund-D-FNjukU.js → IconRefund-D1wQXsZj.js} +1 -1
  58. package/dist/{IconRoundTrip-BqVPrNwg.js → IconRoundTrip-DhPU15r6.js} +1 -1
  59. package/dist/{IconRouteNoStop-CZ_QeOIY.js → IconRouteNoStop-C5b0NI9V.js} +1 -1
  60. package/dist/{IconRouteOneStop-DGpLAQmQ.js → IconRouteOneStop-CDL4AJoN.js} +1 -1
  61. package/dist/IconScheduleChange-CasvbB9p.js +22 -0
  62. package/dist/{IconSeatEmpty-BwyVwYQZ.js → IconSeatEmpty-CUDMQzqk.js} +1 -1
  63. package/dist/{IconSeatSold-B_SNoTs-.js → IconSeatSold-mwtkmlhT.js} +1 -1
  64. package/dist/{IconSeatTotal-DUEF7k6I.js → IconSeatTotal-BPegCOjA.js} +1 -1
  65. package/dist/IconStartDate-DoPJpEly.js +22 -0
  66. package/dist/{IconTemplate-D1ACYaHI.js → IconTemplate-CQH8r3U7.js} +1 -1
  67. package/dist/{IconTicket-5Z4b83BP.js → IconTicket-mONYGHBg.js} +1 -1
  68. package/dist/{IconTimer-DbcddAPo.js → IconTimer-BxR1ymxu.js} +1 -1
  69. package/dist/{IconTrafficControl-CEzhRpZt.js → IconTrafficControl-AcQHu-Dm.js} +1 -1
  70. package/dist/{index-DbgX3-2I.js → index-CjeXy6n3.js} +17600 -18506
  71. package/dist/pimp.es.js +1 -1
  72. package/dist/pimp.umd.js +23 -23
  73. package/dist/style.css +1 -1
  74. package/package.json +2 -1
  75. package/src/components/{core/BaseInputLabel.vue → BaseInputLabel.vue} +9 -15
  76. package/src/components/{core/BaseSelectClearButton.vue → BaseSelectClearButton.vue} +2 -2
  77. package/src/components/{atomic-elements/CpAirlineLogo.vue → CpAirlineLogo.vue} +9 -10
  78. package/src/components/{feedback-indicators/CpAlert.vue → CpAlert.vue} +16 -27
  79. package/src/components/{atomic-elements/CpBadge.vue → CpBadge.vue} +27 -44
  80. package/src/components/{buttons/CpButton.vue → CpButton.vue} +63 -104
  81. package/src/components/{date-pickers/CpCalendar.vue → CpCalendar.vue} +157 -156
  82. package/src/components/{toggles/CpCheckbox.vue → CpCheckbox.vue} +45 -54
  83. package/src/components/{date-pickers/CpDate.vue → CpDate.vue} +202 -212
  84. package/src/components/CpDatepicker.vue +203 -0
  85. package/src/components/{atomic-elements/CpDialog.vue → CpDialog.vue} +14 -9
  86. package/src/components/{typography/CpHeading.vue → CpHeading.vue} +11 -31
  87. package/src/components/{visual/CpIcon.vue → CpIcon.vue} +2 -1
  88. package/src/components/{inputs/CpInput.vue → CpInput.vue} +41 -58
  89. package/src/components/{feedback-indicators/CpLoader.vue → CpLoader.vue} +7 -8
  90. package/src/components/{selects/CpMultiselect.vue → CpMultiselect.vue} +60 -91
  91. package/src/components/{atomic-elements/CpPartnerBadge.vue → CpPartnerBadge.vue} +12 -20
  92. package/src/components/{toggles/CpRadio.vue → CpRadio.vue} +47 -58
  93. package/src/components/{selects/CpSelect.vue → CpSelect.vue} +74 -94
  94. package/src/components/{selects/CpSelectMenu.vue → CpSelectMenu.vue} +94 -96
  95. package/src/components/{toggles/CpSwitch.vue → CpSwitch.vue} +51 -67
  96. package/src/components/{lists-and-table/CpTable.vue → CpTable.vue} +159 -113
  97. package/src/components/{lists-and-table/CpTableEmptyState.vue → CpTableEmptyState.vue} +5 -8
  98. package/src/components/{inputs/CpTextarea.vue → CpTextarea.vue} +32 -52
  99. package/src/components/CpToaster.vue +377 -0
  100. package/src/components/{atomic-elements/CpTooltip.vue → CpTooltip.vue} +12 -11
  101. package/src/components/TransitionExpand.vue +70 -0
  102. package/src/components/icons/IconBaggageCabinNone.vue +24 -0
  103. package/src/components/icons/IconBaggageCheckedNone.vue +25 -0
  104. package/src/components/icons/IconBaggagePersonalNone.vue +33 -0
  105. package/src/components/icons/IconCalendar.vue +17 -0
  106. package/src/components/icons/IconCalendarDelay.vue +21 -0
  107. package/src/components/icons/IconEndDate.vue +19 -0
  108. package/src/components/icons/IconFlightSchedule.vue +23 -0
  109. package/src/components/icons/IconNoPassport.vue +23 -24
  110. package/src/components/icons/IconNoSeat.vue +18 -0
  111. package/src/components/icons/IconOneWay.vue +1 -1
  112. package/src/components/icons/IconPassport.vue +15 -22
  113. package/src/components/icons/IconPlug.vue +17 -0
  114. package/src/components/icons/IconPlugOff.vue +18 -0
  115. package/src/components/icons/IconRecurrence.vue +17 -8
  116. package/src/components/icons/IconScheduleChange.vue +17 -26
  117. package/src/components/icons/IconStartDate.vue +19 -0
  118. package/src/components/index.ts +43 -55
  119. package/src/constants/{src/CpCustomIcons.ts → CpCustomIcons.ts} +13 -2
  120. package/src/constants/CpTableConfig.ts +12 -0
  121. package/src/constants/Heading.ts +8 -0
  122. package/src/{utils/constants/src/Intent.js → constants/Intent.ts} +1 -1
  123. package/src/constants/PartnerTypes.ts +6 -0
  124. package/src/constants/Position.ts +10 -0
  125. package/src/constants/Sizes.ts +5 -0
  126. package/src/constants/colors/Colors.ts +10 -0
  127. package/src/constants/colors/ToggleColors.ts +6 -0
  128. package/src/constants/index.ts +10 -5
  129. package/src/directives/ClickOutside.ts +17 -0
  130. package/src/directives/{ResizeSelect.js → ResizeSelect.ts} +3 -3
  131. package/src/helpers/{dom.js → dom.ts} +13 -9
  132. package/src/helpers/{index.js → index.ts} +13 -3
  133. package/src/helpers/object.ts +9 -0
  134. package/src/helpers/string/src/camelize.ts +6 -0
  135. package/src/helpers/string/src/{decamelize.js → decamelize.ts} +1 -1
  136. package/src/libs/CoreDatepicker.vue +4 -4
  137. package/src/plugins/toaster.ts +71 -0
  138. package/src/stories/BaseInputLabel.stories.ts +2 -1
  139. package/src/stories/CpAirlineLogo.stories.ts +1 -1
  140. package/src/stories/CpAlert.stories.ts +2 -1
  141. package/src/stories/CpBadge.stories.ts +1 -1
  142. package/src/stories/CpButton.stories.ts +1 -1
  143. package/src/stories/CpCheckbox.stories.ts +4 -2
  144. package/src/stories/CpDate.stories.ts +4 -2
  145. package/src/stories/CpDatepicker.stories.ts +4 -2
  146. package/src/stories/CpDialog.stories.ts +3 -2
  147. package/src/stories/CpHeading.stories.ts +2 -1
  148. package/src/stories/CpIcon.stories.ts +3 -1
  149. package/src/stories/CpInput.stories.ts +4 -2
  150. package/src/stories/CpLoader.stories.ts +2 -1
  151. package/src/stories/CpMultiselect.stories.ts +3 -2
  152. package/src/stories/CpPartnerBadge.stories.ts +2 -2
  153. package/src/stories/CpRadio.stories.ts +4 -2
  154. package/src/stories/CpSelect.stories.ts +4 -2
  155. package/src/stories/CpSelectMenu.stories.ts +4 -2
  156. package/src/stories/CpSwitch.stories.ts +4 -2
  157. package/src/stories/CpTable.stories.ts +9 -2
  158. package/src/stories/CpTableEmptyState.stories.ts +2 -1
  159. package/src/stories/CpTextarea.stories.ts +4 -2
  160. package/src/stories/CpToaster.stories.ts +2 -1
  161. package/src/stories/CpTooltip.stories.ts +2 -1
  162. package/src/stories/TransitionExpand.stories.ts +4 -2
  163. package/src/types/luxon.d.ts +1 -0
  164. package/src/vendors/ff-polyfill.ts +38 -0
  165. package/vitest.workspace.js +1 -3
  166. package/dist/IconNoPassport-DBmaQH_g.js +0 -18
  167. package/dist/IconPassport-5SwUf6_R.js +0 -20
  168. package/dist/IconRecurrence-CXVkBJ3i.js +0 -24
  169. package/dist/IconScheduleChange-CEIGEhU4.js +0 -19
  170. package/src/components/date-pickers/CpDatepicker.vue +0 -229
  171. package/src/components/feedback-indicators/CpToaster.vue +0 -372
  172. package/src/components/helpers-utilities/TransitionExpand.vue +0 -72
  173. package/src/constants/src/CpTableConfig.ts +0 -14
  174. package/src/constants/src/Position.ts +0 -10
  175. package/src/constants/src/colors/Colors.ts +0 -10
  176. package/src/constants/src/colors/ToggleColors.ts +0 -6
  177. package/src/directives/ClickOutside.js +0 -13
  178. package/src/helpers/object.js +0 -9
  179. package/src/helpers/string/src/camelize.js +0 -6
  180. package/src/plugins/toaster.js +0 -61
  181. package/src/utils/constants/index.js +0 -3
  182. package/src/utils/constants/src/PartnerTypes.js +0 -6
  183. package/src/utils/constants/src/Sizes.js +0 -5
  184. package/src/vendors/ff-polyfill.js +0 -36
  185. /package/src/components/{atomic-elements/CpDialogWrapper.vue → CpDialogWrapper.vue} +0 -0
  186. /package/src/components/{logo/Pimp.vue → Pimp.vue} +0 -0
  187. /package/src/helpers/string/{index.js → index.ts} +0 -0
@@ -1,19 +0,0 @@
1
- import { createElementBlock as o, openBlock as e, createStaticVNode as n } from "vue";
2
- import { _ as r } from "./index-DbgX3-2I.js";
3
- const i = {}, d = {
4
- width: "24",
5
- height: "25",
6
- viewBox: "0 0 24 25",
7
- fill: "none",
8
- xmlns: "http://www.w3.org/2000/svg",
9
- stroke: "#3E3E5B"
10
- };
11
- function s(a, t) {
12
- return e(), o("svg", d, t[0] || (t[0] = [
13
- n('<path d="M18.3431 9.31279V6.16077C18.3431 5.0562 17.4476 4.16077 16.3431 4.16077H4.50354C3.39897 4.16077 2.50354 5.0562 2.50354 6.16077V18.0003C2.50354 19.1049 3.39897 20.0003 4.50354 20.0003H6.11962" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path><path d="M13.9432 2.40076V5.92065" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path><path d="M6.90344 2.40076V5.92065" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path><path d="M2.50354 9.44055H18.3431" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path><path d="M15.9196 14.4542V17.8002L18.1502 18.9156" stroke-width="1.78937" stroke-linecap="round" stroke-linejoin="round"></path><path d="M10.3429 17.8002C10.3429 14.7202 12.8397 12.2235 15.9196 12.2235C18.9995 12.2235 21.4963 14.7202 21.4963 17.8002C21.4963 20.8462 19.005 23.3771 15.9196 23.3771" stroke-width="1.78937" stroke-linecap="round" stroke-linejoin="round"></path><path d="M8.96887 17.1132L10.3429 18.4872L11.7169 17.1132" stroke-width="1.78937" stroke-linecap="round" stroke-linejoin="round"></path>', 7)
14
- ]));
15
- }
16
- const k = /* @__PURE__ */ r(i, [["render", s]]);
17
- export {
18
- k as default
19
- };
@@ -1,229 +0,0 @@
1
- <template>
2
- <div class="cpDatepicker">
3
- <cp-input
4
- v-show="!isInline"
5
- :id="datePickerReferenceId"
6
- :model-value="inputComputedValue"
7
- type="text"
8
- :placeholder="placeholder"
9
- :is-invalid="isError"
10
- :error-message="errorMessage"
11
- :disabled="isDisabled"
12
- :label="label"
13
- class="cpDatepicker__input"
14
- />
15
- <core-datepicker
16
- :date-one="dateOne"
17
- :date-two="dateTwo"
18
- :trigger-element-id="datePickerReferenceId"
19
- :close-after-select="closeAfterSelect"
20
- :mode="mode"
21
- :inline="isInline"
22
- :months-to-show="numberOfMonths"
23
- :min-date="computedMinDate"
24
- :max-date="maxDate"
25
- :locale="locale"
26
- class="cpDatepicker__datepicker"
27
- :class="{ 'cpDatepicker__datepicker--isInline': isInline }"
28
- @date-one-selected="(date) => selectDate('dateOne', date)"
29
- @date-two-selected="(date) => selectDate('dateTwo', date)"
30
- @opened="() => (isDisabled = true)"
31
- @closed="() => (isDisabled = null)"
32
- />
33
- </div>
34
- </template>
35
-
36
- <script>
37
- import CoreDatepicker from '@/libs/CoreDatepicker.vue'
38
- import CpInput from '@/components/inputs/CpInput.vue'
39
- import { randomString, formatDates } from '@/helpers'
40
- import { DateTime } from 'luxon'
41
-
42
- export default {
43
- name: 'CpDatepicker',
44
- components: {
45
- CoreDatepicker,
46
- CpInput,
47
- },
48
- props: {
49
- triggerElementId: {
50
- type: String,
51
- default: '',
52
- },
53
- mode: {
54
- type: String,
55
- default: 'single',
56
- validator: (value) => {
57
- return ['range', 'single'].includes(value)
58
- },
59
- },
60
- closeAfterSelect: {
61
- type: Boolean,
62
- default: true,
63
- },
64
- label: {
65
- type: String,
66
- default: '',
67
- },
68
- placeholder: {
69
- type: String,
70
- default: 'Select a date',
71
- },
72
- inputValue: {
73
- type: String,
74
- default: '',
75
- },
76
- isError: {
77
- type: Boolean,
78
- default: false,
79
- },
80
- errorMessage: {
81
- type: String,
82
- default: '',
83
- },
84
- initDateOne: {
85
- type: String,
86
- default: '',
87
- validator: (value) => {
88
- return value === '' || value.length === 10
89
- },
90
- },
91
- initDateTwo: {
92
- type: String,
93
- default: '',
94
- validator: (value) => {
95
- return value === '' || value.length === 10
96
- },
97
- },
98
- minDate: {
99
- type: [String, Date],
100
- default: () => DateTime.local().toISODate(),
101
- },
102
- maxDate: {
103
- type: [String, Date],
104
- default: '',
105
- },
106
- allowPastDates: {
107
- type: Boolean,
108
- default: false,
109
- },
110
- isInline: {
111
- type: Boolean,
112
- default: false,
113
- },
114
- singleMonth: {
115
- type: Boolean,
116
- default: false,
117
- },
118
- locale: {
119
- type: String,
120
- default: () => {
121
- return navigator.language
122
- },
123
- },
124
- },
125
- emits: ['dates'],
126
- data() {
127
- return {
128
- calendarFormat: 'YYYY-MM-DD',
129
- humanFormat: 'EEE DD',
130
- dateOne: this.initDateOne || '',
131
- dateTwo: this.mode === 'range' ? this.initDateTwo : '',
132
- isDisabled: null,
133
- datePickerReferenceId: this.triggerElementId || randomString(),
134
- }
135
- },
136
- computed: {
137
- inputComputedValue() {
138
- if (this.inputValue) return this.inputValue
139
-
140
- return formatDates({
141
- dateOne: this.dateOne,
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
- },
175
- },
176
- }
177
- </script>
178
-
179
- <style lang="scss">
180
- .cpDatepicker {
181
- // Opening transition layout adaptation
182
- .asd__fade-enter-from {
183
- transform: translateX(-50%) scale(0.8);
184
- }
185
-
186
- .asd__fade-enter-to {
187
- transform: translateX(-50%) scale(1);
188
- }
189
-
190
- &__input input:disabled {
191
- background-color: colors.$neutral-light;
192
- }
193
-
194
- &__datepicker {
195
- position: absolute;
196
- left: 50%;
197
- transform: translateX(-50%);
198
- }
199
-
200
- &__datepicker:not(&__datepicker--isInline) {
201
- margin-top: 10px;
202
- }
203
-
204
- @media (min-width: 350px) {
205
- position: relative;
206
- }
207
-
208
- @media (max-width: 767px) and (min-width: 350px) {
209
- &__datepicker {
210
- left: 0;
211
- right: 0;
212
- transform: initial;
213
- }
214
-
215
- &__datepicker:not(&__datepicker--isInline) {
216
- margin-top: 16px;
217
- }
218
-
219
- // Opening transition layout adaptation
220
- .asd__fade-enter-from {
221
- transform: scale(0.8);
222
- }
223
-
224
- .asd__fade-enter-to {
225
- transform: scale(1);
226
- }
227
- }
228
- }
229
- </style>
@@ -1,372 +0,0 @@
1
- <template>
2
- <transition @enter="enter" @leave="leave">
3
- <div
4
- v-show="isOpen"
5
- :id="toasterId"
6
- :key="toasterId"
7
- class="cpToaster"
8
- :class="dynamicClass"
9
- role="alert"
10
- @mouseenter="setHoverState()"
11
- @mouseleave="setHoverState(false)"
12
- >
13
- <div class="cpToaster__content">
14
- <cp-icon :type="toasterIcon" class="cpToaster__icon" />
15
- <div class="cpToaster__body">
16
- <cp-heading heading-level="h4" :size="400" class="cpToaster__title">{{ title }}</cp-heading>
17
- <p v-if="description" class="cpToaster__description">{{ description }}</p>
18
- </div>
19
- </div>
20
- <button type="button" class="cpToaster__close" @click="closeToaster"><cp-icon type="x" /></button>
21
- <div v-if="actionLabel" class="cpToaster__footer">
22
- <button type="button" class="cpToaster__button" @click="handleActionMethod">
23
- {{ actionLabel }}
24
- </button>
25
- </div>
26
- </div>
27
- </transition>
28
- </template>
29
-
30
- <script>
31
- import { animate } from 'animejs'
32
-
33
- import { Intent } from '@/utils/constants'
34
- import { randomString } from '@/helpers'
35
-
36
- import CpHeading from '@/components/typography/CpHeading.vue'
37
- import CpIcon from '@/components/visual/CpIcon.vue'
38
-
39
- export default {
40
- name: 'CpToaster',
41
- components: {
42
- CpHeading,
43
- CpIcon,
44
- },
45
- props: {
46
- title: {
47
- type: String,
48
- required: true,
49
- default: '',
50
- },
51
- description: {
52
- type: String,
53
- required: false,
54
- default: '',
55
- },
56
- type: {
57
- type: String,
58
- required: false,
59
- default: 'info',
60
- validator(value) {
61
- const intentValues = Object.values(Intent).map((item) => item.value)
62
- return intentValues.includes(value)
63
- },
64
- },
65
- delayBeforeCloseInMs: {
66
- type: Number,
67
- required: false,
68
- default: 5000,
69
- },
70
- actionLabel: {
71
- type: String,
72
- required: false,
73
- default: '',
74
- },
75
- actionMethod: {
76
- type: Function,
77
- required: false,
78
- default: () => {},
79
- },
80
- isUnique: {
81
- type: Boolean,
82
- default: false,
83
- },
84
- },
85
- data() {
86
- return {
87
- toasterId: null,
88
- toastersContainer: null,
89
- isOpen: false,
90
- isHovered: false,
91
- deleteCountDown: this.delayBeforeCloseInMs,
92
- timeoutID: null,
93
- countDownInterval: null,
94
- publicProperties: ['closeToaster'],
95
- }
96
- },
97
- computed: {
98
- toasterIcon() {
99
- const intentValues = Object.values(Intent)
100
- const intent = intentValues.find((intentItem) => intentItem.value === this.type)
101
- return intent ? intent.icon : Intent.INFO.icon
102
- },
103
- dynamicClass() {
104
- return `cpToaster--${this.type || Intent.INFO.value}`
105
- },
106
- },
107
- watch: {
108
- isHovered(newValue) {
109
- if (!newValue) {
110
- this.handleDeleteEvent()
111
- } else {
112
- this.cancelDelete()
113
- }
114
- },
115
- },
116
- beforeMount() {
117
- this.createContainer()
118
- this.setupContainer()
119
- this.removeSiblings()
120
- this.setToasterId()
121
- },
122
- mounted() {
123
- this.showToaster()
124
- this.handleDeleteEvent()
125
- },
126
- methods: {
127
- createContainer() {
128
- this.toastersContainer = document.querySelector('.cpToaster__container')
129
-
130
- if (this.toastersContainer) return
131
-
132
- if (!this.toastersContainer) {
133
- this.toastersContainer = document.createElement('section')
134
- this.toastersContainer.className = 'cpToaster__container'
135
- }
136
- },
137
- setupContainer() {
138
- document.body.appendChild(this.toastersContainer)
139
- },
140
- removeSiblings() {
141
- if (!this.isUnique) return
142
-
143
- const siblings = document.querySelectorAll('.cpToaster')
144
- siblings.forEach(this.removeElement)
145
- },
146
- setToasterId() {
147
- this.toasterId = randomString()
148
- },
149
- showToaster() {
150
- this.isOpen = true
151
-
152
- this.$nextTick(() => {
153
- this.toastersContainer.insertAdjacentElement('afterbegin', this.$el)
154
- })
155
- },
156
- setHoverState(state = true) {
157
- this.isHovered = state
158
- },
159
- handleDeleteEvent() {
160
- this.startCountDown()
161
-
162
- this.timeoutID = setTimeout(() => {
163
- this.closeToaster()
164
- }, this.delayBeforeCloseInMs)
165
- },
166
- cancelDelete() {
167
- clearTimeout(this.timeoutID)
168
- clearInterval(this.countDownInterval)
169
- this.resetCountDown()
170
- },
171
- startCountDown() {
172
- this.countDownInterval = setInterval(() => {
173
- this.deleteCountDown -= 1000
174
- if (this.deleteCountDown <= 0) {
175
- clearInterval(this.countDownInterval)
176
- }
177
- }, 1000)
178
- },
179
- resetCountDown() {
180
- const delay = this.delayBeforeCloseInMs
181
- this.deleteCountDown = delay
182
- },
183
- handleActionMethod() {
184
- // Unexpected aliasing of 'this' to local variable @typescript-eslint/no-this-alias
185
- // eslint-disable-next-line
186
- const vm = this
187
- const vmProperties = Object.keys(vm)
188
- .filter((key) => this.publicProperties.includes(key))
189
- .reduce((allowedProperties, key) => {
190
- allowedProperties[key] = vm[key]
191
- return allowedProperties
192
- }, {})
193
- return this.actionMethod(vmProperties)
194
- },
195
- closeToaster() {
196
- this.cancelDelete()
197
- this.isOpen = false
198
-
199
- setTimeout(() => {
200
- this.removeElement(this.$el)
201
- }, 240)
202
- },
203
- removeElement(el) {
204
- if (typeof el.remove !== 'undefined') {
205
- el.remove()
206
- } else {
207
- el.parentNode.removeChild(el)
208
- }
209
- },
210
- async enter(el, done) {
211
- animate(el, {
212
- translateY: [-60, 0],
213
- opacity: [0, 1],
214
- duration: 240,
215
- ease: 'cubicBezier(0.175, 0.885, 0.32, 1.175)',
216
- complete: function () {
217
- done()
218
- },
219
- })
220
- },
221
- async leave(el, done) {
222
- animate(el, {
223
- scale: [1, 0.8],
224
- opacity: [1, 0],
225
- duration: 240,
226
- ease: 'cubicBezier(0.0, 0.0, 0.2, 1)',
227
- complete: function () {
228
- done()
229
- },
230
- })
231
- },
232
- },
233
- }
234
- </script>
235
-
236
- <style lang="scss">
237
- @mixin cp-toaster-style($color, $className) {
238
- &--#{$className} &__icon {
239
- color: $color;
240
- }
241
-
242
- &--#{$className}:before {
243
- background-color: $color;
244
- }
245
- }
246
-
247
- .cpToaster {
248
- position: relative;
249
- box-shadow:
250
- rgba(67, 90, 111, 0.3) 0 0 1px,
251
- rgba(67, 90, 111, 0.47) 0 8px 10px -4px;
252
- background: colors.$neutral-light;
253
- padding: sp.$space-md;
254
- overflow: hidden;
255
- width: max-content;
256
- max-width: 100%;
257
- margin: auto;
258
- pointer-events: auto;
259
- font-size: fn.px-to-rem(14);
260
-
261
- @media (min-width: 769px) {
262
- border-radius: fn.px-to-rem(8);
263
- }
264
-
265
- @media (max-width: 768px) {
266
- min-width: 100%;
267
- }
268
-
269
- &:before {
270
- content: '';
271
- position: absolute;
272
- top: 0;
273
- left: 0;
274
- width: fn.px-to-rem(3);
275
- height: 100%;
276
- }
277
-
278
- &__container {
279
- position: fixed;
280
- z-index: 9999;
281
- top: 0;
282
- left: 0;
283
- right: 0;
284
- margin: auto;
285
- padding: sp.$space-lg;
286
- max-width: fn.px-to-rem(400);
287
- pointer-events: none;
288
-
289
- & > *:not(:last-child) {
290
- margin-bottom: sp.$space;
291
- }
292
-
293
- @media (max-width: 768px) {
294
- max-width: 100%;
295
- }
296
- }
297
-
298
- &__content {
299
- display: flex;
300
- align-items: flex-start;
301
- }
302
-
303
- &__body {
304
- flex: 1;
305
- margin-left: sp.$space;
306
- padding-right: calc(sp.$space-lg + sp.$space-lg);
307
- }
308
-
309
- &__icon {
310
- flex-shrink: 0;
311
- height: fn.px-to-rem(16);
312
- width: fn.px-to-rem(16);
313
- }
314
-
315
- &__content,
316
- &__title {
317
- line-height: fn.px-to-rem(16);
318
- }
319
-
320
- &__title {
321
- font-weight: 600;
322
-
323
- &:not(:only-child) {
324
- margin-bottom: sp.$space-sm;
325
- }
326
- }
327
-
328
- &__description {
329
- font-size: fn.px-to-rem(14);
330
- }
331
-
332
- &__close {
333
- position: absolute;
334
- right: sp.$space;
335
- top: sp.$space;
336
- display: flex;
337
- border-radius: fn.px-to-rem(4);
338
- padding: sp.$space-sm;
339
- color: colors.$neutral-dark-1;
340
-
341
- svg {
342
- margin: 0;
343
- width: fn.px-to-rem(18);
344
- height: fn.px-to-rem(18);
345
- }
346
-
347
- &:hover {
348
- background-color: rgba(colors.$neutral-dark-1, 0.1);
349
- }
350
- }
351
-
352
- &__footer {
353
- display: flex;
354
- justify-content: flex-end;
355
- margin-top: sp.$space-lg;
356
- }
357
-
358
- &__button {
359
- font-size: fn.px-to-rem(12);
360
- color: colors.$secondary-color;
361
-
362
- &:not(:hover) {
363
- text-decoration: underline;
364
- }
365
- }
366
-
367
- @include cp-toaster-style(colors.$secondary-color, 'info');
368
- @include cp-toaster-style(colors.$warning-color, 'warning');
369
- @include cp-toaster-style(colors.$success-color, 'success');
370
- @include cp-toaster-style(colors.$error-color, 'critical');
371
- }
372
- </style>
@@ -1,72 +0,0 @@
1
- <template>
2
- <transition name="expand" @enter="enter" @after-enter="afterEnter" @leave="leave">
3
- <slot />
4
- </transition>
5
- </template>
6
-
7
- <script>
8
- export default {
9
- methods: {
10
- afterEnter(element) {
11
- element.style.height = `auto`
12
- },
13
- enter(element) {
14
- const { width } = getComputedStyle(element)
15
-
16
- element.style.width = width
17
- element.style.position = `absolute`
18
- element.style.visibility = `hidden`
19
- element.style.height = `auto`
20
-
21
- const { height } = getComputedStyle(element)
22
-
23
- element.style.width = null
24
- element.style.position = null
25
- element.style.visibility = null
26
- element.style.height = 0
27
-
28
- // Force repaint to make sure the
29
- // animation is triggered correctly.
30
- requestAnimationFrame(() => {
31
- element.style.height = height
32
- })
33
- },
34
- leave(element) {
35
- const { height } = getComputedStyle(element)
36
-
37
- element.style.height = height
38
-
39
- // Force repaint to make sure the
40
- // animation is triggered correctly.
41
- requestAnimationFrame(() => {
42
- element.style.height = 0
43
- })
44
- },
45
- },
46
- }
47
- </script>
48
-
49
- <style scoped>
50
- * {
51
- will-change: height;
52
- transform: translateZ(0);
53
- backface-visibility: hidden;
54
- perspective: 1000px;
55
- }
56
- </style>
57
-
58
- <style lang="scss">
59
- .expand-enter-active,
60
- .expand-leave-active {
61
- transition-property: opacity, height;
62
- transition-duration: 0.2s;
63
- transition-timing-function: ease-out;
64
- overflow: hidden;
65
- }
66
-
67
- .expand-enter-from,
68
- .expand-leave-to {
69
- height: 0;
70
- opacity: 0;
71
- }
72
- </style>
@@ -1,14 +0,0 @@
1
- const VISIBLE_ROWS_MAX = 100
2
-
3
- const RESERVED_KEYS = {
4
- GROUP_BY: 'groupBy',
5
- FULL_WIDTH: 'fullWidth',
6
- IS_SELECTED: 'isSelected',
7
- }
8
-
9
- const PAGINATION_FORMATS = {
10
- RESULTS: 'results',
11
- PAGES: 'pages',
12
- }
13
-
14
- export default { VISIBLE_ROWS_MAX, RESERVED_KEYS, PAGINATION_FORMATS }
@@ -1,10 +0,0 @@
1
- export default {
2
- TOP: 'top',
3
- TOP_LEFT: 'top-left',
4
- TOP_RIGHT: 'top-right',
5
- BOTTOM: 'bottom',
6
- BOTTOM_LEFT: 'bottom-left',
7
- BOTTOM_RIGHT: 'bottom-right',
8
- LEFT: 'left',
9
- RIGHT: 'right',
10
- }