@dartech/arsenal-ui 1.4.75 → 1.4.76

Sign up to get free protection for your applications and to get access to all the features.
package/index.js CHANGED
@@ -1,5 +1,13 @@
1
1
  import { createTheme, responsiveFontSizes, styled, ThemeProvider } from '@mui/material/styles';
2
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
+ import { __rest, __awaiter } from 'tslib';
4
+ import TextField from '@mui/material/TextField';
5
+ import MenuItem from '@mui/material/MenuItem';
6
+ import React, { useRef, useEffect, useState, useCallback, useMemo, createElement, forwardRef, createContext, useContext, memo, useImperativeHandle, Suspense } from 'react';
7
+ import { useController, useWatch, useFormContext, Controller, useFieldArray, useForm } from 'react-hook-form';
8
+ import SvgIcon from '@mui/material/SvgIcon';
9
+ import IconButton from '@mui/material/IconButton';
10
+ import InputAdornment from '@mui/material/InputAdornment';
3
11
  import Button from '@mui/material/Button';
4
12
  import Dialog from '@mui/material/Dialog';
5
13
  import DialogActions from '@mui/material/DialogActions';
@@ -8,15 +16,7 @@ import DialogContentText from '@mui/material/DialogContentText';
8
16
  import DialogTitle from '@mui/material/DialogTitle';
9
17
  import Box from '@mui/material/Box';
10
18
  import Typography from '@mui/material/Typography';
11
- import IconButton from '@mui/material/IconButton';
12
- import SvgIcon from '@mui/material/SvgIcon';
13
19
  import CircularProgress from '@mui/material/CircularProgress';
14
- import { __rest, __awaiter } from 'tslib';
15
- import { useController, useWatch, useFormContext, Controller, useFieldArray, useForm } from 'react-hook-form';
16
- import TextField from '@mui/material/TextField';
17
- import React, { useRef, useEffect, useState, useCallback, useMemo, createElement, forwardRef, createContext, useContext, memo, useImperativeHandle, Suspense } from 'react';
18
- import MenuItem from '@mui/material/MenuItem';
19
- import InputAdornment from '@mui/material/InputAdornment';
20
20
  import FormControl from '@mui/material/FormControl';
21
21
  import FormControlLabel from '@mui/material/FormControlLabel';
22
22
  import FormHelperText from '@mui/material/FormHelperText';
@@ -456,17 +456,13 @@ const ControlDebouncedInput = _a => {
456
456
  }));
457
457
  };
458
458
 
