@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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rws-framework/client",
3
3
  "private": false,
4
- "version": "2.16.3",
4
+ "version": "2.17.0",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
7
7
  "docs": "typedoc --tsconfig ./tsconfig.json"
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 RWSViewComponent, { IWithCompose } from './components/_component';
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 };
@@ -240,6 +240,8 @@ abstract class RWSViewComponent extends FoundationElement implements IRWSViewCom
240
240
 
241
241
  export default RWSViewComponent;
242
242
 
243
+ export { RWSViewComponent };
244
+
243
245
  export type {
244
246
  IAssetShowOptions,
245
247
  IRWSViewComponent
@@ -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, RWSViewComponent } from '../../index';
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 { RWSView, RWSViewComponent, observable, attr } from '../../index';
2
- import {
3
- nullableNumberConverter,
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,9 @@
1
+ import { RWSView} from '../../../_decorator';
2
+ import { ReFormerFieldComponent } from '../_field';
3
+
4
+ @RWSView('reformer-text')
5
+ class ReFormerText extends ReFormerFieldComponent {}
6
+
7
+ ReFormerText.defineComponent();
8
+
9
+ export { ReFormerText };
@@ -0,0 +1,5 @@
1
+ @import "@rws-mixins";
2
+
3
+ .re-former-text-input {
4
+ display: flex;
5
+ }
@@ -0,0 +1,7 @@
1
+ <sl-input
2
+ type="text"
3
+ name="${ x => x.name}"
4
+ id="re-former-field-${x.name}"
5
+ value="${x => x.defaultValue}"
6
+ @change="${(x,c) => x.changeField(x.name, c.event.target)}"
7
+ ></sl-input>
@@ -0,0 +1,5 @@
1
+ @import "@rws-mixins";
2
+
3
+ .re-former-container {
4
+ display: flex;
5
+ }
@@ -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,5 @@
1
+ @import "@rws-mixins";
2
+
3
+ .rws-api-container {
4
+
5
+ }
@@ -0,0 +1,3 @@
1
+ <div class="rws-api-container">
2
+
3
+ </div>
@@ -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 };
@@ -0,0 +1,3 @@
1
+ <div id="resource-form">
2
+
3
+ </div>
@@ -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 };
@@ -0,0 +1,3 @@
1
+ <div id="resource-list">
2
+
3
+ </div>
@@ -1,4 +1,6 @@
1
- import { RWSView, RWSViewComponent, observable, attr } from '../../index';
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 {
@@ -0,0 +1,5 @@
1
+ export interface IReFormerField {
2
+ name: string,
3
+ defaultValue?: any,
4
+ setForm: (field: string, value: any) => Promise<void>
5
+ }