vuetify-swatches 1.0.0 → 1.0.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 +17 -14
- package/dist/index.es.js +160 -79
- package/dist/index.iife.js +210 -2
- package/dist/index.umd.js +211 -2
- package/dist/stats.html +4034 -0
- package/dist/style.css +14 -2
- package/package.json +19 -24
- package/dist/components/VSwatches.vue.d.ts +0 -218
- package/dist/components/VSwatches.vue.d.ts.map +0 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
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
|
|
|
@@ -12,7 +13,9 @@ This project is a remake of [saintplay's vue-swatches](https://saintplay.github.
|
|
|
12
13
|
|
|
13
14
|
Unlike the original version, it provides a UI based on Vuetify, such as ripple effects and dark mode.
|
|
14
15
|
|
|
15
|
-
This library is positioned as a complement to Vuetify and provides a minimal UI. Use the[Menu Component](https://vuetifyjs.com/components/menus/) if you want to display a pop-up menu, and the [Card component](https://vuetifyjs.com/components/cards/) if you want to display a palette.
|
|
16
|
+
This library is positioned as a complement to Vuetify and provides a minimal UI. Use the [Menu Component](https://vuetifyjs.com/components/menus/) if you want to display a pop-up menu, and the [Card component](https://vuetifyjs.com/components/cards/) if you want to display a palette.
|
|
17
|
+
|
|
18
|
+
For Vuetify3, please use the [next branch](https://github.com/logue/vuetify-swatches/tree/next).
|
|
16
19
|
|
|
17
20
|
## Usage
|
|
18
21
|
|
|
@@ -123,19 +126,19 @@ export default Vue.extend({
|
|
|
123
126
|
|
|
124
127
|
### Options
|
|
125
128
|
|
|
126
|
-
| Variables | Type | Default
|
|
127
|
-
| --------- | -------------- |
|
|
128
|
-
| size | string | 2rem
|
|
129
|
-
| icon | string | mdi-checkbox-marked-circle
|
|
130
|
-
| icon-size | string | 1rem
|
|
131
|
-
| depressed | boolean | false
|
|
132
|
-
| disabled | boolean | false
|
|
133
|
-
| elevation | number\|string | undefined
|
|
134
|
-
| outlined | false
|
|
135
|
-
| plain | false
|
|
136
|
-
| raised | true
|
|
137
|
-
| rounded | false
|
|
138
|
-
| tile | false
|
|
129
|
+
| Variables | Type | Default | Info |
|
|
130
|
+
| --------- | -------------- | -------------------------- | ---------------------------------------------------------------------------------------- |
|
|
131
|
+
| size | string | 2rem | Swatch Button size |
|
|
132
|
+
| icon | string | mdi-checkbox-marked-circle | checked icon |
|
|
133
|
+
| icon-size | string | 1rem | checked icon size |
|
|
134
|
+
| depressed | boolean | false | Removes the button box shadow. |
|
|
135
|
+
| disabled | boolean | false | Removes the ability to click or target the component. |
|
|
136
|
+
| elevation | number\|string | undefined | Designates an elevation applied to the component between 0 and 24. |
|
|
137
|
+
| outlined | boolean | false | Makes the background transparent and applies a thin border. |
|
|
138
|
+
| plain | boolean | false | Removes the default background change applied when hovering over the button. |
|
|
139
|
+
| raised | boolean | true | Raised buttons have a box shadow that increases when clicked. This is the default style. |
|
|
140
|
+
| rounded | boolean | false | Applies a large border radius on the button. |
|
|
141
|
+
| tile | boolean | false | Removes the component’s border-radius. |
|
|
139
142
|
|
|
140
143
|
## LICENSE
|
|
141
144
|
|
package/dist/index.es.js
CHANGED
|
@@ -5,19 +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.0.
|
|
8
|
+
* @version 1.0.1
|
|
9
9
|
* @see {@link https://github.com/logue/vuetify-swatches}
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import { defineComponent
|
|
13
|
-
import { VSheet
|
|
14
|
-
import
|
|
15
|
-
|
|
12
|
+
import { defineComponent, ref } from 'vue-demi';
|
|
13
|
+
import { VSheet, VBtn, VIcon } from 'vuetify/lib/components';
|
|
14
|
+
import colors from 'vuetify/lib/util/colors';
|
|
15
|
+
|
|
16
|
+
const _sfc_main = defineComponent({
|
|
16
17
|
name: "VSwatches",
|
|
17
18
|
components: {
|
|
18
|
-
VSheet
|
|
19
|
-
VBtn
|
|
20
|
-
VIcon
|
|
19
|
+
VSheet,
|
|
20
|
+
VBtn,
|
|
21
|
+
VIcon
|
|
21
22
|
},
|
|
22
23
|
model: {
|
|
23
24
|
prop: "modelValue",
|
|
@@ -28,102 +29,182 @@ const S = b({
|
|
|
28
29
|
swatches: {
|
|
29
30
|
type: Array,
|
|
30
31
|
default: () => [
|
|
31
|
-
[
|
|
32
|
+
[colors.shades.black, colors.shades.white, colors.shades.transparent],
|
|
32
33
|
[
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
colors.red.base,
|
|
35
|
+
colors.pink.base,
|
|
36
|
+
colors.purple.base,
|
|
37
|
+
colors.deepPurple.base,
|
|
38
|
+
colors.indigo.base,
|
|
39
|
+
colors.blue.base,
|
|
40
|
+
colors.lightBlue.base,
|
|
41
|
+
colors.cyan.base
|
|
41
42
|
],
|
|
42
43
|
[
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
colors.teal.base,
|
|
45
|
+
colors.green.base,
|
|
46
|
+
colors.lightGreen.base,
|
|
47
|
+
colors.lime.base,
|
|
48
|
+
colors.yellow.base,
|
|
49
|
+
colors.amber.base,
|
|
50
|
+
colors.orange.base,
|
|
51
|
+
colors.deepOrange.base
|
|
51
52
|
],
|
|
52
|
-
[
|
|
53
|
+
[colors.brown.base, colors.blueGrey.base, colors.grey.base]
|
|
53
54
|
]
|
|
54
55
|
},
|
|
55
56
|
size: { type: String, default: "2rem" },
|
|
56
57
|
icon: { type: String, default: "mdi-checkbox-marked-circle" },
|
|
57
58
|
iconSize: { type: String, default: "1rem" },
|
|
58
|
-
depressed: { type: Boolean, default:
|
|
59
|
-
disabled: { type: Boolean, default:
|
|
59
|
+
depressed: { type: Boolean, default: false },
|
|
60
|
+
disabled: { type: Boolean, default: false },
|
|
60
61
|
elevation: { type: [Number, String], default: void 0 },
|
|
61
|
-
outlined: { type: Boolean, default:
|
|
62
|
-
plain: { type: Boolean, default:
|
|
63
|
-
raised: { type: Boolean, default:
|
|
64
|
-
rounded: { type: Boolean, default:
|
|
65
|
-
tile: { type: Boolean, default:
|
|
62
|
+
outlined: { type: Boolean, default: false },
|
|
63
|
+
plain: { type: Boolean, default: false },
|
|
64
|
+
raised: { type: Boolean, default: true },
|
|
65
|
+
rounded: { type: Boolean, default: false },
|
|
66
|
+
tile: { type: Boolean, default: false }
|
|
66
67
|
},
|
|
67
68
|
emits: ["update:modelValue"],
|
|
68
|
-
setup(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
setup(props, context) {
|
|
70
|
+
const checkedVisibilty = ref(false);
|
|
71
|
+
const onSwatchClick = (e) => {
|
|
72
|
+
const value = e.target.value;
|
|
73
|
+
if (!value || props.modelValue === value) {
|
|
74
|
+
return;
|
|
74
75
|
}
|
|
76
|
+
context.emit("update:modelValue", value);
|
|
77
|
+
};
|
|
78
|
+
return {
|
|
79
|
+
checkedVisibilty,
|
|
80
|
+
onSwatchClick
|
|
75
81
|
};
|
|
76
82
|
}
|
|
77
83
|
});
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
84
|
+
|
|
85
|
+
const VSwatches_vue_vue_type_style_index_0_lang = '';
|
|
86
|
+
|
|
87
|
+
function normalizeComponent (
|
|
88
|
+
scriptExports,
|
|
89
|
+
render,
|
|
90
|
+
staticRenderFns,
|
|
91
|
+
functionalTemplate,
|
|
92
|
+
injectStyles,
|
|
93
|
+
scopeId,
|
|
94
|
+
moduleIdentifier, /* server only */
|
|
95
|
+
shadowMode /* vue-cli only */
|
|
96
|
+
) {
|
|
97
|
+
// Vue.extend constructor export interop
|
|
98
|
+
var options = typeof scriptExports === 'function'
|
|
99
|
+
? scriptExports.options
|
|
100
|
+
: scriptExports;
|
|
101
|
+
|
|
102
|
+
// render functions
|
|
103
|
+
if (render) {
|
|
104
|
+
options.render = render;
|
|
105
|
+
options.staticRenderFns = staticRenderFns;
|
|
106
|
+
options._compiled = true;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// functional template
|
|
110
|
+
if (functionalTemplate) {
|
|
111
|
+
options.functional = true;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// scopedId
|
|
115
|
+
if (scopeId) {
|
|
116
|
+
options._scopeId = 'data-v-' + scopeId;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
var hook;
|
|
120
|
+
if (moduleIdentifier) { // server build
|
|
121
|
+
hook = function (context) {
|
|
122
|
+
// 2.3 injection
|
|
123
|
+
context =
|
|
124
|
+
context || // cached call
|
|
125
|
+
(this.$vnode && this.$vnode.ssrContext) || // stateful
|
|
126
|
+
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional
|
|
127
|
+
// 2.2 with runInNewContext: true
|
|
128
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
129
|
+
context = __VUE_SSR_CONTEXT__;
|
|
130
|
+
}
|
|
131
|
+
// inject component styles
|
|
132
|
+
if (injectStyles) {
|
|
133
|
+
injectStyles.call(this, context);
|
|
134
|
+
}
|
|
135
|
+
// register component module identifier for async chunk inference
|
|
136
|
+
if (context && context._registeredComponents) {
|
|
137
|
+
context._registeredComponents.add(moduleIdentifier);
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
// used by ssr in case component is cached and beforeCreate
|
|
141
|
+
// never gets called
|
|
142
|
+
options._ssrRegister = hook;
|
|
143
|
+
} else if (injectStyles) {
|
|
144
|
+
hook = shadowMode
|
|
145
|
+
? function () {
|
|
146
|
+
injectStyles.call(
|
|
147
|
+
this,
|
|
148
|
+
(options.functional ? this.parent : this).$root.$options.shadowRoot
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
: injectStyles;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (hook) {
|
|
155
|
+
if (options.functional) {
|
|
156
|
+
// for template-only hot-reload because in that case the render fn doesn't
|
|
157
|
+
// go through the normalizer
|
|
158
|
+
options._injectStyles = hook;
|
|
159
|
+
// register for functional component in vue file
|
|
160
|
+
var originalRender = options.render;
|
|
161
|
+
options.render = function renderWithStyleInjection (h, context) {
|
|
162
|
+
hook.call(context);
|
|
163
|
+
return originalRender(h, context)
|
|
95
164
|
};
|
|
96
165
|
} else {
|
|
97
|
-
|
|
98
|
-
|
|
166
|
+
// inject component registration as beforeCreate hook
|
|
167
|
+
var existing = options.beforeCreate;
|
|
168
|
+
options.beforeCreate = existing
|
|
169
|
+
? [].concat(existing, hook)
|
|
170
|
+
: [hook];
|
|
99
171
|
}
|
|
172
|
+
}
|
|
173
|
+
|
|
100
174
|
return {
|
|
101
|
-
exports:
|
|
102
|
-
options:
|
|
103
|
-
}
|
|
175
|
+
exports: scriptExports,
|
|
176
|
+
options: options
|
|
177
|
+
}
|
|
104
178
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
179
|
+
|
|
180
|
+
var _sfc_render = function render() {
|
|
181
|
+
var _vm = this, _c = _vm._self._c; _vm._self._setupProxy;
|
|
182
|
+
return _c("v-sheet", { staticClass: "v-swatches" }, _vm._l(_vm.swatches, function(colors, rows) {
|
|
183
|
+
return _c("div", { key: rows }, _vm._l(colors, function(color) {
|
|
184
|
+
return _c("v-btn", { key: color, attrs: { "color": color, "depressed": _vm.depressed, "disabled": _vm.disabled, "elevation": _vm.elevation, "height": _vm.size, "outlined": _vm.outlined, "plain": _vm.plain, "raised": _vm.raised, "tile": _vm.tile, "value": color, "width": _vm.size, "min-width": "auto" }, on: { "click": function($event) {
|
|
185
|
+
return _vm.onSwatchClick($event);
|
|
186
|
+
} } }, [color === _vm.modelValue ? _c("v-icon", { attrs: { "size": _vm.iconSize, "color": color !== "transparent" ? color : void 0 } }, [_vm._v(" " + _vm._s(_vm.icon) + " ")]) : _vm._e()], 1);
|
|
112
187
|
}), 1);
|
|
113
188
|
}), 0);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
189
|
+
};
|
|
190
|
+
var _sfc_staticRenderFns = [];
|
|
191
|
+
_sfc_render._withStripped = true;
|
|
192
|
+
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
193
|
+
_sfc_main,
|
|
194
|
+
_sfc_render,
|
|
195
|
+
_sfc_staticRenderFns,
|
|
196
|
+
false,
|
|
119
197
|
null,
|
|
120
198
|
null,
|
|
121
199
|
null,
|
|
122
200
|
null
|
|
123
201
|
);
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
202
|
+
__component__.options.__file = "D:/Documents/Projects/vuetify-swatch/src/components/VSwatches.vue";
|
|
203
|
+
const VSwatches = __component__.exports;
|
|
204
|
+
|
|
205
|
+
const installVSwatches = (app) => app.component("VSwatches", VSwatches);
|
|
206
|
+
if (typeof window !== "undefined" && window.Vue) {
|
|
207
|
+
window.Vue.use(VSwatches);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export { VSwatches as default, installVSwatches as install };
|
package/dist/index.iife.js
CHANGED
|
@@ -5,8 +5,216 @@
|
|
|
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.0.
|
|
8
|
+
* @version 1.0.1
|
|
9
9
|
* @see {@link https://github.com/logue/vuetify-swatches}
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
var VSwatches
|
|
12
|
+
var VSwatches = (function (exports, vueDemi, components, 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 = vueDemi.defineComponent({
|
|
20
|
+
name: "VSwatches",
|
|
21
|
+
components: {
|
|
22
|
+
VSheet: components.VSheet,
|
|
23
|
+
VBtn: components.VBtn,
|
|
24
|
+
VIcon: components.VIcon
|
|
25
|
+
},
|
|
26
|
+
model: {
|
|
27
|
+
prop: "modelValue",
|
|
28
|
+
event: "update:modelValue"
|
|
29
|
+
},
|
|
30
|
+
props: {
|
|
31
|
+
modelValue: { type: String, default: "#ffffff" },
|
|
32
|
+
swatches: {
|
|
33
|
+
type: Array,
|
|
34
|
+
default: () => [
|
|
35
|
+
[colors__default.default.shades.black, colors__default.default.shades.white, colors__default.default.shades.transparent],
|
|
36
|
+
[
|
|
37
|
+
colors__default.default.red.base,
|
|
38
|
+
colors__default.default.pink.base,
|
|
39
|
+
colors__default.default.purple.base,
|
|
40
|
+
colors__default.default.deepPurple.base,
|
|
41
|
+
colors__default.default.indigo.base,
|
|
42
|
+
colors__default.default.blue.base,
|
|
43
|
+
colors__default.default.lightBlue.base,
|
|
44
|
+
colors__default.default.cyan.base
|
|
45
|
+
],
|
|
46
|
+
[
|
|
47
|
+
colors__default.default.teal.base,
|
|
48
|
+
colors__default.default.green.base,
|
|
49
|
+
colors__default.default.lightGreen.base,
|
|
50
|
+
colors__default.default.lime.base,
|
|
51
|
+
colors__default.default.yellow.base,
|
|
52
|
+
colors__default.default.amber.base,
|
|
53
|
+
colors__default.default.orange.base,
|
|
54
|
+
colors__default.default.deepOrange.base
|
|
55
|
+
],
|
|
56
|
+
[colors__default.default.brown.base, colors__default.default.blueGrey.base, colors__default.default.grey.base]
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
size: { type: String, default: "2rem" },
|
|
60
|
+
icon: { type: String, default: "mdi-checkbox-marked-circle" },
|
|
61
|
+
iconSize: { type: String, default: "1rem" },
|
|
62
|
+
depressed: { type: Boolean, default: false },
|
|
63
|
+
disabled: { type: Boolean, default: false },
|
|
64
|
+
elevation: { type: [Number, String], default: void 0 },
|
|
65
|
+
outlined: { type: Boolean, default: false },
|
|
66
|
+
plain: { type: Boolean, default: false },
|
|
67
|
+
raised: { type: Boolean, default: true },
|
|
68
|
+
rounded: { type: Boolean, default: false },
|
|
69
|
+
tile: { type: Boolean, default: false }
|
|
70
|
+
},
|
|
71
|
+
emits: ["update:modelValue"],
|
|
72
|
+
setup(props, context) {
|
|
73
|
+
const checkedVisibilty = vueDemi.ref(false);
|
|
74
|
+
const onSwatchClick = (e) => {
|
|
75
|
+
const value = e.target.value;
|
|
76
|
+
if (!value || props.modelValue === value) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
context.emit("update:modelValue", value);
|
|
80
|
+
};
|
|
81
|
+
return {
|
|
82
|
+
checkedVisibilty,
|
|
83
|
+
onSwatchClick
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
const VSwatches_vue_vue_type_style_index_0_lang = '';
|
|
89
|
+
|
|
90
|
+
function normalizeComponent (
|
|
91
|
+
scriptExports,
|
|
92
|
+
render,
|
|
93
|
+
staticRenderFns,
|
|
94
|
+
functionalTemplate,
|
|
95
|
+
injectStyles,
|
|
96
|
+
scopeId,
|
|
97
|
+
moduleIdentifier, /* server only */
|
|
98
|
+
shadowMode /* vue-cli only */
|
|
99
|
+
) {
|
|
100
|
+
// Vue.extend constructor export interop
|
|
101
|
+
var options = typeof scriptExports === 'function'
|
|
102
|
+
? scriptExports.options
|
|
103
|
+
: scriptExports;
|
|
104
|
+
|
|
105
|
+
// render functions
|
|
106
|
+
if (render) {
|
|
107
|
+
options.render = render;
|
|
108
|
+
options.staticRenderFns = staticRenderFns;
|
|
109
|
+
options._compiled = true;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// functional template
|
|
113
|
+
if (functionalTemplate) {
|
|
114
|
+
options.functional = true;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// scopedId
|
|
118
|
+
if (scopeId) {
|
|
119
|
+
options._scopeId = 'data-v-' + scopeId;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
var hook;
|
|
123
|
+
if (moduleIdentifier) { // server build
|
|
124
|
+
hook = function (context) {
|
|
125
|
+
// 2.3 injection
|
|
126
|
+
context =
|
|
127
|
+
context || // cached call
|
|
128
|
+
(this.$vnode && this.$vnode.ssrContext) || // stateful
|
|
129
|
+
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional
|
|
130
|
+
// 2.2 with runInNewContext: true
|
|
131
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
132
|
+
context = __VUE_SSR_CONTEXT__;
|
|
133
|
+
}
|
|
134
|
+
// inject component styles
|
|
135
|
+
if (injectStyles) {
|
|
136
|
+
injectStyles.call(this, context);
|
|
137
|
+
}
|
|
138
|
+
// register component module identifier for async chunk inference
|
|
139
|
+
if (context && context._registeredComponents) {
|
|
140
|
+
context._registeredComponents.add(moduleIdentifier);
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
// used by ssr in case component is cached and beforeCreate
|
|
144
|
+
// never gets called
|
|
145
|
+
options._ssrRegister = hook;
|
|
146
|
+
} else if (injectStyles) {
|
|
147
|
+
hook = shadowMode
|
|
148
|
+
? function () {
|
|
149
|
+
injectStyles.call(
|
|
150
|
+
this,
|
|
151
|
+
(options.functional ? this.parent : this).$root.$options.shadowRoot
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
: injectStyles;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (hook) {
|
|
158
|
+
if (options.functional) {
|
|
159
|
+
// for template-only hot-reload because in that case the render fn doesn't
|
|
160
|
+
// go through the normalizer
|
|
161
|
+
options._injectStyles = hook;
|
|
162
|
+
// register for functional component in vue file
|
|
163
|
+
var originalRender = options.render;
|
|
164
|
+
options.render = function renderWithStyleInjection (h, context) {
|
|
165
|
+
hook.call(context);
|
|
166
|
+
return originalRender(h, context)
|
|
167
|
+
};
|
|
168
|
+
} else {
|
|
169
|
+
// inject component registration as beforeCreate hook
|
|
170
|
+
var existing = options.beforeCreate;
|
|
171
|
+
options.beforeCreate = existing
|
|
172
|
+
? [].concat(existing, hook)
|
|
173
|
+
: [hook];
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return {
|
|
178
|
+
exports: scriptExports,
|
|
179
|
+
options: options
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
var _sfc_render = function render() {
|
|
184
|
+
var _vm = this, _c = _vm._self._c; _vm._self._setupProxy;
|
|
185
|
+
return _c("v-sheet", { staticClass: "v-swatches" }, _vm._l(_vm.swatches, function(colors, rows) {
|
|
186
|
+
return _c("div", { key: rows }, _vm._l(colors, function(color) {
|
|
187
|
+
return _c("v-btn", { key: color, attrs: { "color": color, "depressed": _vm.depressed, "disabled": _vm.disabled, "elevation": _vm.elevation, "height": _vm.size, "outlined": _vm.outlined, "plain": _vm.plain, "raised": _vm.raised, "tile": _vm.tile, "value": color, "width": _vm.size, "min-width": "auto" }, on: { "click": function($event) {
|
|
188
|
+
return _vm.onSwatchClick($event);
|
|
189
|
+
} } }, [color === _vm.modelValue ? _c("v-icon", { attrs: { "size": _vm.iconSize, "color": color !== "transparent" ? color : void 0 } }, [_vm._v(" " + _vm._s(_vm.icon) + " ")]) : _vm._e()], 1);
|
|
190
|
+
}), 1);
|
|
191
|
+
}), 0);
|
|
192
|
+
};
|
|
193
|
+
var _sfc_staticRenderFns = [];
|
|
194
|
+
_sfc_render._withStripped = true;
|
|
195
|
+
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
196
|
+
_sfc_main,
|
|
197
|
+
_sfc_render,
|
|
198
|
+
_sfc_staticRenderFns,
|
|
199
|
+
false,
|
|
200
|
+
null,
|
|
201
|
+
null,
|
|
202
|
+
null,
|
|
203
|
+
null
|
|
204
|
+
);
|
|
205
|
+
__component__.options.__file = "D:/Documents/Projects/vuetify-swatch/src/components/VSwatches.vue";
|
|
206
|
+
const VSwatches = __component__.exports;
|
|
207
|
+
|
|
208
|
+
const installVSwatches = (app) => app.component("VSwatches", VSwatches);
|
|
209
|
+
if (typeof window !== "undefined" && window.Vue) {
|
|
210
|
+
window.Vue.use(VSwatches);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
exports.default = VSwatches;
|
|
214
|
+
exports.install = installVSwatches;
|
|
215
|
+
|
|
216
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
217
|
+
|
|
218
|
+
return exports;
|
|
219
|
+
|
|
220
|
+
})({}, VueDemi, Vuetify, colors);
|