@antify/ui 3.1.18 → 3.1.20
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/components/inputs/AntColorInput/AntColorInput.stories.js +15 -6
- package/dist/components/inputs/AntColorInput/AntColorInput.stories.mjs +158 -2
- package/dist/components/inputs/AntColorInput/AntColorInput.types.d.ts +4 -2
- package/dist/components/inputs/AntColorInput/AntColorInput.types.js +13 -11
- package/dist/components/inputs/AntColorInput/AntColorInput.types.mjs +12 -10
- package/dist/components/inputs/AntColorInput/AntColorInput.vue +33 -16
- package/dist/components/inputs/AntColorInput/Color.vue +12 -14
- package/dist/components/inputs/AntColorInput/ColorSelection.vue +4 -2
- package/dist/components/inputs/AntTagInput.vue +1 -1
- package/package.json +1 -1
|
@@ -6,13 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
module.exports = exports.Summary = exports.Docs = void 0;
|
|
7
7
|
var _vue = require("vue");
|
|
8
8
|
var _enums = require("../../../enums");
|
|
9
|
-
var _AntColorInput =
|
|
9
|
+
var _AntColorInput = require("./AntColorInput.types");
|
|
10
|
+
var _AntColorInput2 = _interopRequireDefault(require("./AntColorInput.vue"));
|
|
10
11
|
var _AntFormGroup = _interopRequireDefault(require("../../forms/AntFormGroup.vue"));
|
|
11
12
|
var _AntFormGroupLabel = _interopRequireDefault(require("../../forms/AntFormGroupLabel.vue"));
|
|
12
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
14
|
const meta = {
|
|
14
15
|
title: "Inputs/ColorInput",
|
|
15
|
-
component:
|
|
16
|
+
component: _AntColorInput2.default,
|
|
16
17
|
argTypes: {
|
|
17
18
|
modelValue: {
|
|
18
19
|
control: "text"
|
|
@@ -29,6 +30,12 @@ const meta = {
|
|
|
29
30
|
},
|
|
30
31
|
options: Object.values(_enums.Size)
|
|
31
32
|
},
|
|
33
|
+
colorSize: {
|
|
34
|
+
control: {
|
|
35
|
+
type: "select"
|
|
36
|
+
},
|
|
37
|
+
options: Object.values(_AntColorInput.ColorButtonSize)
|
|
38
|
+
},
|
|
32
39
|
colorsPerRow: {
|
|
33
40
|
control: {
|
|
34
41
|
type: "number"
|
|
@@ -39,10 +46,11 @@ const meta = {
|
|
|
39
46
|
module.exports = meta;
|
|
40
47
|
const defaultOptions = ["primary-500", "red-500", "green-500", "blue-500", "yellow-500", "purple-500", "pink-500", "orange-500"];
|
|
41
48
|
const lightColorOptions = ["primary-300", "red-300", "green-300", "blue-300", "yellow-300", "purple-300", "pink-300", "orange-300"];
|
|
49
|
+
const bulkColorOptions = ["red-200", "red-300", "red-400", "red-500", "red-600", "red-700", "red-800", "red-900", "orange-200", "orange-300", "orange-400", "orange-500", "orange-600", "orange-700", "orange-800", "orange-900", "amber-200", "amber-300", "amber-400", "amber-500", "amber-600", "amber-700", "amber-800", "amber-900", "yellow-200", "yellow-300", "yellow-400", "yellow-500", "yellow-600", "yellow-700", "yellow-800", "yellow-900", "lime-200", "lime-300", "lime-400", "lime-500", "lime-600", "lime-700", "lime-800", "lime-900", "green-200", "green-300", "green-400", "green-500", "green-600", "green-700", "green-800", "green-900", "emerald-200", "emerald-300", "emerald-400", "emerald-500", "emerald-600", "emerald-700", "emerald-800", "emerald-900", "teal-200", "teal-300", "teal-400", "teal-500", "teal-600", "teal-700", "teal-800", "teal-900", "cyan-200", "cyan-300", "cyan-400", "cyan-500", "cyan-600", "cyan-700", "cyan-800", "cyan-900", "sky-200", "sky-300", "sky-400", "sky-500", "sky-600", "sky-700", "sky-800", "sky-900", "blue-200", "blue-300", "blue-400", "blue-500", "blue-600", "blue-700", "blue-800", "blue-900", "indigo-200", "indigo-300", "indigo-400", "indigo-500", "indigo-600", "indigo-700", "indigo-800", "indigo-900", "purple-200", "purple-300", "purple-400", "purple-500", "purple-600", "purple-700", "purple-800", "purple-900", "fuchsia-200", "fuchsia-300", "fuchsia-400", "fuchsia-500", "fuchsia-600", "fuchsia-700", "fuchsia-800", "fuchsia-900", "pink-200", "pink-300", "pink-400", "pink-500", "pink-600", "pink-700", "pink-800", "pink-900", "rose-200", "rose-300", "rose-400", "rose-500", "rose-600", "rose-700", "rose-800", "rose-900", "gray-200", "gray-300", "gray-400", "gray-500", "gray-600", "gray-700", "gray-800", "gray-900", "stone-200", "stone-300", "stone-400", "stone-500", "stone-600", "stone-700", "stone-800", "stone-900"];
|
|
42
50
|
const Docs = exports.Docs = {
|
|
43
51
|
render: args => ({
|
|
44
52
|
components: {
|
|
45
|
-
AntColorInput:
|
|
53
|
+
AntColorInput: _AntColorInput2.default
|
|
46
54
|
},
|
|
47
55
|
setup() {
|
|
48
56
|
const modelValue = (0, _vue.computed)({
|
|
@@ -62,8 +70,9 @@ const Docs = exports.Docs = {
|
|
|
62
70
|
args: {
|
|
63
71
|
label: "Label",
|
|
64
72
|
description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod",
|
|
65
|
-
options:
|
|
66
|
-
modelValue: "entry-1"
|
|
73
|
+
options: bulkColorOptions,
|
|
74
|
+
modelValue: "entry-1",
|
|
75
|
+
colorsPerRow: 8
|
|
67
76
|
}
|
|
68
77
|
};
|
|
69
78
|
const Summary = exports.Summary = {
|
|
@@ -74,7 +83,7 @@ const Summary = exports.Summary = {
|
|
|
74
83
|
},
|
|
75
84
|
render: args => ({
|
|
76
85
|
components: {
|
|
77
|
-
AntColorInput:
|
|
86
|
+
AntColorInput: _AntColorInput2.default,
|
|
78
87
|
AntFormGroup: _AntFormGroup.default,
|
|
79
88
|
AntFormGroupLabel: _AntFormGroupLabel.default
|
|
80
89
|
},
|
|
@@ -8,6 +8,9 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
InputState
|
|
10
10
|
} from "../../../enums/index.mjs";
|
|
11
|
+
import {
|
|
12
|
+
ColorButtonSize
|
|
13
|
+
} from "./AntColorInput.types.mjs";
|
|
11
14
|
import AntColorInput from "./AntColorInput.vue";
|
|
12
15
|
import AntFormGroup from "../../forms/AntFormGroup.vue";
|
|
13
16
|
import AntFormGroupLabel from "../../forms/AntFormGroupLabel.vue";
|
|
@@ -30,6 +33,12 @@ const meta = {
|
|
|
30
33
|
},
|
|
31
34
|
options: Object.values(Size)
|
|
32
35
|
},
|
|
36
|
+
colorSize: {
|
|
37
|
+
control: {
|
|
38
|
+
type: "select"
|
|
39
|
+
},
|
|
40
|
+
options: Object.values(ColorButtonSize)
|
|
41
|
+
},
|
|
33
42
|
colorsPerRow: {
|
|
34
43
|
control: {
|
|
35
44
|
type: "number"
|
|
@@ -58,6 +67,152 @@ const lightColorOptions = [
|
|
|
58
67
|
"pink-300",
|
|
59
68
|
"orange-300"
|
|
60
69
|
];
|
|
70
|
+
const bulkColorOptions = [
|
|
71
|
+
"red-200",
|
|
72
|
+
"red-300",
|
|
73
|
+
"red-400",
|
|
74
|
+
"red-500",
|
|
75
|
+
"red-600",
|
|
76
|
+
"red-700",
|
|
77
|
+
"red-800",
|
|
78
|
+
"red-900",
|
|
79
|
+
"orange-200",
|
|
80
|
+
"orange-300",
|
|
81
|
+
"orange-400",
|
|
82
|
+
"orange-500",
|
|
83
|
+
"orange-600",
|
|
84
|
+
"orange-700",
|
|
85
|
+
"orange-800",
|
|
86
|
+
"orange-900",
|
|
87
|
+
"amber-200",
|
|
88
|
+
"amber-300",
|
|
89
|
+
"amber-400",
|
|
90
|
+
"amber-500",
|
|
91
|
+
"amber-600",
|
|
92
|
+
"amber-700",
|
|
93
|
+
"amber-800",
|
|
94
|
+
"amber-900",
|
|
95
|
+
"yellow-200",
|
|
96
|
+
"yellow-300",
|
|
97
|
+
"yellow-400",
|
|
98
|
+
"yellow-500",
|
|
99
|
+
"yellow-600",
|
|
100
|
+
"yellow-700",
|
|
101
|
+
"yellow-800",
|
|
102
|
+
"yellow-900",
|
|
103
|
+
"lime-200",
|
|
104
|
+
"lime-300",
|
|
105
|
+
"lime-400",
|
|
106
|
+
"lime-500",
|
|
107
|
+
"lime-600",
|
|
108
|
+
"lime-700",
|
|
109
|
+
"lime-800",
|
|
110
|
+
"lime-900",
|
|
111
|
+
"green-200",
|
|
112
|
+
"green-300",
|
|
113
|
+
"green-400",
|
|
114
|
+
"green-500",
|
|
115
|
+
"green-600",
|
|
116
|
+
"green-700",
|
|
117
|
+
"green-800",
|
|
118
|
+
"green-900",
|
|
119
|
+
"emerald-200",
|
|
120
|
+
"emerald-300",
|
|
121
|
+
"emerald-400",
|
|
122
|
+
"emerald-500",
|
|
123
|
+
"emerald-600",
|
|
124
|
+
"emerald-700",
|
|
125
|
+
"emerald-800",
|
|
126
|
+
"emerald-900",
|
|
127
|
+
"teal-200",
|
|
128
|
+
"teal-300",
|
|
129
|
+
"teal-400",
|
|
130
|
+
"teal-500",
|
|
131
|
+
"teal-600",
|
|
132
|
+
"teal-700",
|
|
133
|
+
"teal-800",
|
|
134
|
+
"teal-900",
|
|
135
|
+
"cyan-200",
|
|
136
|
+
"cyan-300",
|
|
137
|
+
"cyan-400",
|
|
138
|
+
"cyan-500",
|
|
139
|
+
"cyan-600",
|
|
140
|
+
"cyan-700",
|
|
141
|
+
"cyan-800",
|
|
142
|
+
"cyan-900",
|
|
143
|
+
"sky-200",
|
|
144
|
+
"sky-300",
|
|
145
|
+
"sky-400",
|
|
146
|
+
"sky-500",
|
|
147
|
+
"sky-600",
|
|
148
|
+
"sky-700",
|
|
149
|
+
"sky-800",
|
|
150
|
+
"sky-900",
|
|
151
|
+
"blue-200",
|
|
152
|
+
"blue-300",
|
|
153
|
+
"blue-400",
|
|
154
|
+
"blue-500",
|
|
155
|
+
"blue-600",
|
|
156
|
+
"blue-700",
|
|
157
|
+
"blue-800",
|
|
158
|
+
"blue-900",
|
|
159
|
+
"indigo-200",
|
|
160
|
+
"indigo-300",
|
|
161
|
+
"indigo-400",
|
|
162
|
+
"indigo-500",
|
|
163
|
+
"indigo-600",
|
|
164
|
+
"indigo-700",
|
|
165
|
+
"indigo-800",
|
|
166
|
+
"indigo-900",
|
|
167
|
+
"purple-200",
|
|
168
|
+
"purple-300",
|
|
169
|
+
"purple-400",
|
|
170
|
+
"purple-500",
|
|
171
|
+
"purple-600",
|
|
172
|
+
"purple-700",
|
|
173
|
+
"purple-800",
|
|
174
|
+
"purple-900",
|
|
175
|
+
"fuchsia-200",
|
|
176
|
+
"fuchsia-300",
|
|
177
|
+
"fuchsia-400",
|
|
178
|
+
"fuchsia-500",
|
|
179
|
+
"fuchsia-600",
|
|
180
|
+
"fuchsia-700",
|
|
181
|
+
"fuchsia-800",
|
|
182
|
+
"fuchsia-900",
|
|
183
|
+
"pink-200",
|
|
184
|
+
"pink-300",
|
|
185
|
+
"pink-400",
|
|
186
|
+
"pink-500",
|
|
187
|
+
"pink-600",
|
|
188
|
+
"pink-700",
|
|
189
|
+
"pink-800",
|
|
190
|
+
"pink-900",
|
|
191
|
+
"rose-200",
|
|
192
|
+
"rose-300",
|
|
193
|
+
"rose-400",
|
|
194
|
+
"rose-500",
|
|
195
|
+
"rose-600",
|
|
196
|
+
"rose-700",
|
|
197
|
+
"rose-800",
|
|
198
|
+
"rose-900",
|
|
199
|
+
"gray-200",
|
|
200
|
+
"gray-300",
|
|
201
|
+
"gray-400",
|
|
202
|
+
"gray-500",
|
|
203
|
+
"gray-600",
|
|
204
|
+
"gray-700",
|
|
205
|
+
"gray-800",
|
|
206
|
+
"gray-900",
|
|
207
|
+
"stone-200",
|
|
208
|
+
"stone-300",
|
|
209
|
+
"stone-400",
|
|
210
|
+
"stone-500",
|
|
211
|
+
"stone-600",
|
|
212
|
+
"stone-700",
|
|
213
|
+
"stone-800",
|
|
214
|
+
"stone-900"
|
|
215
|
+
];
|
|
61
216
|
export const Docs = {
|
|
62
217
|
render: (args) => ({
|
|
63
218
|
components: {
|
|
@@ -81,8 +236,9 @@ export const Docs = {
|
|
|
81
236
|
args: {
|
|
82
237
|
label: "Label",
|
|
83
238
|
description: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod",
|
|
84
|
-
options:
|
|
85
|
-
modelValue: "entry-1"
|
|
239
|
+
options: bulkColorOptions,
|
|
240
|
+
modelValue: "entry-1",
|
|
241
|
+
colorsPerRow: 8
|
|
86
242
|
}
|
|
87
243
|
};
|
|
88
244
|
export const Summary = {
|
|
@@ -3,14 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
exports.ColorButtonSize = void 0;
|
|
7
|
+
var ColorButtonSize = exports.ColorButtonSize = /* @__PURE__ */(ColorButtonSize2 => {
|
|
8
|
+
ColorButtonSize2["xl2"] = "2xl";
|
|
9
|
+
ColorButtonSize2["xl"] = "xl";
|
|
10
|
+
ColorButtonSize2["lg"] = "lg";
|
|
11
|
+
ColorButtonSize2["md"] = "md";
|
|
12
|
+
ColorButtonSize2["sm"] = "sm";
|
|
13
|
+
ColorButtonSize2["xs"] = "xs";
|
|
14
|
+
ColorButtonSize2["xs2"] = "2xs";
|
|
15
|
+
ColorButtonSize2["xs3"] = "3xs";
|
|
16
|
+
ColorButtonSize2["xs4"] = "4xs";
|
|
17
|
+
return ColorButtonSize2;
|
|
18
|
+
})(ColorButtonSize || {});
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
export var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
export var ColorButtonSize = /* @__PURE__ */ ((ColorButtonSize2) => {
|
|
2
|
+
ColorButtonSize2["xl2"] = "2xl";
|
|
3
|
+
ColorButtonSize2["xl"] = "xl";
|
|
4
|
+
ColorButtonSize2["lg"] = "lg";
|
|
5
|
+
ColorButtonSize2["md"] = "md";
|
|
6
|
+
ColorButtonSize2["sm"] = "sm";
|
|
7
|
+
ColorButtonSize2["xs"] = "xs";
|
|
8
|
+
ColorButtonSize2["xs2"] = "2xs";
|
|
9
|
+
ColorButtonSize2["xs3"] = "3xs";
|
|
10
|
+
ColorButtonSize2["xs4"] = "4xs";
|
|
11
|
+
return ColorButtonSize2;
|
|
12
|
+
})(ColorButtonSize || {});
|
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
import Color from './Color.vue';
|
|
15
15
|
import AntDropdown from '../../AntDropdown.vue';
|
|
16
16
|
import ColorSelection from './ColorSelection.vue';
|
|
17
|
-
import
|
|
18
|
-
|
|
17
|
+
import {
|
|
18
|
+
ColorButtonSize,
|
|
19
19
|
} from './AntColorInput.types';
|
|
20
20
|
|
|
21
21
|
const emit = defineEmits([
|
|
@@ -33,19 +33,22 @@ const props = withDefaults(defineProps<{
|
|
|
33
33
|
disabled?: boolean;
|
|
34
34
|
state?: InputState;
|
|
35
35
|
size?: Size;
|
|
36
|
+
colorSize?: ColorButtonSize;
|
|
36
37
|
messages?: string[];
|
|
37
38
|
nullable?: boolean;
|
|
38
39
|
colorsPerRow?: number;
|
|
40
|
+
dropdownWrapperClass?: string | Record<string, boolean>;
|
|
39
41
|
}>(), {
|
|
40
42
|
state: InputState.base,
|
|
41
43
|
size: Size.md,
|
|
44
|
+
colorSize: ColorButtonSize.md,
|
|
42
45
|
messages: () => [],
|
|
43
46
|
nullable: false,
|
|
44
47
|
colorsPerRow: 4,
|
|
45
48
|
});
|
|
46
49
|
const _value = computed({
|
|
47
50
|
get() {
|
|
48
|
-
const found = props.options.find((option: string
|
|
51
|
+
const found = props.options.find((option: string) => option === props.modelValue);
|
|
49
52
|
|
|
50
53
|
if (!found) {
|
|
51
54
|
return props.options[0];
|
|
@@ -53,8 +56,8 @@ const _value = computed({
|
|
|
53
56
|
|
|
54
57
|
return found;
|
|
55
58
|
},
|
|
56
|
-
set(val: string
|
|
57
|
-
emit('update:modelValue',
|
|
59
|
+
set(val: string) {
|
|
60
|
+
emit('update:modelValue', val);
|
|
58
61
|
},
|
|
59
62
|
});
|
|
60
63
|
const hasInputState = computed(() => props.skeleton || props.readonly || props.disabled);
|
|
@@ -91,10 +94,7 @@ const itemClasses = computed(() => {
|
|
|
91
94
|
'focus:ring-2': (props.size === Size.xs2 || props.size === Size.xs || props.size === Size.sm) && !hasInputState.value,
|
|
92
95
|
'focus:ring-4': (props.size === Size.md || props.size === Size.lg) && !hasInputState.value,
|
|
93
96
|
'rounded-r-md': !hasRemoveButton.value,
|
|
94
|
-
'p-1':
|
|
95
|
-
'p-1.5': props.size === Size.xs || props.size === Size.sm,
|
|
96
|
-
'p-2': props.size === Size.md,
|
|
97
|
-
'p-2.5': props.size === Size.lg,
|
|
97
|
+
'p-1': true,
|
|
98
98
|
invisible: props.skeleton,
|
|
99
99
|
'opacity-50 cursor-not-allowed': props.disabled,
|
|
100
100
|
};
|
|
@@ -111,6 +111,20 @@ const itemClasses = computed(() => {
|
|
|
111
111
|
|
|
112
112
|
return classes;
|
|
113
113
|
});
|
|
114
|
+
const inputButtonSize = computed(() => {
|
|
115
|
+
switch(props.size) {
|
|
116
|
+
case Size.xs2:
|
|
117
|
+
return ColorButtonSize.xs4;
|
|
118
|
+
case Size.xs:
|
|
119
|
+
return ColorButtonSize.xs3;
|
|
120
|
+
case Size.sm:
|
|
121
|
+
return ColorButtonSize.xs2;
|
|
122
|
+
case Size.md:
|
|
123
|
+
return ColorButtonSize.xs;
|
|
124
|
+
default:
|
|
125
|
+
return ColorButtonSize.sm;
|
|
126
|
+
}
|
|
127
|
+
});
|
|
114
128
|
const showDropdown = ref<boolean>(false);
|
|
115
129
|
const itemRef = ref<HTMLDivElement | null>(null);
|
|
116
130
|
|
|
@@ -198,7 +212,7 @@ onMounted(() => {
|
|
|
198
212
|
>
|
|
199
213
|
<Color
|
|
200
214
|
:value="modelValue"
|
|
201
|
-
:size="
|
|
215
|
+
:size="inputButtonSize"
|
|
202
216
|
readonly
|
|
203
217
|
/>
|
|
204
218
|
</div>
|
|
@@ -219,12 +233,15 @@ onMounted(() => {
|
|
|
219
233
|
</div>
|
|
220
234
|
|
|
221
235
|
<template #content>
|
|
222
|
-
<
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
236
|
+
<div :class="dropdownWrapperClass">
|
|
237
|
+
<ColorSelection
|
|
238
|
+
:value="modelValue"
|
|
239
|
+
:colors="props.options"
|
|
240
|
+
:colors-per-row="colorsPerRow"
|
|
241
|
+
:color-size="colorSize"
|
|
242
|
+
@select="onColorSelect"
|
|
243
|
+
/>
|
|
244
|
+
</div>
|
|
228
245
|
</template>
|
|
229
246
|
</AntDropdown>
|
|
230
247
|
</AntField>
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from '@fortawesome/free-solid-svg-icons';
|
|
5
5
|
import AntIcon from '../../AntIcon.vue';
|
|
6
6
|
import {
|
|
7
|
-
|
|
7
|
+
ColorButtonSize,
|
|
8
8
|
} from './AntColorInput.types';
|
|
9
9
|
import {
|
|
10
10
|
computed, ref,
|
|
@@ -21,11 +21,11 @@ const props = withDefaults(defineProps<{
|
|
|
21
21
|
*/
|
|
22
22
|
value: string | null;
|
|
23
23
|
selected?: boolean;
|
|
24
|
-
size?:
|
|
24
|
+
size?: ColorButtonSize;
|
|
25
25
|
readonly?: boolean;
|
|
26
26
|
}>(), {
|
|
27
27
|
selected: false,
|
|
28
|
-
size:
|
|
28
|
+
size: ColorButtonSize.xl,
|
|
29
29
|
readonly: false,
|
|
30
30
|
});
|
|
31
31
|
|
|
@@ -37,17 +37,15 @@ defineExpose({
|
|
|
37
37
|
|
|
38
38
|
const buttonClasses = computed(() => ({
|
|
39
39
|
'rounded-sm cursor-pointer flex items-center justify-center': true,
|
|
40
|
-
'h-4 w-4':
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
'h-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
'h-8 w-8': ColorInputSize.xl === props.size,
|
|
50
|
-
'h-10 w-10': ColorInputSize.xl2 === props.size,
|
|
40
|
+
'h-4 w-4': props.size === ColorButtonSize.xs4,
|
|
41
|
+
'h-5 w-5': props.size === ColorButtonSize.xs3,
|
|
42
|
+
'h-6 w-6': props.size === ColorButtonSize.xs2,
|
|
43
|
+
'h-7 w-7': props.size === ColorButtonSize.xs,
|
|
44
|
+
'h-8 w-8': props.size === ColorButtonSize.sm,
|
|
45
|
+
'h-9 w-9': props.size === ColorButtonSize.md,
|
|
46
|
+
'h-10 w-10': props.size === ColorButtonSize.lg,
|
|
47
|
+
'h-11 w-11': props.size === ColorButtonSize.xl,
|
|
48
|
+
'h-12 w-12': props.size === ColorButtonSize.xl2,
|
|
51
49
|
}));
|
|
52
50
|
|
|
53
51
|
const iconClasses = computed(() => {
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from '../../../enums';
|
|
5
5
|
import Color from './Color.vue';
|
|
6
6
|
import {
|
|
7
|
-
|
|
7
|
+
ColorButtonSize,
|
|
8
8
|
} from './AntColorInput.types';
|
|
9
9
|
import {
|
|
10
10
|
onMounted, ref,
|
|
@@ -18,10 +18,12 @@ withDefaults(defineProps<{
|
|
|
18
18
|
// The selected color value
|
|
19
19
|
value: string | null;
|
|
20
20
|
colors: string[];
|
|
21
|
+
colorSize?: ColorButtonSize;
|
|
21
22
|
size?: Size;
|
|
22
23
|
colorsPerRow: number;
|
|
23
24
|
}>(), {
|
|
24
25
|
size: Size.md,
|
|
26
|
+
colorSize: ColorButtonSize.md,
|
|
25
27
|
});
|
|
26
28
|
|
|
27
29
|
type ColorComponentInstance = Element & {
|
|
@@ -57,7 +59,7 @@ onMounted(() => {
|
|
|
57
59
|
:ref="(val) => colorButtonRefs[index] = val as ColorComponentInstance"
|
|
58
60
|
:value="color"
|
|
59
61
|
:selected="color === value"
|
|
60
|
-
:size="
|
|
62
|
+
:size="colorSize"
|
|
61
63
|
@select="(val) => $emit('select', val)"
|
|
62
64
|
/>
|
|
63
65
|
</div>
|