@drax/identity-vue 0.0.24 → 0.0.25

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
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.0.24",
6
+ "version": "0.0.25",
7
7
  "type": "module",
8
8
  "main": "./src/index.ts",
9
9
  "module": "./src/index.ts",
@@ -24,9 +24,9 @@
24
24
  "format": "prettier --write src/"
25
25
  },
26
26
  "dependencies": {
27
- "@drax/common-front": "^0.0.24",
28
- "@drax/common-share": "^0.0.24",
29
- "@drax/identity-share": "^0.0.24",
27
+ "@drax/common-front": "^0.0.25",
28
+ "@drax/common-share": "^0.0.25",
29
+ "@drax/identity-share": "^0.0.25",
30
30
  "vue-i18n": "^9.13.1"
31
31
  },
32
32
  "peerDependencies": {
@@ -63,5 +63,5 @@
63
63
  "vue-tsc": "^2.0.11",
64
64
  "vuetify": "^3.6.4"
65
65
  },
66
- "gitHead": "318180aac2065faa88cb3dffed31a4651e5af0a5"
66
+ "gitHead": "606497ae64684b17c757a72ed57a4a7dda0f1f8e"
67
67
  }
@@ -0,0 +1,29 @@
1
+
2
+ export function useCopy(){
3
+
4
+ function unsecuredCopyToClipboard(text:string) {
5
+ const textArea = document.createElement("textarea");
6
+ textArea.value = text;
7
+ document.body.appendChild(textArea);
8
+ textArea.focus();
9
+ textArea.select();
10
+ try {
11
+ document.execCommand('copy');
12
+ } catch (err) {
13
+ console.error('Unable to copy to clipboard', err);
14
+ }
15
+ document.body.removeChild(textArea);
16
+ }
17
+
18
+ async function copy(text:string) {
19
+ if(navigator.clipboard){
20
+ await navigator.clipboard.writeText(text)
21
+ }else{
22
+ unsecuredCopyToClipboard(text)
23
+ }
24
+ }
25
+
26
+ return {
27
+ copy,
28
+ }
29
+ }
package/src/index.ts CHANGED
@@ -27,9 +27,17 @@ import {useAuth} from "./composables/useAuth.js";
27
27
  import {useUser} from "./composables/useUser.js";
28
28
  import {useRole} from "./composables/useRole.js";
29
29
  import {useTenant} from "./composables/useTenant.js";
30
+ import {useI18nValidation} from "./composables/useI18nValidation.js";
31
+ import {useCopy} from "./composables/useCopy.js";
32
+
30
33
  import {useAuthStore} from "./stores/auth/AuthStore.js";
31
34
 
32
35
  export {
36
+
37
+ //General purpose composables
38
+ useI18nValidation,
39
+ useCopy,
40
+
33
41
  //Vue Components
34
42
  IdentityLogin,
35
43
  IdentityProfileAvatar,