459
- const PopupIconComponent$2 = () => {
460
- return jsx(SvgIcon, Object.assign({
461
- sx: {
462
- mr: 2
463
- }
464
- }, {
459
+ const PopupIconComponent$1 = () => {
460
+ return jsx(SvgIcon, {
465
461
  children: jsx("path", {
466
462
  d: "M4.22032 8.46991C4.36094 8.32946 4.55157 8.25057 4.75032 8.25057C4.94907 8.25057 5.13969 8.32946 5.28032 8.46991L12.0003 15.1899L18.7203 8.46991C18.789 8.39622 18.8718 8.33712 18.9638 8.29613C19.0558 8.25514 19.1551 8.23309 19.2558 8.23132C19.3565 8.22954 19.4565 8.24807 19.5499 8.28579C19.6433 8.32351 19.7281 8.37965 19.7994 8.45087C19.8706 8.52209 19.9267 8.60692 19.9644 8.70031C20.0022 8.7937 20.0207 8.89373 20.0189 8.99443C20.0171 9.09513 19.9951 9.19445 19.9541 9.28645C19.9131 9.37845 19.854 9.46125 19.7803 9.52991L12.5303 16.7799C12.3897 16.9204 12.1991 16.9992 12.0003 16.9992C11.8016 16.9992 11.6109 16.9204 11.4703 16.7799L4.22032 9.52991C4.07987 9.38928 4.00098 9.19866 4.00098 8.99991C4.00098 8.80116 4.07987 8.61054 4.22032 8.46991Z",
467
463
  fill: "#8B8C9E"
468
464
  })
469
- }));
465
+ });
470
466
  };
471
467
  /**
472
468
  * Material UI `Select` controlled component. Used with react-hook-form
@@ -576,7 +572,6 @@ const ControlSelect = _a => {
576
572
  })) : null
577
573
  }, textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.InputProps),
578
574
  SelectProps: {
579
- IconComponent: PopupIconComponent$2,
580
575
  sx: {
581
576
  '& .MuiSelect-select .notranslate::after': textFieldProps.placeholder ? {
582
577
  content: `"${textFieldProps.placeholder}"`,
@@ -790,19 +785,10 @@ const useAutocomplete = ({
790
785
  };
791
786
  var useAutocomplete$1 = useAutocomplete;
792
787
 
793
- var img$7 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M4.22032 8.46991C4.36094 8.32946 4.55157 8.25057 4.75032 8.25057C4.94907 8.25057 5.13969 8.32946 5.28032 8.46991L12.0003 15.1899L18.7203 8.46991C18.789 8.39622 18.8718 8.33712 18.9638 8.29613C19.0558 8.25514 19.1551 8.23309 19.2558 8.23132C19.3565 8.22954 19.4565 8.24807 19.5499 8.28579C19.6433 8.32351 19.7281 8.37965 19.7994 8.45087C19.8706 8.52209 19.9267 8.60692 19.9644 8.70031C20.0022 8.7937 20.0207 8.89373 20.0189 8.99443C20.0171 9.09513 19.9951 9.19445 19.9541 9.28645C19.9131 9.37845 19.854 9.46125 19.7803 9.52991L12.5303 16.7799C12.3897 16.9204 12.1991 16.9992 12.0003 16.9992C11.8016 16.9992 11.6109 16.9204 11.4703 16.7799L4.22032 9.52991C4.07987 9.38928 4.00098 9.19866 4.00098 8.99991C4.00098 8.80116 4.07987 8.61054 4.22032 8.46991Z' fill='%238B8C9E'/%3e%3c/svg%3e";
794
- var PopupIcon = img$7;
795
-
796
788
  /**
797
789
  * Material UI `Autocomplete` controlled component. Used with react-hook-form
798
790
  * @category Forms
799
791
  */
800
- const PopupIconComponent$1 = () => {
801
- return jsx("img", {
802
- src: PopupIcon,
803
- alt: ""
804
- });
805
- };
806
792
  const ControlAutocomplete = _a => {
807
793
  var {
808
794
  control,
@@ -879,7 +865,6 @@ const ControlAutocomplete = _a => {
879
865
  filterSelectedOptions: multiple,
880
866
  onChange: customOnChange ? customOnChange : handleChange,
881
867
  renderOption: renderOption,
882
- popupIcon: jsx(PopupIconComponent$1, {}),
883
868
  renderInput: params => {
884
869
  return jsx(TextField, Object.assign({}, params, {
885
870
  variant: "outlined",
@@ -913,6 +898,9 @@ const ControlAutocomplete = _a => {
913
898
  }, autocompleteProps));
914
899
  };
915
900
 
901
+ var img$7 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M4.22032 8.46991C4.36094 8.32946 4.55157 8.25057 4.75032 8.25057C4.94907 8.25057 5.13969 8.32946 5.28032 8.46991L12.0003 15.1899L18.7203 8.46991C18.789 8.39622 18.8718 8.33712 18.9638 8.29613C19.0558 8.25514 19.1551 8.23309 19.2558 8.23132C19.3565 8.22954 19.4565 8.24807 19.5499 8.28579C19.6433 8.32351 19.7281 8.37965 19.7994 8.45087C19.8706 8.52209 19.9267 8.60692 19.9644 8.70031C20.0022 8.7937 20.0207 8.89373 20.0189 8.99443C20.0171 9.09513 19.9951 9.19445 19.9541 9.28645C19.9131 9.37845 19.854 9.46125 19.7803 9.52991L12.5303 16.7799C12.3897 16.9204 12.1991 16.9992 12.0003 16.9992C11.8016 16.9992 11.6109 16.9204 11.4703 16.7799L4.22032 9.52991C4.07987 9.38928 4.00098 9.19866 4.00098 8.99991C4.00098 8.80116 4.07987 8.61054 4.22032 8.46991Z' fill='%238B8C9E'/%3e%3c/svg%3e";
902
+ var PopupIcon = img$7;
903
+
916
904
  const PopupIconComponent = () => {
917
905
  return jsx("img", {
918
906
  src: PopupIcon,
@@ -1602,11 +1590,26 @@ var baseTheme = createTheme(baseThemeOptions);
1602
1590
 
1603
1591
  const inputThemeOptions = {
1604
1592
  components: {
1593
+ // MuiButtonBase: {
1594
+ // defaultProps: {
1595
+ // disableElevation: true
1596
+ // },
1597
+ // styleOverrides: {
1598
+ // root: {
1599
+ // '&.MuiButton-root': {
1600
+ // // boxShadow: 'none',
1601
+ // // lineHeight: 1.429
1602
+ // },
1603
+ // '&.MuiButton-root:hover': {
1604
+ // // boxShadow: 'none',
1605
+ // backgroundColor: '#D15C3B'
1606
+ // }
1607
+ // }
1608
+ // }
1609
+ // },
1605
1610
  MuiButton: {
1606
- styleOverrides: {
1607
- root: {
1608
- lineHeight: 1.429
1609
- }
1611
+ defaultProps: {
1612
+ disableElevation: true
1610
1613
  }
1611
1614
  },
1612
1615
  MuiInputBase: {
@@ -1615,7 +1618,8 @@ const inputThemeOptions = {
1615
1618
  color: '#262842',
1616
1619
  borderRadius: baseTheme.spacing(3),
1617
1620
  minWidth: baseTheme.spacing(25),
1618
- background: baseTheme.palette.background.default
1621
+ background: baseTheme.palette.background.default,
1622
+ paddingRight: baseTheme.spacing(3)
1619
1623
  // height: 40
1620
1624
  },
1621
1625
 
@@ -1631,6 +1635,9 @@ const inputThemeOptions = {
1631
1635
  },
1632
1636
 
1633
1637
  MuiSelect: {
1638
+ defaultProps: {
1639
+ IconComponent: PopupIconComponent$1
1640
+ },
1634
1641
  styleOverrides: {
1635
1642
  nativeInput: {
1636
1643
  padding: 0,
@@ -1675,7 +1682,15 @@ const inputThemeOptions = {
1675
1682
  }
1676
1683
  },
1677
1684
  MuiAutocomplete: {
1685
+ defaultProps: {
1686
+ popupIcon: jsx(PopupIconComponent$1, {})
1687
+ },
1678
1688
  styleOverrides: {
1689
+ root: {
1690
+ '& .MuiOutlinedInput-root .MuiAutocomplete-endAdornment': {
1691
+ right: 12
1692
+ }
1693
+ },
1679
1694
  paper: {
1680
1695
  marginTop: 8,
1681
1696
  borderRadius: 12,
@@ -3647,24 +3662,26 @@ const SortDescIconComponent$1 = () => {
3647
3662
  alt: ""
3648
3663
  });
3649
3664
  };
3650
- const Table = ({
3651
- columns,
3652
- rows,
3653
- rowCount,
3654
- loading,
3655
- disableMargin,
3656
- mode: _mode = 'server',
3657
- initialPageSize: _initialPageSize = 10,
3658
- pagination: _pagination = true,
3659
- onCellClick
3660
- }) => {
3665
+ const Table = _a => {
3666
+ var {
3667
+ columns,
3668
+ rows,
3669
+ rowCount,
3670
+ loading,
3671
+ disableMargin,
3672
+ mode = 'server',
3673
+ initialPageSize = 10,
3674
+ pagination = true,
3675
+ onCellClick
3676
+ } = _a,
3677
+ dataGridProps = __rest(_a, ["columns", "rows", "rowCount", "loading", "disableMargin", "mode", "initialPageSize", "pagination", "onCellClick"]);
3661
3678
  const {
3662
3679
  page,
3663
3680
  size,
3664
3681
  onPageChange,
3665
3682
  onSizeChange
3666
3683
  } = useTableQueryPagination$1({
3667
- mode: _mode
3684
+ mode
3668
3685
  });
3669
3686
  const {
3670
3687
  onColumnHeaderClick,
@@ -3673,12 +3690,12 @@ const Table = ({
3673
3690
  const {
3674
3691
  pageSize,
3675
3692
  handlePageSizeChange
3676
- } = usePagination$1(_initialPageSize);
3693
+ } = usePagination$1(initialPageSize);
3677
3694
  const tableProps = {
3678
- sortingMode: _mode,
3679
- paginationMode: _mode,
3680
- pageSize: _mode === 'server' ? size : _pagination ? pageSize : rowCount,
3681
- onPageSizeChange: _mode === 'server' ? onSizeChange : handlePageSizeChange,
3695
+ sortingMode: mode,
3696
+ paginationMode: mode,
3697
+ pageSize: mode === 'server' ? size : pagination ? pageSize : rowCount,
3698
+ onPageSizeChange: mode === 'server' ? onSizeChange : handlePageSizeChange,
3682
3699
  components: {
3683
3700
  BaseTooltip: Tooltip,
3684
3701
  Pagination: TablePagination$1,
@@ -3696,7 +3713,7 @@ const Table = ({
3696
3713
  }
3697
3714
  }
3698
3715
  };
3699
- if (_mode === 'server') {
3716
+ if (mode === 'server') {
3700
3717
  // tableProps['sortModel'] = [];
3701
3718
  tableProps['onColumnHeaderClick'] = onColumnHeaderClick;
3702
3719
  tableProps['page'] = page;
@@ -3708,8 +3725,8 @@ const Table = ({
3708
3725
  }, {
3709
3726
  children: jsx(StyledDataGrid, Object.assign({
3710
3727
  autoHeight: true,
3711
- hideFooterPagination: !_pagination,
3712
- hideFooter: !_pagination,
3728
+ hideFooterPagination: !pagination,
3729
+ hideFooter: !pagination,
3713
3730
  disableSelectionOnClick: true,
3714
3731
  showColumnRightBorder: true,
3715
3732
  showCellRightBorder: true,
@@ -3720,7 +3737,7 @@ const Table = ({
3720
3737
  rowCount: rowCount,
3721
3738
  rowsPerPageOptions: [10, 20, 50, 100],
3722
3739
  onCellClick: onCellClick
3723
- }, tableProps))
3740
+ }, tableProps, dataGridProps))
3724
3741
  }));
3725
3742
  };
3726
3743
 
@@ -8379,4 +8396,4 @@ const OverflowTip = ({
8379
8396
  }));
8380
8397
  };
8381
8398
 
8382
- export { AlertDialog, BackButton, Breadcrumbs, ContentLayout, ControlAceEditor, ControlArrayInput, ControlAutocomplete, ControlCheckbox, ControlDate, ControlDateTime, ControlDebouncedInput, ControlInput, ControlNumberInput, ControlPeriodInput, ControlPhoneInput, ControlQueryAutocomplete, ControlRadio, ControlSelect, ControlSwitch, ControlTime, CopyButton, CreateDefinition, CreatePropertiesList, CreatePropertiesListContext, CreatePropertyFormFields, DATE_DEFAULT_FORMAT, DATE_TIME_DEFAULT_FORMAT, DEFAULT_DATE_VALIDATION_ERROR_TEXT, DEFAULT_ERROR_TEXT, DEFAULT_REQUIRED_ERROR_TEXT, DefinitionFiller, DefinitionValueView, InfoItem, JsonModalView, JsonPathPicker, JsonView, Loader, MenuIcon, MultiplePropertyFiller, OverflowTip, PropertyFiller, PropertyType, PropertyValueField, RoundingMode, RouteTabs, Sidebar, SimpleTable, Status, StepperView, TIME_DEFAULT_FORMAT, TabPanel, Table, TableAction, TableActionCell, ViewPropertiesList, ViewProperty, capitalize, deepParseJson, defaultDefinitionArrayValue, defaultDefinitionObjectValue, digitsOnly, floatsOnly, formatDefinitionData, formatTableRowValue, getDemPropertyDateFormat, getEntityStarterValue, getJsonStringValue, getMultiplePropertyFillOptions, getSinglePropertyFillOptions, isDateType, isExpression, isPropertyValueEmpty, numberFormat, propertiesArrayToObject, propertiesObjectToArray, removeArrayItem, safeParseJson, sortArrayOfObjects, theme, useDebounce, useToggle, validateJson };
8399
+ export { AlertDialog, BackButton, Breadcrumbs, ContentLayout, ControlAceEditor, ControlArrayInput, ControlAutocomplete, ControlCheckbox, ControlDate, ControlDateTime, ControlDebouncedInput, ControlInput, ControlNumberInput, ControlPeriodInput, ControlPhoneInput, ControlQueryAutocomplete, ControlRadio, ControlSelect, ControlSwitch, ControlTime, CopyButton, CreateDefinition, CreatePropertiesList, CreatePropertiesListContext, CreatePropertyFormFields, DATE_DEFAULT_FORMAT, DATE_TIME_DEFAULT_FORMAT, DEFAULT_DATE_VALIDATION_ERROR_TEXT, DEFAULT_ERROR_TEXT, DEFAULT_REQUIRED_ERROR_TEXT, DefinitionFiller, DefinitionValueView, InfoItem, JsonModalView, JsonPathPicker, JsonView, Loader, MenuIcon, MultiplePropertyFiller, OverflowTip, PopupIconComponent$1 as PopupIconComponent, PropertyFiller, PropertyType, PropertyValueField, RoundingMode, RouteTabs, Sidebar, SimpleTable, Status, StepperView, TIME_DEFAULT_FORMAT, TabPanel, Table, TableAction, TableActionCell, ViewPropertiesList, ViewProperty, capitalize, deepParseJson, defaultDefinitionArrayValue, defaultDefinitionObjectValue, digitsOnly, floatsOnly, formatDefinitionData, formatTableRowValue, getDemPropertyDateFormat, getEntityStarterValue, getJsonStringValue, getMultiplePropertyFillOptions, getSinglePropertyFillOptions, isDateType, isExpression, isPropertyValueEmpty, numberFormat, propertiesArrayToObject, propertiesObjectToArray, removeArrayItem, safeParseJson, sortArrayOfObjects, theme, useDebounce, useToggle, validateJson };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dartech/arsenal-ui",
3
- "version": "1.4.75",
3
+ "version": "1.4.76",
4
4
  "author": "DAR",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -66,5 +66,9 @@ export type ControlAutocompleteProps = Omit<AutocompleteProps<unknown, boolean,
66
66
  startAdornment?: InputProps['startAdornment'];
67
67
  endAdornment?: InputProps['endAdornment'];
68
68
  };
69
+ /**
70
+ * Material UI `Autocomplete` controlled component. Used with react-hook-form
71
+ * @category Forms
72
+ */
69
73
  export declare const ControlAutocomplete: ({ control, validate, name, label, required, defaultValue, disabled, hideErrorMessage, onChange: customOnChange, labelKey, valueKey, options, multiple, textFieldProps, disableCloseOnSelect, useStringValue, requiredErrorText, startAdornment, endAdornment, ...autocompleteProps }: ControlAutocompleteProps) => JSX.Element;
70
74
  export default ControlAutocomplete;
@@ -63,6 +63,7 @@ export type ControlSelectProps = TextFieldProps & {
63
63
  */
64
64
  requiredErrorText?: string;
65
65
  };
66
+ export declare const PopupIconComponent: () => JSX.Element;
66
67
  /**
67
68
  * Material UI `Select` controlled component. Used with react-hook-form
68
69
  * @category Forms
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Control } from 'react-hook-form';
3
2
  type Props = {
4
3
  control: Control<any>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  type Props = {
3
2
  name: string;
4
3
  label?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  type Props = {
3
2
  name: string;
4
3
  format: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  type Props = {
3
2
  name: string;
4
3
  label?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  type Props = {
3
2
  name: string;
4
3
  label?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { PropertyUnion } from '../../../interfaces';
3
2
  type PropertyItemProps = {
4
3
  property: PropertyUnion;
@@ -1,5 +1,5 @@
1
1
  import React, { Ref } from 'react';
2
- import { GridCellParams, GridColumns, GridFeatureMode, GridRowsProp } from '@mui/x-data-grid';
2
+ import { GridCellParams, GridColumns, GridFeatureMode, GridRowsProp, GridRowParams, GridCallbackDetails } from '@mui/x-data-grid';
3
3
  /**
4
4
  * This interface is referencing the [[Table]] component props.
5
5
  * @category Common UI components
@@ -38,9 +38,10 @@ export interface TableProps {
38
38
  * (params: GridCellParams, event: React.MouseEvent) => void;
39
39
  * ```
40
40
  */
41
- onCellClick?: (params: GridCellParams, event: React.MouseEvent) => void;
41
+ onCellClick?: (params: GridCellParams, event: React.MouseEvent, details: GridCallbackDetails) => void;
42
+ onRowClick?: (params: GridRowParams, event: React.MouseEvent, details: GridCallbackDetails) => void;
42
43
  pagination?: boolean;
43
44
  refProp?: Ref<unknown>;
44
45
  }
45
- export declare const Table: ({ columns, rows, rowCount, loading, disableMargin, mode, initialPageSize, pagination, onCellClick, }: TableProps) => JSX.Element;
46
+ export declare const Table: ({ columns, rows, rowCount, loading, disableMargin, mode, initialPageSize, pagination, onCellClick, ...dataGridProps }: TableProps) => JSX.Element;
46
47
  export default Table;
@@ -1,10 +1,9 @@
1
+ /// <reference types="react" />
1
2
  declare const inputThemeOptions: {
2
3
  components: {
3
4
  MuiButton: {
4
- styleOverrides: {
5
- root: {
6
- lineHeight: number;
7
- };
5
+ defaultProps: {
6
+ disableElevation: boolean;
8
7
  };
9
8
  };
10
9
  MuiInputBase: {
@@ -14,6 +13,7 @@ declare const inputThemeOptions: {
14
13
  borderRadius: string;
15
14
  minWidth: string;
16
15
  background: string;
16
+ paddingRight: string;
17
17
  };
18
18
  input: {
19
19
  minWidth: string;
@@ -21,6 +21,9 @@ declare const inputThemeOptions: {
21
21
  };
22
22
  };
23
23
  MuiSelect: {
24
+ defaultProps: {
25
+ IconComponent: () => JSX.Element;
26
+ };
24
27
  styleOverrides: {
25
28
  nativeInput: {
26
29
  padding: number;
@@ -65,7 +68,15 @@ declare const inputThemeOptions: {
65
68
  };
66
69
  };
67
70
  MuiAutocomplete: {
71
+ defaultProps: {
72
+ popupIcon: JSX.Element;
73
+ };
68
74
  styleOverrides: {
75
+ root: {
76
+ '& .MuiOutlinedInput-root .MuiAutocomplete-endAdornment': {
77
+ right: number;
78
+ };
79
+ };
69
80
  paper: {
70
81
  marginTop: number;
71
82
  borderRadius: number;