@operato/scene-visualizer 8.0.0-beta.0 → 8.0.0-beta.2
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 +5 -5
- package/CHANGELOG.md +0 -640
- package/attachments/0d91a37d-c2d7-4c6d-88dc-a29e5bbea361.png +0 -0
- package/attachments/1b07c8d3-07d5-4007-b02e-031ee1755539.glb +0 -0
- package/attachments/226c6c23-c4fd-46c8-93e3-3d3d9c4bb8a9.glb +0 -0
- package/attachments/4425ca46-cf1d-476d-9185-dcb881ecad1f.glb +0 -0
- package/attachments/51e7c45d-6eae-4baf-a4e2-ba979b7e77cd.glb +0 -0
- package/attachments/54427925-c109-4499-875c-fb14207b95c5.glb +0 -0
- package/attachments/8cc70a65-e20f-4187-83c8-64deb3faf3d9.glb +0 -0
- package/attachments/964d004d-1fe7-4224-89a6-2b6e86db233c.glb +0 -0
- package/attachments/ff47fd63-6f1c-4a69-b965-9bb03797a415.png +0 -0
- package/db.sqlite +0 -0
- package/demo/index-modeller.html +0 -112
- package/demo/index.html +0 -109
- package/logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json +0 -25
- package/logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json +0 -25
- package/logs/application-2025-01-07-10.log +0 -106
- package/logs/application-2025-01-07-14.log +0 -4
- package/logs/application-2025-01-07-15.log +0 -4
- package/logs/connections-2025-01-07-10.log +0 -106
- package/logs/connections-2025-01-07-14.log +0 -53
- package/logs/connections-2025-01-07-15.log +0 -53
- package/schema.graphql +0 -4552
- package/src/banner.ts +0 -88
- package/src/camera.ts +0 -132
- package/src/component.d.ts +0 -10
- package/src/cube.ts +0 -39
- package/src/cylinder.ts +0 -39
- package/src/desk.ts +0 -135
- package/src/editors/index.ts +0 -13
- package/src/editors/property-editor-gltf-info.ts +0 -135
- package/src/editors/property-editor-location-increase-pattern.ts +0 -260
- package/src/effects/outline.ts +0 -54
- package/src/ellipse.ts +0 -37
- package/src/gltf-object.ts +0 -117
- package/src/html-overlay-element.ts +0 -13
- package/src/index.ts +0 -29
- package/src/light.ts +0 -155
- package/src/polygon.ts +0 -88
- package/src/rack-table-cell.ts +0 -386
- package/src/rack-table.ts +0 -1296
- package/src/rack.ts +0 -232
- package/src/rect.ts +0 -39
- package/src/scene/component.ts +0 -38
- package/src/sphere.ts +0 -39
- package/src/sprite.ts +0 -30
- package/src/stock.ts +0 -262
- package/src/templates/3d-container.ts +0 -21
- package/src/templates/banner.ts +0 -21
- package/src/templates/camera.ts +0 -25
- package/src/templates/cube.ts +0 -20
- package/src/templates/cylinder.ts +0 -20
- package/src/templates/desk.ts +0 -20
- package/src/templates/gltf-object.ts +0 -20
- package/src/templates/index.ts +0 -29
- package/src/templates/light.ts +0 -23
- package/src/templates/pallet.ts +0 -20
- package/src/templates/rack-table.ts +0 -21
- package/src/templates/sphere.ts +0 -20
- package/src/templates/sprite.ts +0 -21
- package/src/templates/visualizer.ts +0 -21
- package/src/templates/wall.ts +0 -20
- package/src/text.ts +0 -10
- package/src/three-container-editor.ts +0 -187
- package/src/three-container.ts +0 -724
- package/src/three-controls.ts +0 -778
- package/src/three-layout.ts +0 -25
- package/src/three-space.ts +0 -732
- package/src/threed/common.ts +0 -21
- package/src/threed/floor/floor.ts +0 -62
- package/src/threed/html/elements.ts +0 -27
- package/src/threed/index.ts +0 -15
- package/src/threed/real-object-camera-meshed.ts +0 -67
- package/src/threed/real-object-camera.ts +0 -41
- package/src/threed/real-object-dom-element.ts +0 -55
- package/src/threed/real-object-dummy.ts +0 -13
- package/src/threed/real-object-extrude.ts +0 -210
- package/src/threed/real-object-gltf.ts +0 -136
- package/src/threed/real-object-group.ts +0 -35
- package/src/threed/real-object-mesh.ts +0 -74
- package/src/threed/real-object-plane.ts +0 -27
- package/src/threed/real-object-scene.ts +0 -84
- package/src/threed/real-object-sprite-2d.ts +0 -54
- package/src/threed/real-object-sprite.ts +0 -64
- package/src/threed/real-object-text.ts +0 -86
- package/src/threed/real-object.ts +0 -326
- package/src/threed/texture/canvas-texture.ts +0 -67
- package/src/threed/texture/text-texture.ts +0 -100
- package/src/threed/three-dimensional-container.ts +0 -9
- package/src/threed/utils/bound-uv-generator.ts +0 -80
- package/src/visualizer.ts +0 -319
- package/src/wall.ts +0 -50
- package/tsconfig.json +0 -24
- package/tsconfig.tsbuildinfo +0 -1
- package/web-dev-server.config.mjs +0 -27
package/src/polygon.ts
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { POINT, Polygon } from '@hatiolab/things-scene'
|
|
6
|
-
import * as THREE from 'three'
|
|
7
|
-
import { RealObjectExtrude } from './threed/real-object-extrude'
|
|
8
|
-
|
|
9
|
-
export class PolygonExtrude extends RealObjectExtrude {
|
|
10
|
-
_minMax?: {
|
|
11
|
-
minX?: number
|
|
12
|
-
minY?: number
|
|
13
|
-
maxX?: number
|
|
14
|
-
maxY?: number
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
get shape() {
|
|
18
|
-
var { path = [], round = 0 } = this.component.state
|
|
19
|
-
|
|
20
|
-
var shape = new THREE.Shape()
|
|
21
|
-
|
|
22
|
-
for (var i = 0; i < path.length; i++) {
|
|
23
|
-
const prev = path[(i - 1 + path.length) % path.length]
|
|
24
|
-
const cursor = path[(i + path.length) % path.length]
|
|
25
|
-
const next = path[(i + 1) % path.length]
|
|
26
|
-
|
|
27
|
-
if (prev.x === cursor.x && prev.y === cursor.y) {
|
|
28
|
-
continue
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
var length = Math.sqrt((prev.x - cursor.x) * (prev.x - cursor.x) + (prev.y - cursor.y) * (prev.y - cursor.y))
|
|
32
|
-
var theta = length !== 0 ? Math.atan2(prev.x - cursor.x, prev.y - cursor.y) : 0
|
|
33
|
-
var x = Math.sin(theta) * Math.min(round, length / 2) + cursor.x
|
|
34
|
-
var y = Math.cos(theta) * Math.min(round, length / 2) + cursor.y
|
|
35
|
-
|
|
36
|
-
const p1 = round > 0 || length !== 0 ? { x, y } : cursor
|
|
37
|
-
|
|
38
|
-
var length = Math.sqrt((next.x - cursor.x) * (next.x - cursor.x) + (next.y - cursor.y) * (next.y - cursor.y))
|
|
39
|
-
theta = length !== 0 ? Math.atan2(next.x - cursor.x, next.y - cursor.y) : 0
|
|
40
|
-
x = Math.sin(theta) * Math.min(round, length / 2) + cursor.x
|
|
41
|
-
y = Math.cos(theta) * Math.min(round, length / 2) + cursor.y
|
|
42
|
-
|
|
43
|
-
const p2 = round > 0 || length !== 0 ? { x, y } : cursor
|
|
44
|
-
|
|
45
|
-
i == 0 ? shape.moveTo(p1.x, p1.y) : shape.lineTo(p1.x, p1.y)
|
|
46
|
-
round > 0 && shape.quadraticCurveTo(cursor.x, cursor.y, p2.x, p2.y)
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return shape
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
get minMax() {
|
|
53
|
-
if (!this._minMax) {
|
|
54
|
-
var { path } = this.component.state
|
|
55
|
-
|
|
56
|
-
var minX: number | undefined
|
|
57
|
-
var minY: number | undefined
|
|
58
|
-
var maxX: number | undefined
|
|
59
|
-
var maxY: number | undefined
|
|
60
|
-
|
|
61
|
-
path.forEach((p: POINT, i: number) => {
|
|
62
|
-
if (i == 0) {
|
|
63
|
-
minX = maxX = p.x
|
|
64
|
-
minY = maxY = p.y
|
|
65
|
-
return
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
minX = Math.min(minX!, p.x)
|
|
69
|
-
maxX = Math.max(maxX!, p.x)
|
|
70
|
-
minY = Math.min(minY!, p.y)
|
|
71
|
-
maxY = Math.max(maxY!, p.y)
|
|
72
|
-
})
|
|
73
|
-
|
|
74
|
-
this._minMax = {
|
|
75
|
-
minX,
|
|
76
|
-
minY,
|
|
77
|
-
maxX,
|
|
78
|
-
maxY
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return this._minMax
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
Polygon.prototype.buildRealObject = function () {
|
|
87
|
-
return new PolygonExtrude(this)
|
|
88
|
-
}
|
package/src/rack-table-cell.ts
DELETED
|
@@ -1,386 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
import { Component, Properties, RectPath } from '@hatiolab/things-scene'
|
|
5
|
-
import { Rack } from './rack'
|
|
6
|
-
import { RealObject } from './threed/real-object'
|
|
7
|
-
|
|
8
|
-
const EMPTY_BORDER = {}
|
|
9
|
-
|
|
10
|
-
function isBottomMost(idx: number, rows: number, columns: number) {
|
|
11
|
-
return idx >= (rows - 1) * columns
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function isRightMost(idx: number, rows: number, columns: number) {
|
|
15
|
-
return (idx + 1) % columns == 0
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function hasAnyProperty(o: any, ...properties: string[]) {
|
|
19
|
-
for (let p in properties) {
|
|
20
|
-
if (o.hasOwnProperty(properties[p])) {
|
|
21
|
-
return true
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const EMPTY_CELL_STROKE_STYLE = '#ccc'
|
|
27
|
-
const EMPTY_CELL_LINE_WIDTH = 1
|
|
28
|
-
const EMPTY_CELL_FILL_STYLE = '#efefef'
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* 1. 스타일을 상속 받아야 함. (cascade-style)
|
|
32
|
-
* 2. 스타일을 동적처리할 수 있음. (로직처리)
|
|
33
|
-
* 3. 데이타를 받을 수 있음.
|
|
34
|
-
*/
|
|
35
|
-
export class RackTableCell extends RectPath(Component) {
|
|
36
|
-
_focused: boolean = false
|
|
37
|
-
|
|
38
|
-
get hasTextProperty() {
|
|
39
|
-
return false
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
get nature() {
|
|
43
|
-
return {
|
|
44
|
-
mutable: false,
|
|
45
|
-
resizable: true,
|
|
46
|
-
rotatable: true,
|
|
47
|
-
properties: [
|
|
48
|
-
{
|
|
49
|
-
type: 'string',
|
|
50
|
-
label: 'section',
|
|
51
|
-
name: 'section'
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
type: 'string',
|
|
55
|
-
label: 'unit',
|
|
56
|
-
name: 'unit'
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
type: 'string',
|
|
60
|
-
label: 'shelf-locations',
|
|
61
|
-
name: 'shelfLocations',
|
|
62
|
-
placeholder: '1,2,3,... / ,,,04'
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
type: 'textarea',
|
|
66
|
-
label: 'bin-locations',
|
|
67
|
-
name: 'binLocations',
|
|
68
|
-
placeholder: '1,2,3,...'
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
type: 'checkbox',
|
|
72
|
-
label: 'is-empty',
|
|
73
|
-
name: 'isEmpty'
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
type: 'location-increase-pattern',
|
|
77
|
-
label: '',
|
|
78
|
-
name: '',
|
|
79
|
-
property: {
|
|
80
|
-
event: {
|
|
81
|
-
'increase-location-pattern': (event: CustomEvent) => {
|
|
82
|
-
var { increasingDirection, skipNumbering, startSection, startUnit } = event.detail
|
|
83
|
-
const rackTable = this.parent as any
|
|
84
|
-
rackTable.increaseLocation(increasingDirection, skipNumbering, startSection, startUnit)
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
type: 'editor-table',
|
|
91
|
-
label: '',
|
|
92
|
-
name: '',
|
|
93
|
-
property: {
|
|
94
|
-
merge: false,
|
|
95
|
-
split: false
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
]
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
buildRealObject(): RealObject | undefined {
|
|
103
|
-
return new Rack(this)
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
set merged(merged) {
|
|
107
|
-
this.set('merged', !!merged)
|
|
108
|
-
if (merged) this.set('text', '')
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
get merged() {
|
|
112
|
-
return this.getState('merged')
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
set rowspan(rowspan) {
|
|
116
|
-
this.set('rowspan', rowspan)
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
get rowspan() {
|
|
120
|
-
return this.getState('rowspan')
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
set colspan(colspan) {
|
|
124
|
-
this.set('colspan', colspan)
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
get colspan() {
|
|
128
|
-
return this.getState('colspan')
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
get border() {
|
|
132
|
-
return this.state.border || EMPTY_BORDER
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
get isEmpty() {
|
|
136
|
-
return this.getState('isEmpty')
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
_drawBorder(context: CanvasRenderingContext2D, x: number, y: number, to_x: number, to_y: number, style: any) {
|
|
140
|
-
if (style && style.strokeStyle && style.lineWidth && style.lineDash) {
|
|
141
|
-
context.beginPath()
|
|
142
|
-
context.moveTo(x, y)
|
|
143
|
-
context.lineTo(to_x, to_y)
|
|
144
|
-
|
|
145
|
-
Component.drawStroke(context, style)
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
render(context: CanvasRenderingContext2D) {
|
|
150
|
-
var { left, top, width, height } = this.bounds
|
|
151
|
-
var { isEmpty } = this.state
|
|
152
|
-
|
|
153
|
-
var border = this.border
|
|
154
|
-
|
|
155
|
-
if (!isEmpty) {
|
|
156
|
-
this._draw_rack_cell(context)
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
// Cell 채우기.
|
|
160
|
-
context.beginPath()
|
|
161
|
-
context.lineWidth = 0
|
|
162
|
-
context.rect(left, top, width, height)
|
|
163
|
-
|
|
164
|
-
// Border 그리기
|
|
165
|
-
var parent = this.parent as any
|
|
166
|
-
var idx = parent.components.indexOf(this)
|
|
167
|
-
var columns = parent.columns || 1
|
|
168
|
-
var rows = parent.rows || 1
|
|
169
|
-
|
|
170
|
-
this._drawBorder(context, left, top, left + width, top, border.top)
|
|
171
|
-
this._drawBorder(context, left, top + height, left, top, border.left)
|
|
172
|
-
if (isRightMost(idx, rows, columns))
|
|
173
|
-
this._drawBorder(context, left + width, top, left + width, top + height, border.right)
|
|
174
|
-
if (isBottomMost(idx, rows, columns))
|
|
175
|
-
this._drawBorder(context, left + width, top + height, left, top + height, border.bottom)
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
_draw_rack_cell(context: CanvasRenderingContext2D) {
|
|
179
|
-
var { left, top, width, height } = this.bounds
|
|
180
|
-
|
|
181
|
-
context.save()
|
|
182
|
-
context.fillStyle = EMPTY_CELL_FILL_STYLE
|
|
183
|
-
context.fillRect(left, top, width, height)
|
|
184
|
-
|
|
185
|
-
context.beginPath()
|
|
186
|
-
context.lineWidth = EMPTY_CELL_LINE_WIDTH
|
|
187
|
-
context.strokeStyle = EMPTY_CELL_STROKE_STYLE
|
|
188
|
-
|
|
189
|
-
context.moveTo(left, top)
|
|
190
|
-
context.lineTo(left + width, top + height)
|
|
191
|
-
context.moveTo(left + width, top)
|
|
192
|
-
context.lineTo(left, top + height)
|
|
193
|
-
|
|
194
|
-
context.stroke()
|
|
195
|
-
context.closePath()
|
|
196
|
-
context.restore()
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
get decotag() {
|
|
200
|
-
var rackTable = this.parent
|
|
201
|
-
var { locPattern, zone = '' } = rackTable.model
|
|
202
|
-
|
|
203
|
-
locPattern = locPattern.substring(0, locPattern.indexOf('{u}') + 3)
|
|
204
|
-
|
|
205
|
-
var locationString = ''
|
|
206
|
-
if (this.getState('section') && this.getState('unit'))
|
|
207
|
-
locationString = locPattern
|
|
208
|
-
.replace('{z}', zone)
|
|
209
|
-
.replace('{s}', this.getState('section'))
|
|
210
|
-
.replace('{u}', this.getState('unit'))
|
|
211
|
-
|
|
212
|
-
return locationString || ''
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
get index() {
|
|
216
|
-
let rackTable = this.parent as any
|
|
217
|
-
var index = rackTable.components.indexOf(this)
|
|
218
|
-
|
|
219
|
-
var rowIndex = Math.floor(index / rackTable.columns)
|
|
220
|
-
var columnIndex = index % rackTable.columns
|
|
221
|
-
|
|
222
|
-
return {
|
|
223
|
-
row: rowIndex,
|
|
224
|
-
column: columnIndex
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
get rowIndex() {
|
|
229
|
-
return this.index.row
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
get columnIndex() {
|
|
233
|
-
return this.index.column
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
get leftCell() {
|
|
237
|
-
let rackTable = this.parent as any
|
|
238
|
-
var index = rackTable.components.indexOf(this)
|
|
239
|
-
|
|
240
|
-
var rowIndex = this.rowIndex
|
|
241
|
-
var columnIndex = this.columnIndex
|
|
242
|
-
|
|
243
|
-
if (columnIndex === 0) return null
|
|
244
|
-
|
|
245
|
-
var leftCell = rackTable.components[rowIndex * rackTable.columns + columnIndex - 1]
|
|
246
|
-
|
|
247
|
-
return leftCell
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
get rightCell() {
|
|
251
|
-
let rackTable = this.parent as any
|
|
252
|
-
var index = rackTable.components.indexOf(this)
|
|
253
|
-
|
|
254
|
-
var rowIndex = this.rowIndex
|
|
255
|
-
var columnIndex = this.columnIndex
|
|
256
|
-
|
|
257
|
-
if (columnIndex === rackTable.columns) return null
|
|
258
|
-
|
|
259
|
-
var rightCell = rackTable.components[rowIndex * rackTable.columns + columnIndex + 1]
|
|
260
|
-
|
|
261
|
-
return rightCell
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
get aboveCell() {
|
|
265
|
-
let rackTable = this.parent as any
|
|
266
|
-
var index = rackTable.components.indexOf(this)
|
|
267
|
-
|
|
268
|
-
var rowIndex = this.rowIndex
|
|
269
|
-
var columnIndex = this.columnIndex
|
|
270
|
-
|
|
271
|
-
if (rowIndex === 0) return null
|
|
272
|
-
|
|
273
|
-
var aboveCell = rackTable.components[(rowIndex - 1) * rackTable.columns + columnIndex]
|
|
274
|
-
|
|
275
|
-
return aboveCell
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
get belowCell() {
|
|
279
|
-
var rackTable = this.parent as any
|
|
280
|
-
var index = rackTable.components.indexOf(this)
|
|
281
|
-
|
|
282
|
-
var rowIndex = this.rowIndex
|
|
283
|
-
var columnIndex = this.columnIndex
|
|
284
|
-
|
|
285
|
-
if (rowIndex === rackTable.rows) return null
|
|
286
|
-
|
|
287
|
-
var belowCell = rackTable.components[(rowIndex + 1) * rackTable.columns + columnIndex]
|
|
288
|
-
|
|
289
|
-
return belowCell
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
get rowCells() {
|
|
293
|
-
var rackTable = this.parent as any
|
|
294
|
-
return rackTable.getCellsByRow(this.rowIndex)
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
get columnCells() {
|
|
298
|
-
var rackTable = this.parent as any
|
|
299
|
-
return rackTable.getCellsByColumn(this.columnIndex)
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
get aboveRowCells() {
|
|
303
|
-
var aboveCell = this.aboveCell
|
|
304
|
-
while (1) {
|
|
305
|
-
var aboveRowCells = aboveCell.notEmptyRowCells
|
|
306
|
-
|
|
307
|
-
if (aboveRowCells.length > 0) return aboveRowCells
|
|
308
|
-
|
|
309
|
-
aboveCell = aboveCell.aboveCell
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
get lastUnit() {
|
|
314
|
-
var rowCells = this.aboveRowCells
|
|
315
|
-
|
|
316
|
-
for (let i = rowCells.length - 1; i > 0; i--) {
|
|
317
|
-
var cell = rowCells[i]
|
|
318
|
-
|
|
319
|
-
var unit = cell.getState('unit')
|
|
320
|
-
|
|
321
|
-
if (unit) return Number(unit)
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
return 0
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
get firstUnit() {
|
|
328
|
-
var rowCells = this.aboveRowCells
|
|
329
|
-
|
|
330
|
-
for (let i = 0; i < rowCells.length; i++) {
|
|
331
|
-
var cell = rowCells[i]
|
|
332
|
-
|
|
333
|
-
var unit = cell.getState('unit')
|
|
334
|
-
|
|
335
|
-
if (unit) return Number(unit)
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
return 0
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
get notEmptyRowCells() {
|
|
342
|
-
return this.rowCells.filter((c: Component) => {
|
|
343
|
-
return !c.getState('isEmpty')
|
|
344
|
-
})
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
get emptyRowCells() {
|
|
348
|
-
return this.rowCells.filter((c: Component) => {
|
|
349
|
-
return c.getState('isEmpty')
|
|
350
|
-
})
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
get isAisle() {
|
|
354
|
-
return this.notEmptyRowCells.length === 0
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
onchange(after: Properties, before: Properties) {
|
|
358
|
-
if (hasAnyProperty(after, 'isEmpty')) {
|
|
359
|
-
// FIXME
|
|
360
|
-
delete this.model.unit
|
|
361
|
-
delete this.model.section
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
onmouseenter() {
|
|
366
|
-
this.trigger('deco')
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
onmouseleave() {
|
|
370
|
-
this.trigger('decoreset')
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
contains(x: number, y: number) {
|
|
374
|
-
var contains = super.contains(x, y)
|
|
375
|
-
if (!contains) {
|
|
376
|
-
this._focused = false
|
|
377
|
-
this.invalidate()
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
return contains
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
;['border'].forEach(getter => Component.memoize(RackTableCell.prototype, getter, false))
|
|
385
|
-
|
|
386
|
-
Component.register('rack-table-cell', RackTableCell)
|