@oc-digital/react-component-library 5.2.0-beta.8 → 6.0.0-beta.1
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/build/EditableTable/EditableTable.types.d.ts +2 -6
- package/build/EditableTable/components/TableTextInput.d.ts +5 -4
- package/build/EditableTable/components/utils/getTextWidth.d.ts +1 -1
- package/build/TextField/TextField.d.ts +2 -2
- package/build/assets/index-DCUzKTQq.css +78 -0
- package/build/index.js +1 -10
- package/build/index.js.map +1 -1
- package/package.json +7 -5
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CellProps, HeaderGroup, Row, TableBodyPropGetter, TableBodyProps, TablePropGetter, TableProps } from "react-table";
|
|
2
2
|
import { SchemaOf } from "yup";
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { VirtualItem } from "react-virtual/types";
|
|
5
4
|
export type IAlignment = "left" | "right" | "inherit" | "center" | "justify";
|
|
6
5
|
export type RowData = {
|
|
7
6
|
[key: string]: any;
|
|
@@ -70,8 +69,8 @@ export interface IEssentialRenderFnProps {
|
|
|
70
69
|
value: TableCellValues;
|
|
71
70
|
onChange: (e: any) => void;
|
|
72
71
|
onBlur: any;
|
|
73
|
-
prefix?: React.ReactNode | React.JSXElementConstructor<any
|
|
74
|
-
suffix?: React.ReactNode | React.JSXElementConstructor<any
|
|
72
|
+
prefix?: React.ReactNode | React.JSXElementConstructor<any> | Element;
|
|
73
|
+
suffix?: React.ReactNode | React.JSXElementConstructor<any> | Element;
|
|
75
74
|
numberField?: boolean;
|
|
76
75
|
textAlign?: IAlignment;
|
|
77
76
|
fixedDecimalScale?: boolean;
|
|
@@ -92,9 +91,6 @@ export interface ITableContentProps extends Pick<IEditableTableProps, "disabled"
|
|
|
92
91
|
rowsToRender: Row<RowData>[];
|
|
93
92
|
disabled: boolean;
|
|
94
93
|
includeRowSelect: boolean;
|
|
95
|
-
paddingTop: number;
|
|
96
|
-
paddingBottom: number;
|
|
97
|
-
virtualRows: VirtualItem[];
|
|
98
94
|
isAllRowsSelected: boolean;
|
|
99
95
|
selectedFlatRows: Row<RowData>[];
|
|
100
96
|
}
|
|
@@ -4,12 +4,13 @@ export interface ITableTextInputProps {
|
|
|
4
4
|
value: string | number | null | undefined;
|
|
5
5
|
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
6
6
|
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
7
|
-
prefix?: string | JSX.Element | null;
|
|
8
|
-
suffix?: string | JSX.Element | null;
|
|
9
|
-
textAlign?: "left" | "right" | "center";
|
|
7
|
+
prefix?: string | React.ReactElement | JSX.Element | null;
|
|
8
|
+
suffix?: string | React.ReactElement | JSX.Element | null;
|
|
9
|
+
textAlign?: "start" | "end" | "left" | "right" | "center" | "justify" | "match-parent" | "inherit";
|
|
10
10
|
numberField?: boolean;
|
|
11
11
|
fixedDecimalScale?: boolean;
|
|
12
12
|
error?: string | false;
|
|
13
13
|
disabled?: boolean;
|
|
14
|
+
fullWidth?: boolean;
|
|
14
15
|
}
|
|
15
|
-
export declare const TableTextInput: ({ name, value, onChange, onBlur, prefix, suffix, textAlign, numberField, fixedDecimalScale, error, disabled, }: ITableTextInputProps) => JSX.Element;
|
|
16
|
+
export declare const TableTextInput: ({ name, value, onChange, onBlur, prefix, suffix, textAlign, numberField, fixedDecimalScale, error, disabled, fullWidth, }: ITableTextInputProps) => JSX.Element;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
*
|
|
4
4
|
* When using this to size inputs, the input must have CSS box-sizing: content-box
|
|
5
5
|
*/
|
|
6
|
-
export declare function getTextWidth(text: string, element: HTMLElement): string;
|
|
6
|
+
export declare function getTextWidth(text: string, element: HTMLElement, maxWidth?: number): string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { NumericFormatProps } from "react-number-format";
|
|
3
3
|
import { ITextFieldProps } from "./TextField.types";
|
|
4
4
|
declare const TextField: React.FC<ITextFieldProps>;
|
|
5
5
|
export default TextField;
|
|
6
|
-
interface INumberFormatProps extends Omit<
|
|
6
|
+
interface INumberFormatProps extends Omit<NumericFormatProps, "onChange"> {
|
|
7
7
|
onChange: (event: {
|
|
8
8
|
target: {
|
|
9
9
|
name: string;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
.input {
|
|
2
|
+
background: transparent;
|
|
3
|
+
border: 0;
|
|
4
|
+
font-family: "Roboto", "Helvetica", "Arial", sans-serif;
|
|
5
|
+
transition: border-bottom 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,
|
|
6
|
+
margin-top 200ms cubic-bezier(0.4, 0, 0.2, 1) 0m;
|
|
7
|
+
margin-top: 0;
|
|
8
|
+
min-width: 3ch;
|
|
9
|
+
max-width: 20ch;
|
|
10
|
+
box-sizing: content-box;
|
|
11
|
+
|
|
12
|
+
&:hover {
|
|
13
|
+
border-bottom: 1px solid rgb(158, 158, 158);
|
|
14
|
+
margin-top: 1px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&:focus {
|
|
18
|
+
outline: none;
|
|
19
|
+
border-bottom: 2px solid rgb(115, 196, 202);
|
|
20
|
+
margin-top: 2px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&[data-valid="false"] {
|
|
24
|
+
border-bottom-color: #d32f2f !important;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.wrapper {
|
|
29
|
+
display: grid;
|
|
30
|
+
grid-template-columns: auto 1fr auto;
|
|
31
|
+
align-items: center;
|
|
32
|
+
width: fit-content;
|
|
33
|
+
margin: auto;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.error {
|
|
37
|
+
color: #d32f2f;
|
|
38
|
+
display: block;
|
|
39
|
+
text-align: center;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.checkbox {
|
|
43
|
+
accent-color: rgb(115, 196, 202);
|
|
44
|
+
margin: 0;
|
|
45
|
+
width: 15px;
|
|
46
|
+
height: 15px;
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.label {
|
|
51
|
+
display: flex;
|
|
52
|
+
justify-content: center;
|
|
53
|
+
align-items: center;
|
|
54
|
+
margin: auto;
|
|
55
|
+
border-radius: 5rem;
|
|
56
|
+
width: 38px;
|
|
57
|
+
height: 38px;
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
transition: background 0.2s ease;
|
|
60
|
+
|
|
61
|
+
&:hover {
|
|
62
|
+
background: rgba(0, 0, 0, 0.03);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&:active {
|
|
66
|
+
background: rgba(0, 0, 0, 0.1);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.disabled.label {
|
|
71
|
+
&:hover {
|
|
72
|
+
background: unset;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&:active {
|
|
76
|
+
background: unset;
|
|
77
|
+
}
|
|
78
|
+
}
|