@operato/scene-visualizer 9.2.2 → 10.0.0-beta.10

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.
Files changed (249) hide show
  1. package/dist/carrier.d.ts +263 -0
  2. package/dist/carrier.js +272 -0
  3. package/dist/carrier.js.map +1 -0
  4. package/dist/desk.d.ts +238 -3
  5. package/dist/desk.js +1 -2
  6. package/dist/desk.js.map +1 -1
  7. package/dist/editors/index.d.ts +3 -0
  8. package/dist/editors/index.js +15 -0
  9. package/dist/editors/index.js.map +1 -1
  10. package/dist/editors/property-editor-gltf-fill-targets.d.ts +20 -0
  11. package/dist/editors/property-editor-gltf-fill-targets.js +313 -0
  12. package/dist/editors/property-editor-gltf-fill-targets.js.map +1 -0
  13. package/dist/editors/property-editor-gltf-info.d.ts +25 -3
  14. package/dist/editors/property-editor-gltf-info.js +333 -73
  15. package/dist/editors/property-editor-gltf-info.js.map +1 -1
  16. package/dist/editors/property-editor-gltf-play-targets.d.ts +25 -0
  17. package/dist/editors/property-editor-gltf-play-targets.js +388 -0
  18. package/dist/editors/property-editor-gltf-play-targets.js.map +1 -0
  19. package/dist/editors/property-editor-location-increase-pattern.js +87 -95
  20. package/dist/editors/property-editor-location-increase-pattern.js.map +1 -1
  21. package/dist/editors/property-editor-stocker-location.d.ts +13 -0
  22. package/dist/editors/property-editor-stocker-location.js +151 -0
  23. package/dist/editors/property-editor-stocker-location.js.map +1 -0
  24. package/dist/editors/property-editor-stocker-ports.d.ts +8 -0
  25. package/dist/editors/property-editor-stocker-ports.js +112 -0
  26. package/dist/editors/property-editor-stocker-ports.js.map +1 -0
  27. package/dist/effects/outline.js +1 -1
  28. package/dist/effects/outline.js.map +1 -1
  29. package/dist/index.d.ts +8 -17
  30. package/dist/index.js +10 -17
  31. package/dist/index.js.map +1 -1
  32. package/dist/rack-table-3d.d.ts +16 -0
  33. package/dist/rack-table-3d.js +95 -0
  34. package/dist/rack-table-3d.js.map +1 -0
  35. package/dist/rack-table-cell.d.ts +238 -3
  36. package/dist/rack-table-cell.js +44 -51
  37. package/dist/rack-table-cell.js.map +1 -1
  38. package/dist/rack-table-location.d.ts +37 -0
  39. package/dist/rack-table-location.js +227 -0
  40. package/dist/rack-table-location.js.map +1 -0
  41. package/dist/rack-table.d.ts +13 -29
  42. package/dist/rack-table.js +121 -380
  43. package/dist/rack-table.js.map +1 -1
  44. package/dist/rack.d.ts +16 -5
  45. package/dist/rack.js +106 -19
  46. package/dist/rack.js.map +1 -1
  47. package/dist/signal-tower.d.ts +492 -0
  48. package/dist/signal-tower.js +275 -0
  49. package/dist/signal-tower.js.map +1 -0
  50. package/dist/stock-hub.d.ts +25 -0
  51. package/dist/stock-hub.js +147 -0
  52. package/dist/stock-hub.js.map +1 -0
  53. package/dist/stock.d.ts +52 -8
  54. package/dist/stock.js +223 -120
  55. package/dist/stock.js.map +1 -1
  56. package/dist/stocker-3d.d.ts +23 -0
  57. package/dist/stocker-3d.js +352 -0
  58. package/dist/stocker-3d.js.map +1 -0
  59. package/dist/stocker-port-3d.d.ts +14 -0
  60. package/dist/stocker-port-3d.js +80 -0
  61. package/dist/stocker-port-3d.js.map +1 -0
  62. package/dist/stocker-port.d.ts +254 -0
  63. package/dist/stocker-port.js +123 -0
  64. package/dist/stocker-port.js.map +1 -0
  65. package/dist/stocker.d.ts +340 -0
  66. package/dist/stocker.js +370 -0
  67. package/dist/stocker.js.map +1 -0
  68. package/dist/tank.d.ts +492 -0
  69. package/dist/tank.js +312 -0
  70. package/dist/tank.js.map +1 -0
  71. package/dist/templates/carrier.d.ts +19 -0
  72. package/dist/templates/carrier.js +20 -0
  73. package/dist/templates/carrier.js.map +1 -0
  74. package/dist/templates/cube.js +1 -1
  75. package/dist/templates/cube.js.map +1 -1
  76. package/dist/templates/cylinder.js +3 -3
  77. package/dist/templates/cylinder.js.map +1 -1
  78. package/dist/templates/index.d.ts +38 -38
  79. package/dist/templates/index.js +15 -1
  80. package/dist/templates/index.js.map +1 -1
  81. package/dist/templates/rack-table.d.ts +2 -0
  82. package/dist/templates/rack-table.js +4 -2
  83. package/dist/templates/rack-table.js.map +1 -1
  84. package/dist/templates/signal-tower.d.ts +21 -0
  85. package/dist/templates/signal-tower.js +22 -0
  86. package/dist/templates/signal-tower.js.map +1 -0
  87. package/dist/templates/sphere.d.ts +1 -0
  88. package/dist/templates/sphere.js +5 -4
  89. package/dist/templates/sphere.js.map +1 -1
  90. package/dist/templates/stock-hub.d.ts +14 -0
  91. package/dist/templates/stock-hub.js +15 -0
  92. package/dist/templates/stock-hub.js.map +1 -0
  93. package/dist/templates/stocker-port.d.ts +17 -0
  94. package/dist/templates/stocker-port.js +17 -0
  95. package/dist/templates/stocker-port.js.map +1 -0
  96. package/dist/templates/stocker.d.ts +27 -0
  97. package/dist/templates/stocker.js +38 -0
  98. package/dist/templates/stocker.js.map +1 -0
  99. package/dist/templates/tank.d.ts +21 -0
  100. package/dist/templates/tank.js +22 -0
  101. package/dist/templates/tank.js.map +1 -0
  102. package/dist/templates/vehicle.d.ts +19 -0
  103. package/dist/templates/vehicle.js +20 -0
  104. package/dist/templates/vehicle.js.map +1 -0
  105. package/dist/templates/visualizer.js +1 -1
  106. package/dist/templates/visualizer.js.map +1 -1
  107. package/dist/vehicle.d.ts +248 -0
  108. package/dist/vehicle.js +133 -0
  109. package/dist/vehicle.js.map +1 -0
  110. package/dist/visualizer.d.ts +5 -5
  111. package/dist/visualizer.js +72 -68
  112. package/dist/visualizer.js.map +1 -1
  113. package/icons/carrier.png +0 -0
  114. package/icons/signal-tower.png +0 -0
  115. package/icons/stock-hub.png +0 -0
  116. package/icons/tank.png +0 -0
  117. package/icons/vehicle.png +0 -0
  118. package/package.json +16 -18
  119. package/translations/en.json +6 -0
  120. package/translations/ja.json +5 -0
  121. package/translations/ko.json +6 -1
  122. package/translations/ms.json +5 -0
  123. package/translations/zh.json +5 -0
  124. package/dist/banner.d.ts +0 -15
  125. package/dist/banner.js +0 -76
  126. package/dist/banner.js.map +0 -1
  127. package/dist/camera.d.ts +0 -20
  128. package/dist/camera.js +0 -108
  129. package/dist/camera.js.map +0 -1
  130. package/dist/cube.d.ts +0 -13
  131. package/dist/cube.js +0 -38
  132. package/dist/cube.js.map +0 -1
  133. package/dist/cylinder.d.ts +0 -11
  134. package/dist/cylinder.js +0 -38
  135. package/dist/cylinder.js.map +0 -1
  136. package/dist/ellipse.d.ts +0 -5
  137. package/dist/ellipse.js +0 -22
  138. package/dist/ellipse.js.map +0 -1
  139. package/dist/gltf-object.d.ts +0 -20
  140. package/dist/gltf-object.js +0 -104
  141. package/dist/gltf-object.js.map +0 -1
  142. package/dist/html-overlay-element.d.ts +0 -1
  143. package/dist/html-overlay-element.js +0 -12
  144. package/dist/html-overlay-element.js.map +0 -1
  145. package/dist/light.d.ts +0 -15
  146. package/dist/light.js +0 -135
  147. package/dist/light.js.map +0 -1
  148. package/dist/polygon.d.ts +0 -17
  149. package/dist/polygon.js +0 -64
  150. package/dist/polygon.js.map +0 -1
  151. package/dist/rect.d.ts +0 -5
  152. package/dist/rect.js +0 -36
  153. package/dist/rect.js.map +0 -1
  154. package/dist/scene/component.d.ts +0 -1
  155. package/dist/scene/component.js +0 -29
  156. package/dist/scene/component.js.map +0 -1
  157. package/dist/sphere.d.ts +0 -11
  158. package/dist/sphere.js +0 -38
  159. package/dist/sphere.js.map +0 -1
  160. package/dist/sprite.d.ts +0 -9
  161. package/dist/sprite.js +0 -28
  162. package/dist/sprite.js.map +0 -1
  163. package/dist/text.d.ts +0 -1
  164. package/dist/text.js +0 -9
  165. package/dist/text.js.map +0 -1
  166. package/dist/three-container-editor.d.ts +0 -22
  167. package/dist/three-container-editor.js +0 -132
  168. package/dist/three-container-editor.js.map +0 -1
  169. package/dist/three-container.d.ts +0 -85
  170. package/dist/three-container.js +0 -565
  171. package/dist/three-container.js.map +0 -1
  172. package/dist/three-controls.d.ts +0 -11
  173. package/dist/three-controls.js +0 -616
  174. package/dist/three-controls.js.map +0 -1
  175. package/dist/three-layout.d.ts +0 -8
  176. package/dist/three-layout.js +0 -20
  177. package/dist/three-layout.js.map +0 -1
  178. package/dist/three-space.d.ts +0 -85
  179. package/dist/three-space.js +0 -570
  180. package/dist/three-space.js.map +0 -1
  181. package/dist/threed/common.d.ts +0 -22
  182. package/dist/threed/common.js +0 -19
  183. package/dist/threed/common.js.map +0 -1
  184. package/dist/threed/floor/floor.d.ts +0 -3
  185. package/dist/threed/floor/floor.js +0 -51
  186. package/dist/threed/floor/floor.js.map +0 -1
  187. package/dist/threed/html/elements.d.ts +0 -2
  188. package/dist/threed/html/elements.js +0 -21
  189. package/dist/threed/html/elements.js.map +0 -1
  190. package/dist/threed/index.d.ts +0 -15
  191. package/dist/threed/index.js +0 -16
  192. package/dist/threed/index.js.map +0 -1
  193. package/dist/threed/real-object-camera-meshed.d.ts +0 -12
  194. package/dist/threed/real-object-camera-meshed.js +0 -49
  195. package/dist/threed/real-object-camera-meshed.js.map +0 -1
  196. package/dist/threed/real-object-camera.d.ts +0 -9
  197. package/dist/threed/real-object-camera.js +0 -31
  198. package/dist/threed/real-object-camera.js.map +0 -1
  199. package/dist/threed/real-object-dom-element.d.ts +0 -9
  200. package/dist/threed/real-object-dom-element.js +0 -40
  201. package/dist/threed/real-object-dom-element.js.map +0 -1
  202. package/dist/threed/real-object-dummy.d.ts +0 -6
  203. package/dist/threed/real-object-dummy.js +0 -11
  204. package/dist/threed/real-object-dummy.js.map +0 -1
  205. package/dist/threed/real-object-extrude.d.ts +0 -21
  206. package/dist/threed/real-object-extrude.js +0 -173
  207. package/dist/threed/real-object-extrude.js.map +0 -1
  208. package/dist/threed/real-object-gltf.d.ts +0 -16
  209. package/dist/threed/real-object-gltf.js +0 -101
  210. package/dist/threed/real-object-gltf.js.map +0 -1
  211. package/dist/threed/real-object-group.d.ts +0 -5
  212. package/dist/threed/real-object-group.js +0 -11
  213. package/dist/threed/real-object-group.js.map +0 -1
  214. package/dist/threed/real-object-mesh.d.ts +0 -13
  215. package/dist/threed/real-object-mesh.js +0 -75
  216. package/dist/threed/real-object-mesh.js.map +0 -1
  217. package/dist/threed/real-object-plane.d.ts +0 -5
  218. package/dist/threed/real-object-plane.js +0 -22
  219. package/dist/threed/real-object-plane.js.map +0 -1
  220. package/dist/threed/real-object-scene.d.ts +0 -21
  221. package/dist/threed/real-object-scene.js +0 -67
  222. package/dist/threed/real-object-scene.js.map +0 -1
  223. package/dist/threed/real-object-sprite-2d.d.ts +0 -14
  224. package/dist/threed/real-object-sprite-2d.js +0 -45
  225. package/dist/threed/real-object-sprite-2d.js.map +0 -1
  226. package/dist/threed/real-object-sprite.d.ts +0 -11
  227. package/dist/threed/real-object-sprite.js +0 -50
  228. package/dist/threed/real-object-sprite.js.map +0 -1
  229. package/dist/threed/real-object-text.d.ts +0 -15
  230. package/dist/threed/real-object-text.js +0 -64
  231. package/dist/threed/real-object-text.js.map +0 -1
  232. package/dist/threed/real-object.d.ts +0 -64
  233. package/dist/threed/real-object.js +0 -260
  234. package/dist/threed/real-object.js.map +0 -1
  235. package/dist/threed/texture/canvas-texture.d.ts +0 -4
  236. package/dist/threed/texture/canvas-texture.js +0 -49
  237. package/dist/threed/texture/canvas-texture.js.map +0 -1
  238. package/dist/threed/texture/text-texture.d.ts +0 -8
  239. package/dist/threed/texture/text-texture.js +0 -79
  240. package/dist/threed/texture/text-texture.js.map +0 -1
  241. package/dist/threed/three-dimensional-container.d.ts +0 -8
  242. package/dist/threed/three-dimensional-container.js +0 -2
  243. package/dist/threed/three-dimensional-container.js.map +0 -1
  244. package/dist/threed/utils/bound-uv-generator.d.ts +0 -16
  245. package/dist/threed/utils/bound-uv-generator.js +0 -42
  246. package/dist/threed/utils/bound-uv-generator.js.map +0 -1
  247. package/dist/wall.d.ts +0 -13
  248. package/dist/wall.js +0 -45
  249. package/dist/wall.js.map +0 -1
