jky-component-lib 0.0.60 → 0.0.64
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/es/components.d.ts +1 -0
- package/dist/es/components.js +4 -1
- package/dist/es/form/Form.vue.d.ts +1 -1
- package/dist/es/form/Form.vue.js +64 -10
- package/dist/es/form/FormItem.vue.js +21 -11
- package/dist/es/index.js +2 -0
- package/dist/es/package.json.js +1 -1
- package/dist/es/page-header/PageHeader.vue.js +1 -1
- package/dist/es/page-header/PopoverMenu.vue.js +1 -1
- package/dist/es/page-layout/PageLayout.vue.d.ts +36 -0
- package/dist/es/page-layout/PageLayout.vue.js +152 -0
- package/dist/es/page-layout/PageLayout.vue3.js +5 -0
- package/dist/es/page-layout/index.d.ts +4 -0
- package/dist/es/page-layout/index.js +8 -0
- package/dist/es/page-layout/style.css +8 -0
- package/dist/es/page-table/PageTable.vue.d.ts +22 -270
- package/dist/es/page-table/PageTable.vue.js +148 -118
- package/dist/es/page-table/Toolbar.vue.d.ts +1 -0
- package/dist/es/page-table/Toolbar.vue.js +40 -13
- package/dist/es/page-table/style.css +1 -3
- package/dist/es/rich-editor/RichEditor.vue.js +1 -1
- package/dist/es/style.css +334 -58
- package/dist/es/styles.css +1 -1
- package/dist/lib/components.d.ts +1 -0
- package/dist/lib/components.js +12 -9
- package/dist/lib/form/Form.vue.d.ts +1 -1
- package/dist/lib/form/Form.vue.js +63 -9
- package/dist/lib/form/FormItem.vue.js +21 -11
- package/dist/lib/index.js +8 -6
- package/dist/lib/package.json.js +1 -1
- package/dist/lib/page-header/PageHeader.vue.js +2 -2
- package/dist/lib/page-header/PopoverMenu.vue.js +1 -1
- package/dist/lib/page-layout/PageLayout.vue.d.ts +36 -0
- package/dist/lib/page-layout/PageLayout.vue.js +152 -0
- package/dist/lib/page-layout/PageLayout.vue3.js +5 -0
- package/dist/lib/page-layout/index.d.ts +4 -0
- package/dist/lib/page-layout/index.js +8 -0
- package/dist/lib/page-layout/style.css +8 -0
- package/dist/lib/page-table/PageTable.vue.d.ts +22 -270
- package/dist/lib/page-table/PageTable.vue.js +146 -116
- package/dist/lib/page-table/Toolbar.vue.d.ts +1 -0
- package/dist/lib/page-table/Toolbar.vue.js +38 -11
- package/dist/lib/page-table/style.css +1 -3
- package/dist/lib/rich-editor/RichEditor.vue.js +2 -2
- package/dist/lib/style.css +334 -58
- package/dist/lib/styles.css +1 -1
- package/package.json +1 -1
- package/dist/es/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/ScriptLoader.js +0 -52
- package/dist/es/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/TinyMCE.js +0 -10
- package/dist/es/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/Utils.js +0 -145
- package/dist/es/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/components/Editor.js +0 -160
- package/dist/es/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/components/EditorPropTypes.js +0 -26
- package/dist/es/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/index.js +0 -4
- package/dist/lib/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/ScriptLoader.js +0 -52
- package/dist/lib/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/TinyMCE.js +0 -10
- package/dist/lib/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/Utils.js +0 -145
- package/dist/lib/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/components/Editor.js +0 -160
- package/dist/lib/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/components/EditorPropTypes.js +0 -26
- package/dist/lib/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/index.js +0 -4
|
@@ -39,28 +39,22 @@ var __async = (__this, __arguments, generator) => {
|
|
|
39
39
|
});
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
42
|
-
const es = require("element-plus/es");
|
|
43
|
-
require("element-plus/es/components/base/style/css");
|
|
44
|
-
require("element-plus/es/components/loading/style/css");
|
|
45
|
-
require("element-plus/es/components/button/style/css");
|
|
46
42
|
const vue = require("vue");
|
|
43
|
+
const core = require("@vueuse/core");
|
|
47
44
|
const ElementPlus = require("element-plus");
|
|
48
45
|
const index = require("../form/index.js");
|
|
49
46
|
const Toolbar_vue_vue_type_script_setup_true_lang = require("./Toolbar.vue.js");
|
|
50
47
|
;/* empty css */
|
|
51
48
|
const _hoisted_1 = { class: "jky-page-table__filter-actions" };
|
|
52
|
-
const _hoisted_2 = {
|
|
53
|
-
key: 0,
|
|
54
|
-
class: "flex flex-end mt-4 jky-page-table__pagination"
|
|
55
|
-
};
|
|
56
49
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValues({}, {
|
|
57
50
|
name: "JkyPageTable"
|
|
58
51
|
}), {
|
|
59
52
|
__name: "PageTable",
|
|
60
|
-
props: {
|
|
53
|
+
props: /* @__PURE__ */ vue.mergeModels({
|
|
54
|
+
withCard: { type: Boolean, default: true },
|
|
61
55
|
title: { default: "" },
|
|
62
56
|
filterItems: { default: () => [] },
|
|
63
|
-
|
|
57
|
+
form: {},
|
|
64
58
|
columns: {},
|
|
65
59
|
dataSource: {},
|
|
66
60
|
showSearchButton: { type: Boolean, default: true },
|
|
@@ -75,121 +69,142 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
75
69
|
maxHeight: {},
|
|
76
70
|
emptyText: { default: "暂无数据" },
|
|
77
71
|
loading: { type: Boolean, default: false },
|
|
78
|
-
className: {
|
|
72
|
+
className: {},
|
|
79
73
|
formProps: { default: () => ({}) },
|
|
80
74
|
tableProps: { default: () => ({}) },
|
|
81
75
|
paginationProps: { default: () => ({}) },
|
|
82
76
|
toolbarButtonLimit: { default: 0 },
|
|
83
77
|
toolbarButtons: {}
|
|
84
|
-
},
|
|
85
|
-
|
|
78
|
+
}, {
|
|
79
|
+
"form": {
|
|
80
|
+
default: () => ({})
|
|
81
|
+
},
|
|
82
|
+
"formModifiers": {},
|
|
83
|
+
"pagination": {
|
|
84
|
+
default: () => ({
|
|
85
|
+
currentPage: 1,
|
|
86
|
+
pageSize: 10,
|
|
87
|
+
total: 0
|
|
88
|
+
})
|
|
89
|
+
},
|
|
90
|
+
"paginationModifiers": {}
|
|
91
|
+
}),
|
|
92
|
+
emits: /* @__PURE__ */ vue.mergeModels(["search", "reset", "refresh", "rowClick", "rowDblclick", "selectionChange", "pageChange", "sortChange"], ["update:form", "update:pagination"]),
|
|
86
93
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
87
|
-
var _a, _b, _c;
|
|
88
94
|
const props = __props;
|
|
89
95
|
const emit = __emit;
|
|
90
|
-
const
|
|
96
|
+
const form = vue.useModel(__props, "form");
|
|
97
|
+
const pagination = vue.useModel(__props, "pagination");
|
|
91
98
|
const internalData = vue.ref([]);
|
|
92
|
-
const internalPagination = vue.ref({
|
|
93
|
-
currentPage: ((_a = props.pagination) == null ? void 0 : _a.currentPage) || 1,
|
|
94
|
-
pageSize: ((_b = props.pagination) == null ? void 0 : _b.pageSize) || 10,
|
|
95
|
-
total: ((_c = props.pagination) == null ? void 0 : _c.total) || 0
|
|
96
|
-
});
|
|
97
99
|
const tableRef = vue.ref(null);
|
|
98
100
|
const formRef = vue.ref(null);
|
|
99
|
-
const paginationRef = vue.ref(null);
|
|
100
101
|
const isLoading = vue.ref(props.loading);
|
|
102
|
+
const pageTableRef = vue.ref(null);
|
|
103
|
+
const { isFullscreen: _isFullscreen, toggle: toggleFullscreen } = core.useFullscreen(pageTableRef);
|
|
104
|
+
function handleRefresh() {
|
|
105
|
+
var _a;
|
|
106
|
+
if ((_a = props.dataSource) == null ? void 0 : _a.api) {
|
|
107
|
+
loadData();
|
|
108
|
+
} else {
|
|
109
|
+
emit("refresh");
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
const defaultRightButtons = vue.computed(() => {
|
|
113
|
+
const refreshButton = {
|
|
114
|
+
label: "刷新",
|
|
115
|
+
icon: "icon-[mdi--refresh]",
|
|
116
|
+
class: "ml-3",
|
|
117
|
+
onClick: handleRefresh
|
|
118
|
+
};
|
|
119
|
+
const fullscreenButton = {
|
|
120
|
+
label: _isFullscreen.value ? "退出全屏" : "全屏",
|
|
121
|
+
icon: _isFullscreen.value ? "icon-[mdi--fullscreen-exit]" : "icon-[mdi--fullscreen]",
|
|
122
|
+
class: "ml-3",
|
|
123
|
+
onClick: () => toggleFullscreen()
|
|
124
|
+
};
|
|
125
|
+
return [refreshButton, fullscreenButton];
|
|
126
|
+
});
|
|
101
127
|
const showPagination = vue.computed(() => {
|
|
102
|
-
var
|
|
103
|
-
return !!((
|
|
128
|
+
var _a, _b;
|
|
129
|
+
return !!((_a = props.dataSource) == null ? void 0 : _a.api) || (((_b = pagination.value) == null ? void 0 : _b.total) || 0) > 0;
|
|
104
130
|
});
|
|
105
131
|
function getColumnProps(column) {
|
|
106
132
|
return __spreadValues({}, column);
|
|
107
133
|
}
|
|
108
|
-
vue.watch(
|
|
109
|
-
() => props.pagination,
|
|
110
|
-
(newPagination) => {
|
|
111
|
-
if (newPagination) {
|
|
112
|
-
internalPagination.value.currentPage = newPagination.currentPage || 1;
|
|
113
|
-
internalPagination.value.pageSize = newPagination.pageSize || 10;
|
|
114
|
-
internalPagination.value.total = newPagination.total || 0;
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
{ deep: true }
|
|
118
|
-
);
|
|
119
134
|
function loadData() {
|
|
120
135
|
return __async(this, null, function* () {
|
|
121
|
-
var
|
|
122
|
-
if (!((
|
|
136
|
+
var _a;
|
|
137
|
+
if (!((_a = props.dataSource) == null ? void 0 : _a.api))
|
|
123
138
|
return;
|
|
124
139
|
isLoading.value = true;
|
|
125
140
|
try {
|
|
126
141
|
const result = yield props.dataSource.api(__spreadValues({
|
|
127
|
-
currentPage:
|
|
128
|
-
pageSize:
|
|
129
|
-
},
|
|
142
|
+
currentPage: pagination.value.currentPage || 1,
|
|
143
|
+
pageSize: pagination.value.pageSize || 10
|
|
144
|
+
}, form.value));
|
|
130
145
|
const responseProps = props.dataSource.responseProps || {};
|
|
131
146
|
const recordsField = responseProps.recordsField || "records";
|
|
132
147
|
const totalField = responseProps.totalField || "total";
|
|
133
148
|
internalData.value = result[recordsField] || [];
|
|
134
|
-
|
|
149
|
+
pagination.value.total = result[totalField] || 0;
|
|
135
150
|
emit("pageChange", {
|
|
136
|
-
currentPage:
|
|
137
|
-
pageSize:
|
|
151
|
+
currentPage: pagination.value.currentPage,
|
|
152
|
+
pageSize: pagination.value.pageSize
|
|
138
153
|
});
|
|
139
154
|
} catch (error) {
|
|
140
155
|
console.error("加载数据失败:", error);
|
|
141
156
|
internalData.value = [];
|
|
142
|
-
|
|
157
|
+
pagination.value.total = 0;
|
|
143
158
|
} finally {
|
|
144
159
|
isLoading.value = false;
|
|
145
160
|
}
|
|
146
161
|
});
|
|
147
162
|
}
|
|
148
163
|
function handleSearch() {
|
|
149
|
-
var
|
|
150
|
-
emit("search", __spreadValues({},
|
|
151
|
-
if ((
|
|
152
|
-
|
|
164
|
+
var _a;
|
|
165
|
+
emit("search", __spreadValues({}, form.value));
|
|
166
|
+
if ((_a = props.dataSource) == null ? void 0 : _a.api) {
|
|
167
|
+
pagination.value.currentPage = 1;
|
|
153
168
|
loadData();
|
|
154
169
|
}
|
|
155
170
|
}
|
|
156
171
|
function handleReset() {
|
|
157
|
-
var
|
|
158
|
-
|
|
172
|
+
var _a;
|
|
173
|
+
form.value = {};
|
|
159
174
|
emit("reset");
|
|
160
175
|
if (formRef.value) {
|
|
161
176
|
formRef.value.resetFields();
|
|
162
177
|
}
|
|
163
|
-
if ((
|
|
164
|
-
|
|
178
|
+
if ((_a = props.dataSource) == null ? void 0 : _a.api) {
|
|
179
|
+
pagination.value.currentPage = 1;
|
|
165
180
|
loadData();
|
|
166
181
|
}
|
|
167
182
|
}
|
|
168
183
|
function handlePageChange(page) {
|
|
169
|
-
var
|
|
170
|
-
|
|
171
|
-
if ((
|
|
184
|
+
var _a;
|
|
185
|
+
pagination.value.currentPage = page;
|
|
186
|
+
if ((_a = props.dataSource) == null ? void 0 : _a.api) {
|
|
172
187
|
loadData();
|
|
173
|
-
} else if (
|
|
174
|
-
|
|
188
|
+
} else if (pagination.value.onPageChange) {
|
|
189
|
+
pagination.value.onPageChange(page);
|
|
175
190
|
}
|
|
176
191
|
emit("pageChange", {
|
|
177
|
-
currentPage:
|
|
178
|
-
pageSize:
|
|
192
|
+
currentPage: pagination.value.currentPage,
|
|
193
|
+
pageSize: pagination.value.pageSize
|
|
179
194
|
});
|
|
180
195
|
}
|
|
181
196
|
function handlePageSizeChange(size) {
|
|
182
|
-
var
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
if ((
|
|
197
|
+
var _a;
|
|
198
|
+
pagination.value.pageSize = size;
|
|
199
|
+
pagination.value.currentPage = 1;
|
|
200
|
+
if ((_a = props.dataSource) == null ? void 0 : _a.api) {
|
|
186
201
|
loadData();
|
|
187
|
-
} else if (
|
|
188
|
-
|
|
202
|
+
} else if (pagination.value.onPageSizeChange) {
|
|
203
|
+
pagination.value.onPageSizeChange(size);
|
|
189
204
|
}
|
|
190
205
|
emit("pageChange", {
|
|
191
|
-
currentPage:
|
|
192
|
-
pageSize:
|
|
206
|
+
currentPage: pagination.value.currentPage,
|
|
207
|
+
pageSize: pagination.value.pageSize
|
|
193
208
|
});
|
|
194
209
|
}
|
|
195
210
|
const selectedCount = vue.ref(0);
|
|
@@ -208,42 +223,44 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
208
223
|
}
|
|
209
224
|
__expose({
|
|
210
225
|
refresh: loadData,
|
|
211
|
-
getFilterData: () => __spreadValues({},
|
|
226
|
+
getFilterData: () => __spreadValues({}, form.value),
|
|
212
227
|
setFilterData: (data) => {
|
|
213
|
-
|
|
228
|
+
form.value = __spreadValues({}, data);
|
|
214
229
|
},
|
|
215
230
|
resetFilter: handleReset,
|
|
216
231
|
getSelectedRows: () => {
|
|
217
|
-
var
|
|
218
|
-
return ((
|
|
232
|
+
var _a;
|
|
233
|
+
return ((_a = tableRef.value) == null ? void 0 : _a.getSelectionRows()) || [];
|
|
219
234
|
},
|
|
220
235
|
clearSelection: () => {
|
|
221
|
-
var
|
|
222
|
-
(
|
|
236
|
+
var _a;
|
|
237
|
+
(_a = tableRef.value) == null ? void 0 : _a.clearSelection();
|
|
223
238
|
},
|
|
224
239
|
toggleRowSelection: (row, selected) => {
|
|
225
|
-
var
|
|
226
|
-
(
|
|
240
|
+
var _a;
|
|
241
|
+
(_a = tableRef.value) == null ? void 0 : _a.toggleRowSelection(row, selected);
|
|
227
242
|
},
|
|
228
243
|
sort: (prop, order) => {
|
|
229
|
-
var
|
|
230
|
-
(
|
|
244
|
+
var _a;
|
|
245
|
+
(_a = tableRef.value) == null ? void 0 : _a.sort(prop, order);
|
|
231
246
|
},
|
|
232
247
|
formRef,
|
|
233
|
-
tableRef
|
|
234
|
-
paginationRef
|
|
248
|
+
tableRef
|
|
235
249
|
});
|
|
236
250
|
vue.onMounted(() => {
|
|
237
|
-
var
|
|
238
|
-
if ((
|
|
251
|
+
var _a;
|
|
252
|
+
if ((_a = props.dataSource) == null ? void 0 : _a.api) {
|
|
239
253
|
loadData();
|
|
240
254
|
}
|
|
241
255
|
});
|
|
242
256
|
return (_ctx, _cache) => {
|
|
243
|
-
|
|
244
|
-
const
|
|
257
|
+
var _a, _b;
|
|
258
|
+
const _component_ElButton = vue.resolveComponent("ElButton");
|
|
259
|
+
const _directive_loading = vue.resolveDirective("loading");
|
|
245
260
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
246
|
-
|
|
261
|
+
ref_key: "pageTableRef",
|
|
262
|
+
ref: pageTableRef,
|
|
263
|
+
class: vue.normalizeClass(["bg-transparent jky-page-table", [props.class]])
|
|
247
264
|
}, [
|
|
248
265
|
__props.filterItems && __props.filterItems.length > 0 ? (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElCard), {
|
|
249
266
|
key: 0,
|
|
@@ -253,12 +270,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
253
270
|
vue.createVNode(vue.unref(index.JkyForm), vue.mergeProps({
|
|
254
271
|
ref_key: "formRef",
|
|
255
272
|
ref: formRef,
|
|
256
|
-
modelValue:
|
|
257
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) =>
|
|
273
|
+
modelValue: form.value,
|
|
274
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => form.value = $event),
|
|
258
275
|
items: __props.filterItems,
|
|
259
276
|
inline: true,
|
|
260
277
|
disabled: isLoading.value
|
|
261
|
-
}, __props.formProps), null, 16, ["modelValue", "items", "disabled"]),
|
|
278
|
+
}, __spreadProps(__spreadValues({}, __props.formProps), { inline: true })), null, 16, ["modelValue", "items", "disabled"]),
|
|
262
279
|
vue.createElementVNode("div", _hoisted_1, [
|
|
263
280
|
vue.createVNode(_component_ElButton, {
|
|
264
281
|
type: "primary",
|
|
@@ -280,25 +297,26 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
280
297
|
]),
|
|
281
298
|
_: 1
|
|
282
299
|
})) : vue.createCommentVNode("", true),
|
|
283
|
-
vue.
|
|
300
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(props.withCard ? vue.unref(ElementPlus.ElCard) : "div"), { class: "jky-page-table__table-card min-h-0" }, {
|
|
284
301
|
default: vue.withCtx(() => {
|
|
285
|
-
var _a2, _b2,
|
|
302
|
+
var _a2, _b2, _c, _d, _e, _f, _g;
|
|
286
303
|
return [
|
|
287
304
|
vue.createVNode(Toolbar_vue_vue_type_script_setup_true_lang.default, {
|
|
288
305
|
"left-buttons": ((_a2 = props.toolbarButtons) == null ? void 0 : _a2.left) || [],
|
|
289
306
|
"batch-buttons": ((_b2 = props.toolbarButtons) == null ? void 0 : _b2.batch) || [],
|
|
290
|
-
"right-buttons": ((
|
|
307
|
+
"right-buttons": ((_c = props.toolbarButtons) == null ? void 0 : _c.right) || [],
|
|
308
|
+
"default-buttons": defaultRightButtons.value,
|
|
291
309
|
"selected-count": selectedCount.value,
|
|
292
310
|
"toolbar-button-limit": __props.toolbarButtonLimit,
|
|
293
311
|
payload: {
|
|
294
|
-
currentPage:
|
|
295
|
-
pageSize:
|
|
296
|
-
total:
|
|
312
|
+
currentPage: ((_d = pagination.value) == null ? void 0 : _d.currentPage) || 1,
|
|
313
|
+
pageSize: ((_e = pagination.value) == null ? void 0 : _e.pageSize) || 10,
|
|
314
|
+
total: ((_f = pagination.value) == null ? void 0 : _f.total) || 0,
|
|
297
315
|
tableData: internalData.value,
|
|
298
|
-
selectedRows: ((
|
|
299
|
-
filterData: __spreadValues({},
|
|
316
|
+
selectedRows: ((_g = tableRef.value) == null ? void 0 : _g.getSelectionRows()) || [],
|
|
317
|
+
filterData: __spreadValues({}, form.value)
|
|
300
318
|
}
|
|
301
|
-
}, null, 8, ["left-buttons", "batch-buttons", "right-buttons", "selected-count", "toolbar-button-limit", "payload"]),
|
|
319
|
+
}, null, 8, ["left-buttons", "batch-buttons", "right-buttons", "default-buttons", "selected-count", "toolbar-button-limit", "payload"]),
|
|
302
320
|
vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElTable), vue.mergeProps({
|
|
303
321
|
ref_key: "tableRef",
|
|
304
322
|
ref: tableRef,
|
|
@@ -347,30 +365,42 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
347
365
|
_: 3
|
|
348
366
|
}, 16, ["data", "border", "stripe", "height", "max-height", "empty-text"])), [
|
|
349
367
|
[_directive_loading, isLoading.value]
|
|
350
|
-
])
|
|
351
|
-
showPagination.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
|
|
352
|
-
vue.createVNode(vue.unref(ElementPlus.ElPagination), vue.mergeProps({
|
|
353
|
-
ref_key: "paginationRef",
|
|
354
|
-
ref: paginationRef,
|
|
355
|
-
"current-page": internalPagination.value.currentPage,
|
|
356
|
-
"onUpdate:currentPage": _cache[1] || (_cache[1] = ($event) => internalPagination.value.currentPage = $event),
|
|
357
|
-
"page-size": internalPagination.value.pageSize,
|
|
358
|
-
"onUpdate:pageSize": _cache[2] || (_cache[2] = ($event) => internalPagination.value.pageSize = $event),
|
|
359
|
-
total: internalPagination.value.total,
|
|
360
|
-
"page-sizes": ((_e = __props.pagination) == null ? void 0 : _e.pageSizes) || [10, 20, 50, 100],
|
|
361
|
-
layout: ((_f = __props.pagination) == null ? void 0 : _f.layout) || "total, sizes, prev, pager, next, jumper",
|
|
362
|
-
"show-size-picker": (_h = (_g = __props.pagination) == null ? void 0 : _g.showSizePicker) != null ? _h : true,
|
|
363
|
-
"show-total": (_j = (_i = __props.pagination) == null ? void 0 : _i.showTotal) != null ? _j : true,
|
|
364
|
-
"show-jumper": (_l = (_k = __props.pagination) == null ? void 0 : _k.showJumper) != null ? _l : true
|
|
365
|
-
}, __props.paginationProps, {
|
|
366
|
-
onSizeChange: handlePageSizeChange,
|
|
367
|
-
onCurrentChange: handlePageChange
|
|
368
|
-
}), null, 16, ["current-page", "page-size", "total", "page-sizes", "layout", "show-size-picker", "show-total", "show-jumper"])
|
|
369
|
-
])) : vue.createCommentVNode("", true)
|
|
368
|
+
])
|
|
370
369
|
];
|
|
371
370
|
}),
|
|
372
371
|
_: 3
|
|
373
|
-
})
|
|
372
|
+
})),
|
|
373
|
+
showPagination.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(((_a = pagination.value) == null ? void 0 : _a.withCard) ? vue.unref(ElementPlus.ElCard) : "div"), {
|
|
374
|
+
key: 1,
|
|
375
|
+
class: vue.normalizeClass(["flex flex-end bg-white justify-center mt-4 p-2 z-30 sticky bottom-0 jky-page-table__pagination", [((_b = pagination.value) == null ? void 0 : _b.class) || ""]])
|
|
376
|
+
}, {
|
|
377
|
+
default: vue.withCtx(() => [
|
|
378
|
+
vue.createVNode(vue.unref(ElementPlus.ElScrollbar), { class: "w-full" }, {
|
|
379
|
+
default: vue.withCtx(() => {
|
|
380
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h;
|
|
381
|
+
return [
|
|
382
|
+
vue.createVNode(vue.unref(ElementPlus.ElPagination), vue.mergeProps({
|
|
383
|
+
"current-page": pagination.value.currentPage,
|
|
384
|
+
"onUpdate:currentPage": _cache[1] || (_cache[1] = ($event) => pagination.value.currentPage = $event),
|
|
385
|
+
"page-size": pagination.value.pageSize,
|
|
386
|
+
"onUpdate:pageSize": _cache[2] || (_cache[2] = ($event) => pagination.value.pageSize = $event),
|
|
387
|
+
total: pagination.value.total,
|
|
388
|
+
"page-sizes": ((_a2 = pagination.value) == null ? void 0 : _a2.pageSizes) || [10, 20, 50, 100],
|
|
389
|
+
layout: ((_b2 = pagination.value) == null ? void 0 : _b2.layout) || "total, sizes, prev, pager, next, jumper",
|
|
390
|
+
"show-size-picker": (_d = (_c = pagination.value) == null ? void 0 : _c.showSizePicker) != null ? _d : true,
|
|
391
|
+
"show-total": (_f = (_e = pagination.value) == null ? void 0 : _e.showTotal) != null ? _f : true,
|
|
392
|
+
"show-jumper": (_h = (_g = pagination.value) == null ? void 0 : _g.showJumper) != null ? _h : true
|
|
393
|
+
}, __props.paginationProps, {
|
|
394
|
+
onSizeChange: handlePageSizeChange,
|
|
395
|
+
onCurrentChange: handlePageChange
|
|
396
|
+
}), null, 16, ["current-page", "page-size", "total", "page-sizes", "layout", "show-size-picker", "show-total", "show-jumper"])
|
|
397
|
+
];
|
|
398
|
+
}),
|
|
399
|
+
_: 1
|
|
400
|
+
})
|
|
401
|
+
]),
|
|
402
|
+
_: 1
|
|
403
|
+
}, 8, ["class"])) : vue.createCommentVNode("", true)
|
|
374
404
|
], 2);
|
|
375
405
|
};
|
|
376
406
|
}
|
|
@@ -16,6 +16,7 @@ declare const _default: import('vue').DefineComponent<ToolbarProps, {
|
|
|
16
16
|
leftButtons: ToolbarButtonConfig[];
|
|
17
17
|
batchButtons: ToolbarButtonConfig[];
|
|
18
18
|
rightButtons: ToolbarButtonConfig[];
|
|
19
|
+
defaultButtons: ToolbarButtonConfig[];
|
|
19
20
|
selectedCount: number;
|
|
20
21
|
toolbarButtonLimit: number;
|
|
21
22
|
payload: {
|
|
@@ -19,23 +19,24 @@ var __spreadValues = (a, b) => {
|
|
|
19
19
|
};
|
|
20
20
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
21
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
22
|
-
const es = require("element-plus/es");
|
|
23
|
-
require("element-plus/es/components/base/style/css");
|
|
24
|
-
require("element-plus/es/components/icon/style/css");
|
|
25
22
|
const vue = require("vue");
|
|
26
23
|
const index = require("../node_modules/@element-plus/icons-vue/dist/index.js");
|
|
27
24
|
const ElementPlus = require("element-plus");
|
|
28
25
|
const responsiveToolbar = require("../utils/responsive-toolbar.js");
|
|
29
26
|
const _hoisted_1 = { class: "flex items-center justify-between mb-2 py-2 jky-page-table__toolbar" };
|
|
30
27
|
const _hoisted_2 = { class: "flex items-center" };
|
|
28
|
+
const _hoisted_3 = { class: "flex items-center ml-2 text-gray-500" };
|
|
29
|
+
const _hoisted_4 = ["title", "onClick"];
|
|
31
30
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValues({}, {
|
|
32
31
|
name: "JkyPageTableToolbar"
|
|
33
32
|
}), {
|
|
34
33
|
__name: "Toolbar",
|
|
35
34
|
props: {
|
|
35
|
+
class: {},
|
|
36
36
|
leftButtons: { default: () => [] },
|
|
37
37
|
batchButtons: { default: () => [] },
|
|
38
38
|
rightButtons: { default: () => [] },
|
|
39
|
+
defaultButtons: { default: () => [] },
|
|
39
40
|
selectedCount: { default: 0 },
|
|
40
41
|
toolbarButtonLimit: { default: 0 },
|
|
41
42
|
payload: { default: () => ({
|
|
@@ -101,6 +102,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
101
102
|
const buttons = [];
|
|
102
103
|
if (props.leftButtons) {
|
|
103
104
|
props.leftButtons.forEach((button, index2) => {
|
|
105
|
+
const iconSpan = button.icon ? vue.h("span", {
|
|
106
|
+
class: `${button.icon} text-[1em] inline-block`
|
|
107
|
+
}) : null;
|
|
104
108
|
buttons.push(
|
|
105
109
|
vue.h(
|
|
106
110
|
ElementPlus.ElButton,
|
|
@@ -110,10 +114,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
110
114
|
size: button.size,
|
|
111
115
|
disabled: button.disabled,
|
|
112
116
|
plain: button.plain,
|
|
113
|
-
class: button.
|
|
117
|
+
class: button.class,
|
|
118
|
+
icon: iconSpan || void 0,
|
|
114
119
|
onClick: () => handleToolbarButtonClick(button)
|
|
115
120
|
},
|
|
116
|
-
{
|
|
121
|
+
{
|
|
122
|
+
default: () => button.label
|
|
123
|
+
}
|
|
117
124
|
)
|
|
118
125
|
);
|
|
119
126
|
});
|
|
@@ -131,7 +138,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
131
138
|
key: index2,
|
|
132
139
|
type: button.type,
|
|
133
140
|
disabled: button.disabled,
|
|
134
|
-
class: button.
|
|
141
|
+
class: button.class,
|
|
135
142
|
command: index2
|
|
136
143
|
},
|
|
137
144
|
{ default: () => button.label }
|
|
@@ -147,6 +154,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
147
154
|
props.rightButtons.forEach((button, index2) => {
|
|
148
155
|
const isVisible = index2 < visibleRightCount.value || !needCollapseRight.value;
|
|
149
156
|
if (isVisible) {
|
|
157
|
+
const iconSpan = button.icon ? vue.h("span", {
|
|
158
|
+
class: `${button.icon} text-[1em]`,
|
|
159
|
+
style: { display: "inline-block" }
|
|
160
|
+
}) : null;
|
|
150
161
|
buttons.push(
|
|
151
162
|
vue.h(
|
|
152
163
|
ElementPlus.ElButton,
|
|
@@ -156,10 +167,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
156
167
|
size: button.size,
|
|
157
168
|
disabled: button.disabled,
|
|
158
169
|
plain: button.plain,
|
|
159
|
-
class: button.
|
|
170
|
+
class: button.class,
|
|
171
|
+
icon: iconSpan || void 0,
|
|
160
172
|
onClick: () => handleToolbarButtonClick(button)
|
|
161
173
|
},
|
|
162
|
-
{
|
|
174
|
+
{
|
|
175
|
+
default: () => button.label
|
|
176
|
+
}
|
|
163
177
|
)
|
|
164
178
|
);
|
|
165
179
|
}
|
|
@@ -191,7 +205,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
191
205
|
handleRightCommand
|
|
192
206
|
});
|
|
193
207
|
return (_ctx, _cache) => {
|
|
194
|
-
const _component_ElIcon = es.ElIcon;
|
|
195
208
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
196
209
|
vue.createElementVNode("div", _hoisted_2, [
|
|
197
210
|
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(renderLeftButtons))),
|
|
@@ -215,7 +228,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
215
228
|
class: vue.normalizeClass([((_a = props.leftButtons) == null ? void 0 : _a.length) ? "ml-3" : ""])
|
|
216
229
|
}, {
|
|
217
230
|
suffix: vue.withCtx(() => [
|
|
218
|
-
vue.createVNode(
|
|
231
|
+
vue.createVNode(vue.unref(ElementPlus.ElIcon), { class: "text-white" }, {
|
|
219
232
|
default: vue.withCtx(() => [
|
|
220
233
|
vue.createVNode(vue.unref(index.ArrowDown))
|
|
221
234
|
]),
|
|
@@ -262,7 +275,21 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
262
275
|
})
|
|
263
276
|
]),
|
|
264
277
|
_: 1
|
|
265
|
-
})) : vue.createCommentVNode("", true)
|
|
278
|
+
})) : vue.createCommentVNode("", true),
|
|
279
|
+
vue.createElementVNode("div", _hoisted_3, [
|
|
280
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(props.defaultButtons, (button) => {
|
|
281
|
+
return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
282
|
+
key: button.label + button.icon
|
|
283
|
+
}, [
|
|
284
|
+
button.icon ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
285
|
+
key: 0,
|
|
286
|
+
title: button.label,
|
|
287
|
+
class: vue.normalizeClass(["text-2xl inline-flex items-center justify-center cursor-pointer hover:opacity-70 ml-1", [button.icon]]),
|
|
288
|
+
onClick: vue.withModifiers(($event) => handleToolbarButtonClick(button), ["stop"])
|
|
289
|
+
}, null, 10, _hoisted_4)) : vue.createCommentVNode("", true)
|
|
290
|
+
], 64);
|
|
291
|
+
}), 128))
|
|
292
|
+
])
|
|
266
293
|
], 512)
|
|
267
294
|
]);
|
|
268
295
|
};
|
|
@@ -20,7 +20,7 @@ var __spreadValues = (a, b) => {
|
|
|
20
20
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
21
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
22
22
|
const vue = require("vue");
|
|
23
|
-
const Editor = require("
|
|
23
|
+
const Editor = require("@tinymce/tinymce-vue");
|
|
24
24
|
const _hoisted_1 = { class: "jky-rich-editor" };
|
|
25
25
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValues({}, {
|
|
26
26
|
name: "JkyRichEditor"
|
|
@@ -85,7 +85,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
85
85
|
});
|
|
86
86
|
return (_ctx, _cache) => {
|
|
87
87
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
88
|
-
vue.createVNode(vue.unref(Editor
|
|
88
|
+
vue.createVNode(vue.unref(Editor), {
|
|
89
89
|
ref_key: "editorRef",
|
|
90
90
|
ref: editorRef,
|
|
91
91
|
modelValue: modelValue.value,
|