@oiij/naive-ui 0.0.66 → 0.0.67

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 (39) hide show
  1. package/dist/components/config-providers/ConfigProviders.js +10 -18
  2. package/dist/components/config-providers/ConfigProviders.vue.d.ts +5 -5
  3. package/dist/components/config-providers/index.d.ts +6 -8
  4. package/dist/components/copy-button/CopyButton.vue.d.ts +8 -8
  5. package/dist/components/data-table-plus/DataTablePlus.vue.d.ts +43 -43
  6. package/dist/components/index.d.ts +17 -19
  7. package/dist/components/loading-provider/LoadingProvider.js +78 -0
  8. package/dist/components/loading-provider/LoadingProvider.vue.d.ts +38 -0
  9. package/dist/components/loading-provider/index.d.ts +23 -0
  10. package/dist/components/loading-provider/index.js +7 -0
  11. package/dist/components/{full-loading/full-loading.cssr.js → loading-provider/loading-provider.cssr.js} +5 -5
  12. package/dist/components/preset-form/PresetForm.vue.d.ts +19 -19
  13. package/dist/components/preset-input/PresetInput.vue.d.ts +4 -4
  14. package/dist/components/preset-picker/PresetPicker.js +1 -1
  15. package/dist/components/preset-picker/PresetPicker.vue.d.ts +5 -5
  16. package/dist/components/preset-select/PresetSelect.vue.d.ts +28 -28
  17. package/dist/components/remote-request/RemoteRequest.vue.d.ts +12 -12
  18. package/dist/components/search-input/SearchInput.vue.d.ts +12 -12
  19. package/dist/components/toggle-input/ToggleInput.vue.d.ts +5 -5
  20. package/dist/components/tooltip-button/TooltipButton.vue.d.ts +5 -5
  21. package/dist/components/transition/BaseTransition.vue.d.ts +6 -6
  22. package/dist/components/type-writer/TypeWriter.js +1 -1
  23. package/dist/components/type-writer/TypeWriter.vue.d.ts +5 -5
  24. package/dist/components.d.ts +19 -21
  25. package/dist/components.js +5 -5
  26. package/dist/composables/index.d.ts +1 -0
  27. package/dist/composables/useDataRequest.d.ts +1 -1
  28. package/dist/composables/useLoading.d.ts +10 -0
  29. package/dist/composables/useLoading.js +10 -0
  30. package/dist/index.d.ts +2 -1
  31. package/dist/index.js +2 -1
  32. package/package.json +11 -11
  33. package/dist/components/bubble/Bubble.js +0 -67
  34. package/dist/components/bubble/Bubble.vue.d.ts +0 -54
  35. package/dist/components/bubble/bubble.cssr.js +0 -23
  36. package/dist/components/bubble/index.d.ts +0 -20
  37. package/dist/components/full-loading/FullLoading.js +0 -70
  38. package/dist/components/full-loading/FullLoading.vue.d.ts +0 -38
  39. package/dist/components/full-loading/index.d.ts +0 -17
@@ -0,0 +1,10 @@
1
+ import { loadingProviderInjectionKey } from "../components/loading-provider/index.js";
2
+ import { inject } from "vue";
3
+
4
+ //#region src/composables/useLoading.ts
5
+ function useLoading() {
6
+ return inject(loadingProviderInjectionKey);
7
+ }
8
+
9
+ //#endregion
10
+ export { useLoading };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { DataObject, DataRequestFields, UseDataRequestOptions, UseDataRequestPagination, UseDataRequestReturns, useDataRequest } from "./composables/useDataRequest.js";
2
+ import { useLoading } from "./composables/useLoading.js";
2
3
  import { NaiveFormClearRules, NaiveFormOptions, NaiveFormReturns, NaiveFormRules, useNaiveForm } from "./composables/useNaiveForm.js";
3
4
  import { NaiveThemeReturns, useNaiveTheme } from "./composables/useNaiveTheme.js";
4
5
  import "./composables/index.js";
