@nebula.js/stardust 4.7.0 → 4.8.0
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 +420 -338
- 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 +2 -2
- package/dist/stardust.dev.js +498 -417
- package/dist/stardust.dev.js.map +1 -1
- package/dist/stardust.js +9 -9
- package/dist/stardust.js.map +1 -1
- package/package.json +12 -12
- package/types/index.d.ts +0 -2
package/core/esm/dev.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/stardust v4.
|
|
2
|
+
* @nebula.js/stardust v4.8.0
|
|
3
3
|
* Copyright (c) 2023 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
@@ -8,7 +8,7 @@ import * as React from 'react';
|
|
|
8
8
|
import React__default, { useState as useState$1, useEffect as useEffect$1, forwardRef, useMemo as useMemo$1, useImperativeHandle as useImperativeHandle$1, useReducer, useCallback, useLayoutEffect as useLayoutEffect$1, PureComponent, useRef, useContext, createElement, Component } from 'react';
|
|
9
9
|
import ReactDOM from 'react-dom';
|
|
10
10
|
import { CacheProvider, ThemeContext as ThemeContext$2 } from '@emotion/react';
|
|
11
|
-
import { Checkbox, Radio, Typography, FormControlLabel, Box, Grid, Tooltip, Paper, IconButton, styled as styled$4, Popover, MenuList, MenuItem, ListItemIcon, Divider,
|
|
11
|
+
import { Checkbox, Radio, Typography, FormControlLabel, Box, Grid, Tooltip, Paper, IconButton, styled as styled$4, Popover, MenuList, MenuItem, ListItemIcon, Divider, OutlinedInput, InputAdornment, Badge, List, ListItem, Button, Icon, CircularProgress } from '@mui/material';
|
|
12
12
|
import styled$3 from '@emotion/styled';
|
|
13
13
|
|
|
14
14
|
function getDefaultExportFromCjs (x) {
|
|
@@ -5670,7 +5670,7 @@ function StyledEngineProvider(props) {
|
|
|
5670
5670
|
}
|
|
5671
5671
|
|
|
5672
5672
|
/**
|
|
5673
|
-
* @mui/styled-engine v5.14.
|
|
5673
|
+
* @mui/styled-engine v5.14.18
|
|
5674
5674
|
*
|
|
5675
5675
|
* @license MIT
|
|
5676
5676
|
* This source code is licensed under the MIT license found in the
|
|
@@ -5718,7 +5718,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
5718
5718
|
return target;
|
|
5719
5719
|
}
|
|
5720
5720
|
|
|
5721
|
-
const _excluded$
|
|
5721
|
+
const _excluded$g = ["values", "unit", "step"];
|
|
5722
5722
|
const sortBreakpointsValues = values => {
|
|
5723
5723
|
const breakpointsAsArray = Object.keys(values).map(key => ({
|
|
5724
5724
|
key,
|
|
@@ -5753,7 +5753,7 @@ function createBreakpoints(breakpoints) {
|
|
|
5753
5753
|
unit = 'px',
|
|
5754
5754
|
step = 5
|
|
5755
5755
|
} = breakpoints,
|
|
5756
|
-
other = _objectWithoutPropertiesLoose(breakpoints, _excluded$
|
|
5756
|
+
other = _objectWithoutPropertiesLoose(breakpoints, _excluded$g);
|
|
5757
5757
|
const sortedValues = sortBreakpointsValues(values);
|
|
5758
5758
|
const keys = Object.keys(sortedValues);
|
|
5759
5759
|
function up(key) {
|
|
@@ -6751,7 +6751,7 @@ const styleFunctionSx = unstable_createStyleFunctionSx();
|
|
|
6751
6751
|
styleFunctionSx.filterProps = ['sx'];
|
|
6752
6752
|
var styleFunctionSx$1 = styleFunctionSx;
|
|
6753
6753
|
|
|
6754
|
-
const _excluded$
|
|
6754
|
+
const _excluded$f = ["breakpoints", "palette", "spacing", "shape"];
|
|
6755
6755
|
function createTheme$1(options = {}, ...args) {
|
|
6756
6756
|
const {
|
|
6757
6757
|
breakpoints: breakpointsInput = {},
|
|
@@ -6759,7 +6759,7 @@ function createTheme$1(options = {}, ...args) {
|
|
|
6759
6759
|
spacing: spacingInput,
|
|
6760
6760
|
shape: shapeInput = {}
|
|
6761
6761
|
} = options,
|
|
6762
|
-
other = _objectWithoutPropertiesLoose(options, _excluded$
|
|
6762
|
+
other = _objectWithoutPropertiesLoose(options, _excluded$f);
|
|
6763
6763
|
const breakpoints = createBreakpoints(breakpointsInput);
|
|
6764
6764
|
const spacing = createSpacing(spacingInput);
|
|
6765
6765
|
let muiTheme = deepmerge({
|
|
@@ -6799,7 +6799,7 @@ function useTheme$3(defaultTheme = systemDefaultTheme$1) {
|
|
|
6799
6799
|
|
|
6800
6800
|
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}
|
|
6801
6801
|
|
|
6802
|
-
const _excluded$
|
|
6802
|
+
const _excluded$e = ["variant"];
|
|
6803
6803
|
function isEmpty$2(string) {
|
|
6804
6804
|
return string.length === 0;
|
|
6805
6805
|
}
|
|
@@ -6813,7 +6813,7 @@ function propsToClassKey(props) {
|
|
|
6813
6813
|
const {
|
|
6814
6814
|
variant
|
|
6815
6815
|
} = props,
|
|
6816
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
6816
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$e);
|
|
6817
6817
|
let classKey = variant || '';
|
|
6818
6818
|
Object.keys(other).sort().forEach(key => {
|
|
6819
6819
|
if (key === 'color') {
|
|
@@ -6825,7 +6825,7 @@ function propsToClassKey(props) {
|
|
|
6825
6825
|
return classKey;
|
|
6826
6826
|
}
|
|
6827
6827
|
|
|
6828
|
-
const _excluded$
|
|
6828
|
+
const _excluded$d = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"];
|
|
6829
6829
|
function isEmpty$1(obj) {
|
|
6830
6830
|
return Object.keys(obj).length === 0;
|
|
6831
6831
|
}
|
|
@@ -6962,7 +6962,7 @@ function createStyled(input = {}) {
|
|
|
6962
6962
|
// For more details: https://github.com/mui/material-ui/pull/37908
|
|
6963
6963
|
overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot))
|
|
6964
6964
|
} = inputOptions,
|
|
6965
|
-
options = _objectWithoutPropertiesLoose(inputOptions, _excluded$
|
|
6965
|
+
options = _objectWithoutPropertiesLoose(inputOptions, _excluded$d);
|
|
6966
6966
|
|
|
6967
6967
|
// if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.
|
|
6968
6968
|
const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver :
|
|
@@ -7441,7 +7441,7 @@ function ThemeProvider$1(props) {
|
|
|
7441
7441
|
});
|
|
7442
7442
|
}
|
|
7443
7443
|
|
|
7444
|
-
const _excluded$
|
|
7444
|
+
const _excluded$c = ["defaultProps", "mixins", "overrides", "palette", "props", "styleOverrides"],
|
|
7445
7445
|
_excluded2$1 = ["type", "mode"];
|
|
7446
7446
|
function adaptV4Theme(inputTheme) {
|
|
7447
7447
|
const {
|
|
@@ -7452,7 +7452,7 @@ function adaptV4Theme(inputTheme) {
|
|
|
7452
7452
|
props = {},
|
|
7453
7453
|
styleOverrides = {}
|
|
7454
7454
|
} = inputTheme,
|
|
7455
|
-
other = _objectWithoutPropertiesLoose$1(inputTheme, _excluded$
|
|
7455
|
+
other = _objectWithoutPropertiesLoose$1(inputTheme, _excluded$c);
|
|
7456
7456
|
const theme = _extends$3({}, other, {
|
|
7457
7457
|
components: {}
|
|
7458
7458
|
});
|
|
@@ -7665,7 +7665,7 @@ const green = {
|
|
|
7665
7665
|
};
|
|
7666
7666
|
var green$1 = green;
|
|
7667
7667
|
|
|
7668
|
-
const _excluded$
|
|
7668
|
+
const _excluded$b = ["mode", "contrastThreshold", "tonalOffset"];
|
|
7669
7669
|
const light$1 = {
|
|
7670
7670
|
// The colors used to style the text.
|
|
7671
7671
|
text: {
|
|
@@ -7834,7 +7834,7 @@ function createPalette(palette) {
|
|
|
7834
7834
|
contrastThreshold = 3,
|
|
7835
7835
|
tonalOffset = 0.2
|
|
7836
7836
|
} = palette,
|
|
7837
|
-
other = _objectWithoutPropertiesLoose$1(palette, _excluded$
|
|
7837
|
+
other = _objectWithoutPropertiesLoose$1(palette, _excluded$b);
|
|
7838
7838
|
const primary = palette.primary || getDefaultPrimary(mode);
|
|
7839
7839
|
const secondary = palette.secondary || getDefaultSecondary(mode);
|
|
7840
7840
|
const error = palette.error || getDefaultError(mode);
|
|
@@ -7933,7 +7933,7 @@ function createPalette(palette) {
|
|
|
7933
7933
|
return paletteOutput;
|
|
7934
7934
|
}
|
|
7935
7935
|
|
|
7936
|
-
const _excluded$
|
|
7936
|
+
const _excluded$a = ["fontFamily", "fontSize", "fontWeightLight", "fontWeightRegular", "fontWeightMedium", "fontWeightBold", "htmlFontSize", "allVariants", "pxToRem"];
|
|
7937
7937
|
function round$1(value) {
|
|
7938
7938
|
return Math.round(value * 1e5) / 1e5;
|
|
7939
7939
|
}
|
|
@@ -7964,7 +7964,7 @@ function createTypography(palette, typography) {
|
|
|
7964
7964
|
allVariants,
|
|
7965
7965
|
pxToRem: pxToRem2
|
|
7966
7966
|
} = _ref,
|
|
7967
|
-
other = _objectWithoutPropertiesLoose$1(_ref, _excluded$
|
|
7967
|
+
other = _objectWithoutPropertiesLoose$1(_ref, _excluded$a);
|
|
7968
7968
|
const coef = fontSize / 14;
|
|
7969
7969
|
const pxToRem = pxToRem2 || (size => `${size / htmlFontSize * coef}rem`);
|
|
7970
7970
|
const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => _extends$3({
|
|
@@ -8024,7 +8024,7 @@ function createShadow(...px) {
|
|
|
8024
8024
|
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)];
|
|
8025
8025
|
var shadows$1 = shadows;
|
|
8026
8026
|
|
|
8027
|
-
const _excluded$
|
|
8027
|
+
const _excluded$9 = ["duration", "easing", "delay"];
|
|
8028
8028
|
// Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves
|
|
8029
8029
|
// to learn the context in which each easing should be used.
|
|
8030
8030
|
const easing = {
|
|
@@ -8075,7 +8075,7 @@ function createTransitions(inputTransitions) {
|
|
|
8075
8075
|
easing: easingOption = mergedEasing.easeInOut,
|
|
8076
8076
|
delay = 0
|
|
8077
8077
|
} = options;
|
|
8078
|
-
_objectWithoutPropertiesLoose$1(options, _excluded$
|
|
8078
|
+
_objectWithoutPropertiesLoose$1(options, _excluded$9);
|
|
8079
8079
|
return (Array.isArray(props) ? props : [props]).map(animatedProp => `${animatedProp} ${typeof durationOption === 'string' ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === 'string' ? delay : formatMs(delay)}`).join(',');
|
|
8080
8080
|
};
|
|
8081
8081
|
return _extends$3({
|
|
@@ -8101,7 +8101,7 @@ const zIndex = {
|
|
|
8101
8101
|
};
|
|
8102
8102
|
var zIndex$1 = zIndex;
|
|
8103
8103
|
|
|
8104
|
-
const _excluded$
|
|
8104
|
+
const _excluded$8 = ["breakpoints", "mixins", "spacing", "palette", "transitions", "typography", "shape"];
|
|
8105
8105
|
function createTheme(options = {}, ...args) {
|
|
8106
8106
|
const {
|
|
8107
8107
|
mixins: mixinsInput = {},
|
|
@@ -8109,7 +8109,7 @@ function createTheme(options = {}, ...args) {
|
|
|
8109
8109
|
transitions: transitionsInput = {},
|
|
8110
8110
|
typography: typographyInput = {}
|
|
8111
8111
|
} = options,
|
|
8112
|
-
other = _objectWithoutPropertiesLoose$1(options, _excluded$
|
|
8112
|
+
other = _objectWithoutPropertiesLoose$1(options, _excluded$8);
|
|
8113
8113
|
if (options.vars) {
|
|
8114
8114
|
throw new Error(formatMuiErrorMessage(18));
|
|
8115
8115
|
}
|
|
@@ -8164,12 +8164,12 @@ const styled = createStyled({
|
|
|
8164
8164
|
});
|
|
8165
8165
|
var styled$1 = styled;
|
|
8166
8166
|
|
|
8167
|
-
const _excluded$
|
|
8167
|
+
const _excluded$7 = ["theme"];
|
|
8168
8168
|
function ThemeProvider(_ref) {
|
|
8169
8169
|
let {
|
|
8170
8170
|
theme: themeInput
|
|
8171
8171
|
} = _ref,
|
|
8172
|
-
props = _objectWithoutPropertiesLoose$1(_ref, _excluded$
|
|
8172
|
+
props = _objectWithoutPropertiesLoose$1(_ref, _excluded$7);
|
|
8173
8173
|
const scopedTheme = themeInput[THEME_ID];
|
|
8174
8174
|
return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeProvider$1, _extends$3({}, props, {
|
|
8175
8175
|
themeId: scopedTheme ? THEME_ID : undefined,
|
|
@@ -8551,7 +8551,7 @@ function create$3(definition) {
|
|
|
8551
8551
|
return cache[key];
|
|
8552
8552
|
}
|
|
8553
8553
|
|
|
8554
|
-
const NEBULA_VERSION_HASH = "
|
|
8554
|
+
const NEBULA_VERSION_HASH = "f910" ;
|
|
8555
8555
|
ClassNameGenerator$1.configure(componentName => {
|
|
8556
8556
|
return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
|
|
8557
8557
|
});
|
|
@@ -8812,7 +8812,7 @@ function boot(_ref2) {
|
|
|
8812
8812
|
const appRef = React__default.createRef();
|
|
8813
8813
|
const element = document.createElement('div');
|
|
8814
8814
|
element.style.display = 'none';
|
|
8815
|
-
element.setAttribute('data-nebulajs-version', "4.
|
|
8815
|
+
element.setAttribute('data-nebulajs-version', "4.8.0" );
|
|
8816
8816
|
element.setAttribute('data-app-id', app.id);
|
|
8817
8817
|
document.body.appendChild(element);
|
|
8818
8818
|
if (context) {
|
|
@@ -10030,6 +10030,7 @@ const getBarWidth = _ref => {
|
|
|
10030
10030
|
};
|
|
10031
10031
|
const getFrequencyText = qFrequency => qFrequency || frequencyTextNone;
|
|
10032
10032
|
|
|
10033
|
+
const _excluded$6 = ["backgroundColor"];
|
|
10033
10034
|
const getFreqFlexBasis = _ref => {
|
|
10034
10035
|
let {
|
|
10035
10036
|
sizes,
|
|
@@ -10111,8 +10112,8 @@ const RowColRoot = styled$1('div', {
|
|
|
10111
10112
|
freqHitsValue,
|
|
10112
10113
|
styles
|
|
10113
10114
|
} = _ref4;
|
|
10114
|
-
const
|
|
10115
|
-
|
|
10115
|
+
const _styles$content = styles.content,
|
|
10116
|
+
contentFontStyles = _objectWithoutProperties(_styles$content, _excluded$6);
|
|
10116
10117
|
const selectStyle = getSelectedStyle({
|
|
10117
10118
|
theme,
|
|
10118
10119
|
styles,
|
|
@@ -10138,20 +10139,17 @@ const RowColRoot = styled$1('div', {
|
|
|
10138
10139
|
outline: 'none'
|
|
10139
10140
|
}
|
|
10140
10141
|
},
|
|
10141
|
-
["& .".concat(rowColClasses.row)]: {
|
|
10142
|
-
flexWrap: 'nowrap'
|
|
10143
|
-
|
|
10144
|
-
backgroundColor: rowBackgroundColor
|
|
10145
|
-
},
|
|
10142
|
+
["& .".concat(rowColClasses.row)]: _objectSpread2({
|
|
10143
|
+
flexWrap: 'nowrap'
|
|
10144
|
+
}, styles.content),
|
|
10146
10145
|
["& .".concat(rowColClasses.rowBorderBottom)]: {
|
|
10147
10146
|
borderBottom: isGridCol ? 'none' : "1px solid ".concat(theme.palette.divider),
|
|
10148
10147
|
borderLeft: isGridCol ? "1px solid ".concat(theme.palette.divider) : 'none'
|
|
10149
10148
|
},
|
|
10150
|
-
["& .".concat(rowColClasses.column)]: {
|
|
10149
|
+
["& .".concat(rowColClasses.column)]: _objectSpread2({
|
|
10151
10150
|
flexWrap: 'nowrap',
|
|
10152
|
-
borderRight: "1px solid ".concat(theme.palette.divider)
|
|
10153
|
-
|
|
10154
|
-
},
|
|
10151
|
+
borderRight: "1px solid ".concat(theme.palette.divider)
|
|
10152
|
+
}, styles.content),
|
|
10155
10153
|
// The interior wrapper for all field content.
|
|
10156
10154
|
["& .".concat(rowColClasses.cell)]: {
|
|
10157
10155
|
zIndex: 2,
|
|
@@ -10170,11 +10168,7 @@ const RowColRoot = styled$1('div', {
|
|
|
10170
10168
|
lineHeight: '16px',
|
|
10171
10169
|
userSelect: 'none',
|
|
10172
10170
|
paddingRight: '1px'
|
|
10173
|
-
}, ellipsis),
|
|
10174
|
-
fontSize: styles.content.fontSize,
|
|
10175
|
-
fontFamily: styles.content.fontFamily,
|
|
10176
|
-
color: rowFontColor
|
|
10177
|
-
}),
|
|
10171
|
+
}, ellipsis), contentFontStyles),
|
|
10178
10172
|
["& .".concat(rowColClasses.labelDense)]: {
|
|
10179
10173
|
fontSize: 12
|
|
10180
10174
|
},
|
|
@@ -10208,7 +10202,7 @@ const RowColRoot = styled$1('div', {
|
|
|
10208
10202
|
width: iconWidth,
|
|
10209
10203
|
minWidth: iconWidth,
|
|
10210
10204
|
maxWidth: iconWidth,
|
|
10211
|
-
color:
|
|
10205
|
+
color: contentFontStyles.color
|
|
10212
10206
|
},
|
|
10213
10207
|
// Selection styles (S=Selected, XS=ExcludedSelected, A=Alternative, X=Excluded).
|
|
10214
10208
|
["& .".concat(rowColClasses.S)]: _objectSpread2(_objectSpread2({}, selectStyle), {}, {
|
|
@@ -14507,7 +14501,7 @@ const StyledPopover$1 = styled$1(Popover)(_ref => {
|
|
|
14507
14501
|
return {
|
|
14508
14502
|
// Set here to allow clicking through the modals container
|
|
14509
14503
|
pointerEvents: 'none',
|
|
14510
|
-
["& .".concat(classes$8.icon)]: {
|
|
14504
|
+
["& .".concat(classes$8.icon, " *")]: {
|
|
14511
14505
|
color: theme.palette.text.primary
|
|
14512
14506
|
}
|
|
14513
14507
|
};
|
|
@@ -14565,6 +14559,12 @@ const More$1 = React__default.forwardRef((_ref3, ref) => {
|
|
|
14565
14559
|
slotProps: {
|
|
14566
14560
|
root: {
|
|
14567
14561
|
className: ActionsToolbarMoreElement.className
|
|
14562
|
+
},
|
|
14563
|
+
paper: {
|
|
14564
|
+
style: _objectSpread2({
|
|
14565
|
+
pointerEvents: 'auto',
|
|
14566
|
+
maxWidth: '250px'
|
|
14567
|
+
}, popoverPaperStyle)
|
|
14568
14568
|
}
|
|
14569
14569
|
},
|
|
14570
14570
|
anchorOrigin: {
|
|
@@ -14574,12 +14574,6 @@ const More$1 = React__default.forwardRef((_ref3, ref) => {
|
|
|
14574
14574
|
transformOrigin: {
|
|
14575
14575
|
vertical: 'top',
|
|
14576
14576
|
horizontal: 'right'
|
|
14577
|
-
},
|
|
14578
|
-
PaperProps: {
|
|
14579
|
-
style: _objectSpread2({
|
|
14580
|
-
pointerEvents: 'auto',
|
|
14581
|
-
maxWidth: '250px'
|
|
14582
|
-
}, popoverPaperStyle)
|
|
14583
14577
|
}
|
|
14584
14578
|
}), /*#__PURE__*/React__default.createElement(MenuList, {
|
|
14585
14579
|
id: "moreMenuList"
|
|
@@ -14903,30 +14897,53 @@ var SearchIcon = (props => SvgIcon$2(search(props)));
|
|
|
14903
14897
|
|
|
14904
14898
|
const TREE_PATH = '/qListObjectDef';
|
|
14905
14899
|
const WILDCARD = '**';
|
|
14906
|
-
const
|
|
14907
|
-
shouldForwardProp: p =>
|
|
14900
|
+
const StyledOutlinedInput = styled$1(OutlinedInput, {
|
|
14901
|
+
shouldForwardProp: p => !['styles', 'dense', 'isRtl'].includes(p)
|
|
14908
14902
|
})(_ref => {
|
|
14909
14903
|
let {
|
|
14910
|
-
|
|
14904
|
+
theme,
|
|
14905
|
+
styles,
|
|
14906
|
+
dense,
|
|
14907
|
+
isRtl
|
|
14911
14908
|
} = _ref;
|
|
14912
|
-
|
|
14913
|
-
|
|
14914
|
-
|
|
14915
|
-
|
|
14916
|
-
|
|
14917
|
-
|
|
14918
|
-
|
|
14919
|
-
|
|
14920
|
-
|
|
14921
|
-
|
|
14922
|
-
|
|
14909
|
+
let denseProps = {};
|
|
14910
|
+
if (dense) {
|
|
14911
|
+
denseProps = {
|
|
14912
|
+
fontSize: 12,
|
|
14913
|
+
paddingLeft: theme.spacing(1),
|
|
14914
|
+
'& input': {
|
|
14915
|
+
paddingTop: '5px',
|
|
14916
|
+
paddingBottom: '5px'
|
|
14917
|
+
}
|
|
14918
|
+
};
|
|
14919
|
+
}
|
|
14920
|
+
return _objectSpread2({
|
|
14923
14921
|
display: 'flex',
|
|
14924
|
-
|
|
14922
|
+
border: 'none',
|
|
14923
|
+
fontSize: 14,
|
|
14924
|
+
borderRadius: 0,
|
|
14925
|
+
backgroundColor: styles.search.backgroundColor,
|
|
14926
|
+
paddingLeft: "".concat(CELL_PADDING_LEFT, "px"),
|
|
14927
|
+
flexDirection: isRtl ? 'row-reverse' : 'row',
|
|
14928
|
+
'& fieldset': {
|
|
14929
|
+
borderColor: "".concat(styles.search.borderColor),
|
|
14930
|
+
borderWidth: '1px 0 1px 0',
|
|
14931
|
+
borderRadius: 0
|
|
14932
|
+
},
|
|
14933
|
+
'& .MuiInputBase-root': _objectSpread2({}, styles.search),
|
|
14934
|
+
'& *': {
|
|
14925
14935
|
color: styles.search.color
|
|
14936
|
+
},
|
|
14937
|
+
'& input': {
|
|
14938
|
+
color: styles.search.color,
|
|
14939
|
+
textAlign: isRtl ? 'right' : 'left'
|
|
14940
|
+
},
|
|
14941
|
+
'&.Mui-focused fieldset.OutlinedInput-notchedOutline': {
|
|
14942
|
+
borderColor: "".concat(styles.search.highlightBorderColor, " !important")
|
|
14926
14943
|
}
|
|
14927
|
-
};
|
|
14944
|
+
}, denseProps);
|
|
14928
14945
|
});
|
|
14929
|
-
function ListBoxSearch(
|
|
14946
|
+
function ListBoxSearch(_ref2) {
|
|
14930
14947
|
let {
|
|
14931
14948
|
selections,
|
|
14932
14949
|
selectionState,
|
|
@@ -14940,20 +14957,18 @@ function ListBoxSearch(_ref3) {
|
|
|
14940
14957
|
direction,
|
|
14941
14958
|
hide,
|
|
14942
14959
|
styles
|
|
14943
|
-
} =
|
|
14960
|
+
} = _ref2;
|
|
14944
14961
|
const {
|
|
14945
14962
|
translator
|
|
14946
14963
|
} = useContext(InstanceContext);
|
|
14947
14964
|
const [value, setValue] = useState$1('');
|
|
14948
14965
|
const [wildcardOn, setWildcardOn] = useState$1(false);
|
|
14949
14966
|
const inputRef = useRef();
|
|
14950
|
-
const theme = useTheme$1();
|
|
14951
14967
|
const {
|
|
14952
14968
|
getStoreValue,
|
|
14953
14969
|
setStoreValue
|
|
14954
14970
|
} = useDataStore(model);
|
|
14955
14971
|
const isRtl = direction === 'rtl';
|
|
14956
|
-
const inpuTextAlign = isRtl ? 'right' : 'left';
|
|
14957
14972
|
const cancel = () => selections.isActive() && selections.cancel();
|
|
14958
14973
|
const abortSearch = async () => {
|
|
14959
14974
|
if (!selections.isModal()) {
|
|
@@ -15077,37 +15092,14 @@ function ListBoxSearch(_ref3) {
|
|
|
15077
15092
|
}
|
|
15078
15093
|
return /*#__PURE__*/React__default.createElement(StyledOutlinedInput, {
|
|
15079
15094
|
styles: styles,
|
|
15080
|
-
|
|
15081
|
-
|
|
15082
|
-
|
|
15095
|
+
dense: dense,
|
|
15096
|
+
isRtl: isRtl,
|
|
15097
|
+
startAdornment: /*#__PURE__*/React__default.createElement(InputAdornment, {
|
|
15098
|
+
position: "start"
|
|
15083
15099
|
}, /*#__PURE__*/React__default.createElement(SearchIcon, {
|
|
15084
15100
|
size: dense ? 'small' : 'normal'
|
|
15085
15101
|
})),
|
|
15086
15102
|
className: "search",
|
|
15087
|
-
sx: [{
|
|
15088
|
-
border: 'none',
|
|
15089
|
-
fontSize: 14,
|
|
15090
|
-
borderRadius: 0,
|
|
15091
|
-
backgroundColor: 'transparent',
|
|
15092
|
-
'& fieldset': {
|
|
15093
|
-
border: "1px solid ".concat(theme.palette.divider),
|
|
15094
|
-
borderWidth: '1px 0 1px 0',
|
|
15095
|
-
borderRadius: 0
|
|
15096
|
-
},
|
|
15097
|
-
'&:hover': {
|
|
15098
|
-
border: 'none'
|
|
15099
|
-
},
|
|
15100
|
-
paddingLeft: "".concat(CELL_PADDING_LEFT, "px")
|
|
15101
|
-
}, dense && {
|
|
15102
|
-
fontSize: 12,
|
|
15103
|
-
paddingLeft: theme.spacing(1),
|
|
15104
|
-
'& input': {
|
|
15105
|
-
paddingTop: '5px',
|
|
15106
|
-
paddingBottom: '5px'
|
|
15107
|
-
}
|
|
15108
|
-
}, {
|
|
15109
|
-
flexDirection: isRtl ? 'row-reverse' : 'row'
|
|
15110
|
-
}],
|
|
15111
15103
|
inputRef: inputRef,
|
|
15112
15104
|
size: "small",
|
|
15113
15105
|
fullWidth: true,
|
|
@@ -15119,9 +15111,6 @@ function ListBoxSearch(_ref3) {
|
|
|
15119
15111
|
autoFocus: autoFocus,
|
|
15120
15112
|
inputProps: {
|
|
15121
15113
|
tabIndex: keyboard.innerTabStops ? 0 : -1,
|
|
15122
|
-
style: {
|
|
15123
|
-
textAlign: "".concat(inpuTextAlign)
|
|
15124
|
-
},
|
|
15125
15114
|
'data-testid': 'search-input-field',
|
|
15126
15115
|
'aria-label': translator.get('Listbox.Search.ScreenReaderInstructions')
|
|
15127
15116
|
}
|
|
@@ -16319,7 +16308,7 @@ const {
|
|
|
16319
16308
|
* @class
|
|
16320
16309
|
* @classdesc Class which provides color transformation functionality
|
|
16321
16310
|
* @description This is a constructor.
|
|
16322
|
-
* @private
|
|
16311
|
+
* @private
|
|
16323
16312
|
* @param {object} - Parameters to create a color from different notations
|
|
16324
16313
|
* @example
|
|
16325
16314
|
* // a few ways of instantiating a red color
|
|
@@ -17112,6 +17101,211 @@ class Color {
|
|
|
17112
17101
|
}
|
|
17113
17102
|
}
|
|
17114
17103
|
|
|
17104
|
+
const MULTI_REG = /,(?![^(]*\))/;
|
|
17105
|
+
const SINGLE_REG = /\s(?![^(]*\))/;
|
|
17106
|
+
const LENGTH_REG = /^[0-9]+[a-zA-Z%]+?$/;
|
|
17107
|
+
const PREDEFINED_STRINGS = ['none', 'inset', 'initial', 'inherit'];
|
|
17108
|
+
const isLength = v => v === '0' || LENGTH_REG.test(v);
|
|
17109
|
+
const getColor = singleShadowString => {
|
|
17110
|
+
if (!singleShadowString) return undefined;
|
|
17111
|
+
const parts = singleShadowString.split(SINGLE_REG).filter(part => !PREDEFINED_STRINGS.includes(part.toLowerCase()));
|
|
17112
|
+
const last = parts.at(-1);
|
|
17113
|
+
const color = last && !isLength(last) && !PREDEFINED_STRINGS.includes(last.toLowerCase()) ? last : undefined;
|
|
17114
|
+
return color;
|
|
17115
|
+
};
|
|
17116
|
+
const getShadows = shadowString => {
|
|
17117
|
+
if (!shadowString) return [];
|
|
17118
|
+
return shadowString.split(MULTI_REG).map(s => s.trim());
|
|
17119
|
+
};
|
|
17120
|
+
|
|
17121
|
+
/**
|
|
17122
|
+
* Combine box shadow with box shadow color.
|
|
17123
|
+
* @private
|
|
17124
|
+
* @param {string} boxShadow - Box shadow which may include color
|
|
17125
|
+
* @param {string} themeBoxShadow - Box shadow from theme which may include color
|
|
17126
|
+
* @param {string | undefined} boxShadowColor - Box shadow color
|
|
17127
|
+
* @returns {string} Returns the combined box shadow and box shadow color
|
|
17128
|
+
*
|
|
17129
|
+
* If boxShadow is a single shadow and has a color then this color will be replaced by boxShadowColor and then
|
|
17130
|
+
* returned as the result,otherwise boxShadowColor will be added to boxShadow and then returned as the result.
|
|
17131
|
+
* If boxShadow is multiple shadows or an empty string then it will be returned as the result.
|
|
17132
|
+
*
|
|
17133
|
+
* @example getFullBoxShadow('none', '', 'red') returns 'none'
|
|
17134
|
+
*
|
|
17135
|
+
* @example getFullBoxShadow('initial', '', 'red') returns 'initial'
|
|
17136
|
+
*
|
|
17137
|
+
* @example getFullBoxShadow('inherit', '', 'red') returns 'inherit'
|
|
17138
|
+
*
|
|
17139
|
+
* @example getFullBoxShadow('', '', 'red') returns ''
|
|
17140
|
+
*
|
|
17141
|
+
* @example getFullBoxShadow('1px 2px blue, 3px 6px green', '', 'red') returns '1px 2px blue, 3px 6px green'
|
|
17142
|
+
*
|
|
17143
|
+
* @example getFullBoxShadow('1px 2px blue', '', 'red') returns '1px 2px red'
|
|
17144
|
+
*
|
|
17145
|
+
* @example getFullBoxShadow('1px 2px', '', 'red') returns '1px 2px red'
|
|
17146
|
+
*
|
|
17147
|
+
* @example getFullBoxShadow('1px 2px', '2px 5px green', undefined) returns '1px 2px green'
|
|
17148
|
+
*
|
|
17149
|
+
* @example getFullBoxShadow('1px 2px', '2px 5px', undefined) returns '1px 2px'
|
|
17150
|
+
*/
|
|
17151
|
+
const getFullBoxShadow = (boxShadow, themeBoxShadow, boxShadowColor) => {
|
|
17152
|
+
if (boxShadow && PREDEFINED_STRINGS.includes(boxShadow.toLowerCase())) return boxShadow.toLowerCase();
|
|
17153
|
+
const shadowArray = getShadows(boxShadow);
|
|
17154
|
+
if (shadowArray.length !== 1) return boxShadow;
|
|
17155
|
+
let shadowColor = boxShadowColor;
|
|
17156
|
+
if (!shadowColor) {
|
|
17157
|
+
const themeShadowArray = getShadows(themeBoxShadow);
|
|
17158
|
+
if (themeShadowArray.length !== 1) return boxShadow;
|
|
17159
|
+
shadowColor = getColor(themeShadowArray[0]);
|
|
17160
|
+
}
|
|
17161
|
+
if (!shadowColor) return boxShadow;
|
|
17162
|
+
const color = getColor(shadowArray[0]);
|
|
17163
|
+
if (color) return boxShadow.replace(color, shadowColor);
|
|
17164
|
+
return "".concat(boxShadow, " ").concat(shadowColor);
|
|
17165
|
+
};
|
|
17166
|
+
|
|
17167
|
+
function resolveProperty(path, attribute, theme, objectType) {
|
|
17168
|
+
if (theme && objectType) {
|
|
17169
|
+
return theme.getStyle("object.".concat(objectType), path, attribute);
|
|
17170
|
+
}
|
|
17171
|
+
if (theme) {
|
|
17172
|
+
return theme.getStyle('', path, attribute);
|
|
17173
|
+
}
|
|
17174
|
+
return undefined;
|
|
17175
|
+
}
|
|
17176
|
+
|
|
17177
|
+
const supportNone = true;
|
|
17178
|
+
function resolveColor(colorObj, path, attribute, theme, objectType) {
|
|
17179
|
+
if (colorObj && theme) {
|
|
17180
|
+
return colorObj.color !== 'none' ? theme.getColorPickerColor(colorObj, supportNone) : undefined;
|
|
17181
|
+
}
|
|
17182
|
+
return resolveProperty(path, attribute, theme, objectType);
|
|
17183
|
+
}
|
|
17184
|
+
|
|
17185
|
+
const imageSizingToCssProperty = {
|
|
17186
|
+
originalSize: 'auto auto',
|
|
17187
|
+
alwaysFit: 'contain',
|
|
17188
|
+
fitWidth: '100% auto',
|
|
17189
|
+
fitHeight: 'auto 100%',
|
|
17190
|
+
stretchFit: '100% 100%',
|
|
17191
|
+
alwaysFill: 'cover'
|
|
17192
|
+
};
|
|
17193
|
+
const positionToCss = {
|
|
17194
|
+
'top-left': 'top left',
|
|
17195
|
+
'top-center': 'top center',
|
|
17196
|
+
'top-right': 'top right',
|
|
17197
|
+
'center-left': 'center left',
|
|
17198
|
+
'center-center': 'center center',
|
|
17199
|
+
'center-right': 'center right',
|
|
17200
|
+
'bottom-left': 'bottom left',
|
|
17201
|
+
'bottom-center': 'bottom center',
|
|
17202
|
+
'bottom-right': 'bottom right'
|
|
17203
|
+
};
|
|
17204
|
+
|
|
17205
|
+
// TODO: this needs some proper verification
|
|
17206
|
+
function getSenseServerUrl(app) {
|
|
17207
|
+
var _app$session;
|
|
17208
|
+
let config;
|
|
17209
|
+
let wsUrl;
|
|
17210
|
+
let protocol;
|
|
17211
|
+
let isSecure;
|
|
17212
|
+
if (app !== null && app !== void 0 && (_app$session = app.session) !== null && _app$session !== void 0 && _app$session.config) {
|
|
17213
|
+
config = app.session.config;
|
|
17214
|
+
wsUrl = new URL(config.url);
|
|
17215
|
+
isSecure = wsUrl.protocol === 'wss:';
|
|
17216
|
+
protocol = isSecure ? 'https://' : 'http://';
|
|
17217
|
+
return protocol + wsUrl.host;
|
|
17218
|
+
}
|
|
17219
|
+
return '';
|
|
17220
|
+
}
|
|
17221
|
+
function getBackgroundPosition(bgComp) {
|
|
17222
|
+
var _bgComp$bgImage;
|
|
17223
|
+
let bkgImagePosition = 'center center';
|
|
17224
|
+
if (bgComp !== null && bgComp !== void 0 && (_bgComp$bgImage = bgComp.bgImage) !== null && _bgComp$bgImage !== void 0 && _bgComp$bgImage.position) {
|
|
17225
|
+
bkgImagePosition = positionToCss[bgComp.bgImage.position];
|
|
17226
|
+
}
|
|
17227
|
+
return bkgImagePosition;
|
|
17228
|
+
}
|
|
17229
|
+
function getBackgroundSize(bgComp) {
|
|
17230
|
+
var _bgComp$bgImage2;
|
|
17231
|
+
let bkgImageSize = imageSizingToCssProperty.originalSize;
|
|
17232
|
+
const size = bgComp === null || bgComp === void 0 || (_bgComp$bgImage2 = bgComp.bgImage) === null || _bgComp$bgImage2 === void 0 ? void 0 : _bgComp$bgImage2.sizing;
|
|
17233
|
+
if (size) {
|
|
17234
|
+
bkgImageSize = imageSizingToCssProperty[size];
|
|
17235
|
+
}
|
|
17236
|
+
return bkgImageSize;
|
|
17237
|
+
}
|
|
17238
|
+
function resolveImageUrl(app, relativeUrl) {
|
|
17239
|
+
return relativeUrl ? getSenseServerUrl(app) + relativeUrl : undefined;
|
|
17240
|
+
}
|
|
17241
|
+
function resolveBgImage(bgComp, app) {
|
|
17242
|
+
const bgImageDef = bgComp === null || bgComp === void 0 ? void 0 : bgComp.bgImage;
|
|
17243
|
+
if (bgImageDef) {
|
|
17244
|
+
let url = '';
|
|
17245
|
+
if (bgImageDef.mode === 'media' || bgComp.useImage === 'media') {
|
|
17246
|
+
const urlObj = bgImageDef === null || bgImageDef === void 0 ? void 0 : bgImageDef.mediaUrl;
|
|
17247
|
+
const {
|
|
17248
|
+
qUrl
|
|
17249
|
+
} = (urlObj === null || urlObj === void 0 ? void 0 : urlObj.qStaticContentUrl) || {};
|
|
17250
|
+
url = qUrl ? decodeURIComponent(qUrl) : undefined;
|
|
17251
|
+
url = resolveImageUrl(app, url);
|
|
17252
|
+
}
|
|
17253
|
+
if (bgImageDef.mode === 'expression') {
|
|
17254
|
+
url = bgImageDef.expressionUrl ? decodeURIComponent(bgImageDef.expressionUrl) : undefined;
|
|
17255
|
+
}
|
|
17256
|
+
const pos = getBackgroundPosition(bgComp);
|
|
17257
|
+
const size = getBackgroundSize(bgComp);
|
|
17258
|
+
return url ? {
|
|
17259
|
+
url,
|
|
17260
|
+
pos,
|
|
17261
|
+
size
|
|
17262
|
+
} : undefined;
|
|
17263
|
+
}
|
|
17264
|
+
return undefined;
|
|
17265
|
+
}
|
|
17266
|
+
function resolveBgColor(comp, theme, objectType) {
|
|
17267
|
+
const bgColor = comp === null || comp === void 0 ? void 0 : comp.bgColor;
|
|
17268
|
+
if (bgColor && theme) {
|
|
17269
|
+
if (bgColor.useExpression) {
|
|
17270
|
+
return theme.validateColor(bgColor.colorExpression);
|
|
17271
|
+
}
|
|
17272
|
+
}
|
|
17273
|
+
return resolveColor(bgColor === null || bgColor === void 0 ? void 0 : bgColor.color, '', 'backgroundColor', theme, objectType);
|
|
17274
|
+
}
|
|
17275
|
+
function resolveBorder(comp, theme, objectType) {
|
|
17276
|
+
const borderColor = resolveColor(comp === null || comp === void 0 ? void 0 : comp.borderColor, '', 'borderColor', theme, objectType);
|
|
17277
|
+
const borderWidth = (comp === null || comp === void 0 ? void 0 : comp.borderWidth) || resolveProperty('', 'borderWidth', theme, objectType);
|
|
17278
|
+
return borderWidth && borderColor ? "".concat(borderWidth, " solid ").concat(borderColor) : undefined;
|
|
17279
|
+
}
|
|
17280
|
+
function resolveBorderRadius(comp, theme, objectType) {
|
|
17281
|
+
return (comp === null || comp === void 0 ? void 0 : comp.borderRadius) || resolveProperty('', 'borderRadius', theme, objectType);
|
|
17282
|
+
}
|
|
17283
|
+
function resolveBoxShadow(comp, theme, objectType) {
|
|
17284
|
+
var _comp$shadow, _comp$shadow2;
|
|
17285
|
+
const themeBoxShadow = resolveProperty('shadow', 'boxShadow', theme, objectType);
|
|
17286
|
+
const boxShadow = (comp === null || comp === void 0 || (_comp$shadow = comp.shadow) === null || _comp$shadow === void 0 ? void 0 : _comp$shadow.boxShadow) || themeBoxShadow;
|
|
17287
|
+
const boxShadowColor = resolveColor(comp === null || comp === void 0 || (_comp$shadow2 = comp.shadow) === null || _comp$shadow2 === void 0 ? void 0 : _comp$shadow2.boxShadowColor, 'shadow', 'boxShadowColor', theme, objectType);
|
|
17288
|
+
return getFullBoxShadow(boxShadow, themeBoxShadow, boxShadowColor);
|
|
17289
|
+
}
|
|
17290
|
+
function unfurlFontStyle(fontStyle, target) {
|
|
17291
|
+
if (fontStyle && Array.isArray(fontStyle)) {
|
|
17292
|
+
return fontStyle;
|
|
17293
|
+
}
|
|
17294
|
+
return target === 'main' ? ['bold'] : [];
|
|
17295
|
+
}
|
|
17296
|
+
function resolveTextStyle(textComp, target, theme, objectType) {
|
|
17297
|
+
var _textComp$title;
|
|
17298
|
+
const textProps = (textComp === null || textComp === void 0 || (_textComp$title = textComp.title) === null || _textComp$title === void 0 ? void 0 : _textComp$title[target]) || {};
|
|
17299
|
+
const fontStyle = unfurlFontStyle(textProps.fontStyle, target);
|
|
17300
|
+
return {
|
|
17301
|
+
fontFamily: textProps.fontFamily || theme.getStyle("object.".concat(objectType), "title.".concat(target), 'fontFamily'),
|
|
17302
|
+
color: textProps.color && textProps.color.color !== 'none' ? theme.getColorPickerColor(textProps.color, true) : theme.getStyle("object.".concat(objectType), target, 'color'),
|
|
17303
|
+
fontWeight: fontStyle.includes('bold') ? 'bold' : 'normal',
|
|
17304
|
+
fontStyle: fontStyle.includes('italic') ? 'italic' : 'normal',
|
|
17305
|
+
textDecoration: fontStyle.includes('underline') ? 'underline' : 'initial'
|
|
17306
|
+
};
|
|
17307
|
+
}
|
|
17308
|
+
|
|
17115
17309
|
const LIGHT = '#FFF';
|
|
17116
17310
|
const DARK = '#000';
|
|
17117
17311
|
const CONTRAST_THRESHOLD = 1.5;
|
|
@@ -17213,14 +17407,40 @@ function getSelectionColors(_ref) {
|
|
|
17213
17407
|
possibleContrast
|
|
17214
17408
|
};
|
|
17215
17409
|
}
|
|
17216
|
-
function
|
|
17217
|
-
|
|
17410
|
+
function getBackgroundColor(_ref2) {
|
|
17411
|
+
let {
|
|
17412
|
+
themeApi,
|
|
17413
|
+
themeOverrides
|
|
17414
|
+
} = _ref2;
|
|
17415
|
+
let color;
|
|
17416
|
+
const bgColor = themeOverrides === null || themeOverrides === void 0 ? void 0 : themeOverrides.background;
|
|
17417
|
+
if (!bgColor) {
|
|
17418
|
+
return color;
|
|
17419
|
+
}
|
|
17420
|
+
if (bgColor !== null && bgColor !== void 0 && bgColor.useExpression) {
|
|
17421
|
+
color = resolveBgColor({
|
|
17422
|
+
bgColor
|
|
17423
|
+
}, themeApi, 'listBox');
|
|
17424
|
+
} else {
|
|
17425
|
+
var _themeApi$getColorPic;
|
|
17426
|
+
color = (_themeApi$getColorPic = themeApi.getColorPickerColor(bgColor, true)) === null || _themeApi$getColorPic === void 0 ? void 0 : _themeApi$getColorPic.color;
|
|
17427
|
+
}
|
|
17428
|
+
return color;
|
|
17429
|
+
}
|
|
17430
|
+
function getSearchColor(getListboxStyle) {
|
|
17431
|
+
const desiredTextColor = getListboxStyle('content', 'color');
|
|
17432
|
+
const color = getContrastingColor('#fff', desiredTextColor);
|
|
17433
|
+
return color;
|
|
17434
|
+
}
|
|
17435
|
+
function getStyles(_ref3) {
|
|
17436
|
+
var _themeOverrides$heade, _themeOverrides$backg, _themeOverrides$heade2, _themeOverrides$conte, _themeOverrides$heade3, _themeOverrides$heade4, _themeOverrides$conte2, _themeOverrides$conte3;
|
|
17218
17437
|
let {
|
|
17438
|
+
app,
|
|
17219
17439
|
themeApi,
|
|
17220
17440
|
theme,
|
|
17221
17441
|
components = [],
|
|
17222
17442
|
checkboxes = false
|
|
17223
|
-
} =
|
|
17443
|
+
} = _ref3;
|
|
17224
17444
|
const overrides = getOverridesAsObject(components);
|
|
17225
17445
|
const getListboxStyle = (path, prop) => themeApi.getStyle('object.listBox', path, prop);
|
|
17226
17446
|
const selections = getSelectionColors({
|
|
@@ -17230,22 +17450,51 @@ function getStyles(_ref2) {
|
|
|
17230
17450
|
checkboxes
|
|
17231
17451
|
});
|
|
17232
17452
|
const themeOverrides = overrides.theme || {};
|
|
17453
|
+
const headerColor = ((_themeOverrides$heade = themeOverrides.header) === null || _themeOverrides$heade === void 0 || (_themeOverrides$heade = _themeOverrides$heade.fontColor) === null || _themeOverrides$heade === void 0 ? void 0 : _themeOverrides$heade.color) || getListboxStyle('title.main', 'color');
|
|
17454
|
+
const bgComponentColor = getBackgroundColor({
|
|
17455
|
+
themeApi,
|
|
17456
|
+
themeOverrides
|
|
17457
|
+
});
|
|
17458
|
+
const bgImage = (_themeOverrides$backg = themeOverrides.background) !== null && _themeOverrides$backg !== void 0 && _themeOverrides$backg.image ? resolveBgImage({
|
|
17459
|
+
bgImage: themeOverrides.background.image
|
|
17460
|
+
}, app) : undefined;
|
|
17461
|
+
const searchBgColor = 'rgba(255, 255, 255, 0.7)';
|
|
17462
|
+
const searchColor = getSearchColor(getListboxStyle);
|
|
17463
|
+
const headerFontStyle = ((_themeOverrides$heade2 = themeOverrides.header) === null || _themeOverrides$heade2 === void 0 ? void 0 : _themeOverrides$heade2.fontStyle) || {};
|
|
17464
|
+
const contentFontStyle = ((_themeOverrides$conte = themeOverrides.content) === null || _themeOverrides$conte === void 0 ? void 0 : _themeOverrides$conte.fontStyle) || {};
|
|
17465
|
+
|
|
17466
|
+
// Ensure we only return falseValue when the component is used, and thus has a false value.
|
|
17467
|
+
const getWithFallback = (value, trueValue, falseValue) => value === true && trueValue || value === false && falseValue || undefined;
|
|
17233
17468
|
return {
|
|
17234
|
-
|
|
17469
|
+
background: {
|
|
17470
|
+
backgroundColor: bgComponentColor || getListboxStyle('', 'backgroundColor') || theme.palette.background.default,
|
|
17471
|
+
backgroundImage: bgImage !== null && bgImage !== void 0 && bgImage.url && !(bgImage !== null && bgImage !== void 0 && bgImage.url.startsWith('url(')) ? "url('".concat(bgImage.url, "')") : undefined,
|
|
17472
|
+
backgroundRepeat: 'no-repeat',
|
|
17473
|
+
backgroundSize: bgImage === null || bgImage === void 0 ? void 0 : bgImage.size,
|
|
17474
|
+
backgroundPosition: bgImage === null || bgImage === void 0 ? void 0 : bgImage.pos
|
|
17475
|
+
},
|
|
17235
17476
|
header: {
|
|
17236
|
-
color:
|
|
17237
|
-
fontSize: ((_themeOverrides$
|
|
17238
|
-
fontFamily: getListboxStyle('title.main', 'fontFamily'),
|
|
17239
|
-
fontWeight: getListboxStyle('title.main', 'fontWeight') || 'bold'
|
|
17477
|
+
color: headerColor,
|
|
17478
|
+
fontSize: ((_themeOverrides$heade3 = themeOverrides.header) === null || _themeOverrides$heade3 === void 0 ? void 0 : _themeOverrides$heade3.fontSize) || getListboxStyle('title.main', 'fontSize'),
|
|
17479
|
+
fontFamily: ((_themeOverrides$heade4 = themeOverrides.header) === null || _themeOverrides$heade4 === void 0 ? void 0 : _themeOverrides$heade4.fontFamily) || getListboxStyle('title.main', 'fontFamily'),
|
|
17480
|
+
fontWeight: getWithFallback(headerFontStyle.bold, 'bold', 'normal') || getListboxStyle('title.main', 'fontWeight') || 'bold',
|
|
17481
|
+
textDecoration: headerFontStyle.underline ? 'underline' : 'initial',
|
|
17482
|
+
fontStyle: getWithFallback(headerFontStyle.italic, 'italic', 'normal') || getListboxStyle('title.main', 'fontStyle') || 'initial'
|
|
17240
17483
|
},
|
|
17241
17484
|
content: {
|
|
17242
17485
|
backgroundColor: checkboxes ? undefined : selections.possible,
|
|
17243
17486
|
color: selections.possibleContrast || getListboxStyle('content', 'color'),
|
|
17244
|
-
fontSize: ((_themeOverrides$
|
|
17245
|
-
fontFamily: getListboxStyle('content', 'fontFamily')
|
|
17487
|
+
fontSize: ((_themeOverrides$conte2 = themeOverrides.content) === null || _themeOverrides$conte2 === void 0 ? void 0 : _themeOverrides$conte2.fontSize) || getListboxStyle('content', 'fontSize'),
|
|
17488
|
+
fontFamily: ((_themeOverrides$conte3 = themeOverrides.content) === null || _themeOverrides$conte3 === void 0 ? void 0 : _themeOverrides$conte3.fontFamily) || getListboxStyle('content', 'fontFamily'),
|
|
17489
|
+
fontWeight: getWithFallback(contentFontStyle.bold, 'bold', 'normal') || getListboxStyle('content', 'fontWeight') || 'normal',
|
|
17490
|
+
textDecoration: contentFontStyle.underline ? 'underline' : 'initial',
|
|
17491
|
+
fontStyle: getWithFallback(contentFontStyle.italic, 'italic', 'normal') || getListboxStyle('content', 'fontStyle') || 'initial'
|
|
17246
17492
|
},
|
|
17247
17493
|
search: {
|
|
17248
|
-
color:
|
|
17494
|
+
color: searchColor,
|
|
17495
|
+
borderColor: theme.palette.divider,
|
|
17496
|
+
highlightBorderColor: theme.palette.primary.main,
|
|
17497
|
+
backgroundColor: searchBgColor
|
|
17249
17498
|
},
|
|
17250
17499
|
selections
|
|
17251
17500
|
};
|
|
@@ -18919,8 +19168,8 @@ const StyledGrid$3 = styled$1(Grid, {
|
|
|
18919
19168
|
isGridMode,
|
|
18920
19169
|
styles
|
|
18921
19170
|
} = _ref;
|
|
18922
|
-
return {
|
|
18923
|
-
background
|
|
19171
|
+
return _objectSpread2(_objectSpread2({}, styles.background), {}, {
|
|
19172
|
+
// sets background color and image of listbox
|
|
18924
19173
|
["& .".concat(classes$4.listBoxHeader)]: {
|
|
18925
19174
|
alignSelf: 'center',
|
|
18926
19175
|
display: 'flex'
|
|
@@ -18943,33 +19192,50 @@ const StyledGrid$3 = styled$1(Grid, {
|
|
|
18943
19192
|
'&:focus-visible': {
|
|
18944
19193
|
outline: 'none'
|
|
18945
19194
|
}
|
|
18946
|
-
};
|
|
19195
|
+
});
|
|
18947
19196
|
});
|
|
18948
|
-
const
|
|
19197
|
+
const StyledGridHeader = styled$1(Grid, {
|
|
19198
|
+
shouldForwardProp: p => !['styles', 'isRtl'].includes(p)
|
|
19199
|
+
})(_ref2 => {
|
|
18949
19200
|
let {
|
|
18950
|
-
styles
|
|
19201
|
+
styles,
|
|
19202
|
+
isRtl
|
|
18951
19203
|
} = _ref2;
|
|
18952
|
-
return {
|
|
18953
|
-
|
|
18954
|
-
|
|
18955
|
-
|
|
18956
|
-
|
|
18957
|
-
}
|
|
19204
|
+
return _objectSpread2(_objectSpread2({
|
|
19205
|
+
flexDirection: isRtl ? 'row-reverse' : 'row',
|
|
19206
|
+
wrap: 'nowrap',
|
|
19207
|
+
minHeight: 32,
|
|
19208
|
+
alignContent: 'center'
|
|
19209
|
+
}, styles.header), {}, {
|
|
19210
|
+
'& *': {
|
|
19211
|
+
// Assign the styles color as defaul color for all elements in the header
|
|
19212
|
+
color: styles.header.color
|
|
19213
|
+
}
|
|
19214
|
+
});
|
|
19215
|
+
});
|
|
19216
|
+
const Title = styled$1(Typography)(_ref3 => {
|
|
19217
|
+
let {
|
|
19218
|
+
styles
|
|
19219
|
+
} = _ref3;
|
|
19220
|
+
return _objectSpread2(_objectSpread2({}, styles.header), {}, {
|
|
19221
|
+
paddingRight: '1px' // make place for italic font style
|
|
19222
|
+
});
|
|
18958
19223
|
});
|
|
18959
|
-
|
|
19224
|
+
|
|
19225
|
+
const isModal = _ref4 => {
|
|
18960
19226
|
var _app$isInModalSelecti, _app$isInModalSelecti2;
|
|
18961
19227
|
let {
|
|
18962
19228
|
app,
|
|
18963
19229
|
appSelections
|
|
18964
|
-
} =
|
|
19230
|
+
} = _ref4;
|
|
18965
19231
|
return (_app$isInModalSelecti = (_app$isInModalSelecti2 = app.isInModalSelection) === null || _app$isInModalSelecti2 === void 0 ? void 0 : _app$isInModalSelecti2.call(app)) !== null && _app$isInModalSelecti !== void 0 ? _app$isInModalSelecti : appSelections.isInModal();
|
|
18966
19232
|
};
|
|
18967
|
-
function ListBoxInline(
|
|
19233
|
+
function ListBoxInline(_ref5) {
|
|
18968
19234
|
var _layout$qListObject, _layout$qListObject2, _layoutOptions$dense;
|
|
18969
19235
|
let {
|
|
18970
19236
|
options,
|
|
18971
19237
|
layout
|
|
18972
|
-
} =
|
|
19238
|
+
} = _ref5;
|
|
18973
19239
|
const {
|
|
18974
19240
|
app,
|
|
18975
19241
|
direction,
|
|
@@ -19018,6 +19284,7 @@ function ListBoxInline(_ref4) {
|
|
|
19018
19284
|
checkboxes = checkboxesOption
|
|
19019
19285
|
} = layout || {};
|
|
19020
19286
|
const styles = getStyles({
|
|
19287
|
+
app,
|
|
19021
19288
|
themeApi,
|
|
19022
19289
|
theme,
|
|
19023
19290
|
components,
|
|
@@ -19163,7 +19430,6 @@ function ListBoxInline(_ref4) {
|
|
|
19163
19430
|
const showSearchToggle = search === 'toggle' && showSearch;
|
|
19164
19431
|
const searchVisible = (search === true || showSearchToggle) && !selectDisabled() && searchEnabled !== false;
|
|
19165
19432
|
const dense = (_layoutOptions$dense = layoutOptions.dense) !== null && _layoutOptions$dense !== void 0 ? _layoutOptions$dense : false;
|
|
19166
|
-
const headerHeight = 32;
|
|
19167
19433
|
const onShowSearch = () => {
|
|
19168
19434
|
const newValue = !showSearch;
|
|
19169
19435
|
setShowSearch(newValue);
|
|
@@ -19257,15 +19523,14 @@ function ListBoxInline(_ref4) {
|
|
|
19257
19523
|
},
|
|
19258
19524
|
isGridMode: isGridMode,
|
|
19259
19525
|
"aria-label": keyboard.active ? translator.get('Listbox.ScreenReaderInstructions') : ''
|
|
19260
|
-
}, showToolbarWithTitle && /*#__PURE__*/React__default.createElement(
|
|
19526
|
+
}, showToolbarWithTitle && /*#__PURE__*/React__default.createElement(StyledGridHeader, {
|
|
19261
19527
|
item: true,
|
|
19262
19528
|
container: true,
|
|
19263
|
-
|
|
19264
|
-
|
|
19529
|
+
styles: styles,
|
|
19530
|
+
isRtl: isRtl,
|
|
19265
19531
|
marginY: 1,
|
|
19266
19532
|
paddingLeft: "".concat(headerPaddingLeft, "px"),
|
|
19267
|
-
paddingRight: "".concat(headerPaddingRight, "px")
|
|
19268
|
-
wrap: "nowrap"
|
|
19533
|
+
paddingRight: "".concat(headerPaddingRight, "px")
|
|
19269
19534
|
}, showIcons && /*#__PURE__*/React__default.createElement(Grid, {
|
|
19270
19535
|
item: true,
|
|
19271
19536
|
container: true,
|
|
@@ -19292,7 +19557,8 @@ function ListBoxInline(_ref4) {
|
|
|
19292
19557
|
title: layout.title,
|
|
19293
19558
|
styles: styles
|
|
19294
19559
|
}, layout.title)), /*#__PURE__*/React__default.createElement(Grid, {
|
|
19295
|
-
item: true
|
|
19560
|
+
item: true,
|
|
19561
|
+
display: "flex"
|
|
19296
19562
|
}, /*#__PURE__*/React__default.createElement(ActionsToolbar, _extends$5({
|
|
19297
19563
|
direction: direction
|
|
19298
19564
|
}, getActionToolbarProps(isToolbarDetached))))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
@@ -19328,11 +19594,11 @@ function ListBoxInline(_ref4) {
|
|
|
19328
19594
|
className: classes$4.listboxWrapper
|
|
19329
19595
|
}, isInvalid ? /*#__PURE__*/React__default.createElement(ListBoxError, {
|
|
19330
19596
|
text: errorText
|
|
19331
|
-
}) : /*#__PURE__*/React__default.createElement(AutoSizer, null,
|
|
19597
|
+
}) : /*#__PURE__*/React__default.createElement(AutoSizer, null, _ref6 => {
|
|
19332
19598
|
let {
|
|
19333
19599
|
height,
|
|
19334
19600
|
width
|
|
19335
|
-
} =
|
|
19601
|
+
} = _ref6;
|
|
19336
19602
|
return /*#__PURE__*/React__default.createElement(ListBox, {
|
|
19337
19603
|
model: model,
|
|
19338
19604
|
app: app,
|
|
@@ -19374,10 +19640,10 @@ function ListBoxInline(_ref4) {
|
|
|
19374
19640
|
})))));
|
|
19375
19641
|
}
|
|
19376
19642
|
const ListBoxInlineMemoed = React__default.memo(ListBoxInline);
|
|
19377
|
-
function IsolateUseLayoutWrapper(
|
|
19643
|
+
function IsolateUseLayoutWrapper(_ref7) {
|
|
19378
19644
|
let {
|
|
19379
19645
|
options = {}
|
|
19380
|
-
} =
|
|
19646
|
+
} = _ref7;
|
|
19381
19647
|
const {
|
|
19382
19648
|
model
|
|
19383
19649
|
} = options;
|
|
@@ -21792,205 +22058,6 @@ function Supernova(_ref) {
|
|
|
21792
22058
|
}));
|
|
21793
22059
|
}
|
|
21794
22060
|
|
|
21795
|
-
const MULTI_REG = /,(?![^(]*\))/;
|
|
21796
|
-
const SINGLE_REG = /\s(?![^(]*\))/;
|
|
21797
|
-
const LENGTH_REG = /^[0-9]+[a-zA-Z%]+?$/;
|
|
21798
|
-
const PREDEFINED_STRINGS = ['none', 'inset', 'initial', 'inherit'];
|
|
21799
|
-
const isLength = v => v === '0' || LENGTH_REG.test(v);
|
|
21800
|
-
const getColor = singleShadowString => {
|
|
21801
|
-
if (!singleShadowString) return undefined;
|
|
21802
|
-
const parts = singleShadowString.split(SINGLE_REG).filter(part => !PREDEFINED_STRINGS.includes(part.toLowerCase()));
|
|
21803
|
-
const last = parts.at(-1);
|
|
21804
|
-
const color = last && !isLength(last) && !PREDEFINED_STRINGS.includes(last.toLowerCase()) ? last : undefined;
|
|
21805
|
-
return color;
|
|
21806
|
-
};
|
|
21807
|
-
const getShadows = shadowString => {
|
|
21808
|
-
if (!shadowString) return [];
|
|
21809
|
-
return shadowString.split(MULTI_REG).map(s => s.trim());
|
|
21810
|
-
};
|
|
21811
|
-
|
|
21812
|
-
/**
|
|
21813
|
-
* Combine box shadow with box shadow color.
|
|
21814
|
-
* @param {string} boxShadow - Box shadow which may include color
|
|
21815
|
-
* @param {string} themeBoxShadow - Box shadow from theme which may include color
|
|
21816
|
-
* @param {string | undefined} boxShadowColor - Box shadow color
|
|
21817
|
-
* @returns {string} Returns the combined box shadow and box shadow color
|
|
21818
|
-
*
|
|
21819
|
-
* If boxShadow is a single shadow and has a color then this color will be replaced by boxShadowColor and then
|
|
21820
|
-
* returned as the result,otherwise boxShadowColor will be added to boxShadow and then returned as the result.
|
|
21821
|
-
* If boxShadow is multiple shadows or an empty string then it will be returned as the result.
|
|
21822
|
-
*
|
|
21823
|
-
* @example getFullBoxShadow('none', '', 'red') returns 'none'
|
|
21824
|
-
*
|
|
21825
|
-
* @example getFullBoxShadow('initial', '', 'red') returns 'initial'
|
|
21826
|
-
*
|
|
21827
|
-
* @example getFullBoxShadow('inherit', '', 'red') returns 'inherit'
|
|
21828
|
-
*
|
|
21829
|
-
* @example getFullBoxShadow('', '', 'red') returns ''
|
|
21830
|
-
*
|
|
21831
|
-
* @example getFullBoxShadow('1px 2px blue, 3px 6px green', '', 'red') returns '1px 2px blue, 3px 6px green'
|
|
21832
|
-
*
|
|
21833
|
-
* @example getFullBoxShadow('1px 2px blue', '', 'red') returns '1px 2px red'
|
|
21834
|
-
*
|
|
21835
|
-
* @example getFullBoxShadow('1px 2px', '', 'red') returns '1px 2px red'
|
|
21836
|
-
*
|
|
21837
|
-
* @example getFullBoxShadow('1px 2px', '2px 5px green', undefined) returns '1px 2px green'
|
|
21838
|
-
*
|
|
21839
|
-
* @example getFullBoxShadow('1px 2px', '2px 5px', undefined) returns '1px 2px'
|
|
21840
|
-
*/
|
|
21841
|
-
const getFullBoxShadow = (boxShadow, themeBoxShadow, boxShadowColor) => {
|
|
21842
|
-
if (boxShadow && PREDEFINED_STRINGS.includes(boxShadow.toLowerCase())) return boxShadow.toLowerCase();
|
|
21843
|
-
const shadowArray = getShadows(boxShadow);
|
|
21844
|
-
if (shadowArray.length !== 1) return boxShadow;
|
|
21845
|
-
let shadowColor = boxShadowColor;
|
|
21846
|
-
if (!shadowColor) {
|
|
21847
|
-
const themeShadowArray = getShadows(themeBoxShadow);
|
|
21848
|
-
if (themeShadowArray.length !== 1) return boxShadow;
|
|
21849
|
-
shadowColor = getColor(themeShadowArray[0]);
|
|
21850
|
-
}
|
|
21851
|
-
if (!shadowColor) return boxShadow;
|
|
21852
|
-
const color = getColor(shadowArray[0]);
|
|
21853
|
-
if (color) return boxShadow.replace(color, shadowColor);
|
|
21854
|
-
return "".concat(boxShadow, " ").concat(shadowColor);
|
|
21855
|
-
};
|
|
21856
|
-
|
|
21857
|
-
function resolveProperty(path, attribute, theme, objectType) {
|
|
21858
|
-
if (theme && objectType) {
|
|
21859
|
-
return theme.getStyle("object.".concat(objectType), path, attribute);
|
|
21860
|
-
}
|
|
21861
|
-
if (theme) {
|
|
21862
|
-
return theme.getStyle('', path, attribute);
|
|
21863
|
-
}
|
|
21864
|
-
return undefined;
|
|
21865
|
-
}
|
|
21866
|
-
|
|
21867
|
-
function resolveColor(colorObj, path, attribute, theme, objectType) {
|
|
21868
|
-
if (colorObj && theme) {
|
|
21869
|
-
return colorObj.color !== 'none' ? theme.getColorPickerColor(colorObj, true) : undefined;
|
|
21870
|
-
}
|
|
21871
|
-
return resolveProperty(path, attribute, theme, objectType);
|
|
21872
|
-
}
|
|
21873
|
-
|
|
21874
|
-
const imageSizingToCssProperty = {
|
|
21875
|
-
originalSize: 'auto auto',
|
|
21876
|
-
alwaysFit: 'contain',
|
|
21877
|
-
fitWidth: '100% auto',
|
|
21878
|
-
fitHeight: 'auto 100%',
|
|
21879
|
-
stretchFit: '100% 100%',
|
|
21880
|
-
alwaysFill: 'cover'
|
|
21881
|
-
};
|
|
21882
|
-
const positionToCss = {
|
|
21883
|
-
'top-left': 'top left',
|
|
21884
|
-
'top-center': 'top center',
|
|
21885
|
-
'top-right': 'top right',
|
|
21886
|
-
'center-left': 'center left',
|
|
21887
|
-
'center-center': 'center center',
|
|
21888
|
-
'center-right': 'center right',
|
|
21889
|
-
'bottom-left': 'bottom left',
|
|
21890
|
-
'bottom-center': 'bottom center',
|
|
21891
|
-
'bottom-right': 'bottom right'
|
|
21892
|
-
};
|
|
21893
|
-
|
|
21894
|
-
// TODO: this needs some proper verification
|
|
21895
|
-
function getSenseServerUrl(app) {
|
|
21896
|
-
var _app$session;
|
|
21897
|
-
let config;
|
|
21898
|
-
let wsUrl;
|
|
21899
|
-
let protocol;
|
|
21900
|
-
let isSecure;
|
|
21901
|
-
if (app !== null && app !== void 0 && (_app$session = app.session) !== null && _app$session !== void 0 && _app$session.config) {
|
|
21902
|
-
config = app.session.config;
|
|
21903
|
-
wsUrl = new URL(config.url);
|
|
21904
|
-
isSecure = wsUrl.protocol === 'wss:';
|
|
21905
|
-
protocol = isSecure ? 'https://' : 'http://';
|
|
21906
|
-
return protocol + wsUrl.host;
|
|
21907
|
-
}
|
|
21908
|
-
return '';
|
|
21909
|
-
}
|
|
21910
|
-
function getBackgroundPosition(bgComp) {
|
|
21911
|
-
var _bgComp$bgImage;
|
|
21912
|
-
let bkgImagePosition = 'center center';
|
|
21913
|
-
if (bgComp !== null && bgComp !== void 0 && (_bgComp$bgImage = bgComp.bgImage) !== null && _bgComp$bgImage !== void 0 && _bgComp$bgImage.position) {
|
|
21914
|
-
bkgImagePosition = positionToCss[bgComp.bgImage.position];
|
|
21915
|
-
}
|
|
21916
|
-
return bkgImagePosition;
|
|
21917
|
-
}
|
|
21918
|
-
function getBackgroundSize(bgComp) {
|
|
21919
|
-
var _bgComp$bgImage2;
|
|
21920
|
-
let bkgImageSize = imageSizingToCssProperty.originalSize;
|
|
21921
|
-
if (bgComp !== null && bgComp !== void 0 && (_bgComp$bgImage2 = bgComp.bgImage) !== null && _bgComp$bgImage2 !== void 0 && _bgComp$bgImage2.sizing) {
|
|
21922
|
-
bkgImageSize = imageSizingToCssProperty[bgComp.bgImage.sizing];
|
|
21923
|
-
}
|
|
21924
|
-
return bkgImageSize;
|
|
21925
|
-
}
|
|
21926
|
-
function resolveImageUrl(app, relativeUrl) {
|
|
21927
|
-
return relativeUrl ? getSenseServerUrl(app) + relativeUrl : undefined;
|
|
21928
|
-
}
|
|
21929
|
-
function resolveBgImage(bgComp, app) {
|
|
21930
|
-
const bgImageDef = bgComp === null || bgComp === void 0 ? void 0 : bgComp.bgImage;
|
|
21931
|
-
if (bgImageDef) {
|
|
21932
|
-
let url = '';
|
|
21933
|
-
if (bgImageDef.mode === 'media' || bgComp.useImage === 'media') {
|
|
21934
|
-
var _bgImageDef$mediaUrl;
|
|
21935
|
-
url = bgImageDef !== null && bgImageDef !== void 0 && (_bgImageDef$mediaUrl = bgImageDef.mediaUrl) !== null && _bgImageDef$mediaUrl !== void 0 && (_bgImageDef$mediaUrl = _bgImageDef$mediaUrl.qStaticContentUrl) !== null && _bgImageDef$mediaUrl !== void 0 && _bgImageDef$mediaUrl.qUrl ? decodeURIComponent(bgImageDef.mediaUrl.qStaticContentUrl.qUrl) : undefined;
|
|
21936
|
-
url = resolveImageUrl(app, url);
|
|
21937
|
-
}
|
|
21938
|
-
if (bgImageDef.mode === 'expression') {
|
|
21939
|
-
url = bgImageDef.expressionUrl ? decodeURIComponent(bgImageDef.expressionUrl) : undefined;
|
|
21940
|
-
}
|
|
21941
|
-
const pos = getBackgroundPosition(bgComp);
|
|
21942
|
-
const size = getBackgroundSize(bgComp);
|
|
21943
|
-
return url ? {
|
|
21944
|
-
url,
|
|
21945
|
-
pos,
|
|
21946
|
-
size
|
|
21947
|
-
} : undefined;
|
|
21948
|
-
}
|
|
21949
|
-
return undefined;
|
|
21950
|
-
}
|
|
21951
|
-
function resolveBgColor(comp, theme, objectType) {
|
|
21952
|
-
const bgColor = comp === null || comp === void 0 ? void 0 : comp.bgColor;
|
|
21953
|
-
if (bgColor && theme) {
|
|
21954
|
-
if (bgColor.useExpression) {
|
|
21955
|
-
return theme.validateColor(bgColor.colorExpression);
|
|
21956
|
-
}
|
|
21957
|
-
}
|
|
21958
|
-
return resolveColor(bgColor === null || bgColor === void 0 ? void 0 : bgColor.color, '', 'backgroundColor', theme, objectType);
|
|
21959
|
-
}
|
|
21960
|
-
function resolveBorder(comp, theme, objectType) {
|
|
21961
|
-
const borderColor = resolveColor(comp === null || comp === void 0 ? void 0 : comp.borderColor, '', 'borderColor', theme, objectType);
|
|
21962
|
-
const borderWidth = (comp === null || comp === void 0 ? void 0 : comp.borderWidth) || resolveProperty('', 'borderWidth', theme, objectType);
|
|
21963
|
-
return borderWidth && borderColor ? "".concat(borderWidth, " solid ").concat(borderColor) : undefined;
|
|
21964
|
-
}
|
|
21965
|
-
function resolveBorderRadius(comp, theme, objectType) {
|
|
21966
|
-
return (comp === null || comp === void 0 ? void 0 : comp.borderRadius) || resolveProperty('', 'borderRadius', theme, objectType);
|
|
21967
|
-
}
|
|
21968
|
-
function resolveBoxShadow(comp, theme, objectType) {
|
|
21969
|
-
var _comp$shadow, _comp$shadow2;
|
|
21970
|
-
const themeBoxShadow = resolveProperty('shadow', 'boxShadow', theme, objectType);
|
|
21971
|
-
const boxShadow = (comp === null || comp === void 0 || (_comp$shadow = comp.shadow) === null || _comp$shadow === void 0 ? void 0 : _comp$shadow.boxShadow) || themeBoxShadow;
|
|
21972
|
-
const boxShadowColor = resolveColor(comp === null || comp === void 0 || (_comp$shadow2 = comp.shadow) === null || _comp$shadow2 === void 0 ? void 0 : _comp$shadow2.boxShadowColor, 'shadow', 'boxShadowColor', theme, objectType);
|
|
21973
|
-
return getFullBoxShadow(boxShadow, themeBoxShadow, boxShadowColor);
|
|
21974
|
-
}
|
|
21975
|
-
function unfurlFontStyle(fontStyle, target) {
|
|
21976
|
-
if (fontStyle && Array.isArray(fontStyle)) {
|
|
21977
|
-
return fontStyle;
|
|
21978
|
-
}
|
|
21979
|
-
return target === 'main' ? ['bold'] : [];
|
|
21980
|
-
}
|
|
21981
|
-
function resolveTextStyle(textComp, target, theme, objectType) {
|
|
21982
|
-
var _textComp$title;
|
|
21983
|
-
const textProps = (textComp === null || textComp === void 0 || (_textComp$title = textComp.title) === null || _textComp$title === void 0 ? void 0 : _textComp$title[target]) || {};
|
|
21984
|
-
const fontStyle = unfurlFontStyle(textProps.fontStyle, target);
|
|
21985
|
-
return {
|
|
21986
|
-
fontFamily: textProps.fontFamily || theme.getStyle("object.".concat(objectType), "title.".concat(target), 'fontFamily'),
|
|
21987
|
-
color: textProps.color && textProps.color.color !== 'none' ? theme.getColorPickerColor(textProps.color, true) : theme.getStyle("object.".concat(objectType), target, 'color'),
|
|
21988
|
-
fontWeight: fontStyle.includes('bold') ? 'bold' : 'normal',
|
|
21989
|
-
fontStyle: fontStyle.includes('italic') ? 'italic' : 'normal',
|
|
21990
|
-
textDecoration: fontStyle.includes('underline') ? 'underline' : 'initial'
|
|
21991
|
-
};
|
|
21992
|
-
}
|
|
21993
|
-
|
|
21994
22061
|
const useStyling = (layout, theme, app, themeName) => {
|
|
21995
22062
|
const styling = useMemo$1(() => {
|
|
21996
22063
|
if (layout && theme) {
|
|
@@ -25501,6 +25568,17 @@ function getCellRenderer(cell, halo, initialSnOptions, initialSnPlugins, initial
|
|
|
25501
25568
|
onMount: onMount
|
|
25502
25569
|
}));
|
|
25503
25570
|
}
|
|
25571
|
+
function getBounds(pos, columns, rows) {
|
|
25572
|
+
if (pos.bounds) {
|
|
25573
|
+
return pos.bounds;
|
|
25574
|
+
}
|
|
25575
|
+
return {
|
|
25576
|
+
y: pos.row / rows * 100,
|
|
25577
|
+
x: pos.col / columns * 100,
|
|
25578
|
+
width: pos.colspan / columns * 100,
|
|
25579
|
+
height: pos.rowspan / rows * 100
|
|
25580
|
+
};
|
|
25581
|
+
}
|
|
25504
25582
|
function Sheet(_ref) {
|
|
25505
25583
|
let {
|
|
25506
25584
|
model,
|
|
@@ -25541,6 +25619,10 @@ function Sheet(_ref) {
|
|
|
25541
25619
|
root.removeCell(c.currentId);
|
|
25542
25620
|
});
|
|
25543
25621
|
const lCells = layout.cells;
|
|
25622
|
+
const {
|
|
25623
|
+
columns,
|
|
25624
|
+
rows
|
|
25625
|
+
} = layout;
|
|
25544
25626
|
// TODO - should try reuse existing objects on subsequent renders
|
|
25545
25627
|
// Non-id updates should only change the "css"
|
|
25546
25628
|
const cs = await Promise.all(lCells.map(async c => {
|
|
@@ -25550,7 +25632,7 @@ function Sheet(_ref) {
|
|
|
25550
25632
|
});
|
|
25551
25633
|
const cell = cells.find(ce => ce.id === c.name);
|
|
25552
25634
|
if (cell) {
|
|
25553
|
-
cell.bounds = c
|
|
25635
|
+
cell.bounds = getBounds(c, columns, rows);
|
|
25554
25636
|
delete cell.mountedPromise;
|
|
25555
25637
|
return cell;
|
|
25556
25638
|
}
|
|
@@ -25560,7 +25642,7 @@ function Sheet(_ref) {
|
|
|
25560
25642
|
return {
|
|
25561
25643
|
model: vs.model,
|
|
25562
25644
|
id: c.name,
|
|
25563
|
-
bounds: c
|
|
25645
|
+
bounds: getBounds(c, columns, rows),
|
|
25564
25646
|
cellRef: React__default.createRef(),
|
|
25565
25647
|
currentId: uid(),
|
|
25566
25648
|
mounted,
|