@ljweb/layout-antdv-v4 0.1.0-beta.0 → 0.1.0-beta.2
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 +7 -11
- package/dist/style.css +169 -83
- package/esm/assets/style.css +169 -83
- package/esm/components/color-input/ColorInput.js +110 -41
- package/esm/components/color-input/ColorInput.js.map +1 -1
- package/esm/components/color-input/helpers.js +2 -3
- package/esm/components/color-input/helpers.js.map +1 -1
- package/esm/components/ext-table/ExtTable.vue.js +1 -1
- package/esm/components/ext-table/ExtTable2.vue.js +55 -31
- package/esm/components/ext-table/ExtTable2.vue.js.map +1 -1
- package/esm/components/index.js +36 -38
- package/esm/components/index.js.map +1 -1
- package/esm/index.js +36 -38
- package/esm/index.js.map +1 -1
- package/lib/assets/style.css +169 -83
- package/lib/components/color-input/ColorInput.js +110 -39
- package/lib/components/color-input/ColorInput.js.map +1 -1
- package/lib/components/color-input/helpers.js +2 -3
- package/lib/components/color-input/helpers.js.map +1 -1
- package/lib/components/ext-table/ExtTable.vue.js +1 -1
- package/lib/components/ext-table/ExtTable2.vue.js +55 -31
- package/lib/components/ext-table/ExtTable2.vue.js.map +1 -1
- package/lib/components/index.js +0 -2
- package/lib/components/index.js.map +1 -1
- package/lib/index.js +0 -2
- package/lib/index.js.map +1 -1
- package/package.json +1 -6
- package/src/components/color-input/style.less +48 -0
- package/types/components/color-input/ColorInput.d.ts +10 -0
- package/types/components/color-input/helpers.d.ts +8 -2
- package/types/components/config-provider/ConfigProvider.d.ts +1 -1
- package/types/components/ext-table/ExtTable.vue.d.ts +6 -6
- package/types/components/ext-table/types.d.ts +5 -1
- package/types/components/index.d.ts +0 -1
- package/types/components/locale-dropdown/LocaleDropdown.d.ts +1 -1
- package/esm/components/async-table/AsyncTable.js +0 -290
- package/esm/components/async-table/AsyncTable.js.map +0 -1
- package/esm/components/async-table/helpers.js +0 -71
- package/esm/components/async-table/helpers.js.map +0 -1
- package/esm/components/async-table/index.js +0 -6
- package/esm/components/async-table/index.js.map +0 -1
- package/esm/components/async-table/style.js +0 -2
- package/esm/components/async-table/style.js.map +0 -1
- package/esm/components/async-table/types.js +0 -2
- package/esm/components/async-table/types.js.map +0 -1
- package/lib/components/async-table/AsyncTable.js +0 -290
- package/lib/components/async-table/AsyncTable.js.map +0 -1
- package/lib/components/async-table/helpers.js +0 -71
- package/lib/components/async-table/helpers.js.map +0 -1
- package/lib/components/async-table/index.js +0 -6
- package/lib/components/async-table/index.js.map +0 -1
- package/lib/components/async-table/style.js +0 -3
- package/lib/components/async-table/style.js.map +0 -1
- package/lib/components/async-table/types.js +0 -2
- package/lib/components/async-table/types.js.map +0 -1
- package/types/components/async-table/AsyncTable.d.ts +0 -413
- package/types/components/async-table/helpers.d.ts +0 -18
- package/types/components/async-table/index.d.ts +0 -2
- package/types/components/async-table/style.d.ts +0 -1
- package/types/components/async-table/types.d.ts +0 -50
|
@@ -7,9 +7,8 @@ function colorPickerValue(value) {
|
|
|
7
7
|
return tinycolor__default.default(value || "#000000").toHexString();
|
|
8
8
|
}
|
|
9
9
|
function colorWithAlpha(value, alpha, disableAlpha = false) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return color.setAlpha(Math.max(0, Math.min(1, alpha))).toRgbString();
|
|
10
|
+
if (disableAlpha) return colorPickerValue(value);
|
|
11
|
+
return tinycolor__default.default(value).setAlpha(Math.max(0, Math.min(1, alpha))).toRgbString();
|
|
13
12
|
}
|
|
14
13
|
function colorAlpha(value) {
|
|
15
14
|
return tinycolor__default.default(value || "#000000").getAlpha();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sources":["../../../src/components/color-input/helpers.ts"],"sourcesContent":["import tinycolor from 'tinycolor2';\n\nexport function colorPickerValue(value?:
|
|
1
|
+
{"version":3,"file":"helpers.js","sources":["../../../src/components/color-input/helpers.ts"],"sourcesContent":["import tinycolor from 'tinycolor2';\n\ntype ColorValue = string | { h: number; s: number; v: number };\n\nexport function colorPickerValue(value?: ColorValue) {\n return tinycolor(value || '#000000').toHexString();\n}\n\nexport function colorWithAlpha(value: ColorValue, alpha: number, disableAlpha = false) {\n if (disableAlpha) return colorPickerValue(value);\n return tinycolor(value)\n .setAlpha(Math.max(0, Math.min(1, alpha)))\n .toRgbString();\n}\n\nexport function colorAlpha(value?: string) {\n return tinycolor(value || '#000000').getAlpha();\n}\n"],"names":["tinycolor"],"mappings":";;;;;AAIO,SAAS,iBAAiB,OAAoB;AACnD,SAAOA,2BAAU,SAAS,SAAS,EAAE,YAAA;AACvC;AAEO,SAAS,eAAe,OAAmB,OAAe,eAAe,OAAO;AACrF,MAAI,aAAc,QAAO,iBAAiB,KAAK;AAC/C,SAAOA,mBAAAA,QAAU,KAAK,EACnB,SAAS,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,KAAK,CAAC,CAAC,EACxC,YAAA;AACL;AAEO,SAAS,WAAW,OAAgB;AACzC,SAAOA,2BAAU,SAAS,SAAS,EAAE,SAAA;AACvC;;;;"}
|
|
@@ -3,6 +3,6 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
3
3
|
const ExtTable_vue_vue_type_script_setup_true_lang = require("./ExtTable2.vue.js");
|
|
4
4
|
;/* empty css */
|
|
5
5
|
const _pluginVue_exportHelper = require("../../_virtual/_plugin-vue_export-helper.js");
|
|
6
|
-
const ExtTable = /* @__PURE__ */ _pluginVue_exportHelper.default(ExtTable_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-
|
|
6
|
+
const ExtTable = /* @__PURE__ */ _pluginVue_exportHelper.default(ExtTable_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-8476b82b"]]);
|
|
7
7
|
exports.default = ExtTable;
|
|
8
8
|
//# sourceMappingURL=ExtTable.vue.js.map
|
|
@@ -25,7 +25,7 @@ const ColumnSetting = require("./ColumnSetting.vue.js");
|
|
|
25
25
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
26
26
|
const dayjs__default = /* @__PURE__ */ _interopDefault(dayjs);
|
|
27
27
|
const sortablejs__default = /* @__PURE__ */ _interopDefault(sortablejs);
|
|
28
|
-
const _withScopeId = (n) => (vue.pushScopeId("data-v-
|
|
28
|
+
const _withScopeId = (n) => (vue.pushScopeId("data-v-8476b82b"), n = n(), vue.popScopeId(), n);
|
|
29
29
|
const _hoisted_1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode(
|
|
30
30
|
"svg",
|
|
31
31
|
{
|
|
@@ -62,12 +62,14 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
62
62
|
formatMappings: {},
|
|
63
63
|
prefixCls: { default: void 0 },
|
|
64
64
|
size: {},
|
|
65
|
+
scroll: {},
|
|
65
66
|
dataSource: { default: void 0 },
|
|
66
67
|
toolbar: { default: void 0 },
|
|
67
68
|
fixedColumns: {},
|
|
68
69
|
requiredColumns: {},
|
|
69
70
|
tableId: { default: void 0 },
|
|
70
71
|
showPagination: { type: Boolean, default: true },
|
|
72
|
+
paginationProps: {},
|
|
71
73
|
paginationPosition: { default: "right" },
|
|
72
74
|
defaultPageSize: { default: 20 },
|
|
73
75
|
pageSizeOptions: { default: () => components_extTable_helpers.TABLE_PAGE_SIZE_OPTIONS },
|
|
@@ -438,10 +440,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
438
440
|
},
|
|
439
441
|
{ immediate: true }
|
|
440
442
|
);
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
}
|
|
443
|
+
let queryVersion = 0;
|
|
444
|
+
const loadPage = (canRetryLastPage = true) => {
|
|
445
|
+
const version = ++queryVersion;
|
|
445
446
|
return new Promise((resolve) => {
|
|
446
447
|
isLoading.value = true;
|
|
447
448
|
const queryParams = {
|
|
@@ -451,9 +452,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
451
452
|
},
|
|
452
453
|
...props.sortRemote ? { sorter: tableSorter.value } : {},
|
|
453
454
|
success: (data = { list: [], count: 0 }) => {
|
|
455
|
+
if (version !== queryVersion) return resolve();
|
|
454
456
|
if (data.list.length === 0 && props.showPagination && currentPage.value > 1) {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
+
const lastPage = Math.max(1, Math.ceil(data.count / pageSize.value));
|
|
458
|
+
currentPage.value = canRetryLastPage && lastPage < currentPage.value ? lastPage : 1;
|
|
459
|
+
loadPage(false).then(resolve);
|
|
457
460
|
return;
|
|
458
461
|
}
|
|
459
462
|
isLoading.value = false;
|
|
@@ -465,6 +468,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
465
468
|
resolve();
|
|
466
469
|
},
|
|
467
470
|
fail: (err) => {
|
|
471
|
+
if (version !== queryVersion) return resolve();
|
|
468
472
|
isLoading.value = false;
|
|
469
473
|
if (err && lodashEs.isPlainObject(err) && err.message) {
|
|
470
474
|
antDesignVue.message.error({
|
|
@@ -484,6 +488,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
484
488
|
emits("query", queryParams);
|
|
485
489
|
});
|
|
486
490
|
};
|
|
491
|
+
const loadData = (isResetPage = false) => {
|
|
492
|
+
if (isResetPage) currentPage.value = 1;
|
|
493
|
+
return loadPage();
|
|
494
|
+
};
|
|
487
495
|
const onTableChange = (_pagination, _filters, sorter, extra) => {
|
|
488
496
|
emits("change", _pagination, _filters, sorter, extra);
|
|
489
497
|
if (!props.sortRemote) {
|
|
@@ -519,6 +527,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
519
527
|
refreshColumns(true);
|
|
520
528
|
};
|
|
521
529
|
const reset = () => {
|
|
530
|
+
queryVersion++;
|
|
522
531
|
total.value = 0;
|
|
523
532
|
pageSize.value = props.defaultPageSize;
|
|
524
533
|
currentPage.value = 1;
|
|
@@ -758,6 +767,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
758
767
|
scheduleUndefinedColumnWidthMeasurement();
|
|
759
768
|
});
|
|
760
769
|
vue.onUnmounted(() => {
|
|
770
|
+
queryVersion++;
|
|
761
771
|
isTableMounted = false;
|
|
762
772
|
columnWidthMeasureVersion++;
|
|
763
773
|
destroySortable();
|
|
@@ -768,6 +778,21 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
768
778
|
pageSize.value = size;
|
|
769
779
|
loadData();
|
|
770
780
|
};
|
|
781
|
+
const paginationBindings = vue.computed(
|
|
782
|
+
() => props.paginationProps ?? {
|
|
783
|
+
current: currentPage.value,
|
|
784
|
+
pageSize: pageSize.value,
|
|
785
|
+
total: total.value,
|
|
786
|
+
showTotal: props.showTotal,
|
|
787
|
+
pageSizeOptions: props.pageSizeOptions,
|
|
788
|
+
showSizeChanger: props.showSizeChanger,
|
|
789
|
+
onChange: onPageChange
|
|
790
|
+
}
|
|
791
|
+
);
|
|
792
|
+
const showPaginationControls = vue.computed(() => {
|
|
793
|
+
const { hideOnSinglePage, total: total2 = 0, pageSize: pageSize2, defaultPageSize = 10 } = paginationBindings.value;
|
|
794
|
+
return props.showPagination && (!hideOnSinglePage || total2 > (pageSize2 ?? defaultPageSize));
|
|
795
|
+
});
|
|
771
796
|
const isSlot = (column, type) => {
|
|
772
797
|
return lodashEs.get(column, "format.type") === type;
|
|
773
798
|
};
|
|
@@ -801,7 +826,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
801
826
|
return lodashEs.get(row, column.dataIndex, defaultValue || props.emptyValue);
|
|
802
827
|
};
|
|
803
828
|
const formatIndex = (index) => {
|
|
804
|
-
|
|
829
|
+
const current = props.paginationProps?.current ?? currentPage.value;
|
|
830
|
+
const size = props.paginationProps?.pageSize ?? pageSize.value;
|
|
831
|
+
return (current - 1) * size + index + 1;
|
|
805
832
|
};
|
|
806
833
|
const formatFileType = (row, column) => {
|
|
807
834
|
const value = lodashEs.get(row, column.dataIndex);
|
|
@@ -1187,6 +1214,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
1187
1214
|
disabled: vue.unref(isNestedExtTable) || !_ctx.scrollTable,
|
|
1188
1215
|
"row-selection": computedRowSelection.value,
|
|
1189
1216
|
size: _ctx.size,
|
|
1217
|
+
scroll: _ctx.scroll,
|
|
1190
1218
|
bordered: _ctx.bordered,
|
|
1191
1219
|
columns: columnList.value,
|
|
1192
1220
|
loading: isLoading.value,
|
|
@@ -1453,7 +1481,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
1453
1481
|
]),
|
|
1454
1482
|
key: "2"
|
|
1455
1483
|
} : void 0,
|
|
1456
|
-
|
|
1484
|
+
showPaginationControls.value || computedBatchOperations.value && computedBatchOperations.value.length > 0 || _ctx.$slots["batch-operators"] ? {
|
|
1457
1485
|
name: "default",
|
|
1458
1486
|
fn: vue.withCtx(() => [
|
|
1459
1487
|
vue.createVNode(vue.unref(antDesignVue.Flex), {
|
|
@@ -1500,21 +1528,19 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
1500
1528
|
clear: handleClearSelection
|
|
1501
1529
|
}, void 0, true) : vue.createCommentVNode("v-if", true)
|
|
1502
1530
|
]),
|
|
1503
|
-
|
|
1531
|
+
showPaginationControls.value ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Flex), {
|
|
1504
1532
|
key: 0,
|
|
1505
1533
|
justify: paginationJustify.value,
|
|
1506
1534
|
class: "ext-table-pagination"
|
|
1507
1535
|
}, {
|
|
1508
1536
|
default: vue.withCtx(() => [
|
|
1509
|
-
vue.createVNode(
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
onChange: onPageChange
|
|
1517
|
-
}, null, 8, ["current", "page-size", "total", "show-total", "page-size-options", "show-size-changer"])
|
|
1537
|
+
vue.createVNode(
|
|
1538
|
+
vue.unref(antDesignVue.Pagination),
|
|
1539
|
+
vue.normalizeProps(vue.guardReactiveProps(paginationBindings.value)),
|
|
1540
|
+
null,
|
|
1541
|
+
16
|
|
1542
|
+
/* FULL_PROPS */
|
|
1543
|
+
)
|
|
1518
1544
|
]),
|
|
1519
1545
|
_: 1
|
|
1520
1546
|
/* STABLE */
|
|
@@ -1526,9 +1552,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
1526
1552
|
]),
|
|
1527
1553
|
key: "3"
|
|
1528
1554
|
} : void 0
|
|
1529
|
-
]), 1040, ["disabled", "row-selection", "size", "bordered", "columns", "loading", "data-source", "row-key"]),
|
|
1555
|
+
]), 1040, ["disabled", "row-selection", "size", "scroll", "bordered", "columns", "loading", "data-source", "row-key"]),
|
|
1530
1556
|
vue.createCommentVNode(" pagination "),
|
|
1531
|
-
|
|
1557
|
+
showPaginationControls.value || computedBatchOperations.value && computedBatchOperations.value.length > 0 || _ctx.$slots["batch-operators"] ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Flex), {
|
|
1532
1558
|
key: 1,
|
|
1533
1559
|
justify: "space-between",
|
|
1534
1560
|
align: "center",
|
|
@@ -1573,21 +1599,19 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
1573
1599
|
clear: handleClearSelection
|
|
1574
1600
|
}, void 0, true) : vue.createCommentVNode("v-if", true)
|
|
1575
1601
|
]),
|
|
1576
|
-
|
|
1602
|
+
showPaginationControls.value ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Flex), {
|
|
1577
1603
|
key: 0,
|
|
1578
1604
|
justify: paginationJustify.value,
|
|
1579
1605
|
class: "ext-table-pagination"
|
|
1580
1606
|
}, {
|
|
1581
1607
|
default: vue.withCtx(() => [
|
|
1582
|
-
vue.createVNode(
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
onChange: onPageChange
|
|
1590
|
-
}, null, 8, ["current", "page-size", "total", "show-total", "page-size-options", "show-size-changer"])
|
|
1608
|
+
vue.createVNode(
|
|
1609
|
+
vue.unref(antDesignVue.Pagination),
|
|
1610
|
+
vue.normalizeProps(vue.guardReactiveProps(paginationBindings.value)),
|
|
1611
|
+
null,
|
|
1612
|
+
16
|
|
1613
|
+
/* FULL_PROPS */
|
|
1614
|
+
)
|
|
1591
1615
|
]),
|
|
1592
1616
|
_: 1
|
|
1593
1617
|
/* STABLE */
|