@operato/scene-sted 7.0.1 → 7.3.19

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": "@operato/scene-sted",
3
3
  "description": "scene module for smart thermal energy design platform",
4
- "version": "7.0.1",
4
+ "version": "7.3.19",
5
5
  "license": "MIT",
6
6
  "things-scene": true,
7
7
  "author": "heartyoh",
@@ -27,7 +27,7 @@
27
27
  "migration": "things-factory-migration"
28
28
  },
29
29
  "dependencies": {
30
- "@hatiolab/things-scene": "^3.2.0",
30
+ "@hatiolab/things-scene": "^3.4.0",
31
31
  "@operato/input": "^7.0.0",
32
32
  "@operato/property-editor": "^7.0.0"
33
33
  },
@@ -59,5 +59,5 @@
59
59
  "prettier --write"
60
60
  ]
61
61
  },
62
- "gitHead": "575a4ccdeb952a605c9a6f65a389906e73a71013"
62
+ "gitHead": "ff73072a62ee02520f9d986d0095f6d329de64f9"
63
63
  }
package/CHANGELOG.md DELETED
@@ -1,314 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [7.0.1](https://github.com/things-scene/operato-scene/compare/v7.0.0...v7.0.1) (2024-06-30)
7
-
8
-
9
- ### :bug: Bug Fix
10
-
11
- * things-factory@7.0.0 ([f4cfe44](https://github.com/things-scene/operato-scene/commit/f4cfe44cb565e7b8fdc0df210a722b6526871848))
12
-
13
-
14
-
15
- ## [7.0.0](https://github.com/things-scene/operato-scene/compare/v7.0.0-rc.4...v7.0.0) (2024-06-30)
16
-
17
- **Note:** Version bump only for package @operato/scene-sted
18
-
19
-
20
-
21
-
22
-
23
- ## [7.0.0-rc.4](https://github.com/things-scene/operato-scene/compare/v7.0.0-rc.3...v7.0.0-rc.4) (2024-06-30)
24
-
25
-
26
- ### :bug: Bug Fix
27
-
28
- * operato@7.0.0 ([9740f89](https://github.com/things-scene/operato-scene/commit/9740f8949654b9dd9388558059e89cbed3d8235a))
29
-
30
-
31
-
32
- ## [7.0.0-rc.1](https://github.com/things-scene/operato-scene/compare/v7.0.0-rc.0...v7.0.0-rc.1) (2024-06-21)
33
-
34
-
35
- ### :bug: Bug Fix
36
-
37
- * apply v7-rc dependencies ([eee5612](https://github.com/things-scene/operato-scene/commit/eee5612e1d569387c284a7c6c49d64ef44b6d701))
38
-
39
-
40
-
41
- ## [7.0.0-rc.0](https://github.com/things-scene/operato-scene/compare/v2.0.0-beta.8...v7.0.0-rc.0) (2024-06-21)
42
-
43
-
44
- ### :bug: Bug Fix
45
-
46
- * apply operato@7.0.0-rc ([7d5fa6e](https://github.com/things-scene/operato-scene/commit/7d5fa6e9bef5f6d2231e4d1eface82578fe794f3))
47
-
48
-
49
-
50
- ## [2.0.0-beta.0](https://github.com/things-scene/operato-scene/compare/v2.0.0-alpha.12...v2.0.0-beta.0) (2024-06-01)
51
-
52
-
53
- ### :rocket: New Features
54
-
55
- * 2.0.0-beta.0 ([a2e2869](https://github.com/things-scene/operato-scene/commit/a2e28694eedf5bab0c54bcab5432d54ec59edd7f))
56
-
57
-
58
- ### :bug: Bug Fix
59
-
60
- * allowJs in tsconfig option ([fa77174](https://github.com/things-scene/operato-scene/commit/fa771742188f21f177f0a85281570f59f0c478cf))
61
-
62
-
63
-
64
- ## [2.0.0-alpha.12](https://github.com/things-scene/operato-scene/compare/v2.0.0-alpha.11...v2.0.0-alpha.12) (2024-05-11)
65
-
66
-
67
- ### :bug: Bug Fix
68
-
69
- * ignore 'cache' folder for git and npm ([d70f811](https://github.com/things-scene/operato-scene/commit/d70f8118ff3e9248f80aa9435d6e6cbb8aacfcaf))
70
-
71
-
72
-
73
- ## [2.0.0-alpha.9](https://github.com/things-scene/operato-scene/compare/v2.0.0-alpha.8...v2.0.0-alpha.9) (2024-04-11)
74
-
75
-
76
- ### :bug: Bug Fix
77
-
78
- * things-factory@7.0.1 ([a9f4c18](https://github.com/things-scene/operato-scene/commit/a9f4c1873b80c540e4c2e16649e127ccffcf9a4c))
79
-
80
-
81
-
82
- ## [2.0.0-alpha.6](https://github.com/things-scene/operato-scene/compare/v2.0.0-alpha.5...v2.0.0-alpha.6) (2024-03-24)
83
-
84
-
85
- ### :bug: Bug Fix
86
-
87
- * translation ([266d423](https://github.com/things-scene/operato-scene/commit/266d423d9d6992464f45a437acc90ccf8ed33bf6))
88
-
89
-
90
-
91
- ## [2.0.0-alpha.4](https://github.com/things-scene/operato-scene/compare/v2.0.0-alpha.3...v2.0.0-alpha.4) (2024-03-21)
92
-
93
-
94
- ### :bug: Bug Fix
95
-
96
- * 컴포넌트 명 다국어 ([64e1f08](https://github.com/things-scene/operato-scene/commit/64e1f08af32d2ac193c3d31b0025f8d06f569ca4))
97
-
98
-
99
-
100
- ## [2.0.0-alpha.0](https://github.com/things-scene/operato-scene/compare/v1.3.9...v2.0.0-alpha.0) (2024-01-14)
101
-
102
-
103
- ### :bug: Bug Fix
104
-
105
- * 2.0.0-alpha.0 ([93274e3](https://github.com/things-scene/operato-scene/commit/93274e36c5d184f339f83899654dd48b4786ac2b))
106
-
107
-
108
-
109
- ## [1.3.7](https://github.com/things-scene/operato-scene/compare/v1.3.6...v1.3.7) (2024-01-01)
110
-
111
-
112
- ### :bug: Bug Fix
113
-
114
- * mpi module moved from things-factory ([47b743f](https://github.com/things-scene/operato-scene/commit/47b743fd19001f195db85e50b8f6e457a1573aa5))
115
-
116
-
117
-
118
- ## [1.2.90](https://github.com/things-scene/operato-scene/compare/v1.2.89...v1.2.90) (2023-11-22)
119
-
120
- **Note:** Version bump only for package @operato/scene-sted
121
-
122
-
123
-
124
-
125
-
126
- ## [1.2.87](https://github.com/things-scene/operato-scene/compare/v1.2.86...v1.2.87) (2023-11-10)
127
-
128
- **Note:** Version bump only for package @operato/scene-sted
129
-
130
-
131
-
132
-
133
-
134
- ## [1.2.76](https://github.com/things-scene/operato-scene/compare/v1.2.75...v1.2.76) (2023-10-28)
135
-
136
-
137
- ### :bug: Bug Fix
138
-
139
- * scene-tab ([ad62f96](https://github.com/things-scene/operato-scene/commit/ad62f967b149eb5adf8f2e0714d79e8a9dc7186c))
140
-
141
-
142
-
143
- ## [1.2.73](https://github.com/things-scene/operato-scene/compare/v1.2.72...v1.2.73) (2023-10-22)
144
-
145
-
146
- ### :bug: Bug Fix
147
-
148
- * add help for image-slider ([043d284](https://github.com/things-scene/operato-scene/commit/043d284d6878818079d27b685905b76a486d3fff))
149
-
150
-
151
-
152
- ## [1.2.71](https://github.com/things-scene/operato-scene/compare/v1.2.70...v1.2.71) (2023-10-11)
153
-
154
-
155
- ### :bug: Bug Fix
156
-
157
- * add bluetooth module ([4bba13c](https://github.com/things-scene/operato-scene/commit/4bba13c7ac29508d37f5751ea5abdded60fa314d))
158
-
159
-
160
-
161
- ## [1.2.66](https://github.com/things-scene/operato-scene/compare/v1.2.65...v1.2.66) (2023-09-14)
162
-
163
- **Note:** Version bump only for package @operato/scene-sted
164
-
165
-
166
-
167
-
168
-
169
- ## [1.2.65](https://github.com/things-scene/operato-scene/compare/v1.2.64...v1.2.65) (2023-09-14)
170
-
171
- **Note:** Version bump only for package @operato/scene-sted
172
-
173
-
174
-
175
-
176
-
177
- ## [1.2.62](https://github.com/things-scene/operato-scene/compare/v1.2.61...v1.2.62) (2023-09-11)
178
-
179
- **Note:** Version bump only for package @operato/scene-sted
180
-
181
-
182
-
183
-
184
-
185
- ## [1.2.60](https://github.com/things-scene/operato-scene/compare/v1.2.59...v1.2.60) (2023-09-08)
186
-
187
-
188
- ### :bug: Bug Fix
189
-
190
- * add scene-auth module ([633fedd](https://github.com/things-scene/operato-scene/commit/633feddf91125bc45d1a4dae756588d6601ef859))
191
-
192
-
193
-
194
- ## [1.2.46](https://github.com/things-scene/operato-scene/compare/v1.2.45...v1.2.46) (2023-06-10)
195
-
196
-
197
- ### :bug: Bug Fix
198
-
199
- * typescript build options ([3eb0d7f](https://github.com/things-scene/operato-scene/commit/3eb0d7fd80e2c3cea698501aa1d9d54903423a7b))
200
-
201
-
202
-
203
- ## [1.2.36](https://github.com/things-scene/operato-scene/compare/v1.2.35...v1.2.36) (2023-05-13)
204
-
205
-
206
- ### :bug: Bug Fix
207
-
208
- * license ([d37d485](https://github.com/things-scene/operato-scene/commit/d37d48597407dea1ad022e674f2899720e56d695))
209
-
210
-
211
-
212
- ## [1.2.29](https://github.com/things-scene/operato-scene/compare/v1.2.28...v1.2.29) (2023-04-30)
213
-
214
-
215
- ### :bug: Bug Fix
216
-
217
- * update module's version ([047d08b](https://github.com/things-scene/operato-scene/commit/047d08b5d912d12c04b2f6b63156d1e812588365))
218
-
219
-
220
-
221
- ### [1.2.27](https://github.com/things-scene/operato-scene/compare/v1.2.26...v1.2.27) (2023-04-22)
222
-
223
- **Note:** Version bump only for package @operato/scene-sted
224
-
225
-
226
-
227
-
228
-
229
- ### [1.2.4](https://github.com/things-scene/operato-scene/compare/v1.2.3...v1.2.4) (2023-02-13)
230
-
231
- **Note:** Version bump only for package @operato/scene-sted
232
-
233
-
234
-
235
-
236
-
237
- ### [1.2.2](https://github.com/things-scene/operato-scene/compare/v1.2.1...v1.2.2) (2023-02-09)
238
-
239
-
240
- ### :bug: Bug Fix
241
-
242
- * migrate scene-urdf from things-factory ([3f75f87](https://github.com/things-scene/operato-scene/commit/3f75f8743e993a9a3ed595eed8f94b15da042a31))
243
-
244
-
245
-
246
- ## [1.2.0](https://github.com/things-scene/operato-scene/compare/v1.1.29...v1.2.0) (2023-02-07)
247
-
248
-
249
- ### :bug: Bug Fix
250
-
251
- * updating dependencies ([f4dd8fc](https://github.com/things-scene/operato-scene/commit/f4dd8fcdaa03b67de78189c6d574b30a995456f0))
252
-
253
-
254
-
255
- ### [1.1.23](https://github.com/things-scene/operato-scene/compare/v1.1.22...v1.1.23) (2022-12-18)
256
-
257
-
258
- ### :bug: Bug Fix
259
-
260
- * latest @hatiolab/things-scene ([8d6afb5](https://github.com/things-scene/operato-scene/commit/8d6afb5ecbd453260615fca229f1d74b0ea6e4ee))
261
-
262
-
263
-
264
- ### [1.1.22](https://github.com/things-scene/operato-scene/compare/v1.1.21...v1.1.22) (2022-12-16)
265
-
266
-
267
- ### :bug: Bug Fix
268
-
269
- * input-unit-number ([8c4a8a6](https://github.com/things-scene/operato-scene/commit/8c4a8a6d391261c5c614482d6e5ce85791088bc9))
270
-
271
-
272
-
273
- ### [1.1.21](https://github.com/things-scene/operato-scene/compare/v1.1.20...v1.1.21) (2022-12-16)
274
-
275
-
276
- ### :bug: Bug Fix
277
-
278
- * input-unit-number ([a6d91f2](https://github.com/things-scene/operato-scene/commit/a6d91f2f674b9a7dba4e216419a47be1b3f8550d))
279
-
280
-
281
-
282
- ### [1.1.19](https://github.com/things-scene/operato-scene/compare/v1.1.18...v1.1.19) (2022-12-07)
283
-
284
-
285
- ### :bug: Bug Fix
286
-
287
- * add handling scene-sted change event ([22881c0](https://github.com/things-scene/operato-scene/commit/22881c09ac95bca125915347153b8e3b142fa835))
288
-
289
-
290
-
291
- ### [1.1.18](https://github.com/things-scene/operato-scene/compare/v1.1.17...v1.1.18) (2022-12-06)
292
-
293
-
294
- ### :bug: Bug Fix
295
-
296
- * add input-unit-number for sted ([ec49e25](https://github.com/things-scene/operato-scene/commit/ec49e25edc7cf063052f0d3aac16abd63cdae783))
297
-
298
-
299
-
300
- ### [1.1.17](https://github.com/things-scene/operato-scene/compare/v1.1.16...v1.1.17) (2022-12-05)
301
-
302
-
303
- ### :bug: Bug Fix
304
-
305
- * sted dependencies ([49b4e57](https://github.com/things-scene/operato-scene/commit/49b4e57f5870d109efcee106d6cf506ca2bd1409))
306
-
307
-
308
-
309
- ### [1.1.16](https://github.com/things-scene/operato-scene/compare/v1.1.15...v1.1.16) (2022-12-04)
310
-
311
-
312
- ### :bug: Bug Fix
313
-
314
- * add sted module ([bbcf4c5](https://github.com/things-scene/operato-scene/commit/bbcf4c51bf0ccf5f4fc2c051b6e5e85d71b2d7b8))
File without changes
@@ -1,3 +0,0 @@
1
- import { sted } from './sted'
2
-
3
- export default [sted]
@@ -1,48 +0,0 @@
1
- const icon = `
2
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
3
- viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve">
4
- <style type="text/css">
5
- .st0{fill:{{strokeColor}};}
6
- </style>
7
- <g>
8
- <g>
9
- <path class="st0" d="M33.2,15.2v4.6h-4.6v-4.6H33.2 M34,14.4h-6.1v6.1H34V14.4L34,14.4z"/>
10
- </g>
11
- <g>
12
- <g>
13
- <path class="st0" d="M17.5,15.3l2.2,2.2l-2.2,2.2l-2.2-2.2L17.5,15.3 M17.5,14.2l-3.3,3.3l3.3,3.3l3.3-3.3L17.5,14.2L17.5,14.2z"
14
- />
15
- </g>
16
- <g>
17
- <path class="st0" d="M19.8,7.2v4.6h-4.6V7.2H19.8 M20.6,6.5h-6.1v6.1h6.1V6.5L20.6,6.5z"/>
18
- </g>
19
- <g>
20
- <path class="st0" d="M19.8,23.1v4.6h-4.6v-4.6H19.8 M20.6,22.4h-6.1v6.1h6.1V22.4L20.6,22.4z"/>
21
- </g>
22
- </g>
23
- <g>
24
- <g>
25
- <polygon class="st0" points="13.3,17.4 10.6,19.6 10.6,15.2 13.3,17.4 "/>
26
- </g>
27
- <rect x="8.2" y="16.9" class="st0" width="3.4" height="0.9"/>
28
- </g>
29
- <g>
30
- <g>
31
- <polygon class="st0" points="26.8,17.4 24,19.6 24,15.2 26.8,17.4 "/>
32
- </g>
33
- <rect x="21.7" y="16.9" class="st0" width="3.4" height="0.9"/>
34
- </g>
35
- <g>
36
- <path class="st0" d="M4.1,15.2c1.3,0,2.3,1,2.3,2.3s-1,2.3-2.3,2.3s-2.3-1-2.3-2.3S2.8,15.2,4.1,15.2 M4.1,14.4
37
- c-1.7,0-3.1,1.4-3.1,3.1c0,1.7,1.4,3.1,3.1,3.1s3.1-1.4,3.1-3.1C7.1,15.8,5.8,14.4,4.1,14.4L4.1,14.4z"/>
38
- </g>
39
- </g>
40
- </svg>
41
- `
42
-
43
- export const sted = {
44
- name: 'sted',
45
- description: 'a group of Smart Thermal Energy Platform',
46
- icon,
47
- templates: []
48
- }
package/src/index.ts DELETED
@@ -1,2 +0,0 @@
1
- export { default as MassFraction } from './mass-fraction'
2
- export { default as InputUnitNumber } from './input-unit-number'
@@ -1,246 +0,0 @@
1
- /*
2
- * Copyright © HatioLab Inc. All rights reserved.
3
- */
4
- const UNIT_SYSTEMS: { [unit: string]: { [unit: string]: number | ((v: number) => number)[] } } = {
5
- kg: {
6
- mg: 1000000,
7
- g: 1000,
8
- ton: 0.001
9
- },
10
- rad: {
11
- degree: 180 / Math.PI
12
- },
13
- sec: {
14
- msec: 1000,
15
- min: 1 / 60,
16
- hr: 1 / 3600,
17
- day: 1 / (3600 * 24),
18
- year: 1 / (3600 * 24 * 365)
19
- },
20
- m: {
21
- mm: 1000,
22
- cm: 100,
23
- inch: 39.37008
24
- },
25
- 'g/mol': {
26
- 'kg/kmol': 1,
27
- 'g/kmol': 1000
28
- },
29
- m2: {
30
- mm2: 1000000,
31
- cm2: 1000
32
- },
33
- m3: {
34
- cm3: 1000000,
35
- L: 1000,
36
- mL: 1000000
37
- },
38
- 'kg/m3': {
39
- 'g/m3': 1000,
40
- 'g/L': 1,
41
- 'g/cm3': 0.001,
42
- 'kg/L': 0.001,
43
- 'g/mL': 0.001
44
- },
45
- 'm/sec': {
46
- 'm/min': 60,
47
- 'm/hr': 3600,
48
- 'cm/sec': 100,
49
- 'cm/min': 6000,
50
- 'cm/hr': 360000
51
- },
52
- N: {
53
- kN: 0.001,
54
- kgf: 0.101971621
55
- },
56
- Pa: {
57
- atm: 1 / 101325,
58
- bar: 1 / 100000,
59
- 'kgf/cm2': 1 / 9.80665 / 10000,
60
- MPa: 1 / 1000000,
61
- kPa: 1 / 1000,
62
- psi: 1 / 6894.76,
63
- mmH2O: 1 / 9.80665,
64
- mmHg: 1 / 133.32
65
- },
66
- 'kg/sec': {
67
- 'kg/min': 60,
68
- 'kg/hr': 3600,
69
- 'ton/hr': 3.6,
70
- 'ton/year': (60 * 60 * 24 * 365) / 1000
71
- },
72
- 'kg/m2/sec': {
73
- 'kg/m2/min': 60,
74
- 'kg/m2/hr': 3600
75
- },
76
- 'mol/sec': {
77
- 'kmol/sec': 1 / 1000
78
- },
79
- 'mol/m2/sec': {
80
- 'kmol/m2/sec': 1 / 1000
81
- },
82
- 'Sm3/sec': {
83
- 'Sm3/hr': 3600,
84
- 'Sm3/min': 60,
85
- 'SL/min': 60000,
86
- 'SL/sec': 1000,
87
- 'Scm3/min': 60000000,
88
- 'Scm3/sec': 1000000
89
- },
90
- 'Nm3/sec': {
91
- 'Am3/hr': 3600,
92
- 'Am3/min': 60,
93
- 'AL/min': 60000,
94
- 'AL/sec': 1000,
95
- 'Acm3/min': 60000000,
96
- 'Acm3/sec': 1000000
97
- },
98
- J: {
99
- kJ: 1 / 1000,
100
- MJ: 1 / 1000000,
101
- cal: 1 / 4.184,
102
- kcal: 1 / 4.184 / 1000
103
- },
104
- W: {
105
- kW: 1 / 1000,
106
- MW: 1 / 1000000,
107
- 'kcal/hr': 859.85 / 1000,
108
- hp: 1 / 745.7
109
- },
110
- 'W/m2': {
111
- 'kW/m2': 1 / 1000,
112
- 'W/cm2': 1 / 10000,
113
- 'kW/cm2': 1 / 10000000
114
- },
115
- 'J/kg': {
116
- 'kJ/kg': 1 / 1000,
117
- 'cal/g': 1 / 4.184 / 1000,
118
- 'cal/kg': 1 / 4.184,
119
- 'kcal/kg': 1 / 4.184 / 1000
120
- },
121
- 'J/kg/K': {
122
- 'kJ/kg/K': 1 / 1000,
123
- 'cal/kg/K': 1 / 4.184,
124
- 'kcal/kg/K': 1 / 4.184 / 1000,
125
- 'cal/g/K': 1 / 4.184 / 1000
126
- },
127
- 'W/m/K': {
128
- 'kW/m/K': 1 / 1000,
129
- 'W/cm/K': 1 / 100,
130
- 'kW/cm/K': 1 / 100 / 1000
131
- },
132
- 'W/m2/K': {
133
- 'kW/m2/K': 1 / 1000,
134
- 'kcal/hr/m2/oC': 1 / 1.163
135
- },
136
- 'N sec/m2': {
137
- 'Pa sec': 1,
138
- 'mPa sec': 1000,
139
- 'kg/m/sec': 1,
140
- 'g/cm/sec': 10,
141
- P: 10,
142
- cP: 1000
143
- },
144
- 'm2 oC/W': {
145
- 'm2 oC/kW': 1000
146
- },
147
- '%': {},
148
- ppm: {},
149
- K: {
150
- '°C': [(v: number) => v - 273.15, (v: number) => v + 273.15]
151
- }
152
- }
153
-
154
- const NATURE: ComponentNature = {
155
- mutable: false,
156
- resizable: true,
157
- rotatable: true,
158
- properties: [
159
- {
160
- type: 'string',
161
- label: 'placeholder',
162
- name: 'placeholder'
163
- },
164
- {
165
- type: 'number',
166
- label: 'value',
167
- name: 'value'
168
- },
169
- {
170
- type: 'select',
171
- label: 'unit',
172
- name: 'unit',
173
- property: {
174
- options: ['', ...Object.keys(UNIT_SYSTEMS)]
175
- }
176
- },
177
- {
178
- type: 'select',
179
- label: 'user-unit',
180
- name: 'userUnit',
181
- property: {
182
- options: function () {
183
- const parent: any = (this as any).parentElement
184
- const unit = parent.value['unit']
185
-
186
- return unit ? ['', unit, ...((UNIT_SYSTEMS[unit] && Object.keys(UNIT_SYSTEMS[unit])) || [])] : ['']
187
- }
188
- }
189
- },
190
- {
191
- type: 'checkbox',
192
- label: 'copy-value-to-data',
193
- name: 'copyValueToData'
194
- }
195
- ],
196
- 'value-property': 'value',
197
- help: 'scene/component/graphql'
198
- }
199
-
200
- import '@operato/input/ox-input-unit-number.js'
201
-
202
- import { Component, ComponentNature, HTMLOverlayElement, Properties, error } from '@hatiolab/things-scene'
203
-
204
- export default class InputUnitNumber extends HTMLOverlayElement {
205
- static get nature() {
206
- return NATURE
207
- }
208
-
209
- get tagName() {
210
- return 'ox-input-unit-number'
211
- }
212
-
213
- oncreate_element(inputUnitNumber: HTMLElement) {
214
- inputUnitNumber.onchange = e => {
215
- this.value = (e.target as any).value
216
- }
217
-
218
- inputUnitNumber.style.setProperty('--input-padding', '2px')
219
-
220
- this.reposition()
221
- }
222
-
223
- setElementProperties(input: HTMLElement) {
224
- var { placeholder, unit = 'kg', userUnit, value } = this.state
225
-
226
- input.style.setProperty('--input-padding', '0')
227
- ;(input as any).stdUnit = unit
228
- ;(input as any).userUnit = userUnit && UNIT_SYSTEMS[unit][userUnit] ? userUnit : unit
229
- ;(input as any).placeholder = placeholder || ''
230
- ;(input as any).value = value
231
- }
232
-
233
- onchange(after: Properties, before: Properties) {
234
- super.onchange(after, before)
235
-
236
- if ('value' in after) {
237
- const { copyValueToData } = this.state
238
-
239
- if (copyValueToData) {
240
- this.data = after.value
241
- }
242
- }
243
- }
244
- }
245
-
246
- Component.register('input-unit-number', InputUnitNumber)