@symply.io/basic-components 1.0.0-beta.5 → 1.0.0-beta.6
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/DateInput/FullDateInput/index.js +16 -5
- package/DateInput/FullDateInput/types.d.ts +2 -7
- package/DateInput/MonthDayInput/index.js +16 -5
- package/DateInput/MonthDayInput/types.d.ts +2 -7
- package/DateInput/MonthYearInput/index.js +16 -5
- package/DateInput/MonthYearInput/types.d.ts +2 -7
- package/package.json +1 -1
@@ -9,6 +9,17 @@ var __assign = (this && this.__assign) || function () {
|
|
9
9
|
};
|
10
10
|
return __assign.apply(this, arguments);
|
11
11
|
};
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
13
|
+
var t = {};
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
15
|
+
t[p] = s[p];
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
19
|
+
t[p[i]] = s[p[i]];
|
20
|
+
}
|
21
|
+
return t;
|
22
|
+
};
|
12
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
13
24
|
import { useRifm } from "rifm";
|
14
25
|
import TextField from "@mui/material/TextField";
|
@@ -46,7 +57,7 @@ export function onValidateDate(dateString) {
|
|
46
57
|
return false;
|
47
58
|
}
|
48
59
|
function FullDateInput(props) {
|
49
|
-
var
|
60
|
+
var onChange = props.onChange, value = props.value, _a = props.margin, margin = _a === void 0 ? "normal" : _a, error = props.error, _b = props.helperText, helperText = _b === void 0 ? "Please enter a valid date" : _b, onValidate = props.onValidate, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, rest = __rest(props, ["onChange", "value", "margin", "error", "helperText", "onValidate", "primaryColor", "secondaryColor"]);
|
50
61
|
var theme = useCustomTheme({ primaryColor: primaryColor, secondaryColor: secondaryColor });
|
51
62
|
var _c = useInteractions({ value: value }), valLength = _c.valLength, addMask = _c.addMask;
|
52
63
|
var rifm = useRifm({
|
@@ -56,13 +67,13 @@ function FullDateInput(props) {
|
|
56
67
|
replace: addMask,
|
57
68
|
format: MonthDayYearFormat
|
58
69
|
});
|
59
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(TextField, { placeholder: "MM / DD / YYYY", error: error ||
|
70
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(TextField, __assign({ placeholder: "MM / DD / YYYY", error: error ||
|
60
71
|
(valLength > 0 &&
|
61
|
-
(onValidate ? !onValidate(value) : !onValidateDate(value))), margin: margin,
|
72
|
+
(onValidate ? !onValidate(value) : !onValidateDate(value))), margin: margin, value: rifm.value, onChange: rifm.onChange, helperText: valLength > 0 &&
|
62
73
|
(onValidate ? !onValidate(value) : !onValidateDate(value))
|
63
74
|
? helperText
|
64
|
-
: "",
|
75
|
+
: "", InputLabelProps: {
|
65
76
|
shrink: true
|
66
|
-
} }) })));
|
77
|
+
} }, rest)) })));
|
67
78
|
}
|
68
79
|
export default FullDateInput;
|
@@ -1,13 +1,8 @@
|
|
1
1
|
import { CSSProperties } from "react";
|
2
|
-
|
3
|
-
|
2
|
+
import { TextFieldProps } from "@mui/material/TextField";
|
3
|
+
export interface DateInputprops extends Omit<TextFieldProps, "onChange"> {
|
4
4
|
onChange: (value: string) => void;
|
5
|
-
onFocus?: () => void;
|
6
|
-
onBlur?: () => void;
|
7
5
|
onValidate?: (value?: string) => boolean;
|
8
|
-
helperText?: string;
|
9
|
-
margin?: "none" | "normal" | "dense" | undefined;
|
10
|
-
error?: boolean;
|
11
6
|
value: string;
|
12
7
|
primaryColor?: CSSProperties["color"];
|
13
8
|
secondaryColor?: CSSProperties["color"];
|
@@ -9,6 +9,17 @@ var __assign = (this && this.__assign) || function () {
|
|
9
9
|
};
|
10
10
|
return __assign.apply(this, arguments);
|
11
11
|
};
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
13
|
+
var t = {};
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
15
|
+
t[p] = s[p];
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
19
|
+
t[p[i]] = s[p[i]];
|
20
|
+
}
|
21
|
+
return t;
|
22
|
+
};
|
12
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
13
24
|
import { useRifm } from "rifm";
|
14
25
|
import TextField from "@mui/material/TextField";
|
@@ -32,7 +43,7 @@ export function onValidateMonthDay(monthDayString) {
|
|
32
43
|
return reg.test(monthDayString);
|
33
44
|
}
|
34
45
|
function MonthDayInput(props) {
|
35
|
-
var
|
46
|
+
var onChange = props.onChange, value = props.value, _a = props.margin, margin = _a === void 0 ? "normal" : _a, error = props.error, _b = props.helperText, helperText = _b === void 0 ? "Please enter a valid date" : _b, onValidate = props.onValidate, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, rest = __rest(props, ["onChange", "value", "margin", "error", "helperText", "onValidate", "primaryColor", "secondaryColor"]);
|
36
47
|
var theme = useCustomTheme({ primaryColor: primaryColor, secondaryColor: secondaryColor });
|
37
48
|
var _c = useInteractions({ value: value }), valLength = _c.valLength, addMask = _c.addMask;
|
38
49
|
var rifm = useRifm({
|
@@ -42,13 +53,13 @@ function MonthDayInput(props) {
|
|
42
53
|
replace: addMask,
|
43
54
|
format: MonthDayFormat
|
44
55
|
});
|
45
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(TextField, { placeholder: "MM / DD", error: error ||
|
56
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(TextField, __assign({ placeholder: "MM / DD", error: error ||
|
46
57
|
(valLength > 0 &&
|
47
|
-
(onValidate ? !onValidate(value) : !onValidateMonthDay(value))), margin: margin,
|
58
|
+
(onValidate ? !onValidate(value) : !onValidateMonthDay(value))), margin: margin, value: rifm.value, onChange: rifm.onChange, helperText: valLength > 0 &&
|
48
59
|
(onValidate ? !onValidate(value) : !onValidateMonthDay(value))
|
49
60
|
? helperText
|
50
|
-
: "",
|
61
|
+
: "", InputLabelProps: {
|
51
62
|
shrink: true
|
52
|
-
} }) })));
|
63
|
+
} }, rest)) })));
|
53
64
|
}
|
54
65
|
export default MonthDayInput;
|
@@ -1,13 +1,8 @@
|
|
1
1
|
import { CSSProperties } from "react";
|
2
|
-
|
3
|
-
|
2
|
+
import { TextFieldProps } from "@mui/material/TextField";
|
3
|
+
export interface DateInputprops extends Omit<TextFieldProps, "onChange"> {
|
4
4
|
onChange: (value: string) => void;
|
5
|
-
onFocus?: () => void;
|
6
|
-
onBlur?: () => void;
|
7
5
|
onValidate?: (value?: string) => boolean;
|
8
|
-
helperText?: string;
|
9
|
-
margin?: "none" | "normal" | "dense" | undefined;
|
10
|
-
error?: boolean;
|
11
6
|
value: string;
|
12
7
|
primaryColor?: CSSProperties["color"];
|
13
8
|
secondaryColor?: CSSProperties["color"];
|
@@ -9,6 +9,17 @@ var __assign = (this && this.__assign) || function () {
|
|
9
9
|
};
|
10
10
|
return __assign.apply(this, arguments);
|
11
11
|
};
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
13
|
+
var t = {};
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
15
|
+
t[p] = s[p];
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
19
|
+
t[p[i]] = s[p[i]];
|
20
|
+
}
|
21
|
+
return t;
|
22
|
+
};
|
12
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
13
24
|
import { useRifm } from "rifm";
|
14
25
|
import TextField from "@mui/material/TextField";
|
@@ -33,7 +44,7 @@ export function onValidateMonthYear(monthYearString) {
|
|
33
44
|
return reg.test(monthYearString);
|
34
45
|
}
|
35
46
|
function MonthYearInput(props) {
|
36
|
-
var
|
47
|
+
var onChange = props.onChange, value = props.value, _a = props.margin, margin = _a === void 0 ? "normal" : _a, error = props.error, _b = props.helperText, helperText = _b === void 0 ? "Please enter a valid date" : _b, onValidate = props.onValidate, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, rest = __rest(props, ["onChange", "value", "margin", "error", "helperText", "onValidate", "primaryColor", "secondaryColor"]);
|
37
48
|
var theme = useCustomTheme({ primaryColor: primaryColor, secondaryColor: secondaryColor });
|
38
49
|
var _c = useInteractions({ value: value }), valLength = _c.valLength, addMask = _c.addMask;
|
39
50
|
var rifm = useRifm({
|
@@ -43,13 +54,13 @@ function MonthYearInput(props) {
|
|
43
54
|
replace: addMask,
|
44
55
|
format: MonthYearFormat
|
45
56
|
});
|
46
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(TextField, { placeholder: "MM / YYYY", error: error ||
|
57
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(TextField, __assign({ placeholder: "MM / YYYY", error: error ||
|
47
58
|
(valLength > 0 &&
|
48
|
-
(onValidate ? !onValidate(value) : !onValidateMonthYear(value))), margin: margin,
|
59
|
+
(onValidate ? !onValidate(value) : !onValidateMonthYear(value))), margin: margin, value: rifm.value, onChange: rifm.onChange, helperText: valLength > 0 &&
|
49
60
|
(onValidate ? !onValidate(value) : !onValidateMonthYear(value))
|
50
61
|
? helperText
|
51
|
-
: "",
|
62
|
+
: "", InputLabelProps: {
|
52
63
|
shrink: true
|
53
|
-
} }) })));
|
64
|
+
} }, rest)) })));
|
54
65
|
}
|
55
66
|
export default MonthYearInput;
|
@@ -1,13 +1,8 @@
|
|
1
1
|
import { CSSProperties } from "react";
|
2
|
-
|
3
|
-
|
2
|
+
import { TextFieldProps } from "@mui/material/TextField";
|
3
|
+
export interface DateInputprops extends Omit<TextFieldProps, "onChange"> {
|
4
4
|
onChange: (value: string) => void;
|
5
|
-
onFocus?: () => void;
|
6
|
-
onBlur?: () => void;
|
7
5
|
onValidate?: (value?: string) => boolean;
|
8
|
-
helperText?: string;
|
9
|
-
margin?: "none" | "normal" | "dense" | undefined;
|
10
|
-
error?: boolean;
|
11
6
|
value: string;
|
12
7
|
primaryColor?: CSSProperties["color"];
|
13
8
|
secondaryColor?: CSSProperties["color"];
|