@oc-digital/react-component-library 5.2.0-beta.4 → 5.2.0-beta.40
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 -2
- package/build/EditableTable/components/TableTextInput.d.ts +5 -4
- package/build/EditableTable/components/styled/Input.d.ts +16 -0
- 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 +9 -7
|
@@ -70,8 +70,8 @@ export interface IEssentialRenderFnProps {
|
|
|
70
70
|
value: TableCellValues;
|
|
71
71
|
onChange: (e: any) => void;
|
|
72
72
|
onBlur: any;
|
|
73
|
-
prefix?: React.ReactNode | React.JSXElementConstructor<any
|
|
74
|
-
suffix?: React.ReactNode | React.JSXElementConstructor<any
|
|
73
|
+
prefix?: React.ReactNode | React.JSXElementConstructor<any> | Element;
|
|
74
|
+
suffix?: React.ReactNode | React.JSXElementConstructor<any> | Element;
|
|
75
75
|
numberField?: boolean;
|
|
76
76
|
textAlign?: IAlignment;
|
|
77
77
|
fixedDecimalScale?: boolean;
|
|
@@ -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,3 +3,19 @@ export declare const Input: import("@emotion/styled").StyledComponent<{
|
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
4
|
as?: import("react").ElementType<any> | undefined;
|
|
5
5
|
}, import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, {}>;
|
|
6
|
+
export declare const NumericFormatInput: import("@emotion/styled").StyledComponent<import("react-number-format/types/types").InternalNumberFormatBase & {
|
|
7
|
+
thousandSeparator?: string | boolean | undefined;
|
|
8
|
+
decimalSeparator?: string | undefined;
|
|
9
|
+
allowedDecimalSeparators?: string[] | undefined;
|
|
10
|
+
thousandsGroupStyle?: "none" | "thousand" | "lakh" | "wan" | undefined;
|
|
11
|
+
decimalScale?: number | undefined;
|
|
12
|
+
fixedDecimalScale?: boolean | undefined;
|
|
13
|
+
allowNegative?: boolean | undefined;
|
|
14
|
+
allowLeadingZeros?: boolean | undefined;
|
|
15
|
+
suffix?: string | undefined;
|
|
16
|
+
prefix?: string | undefined;
|
|
17
|
+
} & Omit<import("react-number-format").InputAttributes, never> & Omit<unknown, "defaultValue" | "value" | "type" | "onChange" | "prefix" | "inputMode" | "onFocus" | "onBlur" | "onKeyDown" | "onMouseUp" | "ref" | "displayType" | "renderText" | "getInputRef" | "valueIsNumericString" | "onValueChange" | "isAllowed" | "isCharacterSame" | "thousandSeparator" | "decimalSeparator" | "allowedDecimalSeparators" | "thousandsGroupStyle" | "decimalScale" | "fixedDecimalScale" | "allowNegative" | "allowLeadingZeros" | "suffix"> & {
|
|
18
|
+
customInput?: import("react").ComponentType<unknown> | undefined;
|
|
19
|
+
} & {
|
|
20
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
21
|
+
}, {}, {}>;
|
|
@@ -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
|
+
}
|