@react-fabric/form 1.0.0-beta.44 → 1.0.0-beta.46
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/css/_field.css +38 -14
- package/dist/cjs/form/Form.js +1 -1
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/input/ColorInput.js +23 -31
- package/dist/cjs/input/DateInput.js +1 -1
- package/dist/cjs/input/Field.js +1 -0
- package/dist/cjs/input/File.js +1 -1
- package/dist/cjs/input/Input.js +5 -3
- package/dist/cjs/input/Number.js +1 -1
- package/dist/cjs/input/Password.js +1 -1
- package/dist/cjs/input/RangeSlider.js +2 -2
- package/dist/cjs/input/Search.js +1 -1
- package/dist/cjs/input/Slider.js +2 -2
- package/dist/cjs/input/Textarea.js +1 -1
- package/dist/cjs/internal/InputWrapper.js +2 -2
- package/dist/cjs/select/DualList.js +4 -1
- package/dist/cjs/select/List.js +3 -1
- package/dist/cjs/select/Select.js +3 -1
- package/dist/cjs/select/useSelect.js +1 -1
- package/dist/esm/form/Form.js +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/input/ColorInput.js +23 -31
- package/dist/esm/input/DateInput.js +1 -1
- package/dist/esm/input/Field.js +1 -0
- package/dist/esm/input/File.js +1 -1
- package/dist/esm/input/Input.js +5 -3
- package/dist/esm/input/Number.js +1 -1
- package/dist/esm/input/Password.js +1 -1
- package/dist/esm/input/RangeSlider.js +2 -2
- package/dist/esm/input/Search.js +1 -1
- package/dist/esm/input/Slider.js +2 -2
- package/dist/esm/input/Textarea.js +1 -1
- package/dist/esm/internal/InputWrapper.js +2 -2
- package/dist/esm/select/DualList.js +4 -1
- package/dist/esm/select/List.js +3 -1
- package/dist/esm/select/Select.js +3 -1
- package/dist/esm/select/useSelect.js +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/input/ColorInput.d.ts +1 -1
- package/dist/types/input/Input.d.ts +1 -1
- package/dist/types/select/DualList.d.ts +6 -2
- package/dist/types/select/List.d.ts +1 -1
- package/dist/types/select/Select.d.ts +1 -1
- package/dist/types/types/index.d.ts +6 -1
- package/package.json +5 -5
- package/src/form/Form.tsx +1 -1
- package/src/index.ts +1 -0
- package/src/input/ColorInput.tsx +13 -42
- package/src/input/DateInput.tsx +1 -1
- package/src/input/Field.tsx +1 -0
- package/src/input/File.tsx +1 -1
- package/src/input/Input.tsx +7 -2
- package/src/input/Number.tsx +1 -1
- package/src/input/Password.tsx +1 -1
- package/src/input/RangeSlider.tsx +2 -2
- package/src/input/Search.tsx +1 -1
- package/src/input/Slider.tsx +2 -2
- package/src/input/Textarea.tsx +1 -1
- package/src/internal/InputWrapper.tsx +6 -3
- package/src/select/DualList.tsx +8 -0
- package/src/select/List.tsx +2 -0
- package/src/select/Select.tsx +2 -0
- package/src/select/useSelect.tsx +1 -0
- package/src/types/index.ts +7 -0
|
@@ -108,7 +108,7 @@ export const InputWrapper = ({
|
|
|
108
108
|
invalid && "fabric-invalidWrapper",
|
|
109
109
|
!noOutline &&
|
|
110
110
|
!noBorder &&
|
|
111
|
-
"bg-(--fabric-input) outline
|
|
111
|
+
"bg-(--fabric-input) outline overflow-hidden",
|
|
112
112
|
"flex flex-nowrap items-center flex-1",
|
|
113
113
|
textarea ? "rounded-capped group" : "rounded",
|
|
114
114
|
isExpanded
|
|
@@ -117,7 +117,7 @@ export const InputWrapper = ({
|
|
|
117
117
|
? "absolute inset-x-0"
|
|
118
118
|
: "relative",
|
|
119
119
|
!noOutline &&
|
|
120
|
-
"after:absolute after:bottom-0 after:h-
|
|
120
|
+
"after:absolute after:bottom-0 after:h-px after:bg-primary-500 after:mx-auto",
|
|
121
121
|
)}
|
|
122
122
|
onKeyDown={(e) =>
|
|
123
123
|
e.key === "Escape" &&
|
|
@@ -190,7 +190,10 @@ export const InputWrapper = ({
|
|
|
190
190
|
<Wrapper {...wrapperProps}>
|
|
191
191
|
<div
|
|
192
192
|
ref={elRef}
|
|
193
|
-
className=
|
|
193
|
+
className={classNames(
|
|
194
|
+
"relative min-h-8 flex flex-col flex-nowrap",
|
|
195
|
+
width ? "flex-auto" : "flex-1",
|
|
196
|
+
)}
|
|
194
197
|
style={{ width, flexBasis: width }}
|
|
195
198
|
>
|
|
196
199
|
{el}
|
package/src/select/DualList.tsx
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
import { Button, ButtonGroup, CoreIcons } from "@react-fabric/core";
|
|
25
25
|
import { type RefProp } from "@react-fabric/core/dist/types/types";
|
|
26
26
|
import {
|
|
27
|
+
type ReactElement,
|
|
27
28
|
useCallback,
|
|
28
29
|
useDeferredValue,
|
|
29
30
|
useEffect,
|
|
@@ -68,6 +69,10 @@ export interface DualListProps<T>
|
|
|
68
69
|
* value property name
|
|
69
70
|
*/
|
|
70
71
|
valueProperty?: keyof T;
|
|
72
|
+
/**
|
|
73
|
+
* empty list display
|
|
74
|
+
*/
|
|
75
|
+
emptyDisplay?: ReactElement;
|
|
71
76
|
/**
|
|
72
77
|
* item renderer
|
|
73
78
|
*/
|
|
@@ -82,6 +87,7 @@ export const DualList = <T extends AnyObject = string>({
|
|
|
82
87
|
ref,
|
|
83
88
|
value,
|
|
84
89
|
options,
|
|
90
|
+
emptyDisplay,
|
|
85
91
|
groupProperty,
|
|
86
92
|
height = "18rem",
|
|
87
93
|
labelProperty = "label" as AnyObject,
|
|
@@ -210,6 +216,7 @@ export const DualList = <T extends AnyObject = string>({
|
|
|
210
216
|
error={error}
|
|
211
217
|
height={height}
|
|
212
218
|
options={leftOptions}
|
|
219
|
+
emptyDisplay={emptyDisplay}
|
|
213
220
|
groupProperty={groupProperty}
|
|
214
221
|
labelProperty={labelProperty}
|
|
215
222
|
valueProperty={valueProperty}
|
|
@@ -268,6 +275,7 @@ export const DualList = <T extends AnyObject = string>({
|
|
|
268
275
|
allowClear
|
|
269
276
|
height={height}
|
|
270
277
|
options={rightOptions}
|
|
278
|
+
emptyDisplay={emptyDisplay}
|
|
271
279
|
groupProperty={groupProperty}
|
|
272
280
|
labelProperty={labelProperty}
|
|
273
281
|
valueProperty={valueProperty}
|
package/src/select/List.tsx
CHANGED
|
@@ -63,6 +63,7 @@ export const List = <T extends AnyObject = string>({
|
|
|
63
63
|
onChange,
|
|
64
64
|
onSelect,
|
|
65
65
|
onEnterPressed,
|
|
66
|
+
emptyDisplay,
|
|
66
67
|
invalid,
|
|
67
68
|
error,
|
|
68
69
|
allowClear,
|
|
@@ -308,6 +309,7 @@ export const List = <T extends AnyObject = string>({
|
|
|
308
309
|
labelProperty={labelProperty}
|
|
309
310
|
itemRef={setItemRef}
|
|
310
311
|
itemProps={makeItemProps}
|
|
312
|
+
empty={emptyDisplay}
|
|
311
313
|
>
|
|
312
314
|
{(item, label) => renderer?.(item) ?? label}
|
|
313
315
|
</Options>
|
package/src/select/Select.tsx
CHANGED
|
@@ -64,6 +64,7 @@ export const Select = <T extends AnyObject = string>({
|
|
|
64
64
|
multiple,
|
|
65
65
|
searchable,
|
|
66
66
|
allowCreate,
|
|
67
|
+
emptyDisplay,
|
|
67
68
|
createOption,
|
|
68
69
|
matcher,
|
|
69
70
|
renderer,
|
|
@@ -345,6 +346,7 @@ export const Select = <T extends AnyObject = string>({
|
|
|
345
346
|
labelProperty={labelProperty}
|
|
346
347
|
itemRef={setItemRef}
|
|
347
348
|
itemProps={makeItemProps}
|
|
349
|
+
empty={emptyDisplay}
|
|
348
350
|
>
|
|
349
351
|
{(item, label) => renderer?.(item) ?? label}
|
|
350
352
|
</Options>
|
package/src/select/useSelect.tsx
CHANGED
package/src/types/index.ts
CHANGED
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
type RefProp,
|
|
26
26
|
type TestProps,
|
|
27
27
|
} from "@react-fabric/core/dist/types/types";
|
|
28
|
+
import { type ReactElement } from "react";
|
|
28
29
|
|
|
29
30
|
export interface InputProps<V = string> extends TestProps {
|
|
30
31
|
/**
|
|
@@ -79,6 +80,8 @@ export interface InputProps<V = string> extends TestProps {
|
|
|
79
80
|
*/
|
|
80
81
|
info?: string;
|
|
81
82
|
|
|
83
|
+
monospace?: boolean;
|
|
84
|
+
|
|
82
85
|
/**
|
|
83
86
|
* required
|
|
84
87
|
*/
|
|
@@ -155,6 +158,10 @@ export interface BaseSelectProps<T extends AnyObject = string> {
|
|
|
155
158
|
* allow create item
|
|
156
159
|
*/
|
|
157
160
|
allowCreate?: boolean;
|
|
161
|
+
/**
|
|
162
|
+
* empty list display
|
|
163
|
+
*/
|
|
164
|
+
emptyDisplay?: ReactElement;
|
|
158
165
|
/**
|
|
159
166
|
* create new item object
|
|
160
167
|
*/
|