vuetify-swatches 2.1.1 → 2.3.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.ja.md +7 -41
- package/README.md +7 -41
- package/dist/components/SwatchButton.vue.d.ts +19 -34
- package/dist/components/VSwatches.vue.d.ts +21 -78
- package/dist/index.cjs.js +9 -10
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +105 -103
- package/dist/index.iife.js +9 -10
- package/dist/index.umd.js +9 -10
- package/dist/presets/advanced.js +1 -2
- package/dist/presets/basic.js +1 -2
- package/dist/style.css +2 -0
- package/dist/{interfaces/MetaInterface.d.ts → types/Meta.d.ts} +3 -2
- package/package.json +86 -106
- package/src/components/VSwatches.vue +104 -183
- package/dist/Meta.d.ts +0 -3
- package/dist/presets/src/Meta.d.ts +0 -3
- package/dist/presets/src/components/SwatchButton.vue.d.ts +0 -36
- package/dist/presets/src/components/VSwatches.vue.d.ts +0 -81
- package/dist/presets/src/index.d.ts +0 -3
- package/dist/presets/src/interfaces/MetaInterface.d.ts +0 -7
- package/dist/vuetify-swatches.css +0 -13
package/dist/index.es.js
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*/
|
|
2
|
+
* vuetify-swatches
|
|
3
|
+
*
|
|
4
|
+
* @description Color Swatch component for Vuetify3.
|
|
5
|
+
* @author Logue <logue@hotmail.co.jp>
|
|
6
|
+
* @license MIT
|
|
7
|
+
* @version 2.3.0
|
|
8
|
+
* @see {@link https://github.com/logue/vuetify-swatches}
|
|
9
|
+
*/
|
|
11
10
|
|
|
12
|
-
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createVNode as a, defineComponent as o,
|
|
11
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createVNode as a, defineComponent as o, mergeModels as s, mergeProps as c, normalizeClass as l, openBlock as u, renderList as d, unref as f, useModel as p, withCtx as m } from "vue";
|
|
13
12
|
import { VBtn as h, VIcon as g, VItem as _, VItemGroup as v, VTooltip as y } from "vuetify/components";
|
|
14
13
|
import b from "vuetify/util/colors";
|
|
15
|
-
|
|
14
|
+
// node_modules/.pnpm/es-toolkit@1.53.2/node_modules/es-toolkit/dist/array/zip.mjs
|
|
16
15
|
function x(...e) {
|
|
17
16
|
let t = 0;
|
|
18
17
|
for (let n = 0; n < e.length; n++) e[n].length > t && (t = e[n].length);
|
|
@@ -24,12 +23,11 @@ function x(...e) {
|
|
|
24
23
|
}
|
|
25
24
|
return r;
|
|
26
25
|
}
|
|
27
|
-
|
|
28
|
-
//#region src/components/SwatchButton.vue
|
|
26
|
+
// src/components/SwatchButton.vue
|
|
29
27
|
var S = /* @__PURE__ */ o({
|
|
30
28
|
__name: "SwatchButton",
|
|
31
29
|
props: {
|
|
32
|
-
color: {
|
|
30
|
+
color: {},
|
|
33
31
|
isSelected: {
|
|
34
32
|
type: Boolean,
|
|
35
33
|
default: !1
|
|
@@ -37,19 +35,16 @@ var S = /* @__PURE__ */ o({
|
|
|
37
35
|
size: { default: "2rem" },
|
|
38
36
|
icon: { default: "mdi-checkbox-marked-circle" },
|
|
39
37
|
iconSize: { default: "1rem" },
|
|
40
|
-
variant: {
|
|
38
|
+
variant: {},
|
|
41
39
|
disabled: {
|
|
42
40
|
type: Boolean,
|
|
43
41
|
default: !1
|
|
44
42
|
},
|
|
45
|
-
rounded: {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
],
|
|
51
|
-
default: void 0
|
|
52
|
-
},
|
|
43
|
+
rounded: { type: [
|
|
44
|
+
String,
|
|
45
|
+
Number,
|
|
46
|
+
Boolean
|
|
47
|
+
] },
|
|
53
48
|
border: {
|
|
54
49
|
type: [
|
|
55
50
|
String,
|
|
@@ -58,39 +53,39 @@ var S = /* @__PURE__ */ o({
|
|
|
58
53
|
],
|
|
59
54
|
default: !1
|
|
60
55
|
},
|
|
61
|
-
elevation: {
|
|
56
|
+
elevation: {},
|
|
62
57
|
tooltip: {
|
|
63
58
|
type: Boolean,
|
|
64
59
|
default: !1
|
|
65
60
|
},
|
|
66
|
-
tooltipLocation: { default:
|
|
61
|
+
tooltipLocation: { default: "end" }
|
|
67
62
|
},
|
|
68
63
|
emits: ["click"],
|
|
69
64
|
setup(e, { emit: t }) {
|
|
70
|
-
let i =
|
|
71
|
-
return (
|
|
65
|
+
let i = t;
|
|
66
|
+
return (t, o) => e.color ? (u(), n(f(y), {
|
|
72
67
|
key: 0,
|
|
73
|
-
disabled: !
|
|
74
|
-
location:
|
|
75
|
-
text:
|
|
68
|
+
disabled: !e.tooltip,
|
|
69
|
+
location: e.tooltipLocation,
|
|
70
|
+
text: e.color
|
|
76
71
|
}, {
|
|
77
|
-
activator: m(({ props:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
72
|
+
activator: m(({ props: t }) => [a(f(h), c(t, {
|
|
73
|
+
class: ["p-0", e.color === f(b).shades.transparent ? "bg-transparent" : ""],
|
|
74
|
+
width: e.size,
|
|
75
|
+
height: e.size,
|
|
76
|
+
border: e.border,
|
|
77
|
+
color: e.color,
|
|
78
|
+
disabled: e.disabled,
|
|
79
|
+
elevation: e.elevation,
|
|
80
|
+
variant: e.variant,
|
|
86
81
|
"min-width": "auto",
|
|
87
|
-
onClick:
|
|
82
|
+
onClick: o[0] ||= (e) => i("click")
|
|
88
83
|
}), {
|
|
89
|
-
default: m(() => [
|
|
84
|
+
default: m(() => [e.isSelected ? (u(), n(f(g), {
|
|
90
85
|
key: 0,
|
|
91
|
-
size:
|
|
92
|
-
color:
|
|
93
|
-
icon:
|
|
86
|
+
size: e.iconSize,
|
|
87
|
+
color: e.color === f(b).shades.transparent ? void 0 : e.color,
|
|
88
|
+
icon: e.icon
|
|
94
89
|
}, null, 8, [
|
|
95
90
|
"size",
|
|
96
91
|
"color",
|
|
@@ -98,34 +93,37 @@ var S = /* @__PURE__ */ o({
|
|
|
98
93
|
])) : r("", !0)]),
|
|
99
94
|
_: 1
|
|
100
95
|
}, 16, [
|
|
101
|
-
"border",
|
|
102
96
|
"class",
|
|
97
|
+
"width",
|
|
98
|
+
"height",
|
|
99
|
+
"border",
|
|
103
100
|
"color",
|
|
104
101
|
"disabled",
|
|
105
102
|
"elevation",
|
|
106
|
-
"
|
|
107
|
-
"variant",
|
|
108
|
-
"width"
|
|
103
|
+
"variant"
|
|
109
104
|
])]),
|
|
110
105
|
_: 1
|
|
111
106
|
}, 8, [
|
|
112
107
|
"disabled",
|
|
113
108
|
"location",
|
|
114
109
|
"text"
|
|
115
|
-
])) : (
|
|
110
|
+
])) : (u(), n(f(h), {
|
|
116
111
|
key: 1,
|
|
117
|
-
height: i.size,
|
|
118
|
-
width: i.size,
|
|
119
112
|
class: "p-0",
|
|
113
|
+
width: e.size,
|
|
114
|
+
height: e.size,
|
|
120
115
|
"min-width": "auto",
|
|
121
116
|
variant: "text",
|
|
122
117
|
disabled: ""
|
|
123
|
-
}, null, 8, ["
|
|
118
|
+
}, null, 8, ["width", "height"]));
|
|
124
119
|
}
|
|
125
|
-
}), C =
|
|
120
|
+
}), C = /*#__PURE__*/ ((e, t) => {
|
|
121
|
+
let n = e.__vccOpts || e;
|
|
122
|
+
for (let [e, r] of t) n[e] = r;
|
|
123
|
+
return n;
|
|
124
|
+
})(/* @__PURE__ */ o({
|
|
126
125
|
__name: "VSwatches",
|
|
127
|
-
props: {
|
|
128
|
-
modelValue: { default: b.shades.white },
|
|
126
|
+
props: /*@__PURE__*/ s({
|
|
129
127
|
swatches: { default: () => [] },
|
|
130
128
|
size: { default: "2rem" },
|
|
131
129
|
icon: { default: "mdi-checkbox-marked-circle" },
|
|
@@ -134,19 +132,16 @@ var S = /* @__PURE__ */ o({
|
|
|
134
132
|
type: Boolean,
|
|
135
133
|
default: !1
|
|
136
134
|
},
|
|
137
|
-
variant: {
|
|
135
|
+
variant: {},
|
|
138
136
|
disabled: {
|
|
139
137
|
type: Boolean,
|
|
140
138
|
default: !1
|
|
141
139
|
},
|
|
142
|
-
rounded: {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
],
|
|
148
|
-
default: void 0
|
|
149
|
-
},
|
|
140
|
+
rounded: { type: [
|
|
141
|
+
String,
|
|
142
|
+
Number,
|
|
143
|
+
Boolean
|
|
144
|
+
] },
|
|
150
145
|
border: {
|
|
151
146
|
type: [
|
|
152
147
|
String,
|
|
@@ -155,7 +150,7 @@ var S = /* @__PURE__ */ o({
|
|
|
155
150
|
],
|
|
156
151
|
default: !1
|
|
157
152
|
},
|
|
158
|
-
elevation: {
|
|
153
|
+
elevation: {},
|
|
159
154
|
transpose: {
|
|
160
155
|
type: Boolean,
|
|
161
156
|
default: !1
|
|
@@ -164,39 +159,44 @@ var S = /* @__PURE__ */ o({
|
|
|
164
159
|
type: Boolean,
|
|
165
160
|
default: !1
|
|
166
161
|
},
|
|
167
|
-
tooltipLocation: {
|
|
168
|
-
},
|
|
162
|
+
tooltipLocation: {}
|
|
163
|
+
}, {
|
|
164
|
+
modelValue: { default: b.shades.white },
|
|
165
|
+
modelModifiers: {}
|
|
166
|
+
}),
|
|
169
167
|
emits: ["update:modelValue"],
|
|
170
|
-
setup(r
|
|
171
|
-
let
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
168
|
+
setup(r) {
|
|
169
|
+
let o = p(r, "modelValue"), s = t(() => c(r.swatches, r.inline, r.transpose));
|
|
170
|
+
function c(e, t, n) {
|
|
171
|
+
let r = Array.isArray(e) ? h(e) ? e : e.length > 0 ? [e] : [] : Object.values(e);
|
|
172
|
+
return t ? [r.flat()] : n ? x(...r) : r;
|
|
173
|
+
}
|
|
174
|
+
function h(e) {
|
|
175
|
+
return Array.isArray(e) && e.every(Array.isArray);
|
|
176
|
+
}
|
|
177
|
+
return (t, c) => (u(), n(f(v), {
|
|
178
|
+
modelValue: o.value,
|
|
179
|
+
"onUpdate:modelValue": c[0] ||= (e) => o.value = e,
|
|
180
|
+
class: l(["v-swatches", { "d-inline": r.inline }]),
|
|
181
181
|
mandatory: ""
|
|
182
182
|
}, {
|
|
183
|
-
default: m(() => [
|
|
183
|
+
default: m(() => [r.inline ? (u(!0), i(e, { key: 0 }, d(s.value[0], (e) => (u(), n(f(_), {
|
|
184
184
|
key: e,
|
|
185
185
|
value: e
|
|
186
186
|
}, {
|
|
187
187
|
default: m(({ isSelected: t, toggle: n }) => [a(S, {
|
|
188
|
-
border:
|
|
188
|
+
border: r.border,
|
|
189
189
|
color: e,
|
|
190
|
-
disabled:
|
|
191
|
-
elevation:
|
|
192
|
-
"icon-size":
|
|
193
|
-
icon:
|
|
190
|
+
disabled: r.disabled,
|
|
191
|
+
elevation: r.elevation,
|
|
192
|
+
"icon-size": r.iconSize,
|
|
193
|
+
icon: r.icon,
|
|
194
194
|
"is-selected": t,
|
|
195
|
-
rounded:
|
|
196
|
-
size:
|
|
197
|
-
"tooltip-location":
|
|
198
|
-
tooltip:
|
|
199
|
-
variant:
|
|
195
|
+
rounded: r.rounded,
|
|
196
|
+
size: r.size,
|
|
197
|
+
"tooltip-location": r.tooltipLocation,
|
|
198
|
+
tooltip: r.tooltip,
|
|
199
|
+
variant: r.variant,
|
|
200
200
|
onClick: n
|
|
201
201
|
}, null, 8, [
|
|
202
202
|
"border",
|
|
@@ -214,23 +214,23 @@ var S = /* @__PURE__ */ o({
|
|
|
214
214
|
"onClick"
|
|
215
215
|
])]),
|
|
216
216
|
_: 2
|
|
217
|
-
}, 1032, ["value"]))), 128)) : (
|
|
217
|
+
}, 1032, ["value"]))), 128)) : (u(!0), i(e, { key: 1 }, d(s.value, (t, o) => (u(), i("div", { key: o }, [(u(!0), i(e, null, d(t, (e) => (u(), n(f(_), {
|
|
218
218
|
key: e,
|
|
219
219
|
value: e
|
|
220
220
|
}, {
|
|
221
221
|
default: m(({ isSelected: t, toggle: n }) => [a(S, {
|
|
222
|
-
border:
|
|
222
|
+
border: r.border,
|
|
223
223
|
color: e,
|
|
224
|
-
disabled:
|
|
225
|
-
elevation:
|
|
226
|
-
"icon-size":
|
|
227
|
-
icon:
|
|
224
|
+
disabled: r.disabled,
|
|
225
|
+
elevation: r.elevation,
|
|
226
|
+
"icon-size": r.iconSize,
|
|
227
|
+
icon: r.icon,
|
|
228
228
|
"is-selected": t,
|
|
229
|
-
rounded:
|
|
230
|
-
size:
|
|
231
|
-
"tooltip-location":
|
|
232
|
-
tooltip:
|
|
233
|
-
variant:
|
|
229
|
+
rounded: r.rounded,
|
|
230
|
+
size: r.size,
|
|
231
|
+
"tooltip-location": r.tooltipLocation,
|
|
232
|
+
tooltip: r.tooltip,
|
|
233
|
+
variant: r.variant,
|
|
234
234
|
onClick: n
|
|
235
235
|
}, null, 8, [
|
|
236
236
|
"border",
|
|
@@ -252,6 +252,8 @@ var S = /* @__PURE__ */ o({
|
|
|
252
252
|
_: 1
|
|
253
253
|
}, 8, ["modelValue", "class"]));
|
|
254
254
|
}
|
|
255
|
-
}),
|
|
256
|
-
|
|
257
|
-
|
|
255
|
+
}), [["__scopeId", "data-v-4f87df5e"]]), w = {
|
|
256
|
+
version: "2.3.0",
|
|
257
|
+
date: "2026-12-04T04:36:23.789Z"
|
|
258
|
+
}, T = (e) => e.component("VSwatches", C);
|
|
259
|
+
export { w as Meta, C as default, T as install };
|
package/dist/index.iife.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*/
|
|
2
|
+
* vuetify-swatches
|
|
3
|
+
*
|
|
4
|
+
* @description Color Swatch component for Vuetify3.
|
|
5
|
+
* @author Logue <logue@hotmail.co.jp>
|
|
6
|
+
* @license MIT
|
|
7
|
+
* @version 2.3.0
|
|
8
|
+
* @see {@link https://github.com/logue/vuetify-swatches}
|
|
9
|
+
*/
|
|
11
10
|
|
|
12
|
-
var VSwatches=(function(e,t,n,r){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(
|
|
11
|
+
var VSwatches=(function(e,t,n,r){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of s(t))!l.call(e,i)&&i!==n&&(r=o(t,i),a(e,i,{get:r&&r.get&&!r.configurable?r.get:()=>t[i],enumerable:!r||r.enumerable}));return e};r=((e,t,n)=>(n=e==null?{}:i(c(e)),u(a(n,`default`,{value:e,enumerable:!0}),e)))(r,1);function d(...e){let t=0;for(let n=0;n<e.length;n++)e[n].length>t&&(t=e[n].length);let n=e.length,r=Array(t);for(let i=0;i<t;++i){let t=Array(n);for(let r=0;r<n;++r)t[r]=e[r][i];r[i]=t}return r}var f=(0,t.defineComponent)({__name:`SwatchButton`,props:{color:{},isSelected:{type:Boolean,default:!1},size:{default:`2rem`},icon:{default:`mdi-checkbox-marked-circle`},iconSize:{default:`1rem`},variant:{},disabled:{type:Boolean,default:!1},rounded:{type:[String,Number,Boolean]},border:{type:[String,Number,Boolean],default:!1},elevation:{},tooltip:{type:Boolean,default:!1},tooltipLocation:{default:`end`}},emits:[`click`],setup(e,{emit:i}){let a=i;return(i,o)=>e.color?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VTooltip),{key:0,disabled:!e.tooltip,location:e.tooltipLocation,text:e.color},{activator:(0,t.withCtx)(({props:i})=>[(0,t.createVNode)((0,t.unref)(n.VBtn),(0,t.mergeProps)(i,{class:[`p-0`,e.color===(0,t.unref)(r.default).shades.transparent?`bg-transparent`:``],width:e.size,height:e.size,border:e.border,color:e.color,disabled:e.disabled,elevation:e.elevation,variant:e.variant,"min-width":`auto`,onClick:o[0]||=e=>a(`click`)}),{default:(0,t.withCtx)(()=>[e.isSelected?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VIcon),{key:0,size:e.iconSize,color:e.color===(0,t.unref)(r.default).shades.transparent?void 0:e.color,icon:e.icon},null,8,[`size`,`color`,`icon`])):(0,t.createCommentVNode)(``,!0)]),_:1},16,[`class`,`width`,`height`,`border`,`color`,`disabled`,`elevation`,`variant`])]),_:1},8,[`disabled`,`location`,`text`])):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VBtn),{key:1,class:`p-0`,width:e.size,height:e.size,"min-width":`auto`,variant:`text`,disabled:``},null,8,[`width`,`height`]))}}),p=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})((0,t.defineComponent)({__name:`VSwatches`,props:(0,t.mergeModels)({swatches:{default:()=>[]},size:{default:`2rem`},icon:{default:`mdi-checkbox-marked-circle`},iconSize:{default:`1rem`},inline:{type:Boolean,default:!1},variant:{},disabled:{type:Boolean,default:!1},rounded:{type:[String,Number,Boolean]},border:{type:[String,Number,Boolean],default:!1},elevation:{},transpose:{type:Boolean,default:!1},tooltip:{type:Boolean,default:!1},tooltipLocation:{}},{modelValue:{default:r.default.shades.white},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let r=(0,t.useModel)(e,`modelValue`),i=(0,t.computed)(()=>a(e.swatches,e.inline,e.transpose));function a(e,t,n){let r=Array.isArray(e)?o(e)?e:e.length>0?[e]:[]:Object.values(e);return t?[r.flat()]:n?d(...r):r}function o(e){return Array.isArray(e)&&e.every(Array.isArray)}return(a,o)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VItemGroup),{modelValue:r.value,"onUpdate:modelValue":o[0]||=e=>r.value=e,class:(0,t.normalizeClass)([`v-swatches`,{"d-inline":e.inline}]),mandatory:``},{default:(0,t.withCtx)(()=>[e.inline?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(i.value[0],r=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VItem),{key:r,value:r},{default:(0,t.withCtx)(({isSelected:n,toggle:i})=>[(0,t.createVNode)(f,{border:e.border,color:r,disabled:e.disabled,elevation:e.elevation,"icon-size":e.iconSize,icon:e.icon,"is-selected":n,rounded:e.rounded,size:e.size,"tooltip-location":e.tooltipLocation,tooltip:e.tooltip,variant:e.variant,onClick:i},null,8,[`border`,`color`,`disabled`,`elevation`,`icon-size`,`icon`,`is-selected`,`rounded`,`size`,`tooltip-location`,`tooltip`,`variant`,`onClick`])]),_:2},1032,[`value`]))),128)):((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(i.value,(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:i},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(r,r=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VItem),{key:r,value:r},{default:(0,t.withCtx)(({isSelected:n,toggle:i})=>[(0,t.createVNode)(f,{border:e.border,color:r,disabled:e.disabled,elevation:e.elevation,"icon-size":e.iconSize,icon:e.icon,"is-selected":n,rounded:e.rounded,size:e.size,"tooltip-location":e.tooltipLocation,tooltip:e.tooltip,variant:e.variant,onClick:i},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`]))}}),[[`__scopeId`,`data-v-4f87df5e`]]);return e.Meta={version:`2.3.0`,date:`2026-12-04T04:36:23.789Z`},e.default=p,e.install=e=>e.component(`VSwatches`,p),e})({},Vue,Vuetify,Vuetify);
|
package/dist/index.umd.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*/
|
|
2
|
+
* vuetify-swatches
|
|
3
|
+
*
|
|
4
|
+
* @description Color Swatch component for Vuetify3.
|
|
5
|
+
* @author Logue <logue@hotmail.co.jp>
|
|
6
|
+
* @license MIT
|
|
7
|
+
* @version 2.3.0
|
|
8
|
+
* @see {@link https://github.com/logue/vuetify-swatches}
|
|
9
|
+
*/
|
|
11
10
|
|
|
12
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("vue"),require("vuetify/components"),require("vuetify/util/colors")):typeof define==`function`&&define.amd?define([`exports`,`vue`,`vuetify/components`,`vuetify/util/colors`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.VSwatches={},e.Vue,e
|
|
11
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("vue"),require("vuetify/components"),require("vuetify/util/colors")):typeof define==`function`&&define.amd?define([`exports`,`vue`,`vuetify/components`,`vuetify/util/colors`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.VSwatches={},e.Vue,e.Vuetify,e.Vuetify))})(this,function(e,t,n,r){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of s(t))!l.call(e,i)&&i!==n&&(r=o(t,i),a(e,i,{get:r&&r.get&&!r.configurable?r.get:()=>t[i],enumerable:!r||r.enumerable}));return e};r=((e,t,n)=>(n=e==null?{}:i(c(e)),u(a(n,`default`,{value:e,enumerable:!0}),e)))(r,1);function d(...e){let t=0;for(let n=0;n<e.length;n++)e[n].length>t&&(t=e[n].length);let n=e.length,r=Array(t);for(let i=0;i<t;++i){let t=Array(n);for(let r=0;r<n;++r)t[r]=e[r][i];r[i]=t}return r}var f=(0,t.defineComponent)({__name:`SwatchButton`,props:{color:{},isSelected:{type:Boolean,default:!1},size:{default:`2rem`},icon:{default:`mdi-checkbox-marked-circle`},iconSize:{default:`1rem`},variant:{},disabled:{type:Boolean,default:!1},rounded:{type:[String,Number,Boolean]},border:{type:[String,Number,Boolean],default:!1},elevation:{},tooltip:{type:Boolean,default:!1},tooltipLocation:{default:`end`}},emits:[`click`],setup(e,{emit:i}){let a=i;return(i,o)=>e.color?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VTooltip),{key:0,disabled:!e.tooltip,location:e.tooltipLocation,text:e.color},{activator:(0,t.withCtx)(({props:i})=>[(0,t.createVNode)((0,t.unref)(n.VBtn),(0,t.mergeProps)(i,{class:[`p-0`,e.color===(0,t.unref)(r.default).shades.transparent?`bg-transparent`:``],width:e.size,height:e.size,border:e.border,color:e.color,disabled:e.disabled,elevation:e.elevation,variant:e.variant,"min-width":`auto`,onClick:o[0]||=e=>a(`click`)}),{default:(0,t.withCtx)(()=>[e.isSelected?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VIcon),{key:0,size:e.iconSize,color:e.color===(0,t.unref)(r.default).shades.transparent?void 0:e.color,icon:e.icon},null,8,[`size`,`color`,`icon`])):(0,t.createCommentVNode)(``,!0)]),_:1},16,[`class`,`width`,`height`,`border`,`color`,`disabled`,`elevation`,`variant`])]),_:1},8,[`disabled`,`location`,`text`])):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VBtn),{key:1,class:`p-0`,width:e.size,height:e.size,"min-width":`auto`,variant:`text`,disabled:``},null,8,[`width`,`height`]))}}),p=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})((0,t.defineComponent)({__name:`VSwatches`,props:(0,t.mergeModels)({swatches:{default:()=>[]},size:{default:`2rem`},icon:{default:`mdi-checkbox-marked-circle`},iconSize:{default:`1rem`},inline:{type:Boolean,default:!1},variant:{},disabled:{type:Boolean,default:!1},rounded:{type:[String,Number,Boolean]},border:{type:[String,Number,Boolean],default:!1},elevation:{},transpose:{type:Boolean,default:!1},tooltip:{type:Boolean,default:!1},tooltipLocation:{}},{modelValue:{default:r.default.shades.white},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let r=(0,t.useModel)(e,`modelValue`),i=(0,t.computed)(()=>a(e.swatches,e.inline,e.transpose));function a(e,t,n){let r=Array.isArray(e)?o(e)?e:e.length>0?[e]:[]:Object.values(e);return t?[r.flat()]:n?d(...r):r}function o(e){return Array.isArray(e)&&e.every(Array.isArray)}return(a,o)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VItemGroup),{modelValue:r.value,"onUpdate:modelValue":o[0]||=e=>r.value=e,class:(0,t.normalizeClass)([`v-swatches`,{"d-inline":e.inline}]),mandatory:``},{default:(0,t.withCtx)(()=>[e.inline?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(i.value[0],r=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VItem),{key:r,value:r},{default:(0,t.withCtx)(({isSelected:n,toggle:i})=>[(0,t.createVNode)(f,{border:e.border,color:r,disabled:e.disabled,elevation:e.elevation,"icon-size":e.iconSize,icon:e.icon,"is-selected":n,rounded:e.rounded,size:e.size,"tooltip-location":e.tooltipLocation,tooltip:e.tooltip,variant:e.variant,onClick:i},null,8,[`border`,`color`,`disabled`,`elevation`,`icon-size`,`icon`,`is-selected`,`rounded`,`size`,`tooltip-location`,`tooltip`,`variant`,`onClick`])]),_:2},1032,[`value`]))),128)):((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(i.value,(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:i},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(r,r=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.VItem),{key:r,value:r},{default:(0,t.withCtx)(({isSelected:n,toggle:i})=>[(0,t.createVNode)(f,{border:e.border,color:r,disabled:e.disabled,elevation:e.elevation,"icon-size":e.iconSize,icon:e.icon,"is-selected":n,rounded:e.rounded,size:e.size,"tooltip-location":e.tooltipLocation,tooltip:e.tooltip,variant:e.variant,onClick:i},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`]))}}),[[`__scopeId`,`data-v-4f87df5e`]]);e.Meta={version:`2.3.0`,date:`2026-12-04T04:36:23.789Z`},e.default=p,e.install=e=>e.component(`VSwatches`,p)});
|
package/dist/presets/advanced.js
CHANGED
package/dist/presets/basic.js
CHANGED
package/dist/style.css
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.v-swatches[data-v-4f87df5e] .v-btn{margin:.1rem}.v-swatches[data-v-4f87df5e] .v-icon{filter:invert()grayscale()contrast(100)}.v-swatches[data-v-4f87df5e] .bg-transparent{background:linear-gradient(to top left, transparent 0, transparent calc(50% - .1rem), rgb(var(--v-theme-error)) 50%, transparent calc(50% + .1rem), transparent)}.v-swatches[data-v-4f87df5e] .bg-transparent .v-icon{filter:none}
|
|
2
|
+
/*$vite$:1*/
|