mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-24 06:40:20 +03:00
Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
880d937d33 | ||
|
|
9ebf98352e | ||
|
|
d30344beef | ||
|
|
a3a624c292 | ||
|
|
1fb3e1f922 | ||
|
|
951143d63d | ||
|
|
e8cd98c25d | ||
|
|
dbd4730256 | ||
|
|
6d619603f9 |
No files matched your search
Vendored
+3
@@ -133,6 +133,7 @@ declare module '@vue/runtime-core' {
|
||||
NButton: typeof import('naive-ui')['NButton']
|
||||
NCode: typeof import('naive-ui')['NCode']
|
||||
NCollapseTransition: typeof import('naive-ui')['NCollapseTransition']
|
||||
NColorPicker: typeof import('naive-ui')['NColorPicker']
|
||||
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
|
||||
NEllipsis: typeof import('naive-ui')['NEllipsis']
|
||||
NForm: typeof import('naive-ui')['NForm']
|
||||
@@ -140,6 +141,7 @@ declare module '@vue/runtime-core' {
|
||||
NH1: typeof import('naive-ui')['NH1']
|
||||
NH3: typeof import('naive-ui')['NH3']
|
||||
NIcon: typeof import('naive-ui')['NIcon']
|
||||
NImage: typeof import('naive-ui')['NImage']
|
||||
NInputNumber: typeof import('naive-ui')['NInputNumber']
|
||||
NLayout: typeof import('naive-ui')['NLayout']
|
||||
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
|
||||
@@ -154,6 +156,7 @@ declare module '@vue/runtime-core' {
|
||||
PdfSignatureDetails: typeof import('./src/tools/pdf-signature-checker/components/pdf-signature-details.vue')['default']
|
||||
PercentageCalculator: typeof import('./src/tools/percentage-calculator/percentage-calculator.vue')['default']
|
||||
PhoneParserAndFormatter: typeof import('./src/tools/phone-parser-and-formatter/phone-parser-and-formatter.vue')['default']
|
||||
QrCodeDecoder: typeof import('./src/tools/qr-code-decoder/qr-code-decoder.vue')['default']
|
||||
QrCodeGenerator: typeof import('./src/tools/qr-code-generator/qr-code-generator.vue')['default']
|
||||
RandomPortGenerator: typeof import('./src/tools/random-port-generator/random-port-generator.vue')['default']
|
||||
ResultRow: typeof import('./src/tools/ipv4-range-expander/result-row.vue')['default']
|
||||
|
||||
+2
-1
@@ -67,6 +67,7 @@
|
||||
"iarna-toml-esm": "^3.0.5",
|
||||
"ibantools": "^4.3.3",
|
||||
"js-base64": "^3.7.6",
|
||||
"ical.js": "^2.0.1",
|
||||
"json5": "^2.2.3",
|
||||
"jwt-decode": "^3.1.2",
|
||||
"libphonenumber-js": "^1.10.28",
|
||||
@@ -84,6 +85,7 @@
|
||||
"pinia": "^2.0.34",
|
||||
"plausible-tracker": "^0.3.8",
|
||||
"qrcode": "^1.5.1",
|
||||
"qrcode-parser": "^2.1.3",
|
||||
"sql-formatter": "^13.0.0",
|
||||
"ua-parser-js": "^1.0.35",
|
||||
"ulid": "^2.3.0",
|
||||
@@ -91,7 +93,6 @@
|
||||
"unplugin-auto-import": "^0.16.4",
|
||||
"uuid": "^9.0.0",
|
||||
"vue": "^3.3.4",
|
||||
"vue-color-wheel": "^0.1.1",
|
||||
"vue-i18n": "^9.9.1",
|
||||
"vue-router": "^4.1.6",
|
||||
"vue-tsc": "^1.8.1",
|
||||
|
||||
Generated
+20
-203
@@ -98,6 +98,9 @@ dependencies:
|
||||
ibantools:
|
||||
specifier: ^4.3.3
|
||||
version: 4.3.3
|
||||
ical.js:
|
||||
specifier: ^2.0.1
|
||||
version: 2.0.1
|
||||
js-base64:
|
||||
specifier: ^3.7.6
|
||||
version: 3.7.7
|
||||
@@ -152,6 +155,9 @@ dependencies:
|
||||
qrcode:
|
||||
specifier: ^1.5.1
|
||||
version: 1.5.1
|
||||
qrcode-parser:
|
||||
specifier: ^2.1.3
|
||||
version: 2.1.3
|
||||
sql-formatter:
|
||||
specifier: ^13.0.0
|
||||
version: 13.0.0
|
||||
@@ -173,9 +179,6 @@ dependencies:
|
||||
vue:
|
||||
specifier: ^3.3.4
|
||||
version: 3.3.4
|
||||
vue-color-wheel:
|
||||
specifier: ^0.1.1
|
||||
version: 0.1.1
|
||||
vue-i18n:
|
||||
specifier: ^9.9.1
|
||||
version: 9.9.1(vue@3.3.4)
|
||||
@@ -1913,12 +1916,6 @@ packages:
|
||||
'@babel/helper-validator-identifier': 7.22.20
|
||||
to-fast-properties: 2.0.0
|
||||
|
||||
/@cfcs/core@0.0.6:
|
||||
resolution: {integrity: sha512-FxfJMwoLB8MEMConeXUCqtMGqxdtePQxRBOiGip9ULcYYam3WfCgoY6xdnMaSkYvRvmosp5iuG+TiPofm65+Pw==}
|
||||
dependencies:
|
||||
'@egjs/component': 3.0.5
|
||||
dev: false
|
||||
|
||||
/@css-render/plugin-bem@0.15.12(css-render@0.15.12):
|
||||
resolution: {integrity: sha512-Lq2jSOZn+wYQtsyaFj6QRz2EzAnd3iW5fZeHO1WSXQdVYwvwGX0ZiH3X2JQgtgYLT1yeGtrwrqJdNdMEUD2xTw==}
|
||||
peerDependencies:
|
||||
@@ -1935,28 +1932,6 @@ packages:
|
||||
vue: 3.3.4
|
||||
dev: false
|
||||
|
||||
/@daybrush/utils@1.13.0:
|
||||
resolution: {integrity: sha512-ALK12C6SQNNHw1enXK+UO8bdyQ+jaWNQ1Af7Z3FNxeAwjYhQT7do+TRE4RASAJ3ObaS2+TJ7TXR3oz2Gzbw0PQ==}
|
||||
dev: false
|
||||
|
||||
/@egjs/agent@2.4.4:
|
||||
resolution: {integrity: sha512-cvAPSlUILhBBOakn2krdPnOGv5hAZq92f1YHxYcfu0p7uarix2C6Ia3AVizpS1SGRZGiEkIS5E+IVTLg1I2Iog==}
|
||||
dev: false
|
||||
|
||||
/@egjs/children-differ@1.0.1:
|
||||
resolution: {integrity: sha512-DRvyqMf+CPCOzAopQKHtW+X8iN6Hy6SFol+/7zCUiE5y4P/OB8JP8FtU4NxtZwtafvSL4faD5KoQYPj3JHzPFQ==}
|
||||
dependencies:
|
||||
'@egjs/list-differ': 1.0.1
|
||||
dev: false
|
||||
|
||||
/@egjs/component@3.0.5:
|
||||
resolution: {integrity: sha512-cLcGizTrrUNA2EYE3MBmEDt2tQv1joVP1Q3oDisZ5nw0MZDx2kcgEXM+/kZpfa/PAkFvYVhRUZwytIQWoN3V/w==}
|
||||
dev: false
|
||||
|
||||
/@egjs/list-differ@1.0.1:
|
||||
resolution: {integrity: sha512-OTFTDQcWS+1ZREOdCWuk5hCBgYO4OsD30lXcOCyVOAjXMhgL5rBRDnt/otb6Nz8CzU0L/igdcaQBDLWc4t9gvg==}
|
||||
dev: false
|
||||
|
||||
/@emotion/hash@0.8.0:
|
||||
resolution: {integrity: sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow==}
|
||||
dev: false
|
||||
@@ -2632,25 +2607,6 @@ packages:
|
||||
resolution: {integrity: sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg==}
|
||||
dev: true
|
||||
|
||||
/@scena/dragscroll@1.4.0:
|
||||
resolution: {integrity: sha512-3O8daaZD9VXA9CP3dra6xcgt/qrm0mg0xJCwiX6druCteQ9FFsXffkF8PrqxY4Z4VJ58fFKEa0RlKqbsi/XnRA==}
|
||||
dependencies:
|
||||
'@daybrush/utils': 1.13.0
|
||||
'@scena/event-emitter': 1.0.5
|
||||
dev: false
|
||||
|
||||
/@scena/event-emitter@1.0.5:
|
||||
resolution: {integrity: sha512-AzY4OTb0+7ynefmWFQ6hxDdk0CySAq/D4efljfhtRHCOP7MBF9zUfhKG3TJiroVjASqVgkRJFdenS8ArZo6Olg==}
|
||||
dependencies:
|
||||
'@daybrush/utils': 1.13.0
|
||||
dev: false
|
||||
|
||||
/@scena/matrix@1.1.1:
|
||||
resolution: {integrity: sha512-JVKBhN0tm2Srl+Yt+Ywqu0oLgLcdemDQlD1OxmN9jaCTwaFPZ7tY8n6dhVgMEaR9qcR7r+kAlMXnSfNyYdE+Vg==}
|
||||
dependencies:
|
||||
'@daybrush/utils': 1.13.0
|
||||
dev: false
|
||||
|
||||
/@sinclair/typebox@0.27.8:
|
||||
resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==}
|
||||
dev: true
|
||||
@@ -4691,43 +4647,6 @@ packages:
|
||||
resolution: {integrity: sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==}
|
||||
dev: false
|
||||
|
||||
/croact-css-styled@1.1.9:
|
||||
resolution: {integrity: sha512-G7yvRiVJ3Eoj0ov2h2xR4312hpOzATay2dGS9clK8yJQothjH1sBXIyvOeRP5wBKD9mPcKcoUXPCPsl0tQog4w==}
|
||||
dependencies:
|
||||
'@daybrush/utils': 1.13.0
|
||||
css-styled: 1.0.8
|
||||
framework-utils: 1.1.0
|
||||
dev: false
|
||||
|
||||
/croact-moveable@0.9.0(croact@1.0.4):
|
||||
resolution: {integrity: sha512-fc3bieV6CdqqZFtzsSLi9KmvUMFW3oakUfhPCls1BxKjOfUfn8rktteGED2341A/Qghy8tI3Hm6SdocIc68IKg==}
|
||||
peerDependencies:
|
||||
croact: ^1.0.4
|
||||
dependencies:
|
||||
'@daybrush/utils': 1.13.0
|
||||
'@egjs/agent': 2.4.4
|
||||
'@egjs/children-differ': 1.0.1
|
||||
'@egjs/list-differ': 1.0.1
|
||||
'@scena/dragscroll': 1.4.0
|
||||
'@scena/event-emitter': 1.0.5
|
||||
'@scena/matrix': 1.1.1
|
||||
croact: 1.0.4
|
||||
croact-css-styled: 1.1.9
|
||||
css-to-mat: 1.1.1
|
||||
framework-utils: 1.1.0
|
||||
gesto: 1.19.4
|
||||
overlap-area: 1.1.0
|
||||
react-css-styled: 1.1.9
|
||||
react-moveable: 0.56.0
|
||||
dev: false
|
||||
|
||||
/croact@1.0.4:
|
||||
resolution: {integrity: sha512-9GhvyzTY/IVUrMQ2iz/mzgZ8+NcjczmIo/t4FkC1CU0CEcau6v6VsEih4jkTa4ZmRgYTF0qXEZLObCzdDFplpw==}
|
||||
dependencies:
|
||||
'@daybrush/utils': 1.13.0
|
||||
'@egjs/list-differ': 1.0.1
|
||||
dev: false
|
||||
|
||||
/cron-validator@1.3.1:
|
||||
resolution: {integrity: sha512-C1HsxuPCY/5opR55G5/WNzyEGDWFVG+6GLrA+fW/sCTcP6A6NTjUP2AK7B8n2PyFs90kDG2qzwm8LMheADku6A==}
|
||||
dev: false
|
||||
@@ -4771,19 +4690,6 @@ packages:
|
||||
nth-check: 2.1.1
|
||||
dev: true
|
||||
|
||||
/css-styled@1.0.8:
|
||||
resolution: {integrity: sha512-tCpP7kLRI8dI95rCh3Syl7I+v7PP+2JYOzWkl0bUEoSbJM+u8ITbutjlQVf0NC2/g4ULROJPi16sfwDIO8/84g==}
|
||||
dependencies:
|
||||
'@daybrush/utils': 1.13.0
|
||||
dev: false
|
||||
|
||||
/css-to-mat@1.1.1:
|
||||
resolution: {integrity: sha512-kvpxFYZb27jRd2vium35G7q5XZ2WJ9rWjDUMNT36M3Hc41qCrLXFM5iEKMGXcrPsKfXEN+8l/riB4QzwwwiEyQ==}
|
||||
dependencies:
|
||||
'@daybrush/utils': 1.13.0
|
||||
'@scena/matrix': 1.1.1
|
||||
dev: false
|
||||
|
||||
/css-tree@2.2.1:
|
||||
resolution: {integrity: sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==}
|
||||
engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: '>=7.0.0'}
|
||||
@@ -5808,10 +5714,6 @@ packages:
|
||||
resolution: {integrity: sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==}
|
||||
dev: false
|
||||
|
||||
/framework-utils@1.1.0:
|
||||
resolution: {integrity: sha512-KAfqli5PwpFJ8o3psRNs8svpMGyCSAe8nmGcjQ0zZBWN2H6dZDnq+ABp3N3hdUmFeMrLtjOCTXD4yplUJIWceg==}
|
||||
dev: false
|
||||
|
||||
/from@0.1.7:
|
||||
resolution: {integrity: sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g==}
|
||||
dev: true
|
||||
@@ -5895,13 +5797,6 @@ packages:
|
||||
resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==}
|
||||
engines: {node: '>=6.9.0'}
|
||||
|
||||
/gesto@1.19.4:
|
||||
resolution: {integrity: sha512-hfr/0dWwh0Bnbb88s3QVJd1ZRJeOWcgHPPwmiH6NnafDYvhTsxg+SLYu+q/oPNh9JS3V+nlr6fNs8kvPAtcRDQ==}
|
||||
dependencies:
|
||||
'@daybrush/utils': 1.13.0
|
||||
'@scena/event-emitter': 1.0.5
|
||||
dev: false
|
||||
|
||||
/get-caller-file@2.0.5:
|
||||
resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}
|
||||
engines: {node: 6.* || 8.* || >= 10.*}
|
||||
@@ -6055,10 +5950,6 @@ packages:
|
||||
strip-bom-string: 1.0.0
|
||||
dev: true
|
||||
|
||||
/gsap@3.12.5:
|
||||
resolution: {integrity: sha512-srBfnk4n+Oe/ZnMIOXt3gT605BX9x5+rh/prT2F1SsNJsU1XuMiP0E2aptW481OnonOGACZWBqseH5Z7csHxhQ==}
|
||||
dev: false
|
||||
|
||||
/gzip-size@6.0.0:
|
||||
resolution: {integrity: sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==}
|
||||
engines: {node: '>=10'}
|
||||
@@ -6231,6 +6122,10 @@ packages:
|
||||
resolution: {integrity: sha512-RUTlGuFj3cU/Qfu5YIrsIZjW34/VDgKOz5fDr64Mc4NWP9b2i48vQ39r5xCl1yyFQeyEG/lASstIQHAUX18rRA==}
|
||||
dev: false
|
||||
|
||||
/ical.js@2.0.1:
|
||||
resolution: {integrity: sha512-uYYb1CwTXbd9NP/xTtgQZ5ivv6bpUjQu9VM98s3X78L3XRu00uJW5ZtmnLwyxhztpf5fSiRyDpFW7ZNCePlaPw==}
|
||||
dev: false
|
||||
|
||||
/iconv-lite@0.6.3:
|
||||
resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
@@ -6755,23 +6650,14 @@ packages:
|
||||
engines: {node: '>=0.10.0'}
|
||||
dev: true
|
||||
|
||||
/jsqr@1.4.0:
|
||||
resolution: {integrity: sha512-dxLob7q65Xg2DvstYkRpkYtmKm2sPJ9oFhrhmudT1dZvNFFTlroai3AWSpLey/w5vMcLBXRgOJsbXpdN9HzU/A==}
|
||||
dev: false
|
||||
|
||||
/jwt-decode@3.1.2:
|
||||
resolution: {integrity: sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==}
|
||||
dev: false
|
||||
|
||||
/keycode@2.2.1:
|
||||
resolution: {integrity: sha512-Rdgz9Hl9Iv4QKi8b0OlCRQEzp4AgVxyCtz5S/+VIHezDmrDhkp2N2TqBWOLz0/gbeREXOOiI9/4b8BY9uw2vFg==}
|
||||
dev: false
|
||||
|
||||
/keycon@1.4.0:
|
||||
resolution: {integrity: sha512-p1NAIxiRMH3jYfTeXRs2uWbVJ1WpEjpi8ktzUyBJsX7/wn2qu2VRXktneBLNtKNxJmlUYxRi9gOJt1DuthXR7A==}
|
||||
dependencies:
|
||||
'@cfcs/core': 0.0.6
|
||||
'@daybrush/utils': 1.13.0
|
||||
'@scena/event-emitter': 1.0.5
|
||||
keycode: 2.2.1
|
||||
dev: false
|
||||
|
||||
/kind-of@6.0.3:
|
||||
resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
@@ -7130,16 +7016,6 @@ packages:
|
||||
resolution: {integrity: sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q==}
|
||||
dev: false
|
||||
|
||||
/moveable@0.53.0:
|
||||
resolution: {integrity: sha512-71jS9zIoQzMhnNvduhg4tUEdm23+fO/40FN7muVMbZvVwbTku2MIxxLhnU4qFvxI4oVxn75l79SbtgjuA+s7Pw==}
|
||||
dependencies:
|
||||
'@daybrush/utils': 1.13.0
|
||||
'@scena/event-emitter': 1.0.5
|
||||
croact: 1.0.4
|
||||
croact-moveable: 0.9.0(croact@1.0.4)
|
||||
react-moveable: 0.56.0
|
||||
dev: false
|
||||
|
||||
/mrmime@1.0.1:
|
||||
resolution: {integrity: sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw==}
|
||||
engines: {node: '>=10'}
|
||||
@@ -7396,12 +7272,6 @@ packages:
|
||||
resolution: {integrity: sha512-PPrr40z5/MPStTTGJ0QtSD9KtaGHmnexBQWANWLWQOZZwbNMf/VyG/Uh29LwxExd51p3S323oM3kHbjRqmBiLg==}
|
||||
dev: false
|
||||
|
||||
/overlap-area@1.1.0:
|
||||
resolution: {integrity: sha512-3dlJgJCaVeXH0/eZjYVJvQiLVVrPO4U1ZGqlATtx6QGO3b5eNM6+JgUKa7oStBTdYuGTk7gVoABCW6Tp+dhRdw==}
|
||||
dependencies:
|
||||
'@daybrush/utils': 1.13.0
|
||||
dev: false
|
||||
|
||||
/p-limit@2.3.0:
|
||||
resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==}
|
||||
engines: {node: '>=6'}
|
||||
@@ -7873,6 +7743,12 @@ packages:
|
||||
engines: {node: '>=6'}
|
||||
dev: true
|
||||
|
||||
/qrcode-parser@2.1.3:
|
||||
resolution: {integrity: sha512-tyakoHUQXCjH1+RGiqxH3/6XqbQuXuSaW0CkUp1AlYT0+XA4ndG7bxxyyWpdnr0Z2Vuv0GRwgKSq6sOzNiQfog==}
|
||||
dependencies:
|
||||
jsqr: 1.4.0
|
||||
dev: false
|
||||
|
||||
/qrcode@1.5.1:
|
||||
resolution: {integrity: sha512-nS8NJ1Z3md8uTjKtP+SGGhfqmTCs5flU/xR623oI0JX+Wepz9R8UrRVCTBTJm3qGw3rH6jJ6MUHjkDx15cxSSg==}
|
||||
engines: {node: '>=10.13.0'}
|
||||
@@ -7908,41 +7784,10 @@ packages:
|
||||
safe-buffer: 5.2.1
|
||||
dev: true
|
||||
|
||||
/react-css-styled@1.1.9:
|
||||
resolution: {integrity: sha512-M7fJZ3IWFaIHcZEkoFOnkjdiUFmwd8d+gTh2bpqMOcnxy/0Gsykw4dsL4QBiKsxcGow6tETUa4NAUcmJF+/nfw==}
|
||||
dependencies:
|
||||
css-styled: 1.0.8
|
||||
framework-utils: 1.1.0
|
||||
dev: false
|
||||
|
||||
/react-is@18.2.0:
|
||||
resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==}
|
||||
dev: true
|
||||
|
||||
/react-moveable@0.56.0:
|
||||
resolution: {integrity: sha512-FmJNmIOsOA36mdxbrc/huiE4wuXSRlmon/o+/OrfNhSiYYYL0AV5oObtPluEhb2Yr/7EfYWBHTxF5aWAvjg1SA==}
|
||||
dependencies:
|
||||
'@daybrush/utils': 1.13.0
|
||||
'@egjs/agent': 2.4.4
|
||||
'@egjs/children-differ': 1.0.1
|
||||
'@egjs/list-differ': 1.0.1
|
||||
'@scena/dragscroll': 1.4.0
|
||||
'@scena/event-emitter': 1.0.5
|
||||
'@scena/matrix': 1.1.1
|
||||
css-to-mat: 1.1.1
|
||||
framework-utils: 1.1.0
|
||||
gesto: 1.19.4
|
||||
overlap-area: 1.1.0
|
||||
react-css-styled: 1.1.9
|
||||
react-selecto: 1.26.3
|
||||
dev: false
|
||||
|
||||
/react-selecto@1.26.3:
|
||||
resolution: {integrity: sha512-Ubik7kWSnZyQEBNro+1k38hZaI1tJarE+5aD/qsqCOA1uUBSjgKVBy3EWRzGIbdmVex7DcxznFZLec/6KZNvwQ==}
|
||||
dependencies:
|
||||
selecto: 1.26.3
|
||||
dev: false
|
||||
|
||||
/read-pkg-up@7.0.1:
|
||||
resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==}
|
||||
engines: {node: '>=8'}
|
||||
@@ -8211,21 +8056,6 @@ packages:
|
||||
resolution: {integrity: sha512-lEV5VB8BUKTo/AfktXJcy+JeXns26ylbMkIUco8CYREsQijuz4mrXres2Q+vMLdwkuLxJdIPQ8IlCIxLYm71Yw==}
|
||||
dev: false
|
||||
|
||||
/selecto@1.26.3:
|
||||
resolution: {integrity: sha512-gZHgqMy5uyB6/2YDjv3Qqaf7bd2hTDOpPdxXlrez4R3/L0GiEWDCFaUfrflomgqdb3SxHF2IXY0Jw0EamZi7cw==}
|
||||
dependencies:
|
||||
'@daybrush/utils': 1.13.0
|
||||
'@egjs/children-differ': 1.0.1
|
||||
'@scena/dragscroll': 1.4.0
|
||||
'@scena/event-emitter': 1.0.5
|
||||
css-styled: 1.0.8
|
||||
css-to-mat: 1.1.1
|
||||
framework-utils: 1.1.0
|
||||
gesto: 1.19.4
|
||||
keycon: 1.4.0
|
||||
overlap-area: 1.1.0
|
||||
dev: false
|
||||
|
||||
/semver@5.7.2:
|
||||
resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==}
|
||||
hasBin: true
|
||||
@@ -9375,15 +9205,6 @@ packages:
|
||||
vue: 3.3.4
|
||||
dev: false
|
||||
|
||||
/vue-color-wheel@0.1.1:
|
||||
resolution: {integrity: sha512-FOZztY9puZM+cVWMd9JdOMDHQKCeOoD8qUeJOeSxw4FheOXuuaKpr9Kep2qSX2gTiLEpTgwiFaUkRQnSCVInAQ==}
|
||||
dependencies:
|
||||
colord: 2.9.3
|
||||
gsap: 3.12.5
|
||||
moveable: 0.53.0
|
||||
vue-sonner: 1.1.4
|
||||
dev: false
|
||||
|
||||
/vue-demi@0.13.11(vue@3.3.4):
|
||||
resolution: {integrity: sha512-IR8HoEEGM65YY3ZJYAjMlKygDQn25D5ajNFNoKh9RSDMQtlzCxtfQjdQgv9jjK+m3377SsJXY8ysq8kLCZL25A==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -9467,10 +9288,6 @@ packages:
|
||||
vue: 3.3.4
|
||||
dev: false
|
||||
|
||||
/vue-sonner@1.1.4:
|
||||
resolution: {integrity: sha512-ATt+o38ALfPBfmaT3rfr10K+mkZ/7EdqZewEZVI3krSc1RaIDK8fI9gQro0Jlh8HZcOHv2oUDJufSIUl/qpdOA==}
|
||||
dev: false
|
||||
|
||||
/vue-template-compiler@2.7.14:
|
||||
resolution: {integrity: sha512-zyA5Y3ArvVG0NacJDkkzJuPQDF8RFeRlzV2vLeSnhSpieO6LK2OVbdLPi5MPPs09Ii+gMO8nY4S3iKQxBxDmWQ==}
|
||||
dependencies:
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { colord, extend } from 'colord';
|
||||
import a11yPlugin from 'colord/plugins/a11y';
|
||||
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { useDebounce } from '@vueuse/core';
|
||||
import type { Harmony, HarmonyType } from 'vue-color-wheel';
|
||||
import { VueColorWheel } from 'vue-color-wheel';
|
||||
|
||||
extend([a11yPlugin]);
|
||||
|
||||
const wheelColor = useDebounce(ref('#40ffff')); // { hue: 0, saturation: 0.68, value: 1 }
|
||||
const colors = ref<Array<Harmony>>([]);
|
||||
const currentType = ref<HarmonyType>('analogous');
|
||||
const isColorReadable = ref(false);
|
||||
const isDarkTheme = useDark();
|
||||
|
||||
const harmonyTypes: { type: HarmonyType; label: string }[] = [
|
||||
{ type: 'monochromatic', label: 'Monochromatic' },
|
||||
{ type: 'complementary', label: 'Complementary' },
|
||||
{ type: 'analogous', label: 'Analogous' },
|
||||
{ type: 'triad', label: 'Triad' },
|
||||
{ type: 'split', label: 'Split' },
|
||||
{ type: 'compound', label: 'Compound' },
|
||||
{ type: 'tetradic', label: 'Tetradic' },
|
||||
{ type: 'square', label: 'Square' },
|
||||
{ type: 'doubleSplit', label: 'Double Split' },
|
||||
];
|
||||
|
||||
const colorList = computed(() => {
|
||||
return colors.value.map(item => colord(item.rgb).toHex());
|
||||
});
|
||||
|
||||
function handleChangeGradient(harmonyColors: Harmony[]) {
|
||||
const newColors = harmonyColors.map(color => colord(color.rgb).toHex());
|
||||
|
||||
const [base, secondary] = newColors;
|
||||
|
||||
const rootEl = document.documentElement;
|
||||
|
||||
// change the colors variables
|
||||
harmonyColors.map((color, index) => {
|
||||
const { r, g, b } = colord(color.rgb).toRgb();
|
||||
rootEl.style.setProperty(`--color${index + 1}`, `${r}, ${g}, ${b}`);
|
||||
return null;
|
||||
});
|
||||
const secondaryRgb = colord(secondary).toRgb();
|
||||
rootEl.style.setProperty(
|
||||
'--color-interactive',
|
||||
`${secondaryRgb.r}, ${secondaryRgb.g}, ${secondaryRgb.b}`,
|
||||
);
|
||||
if (newColors.length === 3) {
|
||||
const lightColor = colord(base).saturate(0.25).toRgb();
|
||||
const darkColor = colord(base).desaturate(0.25).toRgb();
|
||||
rootEl.style.setProperty(
|
||||
'--color4',
|
||||
`${lightColor.r}, ${lightColor.g}, ${lightColor.b}`,
|
||||
);
|
||||
rootEl.style.setProperty(
|
||||
'--color5',
|
||||
`${darkColor.r}, ${darkColor.g}, ${darkColor.b}`,
|
||||
);
|
||||
}
|
||||
|
||||
isColorReadable.value = colord(base).isReadable(
|
||||
isDarkTheme.value ? '#fff' : '#000',
|
||||
{ level: 'AAA' },
|
||||
);
|
||||
}
|
||||
|
||||
function handleChangeColors(harmonyColors: Harmony[]) {
|
||||
colors.value = harmonyColors;
|
||||
}
|
||||
|
||||
watch(
|
||||
() => colors.value,
|
||||
(newColors) => {
|
||||
handleChangeGradient(newColors);
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
},
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div style="max-width: 600px">
|
||||
<c-card title="Pick a color" mb-2>
|
||||
<n-color-picker :value="wheelColor" :show-alpha="false" />
|
||||
<div
|
||||
:style="{ backgroundColor: wheelColor }"
|
||||
/>
|
||||
</c-card>
|
||||
|
||||
<c-card title="Pick a palette type" mb-2>
|
||||
<n-radio-group v-model:value="currentType" name="radiogroup">
|
||||
<n-space>
|
||||
<n-radio
|
||||
v-for="v in harmonyTypes"
|
||||
:key="v.type"
|
||||
:value="v.type"
|
||||
:label="v.label"
|
||||
/>
|
||||
</n-space>
|
||||
</n-radio-group>
|
||||
</c-card>
|
||||
<c-card title="Wheel" mb-2 style="text-align: center">
|
||||
<div style="display: inline-block">
|
||||
<VueColorWheel
|
||||
v-model:color="wheelColor"
|
||||
wheel="aurora"
|
||||
:harmony="currentType"
|
||||
:radius="160"
|
||||
:default-color="wheelColor"
|
||||
:show-brightness="false"
|
||||
@change="handleChangeColors"
|
||||
/>
|
||||
</div>
|
||||
</c-card>
|
||||
<div
|
||||
v-for="(color, i) in colorList"
|
||||
:key="i"
|
||||
mt-1 flex items-center justify-center gap-1
|
||||
>
|
||||
<div
|
||||
p-1
|
||||
:style="{
|
||||
backgroundColor: `${color}`,
|
||||
color: isColorReadable ? '#000' : '#fff',
|
||||
}"
|
||||
>
|
||||
{{ color }}
|
||||
</div>
|
||||
<input-copyable :value="color" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,12 +0,0 @@
|
||||
import { ColorPicker } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Color Wheel',
|
||||
path: '/color-wheel',
|
||||
description: 'Choose a color palette/theme using a wheel and mode',
|
||||
keywords: ['color', 'wheel', 'palette', 'theme'],
|
||||
component: () => import('./color-wheel.vue'),
|
||||
icon: ColorPicker,
|
||||
createdAt: new Date('2024-08-15'),
|
||||
});
|
||||
+8
-3
@@ -2,7 +2,6 @@ import { tool as base64FileConverter } from './base64-file-converter';
|
||||
import { tool as base64StringConverter } from './base64-string-converter';
|
||||
import { tool as basicAuthGenerator } from './basic-auth-generator';
|
||||
import { tool as emailNormalizer } from './email-normalizer';
|
||||
import { tool as colorWheel } from './color-wheel';
|
||||
|
||||
import { tool as asciiTextDrawer } from './ascii-text-drawer';
|
||||
|
||||
@@ -10,6 +9,7 @@ import { tool as textToUnicode } from './text-to-unicode';
|
||||
import { tool as safelinkDecoder } from './safelink-decoder';
|
||||
import { tool as xmlToJson } from './xml-to-json';
|
||||
import { tool as jsonToXml } from './json-to-xml';
|
||||
import { tool as qrCodeDecoder } from './qr-code-decoder';
|
||||
import { tool as markdownToHtml } from './markdown-to-html';
|
||||
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
|
||||
import { tool as numeronymGenerator } from './numeronym-generator';
|
||||
@@ -136,12 +136,17 @@ export const toolsByCategory: ToolCategory[] = [
|
||||
httpStatusCodes,
|
||||
jsonDiff,
|
||||
safelinkDecoder,
|
||||
colorWheel,
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'Images and videos',
|
||||
components: [qrCodeGenerator, wifiQrCodeGenerator, svgPlaceholderGenerator, cameraRecorder],
|
||||
components: [
|
||||
qrCodeGenerator,
|
||||
wifiQrCodeGenerator,
|
||||
qrCodeDecoder,
|
||||
svgPlaceholderGenerator,
|
||||
cameraRecorder,
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'Development',
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
declare module "ical.js" {
|
||||
export function parse(content: string): object;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { Qrcode } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'QR Code decoder',
|
||||
path: '/qr-code-decoder',
|
||||
description: 'QR Code Reader',
|
||||
keywords: ['qrcode', 'qr-code', 'decoder', 'reader'],
|
||||
component: () => import('./qr-code-decoder.vue'),
|
||||
icon: Qrcode,
|
||||
createdAt: new Date('2024-09-01'),
|
||||
});
|
||||
@@ -0,0 +1,151 @@
|
||||
import { describe, expect, test } from 'vitest';
|
||||
import { parseQRData } from './qr-code-decoder.service';
|
||||
|
||||
describe('qr-code-decoder', () => {
|
||||
test('parseQRData should parse content correctly', () => {
|
||||
expect(parseQRData(null)).toEqual({
|
||||
type: 'Unknown',
|
||||
value: '',
|
||||
});
|
||||
expect(parseQRData('')).toEqual({
|
||||
type: 'Unknown',
|
||||
value: '',
|
||||
});
|
||||
expect(parseQRData('TEL:+33123456')).toEqual({
|
||||
type: 'Phone',
|
||||
value: '+33123456',
|
||||
});
|
||||
expect(parseQRData('MATMSG:TO: email@example.com;SUB:email subject;BODY:Email text;;')).toEqual({
|
||||
type: 'Email',
|
||||
value: {
|
||||
body: 'Email text',
|
||||
subject: 'email subject',
|
||||
to: 'email@example.com',
|
||||
},
|
||||
});
|
||||
expect(parseQRData('mailto:email@example.com?subject=email subject&body=Email text')).toEqual({
|
||||
type: 'Email',
|
||||
value: {
|
||||
body: 'Email text',
|
||||
subject: 'email subject',
|
||||
to: 'email@example.com',
|
||||
},
|
||||
});
|
||||
expect(parseQRData('SMTP:email@example.com:email subject:Email text')).toEqual({
|
||||
type: 'Email',
|
||||
value: {
|
||||
body: 'Email text',
|
||||
subject: 'email subject',
|
||||
to: 'email@example.com',
|
||||
},
|
||||
});
|
||||
expect(parseQRData('smsto:+33315555:message')).toEqual({
|
||||
type: 'SMS',
|
||||
value: {
|
||||
message: 'message',
|
||||
to: '+33315555',
|
||||
},
|
||||
});
|
||||
expect(parseQRData('WIFI:T:nopass;S:ssid;H:true;')).toEqual({
|
||||
type: 'Wifi',
|
||||
value: {
|
||||
authentication: 'nopass',
|
||||
hidden: 'true',
|
||||
name: 'ssid',
|
||||
password: undefined,
|
||||
},
|
||||
});
|
||||
expect(parseQRData('WIFI:T:WPA;S:ssid;P:password;H:false;')).toEqual({
|
||||
type: 'Wifi',
|
||||
value: {
|
||||
authentication: 'WPA',
|
||||
hidden: 'false',
|
||||
name: 'ssid',
|
||||
password: 'password', // NOSONAR
|
||||
},
|
||||
});
|
||||
expect(parseQRData('BEGIN:VCALENDAR\nPRODID:-//xyz Corp//NONSGML PDA Calendar Version 1.0//EN\nVERSION:2.0\nBEGIN:VEVENT\nDTSTAMP:19960704T120000Z\nUID:uid1@example.com\nORGANIZER:mailto:jsmith@example.com\nDTSTART:19960918T143000Z\nDTEND:19960920T220000Z\nSTATUS:CONFIRMED\nCATEGORIES:CONFERENCE\nSUMMARY:Networld+Interop Conference\nDESCRIPTION:Networld+Interop Conference\n and Exhibit\\nAtlanta World Congress Center\\n\n Atlanta\\, Georgia\nEND:VEVENT\nEND:VCALENDAR'))
|
||||
.toEqual({
|
||||
type: 'iCal',
|
||||
value: [
|
||||
'vcalendar',
|
||||
[
|
||||
[
|
||||
'prodid',
|
||||
{},
|
||||
'text',
|
||||
'-//xyz Corp//NONSGML PDA Calendar Version 1.0//EN',
|
||||
],
|
||||
[
|
||||
'version',
|
||||
{},
|
||||
'text',
|
||||
'2.0',
|
||||
],
|
||||
],
|
||||
[
|
||||
[
|
||||
'vevent',
|
||||
[
|
||||
[
|
||||
'dtstamp',
|
||||
{},
|
||||
'date-time',
|
||||
'1996-07-04T12:00:00Z',
|
||||
],
|
||||
[
|
||||
'uid',
|
||||
{},
|
||||
'text',
|
||||
'uid1@example.com',
|
||||
],
|
||||
[
|
||||
'organizer',
|
||||
{},
|
||||
'cal-address',
|
||||
'mailto:jsmith@example.com',
|
||||
],
|
||||
[
|
||||
'dtstart',
|
||||
{},
|
||||
'date-time',
|
||||
'1996-09-18T14:30:00Z',
|
||||
],
|
||||
[
|
||||
'dtend',
|
||||
{},
|
||||
'date-time',
|
||||
'1996-09-20T22:00:00Z',
|
||||
],
|
||||
[
|
||||
'status',
|
||||
{},
|
||||
'text',
|
||||
'CONFIRMED',
|
||||
],
|
||||
[
|
||||
'categories',
|
||||
{},
|
||||
'text',
|
||||
'CONFERENCE',
|
||||
],
|
||||
[
|
||||
'summary',
|
||||
{},
|
||||
'text',
|
||||
'Networld+Interop Conference',
|
||||
],
|
||||
[
|
||||
'description',
|
||||
{},
|
||||
'text',
|
||||
'Networld+Interop Conference and Exhibit\nAtlanta World Congress Center\nAtlanta, Georgia',
|
||||
],
|
||||
],
|
||||
[],
|
||||
],
|
||||
],
|
||||
],
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,83 @@
|
||||
import ICAL from 'ical.js';
|
||||
|
||||
export function parseQRData(qrContent: string | null) {
|
||||
if (!qrContent) {
|
||||
return { type: 'Unknown', value: '' };
|
||||
}
|
||||
if (qrContent.startsWith('BEGIN:VCALENDAR')) {
|
||||
return { type: 'iCal', value: ICAL.parse(qrContent?.trim()) };
|
||||
}
|
||||
if (qrContent.startsWith('TEL:')) {
|
||||
return { type: 'Phone', value: qrContent.substring(4)?.trim() };
|
||||
}
|
||||
if (qrContent.startsWith('MATMSG:')) {
|
||||
// MATMSG:TO: email@example.com;SUB:email subject;BODY:Email text;;
|
||||
const parsing = /^MATMSG:(?:TO:([^;]*);)?(?:SUB:([^;]*);)?(?:BODY:([^;]*))?;;$/.exec(qrContent) || [];
|
||||
return {
|
||||
type: 'Email',
|
||||
value: {
|
||||
to: parsing[1]?.trim(),
|
||||
subject: parsing[2]?.trim(),
|
||||
body: parsing[3]?.trim(),
|
||||
},
|
||||
};
|
||||
}
|
||||
if (qrContent.startsWith('mailto:')) {
|
||||
// mailto:email@example.com?subject=email subject&body=Email text
|
||||
const parsing = /^mailto:([^\?]+)\?subject=([^\&]*)(?:&body=(.*))$/.exec(qrContent) || [];
|
||||
return {
|
||||
type: 'Email',
|
||||
value: {
|
||||
to: parsing[1]?.trim(),
|
||||
subject: parsing[2]?.trim(),
|
||||
body: parsing[3]?.trim(),
|
||||
},
|
||||
};
|
||||
}
|
||||
if (qrContent.startsWith('SMTP:')) {
|
||||
// SMTP:email@example.com:email subject:Email text
|
||||
const parsing = /^SMTP:([^:]+)(?::([^:]*))(?::([^:]*))?$/.exec(qrContent) || [];
|
||||
return {
|
||||
type: 'Email',
|
||||
value: {
|
||||
to: parsing[1]?.trim(),
|
||||
subject: parsing[2]?.trim(),
|
||||
body: parsing[3]?.trim(),
|
||||
},
|
||||
};
|
||||
}
|
||||
if (qrContent.startsWith('smsto:')) {
|
||||
// smsto:${phoneNumber}:${message}
|
||||
const parsing = /^smsto:([^:]+)(?::(.+))$/.exec(qrContent) || [];
|
||||
return {
|
||||
type: 'SMS',
|
||||
value: {
|
||||
to: parsing[1]?.trim(),
|
||||
message: parsing[2]?.trim(),
|
||||
},
|
||||
};
|
||||
}
|
||||
if (qrContent.startsWith('WIFI:')) {
|
||||
// WIFI:T:${authentication};S:${name};${authentication !== 'nopass' ? `P:${password};` : ''}H:${hidden};
|
||||
const parsing = /^WIFI:T:([^;]+);S:([^;]+);(?:P:([^;]+);)?(?:H:([^;]+);)?$/.exec(qrContent) || [];
|
||||
return {
|
||||
type: 'Wifi',
|
||||
value: {
|
||||
authentication: parsing[1]?.trim(),
|
||||
name: parsing[2]?.trim(),
|
||||
password: parsing[3]?.trim(),
|
||||
hidden: parsing[4]?.trim(),
|
||||
},
|
||||
};
|
||||
}
|
||||
if (/^(?:https?|ftp):\/\//.test(qrContent)) {
|
||||
return {
|
||||
type: 'Url',
|
||||
value: qrContent,
|
||||
};
|
||||
}
|
||||
return {
|
||||
type: 'Text',
|
||||
value: qrContent,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<script setup lang="ts">
|
||||
import type { Ref } from 'vue';
|
||||
import qrcodeParser from 'qrcode-parser';
|
||||
import { parseQRData } from './qr-code-decoder.service';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
|
||||
const fileInput = ref() as Ref<File>;
|
||||
const qrCode = computedAsync(async () => {
|
||||
try {
|
||||
return (await qrcodeParser(fileInput.value));
|
||||
}
|
||||
catch (e: any) {
|
||||
return e.toString();
|
||||
}
|
||||
});
|
||||
const qrCodeParsed = computed(() => {
|
||||
try {
|
||||
const parsed = parseQRData(qrCode.value);
|
||||
return `Type: ${parsed.type}\nValue:${JSON.stringify(parsed.value, null, 2)}`;
|
||||
}
|
||||
catch (e: any) {
|
||||
return e.toString();
|
||||
}
|
||||
});
|
||||
|
||||
async function onUpload(file: File) {
|
||||
if (file) {
|
||||
fileInput.value = file;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<c-file-upload
|
||||
title="Drag and drop a QR Code here, or click to select a file"
|
||||
:paste-image="true"
|
||||
@file-upload="onUpload"
|
||||
/>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<div>
|
||||
<h3>Decoded</h3>
|
||||
<TextareaCopyable
|
||||
:value="qrCode"
|
||||
:word-wrap="true"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<h3>Parsed</h3>
|
||||
<TextareaCopyable
|
||||
:value="qrCodeParsed"
|
||||
:word-wrap="true"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
::v-deep(.n-upload-trigger) {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -5,10 +5,12 @@ const props = withDefaults(defineProps<{
|
||||
multiple?: boolean
|
||||
accept?: string
|
||||
title?: string
|
||||
pasteImage?: boolean
|
||||
}>(), {
|
||||
multiple: false,
|
||||
accept: undefined,
|
||||
title: 'Drag and drop files here, or click to select files',
|
||||
pasteImage: false,
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -16,11 +18,31 @@ const emit = defineEmits<{
|
||||
(event: 'fileUpload', file: File): void
|
||||
}>();
|
||||
|
||||
const { multiple } = toRefs(props);
|
||||
const { multiple, pasteImage } = toRefs(props);
|
||||
|
||||
const isOverDropZone = ref(false);
|
||||
|
||||
function toBase64(file: File) {
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
const reader = new FileReader();
|
||||
reader.readAsDataURL(file);
|
||||
reader.onload = () => resolve(reader.result?.toString() ?? '');
|
||||
reader.onerror = error => reject(error);
|
||||
});
|
||||
}
|
||||
|
||||
const fileInput = ref<HTMLInputElement | null>(null);
|
||||
const imgPreview = ref<HTMLImageElement | null>(null);
|
||||
async function handlePreview(image: File) {
|
||||
if (imgPreview.value) {
|
||||
imgPreview.value.src = await toBase64(image);
|
||||
}
|
||||
}
|
||||
function clearPreview() {
|
||||
if (imgPreview.value) {
|
||||
imgPreview.value.src = '';
|
||||
}
|
||||
}
|
||||
|
||||
function triggerFileInput() {
|
||||
fileInput.value?.click();
|
||||
@@ -39,7 +61,30 @@ function handleDrop(event: DragEvent) {
|
||||
handleUpload(files);
|
||||
}
|
||||
|
||||
function handleUpload(files: FileList | null | undefined) {
|
||||
async function onPasteImage(evt: ClipboardEvent) {
|
||||
if (!pasteImage.value) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const items = evt.clipboardData?.items;
|
||||
if (!items) {
|
||||
return false;
|
||||
}
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
if (items[i].type.includes('image')) {
|
||||
const imageFile = items[i].getAsFile();
|
||||
if (imageFile) {
|
||||
await handlePreview(imageFile);
|
||||
emit('fileUpload', imageFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
async function handleUpload(files: FileList | null | undefined) {
|
||||
clearPreview();
|
||||
|
||||
if (_.isNil(files) || _.isEmpty(files)) {
|
||||
return;
|
||||
}
|
||||
@@ -49,6 +94,7 @@ function handleUpload(files: FileList | null | undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
await handlePreview(files[0]);
|
||||
emit('fileUpload', files[0]);
|
||||
}
|
||||
</script>
|
||||
@@ -60,6 +106,7 @@ function handleUpload(files: FileList | null | undefined) {
|
||||
'border-primary border-opacity-100': isOverDropZone,
|
||||
}"
|
||||
@click="triggerFileInput"
|
||||
@paste.prevent="onPasteImage"
|
||||
@drop.prevent="handleDrop"
|
||||
@dragover.prevent
|
||||
@dragenter="isOverDropZone = true"
|
||||
@@ -73,6 +120,7 @@ function handleUpload(files: FileList | null | undefined) {
|
||||
:accept="accept"
|
||||
@change="handleFileInput"
|
||||
>
|
||||
|
||||
<slot>
|
||||
<span op-70>
|
||||
{{ title }}
|
||||
@@ -90,6 +138,22 @@ function handleUpload(files: FileList | null | undefined) {
|
||||
<c-button>
|
||||
Browse files
|
||||
</c-button>
|
||||
|
||||
<div v-if="pasteImage">
|
||||
<!-- separator -->
|
||||
<div my-4 w-full flex items-center justify-center op-70>
|
||||
<div class="h-1px max-w-100px flex-1 bg-gray-300 op-50" />
|
||||
<div class="mx-2 text-gray-400">
|
||||
or
|
||||
</div>
|
||||
<div class="h-1px max-w-100px flex-1 bg-gray-300 op-50" />
|
||||
</div>
|
||||
|
||||
<p>Paste an image from clipboard</p>
|
||||
</div>
|
||||
</slot>
|
||||
<div mt-2>
|
||||
<img ref="imgPreview" width="150">
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
Reference in new issue
Block a user