@otwb/ui 2.0.21 → 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.
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";
@@ -496,7 +496,6 @@ const AppLogo = /* @__PURE__ */ defineComponent({
496
496
  "--app-logo-img-size": "32px",
497
497
  "--app-logo-name-size": "22px",
498
498
  width: W ? "100%" : "auto",
499
- overflow: "hidden",
500
499
  display: "flex",
501
500
  alignItems: "center",
502
501
  justifyContent: W ? "center" : "flex-start",
@@ -551,9 +550,6 @@ const AppMenu = /* @__PURE__ */ defineComponent({
551
550
  },
552
551
  setup(d) {
553
552
  let z = shallowRef([]);
554
- function V(d, z) {
555
- return d.length > 7;
556
- }
557
553
  watch([() => d.menus, () => d.single], ([B, V]) => {
558
554
  if (z.value = [], !B?.length) return;
559
555
  let H = (z, B = 0) => {
@@ -577,44 +573,19 @@ const AppMenu = /* @__PURE__ */ defineComponent({
577
573
  }, { immediate: !0 }), watch([useTemplateRef("menu"), () => d.current], ([d, z]) => {
578
574
  d?.showOption(z);
579
575
  }, { immediate: !0 });
580
- let H = inject(COLLAPSED_INJECTION_KEY, !1), U = (z) => {
581
- let U = d.collapsed ?? unref(H), W;
582
- 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", {
583
579
  href: z.externalLink,
584
580
  target: "_blank",
585
581
  onClick: (d) => d.stopPropagation()
586
582
  }, [z.label()]);
587
- else if (U) {
588
- let d;
589
- createVNode(RouterLink, { to: z.path }, _isSlot$1(d = z.label()) ? d : { default: () => [d] });
590
- } else {
591
- let d, B = createVNode(RouterLink, { to: z.path }, _isSlot$1(d = z.label()) ? d : { default: () => [d] }), H = createVNode("span", null, [z.label()]);
592
- W = createVNode(NTooltip, {
593
- placement: "top",
594
- trigger: "hover",
595
- showArrow: !0,
596
- delay: 300,
597
- disabled: !V(z.label(), z)
598
- }, {
599
- default: () => H,
600
- trigger: () => B
601
- });
602
- }
603
- else if (U) W = createVNode("span", null, [z.label()]);
604
583
  else {
605
- let d = createVNode("span", null, [z.label()]);
606
- W = createVNode(NTooltip, {
607
- placement: "top",
608
- trigger: "hover",
609
- showArrow: !0,
610
- delay: 300,
611
- disabled: !V(z.label(), z)
612
- }, {
613
- default: () => d,
614
- trigger: () => d
615
- });
584
+ let d;
585
+ U = createVNode(RouterLink, { to: z.path }, _isSlot$1(d = z.label()) ? d : { default: () => [d] });
616
586
  }
617
- 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, [[
618
589
  vTooltip,
619
590
  z.label(),
620
591
  void 0,
@@ -622,7 +593,7 @@ const AppMenu = /* @__PURE__ */ defineComponent({
622
593
  auto: !0,
623
594
  right: !0
624
595
  }
625
- ]])), 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", {
626
597
  xmlns: "http://www.w3.org/2000/svg",
627
598
  width: "24",
628
599
  height: "24",
@@ -631,7 +602,7 @@ const AppMenu = /* @__PURE__ */ defineComponent({
631
602
  }, [createVNode("path", {
632
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",
633
604
  fill: "var(--color-danger)"
634
- }, null)])])), W;
605
+ }, null)])])), U;
635
606
  };
636
607
  return () => {
637
608
  let B = createVNode(NMenu, {
@@ -639,11 +610,11 @@ const AppMenu = /* @__PURE__ */ defineComponent({
639
610
  options: z.value,
640
611
  rootIndent: 16,
641
612
  accordion: d.accordion,
642
- collapsed: d.collapsed ?? unref(H),
613
+ collapsed: d.collapsed ?? unref(V),
643
614
  dropdownProps: { showArrow: !0 },
644
615
  mode: d.horizontal ? "horizontal" : "vertical",
645
616
  value: d.current ?? null,
646
- renderLabel: U,
617
+ renderLabel: H,
647
618
  responsive: !0,
648
619
  collapsedWidth: d.collapsedWidth,
649
620
  width: d.width
package/dist/page.js CHANGED
@@ -435,8 +435,7 @@ function createFormHelper() {
435
435
  showAction: !1,
436
436
  onSubmit: l,
437
437
  onRest: u,
438
- class: m ? "form-dialog1" : "",
439
- style: m ? "padding-right: 1rem" : void 0
438
+ style: m ? "padding-right: .5rem" : void 0
440
439
  }, null);
441
440
  }
442
441
  function createModalHelper() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@otwb/ui",
3
- "version": "2.0.21",
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",