@authing/vue-ui-components 3.0.12-rc.4 → 3.0.13
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/configs/rollup.config.base.js +4 -1
- package/lib/index.min.css +21602 -2
- package/lib/index.min.js +1 -1
- package/package.json +5 -5
- package/src/components/AuthingGuard.vue +61 -13
- package/src/components/Guard.vue +57 -13
- package/src/components/index.js +1 -0
- package/vue.config.js +16 -19
- package/yarn-error.log +20225 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authing/vue-ui-components",
|
|
3
3
|
"description": "Authing Vue UI components",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.13",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vue",
|
|
7
7
|
"vuejs",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"registry": "https://registry.npmjs.org"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@authing/native-js-ui-components": "3.0.12"
|
|
36
|
+
"@authing/native-js-ui-components": "^3.0.12"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@babel/core": "^7.
|
|
39
|
+
"@babel/core": "^7.17.5",
|
|
40
40
|
"@babel/plugin-transform-runtime": "7.4.0",
|
|
41
|
-
"@babel/preset-env": "7.
|
|
41
|
+
"@babel/preset-env": "^7.16.11",
|
|
42
42
|
"@vue/babel-preset-jsx": "1.0.0-beta.3",
|
|
43
43
|
"@vue/cli-plugin-babel": "^3.5.1",
|
|
44
44
|
"@vue/cli-plugin-eslint": "^3.5.1",
|
|
@@ -79,4 +79,4 @@
|
|
|
79
79
|
"> 10%",
|
|
80
80
|
"last 2 versions"
|
|
81
81
|
]
|
|
82
|
-
}
|
|
82
|
+
}
|
|
@@ -3,9 +3,31 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script>
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
getAuthClient,
|
|
8
|
+
initAuthClient,
|
|
9
|
+
AuthingGuard as NativeAuthingGuard,
|
|
10
|
+
GuardEventsCamelToKebabMap,
|
|
11
|
+
GuardMode,
|
|
12
|
+
GuardScenes,
|
|
13
|
+
LoginMethods,
|
|
14
|
+
RegisterMethods,
|
|
15
|
+
} from "@authing/native-js-ui-components";
|
|
7
16
|
import "@authing/native-js-ui-components/lib/index.min.css";
|
|
8
17
|
|
|
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
|
+
};
|
|
30
|
+
|
|
9
31
|
const callbackEvent = ["before-login", "before-register"];
|
|
10
32
|
|
|
11
33
|
export default {
|
|
@@ -86,28 +108,54 @@ export default {
|
|
|
86
108
|
}
|
|
87
109
|
},
|
|
88
110
|
},
|
|
111
|
+
},
|
|
112
|
+
computed: {
|
|
113
|
+
mergeConfig: function () {
|
|
114
|
+
return {
|
|
115
|
+
...this.config,
|
|
116
|
+
appId: this.appId,
|
|
117
|
+
mode: this.mode ?? this.config?.mode,
|
|
118
|
+
autoRegister: this.autoRegister ?? this.config?.autoRegister,
|
|
119
|
+
isSSO: this.isSSO ?? this.config?.isSSO,
|
|
120
|
+
clickCloseable: this.clickCloseable ?? this.config?.clickCloseable,
|
|
121
|
+
escCloseable: this.escCloseable ?? this.config?.escCloseable,
|
|
122
|
+
};
|
|
123
|
+
},
|
|
89
124
|
},
|
|
90
125
|
mounted() {
|
|
91
|
-
this.config = this.config || {};
|
|
92
|
-
this.config.mode = this.mode ? this.mode : this.config.mode;
|
|
93
|
-
this.config.autoRegister = this.autoRegister
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
this.config.
|
|
126
|
+
// this.config = this.config || {};
|
|
127
|
+
// this.config.mode = this.mode ? this.mode : this.config.mode;
|
|
128
|
+
// this.config.autoRegister = this.autoRegister
|
|
129
|
+
// ? this.autoRegister
|
|
130
|
+
// : this.config.autoRegister;
|
|
131
|
+
// this.config.isSSO = this.isSSO ? this.isSSO : this.config.isSSO;
|
|
132
|
+
// this.config.clickCloseable = this.clickCloseable
|
|
133
|
+
// ? this.clickCloseable
|
|
134
|
+
// : this.config.clickCloseable;
|
|
135
|
+
// this.config.escCloseable = this.escCloseable
|
|
136
|
+
// ? this.escCloseable
|
|
137
|
+
// : this.config.escCloseable;
|
|
97
138
|
|
|
98
139
|
// this.config.autoRegister = format(this.autoRegister, this.config.autoRegister)
|
|
99
140
|
// this.config.isSSO = format(this.isSSO, this.config.isSSO)
|
|
100
141
|
// this.config.clickCloseable = format(this.clickCloseable, this.config.clickCloseable)
|
|
101
142
|
// this.config.escCloseable = format(this.escCloseable, this.config.escCloseable)
|
|
102
143
|
|
|
103
|
-
const guard = new NativeAuthingGuard(
|
|
144
|
+
const guard = new NativeAuthingGuard(
|
|
145
|
+
this.appId,
|
|
146
|
+
this.mergeConfig,
|
|
147
|
+
this.tenantId
|
|
148
|
+
);
|
|
104
149
|
|
|
105
150
|
const evts = Object.values(GuardEventsCamelToKebabMap);
|
|
106
|
-
const kebabToCamelMap = Object.entries(GuardEventsCamelToKebabMap).reduce(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
151
|
+
const kebabToCamelMap = Object.entries(GuardEventsCamelToKebabMap).reduce(
|
|
152
|
+
(acc, [camel, kebab]) => {
|
|
153
|
+
return Object.assign({}, acc, {
|
|
154
|
+
[kebab]: camel,
|
|
155
|
+
});
|
|
156
|
+
},
|
|
157
|
+
{}
|
|
158
|
+
);
|
|
111
159
|
|
|
112
160
|
const listeners = evts.reduce((acc, evtName) => {
|
|
113
161
|
return Object.assign({}, acc, {
|
package/src/components/Guard.vue
CHANGED
|
@@ -3,8 +3,30 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script>
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
getAuthClient,
|
|
8
|
+
initAuthClient,
|
|
9
|
+
GuardEventsCamelToKebabMap,
|
|
10
|
+
GuardMode,
|
|
11
|
+
GuardScenes,
|
|
12
|
+
LoginMethods,
|
|
13
|
+
RegisterMethods,
|
|
14
|
+
} from "@authing/native-js-ui-components";
|
|
7
15
|
import "@authing/native-js-ui-components/lib/index.min.css";
|
|
16
|
+
import { Guard as NativeGuard } from "@authing/native-js-ui-components/lib/index.min.js";
|
|
17
|
+
|
|
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
|
+
};
|
|
8
30
|
|
|
9
31
|
const callbackEvent = ["before-login", "before-register"];
|
|
10
32
|
|
|
@@ -83,27 +105,49 @@ export default {
|
|
|
83
105
|
},
|
|
84
106
|
},
|
|
85
107
|
},
|
|
108
|
+
computed: {
|
|
109
|
+
mergeConfig: function () {
|
|
110
|
+
return {
|
|
111
|
+
...this.config,
|
|
112
|
+
appId: this.appId,
|
|
113
|
+
mode: this.mode ?? this.config?.mode,
|
|
114
|
+
autoRegister: this.autoRegister ?? this.config?.autoRegister,
|
|
115
|
+
isSSO: this.isSSO ?? this.config?.isSSO,
|
|
116
|
+
clickCloseable: this.clickCloseable ?? this.config?.clickCloseable,
|
|
117
|
+
escCloseable: this.escCloseable ?? this.config?.escCloseable,
|
|
118
|
+
};
|
|
119
|
+
},
|
|
120
|
+
},
|
|
86
121
|
mounted() {
|
|
87
|
-
this.config = this.config || {};
|
|
88
|
-
this.config.mode = this.mode ? this.mode : this.config.mode;
|
|
89
|
-
this.config.autoRegister = this.autoRegister
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
this.config.
|
|
122
|
+
// this.config = this.config || {};
|
|
123
|
+
// this.config.mode = this.mode ? this.mode : this.config.mode;
|
|
124
|
+
// this.config.autoRegister = this.autoRegister
|
|
125
|
+
// ? this.autoRegister
|
|
126
|
+
// : this.config.autoRegister;
|
|
127
|
+
// this.config.isSSO = this.isSSO ? this.isSSO : this.config.isSSO;
|
|
128
|
+
// this.config.clickCloseable = this.clickCloseable
|
|
129
|
+
// ? this.clickCloseable
|
|
130
|
+
// : this.config.clickCloseable;
|
|
131
|
+
// this.config.escCloseable = this.escCloseable
|
|
132
|
+
// ? this.escCloseable
|
|
133
|
+
// : this.config.escCloseable;
|
|
93
134
|
|
|
94
135
|
// this.config.autoRegister = format(this.autoRegister, this.config.autoRegister)
|
|
95
136
|
// this.config.isSSO = format(this.isSSO, this.config.isSSO)
|
|
96
137
|
// this.config.clickCloseable = format(this.clickCloseable, this.config.clickCloseable)
|
|
97
138
|
// this.config.escCloseable = format(this.escCloseable, this.config.escCloseable)
|
|
98
139
|
|
|
99
|
-
const guard = new NativeGuard(this.appId, this.
|
|
140
|
+
const guard = new NativeGuard(this.appId, this.mergeConfig);
|
|
100
141
|
|
|
101
142
|
const evts = Object.values(GuardEventsCamelToKebabMap);
|
|
102
|
-
const kebabToCamelMap = Object.entries(GuardEventsCamelToKebabMap).reduce(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
143
|
+
const kebabToCamelMap = Object.entries(GuardEventsCamelToKebabMap).reduce(
|
|
144
|
+
(acc, [camel, kebab]) => {
|
|
145
|
+
return Object.assign({}, acc, {
|
|
146
|
+
[kebab]: camel,
|
|
147
|
+
});
|
|
148
|
+
},
|
|
149
|
+
{}
|
|
150
|
+
);
|
|
107
151
|
|
|
108
152
|
const listeners = evts.reduce((acc, evtName) => {
|
|
109
153
|
return Object.assign({}, acc, {
|
package/src/components/index.js
CHANGED
package/vue.config.js
CHANGED
|
@@ -1,36 +1,33 @@
|
|
|
1
|
-
const path = require(
|
|
1
|
+
const path = require("path");
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
4
|
lintOnSave: false,
|
|
5
5
|
|
|
6
|
-
outputDir:
|
|
7
|
-
publicPath:
|
|
6
|
+
outputDir: "./docs",
|
|
7
|
+
publicPath: "./",
|
|
8
8
|
|
|
9
9
|
configureWebpack: {
|
|
10
10
|
entry: {
|
|
11
|
-
app: path.resolve(__dirname,
|
|
11
|
+
app: path.resolve(__dirname, "./docs-src/main.js"),
|
|
12
12
|
},
|
|
13
13
|
resolve: {
|
|
14
14
|
alias: {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
"@style": path.resolve(__dirname, "./src/style/imports.styl"),
|
|
16
|
+
"@": path.resolve(__dirname, "./docs-src"),
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
20
|
|
|
21
|
-
chainWebpack: config => {
|
|
22
|
-
config.module
|
|
23
|
-
.rule('js')
|
|
24
|
-
.include
|
|
25
|
-
.add(path.resolve(__dirname, './docs-src'))
|
|
21
|
+
chainWebpack: (config) => {
|
|
22
|
+
config.module.rule("js").include.add(path.resolve(__dirname, "./docs-src"));
|
|
26
23
|
|
|
27
24
|
config.module
|
|
28
|
-
.rule(
|
|
29
|
-
.use(
|
|
30
|
-
.loader(
|
|
31
|
-
.tap(options => {
|
|
32
|
-
options.compilerOptions.preserveWhitespace = true
|
|
33
|
-
return options
|
|
34
|
-
})
|
|
25
|
+
.rule("vue")
|
|
26
|
+
.use("vue-loader")
|
|
27
|
+
.loader("vue-loader")
|
|
28
|
+
.tap((options) => {
|
|
29
|
+
options.compilerOptions.preserveWhitespace = true;
|
|
30
|
+
return options;
|
|
31
|
+
});
|
|
35
32
|
},
|
|
36
|
-
}
|
|
33
|
+
};
|