@authing/vue-ui-components 3.0.22 → 3.0.24
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/AuthingGuard/index.js +8 -0
- package/{src/components/AuthingGuard.vue → components/AuthingGuard/src/index.vue} +28 -39
- package/components/Guard/index.js +8 -0
- package/{src/components/Guard.vue → components/Guard/src/index.vue} +22 -17
- package/components/index.js +25 -0
- package/lib/index.min.css +1 -2
- package/lib/index.min.js +482 -1
- package/package.json +58 -39
- package/.eslintignore +0 -2
- package/configs/rollup.config.base.js +0 -77
- package/configs/rollup.config.browser.js +0 -15
- package/configs/rollup.config.es.js +0 -16
- package/configs/rollup.config.umd.js +0 -15
- package/src/components/index.d.ts +0 -0
- package/src/components/index.js +0 -7
- package/src/icons.js +0 -18
- package/src/index.js +0 -79
- package/src/mixins/CoupledChild.js +0 -49
- package/src/mixins/CoupledParent.js +0 -172
- package/src/mixins/DisableScroll.js +0 -25
- package/src/mixins/DisabledChild.js +0 -25
- package/src/mixins/DisabledParent.js +0 -35
- package/vue.config.js +0 -33
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div id="authing_guard_container"
|
|
2
|
+
<div id="authing_guard_container" />
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script>
|
|
@@ -13,20 +13,8 @@ import {
|
|
|
13
13
|
LoginMethods,
|
|
14
14
|
RegisterMethods,
|
|
15
15
|
} from "@authing/native-js-ui-components";
|
|
16
|
-
import "@authing/native-js-ui-components/lib/index.min.css";
|
|
17
16
|
|
|
18
|
-
export {
|
|
19
|
-
getAuthClient,
|
|
20
|
-
initAuthClient,
|
|
21
|
-
GuardMode,
|
|
22
|
-
GuardScenes,
|
|
23
|
-
LoginMethods,
|
|
24
|
-
RegisterMethods,
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const format = (a, b) => {
|
|
28
|
-
return !a || a === "false" ? b : true;
|
|
29
|
-
};
|
|
17
|
+
export { getAuthClient, initAuthClient, GuardMode, GuardScenes, LoginMethods, RegisterMethods };
|
|
30
18
|
|
|
31
19
|
const callbackEvent = ["before-login", "before-register"];
|
|
32
20
|
|
|
@@ -84,6 +72,7 @@ export default {
|
|
|
84
72
|
return {
|
|
85
73
|
localVisible: false,
|
|
86
74
|
$guard: null,
|
|
75
|
+
guarConfig: {},
|
|
87
76
|
};
|
|
88
77
|
},
|
|
89
78
|
watch: {
|
|
@@ -109,40 +98,40 @@ export default {
|
|
|
109
98
|
},
|
|
110
99
|
},
|
|
111
100
|
},
|
|
101
|
+
computed: {
|
|
102
|
+
mergeConfig: function () {
|
|
103
|
+
return {
|
|
104
|
+
...this.config,
|
|
105
|
+
appId: this.appId,
|
|
106
|
+
mode: this.mode ?? this.config?.mode,
|
|
107
|
+
autoRegister: this.autoRegister ?? this.config?.autoRegister,
|
|
108
|
+
isSSO: this.isSSO ?? this.config?.isSSO,
|
|
109
|
+
clickCloseable: this.clickCloseable ?? this.config?.clickCloseable,
|
|
110
|
+
escCloseable: this.escCloseable ?? this.config?.escCloseable,
|
|
111
|
+
};
|
|
112
|
+
},
|
|
113
|
+
},
|
|
112
114
|
mounted() {
|
|
113
|
-
this.
|
|
114
|
-
this.
|
|
115
|
-
this.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
this.
|
|
119
|
-
this.config.clickCloseable = this.clickCloseable
|
|
120
|
-
? this.clickCloseable
|
|
121
|
-
: this.config.clickCloseable;
|
|
122
|
-
this.config.escCloseable = this.escCloseable
|
|
123
|
-
? this.escCloseable
|
|
124
|
-
: this.config.escCloseable;
|
|
115
|
+
// this.guarConfig = this.config || {};
|
|
116
|
+
// this.guarConfig.mode = this.mode ? this.mode : this.config.mode;
|
|
117
|
+
// this.guarConfig.autoRegister = this.autoRegister ? this.autoRegister : this.config.autoRegister;
|
|
118
|
+
// this.guarConfig.isSSO = this.isSSO ? this.isSSO : this.config.isSSO;
|
|
119
|
+
// this.guarConfig.clickCloseable = this.clickCloseable ? this.clickCloseable : this.config.clickCloseable;
|
|
120
|
+
// this.guarConfig.escCloseable = this.escCloseable ? this.escCloseable : this.config.escCloseable;
|
|
125
121
|
|
|
126
122
|
// this.config.autoRegister = format(this.autoRegister, this.config.autoRegister)
|
|
127
123
|
// this.config.isSSO = format(this.isSSO, this.config.isSSO)
|
|
128
124
|
// this.config.clickCloseable = format(this.clickCloseable, this.config.clickCloseable)
|
|
129
125
|
// this.config.escCloseable = format(this.escCloseable, this.config.escCloseable)
|
|
130
126
|
|
|
131
|
-
const guard = new NativeAuthingGuard(
|
|
132
|
-
this.appId,
|
|
133
|
-
this.config,
|
|
134
|
-
this.tenantId
|
|
135
|
-
);
|
|
127
|
+
const guard = new NativeAuthingGuard(this.appId, this.mergeConfig, this.tenantId);
|
|
136
128
|
|
|
137
129
|
const evts = Object.values(GuardEventsCamelToKebabMap);
|
|
138
|
-
const kebabToCamelMap = Object.entries(GuardEventsCamelToKebabMap).reduce(
|
|
139
|
-
(
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
},
|
|
144
|
-
{}
|
|
145
|
-
);
|
|
130
|
+
const kebabToCamelMap = Object.entries(GuardEventsCamelToKebabMap).reduce((acc, [camel, kebab]) => {
|
|
131
|
+
return Object.assign({}, acc, {
|
|
132
|
+
[kebab]: camel,
|
|
133
|
+
});
|
|
134
|
+
}, {});
|
|
146
135
|
|
|
147
136
|
const listeners = evts.reduce((acc, evtName) => {
|
|
148
137
|
return Object.assign({}, acc, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div id="authing_guard_container"
|
|
2
|
+
<div id="authing_guard_container" />
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script>
|
|
@@ -17,10 +17,6 @@ import { Guard as NativeGuard } from "@authing/native-js-ui-components/lib/index
|
|
|
17
17
|
|
|
18
18
|
export { getAuthClient, initAuthClient, GuardMode, GuardScenes, LoginMethods, RegisterMethods };
|
|
19
19
|
|
|
20
|
-
const format = (a, b) => {
|
|
21
|
-
return !a || a === "false" ? b : true;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
20
|
const callbackEvent = ["before-login", "before-register"];
|
|
25
21
|
|
|
26
22
|
export default {
|
|
@@ -73,6 +69,7 @@ export default {
|
|
|
73
69
|
return {
|
|
74
70
|
localVisible: false,
|
|
75
71
|
$guard: null,
|
|
72
|
+
guarConfig: {},
|
|
76
73
|
};
|
|
77
74
|
},
|
|
78
75
|
watch: {
|
|
@@ -98,20 +95,28 @@ export default {
|
|
|
98
95
|
},
|
|
99
96
|
},
|
|
100
97
|
},
|
|
98
|
+
computed: {
|
|
99
|
+
mergeConfig: function () {
|
|
100
|
+
return {
|
|
101
|
+
...this.config,
|
|
102
|
+
appId: this.appId,
|
|
103
|
+
mode: this.mode ?? this.config?.mode,
|
|
104
|
+
autoRegister: this.autoRegister ?? this.config?.autoRegister,
|
|
105
|
+
isSSO: this.isSSO ?? this.config?.isSSO,
|
|
106
|
+
clickCloseable: this.clickCloseable ?? this.config?.clickCloseable,
|
|
107
|
+
escCloseable: this.escCloseable ?? this.config?.escCloseable,
|
|
108
|
+
};
|
|
109
|
+
},
|
|
110
|
+
},
|
|
101
111
|
mounted() {
|
|
102
|
-
this.
|
|
103
|
-
this.
|
|
104
|
-
this.
|
|
105
|
-
this.
|
|
106
|
-
this.
|
|
107
|
-
this.
|
|
108
|
-
|
|
109
|
-
// this.config.autoRegister = format(this.autoRegister, this.config.autoRegister)
|
|
110
|
-
// this.config.isSSO = format(this.isSSO, this.config.isSSO)
|
|
111
|
-
// this.config.clickCloseable = format(this.clickCloseable, this.config.clickCloseable)
|
|
112
|
-
// this.config.escCloseable = format(this.escCloseable, this.config.escCloseable)
|
|
112
|
+
// this.guarConfig = this.config || {};
|
|
113
|
+
// this.guarConfig.mode = this.mode ? this.mode : this.config.mode;
|
|
114
|
+
// this.guarConfig.autoRegister = this.autoRegister ? this.autoRegister : this.config.autoRegister;
|
|
115
|
+
// this.guarConfig.isSSO = this.isSSO ? this.isSSO : this.config.isSSO;
|
|
116
|
+
// this.guarConfig.clickCloseable = this.clickCloseable ? this.clickCloseable : this.config.clickCloseable;
|
|
117
|
+
// this.guarConfig.escCloseable = this.escCloseable ? this.escCloseable : this.config.escCloseable;
|
|
113
118
|
|
|
114
|
-
const guard = new NativeGuard(this.appId, this.
|
|
119
|
+
const guard = new NativeGuard(this.appId, this.mergeConfig);
|
|
115
120
|
|
|
116
121
|
const evts = Object.values(GuardEventsCamelToKebabMap);
|
|
117
122
|
const kebabToCamelMap = Object.entries(GuardEventsCamelToKebabMap).reduce((acc, [camel, kebab]) => {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import AuthingGuard from './AuthingGuard'
|
|
2
|
+
import Guard from './Guard'
|
|
3
|
+
import '@authing/native-js-ui-components/lib/index.min.css'
|
|
4
|
+
|
|
5
|
+
const components = [
|
|
6
|
+
AuthingGuard,
|
|
7
|
+
Guard
|
|
8
|
+
]
|
|
9
|
+
// 全局注册
|
|
10
|
+
const install = (app) => {
|
|
11
|
+
components.forEach(component => {
|
|
12
|
+
app.component(component.name, component)
|
|
13
|
+
})
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// 局部注册
|
|
17
|
+
export {
|
|
18
|
+
install,
|
|
19
|
+
Guard,
|
|
20
|
+
AuthingGuard
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default {
|
|
24
|
+
install
|
|
25
|
+
}
|