lecom-ui 5.3.78 → 5.3.79

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.
@@ -11,7 +11,7 @@ const NumberControl = ({
11
11
  onChange,
12
12
  placeholder,
13
13
  required = false,
14
- min,
14
+ min = 0,
15
15
  max,
16
16
  maxDigits,
17
17
  className = "",
@@ -21,34 +21,39 @@ const NumberControl = ({
21
21
  }) => {
22
22
  const defaultPlaceholder = maxDigits ? "0".repeat(maxDigits) : "0";
23
23
  const finalPlaceholder = placeholder ?? defaultPlaceholder;
24
+ value.toString();
24
25
  const handleIncrement = () => {
25
- const current = typeof value === "number" ? value : parseInt(value, 10) || 0;
26
- if (max === void 0 || current < max) {
27
- const newValue = (current + 1).toString();
28
- onChange(newValue);
26
+ const current = typeof value === "number" ? value : parseInt(value, 10) || min;
27
+ if (max !== void 0 && current >= max) {
28
+ return;
29
29
  }
30
+ const newValue = (current + 1).toString();
31
+ onChange(newValue);
30
32
  };
31
33
  const handleDecrement = () => {
32
- const current = typeof value === "number" ? value : parseInt(value, 10) || 0;
33
- if (min === void 0 || current > min) {
34
- const newValue = (current - 1).toString();
35
- onChange(newValue);
34
+ const current = typeof value === "number" ? value : parseInt(value, 10) || min;
35
+ if (current <= min) {
36
+ return;
36
37
  }
38
+ const newValue = (current - 1).toString();
39
+ onChange(newValue);
37
40
  };
38
41
  const handleInputChange = (inputValue) => {
39
42
  const numbersOnly = inputValue.replace(/[^0-9]/g, "");
40
- if (numbersOnly === "") {
41
- onChange("");
43
+ if (numbersOnly === "" || numbersOnly === "0".repeat(numbersOnly.length)) {
44
+ onChange(min.toString());
42
45
  return;
43
46
  }
44
47
  if (maxDigits && numbersOnly.length > maxDigits) {
45
48
  return;
46
49
  }
47
50
  const numValue = parseInt(numbersOnly, 10);
48
- const isAboveMin = min === void 0 || numValue >= min;
51
+ const isAboveMin = numValue >= min;
49
52
  const isBelowMax = max === void 0 || numValue <= max;
50
53
  if (isAboveMin && isBelowMax) {
51
- onChange(numbersOnly);
54
+ onChange(numValue.toString());
55
+ } else if (!isBelowMax && max !== void 0) {
56
+ onChange(max.toString());
52
57
  }
53
58
  };
54
59
  const labelElement = /* @__PURE__ */ React__default.createElement(
package/dist/index.d.ts CHANGED
@@ -961,7 +961,7 @@ declare const RadioGroup: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimi
961
961
  declare const RadioGroupItem: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
962
962
 
963
963
  declare const ResizablePanelGroup: ({ className, ...props }: React$1.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => React$1.JSX.Element;
964
- declare const ResizablePanel: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLButtonElement | HTMLElement | HTMLDivElement | HTMLOListElement | HTMLLIElement | HTMLAnchorElement | HTMLSpanElement | HTMLHeadingElement | HTMLParagraphElement | HTMLLabelElement | HTMLInputElement | HTMLUListElement | HTMLObjectElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableCaptionElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLLegendElement | HTMLLinkElement | HTMLMapElement | HTMLMenuElement | HTMLMetaElement | HTMLMeterElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPictureElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLSourceElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLVideoElement>, "id" | "onResize"> & {
964
+ declare const ResizablePanel: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLButtonElement | HTMLElement | HTMLOListElement | HTMLLIElement | HTMLAnchorElement | HTMLSpanElement | HTMLDivElement | HTMLHeadingElement | HTMLParagraphElement | HTMLLabelElement | HTMLInputElement | HTMLUListElement | HTMLObjectElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableCaptionElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLLegendElement | HTMLLinkElement | HTMLMapElement | HTMLMenuElement | HTMLMetaElement | HTMLMeterElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPictureElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLSourceElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLVideoElement>, "id" | "onResize"> & {
965
965
  className?: string;
966
966
  collapsedSize?: number | undefined;
967
967
  collapsible?: boolean | undefined;
@@ -1129,7 +1129,7 @@ declare const textareaVariants: (props?: ({
1129
1129
  variant?: "filled" | "default" | "borderless" | null | undefined;
1130
1130
  size?: "small" | "large" | "default" | null | undefined;
1131
1131
  radius?: "small" | "large" | "default" | "full" | null | undefined;
1132
- resize?: "default" | "both" | "horizontal" | "vertical" | "vertical-limited" | null | undefined;
1132
+ resize?: "both" | "horizontal" | "vertical" | "default" | "vertical-limited" | null | undefined;
1133
1133
  } & class_variance_authority_types.ClassProp) | undefined) => string;
1134
1134
  interface TextareaProps extends React$1.ComponentProps<'textarea'>, VariantProps<typeof textareaVariants> {
1135
1135
  }
@@ -1266,7 +1266,7 @@ declare const SheetClose: React$1.ForwardRefExoticComponent<DialogPrimitive.Dial
1266
1266
  declare const SheetPortal: React$1.FC<DialogPrimitive.DialogPortalProps>;
1267
1267
  declare const SheetOverlay: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
1268
1268
  declare const sheetVariants: (props?: ({
1269
- side?: "left" | "right" | "top" | "bottom" | null | undefined;
1269
+ side?: "top" | "bottom" | "left" | "right" | null | undefined;
1270
1270
  } & class_variance_authority_types.ClassProp) | undefined) => string;
1271
1271
  interface SheetContentProps extends React$1.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, VariantProps<typeof sheetVariants> {
1272
1272
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lecom-ui",
3
- "version": "5.3.78",
3
+ "version": "5.3.79",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",