5
- export { DataObject, DataRequestFields, NaiveFormClearRules, NaiveFormOptions, NaiveFormReturns, NaiveFormRules, NaiveThemeReturns, UseDataRequestOptions, UseDataRequestPagination, UseDataRequestReturns, useDataRequest, useNaiveForm, useNaiveTheme };
6
+ export { DataObject, DataRequestFields, NaiveFormClearRules, NaiveFormOptions, NaiveFormReturns, NaiveFormRules, NaiveThemeReturns, UseDataRequestOptions, UseDataRequestPagination, UseDataRequestReturns, useDataRequest, useLoading, useNaiveForm, useNaiveTheme };
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { useDataRequest } from "./composables/useDataRequest.js";
2
+ import { useLoading } from "./composables/useLoading.js";
2
3
  import { useNaiveForm } from "./composables/useNaiveForm.js";
3
4
  import { useNaiveTheme } from "./composables/useNaiveTheme.js";
4
5
 
5
- export { useDataRequest, useNaiveForm, useNaiveTheme };
6
+ export { useDataRequest, useLoading, useNaiveForm, useNaiveTheme };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oiij/naive-ui",
3
3
  "type": "module",
4
- "version": "0.0.66",
4
+ "version": "0.0.67",
5
5
  "description": "Some Composable Functions And Components for Vue 3",
6
6
  "author": "oiij",
7
7
  "license": "MIT",
@@ -42,12 +42,12 @@
42
42
  "es-toolkit": "^1.43.0",
43
43
  "naive-ui": "^2.43.2",
44
44
  "prismjs": "^1.30.0",
45
- "vue": "^3.5.25",
46
- "vue-component-type-helpers": "^3.1.8",
45
+ "vue": "^3.5.26",
46
+ "vue-component-type-helpers": "^3.2.1",
47
47
  "vue-hooks-plus": "^2.4.1",
48
- "@oiij/markdown-it": "0.0.9",
49
- "@oiij/css-render": "0.0.7",
50
- "@oiij/use": "0.0.29"
48
+ "@oiij/css-render": "0.0.8",
49
+ "@oiij/markdown-it": "0.0.10",
50
+ "@oiij/use": "0.0.30"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/prismjs": "^1.26.5",
@@ -57,12 +57,12 @@
57
57
  "es-toolkit": "^1.43.0",
58
58
  "naive-ui": "^2.43.2",
59
59
  "prismjs": "^1.30.0",
60
- "vue": "^3.5.25",
61
- "vue-component-type-helpers": "^3.1.8",
60
+ "vue": "^3.5.26",
61
+ "vue-component-type-helpers": "^3.2.1",
62
62
  "vue-hooks-plus": "^2.4.1",
63
- "@oiij/css-render": "0.0.7",
64
- "@oiij/use": "0.0.29",
65
- "@oiij/markdown-it": "0.0.9"
63
+ "@oiij/use": "0.0.30",
64
+ "@oiij/css-render": "0.0.8",
65
+ "@oiij/markdown-it": "0.0.10"
66
66
  },
