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 CHANGED
@@ -8,6 +8,8 @@
8
8
 
9
9
  ![demo](https://user-images.githubusercontent.com/480173/156681882-d3d5e868-ba9a-4a34-9e75-08272d39da64.gif)
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/types/v3-define-component.js").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: () => string[][];
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
- }, import("vue").Data, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, 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: () => string[][];
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;;IAgBnB,kBAAkB;;;;;IAElB,oBAAoB;;;;;IA4BpB,2CAA2C;;;;;IAE3C,mBAAmB;;;;;IAEnB,oBAAoB;;;;;IAEpB,yBAAyB;;;;;;;uBAoBC,KAAK;;IAxD/B,kBAAkB;;;;;IAElB,oBAAoB;;;;;IA4BpB,2CAA2C;;;;;IAE3C,mBAAmB;;;;;IAEnB,oBAAoB;;;;;IAEpB,yBAAyB;;;;;;;;;;;;;AAnD7B,wBAoFG"}
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
@@ -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,mBAA+C,CAAC;AAEtE,OAAO,EAAE,SAAS,IAAI,OAAO,EAAE,gBAAgB,IAAI,OAAO,EAAE,CAAC"}
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 Vuetify.
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.1.3
8
+ * @version 0.3.2
9
9
  * @see {@link https://github.com/logue/vuetify-swatches}
10
10
  */
11
11
 
12
- import { defineComponent as b, ref as v } from "vue";
13
- import { VSheet as w, VBtn as V, VIcon as y } from "vuetify/lib/components";
14
- import e from "vuetify/lib/util/colors";
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(s, t) {
55
+ setup(t, a) {
62
56
  return {
63
- checkedVisibilty: v(!1),
64
- onSwatchClick: (i) => {
65
- const a = i.target.value;
66
- !a || s.modelValue === a || t.emit("update:modelValue", a);
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
- function g(s, t, l, u, i, a, d, p) {
72
- var n = typeof s == "function" ? s.options : s;
73
- t && (n.render = t, n.staticRenderFns = l, n._compiled = !0), u && (n.functional = !0), a && (n._scopeId = "data-v-" + a);
74
- var r;
75
- if (d ? (r = function(o) {
76
- o = o || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !o && typeof __VUE_SSR_CONTEXT__ < "u" && (o = __VUE_SSR_CONTEXT__), i && i.call(this, o), o && o._registeredComponents && o._registeredComponents.add(d);
77
- }, n._ssrRegister = r) : i && (r = p ? function() {
78
- i.call(this, (n.functional ? this.parent : this).$root.$options.shadowRoot);
79
- } : i), r)
80
- if (n.functional) {
81
- n._injectStyles = r;
82
- var h = n.render;
83
- n.render = function(m, c) {
84
- return r.call(c), h(m, c);
85
- };
86
- } else {
87
- var f = n.beforeCreate;
88
- n.beforeCreate = f ? [].concat(f, r) : [r];
89
- }
90
- return {
91
- exports: s,
92
- options: n
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
- var C = function() {
96
- var t = this, l = t._self._c;
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
- _ as default,
109
- N as install
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 Vuetify.
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.1.3
8
+ * @version 0.3.2
9
9
  * @see {@link https://github.com/logue/vuetify-swatches}
10
10
  */
11
11
 
12
- (function(l,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("vuetify/lib/components"),require("vuetify/lib/util/colors")):typeof define=="function"&&define.amd?define(["exports","vue","vuetify/lib/components","vuetify/lib/util/colors"],r):(l=typeof globalThis<"u"?globalThis:l||self,r(l.VSwatches={},l.Vue,l.Vuetify,l.colors))})(this,function(l,r,_,v){"use strict";const e=(n=>n&&typeof n=="object"&&"default"in n?n:{default:n})(v),m=r.defineComponent({name:"VSwatches",components:{VSheet:_.VSheet,VBtn:_.VBtn,VIcon:_.VIcon},model:{prop:"modelValue",event:"update:modelValue"},props:{modelValue:{type:String,default:"#ffffff"},swatches:{type:Array,default:()=>[[e.default.shades.black,e.default.shades.white],[e.default.red.base,e.default.pink.base,e.default.purple.base,e.default.deepPurple.base,e.default.indigo.base,e.default.blue.base,e.default.lightBlue.base,e.default.cyan.base],[e.default.teal.base,e.default.green.base,e.default.lightGreen.base,e.default.lime.base,e.default.yellow.base,e.default.amber.base,e.default.orange.base,e.default.deepOrange.base],[e.default.brown.base,e.default.blueGrey.base,e.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(n,t){return{checkedVisibilty:r.ref(!1),onSwatchClick:u=>{const i=u.target.value;!i||n.modelValue===i||t.emit("update:modelValue",i)}}}}),R="";function y(n,t,f,d,u,i,c,C){var a=typeof n=="function"?n.options:n;t&&(a.render=t,a.staticRenderFns=f,a._compiled=!0),d&&(a.functional=!0),i&&(a._scopeId="data-v-"+i);var o;if(c?(o=function(s){s=s||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!s&&typeof __VUE_SSR_CONTEXT__<"u"&&(s=__VUE_SSR_CONTEXT__),u&&u.call(this,s),s&&s._registeredComponents&&s._registeredComponents.add(c)},a._ssrRegister=o):u&&(o=C?function(){u.call(this,(a.functional?this.parent:this).$root.$options.shadowRoot)}:u),o)if(a.functional){a._injectStyles=o;var k=a.render;a.render=function(z,b){return o.call(b),k(z,b)}}else{var h=a.beforeCreate;a.beforeCreate=h?[].concat(h,o):[o]}return{exports:n,options:a}}var V=function(){var t=this,f=t._self._c;return t._self._setupProxy,f("v-sheet",{staticClass:"v-swatches"},t._l(t.swatches,function(d,u){return f("div",{key:u},t._l(d,function(i){return f("v-btn",{key:i,attrs:{elevation:t.elevation,width:t.size,height:t.size,color:i,value:i,"min-width":"auto"},on:{click:function(c){return t.onSwatchClick(c)}}},[i===t.modelValue?f("v-icon",{attrs:{size:t.iconSize,color:i}},[t._v(" "+t._s(t.icon)+" ")]):t._e()],1)}),1)}),0)},w=[],S=y(m,V,w,!1,null,null,null,null);const p=S.exports,g=n=>n.component("VSwatches",p);typeof window<"u"&&window.Vue&&window.Vue.use(p),l.default=p,l.install=g,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
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 Vuetify.
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.1.3
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.1.3",
5
- "license": "MIT",
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
- "vue2",
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.15.0",
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 && vite build --mode analyze",
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
- "@vue/composition-api": "^1.7.0",
76
- "vue": "^2.6.14",
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-vue2": "^1.1.2",
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.32.12",
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
- "vue": "^2.7.8",
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": "^2.6.9"
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
- import { VSheet, VIcon, VBtn } from 'vuetify/lib/components';
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
- * Swatch button clicked handler
95
+ * ボタンがクリックされた
104
96
  *
105
- * @param e - Event
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,