schummar-table 0.5.4 → 0.7.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.
@@ -36,8 +36,8 @@ var core = require("@material-ui/core");
36
36
  var react = require("react");
37
37
  var tableTheme = require("./tableTheme.js");
38
38
  var jsxRuntime = require("@emotion/react/jsx-runtime");
39
- require("@emotion/react");
40
39
  require("react-dom");
40
+ require("@emotion/react");
41
41
  const mui4Theme = {
42
42
  components: {
43
43
  Button: (props) => jsxRuntime.jsx(core.Button, __spreadProps(__spreadValues({}, props), {
@@ -1 +1 @@
1
- {"version":3,"file":"mui4Theme.js","sources":["../../src/theme/mui4Theme/index.tsx"],"sourcesContent":["import { Badge, Button, Checkbox, CircularProgress, IconButton, TextField, useTheme } from '@material-ui/core';\nimport { ReactNode, useMemo } from 'react';\nimport { PartialTableTheme, TableTheme } from '../../types';\nimport { Popover } from '../defaultTheme/popover';\nimport { mergeThemes, TableThemeContext } from '../tableTheme';\n\nexport const mui4Theme: Partial<TableTheme> = {\n components: {\n Button: (props) => (\n <Button\n {...props}\n size=\"small\"\n fullWidth\n css={{ justifyContent: 'start !important' }}\n color={props.variant === 'contained' ? 'primary' : 'inherit'}\n />\n ),\n IconButton: (props) => <IconButton {...props} size=\"small\" color=\"inherit\" />,\n Checkbox: (props) => <Checkbox {...props} color=\"primary\" size=\"medium\" />,\n Popover,\n Badge,\n TextField: ({ endIcon, ...props }) => <TextField {...props} InputProps={{ endAdornment: endIcon }} size=\"small\" variant=\"outlined\" />,\n Spinner: CircularProgress,\n },\n};\n\nexport function Mui4TableThemeProvider({ theme, children }: { theme?: PartialTableTheme; children: ReactNode }) {\n const muiTheme = useTheme();\n\n const _theme = useMemo(() => {\n return mergeThemes(\n {\n colors: {\n primary: muiTheme.palette.primary,\n secondary: muiTheme.palette.secondary,\n },\n },\n mui4Theme,\n theme ?? {},\n );\n }, [muiTheme, theme]);\n\n return <TableThemeContext.Provider value={_theme}>{children}</TableThemeContext.Provider>;\n}\n"],"names":["mui4Theme","components","Button","props","_jsx","justifyContent","variant","IconButton","Checkbox","Popover","Badge","TextField","endIcon","endAdornment","Spinner","CircularProgress","theme","children","muiTheme","useTheme","_theme","useMemo","mergeThemes","colors","primary","palette","secondary","TableThemeContext"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAMaA,YAAiC;AAAA,EAC5CC,YAAY;AAAA,IACVC,QAASC,WACPC,eAACF,8CACKC;MACJ,MAAK;AAAA,MACL;MACA,KAAK;AAAA,QAAEE,gBAAgB;AAAA;AAAA,MACvB,OAAOF,MAAMG,YAAY,cAAc,YAAY;AAAA;AAAA,IAGvDC,YAAaJ,WAAUC,eAACG,kDAAeJ;MAAO,MAAK;AAAA,MAAQ,OAAM;AAAA;AAAA,IACjEK,UAAWL,WAAUC,eAACI,gDAAaL;MAAO,OAAM;AAAA,MAAU,MAAK;AAAA;AAAA,aAC/DM;WACAC;IACAC,WAAW,CAAC;AAAA,mBAAEC;AAAAA;AAAAA,UAAF,IAAcT,kBAAd,IAAcA;AAAAA,QAAZS;AAAAA;AAAwBR,4BAACO,iDAAcR;QAAO,YAAY;AAAA,UAAEU,cAAcD;AAAAA;AAAAA,QAAW,MAAK;AAAA,QAAQ,SAAQ;AAAA;AAAA;AAAA,IACxHE,SAASC;;;gCAI0B;AAAA,EAAEC;AAAAA,EAAOC;AAAAA,GAAgE;QACxGC,WAAWC;QAEXC,SAASC,cAAQ,MAAM;WACpBC,uBACL;AAAA,MACEC,QAAQ;AAAA,QACNC,SAASN,SAASO,QAAQD;AAAAA,QAC1BE,WAAWR,SAASO,QAAQC;AAAAA;AAAAA,OAGhC1B,WACAgB,wBAAS;AAAA,KAEV,CAACE,UAAUF;SAEPZ,eAACuB,6BAAkB;IAAS,OAAOP;AAAAA;;;;;"}
1
+ {"version":3,"file":"mui4Theme.js","sources":["../../src/theme/mui4Theme/index.tsx"],"sourcesContent":["import { Badge, Button, Checkbox, CircularProgress, IconButton, TextField, useTheme } from '@material-ui/core';\nimport { ReactNode, useMemo } from 'react';\nimport { PartialTableTheme } from '../../types';\nimport { Popover } from '../defaultTheme/popover';\nimport { mergeThemes, TableThemeContext } from '../tableTheme';\n\nexport const mui4Theme: PartialTableTheme = {\n components: {\n Button: (props) => (\n <Button\n {...props}\n size=\"small\"\n fullWidth\n css={{ justifyContent: 'start !important' }}\n color={props.variant === 'contained' ? 'primary' : 'inherit'}\n />\n ),\n IconButton: (props) => <IconButton {...props} size=\"small\" color=\"inherit\" />,\n Checkbox: (props) => <Checkbox {...props} color=\"primary\" size=\"medium\" />,\n Popover,\n Badge,\n TextField: ({ endIcon, ...props }) => <TextField {...props} InputProps={{ endAdornment: endIcon }} size=\"small\" variant=\"outlined\" />,\n Spinner: CircularProgress,\n },\n};\n\nexport function Mui4TableThemeProvider({ theme, children }: { theme?: PartialTableTheme; children: ReactNode }) {\n const muiTheme = useTheme();\n\n const _theme = useMemo(() => {\n return mergeThemes(\n {\n colors: {\n primary: muiTheme.palette.primary,\n secondary: muiTheme.palette.secondary,\n },\n },\n mui4Theme,\n theme ?? {},\n );\n }, [muiTheme, theme]);\n\n return <TableThemeContext.Provider value={_theme}>{children}</TableThemeContext.Provider>;\n}\n"],"names":["mui4Theme","components","Button","props","_jsx","justifyContent","variant","IconButton","Checkbox","Popover","Badge","TextField","endIcon","endAdornment","Spinner","CircularProgress","theme","children","muiTheme","useTheme","_theme","useMemo","mergeThemes","colors","primary","palette","secondary","TableThemeContext"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAMaA,YAA+B;AAAA,EAC1CC,YAAY;AAAA,IACVC,QAASC,WACPC,eAACF,8CACKC;MACJ,MAAK;AAAA,MACL;MACA,KAAK;AAAA,QAAEE,gBAAgB;AAAA;AAAA,MACvB,OAAOF,MAAMG,YAAY,cAAc,YAAY;AAAA;AAAA,IAGvDC,YAAaJ,WAAUC,eAACG,kDAAeJ;MAAO,MAAK;AAAA,MAAQ,OAAM;AAAA;AAAA,IACjEK,UAAWL,WAAUC,eAACI,gDAAaL;MAAO,OAAM;AAAA,MAAU,MAAK;AAAA;AAAA,aAC/DM;WACAC;IACAC,WAAW,CAAC;AAAA,mBAAEC;AAAAA;AAAAA,UAAF,IAAcT,kBAAd,IAAcA;AAAAA,QAAZS;AAAAA;AAAwBR,4BAACO,iDAAcR;QAAO,YAAY;AAAA,UAAEU,cAAcD;AAAAA;AAAAA,QAAW,MAAK;AAAA,QAAQ,SAAQ;AAAA;AAAA;AAAA,IACxHE,SAASC;;;gCAI0B;AAAA,EAAEC;AAAAA,EAAOC;AAAAA,GAAgE;QACxGC,WAAWC;QAEXC,SAASC,cAAQ,MAAM;WACpBC,uBACL;AAAA,MACEC,QAAQ;AAAA,QACNC,SAASN,SAASO,QAAQD;AAAAA,QAC1BE,WAAWR,SAASO,QAAQC;AAAAA;AAAAA,OAGhC1B,WACAgB,wBAAS;AAAA,KAEV,CAACE,UAAUF;SAEPZ,eAACuB,6BAAkB;IAAS,OAAOP;AAAAA;;;;;"}
@@ -36,8 +36,8 @@ var material = require("@mui/material");
36
36
  var react = require("react");
37
37
  var tableTheme = require("./tableTheme.js");
38
38
  var jsxRuntime = require("@emotion/react/jsx-runtime");
39
- require("@emotion/react");
40
39
  require("react-dom");
40
+ require("@emotion/react");
41
41
  const mui5Theme = {
42
42
  components: {
43
43
  Button: (props) => jsxRuntime.jsx(material.Button, __spreadProps(__spreadValues({}, props), {
@@ -1 +1 @@
1
- {"version":3,"file":"mui5Theme.js","sources":["../../src/theme/mui5Theme/index.tsx"],"sourcesContent":["import { Badge, Button, Checkbox, CircularProgress, IconButton, TextField, useTheme } from '@mui/material';\nimport { ReactNode, useMemo } from 'react';\nimport { PartialTableTheme, TableTheme } from '../../types';\nimport { Popover } from '../defaultTheme/popover';\nimport { mergeThemes, TableThemeContext } from '../tableTheme';\n\nexport const mui5Theme: Partial<TableTheme> = {\n components: {\n Button: (props) => (\n <Button\n {...props}\n size=\"small\"\n fullWidth\n css={{ justifyContent: 'start !important' }}\n color={props.variant === 'contained' ? 'primary' : 'inherit'}\n />\n ),\n IconButton: (props) => <IconButton {...props} size=\"small\" css={{ fontSize: '0.8em' }} color=\"inherit\" />,\n Checkbox: (props) => <Checkbox {...props} color=\"primary\" size=\"small\" />,\n Popover,\n Badge,\n TextField: ({ endIcon, ...props }) => <TextField {...props} InputProps={{ endAdornment: endIcon }} size=\"small\" />,\n Spinner: (props) => <CircularProgress {...props} size={20} />,\n },\n};\n\nexport function Mui5TableThemeProvider({ theme, children }: { theme?: PartialTableTheme; children: ReactNode }) {\n const muiTheme = useTheme();\n\n const _theme = useMemo(() => {\n return mergeThemes(\n {\n colors: {\n primary: muiTheme.palette.primary,\n secondary: muiTheme.palette.secondary,\n },\n },\n mui5Theme,\n theme ?? {},\n );\n }, [muiTheme, theme]);\n\n return <TableThemeContext.Provider value={_theme}>{children}</TableThemeContext.Provider>;\n}\n"],"names":["mui5Theme","components","Button","props","_jsx","justifyContent","variant","IconButton","fontSize","Checkbox","Popover","Badge","TextField","endIcon","endAdornment","Spinner","CircularProgress","theme","children","muiTheme","useTheme","_theme","useMemo","mergeThemes","colors","primary","palette","secondary","TableThemeContext"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAMaA,YAAiC;AAAA,EAC5CC,YAAY;AAAA,IACVC,QAASC,WACPC,eAACF,kDACKC;MACJ,MAAK;AAAA,MACL;MACA,KAAK;AAAA,QAAEE,gBAAgB;AAAA;AAAA,MACvB,OAAOF,MAAMG,YAAY,cAAc,YAAY;AAAA;AAAA,IAGvDC,YAAaJ,WAAUC,eAACG,sDAAeJ;MAAO,MAAK;AAAA,MAAQ,KAAK;AAAA,QAAEK,UAAU;AAAA;AAAA,MAAW,OAAM;AAAA;AAAA,IAC7FC,UAAWN,WAAUC,eAACK,oDAAaN;MAAO,OAAM;AAAA,MAAU,MAAK;AAAA;AAAA,aAC/DO;WACAC;IACAC,WAAW,CAAC;AAAA,mBAAEC;AAAAA;AAAAA,UAAF,IAAcV,kBAAd,IAAcA;AAAAA,QAAZU;AAAAA;AAAwBT,4BAACQ,qDAAcT;QAAO,YAAY;AAAA,UAAEW,cAAcD;AAAAA;AAAAA,QAAW,MAAK;AAAA;AAAA;AAAA,IACxGE,SAAUZ,WAAUC,eAACY,4DAAqBb;MAAO,MAAM;AAAA;AAAA;AAAA;gCAIpB;AAAA,EAAEc;AAAAA,EAAOC;AAAAA,GAAgE;QACxGC,WAAWC;QAEXC,SAASC,cAAQ,MAAM;WACpBC,uBACL;AAAA,MACEC,QAAQ;AAAA,QACNC,SAASN,SAASO,QAAQD;AAAAA,QAC1BE,WAAWR,SAASO,QAAQC;AAAAA;AAAAA,OAGhC3B,WACAiB,wBAAS;AAAA,KAEV,CAACE,UAAUF;SAEPb,eAACwB,6BAAkB;IAAS,OAAOP;AAAAA;;;;;"}
1
+ {"version":3,"file":"mui5Theme.js","sources":["../../src/theme/mui5Theme/index.tsx"],"sourcesContent":["import { Badge, Button, Checkbox, CircularProgress, IconButton, TextField, useTheme } from '@mui/material';\nimport { ReactNode, useMemo } from 'react';\nimport { PartialTableTheme } from '../../types';\nimport { Popover } from '../defaultTheme/popover';\nimport { mergeThemes, TableThemeContext } from '../tableTheme';\n\nexport const mui5Theme: PartialTableTheme = {\n components: {\n Button: (props) => (\n <Button\n {...props}\n size=\"small\"\n fullWidth\n css={{ justifyContent: 'start !important' }}\n color={props.variant === 'contained' ? 'primary' : 'inherit'}\n />\n ),\n IconButton: (props) => <IconButton {...props} size=\"small\" css={{ fontSize: '0.8em' }} color=\"inherit\" />,\n Checkbox: (props) => <Checkbox {...props} color=\"primary\" size=\"small\" />,\n Popover,\n Badge,\n TextField: ({ endIcon, ...props }) => <TextField {...props} InputProps={{ endAdornment: endIcon }} size=\"small\" />,\n Spinner: (props) => <CircularProgress {...props} size={20} />,\n },\n};\n\nexport function Mui5TableThemeProvider({ theme, children }: { theme?: PartialTableTheme; children: ReactNode }) {\n const muiTheme = useTheme();\n\n const _theme = useMemo(() => {\n return mergeThemes(\n {\n colors: {\n primary: muiTheme.palette.primary,\n secondary: muiTheme.palette.secondary,\n },\n },\n mui5Theme,\n theme ?? {},\n );\n }, [muiTheme, theme]);\n\n return <TableThemeContext.Provider value={_theme}>{children}</TableThemeContext.Provider>;\n}\n"],"names":["mui5Theme","components","Button","props","_jsx","justifyContent","variant","IconButton","fontSize","Checkbox","Popover","Badge","TextField","endIcon","endAdornment","Spinner","CircularProgress","theme","children","muiTheme","useTheme","_theme","useMemo","mergeThemes","colors","primary","palette","secondary","TableThemeContext"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAMaA,YAA+B;AAAA,EAC1CC,YAAY;AAAA,IACVC,QAASC,WACPC,eAACF,kDACKC;MACJ,MAAK;AAAA,MACL;MACA,KAAK;AAAA,QAAEE,gBAAgB;AAAA;AAAA,MACvB,OAAOF,MAAMG,YAAY,cAAc,YAAY;AAAA;AAAA,IAGvDC,YAAaJ,WAAUC,eAACG,sDAAeJ;MAAO,MAAK;AAAA,MAAQ,KAAK;AAAA,QAAEK,UAAU;AAAA;AAAA,MAAW,OAAM;AAAA;AAAA,IAC7FC,UAAWN,WAAUC,eAACK,oDAAaN;MAAO,OAAM;AAAA,MAAU,MAAK;AAAA;AAAA,aAC/DO;WACAC;IACAC,WAAW,CAAC;AAAA,mBAAEC;AAAAA;AAAAA,UAAF,IAAcV,kBAAd,IAAcA;AAAAA,QAAZU;AAAAA;AAAwBT,4BAACQ,qDAAcT;QAAO,YAAY;AAAA,UAAEW,cAAcD;AAAAA;AAAAA,QAAW,MAAK;AAAA;AAAA;AAAA,IACxGE,SAAUZ,WAAUC,eAACY,4DAAqBb;MAAO,MAAM;AAAA;AAAA;AAAA;gCAIpB;AAAA,EAAEc;AAAAA,EAAOC;AAAAA,GAAgE;QACxGC,WAAWC;QAEXC,SAASC,cAAQ,MAAM;WACpBC,uBACL;AAAA,MACEC,QAAQ;AAAA,QACNC,SAASN,SAASO,QAAQD;AAAAA,QAC1BE,WAAWR,SAASO,QAAQC;AAAAA;AAAAA,OAGhC3B,WACAiB,wBAAS;AAAA,KAEV,CAACE,UAAUF;SAEPb,eAACwB,6BAAkB;IAAS,OAAOP;AAAAA;;;;;"}
@@ -18,22 +18,10 @@ var __spreadValues = (a, b) => {
18
18
  return a;
19
19
  };
20
20
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
- var __objRest = (source, exclude) => {
22
- var target = {};
23
- for (var prop in source)
24
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
25
- target[prop] = source[prop];
26
- if (source != null && __getOwnPropSymbols)
27
- for (var prop of __getOwnPropSymbols(source)) {
28
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
29
- target[prop] = source[prop];
30
- }
31
- return target;
32
- };
33
21
  var react$1 = require("react");
22
+ var reactDom = require("react-dom");
34
23
  var react = require("@emotion/react");
35
24
  var jsxRuntime = require("@emotion/react/jsx-runtime");
36
- var reactDom = require("react-dom");
37
25
  const white = "#ffffff";
38
26
  const lightGray = "#eeeeee";
39
27
  const gray = "#bdbdbd";
@@ -92,7 +80,7 @@ const PopoverContext = react$1.createContext({
92
80
  });
93
81
  const Popover = ({
94
82
  anchorEl,
95
- open: open2,
83
+ open,
96
84
  hidden,
97
85
  onClose,
98
86
  children,
@@ -102,7 +90,7 @@ const Popover = ({
102
90
  const popper = react$1.useRef(null);
103
91
  const [position, setPosition] = react$1.useState();
104
92
  react$1.useLayoutEffect(() => {
105
- if (!anchorEl || !open2) {
93
+ if (!anchorEl || !open) {
106
94
  setPosition(void 0);
107
95
  return;
108
96
  }
@@ -142,7 +130,7 @@ const Popover = ({
142
130
  return () => {
143
131
  clearInterval(handle);
144
132
  };
145
- }, [anchorEl, open2]);
133
+ }, [anchorEl, open]);
146
134
  const {
147
135
  depth
148
136
  } = react$1.useContext(PopoverContext);
@@ -151,7 +139,7 @@ const Popover = ({
151
139
  depth: depth + 1,
152
140
  visible
153
141
  }), [depth, visible]);
154
- if (!open2)
142
+ if (!open)
155
143
  return null;
156
144
  return jsxRuntime.jsx(PopoverContext.Provider, {
157
145
  value: context,
@@ -187,443 +175,9 @@ const Popover = ({
187
175
  }), document.body)
188
176
  });
189
177
  };
190
- const defaultColors = {
191
- primary: { main: "#1976d2", light: "#42a5f5", contrastText: "#fff" },
192
- secondary: { main: "#9c27b0", light: "#ba68c8", contrastText: "#fff" }
193
- };
194
- function Spinner({
195
- className
196
- }) {
197
- return jsxRuntime.jsxs("div", {
198
- className,
199
- css: react.css`
200
- display: inline-block;
201
- position: relative;
202
- width: 1em;
203
- height: 1em;
204
-
205
- div {
206
- box-sizing: border-box;
207
- display: block;
208
- position: absolute;
209
- width: 0.8em;
210
- height: 0.8em;
211
- margin: 0.1em;
212
- border: 0.1em solid #fff;
213
- border-radius: 50%;
214
- animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
215
- border-color: currentColor transparent transparent transparent;
216
- }
217
- div:nth-of-type(1) {
218
- animation-delay: -0.45s;
219
- }
220
- div:nth-of-type(2) {
221
- animation-delay: -0.3s;
222
- }
223
- div:nth-of-type(3) {
224
- animation-delay: -0.15s;
225
- }
226
- @keyframes lds-ring {
227
- 0% {
228
- transform: rotate(0deg);
229
- }
230
- 100% {
231
- transform: rotate(360deg);
232
- }
233
- }
234
- `,
235
- children: [jsxRuntime.jsx("div", {}), jsxRuntime.jsx("div", {}), jsxRuntime.jsx("div", {})]
236
- });
237
- }
238
- const Badge = ({
239
- badgeContent,
240
- children
241
- }) => {
242
- if (!open)
243
- return null;
244
- return jsxRuntime.jsxs("span", {
245
- css: {
246
- display: "inline-flex",
247
- position: "relative",
248
- flexShrink: 0,
249
- verticalAlign: "middle"
250
- },
251
- children: [children, jsxRuntime.jsx("span", {
252
- css: [{
253
- top: 0,
254
- right: 0,
255
- transform: "scale(1) translate(50%, -50%)",
256
- transformOrigin: "100% 0%",
257
- height: 20,
258
- display: "flex",
259
- padding: "0 6px",
260
- zIndex: 1,
261
- position: "absolute",
262
- flexWrap: "wrap",
263
- minWidth: 20,
264
- transition: "transform 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
265
- alignItems: "center",
266
- lineHeight: 1,
267
- alignContent: "center",
268
- borderRadius: 10,
269
- justifyContent: "center",
270
- fontSize: "0.8em"
271
- }, !badgeContent && {
272
- transform: "scale(0) translate(50%, -50%)",
273
- transition: "transform 195ms cubic-bezier(0.4, 0, 0.2, 1) 0ms"
274
- }],
275
- children: badgeContent
276
- })]
277
- });
278
- };
279
- const Button = (_a) => {
280
- var _b = _a, {
281
- startIcon,
282
- children,
283
- variant = "text"
284
- } = _b, props = __objRest(_b, [
285
- "startIcon",
286
- "children",
287
- "variant"
288
- ]);
289
- return jsxRuntime.jsxs("button", __spreadProps(__spreadValues({
290
- css: [{
291
- padding: `var(--spacing) calc(var(--spacing) * 2)`,
292
- display: "inline-flex",
293
- alignItems: "center",
294
- transition: "background-color 150ms",
295
- border: "none",
296
- cursor: "pointer",
297
- background: "transparent",
298
- borderRadius: 4,
299
- "&:active:not(:disabled)": {
300
- transform: "scale3d(0.95, 0.95, 1)"
301
- }
302
- }, variant === "text" && {
303
- "&:hover": {
304
- background: "rgba(0, 0, 0, 0.1)"
305
- }
306
- }, variant === "outlined" && {
307
- border: `1px solid ${darkGray}`,
308
- "&:disabled": {
309
- borderColor: lightGray
310
- }
311
- }, variant === "contained" && {
312
- color: "var(--primaryContrastText)",
313
- backgroundColor: "var(--primaryMain)",
314
- boxShadow: "0px 3px 1px -2px rgb(0 0 0 / 20%), 0px 2px 2px 0px rgb(0 0 0 / 14%), 0px 1px 5px 0px rgb(0 0 0 / 12%)",
315
- "&:hover": {
316
- filter: "brightness(0.9)"
317
- },
318
- "&:disabled": {
319
- filter: "grayscale()",
320
- opacity: 0.5
321
- }
322
- }]
323
- }, props), {
324
- children: [startIcon && jsxRuntime.jsx("span", {
325
- css: {
326
- marginRight: `calc(var(--spacing) * 2)`
327
- },
328
- children: startIcon
329
- }), jsxRuntime.jsx("span", {
330
- children
331
- })]
332
- }));
333
- };
334
- const Checkbox = (_c) => {
335
- var _d = _c, {
336
- className
337
- } = _d, props = __objRest(_d, [
338
- "className"
339
- ]);
340
- return jsxRuntime.jsxs("label", {
341
- css: [{
342
- padding: "calc(var(--spacing) * 1.8)",
343
- display: "flex",
344
- color: "currentcolor",
345
- userSelect: "none",
346
- "& input": {
347
- appearance: "none",
348
- margin: 0
349
- }
350
- }, props.disabled && {
351
- color: "rgba(0, 0, 0, 0.26)"
352
- }],
353
- className,
354
- children: [jsxRuntime.jsx("input", __spreadValues({
355
- type: "checkbox"
356
- }, props)), props.checked ? jsxRuntime.jsx("svg", {
357
- css: {
358
- fontSize: "1.25rem",
359
- width: "1em",
360
- height: "1em",
361
- fill: "var(--primaryMain)"
362
- },
363
- focusable: "false",
364
- viewBox: "0 0 24 24",
365
- "aria-hidden": "true",
366
- children: jsxRuntime.jsx("path", {
367
- d: "M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
368
- })
369
- }) : jsxRuntime.jsx("svg", {
370
- css: {
371
- fontSize: "1.25rem",
372
- width: "1em",
373
- height: "1em",
374
- fill: "currentColor"
375
- },
376
- focusable: "false",
377
- viewBox: "0 0 24 24",
378
- "aria-hidden": "true",
379
- children: jsxRuntime.jsx("path", {
380
- d: "M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"
381
- })
382
- })]
383
- });
384
- };
385
- const IconButton = (props) => {
386
- return jsxRuntime.jsx("button", __spreadValues({
387
- css: {
388
- padding: "var(--spacing)",
389
- borderRadius: "50%",
390
- display: "inline-flex",
391
- justifyContent: "center",
392
- alignItems: "center",
393
- transition: "background-color 150ms",
394
- border: "none",
395
- cursor: "pointer",
396
- color: "inherit",
397
- background: "transparent",
398
- "&:hover": {
399
- backgroundColor: "rgba(0, 0, 0, 0.04)"
400
- },
401
- "&:active": {
402
- transformColor: "scale3d(0.95, 0.95, 1)"
403
- }
404
- }
405
- }, props));
406
- };
407
- const TextField = (_e) => {
408
- var _f = _e, {
409
- endIcon,
410
- className,
411
- inputRef
412
- } = _f, props = __objRest(_f, [
413
- "endIcon",
414
- "className",
415
- "inputRef"
416
- ]);
417
- var _a;
418
- const [focus, setFocus] = react$1.useState(false);
419
- return jsxRuntime.jsx("div", {
420
- className,
421
- css: {
422
- display: "flex"
423
- },
424
- children: jsxRuntime.jsxs("span", {
425
- css: [{
426
- flex: 1,
427
- display: "flex",
428
- alignItems: "center",
429
- border: `1px solid ${darkGray}`,
430
- borderRadius: 4
431
- }, focus && {
432
- border: "2px solid var(--primaryMain)",
433
- margin: -1
434
- }],
435
- children: [jsxRuntime.jsx("input", __spreadProps(__spreadValues({
436
- ref: inputRef
437
- }, props), {
438
- value: (_a = props.value) != null ? _a : "",
439
- onFocus: () => setFocus(true),
440
- onBlur: () => setFocus(false),
441
- css: {
442
- flex: 1,
443
- border: "none",
444
- outline: "none",
445
- borderRadius: 4,
446
- padding: "calc(var(--spacing) * 2)",
447
- paddingRight: 0,
448
- transition: "outline 500ms"
449
- }
450
- })), endIcon]
451
- })
452
- });
453
- };
454
- const defaultComponents = {
455
- IconButton,
456
- Checkbox,
457
- Popover,
458
- Button,
459
- Badge,
460
- TextField,
461
- Spinner
462
- };
463
- const IconDefaultStyle = react.css({
464
- width: "1.5em",
465
- height: "1.5em",
466
- color: "inherit"
467
- });
468
- function Icon(svg) {
469
- return (props) => jsxRuntime.jsx(react.ClassNames, {
470
- children: ({
471
- css: css2
472
- }) => react$1.cloneElement(svg, __spreadProps(__spreadValues({}, props), {
473
- className: css2(IconDefaultStyle, props.className)
474
- }))
475
- });
476
- }
477
- const Settings = Icon(jsxRuntime.jsxs("svg", {
478
- xmlns: "http://www.w3.org/2000/svg",
479
- height: "24px",
480
- viewBox: "0 0 24 24",
481
- width: "24px",
482
- fill: "currentColor",
483
- children: [jsxRuntime.jsx("path", {
484
- d: "M0 0h24v24H0V0z",
485
- fill: "none"
486
- }), jsxRuntime.jsx("path", {
487
- d: "M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"
488
- })]
489
- }));
490
- const Export = Icon(jsxRuntime.jsxs("svg", {
491
- xmlns: "http://www.w3.org/2000/svg",
492
- enableBackground: "new 0 0 24 24",
493
- height: "24px",
494
- viewBox: "0 0 24 24",
495
- width: "24px",
496
- fill: "currentColor",
497
- children: [jsxRuntime.jsx("g", {
498
- children: jsxRuntime.jsx("rect", {
499
- fill: "none",
500
- height: "24",
501
- width: "24"
502
- })
503
- }), jsxRuntime.jsx("g", {
504
- children: jsxRuntime.jsx("path", {
505
- d: "M18,15v3H6v-3H4v3c0,1.1,0.9,2,2,2h12c1.1,0,2-0.9,2-2v-3H18z M17,11l-1.41-1.41L13,12.17V4h-2v8.17L8.41,9.59L7,11l5,5 L17,11z"
506
- })
507
- })]
508
- }));
509
- const Clipboard = Icon(jsxRuntime.jsxs("svg", {
510
- xmlns: "http://www.w3.org/2000/svg",
511
- height: "24px",
512
- viewBox: "0 0 24 24",
513
- width: "24px",
514
- fill: "currentColor",
515
- children: [jsxRuntime.jsx("path", {
516
- d: "M0 0h24v24H0V0z",
517
- fill: "none"
518
- }), jsxRuntime.jsx("path", {
519
- d: "M19 2h-4.18C14.4.84 13.3 0 12 0S9.6.84 9.18 2H5c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm7 18H5V4h2v3h10V4h2v16z"
520
- })]
521
- }));
522
- const ChevronRight = Icon(jsxRuntime.jsxs("svg", {
523
- xmlns: "http://www.w3.org/2000/svg",
524
- height: "24px",
525
- viewBox: "0 0 24 24",
526
- width: "24px",
527
- fill: "currentColor",
528
- children: [jsxRuntime.jsx("path", {
529
- d: "M0 0h24v24H0V0z",
530
- fill: "none"
531
- }), jsxRuntime.jsx("path", {
532
- d: "M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z"
533
- })]
534
- }));
535
- const Search = Icon(jsxRuntime.jsxs("svg", {
536
- xmlns: "http://www.w3.org/2000/svg",
537
- height: "24px",
538
- viewBox: "0 0 24 24",
539
- width: "24px",
540
- fill: "currentColor",
541
- children: [jsxRuntime.jsx("path", {
542
- d: "M0 0h24v24H0V0z",
543
- fill: "none"
544
- }), jsxRuntime.jsx("path", {
545
- d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"
546
- })]
547
- }));
548
- const Clear = Icon(jsxRuntime.jsxs("svg", {
549
- xmlns: "http://www.w3.org/2000/svg",
550
- height: "24px",
551
- viewBox: "0 0 24 24",
552
- width: "24px",
553
- fill: "currentColor",
554
- children: [jsxRuntime.jsx("path", {
555
- d: "M0 0h24v24H0V0z",
556
- fill: "none"
557
- }), jsxRuntime.jsx("path", {
558
- d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
559
- })]
560
- }));
561
- const ArrowDropDown = Icon(jsxRuntime.jsxs("svg", {
562
- xmlns: "http://www.w3.org/2000/svg",
563
- height: "24px",
564
- viewBox: "0 0 24 24",
565
- width: "24px",
566
- fill: "currentColor",
567
- children: [jsxRuntime.jsx("path", {
568
- d: "M0 0h24v24H0V0z",
569
- fill: "none"
570
- }), jsxRuntime.jsx("path", {
571
- d: "M7 10l5 5 5-5H7z"
572
- })]
573
- }));
574
- const FilterList = Icon(jsxRuntime.jsx("svg", {
575
- viewBox: "0 0 24 24",
576
- children: jsxRuntime.jsx("path", {
577
- fill: "currentColor",
578
- d: "M14,12V19.88C14.04,20.18 13.94,20.5 13.71,20.71C13.32,21.1 12.69,21.1 12.3,20.71L10.29,18.7C10.06,18.47 9.96,18.16 10,17.87V12H9.97L4.21,4.62C3.87,4.19 3.95,3.56 4.38,3.22C4.57,3.08 4.78,3 5,3V3H19V3C19.22,3 19.43,3.08 19.62,3.22C20.05,3.56 20.13,4.19 19.79,4.62L14.03,12H14Z"
579
- })
580
- }));
581
- const ArrowUpward = Icon(jsxRuntime.jsxs("svg", {
582
- xmlns: "http://www.w3.org/2000/svg",
583
- height: "24px",
584
- viewBox: "0 0 24 24",
585
- width: "24px",
586
- fill: "currentColor",
587
- children: [jsxRuntime.jsx("path", {
588
- d: "M0 0h24v24H0V0z",
589
- fill: "none"
590
- }), jsxRuntime.jsx("path", {
591
- d: "M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"
592
- })]
593
- }));
594
- const defaultIcons = {
595
- Settings,
596
- Export,
597
- Clipboard,
598
- ChevronRight,
599
- Search,
600
- Clear,
601
- ArrowDropDown,
602
- FilterList,
603
- ArrowUpward
604
- };
605
- const defaultTexts = {
606
- selectColumns: "Select visible columns",
607
- noResults: "No results",
608
- exportTitle: "Export",
609
- exportCopy: "To clipboard",
610
- exportDownload: "Download",
611
- today: "Today",
612
- thisWeek: "This week",
613
- reset: "Reset",
614
- loading: "Loading",
615
- selected: (count) => `${count} selected`
616
- };
617
- const defaultTableTheme = {
618
- text: defaultTexts,
619
- components: defaultComponents,
620
- icons: defaultIcons,
621
- colors: defaultColors,
622
- spacing: "5px"
623
- };
624
- let globalTableTheme = {};
178
+ exports.globalTableTheme = {};
625
179
  function configureTableTheme(tableTheme) {
626
- globalTableTheme = tableTheme;
180
+ exports.globalTableTheme = tableTheme;
627
181
  }
628
182
  const TableThemeContext = react$1.createContext({});
629
183
  function TableThemeProvider({
@@ -654,17 +208,14 @@ function mergeThemes(...themes) {
654
208
  spacing: themes.map((theme) => theme.spacing).reverse().find((x) => x !== void 0)
655
209
  };
656
210
  }
657
- function useTableTheme(props) {
658
- const contextTableTheme = react$1.useContext(TableThemeContext);
659
- return mergeThemes(defaultTableTheme, globalTableTheme, contextTableTheme, props);
660
- }
661
211
  exports.Popover = Popover;
662
212
  exports.PopoverContext = PopoverContext;
663
213
  exports.TableThemeContext = TableThemeContext;
664
214
  exports.TableThemeProvider = TableThemeProvider;
665
215
  exports.configureTableTheme = configureTableTheme;
216
+ exports.darkGray = darkGray;
666
217
  exports.defaultClasses = defaultClasses;
667
218
  exports.gray = gray;
219
+ exports.lightGray = lightGray;
668
220
  exports.mergeThemes = mergeThemes;
669
- exports.useTableTheme = useTableTheme;
670
221
  //# sourceMappingURL=tableTheme.js.map