@knowark/componarkjs 1.7.3 → 1.7.5
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/Makefile +6 -3
- package/jsconfig.json +23 -0
- package/lib/base/component/component.js +27 -26
- package/lib/base/component/component.test.js +76 -32
- package/lib/base/styles/styles.js +34 -5
- package/lib/base/utils/define.js +6 -7
- package/lib/base/utils/define.test.js +5 -5
- package/lib/base/utils/helpers.js +14 -10
- package/lib/base/utils/helpers.test.js +13 -13
- package/lib/base/utils/uuid.js +4 -4
- package/lib/components/audio/components/audio.js +6 -6
- package/lib/components/audio/components/audio.test.js +11 -10
- package/lib/components/audio/styles/ark.css.js +1 -1
- package/lib/components/camera/components/camera.test.js +6 -6
- package/lib/components/camera/styles/ark.css.js +1 -1
- package/lib/components/camera/styles/index.js +1 -1
- package/lib/components/capture/components/capture.js +2 -2
- package/lib/components/capture/components/capture.test.js +1 -1
- package/lib/components/droparea/components/droparea-preview.js +27 -26
- package/lib/components/droparea/components/droparea-preview.test.js +9 -9
- package/lib/components/droparea/components/droparea.js +19 -19
- package/lib/components/droparea/components/droparea.test.js +42 -42
- package/lib/components/droparea/styles/ark.css.js +1 -1
- package/lib/components/emit/components/emit.js +4 -4
- package/lib/components/emit/components/emit.test.js +5 -5
- package/lib/components/list/components/item.test.js +12 -14
- package/lib/components/list/components/list.js +25 -25
- package/lib/components/list/components/list.test.js +27 -29
- package/lib/components/paginator/components/paginator.js +2 -2
- package/lib/components/paginator/components/paginator.test.js +15 -18
- package/lib/components/paginator/styles/ark.css.js +1 -1
- package/lib/components/spinner/components/spinner.js +17 -17
- package/lib/components/spinner/styles/index.js +1 -1
- package/lib/components/splitview/components/splitview.detail.js +3 -3
- package/lib/components/splitview/components/splitview.detail.test.js +23 -23
- package/lib/components/splitview/components/splitview.js +3 -3
- package/lib/components/splitview/components/splitview.master.js +3 -3
- package/lib/components/splitview/components/splitview.master.test.js +2 -2
- package/lib/components/splitview/components/splitview.test.js +5 -7
- package/lib/components/translate/components/translate.js +17 -19
- package/lib/components/translate/components/translate.test.js +13 -14
- package/package.json +1 -1
- package/showcase/assets/knowark.svg +1 -0
- package/showcase/{design/screens/base/audio/audioDemo.js → components/demos/audio.js} +6 -10
- package/showcase/{design/screens/base/camera/cameraDemo.js → components/demos/camera.js} +6 -7
- package/showcase/{design/screens/base/droparea/dropareaDemo.js → components/demos/droparea.js} +7 -7
- package/showcase/{design/screens/base/list/listDemo.js → components/demos/list.js} +2 -3
- package/showcase/{design/screens/base/paginator/paginatorDemo.js → components/demos/paginator.js} +9 -9
- package/showcase/{design/screens/base/splitview/splitViewDemo.js → components/demos/splitview.js} +42 -9
- package/showcase/{design/screens/base/translate/translateDemo.js → components/demos/translate.js} +4 -5
- package/showcase/components/index.html +81 -0
- package/showcase/index.html +40 -82
- package/showcase/index.js +0 -1
- package/webpack.config.cjs +50 -50
- package/showcase/design/core/factories/development/development.factory.js +0 -5
- package/showcase/design/core/factories/development/index.js +0 -1
- package/showcase/design/core/factories/index.js +0 -11
- package/showcase/design/core/factories/standard.factory.js +0 -19
- package/showcase/design/index.html +0 -22
- package/showcase/design/index.js +0 -7
- package/showcase/design/screens/base/audio/index.js +0 -25
- package/showcase/design/screens/base/camera/index.js +0 -25
- package/showcase/design/screens/base/droparea/index.js +0 -25
- package/showcase/design/screens/base/index.js +0 -42
- package/showcase/design/screens/base/list/index.js +0 -25
- package/showcase/design/screens/base/paginator/index.js +0 -25
- package/showcase/design/screens/base/root.component.js +0 -294
- package/showcase/design/screens/base/root.routes.js +0 -28
- package/showcase/design/screens/base/spinner/index.js +0 -25
- package/showcase/design/screens/base/spinner/spinnerDemo.js +0 -55
- package/showcase/design/screens/base/splitview/detailDemo.js +0 -40
- package/showcase/design/screens/base/splitview/index.js +0 -25
- package/showcase/design/screens/base/translate/index.js +0 -20
- package/showcase/design/screens/main.js +0 -12
- package/showcase/design/screens/screens.routes.js +0 -23
- package/tsconfig.json +0 -23
- /package/showcase/{design/.htaccess → .htaccess} +0 -0
package/showcase/index.html
CHANGED
|
@@ -1,86 +1,44 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
|
-
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
body
|
|
25
|
-
display: grid;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
.themes {
|
|
45
|
-
padding: 0;
|
|
46
|
-
display: flex;
|
|
47
|
-
gap: 1rem;
|
|
48
|
-
flex-direction: column;
|
|
49
|
-
align-self: center;
|
|
50
|
-
text-align: center;
|
|
51
|
-
list-style-type: none;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.theme__link {
|
|
55
|
-
user-select: none;
|
|
56
|
-
padding: 1rem;
|
|
57
|
-
background: #001e3d;
|
|
58
|
-
color: #00ffff;
|
|
59
|
-
border-radius: 5px;
|
|
60
|
-
text-decoration: none;
|
|
61
|
-
font-weight: bold;
|
|
62
|
-
transition: all 0.2s ease-in-out;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.theme__link:hover {
|
|
66
|
-
background: #00ffff;
|
|
67
|
-
color: #001e3d;
|
|
68
|
-
}
|
|
69
|
-
</style>
|
|
70
|
-
|
|
71
|
-
<body>
|
|
72
|
-
<main>
|
|
73
|
-
<div class="titles">
|
|
74
|
-
<img src="../showcase/logo-knowark.svg" alt="" class="brand">
|
|
75
|
-
<h1>Componark</h1>
|
|
76
|
-
<h2 id="version"></h2>
|
|
77
|
-
</div>
|
|
78
|
-
<ul class="themes">
|
|
79
|
-
<a class="theme__link" href="/ark/base/accordion">
|
|
80
|
-
<li> ARK </li>
|
|
81
|
-
</a>
|
|
82
|
-
</ul>
|
|
83
|
-
</main>
|
|
84
|
-
</body>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
7
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
8
|
+
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300&display=swap" rel="stylesheet">
|
|
9
|
+
<link rel="stylesheet"href="https://unpkg.com/@knowark/styleark@0.6.1/dist/styles.min.css">
|
|
10
|
+
<title>Componark</title>
|
|
11
|
+
</head>
|
|
12
|
+
<style>
|
|
13
|
+
:root {
|
|
14
|
+
--secondary: #00ffff;
|
|
15
|
+
--primary: #001e3d;
|
|
16
|
+
font-family: "Roboto";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
html, body {
|
|
20
|
+
height: 100%;
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
23
|
+
|
|
24
|
+
<body>
|
|
25
|
+
<main style="display:grid; grid: 1fr 2fr / auto-flow;
|
|
26
|
+
justify-items:center; height:100%; --padding:8">
|
|
27
|
+
<section id="title" style="--margin-top:12">
|
|
28
|
+
<h1 style="text-align:center; --margin-bottom:8">Componark</h1>
|
|
29
|
+
<img style="display:block; --width:15;" src="./assets/knowark.svg">
|
|
30
|
+
</section>
|
|
31
|
+
<section id="entries" style="display:grid; place-items:center;
|
|
32
|
+
--padding-vertical:12">
|
|
33
|
+
<div style="width:100%;">
|
|
34
|
+
<a style="display:block; background:var(--primary);
|
|
35
|
+
color:var(--secondary); text-decoration:none; text-align:center;
|
|
36
|
+
border-radius:5px; --padding:2;" href="/components">
|
|
37
|
+
Components
|
|
38
|
+
</a>
|
|
39
|
+
</div>
|
|
40
|
+
</section>
|
|
41
|
+
</main>
|
|
42
|
+
</body>
|
|
85
43
|
|
|
86
44
|
</html>
|
package/showcase/index.js
CHANGED
package/webpack.config.cjs
CHANGED
|
@@ -1,116 +1,116 @@
|
|
|
1
|
-
const path = require(
|
|
2
|
-
const { DefinePlugin, EnvironmentPlugin } = require(
|
|
3
|
-
const { CleanWebpackPlugin } = require(
|
|
4
|
-
const CopyWebpackPlugin = require(
|
|
5
|
-
const HtmlWebpackPlugin = require(
|
|
1
|
+
const path = require('path')
|
|
2
|
+
const { DefinePlugin, EnvironmentPlugin } = require('webpack')
|
|
3
|
+
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
|
|
4
|
+
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
|
5
|
+
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
|
6
6
|
|
|
7
7
|
module.exports = (env, argv) => {
|
|
8
|
-
const devMode = argv.mode ===
|
|
8
|
+
const devMode = argv.mode === 'development'
|
|
9
9
|
const target = env.TARGET
|
|
10
10
|
|
|
11
11
|
const commonConfig = {
|
|
12
12
|
mode: argv.mode,
|
|
13
13
|
entry: {
|
|
14
|
-
showcase:
|
|
14
|
+
showcase: './lib/showcase/design/index.js'
|
|
15
15
|
},
|
|
16
16
|
plugins: [
|
|
17
17
|
new CleanWebpackPlugin(),
|
|
18
18
|
new HtmlWebpackPlugin({
|
|
19
|
-
chunks: [
|
|
20
|
-
title:
|
|
21
|
-
template:
|
|
19
|
+
chunks: ['showcase', 'runtime'],
|
|
20
|
+
title: 'Componark',
|
|
21
|
+
template: './lib/showcase/design/index.html'
|
|
22
22
|
}),
|
|
23
23
|
new CopyWebpackPlugin({
|
|
24
|
-
patterns: [
|
|
24
|
+
patterns: ['lib/showcase/design/.htaccess']
|
|
25
25
|
}),
|
|
26
26
|
new DefinePlugin({
|
|
27
27
|
PRODUCTION: !devMode,
|
|
28
|
-
VERSION: JSON.stringify(require(
|
|
29
|
-
TARGET: JSON.stringify(target)
|
|
30
|
-
})
|
|
28
|
+
VERSION: JSON.stringify(require('./package.json').version),
|
|
29
|
+
TARGET: JSON.stringify(target)
|
|
30
|
+
})
|
|
31
31
|
],
|
|
32
32
|
module: {
|
|
33
33
|
rules: [
|
|
34
34
|
{
|
|
35
35
|
test: /\.(png|svg|jpg|gif)$/,
|
|
36
|
-
use: [
|
|
36
|
+
use: ['file-loader']
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
|
|
40
40
|
use: [
|
|
41
41
|
{
|
|
42
|
-
loader:
|
|
42
|
+
loader: 'file-loader',
|
|
43
43
|
options: {
|
|
44
|
-
name:
|
|
45
|
-
outputPath:
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
]
|
|
44
|
+
name: '[name].[ext]',
|
|
45
|
+
outputPath: 'fonts/'
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
49
|
}
|
|
50
|
-
]
|
|
50
|
+
]
|
|
51
51
|
},
|
|
52
52
|
resolve: {
|
|
53
53
|
alias: {
|
|
54
|
-
base: path.resolve(__dirname,
|
|
55
|
-
components: path.resolve(__dirname,
|
|
56
|
-
screens: path.resolve(__dirname,
|
|
57
|
-
}
|
|
58
|
-
}
|
|
54
|
+
base: path.resolve(__dirname, './lib/base/'),
|
|
55
|
+
components: path.resolve(__dirname, './lib/components/'),
|
|
56
|
+
screens: path.resolve(__dirname, './lib/showcase/screens/')
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
const arkConfig = Object.assign({}, commonConfig, {
|
|
62
|
-
name:
|
|
62
|
+
name: 'ark',
|
|
63
63
|
mode: argv.mode,
|
|
64
64
|
output: {
|
|
65
|
-
publicPath:
|
|
66
|
-
filename:
|
|
67
|
-
path: path.join(__dirname,
|
|
65
|
+
publicPath: '/ark/',
|
|
66
|
+
filename: '[name].[contenthash].js',
|
|
67
|
+
path: path.join(__dirname, '/dist/ark')
|
|
68
68
|
},
|
|
69
69
|
plugins: commonConfig.plugins.concat([
|
|
70
70
|
new EnvironmentPlugin({
|
|
71
|
-
ARK_DESIGN:
|
|
72
|
-
})
|
|
73
|
-
])
|
|
71
|
+
ARK_DESIGN: 'ark'
|
|
72
|
+
})
|
|
73
|
+
])
|
|
74
74
|
})
|
|
75
75
|
|
|
76
76
|
const rootConfig = {
|
|
77
|
-
name:
|
|
77
|
+
name: 'root',
|
|
78
78
|
mode: argv.mode,
|
|
79
79
|
entry: {
|
|
80
|
-
index:
|
|
80
|
+
index: './lib/showcase/index.js'
|
|
81
81
|
},
|
|
82
82
|
plugins: [
|
|
83
83
|
new CleanWebpackPlugin(),
|
|
84
84
|
new DefinePlugin({
|
|
85
85
|
PRODUCTION: !devMode,
|
|
86
|
-
VERSION: JSON.stringify(require(
|
|
87
|
-
TARGET: JSON.stringify(target)
|
|
86
|
+
VERSION: JSON.stringify(require('./package.json').version),
|
|
87
|
+
TARGET: JSON.stringify(target)
|
|
88
88
|
}),
|
|
89
89
|
new CopyWebpackPlugin({
|
|
90
90
|
patterns: [
|
|
91
|
-
{ from:
|
|
92
|
-
]
|
|
91
|
+
{ from: 'lib/showcase/locales/', to: 'locales/' }
|
|
92
|
+
]
|
|
93
93
|
}),
|
|
94
94
|
new HtmlWebpackPlugin({
|
|
95
|
-
title:
|
|
96
|
-
template:
|
|
97
|
-
})
|
|
98
|
-
]
|
|
95
|
+
title: 'Componark',
|
|
96
|
+
template: './lib/showcase/index.html'
|
|
97
|
+
})
|
|
98
|
+
]
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
if (devMode) {
|
|
102
102
|
rootConfig.devServer = {
|
|
103
103
|
static: [
|
|
104
|
-
path.join(__dirname,
|
|
105
|
-
path.join(__dirname,
|
|
104
|
+
path.join(__dirname, 'dist'),
|
|
105
|
+
path.join(__dirname, 'dist/ark')
|
|
106
106
|
],
|
|
107
107
|
historyApiFallback: {
|
|
108
108
|
rewrites: [
|
|
109
|
-
{ from: /^\/$/, to:
|
|
110
|
-
{ from: /^\/ark/, to:
|
|
111
|
-
]
|
|
109
|
+
{ from: /^\/$/, to: '/index.html' },
|
|
110
|
+
{ from: /^\/ark/, to: '/ark/index.html' }
|
|
111
|
+
]
|
|
112
112
|
},
|
|
113
|
-
port: 7890
|
|
113
|
+
port: 7890
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './development.factory.js'
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Routark } from '@knowark/routarkjs'
|
|
2
|
-
|
|
3
|
-
export class StandardFactory {
|
|
4
|
-
/** @param {string} method */
|
|
5
|
-
extract (method) {
|
|
6
|
-
return this[`_${method}`]
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
_router () {
|
|
10
|
-
const design = process.env.ARK_DESIGN
|
|
11
|
-
return new Routark(window, `/${design}/`)
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const standardStrategy = {
|
|
16
|
-
Router: {
|
|
17
|
-
method: 'router'
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="utf-8">
|
|
6
|
-
<meta name="viewport" content="width=device-width,
|
|
7
|
-
initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
|
8
|
-
<title>Componark</title>
|
|
9
|
-
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css">
|
|
10
|
-
<link href="https://fonts.googleapis.com/css2?family=Material+Icons" rel="stylesheet">
|
|
11
|
-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/all.min.css"
|
|
12
|
-
integrity="sha512-HK5fgLBL+xu6dm/Ii3z4xhlSUyZgTT9tuc/hSrtw6uzJOvgRr2a9jyxxT1ely+B+xFAmJKVSTbpM/CuL7qxO8w=="
|
|
13
|
-
crossorigin="anonymous" />
|
|
14
|
-
<link href="https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;700&display=swap" rel="stylesheet">
|
|
15
|
-
|
|
16
|
-
</head>
|
|
17
|
-
|
|
18
|
-
<body>
|
|
19
|
-
<main></main>
|
|
20
|
-
</body>
|
|
21
|
-
|
|
22
|
-
</html>
|
package/showcase/design/index.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { AudioDemo } from './audioDemo.js'
|
|
2
|
-
|
|
3
|
-
export function hub (parentResolver) {
|
|
4
|
-
const resolver = parentResolver.forge({
|
|
5
|
-
strategy: {
|
|
6
|
-
AudioDemo: {
|
|
7
|
-
method: 'component'
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
|
-
factory: new ComponentFactory()
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
return resolver.resolve('AudioDemo')
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export class ComponentFactory {
|
|
17
|
-
/** @param {string} method */
|
|
18
|
-
extract (method) {
|
|
19
|
-
return this[`_${method}`]
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
_component () {
|
|
23
|
-
return new AudioDemo()
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { CameraDemo } from './cameraDemo.js'
|
|
2
|
-
|
|
3
|
-
export function hub (parentResolver) {
|
|
4
|
-
const resolver = parentResolver.forge({
|
|
5
|
-
strategy: {
|
|
6
|
-
CameraDemo: {
|
|
7
|
-
method: 'component'
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
|
-
factory: new ComponentFactory()
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
return resolver.resolve('CameraDemo')
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export class ComponentFactory {
|
|
17
|
-
/** @param {string} method */
|
|
18
|
-
extract (method) {
|
|
19
|
-
return this[`_${method}`]
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
_component () {
|
|
23
|
-
return new CameraDemo()
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { DropareaDemo } from "./dropareaDemo.js"
|
|
2
|
-
|
|
3
|
-
export function hub(parentResolver) {
|
|
4
|
-
const resolver = parentResolver.forge({
|
|
5
|
-
strategy: {
|
|
6
|
-
DropareaDemo: {
|
|
7
|
-
method: "component",
|
|
8
|
-
},
|
|
9
|
-
},
|
|
10
|
-
factory: new ComponentFactory(),
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
return resolver.resolve("DropareaDemo")
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export class ComponentFactory {
|
|
17
|
-
/** @param {string} method */
|
|
18
|
-
extract(method) {
|
|
19
|
-
return this[`_${method}`]
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
_component() {
|
|
23
|
-
return new DropareaDemo()
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/** @typedef {import('./root.component').RootComponent} RootComponent */
|
|
2
|
-
import './root.component.js'
|
|
3
|
-
import { setRoutes } from './root.routes.js'
|
|
4
|
-
|
|
5
|
-
export function hub (parentResolver, prefix) {
|
|
6
|
-
const resolver = parentResolver.forge({
|
|
7
|
-
strategy: {
|
|
8
|
-
RootComponent: {
|
|
9
|
-
method: 'rootComponent'
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
factory: new RootFactory(prefix)
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
const rootComponent = resolver.resolve('RootComponent')
|
|
16
|
-
setRoutes(resolver, rootComponent, prefix)
|
|
17
|
-
|
|
18
|
-
return rootComponent
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export class RootFactory {
|
|
22
|
-
/** @param {string} prefix */
|
|
23
|
-
constructor (prefix) {
|
|
24
|
-
RootFactory.prefix = prefix
|
|
25
|
-
// @ts-ignore
|
|
26
|
-
this._rootComponent.prefix = prefix
|
|
27
|
-
// @ts-ignore
|
|
28
|
-
this._rootComponent.dependencies = []
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/** @param {string} method */
|
|
32
|
-
extract (method) {
|
|
33
|
-
return this[`_${method}`]
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
_rootComponent () {
|
|
37
|
-
const rootComponent = /** @type {RootComponent} */
|
|
38
|
-
(document.createElement('app-root'))
|
|
39
|
-
return rootComponent.init({ path: RootFactory.prefix })
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
RootFactory.prefix = undefined
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ListDemo } from './listDemo.js'
|
|
2
|
-
|
|
3
|
-
export function hub (parentResolver) {
|
|
4
|
-
const resolver = parentResolver.forge({
|
|
5
|
-
strategy: {
|
|
6
|
-
ListDemo: {
|
|
7
|
-
method: 'component'
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
|
-
factory: new ComponentFactory()
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
return resolver.resolve('ListDemo')
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export class ComponentFactory {
|
|
17
|
-
/** @param {string} method */
|
|
18
|
-
extract (method) {
|
|
19
|
-
return this[`_${method}`]
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
_component () {
|
|
23
|
-
return new ListDemo()
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { PaginatorDemo } from './paginatorDemo.js'
|
|
2
|
-
|
|
3
|
-
export function hub (parentResolver) {
|
|
4
|
-
const resolver = parentResolver.forge({
|
|
5
|
-
strategy: {
|
|
6
|
-
PaginatorDemo: {
|
|
7
|
-
method: 'component'
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
|
-
factory: new ComponentFactory()
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
return resolver.resolve('PaginatorDemo')
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export class ComponentFactory {
|
|
17
|
-
/** @param {string} method */
|
|
18
|
-
extract (method) {
|
|
19
|
-
return this[`_${method}`]
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
_component () {
|
|
23
|
-
return new PaginatorDemo()
|
|
24
|
-
}
|
|
25
|
-
}
|