67
67
  "publishConfig": {
68
68
  "access": "public"
@@ -1,67 +0,0 @@
1
- import BaseTransition_default from "../transition/BaseTransition.js";
2
- import TypeWriter_default from "../type-writer/TypeWriter.js";
3
- import { bubbleCssr, cName } from "./bubble.cssr.js";
4
- import { createBlock, createCommentVNode, createElementVNode, createVNode, defineComponent, mergeProps, normalizeClass, normalizeStyle, openBlock, renderSlot, resolveDynamicComponent, unref, withCtx } from "vue";
5
- import { NAvatar, NEl, NFlex, NSpin } from "naive-ui";
6
- import { useStyle } from "@oiij/css-render";
7
-
8
- //#region src/components/bubble/Bubble.vue
9
- const _sfc_main = /* @__PURE__ */ defineComponent({
10
- __name: "Bubble",
11
- props: {
12
- avatar: {},
13
- content: {},
14
- contentClass: {},
15
- contentStyle: {},
16
- loading: { type: Boolean },
17
- typing: { type: Boolean },
18
- markdown: { type: Boolean },
19
- placement: {}
20
- },
21
- emits: ["typingComplete"],
22
- setup(__props, { emit: __emit }) {
23
- const emit = __emit;
24
- useStyle("n-bubble", bubbleCssr());
25
- return (_ctx, _cache) => {
26
- return openBlock(), createBlock(unref(NEl), {
27
- tag: "div",
28
- class: normalizeClass([unref(cName), __props.placement === "end" ? `${unref(cName)}--reverse` : ""])
29
- }, {
30
- default: withCtx(() => [renderSlot(_ctx.$slots, "avatar", {}, () => [__props.avatar ? (openBlock(), createBlock(unref(NAvatar), mergeProps({
31
- key: 0,
32
- round: ""
33
- }, __props.avatar.props), {
34
- default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.avatar.icon)))]),
35
- _: 1
36
- }, 16)) : createCommentVNode("v-if", true)]), createVNode(unref(NFlex), { vertical: "" }, {
37
- default: withCtx(() => [
38
- renderSlot(_ctx.$slots, "header"),
39
- createVNode(unref(BaseTransition_default), null, {
40
- default: withCtx(() => [__props.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }, () => [createVNode(unref(NSpin), { style: { "height": "44px" } })]) : renderSlot(_ctx.$slots, "default", { key: 1 }, () => [createElementVNode("div", {
41
- class: normalizeClass([`${unref(cName)}__content`, __props.contentClass]),
42
- style: normalizeStyle(__props.contentStyle)
43
- }, [createVNode(unref(TypeWriter_default), {
44
- typing: __props.typing,
45
- markdown: __props.markdown,
46
- value: __props.content,
47
- onStop: _cache[0] || (_cache[0] = ($event) => emit("typingComplete"))
48
- }, null, 8, [
49
- "typing",
50
- "markdown",
51
- "value"
52
- ])], 6)])]),
53
- _: 3
54
- }),
55
- renderSlot(_ctx.$slots, "footer")
56
- ]),
57
- _: 3
58
- })]),
59
- _: 3
60
- }, 8, ["class"]);
61
- };
62
- }
63
- });
64
- var Bubble_default = _sfc_main;
65
-
66
- //#endregion
67
- export { Bubble_default as default };
@@ -1,54 +0,0 @@
1
- import * as vue25 from "vue";
2
- import * as naive_ui15 from "naive-ui";
3
-
4
- //#region src/components/bubble/Bubble.vue.d.ts
5
- declare var __VLS_8: {}, __VLS_27: {}, __VLS_35: {}, __VLS_42: {}, __VLS_51: {};
6
- type __VLS_Slots = {} & {
7
- avatar?: (props: typeof __VLS_8) => any;
8
- } & {
9
- header?: (props: typeof __VLS_27) => any;
10
- } & {
11
- loading?: (props: typeof __VLS_35) => any;
12
- } & {
13
- default?: (props: typeof __VLS_42) => any;
14
- } & {
15
- footer?: (props: typeof __VLS_51) => any;
16
- };
17
- declare const __VLS_base: vue25.DefineComponent<{
18
- avatar?: {
19
- icon?: vue25.VNodeChild;
20
- props?: naive_ui15.AvatarProps;
21
- };
22
- content?: string;
23
- contentClass?: string;
24
- contentStyle?: vue25.CSSProperties;
25
- loading?: boolean;
26
- typing?: boolean;
27
- markdown?: boolean;
28
- placement?: "start" | "end";
29
- }, {}, {}, {}, {}, vue25.ComponentOptionsMixin, vue25.ComponentOptionsMixin, {} & {
30
- typingComplete: () => any;
31
- }, string, vue25.PublicProps, Readonly<{
32
- avatar?: {
33
- icon?: vue25.VNodeChild;
34
- props?: naive_ui15.AvatarProps;
35
- };
36
- content?: string;
37
- contentClass?: string;
38
- contentStyle?: vue25.CSSProperties;
39
- loading?: boolean;
40
- typing?: boolean;
41
- markdown?: boolean;
42
- placement?: "start" | "end";
43
- }> & Readonly<{
44
- onTypingComplete?: (() => any) | undefined;
45
- }>, {}, {}, {}, {}, string, vue25.ComponentProvideOptions, false, {}, any>;
46
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
47
- declare const _default: typeof __VLS_export;
48
- type __VLS_WithSlots<T, S> = T & {
49
- new (): {
50
- $slots: S;
51
- };
52
- };
53
- //#endregion
54
- export { _default };
@@ -1,23 +0,0 @@
1
- import { cssr, namespace, plugin } from "../_utils/cssr-bem.js";
2
-
3
- //#region src/components/bubble/bubble.cssr.ts
4
- const { c, cB, cE, cM } = {
5
- ...cssr,
6
- ...plugin
7
- };
8
- const cName = `${namespace}-bubble`;
9
- function bubbleCssr() {
10
- return c([cB("bubble", {
11
- display: "flex",
12
- gap: "10px",
13
- fontSize: "var(--n-font-size);"
14
- }, [cM("reverse", { flexDirection: "row-reverse" }), cE("content", {
15
- backgroundColor: "var(--tag-color)",
16
- padding: "10px",
17
- borderRadius: "var(--border-radius)",
18
- minHeight: "44px"
19
- })])]);
20
- }
21
-
22
- //#endregion
23
- export { bubbleCssr, cName };
@@ -1,20 +0,0 @@
1
- import { _default } from "./Bubble.vue.js";
2
- import { CSSProperties, VNodeChild } from "vue";
3
- import { AvatarProps } from "naive-ui";
4
-
5
- //#region src/components/bubble/index.d.ts
6
- type BubbleProps = {
7
- avatar?: {
8
- icon?: VNodeChild;
9
- props?: AvatarProps;
10
- };
11
- content?: string;
12
- contentClass?: string;
13
- contentStyle?: CSSProperties;
14
- loading?: boolean;
15
- typing?: boolean;
16
- markdown?: boolean;
17
- placement?: 'start' | 'end';
18
- };
19
- //#endregion
20
- export { BubbleProps };
@@ -1,70 +0,0 @@
1
- import BaseTransition_default from "../transition/BaseTransition.js";
2
- import { cName, fullLoadingCssr } from "./full-loading.cssr.js";
3
- import { Teleport, createBlock, createCommentVNode, createSlots, createVNode, defineComponent, guardReactiveProps, normalizeClass, normalizeProps, normalizeStyle, openBlock, ref, renderSlot, unref, watchEffect, withCtx } from "vue";
4
- import { NEl, NSpin } from "naive-ui";
5
- import { useStyle } from "@oiij/css-render";
6
-
7
- //#region src/components/full-loading/FullLoading.vue
8
- const _sfc_main = /* @__PURE__ */ defineComponent({
9
- __name: "FullLoading",
10
- props: {
11
- show: { type: Boolean },
12
- appendTo: { default: "body" },
13
- mask: {
14
- type: [Boolean, Object],
15
- default: true
16
- },
17
- blur: {
18
- type: Boolean,
19
- default: true
20
- },
21
- disableScroll: {
22
- type: Boolean,
23
- default: true
24
- },
25
- scrollSelector: { default: "body" },
26
- spinProps: {}
27
- },
28
- setup(__props) {
29
- useStyle(cName, fullLoadingCssr());
30
- const cacheOverFlow = ref("auto");
31
- watchEffect(() => {
32
- if (__props.disableScroll) {
33
- const el = __props.scrollSelector instanceof HTMLElement ? __props.scrollSelector : document.querySelector(__props.scrollSelector);
34
- if (el) {
35
- if (__props.show) cacheOverFlow.value = el.style.overflow;
36
- el.style.overflow = __props.show ? "hidden" : cacheOverFlow.value;
37
- }
38
- }
39
- });
40
- return (_ctx, _cache) => {
41
- return openBlock(), createBlock(unref(BaseTransition_default), null, {
42
- default: withCtx(() => [(openBlock(), createBlock(Teleport, { to: __props.appendTo }, [__props.show ? (openBlock(), createBlock(unref(NEl), {
43
- key: 0,
44
- class: normalizeClass([
45
- unref(cName),
46
- { [`${unref(cName)}--mask`]: __props.mask },
47
- { [`${unref(cName)}--blur`]: __props.blur }
48
- ]),
49
- style: normalizeStyle(typeof __props.mask === "object" ? __props.mask : {})
50
- }, {
51
- default: withCtx(() => [createVNode(unref(NSpin), normalizeProps(guardReactiveProps(__props.spinProps)), createSlots({ _: 2 }, [_ctx.$slots.description ? {
52
- name: "description",
53
- fn: withCtx(() => [renderSlot(_ctx.$slots, "description")]),
54
- key: "0"
55
- } : void 0, _ctx.$slots.icon ? {
56
- name: "icon",
57
- fn: withCtx(() => [renderSlot(_ctx.$slots, "icon")]),
58
- key: "1"
59
- } : void 0]), 1040)]),
60
- _: 3
61
- }, 8, ["class", "style"])) : createCommentVNode("v-if", true)], 8, ["to"]))]),
62
- _: 3
63
- });
64
- };
65
- }
66
- });
67
- var FullLoading_default = _sfc_main;
68
-
69
- //#endregion
70
- export { FullLoading_default as default };
@@ -1,38 +0,0 @@
1
- import { ClassStyle } from "../data-table-plus/index.js";
2
- import "../../components.js";
3
- import * as vue71 from "vue";
4
- import * as naive_ui39 from "naive-ui";
5
-
6
- //#region src/components/full-loading/FullLoading.vue.d.ts
7
- declare var __VLS_27: {}, __VLS_30: {};
8
- type __VLS_Slots = {} & {
9
- description?: (props: typeof __VLS_27) => any;
10
- } & {
11
- icon?: (props: typeof __VLS_30) => any;
12
- };
13
- declare const __VLS_base: vue71.DefineComponent<{
14
- show?: boolean;
15
- appendTo?: string | vue71.RendererElement;
16
- mask?: boolean | vue71.CSSProperties;
17
- blur?: boolean;
18
- disableScroll?: boolean;
19
- scrollSelector?: string | HTMLElement;
20
- spinProps?: Omit<naive_ui39.SpinProps, "show"> & ClassStyle;
21
- }, {}, {}, {}, {}, vue71.ComponentOptionsMixin, vue71.ComponentOptionsMixin, {}, string, vue71.PublicProps, Readonly<{
22
- show?: boolean;
23
- appendTo?: string | vue71.RendererElement;
24
- mask?: boolean | vue71.CSSProperties;
25
- blur?: boolean;
26
- disableScroll?: boolean;
27
- scrollSelector?: string | HTMLElement;
28
- spinProps?: Omit<naive_ui39.SpinProps, "show"> & ClassStyle;
29
- }> & Readonly<{}>, {}, {}, {}, {}, string, vue71.ComponentProvideOptions, false, {}, any>;
30
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
31
- declare const _default: typeof __VLS_export;
32
- type __VLS_WithSlots<T, S> = T & {
33
- new (): {
34
- $slots: S;
35
- };
36
- };
37
- //#endregion
38
- export { _default };
@@ -1,17 +0,0 @@
1
- import { ClassStyle } from "../data-table-plus/index.js";
2
- import { _default } from "./FullLoading.vue.js";
3
- import { CSSProperties, RendererElement } from "vue";
4
- import { SpinProps } from "naive-ui";
5
-
6
- //#region src/components/full-loading/index.d.ts
7
- type FullLoadingProps = {
8
- show?: boolean;
9
- appendTo?: string | RendererElement;
10
- mask?: boolean | CSSProperties;
11
- blur?: boolean;
12
- disableScroll?: boolean;
13
- scrollSelector?: string | HTMLElement;
14
- spinProps?: Omit<SpinProps, 'show'> & ClassStyle;
15
- };
16
- //#endregion
17
- export { FullLoadingProps };