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 CHANGED
@@ -5,6 +5,7 @@
5
5
  [![Open in unpkg](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/vuetify-swatches/file/README.md)
6
6
  [![npm version](https://img.shields.io/npm/v/vuetify-swatches.svg)](https://www.npmjs.com/package/vuetify-swatches)
7
7
  [![Open in Gitpod](https://shields.io/badge/Open%20in-Gitpod-green?logo=Gitpod)](https://gitpod.io/#https://github.com/logue/vuetify-swatches)
8
+ [![Twitter Follow](https://img.shields.io/twitter/follow/logue256?style=plastic)](https://twitter.com/logue256)
8
9
 
9
10
  ![demo](https://user-images.githubusercontent.com/480173/156681882-d3d5e868-ba9a-4a34-9e75-08272d39da64.gif)
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 | Info |
127
- | --------- | -------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
128
- | size | string | 2rem | Swatch Button size |
129
- | icon | string | mdi-checkbox-marked-circle | checked icon |
130
- | icon-size | string | 1rem | checked icon size |
131
- | depressed | boolean | false | Removes the button box shadow. |
132
- | disabled | boolean | false | Removes the ability to click or target the component. |
133
- | elevation | number\|string | undefined | Designates an elevation applied to the component between 0 and 24. |
134
- | outlined | false | Makes the background transparent and applies a thin border. |
135
- | plain | false | Removes the default background change applied when hovering over the button. |
136
- | raised | true | Raised buttons have a box shadow that increases when clicked. This is the default style. |
137
- | rounded | false | Applies a large border radius on the button. |
138
- | tile | false | Removes the component’s border-radius. |
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.0
8
+ * @version 1.0.1
9
9
  * @see {@link https://github.com/logue/vuetify-swatches}
10
10
  */
11
11
 
12
- import { defineComponent as b, ref as v } from "vue-demi";
13
- import { VSheet as y, VBtn as w, VIcon as V } from "vuetify/lib/components";
14
- import t from "vuetify/lib/util/colors";
15
- const S = b({
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: y,
19
- VBtn: w,
20
- VIcon: V
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
- [t.shades.black, t.shades.white, t.shades.transparent],
32
+ [colors.shades.black, colors.shades.white, colors.shades.transparent],
32
33
  [
33
- t.red.base,
34
- t.pink.base,
35
- t.purple.base,
36
- t.deepPurple.base,
37
- t.indigo.base,
38
- t.blue.base,
39
- t.lightBlue.base,
40
- t.cyan.base
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
- t.teal.base,
44
- t.green.base,
45
- t.lightGreen.base,
46
- t.lime.base,
47
- t.yellow.base,
48
- t.amber.base,
49
- t.orange.base,
50
- t.deepOrange.base
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
- [t.brown.base, t.blueGrey.base, t.grey.base]
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: !1 },
59
- disabled: { type: Boolean, default: !1 },
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: !1 },
62
- plain: { type: Boolean, default: !1 },
63
- raised: { type: Boolean, default: !0 },
64
- rounded: { type: Boolean, default: !1 },
65
- tile: { type: Boolean, default: !1 }
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(s, e) {
69
- return {
70
- checkedVisibilty: v(!1),
71
- onSwatchClick: (i) => {
72
- const n = i.target.value;
73
- !n || s.modelValue === n || e.emit("update:modelValue", n);
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
- function g(s, e, r, d, i, n, u, _) {
79
- var a = typeof s == "function" ? s.options : s;
80
- e && (a.render = e, a.staticRenderFns = r, a._compiled = !0), d && (a.functional = !0), n && (a._scopeId = "data-v-" + n);
81
- var l;
82
- if (u ? (l = function(o) {
83
- 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(u);
84
- }, a._ssrRegister = l) : i && (l = _ ? function() {
85
- i.call(
86
- this,
87
- (a.functional ? this.parent : this).$root.$options.shadowRoot
88
- );
89
- } : i), l)
90
- if (a.functional) {
91
- a._injectStyles = l;
92
- var h = a.render;
93
- a.render = function(m, p) {
94
- return l.call(p), h(m, p);
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
- var f = a.beforeCreate;
98
- a.beforeCreate = f ? [].concat(f, l) : [l];
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: s,
102
- options: a
103
- };
175
+ exports: scriptExports,
176
+ options: options
177
+ }
104
178
  }
105
- var C = function() {
106
- var e = this, r = e._self._c;
107
- return e._self._setupProxy, r("v-sheet", { staticClass: "v-swatches" }, e._l(e.swatches, function(d, i) {
108
- return r("div", { key: i }, e._l(d, function(n) {
109
- return r("v-btn", { key: n, attrs: { color: n, depressed: e.depressed, disabled: e.disabled, elevation: e.elevation, height: e.size, outlined: e.outlined, plain: e.plain, raised: e.raised, tile: e.tile, value: n, width: e.size, "min-width": "auto" }, on: { click: function(u) {
110
- return e.onSwatchClick(u);
111
- } } }, [n === e.modelValue ? r("v-icon", { attrs: { size: e.iconSize, color: n !== "transparent" ? n : void 0 } }, [e._v(" " + e._s(e.icon) + " ")]) : e._e()], 1);
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
- }, k = [], B = /* @__PURE__ */ g(
115
- S,
116
- C,
117
- k,
118
- !1,
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
- const c = B.exports, T = (s) => s.component("VSwatches", c);
125
- typeof window < "u" && window.Vue && window.Vue.use(c);
126
- export {
127
- c as default,
128
- T as install
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 };
@@ -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.0
8
+ * @version 1.0.1
9
9
  * @see {@link https://github.com/logue/vuetify-swatches}
10
10
  */
11
11
 
12
- var VSwatches=function(u,p,c,v){"use strict";const t=(a=>a&&typeof a=="object"&&"default"in a?a:{default:a})(v),y=p.defineComponent({name:"VSwatches",components:{VSheet:c.VSheet,VBtn:c.VBtn,VIcon:c.VIcon},model:{prop:"modelValue",event:"update:modelValue"},props:{modelValue:{type:String,default:"#ffffff"},swatches:{type:Array,default:()=>[[t.default.shades.black,t.default.shades.white,t.default.shades.transparent],[t.default.red.base,t.default.pink.base,t.default.purple.base,t.default.deepPurple.base,t.default.indigo.base,t.default.blue.base,t.default.lightBlue.base,t.default.cyan.base],[t.default.teal.base,t.default.green.base,t.default.lightGreen.base,t.default.lime.base,t.default.yellow.base,t.default.amber.base,t.default.orange.base,t.default.deepOrange.base],[t.default.brown.base,t.default.blueGrey.base,t.default.grey.base]]},size:{type:String,default:"2rem"},icon:{type:String,default:"mdi-checkbox-marked-circle"},iconSize:{type:String,default:"1rem"},depressed:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},elevation:{type:[Number,String],default:void 0},outlined:{type:Boolean,default:!1},plain:{type:Boolean,default:!1},raised:{type:Boolean,default:!0},rounded:{type:Boolean,default:!1},tile:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(a,e){return{checkedVisibilty:p.ref(!1),onSwatchClick:s=>{const n=s.target.value;!n||a.modelValue===n||e.emit("update:modelValue",n)}}}}),R="";function m(a,e,o,r,s,n,f,C){var l=typeof a=="function"?a.options:a;e&&(l.render=e,l.staticRenderFns=o,l._compiled=!0),r&&(l.functional=!0),n&&(l._scopeId="data-v-"+n);var d;if(f?(d=function(i){i=i||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!i&&typeof __VUE_SSR_CONTEXT__<"u"&&(i=__VUE_SSR_CONTEXT__),s&&s.call(this,i),i&&i._registeredComponents&&i._registeredComponents.add(f)},l._ssrRegister=d):s&&(d=C?function(){s.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:s),d)if(l.functional){l._injectStyles=d;var k=l.render;l.render=function(B,b){return d.call(b),k(B,b)}}else{var h=l.beforeCreate;l.beforeCreate=h?[].concat(h,d):[d]}return{exports:a,options:l}}var V=function(){var e=this,o=e._self._c;return e._self._setupProxy,o("v-sheet",{staticClass:"v-swatches"},e._l(e.swatches,function(r,s){return o("div",{key:s},e._l(r,function(n){return o("v-btn",{key:n,attrs:{color:n,depressed:e.depressed,disabled:e.disabled,elevation:e.elevation,height:e.size,outlined:e.outlined,plain:e.plain,raised:e.raised,tile:e.tile,value:n,width:e.size,"min-width":"auto"},on:{click:function(f){return e.onSwatchClick(f)}}},[n===e.modelValue?o("v-icon",{attrs:{size:e.iconSize,color:n!=="transparent"?n:void 0}},[e._v(" "+e._s(e.icon)+" ")]):e._e()],1)}),1)}),0)},w=[],S=m(y,V,w,!1,null,null,null,null);const _=S.exports,g=a=>a.component("VSwatches",_);return typeof window<"u"&&window.Vue&&window.Vue.use(_),u.default=_,u.install=g,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),u}({},VueDemi,Vuetify,colors);
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);