@sdata/web-vue 3.2.1 → 3.3.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.
- package/README.md +2 -2
- package/dist/sd.css +91 -17
- package/dist/sd.min.css +1 -1
- package/es/_components/select-view/style/index.css +5 -6
- package/es/_components/virtual-list-v2/hooks/use-size.d.ts +17 -0
- package/es/_components/virtual-list-v2/hooks/use-size.js +95 -0
- package/es/_components/virtual-list-v2/index.d.ts +2 -0
- package/es/_components/virtual-list-v2/index.js +5 -0
- package/es/_components/virtual-list-v2/interface.d.ts +44 -0
- package/es/_components/virtual-list-v2/virtual-list-item.d.ts +22 -0
- package/es/_components/virtual-list-v2/virtual-list-item.js +37 -0
- package/es/_components/virtual-list-v2/virtual-list.js +47 -0
- package/es/_components/virtual-list-v2/virtual-list.vue.d.ts +749 -0
- package/es/_components/virtual-list-v2/virtual-list.vue_vue_type_script_lang.js +179 -0
- package/es/_hooks/use-config-provider-prop.d.ts +1 -1
- package/es/_virtual/_plugin-vue_export-helper.js +8 -0
- package/es/color-picker/hooks/use-control-block.js +4 -1
- 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 +14 -0
- package/es/config-provider/index.d.ts +9 -0
- package/es/index.css +91 -17
- package/es/index.d.ts +2 -0
- package/es/index.js +2 -1
- package/es/index.scss +1 -0
- package/es/input-tag/style/index.css +5 -6
- package/es/input-tag/style/input-tag.scss +30 -10
- package/es/message/message.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/pagination/pagination.js +101 -19
- package/es/sd-vue.js +2 -0
- package/es/table/context.d.ts +1 -1
- package/es/table/hooks/use-column-resize.d.ts +3 -2
- package/es/table/hooks/use-column-resize.js +21 -48
- package/es/table/hooks/use-drag.d.ts +1 -3
- package/es/table/hooks/use-drag.js +2 -18
- package/es/table/index.d.ts +21 -36
- package/es/table/style/index.css +12 -5
- package/es/table/style/index.scss +16 -6
- package/es/table/table-operation-td.js +15 -12
- package/es/table/table-operation-th.js +2 -2
- package/es/table/table-tbody.js +3 -1
- package/es/table/table-td.js +3 -4
- package/es/table/table-th.js +24 -40
- package/es/table/table-thead.js +3 -1
- package/es/table/table.d.ts +13 -19
- package/es/table/table.js +205 -424
- package/es/table/utils.d.ts +2 -0
- package/es/table/utils.js +11 -1
- package/es/tag/index.d.ts +3 -3
- package/es/tag/tag.vue.d.ts +2 -2
- package/es/tag/tag.vue_vue_type_script_setup_true_lang.js +16 -5
- package/es/toolbar/index.d.ts +72 -0
- package/es/toolbar/index.js +10 -0
- package/es/toolbar/style/css.js +2 -0
- package/es/toolbar/style/index.css +85 -0
- package/es/toolbar/style/index.d.ts +2 -0
- package/es/toolbar/style/index.js +2 -0
- package/es/toolbar/style/index.scss +97 -0
- package/es/toolbar/style/token.scss +25 -0
- package/es/toolbar/toolbar.js +5 -0
- package/es/toolbar/toolbar.vue.d.ts +44 -0
- package/es/toolbar/toolbar.vue_vue_type_script_setup_true_lang.js +197 -0
- package/es/toolbar/types.d.ts +26 -0
- package/es/trigger/trigger.js +5 -1
- package/json/vetur-attributes.json +76 -1
- package/json/vetur-tags.json +24 -0
- package/json/web-types.json +163 -7
- package/package.json +1 -1
- package/es/table/table-col-group.vue.d.ts +0 -29
|
@@ -22,6 +22,21 @@
|
|
|
22
22
|
@return $value;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
// Builds a `:not()` chain that matches tags carrying their own color
|
|
26
|
+
// (a custom color or any built-in preset). input-tag's default tag
|
|
27
|
+
// background/border/color are scoped to the inverse of this chain so
|
|
28
|
+
// colored tags fully inherit their styling from the Tag component
|
|
29
|
+
// instead of being overridden by the input-tag defaults.
|
|
30
|
+
@function tag-color-not-chain() {
|
|
31
|
+
$chain: ':not(.#{$tag-prefix-cls}-custom-color)';
|
|
32
|
+
|
|
33
|
+
@each $name in $colors {
|
|
34
|
+
$chain: '#{$chain}:not(.#{$tag-prefix-cls}-#{$name})';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@return $chain;
|
|
38
|
+
}
|
|
39
|
+
|
|
25
40
|
@mixin input-tag-size($cls, $size) {
|
|
26
41
|
$font-size-token: string.unquote('input-tag-size-#{$size}-font-size');
|
|
27
42
|
$height-token: string.unquote('input-tag-size-#{$size}-height');
|
|
@@ -96,20 +111,21 @@
|
|
|
96
111
|
align-items: center;
|
|
97
112
|
min-width: 0;
|
|
98
113
|
margin-right: $input-tag-tag-margin-right;
|
|
99
|
-
color: $input-tag-color-text_default;
|
|
100
114
|
font-size: $input-tag-tag-font-size;
|
|
101
115
|
white-space: pre-wrap;
|
|
102
116
|
word-break: break-word;
|
|
103
|
-
|
|
104
|
-
|
|
117
|
+
|
|
118
|
+
&#{tag-color-not-chain()} {
|
|
119
|
+
color: $input-tag-color-text_default;
|
|
120
|
+
background-color: $input-tag-tag-color-bg;
|
|
121
|
+
border-color: $input-tag-tag-color-border;
|
|
122
|
+
}
|
|
105
123
|
|
|
106
124
|
.#{theme.$prefix}-icon-hover:hover::before {
|
|
107
125
|
background-color: $input-tag-tag-remove-icon-color-bg;
|
|
108
126
|
}
|
|
109
127
|
|
|
110
128
|
&.#{theme.$prefix}-tag-custom-color {
|
|
111
|
-
color: token.$tag-custom-color-text;
|
|
112
|
-
|
|
113
129
|
@include icon-hover.icon-hover-bg($tag-prefix-cls, token.$tag-custom-color-icon-bg_hover);
|
|
114
130
|
}
|
|
115
131
|
|
|
@@ -176,8 +192,10 @@
|
|
|
176
192
|
|
|
177
193
|
&.#{$cls}-focus {
|
|
178
194
|
.#{$cls}-tag {
|
|
179
|
-
|
|
180
|
-
|
|
195
|
+
&#{tag-color-not-chain()} {
|
|
196
|
+
background-color: $input-tag-tag-color-bg_focus;
|
|
197
|
+
border-color: $input-tag-tag-color-border_focus;
|
|
198
|
+
}
|
|
181
199
|
|
|
182
200
|
.#{theme.$prefix}-icon-hover:hover::before {
|
|
183
201
|
background-color: $input-tag-tag-remove-icon-color-bg_focus;
|
|
@@ -187,9 +205,11 @@
|
|
|
187
205
|
|
|
188
206
|
&.#{$cls}-disabled {
|
|
189
207
|
.#{$cls}-tag {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
208
|
+
&#{tag-color-not-chain()} {
|
|
209
|
+
color: $input-tag-color-text_disabled;
|
|
210
|
+
background-color: $input-tag-tag-color-bg_disabled;
|
|
211
|
+
border-color: $input-tag-tag-color-border_disabled;
|
|
212
|
+
}
|
|
193
213
|
}
|
|
194
214
|
}
|
|
195
215
|
|
|
@@ -2,6 +2,7 @@ import { getPrefixCls } from "../_utils/global-config.js";
|
|
|
2
2
|
import { isNumber } from "../_utils/is.js";
|
|
3
3
|
import { useSize } from "../_hooks/use-size.js";
|
|
4
4
|
import { useI18n } from "../locale/index.js";
|
|
5
|
+
import { useConfigProviderProp } from "../_hooks/use-config-provider-prop.js";
|
|
5
6
|
import page_item_ellipsis_default from "./page-item-ellipsis.js";
|
|
6
7
|
import page_item_step_default from "./page-item-step.js";
|
|
7
8
|
import page_item_default from "./page-item.js";
|
|
@@ -210,12 +211,83 @@ var pagination_default = /* @__PURE__ */ defineComponent({
|
|
|
210
211
|
* @binding {number} total
|
|
211
212
|
*/
|
|
212
213
|
setup(props, { emit, slots }) {
|
|
214
|
+
var _mergedDefaultPageSiz;
|
|
213
215
|
const prefixCls = getPrefixCls("pagination");
|
|
214
216
|
const { t } = useI18n();
|
|
215
|
-
const { disabled, pageItemStyle, activePageItemStyle, size } = toRefs(props);
|
|
217
|
+
const { disabled, pageItemStyle, activePageItemStyle, size, pageSizeOptions, defaultPageSize, showTotal, showMore, showJumper, showPageSize, autoAdjust, baseSize, bufferSize, pageSizeProps } = toRefs(props);
|
|
216
218
|
const { mergedSize } = useSize(size);
|
|
219
|
+
const { mergedValue: mergedPageSizeOptions } = useConfigProviderProp(pageSizeOptions, {
|
|
220
|
+
propNames: ["pageSizeOptions", "page-size-options"],
|
|
221
|
+
getGlobalValue: (configProviderCtx) => {
|
|
222
|
+
var _configProviderCtx$pa;
|
|
223
|
+
return configProviderCtx === null || configProviderCtx === void 0 || (_configProviderCtx$pa = configProviderCtx.pagination) === null || _configProviderCtx$pa === void 0 ? void 0 : _configProviderCtx$pa.pageSizeOptions;
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
const { mergedValue: mergedDefaultPageSize } = useConfigProviderProp(defaultPageSize, {
|
|
227
|
+
propNames: ["defaultPageSize", "default-page-size"],
|
|
228
|
+
getGlobalValue: (configProviderCtx) => {
|
|
229
|
+
var _configProviderCtx$pa2;
|
|
230
|
+
return configProviderCtx === null || configProviderCtx === void 0 || (_configProviderCtx$pa2 = configProviderCtx.pagination) === null || _configProviderCtx$pa2 === void 0 ? void 0 : _configProviderCtx$pa2.defaultPageSize;
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
const { mergedValue: mergedShowTotal } = useConfigProviderProp(showTotal, {
|
|
234
|
+
propNames: ["showTotal", "show-total"],
|
|
235
|
+
getGlobalValue: (configProviderCtx) => {
|
|
236
|
+
var _configProviderCtx$pa3;
|
|
237
|
+
return configProviderCtx === null || configProviderCtx === void 0 || (_configProviderCtx$pa3 = configProviderCtx.pagination) === null || _configProviderCtx$pa3 === void 0 ? void 0 : _configProviderCtx$pa3.showTotal;
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
const { mergedValue: mergedShowMore } = useConfigProviderProp(showMore, {
|
|
241
|
+
propNames: ["showMore", "show-more"],
|
|
242
|
+
getGlobalValue: (configProviderCtx) => {
|
|
243
|
+
var _configProviderCtx$pa4;
|
|
244
|
+
return configProviderCtx === null || configProviderCtx === void 0 || (_configProviderCtx$pa4 = configProviderCtx.pagination) === null || _configProviderCtx$pa4 === void 0 ? void 0 : _configProviderCtx$pa4.showMore;
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
const { mergedValue: mergedShowJumper } = useConfigProviderProp(showJumper, {
|
|
248
|
+
propNames: ["showJumper", "show-jumper"],
|
|
249
|
+
getGlobalValue: (configProviderCtx) => {
|
|
250
|
+
var _configProviderCtx$pa5;
|
|
251
|
+
return configProviderCtx === null || configProviderCtx === void 0 || (_configProviderCtx$pa5 = configProviderCtx.pagination) === null || _configProviderCtx$pa5 === void 0 ? void 0 : _configProviderCtx$pa5.showJumper;
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
const { mergedValue: mergedShowPageSize } = useConfigProviderProp(showPageSize, {
|
|
255
|
+
propNames: ["showPageSize", "show-page-size"],
|
|
256
|
+
getGlobalValue: (configProviderCtx) => {
|
|
257
|
+
var _configProviderCtx$pa6;
|
|
258
|
+
return configProviderCtx === null || configProviderCtx === void 0 || (_configProviderCtx$pa6 = configProviderCtx.pagination) === null || _configProviderCtx$pa6 === void 0 ? void 0 : _configProviderCtx$pa6.showPageSize;
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
const { mergedValue: mergedAutoAdjust } = useConfigProviderProp(autoAdjust, {
|
|
262
|
+
propNames: ["autoAdjust", "auto-adjust"],
|
|
263
|
+
getGlobalValue: (configProviderCtx) => {
|
|
264
|
+
var _configProviderCtx$pa7;
|
|
265
|
+
return configProviderCtx === null || configProviderCtx === void 0 || (_configProviderCtx$pa7 = configProviderCtx.pagination) === null || _configProviderCtx$pa7 === void 0 ? void 0 : _configProviderCtx$pa7.autoAdjust;
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
const { mergedValue: mergedBaseSize } = useConfigProviderProp(baseSize, {
|
|
269
|
+
propNames: ["baseSize", "base-size"],
|
|
270
|
+
getGlobalValue: (configProviderCtx) => {
|
|
271
|
+
var _configProviderCtx$pa8;
|
|
272
|
+
return configProviderCtx === null || configProviderCtx === void 0 || (_configProviderCtx$pa8 = configProviderCtx.pagination) === null || _configProviderCtx$pa8 === void 0 ? void 0 : _configProviderCtx$pa8.baseSize;
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
const { mergedValue: mergedBufferSize } = useConfigProviderProp(bufferSize, {
|
|
276
|
+
propNames: ["bufferSize", "buffer-size"],
|
|
277
|
+
getGlobalValue: (configProviderCtx) => {
|
|
278
|
+
var _configProviderCtx$pa9;
|
|
279
|
+
return configProviderCtx === null || configProviderCtx === void 0 || (_configProviderCtx$pa9 = configProviderCtx.pagination) === null || _configProviderCtx$pa9 === void 0 ? void 0 : _configProviderCtx$pa9.bufferSize;
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
const { mergedValue: mergedPageSizeProps } = useConfigProviderProp(pageSizeProps, {
|
|
283
|
+
propNames: ["pageSizeProps", "page-size-props"],
|
|
284
|
+
getGlobalValue: (configProviderCtx) => {
|
|
285
|
+
var _configProviderCtx$pa10;
|
|
286
|
+
return configProviderCtx === null || configProviderCtx === void 0 || (_configProviderCtx$pa10 = configProviderCtx.pagination) === null || _configProviderCtx$pa10 === void 0 ? void 0 : _configProviderCtx$pa10.pageSizeProps;
|
|
287
|
+
}
|
|
288
|
+
});
|
|
217
289
|
const _current = ref(props.defaultCurrent);
|
|
218
|
-
const _pageSize = ref(
|
|
290
|
+
const _pageSize = ref((_mergedDefaultPageSiz = mergedDefaultPageSize.value) !== null && _mergedDefaultPageSiz !== void 0 ? _mergedDefaultPageSiz : 10);
|
|
219
291
|
const computedCurrent = computed(() => {
|
|
220
292
|
var _props$current;
|
|
221
293
|
return (_props$current = props.current) !== null && _props$current !== void 0 ? _props$current : _current.value;
|
|
@@ -224,6 +296,14 @@ var pagination_default = /* @__PURE__ */ defineComponent({
|
|
|
224
296
|
var _props$pageSize;
|
|
225
297
|
return (_props$pageSize = props.pageSize) !== null && _props$pageSize !== void 0 ? _props$pageSize : _pageSize.value;
|
|
226
298
|
});
|
|
299
|
+
const resolvedBaseSize = computed(() => {
|
|
300
|
+
var _mergedBaseSize$value;
|
|
301
|
+
return (_mergedBaseSize$value = mergedBaseSize.value) !== null && _mergedBaseSize$value !== void 0 ? _mergedBaseSize$value : props.baseSize;
|
|
302
|
+
});
|
|
303
|
+
const resolvedBufferSize = computed(() => {
|
|
304
|
+
var _mergedBufferSize$val;
|
|
305
|
+
return (_mergedBufferSize$val = mergedBufferSize.value) !== null && _mergedBufferSize$val !== void 0 ? _mergedBufferSize$val : props.bufferSize;
|
|
306
|
+
});
|
|
227
307
|
const pages = computed(() => Math.ceil(props.total / computedPageSize.value));
|
|
228
308
|
const handleClick = (page) => {
|
|
229
309
|
if (page !== computedCurrent.value && isNumber(page) && !props.disabled) {
|
|
@@ -253,7 +333,9 @@ var pagination_default = /* @__PURE__ */ defineComponent({
|
|
|
253
333
|
};
|
|
254
334
|
const pageList = computed(() => {
|
|
255
335
|
const pageList = [];
|
|
256
|
-
|
|
336
|
+
const baseSize = resolvedBaseSize.value;
|
|
337
|
+
const bufferSize = resolvedBufferSize.value;
|
|
338
|
+
if (pages.value < baseSize + bufferSize * 2) for (let i = 1; i <= pages.value; i++) pageList.push(getPageItemElement("page", {
|
|
257
339
|
key: i,
|
|
258
340
|
pageNumber: i
|
|
259
341
|
}));
|
|
@@ -262,13 +344,13 @@ var pagination_default = /* @__PURE__ */ defineComponent({
|
|
|
262
344
|
let right = pages.value;
|
|
263
345
|
let hasLeftEllipsis = false;
|
|
264
346
|
let hasRightEllipsis = false;
|
|
265
|
-
if (computedCurrent.value > 2 +
|
|
347
|
+
if (computedCurrent.value > 2 + bufferSize) {
|
|
266
348
|
hasLeftEllipsis = true;
|
|
267
|
-
left = Math.min(computedCurrent.value -
|
|
349
|
+
left = Math.min(computedCurrent.value - bufferSize, pages.value - 2 * bufferSize);
|
|
268
350
|
}
|
|
269
|
-
if (computedCurrent.value < pages.value - (
|
|
351
|
+
if (computedCurrent.value < pages.value - (bufferSize + 1)) {
|
|
270
352
|
hasRightEllipsis = true;
|
|
271
|
-
right = Math.max(computedCurrent.value +
|
|
353
|
+
right = Math.max(computedCurrent.value + bufferSize, 2 * bufferSize + 1);
|
|
272
354
|
}
|
|
273
355
|
if (hasLeftEllipsis) {
|
|
274
356
|
pageList.push(getPageItemElement("page", {
|
|
@@ -277,7 +359,7 @@ var pagination_default = /* @__PURE__ */ defineComponent({
|
|
|
277
359
|
}));
|
|
278
360
|
pageList.push(getPageItemElement("more", {
|
|
279
361
|
key: "left-ellipsis-pager",
|
|
280
|
-
step: -(
|
|
362
|
+
step: -(bufferSize * 2 + 1)
|
|
281
363
|
}));
|
|
282
364
|
}
|
|
283
365
|
for (let i = left; i <= right; i++) pageList.push(getPageItemElement("page", {
|
|
@@ -287,7 +369,7 @@ var pagination_default = /* @__PURE__ */ defineComponent({
|
|
|
287
369
|
if (hasRightEllipsis) {
|
|
288
370
|
pageList.push(getPageItemElement("more", {
|
|
289
371
|
key: "right-ellipsis-pager",
|
|
290
|
-
step:
|
|
372
|
+
step: bufferSize * 2 + 1
|
|
291
373
|
}));
|
|
292
374
|
pageList.push(getPageItemElement("page", {
|
|
293
375
|
key: pages.value,
|
|
@@ -313,15 +395,15 @@ var pagination_default = /* @__PURE__ */ defineComponent({
|
|
|
313
395
|
return createVNode("ul", { "class": `${prefixCls}-list` }, [
|
|
314
396
|
getPageItemElement("previous", { simple: true }),
|
|
315
397
|
pageList.value,
|
|
316
|
-
|
|
398
|
+
mergedShowMore.value && getPageItemElement("more", {
|
|
317
399
|
key: "more",
|
|
318
|
-
step:
|
|
400
|
+
step: resolvedBufferSize.value * 2 + 1
|
|
319
401
|
}),
|
|
320
402
|
getPageItemElement("next", { simple: true })
|
|
321
403
|
]);
|
|
322
404
|
};
|
|
323
405
|
watch(computedPageSize, (curPageSize, prePageSize) => {
|
|
324
|
-
if (
|
|
406
|
+
if (mergedAutoAdjust.value && curPageSize !== prePageSize && computedCurrent.value > 1) {
|
|
325
407
|
const index = prePageSize * (computedCurrent.value - 1) + 1;
|
|
326
408
|
const newPage = Math.ceil(index / curPageSize);
|
|
327
409
|
if (newPage !== computedCurrent.value) {
|
|
@@ -332,7 +414,7 @@ var pagination_default = /* @__PURE__ */ defineComponent({
|
|
|
332
414
|
}
|
|
333
415
|
});
|
|
334
416
|
watch(pages, (curPages, prePages) => {
|
|
335
|
-
if (
|
|
417
|
+
if (mergedAutoAdjust.value && curPages !== prePages && computedCurrent.value > 1 && computedCurrent.value > curPages) {
|
|
336
418
|
const newCurrent = Math.max(curPages, 1);
|
|
337
419
|
_current.value = newCurrent;
|
|
338
420
|
emit("update:current", newCurrent);
|
|
@@ -348,20 +430,20 @@ var pagination_default = /* @__PURE__ */ defineComponent({
|
|
|
348
430
|
}
|
|
349
431
|
]);
|
|
350
432
|
return () => {
|
|
351
|
-
var _slots$total, _slots$total2;
|
|
433
|
+
var _slots$total, _slots$total2, _mergedPageSizeOption;
|
|
352
434
|
if (props.hideOnSinglePage && pages.value <= 1) return null;
|
|
353
435
|
return createVNode("div", { "class": cls.value }, [
|
|
354
|
-
|
|
436
|
+
mergedShowTotal.value && createVNode("span", { "class": `${prefixCls}-total` }, [(_slots$total = (_slots$total2 = slots.total) === null || _slots$total2 === void 0 ? void 0 : _slots$total2.call(slots, { total: props.total })) !== null && _slots$total !== void 0 ? _slots$total : t("pagination.total", props.total)]),
|
|
355
437
|
renderPager(),
|
|
356
|
-
|
|
438
|
+
mergedShowPageSize.value && createVNode(page_options_default, {
|
|
357
439
|
"disabled": props.disabled,
|
|
358
|
-
"sizeOptions": props.pageSizeOptions,
|
|
440
|
+
"sizeOptions": (_mergedPageSizeOption = mergedPageSizeOptions.value) !== null && _mergedPageSizeOption !== void 0 ? _mergedPageSizeOption : props.pageSizeOptions,
|
|
359
441
|
"pageSize": computedPageSize.value,
|
|
360
442
|
"size": mergedSize.value,
|
|
361
443
|
"onChange": handlePageSizeChange,
|
|
362
|
-
"selectProps":
|
|
444
|
+
"selectProps": mergedPageSizeProps.value
|
|
363
445
|
}, null),
|
|
364
|
-
!props.simple &&
|
|
446
|
+
!props.simple && mergedShowJumper.value && createVNode(page_jumper_default, {
|
|
365
447
|
"disabled": props.disabled,
|
|
366
448
|
"current": computedCurrent.value,
|
|
367
449
|
"pages": pages.value,
|
package/es/sd-vue.js
CHANGED
|
@@ -134,6 +134,7 @@ import TagGroup from "./tag-group/index.js";
|
|
|
134
134
|
import ThemeProvider from "./theme-provider/index.js";
|
|
135
135
|
import item_default$1 from "./timeline/item.js";
|
|
136
136
|
import Timeline from "./timeline/index.js";
|
|
137
|
+
import Toolbar from "./toolbar/index.js";
|
|
137
138
|
import Tour from "./tour/index.js";
|
|
138
139
|
import paragraph_default from "./typography/paragraph.js";
|
|
139
140
|
import text_default from "./typography/text.js";
|
|
@@ -173,6 +174,7 @@ var components = {
|
|
|
173
174
|
Tag,
|
|
174
175
|
TagGroup,
|
|
175
176
|
Timeline,
|
|
177
|
+
Toolbar,
|
|
176
178
|
Tooltip,
|
|
177
179
|
Tour,
|
|
178
180
|
AutoComplete,
|
package/es/table/context.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export interface TableContext {
|
|
|
19
19
|
onSelectAllLeafs: (record: TableDataWithRaw, checked: boolean) => void;
|
|
20
20
|
onSorterChange: (dataIndex: string, direction: 'ascend' | 'descend' | '', ev: Event) => void;
|
|
21
21
|
onFilterChange: (dataIndex: string, filteredValues: string[], ev: Event) => void;
|
|
22
|
-
onThMouseDown: (dataIndex: string, ev:
|
|
22
|
+
onThMouseDown: (dataIndex: string, ev: MouseEvent) => void;
|
|
23
23
|
}
|
|
24
24
|
export interface TableColumnContext {
|
|
25
25
|
addChild: (id: number, column: TableColumnData) => void;
|
|
@@ -2,8 +2,9 @@ import { Ref } from 'vue';
|
|
|
2
2
|
import { EmitFn2 } from '../../_utils/types';
|
|
3
3
|
export declare const useColumnResize: (thRefs: Ref<Record<string, HTMLElement>>, emit: EmitFn2<{
|
|
4
4
|
columnResize: (dataIndex: string, width: number) => true;
|
|
5
|
-
}
|
|
5
|
+
}>) => {
|
|
6
6
|
resizingColumn: Ref<string, string>;
|
|
7
7
|
columnWidth: Record<string, number>;
|
|
8
|
-
handleThMouseDown: (dataIndex: string, ev:
|
|
8
|
+
handleThMouseDown: (dataIndex: string, ev: MouseEvent) => void;
|
|
9
|
+
handleThMouseUp: () => void;
|
|
9
10
|
};
|
|
@@ -1,65 +1,38 @@
|
|
|
1
|
+
import { off, on } from "../../_utils/dom.js";
|
|
1
2
|
import { reactive, ref } from "vue";
|
|
2
|
-
import { tryOnScopeDispose, useEventListener } from "@vueuse/core";
|
|
3
3
|
//#region components/table/hooks/use-column-resize.ts
|
|
4
|
-
var useColumnResize = (thRefs, emit
|
|
4
|
+
var useColumnResize = (thRefs, emit) => {
|
|
5
5
|
const resizingColumn = ref("");
|
|
6
6
|
const columnWidth = reactive({});
|
|
7
|
-
let stopResizeListeners = [];
|
|
8
|
-
const clearResizeListeners = () => {
|
|
9
|
-
stopResizeListeners.forEach((stop) => stop());
|
|
10
|
-
stopResizeListeners = [];
|
|
11
|
-
};
|
|
12
|
-
const resetBodyResizeStyle = () => {
|
|
13
|
-
if (typeof document === "undefined") return;
|
|
14
|
-
document.body.style.cursor = "";
|
|
15
|
-
document.body.style.userSelect = "";
|
|
16
|
-
};
|
|
17
|
-
tryOnScopeDispose(() => {
|
|
18
|
-
clearResizeListeners();
|
|
19
|
-
resetBodyResizeStyle();
|
|
20
|
-
});
|
|
21
7
|
const handleThMouseDown = (dataIndex, ev) => {
|
|
22
|
-
var _columnWidth$dataInde, _ref, _rect$width;
|
|
23
|
-
if (typeof document === "undefined") return;
|
|
24
8
|
ev.preventDefault();
|
|
25
|
-
ev.stopPropagation();
|
|
26
9
|
resizingColumn.value = dataIndex;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
const { clientX } =
|
|
41
|
-
const
|
|
42
|
-
let width = Math.ceil(
|
|
10
|
+
on(window, "mousemove", handleThMouseMoving);
|
|
11
|
+
on(window, "mouseup", handleThMouseUp);
|
|
12
|
+
on(window, "contextmenu", handleThMouseUp);
|
|
13
|
+
};
|
|
14
|
+
const handleThMouseUp = () => {
|
|
15
|
+
resizingColumn.value = "";
|
|
16
|
+
off(window, "mousemove", handleThMouseMoving);
|
|
17
|
+
off(window, "mouseup", handleThMouseUp);
|
|
18
|
+
off(window, "contextmenu", handleThMouseUp);
|
|
19
|
+
};
|
|
20
|
+
const handleThMouseMoving = (ev) => {
|
|
21
|
+
const element = thRefs.value[resizingColumn.value];
|
|
22
|
+
if (element) {
|
|
23
|
+
const { clientX } = ev;
|
|
24
|
+
const { x } = element.getBoundingClientRect();
|
|
25
|
+
let width = Math.ceil(clientX - x);
|
|
43
26
|
if (width < 40) width = 40;
|
|
44
27
|
columnWidth[resizingColumn.value] = width;
|
|
45
28
|
emit("columnResize", resizingColumn.value, width);
|
|
46
|
-
}
|
|
47
|
-
const onPointerUp = () => {
|
|
48
|
-
resizingColumn.value = "";
|
|
49
|
-
resetBodyResizeStyle();
|
|
50
|
-
clearResizeListeners();
|
|
51
|
-
};
|
|
52
|
-
clearResizeListeners();
|
|
53
|
-
stopResizeListeners = [
|
|
54
|
-
useEventListener(document, "pointermove", onPointerMove),
|
|
55
|
-
useEventListener(document, "pointerup", onPointerUp),
|
|
56
|
-
useEventListener(document, "contextmenu", onPointerUp)
|
|
57
|
-
];
|
|
29
|
+
}
|
|
58
30
|
};
|
|
59
31
|
return {
|
|
60
32
|
resizingColumn,
|
|
61
33
|
columnWidth,
|
|
62
|
-
handleThMouseDown
|
|
34
|
+
handleThMouseDown,
|
|
35
|
+
handleThMouseUp
|
|
63
36
|
};
|
|
64
37
|
};
|
|
65
38
|
//#endregion
|
|
@@ -5,15 +5,13 @@ export declare const useDrag: (draggable: Ref<TableDraggable | undefined>) => {
|
|
|
5
5
|
dragType: import("vue").ComputedRef<"row" | "handle" | undefined>;
|
|
6
6
|
dragState: {
|
|
7
7
|
dragging: boolean;
|
|
8
|
-
sourceKey: BaseType
|
|
8
|
+
sourceKey: BaseType;
|
|
9
9
|
sourcePath: number[];
|
|
10
10
|
targetPath: number[];
|
|
11
11
|
data: Record<string, unknown>;
|
|
12
|
-
dropIndicatorPath: number[];
|
|
13
12
|
};
|
|
14
13
|
handleDragStart: (ev: DragEvent, sourceKey: BaseType, sourcePath: number[], data: Record<string, unknown>) => void;
|
|
15
14
|
handleDragEnter: (ev: DragEvent, targetPath: number[]) => void;
|
|
16
|
-
handleDragLeave: (_ev: DragEvent) => void;
|
|
17
15
|
handleDragover: (ev: DragEvent) => void;
|
|
18
16
|
handleDragEnd: (ev: DragEvent) => void;
|
|
19
17
|
handleDrop: (ev: DragEvent) => void;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { computed, reactive } from "vue";
|
|
2
|
-
import { tryOnScopeDispose, useEventListener } from "@vueuse/core";
|
|
3
2
|
//#region components/table/hooks/use-drag.ts
|
|
4
3
|
var useDrag = (draggable) => {
|
|
5
4
|
const dragType = computed(() => {
|
|
@@ -13,8 +12,7 @@ var useDrag = (draggable) => {
|
|
|
13
12
|
sourceKey: "",
|
|
14
13
|
sourcePath: [],
|
|
15
14
|
targetPath: [],
|
|
16
|
-
data: {}
|
|
17
|
-
dropIndicatorPath: []
|
|
15
|
+
data: {}
|
|
18
16
|
});
|
|
19
17
|
const clearDragState = () => {
|
|
20
18
|
dragState.dragging = false;
|
|
@@ -22,16 +20,7 @@ var useDrag = (draggable) => {
|
|
|
22
20
|
dragState.sourcePath = [];
|
|
23
21
|
dragState.targetPath = [];
|
|
24
22
|
dragState.data = {};
|
|
25
|
-
dragState.dropIndicatorPath = [];
|
|
26
23
|
};
|
|
27
|
-
const stopGlobalDragListeners = [useEventListener(typeof window !== "undefined" ? window : void 0, "dragend", () => {
|
|
28
|
-
clearDragState();
|
|
29
|
-
}), useEventListener(typeof window !== "undefined" ? window : void 0, "drop", () => {
|
|
30
|
-
clearDragState();
|
|
31
|
-
})];
|
|
32
|
-
tryOnScopeDispose(() => {
|
|
33
|
-
stopGlobalDragListeners.forEach((stop) => stop());
|
|
34
|
-
});
|
|
35
24
|
const handleDragStart = (ev, sourceKey, sourcePath, data) => {
|
|
36
25
|
if (ev.dataTransfer) {
|
|
37
26
|
ev.dataTransfer.effectAllowed = "move";
|
|
@@ -48,13 +37,9 @@ var useDrag = (draggable) => {
|
|
|
48
37
|
};
|
|
49
38
|
const handleDragEnter = (ev, targetPath) => {
|
|
50
39
|
if (ev.dataTransfer) ev.dataTransfer.dropEffect = "move";
|
|
51
|
-
if (dragState.targetPath.toString() !== targetPath.toString())
|
|
52
|
-
dragState.targetPath = targetPath;
|
|
53
|
-
dragState.dropIndicatorPath = targetPath;
|
|
54
|
-
}
|
|
40
|
+
if (dragState.targetPath.toString() !== targetPath.toString()) dragState.targetPath = targetPath;
|
|
55
41
|
ev.preventDefault();
|
|
56
42
|
};
|
|
57
|
-
const handleDragLeave = (_ev) => {};
|
|
58
43
|
const handleDragover = (ev) => {
|
|
59
44
|
if (ev.dataTransfer) ev.dataTransfer.dropEffect = "move";
|
|
60
45
|
ev.preventDefault();
|
|
@@ -72,7 +57,6 @@ var useDrag = (draggable) => {
|
|
|
72
57
|
dragState,
|
|
73
58
|
handleDragStart,
|
|
74
59
|
handleDragEnter,
|
|
75
|
-
handleDragLeave,
|
|
76
60
|
handleDragover,
|
|
77
61
|
handleDragEnd,
|
|
78
62
|
handleDrop
|
package/es/table/index.d.ts
CHANGED
|
@@ -33,6 +33,10 @@ declare const Table: {
|
|
|
33
33
|
type: import("vue").PropType<import("..").Size>;
|
|
34
34
|
default: () => "small" | "mini" | "medium" | "large";
|
|
35
35
|
};
|
|
36
|
+
tableLayoutFixed: {
|
|
37
|
+
type: BooleanConstructor;
|
|
38
|
+
default: boolean;
|
|
39
|
+
};
|
|
36
40
|
loading: {
|
|
37
41
|
type: (ObjectConstructor | BooleanConstructor)[];
|
|
38
42
|
default: boolean;
|
|
@@ -72,12 +76,7 @@ declare const Table: {
|
|
|
72
76
|
default: boolean;
|
|
73
77
|
};
|
|
74
78
|
virtualListProps: {
|
|
75
|
-
type: import("vue").PropType<import("../_components/virtual-list/interface").VirtualListProps
|
|
76
|
-
threshold?: number;
|
|
77
|
-
fixedSize?: boolean;
|
|
78
|
-
estimatedSize?: number;
|
|
79
|
-
itemKey?: string | ((item: unknown, index: number) => string | number);
|
|
80
|
-
}>;
|
|
79
|
+
type: import("vue").PropType<import("../_components/virtual-list-v2/interface").VirtualListProps>;
|
|
81
80
|
};
|
|
82
81
|
spanMethod: {
|
|
83
82
|
type: import("vue").PropType<(data: {
|
|
@@ -165,10 +164,6 @@ declare const Table: {
|
|
|
165
164
|
type: import("vue").PropType<boolean | import("..").ScrollbarProps>;
|
|
166
165
|
default: boolean;
|
|
167
166
|
};
|
|
168
|
-
debug: {
|
|
169
|
-
type: BooleanConstructor;
|
|
170
|
-
default: boolean;
|
|
171
|
-
};
|
|
172
167
|
showEmptyTree: {
|
|
173
168
|
type: BooleanConstructor;
|
|
174
169
|
default: boolean;
|
|
@@ -246,11 +241,12 @@ declare const Table: {
|
|
|
246
241
|
bordered: boolean | import("./interface").TableBorder;
|
|
247
242
|
columns: import("./interface").TableColumnData[];
|
|
248
243
|
hoverable: boolean;
|
|
244
|
+
pagination: boolean | import("..").PaginationProps;
|
|
249
245
|
defaultExpandAllRows: boolean;
|
|
250
246
|
indentSize: number;
|
|
251
247
|
filterIconAlignLeft: boolean;
|
|
252
248
|
stripe: boolean;
|
|
253
|
-
|
|
249
|
+
tableLayoutFixed: boolean;
|
|
254
250
|
pagePosition: "top" | "tl" | "tr" | "bottom" | "bl" | "br";
|
|
255
251
|
rowKey: string | ((record: import("./interface").TableData) => import("../_utils/types").BaseType);
|
|
256
252
|
showHeader: boolean;
|
|
@@ -259,7 +255,6 @@ declare const Table: {
|
|
|
259
255
|
columnResizable: boolean;
|
|
260
256
|
summaryText: string;
|
|
261
257
|
stickyHeader: number | boolean;
|
|
262
|
-
debug: boolean;
|
|
263
258
|
showEmptyTree: boolean;
|
|
264
259
|
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
265
260
|
P: {};
|
|
@@ -293,6 +288,10 @@ declare const Table: {
|
|
|
293
288
|
type: import("vue").PropType<import("..").Size>;
|
|
294
289
|
default: () => "small" | "mini" | "medium" | "large";
|
|
295
290
|
};
|
|
291
|
+
tableLayoutFixed: {
|
|
292
|
+
type: BooleanConstructor;
|
|
293
|
+
default: boolean;
|
|
294
|
+
};
|
|
296
295
|
loading: {
|
|
297
296
|
type: (ObjectConstructor | BooleanConstructor)[];
|
|
298
297
|
default: boolean;
|
|
@@ -332,12 +331,7 @@ declare const Table: {
|
|
|
332
331
|
default: boolean;
|
|
333
332
|
};
|
|
334
333
|
virtualListProps: {
|
|
335
|
-
type: import("vue").PropType<import("../_components/virtual-list/interface").VirtualListProps
|
|
336
|
-
threshold?: number;
|
|
337
|
-
fixedSize?: boolean;
|
|
338
|
-
estimatedSize?: number;
|
|
339
|
-
itemKey?: string | ((item: unknown, index: number) => string | number);
|
|
340
|
-
}>;
|
|
334
|
+
type: import("vue").PropType<import("../_components/virtual-list-v2/interface").VirtualListProps>;
|
|
341
335
|
};
|
|
342
336
|
spanMethod: {
|
|
343
337
|
type: import("vue").PropType<(data: {
|
|
@@ -425,10 +419,6 @@ declare const Table: {
|
|
|
425
419
|
type: import("vue").PropType<boolean | import("..").ScrollbarProps>;
|
|
426
420
|
default: boolean;
|
|
427
421
|
};
|
|
428
|
-
debug: {
|
|
429
|
-
type: BooleanConstructor;
|
|
430
|
-
default: boolean;
|
|
431
|
-
};
|
|
432
422
|
showEmptyTree: {
|
|
433
423
|
type: BooleanConstructor;
|
|
434
424
|
default: boolean;
|
|
@@ -483,11 +473,12 @@ declare const Table: {
|
|
|
483
473
|
bordered: boolean | import("./interface").TableBorder;
|
|
484
474
|
columns: import("./interface").TableColumnData[];
|
|
485
475
|
hoverable: boolean;
|
|
476
|
+
pagination: boolean | import("..").PaginationProps;
|
|
486
477
|
defaultExpandAllRows: boolean;
|
|
487
478
|
indentSize: number;
|
|
488
479
|
filterIconAlignLeft: boolean;
|
|
489
480
|
stripe: boolean;
|
|
490
|
-
|
|
481
|
+
tableLayoutFixed: boolean;
|
|
491
482
|
pagePosition: "top" | "tl" | "tr" | "bottom" | "bl" | "br";
|
|
492
483
|
rowKey: string | ((record: import("./interface").TableData) => import("../_utils/types").BaseType);
|
|
493
484
|
showHeader: boolean;
|
|
@@ -496,7 +487,6 @@ declare const Table: {
|
|
|
496
487
|
columnResizable: boolean;
|
|
497
488
|
summaryText: string;
|
|
498
489
|
stickyHeader: number | boolean;
|
|
499
|
-
debug: boolean;
|
|
500
490
|
showEmptyTree: boolean;
|
|
501
491
|
}>;
|
|
502
492
|
__isFragment?: never;
|
|
@@ -527,6 +517,10 @@ declare const Table: {
|
|
|
527
517
|
type: import("vue").PropType<import("..").Size>;
|
|
528
518
|
default: () => "small" | "mini" | "medium" | "large";
|
|
529
519
|
};
|
|
520
|
+
tableLayoutFixed: {
|
|
521
|
+
type: BooleanConstructor;
|
|
522
|
+
default: boolean;
|
|
523
|
+
};
|
|
530
524
|
loading: {
|
|
531
525
|
type: (ObjectConstructor | BooleanConstructor)[];
|
|
532
526
|
default: boolean;
|
|
@@ -566,12 +560,7 @@ declare const Table: {
|
|
|
566
560
|
default: boolean;
|
|
567
561
|
};
|
|
568
562
|
virtualListProps: {
|
|
569
|
-
type: import("vue").PropType<import("../_components/virtual-list/interface").VirtualListProps
|
|
570
|
-
threshold?: number;
|
|
571
|
-
fixedSize?: boolean;
|
|
572
|
-
estimatedSize?: number;
|
|
573
|
-
itemKey?: string | ((item: unknown, index: number) => string | number);
|
|
574
|
-
}>;
|
|
563
|
+
type: import("vue").PropType<import("../_components/virtual-list-v2/interface").VirtualListProps>;
|
|
575
564
|
};
|
|
576
565
|
spanMethod: {
|
|
577
566
|
type: import("vue").PropType<(data: {
|
|
@@ -659,10 +648,6 @@ declare const Table: {
|
|
|
659
648
|
type: import("vue").PropType<boolean | import("..").ScrollbarProps>;
|
|
660
649
|
default: boolean;
|
|
661
650
|
};
|
|
662
|
-
debug: {
|
|
663
|
-
type: BooleanConstructor;
|
|
664
|
-
default: boolean;
|
|
665
|
-
};
|
|
666
651
|
showEmptyTree: {
|
|
667
652
|
type: BooleanConstructor;
|
|
668
653
|
default: boolean;
|
|
@@ -740,11 +725,12 @@ declare const Table: {
|
|
|
740
725
|
bordered: boolean | import("./interface").TableBorder;
|
|
741
726
|
columns: import("./interface").TableColumnData[];
|
|
742
727
|
hoverable: boolean;
|
|
728
|
+
pagination: boolean | import("..").PaginationProps;
|
|
743
729
|
defaultExpandAllRows: boolean;
|
|
744
730
|
indentSize: number;
|
|
745
731
|
filterIconAlignLeft: boolean;
|
|
746
732
|
stripe: boolean;
|
|
747
|
-
|
|
733
|
+
tableLayoutFixed: boolean;
|
|
748
734
|
pagePosition: "top" | "tl" | "tr" | "bottom" | "bl" | "br";
|
|
749
735
|
rowKey: string | ((record: import("./interface").TableData) => import("../_utils/types").BaseType);
|
|
750
736
|
showHeader: boolean;
|
|
@@ -753,7 +739,6 @@ declare const Table: {
|
|
|
753
739
|
columnResizable: boolean;
|
|
754
740
|
summaryText: string;
|
|
755
741
|
stickyHeader: number | boolean;
|
|
756
|
-
debug: boolean;
|
|
757
742
|
showEmptyTree: boolean;
|
|
758
743
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
|
759
744
|
Thead: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|