@authing/vue-ui-components 3.1.31 → 4.0.0-alpha.3
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/LICENSE +21 -0
- 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 +5 -5
- package/components/AuthingGuard/index.js +0 -8
- package/components/AuthingGuard/src/index.vue +0 -150
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019-present Authing
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -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";
|