@otwb/ui 2.0.2 → 2.0.4

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 CHANGED
@@ -1 +1 @@
1
- # @otwb/ui
1
+ # @otwb/ui
package/auto-imports.d.ts CHANGED
@@ -1,15 +1,15 @@
1
- export declare const UIDirectives: {
2
- type: 'directive'
3
- resolve: (name: string) => string | undefined
4
- }[]
5
-
6
- export declare const UIComponents: {
7
- type: 'component'
8
- resolve: (name: string) => string | undefined
9
- }[]
10
-
11
- export declare const UI: {
12
- from: string
13
- imports: (string | { name: string, type: boolean })[]
14
- }[]
15
- export default UI
1
+ export declare const UIDirectives: {
2
+ type: 'directive'
3
+ resolve: (name: string) => string | undefined
4
+ }[]
5
+
6
+ export declare const UIComponents: {
7
+ type: 'component'
8
+ resolve: (name: string) => string | undefined
9
+ }[]
10
+
11
+ export declare const UI: {
12
+ from: string
13
+ imports: (string | { name: string, type: boolean })[]
14
+ }[]
15
+ export default UI
package/auto-imports.js CHANGED
@@ -1,34 +1,34 @@
1
- export const UIDirectives = [
2
- {
3
- type: 'directive',
4
- resolve(name) {
5
- return ['Spin', 'Tooltip'].includes(name)
6
- ? { name: `v${name}`, from: '@otwb/ui/directives' }
7
- : undefined
8
- },
9
- },
10
- ]
11
-
12
- export const UIComponents = [
13
- {
14
- type: 'component',
15
- resolve(name) {
16
- return ['DataTable', 'DataForm', 'DataCustom', 'DataFilter', 'DataSelection', 'DataPagination'].includes(name)
17
- ? { name, from: '@otwb/ui/components' }
18
- : undefined
19
- },
20
- },
21
- ]
22
-
23
- export const UI = [
24
- {
25
- from: '@otwb/ui/directives',
26
- imports: ['vSpin', 'vTooltip'],
27
- },
28
- {
29
- from: '@otwb/ui/components',
30
- imports: ['DataTable', 'DataForm', 'DataCustom', 'DataFilter', 'DataSelection', 'DataPagination'],
31
- },
32
- ]
33
-
34
- export default UI
1
+ export const UIDirectives = [
2
+ {
3
+ type: 'directive',
4
+ resolve(name) {
5
+ return ['Spin', 'Tooltip'].includes(name)
6
+ ? { name: `v${name}`, from: '@otwb/ui/directives' }
7
+ : undefined
8
+ },
9
+ },
10
+ ]
11
+
12
+ export const UIComponents = [
13
+ {
14
+ type: 'component',
15
+ resolve(name) {
16
+ return ['DataTable', 'DataForm', 'DataCustom', 'DataFilter', 'DataSelection', 'DataPagination'].includes(name)
17
+ ? { name, from: '@otwb/ui/components' }
18
+ : undefined
19
+ },
20
+ },
21
+ ]
22
+
23
+ export const UI = [
24
+ {
25
+ from: '@otwb/ui/directives',
26
+ imports: ['vSpin', 'vTooltip'],
27
+ },
28
+ {
29
+ from: '@otwb/ui/components',
30
+ imports: ['DataTable', 'DataForm', 'DataCustom', 'DataFilter', 'DataSelection', 'DataPagination'],
31
+ },
32
+ ]
33
+
34
+ export default UI
package/dist/index.js CHANGED
@@ -303,8 +303,7 @@ var style = /* @__PURE__ */ c([
303
303
  gridArea: "header",
304
304
  overflow: "hidden",
305
305
  zIndex: 2,
306
- height: "var(--app-header-height, 44px)",
307
- zIndex: "2"
306
+ height: "var(--app-header-height, 44px)"
308
307
  }),
