chop-logic-components 0.12.1 → 0.13.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/dist/components/containers/grid/Grid.d.ts +4 -0
- package/dist/components/containers/grid/Grid.styled.d.ts +19 -0
- package/dist/components/containers/grid/__docs__/Grid.stories.d.ts +8 -0
- package/dist/components/containers/grid/__docs__/GridExample.d.ts +4 -0
- package/dist/components/containers/grid/__tests__/Body.test.d.ts +1 -0
- package/dist/components/containers/grid/__tests__/ColumnGroup.test.d.ts +1 -0
- package/dist/components/containers/grid/__tests__/Grid.test.d.ts +1 -0
- package/dist/components/containers/grid/__tests__/Head.test.d.ts +1 -0
- package/dist/components/containers/grid/__tests__/Row.test.d.ts +1 -0
- package/dist/components/containers/grid/__tests__/SelectAllRowsCell.test.d.ts +1 -0
- package/dist/components/containers/grid/__tests__/SelectRowCell.test.d.ts +1 -0
- package/dist/components/containers/grid/__tests__/helpers.test.d.ts +1 -0
- package/dist/components/containers/grid/elements/Body.d.ts +13 -0
- package/dist/components/containers/grid/elements/Checkbox.d.ts +7 -0
- package/dist/components/containers/grid/elements/ColumnGroup.d.ts +8 -0
- package/dist/components/containers/grid/elements/DataCell.d.ts +6 -0
- package/dist/components/containers/grid/elements/Head.d.ts +13 -0
- package/dist/components/containers/grid/elements/HeaderCell.d.ts +7 -0
- package/dist/components/containers/grid/elements/Row.d.ts +13 -0
- package/dist/components/containers/grid/elements/SelectAllRowsCell.d.ts +11 -0
- package/dist/components/containers/grid/elements/SelectRowCell.d.ts +11 -0
- package/dist/components/containers/grid/helpers.d.ts +7 -0
- package/dist/components/containers/grid/types.d.ts +26 -0
- package/dist/components/containers/portal/__tests__/Portal.test.d.ts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/inputs/checkbox/Checkbox.d.ts +1 -1
- package/dist/components/misc/icon/Icon.d.ts +4 -2
- package/dist/components/misc/icon/elements/ChevronDown.d.ts +4 -0
- package/dist/components/misc/icon/elements/ChevronLeft.d.ts +4 -0
- package/dist/components/misc/icon/elements/ChevronRight.d.ts +4 -0
- package/dist/components/misc/icon/elements/ChevronUp.d.ts +4 -0
- package/dist/constants/style-variables.d.ts +1 -1
- package/dist/index.cjs.js +380 -304
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +7660 -7357
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/misc/icon/elements/Down.d.ts +0 -4
- package/dist/components/misc/icon/elements/Up.d.ts +0 -4
- /package/dist/components/{misc → containers}/portal/index.d.ts +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledGrid: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, never>> & string;
|
|
3
|
+
export declare const StyledGridHeader: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, never>> & string;
|
|
4
|
+
export declare const StyledGridBody: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, never>> & string;
|
|
5
|
+
export declare const StyledGridHeaderCell: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, never>> & string;
|
|
6
|
+
export declare const StyledGridHeaderRow: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, never>> & string;
|
|
7
|
+
export declare const StyledGridCell: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, never>> & string;
|
|
8
|
+
export declare const StyledGridCaption: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
|
|
9
|
+
export declare const StyledGridRow: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, {
|
|
10
|
+
$selected: boolean;
|
|
11
|
+
}>> & string;
|
|
12
|
+
export declare const StyledGridColumn: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').ColHTMLAttributes<HTMLTableColElement>, HTMLTableColElement>, {
|
|
13
|
+
$isFirst: boolean;
|
|
14
|
+
$highlighted: boolean;
|
|
15
|
+
}>> & string;
|
|
16
|
+
export declare const StyledGridCheckboxWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
17
|
+
$disabled: boolean;
|
|
18
|
+
}>> & string;
|
|
19
|
+
export declare const StyledGridCheckboxInput: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, never>> & string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as GridExample } from './GridExample';
|
|
3
|
+
|
|
4
|
+
declare const meta: Meta<typeof GridExample>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type Story = StoryObj<typeof GridExample>;
|
|
7
|
+
export declare const DefaultGrid: Story;
|
|
8
|
+
export declare const SelectableGrid: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ChopLogicGridColumn, ChopLogicGridItem, RenderDataItemCallback } from '../types';
|
|
2
|
+
|
|
3
|
+
type ChopLogicGridBodyProps = {
|
|
4
|
+
data: ChopLogicGridItem[];
|
|
5
|
+
columns: ChopLogicGridColumn[];
|
|
6
|
+
selectedIds: string[];
|
|
7
|
+
selectRowById: (id: string) => void;
|
|
8
|
+
deselectRowById: (id: string) => void;
|
|
9
|
+
renderDataItem?: RenderDataItemCallback;
|
|
10
|
+
selectable: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare const ChopLogicGridBody: React.FC<ChopLogicGridBodyProps>;
|
|
13
|
+
export default ChopLogicGridBody;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ChopLogicGridColumn } from '../types';
|
|
2
|
+
|
|
3
|
+
type ChopLogicGridHeadProps = {
|
|
4
|
+
columns: ChopLogicGridColumn[];
|
|
5
|
+
gridId: string;
|
|
6
|
+
selectable: boolean;
|
|
7
|
+
isAllSelected: boolean;
|
|
8
|
+
isAllCheckboxDisabled?: boolean;
|
|
9
|
+
selectAll: () => void;
|
|
10
|
+
deselectAll: () => void;
|
|
11
|
+
};
|
|
12
|
+
declare const ChopLogicGridHead: React.FC<ChopLogicGridHeadProps>;
|
|
13
|
+
export default ChopLogicGridHead;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export type GridRowProps = {
|
|
4
|
+
rowId: string;
|
|
5
|
+
selectedIds: string[];
|
|
6
|
+
selectRowById: (id: string) => void;
|
|
7
|
+
deselectRowById: (id: string) => void;
|
|
8
|
+
selectable: boolean;
|
|
9
|
+
values: (string | JSX.Element)[];
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare const GridRow: React.FC<GridRowProps>;
|
|
13
|
+
export default GridRow;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
type SelectAllGridRowsCheckbox = {
|
|
4
|
+
gridId: string;
|
|
5
|
+
isAllSelected: boolean;
|
|
6
|
+
selectAll: () => void;
|
|
7
|
+
deselectAll: () => void;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const SelectAllRowsCell: React.FC<SelectAllGridRowsCheckbox>;
|
|
11
|
+
export default SelectAllRowsCell;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
type SelectAllGridRowsCheckbox = {
|
|
4
|
+
rowId: string;
|
|
5
|
+
isRowSelected: boolean;
|
|
6
|
+
selectRowById: (id: string) => void;
|
|
7
|
+
deselectRowById: (id: string) => void;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const SelectGridRowCell: React.FC<SelectAllGridRowsCheckbox>;
|
|
11
|
+
export default SelectGridRowCell;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ChopLogicGridColumn, ChopLogicGridItem, RenderDataItemCallback } from './types';
|
|
2
|
+
|
|
3
|
+
export declare function getGridRowValues({ item, columns, renderDataItem, }: {
|
|
4
|
+
item: ChopLogicGridItem;
|
|
5
|
+
columns: ChopLogicGridColumn[];
|
|
6
|
+
renderDataItem?: RenderDataItemCallback;
|
|
7
|
+
}): (string | JSX.Element)[];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type ChopLogicGridProps = {
|
|
3
|
+
columns: ChopLogicGridColumn[];
|
|
4
|
+
data: ChopLogicGridItem[];
|
|
5
|
+
caption?: string;
|
|
6
|
+
id?: string;
|
|
7
|
+
selectable?: boolean;
|
|
8
|
+
tabIndex?: number;
|
|
9
|
+
className?: string;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
renderDataItem?: RenderDataItemCallback;
|
|
12
|
+
onSelect?: (ids: string[]) => void;
|
|
13
|
+
};
|
|
14
|
+
export type ChopLogicGridColumn = {
|
|
15
|
+
field: string;
|
|
16
|
+
title?: string;
|
|
17
|
+
component?: React.ReactElement;
|
|
18
|
+
highlighted?: boolean;
|
|
19
|
+
className?: string;
|
|
20
|
+
};
|
|
21
|
+
export type ChopLogicGridItem = {
|
|
22
|
+
id: string;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
};
|
|
26
|
+
export type RenderDataItemCallback = (item: ChopLogicGridItem, field: string) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,4 +8,5 @@ export { default as ChopLogicAlert } from './modals/alert/Alert';
|
|
|
8
8
|
export { default as ChopLogicDialog } from './modals/dialog/Dialog';
|
|
9
9
|
export { default as ChopLogicTooltip } from './modals/tooltip/Tooltip';
|
|
10
10
|
export { default as ChopLogicForm } from './containers/form/Form';
|
|
11
|
+
export { default as ChopLogicGrid } from './containers/grid/Grid';
|
|
11
12
|
export { default as ChopLogicTabs } from './containers/tabs/Tabs';
|
|
@@ -3,7 +3,7 @@ import { default as React } from 'react';
|
|
|
3
3
|
export type ChopLogicCheckboxProps = React.InputHTMLAttributes<HTMLInputElement> & {
|
|
4
4
|
name: string;
|
|
5
5
|
label: string;
|
|
6
|
-
|
|
6
|
+
noLabel?: boolean;
|
|
7
7
|
iconPosition?: 'left' | 'right';
|
|
8
8
|
};
|
|
9
9
|
declare const ChopLogicCheckbox: React.FC<ChopLogicCheckboxProps>;
|
|
@@ -8,11 +8,14 @@ export declare enum CLIcon {
|
|
|
8
8
|
CheckboxChecked = "checkbox-checked",
|
|
9
9
|
CheckboxUnchecked = "checkbox-unchecked",
|
|
10
10
|
CheckMark = "check-mark",
|
|
11
|
+
ChevronDown = "chevron-down",
|
|
12
|
+
ChevronLeft = "chevron-left",
|
|
13
|
+
ChevronRight = "chevron-right",
|
|
14
|
+
ChevronUp = "chevron-up",
|
|
11
15
|
Clear = "clear",
|
|
12
16
|
Copy = "copy",
|
|
13
17
|
Cut = "cut",
|
|
14
18
|
Delete = "delete",
|
|
15
|
-
Down = "down",
|
|
16
19
|
Download = "download",
|
|
17
20
|
Error = "error",
|
|
18
21
|
Forward = "forward",
|
|
@@ -23,7 +26,6 @@ export declare enum CLIcon {
|
|
|
23
26
|
Question = "question",
|
|
24
27
|
Save = "save",
|
|
25
28
|
Show = "show",
|
|
26
|
-
Up = "up",
|
|
27
29
|
Upload = "upload",
|
|
28
30
|
Warning = "warning",
|
|
29
31
|
Remove = "remove"
|
|
@@ -19,7 +19,7 @@ export declare const UNITS: Readonly<{
|
|
|
19
19
|
minElementSize: "2.75rem";
|
|
20
20
|
smallIconSize: "1.6rem";
|
|
21
21
|
blockBorderRadius: "0.375rem";
|
|
22
|
-
|
|
22
|
+
fieldWrapperHeight: "2.125rem";
|
|
23
23
|
}>;
|
|
24
24
|
export declare const SHADOWS: Readonly<{
|
|
25
25
|
box: "rgba(0, 0, 0, 0.15) 2.4px 2.4px 3.2px";
|