@funcd-dev/ui 0.7.0 → 0.8.0
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/index.es.js +1722 -1664
- package/dist/index.umd.js +2 -2
- package/dist/reactive-form/reactive-fields/index.d.ts +1 -0
- package/dist/reactive-form/reactive-fields/reactive-range-slider/index.d.ts +2 -0
- package/dist/reactive-form/reactive-fields/reactive-range-slider/reactive-range-slider.d.ts +5 -0
- package/dist/reactive-form/reactive-fields/reactive-range-slider/types.d.ts +25 -0
- package/dist/reactive-form/reactive-fields/types/field-custom-meta.d.ts +1 -0
- package/dist/reactive-form/reactive-fields/types/field-custom-props.d.ts +2 -0
- package/dist/reactive-form/reactive-fields/types/reactive-field-base.d.ts +1 -1
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ export * from './reactive-number-field';
|
|
|
5
5
|
export * from './reactive-password-field';
|
|
6
6
|
export * from './reactive-radio';
|
|
7
7
|
export * from './reactive-range';
|
|
8
|
+
export * from './reactive-range-slider';
|
|
8
9
|
export * from './reactive-select';
|
|
9
10
|
export * from './reactive-switch';
|
|
10
11
|
export * from './reactive-text-field';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { MantineSize } from '@mantine/core';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export type RangeSliderCustomProps = {
|
|
4
|
+
/** Marks which will be placed on the track */
|
|
5
|
+
marks?: {
|
|
6
|
+
value: number;
|
|
7
|
+
label?: ReactNode;
|
|
8
|
+
}[];
|
|
9
|
+
size?: MantineSize;
|
|
10
|
+
step?: number;
|
|
11
|
+
max?: number;
|
|
12
|
+
min?: number;
|
|
13
|
+
/** Smallest gap between the two thumbs, 10 by default */
|
|
14
|
+
minRange?: number;
|
|
15
|
+
/** Largest gap between the two thumbs */
|
|
16
|
+
maxRange?: number;
|
|
17
|
+
/** Thumb label, or a function that makes it from the value; null hides it */
|
|
18
|
+
label?: ReactNode | ((value: number) => ReactNode);
|
|
19
|
+
thumbSize?: number;
|
|
20
|
+
/** Thumb children, can be used to add icon */
|
|
21
|
+
thumbChildren?: ReactNode;
|
|
22
|
+
inverted?: boolean;
|
|
23
|
+
/** A transformation function, to change the scale of the slider */
|
|
24
|
+
scale?: (value: number) => number;
|
|
25
|
+
};
|
|
@@ -16,6 +16,7 @@ export interface IConditionalProp<TFormValues extends JSONData> {
|
|
|
16
16
|
select: ConditionalProp<'select', TFormValues, true>;
|
|
17
17
|
radio: ConditionalProp<'radio', TFormValues>;
|
|
18
18
|
range: ConditionalProp<'range', TFormValues>;
|
|
19
|
+
'range-slider': ConditionalProp<'range-slider', TFormValues>;
|
|
19
20
|
'multi-select': ConditionalProp<'multi-select', TFormValues>;
|
|
20
21
|
list: ConditionalProp<'list'>;
|
|
21
22
|
}
|
|
@@ -6,6 +6,7 @@ import { NumberFieldCustomProps } from '../reactive-number-field';
|
|
|
6
6
|
import { PasswordFieldCustomProps } from '../reactive-password-field';
|
|
7
7
|
import { RadioCustomProps } from '../reactive-radio';
|
|
8
8
|
import { RangeCustomProps } from '../reactive-range';
|
|
9
|
+
import { RangeSliderCustomProps } from '../reactive-range-slider';
|
|
9
10
|
import { SelectCustomProps } from '../reactive-select';
|
|
10
11
|
import { SwitchCustomProps } from '../reactive-switch';
|
|
11
12
|
import { TextFieldCustomProps } from '../reactive-text-field';
|
|
@@ -24,6 +25,7 @@ export interface ICustomProps<TFormValues extends JSONData> {
|
|
|
24
25
|
select: CommonProps<SelectCustomProps, TFormValues>;
|
|
25
26
|
radio: CommonProps<RadioCustomProps, TFormValues>;
|
|
26
27
|
range: CommonProps<RangeCustomProps, TFormValues>;
|
|
28
|
+
'range-slider': CommonProps<RangeSliderCustomProps, TFormValues>;
|
|
27
29
|
'multi-select': CommonProps<MultiSelectCustomProps, TFormValues>;
|
|
28
30
|
list: CommonProps<ListFieldCustomProps<TFormValues>, TFormValues>;
|
|
29
31
|
}
|
|
@@ -2,7 +2,7 @@ import { Ref } from 'react';
|
|
|
2
2
|
import { RegisterOptions } from 'react-hook-form';
|
|
3
3
|
import { JSONData, Simplify } from '@/types';
|
|
4
4
|
import { FormProps } from '../../../types/form';
|
|
5
|
-
export type InputType = 'text' | 'textarea' | 'number' | 'password' | 'checkbox' | 'switch' | 'select' | 'multi-select' | 'radio' | 'range' | 'autocomplete' | 'list';
|
|
5
|
+
export type InputType = 'text' | 'textarea' | 'number' | 'password' | 'checkbox' | 'switch' | 'select' | 'multi-select' | 'radio' | 'range' | 'range-slider' | 'autocomplete' | 'list';
|
|
6
6
|
export type FormFieldOption<TFieldValues extends JSONData> = RegisterOptions<TFieldValues>;
|
|
7
7
|
export type ErrorFormType = {
|
|
8
8
|
type: string;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@funcd-dev/ui",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"description": "React components for funcd: Mantine-based layouts, reactive forms, reactive charts and a flow editor",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.8.0",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|