@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,148 +1,150 @@
1
- import { ButtonProps, CheckboxGroupProps, CheckboxProps, ColorPickerProps, DatePickerProps, DividerProps, DynamicTagsProps, InputNumberProps, InputProps, RadioGroupProps, RadioProps, RateProps, SelectProps, SliderProps, SwitchProps, TimePickerProps } from 'naive-ui';
2
- import { VNode, VNodeArrayChildren } from 'vue';
3
- import { ClassStyle } from '../data-table-plus/index';
4
- import { SearchInputProps } from '../search-input/index';
5
- export { default as NPresetInput } from './PresetInput.vue';
1
+ import { SearchInputProps } from "../search-input/index.js";
2
+ import { ClassStyle } from "../data-table-plus/index.js";
3
+ import { _default } from "./PresetInput.vue.js";
4
+ import { VNode, VNodeArrayChildren } from "vue";
5
+ import { ButtonProps, CheckboxGroupProps, CheckboxProps, ColorPickerProps, DatePickerProps, DividerProps, DynamicTagsProps, InputNumberProps, InputProps, RadioGroupProps, RadioProps, RateProps, SelectProps, SliderProps, SwitchProps, TimePickerProps } from "naive-ui";
6
+
7
+ //#region src/components/preset-input/index.d.ts
6
8
  type RawChildren = string | number | boolean | VNode | VNodeArrayChildren | (() => any);
