next-helios-fe 1.8.11 → 1.8.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-helios-fe",
3
- "version": "1.8.11",
3
+ "version": "1.8.12",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -76,12 +76,14 @@ export const MultipleSelect: React.FC<MultipleSelectProps> = ({
76
76
  }, [value]);
77
77
 
78
78
  useEffect(() => {
79
- if (tempValue.length === 0) {
80
- inputRef.current?.setCustomValidity(
81
- "Please select some items in the list."
82
- );
83
- } else {
84
- inputRef.current?.setCustomValidity("");
79
+ if (required) {
80
+ if (tempValue.length === 0) {
81
+ inputRef.current?.setCustomValidity(
82
+ "Please select some items in the list."
83
+ );
84
+ } else {
85
+ inputRef.current?.setCustomValidity("");
86
+ }
85
87
  }
86
88
  }, [tempValue]);
87
89
 
@@ -1605,6 +1605,8 @@ export const PhoneNumber: React.FC<PhoneNumberProps> = ({
1605
1605
  type="number"
1606
1606
  className={`w-full ps-16 pe-4 border-default border rounded-md bg-secondary-bg [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none placeholder:duration-300 placeholder:translate-x-0 focus:placeholder:translate-x-1 placeholder:text-silent focus:outline-none focus:ring-1 focus:ring-primary focus:shadow focus:shadow-primary focus:border-primary-dark disabled:bg-secondary-light disabled:text-disabled ${height}`}
1607
1607
  value={tempValue[1]}
1608
+ required={rest.required}
1609
+ disabled={rest.disabled}
1608
1610
  onChange={(e) => {
1609
1611
  setTempValue((prev) => [prev[0], e.target.value]);
1610
1612
  }}
@@ -62,10 +62,14 @@ export const Select: React.FC<SelectProps> = ({
62
62
  }, [rest.value, rest.defaultValue]);
63
63
 
64
64
  useEffect(() => {
65
- if (!tempValue) {
66
- inputRef.current?.setCustomValidity("Please select an item in the list.");
67
- } else {
68
- inputRef.current?.setCustomValidity("");
65
+ if (rest.required) {
66
+ if (!tempValue) {
67
+ inputRef.current?.setCustomValidity(
68
+ "Please select an item in the list."
69
+ );
70
+ } else {
71
+ inputRef.current?.setCustomValidity("");
72
+ }
69
73
  }
70
74
  }, [tempValue]);
71
75