@oiij/naive-ui 0.0.64 → 0.0.66

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 (87) hide show
  1. package/dist/_virtual/_/plugin-vue/export-helper.js +9 -0
  2. package/dist/components/_utils/cssr-bem.js +7 -0
  3. package/dist/components/_utils/prismjs.js +16 -0
  4. package/dist/components/bubble/Bubble.js +67 -0
  5. package/dist/components/bubble/Bubble.vue.d.ts +51 -46
  6. package/dist/components/bubble/bubble.cssr.js +23 -0
  7. package/dist/components/bubble/index.d.ts +19 -15
  8. package/dist/components/config-providers/ConfigProviders.js +78 -0
  9. package/dist/components/config-providers/ConfigProviders.vue.d.ts +37 -33
  10. package/dist/components/config-providers/index.d.ts +28 -24
  11. package/dist/components/copy-button/CopyButton.js +50 -0
  12. package/dist/components/copy-button/CopyButton.vue.d.ts +36 -30
  13. package/dist/components/copy-button/index.d.ts +13 -9
  14. package/dist/components/data-table-plus/DataTablePlus.js +374 -0
  15. package/dist/components/data-table-plus/DataTablePlus.vue.d.ts +365 -351
  16. package/dist/components/data-table-plus/index.d.ts +54 -48
  17. package/dist/components/full-loading/FullLoading.js +70 -0
  18. package/dist/components/full-loading/FullLoading.vue.d.ts +36 -32
  19. package/dist/components/full-loading/full-loading.cssr.js +22 -0
  20. package/dist/components/full-loading/index.d.ts +16 -12
  21. package/dist/components/icons/MageArrowUp.js +29 -0
  22. package/dist/components/icons/MageCopyFill.js +21 -0
  23. package/dist/components/icons/MageMultiplyCircleFill.js +21 -0
  24. package/dist/components/icons/MageSearch.js +25 -0
  25. package/dist/components/index.d.ts +31 -15
  26. package/dist/components/preset-form/PresetForm.js +176 -0
  27. package/dist/components/preset-form/PresetForm.vue.d.ts +82 -72
  28. package/dist/components/preset-form/_utils.js +16 -0
  29. package/dist/components/preset-form/index.d.ts +34 -29
  30. package/dist/components/preset-input/PresetInput.js +87 -0
  31. package/dist/components/preset-input/PresetInput.vue.d.ts +20 -15
  32. package/dist/components/preset-input/index.d.ts +147 -145
  33. package/dist/components/preset-picker/PresetPicker.js +213 -0
  34. package/dist/components/preset-picker/PresetPicker.vue.d.ts +62 -49
  35. package/dist/components/preset-picker/index.d.ts +56 -49
  36. package/dist/components/preset-select/PresetSelect.js +274 -0
  37. package/dist/components/preset-select/PresetSelect.vue.d.ts +190 -180
  38. package/dist/components/preset-select/index.d.ts +44 -38
  39. package/dist/components/remote-request/RemoteRequest.js +90 -0
  40. package/dist/components/remote-request/RemoteRequest.vue.d.ts +55 -49
  41. package/dist/components/remote-request/index.d.ts +23 -17
  42. package/dist/components/search-input/SearchInput.js +85 -0
  43. package/dist/components/search-input/SearchInput.vue.d.ts +48 -2332
  44. package/dist/components/search-input/index.d.ts +16 -12
  45. package/dist/components/toggle-input/ToggleInput.js +64 -0
  46. package/dist/components/toggle-input/ToggleInput.vue.d.ts +46 -0
  47. package/dist/components/toggle-input/index.d.ts +1 -0
  48. package/dist/components/tooltip-button/TooltipButton.js +31 -0
  49. package/dist/components/tooltip-button/TooltipButton.vue.d.ts +33 -28
  50. package/dist/components/tooltip-button/index.d.ts +11 -7
  51. package/dist/components/transition/BaseTransition.js +30 -0
  52. package/dist/components/transition/BaseTransition.vue.d.ts +23 -21
  53. package/dist/components/transition/index.d.ts +10 -6
  54. package/dist/components/transition/transition.cssr.js +20 -0
  55. package/dist/components/type-writer/TypeWriter.js +72 -0
  56. package/dist/components/type-writer/TypeWriter.vue.d.ts +34 -29
  57. package/dist/components/type-writer/index.d.ts +12 -8
  58. package/dist/components/type-writer/type-writer.cssr.js +27 -0
  59. package/dist/components.d.ts +33 -1
  60. package/dist/components.js +17 -7893
  61. package/dist/composables/{index.d.mts → index.d.ts} +3 -3
  62. package/dist/composables/{useNaiveForm.d.mts → useNaiveForm.d.ts} +1 -1
  63. package/dist/composables/{useNaiveTheme.d.mts → useNaiveTheme.d.ts} +1 -1
  64. package/dist/composables/{useNaiveTheme.mjs → useNaiveTheme.js} +1 -1
  65. package/dist/{index.d.mts → index.d.ts} +4 -4
  66. package/dist/index.js +5 -0
  67. package/package.json +14 -13
  68. package/dist/components/_utils/cssr-bem.d.ts +0 -1
  69. package/dist/components/_utils/index.d.ts +0 -2
  70. package/dist/components/_utils/prismjs.d.ts +0 -1
  71. package/dist/components/bubble/bubble.cssr.d.ts +0 -2
  72. package/dist/components/full-loading/full-loading.cssr.d.ts +0 -2
  73. package/dist/components/icons/MageArrowUp.vue.d.ts +0 -2
  74. package/dist/components/icons/MageCopyFill.vue.d.ts +0 -2
  75. package/dist/components/icons/MageMultiplyCircleFill.vue.d.ts +0 -2
  76. package/dist/components/icons/MageSearch.vue.d.ts +0 -2
  77. package/dist/components/preset-form/_utils.d.ts +0 -8
  78. package/dist/components/toggle-editor/ToggleEditor.vue.d.ts +0 -1159
  79. package/dist/components/toggle-editor/index.d.ts +0 -1
  80. package/dist/components/transition/transition.cssr.d.ts +0 -13
  81. package/dist/components/type-writer/type-writer.cssr.d.ts +0 -2
  82. package/dist/index.mjs +0 -5
  83. /package/dist/composables/{_helper.d.mts → _helper.d.ts} +0 -0
  84. /package/dist/composables/{_helper.mjs → _helper.js} +0 -0
  85. /package/dist/composables/{useDataRequest.d.mts → useDataRequest.d.ts} +0 -0
  86. /package/dist/composables/{useDataRequest.mjs → useDataRequest.js} +0 -0
  87. /package/dist/composables/{useNaiveForm.mjs → useNaiveForm.js} +0 -0
