@nebula.js/stardust 4.0.0-alpha.5 → 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 +245 -143
- 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 +245 -142
- 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:
|
|
@@ -22390,15 +22395,10 @@
|
|
|
22390
22395
|
["& .".concat(rowColClasses.labelDense)]: {
|
|
22391
22396
|
fontSize: 12
|
|
22392
22397
|
},
|
|
22393
|
-
// 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,
|
|
22394
22399
|
// when a search string is matched.
|
|
22395
22400
|
["& .".concat(rowColClasses.highlighted)]: {
|
|
22396
|
-
|
|
22397
|
-
width: '100%',
|
|
22398
|
-
'& > span': {
|
|
22399
|
-
width: '100%',
|
|
22400
|
-
backgroundColor: '#FFC72A'
|
|
22401
|
-
}
|
|
22401
|
+
backgroundColor: '#FFC72A'
|
|
22402
22402
|
},
|
|
22403
22403
|
// Checkbox and label container.
|
|
22404
22404
|
["& .".concat(rowColClasses.checkboxLabel)]: {
|
|
@@ -22418,12 +22418,6 @@
|
|
|
22418
22418
|
paddingRight: '2px'
|
|
22419
22419
|
})
|
|
22420
22420
|
},
|
|
22421
|
-
["& .".concat(rowColClasses.checkboxLabel, " .").concat(rowColClasses.labelText)]: {
|
|
22422
|
-
width: 'auto'
|
|
22423
|
-
},
|
|
22424
|
-
["& .".concat(rowColClasses.checkboxLabel, " .").concat(rowColClasses.labelText, ".").concat(rowColClasses.highlighted)]: {
|
|
22425
|
-
width: 'auto'
|
|
22426
|
-
},
|
|
22427
22421
|
// The icons container holding tick and lock, shown inside fields.
|
|
22428
22422
|
["& .".concat(rowColClasses.icon)]: {
|
|
22429
22423
|
display: 'flex',
|
|
@@ -22658,7 +22652,6 @@
|
|
|
22658
22652
|
let {
|
|
22659
22653
|
label,
|
|
22660
22654
|
color,
|
|
22661
|
-
highlighted = false,
|
|
22662
22655
|
dense,
|
|
22663
22656
|
showGray = true,
|
|
22664
22657
|
checkboxes,
|
|
@@ -22668,14 +22661,14 @@
|
|
|
22668
22661
|
return /*#__PURE__*/React.createElement(Typography$1, {
|
|
22669
22662
|
component: "span",
|
|
22670
22663
|
variant: "body2",
|
|
22671
|
-
className: joinClassNames([rowColClasses.labelText,
|
|
22664
|
+
className: joinClassNames([rowColClasses.labelText, dense && rowColClasses.labelDense, showGray && excludedOrAlternative({
|
|
22672
22665
|
cell,
|
|
22673
22666
|
checkboxes
|
|
22674
22667
|
}) && rowColClasses.excludedTextWithCheckbox]),
|
|
22675
22668
|
color: color,
|
|
22676
|
-
align: valueTextAlign
|
|
22669
|
+
align: valueTextAlign,
|
|
22670
|
+
dir: "auto"
|
|
22677
22671
|
}, /*#__PURE__*/React.createElement("span", {
|
|
22678
|
-
dir: "auto",
|
|
22679
22672
|
style: {
|
|
22680
22673
|
whiteSpace: 'pre'
|
|
22681
22674
|
}
|
|
@@ -22686,7 +22679,6 @@
|
|
|
22686
22679
|
let {
|
|
22687
22680
|
label,
|
|
22688
22681
|
color,
|
|
22689
|
-
highlighted,
|
|
22690
22682
|
dense,
|
|
22691
22683
|
showGray,
|
|
22692
22684
|
checkboxes,
|
|
@@ -22697,7 +22689,6 @@
|
|
|
22697
22689
|
return /*#__PURE__*/React.createElement(ValueField, {
|
|
22698
22690
|
label: label,
|
|
22699
22691
|
color: color,
|
|
22700
|
-
highlighted: highlighted,
|
|
22701
22692
|
dense: dense,
|
|
22702
22693
|
showGray: showGray,
|
|
22703
22694
|
checkboxes: checkboxes,
|
|
@@ -22720,7 +22711,6 @@
|
|
|
22720
22711
|
isGridCol,
|
|
22721
22712
|
showGray,
|
|
22722
22713
|
isSingleSelect,
|
|
22723
|
-
highlighted,
|
|
22724
22714
|
checkboxes,
|
|
22725
22715
|
valueTextAlign
|
|
22726
22716
|
} = _ref;
|
|
@@ -22748,7 +22738,6 @@
|
|
|
22748
22738
|
label: /*#__PURE__*/React.createElement(LabelTag, {
|
|
22749
22739
|
label: label,
|
|
22750
22740
|
color: color,
|
|
22751
|
-
highlighted: highlighted,
|
|
22752
22741
|
dense: dense,
|
|
22753
22742
|
showGray: showGray,
|
|
22754
22743
|
checkboxes: checkboxes,
|
|
@@ -22764,23 +22753,21 @@
|
|
|
22764
22753
|
labels,
|
|
22765
22754
|
dense,
|
|
22766
22755
|
showGray,
|
|
22767
|
-
checkboxes
|
|
22768
|
-
textDirection
|
|
22756
|
+
checkboxes
|
|
22769
22757
|
} = _ref;
|
|
22770
|
-
|
|
22771
|
-
dir: textDirection
|
|
22772
|
-
}, labels.map((_ref2, index) => {
|
|
22758
|
+
const text = labels.map((_ref2, index) => {
|
|
22773
22759
|
let [label, highlighted] = _ref2;
|
|
22774
|
-
|
|
22775
|
-
|
|
22776
|
-
|
|
22777
|
-
|
|
22778
|
-
|
|
22779
|
-
|
|
22780
|
-
|
|
22781
|
-
|
|
22782
|
-
|
|
22783
|
-
|
|
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
|
+
});
|
|
22784
22771
|
}
|
|
22785
22772
|
function FieldWithRanges(_ref3) {
|
|
22786
22773
|
let {
|
|
@@ -22795,15 +22782,13 @@
|
|
|
22795
22782
|
cell,
|
|
22796
22783
|
isGridCol,
|
|
22797
22784
|
isSingleSelect,
|
|
22798
|
-
valueTextAlign
|
|
22799
|
-
textDirection
|
|
22785
|
+
valueTextAlign
|
|
22800
22786
|
} = _ref3;
|
|
22801
22787
|
const LWR = /*#__PURE__*/React.createElement(LabelsWithRanges, {
|
|
22802
22788
|
labels: labels,
|
|
22803
22789
|
dense: dense,
|
|
22804
22790
|
showGray: showGray,
|
|
22805
|
-
checkboxes: checkboxes
|
|
22806
|
-
textDirection: textDirection
|
|
22791
|
+
checkboxes: checkboxes
|
|
22807
22792
|
});
|
|
22808
22793
|
return checkboxes ? /*#__PURE__*/React.createElement(CheckboxField, {
|
|
22809
22794
|
onChange: onChange,
|
|
@@ -22833,7 +22818,6 @@
|
|
|
22833
22818
|
isGridCol,
|
|
22834
22819
|
showGray,
|
|
22835
22820
|
isSingleSelect,
|
|
22836
|
-
highlighted,
|
|
22837
22821
|
checkboxes,
|
|
22838
22822
|
valueTextAlign
|
|
22839
22823
|
} = _ref;
|
|
@@ -22848,13 +22832,11 @@
|
|
|
22848
22832
|
isGridCol: isGridCol,
|
|
22849
22833
|
showGray: showGray,
|
|
22850
22834
|
isSingleSelect: isSingleSelect,
|
|
22851
|
-
highlighted: highlighted,
|
|
22852
22835
|
checkboxes: checkboxes,
|
|
22853
22836
|
valueTextAlign: valueTextAlign
|
|
22854
22837
|
}) : /*#__PURE__*/React.createElement(ValueField, {
|
|
22855
22838
|
label: label,
|
|
22856
22839
|
color: color,
|
|
22857
|
-
highlighted: false,
|
|
22858
22840
|
dense: dense,
|
|
22859
22841
|
showGray: true,
|
|
22860
22842
|
checkboxes: checkboxes,
|
|
@@ -22983,55 +22965,6 @@
|
|
|
22983
22965
|
return c;
|
|
22984
22966
|
}
|
|
22985
22967
|
|
|
22986
|
-
// Source: https://en.wikipedia.org/wiki/Bi-directional_text and http://www.unicode.org/Public/6.0.0/ucd/UnicodeData.txt
|
|
22987
|
-
// 3 types of strong direction characters: L (strong left-to-right), R(strong right-to-left, Hebrew) and AL(strong right-to-left, Arabic language)
|
|
22988
|
-
const rangesOfLChars = '[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02B8\u02BB-\u02C1\u02D0-\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376-\u037D\u0386\u0388-\u03F5\u03F7-\u0482\u048A-\u0589\u0903-\u0939\u093B\u093D-\u0940\u0949-\u094C\u094E-\u0950\u0958-\u0961\u0964-\u097F\u0982-\u09B9\u09BD-\u09C0\u09C7-\u09CC\u09CE-\u09E1\u09E6-\u09F1\u09F4-\u09FA\u0A03-\u0A39\u0A3E-\u0A40\u0A59-\u0A6F\u0A72-\u0A74\u0A83-\u0AB9\u0ABD-\u0AC0\u0AC9-\u0ACC\u0AD0-\u0AE1\u0AE6-\u0AEF\u0B02-\u0B39\u0B3D-\u0B3E\u0B40\u0B47-\u0B4C\u0B57-\u0B61\u0B66-\u0B77\u0B83-\u0BBF\u0BC1-\u0BCC\u0BD0-\u0BF2\u0C01-\u0C3D\u0C41-\u0C44\u0C58-\u0C61\u0C66-\u0C6F\u0C7F-\u0CB9\u0CBD-\u0CCB\u0CD5-\u0CE1\u0CE6-\u0D40\u0D46-\u0D4C\u0D4E-\u0D61\u0D66-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0E30\u0E32-\u0E33\u0E40-\u0E46\u0E4F-\u0EB0\u0EB2-\u0EB3\u0EBD-\u0EC6\u0ED0-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3E-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C\u0FBE-\u0FC5\u0FC7-\u102C\u1031\u1038\u103B-\u103C\u103F-\u1057\u105A-\u105D\u1061-\u1070\u1075-\u1081\u1083-\u1084\u1087-\u108C\u108E-\u109C\u109E-\u135A\u1360-\u138F\u13A0-\u13F4\u1401-\u167F\u1681-\u169A\u16A0-\u1711\u1720-\u1731\u1735-\u1751\u1760-\u1770\u1780-\u17B6\u17BE-\u17C5\u17C7-\u17C8\u17D4-\u17DA\u17DC\u17E0-\u17E9\u1810-\u18A8\u18AA-\u191C\u1923-\u1926\u1929-\u1931\u1933-\u1938\u1946-\u19DA\u1A00-\u1A16\u1A19-\u1A55\u1A57\u1A61\u1A63-\u1A64\u1A6D-\u1A72\u1A80-\u1AAD\u1B04-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B6A\u1B74-\u1B7C\u1B82-\u1BA1\u1BA6-\u1BA7\u1BAA-\u1BE5\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2-\u1C2B\u1C34-\u1C35\u1C3B-\u1C7F\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1DBF\u1E00-\u1FBC\u1FBE\u1FC2-\u1FCC\u1FD0-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FFC\u200E\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E-\u214F\u2160-\u2188\u2336-\u237A\u2395\u249C-\u24E9\u26AC\u2800-\u28FF\u2C00-\u2CE4\u2CEB-\u2CEE\u2D00-\u2D70\u2D80-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u31BA\u31F0-\u321C\u3220-\u324F\u3260-\u327B\u327F-\u32B0\u32C0-\u32CB\u32D0-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DB5\u4E00-\uA48C\uA4D0-\uA60C\uA610-\uA66E\uA680-\uA6EF\uA6F2-\uA6F7\uA722-\uA787\uA789-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA824\uA827\uA830-\uA837\uA840-\uA873\uA880-\uA8C3\uA8CE-\uA8D9\uA8F2-\uA925\uA92E-\uA946\uA952-\uA97C\uA983-\uA9B2\uA9B4-\uA9B5\uA9BA-\uA9BB\uA9BD-\uAA28\uAA2F-\uAA30\uAA33-\uAA34\uAA40-\uAA42\uAA44-\uAA4B\uAA4D-\uAAAF\uAAB1\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2-\uABE4\uABE6-\uABE7\uABE9-\uABEC\uABF0-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFDC]';
|
|
22989
|
-
const rangesOfRChars = '[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u07C0-\u07EA\u07F4-\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB4F]';
|
|
22990
|
-
const rangesOfALChars = '[\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5-\u06E6\u06EE-\u06EF\u06FA-\u070D\u0710\u0712-\u072F\u074D-\u07A5\u07B1\uFB50-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]';
|
|
22991
|
-
const rangesOfNChars = '[\u0009-\u000D\u001C-\u0022\u0026-\u002A\u003B-\u0040\u005B-\u0060\u007B-\u007E\u0085\u00A1\u00A6-\u00A9\u00AB-\u00AC\u00AE-\u00AF\u00B4\u00B6-\u00B8\u00BB-\u00BF\u00D7\u00F7\u02B9-\u02BA\u02C2-\u02CF\u02D2-\u02DF\u02E5-\u02ED\u02EF-\u02FF\u0374-\u0375\u037E-\u0385\u0387\u03F6\u058A\u0606-\u0607\u060E-\u060F\u06DE\u06E9\u07F6-\u07F9\u0BF3-\u0BF8\u0BFA\u0C78-\u0C7E\u0F3A-\u0F3D\u1390-\u1399\u1400\u1680\u169B-\u169C\u17F0-\u180A\u180E\u1940-\u1945\u19DE-\u19FF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD-\u200A\u2010-\u2029\u2035-\u2043\u2045-\u205F\u207C-\u207E\u208C-\u208E\u2100-\u2101\u2103-\u2106\u2108-\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u213A-\u213B\u2140-\u2144\u214A-\u214D\u2150-\u215F\u2189-\u2211\u2214-\u2335\u237B-\u2394\u2396-\u2487\u24EA-\u26AB\u26AD-\u27FF\u2900-\u2B59\u2CE5-\u2CEA\u2CF9-\u2CFF\u2E00-\u3004\u3008-\u3020\u3030\u3036-\u3037\u303D-\u303F\u309B-\u309C\u30A0\u30FB\u31C0-\u31E3\u321D-\u321E\u3250-\u325F\u327C-\u327E\u32B1-\u32BF\u32CC-\u32CF\u3377-\u337A\u33DE-\u33DF\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA60D-\uA60F\uA673\uA67E-\uA67F\uA700-\uA721\uA788\uA828-\uA82B\uA874-\uA877\uFD3E-\uFD3F\uFDFD\uFE10-\uFE19\uFE30-\uFE4F\uFE51\uFE54\uFE56-\uFE5E\uFE60-\uFE61\uFE64-\uFE68\uFE6B\uFF01-\uFF02\uFF06-\uFF0A\uFF1B-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE2-\uFFE4\uFFE8-\uFFFD]';
|
|
22992
|
-
// eslint-disable-next-line no-misleading-character-class
|
|
22993
|
-
const rangesOfLRgExp = new RegExp(rangesOfLChars);
|
|
22994
|
-
const rangesOfRRgExp = new RegExp(rangesOfRChars);
|
|
22995
|
-
const rangesOfALRgExp = new RegExp(rangesOfALChars);
|
|
22996
|
-
const rangesOfNRgExp = new RegExp(rangesOfNChars);
|
|
22997
|
-
const
|
|
22998
|
-
// left-to-right marker
|
|
22999
|
-
lrm = String.fromCharCode(8206); // right-to-left marker
|
|
23000
|
-
|
|
23001
|
-
const rlm = String.fromCharCode(8207);
|
|
23002
|
-
function isLtrChar(c) {
|
|
23003
|
-
return rangesOfLRgExp.test(c);
|
|
23004
|
-
}
|
|
23005
|
-
function isRtlChar(c) {
|
|
23006
|
-
return rangesOfRRgExp.test(c) || rangesOfALRgExp.test(c);
|
|
23007
|
-
}
|
|
23008
|
-
function isNeutralChar(c) {
|
|
23009
|
-
return rangesOfNRgExp.test(c);
|
|
23010
|
-
}
|
|
23011
|
-
function detectTextDirection(s) {
|
|
23012
|
-
const n = s ? s.length : 0;
|
|
23013
|
-
let i;
|
|
23014
|
-
let c;
|
|
23015
|
-
for (i = 0; i < n; i++) {
|
|
23016
|
-
c = s[i];
|
|
23017
|
-
if (isLtrChar(c)) {
|
|
23018
|
-
return 'ltr';
|
|
23019
|
-
}
|
|
23020
|
-
if (isRtlChar(c)) {
|
|
23021
|
-
return 'rtl';
|
|
23022
|
-
}
|
|
23023
|
-
}
|
|
23024
|
-
return 'ltr';
|
|
23025
|
-
}
|
|
23026
|
-
var rtlUtil = {
|
|
23027
|
-
detectTextDirection,
|
|
23028
|
-
isLtrChar,
|
|
23029
|
-
isRtlChar,
|
|
23030
|
-
isNeutralChar,
|
|
23031
|
-
lrm,
|
|
23032
|
-
rlm
|
|
23033
|
-
};
|
|
23034
|
-
|
|
23035
22968
|
function RowColumn(_ref) {
|
|
23036
22969
|
var _cell$qText, _cell$qHighlightRange, _cell$qHighlightRange2;
|
|
23037
22970
|
let {
|
|
@@ -23157,7 +23090,6 @@
|
|
|
23157
23090
|
}
|
|
23158
23091
|
const isGridCol = dataLayout === 'grid' && layoutOrder === 'column';
|
|
23159
23092
|
const label = (_cell$qText = cell === null || cell === void 0 ? void 0 : cell.qText) !== null && _cell$qText !== void 0 ? _cell$qText : '';
|
|
23160
|
-
const textDirection = rtlUtil.detectTextDirection(label);
|
|
23161
23093
|
// Search highlights. Split up labelText span into several and add the highlighted class to matching sub-strings.
|
|
23162
23094
|
|
|
23163
23095
|
let labels;
|
|
@@ -23239,8 +23171,7 @@
|
|
|
23239
23171
|
cell: cell,
|
|
23240
23172
|
isGridCol: isGridCol,
|
|
23241
23173
|
isSingleSelect: isSingleSelect,
|
|
23242
|
-
valueTextAlign: valueTextAlign
|
|
23243
|
-
textDirection: textDirection
|
|
23174
|
+
valueTextAlign: valueTextAlign
|
|
23244
23175
|
}) : /*#__PURE__*/React.createElement(Field$1, {
|
|
23245
23176
|
onChange: onChange,
|
|
23246
23177
|
label: label,
|
|
@@ -28558,6 +28489,23 @@
|
|
|
28558
28489
|
};
|
|
28559
28490
|
}
|
|
28560
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
|
+
|
|
28561
28509
|
const PREFIX$4 = 'ListBoxInline';
|
|
28562
28510
|
const classes$4 = {
|
|
28563
28511
|
listBoxHeader: "".concat(PREFIX$4, "-listBoxHeader"),
|
|
@@ -28632,9 +28580,7 @@
|
|
|
28632
28580
|
calculatePagesHeight,
|
|
28633
28581
|
showGray = true,
|
|
28634
28582
|
scrollState = undefined,
|
|
28635
|
-
renderedCallback
|
|
28636
|
-
} = options;
|
|
28637
|
-
let {
|
|
28583
|
+
renderedCallback,
|
|
28638
28584
|
toolbar = true
|
|
28639
28585
|
} = options;
|
|
28640
28586
|
|
|
@@ -28679,6 +28625,8 @@
|
|
|
28679
28625
|
const [appSelections] = useAppSelections(app);
|
|
28680
28626
|
const titleRef = reactExports.useRef(null);
|
|
28681
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';
|
|
28682
28630
|
const {
|
|
28683
28631
|
handleKeyDown,
|
|
28684
28632
|
handleOnMouseEnter,
|
|
@@ -28701,11 +28649,8 @@
|
|
|
28701
28649
|
// this will be static until we can access the useKeyboard hook
|
|
28702
28650
|
active: keyboardActive
|
|
28703
28651
|
};
|
|
28704
|
-
|
|
28705
|
-
|
|
28706
|
-
}
|
|
28707
|
-
const toolbarDetachedOnly = toolbar && (layout === null || layout === void 0 ? void 0 : layout.title) === '';
|
|
28708
|
-
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;
|
|
28709
28654
|
reactExports.useEffect(() => {
|
|
28710
28655
|
const show = () => {
|
|
28711
28656
|
setShowToolbar(true);
|
|
@@ -28729,7 +28674,7 @@
|
|
|
28729
28674
|
selections.removeListener('deactivated', hide);
|
|
28730
28675
|
}
|
|
28731
28676
|
};
|
|
28732
|
-
}, [selections
|
|
28677
|
+
}, [selections]);
|
|
28733
28678
|
reactExports.useEffect(() => {
|
|
28734
28679
|
if (!searchContainer || !searchContainer.current) {
|
|
28735
28680
|
return;
|
|
@@ -28763,7 +28708,7 @@
|
|
|
28763
28708
|
const searchHeight = dense ? 27 : 40;
|
|
28764
28709
|
const extraheight = dense ? 39 : 49;
|
|
28765
28710
|
const searchAddHeight = searchVisible ? searchHeight : 0;
|
|
28766
|
-
const minHeight =
|
|
28711
|
+
const minHeight = showToolbarWithTitle ? 49 + searchAddHeight + extraheight : 0;
|
|
28767
28712
|
const headerHeight = 32;
|
|
28768
28713
|
const onShowSearch = () => {
|
|
28769
28714
|
const newValue = !showSearch;
|
|
@@ -28835,7 +28780,7 @@
|
|
|
28835
28780
|
fontSize: '12px'
|
|
28836
28781
|
}
|
|
28837
28782
|
}));
|
|
28838
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
28783
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, showDetachedToolbarOnly && /*#__PURE__*/React.createElement(ActionsToolbar, _extends$8({
|
|
28839
28784
|
direction: direction
|
|
28840
28785
|
}, getActionToolbarProps(true))), /*#__PURE__*/React.createElement(StyledGrid$3, {
|
|
28841
28786
|
className: "listbox-container",
|
|
@@ -28854,7 +28799,7 @@
|
|
|
28854
28799
|
onMouseLeave: handleOnMouseLeave,
|
|
28855
28800
|
ref: containerRef,
|
|
28856
28801
|
hasIcon: showIcons
|
|
28857
|
-
},
|
|
28802
|
+
}, showToolbarWithTitle && /*#__PURE__*/React.createElement(Grid$1, {
|
|
28858
28803
|
item: true,
|
|
28859
28804
|
container: true,
|
|
28860
28805
|
style: {
|
|
@@ -28944,7 +28889,9 @@
|
|
|
28944
28889
|
className: classes$4.listboxWrapper
|
|
28945
28890
|
}, /*#__PURE__*/React.createElement("div", {
|
|
28946
28891
|
className: classes$4.screenReaderOnly
|
|
28947
|
-
}, 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 => {
|
|
28948
28895
|
let {
|
|
28949
28896
|
height,
|
|
28950
28897
|
width
|
|
@@ -29393,7 +29340,7 @@
|
|
|
29393
29340
|
array.splice(removeIdx, 1);
|
|
29394
29341
|
return removeIdx;
|
|
29395
29342
|
}
|
|
29396
|
-
const nxDimension = f => ({
|
|
29343
|
+
const nxDimension$1 = f => ({
|
|
29397
29344
|
qDef: {
|
|
29398
29345
|
qFieldDefs: [f]
|
|
29399
29346
|
}
|
|
@@ -29424,7 +29371,7 @@
|
|
|
29424
29371
|
return hc.qMeasures;
|
|
29425
29372
|
},
|
|
29426
29373
|
addDimension(d) {
|
|
29427
|
-
const dimension = typeof d === 'string' ? nxDimension(d) : _objectSpread2(_objectSpread2({}, d), {}, {
|
|
29374
|
+
const dimension = typeof d === 'string' ? nxDimension$1(d) : _objectSpread2(_objectSpread2({}, d), {}, {
|
|
29428
29375
|
qDef: d.qDef || {}
|
|
29429
29376
|
});
|
|
29430
29377
|
dimension.qDef.cId = dimension.qDef.cId || uid();
|
|
@@ -29507,6 +29454,69 @@
|
|
|
29507
29454
|
return handler;
|
|
29508
29455
|
}
|
|
29509
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
|
+
|
|
29510
29520
|
/**
|
|
29511
29521
|
* @interface LibraryField
|
|
29512
29522
|
* @property {string} qLibraryId
|
|
@@ -29551,7 +29561,8 @@
|
|
|
29551
29561
|
const s = parts[i];
|
|
29552
29562
|
p = s ? p[s] : p;
|
|
29553
29563
|
}
|
|
29554
|
-
const
|
|
29564
|
+
const createHandler = propertyPath.match('/qListObjectDef') ? loHandler : hcHandler;
|
|
29565
|
+
const handler = createHandler({
|
|
29555
29566
|
dc: p,
|
|
29556
29567
|
def: target,
|
|
29557
29568
|
properties
|
|
@@ -29559,9 +29570,9 @@
|
|
|
29559
29570
|
fields.forEach(f => {
|
|
29560
29571
|
const type = fieldType(f);
|
|
29561
29572
|
if (type === 'measure') {
|
|
29562
|
-
|
|
29573
|
+
handler.addMeasure(f);
|
|
29563
29574
|
} else {
|
|
29564
|
-
|
|
29575
|
+
handler.addDimension(f);
|
|
29565
29576
|
}
|
|
29566
29577
|
});
|
|
29567
29578
|
}
|
|
@@ -30792,7 +30803,8 @@
|
|
|
30792
30803
|
sn,
|
|
30793
30804
|
anchorEl,
|
|
30794
30805
|
hovering,
|
|
30795
|
-
focusHandler
|
|
30806
|
+
focusHandler,
|
|
30807
|
+
titleStyles = {}
|
|
30796
30808
|
} = _ref2;
|
|
30797
30809
|
const showTitle = layout.showTitles && !!layout.title;
|
|
30798
30810
|
const showSubtitle = layout.showTitles && !!layout.subtitle;
|
|
@@ -30850,11 +30862,13 @@
|
|
|
30850
30862
|
}, showTitle && /*#__PURE__*/React.createElement(Typography$1, {
|
|
30851
30863
|
variant: "h6",
|
|
30852
30864
|
noWrap: true,
|
|
30853
|
-
className: CellTitle.className
|
|
30865
|
+
className: CellTitle.className,
|
|
30866
|
+
style: titleStyles.main
|
|
30854
30867
|
}, layout.title), showSubtitle && /*#__PURE__*/React.createElement(Typography$1, {
|
|
30855
30868
|
variant: "body2",
|
|
30856
30869
|
noWrap: true,
|
|
30857
|
-
className: CellSubTitle.className
|
|
30870
|
+
className: CellSubTitle.className,
|
|
30871
|
+
style: titleStyles.subTitle
|
|
30858
30872
|
}, layout.subtitle))), /*#__PURE__*/React.createElement(Grid$1, {
|
|
30859
30873
|
item: true
|
|
30860
30874
|
}, Toolbar));
|
|
@@ -30887,7 +30901,8 @@
|
|
|
30887
30901
|
};
|
|
30888
30902
|
function Footer(_ref2) {
|
|
30889
30903
|
let {
|
|
30890
|
-
layout
|
|
30904
|
+
layout,
|
|
30905
|
+
titleStyles = {}
|
|
30891
30906
|
} = _ref2;
|
|
30892
30907
|
return layout && layout.showTitles && layout.footnote ? /*#__PURE__*/React.createElement(StyledGrid, {
|
|
30893
30908
|
container: true
|
|
@@ -30897,7 +30912,8 @@
|
|
|
30897
30912
|
}, /*#__PURE__*/React.createElement(Typography$1, {
|
|
30898
30913
|
noWrap: true,
|
|
30899
30914
|
variant: "body2",
|
|
30900
|
-
className: CellFooter.className
|
|
30915
|
+
className: CellFooter.className,
|
|
30916
|
+
style: titleStyles.footer
|
|
30901
30917
|
}, layout.footnote))) : null;
|
|
30902
30918
|
}
|
|
30903
30919
|
|
|
@@ -31127,7 +31143,7 @@
|
|
|
31127
31143
|
function resolveImageUrl(app, relativeUrl) {
|
|
31128
31144
|
return relativeUrl ? getSenseServerUrl(app) + relativeUrl : undefined;
|
|
31129
31145
|
}
|
|
31130
|
-
|
|
31146
|
+
function resolveBgImage(bgComp, app) {
|
|
31131
31147
|
const bgImageDef = bgComp === null || bgComp === void 0 ? void 0 : bgComp.bgImage;
|
|
31132
31148
|
if (bgImageDef) {
|
|
31133
31149
|
let url = '';
|
|
@@ -31148,8 +31164,8 @@
|
|
|
31148
31164
|
} : undefined;
|
|
31149
31165
|
}
|
|
31150
31166
|
return undefined;
|
|
31151
|
-
}
|
|
31152
|
-
|
|
31167
|
+
}
|
|
31168
|
+
function resolveBgColor(bgComp, theme, objectType) {
|
|
31153
31169
|
const bgColor = bgComp === null || bgComp === void 0 ? void 0 : bgComp.bgColor;
|
|
31154
31170
|
if (bgColor && theme) {
|
|
31155
31171
|
if (bgColor.useExpression) {
|
|
@@ -31157,8 +31173,32 @@
|
|
|
31157
31173
|
}
|
|
31158
31174
|
return bgColor.color && bgColor.color.color !== 'none' ? theme.getColorPickerColor(bgColor.color, true) : undefined;
|
|
31159
31175
|
}
|
|
31176
|
+
if (theme && objectType) {
|
|
31177
|
+
return theme.getStyle("object.".concat(objectType), '', 'backgroundColor');
|
|
31178
|
+
}
|
|
31179
|
+
if (theme) {
|
|
31180
|
+
return theme.getStyle('', '', 'backgroundColor');
|
|
31181
|
+
}
|
|
31160
31182
|
return undefined;
|
|
31161
|
-
}
|
|
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
|
+
}
|
|
31162
31202
|
|
|
31163
31203
|
/**
|
|
31164
31204
|
* @interface
|
|
@@ -31400,7 +31440,8 @@
|
|
|
31400
31440
|
app,
|
|
31401
31441
|
selections,
|
|
31402
31442
|
nebbie,
|
|
31403
|
-
focusHandler
|
|
31443
|
+
focusHandler,
|
|
31444
|
+
emitter
|
|
31404
31445
|
} = _ref5;
|
|
31405
31446
|
try {
|
|
31406
31447
|
const snType = await getType({
|
|
@@ -31413,7 +31454,8 @@
|
|
|
31413
31454
|
app,
|
|
31414
31455
|
selections,
|
|
31415
31456
|
nebbie,
|
|
31416
|
-
focusHandler
|
|
31457
|
+
focusHandler,
|
|
31458
|
+
emitter
|
|
31417
31459
|
});
|
|
31418
31460
|
return sn;
|
|
31419
31461
|
} catch (err) {
|
|
@@ -31443,7 +31485,8 @@
|
|
|
31443
31485
|
initialSnPlugins,
|
|
31444
31486
|
initialError,
|
|
31445
31487
|
onMount,
|
|
31446
|
-
currentId
|
|
31488
|
+
currentId,
|
|
31489
|
+
emitter
|
|
31447
31490
|
} = _ref6;
|
|
31448
31491
|
const {
|
|
31449
31492
|
app,
|
|
@@ -31482,7 +31525,7 @@
|
|
|
31482
31525
|
});
|
|
31483
31526
|
const [bgColor, setBgColor] = reactExports.useState(undefined);
|
|
31484
31527
|
const [bgImage, setBgImage] = reactExports.useState(undefined); // {url: "", size: "", pos: ""}
|
|
31485
|
-
|
|
31528
|
+
const [titleStyles, setTitleStyles] = reactExports.useState(undefined);
|
|
31486
31529
|
const focusHandler = reactExports.useRef({
|
|
31487
31530
|
focusToolbarButton(last) {
|
|
31488
31531
|
// eslint-disable-next-line react/no-this-in-sfc
|
|
@@ -31493,9 +31536,16 @@
|
|
|
31493
31536
|
eventmixin(focusHandler.current);
|
|
31494
31537
|
}, []);
|
|
31495
31538
|
reactExports.useEffect(() => {
|
|
31496
|
-
|
|
31497
|
-
|
|
31498
|
-
|
|
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
|
+
}
|
|
31499
31549
|
}, [layout, halo.public.theme, halo.app, themeName]);
|
|
31500
31550
|
focusHandler.current.blurCallback = resetFocus => {
|
|
31501
31551
|
halo.root.toggleFocusOfCells();
|
|
@@ -31567,7 +31617,8 @@
|
|
|
31567
31617
|
app,
|
|
31568
31618
|
selections,
|
|
31569
31619
|
nebbie,
|
|
31570
|
-
focusHandler: focusHandler.current
|
|
31620
|
+
focusHandler: focusHandler.current,
|
|
31621
|
+
emitter
|
|
31571
31622
|
});
|
|
31572
31623
|
if (sn) {
|
|
31573
31624
|
dispatch({
|
|
@@ -31709,7 +31760,8 @@
|
|
|
31709
31760
|
sn: state.sn,
|
|
31710
31761
|
anchorEl: cellNode,
|
|
31711
31762
|
hovering: hovering,
|
|
31712
|
-
focusHandler: focusHandler.current
|
|
31763
|
+
focusHandler: focusHandler.current,
|
|
31764
|
+
titleStyles: titleStyles
|
|
31713
31765
|
}, "\xA0"), /*#__PURE__*/React.createElement(Grid$1, {
|
|
31714
31766
|
tabIndex: keyboardNavigation ? 0 : -1,
|
|
31715
31767
|
onKeyDown: keyboardNavigation ? handleKeyDown : null,
|
|
@@ -31720,7 +31772,8 @@
|
|
|
31720
31772
|
},
|
|
31721
31773
|
ref: contentRef
|
|
31722
31774
|
}, Content), /*#__PURE__*/React.createElement(Footer, {
|
|
31723
|
-
layout: layout
|
|
31775
|
+
layout: layout,
|
|
31776
|
+
titleStyles: titleStyles
|
|
31724
31777
|
})), state.longRunningQuery && /*#__PURE__*/React.createElement(LongRunningQuery, {
|
|
31725
31778
|
canCancel: canCancel,
|
|
31726
31779
|
canRetry: canRetry,
|
|
@@ -31736,6 +31789,7 @@
|
|
|
31736
31789
|
initialSnOptions,
|
|
31737
31790
|
initialSnPlugins,
|
|
31738
31791
|
onMount,
|
|
31792
|
+
emitter,
|
|
31739
31793
|
initialError
|
|
31740
31794
|
} = _ref;
|
|
31741
31795
|
const {
|
|
@@ -31751,7 +31805,8 @@
|
|
|
31751
31805
|
initialSnOptions: initialSnOptions,
|
|
31752
31806
|
initialSnPlugins: initialSnPlugins,
|
|
31753
31807
|
initialError: initialError,
|
|
31754
|
-
onMount: onMount
|
|
31808
|
+
onMount: onMount,
|
|
31809
|
+
emitter: emitter
|
|
31755
31810
|
}), element, currentId);
|
|
31756
31811
|
const unmount = () => {
|
|
31757
31812
|
root.remove(portal);
|
|
@@ -31851,6 +31906,7 @@
|
|
|
31851
31906
|
});
|
|
31852
31907
|
let initialSnOptions = {};
|
|
31853
31908
|
let initialSnPlugins = [];
|
|
31909
|
+
const emitter = new nodeEventEmitter();
|
|
31854
31910
|
const setSnOptions = async opts => {
|
|
31855
31911
|
if (mountedReference) {
|
|
31856
31912
|
(async () => {
|
|
@@ -31941,6 +31997,24 @@
|
|
|
31941
31997
|
}
|
|
31942
31998
|
return propertyTree;
|
|
31943
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
|
+
},
|
|
31944
32018
|
// ===== unexposed experimental API - use at own risk ======
|
|
31945
32019
|
__DO_NOT_USE__: {
|
|
31946
32020
|
mount(element) {
|
|
@@ -31955,7 +32029,8 @@
|
|
|
31955
32029
|
initialSnOptions,
|
|
31956
32030
|
initialSnPlugins,
|
|
31957
32031
|
initialError,
|
|
31958
|
-
onMount
|
|
32032
|
+
onMount,
|
|
32033
|
+
emitter
|
|
31959
32034
|
});
|
|
31960
32035
|
return mounted;
|
|
31961
32036
|
},
|
|
@@ -33902,7 +33977,7 @@
|
|
|
33902
33977
|
* @ignore
|
|
33903
33978
|
* @example
|
|
33904
33979
|
* import { onContextMenu } from '@nebula.js/stardust';
|
|
33905
|
-
|
|
33980
|
+
|
|
33906
33981
|
* onContextMenu((menu, event) => {
|
|
33907
33982
|
* menu.addItem(item, index);
|
|
33908
33983
|
* });
|
|
@@ -33956,6 +34031,32 @@
|
|
|
33956
34031
|
};
|
|
33957
34032
|
}
|
|
33958
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
|
+
|
|
33959
34060
|
/**
|
|
33960
34061
|
* @experimental
|
|
33961
34062
|
* @interface Keyboard
|
|
@@ -34137,6 +34238,7 @@
|
|
|
34137
34238
|
nebbie: opts.nebbie,
|
|
34138
34239
|
element: undefined,
|
|
34139
34240
|
// set on mount
|
|
34241
|
+
emitter: opts.emitter,
|
|
34140
34242
|
// ---- singletons ----
|
|
34141
34243
|
deviceType: galaxy.deviceType,
|
|
34142
34244
|
theme: undefined,
|
|
@@ -37340,6 +37442,7 @@
|
|
|
37340
37442
|
exports.useEffect = useEffect;
|
|
37341
37443
|
exports.useElement = useElement;
|
|
37342
37444
|
exports.useEmbed = useEmbed;
|
|
37445
|
+
exports.useEmitter = useEmitter;
|
|
37343
37446
|
exports.useGlobal = useGlobal;
|
|
37344
37447
|
exports.useImperativeHandle = useImperativeHandle;
|
|
37345
37448
|
exports.useKeyboard = useKeyboard;
|