qrcode.vue 3.6.0 → 3.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qrcode.vue",
3
- "version": "3.6.0",
3
+ "version": "3.7.1",
4
4
  "description": "A Vue.js component to generate QRCode. Both support Vue 2 and Vue 3",
5
5
  "type": "module",
6
6
  "main": "./dist/qrcode.vue.cjs.js",
@@ -8,10 +8,10 @@
8
8
  "browser": "./dist/qrcode.vue.browser.js",
9
9
  "unpkg": "./dist/qrcode.vue.browser.min.js",
10
10
  "jsdelivr": "./dist/qrcode.vue.browser.min.js",
11
- "types": "./dist/index.d.ts",
11
+ "types": "./dist/src/index.d.ts",
12
12
  "exports": {
13
13
  ".": {
14
- "types": "./dist/index.d.ts",
14
+ "types": "./dist/src/index.d.ts",
15
15
  "import": "./dist/qrcode.vue.esm.js",
16
16
  "require": "./dist/qrcode.vue.cjs.js"
17
17
  },
@@ -19,7 +19,8 @@
19
19
  },
20
20
  "scripts": {
21
21
  "dev": "rsbuild dev",
22
- "build": "rollup -c"
22
+ "build": "rollup -c",
23
+ "test": "rstest"
23
24
  },
24
25
  "repository": "https://github.com/scopewu/qrcode.vue.git",
25
26
  "keywords": [
@@ -33,6 +34,7 @@
33
34
  ],
34
35
  "files": [
35
36
  "/dist",
37
+ "CHANGELOG.md",
36
38
  "README-zh_cn.md",
37
39
  "README.md"
38
40
  ],
@@ -48,12 +50,13 @@
48
50
  "dependencies": {},
49
51
  "devDependencies": {
50
52
  "@rollup/plugin-terser": "^0.4.4",
51
- "@rsbuild/core": "^1.0.19",
52
- "@rsbuild/plugin-sass": "^1.1.0",
53
- "bootstrap": "^5.3.3",
54
- "rollup": "^4.24.3",
53
+ "@rsbuild/core": "^1.7.2",
54
+ "@rstest/core": "^0.8.1",
55
+ "@vue/test-utils": "^2.4.6",
56
+ "happy-dom": "^20.4.0",
57
+ "rollup": "^4.57.0",
55
58
  "rollup-plugin-typescript2": "^0.36.0",
56
- "typescript": "^5.6.3",
57
- "vue": "^3.5.12"
59
+ "typescript": "^5.9.3",
60
+ "vue": "^3.5.27"
58
61
  }
59
62
  }
