@operato/scene-grist 1.0.0-alpha.9 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,12 +4,24 @@ It is a component that expresses multiple record data in the form of a data grid
4
4
  Data grid is suitable for web application UI, and data list is suitable for mobile application.
5
5
  This can be set with the grist mode attribute.
6
6
 
7
+ If you bind the following type of data to the value property of the grist component, you can see that the data is rendered in each record in grist.
8
+
9
+ ```
10
+ [
11
+ { name: "name 1", description: "record 1", ... },
12
+ { name: "name 2", description: "record 2", ... },
13
+ { name: "name 3", description: "record 3", ... },
14
+ { name: "name 4", description: "record 4", ... },
15
+ ]
16
+ ```
17
+
7
18
  ## Properties
8
19
 
9
20
  - grist mode
10
21
  - Grid: Data grid format that organizes multi-columns in a table format
11
- - list: Data list format that composes multi-column information in the form of an item block
12
- - Depends on device : Depending on the current display, it is automatically selected in the form of a data grid or a data list.
22
+ - List: Data list format that composes multi-column information in the form of an item block
23
+ - Card: Data list format that composes multi-column information in the form of an item block
24
+ - Depends on device : Depending on the current display, it is automatically selected in the form of a Grid or a List.
13
25
  - config
14
26
  - Configuration for grist
15
27
  - It consists of column, header, record and pagination information.
@@ -4,11 +4,23 @@
4
4
  数据网格适用于 Web 应用程序 UI,数据列表适用于移动应用程序。
5
5
  可以使用 grist 模式属性进行移动端应用设置。
6
6
 
7
+ 如果将以下类型的数据绑定到 grist 组件的 value 属性上,可以看到 grist 中的每条记录都呈现了数据。
8
+
9
+ ```
10
+ [
11
+ { name: "name 1", description: "record 1", ... },
12
+ { name: "name 2", description: "record 2", ... },
13
+ { name: "name 3", description: "record 3", ... },
14
+ { name: "name 4", description: "record 4", ... },
15
+ ]
16
+ ```
17
+
7
18
  ## Properties
8
19
 
9
20
  - 模式
10
21
  - Grid: 数据网格格式,以表格格式组织多列
11
- - list: 以项目块的形式组成多列信息的数据列表格式
22
+ - List: 以项目块的形式组成多列信息的数据列表格式
23
+ - Card: 卡片式数据列表
12
24
  - Depends on device : 根据当前设备自动选择数据网格或数据列表
13
25
  - 配置
14
26
  - 用于 grist 的配置