@@ -1,53 +1,59 @@
1
- import { ButtonProps, DataTableColumns, DataTableFilterState, DataTableInst, DataTableProps, DataTableSortState, PaginationProps } from 'naive-ui';
2
- import { FilterState, TableBaseColumn } from 'naive-ui/es/data-table/src/interface';
3
- import { CSSProperties, Ref, ShallowRef } from 'vue';
4
- import { DataObject, DataRequestFields, UseDataRequestReturns } from '../../composables/useDataRequest';
5
- import { RemoteRequestEmits, RemoteRequestProps } from '../remote-request/index';
6
- import { SearchInputProps } from '../search-input/index';
7
- export { default as NDataTablePlus } from './DataTablePlus.vue';
8
- export type ClassStyle = {
9
- class?: string;
10
- style?: CSSProperties | string;
1
+ import { DataObject, DataRequestFields, UseDataRequestReturns } from "../../composables/useDataRequest.js";
2
+ import { RemoteRequestEmits, RemoteRequestProps } from "../remote-request/index.js";
3
+ import { SearchInputProps } from "../search-input/index.js";
4
+ import { _default } from "./DataTablePlus.vue.js";
5
+ import { CSSProperties, Ref, ShallowRef } from "vue";
6
+ import { ButtonProps, DataTableColumns, DataTableFilterState, DataTableInst, DataTableProps, DataTableSortState, PaginationProps } from "naive-ui";
7
+ import { ComponentExposed } from "vue-component-type-helpers";
8
+ import { FilterState, TableBaseColumn } from "naive-ui/es/data-table/src/interface";
9
+
10
+ //#region src/components/data-table-plus/index.d.ts
11
+ type ClassStyle = {
12
+ class?: string;
13
+ style?: CSSProperties | string;
11
14
  };
12
- export type DataTablePlusExpose<P extends DataObject = DataObject, D extends DataObject = DataObject, R extends DataObject = DataObject> = UseDataRequestReturns<P, D, R> & {
13
- filters: Ref<DataTableFilterState | undefined>;
14
- sorters: Ref<Record<string, DataTableSortState> | undefined>;
15
- dataTableRef: Readonly<ShallowRef<DataTableInst | null>>;
15
+ type DataTablePlusExpose<P extends DataObject = DataObject, D extends DataObject = DataObject, R extends DataObject = DataObject> = UseDataRequestReturns<P, D, R> & {
16
+ filters: Ref<DataTableFilterState | undefined>;
17
+ sorters: Ref<Record<string, DataTableSortState> | undefined>;
18
+ dataTableRef: Readonly<ShallowRef<DataTableInst | null>>;
16
19
  };
17
- export type DataTablePlusFields = DataRequestFields & {
18
- filter?: string;
19
- sorter?: string;
20
- rowKey?: string;
21
- search?: string;
22
- children?: string;
20
+ type DataTablePlusFields = DataRequestFields & {
21
+ filter?: string;
22
+ sorter?: string;
23
+ rowKey?: string;
24
+ search?: string;
25
+ children?: string;
23
26
  };
24
- export type DataTablePlusProps<P extends DataObject = DataObject, D extends DataObject = DataObject, R extends DataObject = DataObject> = RemoteRequestProps<P, D> & {
25
- title?: string;
26
- scrollTop?: number | boolean | {
27
- top?: number;
28
- buttonProps?: ButtonProps & ClassStyle;
29
- };
30
- columns?: DataTableColumns<R>;
31
- fields?: DataTablePlusFields;
32
- search?: SearchInputProps & ClassStyle | boolean;
33
- pagination?: Omit<PaginationProps, 'page' | 'pageSize' | 'itemCount'> & ClassStyle | boolean;
34
- columnsFilterOptions?: (filters: DataTableFilterState) => Record<string, any>;
35
- columnsSorterOptions?: (sorters: Record<string, DataTableSortState>) => Record<string, any>;
36
- dataTableProps?: DataTableProps & ClassStyle;
27
+ type DataTablePlusProps<P extends DataObject = DataObject, D extends DataObject = DataObject, R extends DataObject = DataObject> = RemoteRequestProps<P, D> & {
28
+ title?: string;
29
+ scrollTop?: number | boolean | {
30
+ top?: number;
31
+ buttonProps?: ButtonProps & ClassStyle;
32
+ };
33
+ columns?: DataTableColumns<R>;
34
+ fields?: DataTablePlusFields;
35
+ search?: SearchInputProps & ClassStyle | boolean;
36
+ pagination?: Omit<PaginationProps, 'page' | 'pageSize' | 'itemCount'> & ClassStyle | boolean;
37
+ columnsFilterOptions?: (filters: DataTableFilterState) => Record<string, any>;
38
+ columnsSorterOptions?: (sorters: Record<string, DataTableSortState>) => Record<string, any>;
39
+ dataTableProps?: DataTableProps & ClassStyle;
37
40
  };
38
- export type DataTablePlusEmits<P extends DataObject = DataObject, D extends DataObject = DataObject, R extends DataObject = DataObject> = RemoteRequestEmits<P, D> & {
39
- (e: 'clickRow', row: R, index: number, event: MouseEvent, currentData: R[]): void;
40
- (e: 'contextMenuRow', row: R, index: number, event: MouseEvent, currentData: R[]): void;
41
- (e: 'load', row: R): Promise<void>;
42
- (e: 'scroll', ev: Event): void;
43
- (e: 'scrollBottom', ev: Event): void;
44
- (e: 'update:checkedRowKeys', keys: (string | number)[], rows: (R | undefined)[], meta: {
45
- row: R | undefined;
46
- action: 'check' | 'uncheck' | 'checkAll' | 'uncheckAll';
47
- }, currentData: R[]): void;
48
- (e: 'update:expandedRowKeys', keys: (string | number)[], currentData: R[]): void;
49
- (e: 'update:filters', filterState: FilterState, sourceColumn: TableBaseColumn): void;
50
- (e: 'update:sorter', options: DataTableSortState | DataTableSortState[] | null): void;
51
- (e: 'update:page', page: number): void;
52
- (e: 'update:pageSize', pageSize: number): void;
41
+ type DataTablePlusEmits<P extends DataObject = DataObject, D extends DataObject = DataObject, R extends DataObject = DataObject> = RemoteRequestEmits<P, D> & {
42
+ (e: 'clickRow', row: R, index: number, event: MouseEvent, currentData: R[]): void;
43
+ (e: 'contextMenuRow', row: R, index: number, event: MouseEvent, currentData: R[]): void;
44
+ (e: 'load', row: R): Promise<void>;
45
+ (e: 'scroll', ev: Event): void;
46
+ (e: 'scrollBottom', ev: Event): void;
47
+ (e: 'update:checkedRowKeys', keys: (string | number)[], rows: (R | undefined)[], meta: {
48
+ row: R | undefined;
49
+ action: 'check' | 'uncheck' | 'checkAll' | 'uncheckAll';
50
+ }, currentData: R[]): void;
51
+ (e: 'update:expandedRowKeys', keys: (string | number)[], currentData: R[]): void;
52
+ (e: 'update:filters', filterState: FilterState, sourceColumn: TableBaseColumn): void;
53
+ (e: 'update:sorter', options: DataTableSortState | DataTableSortState[] | null): void;
54
+ (e: 'update:page', page: number): void;
55
+ (e: 'update:pageSize', pageSize: number): void;
53
56
  };
57
+ type DataTablePlusInst = ComponentExposed<typeof _default>;
58
+ //#endregion
59
+ export { ClassStyle, DataTablePlusEmits, DataTablePlusExpose, DataTablePlusFields, DataTablePlusInst, DataTablePlusProps };
@@ -0,0 +1,70 @@
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,34 +1,38 @@
1
- declare function __VLS_template(): {
2
- attrs: Partial<{}>;
3
- slots: {
4
- description?(_: {}): any;
5
- icon?(_: {}): any;
6
- };
7
- refs: {};
8
- rootEl: any;
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;
9
12
  };
10
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
11
- declare const __VLS_component: import('vue').DefineComponent<{
12
- show?: boolean;
13
- appendTo?: string | import('vue').RendererElement;
14
- mask?: boolean | import('vue').CSSProperties;
15
- blur?: boolean;
16
- disableScroll?: boolean;
17
- scrollSelector?: string | HTMLElement;
18
- spinProps?: Omit<import('naive-ui').SpinProps, "show"> & import('..').ClassStyle;
19
- }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
20
- show?: boolean;
21
- appendTo?: string | import('vue').RendererElement;
22
- mask?: boolean | import('vue').CSSProperties;
23
- blur?: boolean;
24
- disableScroll?: boolean;
25
- scrollSelector?: string | HTMLElement;
26
- spinProps?: Omit<import('naive-ui').SpinProps, "show"> & import('..').ClassStyle;
27
- }> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
28
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
29
- export default _default;
30
- type __VLS_WithTemplateSlots<T, S> = T & {
31
- new (): {
32
- $slots: S;
33
- };
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
+ };
34
36
  };
37
+ //#endregion
38
+ export { _default };
@@ -0,0 +1,22 @@
1
+ import { cssr, namespace, plugin } from "../_utils/cssr-bem.js";
2
+ import { cM } from "naive-ui";
3
+
4
+ //#region src/components/full-loading/full-loading.cssr.ts
5
+ const { c, cB } = {
6
+ ...cssr,
7
+ ...plugin
8
+ };
9
+ const cName = `${namespace}-full-loading`;
10
+ function fullLoadingCssr() {
11
+ return c([cB("full-loading", {
12
+ position: "fixed",
13
+ inset: 0,
14
+ zIndex: 99,
15
+ display: "flex",
16
+ alignItems: "center",
17
+ justifyContent: "center"
18
+ }, [cM("mask", { background: "rgba(0,0,0,.3)" }), cM("blur", { backdropFilter: "blur(10px)" })])]);
19
+ }
20
+
21
+ //#endregion
22
+ export { cName, fullLoadingCssr };
@@ -1,13 +1,17 @@
1
- import { SpinProps } from 'naive-ui';
2
- import { CSSProperties, RendererElement } from 'vue';
3
- import { ClassStyle } from '../data-table-plus';
4
- export { default as NFullLoading } from './FullLoading.vue';
5
- export type FullLoadingProps = {
6
- show?: boolean;
7
- appendTo?: string | RendererElement;
8
- mask?: boolean | CSSProperties;
9
- blur?: boolean;
10
- disableScroll?: boolean;
11
- scrollSelector?: string | HTMLElement;
12
- spinProps?: Omit<SpinProps, 'show'> & ClassStyle;
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;
13
15
  };
16
+ //#endregion
17
+ export { FullLoadingProps };
@@ -0,0 +1,29 @@
1
+ import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.js";
2
+ import { createCommentVNode, createElementBlock, createElementVNode, openBlock } from "vue";
3
+
4
+ //#region src/components/icons/MageArrowUp.vue
5
+ const _sfc_main = { name: "MageArrowUp" };
6
+ const _hoisted_1 = {
7
+ xmlns: "http://www.w3.org/2000/svg",
8
+ width: "1em",
9
+ height: "1em",
10
+ viewBox: "0 0 24 24"
11
+ };
12
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
13
+ return openBlock(), createElementBlock("svg", _hoisted_1, [createCommentVNode(" Icon from Mage Icons by MageIcons - https://github.com/Mage-Icons/mage-icons/blob/main/License.txt "), _cache[0] || (_cache[0] = createElementVNode("g", {
14
+ fill: "none",
15
+ stroke: "#757575",
16
+ "stroke-linecap": "round",
17
+ "stroke-width": "1.5"
18
+ }, [createElementVNode("path", {
19
+ "stroke-miterlimit": "10",
20
+ d: "M12 4v16"
21
+ }), createElementVNode("path", {
22
+ "stroke-linejoin": "round",
23
+ d: "M19.66 11.033L13.089 4.46a1.53 1.53 0 0 0-2.176 0L4.34 11.033"
24
+ })], -1))]);
25
+ }
26
+ var MageArrowUp_default = /* @__PURE__ */ export_helper_default(_sfc_main, [["render", _sfc_render]]);
27
+
28
+ //#endregion
29
+ export { MageArrowUp_default as default };
@@ -0,0 +1,21 @@
1
+ import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.js";
2
+ import { createCommentVNode, createElementBlock, createElementVNode, openBlock } from "vue";
3
+
4
+ //#region src/components/icons/MageCopyFill.vue
5
+ const _sfc_main = { name: "MageCopyFill" };
6
+ const _hoisted_1 = {
7
+ xmlns: "http://www.w3.org/2000/svg",
8
+ width: "1em",
9
+ height: "1em",
10
+ viewBox: "0 0 24 24"
11
+ };
12
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
13
+ return openBlock(), createElementBlock("svg", _hoisted_1, [createCommentVNode(" Icon from Mage Icons by MageIcons - https://github.com/Mage-Icons/mage-icons/blob/main/License.txt "), _cache[0] || (_cache[0] = createElementVNode("path", {
14
+ fill: "currentColor",
15
+ d: "M18.355 6.54h-1.94V4.69a2.69 2.69 0 0 0-1.646-2.484A2.7 2.7 0 0 0 13.745 2h-8.05a2.68 2.68 0 0 0-2.67 2.69v10.09a2.68 2.68 0 0 0 2.67 2.69h1.94v1.85a2.68 2.68 0 0 0 2.67 2.68h8a2.68 2.68 0 0 0 2.67-2.68V9.23a2.69 2.69 0 0 0-2.62-2.69M7.635 9.23v6.74h-1.94a1.18 1.18 0 0 1-1.17-1.19V4.69a1.18 1.18 0 0 1 1.17-1.19h8.05a1.18 1.18 0 0 1 1.17 1.19v1.85h-4.61a2.69 2.69 0 0 0-2.67 2.69"
16
+ }, null, -1))]);
17
+ }
18
+ var MageCopyFill_default = /* @__PURE__ */ export_helper_default(_sfc_main, [["render", _sfc_render]]);
19
+
20
+ //#endregion
21
+ export { MageCopyFill_default as default };
@@ -0,0 +1,21 @@
1
+ import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.js";
2
+ import { createCommentVNode, createElementBlock, createElementVNode, openBlock } from "vue";
3
+
4
+ //#region src/components/icons/MageMultiplyCircleFill.vue
5
+ const _sfc_main = { name: "MageMultiplyCircleFill" };
6
+ const _hoisted_1 = {
7
+ xmlns: "http://www.w3.org/2000/svg",
8
+ width: "1em",
9
+ height: "1em",
10
+ viewBox: "0 0 24 24"
11
+ };
12
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
13
+ return openBlock(), createElementBlock("svg", _hoisted_1, [createCommentVNode(" Icon from Mage Icons by MageIcons - https://github.com/Mage-Icons/mage-icons/blob/main/License.txt "), _cache[0] || (_cache[0] = createElementVNode("path", {
14
+ fill: "currentColor",
15
+ d: "M12 1.75A10.25 10.25 0 1 0 22.25 12A10.26 10.26 0 0 0 12 1.75m4.67 13.5a1 1 0 0 1 0 1.42a1 1 0 0 1-1.42 0L12 13.42l-3.25 3.25a1 1 0 0 1-1.41-1.42L10.59 12L7.34 8.75a1 1 0 1 1 1.41-1.41L12 10.59l3.25-3.25a1 1 0 1 1 1.42 1.41L13.42 12z"
16
+ }, null, -1))]);
17
+ }
18
+ var MageMultiplyCircleFill_default = /* @__PURE__ */ export_helper_default(_sfc_main, [["render", _sfc_render]]);
19
+
20
+ //#endregion
21
+ export { MageMultiplyCircleFill_default as default };
@@ -0,0 +1,25 @@
1
+ import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.js";
2
+ import { createCommentVNode, createElementBlock, createElementVNode, openBlock } from "vue";
3
+
4
+ //#region src/components/icons/MageSearch.vue
5
+ const _sfc_main = { name: "MageSearch" };
6
+ const _hoisted_1 = {
7
+ xmlns: "http://www.w3.org/2000/svg",
8
+ width: "1em",
9
+ height: "1em",
10
+ viewBox: "0 0 24 24"
11
+ };
12
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
13
+ return openBlock(), createElementBlock("svg", _hoisted_1, [createCommentVNode(" Icon from Mage Icons by MageIcons - https://github.com/Mage-Icons/mage-icons/blob/main/License.txt "), _cache[0] || (_cache[0] = createElementVNode("path", {
14
+ fill: "none",
15
+ stroke: "currentColor",
16
+ "stroke-linecap": "round",
17
+ "stroke-linejoin": "round",
18
+ "stroke-width": "1.5",
19
+ d: "M10.783 18.828a8.05 8.05 0 0 0 7.439-4.955a8.03 8.03 0 0 0-1.737-8.765a8.045 8.045 0 0 0-13.735 5.68c0 2.131.846 4.174 2.352 5.681a8.05 8.05 0 0 0 5.68 2.359m5.706-2.337l4.762 4.759"
20
+ }, null, -1))]);
21
+ }
22
+ var MageSearch_default = /* @__PURE__ */ export_helper_default(_sfc_main, [["render", _sfc_render]]);
23
+
24
+ //#endregion
25
+ export { MageSearch_default as default };
@@ -1,15 +1,31 @@
1
- export * from './bubble';
2
- export * from './config-providers';
3
- export * from './copy-button';
4
- export * from './data-table-plus';
5
- export * from './full-loading';
6
- export * from './preset-form';
7
- export * from './preset-input';
8
- export * from './preset-picker';
9
- export * from './preset-select';
10
- export * from './remote-request';
11
- export * from './search-input';
12
- export * from './toggle-editor';
13
- export * from './tooltip-button';
14
- export * from './transition';
15
- export * from './type-writer';
1
+ import { _default } from "./bubble/Bubble.vue.js";
2
+ import { BubbleProps } from "./bubble/index.js";
3
+ import { _default as _default$1 } from "./remote-request/RemoteRequest.vue.js";
4
+ import { RemoteRequestEmits, RemoteRequestExpose, RemoteRequestFields, RemoteRequestInst, RemoteRequestProps } from "./remote-request/index.js";
5
+ import { _default as _default$2 } from "./search-input/SearchInput.vue.js";
6
+ import { SearchInputProps } from "./search-input/index.js";
7
+ import { NaiveFormRules } from "../composables/useNaiveForm.js";
8
+ import { _default as _default$3 } from "./data-table-plus/DataTablePlus.vue.js";
9
+ import { ClassStyle, DataTablePlusEmits, DataTablePlusExpose, DataTablePlusFields, DataTablePlusInst, DataTablePlusProps } from "./data-table-plus/index.js";
10
+ import { _default as _default$4 } from "./full-loading/FullLoading.vue.js";
11
+ import { FullLoadingProps } from "./full-loading/index.js";
12
+ import { _default as _default$5 } from "./config-providers/ConfigProviders.vue.js";
13
+ import { ConfigProvidersProps, LoadingIns } from "./config-providers/index.js";
14
+ import { _default as _default$6 } from "./copy-button/CopyButton.vue.js";
15
+ import { CopyButtonProps } from "./copy-button/index.js";
16
+ import { _default as _default$7 } from "./preset-input/PresetInput.vue.js";
17
+ import { PresetInputOptions, PresetInputProps, PresetInputType } from "./preset-input/index.js";
18
+ import { _default as _default$8 } from "./preset-form/PresetForm.vue.js";
19
+ import { PresetFormExpose, PresetFormInst, PresetFormOptionItem, PresetFormOptions, PresetFormProps } from "./preset-form/index.js";
20
+ import { _default as _default$9 } from "./preset-picker/PresetPicker.vue.js";
21
+ import { PresetPickerEmits, PresetPickerExpose, PresetPickerInst, PresetPickerProps, PresetPickerValue } from "./preset-picker/index.js";
22
+ import { _default as _default$10 } from "./preset-select/PresetSelect.vue.js";
23
+ import { ArrayAwareType, OptionFormat, PresetSelectEmits, PresetSelectExpose, PresetSelectFields, PresetSelectInst, PresetSelectProps, PresetSelectValue } from "./preset-select/index.js";
24
+ import { _default as _default$11 } from "./toggle-input/ToggleInput.vue.js";
25
+ import "./toggle-input/index.js";
26
+ import { _default as _default$12 } from "./tooltip-button/TooltipButton.vue.js";
27
+ import { TooltipButtonProps } from "./tooltip-button/index.js";
28
+ import { _default as _default$13 } from "./transition/BaseTransition.vue.js";
29
+ import { TransitionProps } from "./transition/index.js";
30
+ import { _default as _default$14 } from "./type-writer/TypeWriter.vue.js";
31
+ import { TypeWriterProps } from "./type-writer/index.js";
@@ -0,0 +1,176 @@
1
+ import { useNaiveForm } from "../../composables/useNaiveForm.js";
2
+ import PresetInput_default from "../preset-input/PresetInput.js";
3
+ import { mergeRule } from "./_utils.js";
4
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, toValue, unref, useTemplateRef, withCtx } from "vue";
5
+ import { NButton, NCollapseTransition, NDivider, NForm, NFormItem, NGi, NGrid } from "naive-ui";
6
+
7
+ //#region src/components/preset-form/PresetForm.vue
8
+ const _sfc_main = /* @__PURE__ */ defineComponent({
9
+ __name: "PresetForm",
10
+ props: {
11
+ options: {},
12
+ values: {},
13
+ rules: {},
14
+ clearRules: {},
15
+ formProps: {},
16
+ gridProps: {}
17
+ },
18
+ emits: ["validated"],
19
+ setup(__props, { expose: __expose, emit: __emit }) {
20
+ const emit = __emit;
21
+ const { formValue, formRules, formRef, formProps: _formProps, setValue, validate, resetValidation, resetForm, reset, clear, onValidated } = useNaiveForm(useTemplateRef("form-ref"), __props.values, {
22
+ rules: __props.rules,
23
+ clearRules: __props.clearRules
24
+ });
25
+ onValidated((value) => {
26
+ emit("validated", value);
27
+ });
28
+ const filterCollapsed = ref(false);
29
+ const _options = computed(() => {
30
+ return __props.options?.filter((f) => typeof f.hidden === "function" ? !f.hidden() : !f.hidden).filter((f) => typeof f.collapsed === "function" ? !f.collapsed() : !f.collapsed);
31
+ });
32
+ const _collapsedOptions = computed(() => {
33
+ return __props.options?.filter((f) => typeof f.hidden === "function" ? !f.hidden() : !f.hidden).filter((f) => typeof f.collapsed === "function" ? !f.collapsed() : f.collapsed);
34
+ });
35
+ function onPresetInputUpdate(val, key) {
36
+ if (key) setValue({ [key]: val });
37
+ }
38
+ const expose = {
39
+ formRef,
40
+ formValue,
41
+ formRules,
42
+ formProps: _formProps,
43
+ setValue,
44
+ validate,
45
+ resetValidation,
46
+ resetForm,
47
+ reset,
48
+ clear,
49
+ onValidated
50
+ };
51
+ const templateBind = computed(() => {
52
+ return {
53
+ ...expose,
54
+ formRef: toValue(formRef),
55
+ formValue: toValue(formValue),
56
+ formRules: toValue(formRules),
57
+ formProps: toValue(_formProps)
58
+ };
59
+ });
60
+ __expose(expose);
61
+ return (_ctx, _cache) => {
62
+ return openBlock(), createBlock(unref(NForm), mergeProps({
63
+ ref: "form-ref",
64
+ model: unref(formValue),
65
+ rules: unref(formRules)
66
+ }, __props.formProps), {
67
+ default: withCtx(() => [
68
+ renderSlot(_ctx.$slots, "header", normalizeProps(guardReactiveProps(templateBind.value))),
69
+ renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(templateBind.value)), () => [_options.value && _options.value.length > 0 ? (openBlock(), createBlock(unref(NGrid), normalizeProps(mergeProps({ key: 0 }, __props.gridProps)), {
70
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_options.value, ({ key, label, required, span, rule, itemProps: { offset, span: _span, suffix, ..._itemProps } = {}, render, ...opt }, _index) => {
71
+ return openBlock(), createBlock(unref(NGi), mergeProps({
72
+ key: _index,
73
+ span: typeof span === "function" ? span() : span ?? _span
74
+ }, { ref_for: true }, {
75
+ offset,
76
+ suffix
77
+ }), {
78
+ default: withCtx(({ overflow }) => [createVNode(unref(NFormItem), mergeProps({
79
+ label: typeof label === "function" ? label() : label,
80
+ path: typeof key === "string" ? key : void 0,
81
+ rule: unref(mergeRule)({
82
+ key,
83
+ label,
84
+ required,
85
+ rule
86
+ })
87
+ }, { ref_for: true }, _itemProps), {
88
+ default: withCtx(() => [render ? (openBlock(), createBlock(resolveDynamicComponent(render({
89
+ ...expose,
90
+ overflow
91
+ })), { key: 0 })) : (openBlock(), createBlock(unref(PresetInput_default), {
92
+ key: 1,
93
+ options: opt,
94
+ value: key ? unref(formValue)[key] : void 0,
95
+ "onUpdate:value": (val) => onPresetInputUpdate(val, key)
96
+ }, null, 8, [
97
+ "options",
98
+ "value",
99
+ "onUpdate:value"
100
+ ]))]),
101
+ _: 2
102
+ }, 1040, [
103
+ "label",
104
+ "path",
105
+ "rule"
106
+ ])]),
107
+ _: 2
108
+ }, 1040, ["span"]);
109
+ }), 128))]),
110
+ _: 1
111
+ }, 16)) : createCommentVNode("v-if", true), _collapsedOptions.value && _collapsedOptions.value.length > 0 ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createVNode(unref(NDivider), { style: { margin: "5px 0" } }, {
112
+ default: withCtx(() => [createVNode(unref(NButton), {
113
+ size: "tiny",
114
+ onClick: _cache[0] || (_cache[0] = ($event) => filterCollapsed.value = !filterCollapsed.value)
115
+ }, {
116
+ default: withCtx(() => [createTextVNode(toDisplayString(filterCollapsed.value ? "折叠" : "展开"), 1)]),
117
+ _: 1
118
+ })]),
119
+ _: 1
120
+ }), createVNode(unref(NCollapseTransition), { show: filterCollapsed.value }, {
121
+ default: withCtx(() => [createVNode(unref(NGrid), normalizeProps(guardReactiveProps(__props.gridProps)), {
122
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_collapsedOptions.value, ({ key, label, required, span, rule, itemProps: { offset, span: _span, suffix, ..._itemProps } = {}, render, ...opt }, _index) => {
123
+ return openBlock(), createBlock(unref(NGi), mergeProps({
124
+ key: _index,
125
+ span: typeof span === "function" ? span() : span ?? _span
126
+ }, { ref_for: true }, {
127
+ offset,
128
+ suffix
129
+ }), {
130
+ default: withCtx(({ overflow }) => [createVNode(unref(NFormItem), mergeProps({
131
+ label: typeof label === "function" ? label() : label,
132
+ path: typeof key === "string" ? key : void 0,
133
+ rule: unref(mergeRule)({
134
+ key,
135
+ label,
136
+ required,
137
+ rule
138
+ })
139
+ }, { ref_for: true }, _itemProps), {
140
+ default: withCtx(() => [render ? (openBlock(), createBlock(resolveDynamicComponent(render({
141
+ ...expose,
142
+ overflow
143
+ })), { key: 0 })) : (openBlock(), createBlock(unref(PresetInput_default), {
144
+ key: 1,
145
+ options: opt,
146
+ value: key ? unref(formValue)[key] : void 0,
147
+ "onUpdate:value": (val) => onPresetInputUpdate(val, key)
148
+ }, null, 8, [
149
+ "options",
150
+ "value",
151
+ "onUpdate:value"
152
+ ]))]),
153
+ _: 2
154
+ }, 1040, [
155
+ "label",
156
+ "path",
157
+ "rule"
158
+ ])]),
159
+ _: 2
160
+ }, 1040, ["span"]);
161
+ }), 128))]),
162
+ _: 1
163
+ }, 16)]),
164
+ _: 1
165
+ }, 8, ["show"])], 64)) : createCommentVNode("v-if", true)]),
166
+ renderSlot(_ctx.$slots, "footer", normalizeProps(guardReactiveProps(templateBind.value)))
167
+ ]),
168
+ _: 3
169
+ }, 16, ["model", "rules"]);
170
+ };
171
+ }
172
+ });
173
+ var PresetForm_default = _sfc_main;
174
+
175
+ //#endregion
176
+ export { PresetForm_default as default };