vuetify-swatches 0.0.11 → 0.0.12

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/dist/index.es.js CHANGED
@@ -9,15 +9,15 @@
9
9
  * @see {@link https://github.com/logue/vuetify-swatches}
10
10
  */
11
11
 
12
- import { VSheet, VBtn, VIcon } from "vuetify/lib";
13
- import { defineComponent, ref } from "vue";
14
- import colors from "vuetify/lib/util/colors";
15
- var _sfc_main = defineComponent({
12
+ import { defineComponent as b, ref as v } from "vue";
13
+ import { VSheet as w, VBtn as V, VIcon as y } from "vuetify/lib/components";
14
+ import e from "vuetify/lib/util/colors";
15
+ const S = b({
16
16
  name: "VSwatches",
17
17
  components: {
18
- VSheet,
19
- VBtn,
20
- VIcon
18
+ VSheet: w,
19
+ VBtn: V,
20
+ VIcon: y
21
21
  },
22
22
  model: {
23
23
  prop: "modelValue",
@@ -28,28 +28,28 @@ var _sfc_main = defineComponent({
28
28
  swatches: {
29
29
  type: Array,
30
30
  default: () => [
31
- [colors.shades.black, colors.shades.white],
31
+ [e.shades.black, e.shades.white],
32
32
  [
33
- colors.red.base,
34
- colors.pink.base,
35
- colors.purple.base,
36
- colors.deepPurple.base,
37
- colors.indigo.base,
38
- colors.blue.base,
39
- colors.lightBlue.base,
40
- colors.cyan.base
33
+ e.red.base,
34
+ e.pink.base,
35
+ e.purple.base,
36
+ e.deepPurple.base,
37
+ e.indigo.base,
38
+ e.blue.base,
39
+ e.lightBlue.base,
40
+ e.cyan.base
41
41
  ],
42
42
  [
43
- colors.teal.base,
44
- colors.green.base,
45
- colors.lightGreen.base,
46
- colors.lime.base,
47
- colors.yellow.base,
48
- colors.amber.base,
49
- colors.orange.base,
50
- colors.deepOrange.base
43
+ e.teal.base,
44
+ e.green.base,
45
+ e.lightGreen.base,
46
+ e.lime.base,
47
+ e.yellow.base,
48
+ e.amber.base,
49
+ e.orange.base,
50
+ e.deepOrange.base
51
51
  ],
52
- [colors.brown.base, colors.blueGrey.base, colors.grey.base]
52
+ [e.brown.base, e.blueGrey.base, e.grey.base]
53
53
  ]
54
54
  },
55
55
  elevation: { type: Number, default: 1 },
@@ -58,89 +58,53 @@ var _sfc_main = defineComponent({
58
58
  iconSize: { type: String, default: "1rem" }
59
59
  },
60
60
  emits: ["update:modelValue"],
61
- setup(props, context) {
62
- const checkedVisibilty = ref(false);
63
- const onSwatchClick = (e) => {
64
- const value = e.target.value;
65
- if (!value || props.modelValue === value) {
66
- return;
67
- }
68
- context.emit("update:modelValue", value);
69
- };
61
+ setup(s, t) {
70
62
  return {
71
- checkedVisibilty,
72
- onSwatchClick
73
- };
74
- }
75
- });
76
- var VSwatches_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".v-swatches .v-btn{padding:0!important;margin:.1rem}.v-swatches .v-btn .v-icon{filter:invert(100%)}\n")();
77
- function normalizeComponent(scriptExports, render2, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
78
- var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
79
- if (render2) {
80
- options.render = render2;
81
- options.staticRenderFns = staticRenderFns;
82
- options._compiled = true;
83
- }
84
- if (functionalTemplate) {
85
- options.functional = true;
86
- }
87
- if (scopeId) {
88
- options._scopeId = "data-v-" + scopeId;
89
- }
90
- var hook;
91
- if (moduleIdentifier) {
92
- hook = function(context) {
93
- context = context || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
94
- if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") {
95
- context = __VUE_SSR_CONTEXT__;
96
- }
97
- if (injectStyles) {
98
- injectStyles.call(this, context);
99
- }
100
- if (context && context._registeredComponents) {
101
- context._registeredComponents.add(moduleIdentifier);
63
+ checkedVisibilty: v(!1),
64
+ onSwatchClick: (i) => {
65
+ const a = i.target.value;
66
+ !a || s.modelValue === a || t.emit("update:modelValue", a);
102
67
  }
103
68
  };
104
- options._ssrRegister = hook;
105
- } else if (injectStyles) {
106
- hook = shadowMode ? function() {
107
- injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot);
108
- } : injectStyles;
109
69
  }
110
- if (hook) {
111
- if (options.functional) {
112
- options._injectStyles = hook;
113
- var originalRender = options.render;
114
- options.render = function renderWithStyleInjection(h, context) {
115
- hook.call(context);
116
- return originalRender(h, context);
70
+ });
71
+ function g(s, t, l, u, i, a, d, p) {
72
+ var n = typeof s == "function" ? s.options : s;
73
+ t && (n.render = t, n.staticRenderFns = l, n._compiled = !0), u && (n.functional = !0), a && (n._scopeId = "data-v-" + a);
74
+ var r;
75
+ if (d ? (r = function(o) {
76
+ o = o || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !o && typeof __VUE_SSR_CONTEXT__ < "u" && (o = __VUE_SSR_CONTEXT__), i && i.call(this, o), o && o._registeredComponents && o._registeredComponents.add(d);
77
+ }, n._ssrRegister = r) : i && (r = p ? function() {
78
+ i.call(this, (n.functional ? this.parent : this).$root.$options.shadowRoot);
79
+ } : i), r)
80
+ if (n.functional) {
81
+ n._injectStyles = r;
82
+ var h = n.render;
83
+ n.render = function(m, c) {
84
+ return r.call(c), h(m, c);
117
85
  };
118
86
  } else {
119
- var existing = options.beforeCreate;
120
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
87
+ var f = n.beforeCreate;
88
+ n.beforeCreate = f ? [].concat(f, r) : [r];
121
89
  }
122
- }
123
90
  return {
124
- exports: scriptExports,
125
- options
91
+ exports: s,
92
+ options: n
126
93
  };
127
94
  }
128
- var _sfc_render = function render() {
129
- var _vm = this, _c = _vm._self._c;
130
- _vm._self._setupProxy;
131
- return _c(VSheet, { staticClass: "v-swatches" }, _vm._l(_vm.swatches, function(colors2, rows) {
132
- return _c("div", { key: rows }, _vm._l(colors2, function(color) {
133
- return _c(VBtn, { key: color, attrs: { "elevation": _vm.elevation, "width": _vm.size, "height": _vm.size, "color": color, "value": color, "min-width": "auto" }, on: { "click": function($event) {
134
- return _vm.onSwatchClick($event);
135
- } } }, [color === _vm.modelValue ? _c(VIcon, { attrs: { "size": _vm.iconSize, "color": color } }, [_vm._v(" " + _vm._s(_vm.icon) + " ")]) : _vm._e()], 1);
95
+ var C = function() {
96
+ var t = this, l = t._self._c;
97
+ return t._self._setupProxy, l("v-sheet", { staticClass: "v-swatches" }, t._l(t.swatches, function(u, i) {
98
+ return l("div", { key: i }, t._l(u, function(a) {
99
+ return l("v-btn", { key: a, attrs: { elevation: t.elevation, width: t.size, height: t.size, color: a, value: a, "min-width": "auto" }, on: { click: function(d) {
100
+ return t.onSwatchClick(d);
101
+ } } }, [a === t.modelValue ? l("v-icon", { attrs: { size: t.iconSize, color: a } }, [t._v(" " + t._s(t.icon) + " ")]) : t._e()], 1);
136
102
  }), 1);
137
103
  }), 0);
104
+ }, k = [], z = /* @__PURE__ */ g(S, C, k, !1, null, null, null, null);
105
+ const _ = z.exports, N = (s) => s.component("VSwatches", _);
106
+ typeof window < "u" && window.Vue && window.Vue.use(_);
107
+ export {
108
+ _ as default,
109
+ N as install
138
110
  };
139
- var _sfc_staticRenderFns = [];
140
- var __component__ = /* @__PURE__ */ normalizeComponent(_sfc_main, _sfc_render, _sfc_staticRenderFns, false, null, null, null, null);
141
- var VSwatches = __component__.exports;
142
- const installVSwatches = (app) => app.component("VSwatches", VSwatches);
143
- if (typeof window !== "undefined" && window.Vue) {
144
- window.Vue.use(VSwatches);
145
- }
146
- export { VSwatches as default, installVSwatches as install };
package/dist/index.umd.js CHANGED
@@ -9,5 +9,4 @@
9
9
  * @see {@link https://github.com/logue/vuetify-swatches}
10
10
  */
11
11
 
12
- (function(u,l){typeof exports=="object"&&typeof module<"u"?l(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"],l):(u=typeof globalThis<"u"?globalThis:u||self,l(u.VSwatches={},u.Vuetify,u.Vue,u.colors))})(this,function(u,l,p,m){"use strict";function b(n){return n&&typeof n=="object"&&"default"in n?n:{default:n}}var e=b(m),V=p.defineComponent({name:"VSwatches",components:{VSheet:l.VSheet,VBtn:l.VBtn,VIcon:l.VIcon},model:{prop:"modelValue",event:"update:modelValue"},props:{modelValue:{type:String,default:"#ffffff"},swatches:{type:Array,default:()=>[[e.default.shades.black,e.default.shades.white],[e.default.red.base,e.default.pink.base,e.default.purple.base,e.default.deepPurple.base,e.default.indigo.base,e.default.blue.base,e.default.lightBlue.base,e.default.cyan.base],[e.default.teal.base,e.default.green.base,e.default.lightGreen.base,e.default.lime.base,e.default.yellow.base,e.default.amber.base,e.default.orange.base,e.default.deepOrange.base],[e.default.brown.base,e.default.blueGrey.base,e.default.grey.base]]},elevation:{type:Number,default:1},size:{type:String,default:"2rem"},icon:{type:String,default:"mdi-checkbox-marked-circle"},iconSize:{type:String,default:"1rem"}},emits:["update:modelValue"],setup(n,t){return{checkedVisibilty:p.ref(!1),onSwatchClick:s=>{const i=s.target.value;!i||n.modelValue===i||t.emit("update:modelValue",i)}}}}),R=(()=>`.v-swatches .v-btn{padding:0!important;margin:.1rem}.v-swatches .v-btn .v-icon{filter:invert(100%)}
13
- `)();function y(n,t,f,d,s,i,c,k){var a=typeof n=="function"?n.options:n;t&&(a.render=t,a.staticRenderFns=f,a._compiled=!0),d&&(a.functional=!0),i&&(a._scopeId="data-v-"+i);var r;if(c?(r=function(o){o=o||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!o&&typeof __VUE_SSR_CONTEXT__<"u"&&(o=__VUE_SSR_CONTEXT__),s&&s.call(this,o),o&&o._registeredComponents&&o._registeredComponents.add(c)},a._ssrRegister=r):s&&(r=k?function(){s.call(this,(a.functional?this.parent:this).$root.$options.shadowRoot)}:s),r)if(a.functional){a._injectStyles=r;var z=a.render;a.render=function(T,v){return r.call(v),z(T,v)}}else{var h=a.beforeCreate;a.beforeCreate=h?[].concat(h,r):[r]}return{exports:n,options:a}}var w=function(){var t=this,f=t._self._c;return t._self._setupProxy,f(l.VSheet,{staticClass:"v-swatches"},t._l(t.swatches,function(d,s){return f("div",{key:s},t._l(d,function(i){return f(l.VBtn,{key:i,attrs:{elevation:t.elevation,width:t.size,height:t.size,color:i,value:i,"min-width":"auto"},on:{click:function(c){return t.onSwatchClick(c)}}},[i===t.modelValue?f(l.VIcon,{attrs:{size:t.iconSize,color:i}},[t._v(" "+t._s(t.icon)+" ")]):t._e()],1)}),1)}),0)},S=[],g=y(V,w,S,!1,null,null,null,null),_=g.exports;const C=n=>n.component("VSwatches",_);typeof window<"u"&&window.Vue&&window.Vue.use(_),u.default=_,u.install=C,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
12
+ (function(l,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("vuetify/lib/components"),require("vuetify/lib/util/colors")):typeof define=="function"&&define.amd?define(["exports","vue","vuetify/lib/components","vuetify/lib/util/colors"],r):(l=typeof globalThis<"u"?globalThis:l||self,r(l.VSwatches={},l.Vue,l.Vuetify,l.colors))})(this,function(l,r,_,v){"use strict";const e=(n=>n&&typeof n=="object"&&"default"in n?n:{default:n})(v),m=r.defineComponent({name:"VSwatches",components:{VSheet:_.VSheet,VBtn:_.VBtn,VIcon:_.VIcon},model:{prop:"modelValue",event:"update:modelValue"},props:{modelValue:{type:String,default:"#ffffff"},swatches:{type:Array,default:()=>[[e.default.shades.black,e.default.shades.white],[e.default.red.base,e.default.pink.base,e.default.purple.base,e.default.deepPurple.base,e.default.indigo.base,e.default.blue.base,e.default.lightBlue.base,e.default.cyan.base],[e.default.teal.base,e.default.green.base,e.default.lightGreen.base,e.default.lime.base,e.default.yellow.base,e.default.amber.base,e.default.orange.base,e.default.deepOrange.base],[e.default.brown.base,e.default.blueGrey.base,e.default.grey.base]]},elevation:{type:Number,default:1},size:{type:String,default:"2rem"},icon:{type:String,default:"mdi-checkbox-marked-circle"},iconSize:{type:String,default:"1rem"}},emits:["update:modelValue"],setup(n,t){return{checkedVisibilty:r.ref(!1),onSwatchClick:u=>{const i=u.target.value;!i||n.modelValue===i||t.emit("update:modelValue",i)}}}}),R="";function y(n,t,f,d,u,i,c,C){var a=typeof n=="function"?n.options:n;t&&(a.render=t,a.staticRenderFns=f,a._compiled=!0),d&&(a.functional=!0),i&&(a._scopeId="data-v-"+i);var o;if(c?(o=function(s){s=s||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!s&&typeof __VUE_SSR_CONTEXT__<"u"&&(s=__VUE_SSR_CONTEXT__),u&&u.call(this,s),s&&s._registeredComponents&&s._registeredComponents.add(c)},a._ssrRegister=o):u&&(o=C?function(){u.call(this,(a.functional?this.parent:this).$root.$options.shadowRoot)}:u),o)if(a.functional){a._injectStyles=o;var k=a.render;a.render=function(z,b){return o.call(b),k(z,b)}}else{var h=a.beforeCreate;a.beforeCreate=h?[].concat(h,o):[o]}return{exports:n,options:a}}var V=function(){var t=this,f=t._self._c;return t._self._setupProxy,f("v-sheet",{staticClass:"v-swatches"},t._l(t.swatches,function(d,u){return f("div",{key:u},t._l(d,function(i){return f("v-btn",{key:i,attrs:{elevation:t.elevation,width:t.size,height:t.size,color:i,value:i,"min-width":"auto"},on:{click:function(c){return t.onSwatchClick(c)}}},[i===t.modelValue?f("v-icon",{attrs:{size:t.iconSize,color:i}},[t._v(" "+t._s(t.icon)+" ")]):t._e()],1)}),1)}),0)},w=[],S=y(m,V,w,!1,null,null,null,null);const p=S.exports,g=n=>n.component("VSwatches",p);typeof window<"u"&&window.Vue&&window.Vue.use(p),l.default=p,l.install=g,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "vuetify-swatches",
4
- "version": "0.0.11",
4
+ "version": "0.0.12",
5
+ "license": "MIT",
5
6
  "description": "Color Swatch component for Vuetify.",
6
7
  "keywords": [
7
8
  "vuejs",
@@ -29,16 +30,12 @@
29
30
  "bugs": {
30
31
  "url": "https://github.com/logue/vuetify-swatches/issues"
31
32
  },
32
- "engines": {
33
- "node": ">=16.15.0",
34
- "yarn": ">=1.22.4"
35
- },
36
- "packageManager": "yarn@3.2.1",
37
- "license": "MIT",
38
- "main": "./dist/index.umd.js",
39
- "module": "./dist/index.es.js",
33
+ "main": "dist/index.umd.js",
34
+ "module": "dist/index.es.js",
35
+ "types": "dist/index.d.ts",
36
+ "style": "dist/style.css",
40
37
  "browser": {
41
- "./sfc": "./src/components/VSwatches.vue"
38
+ "sfc": "src/components/VSwatches.vue"
42
39
  },
43
40
  "exports": {
44
41
  ".": {
@@ -50,12 +47,16 @@
50
47
  "require": "./dist/style.css"
51
48
  }
52
49
  },
53
- "types": "./dist/index.d.ts",
54
50
  "files": [
55
51
  "dist",
56
52
  "src/components/VSwatches.vue"
57
53
  ],
58
54
  "sideEffects": false,
55
+ "engines": {
56
+ "node": ">=16.15.0",
57
+ "yarn": ">=1.22.4"
58
+ },
59
+ "packageManager": "yarn@3.2.1",
59
60
  "scripts": {
60
61
  "dev": "vite",
61
62
  "clean": "rimraf node_modules/.vite ",
@@ -70,24 +71,25 @@
70
71
  "prepare": "husky install"
71
72
  },
72
73
  "peerDependencies": {
73
- "vue": "^2.7.3",
74
+ "vue": "^2.6.14",
74
75
  "vuetify": "^2.6.7"
75
76
  },
76
77
  "devDependencies": {
77
78
  "@codemirror/basic-setup": "^0.20.0",
78
79
  "@codemirror/lang-html": "^6.1.0",
79
- "@types/node": "^18.0.3",
80
- "@typescript-eslint/eslint-plugin": "^5.30.5",
81
- "@typescript-eslint/parser": "^5.30.5",
80
+ "@types/node": "^18.0.6",
81
+ "@typescript-eslint/eslint-plugin": "^5.30.7",
82
+ "@typescript-eslint/parser": "^5.30.7",
82
83
  "@vitejs/plugin-vue2": "^1.1.2",
83
84
  "@vue/eslint-config-prettier": "^7.0.0",
85
+ "@vue/tsconfig": "^0.1.3",
84
86
  "codemirror": "^6.0.1",
85
- "eslint": "^8.19.0",
87
+ "eslint": "^8.20.0",
86
88
  "eslint-config-google": "^0.14.0",
87
89
  "eslint-config-prettier": "^8.5.0",
88
90
  "eslint-import-resolver-alias": "^1.1.2",
89
- "eslint-import-resolver-typescript": "^3.2.4",
90
- "eslint-plugin-html": "^6.2.0",
91
+ "eslint-import-resolver-typescript": "^3.3.0",
92
+ "eslint-plugin-html": "^7.0.0",
91
93
  "eslint-plugin-import": "^2.26.0",
92
94
  "eslint-plugin-jsdoc": "^39.3.3",
93
95
  "eslint-plugin-tsdoc": "^0.2.16",
@@ -97,27 +99,27 @@
97
99
  "eslint-plugin-yaml": "^0.5.0",
98
100
  "husky": "^8.0.1",
99
101
  "lint-staged": "^13.0.3",
100
- "postcss-html": "^1.4.1",
102
+ "postcss-html": "^1.5.0",
101
103
  "prettier": "^2.7.1",
102
104
  "rimraf": "^3.0.2",
103
- "rollup-plugin-visualizer": "^5.6.0",
105
+ "rollup-plugin-visualizer": "^5.7.1",
104
106
  "sass": "1.32.12",
105
107
  "stylelint": "^14.9.1",
106
108
  "stylelint-config-prettier": "^9.0.3",
107
- "stylelint-config-recommended-scss": "^6.0.0",
109
+ "stylelint-config-recommended-scss": "^7.0.0",
108
110
  "stylelint-config-recommended-vue": "^1.4.0",
109
111
  "stylelint-order": "^5.0.0",
110
112
  "stylelint-prettier": "^2.0.0",
111
113
  "typescript": "^4.7.4",
112
114
  "unplugin-vue-components": "^0.21.1",
113
- "vite": "^2.9.13",
115
+ "vite": "^3.0.2",
114
116
  "vite-plugin-banner": "^0.3.0",
115
- "vite-plugin-checker": "^0.4.8",
116
- "vue": "^2.7.3",
117
- "vue-codemirror6": "0.6.6",
117
+ "vite-plugin-checker": "^0.4.9",
118
+ "vue": "^2.7.8",
119
+ "vue-codemirror6": "0.6.7",
118
120
  "vue-eslint-parser": "^9.0.3",
119
- "vue-template-compiler": "^2.7.3",
120
- "vue-tsc": "^0.38.2",
121
+ "vue-template-compiler": "^2.7.8",
122
+ "vue-tsc": "^0.39.0",
121
123
  "vuetify": "^2.6.7"
122
124
  },
123
125
  "husky": {
@@ -29,7 +29,7 @@ import {
29
29
  type SetupContext,
30
30
  } from 'vue';
31
31
 
32
- import { VSheet, VIcon, VBtn } from 'vuetify/lib';
32
+ import { VSheet, VIcon, VBtn } from 'vuetify/lib/components';
33
33
  import colors from 'vuetify/lib/util/colors';
34
34
 
35
35
  /** Vuetify Swatches */