@redsift/table 12.5.9-muiv7 → 12.5.10-muiv6

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.
@@ -1,12 +1,12 @@
1
1
  import { a as _objectWithoutProperties, b as _extends } from './_rollupPluginBabelHelpers.js';
2
- import * as React from 'react';
2
+ import * as React$1 from 'react';
3
3
  import React__default, { forwardRef } from 'react';
4
4
  import { ButtonsColorPalette, IconButton, Button, Checkbox, Icon } from '@redsift/design-system';
5
5
  import { mdiFilterVariant, mdiViewColumn, mdiArrowUp, mdiArrowDown, mdiViewHeadline, mdiViewSequential, mdiViewStream, mdiChevronDown, mdiChevronRight, mdiTrayArrowDown } from '@redsift/icons';
6
- import { e as generateUtilityClass, g as generateUtilityClasses, o as ownerDocument, k as Portal, l as chainPropTypes, P as PropTypes, H as HTMLElementType, j as refType, m as useForkRef, n as useEnhancedEffect, p as useSlotProps, h as composeClasses, f as styled, q as useRtl, u as useDefaultProps } from './Portal.js';
6
+ import { m as require$$1, d as generateUtilityClass, g as generateUtilityClasses, i as _objectWithoutPropertiesLoose, o as ownerDocument, n as Portal, h as _extends$1, p as chainPropTypes, P as PropTypes, H as HTMLElementType, l as refType, q as useForkRef, t as useEnhancedEffect, v as useSlotProps, k as composeClasses, f as styled, u as useDefaultProps } from './Portal.js';
7
7
  import { j as jsxRuntimeExports } from './jsx-runtime.js';
8
8
 