7
- export type PresetInputType = {
8
- 'button': {
9
- props?: ButtonProps & {
10
- label?: string;
11
- };
12
- slots?: {
13
- default?: () => RawChildren;
14
- icon?: () => RawChildren;
15
- };
16
- };
17
- 'color-picker': {
18
- props?: ColorPickerProps;
19
- slots?: {
20
- label?: (color: string | null) => RawChildren;
21
- action?: () => RawChildren;
22
- };
23
- };
24
- 'checkbox': {
25
- props?: CheckboxGroupProps & {
26
- options?: CheckboxProps[];
27
- };
28
- slots?: {
29
- default?: () => RawChildren;
30
- };
31
- };
32
- 'divider': {
33
- props?: DividerProps;
34
- slots?: {
35
- default?: () => RawChildren;
36
- };
37
- };
38
- 'date-picker': {
39
- props?: DatePickerProps;
40
- slots?: undefined;
41
- };
42
- 'dynamic-tags': {
43
- props?: DynamicTagsProps;
44
- slots?: {
45
- input?: (info: {
46
- submit: (value: any) => void;
47
- deactivate: () => void;
48
- }) => RawChildren;
49
- trigger?: (info: {
50
- activate: () => void;
51
- disabled: boolean;
52
- }) => RawChildren;
53
- };
54
- };
55
- 'input': {
56
- props?: InputProps;
57
- slots?: {
58
- clearIcon?: () => RawChildren;
59
- count?: (props: {
60
- value: string;
61
- }) => RawChildren;
62
- passwordInvisibleIcon?: () => RawChildren;
63
- passwordVisibleIcon?: () => RawChildren;
64
- prefix?: () => RawChildren;
65
- separator?: () => RawChildren;
66
- suffix?: () => RawChildren;
67
- };
68
- };
69
- 'input-number': {
70
- props?: InputNumberProps;
71
- slots?: {
72
- addIcon?: () => RawChildren;
73
- minusIcon?: () => RawChildren;
74
- prefix?: () => RawChildren;
75
- suffix?: () => RawChildren;
76
- };
77
- };
78
- 'search': {
79
- props?: SearchInputProps;
80
- slots?: {
81
- prefix?: () => RawChildren;
82
- prefixIcon?: () => RawChildren;
83
- button?: (props: {
84
- value: string;
85
- loading: boolean;
86
- }) => RawChildren;
87
- buttonIcon?: () => RawChildren;
88
- };
89
- };
90
- 'radio': {
91
- props?: RadioGroupProps & {
92
- options?: RadioProps[];
93
- };
94
- slots?: {
95
- default?: () => RawChildren;
96
- };
97
- };
98
- 'rate': {
99
- props?: RateProps;
100
- slots?: {
101
- default?: (info: {
102
- index: number;
103
- }) => RawChildren;
104
- };
105
- };
106
- 'select': {
107
- props?: SelectProps;
108
- slots?: {
109
- header?: () => RawChildren;
110
- action?: () => RawChildren;
111
- empty?: () => RawChildren;
112
- arrow?: () => RawChildren;
113
- };
114
- };
115
- 'slider': {
116
- props?: SliderProps;
117
- slots?: {
118
- thumb?: () => RawChildren;
119
- };
120
- };
121
- 'switch': {
122
- props?: SwitchProps;
123
- slots?: {
124
- checked?: () => RawChildren;
125
- checkedIcon?: () => RawChildren;
126
- icon?: () => RawChildren;
127
- unchecked?: () => RawChildren;
128
- uncheckedIcon?: () => RawChildren;
129
- };
130
- };
131
- 'time-picker': {
132
- props?: TimePickerProps;
133
- slots?: {
134
- icon?: () => RawChildren;
135
- };
136
- };
9
+ type PresetInputType = {
10
+ 'button': {
11
+ props?: ButtonProps & {
12
+ label?: string;
13
+ };
14
+ slots?: {
15
+ default?: () => RawChildren;
16
+ icon?: () => RawChildren;
17
+ };
18
+ };
19
+ 'color-picker': {
20
+ props?: ColorPickerProps;
21
+ slots?: {
22
+ label?: (color: string | null) => RawChildren;
23
+ action?: () => RawChildren;
24
+ };
25
+ };
26
+ 'checkbox': {
27
+ props?: CheckboxGroupProps & {
28
+ options?: CheckboxProps[];
29
+ };
30
+ slots?: {
31
+ default?: () => RawChildren;
32
+ };
33
+ };
34
+ 'divider': {
35
+ props?: DividerProps;
36
+ slots?: {
37
+ default?: () => RawChildren;
38
+ };
39
+ };
40
+ 'date-picker': {
41
+ props?: DatePickerProps;
42
+ slots?: undefined;
43
+ };
44
+ 'dynamic-tags': {
45
+ props?: DynamicTagsProps;
46
+ slots?: {
47
+ input?: (info: {
48
+ submit: (value: any) => void;
49
+ deactivate: () => void;
50
+ }) => RawChildren;
51
+ trigger?: (info: {
52
+ activate: () => void;
53
+ disabled: boolean;
54
+ }) => RawChildren;
55
+ };
56
+ };
57
+ 'input': {
58
+ props?: InputProps;
59
+ slots?: {
60
+ clearIcon?: () => RawChildren;
61
+ count?: (props: {
62
+ value: string;
63
+ }) => RawChildren;
64
+ passwordInvisibleIcon?: () => RawChildren;
65
+ passwordVisibleIcon?: () => RawChildren;
66
+ prefix?: () => RawChildren;
67
+ separator?: () => RawChildren;
68
+ suffix?: () => RawChildren;
69
+ };
70
+ };
71
+ 'input-number': {
72
+ props?: InputNumberProps;
73
+ slots?: {
74
+ addIcon?: () => RawChildren;
75
+ minusIcon?: () => RawChildren;
76
+ prefix?: () => RawChildren;
77
+ suffix?: () => RawChildren;
78
+ };
79
+ };
80
+ 'search': {
81
+ props?: SearchInputProps;
82
+ slots?: {
83
+ prefix?: () => RawChildren;
84
+ prefixIcon?: () => RawChildren;
85
+ button?: (props: {
86
+ value: string;
87
+ loading: boolean;
88
+ }) => RawChildren;
89
+ buttonIcon?: () => RawChildren;
90
+ };
91
+ };
92
+ 'radio': {
93
+ props?: RadioGroupProps & {
94
+ options?: RadioProps[];
95
+ };
96
+ slots?: {
97
+ default?: () => RawChildren;
98
+ };
99
+ };
100
+ 'rate': {
101
+ props?: RateProps;
102
+ slots?: {
103
+ default?: (info: {
104
+ index: number;
105
+ }) => RawChildren;
106
+ };
107
+ };
108
+ 'select': {
109
+ props?: SelectProps;
110
+ slots?: {
111
+ header?: () => RawChildren;
112
+ action?: () => RawChildren;
113
+ empty?: () => RawChildren;
114
+ arrow?: () => RawChildren;
115
+ };
116
+ };
117
+ 'slider': {
118
+ props?: SliderProps;
119
+ slots?: {
120
+ thumb?: () => RawChildren;
121
+ };
122
+ };
123
+ 'switch': {
124
+ props?: SwitchProps;
125
+ slots?: {
126
+ checked?: () => RawChildren;
127
+ checkedIcon?: () => RawChildren;
128
+ icon?: () => RawChildren;
129
+ unchecked?: () => RawChildren;
130
+ uncheckedIcon?: () => RawChildren;
131
+ };
132
+ };
133
+ 'time-picker': {
134
+ props?: TimePickerProps;
135
+ slots?: {
136
+ icon?: () => RawChildren;
137
+ };
138
+ };
137
139
  };
138
- export type PresetInputOptions = {
139
- [K in keyof PresetInputType]: {
140
- type?: K;
141
- props?: PresetInputType[K]['props'] & ClassStyle;
142
- slots?: PresetInputType[K]['slots'];
143
- };
144
- }[keyof PresetInputType];
145
- export type PresetInputProps<V> = {
146
- value?: V;
147
- options?: PresetInputOptions;
140
+ type PresetInputOptions = { [K in keyof PresetInputType]: {
141
+ type?: K;
142
+ props?: PresetInputType[K]['props'] & ClassStyle;
143
+ slots?: PresetInputType[K]['slots'];
144
+ } }[keyof PresetInputType];
145
+ type PresetInputProps<V> = {
146
+ value?: V;
147
+ options?: PresetInputOptions;
148
148
  };
149
+ //#endregion
150
+ export { PresetInputOptions, PresetInputProps, PresetInputType };
@@ -0,0 +1,213 @@
1
+ import MageMultiplyCircleFill_default from "../icons/MageMultiplyCircleFill.js";
2
+ import { computed, createBlock, createCommentVNode, createElementVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, reactive, ref, renderSlot, toDisplayString, toRaw, toValue, unref, watch, withCtx, withModifiers } from "vue";
3
+ import { cloneDeep } from "es-toolkit/object";
4
+ import { NBadge, NButton, NButtonGroup, NModal, NTooltip } from "naive-ui";
5
+
6
+ //#region src/components/preset-picker/PresetPicker.vue
7
+ const _sfc_main = /* @__PURE__ */ defineComponent({
8
+ __name: "PresetPicker",
9
+ props: {
10
+ value: {},
11
+ fallbackLabel: { type: [String, Function] },
12
+ multiple: { type: Boolean },
13
+ disabled: { type: Boolean },
14
+ clearable: { type: Boolean },
15
+ tooltip: {
16
+ type: Boolean,
17
+ default: true
18
+ },
19
+ placeholder: { default: "请选择" },
20
+ type: {},
21
+ columns: {},
22
+ selectionOptions: {},
23
+ fields: {},
24
+ buttonProps: {},
25
+ clearButtonProps: {},
26
+ badgeProps: {},
27
+ modalProps: {}
28
+ },
29
+ emits: [
30
+ "update:value",
31
+ "afterEnter",
32
+ "afterLeave",
33
+ "esc",
34
+ "maskClick",
35
+ "update:show",
36
+ "close",
37
+ "negativeClick",
38
+ "positiveClick"
39
+ ],
40
+ setup(__props, { expose: __expose, emit: __emit }) {
41
+ const emit = __emit;
42
+ const _fields = {
43
+ label: "label",
44
+ value: "value",
45
+ ...__props.fields
46
+ };
47
+ const checkedRowKeys = ref([]);
48
+ const checkedRows = ref([]);
49
+ const selectionColumn = reactive({
50
+ type: "selection",
51
+ multiple: __props.multiple,
52
+ width: 60,
53
+ fixed: "left",
54
+ ...__props.selectionOptions
55
+ });
56
+ watch(() => __props.multiple, () => {
57
+ selectionColumn.multiple = __props.multiple;
58
+ });
59
+ const _columns = reactive([selectionColumn, ...__props.columns ?? []]);
60
+ const showModalFlag = ref(false);
61
+ function showModal() {
62
+ checkedRowKeys.value = cloneDeep(Array.isArray(__props.value) ? __props.value : __props.value ? [__props.value] : []);
63
+ showModalFlag.value = true;
64
+ }
65
+ function clickRowEffect(row) {
66
+ if (__props.multiple) if (checkedRowKeys.value.includes(row?.[_fields.value])) {
67
+ checkedRowKeys.value = checkedRowKeys.value.filter((f) => f !== row?.[_fields.value]);
68
+ checkedRows.value = checkedRows.value.filter((f) => f?.[_fields.value] !== row?.[_fields.value]);
69
+ } else {
70
+ checkedRowKeys.value.push(row?.[_fields.value]);
71
+ checkedRows.value.push(row);
72
+ }
73
+ else {
74
+ checkedRowKeys.value = [row?.[_fields.value]];
75
+ checkedRows.value = [row];
76
+ }
77
+ }
78
+ function updateCheckedRowKeysEffect(keys, rows, meta, currentData) {
79
+ if (meta.action === "checkAll") {
80
+ const allKeys = keys.filter((f) => !checkedRowKeys.value.includes(f));
81
+ checkedRowKeys.value.push(...allKeys);
82
+ const allRows = rows.filter((f) => !checkedRows.value.some((s) => s?.[_fields.value] === f?.[_fields.value]));
83
+ checkedRows.value.push(...allRows);
84
+ return;
85
+ }
86
+ if (meta.action === "uncheckAll") {
87
+ checkedRowKeys.value = checkedRowKeys.value.filter((f) => !currentData?.some((s) => s?.[_fields.value] === f));
88
+ checkedRows.value = checkedRows.value.filter((f) => !currentData?.some((s) => s?.[_fields.value] === f?.[_fields.value]));
89
+ }
90
+ }
91
+ function onNegativeClick() {
92
+ emit("negativeClick");
93
+ showModalFlag.value = false;
94
+ }
95
+ function onPositiveClick() {
96
+ emit("positiveClick");
97
+ if (__props.multiple) {
98
+ const keys = toRaw(toValue(checkedRowKeys));
99
+ emit("update:value", keys, keys.map((m) => toRaw(toValue(checkedRows.value.find((f) => f?.[_fields.value] === m)))));
100
+ } else {
101
+ const key = checkedRowKeys.value[0] ?? null;
102
+ emit("update:value", key, toRaw(toValue(checkedRows.value.find((f) => f?.[_fields.value] === key))));
103
+ }
104
+ showModalFlag.value = false;
105
+ }
106
+ function clearValue() {
107
+ emit("update:value", null, null);
108
+ }
109
+ const _label = computed(() => {
110
+ if (Array.isArray(__props.value) && __props.value.length > 0) return typeof __props.fallbackLabel === "string" ? __props.fallbackLabel : __props.value.map((m) => {
111
+ const item = checkedRows.value.find((f) => f?.[_fields.value] === m);
112
+ return item && item?.[_fields.label] ? item[_fields.label] : typeof __props.fallbackLabel === "function" ? __props.fallbackLabel(m) : m;
113
+ }).join(",");
114
+ if (__props.value && !Array.isArray(__props.value)) {
115
+ const item = checkedRows.value.find((f) => f?.[_fields.value] === __props.value);
116
+ return item && item?.[_fields.label] ? item?.[_fields.label] : typeof __props.fallbackLabel === "function" ? __props.fallbackLabel(__props.value) : __props.fallbackLabel ?? __props.value;
117
+ }
118
+ return __props.placeholder;
119
+ });
120
+ const showClearButton = computed(() => {
121
+ return __props.clearable && (Array.isArray(__props.value) ? __props.value.length > 0 : !!__props.value);
122
+ });
123
+ const checkedCount = computed(() => Array.isArray(__props.value) ? __props.value.length : void 0);
124
+ const expose = {
125
+ showModalFlag,
126
+ checkedRowKeys,
127
+ checkedRows,
128
+ columns: _columns,
129
+ showModal,
130
+ updateCheckedRowKeysEffect,
131
+ clickRowEffect,
132
+ clearValue,
133
+ setCheckedRowKeys: (keys) => {
134
+ checkedRowKeys.value = keys;
135
+ },
136
+ setCheckedRows: (rows) => {
137
+ checkedRows.value = rows;
138
+ }
139
+ };
140
+ const templateBind = computed(() => {
141
+ return {
142
+ ...expose,
143
+ showModalFlag: toValue(showModalFlag),
144
+ checkedRowKeys: toValue(checkedRowKeys),
145
+ checkedRows: toValue(checkedRows),
146
+ columns: toValue(_columns)
147
+ };
148
+ });
149
+ __expose(expose);
150
+ return (_ctx, _cache) => {
151
+ return openBlock(), createBlock(unref(NBadge), mergeProps({ value: checkedCount.value }, __props.badgeProps), {
152
+ default: withCtx(() => [createVNode(unref(NButtonGroup), null, {
153
+ default: withCtx(() => [
154
+ createVNode(unref(NTooltip), {
155
+ disabled: !__props.tooltip || !Array.isArray(__props.value) ? true : false,
156
+ trigger: Array.isArray(__props.value) ? "hover" : "manual"
157
+ }, {
158
+ trigger: withCtx(() => [createVNode(unref(NButton), mergeProps({
159
+ type: __props.type,
160
+ disabled: __props.disabled
161
+ }, __props.buttonProps, { onClick: showModal }), {
162
+ icon: withCtx(() => [renderSlot(_ctx.$slots, "button-icon")]),
163
+ default: withCtx(() => [renderSlot(_ctx.$slots, "button", {}, () => [createElementVNode("span", null, toDisplayString(Array.isArray(__props.value) ? "已选择" : _label.value), 1)])]),
164
+ _: 3
165
+ }, 16, ["type", "disabled"])]),
166
+ default: withCtx(() => [createElementVNode("div", null, toDisplayString(Array.isArray(__props.value) ? _label.value : ""), 1)]),
167
+ _: 3
168
+ }, 8, ["disabled", "trigger"]),
169
+ renderSlot(_ctx.$slots, "clear-button", {}, () => [showClearButton.value ? (openBlock(), createBlock(unref(NButton), mergeProps({
170
+ key: 0,
171
+ circle: "",
172
+ type: __props.type
173
+ }, __props.clearButtonProps, { onClick: withModifiers(clearValue, ["stop"]) }), {
174
+ icon: withCtx(() => [renderSlot(_ctx.$slots, "clear-icon", {}, () => [createVNode(MageMultiplyCircleFill_default)])]),
175
+ _: 3
176
+ }, 16, ["type"])) : createCommentVNode("v-if", true)]),
177
+ createVNode(unref(NModal), mergeProps({
178
+ show: showModalFlag.value,
179
+ "onUpdate:show": _cache[0] || (_cache[0] = ($event) => showModalFlag.value = $event),
180
+ style: { "width": "auto" },
181
+ preset: "dialog",
182
+ title: __props.placeholder,
183
+ "positive-text": "确认",
184
+ "negative-text": "取消"
185
+ }, __props.modalProps, {
186
+ onPositiveClick,
187
+ onNegativeClick,
188
+ onClose: _cache[1] || (_cache[1] = ($event) => emit("close")),
189
+ onAfterEnter: _cache[2] || (_cache[2] = ($event) => emit("afterEnter")),
190
+ onAfterLeave: _cache[3] || (_cache[3] = ($event) => emit("afterLeave")),
191
+ onEsc: _cache[4] || (_cache[4] = ($event) => emit("esc")),
192
+ onMaskClick: _cache[5] || (_cache[5] = ($event) => emit("maskClick")),
193
+ "onUpdate:show": _cache[6] || (_cache[6] = (val) => emit("update:show", val))
194
+ }), {
195
+ action: withCtx(() => [renderSlot(_ctx.$slots, "modal-action")]),
196
+ header: withCtx(() => [renderSlot(_ctx.$slots, "modal-header")]),
197
+ icon: withCtx(() => [renderSlot(_ctx.$slots, "modal-icon")]),
198
+ close: withCtx(() => [renderSlot(_ctx.$slots, "modal-close")]),
199
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(templateBind.value)))]),
200
+ _: 3
201
+ }, 16, ["show", "title"])
202
+ ]),
203
+ _: 3
204
+ })]),
205
+ _: 3
206
+ }, 16, ["value"]);
207
+ };
208
+ }
209
+ });
210
+ var PresetPicker_default = _sfc_main;
211
+
212
+ //#endregion
213
+ export { PresetPicker_default as default };
@@ -1,50 +1,63 @@
1
- import { DataTableColumns } from 'naive-ui';
2
- import { DataObject } from '../../composables/useDataRequest';
3
- import { PresetPickerEmits, PresetPickerExpose, PresetPickerProps, PresetPickerValue } from './index';
4
- declare const _default: <V extends PresetPickerValue, R extends DataObject>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
5
- props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
6
- readonly onClose?: (() => any) | undefined;
7
- readonly "onUpdate:value"?: ((val: V | null, raw: R | R[] | null) => any) | undefined;
8
- readonly onAfterEnter?: (() => any) | undefined;
9
- readonly onAfterLeave?: (() => any) | undefined;
10
- readonly onEsc?: (() => any) | undefined;
11
- readonly onMaskClick?: (() => any) | undefined;
12
- readonly onNegativeClick?: (() => any) | undefined;
13
- readonly onPositiveClick?: (() => any) | undefined;
14
- readonly "onUpdate:show"?: ((value: boolean) => any) | undefined;
15
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:value" | "onUpdate:show" | "onAfterEnter" | "onAfterLeave" | "onClose" | "onEsc" | "onMaskClick" | "onNegativeClick" | "onPositiveClick"> & PresetPickerProps<V, R> & Partial<{}>> & import('vue').PublicProps;
16
- expose(exposed: import('vue').ShallowUnwrapRef<PresetPickerExpose<R>>): void;
17
- attrs: any;
18
- slots: {
19
- 'button-icon'?(_: {}): any;
20
- button?(_: {}): any;
21
- 'clear-button'?(_: {}): any;
22
- 'clear-icon'?(_: {}): any;
23
- default?(_: {
24
- showModalFlag: boolean;
25
- checkedRowKeys: (string | number)[];
26
- checkedRows: R[];
27
- columns: DataTableColumns<any>;
28
- showModal: () => void;
29
- updateCheckedRowKeysEffect: (keys: (string | number)[], rows: (R | undefined)[], meta: {
30
- row: R | undefined;
31
- action: "check" | "uncheck" | "checkAll" | "uncheckAll";
32
- }, currentData: R[]) => void;
33
- clickRowEffect: (row: R) => void;
34
- clearValue: () => void;
35
- setCheckedRowKeys: (keys: (string | number)[]) => void;
36
- setCheckedRows: (rows: R[]) => void;
37
- }): any;
38
- 'modal-action'?(_: {}): any;
39
- 'modal-header'?(_: {}): any;
40
- 'modal-icon'?(_: {}): any;
41
- 'modal-close'?(_: {}): any;
42
- };
43
- emit: PresetPickerEmits<V, R>;
44
- }>) => import('vue').VNode & {
45
- __ctx?: Awaited<typeof __VLS_setup>;
1
+ import { DataObject } from "../../composables/useDataRequest.js";
2
+ import { PresetPickerEmits, PresetPickerExpose, PresetPickerProps, PresetPickerValue } from "./index.js";
3
+ import * as vue85 from "vue";
4
+ import { DataTableColumns } from "naive-ui";
5
+
6
+ //#region src/components/preset-picker/PresetPicker.vue.d.ts
7
+ declare const __VLS_export: <V extends PresetPickerValue, R extends DataObject>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
8
+ props: __VLS_PrettifyLocal<PresetPickerProps<V, R> & {
9
+ onClose?: (() => any) | undefined;
10
+ "onUpdate:value"?: ((val: V | null, raw: R | R[] | null) => any) | undefined;
11
+ onAfterEnter?: (() => any) | undefined;
12
+ onAfterLeave?: (() => any) | undefined;
13
+ onEsc?: (() => any) | undefined;
14
+ onMaskClick?: (() => any) | undefined;
15
+ onNegativeClick?: (() => any) | undefined;
16
+ onPositiveClick?: (() => any) | undefined;
17
+ "onUpdate:show"?: ((value: boolean) => any) | undefined;
18
+ }> & vue85.PublicProps & (typeof globalThis extends {
19
+ __VLS_PROPS_FALLBACK: infer P;
20
+ } ? P : {});
21
+ expose: (exposed: vue85.ShallowUnwrapRef<PresetPickerExpose<R>>) => void;
22
+ attrs: any;
23
+ slots: {
24
+ 'button-icon'?: (props: {}) => any;
25
+ } & {
26
+ button?: (props: {}) => any;
27
+ } & {
28
+ 'clear-button'?: (props: {}) => any;
29
+ } & {
30
+ 'clear-icon'?: (props: {}) => any;
31
+ } & {
32
+ default?: (props: {
33
+ showModalFlag: boolean;
34
+ checkedRowKeys: (string | number)[];
35
+ checkedRows: R[];
36
+ columns: DataTableColumns<any>;
37
+ showModal: () => void;
38
+ updateCheckedRowKeysEffect: (keys: (string | number)[], rows: (R | undefined)[], meta: {
39
+ row: R | undefined;
40
+ action: "check" | "uncheck" | "checkAll" | "uncheckAll";
41
+ }, currentData: R[]) => void;
42
+ clickRowEffect: (row: R) => void;
43
+ clearValue: () => void;
44
+ setCheckedRowKeys: (keys: (string | number)[]) => void;
45
+ setCheckedRows: (rows: R[]) => void;
46
+ }) => any;
47
+ } & {
48
+ 'modal-action'?: (props: {}) => any;
49
+ } & {
50
+ 'modal-header'?: (props: {}) => any;
51
+ } & {
52
+ 'modal-icon'?: (props: {}) => any;
53
+ } & {
54
+ 'modal-close'?: (props: {}) => any;
55
+ };
56
+ emit: PresetPickerEmits<V, R>;
57
+ }>) => vue85.VNode & {
58
+ __ctx?: Awaited<typeof __VLS_setup>;
46
59
  };
47
- export default _default;
48
- type __VLS_PrettifyLocal<T> = {
49
- [K in keyof T]: T[K];
50
- } & {};
60
+ declare const _default: typeof __VLS_export;
61
+ type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K in keyof T as K]: T[K] }) & {};
62
+ //#endregion
63
+ export { _default };