@authing/vue-ui-components 3.1.31 → 4.0.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/components/Guard/src/index.vue +24 -46
- package/components/index.js +7 -6
- package/lib/index.min.css +1 -1
- package/lib/index.min.js +29 -179
- package/package.json +3 -3
- package/components/AuthingGuard/index.js +0 -8
- package/components/AuthingGuard/src/index.vue +0 -150
|
@@ -1,29 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div id="authing_guard_container"
|
|
2
|
+
<div id="authing_guard_container" />
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script>
|
|
6
|
-
import {
|
|
7
|
-
getAuthClient,
|
|
8
|
-
initAuthClient,
|
|
9
|
-
GuardMode,
|
|
10
|
-
GuardScenes,
|
|
11
|
-
LoginMethods,
|
|
12
|
-
RegisterMethods,
|
|
13
|
-
Guard as NativeGuard,
|
|
14
|
-
GuardEventsCamelToKebabMapping,
|
|
15
|
-
} from "@authing/native-js-ui-components";
|
|
6
|
+
import { Guard as NativeGuard, GuardEventsCamelToKebabMapping } from "@authing/native-js-ui-components";
|
|
16
7
|
import "@authing/native-js-ui-components/lib/index.min.css";
|
|
17
8
|
|
|
18
|
-
export {
|
|
19
|
-
getAuthClient,
|
|
20
|
-
initAuthClient,
|
|
21
|
-
GuardMode,
|
|
22
|
-
GuardScenes,
|
|
23
|
-
LoginMethods,
|
|
24
|
-
RegisterMethods,
|
|
25
|
-
};
|
|
26
|
-
|
|
27
9
|
const callbackEvent = ["before-login", "before-register"];
|
|
28
10
|
|
|
29
11
|
export default {
|
|
@@ -88,6 +70,19 @@ export default {
|
|
|
88
70
|
guarConfig: {},
|
|
89
71
|
};
|
|
90
72
|
},
|
|
73
|
+
computed: {
|
|
74
|
+
mergeConfig: function () {
|
|
75
|
+
return {
|
|
76
|
+
...this.config,
|
|
77
|
+
appId: this.appId,
|
|
78
|
+
mode: this.mode ?? this.config?.mode,
|
|
79
|
+
autoRegister: this.autoRegister ?? this.config?.autoRegister,
|
|
80
|
+
isSSO: this.isSSO ?? this.config?.isSSO,
|
|
81
|
+
clickCloseable: this.clickCloseable ?? this.config?.clickCloseable,
|
|
82
|
+
escCloseable: this.escCloseable ?? this.config?.escCloseable,
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
|
+
},
|
|
91
86
|
watch: {
|
|
92
87
|
visible: {
|
|
93
88
|
immediate: true,
|
|
@@ -111,19 +106,6 @@ export default {
|
|
|
111
106
|
},
|
|
112
107
|
},
|
|
113
108
|
},
|
|
114
|
-
computed: {
|
|
115
|
-
mergeConfig: function () {
|
|
116
|
-
return {
|
|
117
|
-
...this.config,
|
|
118
|
-
appId: this.appId,
|
|
119
|
-
mode: this.mode ?? this.config?.mode,
|
|
120
|
-
autoRegister: this.autoRegister ?? this.config?.autoRegister,
|
|
121
|
-
isSSO: this.isSSO ?? this.config?.isSSO,
|
|
122
|
-
clickCloseable: this.clickCloseable ?? this.config?.clickCloseable,
|
|
123
|
-
escCloseable: this.escCloseable ?? this.config?.escCloseable,
|
|
124
|
-
};
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
109
|
mounted() {
|
|
128
110
|
this.guardInstance = new NativeGuard({
|
|
129
111
|
appId: this.appId,
|
|
@@ -133,9 +115,7 @@ export default {
|
|
|
133
115
|
});
|
|
134
116
|
|
|
135
117
|
const evts = Object.values(GuardEventsCamelToKebabMapping);
|
|
136
|
-
const kebabToCamelMap = Object.entries(
|
|
137
|
-
GuardEventsCamelToKebabMapping
|
|
138
|
-
).reduce((acc, [camel, kebab]) => {
|
|
118
|
+
const kebabToCamelMap = Object.entries(GuardEventsCamelToKebabMapping).reduce((acc, [camel, kebab]) => {
|
|
139
119
|
return Object.assign({}, acc, {
|
|
140
120
|
[kebab]: camel,
|
|
141
121
|
});
|
|
@@ -161,14 +141,19 @@ export default {
|
|
|
161
141
|
});
|
|
162
142
|
}, {});
|
|
163
143
|
|
|
164
|
-
evts.forEach((evtName) =>
|
|
165
|
-
this.guardInstance.on(evtName, listeners[evtName])
|
|
166
|
-
);
|
|
144
|
+
evts.forEach((evtName) => this.guardInstance.on(evtName, listeners[evtName]));
|
|
167
145
|
|
|
168
146
|
if (this.localVisible) {
|
|
169
147
|
this.guardInstance.show();
|
|
170
148
|
}
|
|
171
149
|
},
|
|
150
|
+
|
|
151
|
+
beforeUnmount() {
|
|
152
|
+
this.guardInstance.unmountComponent();
|
|
153
|
+
},
|
|
154
|
+
beforeDestroy() {
|
|
155
|
+
this.guardInstance.unmountComponent();
|
|
156
|
+
},
|
|
172
157
|
methods: {
|
|
173
158
|
show() {
|
|
174
159
|
this.guardInstance.show();
|
|
@@ -177,12 +162,5 @@ export default {
|
|
|
177
162
|
this.guardInstance.hide();
|
|
178
163
|
},
|
|
179
164
|
},
|
|
180
|
-
|
|
181
|
-
beforeUnmount() {
|
|
182
|
-
this.guardInstance.unmountComponent();
|
|
183
|
-
},
|
|
184
|
-
beforeDestroy() {
|
|
185
|
-
this.guardInstance.unmountComponent();
|
|
186
|
-
},
|
|
187
165
|
};
|
|
188
166
|
</script>
|
package/components/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import AuthingGuard from './AuthingGuard'
|
|
1
|
+
// import AuthingGuard from './AuthingGuard'
|
|
2
2
|
import Guard from './Guard'
|
|
3
3
|
import '@authing/native-js-ui-components/lib/index.min.css'
|
|
4
4
|
|
|
5
5
|
const components = [
|
|
6
|
-
AuthingGuard,
|
|
7
|
-
Guard
|
|
6
|
+
// AuthingGuard,
|
|
7
|
+
Guard,
|
|
8
8
|
]
|
|
9
9
|
// 全局注册
|
|
10
10
|
const install = (app) => {
|
|
@@ -17,9 +17,10 @@ const install = (app) => {
|
|
|
17
17
|
export {
|
|
18
18
|
install,
|
|
19
19
|
Guard,
|
|
20
|
-
AuthingGuard
|
|
20
|
+
// AuthingGuard
|
|
21
21
|
}
|
|
22
|
-
|
|
23
22
|
export default {
|
|
24
|
-
install
|
|
23
|
+
install,
|
|
25
24
|
}
|
|
25
|
+
|
|
26
|
+
export * from "@authing/native-js-ui-components";
|