9
- const _excluded$2 = ["children", "color", "onClick", "startIcon"];
9
+ const _excluded$4 = ["children", "color", "onClick", "startIcon"];
10
10
  const BaseButton = /*#__PURE__*/forwardRef((props, ref) => {
11
11
  var _props$className;
12
12
  const {
@@ -15,7 +15,7 @@ const BaseButton = /*#__PURE__*/forwardRef((props, ref) => {
15
15
  onClick,
16
16
  startIcon
17
17
  } = props,
18
- forwardedProps = _objectWithoutProperties(props, _excluded$2);
18
+ forwardedProps = _objectWithoutProperties(props, _excluded$4);
19
19
  const color = Object.keys(ButtonsColorPalette).includes(propsColor) ? propsColor : 'primary';
20
20
  if ((_props$className = props.className) !== null && _props$className !== void 0 && _props$className.includes('redsift-condensed')) {
21
21
  return /*#__PURE__*/React__default.createElement(IconButton, _extends({}, forwardedProps, {
@@ -41,7 +41,7 @@ const BaseButton = /*#__PURE__*/forwardRef((props, ref) => {
41
41
  }), children);
42
42
  });
43
43
 
44
- const _excluded$1 = ["checked", "indeterminate", "disabled", "onChange", "touchRippleRef"];
44
+ const _excluded$3 = ["checked", "indeterminate", "disabled", "onChange", "touchRippleRef"];
45
45
  const BaseCheckbox = /*#__PURE__*/forwardRef((props, ref) => {
46
46
  const {
47
47
  checked,
@@ -50,35 +50,35 @@ const BaseCheckbox = /*#__PURE__*/forwardRef((props, ref) => {
50
50
  onChange,
51
51
  touchRippleRef: _touchRippleRef
52
52
  } = props,
53
- forwardedProps = _objectWithoutProperties(props, _excluded$1);
53
+ forwardedProps = _objectWithoutProperties(props, _excluded$3);
54
54
  return /*#__PURE__*/React__default.createElement(Checkbox, _extends({}, forwardedProps, forwardedProps.inputProps, {
55
55
  isSelected: checked && !indeterminate,
56
56
  isDisabled: disabled,
57
57
  isIndeterminate: indeterminate,
58
58
  ref: ref,
59
- onChange: (isChecked, value, name, event) => onChange === null || onChange === void 0 ? void 0 : onChange(event)
59
+ onChange: (isChecked, value, name, event) => onChange(event)
60
60
  }));
61
61
  });
62
62
 
63
- const _excluded = ["displayName"];
63
+ const _excluded$2 = ["displayName"];
64
64
  const muiIconToDSIcon = {
65
- columnFilteredIcon: mdiFilterVariant,
66
- columnSelectorIcon: mdiViewColumn,
67
- columnSortedAscendingIcon: mdiArrowUp,
68
- columnSortedDescendingIcon: mdiArrowDown,
69
- densityCompactIcon: mdiViewHeadline,
70
- densityStandardIcon: mdiViewSequential,
71
- densityComfortableIcon: mdiViewStream,
72
- detailPanelCollapseIcon: mdiChevronDown,
73
- detailPanelExpandIcon: mdiChevronRight,
74
- exportIcon: mdiTrayArrowDown,
75
- openFilterButtonIcon: mdiFilterVariant
65
+ ColumnFilteredIcon: mdiFilterVariant,
66
+ ColumnSelectorIcon: mdiViewColumn,
67
+ ColumnSortedAscendingIcon: mdiArrowUp,
68
+ ColumnSortedDescendingIcon: mdiArrowDown,
69
+ DensityCompactIcon: mdiViewHeadline,
70
+ DensityStandardIcon: mdiViewSequential,
71
+ DensityComfortableIcon: mdiViewStream,
72
+ DetailPanelCollapseIcon: mdiChevronDown,
73
+ DetailPanelExpandIcon: mdiChevronRight,
74
+ ExportIcon: mdiTrayArrowDown,
75
+ OpenFilterButtonIcon: mdiFilterVariant
76
76
  };
77
77
  const BaseIcon = /*#__PURE__*/forwardRef((props, ref) => {
78
78
  const {
79
79
  displayName
80
80
  } = props,
81
- forwardedProps = _objectWithoutProperties(props, _excluded);
81
+ forwardedProps = _objectWithoutProperties(props, _excluded$2);
82
82
  return /*#__PURE__*/React__default.createElement(Icon, _extends({}, forwardedProps, forwardedProps.inputProps, {
83
83
  ref: ref,
84
84
  size: forwardedProps.fontSize,
@@ -86,6 +86,25 @@ const BaseIcon = /*#__PURE__*/forwardRef((props, ref) => {
86
86
  }));
87
87
  });
88
88
 
89
+ var useThemeWithoutDefault = {};
90
+
91
+ Object.defineProperty(useThemeWithoutDefault, "__esModule", {
92
+ value: true
93
+ });
94
+ var default_1 = useThemeWithoutDefault.default = void 0;
95
+ var React = _interopRequireWildcard(React__default);
96
+ var _styledEngine = require$$1;
97
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
98
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
99
+ function isObjectEmpty(obj) {
100
+ return Object.keys(obj).length === 0;
101
+ }
102
+ function useTheme(defaultTheme = null) {
103
+ const contextTheme = React.useContext(_styledEngine.ThemeContext);
104
+ return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme : contextTheme;
105
+ }
106
+ default_1 = useThemeWithoutDefault.default = useTheme;
107
+
89
108
  var top = 'top';
90
109
  var bottom = 'bottom';
91
110
  var right = 'right';
@@ -1882,6 +1901,8 @@ function getPopperUtilityClass(slot) {
1882
1901
  }
1883
1902
  generateUtilityClasses('MuiPopper', ['root']);
1884
1903
 
1904
+ const _excluded$1 = ["anchorEl", "children", "direction", "disablePortal", "modifiers", "open", "placement", "popperOptions", "popperRef", "slotProps", "slots", "TransitionProps", "ownerState"],
1905
+ _excluded2 = ["anchorEl", "children", "container", "direction", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "style", "transition", "slotProps", "slots"];
1885
1906
  function flipPlacement(placement, direction) {
1886
1907
  if (direction === 'ltr') {
1887
1908
  return placement;
@@ -1918,47 +1939,47 @@ const useUtilityClasses = ownerState => {
1918
1939
  return composeClasses(slots, getPopperUtilityClass, classes);
1919
1940
  };
1920
1941
  const defaultPopperOptions = {};
1921
- const PopperTooltip = /*#__PURE__*/React.forwardRef(function PopperTooltip(props, forwardedRef) {
1942
+ const PopperTooltip = /*#__PURE__*/React$1.forwardRef(function PopperTooltip(props, forwardedRef) {
1943
+ var _slots$root;
1922
1944
  const {
1923
- anchorEl,
1924
- children,
1925
- direction,
1926
- disablePortal,
1927
- modifiers,
1928
- open,
1929
- placement: initialPlacement,
1930
- popperOptions,
1931
- popperRef: popperRefProp,
1932
- slotProps = {},
1933
- slots = {},
1934
- TransitionProps,
1935
- // @ts-ignore internal logic
1936
- ownerState: ownerStateProp,
1937
- // prevent from spreading to DOM, it can come from the parent component e.g. Select.
1938
- ...other
1939
- } = props;
1940
- const tooltipRef = React.useRef(null);
1945
+ anchorEl,
1946
+ children,
1947
+ direction,
1948
+ disablePortal,
1949
+ modifiers,
1950
+ open,
1951
+ placement: initialPlacement,
1952
+ popperOptions,
1953
+ popperRef: popperRefProp,
1954
+ slotProps = {},
1955
+ slots = {},
1956
+ TransitionProps
1957
+ // @ts-ignore internal logic
1958
+ // prevent from spreading to DOM, it can come from the parent component e.g. Select.
1959
+ } = props,
1960
+ other = _objectWithoutPropertiesLoose(props, _excluded$1);
1961
+ const tooltipRef = React$1.useRef(null);
1941
1962
  const ownRef = useForkRef(tooltipRef, forwardedRef);
1942
- const popperRef = React.useRef(null);
1963
+ const popperRef = React$1.useRef(null);
1943
1964
  const handlePopperRef = useForkRef(popperRef, popperRefProp);
1944
- const handlePopperRefRef = React.useRef(handlePopperRef);
1965
+ const handlePopperRefRef = React$1.useRef(handlePopperRef);
1945
1966
  useEnhancedEffect(() => {
1946
1967
  handlePopperRefRef.current = handlePopperRef;
1947
1968
  }, [handlePopperRef]);
1948
- React.useImperativeHandle(popperRefProp, () => popperRef.current, []);
1969
+ React$1.useImperativeHandle(popperRefProp, () => popperRef.current, []);
1949
1970
  const rtlPlacement = flipPlacement(initialPlacement, direction);
1950
1971
  /**
1951
1972
  * placement initialized from prop but can change during lifetime if modifiers.flip.
1952
1973
  * modifiers.flip is essentially a flip for controlled/uncontrolled behavior
1953
1974
  */
1954
- const [placement, setPlacement] = React.useState(rtlPlacement);
1955
- const [resolvedAnchorElement, setResolvedAnchorElement] = React.useState(resolveAnchorEl(anchorEl));
1956
- React.useEffect(() => {
1975
+ const [placement, setPlacement] = React$1.useState(rtlPlacement);
1976
+ const [resolvedAnchorElement, setResolvedAnchorElement] = React$1.useState(resolveAnchorEl(anchorEl));
1977
+ React$1.useEffect(() => {
1957
1978
  if (popperRef.current) {
1958
1979
  popperRef.current.forceUpdate();
1959
1980
  }
1960
1981
  });
1961
- React.useEffect(() => {
1982
+ React$1.useEffect(() => {
1962
1983
  if (anchorEl) {
1963
1984
  setResolvedAnchorElement(resolveAnchorEl(anchorEl));
1964
1985
  }
@@ -2004,11 +2025,11 @@ const PopperTooltip = /*#__PURE__*/React.forwardRef(function PopperTooltip(props
2004
2025
  if (popperOptions && popperOptions.modifiers != null) {
2005
2026
  popperModifiers = popperModifiers.concat(popperOptions.modifiers);
2006
2027
  }
2007
- const popper = createPopper(resolvedAnchorElement, tooltipRef.current, {
2008
- placement: rtlPlacement,
2009
- ...popperOptions,
2028
+ const popper = createPopper(resolvedAnchorElement, tooltipRef.current, _extends$1({
2029
+ placement: rtlPlacement
2030
+ }, popperOptions, {
2010
2031
  modifiers: popperModifiers
2011
- });
2032
+ }));
2012
2033
  handlePopperRefRef.current(popper);
2013
2034
  return () => {
2014
2035
  popper.destroy();
@@ -2022,7 +2043,7 @@ const PopperTooltip = /*#__PURE__*/React.forwardRef(function PopperTooltip(props
2022
2043
  childProps.TransitionProps = TransitionProps;
2023
2044
  }
2024
2045
  const classes = useUtilityClasses(props);
2025
- const Root = slots.root ?? 'div';
2046
+ const Root = (_slots$root = slots.root) != null ? _slots$root : 'div';
2026
2047
  const rootProps = useSlotProps({
2027
2048
  elementType: Root,
2028
2049
  externalSlotProps: slotProps.root,
@@ -2034,35 +2055,34 @@ const PopperTooltip = /*#__PURE__*/React.forwardRef(function PopperTooltip(props
2034
2055
  ownerState: props,
2035
2056
  className: classes.root
2036
2057
  });
2037
- return /*#__PURE__*/jsxRuntimeExports.jsx(Root, {
2038
- ...rootProps,
2058
+ return /*#__PURE__*/jsxRuntimeExports.jsx(Root, _extends$1({}, rootProps, {
2039
2059
  children: typeof children === 'function' ? children(childProps) : children
2040
- });
2060
+ }));
2041
2061
  });
2042
2062
 
2043
2063
  /**
2044
2064
  * @ignore - internal component.
2045
2065
  */
2046
- const Popper$2 = /*#__PURE__*/React.forwardRef(function Popper(props, forwardedRef) {
2066
+ const Popper$2 = /*#__PURE__*/React$1.forwardRef(function Popper(props, forwardedRef) {
2047
2067
  const {
2048
- anchorEl,
2049
- children,
2050
- container: containerProp,
2051
- direction = 'ltr',
2052
- disablePortal = false,
2053
- keepMounted = false,
2054
- modifiers,
2055
- open,
2056
- placement = 'bottom',
2057
- popperOptions = defaultPopperOptions,
2058
- popperRef,
2059
- style,
2060
- transition = false,
2061
- slotProps = {},
2062
- slots = {},
2063
- ...other
2064
- } = props;
2065
- const [exited, setExited] = React.useState(true);
2068
+ anchorEl,
2069
+ children,
2070
+ container: containerProp,
2071
+ direction = 'ltr',
2072
+ disablePortal = false,
2073
+ keepMounted = false,
2074
+ modifiers,
2075
+ open,
2076
+ placement = 'bottom',
2077
+ popperOptions = defaultPopperOptions,
2078
+ popperRef,
2079
+ style,
2080
+ transition = false,
2081
+ slotProps = {},
2082
+ slots = {}
2083
+ } = props,
2084
+ other = _objectWithoutPropertiesLoose(props, _excluded2);
2085
+ const [exited, setExited] = React$1.useState(true);
2066
2086
  const handleEnter = () => {
2067
2087
  setExited(false);
2068
2088
  };
@@ -2092,7 +2112,7 @@ const Popper$2 = /*#__PURE__*/React.forwardRef(function Popper(props, forwardedR
2092
2112
  return /*#__PURE__*/jsxRuntimeExports.jsx(Portal, {
2093
2113
  disablePortal: disablePortal,
2094
2114
  container: container,
2095
- children: /*#__PURE__*/jsxRuntimeExports.jsx(PopperTooltip, {
2115
+ children: /*#__PURE__*/jsxRuntimeExports.jsx(PopperTooltip, _extends$1({
2096
2116
  anchorEl: anchorEl,
2097
2117
  direction: direction,
2098
2118
  disablePortal: disablePortal,
@@ -2103,20 +2123,19 @@ const Popper$2 = /*#__PURE__*/React.forwardRef(function Popper(props, forwardedR
2103
2123
  popperOptions: popperOptions,
2104
2124
  popperRef: popperRef,
2105
2125
  slotProps: slotProps,
2106
- slots: slots,
2107
- ...other,
2108
- style: {
2126
+ slots: slots
2127
+ }, other, {
2128
+ style: _extends$1({
2109
2129
  // Prevents scroll issue, waiting for Popper.js to add this style once initiated.
2110
2130
  position: 'fixed',
2111
2131
  // Fix Popper.js display issue
2112
2132
  top: 0,
2113
2133
  left: 0,
2114
- display,
2115
- ...style
2116
- },
2134
+ display
2135
+ }, style),
2117
2136
  TransitionProps: transitionProps,
2118
2137
  children: children
2119
- })
2138
+ }))
2120
2139
  });
2121
2140
  });
2122
2141
  process.env.NODE_ENV !== "production" ? Popper$2.propTypes /* remove-proptypes */ = {
@@ -2242,6 +2261,7 @@ process.env.NODE_ENV !== "production" ? Popper$2.propTypes /* remove-proptypes *
2242
2261
  } : void 0;
2243
2262
  var BasePopper$1 = Popper$2;
2244
2263
 
2264
+ const _excluded = ["anchorEl", "component", "components", "componentsProps", "container", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "transition", "slots", "slotProps"];
2245
2265
  const PopperRoot = styled(BasePopper$1, {
2246
2266
  name: 'MuiPopper',
2247
2267
  slot: 'Root',
@@ -2252,40 +2272,41 @@ const PopperRoot = styled(BasePopper$1, {
2252
2272
  *
2253
2273
  * Demos:
2254
2274
  *
2255
- * - [Autocomplete](https://v6.mui.com/material-ui/react-autocomplete/)
2256
- * - [Menu](https://v6.mui.com/material-ui/react-menu/)
2257
- * - [Popper](https://v6.mui.com/material-ui/react-popper/)
2275
+ * - [Autocomplete](https://mui.com/material-ui/react-autocomplete/)
2276
+ * - [Menu](https://mui.com/material-ui/react-menu/)
2277
+ * - [Popper](https://mui.com/material-ui/react-popper/)
2258
2278
  *
2259
2279
  * API:
2260
2280
  *
2261
- * - [Popper API](https://v6.mui.com/material-ui/api/popper/)
2281
+ * - [Popper API](https://mui.com/material-ui/api/popper/)
2262
2282
  */
2263
- const Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
2264
- const isRtl = useRtl();
2283
+ const Popper = /*#__PURE__*/React$1.forwardRef(function Popper(inProps, ref) {
2284
+ var _slots$root;
2285
+ const theme = default_1();
2265
2286
  const props = useDefaultProps({
2266
2287
  props: inProps,
2267
2288
  name: 'MuiPopper'
2268
2289
  });
2269
2290
  const {
2270
- anchorEl,
2271
- component,
2272
- components,
2273
- componentsProps,
2274
- container,
2275
- disablePortal,
2276
- keepMounted,
2277
- modifiers,
2278
- open,
2279
- placement,
2280
- popperOptions,
2281
- popperRef,
2282
- transition,
2283
- slots,
2284
- slotProps,
2285
- ...other
2286
- } = props;
2287
- const RootComponent = slots?.root ?? components?.Root;
2288
- const otherProps = {
2291
+ anchorEl,
2292
+ component,
2293
+ components,
2294
+ componentsProps,
2295
+ container,
2296
+ disablePortal,
2297
+ keepMounted,
2298
+ modifiers,
2299
+ open,
2300
+ placement,
2301
+ popperOptions,
2302
+ popperRef,
2303
+ transition,
2304
+ slots,
2305
+ slotProps
2306
+ } = props,
2307
+ other = _objectWithoutPropertiesLoose(props, _excluded);
2308
+ const RootComponent = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : components == null ? void 0 : components.Root;
2309
+ const otherProps = _extends$1({
2289
2310
  anchorEl,
2290
2311
  container,
2291
2312
  disablePortal,
@@ -2295,19 +2316,18 @@ const Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
2295
2316
  placement,
2296
2317
  popperOptions,
2297
2318
  popperRef,
2298
- transition,
2299
- ...other
2300
- };
2301
- return /*#__PURE__*/jsxRuntimeExports.jsx(PopperRoot, {
2319
+ transition
2320
+ }, other);
2321
+ return /*#__PURE__*/jsxRuntimeExports.jsx(PopperRoot, _extends$1({
2302
2322
  as: component,
2303
- direction: isRtl ? 'rtl' : 'ltr',
2323
+ direction: theme == null ? void 0 : theme.direction,
2304
2324
  slots: {
2305
2325
  root: RootComponent
2306
2326
  },
2307
- slotProps: slotProps ?? componentsProps,
2308
- ...otherProps,
2327
+ slotProps: slotProps != null ? slotProps : componentsProps
2328
+ }, otherProps, {
2309
2329
  ref: ref
2310
- });
2330
+ }));
2311
2331
  });
2312
2332
  process.env.NODE_ENV !== "production" ? Popper.propTypes /* remove-proptypes */ = {
2313
2333
  // ┌────────────────────────────── Warning ──────────────────────────────┐
@@ -2333,8 +2353,6 @@ process.env.NODE_ENV !== "production" ? Popper.propTypes /* remove-proptypes */
2333
2353
  /**
2334
2354
  * The components used for each slot inside the Popper.
2335
2355
  * Either a string to use a HTML element or a component.
2336
- *
2337
- * @deprecated use the `slots` prop instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
2338
2356
  * @default {}
2339
2357
  */
2340
2358
  components: PropTypes.shape({
@@ -2342,8 +2360,6 @@ process.env.NODE_ENV !== "production" ? Popper.propTypes /* remove-proptypes */
2342
2360
  }),
2343
2361
  /**
2344
2362
  * The props used for each slot inside the Popper.
2345
- *
2346
- * @deprecated use the `slotProps` prop instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
2347
2363
  * @default {}
2348
2364
  */
2349
2365
  componentsProps: PropTypes.shape({