@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
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
import { Component } from 'base/component'
|
|
2
|
-
|
|
3
|
-
// @ts-ignore
|
|
4
|
-
// eslint-disable-next-line no-undef
|
|
5
|
-
export const version = VERSION
|
|
6
|
-
|
|
7
|
-
const design = process.env.ARK_DESIGN
|
|
8
|
-
|
|
9
|
-
const tag = 'app-root'
|
|
10
|
-
export class RootComponent extends Component {
|
|
11
|
-
render() {
|
|
12
|
-
this.content = /* html */ `
|
|
13
|
-
<nav class="app-root__navbar">
|
|
14
|
-
<div class="app-root__menu">
|
|
15
|
-
<span class="material-icons">
|
|
16
|
-
list
|
|
17
|
-
</span>
|
|
18
|
-
</div>
|
|
19
|
-
<div class="app-root__brand">
|
|
20
|
-
<a href="/">
|
|
21
|
-
<h1 class="app-root__title">COMPONARK</h1>
|
|
22
|
-
<p class="app-root__subtitle">web components</p>
|
|
23
|
-
</a>
|
|
24
|
-
</div>
|
|
25
|
-
<div class="app-root__actions">
|
|
26
|
-
<a class="app-root__navitem" href="#">style ${design.toUpperCase()}</a>
|
|
27
|
-
</div>
|
|
28
|
-
</nav>
|
|
29
|
-
|
|
30
|
-
<aside class="app-root__sidebar">
|
|
31
|
-
<div class="${tag}__sidebar-content">
|
|
32
|
-
${this.locations
|
|
33
|
-
.map(
|
|
34
|
-
(location) => `
|
|
35
|
-
<a class="app-root__sideitem" href="/${design}${location.path}">
|
|
36
|
-
${location.name}
|
|
37
|
-
</a>
|
|
38
|
-
`
|
|
39
|
-
)
|
|
40
|
-
.join('')}
|
|
41
|
-
</div>
|
|
42
|
-
</aside>
|
|
43
|
-
|
|
44
|
-
<section class="app-root__content" data-content></section>
|
|
45
|
-
|
|
46
|
-
`
|
|
47
|
-
this.showMenu()
|
|
48
|
-
return super.render()
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/** @param {Component} component */
|
|
52
|
-
setContentComponent(component) {
|
|
53
|
-
if (!component) return
|
|
54
|
-
const container = this.select('[data-content]')
|
|
55
|
-
|
|
56
|
-
container.firstChild?.remove()
|
|
57
|
-
container.append(component)
|
|
58
|
-
component.render().load()
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/** @param {CustomEvent} event */
|
|
62
|
-
selectEventListener(event) {
|
|
63
|
-
event.stopImmediatePropagation()
|
|
64
|
-
const style = event.detail.value
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/** @param {CustomEvent} event */
|
|
68
|
-
onListItemSelected(event) {
|
|
69
|
-
this.dispatchEvent(
|
|
70
|
-
new CustomEvent('navigate', {
|
|
71
|
-
bubbles: true,
|
|
72
|
-
detail: { path: event.detail.data.path },
|
|
73
|
-
})
|
|
74
|
-
)
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
showMenu() {
|
|
78
|
-
this.querySelector('.app-root__menu').addEventListener('click', () => {
|
|
79
|
-
this.querySelector('.app-root__sidebar').style.display = 'grid'
|
|
80
|
-
})
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
get locations() {
|
|
84
|
-
return [
|
|
85
|
-
{ name: 'Audio', path: '/base/audio' },
|
|
86
|
-
{ name: 'Camera', path: '/base/camera' },
|
|
87
|
-
{ name: 'Droparea', path: '/base/droparea' },
|
|
88
|
-
{ name: 'List', path: '/base/list' },
|
|
89
|
-
{ name: 'Paginator', path: '/base/paginator' },
|
|
90
|
-
{ name: 'Spinner', path: '/base/spinner' },
|
|
91
|
-
{ name: 'SplitView', path: '/base/splitview' },
|
|
92
|
-
{ name: 'Translate', path: '/base/translate' },
|
|
93
|
-
]
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const styles = /* css */ `
|
|
98
|
-
|
|
99
|
-
html {
|
|
100
|
-
height: 100%;
|
|
101
|
-
height: -webkit-fill-available;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
body {
|
|
105
|
-
margin: 0;
|
|
106
|
-
padding: 0;
|
|
107
|
-
background-color: #eff3f8;
|
|
108
|
-
height: 100%;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
:root {
|
|
112
|
-
/*
|
|
113
|
-
--primary: #1976d2;
|
|
114
|
-
--secondary: orange;
|
|
115
|
-
--success: green;
|
|
116
|
-
--danger: red;
|
|
117
|
-
--warning: yellow;
|
|
118
|
-
--info: cyan;
|
|
119
|
-
--dark: black;
|
|
120
|
-
--muted: gray;
|
|
121
|
-
--light: lightgray;
|
|
122
|
-
*/
|
|
123
|
-
--xs: 0.3rem;
|
|
124
|
-
--sm: 0.8rem;
|
|
125
|
-
--md: 1rem;
|
|
126
|
-
--lg: 2rem;
|
|
127
|
-
--xl: 3rem;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.${tag} {
|
|
131
|
-
display: grid;
|
|
132
|
-
height: 100%;
|
|
133
|
-
grid-template-rows: 0.05fr 1fr;
|
|
134
|
-
font-family: "Roboto","Helvetica","Arial",sans-serif;
|
|
135
|
-
letter-spacing: 0.02em;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.${tag}__navbar {
|
|
139
|
-
grid-column: 1 / 13;
|
|
140
|
-
display: grid;
|
|
141
|
-
grid-template-columns: repeat(6, 1fr);
|
|
142
|
-
background-color: rgb(0 30 61);
|
|
143
|
-
color: #00ffff;
|
|
144
|
-
text-decoration: none
|
|
145
|
-
overflow: hidden;
|
|
146
|
-
border-bottom:4px solid rgb(160 255 255 / 53%);
|
|
147
|
-
box-shadow: 0px 0px 4px rgba(0,0,0,.6);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.${tag} .material-icons {
|
|
151
|
-
font-size: 2.5rem;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.${tag}__navitem {
|
|
155
|
-
text-decoration: none;
|
|
156
|
-
padding: 2vw;
|
|
157
|
-
color: cyan;
|
|
158
|
-
height:auto;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
.${tag}__sideitems {
|
|
162
|
-
display: flex;
|
|
163
|
-
flex-direction: column;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.${tag}__navitem,
|
|
167
|
-
.${tag}__sideitem {
|
|
168
|
-
transition: background 0.1s ease;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.${tag}__navitem:hover,
|
|
172
|
-
.${tag}__sideitem:hover {
|
|
173
|
-
background-color: rgb(38 54 70);
|
|
174
|
-
color: cyan;
|
|
175
|
-
}
|
|
176
|
-
.${tag}__navitem:active,
|
|
177
|
-
.${tag}__sideitem:active {
|
|
178
|
-
background-color: rgb(239, 243, 248);
|
|
179
|
-
color: cyan;
|
|
180
|
-
}
|
|
181
|
-
.${tag}__navitem:hover, .app-root__sideitem:hover {
|
|
182
|
-
background-color: rgb(131 170 209);
|
|
183
|
-
color: rgb(0 1 2);
|
|
184
|
-
font-weight: bold;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
.${tag}__brand {
|
|
188
|
-
display: grid;
|
|
189
|
-
align-items: center;
|
|
190
|
-
padding: 0 1rem;
|
|
191
|
-
height: 100%;
|
|
192
|
-
width: fit-content;
|
|
193
|
-
justify-self: start;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.${tag}__brand a {
|
|
197
|
-
text-decoration: none;
|
|
198
|
-
text-align: center;
|
|
199
|
-
margin: 0;
|
|
200
|
-
color: white;
|
|
201
|
-
transition: .1s;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.${tag}__brand:hover a {
|
|
205
|
-
color: rgb(0, 255, 255);
|
|
206
|
-
transition: .1s;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
.${tag}__actions {
|
|
211
|
-
display: grid;
|
|
212
|
-
grid-auto-flow: column;
|
|
213
|
-
align-items: center;
|
|
214
|
-
justify-items: center;
|
|
215
|
-
grid-column: 6;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
.${tag}__title {
|
|
219
|
-
all: inherit;
|
|
220
|
-
font-weight: 700;
|
|
221
|
-
font-size: 1.3rem;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
.${tag}__subtitle {
|
|
225
|
-
all: inherit;
|
|
226
|
-
font-size:0.9rem;
|
|
227
|
-
font-weight: 300;
|
|
228
|
-
text-align:center;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
.${tag}__sidebar {
|
|
232
|
-
display: grid;
|
|
233
|
-
height: 100%;
|
|
234
|
-
width: 240px;
|
|
235
|
-
grid-row: 2 / -1;
|
|
236
|
-
background-color: #001e3d;
|
|
237
|
-
color: #00ffff;
|
|
238
|
-
text-decoration: none;
|
|
239
|
-
overflow-x: hidden;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
.${tag}__sidebar-content {
|
|
243
|
-
display: inherit;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
.${tag}__navbar-brand {
|
|
247
|
-
display: none;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
.${tag}__sideitem {
|
|
251
|
-
text-decoration: none;
|
|
252
|
-
padding: 1vw;
|
|
253
|
-
color: rgb(160 255 255);
|
|
254
|
-
border-bottom: 1px solid #8080801c;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
.${tag}__menu {
|
|
258
|
-
display: none;
|
|
259
|
-
text-align:center;
|
|
260
|
-
user-select: none;
|
|
261
|
-
cursor: pointer;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
.${tag}__content {
|
|
265
|
-
grid-area: 2 / 2 / auto / 13;
|
|
266
|
-
padding: 2vmin;
|
|
267
|
-
overflow-x: hidden;
|
|
268
|
-
overflow-y: auto;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
@media only screen and (max-width: 800px) {
|
|
272
|
-
.${tag}__sidebar {
|
|
273
|
-
display: none;
|
|
274
|
-
position: absolute;
|
|
275
|
-
z-index: 1000;
|
|
276
|
-
width: 150px;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
.${tag}__menu {
|
|
280
|
-
display: grid;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
.${tag}__content {
|
|
284
|
-
grid-area: 2 / 1 / auto / 13;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
.${tag}__brand {
|
|
288
|
-
grid-column: 3 / 5;
|
|
289
|
-
justify-self: center;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
}
|
|
293
|
-
`
|
|
294
|
-
Component.define(tag, RootComponent, styles)
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export function setRoutes(resolver, rootComponent, prefix) {
|
|
2
|
-
/** @param {string} path @returns {{ path: string, action: function }} */
|
|
3
|
-
function getComponentRoute(path, dependencies = []) {
|
|
4
|
-
return {
|
|
5
|
-
path: path,
|
|
6
|
-
action: async () => {
|
|
7
|
-
for (const dependency of dependencies) {
|
|
8
|
-
await import(`components/${dependency}/index.js`)
|
|
9
|
-
}
|
|
10
|
-
await import(`components/${path}/index.js`)
|
|
11
|
-
const module = await import(`./${path}/index.js`)
|
|
12
|
-
rootComponent.setContentComponent(module.hub(resolver))
|
|
13
|
-
},
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const router = resolver.resolve('Router')
|
|
18
|
-
router.addRoutes(prefix, [
|
|
19
|
-
getComponentRoute('audio'),
|
|
20
|
-
getComponentRoute('camera'),
|
|
21
|
-
getComponentRoute('droparea'),
|
|
22
|
-
getComponentRoute('list'),
|
|
23
|
-
getComponentRoute('paginator', ['list']),
|
|
24
|
-
getComponentRoute('spinner'),
|
|
25
|
-
getComponentRoute('splitview', ['list']),
|
|
26
|
-
getComponentRoute('translate'),
|
|
27
|
-
])
|
|
28
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { SpinnerDemo } from './spinnerDemo.js'
|
|
2
|
-
|
|
3
|
-
export function hub (parentResolver) {
|
|
4
|
-
const resolver = parentResolver.forge({
|
|
5
|
-
strategy: {
|
|
6
|
-
SpinnerDemo: {
|
|
7
|
-
method: 'component'
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
|
-
factory: new ComponentFactory()
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
return resolver.resolve('SpinnerDemo')
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export class ComponentFactory {
|
|
17
|
-
/** @param {string} method */
|
|
18
|
-
extract (method) {
|
|
19
|
-
return this[`_${method}`]
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
_component () {
|
|
23
|
-
return new SpinnerDemo()
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { Component } from 'base/component/index.js'
|
|
2
|
-
|
|
3
|
-
const tag = 'demo-spinner'
|
|
4
|
-
export class SpinnerDemo extends Component {
|
|
5
|
-
init(context) {
|
|
6
|
-
return super.init()
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
render() {
|
|
10
|
-
this.content = /* html */ `
|
|
11
|
-
<h1>spinner</h1>
|
|
12
|
-
|
|
13
|
-
<div class="spinner-container">
|
|
14
|
-
<div>
|
|
15
|
-
<ark-spinner></ark-spinner>
|
|
16
|
-
<p style="margin-top:16px">circle</p>
|
|
17
|
-
</div>
|
|
18
|
-
<div>
|
|
19
|
-
<ark-spinner scale="1.5" type="chase"></ark-spinner>
|
|
20
|
-
<p style="margin-top:16px">chase</p>
|
|
21
|
-
</div>
|
|
22
|
-
<div>
|
|
23
|
-
<ark-spinner type="rect"></ark-spinner>
|
|
24
|
-
<p style="margin-top:16px">rect</p>
|
|
25
|
-
</div>
|
|
26
|
-
<div>
|
|
27
|
-
<ark-spinner type="bounce"></ark-spinner>
|
|
28
|
-
<p style="margin-top:16px">bounce</p>
|
|
29
|
-
</div>
|
|
30
|
-
<div>
|
|
31
|
-
<ark-spinner type="loader"></ark-spinner>
|
|
32
|
-
<p style="margin-top:16px">loader</p>
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
<a
|
|
37
|
-
target="_blank" href="https://github.com/knowark/componark/blob/master/lib/components/spinner/README.md">
|
|
38
|
-
* Reference
|
|
39
|
-
</a>
|
|
40
|
-
`
|
|
41
|
-
return super.render()
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const styles = /* css */`
|
|
46
|
-
.spinner-container{
|
|
47
|
-
display: flex;
|
|
48
|
-
gap:1.5rem;
|
|
49
|
-
flex-wrap: wrap;
|
|
50
|
-
justify-content: center;
|
|
51
|
-
align-items: center;
|
|
52
|
-
width: 100%;
|
|
53
|
-
}
|
|
54
|
-
`
|
|
55
|
-
Component.define(tag, SpinnerDemo, styles)
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Component } from "base/component/index.js"
|
|
2
|
-
|
|
3
|
-
const tag = "demo-splitview-detail"
|
|
4
|
-
|
|
5
|
-
export class SplitviewDetailDemo extends Component {
|
|
6
|
-
init(context = {}) {
|
|
7
|
-
if (!context.data) return super.init()
|
|
8
|
-
|
|
9
|
-
const data = context.data
|
|
10
|
-
this.first = data.first
|
|
11
|
-
this.second = data.second
|
|
12
|
-
this.year = data.year
|
|
13
|
-
return super.init()
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
render() {
|
|
17
|
-
this.content = this.first
|
|
18
|
-
? /* html */ `
|
|
19
|
-
<button listen on-click="onClick"
|
|
20
|
-
style="margin:8px; --display-large:none;"
|
|
21
|
-
>Close</button>
|
|
22
|
-
<h1>${this.year}</h1>
|
|
23
|
-
<p>
|
|
24
|
-
<span data-first>FIRST: ${this.first}</span>
|
|
25
|
-
<span> | </span>
|
|
26
|
-
<span data-second>SECOND: ${this.second}</span>
|
|
27
|
-
</p>
|
|
28
|
-
`
|
|
29
|
-
: /* html */ `
|
|
30
|
-
<h1>Ark Detail Example</h1>
|
|
31
|
-
`
|
|
32
|
-
return super.render()
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
onClick (event) {
|
|
36
|
-
event.stopPropagation()
|
|
37
|
-
this.emit('close')
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
Component.define(tag, SplitviewDetailDemo)
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { SplitViewDemo } from './splitViewDemo.js'
|
|
2
|
-
|
|
3
|
-
export function hub (parentResolver) {
|
|
4
|
-
const resolver = parentResolver.forge({
|
|
5
|
-
strategy: {
|
|
6
|
-
SplitViewDemo: {
|
|
7
|
-
method: 'component'
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
|
-
factory: new ComponentFactory()
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
return resolver.resolve('SplitViewDemo')
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export class ComponentFactory {
|
|
17
|
-
/** @param {string} method */
|
|
18
|
-
extract (method) {
|
|
19
|
-
return this[`_${method}`]
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
_component () {
|
|
23
|
-
return new SplitViewDemo()
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { TranslateDemo } from './translateDemo.js'
|
|
2
|
-
|
|
3
|
-
export function hub (parentResolver) {
|
|
4
|
-
const resolver = parentResolver.forge({
|
|
5
|
-
factory: new ComponentFactory()
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
return resolver.resolve('TranslateDemo')
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export class ComponentFactory {
|
|
12
|
-
/** @param {string} method */
|
|
13
|
-
extract (method) {
|
|
14
|
-
return this[`${method}`]
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
translateDemo () {
|
|
18
|
-
return new TranslateDemo()
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Injectark } from '@knowark/injectarkjs'
|
|
2
|
-
import { buildInjector } from '../core/factories/index.js'
|
|
3
|
-
import { setMainRoutes } from './screens.routes.js'
|
|
4
|
-
|
|
5
|
-
/** @param {string} target */
|
|
6
|
-
export function main (target) {
|
|
7
|
-
const { strategy, factory } = buildInjector(target)
|
|
8
|
-
const resolver = new Injectark({ strategy: strategy, factory: factory })
|
|
9
|
-
const mainComponent = document.querySelector('main')
|
|
10
|
-
const prefix = '/'
|
|
11
|
-
setMainRoutes(mainComponent, resolver, prefix)
|
|
12
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export function setMainRoutes (mainComponent, resolver, prefix) {
|
|
2
|
-
const router = resolver.resolve('Router')
|
|
3
|
-
router.addRoutes(prefix, [
|
|
4
|
-
{
|
|
5
|
-
path: '',
|
|
6
|
-
action: async () => {
|
|
7
|
-
return router.navigate('/base/accordion')
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
path: 'base',
|
|
12
|
-
action: async () => {
|
|
13
|
-
const module = await import('./base/index.js')
|
|
14
|
-
const _prefix = prefix + 'base/'
|
|
15
|
-
setMainComponent(mainComponent, module.hub(resolver, _prefix))
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
])
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function setMainComponent (mainComponent, screenComponent) {
|
|
22
|
-
mainComponent.parentElement.replaceChild(screenComponent, mainComponent)
|
|
23
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2017",
|
|
4
|
-
"module": "commonjs",
|
|
5
|
-
"allowJs": true,
|
|
6
|
-
"checkJs": true,
|
|
7
|
-
"noEmit": true,
|
|
8
|
-
"noImplicitThis": false,
|
|
9
|
-
"noImplicitAny": false,
|
|
10
|
-
"esModuleInterop": true,
|
|
11
|
-
"resolveJsonModule": true,
|
|
12
|
-
"baseUrl": "lib",
|
|
13
|
-
"paths": {
|
|
14
|
-
"@base*": [
|
|
15
|
-
"base"
|
|
16
|
-
"base*"
|
|
17
|
-
],
|
|
18
|
-
"*": [
|
|
19
|
-
"*"
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
File without changes
|