@owocow/saber-ui 0.0.6 → 0.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.
- package/dist/SaberAppSidebar.vue_vue_type_script_setup_true_lang-DsdFlpyM.js +3487 -0
- package/dist/SaberNavigationSearch.vue_vue_type_script_setup_true_lang-BdCVvmQo.js +108 -0
- package/dist/components/SaberAppSidebar.mjs +4 -0
- package/dist/components/SaberNavigationSearch.mjs +4 -0
- package/dist/components/navigation/SaberAppSidebar.types.d.ts +89 -0
- package/dist/components/navigation/SaberAppSidebar.vue.d.ts +43 -0
- package/dist/components/navigation/SaberNavigationSearch.vue.d.ts +49 -0
- package/dist/composables/index.d.ts +2 -0
- package/dist/composables/use-page-header.d.ts +15 -0
- package/dist/composables/use-page-header.mjs +22 -0
- package/dist/composables.mjs +17 -13
- package/dist/forms/components/fields/SaberPopSelect.vue.d.ts +1 -1
- package/dist/forms/components/fields/SaberUploadImage.vue.d.ts +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.mjs +55 -51
- package/package.json +20 -3
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import z from "@nuxt/ui/components/DashboardSearch.vue";
|
|
2
|
+
import L from "@nuxt/ui/components/Button.vue";
|
|
3
|
+
import P from "@nuxt/ui/components/Kbd.vue";
|
|
4
|
+
import { defineComponent as V, useModel as y, computed as w, openBlock as s, createElementBlock as S, normalizeClass as u, createVNode as T, withCtx as B, createElementVNode as A, Fragment as D, renderList as F, createBlock as G, renderSlot as O, normalizeProps as R, guardReactiveProps as W, mergeModels as U } from "vue";
|
|
5
|
+
const Q = /* @__PURE__ */ V({
|
|
6
|
+
name: "SaberNavigationSearch",
|
|
7
|
+
__name: "SaberNavigationSearch",
|
|
8
|
+
props: /* @__PURE__ */ U({
|
|
9
|
+
groups: {},
|
|
10
|
+
label: { default: "搜索菜单" },
|
|
11
|
+
placeholder: { default: "搜索菜单" },
|
|
12
|
+
shortcut: { default: "meta_k" },
|
|
13
|
+
kbds: { default: () => ["meta", "k"] },
|
|
14
|
+
ui: {}
|
|
15
|
+
}, {
|
|
16
|
+
open: { type: Boolean, default: !1 },
|
|
17
|
+
openModifiers: {},
|
|
18
|
+
searchTerm: { default: "" },
|
|
19
|
+
searchTermModifiers: {}
|
|
20
|
+
}),
|
|
21
|
+
emits: /* @__PURE__ */ U(["select"], ["update:open", "update:searchTerm"]),
|
|
22
|
+
setup(l, { emit: C }) {
|
|
23
|
+
const e = l, K = C, n = y(l, "open"), r = y(l, "searchTerm");
|
|
24
|
+
function M(a, t) {
|
|
25
|
+
K("select", {
|
|
26
|
+
source: "search",
|
|
27
|
+
item: a,
|
|
28
|
+
sectionKey: t.sectionKey,
|
|
29
|
+
groupKey: t.key
|
|
30
|
+
}), n.value = !1, r.value = "";
|
|
31
|
+
}
|
|
32
|
+
const N = w(
|
|
33
|
+
() => e.groups.map((a) => ({
|
|
34
|
+
id: a.key,
|
|
35
|
+
label: a.label,
|
|
36
|
+
items: a.items.map((t) => ({
|
|
37
|
+
...t,
|
|
38
|
+
onSelect: () => M(t, a)
|
|
39
|
+
}))
|
|
40
|
+
}))
|
|
41
|
+
), E = {
|
|
42
|
+
fuseOptions: {
|
|
43
|
+
keys: ["label", "description"],
|
|
44
|
+
useTokenSearch: !0,
|
|
45
|
+
threshold: 0.2
|
|
46
|
+
},
|
|
47
|
+
resultLimit: 12,
|
|
48
|
+
matchAllWhenSearchEmpty: !0
|
|
49
|
+
};
|
|
50
|
+
return (a, t) => {
|
|
51
|
+
var c, i, m, p, d, h, b, f, v, _;
|
|
52
|
+
const I = P, $ = L, x = z;
|
|
53
|
+
return s(), S("div", {
|
|
54
|
+
class: u((c = e.ui) == null ? void 0 : c.root)
|
|
55
|
+
}, [
|
|
56
|
+
T($, {
|
|
57
|
+
"data-testid": "search-button",
|
|
58
|
+
color: "neutral",
|
|
59
|
+
variant: "outline",
|
|
60
|
+
icon: "i-lucide-search",
|
|
61
|
+
label: e.label,
|
|
62
|
+
class: u([(m = (i = e.ui) == null ? void 0 : i.button) == null ? void 0 : m.base, (d = (p = e.ui) == null ? void 0 : p.button) == null ? void 0 : d.hover]),
|
|
63
|
+
ui: {
|
|
64
|
+
leadingIcon: (b = (h = e.ui) == null ? void 0 : h.button) == null ? void 0 : b.leadingIcon,
|
|
65
|
+
label: (v = (f = e.ui) == null ? void 0 : f.button) == null ? void 0 : v.label
|
|
66
|
+
},
|
|
67
|
+
onClick: t[0] || (t[0] = (o) => n.value = !0)
|
|
68
|
+
}, {
|
|
69
|
+
trailing: B(() => {
|
|
70
|
+
var o, g;
|
|
71
|
+
return [
|
|
72
|
+
A("span", {
|
|
73
|
+
class: u((g = (o = e.ui) == null ? void 0 : o.button) == null ? void 0 : g.trailing)
|
|
74
|
+
}, [
|
|
75
|
+
(s(!0), S(D, null, F(e.kbds, (k) => (s(), G(I, {
|
|
76
|
+
key: k,
|
|
77
|
+
value: k,
|
|
78
|
+
variant: "subtle"
|
|
79
|
+
}, null, 8, ["value"]))), 128))
|
|
80
|
+
], 2)
|
|
81
|
+
];
|
|
82
|
+
}),
|
|
83
|
+
_: 1
|
|
84
|
+
}, 8, ["label", "class", "ui"]),
|
|
85
|
+
T(x, {
|
|
86
|
+
open: n.value,
|
|
87
|
+
"onUpdate:open": t[1] || (t[1] = (o) => n.value = o),
|
|
88
|
+
"search-term": r.value,
|
|
89
|
+
"onUpdate:searchTerm": t[2] || (t[2] = (o) => r.value = o),
|
|
90
|
+
groups: N.value,
|
|
91
|
+
shortcut: e.shortcut,
|
|
92
|
+
placeholder: e.placeholder,
|
|
93
|
+
fuse: E,
|
|
94
|
+
"color-mode": !1,
|
|
95
|
+
ui: (_ = e.ui) == null ? void 0 : _.panel
|
|
96
|
+
}, {
|
|
97
|
+
empty: B((o) => [
|
|
98
|
+
O(a.$slots, "empty", R(W(o)))
|
|
99
|
+
]),
|
|
100
|
+
_: 3
|
|
101
|
+
}, 8, ["open", "search-term", "groups", "shortcut", "placeholder", "ui"])
|
|
102
|
+
], 2);
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
export {
|
|
107
|
+
Q as _
|
|
108
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { DashboardSearchProps } from '@nuxt/ui/components/DashboardSearch.vue';
|
|
2
|
+
export interface SaberNavigationItem {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface SaberNavigationGroup {
|
|
10
|
+
key: string;
|
|
11
|
+
label?: string;
|
|
12
|
+
items: SaberNavigationItem[];
|
|
13
|
+
}
|
|
14
|
+
export interface SaberNavigationSection {
|
|
15
|
+
key: string;
|
|
16
|
+
label: string;
|
|
17
|
+
icon?: string;
|
|
18
|
+
entryValue?: string;
|
|
19
|
+
groups: SaberNavigationGroup[];
|
|
20
|
+
}
|
|
21
|
+
export interface SaberNavigationSearchGroup {
|
|
22
|
+
key: string;
|
|
23
|
+
label?: string;
|
|
24
|
+
sectionKey?: string;
|
|
25
|
+
items: SaberNavigationItem[];
|
|
26
|
+
}
|
|
27
|
+
export type SaberNavigationSelectSource = 'direct' | 'item' | 'search';
|
|
28
|
+
export interface SaberNavigationSelectPayload {
|
|
29
|
+
source: SaberNavigationSelectSource;
|
|
30
|
+
item: SaberNavigationItem;
|
|
31
|
+
sectionKey?: string;
|
|
32
|
+
groupKey?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface SaberNavigationSearchUI {
|
|
35
|
+
root?: string;
|
|
36
|
+
button?: {
|
|
37
|
+
base?: string;
|
|
38
|
+
hover?: string;
|
|
39
|
+
leadingIcon?: string;
|
|
40
|
+
label?: string;
|
|
41
|
+
trailing?: string;
|
|
42
|
+
};
|
|
43
|
+
panel?: DashboardSearchProps['ui'];
|
|
44
|
+
}
|
|
45
|
+
export interface SaberAppSidebarUI {
|
|
46
|
+
root?: string;
|
|
47
|
+
header?: string;
|
|
48
|
+
logo?: string;
|
|
49
|
+
viewport?: string;
|
|
50
|
+
panel?: string;
|
|
51
|
+
sectionList?: string;
|
|
52
|
+
group?: string;
|
|
53
|
+
groupLabel?: string;
|
|
54
|
+
childList?: string;
|
|
55
|
+
nestedHeader?: string;
|
|
56
|
+
footer?: string;
|
|
57
|
+
transition?: {
|
|
58
|
+
enterActive?: string;
|
|
59
|
+
leaveActive?: string;
|
|
60
|
+
forwardEnterFrom?: string;
|
|
61
|
+
forwardLeaveTo?: string;
|
|
62
|
+
backwardEnterFrom?: string;
|
|
63
|
+
backwardLeaveTo?: string;
|
|
64
|
+
};
|
|
65
|
+
backButton?: {
|
|
66
|
+
base?: string;
|
|
67
|
+
hover?: string;
|
|
68
|
+
icon?: string;
|
|
69
|
+
label?: string;
|
|
70
|
+
};
|
|
71
|
+
sectionItem?: {
|
|
72
|
+
base?: string;
|
|
73
|
+
active?: string;
|
|
74
|
+
inactive?: string;
|
|
75
|
+
hover?: string;
|
|
76
|
+
leadingIcon?: string;
|
|
77
|
+
label?: string;
|
|
78
|
+
trailingIcon?: string;
|
|
79
|
+
};
|
|
80
|
+
childItem?: {
|
|
81
|
+
base?: string;
|
|
82
|
+
active?: string;
|
|
83
|
+
inactive?: string;
|
|
84
|
+
hover?: string;
|
|
85
|
+
leadingIcon?: string;
|
|
86
|
+
label?: string;
|
|
87
|
+
};
|
|
88
|
+
search?: SaberNavigationSearchUI;
|
|
89
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { SaberAppSidebarUI, SaberNavigationSearchGroup, SaberNavigationSection, SaberNavigationSelectPayload } from './SaberAppSidebar.types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
sections: SaberNavigationSection[];
|
|
4
|
+
searchGroups?: SaberNavigationSearchGroup[];
|
|
5
|
+
activeKey?: string;
|
|
6
|
+
shortcut?: string;
|
|
7
|
+
ui?: SaberAppSidebarUI;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_PublicProps = {
|
|
10
|
+
'activeSection'?: string | undefined;
|
|
11
|
+
} & __VLS_Props;
|
|
12
|
+
declare function __VLS_template(): {
|
|
13
|
+
attrs: Partial<{}>;
|
|
14
|
+
slots: {
|
|
15
|
+
logo?(_: {}): any;
|
|
16
|
+
'search-empty'?(_: {
|
|
17
|
+
searchTerm: string;
|
|
18
|
+
}): any;
|
|
19
|
+
footer?(_: {}): any;
|
|
20
|
+
};
|
|
21
|
+
refs: {};
|
|
22
|
+
rootEl: HTMLElement;
|
|
23
|
+
};
|
|
24
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
25
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
26
|
+
select: (payload: SaberNavigationSelectPayload) => any;
|
|
27
|
+
"section-select": (section: SaberNavigationSection) => any;
|
|
28
|
+
"update:activeSection": (value: string | undefined) => any;
|
|
29
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
30
|
+
onSelect?: ((payload: SaberNavigationSelectPayload) => any) | undefined;
|
|
31
|
+
"onSection-select"?: ((section: SaberNavigationSection) => any) | undefined;
|
|
32
|
+
"onUpdate:activeSection"?: ((value: string | undefined) => any) | undefined;
|
|
33
|
+
}>, {
|
|
34
|
+
shortcut: string;
|
|
35
|
+
searchGroups: SaberNavigationSearchGroup[];
|
|
36
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
|
|
37
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
38
|
+
export default _default;
|
|
39
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
40
|
+
new (): {
|
|
41
|
+
$slots: S;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { SaberNavigationSearchGroup, SaberNavigationSearchUI, SaberNavigationSelectPayload } from './SaberAppSidebar.types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
groups: SaberNavigationSearchGroup[];
|
|
4
|
+
label?: string;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
shortcut?: string;
|
|
7
|
+
kbds?: string[];
|
|
8
|
+
ui?: SaberNavigationSearchUI;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_PublicProps = {
|
|
11
|
+
'open'?: boolean;
|
|
12
|
+
'searchTerm'?: string;
|
|
13
|
+
} & __VLS_Props;
|
|
14
|
+
declare function __VLS_template(): {
|
|
15
|
+
attrs: Partial<{}>;
|
|
16
|
+
slots: Readonly<{
|
|
17
|
+
empty?: (props: {
|
|
18
|
+
searchTerm: string;
|
|
19
|
+
}) => unknown;
|
|
20
|
+
}> & {
|
|
21
|
+
empty?: (props: {
|
|
22
|
+
searchTerm: string;
|
|
23
|
+
}) => unknown;
|
|
24
|
+
};
|
|
25
|
+
refs: {};
|
|
26
|
+
rootEl: HTMLDivElement;
|
|
27
|
+
};
|
|
28
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
29
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
30
|
+
select: (payload: SaberNavigationSelectPayload) => any;
|
|
31
|
+
"update:open": (value: boolean) => any;
|
|
32
|
+
"update:searchTerm": (value: string) => any;
|
|
33
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
34
|
+
onSelect?: ((payload: SaberNavigationSelectPayload) => any) | undefined;
|
|
35
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
36
|
+
"onUpdate:searchTerm"?: ((value: string) => any) | undefined;
|
|
37
|
+
}>, {
|
|
38
|
+
label: string;
|
|
39
|
+
placeholder: string;
|
|
40
|
+
shortcut: string;
|
|
41
|
+
kbds: string[];
|
|
42
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
43
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
44
|
+
export default _default;
|
|
45
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
46
|
+
new (): {
|
|
47
|
+
$slots: S;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -8,5 +8,7 @@ export { useSkeleton } from './use-skeleton';
|
|
|
8
8
|
export { useDelayUnmount } from './use-delay-unmount';
|
|
9
9
|
export { useAddressParse } from './use-address-parse';
|
|
10
10
|
export type { UseAddressParseResult } from './use-address-parse';
|
|
11
|
+
export { providePageHeader, usePageHeader, usePageHeaderSuffix } from './use-page-header';
|
|
12
|
+
export type { PageHeaderOptions, PageHeaderState } from './use-page-header';
|
|
11
13
|
export { normalizeTableResponse, useTable } from './use-table';
|
|
12
14
|
export type { ApiFn, ApiParams, MaybePromise, NormalizedTableResponse, PaginationConfig, TableConfig, TableDataWithIndex, TablePagination, } from './use-table';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MaybeRefOrGetter, Ref } from 'vue';
|
|
2
|
+
export interface PageHeaderState {
|
|
3
|
+
title?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface PageHeaderOptions {
|
|
7
|
+
title?: MaybeRefOrGetter<string | undefined>;
|
|
8
|
+
description?: MaybeRefOrGetter<string | undefined>;
|
|
9
|
+
}
|
|
10
|
+
export declare function providePageHeader(suffixTarget: Ref<HTMLElement | null>): {
|
|
11
|
+
title?: string | undefined;
|
|
12
|
+
description?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
export declare function usePageHeader(options: PageHeaderOptions): void;
|
|
15
|
+
export declare function usePageHeaderSuffix(): Ref<HTMLElement | null, HTMLElement | null>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { reactive as c, provide as i, inject as o, watchEffect as d, toValue as r, onBeforeUnmount as s, ref as u } from "vue";
|
|
2
|
+
const n = Symbol("saber-page-header-state"), a = Symbol("saber-page-header-suffix-target");
|
|
3
|
+
function l(t) {
|
|
4
|
+
const e = c({ title: void 0, description: void 0 });
|
|
5
|
+
return i(n, e), i(a, t), e;
|
|
6
|
+
}
|
|
7
|
+
function E(t) {
|
|
8
|
+
const e = o(n, null);
|
|
9
|
+
e && (d(() => {
|
|
10
|
+
e.title = r(t.title), e.description = r(t.description);
|
|
11
|
+
}), s(() => {
|
|
12
|
+
e.title = void 0, e.description = void 0;
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
15
|
+
function p() {
|
|
16
|
+
return o(a, u(null));
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
l as providePageHeader,
|
|
20
|
+
E as usePageHeader,
|
|
21
|
+
p as usePageHeaderSuffix
|
|
22
|
+
};
|
package/dist/composables.mjs
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
import { useBoolean as r } from "./composables/use-boolean.mjs";
|
|
2
2
|
import { useLoading as t } from "./composables/use-loading.mjs";
|
|
3
|
-
import { settleConfirm as f, useConfirm as
|
|
4
|
-
import { useDelete as
|
|
5
|
-
import { useSkeleton as
|
|
6
|
-
import { useDelayUnmount as
|
|
7
|
-
import { useAddressParse as
|
|
8
|
-
import {
|
|
3
|
+
import { settleConfirm as f, useConfirm as m, useConfirmState as u } from "./composables/use-confirm.mjs";
|
|
4
|
+
import { useDelete as n } from "./composables/use-delete.mjs";
|
|
5
|
+
import { useSkeleton as l } from "./composables/use-skeleton.mjs";
|
|
6
|
+
import { useDelayUnmount as i } from "./composables/use-delay-unmount.mjs";
|
|
7
|
+
import { useAddressParse as P } from "./composables/use-address-parse.mjs";
|
|
8
|
+
import { providePageHeader as H, usePageHeader as S, usePageHeaderSuffix as b } from "./composables/use-page-header.mjs";
|
|
9
|
+
import { normalizeTableResponse as T, useTable as k } from "./composables/use-table.mjs";
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
+
T as normalizeTableResponse,
|
|
12
|
+
H as providePageHeader,
|
|
11
13
|
f as settleConfirm,
|
|
12
|
-
|
|
14
|
+
P as useAddressParse,
|
|
13
15
|
r as useBoolean,
|
|
14
|
-
|
|
16
|
+
m as useConfirm,
|
|
15
17
|
u as useConfirmState,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
i as useDelayUnmount,
|
|
19
|
+
n as useDelete,
|
|
18
20
|
t as useLoading,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
S as usePageHeader,
|
|
22
|
+
b as usePageHeaderSuffix,
|
|
23
|
+
l as useSkeleton,
|
|
24
|
+
k as useTable
|
|
21
25
|
};
|
|
@@ -17,9 +17,9 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {},
|
|
|
17
17
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
18
18
|
}>, {
|
|
19
19
|
placeholder: string;
|
|
20
|
+
multiple: boolean;
|
|
20
21
|
disabled: boolean;
|
|
21
22
|
clearable: boolean;
|
|
22
23
|
items: PopSelectOption[];
|
|
23
|
-
multiple: boolean;
|
|
24
24
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
25
25
|
export default _default;
|
|
@@ -102,10 +102,10 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
|
102
102
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
103
103
|
onRemoveError?: ((error: Error, value: any) => any) | undefined;
|
|
104
104
|
}>, {
|
|
105
|
+
multiple: boolean;
|
|
105
106
|
disabled: boolean;
|
|
106
107
|
size: string;
|
|
107
108
|
dataSource: UploadImageDataSource<any>;
|
|
108
|
-
multiple: boolean;
|
|
109
109
|
max: number;
|
|
110
110
|
maxSize: number;
|
|
111
111
|
accept: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ import { default as SaberInfoProvider } from './components/SaberInfoProvider.vue
|
|
|
8
8
|
import { default as SaberModalWithMobile } from './components/SaberModalWithMobile.vue';
|
|
9
9
|
import { default as SaberStatus } from './components/SaberStatus.vue';
|
|
10
10
|
import { default as SaberSwitchBar } from './components/SaberSwitchBar.vue';
|
|
11
|
+
import { default as SaberAppSidebar } from './components/navigation/SaberAppSidebar.vue';
|
|
12
|
+
import { default as SaberNavigationSearch } from './components/navigation/SaberNavigationSearch.vue';
|
|
11
13
|
import { default as SaberFilterBar } from './forms/components/SaberFilterBar.vue';
|
|
12
14
|
import { default as SaberFormModal } from './forms/components/SaberFormModal.vue';
|
|
13
15
|
import { default as SaberModal } from './forms/components/SaberModal.vue';
|
|
@@ -31,10 +33,11 @@ export { BadgeStatus as SaberBadgeStatus };
|
|
|
31
33
|
export type { BadgeStatusProps } from './BadgeStatus.types';
|
|
32
34
|
export { SaberNoData };
|
|
33
35
|
export type { SaberNoDataProps } from './SaberNoData.types';
|
|
34
|
-
export { SaberConfirmModal, SaberConfirmProvider, SaberInfo, SaberInfoProvider, SaberModalWithMobile, SaberStatus, SaberSwitchBar, };
|
|
36
|
+
export { SaberConfirmModal, SaberConfirmProvider, SaberInfo, SaberInfoProvider, SaberModalWithMobile, SaberAppSidebar, SaberNavigationSearch, SaberStatus, SaberSwitchBar, };
|
|
35
37
|
export type { SaberInfoContext, SaberInfoMode, SaberInfoProps, SaberInfoVariant } from './components/SaberInfo.types';
|
|
36
38
|
export type { SaberStatusType } from './components/SaberStatus.types';
|
|
37
39
|
export type { SaberSwitchBarItem, SaberSwitchBarUI, SaberSwitchBarValue } from './components/SaberSwitchBar.types';
|
|
40
|
+
export type { SaberAppSidebarUI, SaberNavigationGroup, SaberNavigationItem, SaberNavigationSearchGroup, SaberNavigationSearchUI, SaberNavigationSection, SaberNavigationSelectPayload, SaberNavigationSelectSource, } from './components/navigation/SaberAppSidebar.types';
|
|
38
41
|
export { SaberFilterBar, SaberFormModal, SaberDictCheckbox, SaberDictRadio, SaberDictSelect, SaberDistrictSelect, SaberInput, SaberInputNumber, SaberModal, SaberPopSelect, SaberRadioGroup, SaberSelect, SaberTextarea, };
|
|
39
42
|
export { installSaberForms, type SaberFormsOptions } from './forms/plugin';
|
|
40
43
|
export type { DictDataSource, DictOption, FilterField, FormField, FormSubmitHandler, FormValidator } from './forms/types';
|
|
@@ -50,6 +53,8 @@ declare module 'vue' {
|
|
|
50
53
|
SaberModalWithMobile: typeof SaberModalWithMobile;
|
|
51
54
|
SaberStatus: typeof SaberStatus;
|
|
52
55
|
SaberSwitchBar: typeof SaberSwitchBar;
|
|
56
|
+
SaberAppSidebar: typeof SaberAppSidebar;
|
|
57
|
+
SaberNavigationSearch: typeof SaberNavigationSearch;
|
|
53
58
|
SaberFilterBar: typeof SaberFilterBar;
|
|
54
59
|
SaberFormModal: typeof SaberFormModal;
|
|
55
60
|
SaberModal: typeof SaberModal;
|
package/dist/index.mjs
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import h from "@nuxt/ui/vue-plugin";
|
|
2
2
|
import y from "@nuxt/ui/components/Badge.vue";
|
|
3
|
-
import { defineComponent as
|
|
4
|
-
import
|
|
5
|
-
import { _ as
|
|
3
|
+
import { defineComponent as _, computed as f, openBlock as s, createBlock as $, normalizeStyle as v, withCtx as C, createTextVNode as k, toDisplayString as d, createElementBlock as i, normalizeClass as B, createElementVNode as l, createVNode as I, createCommentVNode as m, renderSlot as u } from "vue";
|
|
4
|
+
import N from "@nuxt/ui/runtime/vue/components/Icon.vue";
|
|
5
|
+
import { _ as D } from "./SaberConfirmModal.vue_vue_type_script_setup_true_lang-Cqp9krYl.js";
|
|
6
6
|
import { _ as M } from "./SaberConfirmProvider.vue_vue_type_script_setup_true_lang-DUJ6ftNJ.js";
|
|
7
7
|
import { _ as w } from "./SaberInfo.vue_vue_type_script_setup_true_lang-B3W5VsGR.js";
|
|
8
8
|
import { _ as P } from "./SaberInfoProvider.vue_vue_type_script_setup_true_lang-3rF6bSCn.js";
|
|
9
9
|
import { _ as z } from "./SaberModalWithMobile.vue_vue_type_script_setup_true_lang-aQlToncY.js";
|
|
10
|
-
import { _ as
|
|
11
|
-
import { _ as
|
|
12
|
-
import {
|
|
13
|
-
import { _ as
|
|
14
|
-
import {
|
|
15
|
-
import { _ as pe } from "./
|
|
16
|
-
import { _ as xe
|
|
17
|
-
import { _ as
|
|
18
|
-
import { _ as Ce } from "./
|
|
19
|
-
import { _ as Be } from "./
|
|
10
|
+
import { _ as A } from "./SaberStatus.vue_vue_type_script_setup_true_lang-D9aRVCow.js";
|
|
11
|
+
import { _ as F } from "./SaberSwitchBar.vue_vue_type_script_setup_true_lang-CDx3Dcas.js";
|
|
12
|
+
import { _ as U } from "./SaberAppSidebar.vue_vue_type_script_setup_true_lang-DsdFlpyM.js";
|
|
13
|
+
import { _ as V } from "./SaberNavigationSearch.vue_vue_type_script_setup_true_lang-BdCVvmQo.js";
|
|
14
|
+
import { k as W } from "./plugin-Dr3z0YFg.js";
|
|
15
|
+
import { _ as be, a as fe, b as ue, c as Se, d as _e, e as pe } from "./plugin-Dr3z0YFg.js";
|
|
16
|
+
import { _ as xe } from "./SaberModal.vue_vue_type_script_setup_true_lang-DJno3jA3.js";
|
|
17
|
+
import { _ as ye } from "./SaberDictCheckbox.vue_vue_type_script_setup_true_lang-DUbzy_C6.js";
|
|
18
|
+
import { _ as ve, a as Ce } from "./SaberDictRadio.vue_vue_type_script_setup_true_lang-DR6-jSID.js";
|
|
19
|
+
import { _ as Be } from "./SaberDictSelect.vue_vue_type_script_setup_true_lang-B8PTKNKX.js";
|
|
20
|
+
import { _ as Ne } from "./SaberDistrictSelect.vue_vue_type_script_setup_true_lang-BX8nLC35.js";
|
|
21
|
+
import { _ as Me } from "./SaberPopSelect.vue_vue_type_script_setup_true_lang-BcS27NXI.js";
|
|
20
22
|
const b = {
|
|
21
23
|
red: { 500: "#ef4444", 600: "#dc2626" },
|
|
22
24
|
orange: { 500: "#f97316", 600: "#ea580c" },
|
|
@@ -40,16 +42,16 @@ const b = {
|
|
|
40
42
|
zinc: { 500: "#71717a", 600: "#52525b" },
|
|
41
43
|
neutral: { 500: "#737373", 600: "#525252" },
|
|
42
44
|
stone: { 500: "#78716c", 600: "#57534e" }
|
|
43
|
-
},
|
|
44
|
-
function
|
|
45
|
+
}, H = b.gray;
|
|
46
|
+
function S(e, t) {
|
|
45
47
|
var o, a;
|
|
46
|
-
return ((o = b[e]) == null ? void 0 : o[t]) ?? ((a = b[e]) == null ? void 0 : a[500]) ??
|
|
48
|
+
return ((o = b[e]) == null ? void 0 : o[t]) ?? ((a = b[e]) == null ? void 0 : a[500]) ?? H[500];
|
|
47
49
|
}
|
|
48
|
-
function
|
|
50
|
+
function R(e, t) {
|
|
49
51
|
const o = parseInt(e.slice(1, 3), 16), a = parseInt(e.slice(3, 5), 16), r = parseInt(e.slice(5, 7), 16);
|
|
50
52
|
return `rgba(${o}, ${a}, ${r}, ${t / 100})`;
|
|
51
53
|
}
|
|
52
|
-
const
|
|
54
|
+
const T = /* @__PURE__ */ _({
|
|
53
55
|
__name: "BadgeStatus",
|
|
54
56
|
props: {
|
|
55
57
|
value: {},
|
|
@@ -69,9 +71,9 @@ const R = /* @__PURE__ */ S({
|
|
|
69
71
|
}
|
|
70
72
|
return { label: r, color: "gray" };
|
|
71
73
|
}), a = f(() => {
|
|
72
|
-
const { color: r } = o.value, c =
|
|
74
|
+
const { color: r } = o.value, c = S(r, 500), n = S(r, t.textColorWeight);
|
|
73
75
|
return {
|
|
74
|
-
backgroundColor:
|
|
76
|
+
backgroundColor: R(c, t.bgOpacity),
|
|
75
77
|
color: n
|
|
76
78
|
};
|
|
77
79
|
});
|
|
@@ -88,10 +90,10 @@ const R = /* @__PURE__ */ S({
|
|
|
88
90
|
}, 8, ["style"]);
|
|
89
91
|
};
|
|
90
92
|
}
|
|
91
|
-
}),
|
|
93
|
+
}), E = { class: "rounded-md border border-accented p-3" }, L = { class: "flex flex-col gap-1" }, O = { class: "text-base font-semibold mb-2 text-highlighted w-60" }, j = {
|
|
92
94
|
key: 0,
|
|
93
95
|
class: "text-sm text-muted w-60"
|
|
94
|
-
},
|
|
96
|
+
}, G = { key: 0 }, K = { key: 1 }, q = /* @__PURE__ */ _({
|
|
95
97
|
name: "SaberNoData",
|
|
96
98
|
__name: "SaberNoData",
|
|
97
99
|
props: {
|
|
@@ -103,7 +105,7 @@ const R = /* @__PURE__ */ S({
|
|
|
103
105
|
},
|
|
104
106
|
setup(e) {
|
|
105
107
|
return (t, o) => {
|
|
106
|
-
const a =
|
|
108
|
+
const a = N;
|
|
107
109
|
return s(), i("div", {
|
|
108
110
|
class: B([
|
|
109
111
|
"flex flex-col items-center justify-center gap-6 rounded-md p-10 text-center bg-default",
|
|
@@ -111,53 +113,55 @@ const R = /* @__PURE__ */ S({
|
|
|
111
113
|
t.$props.class
|
|
112
114
|
])
|
|
113
115
|
}, [
|
|
114
|
-
l("div",
|
|
116
|
+
l("div", E, [
|
|
115
117
|
I(a, {
|
|
116
118
|
name: e.icon,
|
|
117
119
|
class: "size-5"
|
|
118
120
|
}, null, 8, ["name"])
|
|
119
121
|
]),
|
|
120
|
-
l("div",
|
|
121
|
-
l("h4",
|
|
122
|
-
e.description ? (s(), i("p",
|
|
122
|
+
l("div", L, [
|
|
123
|
+
l("h4", O, d(e.title), 1),
|
|
124
|
+
e.description ? (s(), i("p", j, d(e.description), 1)) : m("", !0)
|
|
123
125
|
]),
|
|
124
|
-
t.$slots.default ? (s(), i("div",
|
|
126
|
+
t.$slots.default ? (s(), i("div", G, [
|
|
125
127
|
u(t.$slots, "default")
|
|
126
128
|
])) : m("", !0),
|
|
127
|
-
t.$slots.extra ? (s(), i("p",
|
|
129
|
+
t.$slots.extra ? (s(), i("p", K, [
|
|
128
130
|
u(t.$slots, "extra")
|
|
129
131
|
])) : m("", !0)
|
|
130
132
|
], 2);
|
|
131
133
|
};
|
|
132
134
|
}
|
|
133
|
-
}),
|
|
135
|
+
}), le = {
|
|
134
136
|
install(e, t = {}) {
|
|
135
|
-
e.use(h), e.component("SaberBadgeStatus",
|
|
137
|
+
e.use(h), e.component("SaberBadgeStatus", T), e.component("SaberNoData", q), e.component("SaberConfirmModal", D), e.component("SaberConfirmProvider", M), e.component("SaberInfo", w), e.component("SaberInfoProvider", P), e.component("SaberModalWithMobile", z), e.component("SaberStatus", A), e.component("SaberSwitchBar", F), e.component("SaberAppSidebar", U), e.component("SaberNavigationSearch", V), W(e, t.forms);
|
|
136
138
|
}
|
|
137
139
|
};
|
|
138
140
|
export {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
+
U as SaberAppSidebar,
|
|
142
|
+
T as SaberBadgeStatus,
|
|
143
|
+
D as SaberConfirmModal,
|
|
141
144
|
M as SaberConfirmProvider,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
145
|
+
ye as SaberDictCheckbox,
|
|
146
|
+
ve as SaberDictRadio,
|
|
147
|
+
Be as SaberDictSelect,
|
|
148
|
+
Ne as SaberDistrictSelect,
|
|
149
|
+
be as SaberFilterBar,
|
|
150
|
+
fe as SaberFormModal,
|
|
148
151
|
w as SaberInfo,
|
|
149
152
|
P as SaberInfoProvider,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
+
ue as SaberInput,
|
|
154
|
+
Se as SaberInputNumber,
|
|
155
|
+
xe as SaberModal,
|
|
153
156
|
z as SaberModalWithMobile,
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
157
|
+
V as SaberNavigationSearch,
|
|
158
|
+
q as SaberNoData,
|
|
159
|
+
Me as SaberPopSelect,
|
|
160
|
+
Ce as SaberRadioGroup,
|
|
161
|
+
_e as SaberSelect,
|
|
162
|
+
A as SaberStatus,
|
|
163
|
+
F as SaberSwitchBar,
|
|
164
|
+
pe as SaberTextarea,
|
|
165
|
+
le as default,
|
|
166
|
+
W as installSaberForms
|
|
163
167
|
};
|