@redsift/table 8.0.7 → 9.0.0-alpha.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/CONTRIBUTING.md +21 -23
- package/index.d.ts +9 -13
- package/index.js +33 -2
- package/index.js.map +1 -1
- package/package.json +2 -2
package/CONTRIBUTING.md
CHANGED
|
@@ -42,6 +42,10 @@ The Design System is following a monorepo architecture, providing multiple packa
|
|
|
42
42
|
|
|
43
43
|
This package provides popover components. Popover components are based on [floating-ui](https://floating-ui.com/) and [@floating-ui/react](https://floating-ui.com/docs/react). Toasts are based on [react-toastify](https://fkhadra.github.io/react-toastify).
|
|
44
44
|
|
|
45
|
+
- `@redsift/pickers`
|
|
46
|
+
|
|
47
|
+
This package provides selection components. The Popover part of the Pickers comes from `@redsift/popovers`.
|
|
48
|
+
|
|
45
49
|
- `@redsift/table`
|
|
46
50
|
|
|
47
51
|
This package provides datagrid components and features based on [MUI DataGrid](https://mui.com/x/react-data-grid/). Due to the use of advanced features, a [premium license](https://mui.com/x/introduction/licensing/#premium-plan) from MUI is required.
|
|
@@ -136,29 +140,23 @@ const DEFAULT_PROPS: Partial<BadgeProps> = {
|
|
|
136
140
|
/**
|
|
137
141
|
* The Badge component.
|
|
138
142
|
*/
|
|
139
|
-
export const Badge: Comp<BadgeProps, HTMLDivElement> = forwardRef(
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
>
|
|
157
|
-
// content of the component if needed
|
|
158
|
-
</StyledBadge>
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
);
|
|
143
|
+
export const Badge: Comp<BadgeProps, HTMLDivElement> = forwardRef((props, ref) => {
|
|
144
|
+
const {
|
|
145
|
+
// props
|
|
146
|
+
...forwardedProps
|
|
147
|
+
} = props;
|
|
148
|
+
|
|
149
|
+
return (
|
|
150
|
+
<StyledBadge
|
|
151
|
+
{...forwardedProps}
|
|
152
|
+
// transient props
|
|
153
|
+
className={classNames(Badge.className, `${Badge.className}-${variant}`, className)}
|
|
154
|
+
ref={ref as RefObject<HTMLDivElement>}
|
|
155
|
+
>
|
|
156
|
+
// content of the component if needed
|
|
157
|
+
</StyledBadge>
|
|
158
|
+
);
|
|
159
|
+
});
|
|
162
160
|
Badge.className = CLASSNAME;
|
|
163
161
|
Badge.defaultProps = DEFAULT_PROPS;
|
|
164
162
|
Badge.displayName = COMPONENT_NAME;
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _mui_x_data_grid_pro from '@mui/x-data-grid-pro';
|
|
2
2
|
import { GridFilterItem, GridCellParams, GridFilterOperator, GridFilterInputMultipleValue, DataGridProProps, GridToolbarExportProps, GridToolbarFilterButtonProps, GridToolbarColumnsButton, GridToolbarDensitySelector } from '@mui/x-data-grid-pro';
|
|
3
3
|
export { GridAlignment, GridColDef, GridColumns, GridFilterItem, GridFilterModel, GridSelectionModel, getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators } from '@mui/x-data-grid-pro';
|
|
4
|
-
import { Comp,
|
|
4
|
+
import { Comp, IconProps, NotificationsColorPalette, ProductColorPalette, ShieldVariant } from '@redsift/design-system';
|
|
5
5
|
import React, { ReactNode, RefObject, ComponentProps } from 'react';
|
|
6
6
|
|
|
7
7
|
declare const DETAIL_PANEL_TOGGLE_COL_DEF: _mui_x_data_grid_pro.GridColDef<any, any, any>;
|
|
@@ -120,23 +120,19 @@ interface TextCellProps extends ComponentProps<'div'> {
|
|
|
120
120
|
/** Including Badge Component. */
|
|
121
121
|
badge?: ReactNode;
|
|
122
122
|
/**
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
* Recommended path data come from mdi/js.<br />
|
|
126
|
-
* See <a href="https://www.npmjs.com/package/@mdi/js">https://www.npmjs.com/package/@mdi/js</a>.
|
|
123
|
+
* Can be a string or an array of strings containing `d` property of the `path` SVG element.<br />
|
|
124
|
+
* Can also be a ReactElement.
|
|
127
125
|
*/
|
|
128
|
-
leftIcon?:
|
|
126
|
+
leftIcon?: IconProps['icon'];
|
|
129
127
|
/** Left Icon Color variant. */
|
|
130
|
-
leftIconColor?:
|
|
128
|
+
leftIconColor?: NotificationsColorPalette | ProductColorPalette | (string & {});
|
|
131
129
|
/**
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* Recommended path data come from mdi/js.<br />
|
|
135
|
-
* See <a href="https://www.npmjs.com/package/@mdi/js">https://www.npmjs.com/package/@mdi/js</a>.
|
|
130
|
+
* Can be a string or an array of strings containing `d` property of the `path` SVG element.<br />
|
|
131
|
+
* Can also be a ReactElement.
|
|
136
132
|
*/
|
|
137
|
-
rightIcon?:
|
|
133
|
+
rightIcon?: IconProps['icon'];
|
|
138
134
|
/** Right Icon Color variant. */
|
|
139
|
-
rightIconColor?:
|
|
135
|
+
rightIconColor?: NotificationsColorPalette | ProductColorPalette | (string & {});
|
|
140
136
|
/** Shield variant. */
|
|
141
137
|
shieldVariant?: ShieldVariant;
|
|
142
138
|
}
|
package/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { GRID_DETAIL_PANEL_TOGGLE_COL_DEF, getGridNumericOperators as getGridNum
|
|
|
2
2
|
export { getGridBooleanOperators, getGridDateOperators, getGridSingleSelectOperators } from '@mui/x-data-grid-pro';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { forwardRef, useRef, useState, useEffect } from 'react';
|
|
5
|
-
import { Icon, Flexbox,
|
|
5
|
+
import { Icon, Flexbox, CtasColorPalette, NotificationsColorPalette, Button, Checkbox, TextField as TextField$2, Shield } from '@redsift/design-system';
|
|
6
6
|
import { mdiSync, mdiFilterVariant, mdiViewColumn, mdiChevronUp, mdiChevronDown, mdiViewHeadline, mdiViewSequential, mdiViewStream, mdiChevronRight, mdiTrayArrowDown } from '@redsift/icons';
|
|
7
7
|
import emStyled from '@emotion/styled';
|
|
8
8
|
import { Global, ThemeContext } from '@emotion/react';
|
|
@@ -10,6 +10,7 @@ import * as ReactDOM from 'react-dom';
|
|
|
10
10
|
import ReactDOM__default from 'react-dom';
|
|
11
11
|
import classNames from 'classnames';
|
|
12
12
|
import styled$3, { css } from 'styled-components';
|
|
13
|
+
import { Popper } from '@mui/material';
|
|
13
14
|
|
|
14
15
|
// Don't use a spread operator there or it will break the build due to MUI internal components
|
|
15
16
|
const DETAIL_PANEL_TOGGLE_COL_DEF = GRID_DETAIL_PANEL_TOGGLE_COL_DEF;
|
|
@@ -15167,7 +15168,7 @@ const BaseButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
15167
15168
|
startIcon
|
|
15168
15169
|
} = props,
|
|
15169
15170
|
forwardedProps = _objectWithoutProperties(props, _excluded$3);
|
|
15170
|
-
const color = [...Object.values(
|
|
15171
|
+
const color = [...Object.values(CtasColorPalette), ...Object.values(NotificationsColorPalette)].includes(propsColor) ? propsColor : 'primary';
|
|
15171
15172
|
return /*#__PURE__*/React__default.createElement(Button, _extends$1({}, forwardedProps, {
|
|
15172
15173
|
color: color,
|
|
15173
15174
|
onClick: onClick,
|
|
@@ -15197,6 +15198,34 @@ const BaseCheckbox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
15197
15198
|
}));
|
|
15198
15199
|
});
|
|
15199
15200
|
|
|
15201
|
+
const BaseTextField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
15202
|
+
const {
|
|
15203
|
+
label,
|
|
15204
|
+
id,
|
|
15205
|
+
value,
|
|
15206
|
+
onChange,
|
|
15207
|
+
placeholder
|
|
15208
|
+
} = props;
|
|
15209
|
+
return /*#__PURE__*/React__default.createElement(TextField$2, {
|
|
15210
|
+
marginTop: "6px",
|
|
15211
|
+
inputRef: ref,
|
|
15212
|
+
label: label,
|
|
15213
|
+
id: id,
|
|
15214
|
+
value: value,
|
|
15215
|
+
variant: "underline",
|
|
15216
|
+
onChange: (value, name, event) => onChange(event),
|
|
15217
|
+
autoFocus: true,
|
|
15218
|
+
placeholder: placeholder
|
|
15219
|
+
});
|
|
15220
|
+
});
|
|
15221
|
+
|
|
15222
|
+
const BasePopper = /*#__PURE__*/forwardRef((props, ref) => {
|
|
15223
|
+
return /*#__PURE__*/React__default.createElement(Popper, _extends$1({}, props, {
|
|
15224
|
+
ref: ref,
|
|
15225
|
+
container: () => document.getElementById('redsift-app-container')
|
|
15226
|
+
}));
|
|
15227
|
+
});
|
|
15228
|
+
|
|
15200
15229
|
const _excluded$1 = ["autoHeight", "className", "filterModel", "hideToolbar", "height", "license", "onFilterModelChange", "rows"];
|
|
15201
15230
|
const COMPONENT_NAME$1 = 'DataGrid';
|
|
15202
15231
|
const CLASSNAME$1 = 'redsift-datagrid';
|
|
@@ -15246,6 +15275,8 @@ const DataGrid = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
15246
15275
|
components: _objectSpread2(_objectSpread2({
|
|
15247
15276
|
BaseButton,
|
|
15248
15277
|
BaseCheckbox,
|
|
15278
|
+
BaseTextField,
|
|
15279
|
+
BasePopper,
|
|
15249
15280
|
ColumnFilteredIcon: props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends$1({}, props, {
|
|
15250
15281
|
displayName: "ColumnFilteredIcon"
|
|
15251
15282
|
})),
|