uicore-ts 1.0.207 → 1.0.212
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 +2 -0
- package/compiledScripts/UIView.js +110 -81
- package/compiledScripts/UIView.js.map +2 -2
- package/package.json +1 -1
- package/scripts/UIView.ts +144 -179
|
@@ -120,6 +120,8 @@ export declare class UIView extends UIObject {
|
|
|
120
120
|
private _isResizable;
|
|
121
121
|
makeNotResizable?: () => void;
|
|
122
122
|
private _isMoving;
|
|
123
|
+
_isCBEditorTemporaryResizable: boolean;
|
|
124
|
+
_isCBEditorTemporaryMovable: boolean;
|
|
123
125
|
constructor(elementID?: string, viewHTMLElement?: HTMLElement & LooseObject | null, elementType?: string | null, initViewData?: any);
|
|
124
126
|
static get nextIndex(): number;
|
|
125
127
|
static get pageHeight(): number;
|
|
@@ -84,6 +84,8 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
84
84
|
this._isMovable = import_UIObject.NO;
|
|
85
85
|
this._isResizable = import_UIObject.NO;
|
|
86
86
|
this._isMoving = import_UIObject.NO;
|
|
87
|
+
this._isCBEditorTemporaryResizable = import_UIObject.NO;
|
|
88
|
+
this._isCBEditorTemporaryMovable = import_UIObject.NO;
|
|
87
89
|
this.controlEvent = _UIView.controlEvent;
|
|
88
90
|
_UIView._UIViewIndex = _UIView.nextIndex;
|
|
89
91
|
this._UIViewIndex = _UIView._UIViewIndex;
|
|
@@ -1136,9 +1138,13 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1136
1138
|
const borderColor = (_c = (_b = optionalParameters.borderColor) == null ? void 0 : _b.stringValue) != null ? _c : import_UIColor.UIColor.transparentColor.stringValue;
|
|
1137
1139
|
const maxCornerSize = (_d = optionalParameters.maxCornerSize) != null ? _d : "10px";
|
|
1138
1140
|
const cornerSize = (_e = optionalParameters.cornerSize) != null ? _e : "5%";
|
|
1141
|
+
let yOverflow = 0;
|
|
1142
|
+
let xOverflow = 0;
|
|
1139
1143
|
const pointerUpFunction = () => {
|
|
1140
1144
|
var _a2;
|
|
1141
|
-
|
|
1145
|
+
yOverflow = 0;
|
|
1146
|
+
xOverflow = 0;
|
|
1147
|
+
(_a2 = optionalParameters.viewDidChangeToSize) == null ? void 0 : _a2.call(optionalParameters, this, import_UIObject.YES);
|
|
1142
1148
|
};
|
|
1143
1149
|
const frameWasChanged = () => {
|
|
1144
1150
|
var _a2;
|
|
@@ -1155,21 +1161,92 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1155
1161
|
(0, import_SizeConverter.default)(this.viewHTMLElement, this.style.maxHeight)
|
|
1156
1162
|
].min();
|
|
1157
1163
|
}
|
|
1158
|
-
|
|
1159
|
-
frame.width = [
|
|
1160
|
-
frame.width,
|
|
1161
|
-
(0, import_SizeConverter.default)(this.viewHTMLElement, this.style.minWidth)
|
|
1162
|
-
].max();
|
|
1163
|
-
}
|
|
1164
|
-
if (this.style.maxWidth) {
|
|
1165
|
-
frame.width = [
|
|
1166
|
-
frame.width,
|
|
1167
|
-
(0, import_SizeConverter.default)(this.viewHTMLElement, this.style.maxWidth)
|
|
1168
|
-
].min();
|
|
1169
|
-
}
|
|
1164
|
+
yOverflow = yOverflow + this.frame.height - frame.height;
|
|
1170
1165
|
this.frame = frame;
|
|
1171
1166
|
(_a2 = optionalParameters.viewDidChangeToSize) == null ? void 0 : _a2.call(optionalParameters, this, import_UIObject.NO);
|
|
1172
1167
|
};
|
|
1168
|
+
const PointerXDragFunction = (centeredOnPosition, sender, event) => {
|
|
1169
|
+
if (event instanceof MouseEvent) {
|
|
1170
|
+
const signMultiplier = 1 - 2 * centeredOnPosition;
|
|
1171
|
+
let movementX = event.movementX;
|
|
1172
|
+
if (xOverflow * signMultiplier > 0 && 0 > movementX) {
|
|
1173
|
+
xOverflow = (xOverflow + movementX / _UIView.pageScale).integerValue;
|
|
1174
|
+
if (xOverflow >= 0) {
|
|
1175
|
+
return;
|
|
1176
|
+
}
|
|
1177
|
+
movementX = xOverflow;
|
|
1178
|
+
xOverflow = 0;
|
|
1179
|
+
}
|
|
1180
|
+
if (xOverflow > 0 && 0 < movementX && signMultiplier < 0) {
|
|
1181
|
+
xOverflow = (xOverflow + signMultiplier * movementX / _UIView.pageScale).integerValue;
|
|
1182
|
+
if (xOverflow >= 0) {
|
|
1183
|
+
return;
|
|
1184
|
+
}
|
|
1185
|
+
movementX = xOverflow * signMultiplier;
|
|
1186
|
+
xOverflow = 0;
|
|
1187
|
+
}
|
|
1188
|
+
const frame = this.frame;
|
|
1189
|
+
const widthChange = signMultiplier * movementX / _UIView.pageScale;
|
|
1190
|
+
let frameWidth = frame.width + widthChange;
|
|
1191
|
+
if (this.style.minWidth) {
|
|
1192
|
+
frameWidth = [
|
|
1193
|
+
frameWidth,
|
|
1194
|
+
(0, import_SizeConverter.default)(this.viewHTMLElement, this.style.minWidth),
|
|
1195
|
+
0
|
|
1196
|
+
].max();
|
|
1197
|
+
}
|
|
1198
|
+
if (this.style.maxWidth) {
|
|
1199
|
+
frameWidth = [
|
|
1200
|
+
frameWidth,
|
|
1201
|
+
(0, import_SizeConverter.default)(this.viewHTMLElement, this.style.maxWidth)
|
|
1202
|
+
].min();
|
|
1203
|
+
}
|
|
1204
|
+
xOverflow = (xOverflow + frame.width + widthChange - frameWidth).integerValue;
|
|
1205
|
+
this.frame = frame.rectangleWithWidth(frameWidth, centeredOnPosition);
|
|
1206
|
+
frameWasChanged();
|
|
1207
|
+
}
|
|
1208
|
+
};
|
|
1209
|
+
const PointerYDragFunction = (centeredOnPosition, sender, event) => {
|
|
1210
|
+
if (event instanceof MouseEvent) {
|
|
1211
|
+
const signMultiplier = 1 - 2 * centeredOnPosition;
|
|
1212
|
+
let movementY = event.movementY;
|
|
1213
|
+
if (yOverflow * signMultiplier > 0 && 0 > movementY) {
|
|
1214
|
+
yOverflow = (yOverflow + movementY / _UIView.pageScale).integerValue;
|
|
1215
|
+
if (yOverflow >= 0) {
|
|
1216
|
+
return;
|
|
1217
|
+
}
|
|
1218
|
+
movementY = yOverflow;
|
|
1219
|
+
yOverflow = 0;
|
|
1220
|
+
}
|
|
1221
|
+
if (yOverflow > 0 && 0 < movementY && signMultiplier < 0) {
|
|
1222
|
+
yOverflow = (yOverflow + signMultiplier * movementY / _UIView.pageScale).integerValue;
|
|
1223
|
+
if (yOverflow >= 0) {
|
|
1224
|
+
return;
|
|
1225
|
+
}
|
|
1226
|
+
movementY = yOverflow * signMultiplier;
|
|
1227
|
+
yOverflow = 0;
|
|
1228
|
+
}
|
|
1229
|
+
const frame = this.frame;
|
|
1230
|
+
const heightChange = signMultiplier * movementY / _UIView.pageScale;
|
|
1231
|
+
let frameHeight = frame.height + heightChange;
|
|
1232
|
+
if (this.style.minHeight) {
|
|
1233
|
+
frameHeight = [
|
|
1234
|
+
frameHeight,
|
|
1235
|
+
(0, import_SizeConverter.default)(this.viewHTMLElement, this.style.minHeight),
|
|
1236
|
+
0
|
|
1237
|
+
].max();
|
|
1238
|
+
}
|
|
1239
|
+
if (this.style.maxHeight) {
|
|
1240
|
+
frameHeight = [
|
|
1241
|
+
frameHeight,
|
|
1242
|
+
(0, import_SizeConverter.default)(this.viewHTMLElement, this.style.maxHeight)
|
|
1243
|
+
].min();
|
|
1244
|
+
}
|
|
1245
|
+
yOverflow = (yOverflow + frame.height + heightChange - frameHeight).integerValue;
|
|
1246
|
+
this.frame = frame.rectangleWithHeight(frameHeight, centeredOnPosition);
|
|
1247
|
+
frameWasChanged();
|
|
1248
|
+
}
|
|
1249
|
+
};
|
|
1173
1250
|
const leftEdge = new _UIView().configuredWithObject({
|
|
1174
1251
|
_viewHTMLElement: {
|
|
1175
1252
|
className: "leftEdge",
|
|
@@ -1192,12 +1269,7 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1192
1269
|
}),
|
|
1193
1270
|
pausesPointerEvents: import_UIObject.YES
|
|
1194
1271
|
});
|
|
1195
|
-
leftEdge.controlEventTargetAccumulator.PointerDrag = (
|
|
1196
|
-
if (event instanceof MouseEvent) {
|
|
1197
|
-
this.frame = this.frame.rectangleWithInsets(event.movementX / _UIView.pageScale, 0, 0, 0);
|
|
1198
|
-
frameWasChanged();
|
|
1199
|
-
}
|
|
1200
|
-
};
|
|
1272
|
+
leftEdge.controlEventTargetAccumulator.PointerDrag = PointerXDragFunction.bind(this, 1);
|
|
1201
1273
|
leftEdge.controlEventTargetAccumulator.PointerUp = pointerUpFunction;
|
|
1202
1274
|
const rightEdge = new _UIView().configuredWithObject({
|
|
1203
1275
|
_viewHTMLElement: {
|
|
@@ -1221,12 +1293,7 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1221
1293
|
}),
|
|
1222
1294
|
pausesPointerEvents: import_UIObject.YES
|
|
1223
1295
|
});
|
|
1224
|
-
rightEdge.controlEventTargetAccumulator.PointerDrag = (
|
|
1225
|
-
if (event instanceof MouseEvent) {
|
|
1226
|
-
this.frame = this.frame.rectangleWithInsets(0, -event.movementX / _UIView.pageScale, 0, 0);
|
|
1227
|
-
frameWasChanged();
|
|
1228
|
-
}
|
|
1229
|
-
};
|
|
1296
|
+
rightEdge.controlEventTargetAccumulator.PointerDrag = PointerXDragFunction.bind(this, 0);
|
|
1230
1297
|
rightEdge.controlEventTargetAccumulator.PointerUp = pointerUpFunction;
|
|
1231
1298
|
const bottomEdge = new _UIView().configuredWithObject({
|
|
1232
1299
|
_viewHTMLElement: {
|
|
@@ -1250,12 +1317,7 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1250
1317
|
}),
|
|
1251
1318
|
pausesPointerEvents: import_UIObject.YES
|
|
1252
1319
|
});
|
|
1253
|
-
bottomEdge.controlEventTargetAccumulator.PointerDrag = (
|
|
1254
|
-
if (event instanceof MouseEvent) {
|
|
1255
|
-
this.frame = this.frame.rectangleWithInsets(0, 0, -event.movementY / _UIView.pageScale, 0);
|
|
1256
|
-
frameWasChanged();
|
|
1257
|
-
}
|
|
1258
|
-
};
|
|
1320
|
+
bottomEdge.controlEventTargetAccumulator.PointerDrag = PointerYDragFunction.bind(this, 0);
|
|
1259
1321
|
bottomEdge.controlEventTargetAccumulator.PointerUp = pointerUpFunction;
|
|
1260
1322
|
const topEdge = new _UIView().configuredWithObject({
|
|
1261
1323
|
_viewHTMLElement: {
|
|
@@ -1279,13 +1341,12 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1279
1341
|
}),
|
|
1280
1342
|
pausesPointerEvents: import_UIObject.YES
|
|
1281
1343
|
});
|
|
1282
|
-
topEdge.controlEventTargetAccumulator.PointerDrag = (
|
|
1283
|
-
if (event instanceof MouseEvent) {
|
|
1284
|
-
this.frame = this.frame.rectangleWithInsets(0, 0, 0, event.movementY / _UIView.pageScale);
|
|
1285
|
-
frameWasChanged();
|
|
1286
|
-
}
|
|
1287
|
-
};
|
|
1344
|
+
topEdge.controlEventTargetAccumulator.PointerDrag = PointerYDragFunction.bind(this, 1);
|
|
1288
1345
|
topEdge.controlEventTargetAccumulator.PointerUp = pointerUpFunction;
|
|
1346
|
+
const pointerDragTLFunction = (sender, event) => {
|
|
1347
|
+
PointerXDragFunction(1, sender, event);
|
|
1348
|
+
PointerYDragFunction(1, sender, event);
|
|
1349
|
+
};
|
|
1289
1350
|
const topLeftCornerTop = new _UIView().configuredWithObject({
|
|
1290
1351
|
_viewHTMLElement: {
|
|
1291
1352
|
className: "topLeftCornerTop",
|
|
@@ -1309,17 +1370,6 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1309
1370
|
}),
|
|
1310
1371
|
pausesPointerEvents: import_UIObject.YES
|
|
1311
1372
|
});
|
|
1312
|
-
const pointerDragTLFunction = (sender, event) => {
|
|
1313
|
-
if (event instanceof MouseEvent) {
|
|
1314
|
-
this.frame = this.frame.rectangleWithInsets(
|
|
1315
|
-
event.movementX / _UIView.pageScale,
|
|
1316
|
-
0,
|
|
1317
|
-
0,
|
|
1318
|
-
event.movementY / _UIView.pageScale
|
|
1319
|
-
);
|
|
1320
|
-
frameWasChanged();
|
|
1321
|
-
}
|
|
1322
|
-
};
|
|
1323
1373
|
topLeftCornerTop.controlEventTargetAccumulator.PointerDrag = pointerDragTLFunction;
|
|
1324
1374
|
topLeftCornerTop.controlEventTargetAccumulator.PointerUp = pointerUpFunction;
|
|
1325
1375
|
const topLeftCornerLeft = new _UIView().configuredWithObject({
|
|
@@ -1347,6 +1397,10 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1347
1397
|
});
|
|
1348
1398
|
topLeftCornerLeft.controlEventTargetAccumulator.PointerDrag = pointerDragTLFunction;
|
|
1349
1399
|
topLeftCornerLeft.controlEventTargetAccumulator.PointerUp = pointerUpFunction;
|
|
1400
|
+
const pointerDragBLFunction = (sender, event) => {
|
|
1401
|
+
PointerXDragFunction(1, sender, event);
|
|
1402
|
+
PointerYDragFunction(0, sender, event);
|
|
1403
|
+
};
|
|
1350
1404
|
const bottomLeftCornerLeft = new _UIView().configuredWithObject({
|
|
1351
1405
|
_viewHTMLElement: {
|
|
1352
1406
|
className: "bottomLeftCornerLeft",
|
|
@@ -1370,17 +1424,6 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1370
1424
|
}),
|
|
1371
1425
|
pausesPointerEvents: import_UIObject.YES
|
|
1372
1426
|
});
|
|
1373
|
-
const pointerDragBLFunction = (sender, event) => {
|
|
1374
|
-
if (event instanceof MouseEvent) {
|
|
1375
|
-
this.frame = this.frame.rectangleWithInsets(
|
|
1376
|
-
event.movementX / _UIView.pageScale,
|
|
1377
|
-
0,
|
|
1378
|
-
-event.movementY / _UIView.pageScale,
|
|
1379
|
-
0
|
|
1380
|
-
);
|
|
1381
|
-
frameWasChanged();
|
|
1382
|
-
}
|
|
1383
|
-
};
|
|
1384
1427
|
bottomLeftCornerLeft.controlEventTargetAccumulator.PointerDrag = pointerDragBLFunction;
|
|
1385
1428
|
bottomLeftCornerLeft.controlEventTargetAccumulator.PointerUp = pointerUpFunction;
|
|
1386
1429
|
const bottomLeftCornerBottom = new _UIView().configuredWithObject({
|
|
@@ -1408,6 +1451,10 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1408
1451
|
});
|
|
1409
1452
|
bottomLeftCornerBottom.controlEventTargetAccumulator.PointerDrag = pointerDragBLFunction;
|
|
1410
1453
|
bottomLeftCornerBottom.controlEventTargetAccumulator.PointerUp = pointerUpFunction;
|
|
1454
|
+
const pointerDragBRFunction = (sender, event) => {
|
|
1455
|
+
PointerXDragFunction(0, sender, event);
|
|
1456
|
+
PointerYDragFunction(0, sender, event);
|
|
1457
|
+
};
|
|
1411
1458
|
const bottomRightCornerBottom = new _UIView().configuredWithObject({
|
|
1412
1459
|
_viewHTMLElement: {
|
|
1413
1460
|
className: "bottomRightCornerBottom",
|
|
@@ -1431,17 +1478,6 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1431
1478
|
}),
|
|
1432
1479
|
pausesPointerEvents: import_UIObject.YES
|
|
1433
1480
|
});
|
|
1434
|
-
const pointerDragBRFunction = (sender, event) => {
|
|
1435
|
-
if (event instanceof MouseEvent) {
|
|
1436
|
-
this.frame = this.frame.rectangleWithInsets(
|
|
1437
|
-
0,
|
|
1438
|
-
-event.movementX / _UIView.pageScale,
|
|
1439
|
-
-event.movementY / _UIView.pageScale,
|
|
1440
|
-
0
|
|
1441
|
-
);
|
|
1442
|
-
frameWasChanged();
|
|
1443
|
-
}
|
|
1444
|
-
};
|
|
1445
1481
|
bottomRightCornerBottom.controlEventTargetAccumulator.PointerDrag = pointerDragBRFunction;
|
|
1446
1482
|
bottomRightCornerBottom.controlEventTargetAccumulator.PointerUp = pointerUpFunction;
|
|
1447
1483
|
const bottomRightCornerRight = new _UIView().configuredWithObject({
|
|
@@ -1469,6 +1505,10 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1469
1505
|
});
|
|
1470
1506
|
bottomRightCornerRight.controlEventTargetAccumulator.PointerDrag = pointerDragBRFunction;
|
|
1471
1507
|
bottomRightCornerRight.controlEventTargetAccumulator.PointerUp = pointerUpFunction;
|
|
1508
|
+
const pointerDragTRFunction = (sender, event) => {
|
|
1509
|
+
PointerXDragFunction(0, sender, event);
|
|
1510
|
+
PointerYDragFunction(1, sender, event);
|
|
1511
|
+
};
|
|
1472
1512
|
const topRightCornerRight = new _UIView().configuredWithObject({
|
|
1473
1513
|
_viewHTMLElement: {
|
|
1474
1514
|
className: "topRightCornerRight",
|
|
@@ -1492,17 +1532,6 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1492
1532
|
}),
|
|
1493
1533
|
pausesPointerEvents: import_UIObject.YES
|
|
1494
1534
|
});
|
|
1495
|
-
const pointerDragTRFunction = (sender, event) => {
|
|
1496
|
-
if (event instanceof MouseEvent) {
|
|
1497
|
-
this.frame = this.frame.rectangleWithInsets(
|
|
1498
|
-
0,
|
|
1499
|
-
-event.movementX / _UIView.pageScale,
|
|
1500
|
-
0,
|
|
1501
|
-
event.movementY / _UIView.pageScale
|
|
1502
|
-
);
|
|
1503
|
-
frameWasChanged();
|
|
1504
|
-
}
|
|
1505
|
-
};
|
|
1506
1535
|
topRightCornerRight.controlEventTargetAccumulator.PointerDrag = pointerDragTRFunction;
|
|
1507
1536
|
topRightCornerRight.controlEventTargetAccumulator.PointerUp = pointerUpFunction;
|
|
1508
1537
|
const topRightCornerTop = new _UIView().configuredWithObject({
|