@nebula.js/stardust 4.1.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 +869 -757
- package/core/esm/dev.js.map +1 -1
- package/core/esm/index.js +4 -4
- package/core/esm/index.js.map +1 -1
- package/core/package.json +1 -1
- package/dist/stardust.dev.js +2873 -4295
- package/dist/stardust.dev.js.map +1 -1
- package/dist/stardust.js +14 -14
- package/dist/stardust.js.map +1 -1
- package/package.json +12 -12
- package/types/index.d.ts +10 -10
package/core/esm/dev.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/stardust v4.1
|
|
2
|
+
* @nebula.js/stardust v4.2.1
|
|
3
3
|
* Copyright (c) 2023 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
@@ -750,8 +750,8 @@ function _defineProperty(obj, key, value) {
|
|
|
750
750
|
}
|
|
751
751
|
return obj;
|
|
752
752
|
}
|
|
753
|
-
function _extends$
|
|
754
|
-
_extends$
|
|
753
|
+
function _extends$3() {
|
|
754
|
+
_extends$3 = Object.assign ? Object.assign.bind() : function (target) {
|
|
755
755
|
for (var i = 1; i < arguments.length; i++) {
|
|
756
756
|
var source = arguments[i];
|
|
757
757
|
for (var key in source) {
|
|
@@ -762,9 +762,9 @@ function _extends$1() {
|
|
|
762
762
|
}
|
|
763
763
|
return target;
|
|
764
764
|
};
|
|
765
|
-
return _extends$
|
|
765
|
+
return _extends$3.apply(this, arguments);
|
|
766
766
|
}
|
|
767
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
767
|
+
function _objectWithoutPropertiesLoose$2(source, excluded) {
|
|
768
768
|
if (source == null) return {};
|
|
769
769
|
var target = {};
|
|
770
770
|
var sourceKeys = Object.keys(source);
|
|
@@ -778,7 +778,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
778
778
|
}
|
|
779
779
|
function _objectWithoutProperties(source, excluded) {
|
|
780
780
|
if (source == null) return {};
|
|
781
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
781
|
+
var target = _objectWithoutPropertiesLoose$2(source, excluded);
|
|
782
782
|
var key, i;
|
|
783
783
|
if (Object.getOwnPropertySymbols) {
|
|
784
784
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -4300,6 +4300,34 @@ function generateUtilityClasses(componentName, slots, globalStatePrefix = 'Mui')
|
|
|
4300
4300
|
|
|
4301
4301
|
var THEME_ID = '$$material';
|
|
4302
4302
|
|
|
4303
|
+
function _extends$2() {
|
|
4304
|
+
_extends$2 = Object.assign ? Object.assign.bind() : function (target) {
|
|
4305
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
4306
|
+
var source = arguments[i];
|
|
4307
|
+
for (var key in source) {
|
|
4308
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
4309
|
+
target[key] = source[key];
|
|
4310
|
+
}
|
|
4311
|
+
}
|
|
4312
|
+
}
|
|
4313
|
+
return target;
|
|
4314
|
+
};
|
|
4315
|
+
return _extends$2.apply(this, arguments);
|
|
4316
|
+
}
|
|
4317
|
+
|
|
4318
|
+
function _objectWithoutPropertiesLoose$1(source, excluded) {
|
|
4319
|
+
if (source == null) return {};
|
|
4320
|
+
var target = {};
|
|
4321
|
+
var sourceKeys = Object.keys(source);
|
|
4322
|
+
var key, i;
|
|
4323
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
4324
|
+
key = sourceKeys[i];
|
|
4325
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
4326
|
+
target[key] = source[key];
|
|
4327
|
+
}
|
|
4328
|
+
return target;
|
|
4329
|
+
}
|
|
4330
|
+
|
|
4303
4331
|
/*
|
|
4304
4332
|
|
|
4305
4333
|
Based off glamor's StyleSheet, thanks Sunil ❤️
|
|
@@ -4443,6 +4471,7 @@ var RULESET = 'rule';
|
|
|
4443
4471
|
var DECLARATION = 'decl';
|
|
4444
4472
|
var IMPORT = '@import';
|
|
4445
4473
|
var KEYFRAMES = '@keyframes';
|
|
4474
|
+
var LAYER = '@layer';
|
|
4446
4475
|
|
|
4447
4476
|
/**
|
|
4448
4477
|
* @param {number}
|
|
@@ -4872,8 +4901,8 @@ function parse (value, root, parent, rule, rules, rulesets, pseudo, points, decl
|
|
|
4872
4901
|
parse(characters, root, reference, reference, props, rulesets, length, points, children);
|
|
4873
4902
|
else
|
|
4874
4903
|
switch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {
|
|
4875
|
-
// d m s
|
|
4876
|
-
case 100: case 109: case 115:
|
|
4904
|
+
// d l m s
|
|
4905
|
+
case 100: case 108: case 109: case 115:
|
|
4877
4906
|
parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children);
|
|
4878
4907
|
break
|
|
4879
4908
|
default:
|
|
@@ -4992,6 +5021,7 @@ function serialize (children, callback) {
|
|
|
4992
5021
|
*/
|
|
4993
5022
|
function stringify (element, index, children, callback) {
|
|
4994
5023
|
switch (element.type) {
|
|
5024
|
+
case LAYER: if (element.children.length) break
|
|
4995
5025
|
case IMPORT: case DECLARATION: return element.return = element.return || element.value
|
|
4996
5026
|
case COMMENT: return ''
|
|
4997
5027
|
case KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'
|
|
@@ -5584,7 +5614,7 @@ function StyledEngineProvider(props) {
|
|
|
5584
5614
|
}
|
|
5585
5615
|
|
|
5586
5616
|
/**
|
|
5587
|
-
* @mui/styled-engine v5.
|
|
5617
|
+
* @mui/styled-engine v5.13.2
|
|
5588
5618
|
*
|
|
5589
5619
|
* @license MIT
|
|
5590
5620
|
* This source code is licensed under the MIT license found in the
|
|
@@ -5605,8 +5635,35 @@ const internal_processStyles = (tag, processor) => {
|
|
|
5605
5635
|
}
|
|
5606
5636
|
};
|
|
5607
5637
|
|
|
5608
|
-
|
|
5609
|
-
|
|
5638
|
+
function _extends$1() {
|
|
5639
|
+
_extends$1 = Object.assign ? Object.assign.bind() : function (target) {
|
|
5640
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
5641
|
+
var source = arguments[i];
|
|
5642
|
+
for (var key in source) {
|
|
5643
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
5644
|
+
target[key] = source[key];
|
|
5645
|
+
}
|
|
5646
|
+
}
|
|
5647
|
+
}
|
|
5648
|
+
return target;
|
|
5649
|
+
};
|
|
5650
|
+
return _extends$1.apply(this, arguments);
|
|
5651
|
+
}
|
|
5652
|
+
|
|
5653
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
5654
|
+
if (source == null) return {};
|
|
5655
|
+
var target = {};
|
|
5656
|
+
var sourceKeys = Object.keys(source);
|
|
5657
|
+
var key, i;
|
|
5658
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
5659
|
+
key = sourceKeys[i];
|
|
5660
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
5661
|
+
target[key] = source[key];
|
|
5662
|
+
}
|
|
5663
|
+
return target;
|
|
5664
|
+
}
|
|
5665
|
+
|
|
5666
|
+
const _excluded$f = ["values", "unit", "step"];
|
|
5610
5667
|
const sortBreakpointsValues = values => {
|
|
5611
5668
|
const breakpointsAsArray = Object.keys(values).map(key => ({
|
|
5612
5669
|
key,
|
|
@@ -5615,34 +5672,33 @@ const sortBreakpointsValues = values => {
|
|
|
5615
5672
|
// Sort in ascending order
|
|
5616
5673
|
breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);
|
|
5617
5674
|
return breakpointsAsArray.reduce((acc, obj) => {
|
|
5618
|
-
return {
|
|
5619
|
-
...acc,
|
|
5675
|
+
return _extends$1({}, acc, {
|
|
5620
5676
|
[obj.key]: obj.val
|
|
5621
|
-
};
|
|
5677
|
+
});
|
|
5622
5678
|
}, {});
|
|
5623
5679
|
};
|
|
5624
5680
|
|
|
5625
5681
|
// Keep in mind that @media is inclusive by the CSS specification.
|
|
5626
5682
|
function createBreakpoints(breakpoints) {
|
|
5627
5683
|
const {
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5684
|
+
// The breakpoint **start** at this value.
|
|
5685
|
+
// For instance with the first breakpoint xs: [xs, sm).
|
|
5686
|
+
values = {
|
|
5687
|
+
xs: 0,
|
|
5688
|
+
// phone
|
|
5689
|
+
sm: 600,
|
|
5690
|
+
// tablet
|
|
5691
|
+
md: 900,
|
|
5692
|
+
// small laptop
|
|
5693
|
+
lg: 1200,
|
|
5694
|
+
// desktop
|
|
5695
|
+
xl: 1536 // large screen
|
|
5696
|
+
},
|
|
5641
5697
|
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5698
|
+
unit = 'px',
|
|
5699
|
+
step = 5
|
|
5700
|
+
} = breakpoints,
|
|
5701
|
+
other = _objectWithoutPropertiesLoose(breakpoints, _excluded$f);
|
|
5646
5702
|
const sortedValues = sortBreakpointsValues(values);
|
|
5647
5703
|
const keys = Object.keys(sortedValues);
|
|
5648
5704
|
function up(key) {
|
|
@@ -5674,7 +5730,7 @@ function createBreakpoints(breakpoints) {
|
|
|
5674
5730
|
}
|
|
5675
5731
|
return between(key, keys[keys.indexOf(key) + 1]).replace('@media', '@media not all and');
|
|
5676
5732
|
}
|
|
5677
|
-
return {
|
|
5733
|
+
return _extends$1({
|
|
5678
5734
|
keys,
|
|
5679
5735
|
values: sortedValues,
|
|
5680
5736
|
up,
|
|
@@ -5682,9 +5738,8 @@ function createBreakpoints(breakpoints) {
|
|
|
5682
5738
|
between,
|
|
5683
5739
|
only,
|
|
5684
5740
|
not,
|
|
5685
|
-
unit
|
|
5686
|
-
|
|
5687
|
-
};
|
|
5741
|
+
unit
|
|
5742
|
+
}, other);
|
|
5688
5743
|
}
|
|
5689
5744
|
|
|
5690
5745
|
const shape = {
|
|
@@ -6629,14 +6684,15 @@ const styleFunctionSx = unstable_createStyleFunctionSx();
|
|
|
6629
6684
|
styleFunctionSx.filterProps = ['sx'];
|
|
6630
6685
|
var styleFunctionSx$1 = styleFunctionSx;
|
|
6631
6686
|
|
|
6687
|
+
const _excluded$e = ["breakpoints", "palette", "spacing", "shape"];
|
|
6632
6688
|
function createTheme$1(options = {}, ...args) {
|
|
6633
6689
|
const {
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
|
|
6690
|
+
breakpoints: breakpointsInput = {},
|
|
6691
|
+
palette: paletteInput = {},
|
|
6692
|
+
spacing: spacingInput,
|
|
6693
|
+
shape: shapeInput = {}
|
|
6694
|
+
} = options,
|
|
6695
|
+
other = _objectWithoutPropertiesLoose(options, _excluded$e);
|
|
6640
6696
|
const breakpoints = createBreakpoints(breakpointsInput);
|
|
6641
6697
|
const spacing = createSpacing(spacingInput);
|
|
6642
6698
|
let muiTheme = deepmerge({
|
|
@@ -6644,21 +6700,14 @@ function createTheme$1(options = {}, ...args) {
|
|
|
6644
6700
|
direction: 'ltr',
|
|
6645
6701
|
components: {},
|
|
6646
6702
|
// Inject component definitions.
|
|
6647
|
-
palette: {
|
|
6648
|
-
mode: 'light'
|
|
6649
|
-
|
|
6650
|
-
},
|
|
6703
|
+
palette: _extends$1({
|
|
6704
|
+
mode: 'light'
|
|
6705
|
+
}, paletteInput),
|
|
6651
6706
|
spacing,
|
|
6652
|
-
shape: {
|
|
6653
|
-
...shape$1,
|
|
6654
|
-
...shapeInput
|
|
6655
|
-
}
|
|
6707
|
+
shape: _extends$1({}, shape$1, shapeInput)
|
|
6656
6708
|
}, other);
|
|
6657
6709
|
muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
|
|
6658
|
-
muiTheme.unstable_sxConfig = {
|
|
6659
|
-
...defaultSxConfig$1,
|
|
6660
|
-
...(other == null ? void 0 : other.unstable_sxConfig)
|
|
6661
|
-
};
|
|
6710
|
+
muiTheme.unstable_sxConfig = _extends$1({}, defaultSxConfig$1, other == null ? void 0 : other.unstable_sxConfig);
|
|
6662
6711
|
muiTheme.unstable_sx = function sx(props) {
|
|
6663
6712
|
return styleFunctionSx$1({
|
|
6664
6713
|
sx: props,
|
|
@@ -6683,6 +6732,7 @@ function useTheme$3(defaultTheme = systemDefaultTheme$1) {
|
|
|
6683
6732
|
|
|
6684
6733
|
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
6685
6734
|
|
|
6735
|
+
const _excluded$d = ["variant"];
|
|
6686
6736
|
function isEmpty$2(string) {
|
|
6687
6737
|
return string.length === 0;
|
|
6688
6738
|
}
|
|
@@ -6694,9 +6744,9 @@ function isEmpty$2(string) {
|
|
|
6694
6744
|
*/
|
|
6695
6745
|
function propsToClassKey(props) {
|
|
6696
6746
|
const {
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6747
|
+
variant
|
|
6748
|
+
} = props,
|
|
6749
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$d);
|
|
6700
6750
|
let classKey = variant || '';
|
|
6701
6751
|
Object.keys(other).sort().forEach(key => {
|
|
6702
6752
|
if (key === 'color') {
|
|
@@ -6708,7 +6758,7 @@ function propsToClassKey(props) {
|
|
|
6708
6758
|
return classKey;
|
|
6709
6759
|
}
|
|
6710
6760
|
|
|
6711
|
-
|
|
6761
|
+
const _excluded$c = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"];
|
|
6712
6762
|
function isEmpty$1(obj) {
|
|
6713
6763
|
return Object.keys(obj).length === 0;
|
|
6714
6764
|
}
|
|
@@ -6782,27 +6832,25 @@ function createStyled(input = {}) {
|
|
|
6782
6832
|
slotShouldForwardProp = shouldForwardProp
|
|
6783
6833
|
} = input;
|
|
6784
6834
|
const systemSx = props => {
|
|
6785
|
-
return styleFunctionSx$1({
|
|
6786
|
-
|
|
6787
|
-
theme: resolveTheme({
|
|
6788
|
-
...props,
|
|
6835
|
+
return styleFunctionSx$1(_extends$1({}, props, {
|
|
6836
|
+
theme: resolveTheme(_extends$1({}, props, {
|
|
6789
6837
|
defaultTheme,
|
|
6790
6838
|
themeId
|
|
6791
|
-
})
|
|
6792
|
-
});
|
|
6839
|
+
}))
|
|
6840
|
+
}));
|
|
6793
6841
|
};
|
|
6794
6842
|
systemSx.__mui_systemSx = true;
|
|
6795
6843
|
return (tag, inputOptions = {}) => {
|
|
6796
6844
|
// Filter out the `sx` style function from the previous styled component to prevent unnecessary styles generated by the composite components.
|
|
6797
6845
|
internal_processStyles(tag, styles => styles.filter(style => !(style != null && style.__mui_systemSx)));
|
|
6798
6846
|
const {
|
|
6799
|
-
|
|
6800
|
-
|
|
6801
|
-
|
|
6802
|
-
|
|
6803
|
-
|
|
6804
|
-
|
|
6805
|
-
|
|
6847
|
+
name: componentName,
|
|
6848
|
+
slot: componentSlot,
|
|
6849
|
+
skipVariantsResolver: inputSkipVariantsResolver,
|
|
6850
|
+
skipSx: inputSkipSx,
|
|
6851
|
+
overridesResolver
|
|
6852
|
+
} = inputOptions,
|
|
6853
|
+
options = _objectWithoutPropertiesLoose(inputOptions, _excluded$c);
|
|
6806
6854
|
|
|
6807
6855
|
// if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.
|
|
6808
6856
|
const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver : componentSlot && componentSlot !== 'Root' || false;
|
|
@@ -6818,43 +6866,38 @@ function createStyled(input = {}) {
|
|
|
6818
6866
|
// for string (html) tag, preserve the behavior in emotion & styled-components.
|
|
6819
6867
|
shouldForwardPropOption = undefined;
|
|
6820
6868
|
}
|
|
6821
|
-
const defaultStyledResolver = styled$2(tag, {
|
|
6869
|
+
const defaultStyledResolver = styled$2(tag, _extends$1({
|
|
6822
6870
|
shouldForwardProp: shouldForwardPropOption,
|
|
6823
|
-
label
|
|
6824
|
-
|
|
6825
|
-
});
|
|
6871
|
+
label
|
|
6872
|
+
}, options));
|
|
6826
6873
|
const muiStyledResolver = (styleArg, ...expressions) => {
|
|
6827
6874
|
const expressionsWithDefaultTheme = expressions ? expressions.map(stylesArg => {
|
|
6828
6875
|
// On the server Emotion doesn't use React.forwardRef for creating components, so the created
|
|
6829
6876
|
// component stays as a function. This condition makes sure that we do not interpolate functions
|
|
6830
6877
|
// which are basically components used as a selectors.
|
|
6831
6878
|
return typeof stylesArg === 'function' && stylesArg.__emotion_real !== stylesArg ? props => {
|
|
6832
|
-
return stylesArg({
|
|
6833
|
-
|
|
6834
|
-
theme: resolveTheme({
|
|
6835
|
-
...props,
|
|
6879
|
+
return stylesArg(_extends$1({}, props, {
|
|
6880
|
+
theme: resolveTheme(_extends$1({}, props, {
|
|
6836
6881
|
defaultTheme,
|
|
6837
6882
|
themeId
|
|
6838
|
-
})
|
|
6839
|
-
});
|
|
6883
|
+
}))
|
|
6884
|
+
}));
|
|
6840
6885
|
} : stylesArg;
|
|
6841
6886
|
}) : [];
|
|
6842
6887
|
let transformedStyleArg = styleArg;
|
|
6843
6888
|
if (componentName && overridesResolver) {
|
|
6844
6889
|
expressionsWithDefaultTheme.push(props => {
|
|
6845
|
-
const theme = resolveTheme({
|
|
6846
|
-
...props,
|
|
6890
|
+
const theme = resolveTheme(_extends$1({}, props, {
|
|
6847
6891
|
defaultTheme,
|
|
6848
6892
|
themeId
|
|
6849
|
-
});
|
|
6893
|
+
}));
|
|
6850
6894
|
const styleOverrides = getStyleOverrides(componentName, theme);
|
|
6851
6895
|
if (styleOverrides) {
|
|
6852
6896
|
const resolvedStyleOverrides = {};
|
|
6853
6897
|
Object.entries(styleOverrides).forEach(([slotKey, slotStyle]) => {
|
|
6854
|
-
resolvedStyleOverrides[slotKey] = typeof slotStyle === 'function' ? slotStyle({
|
|
6855
|
-
...props,
|
|
6898
|
+
resolvedStyleOverrides[slotKey] = typeof slotStyle === 'function' ? slotStyle(_extends$1({}, props, {
|
|
6856
6899
|
theme
|
|
6857
|
-
}) : slotStyle;
|
|
6900
|
+
})) : slotStyle;
|
|
6858
6901
|
});
|
|
6859
6902
|
return overridesResolver(props, resolvedStyleOverrides);
|
|
6860
6903
|
}
|
|
@@ -6863,11 +6906,10 @@ function createStyled(input = {}) {
|
|
|
6863
6906
|
}
|
|
6864
6907
|
if (componentName && !skipVariantsResolver) {
|
|
6865
6908
|
expressionsWithDefaultTheme.push(props => {
|
|
6866
|
-
const theme = resolveTheme({
|
|
6867
|
-
...props,
|
|
6909
|
+
const theme = resolveTheme(_extends$1({}, props, {
|
|
6868
6910
|
defaultTheme,
|
|
6869
6911
|
themeId
|
|
6870
|
-
});
|
|
6912
|
+
}));
|
|
6871
6913
|
return variantsResolver(props, getVariantStyles(componentName, theme), theme, componentName);
|
|
6872
6914
|
});
|
|
6873
6915
|
}
|
|
@@ -6886,14 +6928,12 @@ function createStyled(input = {}) {
|
|
|
6886
6928
|
// which are basically components used as a selectors.
|
|
6887
6929
|
styleArg.__emotion_real !== styleArg) {
|
|
6888
6930
|
// If the type is function, we need to define the default theme.
|
|
6889
|
-
transformedStyleArg = props => styleArg({
|
|
6890
|
-
|
|
6891
|
-
theme: resolveTheme({
|
|
6892
|
-
...props,
|
|
6931
|
+
transformedStyleArg = props => styleArg(_extends$1({}, props, {
|
|
6932
|
+
theme: resolveTheme(_extends$1({}, props, {
|
|
6893
6933
|
defaultTheme,
|
|
6894
6934
|
themeId
|
|
6895
|
-
})
|
|
6896
|
-
});
|
|
6935
|
+
}))
|
|
6936
|
+
}));
|
|
6897
6937
|
}
|
|
6898
6938
|
const Component = defaultStyledResolver(transformedStyleArg, ...expressionsWithDefaultTheme);
|
|
6899
6939
|
if (tag.muiName) {
|
|
@@ -7196,10 +7236,9 @@ function useThemeScoping(themeId, upperTheme, localTheme, isPrivate = false) {
|
|
|
7196
7236
|
const resolvedTheme = themeId ? upperTheme[themeId] || upperTheme : upperTheme;
|
|
7197
7237
|
if (typeof localTheme === 'function') {
|
|
7198
7238
|
const mergedTheme = localTheme(resolvedTheme);
|
|
7199
|
-
const result = themeId ? {
|
|
7200
|
-
...upperTheme,
|
|
7239
|
+
const result = themeId ? _extends$1({}, upperTheme, {
|
|
7201
7240
|
[themeId]: mergedTheme
|
|
7202
|
-
} : mergedTheme;
|
|
7241
|
+
}) : mergedTheme;
|
|
7203
7242
|
// must return a function for the private theme to NOT merge with the upper theme.
|
|
7204
7243
|
// see the test case "use provided theme from a callback" in ThemeProvider.test.js
|
|
7205
7244
|
if (isPrivate) {
|
|
@@ -7207,13 +7246,9 @@ function useThemeScoping(themeId, upperTheme, localTheme, isPrivate = false) {
|
|
|
7207
7246
|
}
|
|
7208
7247
|
return result;
|
|
7209
7248
|
}
|
|
7210
|
-
return themeId ? {
|
|
7211
|
-
...upperTheme,
|
|
7249
|
+
return themeId ? _extends$1({}, upperTheme, {
|
|
7212
7250
|
[themeId]: localTheme
|
|
7213
|
-
} : {
|
|
7214
|
-
...upperTheme,
|
|
7215
|
-
...localTheme
|
|
7216
|
-
};
|
|
7251
|
+
}) : _extends$1({}, upperTheme, localTheme);
|
|
7217
7252
|
}, [themeId, upperTheme, localTheme, isPrivate]);
|
|
7218
7253
|
}
|
|
7219
7254
|
|
|
@@ -7243,20 +7278,21 @@ function ThemeProvider$1(props) {
|
|
|
7243
7278
|
});
|
|
7244
7279
|
}
|
|
7245
7280
|
|
|
7281
|
+
const _excluded$b = ["defaultProps", "mixins", "overrides", "palette", "props", "styleOverrides"],
|
|
7282
|
+
_excluded2$1 = ["type", "mode"];
|
|
7246
7283
|
function adaptV4Theme(inputTheme) {
|
|
7247
7284
|
const {
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
const theme = {
|
|
7257
|
-
...other,
|
|
7285
|
+
defaultProps = {},
|
|
7286
|
+
mixins = {},
|
|
7287
|
+
overrides = {},
|
|
7288
|
+
palette = {},
|
|
7289
|
+
props = {},
|
|
7290
|
+
styleOverrides = {}
|
|
7291
|
+
} = inputTheme,
|
|
7292
|
+
other = _objectWithoutPropertiesLoose$1(inputTheme, _excluded$b);
|
|
7293
|
+
const theme = _extends$2({}, other, {
|
|
7258
7294
|
components: {}
|
|
7259
|
-
};
|
|
7295
|
+
});
|
|
7260
7296
|
|
|
7261
7297
|
// default props
|
|
7262
7298
|
Object.keys(defaultProps).forEach(component => {
|
|
@@ -7288,41 +7324,38 @@ function adaptV4Theme(inputTheme) {
|
|
|
7288
7324
|
// theme.mixins.gutters
|
|
7289
7325
|
const breakpoints = createBreakpoints(inputTheme.breakpoints || {});
|
|
7290
7326
|
const spacing = theme.spacing;
|
|
7291
|
-
theme.mixins = {
|
|
7327
|
+
theme.mixins = _extends$2({
|
|
7292
7328
|
gutters: (styles = {}) => {
|
|
7293
|
-
return {
|
|
7329
|
+
return _extends$2({
|
|
7294
7330
|
paddingLeft: spacing(2),
|
|
7295
|
-
paddingRight: spacing(2)
|
|
7296
|
-
|
|
7297
|
-
[breakpoints.up('sm')]: {
|
|
7331
|
+
paddingRight: spacing(2)
|
|
7332
|
+
}, styles, {
|
|
7333
|
+
[breakpoints.up('sm')]: _extends$2({
|
|
7298
7334
|
paddingLeft: spacing(3),
|
|
7299
|
-
paddingRight: spacing(3)
|
|
7300
|
-
|
|
7301
|
-
|
|
7302
|
-
|
|
7303
|
-
|
|
7304
|
-
...mixins
|
|
7305
|
-
};
|
|
7335
|
+
paddingRight: spacing(3)
|
|
7336
|
+
}, styles[breakpoints.up('sm')])
|
|
7337
|
+
});
|
|
7338
|
+
}
|
|
7339
|
+
}, mixins);
|
|
7306
7340
|
const {
|
|
7307
|
-
|
|
7308
|
-
|
|
7309
|
-
|
|
7310
|
-
|
|
7341
|
+
type: typeInput,
|
|
7342
|
+
mode: modeInput
|
|
7343
|
+
} = palette,
|
|
7344
|
+
paletteRest = _objectWithoutPropertiesLoose$1(palette, _excluded2$1);
|
|
7311
7345
|
const finalMode = modeInput || typeInput || 'light';
|
|
7312
|
-
theme.palette = {
|
|
7346
|
+
theme.palette = _extends$2({
|
|
7313
7347
|
// theme.palette.text.hint
|
|
7314
7348
|
text: {
|
|
7315
7349
|
hint: finalMode === 'dark' ? 'rgba(255, 255, 255, 0.5)' : 'rgba(0, 0, 0, 0.38)'
|
|
7316
7350
|
},
|
|
7317
7351
|
mode: finalMode,
|
|
7318
|
-
type: finalMode
|
|
7319
|
-
|
|
7320
|
-
};
|
|
7352
|
+
type: finalMode
|
|
7353
|
+
}, paletteRest);
|
|
7321
7354
|
return theme;
|
|
7322
7355
|
}
|
|
7323
7356
|
|
|
7324
7357
|
function createMixins(breakpoints, mixins) {
|
|
7325
|
-
return {
|
|
7358
|
+
return _extends$2({
|
|
7326
7359
|
toolbar: {
|
|
7327
7360
|
minHeight: 56,
|
|
7328
7361
|
[breakpoints.up('xs')]: {
|
|
@@ -7333,9 +7366,8 @@ function createMixins(breakpoints, mixins) {
|
|
|
7333
7366
|
[breakpoints.up('sm')]: {
|
|
7334
7367
|
minHeight: 64
|
|
7335
7368
|
}
|
|
7336
|
-
}
|
|
7337
|
-
|
|
7338
|
-
};
|
|
7369
|
+
}
|
|
7370
|
+
}, mixins);
|
|
7339
7371
|
}
|
|
7340
7372
|
|
|
7341
7373
|
const common = {
|
|
@@ -7470,6 +7502,7 @@ const green = {
|
|
|
7470
7502
|
};
|
|
7471
7503
|
var green$1 = green;
|
|
7472
7504
|
|
|
7505
|
+
const _excluded$a = ["mode", "contrastThreshold", "tonalOffset"];
|
|
7473
7506
|
const light$1 = {
|
|
7474
7507
|
// The colors used to style the text.
|
|
7475
7508
|
text: {
|
|
@@ -7634,11 +7667,11 @@ function getDefaultWarning(mode = 'light') {
|
|
|
7634
7667
|
}
|
|
7635
7668
|
function createPalette(palette) {
|
|
7636
7669
|
const {
|
|
7637
|
-
|
|
7638
|
-
|
|
7639
|
-
|
|
7640
|
-
|
|
7641
|
-
|
|
7670
|
+
mode = 'light',
|
|
7671
|
+
contrastThreshold = 3,
|
|
7672
|
+
tonalOffset = 0.2
|
|
7673
|
+
} = palette,
|
|
7674
|
+
other = _objectWithoutPropertiesLoose$1(palette, _excluded$a);
|
|
7642
7675
|
const primary = palette.primary || getDefaultPrimary(mode);
|
|
7643
7676
|
const secondary = palette.secondary || getDefaultSecondary(mode);
|
|
7644
7677
|
const error = palette.error || getDefaultError(mode);
|
|
@@ -7660,9 +7693,7 @@ function createPalette(palette) {
|
|
|
7660
7693
|
lightShade = 300,
|
|
7661
7694
|
darkShade = 700
|
|
7662
7695
|
}) => {
|
|
7663
|
-
color = {
|
|
7664
|
-
...color
|
|
7665
|
-
};
|
|
7696
|
+
color = _extends$2({}, color);
|
|
7666
7697
|
if (!color.main && color[mainShade]) {
|
|
7667
7698
|
color.main = color[mainShade];
|
|
7668
7699
|
}
|
|
@@ -7683,11 +7714,9 @@ function createPalette(palette) {
|
|
|
7683
7714
|
dark: dark$1,
|
|
7684
7715
|
light: light$1
|
|
7685
7716
|
};
|
|
7686
|
-
const paletteOutput = deepmerge({
|
|
7717
|
+
const paletteOutput = deepmerge(_extends$2({
|
|
7687
7718
|
// A collection of common colors.
|
|
7688
|
-
common: {
|
|
7689
|
-
...common$1
|
|
7690
|
-
},
|
|
7719
|
+
common: _extends$2({}, common$1),
|
|
7691
7720
|
// prevent mutable object.
|
|
7692
7721
|
// The palette mode, can be light or dark.
|
|
7693
7722
|
mode,
|
|
@@ -7736,13 +7765,12 @@ function createPalette(palette) {
|
|
|
7736
7765
|
// Used by the functions below to shift a color's luminance by approximately
|
|
7737
7766
|
// two indexes within its tonal palette.
|
|
7738
7767
|
// E.g., shift from Red 500 to Red 300 or Red 700.
|
|
7739
|
-
tonalOffset
|
|
7740
|
-
|
|
7741
|
-
...modes[mode]
|
|
7742
|
-
}, other);
|
|
7768
|
+
tonalOffset
|
|
7769
|
+
}, modes[mode]), other);
|
|
7743
7770
|
return paletteOutput;
|
|
7744
7771
|
}
|
|
7745
7772
|
|
|
7773
|
+
const _excluded$9 = ["fontFamily", "fontSize", "fontWeightLight", "fontWeightRegular", "fontWeightMedium", "fontWeightBold", "htmlFontSize", "allVariants", "pxToRem"];
|
|
7746
7774
|
function round(value) {
|
|
7747
7775
|
return Math.round(value * 1e5) / 1e5;
|
|
7748
7776
|
}
|
|
@@ -7756,39 +7784,35 @@ const defaultFontFamily = '"Roboto", "Helvetica", "Arial", sans-serif';
|
|
|
7756
7784
|
* @see @link{https://m2.material.io/design/typography/understanding-typography.html}
|
|
7757
7785
|
*/
|
|
7758
7786
|
function createTypography(palette, typography) {
|
|
7759
|
-
const
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
|
|
7764
|
-
|
|
7765
|
-
|
|
7766
|
-
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
|
|
7770
|
-
|
|
7771
|
-
|
|
7772
|
-
|
|
7773
|
-
|
|
7774
|
-
|
|
7775
|
-
|
|
7787
|
+
const _ref = typeof typography === 'function' ? typography(palette) : typography,
|
|
7788
|
+
{
|
|
7789
|
+
fontFamily = defaultFontFamily,
|
|
7790
|
+
// The default font size of the Material Specification.
|
|
7791
|
+
fontSize = 14,
|
|
7792
|
+
// px
|
|
7793
|
+
fontWeightLight = 300,
|
|
7794
|
+
fontWeightRegular = 400,
|
|
7795
|
+
fontWeightMedium = 500,
|
|
7796
|
+
fontWeightBold = 700,
|
|
7797
|
+
// Tell MUI what's the font-size on the html element.
|
|
7798
|
+
// 16px is the default font-size used by browsers.
|
|
7799
|
+
htmlFontSize = 16,
|
|
7800
|
+
// Apply the CSS properties to all the variants.
|
|
7801
|
+
allVariants,
|
|
7802
|
+
pxToRem: pxToRem2
|
|
7803
|
+
} = _ref,
|
|
7804
|
+
other = _objectWithoutPropertiesLoose$1(_ref, _excluded$9);
|
|
7776
7805
|
const coef = fontSize / 14;
|
|
7777
7806
|
const pxToRem = pxToRem2 || (size => `${size / htmlFontSize * coef}rem`);
|
|
7778
|
-
const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => ({
|
|
7807
|
+
const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => _extends$2({
|
|
7779
7808
|
fontFamily,
|
|
7780
7809
|
fontWeight,
|
|
7781
7810
|
fontSize: pxToRem(size),
|
|
7782
7811
|
// Unitless following https://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/
|
|
7783
|
-
lineHeight
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
|
|
7787
|
-
letterSpacing: `${round(letterSpacing / size)}em`
|
|
7788
|
-
} : {}),
|
|
7789
|
-
...casing,
|
|
7790
|
-
...allVariants
|
|
7791
|
-
});
|
|
7812
|
+
lineHeight
|
|
7813
|
+
}, fontFamily === defaultFontFamily ? {
|
|
7814
|
+
letterSpacing: `${round(letterSpacing / size)}em`
|
|
7815
|
+
} : {}, casing, allVariants);
|
|
7792
7816
|
const variants = {
|
|
7793
7817
|
h1: buildVariant(fontWeightLight, 96, 1.167, -1.5),
|
|
7794
7818
|
h2: buildVariant(fontWeightLight, 60, 1.2, -0.5),
|
|
@@ -7811,7 +7835,7 @@ function createTypography(palette, typography) {
|
|
|
7811
7835
|
letterSpacing: 'inherit'
|
|
7812
7836
|
}
|
|
7813
7837
|
};
|
|
7814
|
-
return deepmerge({
|
|
7838
|
+
return deepmerge(_extends$2({
|
|
7815
7839
|
htmlFontSize,
|
|
7816
7840
|
pxToRem,
|
|
7817
7841
|
fontFamily,
|
|
@@ -7819,9 +7843,8 @@ function createTypography(palette, typography) {
|
|
|
7819
7843
|
fontWeightLight,
|
|
7820
7844
|
fontWeightRegular,
|
|
7821
7845
|
fontWeightMedium,
|
|
7822
|
-
fontWeightBold
|
|
7823
|
-
|
|
7824
|
-
}, other, {
|
|
7846
|
+
fontWeightBold
|
|
7847
|
+
}, variants), other, {
|
|
7825
7848
|
clone: false // No need to clone deep
|
|
7826
7849
|
});
|
|
7827
7850
|
}
|
|
@@ -7837,6 +7860,7 @@ function createShadow(...px) {
|
|
|
7837
7860
|
const shadows = ['none', createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];
|
|
7838
7861
|
var shadows$1 = shadows;
|
|
7839
7862
|
|
|
7863
|
+
const _excluded$8 = ["duration", "easing", "delay"];
|
|
7840
7864
|
// Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves
|
|
7841
7865
|
// to learn the context in which each easing should be used.
|
|
7842
7866
|
const easing = {
|
|
@@ -7879,30 +7903,24 @@ function getAutoHeightDuration(height) {
|
|
|
7879
7903
|
return Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10);
|
|
7880
7904
|
}
|
|
7881
7905
|
function createTransitions(inputTransitions) {
|
|
7882
|
-
const mergedEasing = {
|
|
7883
|
-
|
|
7884
|
-
...inputTransitions.easing
|
|
7885
|
-
};
|
|
7886
|
-
const mergedDuration = {
|
|
7887
|
-
...duration,
|
|
7888
|
-
...inputTransitions.duration
|
|
7889
|
-
};
|
|
7906
|
+
const mergedEasing = _extends$2({}, easing, inputTransitions.easing);
|
|
7907
|
+
const mergedDuration = _extends$2({}, duration, inputTransitions.duration);
|
|
7890
7908
|
const create = (props = ['all'], options = {}) => {
|
|
7891
7909
|
const {
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
|
|
7895
|
-
|
|
7896
|
-
|
|
7910
|
+
duration: durationOption = mergedDuration.standard,
|
|
7911
|
+
easing: easingOption = mergedEasing.easeInOut,
|
|
7912
|
+
delay = 0
|
|
7913
|
+
} = options;
|
|
7914
|
+
_objectWithoutPropertiesLoose$1(options, _excluded$8);
|
|
7897
7915
|
return (Array.isArray(props) ? props : [props]).map(animatedProp => `${animatedProp} ${typeof durationOption === 'string' ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === 'string' ? delay : formatMs(delay)}`).join(',');
|
|
7898
7916
|
};
|
|
7899
|
-
return {
|
|
7917
|
+
return _extends$2({
|
|
7900
7918
|
getAutoHeightDuration,
|
|
7901
|
-
create
|
|
7902
|
-
|
|
7919
|
+
create
|
|
7920
|
+
}, inputTransitions, {
|
|
7903
7921
|
easing: mergedEasing,
|
|
7904
7922
|
duration: mergedDuration
|
|
7905
|
-
};
|
|
7923
|
+
});
|
|
7906
7924
|
}
|
|
7907
7925
|
|
|
7908
7926
|
// We need to centralize the zIndex definitions as they work
|
|
@@ -7919,17 +7937,15 @@ const zIndex = {
|
|
|
7919
7937
|
};
|
|
7920
7938
|
var zIndex$1 = zIndex;
|
|
7921
7939
|
|
|
7940
|
+
const _excluded$7 = ["breakpoints", "mixins", "spacing", "palette", "transitions", "typography", "shape"];
|
|
7922
7941
|
function createTheme(options = {}, ...args) {
|
|
7923
7942
|
const {
|
|
7924
|
-
|
|
7925
|
-
|
|
7926
|
-
|
|
7927
|
-
|
|
7928
|
-
|
|
7929
|
-
|
|
7930
|
-
shape: shapeInput,
|
|
7931
|
-
...other
|
|
7932
|
-
} = options;
|
|
7943
|
+
mixins: mixinsInput = {},
|
|
7944
|
+
palette: paletteInput = {},
|
|
7945
|
+
transitions: transitionsInput = {},
|
|
7946
|
+
typography: typographyInput = {}
|
|
7947
|
+
} = options,
|
|
7948
|
+
other = _objectWithoutPropertiesLoose$1(options, _excluded$7);
|
|
7933
7949
|
if (options.vars) {
|
|
7934
7950
|
throw new Error(formatMuiErrorMessage(18));
|
|
7935
7951
|
}
|
|
@@ -7942,16 +7958,11 @@ function createTheme(options = {}, ...args) {
|
|
|
7942
7958
|
shadows: shadows$1.slice(),
|
|
7943
7959
|
typography: createTypography(palette, typographyInput),
|
|
7944
7960
|
transitions: createTransitions(transitionsInput),
|
|
7945
|
-
zIndex: {
|
|
7946
|
-
...zIndex$1
|
|
7947
|
-
}
|
|
7961
|
+
zIndex: _extends$2({}, zIndex$1)
|
|
7948
7962
|
});
|
|
7949
7963
|
muiTheme = deepmerge(muiTheme, other);
|
|
7950
7964
|
muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
|
|
7951
|
-
muiTheme.unstable_sxConfig = {
|
|
7952
|
-
...defaultSxConfig$1,
|
|
7953
|
-
...(other == null ? void 0 : other.unstable_sxConfig)
|
|
7954
|
-
};
|
|
7965
|
+
muiTheme.unstable_sxConfig = _extends$2({}, defaultSxConfig$1, other == null ? void 0 : other.unstable_sxConfig);
|
|
7955
7966
|
muiTheme.unstable_sx = function sx(props) {
|
|
7956
7967
|
return styleFunctionSx$1({
|
|
7957
7968
|
sx: props,
|
|
@@ -7989,16 +8000,17 @@ const styled = createStyled({
|
|
|
7989
8000
|
});
|
|
7990
8001
|
var styled$1 = styled;
|
|
7991
8002
|
|
|
7992
|
-
|
|
7993
|
-
|
|
7994
|
-
|
|
7995
|
-
|
|
8003
|
+
const _excluded$6 = ["theme"];
|
|
8004
|
+
function ThemeProvider(_ref) {
|
|
8005
|
+
let {
|
|
8006
|
+
theme: themeInput
|
|
8007
|
+
} = _ref,
|
|
8008
|
+
props = _objectWithoutPropertiesLoose$1(_ref, _excluded$6);
|
|
7996
8009
|
const scopedTheme = themeInput[THEME_ID];
|
|
7997
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeProvider$1, {
|
|
7998
|
-
...props,
|
|
8010
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeProvider$1, _extends$2({}, props, {
|
|
7999
8011
|
themeId: scopedTheme ? THEME_ID : undefined,
|
|
8000
8012
|
theme: scopedTheme || themeInput
|
|
8001
|
-
});
|
|
8013
|
+
}));
|
|
8002
8014
|
}
|
|
8003
8015
|
|
|
8004
8016
|
function _extends() {
|
|
@@ -8361,7 +8373,7 @@ function create$3(definition) {
|
|
|
8361
8373
|
return cache[key];
|
|
8362
8374
|
}
|
|
8363
8375
|
|
|
8364
|
-
const NEBULA_VERSION_HASH = "
|
|
8376
|
+
const NEBULA_VERSION_HASH = "65bf" ;
|
|
8365
8377
|
ClassNameGenerator$1.configure(componentName => {
|
|
8366
8378
|
return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
|
|
8367
8379
|
});
|
|
@@ -8608,7 +8620,7 @@ function boot(_ref2) {
|
|
|
8608
8620
|
const appRef = React__default.createRef();
|
|
8609
8621
|
const element = document.createElement('div');
|
|
8610
8622
|
element.style.display = 'none';
|
|
8611
|
-
element.setAttribute('data-nebulajs-version', "4.1
|
|
8623
|
+
element.setAttribute('data-nebulajs-version', "4.2.1" );
|
|
8612
8624
|
element.setAttribute('data-app-id', app.id);
|
|
8613
8625
|
document.body.appendChild(element);
|
|
8614
8626
|
if (context) {
|
|
@@ -9013,7 +9025,7 @@ function SvgIcon$2(_ref) {
|
|
|
9013
9025
|
return (
|
|
9014
9026
|
/*#__PURE__*/
|
|
9015
9027
|
// eslint-disable-next-line react/no-array-index-key
|
|
9016
|
-
React__default.createElement(Type, _extends$
|
|
9028
|
+
React__default.createElement(Type, _extends$3({
|
|
9017
9029
|
key: ix
|
|
9018
9030
|
}, attrs))
|
|
9019
9031
|
);
|
|
@@ -9794,13 +9806,13 @@ const getValueStateClasses = _ref2 => {
|
|
|
9794
9806
|
};
|
|
9795
9807
|
|
|
9796
9808
|
const CELL_PADDING_LEFT = 9;
|
|
9809
|
+
const HEADER_PADDING_RIGHT = 4;
|
|
9797
9810
|
const ICON_WIDTH = 12;
|
|
9798
9811
|
const ICON_PADDING = 7;
|
|
9799
9812
|
const BUTTON_ICON_WIDTH = ICON_WIDTH + (ICON_PADDING + 1) * 2; // 1 is border width
|
|
9800
9813
|
const REMOVE_TICK_LIMIT = 80; // an item width equal to or less than this, will hide the select tick
|
|
9801
9814
|
const SCROLL_BAR_WIDTH = 10; // TODO: ignore this - instead set the styling only show on hover...
|
|
9802
9815
|
const ITEM_MAX_WIDTH = 150;
|
|
9803
|
-
const FREQUENCY_WIDTH = 40;
|
|
9804
9816
|
const ITEM_MIN_WIDTH = 56;
|
|
9805
9817
|
const CHECKBOX_WIDTH = 20;
|
|
9806
9818
|
const frequencyTextNone = '-';
|
|
@@ -9822,10 +9834,39 @@ const getBarWidth = _ref => {
|
|
|
9822
9834
|
};
|
|
9823
9835
|
const getFrequencyText = qFrequency => qFrequency || frequencyTextNone;
|
|
9824
9836
|
|
|
9825
|
-
const
|
|
9837
|
+
const getFreqFlexBasis = _ref => {
|
|
9826
9838
|
let {
|
|
9827
|
-
|
|
9839
|
+
sizes,
|
|
9840
|
+
frequencyMode,
|
|
9841
|
+
isGridMode,
|
|
9842
|
+
freqHitsValue
|
|
9828
9843
|
} = _ref;
|
|
9844
|
+
if (frequencyMode === 'P') {
|
|
9845
|
+
return "".concat(sizes.freqMinWidth, "px");
|
|
9846
|
+
}
|
|
9847
|
+
const flexBasis = isGridMode && !freqHitsValue ? 'max-content' : '25%';
|
|
9848
|
+
return flexBasis;
|
|
9849
|
+
};
|
|
9850
|
+
const getMaxFreqWidth = _ref2 => {
|
|
9851
|
+
let {
|
|
9852
|
+
sizes,
|
|
9853
|
+
frequencyMode,
|
|
9854
|
+
isGridMode
|
|
9855
|
+
} = _ref2;
|
|
9856
|
+
if (isGridMode) {
|
|
9857
|
+
// This makes the neighbouring value stretch farther than when using a fixed freuency width.
|
|
9858
|
+
return 'max-content';
|
|
9859
|
+
}
|
|
9860
|
+
if (frequencyMode === 'P') {
|
|
9861
|
+
return sizes.freqMinWidth; // because it will never grow beyond "100.0%"
|
|
9862
|
+
}
|
|
9863
|
+
|
|
9864
|
+
return sizes.freqMaxWidth;
|
|
9865
|
+
};
|
|
9866
|
+
const getSelectedStyle = _ref3 => {
|
|
9867
|
+
let {
|
|
9868
|
+
theme
|
|
9869
|
+
} = _ref3;
|
|
9829
9870
|
return {
|
|
9830
9871
|
background: theme.palette.selected.main,
|
|
9831
9872
|
color: theme.palette.selected.mainContrastText,
|
|
@@ -9847,18 +9888,20 @@ const ellipsis = {
|
|
|
9847
9888
|
const iconWidth = 24; // tick and lock icon width in px
|
|
9848
9889
|
|
|
9849
9890
|
const RowColRoot = styled$1('div', {
|
|
9850
|
-
shouldForwardProp: prop => !['
|
|
9851
|
-
})(
|
|
9891
|
+
shouldForwardProp: prop => !['checkboxes', 'isGridMode', 'isGridCol', 'dense', 'direction', 'sizes', 'frequencyMode', 'freqHitsValue'].includes(prop)
|
|
9892
|
+
})(_ref4 => {
|
|
9852
9893
|
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;
|
|
9853
9894
|
let {
|
|
9854
9895
|
theme,
|
|
9855
|
-
|
|
9896
|
+
checkboxes,
|
|
9856
9897
|
isGridMode,
|
|
9857
9898
|
isGridCol,
|
|
9858
9899
|
dense,
|
|
9859
|
-
|
|
9860
|
-
|
|
9861
|
-
|
|
9900
|
+
direction,
|
|
9901
|
+
sizes,
|
|
9902
|
+
frequencyMode,
|
|
9903
|
+
freqHitsValue
|
|
9904
|
+
} = _ref4;
|
|
9862
9905
|
return {
|
|
9863
9906
|
'&:focus': {
|
|
9864
9907
|
boxShadow: "inset 0 0 0 2px ".concat(theme.palette.custom.focusBorder, " !important")
|
|
@@ -9891,15 +9934,16 @@ const RowColRoot = styled$1('div', {
|
|
|
9891
9934
|
["& .".concat(rowColClasses.cell)]: {
|
|
9892
9935
|
display: 'flex',
|
|
9893
9936
|
alignItems: 'center',
|
|
9894
|
-
minWidth: 0,
|
|
9895
9937
|
flexGrow: 1,
|
|
9938
|
+
minWidth: checkboxes ? '52px' : '26px',
|
|
9939
|
+
// these numbers are just enough to show one letter and ellipsis: A…
|
|
9940
|
+
flexBasis: checkboxes ? 'auto' : 'max-content',
|
|
9896
9941
|
// Note that this padding is overridden when using checkboxes.
|
|
9897
9942
|
paddingLeft: "".concat(CELL_PADDING_LEFT, "px"),
|
|
9898
9943
|
paddingRight: 0
|
|
9899
9944
|
},
|
|
9900
9945
|
// The leaf node, containing the label text.
|
|
9901
9946
|
["& .".concat(rowColClasses.labelText)]: _objectSpread2(_objectSpread2({
|
|
9902
|
-
flexBasis: flexBasisProp,
|
|
9903
9947
|
lineHeight: '16px',
|
|
9904
9948
|
userSelect: 'none',
|
|
9905
9949
|
paddingRight: '1px'
|
|
@@ -9967,9 +10011,22 @@ const RowColRoot = styled$1('div', {
|
|
|
9967
10011
|
["& .".concat(rowColClasses.frequencyCount)]: _objectSpread2(_objectSpread2({
|
|
9968
10012
|
justifyContent: 'flex-end'
|
|
9969
10013
|
}, ellipsis), {}, {
|
|
9970
|
-
flex: "0
|
|
10014
|
+
flex: "0 0 ".concat(getFreqFlexBasis({
|
|
10015
|
+
sizes,
|
|
10016
|
+
frequencyMode,
|
|
10017
|
+
isGridMode,
|
|
10018
|
+
freqHitsValue
|
|
10019
|
+
})),
|
|
10020
|
+
minWidth: !isGridMode && frequencyMode !== 'P' && freqHitsValue ? sizes.freqMinWidth : 'max-content',
|
|
10021
|
+
maxWidth: getMaxFreqWidth({
|
|
10022
|
+
sizes,
|
|
10023
|
+
frequencyMode,
|
|
10024
|
+
isGridMode
|
|
10025
|
+
}),
|
|
9971
10026
|
textAlign: direction === 'rtl' ? 'left' : 'right',
|
|
9972
|
-
|
|
10027
|
+
// In RTL, we already get the 8px from the value element's padding and for
|
|
10028
|
+
// percent mode we have already adapted the width (fixed width) to the max number.
|
|
10029
|
+
paddingLeft: direction !== 'rtl' ? '8px' : 0
|
|
9973
10030
|
}),
|
|
9974
10031
|
["&.".concat(rowColClasses.barContainer)]: {
|
|
9975
10032
|
height: '100%',
|
|
@@ -10815,6 +10872,32 @@ function getRowsKeyboardNavigation(_ref) {
|
|
|
10815
10872
|
return handleKeyDown;
|
|
10816
10873
|
}
|
|
10817
10874
|
|
|
10875
|
+
function getValueTextAlign(_ref) {
|
|
10876
|
+
let {
|
|
10877
|
+
direction,
|
|
10878
|
+
cell,
|
|
10879
|
+
textAlign
|
|
10880
|
+
} = _ref;
|
|
10881
|
+
const isNumeric = !['NaN', undefined].includes(cell === null || cell === void 0 ? void 0 : cell.qNum);
|
|
10882
|
+
let valueTextAlign;
|
|
10883
|
+
const isAutoTextAlign = !textAlign || textAlign.auto;
|
|
10884
|
+
const dirToTextAlignMap = {
|
|
10885
|
+
rtl: 'right',
|
|
10886
|
+
ltr: 'left'
|
|
10887
|
+
};
|
|
10888
|
+
if (isAutoTextAlign) {
|
|
10889
|
+
if (!isNumeric) {
|
|
10890
|
+
valueTextAlign = dirToTextAlignMap[direction];
|
|
10891
|
+
} else {
|
|
10892
|
+
valueTextAlign = direction === 'rtl' ? 'left' : 'right';
|
|
10893
|
+
}
|
|
10894
|
+
} else {
|
|
10895
|
+
valueTextAlign = (textAlign === null || textAlign === void 0 ? void 0 : textAlign.align) || 'left';
|
|
10896
|
+
}
|
|
10897
|
+
const ALLOWED_OPTIONS = ['left', 'center', 'right'];
|
|
10898
|
+
return ALLOWED_OPTIONS.includes(valueTextAlign) ? valueTextAlign : 'left';
|
|
10899
|
+
}
|
|
10900
|
+
|
|
10818
10901
|
function RowColumn(_ref) {
|
|
10819
10902
|
var _cell$qText, _cell$qHighlightRange, _cell$qHighlightRange2;
|
|
10820
10903
|
let {
|
|
@@ -10850,10 +10933,10 @@ function RowColumn(_ref) {
|
|
|
10850
10933
|
columnCount = 1,
|
|
10851
10934
|
rowCount = 1,
|
|
10852
10935
|
dataOffset,
|
|
10936
|
+
deducedFrequencyMode,
|
|
10853
10937
|
focusListItems,
|
|
10854
10938
|
listCount,
|
|
10855
|
-
|
|
10856
|
-
frequencyWidth,
|
|
10939
|
+
sizes,
|
|
10857
10940
|
translator,
|
|
10858
10941
|
showSearch,
|
|
10859
10942
|
isModal
|
|
@@ -10863,6 +10946,9 @@ function RowColumn(_ref) {
|
|
|
10863
10946
|
dataLayout = 'singleColumn',
|
|
10864
10947
|
layoutOrder
|
|
10865
10948
|
} = layoutOptions;
|
|
10949
|
+
const {
|
|
10950
|
+
itemPadding
|
|
10951
|
+
} = sizes;
|
|
10866
10952
|
let cellIndex;
|
|
10867
10953
|
let styles;
|
|
10868
10954
|
const count = {
|
|
@@ -10930,26 +11016,15 @@ function RowColumn(_ref) {
|
|
|
10930
11016
|
const preventContextMenu = useCallback(event => {
|
|
10931
11017
|
event.preventDefault();
|
|
10932
11018
|
}, [checkboxes]);
|
|
11019
|
+
const valueTextAlign = useMemo$1(() => cell && getValueTextAlign({
|
|
11020
|
+
direction,
|
|
11021
|
+
cell,
|
|
11022
|
+
textAlign
|
|
11023
|
+
}), [direction, cell, textAlign]);
|
|
10933
11024
|
if (!cell) {
|
|
10934
11025
|
return null; // prevent rendering empty rows
|
|
10935
11026
|
}
|
|
10936
11027
|
|
|
10937
|
-
const isNumeric = !['NaN', undefined].includes(cell === null || cell === void 0 ? void 0 : cell.qNum);
|
|
10938
|
-
let valueTextAlign;
|
|
10939
|
-
const isAutoTextAlign = !textAlign || textAlign.auto;
|
|
10940
|
-
const dirToTextAlignMap = {
|
|
10941
|
-
rtl: 'right',
|
|
10942
|
-
ltr: 'left'
|
|
10943
|
-
};
|
|
10944
|
-
if (isAutoTextAlign) {
|
|
10945
|
-
if (!isNumeric) {
|
|
10946
|
-
valueTextAlign = dirToTextAlignMap[direction];
|
|
10947
|
-
} else {
|
|
10948
|
-
valueTextAlign = direction === 'rtl' ? 'left' : 'right';
|
|
10949
|
-
}
|
|
10950
|
-
} else {
|
|
10951
|
-
valueTextAlign = (textAlign === null || textAlign === void 0 ? void 0 : textAlign.align) || 'left';
|
|
10952
|
-
}
|
|
10953
11028
|
const isGridCol = dataLayout === 'grid' && layoutOrder === 'column';
|
|
10954
11029
|
const label = (_cell$qText = cell === null || cell === void 0 ? void 0 : cell.qText) !== null && _cell$qText !== void 0 ? _cell$qText : '';
|
|
10955
11030
|
// Search highlights. Split up labelText span into several and add the highlighted class to matching sub-strings.
|
|
@@ -10964,17 +11039,16 @@ function RowColumn(_ref) {
|
|
|
10964
11039
|
display: 'flex',
|
|
10965
11040
|
fontSize: '8px'
|
|
10966
11041
|
};
|
|
11042
|
+
const isRtl = direction === 'rtl';
|
|
10967
11043
|
const cellStyle = {
|
|
10968
11044
|
display: 'flex',
|
|
10969
11045
|
alignItems: 'center',
|
|
10970
|
-
minWidth: 0,
|
|
10971
11046
|
flexGrow: 1,
|
|
10972
|
-
paddingLeft:
|
|
10973
|
-
paddingRight: checkboxes ? 0 :
|
|
11047
|
+
paddingLeft: isRtl ? 8 : checkboxes ? 0 : undefined,
|
|
11048
|
+
paddingRight: checkboxes ? 0 : isRtl ? 8 : 0,
|
|
10974
11049
|
justifyContent: valueTextAlign
|
|
10975
11050
|
};
|
|
10976
11051
|
const isFirstElement = index === 0;
|
|
10977
|
-
const flexBasisVal = checkboxes ? 'auto' : 'max-content';
|
|
10978
11052
|
const showLock = isSelected && isLocked;
|
|
10979
11053
|
const showTick = !checkboxes && isSelected && !isLocked;
|
|
10980
11054
|
const showIcon = !checkboxes && sizePermitsTickOrLock;
|
|
@@ -10987,15 +11061,18 @@ function RowColumn(_ref) {
|
|
|
10987
11061
|
maxIndex: count.max,
|
|
10988
11062
|
showSearch
|
|
10989
11063
|
});
|
|
11064
|
+
const freqHitsValue = !isRtl && valueTextAlign === 'right' || isRtl && valueTextAlign === 'left';
|
|
10990
11065
|
return /*#__PURE__*/React__default.createElement(RowColRoot$1, {
|
|
10991
11066
|
className: rowColClasses.barContainer,
|
|
10992
|
-
|
|
11067
|
+
checkboxes: checkboxes,
|
|
10993
11068
|
style: styles,
|
|
10994
11069
|
isGridCol: isGridCol,
|
|
10995
11070
|
isGridMode: dataLayout === 'grid',
|
|
10996
11071
|
dense: dense,
|
|
10997
|
-
frequencyWidth: frequencyWidth,
|
|
10998
11072
|
direction: direction,
|
|
11073
|
+
sizes: sizes,
|
|
11074
|
+
frequencyMode: deducedFrequencyMode,
|
|
11075
|
+
freqHitsValue: freqHitsValue,
|
|
10999
11076
|
"data-testid": "listbox.item"
|
|
11000
11077
|
}, /*#__PURE__*/React__default.createElement(ItemGrid, {
|
|
11001
11078
|
role: "row",
|
|
@@ -12619,7 +12696,7 @@ function getListBoxComponents(_ref) {
|
|
|
12619
12696
|
pages,
|
|
12620
12697
|
selectDisabled,
|
|
12621
12698
|
interactionEvents,
|
|
12622
|
-
|
|
12699
|
+
deducedFrequencyMode,
|
|
12623
12700
|
histogram,
|
|
12624
12701
|
isSingleSelect,
|
|
12625
12702
|
select,
|
|
@@ -12649,12 +12726,10 @@ function getListBoxComponents(_ref) {
|
|
|
12649
12726
|
} = layout || {};
|
|
12650
12727
|
const {
|
|
12651
12728
|
columnWidth,
|
|
12652
|
-
itemPadding,
|
|
12653
12729
|
listHeight,
|
|
12654
12730
|
itemHeight,
|
|
12655
12731
|
rowCount,
|
|
12656
|
-
columnCount
|
|
12657
|
-
frequencyWidth
|
|
12732
|
+
columnCount
|
|
12658
12733
|
} = sizes || {};
|
|
12659
12734
|
const itemWidth = layoutOptions.dataLayout === 'grid' ? columnWidth : width;
|
|
12660
12735
|
const showTick = itemWidth > REMOVE_TICK_LIMIT;
|
|
@@ -12675,12 +12750,11 @@ function getListBoxComponents(_ref) {
|
|
|
12675
12750
|
}, isLocked || selectDisabled() ? {} : interactionEvents), {}, {
|
|
12676
12751
|
checkboxes,
|
|
12677
12752
|
layoutOptions,
|
|
12678
|
-
|
|
12753
|
+
deducedFrequencyMode,
|
|
12679
12754
|
freqIsAllowed,
|
|
12680
12755
|
isSingleSelect,
|
|
12681
12756
|
textAlign,
|
|
12682
|
-
|
|
12683
|
-
frequencyWidth,
|
|
12757
|
+
sizes,
|
|
12684
12758
|
actions: {
|
|
12685
12759
|
select,
|
|
12686
12760
|
confirm: () => selections === null || selections === void 0 ? void 0 : selections.confirm.call(selections),
|
|
@@ -12710,7 +12784,7 @@ function getListBoxComponents(_ref) {
|
|
|
12710
12784
|
local.current.listRef = ref;
|
|
12711
12785
|
return /*#__PURE__*/React__default.createElement(StyledFixedSizeList
|
|
12712
12786
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
12713
|
-
, _extends$
|
|
12787
|
+
, _extends$3({}, commonComponentOptions, {
|
|
12714
12788
|
dataTestid: "fixed-size-list",
|
|
12715
12789
|
scrollDisabled: constraints === null || constraints === void 0 ? void 0 : constraints.active,
|
|
12716
12790
|
height: listHeight,
|
|
@@ -12787,7 +12861,7 @@ function getListBoxComponents(_ref) {
|
|
|
12787
12861
|
};
|
|
12788
12862
|
return /*#__PURE__*/React__default.createElement(StyledFixedSizeGrid
|
|
12789
12863
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
12790
|
-
, _extends$
|
|
12864
|
+
, _extends$3({}, commonComponentOptions, {
|
|
12791
12865
|
dataTestid: "fixed-size-grid",
|
|
12792
12866
|
scrollDisabled: constraints === null || constraints === void 0 ? void 0 : constraints.active,
|
|
12793
12867
|
height: gridHeight,
|
|
@@ -12865,16 +12939,46 @@ function calculateRowMode(_ref) {
|
|
|
12865
12939
|
};
|
|
12866
12940
|
}
|
|
12867
12941
|
|
|
12868
|
-
|
|
12942
|
+
const getContext = () => {
|
|
12943
|
+
const fragment = document.createDocumentFragment();
|
|
12944
|
+
const canvas = document.createElement('canvas');
|
|
12945
|
+
fragment.appendChild(canvas);
|
|
12946
|
+
return canvas.getContext('2d');
|
|
12947
|
+
};
|
|
12948
|
+
const getTextWidth = (currentText, font) => {
|
|
12949
|
+
const context = getContext();
|
|
12950
|
+
context.font = font;
|
|
12951
|
+
if (Array.isArray(currentText)) {
|
|
12952
|
+
return Math.max(...currentText.map(t => context.measureText(t).width));
|
|
12953
|
+
}
|
|
12954
|
+
const metrics = context.measureText(currentText);
|
|
12955
|
+
return Math.ceil(metrics.width || 0);
|
|
12956
|
+
};
|
|
12957
|
+
const useTextWidth = options => {
|
|
12958
|
+
const textOptions = useMemo$1(() => 'text' in options ? options : {}, [options]);
|
|
12959
|
+
return useMemo$1(() => getTextWidth(textOptions.text, textOptions.font || '12px Source Sans Pro'), [textOptions.text, textOptions.font]);
|
|
12960
|
+
};
|
|
12961
|
+
|
|
12962
|
+
function getMeasureText(layoutOrNumber) {
|
|
12963
|
+
if (!layoutOrNumber) {
|
|
12964
|
+
return '';
|
|
12965
|
+
}
|
|
12966
|
+
const maxGlyphCount = typeof layoutOrNumber === 'number' ? layoutOrNumber : layoutOrNumber.qListObject.qDimensionInfo.qApprMaxGlyphCount;
|
|
12967
|
+
const measureString = Array(maxGlyphCount).fill('M').join('');
|
|
12968
|
+
return measureString;
|
|
12969
|
+
}
|
|
12970
|
+
|
|
12971
|
+
function useListSizes(_ref) {
|
|
12972
|
+
var _theme$listBox;
|
|
12869
12973
|
let {
|
|
12870
12974
|
layout,
|
|
12871
12975
|
width,
|
|
12872
12976
|
height,
|
|
12873
12977
|
listCount,
|
|
12874
12978
|
count,
|
|
12875
|
-
textWidth,
|
|
12876
12979
|
freqIsAllowed,
|
|
12877
|
-
checkboxes
|
|
12980
|
+
checkboxes,
|
|
12981
|
+
theme
|
|
12878
12982
|
} = _ref;
|
|
12879
12983
|
const {
|
|
12880
12984
|
layoutOptions = {}
|
|
@@ -12886,7 +12990,24 @@ function getListSizes(_ref) {
|
|
|
12886
12990
|
dense,
|
|
12887
12991
|
dataLayout
|
|
12888
12992
|
} = layoutOptions;
|
|
12889
|
-
const
|
|
12993
|
+
const {
|
|
12994
|
+
fontSize = '12px',
|
|
12995
|
+
fontFamily = 'Source sans pro'
|
|
12996
|
+
} = ((_theme$listBox = theme.listBox) === null || _theme$listBox === void 0 ? void 0 : _theme$listBox.content) || {};
|
|
12997
|
+
const font = "".concat(fontSize, " ").concat(fontFamily); // font format as supported by HTML canvas
|
|
12998
|
+
const textWidth = useTextWidth({
|
|
12999
|
+
text: getMeasureText(layout),
|
|
13000
|
+
font
|
|
13001
|
+
});
|
|
13002
|
+
const freqMinWidth = useTextWidth({
|
|
13003
|
+
text: getMeasureText(5),
|
|
13004
|
+
font
|
|
13005
|
+
});
|
|
13006
|
+
const freqMaxWidth = useTextWidth({
|
|
13007
|
+
text: getMeasureText(8),
|
|
13008
|
+
font
|
|
13009
|
+
});
|
|
13010
|
+
const frequencyAddWidth = freqIsAllowed ? freqMinWidth : 0;
|
|
12890
13011
|
const checkboxAddWidth = checkboxes ? CHECKBOX_WIDTH : 0;
|
|
12891
13012
|
const tickIconWidth = CHECKBOX_WIDTH;
|
|
12892
13013
|
let dynamicItemMinWidth = ITEM_MIN_WIDTH + frequencyAddWidth + checkboxAddWidth;
|
|
@@ -12967,6 +13088,7 @@ function getListSizes(_ref) {
|
|
|
12967
13088
|
overflowStyling,
|
|
12968
13089
|
itemHeight,
|
|
12969
13090
|
listHeight,
|
|
13091
|
+
listWidth: width,
|
|
12970
13092
|
scrollBarWidth: SCROLL_BAR_WIDTH,
|
|
12971
13093
|
count,
|
|
12972
13094
|
listCount: limitedListCount,
|
|
@@ -12975,42 +13097,12 @@ function getListSizes(_ref) {
|
|
|
12975
13097
|
column: maxColumnCount
|
|
12976
13098
|
},
|
|
12977
13099
|
itemPadding,
|
|
12978
|
-
|
|
13100
|
+
textWidth,
|
|
13101
|
+
freqMinWidth,
|
|
13102
|
+
freqMaxWidth
|
|
12979
13103
|
};
|
|
12980
13104
|
}
|
|
12981
13105
|
|
|
12982
|
-
const getContext = () => {
|
|
12983
|
-
const fragment = document.createDocumentFragment();
|
|
12984
|
-
const canvas = document.createElement('canvas');
|
|
12985
|
-
fragment.appendChild(canvas);
|
|
12986
|
-
return canvas.getContext('2d');
|
|
12987
|
-
};
|
|
12988
|
-
const getTextWidth = (currentText, font) => {
|
|
12989
|
-
const context = getContext();
|
|
12990
|
-
context.font = font;
|
|
12991
|
-
if (Array.isArray(currentText)) {
|
|
12992
|
-
return Math.max(...currentText.map(t => context.measureText(t).width));
|
|
12993
|
-
}
|
|
12994
|
-
const metrics = context.measureText(currentText);
|
|
12995
|
-
return metrics.width;
|
|
12996
|
-
};
|
|
12997
|
-
const useTextWidth = options => {
|
|
12998
|
-
const textOptions = useMemo$1(() => 'text' in options ? options : {}, [options]);
|
|
12999
|
-
return useMemo$1(() => getTextWidth(textOptions.text, textOptions.font || '14px Source Sans Pro'), [textOptions.text, textOptions.font]);
|
|
13000
|
-
};
|
|
13001
|
-
|
|
13002
|
-
function getMeasureText(layout) {
|
|
13003
|
-
if (!layout) {
|
|
13004
|
-
return '';
|
|
13005
|
-
}
|
|
13006
|
-
const maxGlyphCount = layout.qListObject.qDimensionInfo.qApprMaxGlyphCount;
|
|
13007
|
-
let measureString = '';
|
|
13008
|
-
for (let i = 0; i < maxGlyphCount; i++) {
|
|
13009
|
-
measureString += 'M';
|
|
13010
|
-
}
|
|
13011
|
-
return measureString;
|
|
13012
|
-
}
|
|
13013
|
-
|
|
13014
13106
|
function getHorizontalMinBatchSize(_ref) {
|
|
13015
13107
|
let {
|
|
13016
13108
|
width,
|
|
@@ -13202,6 +13294,7 @@ function getSvgIconUtilityClass(slot) {
|
|
|
13202
13294
|
}
|
|
13203
13295
|
generateUtilityClasses('MuiSvgIcon', ['root', 'colorPrimary', 'colorSecondary', 'colorAction', 'colorError', 'colorDisabled', 'fontSizeInherit', 'fontSizeSmall', 'fontSizeMedium', 'fontSizeLarge']);
|
|
13204
13296
|
|
|
13297
|
+
const _excluded$5 = ["children", "className", "color", "component", "fontSize", "htmlColor", "inheritViewBox", "titleAccess", "viewBox"];
|
|
13205
13298
|
const useUtilityClasses = ownerState => {
|
|
13206
13299
|
const {
|
|
13207
13300
|
color,
|
|
@@ -13257,58 +13350,56 @@ const SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {
|
|
|
13257
13350
|
name: 'MuiSvgIcon'
|
|
13258
13351
|
});
|
|
13259
13352
|
const {
|
|
13260
|
-
|
|
13261
|
-
|
|
13262
|
-
|
|
13263
|
-
|
|
13264
|
-
|
|
13265
|
-
|
|
13266
|
-
|
|
13267
|
-
|
|
13268
|
-
|
|
13269
|
-
|
|
13270
|
-
|
|
13271
|
-
const ownerState = {
|
|
13272
|
-
...props,
|
|
13353
|
+
children,
|
|
13354
|
+
className,
|
|
13355
|
+
color = 'inherit',
|
|
13356
|
+
component = 'svg',
|
|
13357
|
+
fontSize = 'medium',
|
|
13358
|
+
htmlColor,
|
|
13359
|
+
inheritViewBox = false,
|
|
13360
|
+
titleAccess,
|
|
13361
|
+
viewBox = '0 0 24 24'
|
|
13362
|
+
} = props,
|
|
13363
|
+
other = _objectWithoutPropertiesLoose$1(props, _excluded$5);
|
|
13364
|
+
const ownerState = _extends$2({}, props, {
|
|
13273
13365
|
color,
|
|
13274
13366
|
component,
|
|
13275
13367
|
fontSize,
|
|
13276
13368
|
instanceFontSize: inProps.fontSize,
|
|
13277
13369
|
inheritViewBox,
|
|
13278
13370
|
viewBox
|
|
13279
|
-
};
|
|
13371
|
+
});
|
|
13280
13372
|
const more = {};
|
|
13281
13373
|
if (!inheritViewBox) {
|
|
13282
13374
|
more.viewBox = viewBox;
|
|
13283
13375
|
}
|
|
13284
13376
|
const classes = useUtilityClasses(ownerState);
|
|
13285
|
-
return /*#__PURE__*/jsxRuntimeExports.jsxs(SvgIconRoot, {
|
|
13377
|
+
return /*#__PURE__*/jsxRuntimeExports.jsxs(SvgIconRoot, _extends$2({
|
|
13286
13378
|
as: component,
|
|
13287
13379
|
className: clsx(classes.root, className),
|
|
13288
13380
|
focusable: "false",
|
|
13289
13381
|
color: htmlColor,
|
|
13290
13382
|
"aria-hidden": titleAccess ? undefined : true,
|
|
13291
13383
|
role: titleAccess ? 'img' : undefined,
|
|
13292
|
-
ref: ref
|
|
13293
|
-
|
|
13294
|
-
...other,
|
|
13384
|
+
ref: ref
|
|
13385
|
+
}, more, other, {
|
|
13295
13386
|
ownerState: ownerState,
|
|
13296
13387
|
children: [children, titleAccess ? /*#__PURE__*/jsxRuntimeExports.jsx("title", {
|
|
13297
13388
|
children: titleAccess
|
|
13298
13389
|
}) : null]
|
|
13299
|
-
});
|
|
13390
|
+
}));
|
|
13300
13391
|
});
|
|
13301
13392
|
SvgIcon.muiName = 'SvgIcon';
|
|
13302
13393
|
var SvgIcon$1 = SvgIcon;
|
|
13303
13394
|
|
|
13304
13395
|
function createSvgIcon(path, displayName) {
|
|
13305
13396
|
function Component(props, ref) {
|
|
13306
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx(SvgIcon$1, {
|
|
13397
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(SvgIcon$1, _extends$2({
|
|
13307
13398
|
"data-testid": `${displayName}Icon`,
|
|
13308
|
-
ref: ref
|
|
13309
|
-
|
|
13399
|
+
ref: ref
|
|
13400
|
+
}, props, {
|
|
13310
13401
|
children: path
|
|
13311
|
-
});
|
|
13402
|
+
}));
|
|
13312
13403
|
}
|
|
13313
13404
|
Component.muiName = SvgIcon$1.muiName;
|
|
13314
13405
|
return /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(Component));
|
|
@@ -13491,7 +13582,7 @@ function getFrequencyAllowed(_ref) {
|
|
|
13491
13582
|
const {
|
|
13492
13583
|
frequencyEnabled = false
|
|
13493
13584
|
} = (layout === null || layout === void 0 ? void 0 : layout.qListObject) || {};
|
|
13494
|
-
const hasValidFreqOption = !['
|
|
13585
|
+
const hasValidFreqOption = !['N', undefined].includes(frequencyMode);
|
|
13495
13586
|
return !!(widthPermitsFreq && (hasValidFreqOption || frequencyEnabled));
|
|
13496
13587
|
}
|
|
13497
13588
|
|
|
@@ -13538,6 +13629,21 @@ const useFrequencyMax = (app, layout) => {
|
|
|
13538
13629
|
};
|
|
13539
13630
|
};
|
|
13540
13631
|
|
|
13632
|
+
function deduceFrequencyMode(pages) {
|
|
13633
|
+
const hasPercentSign = pages.some(_ref => {
|
|
13634
|
+
let {
|
|
13635
|
+
qMatrix
|
|
13636
|
+
} = _ref;
|
|
13637
|
+
return qMatrix.some(_ref2 => {
|
|
13638
|
+
var _item$qFrequency;
|
|
13639
|
+
let [item] = _ref2;
|
|
13640
|
+
return !!((_item$qFrequency = item.qFrequency) !== null && _item$qFrequency !== void 0 && _item$qFrequency.match('%'));
|
|
13641
|
+
});
|
|
13642
|
+
});
|
|
13643
|
+
const OTHER = '-'; // treat all other as '-' (change later if we need to identify other modes)
|
|
13644
|
+
return hasPercentSign ? 'P' : OTHER;
|
|
13645
|
+
}
|
|
13646
|
+
|
|
13541
13647
|
const _excluded$4 = ["isLoadingData"];
|
|
13542
13648
|
const DEFAULT_MIN_BATCH_SIZE = 100;
|
|
13543
13649
|
const StyledWrapper = styled$4('div')(() => ({
|
|
@@ -13554,6 +13660,7 @@ function ListBox(_ref) {
|
|
|
13554
13660
|
model,
|
|
13555
13661
|
app,
|
|
13556
13662
|
constraints,
|
|
13663
|
+
theme,
|
|
13557
13664
|
layout,
|
|
13558
13665
|
selections,
|
|
13559
13666
|
selectionState,
|
|
@@ -13709,10 +13816,6 @@ function ListBox(_ref) {
|
|
|
13709
13816
|
useEffect$1(() => {
|
|
13710
13817
|
fetchData();
|
|
13711
13818
|
}, [layout, local.current.dataOffset]);
|
|
13712
|
-
const textWidth = useTextWidth({
|
|
13713
|
-
text: getMeasureText(layout),
|
|
13714
|
-
font: '14px Source sans pro'
|
|
13715
|
-
});
|
|
13716
13819
|
let minimumBatchSize = DEFAULT_MIN_BATCH_SIZE;
|
|
13717
13820
|
const isVertical = layoutOptions.dataLayout !== 'grid';
|
|
13718
13821
|
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;
|
|
@@ -13729,15 +13832,16 @@ function ListBox(_ref) {
|
|
|
13729
13832
|
layout,
|
|
13730
13833
|
frequencyMode
|
|
13731
13834
|
});
|
|
13732
|
-
const
|
|
13835
|
+
const deducedFrequencyMode = deduceFrequencyMode(pages);
|
|
13836
|
+
const sizes = useListSizes({
|
|
13733
13837
|
layout,
|
|
13734
13838
|
width,
|
|
13735
13839
|
height,
|
|
13736
13840
|
listCount: unlimitedListCount,
|
|
13737
13841
|
count,
|
|
13738
|
-
textWidth,
|
|
13739
13842
|
freqIsAllowed,
|
|
13740
|
-
checkboxes
|
|
13843
|
+
checkboxes,
|
|
13844
|
+
theme
|
|
13741
13845
|
});
|
|
13742
13846
|
if (sizes.columnWidth) {
|
|
13743
13847
|
// In grid mode, where we have a dynamic item width, get a second opinion on showing/hiding frequency.
|
|
@@ -13814,7 +13918,7 @@ function ListBox(_ref) {
|
|
|
13814
13918
|
height,
|
|
13815
13919
|
width,
|
|
13816
13920
|
checkboxes,
|
|
13817
|
-
|
|
13921
|
+
deducedFrequencyMode,
|
|
13818
13922
|
histogram,
|
|
13819
13923
|
keyboard,
|
|
13820
13924
|
showGray,
|
|
@@ -14185,7 +14289,7 @@ const More$1 = React__default.forwardRef((_ref3, ref) => {
|
|
|
14185
14289
|
const autoFocusIndex = actions.findIndex(action => !action.disabled);
|
|
14186
14290
|
return showActions && /*#__PURE__*/React__default.createElement(StyledPopover$1
|
|
14187
14291
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
14188
|
-
, _extends$
|
|
14292
|
+
, _extends$3({}, popoverProps, {
|
|
14189
14293
|
onClose: onCloseOrActionClick,
|
|
14190
14294
|
ref: ref,
|
|
14191
14295
|
open: show,
|
|
@@ -14303,9 +14407,7 @@ function getActionsKeyDownHandler(_ref) {
|
|
|
14303
14407
|
const PREFIX$7 = 'ActionsToolbar';
|
|
14304
14408
|
const classes$7 = {
|
|
14305
14409
|
item: "".concat(PREFIX$7, "-item"),
|
|
14306
|
-
itemSpacing: "".concat(PREFIX$7, "-itemSpacing")
|
|
14307
|
-
firstItemSpacing: "".concat(PREFIX$7, "-firstItemSpacing"),
|
|
14308
|
-
lastItemSpacing: "".concat(PREFIX$7, "-lastItemSpacing")
|
|
14410
|
+
itemSpacing: "".concat(PREFIX$7, "-itemSpacing")
|
|
14309
14411
|
};
|
|
14310
14412
|
const StyledPopover = styled$1(Popover)(_ref => {
|
|
14311
14413
|
let {
|
|
@@ -14313,13 +14415,7 @@ const StyledPopover = styled$1(Popover)(_ref => {
|
|
|
14313
14415
|
} = _ref;
|
|
14314
14416
|
return {
|
|
14315
14417
|
["& .".concat(classes$7.itemSpacing)]: {
|
|
14316
|
-
padding: theme.spacing(0, 0.
|
|
14317
|
-
},
|
|
14318
|
-
["& .".concat(classes$7.firstItemSpacing)]: {
|
|
14319
|
-
padding: theme.spacing(0, 0.5, 0, 0)
|
|
14320
|
-
},
|
|
14321
|
-
["& .".concat(classes$7.lastItemSpacing)]: {
|
|
14322
|
-
padding: theme.spacing(0, 0, 0, 0.5)
|
|
14418
|
+
padding: theme.spacing(0, 0.25)
|
|
14323
14419
|
}
|
|
14324
14420
|
};
|
|
14325
14421
|
});
|
|
@@ -14338,8 +14434,6 @@ const ActionsGroup = React__default.forwardRef((_ref2, ref) => {
|
|
|
14338
14434
|
className,
|
|
14339
14435
|
ariaExpanded = false,
|
|
14340
14436
|
actions = [],
|
|
14341
|
-
first = false,
|
|
14342
|
-
last = false,
|
|
14343
14437
|
addAnchor = false,
|
|
14344
14438
|
isRtl = false
|
|
14345
14439
|
} = _ref2;
|
|
@@ -14350,31 +14444,17 @@ const ActionsGroup = React__default.forwardRef((_ref2, ref) => {
|
|
|
14350
14444
|
flexDirection: isRtl ? 'row-reverse' : 'row',
|
|
14351
14445
|
wrap: "nowrap",
|
|
14352
14446
|
className: className
|
|
14353
|
-
}, actions.map((e, ix) => {
|
|
14354
|
-
|
|
14355
|
-
|
|
14356
|
-
|
|
14357
|
-
|
|
14358
|
-
|
|
14359
|
-
|
|
14360
|
-
|
|
14361
|
-
|
|
14362
|
-
|
|
14363
|
-
|
|
14364
|
-
cls = [classes$7.itemSpacing, classes$7.item];
|
|
14365
|
-
}
|
|
14366
|
-
return /*#__PURE__*/React__default.createElement(Grid, {
|
|
14367
|
-
item: true,
|
|
14368
|
-
key: e.key,
|
|
14369
|
-
className: cls.join(' ').trim()
|
|
14370
|
-
}, /*#__PURE__*/React__default.createElement(Item, {
|
|
14371
|
-
ariaExpanded: ariaExpanded,
|
|
14372
|
-
key: e.key,
|
|
14373
|
-
item: e,
|
|
14374
|
-
ref: ix === 0 ? ref : null,
|
|
14375
|
-
addAnchor: addAnchor
|
|
14376
|
-
}));
|
|
14377
|
-
})) : null;
|
|
14447
|
+
}, actions.map((e, ix) => /*#__PURE__*/React__default.createElement(Grid, {
|
|
14448
|
+
item: true,
|
|
14449
|
+
key: e.key,
|
|
14450
|
+
className: "".concat(classes$7.itemSpacing, " ").concat(classes$7.item)
|
|
14451
|
+
}, /*#__PURE__*/React__default.createElement(Item, {
|
|
14452
|
+
ariaExpanded: ariaExpanded,
|
|
14453
|
+
key: e.key,
|
|
14454
|
+
item: e,
|
|
14455
|
+
ref: ix === 0 ? ref : null,
|
|
14456
|
+
addAnchor: addAnchor
|
|
14457
|
+
})))) : null;
|
|
14378
14458
|
});
|
|
14379
14459
|
const popoverStyle = {
|
|
14380
14460
|
pointerEvents: 'none'
|
|
@@ -14418,7 +14498,7 @@ function ActionsToolbar(_ref3) {
|
|
|
14418
14498
|
} = useContext(InstanceContext);
|
|
14419
14499
|
const [showMoreItems, setShowMoreItems] = useState$1(false);
|
|
14420
14500
|
const popoverAnchorOrigin = {
|
|
14421
|
-
vertical:
|
|
14501
|
+
vertical: 12,
|
|
14422
14502
|
horizontal: ((_popover$anchorEl$cli = (_popover$anchorEl = popover.anchorEl) === null || _popover$anchorEl === void 0 ? void 0 : _popover$anchorEl.clientWidth) !== null && _popover$anchorEl$cli !== void 0 ? _popover$anchorEl$cli : 0) - 7
|
|
14423
14503
|
};
|
|
14424
14504
|
const actionsRef = useRef();
|
|
@@ -14494,17 +14574,13 @@ function ActionsToolbar(_ref3) {
|
|
|
14494
14574
|
flexDirection: isRtl ? 'row-reverse' : 'row'
|
|
14495
14575
|
}
|
|
14496
14576
|
}, showActions && /*#__PURE__*/React__default.createElement(ActionsGroup, {
|
|
14497
|
-
actions: newActions
|
|
14498
|
-
first: true,
|
|
14499
|
-
last: !showMore && !selections.show
|
|
14577
|
+
actions: newActions
|
|
14500
14578
|
}), showMore && /*#__PURE__*/React__default.createElement(ActionsGroup, {
|
|
14501
14579
|
id: "actions-toolbar-show-more",
|
|
14502
14580
|
"data-testid": "actions-toolbar-show-more",
|
|
14503
14581
|
ref: moreRef,
|
|
14504
14582
|
ariaExpanded: showMoreItems,
|
|
14505
14583
|
actions: [moreItem],
|
|
14506
|
-
first: !showActions,
|
|
14507
|
-
last: !selections.show,
|
|
14508
14584
|
addAnchor: true
|
|
14509
14585
|
}), showDivider && /*#__PURE__*/React__default.createElement(Grid, {
|
|
14510
14586
|
item: true,
|
|
@@ -14515,8 +14591,6 @@ function ActionsToolbar(_ref3) {
|
|
|
14515
14591
|
})), selections.show && /*#__PURE__*/React__default.createElement(ActionsGroup, {
|
|
14516
14592
|
className: "actions-toolbar-default-actions",
|
|
14517
14593
|
actions: defaultSelectionActions,
|
|
14518
|
-
first: !showActions && !showMore,
|
|
14519
|
-
last: true,
|
|
14520
14594
|
isRtl: isRtl
|
|
14521
14595
|
}), showMoreItems && /*#__PURE__*/React__default.createElement(More$1, {
|
|
14522
14596
|
show: showMoreItems,
|
|
@@ -14542,7 +14616,7 @@ function ActionsToolbar(_ref3) {
|
|
|
14542
14616
|
className: ActionToolbarElement.className,
|
|
14543
14617
|
style: {
|
|
14544
14618
|
pointerEvents: 'auto',
|
|
14545
|
-
padding: theme.spacing(0.
|
|
14619
|
+
padding: theme.spacing(0.5, 0.25)
|
|
14546
14620
|
}
|
|
14547
14621
|
}
|
|
14548
14622
|
}, Actions) : show && Actions;
|
|
@@ -16131,18 +16205,6 @@ function mount(_ref2) {
|
|
|
16131
16205
|
}), element, uid());
|
|
16132
16206
|
}
|
|
16133
16207
|
|
|
16134
|
-
var $parcel$global =
|
|
16135
|
-
typeof globalThis !== 'undefined'
|
|
16136
|
-
? globalThis
|
|
16137
|
-
: typeof self !== 'undefined'
|
|
16138
|
-
? self
|
|
16139
|
-
: typeof window !== 'undefined'
|
|
16140
|
-
? window
|
|
16141
|
-
: typeof global !== 'undefined'
|
|
16142
|
-
? global
|
|
16143
|
-
: {};
|
|
16144
|
-
|
|
16145
|
-
var $3e40d2fd7fdb47d2$exports = {};
|
|
16146
16208
|
/**
|
|
16147
16209
|
* Detect Element Resize.
|
|
16148
16210
|
* https://github.com/sdecima/javascript-detect-element-resize
|
|
@@ -16153,335 +16215,370 @@ var $3e40d2fd7fdb47d2$exports = {};
|
|
|
16153
16215
|
* 2) Defer initialization code via a top-level function wrapper (to support SSR).
|
|
16154
16216
|
* 3) Avoid unnecessary reflows by not measuring size for scroll events bubbling from children.
|
|
16155
16217
|
* 4) Add nonce for style element.
|
|
16156
|
-
|
|
16157
|
-
|
|
16158
|
-
|
|
16159
|
-
|
|
16160
|
-
|
|
16161
|
-
|
|
16162
|
-
|
|
16163
|
-
|
|
16164
|
-
|
|
16165
|
-
|
|
16166
|
-
|
|
16167
|
-
|
|
16168
|
-
const $3e40d2fd7fdb47d2$var$requestAnimationFrameFn = $3e40d2fd7fdb47d2$var$windowObject.requestAnimationFrame || $3e40d2fd7fdb47d2$var$windowObject.mozRequestAnimationFrame || $3e40d2fd7fdb47d2$var$windowObject.webkitRequestAnimationFrame;
|
|
16169
|
-
if ($3e40d2fd7fdb47d2$var$cancelAnimationFrameFn == null || $3e40d2fd7fdb47d2$var$requestAnimationFrameFn == null) {
|
|
16170
|
-
// For environments that don't support animation frame,
|
|
16171
|
-
// fallback to a setTimeout based approach.
|
|
16172
|
-
$3e40d2fd7fdb47d2$var$cancelFrame = $3e40d2fd7fdb47d2$var$clearTimeoutFn;
|
|
16173
|
-
$3e40d2fd7fdb47d2$var$requestFrame = function requestAnimationFrameViaSetTimeout(callback) {
|
|
16174
|
-
return $3e40d2fd7fdb47d2$var$setTimeoutFn(callback, $3e40d2fd7fdb47d2$var$TIMEOUT_DURATION);
|
|
16175
|
-
};
|
|
16218
|
+
* 5) Use 'export' statement over 'module.exports' assignment
|
|
16219
|
+
**/
|
|
16220
|
+
|
|
16221
|
+
// Check `document` and `window` in case of server-side rendering
|
|
16222
|
+
let windowObject;
|
|
16223
|
+
if (typeof window !== "undefined") {
|
|
16224
|
+
windowObject = window;
|
|
16225
|
+
|
|
16226
|
+
// eslint-disable-next-line no-restricted-globals
|
|
16227
|
+
} else if (typeof self !== "undefined") {
|
|
16228
|
+
// eslint-disable-next-line no-restricted-globals
|
|
16229
|
+
windowObject = self;
|
|
16176
16230
|
} else {
|
|
16177
|
-
|
|
16178
|
-
|
|
16179
|
-
|
|
16180
|
-
|
|
16181
|
-
|
|
16182
|
-
|
|
16183
|
-
|
|
16184
|
-
|
|
16185
|
-
|
|
16186
|
-
|
|
16187
|
-
|
|
16188
|
-
|
|
16189
|
-
|
|
16190
|
-
|
|
16191
|
-
|
|
16192
|
-
|
|
16193
|
-
|
|
16194
|
-
|
|
16195
|
-
|
|
16196
|
-
|
|
16197
|
-
|
|
16231
|
+
windowObject = global;
|
|
16232
|
+
}
|
|
16233
|
+
let cancelFrame = null;
|
|
16234
|
+
let requestFrame = null;
|
|
16235
|
+
const TIMEOUT_DURATION = 20;
|
|
16236
|
+
const clearTimeoutFn = windowObject.clearTimeout;
|
|
16237
|
+
const setTimeoutFn = windowObject.setTimeout;
|
|
16238
|
+
const cancelAnimationFrameFn = windowObject.cancelAnimationFrame || windowObject.mozCancelAnimationFrame || windowObject.webkitCancelAnimationFrame;
|
|
16239
|
+
const requestAnimationFrameFn = windowObject.requestAnimationFrame || windowObject.mozRequestAnimationFrame || windowObject.webkitRequestAnimationFrame;
|
|
16240
|
+
if (cancelAnimationFrameFn == null || requestAnimationFrameFn == null) {
|
|
16241
|
+
// For environments that don't support animation frame,
|
|
16242
|
+
// fallback to a setTimeout based approach.
|
|
16243
|
+
cancelFrame = clearTimeoutFn;
|
|
16244
|
+
requestFrame = function requestAnimationFrameViaSetTimeout(callback) {
|
|
16245
|
+
return setTimeoutFn(callback, TIMEOUT_DURATION);
|
|
16246
|
+
};
|
|
16247
|
+
} else {
|
|
16248
|
+
// Counter intuitively, environments that support animation frames can be trickier.
|
|
16249
|
+
// Chrome's "Throttle non-visible cross-origin iframes" flag can prevent rAFs from being called.
|
|
16250
|
+
// In this case, we should fallback to a setTimeout() implementation.
|
|
16251
|
+
cancelFrame = function cancelFrame([animationFrameID, timeoutID]) {
|
|
16252
|
+
cancelAnimationFrameFn(animationFrameID);
|
|
16253
|
+
clearTimeoutFn(timeoutID);
|
|
16254
|
+
};
|
|
16255
|
+
requestFrame = function requestAnimationFrameWithSetTimeoutFallback(callback) {
|
|
16256
|
+
const animationFrameID = requestAnimationFrameFn(function animationFrameCallback() {
|
|
16257
|
+
clearTimeoutFn(timeoutID);
|
|
16258
|
+
callback();
|
|
16259
|
+
});
|
|
16260
|
+
const timeoutID = setTimeoutFn(function timeoutCallback() {
|
|
16261
|
+
cancelAnimationFrameFn(animationFrameID);
|
|
16262
|
+
callback();
|
|
16263
|
+
}, TIMEOUT_DURATION);
|
|
16264
|
+
return [animationFrameID, timeoutID];
|
|
16265
|
+
};
|
|
16198
16266
|
}
|
|
16199
|
-
function
|
|
16200
|
-
|
|
16201
|
-
|
|
16202
|
-
|
|
16203
|
-
|
|
16204
|
-
|
|
16205
|
-
|
|
16206
|
-
|
|
16207
|
-
|
|
16208
|
-
|
|
16209
|
-
|
|
16210
|
-
|
|
16211
|
-
|
|
16212
|
-
|
|
16213
|
-
|
|
16214
|
-
|
|
16215
|
-
|
|
16216
|
-
|
|
16217
|
-
|
|
16218
|
-
|
|
16219
|
-
|
|
16220
|
-
};
|
|
16221
|
-
scrollListener = function(e) {
|
|
16222
|
-
// Don't measure (which forces) reflow for scrolls that happen inside of children!
|
|
16223
|
-
if (e.target.className && typeof e.target.className.indexOf === "function" && e.target.className.indexOf("contract-trigger") < 0 && e.target.className.indexOf("expand-trigger") < 0) return;
|
|
16224
|
-
const element = this;
|
|
16225
|
-
resetTriggers(this);
|
|
16226
|
-
if (this.__resizeRAF__) $3e40d2fd7fdb47d2$var$cancelFrame(this.__resizeRAF__);
|
|
16227
|
-
this.__resizeRAF__ = $3e40d2fd7fdb47d2$var$requestFrame(function animationFrame() {
|
|
16228
|
-
if (checkTriggers(element)) {
|
|
16229
|
-
element.__resizeLast__.width = element.offsetWidth;
|
|
16230
|
-
element.__resizeLast__.height = element.offsetHeight;
|
|
16231
|
-
element.__resizeListeners__.forEach(function forEachResizeListener(fn) {
|
|
16232
|
-
fn.call(element, e);
|
|
16233
|
-
});
|
|
16234
|
-
}
|
|
16235
|
-
});
|
|
16236
|
-
};
|
|
16237
|
-
/* Detect CSS Animations support to detect element display/re-attach */ let animation = false;
|
|
16238
|
-
let keyframeprefix = "";
|
|
16239
|
-
animationStartEvent = "animationstart";
|
|
16240
|
-
const domPrefixes = "Webkit Moz O ms".split(" ");
|
|
16241
|
-
let startEvents = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" ");
|
|
16242
|
-
let pfx = "";
|
|
16243
|
-
{
|
|
16244
|
-
const elm = document.createElement("fakeelement");
|
|
16245
|
-
if (elm.style.animationName !== undefined) animation = true;
|
|
16246
|
-
if (animation === false) {
|
|
16247
|
-
for(let i = 0; i < domPrefixes.length; i++)if (elm.style[domPrefixes[i] + "AnimationName"] !== undefined) {
|
|
16248
|
-
pfx = domPrefixes[i];
|
|
16249
|
-
keyframeprefix = "-" + pfx.toLowerCase() + "-";
|
|
16250
|
-
animationStartEvent = startEvents[i];
|
|
16251
|
-
animation = true;
|
|
16252
|
-
break;
|
|
16253
|
-
}
|
|
16254
|
-
}
|
|
16255
|
-
}
|
|
16256
|
-
animationName = "resizeanim";
|
|
16257
|
-
animationKeyframes = "@" + keyframeprefix + "keyframes " + animationName + " { from { opacity: 0; } to { opacity: 0; } } ";
|
|
16258
|
-
animationStyle = keyframeprefix + "animation: 1ms " + animationName + "; ";
|
|
16259
|
-
}
|
|
16260
|
-
const createStyles = function(doc) {
|
|
16261
|
-
if (!doc.getElementById("detectElementResize")) {
|
|
16262
|
-
//opacity:0 works around a chrome bug https://code.google.com/p/chromium/issues/detail?id=286360
|
|
16263
|
-
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");
|
|
16264
|
-
style.id = "detectElementResize";
|
|
16265
|
-
style.type = "text/css";
|
|
16266
|
-
if (nonce != null) style.setAttribute("nonce", nonce);
|
|
16267
|
-
if (style.styleSheet) style.styleSheet.cssText = css;
|
|
16268
|
-
else style.appendChild(doc.createTextNode(css));
|
|
16269
|
-
head.appendChild(style);
|
|
16270
|
-
}
|
|
16267
|
+
function createDetectElementResize(nonce) {
|
|
16268
|
+
let animationKeyframes;
|
|
16269
|
+
let animationName;
|
|
16270
|
+
let animationStartEvent;
|
|
16271
|
+
let animationStyle;
|
|
16272
|
+
let checkTriggers;
|
|
16273
|
+
let resetTriggers;
|
|
16274
|
+
let scrollListener;
|
|
16275
|
+
const attachEvent = typeof document !== "undefined" && document.attachEvent;
|
|
16276
|
+
if (!attachEvent) {
|
|
16277
|
+
resetTriggers = function (element) {
|
|
16278
|
+
const triggers = element.__resizeTriggers__,
|
|
16279
|
+
expand = triggers.firstElementChild,
|
|
16280
|
+
contract = triggers.lastElementChild,
|
|
16281
|
+
expandChild = expand.firstElementChild;
|
|
16282
|
+
contract.scrollLeft = contract.scrollWidth;
|
|
16283
|
+
contract.scrollTop = contract.scrollHeight;
|
|
16284
|
+
expandChild.style.width = expand.offsetWidth + 1 + "px";
|
|
16285
|
+
expandChild.style.height = expand.offsetHeight + 1 + "px";
|
|
16286
|
+
expand.scrollLeft = expand.scrollWidth;
|
|
16287
|
+
expand.scrollTop = expand.scrollHeight;
|
|
16271
16288
|
};
|
|
16272
|
-
|
|
16273
|
-
|
|
16274
|
-
else {
|
|
16275
|
-
if (!element.__resizeTriggers__) {
|
|
16276
|
-
const doc = element.ownerDocument;
|
|
16277
|
-
const elementStyle = $3e40d2fd7fdb47d2$var$windowObject.getComputedStyle(element);
|
|
16278
|
-
if (elementStyle && elementStyle.position === "static") element.style.position = "relative";
|
|
16279
|
-
createStyles(doc);
|
|
16280
|
-
element.__resizeLast__ = {};
|
|
16281
|
-
element.__resizeListeners__ = [];
|
|
16282
|
-
(element.__resizeTriggers__ = doc.createElement("div")).className = "resize-triggers";
|
|
16283
|
-
const expandTrigger = doc.createElement("div");
|
|
16284
|
-
expandTrigger.className = "expand-trigger";
|
|
16285
|
-
expandTrigger.appendChild(doc.createElement("div"));
|
|
16286
|
-
const contractTrigger = doc.createElement("div");
|
|
16287
|
-
contractTrigger.className = "contract-trigger";
|
|
16288
|
-
element.__resizeTriggers__.appendChild(expandTrigger);
|
|
16289
|
-
element.__resizeTriggers__.appendChild(contractTrigger);
|
|
16290
|
-
element.appendChild(element.__resizeTriggers__);
|
|
16291
|
-
resetTriggers(element);
|
|
16292
|
-
element.addEventListener("scroll", scrollListener, true);
|
|
16293
|
-
/* Listen for a css animation to detect element display/re-attach */ if (animationStartEvent) {
|
|
16294
|
-
element.__resizeTriggers__.__animationListener__ = function animationListener(e) {
|
|
16295
|
-
if (e.animationName === animationName) resetTriggers(element);
|
|
16296
|
-
};
|
|
16297
|
-
element.__resizeTriggers__.addEventListener(animationStartEvent, element.__resizeTriggers__.__animationListener__);
|
|
16298
|
-
}
|
|
16299
|
-
}
|
|
16300
|
-
element.__resizeListeners__.push(fn);
|
|
16301
|
-
}
|
|
16289
|
+
checkTriggers = function (element) {
|
|
16290
|
+
return element.offsetWidth !== element.__resizeLast__.width || element.offsetHeight !== element.__resizeLast__.height;
|
|
16302
16291
|
};
|
|
16303
|
-
|
|
16304
|
-
|
|
16305
|
-
|
|
16306
|
-
|
|
16307
|
-
|
|
16308
|
-
|
|
16309
|
-
|
|
16310
|
-
|
|
16311
|
-
|
|
16312
|
-
|
|
16313
|
-
|
|
16314
|
-
|
|
16315
|
-
|
|
16316
|
-
|
|
16317
|
-
|
|
16318
|
-
|
|
16292
|
+
scrollListener = function (e) {
|
|
16293
|
+
// Don't measure (which forces) reflow for scrolls that happen inside of children!
|
|
16294
|
+
if (e.target.className && typeof e.target.className.indexOf === "function" && e.target.className.indexOf("contract-trigger") < 0 && e.target.className.indexOf("expand-trigger") < 0) {
|
|
16295
|
+
return;
|
|
16296
|
+
}
|
|
16297
|
+
const element = this;
|
|
16298
|
+
resetTriggers(this);
|
|
16299
|
+
if (this.__resizeRAF__) {
|
|
16300
|
+
cancelFrame(this.__resizeRAF__);
|
|
16301
|
+
}
|
|
16302
|
+
this.__resizeRAF__ = requestFrame(function animationFrame() {
|
|
16303
|
+
if (checkTriggers(element)) {
|
|
16304
|
+
element.__resizeLast__.width = element.offsetWidth;
|
|
16305
|
+
element.__resizeLast__.height = element.offsetHeight;
|
|
16306
|
+
element.__resizeListeners__.forEach(function forEachResizeListener(fn) {
|
|
16307
|
+
fn.call(element, e);
|
|
16308
|
+
});
|
|
16319
16309
|
}
|
|
16310
|
+
});
|
|
16320
16311
|
};
|
|
16321
|
-
return {
|
|
16322
|
-
addResizeListener: addResizeListener,
|
|
16323
|
-
removeResizeListener: removeResizeListener
|
|
16324
|
-
};
|
|
16325
|
-
}
|
|
16326
|
-
$3e40d2fd7fdb47d2$exports = {
|
|
16327
|
-
createDetectElementResize: $3e40d2fd7fdb47d2$var$createDetectElementResize
|
|
16328
|
-
};
|
|
16329
16312
|
|
|
16330
|
-
|
|
16331
|
-
|
|
16332
|
-
|
|
16333
|
-
|
|
16334
|
-
|
|
16335
|
-
|
|
16336
|
-
|
|
16337
|
-
|
|
16338
|
-
|
|
16339
|
-
|
|
16340
|
-
|
|
16341
|
-
}
|
|
16342
|
-
|
|
16343
|
-
|
|
16344
|
-
|
|
16345
|
-
|
|
16346
|
-
|
|
16347
|
-
|
|
16348
|
-
|
|
16349
|
-
|
|
16350
|
-
|
|
16351
|
-
if (typeof res !== "object") return res;
|
|
16352
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
16353
|
-
}
|
|
16354
|
-
return (hint === "string" ? String : Number)(input);
|
|
16355
|
-
}
|
|
16356
|
-
class $6e2bb92d9db3b0c8$export$9d94f4ee1d930ff extends (Component) {
|
|
16357
|
-
constructor(...args){
|
|
16358
|
-
super(...args);
|
|
16359
|
-
$6e2bb92d9db3b0c8$var$_defineProperty(this, "state", {
|
|
16360
|
-
height: this.props.defaultHeight || 0,
|
|
16361
|
-
scaledHeight: this.props.defaultHeight || 0,
|
|
16362
|
-
scaledWidth: this.props.defaultWidth || 0,
|
|
16363
|
-
width: this.props.defaultWidth || 0
|
|
16364
|
-
});
|
|
16365
|
-
$6e2bb92d9db3b0c8$var$_defineProperty(this, "_autoSizer", null);
|
|
16366
|
-
$6e2bb92d9db3b0c8$var$_defineProperty(this, "_detectElementResize", null);
|
|
16367
|
-
$6e2bb92d9db3b0c8$var$_defineProperty(this, "_parentNode", null);
|
|
16368
|
-
$6e2bb92d9db3b0c8$var$_defineProperty(this, "_resizeObserver", null);
|
|
16369
|
-
$6e2bb92d9db3b0c8$var$_defineProperty(this, "_onResize", ()=>{
|
|
16370
|
-
const { disableHeight: disableHeight , disableWidth: disableWidth , onResize: onResize } = this.props;
|
|
16371
|
-
if (this._parentNode) {
|
|
16372
|
-
var _style$paddingLeft, _style$paddingRight, _style$paddingTop, _style$paddingBottom;
|
|
16373
|
-
// Guard against AutoSizer component being removed from the DOM immediately after being added.
|
|
16374
|
-
// This can result in invalid style values which can result in NaN values if we don't handle them.
|
|
16375
|
-
// See issue #150 for more context.
|
|
16376
|
-
const style = window.getComputedStyle(this._parentNode) || {};
|
|
16377
|
-
const paddingLeft = parseFloat((_style$paddingLeft = style.paddingLeft) !== null && _style$paddingLeft !== void 0 ? _style$paddingLeft : "0");
|
|
16378
|
-
const paddingRight = parseFloat((_style$paddingRight = style.paddingRight) !== null && _style$paddingRight !== void 0 ? _style$paddingRight : "0");
|
|
16379
|
-
const paddingTop = parseFloat((_style$paddingTop = style.paddingTop) !== null && _style$paddingTop !== void 0 ? _style$paddingTop : "0");
|
|
16380
|
-
const paddingBottom = parseFloat((_style$paddingBottom = style.paddingBottom) !== null && _style$paddingBottom !== void 0 ? _style$paddingBottom : "0");
|
|
16381
|
-
const rect = this._parentNode.getBoundingClientRect();
|
|
16382
|
-
const scaledHeight = rect.height - paddingTop - paddingBottom;
|
|
16383
|
-
const scaledWidth = rect.width - paddingLeft - paddingRight;
|
|
16384
|
-
const height = this._parentNode.offsetHeight - paddingTop - paddingBottom;
|
|
16385
|
-
const width = this._parentNode.offsetWidth - paddingLeft - paddingRight;
|
|
16386
|
-
if (!disableHeight && (this.state.height !== height || this.state.scaledHeight !== scaledHeight) || !disableWidth && (this.state.width !== width || this.state.scaledWidth !== scaledWidth)) {
|
|
16387
|
-
this.setState({
|
|
16388
|
-
height: height,
|
|
16389
|
-
width: width,
|
|
16390
|
-
scaledHeight: scaledHeight,
|
|
16391
|
-
scaledWidth: scaledWidth
|
|
16392
|
-
});
|
|
16393
|
-
if (typeof onResize === "function") onResize({
|
|
16394
|
-
height: height,
|
|
16395
|
-
scaledHeight: scaledHeight,
|
|
16396
|
-
scaledWidth: scaledWidth,
|
|
16397
|
-
width: width
|
|
16398
|
-
});
|
|
16399
|
-
}
|
|
16400
|
-
}
|
|
16401
|
-
});
|
|
16402
|
-
$6e2bb92d9db3b0c8$var$_defineProperty(this, "_setRef", (autoSizer)=>{
|
|
16403
|
-
this._autoSizer = autoSizer;
|
|
16404
|
-
});
|
|
16405
|
-
}
|
|
16406
|
-
componentDidMount() {
|
|
16407
|
-
const { nonce: nonce } = this.props;
|
|
16408
|
-
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) {
|
|
16409
|
-
// Delay access of parentNode until mount.
|
|
16410
|
-
// This handles edge-cases where the component has already been unmounted before its ref has been set,
|
|
16411
|
-
// As well as libraries like react-lite which have a slightly different lifecycle.
|
|
16412
|
-
this._parentNode = this._autoSizer.parentNode;
|
|
16413
|
-
// Defer requiring resize handler in order to support server-side rendering.
|
|
16414
|
-
// See issue #41
|
|
16415
|
-
if (this._parentNode != null) {
|
|
16416
|
-
if (typeof ResizeObserver !== "undefined") {
|
|
16417
|
-
this._resizeObserver = new ResizeObserver(()=>{
|
|
16418
|
-
// Guard against "ResizeObserver loop limit exceeded" error;
|
|
16419
|
-
// could be triggered if the state update causes the ResizeObserver handler to run long.
|
|
16420
|
-
// See https://github.com/bvaughn/react-virtualized-auto-sizer/issues/55
|
|
16421
|
-
setTimeout(this._onResize, 0);
|
|
16422
|
-
});
|
|
16423
|
-
this._resizeObserver.observe(this._parentNode);
|
|
16424
|
-
} else {
|
|
16425
|
-
this._detectElementResize = (0, $3e40d2fd7fdb47d2$exports.createDetectElementResize)(nonce);
|
|
16426
|
-
this._detectElementResize.addResizeListener(this._parentNode, this._onResize);
|
|
16427
|
-
}
|
|
16428
|
-
this._onResize();
|
|
16429
|
-
}
|
|
16313
|
+
/* Detect CSS Animations support to detect element display/re-attach */
|
|
16314
|
+
let animation = false;
|
|
16315
|
+
let keyframeprefix = "";
|
|
16316
|
+
animationStartEvent = "animationstart";
|
|
16317
|
+
const domPrefixes = "Webkit Moz O ms".split(" ");
|
|
16318
|
+
let startEvents = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" ");
|
|
16319
|
+
let pfx = "";
|
|
16320
|
+
{
|
|
16321
|
+
const elm = document.createElement("fakeelement");
|
|
16322
|
+
if (elm.style.animationName !== undefined) {
|
|
16323
|
+
animation = true;
|
|
16324
|
+
}
|
|
16325
|
+
if (animation === false) {
|
|
16326
|
+
for (let i = 0; i < domPrefixes.length; i++) {
|
|
16327
|
+
if (elm.style[domPrefixes[i] + "AnimationName"] !== undefined) {
|
|
16328
|
+
pfx = domPrefixes[i];
|
|
16329
|
+
keyframeprefix = "-" + pfx.toLowerCase() + "-";
|
|
16330
|
+
animationStartEvent = startEvents[i];
|
|
16331
|
+
animation = true;
|
|
16332
|
+
break;
|
|
16333
|
+
}
|
|
16430
16334
|
}
|
|
16335
|
+
}
|
|
16431
16336
|
}
|
|
16432
|
-
|
|
16433
|
-
|
|
16434
|
-
|
|
16435
|
-
|
|
16436
|
-
|
|
16437
|
-
|
|
16337
|
+
animationName = "resizeanim";
|
|
16338
|
+
animationKeyframes = "@" + keyframeprefix + "keyframes " + animationName + " { from { opacity: 0; } to { opacity: 0; } } ";
|
|
16339
|
+
animationStyle = keyframeprefix + "animation: 1ms " + animationName + "; ";
|
|
16340
|
+
}
|
|
16341
|
+
const createStyles = function (doc) {
|
|
16342
|
+
if (!doc.getElementById("detectElementResize")) {
|
|
16343
|
+
//opacity:0 works around a chrome bug https://code.google.com/p/chromium/issues/detail?id=286360
|
|
16344
|
+
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%; }',
|
|
16345
|
+
head = doc.head || doc.getElementsByTagName("head")[0],
|
|
16346
|
+
style = doc.createElement("style");
|
|
16347
|
+
style.id = "detectElementResize";
|
|
16348
|
+
style.type = "text/css";
|
|
16349
|
+
if (nonce != null) {
|
|
16350
|
+
style.setAttribute("nonce", nonce);
|
|
16351
|
+
}
|
|
16352
|
+
if (style.styleSheet) {
|
|
16353
|
+
style.styleSheet.cssText = css;
|
|
16354
|
+
} else {
|
|
16355
|
+
style.appendChild(doc.createTextNode(css));
|
|
16356
|
+
}
|
|
16357
|
+
head.appendChild(style);
|
|
16358
|
+
}
|
|
16359
|
+
};
|
|
16360
|
+
const addResizeListener = function (element, fn) {
|
|
16361
|
+
if (attachEvent) {
|
|
16362
|
+
element.attachEvent("onresize", fn);
|
|
16363
|
+
} else {
|
|
16364
|
+
if (!element.__resizeTriggers__) {
|
|
16365
|
+
const doc = element.ownerDocument;
|
|
16366
|
+
const elementStyle = windowObject.getComputedStyle(element);
|
|
16367
|
+
if (elementStyle && elementStyle.position === "static") {
|
|
16368
|
+
element.style.position = "relative";
|
|
16369
|
+
}
|
|
16370
|
+
createStyles(doc);
|
|
16371
|
+
element.__resizeLast__ = {};
|
|
16372
|
+
element.__resizeListeners__ = [];
|
|
16373
|
+
(element.__resizeTriggers__ = doc.createElement("div")).className = "resize-triggers";
|
|
16374
|
+
const expandTrigger = doc.createElement("div");
|
|
16375
|
+
expandTrigger.className = "expand-trigger";
|
|
16376
|
+
expandTrigger.appendChild(doc.createElement("div"));
|
|
16377
|
+
const contractTrigger = doc.createElement("div");
|
|
16378
|
+
contractTrigger.className = "contract-trigger";
|
|
16379
|
+
element.__resizeTriggers__.appendChild(expandTrigger);
|
|
16380
|
+
element.__resizeTriggers__.appendChild(contractTrigger);
|
|
16381
|
+
element.appendChild(element.__resizeTriggers__);
|
|
16382
|
+
resetTriggers(element);
|
|
16383
|
+
element.addEventListener("scroll", scrollListener, true);
|
|
16384
|
+
|
|
16385
|
+
/* Listen for a css animation to detect element display/re-attach */
|
|
16386
|
+
if (animationStartEvent) {
|
|
16387
|
+
element.__resizeTriggers__.__animationListener__ = function animationListener(e) {
|
|
16388
|
+
if (e.animationName === animationName) {
|
|
16389
|
+
resetTriggers(element);
|
|
16438
16390
|
}
|
|
16391
|
+
};
|
|
16392
|
+
element.__resizeTriggers__.addEventListener(animationStartEvent, element.__resizeTriggers__.__animationListener__);
|
|
16439
16393
|
}
|
|
16394
|
+
}
|
|
16395
|
+
element.__resizeListeners__.push(fn);
|
|
16440
16396
|
}
|
|
16441
|
-
|
|
16442
|
-
|
|
16443
|
-
|
|
16444
|
-
|
|
16445
|
-
|
|
16446
|
-
|
|
16447
|
-
|
|
16448
|
-
|
|
16449
|
-
|
|
16450
|
-
|
|
16451
|
-
|
|
16452
|
-
// At best this would just be wasting cycles.
|
|
16453
|
-
let bailoutOnChildren = false;
|
|
16454
|
-
if (!disableHeight) {
|
|
16455
|
-
if (height === 0) bailoutOnChildren = true;
|
|
16456
|
-
outerStyle.height = 0;
|
|
16457
|
-
childParams.height = height;
|
|
16458
|
-
childParams.scaledHeight = scaledHeight;
|
|
16397
|
+
};
|
|
16398
|
+
const removeResizeListener = function (element, fn) {
|
|
16399
|
+
if (attachEvent) {
|
|
16400
|
+
element.detachEvent("onresize", fn);
|
|
16401
|
+
} else {
|
|
16402
|
+
element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1);
|
|
16403
|
+
if (!element.__resizeListeners__.length) {
|
|
16404
|
+
element.removeEventListener("scroll", scrollListener, true);
|
|
16405
|
+
if (element.__resizeTriggers__.__animationListener__) {
|
|
16406
|
+
element.__resizeTriggers__.removeEventListener(animationStartEvent, element.__resizeTriggers__.__animationListener__);
|
|
16407
|
+
element.__resizeTriggers__.__animationListener__ = null;
|
|
16459
16408
|
}
|
|
16460
|
-
|
|
16461
|
-
|
|
16462
|
-
|
|
16463
|
-
|
|
16464
|
-
childParams.scaledWidth = scaledWidth;
|
|
16409
|
+
try {
|
|
16410
|
+
element.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__);
|
|
16411
|
+
} catch (e) {
|
|
16412
|
+
// Preact compat; see developit/preact-compat/issues/228
|
|
16465
16413
|
}
|
|
16466
|
-
|
|
16467
|
-
ref: this._setRef,
|
|
16468
|
-
style: {
|
|
16469
|
-
...outerStyle,
|
|
16470
|
-
...style
|
|
16471
|
-
},
|
|
16472
|
-
...rest
|
|
16473
|
-
}, !bailoutOnChildren && children(childParams));
|
|
16414
|
+
}
|
|
16474
16415
|
}
|
|
16416
|
+
};
|
|
16417
|
+
return {
|
|
16418
|
+
addResizeListener,
|
|
16419
|
+
removeResizeListener
|
|
16420
|
+
};
|
|
16475
16421
|
}
|
|
16476
|
-
$6e2bb92d9db3b0c8$var$_defineProperty($6e2bb92d9db3b0c8$export$9d94f4ee1d930ff, "defaultProps", {
|
|
16477
|
-
onResize: ()=>{},
|
|
16478
|
-
disableHeight: false,
|
|
16479
|
-
disableWidth: false,
|
|
16480
|
-
style: {}
|
|
16481
|
-
});
|
|
16482
16422
|
|
|
16423
|
+
class AutoSizer extends Component {
|
|
16424
|
+
constructor(...args) {
|
|
16425
|
+
super(...args);
|
|
16426
|
+
this.state = {
|
|
16427
|
+
height: this.props.defaultHeight || 0,
|
|
16428
|
+
scaledHeight: this.props.defaultHeight || 0,
|
|
16429
|
+
scaledWidth: this.props.defaultWidth || 0,
|
|
16430
|
+
width: this.props.defaultWidth || 0
|
|
16431
|
+
};
|
|
16432
|
+
this._autoSizer = null;
|
|
16433
|
+
this._detectElementResize = null;
|
|
16434
|
+
this._parentNode = null;
|
|
16435
|
+
this._resizeObserver = null;
|
|
16436
|
+
this._timeoutId = null;
|
|
16437
|
+
this._onResize = () => {
|
|
16438
|
+
this._timeoutId = null;
|
|
16439
|
+
const {
|
|
16440
|
+
disableHeight,
|
|
16441
|
+
disableWidth,
|
|
16442
|
+
onResize
|
|
16443
|
+
} = this.props;
|
|
16444
|
+
if (this._parentNode) {
|
|
16445
|
+
var _style$paddingLeft, _style$paddingRight, _style$paddingTop, _style$paddingBottom;
|
|
16446
|
+
// Guard against AutoSizer component being removed from the DOM immediately after being added.
|
|
16447
|
+
// This can result in invalid style values which can result in NaN values if we don't handle them.
|
|
16448
|
+
// See issue #150 for more context.
|
|
16449
|
+
|
|
16450
|
+
const style = window.getComputedStyle(this._parentNode) || {};
|
|
16451
|
+
const paddingLeft = parseFloat((_style$paddingLeft = style.paddingLeft) !== null && _style$paddingLeft !== void 0 ? _style$paddingLeft : "0");
|
|
16452
|
+
const paddingRight = parseFloat((_style$paddingRight = style.paddingRight) !== null && _style$paddingRight !== void 0 ? _style$paddingRight : "0");
|
|
16453
|
+
const paddingTop = parseFloat((_style$paddingTop = style.paddingTop) !== null && _style$paddingTop !== void 0 ? _style$paddingTop : "0");
|
|
16454
|
+
const paddingBottom = parseFloat((_style$paddingBottom = style.paddingBottom) !== null && _style$paddingBottom !== void 0 ? _style$paddingBottom : "0");
|
|
16455
|
+
const rect = this._parentNode.getBoundingClientRect();
|
|
16456
|
+
const scaledHeight = rect.height - paddingTop - paddingBottom;
|
|
16457
|
+
const scaledWidth = rect.width - paddingLeft - paddingRight;
|
|
16458
|
+
const height = this._parentNode.offsetHeight - paddingTop - paddingBottom;
|
|
16459
|
+
const width = this._parentNode.offsetWidth - paddingLeft - paddingRight;
|
|
16460
|
+
if (!disableHeight && (this.state.height !== height || this.state.scaledHeight !== scaledHeight) || !disableWidth && (this.state.width !== width || this.state.scaledWidth !== scaledWidth)) {
|
|
16461
|
+
this.setState({
|
|
16462
|
+
height,
|
|
16463
|
+
width,
|
|
16464
|
+
scaledHeight,
|
|
16465
|
+
scaledWidth
|
|
16466
|
+
});
|
|
16467
|
+
if (typeof onResize === "function") {
|
|
16468
|
+
onResize({
|
|
16469
|
+
height,
|
|
16470
|
+
scaledHeight,
|
|
16471
|
+
scaledWidth,
|
|
16472
|
+
width
|
|
16473
|
+
});
|
|
16474
|
+
}
|
|
16475
|
+
}
|
|
16476
|
+
}
|
|
16477
|
+
};
|
|
16478
|
+
this._setRef = autoSizer => {
|
|
16479
|
+
this._autoSizer = autoSizer;
|
|
16480
|
+
};
|
|
16481
|
+
}
|
|
16482
|
+
componentDidMount() {
|
|
16483
|
+
const {
|
|
16484
|
+
nonce
|
|
16485
|
+
} = this.props;
|
|
16486
|
+
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) {
|
|
16487
|
+
// Delay access of parentNode until mount.
|
|
16488
|
+
// This handles edge-cases where the component has already been unmounted before its ref has been set,
|
|
16489
|
+
// As well as libraries like react-lite which have a slightly different lifecycle.
|
|
16490
|
+
this._parentNode = this._autoSizer.parentNode;
|
|
16491
|
+
|
|
16492
|
+
// Defer requiring resize handler in order to support server-side rendering.
|
|
16493
|
+
// See issue #41
|
|
16494
|
+
if (this._parentNode != null) {
|
|
16495
|
+
if (typeof ResizeObserver !== "undefined") {
|
|
16496
|
+
this._resizeObserver = new ResizeObserver(() => {
|
|
16497
|
+
// Guard against "ResizeObserver loop limit exceeded" error;
|
|
16498
|
+
// could be triggered if the state update causes the ResizeObserver handler to run long.
|
|
16499
|
+
// See https://github.com/bvaughn/react-virtualized-auto-sizer/issues/55
|
|
16500
|
+
this._timeoutId = setTimeout(this._onResize, 0);
|
|
16501
|
+
});
|
|
16502
|
+
this._resizeObserver.observe(this._parentNode);
|
|
16503
|
+
} else {
|
|
16504
|
+
this._detectElementResize = createDetectElementResize(nonce);
|
|
16505
|
+
this._detectElementResize.addResizeListener(this._parentNode, this._onResize);
|
|
16506
|
+
}
|
|
16507
|
+
this._onResize();
|
|
16508
|
+
}
|
|
16509
|
+
}
|
|
16510
|
+
}
|
|
16511
|
+
componentWillUnmount() {
|
|
16512
|
+
if (this._parentNode) {
|
|
16513
|
+
if (this._detectElementResize) {
|
|
16514
|
+
this._detectElementResize.removeResizeListener(this._parentNode, this._onResize);
|
|
16515
|
+
}
|
|
16516
|
+
if (this._timeoutId !== null) {
|
|
16517
|
+
clearTimeout(this._timeoutId);
|
|
16518
|
+
}
|
|
16519
|
+
if (this._resizeObserver) {
|
|
16520
|
+
this._resizeObserver.observe(this._parentNode);
|
|
16521
|
+
this._resizeObserver.disconnect();
|
|
16522
|
+
}
|
|
16523
|
+
}
|
|
16524
|
+
}
|
|
16525
|
+
render() {
|
|
16526
|
+
const {
|
|
16527
|
+
children,
|
|
16528
|
+
defaultHeight,
|
|
16529
|
+
defaultWidth,
|
|
16530
|
+
disableHeight = false,
|
|
16531
|
+
disableWidth = false,
|
|
16532
|
+
nonce,
|
|
16533
|
+
onResize,
|
|
16534
|
+
style = {},
|
|
16535
|
+
tagName = "div",
|
|
16536
|
+
...rest
|
|
16537
|
+
} = this.props;
|
|
16538
|
+
const {
|
|
16539
|
+
height,
|
|
16540
|
+
scaledHeight,
|
|
16541
|
+
scaledWidth,
|
|
16542
|
+
width
|
|
16543
|
+
} = this.state;
|
|
16483
16544
|
|
|
16484
|
-
|
|
16545
|
+
// Outer div should not force width/height since that may prevent containers from shrinking.
|
|
16546
|
+
// Inner component should overflow and use calculated width/height.
|
|
16547
|
+
// See issue #68 for more information.
|
|
16548
|
+
const outerStyle = {
|
|
16549
|
+
overflow: "visible"
|
|
16550
|
+
};
|
|
16551
|
+
const childParams = {};
|
|
16552
|
+
|
|
16553
|
+
// Avoid rendering children before the initial measurements have been collected.
|
|
16554
|
+
// At best this would just be wasting cycles.
|
|
16555
|
+
let bailoutOnChildren = false;
|
|
16556
|
+
if (!disableHeight) {
|
|
16557
|
+
if (height === 0) {
|
|
16558
|
+
bailoutOnChildren = true;
|
|
16559
|
+
}
|
|
16560
|
+
outerStyle.height = 0;
|
|
16561
|
+
childParams.height = height;
|
|
16562
|
+
childParams.scaledHeight = scaledHeight;
|
|
16563
|
+
}
|
|
16564
|
+
if (!disableWidth) {
|
|
16565
|
+
if (width === 0) {
|
|
16566
|
+
bailoutOnChildren = true;
|
|
16567
|
+
}
|
|
16568
|
+
outerStyle.width = 0;
|
|
16569
|
+
childParams.width = width;
|
|
16570
|
+
childParams.scaledWidth = scaledWidth;
|
|
16571
|
+
}
|
|
16572
|
+
return createElement(tagName, {
|
|
16573
|
+
ref: this._setRef,
|
|
16574
|
+
style: {
|
|
16575
|
+
...outerStyle,
|
|
16576
|
+
...style
|
|
16577
|
+
},
|
|
16578
|
+
...rest
|
|
16579
|
+
}, !bailoutOnChildren && children(childParams));
|
|
16580
|
+
}
|
|
16581
|
+
}
|
|
16485
16582
|
|
|
16486
16583
|
const drillDown = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
16487
16584
|
shapes: [{
|
|
@@ -16735,11 +16832,14 @@ function showToolbarDetached(_ref) {
|
|
|
16735
16832
|
let {
|
|
16736
16833
|
containerRect,
|
|
16737
16834
|
titleRef,
|
|
16738
|
-
iconsWidth
|
|
16835
|
+
iconsWidth,
|
|
16836
|
+
headerPaddingLeft,
|
|
16837
|
+
headerPaddingRight
|
|
16739
16838
|
} = _ref;
|
|
16740
16839
|
const containerWidth = containerRect.width;
|
|
16741
|
-
const
|
|
16742
|
-
const
|
|
16840
|
+
const preventTruncation = 2;
|
|
16841
|
+
const padding = headerPaddingLeft + headerPaddingRight;
|
|
16842
|
+
const contentWidth = ((_titleRef$current$cli = titleRef === null || titleRef === void 0 ? void 0 : (_titleRef$current = titleRef.current) === null || _titleRef$current === void 0 ? void 0 : _titleRef$current.clientWidth) !== null && _titleRef$current$cli !== void 0 ? _titleRef$current$cli : 0) + iconsWidth + padding + preventTruncation;
|
|
16743
16843
|
const actionToolbarWidth = 128;
|
|
16744
16844
|
const notSufficientSpace = containerWidth < contentWidth + actionToolbarWidth;
|
|
16745
16845
|
const isTruncated = (titleRef === null || titleRef === void 0 ? void 0 : (_titleRef$current2 = titleRef.current) === null || _titleRef$current2 === void 0 ? void 0 : _titleRef$current2.scrollWidth) > (titleRef === null || titleRef === void 0 ? void 0 : (_titleRef$current3 = titleRef.current) === null || _titleRef$current3 === void 0 ? void 0 : _titleRef$current3.offsetWidth);
|
|
@@ -17033,7 +17133,9 @@ function ListBoxInline(_ref4) {
|
|
|
17033
17133
|
const isDrillDown = (layout === null || layout === void 0 ? void 0 : (_layout$qListObject2 = layout.qListObject) === null || _layout$qListObject2 === void 0 ? void 0 : (_layout$qListObject2$ = _layout$qListObject2.qDimensionInfo) === null || _layout$qListObject2$ === void 0 ? void 0 : _layout$qListObject2$.qGrouping) === 'H';
|
|
17034
17134
|
const showIcons = showSearchOrLockIcon || isDrillDown;
|
|
17035
17135
|
const iconsWidth = (showSearchOrLockIcon ? BUTTON_ICON_WIDTH : 0) + (isDrillDown ? ICON_WIDTH + ICON_PADDING : 0); // Drill-down icon needs padding right so there is space between the icon and the title
|
|
17036
|
-
|
|
17136
|
+
const isRtl = direction === 'rtl';
|
|
17137
|
+
const headerPaddingLeft = CELL_PADDING_LEFT - (showSearchOrLockIcon ? ICON_PADDING : 0);
|
|
17138
|
+
const headerPaddingRight = isRtl ? CELL_PADDING_LEFT - (showIcons ? ICON_PADDING : 0) : HEADER_PADDING_RIGHT;
|
|
17037
17139
|
useEffect$1(() => {
|
|
17038
17140
|
if (!titleRef.current || !containerRect) {
|
|
17039
17141
|
return;
|
|
@@ -17041,14 +17143,15 @@ function ListBoxInline(_ref4) {
|
|
|
17041
17143
|
const isDetached = showToolbarDetached({
|
|
17042
17144
|
containerRect,
|
|
17043
17145
|
titleRef,
|
|
17044
|
-
iconsWidth
|
|
17146
|
+
iconsWidth,
|
|
17147
|
+
headerPaddingLeft,
|
|
17148
|
+
headerPaddingRight
|
|
17045
17149
|
});
|
|
17046
17150
|
setIsToolbarDetached(isDetached);
|
|
17047
17151
|
}, [titleRef.current, containerRect]);
|
|
17048
17152
|
if (!model || !layout || !translator) {
|
|
17049
17153
|
return null;
|
|
17050
17154
|
}
|
|
17051
|
-
const isRtl = direction === 'rtl';
|
|
17052
17155
|
const listboxSelectionToolbarItems = createListboxSelectionToolbar({
|
|
17053
17156
|
layout,
|
|
17054
17157
|
model,
|
|
@@ -17086,8 +17189,6 @@ function ListBoxInline(_ref4) {
|
|
|
17086
17189
|
keyboard
|
|
17087
17190
|
});
|
|
17088
17191
|
const shouldAutoFocus = searchVisible && search === 'toggle';
|
|
17089
|
-
const headerPaddingLeft = CELL_PADDING_LEFT - (showSearchOrLockIcon ? ICON_PADDING : 0);
|
|
17090
|
-
const headerPaddingRight = isRtl ? CELL_PADDING_LEFT - (showIcons ? ICON_PADDING : 0) : 0;
|
|
17091
17192
|
|
|
17092
17193
|
// Add a container padding for grid mode to harmonize with the grid item margins (should sum to 8px).
|
|
17093
17194
|
const isGridMode = (layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.dataLayout) === 'grid';
|
|
@@ -17134,7 +17235,7 @@ function ListBoxInline(_ref4) {
|
|
|
17134
17235
|
if (isInvalid) {
|
|
17135
17236
|
renderedCallback === null || renderedCallback === void 0 ? void 0 : renderedCallback();
|
|
17136
17237
|
}
|
|
17137
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, showDetachedToolbarOnly && /*#__PURE__*/React__default.createElement(ActionsToolbar, _extends$
|
|
17238
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, showDetachedToolbarOnly && /*#__PURE__*/React__default.createElement(ActionsToolbar, _extends$3({
|
|
17138
17239
|
direction: direction
|
|
17139
17240
|
}, getActionToolbarProps(true))), /*#__PURE__*/React__default.createElement(StyledGrid$3, {
|
|
17140
17241
|
className: "listbox-container",
|
|
@@ -17191,7 +17292,7 @@ function ListBoxInline(_ref4) {
|
|
|
17191
17292
|
title: layout.title
|
|
17192
17293
|
}, layout.title)), /*#__PURE__*/React__default.createElement(Grid, {
|
|
17193
17294
|
item: true
|
|
17194
|
-
}, /*#__PURE__*/React__default.createElement(ActionsToolbar, _extends$
|
|
17295
|
+
}, /*#__PURE__*/React__default.createElement(ActionsToolbar, _extends$3({
|
|
17195
17296
|
direction: direction
|
|
17196
17297
|
}, getActionToolbarProps(isToolbarDetached))))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
17197
17298
|
item: true,
|
|
@@ -17229,7 +17330,7 @@ function ListBoxInline(_ref4) {
|
|
|
17229
17330
|
className: classes$4.screenReaderOnly
|
|
17230
17331
|
}, translator.get('Listbox.ScreenReaderInstructions')), isInvalid ? /*#__PURE__*/React__default.createElement(ListBoxError, {
|
|
17231
17332
|
text: errorText
|
|
17232
|
-
}) : /*#__PURE__*/React__default.createElement(
|
|
17333
|
+
}) : /*#__PURE__*/React__default.createElement(AutoSizer, null, _ref5 => {
|
|
17233
17334
|
let {
|
|
17234
17335
|
height,
|
|
17235
17336
|
width
|
|
@@ -17237,6 +17338,7 @@ function ListBoxInline(_ref4) {
|
|
|
17237
17338
|
return /*#__PURE__*/React__default.createElement(ListBox, {
|
|
17238
17339
|
model: model,
|
|
17239
17340
|
app: app,
|
|
17341
|
+
theme: theme,
|
|
17240
17342
|
constraints: constraints,
|
|
17241
17343
|
layout: layout,
|
|
17242
17344
|
selections: selections,
|
|
@@ -17512,6 +17614,14 @@ function useOnTheFlyModel(_ref) {
|
|
|
17512
17614
|
const [model, setModel] = useState$1();
|
|
17513
17615
|
const [fallbackTitle, setFallbackTitle] = useState$1();
|
|
17514
17616
|
const title = (_options$title = options.title) !== null && _options$title !== void 0 ? _options$title : fallbackTitle;
|
|
17617
|
+
let {
|
|
17618
|
+
histogram = false,
|
|
17619
|
+
frequencyMode = 'N'
|
|
17620
|
+
} = options;
|
|
17621
|
+
if (fieldDef && fieldDef.failedToFetchFieldDef) {
|
|
17622
|
+
histogram = false;
|
|
17623
|
+
frequencyMode = 'N';
|
|
17624
|
+
}
|
|
17515
17625
|
useEffect$1(() => {
|
|
17516
17626
|
async function fetchMasterItem() {
|
|
17517
17627
|
try {
|
|
@@ -17534,7 +17644,7 @@ function useOnTheFlyModel(_ref) {
|
|
|
17534
17644
|
throw new Error("Disabling frequency count and histogram: ".concat(e && e.message));
|
|
17535
17645
|
}
|
|
17536
17646
|
}
|
|
17537
|
-
const isFrequencyMaxNeeded =
|
|
17647
|
+
const isFrequencyMaxNeeded = histogram || frequencyMode !== 'N';
|
|
17538
17648
|
const shouldFetchMasterItem = fieldIdentifier.qLibraryId && isFrequencyMaxNeeded;
|
|
17539
17649
|
if (shouldFetchMasterItem) {
|
|
17540
17650
|
fetchMasterItem();
|
|
@@ -17549,31 +17659,6 @@ function useOnTheFlyModel(_ref) {
|
|
|
17549
17659
|
listLayout,
|
|
17550
17660
|
properties = {}
|
|
17551
17661
|
} = options;
|
|
17552
|
-
let {
|
|
17553
|
-
frequencyMode,
|
|
17554
|
-
histogram = false
|
|
17555
|
-
} = options;
|
|
17556
|
-
if (fieldDef && fieldDef.failedToFetchFieldDef) {
|
|
17557
|
-
histogram = false;
|
|
17558
|
-
frequencyMode = 'N';
|
|
17559
|
-
}
|
|
17560
|
-
switch (true) {
|
|
17561
|
-
case ['none', 'N', 'NX_FREQUENCY_NONE'].includes(frequencyMode):
|
|
17562
|
-
frequencyMode = 'N';
|
|
17563
|
-
break;
|
|
17564
|
-
case ['value', 'V', 'NX_FREQUENCY_VALUE', 'default'].includes(frequencyMode):
|
|
17565
|
-
frequencyMode = 'V';
|
|
17566
|
-
break;
|
|
17567
|
-
case ['percent', 'P', 'NX_FREQUENCY_PERCENT'].includes(frequencyMode):
|
|
17568
|
-
frequencyMode = 'P';
|
|
17569
|
-
break;
|
|
17570
|
-
case ['relative', 'R', 'NX_FREQUENCY_RELATIVE'].includes(frequencyMode):
|
|
17571
|
-
frequencyMode = 'R';
|
|
17572
|
-
break;
|
|
17573
|
-
default:
|
|
17574
|
-
frequencyMode = 'N';
|
|
17575
|
-
break;
|
|
17576
|
-
}
|
|
17577
17662
|
const getListdefFrequencyMode = () => histogram && frequencyMode === 'N' ? 'V' : frequencyMode;
|
|
17578
17663
|
const layoutOptions = {
|
|
17579
17664
|
dense
|
|
@@ -17651,6 +17736,28 @@ function identify(_ref) {
|
|
|
17651
17736
|
};
|
|
17652
17737
|
}
|
|
17653
17738
|
|
|
17739
|
+
function getFrequencyModeLetter(frequencyMode) {
|
|
17740
|
+
let freqLetter;
|
|
17741
|
+
switch (true) {
|
|
17742
|
+
case ['none', 'N', 'NX_FREQUENCY_NONE'].includes(frequencyMode):
|
|
17743
|
+
freqLetter = 'N';
|
|
17744
|
+
break;
|
|
17745
|
+
case ['value', 'V', 'NX_FREQUENCY_VALUE', 'default'].includes(frequencyMode):
|
|
17746
|
+
freqLetter = 'V';
|
|
17747
|
+
break;
|
|
17748
|
+
case ['percent', 'P', 'NX_FREQUENCY_PERCENT'].includes(frequencyMode):
|
|
17749
|
+
freqLetter = 'P';
|
|
17750
|
+
break;
|
|
17751
|
+
case ['relative', 'R', 'NX_FREQUENCY_RELATIVE'].includes(frequencyMode):
|
|
17752
|
+
freqLetter = 'R';
|
|
17753
|
+
break;
|
|
17754
|
+
default:
|
|
17755
|
+
freqLetter = 'N';
|
|
17756
|
+
break;
|
|
17757
|
+
}
|
|
17758
|
+
return freqLetter;
|
|
17759
|
+
}
|
|
17760
|
+
|
|
17654
17761
|
const _excluded$3 = ["__DO_NOT_USE__"];
|
|
17655
17762
|
|
|
17656
17763
|
/**
|
|
@@ -17713,6 +17820,12 @@ function ListBoxWrapper(_ref) {
|
|
|
17713
17820
|
qId,
|
|
17714
17821
|
options
|
|
17715
17822
|
});
|
|
17823
|
+
if (!isExistingObject) {
|
|
17824
|
+
Object.assign(options, {
|
|
17825
|
+
frequencyMode: getFrequencyModeLetter(options.frequencyMode) // stick to letter option hereafter
|
|
17826
|
+
});
|
|
17827
|
+
}
|
|
17828
|
+
|
|
17716
17829
|
const [changeCount, setChangeCount] = useState$1(0);
|
|
17717
17830
|
useEffect$1(() => {
|
|
17718
17831
|
if (changeCount) {
|
|
@@ -19184,13 +19297,13 @@ function Progress(_ref2) {
|
|
|
19184
19297
|
const s = SIZES[size];
|
|
19185
19298
|
return /*#__PURE__*/React__default.createElement(Root, {
|
|
19186
19299
|
className: classes$3.root
|
|
19187
|
-
}, /*#__PURE__*/React__default.createElement(CircularProgress, _extends$
|
|
19300
|
+
}, /*#__PURE__*/React__default.createElement(CircularProgress, _extends$3({
|
|
19188
19301
|
variant: "determinate",
|
|
19189
19302
|
value: 100,
|
|
19190
19303
|
className: classes$3.back,
|
|
19191
19304
|
size: s,
|
|
19192
19305
|
thickness: 3
|
|
19193
|
-
}, props)), /*#__PURE__*/React__default.createElement(CircularProgress, _extends$
|
|
19306
|
+
}, props)), /*#__PURE__*/React__default.createElement(CircularProgress, _extends$3({
|
|
19194
19307
|
variant: "indeterminate",
|
|
19195
19308
|
disableShrink: true,
|
|
19196
19309
|
className: classes$3.front,
|
|
@@ -19240,7 +19353,7 @@ function Cancel(_ref) {
|
|
|
19240
19353
|
variant: "h6",
|
|
19241
19354
|
align: "center",
|
|
19242
19355
|
"data-tid": "update-active"
|
|
19243
|
-
}, translator.get('Object.Update.Active')))), /*#__PURE__*/React__default.createElement(Grid, _extends$
|
|
19356
|
+
}, translator.get('Object.Update.Active')))), /*#__PURE__*/React__default.createElement(Grid, _extends$3({
|
|
19244
19357
|
item: true
|
|
19245
19358
|
}, props), /*#__PURE__*/React__default.createElement(Button, {
|
|
19246
19359
|
variant: "contained",
|
|
@@ -19267,7 +19380,7 @@ function Retry(_ref2) {
|
|
|
19267
19380
|
"data-tid": "update-cancelled"
|
|
19268
19381
|
}, translator.get('Object.Update.Cancelled'))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
19269
19382
|
item: true
|
|
19270
|
-
}, /*#__PURE__*/React__default.createElement(Button, _extends$
|
|
19383
|
+
}, /*#__PURE__*/React__default.createElement(Button, _extends$3({
|
|
19271
19384
|
variant: "contained",
|
|
19272
19385
|
onClick: retry
|
|
19273
19386
|
}, props), translator.get('Retry'))));
|
|
@@ -25537,12 +25650,11 @@ function nuked() {
|
|
|
25537
25650
|
* @returns {Promise<object>} The objects properties
|
|
25538
25651
|
* @example
|
|
25539
25652
|
* // generate properties for a barchart
|
|
25540
|
-
* const properties = await n.
|
|
25653
|
+
* const properties = await n.generateProperties({
|
|
25541
25654
|
* type: 'barchart',
|
|
25542
25655
|
* fields: ['Product', { qLibraryId: 'u378hn', type: 'measure' }],
|
|
25543
25656
|
* properties: { showTitle: true }
|
|
25544
25657
|
* },
|
|
25545
|
-
* true
|
|
25546
25658
|
* );
|
|
25547
25659
|
*/
|
|
25548
25660
|
generateProperties: async cfg => createObject(cfg, halo, true),
|