vuetify-swatches 0.0.6 → 0.0.9
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 +3 -2
- package/dist/components/VSwatches.vue.d.ts +40 -0
- package/dist/components/VSwatches.vue.d.ts.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/{v-swatches.es.js → index.es.js} +32 -62
- package/dist/index.umd.js +13 -0
- package/dist/style.css +11 -0
- package/package.json +41 -52
- package/src/components/VSwatches.vue +12 -8
- package/dist/stats.html +0 -2689
- package/dist/v-swatches.umd.js +0 -8
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
|
|
|
@@ -125,6 +125,7 @@ export default Vue.extend({
|
|
|
125
125
|
|
|
126
126
|
| Variables | Type | Default | Info |
|
|
127
127
|
| --------- | ------ | -------------------------- | ------------------ |
|
|
128
|
+
| elevation | number | 1 | shadow size |
|
|
128
129
|
| size | string | 2rem | Swatch Button size |
|
|
129
130
|
| icon | string | mdi-checkbox-marked-circle | checked icon |
|
|
130
131
|
| icon-size | string | 1rem | checked icon size |
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type PropType, type Ref } from 'vue';
|
|
2
|
+
/** Vuetify Swatches */
|
|
3
|
+
declare const _default: import("vue/types/v3-component-proxy").VueProxy<{
|
|
4
|
+
/** Model value */
|
|
5
|
+
modelValue: {
|
|
6
|
+
type: StringConstructor;
|
|
7
|
+
required: true;
|
|
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
|
+
selected: Ref<string>;
|
|
37
|
+
onSwatchClick: (e: Event) => void;
|
|
38
|
+
}, import("vue").Data, {}, {}, {}, {}, {}>;
|
|
39
|
+
export default _default;
|
|
40
|
+
//# sourceMappingURL=VSwatches.vue.d.ts.map
|
|
@@ -0,0 +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;;AAzEnC,wBAwFG"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +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,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.9
|
|
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,
|
|
@@ -41,6 +52,7 @@ var __vue2_script = defineComponent({
|
|
|
41
52
|
[colors.brown.base, colors.blueGrey.base, colors.grey.base]
|
|
42
53
|
]
|
|
43
54
|
},
|
|
55
|
+
elevation: { type: Number, default: 1 },
|
|
44
56
|
size: { type: String, default: "2rem" },
|
|
45
57
|
icon: { type: String, default: "mdi-checkbox-marked-circle" },
|
|
46
58
|
iconSize: { type: String, default: "1rem" }
|
|
@@ -48,7 +60,6 @@ var __vue2_script = defineComponent({
|
|
|
48
60
|
emits: ["update:modelValue"],
|
|
49
61
|
setup(props, context) {
|
|
50
62
|
const checkedVisibilty = ref(false);
|
|
51
|
-
const palette = ref(props.swatches);
|
|
52
63
|
const selected = ref(props.modelValue);
|
|
53
64
|
const onSwatchClick = (e) => {
|
|
54
65
|
const value = e.target.value;
|
|
@@ -60,52 +71,17 @@ var __vue2_script = defineComponent({
|
|
|
60
71
|
};
|
|
61
72
|
return {
|
|
62
73
|
checkedVisibilty,
|
|
63
|
-
palette,
|
|
64
74
|
selected,
|
|
65
75
|
onSwatchClick
|
|
66
76
|
};
|
|
67
77
|
}
|
|
68
78
|
});
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
var _h = _vm.$createElement;
|
|
72
|
-
var _c = _vm._self._c || _h;
|
|
73
|
-
return _c(VSheet, {
|
|
74
|
-
staticClass: "v-swatches"
|
|
75
|
-
}, _vm._l(_vm.palette, function(colors2, rows) {
|
|
76
|
-
return _c("div", {
|
|
77
|
-
key: rows
|
|
78
|
-
}, _vm._l(colors2, function(color) {
|
|
79
|
-
return _c(VBtn, {
|
|
80
|
-
key: color,
|
|
81
|
-
attrs: {
|
|
82
|
-
"elevation": "1",
|
|
83
|
-
"width": _vm.size,
|
|
84
|
-
"height": _vm.size,
|
|
85
|
-
"color": color,
|
|
86
|
-
"value": color,
|
|
87
|
-
"min-width": "auto"
|
|
88
|
-
},
|
|
89
|
-
on: {
|
|
90
|
-
"click": _vm.onSwatchClick
|
|
91
|
-
}
|
|
92
|
-
}, [color === _vm.selected ? _c(VIcon, {
|
|
93
|
-
attrs: {
|
|
94
|
-
"size": _vm.iconSize,
|
|
95
|
-
"color": color
|
|
96
|
-
}
|
|
97
|
-
}, [_vm._v(" " + _vm._s(_vm.icon) + " ")]) : _vm._e()], 1);
|
|
98
|
-
}), 1);
|
|
99
|
-
}), 0);
|
|
100
|
-
};
|
|
101
|
-
var staticRenderFns = [];
|
|
102
|
-
render._withStripped = true;
|
|
103
|
-
var VSwatches_vue_vue_type_style_index_0_lang = "";
|
|
104
|
-
function normalizeComponent(scriptExports, render2, staticRenderFns2, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
|
|
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) {
|
|
105
81
|
var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
|
|
106
82
|
if (render2) {
|
|
107
83
|
options.render = render2;
|
|
108
|
-
options.staticRenderFns =
|
|
84
|
+
options.staticRenderFns = staticRenderFns;
|
|
109
85
|
options._compiled = true;
|
|
110
86
|
}
|
|
111
87
|
if (functionalTemplate) {
|
|
@@ -152,26 +128,20 @@ function normalizeComponent(scriptExports, render2, staticRenderFns2, functional
|
|
|
152
128
|
options
|
|
153
129
|
};
|
|
154
130
|
}
|
|
155
|
-
|
|
156
|
-
var
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
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);
|
|
137
|
+
}), 1);
|
|
138
|
+
}), 0);
|
|
139
|
+
};
|
|
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);
|
|
161
146
|
}
|
|
162
|
-
__component__.options.__file = "src/components/VSwatches.vue";
|
|
163
|
-
var VSwatches = /* @__PURE__ */ function() {
|
|
164
|
-
return __component__.exports;
|
|
165
|
-
}();
|
|
166
|
-
/**
|
|
167
|
-
* Vuetify Swatches Component
|
|
168
|
-
*
|
|
169
|
-
* @license MIT
|
|
170
|
-
* @author Logue {@link logue@hotmail.co.jp}
|
|
171
|
-
* @copyright 2022 Masashi Yoshikawa {@link https://logue.dev/} All rights reserved.
|
|
172
|
-
* @see {@link https://github.com/logue/vuetify-swatches}
|
|
173
|
-
*/
|
|
174
|
-
const installVSwatches = isVue2 ? (app) => {
|
|
175
|
-
app.component("VSwatches", VSwatches);
|
|
176
|
-
} : install();
|
|
177
147
|
export { VSwatches as default, installVSwatches as install };
|
|
@@ -0,0 +1,13 @@
|
|
|
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.9
|
|
9
|
+
* @see {@link https://github.com/logue/vuetify-swatches}
|
|
10
|
+
*/
|
|
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"}})});
|
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.9
|
|
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,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "vuetify-swatches",
|
|
4
|
-
"
|
|
5
|
-
"version": "0.0.6",
|
|
4
|
+
"version": "0.0.9",
|
|
6
5
|
"description": "Color Swatch component for Vuetify.",
|
|
7
6
|
"keywords": [
|
|
8
7
|
"vuejs",
|
|
@@ -31,20 +30,22 @@
|
|
|
31
30
|
"url": "https://github.com/logue/vuetify-swatches/issues"
|
|
32
31
|
},
|
|
33
32
|
"engines": {
|
|
34
|
-
"node": ">=16"
|
|
33
|
+
"node": ">=16.15.0",
|
|
34
|
+
"yarn": ">=1.22.4"
|
|
35
35
|
},
|
|
36
|
+
"packageManager": "yarn@3.2.1",
|
|
36
37
|
"license": "MIT",
|
|
37
|
-
"main": "./dist/
|
|
38
|
-
"module": "./dist/
|
|
38
|
+
"main": "./dist/index.umd.js",
|
|
39
|
+
"module": "./dist/index.es.js",
|
|
39
40
|
"browser": {
|
|
40
41
|
"./sfc": "./src/components/VSwatches.vue"
|
|
41
42
|
},
|
|
42
43
|
"exports": {
|
|
43
44
|
".": {
|
|
44
|
-
"import": "./dist/
|
|
45
|
-
"require": "./dist/
|
|
45
|
+
"import": "./dist/index.es.js",
|
|
46
|
+
"require": "./dist/index.umd.js"
|
|
46
47
|
},
|
|
47
|
-
"./
|
|
48
|
+
"./style.css": {
|
|
48
49
|
"import": "./dist/style.css",
|
|
49
50
|
"require": "./dist/style.css"
|
|
50
51
|
}
|
|
@@ -57,7 +58,7 @@
|
|
|
57
58
|
"sideEffects": false,
|
|
58
59
|
"scripts": {
|
|
59
60
|
"dev": "vite",
|
|
60
|
-
"clean": "rimraf node_modules/.vite",
|
|
61
|
+
"clean": "rimraf node_modules/.vite ",
|
|
61
62
|
"build": "vite build & vue-tsc --declaration --emitDeclarationOnly",
|
|
62
63
|
"build:analyze": "vue-tsc --noEmit && vite build --mode analyze",
|
|
63
64
|
"build:docs": "vite build --config vite.config.docs.ts",
|
|
@@ -66,73 +67,61 @@
|
|
|
66
67
|
"lint:style": "stylelint . --cache --cache-location ./node_modules/.vite/vite-plugin-stylelint",
|
|
67
68
|
"lint:markup": "vue-tsc --noEmit",
|
|
68
69
|
"preview": "vite preview --config vite.config.docs.ts",
|
|
69
|
-
"prepare": "husky install"
|
|
70
|
-
"postinstall": "npx vue-demi-fix"
|
|
71
|
-
},
|
|
72
|
-
"dependencies": {
|
|
73
|
-
"vue-demi": "latest"
|
|
70
|
+
"prepare": "husky install"
|
|
74
71
|
},
|
|
75
72
|
"peerDependencies": {
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"vuetify": "^2.6.6"
|
|
79
|
-
},
|
|
80
|
-
"peerDependenciesMeta": {
|
|
81
|
-
"@vue/composition-api": {
|
|
82
|
-
"optional": true
|
|
83
|
-
}
|
|
73
|
+
"vue": "^2.7.0",
|
|
74
|
+
"vuetify": "^2.6.7"
|
|
84
75
|
},
|
|
85
76
|
"devDependencies": {
|
|
86
77
|
"@codemirror/basic-setup": "^0.20.0",
|
|
87
|
-
"@codemirror/lang-html": "^
|
|
88
|
-
"@
|
|
89
|
-
"@
|
|
90
|
-
"@
|
|
91
|
-
"@typescript-eslint/
|
|
92
|
-
"@
|
|
93
|
-
"@
|
|
94
|
-
"
|
|
78
|
+
"@codemirror/lang-html": "^6.1.0",
|
|
79
|
+
"@codemirror/state": "^6.1.0",
|
|
80
|
+
"@codemirror/view": "^6.0.2",
|
|
81
|
+
"@types/node": "^18.0.1",
|
|
82
|
+
"@typescript-eslint/eslint-plugin": "^5.30.4",
|
|
83
|
+
"@typescript-eslint/parser": "^5.30.4",
|
|
84
|
+
"@vitejs/plugin-vue2": "^1.1.2",
|
|
85
|
+
"codemirror": "^6.0.1",
|
|
86
|
+
"eslint": "^8.19.0",
|
|
95
87
|
"eslint-config-google": "^0.14.0",
|
|
96
88
|
"eslint-config-prettier": "^8.5.0",
|
|
97
|
-
"eslint-config-vuetify": "^0.6.1",
|
|
98
89
|
"eslint-import-resolver-alias": "^1.1.2",
|
|
99
|
-
"eslint-import-resolver-typescript": "^2.
|
|
90
|
+
"eslint-import-resolver-typescript": "^3.2.1",
|
|
100
91
|
"eslint-plugin-import": "^2.26.0",
|
|
101
|
-
"eslint-plugin-
|
|
102
|
-
"eslint-plugin-prettier-vue": "^3.1.0",
|
|
92
|
+
"eslint-plugin-jsdoc": "^39.3.3",
|
|
103
93
|
"eslint-plugin-tsdoc": "^0.2.16",
|
|
104
|
-
"eslint-plugin-vue": "^9.
|
|
105
|
-
"eslint-plugin-vuejs-accessibility": "^1.
|
|
94
|
+
"eslint-plugin-vue": "^9.1.1",
|
|
95
|
+
"eslint-plugin-vuejs-accessibility": "^1.2.0",
|
|
106
96
|
"eslint-plugin-vuetify": "^1.1.0",
|
|
107
97
|
"eslint-plugin-yaml": "^0.5.0",
|
|
108
98
|
"husky": "^8.0.1",
|
|
109
|
-
"lint-staged": "^
|
|
99
|
+
"lint-staged": "^13.0.3",
|
|
110
100
|
"postcss-html": "^1.4.1",
|
|
111
|
-
"prettier": "^2.
|
|
101
|
+
"prettier": "^2.7.1",
|
|
112
102
|
"prettier-plugin-jsdoc": "^0.3.38",
|
|
113
103
|
"prettier-plugin-md-nocjsp": "^1.2.0",
|
|
114
|
-
"prettier-plugin-sort-imports": "^1.
|
|
104
|
+
"prettier-plugin-sort-imports": "^1.7.0",
|
|
115
105
|
"rimraf": "^3.0.2",
|
|
116
106
|
"rollup-plugin-visualizer": "^5.6.0",
|
|
117
107
|
"sass": "1.32.12",
|
|
118
|
-
"stylelint": "^14.
|
|
108
|
+
"stylelint": "^14.9.1",
|
|
119
109
|
"stylelint-config-prettier": "^9.0.3",
|
|
120
110
|
"stylelint-config-recommended-scss": "^6.0.0",
|
|
121
111
|
"stylelint-config-recommended-vue": "^1.4.0",
|
|
122
112
|
"stylelint-order": "^5.0.0",
|
|
123
113
|
"stylelint-prettier": "^2.0.0",
|
|
124
|
-
"typescript": "^4.
|
|
125
|
-
"unplugin-vue-components": "^0.
|
|
126
|
-
"vite": "^2.9.
|
|
127
|
-
"vite-plugin-
|
|
128
|
-
"vite-plugin-
|
|
129
|
-
"
|
|
130
|
-
"vue": "
|
|
131
|
-
"vue-
|
|
132
|
-
"vue-
|
|
133
|
-
"vue-
|
|
134
|
-
"
|
|
135
|
-
"vuetify": "^2.6.6"
|
|
114
|
+
"typescript": "^4.7.4",
|
|
115
|
+
"unplugin-vue-components": "^0.21.0",
|
|
116
|
+
"vite": "^2.9.13",
|
|
117
|
+
"vite-plugin-banner": "^0.3.0",
|
|
118
|
+
"vite-plugin-checker": "^0.4.7",
|
|
119
|
+
"vue": "^2.7.0",
|
|
120
|
+
"vue-codemirror6": "0.6.5",
|
|
121
|
+
"vue-eslint-parser": "^9.0.3",
|
|
122
|
+
"vue-template-compiler": "^2.7.1",
|
|
123
|
+
"vue-tsc": "^0.38.2",
|
|
124
|
+
"vuetify": "^2.6.7"
|
|
136
125
|
},
|
|
137
126
|
"husky": {
|
|
138
127
|
"hooks": {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-sheet class="v-swatches">
|
|
3
|
-
<div v-for="(colors, rows) in
|
|
3
|
+
<div v-for="(colors, rows) in swatches" :key="rows">
|
|
4
4
|
<v-btn
|
|
5
5
|
v-for="color in colors"
|
|
6
6
|
:key="color"
|
|
7
|
-
elevation="
|
|
7
|
+
:elevation="elevation"
|
|
8
8
|
:width="size"
|
|
9
9
|
:height="size"
|
|
10
10
|
:color="color"
|
|
@@ -21,7 +21,13 @@
|
|
|
21
21
|
</template>
|
|
22
22
|
|
|
23
23
|
<script lang="ts">
|
|
24
|
-
import {
|
|
24
|
+
import {
|
|
25
|
+
defineComponent,
|
|
26
|
+
ref,
|
|
27
|
+
type PropType,
|
|
28
|
+
type Ref,
|
|
29
|
+
type SetupContext,
|
|
30
|
+
} from 'vue';
|
|
25
31
|
|
|
26
32
|
import { VSheet, VIcon, VBtn } from 'vuetify/lib';
|
|
27
33
|
import colors from 'vuetify/lib/util/colors';
|
|
@@ -46,7 +52,7 @@ export default defineComponent({
|
|
|
46
52
|
modelValue: { type: String, required: true },
|
|
47
53
|
/** Swatch colors */
|
|
48
54
|
swatches: {
|
|
49
|
-
type: Array as
|
|
55
|
+
type: Array as PropType<string[] | string[][]>,
|
|
50
56
|
default: () => [
|
|
51
57
|
[colors.shades.black, colors.shades.white],
|
|
52
58
|
[
|
|
@@ -72,6 +78,8 @@ export default defineComponent({
|
|
|
72
78
|
[colors.brown.base, colors.blueGrey.base, colors.grey.base],
|
|
73
79
|
],
|
|
74
80
|
},
|
|
81
|
+
/** The size of the shadow of the button */
|
|
82
|
+
elevation: { type: Number, default: 1 },
|
|
75
83
|
/** Swatch sized */
|
|
76
84
|
size: { type: String, default: '2rem' },
|
|
77
85
|
/** selected icon */
|
|
@@ -90,9 +98,6 @@ export default defineComponent({
|
|
|
90
98
|
/** チェックアイコンの表示制御 */
|
|
91
99
|
const checkedVisibilty: Ref<boolean> = ref(false);
|
|
92
100
|
|
|
93
|
-
/** Palette */
|
|
94
|
-
const palette: Ref<string[] | string[][]> = ref(props.swatches);
|
|
95
|
-
|
|
96
101
|
/** Selected color */
|
|
97
102
|
const selected: Ref<string> = ref(props.modelValue);
|
|
98
103
|
|
|
@@ -112,7 +117,6 @@ export default defineComponent({
|
|
|
112
117
|
|
|
113
118
|
return {
|
|
114
119
|
checkedVisibilty,
|
|
115
|
-
palette,
|
|
116
120
|
selected,
|
|
117
121
|
onSwatchClick,
|
|
118
122
|
};
|