@algodomain/smart-forms 0.1.3 → 0.1.4

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.
@@ -1,18 +1,22 @@
1
1
  import React__default from 'react';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
3
 
3
4
  interface SmartInputProps {
4
5
  field: string;
5
6
  label?: string;
6
- type?: 'text' | 'email' | 'password' | 'tel' | 'number' | 'textarea';
7
+ type?: 'text' | 'email' | 'password' | 'tel' | 'number' | 'textarea' | 'date';
7
8
  placeholder?: string;
8
9
  validation?: any;
9
10
  className?: string;
10
11
  required?: boolean;
11
12
  defaultValue?: any;
13
+ syncValue?: any;
12
14
  info?: string;
13
15
  subLabel?: string;
14
16
  disabled?: boolean | ((formData: any) => boolean);
15
17
  hidden?: boolean | ((formData: any) => boolean);
18
+ icon?: React__default.ReactNode;
19
+ iconPosition?: 'left' | 'right';
16
20
  }
17
21
  declare const SmartInput: React__default.FC<SmartInputProps>;
18
22
 
@@ -71,32 +75,41 @@ interface SmartSelectProps {
71
75
  }
72
76
  declare const SmartSelect: React__default.FC<SmartSelectProps>;
73
77
 
74
- interface SmartDatePickerProps {
78
+ interface SmartComboboxOption {
79
+ value: string;
80
+ label: string;
81
+ }
82
+ interface SmartComboboxProps {
75
83
  field: string;
76
84
  label?: string;
85
+ options: SmartComboboxOption[];
77
86
  className?: string;
78
87
  placeholder?: string;
88
+ allowCustom?: boolean;
79
89
  validation?: any;
80
90
  required?: boolean;
81
- allowPast?: boolean;
82
- allowFuture?: boolean;
83
- /**
84
- * When true, value will be stored/returned as ISO string (yyyy-MM-dd).
85
- * Otherwise the underlying form value will be a Date instance.
86
- */
87
- valueAsString?: boolean;
88
- /** Optional minimum selectable date */
89
- minDate?: Date;
90
- /** Optional maximum selectable date */
91
- maxDate?: Date;
92
- /** Default value for the date picker (can be Date or string depending on valueAsString) */
93
- defaultValue?: Date | string;
91
+ defaultValue?: string;
94
92
  info?: string;
95
93
  subLabel?: string;
96
94
  disabled?: boolean | ((formData: any) => boolean);
97
95
  hidden?: boolean | ((formData: any) => boolean);
98
96
  }
99
- declare const SmartDatePicker: React__default.FC<SmartDatePickerProps>;
97
+ declare const SmartCombobox: React__default.FC<SmartComboboxProps>;
98
+
99
+ type SmartDatePickerProps = {
100
+ field: string;
101
+ label?: string;
102
+ placeholder?: string;
103
+ validation?: any;
104
+ className?: string;
105
+ required?: boolean;
106
+ defaultValue?: any;
107
+ info?: string;
108
+ subLabel?: string;
109
+ disabled?: boolean | ((formData: any) => boolean);
110
+ hidden?: boolean | ((formData: any) => boolean);
111
+ };
112
+ declare const SmartDatePicker: ({ field, label, className, ...props }: SmartDatePickerProps) => react_jsx_runtime.JSX.Element;
100
113
 
101
114
  interface SmartTagsProps {
102
115
  field: string;
@@ -119,4 +132,4 @@ interface SmartTagsProps {
119
132
  }
120
133
  declare const SmartTags: React__default.FC<SmartTagsProps>;
121
134
 
122
- export { SmartInput as S, SmartCheckbox as a, SmartRadioGroup as b, SmartSelect as c, SmartDatePicker as d, SmartTags as e, type SmartInputProps as f, type SmartTagsProps as g };
135
+ export { SmartInput as S, SmartCheckbox as a, SmartRadioGroup as b, SmartSelect as c, SmartCombobox as d, SmartDatePicker as e, SmartTags as f, type SmartInputProps as g, type SmartTagsProps as h, type SmartDatePickerProps as i, type SmartComboboxProps as j, type SmartComboboxOption as k };
@@ -1,18 +1,22 @@
1
1
  import React__default from 'react';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
3
 
3
4
  interface SmartInputProps {
4
5
  field: string;
5
6
  label?: string;
6
- type?: 'text' | 'email' | 'password' | 'tel' | 'number' | 'textarea';
7
+ type?: 'text' | 'email' | 'password' | 'tel' | 'number' | 'textarea' | 'date';
7
8
  placeholder?: string;
8
9
  validation?: any;
9
10
  className?: string;
10
11
  required?: boolean;
11
12
  defaultValue?: any;
13
+ syncValue?: any;
12
14
  info?: string;
13
15
  subLabel?: string;
14
16
  disabled?: boolean | ((formData: any) => boolean);
15
17
  hidden?: boolean | ((formData: any) => boolean);
18
+ icon?: React__default.ReactNode;
19
+ iconPosition?: 'left' | 'right';
16
20
  }
17
21
  declare const SmartInput: React__default.FC<SmartInputProps>;
18
22
 
@@ -71,32 +75,41 @@ interface SmartSelectProps {
71
75
  }
72
76
  declare const SmartSelect: React__default.FC<SmartSelectProps>;
73
77
 
74
- interface SmartDatePickerProps {
78
+ interface SmartComboboxOption {
79
+ value: string;
80
+ label: string;
81
+ }
82
+ interface SmartComboboxProps {
75
83
  field: string;
76
84
  label?: string;
85
+ options: SmartComboboxOption[];
77
86
  className?: string;
78
87
  placeholder?: string;
88
+ allowCustom?: boolean;
79
89
  validation?: any;
80
90
  required?: boolean;
81
- allowPast?: boolean;
82
- allowFuture?: boolean;
83
- /**
84
- * When true, value will be stored/returned as ISO string (yyyy-MM-dd).
85
- * Otherwise the underlying form value will be a Date instance.
86
- */
87
- valueAsString?: boolean;
88
- /** Optional minimum selectable date */
89
- minDate?: Date;
90
- /** Optional maximum selectable date */
91
- maxDate?: Date;
92
- /** Default value for the date picker (can be Date or string depending on valueAsString) */
93
- defaultValue?: Date | string;
91
+ defaultValue?: string;
94
92
  info?: string;
95
93
  subLabel?: string;
96
94
  disabled?: boolean | ((formData: any) => boolean);
97
95
  hidden?: boolean | ((formData: any) => boolean);
98
96
  }
99
- declare const SmartDatePicker: React__default.FC<SmartDatePickerProps>;
97
+ declare const SmartCombobox: React__default.FC<SmartComboboxProps>;
98
+
99
+ type SmartDatePickerProps = {
100
+ field: string;
101
+ label?: string;
102
+ placeholder?: string;
103
+ validation?: any;
104
+ className?: string;
105
+ required?: boolean;
106
+ defaultValue?: any;
107
+ info?: string;
108
+ subLabel?: string;
109
+ disabled?: boolean | ((formData: any) => boolean);
110
+ hidden?: boolean | ((formData: any) => boolean);
111
+ };
112
+ declare const SmartDatePicker: ({ field, label, className, ...props }: SmartDatePickerProps) => react_jsx_runtime.JSX.Element;
100
113
 
101
114
  interface SmartTagsProps {
102
115
  field: string;
@@ -119,4 +132,4 @@ interface SmartTagsProps {
119
132
  }
120
133
  declare const SmartTags: React__default.FC<SmartTagsProps>;
121
134
 
122
- export { SmartInput as S, SmartCheckbox as a, SmartRadioGroup as b, SmartSelect as c, SmartDatePicker as d, SmartTags as e, type SmartInputProps as f, type SmartTagsProps as g };
135
+ export { SmartInput as S, SmartCheckbox as a, SmartRadioGroup as b, SmartSelect as c, SmartCombobox as d, SmartDatePicker as e, SmartTags as f, type SmartInputProps as g, type SmartTagsProps as h, type SmartDatePickerProps as i, type SmartComboboxProps as j, type SmartComboboxOption as k };