architwin 1.14.15 → 1.15.0
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/lib/architwin.d.ts +13 -2
- package/lib/architwin.js +1 -1
- package/lib/atwinui/components/toolbar/i18n.js +71 -3
- package/lib/atwinui/components/toolbar/index.js +5 -1
- package/lib/atwinui/components/toolbar/menuBar.d.ts +1 -0
- package/lib/atwinui/components/toolbar/menuBar.js +12 -0
- package/lib/atwinui/components/toolbar/spacePartition/roomFormPane.d.ts +2 -0
- package/lib/atwinui/components/toolbar/spacePartition/roomFormPane.js +62 -24
- package/lib/atwinui/components/toolbar/spacePartition/roomTreePane.d.ts +21 -3
- package/lib/atwinui/components/toolbar/spacePartition/roomTreePane.js +62 -25
- package/lib/atwinui/components/toolbar/tagFormPane.js +2 -1
- package/lib/atwinui/components/toolbar/tagListPane.d.ts +7 -2
- package/lib/atwinui/components/toolbar/tagListPane.js +126 -38
- package/lib/atwinui/events.d.ts +5 -3
- package/lib/atwinui/events.js +633 -79
- package/lib/atwinui/index.js +9 -1
- package/lib/color.js +12 -1
- package/lib/loaders/polydrawerLoader.js +3 -0
- package/lib/types.d.ts +75 -1
- package/lib/types.js +17 -0
- package/package.json +1 -1
- package/static/atwinui.css +88 -7
- package/static/colors/SOFT_ROYAL_BLUE.png +0 -0
- package/static/colors/YELLOW_ORANGE.png +0 -0
- package/static/utility.css +157 -538
- package/lib/atwinui/components/toolbar/roomCreation/roomFormPane.d.ts +0 -68
- package/lib/atwinui/components/toolbar/roomCreation/roomFormPane.js +0 -798
- package/lib/atwinui/components/toolbar/roomCreation/roomLayerListPane.d.ts +0 -33
- package/lib/atwinui/components/toolbar/roomCreation/roomLayerListPane.js +0 -447
- package/lib/atwinui/components/toolbar/tagIotForm.d.ts +0 -20
- package/lib/atwinui/components/toolbar/tagIotForm.js +0 -391
- package/lib/atwinui/components/toolbar/usersPane.d.ts +0 -14
- package/lib/atwinui/components/toolbar/usersPane.js +0 -273
- package/lib/convert.d.ts +0 -13
- package/lib/convert.js +0 -54
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { RoomNode } from "../../../../types";
|
|
2
|
-
/**
|
|
3
|
-
* Renders and returns the HTML element for the room layer list pane.
|
|
4
|
-
* @returns {HTMLElement} The HTML element representing the room layer list pane.
|
|
5
|
-
*/
|
|
6
|
-
export declare function renderRoomLayerListPane(): HTMLElement;
|
|
7
|
-
/**
|
|
8
|
-
* Renders the UI for the Room tree structure.
|
|
9
|
-
* @param rooms - Details of the rooms to construct the tree.
|
|
10
|
-
*/
|
|
11
|
-
export declare function renderRoomTree(rooms: Array<RoomNode>): void;
|
|
12
|
-
/**
|
|
13
|
-
* Renders the UI for the specified room.
|
|
14
|
-
* @param room - The details of the room to be rendered.
|
|
15
|
-
*/
|
|
16
|
-
export declare function renderRoom(room: RoomNode): HTMLUListElement;
|
|
17
|
-
/**
|
|
18
|
-
* Renders the partitions for a specific room.
|
|
19
|
-
* @param roomPartitions - The details of the room partitions to be rendered.
|
|
20
|
-
* @param roomId - The identifier of the room to which the partitions belong.
|
|
21
|
-
*/
|
|
22
|
-
export declare function renderPartitions(roomPartitions: RoomNode[], roomId: string): void;
|
|
23
|
-
/**
|
|
24
|
-
* Renders the items within a specific partition.
|
|
25
|
-
* @param partitionItems - The details of the partition items to be rendered.
|
|
26
|
-
*/
|
|
27
|
-
export declare function renderPartitionItems(partitionItems: any): string;
|
|
28
|
-
export declare function updateParentVisibility(isPartition: boolean, currentBtn: HTMLElement): void;
|
|
29
|
-
/**
|
|
30
|
-
* Retrieves the current room data being edited.
|
|
31
|
-
* @returns The current room node being edited.
|
|
32
|
-
*/
|
|
33
|
-
export declare function getCurrentEditRoomData(): RoomNode;
|
|
@@ -1,447 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { getBundleVersion, extractUUID } from "../../../../utils";
|
|
11
|
-
import { batchAddEventListenerByClassName, handleRoomVisibility, toggleDisplayPane } from "../../../events";
|
|
12
|
-
import i18n from "../i18n";
|
|
13
|
-
import { setPartitionFormMode } from "./roomFormPane";
|
|
14
|
-
import { _3DXObjects } from "../../../../architwin";
|
|
15
|
-
let roomDataArray = [];
|
|
16
|
-
let currentEditRoomData = null;
|
|
17
|
-
/**
|
|
18
|
-
* Renders and returns the HTML element for the room layer list pane.
|
|
19
|
-
* @returns {HTMLElement} The HTML element representing the room layer list pane.
|
|
20
|
-
*/
|
|
21
|
-
export function renderRoomLayerListPane() {
|
|
22
|
-
console.info("__@ renderRoomLayerListPane");
|
|
23
|
-
const element = document.createElement('div');
|
|
24
|
-
element.classList.add('at_container');
|
|
25
|
-
element.classList.add('at_w-12');
|
|
26
|
-
element.classList.add('at_h-full');
|
|
27
|
-
element.setAttribute('id', 'at-room-tree-pane');
|
|
28
|
-
element.setAttribute('data-cy', 'at-room-tree-pane');
|
|
29
|
-
element.innerHTML = `
|
|
30
|
-
<div class="at_panel_header">
|
|
31
|
-
<span>${i18n.t('RoomTree')}</span>
|
|
32
|
-
</div>
|
|
33
|
-
|
|
34
|
-
<div class="at_button_row at_justify_end">
|
|
35
|
-
<div class="at_button at_accent at_accent_active" id="at-all-display-btn" data-cy="at-all-display-btn">
|
|
36
|
-
<span>${i18n.t('ALL')}</span>
|
|
37
|
-
</div>
|
|
38
|
-
<div class="at_button at_accent" id="at-floor-display-btn" data-cy="at-floor-display-btn">
|
|
39
|
-
<span class="mdi mdi-perspective-less"></span>
|
|
40
|
-
</div>
|
|
41
|
-
<div class="at_button at_accent" id="at-wall-display-btn" data-cy="at-wall-display-btn">
|
|
42
|
-
<span class="mdi mdi-perspective-less at_rotate_minus_90"></span>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
|
|
46
|
-
<div class="at_scrollable_container at_h-min-60" id="at-room-tree" data-cy="at-room-tree">
|
|
47
|
-
|
|
48
|
-
</div>
|
|
49
|
-
|
|
50
|
-
<div class="at_button_row at_justify_between" >
|
|
51
|
-
<div class="at_button at_ghost" id="at-partition-report-btn" data-cy="at-create-report-btn">
|
|
52
|
-
${i18n.t('Report')}
|
|
53
|
-
<span class="mdi mdi-table-arrow-down"></span>
|
|
54
|
-
</div>
|
|
55
|
-
<div class="at_button at_ghost" id="at-draw-room-btn" data-cy="at-draw-room-btn" target-pane="at-room-form-pane">
|
|
56
|
-
${i18n.t('AddRoom')}
|
|
57
|
-
<span class="mdi mdi-plus-circle-outline"></span>
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
<div class="at_flex at_justify_center at_price" id="at-bundle-version" data-cy="at-bundle-version">
|
|
61
|
-
<small class="at_text_xxs at_text_white at_opacity_5">${getBundleVersion()}</small>
|
|
62
|
-
</div>
|
|
63
|
-
`;
|
|
64
|
-
return element;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Renders the UI for the Room tree structure.
|
|
68
|
-
* @param rooms - Details of the rooms to construct the tree.
|
|
69
|
-
*/
|
|
70
|
-
export function renderRoomTree(rooms) {
|
|
71
|
-
console.log("__@ renderRoomTree");
|
|
72
|
-
console.info("__@ Room tree _3DXObjects: ", _3DXObjects);
|
|
73
|
-
try {
|
|
74
|
-
// Target the at-room-tree container
|
|
75
|
-
const roomTreeContainer = document.getElementById('at-room-tree');
|
|
76
|
-
// Clear any existing content inside the container before appending new UI
|
|
77
|
-
roomTreeContainer.innerHTML = '';
|
|
78
|
-
// Create the root <ul> element
|
|
79
|
-
const rootUl = document.createElement('ul');
|
|
80
|
-
rootUl.classList.add('at_room_tree');
|
|
81
|
-
// Iterate over each room
|
|
82
|
-
rooms.forEach(room => {
|
|
83
|
-
const roomItem = renderRoom(room);
|
|
84
|
-
roomTreeContainer.appendChild(roomItem);
|
|
85
|
-
if (room.children.length > 0) {
|
|
86
|
-
// Render room partitions
|
|
87
|
-
renderPartitions(room.children, room.uuid);
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
// Append the root <ul> to the #at-room-tree container
|
|
91
|
-
roomTreeContainer.appendChild(rootUl);
|
|
92
|
-
}
|
|
93
|
-
catch (error) {
|
|
94
|
-
console.error("__@ Failed to render room tree: ", error);
|
|
95
|
-
}
|
|
96
|
-
toggleSelectedRoom();
|
|
97
|
-
setRoomData(rooms);
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Renders the UI for the specified room.
|
|
101
|
-
* @param room - The details of the room to be rendered.
|
|
102
|
-
*/
|
|
103
|
-
export function renderRoom(room) {
|
|
104
|
-
const element = document.createElement('ul');
|
|
105
|
-
element.classList.add('at_room_tree');
|
|
106
|
-
element.innerHTML = `
|
|
107
|
-
<li class="at_room_tree_parent">
|
|
108
|
-
<div class="at_flex at_space_between at_toggle">
|
|
109
|
-
<span class="toggle selectable" >▶ ${room.name}</span>
|
|
110
|
-
<div>
|
|
111
|
-
<span id="at-room-edit-${room.uuid}-btn" class="mdi mdi-pencil at_room_edit_btn" target-pane="at-room-form-pane"></span>
|
|
112
|
-
<span id="at-room-visibility-${room.uuid}-btn" class="mdi mdi-eye at_room_visible_btn"></span>
|
|
113
|
-
</div>
|
|
114
|
-
</div>
|
|
115
|
-
<ul id="at-partition-container-${room.uuid}" class="hidden">
|
|
116
|
-
</ul>
|
|
117
|
-
</li>
|
|
118
|
-
`;
|
|
119
|
-
return element;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Renders the partitions for a specific room.
|
|
123
|
-
* @param roomPartitions - The details of the room partitions to be rendered.
|
|
124
|
-
* @param roomId - The identifier of the room to which the partitions belong.
|
|
125
|
-
*/
|
|
126
|
-
export function renderPartitions(roomPartitions, roomId) {
|
|
127
|
-
console.log("__@ roomPartitions: ", roomPartitions);
|
|
128
|
-
const partitionContainer = document.getElementById(`at-partition-container-${roomId}`);
|
|
129
|
-
if (partitionContainer) {
|
|
130
|
-
partitionContainer.innerHTML = '';
|
|
131
|
-
roomPartitions.forEach(partition => {
|
|
132
|
-
console.log("__@ room partition: ", partition);
|
|
133
|
-
const partitionItem = partition.name.split(' ');
|
|
134
|
-
// Append HTML to the container
|
|
135
|
-
let partitionHTML = `
|
|
136
|
-
<li class="at_room_tree_child">
|
|
137
|
-
<div class="at_flex at_space_between at_toggle">
|
|
138
|
-
<span class="toggle selectable">▶ ${i18n.t(`${partitionItem[0]}`)} ${partitionItem[1]}</span>
|
|
139
|
-
<div>
|
|
140
|
-
<span id="at-partition-visibility-${partition.uuid}-btn" class="mdi mdi-eye at_room_visible_btn"></span>
|
|
141
|
-
</div>
|
|
142
|
-
</div>
|
|
143
|
-
<ul id="at-partition-items-container-${partition.uuid}" class="hidden">
|
|
144
|
-
`;
|
|
145
|
-
const polygonJson = JSON.parse(partition.polygon_json);
|
|
146
|
-
console.log("artition polygon data: ", polygonJson);
|
|
147
|
-
if (polygonJson && polygonJson.floor && polygonJson.walls) {
|
|
148
|
-
// Render floor
|
|
149
|
-
partitionHTML += renderPartitionItems(polygonJson.floor);
|
|
150
|
-
// Render walls
|
|
151
|
-
if (polygonJson.walls.length > 0) {
|
|
152
|
-
partitionHTML += renderPartitionItems(polygonJson.walls);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
partitionHTML += `</ul></li>`;
|
|
156
|
-
partitionContainer.innerHTML += partitionHTML;
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Renders the items within a specific partition.
|
|
162
|
-
* @param partitionItems - The details of the partition items to be rendered.
|
|
163
|
-
*/
|
|
164
|
-
export function renderPartitionItems(partitionItems) {
|
|
165
|
-
console.log("__@ partitionItems: ", partitionItems);
|
|
166
|
-
let itemsHTML = '';
|
|
167
|
-
// Check if item is an array, e.g.: walls
|
|
168
|
-
if (Array.isArray(partitionItems)) {
|
|
169
|
-
// This is for the walls
|
|
170
|
-
partitionItems.forEach(item => {
|
|
171
|
-
console.log("__@ partition item: ", item);
|
|
172
|
-
// Split wall name to localize
|
|
173
|
-
const match = item.name.match(/_wall-(\d+)$/);
|
|
174
|
-
itemsHTML += `
|
|
175
|
-
<li class="at_toggle">${i18n.t(`Wall`)} ${match[1]}
|
|
176
|
-
<span id="at-partition-item-${item.uuid.substring(0, 6)}" class="mdi mdi-eye at_room_visible_btn at_pull_right"></span>
|
|
177
|
-
</li>
|
|
178
|
-
`;
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
else {
|
|
182
|
-
// This is for the floor
|
|
183
|
-
itemsHTML += `
|
|
184
|
-
<li class="at_toggle"> ${i18n.t(`${partitionItems.name}`)}
|
|
185
|
-
<span id="at-partition-item-${partitionItems.uuid.substring(0, 6)}" class="mdi mdi-eye at_room_visible_btn at_pull_right"></span>
|
|
186
|
-
</li>
|
|
187
|
-
`;
|
|
188
|
-
}
|
|
189
|
-
return itemsHTML;
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Toggles the selection state of a room.
|
|
193
|
-
*/
|
|
194
|
-
function toggleSelectedRoom() {
|
|
195
|
-
console.log("__@ toggleSelectedRoom");
|
|
196
|
-
try {
|
|
197
|
-
document.querySelectorAll('.at_room_tree .toggle, .at_room_tree .selectable').forEach(function (item) {
|
|
198
|
-
item.addEventListener('click', function (event) {
|
|
199
|
-
// Prevent event from propagating to parent elements
|
|
200
|
-
event.stopPropagation();
|
|
201
|
-
// Find the parent div of the clicked toggle
|
|
202
|
-
const parentDiv = item.closest('div');
|
|
203
|
-
// Remove the 'selected' class from all items
|
|
204
|
-
document.querySelectorAll('.selected').forEach(function (el) {
|
|
205
|
-
el.classList.remove('selected');
|
|
206
|
-
});
|
|
207
|
-
// Add the 'selected' class to the clicked item
|
|
208
|
-
item.classList.add('selected');
|
|
209
|
-
parentDiv.classList.add('selected');
|
|
210
|
-
// Toggle visibility of child items
|
|
211
|
-
let childList = parentDiv.nextElementSibling;
|
|
212
|
-
// If it's not a direct sibling (in case of nested elements like partitions), find the next <ul> at the right level
|
|
213
|
-
if (!childList || childList.tagName !== 'UL') {
|
|
214
|
-
childList = item.nextElementSibling;
|
|
215
|
-
}
|
|
216
|
-
// Toggle visibility of the child list
|
|
217
|
-
if (childList) {
|
|
218
|
-
childList.classList.toggle('hidden');
|
|
219
|
-
}
|
|
220
|
-
// Toggle the arrow without affecting #at-icons
|
|
221
|
-
if (item.textContent.trim().startsWith('▶')) {
|
|
222
|
-
item.textContent = item.textContent.replace('▶', '▼');
|
|
223
|
-
}
|
|
224
|
-
else {
|
|
225
|
-
item.textContent = item.textContent.replace('▼', '▶');
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
catch (error) {
|
|
231
|
-
console.error("__@ Failed to toggle selected room: ", error);
|
|
232
|
-
}
|
|
233
|
-
// Attach event listener
|
|
234
|
-
batchAddEventListenerByClassName('at_room_edit_btn', (event) => __awaiter(this, void 0, void 0, function* () {
|
|
235
|
-
console.log('Event', event);
|
|
236
|
-
// Prevent event from propagating up to parent elements
|
|
237
|
-
event.stopPropagation();
|
|
238
|
-
// Highlight selected item
|
|
239
|
-
highlightSelectedItem(event);
|
|
240
|
-
setPartitionFormMode("EDIT" /* FORM_MODE.EDIT */);
|
|
241
|
-
// @ts-ignore
|
|
242
|
-
setCurrentEditRoomData(event.target.id);
|
|
243
|
-
// @ts-ignore
|
|
244
|
-
toggleDisplayPane(event.target.id);
|
|
245
|
-
}));
|
|
246
|
-
batchAddEventListenerByClassName('at_room_visible_btn', (event) => __awaiter(this, void 0, void 0, function* () {
|
|
247
|
-
console.log('Event', event);
|
|
248
|
-
const target = event.target;
|
|
249
|
-
// Prevent event from propagating up to parent elements
|
|
250
|
-
event.stopPropagation();
|
|
251
|
-
// Highlight selected item
|
|
252
|
-
highlightSelectedItem(event);
|
|
253
|
-
// Handle visibility logic
|
|
254
|
-
handleRoomVisibility(target.id);
|
|
255
|
-
}));
|
|
256
|
-
}
|
|
257
|
-
/**
|
|
258
|
-
* Highlights the selected item based on the triggered event.
|
|
259
|
-
* @param event - The event object containing details about the selected item.
|
|
260
|
-
*/
|
|
261
|
-
function highlightSelectedItem(event) {
|
|
262
|
-
const target = event.target;
|
|
263
|
-
if (target) {
|
|
264
|
-
// Find the closest div or li parent to apply the 'selected' class
|
|
265
|
-
const parentDiv = target.closest('.at_toggle');
|
|
266
|
-
// Remove the 'selected' class from all items
|
|
267
|
-
document.querySelectorAll('.selected').forEach((item) => {
|
|
268
|
-
item.classList.remove('selected');
|
|
269
|
-
});
|
|
270
|
-
// Add the 'selected' class to the clicked icon's parent div
|
|
271
|
-
if (parentDiv) {
|
|
272
|
-
parentDiv.classList.add('selected');
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
// export function updateParentVisibility(isPartition: boolean, childElement: HTMLElement) {
|
|
277
|
-
// const parent = childElement.closest('ul')?.closest('li');
|
|
278
|
-
// if (!parent) return;
|
|
279
|
-
// if (isPartition && parent) {
|
|
280
|
-
// const parentEyeIcon = parent.querySelector('.at_room_visible_btn') as HTMLElement;
|
|
281
|
-
// if (parentEyeIcon) {
|
|
282
|
-
// console.log("Parent Eye Icon Element:", parentEyeIcon);
|
|
283
|
-
// if (parentEyeIcon.classList.contains('mdi-eye-off')) {
|
|
284
|
-
// parentEyeIcon.classList.remove('mdi-eye-off')
|
|
285
|
-
// parentEyeIcon.classList.add('mdi-eye')
|
|
286
|
-
// }else{
|
|
287
|
-
// parentEyeIcon.classList.remove('mdi-eye')
|
|
288
|
-
// parentEyeIcon.classList.add('mdi-eye-off')
|
|
289
|
-
// }
|
|
290
|
-
// }
|
|
291
|
-
// }
|
|
292
|
-
// }
|
|
293
|
-
export function updateParentVisibility(isPartition, currentBtn) {
|
|
294
|
-
var _a, _b, _c, _d, _e, _f;
|
|
295
|
-
const parentId = isPartition
|
|
296
|
-
? (_b = (_a = currentBtn.closest('.at_room_tree_child')) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.id
|
|
297
|
-
: (_d = (_c = currentBtn.closest('.at_room_tree_parent')) === null || _c === void 0 ? void 0 : _c.parentElement) === null || _d === void 0 ? void 0 : _d.id;
|
|
298
|
-
if (parentId) {
|
|
299
|
-
const parentVisibilityBtn = document.querySelector(`#${parentId} .mdi-eye, #${parentId} .mdi-eye-off`);
|
|
300
|
-
if (parentVisibilityBtn) {
|
|
301
|
-
// Check if all children of the parent are in the same visibility state
|
|
302
|
-
const allChildrenVisible = Array.from(((_e = parentVisibilityBtn.parentElement) === null || _e === void 0 ? void 0 : _e.querySelectorAll('.mdi-eye')) || []).length > 0;
|
|
303
|
-
const allChildrenHidden = Array.from(((_f = parentVisibilityBtn.parentElement) === null || _f === void 0 ? void 0 : _f.querySelectorAll('.mdi-eye-off')) || []).length > 0;
|
|
304
|
-
// Update the parent's visibility based on its children
|
|
305
|
-
if (allChildrenVisible && !allChildrenHidden) {
|
|
306
|
-
parentVisibilityBtn.classList.remove('mdi-eye-off');
|
|
307
|
-
parentVisibilityBtn.classList.add('mdi-eye');
|
|
308
|
-
}
|
|
309
|
-
else if (allChildrenHidden && !allChildrenVisible) {
|
|
310
|
-
parentVisibilityBtn.classList.remove('mdi-eye');
|
|
311
|
-
parentVisibilityBtn.classList.add('mdi-eye-off');
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* Sets the room data for the application.
|
|
318
|
-
* @param rooms - An array of room nodes to be stored.
|
|
319
|
-
*/
|
|
320
|
-
function setRoomData(rooms) {
|
|
321
|
-
roomDataArray = rooms;
|
|
322
|
-
}
|
|
323
|
-
/**
|
|
324
|
-
* Retrieves the stored room data.
|
|
325
|
-
* @returns An array of room nodes.
|
|
326
|
-
*/
|
|
327
|
-
function getRoomData() {
|
|
328
|
-
return roomDataArray;
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* Sets the current room data being edited based on the provided ID.
|
|
332
|
-
* @param id - The unique identifier of the room to be edited.
|
|
333
|
-
*/
|
|
334
|
-
function setCurrentEditRoomData(id) {
|
|
335
|
-
const roomUUID = extractUUID(id);
|
|
336
|
-
currentEditRoomData = getRoomData().find(room => room.uuid === roomUUID);
|
|
337
|
-
}
|
|
338
|
-
/**
|
|
339
|
-
* Retrieves the current room data being edited.
|
|
340
|
-
* @returns The current room node being edited.
|
|
341
|
-
*/
|
|
342
|
-
export function getCurrentEditRoomData() {
|
|
343
|
-
return currentEditRoomData;
|
|
344
|
-
}
|
|
345
|
-
// STATIC ROOM TREE UI
|
|
346
|
-
// <ul class="at_room_tree">
|
|
347
|
-
// <li class="at_room_tree_parent">
|
|
348
|
-
// <div class="at_flex at_space_between at_toggle">
|
|
349
|
-
// <span class="toggle selectable" >▶ Room 1</span>
|
|
350
|
-
// <div>
|
|
351
|
-
// <span id="at_edit_icon" class="mdi mdi-pencil at_edit_icon"></span>
|
|
352
|
-
// <span id="at_visible_icon" class="mdi mdi-eye at_eye_icon"></span>
|
|
353
|
-
// </div>
|
|
354
|
-
// </div>
|
|
355
|
-
// <ul class="hidden">
|
|
356
|
-
// <li class="at_room_tree_child">
|
|
357
|
-
// <div class="at_flex at_space_between at_toggle">
|
|
358
|
-
// <span class="toggle selectable" >▶ Partition 1</span>
|
|
359
|
-
// <div>
|
|
360
|
-
// <span id="at_edit_icon" class="mdi mdi-pencil at_edit_icon"></span>
|
|
361
|
-
// <span id="at_visible_icon" class="mdi mdi-eye at_eye_icon"></span>
|
|
362
|
-
// </div>
|
|
363
|
-
// </div>
|
|
364
|
-
// <ul class="hidden">
|
|
365
|
-
// <li class="at_toggle"> Floor 1
|
|
366
|
-
// <span id="at_visible_icon" class="mdi mdi-eye at_eye_icon at_pull_right"></span>
|
|
367
|
-
// </li>
|
|
368
|
-
// <li class="at_toggle"> Wall 1
|
|
369
|
-
// <span id="at_visible_icon" class="mdi mdi-eye at_eye_icon at_pull_right"></span>
|
|
370
|
-
// </li>
|
|
371
|
-
// <li class="at_toggle"> Wall 2
|
|
372
|
-
// <span id="at_visible_icon" class="mdi mdi-eye at_eye_icon at_pull_right"></span>
|
|
373
|
-
// </li>
|
|
374
|
-
// </ul>
|
|
375
|
-
// </li>
|
|
376
|
-
// </ul>
|
|
377
|
-
// </li>
|
|
378
|
-
// </ul>
|
|
379
|
-
// NOT USING INNERHTML
|
|
380
|
-
// const roomElement = document.createElement('li');
|
|
381
|
-
// roomElement.classList.add('at_room_tree_parent');
|
|
382
|
-
// const roomDiv = document.createElement('div');
|
|
383
|
-
// roomDiv.setAttribute('id', `at-room-${room.id}`)
|
|
384
|
-
// roomDiv.classList.add('at_flex', 'at_space_between', 'at_toggle');
|
|
385
|
-
// const roomTitle = document.createElement('span');
|
|
386
|
-
// roomTitle.classList.add('toggle', 'selectable');
|
|
387
|
-
// roomTitle.textContent = `▶ ${room.name}`;
|
|
388
|
-
// const roomIcons = document.createElement('div');
|
|
389
|
-
// // Edit icon
|
|
390
|
-
// const pencilIcon = document.createElement('span');
|
|
391
|
-
// pencilIcon.setAttribute('id', `at-room-edit-${room.id}-btn`)
|
|
392
|
-
// pencilIcon.classList.add('mdi', 'mdi-pencil', 'at_room_edit_btn');
|
|
393
|
-
// // Visibility icon
|
|
394
|
-
// const eyeIcon = document.createElement('span');
|
|
395
|
-
// eyeIcon.setAttribute('id', `at-room-visibility-${room.id}-btn`)
|
|
396
|
-
// eyeIcon.classList.add('mdi', 'mdi-eye', 'at_room_visible_btn');
|
|
397
|
-
// roomIcons.appendChild(pencilIcon);
|
|
398
|
-
// roomIcons.appendChild(eyeIcon);
|
|
399
|
-
// roomDiv.appendChild(roomTitle);
|
|
400
|
-
// roomDiv.appendChild(roomIcons);
|
|
401
|
-
// roomElement.appendChild(roomDiv);
|
|
402
|
-
// // Create child partition list
|
|
403
|
-
// const partitionList = document.createElement('ul');
|
|
404
|
-
// partitionList.classList.add('hidden');
|
|
405
|
-
// room.partitions.forEach(partition => {
|
|
406
|
-
// const partitionElement = document.createElement('li');
|
|
407
|
-
// partitionElement.setAttribute('id', `at-partition-${partition.id}`)
|
|
408
|
-
// partitionElement.classList.add('at_room_tree_child');
|
|
409
|
-
// const partitionDiv = document.createElement('div');
|
|
410
|
-
// partitionDiv.classList.add('at_flex', 'at_space_between', 'at_toggle');
|
|
411
|
-
// const partitionTitle = document.createElement('span');
|
|
412
|
-
// partitionTitle.classList.add('toggle', 'selectable');
|
|
413
|
-
// partitionTitle.textContent = `▶ ${partition.name}`;
|
|
414
|
-
// const partitionIcons = document.createElement('div');
|
|
415
|
-
// // Edit icon
|
|
416
|
-
// const partitionPencilIcon = document.createElement('span');
|
|
417
|
-
// partitionPencilIcon.setAttribute('id', `at-partition-edit-${partition.id}-btn`)
|
|
418
|
-
// partitionPencilIcon.classList.add('mdi', 'mdi-pencil', 'at_room_edit_btn');
|
|
419
|
-
// // Visibility icon
|
|
420
|
-
// const partitionEyeIcon = document.createElement('span');
|
|
421
|
-
// partitionEyeIcon.setAttribute('id', `at-partition-visibility-${partition.id}-btn`)
|
|
422
|
-
// partitionEyeIcon.classList.add('mdi', 'mdi-eye', 'at_room_visible_btn');
|
|
423
|
-
// partitionIcons.appendChild(partitionPencilIcon);
|
|
424
|
-
// partitionIcons.appendChild(partitionEyeIcon);
|
|
425
|
-
// partitionDiv.appendChild(partitionTitle);
|
|
426
|
-
// partitionDiv.appendChild(partitionIcons);
|
|
427
|
-
// partitionElement.appendChild(partitionDiv);
|
|
428
|
-
// // Create child items (floor, wall, etc.)
|
|
429
|
-
// const itemList = document.createElement('ul');
|
|
430
|
-
// itemList.classList.add('hidden');
|
|
431
|
-
// partition.items.forEach(item => {
|
|
432
|
-
// const itemElement = document.createElement('li');
|
|
433
|
-
// itemElement.setAttribute('id', `at-partition-item-${item.id}`)
|
|
434
|
-
// itemElement.classList.add('at_toggle');
|
|
435
|
-
// itemElement.textContent = item.name;
|
|
436
|
-
// // Visibility icon
|
|
437
|
-
// const eyeIconForItem = document.createElement('span');
|
|
438
|
-
// eyeIconForItem.setAttribute('id', `at-partition-item-${item.id}`)
|
|
439
|
-
// eyeIconForItem.classList.add('mdi', 'mdi-eye', 'at_room_visible_btn', 'at_pull_right');
|
|
440
|
-
// itemElement.appendChild(eyeIconForItem);
|
|
441
|
-
// itemList.appendChild(itemElement);
|
|
442
|
-
// });
|
|
443
|
-
// partitionElement.appendChild(itemList);
|
|
444
|
-
// partitionList.appendChild(partitionElement);
|
|
445
|
-
// });
|
|
446
|
-
// roomElement.appendChild(partitionList);
|
|
447
|
-
// rootUl.appendChild(roomElement);
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { FORM_MODE, ITagIOTCategory, ITagIOTDevice } from '../../../types';
|
|
2
|
-
export declare let iotTagFormMode: FORM_MODE;
|
|
3
|
-
export declare function renderTagIOTForm(): HTMLDivElement;
|
|
4
|
-
export declare function setIotCategoryOptions(): void;
|
|
5
|
-
export declare function toggleIoTCategoryOptions(): void;
|
|
6
|
-
export declare function toggleIoTDevicesOptions(): void;
|
|
7
|
-
export declare function setSelectedIoTSystemRadio(payload: string): void;
|
|
8
|
-
export declare function clearIoTDropdowns(): void;
|
|
9
|
-
export declare function initIoTFormData(): void;
|
|
10
|
-
export declare function renderIotCategoryDropdownOptions(elementId: string, items: Array<ITagIOTCategory>): void;
|
|
11
|
-
export declare function setIotDeviceOptions(): void;
|
|
12
|
-
export declare function renderIotDeviceDropdownOptions(elementId: string, items: Array<ITagIOTDevice>): void;
|
|
13
|
-
export declare function getIotTagFormData(): {
|
|
14
|
-
tagName: string;
|
|
15
|
-
modelName: string;
|
|
16
|
-
serialName: string;
|
|
17
|
-
tagMf: string;
|
|
18
|
-
tagCategoryId: string;
|
|
19
|
-
systemLink?: string;
|
|
20
|
-
};
|