ant-float-label 1.0.5 → 1.0.7

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.css CHANGED
@@ -4,4 +4,4 @@
4
4
  .ant-float-label-form-input-number {border:none!important;box-shadow:none!important;}
5
5
  .ant-float-label-form-picker {border:none!important;box-shadow:none!important;}
6
6
  .ant-float-label-form-select .ant-select-selector {border:none!important;box-shadow:none!important;}.ant-float-label-form-select{height:auto!important;}
7
- .ant-float-label-form-input-password{position:static;}
7
+ .ant-float-label-form-input-password{position:static!important;}
package/dist/index.js CHANGED
@@ -83,7 +83,7 @@ function FloatAutoComplete({ placeholder, onFocus, onBlur, value, defaultValue,
83
83
  initFlag.current = false;
84
84
  };
85
85
  }, [value]);
86
- return (jsx(FloattingLabelBox, { label: placeholder, focused: isFocus, haveValue: !!inputValue, width: style?.width, height: style?.height, status: restProps.status, children: jsx(AutoComplete, { style: {
86
+ 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(AutoComplete, { style: {
87
87
  width: "100%",
88
88
  ...style,
89
89
  border: "none",
@@ -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, 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" }, ...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, 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" }, ...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, 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" }, ...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,7 +219,7 @@ 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, 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" }, ...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;
@@ -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, children: jsx(RangePicker, { 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: haveValue ? ["", ""] : placeholder }) }));
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, size: size, 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, 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" }, ...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 }) {
@@ -337,7 +337,7 @@ function FloatTimePicker({ placeholder, onFocus, onBlur, value, defaultValue, st
337
337
  : inputValue;
338
338
  return !!currValue;
339
339
  }, [inputValue]);
340
- return (jsx(FloattingLabelBox, { label: placeholder, focused: isFocus, haveValue: haveValue, width: style?.width, height: style?.height, status: restProps.status, children: jsx(TimePicker, { style: {
340
+ 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(TimePicker, { style: {
341
341
  ...style,
342
342
  width: "100%",
343
343
  border: "none",
@@ -381,7 +381,7 @@ function FloatTreeSelect({ placeholder, onFocus, onBlur, value, defaultValue, st
381
381
  : inputValue;
382
382
  return !!currValue;
383
383
  }, [inputValue]);
384
- return (jsx(FloattingLabelBox, { label: placeholder, focused: isFocus, haveValue: haveValue, width: style?.width, height: style?.height, status: restProps.status, children: jsx(TreeSelect, { style: {
384
+ 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(TreeSelect, { style: {
385
385
  ...style,
386
386
  width: "100%",
387
387
  border: "none",
@@ -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, 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" }, ...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 };
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ant-float-label",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "Antd 5 form style similar to MUI",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ant-float-label",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "Antd 5 form style similar to MUI",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",