@vitrosoftware/common-ui-ts 1.1.238 → 1.1.240

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.
@@ -46,6 +46,10 @@
46
46
  border-bottom: 2px solid #FE001B;
47
47
  margin-left: 4px;
48
48
  }
49
+ .comparison-popup-head-item.changed {
50
+ border-bottom: 2px solid #FFE100;
51
+ margin-left: 4px;
52
+ }
49
53
 
50
54
  .comparison-popup-body .uk-switcher {
51
55
  height: calc(100% - 53px);
@@ -83,6 +87,10 @@
83
87
  border-left: 2px solid #FE001B;
84
88
  }
85
89
 
90
+ .comparison-popup-body .item-changed {
91
+ border-left: 2px solid #FFE100;
92
+ }
93
+
86
94
  .ui-dialog.ui-dialog-comparison .ui-dialog-titlebar-buttonpane>a {
87
95
  margin-right: 2px !important;
88
96
  }
@@ -90,3 +98,77 @@
90
98
  .ui-dialog.ui-dialog-comparison .ui-dialog-titlebar-buttonpane>a:last-child {
91
99
  margin-right: 0;
92
100
  }
101
+
102
+
103
+
104
+
105
+ .property-comparison-popup-wrap {
106
+ font-family: Arial, sans-serif;
107
+ padding: 15px;
108
+ }
109
+
110
+ .property-groups-container {
111
+ padding: 5px;
112
+ overflow-y: auto;
113
+ max-height: calc(100vh - 100px);
114
+ }
115
+
116
+ .property-group {
117
+ margin-bottom: 20px;
118
+ border: 1px solid #e0e0e0;
119
+ border-radius: 4px;
120
+ overflow: hidden;
121
+ }
122
+
123
+ .group-header {
124
+ padding: 10px 15px;
125
+ background: #f5f5f5;
126
+ font-weight: bold;
127
+ font-size: 15px;
128
+ }
129
+
130
+ .properties-list {
131
+ padding: 10px;
132
+ }
133
+
134
+ .property-item {
135
+ margin-bottom: 12px;
136
+ padding-bottom: 12px;
137
+ border-bottom: 1px solid #eee;
138
+ }
139
+
140
+ .property-item:last-child {
141
+ border-bottom: none;
142
+ margin-bottom: 0;
143
+ padding-bottom: 0;
144
+ }
145
+
146
+ .property-name {
147
+ font-weight: bold;
148
+ margin-bottom: 5px;
149
+ font-size: 14px;
150
+ }
151
+
152
+ .property-value {
153
+ display: flex;
154
+ margin: 3px 0;
155
+ font-size: 13px;
156
+ }
157
+
158
+ .model-name {
159
+ font-weight: bold;
160
+ min-width: 200px;
161
+ color: #555;
162
+ }
163
+
164
+ .model-a .model-name {
165
+ color: #d32f2f;
166
+ }
167
+
168
+ .model-b .model-name {
169
+ color: #388e3c;
170
+ }
171
+
172
+ .value {
173
+ margin-left: 10px;
174
+ }
@@ -0,0 +1 @@
1
+ <svg viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M13 6L8 11L3 6' stroke='#222D44' stroke-linecap='round' stroke-linejoin='round'/></svg>
@@ -0,0 +1,3 @@
1
+ <svg width="33" height="32" viewBox="0 0 33 32" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M16.4997 29.3327V17.3327M16.4997 17.3327L21.1663 21.9993M16.4997 17.3327L11.833 21.9993M27.1663 23.4753C29.1583 22.6953 31.1663 20.918 31.1663 17.3327C31.1663 11.9993 26.7223 10.666 24.4997 10.666C24.4997 7.99935 24.4997 2.66602 16.4997 2.66602C8.49967 2.66602 8.49967 7.99935 8.49967 10.666C6.27701 10.666 1.83301 11.9993 1.83301 17.3327C1.83301 20.918 3.84101 22.6953 5.83301 23.4753" stroke="#66B1FF" stroke-width="1.25635" stroke-linecap="round" stroke-linejoin="round"/>
3
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M19.2727 16.8958C20.6309 16.364 22 15.1523 22 12.708C22 9.072 18.97 8.16299 17.4545 8.16299C17.4545 6.34499 17.4545 2.70898 12 2.70898C6.54545 2.70898 6.54545 6.34499 6.54545 8.16299C5.03 8.16299 2 9.072 2 12.708C2 15.1523 3.36909 16.364 4.72727 16.8958" stroke="#222D44" stroke-linecap="round" stroke-linejoin="round"/>
3
+ <path d="M12.0081 22L12.0039 13" stroke="#222D44" stroke-linecap="round" stroke-linejoin="round"/>
4
+ <path d="M15.1843 19.3164L12.0023 22.4984L8.82031 19.3164" stroke="#222D44" stroke-linecap="round" stroke-linejoin="round"/>
5
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M4.99516 13.3337L1.66699 10.0029L5.00033 6.66699" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
3
+ <path d="M15.0052 6.66699L18.3333 9.99778L15 13.3337" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
4
+ <path d="M1.66699 10H18.3337" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
5
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg viewBox="0 0 6 30" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g id="Spliter">
3
+ <path id="Rectangle 4359" d="M0 0H4.5C5.32843 0 6 0.671573 6 1.5V28.5C6 29.3284 5.32843 30 4.5 30H0V0Z" fill="#326AD6"/>
4
+ <path id="Polygon 3" d="M1.5 12.911C1.5 12.6251 1.80945 12.4464 2.05701 12.5894L5.12058 14.3581C5.36814 14.501 5.36814 14.8584 5.12058 15.0013L2.05701 16.7701C1.80945 16.913 1.5 16.7343 1.5 16.4485L1.5 12.911Z" fill="white"/>
5
+ </g>
6
+ </svg>
@@ -0,0 +1,11 @@
1
+ <svg width="9" height="9" viewBox="0 0 9 9" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_2832_1940)">
3
+ <line x1="9.35355" y1="0.353553" x2="0.353553" y2="9.35355" stroke="#8E98A3"/>
4
+ <line x1="9.35355" y1="6.35355" x2="6.35355" y2="9.35355" stroke="#8E98A3"/>
5
+ </g>
6
+ <defs>
7
+ <clipPath id="clip0_2832_1940">
8
+ <rect width="9" height="9" fill="white"/>
9
+ </clipPath>
10
+ </defs>
11
+ </svg>
@@ -15,6 +15,19 @@ body,
15
15
  #xeokitCanvas {
