@weareconceptstudio/form 0.0.8 → 0.0.9

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.
@@ -40,6 +40,8 @@ const BaseForm = forwardRef(({ initialValues: defaultValues, values, children, o
40
40
  }, [methods, onSubmit]);
41
41
  useImperativeHandle(ref, () => ({
42
42
  ...methods,
43
+ isValid: methods.formState.isValid,
44
+ isFormTouched: Object.keys(methods.formState.touchedFields).length > 0,
43
45
  submit: () => methods.handleSubmit(handleSubmit)(),
44
46
  }));
45
47
  return (React.createElement(FormProvider, { ...methods },
@@ -52,6 +52,13 @@ const Select = (props) => {
52
52
  select_empty || empty,
53
53
  React.createElement("p", { className: `no-options` }, 'No Data')));
54
54
  };
55
+ //! Custom Styles
56
+ const customStyles = {
57
+ menuList: (provided) => ({
58
+ ...provided,
59
+ maxHeight: '144px',
60
+ }),
61
+ };
55
62
  const options = useMemo(() => {
56
63
  const newOptions = [];
57
64
  const labelKey = optionKey ?? 'name';
@@ -82,7 +89,7 @@ const Select = (props) => {
82
89
  return (React.createElement(ReactSelect
83
90
  // unstyled
84
91
  // menuIsOpen={true}
85
- , { ...selectProps, options: options, isMulti: multiple, isLoading: loading, isDisabled: disabled, className: classString, isClearable: allowClear, isSearchable: allowSearch, components: customComponents, classNamePrefix: 'react-select', noOptionsMessage: customNoOptionsMessage, value: options.filter((opt) => (multiple ? selectProps.value.includes(opt.value) : opt.value === selectProps.value)) }));
92
+ , { ...selectProps, options: options, isMulti: multiple, isLoading: loading, styles: customStyles, isDisabled: disabled, className: classString, isClearable: allowClear, isSearchable: allowSearch, components: customComponents, classNamePrefix: 'react-select', noOptionsMessage: customNoOptionsMessage, value: options.filter((opt) => (multiple ? selectProps.value.includes(opt.value) : opt.value === selectProps.value)) }));
86
93
  };
87
94
  if (process.env.NODE_ENV !== 'production') {
88
95
  Select.displayName = 'Select';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weareconceptstudio/form",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "Concept Studio Form",
5
5
  "author": "Concept Studio",
6
6
  "license": "ISC",