vuetify-swatches 0.0.8 → 0.0.11

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
@@ -38,7 +38,7 @@ export default Vue.extend({
38
38
  </script>
39
39
 
40
40
  <style>
41
- @import 'vuetify-swatches/dist/style.css';
41
+ @import 'vuetify-swatches/style.css';
42
42
  </style>
43
43
  ```
44
44
 
@@ -117,7 +117,7 @@ export default Vue.extend({
117
117
  </script>
118
118
 
119
119
  <style>
120
- @import 'vuetify-swatches/dist/style.css';
120
+ @import 'vuetify-swatches/style.css';
121
121
  </style>
122
122
  ```
123
123
 
@@ -1,14 +1,10 @@
1
- import { type PropType, type Ref } from 'vue-demi';
1
+ import { type PropType, type Ref } from 'vue';
2
2
  /** Vuetify Swatches */
3
- declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
4
- checkedVisibilty: Ref<boolean>;
5
- selected: Ref<string>;
6
- onSwatchClick: (e: Event) => void;
7
- }> & import("@vue/composition-api").Data, {}, {}, {
3
+ declare const _default: import("vue/types/v3-define-component").DefineComponent<{
8
4
  /** Model value */
9
5
  modelValue: {
10
6
  type: StringConstructor;
11
- required: true;
7
+ default: string;
12
8
  };
13
9
  /** Swatch colors */
14
10
  swatches: {
@@ -35,11 +31,14 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
35
31
  type: StringConstructor;
36
32
  default: string;
37
33
  };
38
- }, import("@vue/composition-api").ExtractPropTypes<{
34
+ }, {
35
+ checkedVisibilty: Ref<boolean>;
36
+ onSwatchClick: (e: Event) => void;
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: {
@@ -66,30 +65,13 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
66
65
  type: StringConstructor;
67
66
  default: string;
68
67
  };
69
- }>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
68
+ }>>, {
70
69
  modelValue: string;
71
70
  swatches: string[] | string[][];
72
71
  elevation: number;
73
72
  size: string;
74
73
  icon: string;
75
74
  iconSize: string;
76
- } & {}, import("@vue/composition-api").ShallowUnwrapRef<{
77
- checkedVisibilty: Ref<boolean>;
78
- selected: Ref<string>;
79
- onSwatchClick: (e: Event) => void;
80
- }>, import("@vue/composition-api").Data, {}, {}, {}, {}, {}, {
81
- modelValue: string;
82
- swatches: string[] | string[][];
83
- elevation: number;
84
- size: string;
85
- icon: string;
86
- iconSize: string;
87
- } & {}, {
88
- swatches: string[] | string[][];
89
- elevation: number;
90
- size: string;
91
- icon: string;
92
- iconSize: string;
93
- }, true>);
75
+ }>;
94
76
  export default _default;
95
77
  //# sourceMappingURL=VSwatches.vue.d.ts.map
@@ -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,UAAU,CAAC;AAKlB,uBAAuB;;;;uBA0EO,KAAK;;IA1D/B,kBAAkB;;;;;IAElB,oBAAoB;;;;;IA4BpB,2CAA2C;;;;;IAE3C,mBAAmB;;;;;IAEnB,oBAAoB;;;;;IAEpB,yBAAyB;;;;;;IApCzB,kBAAkB;;;;;IAElB,oBAAoB;;;;;IA4BpB,2CAA2C;;;;;IAE3C,mBAAmB;;;;;IAEnB,oBAAoB;;;;;IAEpB,yBAAyB;;;;;;;;;;;;;;;uBAsBC,KAAK;;;;;;;;;;;;;;;AAzEnC,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.d.ts CHANGED
@@ -1,11 +1,3 @@
1
- /**
2
- * Vuetify Swatches Component
3
- *
4
- * @license MIT
5
- * @author Logue {@link logue@hotmail.co.jp}
6
- * @copyright 2022 Masashi Yoshikawa {@link https://logue.dev/} All rights reserved.
7
- * @see {@link https://github.com/logue/vuetify-swatches}
8
- */
9
1
  import VSwatches from './components/VSwatches.vue';
10
2
  declare const installVSwatches: (app: any) => any;
11
3
  export { VSwatches as default, installVSwatches as install };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,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,mBAA+C,CAAC;AAEtE,OAAO,EAAE,SAAS,IAAI,OAAO,EAAE,gBAAgB,IAAI,OAAO,EAAE,CAAC"}
