vuetify-swatches 1.0.5 → 1.0.7

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/Meta.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // This file is auto-generated by the build system.
2
2
  const meta = {
3
- version: '1.0.4',
4
- date: '2023-01-19T12:01:47.957Z',
3
+ version: '1.0.7',
4
+ date: '2023-02-15T10:55:52.738Z',
5
5
  };
6
6
  export default meta;
package/dist/index.es.js CHANGED
@@ -5,22 +5,26 @@
5
5
  * @author Logue <logue@hotmail.co.jp>
6
6
  * @copyright 2022-2023 By Masashi Yoshikawa All rights reserved.
7
7
  * @license MIT
8
- * @version 1.0.4
8
+ * @version 1.0.7
9
9
  * @see {@link https://github.com/logue/vuetify-swatches}
10
10
  */
11
11
 
12
12
  import { VSheet, VBtn, VIcon } from 'vuetify/lib';
13
- import { defineComponent, ref } from 'vue-demi';
13
+ import { defineComponent, ref, watch } from 'vue-demi';
14
14
  import colors from 'vuetify/lib/util/colors';
15
15
 
16
16
  var _sfc_main = defineComponent({
17
+ /** Component name */
17
18
  name: "VSwatches",
19
+ /** Model Definition */
18
20
  model: {
19
21
  prop: "modelValue",
20
22
  event: "update:modelValue"
21
23
  },
22
24
  props: {
25
+ /** Model value */
23
26
  modelValue: { type: String, default: "#ffffff" },
27
+ /** Swatch colors */
24
28
  swatches: {
25
29
  type: Array,
26
30
  default: () => [
@@ -48,28 +52,83 @@ var _sfc_main = defineComponent({
48
52
  [colors.brown.base, colors.blueGrey.base, colors.grey.base]
49
53
  ]
50
54
  },
55
+ /** Swatch sized */
51
56
  size: { type: String, default: "2rem" },
57
+ /** Selected icon */
52
58
  icon: { type: String, default: "mdi-checkbox-marked-circle" },
59
+ /** selected icon size */
53
60
  iconSize: { type: String, default: "1rem" },
61
+ /**
62
+ * Removes the button box shadow.
63
+ *
64
+ * @see {@link https://vuetifyjs.com/en/components/buttons/#depressed}
65
+ */
54
66
  depressed: { type: Boolean, default: false },
67
+ /**
68
+ * Removes the ability to click or target the component.
69
+ *
70
+ * @see {@link https://vuetifyjs.com/en/api/v-btn/#props-disabled}
71
+ */
55
72
  disabled: { type: Boolean, default: false },
73
+ /**
74
+ * Designates an elevation applied to the component between 0 and 24.
75
+ *
76
+ * @see {@link https://vuetifyjs.com/en/api/v-btn/#props-elevation}
77
+ */
56
78
  elevation: { type: [Number, String], default: void 0 },
79
+ /**
80
+ * Makes the background transparent and applies a thin border.
81
+ *
82
+ * @see {@link https://vuetifyjs.com/en/components/buttons/#outlined}
83
+ */
57
84
  outlined: { type: Boolean, default: false },
85
+ /**
86
+ * Removes the default background change applied when hovering over the button.
87
+ *
88
+ * @see {@link https://vuetifyjs.com/en/components/buttons/#plain}
89
+ */
58
90
  plain: { type: Boolean, default: false },
91
+ /**
92
+ * Raised buttons have a box shadow that increases when clicked. This is the default style.
93
+ *
94
+ * @see {@link https://vuetifyjs.com/en/components/buttons/#raised}
95
+ */
59
96
  raised: { type: Boolean, default: true },
97
+ /**
98
+ * Applies a large border radius on the button.
99
+ *
100
+ * @see {@link https://vuetifyjs.com/en/components/buttons/#rounded}
101
+ */
60
102
  rounded: { type: Boolean, default: false },
103
+ /**
104
+ * Removes the component’s border-radius.
105
+ *
106
+ * @see {@link https://vuetifyjs.com/en/components/buttons/#tile}
107
+ */
61
108
  tile: { type: Boolean, default: false }
62
109
  },
110
+ /** Emits */
63
111
  emits: ["update:modelValue"],
112
+ /**
113
+ * Setup
114
+ *
115
+ * @param props - Props
116
+ * @param context - Context
117
+ */
64
118
  setup(props, context) {
65
119
  const checkedVisibilty = ref(false);
120
+ const selected = ref(props.modelValue);
66
121
  const onSwatchClick = (e) => {
67
122
  const value = e.target.value;
68
123
  if (!value || props.modelValue === value) {
69
124
  return;
70
125
  }
71
- context.emit("update:modelValue", value);
126
+ selected.value = value;
72
127
  };
128
+ watch(
129
+ () => selected.value,
130
+ (value) => context.emit("update:modelValue", value)
131
+ );
73
132
  return {
74
133
  checkedVisibilty,
75
134
  onSwatchClick
@@ -196,8 +255,8 @@ var __component__ = /* @__PURE__ */ normalizeComponent(
196
255
  var VSwatches = __component__.exports;
197
256
 
198
257
  const meta = {
199
- version: "1.0.4",
200
- date: "2023-01-19T12:01:47.957Z"
258
+ version: "1.0.7",
259
+ date: "2023-02-15T10:53:18.492Z"
201
260
  };
202
261
 
203
262
  const installVSwatches = (app) => app.component("VSwatches", VSwatches);
@@ -5,7 +5,7 @@
5
5
  * @author Logue <logue@hotmail.co.jp>
6
6
  * @copyright 2022-2023 By Masashi Yoshikawa All rights reserved.
7
7
  * @license MIT
8
- * @version 1.0.4
8
+ * @version 1.0.7
9
9
  * @see {@link https://github.com/logue/vuetify-swatches}
10
10
  */
11
11
 
@@ -17,13 +17,17 @@ var VSwatches = (function (exports, lib, vueDemi, colors) {
17
17
  var colors__default = /*#__PURE__*/_interopDefaultCompat(colors);
18
18
 
19
19
  var _sfc_main = vueDemi.defineComponent({
20
+ /** Component name */
20
21
  name: "VSwatches",
22
+ /** Model Definition */
21
23
  model: {
22
24
  prop: "modelValue",
23
25
  event: "update:modelValue"
24
26
  },
25
27
  props: {
28
+ /** Model value */
26
29
  modelValue: { type: String, default: "#ffffff" },
30
+ /** Swatch colors */
27
31
  swatches: {
28
32
  type: Array,
29
33
  default: () => [
@@ -51,28 +55,83 @@ var VSwatches = (function (exports, lib, vueDemi, colors) {
51
55
  [colors__default["default"].brown.base, colors__default["default"].blueGrey.base, colors__default["default"].grey.base]
52
56
  ]
53
57
  },
58
+ /** Swatch sized */
54
59
  size: { type: String, default: "2rem" },
60
+ /** Selected icon */
55
61
  icon: { type: String, default: "mdi-checkbox-marked-circle" },
62
+ /** selected icon size */
56
63
  iconSize: { type: String, default: "1rem" },
64
+ /**
65
+ * Removes the button box shadow.
66
+ *
67
+ * @see {@link https://vuetifyjs.com/en/components/buttons/#depressed}
68
+ */
57
69
  depressed: { type: Boolean, default: false },
70
+ /**
71
+ * Removes the ability to click or target the component.
72
+ *
73
+ * @see {@link https://vuetifyjs.com/en/api/v-btn/#props-disabled}
74
+ */
58
75
  disabled: { type: Boolean, default: false },
76
+ /**
77
+ * Designates an elevation applied to the component between 0 and 24.
78
+ *
79
+ * @see {@link https://vuetifyjs.com/en/api/v-btn/#props-elevation}
80
+ */
59
81
  elevation: { type: [Number, String], default: void 0 },
82
+ /**
83
+ * Makes the background transparent and applies a thin border.
84
+ *
85
+ * @see {@link https://vuetifyjs.com/en/components/buttons/#outlined}
86
+ */
60
87
  outlined: { type: Boolean, default: false },
88
+ /**
89
+ * Removes the default background change applied when hovering over the button.
90
+ *
91
+ * @see {@link https://vuetifyjs.com/en/components/buttons/#plain}
92
+ */
61
93
  plain: { type: Boolean, default: false },
94
+ /**
95
+ * Raised buttons have a box shadow that increases when clicked. This is the default style.
96
+ *
97
+ * @see {@link https://vuetifyjs.com/en/components/buttons/#raised}
98
+ */
62
99
  raised: { type: Boolean, default: true },
100
+ /**
101
+ * Applies a large border radius on the button.
102
+ *
103
+ * @see {@link https://vuetifyjs.com/en/components/buttons/#rounded}
104
+ */
63
105
  rounded: { type: Boolean, default: false },
106
+ /**
107
+ * Removes the component’s border-radius.
108
+ *
109
+ * @see {@link https://vuetifyjs.com/en/components/buttons/#tile}
110
+ */
64
111
  tile: { type: Boolean, default: false }
65
112
  },
113
+ /** Emits */
66
114
  emits: ["update:modelValue"],
115
+ /**
116
+ * Setup
117
+ *
118
+ * @param props - Props
119
+ * @param context - Context
120
+ */
67
121
  setup(props, context) {
68
122
  const checkedVisibilty = vueDemi.ref(false);
123
+ const selected = vueDemi.ref(props.modelValue);
69
124
  const onSwatchClick = (e) => {
70
125
  const value = e.target.value;
71
126
  if (!value || props.modelValue === value) {
72
127
  return;
73
128
  }
74
- context.emit("update:modelValue", value);
129
+ selected.value = value;
75
130
  };
131
+ vueDemi.watch(
132
+ () => selected.value,
133
+ (value) => context.emit("update:modelValue", value)
134
+ );
76
135
  return {
77
136
  checkedVisibilty,
78
137
  onSwatchClick
@@ -199,8 +258,8 @@ var VSwatches = (function (exports, lib, vueDemi, colors) {
199
258
  var VSwatches = __component__.exports;
200
259
 
201
260
  const meta = {
202
- version: "1.0.4",
203
- date: "2023-01-19T12:01:47.957Z"
261
+ version: "1.0.7",
262
+ date: "2023-02-15T10:53:18.492Z"
204
263
  };
205
264
 
206
265
  const installVSwatches = (app) => app.component("VSwatches", VSwatches);
package/dist/index.umd.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * @author Logue <logue@hotmail.co.jp>
6
6
  * @copyright 2022-2023 By Masashi Yoshikawa All rights reserved.
7
7
  * @license MIT
8
- * @version 1.0.4
8
+ * @version 1.0.7
9
9
  * @see {@link https://github.com/logue/vuetify-swatches}
10
10
  */
11
11
 
@@ -20,13 +20,17 @@
20
20
  var colors__default = /*#__PURE__*/_interopDefaultCompat(colors);
21
21
 
22
22
  var _sfc_main = vueDemi.defineComponent({
23
+ /** Component name */
23
24
  name: "VSwatches",
25
+ /** Model Definition */
24
26
  model: {
25
27
  prop: "modelValue",
26
28
  event: "update:modelValue"
27
29
  },
28
30
  props: {
31
+ /** Model value */
29
32
  modelValue: { type: String, default: "#ffffff" },
33
+ /** Swatch colors */
30
34
  swatches: {
31
35
  type: Array,
32
36
  default: () => [
@@ -54,28 +58,83 @@
54
58
  [colors__default["default"].brown.base, colors__default["default"].blueGrey.base, colors__default["default"].grey.base]
55
59
  ]
56
60
  },
61
+ /** Swatch sized */
57
62
  size: { type: String, default: "2rem" },
63
+ /** Selected icon */
58
64
  icon: { type: String, default: "mdi-checkbox-marked-circle" },
65
+ /** selected icon size */
59
66
  iconSize: { type: String, default: "1rem" },
67
+ /**
68
+ * Removes the button box shadow.
69
+ *
70
+ * @see {@link https://vuetifyjs.com/en/components/buttons/#depressed}
71
+ */
60
72
  depressed: { type: Boolean, default: false },
73
+ /**
74
+ * Removes the ability to click or target the component.
75
+ *
76
+ * @see {@link https://vuetifyjs.com/en/api/v-btn/#props-disabled}
77
+ */
61
78
  disabled: { type: Boolean, default: false },
79
+ /**
80
+ * Designates an elevation applied to the component between 0 and 24.
81
+ *
82
+ * @see {@link https://vuetifyjs.com/en/api/v-btn/#props-elevation}
83
+ */
62
84
  elevation: { type: [Number, String], default: void 0 },
85
+ /**
86
+ * Makes the background transparent and applies a thin border.
87
+ *
88
+ * @see {@link https://vuetifyjs.com/en/components/buttons/#outlined}
89
+ */
63
90
  outlined: { type: Boolean, default: false },
91
+ /**
92
+ * Removes the default background change applied when hovering over the button.
93
+ *
94
+ * @see {@link https://vuetifyjs.com/en/components/buttons/#plain}
95
+ */
64
96
  plain: { type: Boolean, default: false },
97
+ /**
98
+ * Raised buttons have a box shadow that increases when clicked. This is the default style.
99
+ *
100
+ * @see {@link https://vuetifyjs.com/en/components/buttons/#raised}
101
+ */
65
102
  raised: { type: Boolean, default: true },
103
+ /**
104
+ * Applies a large border radius on the button.
105
+ *
106
+ * @see {@link https://vuetifyjs.com/en/components/buttons/#rounded}
107
+ */
66
108
  rounded: { type: Boolean, default: false },
109
+ /**
110
+ * Removes the component’s border-radius.
111
+ *
112
+ * @see {@link https://vuetifyjs.com/en/components/buttons/#tile}
113
+ */
67
114
  tile: { type: Boolean, default: false }
68
115
  },
116
+ /** Emits */
69
117
  emits: ["update:modelValue"],
118
+ /**
119
+ * Setup
120
+ *
121
+ * @param props - Props
122
+ * @param context - Context
123
+ */
70
124
  setup(props, context) {
71
125
  const checkedVisibilty = vueDemi.ref(false);
126
+ const selected = vueDemi.ref(props.modelValue);
72
127
  const onSwatchClick = (e) => {
73
128
  const value = e.target.value;
74
129
  if (!value || props.modelValue === value) {
75
130
  return;
76
131
  }
77
- context.emit("update:modelValue", value);
132
+ selected.value = value;
78
133
  };
134
+ vueDemi.watch(
135
+ () => selected.value,
136
+ (value) => context.emit("update:modelValue", value)
137
+ );
79
138
  return {
80
139
  checkedVisibilty,
81
140
  onSwatchClick
@@ -202,8 +261,8 @@
202
261
  var VSwatches = __component__.exports;
203
262
 
204
263
  const meta = {
205
- version: "1.0.4",
206
- date: "2023-01-19T12:01:47.957Z"
264
+ version: "1.0.7",
265
+ date: "2023-02-15T10:53:18.492Z"
207
266
  };
208
267
 
209
268
  const installVSwatches = (app) => app.component("VSwatches", VSwatches);
package/dist/style.css CHANGED
@@ -5,7 +5,7 @@
5
5
  * @author Logue <logue@hotmail.co.jp>
6
6
  * @copyright 2022-2023 By Masashi Yoshikawa All rights reserved.
7
7
  * @license MIT
8
- * @version 1.0.4
8
+ * @version 1.0.7
9
9
  * @see {@link https://github.com/logue/vuetify-swatches}
10
10
  */
11
11
 
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.0.5",
4
+ "version": "1.0.7",
5
5
  "license": "MIT",
6
6
  "description": "Color Swatch component for Vuetify.",
7
7
  "keywords": [
@@ -54,10 +54,10 @@
54
54
  ],
55
55
  "sideEffects": false,
56
56
  "engines": {
57
- "node": ">=18.12.1",
57
+ "node": ">=18.14.0",
58
58
  "yarn": ">=1.22.19"
59
59
  },
60
- "packageManager": "yarn@3.3.1",
60
+ "packageManager": "yarn@3.4.1",
61
61
  "scripts": {
62
62
  "dev": "vite",
63
63
  "clean": "rimraf node_modules/.vite",
@@ -87,45 +87,45 @@
87
87
  }
88
88
  },
89
89
  "devDependencies": {
90
- "@codemirror/lang-html": "^6.4.1",
90
+ "@codemirror/lang-vue": "^0.1.1",
91
91
  "@types/lodash": "^4.14.191",
92
- "@types/node": "^18.11.18",
93
- "@typescript-eslint/eslint-plugin": "^5.48.2",
94
- "@typescript-eslint/parser": "^5.48.2",
92
+ "@types/node": "^18.13.0",
93
+ "@typescript-eslint/eslint-plugin": "^5.52.0",
94
+ "@typescript-eslint/parser": "^5.52.0",
95
95
  "@vitejs/plugin-vue2": "^2.2.0",
96
96
  "@vue/eslint-config-prettier": "^7.0.0",
97
97
  "@vue/tsconfig": "^0.1.3",
98
- "eslint": "^8.32.0",
98
+ "eslint": "^8.34.0",
99
99
  "eslint-config-google": "^0.14.0",
100
100
  "eslint-config-prettier": "^8.6.0",
101
101
  "eslint-import-resolver-alias": "^1.1.2",
102
102
  "eslint-import-resolver-typescript": "^3.5.3",
103
103
  "eslint-plugin-import": "^2.27.5",
104
- "eslint-plugin-jsdoc": "^39.6.6",
104
+ "eslint-plugin-jsdoc": "^40.0.0",
105
105
  "eslint-plugin-prettier": "^4.2.1",
106
106
  "eslint-plugin-tsdoc": "^0.2.17",
107
107
  "eslint-plugin-vue": "^9.9.0",
108
108
  "eslint-plugin-vuejs-accessibility": "^2.1.0",
109
109
  "eslint-plugin-vuetify": "^1.1.0",
110
110
  "husky": "^8.0.3",
111
- "lint-staged": "^13.1.0",
111
+ "lint-staged": "^13.1.2",
112
112
  "npm-run-all": "^4.1.5",
113
113
  "postcss-html": "^1.5.0",
114
- "prettier": "^2.8.3",
115
- "rimraf": "^4.1.1",
114
+ "prettier": "^2.8.4",
115
+ "rimraf": "^4.1.2",
116
116
  "rollup-plugin-visualizer": "^5.9.0",
117
117
  "sass": "1.32.12",
118
- "stylelint": "^14.16.1",
119
- "stylelint-config-prettier": "^9.0.4",
120
- "stylelint-config-recommended-scss": "^8.0.0",
118
+ "stylelint": "^15.1.0",
119
+ "stylelint-config-prettier": "^9.0.5",
120
+ "stylelint-config-recommended-scss": "^9.0.1",
121
121
  "stylelint-config-recommended-vue": "^1.4.0",
122
- "typescript": "^4.9.4",
123
- "unplugin-vue-components": "^0.22.12",
124
- "vite": "^4.0.4",
122
+ "typescript": "^4.9.5",
123
+ "unplugin-vue-components": "^0.23.0",
124
+ "vite": "^4.1.1",
125
125
  "vite-plugin-banner": "^0.7.0",
126
- "vite-plugin-checker": "^0.5.3",
126
+ "vite-plugin-checker": "^0.5.5",
127
127
  "vue": "^2.7.13",
128
- "vue-codemirror6": "^1.1.6",
128
+ "vue-codemirror6": "^1.1.11",
129
129
  "vue-eslint-parser": "^9.1.0",
130
130
  "vue-tsc": "^1.0.24",
131
131
  "vuetify": "^2.6.14"
@@ -136,12 +136,12 @@
136
136
  }
137
137
  },
138
138
  "lint-staged": {
139
- "*.vue": "vue-tsc --noEmit",
140
139
  "*.{js,ts,json,yml,yaml,vue,htm,html}": "eslint --fix --cache --cache-location ./node_modules/.vite/vite-plugin-eslint",
141
140
  "*.{css,sass,scss,vue,htm,html}": "stylelint --fix --cache --cache-location ./node_modules/.vite/vite-plugin-stylelint",
142
141
  "*": "prettier -w -u"
143
142
  },
144
143
  "resolutions": {
145
- "json5": "^2.2.3"
144
+ "json5": "^2.2.3",
145
+ "http-cache-semantics": "^4.1.1"
146
146
  }
147
147
  }
@@ -34,6 +34,7 @@
34
34
  import {
35
35
  defineComponent,
36
36
  ref,
37
+ watch,
37
38
  type PropType,
38
39
  type Ref,
39
40
  type SetupContext,
@@ -148,19 +149,27 @@ export default defineComponent({
148
149
  /** Check icon visibility */
149
150
  const checkedVisibilty: Ref<boolean> = ref(false);
150
151
 
152
+ /** Selected Color */
153
+ const selected: Ref<string> = ref(props.modelValue);
154
+
151
155
  /**
152
156
  * Swatch button clicked handler
153
157
  *
154
158
  * @param e - Event
155
159
  */
156
- const onSwatchClick = (e: Event) => {
160
+ const onSwatchClick = (e: PointerEvent) => {
157
161
  const value = (e.target as HTMLButtonElement).value;
158
162
  if (!value || props.modelValue === value) {
159
163
  return;
160
164
  }
161
- context.emit('update:modelValue', value);
165
+ selected.value = value;
162
166
  };
163
167
 
168
+ watch(
169
+ () => selected.value,
170
+ value => context.emit('update:modelValue', value)
171
+ );
172
+
164
173
  return {
165
174
  checkedVisibilty,
166
175
  onSwatchClick,