envoc-form 4.0.1-1 → 4.0.1-10
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/README.md +2 -2
- package/es/ConfirmBaseForm/ConfirmBaseForm.d.ts +3 -1
- package/es/ConfirmBaseForm/ConfirmBaseForm.js +3 -2
- package/es/ConfirmDeleteForm/ConfirmDeleteForm.js +2 -1
- package/es/DatePicker/DatePickerGroup.d.ts +2 -1
- package/es/DatePicker/DatePickerGroup.js +22 -5
- package/es/DatePicker/StringDateOnlyPickerGroup.d.ts +5 -0
- package/es/DatePicker/{DateOnlyDatePickerGroup.js → StringDateOnlyPickerGroup.js} +7 -6
- package/es/Field/Field.d.ts +3 -3
- package/es/Field/Field.js +9 -4
- package/es/FieldArray/FieldArray.js +10 -7
- package/es/File/FileGroup.js +5 -3
- package/es/File/FileList.js +2 -1
- package/es/Form/Form.d.ts +8 -3
- package/es/Form/Form.js +32 -3
- package/es/FormActions.js +5 -1
- package/es/FormDefaults.d.ts +3 -0
- package/es/FormDefaults.js +1 -0
- package/es/Group.d.ts +2 -1
- package/es/Group.js +8 -5
- package/es/Input/IconInputGroup.js +2 -1
- package/es/Input/InputGroup.d.ts +1 -1
- package/es/Input/InputGroup.js +3 -2
- package/es/Input/MoneyInputGroup.js +2 -1
- package/es/Input/NumberInputGroup.js +2 -1
- package/es/Input/StringInputGroup.js +2 -1
- package/es/Select/SelectGroup.d.ts +1 -1
- package/es/Select/SelectGroup.js +8 -3
- package/es/StandardFormActions.js +2 -1
- package/es/SubmitFormButton.js +4 -2
- package/es/TextArea/TextAreaGroup.js +3 -2
- package/es/__Tests__/FormTestBase.d.ts +3 -3
- package/es/index.d.ts +4 -2
- package/es/index.js +4 -1
- package/lib/ConfirmBaseForm/ConfirmBaseForm.d.ts +3 -1
- package/lib/ConfirmBaseForm/ConfirmBaseForm.js +3 -2
- package/lib/ConfirmDeleteForm/ConfirmDeleteForm.js +2 -1
- package/lib/DatePicker/DatePickerGroup.d.ts +2 -1
- package/lib/DatePicker/DatePickerGroup.js +23 -4
- package/lib/DatePicker/StringDateOnlyPickerGroup.d.ts +5 -0
- package/lib/DatePicker/{DateOnlyDatePickerGroup.js → StringDateOnlyPickerGroup.js} +8 -7
- package/lib/Field/Field.d.ts +3 -3
- package/lib/Field/Field.js +9 -4
- package/lib/FieldArray/FieldArray.js +10 -7
- package/lib/File/FileGroup.js +5 -3
- package/lib/File/FileList.js +2 -1
- package/lib/Form/Form.d.ts +8 -3
- package/lib/Form/Form.js +32 -3
- package/lib/FormActions.js +5 -1
- package/lib/FormDefaults.d.ts +3 -0
- package/lib/FormDefaults.js +4 -0
- package/lib/Group.d.ts +2 -1
- package/lib/Group.js +8 -5
- package/lib/Input/IconInputGroup.js +2 -1
- package/lib/Input/InputGroup.d.ts +1 -1
- package/lib/Input/InputGroup.js +3 -2
- package/lib/Input/MoneyInputGroup.js +2 -1
- package/lib/Input/NumberInputGroup.js +2 -1
- package/lib/Input/StringInputGroup.js +2 -1
- package/lib/Select/SelectGroup.d.ts +1 -1
- package/lib/Select/SelectGroup.js +8 -3
- package/lib/StandardFormActions.js +2 -1
- package/lib/SubmitFormButton.js +4 -2
- package/lib/TextArea/TextAreaGroup.js +3 -2
- package/lib/__Tests__/FormTestBase.d.ts +3 -3
- package/lib/index.d.ts +4 -2
- package/lib/index.js +8 -3
- package/package.json +4 -2
- package/src/AddressInput/__snapshots__/AddressInput.test.tsx.snap +15 -10
- package/src/ConfirmBaseForm/ConfirmBaseForm.tsx +13 -3
- package/src/ConfirmBaseForm/__snapshots__/ConfirmBaseForm.test.tsx.snap +3 -3
- package/src/ConfirmDeleteForm/ConfirmDeleteForm.tsx +8 -1
- package/src/ConfirmDeleteForm/__snapshots__/ConfirmDeleteForm.test.tsx.snap +2 -2
- package/src/DatePicker/DatePicker.test.tsx +3 -3
- package/src/DatePicker/DatePickerGroup.tsx +40 -7
- package/src/DatePicker/StringDateOnlyPickerGroup.tsx +23 -0
- package/src/DatePicker/__snapshots__/DatePicker.test.tsx.snap +3 -2
- package/src/Field/Field.tsx +22 -7
- package/src/FieldArray/FieldArray.tsx +21 -9
- package/src/File/FileGroup.tsx +14 -2
- package/src/File/FileList.tsx +3 -1
- package/src/File/__snapshots__/FileGroup.test.tsx.snap +5 -3
- package/src/Form/Form.tsx +56 -4
- package/src/Form/__snapshots__/Form.test.tsx.snap +1 -0
- package/src/FormActions.tsx +8 -2
- package/src/FormDefaults.ts +1 -0
- package/src/Group.tsx +21 -6
- package/src/Input/IconInputGroup.tsx +5 -2
- package/src/Input/InputGroup.tsx +11 -2
- package/src/Input/MoneyInputGroup.tsx +5 -1
- package/src/Input/NumberInputGroup.tsx +5 -1
- package/src/Input/StringInputGroup.tsx +5 -1
- package/src/Input/__Tests__/__snapshots__/IconInputGroup.test.tsx.snap +4 -2
- package/src/Input/__Tests__/__snapshots__/MoneyInputGroup.test.tsx.snap +4 -2
- package/src/Input/__Tests__/__snapshots__/NumberInputGroup.test.tsx.snap +4 -2
- package/src/Input/__Tests__/__snapshots__/StringInputGroup.test.tsx.snap +4 -2
- package/src/Select/SelectGroup.tsx +15 -3
- package/src/Select/__tests__/__snapshots__/BooleanSelectGroup.test.tsx.snap +3 -2
- package/src/Select/__tests__/__snapshots__/NumberSelectGroup.test.tsx.snap +6 -4
- package/src/Select/__tests__/__snapshots__/StringSelectGroup.test.tsx.snap +6 -4
- package/src/StandardFormActions.tsx +4 -1
- package/src/SubmitFormButton.tsx +7 -1
- package/src/TextArea/TextAreaGroup.tsx +11 -2
- package/src/__Tests__/FormTestBase.tsx +3 -3
- package/src/__Tests__/__snapshots__/StandardFormActions.test.tsx.snap +4 -2
- package/src/__Tests__/__snapshots__/SubmitFormButton.test.tsx.snap +3 -1
- package/src/index.ts +7 -6
- package/es/DatePicker/DateOnlyDatePickerGroup.d.ts +0 -10
- package/lib/DatePicker/DateOnlyDatePickerGroup.d.ts +0 -10
- package/src/DatePicker/DateOnlyDatePickerGroup.tsx +0 -24
@@ -2,6 +2,7 @@ import { default as ReactSelect } from 'react-select';
|
|
2
2
|
import classNames from 'classnames';
|
3
3
|
import { InjectedFieldProps } from '../Field/InjectedFieldProps';
|
4
4
|
import Group, { GroupProps } from '../Group';
|
5
|
+
import { FormDefaults } from '../FormDefaults';
|
5
6
|
|
6
7
|
export interface SelectOption<TValue> {
|
7
8
|
value: (TValue extends Array<infer P> ? P : TValue) | undefined;
|
@@ -37,6 +38,8 @@ export default function SelectGroup<TValue>({
|
|
37
38
|
input,
|
38
39
|
meta,
|
39
40
|
className,
|
41
|
+
required,
|
42
|
+
disabled,
|
40
43
|
options,
|
41
44
|
multiple,
|
42
45
|
placeholder,
|
@@ -63,10 +66,15 @@ export default function SelectGroup<TValue>({
|
|
63
66
|
{...rest}
|
64
67
|
input={input}
|
65
68
|
meta={meta}
|
69
|
+
required={required}
|
70
|
+
disabled={disabled}
|
66
71
|
className={classNames(
|
67
72
|
className,
|
68
|
-
{
|
69
|
-
|
73
|
+
{
|
74
|
+
[FormDefaults.cssClassPrefix + 'multiple']: multiple,
|
75
|
+
[FormDefaults.cssClassPrefix + 'loading']: isLoading,
|
76
|
+
},
|
77
|
+
FormDefaults.cssClassPrefix + 'select-group'
|
70
78
|
)}>
|
71
79
|
<ReactSelect<
|
72
80
|
Partial<SelectOption<TValue>>,
|
@@ -74,6 +82,7 @@ export default function SelectGroup<TValue>({
|
|
74
82
|
>
|
75
83
|
inputId={input.id}
|
76
84
|
isMulti={multiple}
|
85
|
+
isDisabled={disabled}
|
77
86
|
options={effectiveOptions}
|
78
87
|
onBlur={input.onBlur}
|
79
88
|
value={getValue()}
|
@@ -85,7 +94,10 @@ export default function SelectGroup<TValue>({
|
|
85
94
|
}
|
86
95
|
}}
|
87
96
|
getOptionLabel={(option) => option?.label ?? ''}
|
88
|
-
className={classNames(
|
97
|
+
className={classNames(
|
98
|
+
className,
|
99
|
+
FormDefaults.cssClassPrefix + 'select-group'
|
100
|
+
)}
|
89
101
|
classNamePrefix="react-select"
|
90
102
|
menuPortalTarget={document.body}
|
91
103
|
menuPlacement="auto"
|
@@ -4,9 +4,10 @@ exports[`BooleanSelectGroup has matching snapshot 1`] = `
|
|
4
4
|
<DocumentFragment>
|
5
5
|
<form
|
6
6
|
action="#"
|
7
|
+
class="envoc-form-form"
|
7
8
|
>
|
8
9
|
<div
|
9
|
-
class="select-group group"
|
10
|
+
class="envoc-form-select-group envoc-form-group"
|
10
11
|
>
|
11
12
|
<div
|
12
13
|
id="allowlogin-error-scroll-target"
|
@@ -18,7 +19,7 @@ exports[`BooleanSelectGroup has matching snapshot 1`] = `
|
|
18
19
|
Allow Login
|
19
20
|
</label>
|
20
21
|
<div
|
21
|
-
class="select-group css-b62m3t-container"
|
22
|
+
class="envoc-form-select-group css-b62m3t-container"
|
22
23
|
>
|
23
24
|
<span
|
24
25
|
class="css-1f43avz-a11yText-A11yText"
|
@@ -4,9 +4,10 @@ exports[`MultiNumberSelectGroup has matching snapshot 1`] = `
|
|
4
4
|
<DocumentFragment>
|
5
5
|
<form
|
6
6
|
action="#"
|
7
|
+
class="envoc-form-form"
|
7
8
|
>
|
8
9
|
<div
|
9
|
-
class="multiple select-group group"
|
10
|
+
class="envoc-form-multiple envoc-form-select-group envoc-form-group"
|
10
11
|
>
|
11
12
|
<div
|
12
13
|
id="userroles-error-scroll-target"
|
@@ -18,7 +19,7 @@ exports[`MultiNumberSelectGroup has matching snapshot 1`] = `
|
|
18
19
|
Favorite Number
|
19
20
|
</label>
|
20
21
|
<div
|
21
|
-
class="select-group css-b62m3t-container"
|
22
|
+
class="envoc-form-select-group css-b62m3t-container"
|
22
23
|
>
|
23
24
|
<span
|
24
25
|
class="css-1f43avz-a11yText-A11yText"
|
@@ -102,9 +103,10 @@ exports[`SingleNumberSelectGroup has matching snapshot 1`] = `
|
|
102
103
|
<DocumentFragment>
|
103
104
|
<form
|
104
105
|
action="#"
|
106
|
+
class="envoc-form-form"
|
105
107
|
>
|
106
108
|
<div
|
107
|
-
class="select-group group"
|
109
|
+
class="envoc-form-select-group envoc-form-group"
|
108
110
|
>
|
109
111
|
<div
|
110
112
|
id="favoritenumber-error-scroll-target"
|
@@ -116,7 +118,7 @@ exports[`SingleNumberSelectGroup has matching snapshot 1`] = `
|
|
116
118
|
Favorite Number
|
117
119
|
</label>
|
118
120
|
<div
|
119
|
-
class="select-group css-b62m3t-container"
|
121
|
+
class="envoc-form-select-group css-b62m3t-container"
|
120
122
|
>
|
121
123
|
<span
|
122
124
|
class="css-1f43avz-a11yText-A11yText"
|
@@ -4,9 +4,10 @@ exports[`MultiStringSelectGroup has matching snapshot 1`] = `
|
|
4
4
|
<DocumentFragment>
|
5
5
|
<form
|
6
6
|
action="#"
|
7
|
+
class="envoc-form-form"
|
7
8
|
>
|
8
9
|
<div
|
9
|
-
class="multiple select-group group"
|
10
|
+
class="envoc-form-multiple envoc-form-select-group envoc-form-group"
|
10
11
|
>
|
11
12
|
<div
|
12
13
|
id="favoritecolors-error-scroll-target"
|
@@ -18,7 +19,7 @@ exports[`MultiStringSelectGroup has matching snapshot 1`] = `
|
|
18
19
|
Favorite Color
|
19
20
|
</label>
|
20
21
|
<div
|
21
|
-
class="select-group css-b62m3t-container"
|
22
|
+
class="envoc-form-select-group css-b62m3t-container"
|
22
23
|
>
|
23
24
|
<span
|
24
25
|
class="css-1f43avz-a11yText-A11yText"
|
@@ -102,9 +103,10 @@ exports[`SingleStringSelectGroup has matching snapshot 1`] = `
|
|
102
103
|
<DocumentFragment>
|
103
104
|
<form
|
104
105
|
action="#"
|
106
|
+
class="envoc-form-form"
|
105
107
|
>
|
106
108
|
<div
|
107
|
-
class="select-group group"
|
109
|
+
class="envoc-form-select-group envoc-form-group"
|
108
110
|
>
|
109
111
|
<div
|
110
112
|
id="favoritecolor-error-scroll-target"
|
@@ -116,7 +118,7 @@ exports[`SingleStringSelectGroup has matching snapshot 1`] = `
|
|
116
118
|
Favorite Color
|
117
119
|
</label>
|
118
120
|
<div
|
119
|
-
class="select-group css-b62m3t-container"
|
121
|
+
class="envoc-form-select-group css-b62m3t-container"
|
120
122
|
>
|
121
123
|
<span
|
122
124
|
class="css-1f43avz-a11yText-A11yText"
|
@@ -2,6 +2,7 @@ import { MouseEventHandler } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
3
3
|
import { useFormikContext } from 'formik';
|
4
4
|
import SubmitFormButton from './SubmitFormButton';
|
5
|
+
import { FormDefaults } from './FormDefaults';
|
5
6
|
|
6
7
|
export interface StandardFormActionsProps {
|
7
8
|
allowPristineSubmit?: boolean;
|
@@ -19,7 +20,9 @@ export default function StandardFormActions({
|
|
19
20
|
<SubmitFormButton allowPristineSubmit={allowPristineSubmit} />
|
20
21
|
|
21
22
|
<button
|
22
|
-
className={classNames(
|
23
|
+
className={classNames(
|
24
|
+
FormDefaults.cssClassPrefix + 'standard-form-actions-cancel-button'
|
25
|
+
)}
|
23
26
|
type="button"
|
24
27
|
disabled={isSubmitting}
|
25
28
|
onClick={handleCancel || goBack}>
|
package/src/SubmitFormButton.tsx
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import React, { LegacyRef } from 'react';
|
2
2
|
import classNames from 'classnames';
|
3
3
|
import { useFormikContext } from 'formik';
|
4
|
+
import { FormDefaults } from './FormDefaults';
|
4
5
|
|
5
6
|
export interface SubmitFormButtonProps
|
6
7
|
extends Omit<React.HTMLProps<HTMLButtonElement>, 'type'> {
|
@@ -20,12 +21,14 @@ function SubmitFormButton(
|
|
20
21
|
) {
|
21
22
|
const { isSubmitting, dirty } = useFormikContext();
|
22
23
|
const preventSubmit = (!dirty && !allowPristineSubmit) || isSubmitting;
|
24
|
+
const buttonName = typeof children === 'string' ? children : 'Submit';
|
23
25
|
return (
|
24
26
|
<button
|
25
27
|
{...props}
|
26
28
|
ref={ref}
|
27
29
|
type="submit"
|
28
30
|
disabled={preventSubmit || disabled}
|
31
|
+
aria-label={buttonName}
|
29
32
|
title={
|
30
33
|
title || isSubmitting
|
31
34
|
? 'Loading, please wait...'
|
@@ -33,7 +36,10 @@ function SubmitFormButton(
|
|
33
36
|
? "You haven't made any changes"
|
34
37
|
: ''
|
35
38
|
}
|
36
|
-
className={classNames(
|
39
|
+
className={classNames(
|
40
|
+
FormDefaults.cssClassPrefix + 'submit-form-button',
|
41
|
+
className
|
42
|
+
)}>
|
37
43
|
{children || 'Submit'}
|
38
44
|
</button>
|
39
45
|
);
|
@@ -2,6 +2,7 @@ import React, { LegacyRef } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
3
3
|
import { InjectedFieldProps } from '../Field/InjectedFieldProps';
|
4
4
|
import Group, { GroupProps } from '../Group';
|
5
|
+
import { FormDefaults } from '../FormDefaults';
|
5
6
|
|
6
7
|
export interface TextAreaGroupProps
|
7
8
|
extends InjectedFieldProps<string | undefined>,
|
@@ -21,6 +22,7 @@ function TextAreaGroup(
|
|
21
22
|
label,
|
22
23
|
helpText,
|
23
24
|
className,
|
25
|
+
required,
|
24
26
|
disabled,
|
25
27
|
icon,
|
26
28
|
...rest
|
@@ -31,10 +33,14 @@ function TextAreaGroup(
|
|
31
33
|
<Group
|
32
34
|
input={input}
|
33
35
|
meta={meta}
|
36
|
+
required={required}
|
34
37
|
disabled={disabled}
|
35
38
|
label={label}
|
36
39
|
helpText={helpText}
|
37
|
-
className={classNames(
|
40
|
+
className={classNames(
|
41
|
+
className,
|
42
|
+
FormDefaults.cssClassPrefix + 'text-area-group'
|
43
|
+
)}>
|
38
44
|
{icon}
|
39
45
|
<textarea
|
40
46
|
{...input}
|
@@ -42,7 +48,10 @@ function TextAreaGroup(
|
|
42
48
|
value={input.value}
|
43
49
|
onChange={(val) => input.onChange(val.target.value)}
|
44
50
|
ref={ref}
|
45
|
-
className={classNames(
|
51
|
+
className={classNames(
|
52
|
+
className,
|
53
|
+
FormDefaults.cssClassPrefix + 'text-area-group'
|
54
|
+
)}
|
46
55
|
/>
|
47
56
|
</Group>
|
48
57
|
);
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import '@testing-library/jest-dom/extend-expect';
|
2
2
|
import { HashRouter } from 'react-router-dom';
|
3
3
|
import { ValidatedApiResult } from 'Validation/ValidatedApiResult';
|
4
|
-
import {
|
4
|
+
import { Form, FormBuilderProp } from '../../src';
|
5
5
|
|
6
6
|
interface FormTestBaseProps<TForm extends object> {
|
7
7
|
children: (formBuilder: FormBuilderProp<TForm>) => JSX.Element;
|
@@ -50,8 +50,8 @@ interface PersonDto {
|
|
50
50
|
phoneNumber?: string;
|
51
51
|
yearlySalaryUSD?: number;
|
52
52
|
isCool?: boolean;
|
53
|
-
gradDate?:
|
54
|
-
favoriteDate?:
|
53
|
+
gradDate?: string;
|
54
|
+
favoriteDate?: string;
|
55
55
|
favoriteNumber?: number;
|
56
56
|
favoriteColor?: string;
|
57
57
|
favoriteColors?: string[];
|
@@ -4,9 +4,11 @@ exports[`StandardFormActions has matching snapshot 1`] = `
|
|
4
4
|
<DocumentFragment>
|
5
5
|
<form
|
6
6
|
action="#"
|
7
|
+
class="envoc-form-form"
|
7
8
|
>
|
8
9
|
<button
|
9
|
-
|
10
|
+
aria-label="Submit"
|
11
|
+
class="envoc-form-submit-form-button"
|
10
12
|
disabled=""
|
11
13
|
title="You haven't made any changes"
|
12
14
|
type="submit"
|
@@ -15,7 +17,7 @@ exports[`StandardFormActions has matching snapshot 1`] = `
|
|
15
17
|
</button>
|
16
18
|
|
17
19
|
<button
|
18
|
-
class="standard-form-actions-cancel-button"
|
20
|
+
class="envoc-form-standard-form-actions-cancel-button"
|
19
21
|
type="button"
|
20
22
|
>
|
21
23
|
Cancel
|
@@ -4,9 +4,11 @@ exports[`SubmitFormButton has matching snapshot 1`] = `
|
|
4
4
|
<DocumentFragment>
|
5
5
|
<form
|
6
6
|
action="#"
|
7
|
+
class="envoc-form-form"
|
7
8
|
>
|
8
9
|
<button
|
9
|
-
|
10
|
+
aria-label="Submit"
|
11
|
+
class="envoc-form-submit-form-button"
|
10
12
|
disabled=""
|
11
13
|
title="You haven't made any changes"
|
12
14
|
type="submit"
|
package/src/index.ts
CHANGED
@@ -17,18 +17,16 @@ export type { ConfirmDeleteFormProps } from './ConfirmDeleteForm/ConfirmDeleteFo
|
|
17
17
|
// Date
|
18
18
|
export { default as DatePickerGroup } from './DatePicker/DatePickerGroup';
|
19
19
|
export type { DatePickerGroupProps as DatePickerGroupProps } from './DatePicker/DatePickerGroup';
|
20
|
+
export { convertToTimeZoneInsensitiveISOString } from './DatePicker/DatePickerGroup';
|
20
21
|
|
21
22
|
export type { DatePickerHelper } from './DatePicker/DatePickerHelper';
|
22
23
|
|
23
|
-
export { default as DateOnlyDatePickerGroup } from './DatePicker/DateOnlyDatePickerGroup';
|
24
|
-
export type {
|
25
|
-
DateOnly,
|
26
|
-
DateOnlyDatePickerGroupProps,
|
27
|
-
} from './DatePicker/DateOnlyDatePickerGroup';
|
28
|
-
|
29
24
|
export { default as StringDatePickerGroup } from './DatePicker/StringDatePickerGroup';
|
30
25
|
export type { StringDatePickerGroupProps } from './DatePicker/StringDatePickerGroup';
|
31
26
|
|
27
|
+
export { default as StringDateOnlyPickerGroup } from './DatePicker/StringDateOnlyPickerGroup';
|
28
|
+
export type { StringDateOnlyPickerGroupProps } from './DatePicker/StringDateOnlyPickerGroup';
|
29
|
+
|
32
30
|
// Field
|
33
31
|
export { default as Field } from './Field/Field';
|
34
32
|
export type { FieldProps } from './Field/Field';
|
@@ -75,6 +73,9 @@ export type { FormActionsProps as FormActionsProps } from './FormActions';
|
|
75
73
|
export { default as StandardFormActions } from './StandardFormActions';
|
76
74
|
export type { StandardFormActionsProps as StandardFormActionsProps } from './StandardFormActions';
|
77
75
|
|
76
|
+
// FormDefaults
|
77
|
+
export { FormDefaults } from './FormDefaults';
|
78
|
+
|
78
79
|
// Input
|
79
80
|
export { default as Group } from './Group';
|
80
81
|
export type { GroupProps as GroupProps } from './Group';
|
@@ -1,10 +0,0 @@
|
|
1
|
-
/// <reference types="react" />
|
2
|
-
import { DatePickerHelper } from './DatePickerHelper';
|
3
|
-
export interface DateOnly {
|
4
|
-
year?: number;
|
5
|
-
month?: number;
|
6
|
-
day?: number;
|
7
|
-
}
|
8
|
-
export interface DateOnlyDatePickerGroupProps extends DatePickerHelper<DateOnly | undefined> {
|
9
|
-
}
|
10
|
-
export default function DateOnlyDatePickerGroup(props: DateOnlyDatePickerGroupProps): JSX.Element;
|
@@ -1,10 +0,0 @@
|
|
1
|
-
/// <reference types="react" />
|
2
|
-
import { DatePickerHelper } from './DatePickerHelper';
|
3
|
-
export interface DateOnly {
|
4
|
-
year?: number;
|
5
|
-
month?: number;
|
6
|
-
day?: number;
|
7
|
-
}
|
8
|
-
export interface DateOnlyDatePickerGroupProps extends DatePickerHelper<DateOnly | undefined> {
|
9
|
-
}
|
10
|
-
export default function DateOnlyDatePickerGroup(props: DateOnlyDatePickerGroupProps): JSX.Element;
|
@@ -1,24 +0,0 @@
|
|
1
|
-
import DatePickerGroup from './DatePickerGroup';
|
2
|
-
import { DatePickerHelper } from './DatePickerHelper';
|
3
|
-
|
4
|
-
export interface DateOnly {
|
5
|
-
year?: number;
|
6
|
-
month?: number;
|
7
|
-
day?: number;
|
8
|
-
}
|
9
|
-
|
10
|
-
export interface DateOnlyDatePickerGroupProps
|
11
|
-
extends DatePickerHelper<DateOnly | undefined> {}
|
12
|
-
export default function DateOnlyDatePickerGroup(
|
13
|
-
props: DateOnlyDatePickerGroupProps
|
14
|
-
) {
|
15
|
-
return <DatePickerGroup {...props} convert={convertToDateOnly} />;
|
16
|
-
}
|
17
|
-
|
18
|
-
function convertToDateOnly(arg: Date) {
|
19
|
-
return {
|
20
|
-
year: arg.getFullYear(),
|
21
|
-
month: arg.getMonth() + 1,
|
22
|
-
day: arg.getDate(),
|
23
|
-
};
|
24
|
-
}
|