@knowark/componarkjs 1.7.3 → 1.7.4
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 +3 -3
- package/lib/base/styles/styles.js +32 -3
- package/package.json +1 -1
- package/showcase/assets/knowark.svg +1 -0
- package/showcase/{design/screens/base/audio/audioDemo.js → components/demos/audio.js} +5 -9
- package/showcase/{design/screens/base/camera/cameraDemo.js → components/demos/camera.js} +1 -1
- package/showcase/{design/screens/base/droparea/dropareaDemo.js → components/demos/droparea.js} +1 -1
- package/showcase/{design/screens/base/list/listDemo.js → components/demos/list.js} +1 -1
- package/showcase/{design/screens/base/paginator/paginatorDemo.js → components/demos/paginator.js} +1 -1
- package/showcase/{design/screens/base/splitview/splitViewDemo.js → components/demos/splitview.js} +40 -5
- package/showcase/{design/screens/base/translate/translateDemo.js → components/demos/translate.js} +1 -1
- package/showcase/components/index.html +81 -0
- package/showcase/index.html +40 -82
- 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/showcase/{design/.htaccess → .htaccess} +0 -0
package/Makefile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.PHONY: all tests coverage
|
|
1
|
+
.PHONY: all tests coverage showcase
|
|
2
2
|
|
|
3
3
|
setup:
|
|
4
4
|
npm install -g browser-sync && \
|
|
@@ -16,7 +16,7 @@ clean:
|
|
|
16
16
|
rm -rf ./dist
|
|
17
17
|
|
|
18
18
|
showcase:
|
|
19
|
-
npx live-server ./showcase
|
|
19
|
+
npx live-server ./showcase
|
|
20
20
|
|
|
21
21
|
dev:
|
|
22
22
|
npm run dev
|
|
@@ -28,7 +28,7 @@ push:
|
|
|
28
28
|
git push && git push --tags
|
|
29
29
|
|
|
30
30
|
deploy:
|
|
31
|
-
sshpass -e rsync -av --delete ./
|
|
31
|
+
sshpass -e rsync -av --delete ./showcase/ \
|
|
32
32
|
${RSYNC_USER}@${RSYNC_HOST}:${RSYNC_DIR}
|
|
33
33
|
|
|
34
34
|
reset:
|
|
@@ -46,7 +46,8 @@ html {
|
|
|
46
46
|
|
|
47
47
|
/* TYPOGRAPHY */
|
|
48
48
|
|
|
49
|
-
--font-size-
|
|
49
|
+
--font-size-base: 0.5rem;
|
|
50
|
+
--font-size-step: 0.125rem;
|
|
50
51
|
--line-height-step: 0.5;
|
|
51
52
|
--word-spacing-step: 0.1rem;
|
|
52
53
|
--letter-spacing-step: 0.05rem;
|
|
@@ -102,7 +103,8 @@ ${actions.map(action => css`
|
|
|
102
103
|
/* TYPOGRAPHY */
|
|
103
104
|
|
|
104
105
|
[style*='--font-size:'] {
|
|
105
|
-
font-size: calc(var(--font-size-
|
|
106
|
+
font-size: calc(var(--font-size-base) + (
|
|
107
|
+
var(--font-size-step) * var(--font-size)));
|
|
106
108
|
}
|
|
107
109
|
[style*='--line-height:'] {
|
|
108
110
|
line-height: calc(var(--line-height-step) * var(--line-height));
|
|
@@ -114,6 +116,18 @@ ${actions.map(action => css`
|
|
|
114
116
|
letter-spacing: calc(var(--letter-spacing-step) * var(--letter-spacing));
|
|
115
117
|
}
|
|
116
118
|
|
|
119
|
+
[style*='--text-overflow:'] {
|
|
120
|
+
overflow: hidden;
|
|
121
|
+
white-space: nowrap;
|
|
122
|
+
text-overflow: var(--text-overflow);
|
|
123
|
+
}
|
|
124
|
+
[style*='--overflow:'] {
|
|
125
|
+
overflow: var(--overflow);
|
|
126
|
+
}
|
|
127
|
+
[style*='--white-space:'] {
|
|
128
|
+
white-space: var(--white-space);
|
|
129
|
+
}
|
|
130
|
+
|
|
117
131
|
/* SPACING */
|
|
118
132
|
|
|
119
133
|
${sides.map(side => css`
|
|
@@ -277,7 +291,22 @@ ${[...mutableProperties, ...effects].map(
|
|
|
277
291
|
[style*='--display-large:'] {
|
|
278
292
|
display: var(--display-large);
|
|
279
293
|
}
|
|
280
|
-
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/* PSEUDO-ELEMENTS */
|
|
297
|
+
|
|
298
|
+
${actions.map(action => css`
|
|
299
|
+
[style*='--content-before${action}:']${action.replace('-', ':')}::before {
|
|
300
|
+
content: var(--content-before${action});
|
|
301
|
+
}
|
|
302
|
+
[style*='--content-after${action}:']${action.replace('-', ':')}::after {
|
|
303
|
+
content: var(--content-after${action});
|
|
304
|
+
}
|
|
305
|
+
[style*='--background-backdrop${action}:']${action.replace(
|
|
306
|
+
'-', ':')}::backdrop {
|
|
307
|
+
background: var(--background-backdrop${action});
|
|
308
|
+
}
|
|
309
|
+
`.trim()).join('\n')}
|
|
281
310
|
|
|
282
311
|
/* ANIMATIONS */
|
|
283
312
|
|
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!-- Generator: Gravit.io --><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="isolation:isolate" viewBox="107 253.112 287.776 287.776" width="287.776pt" height="287.776pt"><g><circle vector-effect="non-scaling-stroke" cx="250.88815644671115" cy="396.9999999999993" r="143.88815644671132" fill="rgb(0,30,61)"/><g><path d=" M 344.921 390.854 C 339.37 405.032 325.062 415.132 308.305 415.132 L 191.334 415.132 C 191.334 415.132 191.334 415.132 191.334 415.132 L 191.334 415.132 L 188.972 415.132 L 188.972 415.065 C 173.514 414.182 160.463 404.697 154.998 391.551 C 159.372 391.471 163.739 391.112 168.077 390.471 C 178.473 388.939 188.727 386.562 198.738 383.364 C 206.917 380.753 214.969 377.739 222.854 374.332 C 232.397 370.206 241.789 365.744 251.013 360.948 C 259.668 365.92 268.591 370.398 277.749 374.366 C 286.53 378.158 295.562 381.364 304.769 383.95 C 313.366 386.369 322.122 388.203 330.97 389.45 C 335.601 390.098 340.254 390.572 344.921 390.854 Z M 346.809 384.274 C 347.197 382.157 347.4 379.979 347.4 377.756 C 347.4 357.127 329.882 340.38 308.305 340.38 C 304.304 340.38 300.443 340.955 296.81 342.032 C 288.479 326.354 270.576 315.505 249.857 315.505 C 229.129 315.505 211.22 326.362 202.893 342.051 C 199.242 340.962 195.359 340.38 191.334 340.38 C 169.757 340.38 152.238 357.127 152.238 377.756 L 152.238 377.756 C 152.238 380.187 152.482 382.563 152.953 384.863 C 157.685 384.877 162.417 384.537 167.106 383.85 C 177.134 382.368 187.036 380.075 196.696 376.986 C 204.673 374.441 212.517 371.503 220.201 368.18 C 230.723 363.635 241.06 358.671 251.189 353.289 C 260.598 358.88 270.358 363.869 280.402 368.213 C 288.915 371.897 297.663 375.002 306.586 377.505 C 314.89 379.84 323.352 381.615 331.899 382.812 C 336.845 383.51 341.82 383.997 346.809 384.274 Z " fill-rule="evenodd" fill="rgb(0,255,255)"/><path d=" M 160.192 461.165 L 152.526 461.165 L 152.526 426.582 L 151.975 421.557 L 160.192 420.789 L 160.192 442.128 L 166.831 433.934 L 175.375 433.934 L 166.305 443.836 L 161.195 445.643 L 165.93 447.203 L 177.905 461.165 L 169.186 461.165 L 160.192 449.827 L 160.192 461.165 L 160.192 461.165 Z M 180.085 434.108 L 188.252 433.291 L 188.252 437.969 L 190.507 434.231 L 190.507 434.231 Q 191.308 433.959 192.148 433.736 L 192.148 433.736 L 192.148 433.736 Q 192.987 433.513 193.864 433.513 L 193.864 433.513 L 193.864 433.513 Q 194.941 433.513 195.956 433.575 L 195.956 433.575 L 195.956 433.575 Q 196.97 433.637 197.897 433.872 L 197.897 433.872 L 197.897 433.872 Q 198.824 434.108 199.651 434.565 L 199.651 434.565 L 199.651 434.565 Q 200.478 435.023 201.204 435.816 L 201.204 435.816 L 201.204 435.816 Q 201.981 436.657 202.407 437.648 L 202.407 437.648 L 202.407 437.648 Q 202.833 438.638 203.021 439.616 L 203.021 439.616 L 203.021 439.616 Q 203.209 440.593 203.246 441.522 L 203.246 441.522 L 203.246 441.522 Q 203.284 442.45 203.284 443.168 L 203.284 443.168 L 203.284 461.165 L 195.116 461.165 L 195.116 442.425 L 195.116 442.425 Q 195.116 441.41 194.929 440.73 L 194.929 440.73 L 194.929 440.73 Q 194.741 440.049 194.415 439.64 L 194.415 439.64 L 194.415 439.64 Q 194.089 439.232 193.626 439.059 L 193.626 439.059 L 193.626 439.059 Q 193.162 438.885 192.611 438.885 L 192.611 438.885 L 192.611 438.885 Q 192.185 438.885 191.647 439.034 L 191.647 439.034 L 191.647 439.034 Q 191.108 439.182 190.532 439.442 L 190.532 439.442 L 190.532 439.442 Q 189.956 439.702 189.367 440.098 L 189.367 440.098 L 189.367 440.098 Q 188.778 440.494 188.252 440.965 L 188.252 440.965 L 188.252 461.165 L 180.085 461.165 L 180.085 434.108 L 180.085 434.108 Z M 222.024 461.586 L 222.024 461.586 L 222.024 461.586 Q 219.017 461.586 216.537 460.509 L 216.537 460.509 L 216.537 460.509 Q 214.057 459.432 212.265 457.538 L 212.265 457.538 L 212.265 457.538 Q 210.474 455.645 209.484 453.07 L 209.484 453.07 L 209.484 453.07 Q 208.495 450.495 208.495 447.475 L 208.495 447.475 L 208.495 447.475 Q 208.495 444.48 209.447 441.918 L 209.447 441.918 L 209.447 441.918 Q 210.399 439.356 212.165 437.487 L 212.165 437.487 L 212.165 437.487 Q 213.931 435.618 216.424 434.565 L 216.424 434.565 L 216.424 434.565 Q 218.917 433.513 222.024 433.513 L 222.024 433.513 L 222.024 433.513 Q 225.03 433.513 227.523 434.565 L 227.523 434.565 L 227.523 434.565 Q 230.015 435.618 231.807 437.487 L 231.807 437.487 L 231.807 437.487 Q 233.598 439.356 234.588 441.918 L 234.588 441.918 L 234.588 441.918 Q 235.577 444.48 235.577 447.475 L 235.577 447.475 L 235.577 447.475 Q 235.577 450.495 234.625 453.07 L 234.625 453.07 L 234.625 453.07 Q 233.673 455.645 231.907 457.538 L 231.907 457.538 L 231.907 457.538 Q 230.141 459.432 227.635 460.509 L 227.635 460.509 L 227.635 460.509 Q 225.13 461.586 222.024 461.586 Z M 227.41 448.094 L 227.41 448.094 L 227.41 448.094 Q 227.41 446.411 227.109 444.777 L 227.109 444.777 L 227.109 444.777 Q 226.809 443.143 226.145 441.844 L 226.145 441.844 L 226.145 441.844 Q 225.481 440.544 224.441 439.752 L 224.441 439.752 L 224.441 439.752 Q 223.401 438.96 221.923 438.96 L 221.923 438.96 L 221.923 438.96 Q 220.545 438.96 219.543 439.64 L 219.543 439.64 L 219.543 439.64 Q 218.541 440.321 217.902 441.46 L 217.902 441.46 L 217.902 441.46 Q 217.263 442.599 216.963 444.047 L 216.963 444.047 L 216.963 444.047 Q 216.662 445.495 216.662 447.03 L 216.662 447.03 L 216.662 447.03 Q 216.662 448.738 216.963 450.372 L 216.963 450.372 L 216.963 450.372 Q 217.263 452.006 217.927 453.28 L 217.927 453.28 L 217.927 453.28 Q 218.591 454.555 219.618 455.347 L 219.618 455.347 L 219.618 455.347 Q 220.646 456.14 222.099 456.14 L 222.099 456.14 L 222.099 456.14 Q 223.477 456.14 224.479 455.459 L 224.479 455.459 L 224.479 455.459 Q 225.481 454.778 226.132 453.639 L 226.132 453.639 L 226.132 453.639 Q 226.784 452.501 227.097 451.065 L 227.097 451.065 L 227.097 451.065 Q 227.41 449.629 227.41 448.094 Z M 259.127 433.934 L 260.856 441.361 L 262.735 454.432 L 264.238 441.361 L 266.017 434.083 L 273.658 433.34 L 265.866 461.165 L 259.328 461.165 L 257.449 453.738 L 255.77 440.866 L 253.941 453.738 L 252.238 461.165 L 245.699 461.165 L 238.158 434.108 L 245.824 433.291 L 247.678 441.361 L 249.331 454.481 L 251.085 441.361 L 252.939 433.934 L 259.127 433.934 L 259.127 433.934 Z M 298.335 456.09 L 298.912 461.165 L 290.419 461.165 L 290.419 457.155 L 287.412 461.462 L 287.412 461.462 Q 287.212 461.512 286.936 461.549 L 286.936 461.549 L 286.936 461.549 Q 286.661 461.586 286.134 461.586 L 286.134 461.586 L 286.134 461.586 Q 283.98 461.586 282.051 460.979 L 282.051 460.979 L 282.051 460.979 Q 280.122 460.373 278.669 459.197 L 278.669 459.197 L 278.669 459.197 Q 277.216 458.021 276.351 456.288 L 276.351 456.288 L 276.351 456.288 Q 275.487 454.555 275.487 452.303 L 275.487 452.303 L 275.487 452.303 Q 275.487 450.718 275.963 449.431 L 275.963 449.431 L 275.963 449.431 Q 276.439 448.144 277.278 447.129 L 277.278 447.129 L 277.278 447.129 Q 278.117 446.114 279.22 445.371 L 279.22 445.371 L 279.22 445.371 Q 280.322 444.628 281.587 444.146 L 281.587 444.146 L 281.587 444.146 Q 282.853 443.663 284.193 443.428 L 284.193 443.428 L 284.193 443.428 Q 285.533 443.193 286.811 443.193 L 286.811 443.193 L 286.811 443.193 Q 287.938 443.193 288.828 443.267 L 288.828 443.267 L 288.828 443.267 Q 289.717 443.341 290.394 443.465 L 290.394 443.465 L 290.394 443.465 Q 290.368 442.475 290.243 441.645 L 290.243 441.645 L 290.243 441.645 Q 290.118 440.816 289.792 440.197 L 289.792 440.197 L 289.792 440.197 Q 289.467 439.578 288.915 439.232 L 288.915 439.232 L 288.915 439.232 Q 288.364 438.885 287.512 438.885 L 287.512 438.885 L 287.512 438.885 Q 285.383 438.885 283.429 439.368 L 283.429 439.368 L 283.429 439.368 Q 281.475 439.851 279.896 440.42 L 279.896 440.42 L 277.291 435.84 L 277.291 435.84 Q 279.245 434.974 281.124 434.454 L 281.124 434.454 L 281.124 434.454 Q 282.326 434.108 283.967 433.81 L 283.967 433.81 L 283.967 433.81 Q 285.608 433.513 287.738 433.513 L 287.738 433.513 L 287.738 433.513 Q 290.995 433.513 293.062 434.293 L 293.062 434.293 L 293.062 434.293 Q 295.129 435.073 296.294 436.496 L 296.294 436.496 L 296.294 436.496 Q 297.458 437.92 297.897 439.913 L 297.897 439.913 L 297.897 439.913 Q 298.335 441.905 298.335 444.307 L 298.335 444.307 L 298.335 456.09 L 298.335 456.09 Z M 290.419 453.986 L 290.419 448.416 L 290.419 448.416 Q 289.817 448.342 289.103 448.28 L 289.103 448.28 L 289.103 448.28 Q 288.389 448.218 287.738 448.218 L 287.738 448.218 L 287.738 448.218 Q 286.836 448.218 285.972 448.466 L 285.972 448.466 L 285.972 448.466 Q 285.107 448.713 284.431 449.208 L 284.431 449.208 L 284.431 449.208 Q 283.754 449.703 283.329 450.471 L 283.329 450.471 L 283.329 450.471 Q 282.903 451.238 282.903 452.278 L 282.903 452.278 L 282.903 452.278 Q 282.903 453.12 283.178 453.837 L 283.178 453.837 L 283.178 453.837 Q 283.454 454.555 283.905 455.088 L 283.905 455.088 L 283.905 455.088 Q 284.356 455.62 284.919 455.917 L 284.919 455.917 L 284.919 455.917 Q 285.483 456.214 286.059 456.214 L 286.059 456.214 L 286.059 456.214 Q 286.786 456.214 287.45 455.991 L 287.45 455.991 L 287.45 455.991 Q 288.114 455.768 288.677 455.434 L 288.677 455.434 L 288.677 455.434 Q 289.241 455.1 289.679 454.704 L 289.679 454.704 L 289.679 454.704 Q 290.118 454.308 290.419 453.986 L 290.419 453.986 L 290.419 453.986 Z M 320.958 434.33 L 320.608 439.702 L 320.608 439.702 Q 320.107 439.455 319.706 439.294 L 319.706 439.294 L 319.706 439.294 Q 319.305 439.133 318.904 439.034 L 318.904 439.034 L 318.904 439.034 Q 318.503 438.935 318.065 438.91 L 318.065 438.91 L 318.065 438.91 Q 317.626 438.885 317.05 438.885 L 317.05 438.885 L 317.05 438.885 Q 316.349 438.885 315.635 439.219 L 315.635 439.219 L 315.635 439.219 Q 314.921 439.554 314.257 440.123 L 314.257 440.123 L 314.257 440.123 Q 313.593 440.692 313.042 441.423 L 313.042 441.423 L 313.042 441.423 Q 312.49 442.153 312.115 442.945 L 312.115 442.945 L 312.115 461.165 L 303.947 461.165 L 303.947 434.108 L 312.115 433.291 L 312.115 439.009 L 314.47 433.934 L 314.47 433.934 Q 314.87 433.786 315.609 433.65 L 315.609 433.65 L 315.609 433.65 Q 316.349 433.513 317 433.513 L 317 433.513 L 317 433.513 Q 318.378 433.513 319.267 433.724 L 319.267 433.724 L 319.267 433.724 Q 320.157 433.934 320.958 434.33 L 320.958 434.33 L 320.958 434.33 Z M 331.806 461.165 L 324.14 461.165 L 324.14 426.582 L 323.589 421.557 L 331.806 420.789 L 331.806 442.128 L 338.445 433.934 L 346.989 433.934 L 337.919 443.836 L 332.808 445.643 L 337.544 447.203 L 349.519 461.165 L 340.8 461.165 L 331.806 449.827 L 331.806 461.165 L 331.806 461.165 Z " fill="rgb(0,255,255)"/></g></g></svg>
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
import { Component } from '
|
|
1
|
+
import { Component } from '@knowark/componarkjs'
|
|
2
2
|
|
|
3
3
|
export class AudioDemo extends Component {
|
|
4
|
-
init (context) {
|
|
5
|
-
return super.init(context)
|
|
6
|
-
}
|
|
7
|
-
|
|
8
4
|
render () {
|
|
5
|
+
this.style.cssText = '--padding:4; --margin:2;'
|
|
9
6
|
this.content = /* html */ `
|
|
10
7
|
<ark-audio></ark-audio>
|
|
11
8
|
|
|
12
|
-
<a
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* Reference
|
|
9
|
+
<a target="_blank"
|
|
10
|
+
href="https://github.com/knowark/componark/blob/master/lib/components/audio/README.md">
|
|
11
|
+
* Reference
|
|
16
12
|
</a>
|
|
17
13
|
`
|
|
18
14
|
return super.render()
|
package/showcase/{design/screens/base/splitview/splitViewDemo.js → components/demos/splitview.js}
RENAMED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { Component } from '
|
|
2
|
-
import './detailDemo.js'
|
|
3
|
-
|
|
4
|
-
const tag = 'demo-splitview'
|
|
1
|
+
import { Component } from '@knowark/componarkjs'
|
|
5
2
|
|
|
3
|
+
let tag = 'demo-splitview'
|
|
6
4
|
export class SplitViewDemo extends Component {
|
|
7
5
|
render () {
|
|
8
6
|
this.content = /* html */ `
|
|
@@ -54,5 +52,42 @@ export class SplitViewDemo extends Component {
|
|
|
54
52
|
|
|
55
53
|
}
|
|
56
54
|
}
|
|
57
|
-
|
|
58
55
|
Component.define(tag, SplitViewDemo)
|
|
56
|
+
|
|
57
|
+
tag = "demo-splitview-detail"
|
|
58
|
+
export class SplitviewDetailDemo extends Component {
|
|
59
|
+
init(context = {}) {
|
|
60
|
+
if (!context.data) return super.init()
|
|
61
|
+
|
|
62
|
+
const data = context.data
|
|
63
|
+
this.first = data.first
|
|
64
|
+
this.second = data.second
|
|
65
|
+
this.year = data.year
|
|
66
|
+
return super.init()
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
render() {
|
|
70
|
+
this.content = this.first
|
|
71
|
+
? /* html */ `
|
|
72
|
+
<button listen on-click="onClick"
|
|
73
|
+
style="margin:8px; --display-large:none;"
|
|
74
|
+
>Close</button>
|
|
75
|
+
<h1>${this.year}</h1>
|
|
76
|
+
<p>
|
|
77
|
+
<span data-first>FIRST: ${this.first}</span>
|
|
78
|
+
<span> | </span>
|
|
79
|
+
<span data-second>SECOND: ${this.second}</span>
|
|
80
|
+
</p>
|
|
81
|
+
`
|
|
82
|
+
: /* html */ `
|
|
83
|
+
<h1>Ark Detail Example</h1>
|
|
84
|
+
`
|
|
85
|
+
return super.render()
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
onClick (event) {
|
|
89
|
+
event.stopPropagation()
|
|
90
|
+
this.emit('close')
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
Component.define(tag, SplitviewDetailDemo)
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>Componark - Components</title>
|
|
6
|
+
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300&display=swap" rel="stylesheet">
|
|
7
|
+
<link rel="stylesheet"href="https://unpkg.com/@knowark/styleark@0.6.1/dist/styles.min.css">
|
|
8
|
+
<script type="importmap">
|
|
9
|
+
{
|
|
10
|
+
"imports": {
|
|
11
|
+
"@knowark/componarkjs": "https://unpkg.com/@knowark/componarkjs@1.7.3/lib/index.js"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
</script>
|
|
15
|
+
<style>
|
|
16
|
+
:root {
|
|
17
|
+
--secondary: #00ffff;
|
|
18
|
+
--primary: #001e3d;
|
|
19
|
+
font-family: "Roboto";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
html, body {
|
|
23
|
+
height: 100%;
|
|
24
|
+
}
|
|
25
|
+
</style>
|
|
26
|
+
</head>
|
|
27
|
+
<body>
|
|
28
|
+
<app-root style="height:100%;;"></app-root>
|
|
29
|
+
<script type="module">
|
|
30
|
+
import { Component, html } from '@knowark/componarkjs'
|
|
31
|
+
|
|
32
|
+
const tag = 'app-root'
|
|
33
|
+
class RootComponent extends Component {
|
|
34
|
+
render () {
|
|
35
|
+
this.content = html`
|
|
36
|
+
<nav style="background:var(--primary); --padding:4; --height:4">
|
|
37
|
+
<a href="/" style="text-decoration:none; color:white">COMPONARK</a>
|
|
38
|
+
</nav>
|
|
39
|
+
<main style="height:calc(100% - (var(--height-step) * 4));
|
|
40
|
+
--grid: auto-flow / 1fr 5fr">
|
|
41
|
+
<aside id="menu" style="--flow:row; overflow:auto"
|
|
42
|
+
listen on-click="onMenuItem">
|
|
43
|
+
${[
|
|
44
|
+
{ component: 'audio' },
|
|
45
|
+
{ component: 'camera' },
|
|
46
|
+
//{ component: 'capture' },
|
|
47
|
+
//{ component: 'droparea' },
|
|
48
|
+
//{ component: 'emit' },
|
|
49
|
+
{ component: 'list' },
|
|
50
|
+
{ component: 'paginator' },
|
|
51
|
+
{ component: 'splitview' },
|
|
52
|
+
{ component: 'translate' },
|
|
53
|
+
].map(item => html`
|
|
54
|
+
<button style="height:100%; width:100%; font-weight:bold;
|
|
55
|
+
text-align:center; text-transform:capitalize; cursor:pointer;
|
|
56
|
+
--all:unset; --background-hover:var(--primary);
|
|
57
|
+
--color-hover:var(--light);">
|
|
58
|
+
${item.component}
|
|
59
|
+
</button>
|
|
60
|
+
`).join('\n')}
|
|
61
|
+
</aside>
|
|
62
|
+
<article id="content" style="background:var(--muted); --padding:4">
|
|
63
|
+
</article>
|
|
64
|
+
</main>
|
|
65
|
+
`
|
|
66
|
+
return super.render()
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async onMenuItem (event) {
|
|
70
|
+
const component = event.target.textContent.trim()
|
|
71
|
+
const file = `./demos/${component}.js`
|
|
72
|
+
const module = await import(file)
|
|
73
|
+
this.querySelector('#content').innerHTML = `
|
|
74
|
+
<demo-${component}></demo-${component}>
|
|
75
|
+
`
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
Component.define(tag, RootComponent)
|
|
79
|
+
</script>
|
|
80
|
+
</body>
|
|
81
|
+
</html>
|
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>
|
|
@@ -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
|
-
}
|
|
@@ -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
|
-
}
|
|
File without changes
|