vuetify-swatches 1.4.0 → 1.4.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/dist/index.es.js CHANGED
@@ -5,11 +5,11 @@
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.4.0
8
+ * @version 1.4.1
9
9
  * @see {@link https://github.com/logue/vuetify-swatches}
10
10
  */
11
11
 
12
- import { defineComponent, ref, watch, openBlock, createBlock, unref, withCtx, createElementBlock, Fragment, renderList, normalizeClass, createTextVNode, toDisplayString, createCommentVNode } from 'vue';
12
+ import { defineComponent, ref, watch, onMounted, openBlock, createBlock, unref, withCtx, createElementBlock, Fragment, renderList, normalizeClass, createTextVNode, toDisplayString, createCommentVNode } from 'vue';
13
13
  import { VSheet, VBtn, VIcon } from 'vuetify/components';
14
14
  import colors from 'vuetify/lib/util/colors.mjs';
15
15
 
@@ -112,12 +112,17 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
112
112
  },
113
113
  setup(__props, { emit: emits }) {
114
114
  const props = __props;
115
- const selected = ref(props.modelValue || colors.shades.white);
115
+ const selected = ref(colors.shades.white);
116
116
  const onSwatchClick = (e) => selected.value = e.target.value || colors.shades.white;
117
117
  watch(
118
118
  () => selected.value,
119
119
  (s) => emits("update:modelValue", s)
120
120
  );
121
+ onMounted(() => {
122
+ if (props.modelValue) {
123
+ selected.value = props.modelValue;
124
+ }
125
+ });
121
126
  return (_ctx, _cache) => {
122
127
  return openBlock(), createBlock(unref(VSheet), { class: "v-swatches" }, {
123
128
  default: withCtx(() => [
@@ -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.4.0
8
+ * @version 1.4.1
9
9
  * @see {@link https://github.com/logue/vuetify-swatches}
10
10
  */
11
11
 
@@ -115,12 +115,17 @@ var VSwatches = (function (exports, vue, components, colors) {
115
115
  },
116
116
  setup(__props, { emit: emits }) {
117
117
  const props = __props;
118
- const selected = vue.ref(props.modelValue || colors__default["default"].shades.white);
118
+ const selected = vue.ref(colors__default["default"].shades.white);
119
119
  const onSwatchClick = (e) => selected.value = e.target.value || colors__default["default"].shades.white;
120
120
  vue.watch(
121
121
  () => selected.value,
122
122
  (s) => emits("update:modelValue", s)
123
123
  );
124
+ vue.onMounted(() => {
125
+ if (props.modelValue) {
126
+ selected.value = props.modelValue;
127
+ }
128
+ });
124
129
  return (_ctx, _cache) => {
125
130
  return vue.openBlock(), vue.createBlock(vue.unref(components.VSheet), { class: "v-swatches" }, {
126
131
  default: vue.withCtx(() => [
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.4.0
8
+ * @version 1.4.1
9
9
  * @see {@link https://github.com/logue/vuetify-swatches}
10
10
  */
11
11
 
@@ -118,12 +118,17 @@
118
118
  },
119
119
  setup(__props, { emit: emits }) {
120
120
  const props = __props;
121
- const selected = vue.ref(props.modelValue || colors__default["default"].shades.white);
121
+ const selected = vue.ref(colors__default["default"].shades.white);
122
122
  const onSwatchClick = (e) => selected.value = e.target.value || colors__default["default"].shades.white;
123
123
  vue.watch(
124
124
  () => selected.value,
125
125
  (s) => emits("update:modelValue", s)
126
126
  );
127
+ vue.onMounted(() => {
128
+ if (props.modelValue) {
129
+ selected.value = props.modelValue;
130
+ }
131
+ });
127
132
  return (_ctx, _cache) => {
128
133
  return vue.openBlock(), vue.createBlock(vue.unref(components.VSheet), { class: "v-swatches" }, {
129
134
  default: vue.withCtx(() => [
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.4.0
8
+ * @version 1.4.1
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.4.0",
4
+ "version": "1.4.1",
5
5
  "description": "Color Swatch component for Vuetify3.",
6
6
  "keywords": [
7
7
  "vuejs",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "main": "dist/index.umd.js",
36
36
  "module": "dist/index.es.js",
37
- "types": "dist/src/index.d.ts",
37
+ "types": "dist/index.d.ts",
38
38
  "style": "dist/style.css",
39
39
  "browser": {
40
40
  "./sfc": "./src/components/VSwatches.vue"
@@ -43,7 +43,7 @@
43
43
  ".": {
44
44
  "import": "./dist/index.es.js",
45
45
  "require": "./dist/index.umd.js",
46
- "types": "./dist/src/index.d.ts"
46
+ "types": "./dist/index.d.ts"
47
47
  },
48
48
  "./dist/style.css": {
49
49
  "import": "./dist/style.css",
@@ -57,7 +57,7 @@
57
57
  "engines": {
58
58
  "yarn": ">=1.22.19"
59
59
  },
60
- "packageManager": "yarn@3.5.1",
60
+ "packageManager": "yarn@3.6.1",
61
61
  "sideEffects": false,
62
62
  "scripts": {
63
63
  "dev": "vite",
@@ -74,48 +74,48 @@
74
74
  "version": "auto-changelog -p && git add CHANGELOG.md"
75
75
  },
76
76
  "peerDependencies": {
77
- "vuetify": "^3.3.1"
77
+ "vuetify": "^3.3.11"
78
78
  },
79
79
  "devDependencies": {
80
- "@codemirror/lang-vue": "^0.1.1",
81
- "@tsconfig/node-lts": "^18.12.2",
82
- "@types/node": "^20.2.5",
83
- "@typescript-eslint/eslint-plugin": "^5.59.7",
84
- "@typescript-eslint/parser": "^5.59.7",
80
+ "@codemirror/lang-vue": "^0.1.2",
81
+ "@tsconfig/node-lts": "^18.12.3",
82
+ "@types/node": "^20.4.6",
83
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
84
+ "@typescript-eslint/parser": "^6.2.1",
85
85
  "@vitejs/plugin-vue": "^4.2.3",
86
- "@vue/eslint-config-prettier": "^7.1.0",
86
+ "@vue/eslint-config-prettier": "^8.0.0",
87
87
  "@vue/tsconfig": "^0.4.0",
88
- "eslint": "^8.41.0",
89
- "eslint-config-standard-with-typescript": "^34.0.1",
88
+ "eslint": "^8.46.0",
89
+ "eslint-config-standard-with-typescript": "^37.0.0",
90
90
  "eslint-import-resolver-alias": "^1.1.2",
91
91
  "eslint-import-resolver-typescript": "^3.5.5",
92
92
  "eslint-plugin-html": "^7.1.0",
93
- "eslint-plugin-import": "^2.27.5",
94
- "eslint-plugin-n": "^16.0.0",
93
+ "eslint-plugin-import": "^2.28.0",
94
+ "eslint-plugin-n": "^16.0.1",
95
95
  "eslint-plugin-promise": "^6.1.1",
96
96
  "eslint-plugin-tsdoc": "^0.2.17",
97
- "eslint-plugin-vue": "^9.14.1",
97
+ "eslint-plugin-vue": "^9.16.1",
98
98
  "eslint-plugin-vuejs-accessibility": "^2.1.0",
99
- "eslint-plugin-vuetify": "^2.0.1",
99
+ "eslint-plugin-vuetify": "^2.0.5",
100
100
  "eslint-plugin-yaml": "^0.5.0",
101
101
  "husky": "^8.0.3",
102
- "lint-staged": "^13.2.2",
102
+ "lint-staged": "^13.2.3",
103
103
  "npm-run-all": "^4.1.5",
104
- "prettier": "^2.8.8",
104
+ "prettier": "^3.0.0",
105
105
  "rimraf": "^5.0.1",
106
- "rollup-plugin-visualizer": "^5.9.0",
107
- "sass": "^1.62.1",
108
- "typescript": "^5.0.4",
109
- "vite": "^4.3.9",
106
+ "rollup-plugin-visualizer": "^5.9.2",
107
+ "sass": "^1.64.2",
108
+ "typescript": "^5.1.6",
109
+ "vite": "^4.4.8",
110
110
  "vite-plugin-banner": "^0.7.0",
111
- "vite-plugin-checker": "^0.6.0",
112
- "vite-plugin-dts": "^2.3.0",
111
+ "vite-plugin-checker": "^0.6.1",
112
+ "vite-plugin-dts": "^3.4.0",
113
113
  "vite-plugin-vuetify": "^1.0.2",
114
114
  "vue": "^3.3.4",
115
- "vue-codemirror6": "^1.1.21",
116
- "vue-eslint-parser": "^9.3.0",
117
- "vue-tsc": "^1.6.5",
118
- "vuetify": "^3.3.1"
115
+ "vue-codemirror6": "^1.1.24",
116
+ "vue-eslint-parser": "^9.3.1",
117
+ "vue-tsc": "^1.8.8",
118
+ "vuetify": "^3.3.11"
119
119
  },
120
120
  "husky": {
121
121
  "hooks": {
@@ -130,6 +130,7 @@
130
130
  "resolutions": {
131
131
  "http-cache-semantics": "^4.1.1",
132
132
  "json5": "^2.2.3",
133
+ "semver": "^7.5.2",
133
134
  "yaml": "^2.2.2"
134
135
  }
135
136
  }
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  /** Vuetify Swatches */
3
- import { ref, watch, type PropType, type Ref } from 'vue';
3
+ import { ref, watch, type PropType, type Ref, onMounted } from 'vue';
4
4
 
5
5
  import { VBtn, VIcon, VSheet } from 'vuetify/components';
6
6
  import colors from 'vuetify/lib/util/colors.mjs';
@@ -107,7 +107,7 @@ const props = defineProps({
107
107
  });
108
108
 
109
109
  /** Selected Color */
110
- const selected: Ref<string> = ref(props.modelValue || colors.shades.white);
110
+ const selected: Ref<string> = ref(colors.shades.white);
111
111
 
112
112
  /**
113
113
  * Swatch button clicked handler
@@ -122,6 +122,12 @@ watch(
122
122
  () => selected.value,
123
123
  s => emits('update:modelValue', s)
124
124
  );
125
+
126
+ onMounted(() => {
127
+ if (props.modelValue) {
128
+ selected.value = props.modelValue;
129
+ }
130
+ });
125
131
  </script>
126
132
 
127
133
  <template>
@@ -1,161 +0,0 @@
1
- import { type PropType } from 'vue';
2
- /** Emits */
3
- declare const _sfc_main: import("vue").DefineComponent<{
4
- /** Model value */
5
- modelValue: {
6
- type: StringConstructor;
7
- default: any;
8
- };
9
- /** Swatch colors */
10
- swatches: {
11
- type: PropType<string[] | string[][]>;
12
- default: () => any[][];
13
- };
14
- /** Swatch size */
15
- size: {
16
- type: StringConstructor;
17
- default: string;
18
- };
19
- /** Selected icon */
20
- icon: {
21
- type: StringConstructor;
22
- default: string;
23
- };
24
- /** selected icon size */
25
- iconSize: {
26
- type: StringConstructor;
27
- default: string;
28
- };
29
- /**
30
- * The variant prop gives you easy access to several different button styles..
31
- *
32
- * @see {@link https://vuetifyjs.com/en/components/buttons/#variant}
33
- */
34
- variant: {
35
- type: PropType<NonNullable<"flat" | "text" | "elevated" | "tonal" | "outlined" | "plain">>;
36
- default: undefined;
37
- };
38
- /**
39
- * Removes the ability to click or target the component.
40
- *
41
- * @see {@link https://vuetifyjs.com/en/api/v-btn/#props-disabled}
42
- */
43
- disabled: {
44
- type: BooleanConstructor;
45
- default: boolean;
46
- };
47
- /**
48
- * Applies a large border radius on the button.
49
- *
50
- * @see {@link https://vuetifyjs.com/en/components/buttons/#rounded}
51
- */
52
- rounded: {
53
- type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
54
- default: undefined;
55
- };
56
- /**
57
- * Applies border styles to component.
58
- *
59
- * @see {@link https://vuetifyjs.com/en/api/v-btn/#props-border}
60
- */
61
- border: {
62
- type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
63
- default: boolean;
64
- };
65
- /**
66
- * Designates an elevation applied to the component between 0 and 24.
67
- *
68
- * @see {@link https://vuetifyjs.com/en/api/v-btn/#props-elevation}
69
- */
70
- elevation: {
71
- type: (StringConstructor | NumberConstructor)[];
72
- default: undefined;
73
- };
74
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
75
- 'update:modelValue': (value: string) => true;
76
- }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
77
- /** Model value */
78
- modelValue: {
79
- type: StringConstructor;
80
- default: any;
81
- };
82
- /** Swatch colors */
83
- swatches: {
84
- type: PropType<string[] | string[][]>;
85
- default: () => any[][];
86
- };
87
- /** Swatch size */
88
- size: {
89
- type: StringConstructor;
90
- default: string;
91
- };
92
- /** Selected icon */
93
- icon: {
94
- type: StringConstructor;
95
- default: string;
96
- };
97
- /** selected icon size */
98
- iconSize: {
99
- type: StringConstructor;
100
- default: string;
101
- };
102
- /**
103
- * The variant prop gives you easy access to several different button styles..
104
- *
105
- * @see {@link https://vuetifyjs.com/en/components/buttons/#variant}
106
- */
107
- variant: {
108
- type: PropType<NonNullable<"flat" | "text" | "elevated" | "tonal" | "outlined" | "plain">>;
109
- default: undefined;
110
- };
111
- /**
112
- * Removes the ability to click or target the component.
113
- *
114
- * @see {@link https://vuetifyjs.com/en/api/v-btn/#props-disabled}
115
- */
116
- disabled: {
117
- type: BooleanConstructor;
118
- default: boolean;
119
- };
120
- /**
121
- * Applies a large border radius on the button.
122
- *
123
- * @see {@link https://vuetifyjs.com/en/components/buttons/#rounded}
124
- */
125
- rounded: {
126
- type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
127
- default: undefined;
128
- };
129
- /**
130
- * Applies border styles to component.
131
- *
132
- * @see {@link https://vuetifyjs.com/en/api/v-btn/#props-border}
133
- */
134
- border: {
135
- type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
136
- default: boolean;
137
- };
138
- /**
139
- * Designates an elevation applied to the component between 0 and 24.
140
- *
141
- * @see {@link https://vuetifyjs.com/en/api/v-btn/#props-elevation}
142
- */
143
- elevation: {
144
- type: (StringConstructor | NumberConstructor)[];
145
- default: undefined;
146
- };
147
- }>> & {
148
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
149
- }, {
150
- modelValue: string;
151
- swatches: string[] | string[][];
152
- size: string;
153
- icon: string;
154
- iconSize: string;
155
- variant: NonNullable<"flat" | "text" | "elevated" | "tonal" | "outlined" | "plain">;
156
- disabled: boolean;
157
- rounded: string | number | boolean;
158
- border: string | number | boolean;
159
- elevation: string | number;
160
- }, {}>;
161
- export default _sfc_main;
File without changes