@labelbee/lb-annotation 1.14.0-alpha.3 → 1.14.0-alpha.6
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/dist/_virtual/MathUtilsWorker.js +1 -8
- package/dist/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +2 -35
- package/dist/_virtual/filterBoxWorker.js +1 -8
- package/dist/_virtual/highlightWorker.js +1 -8
- package/dist/assets/attributeIcon/icon_canvasEdit0.svg.js +1 -5
- package/dist/assets/attributeIcon/icon_canvasEdit1.svg.js +1 -5
- package/dist/assets/attributeIcon/icon_canvasEdit2.svg.js +1 -5
- package/dist/assets/attributeIcon/icon_canvasEdit3.svg.js +1 -5
- package/dist/assets/attributeIcon/icon_canvasEdit4.svg.js +1 -5
- package/dist/assets/attributeIcon/icon_canvasEdit5.svg.js +1 -5
- package/dist/assets/attributeIcon/icon_canvasEdit6.svg.js +1 -5
- package/dist/assets/attributeIcon/icon_canvasEdit7.svg.js +1 -5
- package/dist/assets/attributeIcon/icon_canvasEdit8.svg.js +1 -5
- package/dist/assets/attributeIcon/icon_canvasEdit_miss.svg.js +1 -5
- package/dist/assets/attributeIcon/icon_cuboidFAB.svg.js +5 -5
- package/dist/assets/attributeIcon/icon_cuboidLeft.svg.js +7 -5
- package/dist/assets/attributeIcon/icon_cuboidMore.svg.js +5 -5
- package/dist/assets/attributeIcon/icon_cuboidRight.svg.js +5 -5
- package/dist/assets/attributeIcon/icon_cuboidTop.svg.js +12 -5
- package/dist/assets/attributeIcon/icon_editFEN.svg.js +1 -5
- package/dist/assets/attributeIcon/icon_editHUANG.svg.js +1 -5
- package/dist/assets/attributeIcon/icon_editLAN.svg.js +1 -5
- package/dist/assets/attributeIcon/icon_editLV.svg.js +1 -5
- package/dist/assets/attributeIcon/icon_editQING.svg.js +1 -5
- package/dist/constant/annotation.js +1 -127
- package/dist/constant/annotationTask.js +1 -30
- package/dist/constant/defaultConfig.js +1 -266
- package/dist/constant/keyCode.js +1 -38
- package/dist/constant/style.js +1 -98
- package/dist/constant/tool.js +1 -236
- package/dist/core/index.js +1 -150
- package/dist/core/pointCloud/OrbitControls.js +1 -665
- package/dist/core/pointCloud/PCDLoader.js +2 -260
- package/dist/core/pointCloud/annotation.js +1 -215
- package/dist/core/pointCloud/cache.js +1 -53
- package/dist/core/pointCloud/index.js +5 -991
- package/dist/core/pointCloud/matrix.js +1 -138
- package/dist/core/scheduler.js +1 -233
- package/dist/core/toolOperation/LineToolOperation.js +1 -1434
- package/dist/core/toolOperation/ScribbleTool.js +1 -292
- package/dist/core/toolOperation/TextToolOperation.js +1 -131
- package/dist/core/toolOperation/ViewOperation.js +1 -556
- package/dist/core/toolOperation/basicToolOperation.js +1 -881
- package/dist/core/toolOperation/checkOperation.js +1 -208
- package/dist/core/toolOperation/cuboidOperation.js +1 -754
- package/dist/core/toolOperation/cuboidToggleButtonClass.js +7 -152
- package/dist/core/toolOperation/eventListener.js +1 -37
- package/dist/core/toolOperation/measureOperation.js +1 -41
- package/dist/core/toolOperation/pointCloud2dOperation.js +1 -365
- package/dist/core/toolOperation/pointOperation.js +1 -696
- package/dist/core/toolOperation/polygonOperation.js +1 -1251
- package/dist/core/toolOperation/rectOperation.js +1 -1233
- package/dist/core/toolOperation/segmentByRect.js +1 -174
- package/dist/core/toolOperation/tagOperation.js +3 -201
- package/dist/core/toolOperation/textAttributeClass.js +16 -182
- package/dist/index.js +1 -185
- package/dist/locales/constants.js +1 -24
- package/dist/locales/en_US/message.js +1 -25
- package/dist/locales/index.js +1 -19
- package/dist/locales/zh_CN/message.js +1 -25
- package/dist/newCore/CanvasScheduler.js +1 -35
- package/dist/types/core/pointCloud/index.d.ts +2 -2
- package/dist/utils/ActionsHistory.js +1 -84
- package/dist/utils/ImgUtils.js +1 -23
- package/dist/utils/MathUtils.js +2 -385
- package/dist/utils/VectorUtils.js +1 -25
- package/dist/utils/tool/AttributeUtils.js +1 -218
- package/dist/utils/tool/AxisUtils.js +1 -340
- package/dist/utils/tool/CanvasUtils.js +1 -62
- package/dist/utils/tool/CommonToolUtils.js +1 -174
- package/dist/utils/tool/CuboidUtils.js +1 -704
- package/dist/utils/tool/DblClickEventListener.js +1 -102
- package/dist/utils/tool/DrawUtils.js +3 -492
- package/dist/utils/tool/EnhanceCommonToolUtils.js +1 -53
- package/dist/utils/tool/ImgPosUtils.js +1 -58
- package/dist/utils/tool/LineToolUtils.js +1 -261
- package/dist/utils/tool/MarkerUtils.js +1 -56
- package/dist/utils/tool/PolygonUtils.js +1 -460
- package/dist/utils/tool/RectUtils.js +1 -155
- package/dist/utils/tool/RenderDomClass.js +7 -57
- package/dist/utils/tool/RenderDomUtils.js +4 -21
- package/dist/utils/tool/StyleUtils.js +1 -31
- package/dist/utils/tool/TagUtils.js +1 -129
- package/dist/utils/tool/UnitUtils.js +1 -12
- package/dist/utils/tool/ZoomUtils.js +1 -72
- package/dist/utils/tool/polygonTool.js +1 -133
- package/dist/utils/uuid.js +1 -26
- package/es/_virtual/MathUtilsWorker.js +1 -6
- package/es/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +2 -31
- package/es/_virtual/filterBoxWorker.js +1 -6
- package/es/_virtual/highlightWorker.js +1 -6
- package/es/assets/attributeIcon/icon_canvasEdit0.svg.js +1 -3
- package/es/assets/attributeIcon/icon_canvasEdit1.svg.js +1 -3
- package/es/assets/attributeIcon/icon_canvasEdit2.svg.js +1 -3
- package/es/assets/attributeIcon/icon_canvasEdit3.svg.js +1 -3
- package/es/assets/attributeIcon/icon_canvasEdit4.svg.js +1 -3
- package/es/assets/attributeIcon/icon_canvasEdit5.svg.js +1 -3
- package/es/assets/attributeIcon/icon_canvasEdit6.svg.js +1 -3
- package/es/assets/attributeIcon/icon_canvasEdit7.svg.js +1 -3
- package/es/assets/attributeIcon/icon_canvasEdit8.svg.js +1 -3
- package/es/assets/attributeIcon/icon_canvasEdit_miss.svg.js +1 -3
- package/es/assets/attributeIcon/icon_cuboidFAB.svg.js +5 -3
- package/es/assets/attributeIcon/icon_cuboidLeft.svg.js +7 -3
- package/es/assets/attributeIcon/icon_cuboidMore.svg.js +5 -3
- package/es/assets/attributeIcon/icon_cuboidRight.svg.js +5 -3
- package/es/assets/attributeIcon/icon_cuboidTop.svg.js +12 -3
- package/es/assets/attributeIcon/icon_editFEN.svg.js +1 -3
- package/es/assets/attributeIcon/icon_editHUANG.svg.js +1 -3
- package/es/assets/attributeIcon/icon_editLAN.svg.js +1 -3
- package/es/assets/attributeIcon/icon_editLV.svg.js +1 -3
- package/es/assets/attributeIcon/icon_editQING.svg.js +1 -3
- package/es/constant/annotation.js +1 -113
- package/es/constant/annotationTask.js +1 -25
- package/es/constant/defaultConfig.js +1 -260
- package/es/constant/keyCode.js +1 -36
- package/es/constant/style.js +1 -74
- package/es/constant/tool.js +1 -220
- package/es/core/index.js +1 -148
- package/es/core/pointCloud/OrbitControls.js +1 -661
- package/es/core/pointCloud/PCDLoader.js +2 -256
- package/es/core/pointCloud/annotation.js +1 -211
- package/es/core/pointCloud/cache.js +1 -49
- package/es/core/pointCloud/index.js +5 -962
- package/es/core/pointCloud/matrix.js +1 -109
- package/es/core/scheduler.js +1 -228
- package/es/core/toolOperation/LineToolOperation.js +1 -1421
- package/es/core/toolOperation/ScribbleTool.js +1 -290
- package/es/core/toolOperation/TextToolOperation.js +1 -129
- package/es/core/toolOperation/ViewOperation.js +1 -549
- package/es/core/toolOperation/basicToolOperation.js +1 -877
- package/es/core/toolOperation/checkOperation.js +1 -206
- package/es/core/toolOperation/cuboidOperation.js +1 -752
- package/es/core/toolOperation/cuboidToggleButtonClass.js +7 -150
- package/es/core/toolOperation/eventListener.js +1 -35
- package/es/core/toolOperation/measureOperation.js +1 -39
- package/es/core/toolOperation/pointCloud2dOperation.js +1 -359
- package/es/core/toolOperation/pointOperation.js +1 -690
- package/es/core/toolOperation/polygonOperation.js +1 -1245
- package/es/core/toolOperation/rectOperation.js +1 -1228
- package/es/core/toolOperation/segmentByRect.js +1 -172
- package/es/core/toolOperation/tagOperation.js +3 -199
- package/es/core/toolOperation/textAttributeClass.js +16 -180
- package/es/index.js +1 -46
- package/es/locales/constants.js +1 -22
- package/es/locales/en_US/message.js +1 -23
- package/es/locales/index.js +1 -17
- package/es/locales/zh_CN/message.js +1 -23
- package/es/newCore/CanvasScheduler.js +1 -31
- package/es/utils/ActionsHistory.js +1 -78
- package/es/utils/ImgUtils.js +1 -21
- package/es/utils/MathUtils.js +2 -380
- package/es/utils/VectorUtils.js +1 -23
- package/es/utils/tool/AttributeUtils.js +1 -212
- package/es/utils/tool/AxisUtils.js +1 -335
- package/es/utils/tool/CanvasUtils.js +1 -60
- package/es/utils/tool/CommonToolUtils.js +1 -172
- package/es/utils/tool/CuboidUtils.js +1 -680
- package/es/utils/tool/DblClickEventListener.js +1 -100
- package/es/utils/tool/DrawUtils.js +3 -490
- package/es/utils/tool/EnhanceCommonToolUtils.js +1 -48
- package/es/utils/tool/ImgPosUtils.js +1 -56
- package/es/utils/tool/LineToolUtils.js +1 -255
- package/es/utils/tool/MarkerUtils.js +1 -54
- package/es/utils/tool/PolygonUtils.js +1 -458
- package/es/utils/tool/RectUtils.js +1 -153
- package/es/utils/tool/RenderDomClass.js +7 -55
- package/es/utils/tool/RenderDomUtils.js +4 -19
- package/es/utils/tool/StyleUtils.js +1 -29
- package/es/utils/tool/TagUtils.js +1 -127
- package/es/utils/tool/UnitUtils.js +1 -10
- package/es/utils/tool/ZoomUtils.js +1 -70
- package/es/utils/tool/polygonTool.js +1 -126
- package/es/utils/uuid.js +1 -24
- package/package.json +3 -4
- package/LICENSE +0 -203
- package/dist/core/pointCloud/segmentation.js +0 -144
- package/dist/core/pointCloud/selector/Sse3dLassoSelector.js +0 -26
- package/dist/core/pointCloud/selector/Sse3dSelector.js +0 -16
- package/dist/types/core/pointCloud/segmentation.d.ts +0 -0
- package/dist/types/core/pointCloud/selector/Sse3dLassoSelector.d.ts +0 -0
- package/dist/types/core/pointCloud/selector/Sse3dSelector.d.ts +0 -0
- package/es/_virtual/_rollup-plugin-web-worker-loader__helper__auto__createBase64WorkerFactory.js +0 -12
- package/es/_virtual/_rollup-plugin-web-worker-loader__helper__auto__isNodeJS.js +0 -7
- package/es/_virtual/_rollup-plugin-web-worker-loader__helper__node__WorkerClass.js +0 -11
- package/es/_virtual/_rollup-plugin-web-worker-loader__helper__node__createBase64WorkerFactory.js +0 -18
- package/es/core/pointCloud/segmentation.js +0 -120
- package/es/core/pointCloud/selector/Sse3dLassoSelector.js +0 -24
- package/es/core/pointCloud/selector/Sse3dSelector.js +0 -14
- package/es/core/toolOperation/scribbleTool2.js +0 -249
|
@@ -1,172 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { EStepType, ESortDirection } from '../../constant/annotation.js';
|
|
3
|
-
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __defProps = Object.defineProperties;
|
|
6
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {enumerable: true, configurable: true, writable: true, value}) : obj[key] = value;
|
|
11
|
-
var __spreadValues = (a, b) => {
|
|
12
|
-
for (var prop in b || (b = {}))
|
|
13
|
-
if (__hasOwnProp.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
if (__getOwnPropSymbols)
|
|
16
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
-
if (__propIsEnum.call(b, prop))
|
|
18
|
-
__defNormalProp(a, prop, b[prop]);
|
|
19
|
-
}
|
|
20
|
-
return a;
|
|
21
|
-
};
|
|
22
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
-
class CommonToolUtils {
|
|
24
|
-
static getStepInfo(step, stepList) {
|
|
25
|
-
return stepList == null ? void 0 : stepList.filter((info) => info.step === step)[0];
|
|
26
|
-
}
|
|
27
|
-
static getCurrentStepInfo(currentStep, stepList) {
|
|
28
|
-
const currentStepInfo = this.getStepInfo(currentStep, stepList);
|
|
29
|
-
if (currentStepInfo) {
|
|
30
|
-
if (currentStepInfo.type === EStepType.QUALITY_INSPECTION || currentStepInfo.type === EStepType.MANUAL_CORRECTION) {
|
|
31
|
-
return this.getCurrentStepInfo(currentStepInfo.dataSourceStep, stepList);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return currentStepInfo;
|
|
35
|
-
}
|
|
36
|
-
static getMaxOrder(result) {
|
|
37
|
-
let order = 0;
|
|
38
|
-
result.forEach((v) => {
|
|
39
|
-
if (v.order && v.order > order) {
|
|
40
|
-
order = v.order;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
return order;
|
|
44
|
-
}
|
|
45
|
-
static hotkeyFilter(event) {
|
|
46
|
-
const target = event.target || event.srcElement;
|
|
47
|
-
if (!target) {
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
const {tagName, type} = target;
|
|
51
|
-
if (!tagName || !type) {
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
let flag = true;
|
|
55
|
-
if (target.isContentEditable || tagName === "TEXTAREA" || (tagName === "INPUT" && type !== "radio" || tagName === "TEXTAREA") && !target.readOnly) {
|
|
56
|
-
flag = false;
|
|
57
|
-
}
|
|
58
|
-
return flag;
|
|
59
|
-
}
|
|
60
|
-
static getNextSelectedRectID(rectList, sort = ESortDirection.ascend, selectedID) {
|
|
61
|
-
let sign = 1;
|
|
62
|
-
if (sort === ESortDirection.descend) {
|
|
63
|
-
sign = -1;
|
|
64
|
-
}
|
|
65
|
-
const sortRectList = rectList.sort((a, b) => {
|
|
66
|
-
if (a.x - b.x === 0) {
|
|
67
|
-
return a.y - b.y;
|
|
68
|
-
}
|
|
69
|
-
return sign * (a.x - b.x);
|
|
70
|
-
});
|
|
71
|
-
const i = sortRectList.findIndex((v) => v.id === selectedID);
|
|
72
|
-
const len = sortRectList.length;
|
|
73
|
-
return sortRectList[(i + 1) % len];
|
|
74
|
-
}
|
|
75
|
-
static getNextSelectedRectIDByEvent(pointList, event, selectedID) {
|
|
76
|
-
const sortDirection = event.shiftKey ? ESortDirection.descend : ESortDirection.ascend;
|
|
77
|
-
return this.getNextSelectedRectID(pointList, sortDirection, selectedID);
|
|
78
|
-
}
|
|
79
|
-
static getRenderResultList(resultList, sourceID, attributeLockList = [], selectedID) {
|
|
80
|
-
let selectedRect;
|
|
81
|
-
const showingRect = resultList.filter((result) => {
|
|
82
|
-
if (selectedID && selectedID === (result == null ? void 0 : result.id)) {
|
|
83
|
-
selectedRect = result;
|
|
84
|
-
return false;
|
|
85
|
-
}
|
|
86
|
-
if (attributeLockList.length > 0 && !attributeLockList.includes(result == null ? void 0 : result.attribute)) {
|
|
87
|
-
return false;
|
|
88
|
-
}
|
|
89
|
-
if (this.isDifferSourceID(result == null ? void 0 : result.sourceID, sourceID)) {
|
|
90
|
-
return false;
|
|
91
|
-
}
|
|
92
|
-
return true;
|
|
93
|
-
});
|
|
94
|
-
return [showingRect, selectedRect];
|
|
95
|
-
}
|
|
96
|
-
static getSourceID(basicResult) {
|
|
97
|
-
var _a;
|
|
98
|
-
const defaultSourceID = "";
|
|
99
|
-
if (basicResult) {
|
|
100
|
-
return (_a = basicResult == null ? void 0 : basicResult.id) != null ? _a : defaultSourceID;
|
|
101
|
-
}
|
|
102
|
-
return defaultSourceID;
|
|
103
|
-
}
|
|
104
|
-
static findAllLine(pointList, isClose = true) {
|
|
105
|
-
const arr = [];
|
|
106
|
-
const newPoint = [...pointList];
|
|
107
|
-
if (newPoint.length >= 3 && isClose === true) {
|
|
108
|
-
newPoint.push(__spreadValues({}, newPoint[0]));
|
|
109
|
-
}
|
|
110
|
-
for (let i = 0; i < newPoint.length; i++) {
|
|
111
|
-
if (newPoint[i + 1]) {
|
|
112
|
-
arr.push({
|
|
113
|
-
point1: newPoint[i],
|
|
114
|
-
point2: newPoint[i + 1],
|
|
115
|
-
pointIndex: i
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
return arr;
|
|
120
|
-
}
|
|
121
|
-
static translateSourceID(sourceID) {
|
|
122
|
-
if (sourceID === void 0 || sourceID === 0 || sourceID === "0") {
|
|
123
|
-
sourceID = "";
|
|
124
|
-
}
|
|
125
|
-
return sourceID;
|
|
126
|
-
}
|
|
127
|
-
static isDifferSourceID(sourceIDA, sourceIDB) {
|
|
128
|
-
sourceIDA = this.translateSourceID(sourceIDA);
|
|
129
|
-
sourceIDB = this.translateSourceID(sourceIDB);
|
|
130
|
-
return `${sourceIDA}` !== `${sourceIDB}`;
|
|
131
|
-
}
|
|
132
|
-
static isSameSourceID(sourceIDA, sourceIDB) {
|
|
133
|
-
sourceIDA = this.translateSourceID(sourceIDA);
|
|
134
|
-
sourceIDB = this.translateSourceID(sourceIDB);
|
|
135
|
-
return `${sourceIDA}` === `${sourceIDB}`;
|
|
136
|
-
}
|
|
137
|
-
static getNextMarker(resultList, markerList = [], markerIndex) {
|
|
138
|
-
if ((markerList == null ? void 0 : markerList.length) === 0) {
|
|
139
|
-
return void 0;
|
|
140
|
-
}
|
|
141
|
-
let newSortList = markerList.map((data, index) => __spreadProps(__spreadValues({}, data), {index}));
|
|
142
|
-
if (typeof markerIndex === "number" && markerIndex > 0) {
|
|
143
|
-
const markerInfo = markerList[markerIndex];
|
|
144
|
-
if (markerInfo && resultList.every((rect) => rect.label !== markerInfo.value)) {
|
|
145
|
-
return {label: markerInfo.value, index: markerIndex};
|
|
146
|
-
}
|
|
147
|
-
newSortList = [...newSortList.slice(markerIndex, markerList.length), ...newSortList.slice(0, markerIndex)];
|
|
148
|
-
}
|
|
149
|
-
for (let i = 0; i < newSortList.length; i++) {
|
|
150
|
-
if (resultList.some((rect) => rect.label === newSortList[i].value)) {
|
|
151
|
-
continue;
|
|
152
|
-
}
|
|
153
|
-
return {label: newSortList[i].value, index: newSortList[i].index};
|
|
154
|
-
}
|
|
155
|
-
return void 0;
|
|
156
|
-
}
|
|
157
|
-
static getCurrentMarkerIndex(label, markerList = []) {
|
|
158
|
-
return markerList.findIndex((marker) => label === marker.value);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
CommonToolUtils.jsonParser = (content, defaultValue = {}) => {
|
|
162
|
-
try {
|
|
163
|
-
if (typeof content === "string") {
|
|
164
|
-
return JSON.parse(content);
|
|
165
|
-
}
|
|
166
|
-
return isObject(content) ? content : defaultValue;
|
|
167
|
-
} catch (e) {
|
|
168
|
-
return defaultValue;
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
export { CommonToolUtils as default };
|
|
1
|
+
import{isObject as h}from"lodash";import{EStepType as u,ESortDirection as f}from"../../constant/annotation.js";var v=Object.defineProperty,y=Object.defineProperties,_=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable,p=(o,t,e)=>t in o?v(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,g=(o,t)=>{for(var e in t||(t={}))O.call(t,e)&&p(o,e,t[e]);if(d)for(var e of d(t))P.call(t,e)&&p(o,e,t[e]);return o},E=(o,t)=>y(o,_(t));class S{static getStepInfo(t,e){return e==null?void 0:e.filter(r=>r.step===t)[0]}static getCurrentStepInfo(t,e){const r=this.getStepInfo(t,e);return r&&(r.type===u.QUALITY_INSPECTION||r.type===u.MANUAL_CORRECTION)?this.getCurrentStepInfo(r.dataSourceStep,e):r}static getMaxOrder(t){let e=0;return t.forEach(r=>{r.order&&r.order>e&&(e=r.order)}),e}static hotkeyFilter(t){const e=t.target||t.srcElement;if(!e)return!0;const{tagName:r,type:i}=e;if(!r||!i)return!0;let n=!0;return(e.isContentEditable||r==="TEXTAREA"||(r==="INPUT"&&i!=="radio"||r==="TEXTAREA")&&!e.readOnly)&&(n=!1),n}static getNextSelectedRectID(t,e=f.ascend,r){let i=1;e===f.descend&&(i=-1);const n=t.sort((s,c)=>s.x-c.x==0?s.y-c.y:i*(s.x-c.x)),l=n.findIndex(s=>s.id===r),a=n.length;return n[(l+1)%a]}static getNextSelectedRectIDByEvent(t,e,r){const i=e.shiftKey?f.descend:f.ascend;return this.getNextSelectedRectID(t,i,r)}static getRenderResultList(t,e,r=[],i){let n;return[t.filter(a=>i&&i===(a==null?void 0:a.id)?(n=a,!1):!(r.length>0&&!r.includes(a==null?void 0:a.attribute)||this.isDifferSourceID(a==null?void 0:a.sourceID,e))),n]}static getSourceID(t){var e;const r="";return t&&(e=t==null?void 0:t.id)!=null?e:r}static findAllLine(t,e=!0){const r=[],i=[...t];i.length>=3&&e===!0&&i.push(g({},i[0]));for(let n=0;n<i.length;n++)i[n+1]&&r.push({point1:i[n],point2:i[n+1],pointIndex:n});return r}static translateSourceID(t){return(t===void 0||t===0||t==="0")&&(t=""),t}static isDifferSourceID(t,e){return t=this.translateSourceID(t),e=this.translateSourceID(e),`${t}`!=`${e}`}static isSameSourceID(t,e){return t=this.translateSourceID(t),e=this.translateSourceID(e),`${t}`==`${e}`}static getNextMarker(t,e=[],r){if((e==null?void 0:e.length)===0)return;let i=e.map((n,l)=>E(g({},n),{index:l}));if(typeof r=="number"&&r>0){const n=e[r];if(n&&t.every(l=>l.label!==n.value))return{label:n.value,index:r};i=[...i.slice(r,e.length),...i.slice(0,r)]}for(let n=0;n<i.length;n++)if(!t.some(l=>l.label===i[n].value))return{label:i[n].value,index:i[n].index}}static getCurrentMarkerIndex(t,e=[]){return e.findIndex(r=>t===r.value)}}S.jsonParser=(o,t={})=>{try{return typeof o=="string"?JSON.parse(o):h(o)?o:t}catch(e){return t}};export{S as default};
|