shadcn-zod-formkit 1.19.0 → 1.20.0
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.cjs +6 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +6 -4
- package/dist/index.mjs.map +1 -1
- package/dist/shadcn-zod-formkit-1.20.0.tgz +0 -0
- package/package.json +1 -1
- package/dist/shadcn-zod-formkit-1.19.0.tgz +0 -0
package/dist/index.cjs
CHANGED
|
@@ -1806,19 +1806,22 @@ function ButtonGroup({
|
|
|
1806
1806
|
var ButtonGroupInput = class extends BaseInput {
|
|
1807
1807
|
render() {
|
|
1808
1808
|
const { input, form, isSubmitting } = this;
|
|
1809
|
-
|
|
1809
|
+
const className = input.className;
|
|
1810
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FieldButtonGroup, { input, form, isSubmitting, className });
|
|
1810
1811
|
}
|
|
1811
1812
|
};
|
|
1812
|
-
var FieldButtonGroup = ({ input, form, isSubmitting }) => {
|
|
1813
|
+
var FieldButtonGroup = ({ input, form, isSubmitting, className = "w-full flex-1" }) => {
|
|
1813
1814
|
const options = (input.listConfig?.list ?? []).filter((option) => "name" in option);
|
|
1814
1815
|
const handleSelect = (value) => {
|
|
1815
1816
|
form.setValue(input.name, value, { shouldValidate: true });
|
|
1817
|
+
if (input.listConfig?.onOptionChange) input.listConfig.onOptionChange(value);
|
|
1816
1818
|
};
|
|
1817
1819
|
const selectedValue = form.watch(input.name);
|
|
1818
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ButtonGroup, { children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1820
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ButtonGroup, { className: "flex flex-row w-full", children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1819
1821
|
Button,
|
|
1820
1822
|
{
|
|
1821
1823
|
type: "button",
|
|
1824
|
+
className,
|
|
1822
1825
|
variant: selectedValue === option.value ? "default" : "outline",
|
|
1823
1826
|
onClick: () => handleSelect(option.value),
|
|
1824
1827
|
disabled: isSubmitting,
|
|
@@ -4015,7 +4018,6 @@ var FieldFile = ({ form, input, isSubmitting }) => {
|
|
|
4015
4018
|
if (file) {
|
|
4016
4019
|
const objectUrl = URL.createObjectURL(file);
|
|
4017
4020
|
setPreview(objectUrl);
|
|
4018
|
-
console.log("\u{1F680} ~ handleFileChange ~ objectUrl:", objectUrl);
|
|
4019
4021
|
} else {
|
|
4020
4022
|
setPreview(null);
|
|
4021
4023
|
}
|