@sdata/web-vue 3.14.0 → 3.16.0
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/sd.css +44 -3
- package/dist/sd.min.css +1 -1
- package/es/_components/resize-trigger.vue_vue_type_script_setup_true_lang.js +6 -3
- package/es/_components/select-view/select-view.js +3 -1
- package/es/alert/alert.vue_vue_type_script_setup_true_lang.js +5 -2
- package/es/anchor/anchor.vue_vue_type_script_setup_true_lang.js +5 -2
- package/es/back-top/back-top.vue_vue_type_script_setup_true_lang.js +5 -2
- package/es/basic-crud-table/basic-crud-modal.js +5 -0
- package/es/basic-crud-table/basic-crud-modal.vue.d.ts +264 -0
- package/es/basic-crud-table/basic-crud-modal.vue_vue_type_script_setup_true_lang.js +139 -0
- package/es/basic-crud-table/basic-crud-table.js +5 -0
- package/es/basic-crud-table/basic-crud-table.vue.d.ts +935 -0
- package/es/basic-crud-table/basic-crud-table.vue_vue_type_script_setup_true_lang.js +520 -0
- package/es/basic-crud-table/index.d.ts +2722 -0
- package/es/basic-crud-table/index.js +9 -0
- package/es/basic-crud-table/style/css.js +2 -0
- package/es/basic-crud-table/style/index.css +60 -0
- package/es/basic-crud-table/style/index.d.ts +2 -0
- package/es/basic-crud-table/style/index.js +2 -0
- package/es/basic-crud-table/style/index.scss +54 -0
- package/es/basic-crud-table/style/token.scss +8 -0
- package/es/basic-crud-table/types.d.ts +70 -0
- package/es/breadcrumb/breadcrumb-item.js +4 -2
- package/es/breadcrumb/breadcrumb.js +3 -1
- package/es/calendar/components/event.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/calendar/components/headings-bar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/card/card.d.ts +1 -1
- package/es/card/index.d.ts +3 -3
- package/es/carousel/carousel-arrow.vue_vue_type_script_setup_true_lang.js +9 -5
- package/es/carousel/carousel-indicator.vue_vue_type_script_setup_true_lang.js +4 -2
- package/es/carousel/carousel-item.vue_vue_type_script_setup_true_lang.js +4 -2
- package/es/carousel/carousel.js +3 -1
- package/es/cascader/cascader-option.js +1 -1
- package/es/cascader/cascader.vue_vue_type_script_setup_true_lang.js +3 -3
- package/es/color-picker/color-picker.js +6 -5
- package/es/color-picker/panel.d.ts +2 -2
- package/es/color-picker/panel.js +5 -4
- package/es/components.d.ts +1 -0
- package/es/config-provider/config-provider.vue.d.ts +7 -1
- package/es/config-provider/config-provider.vue_vue_type_script_setup_true_lang.js +7 -1
- package/es/config-provider/context.d.ts +4 -0
- package/es/config-provider/index.d.ts +25 -15
- package/es/copy/copy.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/date-picker/hooks/use-provide-datepicker-transform.js +1 -1
- package/es/date-picker/panels/header.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/date-picker/picker.vue_vue_type_script_setup_true_lang.js +3 -3
- package/es/date-picker/range-picker.vue_vue_type_script_setup_true_lang.js +2 -2
- package/es/drawer/drawer.vue_vue_type_script_setup_true_lang.js +4 -3
- package/es/dropdown/dropdown-button.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/dropdown/dropdown-panel.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/dropdown/dropdown-submenu.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/file-previewer/file-previewer.vue_vue_type_script_setup_true_lang.js +13 -9
- package/es/form/form-item.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/form/index.js +1 -1
- package/es/grid/grid-col.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/grid/grid-item.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/grid/grid-row.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/grid/grid.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/image/image.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/image/preview-arrow.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/image/preview.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/index.css +44 -3
- package/es/index.d.ts +2 -0
- package/es/index.js +55 -54
- package/es/index.scss +1 -0
- package/es/input/input.js +3 -1
- package/es/input-number/input-number.js +8 -6
- package/es/json-form/style/index.css +0 -3
- package/es/json-form/style/index.scss +4 -3
- package/es/json-form/utils.js +5 -5
- package/es/layout/sider.vue_vue_type_script_setup_true_lang.js +9 -7
- package/es/link/link.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/list/list.js +1 -1
- package/es/locale/interface.d.ts +39 -0
- package/es/locale/lang/ar-eg.js +38 -0
- package/es/locale/lang/de-de.js +38 -0
- package/es/locale/lang/en-us.js +38 -0
- package/es/locale/lang/es-es.js +38 -0
- package/es/locale/lang/fr-fr.js +38 -0
- package/es/locale/lang/id-id.js +38 -0
- package/es/locale/lang/it-it.js +38 -0
- package/es/locale/lang/ja-jp.js +38 -0
- package/es/locale/lang/km-kh.js +38 -0
- package/es/locale/lang/ko-kr.js +38 -0
- package/es/locale/lang/ms-my.js +38 -0
- package/es/locale/lang/nl-nl.js +38 -0
- package/es/locale/lang/pt-pt.js +38 -0
- package/es/locale/lang/ru-ru.js +38 -0
- package/es/locale/lang/th-th.js +38 -0
- package/es/locale/lang/vi-vn.js +38 -0
- package/es/locale/lang/zh-cn.js +38 -0
- package/es/locale/lang/zh-tw.js +38 -0
- package/es/menu/item.d.ts +1 -1
- package/es/modal/modal.vue_vue_type_script_setup_true_lang.js +4 -3
- package/es/page-header/page-header.vue_vue_type_script_setup_true_lang.js +8 -2
- package/es/pagination/page-item-ellipsis.vue_vue_type_script_setup_true_lang.js +5 -2
- package/es/pagination/page-item-step.vue_vue_type_script_setup_true_lang.js +5 -3
- package/es/pagination/page-options.vue_vue_type_script_setup_true_lang.js +3 -3
- package/es/pagination/pagination.js +1 -1
- package/es/popconfirm/popconfirm.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/qr-code/qr-code.vue_vue_type_script_setup_true_lang.js +4 -2
- package/es/rate/rate.js +3 -1
- package/es/sd-vue.js +54 -52
- package/es/secret/secret.vue_vue_type_script_setup_true_lang.js +3 -1
- package/es/select/select.js +3 -3
- package/es/statistic/statistic.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/steps/steps.vue_vue_type_script_setup_true_lang.js +6 -3
- package/es/table/index.d.ts +4 -4
- package/es/table/table-operation-td.js +3 -3
- package/es/table/table-th.d.ts +1 -1
- package/es/table/table-th.js +2 -2
- package/es/table/table.d.ts +1 -1
- package/es/table/table.js +2 -2
- package/es/tabs/tabs-button.js +1 -1
- package/es/tag/tag.vue_vue_type_script_setup_true_lang.js +8 -2
- package/es/tag-group/tag-group.vue_vue_type_script_setup_true_lang.js +2 -2
- package/es/textarea/textarea.vue_vue_type_script_setup_true_lang.js +5 -2
- package/es/time-picker/time-picker.vue_vue_type_script_setup_true_lang.js +2 -2
- package/es/toolbar/index.d.ts +3 -3
- package/es/toolbar/toolbar.vue.d.ts +2 -2
- package/es/toolbar/toolbar.vue_vue_type_script_setup_true_lang.js +5 -5
- package/es/transfer/transfer-list-item.js +3 -1
- package/es/transfer/transfer.vue_vue_type_script_setup_true_lang.js +7 -5
- package/es/tree/base-node.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/tree/node-switcher.vue_vue_type_script_lang.js +1 -1
- package/es/typography/edit-content.vue_vue_type_script_setup_true_lang.js +8 -2
- package/es/upload/upload-list-item.js +1 -1
- package/es/upload/upload-picture-item.js +5 -3
- package/es/verification-code/verification-code.js +4 -2
- package/json/vetur-attributes.json +3 -0
- package/json/vetur-tags.json +4 -0
- package/json/web-types.json +15 -1
- package/package.json +1 -1
- package/es/color-picker/colors.d.ts +0 -1
- package/es/color-picker/colors.js +0 -27
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/objectSpread2.js";
|
|
2
2
|
import resize_observer_default from "./resize-observer.js";
|
|
3
|
+
import { useI18n } from "../locale/index.js";
|
|
3
4
|
import IconDragDotVertical from "../icon/icon-drag-dot-vertical/index.js";
|
|
4
5
|
import IconDragDot from "../icon/icon-drag-dot/index.js";
|
|
5
6
|
import { computed, createBlock, createElementVNode, defineComponent, normalizeClass, openBlock, renderSlot, toRefs, unref, withCtx } from "vue";
|
|
6
7
|
//#region components/_components/resize-trigger.vue?vue&type=script&setup=true&lang.tsx
|
|
7
|
-
var _hoisted_1 = ["aria-orientation"];
|
|
8
|
+
var _hoisted_1 = ["aria-orientation", "aria-label"];
|
|
8
9
|
var resize_trigger_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, { name: "ResizeTrigger" }), {}, {
|
|
9
10
|
__name: "resize-trigger",
|
|
10
11
|
props: {
|
|
@@ -20,7 +21,9 @@ var resize_trigger_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
20
21
|
emits: ["resize"],
|
|
21
22
|
setup(__props, { emit: __emit }) {
|
|
22
23
|
const emit = __emit;
|
|
23
|
-
const
|
|
24
|
+
const props = __props;
|
|
25
|
+
const { t } = useI18n();
|
|
26
|
+
const { direction, prefixCls } = toRefs(props);
|
|
24
27
|
const isHorizontal = computed(() => (direction === null || direction === void 0 ? void 0 : direction.value) === "horizontal");
|
|
25
28
|
const classNames = computed(() => [prefixCls.value, {
|
|
26
29
|
[`${prefixCls.value}-horizontal`]: isHorizontal.value,
|
|
@@ -36,7 +39,7 @@ var resize_trigger_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
36
39
|
role: "separator",
|
|
37
40
|
tabindex: "0",
|
|
38
41
|
"aria-orientation": unref(direction),
|
|
39
|
-
"aria-label": "
|
|
42
|
+
"aria-label": unref(t)("a11y.resize")
|
|
40
43
|
}, [renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("div", { class: normalizeClass(`${unref(prefixCls)}-icon-wrapper`) }, [renderSlot(_ctx.$slots, "icon", {}, () => [isHorizontal.value ? (openBlock(), createBlock(unref(IconDragDot), {
|
|
41
44
|
key: 0,
|
|
42
45
|
class: normalizeClass(`${unref(prefixCls)}-icon`)
|
|
@@ -3,6 +3,7 @@ import { getPrefixCls } from "../../_utils/global-config.js";
|
|
|
3
3
|
import { isArray } from "../../_utils/is.js";
|
|
4
4
|
import icon_hover_default from "../icon-hover.js";
|
|
5
5
|
import IconClose from "../../icon/icon-close/index.js";
|
|
6
|
+
import { useI18n } from "../../locale/index.js";
|
|
6
7
|
import IconLoading from "../../icon/icon-loading/index.js";
|
|
7
8
|
import feedback_icon_default from "../feedback-icon.js";
|
|
8
9
|
import { useSize } from "../../_hooks/use-size.js";
|
|
@@ -83,6 +84,7 @@ var select_view_default = /* @__PURE__ */ defineComponent({
|
|
|
83
84
|
"blur"
|
|
84
85
|
],
|
|
85
86
|
setup(props, { emit, slots }) {
|
|
87
|
+
const { t } = useI18n();
|
|
86
88
|
const { size, disabled, error } = toRefs(props);
|
|
87
89
|
const prefixCls = getPrefixCls("select-view");
|
|
88
90
|
const { feedback, eventHandlers, mergedDisabled, mergedSize: _mergedSize, mergedError } = useFormItem({
|
|
@@ -133,7 +135,7 @@ var select_view_default = /* @__PURE__ */ defineComponent({
|
|
|
133
135
|
showClearBtn.value && createVNode("button", {
|
|
134
136
|
"type": "button",
|
|
135
137
|
"class": `${prefixCls}-clear-btn`,
|
|
136
|
-
"aria-label": "
|
|
138
|
+
"aria-label": t("a11y.clear"),
|
|
137
139
|
"onClick": handleClear,
|
|
138
140
|
"onMousedown": (ev) => ev.stopPropagation()
|
|
139
141
|
}, [createVNode(icon_hover_default, null, { default: () => [createVNode(IconClose, null, null)] })]),
|
|
@@ -7,8 +7,10 @@ import IconClose from "../icon/icon-close/index.js";
|
|
|
7
7
|
import IconCloseCircleFill from "../icon/icon-close-circle-fill/index.js";
|
|
8
8
|
import IconExclamationCircleFill from "../icon/icon-exclamation-circle-fill/index.js";
|
|
9
9
|
import IconInfoCircleFill from "../icon/icon-info-circle-fill/index.js";
|
|
10
|
+
import { useI18n } from "../locale/index.js";
|
|
10
11
|
import { Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, ref, renderSlot, toDisplayString, unref, useSlots, withCtx } from "vue";
|
|
11
12
|
//#region components/alert/alert.vue?vue&type=script&setup=true&lang.ts
|
|
13
|
+
var _hoisted_1 = ["aria-label"];
|
|
12
14
|
var alert_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, { name: "Alert" }), {}, {
|
|
13
15
|
__name: "alert",
|
|
14
16
|
props: {
|
|
@@ -85,6 +87,7 @@ var alert_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
|
|
|
85
87
|
* @version 2.36.0
|
|
86
88
|
*/
|
|
87
89
|
const slots = useSlots();
|
|
90
|
+
const { t } = useI18n();
|
|
88
91
|
const prefixCls = getPrefixCls("alert");
|
|
89
92
|
const visible = ref(true);
|
|
90
93
|
const handleClose = (ev) => {
|
|
@@ -136,14 +139,14 @@ var alert_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
|
|
|
136
139
|
key: 2,
|
|
137
140
|
tabindex: "0",
|
|
138
141
|
role: "button",
|
|
139
|
-
"aria-label": "
|
|
142
|
+
"aria-label": unref(t)("a11y.close"),
|
|
140
143
|
class: normalizeClass(`${unref(prefixCls)}-close-btn`),
|
|
141
144
|
onClick: handleClose,
|
|
142
145
|
onKeydown: onCloseKeydown
|
|
143
146
|
}, [renderSlot(_ctx.$slots, "close-element", {}, () => [createVNode(icon_hover_default, null, {
|
|
144
147
|
default: withCtx(() => [createVNode(unref(IconClose))]),
|
|
145
148
|
_: 1
|
|
146
|
-
})])],
|
|
149
|
+
})])], 42, _hoisted_1)) : createCommentVNode("", true)
|
|
147
150
|
], 2)) : createCommentVNode("", true)]),
|
|
148
151
|
_: 3
|
|
149
152
|
});
|
|
@@ -3,11 +3,13 @@ import { getPrefixCls } from "../_utils/global-config.js";
|
|
|
3
3
|
import { isNumber, isWindow } from "../_utils/is.js";
|
|
4
4
|
import { getElement, off, on } from "../_utils/dom.js";
|
|
5
5
|
import { throttleByRaf } from "../_utils/throttle-by-raf.js";
|
|
6
|
+
import { useI18n } from "../locale/index.js";
|
|
6
7
|
import { anchorInjectionKey } from "./context.js";
|
|
7
8
|
import { BOUNDARY_POSITIONS, slide } from "./utils.js";
|
|
8
9
|
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, nextTick, normalizeClass, normalizeProps, onBeforeUnmount, onMounted, openBlock, provide, reactive, ref, renderSlot, resolveDynamicComponent, unref, watch, withCtx } from "vue";
|
|
9
10
|
import { compute } from "compute-scroll-into-view";
|
|
10
11
|
//#region components/anchor/anchor.vue?vue&type=script&setup=true&lang.ts
|
|
12
|
+
var _hoisted_1 = ["aria-label"];
|
|
11
13
|
var anchor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, { name: "Anchor" }), {}, {
|
|
12
14
|
__name: "anchor",
|
|
13
15
|
props: {
|
|
@@ -98,6 +100,7 @@ var anchor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
|
|
|
98
100
|
setup(__props, { emit: __emit }) {
|
|
99
101
|
const emit = __emit;
|
|
100
102
|
const props = __props;
|
|
103
|
+
const { t } = useI18n();
|
|
101
104
|
const prefixCls = getPrefixCls("anchor");
|
|
102
105
|
const anchorRef = ref();
|
|
103
106
|
const lineSliderRef = ref();
|
|
@@ -233,14 +236,14 @@ var anchor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
|
|
|
233
236
|
ref_key: "anchorRef",
|
|
234
237
|
ref: anchorRef,
|
|
235
238
|
role: "navigation",
|
|
236
|
-
"aria-label": "
|
|
239
|
+
"aria-label": unref(t)("a11y.anchorNav"),
|
|
237
240
|
class: normalizeClass(cls.value)
|
|
238
241
|
}, [!__props.lineLess ? (openBlock(), createElementBlock("div", {
|
|
239
242
|
key: 0,
|
|
240
243
|
ref_key: "lineSliderRef",
|
|
241
244
|
ref: lineSliderRef,
|
|
242
245
|
class: normalizeClass(`${unref(prefixCls)}-line-slider`)
|
|
243
|
-
}, null, 2)) : createCommentVNode("", true), createElementVNode("ul", { class: normalizeClass(`${unref(prefixCls)}-list`) }, [renderSlot(_ctx.$slots, "default")], 2)],
|
|
246
|
+
}, null, 2)) : createCommentVNode("", true), createElementVNode("ul", { class: normalizeClass(`${unref(prefixCls)}-list`) }, [renderSlot(_ctx.$slots, "default")], 2)], 10, _hoisted_1)]),
|
|
244
247
|
_: 3
|
|
245
248
|
}, 16);
|
|
246
249
|
};
|
|
@@ -3,10 +3,12 @@ import { getPrefixCls } from "../_utils/global-config.js";
|
|
|
3
3
|
import { isString } from "../_utils/is.js";
|
|
4
4
|
import { off, on } from "../_utils/dom.js";
|
|
5
5
|
import { throttleByRaf } from "../_utils/throttle-by-raf.js";
|
|
6
|
+
import { useI18n } from "../locale/index.js";
|
|
6
7
|
import IconToTop from "../icon/icon-to-top/index.js";
|
|
7
8
|
import { Transition, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, onMounted, onUnmounted, openBlock, ref, renderSlot, unref, withCtx } from "vue";
|
|
8
9
|
import BTween from "b-tween";
|
|
9
10
|
//#region components/back-top/back-top.vue?vue&type=script&setup=true&lang.ts
|
|
11
|
+
var _hoisted_1 = ["aria-label"];
|
|
10
12
|
var back_top_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, { name: "BackTop" }), {}, {
|
|
11
13
|
__name: "back-top",
|
|
12
14
|
props: {
|
|
@@ -42,6 +44,7 @@ var back_top_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
42
44
|
},
|
|
43
45
|
setup(__props) {
|
|
44
46
|
const props = __props;
|
|
47
|
+
const { t } = useI18n();
|
|
45
48
|
const prefixCls = getPrefixCls("back-top");
|
|
46
49
|
const visible = ref(false);
|
|
47
50
|
const target = ref();
|
|
@@ -92,8 +95,8 @@ var back_top_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
92
95
|
}, [renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("button", {
|
|
93
96
|
type: "button",
|
|
94
97
|
class: normalizeClass(`${unref(prefixCls)}-btn`),
|
|
95
|
-
"aria-label": "
|
|
96
|
-
}, [createVNode(unref(IconToTop))],
|
|
98
|
+
"aria-label": unref(t)("a11y.backToTop")
|
|
99
|
+
}, [createVNode(unref(IconToTop))], 10, _hoisted_1)])], 2)) : createCommentVNode("", true)]),
|
|
97
100
|
_: 3
|
|
98
101
|
});
|
|
99
102
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import basic_crud_modal_vue_vue_type_script_setup_true_lang_default from "./basic-crud-modal.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
//#region components/basic-crud-table/basic-crud-modal.vue
|
|
3
|
+
var basic_crud_modal_default = basic_crud_modal_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { basic_crud_modal_default as default };
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import type { UnknownRecord } from 'type-fest';
|
|
2
|
+
import type { VNode } from 'vue';
|
|
3
|
+
import { nextTick } from 'vue';
|
|
4
|
+
import type { TableData } from '../table';
|
|
5
|
+
import type { BasicCrudTableModalFormProps, BasicCrudTableModalProps, BasicCrudTableModalSubmitContext, MaybePromise } from './types';
|
|
6
|
+
type __VLS_Slots = {
|
|
7
|
+
[name: string]: ((props: UnknownRecord) => VNode[]) | undefined;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_Props = {
|
|
10
|
+
modalProps?: BasicCrudTableModalProps;
|
|
11
|
+
modalFormProps?: BasicCrudTableModalFormProps;
|
|
12
|
+
createApi?: (data: UnknownRecord) => MaybePromise<unknown>;
|
|
13
|
+
updateApi?: (data: UnknownRecord) => MaybePromise<unknown>;
|
|
14
|
+
detailApi?: (row: TableData) => MaybePromise<UnknownRecord>;
|
|
15
|
+
valueTransformer?: (data: UnknownRecord) => UnknownRecord;
|
|
16
|
+
beforeSubmit?: (context: BasicCrudTableModalSubmitContext<TableData>) => MaybePromise<boolean | void>;
|
|
17
|
+
};
|
|
18
|
+
declare function open(row?: TableData): Promise<void>;
|
|
19
|
+
type __VLS_ModelProps = {
|
|
20
|
+
'visible'?: boolean;
|
|
21
|
+
'model'?: UnknownRecord;
|
|
22
|
+
};
|
|
23
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
24
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
25
|
+
open: typeof open;
|
|
26
|
+
type: import("vue").ComputedRef<"create" | "edit">;
|
|
27
|
+
formRef: import("vue").ShallowRef<({
|
|
28
|
+
$: import("vue").ComponentInternalInstance;
|
|
29
|
+
$data: {};
|
|
30
|
+
$props: {
|
|
31
|
+
readonly schemas: import("..").JsonFormA2UI_0_8ComponentNode[] | import("..").JsonFormSchema<import("..").JsonFormComponentType<{}>, {}>[];
|
|
32
|
+
readonly adapter?: import("..").JsonFormAdapter | undefined;
|
|
33
|
+
readonly model?: import("..").JsonFormModel | undefined;
|
|
34
|
+
readonly hideLabel?: boolean | undefined;
|
|
35
|
+
readonly hideAsterisk?: boolean | undefined;
|
|
36
|
+
readonly showColon?: boolean | undefined;
|
|
37
|
+
readonly component?: (string | import("vue").Component) | undefined;
|
|
38
|
+
readonly modelValue?: import("..").JsonFormModel | undefined;
|
|
39
|
+
readonly "onUpdate:modelValue"?: ((value: import("..").JsonFormModel | undefined) => any) | undefined;
|
|
40
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
41
|
+
$attrs: import("vue").Attrs;
|
|
42
|
+
$refs: {
|
|
43
|
+
[x: string]: unknown;
|
|
44
|
+
};
|
|
45
|
+
$slots: Readonly<{
|
|
46
|
+
[name: string]: import("vue").Slot<any> | undefined;
|
|
47
|
+
}>;
|
|
48
|
+
$root: import("vue").ComponentPublicInstance | null;
|
|
49
|
+
$parent: import("vue").ComponentPublicInstance | null;
|
|
50
|
+
$host: Element | null;
|
|
51
|
+
$emit: (event: "update:modelValue", value: import("..").JsonFormModel | undefined) => void;
|
|
52
|
+
$el: any;
|
|
53
|
+
$options: import("vue").ComponentOptionsBase<Readonly<{
|
|
54
|
+
schemas: import("..").JsonFormA2UI_0_8ComponentNode[] | import("..").JsonFormSchema<import("..").JsonFormComponentType<{}>, {}>[];
|
|
55
|
+
adapter?: import("..").JsonFormAdapter;
|
|
56
|
+
model?: import("..").JsonFormModel;
|
|
57
|
+
hideLabel?: boolean;
|
|
58
|
+
hideAsterisk?: boolean;
|
|
59
|
+
showColon?: boolean;
|
|
60
|
+
component?: string | import("vue").Component;
|
|
61
|
+
} & {
|
|
62
|
+
modelValue?: import("..").JsonFormModel | undefined;
|
|
63
|
+
}> & Readonly<{
|
|
64
|
+
"onUpdate:modelValue"?: ((value: import("..").JsonFormModel | undefined) => any) | undefined;
|
|
65
|
+
}>, {
|
|
66
|
+
validate: (callback?: ((errors: undefined | Record<string, import("..").ValidatedError>) => void) | undefined) => Promise<Record<string, import("..").ValidatedError> | undefined> | undefined;
|
|
67
|
+
validateField: (field: string | string[], callback?: ((errors: undefined | Record<string, import("..").ValidatedError>) => void) | undefined) => Promise<Record<string, import("..").ValidatedError> | undefined> | undefined;
|
|
68
|
+
resetFields: (field?: string | string[] | undefined) => void | undefined;
|
|
69
|
+
clearValidate: (field?: string | string[] | undefined) => void | undefined;
|
|
70
|
+
setFields: (data: Record<string, import("../form/interface").FieldData>) => void | undefined;
|
|
71
|
+
scrollToField: (field: string) => void | undefined;
|
|
72
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
73
|
+
"update:modelValue": (value: import("..").JsonFormModel | undefined) => any;
|
|
74
|
+
}, string, {
|
|
75
|
+
component: string | import("vue").Component;
|
|
76
|
+
showColon: boolean;
|
|
77
|
+
hideLabel: boolean;
|
|
78
|
+
hideAsterisk: boolean;
|
|
79
|
+
model: import("..").JsonFormModel;
|
|
80
|
+
adapter: import("..").JsonFormAdapter;
|
|
81
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
|
|
82
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
83
|
+
created?: (() => void) | (() => void)[];
|
|
84
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
85
|
+
mounted?: (() => void) | (() => void)[];
|
|
86
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
87
|
+
updated?: (() => void) | (() => void)[];
|
|
88
|
+
activated?: (() => void) | (() => void)[];
|
|
89
|
+
deactivated?: (() => void) | (() => void)[];
|
|
90
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
91
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
92
|
+
destroyed?: (() => void) | (() => void)[];
|
|
93
|
+
unmounted?: (() => void) | (() => void)[];
|
|
94
|
+
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
95
|
+
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
96
|
+
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
97
|
+
};
|
|
98
|
+
$forceUpdate: () => void;
|
|
99
|
+
$nextTick: typeof nextTick;
|
|
100
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
|
|
101
|
+
} & Readonly<{
|
|
102
|
+
component: string | import("vue").Component;
|
|
103
|
+
showColon: boolean;
|
|
104
|
+
hideLabel: boolean;
|
|
105
|
+
hideAsterisk: boolean;
|
|
106
|
+
model: import("..").JsonFormModel;
|
|
107
|
+
adapter: import("..").JsonFormAdapter;
|
|
108
|
+
}> & Omit<Readonly<{
|
|
109
|
+
schemas: import("..").JsonFormA2UI_0_8ComponentNode[] | import("..").JsonFormSchema<import("..").JsonFormComponentType<{}>, {}>[];
|
|
110
|
+
adapter?: import("..").JsonFormAdapter;
|
|
111
|
+
model?: import("..").JsonFormModel;
|
|
112
|
+
hideLabel?: boolean;
|
|
113
|
+
hideAsterisk?: boolean;
|
|
114
|
+
showColon?: boolean;
|
|
115
|
+
component?: string | import("vue").Component;
|
|
116
|
+
} & {
|
|
117
|
+
modelValue?: import("..").JsonFormModel | undefined;
|
|
118
|
+
}> & Readonly<{
|
|
119
|
+
"onUpdate:modelValue"?: ((value: import("..").JsonFormModel | undefined) => any) | undefined;
|
|
120
|
+
}>, "validate" | "validateField" | "resetFields" | "clearValidate" | "setFields" | "scrollToField" | ("component" | "showColon" | "hideLabel" | "hideAsterisk" | "model" | "adapter")> & {
|
|
121
|
+
validate: (callback?: ((errors: undefined | Record<string, import("..").ValidatedError>) => void) | undefined) => Promise<Record<string, import("..").ValidatedError> | undefined> | undefined;
|
|
122
|
+
validateField: (field: string | string[], callback?: ((errors: undefined | Record<string, import("..").ValidatedError>) => void) | undefined) => Promise<Record<string, import("..").ValidatedError> | undefined> | undefined;
|
|
123
|
+
resetFields: (field?: string | string[] | undefined) => void | undefined;
|
|
124
|
+
clearValidate: (field?: string | string[] | undefined) => void | undefined;
|
|
125
|
+
setFields: (data: Record<string, import("../form/interface").FieldData>) => void | undefined;
|
|
126
|
+
scrollToField: (field: string) => void | undefined;
|
|
127
|
+
} & {} & import("vue").ComponentCustomProperties & {} & {
|
|
128
|
+
$slots: {
|
|
129
|
+
[x: string]: ((props: {
|
|
130
|
+
[x: string]: unknown;
|
|
131
|
+
}) => any) | undefined;
|
|
132
|
+
} & {
|
|
133
|
+
default?: (props: {}) => any;
|
|
134
|
+
};
|
|
135
|
+
}) | undefined, ({
|
|
136
|
+
$: import("vue").ComponentInternalInstance;
|
|
137
|
+
$data: {};
|
|
138
|
+
$props: {
|
|
139
|
+
readonly schemas: import("..").JsonFormA2UI_0_8ComponentNode[] | import("..").JsonFormSchema<import("..").JsonFormComponentType<{}>, {}>[];
|
|
140
|
+
readonly adapter?: import("..").JsonFormAdapter | undefined;
|
|
141
|
+
readonly model?: import("..").JsonFormModel | undefined;
|
|
142
|
+
readonly hideLabel?: boolean | undefined;
|
|
143
|
+
readonly hideAsterisk?: boolean | undefined;
|
|
144
|
+
readonly showColon?: boolean | undefined;
|
|
145
|
+
readonly component?: (string | import("vue").Component) | undefined;
|
|
146
|
+
readonly modelValue?: import("..").JsonFormModel | undefined;
|
|
147
|
+
readonly "onUpdate:modelValue"?: ((value: import("..").JsonFormModel | undefined) => any) | undefined;
|
|
148
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
149
|
+
$attrs: import("vue").Attrs;
|
|
150
|
+
$refs: {
|
|
151
|
+
[x: string]: unknown;
|
|
152
|
+
};
|
|
153
|
+
$slots: Readonly<{
|
|
154
|
+
[name: string]: import("vue").Slot<any> | undefined;
|
|
155
|
+
}>;
|
|
156
|
+
$root: import("vue").ComponentPublicInstance | null;
|
|
157
|
+
$parent: import("vue").ComponentPublicInstance | null;
|
|
158
|
+
$host: Element | null;
|
|
159
|
+
$emit: (event: "update:modelValue", value: import("..").JsonFormModel | undefined) => void;
|
|
160
|
+
$el: any;
|
|
161
|
+
$options: import("vue").ComponentOptionsBase<Readonly<{
|
|
162
|
+
schemas: import("..").JsonFormA2UI_0_8ComponentNode[] | import("..").JsonFormSchema<import("..").JsonFormComponentType<{}>, {}>[];
|
|
163
|
+
adapter?: import("..").JsonFormAdapter;
|
|
164
|
+
model?: import("..").JsonFormModel;
|
|
165
|
+
hideLabel?: boolean;
|
|
166
|
+
hideAsterisk?: boolean;
|
|
167
|
+
showColon?: boolean;
|
|
168
|
+
component?: string | import("vue").Component;
|
|
169
|
+
} & {
|
|
170
|
+
modelValue?: import("..").JsonFormModel | undefined;
|
|
171
|
+
}> & Readonly<{
|
|
172
|
+
"onUpdate:modelValue"?: ((value: import("..").JsonFormModel | undefined) => any) | undefined;
|
|
173
|
+
}>, {
|
|
174
|
+
validate: (callback?: ((errors: undefined | Record<string, import("..").ValidatedError>) => void) | undefined) => Promise<Record<string, import("..").ValidatedError> | undefined> | undefined;
|
|
175
|
+
validateField: (field: string | string[], callback?: ((errors: undefined | Record<string, import("..").ValidatedError>) => void) | undefined) => Promise<Record<string, import("..").ValidatedError> | undefined> | undefined;
|
|
176
|
+
resetFields: (field?: string | string[] | undefined) => void | undefined;
|
|
177
|
+
clearValidate: (field?: string | string[] | undefined) => void | undefined;
|
|
178
|
+
setFields: (data: Record<string, import("../form/interface").FieldData>) => void | undefined;
|
|
179
|
+
scrollToField: (field: string) => void | undefined;
|
|
180
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
181
|
+
"update:modelValue": (value: import("..").JsonFormModel | undefined) => any;
|
|
182
|
+
}, string, {
|
|
183
|
+
component: string | import("vue").Component;
|
|
184
|
+
showColon: boolean;
|
|
185
|
+
hideLabel: boolean;
|
|
186
|
+
hideAsterisk: boolean;
|
|
187
|
+
model: import("..").JsonFormModel;
|
|
188
|
+
adapter: import("..").JsonFormAdapter;
|
|
189
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
|
|
190
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
191
|
+
created?: (() => void) | (() => void)[];
|
|
192
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
193
|
+
mounted?: (() => void) | (() => void)[];
|
|
194
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
195
|
+
updated?: (() => void) | (() => void)[];
|
|
196
|
+
activated?: (() => void) | (() => void)[];
|
|
197
|
+
deactivated?: (() => void) | (() => void)[];
|
|
198
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
199
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
200
|
+
destroyed?: (() => void) | (() => void)[];
|
|
201
|
+
unmounted?: (() => void) | (() => void)[];
|
|
202
|
+
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
203
|
+
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
204
|
+
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
205
|
+
};
|
|
206
|
+
$forceUpdate: () => void;
|
|
207
|
+
$nextTick: typeof nextTick;
|
|
208
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
|
|
209
|
+
} & Readonly<{
|
|
210
|
+
component: string | import("vue").Component;
|
|
211
|
+
showColon: boolean;
|
|
212
|
+
hideLabel: boolean;
|
|
213
|
+
hideAsterisk: boolean;
|
|
214
|
+
model: import("..").JsonFormModel;
|
|
215
|
+
adapter: import("..").JsonFormAdapter;
|
|
216
|
+
}> & Omit<Readonly<{
|
|
217
|
+
schemas: import("..").JsonFormA2UI_0_8ComponentNode[] | import("..").JsonFormSchema<import("..").JsonFormComponentType<{}>, {}>[];
|
|
218
|
+
adapter?: import("..").JsonFormAdapter;
|
|
219
|
+
model?: import("..").JsonFormModel;
|
|
220
|
+
hideLabel?: boolean;
|
|
221
|
+
hideAsterisk?: boolean;
|
|
222
|
+
showColon?: boolean;
|
|
223
|
+
component?: string | import("vue").Component;
|
|
224
|
+
} & {
|
|
225
|
+
modelValue?: import("..").JsonFormModel | undefined;
|
|
226
|
+
}> & Readonly<{
|
|
227
|
+
"onUpdate:modelValue"?: ((value: import("..").JsonFormModel | undefined) => any) | undefined;
|
|
228
|
+
}>, "validate" | "validateField" | "resetFields" | "clearValidate" | "setFields" | "scrollToField" | ("component" | "showColon" | "hideLabel" | "hideAsterisk" | "model" | "adapter")> & {
|
|
229
|
+
validate: (callback?: ((errors: undefined | Record<string, import("..").ValidatedError>) => void) | undefined) => Promise<Record<string, import("..").ValidatedError> | undefined> | undefined;
|
|
230
|
+
validateField: (field: string | string[], callback?: ((errors: undefined | Record<string, import("..").ValidatedError>) => void) | undefined) => Promise<Record<string, import("..").ValidatedError> | undefined> | undefined;
|
|
231
|
+
resetFields: (field?: string | string[] | undefined) => void | undefined;
|
|
232
|
+
clearValidate: (field?: string | string[] | undefined) => void | undefined;
|
|
233
|
+
setFields: (data: Record<string, import("../form/interface").FieldData>) => void | undefined;
|
|
234
|
+
scrollToField: (field: string) => void | undefined;
|
|
235
|
+
} & {} & import("vue").ComponentCustomProperties & {} & {
|
|
236
|
+
$slots: {
|
|
237
|
+
[x: string]: ((props: {
|
|
238
|
+
[x: string]: unknown;
|
|
239
|
+
}) => any) | undefined;
|
|
240
|
+
} & {
|
|
241
|
+
default?: (props: {}) => any;
|
|
242
|
+
};
|
|
243
|
+
}) | undefined>;
|
|
244
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
245
|
+
success: (result: unknown, context: BasicCrudTableModalSubmitContext<TableData>) => any;
|
|
246
|
+
error: (error: unknown) => any;
|
|
247
|
+
close: () => any;
|
|
248
|
+
"update:visible": (value: boolean) => any;
|
|
249
|
+
"update:model": (value: UnknownRecord) => any;
|
|
250
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
251
|
+
onSuccess?: ((result: unknown, context: BasicCrudTableModalSubmitContext<TableData>) => any) | undefined;
|
|
252
|
+
onError?: ((error: unknown) => any) | undefined;
|
|
253
|
+
onClose?: (() => any) | undefined;
|
|
254
|
+
"onUpdate:visible"?: ((value: boolean) => any) | undefined;
|
|
255
|
+
"onUpdate:model"?: ((value: UnknownRecord) => any) | undefined;
|
|
256
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
257
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
258
|
+
declare const _default: typeof __VLS_export;
|
|
259
|
+
export default _default;
|
|
260
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
261
|
+
new (): {
|
|
262
|
+
$slots: S;
|
|
263
|
+
};
|
|
264
|
+
};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/objectSpread2.js";
|
|
2
|
+
import { _asyncToGenerator } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/asyncToGenerator.js";
|
|
3
|
+
import JsonForm from "../json-form/index.js";
|
|
4
|
+
import Modal from "../modal/index.js";
|
|
5
|
+
import { computed, createBlock, createSlots, createVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, nextTick, normalizeProps, openBlock, renderList, renderSlot, shallowRef, unref, useModel, useSlots, withCtx } from "vue";
|
|
6
|
+
import { cloneDeep } from "es-toolkit";
|
|
7
|
+
//#region components/basic-crud-table/basic-crud-modal.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
+
var basic_crud_modal_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, { name: "BasicCrudModal" }), {}, {
|
|
9
|
+
__name: "basic-crud-modal",
|
|
10
|
+
props: /*@__PURE__*/ mergeModels({
|
|
11
|
+
modalProps: { default: () => ({}) },
|
|
12
|
+
modalFormProps: { default: () => ({ schemas: [] }) },
|
|
13
|
+
createApi: { type: Function },
|
|
14
|
+
updateApi: { type: Function },
|
|
15
|
+
detailApi: { type: Function },
|
|
16
|
+
valueTransformer: { type: Function },
|
|
17
|
+
beforeSubmit: { type: Function }
|
|
18
|
+
}, {
|
|
19
|
+
"visible": _objectSpread2({ type: Boolean }, { default: false }),
|
|
20
|
+
"visibleModifiers": {},
|
|
21
|
+
"model": { default: () => ({}) },
|
|
22
|
+
"modelModifiers": {}
|
|
23
|
+
}),
|
|
24
|
+
emits: /*@__PURE__*/ mergeModels([
|
|
25
|
+
"success",
|
|
26
|
+
"close",
|
|
27
|
+
"error"
|
|
28
|
+
], ["update:visible", "update:model"]),
|
|
29
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
30
|
+
const emit = __emit;
|
|
31
|
+
const visible = useModel(__props, "visible");
|
|
32
|
+
const model = useModel(__props, "model");
|
|
33
|
+
const slots = useSlots();
|
|
34
|
+
const formRef = shallowRef();
|
|
35
|
+
const type = shallowRef("create");
|
|
36
|
+
const editingRow = shallowRef();
|
|
37
|
+
const initialModel = shallowRef(cloneDeep(model.value));
|
|
38
|
+
const resolvedTitle = computed(() => type.value === "create" ? "创建" : "编辑");
|
|
39
|
+
const slotContext = computed(() => ({
|
|
40
|
+
type: type.value,
|
|
41
|
+
row: editingRow.value,
|
|
42
|
+
model: model.value
|
|
43
|
+
}));
|
|
44
|
+
const formSlotNames = computed(() => Object.keys(slots).filter((name) => !["title", "footer"].includes(name)));
|
|
45
|
+
function open(_x) {
|
|
46
|
+
return _open.apply(this, arguments);
|
|
47
|
+
}
|
|
48
|
+
function _open() {
|
|
49
|
+
_open = _asyncToGenerator(function* (row) {
|
|
50
|
+
var _formRef$value;
|
|
51
|
+
type.value = row ? "edit" : "create";
|
|
52
|
+
editingRow.value = row;
|
|
53
|
+
model.value = cloneDeep(initialModel.value);
|
|
54
|
+
if (row) try {
|
|
55
|
+
const detail = __props.detailApi ? yield __props.detailApi(row) : cloneDeep(_objectSpread2({}, row));
|
|
56
|
+
model.value = __props.valueTransformer ? __props.valueTransformer(detail) : detail;
|
|
57
|
+
} catch (error) {
|
|
58
|
+
emit("error", error);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
visible.value = true;
|
|
62
|
+
yield nextTick();
|
|
63
|
+
(_formRef$value = formRef.value) === null || _formRef$value === void 0 || _formRef$value.clearValidate();
|
|
64
|
+
});
|
|
65
|
+
return _open.apply(this, arguments);
|
|
66
|
+
}
|
|
67
|
+
function handleBeforeOk() {
|
|
68
|
+
return _handleBeforeOk.apply(this, arguments);
|
|
69
|
+
}
|
|
70
|
+
function _handleBeforeOk() {
|
|
71
|
+
_handleBeforeOk = _asyncToGenerator(function* () {
|
|
72
|
+
var _formRef$value2;
|
|
73
|
+
if (yield (_formRef$value2 = formRef.value) === null || _formRef$value2 === void 0 ? void 0 : _formRef$value2.validate()) return false;
|
|
74
|
+
const context = {
|
|
75
|
+
type: type.value,
|
|
76
|
+
row: editingRow.value,
|
|
77
|
+
model: model.value
|
|
78
|
+
};
|
|
79
|
+
if (__props.beforeSubmit && (yield __props.beforeSubmit(context)) === false) return false;
|
|
80
|
+
try {
|
|
81
|
+
const api = type.value === "create" ? __props.createApi : __props.updateApi;
|
|
82
|
+
emit("success", api ? yield api(model.value) : void 0, context);
|
|
83
|
+
return true;
|
|
84
|
+
} catch (error) {
|
|
85
|
+
emit("error", error);
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
return _handleBeforeOk.apply(this, arguments);
|
|
90
|
+
}
|
|
91
|
+
function handleClose() {
|
|
92
|
+
var _formRef$value3, _formRef$value4;
|
|
93
|
+
model.value = cloneDeep(initialModel.value);
|
|
94
|
+
editingRow.value = void 0;
|
|
95
|
+
type.value = "create";
|
|
96
|
+
(_formRef$value3 = formRef.value) === null || _formRef$value3 === void 0 || _formRef$value3.resetFields();
|
|
97
|
+
(_formRef$value4 = formRef.value) === null || _formRef$value4 === void 0 || _formRef$value4.clearValidate();
|
|
98
|
+
emit("close");
|
|
99
|
+
}
|
|
100
|
+
__expose({
|
|
101
|
+
open,
|
|
102
|
+
type: computed(() => type.value),
|
|
103
|
+
formRef
|
|
104
|
+
});
|
|
105
|
+
return (_ctx, _cache) => {
|
|
106
|
+
return openBlock(), createBlock(unref(Modal), mergeProps({
|
|
107
|
+
visible: visible.value,
|
|
108
|
+
"onUpdate:visible": _cache[1] || (_cache[1] = ($event) => visible.value = $event)
|
|
109
|
+
}, __props.modalProps, {
|
|
110
|
+
title: resolvedTitle.value,
|
|
111
|
+
"on-before-ok": handleBeforeOk,
|
|
112
|
+
onClose: handleClose
|
|
113
|
+
}), createSlots({
|
|
114
|
+
default: withCtx(() => [createVNode(unref(JsonForm), mergeProps({
|
|
115
|
+
ref_key: "formRef",
|
|
116
|
+
ref: formRef,
|
|
117
|
+
modelValue: model.value,
|
|
118
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event)
|
|
119
|
+
}, __props.modalFormProps), createSlots({ _: 2 }, [renderList(formSlotNames.value, (name) => {
|
|
120
|
+
return {
|
|
121
|
+
name,
|
|
122
|
+
fn: withCtx((data) => [renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(_objectSpread2(_objectSpread2({}, data), slotContext.value))))])
|
|
123
|
+
};
|
|
124
|
+
})]), 1040, ["modelValue"])]),
|
|
125
|
+
_: 2
|
|
126
|
+
}, [_ctx.$slots.title ? {
|
|
127
|
+
name: "title",
|
|
128
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "title", normalizeProps(guardReactiveProps(slotContext.value)))]),
|
|
129
|
+
key: "0"
|
|
130
|
+
} : void 0, _ctx.$slots.footer ? {
|
|
131
|
+
name: "footer",
|
|
132
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "footer", normalizeProps(guardReactiveProps(slotContext.value)))]),
|
|
133
|
+
key: "1"
|
|
134
|
+
} : void 0]), 1040, ["visible", "title"]);
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
}));
|
|
138
|
+
//#endregion
|
|
139
|
+
export { basic_crud_modal_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import basic_crud_table_vue_vue_type_script_setup_true_lang_default from "./basic-crud-table.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
//#region components/basic-crud-table/basic-crud-table.vue
|
|
3
|
+
var basic_crud_table_default = basic_crud_table_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { basic_crud_table_default as default };
|