@netu-si/netu-react-dsf-components 0.0.13 → 0.0.14
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/cjs/assets/index-b6796621.css +16 -0
- package/dist/cjs/components/DSFButton/DSFInputField.d.ts +15 -0
- package/dist/cjs/components/DSFDateInput/Input.d.ts +49 -0
- package/dist/cjs/components/DSFDateInput2/DSFDateInput2.d.ts +56 -0
- package/dist/cjs/components/DSFDateInput2/index.d.ts +1 -0
- package/dist/cjs/components/DSFHeader/DSFHeader.d.ts +3 -2
- package/dist/cjs/components/DSFTextInput/DSFTextInput.d.ts +13 -0
- package/dist/cjs/components/DSFTextInput/index.d.ts +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/stories/Button.d.ts +29 -0
- package/dist/cjs/stories/Header.d.ts +13 -0
- package/dist/cjs/stories/Page.d.ts +3 -0
- package/dist/cjs/stories/Page.stories.d.ts +13 -0
- package/dist/esm/assets/index-b6796621.css +16 -0
- package/dist/esm/components/DSFButton/DSFInputField.d.ts +15 -0
- package/dist/esm/components/DSFDateInput/Input.d.ts +49 -0
- package/dist/esm/components/DSFDateInput2/DSFDateInput2.d.ts +56 -0
- package/dist/esm/components/DSFDateInput2/index.d.ts +1 -0
- package/dist/esm/components/DSFHeader/DSFHeader.d.ts +3 -2
- package/dist/esm/components/DSFTextInput/DSFTextInput.d.ts +13 -0
- package/dist/esm/components/DSFTextInput/index.d.ts +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/stories/Button.d.ts +29 -0
- package/dist/esm/stories/Header.d.ts +13 -0
- package/dist/esm/stories/Page.d.ts +3 -0
- package/dist/esm/stories/Page.stories.d.ts +13 -0
- package/dist/index.d.ts +3 -2
- package/dist/types.d.ts +16 -0
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import "../../resources/css/dsf.main.min.css";
|
|
3
|
+
import { DSFInputProps } from "../DSFInput/DSFInput";
|
|
4
|
+
export interface DSFInputFieldProps {
|
|
5
|
+
label: string;
|
|
6
|
+
hint?: string;
|
|
7
|
+
id: string;
|
|
8
|
+
inputProps?: DSFInputProps;
|
|
9
|
+
meta: {
|
|
10
|
+
error?: string | string[];
|
|
11
|
+
touched?: boolean;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
declare const DSFInputField: FC<DSFInputFieldProps>;
|
|
15
|
+
export default DSFInputField;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import DSFInput, { DSFInputProps as BaseInputProps } from '../DSFInput/DSFInput';
|
|
3
|
+
type InputsType = {
|
|
4
|
+
[key: string]: BaseInputProps | undefined;
|
|
5
|
+
day?: BaseInputProps;
|
|
6
|
+
month?: BaseInputProps;
|
|
7
|
+
year?: BaseInputProps;
|
|
8
|
+
};
|
|
9
|
+
export interface DateInputProps {
|
|
10
|
+
id: string;
|
|
11
|
+
names?: {
|
|
12
|
+
day?: string;
|
|
13
|
+
month?: string;
|
|
14
|
+
year?: string;
|
|
15
|
+
};
|
|
16
|
+
defaultValues?: {
|
|
17
|
+
day?: string;
|
|
18
|
+
month?: string;
|
|
19
|
+
year?: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Custom props to pass down to the input fields
|
|
23
|
+
*/
|
|
24
|
+
inputs?: InputsType;
|
|
25
|
+
value?: {
|
|
26
|
+
day?: string;
|
|
27
|
+
month?: string;
|
|
28
|
+
year?: string;
|
|
29
|
+
};
|
|
30
|
+
labels?: {
|
|
31
|
+
day?: string;
|
|
32
|
+
month?: string;
|
|
33
|
+
year?: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* This comes from the multiInputInput HOC and is needed to track all 3 inputs
|
|
37
|
+
*/
|
|
38
|
+
refs?: (refs: {
|
|
39
|
+
day?: React.Ref<typeof DSFInput>;
|
|
40
|
+
month?: React.Ref<typeof DSFInput>;
|
|
41
|
+
year?: React.Ref<typeof DSFInput>;
|
|
42
|
+
}) => void;
|
|
43
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>, key: string) => void;
|
|
44
|
+
onBlur?: (e: React.FocusEvent<HTMLInputElement>, key: string) => void;
|
|
45
|
+
onFocus?: (e: React.FocusEvent<HTMLInputElement>, key: string) => void;
|
|
46
|
+
error?: boolean;
|
|
47
|
+
}
|
|
48
|
+
declare const _default: any;
|
|
49
|
+
export default _default;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import '../../resources/css/dsf.main.min.css';
|
|
2
|
+
import React, { RefObject } from 'react';
|
|
3
|
+
import { DSFInputProps } from '../DSFInput/DSFInput';
|
|
4
|
+
interface InputRefObject {
|
|
5
|
+
day: RefObject<HTMLInputElement>;
|
|
6
|
+
month: RefObject<HTMLInputElement>;
|
|
7
|
+
year: RefObject<HTMLInputElement>;
|
|
8
|
+
}
|
|
9
|
+
export interface DSFDateInput2Props {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
hint?: string;
|
|
13
|
+
errorText?: string;
|
|
14
|
+
refs?: InputRefObject;
|
|
15
|
+
labels?: {
|
|
16
|
+
day: string;
|
|
17
|
+
month: string;
|
|
18
|
+
year: string;
|
|
19
|
+
};
|
|
20
|
+
inputs?: {
|
|
21
|
+
day?: DSFInputProps;
|
|
22
|
+
month?: DSFInputProps;
|
|
23
|
+
year?: DSFInputProps;
|
|
24
|
+
};
|
|
25
|
+
defaultValues?: {
|
|
26
|
+
day?: string;
|
|
27
|
+
month?: string;
|
|
28
|
+
year?: string;
|
|
29
|
+
};
|
|
30
|
+
inputProps?: {
|
|
31
|
+
/**
|
|
32
|
+
* Called when the day, month or year changes
|
|
33
|
+
*/
|
|
34
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>, key: string) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Called when the day, month or year fields are blurred
|
|
37
|
+
* (does not get called when moving between inputs in the same datefield)
|
|
38
|
+
*/
|
|
39
|
+
onBlur?: (e: React.FocusEvent<HTMLInputElement>, key: string) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Called when the day, month or year fields are focussed
|
|
42
|
+
* (does not get called when moving between inputs in the same datefield)
|
|
43
|
+
*/
|
|
44
|
+
onFocus?: (e: React.FocusEvent<HTMLInputElement>, key: string) => void;
|
|
45
|
+
/**
|
|
46
|
+
* When the form field is controlled, this sets the value of the day, month and year inputs
|
|
47
|
+
*/
|
|
48
|
+
value?: {
|
|
49
|
+
day?: string;
|
|
50
|
+
month?: string;
|
|
51
|
+
year?: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
declare const DSFDateInput2: React.FC<DSFDateInput2Props>;
|
|
56
|
+
export default DSFDateInput2;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './DSFDateInput2';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ChangeEvent } from 'react';
|
|
1
|
+
import React, { ChangeEvent, MouseEventHandler } from 'react';
|
|
2
2
|
import '../../resources/css/dsf.main.min.css';
|
|
3
3
|
import '../../resources/css/custom.css';
|
|
4
4
|
export type NavMenuItem = {
|
|
@@ -12,11 +12,12 @@ export interface DSFHeaderProps {
|
|
|
12
12
|
menu?: NavMenuItem[];
|
|
13
13
|
logoUrl?: string;
|
|
14
14
|
languageHandler?: (event: ChangeEvent<HTMLSelectElement>) => void;
|
|
15
|
+
onLogoClickHandler?: MouseEventHandler<HTMLAnchorElement>;
|
|
15
16
|
defaultValue?: string | null;
|
|
16
17
|
showLogo?: boolean;
|
|
17
18
|
}
|
|
18
19
|
declare const DSFHeader: {
|
|
19
|
-
({ headerTitle, menu, logoUrl, showLang, languageHandler, defaultValue, showLogo, }: DSFHeaderProps): React.JSX.Element;
|
|
20
|
+
({ headerTitle, menu, logoUrl, onLogoClickHandler, showLang, languageHandler, defaultValue, showLogo, }: DSFHeaderProps): React.JSX.Element;
|
|
20
21
|
defaultProps: {
|
|
21
22
|
showLang: boolean;
|
|
22
23
|
menu: undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import "../../resources/css/dsf.main.min.css";
|
|
3
|
+
export interface DSFTextInputProps {
|
|
4
|
+
label?: string;
|
|
5
|
+
hint?: string;
|
|
6
|
+
id?: string;
|
|
7
|
+
error?: string;
|
|
8
|
+
visualSize?: number;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
required?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const DSFTextInput: FC<DSFTextInputProps>;
|
|
13
|
+
export default DSFTextInput;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./DSFTextInput";
|