@m4l/components 0.1.31 → 0.1.32
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/components/CommonActions/components/ActionCancel/{index.01a86ee6.js → index.641ea102.js} +1 -1
- package/components/CommonActions/components/ActionFormCancel/{index.e18a3161.js → index.3b9e5121.js} +2 -2
- package/components/CommonActions/components/ActionIntro/{index.fdd7e34d.js → index.d53e0d31.js} +1 -1
- package/components/CommonActions/components/Actions/{index.c87086ac.js → index.545d7067.js} +22 -24
- package/components/DataGrid/contexts/DataGridContext/index.d.ts +5 -0
- package/components/DataGrid/contexts/{BaseContext → DataGridContext}/types.d.ts +4 -16
- package/components/DataGrid/contexts/FilterContext/types.d.ts +8 -4
- package/components/DataGrid/hooks/useDataGrid.d.ts +3 -0
- package/components/DataGrid/{index.fc1ace65.js → index.b6a45f67.js} +335 -311
- package/components/DataGrid/{components → subcomponents}/Actions/index.d.ts +0 -0
- package/components/DataGrid/{components → subcomponents}/Actions/styles.d.ts +0 -0
- package/components/DataGrid/{components/Actions/components → subcomponents/Actions/subcomponents}/Density/index.d.ts +0 -0
- package/components/DataGrid/{components/Actions/components → subcomponents/Actions/subcomponents}/Density/styles.d.ts +0 -0
- package/components/DataGrid/{components/Actions/components → subcomponents/Actions/subcomponents}/Filter/index.d.ts +0 -0
- package/components/DataGrid/{components/Actions/components → subcomponents/Actions/subcomponents}/Filter/styles.d.ts +0 -0
- package/components/DataGrid/{components/Actions/components → subcomponents/Actions/subcomponents}/RowsCount/index.d.ts +0 -0
- package/components/DataGrid/{components/Actions/components → subcomponents/Actions/subcomponents}/RowsCount/styles.d.ts +0 -0
- package/components/DataGrid/{components/Actions/components → subcomponents/Actions/subcomponents}/Settings/index.d.ts +0 -0
- package/components/DataGrid/{components/Actions/components → subcomponents/Actions/subcomponents}/Settings/styles.d.ts +0 -0
- package/components/DataGrid/{components/Actions/components/Settings → subcomponents/Actions/subcomponents/Settings/subcomponents}/ColumnsConfig/index.d.ts +0 -0
- package/components/DataGrid/{components/Actions/components/Settings → subcomponents/Actions/subcomponents/Settings/subcomponents}/ColumnsConfig/styles.d.ts +0 -0
- package/components/DataGrid/{components/Actions/components/Settings/ColumnsConfig/components → subcomponents/Actions/subcomponents/Settings/subcomponents/ColumnsConfig/subcomponents}/FormatterColumn/index.d.ts +0 -0
- package/components/DataGrid/{components/Actions/components/Settings → subcomponents/Actions/subcomponents/Settings/subcomponents}/ColumnsConfig/types.d.ts +1 -1
- package/components/DataGrid/{components/Actions/components → subcomponents/Actions/subcomponents}/Settings/types.d.ts +0 -0
- package/components/DataGrid/{components → subcomponents}/Actions/types.d.ts +1 -1
- package/components/DataGrid/{components → subcomponents}/Table/hooks/getDragHeaderRenderer.d.ts +0 -0
- package/components/DataGrid/{components → subcomponents}/Table/hooks/useFocusRef.d.ts +0 -0
- package/components/DataGrid/{components → subcomponents}/Table/hooks/useSortColumnsRows.d.ts +1 -1
- package/components/DataGrid/{components → subcomponents}/Table/index.d.ts +0 -0
- package/components/DataGrid/{components → subcomponents}/Table/styles.d.ts +0 -0
- package/components/DataGrid/{components/Table/components → subcomponents/Table/subcomponents}/ActionsColumn.d.ts +0 -0
- package/components/DataGrid/{components/Table/components → subcomponents/Table/subcomponents}/CheckboxFormatter.d.ts +0 -0
- package/components/DataGrid/{components/Table/components → subcomponents/Table/subcomponents}/CustomIcons.d.ts +0 -0
- package/components/DataGrid/{components/Table/components → subcomponents/Table/subcomponents}/DraggableHeaderRenderer.d.ts +0 -0
- package/components/DataGrid/{components/Table/components → subcomponents/Table/subcomponents}/SelectColumn.d.ts +0 -0
- package/components/DataGrid/{components/Table/components → subcomponents/Table/subcomponents}/SkeletonFormatter/index.d.ts +0 -0
- package/components/DataGrid/{components/Table/components → subcomponents/Table/subcomponents}/SkeletonFormatter/styles.d.ts +0 -0
- package/components/DataGrid/{components → subcomponents}/editors/TextEditor/index.d.ts +0 -0
- package/components/DataGrid/types.d.ts +6 -4
- package/components/DataGrid/utils/getDataGridRowsFromSet.d.ts +1 -0
- package/components/DynamicFilter/{index.12df5a80.js → index.b3b19031.js} +8 -8
- package/components/ModalDialog/{index.6bec80b1.js → index.81b8e093.js} +2 -2
- package/components/ObjectLogs/{index.93488e5f.js → index.af1c3382.js} +3 -4
- package/components/Period/{index.f17be628.js → index.9ce96aed.js} +2 -2
- package/components/formatters/BooleanFormatter/{index.35185e99.js → index.81f4ea70.js} +18 -15
- package/components/formatters/PointsFormatter/index.d.ts +1 -0
- package/components/formatters/PointsFormatter/types.d.ts +3 -2
- package/components/formatters/UncertaintyFormatter/index.d.ts +1 -0
- package/components/formatters/UncertaintyFormatter/types.d.ts +4 -3
- package/components/formatters/{index.b7532df7.js → index.a0309e3a.js} +47 -50
- package/components/formatters/index.d.ts +2 -2
- package/components/hook-form/RHFPeriod/{index.e8c2c210.js → index.116158c4.js} +1 -1
- package/components/index.d.ts +2 -1
- package/components/mui_extended/Button/{index.6bdb0b2d.js → index.bd85b59c.js} +1 -1
- package/components/mui_extended/Pager/{index.66593ad3.js → index.a98c43cc.js} +1 -1
- package/components/mui_extended/Popover/{index.4c70cdba.js → index.f38042fc.js} +3 -3
- package/contexts/ModalContext/{index.6d1021d4.js → index.9a44cced.js} +3 -3
- package/hooks/useModal/{index.ee8b9d9f.js → index.2a92d33a.js} +1 -1
- package/index.js +27 -24
- package/package.json +1 -1
- package/react-data-grid.d46d625e.js +1 -1
- package/components/DataGrid/contexts/BaseContext/index.d.ts +0 -5
- package/components/DataGrid/hooks/useBase.d.ts +0 -1
package/components/CommonActions/components/ActionCancel/{index.01a86ee6.js → index.641ea102.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useModuleDictionary } from "@m4l/core";
|
|
2
|
-
import { B as Button } from "../../../mui_extended/Button/index.
|
|
2
|
+
import { B as Button } from "../../../mui_extended/Button/index.bd85b59c.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
const ActionCancel = (props) => {
|
|
5
5
|
const {
|
package/components/CommonActions/components/ActionFormCancel/{index.e18a3161.js → index.3b9e5121.js}
RENAMED
|
@@ -2,9 +2,9 @@ import { useFormContext, useFormState } from "react-hook-form";
|
|
|
2
2
|
import { useNavigate } from "react-router-dom";
|
|
3
3
|
import { useModuleDictionary, useModuleSkeleton } from "@m4l/core";
|
|
4
4
|
import { Skeleton } from "@mui/material";
|
|
5
|
-
import { B as Button } from "../../../mui_extended/Button/index.
|
|
5
|
+
import { B as Button } from "../../../mui_extended/Button/index.bd85b59c.js";
|
|
6
6
|
import { useCallback } from "react";
|
|
7
|
-
import { u as useModal } from "../../../../hooks/useModal/index.
|
|
7
|
+
import { u as useModal } from "../../../../hooks/useModal/index.2a92d33a.js";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
function ActionFormCancel(props) {
|
|
10
10
|
const {
|
package/components/CommonActions/components/ActionIntro/{index.fdd7e34d.js → index.d53e0d31.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useModuleDictionary } from "@m4l/core";
|
|
2
|
-
import { B as Button } from "../../../mui_extended/Button/index.
|
|
2
|
+
import { B as Button } from "../../../mui_extended/Button/index.bd85b59c.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
const ActionIntro = (props) => {
|
|
5
5
|
const {
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { styled } from "@mui/material/styles";
|
|
3
|
-
import { useEnvironment, useModuleDictionary } from "@m4l/core";
|
|
3
|
+
import { useEnvironment, useModuleDictionary, useModuleSkeleton } from "@m4l/core";
|
|
4
4
|
import { IconButton, Tooltip, MenuItem, Skeleton, Checkbox } from "@mui/material";
|
|
5
5
|
import "@mui/material/Button";
|
|
6
6
|
import "react-hook-form";
|
|
7
7
|
import "react-router-dom";
|
|
8
8
|
import { useState, useMemo, forwardRef, useRef, useImperativeHandle, useEffect, useCallback } from "react";
|
|
9
|
-
import "../../../../contexts/ModalContext/index.
|
|
9
|
+
import "../../../../contexts/ModalContext/index.9a44cced.js";
|
|
10
10
|
import "@mui/lab";
|
|
11
11
|
import { I as IconButton$1 } from "../../../mui_extended/IconButton/index.25ff14bd.js";
|
|
12
|
-
import { u as
|
|
13
|
-
import { P as Pager } from "../../../mui_extended/Pager/index.
|
|
12
|
+
import { u as useDataGrid, a as useFilters, O as OriginalDataGridWrapperStyled } from "../../../DataGrid/index.b6a45f67.js";
|
|
13
|
+
import { P as Pager } from "../../../mui_extended/Pager/index.a98c43cc.js";
|
|
14
14
|
import { D as DataGrid$1 } from "../../../../react-data-grid.d46d625e.js";
|
|
15
|
-
import { u as useModal } from "../../../../hooks/useModal/index.
|
|
16
|
-
import { A as ActionCancel } from "../ActionCancel/index.
|
|
17
|
-
import { A as ActionIntro } from "../ActionIntro/index.
|
|
18
|
-
import { P as Popover } from "../../../mui_extended/Popover/index.
|
|
15
|
+
import { u as useModal } from "../../../../hooks/useModal/index.2a92d33a.js";
|
|
16
|
+
import { A as ActionCancel } from "../ActionCancel/index.641ea102.js";
|
|
17
|
+
import { A as ActionIntro } from "../ActionIntro/index.d53e0d31.js";
|
|
18
|
+
import { P as Popover } from "../../../mui_extended/Popover/index.f38042fc.js";
|
|
19
19
|
import { I as Icon } from "../../../Icon/index.619fa9ad.js";
|
|
20
20
|
import { useResponsiveDesktop } from "@m4l/graphics";
|
|
21
21
|
const WrapperStandarActions = styled("div")(({
|
|
@@ -219,7 +219,7 @@ const ACTIONS_COLUMN_KEY = "actions-row";
|
|
|
219
219
|
function ActionsFormatter(props) {
|
|
220
220
|
const {
|
|
221
221
|
rowActionsGetter
|
|
222
|
-
} =
|
|
222
|
+
} = useDataGrid();
|
|
223
223
|
if (rowActionsGetter === void 0) {
|
|
224
224
|
return /* @__PURE__ */ jsx(Fragment, {});
|
|
225
225
|
}
|
|
@@ -260,9 +260,7 @@ const SKTWrapperFilter = styled("div")(({
|
|
|
260
260
|
height: theme.spacing(3.75)
|
|
261
261
|
}));
|
|
262
262
|
function Filter() {
|
|
263
|
-
const
|
|
264
|
-
isSkeleton
|
|
265
|
-
} = useBase();
|
|
263
|
+
const isSkeleton = useModuleSkeleton();
|
|
266
264
|
const {
|
|
267
265
|
activeFilters,
|
|
268
266
|
setActiveFilters
|
|
@@ -612,9 +610,8 @@ function Settings() {
|
|
|
612
610
|
} = useModal();
|
|
613
611
|
const {
|
|
614
612
|
columnsConfig,
|
|
615
|
-
onChangeColumnsConfig
|
|
616
|
-
|
|
617
|
-
} = useBase();
|
|
613
|
+
onChangeColumnsConfig
|
|
614
|
+
} = useDataGrid();
|
|
618
615
|
const {
|
|
619
616
|
getLabel
|
|
620
617
|
} = useModuleDictionary();
|
|
@@ -622,6 +619,7 @@ function Settings() {
|
|
|
622
619
|
host_static_assets,
|
|
623
620
|
environment_assets
|
|
624
621
|
} = useEnvironment();
|
|
622
|
+
const isSkeleton = useModuleSkeleton();
|
|
625
623
|
const ref = useRef(null);
|
|
626
624
|
const onCloseSettings = useCallback(() => {
|
|
627
625
|
closeModal();
|
|
@@ -683,12 +681,12 @@ const InsetLabel = styled("span")(({ theme }) => ({
|
|
|
683
681
|
}));
|
|
684
682
|
function RowsCount() {
|
|
685
683
|
const {
|
|
686
|
-
rowsCount
|
|
687
|
-
|
|
688
|
-
} = useBase();
|
|
684
|
+
rowsCount
|
|
685
|
+
} = useDataGrid();
|
|
689
686
|
const {
|
|
690
687
|
getLabel
|
|
691
688
|
} = useModuleDictionary();
|
|
689
|
+
const isSkeleton = useModuleSkeleton();
|
|
692
690
|
if (isSkeleton) {
|
|
693
691
|
return /* @__PURE__ */ jsxs(Container, {
|
|
694
692
|
children: [/* @__PURE__ */ jsx(RowsLabel, {
|
|
@@ -737,12 +735,12 @@ function Density() {
|
|
|
737
735
|
const {
|
|
738
736
|
rowHeights,
|
|
739
737
|
currentRowHeightVariant,
|
|
740
|
-
setRowHeightVariant
|
|
741
|
-
|
|
742
|
-
} = useBase();
|
|
738
|
+
setRowHeightVariant
|
|
739
|
+
} = useDataGrid();
|
|
743
740
|
const {
|
|
744
741
|
getLabel
|
|
745
742
|
} = useModuleDictionary();
|
|
743
|
+
const isSkeleton = useModuleSkeleton();
|
|
746
744
|
const menuActions = useMemo(() => {
|
|
747
745
|
if (typeof rowHeights === "number") {
|
|
748
746
|
return [];
|
|
@@ -831,9 +829,9 @@ const WrapperActions = styled("div")(({ theme }) => ({
|
|
|
831
829
|
function Actions(props) {
|
|
832
830
|
const isDesktop = useResponsiveDesktop();
|
|
833
831
|
const {
|
|
834
|
-
rowHeights
|
|
835
|
-
|
|
836
|
-
|
|
832
|
+
rowHeights
|
|
833
|
+
} = useDataGrid();
|
|
834
|
+
const isSkeleton = useModuleSkeleton();
|
|
837
835
|
const {
|
|
838
836
|
withRowsCount = true,
|
|
839
837
|
withPager = true,
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DataGridContextProps, DataGridProviderProps } from './types';
|
|
3
|
+
declare const DataGridContext: import("react").Context<DataGridContextProps<any, any> | null>;
|
|
4
|
+
declare function DataGridProvider<TRow, TSummaryRow>(props: DataGridProviderProps<TRow, TSummaryRow>): JSX.Element;
|
|
5
|
+
export { DataGridProvider, DataGridContext };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { MenuAction } from '../../../mui_extended/MenuActions/types';
|
|
2
1
|
import { ReactNode } from 'react';
|
|
3
|
-
import { Column } from 'react-data-grid';
|
|
4
2
|
import { Maybe } from '@m4l/core';
|
|
5
|
-
import { RowKey,
|
|
3
|
+
import { RowKey, RowHeightVariants, GridProps } from '../../types';
|
|
6
4
|
export interface IConfigColumn {
|
|
7
5
|
key: string;
|
|
8
6
|
visible: boolean;
|
|
@@ -18,29 +16,19 @@ export interface IGridConfig {
|
|
|
18
16
|
columnsConfig: IConfigColumn[];
|
|
19
17
|
columnsWidths: Map<string, Maybe<RowKey>>;
|
|
20
18
|
}
|
|
21
|
-
export
|
|
19
|
+
export interface DataGridProviderProps<TRow, TSummaryRow> extends Pick<GridProps<TRow, TSummaryRow>, 'rows' | 'columns' | 'rowActionsGetter' | 'rowHeaderHeights' | 'rowHeights' | 'initialRowHeightVariant' | 'checkedRows' | 'onCheckedRowsChange' | 'rowKeyGetter'> {
|
|
22
20
|
id: number | string;
|
|
23
|
-
isSkeleton: boolean;
|
|
24
21
|
children: ReactNode;
|
|
25
|
-
columns: readonly Column<TRow, TSummaryRow>[];
|
|
26
22
|
remoteConfig?: IGridConfig;
|
|
27
23
|
rowsCount: number;
|
|
28
|
-
|
|
29
|
-
rowHeaderHeights: RowHeights;
|
|
30
|
-
rowHeights: RowHeights;
|
|
31
|
-
initialRowHeightVariant: RowHeightVariants;
|
|
32
|
-
};
|
|
24
|
+
}
|
|
33
25
|
export declare type RowHeightState = {
|
|
34
26
|
rowHVariant: RowHeightVariants;
|
|
35
27
|
rowHeight: number;
|
|
36
28
|
rowHeaderHeight: number;
|
|
37
29
|
};
|
|
38
|
-
export interface
|
|
39
|
-
rowsCount: number;
|
|
40
|
-
isSkeleton: boolean;
|
|
30
|
+
export interface DataGridContextProps<TRow, TSummaryRow> extends IGridConfig, Pick<DataGridProviderProps<TRow, TSummaryRow>, 'rows' | 'checkedRows' | 'onCheckedRowsChange' | 'rowHeights' | 'rowsCount' | 'rowActionsGetter' | 'rowKeyGetter'> {
|
|
41
31
|
setRowsCount: (newRowsCount: number) => void;
|
|
42
|
-
rowActionsGetter?: ((row: any) => MenuAction[]) | undefined;
|
|
43
|
-
rowHeights: RowHeights;
|
|
44
32
|
currentRowHeaderHeight: number;
|
|
45
33
|
currentRowHeight: number;
|
|
46
34
|
currentRowHeightVariant: RowHeightVariants;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Column } from 'react-data-grid';
|
|
2
|
+
export interface ColumnFilter {
|
|
3
|
+
value: string;
|
|
4
|
+
customFilter?: (row: any, value: string) => boolean;
|
|
5
|
+
}
|
|
2
6
|
export interface FilterContextProps {
|
|
3
7
|
activeFilters: boolean;
|
|
4
|
-
filters?: Map<
|
|
5
|
-
onChangeFilter?: (
|
|
8
|
+
filters?: Map<string, ColumnFilter>;
|
|
9
|
+
onChangeFilter?: (column: Column<any, any>, value: string) => void;
|
|
6
10
|
setActiveFilters: (active: boolean) => void;
|
|
7
11
|
}
|
|
8
12
|
export interface IFilterState {
|
|
9
13
|
activeFilters: boolean;
|
|
10
|
-
filters?: Map<
|
|
14
|
+
filters?: Map<string, ColumnFilter>;
|
|
11
15
|
}
|