@citizenplane/pimp 9.5.12 → 9.6.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/pimp.es.js +3745 -3706
- package/dist/pimp.umd.js +18 -18
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/CpCalendar.vue +19 -24
- package/src/components/CpCheckbox.vue +7 -9
- package/src/components/CpDate.vue +13 -13
- package/src/components/CpDatepicker.vue +18 -18
- package/src/components/CpInput.vue +10 -10
- package/src/components/CpLoader.vue +59 -16
- package/src/components/CpRadio.vue +8 -8
- package/src/components/CpSelect.vue +9 -13
- package/src/components/CpSwitch.vue +8 -10
- package/src/components/CpTable.vue +13 -14
- package/src/components/CpTextarea.vue +6 -6
- package/src/components/CpToaster.vue +6 -12
- package/src/components/icons/IconPlane.vue +16 -0
- package/src/components/icons/IconPlaneLanding.vue +17 -0
- package/src/components/icons/IconPlaneTakeoff.vue +7 -0
- package/src/constants/CpCustomIcons.ts +6 -0
- package/src/helpers/index.ts +0 -4
- package/src/libs/CoreDatepicker.vue +11 -11
- package/src/stories/CpLoader.stories.ts +11 -10
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div :aria-disabled="isDisabled" class="cpInput" :class="dynamicClasses" @click="focusOnInput">
|
|
3
3
|
<base-input-label
|
|
4
4
|
v-if="label"
|
|
5
5
|
v-bind-once="{ for: inputIdentifier }"
|
|
6
6
|
:is-invalid="isInputInvalid"
|
|
7
|
-
:tooltip="tooltip"
|
|
8
7
|
:required="isRequired"
|
|
8
|
+
:tooltip="tooltip"
|
|
9
9
|
>
|
|
10
10
|
{{ capitalizedLabel }}
|
|
11
11
|
</base-input-label>
|
|
12
12
|
<div
|
|
13
13
|
ref="cpInputContainer"
|
|
14
|
-
:class="{ 'cpInput__container--hasBeforeIcon': hasBeforeIcon }"
|
|
15
14
|
class="cpInput__container"
|
|
15
|
+
:class="{ 'cpInput__container--hasBeforeIcon': hasBeforeIcon }"
|
|
16
16
|
>
|
|
17
17
|
<div v-if="hasBeforeIcon" class="cpInput__icon cpInput__icon--isBefore">
|
|
18
18
|
<cp-icon v-if="isSearch" type="search" />
|
|
@@ -22,18 +22,18 @@
|
|
|
22
22
|
v-model="inputModel"
|
|
23
23
|
v-bind-once="{ id: inputIdentifier }"
|
|
24
24
|
v-maska
|
|
25
|
-
:data-maska="mask"
|
|
26
25
|
v-bind="restAttributes"
|
|
27
|
-
:disabled="isDisabled"
|
|
28
|
-
:aria-invalid="isInputInvalid"
|
|
29
26
|
:aria-describedby="inputDescribedByAttribute"
|
|
27
|
+
:aria-invalid="isInputInvalid"
|
|
30
28
|
class="cpInput__inner"
|
|
29
|
+
:data-maska="mask"
|
|
30
|
+
:disabled="isDisabled"
|
|
31
31
|
/>
|
|
32
32
|
<div v-if="hasAfterIcon" class="cpInput__icon cpInput__icon--isAfter">
|
|
33
33
|
<slot v-if="displayAfterIcon" name="trailing-icon" />
|
|
34
34
|
<transition name="fade">
|
|
35
|
-
<button v-if="isClearButtonVisible"
|
|
36
|
-
<cp-icon
|
|
35
|
+
<button v-if="isClearButtonVisible" class="cpInput__clear" type="button" @click="clearInputValue">
|
|
36
|
+
<cp-icon class="cpInput__clearIcon" type="x" />
|
|
37
37
|
</button>
|
|
38
38
|
</transition>
|
|
39
39
|
</div>
|
|
@@ -55,7 +55,7 @@ import { ref, useAttrs, useSlots, computed, nextTick, onMounted, useId } from 'v
|
|
|
55
55
|
import BaseInputLabel from '@/components/BaseInputLabel.vue'
|
|
56
56
|
|
|
57
57
|
import { Sizes } from '@/constants'
|
|
58
|
-
import {
|
|
58
|
+
import { capitalizeFirstLetter } from '@/helpers'
|
|
59
59
|
|
|
60
60
|
interface Emits {
|
|
61
61
|
(e: 'update:modelValue', value: string | number | boolean): void
|
|
@@ -99,7 +99,7 @@ const attrs = useAttrs()
|
|
|
99
99
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
100
100
|
const { ['class']: value, id, ...restAttributes } = attrs
|
|
101
101
|
|
|
102
|
-
const inputIdentifier = ref(id ||
|
|
102
|
+
const inputIdentifier = ref(id || useId())
|
|
103
103
|
|
|
104
104
|
const helpMessageId = useId()
|
|
105
105
|
const errorMessageId = useId()
|
|
@@ -1,44 +1,87 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<svg
|
|
3
3
|
id="loader-1"
|
|
4
|
+
class="cpLoader"
|
|
5
|
+
:class="dynamicClasses"
|
|
6
|
+
enable-background="new 0 0 40 40"
|
|
7
|
+
height="40"
|
|
4
8
|
version="1.1"
|
|
5
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
6
|
-
x="0px"
|
|
7
|
-
y="0px"
|
|
8
|
-
width="40px"
|
|
9
|
-
height="40px"
|
|
10
9
|
viewBox="0 0 40 40"
|
|
11
|
-
|
|
10
|
+
width="40"
|
|
11
|
+
x="0px"
|
|
12
12
|
xml:space="preserve"
|
|
13
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
14
|
+
y="0px"
|
|
13
15
|
>
|
|
14
16
|
<path
|
|
15
|
-
opacity="0.2"
|
|
16
|
-
:fill="color"
|
|
17
17
|
d="M20.201,5.169c-8.254,0-14.946,6.692-14.946,14.946c0,8.255,6.692,14.946,14.946,14.946 s14.946-6.691,14.946-14.946C35.146,11.861,28.455,5.169,20.201,5.169z M20.201,31.749c-6.425,0-11.634-5.208-11.634-11.634 c0-6.425,5.209-11.634,11.634-11.634c6.425,0,11.633,5.209,11.633,11.634C31.834,26.541,26.626,31.749,20.201,31.749z"
|
|
18
|
+
fill="currentColor"
|
|
19
|
+
opacity="0.2"
|
|
18
20
|
/>
|
|
19
21
|
<path
|
|
20
|
-
:fill="color"
|
|
21
22
|
d="M26.013,10.047l1.654-2.866c-2.198-1.272-4.743-2.012-7.466-2.012h0v3.312h0 C22.32,8.481,24.301,9.057,26.013,10.047z"
|
|
23
|
+
fill="currentColor"
|
|
22
24
|
>
|
|
23
25
|
<animateTransform
|
|
24
|
-
attributeType="xml"
|
|
25
26
|
attributeName="transform"
|
|
26
|
-
|
|
27
|
-
from="0 20 20"
|
|
28
|
-
to="360 20 20"
|
|
27
|
+
attributeType="xml"
|
|
29
28
|
dur="0.5s"
|
|
29
|
+
from="0 20 20"
|
|
30
30
|
repeatCount="indefinite"
|
|
31
|
+
to="360 20 20"
|
|
32
|
+
type="rotate"
|
|
31
33
|
/>
|
|
32
34
|
</path>
|
|
33
35
|
</svg>
|
|
34
36
|
</template>
|
|
35
37
|
|
|
36
38
|
<script setup lang="ts">
|
|
39
|
+
import { computed } from 'vue'
|
|
40
|
+
|
|
41
|
+
import { Colors, Sizes } from '@/constants'
|
|
42
|
+
import { capitalizeFirstLetter } from '@/helpers'
|
|
43
|
+
|
|
37
44
|
interface Props {
|
|
38
|
-
color?:
|
|
45
|
+
color?: Colors
|
|
46
|
+
size?: Sizes
|
|
39
47
|
}
|
|
40
48
|
|
|
41
|
-
withDefaults(defineProps<Props>(), {
|
|
42
|
-
|
|
49
|
+
const props = withDefaults(defineProps<Props>(), { color: Colors.PURPLE, size: Sizes.MD })
|
|
50
|
+
|
|
51
|
+
const capitalizedColor = computed(() => capitalizeFirstLetter(props.color))
|
|
52
|
+
|
|
53
|
+
const dynamicClasses = computed(() => {
|
|
54
|
+
return [`cpLoader--is${capitalizedColor.value}`, `cpLoader--${props.size}`]
|
|
43
55
|
})
|
|
44
56
|
</script>
|
|
57
|
+
|
|
58
|
+
<style lang="scss">
|
|
59
|
+
@mixin cp-loader-themed($className, $color) {
|
|
60
|
+
&--is#{$className} {
|
|
61
|
+
color: $color;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.cpLoader {
|
|
66
|
+
@include mx.square-sizing(32);
|
|
67
|
+
|
|
68
|
+
@include cp-loader-themed('Blue', colors.$secondary-color);
|
|
69
|
+
@include cp-loader-themed('Purple', colors.$primary-color);
|
|
70
|
+
@include cp-loader-themed('Green', colors.$success-color);
|
|
71
|
+
@include cp-loader-themed('Orange', colors.$warning-color);
|
|
72
|
+
@include cp-loader-themed('Red', colors.$error-color);
|
|
73
|
+
@include cp-loader-themed('Yellow', colors.$yellow);
|
|
74
|
+
|
|
75
|
+
&--lg {
|
|
76
|
+
@include mx.square-sizing(48);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&--sm {
|
|
80
|
+
@include mx.square-sizing(24);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&--xs {
|
|
84
|
+
@include mx.square-sizing(16);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
</style>
|
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
<label
|
|
4
4
|
v-for="({ label, value, description, additionalData, disabled }, index) in options"
|
|
5
5
|
:key="getRadioId(index)"
|
|
6
|
-
:class="computedClasses({ value, disabled })"
|
|
7
6
|
class="cpRadio"
|
|
7
|
+
:class="computedClasses({ value, disabled })"
|
|
8
8
|
:for="getRadioId(index)"
|
|
9
9
|
>
|
|
10
10
|
<input
|
|
11
11
|
:id="getRadioId(index)"
|
|
12
|
+
:autofocus="autofocus"
|
|
12
13
|
:checked="isActive(value)"
|
|
13
|
-
:value="value"
|
|
14
14
|
:disabled="disabled"
|
|
15
|
-
type="radio"
|
|
16
|
-
:autofocus="autofocus"
|
|
17
15
|
:name="groupName"
|
|
16
|
+
type="radio"
|
|
17
|
+
:value="value"
|
|
18
18
|
@input="onChange(value)"
|
|
19
19
|
/>
|
|
20
20
|
<span class="cpRadio__content">
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
</template>
|
|
30
30
|
|
|
31
31
|
<script setup lang="ts">
|
|
32
|
-
import {
|
|
32
|
+
import { useId } from 'vue'
|
|
33
33
|
|
|
34
34
|
import { ToggleColors } from '@/constants'
|
|
35
|
-
import { capitalizeFirstLetter
|
|
35
|
+
import { capitalizeFirstLetter } from '@/helpers'
|
|
36
36
|
|
|
37
37
|
interface RadioOption {
|
|
38
38
|
additionalData?: string
|
|
@@ -62,11 +62,11 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
62
62
|
|
|
63
63
|
const emit = defineEmits<Emits>()
|
|
64
64
|
|
|
65
|
-
const radioUniqueId =
|
|
65
|
+
const radioUniqueId = useId()
|
|
66
66
|
|
|
67
67
|
const onChange = (value: string): void => emit('update:modelValue', value)
|
|
68
68
|
|
|
69
|
-
const getRadioId = (index: number): string => `${radioUniqueId
|
|
69
|
+
const getRadioId = (index: number): string => `${radioUniqueId}${index}`
|
|
70
70
|
|
|
71
71
|
const isActive = (value: string): boolean => value === props.modelValue
|
|
72
72
|
|
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
<div class="cpSelect" :class="dynamicClasses">
|
|
3
3
|
<base-input-label
|
|
4
4
|
v-if="label"
|
|
5
|
+
class="cpSelect__label"
|
|
5
6
|
:for="selectReferenceId"
|
|
6
|
-
:tooltip="tooltip"
|
|
7
7
|
:is-invalid="isInvalid"
|
|
8
8
|
:required="required"
|
|
9
|
-
|
|
9
|
+
:tooltip="tooltip"
|
|
10
10
|
>
|
|
11
11
|
{{ capitalizedLabel }}
|
|
12
12
|
</base-input-label>
|
|
13
13
|
<div class="cpSelect__container">
|
|
14
14
|
<select
|
|
15
15
|
:id="selectReferenceId"
|
|
16
|
-
:value="modelValue"
|
|
17
|
-
:disabled="disabled"
|
|
18
|
-
:required="required"
|
|
19
16
|
:autocomplete="autocomplete"
|
|
20
|
-
:name="name"
|
|
21
17
|
class="cpSelect__inner"
|
|
18
|
+
:disabled="disabled"
|
|
19
|
+
:name="name"
|
|
20
|
+
:required="required"
|
|
21
|
+
:value="modelValue"
|
|
22
22
|
@input="handleChange"
|
|
23
23
|
>
|
|
24
24
|
<option :disabled="hideDefaultValue" value="">{{ defaultValue }}</option>
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
</template>
|
|
38
38
|
|
|
39
39
|
<script setup lang="ts">
|
|
40
|
-
import {
|
|
40
|
+
import { computed, useId } from 'vue'
|
|
41
41
|
|
|
42
42
|
import BaseInputLabel from '@/components/BaseInputLabel.vue'
|
|
43
43
|
import TransitionExpand from '@/components/TransitionExpand.vue'
|
|
44
44
|
|
|
45
45
|
import { Sizes } from '@/constants'
|
|
46
|
-
import {
|
|
46
|
+
import { capitalizeFirstLetter } from '@/helpers'
|
|
47
47
|
|
|
48
48
|
interface Emits {
|
|
49
49
|
(e: 'update:modelValue', value: string): void
|
|
@@ -89,7 +89,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
89
89
|
|
|
90
90
|
const emit = defineEmits<Emits>()
|
|
91
91
|
|
|
92
|
-
const selectReferenceId =
|
|
92
|
+
const selectReferenceId = useId()
|
|
93
93
|
|
|
94
94
|
const helpMessageId = useId()
|
|
95
95
|
const errorMessageId = useId()
|
|
@@ -115,10 +115,6 @@ const handleChange = (e: Event): void => {
|
|
|
115
115
|
const target = e.target as HTMLSelectElement
|
|
116
116
|
emit('update:modelValue', target.value)
|
|
117
117
|
}
|
|
118
|
-
|
|
119
|
-
onMounted(() => {
|
|
120
|
-
selectReferenceId.value = randomString()
|
|
121
|
-
})
|
|
122
118
|
</script>
|
|
123
119
|
|
|
124
120
|
<style lang="scss">
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
<span class="cpSwitch__switch">
|
|
4
4
|
<input
|
|
5
5
|
:id="switchUniqueId"
|
|
6
|
-
:
|
|
6
|
+
:autofocus="autofocus"
|
|
7
7
|
:checked="modelValue"
|
|
8
|
-
:
|
|
9
|
-
type="checkbox"
|
|
8
|
+
:disabled="disabled"
|
|
10
9
|
:name="groupName"
|
|
11
|
-
|
|
10
|
+
type="checkbox"
|
|
11
|
+
:value="modelValue"
|
|
12
12
|
@change="handleClick(modelValue)"
|
|
13
13
|
/>
|
|
14
14
|
<span class="cpSwitch__knobContainer">
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<span v-if="label" class="cpSwitch__label">{{ label }}</span>
|
|
21
21
|
<span v-if="isRequired" class="u-asterisk">*</span>
|
|
22
22
|
<cp-tooltip v-if="tooltip" :content="tooltip">
|
|
23
|
-
<cp-icon
|
|
23
|
+
<cp-icon class="cpSwitch__tooltip" size="16" type="tooltip" />
|
|
24
24
|
</cp-tooltip>
|
|
25
25
|
</div>
|
|
26
26
|
<span v-if="helper" class="cpSwitch__helper">{{ helper }}</span>
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
</template>
|
|
30
30
|
|
|
31
31
|
<script setup lang="ts">
|
|
32
|
-
import {
|
|
32
|
+
import { computed, useId } from 'vue'
|
|
33
33
|
|
|
34
34
|
import CpTooltip from '@/components/CpTooltip.vue'
|
|
35
35
|
|
|
36
36
|
import { ToggleColors } from '@/constants'
|
|
37
|
-
import { capitalizeFirstLetter
|
|
37
|
+
import { capitalizeFirstLetter } from '@/helpers'
|
|
38
38
|
|
|
39
39
|
interface Props {
|
|
40
40
|
autofocus?: boolean
|
|
@@ -68,9 +68,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
68
68
|
|
|
69
69
|
const emit = defineEmits<Emits>()
|
|
70
70
|
|
|
71
|
-
const switchUniqueId =
|
|
72
|
-
|
|
73
|
-
switchUniqueId.value = randomString()
|
|
71
|
+
const switchUniqueId = useId()
|
|
74
72
|
|
|
75
73
|
const capitalizedColor = computed(() => {
|
|
76
74
|
return capitalizeFirstLetter(props.color)
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
<div class="cpTable" :class="mainClasses">
|
|
3
3
|
<div
|
|
4
4
|
ref="cpTableContainer"
|
|
5
|
-
role="region"
|
|
6
5
|
:aria-labelledby="uniqueId"
|
|
7
|
-
tabindex="0"
|
|
8
6
|
class="cpTable__container"
|
|
9
7
|
:class="containerClasses"
|
|
8
|
+
role="region"
|
|
9
|
+
tabindex="0"
|
|
10
10
|
>
|
|
11
11
|
<table class="cpTable__table">
|
|
12
12
|
<caption v-if="caption" :id="uniqueId" class="cpTable__caption">
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
class="cpTable__column"
|
|
23
23
|
:style="getColumnStyle(column)"
|
|
24
24
|
>
|
|
25
|
-
<slot
|
|
25
|
+
<slot :column="column" name="column">
|
|
26
26
|
{{ column.name }}
|
|
27
27
|
</slot>
|
|
28
28
|
</th>
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
:key="`${cellKey}_${rowIndex}`"
|
|
47
47
|
class="cpTable__cell"
|
|
48
48
|
:class="getCellClasses(cellKey)"
|
|
49
|
-
:style="getCellStyle(cellKey, cellIndex)"
|
|
50
49
|
:colspan="getColspan(cellKey)"
|
|
50
|
+
:style="getCellStyle(cellKey, cellIndex)"
|
|
51
51
|
>
|
|
52
|
-
<slot :
|
|
52
|
+
<slot :cell="cellValue" :name="cellKey">
|
|
53
53
|
<span v-if="isFullWidthRow(rowData)">{{ cellValue }}</span>
|
|
54
54
|
<template v-else>{{ cellValue }}</template>
|
|
55
55
|
</slot>
|
|
@@ -61,21 +61,21 @@
|
|
|
61
61
|
v-for="option in quickOptions"
|
|
62
62
|
:key="option.id"
|
|
63
63
|
v-tooltip="getQuickOptionTooltip(option)"
|
|
64
|
-
type="button"
|
|
65
64
|
class="cpTable__action"
|
|
66
65
|
:class="getQuickOptionClasses(option)"
|
|
67
66
|
:disabled="option.isDisabled"
|
|
67
|
+
type="button"
|
|
68
68
|
@click.stop="($event) => option.action(getRowPayload(rowIndex), $event)"
|
|
69
69
|
>
|
|
70
|
-
<cp-icon :type="option.icon"
|
|
70
|
+
<cp-icon size="16" :type="option.icon" />
|
|
71
71
|
</button>
|
|
72
72
|
|
|
73
73
|
<button
|
|
74
|
-
type="button"
|
|
75
74
|
class="cpTable__action cpTable__action--isDefault"
|
|
75
|
+
type="button"
|
|
76
76
|
@click.stop="handleContextMenu({ rowData, rowIndex }, $event)"
|
|
77
77
|
>
|
|
78
|
-
<cp-icon type="more-vertical"
|
|
78
|
+
<cp-icon size="16" type="more-vertical" />
|
|
79
79
|
</button>
|
|
80
80
|
</slot>
|
|
81
81
|
</div>
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
</tr>
|
|
85
85
|
</tbody>
|
|
86
86
|
</table>
|
|
87
|
-
<cp-table-empty-state v-if="hasNoResult"
|
|
87
|
+
<cp-table-empty-state v-if="hasNoResult" class="cpTable__emptyState" :placeholder="noResultPlaceholder" />
|
|
88
88
|
</div>
|
|
89
89
|
<div v-if="hasPagination" class="cpTable__footer">
|
|
90
90
|
<div class="footer__details">
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
</template>
|
|
99
99
|
<template v-else> No results </template>
|
|
100
100
|
</slot>
|
|
101
|
-
<template v-else> Loading <cp-loader
|
|
101
|
+
<template v-else> Loading <cp-loader class="cpTable__loader--isSmall" :color="LoaderColor" /> </template>
|
|
102
102
|
</p>
|
|
103
103
|
</div>
|
|
104
104
|
<div class="footer__pagination">
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
</template>
|
|
118
118
|
|
|
119
119
|
<script setup lang="ts">
|
|
120
|
-
import { ref, computed } from 'vue'
|
|
120
|
+
import { ref, computed, useId } from 'vue'
|
|
121
121
|
|
|
122
122
|
import CpContextualMenu from '@/components/CpContextualMenu.vue'
|
|
123
123
|
import CpTableEmptyState from '@/components/CpTableEmptyState.vue'
|
|
@@ -125,7 +125,6 @@ import CpTableEmptyState from '@/components/CpTableEmptyState.vue'
|
|
|
125
125
|
import { camelize, decamelize } from '@/helpers/string'
|
|
126
126
|
|
|
127
127
|
import { PAGINATION_FORMATS, RESERVED_KEYS, VISIBLE_ROWS_MAX } from '@/constants'
|
|
128
|
-
import { randomString } from '@/helpers'
|
|
129
128
|
|
|
130
129
|
interface Emits {
|
|
131
130
|
(e: 'onRowClick', data: Record<string, unknown>): void
|
|
@@ -199,7 +198,7 @@ const emit = defineEmits<Emits>()
|
|
|
199
198
|
|
|
200
199
|
const LoaderColor = '#5341F9'
|
|
201
200
|
|
|
202
|
-
const uniqueId =
|
|
201
|
+
const uniqueId = useId()
|
|
203
202
|
const pageNumber = ref(0)
|
|
204
203
|
const cpTableContainer = ref<HTMLElement | null>(null)
|
|
205
204
|
const contextualMenu = ref<InstanceType<typeof CpContextualMenu>>()
|
|
@@ -3,21 +3,21 @@
|
|
|
3
3
|
<base-input-label
|
|
4
4
|
v-if="label"
|
|
5
5
|
v-bind-once="{ for: inputIdentifier }"
|
|
6
|
+
class="cpTextarea__label"
|
|
6
7
|
:is-invalid="isInvalid"
|
|
7
8
|
:required="required"
|
|
8
|
-
class="cpTextarea__label"
|
|
9
9
|
>
|
|
10
10
|
{{ capitalizedLabel }}
|
|
11
11
|
</base-input-label>
|
|
12
12
|
<textarea
|
|
13
13
|
v-model="textareaModel"
|
|
14
14
|
v-bind-once="{ id: inputIdentifier }"
|
|
15
|
+
class="cpTextarea__input"
|
|
16
|
+
:class="{ 'cpTextarea__input--isInvalid': isInvalid }"
|
|
15
17
|
:disabled="disabled"
|
|
16
18
|
:placeholder="placeholder"
|
|
17
19
|
:required="required"
|
|
18
20
|
:style="`min-height: ${height}px`"
|
|
19
|
-
:class="{ 'cpTextarea__input--isInvalid': isInvalid }"
|
|
20
|
-
class="cpTextarea__input"
|
|
21
21
|
/>
|
|
22
22
|
<transition-expand>
|
|
23
23
|
<p v-if="displayErrorMessage" class="cpTextarea__error">
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
</template>
|
|
29
29
|
|
|
30
30
|
<script setup lang="ts">
|
|
31
|
-
import { ref, computed } from 'vue'
|
|
31
|
+
import { ref, computed, useId } from 'vue'
|
|
32
32
|
|
|
33
33
|
import BaseInputLabel from '@/components/BaseInputLabel.vue'
|
|
34
34
|
import TransitionExpand from '@/components/TransitionExpand.vue'
|
|
35
35
|
|
|
36
|
-
import {
|
|
36
|
+
import { capitalizeFirstLetter } from '@/helpers'
|
|
37
37
|
|
|
38
38
|
interface Emits {
|
|
39
39
|
(e: 'update:modelValue', value: string): void
|
|
@@ -75,7 +75,7 @@ const textareaModel = defineModel<string>({
|
|
|
75
75
|
},
|
|
76
76
|
})
|
|
77
77
|
|
|
78
|
-
const inputIdentifier = ref(props.inputId ||
|
|
78
|
+
const inputIdentifier = ref(props.inputId || useId())
|
|
79
79
|
|
|
80
80
|
const capitalizedLabel = computed(() => capitalizeFirstLetter(props.label))
|
|
81
81
|
|
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
@mouseleave="setHoverState(false)"
|
|
12
12
|
>
|
|
13
13
|
<div class="cpToaster__content">
|
|
14
|
-
<cp-icon
|
|
14
|
+
<cp-icon class="cpToaster__icon" :type="toasterIcon" />
|
|
15
15
|
<div class="cpToaster__body">
|
|
16
|
-
<cp-heading :heading-level="HeadingLevels.H4" :size="400"
|
|
16
|
+
<cp-heading class="cpToaster__title" :heading-level="HeadingLevels.H4" :size="400">{{ title }}</cp-heading>
|
|
17
17
|
<p v-if="description" class="cpToaster__description">{{ description }}</p>
|
|
18
18
|
</div>
|
|
19
19
|
</div>
|
|
20
|
-
<button
|
|
20
|
+
<button class="cpToaster__close" type="button" @click="closeToaster"><cp-icon type="x" /></button>
|
|
21
21
|
<div v-if="actionLabel" class="cpToaster__footer">
|
|
22
|
-
<button
|
|
22
|
+
<button class="cpToaster__button" type="button" @click="handleActionMethod">
|
|
23
23
|
{{ actionLabel }}
|
|
24
24
|
</button>
|
|
25
25
|
</div>
|
|
@@ -29,13 +29,12 @@
|
|
|
29
29
|
|
|
30
30
|
<script setup lang="ts">
|
|
31
31
|
import { animate } from 'animejs'
|
|
32
|
-
import { ref, computed, watch, onBeforeMount, onMounted, nextTick, getCurrentInstance } from 'vue'
|
|
32
|
+
import { ref, computed, watch, onBeforeMount, onMounted, nextTick, getCurrentInstance, useId } from 'vue'
|
|
33
33
|
|
|
34
34
|
import CpHeading from '@/components/CpHeading.vue'
|
|
35
35
|
import CpIcon from '@/components/CpIcon.vue'
|
|
36
36
|
|
|
37
37
|
import { HeadingLevels, Intent } from '@/constants'
|
|
38
|
-
import { randomString } from '@/helpers'
|
|
39
38
|
|
|
40
39
|
interface Props {
|
|
41
40
|
actionLabel?: string
|
|
@@ -69,7 +68,7 @@ if (!validateType(props.type)) {
|
|
|
69
68
|
console.warn(`Type de toaster invalide: ${props.type}`)
|
|
70
69
|
}
|
|
71
70
|
|
|
72
|
-
const toasterId =
|
|
71
|
+
const toasterId = useId()
|
|
73
72
|
const toastersContainer = ref<HTMLElement | null>(null)
|
|
74
73
|
const isOpen = ref<boolean>(false)
|
|
75
74
|
const isHovered = ref<boolean>(false)
|
|
@@ -121,10 +120,6 @@ const removeSiblings = (): void => {
|
|
|
121
120
|
siblings.forEach(removeElement)
|
|
122
121
|
}
|
|
123
122
|
|
|
124
|
-
const setToasterId = (): void => {
|
|
125
|
-
toasterId.value = randomString()
|
|
126
|
-
}
|
|
127
|
-
|
|
128
123
|
const showToaster = (): void => {
|
|
129
124
|
isOpen.value = true
|
|
130
125
|
|
|
@@ -225,7 +220,6 @@ onBeforeMount(() => {
|
|
|
225
220
|
createContainer()
|
|
226
221
|
setupContainer()
|
|
227
222
|
removeSiblings()
|
|
228
|
-
setToasterId()
|
|
229
223
|
})
|
|
230
224
|
|
|
231
225
|
onMounted(() => {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg
|
|
3
|
+
fill="none"
|
|
4
|
+
height="24"
|
|
5
|
+
stroke="currentColor"
|
|
6
|
+
stroke-linejoin="round"
|
|
7
|
+
stroke-width="2"
|
|
8
|
+
viewBox="0 0 24 24"
|
|
9
|
+
width="24"
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
>
|
|
12
|
+
<path
|
|
13
|
+
d="M3.36776 12.6884L9.49721 9.71379V7.09039C9.76954 5.16444 10.3673 4.26528 11.7194 3.02224C11.8781 2.87633 12.1219 2.87633 12.2806 3.02224C13.6327 4.26528 14.2305 5.16444 14.5028 7.09039V9.71379L20.6322 12.6884C20.8114 12.7753 20.9251 12.9569 20.9251 13.156V14.6153C20.9251 15.3248 20.2855 15.8631 19.5864 15.7419L14.5028 14.8611V18.8782L15.8204 19.7167C15.9704 19.8121 16.0611 19.9775 16.0611 20.1552V20.5842C16.0611 20.8138 15.875 21 15.6453 21H8.35467C8.12503 21 7.93886 20.8138 7.93886 20.5842V20.1552C7.93886 19.9775 8.02965 19.8121 8.17958 19.7167L9.49721 18.8782V14.8611L4.41364 15.7419C3.71448 15.8631 3.07493 15.3248 3.07493 14.6153V13.156C3.07493 12.9569 3.18865 12.7753 3.36776 12.6884Z"
|
|
14
|
+
/>
|
|
15
|
+
</svg>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg
|
|
3
|
+
fill="none"
|
|
4
|
+
height="24"
|
|
5
|
+
stroke="currentColor"
|
|
6
|
+
stroke-linecap="round"
|
|
7
|
+
stroke-linejoin="round"
|
|
8
|
+
stroke-width="2"
|
|
9
|
+
viewBox="0 0 24 24"
|
|
10
|
+
width="24"
|
|
11
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
+
>
|
|
13
|
+
<path
|
|
14
|
+
d="M15.3597 8.78016L13.2651 5.02005C12.9765 4.51424 12.519 4.12617 11.9729 3.92387L10.9579 3.54786L10.9963 7.19388M3.17855 21H21M6.86353 6.41244L18.8104 9.74182C20.3201 10.1626 21.1808 11.7505 20.7093 13.2451L20.1688 14.9582L14.0694 13.1637L8.26007 15.7715C7.48033 16.1216 6.60242 16.1866 5.77964 15.9552L3.75296 15.3852L8.46111 11.7213L6.34453 11.0993C4.20299 10.4699 2.96351 8.23769 3.56143 6.08715L4.36799 3.18616L6.86353 6.41244Z"
|
|
15
|
+
/>
|
|
16
|
+
</svg>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg fill="currentColor" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<path
|
|
4
|
+
d="M6.68972 7.85846L6.40328 8.81656C6.60964 8.87825 6.83041 8.87167 7.03273 8.79779L6.68972 7.85846ZM17.2459 4.00369L16.9029 3.06436V3.06436L17.2459 4.00369ZM20.4937 5.58137L19.5433 5.89241V5.89241L20.4937 5.58137ZM21 7.12834L21.3295 8.07249C21.8438 7.89302 22.1198 7.33497 21.9504 6.8173L21 7.12834ZM15.5606 9.02664L15.2311 8.08248C15.0059 8.16108 14.8162 8.31758 14.6963 8.52375L15.5606 9.02664ZM12.6589 14.014L11.7946 13.5111L12.6589 14.014ZM10.9291 15.4586L11.2699 16.3988L10.9291 15.4586ZM9.13562 16.1088L8.17668 15.8251C8.06967 16.1869 8.17541 16.5782 8.45011 16.8368C8.72481 17.0955 9.1217 17.1775 9.47642 17.0489L9.13562 16.1088ZM10.6689 10.9249L11.6278 11.2086C11.7342 10.8488 11.6303 10.4597 11.3586 10.2009C11.087 9.9421 10.6933 9.85715 10.3391 9.98088L10.6689 10.9249ZM8.78168 11.5842L9.11145 12.5282L9.11145 12.5282L8.78168 11.5842ZM4.08609 9.36208L5.02521 9.01849H5.02521L4.08609 9.36208ZM3.14867 6.79979L3.43511 5.84169C3.0726 5.73331 2.67996 5.83881 2.42059 6.11429C2.16122 6.38976 2.07954 6.78804 2.20954 7.14337L3.14867 6.79979ZM10.6692 3.4535L11.0864 2.54467L10.6692 3.4535ZM9.13885 3.32835L8.87488 2.36383H8.87487L9.13885 3.32835ZM8.19281 3.58728L7.92883 2.62275C7.61137 2.70963 7.357 2.94716 7.2486 3.25794C7.1402 3.56871 7.19167 3.91292 7.38622 4.17839L8.19281 3.58728ZM3.17855 20C2.62626 20 2.17855 20.4477 2.17855 21C2.17855 21.5523 2.62626 22 3.17855 22V20ZM21 22C21.5523 22 22 21.5523 22 21C22 20.4477 21.5523 20 21 20V22ZM7.03273 8.79779L17.5889 4.94302L16.9029 3.06436L6.34671 6.91913L7.03273 8.79779ZM19.5433 5.89241L20.0496 7.43938L21.9504 6.8173L21.4441 5.27033L19.5433 5.89241ZM20.6705 6.18418L15.2311 8.08248L15.8901 9.97079L21.3295 8.07249L20.6705 6.18418ZM14.6963 8.52375L11.7946 13.5111L13.5233 14.5169L16.425 9.52953L14.6963 8.52375ZM10.5883 14.5185L8.79482 15.1686L9.47642 17.0489L11.2699 16.3988L10.5883 14.5185ZM10.0946 16.3924L11.6278 11.2086L9.70992 10.6413L8.17668 15.8251L10.0946 16.3924ZM10.3391 9.98088L8.4519 10.6401L9.11145 12.5282L10.9986 11.869L10.3391 9.98088ZM5.02521 9.01849L4.08779 6.4562L2.20954 7.14337L3.14697 9.70566L5.02521 9.01849ZM2.86222 7.75788L6.40328 8.81656L6.97616 6.90036L3.43511 5.84169L2.86222 7.75788ZM8.4519 10.6401C7.05845 11.1269 5.53234 10.4047 5.02521 9.01849L3.14697 9.70566C4.02968 12.1184 6.68602 13.3755 9.11145 12.5282L8.4519 10.6401ZM11.7946 13.5111C11.523 13.9779 11.096 14.3344 10.5883 14.5185L11.2699 16.3988C12.2184 16.0549 13.0159 15.3889 13.5233 14.5169L11.7946 13.5111ZM17.5889 4.94302C18.3916 4.64989 19.2775 5.08022 19.5433 5.89241L21.4441 5.27033C20.8265 3.38315 18.7681 2.38325 16.9029 3.06436L17.5889 4.94302ZM14.7977 4.2482L11.0864 2.54467L10.2521 4.36233L13.9633 6.06586L14.7977 4.2482ZM8.87487 2.36383L7.92883 2.62275L8.45679 4.5518L9.40283 4.29288L8.87487 2.36383ZM7.38622 4.17839L9.33924 6.84332L10.9524 5.66109L8.9994 2.99616L7.38622 4.17839ZM11.0864 2.54467C10.3933 2.22654 9.61041 2.16252 8.87488 2.36383L9.40283 4.29288C9.68528 4.21558 9.98592 4.24017 10.2521 4.36233L11.0864 2.54467ZM3.17855 22H21V20H3.17855V22Z"
|
|
5
|
+
/>
|
|
6
|
+
</svg>
|
|
7
|
+
</template>
|
|
@@ -57,7 +57,10 @@ import IconOta from '@/components/icons/IconOta.vue'
|
|
|
57
57
|
import IconPaid from '@/components/icons/IconPaid.vue'
|
|
58
58
|
import IconPassport from '@/components/icons/IconPassport.vue'
|
|
59
59
|
import IconPayout from '@/components/icons/IconPayout.vue'
|
|
60
|
+
import IconPlane from '@/components/icons/IconPlane.vue'
|
|
60
61
|
import IconPlane2 from '@/components/icons/IconPlane2.vue'
|
|
62
|
+
import IconPlaneLanding from '@/components/icons/IconPlaneLanding.vue'
|
|
63
|
+
import IconPlaneTakeoff from '@/components/icons/IconPlaneTakeoff.vue'
|
|
61
64
|
import IconPlug from '@/components/icons/IconPlug.vue'
|
|
62
65
|
import IconPlugOff from '@/components/icons/IconPlugOff.vue'
|
|
63
66
|
import IconReceipt from '@/components/icons/IconReceipt.vue'
|
|
@@ -140,6 +143,9 @@ export const CustomCpIcons = {
|
|
|
140
143
|
paid: IconPaid,
|
|
141
144
|
passport: IconPassport,
|
|
142
145
|
payout: IconPayout,
|
|
146
|
+
plane: IconPlane,
|
|
147
|
+
'plane-takeoff': IconPlaneTakeoff,
|
|
148
|
+
'plane-landing': IconPlaneLanding,
|
|
143
149
|
'plane-2': IconPlane2,
|
|
144
150
|
plug: IconPlug,
|
|
145
151
|
'plug-off': IconPlugOff,
|