@farmzone/fz-react-ui 1.0.18 → 1.0.19

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
@@ -976,6 +976,7 @@ type SelectOption<P> = BaseOption<P> & {
976
976
  type RadioOption<P> = BaseOption<P> & {
977
977
  type: "radio";
978
978
  options: Array<SelectableOption>;
979
+ autoSubmit?: boolean;
979
980
  };
980
981
  type DateOption<P> = BaseOption<P> & {
981
982
  type: "date";
@@ -988,6 +989,7 @@ type DateRangeOption<P> = BaseOption<P> & {
988
989
  type CheckboxOption<P> = BaseOption<P> & {
989
990
  type: "checkbox";
990
991
  options: Array<SelectableOption>;
992
+ autoSubmit?: boolean;
991
993
  };
992
994
  type FilterOption<P> = InputOption<P> | SelectOption<P> | RadioOption<P> | DateOption<P> | DateRangeOption<P> | CheckboxOption<P>;
993
995
  interface FilterRow<P> {
package/dist/index.d.ts CHANGED
@@ -976,6 +976,7 @@ type SelectOption<P> = BaseOption<P> & {
976
976
  type RadioOption<P> = BaseOption<P> & {
977
977
  type: "radio";
978
978
  options: Array<SelectableOption>;
979
+ autoSubmit?: boolean;
979
980
  };
980
981
  type DateOption<P> = BaseOption<P> & {
981
982
  type: "date";
@@ -988,6 +989,7 @@ type DateRangeOption<P> = BaseOption<P> & {
988
989
  type CheckboxOption<P> = BaseOption<P> & {
989
990
  type: "checkbox";
990
991
  options: Array<SelectableOption>;
992
+ autoSubmit?: boolean;
991
993
  };
992
994
  type FilterOption<P> = InputOption<P> | SelectOption<P> | RadioOption<P> | DateOption<P> | DateRangeOption<P> | CheckboxOption<P>;
993
995
  interface FilterRow<P> {
package/dist/index.js CHANGED
@@ -717,7 +717,7 @@ function Slider(props) {
717
717
  RadixSlider.Track,
718
718
  {
719
719
  className: cn(
720
- "relative h-[3px] grow rounded-full bg-blackA7",
720
+ "relative h-[3px] grow rounded-full bg-gray-200",
721
721
  orientation === "vertical" && "w-[3px] h-full",
722
722
  trackClassName
723
723
  ),
@@ -725,7 +725,7 @@ function Slider(props) {
725
725
  RadixSlider.Range,
726
726
  {
727
727
  className: cn(
728
- "absolute h-full rounded-full bg-white",
728
+ "absolute h-full rounded-full bg-[#009fe3]",
729
729
  orientation === "vertical" && "w-full",
730
730
  rangeClassName
731
731
  )
@@ -733,17 +733,18 @@ function Slider(props) {
733
733
  )
734
734
  }
735
735
  ),
736
- /* @__PURE__ */ jsx(
736
+ (value ?? defaultValue).map((_, index) => /* @__PURE__ */ jsx(
737
737
  RadixSlider.Thumb,
738
738
  {
739
739
  className: cn(
740
- "block size-5 rounded-[10px] bg-white shadow-[0_2px_10px] shadow-blackA4 hover:bg-violet3 focus:shadow-[0_0_0_5px] focus:shadow-blackA5 focus:outline-none",
740
+ "block size-4 rounded-full bg-white border-2 border-[#009fe3] shadow-md hover:border-[#0090cf] focus:outline-none focus:ring-2 focus:ring-[#009fe3]/40 focus:ring-offset-1",
741
741
  disabled && "cursor-not-allowed opacity-50",
742
742
  thumbClassName
743
743
  ),
744
- "aria-label": ariaLabel
745
- }
746
- )
744
+ "aria-label": index === 0 ? ariaLabel : `${ariaLabel} max`
745
+ },
746
+ index
747
+ ))
747
748
  ]
748
749
  }
749
750
  );
@@ -6114,7 +6115,7 @@ function FilePreviewViewerSession(props) {
6114
6115
  useEffect(() => {
6115
6116
  if (!showNavigation) return;
6116
6117
  const [prevIndex, nextIndex] = getAdjacentIndexes(currentIndex, fileArray.length);
6117
- const urlsToPreload = [prevIndex, nextIndex].filter((idx) => idx !== currentIndex).map((idx) => fileArray[idx]);
6118
+ const urlsToPreload = [prevIndex, nextIndex].filter((idx) => idx !== currentIndex).map((idx) => fileArray[idx]).filter((url) => url !== void 0);
6118
6119
  preloadPreviewImages(urlsToPreload);
6119
6120
  }, [showNavigation, currentIndex, fileArray]);
6120
6121
  useEffect(() => {
@@ -7750,7 +7751,7 @@ var SubmitForm = Object.assign(SubmitFormRoot, {
7750
7751
  function LabeledFilterOption(props) {
7751
7752
  const { label, children, gap } = props;
7752
7753
  return /* @__PURE__ */ jsxs("div", { style: { marginLeft: gap }, className: "flex flex-row items-center gap-4", children: [
7753
- label && /* @__PURE__ */ jsx("label", { className: "text-sm font-medium text-gray-60 shrink-0", children: label }),
7754
+ label && /* @__PURE__ */ jsx("label", { className: "text-sm font-medium text-gray-60 shrink-0 select-none", children: label }),
7754
7755
  children
7755
7756
  ] });
7756
7757
  }
@@ -7786,8 +7787,9 @@ function PageFilter(props) {
7786
7787
  onChange({ [key]: value });
7787
7788
  if (autoSubmit) pendingAutoSubmitRef.current = { key, value };
7788
7789
  };
7789
- const handleRadioChange = (key) => (value) => {
7790
+ const handleRadioChange = (key, autoSubmit) => (value) => {
7790
7791
  onChange({ [key]: value });
7792
+ if (autoSubmit) pendingAutoSubmitRef.current = { key, value };
7791
7793
  };
7792
7794
  const handleDateChange = (key) => (date) => {
7793
7795
  onChange({ [key]: date });
@@ -7795,8 +7797,10 @@ function PageFilter(props) {
7795
7797
  const handleRangeChangeCurried = (startKey, endKey) => (start, end) => {
7796
7798
  onChange({ [startKey]: start, [endKey]: end });
7797
7799
  };
7798
- const handleCheckboxChange = (key) => (checked) => {
7799
- onChange({ [key]: checked ? "true" : "false" });
7800
+ const handleCheckboxChange = (key, autoSubmit) => (checked) => {
7801
+ const value = checked ? "true" : "false";
7802
+ onChange({ [key]: value });
7803
+ if (autoSubmit) pendingAutoSubmitRef.current = { key, value };
7800
7804
  };
7801
7805
  const handleSubmit = () => {
7802
7806
  pendingAutoSubmitRef.current = null;
@@ -7842,7 +7846,7 @@ function PageFilter(props) {
7842
7846
  {
7843
7847
  name: String(optionKey),
7844
7848
  value: currentValue,
7845
- onChange: handleRadioChange(optionKey),
7849
+ onChange: handleRadioChange(optionKey, option.autoSubmit),
7846
7850
  options: option.options,
7847
7851
  direction: "horizontal"
7848
7852
  }
@@ -7874,7 +7878,7 @@ function PageFilter(props) {
7874
7878
  checked: currentValue === "true",
7875
7879
  name: String(optionKey),
7876
7880
  value: currentValue,
7877
- onChange: handleCheckboxChange(optionKey)
7881
+ onChange: handleCheckboxChange(optionKey, option.autoSubmit)
7878
7882
  }
7879
7883
  ) }, String(optionKey));
7880
7884
  default: {