uicore-ts 1.0.208 → 1.0.215
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 +92 -73
- package/compiledScripts/UIView.js.map +2 -2
- package/package.json +1 -1
- package/scripts/UIView.ts +117 -175
|
@@ -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,12 +1138,12 @@ 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%";
|
|
1139
|
-
let
|
|
1140
|
-
let
|
|
1141
|
+
let yOverflow = 0;
|
|
1142
|
+
let xOverflow = 0;
|
|
1141
1143
|
const pointerUpFunction = () => {
|
|
1142
1144
|
var _a2;
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
+
yOverflow = 0;
|
|
1146
|
+
xOverflow = 0;
|
|
1145
1147
|
(_a2 = optionalParameters.viewDidChangeToSize) == null ? void 0 : _a2.call(optionalParameters, this, import_UIObject.YES);
|
|
1146
1148
|
};
|
|
1147
1149
|
const frameWasChanged = () => {
|
|
@@ -1159,18 +1161,38 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1159
1161
|
(0, import_SizeConverter.default)(this.viewHTMLElement, this.style.maxHeight)
|
|
1160
1162
|
].min();
|
|
1161
1163
|
}
|
|
1162
|
-
|
|
1164
|
+
yOverflow = yOverflow + this.frame.height - frame.height;
|
|
1163
1165
|
this.frame = frame;
|
|
1164
1166
|
(_a2 = optionalParameters.viewDidChangeToSize) == null ? void 0 : _a2.call(optionalParameters, this, import_UIObject.NO);
|
|
1165
1167
|
};
|
|
1166
|
-
const
|
|
1168
|
+
const PointerXDragFunction = (centeredOnPosition, sender, event) => {
|
|
1167
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
|
+
}
|
|
1168
1188
|
const frame = this.frame;
|
|
1169
|
-
|
|
1189
|
+
const widthChange = signMultiplier * movementX / _UIView.pageScale;
|
|
1190
|
+
let frameWidth = frame.width + widthChange;
|
|
1170
1191
|
if (this.style.minWidth) {
|
|
1171
1192
|
frameWidth = [
|
|
1172
1193
|
frameWidth,
|
|
1173
|
-
(0, import_SizeConverter.default)(this.viewHTMLElement, this.style.minWidth)
|
|
1194
|
+
(0, import_SizeConverter.default)(this.viewHTMLElement, this.style.minWidth),
|
|
1195
|
+
0
|
|
1174
1196
|
].max();
|
|
1175
1197
|
}
|
|
1176
1198
|
if (this.style.maxWidth) {
|
|
@@ -1179,11 +1201,52 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1179
1201
|
(0, import_SizeConverter.default)(this.viewHTMLElement, this.style.maxWidth)
|
|
1180
1202
|
].min();
|
|
1181
1203
|
}
|
|
1182
|
-
|
|
1204
|
+
xOverflow = (xOverflow + frame.width + widthChange - frameWidth).integerValue;
|
|
1183
1205
|
this.frame = frame.rectangleWithWidth(frameWidth, centeredOnPosition);
|
|
1184
1206
|
frameWasChanged();
|
|
1185
1207
|
}
|
|
1186
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
|
+
};
|
|
1187
1250
|
const leftEdge = new _UIView().configuredWithObject({
|
|
1188
1251
|
_viewHTMLElement: {
|
|
1189
1252
|
className: "leftEdge",
|
|
@@ -1206,7 +1269,7 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1206
1269
|
}),
|
|
1207
1270
|
pausesPointerEvents: import_UIObject.YES
|
|
1208
1271
|
});
|
|
1209
|
-
leftEdge.controlEventTargetAccumulator.PointerDrag =
|
|
1272
|
+
leftEdge.controlEventTargetAccumulator.PointerDrag = PointerXDragFunction.bind(this, 1);
|
|
1210
1273
|
leftEdge.controlEventTargetAccumulator.PointerUp = pointerUpFunction;
|
|
1211
1274
|
const rightEdge = new _UIView().configuredWithObject({
|
|
1212
1275
|
_viewHTMLElement: {
|
|
@@ -1230,7 +1293,7 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1230
1293
|
}),
|
|
1231
1294
|
pausesPointerEvents: import_UIObject.YES
|
|
1232
1295
|
});
|
|
1233
|
-
rightEdge.controlEventTargetAccumulator.PointerDrag =
|
|
1296
|
+
rightEdge.controlEventTargetAccumulator.PointerDrag = PointerXDragFunction.bind(this, 0);
|
|
1234
1297
|
rightEdge.controlEventTargetAccumulator.PointerUp = pointerUpFunction;
|
|
1235
1298
|
const bottomEdge = new _UIView().configuredWithObject({
|
|
1236
1299
|
_viewHTMLElement: {
|
|
@@ -1254,13 +1317,7 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1254
1317
|
}),
|
|
1255
1318
|
pausesPointerEvents: import_UIObject.YES
|
|
1256
1319
|
});
|
|
1257
|
-
bottomEdge.controlEventTargetAccumulator.PointerDrag = (
|
|
1258
|
-
if (event instanceof MouseEvent) {
|
|
1259
|
-
const frame = this.frame;
|
|
1260
|
-
this.frame = this.frame.rectangleWithInsets(0, 0, -event.movementY / _UIView.pageScale, 0);
|
|
1261
|
-
frameWasChanged();
|
|
1262
|
-
}
|
|
1263
|
-
};
|
|
1320
|
+
bottomEdge.controlEventTargetAccumulator.PointerDrag = PointerYDragFunction.bind(this, 0);
|
|
1264
1321
|
bottomEdge.controlEventTargetAccumulator.PointerUp = pointerUpFunction;
|
|
1265
1322
|
const topEdge = new _UIView().configuredWithObject({
|
|
1266
1323
|
_viewHTMLElement: {
|
|
@@ -1284,14 +1341,12 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1284
1341
|
}),
|
|
1285
1342
|
pausesPointerEvents: import_UIObject.YES
|
|
1286
1343
|
});
|
|
1287
|
-
topEdge.controlEventTargetAccumulator.PointerDrag = (
|
|
1288
|
-
if (event instanceof MouseEvent) {
|
|
1289
|
-
const frame = this.frame;
|
|
1290
|
-
this.frame = this.frame.rectangleWithInsets(0, 0, 0, event.movementY / _UIView.pageScale);
|
|
1291
|
-
frameWasChanged();
|
|
1292
|
-
}
|
|
1293
|
-
};
|
|
1344
|
+
topEdge.controlEventTargetAccumulator.PointerDrag = PointerYDragFunction.bind(this, 1);
|
|
1294
1345
|
topEdge.controlEventTargetAccumulator.PointerUp = pointerUpFunction;
|
|
1346
|
+
const pointerDragTLFunction = (sender, event) => {
|
|
1347
|
+
PointerXDragFunction(1, sender, event);
|
|
1348
|
+
PointerYDragFunction(1, sender, event);
|
|
1349
|
+
};
|
|
1295
1350
|
const topLeftCornerTop = new _UIView().configuredWithObject({
|
|
1296
1351
|
_viewHTMLElement: {
|
|
1297
1352
|
className: "topLeftCornerTop",
|
|
@@ -1315,18 +1370,6 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1315
1370
|
}),
|
|
1316
1371
|
pausesPointerEvents: import_UIObject.YES
|
|
1317
1372
|
});
|
|
1318
|
-
const pointerDragTLFunction = (sender, event) => {
|
|
1319
|
-
if (event instanceof MouseEvent) {
|
|
1320
|
-
const frame = this.frame;
|
|
1321
|
-
this.frame = this.frame.rectangleWithInsets(
|
|
1322
|
-
event.movementX / _UIView.pageScale,
|
|
1323
|
-
0,
|
|
1324
|
-
0,
|
|
1325
|
-
event.movementY / _UIView.pageScale
|
|
1326
|
-
);
|
|
1327
|
-
frameWasChanged();
|
|
1328
|
-
}
|
|
1329
|
-
};
|
|
1330
1373
|
topLeftCornerTop.controlEventTargetAccumulator.PointerDrag = pointerDragTLFunction;
|
|
1331
1374
|
topLeftCornerTop.controlEventTargetAccumulator.PointerUp = pointerUpFunction;
|
|
1332
1375
|
const topLeftCornerLeft = new _UIView().configuredWithObject({
|
|
@@ -1354,6 +1397,10 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1354
1397
|
});
|
|
1355
1398
|
topLeftCornerLeft.controlEventTargetAccumulator.PointerDrag = pointerDragTLFunction;
|
|
1356
1399
|
topLeftCornerLeft.controlEventTargetAccumulator.PointerUp = pointerUpFunction;
|
|
1400
|
+
const pointerDragBLFunction = (sender, event) => {
|
|
1401
|
+
PointerXDragFunction(1, sender, event);
|
|
1402
|
+
PointerYDragFunction(0, sender, event);
|
|
1403
|
+
};
|
|
1357
1404
|
const bottomLeftCornerLeft = new _UIView().configuredWithObject({
|
|
1358
1405
|
_viewHTMLElement: {
|
|
1359
1406
|
className: "bottomLeftCornerLeft",
|
|
@@ -1377,18 +1424,6 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1377
1424
|
}),
|
|
1378
1425
|
pausesPointerEvents: import_UIObject.YES
|
|
1379
1426
|
});
|
|
1380
|
-
const pointerDragBLFunction = (sender, event) => {
|
|
1381
|
-
if (event instanceof MouseEvent) {
|
|
1382
|
-
const frame = this.frame;
|
|
1383
|
-
this.frame = this.frame.rectangleWithInsets(
|
|
1384
|
-
event.movementX / _UIView.pageScale,
|
|
1385
|
-
0,
|
|
1386
|
-
-event.movementY / _UIView.pageScale,
|
|
1387
|
-
0
|
|
1388
|
-
);
|
|
1389
|
-
frameWasChanged();
|
|
1390
|
-
}
|
|
1391
|
-
};
|
|
1392
1427
|
bottomLeftCornerLeft.controlEventTargetAccumulator.PointerDrag = pointerDragBLFunction;
|
|
1393
1428
|
bottomLeftCornerLeft.controlEventTargetAccumulator.PointerUp = pointerUpFunction;
|
|
1394
1429
|
const bottomLeftCornerBottom = new _UIView().configuredWithObject({
|
|
@@ -1416,6 +1451,10 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1416
1451
|
});
|
|
1417
1452
|
bottomLeftCornerBottom.controlEventTargetAccumulator.PointerDrag = pointerDragBLFunction;
|
|
1418
1453
|
bottomLeftCornerBottom.controlEventTargetAccumulator.PointerUp = pointerUpFunction;
|
|
1454
|
+
const pointerDragBRFunction = (sender, event) => {
|
|
1455
|
+
PointerXDragFunction(0, sender, event);
|
|
1456
|
+
PointerYDragFunction(0, sender, event);
|
|
1457
|
+
};
|
|
1419
1458
|
const bottomRightCornerBottom = new _UIView().configuredWithObject({
|
|
1420
1459
|
_viewHTMLElement: {
|
|
1421
1460
|
className: "bottomRightCornerBottom",
|
|
@@ -1439,18 +1478,6 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1439
1478
|
}),
|
|
1440
1479
|
pausesPointerEvents: import_UIObject.YES
|
|
1441
1480
|
});
|
|
1442
|
-
const pointerDragBRFunction = (sender, event) => {
|
|
1443
|
-
if (event instanceof MouseEvent) {
|
|
1444
|
-
const frame = this.frame;
|
|
1445
|
-
this.frame = this.frame.rectangleWithInsets(
|
|
1446
|
-
0,
|
|
1447
|
-
-event.movementX / _UIView.pageScale,
|
|
1448
|
-
-event.movementY / _UIView.pageScale,
|
|
1449
|
-
0
|
|
1450
|
-
);
|
|
1451
|
-
frameWasChanged();
|
|
1452
|
-
}
|
|
1453
|
-
};
|
|
1454
1481
|
bottomRightCornerBottom.controlEventTargetAccumulator.PointerDrag = pointerDragBRFunction;
|
|
1455
1482
|
bottomRightCornerBottom.controlEventTargetAccumulator.PointerUp = pointerUpFunction;
|
|
1456
1483
|
const bottomRightCornerRight = new _UIView().configuredWithObject({
|
|
@@ -1478,6 +1505,10 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1478
1505
|
});
|
|
1479
1506
|
bottomRightCornerRight.controlEventTargetAccumulator.PointerDrag = pointerDragBRFunction;
|
|
1480
1507
|
bottomRightCornerRight.controlEventTargetAccumulator.PointerUp = pointerUpFunction;
|
|
1508
|
+
const pointerDragTRFunction = (sender, event) => {
|
|
1509
|
+
PointerXDragFunction(0, sender, event);
|
|
1510
|
+
PointerYDragFunction(1, sender, event);
|
|
1511
|
+
};
|
|
1481
1512
|
const topRightCornerRight = new _UIView().configuredWithObject({
|
|
1482
1513
|
_viewHTMLElement: {
|
|
1483
1514
|
className: "topRightCornerRight",
|
|
@@ -1501,18 +1532,6 @@ const _UIView = class extends import_UIObject.UIObject {
|
|
|
1501
1532
|
}),
|
|
1502
1533
|
pausesPointerEvents: import_UIObject.YES
|
|
1503
1534
|
});
|
|
1504
|
-
const pointerDragTRFunction = (sender, event) => {
|
|
1505
|
-
if (event instanceof MouseEvent) {
|
|
1506
|
-
const frame = this.frame;
|
|
1507
|
-
this.frame = this.frame.rectangleWithInsets(
|
|
1508
|
-
0,
|
|
1509
|
-
-event.movementX / _UIView.pageScale,
|
|
1510
|
-
0,
|
|
1511
|
-
event.movementY / _UIView.pageScale
|
|
1512
|
-
);
|
|
1513
|
-
frameWasChanged();
|
|
1514
|
-
}
|
|
1515
|
-
};
|
|
1516
1535
|
topRightCornerRight.controlEventTargetAccumulator.PointerDrag = pointerDragTRFunction;
|
|
1517
1536
|
topRightCornerRight.controlEventTargetAccumulator.PointerUp = pointerUpFunction;
|
|
1518
1537
|
const topRightCornerTop = new _UIView().configuredWithObject({
|