@nebula.js/stardust 4.2.0 → 4.2.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.
- package/core/esm/dev.js +570 -457
- package/core/esm/dev.js.map +1 -1
- package/core/esm/index.js +3 -3
- package/core/esm/index.js.map +1 -1
- package/core/package.json +1 -1
- package/dist/stardust.dev.js +571 -458
- package/dist/stardust.dev.js.map +1 -1
- package/dist/stardust.js +10 -10
- package/dist/stardust.js.map +1 -1
- package/package.json +11 -11
- package/types/index.d.ts +10 -10
package/dist/stardust.dev.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/stardust v4.2.
|
|
2
|
+
* @nebula.js/stardust v4.2.1
|
|
3
3
|
* Copyright (c) 2023 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
@@ -14769,7 +14769,7 @@
|
|
|
14769
14769
|
return cache[key];
|
|
14770
14770
|
}
|
|
14771
14771
|
|
|
14772
|
-
const NEBULA_VERSION_HASH = "
|
|
14772
|
+
const NEBULA_VERSION_HASH = "65bf" ;
|
|
14773
14773
|
ClassNameGenerator$1.configure(componentName => {
|
|
14774
14774
|
return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
|
|
14775
14775
|
});
|
|
@@ -15016,7 +15016,7 @@
|
|
|
15016
15016
|
const appRef = React.createRef();
|
|
15017
15017
|
const element = document.createElement('div');
|
|
15018
15018
|
element.style.display = 'none';
|
|
15019
|
-
element.setAttribute('data-nebulajs-version', "4.2.
|
|
15019
|
+
element.setAttribute('data-nebulajs-version', "4.2.1" );
|
|
15020
15020
|
element.setAttribute('data-app-id', app.id);
|
|
15021
15021
|
document.body.appendChild(element);
|
|
15022
15022
|
if (context) {
|
|
@@ -17154,7 +17154,7 @@
|
|
|
17154
17154
|
className: clsx(className, rootSlotProps == null ? void 0 : rootSlotProps.className, classes == null ? void 0 : classes.root, !ownerState.open && ownerState.exited && (classes == null ? void 0 : classes.hidden))
|
|
17155
17155
|
}),
|
|
17156
17156
|
backdrop: () => _extends$4({}, BackdropProps, resolveComponentProps(backdropSlotProps, ownerState), {
|
|
17157
|
-
className: clsx(backdropSlotProps == null ? void 0 : backdropSlotProps.className, classes == null ? void 0 : classes.backdrop)
|
|
17157
|
+
className: clsx(backdropSlotProps == null ? void 0 : backdropSlotProps.className, BackdropProps == null ? void 0 : BackdropProps.className, classes == null ? void 0 : classes.backdrop)
|
|
17158
17158
|
})
|
|
17159
17159
|
},
|
|
17160
17160
|
onTransitionEnter: () => setExited(false),
|
|
@@ -21533,7 +21533,6 @@
|
|
|
21533
21533
|
const REMOVE_TICK_LIMIT = 80; // an item width equal to or less than this, will hide the select tick
|
|
21534
21534
|
const SCROLL_BAR_WIDTH = 10; // TODO: ignore this - instead set the styling only show on hover...
|
|
21535
21535
|
const ITEM_MAX_WIDTH = 150;
|
|
21536
|
-
const FREQUENCY_WIDTH = 40;
|
|
21537
21536
|
const ITEM_MIN_WIDTH = 56;
|
|
21538
21537
|
const CHECKBOX_WIDTH = 20;
|
|
21539
21538
|
const frequencyTextNone = '-';
|
|
@@ -21555,10 +21554,39 @@
|
|
|
21555
21554
|
};
|
|
21556
21555
|
const getFrequencyText = qFrequency => qFrequency || frequencyTextNone;
|
|
21557
21556
|
|
|
21558
|
-
const
|
|
21557
|
+
const getFreqFlexBasis = _ref => {
|
|
21559
21558
|
let {
|
|
21560
|
-
|
|
21559
|
+
sizes,
|
|
21560
|
+
frequencyMode,
|
|
21561
|
+
isGridMode,
|
|
21562
|
+
freqHitsValue
|
|
21561
21563
|
} = _ref;
|
|
21564
|
+
if (frequencyMode === 'P') {
|
|
21565
|
+
return "".concat(sizes.freqMinWidth, "px");
|
|
21566
|
+
}
|
|
21567
|
+
const flexBasis = isGridMode && !freqHitsValue ? 'max-content' : '25%';
|
|
21568
|
+
return flexBasis;
|
|
21569
|
+
};
|
|
21570
|
+
const getMaxFreqWidth = _ref2 => {
|
|
21571
|
+
let {
|
|
21572
|
+
sizes,
|
|
21573
|
+
frequencyMode,
|
|
21574
|
+
isGridMode
|
|
21575
|
+
} = _ref2;
|
|
21576
|
+
if (isGridMode) {
|
|
21577
|
+
// This makes the neighbouring value stretch farther than when using a fixed freuency width.
|
|
21578
|
+
return 'max-content';
|
|
21579
|
+
}
|
|
21580
|
+
if (frequencyMode === 'P') {
|
|
21581
|
+
return sizes.freqMinWidth; // because it will never grow beyond "100.0%"
|
|
21582
|
+
}
|
|
21583
|
+
|
|
21584
|
+
return sizes.freqMaxWidth;
|
|
21585
|
+
};
|
|
21586
|
+
const getSelectedStyle = _ref3 => {
|
|
21587
|
+
let {
|
|
21588
|
+
theme
|
|
21589
|
+
} = _ref3;
|
|
21562
21590
|
return {
|
|
21563
21591
|
background: theme.palette.selected.main,
|
|
21564
21592
|
color: theme.palette.selected.mainContrastText,
|
|
@@ -21580,18 +21608,20 @@
|
|
|
21580
21608
|
const iconWidth = 24; // tick and lock icon width in px
|
|
21581
21609
|
|
|
21582
21610
|
const RowColRoot = styled$1('div', {
|
|
21583
|
-
shouldForwardProp: prop => !['
|
|
21584
|
-
})(
|
|
21611
|
+
shouldForwardProp: prop => !['checkboxes', 'isGridMode', 'isGridCol', 'dense', 'direction', 'sizes', 'frequencyMode', 'freqHitsValue'].includes(prop)
|
|
21612
|
+
})(_ref4 => {
|
|
21585
21613
|
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;
|
|
21586
21614
|
let {
|
|
21587
21615
|
theme,
|
|
21588
|
-
|
|
21616
|
+
checkboxes,
|
|
21589
21617
|
isGridMode,
|
|
21590
21618
|
isGridCol,
|
|
21591
21619
|
dense,
|
|
21592
|
-
|
|
21593
|
-
|
|
21594
|
-
|
|
21620
|
+
direction,
|
|
21621
|
+
sizes,
|
|
21622
|
+
frequencyMode,
|
|
21623
|
+
freqHitsValue
|
|
21624
|
+
} = _ref4;
|
|
21595
21625
|
return {
|
|
21596
21626
|
'&:focus': {
|
|
21597
21627
|
boxShadow: "inset 0 0 0 2px ".concat(theme.palette.custom.focusBorder, " !important")
|
|
@@ -21624,15 +21654,16 @@
|
|
|
21624
21654
|
["& .".concat(rowColClasses.cell)]: {
|
|
21625
21655
|
display: 'flex',
|
|
21626
21656
|
alignItems: 'center',
|
|
21627
|
-
minWidth: 0,
|
|
21628
21657
|
flexGrow: 1,
|
|
21658
|
+
minWidth: checkboxes ? '52px' : '26px',
|
|
21659
|
+
// these numbers are just enough to show one letter and ellipsis: A…
|
|
21660
|
+
flexBasis: checkboxes ? 'auto' : 'max-content',
|
|
21629
21661
|
// Note that this padding is overridden when using checkboxes.
|
|
21630
21662
|
paddingLeft: "".concat(CELL_PADDING_LEFT, "px"),
|
|
21631
21663
|
paddingRight: 0
|
|
21632
21664
|
},
|
|
21633
21665
|
// The leaf node, containing the label text.
|
|
21634
21666
|
["& .".concat(rowColClasses.labelText)]: _objectSpread2(_objectSpread2({
|
|
21635
|
-
flexBasis: flexBasisProp,
|
|
21636
21667
|
lineHeight: '16px',
|
|
21637
21668
|
userSelect: 'none',
|
|
21638
21669
|
paddingRight: '1px'
|
|
@@ -21700,9 +21731,22 @@
|
|
|
21700
21731
|
["& .".concat(rowColClasses.frequencyCount)]: _objectSpread2(_objectSpread2({
|
|
21701
21732
|
justifyContent: 'flex-end'
|
|
21702
21733
|
}, ellipsis), {}, {
|
|
21703
|
-
flex: "0
|
|
21734
|
+
flex: "0 0 ".concat(getFreqFlexBasis({
|
|
21735
|
+
sizes,
|
|
21736
|
+
frequencyMode,
|
|
21737
|
+
isGridMode,
|
|
21738
|
+
freqHitsValue
|
|
21739
|
+
})),
|
|
21740
|
+
minWidth: !isGridMode && frequencyMode !== 'P' && freqHitsValue ? sizes.freqMinWidth : 'max-content',
|
|
21741
|
+
maxWidth: getMaxFreqWidth({
|
|
21742
|
+
sizes,
|
|
21743
|
+
frequencyMode,
|
|
21744
|
+
isGridMode
|
|
21745
|
+
}),
|
|
21704
21746
|
textAlign: direction === 'rtl' ? 'left' : 'right',
|
|
21705
|
-
|
|
21747
|
+
// In RTL, we already get the 8px from the value element's padding and for
|
|
21748
|
+
// percent mode we have already adapted the width (fixed width) to the max number.
|
|
21749
|
+
paddingLeft: direction !== 'rtl' ? '8px' : 0
|
|
21706
21750
|
}),
|
|
21707
21751
|
["&.".concat(rowColClasses.barContainer)]: {
|
|
21708
21752
|
height: '100%',
|
|
@@ -22548,6 +22592,32 @@
|
|
|
22548
22592
|
return handleKeyDown;
|
|
22549
22593
|
}
|
|
22550
22594
|
|
|
22595
|
+
function getValueTextAlign(_ref) {
|
|
22596
|
+
let {
|
|
22597
|
+
direction,
|
|
22598
|
+
cell,
|
|
22599
|
+
textAlign
|
|
22600
|
+
} = _ref;
|
|
22601
|
+
const isNumeric = !['NaN', undefined].includes(cell === null || cell === void 0 ? void 0 : cell.qNum);
|
|
22602
|
+
let valueTextAlign;
|
|
22603
|
+
const isAutoTextAlign = !textAlign || textAlign.auto;
|
|
22604
|
+
const dirToTextAlignMap = {
|
|
22605
|
+
rtl: 'right',
|
|
22606
|
+
ltr: 'left'
|
|
22607
|
+
};
|
|
22608
|
+
if (isAutoTextAlign) {
|
|
22609
|
+
if (!isNumeric) {
|
|
22610
|
+
valueTextAlign = dirToTextAlignMap[direction];
|
|
22611
|
+
} else {
|
|
22612
|
+
valueTextAlign = direction === 'rtl' ? 'left' : 'right';
|
|
22613
|
+
}
|
|
22614
|
+
} else {
|
|
22615
|
+
valueTextAlign = (textAlign === null || textAlign === void 0 ? void 0 : textAlign.align) || 'left';
|
|
22616
|
+
}
|
|
22617
|
+
const ALLOWED_OPTIONS = ['left', 'center', 'right'];
|
|
22618
|
+
return ALLOWED_OPTIONS.includes(valueTextAlign) ? valueTextAlign : 'left';
|
|
22619
|
+
}
|
|
22620
|
+
|
|
22551
22621
|
function RowColumn(_ref) {
|
|
22552
22622
|
var _cell$qText, _cell$qHighlightRange, _cell$qHighlightRange2;
|
|
22553
22623
|
let {
|
|
@@ -22583,10 +22653,10 @@
|
|
|
22583
22653
|
columnCount = 1,
|
|
22584
22654
|
rowCount = 1,
|
|
22585
22655
|
dataOffset,
|
|
22656
|
+
deducedFrequencyMode,
|
|
22586
22657
|
focusListItems,
|
|
22587
22658
|
listCount,
|
|
22588
|
-
|
|
22589
|
-
frequencyWidth,
|
|
22659
|
+
sizes,
|
|
22590
22660
|
translator,
|
|
22591
22661
|
showSearch,
|
|
22592
22662
|
isModal
|
|
@@ -22596,6 +22666,9 @@
|
|
|
22596
22666
|
dataLayout = 'singleColumn',
|
|
22597
22667
|
layoutOrder
|
|
22598
22668
|
} = layoutOptions;
|
|
22669
|
+
const {
|
|
22670
|
+
itemPadding
|
|
22671
|
+
} = sizes;
|
|
22599
22672
|
let cellIndex;
|
|
22600
22673
|
let styles;
|
|
22601
22674
|
const count = {
|
|
@@ -22663,26 +22736,15 @@
|
|
|
22663
22736
|
const preventContextMenu = reactExports.useCallback(event => {
|
|
22664
22737
|
event.preventDefault();
|
|
22665
22738
|
}, [checkboxes]);
|
|
22739
|
+
const valueTextAlign = reactExports.useMemo(() => cell && getValueTextAlign({
|
|
22740
|
+
direction,
|
|
22741
|
+
cell,
|
|
22742
|
+
textAlign
|
|
22743
|
+
}), [direction, cell, textAlign]);
|
|
22666
22744
|
if (!cell) {
|
|
22667
22745
|
return null; // prevent rendering empty rows
|
|
22668
22746
|
}
|
|
22669
22747
|
|
|
22670
|
-
const isNumeric = !['NaN', undefined].includes(cell === null || cell === void 0 ? void 0 : cell.qNum);
|
|
22671
|
-
let valueTextAlign;
|
|
22672
|
-
const isAutoTextAlign = !textAlign || textAlign.auto;
|
|
22673
|
-
const dirToTextAlignMap = {
|
|
22674
|
-
rtl: 'right',
|
|
22675
|
-
ltr: 'left'
|
|
22676
|
-
};
|
|
22677
|
-
if (isAutoTextAlign) {
|
|
22678
|
-
if (!isNumeric) {
|
|
22679
|
-
valueTextAlign = dirToTextAlignMap[direction];
|
|
22680
|
-
} else {
|
|
22681
|
-
valueTextAlign = direction === 'rtl' ? 'left' : 'right';
|
|
22682
|
-
}
|
|
22683
|
-
} else {
|
|
22684
|
-
valueTextAlign = (textAlign === null || textAlign === void 0 ? void 0 : textAlign.align) || 'left';
|
|
22685
|
-
}
|
|
22686
22748
|
const isGridCol = dataLayout === 'grid' && layoutOrder === 'column';
|
|
22687
22749
|
const label = (_cell$qText = cell === null || cell === void 0 ? void 0 : cell.qText) !== null && _cell$qText !== void 0 ? _cell$qText : '';
|
|
22688
22750
|
// Search highlights. Split up labelText span into several and add the highlighted class to matching sub-strings.
|
|
@@ -22697,17 +22759,16 @@
|
|
|
22697
22759
|
display: 'flex',
|
|
22698
22760
|
fontSize: '8px'
|
|
22699
22761
|
};
|
|
22762
|
+
const isRtl = direction === 'rtl';
|
|
22700
22763
|
const cellStyle = {
|
|
22701
22764
|
display: 'flex',
|
|
22702
22765
|
alignItems: 'center',
|
|
22703
|
-
minWidth: 0,
|
|
22704
22766
|
flexGrow: 1,
|
|
22705
|
-
paddingLeft:
|
|
22706
|
-
paddingRight: checkboxes ? 0 :
|
|
22767
|
+
paddingLeft: isRtl ? 8 : checkboxes ? 0 : undefined,
|
|
22768
|
+
paddingRight: checkboxes ? 0 : isRtl ? 8 : 0,
|
|
22707
22769
|
justifyContent: valueTextAlign
|
|
22708
22770
|
};
|
|
22709
22771
|
const isFirstElement = index === 0;
|
|
22710
|
-
const flexBasisVal = checkboxes ? 'auto' : 'max-content';
|
|
22711
22772
|
const showLock = isSelected && isLocked;
|
|
22712
22773
|
const showTick = !checkboxes && isSelected && !isLocked;
|
|
22713
22774
|
const showIcon = !checkboxes && sizePermitsTickOrLock;
|
|
@@ -22720,15 +22781,18 @@
|
|
|
22720
22781
|
maxIndex: count.max,
|
|
22721
22782
|
showSearch
|
|
22722
22783
|
});
|
|
22784
|
+
const freqHitsValue = !isRtl && valueTextAlign === 'right' || isRtl && valueTextAlign === 'left';
|
|
22723
22785
|
return /*#__PURE__*/React.createElement(RowColRoot$1, {
|
|
22724
22786
|
className: rowColClasses.barContainer,
|
|
22725
|
-
|
|
22787
|
+
checkboxes: checkboxes,
|
|
22726
22788
|
style: styles,
|
|
22727
22789
|
isGridCol: isGridCol,
|
|
22728
22790
|
isGridMode: dataLayout === 'grid',
|
|
22729
22791
|
dense: dense,
|
|
22730
|
-
frequencyWidth: frequencyWidth,
|
|
22731
22792
|
direction: direction,
|
|
22793
|
+
sizes: sizes,
|
|
22794
|
+
frequencyMode: deducedFrequencyMode,
|
|
22795
|
+
freqHitsValue: freqHitsValue,
|
|
22732
22796
|
"data-testid": "listbox.item"
|
|
22733
22797
|
}, /*#__PURE__*/React.createElement(ItemGrid, {
|
|
22734
22798
|
role: "row",
|
|
@@ -24352,7 +24416,7 @@
|
|
|
24352
24416
|
pages,
|
|
24353
24417
|
selectDisabled,
|
|
24354
24418
|
interactionEvents,
|
|
24355
|
-
|
|
24419
|
+
deducedFrequencyMode,
|
|
24356
24420
|
histogram,
|
|
24357
24421
|
isSingleSelect,
|
|
24358
24422
|
select,
|
|
@@ -24382,12 +24446,10 @@
|
|
|
24382
24446
|
} = layout || {};
|
|
24383
24447
|
const {
|
|
24384
24448
|
columnWidth,
|
|
24385
|
-
itemPadding,
|
|
24386
24449
|
listHeight,
|
|
24387
24450
|
itemHeight,
|
|
24388
24451
|
rowCount,
|
|
24389
|
-
columnCount
|
|
24390
|
-
frequencyWidth
|
|
24452
|
+
columnCount
|
|
24391
24453
|
} = sizes || {};
|
|
24392
24454
|
const itemWidth = layoutOptions.dataLayout === 'grid' ? columnWidth : width;
|
|
24393
24455
|
const showTick = itemWidth > REMOVE_TICK_LIMIT;
|
|
@@ -24408,12 +24470,11 @@
|
|
|
24408
24470
|
}, isLocked || selectDisabled() ? {} : interactionEvents), {}, {
|
|
24409
24471
|
checkboxes,
|
|
24410
24472
|
layoutOptions,
|
|
24411
|
-
|
|
24473
|
+
deducedFrequencyMode,
|
|
24412
24474
|
freqIsAllowed,
|
|
24413
24475
|
isSingleSelect,
|
|
24414
24476
|
textAlign,
|
|
24415
|
-
|
|
24416
|
-
frequencyWidth,
|
|
24477
|
+
sizes,
|
|
24417
24478
|
actions: {
|
|
24418
24479
|
select,
|
|
24419
24480
|
confirm: () => selections === null || selections === void 0 ? void 0 : selections.confirm.call(selections),
|
|
@@ -24598,16 +24659,46 @@
|
|
|
24598
24659
|
};
|
|
24599
24660
|
}
|
|
24600
24661
|
|
|
24601
|
-
|
|
24662
|
+
const getContext = () => {
|
|
24663
|
+
const fragment = document.createDocumentFragment();
|
|
24664
|
+
const canvas = document.createElement('canvas');
|
|
24665
|
+
fragment.appendChild(canvas);
|
|
24666
|
+
return canvas.getContext('2d');
|
|
24667
|
+
};
|
|
24668
|
+
const getTextWidth = (currentText, font) => {
|
|
24669
|
+
const context = getContext();
|
|
24670
|
+
context.font = font;
|
|
24671
|
+
if (Array.isArray(currentText)) {
|
|
24672
|
+
return Math.max(...currentText.map(t => context.measureText(t).width));
|
|
24673
|
+
}
|
|
24674
|
+
const metrics = context.measureText(currentText);
|
|
24675
|
+
return Math.ceil(metrics.width || 0);
|
|
24676
|
+
};
|
|
24677
|
+
const useTextWidth = options => {
|
|
24678
|
+
const textOptions = reactExports.useMemo(() => 'text' in options ? options : {}, [options]);
|
|
24679
|
+
return reactExports.useMemo(() => getTextWidth(textOptions.text, textOptions.font || '12px Source Sans Pro'), [textOptions.text, textOptions.font]);
|
|
24680
|
+
};
|
|
24681
|
+
|
|
24682
|
+
function getMeasureText(layoutOrNumber) {
|
|
24683
|
+
if (!layoutOrNumber) {
|
|
24684
|
+
return '';
|
|
24685
|
+
}
|
|
24686
|
+
const maxGlyphCount = typeof layoutOrNumber === 'number' ? layoutOrNumber : layoutOrNumber.qListObject.qDimensionInfo.qApprMaxGlyphCount;
|
|
24687
|
+
const measureString = Array(maxGlyphCount).fill('M').join('');
|
|
24688
|
+
return measureString;
|
|
24689
|
+
}
|
|
24690
|
+
|
|
24691
|
+
function useListSizes(_ref) {
|
|
24692
|
+
var _theme$listBox;
|
|
24602
24693
|
let {
|
|
24603
24694
|
layout,
|
|
24604
24695
|
width,
|
|
24605
24696
|
height,
|
|
24606
24697
|
listCount,
|
|
24607
24698
|
count,
|
|
24608
|
-
textWidth,
|
|
24609
24699
|
freqIsAllowed,
|
|
24610
|
-
checkboxes
|
|
24700
|
+
checkboxes,
|
|
24701
|
+
theme
|
|
24611
24702
|
} = _ref;
|
|
24612
24703
|
const {
|
|
24613
24704
|
layoutOptions = {}
|
|
@@ -24619,7 +24710,24 @@
|
|
|
24619
24710
|
dense,
|
|
24620
24711
|
dataLayout
|
|
24621
24712
|
} = layoutOptions;
|
|
24622
|
-
const
|
|
24713
|
+
const {
|
|
24714
|
+
fontSize = '12px',
|
|
24715
|
+
fontFamily = 'Source sans pro'
|
|
24716
|
+
} = ((_theme$listBox = theme.listBox) === null || _theme$listBox === void 0 ? void 0 : _theme$listBox.content) || {};
|
|
24717
|
+
const font = "".concat(fontSize, " ").concat(fontFamily); // font format as supported by HTML canvas
|
|
24718
|
+
const textWidth = useTextWidth({
|
|
24719
|
+
text: getMeasureText(layout),
|
|
24720
|
+
font
|
|
24721
|
+
});
|
|
24722
|
+
const freqMinWidth = useTextWidth({
|
|
24723
|
+
text: getMeasureText(5),
|
|
24724
|
+
font
|
|
24725
|
+
});
|
|
24726
|
+
const freqMaxWidth = useTextWidth({
|
|
24727
|
+
text: getMeasureText(8),
|
|
24728
|
+
font
|
|
24729
|
+
});
|
|
24730
|
+
const frequencyAddWidth = freqIsAllowed ? freqMinWidth : 0;
|
|
24623
24731
|
const checkboxAddWidth = checkboxes ? CHECKBOX_WIDTH : 0;
|
|
24624
24732
|
const tickIconWidth = CHECKBOX_WIDTH;
|
|
24625
24733
|
let dynamicItemMinWidth = ITEM_MIN_WIDTH + frequencyAddWidth + checkboxAddWidth;
|
|
@@ -24700,6 +24808,7 @@
|
|
|
24700
24808
|
overflowStyling,
|
|
24701
24809
|
itemHeight,
|
|
24702
24810
|
listHeight,
|
|
24811
|
+
listWidth: width,
|
|
24703
24812
|
scrollBarWidth: SCROLL_BAR_WIDTH,
|
|
24704
24813
|
count,
|
|
24705
24814
|
listCount: limitedListCount,
|
|
@@ -24708,42 +24817,12 @@
|
|
|
24708
24817
|
column: maxColumnCount
|
|
24709
24818
|
},
|
|
24710
24819
|
itemPadding,
|
|
24711
|
-
|
|
24820
|
+
textWidth,
|
|
24821
|
+
freqMinWidth,
|
|
24822
|
+
freqMaxWidth
|
|
24712
24823
|
};
|
|
24713
24824
|
}
|
|
24714
24825
|
|
|
24715
|
-
const getContext = () => {
|
|
24716
|
-
const fragment = document.createDocumentFragment();
|
|
24717
|
-
const canvas = document.createElement('canvas');
|
|
24718
|
-
fragment.appendChild(canvas);
|
|
24719
|
-
return canvas.getContext('2d');
|
|
24720
|
-
};
|
|
24721
|
-
const getTextWidth = (currentText, font) => {
|
|
24722
|
-
const context = getContext();
|
|
24723
|
-
context.font = font;
|
|
24724
|
-
if (Array.isArray(currentText)) {
|
|
24725
|
-
return Math.max(...currentText.map(t => context.measureText(t).width));
|
|
24726
|
-
}
|
|
24727
|
-
const metrics = context.measureText(currentText);
|
|
24728
|
-
return metrics.width;
|
|
24729
|
-
};
|
|
24730
|
-
const useTextWidth = options => {
|
|
24731
|
-
const textOptions = reactExports.useMemo(() => 'text' in options ? options : {}, [options]);
|
|
24732
|
-
return reactExports.useMemo(() => getTextWidth(textOptions.text, textOptions.font || '14px Source Sans Pro'), [textOptions.text, textOptions.font]);
|
|
24733
|
-
};
|
|
24734
|
-
|
|
24735
|
-
function getMeasureText(layout) {
|
|
24736
|
-
if (!layout) {
|
|
24737
|
-
return '';
|
|
24738
|
-
}
|
|
24739
|
-
const maxGlyphCount = layout.qListObject.qDimensionInfo.qApprMaxGlyphCount;
|
|
24740
|
-
let measureString = '';
|
|
24741
|
-
for (let i = 0; i < maxGlyphCount; i++) {
|
|
24742
|
-
measureString += 'M';
|
|
24743
|
-
}
|
|
24744
|
-
return measureString;
|
|
24745
|
-
}
|
|
24746
|
-
|
|
24747
24826
|
function getHorizontalMinBatchSize(_ref) {
|
|
24748
24827
|
let {
|
|
24749
24828
|
width,
|
|
@@ -25077,7 +25156,7 @@
|
|
|
25077
25156
|
const {
|
|
25078
25157
|
frequencyEnabled = false
|
|
25079
25158
|
} = (layout === null || layout === void 0 ? void 0 : layout.qListObject) || {};
|
|
25080
|
-
const hasValidFreqOption = !['
|
|
25159
|
+
const hasValidFreqOption = !['N', undefined].includes(frequencyMode);
|
|
25081
25160
|
return !!(widthPermitsFreq && (hasValidFreqOption || frequencyEnabled));
|
|
25082
25161
|
}
|
|
25083
25162
|
|
|
@@ -25124,6 +25203,21 @@
|
|
|
25124
25203
|
};
|
|
25125
25204
|
};
|
|
25126
25205
|
|
|
25206
|
+
function deduceFrequencyMode(pages) {
|
|
25207
|
+
const hasPercentSign = pages.some(_ref => {
|
|
25208
|
+
let {
|
|
25209
|
+
qMatrix
|
|
25210
|
+
} = _ref;
|
|
25211
|
+
return qMatrix.some(_ref2 => {
|
|
25212
|
+
var _item$qFrequency;
|
|
25213
|
+
let [item] = _ref2;
|
|
25214
|
+
return !!((_item$qFrequency = item.qFrequency) !== null && _item$qFrequency !== void 0 && _item$qFrequency.match('%'));
|
|
25215
|
+
});
|
|
25216
|
+
});
|
|
25217
|
+
const OTHER = '-'; // treat all other as '-' (change later if we need to identify other modes)
|
|
25218
|
+
return hasPercentSign ? 'P' : OTHER;
|
|
25219
|
+
}
|
|
25220
|
+
|
|
25127
25221
|
const _excluded$4 = ["isLoadingData"];
|
|
25128
25222
|
const DEFAULT_MIN_BATCH_SIZE = 100;
|
|
25129
25223
|
const StyledWrapper = styled$1('div')(() => ({
|
|
@@ -25140,6 +25234,7 @@
|
|
|
25140
25234
|
model,
|
|
25141
25235
|
app,
|
|
25142
25236
|
constraints,
|
|
25237
|
+
theme,
|
|
25143
25238
|
layout,
|
|
25144
25239
|
selections,
|
|
25145
25240
|
selectionState,
|
|
@@ -25295,10 +25390,6 @@
|
|
|
25295
25390
|
reactExports.useEffect(() => {
|
|
25296
25391
|
fetchData();
|
|
25297
25392
|
}, [layout, local.current.dataOffset]);
|
|
25298
|
-
const textWidth = useTextWidth({
|
|
25299
|
-
text: getMeasureText(layout),
|
|
25300
|
-
font: '14px Source sans pro'
|
|
25301
|
-
});
|
|
25302
25393
|
let minimumBatchSize = DEFAULT_MIN_BATCH_SIZE;
|
|
25303
25394
|
const isVertical = layoutOptions.dataLayout !== 'grid';
|
|
25304
25395
|
const count = layout === null || layout === void 0 ? void 0 : (_layout$qListObject$q = layout.qListObject.qSize) === null || _layout$qListObject$q === void 0 ? void 0 : _layout$qListObject$q.qcy;
|
|
@@ -25315,15 +25406,16 @@
|
|
|
25315
25406
|
layout,
|
|
25316
25407
|
frequencyMode
|
|
25317
25408
|
});
|
|
25318
|
-
const
|
|
25409
|
+
const deducedFrequencyMode = deduceFrequencyMode(pages);
|
|
25410
|
+
const sizes = useListSizes({
|
|
25319
25411
|
layout,
|
|
25320
25412
|
width,
|
|
25321
25413
|
height,
|
|
25322
25414
|
listCount: unlimitedListCount,
|
|
25323
25415
|
count,
|
|
25324
|
-
textWidth,
|
|
25325
25416
|
freqIsAllowed,
|
|
25326
|
-
checkboxes
|
|
25417
|
+
checkboxes,
|
|
25418
|
+
theme
|
|
25327
25419
|
});
|
|
25328
25420
|
if (sizes.columnWidth) {
|
|
25329
25421
|
// In grid mode, where we have a dynamic item width, get a second opinion on showing/hiding frequency.
|
|
@@ -25400,7 +25492,7 @@
|
|
|
25400
25492
|
height,
|
|
25401
25493
|
width,
|
|
25402
25494
|
checkboxes,
|
|
25403
|
-
|
|
25495
|
+
deducedFrequencyMode,
|
|
25404
25496
|
histogram,
|
|
25405
25497
|
keyboard,
|
|
25406
25498
|
showGray,
|
|
@@ -27687,21 +27779,6 @@
|
|
|
27687
27779
|
}), element, uid());
|
|
27688
27780
|
}
|
|
27689
27781
|
|
|
27690
|
-
var $parcel$global =
|
|
27691
|
-
typeof globalThis !== 'undefined'
|
|
27692
|
-
? globalThis
|
|
27693
|
-
: typeof self !== 'undefined'
|
|
27694
|
-
? self
|
|
27695
|
-
: typeof window !== 'undefined'
|
|
27696
|
-
? window
|
|
27697
|
-
: typeof global !== 'undefined'
|
|
27698
|
-
? global
|
|
27699
|
-
: {};
|
|
27700
|
-
function $parcel$export(e, n, v, s) {
|
|
27701
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
27702
|
-
}
|
|
27703
|
-
|
|
27704
|
-
var $3e40d2fd7fdb47d2$exports = {};
|
|
27705
27782
|
/**
|
|
27706
27783
|
* Detect Element Resize.
|
|
27707
27784
|
* https://github.com/sdecima/javascript-detect-element-resize
|
|
@@ -27712,346 +27789,371 @@
|
|
|
27712
27789
|
* 2) Defer initialization code via a top-level function wrapper (to support SSR).
|
|
27713
27790
|
* 3) Avoid unnecessary reflows by not measuring size for scroll events bubbling from children.
|
|
27714
27791
|
* 4) Add nonce for style element.
|
|
27715
|
-
|
|
27716
|
-
|
|
27717
|
-
|
|
27718
|
-
|
|
27719
|
-
|
|
27720
|
-
|
|
27721
|
-
|
|
27722
|
-
|
|
27723
|
-
|
|
27724
|
-
|
|
27725
|
-
|
|
27726
|
-
|
|
27727
|
-
const $3e40d2fd7fdb47d2$var$requestAnimationFrameFn = $3e40d2fd7fdb47d2$var$windowObject.requestAnimationFrame || $3e40d2fd7fdb47d2$var$windowObject.mozRequestAnimationFrame || $3e40d2fd7fdb47d2$var$windowObject.webkitRequestAnimationFrame;
|
|
27728
|
-
if ($3e40d2fd7fdb47d2$var$cancelAnimationFrameFn == null || $3e40d2fd7fdb47d2$var$requestAnimationFrameFn == null) {
|
|
27729
|
-
// For environments that don't support animation frame,
|
|
27730
|
-
// fallback to a setTimeout based approach.
|
|
27731
|
-
$3e40d2fd7fdb47d2$var$cancelFrame = $3e40d2fd7fdb47d2$var$clearTimeoutFn;
|
|
27732
|
-
$3e40d2fd7fdb47d2$var$requestFrame = function requestAnimationFrameViaSetTimeout(callback) {
|
|
27733
|
-
return $3e40d2fd7fdb47d2$var$setTimeoutFn(callback, $3e40d2fd7fdb47d2$var$TIMEOUT_DURATION);
|
|
27734
|
-
};
|
|
27792
|
+
* 5) Use 'export' statement over 'module.exports' assignment
|
|
27793
|
+
**/
|
|
27794
|
+
|
|
27795
|
+
// Check `document` and `window` in case of server-side rendering
|
|
27796
|
+
let windowObject;
|
|
27797
|
+
if (typeof window !== "undefined") {
|
|
27798
|
+
windowObject = window;
|
|
27799
|
+
|
|
27800
|
+
// eslint-disable-next-line no-restricted-globals
|
|
27801
|
+
} else if (typeof self !== "undefined") {
|
|
27802
|
+
// eslint-disable-next-line no-restricted-globals
|
|
27803
|
+
windowObject = self;
|
|
27735
27804
|
} else {
|
|
27736
|
-
|
|
27737
|
-
|
|
27738
|
-
|
|
27739
|
-
|
|
27740
|
-
|
|
27741
|
-
|
|
27742
|
-
|
|
27743
|
-
|
|
27744
|
-
|
|
27745
|
-
|
|
27746
|
-
|
|
27747
|
-
|
|
27748
|
-
|
|
27749
|
-
|
|
27750
|
-
|
|
27751
|
-
|
|
27752
|
-
|
|
27753
|
-
|
|
27754
|
-
|
|
27755
|
-
|
|
27756
|
-
|
|
27757
|
-
|
|
27758
|
-
|
|
27759
|
-
|
|
27760
|
-
|
|
27761
|
-
|
|
27762
|
-
|
|
27763
|
-
|
|
27764
|
-
|
|
27765
|
-
|
|
27766
|
-
|
|
27767
|
-
|
|
27768
|
-
|
|
27769
|
-
|
|
27770
|
-
|
|
27771
|
-
|
|
27772
|
-
|
|
27773
|
-
|
|
27774
|
-
|
|
27775
|
-
|
|
27776
|
-
|
|
27777
|
-
|
|
27778
|
-
|
|
27779
|
-
|
|
27780
|
-
|
|
27781
|
-
|
|
27782
|
-
|
|
27783
|
-
|
|
27784
|
-
|
|
27785
|
-
|
|
27786
|
-
|
|
27787
|
-
|
|
27788
|
-
|
|
27789
|
-
|
|
27790
|
-
|
|
27791
|
-
|
|
27792
|
-
|
|
27793
|
-
}
|
|
27794
|
-
});
|
|
27795
|
-
};
|
|
27796
|
-
/* Detect CSS Animations support to detect element display/re-attach */ let animation = false;
|
|
27797
|
-
let keyframeprefix = "";
|
|
27798
|
-
animationStartEvent = "animationstart";
|
|
27799
|
-
const domPrefixes = "Webkit Moz O ms".split(" ");
|
|
27800
|
-
let startEvents = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" ");
|
|
27801
|
-
let pfx = "";
|
|
27802
|
-
{
|
|
27803
|
-
const elm = document.createElement("fakeelement");
|
|
27804
|
-
if (elm.style.animationName !== undefined) animation = true;
|
|
27805
|
-
if (animation === false) {
|
|
27806
|
-
for(let i = 0; i < domPrefixes.length; i++)if (elm.style[domPrefixes[i] + "AnimationName"] !== undefined) {
|
|
27807
|
-
pfx = domPrefixes[i];
|
|
27808
|
-
keyframeprefix = "-" + pfx.toLowerCase() + "-";
|
|
27809
|
-
animationStartEvent = startEvents[i];
|
|
27810
|
-
animation = true;
|
|
27811
|
-
break;
|
|
27812
|
-
}
|
|
27813
|
-
}
|
|
27814
|
-
}
|
|
27815
|
-
animationName = "resizeanim";
|
|
27816
|
-
animationKeyframes = "@" + keyframeprefix + "keyframes " + animationName + " { from { opacity: 0; } to { opacity: 0; } } ";
|
|
27817
|
-
animationStyle = keyframeprefix + "animation: 1ms " + animationName + "; ";
|
|
27818
|
-
}
|
|
27819
|
-
const createStyles = function(doc) {
|
|
27820
|
-
if (!doc.getElementById("detectElementResize")) {
|
|
27821
|
-
//opacity:0 works around a chrome bug https://code.google.com/p/chromium/issues/detail?id=286360
|
|
27822
|
-
const css = (animationKeyframes ? animationKeyframes : "") + ".resize-triggers { " + (animationStyle ? animationStyle : "") + "visibility: hidden; opacity: 0; } " + '.resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', head = doc.head || doc.getElementsByTagName("head")[0], style = doc.createElement("style");
|
|
27823
|
-
style.id = "detectElementResize";
|
|
27824
|
-
style.type = "text/css";
|
|
27825
|
-
if (nonce != null) style.setAttribute("nonce", nonce);
|
|
27826
|
-
if (style.styleSheet) style.styleSheet.cssText = css;
|
|
27827
|
-
else style.appendChild(doc.createTextNode(css));
|
|
27828
|
-
head.appendChild(style);
|
|
27829
|
-
}
|
|
27805
|
+
windowObject = global;
|
|
27806
|
+
}
|
|
27807
|
+
let cancelFrame = null;
|
|
27808
|
+
let requestFrame = null;
|
|
27809
|
+
const TIMEOUT_DURATION = 20;
|
|
27810
|
+
const clearTimeoutFn = windowObject.clearTimeout;
|
|
27811
|
+
const setTimeoutFn = windowObject.setTimeout;
|
|
27812
|
+
const cancelAnimationFrameFn = windowObject.cancelAnimationFrame || windowObject.mozCancelAnimationFrame || windowObject.webkitCancelAnimationFrame;
|
|
27813
|
+
const requestAnimationFrameFn = windowObject.requestAnimationFrame || windowObject.mozRequestAnimationFrame || windowObject.webkitRequestAnimationFrame;
|
|
27814
|
+
if (cancelAnimationFrameFn == null || requestAnimationFrameFn == null) {
|
|
27815
|
+
// For environments that don't support animation frame,
|
|
27816
|
+
// fallback to a setTimeout based approach.
|
|
27817
|
+
cancelFrame = clearTimeoutFn;
|
|
27818
|
+
requestFrame = function requestAnimationFrameViaSetTimeout(callback) {
|
|
27819
|
+
return setTimeoutFn(callback, TIMEOUT_DURATION);
|
|
27820
|
+
};
|
|
27821
|
+
} else {
|
|
27822
|
+
// Counter intuitively, environments that support animation frames can be trickier.
|
|
27823
|
+
// Chrome's "Throttle non-visible cross-origin iframes" flag can prevent rAFs from being called.
|
|
27824
|
+
// In this case, we should fallback to a setTimeout() implementation.
|
|
27825
|
+
cancelFrame = function cancelFrame([animationFrameID, timeoutID]) {
|
|
27826
|
+
cancelAnimationFrameFn(animationFrameID);
|
|
27827
|
+
clearTimeoutFn(timeoutID);
|
|
27828
|
+
};
|
|
27829
|
+
requestFrame = function requestAnimationFrameWithSetTimeoutFallback(callback) {
|
|
27830
|
+
const animationFrameID = requestAnimationFrameFn(function animationFrameCallback() {
|
|
27831
|
+
clearTimeoutFn(timeoutID);
|
|
27832
|
+
callback();
|
|
27833
|
+
});
|
|
27834
|
+
const timeoutID = setTimeoutFn(function timeoutCallback() {
|
|
27835
|
+
cancelAnimationFrameFn(animationFrameID);
|
|
27836
|
+
callback();
|
|
27837
|
+
}, TIMEOUT_DURATION);
|
|
27838
|
+
return [animationFrameID, timeoutID];
|
|
27839
|
+
};
|
|
27840
|
+
}
|
|
27841
|
+
function createDetectElementResize(nonce) {
|
|
27842
|
+
let animationKeyframes;
|
|
27843
|
+
let animationName;
|
|
27844
|
+
let animationStartEvent;
|
|
27845
|
+
let animationStyle;
|
|
27846
|
+
let checkTriggers;
|
|
27847
|
+
let resetTriggers;
|
|
27848
|
+
let scrollListener;
|
|
27849
|
+
const attachEvent = typeof document !== "undefined" && document.attachEvent;
|
|
27850
|
+
if (!attachEvent) {
|
|
27851
|
+
resetTriggers = function (element) {
|
|
27852
|
+
const triggers = element.__resizeTriggers__,
|
|
27853
|
+
expand = triggers.firstElementChild,
|
|
27854
|
+
contract = triggers.lastElementChild,
|
|
27855
|
+
expandChild = expand.firstElementChild;
|
|
27856
|
+
contract.scrollLeft = contract.scrollWidth;
|
|
27857
|
+
contract.scrollTop = contract.scrollHeight;
|
|
27858
|
+
expandChild.style.width = expand.offsetWidth + 1 + "px";
|
|
27859
|
+
expandChild.style.height = expand.offsetHeight + 1 + "px";
|
|
27860
|
+
expand.scrollLeft = expand.scrollWidth;
|
|
27861
|
+
expand.scrollTop = expand.scrollHeight;
|
|
27830
27862
|
};
|
|
27831
|
-
|
|
27832
|
-
|
|
27833
|
-
else {
|
|
27834
|
-
if (!element.__resizeTriggers__) {
|
|
27835
|
-
const doc = element.ownerDocument;
|
|
27836
|
-
const elementStyle = $3e40d2fd7fdb47d2$var$windowObject.getComputedStyle(element);
|
|
27837
|
-
if (elementStyle && elementStyle.position === "static") element.style.position = "relative";
|
|
27838
|
-
createStyles(doc);
|
|
27839
|
-
element.__resizeLast__ = {};
|
|
27840
|
-
element.__resizeListeners__ = [];
|
|
27841
|
-
(element.__resizeTriggers__ = doc.createElement("div")).className = "resize-triggers";
|
|
27842
|
-
const expandTrigger = doc.createElement("div");
|
|
27843
|
-
expandTrigger.className = "expand-trigger";
|
|
27844
|
-
expandTrigger.appendChild(doc.createElement("div"));
|
|
27845
|
-
const contractTrigger = doc.createElement("div");
|
|
27846
|
-
contractTrigger.className = "contract-trigger";
|
|
27847
|
-
element.__resizeTriggers__.appendChild(expandTrigger);
|
|
27848
|
-
element.__resizeTriggers__.appendChild(contractTrigger);
|
|
27849
|
-
element.appendChild(element.__resizeTriggers__);
|
|
27850
|
-
resetTriggers(element);
|
|
27851
|
-
element.addEventListener("scroll", scrollListener, true);
|
|
27852
|
-
/* Listen for a css animation to detect element display/re-attach */ if (animationStartEvent) {
|
|
27853
|
-
element.__resizeTriggers__.__animationListener__ = function animationListener(e) {
|
|
27854
|
-
if (e.animationName === animationName) resetTriggers(element);
|
|
27855
|
-
};
|
|
27856
|
-
element.__resizeTriggers__.addEventListener(animationStartEvent, element.__resizeTriggers__.__animationListener__);
|
|
27857
|
-
}
|
|
27858
|
-
}
|
|
27859
|
-
element.__resizeListeners__.push(fn);
|
|
27860
|
-
}
|
|
27863
|
+
checkTriggers = function (element) {
|
|
27864
|
+
return element.offsetWidth !== element.__resizeLast__.width || element.offsetHeight !== element.__resizeLast__.height;
|
|
27861
27865
|
};
|
|
27862
|
-
|
|
27863
|
-
|
|
27864
|
-
|
|
27865
|
-
|
|
27866
|
-
|
|
27867
|
-
|
|
27868
|
-
|
|
27869
|
-
|
|
27870
|
-
|
|
27871
|
-
|
|
27872
|
-
|
|
27873
|
-
|
|
27874
|
-
|
|
27875
|
-
|
|
27876
|
-
|
|
27877
|
-
|
|
27866
|
+
scrollListener = function (e) {
|
|
27867
|
+
// Don't measure (which forces) reflow for scrolls that happen inside of children!
|
|
27868
|
+
if (e.target.className && typeof e.target.className.indexOf === "function" && e.target.className.indexOf("contract-trigger") < 0 && e.target.className.indexOf("expand-trigger") < 0) {
|
|
27869
|
+
return;
|
|
27870
|
+
}
|
|
27871
|
+
const element = this;
|
|
27872
|
+
resetTriggers(this);
|
|
27873
|
+
if (this.__resizeRAF__) {
|
|
27874
|
+
cancelFrame(this.__resizeRAF__);
|
|
27875
|
+
}
|
|
27876
|
+
this.__resizeRAF__ = requestFrame(function animationFrame() {
|
|
27877
|
+
if (checkTriggers(element)) {
|
|
27878
|
+
element.__resizeLast__.width = element.offsetWidth;
|
|
27879
|
+
element.__resizeLast__.height = element.offsetHeight;
|
|
27880
|
+
element.__resizeListeners__.forEach(function forEachResizeListener(fn) {
|
|
27881
|
+
fn.call(element, e);
|
|
27882
|
+
});
|
|
27878
27883
|
}
|
|
27884
|
+
});
|
|
27879
27885
|
};
|
|
27880
|
-
return {
|
|
27881
|
-
addResizeListener: addResizeListener,
|
|
27882
|
-
removeResizeListener: removeResizeListener
|
|
27883
|
-
};
|
|
27884
|
-
}
|
|
27885
|
-
$3e40d2fd7fdb47d2$exports = {
|
|
27886
|
-
createDetectElementResize: $3e40d2fd7fdb47d2$var$createDetectElementResize
|
|
27887
|
-
};
|
|
27888
27886
|
|
|
27889
|
-
|
|
27890
|
-
|
|
27891
|
-
|
|
27892
|
-
|
|
27893
|
-
|
|
27894
|
-
|
|
27895
|
-
|
|
27896
|
-
|
|
27897
|
-
|
|
27898
|
-
|
|
27899
|
-
|
|
27900
|
-
|
|
27901
|
-
|
|
27902
|
-
|
|
27903
|
-
|
|
27904
|
-
|
|
27905
|
-
|
|
27906
|
-
|
|
27907
|
-
|
|
27908
|
-
|
|
27909
|
-
|
|
27910
|
-
if (typeof res !== "object") return res;
|
|
27911
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
27912
|
-
}
|
|
27913
|
-
return (hint === "string" ? String : Number)(input);
|
|
27914
|
-
}
|
|
27915
|
-
class $6e2bb92d9db3b0c8$export$9d94f4ee1d930ff extends (reactExports.Component) {
|
|
27916
|
-
constructor(...args){
|
|
27917
|
-
super(...args);
|
|
27918
|
-
$6e2bb92d9db3b0c8$var$_defineProperty(this, "state", {
|
|
27919
|
-
height: this.props.defaultHeight || 0,
|
|
27920
|
-
scaledHeight: this.props.defaultHeight || 0,
|
|
27921
|
-
scaledWidth: this.props.defaultWidth || 0,
|
|
27922
|
-
width: this.props.defaultWidth || 0
|
|
27923
|
-
});
|
|
27924
|
-
$6e2bb92d9db3b0c8$var$_defineProperty(this, "_autoSizer", null);
|
|
27925
|
-
$6e2bb92d9db3b0c8$var$_defineProperty(this, "_detectElementResize", null);
|
|
27926
|
-
$6e2bb92d9db3b0c8$var$_defineProperty(this, "_parentNode", null);
|
|
27927
|
-
$6e2bb92d9db3b0c8$var$_defineProperty(this, "_resizeObserver", null);
|
|
27928
|
-
$6e2bb92d9db3b0c8$var$_defineProperty(this, "_onResize", ()=>{
|
|
27929
|
-
const { disableHeight: disableHeight , disableWidth: disableWidth , onResize: onResize } = this.props;
|
|
27930
|
-
if (this._parentNode) {
|
|
27931
|
-
var _style$paddingLeft, _style$paddingRight, _style$paddingTop, _style$paddingBottom;
|
|
27932
|
-
// Guard against AutoSizer component being removed from the DOM immediately after being added.
|
|
27933
|
-
// This can result in invalid style values which can result in NaN values if we don't handle them.
|
|
27934
|
-
// See issue #150 for more context.
|
|
27935
|
-
const style = window.getComputedStyle(this._parentNode) || {};
|
|
27936
|
-
const paddingLeft = parseFloat((_style$paddingLeft = style.paddingLeft) !== null && _style$paddingLeft !== void 0 ? _style$paddingLeft : "0");
|
|
27937
|
-
const paddingRight = parseFloat((_style$paddingRight = style.paddingRight) !== null && _style$paddingRight !== void 0 ? _style$paddingRight : "0");
|
|
27938
|
-
const paddingTop = parseFloat((_style$paddingTop = style.paddingTop) !== null && _style$paddingTop !== void 0 ? _style$paddingTop : "0");
|
|
27939
|
-
const paddingBottom = parseFloat((_style$paddingBottom = style.paddingBottom) !== null && _style$paddingBottom !== void 0 ? _style$paddingBottom : "0");
|
|
27940
|
-
const rect = this._parentNode.getBoundingClientRect();
|
|
27941
|
-
const scaledHeight = rect.height - paddingTop - paddingBottom;
|
|
27942
|
-
const scaledWidth = rect.width - paddingLeft - paddingRight;
|
|
27943
|
-
const height = this._parentNode.offsetHeight - paddingTop - paddingBottom;
|
|
27944
|
-
const width = this._parentNode.offsetWidth - paddingLeft - paddingRight;
|
|
27945
|
-
if (!disableHeight && (this.state.height !== height || this.state.scaledHeight !== scaledHeight) || !disableWidth && (this.state.width !== width || this.state.scaledWidth !== scaledWidth)) {
|
|
27946
|
-
this.setState({
|
|
27947
|
-
height: height,
|
|
27948
|
-
width: width,
|
|
27949
|
-
scaledHeight: scaledHeight,
|
|
27950
|
-
scaledWidth: scaledWidth
|
|
27951
|
-
});
|
|
27952
|
-
if (typeof onResize === "function") onResize({
|
|
27953
|
-
height: height,
|
|
27954
|
-
scaledHeight: scaledHeight,
|
|
27955
|
-
scaledWidth: scaledWidth,
|
|
27956
|
-
width: width
|
|
27957
|
-
});
|
|
27958
|
-
}
|
|
27959
|
-
}
|
|
27960
|
-
});
|
|
27961
|
-
$6e2bb92d9db3b0c8$var$_defineProperty(this, "_setRef", (autoSizer)=>{
|
|
27962
|
-
this._autoSizer = autoSizer;
|
|
27963
|
-
});
|
|
27964
|
-
}
|
|
27965
|
-
componentDidMount() {
|
|
27966
|
-
const { nonce: nonce } = this.props;
|
|
27967
|
-
if (this._autoSizer && this._autoSizer.parentNode && this._autoSizer.parentNode.ownerDocument && this._autoSizer.parentNode.ownerDocument.defaultView && this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement) {
|
|
27968
|
-
// Delay access of parentNode until mount.
|
|
27969
|
-
// This handles edge-cases where the component has already been unmounted before its ref has been set,
|
|
27970
|
-
// As well as libraries like react-lite which have a slightly different lifecycle.
|
|
27971
|
-
this._parentNode = this._autoSizer.parentNode;
|
|
27972
|
-
// Defer requiring resize handler in order to support server-side rendering.
|
|
27973
|
-
// See issue #41
|
|
27974
|
-
if (this._parentNode != null) {
|
|
27975
|
-
if (typeof ResizeObserver !== "undefined") {
|
|
27976
|
-
this._resizeObserver = new ResizeObserver(()=>{
|
|
27977
|
-
// Guard against "ResizeObserver loop limit exceeded" error;
|
|
27978
|
-
// could be triggered if the state update causes the ResizeObserver handler to run long.
|
|
27979
|
-
// See https://github.com/bvaughn/react-virtualized-auto-sizer/issues/55
|
|
27980
|
-
setTimeout(this._onResize, 0);
|
|
27981
|
-
});
|
|
27982
|
-
this._resizeObserver.observe(this._parentNode);
|
|
27983
|
-
} else {
|
|
27984
|
-
this._detectElementResize = (0, $3e40d2fd7fdb47d2$exports.createDetectElementResize)(nonce);
|
|
27985
|
-
this._detectElementResize.addResizeListener(this._parentNode, this._onResize);
|
|
27986
|
-
}
|
|
27987
|
-
this._onResize();
|
|
27988
|
-
}
|
|
27887
|
+
/* Detect CSS Animations support to detect element display/re-attach */
|
|
27888
|
+
let animation = false;
|
|
27889
|
+
let keyframeprefix = "";
|
|
27890
|
+
animationStartEvent = "animationstart";
|
|
27891
|
+
const domPrefixes = "Webkit Moz O ms".split(" ");
|
|
27892
|
+
let startEvents = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" ");
|
|
27893
|
+
let pfx = "";
|
|
27894
|
+
{
|
|
27895
|
+
const elm = document.createElement("fakeelement");
|
|
27896
|
+
if (elm.style.animationName !== undefined) {
|
|
27897
|
+
animation = true;
|
|
27898
|
+
}
|
|
27899
|
+
if (animation === false) {
|
|
27900
|
+
for (let i = 0; i < domPrefixes.length; i++) {
|
|
27901
|
+
if (elm.style[domPrefixes[i] + "AnimationName"] !== undefined) {
|
|
27902
|
+
pfx = domPrefixes[i];
|
|
27903
|
+
keyframeprefix = "-" + pfx.toLowerCase() + "-";
|
|
27904
|
+
animationStartEvent = startEvents[i];
|
|
27905
|
+
animation = true;
|
|
27906
|
+
break;
|
|
27907
|
+
}
|
|
27989
27908
|
}
|
|
27909
|
+
}
|
|
27990
27910
|
}
|
|
27991
|
-
|
|
27992
|
-
|
|
27993
|
-
|
|
27994
|
-
|
|
27995
|
-
|
|
27996
|
-
|
|
27911
|
+
animationName = "resizeanim";
|
|
27912
|
+
animationKeyframes = "@" + keyframeprefix + "keyframes " + animationName + " { from { opacity: 0; } to { opacity: 0; } } ";
|
|
27913
|
+
animationStyle = keyframeprefix + "animation: 1ms " + animationName + "; ";
|
|
27914
|
+
}
|
|
27915
|
+
const createStyles = function (doc) {
|
|
27916
|
+
if (!doc.getElementById("detectElementResize")) {
|
|
27917
|
+
//opacity:0 works around a chrome bug https://code.google.com/p/chromium/issues/detail?id=286360
|
|
27918
|
+
const css = (animationKeyframes ? animationKeyframes : "") + ".resize-triggers { " + (animationStyle ? animationStyle : "") + "visibility: hidden; opacity: 0; } " + '.resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',
|
|
27919
|
+
head = doc.head || doc.getElementsByTagName("head")[0],
|
|
27920
|
+
style = doc.createElement("style");
|
|
27921
|
+
style.id = "detectElementResize";
|
|
27922
|
+
style.type = "text/css";
|
|
27923
|
+
if (nonce != null) {
|
|
27924
|
+
style.setAttribute("nonce", nonce);
|
|
27925
|
+
}
|
|
27926
|
+
if (style.styleSheet) {
|
|
27927
|
+
style.styleSheet.cssText = css;
|
|
27928
|
+
} else {
|
|
27929
|
+
style.appendChild(doc.createTextNode(css));
|
|
27930
|
+
}
|
|
27931
|
+
head.appendChild(style);
|
|
27932
|
+
}
|
|
27933
|
+
};
|
|
27934
|
+
const addResizeListener = function (element, fn) {
|
|
27935
|
+
if (attachEvent) {
|
|
27936
|
+
element.attachEvent("onresize", fn);
|
|
27937
|
+
} else {
|
|
27938
|
+
if (!element.__resizeTriggers__) {
|
|
27939
|
+
const doc = element.ownerDocument;
|
|
27940
|
+
const elementStyle = windowObject.getComputedStyle(element);
|
|
27941
|
+
if (elementStyle && elementStyle.position === "static") {
|
|
27942
|
+
element.style.position = "relative";
|
|
27943
|
+
}
|
|
27944
|
+
createStyles(doc);
|
|
27945
|
+
element.__resizeLast__ = {};
|
|
27946
|
+
element.__resizeListeners__ = [];
|
|
27947
|
+
(element.__resizeTriggers__ = doc.createElement("div")).className = "resize-triggers";
|
|
27948
|
+
const expandTrigger = doc.createElement("div");
|
|
27949
|
+
expandTrigger.className = "expand-trigger";
|
|
27950
|
+
expandTrigger.appendChild(doc.createElement("div"));
|
|
27951
|
+
const contractTrigger = doc.createElement("div");
|
|
27952
|
+
contractTrigger.className = "contract-trigger";
|
|
27953
|
+
element.__resizeTriggers__.appendChild(expandTrigger);
|
|
27954
|
+
element.__resizeTriggers__.appendChild(contractTrigger);
|
|
27955
|
+
element.appendChild(element.__resizeTriggers__);
|
|
27956
|
+
resetTriggers(element);
|
|
27957
|
+
element.addEventListener("scroll", scrollListener, true);
|
|
27958
|
+
|
|
27959
|
+
/* Listen for a css animation to detect element display/re-attach */
|
|
27960
|
+
if (animationStartEvent) {
|
|
27961
|
+
element.__resizeTriggers__.__animationListener__ = function animationListener(e) {
|
|
27962
|
+
if (e.animationName === animationName) {
|
|
27963
|
+
resetTriggers(element);
|
|
27997
27964
|
}
|
|
27965
|
+
};
|
|
27966
|
+
element.__resizeTriggers__.addEventListener(animationStartEvent, element.__resizeTriggers__.__animationListener__);
|
|
27998
27967
|
}
|
|
27968
|
+
}
|
|
27969
|
+
element.__resizeListeners__.push(fn);
|
|
27999
27970
|
}
|
|
28000
|
-
|
|
28001
|
-
|
|
28002
|
-
|
|
28003
|
-
|
|
28004
|
-
|
|
28005
|
-
|
|
28006
|
-
|
|
28007
|
-
|
|
28008
|
-
|
|
28009
|
-
|
|
28010
|
-
|
|
28011
|
-
// At best this would just be wasting cycles.
|
|
28012
|
-
let bailoutOnChildren = false;
|
|
28013
|
-
if (!disableHeight) {
|
|
28014
|
-
if (height === 0) bailoutOnChildren = true;
|
|
28015
|
-
outerStyle.height = 0;
|
|
28016
|
-
childParams.height = height;
|
|
28017
|
-
childParams.scaledHeight = scaledHeight;
|
|
27971
|
+
};
|
|
27972
|
+
const removeResizeListener = function (element, fn) {
|
|
27973
|
+
if (attachEvent) {
|
|
27974
|
+
element.detachEvent("onresize", fn);
|
|
27975
|
+
} else {
|
|
27976
|
+
element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1);
|
|
27977
|
+
if (!element.__resizeListeners__.length) {
|
|
27978
|
+
element.removeEventListener("scroll", scrollListener, true);
|
|
27979
|
+
if (element.__resizeTriggers__.__animationListener__) {
|
|
27980
|
+
element.__resizeTriggers__.removeEventListener(animationStartEvent, element.__resizeTriggers__.__animationListener__);
|
|
27981
|
+
element.__resizeTriggers__.__animationListener__ = null;
|
|
28018
27982
|
}
|
|
28019
|
-
|
|
28020
|
-
|
|
28021
|
-
|
|
28022
|
-
|
|
28023
|
-
childParams.scaledWidth = scaledWidth;
|
|
27983
|
+
try {
|
|
27984
|
+
element.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__);
|
|
27985
|
+
} catch (e) {
|
|
27986
|
+
// Preact compat; see developit/preact-compat/issues/228
|
|
28024
27987
|
}
|
|
28025
|
-
|
|
28026
|
-
ref: this._setRef,
|
|
28027
|
-
style: {
|
|
28028
|
-
...outerStyle,
|
|
28029
|
-
...style
|
|
28030
|
-
},
|
|
28031
|
-
...rest
|
|
28032
|
-
}, !bailoutOnChildren && children(childParams));
|
|
27988
|
+
}
|
|
28033
27989
|
}
|
|
27990
|
+
};
|
|
27991
|
+
return {
|
|
27992
|
+
addResizeListener,
|
|
27993
|
+
removeResizeListener
|
|
27994
|
+
};
|
|
28034
27995
|
}
|
|
28035
27996
|
|
|
27997
|
+
class AutoSizer extends reactExports.Component {
|
|
27998
|
+
constructor(...args) {
|
|
27999
|
+
super(...args);
|
|
28000
|
+
this.state = {
|
|
28001
|
+
height: this.props.defaultHeight || 0,
|
|
28002
|
+
scaledHeight: this.props.defaultHeight || 0,
|
|
28003
|
+
scaledWidth: this.props.defaultWidth || 0,
|
|
28004
|
+
width: this.props.defaultWidth || 0
|
|
28005
|
+
};
|
|
28006
|
+
this._autoSizer = null;
|
|
28007
|
+
this._detectElementResize = null;
|
|
28008
|
+
this._parentNode = null;
|
|
28009
|
+
this._resizeObserver = null;
|
|
28010
|
+
this._timeoutId = null;
|
|
28011
|
+
this._onResize = () => {
|
|
28012
|
+
this._timeoutId = null;
|
|
28013
|
+
const {
|
|
28014
|
+
disableHeight,
|
|
28015
|
+
disableWidth,
|
|
28016
|
+
onResize
|
|
28017
|
+
} = this.props;
|
|
28018
|
+
if (this._parentNode) {
|
|
28019
|
+
var _style$paddingLeft, _style$paddingRight, _style$paddingTop, _style$paddingBottom;
|
|
28020
|
+
// Guard against AutoSizer component being removed from the DOM immediately after being added.
|
|
28021
|
+
// This can result in invalid style values which can result in NaN values if we don't handle them.
|
|
28022
|
+
// See issue #150 for more context.
|
|
28023
|
+
|
|
28024
|
+
const style = window.getComputedStyle(this._parentNode) || {};
|
|
28025
|
+
const paddingLeft = parseFloat((_style$paddingLeft = style.paddingLeft) !== null && _style$paddingLeft !== void 0 ? _style$paddingLeft : "0");
|
|
28026
|
+
const paddingRight = parseFloat((_style$paddingRight = style.paddingRight) !== null && _style$paddingRight !== void 0 ? _style$paddingRight : "0");
|
|
28027
|
+
const paddingTop = parseFloat((_style$paddingTop = style.paddingTop) !== null && _style$paddingTop !== void 0 ? _style$paddingTop : "0");
|
|
28028
|
+
const paddingBottom = parseFloat((_style$paddingBottom = style.paddingBottom) !== null && _style$paddingBottom !== void 0 ? _style$paddingBottom : "0");
|
|
28029
|
+
const rect = this._parentNode.getBoundingClientRect();
|
|
28030
|
+
const scaledHeight = rect.height - paddingTop - paddingBottom;
|
|
28031
|
+
const scaledWidth = rect.width - paddingLeft - paddingRight;
|
|
28032
|
+
const height = this._parentNode.offsetHeight - paddingTop - paddingBottom;
|
|
28033
|
+
const width = this._parentNode.offsetWidth - paddingLeft - paddingRight;
|
|
28034
|
+
if (!disableHeight && (this.state.height !== height || this.state.scaledHeight !== scaledHeight) || !disableWidth && (this.state.width !== width || this.state.scaledWidth !== scaledWidth)) {
|
|
28035
|
+
this.setState({
|
|
28036
|
+
height,
|
|
28037
|
+
width,
|
|
28038
|
+
scaledHeight,
|
|
28039
|
+
scaledWidth
|
|
28040
|
+
});
|
|
28041
|
+
if (typeof onResize === "function") {
|
|
28042
|
+
onResize({
|
|
28043
|
+
height,
|
|
28044
|
+
scaledHeight,
|
|
28045
|
+
scaledWidth,
|
|
28046
|
+
width
|
|
28047
|
+
});
|
|
28048
|
+
}
|
|
28049
|
+
}
|
|
28050
|
+
}
|
|
28051
|
+
};
|
|
28052
|
+
this._setRef = autoSizer => {
|
|
28053
|
+
this._autoSizer = autoSizer;
|
|
28054
|
+
};
|
|
28055
|
+
}
|
|
28056
|
+
componentDidMount() {
|
|
28057
|
+
const {
|
|
28058
|
+
nonce
|
|
28059
|
+
} = this.props;
|
|
28060
|
+
if (this._autoSizer && this._autoSizer.parentNode && this._autoSizer.parentNode.ownerDocument && this._autoSizer.parentNode.ownerDocument.defaultView && this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement) {
|
|
28061
|
+
// Delay access of parentNode until mount.
|
|
28062
|
+
// This handles edge-cases where the component has already been unmounted before its ref has been set,
|
|
28063
|
+
// As well as libraries like react-lite which have a slightly different lifecycle.
|
|
28064
|
+
this._parentNode = this._autoSizer.parentNode;
|
|
28065
|
+
|
|
28066
|
+
// Defer requiring resize handler in order to support server-side rendering.
|
|
28067
|
+
// See issue #41
|
|
28068
|
+
if (this._parentNode != null) {
|
|
28069
|
+
if (typeof ResizeObserver !== "undefined") {
|
|
28070
|
+
this._resizeObserver = new ResizeObserver(() => {
|
|
28071
|
+
// Guard against "ResizeObserver loop limit exceeded" error;
|
|
28072
|
+
// could be triggered if the state update causes the ResizeObserver handler to run long.
|
|
28073
|
+
// See https://github.com/bvaughn/react-virtualized-auto-sizer/issues/55
|
|
28074
|
+
this._timeoutId = setTimeout(this._onResize, 0);
|
|
28075
|
+
});
|
|
28076
|
+
this._resizeObserver.observe(this._parentNode);
|
|
28077
|
+
} else {
|
|
28078
|
+
this._detectElementResize = createDetectElementResize(nonce);
|
|
28079
|
+
this._detectElementResize.addResizeListener(this._parentNode, this._onResize);
|
|
28080
|
+
}
|
|
28081
|
+
this._onResize();
|
|
28082
|
+
}
|
|
28083
|
+
}
|
|
28084
|
+
}
|
|
28085
|
+
componentWillUnmount() {
|
|
28086
|
+
if (this._parentNode) {
|
|
28087
|
+
if (this._detectElementResize) {
|
|
28088
|
+
this._detectElementResize.removeResizeListener(this._parentNode, this._onResize);
|
|
28089
|
+
}
|
|
28090
|
+
if (this._timeoutId !== null) {
|
|
28091
|
+
clearTimeout(this._timeoutId);
|
|
28092
|
+
}
|
|
28093
|
+
if (this._resizeObserver) {
|
|
28094
|
+
this._resizeObserver.observe(this._parentNode);
|
|
28095
|
+
this._resizeObserver.disconnect();
|
|
28096
|
+
}
|
|
28097
|
+
}
|
|
28098
|
+
}
|
|
28099
|
+
render() {
|
|
28100
|
+
const {
|
|
28101
|
+
children,
|
|
28102
|
+
defaultHeight,
|
|
28103
|
+
defaultWidth,
|
|
28104
|
+
disableHeight = false,
|
|
28105
|
+
disableWidth = false,
|
|
28106
|
+
nonce,
|
|
28107
|
+
onResize,
|
|
28108
|
+
style = {},
|
|
28109
|
+
tagName = "div",
|
|
28110
|
+
...rest
|
|
28111
|
+
} = this.props;
|
|
28112
|
+
const {
|
|
28113
|
+
height,
|
|
28114
|
+
scaledHeight,
|
|
28115
|
+
scaledWidth,
|
|
28116
|
+
width
|
|
28117
|
+
} = this.state;
|
|
28036
28118
|
|
|
28037
|
-
|
|
28119
|
+
// Outer div should not force width/height since that may prevent containers from shrinking.
|
|
28120
|
+
// Inner component should overflow and use calculated width/height.
|
|
28121
|
+
// See issue #68 for more information.
|
|
28122
|
+
const outerStyle = {
|
|
28123
|
+
overflow: "visible"
|
|
28124
|
+
};
|
|
28125
|
+
const childParams = {};
|
|
28038
28126
|
|
|
28039
|
-
|
|
28040
|
-
|
|
28041
|
-
|
|
28042
|
-
|
|
28043
|
-
|
|
28044
|
-
|
|
28045
|
-
|
|
28046
|
-
|
|
28047
|
-
|
|
28048
|
-
|
|
28049
|
-
|
|
28127
|
+
// Avoid rendering children before the initial measurements have been collected.
|
|
28128
|
+
// At best this would just be wasting cycles.
|
|
28129
|
+
let bailoutOnChildren = false;
|
|
28130
|
+
if (!disableHeight) {
|
|
28131
|
+
if (height === 0) {
|
|
28132
|
+
bailoutOnChildren = true;
|
|
28133
|
+
}
|
|
28134
|
+
outerStyle.height = 0;
|
|
28135
|
+
childParams.height = height;
|
|
28136
|
+
childParams.scaledHeight = scaledHeight;
|
|
28137
|
+
}
|
|
28138
|
+
if (!disableWidth) {
|
|
28139
|
+
if (width === 0) {
|
|
28140
|
+
bailoutOnChildren = true;
|
|
28141
|
+
}
|
|
28142
|
+
outerStyle.width = 0;
|
|
28143
|
+
childParams.width = width;
|
|
28144
|
+
childParams.scaledWidth = scaledWidth;
|
|
28145
|
+
}
|
|
28146
|
+
return reactExports.createElement(tagName, {
|
|
28147
|
+
ref: this._setRef,
|
|
28148
|
+
style: {
|
|
28149
|
+
...outerStyle,
|
|
28150
|
+
...style
|
|
28151
|
+
},
|
|
28152
|
+
...rest
|
|
28153
|
+
}, !bailoutOnChildren && children(childParams));
|
|
28154
|
+
}
|
|
28050
28155
|
}
|
|
28051
28156
|
|
|
28052
|
-
|
|
28053
|
-
var $149c1bd638913645$export$2e2bcd8739ae039 = ($6e2bb92d9db3b0c8$export$9d94f4ee1d930ff);
|
|
28054
|
-
|
|
28055
28157
|
const drillDown = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
28056
28158
|
shapes: [{
|
|
28057
28159
|
type: 'path',
|
|
@@ -28802,7 +28904,7 @@
|
|
|
28802
28904
|
className: classes$4.screenReaderOnly
|
|
28803
28905
|
}, translator.get('Listbox.ScreenReaderInstructions')), isInvalid ? /*#__PURE__*/React.createElement(ListBoxError, {
|
|
28804
28906
|
text: errorText
|
|
28805
|
-
}) : /*#__PURE__*/React.createElement(
|
|
28907
|
+
}) : /*#__PURE__*/React.createElement(AutoSizer, null, _ref5 => {
|
|
28806
28908
|
let {
|
|
28807
28909
|
height,
|
|
28808
28910
|
width
|
|
@@ -28810,6 +28912,7 @@
|
|
|
28810
28912
|
return /*#__PURE__*/React.createElement(ListBox, {
|
|
28811
28913
|
model: model,
|
|
28812
28914
|
app: app,
|
|
28915
|
+
theme: theme,
|
|
28813
28916
|
constraints: constraints,
|
|
28814
28917
|
layout: layout,
|
|
28815
28918
|
selections: selections,
|
|
@@ -29085,6 +29188,14 @@
|
|
|
29085
29188
|
const [model, setModel] = reactExports.useState();
|
|
29086
29189
|
const [fallbackTitle, setFallbackTitle] = reactExports.useState();
|
|
29087
29190
|
const title = (_options$title = options.title) !== null && _options$title !== void 0 ? _options$title : fallbackTitle;
|
|
29191
|
+
let {
|
|
29192
|
+
histogram = false,
|
|
29193
|
+
frequencyMode = 'N'
|
|
29194
|
+
} = options;
|
|
29195
|
+
if (fieldDef && fieldDef.failedToFetchFieldDef) {
|
|
29196
|
+
histogram = false;
|
|
29197
|
+
frequencyMode = 'N';
|
|
29198
|
+
}
|
|
29088
29199
|
reactExports.useEffect(() => {
|
|
29089
29200
|
async function fetchMasterItem() {
|
|
29090
29201
|
try {
|
|
@@ -29107,7 +29218,7 @@
|
|
|
29107
29218
|
throw new Error("Disabling frequency count and histogram: ".concat(e && e.message));
|
|
29108
29219
|
}
|
|
29109
29220
|
}
|
|
29110
|
-
const isFrequencyMaxNeeded =
|
|
29221
|
+
const isFrequencyMaxNeeded = histogram || frequencyMode !== 'N';
|
|
29111
29222
|
const shouldFetchMasterItem = fieldIdentifier.qLibraryId && isFrequencyMaxNeeded;
|
|
29112
29223
|
if (shouldFetchMasterItem) {
|
|
29113
29224
|
fetchMasterItem();
|
|
@@ -29122,31 +29233,6 @@
|
|
|
29122
29233
|
listLayout,
|
|
29123
29234
|
properties = {}
|
|
29124
29235
|
} = options;
|
|
29125
|
-
let {
|
|
29126
|
-
frequencyMode,
|
|
29127
|
-
histogram = false
|
|
29128
|
-
} = options;
|
|
29129
|
-
if (fieldDef && fieldDef.failedToFetchFieldDef) {
|
|
29130
|
-
histogram = false;
|
|
29131
|
-
frequencyMode = 'N';
|
|
29132
|
-
}
|
|
29133
|
-
switch (true) {
|
|
29134
|
-
case ['none', 'N', 'NX_FREQUENCY_NONE'].includes(frequencyMode):
|
|
29135
|
-
frequencyMode = 'N';
|
|
29136
|
-
break;
|
|
29137
|
-
case ['value', 'V', 'NX_FREQUENCY_VALUE', 'default'].includes(frequencyMode):
|
|
29138
|
-
frequencyMode = 'V';
|
|
29139
|
-
break;
|
|
29140
|
-
case ['percent', 'P', 'NX_FREQUENCY_PERCENT'].includes(frequencyMode):
|
|
29141
|
-
frequencyMode = 'P';
|
|
29142
|
-
break;
|
|
29143
|
-
case ['relative', 'R', 'NX_FREQUENCY_RELATIVE'].includes(frequencyMode):
|
|
29144
|
-
frequencyMode = 'R';
|
|
29145
|
-
break;
|
|
29146
|
-
default:
|
|
29147
|
-
frequencyMode = 'N';
|
|
29148
|
-
break;
|
|
29149
|
-
}
|
|
29150
29236
|
const getListdefFrequencyMode = () => histogram && frequencyMode === 'N' ? 'V' : frequencyMode;
|
|
29151
29237
|
const layoutOptions = {
|
|
29152
29238
|
dense
|
|
@@ -29224,6 +29310,28 @@
|
|
|
29224
29310
|
};
|
|
29225
29311
|
}
|
|
29226
29312
|
|
|
29313
|
+
function getFrequencyModeLetter(frequencyMode) {
|
|
29314
|
+
let freqLetter;
|
|
29315
|
+
switch (true) {
|
|
29316
|
+
case ['none', 'N', 'NX_FREQUENCY_NONE'].includes(frequencyMode):
|
|
29317
|
+
freqLetter = 'N';
|
|
29318
|
+
break;
|
|
29319
|
+
case ['value', 'V', 'NX_FREQUENCY_VALUE', 'default'].includes(frequencyMode):
|
|
29320
|
+
freqLetter = 'V';
|
|
29321
|
+
break;
|
|
29322
|
+
case ['percent', 'P', 'NX_FREQUENCY_PERCENT'].includes(frequencyMode):
|
|
29323
|
+
freqLetter = 'P';
|
|
29324
|
+
break;
|
|
29325
|
+
case ['relative', 'R', 'NX_FREQUENCY_RELATIVE'].includes(frequencyMode):
|
|
29326
|
+
freqLetter = 'R';
|
|
29327
|
+
break;
|
|
29328
|
+
default:
|
|
29329
|
+
freqLetter = 'N';
|
|
29330
|
+
break;
|
|
29331
|
+
}
|
|
29332
|
+
return freqLetter;
|
|
29333
|
+
}
|
|
29334
|
+
|
|
29227
29335
|
const _excluded$3 = ["__DO_NOT_USE__"];
|
|
29228
29336
|
|
|
29229
29337
|
/**
|
|
@@ -29286,6 +29394,12 @@
|
|
|
29286
29394
|
qId,
|
|
29287
29395
|
options
|
|
29288
29396
|
});
|
|
29397
|
+
if (!isExistingObject) {
|
|
29398
|
+
Object.assign(options, {
|
|
29399
|
+
frequencyMode: getFrequencyModeLetter(options.frequencyMode) // stick to letter option hereafter
|
|
29400
|
+
});
|
|
29401
|
+
}
|
|
29402
|
+
|
|
29289
29403
|
const [changeCount, setChangeCount] = reactExports.useState(0);
|
|
29290
29404
|
reactExports.useEffect(() => {
|
|
29291
29405
|
if (changeCount) {
|
|
@@ -37110,12 +37224,11 @@
|
|
|
37110
37224
|
* @returns {Promise<object>} The objects properties
|
|
37111
37225
|
* @example
|
|
37112
37226
|
* // generate properties for a barchart
|
|
37113
|
-
* const properties = await n.
|
|
37227
|
+
* const properties = await n.generateProperties({
|
|
37114
37228
|
* type: 'barchart',
|
|
37115
37229
|
* fields: ['Product', { qLibraryId: 'u378hn', type: 'measure' }],
|
|
37116
37230
|
* properties: { showTitle: true }
|
|
37117
37231
|
* },
|
|
37118
|
-
* true
|
|
37119
37232
|
* );
|
|
37120
37233
|
*/
|
|
37121
37234
|
generateProperties: async cfg => createObject(cfg, halo, true),
|