gov-layout 1.2.27 → 1.2.29
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/README.md +1 -0
- package/dist/index.js +14 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -222,6 +222,7 @@ const menuItems: MenuItem[] = [
|
|
|
222
222
|
- ✅ Default ตั้งค่าระบบ + ช่วยเหลือ (override ได้)
|
|
223
223
|
- ✅ โปรไฟล์ + ออกจากระบบ ล่างสุดเสมอ
|
|
224
224
|
- ✅ `dividerAfter` เส้นคั่นระหว่างกลุ่ม
|
|
225
|
+
- ✅ แสดง Avatar Icon อัตโนมัติกรณีผู้ใช้ไม่มีรูปโปรไฟล์ (v1.2.28+) 🆕
|
|
225
226
|
|
|
226
227
|
---
|
|
227
228
|
|
package/dist/index.js
CHANGED
|
@@ -625,18 +625,6 @@ function ProfileIcon() {
|
|
|
625
625
|
}
|
|
626
626
|
);
|
|
627
627
|
}
|
|
628
|
-
function DefaultAvatarIcon() {
|
|
629
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
630
|
-
"svg",
|
|
631
|
-
{
|
|
632
|
-
width: "20",
|
|
633
|
-
height: "20",
|
|
634
|
-
viewBox: "0 0 24 24",
|
|
635
|
-
fill: "currentColor",
|
|
636
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" })
|
|
637
|
-
}
|
|
638
|
-
);
|
|
639
|
-
}
|
|
640
628
|
function SidebarUserProfile({
|
|
641
629
|
user,
|
|
642
630
|
roleLabel,
|
|
@@ -652,6 +640,11 @@ function SidebarUserProfile({
|
|
|
652
640
|
}
|
|
653
641
|
return user.firstName || user.lastName || "\u0E1C\u0E39\u0E49\u0E43\u0E0A\u0E49";
|
|
654
642
|
};
|
|
643
|
+
const getInitial = () => {
|
|
644
|
+
if (user.firstName) return user.firstName.substring(0, 2);
|
|
645
|
+
if (user.lastName) return user.lastName.substring(0, 2);
|
|
646
|
+
return "\u0E1C\u0E39\u0E49";
|
|
647
|
+
};
|
|
655
648
|
if (collapsed) {
|
|
656
649
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: {
|
|
657
650
|
padding: "12px 8px",
|
|
@@ -667,7 +660,7 @@ function SidebarUserProfile({
|
|
|
667
660
|
onClick: onProfile,
|
|
668
661
|
title: onProfile ? "\u0E14\u0E39\u0E42\u0E1B\u0E23\u0E44\u0E1F\u0E25\u0E4C" : getFullName(),
|
|
669
662
|
style: { cursor: onProfile ? "pointer" : "default" },
|
|
670
|
-
children: user.pictureUrl ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
663
|
+
children: user.pictureUrl && !user.pictureUrl.startsWith("/") ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
671
664
|
"img",
|
|
672
665
|
{
|
|
673
666
|
src: user.pictureUrl,
|
|
@@ -690,9 +683,11 @@ function SidebarUserProfile({
|
|
|
690
683
|
display: "flex",
|
|
691
684
|
alignItems: "center",
|
|
692
685
|
justifyContent: "center",
|
|
693
|
-
color: "#fff"
|
|
686
|
+
color: "#fff",
|
|
687
|
+
fontWeight: 700,
|
|
688
|
+
fontSize: "14px"
|
|
694
689
|
},
|
|
695
|
-
children:
|
|
690
|
+
children: getInitial()
|
|
696
691
|
}
|
|
697
692
|
)
|
|
698
693
|
}
|
|
@@ -784,7 +779,7 @@ function SidebarUserProfile({
|
|
|
784
779
|
transition: "opacity 0.15s ease"
|
|
785
780
|
},
|
|
786
781
|
children: [
|
|
787
|
-
user.pictureUrl ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
782
|
+
user.pictureUrl && !user.pictureUrl.startsWith("/") ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
788
783
|
"img",
|
|
789
784
|
{
|
|
790
785
|
src: user.pictureUrl,
|
|
@@ -809,9 +804,11 @@ function SidebarUserProfile({
|
|
|
809
804
|
alignItems: "center",
|
|
810
805
|
justifyContent: "center",
|
|
811
806
|
color: "#fff",
|
|
807
|
+
fontWeight: 700,
|
|
808
|
+
fontSize: "16px",
|
|
812
809
|
flexShrink: 0
|
|
813
810
|
},
|
|
814
|
-
children:
|
|
811
|
+
children: getInitial()
|
|
815
812
|
}
|
|
816
813
|
),
|
|
817
814
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
|