@esic-lab/data-core-ui 0.0.86 → 0.0.87

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.js CHANGED
@@ -4339,6 +4339,11 @@ function ProfileSelect({
4339
4339
  {}
4340
4340
  );
4341
4341
  }, [filteredUnassigned]);
4342
+ const groupedEntries = (0, import_react19.useMemo)(() => {
4343
+ return Object.entries(groupedUsers).sort(
4344
+ ([a], [b]) => a.localeCompare(b, "th")
4345
+ );
4346
+ }, [groupedUsers]);
4342
4347
  return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { ref: containerRef, className: "relative body-1", children: [
4343
4348
  mode === "icon" ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4344
4349
  import_icons_react14.IconUsers,
@@ -4551,54 +4556,52 @@ function ProfileSelect({
4551
4556
  ghost: true,
4552
4557
  size: "small",
4553
4558
  className: "[&_.ant-collapse-content-box]:!py-[2px]",
4554
- items: Object.entries(groupedUsers).map(
4555
- ([company, users], index) => ({
4556
- key: index.toString(),
4557
- label: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
4558
- "span",
4559
- {
4560
- className: "font-semibold body-3 line-clamp-1",
4561
- title: `${company} (${users.length})`,
4562
- children: [
4563
- company,
4564
- " (",
4565
- users.length,
4566
- ")"
4567
- ]
4568
- }
4569
- ),
4570
- children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "flex flex-col gap-1 pl-2", children: users.map((user) => /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
4571
- "button",
4572
- {
4573
- className: "flex items-center hover:bg-gray-100 cursor-pointer w-full p-1 rounded text-left",
4574
- onClick: () => onUpdateAssignUser(user, "add"),
4575
- children: [
4576
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "relative cursor-pointer flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4577
- "img",
4578
- {
4579
- src: user.profile,
4580
- style: {
4581
- width: avatarSize,
4582
- height: avatarSize,
4583
- borderRadius: "50%"
4584
- },
4585
- className: "border object-cover"
4586
- }
4587
- ) }),
4588
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4589
- "span",
4590
- {
4591
- className: "ml-2 body-3 line-clamp-1",
4592
- title: user.name,
4593
- children: user.name
4594
- }
4595
- )
4596
- ]
4597
- },
4598
- user.id
4599
- )) })
4600
- })
4601
- )
4559
+ items: groupedEntries.map(([company, users]) => ({
4560
+ key: company,
4561
+ label: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
4562
+ "span",
4563
+ {
4564
+ className: "font-semibold body-3 line-clamp-1",
4565
+ title: `${company} (${users.length})`,
4566
+ children: [
4567
+ company,
4568
+ " (",
4569
+ users.length,
4570
+ ")"
4571
+ ]
4572
+ }
4573
+ ),
4574
+ children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "flex flex-col gap-1 pl-2", children: users.map((user) => /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
4575
+ "button",
4576
+ {
4577
+ className: "flex items-center hover:bg-gray-100 cursor-pointer w-full p-1 rounded text-left",
4578
+ onClick: () => onUpdateAssignUser(user, "add"),
4579
+ children: [
4580
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "relative cursor-pointer flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4581
+ "img",
4582
+ {
4583
+ src: user.profile,
4584
+ style: {
4585
+ width: avatarSize,
4586
+ height: avatarSize,
4587
+ borderRadius: "50%"
4588
+ },
4589
+ className: "border object-cover"
4590
+ }
4591
+ ) }),
4592
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4593
+ "span",
4594
+ {
4595
+ className: "ml-2 body-3 line-clamp-1",
4596
+ title: user.name,
4597
+ children: user.name
4598
+ }
4599
+ )
4600
+ ]
4601
+ },
4602
+ user.id
4603
+ )) })
4604
+ }))
4602
4605
  }
4603
4606
  )
4604
4607
  )
package/dist/index.mjs CHANGED
@@ -4273,6 +4273,11 @@ function ProfileSelect({
4273
4273
  {}
4274
4274
  );
4275
4275
  }, [filteredUnassigned]);
