@ui5/webcomponents-base 2.17.0-rc.5 → 2.18.0-rc.0
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/CHANGELOG.md +23 -0
- package/dist/.tsbuildinfobuild +1 -1
- package/dist/InitialConfiguration.d.ts +1 -2
- package/dist/InitialConfiguration.js +1 -6
- package/dist/InitialConfiguration.js.map +1 -1
- package/dist/config/Theme.d.ts +1 -21
- package/dist/config/Theme.js +2 -30
- package/dist/config/Theme.js.map +1 -1
- package/dist/css/OpenUI5PopupStyles.css +5 -0
- package/dist/custom-elements-internal.json +148 -148
- package/dist/custom-elements.json +148 -148
- package/dist/features/OpenUI5Support.d.ts +1 -1
- package/dist/features/OpenUI5Support.js.map +1 -1
- package/dist/features/patchPopup.d.ts +17 -12
- package/dist/features/patchPopup.js +66 -22
- package/dist/features/patchPopup.js.map +1 -1
- package/dist/generated/VersionInfo.js +3 -3
- package/dist/generated/VersionInfo.js.map +1 -1
- package/dist/generated/css/BusyIndicator.css.d.ts +1 -1
- package/dist/generated/css/BusyIndicator.css.js +1 -1
- package/dist/generated/css/BusyIndicator.css.js.map +1 -1
- package/dist/generated/css/MultipleDragGhost.css.d.ts +1 -1
- package/dist/generated/css/MultipleDragGhost.css.js +1 -1
- package/dist/generated/css/MultipleDragGhost.css.js.map +1 -1
- package/dist/generated/css/OpenUI5PopupStyles.css.d.ts +1 -1
- package/dist/generated/css/OpenUI5PopupStyles.css.js +1 -1
- package/dist/generated/css/OpenUI5PopupStyles.css.js.map +1 -1
- package/dist/generated/css/ScrollbarStyles.css.d.ts +1 -1
- package/dist/generated/css/ScrollbarStyles.css.js +1 -1
- package/dist/generated/css/ScrollbarStyles.css.js.map +1 -1
- package/dist/generated/css/SystemCSSVars.css.d.ts +1 -1
- package/dist/generated/css/SystemCSSVars.css.js +1 -1
- package/dist/generated/css/SystemCSSVars.css.js.map +1 -1
- package/dist/prod/InitialConfiguration.js +1 -1
- package/dist/prod/InitialConfiguration.js.map +3 -3
- package/dist/prod/config/Theme.js +1 -1
- package/dist/prod/config/Theme.js.map +3 -3
- package/dist/prod/features/OpenUI5Support.js +1 -1
- package/dist/prod/features/OpenUI5Support.js.map +2 -2
- package/dist/prod/features/patchPopup.js +1 -1
- package/dist/prod/features/patchPopup.js.map +3 -3
- package/dist/prod/generated/VersionInfo.js +1 -1
- package/dist/prod/generated/VersionInfo.js.map +2 -2
- package/dist/prod/generated/css/BusyIndicator.css.js +1 -1
- package/dist/prod/generated/css/BusyIndicator.css.js.map +1 -1
- package/dist/prod/generated/css/MultipleDragGhost.css.js +1 -1
- package/dist/prod/generated/css/MultipleDragGhost.css.js.map +1 -1
- package/dist/prod/generated/css/OpenUI5PopupStyles.css.js +1 -1
- package/dist/prod/generated/css/OpenUI5PopupStyles.css.js.map +1 -1
- package/dist/prod/generated/css/ScrollbarStyles.css.js +1 -1
- package/dist/prod/generated/css/ScrollbarStyles.css.js.map +1 -1
- package/dist/prod/generated/css/SystemCSSVars.css.js +1 -1
- package/dist/prod/generated/css/SystemCSSVars.css.js.map +1 -1
- package/dist/prod/theming/applyTheme.js +1 -1
- package/dist/prod/theming/applyTheme.js.map +3 -3
- package/dist/theming/applyTheme.js +29 -19
- package/dist/theming/applyTheme.js.map +1 -1
- package/package.json +3 -3
- package/src/css/OpenUI5PopupStyles.css +5 -0
|
@@ -1061,36 +1061,6 @@
|
|
|
1061
1061
|
}
|
|
1062
1062
|
]
|
|
1063
1063
|
},
|
|
1064
|
-
{
|
|
1065
|
-
"kind": "javascript-module",
|
|
1066
|
-
"path": "dist/asset-registries/Icons.js",
|
|
1067
|
-
"declarations": [],
|
|
1068
|
-
"exports": []
|
|
1069
|
-
},
|
|
1070
|
-
{
|
|
1071
|
-
"kind": "javascript-module",
|
|
1072
|
-
"path": "dist/asset-registries/Illustrations.js",
|
|
1073
|
-
"declarations": [],
|
|
1074
|
-
"exports": []
|
|
1075
|
-
},
|
|
1076
|
-
{
|
|
1077
|
-
"kind": "javascript-module",
|
|
1078
|
-
"path": "dist/asset-registries/LocaleData.js",
|
|
1079
|
-
"declarations": [],
|
|
1080
|
-
"exports": []
|
|
1081
|
-
},
|
|
1082
|
-
{
|
|
1083
|
-
"kind": "javascript-module",
|
|
1084
|
-
"path": "dist/asset-registries/Themes.js",
|
|
1085
|
-
"declarations": [],
|
|
1086
|
-
"exports": []
|
|
1087
|
-
},
|
|
1088
|
-
{
|
|
1089
|
-
"kind": "javascript-module",
|
|
1090
|
-
"path": "dist/asset-registries/i18n.js",
|
|
1091
|
-
"declarations": [],
|
|
1092
|
-
"exports": []
|
|
1093
|
-
},
|
|
1094
1064
|
{
|
|
1095
1065
|
"kind": "javascript-module",
|
|
1096
1066
|
"path": "dist/config/AnimationMode.js",
|
|
@@ -1165,150 +1135,45 @@
|
|
|
1165
1135
|
},
|
|
1166
1136
|
{
|
|
1167
1137
|
"kind": "javascript-module",
|
|
1168
|
-
"path": "dist/
|
|
1169
|
-
"declarations": [],
|
|
1170
|
-
"exports": [
|
|
1171
|
-
{
|
|
1172
|
-
"kind": "js",
|
|
1173
|
-
"name": "default",
|
|
1174
|
-
"declaration": {
|
|
1175
|
-
"name": "DOMReferenceConverter",
|
|
1176
|
-
"module": "dist/converters/DOMReference.js"
|
|
1177
|
-
}
|
|
1178
|
-
}
|
|
1179
|
-
]
|
|
1180
|
-
},
|
|
1181
|
-
{
|
|
1182
|
-
"kind": "javascript-module",
|
|
1183
|
-
"path": "dist/decorators/bound.js",
|
|
1184
|
-
"declarations": [],
|
|
1185
|
-
"exports": [
|
|
1186
|
-
{
|
|
1187
|
-
"kind": "js",
|
|
1188
|
-
"name": "default",
|
|
1189
|
-
"declaration": {
|
|
1190
|
-
"name": "bound",
|
|
1191
|
-
"module": "dist/decorators/bound.js"
|
|
1192
|
-
}
|
|
1193
|
-
}
|
|
1194
|
-
]
|
|
1195
|
-
},
|
|
1196
|
-
{
|
|
1197
|
-
"kind": "javascript-module",
|
|
1198
|
-
"path": "dist/decorators/customElement.js",
|
|
1199
|
-
"declarations": [],
|
|
1200
|
-
"exports": [
|
|
1201
|
-
{
|
|
1202
|
-
"kind": "js",
|
|
1203
|
-
"name": "default",
|
|
1204
|
-
"declaration": {
|
|
1205
|
-
"name": "customElement",
|
|
1206
|
-
"module": "dist/decorators/customElement.js"
|
|
1207
|
-
}
|
|
1208
|
-
}
|
|
1209
|
-
]
|
|
1210
|
-
},
|
|
1211
|
-
{
|
|
1212
|
-
"kind": "javascript-module",
|
|
1213
|
-
"path": "dist/decorators/event-strict.js",
|
|
1214
|
-
"declarations": [],
|
|
1215
|
-
"exports": [
|
|
1216
|
-
{
|
|
1217
|
-
"kind": "js",
|
|
1218
|
-
"name": "default",
|
|
1219
|
-
"declaration": {
|
|
1220
|
-
"name": "event",
|
|
1221
|
-
"module": "dist/decorators/event-strict.js"
|
|
1222
|
-
}
|
|
1223
|
-
}
|
|
1224
|
-
]
|
|
1225
|
-
},
|
|
1226
|
-
{
|
|
1227
|
-
"kind": "javascript-module",
|
|
1228
|
-
"path": "dist/decorators/event.js",
|
|
1138
|
+
"path": "dist/asset-registries/Icons.js",
|
|
1229
1139
|
"declarations": [],
|
|
1230
|
-
"exports": [
|
|
1231
|
-
{
|
|
1232
|
-
"kind": "js",
|
|
1233
|
-
"name": "default",
|
|
1234
|
-
"declaration": {
|
|
1235
|
-
"name": "event",
|
|
1236
|
-
"module": "dist/decorators/event.js"
|
|
1237
|
-
}
|
|
1238
|
-
}
|
|
1239
|
-
]
|
|
1140
|
+
"exports": []
|
|
1240
1141
|
},
|
|
1241
1142
|
{
|
|
1242
1143
|
"kind": "javascript-module",
|
|
1243
|
-
"path": "dist/
|
|
1144
|
+
"path": "dist/asset-registries/Illustrations.js",
|
|
1244
1145
|
"declarations": [],
|
|
1245
|
-
"exports": [
|
|
1246
|
-
{
|
|
1247
|
-
"kind": "js",
|
|
1248
|
-
"name": "default",
|
|
1249
|
-
"declaration": {
|
|
1250
|
-
"name": "i18n",
|
|
1251
|
-
"module": "dist/decorators/i18n.js"
|
|
1252
|
-
}
|
|
1253
|
-
}
|
|
1254
|
-
]
|
|
1146
|
+
"exports": []
|
|
1255
1147
|
},
|
|
1256
1148
|
{
|
|
1257
1149
|
"kind": "javascript-module",
|
|
1258
|
-
"path": "dist/
|
|
1150
|
+
"path": "dist/asset-registries/LocaleData.js",
|
|
1259
1151
|
"declarations": [],
|
|
1260
|
-
"exports": [
|
|
1261
|
-
{
|
|
1262
|
-
"kind": "js",
|
|
1263
|
-
"name": "default",
|
|
1264
|
-
"declaration": {
|
|
1265
|
-
"name": "property",
|
|
1266
|
-
"module": "dist/decorators/property.js"
|
|
1267
|
-
}
|
|
1268
|
-
}
|
|
1269
|
-
]
|
|
1152
|
+
"exports": []
|
|
1270
1153
|
},
|
|
1271
1154
|
{
|
|
1272
1155
|
"kind": "javascript-module",
|
|
1273
|
-
"path": "dist/
|
|
1156
|
+
"path": "dist/asset-registries/Themes.js",
|
|
1274
1157
|
"declarations": [],
|
|
1275
|
-
"exports": [
|
|
1276
|
-
{
|
|
1277
|
-
"kind": "js",
|
|
1278
|
-
"name": "default",
|
|
1279
|
-
"declaration": {
|
|
1280
|
-
"name": "query",
|
|
1281
|
-
"module": "dist/decorators/query.js"
|
|
1282
|
-
}
|
|
1283
|
-
}
|
|
1284
|
-
]
|
|
1158
|
+
"exports": []
|
|
1285
1159
|
},
|
|
1286
1160
|
{
|
|
1287
1161
|
"kind": "javascript-module",
|
|
1288
|
-
"path": "dist/
|
|
1162
|
+
"path": "dist/asset-registries/i18n.js",
|
|
1289
1163
|
"declarations": [],
|
|
1290
|
-
"exports": [
|
|
1291
|
-
{
|
|
1292
|
-
"kind": "js",
|
|
1293
|
-
"name": "default",
|
|
1294
|
-
"declaration": {
|
|
1295
|
-
"name": "queryAll",
|
|
1296
|
-
"module": "dist/decorators/queryAll.js"
|
|
1297
|
-
}
|
|
1298
|
-
}
|
|
1299
|
-
]
|
|
1164
|
+
"exports": []
|
|
1300
1165
|
},
|
|
1301
1166
|
{
|
|
1302
1167
|
"kind": "javascript-module",
|
|
1303
|
-
"path": "dist/
|
|
1168
|
+
"path": "dist/converters/DOMReference.js",
|
|
1304
1169
|
"declarations": [],
|
|
1305
1170
|
"exports": [
|
|
1306
1171
|
{
|
|
1307
1172
|
"kind": "js",
|
|
1308
1173
|
"name": "default",
|
|
1309
1174
|
"declaration": {
|
|
1310
|
-
"name": "
|
|
1311
|
-
"module": "dist/
|
|
1175
|
+
"name": "DOMReferenceConverter",
|
|
1176
|
+
"module": "dist/converters/DOMReference.js"
|
|
1312
1177
|
}
|
|
1313
1178
|
}
|
|
1314
1179
|
]
|
|
@@ -1488,6 +1353,141 @@
|
|
|
1488
1353
|
}
|
|
1489
1354
|
]
|
|
1490
1355
|
},
|
|
1356
|
+
{
|
|
1357
|
+
"kind": "javascript-module",
|
|
1358
|
+
"path": "dist/decorators/bound.js",
|
|
1359
|
+
"declarations": [],
|
|
1360
|
+
"exports": [
|
|
1361
|
+
{
|
|
1362
|
+
"kind": "js",
|
|
1363
|
+
"name": "default",
|
|
1364
|
+
"declaration": {
|
|
1365
|
+
"name": "bound",
|
|
1366
|
+
"module": "dist/decorators/bound.js"
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
]
|
|
1370
|
+
},
|
|
1371
|
+
{
|
|
1372
|
+
"kind": "javascript-module",
|
|
1373
|
+
"path": "dist/decorators/customElement.js",
|
|
1374
|
+
"declarations": [],
|
|
1375
|
+
"exports": [
|
|
1376
|
+
{
|
|
1377
|
+
"kind": "js",
|
|
1378
|
+
"name": "default",
|
|
1379
|
+
"declaration": {
|
|
1380
|
+
"name": "customElement",
|
|
1381
|
+
"module": "dist/decorators/customElement.js"
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
]
|
|
1385
|
+
},
|
|
1386
|
+
{
|
|
1387
|
+
"kind": "javascript-module",
|
|
1388
|
+
"path": "dist/decorators/event-strict.js",
|
|
1389
|
+
"declarations": [],
|
|
1390
|
+
"exports": [
|
|
1391
|
+
{
|
|
1392
|
+
"kind": "js",
|
|
1393
|
+
"name": "default",
|
|
1394
|
+
"declaration": {
|
|
1395
|
+
"name": "event",
|
|
1396
|
+
"module": "dist/decorators/event-strict.js"
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
]
|
|
1400
|
+
},
|
|
1401
|
+
{
|
|
1402
|
+
"kind": "javascript-module",
|
|
1403
|
+
"path": "dist/decorators/event.js",
|
|
1404
|
+
"declarations": [],
|
|
1405
|
+
"exports": [
|
|
1406
|
+
{
|
|
1407
|
+
"kind": "js",
|
|
1408
|
+
"name": "default",
|
|
1409
|
+
"declaration": {
|
|
1410
|
+
"name": "event",
|
|
1411
|
+
"module": "dist/decorators/event.js"
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
]
|
|
1415
|
+
},
|
|
1416
|
+
{
|
|
1417
|
+
"kind": "javascript-module",
|
|
1418
|
+
"path": "dist/decorators/i18n.js",
|
|
1419
|
+
"declarations": [],
|
|
1420
|
+
"exports": [
|
|
1421
|
+
{
|
|
1422
|
+
"kind": "js",
|
|
1423
|
+
"name": "default",
|
|
1424
|
+
"declaration": {
|
|
1425
|
+
"name": "i18n",
|
|
1426
|
+
"module": "dist/decorators/i18n.js"
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
]
|
|
1430
|
+
},
|
|
1431
|
+
{
|
|
1432
|
+
"kind": "javascript-module",
|
|
1433
|
+
"path": "dist/decorators/property.js",
|
|
1434
|
+
"declarations": [],
|
|
1435
|
+
"exports": [
|
|
1436
|
+
{
|
|
1437
|
+
"kind": "js",
|
|
1438
|
+
"name": "default",
|
|
1439
|
+
"declaration": {
|
|
1440
|
+
"name": "property",
|
|
1441
|
+
"module": "dist/decorators/property.js"
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
]
|
|
1445
|
+
},
|
|
1446
|
+
{
|
|
1447
|
+
"kind": "javascript-module",
|
|
1448
|
+
"path": "dist/decorators/query.js",
|
|
1449
|
+
"declarations": [],
|
|
1450
|
+
"exports": [
|
|
1451
|
+
{
|
|
1452
|
+
"kind": "js",
|
|
1453
|
+
"name": "default",
|
|
1454
|
+
"declaration": {
|
|
1455
|
+
"name": "query",
|
|
1456
|
+
"module": "dist/decorators/query.js"
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
]
|
|
1460
|
+
},
|
|
1461
|
+
{
|
|
1462
|
+
"kind": "javascript-module",
|
|
1463
|
+
"path": "dist/decorators/queryAll.js",
|
|
1464
|
+
"declarations": [],
|
|
1465
|
+
"exports": [
|
|
1466
|
+
{
|
|
1467
|
+
"kind": "js",
|
|
1468
|
+
"name": "default",
|
|
1469
|
+
"declaration": {
|
|
1470
|
+
"name": "queryAll",
|
|
1471
|
+
"module": "dist/decorators/queryAll.js"
|
|
1472
|
+
}
|
|
1473
|
+
}
|
|
1474
|
+
]
|
|
1475
|
+
},
|
|
1476
|
+
{
|
|
1477
|
+
"kind": "javascript-module",
|
|
1478
|
+
"path": "dist/decorators/slot.js",
|
|
1479
|
+
"declarations": [],
|
|
1480
|
+
"exports": [
|
|
1481
|
+
{
|
|
1482
|
+
"kind": "js",
|
|
1483
|
+
"name": "default",
|
|
1484
|
+
"declaration": {
|
|
1485
|
+
"name": "slot",
|
|
1486
|
+
"module": "dist/decorators/slot.js"
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
]
|
|
1490
|
+
},
|
|
1491
1491
|
{
|
|
1492
1492
|
"kind": "javascript-module",
|
|
1493
1493
|
"path": "dist/features/F6Navigation.js",
|
|
@@ -34,6 +34,6 @@ declare class OpenUI5Support {
|
|
|
34
34
|
static cssVariablesLoaded(): boolean | undefined;
|
|
35
35
|
static addOpenedPopup(popupInfo: PopupInfo): void;
|
|
36
36
|
static removeOpenedPopup(popup: object): void;
|
|
37
|
-
static getTopmostPopup(): object;
|
|
37
|
+
static getTopmostPopup(): object | null;
|
|
38
38
|
}
|
|
39
39
|
export default OpenUI5Support;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenUI5Support.js","sourceRoot":"","sources":["../../src/features/OpenUI5Support.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EACN,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,eAAe,GACf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AA+D9C,MAAM,cAAc;IACnB,MAAM,CAAC,mBAAmB;QACzB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAG,CAAC,OAAO,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC,CAAC,2DAA2D;QACzE,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,EAAG,CAAC,OAAiB,CAAC;QACjD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAChC,OAAO,KAAK,CAAC;QACd,CAAC;QACD,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC;IAC5D,CAAC;IAED,MAAM,CAAC,iBAAiB;QACvB,OAAO,OAAO,MAAM,CAAC,GAAG,EAAE,EAAE,EAAE,OAAO,KAAK,UAAU,CAAC;IACtD,CAAC;IAID,MAAM,CAAC,IAAI;QACV,IAAI,CAAC,cAAc,CAAC,iBAAiB,EAAE,EAAE,CAAC;YACzC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;QAC1B,CAAC;QAED,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC;YACjC,cAAc,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AAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC7F,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,SAAoB;QACzC,cAAc,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,MAAM,CAAC,iBAAiB,CAAC,KAAa;QACrC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IAED,MAAM,CAAC,eAAe;QACrB,OAAO,eAAe,EAAE,CAAC;IAC1B,CAAC;CACD;AAED,eAAe,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;AAElD,eAAe,cAAc,CAAC","sourcesContent":["import patchPatcher from \"./patchPatcher.js\";\nimport type { OpenUI5Patcher } from \"./patchPatcher.js\";\nimport {\n\tpatchPopup,\n\taddOpenedPopup,\n\tremoveOpenedPopup,\n\tgetTopmostPopup,\n} from \"./patchPopup.js\";\nimport type { OpenUI5Popup, OpenUI5PopupBasedControl, PopupInfo } from \"./patchPopup.js\";\nimport { registerFeature } from \"../FeaturesRegistry.js\";\nimport { setTheme } from \"../config/Theme.js\";\nimport type { CLDRData } from \"../asset-registries/LocaleData.js\";\nimport type { LegacyDateCalendarCustomizing } from \"../features/LegacyDateFormats.js\";\n\ntype OpenUI5Core = {\n\tattachInit: (callback: () => void) => void,\n\tready: () => Promise<void>,\n\tattachThemeChanged: (callback: () => void) => void,\n\tgetConfiguration: () => OpenUI5CoreConfiguration,\n};\n\ntype OpenUI5CoreConfiguration = {\n\tgetAnimationMode: () => string,\n\tgetLanguage: () => string,\n\tgetTheme: () => string,\n\tgetThemeRoot: () => string,\n\tgetRTL: () => string,\n\tgetTimezone: () => string,\n\tgetCalendarType: () => string,\n\tgetLocale: () => string,\n\tgetFormatSettings: () => {\n\t\tgetLegacyDateCalendarCustomizing: () => LegacyDateCalendarCustomizing;\n\t}\n};\n\ntype ControlBehavior = {\n\tgetAnimationMode: () => string,\n}\n\ntype Localization = {\n\tgetLanguage: () => string,\n\tgetLanguageTag: () => string,\n\tgetRTL: () => string,\n\tgetTimezone: () => string,\n}\n\ntype LocaleData = {\n\tgetInstance: (locale: string) => Locale,\n}\n\ntype Theming = {\n\tgetThemeRoot: () => string,\n\tgetTheme: () => string,\n\tattachApplied: (callback: () => void) => void,\n}\n\ntype Formatting = {\n\tgetCalendarType: () => string,\n\tgetLegacyDateCalendarCustomizing: () => LegacyDateCalendarCustomizing,\n\tgetCustomIslamicCalendarData?: () => LegacyDateCalendarCustomizing,\n}\n\ntype CalendarUtils = {\n\tgetWeekConfigurationValues: () => {\n\t\tfirstDayOfWeek: number | undefined,\n\t},\n}\n\ntype Locale = {\n\tgetFirstDayOfWeek: () => number,\n\t_get: () => CLDRData,\n};\n\nclass OpenUI5Support {\n\tstatic isAtLeastVersion116() {\n\t\tif (!window.sap.ui!.version) {\n\t\t\treturn true; // sap.ui.version will be removed in newer OpenUI5 versions\n\t\t}\n\t\tconst version = window.sap.ui!.version as string;\n\t\tconst parts = version.split(\".\");\n\t\tif (!parts || parts.length < 2) {\n\t\t\treturn false;\n\t\t}\n\t\treturn parseInt(parts[0]) > 1 || parseInt(parts[1]) >= 116;\n\t}\n\n\tstatic isOpenUI5Detected() {\n\t\treturn typeof window.sap?.ui?.require === \"function\";\n\t}\n\n\tstatic initPromise?: Promise<void>;\n\n\tstatic init() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\tif (!OpenUI5Support.initPromise) {\n\t\t\tOpenUI5Support.initPromise = new Promise<void>(resolve => {\n\t\t\t\twindow.sap.ui.require([\"sap/ui/core/Core\"], async (Core: OpenUI5Core) => {\n\t\t\t\t\tconst callback = () => {\n\t\t\t\t\t\tlet deps: Array<string> = [\"sap/ui/core/Popup\", \"sap/m/Dialog\", \"sap/ui/core/Patcher\", \"sap/ui/core/LocaleData\"];\n\t\t\t\t\t\tif (OpenUI5Support.isAtLeastVersion116()) { // for versions since 1.116.0 and onward, use the modular core\n\t\t\t\t\t\t\tdeps = [\n\t\t\t\t\t\t\t\t...deps,\n\t\t\t\t\t\t\t\t\"sap/base/i18n/Formatting\",\n\t\t\t\t\t\t\t\t\"sap/base/i18n/Localization\",\n\t\t\t\t\t\t\t\t\"sap/ui/core/ControlBehavior\",\n\t\t\t\t\t\t\t\t\"sap/ui/core/Theming\",\n\t\t\t\t\t\t\t\t\"sap/ui/core/date/CalendarUtils\",\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\t\t\t\t\t\twindow.sap.ui.require(deps, (Popup: OpenUI5Popup, Dialog: OpenUI5PopupBasedControl, Patcher: OpenUI5Patcher) => {\n\t\t\t\t\t\t\tpatchPatcher(Patcher);\n\t\t\t\t\t\t\tpatchPopup(Popup, Dialog);\n\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t});\n\t\t\t\t\t};\n\t\t\t\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\t\t\t\tawait Core.ready();\n\t\t\t\t\t\tcallback();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tCore.attachInit(callback);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\treturn OpenUI5Support.initPromise;\n\t}\n\n\tstatic getConfigurationSettingsObject() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst ControlBehavior = window.sap.ui.require(\"sap/ui/core/ControlBehavior\") as ControlBehavior;\n\t\t\tconst Localization = window.sap.ui.require(\"sap/base/i18n/Localization\") as Localization;\n\t\t\tconst Theming = window.sap.ui.require(\"sap/ui/core/Theming\") as Theming;\n\t\t\tconst Formatting = window.sap.ui.require(\"sap/base/i18n/Formatting\") as Formatting;\n\t\t\tconst CalendarUtils = window.sap.ui.require(\"sap/ui/core/date/CalendarUtils\") as CalendarUtils;\n\n\t\t\treturn {\n\t\t\t\tanimationMode: ControlBehavior.getAnimationMode(),\n\t\t\t\tlanguage: Localization.getLanguage(),\n\t\t\t\ttheme: Theming.getTheme(),\n\t\t\t\tthemeRoot: Theming.getThemeRoot(),\n\t\t\t\trtl: Localization.getRTL(),\n\t\t\t\ttimezone: Localization.getTimezone(),\n\t\t\t\tcalendarType: Formatting.getCalendarType(),\n\t\t\t\tformatSettings: {\n\t\t\t\t\tfirstDayOfWeek: CalendarUtils.getWeekConfigurationValues().firstDayOfWeek,\n\t\t\t\t\tlegacyDateCalendarCustomizing: Formatting.getCustomIslamicCalendarData?.()\n\t\t\t\t\t\t\t\t\t\t\t\t?? Formatting.getLegacyDateCalendarCustomizing?.(),\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\tconst config = Core.getConfiguration();\n\t\tconst LocaleData = window.sap.ui.require(\"sap/ui/core/LocaleData\") as LocaleData;\n\n\t\treturn {\n\t\t\tanimationMode: config.getAnimationMode(),\n\t\t\tlanguage: config.getLanguage(),\n\t\t\ttheme: config.getTheme(),\n\t\t\tthemeRoot: config.getThemeRoot(),\n\t\t\trtl: config.getRTL(),\n\t\t\ttimezone: config.getTimezone(),\n\t\t\tcalendarType: config.getCalendarType(),\n\t\t\tformatSettings: {\n\t\t\t\tfirstDayOfWeek: LocaleData ? LocaleData.getInstance(config.getLocale()).getFirstDayOfWeek() : undefined,\n\t\t\t\tlegacyDateCalendarCustomizing: config.getFormatSettings().getLegacyDateCalendarCustomizing(),\n\t\t\t},\n\t\t};\n\t}\n\n\tstatic getLocaleDataObject() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst LocaleData = window.sap.ui.require(\"sap/ui/core/LocaleData\") as LocaleData;\n\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst Localization = window.sap.ui.require(\"sap/base/i18n/Localization\") as Localization;\n\t\t\treturn LocaleData.getInstance(Localization.getLanguageTag())._get();\n\t\t}\n\n\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\tconst config = Core.getConfiguration();\n\t\treturn LocaleData.getInstance(config.getLocale())._get();\n\t}\n\n\tstatic _listenForThemeChange() {\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst Theming: Theming = window.sap.ui.require(\"sap/ui/core/Theming\");\n\t\t\tTheming.attachApplied(() => {\n\t\t\t\tsetTheme(Theming.getTheme());\n\t\t\t});\n\t\t} else {\n\t\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\t\tconst config = Core.getConfiguration();\n\t\t\tCore.attachThemeChanged(() => {\n\t\t\t\tsetTheme(config.getTheme());\n\t\t\t});\n\t\t}\n\t}\n\n\tstatic attachListeners() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tOpenUI5Support._listenForThemeChange();\n\t}\n\n\tstatic cssVariablesLoaded() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst link = [...document.head.children].find(el => el.id === \"sap-ui-theme-sap.ui.core\") as HTMLLinkElement; // more reliable than querySelector early\n\t\tif (!link) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// The file name is \"css_variables.css\" until 1.127 and \"library.css\" from 1.127 onwards\n\t\treturn !!link.href.match(/\\/css(-|_)variables\\.css/) || !!link.href.match(/\\/library\\.css/);\n\t}\n\n\tstatic addOpenedPopup(popupInfo: PopupInfo) {\n\t\taddOpenedPopup(popupInfo);\n\t}\n\n\tstatic removeOpenedPopup(popup: object) {\n\t\tremoveOpenedPopup(popup);\n\t}\n\n\tstatic getTopmostPopup() {\n\t\treturn getTopmostPopup();\n\t}\n}\n\nregisterFeature(\"OpenUI5Support\", OpenUI5Support);\n\nexport default Open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AAK,CAAC,0BAA0B,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC7F,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,SAAoB;QACzC,cAAc,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,MAAM,CAAC,iBAAiB,CAAC,KAAa;QACrC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IAED,MAAM,CAAC,eAAe;QACrB,OAAO,eAAe,EAAE,CAAC;IAC1B,CAAC;CACD;AAED,eAAe,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;AAElD,eAAe,cAAc,CAAC","sourcesContent":["import patchPatcher from \"./patchPatcher.js\";\nimport type { OpenUI5Patcher } from \"./patchPatcher.js\";\nimport {\n\tpatchPopup,\n\taddOpenedPopup,\n\tremoveOpenedPopup,\n\tgetTopmostPopup,\n} from \"./patchPopup.js\";\nimport type { OpenUI5PopupClass, OpenUI5DialogClass, PopupInfo } from \"./patchPopup.js\";\nimport { registerFeature } from \"../FeaturesRegistry.js\";\nimport { setTheme } from \"../config/Theme.js\";\nimport type { CLDRData } from \"../asset-registries/LocaleData.js\";\nimport type { LegacyDateCalendarCustomizing } from \"../features/LegacyDateFormats.js\";\n\ntype OpenUI5Core = {\n\tattachInit: (callback: () => void) => void,\n\tready: () => Promise<void>,\n\tattachThemeChanged: (callback: () => void) => void,\n\tgetConfiguration: () => OpenUI5CoreConfiguration,\n};\n\ntype OpenUI5CoreConfiguration = {\n\tgetAnimationMode: () => string,\n\tgetLanguage: () => string,\n\tgetTheme: () => string,\n\tgetThemeRoot: () => string,\n\tgetRTL: () => string,\n\tgetTimezone: () => string,\n\tgetCalendarType: () => string,\n\tgetLocale: () => string,\n\tgetFormatSettings: () => {\n\t\tgetLegacyDateCalendarCustomizing: () => LegacyDateCalendarCustomizing;\n\t}\n};\n\ntype ControlBehavior = {\n\tgetAnimationMode: () => string,\n}\n\ntype Localization = {\n\tgetLanguage: () => string,\n\tgetLanguageTag: () => string,\n\tgetRTL: () => string,\n\tgetTimezone: () => string,\n}\n\ntype LocaleData = {\n\tgetInstance: (locale: string) => Locale,\n}\n\ntype Theming = {\n\tgetThemeRoot: () => string,\n\tgetTheme: () => string,\n\tattachApplied: (callback: () => void) => void,\n}\n\ntype Formatting = {\n\tgetCalendarType: () => string,\n\tgetLegacyDateCalendarCustomizing: () => LegacyDateCalendarCustomizing,\n\tgetCustomIslamicCalendarData?: () => LegacyDateCalendarCustomizing,\n}\n\ntype CalendarUtils = {\n\tgetWeekConfigurationValues: () => {\n\t\tfirstDayOfWeek: number | undefined,\n\t},\n}\n\ntype Locale = {\n\tgetFirstDayOfWeek: () => number,\n\t_get: () => CLDRData,\n};\n\nclass OpenUI5Support {\n\tstatic isAtLeastVersion116() {\n\t\tif (!window.sap.ui!.version) {\n\t\t\treturn true; // sap.ui.version will be removed in newer OpenUI5 versions\n\t\t}\n\t\tconst version = window.sap.ui!.version as string;\n\t\tconst parts = version.split(\".\");\n\t\tif (!parts || parts.length < 2) {\n\t\t\treturn false;\n\t\t}\n\t\treturn parseInt(parts[0]) > 1 || parseInt(parts[1]) >= 116;\n\t}\n\n\tstatic isOpenUI5Detected() {\n\t\treturn typeof window.sap?.ui?.require === \"function\";\n\t}\n\n\tstatic initPromise?: Promise<void>;\n\n\tstatic init() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\tif (!OpenUI5Support.initPromise) {\n\t\t\tOpenUI5Support.initPromise = new Promise<void>(resolve => {\n\t\t\t\twindow.sap.ui.require([\"sap/ui/core/Core\"], async (Core: OpenUI5Core) => {\n\t\t\t\t\tconst callback = () => {\n\t\t\t\t\t\tlet deps: Array<string> = [\"sap/ui/core/Popup\", \"sap/m/Dialog\", \"sap/ui/core/Patcher\", \"sap/ui/core/LocaleData\"];\n\t\t\t\t\t\tif (OpenUI5Support.isAtLeastVersion116()) { // for versions since 1.116.0 and onward, use the modular core\n\t\t\t\t\t\t\tdeps = [\n\t\t\t\t\t\t\t\t...deps,\n\t\t\t\t\t\t\t\t\"sap/base/i18n/Formatting\",\n\t\t\t\t\t\t\t\t\"sap/base/i18n/Localization\",\n\t\t\t\t\t\t\t\t\"sap/ui/core/ControlBehavior\",\n\t\t\t\t\t\t\t\t\"sap/ui/core/Theming\",\n\t\t\t\t\t\t\t\t\"sap/ui/core/date/CalendarUtils\",\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\t\t\t\t\t\twindow.sap.ui.require(deps, (Popup: OpenUI5PopupClass, Dialog: OpenUI5DialogClass, Patcher: OpenUI5Patcher) => {\n\t\t\t\t\t\t\tpatchPatcher(Patcher);\n\t\t\t\t\t\t\tpatchPopup(Popup, Dialog);\n\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t});\n\t\t\t\t\t};\n\t\t\t\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\t\t\t\tawait Core.ready();\n\t\t\t\t\t\tcallback();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tCore.attachInit(callback);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\treturn OpenUI5Support.initPromise;\n\t}\n\n\tstatic getConfigurationSettingsObject() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst ControlBehavior = window.sap.ui.require(\"sap/ui/core/ControlBehavior\") as ControlBehavior;\n\t\t\tconst Localization = window.sap.ui.require(\"sap/base/i18n/Localization\") as Localization;\n\t\t\tconst Theming = window.sap.ui.require(\"sap/ui/core/Theming\") as Theming;\n\t\t\tconst Formatting = window.sap.ui.require(\"sap/base/i18n/Formatting\") as Formatting;\n\t\t\tconst CalendarUtils = window.sap.ui.require(\"sap/ui/core/date/CalendarUtils\") as CalendarUtils;\n\n\t\t\treturn {\n\t\t\t\tanimationMode: ControlBehavior.getAnimationMode(),\n\t\t\t\tlanguage: Localization.getLanguage(),\n\t\t\t\ttheme: Theming.getTheme(),\n\t\t\t\tthemeRoot: Theming.getThemeRoot(),\n\t\t\t\trtl: Localization.getRTL(),\n\t\t\t\ttimezone: Localization.getTimezone(),\n\t\t\t\tcalendarType: Formatting.getCalendarType(),\n\t\t\t\tformatSettings: {\n\t\t\t\t\tfirstDayOfWeek: CalendarUtils.getWeekConfigurationValues().firstDayOfWeek,\n\t\t\t\t\tlegacyDateCalendarCustomizing: Formatting.getCustomIslamicCalendarData?.()\n\t\t\t\t\t\t\t\t\t\t\t\t?? Formatting.getLegacyDateCalendarCustomizing?.(),\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\tconst config = Core.getConfiguration();\n\t\tconst LocaleData = window.sap.ui.require(\"sap/ui/core/LocaleData\") as LocaleData;\n\n\t\treturn {\n\t\t\tanimationMode: config.getAnimationMode(),\n\t\t\tlanguage: config.getLanguage(),\n\t\t\ttheme: config.getTheme(),\n\t\t\tthemeRoot: config.getThemeRoot(),\n\t\t\trtl: config.getRTL(),\n\t\t\ttimezone: config.getTimezone(),\n\t\t\tcalendarType: config.getCalendarType(),\n\t\t\tformatSettings: {\n\t\t\t\tfirstDayOfWeek: LocaleData ? LocaleData.getInstance(config.getLocale()).getFirstDayOfWeek() : undefined,\n\t\t\t\tlegacyDateCalendarCustomizing: config.getFormatSettings().getLegacyDateCalendarCustomizing(),\n\t\t\t},\n\t\t};\n\t}\n\n\tstatic getLocaleDataObject() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst LocaleData = window.sap.ui.require(\"sap/ui/core/LocaleData\") as LocaleData;\n\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst Localization = window.sap.ui.require(\"sap/base/i18n/Localization\") as Localization;\n\t\t\treturn LocaleData.getInstance(Localization.getLanguageTag())._get();\n\t\t}\n\n\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\tconst config = Core.getConfiguration();\n\t\treturn LocaleData.getInstance(config.getLocale())._get();\n\t}\n\n\tstatic _listenForThemeChange() {\n\t\tif (OpenUI5Support.isAtLeastVersion116()) {\n\t\t\tconst Theming: Theming = window.sap.ui.require(\"sap/ui/core/Theming\");\n\t\t\tTheming.attachApplied(() => {\n\t\t\t\tsetTheme(Theming.getTheme());\n\t\t\t});\n\t\t} else {\n\t\t\tconst Core = window.sap.ui.require(\"sap/ui/core/Core\") as OpenUI5Core;\n\t\t\tconst config = Core.getConfiguration();\n\t\t\tCore.attachThemeChanged(() => {\n\t\t\t\tsetTheme(config.getTheme());\n\t\t\t});\n\t\t}\n\t}\n\n\tstatic attachListeners() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tOpenUI5Support._listenForThemeChange();\n\t}\n\n\tstatic cssVariablesLoaded() {\n\t\tif (!OpenUI5Support.isOpenUI5Detected()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst link = [...document.head.children].find(el => el.id === \"sap-ui-theme-sap.ui.core\") as HTMLLinkElement; // more reliable than querySelector early\n\t\tif (!link) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// The file name is \"css_variables.css\" until 1.127 and \"library.css\" from 1.127 onwards\n\t\treturn !!link.href.match(/\\/css(-|_)variables\\.css/) || !!link.href.match(/\\/library\\.css/);\n\t}\n\n\tstatic addOpenedPopup(popupInfo: PopupInfo) {\n\t\taddOpenedPopup(popupInfo);\n\t}\n\n\tstatic removeOpenedPopup(popup: object) {\n\t\tremoveOpenedPopup(popup);\n\t}\n\n\tstatic getTopmostPopup() {\n\t\treturn getTopmostPopup();\n\t}\n}\n\nregisterFeature(\"OpenUI5Support\", OpenUI5Support);\n\nexport default OpenUI5Support;\n"]}
|
|
@@ -2,27 +2,32 @@ type Control = {
|
|
|
2
2
|
getDomRef: () => HTMLElement | null;
|
|
3
3
|
};
|
|
4
4
|
type OpenUI5Popup = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
open: (...args: any[]) => void;
|
|
6
|
+
_closed: (...args: any[]) => void;
|
|
7
|
+
getOpenState: () => "CLOSED" | "CLOSING" | "OPEN" | "OPENING";
|
|
8
|
+
getContent: () => Control | HTMLElement | null;
|
|
9
|
+
onFocusEvent: (...args: any[]) => void;
|
|
10
|
+
getModal: () => boolean;
|
|
11
|
+
};
|
|
12
|
+
type OpenUI5PopupClass = {
|
|
13
|
+
prototype: OpenUI5Popup;
|
|
12
14
|
};
|
|
13
|
-
type
|
|
15
|
+
type OpenUI5DialogClass = {
|
|
14
16
|
prototype: {
|
|
15
17
|
onsapescape: (...args: any[]) => void;
|
|
16
18
|
oPopup: OpenUI5Popup;
|
|
17
19
|
};
|
|
18
20
|
};
|
|
19
21
|
type PopupInfo = {
|
|
20
|
-
type: "
|
|
22
|
+
type: "WebComponent";
|
|
21
23
|
instance: object;
|
|
24
|
+
} | {
|
|
25
|
+
type: "OpenUI5";
|
|
26
|
+
instance: OpenUI5Popup;
|
|
22
27
|
};
|
|
23
28
|
declare const addOpenedPopup: (popupInfo: PopupInfo) => void;
|
|
24
29
|
declare const removeOpenedPopup: (popup: object) => void;
|
|
25
|
-
declare const getTopmostPopup: () => object;
|
|
26
|
-
declare const patchPopup: (Popup:
|
|
30
|
+
declare const getTopmostPopup: () => object | null;
|
|
31
|
+
declare const patchPopup: (Popup: OpenUI5PopupClass, Dialog: OpenUI5DialogClass) => void;
|
|
27
32
|
export { patchPopup, addOpenedPopup, removeOpenedPopup, getTopmostPopup, };
|
|
28
|
-
export type {
|
|
33
|
+
export type { OpenUI5PopupClass, OpenUI5DialogClass, PopupInfo };
|
|
@@ -8,11 +8,17 @@ const addOpenedPopup = (popupInfo) => {
|
|
|
8
8
|
};
|
|
9
9
|
const removeOpenedPopup = (popup) => {
|
|
10
10
|
const index = AllOpenedPopupsRegistry.openedRegistry.findIndex(el => el.instance === popup);
|
|
11
|
+
if (index === AllOpenedPopupsRegistry.openedRegistry.length - 1) {
|
|
12
|
+
fixTopmostOpenUI5Popup();
|
|
13
|
+
}
|
|
11
14
|
if (index > -1) {
|
|
12
15
|
AllOpenedPopupsRegistry.openedRegistry.splice(index, 1);
|
|
13
16
|
}
|
|
14
17
|
};
|
|
15
18
|
const getTopmostPopup = () => {
|
|
19
|
+
if (AllOpenedPopupsRegistry.openedRegistry.length === 0) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
16
22
|
return AllOpenedPopupsRegistry.openedRegistry[AllOpenedPopupsRegistry.openedRegistry.length - 1].instance;
|
|
17
23
|
};
|
|
18
24
|
/**
|
|
@@ -33,15 +39,67 @@ const hasWebComponentPopupAbove = (popup) => {
|
|
|
33
39
|
}
|
|
34
40
|
return false;
|
|
35
41
|
};
|
|
36
|
-
const
|
|
42
|
+
const getPopupContentElement = (popup) => {
|
|
43
|
+
const content = popup.getContent();
|
|
44
|
+
return content instanceof HTMLElement ? content : content?.getDomRef() || null;
|
|
45
|
+
};
|
|
46
|
+
const openNativePopoverForOpenUI5 = (popup) => {
|
|
47
|
+
const openingInitiated = ["OPENING", "OPEN"].includes(popup.getOpenState());
|
|
48
|
+
if (!openingInitiated || !isNativePopoverOpen()) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const domRef = getPopupContentElement(popup);
|
|
52
|
+
if (!domRef) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const openUI5BlockLayer = document.getElementById("sap-ui-blocklayer-popup");
|
|
56
|
+
if (popup.getModal() && openUI5BlockLayer) {
|
|
57
|
+
openUI5BlockLayer.setAttribute("popover", "manual");
|
|
58
|
+
openUI5BlockLayer.hidePopover();
|
|
59
|
+
openUI5BlockLayer.showPopover();
|
|
60
|
+
}
|
|
37
61
|
domRef.setAttribute("popover", "manual");
|
|
38
62
|
domRef.showPopover();
|
|
39
63
|
};
|
|
40
|
-
const
|
|
64
|
+
const closeNativePopoverForOpenUI5 = (popup) => {
|
|
65
|
+
const domRef = getPopupContentElement(popup);
|
|
66
|
+
if (!domRef) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
41
69
|
if (domRef.hasAttribute("popover")) {
|
|
42
70
|
domRef.hidePopover();
|
|
43
71
|
domRef.removeAttribute("popover");
|
|
44
72
|
}
|
|
73
|
+
if (getTopmostPopup() !== popup) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
// The OpenUI5 block layer is only one for all modal OpenUI5 popups,
|
|
77
|
+
// and it is displayed above all opened pupups - OpenUI5 and Web Components,
|
|
78
|
+
// as a result, we need to hide this block layer.
|
|
79
|
+
// If the underlying popup is a Web Component - it is displayed like a native popover, and we don't need to do anything
|
|
80
|
+
// If the underlying popup is an OpenUI5 popup, it will be fixed in fixTopmostOpenUI5Popup method.
|
|
81
|
+
if (popup.getModal()) {
|
|
82
|
+
const openUI5BlockLayer = document.getElementById("sap-ui-blocklayer-popup");
|
|
83
|
+
if (openUI5BlockLayer && openUI5BlockLayer.hasAttribute("popover")) {
|
|
84
|
+
openUI5BlockLayer.hidePopover();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const fixTopmostOpenUI5Popup = () => {
|
|
89
|
+
if (!isNativePopoverOpen()) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const prevPopup = AllOpenedPopupsRegistry.openedRegistry[AllOpenedPopupsRegistry.openedRegistry.length - 2];
|
|
93
|
+
if (!prevPopup
|
|
94
|
+
|| prevPopup.type !== "OpenUI5"
|
|
95
|
+
|| !prevPopup.instance.getModal()) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const content = getPopupContentElement(prevPopup.instance);
|
|
99
|
+
const openUI5BlockLayer = document.getElementById("sap-ui-blocklayer-popup");
|
|
100
|
+
content?.hidePopover();
|
|
101
|
+
openUI5BlockLayer?.showPopover();
|
|
102
|
+
content?.showPopover();
|
|
45
103
|
};
|
|
46
104
|
const isNativePopoverOpen = (root = document) => {
|
|
47
105
|
if (root.querySelector(":popover-open")) {
|
|
@@ -52,9 +110,9 @@ const isNativePopoverOpen = (root = document) => {
|
|
|
52
110
|
return shadowRoot && isNativePopoverOpen(shadowRoot);
|
|
53
111
|
});
|
|
54
112
|
};
|
|
55
|
-
const
|
|
56
|
-
const origOnsapescape =
|
|
57
|
-
|
|
113
|
+
const patchDialog = (Dialog) => {
|
|
114
|
+
const origOnsapescape = Dialog.prototype.onsapescape;
|
|
115
|
+
Dialog.prototype.onsapescape = function onsapescape(...args) {
|
|
58
116
|
if (hasWebComponentPopupAbove(this.oPopup)) {
|
|
59
117
|
return;
|
|
60
118
|
}
|
|
@@ -65,17 +123,7 @@ const patchOpen = (Popup) => {
|
|
|
65
123
|
const origOpen = Popup.prototype.open;
|
|
66
124
|
Popup.prototype.open = function open(...args) {
|
|
67
125
|
origOpen.apply(this, args); // call open first to initiate opening
|
|
68
|
-
|
|
69
|
-
const openingInitiated = ["OPENING", "OPEN"].includes(this.getOpenState());
|
|
70
|
-
if (openingInitiated && topLayerAlreadyInUse) {
|
|
71
|
-
const element = this.getContent();
|
|
72
|
-
if (element) {
|
|
73
|
-
const domRef = element instanceof HTMLElement ? element : element?.getDomRef();
|
|
74
|
-
if (domRef) {
|
|
75
|
-
openNativePopover(domRef);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
126
|
+
openNativePopoverForOpenUI5(this);
|
|
79
127
|
addOpenedPopup({
|
|
80
128
|
type: "OpenUI5",
|
|
81
129
|
instance: this,
|
|
@@ -85,12 +133,8 @@ const patchOpen = (Popup) => {
|
|
|
85
133
|
const patchClosed = (Popup) => {
|
|
86
134
|
const _origClosed = Popup.prototype._closed;
|
|
87
135
|
Popup.prototype._closed = function _closed(...args) {
|
|
88
|
-
|
|
89
|
-
const domRef = element instanceof HTMLElement ? element : element?.getDomRef();
|
|
136
|
+
closeNativePopoverForOpenUI5(this);
|
|
90
137
|
_origClosed.apply(this, args); // only then call _close
|
|
91
|
-
if (domRef) {
|
|
92
|
-
closeNativePopover(domRef); // unset the popover attribute and close the native popover, but only if still in DOM
|
|
93
|
-
}
|
|
94
138
|
removeOpenedPopup(this);
|
|
95
139
|
};
|
|
96
140
|
};
|
|
@@ -113,7 +157,7 @@ const patchPopup = (Popup, Dialog) => {
|
|
|
113
157
|
patchClosed(Popup); // Popup.prototype._closed
|
|
114
158
|
createGlobalStyles(); // Ensures correct popover positioning by OpenUI5 (otherwise 0,0 is the center of the screen)
|
|
115
159
|
patchFocusEvent(Popup); // Popup.prototype.onFocusEvent
|
|
116
|
-
|
|
160
|
+
patchDialog(Dialog); // Dialog.prototype.onsapescape
|
|
117
161
|
};
|
|
118
162
|
export { patchPopup, addOpenedPopup, removeOpenedPopup, getTopmostPopup, };
|
|
119
163
|
//# sourceMappingURL=patchPopup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patchPopup.js","sourceRoot":"","sources":["../../src/features/patchPopup.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,wBAAwB,MAAM,+BAA+B,CAAC;AA6BrE,0EAA0E;AAC1E,MAAM,uBAAuB,GAAG,iBAAiB,CAAuC,yBAAyB,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC,CAAC;AAE3I,MAAM,cAAc,GAAG,CAAC,SAAoB,EAAE,EAAE;IAC/C,uBAAuB,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACxD,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,KAAa,EAAE,EAAE;IAC3C,MAAM,KAAK,GAAG,uBAAuB,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,CAAC,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AAG,IAAW;QAClE,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,EAAE,CAAC;YACtC,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAClC,CAAC;IACF,CAAC,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAC/B,MAAM,UAAU,GAAG,IAAI,aAAa,EAAE,CAAC;IACvC,UAAU,CAAC,WAAW,CAAC,+CAA+C,CAAC,CAAC;IACxE,QAAQ,CAAC,kBAAkB,GAAG,CAAC,GAAG,QAAQ,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;AAC5E,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,KAAmB,EAAE,MAAgC,EAAE,EAAE;IAC5E,wBAAwB,EAAE,CAAC;IAC3B,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,uBAAuB;IACzC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,0BAA0B;IAC9C,kBAAkB,EAAE,CAAC,CAAC,6FAA6F;IACnH,eAAe,CAAC,KAAK,CAAC,CAAC,CAAA,+BAA+B;IACtD,sBAAsB,CAAC,MAAM,CAAC,CAAC,CAAC,+BAA+B;AAChE,CAAC,CAAC;AAEF,OAAO,EACN,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,eAAe,GACf,CAAC","sourcesContent":["// OpenUI5's Control.js subset\nimport getSharedResource from \"../getSharedResource.js\";\nimport insertOpenUI5PopupStyles from \"./insertOpenUI5PopupStyles.js\";\n\ntype Control = {\n\tgetDomRef: () => HTMLElement | null,\n}\n\n// The lifecycle of Popup.js is open -> _opened -> close -> _closed, we're interested in the first (open) and last (_closed)\ntype OpenUI5Popup = {\n\tprototype: {\n\t\topen: (...args: any[]) => void,\n\t\t_closed: (...args: any[]) => void,\n\t\tgetOpenState: () => \"CLOSED\" | \"CLOSING\" | \"OPEN\" | \"OPENING\",\n\t\tgetContent: () => Control | HTMLElement | null, // this is the OpenUI5 Element/Control instance that opens the Popup (usually sap.m.Popover/sap.m.Dialog)\n\t\tonFocusEvent: (...args: any[]) => void,\n\t}\n};\n\ntype OpenUI5PopupBasedControl = {\n\tprototype: {\n\t\tonsapescape: (...args: any[]) => void,\n\t\toPopup: OpenUI5Popup,\n\t}\n};\n\ntype PopupInfo = {\n\ttype: \"OpenUI5\" | \"WebComponent\";\n\tinstance: object;\n};\n\n// contains all OpenUI5 and Web Component popups that are currently opened\nconst AllOpenedPopupsRegistry = getSharedResource<{ openedRegistry: Array<PopupInfo> }>(\"AllOpenedPopupsRegistry\", { openedRegistry: [] });\n\nconst addOpenedPopup = (popupInfo: PopupInfo) => {\n\tAllOpenedPopupsRegistry.openedRegistry.push(popupInfo);\n};\n\nconst removeOpenedPopup = (popup: object) => {\n\tconst index = AllOpenedPopupsRegistry.openedRegistry.findIndex(el => el.instance === popup);\n\tif (index > -1) {\n\t\tAllOpenedPopupsRegistry.openedRegistry.splice(index, 1);\n\t}\n};\n\nconst getTopmostPopup = () => {\n\treturn AllOpenedPopupsRegistry.openedRegistry[AllOpenedPopupsRegistry.openedRegistry.length - 1].instance;\n};\n\n/**\n * Determines whether there is a Web Component popup opened above (a specified popup).\n *\n * @param {object} popup The popup instance to check against.\n * @returns {boolean} `true` if a Web Component popup is opened above (the given popup instance); otherwise `false`.\n */\nconst hasWebComponentPopupAbove = (popup: object) => {\n\tfor (let i = AllOpenedPopupsRegistry.openedRegistry.length - 1; i >= 0; i--) {\n\t\tconst popupInfo = AllOpenedPopupsRegistry.openedRegistry[i];\n\t\tif (popupInfo.type === \"WebComponent\") {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (popupInfo.instance === popup) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn false;\n};\n\nconst openNativePopover = (domRef: HTMLElement) => {\n\tdomRef.setAttribute(\"popover\", \"manual\");\n\tdomRef.showPopover();\n};\n\nconst closeNativePopover = (domRef: HTMLElement) => {\n\tif (domRef.hasAttribute(\"popover\")) {\n\t\tdomRef.hidePopover();\n\t\tdomRef.removeAttribute(\"popover\");\n\t}\n};\n\nconst isNativePopoverOpen = (root: Document | ShadowRoot = document): boolean => {\n\tif (root.querySelector(\":popover-open\")) {\n\t\treturn true;\n\t}\n\n\treturn Array.from(root.querySelectorAll(\"*\")).some(element => {\n\t\tconst shadowRoot = element.shadowRoot;\n\t\treturn shadowRoot && isNativePopoverOpen(shadowRoot);\n\t});\n};\n\nconst patchPopupBasedControl = (PopupBasedControl: OpenUI5PopupBasedControl) => {\n\tconst origOnsapescape = PopupBasedControl.prototype.onsapescape;\n\tPopupBasedControl.prototype.onsapescape = function onsapescape(...args: any[]) {\n\t\tif (hasWebComponentPopupAbove(this.oPopup)) {\n\t\t\treturn;\n\t\t}\n\n\t\torigOnsapescape.apply(this, args);\n\t};\n};\n\nconst patchOpen = (Popup: OpenUI5Popup) => {\n\tconst origOpen = Popup.prototype.open;\n\tPopup.prototype.open = function open(...args: any[]) {\n\t\torigOpen.apply(this, args); // call open first to initiate opening\n\t\tconst topLayerAlreadyInUse = isNativePopoverOpen();\n\t\tconst openingInitiated = [\"OPENING\", \"OPEN\"].includes(this.getOpenState());\n\t\tif (openingInitiated && topLayerAlreadyInUse) {\n\t\t\tconst element = this.getContent();\n\t\t\tif (element) {\n\t\t\t\tconst domRef = element instanceof HTMLElement ? element : element?.getDomRef();\n\t\t\t\tif (domRef) {\n\t\t\t\t\topenNativePopover(domRef);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\taddOpenedPopup({\n\t\t\ttype: \"OpenUI5\",\n\t\t\tinstance: this,\n\t\t});\n\t};\n};\n\nconst patchClosed = (Popup: OpenUI5Popup) => {\n\tconst _origClosed = Popup.prototype._closed;\n\tPopup.prototype._closed = function _closed(...args: any[]) {\n\t\tconst element = this.getContent();\n\t\tconst domRef = element instanceof HTMLElement ? element : element?.getDomRef();\n\t\t_origClosed.apply(this, args); // only then call _close\n\t\tif (domRef) {\n\t\t\tcloseNativePopover(domRef); // unset the popover attribute and close the native popover, but only if still in DOM\n\t\t}\n\n\t\tremoveOpenedPopup(this);\n\t};\n};\n\nconst patchFocusEvent = (Popup: OpenUI5Popup) => {\n\tconst origFocusEvent = Popup.prototype.onFocusEvent;\n\tPopup.prototype.onFocusEvent = function onFocusEvent(...args: any[]) {\n\t\tif (!hasWebComponentPopupAbove(this)) {\n\t\t\torigFocusEvent.apply(this, args);\n\t\t}\n\t};\n};\n\nconst createGlobalStyles = () => {\n\tconst stylesheet = new CSSStyleSheet();\n\tstylesheet.replaceSync(`.sapMPopup-CTX:popover-open { inset: unset; }`);\n\tdocument.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet];\n};\n\nconst patchPopup = (Popup: OpenUI5Popup, Dialog: OpenUI5PopupBasedControl) => {\n\tinsertOpenUI5PopupStyles();\n\tpatchOpen(Popup); // Popup.prototype.open\n\tpatchClosed(Popup); // Popup.prototype._closed\n\tcreateGlobalStyles(); // Ensures correct popover positioning by OpenUI5 (otherwise 0,0 is the center of the screen)\n\tpatchFocusEvent(Popup);// Popup.prototype.onFocusEvent\n\tpatchPopupBasedControl(Dialog); // Dialog.prototype.onsapescape\n};\n\nexport {\n\tpatchPopup,\n\taddOpenedPopup,\n\tremoveOpenedPopup,\n\tgetTopmostPopup,\n};\n\nexport type { OpenUI5Popup, OpenUI5PopupBasedControl, PopupInfo };\n"]}
|
|
1
|
+
{"version":3,"file":"patchPopup.js","sourceRoot":"","sources":["../../src/features/patchPopup.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,wBAAwB,MAAM,+BAA+B,CAAC;AAmCrE,0EAA0E;AAC1E,MAAM,uBAAuB,GAAG,iBAAiB,CAAuC,yBAAyB,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC,CAAC;AAE3I,MAAM,cAAc,GAAG,CAAC,SAAoB,EAAE,EAAE;IAC/C,uBAAuB,CAAC,cAAc,CAAC,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AAO,EACN,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,eAAe,GACf,CAAC","sourcesContent":["// OpenUI5's Control.js subset\nimport getSharedResource from \"../getSharedResource.js\";\nimport insertOpenUI5PopupStyles from \"./insertOpenUI5PopupStyles.js\";\n\ntype Control = {\n\tgetDomRef: () => HTMLElement | null,\n}\n\n// The lifecycle of Popup.js is open -> _opened -> close -> _closed, we're interested in the first (open) and last (_closed)\ntype OpenUI5Popup = {\n\topen: (...args: any[]) => void,\n\t_closed: (...args: any[]) => void,\n\tgetOpenState: () => \"CLOSED\" | \"CLOSING\" | \"OPEN\" | \"OPENING\",\n\tgetContent: () => Control | HTMLElement | null, // this is the OpenUI5 Element/Control instance that opens the Popup (usually sap.m.Popover/sap.m.Dialog)\n\tonFocusEvent: (...args: any[]) => void,\n\tgetModal: () => boolean\n};\n\ntype OpenUI5PopupClass = {\n\tprototype: OpenUI5Popup\n};\n\ntype OpenUI5DialogClass = {\n\tprototype: {\n\t\tonsapescape: (...args: any[]) => void,\n\t\toPopup: OpenUI5Popup,\n\t}\n};\n\ntype PopupInfo = {\n\ttype: \"WebComponent\";\n\tinstance: object;\n} | {\n\ttype: \"OpenUI5\";\n\tinstance: OpenUI5Popup;\n};\n\n// contains all OpenUI5 and Web Component popups that are currently opened\nconst AllOpenedPopupsRegistry = getSharedResource<{ openedRegistry: Array<PopupInfo> }>(\"AllOpenedPopupsRegistry\", { openedRegistry: [] });\n\nconst addOpenedPopup = (popupInfo: PopupInfo) => {\n\tAllOpenedPopupsRegistry.openedRegistry.push(popupInfo);\n};\n\nconst removeOpenedPopup = (popup: object) => {\n\tconst index = AllOpenedPopupsRegistry.openedRegistry.findIndex(el => el.instance === popup);\n\n\tif (index === AllOpenedPopupsRegistry.openedRegistry.length - 1) {\n\t\tfixTopmostOpenUI5Popup();\n\t}\n\n\tif (index > -1) {\n\t\tAllOpenedPopupsRegistry.openedRegistry.splice(index, 1);\n\t}\n};\n\nconst getTopmostPopup = () => {\n\tif (AllOpenedPopupsRegistry.openedRegistry.length === 0) {\n\t\treturn null;\n\t}\n\treturn AllOpenedPopupsRegistry.openedRegistry[AllOpenedPopupsRegistry.openedRegistry.length - 1].instance;\n};\n\n/**\n * Determines whether there is a Web Component popup opened above (a specified popup).\n *\n * @param {object} popup The popup instance to check against.\n * @returns {boolean} `true` if a Web Component popup is opened above (the given popup instance); otherwise `false`.\n */\nconst hasWebComponentPopupAbove = (popup: object) => {\n\tfor (let i = AllOpenedPopupsRegistry.openedRegistry.length - 1; i >= 0; i--) {\n\t\tconst popupInfo = AllOpenedPopupsRegistry.openedRegistry[i];\n\t\tif (popupInfo.type === \"WebComponent\") {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (popupInfo.instance === popup) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn false;\n};\n\nconst getPopupContentElement = (popup: OpenUI5Popup): HTMLElement | null => {\n\tconst content = popup.getContent();\n\treturn content instanceof HTMLElement ? content : content?.getDomRef() || null;\n};\n\nconst openNativePopoverForOpenUI5 = (popup: OpenUI5Popup) => {\n\tconst openingInitiated = [\"OPENING\", \"OPEN\"].includes(popup.getOpenState());\n\tif (!openingInitiated || !isNativePopoverOpen()) {\n\t\treturn;\n\t}\n\n\tconst domRef = getPopupContentElement(popup);\n\n\tif (!domRef) {\n\t\treturn;\n\t}\n\n\tconst openUI5BlockLayer = document.getElementById(\"sap-ui-blocklayer-popup\");\n\n\tif (popup.getModal() && openUI5BlockLayer) {\n\t\topenUI5BlockLayer.setAttribute(\"popover\", \"manual\");\n\t\topenUI5BlockLayer.hidePopover();\n\t\topenUI5BlockLayer.showPopover();\n\t}\n\n\tdomRef.setAttribute(\"popover\", \"manual\");\n\tdomRef.showPopover();\n};\n\nconst closeNativePopoverForOpenUI5 = (popup: OpenUI5Popup) => {\n\tconst domRef = getPopupContentElement(popup);\n\n\tif (!domRef) {\n\t\treturn;\n\t}\n\n\tif (domRef.hasAttribute(\"popover\")) {\n\t\tdomRef.hidePopover();\n\t\tdomRef.removeAttribute(\"popover\");\n\t}\n\n\tif (getTopmostPopup() !== popup) {\n\t\treturn;\n\t}\n\n\t// The OpenUI5 block layer is only one for all modal OpenUI5 popups,\n\t// and it is displayed above all opened pupups - OpenUI5 and Web Components,\n\t// as a result, we need to hide this block layer.\n\t// If the underlying popup is a Web Component - it is displayed like a native popover, and we don't need to do anything\n\t// If the underlying popup is an OpenUI5 popup, it will be fixed in fixTopmostOpenUI5Popup method.\n\tif (popup.getModal()) {\n\t\tconst openUI5BlockLayer = document.getElementById(\"sap-ui-blocklayer-popup\");\n\t\tif (openUI5BlockLayer && openUI5BlockLayer.hasAttribute(\"popover\")) {\n\t\t\topenUI5BlockLayer.hidePopover();\n\t\t}\n\t}\n};\n\nconst fixTopmostOpenUI5Popup = () => {\n\tif (!isNativePopoverOpen()) {\n\t\treturn;\n\t}\n\n\tconst prevPopup = AllOpenedPopupsRegistry.openedRegistry[AllOpenedPopupsRegistry.openedRegistry.length - 2];\n\tif (!prevPopup\n\t\t|| prevPopup.type !== \"OpenUI5\"\n\t\t|| !prevPopup.instance.getModal()) {\n\t\treturn;\n\t}\n\n\tconst content = getPopupContentElement(prevPopup.instance);\n\tconst openUI5BlockLayer = document.getElementById(\"sap-ui-blocklayer-popup\");\n\n\tcontent?.hidePopover();\n\topenUI5BlockLayer?.showPopover();\n\n\tcontent?.showPopover();\n};\n\nconst isNativePopoverOpen = (root: Document | ShadowRoot = document): boolean => {\n\tif (root.querySelector(\":popover-open\")) {\n\t\treturn true;\n\t}\n\n\treturn Array.from(root.querySelectorAll(\"*\")).some(element => {\n\t\tconst shadowRoot = element.shadowRoot;\n\t\treturn shadowRoot && isNativePopoverOpen(shadowRoot);\n\t});\n};\n\nconst patchDialog = (Dialog: OpenUI5DialogClass) => {\n\tconst origOnsapescape = Dialog.prototype.onsapescape;\n\tDialog.prototype.onsapescape = function onsapescape(...args: any[]) {\n\t\tif (hasWebComponentPopupAbove(this.oPopup)) {\n\t\t\treturn;\n\t\t}\n\n\t\torigOnsapescape.apply(this, args);\n\t};\n};\n\nconst patchOpen = (Popup: OpenUI5PopupClass) => {\n\tconst origOpen = Popup.prototype.open;\n\tPopup.prototype.open = function open(...args: any[]) {\n\t\torigOpen.apply(this, args); // call open first to initiate opening\n\t\topenNativePopoverForOpenUI5(this);\n\n\t\taddOpenedPopup({\n\t\t\ttype: \"OpenUI5\",\n\t\t\tinstance: this,\n\t\t});\n\t};\n};\n\nconst patchClosed = (Popup: OpenUI5PopupClass) => {\n\tconst _origClosed = Popup.prototype._closed;\n\tPopup.prototype._closed = function _closed(...args: any[]) {\n\t\tcloseNativePopoverForOpenUI5(this);\n\t\t_origClosed.apply(this, args); // only then call _close\n\t\tremoveOpenedPopup(this);\n\t};\n};\n\nconst patchFocusEvent = (Popup: OpenUI5PopupClass) => {\n\tconst origFocusEvent = Popup.prototype.onFocusEvent;\n\tPopup.prototype.onFocusEvent = function onFocusEvent(...args: any[]) {\n\t\tif (!hasWebComponentPopupAbove(this)) {\n\t\t\torigFocusEvent.apply(this, args);\n\t\t}\n\t};\n};\n\nconst createGlobalStyles = () => {\n\tconst stylesheet = new CSSStyleSheet();\n\tstylesheet.replaceSync(`.sapMPopup-CTX:popover-open { inset: unset; }`);\n\tdocument.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet];\n};\n\nconst patchPopup = (Popup: OpenUI5PopupClass, Dialog: OpenUI5DialogClass) => {\n\tinsertOpenUI5PopupStyles();\n\tpatchOpen(Popup); // Popup.prototype.open\n\tpatchClosed(Popup); // Popup.prototype._closed\n\tcreateGlobalStyles(); // Ensures correct popover positioning by OpenUI5 (otherwise 0,0 is the center of the screen)\n\tpatchFocusEvent(Popup);// Popup.prototype.onFocusEvent\n\tpatchDialog(Dialog); // Dialog.prototype.onsapescape\n};\n\nexport {\n\tpatchPopup,\n\taddOpenedPopup,\n\tremoveOpenedPopup,\n\tgetTopmostPopup,\n};\n\nexport type { OpenUI5PopupClass, OpenUI5DialogClass, PopupInfo };\n"]}
|