@appquality/unguess-design-system 4.0.39 β†’ 4.0.41

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/CHANGELOG.md CHANGED
@@ -1,3 +1,29 @@
1
+ # v4.0.41 (Thu Jun 19 2025)
2
+
3
+ #### πŸ› Bug Fix
4
+
5
+ - Add disabled to multiselect [#530](https://github.com/AppQuality/unguess-design-system/pull/530) ([@sinatragianpaolo](https://github.com/sinatragianpaolo) [@d-beezee](https://github.com/d-beezee))
6
+ - feat: Implement disabled state for MultiSelect component to prevent interactions [#529](https://github.com/AppQuality/unguess-design-system/pull/529) ([@sinatragianpaolo](https://github.com/sinatragianpaolo))
7
+
8
+ #### Authors: 2
9
+
10
+ - [@d-beezee](https://github.com/d-beezee)
11
+ - Gianpaolo Sinatra ([@sinatragianpaolo](https://github.com/sinatragianpaolo))
12
+
13
+ ---
14
+
15
+ # v4.0.40 (Tue Jun 17 2025)
16
+
17
+ #### πŸ› Bug Fix
18
+
19
+ - feat: Add listboxAppendToNode prop to MultiSelect for enhanced flexib… [#527](https://github.com/AppQuality/unguess-design-system/pull/527) ([@d-beezee](https://github.com/d-beezee))
20
+
21
+ #### Authors: 1
22
+
23
+ - [@d-beezee](https://github.com/d-beezee)
24
+
25
+ ---
26
+
1
27
  # v4.0.39 (Wed May 21 2025)
2
28
 
3
29
  #### πŸ› Bug Fix
package/build/index.d.ts CHANGED
@@ -5419,11 +5419,12 @@ export declare const ModalFullScreen: {
5419
5419
  FooterItem: ForwardRefExoticComponent<HTMLAttributes<HTMLSpanElement> & RefAttributes<HTMLSpanElement>>;
5420
5420
  };
5421
5421
 
5422
- export declare const MultiSelect: ({ options, onChange, creatable, i18n, maxItems, size, menuHeight, }: MultiSelectProps) => JSX_2.Element;
5422
+ export declare const MultiSelect: ({ options, onChange, creatable, i18n, maxItems, size, menuHeight, listboxAppendToNode, disabled }: MultiSelectProps) => JSX_2.Element;
5423
5423
 
5424
5424
  declare type MultiSelectProps = {
5425
5425
  maxItems?: number;
5426
5426
  options: Item_2[];
5427
+ listboxAppendToNode?: Element | DocumentFragment;
5427
5428
  selectedItems?: Item_2[];
5428
5429
  onChange?: (selectedItems: Item_2[], newItem?: string) => Promise<void>;
5429
5430
  creatable?: boolean;
@@ -5436,6 +5437,7 @@ declare type MultiSelectProps = {
5436
5437
  addNew?: (value: string) => string;
5437
5438
  showMore?: (value: number) => string;
5438
5439
  };
5440
+ disabled?: boolean;
5439
5441
  };
5440
5442
 
5441
5443
  /**
package/build/index.js CHANGED
@@ -76351,74 +76351,80 @@ const ntt = (e) => /* @__PURE__ */ W.createElement("svg", { width: 16, height: 1
76351
76351
  i18n: r,
76352
76352
  maxItems: i,
76353
76353
  size: o,
76354
- menuHeight: a
76354
+ menuHeight: a,
76355
+ listboxAppendToNode: s,
76356
+ disabled: l
76355
76357
  }) => {
76356
- const [s, l] = Ue(""), [d, h] = Ue(e);
76358
+ const [d, h] = Ue(""), [m, y] = Ue(e);
76357
76359
  return Ye(() => {
76358
- const m = e.filter(
76359
- (y) => y.label.trim().toLowerCase().indexOf(s.trim().toLowerCase()) !== -1
76360
+ const w = e.filter(
76361
+ (C) => C.label.trim().toLowerCase().indexOf(d.trim().toLowerCase()) !== -1
76360
76362
  );
76361
- h(m);
76362
- }, [s, e]), /* @__PURE__ */ M.jsxs(ef, { children: [
76363
+ y(w);
76364
+ }, [d, e]), /* @__PURE__ */ M.jsxs(ef, { children: [
76363
76365
  /* @__PURE__ */ M.jsx(Wp, { hidden: !0, children: (r == null ? void 0 : r.label) ?? "Multiselect" }),
76364
76366
  /* @__PURE__ */ M.jsxs(
76365
76367
  ps,
76366
76368
  {
76367
- renderValue: ({ selection: m }) => {
76368
- if (!m || Array.isArray(m) && m.length === 0)
76369
+ isDisabled: l,
76370
+ renderValue: ({ selection: w }) => {
76371
+ if (!w || Array.isArray(w) && w.length === 0)
76369
76372
  return /* @__PURE__ */ M.jsx("div", { style: { color: Ie.palette.grey[400] }, children: (r == null ? void 0 : r.placeholder) ?? "Select items..." });
76370
76373
  },
76371
- renderExpandTags: r != null && r.showMore ? (m) => r.showMore ? r.showMore(m) : "" : void 0,
76374
+ renderExpandTags: r != null && r.showMore ? (w) => r.showMore ? r.showMore(w) : "" : void 0,
76375
+ listboxAppendToNode: s,
76372
76376
  maxHeight: "auto",
76373
76377
  isCompact: o !== "medium",
76374
76378
  isMultiselectable: !0,
76375
76379
  maxTags: i,
76376
- inputValue: s,
76377
- selectionValue: e.filter((m) => m.selected).map((m) => m.id.toString()),
76380
+ inputValue: d,
76381
+ selectionValue: e.filter((w) => w.selected).map((w) => w.id.toString()),
76378
76382
  listboxMaxHeight: a ?? "200px",
76379
76383
  isAutocomplete: !0,
76380
- onChange: ({ type: m, inputValue: y, selectionValue: w }) => {
76381
- var C;
76382
- if (m === "input:change") {
76383
- l(y || "");
76384
- return;
76385
- }
76386
- if (t && (m === "fn:setSelectionValue" || m === "option:click" || m === "input:keyDown:Enter") && Array.isArray(w)) {
76387
- const E = w.map((k) => {
76388
- const R = e.find((_) => _.id === parseInt(k));
76389
- return R ? {
76390
- ...R,
76391
- selected: !0
76392
- } : {
76393
- id: void 0,
76394
- label: k,
76395
- selected: !0
76396
- };
76397
- }), I = E.filter((k) => k.id), L = (C = E.find((k) => !k.id)) == null ? void 0 : C.label;
76398
- t(
76399
- e.map((k) => ({
76400
- ...k,
76401
- selected: I.some((R) => R.id === k.id)
76402
- })),
76403
- L || void 0
76404
- ).then(() => l(""));
76384
+ onChange: ({ type: w, inputValue: C, selectionValue: E }) => {
76385
+ var I;
76386
+ if (!l) {
76387
+ if (w === "input:change") {
76388
+ h(C || "");
76389
+ return;
76390
+ }
76391
+ if (t && (w === "fn:setSelectionValue" || w === "option:click" || w === "input:keyDown:Enter") && Array.isArray(E)) {
76392
+ const L = E.map((_) => {
76393
+ const $ = e.find((F) => F.id === parseInt(_));
76394
+ return $ ? {
76395
+ ...$,
76396
+ selected: !0
76397
+ } : {
76398
+ id: void 0,
76399
+ label: _,
76400
+ selected: !0
76401
+ };
76402
+ }), k = L.filter((_) => _.id), R = (I = L.find((_) => !_.id)) == null ? void 0 : I.label;
76403
+ t(
76404
+ e.map((_) => ({
76405
+ ..._,
76406
+ selected: k.some(($) => $.id === _.id)
76407
+ })),
76408
+ R || void 0
76409
+ ).then(() => h(""));
76410
+ }
76405
76411
  }
76406
76412
  },
76407
76413
  children: [
76408
- e.map((m) => /* @__PURE__ */ M.jsx(
76414
+ e.map((w) => /* @__PURE__ */ M.jsx(
76409
76415
  ho,
76410
76416
  {
76411
- isHidden: !d.some((y) => y.id === m.id),
76412
- value: m.id.toString(),
76413
- label: m.label,
76414
- isSelected: m.selected,
76417
+ isHidden: !m.some((C) => C.id === w.id),
76418
+ value: w.id.toString(),
76419
+ label: w.label,
76420
+ isSelected: w.selected,
76415
76421
  tagProps: {
76416
76422
  isPill: !0
76417
76423
  }
76418
76424
  },
76419
- m.id
76425
+ w.id
76420
76426
  )),
76421
- d.length === 0 && !n && /* @__PURE__ */ M.jsx(
76427
+ m.length === 0 && !n && /* @__PURE__ */ M.jsx(
76422
76428
  ho,
76423
76429
  {
76424
76430
  isDisabled: !0,
@@ -76426,17 +76432,17 @@ const ntt = (e) => /* @__PURE__ */ W.createElement("svg", { width: 16, height: 1
76426
76432
  label: (r == null ? void 0 : r.noMatches) ?? "No matches found"
76427
76433
  }
76428
76434
  ),
76429
- n && s.length > 0 && !d.find(
76430
- (m) => m.label.toLowerCase() === s.toLowerCase()
76435
+ n && d.length > 0 && !m.find(
76436
+ (w) => w.label.toLowerCase() === d.toLowerCase()
76431
76437
  ) ? /* @__PURE__ */ M.jsxs(M.Fragment, { children: [
76432
76438
  /* @__PURE__ */ M.jsx(Oc, {}),
76433
76439
  /* @__PURE__ */ M.jsx(
76434
76440
  ho,
76435
76441
  {
76436
76442
  tagProps: { isPill: !0 },
76437
- value: s,
76443
+ value: d,
76438
76444
  icon: /* @__PURE__ */ M.jsx(ntt, {}),
76439
- label: r != null && r.addNew ? r.addNew(s) : `Want to add "${s}"?`
76445
+ label: r != null && r.addNew ? r.addNew(d) : `Want to add "${d}"?`
76440
76446
  }
76441
76447
  )
76442
76448
  ] }) : null
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appquality/unguess-design-system",
3
- "version": "4.0.39",
3
+ "version": "4.0.41",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",