@otwb/ui 2.0.7 → 2.0.8

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 +80 -26
  2. package/package.json +1 -1
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, NText, NThing, 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";
@@ -869,7 +869,20 @@ var AppTab = /* @__PURE__ */ defineComponent({
869
869
  }, [createVNode("span", {
870
870
  class: "whitespace-nowrap",
871
871
  style: q.value
872
- }, [B.default?.()]), createVNode("span", { style: "line-height: 0; display: inline-block; text-align: right; padding-top: 2px" }, null)])])]);
872
+ }, [B.default?.()]), createVNode("span", { style: "line-height: 0; display: inline-block; text-align: right; padding-top: 2px" }, [createVNode(NButton, {
873
+ text: !0,
874
+ onClick: (d) => {
875
+ d.stopPropagation(), z("close");
876
+ }
877
+ }, { default: () => [createVNode(NIcon, { size: 18 }, { default: () => [createVNode("svg", {
878
+ xmlns: "http://www.w3.org/2000/svg",
879
+ width: "1em",
880
+ height: "1em",
881
+ viewBox: "0 0 24 24"
882
+ }, [createVNode("path", {
883
+ fill: "currentColor",
884
+ d: "m6.4 18.308l-.708-.708l5.6-5.6l-5.6-5.6l.708-.708l5.6 5.6l5.6-5.6l.708.708l-5.6 5.6l5.6 5.6l-.708.708l-5.6-5.6z"
885
+ }, null)])] })] })])])])]);
873
886
  }
874
887
  });