@@ -0,0 +1,15 @@
1
+ {
2
+ "keep": {
3
+ "days": true,
4
+ "amount": 2
5
+ },
6
+ "auditLog": "logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json",
7
+ "files": [
8
+ {
9
+ "date": 1654827950935,
10
+ "name": "logs/application-2022-06-10-11.log",
11
+ "hash": "2c183d3b88a5c349a78c57cf655a3030"
12
+ }
13
+ ],
14
+ "hashType": "md5"
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "keep": {
3
+ "days": true,
4
+ "amount": 14
5
+ },
6
+ "auditLog": "logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json",
7
+ "files": [
8
+ {
9
+ "date": 1654827953311,
10
+ "name": "logs/connections-2022-06-10-11.log",
11
+ "hash": "3ee93a30080fbb5f93fe4b5ab97c8283"
12
+ }
13
+ ],
14
+ "hashType": "md5"
15
+ }
@@ -0,0 +1,12 @@
1
+ 2022-06-10T11:25:52+09:00 info: File Storage is Ready.
2
+ 2022-06-10T11:26:12+09:00 info: File Storage is Ready.
3
+ 2022-06-10T11:26:17+09:00 info: Database connection established
4
+ 2022-06-10T11:26:18+09:00 error: listen EADDRINUSE: address already in use :::3000
5
+ 2022-06-10T11:26:40+09:00 info: File Storage is Ready.
6
+ 2022-06-10T11:26:42+09:00 info: Database connection established
7
+ 2022-06-10T11:26:43+09:00 info: 🚀 Server ready at http://0.0.0.0:3000/graphql
8
+ 2022-06-10T11:26:43+09:00 info: 🚀 Subscriptions ready at ws://0.0.0.0:3000/subscriptions
9
+ 2022-06-10T11:36:15+09:00 info: File Storage is Ready.
10
+ 2022-06-10T11:36:20+09:00 info: Database connection established
11
+ 2022-06-10T11:36:21+09:00 info: 🚀 Server ready at http://0.0.0.0:3000/graphql
12
+ 2022-06-10T11:36:21+09:00 info: 🚀 Subscriptions ready at ws://0.0.0.0:3000/subscriptions
@@ -0,0 +1,70 @@
1
+ 2022-06-10T11:26:44+09:00 info: Initializing ConnectionManager...
2
+ 2022-06-10T11:26:44+09:00 info: Connector 'echo-back-server' started to ready
3
+ 2022-06-10T11:26:44+09:00 info: Connector 'echo-back' started to ready
4
+ 2022-06-10T11:26:44+09:00 info: Connector 'http-connector' started to ready
5
+ 2022-06-10T11:26:44+09:00 info: Connector 'graphql-connector' started to ready
6
+ 2022-06-10T11:26:44+09:00 info: Connector 'sqlite-connector' started to ready
7
+ 2022-06-10T11:26:44+09:00 info: Connector 'postgresql-connector' started to ready
8
+ 2022-06-10T11:26:44+09:00 info: Connector 'mqtt-connector' started to ready
9
+ 2022-06-10T11:26:44+09:00 info: Connector 'mssql-connector' started to ready
10
+ 2022-06-10T11:26:44+09:00 info: Connector 'oracle-connector' started to ready
11
+ 2022-06-10T11:26:44+09:00 info: Connector 'mysql-connector' started to ready
12
+ 2022-06-10T11:26:44+09:00 info: Connector 'socket-server' started to ready
13
+ 2022-06-10T11:26:44+09:00 info: echo-back-servers are ready
14
+ 2022-06-10T11:26:44+09:00 info: echo-back connections are ready
15
+ 2022-06-10T11:26:44+09:00 info: http-connector connections are ready
16
+ 2022-06-10T11:26:44+09:00 info: graphql-connector connections are ready
17
+ 2022-06-10T11:26:44+09:00 info: sqlite-connector connections are ready
18
+ 2022-06-10T11:26:44+09:00 info: postgresql-connector connections are ready
19
+ 2022-06-10T11:26:44+09:00 info: mqtt-connector connections are ready
20
+ 2022-06-10T11:26:44+09:00 info: mssql-connector connections are ready
21
+ 2022-06-10T11:26:44+09:00 info: oracle-connector connections are ready
22
+ 2022-06-10T11:26:44+09:00 info: mysql-connector connections are ready
23
+ 2022-06-10T11:26:44+09:00 info: socket servers are ready
24
+ 2022-06-10T11:26:44+09:00 info: All connector for 'echo-back-server' ready
25
+ 2022-06-10T11:26:44+09:00 info: All connector for 'echo-back' ready
26
+ 2022-06-10T11:26:44+09:00 info: All connector for 'http-connector' ready
27
+ 2022-06-10T11:26:44+09:00 info: All connector for 'graphql-connector' ready
28
+ 2022-06-10T11:26:44+09:00 info: All connector for 'sqlite-connector' ready
29
+ 2022-06-10T11:26:44+09:00 info: All connector for 'postgresql-connector' ready
30
+ 2022-06-10T11:26:44+09:00 info: All connector for 'mqtt-connector' ready
31
+ 2022-06-10T11:26:44+09:00 info: All connector for 'mssql-connector' ready
32
+ 2022-06-10T11:26:44+09:00 info: All connector for 'oracle-connector' ready
33
+ 2022-06-10T11:26:44+09:00 info: All connector for 'mysql-connector' ready
34
+ 2022-06-10T11:26:44+09:00 info: All connector for 'socket-server' ready
35
+ 2022-06-10T11:26:44+09:00 info: ConnectionManager initialization done:
36
+ 2022-06-10T11:36:22+09:00 info: Initializing ConnectionManager...
37
+ 2022-06-10T11:36:22+09:00 info: Connector 'echo-back-server' started to ready
38
+ 2022-06-10T11:36:22+09:00 info: Connector 'echo-back' started to ready
39
+ 2022-06-10T11:36:22+09:00 info: Connector 'http-connector' started to ready
40
+ 2022-06-10T11:36:22+09:00 info: Connector 'graphql-connector' started to ready
41
+ 2022-06-10T11:36:22+09:00 info: Connector 'sqlite-connector' started to ready
42
+ 2022-06-10T11:36:22+09:00 info: Connector 'postgresql-connector' started to ready
43
+ 2022-06-10T11:36:22+09:00 info: Connector 'mqtt-connector' started to ready
44
+ 2022-06-10T11:36:22+09:00 info: Connector 'mssql-connector' started to ready
45
+ 2022-06-10T11:36:22+09:00 info: Connector 'oracle-connector' started to ready
46
+ 2022-06-10T11:36:22+09:00 info: Connector 'mysql-connector' started to ready
47
+ 2022-06-10T11:36:22+09:00 info: Connector 'socket-server' started to ready
48
+ 2022-06-10T11:36:22+09:00 info: echo-back-servers are ready
49
+ 2022-06-10T11:36:22+09:00 info: echo-back connections are ready
50
+ 2022-06-10T11:36:22+09:00 info: http-connector connections are ready
51
+ 2022-06-10T11:36:22+09:00 info: graphql-connector connections are ready
52
+ 2022-06-10T11:36:22+09:00 info: sqlite-connector connections are ready
53
+ 2022-06-10T11:36:22+09:00 info: postgresql-connector connections are ready
54
+ 2022-06-10T11:36:22+09:00 info: mqtt-connector connections are ready
55
+ 2022-06-10T11:36:22+09:00 info: mssql-connector connections are ready
56
+ 2022-06-10T11:36:22+09:00 info: oracle-connector connections are ready
57
+ 2022-06-10T11:36:22+09:00 info: mysql-connector connections are ready
58
+ 2022-06-10T11:36:22+09:00 info: socket servers are ready
59
+ 2022-06-10T11:36:22+09:00 info: All connector for 'echo-back-server' ready
60
+ 2022-06-10T11:36:22+09:00 info: All connector for 'echo-back' ready
61
+ 2022-06-10T11:36:22+09:00 info: All connector for 'http-connector' ready
62
+ 2022-06-10T11:36:22+09:00 info: All connector for 'graphql-connector' ready
63
+ 2022-06-10T11:36:22+09:00 info: All connector for 'sqlite-connector' ready
64
+ 2022-06-10T11:36:22+09:00 info: All connector for 'postgresql-connector' ready
65
+ 2022-06-10T11:36:22+09:00 info: All connector for 'mqtt-connector' ready
66
+ 2022-06-10T11:36:22+09:00 info: All connector for 'mssql-connector' ready
67
+ 2022-06-10T11:36:22+09:00 info: All connector for 'oracle-connector' ready
68
+ 2022-06-10T11:36:22+09:00 info: All connector for 'mysql-connector' ready
69
+ 2022-06-10T11:36:22+09:00 info: All connector for 'socket-server' ready
70
+ 2022-06-10T11:36:22+09:00 info: ConnectionManager initialization done:
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Grist UI component for things-scene",
4
4
  "license": "MIT",
