shadcn-zod-formkit 1.34.0 → 1.34.1

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.d.mts CHANGED
@@ -207,8 +207,8 @@ declare abstract class BaseInput {
207
207
  constructor(input: FieldProps, form: UseFormReturn, isSubmitting?: boolean | undefined);
208
208
  abstract render(): JSX.Element;
209
209
  }
210
- declare const entityToInputOption: (entitiy: any, name?: string, description?: string, groupedLabel?: string) => InputOption;
211
- declare const entitiesToInputOption: (data: any[], optionValue?: string, groupedLabel?: string) => InputOption[];
210
+ declare const entityToInputOption: (entitiy: any, name?: string, description?: string, groupedLabel?: string, optionLabel?: string) => InputOption;
211
+ declare const entitiesToInputOption: (data: any[], optionValue?: string, groupedLabel?: string, optionLabel?: string) => InputOption[];
212
212
  declare const entityToGroupedOption: (entitiy: any, name?: string) => GroupedOption;
213
213
  declare const entitiesToGroupedOption: (data: any[], optionValue?: string) => GroupedOption[];
214
214
  declare const handleOnChage: (event: any[] | any, input: FieldProps, field?: ControllerRenderProps<FieldValues, string>) => void;
package/dist/index.d.ts CHANGED
@@ -207,8 +207,8 @@ declare abstract class BaseInput {
207
207
  constructor(input: FieldProps, form: UseFormReturn, isSubmitting?: boolean | undefined);
208
208
  abstract render(): JSX.Element;
209
209
  }
210
- declare const entityToInputOption: (entitiy: any, name?: string, description?: string, groupedLabel?: string) => InputOption;
211
- declare const entitiesToInputOption: (data: any[], optionValue?: string, groupedLabel?: string) => InputOption[];
210
+ declare const entityToInputOption: (entitiy: any, name?: string, description?: string, groupedLabel?: string, optionLabel?: string) => InputOption;
211
+ declare const entitiesToInputOption: (data: any[], optionValue?: string, groupedLabel?: string, optionLabel?: string) => InputOption[];
212
212
  declare const entityToGroupedOption: (entitiy: any, name?: string) => GroupedOption;
213
213
  declare const entitiesToGroupedOption: (data: any[], optionValue?: string) => GroupedOption[];
214
214
  declare const handleOnChage: (event: any[] | any, input: FieldProps, field?: ControllerRenderProps<FieldValues, string>) => void;
package/dist/index.mjs CHANGED
@@ -168,16 +168,17 @@ var BaseInput = class {
168
168
  this.isSubmitting = isSubmitting;
169
169
  }
170
170
  };
171
- var entityToInputOption = (entitiy, name = "name", description = "description", groupedLabel) => ({
171
+ var entityToInputOption = (entitiy, name = "name", description = "description", groupedLabel, optionLabel = "label") => ({
172
172
  id: entitiy["id"],
173
173
  name: entitiy[name],
174
+ label: entitiy[optionLabel],
174
175
  description: entitiy[description],
175
176
  groupedLabel
176
177
  });
177
- var entitiesToInputOption = (data, optionValue = "name", groupedLabel) => {
178
+ var entitiesToInputOption = (data, optionValue = "name", groupedLabel, optionLabel = "description") => {
178
179
  const entities = [];
179
180
  for (const key of data) {
180
- const entidad = entityToInputOption(key, optionValue, void 0, groupedLabel);
181
+ const entidad = entityToInputOption(key, optionValue, optionLabel, groupedLabel);
181
182
  if (entidad) entities.push(entidad);
182
183
  }
183
184
  return entities;
@@ -1896,7 +1897,7 @@ var GroupedSwitches = ({ options, onChange, input, isSubmitting }) => {
1896
1897
  ] })
1897
1898
  ] }),
1898
1899
  switches.map((opt, index) => /* @__PURE__ */ jsxs("div", { className: `p-2 rounded-lg flex flex-row w-full items-center justify-between ${!(index % 2) ? "bg-black/5" : "bg-white/5"}`, children: [
1899
- /* @__PURE__ */ jsx(Label, { htmlFor: String(opt.id), children: opt.label || opt.name }),
1900
+ /* @__PURE__ */ jsx(Label, { htmlFor: String(opt.id), children: opt.label || opt.description || opt.name }),
1900
1901
  /* @__PURE__ */ jsx(
1901
1902
  Switch,
1902
1903
  {