875
888
  const AppMultiTabs = /* @__PURE__ */ defineComponent({
@@ -989,26 +1002,36 @@ const AppNotification = /* @__PURE__ */ defineComponent({
989
1002
  W("common.notification.tip", { count: q.unread }),
990
1003
  void 0,
991
1004
  { bottom: !0 }
992
- ]]), X = () => {
993
- let d, z;
994
- return createVNode("div", { style: "display: flex; align-items: baseline; gap: 20px" }, [
995
- createVNode("div", { style: "padding-right: 12px" }, [W("common.notification.title")]),
996
- createVNode(NButton, {
997
- text: !0,
998
- type: K.value === "all" ? "primary" : "default",
999
- onClick: () => {
1000
- K.value = "all", J();
1001
- }
1002
- }, _isSlot(d = W("common.notification.all")) ? d : { default: () => [d] }),
1003
- createVNode(NButton, {
1004
- text: !0,
1005
- type: K.value === "unread" ? "primary" : "default",
1006
- onClick: () => {
1007
- K.value = "unread", J();
1008
- }
1009
- }, _isSlot(z = W("common.notification.unread", { count: q.unread > 99 ? "99+" : q.unread.toString() })) ? z : { default: () => [z] })
1010
- ]);
1011
- }, Z = (d) => createVNode(NListItem, {
1005
+ ]]), X = () => createVNode("div", { style: "display: flex; align-items:center; gap: 16px" }, [createVNode(NButton, {
1006
+ text: !0,
1007
+ onClick: () => {
1008
+ G.value = !1;
1009
+ }
1010
+ }, { default: () => [createVNode(NIcon, {
1011
+ size: "20",
1012
+ color: "rgba(0,0,0,.45)",
1013
+ onClick: () => {
1014
+ G.value = !1;
1015
+ }
1016
+ }, { default: () => [createVNode("svg", {
1017
+ xmlns: "http://www.w3.org/2000/svg",
1018
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
1019
+ viewBox: "0 0 512 512"
1020
+ }, [createVNode("path", {
1021
+ fill: "none",
1022
+ stroke: "currentColor",
1023
+ "stroke-linecap": "round",
1024
+ "stroke-linejoin": "round",
1025
+ "stroke-width": "32",
1026
+ d: "M368 368L144 144"
1027
+ }, null), createVNode("path", {
1028
+ fill: "none",
1029
+ stroke: "currentColor",
1030
+ "stroke-linecap": "round",
1031
+ "stroke-linejoin": "round",
1032
+ "stroke-width": "32",
1033
+ d: "M368 144L144 368"
1034
+ }, null)])] })] }), createVNode("div", { style: "padding-right: 12px" }, [W("common.notification.title")])]), Z = (d) => createVNode(NListItem, {
1012
1035
  key: d.key,
1013
1036
  onClick: () => {
1014
1037
  d.status === "unread" && (z.markRead?.([d.key]).then(() => {
@@ -1063,12 +1086,44 @@ const AppNotification = /* @__PURE__ */ defineComponent({
1063
1086
  default: d.content,
1064
1087
  footer: () => createVNode("span", { style: "color: gray" }, [d.hover ? format(d.date, W("common.notification.time")) : W("common.timeago", { time: d.date })])
1065
1088
  })] }), Q = () => {
1066
- let d;
1067
- return withDirectives(q.records.length > 0 ? createVNode(NList, {
1089
+ let d, z;
1090
+ return withDirectives(q.records.length > 0 ? createVNode("div", null, [createVNode(NTabs, {
1091
+ "onUpdate:value": [(d) => {
1092
+ console.log(d), K.value = d, J();
1093
+ }, (d) => K.value = d],
1094
+ type: "line",
1095
+ "default-value": "all",
1096
+ animated: !0,
1097
+ value: K.value
1098
+ }, { default: () => [createVNode(NTabPane, {
1099
+ name: "all",
1100
+ tab: W("common.notification.all")
1101
+ }, { default: () => [createVNode(NList, {
1068
1102
  clickable: !0,
1069
1103
  hoverable: !0,
1070
1104
  style: "min-height: 50vh"
1071
- }, _isSlot(d = q.records.map((d) => Z(d))) ? d : { default: () => [d] }) : createVNode(NEmpty, { style: "margin-top: 30vh" }, null), [[vSpin, q.loading]]);
1105
+ }, _isSlot(d = q.records.map((d) => Z(d))) ? d : { default: () => [d] })] }), createVNode(NTabPane, {
1106
+ name: "unread",
1107
+ tab: W("common.notification.unread", { count: q.unread > 99 ? "99+" : q.unread.toString() })
1108
+ }, { default: () => [createVNode(NList, {
1109
+ clickable: !0,
1110
+ hoverable: !0,
1111
+ style: "min-height: 50vh"
1112
+ }, _isSlot(z = q.records.map((d) => Z(d))) ? z : { default: () => [z] })] })] })]) : createVNode("div", null, [createVNode(NTabs, {
1113
+ "onUpdate:value": [(d) => {
1114
+ console.log(d), K.value = d, J();
1115
+ }, (d) => K.value = d],
1116
+ type: "line",
1117
+ "default-value": "all",
1118
+ animated: !0,
1119
+ value: K.value
1120
+ }, { default: () => [createVNode(NTabPane, {
1121
+ name: "all",
1122
+ tab: W("common.notification.all")
1123
+ }, { default: () => [createVNode(NEmpty, { style: "margin-top: 30vh" }, null)] }), createVNode(NTabPane, {
1124
+ name: "unread",
1125
+ tab: W("common.notification.unread", { count: q.unread > 99 ? "99+" : q.unread.toString() })
1126
+ }, { default: () => [createVNode(NEmpty, { style: "margin-top: 30vh" }, null)] })] })]), [[vSpin, q.loading]]);
1072
1127
  }, $ = () => createVNode("div", { style: "display: flex; justify-content: space-between; width: 100%" }, [K.value === "unread" ? createVNode(NButton, {
1073
1128
  text: !0,
1074
1129
  type: "primary",
@@ -1107,7 +1162,6 @@ const AppNotification = /* @__PURE__ */ defineComponent({
1107
1162
  width: 400
1108
1163
  }, { default: () => [createVNode(NDrawerContent, {
1109
1164
  title: W("common.notification.title"),
1110
- closable: !0,
1111
1165
  nativeScrollbar: !1,
1112
1166
  bodyContentStyle: { padding: "0" }
1113
1167
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@otwb/ui",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "otwb UI",