package/dist/index.es.js CHANGED
@@ -1,7 +1,18 @@
1
- import { defineComponent, ref } from "vue-demi";
1
+ /**
2
+ * vuetify-swatches
3
+ *
4
+ * @description Color Swatch component for Vuetify.
5
+ * @author Logue <logue@hotmail.co.jp>
6
+ * @copyright 2022 By Masashi Yoshikawa All rights reserved.
7
+ * @license MIT
8
+ * @version 0.0.11
9
+ * @see {@link https://github.com/logue/vuetify-swatches}
10
+ */
11
+
2
12
  import { VSheet, VBtn, VIcon } from "vuetify/lib";
13
+ import { defineComponent, ref } from "vue";
3
14
  import colors from "vuetify/lib/util/colors";
4
- var __vue2_script = defineComponent({
15
+ var _sfc_main = defineComponent({
5
16
  name: "VSwatches",
6
17
  components: {
7
18
  VSheet,
@@ -13,7 +24,7 @@ var __vue2_script = defineComponent({
13
24
  event: "update:modelValue"
14
25
  },
15
26
  props: {
16
- modelValue: { type: String, required: true },
27
+ modelValue: { type: String, default: "#ffffff" },
17
28
  swatches: {
18
29
  type: Array,
19
30
  default: () => [
@@ -49,61 +60,25 @@ var __vue2_script = defineComponent({
49
60
  emits: ["update:modelValue"],
50
61
  setup(props, context) {
51
62
  const checkedVisibilty = ref(false);
52
- const selected = ref(props.modelValue);
53
63
  const onSwatchClick = (e) => {
54
64
  const value = e.target.value;
55
- if (!value || selected.value === value) {
65
+ if (!value || props.modelValue === value) {
56
66
  return;
57
67
  }
58
- selected.value = value;
59
68
  context.emit("update:modelValue", value);
60
69
  };
61
70
  return {
62
71
  checkedVisibilty,
63
- selected,
64
72
  onSwatchClick
65
73
  };
66
74
  }
67
75
  });
68
- var render = function() {
69
- var _vm = this;
70
- var _h = _vm.$createElement;
71
- var _c = _vm._self._c || _h;
72
- return _c(VSheet, {
73
- staticClass: "v-swatches"
74
- }, _vm._l(_vm.swatches, function(colors2, rows) {
75
- return _c("div", {
76
- key: rows
77
- }, _vm._l(colors2, function(color) {
78
- return _c(VBtn, {
79
- key: color,
80
- attrs: {
81
- "elevation": _vm.elevation,
82
- "width": _vm.size,
83
- "height": _vm.size,
84
- "color": color,
85
- "value": color,
86
- "min-width": "auto"
87
- },
88
- on: {
89
- "click": _vm.onSwatchClick
90
- }
91
- }, [color === _vm.selected ? _c(VIcon, {
92
- attrs: {
93
- "size": _vm.iconSize,
94
- "color": color
95
- }
96
- }, [_vm._v(" " + _vm._s(_vm.icon) + " ")]) : _vm._e()], 1);
97
- }), 1);
98
- }), 0);
99
- };
100
- var staticRenderFns = [];
101
- var VSwatches_vue_vue_type_style_index_0_lang = "";
102
- function normalizeComponent(scriptExports, render2, staticRenderFns2, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
76
+ 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")();
77
+ function normalizeComponent(scriptExports, render2, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
103
78
  var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
104
79
  if (render2) {
105
80
  options.render = render2;
106
- options.staticRenderFns = staticRenderFns2;
81
+ options.staticRenderFns = staticRenderFns;
107
82
  options._compiled = true;
108
83
  }
109
84
  if (functionalTemplate) {
@@ -150,23 +125,22 @@ function normalizeComponent(scriptExports, render2, staticRenderFns2, functional
150
125
  options
151
126
  };
152
127
  }
153
- const __cssModules = {};
154
- var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles, null, null, null);
155
- function __vue2_injectStyles(context) {
156
- for (let o in __cssModules) {
157
- this[o] = __cssModules[o];
158
- }
159
- }
160
- var VSwatches = /* @__PURE__ */ function() {
161
- return __component__.exports;
162
- }();
163
- /**
164
- * Vuetify Swatches Component
165
- *
166
- * @license MIT
167
- * @author Logue {@link logue@hotmail.co.jp}
168
- * @copyright 2022 Masashi Yoshikawa {@link https://logue.dev/} All rights reserved.
169
- * @see {@link https://github.com/logue/vuetify-swatches}
170
- */
128
+ var _sfc_render = function render() {
129
+ var _vm = this, _c = _vm._self._c;
130
+ _vm._self._setupProxy;
131
+ return _c(VSheet, { staticClass: "v-swatches" }, _vm._l(_vm.swatches, function(colors2, rows) {
132
+ return _c("div", { key: rows }, _vm._l(colors2, function(color) {
133
+ return _c(VBtn, { key: color, attrs: { "elevation": _vm.elevation, "width": _vm.size, "height": _vm.size, "color": color, "value": color, "min-width": "auto" }, on: { "click": function($event) {
134
+ return _vm.onSwatchClick($event);
135
+ } } }, [color === _vm.modelValue ? _c(VIcon, { attrs: { "size": _vm.iconSize, "color": color } }, [_vm._v(" " + _vm._s(_vm.icon) + " ")]) : _vm._e()], 1);
136
+ }), 1);
137
+ }), 0);
138
+ };
139
+ var _sfc_staticRenderFns = [];
140
+ var __component__ = /* @__PURE__ */ normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, null, null, null);
141
+ var VSwatches = __component__.exports;
171
142
  const installVSwatches = (app) => app.component("VSwatches", VSwatches);
143
+ if (typeof window !== "undefined" && window.Vue) {
144
+ window.Vue.use(VSwatches);
145
+ }
172
146
  export { VSwatches as default, installVSwatches as install };
package/dist/index.umd.js CHANGED
@@ -1,8 +1,13 @@
1
- (function(n,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue-demi"),require("vuetify/lib"),require("vuetify/lib/util/colors")):typeof define=="function"&&define.amd?define(["exports","vue-demi","vuetify/lib","vuetify/lib/util/colors"],d):(n=typeof globalThis<"u"?globalThis:n||self,d(n.VSwatches={},n.VueDemi,n.Vuetify,n.colors))})(this,function(n,d,_,b){"use strict";function y(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var t=y(b),V=d.defineComponent({name:"VSwatches",components:{VSheet:_.VSheet,VBtn:_.VBtn,VIcon:_.VIcon},model:{prop:"modelValue",event:"update:modelValue"},props:{modelValue:{type:String,required:!0},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(e,u){const s=d.ref(!1),f=d.ref(e.modelValue);return{checkedVisibilty:s,selected:f,onSwatchClick:i=>{const c=i.target.value;!c||f.value===c||(f.value=c,u.emit("update:modelValue",c))}}}}),S=function(){var e=this,u=e.$createElement,s=e._self._c||u;return s(_.VSheet,{staticClass:"v-swatches"},e._l(e.swatches,function(f,r){return s("div",{key:r},e._l(f,function(i){return s(_.VBtn,{key:i,attrs:{elevation:e.elevation,width:e.size,height:e.size,color:i,value:i,"min-width":"auto"},on:{click:e.onSwatchClick}},[i===e.selected?s(_.VIcon,{attrs:{size:e.iconSize,color:i}},[e._v(" "+e._s(e.icon)+" ")]):e._e()],1)}),1)}),0)},w=[],q="";function g(e,u,s,f,r,i,c,T){var a=typeof e=="function"?e.options:e;u&&(a.render=u,a.staticRenderFns=s,a._compiled=!0),f&&(a.functional=!0),i&&(a._scopeId="data-v-"+i);var o;if(c?(o=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__),r&&r.call(this,l),l&&l._registeredComponents&&l._registeredComponents.add(c)},a._ssrRegister=o):r&&(o=T?function(){r.call(this,(a.functional?this.parent:this).$root.$options.shadowRoot)}:r),o)if(a.functional){a._injectStyles=o;var $=a.render;a.render=function(R,m){return o.call(m),$(R,m)}}else{var v=a.beforeCreate;a.beforeCreate=v?[].concat(v,o):[o]}return{exports:e,options:a}}const h={};var C=g(V,S,w,!1,k,null,null,null);function k(e){for(let u in h)this[u]=h[u]}var p=function(){return C.exports}();/**
2
- * Vuetify Swatches Component
1
+ /**
2
+ * vuetify-swatches
3
3
  *
4
+ * @description Color Swatch component for Vuetify.
5
+ * @author Logue <logue@hotmail.co.jp>
6
+ * @copyright 2022 By Masashi Yoshikawa All rights reserved.
4
7
  * @license MIT
5
- * @author Logue {@link logue@hotmail.co.jp}
6
- * @copyright 2022 Masashi Yoshikawa {@link https://logue.dev/} All rights reserved.
8
+ * @version 0.0.11
7
9
  * @see {@link https://github.com/logue/vuetify-swatches}
8
- */const z=e=>e.component("VSwatches",p);n.default=p,n.install=z,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
10
+ */
11
+
12
+ (function(u,l){typeof exports=="object"&&typeof module<"u"?l(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"],l):(u=typeof globalThis<"u"?globalThis:u||self,l(u.VSwatches={},u.Vuetify,u.Vue,u.colors))})(this,function(u,l,p,m){"use strict";function b(n){return n&&typeof n=="object"&&"default"in n?n:{default:n}}var e=b(m),V=p.defineComponent({name:"VSwatches",components:{VSheet:l.VSheet,VBtn:l.VBtn,VIcon:l.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:p.ref(!1),onSwatchClick:s=>{const i=s.target.value;!i||n.modelValue===i||t.emit("update:modelValue",i)}}}}),R=(()=>`.v-swatches .v-btn{padding:0!important;margin:.1rem}.v-swatches .v-btn .v-icon{filter:invert(100%)}
13
+ `)();function y(n,t,f,d,s,i,c,k){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 r;if(c?(r=function(o){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__),s&&s.call(this,o),o&&o._registeredComponents&&o._registeredComponents.add(c)},a._ssrRegister=r):s&&(r=k?function(){s.call(this,(a.functional?this.parent:this).$root.$options.shadowRoot)}:s),r)if(a.functional){a._injectStyles=r;var z=a.render;a.render=function(T,v){return r.call(v),z(T,v)}}else{var h=a.beforeCreate;a.beforeCreate=h?[].concat(h,r):[r]}return{exports:n,options:a}}var w=function(){var t=this,f=t._self._c;return t._self._setupProxy,f(l.VSheet,{staticClass:"v-swatches"},t._l(t.swatches,function(d,s){return f("div",{key:s},t._l(d,function(i){return f(l.VBtn,{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(l.VIcon,{attrs:{size:t.iconSize,color:i}},[t._v(" "+t._s(t.icon)+" ")]):t._e()],1)}),1)}),0)},S=[],g=y(V,w,S,!1,null,null,null,null),_=g.exports;const C=n=>n.component("VSwatches",_);typeof window<"u"&&window.Vue&&window.Vue.use(_),u.default=_,u.install=C,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/dist/style.css CHANGED
@@ -1 +1,12 @@
1
+ /**
2
+ * vuetify-swatches
3
+ *
4
+ * @description Color Swatch component for Vuetify.
5
+ * @author Logue <logue@hotmail.co.jp>
6
+ * @copyright 2022 By Masashi Yoshikawa All rights reserved.
7
+ * @license MIT
8
+ * @version 0.0.11
9
+ * @see {@link https://github.com/logue/vuetify-swatches}
10
+ */
11
+
1
12
  .v-swatches .v-btn{padding:0!important;margin:.1rem}.v-swatches .v-btn .v-icon{filter:invert(100%)}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "vuetify-swatches",
4
- "version": "0.0.8",
4
+ "version": "0.0.11",
5
5
  "description": "Color Swatch component for Vuetify.",
6
6
  "keywords": [
7
7
  "vuejs",
@@ -69,62 +69,56 @@
69
69
  "preview": "vite preview --config vite.config.docs.ts",
70
70
  "prepare": "husky install"
71
71
  },
72
- "dependencies": {
73
- "@vue/composition-api": "latest",
74
- "vue-demi": "latest"
75
- },
76
72
  "peerDependencies": {
77
- "vue": "^2.6.14",
78
- "vuetify": "^2.6.6"
73
+ "vue": "^2.7.3",
74
+ "vuetify": "^2.6.7"
79
75
  },
80
76
  "devDependencies": {
81
77
  "@codemirror/basic-setup": "^0.20.0",
82
- "@codemirror/lang-html": "^0.20.0",
83
- "@codemirror/state": "^0.20.0",
84
- "@codemirror/view": "^0.20.6",
85
- "@types/node": "^17.0.36",
86
- "@typescript-eslint/eslint-plugin": "^5.26.0",
87
- "@typescript-eslint/parser": "^5.26.0",
88
- "eslint": "^8.16.0",
78
+ "@codemirror/lang-html": "^6.1.0",
79
+ "@types/node": "^18.0.3",
80
+ "@typescript-eslint/eslint-plugin": "^5.30.5",
81
+ "@typescript-eslint/parser": "^5.30.5",
82
+ "@vitejs/plugin-vue2": "^1.1.2",
83
+ "@vue/eslint-config-prettier": "^7.0.0",
84
+ "codemirror": "^6.0.1",
85
+ "eslint": "^8.19.0",
89
86
  "eslint-config-google": "^0.14.0",
90
87
  "eslint-config-prettier": "^8.5.0",
91
88
  "eslint-import-resolver-alias": "^1.1.2",
92
- "eslint-import-resolver-typescript": "^2.7.1",
89
+ "eslint-import-resolver-typescript": "^3.2.4",
90
+ "eslint-plugin-html": "^6.2.0",
93
91
  "eslint-plugin-import": "^2.26.0",
94
- "eslint-plugin-jsdoc": "^39.3.2",
92
+ "eslint-plugin-jsdoc": "^39.3.3",
95
93
  "eslint-plugin-tsdoc": "^0.2.16",
96
- "eslint-plugin-vue": "^9.0.1",
97
- "eslint-plugin-vuejs-accessibility": "^1.1.1",
94
+ "eslint-plugin-vue": "^9.2.0",
95
+ "eslint-plugin-vuejs-accessibility": "^1.2.0",
98
96
  "eslint-plugin-vuetify": "^1.1.0",
99
97
  "eslint-plugin-yaml": "^0.5.0",
100
98
  "husky": "^8.0.1",
101
- "lint-staged": "^12.4.2",
99
+ "lint-staged": "^13.0.3",
102
100
  "postcss-html": "^1.4.1",
103
- "prettier": "^2.6.2",
104
- "prettier-plugin-jsdoc": "^0.3.38",
105
- "prettier-plugin-md-nocjsp": "^1.2.0",
106
- "prettier-plugin-sort-imports": "^1.6.1",
101
+ "prettier": "^2.7.1",
107
102
  "rimraf": "^3.0.2",
108
103
  "rollup-plugin-visualizer": "^5.6.0",
109
104
  "sass": "1.32.12",
110
- "stylelint": "^14.8.5",
105
+ "stylelint": "^14.9.1",
111
106
  "stylelint-config-prettier": "^9.0.3",
112
107
  "stylelint-config-recommended-scss": "^6.0.0",
113
108
  "stylelint-config-recommended-vue": "^1.4.0",
114
109
  "stylelint-order": "^5.0.0",
115
110
  "stylelint-prettier": "^2.0.0",
116
- "typescript": "^4.7.2",
117
- "unplugin-vue-components": "^0.19.6",
118
- "vite": "^2.9.9",
119
- "vite-plugin-checker": "^0.4.6",
120
- "vite-plugin-stylelint": "^2.2.3",
121
- "vite-plugin-vue2": "^2.0.1",
122
- "vue": "^2.6.14",
123
- "vue-codemirror6": "0.1.6",
124
- "vue-eslint-parser": "^9.0.2",
125
- "vue-template-compiler": "^2.6.14",
126
- "vue-tsc": "^0.34.17",
127
- "vuetify": "^2.6.6"
111
+ "typescript": "^4.7.4",
112
+ "unplugin-vue-components": "^0.21.1",
113
+ "vite": "^2.9.13",
114
+ "vite-plugin-banner": "^0.3.0",
115
+ "vite-plugin-checker": "^0.4.8",
116
+ "vue": "^2.7.3",
117
+ "vue-codemirror6": "0.6.6",
118
+ "vue-eslint-parser": "^9.0.3",
119
+ "vue-template-compiler": "^2.7.3",
120
+ "vue-tsc": "^0.38.2",
121
+ "vuetify": "^2.6.7"
128
122
  },
129
123
  "husky": {
130
124
  "hooks": {
@@ -136,5 +130,8 @@
136
130
  "*.{js,ts,json,yml,yaml,vue,htm,html}": "eslint --fix --cache --cache-location ./node_modules/.vite/vite-plugin-eslint",
137
131
  "*.{css,sass,scss,vue,htm,html}": "stylelint --fix --cache --cache-location ./node_modules/.vite/vite-plugin-stylelint",
138
132
  "*": "prettier -w -u"
133
+ },
134
+ "resolutions": {
135
+ "prettier": "^2.7.1"
139
136
  }
140
137
  }
@@ -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>
@@ -27,7 +27,7 @@ import {
27
27
  type PropType,
28
28
  type Ref,
29
29
  type SetupContext,
30
- } from 'vue-demi';
30
+ } from 'vue';
31
31
 
32
32
  import { VSheet, VIcon, VBtn } from 'vuetify/lib';
33
33
  import colors from 'vuetify/lib/util/colors';
@@ -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
  },