@things-factory/scene-visualizer 4.0.10 → 4.0.14

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.
@@ -11,6 +11,76 @@ export default class LocationIncreasePatternEditor extends OxPropertyEditor {
11
11
  return [
12
12
  super.styles,
13
13
  css`
14
+ fieldset {
15
+ border: none;
16
+ border-bottom: 1px solid #cfd8dc;
17
+ color: var(--primary-text-color);
18
+ font-size: 12px;
19
+ padding: 0 0 10px 0;
20
+ margin: 0 0 10px 0;
21
+ }
22
+
23
+ fieldset legend {
24
+ padding: 5px 0 0 5px;
25
+ font-size: 11px;
26
+ color: #e46c2e;
27
+ font-weight: bold;
28
+ text-transform: capitalize;
29
+ }
30
+
31
+ .property-grid {
32
+ display: grid;
33
+ grid-template-columns: repeat(10, 1fr);
34
+ grid-gap: 5px;
35
+ grid-auto-rows: minmax(24px, auto);
36
+ margin: 10px 0 0 0;
37
+ }
38
+
39
+ .property-grid > * {
40
+ line-height: 1.5;
41
+ }
42
+
43
+ #border-set > mwc-icon {
44
+ grid-column: span 2;
45
+ margin: 0 0 0 8px;
46
+ width: 32px;
47
+ height: 32px;
48
+ }
49
+
50
+ .property-grid > label {
51
+ grid-column: span 3;
52
+ text-align: right;
53
+ text-transform: capitalize;
54
+ }
55
+
56
+ .property-grid > paper-dropdown-menu,
57
+ .property-grid > input {
58
+ grid-column: span 7;
59
+ padding: 0;
60
+ margin: 0;
61
+ }
62
+
63
+ .property-grid > .checkbox-row {
64
+ grid-column: span 10;
65
+
66
+ display: grid;
67
+ grid-template-columns: repeat(10, 1fr);
68
+ grid-gap: 5px;
69
+ grid-auto-rows: minmax(24px, auto);
70
+ align-items: center;
71
+ }
72
+
73
+ .checkbox-row > input {
74
+ grid-column: span 4 / auto;
75
+ order: 1;
76
+ place-self: center end;
77
+ }
78
+
79
+ .checkbox-row > label {
80
+ grid-column: span 6;
81
+ text-align: left;
82
+ }
83
+
14
84
  #pattern-set {
15
85
  overflow: hidden;
16
86
  grid-column: 1 / -1;
@@ -90,37 +160,47 @@ export default class LocationIncreasePatternEditor extends OxPropertyEditor {
90
160
  editorTemplate() {
91
161
  // TODO: background image change to use the url-loader
92
162
  return html`
93
- <legend><i18n-msg msgid="label.location-increase-pattern">Increase Pattern</i18n-msg></legend>
94
- <label> <i18n-msg msgid="label.start-section">Start Section</i18n-msg> </label>
95
- <input
96
- type="number"
97
- data-start-section
98
- value="${this.startSection}"
99
- @change=${e => (this.startSection = e.target.valueAsNumber)}
100
- />
101
- <label> <i18n-msg msgid="label.start-unit">Start Unit</i18n-msg> </label>
102
- <input
103
- type="number"
104
- data-start-unit
105
- value="${this.startUnit}"
106
- @change=${e => (this.startUnit = e.target.valueAsNumber)}
107
- />
108
- <label for="skip-numbering">
109
- <i18n-msg msgid="label.skip-numbering">Skip Numbering</i18n-msg>
110
- </label>
111
- <input id="skip-numbering" type="checkbox" data-skip-numbering ?checked="${this.skipNumbering}" />
112
- <div id="pattern-set" class="location-increase-pattern-btn" @click=${e => this._onTapType(e)}>
113
- <paper-button data-value="cw"> <iron-icon icon="editor:border-outer"></iron-icon> </paper-button>
114
- <paper-button data-value="ccw">
115
- <iron-icon icon="editor:border-inner"></iron-icon>
116
- </paper-button>
117
- <paper-button data-value="zigzag">
118
- <iron-icon icon="editor:border-inner"></iron-icon>
119
- </paper-button>
120
- <paper-button data-value="zigzag-reverse">
121
- <iron-icon icon="editor:border-inner"></iron-icon>
122
- </paper-button>
123
- </div>
163
+ <fieldset fullwidth>
164
+ <legend><i18n-msg msgid="label.location-increase-pattern">Increase Pattern</i18n-msg></legend>
165
+
166
+ <div class="property-grid">
167
+ <label> <i18n-msg msgid="label.start-section">Start Section</i18n-msg> </label>
168
+ <input
169
+ type="number"
170
+ data-start-section
171
+ value="${this.startSection}"
172
+ @change=${e => (this.startSection = e.target.valueAsNumber)}
173
+ />
174
+
175
+ <label> <i18n-msg msgid="label.start-unit">Start Unit</i18n-msg> </label>
176
+ <input
177
+ type="number"
178
+ data-start-unit
179
+ value="${this.startUnit}"
180
+ @change=${e => (this.startUnit = e.target.valueAsNumber)}
181
+ />
182
+
183
+ <div class="checkbox-row" fullwidth>
184
+ <input id="skip-numbering" type="checkbox" data-skip-numbering ?checked="${this.skipNumbering}" />
185
+ <label for="skip-numbering">
186
+ <i18n-msg msgid="label.skip-numbering">Skip Numbering</i18n-msg>
187
+ </label>
188
+ </div>
189
+
190
+ <div id="pattern-set" class="property-grid location-increase-pattern-btn" @click=${e => this._onTapType(e)}>
191
+ <paper-button data-value="cw"> <iron-icon icon="editor:border-outer"></iron-icon> </paper-button>
192
+ <paper-button data-value="ccw">
193
+ <iron-icon icon="editor:border-inner"></iron-icon>
194
+ </paper-button>
195
+ <paper-button data-value="zigzag">
196
+ <iron-icon icon="editor:border-inner"></iron-icon>
197
+ </paper-button>
198
+ <paper-button data-value="zigzag-reverse">
199
+ <iron-icon icon="editor:border-inner"></iron-icon>
200
+ </paper-button>
201
+ </div>
202
+ </div>
203
+ </fieldset>
124
204
  `
125
205
  }
126
206
 
@@ -142,10 +222,6 @@ export default class LocationIncreasePatternEditor extends OxPropertyEditor {
142
222
  this._specificPropEl = null
143
223
  }
144
224
 
145
- firstUpdated(changedProperties) {
146
- this.shadowRoot.addEventListener('rack-table-cell-increment-set', this._handleRackTableCellIncrementSet, false)
147
- }
148
-
149
225
  connectedCallback() {
150
226
  super.connectedCallback()
151
227
  if (this.property && this.property.event) {
@@ -172,46 +248,26 @@ export default class LocationIncreasePatternEditor extends OxPropertyEditor {
172
248
  _onTapType(e) {
173
249
  var target = e.target
174
250
 
175
- while (!target.hasAttribute('data-value') && target !== this) target = target.parentElement
176
-
177
- if (target === this) return
251
+ const increasingDirection = target?.closest('[data-value]')?.getAttribute('data-value')
252
+ if (!increasingDirection) {
253
+ return
254
+ }
178
255
 
179
- document.dispatchEvent(
180
- new CustomEvent('increase-location-pattern', {
256
+ this.dispatchEvent(
257
+ new CustomEvent('i-need-selected', {
181
258
  bubbles: true,
182
259
  composed: true,
183
260
  detail: {
184
- increasingDirection: target.getAttribute('data-value'),
185
- startSection: this.startSection,
186
- startUnit: this.startUnit,
187
- skipNumbering: this.skipNumbering
261
+ callback: selected => {
262
+ const table = selected[0].parent
263
+ table.increaseLocation(increasingDirection, this.skipNumbering, this.startSection, this.startUnit)
264
+ }
188
265
  }
189
266
  })
190
267
  )
191
268
 
192
269
  e.stopPropagation()
193
270
  }
194
-
195
- _handleRackTableCellIncrementSet(e) {
196
- let detail = e.detail
197
-
198
- var selected = this.selected[0].parent
199
-
200
- var { increasingDirection, skipNumbering, startSection, startUnit } = detail
201
-
202
- this.scene.undoableChange(function () {
203
- selected.increaseLocation(increasingDirection, skipNumbering, startSection, startUnit)
204
- })
205
- }
206
-
207
- _getSpecificPropEl() {
208
- // TODO: Shady인 경우에 대하여 처리하여야 함.
209
- return this.getRootNode().host.getRootNode().host
210
- }
211
-
212
- isTypeOf(is, type) {
213
- return is == type
214
- }
215
271
  }
216
272
 
217
273
  customElements.define(LocationIncreasePatternEditor.is, LocationIncreasePatternEditor)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@things-factory/scene-visualizer",
3
3
  "description": "The visualizer component for things-scene.",
4
- "version": "4.0.10",
4
+ "version": "4.0.14",
5
5
  "things-scene": true,
6
6
  "browser": "src/index.js",
7
7
  "author": "heartyoh",
@@ -16,9 +16,9 @@
16
16
  "directory": "packages/scene-visualizer"
17
17
  },
18
18
  "dependencies": {
19
- "@hatiolab/things-scene": "^2.7.20",
19
+ "@hatiolab/things-scene": "^2.7.27",
20
20
  "lit": "^2.0.2",
21
21
  "three": "^0.122.0"
22
22
  },
23
- "gitHead": "1815d5f855c0e4613bd286e1ca9e7d8fd632605a"
23
+ "gitHead": "956c782b5b2a6ff4c4e18f4a1bdcf778814f1b52"
24
24
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "label.bin-locations": "bin locations",
2
3
  "label.camera-x": "camera X",
3
4
  "label.camera-y": "camera Y",
4
5
  "label.camera-z": "camera Z",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "label.bin-locations": "bin locations",
2
3
  "label.camera-x": "카메라 X",
3
4
  "label.camera-y": "카메라 Y",
4
5
  "label.camera-z": "카메라 Z",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "label.bin-locations": "[ms] bin locations",
2
3
  "label.camera-x": "[ms] camera X",
3
4
  "label.camera-y": "[ms] camera Y",
4
5
  "label.camera-z": "[ms] camera Z",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "label.bin-locations": "[zh] bin locations",
2
3
  "label.camera-x": "相机X",
3
4
  "label.camera-y": "相机Y",
4
5
  "label.camera-z": "相机Z",