vuetify-swatches 1.4.0 → 1.4.3

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
@@ -132,6 +132,30 @@ Most props other than size and placement are the same as [v-btn](https://next.vu
132
132
 
133
133
  [^1] Available variants are: elevated(default), flat, tonal, outlined, text, and plain.
134
134
 
135
+ ### CDN Usage
136
+
137
+ ```html
138
+ <!-- Vue core -->
139
+ <script src="https://cdn.jsdelivr.net/npm/vue@3.3.4/dist/vue.global.js"></script>
140
+ <script src="https://cdn.jsdelivr.net/npm/vuetify@3.3.14/dist/vuetify.min.js"></script>
141
+ <link
142
+ rel="stylesheet"
143
+ href="https://cdn.jsdelivr.net/npm/vuetify@3.3.14/dist/vuetify.min.js"
144
+ />
145
+ <!-- Markdown wasm -->
146
+ <script src="https://cdn.jsdelivr.net/npm/vuetify-swatches@1.4.3/dist/index.iife.min.js"></script>
147
+ <script>
148
+ const { createApp } = Vue;
149
+ const { createVuetify } = Vuetify;
150
+
151
+ const app = createApp();
152
+ app.use(vuetify).component(VSwatches).mount('#app');
153
+ </script>
154
+ ```
155
+
156
+ ```
157
+
135
158
  ## LICENSE
136
159
 
137
160
  ©2022-2023 by Logue. Licensed under the [MIT License](LICENSE).
161
+ ```
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.3
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(() => [
@@ -165,8 +170,5 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
165
170
  var VSwatches_vue_vue_type_style_index_0_lang = '';
166
171
 
167
172
  const installVSwatches = (app) => app.component("VSwatches", _sfc_main);
168
- if (typeof window !== "undefined" && window.Vue) {
169
- window.Vue.use(_sfc_main);
170
- }
171
173
 
172
174
  export { _sfc_main as default, installVSwatches as install };
@@ -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.3
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(() => [
@@ -168,9 +173,6 @@ var VSwatches = (function (exports, vue, components, colors) {
168
173
  var VSwatches_vue_vue_type_style_index_0_lang = '';
169
174
 
170
175
  const installVSwatches = (app) => app.component("VSwatches", _sfc_main);
171
- if (typeof window !== "undefined" && window.Vue) {
172
- window.Vue.use(_sfc_main);
173
- }
174
176
 
175
177
  exports["default"] = _sfc_main;
176
178
  exports.install = installVSwatches;
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.3
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(() => [
@@ -171,9 +176,6 @@
171
176
  var VSwatches_vue_vue_type_style_index_0_lang = '';
172
177
 
173
178
  const installVSwatches = (app) => app.component("VSwatches", _sfc_main);
174
- if (typeof window !== "undefined" && window.Vue) {
175
- window.Vue.use(_sfc_main);
176
- }
177
179
 
178
180
  exports["default"] = _sfc_main;
179
181
  exports.install = installVSwatches;
package/dist/style.css CHANGED
@@ -5,13 +5,15 @@
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.3
9
9
  * @see {@link https://github.com/logue/vuetify-swatches}
10
10
  */
11
11
 
12
12
  .v-swatches div .v-btn {
13
13
  padding: 0 !important;
14
14
  margin: 0.1rem;
15
+ /** Reverse checkd mark color */
16
+ /** Add Slash */
15
17
  }
16
18
  .v-swatches div .v-btn .v-icon {
17
19
  filter: invert(100%) grayscale(100%) contrast(100);
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.3",
5
5
  "description": "Color Swatch component for Vuetify3.",
6
6
  "keywords": [
7
7
  "vuejs",
@@ -34,6 +34,8 @@
34
34
  },
35
35
  "main": "dist/index.umd.js",
36
36
  "module": "dist/index.es.js",
37
+ "jsdelivr": "dist/index.iife.js",
38
+ "unpkg": "dist/index.iife.js",
37
39
  "types": "dist/src/index.d.ts",
38
40
  "style": "dist/style.css",
39
41
  "browser": {
@@ -43,6 +45,8 @@
43
45
  ".": {
44
46
  "import": "./dist/index.es.js",
45
47
  "require": "./dist/index.umd.js",
48
+ "jsdelivr": "./dist/index.iife.js",
49
+ "unpkg": "./dist/index.iife.js",
46
50
  "types": "./dist/src/index.d.ts"
47
51
  },
48
52
  "./dist/style.css": {
@@ -57,7 +61,7 @@
57
61
  "engines": {
58
62
  "yarn": ">=1.22.19"
59
63
  },
60
- "packageManager": "yarn@3.5.1",
64
+ "packageManager": "yarn@3.6.3",
61
65
  "sideEffects": false,
62
66
  "scripts": {
63
67
  "dev": "vite",
@@ -74,48 +78,48 @@
74
78
  "version": "auto-changelog -p && git add CHANGELOG.md"
75
79
  },
76
80
  "peerDependencies": {
77
- "vuetify": "^3.3.1"
81
+ "vuetify": "^3.3.12"
78
82
  },
79
83
  "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",
85
- "@vitejs/plugin-vue": "^4.2.3",
86
- "@vue/eslint-config-prettier": "^7.1.0",
84
+ "@codemirror/lang-vue": "^0.1.2",
85
+ "@tsconfig/node-lts": "^18.12.4",
86
+ "@types/node": "^20.5.6",
87
+ "@typescript-eslint/eslint-plugin": "^6.4.1",
88
+ "@typescript-eslint/parser": "^6.4.1",
89
+ "@vitejs/plugin-vue": "^4.3.3",
90
+ "@vue/eslint-config-prettier": "^8.0.0",
87
91
  "@vue/tsconfig": "^0.4.0",
88
- "eslint": "^8.41.0",
89
- "eslint-config-standard-with-typescript": "^34.0.1",
92
+ "eslint": "^8.48.0",
93
+ "eslint-config-standard-with-typescript": "^38.0.0",
90
94
  "eslint-import-resolver-alias": "^1.1.2",
91
- "eslint-import-resolver-typescript": "^3.5.5",
95
+ "eslint-import-resolver-typescript": "^3.6.0",
92
96
  "eslint-plugin-html": "^7.1.0",
93
- "eslint-plugin-import": "^2.27.5",
94
- "eslint-plugin-n": "^16.0.0",
97
+ "eslint-plugin-import": "^2.28.1",
98
+ "eslint-plugin-n": "^16.0.2",
95
99
  "eslint-plugin-promise": "^6.1.1",
96
100
  "eslint-plugin-tsdoc": "^0.2.17",
97
- "eslint-plugin-vue": "^9.14.1",
98
- "eslint-plugin-vuejs-accessibility": "^2.1.0",
99
- "eslint-plugin-vuetify": "^2.0.1",
101
+ "eslint-plugin-vue": "^9.17.0",
102
+ "eslint-plugin-vuejs-accessibility": "^2.2.0",
103
+ "eslint-plugin-vuetify": "^2.0.5",
100
104
  "eslint-plugin-yaml": "^0.5.0",
101
105
  "husky": "^8.0.3",
102
- "lint-staged": "^13.2.2",
106
+ "lint-staged": "^14.0.1",
103
107
  "npm-run-all": "^4.1.5",
104
- "prettier": "^2.8.8",
108
+ "prettier": "^3.0.2",
105
109
  "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",
110
+ "rollup-plugin-visualizer": "^5.9.2",
111
+ "sass": "^1.66.1",
112
+ "typescript": "^5.2.2",
113
+ "vite": "^4.4.9",
110
114
  "vite-plugin-banner": "^0.7.0",
111
- "vite-plugin-checker": "^0.6.0",
112
- "vite-plugin-dts": "^2.3.0",
115
+ "vite-plugin-checker": "^0.6.2",
116
+ "vite-plugin-dts": "^3.5.2",
113
117
  "vite-plugin-vuetify": "^1.0.2",
114
118
  "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"
119
+ "vue-codemirror6": "^1.1.24",
120
+ "vue-eslint-parser": "^9.3.1",
121
+ "vue-tsc": "^1.8.8",
122
+ "vuetify": "^3.3.14"
119
123
  },
120
124
  "husky": {
121
125
  "hooks": {
@@ -130,6 +134,7 @@
130
134
  "resolutions": {
131
135
  "http-cache-semantics": "^4.1.1",
132
136
  "json5": "^2.2.3",
137
+ "semver": "^7.5.2",
133
138
  "yaml": "^2.2.2"
134
139
  }
135
140
  }
@@ -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';
@@ -16,7 +16,7 @@ const props = defineProps({
16
16
  modelValue: { type: String, default: colors.shades.white },
17
17
  /** Swatch colors */
18
18
  swatches: {
19
- type: Array as PropType<string[] | string[][]>,
19
+ type: Array as PropType<string[] | string[][] | Record<string, string[]>>,
20
20
  default: () => [
21
21
  [colors.shades.black, colors.shades.white, colors.shades.transparent],
22
22
  [
@@ -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>
@@ -161,10 +167,12 @@ watch(
161
167
  padding: 0 !important;
162
168
  margin: 0.1rem;
163
169
 
170
+ /** Reverse checkd mark color */
164
171
  .v-icon {
165
172
  filter: invert(100%) grayscale(100%) contrast(100);
166
173
  }
167
174
 
175
+ /** Add Slash */
168
176
  &.bg-trasparent {
169
177
  background: linear-gradient(
170
178
  to top left,
@@ -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