ant-float-label 1.0.7 → 1.0.8
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 +1 -0
- package/dist/README.md +1 -0
- package/dist/component/FloatRangePicker/index.d.ts +1 -1
- package/dist/index.js +11 -11
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/README.md
CHANGED
|
@@ -2,4 +2,4 @@ import "./index.css";
|
|
|
2
2
|
import { RangePickerProps } from "antd/es/date-picker";
|
|
3
3
|
export interface FloatRangePickerProps extends RangePickerProps {
|
|
4
4
|
}
|
|
5
|
-
export declare function FloatRangePicker({ placeholder, onFocus, onBlur, value, defaultValue, style,
|
|
5
|
+
export declare function FloatRangePicker({ placeholder, onFocus, onBlur, value, defaultValue, style, onChange, ...restProps }: FloatRangePickerProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -87,7 +87,7 @@ function FloatAutoComplete({ placeholder, onFocus, onBlur, value, defaultValue,
|
|
|
87
87
|
width: "100%",
|
|
88
88
|
...style,
|
|
89
89
|
border: "none",
|
|
90
|
-
}, ...restProps, onFocus: handleFocus, onBlur: handleBlur, value: value, defaultValue: defaultValue, size: size, onChange: handleChange, rootClassName: "ant-float-label-form-auto-complete" }) }));
|
|
90
|
+
}, variant: "borderless", ...restProps, onFocus: handleFocus, onBlur: handleBlur, value: value, defaultValue: defaultValue, size: size, onChange: handleChange, rootClassName: "ant-float-label-form-auto-complete" }) }));
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
function FloatCascader({ placeholder, onFocus, onBlur, value, defaultValue, style, size, onChange, ...restProps }) {
|
|
@@ -127,7 +127,7 @@ function FloatCascader({ placeholder, onFocus, onBlur, value, defaultValue, styl
|
|
|
127
127
|
: inputValue;
|
|
128
128
|
return !!currValue;
|
|
129
129
|
}, [inputValue]);
|
|
130
|
-
return (jsx(FloattingLabelBox, { label: placeholder, focused: isFocus, haveValue: haveValue, width: style?.width, height: style?.height, status: restProps.status || (restProps["aria-invalid"] ? "error" : undefined), children: jsx(Cascader, { style: { ...style, width: "100%", border: "none" }, ...restProps, onFocus: handleFocus, onBlur: handleBlur, value: value, defaultValue: defaultValue, size: size, onChange: handleChange, rootClassName: "ant-float-label-form-select" }) }));
|
|
130
|
+
return (jsx(FloattingLabelBox, { label: placeholder, focused: isFocus, haveValue: haveValue, width: style?.width, height: style?.height, status: restProps.status || (restProps["aria-invalid"] ? "error" : undefined), children: jsx(Cascader, { style: { ...style, width: "100%", border: "none" }, variant: "borderless", ...restProps, onFocus: handleFocus, onBlur: handleBlur, value: value, defaultValue: defaultValue, size: size, onChange: handleChange, rootClassName: "ant-float-label-form-select" }) }));
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
function FloatDatePicker({ placeholder, onFocus, onBlur, value, defaultValue, style, size, onChange, ...restProps }) {
|
|
@@ -161,7 +161,7 @@ function FloatDatePicker({ placeholder, onFocus, onBlur, value, defaultValue, st
|
|
|
161
161
|
initFlag.current = false;
|
|
162
162
|
};
|
|
163
163
|
}, [value]);
|
|
164
|
-
return (jsx(FloattingLabelBox, { label: placeholder, focused: isFocus, haveValue: !!inputValue, width: style?.width, height: style?.height, status: restProps.status || (restProps["aria-invalid"] ? "error" : undefined), children: jsx(DatePicker, { style: { ...style, width: "100%", border: "none" }, ...restProps, onFocus: handleFocus, onBlur: handleBlur, value: value, defaultValue: defaultValue, size: size, onChange: handleChange, rootClassName: "ant-float-label-form-picker", placeholder: "" }) }));
|
|
164
|
+
return (jsx(FloattingLabelBox, { label: placeholder, focused: isFocus, haveValue: !!inputValue, width: style?.width, height: style?.height, status: restProps.status || (restProps["aria-invalid"] ? "error" : undefined), children: jsx(DatePicker, { style: { ...style, width: "100%", border: "none" }, variant: "borderless", ...restProps, onFocus: handleFocus, onBlur: handleBlur, value: value, defaultValue: defaultValue, size: size, onChange: handleChange, rootClassName: "ant-float-label-form-picker", placeholder: "" }) }));
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
function FloatInput({ placeholder, onFocus, onBlur, value, defaultValue, style, size, ...restProps }) {
|
|
@@ -190,7 +190,7 @@ function FloatInput({ placeholder, onFocus, onBlur, value, defaultValue, style,
|
|
|
190
190
|
initFlag.current = false;
|
|
191
191
|
};
|
|
192
192
|
}, [value]);
|
|
193
|
-
return (jsx(FloattingLabelBox, { label: placeholder, focused: isFocus, haveValue: !!inputValue, width: style?.width, height: style?.height, status: restProps.status || (restProps["aria-invalid"] ? "error" : undefined), children: jsx(Input, { style: { ...style, width: "100%", border: "none" }, ...restProps, onFocus: handleFocus, onBlur: handleBlur, value: value, defaultValue: defaultValue, size: size }) }));
|
|
193
|
+
return (jsx(FloattingLabelBox, { label: placeholder, focused: isFocus, haveValue: !!inputValue, width: style?.width, height: style?.height, status: restProps.status || (restProps["aria-invalid"] ? "error" : undefined), children: jsx(Input, { style: { ...style, width: "100%", border: "none" }, variant: "borderless", ...restProps, onFocus: handleFocus, onBlur: handleBlur, value: value, defaultValue: defaultValue, size: size }) }));
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
function FloatInputNumber({ placeholder, onFocus, onBlur, value, defaultValue, style, size, ...restProps }) {
|
|
@@ -219,11 +219,11 @@ function FloatInputNumber({ placeholder, onFocus, onBlur, value, defaultValue, s
|
|
|
219
219
|
initFlag.current = false;
|
|
220
220
|
};
|
|
221
221
|
}, [value]);
|
|
222
|
-
return (jsx(FloattingLabelBox, { label: placeholder, focused: isFocus, haveValue: !!inputValue, width: style?.width, height: style?.height, status: restProps.status || (restProps["aria-invalid"] ? "error" : undefined), children: jsx(InputNumber, { style: { ...style, width: "100%", border: "none" }, ...restProps, onFocus: handleFocus, onBlur: handleBlur, value: value, defaultValue: defaultValue, size: size, rootClassName: "ant-float-label-form-input-number" }) }));
|
|
222
|
+
return (jsx(FloattingLabelBox, { label: placeholder, focused: isFocus, haveValue: !!inputValue, width: style?.width, height: style?.height, status: restProps.status || (restProps["aria-invalid"] ? "error" : undefined), children: jsx(InputNumber, { style: { ...style, width: "100%", border: "none" }, variant: "borderless", ...restProps, onFocus: handleFocus, onBlur: handleBlur, value: value, defaultValue: defaultValue, size: size, rootClassName: "ant-float-label-form-input-number" }) }));
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
const { RangePicker } = DatePicker;
|
|
226
|
-
function FloatRangePicker({ placeholder, onFocus, onBlur, value, defaultValue, style,
|
|
226
|
+
function FloatRangePicker({ placeholder, onFocus, onBlur, value, defaultValue, style, onChange, ...restProps }) {
|
|
227
227
|
const initFlag = useRef(false);
|
|
228
228
|
const [isFocus, setIsFocus] = useState(false);
|
|
229
229
|
const [inputValue, setInputValue] = useState(defaultValue ?? value);
|
|
@@ -257,7 +257,7 @@ function FloatRangePicker({ placeholder, onFocus, onBlur, value, defaultValue, s
|
|
|
257
257
|
const haveValue = useMemo(() => {
|
|
258
258
|
return !!(isFocus || inputValue);
|
|
259
259
|
}, [inputValue, isFocus]);
|
|
260
|
-
return (jsx(FloattingLabelBox, { label: haveValue && placeholder ? placeholder.join(" - ") : "", focused: isFocus, haveValue: haveValue, width: style?.width, height: style?.height, status: restProps.status || (restProps["aria-invalid"] ? "error" : undefined), children: jsx(RangePicker, { style: { ...style, width: "100%", border: "none" }, ...restProps, onFocus: handleFocus, onBlur: handleBlur, value: value, defaultValue: defaultValue,
|
|
260
|
+
return (jsx(FloattingLabelBox, { label: haveValue && placeholder ? placeholder.join(" - ") : "", focused: isFocus, haveValue: haveValue, width: style?.width, height: style?.height, status: restProps.status || (restProps["aria-invalid"] ? "error" : undefined), children: jsx(RangePicker, { style: { ...style, width: "100%", border: "none" }, variant: "borderless", ...restProps, onFocus: handleFocus, onBlur: handleBlur, value: value, defaultValue: defaultValue, onChange: handleChange, rootClassName: "ant-float-label-form-picker", placeholder: haveValue ? ["", ""] : placeholder }) }));
|
|
261
261
|
}
|
|
262
262
|
|
|
263
263
|
function FloatSelect({ placeholder, onFocus, onBlur, value, defaultValue, style, size, mode, onChange, ...restProps }) {
|
|
@@ -297,7 +297,7 @@ function FloatSelect({ placeholder, onFocus, onBlur, value, defaultValue, style,
|
|
|
297
297
|
: inputValue;
|
|
298
298
|
return !!currValue;
|
|
299
299
|
}, [inputValue]);
|
|
300
|
-
return (jsx(FloattingLabelBox, { label: placeholder, focused: isFocus, haveValue: haveValue, width: style?.width, height: style?.height, status: restProps.status || (restProps["aria-invalid"] ? "error" : undefined), children: jsx(Select, { style: { ...style, width: "100%", border: "none" }, ...restProps, onFocus: handleFocus, onBlur: handleBlur, value: value, defaultValue: defaultValue, size: size, onChange: handleChange, mode: mode, rootClassName: "ant-float-label-form-select" }) }));
|
|
300
|
+
return (jsx(FloattingLabelBox, { label: placeholder, focused: isFocus, haveValue: haveValue, width: style?.width, height: style?.height, status: restProps.status || (restProps["aria-invalid"] ? "error" : undefined), children: jsx(Select, { style: { ...style, width: "100%", border: "none" }, variant: "borderless", ...restProps, onFocus: handleFocus, onBlur: handleBlur, value: value, defaultValue: defaultValue, size: size, onChange: handleChange, mode: mode, rootClassName: "ant-float-label-form-select" }) }));
|
|
301
301
|
}
|
|
302
302
|
|
|
303
303
|
function FloatTimePicker({ placeholder, onFocus, onBlur, value, defaultValue, style, size, mode, onChange, ...restProps }) {
|
|
@@ -341,7 +341,7 @@ function FloatTimePicker({ placeholder, onFocus, onBlur, value, defaultValue, st
|
|
|
341
341
|
...style,
|
|
342
342
|
width: "100%",
|
|
343
343
|
border: "none",
|
|
344
|
-
}, ...restProps, onFocus: handleFocus, onBlur: handleBlur, value: value, defaultValue: defaultValue, size: size, onChange: handleChange, mode: mode, rootClassName: "ant-float-label-form-select", placeholder: "" }) }));
|
|
344
|
+
}, variant: "borderless", ...restProps, onFocus: handleFocus, onBlur: handleBlur, value: value, defaultValue: defaultValue, size: size, onChange: handleChange, mode: mode, rootClassName: "ant-float-label-form-select", placeholder: "" }) }));
|
|
345
345
|
}
|
|
346
346
|
|
|
347
347
|
function FloatTreeSelect({ placeholder, onFocus, onBlur, value, defaultValue, style, size, onChange, ...restProps }) {
|
|
@@ -385,7 +385,7 @@ function FloatTreeSelect({ placeholder, onFocus, onBlur, value, defaultValue, st
|
|
|
385
385
|
...style,
|
|
386
386
|
width: "100%",
|
|
387
387
|
border: "none",
|
|
388
|
-
}, ...restProps, onFocus: handleFocus, onBlur: handleBlur, value: value, defaultValue: defaultValue, size: size, onChange: handleChange, rootClassName: "ant-float-label-form-select" }) }));
|
|
388
|
+
}, variant: "borderless", ...restProps, onFocus: handleFocus, onBlur: handleBlur, value: value, defaultValue: defaultValue, size: size, onChange: handleChange, rootClassName: "ant-float-label-form-select" }) }));
|
|
389
389
|
}
|
|
390
390
|
|
|
391
391
|
const { Password } = Input;
|
|
@@ -415,7 +415,7 @@ function FloatPassword({ placeholder, onFocus, onBlur, value, defaultValue, styl
|
|
|
415
415
|
initFlag.current = false;
|
|
416
416
|
};
|
|
417
417
|
}, [value]);
|
|
418
|
-
return (jsx(FloattingLabelBox, { label: placeholder, focused: isFocus, haveValue: !!inputValue, width: style?.width, height: style?.height, status: restProps.status || (restProps["aria-invalid"] ? "error" : undefined), children: jsx(Password, { style: { ...style, width: "100%", border: "none" }, ...restProps, onFocus: handleFocus, onBlur: handleBlur, value: value, defaultValue: defaultValue, size: size, rootClassName: "ant-float-label-form-input-password" }) }));
|
|
418
|
+
return (jsx(FloattingLabelBox, { label: placeholder, focused: isFocus, haveValue: !!inputValue, width: style?.width, height: style?.height, status: restProps.status || (restProps["aria-invalid"] ? "error" : undefined), children: jsx(Password, { style: { ...style, width: "100%", border: "none" }, variant: "borderless", ...restProps, onFocus: handleFocus, onBlur: handleBlur, value: value, defaultValue: defaultValue, size: size, rootClassName: "ant-float-label-form-input-password" }) }));
|
|
419
419
|
}
|
|
420
420
|
|
|
421
421
|
export { FloatAutoComplete, FloatCascader, FloatDatePicker, FloatInput, FloatInputNumber, FloatPassword, FloatRangePicker, FloatSelect, FloatTimePicker, FloatTreeSelect, FloattingLabelBox };
|