@otwb/ui 2.0.22 → 2.0.23

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.
Files changed (2) hide show
  1. package/dist/index.js +12 -40
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { i as vTooltip, n as vSpin, r as TooltipDirectiveProvider, t as SpinDire
3
3
  import { g as useStyle, i as cM, n as cB, r as cE, t as c } from "./use-style-DcT-1dj4.js";
4
4
  import { Fragment, computed, createVNode, defineComponent, inject, isVNode, mergeProps, provide, reactive, ref, renderSlot, shallowRef, toRef, toValue, unref, useTemplateRef, watch, withDirectives } from "vue";
5
5
  import { computedAsync, promiseTimeout, useElementHover, useElementSize, useEventListener, useFullscreen, watchDebounced } from "@vueuse/core";
6
- import { NAvatar, NBadge, NBreadcrumb, NBreadcrumbItem, NButton, NDrawer, NDrawerContent, NDropdown, NEmpty, NIcon, NList, NListItem, NMenu, NPagination, NPopover, NScrollbar, NTabPane, NTabs, NText, NThing, NTooltip, useThemeVars } from "ithinkdt-ui";
6
+ import { NAvatar, NBadge, NBreadcrumb, NBreadcrumbItem, NButton, NDrawer, NDrawerContent, NDropdown, NEmpty, NIcon, NList, NListItem, NMenu, NPagination, NPopover, NScrollbar, NTabPane, NTabs, NText, NThing, useThemeVars } from "ithinkdt-ui";
7
7
  import { useAtomicBroadcast } from "@otwb/common/composables";
8
8
  import { RouterLink, useRouter } from "vue-router";
9
9
  import { walkTree } from "@otwb/common/tree";
@@ -550,9 +550,6 @@ const AppMenu = /* @__PURE__ */ defineComponent({
550
550
  },
551
551
  setup(d) {
552
552
  let z = shallowRef([]);
553
- function V(d, z) {
554
- return d.length > 7;
555
- }
556
553
  watch([() => d.menus, () => d.single], ([B, V]) => {
557
554
  if (z.value = [], !B?.length) return;
558
555
  let H = (z, B = 0) => {
@@ -576,44 +573,19 @@ const AppMenu = /* @__PURE__ */ defineComponent({
576
573
  }, { immediate: !0 }), watch([useTemplateRef("menu"), () => d.current], ([d, z]) => {
577
574
  d?.showOption(z);
578
575
  }, { immediate: !0 });
579
- let H = inject(COLLAPSED_INJECTION_KEY, !1), U = (z) => {
580
- let U = d.collapsed ?? unref(H), W;
581
- if (z._.type === "view") if (z.isExternal && z.externalEmbed) W = createVNode("a", {
576
+ let V = inject(COLLAPSED_INJECTION_KEY, !1), H = (z) => {
577
+ let H = d.collapsed ?? unref(V), U;
578
+ if (z._.type === "view") if (z.isExternal && z.externalEmbed) U = createVNode("a", {
582
579
  href: z.externalLink,
583
580
  target: "_blank",
584
581
  onClick: (d) => d.stopPropagation()
585
582
  }, [z.label()]);
586
- else if (U) {
587
- let d;
588
- createVNode(RouterLink, { to: z.path }, _isSlot$1(d = z.label()) ? d : { default: () => [d] });
589
- } else {
590
- let d, B = createVNode(RouterLink, { to: z.path }, _isSlot$1(d = z.label()) ? d : { default: () => [d] }), H = createVNode("span", null, [z.label()]);
591
- W = createVNode(NTooltip, {
592
- placement: "top",
593
- trigger: "hover",
594
- showArrow: !0,
595
- delay: 300,
596
- disabled: !V(z.label(), z)
597
- }, {
598
- default: () => H,
599
- trigger: () => B
600
- });
601
- }
602
- else if (U) W = createVNode("span", null, [z.label()]);
603
583
  else {
604
- let d = createVNode("span", null, [z.label()]);
605
- W = createVNode(NTooltip, {
606
- placement: "top",
607
- trigger: "hover",
608
- showArrow: !0,
609
- delay: 300,
610
- disabled: !V(z.label(), z)
611
- }, {
612
- default: () => d,
613
- trigger: () => d
614
- });
584
+ let d;
585
+ U = createVNode(RouterLink, { to: z.path }, _isSlot$1(d = z.label()) ? d : { default: () => [d] });
615
586
  }
616
- return W.key = `${z.key}:${U ? 1 : 0}`, z.depth === 0 && !U && (W = withDirectives(W, [[
587
+ else U = createVNode("span", null, [z.label()]);
588
+ return U.key = `${z.key}:${H ? 1 : 0}`, z.depth === 0 && !H && (U = withDirectives(U, [[
617
589
  vTooltip,
618
590
  z.label(),
619
591
  void 0,
@@ -621,7 +593,7 @@ const AppMenu = /* @__PURE__ */ defineComponent({
621
593
  auto: !0,
622
594
  right: !0
623
595
  }
624
- ]])), z.isNew && (W = createVNode("div", { style: "display: flex; width: 100%" }, [createVNode("span", { style: "flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis" }, [W]), createVNode("svg", {
596
+ ]])), z.isNew && (U = createVNode("div", { style: "display: flex; width: 100%" }, [createVNode("span", { style: "flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis" }, [U]), createVNode("svg", {
625
597
  xmlns: "http://www.w3.org/2000/svg",
626
598
  width: "24",
627
599
  height: "24",
@@ -630,7 +602,7 @@ const AppMenu = /* @__PURE__ */ defineComponent({
630
602
  }, [createVNode("path", {
631
603
  d: "M245.76 286.72h552.96c124.928 0 225.28 100.352 225.28 225.28s-100.352 225.28-225.28 225.28H0V532.48c0-135.168 110.592-245.76 245.76-245.76z m133.12 348.16V401.408H348.16v178.176l-112.64-178.176H204.8V634.88h30.72v-178.176L348.16 634.88h30.72z m182.272-108.544v-24.576h-96.256v-75.776h110.592v-24.576h-141.312V634.88h143.36v-24.576h-112.64v-83.968h96.256z m100.352 28.672l-34.816-151.552h-34.816l55.296 233.472H675.84l47.104-161.792 4.096-20.48 4.096 20.48 47.104 161.792h28.672l57.344-233.472h-34.816l-32.768 151.552-4.096 30.72-6.144-30.72-40.96-151.552h-30.72l-40.96 151.552-6.144 30.72-6.144-30.72z",
632
604
  fill: "var(--color-danger)"
633
- }, null)])])), W;
605
+ }, null)])])), U;
634
606
  };
635
607
  return () => {
636
608
  let B = createVNode(NMenu, {
@@ -638,11 +610,11 @@ const AppMenu = /* @__PURE__ */ defineComponent({
638
610
  options: z.value,
639
611
  rootIndent: 16,
640
612
  accordion: d.accordion,
641
- collapsed: d.collapsed ?? unref(H),
613
+ collapsed: d.collapsed ?? unref(V),
642
614
  dropdownProps: { showArrow: !0 },
643
615
  mode: d.horizontal ? "horizontal" : "vertical",
644
616
  value: d.current ?? null,
645
- renderLabel: U,
617
+ renderLabel: H,
646
618
  responsive: !0,
647
619
  collapsedWidth: d.collapsedWidth,
648
620
  width: d.width
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@otwb/ui",
3
- "version": "2.0.22",
3
+ "version": "2.0.23",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "otwb UI",
@@ -90,7 +90,7 @@
90
90
  "vite": "npm:rolldown-vite@^7.1.20",
91
91
  "vue": "^3.5.22",
92
92
  "vue-router": "^4.6.3",
93
- "@otwb/page": "^2.0.0"
93
+ "@otwb/page": "^2.0.2"
94
94
  },
95
95
  "scripts": {
96
96
  "dev": "vite build --watch",