lecom-ui 5.4.33 → 5.4.35

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.
@@ -139,7 +139,7 @@ const ComboboxItemContent = ({
139
139
  variant: fontVariant,
140
140
  className: cn(
141
141
  textColor,
142
- "whitespace-normal flex items-center justify-center"
142
+ "whitespace-normal flex items-center justify-center break-words"
143
143
  )
144
144
  },
145
145
  option.label
@@ -93,12 +93,12 @@ const MultiSelect = React.forwardRef(
93
93
  setTimeout(() => calculateMaxCount(), 10);
94
94
  return;
95
95
  }
96
- const CONTROLS_WIDTH = 80;
97
- const COUNTER_TAG_WIDTH = 41;
96
+ const CONTROLS_WIDTH = 60;
97
+ const COUNTER_TAG_WIDTH = 50;
98
98
  const TAG_GAP = 4;
99
99
  const CONTAINER_PADDING = 8;
100
- const AVG_CHAR_WIDTH = 8;
101
- const TAG_PADDING = 24;
100
+ const AVG_CHAR_WIDTH = 10;
101
+ const TAG_PADDING = 16;
102
102
  const availableWidth = buttonWidth - CONTAINER_PADDING * 2 - CONTROLS_WIDTH;
103
103
  if (availableWidth <= 0) {
104
104
  setDynamicMaxCount(1);
@@ -198,16 +198,20 @@ const MultiSelect = React.forwardRef(
198
198
  if (selectedValues.length === all.length) {
199
199
  handleClear();
200
200
  } else {
201
- setSelectedValues(all);
202
- onValueChange(all);
201
+ const newValues = all.filter((v) => !selectedValues.includes(v));
202
+ const result = [...selectedValues, ...newValues];
203
+ setSelectedValues(result);
204
+ onValueChange(result);
203
205
  }
204
206
  } else {
205
207
  if (selectedValues.length === effectiveOptions.length) {
206
208
  handleClear();
207
209
  } else {
208
210
  const allValues = effectiveOptions.map((option) => option.value);
209
- setSelectedValues(allValues);
210
- onValueChange(allValues);
211
+ const newValues = allValues.filter((values) => !selectedValues.includes(values));
212
+ const result = [...selectedValues, ...newValues];
213
+ setSelectedValues(result);
214
+ onValueChange(result);
211
215
  }
212
216
  }
213
217
  };
@@ -535,10 +539,9 @@ const MultiSelect = React.forwardRef(
535
539
  className
536
540
  ),
537
541
  "aria-expanded": isPopoverOpen,
538
- "aria-readonly": readOnly,
539
542
  disabled
540
543
  },
541
- selectedValues.length > 0 ? /* @__PURE__ */ React.createElement("div", { className: "flex justify-between items-center w-full" }, /* @__PURE__ */ React.createElement("div", { className: "flex flex-wrap items-center gap-1" }, selectedValues.slice(0, dynamicMaxCount).map((value2) => {
544
+ selectedValues.length > 0 ? /* @__PURE__ */ React.createElement("div", { className: "flex justify-between items-center w-full px-2" }, /* @__PURE__ */ React.createElement("div", { className: "flex flex-wrap items-center gap-1" }, selectedValues.slice(0, dynamicMaxCount).map((value2) => {
542
545
  const selectedOption = options.find(
543
546
  (option) => option.value === value2
544
547
  );
@@ -588,7 +591,7 @@ const MultiSelect = React.forwardRef(
588
591
  ))), /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between" }, !disabled && !readOnly && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
589
592
  X,
590
593
  {
591
- className: "h-4 w-4 cursor-pointer text-grey-800",
594
+ className: "h-5 w-5 cursor-pointer text-grey-800",
592
595
  onClick: (event) => {
593
596
  event.stopPropagation();
594
597
  handleClear();
@@ -600,7 +603,7 @@ const MultiSelect = React.forwardRef(
600
603
  orientation: "vertical",
601
604
  className: "flex min-h-4 mx-1 h-full"
602
605
  }
603
- )), isPopoverOpen ? /* @__PURE__ */ React.createElement(ChevronUp, { className: "h-4 w-4 cursor-pointer text-grey-800" }) : /* @__PURE__ */ React.createElement(ChevronDown, { className: "h-4 w-4 cursor-pointer text-grey-800" }))) : /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between w-full mx-auto" }, /* @__PURE__ */ React.createElement(
606
+ )), isPopoverOpen ? /* @__PURE__ */ React.createElement(ChevronUp, { className: "h-5 w-5 cursor-pointer text-grey-800" }) : /* @__PURE__ */ React.createElement(ChevronDown, { className: "h-5 w-5 cursor-pointer text-grey-800" }))) : /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between w-full mx-auto" }, /* @__PURE__ */ React.createElement(
604
607
  Typography,
605
608
  {
606
609
  variant: getFontVariant(size),
@@ -730,8 +733,7 @@ const MultiSelect = React.forwardRef(
730
733
  Typography,
731
734
  {
732
735
  variant: getFontVariant(size),
733
- className: "text-grey-800 truncate overflow-hidden",
734
- title: option.label
736
+ className: "text-grey-800 break-words"
735
737
  },
736
738
  highlight(option.label, query)
737
739
  ))
@@ -772,8 +774,7 @@ const MultiSelect = React.forwardRef(
772
774
  Typography,
773
775
  {
774
776
  variant: getFontVariant(size),
775
- className: "text-grey-800 truncate overflow-hidden",
776
- title: option.label
777
+ className: "text-grey-800 break-words"
777
778
  },
778
779
  highlight(option.label, query)
779
780
  ))
package/dist/index.d.ts CHANGED
@@ -994,7 +994,7 @@ declare const RadioGroup: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimi
994
994
  declare const RadioGroupItem: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
995
995
 
996
996
  declare const ResizablePanelGroup: ({ className, ...props }: React$1.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => React$1.JSX.Element;
997
- declare const ResizablePanel: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLButtonElement | HTMLElement | HTMLDivElement | HTMLHeadingElement | HTMLParagraphElement | HTMLSpanElement | HTMLOListElement | HTMLLIElement | HTMLAnchorElement | HTMLUListElement | HTMLLabelElement | HTMLInputElement | 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"> & {
997
+ 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"> & {
998
998
  className?: string;
999
999
  collapsedSize?: number | undefined;
1000
1000
  collapsible?: boolean | undefined;
@@ -1306,7 +1306,7 @@ declare const SheetClose: React$1.ForwardRefExoticComponent<DialogPrimitive.Dial
1306
1306
  declare const SheetPortal: React$1.FC<DialogPrimitive.DialogPortalProps>;
1307
1307
  declare const SheetOverlay: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
1308
1308
  declare const sheetVariants: (props?: ({
1309
- side?: "top" | "right" | "bottom" | "left" | null | undefined;
1309
+ side?: "left" | "right" | "top" | "bottom" | null | undefined;
1310
1310
  } & class_variance_authority_types.ClassProp) | undefined) => string;
1311
1311
  interface SheetContentProps extends React$1.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, VariantProps<typeof sheetVariants> {
1312
1312
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lecom-ui",
3
- "version": "5.4.33",
3
+ "version": "5.4.35",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",