@farmzone/fz-react-ui 1.1.3 → 1.1.5

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.cts CHANGED
@@ -966,6 +966,7 @@ type SelectableOption = {
966
966
  interface BaseOption<P> {
967
967
  label?: string;
968
968
  key: keyof P;
969
+ className?: string;
969
970
  }
970
971
  type InputOption<P> = BaseOption<P> & {
971
972
  type: "input";
@@ -1014,6 +1015,8 @@ interface PageFilterProps<P> {
1014
1015
  colGap?: number;
1015
1016
  submitButtonText?: string;
1016
1017
  resetButtonText?: string;
1018
+ showSubmitButton?: boolean;
1019
+ showResetButton?: boolean;
1017
1020
  values: P;
1018
1021
  primaryColor?: string;
1019
1022
  }
package/dist/index.d.ts CHANGED
@@ -966,6 +966,7 @@ type SelectableOption = {
966
966
  interface BaseOption<P> {
967
967
  label?: string;
968
968
  key: keyof P;
969
+ className?: string;
969
970
  }
970
971
  type InputOption<P> = BaseOption<P> & {
971
972
  type: "input";
@@ -1014,6 +1015,8 @@ interface PageFilterProps<P> {
1014
1015
  colGap?: number;
1015
1016
  submitButtonText?: string;
1016
1017
  resetButtonText?: string;
1018
+ showSubmitButton?: boolean;
1019
+ showResetButton?: boolean;
1017
1020
  values: P;
1018
1021
  primaryColor?: string;
1019
1022
  }
package/dist/index.js CHANGED
@@ -7828,6 +7828,8 @@ function PageFilter(props) {
7828
7828
  colGap = 0,
7829
7829
  submitButtonText = "\uAC80\uC0C9",
7830
7830
  resetButtonText = "\uCD08\uAE30\uD654",
7831
+ showSubmitButton = true,
7832
+ showResetButton = true,
7831
7833
  values,
7832
7834
  primaryColor
7833
7835
  } = props;
@@ -7888,7 +7890,8 @@ function PageFilter(props) {
7888
7890
  onKeyDown: (e) => {
7889
7891
  if (e.key === "Enter") handleSubmit();
7890
7892
  },
7891
- leftIcon: option.leftIcon !== false ? /* @__PURE__ */ jsx(Search, { size: 16 }) : void 0
7893
+ leftIcon: option.leftIcon !== false ? /* @__PURE__ */ jsx(Search, { size: 16 }) : void 0,
7894
+ className: option.className
7892
7895
  }
7893
7896
  ) }, String(optionKey));
7894
7897
  case "select":
@@ -7900,7 +7903,8 @@ function PageFilter(props) {
7900
7903
  options: option.options,
7901
7904
  placeholder: option.placeholder || "\uC120\uD0DD",
7902
7905
  canReset: option.canReset ?? true,
7903
- containerClassName: option.containerClassName ?? "w-30"
7906
+ containerClassName: option.containerClassName ?? "w-30",
7907
+ className: option.className
7904
7908
  }
7905
7909
  ) }, String(optionKey));
7906
7910
  case "radio":
@@ -7911,7 +7915,8 @@ function PageFilter(props) {
7911
7915
  value: currentValue,
7912
7916
  onChange: handleRadioChange(optionKey, option.autoSubmit),
7913
7917
  options: option.options,
7914
- direction: "horizontal"
7918
+ direction: "horizontal",
7919
+ containerClassName: option.className
7915
7920
  }
7916
7921
  ) }, String(optionKey));
7917
7922
  case "date":
@@ -7921,7 +7926,8 @@ function PageFilter(props) {
7921
7926
  value: currentValue,
7922
7927
  onChange: handleDateChange(optionKey),
7923
7928
  placeholder: option.placeholder,
7924
- onKeyDownEnter: handleSubmit
7929
+ onKeyDownEnter: handleSubmit,
7930
+ className: option.className
7925
7931
  }
7926
7932
  ) }, String(optionKey));
7927
7933
  case "date-range":
@@ -7931,17 +7937,20 @@ function PageFilter(props) {
7931
7937
  startValue: currentValue,
7932
7938
  endValue: String(values[option.endKey] ?? ""),
7933
7939
  onRangeChange: handleRangeChangeCurried(optionKey, option.endKey),
7934
- onKeyDownEnter: handleSubmit
7940
+ onKeyDownEnter: handleSubmit,
7941
+ className: option.className
7935
7942
  }
7936
7943
  ) }, String(optionKey));
7937
7944
  case "checkbox":
7938
- return /* @__PURE__ */ jsx(LabeledFilterOption, { label: option.label, gap: rowGap2, children: /* @__PURE__ */ jsx(
7945
+ return /* @__PURE__ */ jsx(LabeledFilterOption, { gap: rowGap2, children: /* @__PURE__ */ jsx(
7939
7946
  Checkbox,
7940
7947
  {
7941
7948
  checked: currentValue === "true",
7942
7949
  name: String(optionKey),
7943
7950
  value: currentValue,
7944
- onChange: handleCheckboxChange(optionKey, option.autoSubmit)
7951
+ label: option.label,
7952
+ onChange: handleCheckboxChange(optionKey, option.autoSubmit),
7953
+ className: option.className
7945
7954
  }
7946
7955
  ) }, String(optionKey));
7947
7956
  default: {
@@ -7959,9 +7968,9 @@ function PageFilter(props) {
7959
7968
  const isLastRow = rows.length - 1 === ix;
7960
7969
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-row min-h-11", children: [
7961
7970
  row.options.map((option, index) => renderFilterOption(option, rowGap, index)),
7962
- isLastRow && /* @__PURE__ */ jsxs("div", { className: "ml-2 flex flex-row items-center gap-2", children: [
7963
- /* @__PURE__ */ jsx(Button, { variant: "search", onClick: handleSubmit, children: submitButtonText }),
7964
- onReset && /* @__PURE__ */ jsx(Button, { variant: "reset", onClick: handleReset, children: resetButtonText })
7971
+ isLastRow && (showSubmitButton || showResetButton && onReset) && /* @__PURE__ */ jsxs("div", { className: "ml-2 flex flex-row items-center gap-2", children: [
7972
+ showSubmitButton && /* @__PURE__ */ jsx(Button, { variant: "search", onClick: handleSubmit, children: submitButtonText }),
7973
+ onReset && showResetButton && /* @__PURE__ */ jsx(Button, { variant: "reset", onClick: handleReset, children: resetButtonText })
7965
7974
  ] })
7966
7975
  ] }, row.options.map((opt) => String(opt.key)).join("_"));
7967
7976
  }) })