@redsift/table 12.5.3-muiv6 → 12.5.3-muiv7

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$1 from 'react';
2
+ import * as React 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 { 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';
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';
7
7
  import { j as jsxRuntimeExports } from './jsx-runtime.js';
8
8
 
9
- const _excluded$4 = ["children", "color", "onClick", "startIcon"];
9
+ const _excluded$2 = ["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$4);
18
+ forwardedProps = _objectWithoutProperties(props, _excluded$2);
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$3 = ["checked", "indeterminate", "disabled", "onChange", "touchRippleRef"];
44
+ const _excluded$1 = ["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$3);
53
+ forwardedProps = _objectWithoutProperties(props, _excluded$1);
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(event)
59
+ onChange: (isChecked, value, name, event) => onChange === null || onChange === void 0 ? void 0 : onChange(event)
60
60
  }));
61
61
  });
62
62
 
63
- const _excluded$2 = ["displayName"];
63
+ const _excluded = ["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$2);
81
+ forwardedProps = _objectWithoutProperties(props, _excluded);
82
82
  return /*#__PURE__*/React__default.createElement(Icon, _extends({}, forwardedProps, forwardedProps.inputProps, {
83
83
  ref: ref,
84
84
  size: forwardedProps.fontSize,
@@ -86,25 +86,6 @@ 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
-
108
89
  var top = 'top';
109
90
  var bottom = 'bottom';
110
91
  var right = 'right';
@@ -1901,8 +1882,6 @@ function getPopperUtilityClass(slot) {
1901
1882
  }
1902
1883
  generateUtilityClasses('MuiPopper', ['root']);
1903
1884
 
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"];
1906
1885
  function flipPlacement(placement, direction) {
1907
1886
  if (direction === 'ltr') {
1908
1887
  return placement;
@@ -1939,47 +1918,47 @@ const useUtilityClasses = ownerState => {
1939
1918
  return composeClasses(slots, getPopperUtilityClass, classes);
1940
1919
  };
1941
1920
  const defaultPopperOptions = {};
1942
- const PopperTooltip = /*#__PURE__*/React$1.forwardRef(function PopperTooltip(props, forwardedRef) {
1943
- var _slots$root;
1921
+ const PopperTooltip = /*#__PURE__*/React.forwardRef(function PopperTooltip(props, forwardedRef) {
1944
1922
  const {
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);
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);
1962
1941
  const ownRef = useForkRef(tooltipRef, forwardedRef);
1963
- const popperRef = React$1.useRef(null);
1942
+ const popperRef = React.useRef(null);
1964
1943
  const handlePopperRef = useForkRef(popperRef, popperRefProp);
1965
- const handlePopperRefRef = React$1.useRef(handlePopperRef);
1944
+ const handlePopperRefRef = React.useRef(handlePopperRef);
1966
1945
  useEnhancedEffect(() => {
1967
1946
  handlePopperRefRef.current = handlePopperRef;
1968
1947
  }, [handlePopperRef]);
1969
- React$1.useImperativeHandle(popperRefProp, () => popperRef.current, []);
1948
+ React.useImperativeHandle(popperRefProp, () => popperRef.current, []);
1970
1949
  const rtlPlacement = flipPlacement(initialPlacement, direction);
1971
1950
  /**
1972
1951
  * placement initialized from prop but can change during lifetime if modifiers.flip.
1973
1952
  * modifiers.flip is essentially a flip for controlled/uncontrolled behavior
1974
1953
  */
1975
- const [placement, setPlacement] = React$1.useState(rtlPlacement);
1976
- const [resolvedAnchorElement, setResolvedAnchorElement] = React$1.useState(resolveAnchorEl(anchorEl));
1977
- React$1.useEffect(() => {
1954
+ const [placement, setPlacement] = React.useState(rtlPlacement);
1955
+ const [resolvedAnchorElement, setResolvedAnchorElement] = React.useState(resolveAnchorEl(anchorEl));
1956
+ React.useEffect(() => {
1978
1957
  if (popperRef.current) {
1979
1958
  popperRef.current.forceUpdate();
1980
1959
  }
1981
1960
  });
1982
- React$1.useEffect(() => {
1961
+ React.useEffect(() => {
1983
1962
  if (anchorEl) {
1984
1963
  setResolvedAnchorElement(resolveAnchorEl(anchorEl));
1985
1964
  }
@@ -2025,11 +2004,11 @@ const PopperTooltip = /*#__PURE__*/React$1.forwardRef(function PopperTooltip(pro
2025
2004
  if (popperOptions && popperOptions.modifiers != null) {
2026
2005
  popperModifiers = popperModifiers.concat(popperOptions.modifiers);
2027
2006
  }
2028
- const popper = createPopper(resolvedAnchorElement, tooltipRef.current, _extends$1({
2029
- placement: rtlPlacement
2030
- }, popperOptions, {
2007
+ const popper = createPopper(resolvedAnchorElement, tooltipRef.current, {
2008
+ placement: rtlPlacement,
2009
+ ...popperOptions,
2031
2010
  modifiers: popperModifiers
2032
- }));
2011
+ });
2033
2012
  handlePopperRefRef.current(popper);
2034
2013
  return () => {
2035
2014
  popper.destroy();
@@ -2043,7 +2022,7 @@ const PopperTooltip = /*#__PURE__*/React$1.forwardRef(function PopperTooltip(pro
2043
2022
  childProps.TransitionProps = TransitionProps;
2044
2023
  }
2045
2024
  const classes = useUtilityClasses(props);
2046
- const Root = (_slots$root = slots.root) != null ? _slots$root : 'div';
2025
+ const Root = slots.root ?? 'div';
2047
2026
  const rootProps = useSlotProps({
2048
2027
  elementType: Root,
2049
2028
  externalSlotProps: slotProps.root,
@@ -2055,34 +2034,35 @@ const PopperTooltip = /*#__PURE__*/React$1.forwardRef(function PopperTooltip(pro
2055
2034
  ownerState: props,
2056
2035
  className: classes.root
2057
2036
  });
2058
- return /*#__PURE__*/jsxRuntimeExports.jsx(Root, _extends$1({}, rootProps, {
2037
+ return /*#__PURE__*/jsxRuntimeExports.jsx(Root, {
2038
+ ...rootProps,
2059
2039
  children: typeof children === 'function' ? children(childProps) : children
2060
- }));
2040
+ });
2061
2041
  });
2062
2042
 
2063
2043
  /**
2064
2044
  * @ignore - internal component.
2065
2045
  */
2066
- const Popper$2 = /*#__PURE__*/React$1.forwardRef(function Popper(props, forwardedRef) {
2046
+ const Popper$2 = /*#__PURE__*/React.forwardRef(function Popper(props, forwardedRef) {
2067
2047
  const {
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);
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);
2086
2066
  const handleEnter = () => {
2087
2067
  setExited(false);
2088
2068
  };
@@ -2112,7 +2092,7 @@ const Popper$2 = /*#__PURE__*/React$1.forwardRef(function Popper(props, forwarde
2112
2092
  return /*#__PURE__*/jsxRuntimeExports.jsx(Portal, {
2113
2093
  disablePortal: disablePortal,
2114
2094
  container: container,
2115
- children: /*#__PURE__*/jsxRuntimeExports.jsx(PopperTooltip, _extends$1({
2095
+ children: /*#__PURE__*/jsxRuntimeExports.jsx(PopperTooltip, {
2116
2096
  anchorEl: anchorEl,
2117
2097
  direction: direction,
2118
2098
  disablePortal: disablePortal,
@@ -2123,19 +2103,20 @@ const Popper$2 = /*#__PURE__*/React$1.forwardRef(function Popper(props, forwarde
2123
2103
  popperOptions: popperOptions,
2124
2104
  popperRef: popperRef,
2125
2105
  slotProps: slotProps,
2126
- slots: slots
2127
- }, other, {
2128
- style: _extends$1({
2106
+ slots: slots,
2107
+ ...other,
2108
+ style: {
2129
2109
  // Prevents scroll issue, waiting for Popper.js to add this style once initiated.
2130
2110
  position: 'fixed',
2131
2111
  // Fix Popper.js display issue
2132
2112
  top: 0,
2133
2113
  left: 0,
2134
- display
2135
- }, style),
2114
+ display,
2115
+ ...style
2116
+ },
2136
2117
  TransitionProps: transitionProps,
2137
2118
  children: children
2138
- }))
2119
+ })
2139
2120
  });
2140
2121
  });
2141
2122
  process.env.NODE_ENV !== "production" ? Popper$2.propTypes /* remove-proptypes */ = {
@@ -2261,7 +2242,6 @@ process.env.NODE_ENV !== "production" ? Popper$2.propTypes /* remove-proptypes *
2261
2242
  } : void 0;
2262
2243
  var BasePopper$1 = Popper$2;
2263
2244
 
2264
- const _excluded = ["anchorEl", "component", "components", "componentsProps", "container", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "transition", "slots", "slotProps"];
2265
2245
  const PopperRoot = styled(BasePopper$1, {
2266
2246
  name: 'MuiPopper',
2267
2247
  slot: 'Root',
@@ -2272,41 +2252,40 @@ const PopperRoot = styled(BasePopper$1, {
2272
2252
  *
2273
2253
  * Demos:
2274
2254
  *
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/)
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/)
2278
2258
  *
2279
2259
  * API:
2280
2260
  *
2281
- * - [Popper API](https://mui.com/material-ui/api/popper/)
2261
+ * - [Popper API](https://v6.mui.com/material-ui/api/popper/)
2282
2262
  */
2283
- const Popper = /*#__PURE__*/React$1.forwardRef(function Popper(inProps, ref) {
2284
- var _slots$root;
2285
- const theme = default_1();
2263
+ const Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
2264
+ const isRtl = useRtl();
2286
2265
  const props = useDefaultProps({
2287
2266
  props: inProps,
2288
2267
  name: 'MuiPopper'
2289
2268
  });
2290
2269
  const {
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({
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 = {
2310
2289
  anchorEl,
2311
2290
  container,
2312
2291
  disablePortal,
@@ -2316,18 +2295,19 @@ const Popper = /*#__PURE__*/React$1.forwardRef(function Popper(inProps, ref) {
2316
2295
  placement,
2317
2296
  popperOptions,
2318
2297
  popperRef,
2319
- transition
2320
- }, other);
2321
- return /*#__PURE__*/jsxRuntimeExports.jsx(PopperRoot, _extends$1({
2298
+ transition,
2299
+ ...other
2300
+ };
2301
+ return /*#__PURE__*/jsxRuntimeExports.jsx(PopperRoot, {
2322
2302
  as: component,
2323
- direction: theme == null ? void 0 : theme.direction,
2303
+ direction: isRtl ? 'rtl' : 'ltr',
2324
2304
  slots: {
2325
2305
  root: RootComponent
2326
2306
  },
2327
- slotProps: slotProps != null ? slotProps : componentsProps
2328
- }, otherProps, {
2307
+ slotProps: slotProps ?? componentsProps,
2308
+ ...otherProps,
2329
2309
  ref: ref
2330
- }));
2310
+ });
2331
2311
  });
2332
2312
  process.env.NODE_ENV !== "production" ? Popper.propTypes /* remove-proptypes */ = {
2333
2313
  // ┌────────────────────────────── Warning ──────────────────────────────┐
@@ -2353,6 +2333,8 @@ process.env.NODE_ENV !== "production" ? Popper.propTypes /* remove-proptypes */
2353
2333
  /**
2354
2334
  * The components used for each slot inside the Popper.
2355
2335
  * 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/).
2356
2338
  * @default {}
2357
2339
  */
2358
2340
  components: PropTypes.shape({
@@ -2360,6 +2342,8 @@ process.env.NODE_ENV !== "production" ? Popper.propTypes /* remove-proptypes */
2360
2342
  }),
2361
2343
  /**
2362
2344
  * 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/).
2363
2347
  * @default {}
2364
2348
  */
2365
2349
  componentsProps: PropTypes.shape({