package/README-ja.md DELETED
@@ -1,267 +0,0 @@
1
- # qrcode.vue
2
-
3
- ⚠️ 現在、Vue 3.xを使用している場合は、`qrcode.vue` を`3.x`にアップグレードしてください。
4
-
5
- 🔒 Vue 2.xを使用している場合は、バージョン `1.x` を使用し続けてください。
6
-
7
- [QRコード](https://en.wikipedia.org/wiki/QR_code)を生成するための Vue.js コンポーネントです。Vue 2 と Vue 3 の両方をサポートしています。
8
-
9
- [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/scopewu/qrcode.vue/blob/main/LICENSE)
10
-
11
- [English](./README.md)
12
-
13
- ## インストール
14
-
15
- `qrcode.vue`コンポーネントを Vue.js アプリに使用できます。
16
-
17
- ```bash
18
- npm install --save qrcode.vue # yarn add qrcode.vue
19
- ```
20
-
21
- ```
22
- dist/
23
- |--- qrcode.vue.cjs.js // CommonJS
24
- |--- qrcode.vue.esm.js // ESモジュール
25
- |--- qrcode.vue.browser.js // ブラウザまたはrequire.jsまたはCommonJS用のUMD
26
- |--- qrcode.vue.browser.min.js // 最小サイズのUMD
27
- ```
28
-
29
- ## 使用方法
30
-
31
- e.g.
32
-
33
- ```javascript
34
- import { createApp } from 'vue'
35
- import QrcodeVue from 'qrcode.vue'
36
-
37
- createApp({
38
- data: {
39
- value: 'https://example.com',
40
- },
41
- template: '<qrcode-vue :value="value"></qrcode-vue>',
42
- components: {
43
- QrcodeVue,
44
- },
45
- }).mount('#root')
46
- ```
47
-
48
- または、`*.vue` 拡張子の単一ファイルコンポーネントで使用します:
49
-
50
- ```html
51
- <template>
52
- <qrcode-vue :value="value" :size="size" level="H" />
53
- </template>
54
- <script>
55
- import QrcodeVue from 'qrcode.vue'
56
-
57
- export default {
58
- data() {
59
- return {
60
- value: 'https://example.com',
61
- size: 300,
62
- }
63
- },
64
- components: {
65
- QrcodeVue,
66
- },
67
- }
68
- </script>
69
- ```
70
-
71
- Vue 3で `TypeScript` を使用する場合:
72
-
73
- ```html
74
- <template>
75
- <qrcode-vue
76
- :value="value"
77
- :level="level"
78
- :render-as="renderAs"
79
- :background="background"
80
- :foreground='foreground'
81
- :gradient="gradient"
82
- :gradient-type="gradientType"
83
- :gradient-start-color="gradientStartColor"
84
- :gradient-end-color="gradientEndColor"
85
- :image-settings='imageSettings'
86
- />
87
- </template>
88
- <script setup lang="ts">
89
- import { ref } from 'vue'
90
- import QrcodeVue from 'qrcode.vue'
91
- import type { Level, RenderAs, GradientType, ImageSettings } from 'qrcode.vue'
92
-
93
- const value = ref('qrcode')
94
- const level = ref<Level>('M')
95
- const renderAs = ref<RenderAs>('svg')
96
- const background = ref('#ffffff')
97
- const foreground = ref('#000000')
98
- const margin = ref(0)
99
-
100
- // 画像の設定
101
- const imageSettings = ref<ImageSettings>({
102
- src: 'https://github.com/scopewu.png',
103
- width: 30,
104
- height: 30,
105
- // x: 10,
106
- // y: 10,
107
- excavate: true,
108
- })
109
-
110
- // グラデーション
111
- const gradient = ref(false)
112
- const gradientType = ref<GradientType>('linear')
113
- const gradientStartColor = ref('#000000')
114
- const gradientEndColor = ref('#38bdf8')
115
- </script>
116
- ```
117
-
118
- ## コンポーネントプロパティ
119
-
120
- ### `value`
121
-
122
- - タイプ:`string`
123
- - デフォルト:`''`
124
-
125
- QRコードの内容。
126
-
127
- ### `size`
128
-
129
- - タイプ:`number`
130
- - デフォルト:`100`
131
-
132
- QRコード要素のサイズ。
133
-
134
- ### `render-as`
135
-
136
- - タイプ:`RenderAs('canvas' | 'svg')`
137
- - デフォルト:`canvas`
138
-
139
- `canvas`または`svg`としてQRコードを生成します。`svg`プロパティはSSRで動作します。
140
-
141
- ### `margin`
142
-
143
- - タイプ:`number`
144
- - デフォルト:`0`
145
-
146
- 静かなゾーンの幅を定義します。
147
-
148
- ### `level`
149
-
150
- - タイプ:`Level('L' | 'M' | 'Q' | 'H')`
151
- - デフォルト:`H`
152
-
153
- QRコードの誤り訂正レベル('L'、'M'、'Q'、'H'のいずれか)。詳細については、[wikipedia: QR_code](https://en.wikipedia.org/wiki/QR_code#Error_correction)を参照してください。
154
-
155
- ### `background`
156
-
157
- - タイプ:`string`
158
- - デフォルト:`#ffffff`
159
-
160
- QRコードの背景色。
161
-
162
- ### `foreground`
163
-
164
- - タイプ:`string`
165
- - デフォルト:`#000000`
166
-
167
- QRコードの前景色。
168
-
169
- ### `image-settings`
170
-
171
- - タイプ: `ImageSettings`
172
- - デフォルト: `{}`
173
-
174
- ```ts
175
- export type ImageSettings = {
176
- src: string, // The URL of image.
177
- x?: number, // The horizontal offset. When not specified, will center the image.
178
- y?: number, // The vertical offset. When not specified, will center the image.
179
- height: number, // The height of image
180
- width: number, // The height of image
181
- excavate?: boolean, // Whether or not to "excavate" the modules around the image.
182
- }
183
- ```
184
-
185
- The settings to support qrcode image logo.
186
-
187
- ### `gradient`
188
-
189
- - タイプ:`boolean`
190
- - デフォルト:`false`
191
-
192
- QRコードのグラデーション塗りつぶしを有効にします。
193
-
194
- ### `gradient-type`
195
-
196
- - タイプ:`GradientType('linear' | 'radial')`
197
- - デフォルト:`linear`
198
-
199
- グラデーションの種類を指定します。
200
-
201
- ### `gradient-start-color`
202
-
203
- - タイプ:`string`
204
- - デフォルト:`#000000`
205
-
206
- グラデーションの開始色。
207
-
208
- ### `gradient-end-color`
209
-
210
- - タイプ:`string`
211
- - デフォルト:`#ffffff`
212
-
213
- グラデーションの終了色。
214
-
215
- ### `class`
216
-
217
- - タイプ:`string`
218
- - デフォルト:`''`
219
-
220
- QRコード要素のクラス名。
221
-
222
- ## `QrcodeVue` 3.5+
223
-
224
- `QrcodeVue` 3.5+ exports separate `QrcodeCanvas` and `QrcodeSvg` components, for which the rollup configuration has been modified:
225
-
226
- ```
227
- // rollup.config.js
228
-
229
- - exports: 'default',
230
- + exports: 'named',
231
- ```
232
-
233
- Direct references to `QrcodeVue` in common.js and cdn now require the `default` field:
234
-
235
- ```js
236
- const QrcodeVue = require('qrcode.vue').default
237
- const { default: QrcodeVue, QrcodeCanvas, QrcodeSvg } = require('qrcode.vue')
238
- ```
239
-
240
- ```html
241
- <!--With HTML-->
242
- <div id="root">
243
- <p class="flex space-x">
244
- <qrcode-vue :value="test" render-as="svg"></qrcode-vue>
245
- <qrcode-canvas :value="test"></qrcode-canvas>
246
- </p>
247
- <p><input v-model="test" /></p>
248
- </div>
249
- <script src="https://cdn.jsdelivr.net/npm/vue@3.5/dist/vue.global.prod.js"></script>
250
- <script src="https://cdn.jsdelivr.net/npm/qrcode.vue@3.5/dist/qrcode.vue.browser.min.js"></script>
251
-
252
- <script>
253
- Vue.createApp({
254
- data() { return {
255
- test: 'Hello World',
256
- }},
257
- components: {
258
- QrcodeVue: QrcodeVue.default,
259
- QrcodeCanvas: QrcodeVue.QrcodeCanvas,
260
- },
261
- }).mount('#root')
262
- </script>
263
- ```
264
-
265
- ## ライセンス
266
-
267
- copyright &copy; 2021 @scopewu, license by [MIT](https://github.com/scopewu/qrcode.vue/blob/main/LICENSE)
File without changes