vuetify-swatches 1.8.0 → 2.0.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/README.md +107 -30
- package/dist/components/SwatchButton.vue.d.ts +35 -0
- package/dist/components/VSwatches.vue.d.ts +79 -15
- package/dist/index.cjs.js +2 -2
- package/dist/index.es.js +182 -71
- package/dist/index.iife.js +2 -2
- package/dist/index.umd.js +2 -2
- package/dist/presets/advanced.d.ts +5 -0
- package/dist/presets/advanced.js +235 -0
- package/dist/presets/basic.d.ts +5 -0
- package/dist/presets/basic.js +28 -0
- package/dist/presets/index.d.ts +17 -0
- package/dist/presets/index.js +6 -0
- package/dist/vuetify-swatches.css +2 -2
- package/package.json +38 -23
- package/src/components/VSwatches.vue +152 -88
package/dist/index.es.js
CHANGED
|
@@ -5,52 +5,108 @@
|
|
|
5
5
|
* @author Logue <logue@hotmail.co.jp>
|
|
6
6
|
* @copyright 2022-2025 By Masashi Yoshikawa All rights reserved.
|
|
7
7
|
* @license MIT
|
|
8
|
-
* @version
|
|
8
|
+
* @version 2.0.0
|
|
9
9
|
* @see {@link https://github.com/logue/vuetify-swatches}
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import { defineComponent as
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
|
|
12
|
+
import { defineComponent as B, createBlock as c, openBlock as n, unref as r, withCtx as p, createVNode as z, mergeProps as C, createCommentVNode as x, computed as N, ref as L, watch as S, normalizeClass as A, createElementBlock as f, Fragment as b, renderList as y } from "vue";
|
|
13
|
+
import { VTooltip as I, VBtn as g, VIcon as j, VItemGroup as $, VItem as k } from "vuetify/components";
|
|
14
|
+
import m from "vuetify/util/colors";
|
|
15
|
+
function E(...l) {
|
|
16
|
+
let d = 0;
|
|
17
|
+
for (let i = 0; i < l.length; i++)
|
|
18
|
+
l[i].length > d && (d = l[i].length);
|
|
19
|
+
const t = l.length, e = Array(d);
|
|
20
|
+
for (let i = 0; i < d; ++i) {
|
|
21
|
+
const a = Array(t);
|
|
22
|
+
for (let o = 0; o < t; ++o)
|
|
23
|
+
a[o] = l[o][i];
|
|
24
|
+
e[i] = a;
|
|
25
|
+
}
|
|
26
|
+
return e;
|
|
27
|
+
}
|
|
28
|
+
var w = /* @__PURE__ */ B({
|
|
29
|
+
__name: "SwatchButton",
|
|
30
|
+
props: {
|
|
31
|
+
color: { default: void 0 },
|
|
32
|
+
isSelected: { type: Boolean, default: !1 },
|
|
33
|
+
size: { default: "2rem" },
|
|
34
|
+
icon: { default: "mdi-checkbox-marked-circle" },
|
|
35
|
+
iconSize: { default: "1rem" },
|
|
36
|
+
variant: { default: void 0 },
|
|
37
|
+
disabled: { type: Boolean, default: !1 },
|
|
38
|
+
rounded: { type: [String, Number, Boolean], default: void 0 },
|
|
39
|
+
border: { type: [String, Number, Boolean], default: !1 },
|
|
40
|
+
elevation: { default: void 0 },
|
|
41
|
+
tooltip: { type: Boolean, default: !1 },
|
|
42
|
+
tooltipLocation: { default: void 0 }
|
|
43
|
+
},
|
|
44
|
+
emits: ["click"],
|
|
45
|
+
setup(l, { emit: d }) {
|
|
46
|
+
const t = l, e = d;
|
|
47
|
+
return (i, a) => t.color ? (n(), c(r(I), {
|
|
48
|
+
key: 0,
|
|
49
|
+
disabled: !t.tooltip,
|
|
50
|
+
location: t.tooltipLocation,
|
|
51
|
+
text: t.color
|
|
52
|
+
}, {
|
|
53
|
+
activator: p(({ props: o }) => [
|
|
54
|
+
z(r(g), C(o, {
|
|
55
|
+
border: t.border,
|
|
56
|
+
class: [
|
|
57
|
+
t.color === r(m).shades.transparent ? "bg-transparent" : "",
|
|
58
|
+
"p-0"
|
|
59
|
+
],
|
|
60
|
+
color: t.color,
|
|
61
|
+
disabled: t.disabled,
|
|
62
|
+
elevation: t.elevation,
|
|
63
|
+
height: t.size,
|
|
64
|
+
variant: t.variant,
|
|
65
|
+
width: t.size,
|
|
66
|
+
"min-width": "auto",
|
|
67
|
+
onClick: a[0] || (a[0] = (v) => e("click"))
|
|
68
|
+
}), {
|
|
69
|
+
default: p(() => [
|
|
70
|
+
t.isSelected ? (n(), c(r(j), {
|
|
71
|
+
key: 0,
|
|
72
|
+
size: t.iconSize,
|
|
73
|
+
color: t.color !== r(m).shades.transparent ? t.color : void 0,
|
|
74
|
+
icon: t.icon
|
|
75
|
+
}, null, 8, ["size", "color", "icon"])) : x("", !0)
|
|
76
|
+
]),
|
|
77
|
+
_: 1
|
|
78
|
+
}, 16, ["border", "class", "color", "disabled", "elevation", "height", "variant", "width"])
|
|
79
|
+
]),
|
|
80
|
+
_: 1
|
|
81
|
+
}, 8, ["disabled", "location", "text"])) : (n(), c(r(g), {
|
|
82
|
+
key: 1,
|
|
83
|
+
height: t.size,
|
|
84
|
+
width: t.size,
|
|
85
|
+
class: "p-0",
|
|
86
|
+
disabled: "",
|
|
87
|
+
"min-width": "auto",
|
|
88
|
+
variant: "text"
|
|
89
|
+
}, null, 8, ["height", "width"]));
|
|
90
|
+
}
|
|
91
|
+
}), F = /* @__PURE__ */ B({
|
|
16
92
|
__name: "VSwatches",
|
|
17
93
|
props: {
|
|
18
94
|
/** Model value */
|
|
19
|
-
modelValue: { type: String, default:
|
|
95
|
+
modelValue: { type: String, default: m.shades.white },
|
|
20
96
|
/** Swatch colors */
|
|
21
97
|
swatches: {
|
|
22
98
|
type: Array,
|
|
23
|
-
default: () => [
|
|
24
|
-
[e.shades.black, e.shades.white, e.shades.transparent],
|
|
25
|
-
[
|
|
26
|
-
e.red.base,
|
|
27
|
-
e.pink.base,
|
|
28
|
-
e.purple.base,
|
|
29
|
-
e.deepPurple.base,
|
|
30
|
-
e.indigo.base,
|
|
31
|
-
e.blue.base,
|
|
32
|
-
e.lightBlue.base,
|
|
33
|
-
e.cyan.base
|
|
34
|
-
],
|
|
35
|
-
[
|
|
36
|
-
e.teal.base,
|
|
37
|
-
e.green.base,
|
|
38
|
-
e.lightGreen.base,
|
|
39
|
-
e.lime.base,
|
|
40
|
-
e.yellow.base,
|
|
41
|
-
e.amber.base,
|
|
42
|
-
e.orange.base,
|
|
43
|
-
e.deepOrange.base
|
|
44
|
-
],
|
|
45
|
-
[e.brown.base, e.blueGrey.base, e.grey.base]
|
|
46
|
-
]
|
|
99
|
+
default: () => []
|
|
47
100
|
},
|
|
48
101
|
/** Swatch size */
|
|
49
102
|
size: {
|
|
50
103
|
type: String,
|
|
51
104
|
default: "2rem"
|
|
52
105
|
},
|
|
53
|
-
/**
|
|
106
|
+
/**
|
|
107
|
+
* Selected icon
|
|
108
|
+
* @see {@link https://vuetifyjs.com/en/components/icons/#usage
|
|
109
|
+
*/
|
|
54
110
|
icon: {
|
|
55
111
|
type: String,
|
|
56
112
|
default: "mdi-checkbox-marked-circle"
|
|
@@ -60,6 +116,11 @@ var _ = /* @__PURE__ */ g({
|
|
|
60
116
|
type: String,
|
|
61
117
|
default: "1rem"
|
|
62
118
|
},
|
|
119
|
+
/** Display swatches in a single row */
|
|
120
|
+
inline: {
|
|
121
|
+
type: Boolean,
|
|
122
|
+
default: !1
|
|
123
|
+
},
|
|
63
124
|
/**
|
|
64
125
|
* The variant prop gives you easy access to several different button styles..
|
|
65
126
|
*
|
|
@@ -104,58 +165,108 @@ var _ = /* @__PURE__ */ g({
|
|
|
104
165
|
elevation: {
|
|
105
166
|
type: [String, Number],
|
|
106
167
|
default: void 0
|
|
168
|
+
},
|
|
169
|
+
/** Swap cols and rows */
|
|
170
|
+
transpose: {
|
|
171
|
+
type: Boolean,
|
|
172
|
+
default: !1
|
|
173
|
+
},
|
|
174
|
+
/**
|
|
175
|
+
* Tooltip
|
|
176
|
+
* @see {@link https://vuetifyjs.com/en/components/tooltips/}
|
|
177
|
+
*/
|
|
178
|
+
tooltip: {
|
|
179
|
+
type: Boolean,
|
|
180
|
+
default: !1
|
|
181
|
+
},
|
|
182
|
+
/**
|
|
183
|
+
* Tooltip location
|
|
184
|
+
* @see {@link https://vuetifyjs.com/en/components/tooltips/#props-location}
|
|
185
|
+
*/
|
|
186
|
+
tooltipLocation: {
|
|
187
|
+
type: String,
|
|
188
|
+
default: void 0
|
|
107
189
|
}
|
|
108
190
|
},
|
|
109
191
|
emits: {
|
|
110
192
|
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
|
111
|
-
"update:modelValue": (
|
|
193
|
+
"update:modelValue": (l) => !0
|
|
112
194
|
},
|
|
113
|
-
setup(
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
()
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
195
|
+
setup(l, { emit: d }) {
|
|
196
|
+
const t = d, e = l, i = N(() => {
|
|
197
|
+
const o = Array.isArray(e.swatches) ? e.swatches : Object.values(e.swatches);
|
|
198
|
+
return e.inline ? [o.flat(1 / 0)] : e.transpose ? E(...o) : o;
|
|
199
|
+
}), a = L(m.shades.white);
|
|
200
|
+
return S(
|
|
201
|
+
() => a.value,
|
|
202
|
+
(o) => t("update:modelValue", o)
|
|
203
|
+
), S(
|
|
204
|
+
() => e.modelValue,
|
|
205
|
+
(o) => {
|
|
206
|
+
o && (a.value = o);
|
|
207
|
+
},
|
|
208
|
+
{ immediate: !0 }
|
|
209
|
+
), (o, v) => (n(), c(r($), {
|
|
210
|
+
modelValue: a.value,
|
|
211
|
+
"onUpdate:modelValue": v[0] || (v[0] = (s) => a.value = s),
|
|
212
|
+
class: A([{ "d-inline": e.inline }, "v-swatches"]),
|
|
213
|
+
mandatory: ""
|
|
214
|
+
}, {
|
|
215
|
+
default: p(() => [
|
|
216
|
+
e.inline ? (n(!0), f(b, { key: 0 }, y(i.value[0], (s) => (n(), c(r(k), {
|
|
217
|
+
key: s,
|
|
218
|
+
value: s
|
|
219
|
+
}, {
|
|
220
|
+
default: p(({ isSelected: h, toggle: u }) => [
|
|
221
|
+
z(w, {
|
|
222
|
+
border: e.border,
|
|
223
|
+
color: s,
|
|
224
|
+
disabled: e.disabled,
|
|
225
|
+
elevation: e.elevation,
|
|
226
|
+
"icon-size": e.iconSize,
|
|
227
|
+
icon: e.icon,
|
|
228
|
+
"is-selected": h,
|
|
229
|
+
rounded: e.rounded,
|
|
230
|
+
size: e.size,
|
|
231
|
+
"tooltip-location": e.tooltipLocation,
|
|
232
|
+
tooltip: e.tooltip,
|
|
233
|
+
variant: e.variant,
|
|
234
|
+
onClick: u
|
|
235
|
+
}, null, 8, ["border", "color", "disabled", "elevation", "icon-size", "icon", "is-selected", "rounded", "size", "tooltip-location", "tooltip", "variant", "onClick"])
|
|
236
|
+
]),
|
|
237
|
+
_: 2
|
|
238
|
+
}, 1032, ["value"]))), 128)) : (n(!0), f(b, { key: 1 }, y(i.value, (s, h) => (n(), f("div", { key: h }, [
|
|
239
|
+
(n(!0), f(b, null, y(s, (u) => (n(), c(r(k), {
|
|
240
|
+
key: u,
|
|
241
|
+
value: u
|
|
136
242
|
}, {
|
|
137
|
-
default:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
243
|
+
default: p(({ isSelected: V, toggle: _ }) => [
|
|
244
|
+
z(w, {
|
|
245
|
+
border: e.border,
|
|
246
|
+
color: u,
|
|
247
|
+
disabled: e.disabled,
|
|
248
|
+
elevation: e.elevation,
|
|
249
|
+
"icon-size": e.iconSize,
|
|
250
|
+
icon: e.icon,
|
|
251
|
+
"is-selected": V,
|
|
252
|
+
rounded: e.rounded,
|
|
253
|
+
size: e.size,
|
|
254
|
+
"tooltip-location": e.tooltipLocation,
|
|
255
|
+
tooltip: e.tooltip,
|
|
256
|
+
variant: e.variant,
|
|
257
|
+
onClick: _
|
|
258
|
+
}, null, 8, ["border", "color", "disabled", "elevation", "icon-size", "icon", "is-selected", "rounded", "size", "tooltip-location", "tooltip", "variant", "onClick"])
|
|
148
259
|
]),
|
|
149
260
|
_: 2
|
|
150
|
-
}, 1032, ["
|
|
261
|
+
}, 1032, ["value"]))), 128))
|
|
151
262
|
]))), 128))
|
|
152
263
|
]),
|
|
153
264
|
_: 1
|
|
154
|
-
}));
|
|
265
|
+
}, 8, ["modelValue", "class"]));
|
|
155
266
|
}
|
|
156
267
|
});
|
|
157
|
-
const
|
|
268
|
+
const T = (l) => l.component("VSwatches", F);
|
|
158
269
|
export {
|
|
159
|
-
|
|
160
|
-
|
|
270
|
+
F as default,
|
|
271
|
+
T as install
|
|
161
272
|
};
|
package/dist/index.iife.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* @author Logue <logue@hotmail.co.jp>
|
|
6
6
|
* @copyright 2022-2025 By Masashi Yoshikawa All rights reserved.
|
|
7
7
|
* @license MIT
|
|
8
|
-
* @version
|
|
8
|
+
* @version 2.0.0
|
|
9
9
|
* @see {@link https://github.com/logue/vuetify-swatches}
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
var VSwatches=(function(
|
|
12
|
+
var VSwatches=(function(f,e,d,b){"use strict";function y(l){return l&&typeof l=="object"&&"default"in l?l:{default:l}}var u=y(b);function B(...l){let r=0;for(let a=0;a<l.length;a++)l[a].length>r&&(r=l[a].length);const o=l.length,t=Array(r);for(let a=0;a<r;++a){const n=Array(o);for(let i=0;i<o;++i)n[i]=l[i][a];t[a]=n}return t}var h=e.defineComponent({__name:"SwatchButton",props:{color:{default:void 0},isSelected:{type:Boolean,default:!1},size:{default:"2rem"},icon:{default:"mdi-checkbox-marked-circle"},iconSize:{default:"1rem"},variant:{default:void 0},disabled:{type:Boolean,default:!1},rounded:{type:[String,Number,Boolean],default:void 0},border:{type:[String,Number,Boolean],default:!1},elevation:{default:void 0},tooltip:{type:Boolean,default:!1},tooltipLocation:{default:void 0}},emits:["click"],setup(l,{emit:r}){const o=l,t=r;return(a,n)=>o.color?(e.openBlock(),e.createBlock(e.unref(d.VTooltip),{key:0,disabled:!o.tooltip,location:o.tooltipLocation,text:o.color},{activator:e.withCtx(({props:i})=>[e.createVNode(e.unref(d.VBtn),e.mergeProps(i,{border:o.border,class:[o.color===e.unref(u.default).shades.transparent?"bg-transparent":"","p-0"],color:o.color,disabled:o.disabled,elevation:o.elevation,height:o.size,variant:o.variant,width:o.size,"min-width":"auto",onClick:n[0]||(n[0]=p=>t("click"))}),{default:e.withCtx(()=>[o.isSelected?(e.openBlock(),e.createBlock(e.unref(d.VIcon),{key:0,size:o.iconSize,color:o.color!==e.unref(u.default).shades.transparent?o.color:void 0,icon:o.icon},null,8,["size","color","icon"])):e.createCommentVNode("",!0)]),_:1},16,["border","class","color","disabled","elevation","height","variant","width"])]),_:1},8,["disabled","location","text"])):(e.openBlock(),e.createBlock(e.unref(d.VBtn),{key:1,height:o.size,width:o.size,class:"p-0",disabled:"","min-width":"auto",variant:"text"},null,8,["height","width"]))}}),k=e.defineComponent({__name:"VSwatches",props:{modelValue:{type:String,default:u.default.shades.white},swatches:{type:Array,default:()=>[]},size:{type:String,default:"2rem"},icon:{type:String,default:"mdi-checkbox-marked-circle"},iconSize:{type:String,default:"1rem"},inline:{type:Boolean,default:!1},variant:{type:String,default:void 0},disabled:{type:Boolean,default:!1},rounded:{type:[String,Number,Boolean],default:void 0},border:{type:[String,Number,Boolean],default:!1},elevation:{type:[String,Number],default:void 0},transpose:{type:Boolean,default:!1},tooltip:{type:Boolean,default:!1},tooltipLocation:{type:String,default:void 0}},emits:{"update:modelValue":l=>!0},setup(l,{emit:r}){const o=r,t=l,a=e.computed(()=>{const i=Array.isArray(t.swatches)?t.swatches:Object.values(t.swatches);return t.inline?[i.flat(1/0)]:t.transpose?B(...i):i}),n=e.ref(u.default.shades.white);return e.watch(()=>n.value,i=>o("update:modelValue",i)),e.watch(()=>t.modelValue,i=>{i&&(n.value=i)},{immediate:!0}),(i,p)=>(e.openBlock(),e.createBlock(e.unref(d.VItemGroup),{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=c=>n.value=c),class:e.normalizeClass([{"d-inline":t.inline},"v-swatches"]),mandatory:""},{default:e.withCtx(()=>[t.inline?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(a.value[0],c=>(e.openBlock(),e.createBlock(e.unref(d.VItem),{key:c,value:c},{default:e.withCtx(({isSelected:m,toggle:s})=>[e.createVNode(h,{border:t.border,color:c,disabled:t.disabled,elevation:t.elevation,"icon-size":t.iconSize,icon:t.icon,"is-selected":m,rounded:t.rounded,size:t.size,"tooltip-location":t.tooltipLocation,tooltip:t.tooltip,variant:t.variant,onClick:s},null,8,["border","color","disabled","elevation","icon-size","icon","is-selected","rounded","size","tooltip-location","tooltip","variant","onClick"])]),_:2},1032,["value"]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(a.value,(c,m)=>(e.openBlock(),e.createElementBlock("div",{key:m},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c,s=>(e.openBlock(),e.createBlock(e.unref(d.VItem),{key:s,value:s},{default:e.withCtx(({isSelected:z,toggle:S})=>[e.createVNode(h,{border:t.border,color:s,disabled:t.disabled,elevation:t.elevation,"icon-size":t.iconSize,icon:t.icon,"is-selected":z,rounded:t.rounded,size:t.size,"tooltip-location":t.tooltipLocation,tooltip:t.tooltip,variant:t.variant,onClick:S},null,8,["border","color","disabled","elevation","icon-size","icon","is-selected","rounded","size","tooltip-location","tooltip","variant","onClick"])]),_:2},1032,["value"]))),128))]))),128))]),_:1},8,["modelValue","class"]))}});const w=l=>l.component("VSwatches",k);return f.default=k,f.install=w,Object.defineProperty(f,"__esModule",{value:!0}),f})({},Vue,Vuetify/components,colors);
|
package/dist/index.umd.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* @author Logue <logue@hotmail.co.jp>
|
|
6
6
|
* @copyright 2022-2025 By Masashi Yoshikawa All rights reserved.
|
|
7
7
|
* @license MIT
|
|
8
|
-
* @version
|
|
8
|
+
* @version 2.0.0
|
|
9
9
|
* @see {@link https://github.com/logue/vuetify-swatches}
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
(function(
|
|
12
|
+
(function(a,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vuetify/components"),require("vuetify/util/colors")):typeof define=="function"&&define.amd?define(["exports","vue","vuetify/components","vuetify/util/colors"],e):(a=typeof globalThis<"u"?globalThis:a||self,e(a.VSwatches={},a.Vue,a["Vuetify/components"],a.colors))})(this,(function(a,e,c,k){"use strict";function b(i){return i&&typeof i=="object"&&"default"in i?i:{default:i}}var u=b(k);function B(...i){let d=0;for(let n=0;n<i.length;n++)i[n].length>d&&(d=i[n].length);const o=i.length,t=Array(d);for(let n=0;n<d;++n){const r=Array(o);for(let l=0;l<o;++l)r[l]=i[l][n];t[n]=r}return t}var h=e.defineComponent({__name:"SwatchButton",props:{color:{default:void 0},isSelected:{type:Boolean,default:!1},size:{default:"2rem"},icon:{default:"mdi-checkbox-marked-circle"},iconSize:{default:"1rem"},variant:{default:void 0},disabled:{type:Boolean,default:!1},rounded:{type:[String,Number,Boolean],default:void 0},border:{type:[String,Number,Boolean],default:!1},elevation:{default:void 0},tooltip:{type:Boolean,default:!1},tooltipLocation:{default:void 0}},emits:["click"],setup(i,{emit:d}){const o=i,t=d;return(n,r)=>o.color?(e.openBlock(),e.createBlock(e.unref(c.VTooltip),{key:0,disabled:!o.tooltip,location:o.tooltipLocation,text:o.color},{activator:e.withCtx(({props:l})=>[e.createVNode(e.unref(c.VBtn),e.mergeProps(l,{border:o.border,class:[o.color===e.unref(u.default).shades.transparent?"bg-transparent":"","p-0"],color:o.color,disabled:o.disabled,elevation:o.elevation,height:o.size,variant:o.variant,width:o.size,"min-width":"auto",onClick:r[0]||(r[0]=p=>t("click"))}),{default:e.withCtx(()=>[o.isSelected?(e.openBlock(),e.createBlock(e.unref(c.VIcon),{key:0,size:o.iconSize,color:o.color!==e.unref(u.default).shades.transparent?o.color:void 0,icon:o.icon},null,8,["size","color","icon"])):e.createCommentVNode("",!0)]),_:1},16,["border","class","color","disabled","elevation","height","variant","width"])]),_:1},8,["disabled","location","text"])):(e.openBlock(),e.createBlock(e.unref(c.VBtn),{key:1,height:o.size,width:o.size,class:"p-0",disabled:"","min-width":"auto",variant:"text"},null,8,["height","width"]))}}),y=e.defineComponent({__name:"VSwatches",props:{modelValue:{type:String,default:u.default.shades.white},swatches:{type:Array,default:()=>[]},size:{type:String,default:"2rem"},icon:{type:String,default:"mdi-checkbox-marked-circle"},iconSize:{type:String,default:"1rem"},inline:{type:Boolean,default:!1},variant:{type:String,default:void 0},disabled:{type:Boolean,default:!1},rounded:{type:[String,Number,Boolean],default:void 0},border:{type:[String,Number,Boolean],default:!1},elevation:{type:[String,Number],default:void 0},transpose:{type:Boolean,default:!1},tooltip:{type:Boolean,default:!1},tooltipLocation:{type:String,default:void 0}},emits:{"update:modelValue":i=>!0},setup(i,{emit:d}){const o=d,t=i,n=e.computed(()=>{const l=Array.isArray(t.swatches)?t.swatches:Object.values(t.swatches);return t.inline?[l.flat(1/0)]:t.transpose?B(...l):l}),r=e.ref(u.default.shades.white);return e.watch(()=>r.value,l=>o("update:modelValue",l)),e.watch(()=>t.modelValue,l=>{l&&(r.value=l)},{immediate:!0}),(l,p)=>(e.openBlock(),e.createBlock(e.unref(c.VItemGroup),{modelValue:r.value,"onUpdate:modelValue":p[0]||(p[0]=s=>r.value=s),class:e.normalizeClass([{"d-inline":t.inline},"v-swatches"]),mandatory:""},{default:e.withCtx(()=>[t.inline?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(n.value[0],s=>(e.openBlock(),e.createBlock(e.unref(c.VItem),{key:s,value:s},{default:e.withCtx(({isSelected:m,toggle:f})=>[e.createVNode(h,{border:t.border,color:s,disabled:t.disabled,elevation:t.elevation,"icon-size":t.iconSize,icon:t.icon,"is-selected":m,rounded:t.rounded,size:t.size,"tooltip-location":t.tooltipLocation,tooltip:t.tooltip,variant:t.variant,onClick:f},null,8,["border","color","disabled","elevation","icon-size","icon","is-selected","rounded","size","tooltip-location","tooltip","variant","onClick"])]),_:2},1032,["value"]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(n.value,(s,m)=>(e.openBlock(),e.createElementBlock("div",{key:m},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s,f=>(e.openBlock(),e.createBlock(e.unref(c.VItem),{key:f,value:f},{default:e.withCtx(({isSelected:z,toggle:S})=>[e.createVNode(h,{border:t.border,color:f,disabled:t.disabled,elevation:t.elevation,"icon-size":t.iconSize,icon:t.icon,"is-selected":z,rounded:t.rounded,size:t.size,"tooltip-location":t.tooltipLocation,tooltip:t.tooltip,variant:t.variant,onClick:S},null,8,["border","color","disabled","elevation","icon-size","icon","is-selected","rounded","size","tooltip-location","tooltip","variant","onClick"])]),_:2},1032,["value"]))),128))]))),128))]),_:1},8,["modelValue","class"]))}});const w=i=>i.component("VSwatches",y);a.default=y,a.install=w,Object.defineProperty(a,"__esModule",{value:!0})}));
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Advanced Material Design color palette with all color variations
|
|
3
|
+
* Contains lighten and darken variations for each color
|
|
4
|
+
*/
|
|
5
|
+
export declare const advancedPalette: readonly [readonly [string, string, string], readonly [string, string, string, string, string, string, string, string, string, string], readonly [string, string, string, string, string, string, string, string, string, string], readonly [string, string, string, string, string, string, string, string, string, string], readonly [string, string, string, string, string, string, string, string, string, string], readonly [string, string, string, string, string, string, string, string, string, string], readonly [string, string, string, string, string, string, string, string, string, string], readonly [string, string, string, string, string, string, string, string, string, string], readonly [string, string, string, string, string, string, string, string, string, string], readonly [string, string, string, string, string, string, string, string, string, string], readonly [string, string, string, string, string, string, string, string, string, string], readonly [string, string, string, string, string, string, string, string, string, string], readonly [string, string, string, string, string, string, string, string, string, string], readonly [string, string, string, string, string, string, string, string, string, string], readonly [string, string, string, string, string, string, string, string, string, string], readonly [string, string, string, string, string, string, string, string, string, string], readonly [string, string, string, string, string, string, string, string, string, string], readonly [string, string, string, string, string, string, string, string, string, string], readonly [string, string, string, string, string, string, string, string, string, string], readonly [string, string, string, string, string, string, string, string, string, string]];
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import e from "vuetify/util/colors";
|
|
2
|
+
const l = [
|
|
3
|
+
[e.shades.black, e.shades.white, e.shades.transparent],
|
|
4
|
+
[
|
|
5
|
+
e.red.lighten5,
|
|
6
|
+
e.red.lighten4,
|
|
7
|
+
e.red.lighten3,
|
|
8
|
+
e.red.lighten2,
|
|
9
|
+
e.red.lighten1,
|
|
10
|
+
e.red.base,
|
|
11
|
+
e.red.darken1,
|
|
12
|
+
e.red.darken2,
|
|
13
|
+
e.red.darken3,
|
|
14
|
+
e.red.darken4
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
e.pink.lighten5,
|
|
18
|
+
e.pink.lighten4,
|
|
19
|
+
e.pink.lighten3,
|
|
20
|
+
e.pink.lighten2,
|
|
21
|
+
e.pink.lighten1,
|
|
22
|
+
e.pink.base,
|
|
23
|
+
e.pink.darken1,
|
|
24
|
+
e.pink.darken2,
|
|
25
|
+
e.pink.darken3,
|
|
26
|
+
e.pink.darken4
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
e.purple.lighten5,
|
|
30
|
+
e.purple.lighten4,
|
|
31
|
+
e.purple.lighten3,
|
|
32
|
+
e.purple.lighten2,
|
|
33
|
+
e.purple.lighten1,
|
|
34
|
+
e.purple.base,
|
|
35
|
+
e.purple.darken1,
|
|
36
|
+
e.purple.darken2,
|
|
37
|
+
e.purple.darken3,
|
|
38
|
+
e.purple.darken4
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
e.deepPurple.lighten5,
|
|
42
|
+
e.deepPurple.lighten4,
|
|
43
|
+
e.deepPurple.lighten3,
|
|
44
|
+
e.deepPurple.lighten2,
|
|
45
|
+
e.deepPurple.lighten1,
|
|
46
|
+
e.deepPurple.base,
|
|
47
|
+
e.deepPurple.darken1,
|
|
48
|
+
e.deepPurple.darken2,
|
|
49
|
+
e.deepPurple.darken3,
|
|
50
|
+
e.deepPurple.darken4
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
e.indigo.lighten5,
|
|
54
|
+
e.indigo.lighten4,
|
|
55
|
+
e.indigo.lighten3,
|
|
56
|
+
e.indigo.lighten2,
|
|
57
|
+
e.indigo.lighten1,
|
|
58
|
+
e.indigo.base,
|
|
59
|
+
e.indigo.darken1,
|
|
60
|
+
e.indigo.darken2,
|
|
61
|
+
e.indigo.darken3,
|
|
62
|
+
e.indigo.darken4
|
|
63
|
+
],
|
|
64
|
+
[
|
|
65
|
+
e.blue.lighten5,
|
|
66
|
+
e.blue.lighten4,
|
|
67
|
+
e.blue.lighten3,
|
|
68
|
+
e.blue.lighten2,
|
|
69
|
+
e.blue.lighten1,
|
|
70
|
+
e.blue.base,
|
|
71
|
+
e.blue.darken1,
|
|
72
|
+
e.blue.darken2,
|
|
73
|
+
e.blue.darken3,
|
|
74
|
+
e.blue.darken4
|
|
75
|
+
],
|
|
76
|
+
[
|
|
77
|
+
e.lightBlue.lighten5,
|
|
78
|
+
e.lightBlue.lighten4,
|
|
79
|
+
e.lightBlue.lighten3,
|
|
80
|
+
e.lightBlue.lighten2,
|
|
81
|
+
e.lightBlue.lighten1,
|
|
82
|
+
e.lightBlue.base,
|
|
83
|
+
e.lightBlue.darken1,
|
|
84
|
+
e.lightBlue.darken2,
|
|
85
|
+
e.lightBlue.darken3,
|
|
86
|
+
e.lightBlue.darken4
|
|
87
|
+
],
|
|
88
|
+
[
|
|
89
|
+
e.cyan.lighten5,
|
|
90
|
+
e.cyan.lighten4,
|
|
91
|
+
e.cyan.lighten3,
|
|
92
|
+
e.cyan.lighten2,
|
|
93
|
+
e.cyan.lighten1,
|
|
94
|
+
e.cyan.base,
|
|
95
|
+
e.cyan.darken1,
|
|
96
|
+
e.cyan.darken2,
|
|
97
|
+
e.cyan.darken3,
|
|
98
|
+
e.cyan.darken4
|
|
99
|
+
],
|
|
100
|
+
[
|
|
101
|
+
e.teal.lighten5,
|
|
102
|
+
e.teal.lighten4,
|
|
103
|
+
e.teal.lighten3,
|
|
104
|
+
e.teal.lighten2,
|
|
105
|
+
e.teal.lighten1,
|
|
106
|
+
e.teal.base,
|
|
107
|
+
e.teal.darken1,
|
|
108
|
+
e.teal.darken2,
|
|
109
|
+
e.teal.darken3,
|
|
110
|
+
e.teal.darken4
|
|
111
|
+
],
|
|
112
|
+
[
|
|
113
|
+
e.green.lighten5,
|
|
114
|
+
e.green.lighten4,
|
|
115
|
+
e.green.lighten3,
|
|
116
|
+
e.green.lighten2,
|
|
117
|
+
e.green.lighten1,
|
|
118
|
+
e.green.base,
|
|
119
|
+
e.green.darken1,
|
|
120
|
+
e.green.darken2,
|
|
121
|
+
e.green.darken3,
|
|
122
|
+
e.green.darken4
|
|
123
|
+
],
|
|
124
|
+
[
|
|
125
|
+
e.lightGreen.lighten5,
|
|
126
|
+
e.lightGreen.lighten4,
|
|
127
|
+
e.lightGreen.lighten3,
|
|
128
|
+
e.lightGreen.lighten2,
|
|
129
|
+
e.lightGreen.lighten1,
|
|
130
|
+
e.lightGreen.base,
|
|
131
|
+
e.lightGreen.darken1,
|
|
132
|
+
e.lightGreen.darken2,
|
|
133
|
+
e.lightGreen.darken3,
|
|
134
|
+
e.lightGreen.darken4
|
|
135
|
+
],
|
|
136
|
+
[
|
|
137
|
+
e.lime.lighten5,
|
|
138
|
+
e.lime.lighten4,
|
|
139
|
+
e.lime.lighten3,
|
|
140
|
+
e.lime.lighten2,
|
|
141
|
+
e.lime.lighten1,
|
|
142
|
+
e.lime.base,
|
|
143
|
+
e.lime.darken1,
|
|
144
|
+
e.lime.darken2,
|
|
145
|
+
e.lime.darken3,
|
|
146
|
+
e.lime.darken4
|
|
147
|
+
],
|
|
148
|
+
[
|
|
149
|
+
e.yellow.lighten5,
|
|
150
|
+
e.yellow.lighten4,
|
|
151
|
+
e.yellow.lighten3,
|
|
152
|
+
e.yellow.lighten2,
|
|
153
|
+
e.yellow.lighten1,
|
|
154
|
+
e.yellow.base,
|
|
155
|
+
e.yellow.darken1,
|
|
156
|
+
e.yellow.darken2,
|
|
157
|
+
e.yellow.darken3,
|
|
158
|
+
e.yellow.darken4
|
|
159
|
+
],
|
|
160
|
+
[
|
|
161
|
+
e.amber.lighten5,
|
|
162
|
+
e.amber.lighten4,
|
|
163
|
+
e.amber.lighten3,
|
|
164
|
+
e.amber.lighten2,
|
|
165
|
+
e.amber.lighten1,
|
|
166
|
+
e.amber.base,
|
|
167
|
+
e.amber.darken1,
|
|
168
|
+
e.amber.darken2,
|
|
169
|
+
e.amber.darken3,
|
|
170
|
+
e.amber.darken4
|
|
171
|
+
],
|
|
172
|
+
[
|
|
173
|
+
e.orange.lighten5,
|
|
174
|
+
e.orange.lighten4,
|
|
175
|
+
e.orange.lighten3,
|
|
176
|
+
e.orange.lighten2,
|
|
177
|
+
e.orange.lighten1,
|
|
178
|
+
e.orange.base,
|
|
179
|
+
e.orange.darken1,
|
|
180
|
+
e.orange.darken2,
|
|
181
|
+
e.orange.darken3,
|
|
182
|
+
e.orange.darken4
|
|
183
|
+
],
|
|
184
|
+
[
|
|
185
|
+
e.deepOrange.lighten5,
|
|
186
|
+
e.deepOrange.lighten4,
|
|
187
|
+
e.deepOrange.lighten3,
|
|
188
|
+
e.deepOrange.lighten2,
|
|
189
|
+
e.deepOrange.lighten1,
|
|
190
|
+
e.deepOrange.base,
|
|
191
|
+
e.deepOrange.darken1,
|
|
192
|
+
e.deepOrange.darken2,
|
|
193
|
+
e.deepOrange.darken3,
|
|
194
|
+
e.deepOrange.darken4
|
|
195
|
+
],
|
|
196
|
+
[
|
|
197
|
+
e.brown.lighten5,
|
|
198
|
+
e.brown.lighten4,
|
|
199
|
+
e.brown.lighten3,
|
|
200
|
+
e.brown.lighten2,
|
|
201
|
+
e.brown.lighten1,
|
|
202
|
+
e.brown.base,
|
|
203
|
+
e.brown.darken1,
|
|
204
|
+
e.brown.darken2,
|
|
205
|
+
e.brown.darken3,
|
|
206
|
+
e.brown.darken4
|
|
207
|
+
],
|
|
208
|
+
[
|
|
209
|
+
e.blueGrey.lighten5,
|
|
210
|
+
e.blueGrey.lighten4,
|
|
211
|
+
e.blueGrey.lighten3,
|
|
212
|
+
e.blueGrey.lighten2,
|
|
213
|
+
e.blueGrey.lighten1,
|
|
214
|
+
e.blueGrey.base,
|
|
215
|
+
e.blueGrey.darken1,
|
|
216
|
+
e.blueGrey.darken2,
|
|
217
|
+
e.blueGrey.darken3,
|
|
218
|
+
e.blueGrey.darken4
|
|
219
|
+
],
|
|
220
|
+
[
|
|
221
|
+
e.grey.lighten5,
|
|
222
|
+
e.grey.lighten4,
|
|
223
|
+
e.grey.lighten3,
|
|
224
|
+
e.grey.lighten2,
|
|
225
|
+
e.grey.lighten1,
|
|
226
|
+
e.grey.base,
|
|
227
|
+
e.grey.darken1,
|
|
228
|
+
e.grey.darken2,
|
|
229
|
+
e.grey.darken3,
|
|
230
|
+
e.grey.darken4
|
|
231
|
+
]
|
|
232
|
+
];
|
|
233
|
+
export {
|
|
234
|
+
l as advancedPalette
|
|
235
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Basic Material Design color palette
|
|
3
|
+
* Contains base colors from Material Design color system
|
|
4
|
+
*/
|
|
5
|
+
export declare const basicPalette: readonly [readonly [string, string, string], readonly [string, string, string, string, string, string, string, string], readonly [string, string, string, string, string, string, string, string], readonly [string, string, string]];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import e from "vuetify/util/colors";
|
|
2
|
+
const s = [
|
|
3
|
+
[e.shades.black, e.shades.white, e.shades.transparent],
|
|
4
|
+
[
|
|
5
|
+
e.red.base,
|
|
6
|
+
e.pink.base,
|
|
7
|
+
e.purple.base,
|
|
8
|
+
e.deepPurple.base,
|
|
9
|
+
e.indigo.base,
|
|
10
|
+
e.blue.base,
|
|
11
|
+
e.lightBlue.base,
|
|
12
|
+
e.cyan.base
|
|
13
|
+
],
|
|
14
|
+
[
|
|
15
|
+
e.teal.base,
|
|
16
|
+
e.green.base,
|
|
17
|
+
e.lightGreen.base,
|
|
18
|
+
e.lime.base,
|
|
19
|
+
e.yellow.base,
|
|
20
|
+
e.amber.base,
|
|
21
|
+
e.orange.base,
|
|
22
|
+
e.deepOrange.base
|
|
23
|
+
],
|
|
24
|
+
[e.brown.base, e.blueGrey.base, e.grey.base]
|
|
25
|
+
];
|
|
26
|
+
export {
|
|
27
|
+
s as basicPalette
|
|
28
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preset color palettes for vuetify-swatches
|
|
3
|
+
*
|
|
4
|
+
* These palettes are available as separate imports to keep the main bundle size small.
|
|
5
|
+
* Import only what you need:
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // Import basic palette (lightweight)
|
|
10
|
+
* import { basicPalette } from 'vuetify-swatches/palettes';
|
|
11
|
+
*
|
|
12
|
+
* // Import advanced palette (larger)
|
|
13
|
+
* import { advancedPalette } from 'vuetify-swatches/palettes';
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export { basicPalette } from './basic';
|
|
17
|
+
export { advancedPalette } from './advanced';
|