vuetify-swatches 2.1.0 → 2.3.0
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.ja.md +7 -41
- package/README.md +7 -41
- package/dist/components/SwatchButton.vue.d.ts +20 -34
- package/dist/components/VSwatches.vue.d.ts +23 -223
- package/dist/index.cjs.js +9 -10
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +256 -269
- package/dist/index.iife.js +9 -10
- package/dist/index.umd.js +9 -10
- package/dist/presets/advanced.js +236 -233
- package/dist/presets/basic.js +33 -26
- package/dist/presets/index.d.ts +2 -2
- package/dist/presets/index.js +3 -6
- package/dist/style.css +2 -0
- package/dist/{interfaces/MetaInterface.d.ts → types/Meta.d.ts} +3 -2
- package/package.json +92 -99
- package/src/components/VSwatches.vue +101 -211
- package/dist/Meta.d.ts +0 -3
- package/dist/vuetify-swatches.css +0 -12
package/package.json
CHANGED
|
@@ -1,43 +1,56 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://schemastore.org/package.json",
|
|
3
2
|
"name": "vuetify-swatches",
|
|
4
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
5
4
|
"description": "Color Swatch component for Vuetify3.",
|
|
6
5
|
"keywords": [
|
|
7
|
-
"vue",
|
|
8
|
-
"vue3",
|
|
9
|
-
"vue-components",
|
|
10
|
-
"color-picker",
|
|
11
6
|
"color-palette",
|
|
7
|
+
"color-picker",
|
|
12
8
|
"swatches",
|
|
9
|
+
"vue",
|
|
10
|
+
"vue-components",
|
|
13
11
|
"vue-plugin",
|
|
12
|
+
"vue3",
|
|
14
13
|
"vuetify",
|
|
15
14
|
"vuetify3"
|
|
16
15
|
],
|
|
16
|
+
"homepage": "https://github.com/logue/vuetify-swatches",
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/logue/vuetify-swatches/issues"
|
|
19
|
+
},
|
|
17
20
|
"license": "MIT",
|
|
18
|
-
"type": "module",
|
|
19
21
|
"author": {
|
|
20
22
|
"name": "Logue",
|
|
21
23
|
"email": "logue@hotmail.co.jp",
|
|
22
24
|
"url": "https://logue.dev/"
|
|
23
25
|
},
|
|
24
|
-
"homepage": "https://github.com/logue/vuetify-swatches",
|
|
25
26
|
"repository": {
|
|
26
27
|
"type": "git",
|
|
27
28
|
"url": "git@github.com:logue/vuetify-swatches.git"
|
|
28
29
|
},
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
"funding": [
|
|
31
|
+
{
|
|
32
|
+
"type": "github",
|
|
33
|
+
"url": "https://github.com/sponsors/logue"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"type": "ko-fi",
|
|
37
|
+
"url": "https://ko-fi.com/logue"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"style": "dist/style.css",
|
|
41
|
+
"files": [
|
|
42
|
+
"dist",
|
|
43
|
+
"src/components/VSwatches.vue"
|
|
44
|
+
],
|
|
45
|
+
"type": "module",
|
|
32
46
|
"main": "dist/index.umd.js",
|
|
33
47
|
"module": "dist/index.es.js",
|
|
34
|
-
"jsdelivr": "dist/index.iife.js",
|
|
35
|
-
"unpkg": "dist/index.iife.js",
|
|
36
|
-
"types": "dist/index.d.ts",
|
|
37
|
-
"style": "dist/vuetify-swatches.css",
|
|
38
48
|
"browser": {
|
|
39
49
|
"./sfc": "./src/components/VSwatches.vue"
|
|
40
50
|
},
|
|
51
|
+
"types": "dist/index.d.ts",
|
|
52
|
+
"unpkg": "dist/index.iife.js",
|
|
53
|
+
"jsdelivr": "dist/index.iife.js",
|
|
41
54
|
"exports": {
|
|
42
55
|
".": {
|
|
43
56
|
"types": "./dist/index.d.ts",
|
|
@@ -58,102 +71,82 @@
|
|
|
58
71
|
},
|
|
59
72
|
"./umd": "./dist/index.umd.js",
|
|
60
73
|
"./iife": "./dist/index.iife.js",
|
|
61
|
-
"./dist/style.css": "./dist/
|
|
74
|
+
"./dist/style.css": "./dist/style.css",
|
|
62
75
|
"./package.json": "./package.json"
|
|
63
76
|
},
|
|
64
|
-
"files": [
|
|
65
|
-
"dist",
|
|
66
|
-
"src/components/VSwatches.vue"
|
|
67
|
-
],
|
|
68
|
-
"engines": {
|
|
69
|
-
"node": ">=24.11.1"
|
|
70
|
-
},
|
|
71
|
-
"packageManager": "pnpm@10.30.3",
|
|
72
|
-
"sideEffects": false,
|
|
73
77
|
"scripts": {
|
|
74
|
-
"dev": "
|
|
75
|
-
"clean": "rimraf node_modules/.vite",
|
|
76
|
-
"type-check": "vue-tsc --build --force",
|
|
77
|
-
"build": "run-s type-check build-only build:presets",
|
|
78
|
-
"build:analyze": "vite build --mode=analyze",
|
|
79
|
-
"build:clean": "rimraf dist docs",
|
|
80
|
-
"build:docs": "vite build --mode=docs",
|
|
81
|
-
"build-only": "vite build",
|
|
82
|
-
"build:presets": "vite build --config vite.config.presets.ts",
|
|
78
|
+
"dev": "vp dev --open",
|
|
83
79
|
"lint": "run-s lint:*",
|
|
84
|
-
"lint:
|
|
85
|
-
"lint:
|
|
86
|
-
"lint:
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
"
|
|
97
|
-
"
|
|
80
|
+
"lint:check": "vize lint --type-aware",
|
|
81
|
+
"lint:oxlint": "vp lint --fix",
|
|
82
|
+
"lint:oxfmt": "vp fmt",
|
|
83
|
+
"build": "run-s build:lib build:presets",
|
|
84
|
+
"build:lib": "run-p type-check build-only",
|
|
85
|
+
"build:docs": "vp build --mode=docs",
|
|
86
|
+
"build:presets": "vp build --config vite.config.presets.ts",
|
|
87
|
+
"build:analyze": "vp build --mode analyze",
|
|
88
|
+
"preview": "vp preview",
|
|
89
|
+
"test": "vp test",
|
|
90
|
+
"test:run": "vp test run",
|
|
91
|
+
"test:coverage": "vp test run --coverage",
|
|
92
|
+
"test:e2e": "playwright test",
|
|
93
|
+
"clean": "rimraf dist",
|
|
94
|
+
"clean:hard": "rimraf dist node_modules/.tmp node_modules/.vite node_modules/.vite-tmp",
|
|
95
|
+
"build-only": "vp build",
|
|
96
|
+
"type-check": "vize check --tsconfig tsconfig.app.json",
|
|
97
|
+
"skills:install": "npx --no-install skills --version >/dev/null 2>&1 && npx skills experimental_install --yes || echo '\\033[1;33m⚠️ [Warning] skills command not found. Skipped auto-installation of agent skills.\\033[0m'",
|
|
98
|
+
"skills:update": "npx skills update",
|
|
99
|
+
"prepare": "vp config && pnpm run skills:install"
|
|
98
100
|
},
|
|
99
101
|
"dependencies": {
|
|
100
|
-
"es-toolkit": "^1.
|
|
102
|
+
"es-toolkit": "^1.53.2"
|
|
101
103
|
},
|
|
102
104
|
"devDependencies": {
|
|
103
|
-
"@codemirror/lang-vue": "0.1.3",
|
|
104
|
-
"@
|
|
105
|
-
"@
|
|
106
|
-
"@
|
|
107
|
-
"@
|
|
108
|
-
"@
|
|
109
|
-
"@
|
|
110
|
-
"@
|
|
111
|
-
"@
|
|
112
|
-
"@
|
|
113
|
-
"@
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
"eslint-
|
|
118
|
-
"eslint-plugin-
|
|
119
|
-
"eslint-plugin-security": "^4.
|
|
120
|
-
"eslint-plugin-
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
"
|
|
126
|
-
"
|
|
127
|
-
"
|
|
128
|
-
"
|
|
129
|
-
"prettier": "^3.8.1",
|
|
130
|
-
"rimraf": "^6.1.3",
|
|
131
|
-
"rollup-plugin-visualizer": "^7.0.1",
|
|
132
|
-
"sass-embedded": "^1.97.3",
|
|
133
|
-
"typescript": "^5.9.3",
|
|
134
|
-
"typescript-eslint": "^8.56.1",
|
|
135
|
-
"vite": "^7.3.1",
|
|
105
|
+
"@codemirror/lang-vue": "^0.1.3",
|
|
106
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.8.1",
|
|
107
|
+
"@eslint/markdown": "^9.0.0",
|
|
108
|
+
"@mdi/font": "^7.4.47",
|
|
109
|
+
"@playwright/test": "^1.65.2",
|
|
110
|
+
"@tsconfig/node-lts": "^26.0.1",
|
|
111
|
+
"@types/jsdom": "^30.0.0",
|
|
112
|
+
"@types/node": "^26.6.11",
|
|
113
|
+
"@typescript/native": "npm:typescript@^7.0.2",
|
|
114
|
+
"@vitejs/plugin-vue": "^6.1.1",
|
|
115
|
+
"@vitest/coverage-v8": "catalog:",
|
|
116
|
+
"@vue/language-core": "^3.3.14",
|
|
117
|
+
"@vue/test-utils": "^2.6.0",
|
|
118
|
+
"@vue/tsconfig": "^0.9.1",
|
|
119
|
+
"eslint-config-vuetify": "^4.7.2",
|
|
120
|
+
"eslint-plugin-playwright": "^2.12.2",
|
|
121
|
+
"eslint-plugin-security": "^4.2.1",
|
|
122
|
+
"eslint-plugin-vuetify": "^2.7.3",
|
|
123
|
+
"jsdom": "^31.0.1",
|
|
124
|
+
"npm-run-all2": "^9.1.0",
|
|
125
|
+
"rimraf": "^6.1.4",
|
|
126
|
+
"rollup-plugin-visualizer": "^7.3.0",
|
|
127
|
+
"sass-embedded": "^1.108.2",
|
|
128
|
+
"taze": "^21.3.0",
|
|
129
|
+
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
130
|
+
"vite": "catalog:",
|
|
136
131
|
"vite-plugin-banner": "^0.8.1",
|
|
137
|
-
"vite-plugin-checker": "^
|
|
138
|
-
"vite-plugin-dts": "^
|
|
132
|
+
"vite-plugin-checker": "^1.1.0",
|
|
133
|
+
"vite-plugin-dts": "^5.1.2",
|
|
134
|
+
"vite-plugin-vue-devtools": "^8.2.1",
|
|
139
135
|
"vite-plugin-vuetify": "^2.1.3",
|
|
140
|
-
"
|
|
141
|
-
"
|
|
142
|
-
"
|
|
143
|
-
"vue-
|
|
144
|
-
"vue-tsc": "^3.2.5"
|
|
136
|
+
"vite-plus": "catalog:",
|
|
137
|
+
"vitest": "catalog:",
|
|
138
|
+
"vize": "^0.839.0",
|
|
139
|
+
"vue-codemirror6": "^1.8.2"
|
|
145
140
|
},
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
|
|
149
|
-
}
|
|
141
|
+
"peerDependencies": {
|
|
142
|
+
"vue": ">=3.5",
|
|
143
|
+
"vuetify": ">=4"
|
|
150
144
|
},
|
|
151
|
-
"
|
|
152
|
-
"
|
|
145
|
+
"engines": {
|
|
146
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
153
147
|
},
|
|
154
|
-
"
|
|
155
|
-
|
|
156
|
-
"
|
|
157
|
-
"yaml": ">=2.3.2"
|
|
148
|
+
"packageManager": "pnpm@12.26.0",
|
|
149
|
+
"stackblitz": {
|
|
150
|
+
"startCommand": "pnpm run test:unit"
|
|
158
151
|
}
|
|
159
152
|
}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
<script
|
|
1
|
+
<script lang="ts" setup vapor>
|
|
2
2
|
/** Vuetify Swatches */
|
|
3
|
-
import {
|
|
4
|
-
computed,
|
|
5
|
-
ref,
|
|
6
|
-
watch,
|
|
7
|
-
type ComputedRef,
|
|
8
|
-
type PropType,
|
|
9
|
-
type Ref,
|
|
10
|
-
} from 'vue';
|
|
3
|
+
import { computed } from 'vue';
|
|
11
4
|
|
|
12
5
|
import { zip } from 'es-toolkit';
|
|
13
6
|
import { VItem, VItemGroup } from 'vuetify/components';
|
|
@@ -15,168 +8,67 @@ import colors from 'vuetify/util/colors';
|
|
|
15
8
|
|
|
16
9
|
import SwatchButton from './SwatchButton.vue';
|
|
17
10
|
|
|
18
|
-
import type {
|
|
19
|
-
import type { Anchor } from 'vuetify/lib/util/index.d.ts';
|
|
20
|
-
|
|
21
|
-
/** Emits */
|
|
22
|
-
const emits = defineEmits({
|
|
23
|
-
'update:modelValue': (_value: string) => true,
|
|
24
|
-
});
|
|
11
|
+
import type { VSwatchesProps } from '@/types/VSwatchesProps.d.ts';
|
|
25
12
|
|
|
26
13
|
/** Props */
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Selected icon
|
|
48
|
-
* @see {@link https://vuetifyjs.com/en/components/icons/#usage
|
|
49
|
-
*/
|
|
50
|
-
icon: {
|
|
51
|
-
type: String,
|
|
52
|
-
default: 'mdi-checkbox-marked-circle',
|
|
53
|
-
},
|
|
54
|
-
/** selected icon size */
|
|
55
|
-
iconSize: {
|
|
56
|
-
type: String,
|
|
57
|
-
default: '1rem',
|
|
58
|
-
},
|
|
59
|
-
/** Display swatches in a single row */
|
|
60
|
-
inline: {
|
|
61
|
-
type: Boolean,
|
|
62
|
-
default: false,
|
|
63
|
-
},
|
|
64
|
-
/**
|
|
65
|
-
* The variant prop gives you easy access to several different button styles..
|
|
66
|
-
*
|
|
67
|
-
* @see {@link https://vuetifyjs.com/en/components/buttons/#variant}
|
|
68
|
-
*/
|
|
69
|
-
variant: {
|
|
70
|
-
type: String as PropType<Variant>,
|
|
71
|
-
default: undefined,
|
|
72
|
-
},
|
|
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
|
-
*/
|
|
78
|
-
disabled: {
|
|
79
|
-
type: Boolean,
|
|
80
|
-
default: false,
|
|
81
|
-
},
|
|
82
|
-
/**
|
|
83
|
-
* Applies a large border radius on the button.
|
|
84
|
-
*
|
|
85
|
-
* @see {@link https://vuetifyjs.com/en/components/buttons/#rounded}
|
|
86
|
-
*/
|
|
87
|
-
rounded: {
|
|
88
|
-
type: [String, Number, Boolean],
|
|
89
|
-
default: undefined,
|
|
90
|
-
},
|
|
91
|
-
/**
|
|
92
|
-
* Applies border styles to component.
|
|
93
|
-
*
|
|
94
|
-
* @see {@link https://vuetifyjs.com/en/api/v-btn/#props-border}
|
|
95
|
-
*/
|
|
96
|
-
border: {
|
|
97
|
-
type: [String, Number, Boolean],
|
|
98
|
-
default: false,
|
|
99
|
-
},
|
|
100
|
-
/**
|
|
101
|
-
* Designates an elevation applied to the component between 0 and 24.
|
|
102
|
-
*
|
|
103
|
-
* @see {@link https://vuetifyjs.com/en/api/v-btn/#props-elevation}
|
|
104
|
-
*/
|
|
105
|
-
elevation: {
|
|
106
|
-
type: [String, Number],
|
|
107
|
-
default: undefined,
|
|
108
|
-
},
|
|
109
|
-
/** Swap cols and rows */
|
|
110
|
-
transpose: {
|
|
111
|
-
type: Boolean,
|
|
112
|
-
default: false,
|
|
113
|
-
},
|
|
114
|
-
/**
|
|
115
|
-
* Tooltip
|
|
116
|
-
* @see {@link https://vuetifyjs.com/en/components/tooltips/}
|
|
117
|
-
*/
|
|
118
|
-
tooltip: {
|
|
119
|
-
type: Boolean,
|
|
120
|
-
default: false,
|
|
121
|
-
},
|
|
122
|
-
/**
|
|
123
|
-
* Tooltip location
|
|
124
|
-
* @see {@link https://vuetifyjs.com/en/components/tooltips/#props-location}
|
|
125
|
-
*/
|
|
126
|
-
tooltipLocation: {
|
|
127
|
-
type: String as PropType<Anchor>,
|
|
128
|
-
default: undefined,
|
|
129
|
-
},
|
|
14
|
+
const {
|
|
15
|
+
swatches = [],
|
|
16
|
+
size = '2rem',
|
|
17
|
+
icon = 'mdi-checkbox-marked-circle',
|
|
18
|
+
iconSize = '1rem',
|
|
19
|
+
inline = false,
|
|
20
|
+
variant,
|
|
21
|
+
disabled = false,
|
|
22
|
+
rounded,
|
|
23
|
+
border = false,
|
|
24
|
+
elevation,
|
|
25
|
+
transpose = false,
|
|
26
|
+
tooltip = false,
|
|
27
|
+
tooltipLocation
|
|
28
|
+
} = defineProps<Partial<Omit<VSwatchesProps, 'modelValue'>>>();
|
|
29
|
+
|
|
30
|
+
/** Selected Color */
|
|
31
|
+
const selected = defineModel<string>({
|
|
32
|
+
default: colors.shades.white
|
|
130
33
|
});
|
|
131
34
|
|
|
132
35
|
/** Normalized swatches structure for rendering */
|
|
133
|
-
const normalizedSwatches
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
36
|
+
const normalizedSwatches = computed(() => normalizeSwatches(swatches, inline, transpose));
|
|
37
|
+
|
|
38
|
+
function normalizeSwatches(
|
|
39
|
+
swatches: VSwatchesProps['swatches'],
|
|
40
|
+
inline: boolean,
|
|
41
|
+
transpose: boolean
|
|
42
|
+
): SwatchRows {
|
|
43
|
+
const rows = Array.isArray(swatches)
|
|
44
|
+
? isSwatchRows(swatches)
|
|
45
|
+
? swatches
|
|
46
|
+
: swatches.length > 0
|
|
47
|
+
? [swatches]
|
|
48
|
+
: []
|
|
49
|
+
: Object.values(swatches);
|
|
50
|
+
|
|
51
|
+
if (inline) {
|
|
52
|
+
return [rows.flat()];
|
|
142
53
|
}
|
|
143
54
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
return zip(...baseSwatches) as string[][];
|
|
55
|
+
if (transpose) {
|
|
56
|
+
return zip(...rows);
|
|
147
57
|
}
|
|
148
58
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
/** Selected Color */
|
|
154
|
-
const selected: Ref<string> = ref(colors.shades.white);
|
|
59
|
+
return rows;
|
|
60
|
+
}
|
|
155
61
|
|
|
156
|
-
|
|
157
|
-
()
|
|
158
|
-
|
|
159
|
-
);
|
|
62
|
+
function isSwatchRows(swatches: VSwatchesProps['swatches']): swatches is SwatchRows {
|
|
63
|
+
return Array.isArray(swatches) && swatches.every(Array.isArray);
|
|
64
|
+
}
|
|
160
65
|
|
|
161
|
-
|
|
162
|
-
() => props.modelValue,
|
|
163
|
-
newValue => {
|
|
164
|
-
if (newValue) {
|
|
165
|
-
selected.value = newValue;
|
|
166
|
-
}
|
|
167
|
-
},
|
|
168
|
-
{ immediate: true }
|
|
169
|
-
);
|
|
66
|
+
type SwatchRows = readonly (readonly (string | undefined)[])[];
|
|
170
67
|
</script>
|
|
171
68
|
|
|
172
69
|
<template>
|
|
173
|
-
<v-item-group
|
|
174
|
-
v-
|
|
175
|
-
:class="{ 'd-inline': props.inline }"
|
|
176
|
-
class="v-swatches"
|
|
177
|
-
mandatory
|
|
178
|
-
>
|
|
179
|
-
<template v-if="props.inline">
|
|
70
|
+
<v-item-group v-model="selected" class="v-swatches" :class="{ 'd-inline': inline }" mandatory>
|
|
71
|
+
<template v-if="inline">
|
|
180
72
|
<v-item
|
|
181
73
|
v-for="color in normalizedSwatches[0]"
|
|
182
74
|
:key="color"
|
|
@@ -184,73 +76,71 @@ watch(
|
|
|
184
76
|
:value="color"
|
|
185
77
|
>
|
|
186
78
|
<swatch-button
|
|
187
|
-
:border="
|
|
79
|
+
:border="border"
|
|
188
80
|
:color="color"
|
|
189
|
-
:disabled="
|
|
190
|
-
:elevation="
|
|
191
|
-
:icon-size="
|
|
192
|
-
:icon="
|
|
81
|
+
:disabled="disabled"
|
|
82
|
+
:elevation="elevation"
|
|
83
|
+
:icon-size="iconSize"
|
|
84
|
+
:icon="icon"
|
|
193
85
|
:is-selected="isSelected"
|
|
194
|
-
:rounded="
|
|
195
|
-
:size="
|
|
196
|
-
:tooltip-location="
|
|
197
|
-
:tooltip="
|
|
198
|
-
:variant="
|
|
86
|
+
:rounded="rounded"
|
|
87
|
+
:size="size"
|
|
88
|
+
:tooltip-location="tooltipLocation"
|
|
89
|
+
:tooltip="tooltip"
|
|
90
|
+
:variant="variant"
|
|
199
91
|
@click="toggle"
|
|
200
92
|
/>
|
|
201
93
|
</v-item>
|
|
202
94
|
</template>
|
|
203
|
-
<
|
|
204
|
-
<v-
|
|
205
|
-
v-for="color in cols"
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
/>
|
|
225
|
-
</v-item>
|
|
226
|
-
</div>
|
|
95
|
+
<template v-else>
|
|
96
|
+
<div v-for="(cols, rows) in normalizedSwatches" :key="rows">
|
|
97
|
+
<v-item v-for="color in cols" :key="color" v-slot="{ isSelected, toggle }" :value="color">
|
|
98
|
+
<swatch-button
|
|
99
|
+
:border="border"
|
|
100
|
+
:color="color"
|
|
101
|
+
:disabled="disabled"
|
|
102
|
+
:elevation="elevation"
|
|
103
|
+
:icon-size="iconSize"
|
|
104
|
+
:icon="icon"
|
|
105
|
+
:is-selected="isSelected"
|
|
106
|
+
:rounded="rounded"
|
|
107
|
+
:size="size"
|
|
108
|
+
:tooltip-location="tooltipLocation"
|
|
109
|
+
:tooltip="tooltip"
|
|
110
|
+
:variant="variant"
|
|
111
|
+
@click="toggle"
|
|
112
|
+
/>
|
|
113
|
+
</v-item>
|
|
114
|
+
</div>
|
|
115
|
+
</template>
|
|
227
116
|
</v-item-group>
|
|
228
117
|
</template>
|
|
229
118
|
|
|
230
|
-
<style lang="scss">
|
|
119
|
+
<style lang="scss" scoped>
|
|
231
120
|
.v-swatches {
|
|
232
|
-
.v-btn {
|
|
121
|
+
:deep(.v-btn) {
|
|
233
122
|
margin: 0.1rem;
|
|
123
|
+
}
|
|
234
124
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
125
|
+
/** Reverse checkd mark color */
|
|
126
|
+
:deep(.v-icon) {
|
|
127
|
+
filter: invert(100%) grayscale(100%) contrast(100);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** Add Slash */
|
|
131
|
+
:deep(.bg-transparent) {
|
|
132
|
+
background: linear-gradient(
|
|
133
|
+
to top left,
|
|
134
|
+
transparent 0,
|
|
135
|
+
transparent calc(50% - 0.1rem),
|
|
136
|
+
rgb(var(--v-theme-error)) 50%,
|
|
137
|
+
transparent calc(50% + 0.1rem),
|
|
138
|
+
transparent
|
|
139
|
+
);
|
|
140
|
+
}
|
|
239
141
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
background: linear-gradient(
|
|
243
|
-
to top left,
|
|
244
|
-
transparent 0,
|
|
245
|
-
transparent calc(50% - 0.1rem),
|
|
246
|
-
rgb(var(--v-theme-error)) 50%,
|
|
247
|
-
transparent calc(50% + 0.1rem),
|
|
248
|
-
transparent
|
|
249
|
-
);
|
|
250
|
-
.v-icon {
|
|
251
|
-
filter: none;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
142
|
+
:deep(.bg-transparent .v-icon) {
|
|
143
|
+
filter: none;
|
|
254
144
|
}
|
|
255
145
|
}
|
|
256
146
|
</style>
|
package/dist/Meta.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* vuetify-swatches
|
|
3
|
-
*
|
|
4
|
-
* @description Color Swatch component for Vuetify3.
|
|
5
|
-
* @author Logue <logue@hotmail.co.jp>
|
|
6
|
-
* @copyright 2022-2026 By Masashi Yoshikawa All rights reserved.
|
|
7
|
-
* @license MIT
|
|
8
|
-
* @version 2.0.1
|
|
9
|
-
* @see {@link https://github.com/logue/vuetify-swatches}
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
.v-swatches .v-btn{margin:.1rem}.v-swatches .v-btn .v-icon{filter:invert(100%) grayscale(100%) contrast(100)}.v-swatches .v-btn.bg-transparent{background:linear-gradient(to top left,transparent 0,transparent calc(50% - .1rem),rgb(var(--v-theme-error)) 50%,transparent calc(50% + .1rem),transparent)}.v-swatches .v-btn.bg-transparent .v-icon{filter:none}
|