knt-shared 1.4.2 → 1.4.4
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/components/Form/BasicForm.vue.d.ts.map +1 -1
- package/dist/components/Table/BasicTable.vue.d.ts +1 -1
- package/dist/components/Table/hooks/useTableEdit.d.ts +1 -1
- package/dist/components/Table/hooks/useTableEdit.d.ts.map +1 -1
- package/dist/index.cjs.js +28 -11
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +28 -11
- package/dist/index.esm.js.map +1 -1
- package/dist/style.css +55 -55
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BasicForm.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Form/BasicForm.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BasicForm.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Form/BasicForm.vue"],"names":[],"mappings":"AA8FA;AAcA,OAAO,KAAK,EAAC,UAAU,EAAE,cAAc,EAAiB,MAAM,SAAS,CAAC;AAqdxE,iBAAS,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAoU+D,GAAG;qBAE1D,GAAG;EAGjC;AAyBD,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;0BAxmBc;QACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC5B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC9B;;;;;;;;;;;;;;;;;;;;;;;;;;0BAhG4B,UAAU;mCAMD,UAAU;;;;;;;;;;;iCAoCZ,UAAU;0BA6FnB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;6BAKd,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;;4BA4BpB,MAAM,GAAG,MAAM,EAAE;2BAKlB,OAAO,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,EAA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KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
|
|
@@ -93,7 +93,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
93
93
|
saveEdit: (record: TableData) => Promise<boolean>;
|
|
94
94
|
cancelEdit: (record: TableData) => void;
|
|
95
95
|
deleteRow: (record: TableData) => Promise<void>;
|
|
96
|
-
addRow: () => Promise<void>;
|
|
96
|
+
addRow: (position?: "top" | "bottom") => Promise<void>;
|
|
97
97
|
getEditingRows: () => TableData[];
|
|
98
98
|
saveAllEdits: () => Promise<boolean>;
|
|
99
99
|
cancelAllEdits: () => void;
|
|
@@ -18,7 +18,7 @@ export declare function useTableEdit(props: ComputedRef<BasicTableProps>, dataSo
|
|
|
18
18
|
saveEdit: (record: TableData) => Promise<boolean>;
|
|
19
19
|
cancelEdit: (record: TableData) => void;
|
|
20
20
|
deleteRow: (record: TableData) => Promise<void>;
|
|
21
|
-
addRow: () => Promise<void>;
|
|
21
|
+
addRow: (position?: "top" | "bottom") => Promise<void>;
|
|
22
22
|
getEditingRows: () => TableData[];
|
|
23
23
|
saveAllEdits: () => Promise<boolean>;
|
|
24
24
|
cancelAllEdits: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTableEdit.d.ts","sourceRoot":"","sources":["../../../../src/components/Table/hooks/useTableEdit.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAmB,MAAM,UAAU,CAAC;AAG9E;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,WAAW,CAAC,eAAe,CAAC,EACnC,UAAU,EAAE,GAAG,CA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+1779,7 @@ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1779
1779
|
};
|
|
1780
1780
|
}
|
|
1781
1781
|
});
|
|
1782
|
-
const VideoPreview = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-
|
|
1782
|
+
const VideoPreview = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-e8cbf700"]]);
|
|
1783
1783
|
const _hoisted_1$6 = { class: "video-modal-title" };
|
|
1784
1784
|
const _hoisted_2$5 = { class: "file-name" };
|
|
1785
1785
|
const _hoisted_3$3 = { class: "video-modal-content" };
|
|
@@ -1937,7 +1937,7 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1937
1937
|
emits: ["register", "update:modelValue", "change", "success", "handleSuccess", "error", "handlError", "progress", "remove", "preview", "exceed", "sortChange"],
|
|
1938
1938
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
1939
1939
|
vue.useCssVars((_ctx) => ({
|
|
1940
|
-
"
|
|
1940
|
+
"v5e570a54": cardSizeValue.value
|
|
1941
1941
|
}));
|
|
1942
1942
|
const props = __props;
|
|
1943
1943
|
const emit = __emit;
|
|
@@ -1992,13 +1992,13 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1992
1992
|
});
|
|
1993
1993
|
const isVideoFile = (fileItem) => {
|
|
1994
1994
|
var _a, _b;
|
|
1995
|
-
if (!fileItem.url && !fileItem.
|
|
1996
|
-
const fileName = fileItem.name || ((_a = fileItem.
|
|
1995
|
+
if (!fileItem.url && !fileItem.originFileObj) return false;
|
|
1996
|
+
const fileName = fileItem.name || ((_a = fileItem.originFileObj) == null ? void 0 : _a.name) || "";
|
|
1997
1997
|
const videoExtensions = [".mp4", ".avi", ".mov", ".wmv", ".flv", ".mkv", ".webm", ".m4v"];
|
|
1998
1998
|
const hasVideoExtension = videoExtensions.some(
|
|
1999
1999
|
(ext) => fileName.toLowerCase().endsWith(ext)
|
|
2000
2000
|
);
|
|
2001
|
-
const mimeType = ((_b = fileItem.
|
|
2001
|
+
const mimeType = ((_b = fileItem.originFileObj) == null ? void 0 : _b.type) || "";
|
|
2002
2002
|
const isVideoMimeType = mimeType.startsWith("video/");
|
|
2003
2003
|
return hasVideoExtension || isVideoMimeType;
|
|
2004
2004
|
};
|
|
@@ -2548,7 +2548,7 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
2548
2548
|
};
|
|
2549
2549
|
}
|
|
2550
2550
|
});
|
|
2551
|
-
const BasicUpload = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-
|
|
2551
|
+
const BasicUpload = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-640a0bf9"]]);
|
|
2552
2552
|
function useUpload(props) {
|
|
2553
2553
|
const uploadRef = vue.ref(null);
|
|
2554
2554
|
const fileListRef = vue.ref((props == null ? void 0 : props.defaultFileList) || []);
|
|
@@ -2947,7 +2947,9 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
2947
2947
|
const removeSchema = (field) => {
|
|
2948
2948
|
const fields = Array.isArray(field) ? field : [field];
|
|
2949
2949
|
fields.forEach((f) => {
|
|
2950
|
-
const index = internalSchemas.value.findIndex(
|
|
2950
|
+
const index = internalSchemas.value.findIndex(
|
|
2951
|
+
(s) => s.field === f
|
|
2952
|
+
);
|
|
2951
2953
|
if (index !== -1) {
|
|
2952
2954
|
internalSchemas.value.splice(index, 1);
|
|
2953
2955
|
delete formModel[f];
|
|
@@ -3040,7 +3042,9 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
3040
3042
|
const _component_a_tooltip = vue.resolveComponent("a-tooltip");
|
|
3041
3043
|
const _component_a_form_item = vue.resolveComponent("a-form-item");
|
|
3042
3044
|
const _component_a_col = vue.resolveComponent("a-col");
|
|
3045
|
+
const _component_icon_search = vue.resolveComponent("icon-search");
|
|
3043
3046
|
const _component_a_button = vue.resolveComponent("a-button");
|
|
3047
|
+
const _component_icon_refresh = vue.resolveComponent("icon-refresh");
|
|
3044
3048
|
const _component_a_space = vue.resolveComponent("a-space");
|
|
3045
3049
|
const _component_a_row = vue.resolveComponent("a-row");
|
|
3046
3050
|
const _component_a_form = vue.resolveComponent("a-form");
|
|
@@ -3118,8 +3122,11 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
3118
3122
|
"html-type": "submit",
|
|
3119
3123
|
loading: submitLoading.value
|
|
3120
3124
|
}, {
|
|
3125
|
+
icon: vue.withCtx(() => [
|
|
3126
|
+
vue.createVNode(_component_icon_search)
|
|
3127
|
+
]),
|
|
3121
3128
|
default: vue.withCtx(() => [
|
|
3122
|
-
vue.createTextVNode(vue.toDisplayString(getActionProps.value.submitButtonText), 1)
|
|
3129
|
+
vue.createTextVNode(" " + vue.toDisplayString(getActionProps.value.submitButtonText), 1)
|
|
3123
3130
|
]),
|
|
3124
3131
|
_: 1
|
|
3125
3132
|
}, 8, ["loading"])) : vue.createCommentVNode("", true),
|
|
@@ -3127,8 +3134,11 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
3127
3134
|
key: 1,
|
|
3128
3135
|
onClick: handleReset
|
|
3129
3136
|
}, {
|
|
3137
|
+
icon: vue.withCtx(() => [
|
|
3138
|
+
vue.createVNode(_component_icon_refresh)
|
|
3139
|
+
]),
|
|
3130
3140
|
default: vue.withCtx(() => [
|
|
3131
|
-
vue.createTextVNode(vue.toDisplayString(getActionProps.value.resetButtonText), 1)
|
|
3141
|
+
vue.createTextVNode(" " + vue.toDisplayString(getActionProps.value.resetButtonText), 1)
|
|
3132
3142
|
]),
|
|
3133
3143
|
_: 1
|
|
3134
3144
|
})) : vue.createCommentVNode("", true),
|
|
@@ -3812,6 +3822,9 @@ function useTableEdit(props, dataSource, getRowKey) {
|
|
|
3812
3822
|
if (editValueMap[recordKey] && columnKey in editValueMap[recordKey]) {
|
|
3813
3823
|
return editValueMap[recordKey][columnKey];
|
|
3814
3824
|
}
|
|
3825
|
+
if (column.editDefaultValue) {
|
|
3826
|
+
return column.editDefaultValue;
|
|
3827
|
+
}
|
|
3815
3828
|
if (column.editValueGetter) {
|
|
3816
3829
|
return column.editValueGetter(record);
|
|
3817
3830
|
}
|
|
@@ -3985,7 +3998,7 @@ function useTableEdit(props, dataSource, getRowKey) {
|
|
|
3985
3998
|
delete validationErrorMap[recordKey];
|
|
3986
3999
|
webVue.Message.success("删除成功");
|
|
3987
4000
|
};
|
|
3988
|
-
const addRow = async () => {
|
|
4001
|
+
const addRow = async (position = "bottom") => {
|
|
3989
4002
|
let newRecord = {};
|
|
3990
4003
|
if (editConfig.value.onAdd) {
|
|
3991
4004
|
try {
|
|
@@ -4000,7 +4013,11 @@ function useTableEdit(props, dataSource, getRowKey) {
|
|
|
4000
4013
|
if (typeof rowKey === "string" && !newRecord[rowKey]) {
|
|
4001
4014
|
newRecord[rowKey] = `temp_${Date.now()}_${Math.random()}`;
|
|
4002
4015
|
}
|
|
4003
|
-
|
|
4016
|
+
if (position === "top") {
|
|
4017
|
+
dataSource.value.unshift(newRecord);
|
|
4018
|
+
} else {
|
|
4019
|
+
dataSource.value.push(newRecord);
|
|
4020
|
+
}
|
|
4004
4021
|
startEdit(newRecord);
|
|
4005
4022
|
};
|
|
4006
4023
|
const getEditingRows = () => {
|