@owocow/saber-ui 0.0.6 → 0.0.7
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.
|
@@ -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
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owocow/saber-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "Saber application foundation for Vue 3 projects built on Nuxt UI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -84,6 +84,10 @@
|
|
|
84
84
|
"types": "./dist/composables/use-address-parse.d.ts",
|
|
85
85
|
"import": "./dist/composables/use-address-parse.mjs"
|
|
86
86
|
},
|
|
87
|
+
"./composables/use-page-header": {
|
|
88
|
+
"types": "./dist/composables/use-page-header.d.ts",
|
|
89
|
+
"import": "./dist/composables/use-page-header.mjs"
|
|
90
|
+
},
|
|
87
91
|
"./components/SaberInfo": {
|
|
88
92
|
"types": "./dist/components/SaberInfo.vue.d.ts",
|
|
89
93
|
"import": "./dist/components/SaberInfo.mjs"
|
|
@@ -173,12 +177,13 @@
|
|
|
173
177
|
"dist"
|
|
174
178
|
],
|
|
175
179
|
"scripts": {
|
|
180
|
+
"test": "node --test",
|
|
176
181
|
"build": "vite build",
|
|
177
182
|
"docs:dev": "vitepress dev docs",
|
|
178
183
|
"docs:typecheck": "tsc -p docs/tsconfig.json --noEmit",
|
|
179
184
|
"docs:build": "vitepress build docs",
|
|
180
185
|
"docs:preview": "vitepress preview docs",
|
|
181
|
-
"verify": "pnpm build && pnpm docs:typecheck && pnpm docs:build",
|
|
186
|
+
"verify": "pnpm test && pnpm build && pnpm docs:typecheck && pnpm docs:build",
|
|
182
187
|
"prepublishOnly": "npm run build"
|
|
183
188
|
},
|
|
184
189
|
"dependencies": {
|