@rws-framework/client 2.10.0 → 2.10.2
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/package.json +2 -2
- package/rws.webpack.config.js +3 -4
- package/src/client/components.ts +2 -6
- package/src/components/uploader/component.ts +7 -3
- package/src/components/uploader/styles/layout.scss +36 -8
- package/src/components/uploader/template.html +1 -1
- package/src/services/ConfigService.ts +1 -4
- package/webpack/scss/_import.js +0 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rws-framework/client",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "2.10.
|
|
4
|
+
"version": "2.10.2",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"docs": "typedoc --tsconfig ./tsconfig.json"
|
|
@@ -106,4 +106,4 @@
|
|
|
106
106
|
"overrides": {
|
|
107
107
|
"lodash": "^4.17.21"
|
|
108
108
|
}
|
|
109
|
-
}
|
|
109
|
+
}
|
package/rws.webpack.config.js
CHANGED
|
@@ -32,7 +32,9 @@ const RWSWebpackWrapper = async (config) => {
|
|
|
32
32
|
|
|
33
33
|
const executionDir = rwsPath.relativize(BuildConfigurator.get('executionDir') || config.executionDir || process.cwd(), config.packageDir);
|
|
34
34
|
|
|
35
|
-
const
|
|
35
|
+
const isWatcher = process.argv.includes('--watch') || false;
|
|
36
|
+
|
|
37
|
+
const isDev = isWatcher ? true : (BuildConfigurator.get('dev', config.dev) || false);
|
|
36
38
|
const isHotReload = BuildConfigurator.get('hot', config.hot);
|
|
37
39
|
const isReport = BuildConfigurator.get('report', config.report);
|
|
38
40
|
const isParted = BuildConfigurator.get('parted', config.parted || false);
|
|
@@ -235,9 +237,6 @@ const RWSWebpackWrapper = async (config) => {
|
|
|
235
237
|
WEBPACK_PLUGINS.push(new RWSAfterPlugin({ actions: WEBPACK_AFTER_ACTIONS, dev: isDev }));
|
|
236
238
|
}
|
|
237
239
|
|
|
238
|
-
console.log('Webpack building with entrypoints:', Object.keys(automatedChunks));
|
|
239
|
-
|
|
240
|
-
|
|
241
240
|
let cfgExport = {
|
|
242
241
|
context: executionDir,
|
|
243
242
|
entry: {
|
package/src/client/components.ts
CHANGED
|
@@ -13,13 +13,9 @@ async function loadPartedComponents(this: RWSClientInstance): Promise<RWSInfoTyp
|
|
|
13
13
|
const loadedComponents = [];
|
|
14
14
|
|
|
15
15
|
document.addEventListener(RWSViewComponent._EVENTS.component_define, (event: Event) => {
|
|
16
|
-
const customEvent = event as CustomEvent<string>;
|
|
16
|
+
const customEvent = event as CustomEvent<string>;
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
loadedComponents.push(customEvent.detail);
|
|
21
|
-
|
|
22
|
-
console.log(loadedComponents.length, componentParts.components.length);
|
|
18
|
+
loadedComponents.push(customEvent.detail);
|
|
23
19
|
});
|
|
24
20
|
|
|
25
21
|
let compList = '';
|
|
@@ -3,19 +3,23 @@ import { RWSView, RWSViewComponent, observable, attr } from '../../index';
|
|
|
3
3
|
@RWSView('rws-uploader')
|
|
4
4
|
class RWSUploader extends RWSViewComponent {
|
|
5
5
|
|
|
6
|
-
@observable uploadProgress: number
|
|
6
|
+
@observable uploadProgress: number;
|
|
7
7
|
|
|
8
8
|
@observable uploadedFile: File;
|
|
9
9
|
@observable chosenFile: File;
|
|
10
10
|
@observable uploadParams: any;
|
|
11
11
|
|
|
12
12
|
@attr onFinish: (uploadResponse: any) => void;
|
|
13
|
-
@attr onStart: (chosenFile: File, context: any) =>
|
|
13
|
+
@attr onStart: (chosenFile: File, context: any) => Promise<unknown> = async (chosenFile: File) => chosenFile;
|
|
14
14
|
@attr onProgress: (progress: number) => void = (progress: number) => null;
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
async onUploadStart(): Promise<void>
|
|
18
18
|
{
|
|
19
|
+
if(!this.uploadProgress){
|
|
20
|
+
this.uploadProgress = 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
19
23
|
const response = await this.onStart(this.chosenFile, this);
|
|
20
24
|
|
|
21
25
|
if(response === null){
|
|
@@ -71,7 +75,7 @@ class RWSUploader extends RWSViewComponent {
|
|
|
71
75
|
|
|
72
76
|
uploadProgressChanged(oldV: any, newV: any)
|
|
73
77
|
{
|
|
74
|
-
|
|
78
|
+
|
|
75
79
|
}
|
|
76
80
|
}
|
|
77
81
|
|
|
@@ -1,8 +1,33 @@
|
|
|
1
1
|
@import "@rws-mixins";
|
|
2
2
|
|
|
3
|
+
//vars
|
|
4
|
+
$upl_secondary: var(--rws-uploader-secondary, #CCC);
|
|
5
|
+
$upl_bg: var(--rws-uploader-bg, #424242);
|
|
6
|
+
$upl_border: var(--rws-uploader-border, #FFF);
|
|
7
|
+
|
|
8
|
+
$upl_primary: var(--rws-uploader-primary, #EE2375);
|
|
9
|
+
|
|
10
|
+
$upl_text: var(--rws-uploader-text, #000);
|
|
11
|
+
|
|
12
|
+
$upl_btn_text: var(--rws-uploader-btn-text, #000);
|
|
13
|
+
$upl_btn_bg: var(--rws-uploader-btn-bg, #CCC);
|
|
14
|
+
$upl_btn_border: var(--rws-uploader-btn-border, #000);
|
|
15
|
+
|
|
16
|
+
rws-progress {
|
|
17
|
+
--accent-foreground-rest: $upl_primary;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//styles
|
|
3
21
|
.upload_area {
|
|
22
|
+
|
|
23
|
+
color: $upl_text;
|
|
24
|
+
|
|
4
25
|
padding: 25px;
|
|
5
26
|
|
|
27
|
+
|
|
28
|
+
*{
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
}
|
|
6
31
|
|
|
7
32
|
section{
|
|
8
33
|
&::after{
|
|
@@ -14,7 +39,7 @@
|
|
|
14
39
|
display: block;
|
|
15
40
|
contain: content;
|
|
16
41
|
box-sizing: border-box;
|
|
17
|
-
background:
|
|
42
|
+
background: $upl_bg;
|
|
18
43
|
border-radius: 10px;
|
|
19
44
|
box-shadow: 0 0 5px rgba(0, 0, 0, 0.7);
|
|
20
45
|
|
|
@@ -22,7 +47,7 @@
|
|
|
22
47
|
@include grid-container();
|
|
23
48
|
@include grid-flex-align-items(center, center);
|
|
24
49
|
|
|
25
|
-
border: 4px dashed
|
|
50
|
+
border: 4px dashed $upl_border; // Adjust color as needed
|
|
26
51
|
width: 100%; // Adjust width as needed
|
|
27
52
|
height: 100%; // Adjust height as needed
|
|
28
53
|
padding: 30px;
|
|
@@ -33,14 +58,14 @@
|
|
|
33
58
|
cursor: pointer;
|
|
34
59
|
|
|
35
60
|
.file-block {
|
|
36
|
-
border: 1px solid
|
|
61
|
+
border: 1px solid $upl_border;
|
|
37
62
|
|
|
38
63
|
font-size: 10px;
|
|
39
64
|
padding: 15px;
|
|
40
65
|
border-radius: 15px;
|
|
41
66
|
|
|
42
67
|
.close-btn {
|
|
43
|
-
border: 1px solid
|
|
68
|
+
border: 1px solid $upl_border;
|
|
44
69
|
padding: 5px;
|
|
45
70
|
font-weight: bold;
|
|
46
71
|
margin-left: 10px;
|
|
@@ -53,7 +78,7 @@
|
|
|
53
78
|
|
|
54
79
|
&:before{
|
|
55
80
|
content: '';
|
|
56
|
-
background:
|
|
81
|
+
background: $upl_secondary;
|
|
57
82
|
opacity: 0.4;
|
|
58
83
|
|
|
59
84
|
position: absolute;
|
|
@@ -70,6 +95,7 @@
|
|
|
70
95
|
|
|
71
96
|
h3{
|
|
72
97
|
padding: 0 15px;
|
|
98
|
+
color: $upl_text;
|
|
73
99
|
}
|
|
74
100
|
|
|
75
101
|
article {
|
|
@@ -78,14 +104,14 @@
|
|
|
78
104
|
|
|
79
105
|
|
|
80
106
|
button {
|
|
81
|
-
background:
|
|
82
|
-
color:
|
|
107
|
+
background: $upl_btn_bg;
|
|
108
|
+
color: $upl_btn_text;
|
|
83
109
|
font-size: 14px;
|
|
84
110
|
padding: 10px;
|
|
85
111
|
box-shadow: none;
|
|
86
112
|
border-radius: 5px;
|
|
87
113
|
border-style: solid;
|
|
88
|
-
border-color:
|
|
114
|
+
border-color: $upl_btn_border;
|
|
89
115
|
border-width: 1px;
|
|
90
116
|
|
|
91
117
|
fill: currentcolor;
|
|
@@ -97,6 +123,8 @@
|
|
|
97
123
|
|
|
98
124
|
&.next{
|
|
99
125
|
float: right;
|
|
126
|
+
margin-right: 10px;
|
|
127
|
+
margin-bottom: 10px;
|
|
100
128
|
}
|
|
101
129
|
}
|
|
102
130
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div class="upload_area">
|
|
2
2
|
<section>
|
|
3
3
|
<h3>Upload file</h3>
|
|
4
|
-
<rws-progress value="${x => x.uploadProgress}" min="1" max="100"></rws-progress>
|
|
4
|
+
<rws-progress :value="${x => x.uploadProgress}" min="1" max="100"></rws-progress>
|
|
5
5
|
<article>
|
|
6
6
|
<div class="drag-and-drop">
|
|
7
7
|
<div @click="${x => !x.chosenFile ? x.onChoose() : (() => {})()}" class="upl-background"></div>
|
|
@@ -92,10 +92,7 @@ class ConfigService extends TheService {
|
|
|
92
92
|
|
|
93
93
|
return new Promise((resolve) => {
|
|
94
94
|
const tick = () => {
|
|
95
|
-
if(ConfigService.isLoaded){
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
// console.log('resolved', tagName);
|
|
95
|
+
if(ConfigService.isLoaded){
|
|
99
96
|
clearTimeout(t);
|
|
100
97
|
resolve(true);
|
|
101
98
|
return;
|