@yimingliao/cms 0.0.99 → 0.0.100
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/client/index.d.ts +2 -1
- package/dist/client/index.js +24 -16
- package/package.json +1 -1
package/dist/client/index.d.ts
CHANGED
|
@@ -426,8 +426,9 @@ declare function MainFields({ className, children, ...props }: ComponentProps<"d
|
|
|
426
426
|
declare function SideFields({ className, children, ...props }: ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
427
427
|
|
|
428
428
|
interface InputProps<T extends FormData = FormData> extends ComponentProps<"input">, FormFieldController<T> {
|
|
429
|
+
inputGroupClassName?: string;
|
|
429
430
|
}
|
|
430
|
-
declare function Input<T extends FormData = FormData>({ fieldName, setFormData, isLoading, isDisabled, isError, className, children, ...props }: InputProps<T>): react_jsx_runtime.JSX.Element;
|
|
431
|
+
declare function Input<T extends FormData = FormData>({ fieldName, setFormData, isLoading, isDisabled, isError, className, inputGroupClassName, children, ...props }: InputProps<T>): react_jsx_runtime.JSX.Element;
|
|
431
432
|
|
|
432
433
|
declare function PasswordInput<T extends FormData = FormData>({ ...props }: InputProps<T>): react_jsx_runtime.JSX.Element;
|
|
433
434
|
|
package/dist/client/index.js
CHANGED
|
@@ -713,25 +713,33 @@ function Input({
|
|
|
713
713
|
isError = false,
|
|
714
714
|
// base
|
|
715
715
|
className,
|
|
716
|
+
inputGroupClassName,
|
|
716
717
|
children,
|
|
717
718
|
...props
|
|
718
719
|
}) {
|
|
719
|
-
return /* @__PURE__ */ jsxs(
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
720
|
+
return /* @__PURE__ */ jsxs(
|
|
721
|
+
InputGroup,
|
|
722
|
+
{
|
|
723
|
+
"data-disabled": isDisabled || isLoading,
|
|
724
|
+
className: cn("h-10", inputGroupClassName),
|
|
725
|
+
children: [
|
|
726
|
+
isLoading ? /* @__PURE__ */ jsx(InputGroupAddon, { children: /* @__PURE__ */ jsx(Spinner, {}) }) : /* @__PURE__ */ jsx(
|
|
727
|
+
InputGroupInput,
|
|
728
|
+
{
|
|
729
|
+
disabled: isDisabled || isLoading,
|
|
730
|
+
"aria-invalid": isError,
|
|
731
|
+
onChange: (e) => {
|
|
732
|
+
if (!setFormData || !fieldName) return;
|
|
733
|
+
setFormData((p) => ({ ...p, [fieldName]: e.target.value }));
|
|
734
|
+
},
|
|
735
|
+
className: cn("h-10", className),
|
|
736
|
+
...props
|
|
737
|
+
}
|
|
738
|
+
),
|
|
739
|
+
children
|
|
740
|
+
]
|
|
741
|
+
}
|
|
742
|
+
);
|
|
735
743
|
}
|
|
736
744
|
function PasswordInput({
|
|
737
745
|
...props
|