@sedoo/unidoo 0.1.75 → 0.2.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/dist/unidoo/404.html +25 -0
- package/dist/unidoo/README.html +28 -0
- package/dist/unidoo/api-examples.html +115 -0
- package/dist/unidoo/assets/README.md.BZ5Xhpv0.js +1 -0
- package/dist/unidoo/assets/README.md.BZ5Xhpv0.lean.js +1 -0
- package/dist/unidoo/assets/api-examples.md.DBhC6zLa.js +16 -0
- package/dist/unidoo/assets/api-examples.md.DBhC6zLa.lean.js +1 -0
- package/dist/unidoo/assets/app._GYTos2W.js +1 -0
- package/dist/unidoo/assets/captcha_README.md.DD-ycQoE.js +14 -0
- package/dist/unidoo/assets/captcha_README.md.DD-ycQoE.lean.js +1 -0
- package/dist/unidoo/assets/chunks/framework.BNUUHgeN.js +20 -0
- package/dist/unidoo/assets/chunks/theme.dgUwZt0m.js +17 -0
- package/dist/unidoo/assets/confirm-dialog_README.md.TA2YAyOM.js +40 -0
- package/dist/unidoo/assets/confirm-dialog_README.md.TA2YAyOM.lean.js +1 -0
- package/dist/unidoo/assets/crud-table_README.md.DssifgeL.js +24 -0
- package/dist/unidoo/assets/crud-table_README.md.DssifgeL.lean.js +1 -0
- package/dist/unidoo/assets/index.md.D-nQzHqq.js +1 -0
- package/dist/unidoo/assets/index.md.D-nQzHqq.lean.js +1 -0
- package/dist/unidoo/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 +0 -0
- package/dist/unidoo/assets/inter-italic-cyrillic.By2_1cv3.woff2 +0 -0
- package/dist/unidoo/assets/inter-italic-greek-ext.1u6EdAuj.woff2 +0 -0
- package/dist/unidoo/assets/inter-italic-greek.DJ8dCoTZ.woff2 +0 -0
- package/dist/unidoo/assets/inter-italic-latin-ext.CN1xVJS-.woff2 +0 -0
- package/dist/unidoo/assets/inter-italic-latin.C2AdPX0b.woff2 +0 -0
- package/dist/unidoo/assets/inter-italic-vietnamese.BSbpV94h.woff2 +0 -0
- package/dist/unidoo/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 +0 -0
- package/dist/unidoo/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 +0 -0
- package/dist/unidoo/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 +0 -0
- package/dist/unidoo/assets/inter-roman-greek.BBVDIX6e.woff2 +0 -0
- package/dist/unidoo/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 +0 -0
- package/dist/unidoo/assets/inter-roman-latin.Di8DUHzh.woff2 +0 -0
- package/dist/unidoo/assets/inter-roman-vietnamese.BjW4sHH5.woff2 +0 -0
- package/dist/unidoo/assets/markdown-examples.md.qFdbvAEC.js +33 -0
- package/dist/unidoo/assets/markdown-examples.md.qFdbvAEC.lean.js +1 -0
- package/dist/unidoo/assets/style.DcdIs2mU.css +5 -0
- package/dist/unidoo/assets/unidoo-alert_README.md.CDBoKUvE.js +21 -0
- package/dist/unidoo/assets/unidoo-alert_README.md.CDBoKUvE.lean.js +1 -0
- package/dist/unidoo/assets/unidoo-formatError_README.md.D88kRSAN.js +20 -0
- package/dist/unidoo/assets/unidoo-formatError_README.md.D88kRSAN.lean.js +1 -0
- package/dist/unidoo/assets/unidoo-heatmap_README.md.CWPHTlQQ.js +9 -0
- package/dist/unidoo/assets/unidoo-heatmap_README.md.CWPHTlQQ.lean.js +1 -0
- package/dist/unidoo/assets/unidoo-integration_README.md.BfYvxL4t.js +3 -0
- package/dist/unidoo/assets/unidoo-integration_README.md.BfYvxL4t.lean.js +1 -0
- package/dist/unidoo/assets/unidoo-keycloak_README.md.BFwhUR1e.js +94 -0
- package/dist/unidoo/assets/unidoo-keycloak_README.md.BFwhUR1e.lean.js +1 -0
- package/dist/unidoo/assets/unidoo-mapgeofeatures_README.md.DRFYhHxL.js +17 -0
- package/dist/unidoo/assets/unidoo-mapgeofeatures_README.md.DRFYhHxL.lean.js +1 -0
- package/dist/unidoo/assets/unidoo-markdown_README.md.CJiUs_1Z.js +3 -0
- package/dist/unidoo/assets/unidoo-markdown_README.md.CJiUs_1Z.lean.js +1 -0
- package/dist/unidoo/assets/unidoo-player_README.md.C-ZkMmPM.js +41 -0
- package/dist/unidoo/assets/unidoo-player_README.md.C-ZkMmPM.lean.js +1 -0
- package/dist/unidoo/assets/unidoo-sso-users_README.md.CW5npEfC.js +1 -0
- package/dist/unidoo/assets/unidoo-sso-users_README.md.CW5npEfC.lean.js +1 -0
- package/dist/unidoo/assets/unidoo-trajectorymap_README.md.SsigyJ2k.js +4 -0
- package/dist/unidoo/assets/unidoo-trajectorymap_README.md.SsigyJ2k.lean.js +1 -0
- package/dist/unidoo/assets/unidoo-uuid_README.md.ciL1hMaH.js +7 -0
- package/dist/unidoo/assets/unidoo-uuid_README.md.ciL1hMaH.lean.js +1 -0
- package/dist/unidoo/assets/unidoo-viewer_README.md.ClgkM8DW.js +4 -0
- package/dist/unidoo/assets/unidoo-viewer_README.md.ClgkM8DW.lean.js +1 -0
- package/dist/unidoo/captcha/README.html +41 -0
- package/dist/unidoo/confirm-dialog/README.html +67 -0
- package/dist/unidoo/crud-table/README.html +51 -0
- package/dist/unidoo/hashmap.json +1 -0
- package/dist/unidoo/index.html +28 -0
- package/dist/unidoo/markdown-examples.html +60 -0
- package/dist/unidoo/unidoo-alert/README.html +48 -0
- package/dist/unidoo/unidoo-formatError/README.html +47 -0
- package/dist/unidoo/unidoo-heatmap/README.html +36 -0
- package/dist/unidoo/unidoo-integration/README.html +30 -0
- package/dist/unidoo/unidoo-keycloak/README.html +121 -0
- package/dist/unidoo/unidoo-mapgeofeatures/README.html +44 -0
- package/dist/unidoo/unidoo-markdown/README.html +30 -0
- package/dist/unidoo/unidoo-player/README.html +68 -0
- package/dist/unidoo/unidoo-sso-users/README.html +28 -0
- package/dist/unidoo/unidoo-trajectorymap/README.html +31 -0
- package/dist/unidoo/unidoo-uuid/README.html +34 -0
- package/dist/unidoo/unidoo-viewer/README.html +31 -0
- package/dist/unidoo/unidoo.css +1 -0
- package/dist/unidoo/unidoo.es.js +290 -0
- package/dist/unidoo/unidoo.umd.js +1 -1888
- package/dist/unidoo/vp-icons.css +1 -0
- package/package.json +29 -34
- package/src/components/UnidooAlert.vue +166 -117
- package/src/components/UnidooCaptcha.vue +70 -84
- package/src/globals.js +22 -0
- package/src/index.js +7 -0
- package/src/plugin.js +23 -278
- package/src/plugin.js.old +281 -0
- package/src/services/alertService.js +102 -0
- package/src/services/uuidService.js +25 -0
- package/dist/auth/auth.common.js +0 -11
- package/dist/auth/auth.umd.js +0 -11
- package/dist/auth/auth.umd.min.js +0 -11
- package/dist/auth/demo.html +0 -8
- package/dist/unidoo/demo.html +0 -8
- package/dist/unidoo/unidoo.common.js +0 -1888
- package/dist/unidoo/unidoo.umd.min.js +0 -1888
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.vpi-social-github{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E")}
|
package/package.json
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sedoo/unidoo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"private": false,
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"registry": "https://registry.npmjs.org/",
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
5
9
|
"scripts": {
|
|
6
|
-
"build": "npm run build:unidoo
|
|
7
|
-
"build:unidoo": "
|
|
10
|
+
"build": "npm run build:unidoo",
|
|
11
|
+
"build:unidoo": "vite build",
|
|
8
12
|
"build:auth": "vue-cli-service build --target lib --dest dist/auth --name auth src/auth.js",
|
|
9
|
-
"lint": "
|
|
10
|
-
"docs:dev": "
|
|
11
|
-
"docs:build": "
|
|
12
|
-
"publish:local": "eval $(grep '^CI_NPMJS_TOKEN' .env.local) && npm config set -- '//registry.npmjs.org/:_authToken' \"${CI_NPMJS_TOKEN}\" && npm publish --access public"
|
|
13
|
+
"lint": "vite lint --fix && vite lint dev --fix",
|
|
14
|
+
"docs:dev": "vitepress dev docs",
|
|
15
|
+
"docs:build": "vitepress build docs",
|
|
16
|
+
"publish:local": "eval $(grep '^CI_NPMJS_TOKEN' .env.local) && npm config set -- '//registry.npmjs.org/:_authToken' \"${CI_NPMJS_TOKEN}\" && npm publish --access public",
|
|
17
|
+
"docs:preview": "vitepress preview docs"
|
|
13
18
|
},
|
|
14
19
|
"comments": {
|
|
15
20
|
"scripts": "The build and docs:build script are used in the continuous integration process. They musn't be removed."
|
|
@@ -20,47 +25,33 @@
|
|
|
20
25
|
"src/**/*"
|
|
21
26
|
],
|
|
22
27
|
"dependencies": {
|
|
28
|
+
"axios": "^1.19.0",
|
|
23
29
|
"date-fns": "^2.30.0",
|
|
24
30
|
"date-fns-tz": "^1.3.8",
|
|
25
31
|
"dompurify": "^3.2.4",
|
|
26
|
-
"keycloak-js": "^
|
|
32
|
+
"keycloak-js": "^26.2.3",
|
|
27
33
|
"marked": "^0.8.2",
|
|
34
|
+
"mitt": "^3.0.1",
|
|
28
35
|
"moment": "^2.30.1",
|
|
29
36
|
"ol": "^6.15.1",
|
|
30
37
|
"ol-ext": "^4.0.23",
|
|
31
38
|
"v-tooltip": "^2.1.3",
|
|
32
|
-
"vue
|
|
33
|
-
"vue-
|
|
39
|
+
"vue": "^3.5.43",
|
|
40
|
+
"vue-axios": "3.6.0",
|
|
41
|
+
"vuetify": "^3.13.4"
|
|
34
42
|
},
|
|
35
43
|
"devDependencies": {
|
|
36
|
-
"
|
|
37
|
-
"@vue/cli-plugin-babel": "^4.5.19",
|
|
38
|
-
"@vue/cli-plugin-eslint": "^4.5.19",
|
|
39
|
-
"@vue/cli-service": "^4.5.19",
|
|
40
|
-
"@vue/eslint-config-standard": "5.1.2",
|
|
41
|
-
"axios": "0.21.2",
|
|
44
|
+
"@vitejs/plugin-vue": "^5.2.3",
|
|
42
45
|
"babel-eslint": "10.1.0",
|
|
46
|
+
"caniuse-lite": "^1.0.30001741",
|
|
43
47
|
"core-js": "3.6.5",
|
|
44
48
|
"eslint": "^7.32.0",
|
|
45
|
-
"eslint-plugin-import": "2.22.1",
|
|
46
|
-
"eslint-plugin-node": "11.1.0",
|
|
47
|
-
"eslint-plugin-promise": "4.2.1",
|
|
48
|
-
"eslint-plugin-standard": "4.0.0",
|
|
49
49
|
"eslint-plugin-vue": "7.0.1",
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"vue": "2.6.14",
|
|
54
|
-
"vue-cli-plugin-vuetify": "2.0.7",
|
|
50
|
+
"vite": "^6.2.4",
|
|
51
|
+
"vite-plugin-vuetify": "^2.1.3",
|
|
52
|
+
"vitepress": "^1.6.4",
|
|
55
53
|
"vue-json-tree": "0.4.3",
|
|
56
|
-
"vue-json-tree-view": "2.1.6"
|
|
57
|
-
"vue-server-renderer": "2.6.14",
|
|
58
|
-
"vue-template-compiler": "2.6.14",
|
|
59
|
-
"vuepress": "1.8.2",
|
|
60
|
-
"vuetify": "2.3.13",
|
|
61
|
-
"vuetify-loader": "1.6.0",
|
|
62
|
-
"webpack-bundle-analyzer": "^4.10.2",
|
|
63
|
-
"webpack-cdn-upload-plugin": "2.0.2"
|
|
54
|
+
"vue-json-tree-view": "2.1.6"
|
|
64
55
|
},
|
|
65
56
|
"eslintConfig": {
|
|
66
57
|
"root": true,
|
|
@@ -88,7 +79,11 @@
|
|
|
88
79
|
],
|
|
89
80
|
"description": "Commons components to simplify vuetify based application developement",
|
|
90
81
|
"exports": {
|
|
91
|
-
".":
|
|
82
|
+
".": {
|
|
83
|
+
"import": "./dist/unidoo/unidoo.es.js",
|
|
84
|
+
"require": "./dist/unidoo/unidoo.umd.js"
|
|
85
|
+
},
|
|
86
|
+
"./style.css": "./dist/unidoo/style.css"
|
|
92
87
|
},
|
|
93
88
|
"repository": {
|
|
94
89
|
"type": "git",
|
|
@@ -1,126 +1,175 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
</
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
2
|
+
<v-snackbar
|
|
3
|
+
v-model="snackbar"
|
|
4
|
+
:color="type"
|
|
5
|
+
:timeout="timeout"
|
|
6
|
+
:location="snackbarLocation"
|
|
7
|
+
>
|
|
8
|
+
<v-container>
|
|
9
|
+
<v-row>
|
|
10
|
+
<v-progress-linear
|
|
11
|
+
absolute
|
|
12
|
+
top
|
|
13
|
+
rounded
|
|
14
|
+
rounded-bar
|
|
15
|
+
:model-value="progressValue"
|
|
16
|
+
:color="progressColor"
|
|
17
|
+
/>
|
|
18
|
+
</v-row>
|
|
19
|
+
|
|
20
|
+
<v-row align="center">
|
|
21
|
+
<span>{{ message }}</span>
|
|
22
|
+
|
|
23
|
+
<v-spacer />
|
|
24
|
+
|
|
25
|
+
<v-btn
|
|
26
|
+
variant="text"
|
|
27
|
+
@click="snackbar = false"
|
|
28
|
+
>
|
|
29
|
+
{{ closeButtonLabel }}
|
|
30
|
+
</v-btn>
|
|
31
|
+
</v-row>
|
|
32
|
+
</v-container>
|
|
33
|
+
</v-snackbar>
|
|
32
34
|
</template>
|
|
33
35
|
|
|
34
|
-
<script>
|
|
35
|
-
import
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
36
|
+
<script setup>
|
|
37
|
+
import {
|
|
38
|
+
computed,
|
|
39
|
+
inject,
|
|
40
|
+
onBeforeUnmount,
|
|
41
|
+
onMounted,
|
|
42
|
+
ref,
|
|
43
|
+
watch
|
|
44
|
+
} from 'vue'
|
|
45
|
+
|
|
46
|
+
const eventBus = inject('unidooEventBus')
|
|
47
|
+
|
|
48
|
+
if (!eventBus) {
|
|
49
|
+
throw new Error(
|
|
50
|
+
'UnidooAlert must be used after Plugin Unidoo is installed.'
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const defaultAlertParams = {
|
|
55
|
+
position: 'top',
|
|
56
|
+
timeout: 4000,
|
|
57
|
+
type: 'info',
|
|
58
|
+
closeButtonLabel: 'Close'
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const snackbar = ref(false)
|
|
62
|
+
const message = ref('')
|
|
63
|
+
const currentTime = ref(0)
|
|
64
|
+
const timer = ref(null)
|
|
65
|
+
const position = ref(defaultAlertParams.position)
|
|
66
|
+
const timeout = ref(defaultAlertParams.timeout)
|
|
67
|
+
const type = ref(defaultAlertParams.type)
|
|
68
|
+
const closeButtonLabel = ref(defaultAlertParams.closeButtonLabel)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
const progressValue = computed(() => {
|
|
72
|
+
if (!timeout.value) {
|
|
73
|
+
return 0
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return Math.max(
|
|
77
|
+
0,
|
|
78
|
+
Math.floor(100 * (1 - currentTime.value / timeout.value))
|
|
79
|
+
)
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
const progressColor = computed(() => {
|
|
83
|
+
switch (type.value) {
|
|
84
|
+
case 'success':
|
|
85
|
+
return '#1B5E20'
|
|
86
|
+
case 'error':
|
|
87
|
+
return '#D50000'
|
|
88
|
+
case 'warning':
|
|
89
|
+
return '#E65100'
|
|
90
|
+
default:
|
|
91
|
+
return undefined
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
const snackbarLocation = computed(() => {
|
|
96
|
+
switch (position.value) {
|
|
97
|
+
case 'top':
|
|
98
|
+
return 'top'
|
|
99
|
+
case 'bottom':
|
|
100
|
+
return 'bottom'
|
|
101
|
+
case 'centered':
|
|
102
|
+
case 'center':
|
|
103
|
+
return 'center'
|
|
104
|
+
default:
|
|
105
|
+
return position.value
|
|
106
|
+
}
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
function show(params = {}) {
|
|
110
|
+
currentTime.value = 0
|
|
111
|
+
message.value = params.message ?? ''
|
|
112
|
+
position.value = params.position ?? defaultAlertParams.position
|
|
113
|
+
timeout.value = params.timeout ?? defaultAlertParams.timeout
|
|
114
|
+
type.value = params.type ?? defaultAlertParams.type
|
|
115
|
+
closeButtonLabel.value = params.closeButtonLabel ?? defaultAlertParams.closeButtonLabel
|
|
116
|
+
|
|
117
|
+
snackbar.value = true
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function updateParams(params = {}) {
|
|
121
|
+
position.value = params.position ?? position.value
|
|
122
|
+
timeout.value = params.timeout ?? timeout.value
|
|
123
|
+
type.value = params.type ?? type.value
|
|
124
|
+
closeButtonLabel.value =
|
|
125
|
+
params.closeButtonLabel ?? closeButtonLabel.value
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function stopTimer() {
|
|
129
|
+
if (timer.value !== null) {
|
|
130
|
+
clearInterval(timer.value)
|
|
131
|
+
timer.value = null
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function startTimer() {
|
|
136
|
+
stopTimer()
|
|
137
|
+
|
|
138
|
+
if (!timeout.value) {
|
|
139
|
+
return
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
timer.value = setInterval(() => {
|
|
143
|
+
currentTime.value += 100
|
|
144
|
+
|
|
145
|
+
if (currentTime.value >= timeout.value) {
|
|
146
|
+
stopTimer()
|
|
147
|
+
}
|
|
148
|
+
}, 100)
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
watch(snackbar, (value) => {
|
|
152
|
+
if (value) {
|
|
153
|
+
startTimer()
|
|
154
|
+
} else {
|
|
155
|
+
stopTimer()
|
|
156
|
+
}
|
|
157
|
+
})
|
|
158
|
+
|
|
159
|
+
onMounted(() => {
|
|
160
|
+
eventBus.on('unidoo-alert-show', show)
|
|
161
|
+
eventBus.on('unidoo-alert-params', updateParams)
|
|
162
|
+
})
|
|
163
|
+
|
|
164
|
+
onBeforeUnmount(() => {
|
|
165
|
+
eventBus.off('unidoo-alert-show', show)
|
|
166
|
+
eventBus.off('unidoo-alert-params', updateParams)
|
|
167
|
+
stopTimer()
|
|
168
|
+
})
|
|
120
169
|
</script>
|
|
121
170
|
|
|
122
171
|
<style scoped>
|
|
123
|
-
.v-
|
|
172
|
+
.v-snackbar {
|
|
124
173
|
z-index: 2000;
|
|
125
174
|
}
|
|
126
175
|
</style>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<span>
|
|
3
|
-
<div ref="
|
|
3
|
+
<div ref="captchaRef"></div>
|
|
4
4
|
<div>
|
|
5
5
|
<v-text-field :label="textFieldLabel" v-model="text"></v-text-field>
|
|
6
6
|
<v-btn :color="color" @click="refresh">{{ refreshButtonLabel }}</v-btn>
|
|
@@ -8,98 +8,84 @@
|
|
|
8
8
|
</span>
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
|
-
<script>
|
|
12
|
-
|
|
13
|
-
components: {},
|
|
11
|
+
<script setup>
|
|
12
|
+
import { computed, ref, watch, onMounted } from "vue";
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
const emit = defineEmits(['update:modelValue'])
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
size: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: "6",
|
|
19
19
|
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
color: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "primary",
|
|
23
|
+
},
|
|
24
|
+
value: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
},
|
|
27
|
+
textFieldLabel: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: "Text",
|
|
27
30
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
return false;
|
|
34
|
-
},
|
|
35
|
-
captchaText: function () {
|
|
36
|
-
return this.captcha.join("");
|
|
37
|
-
}
|
|
31
|
+
refreshButtonLabel: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: "Refresh",
|
|
38
34
|
},
|
|
39
|
-
|
|
40
|
-
refresh() {
|
|
41
|
-
this.text = "";
|
|
42
|
-
this.generateCaptcha();
|
|
43
|
-
},
|
|
35
|
+
});
|
|
44
36
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const charsArray =
|
|
49
|
-
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@!#$%^&*";
|
|
50
|
-
const size = Number.parseInt(this.size);
|
|
51
|
-
for (var i = 0; i < size; i++) {
|
|
52
|
-
// Eviter la repetition des characters
|
|
53
|
-
var index = Math.floor(Math.random() * charsArray.length + 1);
|
|
54
|
-
if (captcha.indexOf(charsArray[index]) === -1) {
|
|
55
|
-
captcha.push(charsArray[index]);
|
|
56
|
-
} else i--;
|
|
57
|
-
}
|
|
58
|
-
this.width = 20 * captcha.length;
|
|
59
|
-
this.captcha = captcha;
|
|
37
|
+
onMounted(() => {
|
|
38
|
+
generateCaptcha()
|
|
39
|
+
})
|
|
60
40
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
ctx.font = "25px Georgia";
|
|
67
|
-
ctx.strokeText(this.captcha.join(""), 0, 30);
|
|
41
|
+
const captcha = ref([]);
|
|
42
|
+
const captchaRef = ref(null)
|
|
43
|
+
const captchaPhrase = ref("")
|
|
44
|
+
const width = ref(0);
|
|
45
|
+
const text = ref("");
|
|
68
46
|
|
|
69
|
-
|
|
47
|
+
const valid = computed(() => {
|
|
48
|
+
return captchaPhrase.value === text.value;
|
|
49
|
+
});
|
|
70
50
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
51
|
+
watch(valid, (value) => {
|
|
52
|
+
emit('update:modelValue', value);
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
const refresh = () => {
|
|
56
|
+
text.value = "";
|
|
57
|
+
generateCaptcha();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const generateCaptcha = () => {
|
|
61
|
+
const captchaLocal = [];
|
|
62
|
+
const charsArray =
|
|
63
|
+
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@!#$%^&*";
|
|
64
|
+
const size = Number.parseInt(props.size);
|
|
65
|
+
for (var i = 0; i < size; i++) {
|
|
66
|
+
// Eviter la repetition des characters
|
|
67
|
+
var index = Math.floor(Math.random() * charsArray.length + 1);
|
|
68
|
+
if (captchaLocal.indexOf(charsArray[index]) == -1) {
|
|
69
|
+
captchaLocal.push(charsArray[index]);
|
|
70
|
+
} else i--;
|
|
71
|
+
}
|
|
72
|
+
width.value = 20 * captchaLocal.length;
|
|
73
|
+
captcha.value = captchaLocal;
|
|
74
|
+
captchaPhrase.value = captcha.value.join("")
|
|
75
|
+
|
|
76
|
+
var canv = document.createElement("canvas");
|
|
77
|
+
canv.id = "canvas";
|
|
78
|
+
canv.width = width.value;
|
|
79
|
+
canv.height = 50;
|
|
80
|
+
var ctx = canv.getContext("2d");
|
|
81
|
+
ctx.font = "25px Georgia";
|
|
82
|
+
ctx.strokeText(captcha.value.join(""), 0, 30);
|
|
83
|
+
|
|
84
|
+
const captchaElement = captchaRef.value;
|
|
82
85
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
default: "6"
|
|
87
|
-
},
|
|
88
|
-
color: {
|
|
89
|
-
type: String,
|
|
90
|
-
default: "primary"
|
|
91
|
-
},
|
|
92
|
-
value: {
|
|
93
|
-
type: Boolean
|
|
94
|
-
},
|
|
95
|
-
textFieldLabel: {
|
|
96
|
-
type: String,
|
|
97
|
-
default: "Text"
|
|
98
|
-
},
|
|
99
|
-
refreshButtonLabel: {
|
|
100
|
-
type: String,
|
|
101
|
-
default: "Refresh"
|
|
102
|
-
}
|
|
86
|
+
if (captchaElement != null) {
|
|
87
|
+
captchaElement.innerHTML = "";
|
|
88
|
+
captchaElement.appendChild(canv);
|
|
103
89
|
}
|
|
104
90
|
};
|
|
105
91
|
</script>
|
package/src/globals.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Use globally in wordpress context
|
|
3
|
+
*
|
|
4
|
+
* @param {string} url
|
|
5
|
+
*/
|
|
6
|
+
function setFaviconUrl(url) {
|
|
7
|
+
let link = document.querySelector("link[rel~='icon']");
|
|
8
|
+
if (!link) {
|
|
9
|
+
link = document.createElement("link");
|
|
10
|
+
link.rel = "icon";
|
|
11
|
+
document.head.appendChild(link);
|
|
12
|
+
}
|
|
13
|
+
link.href = url;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* <script src="https://unpkg.com/@sedoo/unidoo/src/globals.js"></script>
|
|
18
|
+
<ftp-main-app></ftp-main-app>
|
|
19
|
+
<script>
|
|
20
|
+
setFavicon('https://wpedu2.sedoo.fr/wp-content-omp/uploads/sites/67/2025/09/sftpFavicon.png');
|
|
21
|
+
</script>
|
|
22
|
+
*/
|
package/src/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as Unidoo } from '@/plugin.js'
|
|
2
|
+
|
|
3
|
+
export { createAlertService} from '@/services/alertService.js'
|
|
4
|
+
export { createUuidService } from '@/services/uuidService.js'
|
|
5
|
+
|
|
6
|
+
export { default as UnidooSnackbar } from '@/components/UnidooAlert.vue'
|
|
7
|
+
export { default as UnidooCaptcha } from '@/components/UnidooCaptcha.vue'
|