@nebula.js/sn-action-button 1.10.0 → 1.12.1
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/sn-action-button v1.
|
|
3
|
-
* Copyright (c)
|
|
2
|
+
* @nebula.js/sn-action-button v1.12.1
|
|
3
|
+
* Copyright (c) 2022 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -1038,35 +1038,6 @@ var inIframe = function inIframe() {
|
|
|
1038
1038
|
return true;
|
|
1039
1039
|
}
|
|
1040
1040
|
};
|
|
1041
|
-
|
|
1042
|
-
var getOrderedSheets = /*#__PURE__*/function () {
|
|
1043
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(app) {
|
|
1044
|
-
var sheets;
|
|
1045
|
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
1046
|
-
while (1) {
|
|
1047
|
-
switch (_context.prev = _context.next) {
|
|
1048
|
-
case 0:
|
|
1049
|
-
_context.next = 2;
|
|
1050
|
-
return app.getSheetList();
|
|
1051
|
-
|
|
1052
|
-
case 2:
|
|
1053
|
-
sheets = _context.sent;
|
|
1054
|
-
return _context.abrupt("return", sheets.sort(function (current, next) {
|
|
1055
|
-
return current.qData.rank - next.qData.rank;
|
|
1056
|
-
}));
|
|
1057
|
-
|
|
1058
|
-
case 4:
|
|
1059
|
-
case "end":
|
|
1060
|
-
return _context.stop();
|
|
1061
|
-
}
|
|
1062
|
-
}
|
|
1063
|
-
}, _callee);
|
|
1064
|
-
}));
|
|
1065
|
-
|
|
1066
|
-
return function getOrderedSheets(_x) {
|
|
1067
|
-
return _ref.apply(this, arguments);
|
|
1068
|
-
};
|
|
1069
|
-
}();
|
|
1070
1041
|
var getOrderedVisibleSheet = /*#__PURE__*/function () {
|
|
1071
1042
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(app) {
|
|
1072
1043
|
var sheets, visibleSheets;
|
|
@@ -1164,39 +1135,21 @@ var navigationActions = [{
|
|
|
1164
1135
|
value: 'lastSheet',
|
|
1165
1136
|
navigationCall: function () {
|
|
1166
1137
|
var _navigationCall3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(_ref5) {
|
|
1167
|
-
var app,
|
|
1138
|
+
var app, senseNavigation, sheets;
|
|
1168
1139
|
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
1169
1140
|
while (1) {
|
|
1170
1141
|
switch (_context5.prev = _context5.next) {
|
|
1171
1142
|
case 0:
|
|
1172
|
-
app = _ref5.app,
|
|
1173
|
-
|
|
1174
|
-
if (!enableSheetShow) {
|
|
1175
|
-
_context5.next = 7;
|
|
1176
|
-
break;
|
|
1177
|
-
}
|
|
1178
|
-
|
|
1179
|
-
_context5.next = 4;
|
|
1143
|
+
app = _ref5.app, senseNavigation = _ref5.senseNavigation;
|
|
1144
|
+
_context5.next = 3;
|
|
1180
1145
|
return getOrderedVisibleSheet(app);
|
|
1181
1146
|
|
|
1182
|
-
case
|
|
1183
|
-
|
|
1184
|
-
_context5.next =
|
|
1185
|
-
break;
|
|
1186
|
-
|
|
1187
|
-
case 7:
|
|
1188
|
-
_context5.next = 9;
|
|
1189
|
-
return getOrderedSheets(app);
|
|
1190
|
-
|
|
1191
|
-
case 9:
|
|
1192
|
-
_context5.t0 = _context5.sent;
|
|
1193
|
-
|
|
1194
|
-
case 10:
|
|
1195
|
-
sheets = _context5.t0;
|
|
1196
|
-
_context5.next = 13;
|
|
1147
|
+
case 3:
|
|
1148
|
+
sheets = _context5.sent;
|
|
1149
|
+
_context5.next = 6;
|
|
1197
1150
|
return senseNavigation.goToSheet(sheets[sheets.length - 1].qInfo.qId);
|
|
1198
1151
|
|
|
1199
|
-
case
|
|
1152
|
+
case 6:
|
|
1200
1153
|
case "end":
|
|
1201
1154
|
return _context5.stop();
|
|
1202
1155
|
}
|
|
@@ -1216,39 +1169,21 @@ var navigationActions = [{
|
|
|
1216
1169
|
value: 'firstSheet',
|
|
1217
1170
|
navigationCall: function () {
|
|
1218
1171
|
var _navigationCall4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(_ref6) {
|
|
1219
|
-
var app,
|
|
1172
|
+
var app, senseNavigation, sheets;
|
|
1220
1173
|
return regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
1221
1174
|
while (1) {
|
|
1222
1175
|
switch (_context6.prev = _context6.next) {
|
|
1223
1176
|
case 0:
|
|
1224
|
-
app = _ref6.app,
|
|
1225
|
-
|
|
1226
|
-
if (!enableSheetShow) {
|
|
1227
|
-
_context6.next = 7;
|
|
1228
|
-
break;
|
|
1229
|
-
}
|
|
1230
|
-
|
|
1231
|
-
_context6.next = 4;
|
|
1177
|
+
app = _ref6.app, senseNavigation = _ref6.senseNavigation;
|
|
1178
|
+
_context6.next = 3;
|
|
1232
1179
|
return getOrderedVisibleSheet(app);
|
|
1233
1180
|
|
|
1234
|
-
case
|
|
1235
|
-
|
|
1236
|
-
_context6.next =
|
|
1237
|
-
break;
|
|
1238
|
-
|
|
1239
|
-
case 7:
|
|
1240
|
-
_context6.next = 9;
|
|
1241
|
-
return getOrderedSheets(app);
|
|
1242
|
-
|
|
1243
|
-
case 9:
|
|
1244
|
-
_context6.t0 = _context6.sent;
|
|
1245
|
-
|
|
1246
|
-
case 10:
|
|
1247
|
-
sheets = _context6.t0;
|
|
1248
|
-
_context6.next = 13;
|
|
1181
|
+
case 3:
|
|
1182
|
+
sheets = _context6.sent;
|
|
1183
|
+
_context6.next = 6;
|
|
1249
1184
|
return senseNavigation.goToSheet(sheets[0].qInfo.qId);
|
|
1250
1185
|
|
|
1251
|
-
case
|
|
1186
|
+
case 6:
|
|
1252
1187
|
case "end":
|
|
1253
1188
|
return _context6.stop();
|
|
1254
1189
|
}
|
|
@@ -2209,8 +2144,7 @@ var toggleOptions = [{
|
|
|
2209
2144
|
translation: 'properties.off'
|
|
2210
2145
|
}];
|
|
2211
2146
|
function ext(_ref) {
|
|
2212
|
-
var translator = _ref.translator
|
|
2213
|
-
enableReloadAction = _ref.enableReloadAction;
|
|
2147
|
+
var translator = _ref.translator;
|
|
2214
2148
|
return {
|
|
2215
2149
|
definition: {
|
|
2216
2150
|
type: 'items',
|
|
@@ -2256,11 +2190,7 @@ function ext(_ref) {
|
|
|
2256
2190
|
component: 'expression-with-dropdown',
|
|
2257
2191
|
translation: 'Object.ActionButton.Action',
|
|
2258
2192
|
defaultValue: '',
|
|
2259
|
-
options:
|
|
2260
|
-
return actions.filter(function (a) {
|
|
2261
|
-
return enableReloadAction || a.value !== 'doReload';
|
|
2262
|
-
});
|
|
2263
|
-
},
|
|
2193
|
+
options: actions,
|
|
2264
2194
|
dropdownOnly: true
|
|
2265
2195
|
},
|
|
2266
2196
|
bookmark: {
|
|
@@ -3842,7 +3772,7 @@ var styleFormatter = {
|
|
|
3842
3772
|
disabled = _ref2.disabled,
|
|
3843
3773
|
theme = _ref2.theme,
|
|
3844
3774
|
element = _ref2.element;
|
|
3845
|
-
var styles = 'width: 100%;height: 100%;transition: transform .1s ease-in-out;';
|
|
3775
|
+
var styles = 'width: 100%;height: 100%;transition: transform .1s ease-in-out;position: absolute;bottom: 0;left: 0; top: 0;right: 0;margin: auto;';
|
|
3846
3776
|
var font = style.font,
|
|
3847
3777
|
background = style.background,
|
|
3848
3778
|
border = style.border;
|
|
@@ -4001,8 +3931,7 @@ function renderButton(_ref2) {
|
|
|
4001
3931
|
app = _ref2.app,
|
|
4002
3932
|
constraints = _ref2.constraints,
|
|
4003
3933
|
senseNavigation = _ref2.senseNavigation,
|
|
4004
|
-
element = _ref2.element
|
|
4005
|
-
enableSheetShow = _ref2.enableSheetShow;
|
|
3934
|
+
element = _ref2.element;
|
|
4006
3935
|
var isSense = !!senseNavigation;
|
|
4007
3936
|
var button = element.firstElementChild;
|
|
4008
3937
|
var style = layout.style,
|
|
@@ -4067,7 +3996,6 @@ function renderButton(_ref2) {
|
|
|
4067
3996
|
_context2.next = 13;
|
|
4068
3997
|
return navigationObject.navigationCall(_objectSpread2({
|
|
4069
3998
|
app: app,
|
|
4070
|
-
enableSheetShow: enableSheetShow,
|
|
4071
3999
|
senseNavigation: senseNavigation
|
|
4072
4000
|
}, navigation));
|
|
4073
4001
|
|
|
@@ -4122,12 +4050,8 @@ function renderButton(_ref2) {
|
|
|
4122
4050
|
|
|
4123
4051
|
function supernova(env) {
|
|
4124
4052
|
var sense = env.sense,
|
|
4125
|
-
translator = env.translator
|
|
4126
|
-
flags = env.flags;
|
|
4053
|
+
translator = env.translator;
|
|
4127
4054
|
var senseNavigation = sense && sense.navigation;
|
|
4128
|
-
var isEnabled = flags.isEnabled;
|
|
4129
|
-
var enableSheetShow = isEnabled('SHEET_SHOW_CONDITION');
|
|
4130
|
-
var enableReloadAction = isEnabled('ACTION_BUTTON_RELOAD');
|
|
4131
4055
|
properties.style.label = sense ? translator.get('Object.ActionButton') : 'Button';
|
|
4132
4056
|
return {
|
|
4133
4057
|
qae: {
|
|
@@ -4151,8 +4075,7 @@ function supernova(env) {
|
|
|
4151
4075
|
constraints: constraints,
|
|
4152
4076
|
theme: theme,
|
|
4153
4077
|
app: app,
|
|
4154
|
-
senseNavigation: senseNavigation
|
|
4155
|
-
enableSheetShow: enableSheetShow
|
|
4078
|
+
senseNavigation: senseNavigation
|
|
4156
4079
|
});
|
|
4157
4080
|
useEffect(function () {
|
|
4158
4081
|
return function () {
|
|
@@ -4161,8 +4084,7 @@ function supernova(env) {
|
|
|
4161
4084
|
}, [element]);
|
|
4162
4085
|
},
|
|
4163
4086
|
ext: ext({
|
|
4164
|
-
translator: translator
|
|
4165
|
-
enableReloadAction: enableReloadAction
|
|
4087
|
+
translator: translator
|
|
4166
4088
|
})
|
|
4167
4089
|
};
|
|
4168
4090
|
}
|