309
308
  cB("sider", {
310
309
  gridArea: "sider",
@@ -812,43 +811,7 @@ function useContentScroll(d, z, B) {
812
811
  content: z
813
812
  };
814
813
  }
815
- var IBg = (d) => createVNode("svg", d, [
816
- createVNode("defs", null, [
817
- createVNode("symbol", {
818
- id: "geometry-left",
819
- viewBox: "0 0 214 36"
820
- }, [createVNode("path", { d: "M17 0h197v36H0v-2c4.5 0 9-3.5 9-8V8c0-4.5 3.5-8 8-8z" }, null)]),
821
- createVNode("symbol", {
822
- id: "geometry-right",
823
- viewBox: "0 0 214 36"
824
- }, [createVNode("use", { "xlink:href": "#geometry-left" }, null)]),
825
- createVNode("clipPath", null, [createVNode("rect", {
826
- width: "100%",
827
- height: "100%",
828
- x: "0"
829
- }, null)])
830
- ]),
831
- createVNode("svg", {
832
- width: "50%",
833
- height: "100%"
834
- }, [createVNode("use", {
835
- "xlink:href": "#geometry-left",
836
- width: "214",
837
- height: "36",
838
- fill: "currentColor"
839
- }, null)]),
840
- createVNode("g", { transform: "scale(-1, 1)" }, [createVNode("svg", {
841
- width: "50%",
842
- height: "100%",
843
- x: "-100%",
844
- y: "0"
845
- }, [createVNode("use", {
846
- "xlink:href": "#geometry-right",
847
- width: "214",
848
- height: "36",
849
- fill: "currentColor"
850
- }, null)])])
851
- ]), AppTab = /* @__PURE__ */ defineComponent({
814
+ var AppTab = /* @__PURE__ */ defineComponent({
852
815
  name: "AppTab",
853
816
  props: {
854
817
  path: String,
@@ -865,10 +828,15 @@ var IBg = (d) => createVNode("svg", d, [
865
828
  });
866
829
  let K = useThemeVars(), q = computed(() => ({
867
830
  fontSize: "14px",
868
- color: d.isCurrent ? K.value.primaryColor : K.value.textColor3,
869
- maxWidth: "355px",
870
- overflow: "hidden"
831
+ color: d.isCurrent ? "#595959" : K.value.textColor3,
832
+ maxWidth: "350px",
833
+ overflow: "hidden",
834
+ marginRight: "5px"
871
835
  })), J = computed(() => ({
836
+ height: "34px",
837
+ padding: "0 12px 0 15px"
838
+ }));
839
+ return computed(() => ({
872
840
  width: "calc(100% + 27px)",
873
841
  height: "100%",
874
842
  position: "absolute",
@@ -876,34 +844,30 @@ var IBg = (d) => createVNode("svg", d, [
876
844
  left: "-14px",
877
845
  zIndex: d.isCurrent ? -1 : -2,
878
846
  color: d.isCurrent ? getOpaqueColor(K.value.primaryColor, d.dark ? .3 : .12, d.dark ? "#000" : "#fff") : H.value ? K.value.borderColor : "transparent"
879
- }));
880
- return () => createVNode("div", {
847
+ })), () => createVNode("div", {
881
848
  ref: V,
882
- style: "position: relative; padding: 2px 10px 5px; cursor: pointer"
883
- }, [
884
- createVNode("div", {
885
- ref: U,
886
- style: "transition: width 300ms; overflow: hidden"
887
- }, [createVNode("div", {
888
- ref: W,
889
- style: "display: flex; align-items: center; gap: 4px; width: fit-content"
890
- }, [createVNode("span", { style: q.value }, [B.default?.()]), d.closable !== !1 && (d.isCurrent || H.value) ? createVNode("span", { style: "line-height: 0; display: inline-block; text-align: right; padding-top: 2px" }, [createVNode(NButton, {
891
- text: !0,
892
- onClick: (d) => {
893
- d.stopPropagation(), z("close");
894
- }
895
- }, { default: () => [createVNode(NIcon, { size: 18 }, { default: () => [createVNode("svg", {
896
- xmlns: "http://www.w3.org/2000/svg",
897
- width: "1em",
898
- height: "1em",
899
- viewBox: "0 0 24 24"
900
- }, [createVNode("path", {
901
- fill: "currentColor",
902
- 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"
903
- }, null)])] })] })]) : void 0])]),
904
- createVNode("span", { style: "height: 50%; width: 1px; background: #aaa; display: inline-block; position: absolute; top: 20%; right: -4px; z-index: -3" }, null),
905
- createVNode(IBg, { style: J.value }, null)
906
- ]);
849
+ style: "position: relative; padding: 0px 0px 0px; cursor: pointer"
850
+ }, [createVNode("div", { style: "transition: width 300ms; overflow: hidden" }, [createVNode("div", {
851
+ ref: W,
852
+ style: ["display: flex; align-items: center; width: fit-content", J.value],
853
+ class: d.isCurrent ? "bg-[#f0f2f5]" : ""
854
+ }, [createVNode("span", {
855
+ class: "whitespace-nowrap",
856
+ style: q.value
857
+ }, [B.default?.()]), createVNode("span", { style: "line-height: 0; display: inline-block; text-align: right; padding-top: 2px" }, [createVNode(NButton, {
858
+ text: !0,
859
+ onClick: (d) => {
860
+ d.stopPropagation(), z("close");
861
+ }
862
+ }, { default: () => [createVNode(NIcon, { size: 18 }, { default: () => [createVNode("svg", {
863
+ xmlns: "http://www.w3.org/2000/svg",
864
+ width: "1em",
865
+ height: "1em",
866
+ viewBox: "0 0 24 24"
867
+ }, [createVNode("path", {
868
+ fill: "currentColor",
869
+ 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"
870
+ }, null)])] })] })])])])]);
907
871
  }
908
872
  });
909
873
  const AppMultiTabs = /* @__PURE__ */ defineComponent({
@@ -923,33 +887,29 @@ const AppMultiTabs = /* @__PURE__ */ defineComponent({
923
887
  return useContentScroll(Y, Z, J), () => createVNode("div", { style: "width: 100%; height: 100%; overflow: hidden; display: flex; justify-content: space-between" }, [createVNode("div", {
924
888
  ref: Y,
925
889
  style: "flex: 1 1 100%; height: 100%; display: flex; overflow: hidden; align-items: center; position: relative"
926
- }, [
927
- createVNode("div", { style: "height: 100%; flex: 0 0 16px; z-index: 1; position: sticky; left: 0; backdrop-filter: opacity(0.9) blur(5px)" }, null),
928
- createVNode("div", {
929
- ref: Z,
930
- style: "padding-inline: 12px; flex: 1 1 auto; display: flex; align-items: end; gap: 8px; height: 100%",
931
- onContextmenu: (d) => W(d)
932
- }, [d.tabs.map((z, V, U) => {
933
- let G = d.current?.key === z.key, K = z.title ?? z.path;
934
- return createVNode(AppTab, {
935
- key: z.key,
936
- isCurrent: G,
937
- isLast: V === U.length - 1,
938
- onClose: z.close,
939
- closable: z.closable,
940
- dark: d.dark,
941
- onClick: () => {
942
- G || H.push(z.fullPath);
943
- },
944
- onContextmenu: (d) => W(d, z)
945
- }, { default: () => [B.name ? B.name({
946
- isCurrent: G,
947
- name: K,
948
- tab: z
949
- }) : K] });
950
- })]),
951
- createVNode("div", { style: "height: 100%; flex: 0 0 16px; z-index: 1; position: sticky; right: 0; backdrop-filter: opacity(0.9) blur(5px)" }, null)
952
- ]), createVNode(NDropdown, {
890
+ }, [createVNode("div", {
891
+ ref: Z,
892
+ style: "flex: 1 1 auto; display: flex; align-items: end; height: 100%",
893
+ onContextmenu: (d) => W(d)
894
+ }, [d.tabs.map((z, V, U) => {
895
+ let G = d.current?.key === z.key, K = z.title ?? z.path;
896
+ return createVNode(AppTab, {
897
+ key: z.key,
898
+ isCurrent: G,
899
+ isLast: V === U.length - 1,
900
+ onClose: z.close,
901
+ closable: z.closable,
902
+ dark: d.dark,
903
+ onClick: () => {
904
+ G || H.push(z.fullPath);
905
+ },
906
+ onContextmenu: (d) => W(d, z)
907
+ }, { default: () => [B.name ? B.name({
908
+ isCurrent: G,
909
+ name: K,
910
+ tab: z
911
+ }) : K] });
912
+ })]), createVNode("div", { style: "height: 100%; flex: 0 0 16px; z-index: 1; position: sticky; right: 0; backdrop-filter: opacity(0.9) blur(5px)" }, null)]), createVNode(NDropdown, {
953
913
  placement: "bottom-start",
954
914
  trigger: "manual",
955
915
  show: U.visible,