4276
+ const groupedEntries = useMemo2(() => {
4277
+ return Object.entries(groupedUsers).sort(
4278
+ ([a], [b]) => a.localeCompare(b, "th")
4279
+ );
4280
+ }, [groupedUsers]);
4276
4281
  return /* @__PURE__ */ jsxs34("div", { ref: containerRef, className: "relative body-1", children: [
4277
4282
  mode === "icon" ? /* @__PURE__ */ jsx43("div", { children: /* @__PURE__ */ jsx43(
4278
4283
  IconUsers,
@@ -4485,54 +4490,52 @@ function ProfileSelect({
4485
4490
  ghost: true,
4486
4491
  size: "small",
4487
4492
  className: "[&_.ant-collapse-content-box]:!py-[2px]",
4488
- items: Object.entries(groupedUsers).map(
4489
- ([company, users], index) => ({
4490
- key: index.toString(),
4491
- label: /* @__PURE__ */ jsxs34(
4492
- "span",
4493
- {
4494
- className: "font-semibold body-3 line-clamp-1",
4495
- title: `${company} (${users.length})`,
4496
- children: [
4497
- company,
4498
- " (",
4499
- users.length,
4500
- ")"
4501
- ]
4502
- }
4503
- ),
4504
- children: /* @__PURE__ */ jsx43("div", { className: "flex flex-col gap-1 pl-2", children: users.map((user) => /* @__PURE__ */ jsxs34(
4505
- "button",
4506
- {
4507
- className: "flex items-center hover:bg-gray-100 cursor-pointer w-full p-1 rounded text-left",
4508
- onClick: () => onUpdateAssignUser(user, "add"),
4509
- children: [
4510
- /* @__PURE__ */ jsx43("div", { className: "relative cursor-pointer flex-shrink-0", children: /* @__PURE__ */ jsx43(
4511
- "img",
4512
- {
4513
- src: user.profile,
4514
- style: {
4515
- width: avatarSize,
4516
- height: avatarSize,
4517
- borderRadius: "50%"
4518
- },
4519
- className: "border object-cover"
4520
- }
4521
- ) }),
4522
- /* @__PURE__ */ jsx43(
4523
- "span",
4524
- {
4525
- className: "ml-2 body-3 line-clamp-1",
4526
- title: user.name,
4527
- children: user.name
4528
- }
4529
- )
4530
- ]
4531
- },
4532
- user.id
4533
- )) })
4534
- })
4535
- )
4493
+ items: groupedEntries.map(([company, users]) => ({
4494
+ key: company,
4495
+ label: /* @__PURE__ */ jsxs34(
4496
+ "span",
4497
+ {
4498
+ className: "font-semibold body-3 line-clamp-1",
4499
+ title: `${company} (${users.length})`,
4500
+ children: [
4501
+ company,
4502
+ " (",
4503
+ users.length,
4504
+ ")"
4505
+ ]
4506
+ }
4507
+ ),
4508
+ children: /* @__PURE__ */ jsx43("div", { className: "flex flex-col gap-1 pl-2", children: users.map((user) => /* @__PURE__ */ jsxs34(
4509
+ "button",
4510
+ {
4511
+ className: "flex items-center hover:bg-gray-100 cursor-pointer w-full p-1 rounded text-left",
4512
+ onClick: () => onUpdateAssignUser(user, "add"),
4513
+ children: [
4514
+ /* @__PURE__ */ jsx43("div", { className: "relative cursor-pointer flex-shrink-0", children: /* @__PURE__ */ jsx43(
4515
+ "img",
4516
+ {
4517
+ src: user.profile,
4518
+ style: {
4519
+ width: avatarSize,
4520
+ height: avatarSize,
4521
+ borderRadius: "50%"
4522
+ },
4523
+ className: "border object-cover"
4524
+ }
4525
+ ) }),
4526
+ /* @__PURE__ */ jsx43(
4527
+ "span",
4528
+ {
4529
+ className: "ml-2 body-3 line-clamp-1",
4530
+ title: user.name,
4531
+ children: user.name
4532
+ }
4533
+ )
4534
+ ]
4535
+ },
4536
+ user.id
4537
+ )) })
4538
+ }))
4536
4539
  }
4537
4540
  )
4538
4541
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esic-lab/data-core-ui",
3
- "version": "0.0.86",
3
+ "version": "0.0.87",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",