16
16
  width: 100%;
17
17
  height: 100%;
18
+ left: 0;
19
+ top: 0;
20
+ position: absolute;
21
+ }
22
+
23
+ #xeokitCompareCanvas {
24
+ display: none;
25
+ width: 50%;
26
+ height: 100%;
27
+ border-left: 2px solid gray;
28
+ right : 0;
29
+ top: 0;
30
+ position: absolute;
18
31
  }
19
32
 
20
33
  body {
package/dist/index.js CHANGED
@@ -750,15 +750,27 @@ var Breadcrumbs = function Breadcrumbs(props) {
750
750
  windowWidth < exports.MOBILE_VIEW.WIDTH ? setIsMobileView(true) : setIsMobileView(false);
751
751
  }
752
752
  };
753
+ var isValidEvent = function isValidEvent(e) {
754
+ var _e$detail;
755
+ if ((_e$detail = e.detail) !== null && _e$detail !== void 0 && _e$detail.eventScopeId) {
756
+ var _e$detail2;
757
+ return ((_e$detail2 = e.detail) === null || _e$detail2 === void 0 ? void 0 : _e$detail2.eventScopeId) === props.eventScopeId;
758
+ }
759
+ return true;
760
+ };
753
761
  var updateItemList = function updateItemList(e) {
754
- if (props.getItemList) {
755
- props.getItemList(e).then(function (list) {
756
- setItemList(getItemList(list));
757
- });
762
+ if (isValidEvent(e)) {
763
+ if (props.getItemList) {
764
+ props.getItemList(e).then(function (list) {
765
+ setItemList(getItemList(list));
766
+ });
767
+ }
758
768
  }
759
769
  };
760
770
  var resetItemList = function resetItemList(e) {
761
- setItemList([]);
771
+ if (isValidEvent(e)) {
772
+ setItemList([]);
773
+ }
762
774
  };
763
775
  var initItemListMobileView = function initItemListMobileView(itemList) {
764
776
  var list = [].concat(itemList);
@@ -66942,7 +66954,7 @@ var Viewer = function Viewer(props) {
66942
66954
  };
66943
66955
 
66944
66956
  var name = "@vitrosoftware/common-ui-ts";
66945
- var version$1 = "1.1.238";
66957
+ var version$1 = "1.1.240";
66946
66958
  var description = "vitro software common ui ts";
66947
66959
  var author = "";
66948
66960
  var license = "MIT";
@@ -83468,7 +83480,12 @@ var RouteItem = function RouteItem(props) {
83468
83480
 
83469
83481
  var w$9 = window;
83470
83482
  var ID_FILE_VERSION_SELECT$1 = 'fileVersionSelect';
83483
+ var ID_COMPARE_TREE = 'compareTreeContent';
83484
+ var EVENT_COMPARE_TREE_ITEM_SLECT = 'vitro.compare.tree.item.select';
83485
+ var CSS_CLASS_TEXT = 'vitro-text';
83471
83486
  var Viewer$1 = function Viewer(props) {
83487
+ var compareModelResultRef = React.useRef([]);
83488
+ var isTreeViewInitRef = React.useRef(false);
83472
83489
  React.useEffect(function () {
83473
83490
  if (props.context) {
83474
83491
  init();
@@ -83479,7 +83496,8 @@ var Viewer$1 = function Viewer(props) {
83479
83496
  var initViewer = function initViewer() {
83480
83497
  if (w$9.initBimViewer) {
83481
83498
  var context = _extends({}, props.context, {
83482
- initIssueList: initIssueList
83499
+ initIssueList: initIssueList,
83500
+ initCompareTreeView: initCompareTreeView
83483
83501
  });
83484
83502
  w$9.initBimViewer(context);
83485
83503
  initFileVersionSelect();
@@ -83509,6 +83527,86 @@ var Viewer$1 = function Viewer(props) {
83509
83527
  container: props.context.container
83510
83528
  }, component), sidebar);
83511
83529
  };
83530
+ function mapServerNodeToJsTree(n) {
83531
+ var total = (n.childAddCount || 0) + (n.childDelCount || 0) + (n.childChangeCount || 0);
83532
+ var countsHtml = total ? "<span class=\"vitro-count-wrap\">\n " + (n.childAddCount ? "<span class=\"vitro-count-add\">" + n.childAddCount + "</span>" : '') + "\n " + (n.childDelCount ? "<span class=\"vitro-count-del\">" + n.childDelCount + "</span>" : '') + "\n " + (n.childChangeCount ? "<span class=\"vitro-count-change\">" + n.childChangeCount + "</span>" : '') + "\n </span>" : '';
83533
+ var text = "<span class=\"" + CSS_CLASS_TEXT + "\">" + (n.name || n.type || n.uuid) + "</span>" + countsHtml;
83534
+ return {
83535
+ id: n.uuid,
83536
+ text: text,
83537
+ parent: n.parentUUID || '#',
83538
+ children: total > 0,
83539
+ li_attr: {
83540
+ "class": n.changeType ? 'change-type-' + n.changeType : ''
83541
+ },
83542
+ data: {
83543
+ parentUUID: n.parentUUID,
83544
+ changeType: n.changeType || null
83545
+ }
83546
+ };
83547
+ }
83548
+ var getCurrentCompareFilters = function getCurrentCompareFilters() {
83549
+ var changeTypes = [];
83550
+ if (jquery('#btnCompareFilterAdd').hasClass('selected')) changeTypes.push('add');
83551
+ if (jquery('#btnCompareFilterDel').hasClass('selected')) changeTypes.push('del');
83552
+ if (jquery('#btnCompareFilterChange').hasClass('selected')) changeTypes.push('change');
83553
+ var searchTerm = (jquery('#compareSearch').val() || '').trim();
83554
+ return {
83555
+ ChangeTypeList: changeTypes,
83556
+ SearchTerm: searchTerm || '',
83557
+ IsGeometry: null
83558
+ };
83559
+ };
83560
+ var initCompareTreeView = function initCompareTreeView() {
83561
+ var el = document.getElementById(ID_COMPARE_TREE);
83562
+ if (!el) return;
83563
+ if (!isTreeViewInitRef.current) {
83564
+ var config = {
83565
+ core: {
83566
+ check_callback: true,
83567
+ themes: {
83568
+ dots: false
83569
+ },
83570
+ data: function data(node, cb) {
83571
+ var isRoot = node.id === '#';
83572
+ var parentUUID = isRoot ? '-1' : node.id;
83573
+ var baseFilters = getCurrentCompareFilters();
83574
+ var payload = Object.assign({
83575
+ ParentUUID: parentUUID,
83576
+ Skip: 0,
83577
+ Take: 0
83578
+ }, baseFilters);
83579
+ window.viewer.scene.canvas.spinner.processes++;
83580
+ window.BIMModel.CompareChildList(function (list) {
83581
+ var items = (list || []).map(mapServerNodeToJsTree);
83582
+ cb(items);
83583
+ window.viewer.scene.canvas.spinner.processes--;
83584
+ }, function () {
83585
+ cb([]);
83586
+ window.viewer.scene.canvas.spinner.processes--;
83587
+ }, payload, true);
83588
+ }
83589
+ },
83590
+ plugins: ['wholerow']
83591
+ };
83592
+ jquery(el).jstree(config).on('select_node.jstree', function (_e, data) {
83593
+ var _data$node, _data$node$data;
83594
+ if (data !== null && data !== void 0 && (_data$node = data.node) !== null && _data$node !== void 0 && (_data$node$data = _data$node.data) !== null && _data$node$data !== void 0 && _data$node$data.changeType) {
83595
+ var evt = new CustomEvent(EVENT_COMPARE_TREE_ITEM_SLECT, {
83596
+ detail: {
83597
+ itemId: data.node.id
83598
+ }
83599
+ });
83600
+ window.dispatchEvent(evt);
83601
+ } else {
83602
+ jquery(el).jstree(true).open_node(data.node);
83603
+ }
83604
+ });
83605
+ isTreeViewInitRef.current = true;
83606
+ } else {
83607
+ jquery(el).jstree(true).refresh(true);
83608
+ }
83609
+ };
83512
83610
  var initFileVersionSelect = function initFileVersionSelect() {
83513
83611
  var selectContainer = document.getElementById(ID_FILE_VERSION_SELECT$1);
83514
83612
  var select = React__default.createElement(FileVersionSelect, {