@otwb/ui 2.0.2 → 2.0.3
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 -1
- package/auto-imports.d.ts +15 -15
- package/auto-imports.js +34 -34
- package/dist/index.js +53 -96
- package/esm/components.d.ts +448 -448
- package/esm/components.js +1 -1
- package/esm/design.d.ts +243 -243
- package/esm/directives.d.ts +42 -42
- package/esm/directives.js +1 -1
- package/esm/index.d.ts +19 -19
- package/esm/index.js +1 -1
- package/esm/page.d.ts +170 -170
- package/esm/page.js +1 -1
- package/esm/use-style.d.ts +10 -10
- package/esm/use-style.js +1 -1
- package/locale.d.ts +78 -78
- package/package.json +2 -2
- package/unocss-preset.d.ts +5 -5
- package/unocss-preset.js +94 -94
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
|
|
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 ?
|
|
869
|
-
maxWidth: "
|
|
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,27 @@ 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:
|
|
883
|
-
}, [
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
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", { style: q.value }, [B.default?.()]), createVNode("span", { style: "line-height: 0; display: inline-block; text-align: right; padding-top: 2px" }, [createVNode(NButton, {
|
|
855
|
+
text: !0,
|
|
856
|
+
onClick: (d) => {
|
|
857
|
+
d.stopPropagation(), z("close");
|
|
858
|
+
}
|
|
859
|
+
}, { default: () => [createVNode(NIcon, { size: 18 }, { default: () => [createVNode("svg", {
|
|
860
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
861
|
+
width: "1em",
|
|
862
|
+
height: "1em",
|
|
863
|
+
viewBox: "0 0 24 24"
|
|
864
|
+
}, [createVNode("path", {
|
|
865
|
+
fill: "currentColor",
|
|
866
|
+
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"
|
|
867
|
+
}, null)])] })] })])])])]);
|
|
907
868
|
}
|
|
908
869
|
});
|
|
909
870
|
const AppMultiTabs = /* @__PURE__ */ defineComponent({
|
|
@@ -923,33 +884,29 @@ const AppMultiTabs = /* @__PURE__ */ defineComponent({
|
|
|
923
884
|
return useContentScroll(Y, Z, J), () => createVNode("div", { style: "width: 100%; height: 100%; overflow: hidden; display: flex; justify-content: space-between" }, [createVNode("div", {
|
|
924
885
|
ref: Y,
|
|
925
886
|
style: "flex: 1 1 100%; height: 100%; display: flex; overflow: hidden; align-items: center; position: relative"
|
|
926
|
-
}, [
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
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, {
|
|
887
|
+
}, [createVNode("div", {
|
|
888
|
+
ref: Z,
|
|
889
|
+
style: "flex: 1 1 auto; display: flex; align-items: end; height: 100%",
|
|
890
|
+
onContextmenu: (d) => W(d)
|
|
891
|
+
}, [d.tabs.map((z, V, U) => {
|
|
892
|
+
let G = d.current?.key === z.key, K = z.title ?? z.path;
|
|
893
|
+
return createVNode(AppTab, {
|
|
894
|
+
key: z.key,
|
|
895
|
+
isCurrent: G,
|
|
896
|
+
isLast: V === U.length - 1,
|
|
897
|
+
onClose: z.close,
|
|
898
|
+
closable: z.closable,
|
|
899
|
+
dark: d.dark,
|
|
900
|
+
onClick: () => {
|
|
901
|
+
G || H.push(z.fullPath);
|
|
902
|
+
},
|
|
903
|
+
onContextmenu: (d) => W(d, z)
|
|
904
|
+
}, { default: () => [B.name ? B.name({
|
|
905
|
+
isCurrent: G,
|
|
906
|
+
name: K,
|
|
907
|
+
tab: z
|
|
908
|
+
}) : K] });
|
|
909
|
+
})]), 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
910
|
placement: "bottom-start",
|
|
954
911
|
trigger: "manual",
|
|
955
912
|
show: U.visible,
|