classcard-ui 0.2.211 → 0.2.212
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 +104 -100
- package/dist/classcard-ui.common.js.map +1 -1
- package/dist/classcard-ui.css +1 -1
- package/dist/classcard-ui.umd.js +104 -100
- package/dist/classcard-ui.umd.js.map +1 -1
- package/dist/classcard-ui.umd.min.js +1 -1
- package/dist/classcard-ui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/CDatepicker/CDatepicker.vue +3 -3
- package/src/components/CIcon/CIcon.vue +1 -1
- package/src/components/CInput/CInput.vue +1 -0
- package/src/components/CInputAddon/CInputAddon.vue +6 -7
- package/src/components/CMultiselect/CMultiselect.vue +7 -1
- package/src/components/CMultiselectr/CMultiselectr.vue +1 -1
- package/src/components/CRadio/CRadio.vue +5 -0
- package/src/components/CSwitch/CSwitch.vue +11 -14
- package/src/components/CTabs/CTabs.vue +1 -1
- package/src/stories/CCheckbox.stories.js +1 -1
- package/src/stories/CMultiselect.stories.js +2 -1
- package/src/stories/CPagination.stories.js +6 -1
- package/src/stories/CRadio.stories.js +1 -0
- package/src/stories/CSwitch.stories.js +1 -0
package/package.json
CHANGED
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
:value="inputValue"
|
|
38
38
|
:class="[
|
|
39
39
|
disabled
|
|
40
|
-
? 'border-gray-100 text-gray-400'
|
|
41
|
-
: 'border-gray-300 text-gray-700',
|
|
40
|
+
? 'border-gray-100 border-l-0 text-gray-400'
|
|
41
|
+
: 'border-gray-300 border-l-0 text-gray-700',
|
|
42
42
|
'bg-white w-full p-2 appearance-none border rounded-r-md focus:outline-none focus:border-blue-500 text-sm',
|
|
43
43
|
]"
|
|
44
44
|
:readonly="disabled"
|
|
@@ -87,8 +87,8 @@ export default {
|
|
|
87
87
|
data() {
|
|
88
88
|
const masks = {
|
|
89
89
|
input: [
|
|
90
|
-
"YYYY/MM/DD",
|
|
91
90
|
"MMM DD, YYYY",
|
|
91
|
+
"YYYY/MM/DD",
|
|
92
92
|
"DD-MM-YYYY",
|
|
93
93
|
"DD/MM/YYYY",
|
|
94
94
|
"YYYY-MM-DD",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
:type="type"
|
|
18
18
|
:value="inputValue"
|
|
19
19
|
@input="$emit('input', $event.target.value)"
|
|
20
|
+
@blur="$emit('blur', $event.target.value)"
|
|
20
21
|
:class="errorClasses"
|
|
21
22
|
class="focus:ring-indigo-500 focus:border-indigo-500 flex-1 block w-full px-3 py-2 rounded-md sm:text-sm disabled:opacity-50"
|
|
22
23
|
:placeholder="placeholder"
|
|
@@ -71,20 +71,19 @@
|
|
|
71
71
|
:disabled="disabled"
|
|
72
72
|
/>
|
|
73
73
|
<div class="absolute inset-y-0 right-3 flex items-center pointer-events-none">
|
|
74
|
+
<div
|
|
75
|
+
v-if="!isValidate"
|
|
76
|
+
class="right-0 pr-2 flex items-center pointer-events-none text-red-600"
|
|
77
|
+
>
|
|
78
|
+
<c-icon name="exclamation-circle" type="solid" class="h-5 w-5"></c-icon>
|
|
79
|
+
</div>
|
|
74
80
|
<span
|
|
75
|
-
v-if="isValidate"
|
|
76
81
|
class="text-gray-500 sm:text-sm"
|
|
77
82
|
:class="disabled ? 'opacity-50' : ''"
|
|
78
83
|
>
|
|
79
84
|
{{ addon }}
|
|
80
85
|
</span>
|
|
81
86
|
</div>
|
|
82
|
-
<div
|
|
83
|
-
v-if="!isValidate"
|
|
84
|
-
class="absolute inset-y-0 right-0 pr-2 flex items-center pointer-events-none text-red-600"
|
|
85
|
-
>
|
|
86
|
-
<c-icon name="exclamation-circle" type="solid" class="h-5 w-5"></c-icon>
|
|
87
|
-
</div>
|
|
88
87
|
</div>
|
|
89
88
|
<div v-if="inlineAddon && addonType == 'leading'" class="relative mt-1 flex rounded-md">
|
|
90
89
|
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
|
@@ -74,7 +74,10 @@ export default {
|
|
|
74
74
|
required: true,
|
|
75
75
|
},
|
|
76
76
|
label: String,
|
|
77
|
-
placeholder:
|
|
77
|
+
placeholder:{
|
|
78
|
+
type: String,
|
|
79
|
+
default: "Start typing... (min 2 characters) to search options",
|
|
80
|
+
},
|
|
78
81
|
// whether multiple fields are allowed or not
|
|
79
82
|
isMultiple: {
|
|
80
83
|
type: Boolean,
|
|
@@ -170,4 +173,7 @@ export default {
|
|
|
170
173
|
.vs__dropdown-toggle.vs__dropdown-option--highlight {
|
|
171
174
|
@apply bg-indigo-700 text-white;
|
|
172
175
|
}
|
|
176
|
+
.vs__dropdown-option--highlight {
|
|
177
|
+
@apply bg-indigo-700 text-white;
|
|
178
|
+
}
|
|
173
179
|
</style>
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
<input
|
|
11
11
|
type="radio"
|
|
12
12
|
:value="item.value"
|
|
13
|
+
:name="name"
|
|
13
14
|
v-model="selectedItem"
|
|
14
15
|
@click="onChange(item.value)"
|
|
15
16
|
class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 cursor-pointer border-gray-300 disabled:opacity-50"
|
|
@@ -44,6 +45,10 @@ export default {
|
|
|
44
45
|
isDisabled: {
|
|
45
46
|
type: Boolean,
|
|
46
47
|
},
|
|
48
|
+
name: {
|
|
49
|
+
type: String,
|
|
50
|
+
required: true,
|
|
51
|
+
},
|
|
47
52
|
},
|
|
48
53
|
data() {
|
|
49
54
|
return {
|
|
@@ -4,17 +4,18 @@
|
|
|
4
4
|
<div
|
|
5
5
|
v-if="size === 'small'"
|
|
6
6
|
:class="label == '' ? 'items-center' : 'items-start'"
|
|
7
|
-
class="flex justify-between"
|
|
7
|
+
class="flex justify-between cursor-pointer"
|
|
8
8
|
>
|
|
9
|
-
<span class="flex-grow flex flex-col" id="smallleft" v-if="direction == 'left'">
|
|
9
|
+
<span class="flex-grow flex flex-col" id="smallleft" v-if="direction == 'left'" @click="switchValue">
|
|
10
10
|
<span v-if="label" :class="classes" class="text-gray-900">{{ label }}</span>
|
|
11
11
|
<span v-if="description" class="text-sm text-gray-500">{{ description }}</span>
|
|
12
12
|
</span>
|
|
13
13
|
<button
|
|
14
14
|
type="button"
|
|
15
|
-
class="flex-shrink-0 group relative rounded-full inline-flex items-center justify-center h-5 w-10 cursor-pointer focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
|
|
15
|
+
class="flex-shrink-0 group relative rounded-full inline-flex items-center justify-center h-5 w-10 cursor-pointer focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 disabled:opacity-50"
|
|
16
16
|
aria-pressed="false"
|
|
17
17
|
@click="switchValue"
|
|
18
|
+
:disabled="disabled"
|
|
18
19
|
>
|
|
19
20
|
<span class="sr-only">Use setting</span>
|
|
20
21
|
<span
|
|
@@ -32,14 +33,14 @@
|
|
|
32
33
|
class="pointer-events-none absolute left-0 inline-block h-5 w-5 border border-gray-200 rounded-full bg-white transform ring-0 transition-transform ease-in-out duration-200"
|
|
33
34
|
></span>
|
|
34
35
|
</button>
|
|
35
|
-
<span class="flex flex-col" id="toggleLabel" v-if="direction == 'right'">
|
|
36
|
+
<span class="flex flex-col" id="toggleLabel" v-if="direction == 'right'" @click="switchValue">
|
|
36
37
|
<span v-if="label" :class="classes" class="text-gray-900">{{ label }}</span>
|
|
37
38
|
<span v-if="description" class="text-sm text-gray-500">{{ description }}</span>
|
|
38
39
|
</span>
|
|
39
40
|
</div>
|
|
40
41
|
<!-- large toggle -->
|
|
41
|
-
<div v-else :class="label == '' ? 'items-center' : 'items-start'" class="flex justify-between">
|
|
42
|
-
<span class="flex-grow flex flex-col" id="toggleLabel" v-if="direction == 'left'">
|
|
42
|
+
<div v-else :class="label == '' ? 'items-center' : 'items-start'" class="flex justify-between cursor-pointer">
|
|
43
|
+
<span class="flex-grow flex flex-col" id="toggleLabel" v-if="direction == 'left'" @click="switchValue">
|
|
43
44
|
<span v-if="label" :class="classes" class="text-gray-900">{{ label }}</span>
|
|
44
45
|
<span v-if="description" class="text-sm text-gray-500">{{ description }}</span>
|
|
45
46
|
</span>
|
|
@@ -48,7 +49,8 @@
|
|
|
48
49
|
aria-pressed="false"
|
|
49
50
|
:class="{ 'bg-indigo-600': isToggle == 1, 'bg-gray-200': isToggle == 0 }"
|
|
50
51
|
@click="switchValue"
|
|
51
|
-
class="relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
|
|
52
|
+
class="relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 disabled:opacity-50"
|
|
53
|
+
:disabled="disabled"
|
|
52
54
|
>
|
|
53
55
|
<span class="sr-only">Use setting</span>
|
|
54
56
|
<span
|
|
@@ -57,7 +59,7 @@
|
|
|
57
59
|
class="inline-block h-5 w-5 rounded-full bg-white transform ring-0 transition ease-in-out duration-200"
|
|
58
60
|
></span>
|
|
59
61
|
</button>
|
|
60
|
-
<span class="flex flex-col" id="toggleLabel" v-if="direction == 'right'">
|
|
62
|
+
<span class="flex flex-col" id="toggleLabel" v-if="direction == 'right'" disabled:opacity-50>
|
|
61
63
|
<span v-if="label" :class="classes" class="text-gray-900">{{ label }}</span>
|
|
62
64
|
<span v-if="description" class="text-sm text-gray-500">{{ description }}</span>
|
|
63
65
|
</span>
|
|
@@ -97,12 +99,7 @@ export default {
|
|
|
97
99
|
},
|
|
98
100
|
methods: {
|
|
99
101
|
switchValue() {
|
|
100
|
-
|
|
101
|
-
if (this.isToggle == 1) {
|
|
102
|
-
this.isToggle = 0;
|
|
103
|
-
} else if (this.isToggle == 0) {
|
|
104
|
-
this.isToggle = 1;
|
|
105
|
-
}
|
|
102
|
+
this.isToggle = this.isToggle === 1 ? 0 : 1;
|
|
106
103
|
this.$emit("returnToggleValue", this.isToggle);
|
|
107
104
|
},
|
|
108
105
|
},
|
|
@@ -8,6 +8,7 @@ export default {
|
|
|
8
8
|
options: Array,
|
|
9
9
|
label: String,
|
|
10
10
|
filterable: Boolean,
|
|
11
|
+
optionLabel: String,
|
|
11
12
|
},
|
|
12
13
|
};
|
|
13
14
|
|
|
@@ -19,7 +20,6 @@ const Template = (args, { argTypes }) => ({
|
|
|
19
20
|
|
|
20
21
|
export const Default = Template.bind({});
|
|
21
22
|
Default.args = {
|
|
22
|
-
// options: ["list", "of", "options"],
|
|
23
23
|
options: [
|
|
24
24
|
{
|
|
25
25
|
text: "Subjects",
|
|
@@ -90,6 +90,7 @@ Default.args = {
|
|
|
90
90
|
children: [{ id: "15820_Package", text: "Mathematics" }],
|
|
91
91
|
},
|
|
92
92
|
],
|
|
93
|
+
optionLabel: "text",
|
|
93
94
|
label: "Active",
|
|
94
95
|
showOptionImage: true,
|
|
95
96
|
filterable: false,
|