@@ -0,0 +1,227 @@
1
+ /*
2
+ * Copyright © HatioLab Inc. All rights reserved.
3
+ *
4
+ * RackTable location management utilities.
5
+ * Extracted from rack-table.ts for separation of concerns.
6
+ */
7
+ /**
8
+ * Classify cells by their row index.
9
+ */
10
+ export function classifyByRow(cells) {
11
+ const classified = [];
12
+ cells.forEach(c => {
13
+ const { row, column } = c.index;
14
+ if (!classified[row]) {
15
+ classified[row] = [];
16
+ }
17
+ classified[row][column] = c;
18
+ });
19
+ return classified;
20
+ }
21
+ /**
22
+ * Find aisle rows (rows where all cells are empty).
23
+ */
24
+ export function findAisle(rows) {
25
+ if (!rows) {
26
+ return [];
27
+ }
28
+ return rows.filter(r => {
29
+ return r[0] && r[0].isAisle;
30
+ });
31
+ }
32
+ /**
33
+ * Get indices of aisle rows.
34
+ */
35
+ export function getAisleRowIndices(rows) {
36
+ const aisles = findAisle(rows);
37
+ const aisleRowIndices = [];
38
+ aisles.forEach(aisle => {
39
+ aisleRowIndices.push(rows.indexOf(aisle));
40
+ });
41
+ return aisleRowIndices;
42
+ }
43
+ /**
44
+ * Classify rows into sections separated by aisle rows.
45
+ */
46
+ export function classifyCellsBySection(rows, aisleRowIndices) {
47
+ const sections = [];
48
+ let wasAisle = false;
49
+ let section;
50
+ rows.forEach((row, i) => {
51
+ const isAisle = aisleRowIndices.indexOf(i) > -1;
52
+ if (!(wasAisle || isAisle)) {
53
+ section = [];
54
+ sections.push(section);
55
+ }
56
+ wasAisle = isAisle;
57
+ section.push(row);
58
+ });
59
+ return sections;
60
+ }
61
+ /**
62
+ * Rearrange cells by aisle direction pattern.
63
+ */
64
+ export function rearrangeByAisle(type, sections) {
65
+ const rearranged = [];
66
+ switch (type.toLowerCase()) {
67
+ case 'cw': {
68
+ let reverse = false;
69
+ sections.forEach(rows => {
70
+ const section = [];
71
+ rearranged.push(section);
72
+ rows.forEach((r, i) => {
73
+ if (reverse)
74
+ r.reverse();
75
+ if (i % 2 === 0) {
76
+ section.push(r);
77
+ reverse = !reverse;
78
+ }
79
+ });
80
+ });
81
+ break;
82
+ }
83
+ case 'ccw': {
84
+ let reverse = true;
85
+ sections.forEach(rows => {
86
+ const section = [];
87
+ rearranged.push(section);
88
+ rows.forEach((r, i) => {
89
+ if (reverse)
90
+ r.reverse();
91
+ if (i % 2 === 0) {
92
+ section.push(r);
93
+ reverse = !reverse;
94
+ }
95
+ });
96
+ });
97
+ break;
98
+ }
99
+ case 'zigzag':
100
+ sections.forEach(rows => {
101
+ const section = [];
102
+ rows.forEach((r, i) => {
103
+ if (i % 2 === 0) {
104
+ section.push(r);
105
+ }
106
+ });
107
+ const sectionLength = section.length;
108
+ const tempRow = [];
109
+ const tempSection = [];
110
+ section.forEach((row, rowIdx) => {
111
+ row.forEach((cell, idx) => {
112
+ tempRow[rowIdx + idx * section.length] = cell;
113
+ });
114
+ });
115
+ const chunkSize = tempRow.length / sectionLength;
116
+ for (let idx = 0; idx < sectionLength; idx++) {
117
+ tempSection.push(tempRow.slice(idx * chunkSize, (idx + 1) * chunkSize));
118
+ }
119
+ rearranged.push(tempSection);
120
+ });
121
+ break;
122
+ case 'zigzag-reverse':
123
+ sections.forEach(rows => {
124
+ const section = [];
125
+ rows.forEach((r, i) => {
126
+ if (i % 2 === 0) {
127
+ r.reverse();
128
+ section.push(r);
129
+ }
130
+ });
131
+ const sectionLength = section.length;
132
+ const tempRow = [];
133
+ const tempSection = [];
134
+ section.forEach((row, rowIdx) => {
135
+ row.forEach((cell, idx) => {
136
+ tempRow[rowIdx + idx * section.length] = cell;
137
+ });
138
+ });
139
+ const chunkSize = tempRow.length / sectionLength;
140
+ for (let idx = 0; idx < sectionLength; idx++) {
141
+ tempSection.push(tempRow.slice(idx * chunkSize, (idx + 1) * chunkSize));
142
+ }
143
+ rearranged.push(tempSection);
144
+ });
145
+ break;
146
+ }
147
+ return rearranged;
148
+ }
149
+ /**
150
+ * Remove empty cells from sections.
151
+ */
152
+ export function removeEmptyCells(sections) {
153
+ const newSections = [];
154
+ sections.forEach(rows => {
155
+ const newRows = [];
156
+ newSections.push(newRows);
157
+ rows.forEach(row => {
158
+ const newRow = [];
159
+ newRows.push(newRow);
160
+ row.forEach(c => {
161
+ if (!c.isEmpty)
162
+ newRow.push(c);
163
+ });
164
+ });
165
+ });
166
+ return newSections;
167
+ }
168
+ /**
169
+ * Merge section rows into flat arrays.
170
+ */
171
+ export function mergeRows(sections) {
172
+ const merged = [];
173
+ sections.forEach(section => {
174
+ let newSection = [];
175
+ section.forEach(rows => {
176
+ let mergedRow = [];
177
+ rows.forEach(row => {
178
+ mergedRow = mergedRow.concat(row);
179
+ });
180
+ newSection = newSection.concat(mergedRow);
181
+ });
182
+ merged.push(newSection);
183
+ });
184
+ return merged;
185
+ }
186
+ /**
187
+ * Set section/unit location on cells.
188
+ */
189
+ export function setLocations(sections, startSection, startUnit, sectionDigits, unitDigits) {
190
+ let sectionNumber = Number(startSection) || 1;
191
+ sections.forEach(section => {
192
+ let unitNumber = Number(startUnit) || 1;
193
+ section.forEach(c => {
194
+ if (!c.isEmpty) {
195
+ c.set('section', String(sectionNumber).padStart(sectionDigits, '0'));
196
+ c.set('unit', String(unitNumber).padStart(unitDigits, '0'));
197
+ }
198
+ else {
199
+ c.set('section', null);
200
+ c.set('unit', null);
201
+ }
202
+ unitNumber++;
203
+ });
204
+ sectionNumber++;
205
+ });
206
+ }
207
+ /**
208
+ * Run the full location increase flow.
209
+ */
210
+ export function increaseLocation(selectedCells, type, skipNumbering, startSection, startUnit, sectionDigits, unitDigits) {
211
+ // step 1: classify cells by row
212
+ const classified = classifyByRow(selectedCells);
213
+ // step 2: find aisle row indices
214
+ const aisleRowIndices = getAisleRowIndices(classified);
215
+ // step 3: classify cells by section
216
+ const sections = classifyCellsBySection(classified, aisleRowIndices);
217
+ // step 4: rearrange by aisle
218
+ let rearranged = rearrangeByAisle(type, sections);
219
+ // step 5: if skip numbering, remove empty cells
220
+ if (skipNumbering)
221
+ rearranged = removeEmptyCells(rearranged);
222
+ // step 6: merge rows
223
+ const merged = mergeRows(rearranged);
224
+ // step 7: set location
225
+ setLocations(merged, startSection, startUnit, sectionDigits, unitDigits);
226
+ }
227
+ //# sourceMappingURL=rack-table-location.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rack-table-location.js","sourceRoot":"","sources":["../src/rack-table-location.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,KAAsB;IAClD,MAAM,UAAU,GAAsB,EAAE,CAAA;IAExC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;QAChB,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,CAAA;QAE/B,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACrB,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,CAAA;QACtB,CAAC;QAED,UAAU,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAC7B,CAAC,CAAC,CAAA;IAEF,OAAO,UAAU,CAAA;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,IAAwB;IAChD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,EAAE,CAAA;IACX,CAAC;IAED,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;QACrB,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;IAC7B,CAAC,CAAC,CAAA;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAuB;IACxD,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAAA;IAC9B,MAAM,eAAe,GAAa,EAAE,CAAA;IAEpC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACrB,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA;IAC3C,CAAC,CAAC,CAAA;IAEF,OAAO,eAAe,CAAA;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB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a,EAAE,CAAA;IACjB,CAAC,CAAC,CAAA;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,aAA8B,EAC9B,IAAY,EACZ,aAAsB,EACtB,YAAoB,EACpB,SAAiB,EACjB,aAAqB,EACrB,UAAkB;IAElB,gCAAgC;IAChC,MAAM,UAAU,GAAG,aAAa,CAAC,aAAa,CAAC,CAAA;IAE/C,iCAAiC;IACjC,MAAM,eAAe,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAA;IAEtD,oCAAoC;IACpC,MAAM,QAAQ,GAAG,sBAAsB,CAAC,UAAU,EAAE,eAAe,CAAC,CAAA;IAEpE,6BAA6B;IAC7B,IAAI,UAAU,GAAG,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;IAEjD,gDAAgD;IAChD,IAAI,aAAa;QAAE,UAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAA;IAE5D,qBAAqB;IACrB,MAAM,MAAM,GAAG,SAAS,CAAC,UAAU,CAAC,CAAA;IAEpC,uBAAuB;IACvB,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,CAAC,CAAA;AAC1E,CAAC","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n *\n * RackTable location management utilities.\n * Extracted from rack-table.ts for separation of concerns.\n */\n\nimport type { RackTableCell } from './rack-table-cell.js'\n\n/**\n * Classify cells by their row index.\n */\nexport function classifyByRow(cells: RackTableCell[]): RackTableCell[][] {\n const classified: RackTableCell[][] = []\n\n cells.forEach(c => {\n const { row, column } = c.index\n\n if (!classified[row]) {\n classified[row] = []\n }\n\n classified[row][column] = c\n })\n\n return classified\n}\n\n/**\n * Find aisle rows (rows where all cells are empty).\n */\nexport function findAisle(rows?: RackTableCell[][]): RackTableCell[][] {\n if (!rows) {\n return []\n }\n\n return rows.filter(r => {\n return r[0] && r[0].isAisle\n })\n}\n\n/**\n * Get indices of aisle rows.\n */\nexport function getAisleRowIndices(rows: RackTableCell[][]): number[] {\n const aisles = findAisle(rows)\n const aisleRowIndices: number[] = []\n\n aisles.forEach(aisle => {\n aisleRowIndices.push(rows.indexOf(aisle))\n })\n\n return aisleRowIndices\n}\n\n/**\n * Classify rows into sections separated by aisle rows.\n */\nexport function classifyCellsBySection(\n rows: RackTableCell[][],\n aisleRowIndices: number[]\n): RackTableCell[][][] {\n const sections: RackTableCell[][][] = []\n let wasAisle = false\n let section!: RackTableCell[][]\n\n rows.forEach((row, i) => {\n const isAisle = aisleRowIndices.indexOf(i) > -1\n\n if (!(wasAisle || isAisle)) {\n section = []\n sections.push(section)\n }\n\n wasAisle = isAisle\n\n section.push(row)\n })\n\n return sections\n}\n\n/**\n * Rearrange cells by aisle direction pattern.\n */\nexport function rearrangeByAisle(type: string, sections: RackTableCell[][][]): RackTableCell[][][] {\n const rearranged: RackTableCell[][][] = []\n\n switch (type.toLowerCase()) {\n case 'cw': {\n let reverse = false\n sections.forEach(rows => {\n const section: RackTableCell[][] = []\n rearranged.push(section)\n rows.forEach((r, i) => {\n if (reverse) r.reverse()\n\n if (i % 2 === 0) {\n section.push(r)\n reverse = !reverse\n }\n })\n })\n break\n }\n case 'ccw': {\n let reverse = true\n sections.forEach(rows => {\n const section: RackTableCell[][] = []\n rearranged.push(section)\n rows.forEach((r, i) => {\n if (reverse) r.reverse()\n\n if (i % 2 === 0) {\n section.push(r)\n reverse = !reverse\n }\n })\n })\n break\n }\n case 'zigzag':\n sections.forEach(rows => {\n const section: RackTableCell[][] = []\n\n rows.forEach((r, i) => {\n if (i % 2 === 0) {\n section.push(r)\n }\n })\n\n const sectionLength = section.length\n const tempRow: RackTableCell[] = []\n const tempSection: RackTableCell[][] = []\n\n section.forEach((row, rowIdx) => {\n row.forEach((cell, idx) => {\n tempRow[rowIdx + idx * section.length] = cell\n })\n })\n\n const chunkSize = tempRow.length / sectionLength\n for (let idx = 0; idx < sectionLength; idx++) {\n tempSection.push(tempRow.slice(idx * chunkSize, (idx + 1) * chunkSize))\n }\n\n rearranged.push(tempSection)\n })\n break\n case 'zigzag-reverse':\n sections.forEach(rows => {\n const section: RackTableCell[][] = []\n\n rows.forEach((r, i) => {\n if (i % 2 === 0) {\n r.reverse()\n section.push(r)\n }\n })\n\n const sectionLength = section.length\n const tempRow: RackTableCell[] = []\n const tempSection: RackTableCell[][] = []\n\n section.forEach((row, rowIdx) => {\n row.forEach((cell, idx) => {\n tempRow[rowIdx + idx * section.length] = cell\n })\n })\n\n const chunkSize = tempRow.length / sectionLength\n for (let idx = 0; idx < sectionLength; idx++) {\n tempSection.push(tempRow.slice(idx * chunkSize, (idx + 1) * chunkSize))\n }\n\n rearranged.push(tempSection)\n })\n break\n }\n\n return rearranged\n}\n\n/**\n * Remove empty cells from sections.\n */\nexport function removeEmptyCells(sections: RackTableCell[][][]): RackTableCell[][][] {\n const newSections: RackTableCell[][][] = []\n sections.forEach(rows => {\n const newRows: RackTableCell[][] = []\n newSections.push(newRows)\n rows.forEach(row => {\n const newRow: RackTableCell[] = []\n newRows.push(newRow)\n row.forEach(c => {\n if (!c.isEmpty) newRow.push(c)\n })\n })\n })\n\n return newSections\n}\n\n/**\n * Merge section rows into flat arrays.\n */\nexport function mergeRows(sections: RackTableCell[][][]): RackTableCell[][] {\n const merged: RackTableCell[][] = []\n\n sections.forEach(section => {\n let newSection: RackTableCell[] = []\n\n section.forEach(rows => {\n let mergedRow: RackTableCell[] = []\n rows.forEach(row => {\n mergedRow = mergedRow.concat(row)\n })\n newSection = newSection.concat(mergedRow)\n })\n merged.push(newSection)\n })\n\n return merged\n}\n\n/**\n * Set section/unit location on cells.\n */\nexport function setLocations(\n sections: RackTableCell[][],\n startSection: number,\n startUnit: number,\n sectionDigits: number,\n unitDigits: number\n) {\n let sectionNumber = Number(startSection) || 1\n\n sections.forEach(section => {\n let unitNumber = Number(startUnit) || 1\n section.forEach(c => {\n if (!c.isEmpty) {\n c.set('section', String(sectionNumber).padStart(sectionDigits, '0'))\n c.set('unit', String(unitNumber).padStart(unitDigits, '0'))\n } else {\n c.set('section', null)\n c.set('unit', null)\n }\n unitNumber++\n })\n sectionNumber++\n })\n}\n\n/**\n * Run the full location increase flow.\n */\nexport function increaseLocation(\n selectedCells: RackTableCell[],\n type: string,\n skipNumbering: boolean,\n startSection: number,\n startUnit: number,\n sectionDigits: number,\n unitDigits: number\n) {\n // step 1: classify cells by row\n const classified = classifyByRow(selectedCells)\n\n // step 2: find aisle row indices\n const aisleRowIndices = getAisleRowIndices(classified)\n\n // step 3: classify cells by section\n const sections = classifyCellsBySection(classified, aisleRowIndices)\n\n // step 4: rearrange by aisle\n let rearranged = rearrangeByAisle(type, sections)\n\n // step 5: if skip numbering, remove empty cells\n if (skipNumbering) rearranged = removeEmptyCells(rearranged)\n\n // step 6: merge rows\n const merged = mergeRows(rearranged)\n\n // step 7: set location\n setLocations(merged, startSection, startUnit, sectionDigits, unitDigits)\n}\n"]}
@@ -1,22 +1,17 @@
1
- import { Component, ComponentNature, ContainerAbstract, Control, Properties } from '@hatiolab/things-scene';
2
- import { Rack } from './rack.js';
1
+ import { Component, ComponentNature, ContainerAbstract, Control, Properties, RealObject } from '@hatiolab/things-scene';
2
+ import * as THREE from 'three';
3
3
  import { RackTableCell } from './rack-table-cell.js';
