@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.
Files changed (149) hide show
  1. package/dist/{IconAccompaniedMinorEach-CUq3oXbX.js → IconAccompaniedMinorEach-BJYaPpW3.js} +1 -1
  2. package/dist/{IconAccompaniedMinorNone-nZ4eSfTj.js → IconAccompaniedMinorNone-D1JR2Qpd.js} +1 -1
  3. package/dist/{IconAccompaniedMinorOne-CDMqq14b.js → IconAccompaniedMinorOne-BJ3jzEDZ.js} +1 -1
  4. package/dist/{IconAddReceipt-DRpGiWBU.js → IconAddReceipt-BX_va94f.js} +1 -1
  5. package/dist/{IconAirportTerminal-8k-3lKjb.js → IconAirportTerminal-Dzr98nfc.js} +1 -1
  6. package/dist/{IconArrival-m6HnOVje.js → IconArrival-Ced9HrJH.js} +1 -1
  7. package/dist/{IconBroadcast-B13UworG.js → IconBroadcast-BYX44Wak.js} +1 -1
  8. package/dist/{IconCabinBag-CNnzHz2B.js → IconCabinBag-D1Qs952U.js} +1 -1
  9. package/dist/{IconCheckedBaggage-CkxUDHe9.js → IconCheckedBaggage-Q4_SQL9l.js} +1 -1
  10. package/dist/{IconCheckedBaggage20-DEtphLSa.js → IconCheckedBaggage20-DVH1-A0V.js} +1 -1
  11. package/dist/{IconCheckedBaggage30-CmAddx5h.js → IconCheckedBaggage30-DYOAf-7Z.js} +1 -1
  12. package/dist/{IconChild-OReHyUco.js → IconChild-BeCLAr8Y.js} +1 -1
  13. package/dist/{IconContact-D2N23RZ5.js → IconContact-B3r39fyI.js} +1 -1
  14. package/dist/{IconDeparture-D10LaXRX.js → IconDeparture-BflKZUiE.js} +1 -1
  15. package/dist/{IconDistribution-SpPiru9I.js → IconDistribution-CBxQ7UWb.js} +1 -1
  16. package/dist/{IconDistributionClosed-Bzqe7nju.js → IconDistributionClosed-BWp_k24K.js} +1 -1
  17. package/dist/{IconDistributionExclusivePair-CjPM-_R1.js → IconDistributionExclusivePair-erLbcLps.js} +1 -1
  18. package/dist/{IconDistributionSided-DehjCN0D.js → IconDistributionSided-y000n4qB.js} +1 -1
  19. package/dist/{IconDistributionSupplySided-DWCyXqd1.js → IconDistributionSupplySided-7kCvGwnz.js} +1 -1
  20. package/dist/{IconDynamicContent-BvzbgXvW.js → IconDynamicContent-SwBxkPMB.js} +1 -1
  21. package/dist/{IconFares-zARDpPNl.js → IconFares-DTm0Q_RI.js} +1 -1
  22. package/dist/{IconFaresOutlined-DLFV8nwg.js → IconFaresOutlined-BFMo_x9Q.js} +1 -1
  23. package/dist/{IconFemale-Ba4uoI-S.js → IconFemale-Ma0KeaEM.js} +1 -1
  24. package/dist/{IconFindConversation-d0pP3wG9.js → IconFindConversation-CpsDYPgD.js} +1 -1
  25. package/dist/{IconFire-CXzWKoMB.js → IconFire-DECrDnLM.js} +1 -1
  26. package/dist/{IconFlight-Cof8M5dO.js → IconFlight-D5M0A0CM.js} +1 -1
  27. package/dist/{IconFlightReturn-CA9iGMcW.js → IconFlightReturn-CTvqEFME.js} +1 -1
  28. package/dist/{IconHandHeart-CCLKnMOm.js → IconHandHeart-ChgdfXQa.js} +1 -1
  29. package/dist/{IconHistory-DI6WD_3J.js → IconHistory-DpIXDYI5.js} +1 -1
  30. package/dist/{IconHourGlass-BorNLEca.js → IconHourGlass-CIRkFUSM.js} +1 -1
  31. package/dist/{IconIdCard-DhbhBkul.js → IconIdCard-UD5VZsUi.js} +1 -1
  32. package/dist/{IconInfant-D4EztT9g.js → IconInfant-CmLUvWpO.js} +1 -1
  33. package/dist/{IconItinerary-Bhj_lgG2.js → IconItinerary-CY8irele.js} +1 -1
  34. package/dist/{IconLeave-BvpY7gdD.js → IconLeave-C3bpPz6L.js} +1 -1
  35. package/dist/{IconMale-RMd_9ZSg.js → IconMale-x4xdulWB.js} +1 -1
  36. package/dist/{IconMultiSegments-DROUj0t5.js → IconMultiSegments-BhTMfvhQ.js} +1 -1
  37. package/dist/{IconNoPassport-DBmaQH_g.js → IconNoPassport-_Xm76k6b.js} +1 -1
  38. package/dist/{IconNoRefund-yNAZr7uX.js → IconNoRefund-B78s0oyF.js} +1 -1
  39. package/dist/{IconNotion-CpZhGILz.js → IconNotion-C22PTLTU.js} +1 -1
  40. package/dist/{IconOffline-Bf1mw_1N.js → IconOffline-BDzikWE9.js} +1 -1
  41. package/dist/{IconOneWay-6oGoLo57.js → IconOneWay-DlTVxokv.js} +2 -2
  42. package/dist/{IconPaid-B3dvioAR.js → IconPaid-DmGERe85.js} +1 -1
  43. package/dist/{IconPassport-5SwUf6_R.js → IconPassport-6VOlXjxJ.js} +1 -1
  44. package/dist/{IconPayout-b3TcXwjA.js → IconPayout-abr6BXCd.js} +1 -1
  45. package/dist/{IconReceipt-Dh454941.js → IconReceipt-BnTaihcq.js} +1 -1
  46. package/dist/{IconRecurrence-CXVkBJ3i.js → IconRecurrence-C5TPG2ht.js} +1 -1
  47. package/dist/{IconRefund-D-FNjukU.js → IconRefund-Ysv8pyMJ.js} +1 -1
  48. package/dist/{IconRoundTrip-BqVPrNwg.js → IconRoundTrip-CIVDw8LK.js} +1 -1
  49. package/dist/{IconRouteNoStop-CZ_QeOIY.js → IconRouteNoStop-DQrq4gW5.js} +1 -1
  50. package/dist/{IconRouteOneStop-DGpLAQmQ.js → IconRouteOneStop-pzisj4i4.js} +1 -1
  51. package/dist/{IconScheduleChange-CEIGEhU4.js → IconScheduleChange-BONs1AAT.js} +1 -1
  52. package/dist/{IconSeatEmpty-BwyVwYQZ.js → IconSeatEmpty-CHij3aGA.js} +1 -1
  53. package/dist/{IconSeatSold-B_SNoTs-.js → IconSeatSold-QspS_zCh.js} +1 -1
  54. package/dist/{IconSeatTotal-DUEF7k6I.js → IconSeatTotal-DTZ1TcAX.js} +1 -1
  55. package/dist/{IconTemplate-D1ACYaHI.js → IconTemplate-BDmmr-9L.js} +1 -1
  56. package/dist/{IconTicket-5Z4b83BP.js → IconTicket--vVn61Ey.js} +1 -1
  57. package/dist/{IconTimer-DbcddAPo.js → IconTimer-CspKpwqZ.js} +1 -1
  58. package/dist/{IconTrafficControl-CEzhRpZt.js → IconTrafficControl-DBamcJNe.js} +1 -1
  59. package/dist/{index-DbgX3-2I.js → index-C3oHnZQk.js} +9166 -10083
  60. package/dist/pimp.es.js +1 -1
  61. package/dist/pimp.umd.js +17 -17
  62. package/dist/style.css +1 -1
  63. package/package.json +2 -1
  64. package/src/components/atomic-elements/CpAirlineLogo.vue +9 -10
  65. package/src/components/atomic-elements/CpBadge.vue +27 -44
  66. package/src/components/atomic-elements/CpDialog.vue +14 -9
  67. package/src/components/atomic-elements/CpPartnerBadge.vue +12 -20
  68. package/src/components/atomic-elements/CpTooltip.vue +12 -11
  69. package/src/components/buttons/CpButton.vue +63 -104
  70. package/src/components/core/BaseInputLabel.vue +9 -15
  71. package/src/components/core/BaseSelectClearButton.vue +1 -1
  72. package/src/components/date-pickers/CpCalendar.vue +154 -153
  73. package/src/components/date-pickers/CpDate.vue +202 -212
  74. package/src/components/date-pickers/CpDatepicker.vue +112 -138
  75. package/src/components/feedback-indicators/CpAlert.vue +16 -27
  76. package/src/components/feedback-indicators/CpLoader.vue +7 -8
  77. package/src/components/feedback-indicators/CpToaster.vue +197 -192
  78. package/src/components/helpers-utilities/TransitionExpand.vue +31 -33
  79. package/src/components/icons/IconOneWay.vue +1 -1
  80. package/src/components/index.ts +28 -40
  81. package/src/components/inputs/CpInput.vue +40 -57
  82. package/src/components/inputs/CpTextarea.vue +30 -50
  83. package/src/components/lists-and-table/CpTable.vue +159 -113
  84. package/src/components/lists-and-table/CpTableEmptyState.vue +5 -8
  85. package/src/components/selects/CpMultiselect.vue +58 -89
  86. package/src/components/selects/CpSelect.vue +70 -90
  87. package/src/components/selects/CpSelectMenu.vue +94 -96
  88. package/src/components/toggles/CpCheckbox.vue +45 -54
  89. package/src/components/toggles/CpRadio.vue +47 -58
  90. package/src/components/toggles/CpSwitch.vue +51 -67
  91. package/src/components/typography/CpHeading.vue +11 -31
  92. package/src/components/visual/CpIcon.vue +2 -1
  93. package/src/constants/{src/CpCustomIcons.ts → CpCustomIcons.ts} +1 -1
  94. package/src/constants/CpTableConfig.ts +12 -0
  95. package/src/constants/Heading.ts +8 -0
  96. package/src/{utils/constants/src/Intent.js → constants/Intent.ts} +1 -1
  97. package/src/constants/PartnerTypes.ts +6 -0
  98. package/src/constants/Position.ts +10 -0
  99. package/src/constants/Sizes.ts +5 -0
  100. package/src/constants/colors/Colors.ts +10 -0
  101. package/src/constants/colors/ToggleColors.ts +6 -0
  102. package/src/constants/index.ts +10 -5
  103. package/src/directives/ClickOutside.ts +17 -0
  104. package/src/directives/{ResizeSelect.js → ResizeSelect.ts} +3 -3
  105. package/src/helpers/{dom.js → dom.ts} +13 -9
  106. package/src/helpers/{index.js → index.ts} +13 -3
  107. package/src/helpers/object.ts +9 -0
  108. package/src/helpers/string/src/camelize.ts +6 -0
  109. package/src/helpers/string/src/{decamelize.js → decamelize.ts} +1 -1
  110. package/src/libs/CoreDatepicker.vue +4 -4
  111. package/src/plugins/toaster.ts +71 -0
  112. package/src/stories/BaseInputLabel.stories.ts +1 -0
  113. package/src/stories/CpAlert.stories.ts +1 -0
  114. package/src/stories/CpCheckbox.stories.ts +3 -1
  115. package/src/stories/CpDate.stories.ts +3 -1
  116. package/src/stories/CpDatepicker.stories.ts +3 -1
  117. package/src/stories/CpDialog.stories.ts +2 -1
  118. package/src/stories/CpHeading.stories.ts +1 -0
  119. package/src/stories/CpIcon.stories.ts +2 -0
  120. package/src/stories/CpInput.stories.ts +3 -1
  121. package/src/stories/CpLoader.stories.ts +1 -0
  122. package/src/stories/CpMultiselect.stories.ts +2 -1
  123. package/src/stories/CpPartnerBadge.stories.ts +1 -1
  124. package/src/stories/CpRadio.stories.ts +3 -1
  125. package/src/stories/CpSelect.stories.ts +3 -1
  126. package/src/stories/CpSelectMenu.stories.ts +3 -1
  127. package/src/stories/CpSwitch.stories.ts +3 -1
  128. package/src/stories/CpTable.stories.ts +8 -1
  129. package/src/stories/CpTableEmptyState.stories.ts +1 -0
  130. package/src/stories/CpTextarea.stories.ts +3 -1
  131. package/src/stories/CpToaster.stories.ts +1 -0
  132. package/src/stories/CpTooltip.stories.ts +1 -0
  133. package/src/stories/TransitionExpand.stories.ts +3 -1
  134. package/src/types/luxon.d.ts +1 -0
  135. package/src/vendors/ff-polyfill.ts +38 -0
  136. package/vitest.workspace.js +1 -3
  137. package/src/constants/src/CpTableConfig.ts +0 -14
  138. package/src/constants/src/Position.ts +0 -10
  139. package/src/constants/src/colors/Colors.ts +0 -10
  140. package/src/constants/src/colors/ToggleColors.ts +0 -6
  141. package/src/directives/ClickOutside.js +0 -13
  142. package/src/helpers/object.js +0 -9
  143. package/src/helpers/string/src/camelize.js +0 -6
  144. package/src/plugins/toaster.js +0 -61
  145. package/src/utils/constants/index.js +0 -3
  146. package/src/utils/constants/src/PartnerTypes.js +0 -6
  147. package/src/utils/constants/src/Sizes.js +0 -5
  148. package/src/vendors/ff-polyfill.js +0 -36
  149. /package/src/helpers/string/{index.js → index.ts} +0 -0
