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 +2 -2
- package/dist/components/VSwatches.vue.d.ts +10 -28
- package/dist/components/VSwatches.vue.d.ts.map +1 -1
- package/dist/index.d.ts +0 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +35 -61
- package/dist/index.umd.js +10 -5
- package/dist/style.css +11 -0
- package/package.json +33 -36
- package/src/components/VSwatches.vue +6 -11
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ export default Vue.extend({
|
|
|
38
38
|
</script>
|
|
39
39
|
|
|
40
40
|
<style>
|
|
41
|
-
@import 'vuetify-swatches/
|
|
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/
|
|
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
|
|
1
|
+
import { type PropType, type Ref } from 'vue';
|
|
2
2
|
/** Vuetify Swatches */
|
|
3
|
-
declare const _default: import("vue
|
|
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
|
-
|
|
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
|
-
},
|
|
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
|
-
|
|
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
|
-
}
|
|
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
|
-
}
|
|
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,
|
|
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 };
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
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
|
-
|
|
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
|
|
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,
|
|
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 ||
|
|
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
|
|
69
|
-
|
|
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 =
|
|
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
|
-
|
|
154
|
-
var
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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
|
-
|
|
2
|
-
*
|
|
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
|
-
* @
|
|
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
|
-
*/
|
|
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.
|
|
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.
|
|
78
|
-
"vuetify": "^2.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": "^
|
|
83
|
-
"@
|
|
84
|
-
"@
|
|
85
|
-
"@
|
|
86
|
-
"@
|
|
87
|
-
"@
|
|
88
|
-
"
|
|
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.
|
|
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.
|
|
92
|
+
"eslint-plugin-jsdoc": "^39.3.3",
|
|
95
93
|
"eslint-plugin-tsdoc": "^0.2.16",
|
|
96
|
-
"eslint-plugin-vue": "^9.0
|
|
97
|
-
"eslint-plugin-vuejs-accessibility": "^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": "^
|
|
99
|
+
"lint-staged": "^13.0.3",
|
|
102
100
|
"postcss-html": "^1.4.1",
|
|
103
|
-
"prettier": "^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.
|
|
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.
|
|
117
|
-
"unplugin-vue-components": "^0.
|
|
118
|
-
"vite": "^2.9.
|
|
119
|
-
"vite-plugin-
|
|
120
|
-
"vite-plugin-
|
|
121
|
-
"
|
|
122
|
-
"vue": "
|
|
123
|
-
"vue-
|
|
124
|
-
"vue-
|
|
125
|
-
"vue-
|
|
126
|
-
"
|
|
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 ===
|
|
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
|
|
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,
|
|
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 ||
|
|
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
|
},
|