4
- import { RealObjectGroup } from './threed/real-object-group.js';
5
- import { RealObject } from './threed/real-object.js';
6
- export declare class RackTable3d extends RealObjectGroup {
7
- build(): void;
8
- get position(): {
9
- x: number;
10
- y: any;
11
- z: number;
12
- };
13
- createRacks(): void;
14
- mergeAndAddRackCommonObjects(racks: Rack[]): void;
15
- makeShelfString(pattern: string, shelf: number, length: number): string | undefined;
16
- updateAlpha(): void;
17
- }
18
- export declare class RackTable extends ContainerAbstract {
4
+ import type { StockMaterialProvider } from './stock.js';
5
+ export declare class RackTable extends ContainerAbstract implements StockMaterialProvider {
19
6
  _focused_cell?: RackTableCell;
7
+ _stock_materials: THREE.Material[];
8
+ _default_material?: THREE.Material;
9
+ _empty_material?: THREE.Material;
10
+ private _legendTarget?;
11
+ get legendTarget(): Component | undefined;
12
+ get hideEmptyStock(): boolean;
13
+ private _onLegendChanged;
14
+ private _resetMaterials;
20
15
  is3dish(): boolean;
21
16
  buildRealObject(): RealObject | undefined;
22
17
  dispose(): void;
@@ -25,7 +20,7 @@ export declare class RackTable extends ContainerAbstract {
25
20
  get widths(): number[];
26
21
  get heights(): number[];
27
22
  buildCells(newrows: number, newcolumns: number, oldrows: number, oldcolumns: number): void;
28
- get layout(): import("@hatiolab/things-scene").LAYOUT;
23
+ get layout(): any;
29
24
  get rows(): any;
30
25
  setCellsStyle(cells: RackTableCell[], style: any, where: string): void;
31
26
  getRowColumn(cell: RackTableCell): {
@@ -42,18 +37,7 @@ export declare class RackTable extends ContainerAbstract {
42
37
  insertCellsRight(cells: RackTableCell[]): false | undefined;
43
38
  distributeHorizontal(cells: RackTableCell[]): void;
44
39
  distributeVertical(cells: RackTableCell[]): void;
45
- /**
46
- * visualizer location setting functions
47
- */
48
40
  increaseLocation(type: string, skipNumbering: boolean, startSection: number, startUnit: number): void;
49
- classifyByRow(cells: RackTableCell[]): RackTableCell[][];
50
- findAisle(rows?: RackTableCell[][]): RackTableCell[][];
51
- getAisleRowIndices(rows?: RackTableCell[][]): number[];
52
- classifyCellsBySection(rows: RackTableCell[][], aisleRowIndices: number[]): RackTableCell[][][];
53
- rearrangeByAisle(type: string, sections: RackTableCell[][][]): RackTableCell[][][];
54
- removeEmptyCells(sections: RackTableCell[][][]): RackTableCell[][][];
55
- mergeRows(sections: RackTableCell[][][]): RackTableCell[][];
56
- setLocations(sections: RackTableCell[][], startSection: number, startUnit: number): void;
57
41
  get columns(): any;
58
42
  get lefts(): Component[];
59
43
  get centers(): Component[];