vuetify-swatches 0.0.10 → 0.1.1

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.
@@ -4,7 +4,7 @@ declare const _default: import("vue/types/v3-define-component").DefineComponent<
4
4
  /** Model value */
5
5
  modelValue: {
6
6
  type: StringConstructor;
7
- required: true;
7
+ default: string;
8
8
  };
9
9
  /** Swatch colors */
10
10
  swatches: {
@@ -33,13 +33,12 @@ declare const _default: import("vue/types/v3-define-component").DefineComponent<
33
33
  };
34
34
  }, {
35
35
  checkedVisibilty: Ref<boolean>;
36
- selected: Ref<string>;
37
36
  onSwatchClick: (e: Event) => void;
38
37
  }, import("vue").Data, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
39
38
  /** Model value */
40
39
  modelValue: {
41
40
  type: StringConstructor;
42
- required: true;
41
+ default: string;
43
42
  };
44
43
  /** Swatch colors */
45
44
  swatches: {
@@ -67,6 +66,7 @@ declare const _default: import("vue/types/v3-define-component").DefineComponent<
67
66
  default: string;
68
67
  };
69
68
  }>>, {
69
+ modelValue: string;
70
70
  swatches: string[] | string[][];
71
71
  elevation: number;
72
72
  size: string;
@@ -1 +1 @@
1
- {"version":3,"file":"VSwatches.vue.d.ts","sourceRoot":"","sources":["../../src/components/VSwatches.vue.ts"],"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;;;;;;;;uBAsBC,KAAK;;IA1D/B,kBAAkB;;;;;IAElB,oBAAoB;;;;;IA4BpB,2CAA2C;;;;;IAE3C,mBAAmB;;;;;IAEnB,oBAAoB;;;;;IAEpB,yBAAyB;;;;;;;;;;;;AAnD7B,wBAwFG"}
1
+ {"version":3,"file":"VSwatches.vue.d.ts","sourceRoot":"","sources":["../../src/components/VSwatches.vue.ts"],"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;;;;;;;uBAmBC,KAAK;;IAvD/B,kBAAkB;;;;;IAElB,oBAAoB;;;;;IA4BpB,2CAA2C;;;;;IAE3C,mBAAmB;;;;;IAEnB,oBAAoB;;;;;IAEpB,yBAAyB;;;;;;;;;;;;;AAnD7B,wBAmFG"}
package/dist/index.es.js CHANGED
@@ -5,51 +5,51 @@
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.0
8
+ * @version 0.1.1
9
9
  * @see {@link https://github.com/logue/vuetify-swatches}
10
10
  */
11
11
 
12
- import { VSheet, VBtn, VIcon } from "vuetify/lib";
13
- import { defineComponent, ref } from "vue";
14
- import colors from "vuetify/lib/util/colors";
15
- var _sfc_main = defineComponent({
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({
16
16
  name: "VSwatches",
17
17
  components: {
18
- VSheet,
19
- VBtn,
20
- VIcon
18
+ VSheet: w,
19
+ VBtn: V,
20
+ VIcon: y
21
21
  },
22
22
  model: {
23
23
  prop: "modelValue",
24
24
  event: "update:modelValue"
25
25
  },
26
26
  props: {
27
- modelValue: { type: String, required: true },
27
+ modelValue: { type: String, default: "#ffffff" },
28
28
  swatches: {
29
29
  type: Array,
30
30
  default: () => [
31
- [colors.shades.black, colors.shades.white],
31
+ [e.shades.black, e.shades.white],
32
32
  [
33
- colors.red.base,
34
- colors.pink.base,
35
- colors.purple.base,
36
- colors.deepPurple.base,
37
- colors.indigo.base,
38
- colors.blue.base,
39
- colors.lightBlue.base,
40
- colors.cyan.base
33
+ e.red.base,
34
+ e.pink.base,
35
+ e.purple.base,
36
+ e.deepPurple.base,
37
+ e.indigo.base,
38
+ e.blue.base,
39
+ e.lightBlue.base,
40
+ e.cyan.base
41
41
  ],
42
42
  [
43
- colors.teal.base,
44
- colors.green.base,
45
- colors.lightGreen.base,
46
- colors.lime.base,
47
- colors.yellow.base,
48
- colors.amber.base,
49
- colors.orange.base,
50
- colors.deepOrange.base
43
+ e.teal.base,
44
+ e.green.base,
45
+ e.lightGreen.base,
46
+ e.lime.base,
47
+ e.yellow.base,
48
+ e.amber.base,
49
+ e.orange.base,
50
+ e.deepOrange.base
51
51
  ],
52
- [colors.brown.base, colors.blueGrey.base, colors.grey.base]
52
+ [e.brown.base, e.blueGrey.base, e.grey.base]
53
53
  ]
54
54
  },
55
55
  elevation: { type: Number, default: 1 },
@@ -58,90 +58,53 @@ var _sfc_main = defineComponent({
58
58
  iconSize: { type: String, default: "1rem" }
59
59
  },
60
60
  emits: ["update:modelValue"],
61
- setup(props, context) {
62
- const checkedVisibilty = ref(false);
63
- const selected = ref(props.modelValue);
64
- const onSwatchClick = (e) => {
65
- const value = e.target.value;
66
- if (!value || selected.value === value) {
67
- return;
68
- }
69
- selected.value = value;
70
- context.emit("update:modelValue", value);
71
- };
61
+ setup(s, t) {
72
62
  return {
73
- checkedVisibilty,
74
- selected,
75
- onSwatchClick
76
- };
77
- }
78
- });
79
- var VSwatches_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".v-swatches .v-btn{padding:0!important;margin:.1rem}.v-swatches .v-btn .v-icon{filter:invert(100%)}\n")();
80
- function normalizeComponent(scriptExports, render2, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
81
- var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
82
- if (render2) {
83
- options.render = render2;
84
- options.staticRenderFns = staticRenderFns;
85
- options._compiled = true;
86
- }
87
- if (functionalTemplate) {
88
- options.functional = true;
89
- }
90
- if (scopeId) {
91
- options._scopeId = "data-v-" + scopeId;
92
- }
93
- var hook;
94
- if (moduleIdentifier) {
95
- hook = function(context) {
96
- context = context || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
97
- if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") {
98
- context = __VUE_SSR_CONTEXT__;
99
- }
100
- if (injectStyles) {
101
- injectStyles.call(this, context);
102
- }
103
- if (context && context._registeredComponents) {
104
- context._registeredComponents.add(moduleIdentifier);
63
+ checkedVisibilty: v(!1),
64
+ onSwatchClick: (i) => {
65
+ const a = i.target.value;
66
+ !a || s.modelValue === a || t.emit("update:modelValue", a);
105
67
  }
106
68
  };
107
- options._ssrRegister = hook;
108
- } else if (injectStyles) {
109
- hook = shadowMode ? function() {
110
- injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot);
111
- } : injectStyles;
112
69
  }
113
- if (hook) {
114
- if (options.functional) {
115
- options._injectStyles = hook;
116
- var originalRender = options.render;
117
- options.render = function renderWithStyleInjection(h, context) {
118
- hook.call(context);
119
- return originalRender(h, context);
70
+ });
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);
120
85
  };
121
86
  } else {
122
- var existing = options.beforeCreate;
123
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
87
+ var f = n.beforeCreate;
88
+ n.beforeCreate = f ? [].concat(f, r) : [r];
124
89
  }
125
- }
126
90
  return {
127
- exports: scriptExports,
128
- options
91
+ exports: s,
92
+ options: n
129
93
  };
130
94
  }
131
- var _sfc_render = function render() {
132
- var _vm = this, _c = _vm._self._c;
133
- _vm._self._setupProxy;
134
- return _c(VSheet, { staticClass: "v-swatches" }, _vm._l(_vm.swatches, function(colors2, rows) {
135
- return _c("div", { key: rows }, _vm._l(colors2, function(color) {
136
- return _c(VBtn, { key: color, attrs: { "elevation": _vm.elevation, "width": _vm.size, "height": _vm.size, "color": color, "value": color, "min-width": "auto" }, on: { "click": _vm.onSwatchClick } }, [color === _vm.selected ? _c(VIcon, { attrs: { "size": _vm.iconSize, "color": color } }, [_vm._v(" " + _vm._s(_vm.icon) + " ")]) : _vm._e()], 1);
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);
137
102
  }), 1);
138
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(_);
107
+ export {
108
+ _ as default,
109
+ N as install
139
110
  };
140
- var _sfc_staticRenderFns = [];
141
- var __component__ = /* @__PURE__ */ normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, null, null, null);
142
- var VSwatches = __component__.exports;
143
- const installVSwatches = (app) => app.component("VSwatches", VSwatches);
144
- if (typeof window !== "undefined" && window.Vue) {
145
- window.Vue.use(VSwatches);
146
- }
147
- export { VSwatches as default, installVSwatches as install };
package/dist/index.umd.js CHANGED
@@ -5,9 +5,8 @@
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.0
8
+ * @version 0.1.1
9
9
  * @see {@link https://github.com/logue/vuetify-swatches}
10
10
  */
11
11
 
12
- (function(i,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("vuetify/lib"),require("vue"),require("vuetify/lib/util/colors")):typeof define=="function"&&define.amd?define(["exports","vuetify/lib","vue","vuetify/lib/util/colors"],u):(i=typeof globalThis<"u"?globalThis:i||self,u(i.VSwatches={},i.Vuetify,i.Vue,i.colors))})(this,function(i,u,_,m){"use strict";function b(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var e=b(m),y=_.defineComponent({name:"VSwatches",components:{VSheet:u.VSheet,VBtn:u.VBtn,VIcon:u.VIcon},model:{prop:"modelValue",event:"update:modelValue"},props:{modelValue:{type:String,required:!0},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(a,t){const r=_.ref(!1),f=_.ref(a.modelValue);return{checkedVisibilty:r,selected:f,onSwatchClick:s=>{const c=s.target.value;!c||f.value===c||(f.value=c,t.emit("update:modelValue",c))}}}}),R=(()=>`.v-swatches .v-btn{padding:0!important;margin:.1rem}.v-swatches .v-btn .v-icon{filter:invert(100%)}
13
- `)();function V(a,t,r,f,o,s,c,k){var n=typeof a=="function"?a.options:a;t&&(n.render=t,n.staticRenderFns=r,n._compiled=!0),f&&(n.functional=!0),s&&(n._scopeId="data-v-"+s);var d;if(c?(d=function(l){l=l||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!l&&typeof __VUE_SSR_CONTEXT__<"u"&&(l=__VUE_SSR_CONTEXT__),o&&o.call(this,l),l&&l._registeredComponents&&l._registeredComponents.add(c)},n._ssrRegister=d):o&&(d=k?function(){o.call(this,(n.functional?this.parent:this).$root.$options.shadowRoot)}:o),d)if(n.functional){n._injectStyles=d;var z=n.render;n.render=function(T,v){return d.call(v),z(T,v)}}else{var h=n.beforeCreate;n.beforeCreate=h?[].concat(h,d):[d]}return{exports:a,options:n}}var w=function(){var t=this,r=t._self._c;return t._self._setupProxy,r(u.VSheet,{staticClass:"v-swatches"},t._l(t.swatches,function(f,o){return r("div",{key:o},t._l(f,function(s){return r(u.VBtn,{key:s,attrs:{elevation:t.elevation,width:t.size,height:t.size,color:s,value:s,"min-width":"auto"},on:{click:t.onSwatchClick}},[s===t.selected?r(u.VIcon,{attrs:{size:t.iconSize,color:s}},[t._v(" "+t._s(t.icon)+" ")]):t._e()],1)}),1)}),0)},S=[],g=V(y,w,S,!1,null,null,null,null),p=g.exports;const C=a=>a.component("VSwatches",p);typeof window<"u"&&window.Vue&&window.Vue.use(p),i.default=p,i.install=C,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
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"}})});
package/dist/style.css CHANGED
@@ -5,8 +5,8 @@
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.0
8
+ * @version 0.1.1
9
9
  * @see {@link https://github.com/logue/vuetify-swatches}
10
10
  */
11
11
 
12
- .v-swatches .v-btn{padding:0!important;margin:.1rem}.v-swatches .v-btn .v-icon{filter:invert(100%)}
12
+ .v-swatches .v-btn{padding:0!important;margin:.1rem}.v-swatches .v-btn .v-icon{filter:invert(100%) grayscale(100%) contrast(100)}
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "vuetify-swatches",
4
- "version": "0.0.10",
4
+ "version": "0.1.1",
5
+ "license": "MIT",
5
6
  "description": "Color Swatch component for Vuetify.",
6
7
  "keywords": [
7
8
  "vuejs",
@@ -29,16 +30,12 @@
29
30
  "bugs": {
30
31
  "url": "https://github.com/logue/vuetify-swatches/issues"
31
32
  },
32
- "engines": {
33
- "node": ">=16.15.0",
34
- "yarn": ">=1.22.4"
35
- },
36
- "packageManager": "yarn@3.2.1",
37
- "license": "MIT",
38
- "main": "./dist/index.umd.js",
39
- "module": "./dist/index.es.js",
33
+ "main": "dist/index.umd.js",
34
+ "module": "dist/index.es.js",
35
+ "types": "dist/index.d.ts",
36
+ "style": "dist/style.css",
40
37
  "browser": {
41
- "./sfc": "./src/components/VSwatches.vue"
38
+ "sfc": "src/components/VSwatches.vue"
42
39
  },
43
40
  "exports": {
44
41
  ".": {
@@ -50,12 +47,16 @@
50
47
  "require": "./dist/style.css"
51
48
  }
52
49
  },
53
- "types": "./dist/index.d.ts",
54
50
  "files": [
55
51
  "dist",
56
52
  "src/components/VSwatches.vue"
57
53
  ],
58
54
  "sideEffects": false,
55
+ "engines": {
56
+ "node": ">=16.15.0",
57
+ "yarn": ">=1.22.4"
58
+ },
59
+ "packageManager": "yarn@3.2.1",
59
60
  "scripts": {
60
61
  "dev": "vite",
61
62
  "clean": "rimraf node_modules/.vite ",
@@ -70,53 +71,62 @@
70
71
  "prepare": "husky install"
71
72
  },
72
73
  "peerDependencies": {
73
- "vue": "^2.7.2",
74
- "vuetify": "^2.6.7"
74
+ "@vue/composition-api": "^1.7.0",
75
+ "vue": "^2.6.14",
76
+ "vuetify": "^2.6.8"
77
+ },
78
+ "peerDependenciesMeta": {
79
+ "@vue/composition-api": {
80
+ "optional": true
81
+ }
75
82
  },
76
83
  "devDependencies": {
84
+ "@codemirror/basic-setup": "^0.20.0",
77
85
  "@codemirror/lang-html": "^6.1.0",
78
- "@types/node": "^18.0.2",
79
- "@typescript-eslint/eslint-plugin": "^5.30.5",
80
- "@typescript-eslint/parser": "^5.30.5",
86
+ "@types/node": "^18.6.3",
87
+ "@typescript-eslint/eslint-plugin": "^5.32.0",
88
+ "@typescript-eslint/parser": "^5.32.0",
81
89
  "@vitejs/plugin-vue2": "^1.1.2",
82
90
  "@vue/eslint-config-prettier": "^7.0.0",
83
- "eslint": "^8.19.0",
91
+ "@vue/tsconfig": "^0.1.3",
92
+ "codemirror": "^6.0.1",
93
+ "eslint": "^8.21.0",
84
94
  "eslint-config-google": "^0.14.0",
85
95
  "eslint-config-prettier": "^8.5.0",
86
96
  "eslint-import-resolver-alias": "^1.1.2",
87
- "eslint-import-resolver-typescript": "^3.2.2",
88
- "eslint-plugin-html": "^6.2.0",
97
+ "eslint-import-resolver-typescript": "^3.4.0",
98
+ "eslint-plugin-html": "^7.1.0",
89
99
  "eslint-plugin-import": "^2.26.0",
90
- "eslint-plugin-jsdoc": "^39.3.3",
100
+ "eslint-plugin-jsdoc": "^39.3.4",
91
101
  "eslint-plugin-tsdoc": "^0.2.16",
92
- "eslint-plugin-vue": "^9.1.1",
102
+ "eslint-plugin-vue": "^9.3.0",
93
103
  "eslint-plugin-vuejs-accessibility": "^1.2.0",
94
104
  "eslint-plugin-vuetify": "^1.1.0",
95
105
  "eslint-plugin-yaml": "^0.5.0",
96
106
  "husky": "^8.0.1",
97
107
  "lint-staged": "^13.0.3",
98
- "postcss-html": "^1.4.1",
108
+ "postcss-html": "^1.5.0",
99
109
  "prettier": "^2.7.1",
100
110
  "rimraf": "^3.0.2",
101
- "rollup-plugin-visualizer": "^5.6.0",
111
+ "rollup-plugin-visualizer": "^5.7.1",
102
112
  "sass": "1.32.12",
103
113
  "stylelint": "^14.9.1",
104
114
  "stylelint-config-prettier": "^9.0.3",
105
- "stylelint-config-recommended-scss": "^6.0.0",
115
+ "stylelint-config-recommended-scss": "^7.0.0",
106
116
  "stylelint-config-recommended-vue": "^1.4.0",
107
117
  "stylelint-order": "^5.0.0",
108
118
  "stylelint-prettier": "^2.0.0",
109
119
  "typescript": "^4.7.4",
110
- "unplugin-vue-components": "^0.21.0",
111
- "vite": "^2.9.13",
120
+ "unplugin-vue-components": "^0.21.2",
121
+ "vite": "^3.0.4",
112
122
  "vite-plugin-banner": "^0.3.0",
113
- "vite-plugin-checker": "^0.4.8",
114
- "vue": "^2.7.2",
115
- "vue-codemirror6": "0.6.5",
123
+ "vite-plugin-checker": "^0.4.9",
124
+ "vue": "^2.7.8",
125
+ "vue-codemirror6": "0.6.8",
116
126
  "vue-eslint-parser": "^9.0.3",
117
- "vue-template-compiler": "^2.7.2",
118
- "vue-tsc": "^0.38.2",
119
- "vuetify": "^2.6.7"
127
+ "vue-template-compiler": "^2.7.8",
128
+ "vue-tsc": "^0.39.4",
129
+ "vuetify": "^2.6.8"
120
130
  },
121
131
  "husky": {
122
132
  "hooks": {
@@ -10,9 +10,9 @@
10
10
  :color="color"
11
11
  :value="color"
12
12
  min-width="auto"
13
- @click="onSwatchClick"
13
+ @click="onSwatchClick($event)"
14
14
  >
15
- <v-icon v-if="color === selected" :size="iconSize" :color="color">
15
+ <v-icon v-if="color === modelValue" :size="iconSize" :color="color">
16
16
  {{ icon }}
17
17
  </v-icon>
18
18
  </v-btn>
@@ -29,7 +29,7 @@ import {
29
29
  type SetupContext,
30
30
  } from 'vue';
31
31
 
32
- import { VSheet, VIcon, VBtn } from 'vuetify/lib';
32
+ import { VSheet, VIcon, VBtn } from 'vuetify/lib/components';
33
33
  import colors from 'vuetify/lib/util/colors';
34
34
 
35
35
  /** Vuetify Swatches */
@@ -49,7 +49,7 @@ export default defineComponent({
49
49
  },
50
50
  props: {
51
51
  /** Model value */
52
- modelValue: { type: String, required: true },
52
+ modelValue: { type: String, default: '#ffffff' },
53
53
  /** Swatch colors */
54
54
  swatches: {
55
55
  type: Array as PropType<string[] | string[][]>,
@@ -95,12 +95,9 @@ export default defineComponent({
95
95
  * @param context - Context
96
96
  */
97
97
  setup(props, context: SetupContext) {
98
- /** チェックアイコンの表示制御 */
98
+ /** Check icon visibility */
99
99
  const checkedVisibilty: Ref<boolean> = ref(false);
100
100
 
101
- /** Selected color */
102
- const selected: Ref<string> = ref(props.modelValue);
103
-
104
101
  /**
105
102
  * ボタンがクリックされた
106
103
  *
@@ -108,16 +105,14 @@ export default defineComponent({
108
105
  */
109
106
  const onSwatchClick = (e: Event) => {
110
107
  const value = (e.target as HTMLButtonElement).value;
111
- if (!value || selected.value === value) {
108
+ if (!value || props.modelValue === value) {
112
109
  return;
113
110
  }
114
- selected.value = value;
115
111
  context.emit('update:modelValue', value);
116
112
  };
117
113
 
118
114
  return {
119
115
  checkedVisibilty,
120
- selected,
121
116
  onSwatchClick,
122
117
  };
123
118
  },
@@ -131,7 +126,7 @@ export default defineComponent({
131
126
  margin: 0.1rem;
132
127
 
133
128
  .v-icon {
134
- filter: invert(100%);
129
+ filter: invert(100%) grayscale(100%) contrast(100);
135
130
  }
136
131
  }
137
132
  }