5
5
  "author": "heartyoh",
6
- "version": "1.0.0-alpha.9",
6
+ "version": "1.0.2",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.js",
9
9
  "things-scene": true,
@@ -17,7 +17,7 @@
17
17
  "directory": "packages/grist"
18
18
  },
19
19
  "scripts": {
20
- "serve": "tsc && things-factory-dev",
20
+ "serve": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"things-factory-dev\"",
21
21
  "start": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds\"",
22
22
  "build": "tsc",
23
23
  "prepublish": "tsc",
@@ -26,15 +26,13 @@
26
26
  "migration": "things-factory-migration"
27
27
  },
28
28
  "dependencies": {
29
- "@hatiolab/things-scene": "^2.7.34",
30
- "@operato/data-grist": "^1.0.0-alpha.51",
31
- "uuid": "^3.4.0"
29
+ "@hatiolab/things-scene": "^3.0.19",
30
+ "@operato/data-grist": "^1.0.0"
32
31
  },
33
32
  "devDependencies": {
34
33
  "@hatiolab/prettier-config": "^1.0.0",
35
- "@operato/board": "^1.0.0-alpha.51",
36
- "@things-factory/builder": "^5.0.0-alpha.28",
37
- "@things-factory/operato-board": "^5.0.0-alpha.28",
34
+ "@things-factory/builder": "^5.0.0",
35
+ "@things-factory/operato-board": "^5.0.0",
38
36
  "@types/lodash-es": "^4.17.5",
39
37
  "@typescript-eslint/eslint-plugin": "^4.33.0",
40
38
  "@typescript-eslint/parser": "^4.33.0",
@@ -60,5 +58,5 @@
60
58
  "prettier --write"
61
59
  ]
