@nebula.js/stardust 4.0.0-alpha.4 → 4.0.0-alpha.6
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/core/esm/dev.js +331 -150
- package/core/esm/dev.js.map +1 -1
- package/core/esm/index.js +3 -3
- package/core/esm/index.js.map +1 -1
- package/dist/stardust.dev.js +331 -149
- package/dist/stardust.dev.js.map +1 -1
- package/dist/stardust.js +13 -13
- package/dist/stardust.js.map +1 -1
- package/package.json +9 -9
- package/types/index.d.ts +19 -0
package/dist/stardust.dev.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/stardust v4.0.0-alpha.
|
|
2
|
+
* @nebula.js/stardust v4.0.0-alpha.6
|
|
3
3
|
* Copyright (c) 2023 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
@@ -1563,7 +1563,7 @@
|
|
|
1563
1563
|
var SelectionToolbar_ClickToUnlock = {
|
|
1564
1564
|
id: "SelectionToolbar.ClickToUnlock",
|
|
1565
1565
|
locale: {
|
|
1566
|
-
"de-DE": "
|
|
1566
|
+
"de-DE": "Zum Entsperren klicken",
|
|
1567
1567
|
"en-US": "Click to unlock",
|
|
1568
1568
|
"es-ES": "Haga clic para desbloquearla",
|
|
1569
1569
|
"fr-FR": "Cliquez pour déverrouiller",
|
|
@@ -15420,7 +15420,7 @@
|
|
|
15420
15420
|
return cache[key];
|
|
15421
15421
|
}
|
|
15422
15422
|
|
|
15423
|
-
const NEBULA_VERSION_HASH = "
|
|
15423
|
+
const NEBULA_VERSION_HASH = "9917" ;
|
|
15424
15424
|
ClassNameGenerator$1.configure(componentName => {
|
|
15425
15425
|
return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
|
|
15426
15426
|
});
|
|
@@ -15628,7 +15628,7 @@
|
|
|
15628
15628
|
const appRef = React.createRef();
|
|
15629
15629
|
const element = document.createElement('div');
|
|
15630
15630
|
element.style.display = 'none';
|
|
15631
|
-
element.setAttribute('data-nebulajs-version', "4.0.0-alpha.
|
|
15631
|
+
element.setAttribute('data-nebulajs-version', "4.0.0-alpha.6" );
|
|
15632
15632
|
element.setAttribute('data-app-id', app.id);
|
|
15633
15633
|
document.body.appendChild(element);
|
|
15634
15634
|
const root = client.createRoot(element);
|
|
@@ -21702,7 +21702,7 @@
|
|
|
21702
21702
|
return elemNumbersOrdered.slice(min, max + 1);
|
|
21703
21703
|
}
|
|
21704
21704
|
|
|
21705
|
-
const getKeyAsToggleSelected = event => !(event.metaKey || event.ctrlKey);
|
|
21705
|
+
const getKeyAsToggleSelected = event => !(event !== null && event !== void 0 && event.metaKey || event !== null && event !== void 0 && event.ctrlKey);
|
|
21706
21706
|
function useSelectionsInteractions(_ref) {
|
|
21707
21707
|
let {
|
|
21708
21708
|
selectionState,
|
|
@@ -21743,6 +21743,11 @@
|
|
|
21743
21743
|
const selectManually = function () {
|
|
21744
21744
|
let elementIds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
21745
21745
|
let additive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
21746
|
+
let event = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
|
21747
|
+
const toggle = !selectionState.isSingleSelect && getKeyAsToggleSelected(event === null || event === void 0 ? void 0 : event.nativeEvent);
|
|
21748
|
+
if (!toggle) {
|
|
21749
|
+
selectionState.clearItemStates(true);
|
|
21750
|
+
}
|
|
21746
21751
|
const elemNumbers = [];
|
|
21747
21752
|
selectionState.updateItems(elementIds, additive, elemNumbers);
|
|
21748
21753
|
selectionState.setSelectableValuesUpdating();
|
|
@@ -21750,7 +21755,7 @@
|
|
|
21750
21755
|
selections,
|
|
21751
21756
|
elemNumbers: additive ? elemNumbers : elementIds,
|
|
21752
21757
|
isSingleSelect: selectionState.isSingleSelect,
|
|
21753
|
-
toggle
|
|
21758
|
+
toggle
|
|
21754
21759
|
});
|
|
21755
21760
|
};
|
|
21756
21761
|
const handleSingleSelectKey = (event, target) => {
|
|
@@ -22007,7 +22012,7 @@
|
|
|
22007
22012
|
setStartedRange(true);
|
|
22008
22013
|
break;
|
|
22009
22014
|
case KEYS.SPACE:
|
|
22010
|
-
select([+event.currentTarget.getAttribute('data-n')]);
|
|
22015
|
+
select([+event.currentTarget.getAttribute('data-n')], false, event);
|
|
22011
22016
|
break;
|
|
22012
22017
|
case KEYS.ARROW_DOWN:
|
|
22013
22018
|
case KEYS.ARROW_RIGHT:
|
|
@@ -22272,6 +22277,16 @@
|
|
|
22272
22277
|
return clazzArr;
|
|
22273
22278
|
};
|
|
22274
22279
|
|
|
22280
|
+
const CELL_PADDING_LEFT = 9;
|
|
22281
|
+
const ICON_WIDTH = 12;
|
|
22282
|
+
const ICON_PADDING = 7;
|
|
22283
|
+
const BUTTON_ICON_WIDTH = ICON_WIDTH + (ICON_PADDING + 1) * 2; // 1 is border width
|
|
22284
|
+
const REMOVE_TICK_LIMIT = 80; // an item width equal to or less than this, will hide the select tick
|
|
22285
|
+
const SCROLL_BAR_WIDTH = 10; // TODO: ignore this - instead set the styling only show on hover...
|
|
22286
|
+
const ITEM_MAX_WIDTH = 150;
|
|
22287
|
+
const FREQUENCY_WIDTH = 40;
|
|
22288
|
+
const ITEM_MIN_WIDTH = 56;
|
|
22289
|
+
const CHECKBOX_WIDTH = 20;
|
|
22275
22290
|
const frequencyTextNone = '-';
|
|
22276
22291
|
const barPadPx = 4;
|
|
22277
22292
|
const barBorderWidthPx = 1;
|
|
@@ -22291,11 +22306,6 @@
|
|
|
22291
22306
|
};
|
|
22292
22307
|
const getFrequencyText = qFrequency => qFrequency || frequencyTextNone;
|
|
22293
22308
|
|
|
22294
|
-
const CELL_PADDING_LEFT = 9;
|
|
22295
|
-
const ICON_WIDTH = 12;
|
|
22296
|
-
const ICON_PADDING = 7;
|
|
22297
|
-
const BUTTON_ICON_WIDTH = ICON_WIDTH + (ICON_PADDING + 1) * 2; // 1 is border width
|
|
22298
|
-
|
|
22299
22309
|
const getSelectedStyle = _ref => {
|
|
22300
22310
|
let {
|
|
22301
22311
|
theme
|
|
@@ -22321,7 +22331,7 @@
|
|
|
22321
22331
|
const iconWidth = 24; // tick and lock icon width in px
|
|
22322
22332
|
|
|
22323
22333
|
const RowColRoot = styled$1('div', {
|
|
22324
|
-
shouldForwardProp: prop => !['flexBasisProp', 'isGridMode', 'isGridCol', 'dense', 'frequencyWidth'
|
|
22334
|
+
shouldForwardProp: prop => !['flexBasisProp', 'isGridMode', 'isGridCol', 'dense', 'frequencyWidth'].includes(prop)
|
|
22325
22335
|
})(_ref2 => {
|
|
22326
22336
|
var _theme$listBox$conten, _theme$listBox, _theme$listBox$conten2, _theme$listBox$conten3, _theme$listBox2, _theme$listBox2$conte, _theme$listBox3, _theme$listBox3$conte, _theme$listBox4, _theme$listBox4$conte;
|
|
22327
22337
|
let {
|
|
@@ -22330,9 +22340,7 @@
|
|
|
22330
22340
|
isGridMode,
|
|
22331
22341
|
isGridCol,
|
|
22332
22342
|
dense,
|
|
22333
|
-
frequencyWidth
|
|
22334
|
-
showIcon,
|
|
22335
|
-
checkboxes
|
|
22343
|
+
frequencyWidth
|
|
22336
22344
|
} = _ref2;
|
|
22337
22345
|
return {
|
|
22338
22346
|
'&:focus': {
|
|
@@ -22377,7 +22385,7 @@
|
|
|
22377
22385
|
flexBasis: flexBasisProp,
|
|
22378
22386
|
lineHeight: '16px',
|
|
22379
22387
|
userSelect: 'none',
|
|
22380
|
-
paddingRight:
|
|
22388
|
+
paddingRight: '1px'
|
|
22381
22389
|
}, ellipsis), {}, {
|
|
22382
22390
|
whiteSpace: 'pre',
|
|
22383
22391
|
// to keep white-space on highlight
|
|
@@ -22387,15 +22395,10 @@
|
|
|
22387
22395
|
["& .".concat(rowColClasses.labelDense)]: {
|
|
22388
22396
|
fontSize: 12
|
|
22389
22397
|
},
|
|
22390
|
-
// Highlight is added to labelText spans, which are created as
|
|
22398
|
+
// Highlight is added to labelText spans, which are created as children to original labelText,
|
|
22391
22399
|
// when a search string is matched.
|
|
22392
22400
|
["& .".concat(rowColClasses.highlighted)]: {
|
|
22393
|
-
|
|
22394
|
-
width: '100%',
|
|
22395
|
-
'& > span': {
|
|
22396
|
-
width: '100%',
|
|
22397
|
-
backgroundColor: '#FFC72A'
|
|
22398
|
-
}
|
|
22401
|
+
backgroundColor: '#FFC72A'
|
|
22399
22402
|
},
|
|
22400
22403
|
// Checkbox and label container.
|
|
22401
22404
|
["& .".concat(rowColClasses.checkboxLabel)]: {
|
|
@@ -22449,7 +22452,7 @@
|
|
|
22449
22452
|
["& .".concat(rowColClasses.frequencyCount)]: _objectSpread2(_objectSpread2({
|
|
22450
22453
|
justifyContent: 'flex-end'
|
|
22451
22454
|
}, ellipsis), {}, {
|
|
22452
|
-
flex: "0 1 ".concat(frequencyWidth
|
|
22455
|
+
flex: "0 1 ".concat(frequencyWidth, "px"),
|
|
22453
22456
|
textAlign: 'right',
|
|
22454
22457
|
paddingLeft: '2px'
|
|
22455
22458
|
}),
|
|
@@ -22649,7 +22652,6 @@
|
|
|
22649
22652
|
let {
|
|
22650
22653
|
label,
|
|
22651
22654
|
color,
|
|
22652
|
-
highlighted = false,
|
|
22653
22655
|
dense,
|
|
22654
22656
|
showGray = true,
|
|
22655
22657
|
checkboxes,
|
|
@@ -22659,14 +22661,14 @@
|
|
|
22659
22661
|
return /*#__PURE__*/React.createElement(Typography$1, {
|
|
22660
22662
|
component: "span",
|
|
22661
22663
|
variant: "body2",
|
|
22662
|
-
className: joinClassNames([rowColClasses.labelText,
|
|
22664
|
+
className: joinClassNames([rowColClasses.labelText, dense && rowColClasses.labelDense, showGray && excludedOrAlternative({
|
|
22663
22665
|
cell,
|
|
22664
22666
|
checkboxes
|
|
22665
22667
|
}) && rowColClasses.excludedTextWithCheckbox]),
|
|
22666
22668
|
color: color,
|
|
22667
|
-
align: valueTextAlign
|
|
22669
|
+
align: valueTextAlign,
|
|
22670
|
+
dir: "auto"
|
|
22668
22671
|
}, /*#__PURE__*/React.createElement("span", {
|
|
22669
|
-
dir: "auto",
|
|
22670
22672
|
style: {
|
|
22671
22673
|
whiteSpace: 'pre'
|
|
22672
22674
|
}
|
|
@@ -22677,7 +22679,6 @@
|
|
|
22677
22679
|
let {
|
|
22678
22680
|
label,
|
|
22679
22681
|
color,
|
|
22680
|
-
highlighted,
|
|
22681
22682
|
dense,
|
|
22682
22683
|
showGray,
|
|
22683
22684
|
checkboxes,
|
|
@@ -22688,7 +22689,6 @@
|
|
|
22688
22689
|
return /*#__PURE__*/React.createElement(ValueField, {
|
|
22689
22690
|
label: label,
|
|
22690
22691
|
color: color,
|
|
22691
|
-
highlighted: highlighted,
|
|
22692
22692
|
dense: dense,
|
|
22693
22693
|
showGray: showGray,
|
|
22694
22694
|
checkboxes: checkboxes,
|
|
@@ -22711,7 +22711,6 @@
|
|
|
22711
22711
|
isGridCol,
|
|
22712
22712
|
showGray,
|
|
22713
22713
|
isSingleSelect,
|
|
22714
|
-
highlighted,
|
|
22715
22714
|
checkboxes,
|
|
22716
22715
|
valueTextAlign
|
|
22717
22716
|
} = _ref;
|
|
@@ -22739,7 +22738,6 @@
|
|
|
22739
22738
|
label: /*#__PURE__*/React.createElement(LabelTag, {
|
|
22740
22739
|
label: label,
|
|
22741
22740
|
color: color,
|
|
22742
|
-
highlighted: highlighted,
|
|
22743
22741
|
dense: dense,
|
|
22744
22742
|
showGray: showGray,
|
|
22745
22743
|
checkboxes: checkboxes,
|
|
@@ -22757,18 +22755,19 @@
|
|
|
22757
22755
|
showGray,
|
|
22758
22756
|
checkboxes
|
|
22759
22757
|
} = _ref;
|
|
22760
|
-
|
|
22758
|
+
const text = labels.map((_ref2, index) => {
|
|
22761
22759
|
let [label, highlighted] = _ref2;
|
|
22762
|
-
|
|
22763
|
-
|
|
22764
|
-
|
|
22765
|
-
|
|
22766
|
-
|
|
22767
|
-
|
|
22768
|
-
|
|
22769
|
-
|
|
22770
|
-
|
|
22771
|
-
|
|
22760
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
22761
|
+
id: index,
|
|
22762
|
+
className: highlighted ? rowColClasses.highlighted : ''
|
|
22763
|
+
}, label);
|
|
22764
|
+
});
|
|
22765
|
+
return /*#__PURE__*/React.createElement(ValueField, {
|
|
22766
|
+
label: text,
|
|
22767
|
+
dense: dense,
|
|
22768
|
+
showGray: showGray,
|
|
22769
|
+
checkboxes: checkboxes
|
|
22770
|
+
});
|
|
22772
22771
|
}
|
|
22773
22772
|
function FieldWithRanges(_ref3) {
|
|
22774
22773
|
let {
|
|
@@ -22819,7 +22818,6 @@
|
|
|
22819
22818
|
isGridCol,
|
|
22820
22819
|
showGray,
|
|
22821
22820
|
isSingleSelect,
|
|
22822
|
-
highlighted,
|
|
22823
22821
|
checkboxes,
|
|
22824
22822
|
valueTextAlign
|
|
22825
22823
|
} = _ref;
|
|
@@ -22834,13 +22832,11 @@
|
|
|
22834
22832
|
isGridCol: isGridCol,
|
|
22835
22833
|
showGray: showGray,
|
|
22836
22834
|
isSingleSelect: isSingleSelect,
|
|
22837
|
-
highlighted: highlighted,
|
|
22838
22835
|
checkboxes: checkboxes,
|
|
22839
22836
|
valueTextAlign: valueTextAlign
|
|
22840
22837
|
}) : /*#__PURE__*/React.createElement(ValueField, {
|
|
22841
22838
|
label: label,
|
|
22842
22839
|
color: color,
|
|
22843
|
-
highlighted: false,
|
|
22844
22840
|
dense: dense,
|
|
22845
22841
|
showGray: true,
|
|
22846
22842
|
checkboxes: checkboxes,
|
|
@@ -22940,7 +22936,7 @@
|
|
|
22940
22936
|
dataLayout,
|
|
22941
22937
|
layoutOrder,
|
|
22942
22938
|
itemPadding,
|
|
22943
|
-
|
|
22939
|
+
cellPaddingRight
|
|
22944
22940
|
} = _ref;
|
|
22945
22941
|
return {
|
|
22946
22942
|
["&.".concat(rowColClasses.fieldRoot)]: _objectSpread2(_objectSpread2({}, getGridItemSizes({
|
|
@@ -22948,7 +22944,7 @@
|
|
|
22948
22944
|
layoutOrder,
|
|
22949
22945
|
itemPadding
|
|
22950
22946
|
})), {}, {
|
|
22951
|
-
paddingRight:
|
|
22947
|
+
paddingRight: cellPaddingRight ? '8px' : undefined
|
|
22952
22948
|
})
|
|
22953
22949
|
};
|
|
22954
22950
|
});
|
|
@@ -22998,7 +22994,7 @@
|
|
|
22998
22994
|
histogram = false,
|
|
22999
22995
|
keyboard,
|
|
23000
22996
|
showGray = true,
|
|
23001
|
-
showTick:
|
|
22997
|
+
showTick: sizePermitsTickOrLock = true,
|
|
23002
22998
|
columnCount = 1,
|
|
23003
22999
|
rowCount = 1,
|
|
23004
23000
|
dataOffset,
|
|
@@ -23094,7 +23090,6 @@
|
|
|
23094
23090
|
}
|
|
23095
23091
|
const isGridCol = dataLayout === 'grid' && layoutOrder === 'column';
|
|
23096
23092
|
const label = (_cell$qText = cell === null || cell === void 0 ? void 0 : cell.qText) !== null && _cell$qText !== void 0 ? _cell$qText : '';
|
|
23097
|
-
|
|
23098
23093
|
// Search highlights. Split up labelText span into several and add the highlighted class to matching sub-strings.
|
|
23099
23094
|
|
|
23100
23095
|
let labels;
|
|
@@ -23119,23 +23114,23 @@
|
|
|
23119
23114
|
const isFirstElement = index === 0;
|
|
23120
23115
|
const flexBasisVal = checkboxes ? 'auto' : 'max-content';
|
|
23121
23116
|
const showLock = isSelected && isLocked;
|
|
23122
|
-
const showTick = !checkboxes && isSelected && !isLocked
|
|
23123
|
-
const showIcon = !checkboxes &&
|
|
23117
|
+
const showTick = !checkboxes && isSelected && !isLocked;
|
|
23118
|
+
const showIcon = !checkboxes && sizePermitsTickOrLock;
|
|
23119
|
+
const cellPaddingRight = checkboxes || !sizePermitsTickOrLock;
|
|
23124
23120
|
return /*#__PURE__*/React.createElement(RowColRoot$1, {
|
|
23125
23121
|
className: rowColClasses.barContainer,
|
|
23126
23122
|
flexBasisProp: flexBasisVal,
|
|
23127
23123
|
style: styles,
|
|
23128
|
-
showIcon: showIcon,
|
|
23129
|
-
checkboxes: checkboxes,
|
|
23130
23124
|
isGridCol: isGridCol,
|
|
23131
23125
|
isGridMode: dataLayout === 'grid',
|
|
23132
23126
|
dense: dense,
|
|
23133
|
-
frequencyWidth: frequencyWidth
|
|
23127
|
+
frequencyWidth: frequencyWidth,
|
|
23128
|
+
"data-testid": "listbox.item"
|
|
23134
23129
|
}, /*#__PURE__*/React.createElement(ItemGrid, {
|
|
23135
23130
|
ref: rowRef,
|
|
23136
23131
|
container: true,
|
|
23137
23132
|
dataLayout: dataLayout,
|
|
23138
|
-
|
|
23133
|
+
cellPaddingRight: cellPaddingRight,
|
|
23139
23134
|
layoutOrder: layoutOrder,
|
|
23140
23135
|
itemPadding: itemPadding,
|
|
23141
23136
|
gap: 0,
|
|
@@ -24732,8 +24727,6 @@
|
|
|
24732
24727
|
overflowDisclaimer.set(show);
|
|
24733
24728
|
}
|
|
24734
24729
|
|
|
24735
|
-
const REMOVE_TICK_LIMIT = 80; // an item width equal to or less than this, will hide the select tick
|
|
24736
|
-
|
|
24737
24730
|
const {
|
|
24738
24731
|
StyledFixedSizeList,
|
|
24739
24732
|
StyledFixedSizeGrid
|
|
@@ -24962,12 +24955,6 @@
|
|
|
24962
24955
|
};
|
|
24963
24956
|
}
|
|
24964
24957
|
|
|
24965
|
-
const SCROLL_BAR_WIDTH = 10; // TODO: ignore this - instead set the styling only show on hover...
|
|
24966
|
-
const ITEM_MAX_WIDTH = 150;
|
|
24967
|
-
const FREQUENCY_WIDTH = 40;
|
|
24968
|
-
const ITEM_MIN_WIDTH = 56;
|
|
24969
|
-
const CHECKBOX_WIDTH = 20;
|
|
24970
|
-
|
|
24971
24958
|
function calculateRowMode(_ref) {
|
|
24972
24959
|
let {
|
|
24973
24960
|
maxVisibleColumns,
|
|
@@ -24979,7 +24966,7 @@
|
|
|
24979
24966
|
const maxColumns = (maxVisibleColumns === null || maxVisibleColumns === void 0 ? void 0 : maxVisibleColumns.maxColumns) || 3;
|
|
24980
24967
|
const innerWidth = containerWidth - SCROLL_BAR_WIDTH;
|
|
24981
24968
|
let columnCount;
|
|
24982
|
-
const autoColumnCount = Math.min(listCount, Math.
|
|
24969
|
+
const autoColumnCount = Math.min(listCount, Math.max(1, Math.round(innerWidth / Math.max(itemMinWidth, columnAutoWidth)))); // TODO: smarter sizing... based on glyph count + font size etc...??
|
|
24983
24970
|
if ((maxVisibleColumns === null || maxVisibleColumns === void 0 ? void 0 : maxVisibleColumns.auto) !== false) {
|
|
24984
24971
|
columnCount = autoColumnCount;
|
|
24985
24972
|
} else {
|
|
@@ -25017,8 +25004,16 @@
|
|
|
25017
25004
|
} = layoutOptions;
|
|
25018
25005
|
const frequencyAddWidth = freqIsAllowed ? FREQUENCY_WIDTH : 0;
|
|
25019
25006
|
const checkboxAddWidth = checkboxes ? CHECKBOX_WIDTH : 0;
|
|
25020
|
-
const
|
|
25021
|
-
|
|
25007
|
+
const tickIconWidth = CHECKBOX_WIDTH;
|
|
25008
|
+
let dynamicItemMinWidth = ITEM_MIN_WIDTH + frequencyAddWidth + checkboxAddWidth;
|
|
25009
|
+
if (!checkboxes && dynamicItemMinWidth >= REMOVE_TICK_LIMIT) {
|
|
25010
|
+
dynamicItemMinWidth += tickIconWidth;
|
|
25011
|
+
}
|
|
25012
|
+
let columnAutoWidth = textWidth + 18 + frequencyAddWidth + checkboxAddWidth;
|
|
25013
|
+
if (!checkboxes && columnAutoWidth >= REMOVE_TICK_LIMIT) {
|
|
25014
|
+
columnAutoWidth += tickIconWidth;
|
|
25015
|
+
}
|
|
25016
|
+
columnAutoWidth = Math.min(ITEM_MAX_WIDTH, Math.max(columnAutoWidth, dynamicItemMinWidth));
|
|
25022
25017
|
let overflowStyling;
|
|
25023
25018
|
let columnCount;
|
|
25024
25019
|
let columnWidth;
|
|
@@ -25592,7 +25587,7 @@
|
|
|
25592
25587
|
});
|
|
25593
25588
|
if (itemsLoader.pages.length && !awaitingFrequencyMax) {
|
|
25594
25589
|
// All necessary data fetching done - signal rendering done!
|
|
25595
|
-
renderedCallback();
|
|
25590
|
+
renderedCallback === null || renderedCallback === void 0 ? void 0 : renderedCallback();
|
|
25596
25591
|
}
|
|
25597
25592
|
}
|
|
25598
25593
|
const isItemLoaded = reactExports.useCallback(index => {
|
|
@@ -25982,7 +25977,8 @@
|
|
|
25982
25977
|
size: "large",
|
|
25983
25978
|
disableRipple: true,
|
|
25984
25979
|
"aria-expanded": ariaExpanded,
|
|
25985
|
-
"aria-controls": "moreMenuList"
|
|
25980
|
+
"aria-controls": "moreMenuList",
|
|
25981
|
+
"data-testid": "actions-toolbar-".concat(item.key)
|
|
25986
25982
|
}, hasSvgIconShape && SvgIcon(item.getSvgIconShape()), addAnchor && /*#__PURE__*/React.createElement("div", {
|
|
25987
25983
|
ref: ref,
|
|
25988
25984
|
style: {
|
|
@@ -28493,6 +28489,23 @@
|
|
|
28493
28489
|
};
|
|
28494
28490
|
}
|
|
28495
28491
|
|
|
28492
|
+
function ListBoxError(_ref) {
|
|
28493
|
+
let {
|
|
28494
|
+
text
|
|
28495
|
+
} = _ref;
|
|
28496
|
+
const {
|
|
28497
|
+
translator
|
|
28498
|
+
} = reactExports.useContext(InstanceContext);
|
|
28499
|
+
const StyledDiv = styled$1('div')(() => ({
|
|
28500
|
+
display: 'flex',
|
|
28501
|
+
width: '100%',
|
|
28502
|
+
height: '100%',
|
|
28503
|
+
alignItems: 'center',
|
|
28504
|
+
justifyContent: 'center'
|
|
28505
|
+
}));
|
|
28506
|
+
return /*#__PURE__*/React.createElement(StyledDiv, null, translator.get(text));
|
|
28507
|
+
}
|
|
28508
|
+
|
|
28496
28509
|
const PREFIX$4 = 'ListBoxInline';
|
|
28497
28510
|
const classes$4 = {
|
|
28498
28511
|
listBoxHeader: "".concat(PREFIX$4, "-listBoxHeader"),
|
|
@@ -28567,9 +28580,7 @@
|
|
|
28567
28580
|
calculatePagesHeight,
|
|
28568
28581
|
showGray = true,
|
|
28569
28582
|
scrollState = undefined,
|
|
28570
|
-
renderedCallback
|
|
28571
|
-
} = options;
|
|
28572
|
-
let {
|
|
28583
|
+
renderedCallback,
|
|
28573
28584
|
toolbar = true
|
|
28574
28585
|
} = options;
|
|
28575
28586
|
|
|
@@ -28614,6 +28625,8 @@
|
|
|
28614
28625
|
const [appSelections] = useAppSelections(app);
|
|
28615
28626
|
const titleRef = reactExports.useRef(null);
|
|
28616
28627
|
const [selectionState$1] = reactExports.useState(() => selectionState());
|
|
28628
|
+
const isInvalid = layout === null || layout === void 0 ? void 0 : layout.qListObject.qDimensionInfo.qError;
|
|
28629
|
+
const errorText = isInvalid && constraints.active ? 'Visualization.Invalid.Dimension' : 'Visualization.Incomplete';
|
|
28617
28630
|
const {
|
|
28618
28631
|
handleKeyDown,
|
|
28619
28632
|
handleOnMouseEnter,
|
|
@@ -28636,11 +28649,8 @@
|
|
|
28636
28649
|
// this will be static until we can access the useKeyboard hook
|
|
28637
28650
|
active: keyboardActive
|
|
28638
28651
|
};
|
|
28639
|
-
|
|
28640
|
-
|
|
28641
|
-
}
|
|
28642
|
-
const toolbarDetachedOnly = toolbar && (layout === null || layout === void 0 ? void 0 : layout.title) === '';
|
|
28643
|
-
toolbar = toolbar && (layout === null || layout === void 0 ? void 0 : layout.title) !== '';
|
|
28652
|
+
const showDetachedToolbarOnly = toolbar && ((layout === null || layout === void 0 ? void 0 : layout.title) === '' || (layout === null || layout === void 0 ? void 0 : layout.showTitle) === false);
|
|
28653
|
+
const showToolbarWithTitle = toolbar && (layout === null || layout === void 0 ? void 0 : layout.title) !== '' && (layout === null || layout === void 0 ? void 0 : layout.showTitle) !== false;
|
|
28644
28654
|
reactExports.useEffect(() => {
|
|
28645
28655
|
const show = () => {
|
|
28646
28656
|
setShowToolbar(true);
|
|
@@ -28664,7 +28674,7 @@
|
|
|
28664
28674
|
selections.removeListener('deactivated', hide);
|
|
28665
28675
|
}
|
|
28666
28676
|
};
|
|
28667
|
-
}, [selections
|
|
28677
|
+
}, [selections]);
|
|
28668
28678
|
reactExports.useEffect(() => {
|
|
28669
28679
|
if (!searchContainer || !searchContainer.current) {
|
|
28670
28680
|
return;
|
|
@@ -28698,7 +28708,7 @@
|
|
|
28698
28708
|
const searchHeight = dense ? 27 : 40;
|
|
28699
28709
|
const extraheight = dense ? 39 : 49;
|
|
28700
28710
|
const searchAddHeight = searchVisible ? searchHeight : 0;
|
|
28701
|
-
const minHeight =
|
|
28711
|
+
const minHeight = showToolbarWithTitle ? 49 + searchAddHeight + extraheight : 0;
|
|
28702
28712
|
const headerHeight = 32;
|
|
28703
28713
|
const onShowSearch = () => {
|
|
28704
28714
|
const newValue = !showSearch;
|
|
@@ -28721,7 +28731,7 @@
|
|
|
28721
28731
|
selections
|
|
28722
28732
|
});
|
|
28723
28733
|
const shouldAutoFocus = searchVisible && search === 'toggle';
|
|
28724
|
-
const showSearchIcon = searchEnabled !== false && search === 'toggle'
|
|
28734
|
+
const showSearchIcon = searchEnabled !== false && search === 'toggle';
|
|
28725
28735
|
const showSearchOrLockIcon = isLocked || showSearchIcon;
|
|
28726
28736
|
const showIcons = showSearchOrLockIcon || isDrillDown;
|
|
28727
28737
|
const iconsWidth = (showSearchOrLockIcon ? BUTTON_ICON_WIDTH : 0) + (isDrillDown ? ICON_WIDTH + ICON_PADDING : 0); // Drill-down icon needs padding right so there is space between the icon and the title
|
|
@@ -28734,7 +28744,43 @@
|
|
|
28734
28744
|
if (isGridMode) {
|
|
28735
28745
|
containerPadding = layoutOptions.layoutOrder === 'row' ? '2px 4px' : '2px 6px 2px 4px';
|
|
28736
28746
|
}
|
|
28737
|
-
|
|
28747
|
+
const searchIconComp = constraints !== null && constraints !== void 0 && constraints.active ? /*#__PURE__*/React.createElement(SearchIcon, {
|
|
28748
|
+
title: translator.get('Listbox.Search'),
|
|
28749
|
+
size: "large",
|
|
28750
|
+
style: {
|
|
28751
|
+
fontSize: '12px',
|
|
28752
|
+
padding: '7px'
|
|
28753
|
+
}
|
|
28754
|
+
}) : /*#__PURE__*/React.createElement(IconButton$1, {
|
|
28755
|
+
onClick: onShowSearch,
|
|
28756
|
+
tabIndex: -1,
|
|
28757
|
+
title: translator.get('Listbox.Search'),
|
|
28758
|
+
size: "large",
|
|
28759
|
+
disableRipple: true,
|
|
28760
|
+
"data-testid": "search-toggle-btn"
|
|
28761
|
+
}, /*#__PURE__*/React.createElement(SearchIcon, {
|
|
28762
|
+
style: {
|
|
28763
|
+
fontSize: '12px'
|
|
28764
|
+
}
|
|
28765
|
+
}));
|
|
28766
|
+
const lockIconComp = selectDisabled() ? /*#__PURE__*/React.createElement(Lock, {
|
|
28767
|
+
size: "large",
|
|
28768
|
+
style: {
|
|
28769
|
+
fontSize: '12px',
|
|
28770
|
+
padding: '7px'
|
|
28771
|
+
}
|
|
28772
|
+
}) : /*#__PURE__*/React.createElement(IconButton$1, {
|
|
28773
|
+
title: translator.get('SelectionToolbar.ClickToUnlock'),
|
|
28774
|
+
tabIndex: -1,
|
|
28775
|
+
onClick: unlock,
|
|
28776
|
+
size: "large"
|
|
28777
|
+
}, /*#__PURE__*/React.createElement(Lock, {
|
|
28778
|
+
disableRipple: true,
|
|
28779
|
+
style: {
|
|
28780
|
+
fontSize: '12px'
|
|
28781
|
+
}
|
|
28782
|
+
}));
|
|
28783
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, showDetachedToolbarOnly && /*#__PURE__*/React.createElement(ActionsToolbar, _extends$8({
|
|
28738
28784
|
direction: direction
|
|
28739
28785
|
}, getActionToolbarProps(true))), /*#__PURE__*/React.createElement(StyledGrid$3, {
|
|
28740
28786
|
className: "listbox-container",
|
|
@@ -28753,7 +28799,7 @@
|
|
|
28753
28799
|
onMouseLeave: handleOnMouseLeave,
|
|
28754
28800
|
ref: containerRef,
|
|
28755
28801
|
hasIcon: showIcons
|
|
28756
|
-
},
|
|
28802
|
+
}, showToolbarWithTitle && /*#__PURE__*/React.createElement(Grid$1, {
|
|
28757
28803
|
item: true,
|
|
28758
28804
|
container: true,
|
|
28759
28805
|
style: {
|
|
@@ -28780,29 +28826,7 @@
|
|
|
28780
28826
|
alignItems: 'center',
|
|
28781
28827
|
width: iconsWidth
|
|
28782
28828
|
}
|
|
28783
|
-
}, isLocked ? /*#__PURE__*/React.createElement(
|
|
28784
|
-
title: translator.get('SelectionToolbar.ClickToUnlock'),
|
|
28785
|
-
tabIndex: -1,
|
|
28786
|
-
onClick: unlock,
|
|
28787
|
-
disabled: selectDisabled(),
|
|
28788
|
-
size: "large"
|
|
28789
|
-
}, /*#__PURE__*/React.createElement(Lock, {
|
|
28790
|
-
disableRipple: true,
|
|
28791
|
-
style: {
|
|
28792
|
-
fontSize: '12px'
|
|
28793
|
-
}
|
|
28794
|
-
})) : showSearchIcon && /*#__PURE__*/React.createElement(IconButton$1, {
|
|
28795
|
-
onClick: onShowSearch,
|
|
28796
|
-
tabIndex: -1,
|
|
28797
|
-
title: translator.get('Listbox.Search'),
|
|
28798
|
-
size: "large",
|
|
28799
|
-
disableRipple: true,
|
|
28800
|
-
"data-testid": "search-toggle-btn"
|
|
28801
|
-
}, /*#__PURE__*/React.createElement(SearchIcon, {
|
|
28802
|
-
style: {
|
|
28803
|
-
fontSize: '12px'
|
|
28804
|
-
}
|
|
28805
|
-
})), isDrillDown && /*#__PURE__*/React.createElement(DrillDownIcon, {
|
|
28829
|
+
}, isLocked ? lockIconComp : showSearchIcon && searchIconComp, isDrillDown && /*#__PURE__*/React.createElement(DrillDownIcon, {
|
|
28806
28830
|
tabIndex: -1,
|
|
28807
28831
|
title: translator.get('Listbox.DrillDown'),
|
|
28808
28832
|
size: "large",
|
|
@@ -28865,7 +28889,9 @@
|
|
|
28865
28889
|
className: classes$4.listboxWrapper
|
|
28866
28890
|
}, /*#__PURE__*/React.createElement("div", {
|
|
28867
28891
|
className: classes$4.screenReaderOnly
|
|
28868
|
-
}, translator.get('Listbox.ScreenReaderInstructions')), /*#__PURE__*/React.createElement(
|
|
28892
|
+
}, translator.get('Listbox.ScreenReaderInstructions')), isInvalid ? /*#__PURE__*/React.createElement(ListBoxError, {
|
|
28893
|
+
text: errorText
|
|
28894
|
+
}) : /*#__PURE__*/React.createElement(AutoSizer, null, _ref4 => {
|
|
28869
28895
|
let {
|
|
28870
28896
|
height,
|
|
28871
28897
|
width
|
|
@@ -29314,7 +29340,7 @@
|
|
|
29314
29340
|
array.splice(removeIdx, 1);
|
|
29315
29341
|
return removeIdx;
|
|
29316
29342
|
}
|
|
29317
|
-
const nxDimension = f => ({
|
|
29343
|
+
const nxDimension$1 = f => ({
|
|
29318
29344
|
qDef: {
|
|
29319
29345
|
qFieldDefs: [f]
|
|
29320
29346
|
}
|
|
@@ -29345,7 +29371,7 @@
|
|
|
29345
29371
|
return hc.qMeasures;
|
|
29346
29372
|
},
|
|
29347
29373
|
addDimension(d) {
|
|
29348
|
-
const dimension = typeof d === 'string' ? nxDimension(d) : _objectSpread2(_objectSpread2({}, d), {}, {
|
|
29374
|
+
const dimension = typeof d === 'string' ? nxDimension$1(d) : _objectSpread2(_objectSpread2({}, d), {}, {
|
|
29349
29375
|
qDef: d.qDef || {}
|
|
29350
29376
|
});
|
|
29351
29377
|
dimension.qDef.cId = dimension.qDef.cId || uid();
|
|
@@ -29428,6 +29454,69 @@
|
|
|
29428
29454
|
return handler;
|
|
29429
29455
|
}
|
|
29430
29456
|
|
|
29457
|
+
const nxDimension = f => ({
|
|
29458
|
+
qDef: {
|
|
29459
|
+
qFieldDefs: [f]
|
|
29460
|
+
}
|
|
29461
|
+
});
|
|
29462
|
+
function loHandler(_ref) {
|
|
29463
|
+
let {
|
|
29464
|
+
dc: lo,
|
|
29465
|
+
def,
|
|
29466
|
+
properties
|
|
29467
|
+
} = _ref;
|
|
29468
|
+
lo.qInitialDataFetch = lo.qInitialDataFetch || [];
|
|
29469
|
+
const objectProperties = properties;
|
|
29470
|
+
const handler = {
|
|
29471
|
+
dimensions() {
|
|
29472
|
+
if (!lo.qLibraryId && (!lo.qDef || !lo.qDef.qFieldDefs || lo.qDef.qFieldDefs.length === 0)) return [];
|
|
29473
|
+
return [lo];
|
|
29474
|
+
},
|
|
29475
|
+
measures() {
|
|
29476
|
+
return [];
|
|
29477
|
+
},
|
|
29478
|
+
addDimension(d) {
|
|
29479
|
+
const dimension = typeof d === 'string' ? nxDimension(d) : _objectSpread2(_objectSpread2({}, d), {}, {
|
|
29480
|
+
qDef: d.qDef || {}
|
|
29481
|
+
});
|
|
29482
|
+
dimension.qDef.cId = dimension.qDef.cId || uid();
|
|
29483
|
+
dimension.qDef.qSortCriterias = lo.qDef.qSortCriterias || [{
|
|
29484
|
+
qSortByState: 1,
|
|
29485
|
+
qSortByLoadOrder: 1,
|
|
29486
|
+
qSortByNumeric: 1,
|
|
29487
|
+
qSortByAscii: 1
|
|
29488
|
+
}];
|
|
29489
|
+
Object.keys(dimension).forEach(k => {
|
|
29490
|
+
lo[k] = dimension[k];
|
|
29491
|
+
});
|
|
29492
|
+
def.dimensions.added(dimension, objectProperties);
|
|
29493
|
+
return dimension;
|
|
29494
|
+
},
|
|
29495
|
+
removeDimension(idx) {
|
|
29496
|
+
const dimension = lo;
|
|
29497
|
+
delete lo.qDef;
|
|
29498
|
+
delete lo.qLibraryId;
|
|
29499
|
+
def.dimensions.removed(dimension, objectProperties, idx);
|
|
29500
|
+
return dimension;
|
|
29501
|
+
},
|
|
29502
|
+
addMeasure() {},
|
|
29503
|
+
removeMeasure() {},
|
|
29504
|
+
maxDimensions() {
|
|
29505
|
+
return 1;
|
|
29506
|
+
},
|
|
29507
|
+
maxMeasures() {
|
|
29508
|
+
return 0;
|
|
29509
|
+
},
|
|
29510
|
+
canAddDimension() {
|
|
29511
|
+
return handler.dimensions().length === 0;
|
|
29512
|
+
},
|
|
29513
|
+
canAddMeasure() {
|
|
29514
|
+
return false;
|
|
29515
|
+
}
|
|
29516
|
+
};
|
|
29517
|
+
return handler;
|
|
29518
|
+
}
|
|
29519
|
+
|
|
29431
29520
|
/**
|
|
29432
29521
|
* @interface LibraryField
|
|
29433
29522
|
* @property {string} qLibraryId
|
|
@@ -29472,7 +29561,8 @@
|
|
|
29472
29561
|
const s = parts[i];
|
|
29473
29562
|
p = s ? p[s] : p;
|
|
29474
29563
|
}
|
|
29475
|
-
const
|
|
29564
|
+
const createHandler = propertyPath.match('/qListObjectDef') ? loHandler : hcHandler;
|
|
29565
|
+
const handler = createHandler({
|
|
29476
29566
|
dc: p,
|
|
29477
29567
|
def: target,
|
|
29478
29568
|
properties
|
|
@@ -29480,9 +29570,9 @@
|
|
|
29480
29570
|
fields.forEach(f => {
|
|
29481
29571
|
const type = fieldType(f);
|
|
29482
29572
|
if (type === 'measure') {
|
|
29483
|
-
|
|
29573
|
+
handler.addMeasure(f);
|
|
29484
29574
|
} else {
|
|
29485
|
-
|
|
29575
|
+
handler.addDimension(f);
|
|
29486
29576
|
}
|
|
29487
29577
|
});
|
|
29488
29578
|
}
|
|
@@ -30713,7 +30803,8 @@
|
|
|
30713
30803
|
sn,
|
|
30714
30804
|
anchorEl,
|
|
30715
30805
|
hovering,
|
|
30716
|
-
focusHandler
|
|
30806
|
+
focusHandler,
|
|
30807
|
+
titleStyles = {}
|
|
30717
30808
|
} = _ref2;
|
|
30718
30809
|
const showTitle = layout.showTitles && !!layout.title;
|
|
30719
30810
|
const showSubtitle = layout.showTitles && !!layout.subtitle;
|
|
@@ -30771,11 +30862,13 @@
|
|
|
30771
30862
|
}, showTitle && /*#__PURE__*/React.createElement(Typography$1, {
|
|
30772
30863
|
variant: "h6",
|
|
30773
30864
|
noWrap: true,
|
|
30774
|
-
className: CellTitle.className
|
|
30865
|
+
className: CellTitle.className,
|
|
30866
|
+
style: titleStyles.main
|
|
30775
30867
|
}, layout.title), showSubtitle && /*#__PURE__*/React.createElement(Typography$1, {
|
|
30776
30868
|
variant: "body2",
|
|
30777
30869
|
noWrap: true,
|
|
30778
|
-
className: CellSubTitle.className
|
|
30870
|
+
className: CellSubTitle.className,
|
|
30871
|
+
style: titleStyles.subTitle
|
|
30779
30872
|
}, layout.subtitle))), /*#__PURE__*/React.createElement(Grid$1, {
|
|
30780
30873
|
item: true
|
|
30781
30874
|
}, Toolbar));
|
|
@@ -30808,7 +30901,8 @@
|
|
|
30808
30901
|
};
|
|
30809
30902
|
function Footer(_ref2) {
|
|
30810
30903
|
let {
|
|
30811
|
-
layout
|
|
30904
|
+
layout,
|
|
30905
|
+
titleStyles = {}
|
|
30812
30906
|
} = _ref2;
|
|
30813
30907
|
return layout && layout.showTitles && layout.footnote ? /*#__PURE__*/React.createElement(StyledGrid, {
|
|
30814
30908
|
container: true
|
|
@@ -30818,7 +30912,8 @@
|
|
|
30818
30912
|
}, /*#__PURE__*/React.createElement(Typography$1, {
|
|
30819
30913
|
noWrap: true,
|
|
30820
30914
|
variant: "body2",
|
|
30821
|
-
className: CellFooter.className
|
|
30915
|
+
className: CellFooter.className,
|
|
30916
|
+
style: titleStyles.footer
|
|
30822
30917
|
}, layout.footnote))) : null;
|
|
30823
30918
|
}
|
|
30824
30919
|
|
|
@@ -31048,7 +31143,7 @@
|
|
|
31048
31143
|
function resolveImageUrl(app, relativeUrl) {
|
|
31049
31144
|
return relativeUrl ? getSenseServerUrl(app) + relativeUrl : undefined;
|
|
31050
31145
|
}
|
|
31051
|
-
|
|
31146
|
+
function resolveBgImage(bgComp, app) {
|
|
31052
31147
|
const bgImageDef = bgComp === null || bgComp === void 0 ? void 0 : bgComp.bgImage;
|
|
31053
31148
|
if (bgImageDef) {
|
|
31054
31149
|
let url = '';
|
|
@@ -31069,8 +31164,8 @@
|
|
|
31069
31164
|
} : undefined;
|
|
31070
31165
|
}
|
|
31071
31166
|
return undefined;
|
|
31072
|
-
}
|
|
31073
|
-
|
|
31167
|
+
}
|
|
31168
|
+
function resolveBgColor(bgComp, theme, objectType) {
|
|
31074
31169
|
const bgColor = bgComp === null || bgComp === void 0 ? void 0 : bgComp.bgColor;
|
|
31075
31170
|
if (bgColor && theme) {
|
|
31076
31171
|
if (bgColor.useExpression) {
|
|
@@ -31078,8 +31173,32 @@
|
|
|
31078
31173
|
}
|
|
31079
31174
|
return bgColor.color && bgColor.color.color !== 'none' ? theme.getColorPickerColor(bgColor.color, true) : undefined;
|
|
31080
31175
|
}
|
|
31176
|
+
if (theme && objectType) {
|
|
31177
|
+
return theme.getStyle("object.".concat(objectType), '', 'backgroundColor');
|
|
31178
|
+
}
|
|
31179
|
+
if (theme) {
|
|
31180
|
+
return theme.getStyle('', '', 'backgroundColor');
|
|
31181
|
+
}
|
|
31081
31182
|
return undefined;
|
|
31082
|
-
}
|
|
31183
|
+
}
|
|
31184
|
+
function unfurlFontStyle(fontStyle, target) {
|
|
31185
|
+
if (fontStyle && Array.isArray(fontStyle)) {
|
|
31186
|
+
return fontStyle;
|
|
31187
|
+
}
|
|
31188
|
+
return target === 'main' ? ['bold'] : [];
|
|
31189
|
+
}
|
|
31190
|
+
function resolveTextStyle(textComp, target, theme, objectType) {
|
|
31191
|
+
var _textComp$title;
|
|
31192
|
+
const textProps = (textComp === null || textComp === void 0 ? void 0 : (_textComp$title = textComp.title) === null || _textComp$title === void 0 ? void 0 : _textComp$title[target]) || {};
|
|
31193
|
+
const fontStyle = unfurlFontStyle(textProps.fontStyle, target);
|
|
31194
|
+
return {
|
|
31195
|
+
fontFamily: textProps.fontFamily || theme.getStyle("object.".concat(objectType), "title.".concat(target), 'fontFamily'),
|
|
31196
|
+
color: textProps.color && textProps.color.color !== 'none' ? theme.getColorPickerColor(textProps.color, true) : theme.getStyle("object.".concat(objectType), target, 'color'),
|
|
31197
|
+
fontWeight: fontStyle.includes('bold') ? 'bold' : 'normal',
|
|
31198
|
+
fontStyle: fontStyle.includes('italic') ? 'italic' : 'normal',
|
|
31199
|
+
textDecoration: fontStyle.includes('underline') ? 'underline' : 'initial'
|
|
31200
|
+
};
|
|
31201
|
+
}
|
|
31083
31202
|
|
|
31084
31203
|
/**
|
|
31085
31204
|
* @interface
|
|
@@ -31321,7 +31440,8 @@
|
|
|
31321
31440
|
app,
|
|
31322
31441
|
selections,
|
|
31323
31442
|
nebbie,
|
|
31324
|
-
focusHandler
|
|
31443
|
+
focusHandler,
|
|
31444
|
+
emitter
|
|
31325
31445
|
} = _ref5;
|
|
31326
31446
|
try {
|
|
31327
31447
|
const snType = await getType({
|
|
@@ -31334,16 +31454,26 @@
|
|
|
31334
31454
|
app,
|
|
31335
31455
|
selections,
|
|
31336
31456
|
nebbie,
|
|
31337
|
-
focusHandler
|
|
31457
|
+
focusHandler,
|
|
31458
|
+
emitter
|
|
31338
31459
|
});
|
|
31339
31460
|
return sn;
|
|
31340
31461
|
} catch (err) {
|
|
31341
|
-
|
|
31342
|
-
|
|
31343
|
-
|
|
31344
|
-
|
|
31345
|
-
|
|
31346
|
-
|
|
31462
|
+
if (!version) {
|
|
31463
|
+
dispatch({
|
|
31464
|
+
type: 'ERROR',
|
|
31465
|
+
error: {
|
|
31466
|
+
title: "Could not find a version of '".concat(visualization, "' that supports current object version. Did you forget to register ").concat(visualization, "?")
|
|
31467
|
+
}
|
|
31468
|
+
});
|
|
31469
|
+
} else {
|
|
31470
|
+
dispatch({
|
|
31471
|
+
type: 'ERROR',
|
|
31472
|
+
error: {
|
|
31473
|
+
title: err.message
|
|
31474
|
+
}
|
|
31475
|
+
});
|
|
31476
|
+
}
|
|
31347
31477
|
}
|
|
31348
31478
|
return undefined;
|
|
31349
31479
|
};
|
|
@@ -31355,7 +31485,8 @@
|
|
|
31355
31485
|
initialSnPlugins,
|
|
31356
31486
|
initialError,
|
|
31357
31487
|
onMount,
|
|
31358
|
-
currentId
|
|
31488
|
+
currentId,
|
|
31489
|
+
emitter
|
|
31359
31490
|
} = _ref6;
|
|
31360
31491
|
const {
|
|
31361
31492
|
app,
|
|
@@ -31394,7 +31525,7 @@
|
|
|
31394
31525
|
});
|
|
31395
31526
|
const [bgColor, setBgColor] = reactExports.useState(undefined);
|
|
31396
31527
|
const [bgImage, setBgImage] = reactExports.useState(undefined); // {url: "", size: "", pos: ""}
|
|
31397
|
-
|
|
31528
|
+
const [titleStyles, setTitleStyles] = reactExports.useState(undefined);
|
|
31398
31529
|
const focusHandler = reactExports.useRef({
|
|
31399
31530
|
focusToolbarButton(last) {
|
|
31400
31531
|
// eslint-disable-next-line react/no-this-in-sfc
|
|
@@ -31405,9 +31536,16 @@
|
|
|
31405
31536
|
eventmixin(focusHandler.current);
|
|
31406
31537
|
}, []);
|
|
31407
31538
|
reactExports.useEffect(() => {
|
|
31408
|
-
|
|
31409
|
-
|
|
31410
|
-
|
|
31539
|
+
if (layout && halo.public.theme) {
|
|
31540
|
+
const bgComp = layout.components ? layout.components.find(comp => comp.key === 'general') : null;
|
|
31541
|
+
setTitleStyles({
|
|
31542
|
+
main: resolveTextStyle(bgComp, 'main', halo.public.theme, layout.visualization),
|
|
31543
|
+
footer: resolveTextStyle(bgComp, 'footer', halo.public.theme, layout.visualization),
|
|
31544
|
+
subTitle: resolveTextStyle(bgComp, 'subTitle', halo.public.theme, layout.visualization)
|
|
31545
|
+
});
|
|
31546
|
+
setBgColor(resolveBgColor(bgComp, halo.public.theme, layout.visualization));
|
|
31547
|
+
setBgImage(resolveBgImage(bgComp, halo.app));
|
|
31548
|
+
}
|
|
31411
31549
|
}, [layout, halo.public.theme, halo.app, themeName]);
|
|
31412
31550
|
focusHandler.current.blurCallback = resetFocus => {
|
|
31413
31551
|
halo.root.toggleFocusOfCells();
|
|
@@ -31479,7 +31617,8 @@
|
|
|
31479
31617
|
app,
|
|
31480
31618
|
selections,
|
|
31481
31619
|
nebbie,
|
|
31482
|
-
focusHandler: focusHandler.current
|
|
31620
|
+
focusHandler: focusHandler.current,
|
|
31621
|
+
emitter
|
|
31483
31622
|
});
|
|
31484
31623
|
if (sn) {
|
|
31485
31624
|
dispatch({
|
|
@@ -31500,15 +31639,6 @@
|
|
|
31500
31639
|
|
|
31501
31640
|
// Load supernova
|
|
31502
31641
|
const withVersion = types.getSupportedVersion(layout.visualization, layout.version);
|
|
31503
|
-
if (!withVersion) {
|
|
31504
|
-
dispatch({
|
|
31505
|
-
type: 'ERROR',
|
|
31506
|
-
error: {
|
|
31507
|
-
title: "Could not find a version of '".concat(layout.visualization, "' that supports current object version. Did you forget to register ").concat(layout.visualization, "?")
|
|
31508
|
-
}
|
|
31509
|
-
});
|
|
31510
|
-
return undefined;
|
|
31511
|
-
}
|
|
31512
31642
|
load(layout.visualization, withVersion);
|
|
31513
31643
|
return () => {};
|
|
31514
31644
|
}, [types, state.sn, model, selections, layout, appLayout, language]);
|
|
@@ -31630,7 +31760,8 @@
|
|
|
31630
31760
|
sn: state.sn,
|
|
31631
31761
|
anchorEl: cellNode,
|
|
31632
31762
|
hovering: hovering,
|
|
31633
|
-
focusHandler: focusHandler.current
|
|
31763
|
+
focusHandler: focusHandler.current,
|
|
31764
|
+
titleStyles: titleStyles
|
|
31634
31765
|
}, "\xA0"), /*#__PURE__*/React.createElement(Grid$1, {
|
|
31635
31766
|
tabIndex: keyboardNavigation ? 0 : -1,
|
|
31636
31767
|
onKeyDown: keyboardNavigation ? handleKeyDown : null,
|
|
@@ -31641,7 +31772,8 @@
|
|
|
31641
31772
|
},
|
|
31642
31773
|
ref: contentRef
|
|
31643
31774
|
}, Content), /*#__PURE__*/React.createElement(Footer, {
|
|
31644
|
-
layout: layout
|
|
31775
|
+
layout: layout,
|
|
31776
|
+
titleStyles: titleStyles
|
|
31645
31777
|
})), state.longRunningQuery && /*#__PURE__*/React.createElement(LongRunningQuery, {
|
|
31646
31778
|
canCancel: canCancel,
|
|
31647
31779
|
canRetry: canRetry,
|
|
@@ -31657,6 +31789,7 @@
|
|
|
31657
31789
|
initialSnOptions,
|
|
31658
31790
|
initialSnPlugins,
|
|
31659
31791
|
onMount,
|
|
31792
|
+
emitter,
|
|
31660
31793
|
initialError
|
|
31661
31794
|
} = _ref;
|
|
31662
31795
|
const {
|
|
@@ -31672,7 +31805,8 @@
|
|
|
31672
31805
|
initialSnOptions: initialSnOptions,
|
|
31673
31806
|
initialSnPlugins: initialSnPlugins,
|
|
31674
31807
|
initialError: initialError,
|
|
31675
|
-
onMount: onMount
|
|
31808
|
+
onMount: onMount,
|
|
31809
|
+
emitter: emitter
|
|
31676
31810
|
}), element, currentId);
|
|
31677
31811
|
const unmount = () => {
|
|
31678
31812
|
root.remove(portal);
|
|
@@ -31772,6 +31906,7 @@
|
|
|
31772
31906
|
});
|
|
31773
31907
|
let initialSnOptions = {};
|
|
31774
31908
|
let initialSnPlugins = [];
|
|
31909
|
+
const emitter = new nodeEventEmitter();
|
|
31775
31910
|
const setSnOptions = async opts => {
|
|
31776
31911
|
if (mountedReference) {
|
|
31777
31912
|
(async () => {
|
|
@@ -31862,6 +31997,24 @@
|
|
|
31862
31997
|
}
|
|
31863
31998
|
return propertyTree;
|
|
31864
31999
|
},
|
|
32000
|
+
/**
|
|
32001
|
+
* Listens to custom events from inside the visualization. See useEmitter
|
|
32002
|
+
* @experimental
|
|
32003
|
+
* @param {string} eventName Event name to listen to
|
|
32004
|
+
* @param {Function} listener Callback function to invoke
|
|
32005
|
+
*/
|
|
32006
|
+
on(eventName, listener) {
|
|
32007
|
+
emitter.on(eventName, listener);
|
|
32008
|
+
},
|
|
32009
|
+
/**
|
|
32010
|
+
* Removes a listener
|
|
32011
|
+
* @experimental
|
|
32012
|
+
* @param {string} eventName Event name to remove from
|
|
32013
|
+
* @param {Function} listener Callback function to remove
|
|
32014
|
+
*/
|
|
32015
|
+
off(eventName, listener) {
|
|
32016
|
+
emitter.off(eventName, listener);
|
|
32017
|
+
},
|
|
31865
32018
|
// ===== unexposed experimental API - use at own risk ======
|
|
31866
32019
|
__DO_NOT_USE__: {
|
|
31867
32020
|
mount(element) {
|
|
@@ -31876,7 +32029,8 @@
|
|
|
31876
32029
|
initialSnOptions,
|
|
31877
32030
|
initialSnPlugins,
|
|
31878
32031
|
initialError,
|
|
31879
|
-
onMount
|
|
32032
|
+
onMount,
|
|
32033
|
+
emitter
|
|
31880
32034
|
});
|
|
31881
32035
|
return mounted;
|
|
31882
32036
|
},
|
|
@@ -33823,7 +33977,7 @@
|
|
|
33823
33977
|
* @ignore
|
|
33824
33978
|
* @example
|
|
33825
33979
|
* import { onContextMenu } from '@nebula.js/stardust';
|
|
33826
|
-
|
|
33980
|
+
|
|
33827
33981
|
* onContextMenu((menu, event) => {
|
|
33828
33982
|
* menu.addItem(item, index);
|
|
33829
33983
|
* });
|
|
@@ -33877,6 +34031,32 @@
|
|
|
33877
34031
|
};
|
|
33878
34032
|
}
|
|
33879
34033
|
|
|
34034
|
+
/**
|
|
34035
|
+
* Gets an event emitter instance for the visualization.
|
|
34036
|
+
* @entry
|
|
34037
|
+
* @experimental
|
|
34038
|
+
* @returns {Emitter} The emitter instance.
|
|
34039
|
+
* @example
|
|
34040
|
+
* // In a Nebula visualization
|
|
34041
|
+
* import { useEmitter } from '@nebula.js/stardust';
|
|
34042
|
+
* useEffect(()=> {
|
|
34043
|
+
* // on some trigger
|
|
34044
|
+
* emitter.emit("trigger", params)
|
|
34045
|
+
* }, [...])
|
|
34046
|
+
*
|
|
34047
|
+
* // In a mashup
|
|
34048
|
+
* const viz = await n.render({
|
|
34049
|
+
* element: el,
|
|
34050
|
+
* id: 'abcdef'
|
|
34051
|
+
* });
|
|
34052
|
+
* viz.on("trigger", ()=> {
|
|
34053
|
+
* // do something
|
|
34054
|
+
* })
|
|
34055
|
+
*/
|
|
34056
|
+
function useEmitter() {
|
|
34057
|
+
return useInternalContext('emitter');
|
|
34058
|
+
}
|
|
34059
|
+
|
|
33880
34060
|
/**
|
|
33881
34061
|
* @experimental
|
|
33882
34062
|
* @interface Keyboard
|
|
@@ -34058,6 +34238,7 @@
|
|
|
34058
34238
|
nebbie: opts.nebbie,
|
|
34059
34239
|
element: undefined,
|
|
34060
34240
|
// set on mount
|
|
34241
|
+
emitter: opts.emitter,
|
|
34061
34242
|
// ---- singletons ----
|
|
34062
34243
|
deviceType: galaxy.deviceType,
|
|
34063
34244
|
theme: undefined,
|
|
@@ -37261,6 +37442,7 @@
|
|
|
37261
37442
|
exports.useEffect = useEffect;
|
|
37262
37443
|
exports.useElement = useElement;
|
|
37263
37444
|
exports.useEmbed = useEmbed;
|
|
37445
|
+
exports.useEmitter = useEmitter;
|
|
37264
37446
|
exports.useGlobal = useGlobal;
|
|
37265
37447
|
exports.useImperativeHandle = useImperativeHandle;
|
|
37266
37448
|
exports.useKeyboard = useKeyboard;
|