@rws-framework/client 2.16.3 → 2.17.0
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 +1 -1
- package/src/client.ts +2 -2
- package/src/components/_component.ts +2 -0
- package/src/components/index.ts +5 -0
- package/src/components/loader/component.ts +2 -2
- package/src/components/progress/component.ts +3 -4
- package/src/components/reformer/component.ts +29 -0
- package/src/components/reformer/fields/_field.ts +14 -0
- package/src/components/reformer/fields/text/component.ts +9 -0
- package/src/components/reformer/fields/text/styles/layout.scss +5 -0
- package/src/components/reformer/fields/text/template.html +7 -0
- package/src/components/reformer/styles/layout.scss +5 -0
- package/src/components/reformer/template.html +7 -0
- package/src/components/rws-api-resource/component.ts +20 -0
- package/src/components/rws-api-resource/styles/layout.scss +5 -0
- package/src/components/rws-api-resource/template.html +3 -0
- package/src/components/rws-api-resource/variants/form/component.ts +11 -0
- package/src/components/rws-api-resource/variants/form/styles/layout.scss +0 -0
- package/src/components/rws-api-resource/variants/form/template.html +3 -0
- package/src/components/rws-api-resource/variants/list/component.ts +11 -0
- package/src/components/rws-api-resource/variants/list/styles/layout.scss +0 -0
- package/src/components/rws-api-resource/variants/list/template.html +3 -0
- package/src/components/uploader/component.ts +3 -1
- package/src/types/IReFormerField.ts +5 -0
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -15,7 +15,7 @@ import RWSWindow, { RWSWindowComponentRegister, loadRWSRichWindow } from './type
|
|
|
15
15
|
|
|
16
16
|
import { DI, Container, Registration } from './components/_container';
|
|
17
17
|
|
|
18
|
-
import
|
|
18
|
+
import { declareRWSComponents } from './components/index';
|
|
19
19
|
import RWSContainer from './components/_container';
|
|
20
20
|
import TheRWSService from './services/_service';
|
|
21
21
|
|
|
@@ -202,4 +202,4 @@ class RWSClient {
|
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
export default DI.createInterface<RWSClient>(x => x.singleton(RWSClient));
|
|
205
|
-
export { RWSClient as RWSClientInstance };
|
|
205
|
+
export { RWSClient as RWSClientInstance, declareRWSComponents };
|
package/src/components/index.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { RWSUploader } from './uploader/component';
|
|
2
2
|
import { RWSProgress } from './progress/component';
|
|
3
3
|
import { RWSLoader } from './loader/component';
|
|
4
|
+
import { RWSApiResource } from './rws-api-resource/component';
|
|
5
|
+
import { ReFormer } from './reformer/component';
|
|
4
6
|
|
|
5
7
|
|
|
6
8
|
function declareRWSComponents(parted: boolean = false): void
|
|
@@ -9,6 +11,9 @@ function declareRWSComponents(parted: boolean = false): void
|
|
|
9
11
|
RWSUploader;
|
|
10
12
|
RWSProgress;
|
|
11
13
|
RWSLoader;
|
|
14
|
+
|
|
15
|
+
RWSApiResource;
|
|
16
|
+
ReFormer;
|
|
12
17
|
}
|
|
13
18
|
}
|
|
14
19
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { RWSView
|
|
1
|
+
import { RWSView } from '../_decorator';
|
|
2
|
+
import { RWSViewComponent } from '../_component';
|
|
2
3
|
|
|
3
4
|
@RWSView('the-loader')
|
|
4
5
|
class RWSLoader extends RWSViewComponent {
|
|
5
|
-
|
|
6
6
|
connectedCallback(): void {
|
|
7
7
|
super.connectedCallback();
|
|
8
8
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
} from '@microsoft/fast-element';
|
|
1
|
+
import { observable, attr, nullableNumberConverter } from '@microsoft/fast-element';
|
|
2
|
+
import { RWSView } from '../_decorator';
|
|
3
|
+
import { RWSViewComponent } from '../_component';
|
|
5
4
|
|
|
6
5
|
@RWSView('rws-progress', { debugPackaging: false })
|
|
7
6
|
class RWSProgress extends RWSViewComponent {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { observable, attr } from '@microsoft/fast-element';
|
|
2
|
+
import { IKDBTypesResponse } from '../../types/IBackendCore';
|
|
3
|
+
import { RWSViewComponent} from '../_component';
|
|
4
|
+
import { RWSView} from '../_decorator';
|
|
5
|
+
import { ReFormerText } from './fields/text/component';
|
|
6
|
+
|
|
7
|
+
ReFormerText;
|
|
8
|
+
|
|
9
|
+
@RWSView('rws-reformer')
|
|
10
|
+
class ReFormer extends RWSViewComponent {
|
|
11
|
+
@attr resourceName: string;
|
|
12
|
+
|
|
13
|
+
@observable fields: string[] | null = null;
|
|
14
|
+
@observable modelTypes: IKDBTypesResponse;
|
|
15
|
+
|
|
16
|
+
async connectedCallback(): Promise<void>
|
|
17
|
+
{
|
|
18
|
+
this.modelTypes = await this.apiService.getResource(this.resourceName);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
setForm(key: string, val: any)
|
|
22
|
+
{
|
|
23
|
+
console.log('set reformer form', {key, val});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
ReFormer.defineComponent();
|
|
28
|
+
|
|
29
|
+
export { ReFormer };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { observable, attr } from "@microsoft/fast-element";
|
|
2
|
+
import RWSViewComponent from "../../_component";
|
|
3
|
+
import { IReFormerField } from "../../../types/IReFormerField";
|
|
4
|
+
|
|
5
|
+
export abstract class ReFormerFieldComponent extends RWSViewComponent implements IReFormerField {
|
|
6
|
+
@attr name: string;
|
|
7
|
+
@observable defaultValue: any;
|
|
8
|
+
@observable setForm: (field: string, value: any) => Promise<void>;
|
|
9
|
+
|
|
10
|
+
changeField(key: string, value: any)
|
|
11
|
+
{
|
|
12
|
+
this.setForm(key, value);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<div class="re-former-container">
|
|
2
|
+
${T.repeat(x => x.modelTypes.data.types, T.html`<div class="form-field">
|
|
3
|
+
${T.when(x => x.type === 'String', T.html`
|
|
4
|
+
<re-former-text :setForm="${x => x.setForm.bind(x)}" name="${x => x.fieldName}"></re-former-text>
|
|
5
|
+
`)}
|
|
6
|
+
</div>`)}
|
|
7
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IKDBTypeInfo, IKDBTypesResponse } from '../../types/IBackendCore';
|
|
2
|
+
import { observable, attr } from '@microsoft/fast-element';
|
|
3
|
+
import { RWSView } from '../_decorator';
|
|
4
|
+
import { RWSViewComponent } from '../_component';
|
|
5
|
+
import { RWSResourceListComponent } from './variants/list/component';
|
|
6
|
+
import { RWSResourceFormComponent } from './variants/form/component';
|
|
7
|
+
import { IRWSResourceQuery } from '../../types/IRWSResource';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
RWSResourceListComponent;
|
|
11
|
+
RWSResourceFormComponent;
|
|
12
|
+
|
|
13
|
+
@RWSView('rws-resource')
|
|
14
|
+
class RWSApiResource extends RWSViewComponent {
|
|
15
|
+
@observable dbModelData: IKDBTypesResponse;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
RWSApiResource.defineComponent();
|
|
19
|
+
|
|
20
|
+
export { RWSApiResource };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RWSViewComponent} from '../../../_component';
|
|
2
|
+
import { RWSView} from '../../../_decorator';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
@RWSView('rws-resource-form')
|
|
6
|
+
class RWSResourceFormComponent extends RWSViewComponent {
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
RWSResourceFormComponent.defineComponent();
|
|
10
|
+
|
|
11
|
+
export { RWSResourceFormComponent };
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RWSViewComponent} from '../../../_component';
|
|
2
|
+
import { RWSView} from '../../../_decorator';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
@RWSView('rws-resource-list')
|
|
6
|
+
class RWSResourceListComponent extends RWSViewComponent {
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
RWSResourceListComponent.defineComponent();
|
|
10
|
+
|
|
11
|
+
export { RWSResourceListComponent };
|
|
File without changes
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { observable, attr } from '@microsoft/fast-element';
|
|
2
|
+
import { RWSView } from '../_decorator';
|
|
3
|
+
import { RWSViewComponent } from '../_component';
|
|
2
4
|
|
|
3
5
|
@RWSView('rws-uploader')
|
|
4
6
|
class RWSUploader extends RWSViewComponent {
|