architwin 1.13.3 → 1.13.5
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/atwinui/components/toolbar/objectListPane.d.ts +5 -1
- package/lib/atwinui/components/toolbar/objectListPane.js +70 -0
- package/lib/atwinui/components/toolbar/tagListPane.d.ts +5 -1
- package/lib/atwinui/components/toolbar/tagListPane.js +77 -1
- package/lib/atwinui/events.js +83 -11
- package/lib/types.d.ts +44 -0
- package/lib/types.js +12 -0
- package/package.json +1 -1
- package/static/atwinui.css +34 -0
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import { IShowcaseObject } from "../../../types";
|
|
1
|
+
import { IShowcaseObject, SortConfig } from "../../../types";
|
|
2
2
|
import { Scene } from "../../../../bundle/sdk";
|
|
3
|
+
export declare let selectedObjectSortOption: SortConfig;
|
|
3
4
|
export declare function renderObjectListPane(cardList: Array<IShowcaseObject>): HTMLElement;
|
|
4
5
|
export declare function renderObjectCards(cardList: Array<IShowcaseObject>, objectComponents?: Array<Scene.IComponent>): void;
|
|
5
6
|
export declare function addObjectCard(objectCards: HTMLElement, payload: IShowcaseObject): void;
|
|
6
7
|
export declare function removeObjectCard(elementId: string): void;
|
|
7
8
|
export declare function updateObjectCard(objectCards: HTMLElement, payload: IShowcaseObject): void;
|
|
8
9
|
export declare function renderObjectList(cardList: Array<IShowcaseObject>, objectComponents?: Array<Scene.IComponent>): void;
|
|
10
|
+
export declare const sortShowcaseObjects: (items: IShowcaseObject[], options: SortConfig) => IShowcaseObject[];
|
|
11
|
+
export declare function updateSelectedObjectSortOption(textSortOption: string): void;
|
|
12
|
+
export declare function resetSelectedObjectSortOption(): void;
|
|
@@ -7,12 +7,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
+
import { sortObjectOptions } from "../../../types";
|
|
10
11
|
import { renderObjectCard, renderObjectRow, setActiveCard } from "./card";
|
|
11
12
|
import { batchAddEventListenerByClassName, toggleActionBar, handleModelVisibility, handleDeleteModel } from "../../events";
|
|
12
13
|
import i18n from './i18n';
|
|
13
14
|
import { setModalAction, toggleModal } from "./modal";
|
|
14
15
|
import { getBundleVersion } from "../../../utils";
|
|
15
16
|
import { toggleModelControl } from "./modelControlsPane";
|
|
17
|
+
export let selectedObjectSortOption = { by: 'showcase_object_name', order: 'asc' };
|
|
16
18
|
export function renderObjectListPane(cardList) {
|
|
17
19
|
const element = document.createElement('div');
|
|
18
20
|
element.classList.add('at_container');
|
|
@@ -37,6 +39,14 @@ export function renderObjectListPane(cardList) {
|
|
|
37
39
|
<div class="at_button at_ghost" id="at-models-list-view-btn" data-cy="at-models-list-view-btn">
|
|
38
40
|
<span class="mdi mdi-list-box"></span>
|
|
39
41
|
</div>
|
|
42
|
+
<div id="at-object-sort-icon" class="mdi mdi-filter mdi-24px at_icon_hover">
|
|
43
|
+
<span id="at-object-sort-options-tooltip" class="at_custom_tooltip">
|
|
44
|
+
<p class="at_object_sort_option at_sort_option_selected">Ascending</p>
|
|
45
|
+
<p class="at_object_sort_option">Descending</p>
|
|
46
|
+
<p class="at_object_sort_option">Newest</p>
|
|
47
|
+
<p class="at_object_sort_option">Oldest</p>
|
|
48
|
+
</span>
|
|
49
|
+
</div>
|
|
40
50
|
</div>
|
|
41
51
|
<div class="at_scrollable_container at_h-min-60" id="at-object-cards" data-cy="at-object-cards">
|
|
42
52
|
|
|
@@ -158,6 +168,7 @@ export function updateObjectCard(objectCards, payload) {
|
|
|
158
168
|
targetCard.textContent = payload.object_data.name;
|
|
159
169
|
}
|
|
160
170
|
}
|
|
171
|
+
// IShowcaseObject.object_data.filename (asc | desc), IShowcaseObject.created_on (newest | oldest)
|
|
161
172
|
export function renderObjectList(cardList, objectComponents) {
|
|
162
173
|
console.log("renderObjectList(): ", objectComponents);
|
|
163
174
|
const objectList = document.getElementById('at-object-cards');
|
|
@@ -222,3 +233,62 @@ export function renderObjectList(cardList, objectComponents) {
|
|
|
222
233
|
objectList.innerHTML = '<p>No objects in space</p>';
|
|
223
234
|
}
|
|
224
235
|
}
|
|
236
|
+
export const sortShowcaseObjects = (items, options) => {
|
|
237
|
+
if (!(items === null || items === void 0 ? void 0 : items.length))
|
|
238
|
+
return [];
|
|
239
|
+
return [...items].sort((a, b) => {
|
|
240
|
+
var _a, _b;
|
|
241
|
+
let comparison = 0;
|
|
242
|
+
if (options.by === 'showcase_object_name') {
|
|
243
|
+
// Sort by object_data.filename
|
|
244
|
+
const filenameA = (_a = a.showcase_object_name) !== null && _a !== void 0 ? _a : '';
|
|
245
|
+
const filenameB = (_b = b.showcase_object_name) !== null && _b !== void 0 ? _b : '';
|
|
246
|
+
// Use natural sorting for filenames (handles numbers in names correctly)
|
|
247
|
+
comparison = filenameA.localeCompare(filenameB, undefined, {
|
|
248
|
+
numeric: true,
|
|
249
|
+
sensitivity: 'base',
|
|
250
|
+
caseFirst: 'lower'
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
else if (options.by === 'created_on') {
|
|
254
|
+
// Sort by created_on date
|
|
255
|
+
const dateA = a.object_data.created_on ? new Date(a.object_data.created_on).getTime() : 0;
|
|
256
|
+
const dateB = b.object_data.created_on ? new Date(b.object_data.created_on).getTime() : 0;
|
|
257
|
+
comparison = dateA - dateB;
|
|
258
|
+
}
|
|
259
|
+
// Apply sort order
|
|
260
|
+
return options.order === 'desc' ? -comparison : comparison;
|
|
261
|
+
});
|
|
262
|
+
};
|
|
263
|
+
export function updateSelectedObjectSortOption(textSortOption) {
|
|
264
|
+
selectedObjectSortOption = sortObjectOptions[textSortOption] || { by: 'label', order: 'asc' };
|
|
265
|
+
const tooltip = document.getElementById('at-object-sort-options-tooltip');
|
|
266
|
+
const options = tooltip.querySelectorAll('.at_object_sort_option');
|
|
267
|
+
options.forEach((option) => {
|
|
268
|
+
if (option.innerText === textSortOption) {
|
|
269
|
+
option.classList.add('at_sort_option_selected');
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
option.style.backgroundColor = '';
|
|
273
|
+
option.classList.remove('at_sort_option_selected');
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
export function resetSelectedObjectSortOption() {
|
|
278
|
+
selectedObjectSortOption = { by: 'showcase_object_name', order: 'asc' };
|
|
279
|
+
const tooltip = document.getElementById('at-object-sort-options-tooltip');
|
|
280
|
+
if (tooltip) {
|
|
281
|
+
const options = tooltip.querySelectorAll('.at_object_sort_option');
|
|
282
|
+
if (options) {
|
|
283
|
+
options.forEach((option) => {
|
|
284
|
+
if (option.innerText === 'Ascending') {
|
|
285
|
+
option.classList.add('at_sort_option_selected');
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
option.style.backgroundColor = '';
|
|
289
|
+
option.classList.remove('at_sort_option_selected');
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ITag, ITagCategory } from "../../../types";
|
|
1
|
+
import { ITag, ITagCategory, SortConfig } from "../../../types";
|
|
2
2
|
import { MpSdk } from "../../../../bundle/sdk";
|
|
3
3
|
export declare let selectedCategoryFilterId: any;
|
|
4
4
|
export declare let selectedSubCategoryFilterId: any;
|
|
5
|
+
export declare let selectedTagSortOption: SortConfig;
|
|
5
6
|
export declare function renderTagListPane(): HTMLElement;
|
|
6
7
|
export declare function isTagPartOfCategory(categoryUUID: string): boolean;
|
|
7
8
|
export declare function renderTags(tags: Array<ITag>, showOwnTagsOnly?: boolean): void;
|
|
@@ -17,3 +18,6 @@ export declare function getSearchTagTerm(): string;
|
|
|
17
18
|
export declare function searchTagList(tags: Array<ITag>): Array<ITag>;
|
|
18
19
|
export declare function setSearchTagTerm(searchTagName: string): void;
|
|
19
20
|
export declare function searchClearfield(): void;
|
|
21
|
+
export declare const sortTags: (items: ITag[], options: SortConfig) => ITag[];
|
|
22
|
+
export declare function updateSelectedTagSortOption(textSortOption: string): void;
|
|
23
|
+
export declare function resetSelectedTagSortOption(): void;
|
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { SPACE_EVENTS } from "../../../types";
|
|
10
|
+
import { SPACE_EVENTS, sortTagOptions } from "../../../types";
|
|
11
11
|
import { batchAddEventListenerByClassName, toggleDisplayPane, batchAddEventListenerByDataAttribute } from "../../events";
|
|
12
12
|
import { convertToCssRgb, getBundleVersion } from "../../../utils";
|
|
13
13
|
import { gotoTag, disposeTag, dispatchSpaceEvent, _tags, getUserAssignedCategories, _mpConfig } from "../../../architwin";
|
|
@@ -24,6 +24,7 @@ let allSubcategories = [];
|
|
|
24
24
|
let tagSearchTerm = '';
|
|
25
25
|
export let selectedCategoryFilterId = undefined;
|
|
26
26
|
export let selectedSubCategoryFilterId = undefined;
|
|
27
|
+
export let selectedTagSortOption = { by: 'label', order: 'asc' };
|
|
27
28
|
export function renderTagListPane() {
|
|
28
29
|
const element = document.createElement('div');
|
|
29
30
|
element.classList.add('at_container');
|
|
@@ -36,6 +37,16 @@ export function renderTagListPane() {
|
|
|
36
37
|
<span>${i18n.t('Tags')}</span>
|
|
37
38
|
</div>
|
|
38
39
|
<div class="at_form_container at_h-min-65 at_tag_list_pane">
|
|
40
|
+
<div class="at_sort_btn_container">
|
|
41
|
+
<div id="at-tag-sort-icon" class="mdi mdi-filter mdi-24px at_icon_hover">
|
|
42
|
+
<span id="at-tag-sort-options-tooltip" class="at_custom_tooltip">
|
|
43
|
+
<p class="at_tag_sort_option at_sort_option_selected">Ascending</p>
|
|
44
|
+
<p class="at_tag_sort_option">Descending</p>
|
|
45
|
+
<p class="at_tag_sort_option">Newest</p>
|
|
46
|
+
<p class="at_tag_sort_option">Oldest</p>
|
|
47
|
+
</span>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
39
50
|
<div class="at_flex_row">
|
|
40
51
|
<input class="at_field_search_input" type="text" name="search_name" id="at-tag-name-search" data-cy="at-tag-name-search" placeholder=${i18n.t('Search...')}>
|
|
41
52
|
<span class="mdi mdi-close at_button_search_tag" id="at-clear-search-tag-name" style="display:none"></span>
|
|
@@ -357,6 +368,7 @@ export function addClickEventToTagRow(tag) {
|
|
|
357
368
|
// }
|
|
358
369
|
// return filteredByCategory
|
|
359
370
|
// }
|
|
371
|
+
// ITag.json_data.label (asc | desc), ITag.created_on (newest | oldest)
|
|
360
372
|
export function filterTagList(tags) {
|
|
361
373
|
log.info("filterTagList()", tags);
|
|
362
374
|
if (tagSearchTerm && (!selectedCategoryFilterId && selectedCategoryFilterId !== '')) {
|
|
@@ -486,3 +498,67 @@ export function searchClearfield() {
|
|
|
486
498
|
tagSearchTerm = '';
|
|
487
499
|
}
|
|
488
500
|
}
|
|
501
|
+
export const sortTags = (items, options) => {
|
|
502
|
+
if (!(items === null || items === void 0 ? void 0 : items.length))
|
|
503
|
+
return [];
|
|
504
|
+
return [...items].sort((a, b) => {
|
|
505
|
+
var _a, _b, _c, _d;
|
|
506
|
+
let comparison = 0;
|
|
507
|
+
if (options.by === 'label') {
|
|
508
|
+
// Sort by json_data.label
|
|
509
|
+
const labelA = (_b = (_a = a.json_data) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : '';
|
|
510
|
+
const labelB = (_d = (_c = b.json_data) === null || _c === void 0 ? void 0 : _c.label) !== null && _d !== void 0 ? _d : '';
|
|
511
|
+
// Handle different types - numbers vs strings
|
|
512
|
+
if (typeof labelA === 'number' && typeof labelB === 'number') {
|
|
513
|
+
comparison = labelA - labelB;
|
|
514
|
+
}
|
|
515
|
+
else {
|
|
516
|
+
// Convert to strings for consistent comparison
|
|
517
|
+
comparison = String(labelA).localeCompare(String(labelB), undefined, {
|
|
518
|
+
numeric: true,
|
|
519
|
+
sensitivity: 'base'
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
else if (options.by === 'created_on') {
|
|
524
|
+
// Sort by created_on date
|
|
525
|
+
const dateA = a.created_on ? new Date(a.created_on).getTime() : 0;
|
|
526
|
+
const dateB = b.created_on ? new Date(b.created_on).getTime() : 0;
|
|
527
|
+
comparison = dateA - dateB;
|
|
528
|
+
}
|
|
529
|
+
// Apply sort order
|
|
530
|
+
return options.order === 'desc' ? -comparison : comparison;
|
|
531
|
+
});
|
|
532
|
+
};
|
|
533
|
+
export function updateSelectedTagSortOption(textSortOption) {
|
|
534
|
+
selectedTagSortOption = sortTagOptions[textSortOption] || { by: 'label', order: 'asc' };
|
|
535
|
+
const tooltip = document.getElementById('at-tag-sort-options-tooltip');
|
|
536
|
+
const options = tooltip.querySelectorAll('.at_tag_sort_option');
|
|
537
|
+
options.forEach((option) => {
|
|
538
|
+
if (option.innerText === textSortOption) {
|
|
539
|
+
option.classList.add('at_sort_option_selected');
|
|
540
|
+
}
|
|
541
|
+
else {
|
|
542
|
+
option.style.backgroundColor = '';
|
|
543
|
+
option.classList.remove('at_sort_option_selected');
|
|
544
|
+
}
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
export function resetSelectedTagSortOption() {
|
|
548
|
+
selectedTagSortOption = { by: 'label', order: 'asc' };
|
|
549
|
+
const tooltip = document.getElementById('at-tag-sort-options-tooltip');
|
|
550
|
+
if (tooltip) {
|
|
551
|
+
const options = tooltip.querySelectorAll('.at_tag_sort_option');
|
|
552
|
+
if (options) {
|
|
553
|
+
options.forEach((option) => {
|
|
554
|
+
if (option.innerText === 'Ascending') {
|
|
555
|
+
option.classList.add('at_sort_option_selected');
|
|
556
|
+
}
|
|
557
|
+
else {
|
|
558
|
+
option.style.backgroundColor = '';
|
|
559
|
+
option.classList.remove('at_sort_option_selected');
|
|
560
|
+
}
|
|
561
|
+
});
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}
|
package/lib/atwinui/events.js
CHANGED
|
@@ -11,9 +11,9 @@ import { actionBar, renderObjectCards, renderLibraryCards, renderTags, renderTag
|
|
|
11
11
|
import { getTargetPosition, addMediaScreen, _3DXObjects, selectedObject, setTransformControls, copyObject, revertTransform, clearSelectedObject, removeTransformControls, getLibrary, getMpTags, renderTag, captureSpaceScreenshot, moveTag, subscribeSpaceEvent, setModelVisibility, disposeModel, disposeTag, _tags, _tagCategories, dispatchSpaceEvent, editTagLabel, editTagDescription, setTagMessageRecepients, setTagMessages, setSelectedTagUuid, renderMeetingSidebar, setTagIcon, setObjectTransformation, getSelectedObject, _atwin, isCdnMapDataAvailable, captureScreenshotAndCameraDetails, _mpConfig, cancelModelPlacement, _modelDetails, actionHistory, get3DXObjects, transformHistory, goToModel, themeManager, _partitionNodes, setSpacePartitionNodes, getSpaceId, setFloorBaseHeight, toggleWallVisibility, getChildrenOfModel, toggleFloorVisibility, renderPolygon, getCurrentPolygon, getFloorBaseHeight, setSelectedObject, redoDrawAction, undoDrawAction, setWallBaseHeight, clearWallBaseHeight, clearFloorBaseHeight, isToolbarFeatureEnabled, captureCurrentView, getCurrentFloor, setPipeCategories, setPipes, detachTagMedia, getTagDataCollection } from "../architwin";
|
|
12
12
|
import { Notyf } from 'notyf';
|
|
13
13
|
import 'notyf/notyf.min.css';
|
|
14
|
-
import { SPACE_EVENTS, COORDINATE_SYSTEM, UNITS, DEGREE, MAP_OPTIONS, CUSTOM_MAP_MODE } from "../types";
|
|
14
|
+
import { SPACE_EVENTS, COORDINATE_SYSTEM, UNITS, DEGREE, MAP_OPTIONS, sortTagOptions, sortObjectOptions, CUSTOM_MAP_MODE } from "../types";
|
|
15
15
|
import { initFormData, setTagFormMode } from "./components/toolbar/tagFormPane";
|
|
16
|
-
import { renderObjectList } from "./components/toolbar/objectListPane";
|
|
16
|
+
import { renderObjectList, resetSelectedObjectSortOption, selectedObjectSortOption, sortShowcaseObjects, updateSelectedObjectSortOption } from "./components/toolbar/objectListPane";
|
|
17
17
|
import { renderLibraryList } from "./components/toolbar/libraryPane";
|
|
18
18
|
import { renderObjectCard } from "./components/toolbar/card";
|
|
19
19
|
import { toggleModelControl, getCoordinateValues, showCurrentCoordinateValue, handleModelControlInputs, setSelectedObjectCoordinateSystem, getSelectedObjectCoordinateSystem, getCurrentTransformationValues, setCurrentTransformationValues, getTransformValues, clearCurrentTransformationValues } from "./components/toolbar/modelControlsPane";
|
|
@@ -28,7 +28,7 @@ import { toggleDrawPartitionButton, displayPartitionFormMode, setPartitionFormMo
|
|
|
28
28
|
import { actionSettingsSelectOption, getTempCoordinateSystem, getTempMeasurementUnit, getTempRotationUnit, setCoordinateSystem, setMeasurementUnit, setRotationUnit, initSettingsValues, setTempCoordinateSystem, setTempMeasurementUnit, setTempRotationUnit, toggleActionSettingsDropdown, toggleCalibrateBasepoint, setScaleFactor, getTempScaleFactor, setTempScaleFactor, setBasepoint, getTempBasepoint, setTempBasepoint, getBasepoint, toggleActionSettings, getBasepointObjectPayload, displayConvertedCoordinates, getCoordinateSystem, getScaleFactor, getMeasurementUnit, getRotationUnit, setBasepointObjectPayload } from "./components/toolbar/actionSettingsPane";
|
|
29
29
|
import { getBasepointCalibrateBpCoordinateValues, getBasepointCalibrateMpCoordinateValues, initBsepointCalibratePane, toggleBasepointCalibratePane } from "./components/toolbar/basepointCalibratePane";
|
|
30
30
|
import { toggleGeneralMapOptions, initGeneralSelectedMap, getSelectedMapOption } from './components/toolbar/generalSettingsMenuPane';
|
|
31
|
-
import { searchTagList, setSearchTagTerm, searchClearfield, getSearchTagTerm } from './components/toolbar/tagListPane';
|
|
31
|
+
import { searchTagList, setSearchTagTerm, searchClearfield, getSearchTagTerm, sortTags, updateSelectedTagSortOption, resetSelectedTagSortOption } from './components/toolbar/tagListPane';
|
|
32
32
|
import { PipeList } from "./components/toolbar/pipeListPane";
|
|
33
33
|
import { PipeForm } from "./components/toolbar/pipeFormPane";
|
|
34
34
|
// import { EditPipeForm, initPipeFormPane, pipeFormData, setPipeFormMode } from "./components/toolbar/pipeFormPane";
|
|
@@ -175,13 +175,15 @@ function toggleDisplayPane(targetId) {
|
|
|
175
175
|
if (paneId === 'at-object-list-pane') {
|
|
176
176
|
const objectsInSpace = get3DXObjects();
|
|
177
177
|
const objectComponents = objectsInSpace.map(obj => obj.component);
|
|
178
|
-
const spaceObjects = objectsInSpace.filter(obj => obj.type !== 'POLYGON' && obj.type !== 'BASEPOINT').map(obj => obj.object);
|
|
179
|
-
|
|
178
|
+
const spaceObjects = objectsInSpace.filter(obj => obj.type !== 'POLYGON' && obj.type !== 'BASEPOINT' && obj.type !== "PATH").map(obj => obj.object);
|
|
179
|
+
const sortedObjects = sortShowcaseObjects(spaceObjects, { by: 'showcase_object_name', order: 'asc' });
|
|
180
|
+
renderObjectCards(sortedObjects, objectComponents);
|
|
180
181
|
if (targetId === 'at-cancel-library-btn') {
|
|
181
182
|
yield cancelModelPlacement();
|
|
182
183
|
}
|
|
183
184
|
}
|
|
184
185
|
else {
|
|
186
|
+
resetSelectedObjectSortOption();
|
|
185
187
|
clearSelectedObject();
|
|
186
188
|
removeTransformControls();
|
|
187
189
|
}
|
|
@@ -205,10 +207,12 @@ function toggleDisplayPane(targetId) {
|
|
|
205
207
|
const tags = getMpTags();
|
|
206
208
|
if (selectedCategoryFilterId || selectedSubCategoryFilterId) {
|
|
207
209
|
const filteredTags = filterTagList(tags);
|
|
208
|
-
|
|
210
|
+
const sortedTags = sortTags(filteredTags, { by: 'label', order: 'asc' });
|
|
211
|
+
renderTags(sortedTags);
|
|
209
212
|
}
|
|
210
213
|
else if (tags.length > 0) {
|
|
211
|
-
|
|
214
|
+
const sortedTags = sortTags(tags, { by: 'label', order: 'asc' });
|
|
215
|
+
renderTags(sortedTags, true);
|
|
212
216
|
}
|
|
213
217
|
//Render the category dropdown elements if tagCategories is populated
|
|
214
218
|
if (_tagCategories && _tagCategories.length > 0) {
|
|
@@ -220,6 +224,9 @@ function toggleDisplayPane(targetId) {
|
|
|
220
224
|
searchTagList(tags);
|
|
221
225
|
}
|
|
222
226
|
}
|
|
227
|
+
else {
|
|
228
|
+
resetSelectedTagSortOption();
|
|
229
|
+
}
|
|
223
230
|
if (paneId === 'at-tag-form-pane') {
|
|
224
231
|
log.info("Tag Form Pane");
|
|
225
232
|
setTagFormMode("ADD" /* FORM_MODE.ADD */);
|
|
@@ -358,6 +365,8 @@ function setupIndividualEventListeners() {
|
|
|
358
365
|
handleCloseCustomMinimap();
|
|
359
366
|
handleCustomMapControls();
|
|
360
367
|
handleCloseActiveMinimap();
|
|
368
|
+
handleClickEventInTagSortOption();
|
|
369
|
+
handleClickEventInObjectSortOption();
|
|
361
370
|
handlePipeForm();
|
|
362
371
|
handlePipeList();
|
|
363
372
|
}
|
|
@@ -1500,18 +1509,20 @@ function handleSetModelsView() {
|
|
|
1500
1509
|
modelsListViewBtn.classList.remove('at_ghost_active');
|
|
1501
1510
|
modelsView = 'card';
|
|
1502
1511
|
log.info("modelCardViewBtn", modelsView);
|
|
1503
|
-
const spaceObjects = _3DXObjects.filter(obj => obj.type !== 'POLYGON' && obj.type !== "BASEPOINT").map(obj => obj.object);
|
|
1512
|
+
const spaceObjects = _3DXObjects.filter(obj => obj.type !== 'POLYGON' && obj.type !== "BASEPOINT" && obj.type !== "PATH").map(obj => obj.object);
|
|
1504
1513
|
const objectComponents = _3DXObjects.map(obj => obj.component);
|
|
1505
|
-
|
|
1514
|
+
const sortedObjects = sortShowcaseObjects(spaceObjects, selectedObjectSortOption);
|
|
1515
|
+
renderObjectCards(sortedObjects, objectComponents);
|
|
1506
1516
|
});
|
|
1507
1517
|
modelsListViewBtn.addEventListener('click', () => {
|
|
1508
1518
|
modelsListViewBtn.classList.add('at_ghost_active');
|
|
1509
1519
|
modelsCardViewBtn.classList.remove('at_ghost_active');
|
|
1510
1520
|
modelsView = 'list';
|
|
1511
1521
|
log.info("modelListViewBtn", modelsView);
|
|
1512
|
-
const spaceObjects = _3DXObjects.filter(obj => obj.type !== "POLYGON" && obj.type !== "BASEPOINT").map(obj => obj.object);
|
|
1522
|
+
const spaceObjects = _3DXObjects.filter(obj => obj.type !== "POLYGON" && obj.type !== "BASEPOINT" && obj.type !== "PATH").map(obj => obj.object);
|
|
1513
1523
|
const objectComponents = _3DXObjects.map(obj => obj.component);
|
|
1514
|
-
|
|
1524
|
+
const sortedObjects = sortShowcaseObjects(spaceObjects, selectedObjectSortOption);
|
|
1525
|
+
renderObjectList(sortedObjects, objectComponents);
|
|
1515
1526
|
});
|
|
1516
1527
|
}
|
|
1517
1528
|
function handleSetLibraryModelsView() {
|
|
@@ -3059,6 +3070,67 @@ function handleCloseActiveMinimap() {
|
|
|
3059
3070
|
});
|
|
3060
3071
|
}
|
|
3061
3072
|
}
|
|
3073
|
+
function handleClickEventInTagSortOption() {
|
|
3074
|
+
const sortIcon = document.getElementById('at-tag-sort-icon');
|
|
3075
|
+
let clickListenerAdded = false;
|
|
3076
|
+
if (sortIcon) {
|
|
3077
|
+
sortIcon.addEventListener('mouseover', () => {
|
|
3078
|
+
const sortTooltip = document.getElementById('at-tag-sort-options-tooltip');
|
|
3079
|
+
// console.log('Tooltip ready:', !!sortTooltip)
|
|
3080
|
+
// Only add the click listener once
|
|
3081
|
+
if (sortTooltip && !clickListenerAdded) {
|
|
3082
|
+
clickListenerAdded = true;
|
|
3083
|
+
sortTooltip.addEventListener('click', (event) => {
|
|
3084
|
+
const target = event.target;
|
|
3085
|
+
const closestOption = target.closest('.at_tag_sort_option');
|
|
3086
|
+
if (closestOption) {
|
|
3087
|
+
const innerText = closestOption.innerText;
|
|
3088
|
+
updateSelectedTagSortOption(innerText);
|
|
3089
|
+
const tags = getMpTags();
|
|
3090
|
+
const filteredTags = filterTagList(tags);
|
|
3091
|
+
const sortConfig = sortTagOptions[innerText] || { by: 'label', order: 'asc' };
|
|
3092
|
+
if (selectedCategoryFilterId || selectedSubCategoryFilterId) {
|
|
3093
|
+
const sortedTags = sortTags(filteredTags, sortConfig);
|
|
3094
|
+
renderTags(sortedTags);
|
|
3095
|
+
}
|
|
3096
|
+
else if (tags.length > 0) {
|
|
3097
|
+
const sortedTags = sortTags(tags, sortConfig);
|
|
3098
|
+
renderTags(sortedTags);
|
|
3099
|
+
}
|
|
3100
|
+
}
|
|
3101
|
+
});
|
|
3102
|
+
}
|
|
3103
|
+
});
|
|
3104
|
+
}
|
|
3105
|
+
}
|
|
3106
|
+
function handleClickEventInObjectSortOption() {
|
|
3107
|
+
const sortIcon = document.getElementById('at-object-sort-icon');
|
|
3108
|
+
let clickListenerAdded = false;
|
|
3109
|
+
if (sortIcon) {
|
|
3110
|
+
sortIcon.addEventListener('mouseover', () => {
|
|
3111
|
+
const sortTooltip = document.getElementById('at-object-sort-options-tooltip');
|
|
3112
|
+
// console.log('Tooltip ready:', !!sortTooltip)
|
|
3113
|
+
// Only add the click listener once
|
|
3114
|
+
if (sortTooltip && !clickListenerAdded) {
|
|
3115
|
+
clickListenerAdded = true;
|
|
3116
|
+
sortTooltip.addEventListener('click', (event) => {
|
|
3117
|
+
const target = event.target;
|
|
3118
|
+
const closestOption = target.closest('.at_object_sort_option');
|
|
3119
|
+
if (closestOption) {
|
|
3120
|
+
const innerText = closestOption.innerText;
|
|
3121
|
+
updateSelectedObjectSortOption(innerText);
|
|
3122
|
+
const objectsInSpace = get3DXObjects();
|
|
3123
|
+
const objectComponents = objectsInSpace.map(obj => obj.component);
|
|
3124
|
+
const spaceObjects = objectsInSpace.filter(obj => obj.type !== 'POLYGON' && obj.type !== 'BASEPOINT').map(obj => obj.object);
|
|
3125
|
+
const sortConfig = sortObjectOptions[innerText] || { by: 'label', order: 'asc' };
|
|
3126
|
+
const sortedObjects = sortShowcaseObjects(spaceObjects, sortConfig);
|
|
3127
|
+
renderObjectCards(sortedObjects, objectComponents);
|
|
3128
|
+
}
|
|
3129
|
+
});
|
|
3130
|
+
}
|
|
3131
|
+
});
|
|
3132
|
+
}
|
|
3133
|
+
}
|
|
3062
3134
|
export {
|
|
3063
3135
|
//state
|
|
3064
3136
|
activeToolbarItem, activeActionItem, cancelModelPlacementPrompt, isCustomMapControlsVisible, pipeColor,
|
package/lib/types.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export interface ITag {
|
|
|
29
29
|
category_uuid?: string;
|
|
30
30
|
uuid?: string;
|
|
31
31
|
media_url?: string;
|
|
32
|
+
created_on?: string;
|
|
32
33
|
}
|
|
33
34
|
export interface ITagCategory {
|
|
34
35
|
uuid: string;
|
|
@@ -237,6 +238,7 @@ export interface IShowcaseObject {
|
|
|
237
238
|
object_data: I3DObject;
|
|
238
239
|
coordinate_system?: string;
|
|
239
240
|
json_data?: string;
|
|
241
|
+
created_on?: string;
|
|
240
242
|
}
|
|
241
243
|
export interface IVideoObject {
|
|
242
244
|
data: IShowcaseObject;
|
|
@@ -1338,6 +1340,48 @@ export declare enum MAP_OPTIONS {
|
|
|
1338
1340
|
DEFAULT_MAP = "Default Minimap",
|
|
1339
1341
|
CUSTOM_MAP = "Custom Minimap"
|
|
1340
1342
|
}
|
|
1343
|
+
export type SortBy = 'label' | 'showcase_object_name' | 'created_on';
|
|
1344
|
+
export type SortOrder = 'asc' | 'desc';
|
|
1345
|
+
export interface SortConfig {
|
|
1346
|
+
by: SortBy;
|
|
1347
|
+
order: SortOrder;
|
|
1348
|
+
}
|
|
1349
|
+
export declare const sortTagOptions: {
|
|
1350
|
+
readonly Ascending: {
|
|
1351
|
+
readonly by: "label";
|
|
1352
|
+
readonly order: "asc";
|
|
1353
|
+
};
|
|
1354
|
+
readonly Descending: {
|
|
1355
|
+
readonly by: "label";
|
|
1356
|
+
readonly order: "desc";
|
|
1357
|
+
};
|
|
1358
|
+
readonly Newest: {
|
|
1359
|
+
readonly by: "created_on";
|
|
1360
|
+
readonly order: "desc";
|
|
1361
|
+
};
|
|
1362
|
+
readonly Oldest: {
|
|
1363
|
+
readonly by: "created_on";
|
|
1364
|
+
readonly order: "asc";
|
|
1365
|
+
};
|
|
1366
|
+
};
|
|
1367
|
+
export declare const sortObjectOptions: {
|
|
1368
|
+
readonly Ascending: {
|
|
1369
|
+
readonly by: "showcase_object_name";
|
|
1370
|
+
readonly order: "asc";
|
|
1371
|
+
};
|
|
1372
|
+
readonly Descending: {
|
|
1373
|
+
readonly by: "showcase_object_name";
|
|
1374
|
+
readonly order: "desc";
|
|
1375
|
+
};
|
|
1376
|
+
readonly Newest: {
|
|
1377
|
+
readonly by: "created_on";
|
|
1378
|
+
readonly order: "desc";
|
|
1379
|
+
};
|
|
1380
|
+
readonly Oldest: {
|
|
1381
|
+
readonly by: "created_on";
|
|
1382
|
+
readonly order: "asc";
|
|
1383
|
+
};
|
|
1384
|
+
};
|
|
1341
1385
|
export declare enum CUSTOM_MAP_MODE {
|
|
1342
1386
|
DEFAULT = "DEFAULT",
|
|
1343
1387
|
EDIT = "EDIT"
|
package/lib/types.js
CHANGED
|
@@ -168,6 +168,18 @@ export var MAP_OPTIONS;
|
|
|
168
168
|
MAP_OPTIONS["DEFAULT_MAP"] = "Default Minimap";
|
|
169
169
|
MAP_OPTIONS["CUSTOM_MAP"] = "Custom Minimap";
|
|
170
170
|
})(MAP_OPTIONS || (MAP_OPTIONS = {}));
|
|
171
|
+
export const sortTagOptions = {
|
|
172
|
+
'Ascending': { by: 'label', order: 'asc' },
|
|
173
|
+
'Descending': { by: 'label', order: 'desc' },
|
|
174
|
+
'Newest': { by: 'created_on', order: 'desc' },
|
|
175
|
+
'Oldest': { by: 'created_on', order: 'asc' }
|
|
176
|
+
};
|
|
177
|
+
export const sortObjectOptions = {
|
|
178
|
+
'Ascending': { by: 'showcase_object_name', order: 'asc' },
|
|
179
|
+
'Descending': { by: 'showcase_object_name', order: 'desc' },
|
|
180
|
+
'Newest': { by: 'created_on', order: 'desc' },
|
|
181
|
+
'Oldest': { by: 'created_on', order: 'asc' }
|
|
182
|
+
};
|
|
171
183
|
export var CUSTOM_MAP_MODE;
|
|
172
184
|
(function (CUSTOM_MAP_MODE) {
|
|
173
185
|
CUSTOM_MAP_MODE["DEFAULT"] = "DEFAULT";
|
package/package.json
CHANGED
package/static/atwinui.css
CHANGED
|
@@ -491,6 +491,7 @@
|
|
|
491
491
|
flex-direction: row;
|
|
492
492
|
gap: 4px;
|
|
493
493
|
margin-bottom: 8px;
|
|
494
|
+
margin-top: 8px;
|
|
494
495
|
}
|
|
495
496
|
|
|
496
497
|
.at_button_search_tag{
|
|
@@ -2067,4 +2068,37 @@
|
|
|
2067
2068
|
|
|
2068
2069
|
.at_comment_unsend_container{
|
|
2069
2070
|
cursor: pointer;
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
.at_tag_sort_option,
|
|
2074
|
+
.at_object_sort_option {
|
|
2075
|
+
margin: 3px 0 3px 0;
|
|
2076
|
+
cursor: pointer;
|
|
2077
|
+
padding: 2px 5px 2px 5px;
|
|
2078
|
+
border-radius: 2px;
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2081
|
+
.at_tag_sort_option:hover,
|
|
2082
|
+
.at_object_sort_option:hover {
|
|
2083
|
+
background-color: grey;
|
|
2084
|
+
}
|
|
2085
|
+
|
|
2086
|
+
.at_sort_btn_container {
|
|
2087
|
+
display: flex;
|
|
2088
|
+
flex-direction: column;
|
|
2089
|
+
align-items: end;
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
#at-tag-sort-icon {
|
|
2093
|
+
background-color: var(--bg-secondary);
|
|
2094
|
+
margin-bottom: 15px;
|
|
2095
|
+
margin-right: -15px;
|
|
2096
|
+
}
|
|
2097
|
+
|
|
2098
|
+
#at-object-sort-icon {
|
|
2099
|
+
background-color: var(--bg-secondary);
|
|
2100
|
+
}
|
|
2101
|
+
|
|
2102
|
+
.at_sort_option_selected {
|
|
2103
|
+
background-color: var(--bg-accent) !important;
|
|
2070
2104
|
}
|