classcard-ui 0.2.1500 → 0.2.1502
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/classcard-ui.common.js +232 -150
- package/dist/classcard-ui.common.js.map +1 -1
- package/dist/classcard-ui.css +1 -1
- package/dist/classcard-ui.umd.js +232 -150
- package/dist/classcard-ui.umd.js.map +1 -1
- package/dist/classcard-ui.umd.min.js +3 -3
- package/dist/classcard-ui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/components/CAlertModal/CAlertModal.vue +5 -3
- package/src/components/CConfirmActionModal/CConfirmActionModal.vue +48 -12
- package/src/components/CMultiselect/CMultiselect.vue +20 -13
- package/src/icons.js +2 -0
package/package.json
CHANGED
package/src/.DS_Store
ADDED
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="z-100 fixed inset-0 overflow-y-auto">
|
|
3
3
|
<div
|
|
4
|
-
class="flex min-h-screen items-end justify-center
|
|
4
|
+
class="flex min-h-screen items-end justify-center p-4 text-center sm:block sm:p-0"
|
|
5
5
|
@click="$emit('proceedAddingEvent', false)"
|
|
6
6
|
>
|
|
7
7
|
<transition
|
|
@@ -73,13 +73,14 @@
|
|
|
73
73
|
</div>
|
|
74
74
|
</div>
|
|
75
75
|
<div
|
|
76
|
-
:class="`mt-4
|
|
76
|
+
:class="`mt-4 flex flex-col-reverse gap-3 sm:ml-10 sm:flex-row sm:items-center sm:justify-end sm:gap-4 ${btnWrapperClass}`"
|
|
77
77
|
>
|
|
78
78
|
<c-button
|
|
79
79
|
v-if="secondaryButtonText"
|
|
80
80
|
:type="secondaryButtonType"
|
|
81
81
|
:label="secondaryButtonText"
|
|
82
82
|
:id="getActionIDFn(secondaryButtonText)"
|
|
83
|
+
customClasses="w-full justify-center sm:w-auto"
|
|
83
84
|
@action="$emit('proceedAddingEvent', false)"
|
|
84
85
|
></c-button>
|
|
85
86
|
<c-button
|
|
@@ -87,7 +88,8 @@
|
|
|
87
88
|
:type="primaryButtonType"
|
|
88
89
|
:label="primaryButtonText"
|
|
89
90
|
:isLoading="primaryButtonLoader"
|
|
90
|
-
:id="getActionIDFn(
|
|
91
|
+
:id="getActionIDFn(primaryButtonText)"
|
|
92
|
+
customClasses="w-full justify-center sm:w-auto"
|
|
91
93
|
@action="$emit('proceedAddingEvent', true)"
|
|
92
94
|
></c-button>
|
|
93
95
|
</div>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<div
|
|
4
4
|
v-scroll-lock="true"
|
|
5
5
|
id="confirm-action-modal"
|
|
6
|
-
class="fixed inset-0
|
|
6
|
+
class="z-100 fixed inset-0 overflow-y-auto"
|
|
7
7
|
>
|
|
8
8
|
<div
|
|
9
9
|
class="flex min-h-screen items-end justify-center pt-4 pb-20 text-center sm:block sm:p-0 sm:px-4"
|
|
@@ -46,17 +46,28 @@
|
|
|
46
46
|
@click.stop
|
|
47
47
|
>
|
|
48
48
|
<div
|
|
49
|
-
class="modal-content flex items-center gap-4 overflow-y-auto px-6 pt-6 pb-4"
|
|
49
|
+
class="modal-content relative flex items-center gap-4 overflow-y-auto px-6 pt-6 pb-4"
|
|
50
50
|
>
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
<button
|
|
52
|
+
v-if="showClose"
|
|
53
|
+
type="button"
|
|
54
|
+
class="absolute top-3 right-3 p-2"
|
|
55
|
+
@click="$emit('close')"
|
|
54
56
|
>
|
|
55
57
|
<c-icon
|
|
56
|
-
name="
|
|
57
|
-
type="
|
|
58
|
+
name="x-mark-solid-v2"
|
|
59
|
+
type="solid"
|
|
60
|
+
class="h-6 w-6 text-gray-400"
|
|
61
|
+
cursor-type="cursor-pointer"
|
|
62
|
+
></c-icon>
|
|
63
|
+
</button>
|
|
64
|
+
<div aria-hidden="true" :class="iconContainerClasses">
|
|
65
|
+
<c-icon
|
|
66
|
+
:name="iconName"
|
|
67
|
+
:type="iconType"
|
|
58
68
|
:class="iconClasses"
|
|
59
|
-
viewBox="
|
|
69
|
+
:viewBox="resolvedIconViewBox"
|
|
70
|
+
:viewBoxOutline="resolvedIconViewBox"
|
|
60
71
|
></c-icon>
|
|
61
72
|
</div>
|
|
62
73
|
<div class="flex-1">
|
|
@@ -65,7 +76,12 @@
|
|
|
65
76
|
class="text-base font-medium text-gray-900"
|
|
66
77
|
>
|
|
67
78
|
{{ title }}
|
|
68
|
-
<span
|
|
79
|
+
<span
|
|
80
|
+
v-if="isRequired"
|
|
81
|
+
class="text-red-600"
|
|
82
|
+
aria-hidden="true"
|
|
83
|
+
>*</span
|
|
84
|
+
>
|
|
69
85
|
<span v-if="isRequired" class="sr-only">(required)</span>
|
|
70
86
|
</h3>
|
|
71
87
|
<div class="text-sm text-gray-500">
|
|
@@ -123,7 +139,7 @@
|
|
|
123
139
|
|
|
124
140
|
<script>
|
|
125
141
|
import CButton from "../CButton";
|
|
126
|
-
import CIcon from
|
|
142
|
+
import CIcon from "../CIcon/CIcon.vue";
|
|
127
143
|
import CTextarea from "../CTextarea";
|
|
128
144
|
|
|
129
145
|
const COLOR_VARIANT_CLASSES = {
|
|
@@ -220,6 +236,21 @@ export default {
|
|
|
220
236
|
type: String,
|
|
221
237
|
default: "red",
|
|
222
238
|
},
|
|
239
|
+
iconName: {
|
|
240
|
+
type: String,
|
|
241
|
+
default: "exclamation-triangle-outline-v2",
|
|
242
|
+
},
|
|
243
|
+
iconType: {
|
|
244
|
+
type: String,
|
|
245
|
+
default: "outline-v2",
|
|
246
|
+
},
|
|
247
|
+
iconViewBox: {
|
|
248
|
+
type: String,
|
|
249
|
+
},
|
|
250
|
+
showClose: {
|
|
251
|
+
type: Boolean,
|
|
252
|
+
default: false,
|
|
253
|
+
},
|
|
223
254
|
},
|
|
224
255
|
computed: {
|
|
225
256
|
ariaDescribedby() {
|
|
@@ -227,8 +258,13 @@ export default {
|
|
|
227
258
|
? "modal-message modal-description"
|
|
228
259
|
: "modal-message";
|
|
229
260
|
},
|
|
261
|
+
resolvedIconViewBox() {
|
|
262
|
+
return this.iconViewBox || "0 0 24 24";
|
|
263
|
+
},
|
|
230
264
|
colorVariantClasses() {
|
|
231
|
-
return
|
|
265
|
+
return (
|
|
266
|
+
COLOR_VARIANT_CLASSES[this.colorVariant] || COLOR_VARIANT_CLASSES.red
|
|
267
|
+
);
|
|
232
268
|
},
|
|
233
269
|
iconContainerClasses() {
|
|
234
270
|
return [
|
|
@@ -251,4 +287,4 @@ export default {
|
|
|
251
287
|
.modal-content {
|
|
252
288
|
max-height: calc(100vh - 200px);
|
|
253
289
|
}
|
|
254
|
-
</style>
|
|
290
|
+
</style>
|
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
<template v-else>
|
|
176
176
|
<div v-if="!isGrouped">
|
|
177
177
|
<div v-if="option.hasNoData" class="dropdown-menu-bordered"></div>
|
|
178
|
-
<div v-else class="mt-1 flex h-full w-full items-center">
|
|
178
|
+
<div v-else class="group mt-1 flex h-full w-full items-center">
|
|
179
179
|
<div @click.stop v-if="addCheckBox" class="flex-shrink-0">
|
|
180
180
|
<c-checkbox
|
|
181
181
|
:value="isChecked(option)"
|
|
@@ -216,12 +216,19 @@
|
|
|
216
216
|
"
|
|
217
217
|
:name="option.icon.name"
|
|
218
218
|
:type="option.icon.type"
|
|
219
|
-
:class="
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
219
|
+
:class="[
|
|
220
|
+
'mr-2 h-5 w-5 text-gray-400',
|
|
221
|
+
option.icon.optionIconClass,
|
|
222
|
+
option.isDisabled || option.disabled
|
|
223
|
+
? 'opacity-50'
|
|
224
|
+
: 'opacity-100',
|
|
225
|
+
]"
|
|
226
|
+
:viewBox="option.icon.viewBox || '0 0 20 20'"
|
|
227
|
+
:cursorType="
|
|
228
|
+
option.isDisabled || option.disabled
|
|
229
|
+
? 'cursor-not-allowed'
|
|
230
|
+
: 'cursor-pointer'
|
|
231
|
+
"
|
|
225
232
|
/>
|
|
226
233
|
</p>
|
|
227
234
|
<div class="w-full">
|
|
@@ -283,7 +290,7 @@
|
|
|
283
290
|
</v-list-subheader>
|
|
284
291
|
<div
|
|
285
292
|
:class="[
|
|
286
|
-
'mt-1 flex h-full w-full',
|
|
293
|
+
'group mt-1 flex h-full w-full',
|
|
287
294
|
option.description ? 'items-start' : 'items-center',
|
|
288
295
|
]"
|
|
289
296
|
>
|
|
@@ -878,7 +885,7 @@ export default {
|
|
|
878
885
|
if (animationCycle !== this.chipAnimationCycle) return;
|
|
879
886
|
|
|
880
887
|
const chipElements = Array.from(
|
|
881
|
-
vSelectEl.querySelectorAll(".vs__selected")
|
|
888
|
+
vSelectEl.querySelectorAll(".vs__selected")
|
|
882
889
|
);
|
|
883
890
|
const chipsToAnimate = chipElements.slice(-insertedCount);
|
|
884
891
|
|
|
@@ -892,7 +899,7 @@ export default {
|
|
|
892
899
|
void chipEl.offsetWidth;
|
|
893
900
|
chipEl.style.setProperty(
|
|
894
901
|
"--chip-enter-delay",
|
|
895
|
-
`${index * staggerMs}ms
|
|
902
|
+
`${index * staggerMs}ms`
|
|
896
903
|
);
|
|
897
904
|
chipEl.classList.add("chip-entering");
|
|
898
905
|
});
|
|
@@ -1031,7 +1038,7 @@ export default {
|
|
|
1031
1038
|
];
|
|
1032
1039
|
return selectedItemsArray.some(
|
|
1033
1040
|
(item) =>
|
|
1034
|
-
item[this.primaryComparisonKey] === option[this.primaryComparisonKey]
|
|
1041
|
+
item[this.primaryComparisonKey] === option[this.primaryComparisonKey]
|
|
1035
1042
|
)
|
|
1036
1043
|
? 1
|
|
1037
1044
|
: 0;
|
|
@@ -1042,7 +1049,7 @@ export default {
|
|
|
1042
1049
|
this.value = this.value.filter(
|
|
1043
1050
|
(item) =>
|
|
1044
1051
|
item[this.primaryComparisonKey] !==
|
|
1045
|
-
option[this.primaryComparisonKey]
|
|
1052
|
+
option[this.primaryComparisonKey]
|
|
1046
1053
|
);
|
|
1047
1054
|
} else {
|
|
1048
1055
|
this.value = [...this.value, option];
|
|
@@ -1058,7 +1065,7 @@ export default {
|
|
|
1058
1065
|
this.value = this.value.filter(
|
|
1059
1066
|
(item) =>
|
|
1060
1067
|
item[this.primaryComparisonKey] !==
|
|
1061
|
-
this.otherOption[this.primaryComparisonKey]
|
|
1068
|
+
this.otherOption[this.primaryComparisonKey]
|
|
1062
1069
|
);
|
|
1063
1070
|
} else {
|
|
1064
1071
|
this.value = [...this.value, this.otherOption];
|
package/src/icons.js
CHANGED
|
@@ -589,6 +589,8 @@ export default {
|
|
|
589
589
|
"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003ZM12 8.25a.75.75 0 0 1 .75.75v3.75a.75.75 0 0 1-1.5 0V9a.75.75 0 0 1 .75-.75Zm0 8.25a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z",
|
|
590
590
|
"exclamation-triangle-outline-v2":
|
|
591
591
|
"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z",
|
|
592
|
+
"question-mark-circle-outline-v2":
|
|
593
|
+
"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z",
|
|
592
594
|
"chain-link":
|
|
593
595
|
"M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244",
|
|
594
596
|
"invoice-unlink":
|