@@ -0,0 +1,9 @@
1
+ export const isObject = (value: unknown): value is Record<string, unknown> => {
2
+ return value !== null && typeof value === 'object'
3
+ }
4
+
5
+ export const isEmpty = (obj: unknown): boolean => {
6
+ if (!isObject(obj)) return true
7
+
8
+ return Reflect.ownKeys(obj).length === 0 && (obj as { constructor: unknown }).constructor === Object
9
+ }
@@ -0,0 +1,6 @@
1
+ export default function camelize(input: string): string {
2
+ return input.replace(/^[\w]|[A-Z]|\b\w|\s+/g, (match, index: number) => {
3
+ if (+match === 0) return ''
4
+ return index === 0 ? match.toLowerCase() : match.toUpperCase()
5
+ })
6
+ }
@@ -1,4 +1,4 @@
1
- export default function decamelize(camelCasedString, separator = ' ') {
1
+ export default function decamelize(camelCasedString: string, separator = ' '): string {
2
2
  return camelCasedString
3
3
  .replace(/([a-z\d])([A-Z])/g, `$1${separator}$2`)
4
4
  .replace(/([A-Z]+)([A-Z][a-z\d]+)/g, `$1${separator}$2`)
@@ -126,14 +126,14 @@
126
126
  </transition>
127
127
  </template>
128
128
 
129
- <script>
129
+ <script lang="ts">
130
130
  import { DateTime, Info } from 'luxon'
131
131
 
132
- import { randomString } from '@/helpers'
133
- import ResizeSelect from '@/directives/ResizeSelect'
134
-
135
132
  import CpIcon from '@/components/visual/CpIcon.vue'
136
133
 
134
+ import ResizeSelect from '@/directives/ResizeSelect'
135
+ import { randomString } from '@/helpers'
136
+
137
137
  export default {
138
138
  name: 'CoreDatepicker',
139
139
  components: {
@@ -0,0 +1,71 @@
1
+ import { App, h, render, VNode } from 'vue'
2
+
3
+ import CpToaster from '@/components/feedback-indicators/CpToaster.vue'
4
+
5
+ import { Intent } from '@/constants'
6
+
7
+ type MountOptions = {
8
+ app?: App | null
9
+ children?: unknown
10
+ element?: HTMLElement | null
11
+ props?: Record<string, unknown>
12
+ }
13
+
14
+ const createElement = () => (typeof document !== 'undefined' ? document.createElement('div') : null)
15
+
16
+ const mount = (component: unknown, { props, children, element, app }: MountOptions = {}) => {
17
+ let el: HTMLElement | null = element ? element : createElement()
18
+
19
+ // @ts-expect-error <comment on type error>
20
+ let vNode: VNode = h(component, props, children)
21
+ if (app && app._context) {
22
+ vNode.appContext = app._context
23
+ }
24
+
25
+ render(vNode, el as HTMLElement)
26
+
27
+ const destroy = () => {
28
+ if (el) {
29
+ render(null, el)
30
+ }
31
+ el = null
32
+ // @ts-expect-error explicit nulling for GC
33
+ vNode = null
34
+ }
35
+
36
+ return { vNode, destroy, el }
37
+ }
38
+
39
+ const createToaster = (globalOptions: Record<string, unknown> = {}) => {
40
+ return {
41
+ show(options: Record<string, unknown> = {}) {
42
+ const localOptions = { ...options }
43
+
44
+ mount(CpToaster, {
45
+ props: { ...globalOptions, ...localOptions },
46
+ })
47
+ },
48
+ unique(options: Record<string, unknown> = {}) {
49
+ options.isUnique = true
50
+ return this.show(options)
51
+ },
52
+ success(options: Record<string, unknown> = {}) {
53
+ options.type = Intent.SUCCESS.value
54
+ return this.show(options)
55
+ },
56
+ critical(options: Record<string, unknown> = {}) {
57
+ options.type = Intent.CRITICAL.value
58
+ return this.show(options)
59
+ },
60
+ info(options: Record<string, unknown> = {}) {
61
+ options.type = Intent.INFO.value
62
+ return this.show(options)
63
+ },
64
+ warning(options: Record<string, unknown> = {}) {
65
+ options.type = Intent.WARNING.value
66
+ return this.show(options)
67
+ },
68
+ }
69
+ }
70
+
71
+ export default createToaster
@@ -1,4 +1,5 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3'
2
+
2
3
  import BaseInputLabel from '@/components/core/BaseInputLabel.vue'
3
4
 
4
5
  const meta = {
@@ -1,4 +1,5 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3'
2
+
2
3
  import CpAlert from '@/components/feedback-indicators/CpAlert.vue'
3
4
 
4
5
  const meta = {
@@ -1,5 +1,7 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3'
2
1
  import { ref } from 'vue'
2
+
3
+ import type { Meta, StoryObj } from '@storybook/vue3'
4
+
3
5
  import CpCheckbox from '@/components/toggles/CpCheckbox.vue'
4
6
 
5
7
  const meta = {
@@ -1,5 +1,7 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3'
2
1
  import { ref } from 'vue'
2
+
3
+ import type { Meta, StoryObj } from '@storybook/vue3'
4
+
3
5
  import CpDate from '@/components/date-pickers/CpDate.vue'
4
6
 
5
7
  const meta = {
@@ -1,5 +1,7 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3'
2
1
  import { ref } from 'vue'
2
+
3
+ import type { Meta, StoryObj } from '@storybook/vue3'
4
+
3
5
  import CpDatepicker from '@/components/date-pickers/CpDatepicker.vue'
4
6
 
5
7
  const meta = {
@@ -1,6 +1,7 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3'
2
1
  import { ref } from 'vue'
3
2
 
3
+ import type { Meta, StoryObj } from '@storybook/vue3'
4
+
4
5
  import CpDialog from '@/components/atomic-elements/CpDialog.vue'
5
6
 
6
7
  const meta = {
@@ -1,4 +1,5 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3'
2
+
2
3
  import CpHeading from '@/components/typography/CpHeading.vue'
3
4
 
4
5
  const meta = {
@@ -1,5 +1,7 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3'
2
+
2
3
  import CpIcon from '@/components/visual/CpIcon.vue'
4
+
3
5
  import { CustomCpIcons } from '@/constants'
4
6
 
5
7
  const iconsOptions = [
@@ -1,5 +1,7 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3'
2
1
  import { ref } from 'vue'
2
+
3
+ import type { Meta, StoryObj } from '@storybook/vue3'
4
+
3
5
  import CpInput from '@/components/inputs/CpInput.vue'
4
6
 
5
7
  const meta = {
@@ -1,4 +1,5 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3'
2
+
2
3
  import CpLoader from '@/components/feedback-indicators/CpLoader.vue'
3
4
 
4
5
  const meta = {
@@ -1,6 +1,7 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3'
2
1
  import { ref } from 'vue'
3
2
 
3
+ import type { Meta, StoryObj } from '@storybook/vue3'
4
+
4
5
  import CpMultiselect from '@/components/selects/CpMultiselect.vue'
5
6
 
6
7
  const meta = {
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/vue3'
2
2
 
3
3
  import CpPartnerBadge from '@/components/atomic-elements/CpPartnerBadge.vue'
4
4
 
5
- import { PartnerTypes, Sizes } from '@/utils/constants'
5
+ import { PartnerTypes, Sizes } from '@/constants'
6
6
 
7
7
  const meta = {
8
8
  title: 'CpPartnerBadge',
@@ -1,5 +1,7 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3'
2
1
  import { ref } from 'vue'
2
+
3
+ import type { Meta, StoryObj } from '@storybook/vue3'
4
+
3
5
  import CpRadio from '@/components/toggles/CpRadio.vue'
4
6
 
5
7
  const meta = {
@@ -1,5 +1,7 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3'
2
1
  import { ref } from 'vue'
2
+
3
+ import type { Meta, StoryObj } from '@storybook/vue3'
4
+
3
5
  import CpSelect from '@/components/selects/CpSelect.vue'
4
6
 
5
7
  const meta = {
@@ -1,5 +1,7 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3'
2
1
  import { ref } from 'vue'
2
+
3
+ import type { Meta, StoryObj } from '@storybook/vue3'
4
+
3
5
  import CpSelectMenu from '@/components/selects/CpSelectMenu.vue'
4
6
 
5
7
  const meta = {
@@ -1,5 +1,7 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3'
2
1
  import { ref } from 'vue'
2
+
3
+ import type { Meta, StoryObj } from '@storybook/vue3'
4
+
3
5
  import CpSwitch from '@/components/toggles/CpSwitch.vue'
4
6
 
5
7
  const meta = {
@@ -1,6 +1,9 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3'
2
+
2
3
  import CpTable from '@/components/lists-and-table/CpTable.vue'
3
4
 
5
+ import { PAGINATION_FORMATS } from '@/constants'
6
+
4
7
  const meta = {
5
8
  title: 'CpTable',
6
9
  component: CpTable,
@@ -111,7 +114,7 @@ export const WithPagination: Story = {
111
114
  pagination: {
112
115
  enabled: true,
113
116
  limit: 3,
114
- format: 'pages',
117
+ format: PAGINATION_FORMATS.PAGES,
115
118
  },
116
119
  },
117
120
  }
@@ -190,22 +193,26 @@ export const WithCustomRowOptions: Story = {
190
193
  enableRowOptions: true,
191
194
  rowOptions: [
192
195
  {
196
+ id: 'see',
193
197
  label: 'see',
194
198
  icon: 'eye',
195
199
  action: () => console.log('See'),
196
200
  },
197
201
  {
202
+ id: 'edit',
198
203
  label: 'edit',
199
204
  icon: 'edit-2',
200
205
  action: () => console.log('Edit'),
201
206
  },
202
207
  {
208
+ id: 'disable',
203
209
  label: 'disable',
204
210
  icon: 'history',
205
211
  disabled: true,
206
212
  action: () => console.log('History'),
207
213
  },
208
214
  {
215
+ id: 'delete',
209
216
  label: 'delete',
210
217
  icon: 'trash',
211
218
  isCritical: true,
@@ -1,4 +1,5 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3'
2
+
2
3
  import CpTableEmptyState from '@/components/lists-and-table/CpTableEmptyState.vue'
3
4
 
4
5
  const meta = {
@@ -1,5 +1,7 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3'
2
1
  import { ref } from 'vue'
2
+
3
+ import type { Meta, StoryObj } from '@storybook/vue3'
4
+
3
5
  import CpTextarea from '@/components/inputs/CpTextarea.vue'
4
6
 
5
7
  const meta = {
@@ -1,4 +1,5 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3'
2
+
2
3
  import CpToaster from '@/components/feedback-indicators/CpToaster.vue'
3
4
 
4
5
  const meta = {
@@ -1,4 +1,5 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3'
2
+
2
3
  import CpTooltip from '@/components/atomic-elements/CpTooltip.vue'
3
4
 
4
5
  const meta = {
@@ -1,5 +1,7 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3'
2
1
  import { ref } from 'vue'
2
+
3
+ import type { Meta, StoryObj } from '@storybook/vue3'
4
+
3
5
  import TransitionExpand from '@/components/helpers-utilities/TransitionExpand.vue'
4
6
 
5
7
  const meta = {
@@ -0,0 +1 @@
1
+ declare module 'luxon'
@@ -0,0 +1,38 @@
1
+ // Copy paste from https://gist.github.com/nuxodin/9250e56a3ce6c0446efa
2
+ export default function ffPolyfill(): void {
3
+ const w = window
4
+ const d = w.document
5
+
6
+ if (w.onfocus === undefined) {
7
+ d.addEventListener('focus', addPolyfill as EventListener, true)
8
+ d.addEventListener('blur', addPolyfill as EventListener, true)
9
+ d.addEventListener('focusin', removePolyfill as EventListener, true)
10
+ d.addEventListener('focusout', removePolyfill as EventListener, true)
11
+ }
12
+
13
+ function addPolyfill(e: FocusEvent) {
14
+ const type = e.type === 'focus' ? 'focusin' : 'focusout'
15
+ const event = new CustomEvent(type, {
16
+ bubbles: true,
17
+ cancelable: false,
18
+ })
19
+ // @ts-expect-error <comment on type error>
20
+ event.c1Generated = true
21
+ ;(e.target as HTMLElement).dispatchEvent(event)
22
+ }
23
+
24
+ function removePolyfill(e: FocusEvent) {
25
+ // @ts-expect-error <comment on type error>
26
+ if (!e.c1Generated) {
27
+ // focus after focusin, so chrome will the first time trigger tow times focusin
28
+ d.removeEventListener('focus', addPolyfill as EventListener, true)
29
+ d.removeEventListener('blur', addPolyfill as EventListener, true)
30
+ d.removeEventListener('focusin', removePolyfill as EventListener, true)
31
+ d.removeEventListener('focusout', removePolyfill as EventListener, true)
32
+ }
33
+ setTimeout(function () {
34
+ d.removeEventListener('focusin', removePolyfill as EventListener, true)
35
+ d.removeEventListener('focusout', removePolyfill as EventListener, true)
36
+ })
37
+ }
38
+ }
@@ -1,10 +1,8 @@
1
+ import { storybookTest } from '@storybook/experimental-addon-test/vitest-plugin'
1
2
  import path from 'node:path'
2
3
  import { fileURLToPath } from 'node:url'
3
-
4
4
  import { defineWorkspace } from 'vitest/config'
5
5
 
6
- import { storybookTest } from '@storybook/experimental-addon-test/vitest-plugin'
7
-
8
6
  const dirname = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url))
9
7
 
10
8
  // More info at: https://storybook.js.org/docs/writing-tests/test-addon
@@ -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
- }
@@ -1,10 +0,0 @@
1
- export default {
2
- BLUE: 'blue',
3
- GRAY: 'gray',
4
- GREEN: 'green',
5
- ORANGE: 'orange',
6
- PINK: 'pink',
7
- PURPLE: 'purple',
8
- RED: 'red',
9
- YELLOW: 'yellow',
10
- }
@@ -1,6 +0,0 @@
1
- import Colors from './Colors'
2
-
3
- export default {
4
- BLUE: Colors.BLUE,
5
- PURPLE: Colors.PURPLE,
6
- }
@@ -1,13 +0,0 @@
1
- export default {
2
- beforeMount(el, binding) {
3
- el.clickOutsideEvent = function (event) {
4
- if (!(el === event.target || el.contains(event.target))) {
5
- binding.value(event, el)
6
- }
7
- }
8
- document.body.addEventListener('click', el.clickOutsideEvent)
9
- },
10
- unmounted(el) {
11
- document.body.removeEventListener('click', el.clickOutsideEvent)
12
- },
13
- }
@@ -1,9 +0,0 @@
1
- export const isObject = (object) => {
2
- return object != null && typeof object === 'object'
3
- }
4
-
5
- export const isEmpty = (obj) => {
6
- if (!isObject(obj)) return true
7
-
8
- return Reflect.ownKeys(obj).length === 0 && obj.constructor === Object
9
- }
@@ -1,6 +0,0 @@
1
- export default function camelize(string) {
2
- return string.replace(/^\w|[A-Z]|\b\w|\s+/g, (match, index) => {
3
- if (+match === 0) return '' // or if (/\s+/.test(match)) for white spaces
4
- return index === 0 ? match.toLowerCase() : match.toUpperCase()
5
- })
6
- }
@@ -1,61 +0,0 @@
1
- import CpToaster from '@/components/feedback-indicators/CpToaster.vue'
2
- import { Intent } from '@/utils/constants'
3
-
4
- import { h, render } from 'vue'
5
-
6
- const createElement = () => typeof document !== 'undefined' && document.createElement('div')
7
-
8
- const mount = (component, { props, children, element, app } = {}) => {
9
- let el = element ? element : createElement()
10
-
11
- let vNode = h(component, props, children)
12
- if (app && app._context) {
13
- vNode.appContext = app._context
14
- }
15
-
16
- render(vNode, el)
17
-
18
- const destroy = () => {
19
- if (el) {
20
- render(null, el)
21
- }
22
- el = null
23
- vNode = null
24
- }
25
-
26
- return { vNode, destroy, el }
27
- }
28
-
29
- const createToaster = (globalOptions = {}) => {
30
- return {
31
- show(options = {}) {
32
- let localOptions = { ...options }
33
-
34
- mount(CpToaster, {
35
- props: { ...globalOptions, ...localOptions },
36
- })
37
- },
38
- unique(options = {}) {
39
- options.isUnique = true
40
- return this.show(options)
41
- },
42
- success(options = {}) {
43
- options.type = Intent.SUCCESS.value
44
- return this.show(options)
45
- },
46
- critical(options = {}) {
47
- options.type = Intent.CRITICAL.value
48
- return this.show(options)
49
- },
50
- info(options = {}) {
51
- options.type = Intent.INFO.value
52
- return this.show(options)
53
- },
54
- warning(options = {}) {
55
- options.type = Intent.WARNING.value
56
- return this.show(options)
57
- },
58
- }
59
- }
60
-
61
- export default createToaster
@@ -1,3 +0,0 @@
1
- export { default as Intent } from './src/Intent'
2
- export { default as Sizes } from './src/Sizes'
3
- export { default as PartnerTypes } from './src/PartnerTypes'
@@ -1,6 +0,0 @@
1
- export default {
2
- OTA: 'ota',
3
- AIRLINE: 'airline',
4
- SUPPLIER: 'supplier',
5
- THIRDPARTY: 'thirdParty',
6
- }
@@ -1,5 +0,0 @@
1
- export default {
2
- XS: 'xs',
3
- SM: 'sm',
4
- MD: 'md',
5
- }
@@ -1,36 +0,0 @@
1
- // Copy paste from https://gist.github.com/nuxodin/9250e56a3ce6c0446efa
2
- export default function () {
3
- var w = window,
4
- d = w.document
5
-
6
- if (w.onfocusin === undefined) {
7
- d.addEventListener('focus', addPolyfill, true)
8
- d.addEventListener('blur', addPolyfill, true)
9
- d.addEventListener('focusin', removePolyfill, true)
10
- d.addEventListener('focusout', removePolyfill, true)
11
- }
12
-
13
- function addPolyfill(e) {
14
- var type = e.type === 'focus' ? 'focusin' : 'focusout'
15
- var event = new CustomEvent(type, {
16
- bubbles: true,
17
- cancelable: false,
18
- })
19
- event.c1Generated = true
20
- e.target.dispatchEvent(event)
21
- }
22
-
23
- function removePolyfill(e) {
24
- if (!e.c1Generated) {
25
- // focus after focusin, so chrome will the first time trigger tow times focusin
26
- d.removeEventListener('focus', addPolyfill, true)
27
- d.removeEventListener('blur', addPolyfill, true)
28
- d.removeEventListener('focusin', removePolyfill, true)
29
- d.removeEventListener('focusout', removePolyfill, true)
30
- }
31
- setTimeout(function () {
32
- d.removeEventListener('focusin', removePolyfill, true)
33
- d.removeEventListener('focusout', removePolyfill, true)
34
- })
35
- }
36
- }
File without changes