vuetify-swatches 0.0.11 → 0.3.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.
- package/README.md +4 -2
- package/dist/index.es.js +62 -98
- package/dist/index.umd.js +1 -2
- package/package.json +39 -37
- package/src/components/VSwatches.vue +6 -14
package/README.md
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|

|
|
10
10
|
|
|
11
|
+
This branch is for vuetify3. Not usable for production, experimental use only. Bidirectional binding (select swatch button by value) does not work due to a problem on the Vuetify3 side.
|
|
12
|
+
|
|
11
13
|
This project is a remake of [saintplay's vue-swatches](https://saintplay.github.io/vue-swatches/) with [Vuetify](https://vuetifyjs.com/).
|
|
12
14
|
|
|
13
15
|
Unlike the original version, it provides a UI based on Vuetify, such as ripple effects and dark mode.
|
|
@@ -38,7 +40,7 @@ export default Vue.extend({
|
|
|
38
40
|
</script>
|
|
39
41
|
|
|
40
42
|
<style>
|
|
41
|
-
@import 'vuetify-swatches/style.css';
|
|
43
|
+
@import 'vuetify-swatches/dist/style.css';
|
|
42
44
|
</style>
|
|
43
45
|
```
|
|
44
46
|
|
|
@@ -117,7 +119,7 @@ export default Vue.extend({
|
|
|
117
119
|
</script>
|
|
118
120
|
|
|
119
121
|
<style>
|
|
120
|
-
@import 'vuetify-swatches/style.css';
|
|
122
|
+
@import 'vuetify-swatches/dist/style.css';
|
|
121
123
|
</style>
|
|
122
124
|
```
|
|
123
125
|
|
package/dist/index.es.js
CHANGED
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
* @see {@link https://github.com/logue/vuetify-swatches}
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
|
|
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",
|
|
@@ -28,28 +28,28 @@ var _sfc_main = defineComponent({
|
|
|
28
28
|
swatches: {
|
|
29
29
|
type: Array,
|
|
30
30
|
default: () => [
|
|
31
|
-
[
|
|
31
|
+
[e.shades.black, e.shades.white],
|
|
32
32
|
[
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
-
[
|
|
52
|
+
[e.brown.base, e.blueGrey.base, e.grey.base]
|
|
53
53
|
]
|
|
54
54
|
},
|
|
55
55
|
elevation: { type: Number, default: 1 },
|
|
@@ -58,89 +58,53 @@ var _sfc_main = defineComponent({
|
|
|
58
58
|
iconSize: { type: String, default: "1rem" }
|
|
59
59
|
},
|
|
60
60
|
emits: ["update:modelValue"],
|
|
61
|
-
setup(
|
|
62
|
-
const checkedVisibilty = ref(false);
|
|
63
|
-
const onSwatchClick = (e) => {
|
|
64
|
-
const value = e.target.value;
|
|
65
|
-
if (!value || props.modelValue === value) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
context.emit("update:modelValue", value);
|
|
69
|
-
};
|
|
61
|
+
setup(s, t) {
|
|
70
62
|
return {
|
|
71
|
-
checkedVisibilty,
|
|
72
|
-
onSwatchClick
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
});
|
|
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) {
|
|
78
|
-
var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
|
|
79
|
-
if (render2) {
|
|
80
|
-
options.render = render2;
|
|
81
|
-
options.staticRenderFns = staticRenderFns;
|
|
82
|
-
options._compiled = true;
|
|
83
|
-
}
|
|
84
|
-
if (functionalTemplate) {
|
|
85
|
-
options.functional = true;
|
|
86
|
-
}
|
|
87
|
-
if (scopeId) {
|
|
88
|
-
options._scopeId = "data-v-" + scopeId;
|
|
89
|
-
}
|
|
90
|
-
var hook;
|
|
91
|
-
if (moduleIdentifier) {
|
|
92
|
-
hook = function(context) {
|
|
93
|
-
context = context || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
|
|
94
|
-
if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") {
|
|
95
|
-
context = __VUE_SSR_CONTEXT__;
|
|
96
|
-
}
|
|
97
|
-
if (injectStyles) {
|
|
98
|
-
injectStyles.call(this, context);
|
|
99
|
-
}
|
|
100
|
-
if (context && context._registeredComponents) {
|
|
101
|
-
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);
|
|
102
67
|
}
|
|
103
68
|
};
|
|
104
|
-
options._ssrRegister = hook;
|
|
105
|
-
} else if (injectStyles) {
|
|
106
|
-
hook = shadowMode ? function() {
|
|
107
|
-
injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot);
|
|
108
|
-
} : injectStyles;
|
|
109
69
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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);
|
|
117
85
|
};
|
|
118
86
|
} else {
|
|
119
|
-
var
|
|
120
|
-
|
|
87
|
+
var f = n.beforeCreate;
|
|
88
|
+
n.beforeCreate = f ? [].concat(f, r) : [r];
|
|
121
89
|
}
|
|
122
|
-
}
|
|
123
90
|
return {
|
|
124
|
-
exports:
|
|
125
|
-
options
|
|
91
|
+
exports: s,
|
|
92
|
+
options: n
|
|
126
93
|
};
|
|
127
94
|
}
|
|
128
|
-
var
|
|
129
|
-
var
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
} } }, [color === _vm.modelValue ? _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);
|
|
136
102
|
}), 1);
|
|
137
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
|
|
138
110
|
};
|
|
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;
|
|
142
|
-
const installVSwatches = (app) => app.component("VSwatches", VSwatches);
|
|
143
|
-
if (typeof window !== "undefined" && window.Vue) {
|
|
144
|
-
window.Vue.use(VSwatches);
|
|
145
|
-
}
|
|
146
|
-
export { VSwatches as default, installVSwatches as install };
|
package/dist/index.umd.js
CHANGED
|
@@ -9,5 +9,4 @@
|
|
|
9
9
|
* @see {@link https://github.com/logue/vuetify-swatches}
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
(function(
|
|
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"}})});
|
|
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/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "vuetify-swatches",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"description": "Color Swatch component for
|
|
4
|
+
"version": "0.3.1",
|
|
5
|
+
"description": "Color Swatch component for Vuetify3.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"vuejs",
|
|
8
8
|
"vue",
|
|
@@ -10,12 +10,14 @@
|
|
|
10
10
|
"color-picker",
|
|
11
11
|
"color-palette",
|
|
12
12
|
"swatches",
|
|
13
|
-
"
|
|
13
|
+
"vue3",
|
|
14
14
|
"vue-plugin",
|
|
15
15
|
"vue-resource",
|
|
16
16
|
"vuetify",
|
|
17
|
+
"vuetify3",
|
|
17
18
|
"vuetify-components"
|
|
18
19
|
],
|
|
20
|
+
"license": "MIT",
|
|
19
21
|
"author": {
|
|
20
22
|
"name": "Logue",
|
|
21
23
|
"email": "logue@hotmail.co.jp",
|
|
@@ -29,14 +31,10 @@
|
|
|
29
31
|
"bugs": {
|
|
30
32
|
"url": "https://github.com/logue/vuetify-swatches/issues"
|
|
31
33
|
},
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"packageManager": "yarn@3.2.1",
|
|
37
|
-
"license": "MIT",
|
|
38
|
-
"main": "./dist/index.umd.js",
|
|
39
|
-
"module": "./dist/index.es.js",
|
|
34
|
+
"main": "dist/index.umd.js",
|
|
35
|
+
"module": "dist/index.es.js",
|
|
36
|
+
"types": "dist/index.d.ts",
|
|
37
|
+
"style": "dist/style.css",
|
|
40
38
|
"browser": {
|
|
41
39
|
"./sfc": "./src/components/VSwatches.vue"
|
|
42
40
|
},
|
|
@@ -50,11 +48,15 @@
|
|
|
50
48
|
"require": "./dist/style.css"
|
|
51
49
|
}
|
|
52
50
|
},
|
|
53
|
-
"types": "./dist/index.d.ts",
|
|
54
51
|
"files": [
|
|
55
52
|
"dist",
|
|
56
53
|
"src/components/VSwatches.vue"
|
|
57
54
|
],
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=16.15.0",
|
|
57
|
+
"yarn": ">=1.22.4"
|
|
58
|
+
},
|
|
59
|
+
"packageManager": "yarn@3.2.1",
|
|
58
60
|
"sideEffects": false,
|
|
59
61
|
"scripts": {
|
|
60
62
|
"dev": "vite",
|
|
@@ -70,55 +72,55 @@
|
|
|
70
72
|
"prepare": "husky install"
|
|
71
73
|
},
|
|
72
74
|
"peerDependencies": {
|
|
73
|
-
"vue": "^2.
|
|
74
|
-
"vuetify": "^
|
|
75
|
+
"vue": "^3.2.37",
|
|
76
|
+
"vuetify": "^3.0.0-beta.6"
|
|
75
77
|
},
|
|
76
78
|
"devDependencies": {
|
|
77
|
-
"@codemirror/basic-setup": "^0.20.0",
|
|
78
79
|
"@codemirror/lang-html": "^6.1.0",
|
|
79
|
-
"@types/node": "^18.
|
|
80
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
81
|
-
"@typescript-eslint/parser": "^5.
|
|
82
|
-
"@vitejs/plugin-
|
|
83
|
-
"@vue/
|
|
80
|
+
"@types/node": "^18.6.3",
|
|
81
|
+
"@typescript-eslint/eslint-plugin": "^5.32.0",
|
|
82
|
+
"@typescript-eslint/parser": "^5.32.0",
|
|
83
|
+
"@vitejs/plugin-vue": "^3.0.1",
|
|
84
|
+
"@vue/tsconfig": "^0.1.3",
|
|
84
85
|
"codemirror": "^6.0.1",
|
|
85
|
-
"eslint": "^8.
|
|
86
|
+
"eslint": "^8.21.0",
|
|
86
87
|
"eslint-config-google": "^0.14.0",
|
|
87
88
|
"eslint-config-prettier": "^8.5.0",
|
|
88
89
|
"eslint-import-resolver-alias": "^1.1.2",
|
|
89
|
-
"eslint-import-resolver-typescript": "^3.
|
|
90
|
-
"eslint-plugin-html": "^6.2.0",
|
|
90
|
+
"eslint-import-resolver-typescript": "^3.4.0",
|
|
91
91
|
"eslint-plugin-import": "^2.26.0",
|
|
92
|
-
"eslint-plugin-jsdoc": "^39.3.
|
|
92
|
+
"eslint-plugin-jsdoc": "^39.3.4",
|
|
93
93
|
"eslint-plugin-tsdoc": "^0.2.16",
|
|
94
|
-
"eslint-plugin-vue": "^9.
|
|
94
|
+
"eslint-plugin-vue": "^9.3.0",
|
|
95
95
|
"eslint-plugin-vuejs-accessibility": "^1.2.0",
|
|
96
96
|
"eslint-plugin-vuetify": "^1.1.0",
|
|
97
97
|
"eslint-plugin-yaml": "^0.5.0",
|
|
98
98
|
"husky": "^8.0.1",
|
|
99
99
|
"lint-staged": "^13.0.3",
|
|
100
|
-
"postcss-html": "^1.
|
|
100
|
+
"postcss-html": "^1.5.0",
|
|
101
101
|
"prettier": "^2.7.1",
|
|
102
|
+
"prettier-plugin-jsdoc": "^0.3.38",
|
|
103
|
+
"prettier-plugin-md-nocjsp": "^1.3.0",
|
|
104
|
+
"prettier-plugin-sort-imports": "^1.7.0",
|
|
102
105
|
"rimraf": "^3.0.2",
|
|
103
|
-
"rollup-plugin-visualizer": "^5.
|
|
104
|
-
"sass": "1.
|
|
106
|
+
"rollup-plugin-visualizer": "^5.7.1",
|
|
107
|
+
"sass": "1.54.0",
|
|
105
108
|
"stylelint": "^14.9.1",
|
|
106
109
|
"stylelint-config-prettier": "^9.0.3",
|
|
107
|
-
"stylelint-config-recommended-scss": "^
|
|
110
|
+
"stylelint-config-recommended-scss": "^7.0.0",
|
|
108
111
|
"stylelint-config-recommended-vue": "^1.4.0",
|
|
109
112
|
"stylelint-order": "^5.0.0",
|
|
110
113
|
"stylelint-prettier": "^2.0.0",
|
|
111
114
|
"typescript": "^4.7.4",
|
|
112
|
-
"
|
|
113
|
-
"vite": "^2.9.13",
|
|
115
|
+
"vite": "^3.0.4",
|
|
114
116
|
"vite-plugin-banner": "^0.3.0",
|
|
115
|
-
"vite-plugin-checker": "^0.4.
|
|
116
|
-
"
|
|
117
|
-
"vue
|
|
117
|
+
"vite-plugin-checker": "^0.4.9",
|
|
118
|
+
"vite-plugin-vuetify": "^1.0.0-alpha.14",
|
|
119
|
+
"vue": "^3.2.37",
|
|
120
|
+
"vue-codemirror6": "0.6.8",
|
|
118
121
|
"vue-eslint-parser": "^9.0.3",
|
|
119
|
-
"vue-
|
|
120
|
-
"
|
|
121
|
-
"vuetify": "^2.6.7"
|
|
122
|
+
"vue-tsc": "^0.39.4",
|
|
123
|
+
"vuetify": "^3.0.0-beta.6"
|
|
122
124
|
},
|
|
123
125
|
"husky": {
|
|
124
126
|
"hooks": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-sheet class="v-swatches">
|
|
3
|
-
<div v-for="(colors, rows) in swatches" :key="rows">
|
|
3
|
+
<div v-for="(colors, rows) in swatches" :key="rows" class="d-flex">
|
|
4
4
|
<v-btn
|
|
5
5
|
v-for="color in colors"
|
|
6
6
|
:key="color"
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
:width="size"
|
|
9
9
|
:height="size"
|
|
10
10
|
:color="color"
|
|
11
|
-
:value="color"
|
|
11
|
+
:data-value="color"
|
|
12
12
|
min-width="auto"
|
|
13
13
|
@click="onSwatchClick($event)"
|
|
14
14
|
>
|
|
@@ -29,19 +29,13 @@ import {
|
|
|
29
29
|
type SetupContext,
|
|
30
30
|
} from 'vue';
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
import colors from 'vuetify/lib/util/colors';
|
|
32
|
+
// eslint-disable-next-line import/no-unresolved
|
|
33
|
+
import colors from 'vuetify/lib/util/colors.mjs';
|
|
34
34
|
|
|
35
35
|
/** Vuetify Swatches */
|
|
36
36
|
export default defineComponent({
|
|
37
37
|
/** Component name */
|
|
38
38
|
name: 'VSwatches',
|
|
39
|
-
/** Components */
|
|
40
|
-
components: {
|
|
41
|
-
VSheet,
|
|
42
|
-
VBtn,
|
|
43
|
-
VIcon,
|
|
44
|
-
},
|
|
45
39
|
/** Model Definition */
|
|
46
40
|
model: {
|
|
47
41
|
prop: 'modelValue',
|
|
@@ -97,20 +91,18 @@ export default defineComponent({
|
|
|
97
91
|
setup(props, context: SetupContext) {
|
|
98
92
|
/** Check icon visibility */
|
|
99
93
|
const checkedVisibilty: Ref<boolean> = ref(false);
|
|
100
|
-
|
|
101
94
|
/**
|
|
102
95
|
* ボタンがクリックされた
|
|
103
96
|
*
|
|
104
97
|
* @param e - イベント
|
|
105
98
|
*/
|
|
106
99
|
const onSwatchClick = (e: Event) => {
|
|
107
|
-
const value = (e.target as HTMLButtonElement).value;
|
|
100
|
+
const value = (e.target as HTMLButtonElement).dataset.value;
|
|
108
101
|
if (!value || props.modelValue === value) {
|
|
109
102
|
return;
|
|
110
103
|
}
|
|
111
104
|
context.emit('update:modelValue', value);
|
|
112
105
|
};
|
|
113
|
-
|
|
114
106
|
return {
|
|
115
107
|
checkedVisibilty,
|
|
116
108
|
onSwatchClick,
|
|
@@ -126,7 +118,7 @@ export default defineComponent({
|
|
|
126
118
|
margin: 0.1rem;
|
|
127
119
|
|
|
128
120
|
.v-icon {
|
|
129
|
-
filter: invert(100%);
|
|
121
|
+
filter: invert(100%) grayscale(100%) contrast(100);
|
|
130
122
|
}
|
|
131
123
|
}
|
|
132
124
|
}
|