uicore-ts 1.0.175 → 1.0.178
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/compiledScripts/UIView.d.ts +4 -5
- package/compiledScripts/UIView.js +22 -20
- package/compiledScripts/UIView.js.map +2 -2
- package/package.json +1 -1
- package/scripts/UIView.ts +87 -93
|
@@ -116,9 +116,9 @@ export declare class UIView extends UIObject {
|
|
|
116
116
|
isInternalScaling: boolean;
|
|
117
117
|
private _resizeObserver;
|
|
118
118
|
private _isMovable;
|
|
119
|
-
|
|
119
|
+
makeNotMovable?: () => void;
|
|
120
120
|
private _isResizable;
|
|
121
|
-
|
|
121
|
+
makeNotResizable?: () => void;
|
|
122
122
|
private _isMoving;
|
|
123
123
|
constructor(elementID?: string, viewHTMLElement?: HTMLElement & LooseObject | null, elementType?: string | null, initViewData?: any);
|
|
124
124
|
static get nextIndex(): number;
|
|
@@ -281,13 +281,12 @@ export declare class UIView extends UIObject {
|
|
|
281
281
|
get isMovable(): boolean;
|
|
282
282
|
set isMovable(isMovable: boolean);
|
|
283
283
|
makeMovable(optionalParameters?: {
|
|
284
|
-
|
|
285
|
-
shouldMoveWithDragEvent?: (sender: UIView, event: DragEvent) => boolean;
|
|
284
|
+
shouldMoveWithMouseEvent?: (sender: UIView, event: MouseEvent) => boolean;
|
|
286
285
|
viewDidMoveToPosition?: (view: UIView, isMovementCompleted: boolean) => void;
|
|
287
286
|
}): void;
|
|
288
287
|
get isResizable(): boolean;
|
|
289
288
|
set isResizable(isResizable: boolean);
|
|
290
|
-
|
|
289
|
+
makeResizable(optionalParameters?: {
|
|
291
290
|
overlayElement?: HTMLElement;
|
|
292
291
|
borderWidth?: number;
|
|
293
292
|
borderColor?: UIColor;
|
|
@@ -1040,22 +1040,21 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1040
1040
|
if (isMovable) {
|
|
1041
1041
|
this.makeMovable();
|
|
1042
1042
|
} else {
|
|
1043
|
-
(_a = this.
|
|
1043
|
+
(_a = this.makeNotMovable) == null ? void 0 : _a.call(this);
|
|
1044
1044
|
}
|
|
1045
1045
|
}
|
|
1046
1046
|
makeMovable(optionalParameters = {}) {
|
|
1047
|
-
var _a
|
|
1047
|
+
var _a;
|
|
1048
1048
|
if (this.isMovable) {
|
|
1049
1049
|
return;
|
|
1050
1050
|
}
|
|
1051
|
-
const
|
|
1052
|
-
const shouldMoveWithDragEvent = (_b = optionalParameters.shouldMoveWithDragEvent) != null ? _b : (sender, event) => (0, import_UIObject.IS)(event.altKey);
|
|
1051
|
+
const shouldMoveWithMouseEvent = (_a = optionalParameters.shouldMoveWithMouseEvent) != null ? _a : (sender, event) => (0, import_UIObject.IS)(event.altKey);
|
|
1053
1052
|
let viewValuesBeforeModifications = [];
|
|
1054
1053
|
let startPoint;
|
|
1055
1054
|
let views;
|
|
1056
1055
|
const movementFunction = (sender, event) => {
|
|
1057
1056
|
var _a2;
|
|
1058
|
-
if (event instanceof
|
|
1057
|
+
if (event instanceof MouseEvent && shouldMoveWithMouseEvent(sender, event)) {
|
|
1059
1058
|
if (!this._isMoving) {
|
|
1060
1059
|
startPoint = this.frame.min;
|
|
1061
1060
|
sender.pointerDraggingPoint = new import_UIPoint.UIPoint(0, 0);
|
|
@@ -1102,12 +1101,12 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1102
1101
|
movementStopFunction
|
|
1103
1102
|
);
|
|
1104
1103
|
this._isMovable = import_UIObject.NO;
|
|
1105
|
-
this.
|
|
1104
|
+
this.makeNotMovable = void 0;
|
|
1106
1105
|
};
|
|
1107
1106
|
this.controlEventTargetAccumulator.PointerDrag = movementFunction;
|
|
1108
1107
|
this.controlEventTargetAccumulator.PointerUp.PointerCancel = movementStopFunction;
|
|
1109
1108
|
this._isMovable = import_UIObject.YES;
|
|
1110
|
-
this.
|
|
1109
|
+
this.makeNotMovable = cleanupFunction;
|
|
1111
1110
|
}
|
|
1112
1111
|
get isResizable() {
|
|
1113
1112
|
return this._isResizable;
|
|
@@ -1115,12 +1114,12 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1115
1114
|
set isResizable(isResizable) {
|
|
1116
1115
|
var _a;
|
|
1117
1116
|
if (isResizable) {
|
|
1118
|
-
this.
|
|
1117
|
+
this.makeResizable();
|
|
1119
1118
|
} else {
|
|
1120
|
-
(_a = this.
|
|
1119
|
+
(_a = this.makeNotResizable) == null ? void 0 : _a.call(this);
|
|
1121
1120
|
}
|
|
1122
1121
|
}
|
|
1123
|
-
|
|
1122
|
+
makeResizable(optionalParameters = {}) {
|
|
1124
1123
|
var _a, _b, _c, _d, _e;
|
|
1125
1124
|
if (this.isResizable) {
|
|
1126
1125
|
return;
|
|
@@ -1158,7 +1157,7 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1158
1157
|
});
|
|
1159
1158
|
leftEdge.controlEventTargetAccumulator.PointerDrag = (sender, event) => {
|
|
1160
1159
|
var _a2;
|
|
1161
|
-
if (event instanceof
|
|
1160
|
+
if (event instanceof MouseEvent) {
|
|
1162
1161
|
this.frame = this.frame.rectangleWithInsets(event.movementX / _UIView.pageScale, 0, 0, 0);
|
|
1163
1162
|
(_a2 = optionalParameters.viewDidChangeToSize) == null ? void 0 : _a2.call(optionalParameters, this, import_UIObject.NO);
|
|
1164
1163
|
}
|
|
@@ -1188,7 +1187,7 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1188
1187
|
});
|
|
1189
1188
|
rightEdge.controlEventTargetAccumulator.PointerDrag = (sender, event) => {
|
|
1190
1189
|
var _a2;
|
|
1191
|
-
if (event instanceof
|
|
1190
|
+
if (event instanceof MouseEvent) {
|
|
1192
1191
|
this.frame = this.frame.rectangleWithInsets(0, -event.movementX / _UIView.pageScale, 0, 0);
|
|
1193
1192
|
(_a2 = optionalParameters.viewDidChangeToSize) == null ? void 0 : _a2.call(optionalParameters, this, import_UIObject.NO);
|
|
1194
1193
|
}
|
|
@@ -1218,7 +1217,7 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1218
1217
|
});
|
|
1219
1218
|
bottomEdge.controlEventTargetAccumulator.PointerDrag = (sender, event) => {
|
|
1220
1219
|
var _a2;
|
|
1221
|
-
if (event instanceof
|
|
1220
|
+
if (event instanceof MouseEvent) {
|
|
1222
1221
|
this.frame = this.frame.rectangleWithInsets(0, 0, -event.movementY / _UIView.pageScale, 0);
|
|
1223
1222
|
(_a2 = optionalParameters.viewDidChangeToSize) == null ? void 0 : _a2.call(optionalParameters, this, import_UIObject.NO);
|
|
1224
1223
|
}
|
|
@@ -1248,7 +1247,7 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1248
1247
|
});
|
|
1249
1248
|
topEdge.controlEventTargetAccumulator.PointerDrag = (sender, event) => {
|
|
1250
1249
|
var _a2;
|
|
1251
|
-
if (event instanceof
|
|
1250
|
+
if (event instanceof MouseEvent) {
|
|
1252
1251
|
this.frame = this.frame.rectangleWithInsets(0, 0, 0, event.movementY / _UIView.pageScale);
|
|
1253
1252
|
(_a2 = optionalParameters.viewDidChangeToSize) == null ? void 0 : _a2.call(optionalParameters, this, import_UIObject.NO);
|
|
1254
1253
|
}
|
|
@@ -1279,7 +1278,7 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1279
1278
|
});
|
|
1280
1279
|
const pointerDragTLFunction = (sender, event) => {
|
|
1281
1280
|
var _a2;
|
|
1282
|
-
if (event instanceof
|
|
1281
|
+
if (event instanceof MouseEvent) {
|
|
1283
1282
|
this.frame = this.frame.rectangleWithInsets(
|
|
1284
1283
|
event.movementX / _UIView.pageScale,
|
|
1285
1284
|
0,
|
|
@@ -1341,7 +1340,7 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1341
1340
|
});
|
|
1342
1341
|
const pointerDragBLFunction = (sender, event) => {
|
|
1343
1342
|
var _a2;
|
|
1344
|
-
if (event instanceof
|
|
1343
|
+
if (event instanceof MouseEvent) {
|
|
1345
1344
|
this.frame = this.frame.rectangleWithInsets(
|
|
1346
1345
|
event.movementX / _UIView.pageScale,
|
|
1347
1346
|
0,
|
|
@@ -1403,7 +1402,7 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1403
1402
|
});
|
|
1404
1403
|
const pointerDragBRFunction = (sender, event) => {
|
|
1405
1404
|
var _a2;
|
|
1406
|
-
if (event instanceof
|
|
1405
|
+
if (event instanceof MouseEvent) {
|
|
1407
1406
|
this.frame = this.frame.rectangleWithInsets(
|
|
1408
1407
|
0,
|
|
1409
1408
|
-event.movementX / _UIView.pageScale,
|
|
@@ -1465,7 +1464,7 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1465
1464
|
});
|
|
1466
1465
|
const pointerDragTRFunction = (sender, event) => {
|
|
1467
1466
|
var _a2;
|
|
1468
|
-
if (event instanceof
|
|
1467
|
+
if (event instanceof MouseEvent) {
|
|
1469
1468
|
this.frame = this.frame.rectangleWithInsets(
|
|
1470
1469
|
0,
|
|
1471
1470
|
-event.movementX / _UIView.pageScale,
|
|
@@ -1518,9 +1517,12 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1518
1517
|
];
|
|
1519
1518
|
views.forEach((view) => overlayElement.appendChild(view.viewHTMLElement));
|
|
1520
1519
|
this._isResizable = import_UIObject.YES;
|
|
1521
|
-
this.
|
|
1520
|
+
this.makeNotResizable = () => {
|
|
1521
|
+
if (!this.isResizable) {
|
|
1522
|
+
return;
|
|
1523
|
+
}
|
|
1522
1524
|
views.everyElement.viewHTMLElement.remove();
|
|
1523
|
-
this.
|
|
1525
|
+
this.makeNotResizable = void 0;
|
|
1524
1526
|
this._isResizable = import_UIObject.NO;
|
|
1525
1527
|
};
|
|
1526
1528
|
}
|