vuetify-swatches 0.1.3 → 0.3.2
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 +4 -2
- package/dist/components/VSwatches.vue.d.ts +76 -76
- package/dist/components/VSwatches.vue.d.ts.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +56 -53
- package/dist/index.umd.js +3 -3
- package/dist/style.css +2 -2
- package/package.json +16 -26
- package/src/components/VSwatches.vue +7 -16
package/README.md
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|

|
|
10
10
|
|
|
11
|
+
This branch is for vuetify3. Not usable for production, experimental use only. Bidirectional binding (select swatch button by value) does not work due to a problem on the Vuetify3 side.
|
|
12
|
+
|
|
11
13
|
This project is a remake of [saintplay's vue-swatches](https://saintplay.github.io/vue-swatches/) with [Vuetify](https://vuetifyjs.com/).
|
|
12
14
|
|
|
13
15
|
Unlike the original version, it provides a UI based on Vuetify, such as ripple effects and dark mode.
|
|
@@ -38,7 +40,7 @@ export default Vue.extend({
|
|
|
38
40
|
</script>
|
|
39
41
|
|
|
40
42
|
<style>
|
|
41
|
-
@import 'vuetify-swatches/style.css';
|
|
43
|
+
@import 'vuetify-swatches/dist/style.css';
|
|
42
44
|
</style>
|
|
43
45
|
```
|
|
44
46
|
|
|
@@ -117,7 +119,7 @@ export default Vue.extend({
|
|
|
117
119
|
</script>
|
|
118
120
|
|
|
119
121
|
<style>
|
|
120
|
-
@import 'vuetify-swatches/style.css';
|
|
122
|
+
@import 'vuetify-swatches/dist/style.css';
|
|
121
123
|
</style>
|
|
122
124
|
```
|
|
123
125
|
|
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
import { type PropType, type Ref } from 'vue';
|
|
2
|
-
/** Vuetify Swatches */
|
|
3
|
-
declare const _default: import("vue
|
|
4
|
-
/** Model value */
|
|
5
|
-
modelValue: {
|
|
6
|
-
type: StringConstructor;
|
|
7
|
-
default: string;
|
|
8
|
-
};
|
|
9
|
-
/** Swatch colors */
|
|
10
|
-
swatches: {
|
|
11
|
-
type: PropType<string[] | string[][]>;
|
|
12
|
-
default: () =>
|
|
13
|
-
};
|
|
14
|
-
/** The size of the shadow of the button */
|
|
15
|
-
elevation: {
|
|
16
|
-
type: NumberConstructor;
|
|
17
|
-
default: number;
|
|
18
|
-
};
|
|
19
|
-
/** Swatch sized */
|
|
20
|
-
size: {
|
|
21
|
-
type: StringConstructor;
|
|
22
|
-
default: string;
|
|
23
|
-
};
|
|
24
|
-
/** selected icon */
|
|
25
|
-
icon: {
|
|
26
|
-
type: StringConstructor;
|
|
27
|
-
default: string;
|
|
28
|
-
};
|
|
29
|
-
/** selected icon size */
|
|
30
|
-
iconSize: {
|
|
31
|
-
type: StringConstructor;
|
|
32
|
-
default: string;
|
|
33
|
-
};
|
|
34
|
-
}, {
|
|
35
|
-
checkedVisibilty: Ref<boolean>;
|
|
36
|
-
onSwatchClick: (e: Event) => void;
|
|
37
|
-
},
|
|
38
|
-
/** Model value */
|
|
39
|
-
modelValue: {
|
|
40
|
-
type: StringConstructor;
|
|
41
|
-
default: string;
|
|
42
|
-
};
|
|
43
|
-
/** Swatch colors */
|
|
44
|
-
swatches: {
|
|
45
|
-
type: PropType<string[] | string[][]>;
|
|
46
|
-
default: () =>
|
|
47
|
-
};
|
|
48
|
-
/** The size of the shadow of the button */
|
|
49
|
-
elevation: {
|
|
50
|
-
type: NumberConstructor;
|
|
51
|
-
default: number;
|
|
52
|
-
};
|
|
53
|
-
/** Swatch sized */
|
|
54
|
-
size: {
|
|
55
|
-
type: StringConstructor;
|
|
56
|
-
default: string;
|
|
57
|
-
};
|
|
58
|
-
/** selected icon */
|
|
59
|
-
icon: {
|
|
60
|
-
type: StringConstructor;
|
|
61
|
-
default: string;
|
|
62
|
-
};
|
|
63
|
-
/** selected icon size */
|
|
64
|
-
iconSize: {
|
|
65
|
-
type: StringConstructor;
|
|
66
|
-
default: string;
|
|
67
|
-
};
|
|
68
|
-
}>>, {
|
|
69
|
-
modelValue: string;
|
|
70
|
-
swatches: string[] | string[][];
|
|
71
|
-
elevation: number;
|
|
72
|
-
size: string;
|
|
73
|
-
icon: string;
|
|
74
|
-
iconSize: string;
|
|
75
|
-
}>;
|
|
76
|
-
export default _default;
|
|
1
|
+
import { type PropType, type Ref } from 'vue';
|
|
2
|
+
/** Vuetify Swatches */
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
/** Model value */
|
|
5
|
+
modelValue: {
|
|
6
|
+
type: StringConstructor;
|
|
7
|
+
default: string;
|
|
8
|
+
};
|
|
9
|
+
/** Swatch colors */
|
|
10
|
+
swatches: {
|
|
11
|
+
type: PropType<string[] | string[][]>;
|
|
12
|
+
default: () => any[][];
|
|
13
|
+
};
|
|
14
|
+
/** The size of the shadow of the button */
|
|
15
|
+
elevation: {
|
|
16
|
+
type: NumberConstructor;
|
|
17
|
+
default: number;
|
|
18
|
+
};
|
|
19
|
+
/** Swatch sized */
|
|
20
|
+
size: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
/** selected icon */
|
|
25
|
+
icon: {
|
|
26
|
+
type: StringConstructor;
|
|
27
|
+
default: string;
|
|
28
|
+
};
|
|
29
|
+
/** selected icon size */
|
|
30
|
+
iconSize: {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
default: string;
|
|
33
|
+
};
|
|
34
|
+
}, {
|
|
35
|
+
checkedVisibilty: Ref<boolean>;
|
|
36
|
+
onSwatchClick: (e: Event) => void;
|
|
37
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
38
|
+
/** Model value */
|
|
39
|
+
modelValue: {
|
|
40
|
+
type: StringConstructor;
|
|
41
|
+
default: string;
|
|
42
|
+
};
|
|
43
|
+
/** Swatch colors */
|
|
44
|
+
swatches: {
|
|
45
|
+
type: PropType<string[] | string[][]>;
|
|
46
|
+
default: () => any[][];
|
|
47
|
+
};
|
|
48
|
+
/** The size of the shadow of the button */
|
|
49
|
+
elevation: {
|
|
50
|
+
type: NumberConstructor;
|
|
51
|
+
default: number;
|
|
52
|
+
};
|
|
53
|
+
/** Swatch sized */
|
|
54
|
+
size: {
|
|
55
|
+
type: StringConstructor;
|
|
56
|
+
default: string;
|
|
57
|
+
};
|
|
58
|
+
/** selected icon */
|
|
59
|
+
icon: {
|
|
60
|
+
type: StringConstructor;
|
|
61
|
+
default: string;
|
|
62
|
+
};
|
|
63
|
+
/** selected icon size */
|
|
64
|
+
iconSize: {
|
|
65
|
+
type: StringConstructor;
|
|
66
|
+
default: string;
|
|
67
|
+
};
|
|
68
|
+
}>>, {
|
|
69
|
+
modelValue: string;
|
|
70
|
+
swatches: string[] | string[][];
|
|
71
|
+
elevation: number;
|
|
72
|
+
size: string;
|
|
73
|
+
icon: string;
|
|
74
|
+
iconSize: string;
|
|
75
|
+
}>;
|
|
76
|
+
export default _default;
|
|
77
77
|
//# sourceMappingURL=VSwatches.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VSwatches.vue.d.ts","sourceRoot":"","sources":["../../src/components/VSwatches.vue.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,GAAG,EAET,MAAM,KAAK,CAAC;AAKb,uBAAuB;;
|
|
1
|
+
{"version":3,"file":"VSwatches.vue.d.ts","sourceRoot":"","sources":["../../src/components/VSwatches.vue.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,GAAG,EAET,MAAM,KAAK,CAAC;AAKb,uBAAuB;;IAUnB,kBAAkB;;;;;IAElB,oBAAoB;;;;;IA4BpB,2CAA2C;;;;;IAE3C,mBAAmB;;;;;IAEnB,oBAAoB;;;;;IAEpB,yBAAyB;;;;;;;uBAkBC,KAAK;;IAtD/B,kBAAkB;;;;;IAElB,oBAAoB;;;;;IA4BpB,2CAA2C;;;;;IAE3C,mBAAmB;;;;;IAEnB,oBAAoB;;;;;IAEpB,yBAAyB;;;;;;;;;;;;;AA7C7B,wBA2EG"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import VSwatches from './components/VSwatches.vue';
|
|
2
|
-
declare const installVSwatches: (app: any) => any;
|
|
3
|
-
export { VSwatches as default, installVSwatches as install };
|
|
1
|
+
import VSwatches from './components/VSwatches.vue';
|
|
2
|
+
declare const installVSwatches: (app: any) => any;
|
|
3
|
+
export { VSwatches as default, installVSwatches as install };
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,4BAA4B,CAAC;AAEnD,QAAA,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,4BAA4B,CAAC;AAEnD,QAAA,MAAM,gBAAgB,QAAS,GAAG,QAA0C,CAAC;AAE7E,OAAO,EAAE,SAAS,IAAI,OAAO,EAAE,gBAAgB,IAAI,OAAO,EAAE,CAAC"}
|
package/dist/index.es.js
CHANGED
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* vuetify-swatches
|
|
3
3
|
*
|
|
4
|
-
* @description Color Swatch component for
|
|
4
|
+
* @description Color Swatch component for Vuetify3.
|
|
5
5
|
* @author Logue <logue@hotmail.co.jp>
|
|
6
6
|
* @copyright 2022 By Masashi Yoshikawa All rights reserved.
|
|
7
7
|
* @license MIT
|
|
8
|
-
* @version 0.
|
|
8
|
+
* @version 0.3.2
|
|
9
9
|
* @see {@link https://github.com/logue/vuetify-swatches}
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import { defineComponent as
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
const S = b({
|
|
12
|
+
import { defineComponent as V, ref as k, resolveComponent as c, openBlock as n, createBlock as d, withCtx as u, createElementBlock as p, Fragment as m, renderList as f, createTextVNode as S, toDisplayString as C, createCommentVNode as z } from "vue";
|
|
13
|
+
import e from "vuetify/lib/util/colors.mjs";
|
|
14
|
+
const B = V({
|
|
16
15
|
name: "VSwatches",
|
|
17
|
-
components: {
|
|
18
|
-
VSheet: w,
|
|
19
|
-
VBtn: V,
|
|
20
|
-
VIcon: y
|
|
21
|
-
},
|
|
22
16
|
model: {
|
|
23
17
|
prop: "modelValue",
|
|
24
18
|
event: "update:modelValue"
|
|
@@ -58,53 +52,62 @@ const S = b({
|
|
|
58
52
|
iconSize: { type: String, default: "1rem" }
|
|
59
53
|
},
|
|
60
54
|
emits: ["update:modelValue"],
|
|
61
|
-
setup(
|
|
55
|
+
setup(t, a) {
|
|
62
56
|
return {
|
|
63
|
-
checkedVisibilty:
|
|
64
|
-
onSwatchClick: (
|
|
65
|
-
const
|
|
66
|
-
!
|
|
57
|
+
checkedVisibilty: k(!1),
|
|
58
|
+
onSwatchClick: (l) => {
|
|
59
|
+
const i = l.target.dataset.value;
|
|
60
|
+
!i || t.modelValue === i || a.emit("update:modelValue", i);
|
|
67
61
|
}
|
|
68
62
|
};
|
|
69
63
|
}
|
|
70
64
|
});
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
n.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
65
|
+
const $ = (t, a) => {
|
|
66
|
+
const o = t.__vccOpts || t;
|
|
67
|
+
for (const [r, l] of a)
|
|
68
|
+
o[r] = l;
|
|
69
|
+
return o;
|
|
70
|
+
};
|
|
71
|
+
function N(t, a, o, r, l, i) {
|
|
72
|
+
const h = c("v-icon"), w = c("v-btn"), v = c("v-sheet");
|
|
73
|
+
return n(), d(v, { class: "v-swatches" }, {
|
|
74
|
+
default: u(() => [
|
|
75
|
+
(n(!0), p(m, null, f(t.swatches, (y, _) => (n(), p("div", {
|
|
76
|
+
key: _,
|
|
77
|
+
class: "d-flex"
|
|
78
|
+
}, [
|
|
79
|
+
(n(!0), p(m, null, f(y, (s) => (n(), d(w, {
|
|
80
|
+
key: s,
|
|
81
|
+
elevation: t.elevation,
|
|
82
|
+
width: t.size,
|
|
83
|
+
height: t.size,
|
|
84
|
+
color: s,
|
|
85
|
+
"data-value": s,
|
|
86
|
+
"min-width": "auto",
|
|
87
|
+
onClick: a[0] || (a[0] = (g) => t.onSwatchClick(g))
|
|
88
|
+
}, {
|
|
89
|
+
default: u(() => [
|
|
90
|
+
s === t.modelValue ? (n(), d(h, {
|
|
91
|
+
key: 0,
|
|
92
|
+
size: t.iconSize,
|
|
93
|
+
color: s
|
|
94
|
+
}, {
|
|
95
|
+
default: u(() => [
|
|
96
|
+
S(C(t.icon), 1)
|
|
97
|
+
]),
|
|
98
|
+
_: 2
|
|
99
|
+
}, 1032, ["size", "color"])) : z("", !0)
|
|
100
|
+
]),
|
|
101
|
+
_: 2
|
|
102
|
+
}, 1032, ["elevation", "width", "height", "color", "data-value"]))), 128))
|
|
103
|
+
]))), 128))
|
|
104
|
+
]),
|
|
105
|
+
_: 1
|
|
106
|
+
});
|
|
94
107
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return t._self._setupProxy, l("v-sheet", { staticClass: "v-swatches" }, t._l(t.swatches, function(u, i) {
|
|
98
|
-
return l("div", { key: i }, t._l(u, function(a) {
|
|
99
|
-
return l("v-btn", { key: a, attrs: { elevation: t.elevation, width: t.size, height: t.size, color: a, value: a, "min-width": "auto" }, on: { click: function(d) {
|
|
100
|
-
return t.onSwatchClick(d);
|
|
101
|
-
} } }, [a === t.modelValue ? l("v-icon", { attrs: { size: t.iconSize, color: a } }, [t._v(" " + t._s(t.icon) + " ")]) : t._e()], 1);
|
|
102
|
-
}), 1);
|
|
103
|
-
}), 0);
|
|
104
|
-
}, k = [], z = /* @__PURE__ */ g(S, C, k, !1, null, null, null, null);
|
|
105
|
-
const _ = z.exports, N = (s) => s.component("VSwatches", _);
|
|
106
|
-
typeof window < "u" && window.Vue && window.Vue.use(_);
|
|
108
|
+
const b = /* @__PURE__ */ $(B, [["render", N]]), A = (t) => t.component("VSwatches", b);
|
|
109
|
+
typeof window < "u" && window.Vue && window.Vue.use(b);
|
|
107
110
|
export {
|
|
108
|
-
|
|
109
|
-
|
|
111
|
+
b as default,
|
|
112
|
+
A as install
|
|
110
113
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* vuetify-swatches
|
|
3
3
|
*
|
|
4
|
-
* @description Color Swatch component for
|
|
4
|
+
* @description Color Swatch component for Vuetify3.
|
|
5
5
|
* @author Logue <logue@hotmail.co.jp>
|
|
6
6
|
* @copyright 2022 By Masashi Yoshikawa All rights reserved.
|
|
7
7
|
* @license MIT
|
|
8
|
-
* @version 0.
|
|
8
|
+
* @version 0.3.2
|
|
9
9
|
* @see {@link https://github.com/logue/vuetify-swatches}
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
(function(l,
|
|
12
|
+
(function(l,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vuetify/lib/util/colors.mjs")):typeof define=="function"&&define.amd?define(["exports","vue","vuetify/lib/util/colors.mjs"],e):(l=typeof globalThis<"u"?globalThis:l||self,e(l.VSwatches={},l.Vue,l.colors))})(this,function(l,e,u){"use strict";const t=(a=>a&&typeof a=="object"&&"default"in a?a:{default:a})(u),f=e.defineComponent({name:"VSwatches",model:{prop:"modelValue",event:"update:modelValue"},props:{modelValue:{type:String,default:"#ffffff"},swatches:{type:Array,default:()=>[[t.default.shades.black,t.default.shades.white],[t.default.red.base,t.default.pink.base,t.default.purple.base,t.default.deepPurple.base,t.default.indigo.base,t.default.blue.base,t.default.lightBlue.base,t.default.cyan.base],[t.default.teal.base,t.default.green.base,t.default.lightGreen.base,t.default.lime.base,t.default.yellow.base,t.default.amber.base,t.default.orange.base,t.default.deepOrange.base],[t.default.brown.base,t.default.blueGrey.base,t.default.grey.base]]},elevation:{type:Number,default:1},size:{type:String,default:"2rem"},icon:{type:String,default:"mdi-checkbox-marked-circle"},iconSize:{type:String,default:"1rem"}},emits:["update:modelValue"],setup(a,n){return{checkedVisibilty:e.ref(!1),onSwatchClick:i=>{const d=i.target.dataset.value;!d||a.modelValue===d||n.emit("update:modelValue",d)}}}}),S="",p=(a,n)=>{const s=a.__vccOpts||a;for(const[c,i]of n)s[c]=i;return s};function m(a,n,s,c,i,d){const h=e.resolveComponent("v-icon"),y=e.resolveComponent("v-btn"),w=e.resolveComponent("v-sheet");return e.openBlock(),e.createBlock(w,{class:"v-swatches"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.swatches,(k,_)=>(e.openBlock(),e.createElementBlock("div",{key:_,class:"d-flex"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k,o=>(e.openBlock(),e.createBlock(y,{key:o,elevation:a.elevation,width:a.size,height:a.size,color:o,"data-value":o,"min-width":"auto",onClick:n[0]||(n[0]=g=>a.onSwatchClick(g))},{default:e.withCtx(()=>[o===a.modelValue?(e.openBlock(),e.createBlock(h,{key:0,size:a.iconSize,color:o},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.icon),1)]),_:2},1032,["size","color"])):e.createCommentVNode("",!0)]),_:2},1032,["elevation","width","height","color","data-value"]))),128))]))),128))]),_:1})}const r=p(f,[["render",m]]),b=a=>a.component("VSwatches",r);typeof window<"u"&&window.Vue&&window.Vue.use(r),l.default=r,l.install=b,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/style.css
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* vuetify-swatches
|
|
3
3
|
*
|
|
4
|
-
* @description Color Swatch component for
|
|
4
|
+
* @description Color Swatch component for Vuetify3.
|
|
5
5
|
* @author Logue <logue@hotmail.co.jp>
|
|
6
6
|
* @copyright 2022 By Masashi Yoshikawa All rights reserved.
|
|
7
7
|
* @license MIT
|
|
8
|
-
* @version 0.
|
|
8
|
+
* @version 0.3.2
|
|
9
9
|
* @see {@link https://github.com/logue/vuetify-swatches}
|
|
10
10
|
*/
|
|
11
11
|
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "vuetify-swatches",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"
|
|
6
|
-
"description": "Color Swatch component for Vuetify.",
|
|
4
|
+
"version": "0.3.2",
|
|
5
|
+
"description": "Color Swatch component for Vuetify3.",
|
|
7
6
|
"keywords": [
|
|
8
7
|
"vuejs",
|
|
9
8
|
"vue",
|
|
@@ -11,12 +10,14 @@
|
|
|
11
10
|
"color-picker",
|
|
12
11
|
"color-palette",
|
|
13
12
|
"swatches",
|
|
14
|
-
"
|
|
13
|
+
"vue3",
|
|
15
14
|
"vue-plugin",
|
|
16
15
|
"vue-resource",
|
|
17
16
|
"vuetify",
|
|
17
|
+
"vuetify3",
|
|
18
18
|
"vuetify-components"
|
|
19
19
|
],
|
|
20
|
+
"license": "MIT",
|
|
20
21
|
"type": "module",
|
|
21
22
|
"author": {
|
|
22
23
|
"name": "Logue",
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
"types": "dist/index.d.ts",
|
|
37
38
|
"style": "dist/style.css",
|
|
38
39
|
"browser": {
|
|
39
|
-
"sfc": "src/components/VSwatches.vue"
|
|
40
|
+
"./sfc": "./src/components/VSwatches.vue"
|
|
40
41
|
},
|
|
41
42
|
"exports": {
|
|
42
43
|
".": {
|
|
@@ -52,17 +53,17 @@
|
|
|
52
53
|
"dist",
|
|
53
54
|
"src/components/VSwatches.vue"
|
|
54
55
|
],
|
|
55
|
-
"sideEffects": false,
|
|
56
56
|
"engines": {
|
|
57
|
-
"node": ">=16.
|
|
57
|
+
"node": ">=16.16.0",
|
|
58
58
|
"yarn": ">=1.22.10"
|
|
59
59
|
},
|
|
60
60
|
"packageManager": "yarn@3.2.2",
|
|
61
|
+
"sideEffects": false,
|
|
61
62
|
"scripts": {
|
|
62
63
|
"dev": "vite",
|
|
63
64
|
"clean": "rimraf node_modules/.vite ",
|
|
64
65
|
"build": "vite build & vue-tsc --declaration --emitDeclarationOnly",
|
|
65
|
-
"build:analyze": "vue-tsc --noEmit
|
|
66
|
+
"build:analyze": "vue-tsc --noEmit & vite build --mode analyze",
|
|
66
67
|
"build:docs": "vite build --config vite.config.docs.ts",
|
|
67
68
|
"build:clean": "rimraf dist",
|
|
68
69
|
"lint": "eslint . --fix --cache --cache-location ./node_modules/.vite/vite-plugin-eslint && prettier . -w -u",
|
|
@@ -72,24 +73,15 @@
|
|
|
72
73
|
"prepare": "husky install"
|
|
73
74
|
},
|
|
74
75
|
"peerDependencies": {
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"vuetify": "^2.6.9"
|
|
78
|
-
},
|
|
79
|
-
"peerDependenciesMeta": {
|
|
80
|
-
"@vue/composition-api": {
|
|
81
|
-
"optional": true
|
|
82
|
-
}
|
|
76
|
+
"vue": "^3.2.37",
|
|
77
|
+
"vuetify": "^3.0.0-beta.7"
|
|
83
78
|
},
|
|
84
79
|
"devDependencies": {
|
|
85
|
-
"@codemirror/basic-setup": "^0.20.0",
|
|
86
80
|
"@codemirror/lang-html": "^6.1.0",
|
|
87
|
-
"@types/lodash": "^4.14.182",
|
|
88
81
|
"@types/node": "^18.7.1",
|
|
89
82
|
"@typescript-eslint/eslint-plugin": "^5.33.0",
|
|
90
83
|
"@typescript-eslint/parser": "^5.33.0",
|
|
91
|
-
"@vitejs/plugin-
|
|
92
|
-
"@vue/eslint-config-prettier": "^7.0.0",
|
|
84
|
+
"@vitejs/plugin-vue": "^3.0.1",
|
|
93
85
|
"@vue/tsconfig": "^0.1.3",
|
|
94
86
|
"codemirror": "^6.0.1",
|
|
95
87
|
"eslint": "^8.21.0",
|
|
@@ -97,7 +89,6 @@
|
|
|
97
89
|
"eslint-config-prettier": "^8.5.0",
|
|
98
90
|
"eslint-import-resolver-alias": "^1.1.2",
|
|
99
91
|
"eslint-import-resolver-typescript": "^3.4.0",
|
|
100
|
-
"eslint-plugin-html": "^7.1.0",
|
|
101
92
|
"eslint-plugin-import": "^2.26.0",
|
|
102
93
|
"eslint-plugin-jsdoc": "^39.3.6",
|
|
103
94
|
"eslint-plugin-tsdoc": "^0.2.16",
|
|
@@ -111,7 +102,7 @@
|
|
|
111
102
|
"prettier": "^2.7.1",
|
|
112
103
|
"rimraf": "^3.0.2",
|
|
113
104
|
"rollup-plugin-visualizer": "^5.7.1",
|
|
114
|
-
"sass": "1.
|
|
105
|
+
"sass": "1.54.4",
|
|
115
106
|
"stylelint": "^14.10.0",
|
|
116
107
|
"stylelint-config-prettier": "^9.0.3",
|
|
117
108
|
"stylelint-config-recommended-scss": "^7.0.0",
|
|
@@ -119,16 +110,15 @@
|
|
|
119
110
|
"stylelint-order": "^5.0.0",
|
|
120
111
|
"stylelint-prettier": "^2.0.0",
|
|
121
112
|
"typescript": "^4.7.4",
|
|
122
|
-
"unplugin-vue-components": "^0.22.4",
|
|
123
113
|
"vite": "^3.0.5",
|
|
124
114
|
"vite-plugin-banner": "^0.3.0",
|
|
125
115
|
"vite-plugin-checker": "^0.4.9",
|
|
126
|
-
"
|
|
116
|
+
"vite-plugin-vuetify": "^1.0.0-alpha.14",
|
|
117
|
+
"vue": "^3.2.37",
|
|
127
118
|
"vue-codemirror6": "0.6.8",
|
|
128
119
|
"vue-eslint-parser": "^9.0.3",
|
|
129
|
-
"vue-template-compiler": "^2.7.8",
|
|
130
120
|
"vue-tsc": "^0.40.1",
|
|
131
|
-
"vuetify": "^
|
|
121
|
+
"vuetify": "^3.0.0-beta.7"
|
|
132
122
|
},
|
|
133
123
|
"husky": {
|
|
134
124
|
"hooks": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-sheet class="v-swatches">
|
|
3
|
-
<div v-for="(colors, rows) in swatches" :key="rows">
|
|
3
|
+
<div v-for="(colors, rows) in swatches" :key="rows" class="d-flex">
|
|
4
4
|
<v-btn
|
|
5
5
|
v-for="color in colors"
|
|
6
6
|
:key="color"
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
:width="size"
|
|
9
9
|
:height="size"
|
|
10
10
|
:color="color"
|
|
11
|
-
:value="color"
|
|
11
|
+
:data-value="color"
|
|
12
12
|
min-width="auto"
|
|
13
13
|
@click="onSwatchClick($event)"
|
|
14
14
|
>
|
|
@@ -29,19 +29,13 @@ import {
|
|
|
29
29
|
type SetupContext,
|
|
30
30
|
} from 'vue';
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
import colors from 'vuetify/lib/util/colors';
|
|
32
|
+
// eslint-disable-next-line import/no-unresolved
|
|
33
|
+
import colors from 'vuetify/lib/util/colors.mjs';
|
|
34
34
|
|
|
35
35
|
/** Vuetify Swatches */
|
|
36
36
|
export default defineComponent({
|
|
37
37
|
/** Component name */
|
|
38
38
|
name: 'VSwatches',
|
|
39
|
-
/** Components */
|
|
40
|
-
components: {
|
|
41
|
-
VSheet,
|
|
42
|
-
VBtn,
|
|
43
|
-
VIcon,
|
|
44
|
-
},
|
|
45
39
|
/** Model Definition */
|
|
46
40
|
model: {
|
|
47
41
|
prop: 'modelValue',
|
|
@@ -91,27 +85,24 @@ export default defineComponent({
|
|
|
91
85
|
emits: ['update:modelValue'],
|
|
92
86
|
/**
|
|
93
87
|
* Setup
|
|
94
|
-
*
|
|
95
88
|
* @param props - Props
|
|
96
89
|
* @param context - Context
|
|
97
90
|
*/
|
|
98
91
|
setup(props, context: SetupContext) {
|
|
99
92
|
/** Check icon visibility */
|
|
100
93
|
const checkedVisibilty: Ref<boolean> = ref(false);
|
|
101
|
-
|
|
102
94
|
/**
|
|
103
|
-
*
|
|
95
|
+
* ボタンがクリックされた
|
|
104
96
|
*
|
|
105
|
-
* @param e -
|
|
97
|
+
* @param e - イベント
|
|
106
98
|
*/
|
|
107
99
|
const onSwatchClick = (e: Event) => {
|
|
108
|
-
const value = (e.target as HTMLButtonElement).value;
|
|
100
|
+
const value = (e.target as HTMLButtonElement).dataset.value;
|
|
109
101
|
if (!value || props.modelValue === value) {
|
|
110
102
|
return;
|
|
111
103
|
}
|
|
112
104
|
context.emit('update:modelValue', value);
|
|
113
105
|
};
|
|
114
|
-
|
|
115
106
|
return {
|
|
116
107
|
checkedVisibilty,
|
|
117
108
|
onSwatchClick,
|