vuetify-swatches 1.3.0 → 1.3.2
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 -1
- package/dist/components/VSwatches.vue.d.ts.map +1 -1
- package/dist/index.es.js +90 -71
- package/dist/index.iife.js +139 -2
- package/dist/index.umd.js +140 -2
- package/dist/style.css +14 -2
- package/package.json +26 -25
package/README.md
CHANGED
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
[](https://uiwjs.github.io/npm-unpkg/#/pkg/vuetify-swatches/file/README.md)
|
|
6
6
|
[](https://www.npmjs.com/package/vuetify-swatches)
|
|
7
7
|
[](https://gitpod.io/#https://github.com/logue/vuetify-swatches)
|
|
8
|
+
[](https://twitter.com/logue256)
|
|
8
9
|
|
|
9
10
|

|
|
10
11
|
|
|
11
|
-
This branch is for vuetify3. Not usable for production, experimental use only.
|
|
12
|
+
This branch is for vuetify3. Not usable for production, experimental use only.
|
|
12
13
|
|
|
13
14
|
This project is a remake of [saintplay's vue-swatches](https://saintplay.github.io/vue-swatches/) with [Vuetify](https://vuetifyjs.com/).
|
|
14
15
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VSwatches.vue.d.ts","sourceRoot":"","sources":["../../src/components/VSwatches.vue.
|
|
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;;IAUnB,kBAAkB;;;;;IAElB,oBAAoB;;;;;IA4BpB,kBAAkB;;;;;IAElB,oBAAoB;;;;;IAEpB,yBAAyB;;;;;IAEzB;;;;OAIG;;;;;IAOH;;;;OAIG;;;;;IAEH;;;;OAIG;;;;;;;;uBAoBuB,KAAK;;;IA7E/B,kBAAkB;;;;;IAElB,oBAAoB;;;;;IA4BpB,kBAAkB;;;;;IAElB,oBAAoB;;;;;IAEpB,yBAAyB;;;;;IAEzB;;;;OAIG;;;;;IAOH;;;;OAIG;;;;;IAEH;;;;OAIG;;;;;;;;;;;;;;;;AAlEP,wBAoGG"}
|
package/dist/index.es.js
CHANGED
|
@@ -5,45 +5,46 @@
|
|
|
5
5
|
* @author Logue <logue@hotmail.co.jp>
|
|
6
6
|
* @copyright 2022 By Masashi Yoshikawa All rights reserved.
|
|
7
7
|
* @license MIT
|
|
8
|
-
* @version 1.3.
|
|
8
|
+
* @version 1.3.2
|
|
9
9
|
* @see {@link https://github.com/logue/vuetify-swatches}
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import { defineComponent
|
|
13
|
-
import
|
|
14
|
-
|
|
12
|
+
import { defineComponent, ref, resolveComponent, openBlock, createBlock, withCtx, createElementBlock, Fragment, renderList, normalizeClass, createTextVNode, toDisplayString, createCommentVNode } from 'vue';
|
|
13
|
+
import colors from 'vuetify/lib/util/colors.mjs';
|
|
14
|
+
|
|
15
|
+
const _sfc_main = defineComponent({
|
|
15
16
|
name: "VSwatches",
|
|
16
17
|
model: {
|
|
17
18
|
prop: "modelValue",
|
|
18
19
|
event: "update:modelValue"
|
|
19
20
|
},
|
|
20
21
|
props: {
|
|
21
|
-
modelValue: { type: String, default:
|
|
22
|
+
modelValue: { type: String, default: colors.shades.white },
|
|
22
23
|
swatches: {
|
|
23
24
|
type: Array,
|
|
24
25
|
default: () => [
|
|
25
|
-
[
|
|
26
|
+
[colors.shades.black, colors.shades.white, colors.shades.transparent],
|
|
26
27
|
[
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
colors.red.base,
|
|
29
|
+
colors.pink.base,
|
|
30
|
+
colors.purple.base,
|
|
31
|
+
colors.deepPurple.base,
|
|
32
|
+
colors.indigo.base,
|
|
33
|
+
colors.blue.base,
|
|
34
|
+
colors.lightBlue.base,
|
|
35
|
+
colors.cyan.base
|
|
35
36
|
],
|
|
36
37
|
[
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
colors.teal.base,
|
|
39
|
+
colors.green.base,
|
|
40
|
+
colors.lightGreen.base,
|
|
41
|
+
colors.lime.base,
|
|
42
|
+
colors.yellow.base,
|
|
43
|
+
colors.amber.base,
|
|
44
|
+
colors.orange.base,
|
|
45
|
+
colors.deepOrange.base
|
|
45
46
|
],
|
|
46
|
-
[
|
|
47
|
+
[colors.brown.base, colors.blueGrey.base, colors.grey.base]
|
|
47
48
|
]
|
|
48
49
|
},
|
|
49
50
|
size: { type: String, default: "2rem" },
|
|
@@ -57,63 +58,81 @@ const $ = k({
|
|
|
57
58
|
rounded: { type: String, Number, default: void 0 }
|
|
58
59
|
},
|
|
59
60
|
emits: ["update:modelValue"],
|
|
60
|
-
setup(
|
|
61
|
+
setup(props, context) {
|
|
62
|
+
const checkedVisibilty = ref(false);
|
|
63
|
+
const onSwatchClick = (e) => {
|
|
64
|
+
const value = e.target.dataset.value;
|
|
65
|
+
if (!value || props.modelValue === value) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
context.emit("update:modelValue", value);
|
|
69
|
+
};
|
|
61
70
|
return {
|
|
62
|
-
checkedVisibilty
|
|
63
|
-
onSwatchClick
|
|
64
|
-
|
|
65
|
-
!l || t.modelValue === l || s.emit("update:modelValue", l);
|
|
66
|
-
},
|
|
67
|
-
shades: e.shades
|
|
71
|
+
checkedVisibilty,
|
|
72
|
+
onSwatchClick,
|
|
73
|
+
shades: colors.shades
|
|
68
74
|
};
|
|
69
75
|
}
|
|
70
76
|
});
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
|
|
78
|
+
const VSwatches_vue_vue_type_style_index_0_lang = '';
|
|
79
|
+
|
|
80
|
+
const _export_sfc = (sfc, props) => {
|
|
81
|
+
const target = sfc.__vccOpts || sfc;
|
|
82
|
+
for (const [key, val] of props) {
|
|
83
|
+
target[key] = val;
|
|
84
|
+
}
|
|
85
|
+
return target;
|
|
76
86
|
};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
color: a !== t.shades.transparent ? a : void 0
|
|
87
|
+
|
|
88
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
89
|
+
const _component_v_icon = resolveComponent("v-icon");
|
|
90
|
+
const _component_v_btn = resolveComponent("v-btn");
|
|
91
|
+
const _component_v_sheet = resolveComponent("v-sheet");
|
|
92
|
+
return openBlock(), createBlock(_component_v_sheet, { class: "v-swatches" }, {
|
|
93
|
+
default: withCtx(() => [
|
|
94
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.swatches, (colors, rows) => {
|
|
95
|
+
return openBlock(), createElementBlock("div", { key: rows }, [
|
|
96
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(colors, (color) => {
|
|
97
|
+
return openBlock(), createBlock(_component_v_btn, {
|
|
98
|
+
key: color,
|
|
99
|
+
color,
|
|
100
|
+
disabled: _ctx.disabled,
|
|
101
|
+
height: _ctx.size,
|
|
102
|
+
value: color,
|
|
103
|
+
variant: _ctx.variant,
|
|
104
|
+
width: _ctx.size,
|
|
105
|
+
"data-value": color,
|
|
106
|
+
class: normalizeClass(color === _ctx.shades.transparent ? "bg-trasparent" : ""),
|
|
107
|
+
"min-width": "auto",
|
|
108
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.onSwatchClick($event))
|
|
100
109
|
}, {
|
|
101
|
-
default:
|
|
102
|
-
|
|
110
|
+
default: withCtx(() => [
|
|
111
|
+
color === _ctx.modelValue ? (openBlock(), createBlock(_component_v_icon, {
|
|
112
|
+
key: 0,
|
|
113
|
+
size: _ctx.iconSize,
|
|
114
|
+
color: color !== _ctx.shades.transparent ? color : void 0
|
|
115
|
+
}, {
|
|
116
|
+
default: withCtx(() => [
|
|
117
|
+
createTextVNode(toDisplayString(_ctx.icon), 1)
|
|
118
|
+
]),
|
|
119
|
+
_: 2
|
|
120
|
+
}, 1032, ["size", "color"])) : createCommentVNode("", true)
|
|
103
121
|
]),
|
|
104
122
|
_: 2
|
|
105
|
-
}, 1032, ["
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
]))), 128))
|
|
123
|
+
}, 1032, ["color", "disabled", "height", "value", "variant", "width", "data-value", "class"]);
|
|
124
|
+
}), 128))
|
|
125
|
+
]);
|
|
126
|
+
}), 128))
|
|
110
127
|
]),
|
|
111
128
|
_: 1
|
|
112
129
|
});
|
|
113
130
|
}
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
131
|
+
const VSwatches = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
132
|
+
|
|
133
|
+
const installVSwatches = (app) => app.component("VSwatches", VSwatches);
|
|
134
|
+
if (typeof window !== "undefined" && window.Vue) {
|
|
135
|
+
window.Vue.use(VSwatches);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export { VSwatches as default, installVSwatches as install };
|
package/dist/index.iife.js
CHANGED
|
@@ -5,8 +5,145 @@
|
|
|
5
5
|
* @author Logue <logue@hotmail.co.jp>
|
|
6
6
|
* @copyright 2022 By Masashi Yoshikawa All rights reserved.
|
|
7
7
|
* @license MIT
|
|
8
|
-
* @version 1.3.
|
|
8
|
+
* @version 1.3.2
|
|
9
9
|
* @see {@link https://github.com/logue/vuetify-swatches}
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
var VSwatches
|
|
12
|
+
var VSwatches = (function (exports, vue, colors) {
|
|
13
|
+
'use strict';
|
|
14
|
+
|
|
15
|
+
const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
|
|
16
|
+
|
|
17
|
+
const colors__default = /*#__PURE__*/_interopDefaultLegacy(colors);
|
|
18
|
+
|
|
19
|
+
const _sfc_main = vue.defineComponent({
|
|
20
|
+
name: "VSwatches",
|
|
21
|
+
model: {
|
|
22
|
+
prop: "modelValue",
|
|
23
|
+
event: "update:modelValue"
|
|
24
|
+
},
|
|
25
|
+
props: {
|
|
26
|
+
modelValue: { type: String, default: colors__default.default.shades.white },
|
|
27
|
+
swatches: {
|
|
28
|
+
type: Array,
|
|
29
|
+
default: () => [
|
|
30
|
+
[colors__default.default.shades.black, colors__default.default.shades.white, colors__default.default.shades.transparent],
|
|
31
|
+
[
|
|
32
|
+
colors__default.default.red.base,
|
|
33
|
+
colors__default.default.pink.base,
|
|
34
|
+
colors__default.default.purple.base,
|
|
35
|
+
colors__default.default.deepPurple.base,
|
|
36
|
+
colors__default.default.indigo.base,
|
|
37
|
+
colors__default.default.blue.base,
|
|
38
|
+
colors__default.default.lightBlue.base,
|
|
39
|
+
colors__default.default.cyan.base
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
colors__default.default.teal.base,
|
|
43
|
+
colors__default.default.green.base,
|
|
44
|
+
colors__default.default.lightGreen.base,
|
|
45
|
+
colors__default.default.lime.base,
|
|
46
|
+
colors__default.default.yellow.base,
|
|
47
|
+
colors__default.default.amber.base,
|
|
48
|
+
colors__default.default.orange.base,
|
|
49
|
+
colors__default.default.deepOrange.base
|
|
50
|
+
],
|
|
51
|
+
[colors__default.default.brown.base, colors__default.default.blueGrey.base, colors__default.default.grey.base]
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
size: { type: String, default: "2rem" },
|
|
55
|
+
icon: { type: String, default: "mdi-checkbox-marked-circle" },
|
|
56
|
+
iconSize: { type: String, default: "1rem" },
|
|
57
|
+
variant: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: void 0
|
|
60
|
+
},
|
|
61
|
+
disabled: { type: Boolean, default: void 0 },
|
|
62
|
+
rounded: { type: String, Number, default: void 0 }
|
|
63
|
+
},
|
|
64
|
+
emits: ["update:modelValue"],
|
|
65
|
+
setup(props, context) {
|
|
66
|
+
const checkedVisibilty = vue.ref(false);
|
|
67
|
+
const onSwatchClick = (e) => {
|
|
68
|
+
const value = e.target.dataset.value;
|
|
69
|
+
if (!value || props.modelValue === value) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
context.emit("update:modelValue", value);
|
|
73
|
+
};
|
|
74
|
+
return {
|
|
75
|
+
checkedVisibilty,
|
|
76
|
+
onSwatchClick,
|
|
77
|
+
shades: colors__default.default.shades
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
const VSwatches_vue_vue_type_style_index_0_lang = '';
|
|
83
|
+
|
|
84
|
+
const _export_sfc = (sfc, props) => {
|
|
85
|
+
const target = sfc.__vccOpts || sfc;
|
|
86
|
+
for (const [key, val] of props) {
|
|
87
|
+
target[key] = val;
|
|
88
|
+
}
|
|
89
|
+
return target;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
93
|
+
const _component_v_icon = vue.resolveComponent("v-icon");
|
|
94
|
+
const _component_v_btn = vue.resolveComponent("v-btn");
|
|
95
|
+
const _component_v_sheet = vue.resolveComponent("v-sheet");
|
|
96
|
+
return vue.openBlock(), vue.createBlock(_component_v_sheet, { class: "v-swatches" }, {
|
|
97
|
+
default: vue.withCtx(() => [
|
|
98
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.swatches, (colors, rows) => {
|
|
99
|
+
return vue.openBlock(), vue.createElementBlock("div", { key: rows }, [
|
|
100
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(colors, (color) => {
|
|
101
|
+
return vue.openBlock(), vue.createBlock(_component_v_btn, {
|
|
102
|
+
key: color,
|
|
103
|
+
color,
|
|
104
|
+
disabled: _ctx.disabled,
|
|
105
|
+
height: _ctx.size,
|
|
106
|
+
value: color,
|
|
107
|
+
variant: _ctx.variant,
|
|
108
|
+
width: _ctx.size,
|
|
109
|
+
"data-value": color,
|
|
110
|
+
class: vue.normalizeClass(color === _ctx.shades.transparent ? "bg-trasparent" : ""),
|
|
111
|
+
"min-width": "auto",
|
|
112
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.onSwatchClick($event))
|
|
113
|
+
}, {
|
|
114
|
+
default: vue.withCtx(() => [
|
|
115
|
+
color === _ctx.modelValue ? (vue.openBlock(), vue.createBlock(_component_v_icon, {
|
|
116
|
+
key: 0,
|
|
117
|
+
size: _ctx.iconSize,
|
|
118
|
+
color: color !== _ctx.shades.transparent ? color : void 0
|
|
119
|
+
}, {
|
|
120
|
+
default: vue.withCtx(() => [
|
|
121
|
+
vue.createTextVNode(vue.toDisplayString(_ctx.icon), 1)
|
|
122
|
+
]),
|
|
123
|
+
_: 2
|
|
124
|
+
}, 1032, ["size", "color"])) : vue.createCommentVNode("", true)
|
|
125
|
+
]),
|
|
126
|
+
_: 2
|
|
127
|
+
}, 1032, ["color", "disabled", "height", "value", "variant", "width", "data-value", "class"]);
|
|
128
|
+
}), 128))
|
|
129
|
+
]);
|
|
130
|
+
}), 128))
|
|
131
|
+
]),
|
|
132
|
+
_: 1
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
const VSwatches = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
136
|
+
|
|
137
|
+
const installVSwatches = (app) => app.component("VSwatches", VSwatches);
|
|
138
|
+
if (typeof window !== "undefined" && window.Vue) {
|
|
139
|
+
window.Vue.use(VSwatches);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
exports.default = VSwatches;
|
|
143
|
+
exports.install = installVSwatches;
|
|
144
|
+
|
|
145
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
146
|
+
|
|
147
|
+
return exports;
|
|
148
|
+
|
|
149
|
+
})({}, Vue, colors);
|
package/dist/index.umd.js
CHANGED
|
@@ -5,8 +5,146 @@
|
|
|
5
5
|
* @author Logue <logue@hotmail.co.jp>
|
|
6
6
|
* @copyright 2022 By Masashi Yoshikawa All rights reserved.
|
|
7
7
|
* @license MIT
|
|
8
|
-
* @version 1.3.
|
|
8
|
+
* @version 1.3.2
|
|
9
9
|
* @see {@link https://github.com/logue/vuetify-swatches}
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
(function
|
|
12
|
+
(function (global, factory) {
|
|
13
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('vuetify/lib/util/colors.mjs')) :
|
|
14
|
+
typeof define === 'function' && define.amd ? define(['exports', 'vue', 'vuetify/lib/util/colors.mjs'], factory) :
|
|
15
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.VSwatches = {}, global.Vue, global.colors));
|
|
16
|
+
})(this, (function (exports, vue, colors) { 'use strict';
|
|
17
|
+
|
|
18
|
+
const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
|
|
19
|
+
|
|
20
|
+
const colors__default = /*#__PURE__*/_interopDefaultLegacy(colors);
|
|
21
|
+
|
|
22
|
+
const _sfc_main = vue.defineComponent({
|
|
23
|
+
name: "VSwatches",
|
|
24
|
+
model: {
|
|
25
|
+
prop: "modelValue",
|
|
26
|
+
event: "update:modelValue"
|
|
27
|
+
},
|
|
28
|
+
props: {
|
|
29
|
+
modelValue: { type: String, default: colors__default.default.shades.white },
|
|
30
|
+
swatches: {
|
|
31
|
+
type: Array,
|
|
32
|
+
default: () => [
|
|
33
|
+
[colors__default.default.shades.black, colors__default.default.shades.white, colors__default.default.shades.transparent],
|
|
34
|
+
[
|
|
35
|
+
colors__default.default.red.base,
|
|
36
|
+
colors__default.default.pink.base,
|
|
37
|
+
colors__default.default.purple.base,
|
|
38
|
+
colors__default.default.deepPurple.base,
|
|
39
|
+
colors__default.default.indigo.base,
|
|
40
|
+
colors__default.default.blue.base,
|
|
41
|
+
colors__default.default.lightBlue.base,
|
|
42
|
+
colors__default.default.cyan.base
|
|
43
|
+
],
|
|
44
|
+
[
|
|
45
|
+
colors__default.default.teal.base,
|
|
46
|
+
colors__default.default.green.base,
|
|
47
|
+
colors__default.default.lightGreen.base,
|
|
48
|
+
colors__default.default.lime.base,
|
|
49
|
+
colors__default.default.yellow.base,
|
|
50
|
+
colors__default.default.amber.base,
|
|
51
|
+
colors__default.default.orange.base,
|
|
52
|
+
colors__default.default.deepOrange.base
|
|
53
|
+
],
|
|
54
|
+
[colors__default.default.brown.base, colors__default.default.blueGrey.base, colors__default.default.grey.base]
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
size: { type: String, default: "2rem" },
|
|
58
|
+
icon: { type: String, default: "mdi-checkbox-marked-circle" },
|
|
59
|
+
iconSize: { type: String, default: "1rem" },
|
|
60
|
+
variant: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: void 0
|
|
63
|
+
},
|
|
64
|
+
disabled: { type: Boolean, default: void 0 },
|
|
65
|
+
rounded: { type: String, Number, default: void 0 }
|
|
66
|
+
},
|
|
67
|
+
emits: ["update:modelValue"],
|
|
68
|
+
setup(props, context) {
|
|
69
|
+
const checkedVisibilty = vue.ref(false);
|
|
70
|
+
const onSwatchClick = (e) => {
|
|
71
|
+
const value = e.target.dataset.value;
|
|
72
|
+
if (!value || props.modelValue === value) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
context.emit("update:modelValue", value);
|
|
76
|
+
};
|
|
77
|
+
return {
|
|
78
|
+
checkedVisibilty,
|
|
79
|
+
onSwatchClick,
|
|
80
|
+
shades: colors__default.default.shades
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const VSwatches_vue_vue_type_style_index_0_lang = '';
|
|
86
|
+
|
|
87
|
+
const _export_sfc = (sfc, props) => {
|
|
88
|
+
const target = sfc.__vccOpts || sfc;
|
|
89
|
+
for (const [key, val] of props) {
|
|
90
|
+
target[key] = val;
|
|
91
|
+
}
|
|
92
|
+
return target;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
96
|
+
const _component_v_icon = vue.resolveComponent("v-icon");
|
|
97
|
+
const _component_v_btn = vue.resolveComponent("v-btn");
|
|
98
|
+
const _component_v_sheet = vue.resolveComponent("v-sheet");
|
|
99
|
+
return vue.openBlock(), vue.createBlock(_component_v_sheet, { class: "v-swatches" }, {
|
|
100
|
+
default: vue.withCtx(() => [
|
|
101
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.swatches, (colors, rows) => {
|
|
102
|
+
return vue.openBlock(), vue.createElementBlock("div", { key: rows }, [
|
|
103
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(colors, (color) => {
|
|
104
|
+
return vue.openBlock(), vue.createBlock(_component_v_btn, {
|
|
105
|
+
key: color,
|
|
106
|
+
color,
|
|
107
|
+
disabled: _ctx.disabled,
|
|
108
|
+
height: _ctx.size,
|
|
109
|
+
value: color,
|
|
110
|
+
variant: _ctx.variant,
|
|
111
|
+
width: _ctx.size,
|
|
112
|
+
"data-value": color,
|
|
113
|
+
class: vue.normalizeClass(color === _ctx.shades.transparent ? "bg-trasparent" : ""),
|
|
114
|
+
"min-width": "auto",
|
|
115
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.onSwatchClick($event))
|
|
116
|
+
}, {
|
|
117
|
+
default: vue.withCtx(() => [
|
|
118
|
+
color === _ctx.modelValue ? (vue.openBlock(), vue.createBlock(_component_v_icon, {
|
|
119
|
+
key: 0,
|
|
120
|
+
size: _ctx.iconSize,
|
|
121
|
+
color: color !== _ctx.shades.transparent ? color : void 0
|
|
122
|
+
}, {
|
|
123
|
+
default: vue.withCtx(() => [
|
|
124
|
+
vue.createTextVNode(vue.toDisplayString(_ctx.icon), 1)
|
|
125
|
+
]),
|
|
126
|
+
_: 2
|
|
127
|
+
}, 1032, ["size", "color"])) : vue.createCommentVNode("", true)
|
|
128
|
+
]),
|
|
129
|
+
_: 2
|
|
130
|
+
}, 1032, ["color", "disabled", "height", "value", "variant", "width", "data-value", "class"]);
|
|
131
|
+
}), 128))
|
|
132
|
+
]);
|
|
133
|
+
}), 128))
|
|
134
|
+
]),
|
|
135
|
+
_: 1
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
const VSwatches = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
139
|
+
|
|
140
|
+
const installVSwatches = (app) => app.component("VSwatches", VSwatches);
|
|
141
|
+
if (typeof window !== "undefined" && window.Vue) {
|
|
142
|
+
window.Vue.use(VSwatches);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
exports.default = VSwatches;
|
|
146
|
+
exports.install = installVSwatches;
|
|
147
|
+
|
|
148
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
149
|
+
|
|
150
|
+
}));
|
package/dist/style.css
CHANGED
|
@@ -5,8 +5,20 @@
|
|
|
5
5
|
* @author Logue <logue@hotmail.co.jp>
|
|
6
6
|
* @copyright 2022 By Masashi Yoshikawa All rights reserved.
|
|
7
7
|
* @license MIT
|
|
8
|
-
* @version 1.3.
|
|
8
|
+
* @version 1.3.2
|
|
9
9
|
* @see {@link https://github.com/logue/vuetify-swatches}
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
.v-swatches .v-btn
|
|
12
|
+
.v-swatches .v-btn {
|
|
13
|
+
padding: 0 !important;
|
|
14
|
+
margin: 0.1rem;
|
|
15
|
+
}
|
|
16
|
+
.v-swatches .v-btn .v-icon {
|
|
17
|
+
filter: invert(100%) grayscale(100%) contrast(100);
|
|
18
|
+
}
|
|
19
|
+
.v-swatches .v-btn.bg-trasparent {
|
|
20
|
+
background: linear-gradient(to top left, transparent 0, transparent calc(50% - 0.1rem), #F44336 50%, transparent calc(50% + 0.1rem), transparent);
|
|
21
|
+
}
|
|
22
|
+
.v-swatches .v-btn.bg-trasparent .v-icon {
|
|
23
|
+
filter: none;
|
|
24
|
+
}
|
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": "1.3.
|
|
4
|
+
"version": "1.3.2",
|
|
5
5
|
"description": "Color Swatch component for Vuetify3.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"vuejs",
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
"src/components/VSwatches.vue"
|
|
55
55
|
],
|
|
56
56
|
"engines": {
|
|
57
|
-
"node": ">=16.
|
|
57
|
+
"node": ">=16.18.0",
|
|
58
58
|
"yarn": ">=1.22.10"
|
|
59
59
|
},
|
|
60
|
-
"packageManager": "yarn@3.2.
|
|
60
|
+
"packageManager": "yarn@3.2.4",
|
|
61
61
|
"sideEffects": false,
|
|
62
62
|
"scripts": {
|
|
63
63
|
"dev": "vite",
|
|
@@ -73,26 +73,27 @@
|
|
|
73
73
|
"prepare": "husky install"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
|
-
"vue": "^3.2.
|
|
77
|
-
"vuetify": "^3.0.0-beta.
|
|
76
|
+
"vue": "^3.2.41",
|
|
77
|
+
"vuetify": "^3.0.0-beta.15"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"@codemirror/lang-html": "^6.1.
|
|
81
|
-
"@types/node": "^18.7
|
|
82
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
83
|
-
"@typescript-eslint/parser": "^5.
|
|
84
|
-
"@vitejs/plugin-vue": "^3.
|
|
80
|
+
"@codemirror/lang-html": "^6.1.3",
|
|
81
|
+
"@types/node": "^18.11.7",
|
|
82
|
+
"@typescript-eslint/eslint-plugin": "^5.41.0",
|
|
83
|
+
"@typescript-eslint/parser": "^5.41.0",
|
|
84
|
+
"@vitejs/plugin-vue": "^3.2.0",
|
|
85
|
+
"@vue/eslint-config-prettier": "^7.0.0",
|
|
85
86
|
"@vue/tsconfig": "^0.1.3",
|
|
86
87
|
"codemirror": "^6.0.1",
|
|
87
|
-
"eslint": "^8.
|
|
88
|
+
"eslint": "^8.26.0",
|
|
88
89
|
"eslint-config-google": "^0.14.0",
|
|
89
90
|
"eslint-config-prettier": "^8.5.0",
|
|
90
91
|
"eslint-import-resolver-alias": "^1.1.2",
|
|
91
|
-
"eslint-import-resolver-typescript": "^3.5.
|
|
92
|
+
"eslint-import-resolver-typescript": "^3.5.2",
|
|
92
93
|
"eslint-plugin-import": "^2.26.0",
|
|
93
|
-
"eslint-plugin-jsdoc": "^39.3.
|
|
94
|
+
"eslint-plugin-jsdoc": "^39.3.25",
|
|
94
95
|
"eslint-plugin-tsdoc": "^0.2.17",
|
|
95
|
-
"eslint-plugin-vue": "^9.
|
|
96
|
+
"eslint-plugin-vue": "^9.6.0",
|
|
96
97
|
"eslint-plugin-vuejs-accessibility": "^1.2.0",
|
|
97
98
|
"eslint-plugin-vuetify": "^1.1.0",
|
|
98
99
|
"eslint-plugin-yaml": "^0.5.0",
|
|
@@ -101,24 +102,24 @@
|
|
|
101
102
|
"postcss-html": "^1.5.0",
|
|
102
103
|
"prettier": "^2.7.1",
|
|
103
104
|
"rimraf": "^3.0.2",
|
|
104
|
-
"rollup-plugin-visualizer": "^5.8.
|
|
105
|
-
"sass": "1.
|
|
106
|
-
"stylelint": "^14.
|
|
105
|
+
"rollup-plugin-visualizer": "^5.8.3",
|
|
106
|
+
"sass": "1.55.0",
|
|
107
|
+
"stylelint": "^14.14.0",
|
|
107
108
|
"stylelint-config-prettier": "^9.0.3",
|
|
108
|
-
"stylelint-config-recommended-scss": "^
|
|
109
|
+
"stylelint-config-recommended-scss": "^8.0.0",
|
|
109
110
|
"stylelint-config-recommended-vue": "^1.4.0",
|
|
110
111
|
"stylelint-order": "^5.0.0",
|
|
111
112
|
"stylelint-prettier": "^2.0.0",
|
|
112
|
-
"typescript": "^4.8.
|
|
113
|
-
"vite": "^3.
|
|
113
|
+
"typescript": "^4.8.4",
|
|
114
|
+
"vite": "^3.2.0",
|
|
114
115
|
"vite-plugin-banner": "^0.5.0",
|
|
115
116
|
"vite-plugin-checker": "^0.5.1",
|
|
116
|
-
"vite-plugin-vuetify": "^1.0.0
|
|
117
|
-
"vue": "^3.2.
|
|
118
|
-
"vue-codemirror6": "1.0.
|
|
117
|
+
"vite-plugin-vuetify": "^1.0.0",
|
|
118
|
+
"vue": "^3.2.41",
|
|
119
|
+
"vue-codemirror6": "1.0.3",
|
|
119
120
|
"vue-eslint-parser": "^9.1.0",
|
|
120
|
-
"vue-tsc": "^0.
|
|
121
|
-
"vuetify": "^3.0.0-beta.
|
|
121
|
+
"vue-tsc": "^1.0.9",
|
|
122
|
+
"vuetify": "^3.0.0-beta.14"
|
|
122
123
|
},
|
|
123
124
|
"husky": {
|
|
124
125
|
"hooks": {
|