@sdata/web-vue 3.16.0 → 3.16.1
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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { configProviderInjectionKey } from "../config-provider/context.js";
|
|
1
2
|
import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/objectSpread2.js";
|
|
2
3
|
import { getPrefixCls } from "../_utils/global-config.js";
|
|
3
4
|
import { isPromise } from "../_utils/is.js";
|
|
@@ -10,7 +11,7 @@ import Space from "../space/index.js";
|
|
|
10
11
|
import Table from "../table/index.js";
|
|
11
12
|
import Toolbar from "../toolbar/index.js";
|
|
12
13
|
import basic_crud_modal_default from "./basic-crud-modal.js";
|
|
13
|
-
import { computed, createBlock, createCommentVNode, createElementBlock, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, onMounted, openBlock, ref, renderList, renderSlot, shallowRef, toDisplayString, unref, useModel, useSlots, withCtx } from "vue";
|
|
14
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, inject, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, onMounted, openBlock, ref, renderList, renderSlot, shallowRef, toDisplayString, unref, useModel, useSlots, withCtx } from "vue";
|
|
14
15
|
import { isFunction, isNil, isString, omitBy } from "es-toolkit";
|
|
15
16
|
//#region components/basic-crud-table/basic-crud-table.vue?vue&type=script&setup=true&lang.ts
|
|
16
17
|
var _hoisted_1 = ["aria-busy"];
|
|
@@ -119,6 +120,7 @@ var basic_crud_table_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
119
120
|
const modalModel = useModel(__props, "modalModel");
|
|
120
121
|
const modalVisible = useModel(__props, "modalVisible");
|
|
121
122
|
const slots = useSlots();
|
|
123
|
+
const configProvider = inject(configProviderInjectionKey, void 0);
|
|
122
124
|
const toolbarRef = shallowRef();
|
|
123
125
|
const modalRef = shallowRef();
|
|
124
126
|
const current = shallowRef(resolvePaginationNumber("current", "defaultCurrent", 1));
|
|
@@ -162,9 +164,17 @@ var basic_crud_table_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
162
164
|
return Object.keys(slots).filter((name) => name.startsWith(prefix)).map((name) => name.slice(prefix.length)).filter((name) => !excluded.includes(name));
|
|
163
165
|
}
|
|
164
166
|
function resolvePaginationNumber(controlled, initial, fallback) {
|
|
165
|
-
var _ref, _pagination$controlle;
|
|
166
167
|
const pagination = __props.tableProps.pagination;
|
|
167
|
-
|
|
168
|
+
if (typeof pagination === "object") {
|
|
169
|
+
var _pagination$controlle;
|
|
170
|
+
const localValue = (_pagination$controlle = pagination[controlled]) !== null && _pagination$controlle !== void 0 ? _pagination$controlle : pagination[initial];
|
|
171
|
+
if (localValue !== void 0) return Number(localValue);
|
|
172
|
+
}
|
|
173
|
+
if (initial === "defaultPageSize") {
|
|
174
|
+
var _configProvider$pagin, _configProvider$pagin2;
|
|
175
|
+
return Number((_configProvider$pagin = configProvider === null || configProvider === void 0 || (_configProvider$pagin2 = configProvider.pagination) === null || _configProvider$pagin2 === void 0 ? void 0 : _configProvider$pagin2.defaultPageSize) !== null && _configProvider$pagin !== void 0 ? _configProvider$pagin : fallback);
|
|
176
|
+
}
|
|
177
|
+
return fallback;
|
|
168
178
|
}
|
|
169
179
|
function isObjectResult(value) {
|
|
170
180
|
return !!value && typeof value === "object" && Array.isArray(value.data);
|
|
@@ -185,9 +195,9 @@ var basic_crud_table_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
185
195
|
tableData.value = result;
|
|
186
196
|
total.value = result.length;
|
|
187
197
|
} else if (isObjectResult(result)) {
|
|
188
|
-
var
|
|
198
|
+
var _ref, _result$total;
|
|
189
199
|
tableData.value = result.data;
|
|
190
|
-
total.value = (
|
|
200
|
+
total.value = (_ref = (_result$total = result.total) !== null && _result$total !== void 0 ? _result$total : result.count) !== null && _ref !== void 0 ? _ref : result.data.length;
|
|
191
201
|
} else return;
|
|
192
202
|
emit("tableFetched", tableData.value, result);
|
|
193
203
|
} catch (error) {
|
|
@@ -41,7 +41,10 @@ var page_options_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
41
41
|
options: options.value,
|
|
42
42
|
size: __props.size,
|
|
43
43
|
disabled: __props.disabled
|
|
44
|
-
}, __props.selectProps, {
|
|
44
|
+
}, __props.selectProps, {
|
|
45
|
+
"allow-clear": false,
|
|
46
|
+
onChange: handleChange
|
|
47
|
+
}), null, 16, [
|
|
45
48
|
"model-value",
|
|
46
49
|
"options",
|
|
47
50
|
"size",
|
package/json/web-types.json
CHANGED