@operato/property-editor 1.0.0-alpha.4 → 1.0.0-alpha.40
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/@types/global/index.d.ts +2 -0
- package/CHANGELOG.md +306 -0
- package/demo/index.html +181 -5
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.js +2 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/ox-properties-dynamic-view.d.ts +4 -0
- package/dist/src/ox-properties-dynamic-view.js +122 -0
- package/dist/src/ox-properties-dynamic-view.js.map +1 -0
- package/dist/src/ox-property-editor-angle.d.ts +5 -0
- package/dist/src/ox-property-editor-angle.js +17 -0
- package/dist/src/ox-property-editor-angle.js.map +1 -0
- package/dist/src/ox-property-editor-checkbox.d.ts +6 -0
- package/dist/src/ox-property-editor-checkbox.js +18 -0
- package/dist/src/ox-property-editor-checkbox.js.map +1 -0
- package/dist/src/ox-property-editor-color.d.ts +5 -0
- package/dist/src/ox-property-editor-color.js +23 -0
- package/dist/src/ox-property-editor-color.js.map +1 -0
- package/dist/src/ox-property-editor-crontab.d.ts +5 -0
- package/dist/src/ox-property-editor-crontab.js +15 -0
- package/dist/src/ox-property-editor-crontab.js.map +1 -0
- package/dist/src/ox-property-editor-data.d.ts +5 -0
- package/dist/src/ox-property-editor-data.js +15 -0
- package/dist/src/ox-property-editor-data.js.map +1 -0
- package/dist/src/ox-property-editor-date.d.ts +4 -0
- package/dist/src/ox-property-editor-date.js +14 -0
- package/dist/src/ox-property-editor-date.js.map +1 -0
- package/dist/src/ox-property-editor-file.d.ts +5 -0
- package/dist/src/ox-property-editor-file.js +17 -0
- package/dist/src/ox-property-editor-file.js.map +1 -0
- package/dist/src/ox-property-editor-gradient-colorstops.d.ts +5 -0
- package/dist/src/ox-property-editor-gradient-colorstops.js +25 -0
- package/dist/src/ox-property-editor-gradient-colorstops.js.map +1 -0
- package/dist/src/ox-property-editor-image.d.ts +5 -0
- package/dist/src/ox-property-editor-image.js +16 -0
- package/dist/src/ox-property-editor-image.js.map +1 -0
- package/dist/src/ox-property-editor-legend.d.ts +4 -0
- package/dist/src/ox-property-editor-legend.js +14 -0
- package/dist/src/ox-property-editor-legend.js.map +1 -0
- package/dist/src/ox-property-editor-multiple-colors.d.ts +5 -0
- package/dist/src/ox-property-editor-multiple-colors.js +15 -0
- package/dist/src/ox-property-editor-multiple-colors.js.map +1 -0
- package/dist/src/ox-property-editor-number.d.ts +5 -0
- package/dist/src/ox-property-editor-number.js +28 -0
- package/dist/src/ox-property-editor-number.js.map +1 -0
- package/dist/src/ox-property-editor-options.d.ts +5 -0
- package/dist/src/ox-property-editor-options.js +15 -0
- package/dist/src/ox-property-editor-options.js.map +1 -0
- package/dist/src/ox-property-editor-password.d.ts +4 -0
- package/dist/src/ox-property-editor-password.js +14 -0
- package/dist/src/ox-property-editor-password.js.map +1 -0
- package/dist/src/ox-property-editor-range.d.ts +5 -0
- package/dist/src/ox-property-editor-range.js +18 -0
- package/dist/src/ox-property-editor-range.js.map +1 -0
- package/dist/src/ox-property-editor-scene-component-id.d.ts +5 -0
- package/dist/src/ox-property-editor-scene-component-id.js +21 -0
- package/dist/src/ox-property-editor-scene-component-id.js.map +1 -0
- package/dist/src/ox-property-editor-select.d.ts +16 -0
- package/dist/src/ox-property-editor-select.js +66 -0
- package/dist/src/ox-property-editor-select.js.map +1 -0
- package/dist/src/ox-property-editor-solid-colorstops.d.ts +5 -0
- package/dist/src/ox-property-editor-solid-colorstops.js +25 -0
- package/dist/src/ox-property-editor-solid-colorstops.js.map +1 -0
- package/dist/src/ox-property-editor-string.d.ts +4 -0
- package/dist/src/ox-property-editor-string.js +14 -0
- package/dist/src/ox-property-editor-string.js.map +1 -0
- package/dist/src/ox-property-editor-table.d.ts +5 -0
- package/dist/src/ox-property-editor-table.js +15 -0
- package/dist/src/ox-property-editor-table.js.map +1 -0
- package/dist/src/ox-property-editor-textarea.d.ts +5 -0
- package/dist/src/ox-property-editor-textarea.js +26 -0
- package/dist/src/ox-property-editor-textarea.js.map +1 -0
- package/dist/src/ox-property-editor-value-map.d.ts +5 -0
- package/dist/src/ox-property-editor-value-map.js +20 -0
- package/dist/src/ox-property-editor-value-map.js.map +1 -0
- package/dist/src/ox-property-editor-value-ranges.d.ts +5 -0
- package/dist/src/ox-property-editor-value-ranges.js +25 -0
- package/dist/src/ox-property-editor-value-ranges.js.map +1 -0
- package/dist/src/ox-property-editor.d.ts +1 -0
- package/dist/src/ox-property-editor.js +9 -5
- package/dist/src/ox-property-editor.js.map +1 -1
- package/dist/src/types.d.ts +8 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +32 -4
- package/src/index.ts +2 -1
- package/src/ox-properties-dynamic-view.ts +133 -0
- package/src/ox-property-editor-angle.ts +14 -0
- package/src/ox-property-editor-checkbox.ts +16 -0
- package/src/ox-property-editor-color.ts +20 -0
- package/src/ox-property-editor-crontab.ts +12 -0
- package/src/ox-property-editor-data.ts +12 -0
- package/src/ox-property-editor-date.ts +10 -0
- package/src/ox-property-editor-file.ts +14 -0
- package/src/ox-property-editor-gradient-colorstops.ts +22 -0
- package/src/ox-property-editor-image.ts +13 -0
- package/src/ox-property-editor-legend.ts +10 -0
- package/src/ox-property-editor-multiple-colors.ts +12 -0
- package/src/ox-property-editor-number.ts +26 -0
- package/src/ox-property-editor-options.ts +12 -0
- package/src/ox-property-editor-password.ts +10 -0
- package/src/ox-property-editor-range.ts +16 -0
- package/src/ox-property-editor-scene-component-id.ts +18 -0
- package/src/ox-property-editor-select.ts +73 -0
- package/src/ox-property-editor-solid-colorstops.ts +22 -0
- package/src/ox-property-editor-string.ts +10 -0
- package/src/ox-property-editor-table.ts +12 -0
- package/src/ox-property-editor-textarea.ts +22 -0
- package/src/ox-property-editor-value-map.ts +18 -0
- package/src/ox-property-editor-value-ranges.ts +23 -0
- package/src/ox-property-editor.ts +10 -5
- package/src/types.ts +8 -0
- package/translations/en.json +3 -0
- package/translations/ko.json +3 -0
- package/translations/ms.json +3 -0
- package/translations/zh.json +3 -0
- package/tsconfig.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,312 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.0.0-alpha.40](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.39...v1.0.0-alpha.40) (2022-03-26)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @operato/property-editor
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [1.0.0-alpha.39](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.38...v1.0.0-alpha.39) (2022-03-25)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @operato/property-editor
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [1.0.0-alpha.38](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.37...v1.0.0-alpha.38) (2022-03-25)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @operato/property-editor
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [1.0.0-alpha.37](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.36...v1.0.0-alpha.37) (2022-03-25)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @operato/property-editor
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## [1.0.0-alpha.36](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.35...v1.0.0-alpha.36) (2022-03-21)
|
|
39
|
+
|
|
40
|
+
**Note:** Version bump only for package @operato/property-editor
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## [1.0.0-alpha.35](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.34...v1.0.0-alpha.35) (2022-03-21)
|
|
47
|
+
|
|
48
|
+
**Note:** Version bump only for package @operato/property-editor
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## [1.0.0-alpha.34](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.33...v1.0.0-alpha.34) (2022-03-20)
|
|
55
|
+
|
|
56
|
+
**Note:** Version bump only for package @operato/property-editor
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## [1.0.0-alpha.33](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.32...v1.0.0-alpha.33) (2022-03-19)
|
|
63
|
+
|
|
64
|
+
**Note:** Version bump only for package @operato/property-editor
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## [1.0.0-alpha.32](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.31...v1.0.0-alpha.32) (2022-03-19)
|
|
71
|
+
|
|
72
|
+
**Note:** Version bump only for package @operato/property-editor
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## [1.0.0-alpha.31](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.30...v1.0.0-alpha.31) (2022-03-19)
|
|
79
|
+
|
|
80
|
+
**Note:** Version bump only for package @operato/property-editor
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
## [1.0.0-alpha.30](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.29...v1.0.0-alpha.30) (2022-03-18)
|
|
87
|
+
|
|
88
|
+
**Note:** Version bump only for package @operato/property-editor
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
## [1.0.0-alpha.29](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.28...v1.0.0-alpha.29) (2022-03-17)
|
|
95
|
+
|
|
96
|
+
**Note:** Version bump only for package @operato/property-editor
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
## [1.0.0-alpha.28](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.26...v1.0.0-alpha.28) (2022-03-17)
|
|
103
|
+
|
|
104
|
+
**Note:** Version bump only for package @operato/property-editor
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
## [1.0.0-alpha.27](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.26...v1.0.0-alpha.27) (2022-03-17)
|
|
111
|
+
|
|
112
|
+
**Note:** Version bump only for package @operato/property-editor
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
## [1.0.0-alpha.26](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.25...v1.0.0-alpha.26) (2022-03-17)
|
|
119
|
+
|
|
120
|
+
**Note:** Version bump only for package @operato/property-editor
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
## [1.0.0-alpha.25](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.24...v1.0.0-alpha.25) (2022-03-17)
|
|
127
|
+
|
|
128
|
+
**Note:** Version bump only for package @operato/property-editor
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
## [1.0.0-alpha.24](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.23...v1.0.0-alpha.24) (2022-03-17)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
### :bug: Bug Fix
|
|
138
|
+
|
|
139
|
+
* ccp, dataset, property-editor style ([92b2448](https://github.com/hatiolab/operato/commit/92b2448756604ee0b885949dd193241f319cf147))
|
|
140
|
+
* refactoring grist-editor, property-editor and input ([ea7431a](https://github.com/hatiolab/operato/commit/ea7431a5e2dfd96ef392c1905e9622df7c2ef88c))
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
## [1.0.0-alpha.23](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.22...v1.0.0-alpha.23) (2022-03-17)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
### :rocket: New Features
|
|
148
|
+
|
|
149
|
+
* added qc module ([263b679](https://github.com/hatiolab/operato/commit/263b6794b97a635df1a50d013adaef2e83635908))
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
## [1.0.0-alpha.22](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.21...v1.0.0-alpha.22) (2022-03-17)
|
|
154
|
+
|
|
155
|
+
**Note:** Version bump only for package @operato/property-editor
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
## [1.0.0-alpha.21](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.20...v1.0.0-alpha.21) (2022-03-16)
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
### :rocket: New Features
|
|
165
|
+
|
|
166
|
+
* add ccp module ([cbea635](https://github.com/hatiolab/operato/commit/cbea635d5f638d49fc99d68cc1727ac3e06ddf22))
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
## [1.0.0-alpha.20](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.19...v1.0.0-alpha.20) (2022-03-15)
|
|
171
|
+
|
|
172
|
+
**Note:** Version bump only for package @operato/property-editor
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
## [1.0.0-alpha.19](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.18...v1.0.0-alpha.19) (2022-03-14)
|
|
179
|
+
|
|
180
|
+
**Note:** Version bump only for package @operato/property-editor
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
## [1.0.0-alpha.18](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.17...v1.0.0-alpha.18) (2022-03-14)
|
|
187
|
+
|
|
188
|
+
**Note:** Version bump only for package @operato/property-editor
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
## [1.0.0-alpha.17](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.16...v1.0.0-alpha.17) (2022-03-13)
|
|
195
|
+
|
|
196
|
+
**Note:** Version bump only for package @operato/property-editor
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
## [1.0.0-alpha.16](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.15...v1.0.0-alpha.16) (2022-03-13)
|
|
203
|
+
|
|
204
|
+
**Note:** Version bump only for package @operato/property-editor
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
## [1.0.0-alpha.15](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.14...v1.0.0-alpha.15) (2022-03-13)
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
### :rocket: New Features
|
|
214
|
+
|
|
215
|
+
* migrate input, property-editor from things-factory ([dbd5e73](https://github.com/hatiolab/operato/commit/dbd5e73eac328e72c4bb7abd113a819532bc894d))
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
## [1.0.0-alpha.14](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.13...v1.0.0-alpha.14) (2022-03-13)
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
### :bug: Bug Fix
|
|
223
|
+
|
|
224
|
+
* typo ([24e77ac](https://github.com/hatiolab/operato/commit/24e77aca7938c895fdfe37f5235c6c781964d81a))
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
## [1.0.0-alpha.13](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.12...v1.0.0-alpha.13) (2022-03-13)
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
### :bug: Bug Fix
|
|
232
|
+
|
|
233
|
+
* typos ([71447fa](https://github.com/hatiolab/operato/commit/71447fa2dfb52c5e45909baac735c2e195856256))
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
## [1.0.0-alpha.12](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.11...v1.0.0-alpha.12) (2022-03-13)
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
### :rocket: New Features
|
|
241
|
+
|
|
242
|
+
* migrate input, property-editor from things-factory ([4800d85](https://github.com/hatiolab/operato/commit/4800d859473bf623325233a7f2af851e5d093dcb))
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
## [1.0.0-alpha.11](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.10...v1.0.0-alpha.11) (2022-03-12)
|
|
247
|
+
|
|
248
|
+
**Note:** Version bump only for package @operato/property-editor
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
## [1.0.0-alpha.10](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.9...v1.0.0-alpha.10) (2022-03-12)
|
|
255
|
+
|
|
256
|
+
**Note:** Version bump only for package @operato/property-editor
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
## [1.0.0-alpha.9](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.8...v1.0.0-alpha.9) (2022-03-12)
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
### :rocket: New Features
|
|
266
|
+
|
|
267
|
+
* settled concept for input, property-editor, grist-editor, so on ([0c9e1d0](https://github.com/hatiolab/operato/commit/0c9e1d054c7aef5d965868242cf471667af7a3c3))
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
## [1.0.0-alpha.8](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.7...v1.0.0-alpha.8) (2022-03-11)
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
### :bug: Bug Fix
|
|
275
|
+
|
|
276
|
+
* ox-property-editor-checkbox fault ([7e54318](https://github.com/hatiolab/operato/commit/7e54318b6a350782113e18d01ce7999c1e95fe47))
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
## [1.0.0-alpha.7](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.6...v1.0.0-alpha.7) (2022-03-11)
|
|
281
|
+
|
|
282
|
+
**Note:** Version bump only for package @operato/property-editor
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
## [1.0.0-alpha.6](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.5...v1.0.0-alpha.6) (2022-03-11)
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
### :bug: Bug Fix
|
|
292
|
+
|
|
293
|
+
* ox-property-editor package.json missing ([ee8d0f8](https://github.com/hatiolab/operato/commit/ee8d0f8634e7f701b322981b8194442cdc2ebed1))
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
## [1.0.0-alpha.5](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.4...v1.0.0-alpha.5) (2022-03-11)
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
### :bug: Bug Fix
|
|
301
|
+
|
|
302
|
+
* migrate parameter-editor from things-factory ([019a30d](https://github.com/hatiolab/operato/commit/019a30df6fd4c8a273d4194d13f5784ed6f8d956))
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
### :rocket: New Features
|
|
306
|
+
|
|
307
|
+
* migrate property-editor from things-factory ([272cdaa](https://github.com/hatiolab/operato/commit/272cdaafd74f3c3c597403f88655cb5cf4a81313))
|
|
308
|
+
* migrated property-editors from things-factory ([9d0b73a](https://github.com/hatiolab/operato/commit/9d0b73a8c05187e7ca8db874ddde8c977ec52a55))
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
6
312
|
## [1.0.0-alpha.4](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.3...v1.0.0-alpha.4) (2022-03-11)
|
|
7
313
|
|
|
8
314
|
**Note:** Version bump only for package @operato/property-editor
|
package/demo/index.html
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
body {
|
|
8
8
|
margin: 0;
|
|
9
9
|
padding: 0;
|
|
10
|
-
overflow: hidden;
|
|
11
10
|
|
|
12
11
|
/* This is a font-stack that tries to use the system-default sans-serifs first */
|
|
13
12
|
font-family: Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
|
|
@@ -15,21 +14,198 @@
|
|
|
15
14
|
-webkit-font-smoothing: antialiased;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
|
-
ox-
|
|
17
|
+
ox-properties-dynamic-view {
|
|
19
18
|
width: 100vw;
|
|
20
|
-
height: 100vh;
|
|
21
19
|
}
|
|
22
20
|
</style>
|
|
21
|
+
|
|
22
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/web-animations/2.3.2/web-animations-next-lite.min.js"></script>
|
|
23
|
+
|
|
23
24
|
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet" />
|
|
24
25
|
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
|
|
25
26
|
</head>
|
|
26
27
|
<body>
|
|
27
28
|
<div id="demo"></div>
|
|
29
|
+
|
|
28
30
|
<script type="module">
|
|
29
31
|
import { html, render } from 'lit'
|
|
30
|
-
import '
|
|
32
|
+
import '@operato/i18n/ox-i18n.js'
|
|
33
|
+
|
|
34
|
+
import '../dist/src/ox-property-editor-angle.js'
|
|
35
|
+
import '../dist/src/ox-property-editor-checkbox.js'
|
|
36
|
+
import '../dist/src/ox-property-editor-color.js'
|
|
37
|
+
import '../dist/src/ox-property-editor-date.js'
|
|
38
|
+
import '../dist/src/ox-property-editor-legend.js'
|
|
39
|
+
import '../dist/src/ox-property-editor-number.js'
|
|
40
|
+
import '../dist/src/ox-property-editor-password.js'
|
|
41
|
+
import '../dist/src/ox-property-editor-range.js'
|
|
42
|
+
import '../dist/src/ox-property-editor-select.js'
|
|
43
|
+
import '../dist/src/ox-property-editor-string.js'
|
|
44
|
+
import '../dist/src/ox-property-editor-image.js'
|
|
45
|
+
import '../dist/src/ox-property-editor-file.js'
|
|
46
|
+
import '../dist/src/ox-property-editor-multiple-colors.js'
|
|
47
|
+
import '../dist/src/ox-property-editor-crontab.js'
|
|
48
|
+
// import '../dist/src/ox-property-editor-textarea.js'
|
|
49
|
+
// import '../dist/src/ox-property-editor-options.js'
|
|
50
|
+
|
|
51
|
+
import '../dist/src/ox-properties-dynamic-view.js'
|
|
52
|
+
|
|
53
|
+
import { OxPropertyEditor } from '@operato/property-editor'
|
|
54
|
+
|
|
55
|
+
OxPropertyEditor.register({
|
|
56
|
+
legend: 'ox-property-editor-legend',
|
|
57
|
+
number: 'ox-property-editor-number',
|
|
58
|
+
slider: 'ox-property-editor-range',
|
|
59
|
+
password: 'ox-property-editor-password',
|
|
60
|
+
angle: 'ox-property-editor-angle',
|
|
61
|
+
string: 'ox-property-editor-string',
|
|
62
|
+
textarea: 'ox-property-editor-textarea',
|
|
63
|
+
javascript: 'ox-property-editor-textarea',
|
|
64
|
+
checkbox: 'ox-property-editor-checkbox',
|
|
65
|
+
boolean: 'ox-property-editor-checkbox',
|
|
66
|
+
select: 'ox-property-editor-select',
|
|
67
|
+
date: 'ox-property-editor-date',
|
|
68
|
+
options: 'ox-property-editor-options',
|
|
69
|
+
data: 'ox-property-editor-data',
|
|
70
|
+
file: 'ox-property-editor-file',
|
|
71
|
+
image: 'ox-property-editor-image',
|
|
72
|
+
'range-input': 'ox-property-editor-range',
|
|
73
|
+
'attachment-selector': 'ox-property-editor-attachment-selector',
|
|
74
|
+
'gltf-selector': 'ox-property-editor-attachment-selector',
|
|
75
|
+
'image-selector': 'ox-property-editor-image-selector',
|
|
76
|
+
color: 'ox-property-editor-color',
|
|
77
|
+
'solid-color-stops': 'ox-property-editor-solid-colorstops',
|
|
78
|
+
'gradient-color-stops': 'ox-property-editor-gradient-colorstops',
|
|
79
|
+
'multiple-color': 'ox-property-editor-multiple-colors',
|
|
80
|
+
map: 'ox-property-editor-value-map',
|
|
81
|
+
range: 'ox-property-editor-value-ranges',
|
|
82
|
+
graphql: 'ox-property-editor-graphql',
|
|
83
|
+
'editor-table': 'ox-property-editor-table',
|
|
84
|
+
'id-input': 'ox-property-editor-scene-component-id',
|
|
85
|
+
'font-selector': 'ox-property-editor-font-selector',
|
|
86
|
+
crontab: 'ox-property-editor-crontab'
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
const properties = [
|
|
90
|
+
{
|
|
91
|
+
type: 'string',
|
|
92
|
+
label: 'ABC',
|
|
93
|
+
name: 'ABC'
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
type: 'password',
|
|
97
|
+
label: 'PWD',
|
|
98
|
+
name: 'PWD'
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
type: 'select',
|
|
102
|
+
label: 'SLT',
|
|
103
|
+
name: 'SLT',
|
|
104
|
+
property: {
|
|
105
|
+
options: ['aaa', 'bbb']
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
type: 'number',
|
|
110
|
+
label: 'N#',
|
|
111
|
+
name: 'N#'
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
type: 'checkbox',
|
|
115
|
+
label: 'XV',
|
|
116
|
+
name: 'XV'
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
type: 'angle',
|
|
120
|
+
label: 'Degree',
|
|
121
|
+
name: 'Degree'
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
type: 'date',
|
|
125
|
+
label: 'DD',
|
|
126
|
+
name: 'DD'
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
type: 'legend',
|
|
130
|
+
label: '',
|
|
131
|
+
name: 'NEW-GROUP',
|
|
132
|
+
property: {
|
|
133
|
+
label: 'NEW-GROUP'
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
type: 'slider',
|
|
138
|
+
label: 'S',
|
|
139
|
+
name: 'S',
|
|
140
|
+
property: {
|
|
141
|
+
min: 30,
|
|
142
|
+
max: 300,
|
|
143
|
+
step: 10
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
type: 'textarea',
|
|
148
|
+
label: 'TA',
|
|
149
|
+
name: 'TA'
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
type: 'options',
|
|
153
|
+
label: 'OT',
|
|
154
|
+
name: 'OT'
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
type: 'data',
|
|
158
|
+
label: 'DT',
|
|
159
|
+
name: 'DT'
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
type: 'color',
|
|
163
|
+
label: 'CL',
|
|
164
|
+
name: 'CL'
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
type: 'multiple-color',
|
|
168
|
+
label: 'CLS',
|
|
169
|
+
name: 'CLS'
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
type: 'image',
|
|
173
|
+
label: 'IM',
|
|
174
|
+
name: 'IM'
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
type: 'file',
|
|
178
|
+
label: 'FL',
|
|
179
|
+
name: 'FL',
|
|
180
|
+
property: {
|
|
181
|
+
multiple: true
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
type: 'crontab',
|
|
186
|
+
label: 'schedule',
|
|
187
|
+
name: 'schedule'
|
|
188
|
+
}
|
|
189
|
+
]
|
|
190
|
+
|
|
191
|
+
const value = {
|
|
192
|
+
S: 290,
|
|
193
|
+
SLT: 'bbb',
|
|
194
|
+
IM: 'https://www.hatiolab.com/assets/img/arch-thingsboard.png',
|
|
195
|
+
CLS: ['yello', 'green'],
|
|
196
|
+
schedule: '* * * * * *'
|
|
197
|
+
}
|
|
31
198
|
|
|
32
|
-
render(
|
|
199
|
+
render(
|
|
200
|
+
html`
|
|
201
|
+
<ox-properties-dynamic-view
|
|
202
|
+
.props=${properties}
|
|
203
|
+
.value=${value}
|
|
204
|
+
@property-change=${e => console.log(e.currentTarget.value)}
|
|
205
|
+
></ox-properties-dynamic-view>
|
|
206
|
+
`,
|
|
207
|
+
document.querySelector('#demo')
|
|
208
|
+
)
|
|
33
209
|
</script>
|
|
34
210
|
</body>
|
|
35
211
|
</html>
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './types.js';
|
|
2
|
+
export * from './ox-property-editor.js';
|
package/dist/src/index.js
CHANGED
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,yBAAyB,CAAA","sourcesContent":["export * from './types.js'\nexport * from './ox-property-editor.js'\n"]}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { __decorate } from "tslib";
|
|
5
|
+
import { LitElement, html } from 'lit';
|
|
6
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
7
|
+
import { OxPropertyEditor } from './ox-property-editor.js';
|
|
8
|
+
/**
|
|
9
|
+
모든 에디터들은 change 이벤트를 지원해야 한다. 또한, 모든 에디터들은 value속성에 값을 가져야 한다.
|
|
10
|
+
|
|
11
|
+
Example:
|
|
12
|
+
|
|
13
|
+
<ox-properties-dynamic-view value="{{value}}">
|
|
14
|
+
<label>Center X</label>
|
|
15
|
+
<input type="number" .value="${value.cx}">
|
|
16
|
+
<label>Width</label>
|
|
17
|
+
<input type="number" .value="${value.width}">
|
|
18
|
+
</ox-properties-dynamic-view>
|
|
19
|
+
*/
|
|
20
|
+
const DEFAULT_VALUE = {
|
|
21
|
+
legend: '',
|
|
22
|
+
number: 0,
|
|
23
|
+
angle: 0,
|
|
24
|
+
string: '',
|
|
25
|
+
password: '',
|
|
26
|
+
textarea: '',
|
|
27
|
+
checkbox: false,
|
|
28
|
+
select: '',
|
|
29
|
+
color: '#000000',
|
|
30
|
+
'solidcolor-stops': null,
|
|
31
|
+
'gradientcolor-stops': null,
|
|
32
|
+
'gltf-selector': '',
|
|
33
|
+
'image-selector': '',
|
|
34
|
+
multiplecolor: null,
|
|
35
|
+
editortable: null,
|
|
36
|
+
imageselector: '',
|
|
37
|
+
options: null,
|
|
38
|
+
date: null
|
|
39
|
+
};
|
|
40
|
+
let OxPropertiesDynamicView = class OxPropertiesDynamicView extends LitElement {
|
|
41
|
+
constructor() {
|
|
42
|
+
super(...arguments);
|
|
43
|
+
this.value = {};
|
|
44
|
+
}
|
|
45
|
+
render() {
|
|
46
|
+
return html `<slot></slot>`;
|
|
47
|
+
}
|
|
48
|
+
firstUpdated() {
|
|
49
|
+
this.addEventListener('change', this._onValueChanged.bind(this));
|
|
50
|
+
}
|
|
51
|
+
updated(changes) {
|
|
52
|
+
changes.has('props') && this._onPropsChanged(this.props || []);
|
|
53
|
+
changes.has('value') && this._setValues();
|
|
54
|
+
}
|
|
55
|
+
_onPropsChanged(props) {
|
|
56
|
+
const specs = this.props || [];
|
|
57
|
+
this.textContent = '';
|
|
58
|
+
specs.forEach(spec => {
|
|
59
|
+
let elementType = OxPropertyEditor.getEditor(spec.type);
|
|
60
|
+
if (!elementType) {
|
|
61
|
+
console.warn('Property Editor not defined', spec.type);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
let element = document.createElement(elementType);
|
|
65
|
+
element.label = spec.label;
|
|
66
|
+
element.type = spec.type;
|
|
67
|
+
element.placeholder = spec.placeholder;
|
|
68
|
+
element.setAttribute('name', spec.name);
|
|
69
|
+
if (spec.observe) {
|
|
70
|
+
element.observe = spec.observe;
|
|
71
|
+
}
|
|
72
|
+
element.property = spec.property;
|
|
73
|
+
element.setAttribute('property-editor', 'true');
|
|
74
|
+
this.appendChild(element);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
_setValues() {
|
|
78
|
+
this.value &&
|
|
79
|
+
Array.from(this.querySelectorAll('[name]')).forEach(prop => {
|
|
80
|
+
const editor = prop;
|
|
81
|
+
const name = editor.getAttribute('name');
|
|
82
|
+
var value = this.value[name];
|
|
83
|
+
if (value === undefined) {
|
|
84
|
+
value = DEFAULT_VALUE[editor.type];
|
|
85
|
+
}
|
|
86
|
+
editor.value = value;
|
|
87
|
+
editor.observe && editor.observe.call(prop, editor.value);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
_onValueChanged(e) {
|
|
91
|
+
e.stopPropagation();
|
|
92
|
+
var target = e.target;
|
|
93
|
+
const editor = target.closest('[property-editor]');
|
|
94
|
+
var name = editor.getAttribute('name');
|
|
95
|
+
if (!name) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (this.value) {
|
|
99
|
+
this.value[name] = editor.value;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
this.value = {
|
|
103
|
+
[name]: editor.value
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
this.dispatchEvent(new CustomEvent('property-change', {
|
|
107
|
+
bubbles: true,
|
|
108
|
+
composed: true,
|
|
109
|
+
detail: this.value
|
|
110
|
+
}));
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
__decorate([
|
|
114
|
+
property({ type: Object })
|
|
115
|
+
], OxPropertiesDynamicView.prototype, "value", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
property({ type: Array })
|
|
118
|
+
], OxPropertiesDynamicView.prototype, "props", void 0);
|
|
119
|
+
OxPropertiesDynamicView = __decorate([
|
|
120
|
+
customElement('ox-properties-dynamic-view')
|
|
121
|
+
], OxPropertiesDynamicView);
|
|
122
|
+
//# sourceMappingURL=ox-properties-dynamic-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ox-properties-dynamic-view.js","sourceRoot":"","sources":["../../src/ox-properties-dynamic-view.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { LitElement, PropertyValues, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { OxPropertyEditor } from './ox-property-editor.js'\nimport { PropertySpec } from './types.js'\n\n/**\n모든 에디터들은 change 이벤트를 지원해야 한다. 또한, 모든 에디터들은 value속성에 값을 가져야 한다.\n\nExample:\n\n <ox-properties-dynamic-view value=\"{{value}}\">\n <label>Center X</label>\n <input type=\"number\" .value=\"${value.cx}\">\n <label>Width</label>\n <input type=\"number\" .value=\"${value.width}\">\n </ox-properties-dynamic-view>\n*/\n\nconst DEFAULT_VALUE = {\n legend: '',\n number: 0,\n angle: 0,\n string: '',\n password: '',\n textarea: '',\n checkbox: false,\n select: '',\n color: '#000000',\n 'solidcolor-stops': null,\n 'gradientcolor-stops': null,\n 'gltf-selector': '',\n 'image-selector': '',\n multiplecolor: null,\n editortable: null,\n imageselector: '',\n options: null,\n date: null\n}\n\n@customElement('ox-properties-dynamic-view')\nclass OxPropertiesDynamicView extends LitElement {\n @property({ type: Object }) value: { [name: string]: any } = {}\n @property({ type: Array }) props?: PropertySpec[]\n\n render() {\n return html`<slot></slot>`\n }\n\n firstUpdated() {\n this.addEventListener('change', this._onValueChanged.bind(this))\n }\n\n updated(changes: PropertyValues<this>) {\n changes.has('props') && this._onPropsChanged(this.props || [])\n changes.has('value') && this._setValues()\n }\n\n _onPropsChanged(props: PropertySpec[]) {\n const specs = this.props || []\n\n this.textContent = ''\n specs.forEach(spec => {\n let elementType = OxPropertyEditor.getEditor(spec.type)\n if (!elementType) {\n console.warn('Property Editor not defined', spec.type)\n return\n }\n let element = document.createElement(elementType) as OxPropertyEditor\n\n element.label = spec.label\n element.type = spec.type\n element.placeholder = spec.placeholder\n element.setAttribute('name', spec.name)\n\n if (spec.observe) {\n element.observe = spec.observe\n }\n element.property = spec.property\n element.setAttribute('property-editor', 'true')\n\n this.appendChild(element)\n })\n }\n\n _setValues() {\n this.value &&\n Array.from(this.querySelectorAll('[name]')).forEach(prop => {\n const editor = prop as OxPropertyEditor\n const name = editor.getAttribute('name')\n\n var value = this.value[name!]\n if (value === undefined) {\n value = (DEFAULT_VALUE as any)[editor.type]\n }\n\n editor.value = value\n editor.observe && editor.observe.call(prop, editor.value)\n })\n }\n\n _onValueChanged(e: Event) {\n e.stopPropagation()\n var target = e.target as Element\n\n const editor = target.closest('[property-editor]') as OxPropertyEditor\n\n var name = editor.getAttribute('name')\n if (!name) {\n return\n }\n\n if (this.value) {\n this.value[name] = editor.value\n } else {\n this.value = {\n [name]: editor.value\n }\n }\n\n this.dispatchEvent(\n new CustomEvent('property-change', {\n bubbles: true,\n composed: true,\n detail: this.value\n })\n )\n }\n}\n"]}
|