62
60
  },
63
- "gitHead": "0f3a63c7937857320e260cfbbf841f54fa9c62ca"
61
+ "gitHead": "484b3aefc64bc7f15b67fae16f1b674f81767113"
64
62
  }
@@ -4,8 +4,6 @@
4
4
  * grist 컴포넌트를 보조하여 grist의 각종 동작을 수행하는 컴포넌트.
5
5
  */
6
6
 
7
- import uuid from 'uuid'
8
-
9
7
  import { Component, ComponentNature, Properties, RectPath, ValueHolder } from '@hatiolab/things-scene'
10
8
  import { DataGrist } from '@operato/data-grist'
11
9
  import { GristData, GristRecord, SorterConfig } from '@operato/data-grist/src/types.js'
@@ -98,14 +96,12 @@ const NATURE: ComponentNature = {
98
96
  }
99
97
 
100
98
  export default class GristAction extends ValueHolder(RectPath(Component)) {
101
- static get nature() {
99
+ private _data: any
100
+
101
+ get nature() {
102
102
  return NATURE
103
103
  }
104
104
 
105
- // grist의 fetchHandler를 사용할 때 이 컴포넌트를 판별할 ID
106
- private uuid = uuid.v4()
107
- private _data: any
108
-
109
105
  ready() {
110
106
  // 뷰어 시작시에도 action 값이 getPageInfo로 되어 있을 경우 fetchHandler를 등록하기 위해 onchange를 호출함
111
107
  this.onchange({ action: this.state.action })
@@ -132,10 +128,11 @@ export default class GristAction extends ValueHolder(RectPath(Component)) {
132
128
  // action 값이 바뀌면 getPageInfo인지 확인하고 grist에 fetchHandler를 등록하거나 폐기함
133
129
  if ('action' in after) {
134
130
  const gristComponent = this.targetGristComponent
131
+ const { refid } = this.state
135
132
 
136
133
  if (gristComponent) {
137
134
  if (after.action == ACTIONS.GET_PAGE_INFO) {
138
- gristComponent.beforeFetchFuncs[this.uuid] = (fetchedData: {
135
+ gristComponent.beforeFetchFuncs[refid] = (fetchedData: {
139
136
  page: number
140
137
  limit: number
141
138
  total: number
@@ -145,7 +142,7 @@ export default class GristAction extends ValueHolder(RectPath(Component)) {
145
142
  this.doDataMap()
146
143
  }
147
144
  } else {
148
- delete gristComponent.beforeFetchFuncs[this.uuid]
145
+ delete gristComponent.beforeFetchFuncs[refid]
149
146
  }
150
147
  }
151
148
  }
package/src/grist.ts CHANGED
@@ -6,7 +6,8 @@ import '@operato/data-grist'
6
6
 
7
7
  import { Component, ComponentNature, HTMLOverlayElement, Properties, error } from '@hatiolab/things-scene'
8
8
  import { DataGrist, FetchResult } from '@operato/data-grist'
9
- import { FetchOption, GristRecord } from '@operato/data-grist/dist/src/types'
9
+
10
+ import { FetchOption } from '@operato/data-grist/dist/src/types'
10
11
 
11
12
  const NATURE: ComponentNature = {
12
13
  mutable: false,
@@ -27,6 +28,10 @@ const NATURE: ComponentNature = {
27
28
  display: 'List',
28
29
  value: 'LIST'
29
30
  },
31
+ {
32
+ display: 'Card',
33
+ value: 'CARD'
34
+ },
30
35
  {
31
36
  display: 'Depends on device',
32
37
  value: 'DEVICE'
@@ -86,10 +91,6 @@ const NATURE: ComponentNature = {
86
91
  const isMobileDevice = () => false
87
92
 
88
93
  export default class SceneGrist extends HTMLOverlayElement {
89
- static get nature() {
90
- return NATURE
91
- }
92
-
93
94
  public beforeFetchFuncs: any = {}
94
95
 
95
96
  private __value: any = {}
@@ -98,6 +99,10 @@ export default class SceneGrist extends HTMLOverlayElement {
98
99
 
99
100
  public grist?: DataGrist
100
101
 
102
+ get nature() {
103
+ return NATURE
104
+ }
105
+
101
106
  ready() {
102
107
  super.ready()
103
108