@fecp/mobile 1.1.30 → 1.1.31

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,8 +1,9 @@
1
1
  "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
2
3
  require("../ui/index.js");
3
4
  const grid = require("./src/grid.js");
4
5
  const index_esm = require("../../../../../@vxe-ui_core@4.1.3_vue@3.5.13_typescript@5.7.3_/node_modules/@vxe-ui/core/es/index.esm.js");
5
- Object.assign({}, grid.default, {
6
+ const VxeGrid = Object.assign({}, grid.default, {
6
7
  install(app) {
7
8
  app.component(grid.default.name, grid.default);
8
9
  }
@@ -11,3 +12,5 @@ if (index_esm.VxeUI.dynamicApp) {
11
12
  index_esm.VxeUI.dynamicApp.component(grid.default.name, grid.default);
12
13
  }
13
14
  index_esm.VxeUI.component(grid.default);
15
+ exports.VxeGrid = VxeGrid;
16
+ exports.default = VxeGrid;
@@ -255,6 +255,41 @@ function isColumnInfo(column) {
255
255
  function createColumn($xeTable, options, renderOptions) {
256
256
  return isColumnInfo(options) ? options : vue.reactive(new columnInfo.ColumnInfo($xeTable, options, renderOptions));
257
257
  }
258
+ function watchColumn($xeTable, props, column) {
259
+ Object.keys(props).forEach((name) => {
260
+ vue.watch(() => props[name], (value) => {
261
+ column.update(name, value);
262
+ if ($xeTable) {
263
+ if (name === "filters") {
264
+ $xeTable.setFilter(column, value);
265
+ $xeTable.handleUpdateDataQueue();
266
+ } else if (["visible", "fixed", "width", "minWidth", "maxWidth"].includes(name)) {
267
+ $xeTable.handleRefreshColumnQueue();
268
+ }
269
+ }
270
+ });
271
+ });
272
+ }
273
+ function assembleColumn($xeTable, elem, column, colgroup) {
274
+ const { reactData } = $xeTable;
275
+ const { staticColumns } = reactData;
276
+ const parentElem = elem.parentNode;
277
+ const parentColumn = colgroup ? colgroup.columnConfig : null;
278
+ const parentCols = parentColumn ? parentColumn.children : staticColumns;
279
+ if (parentElem && parentCols) {
280
+ parentCols.splice(index.default.arrayIndexOf(parentElem.children, elem), 0, column);
281
+ reactData.staticColumns = staticColumns.slice(0);
282
+ }
283
+ }
284
+ function destroyColumn($xeTable, column) {
285
+ const { reactData } = $xeTable;
286
+ const { staticColumns } = reactData;
287
+ const matchObj = index.default.findTree(staticColumns, (item) => item.id === column.id, { children: "children" });
288
+ if (matchObj) {
289
+ matchObj.items.splice(matchObj.index, 1);
290
+ }
291
+ reactData.staticColumns = staticColumns.slice(0);
292
+ }
258
293
  function getRootColumn($xeTable, column) {
259
294
  const { internalData } = $xeTable;
260
295
  const { fullColumnIdData } = internalData;
@@ -468,6 +503,7 @@ function colToVisible($xeTable, column, row) {
468
503
  }
469
504
  return Promise.resolve();
470
505
  }
506
+ exports.assembleColumn = assembleColumn;
471
507
  exports.calcTreeLine = calcTreeLine;
472
508
  exports.clearTableAllStatus = clearTableAllStatus;
473
509
  exports.clearTableDefaultStatus = clearTableDefaultStatus;
@@ -476,6 +512,7 @@ exports.convertHeaderColumnToRows = convertHeaderColumnToRows;
476
512
  exports.createColumn = createColumn;
477
513
  exports.createHandleGetRowId = createHandleGetRowId;
478
514
  exports.createHandleUpdateRowId = createHandleUpdateRowId;
515
+ exports.destroyColumn = destroyColumn;
479
516
  exports.encodeRowid = encodeRowid;
480
517
  exports.getCellHeight = getCellHeight;
481
518
  exports.getCellValue = getCellValue;
@@ -497,3 +534,4 @@ exports.toFilters = toFilters;
497
534
  exports.toTreePathSeq = toTreePathSeq;
498
535
  exports.updateDeepRowKey = updateDeepRowKey;
499
536
  exports.updateFastRowKey = updateFastRowKey;
537
+ exports.watchColumn = watchColumn;
@@ -102,7 +102,7 @@ function getEventTargetNode(evnt, container, queryCls, queryMethod) {
102
102
  let targetElem;
103
103
  let target = evnt.target.shadowRoot && evnt.composed ? evnt.composedPath()[0] || evnt.target : evnt.target;
104
104
  while (target && target.nodeType && target !== document) {
105
- if (queryCls && hasClass(target, queryCls) && true) {
105
+ if (queryCls && hasClass(target, queryCls) && (!queryMethod || queryMethod(target))) {
106
106
  targetElem = target;
107
107
  } else if (target === container) {
108
108
  return { flag: queryCls ? !!targetElem : true, container, targetElem };
@@ -111,7 +111,31 @@ function getEventTargetNode(evnt, container, queryCls, queryMethod) {
111
111
  }
112
112
  return { flag: false };
113
113
  }
114
+ function getAbsolutePos(elem) {
115
+ const bounding = elem.getBoundingClientRect();
116
+ const boundingTop = bounding.top;
117
+ const boundingLeft = bounding.left;
118
+ const { scrollTop, scrollLeft, visibleHeight, visibleWidth } = getDomNode();
119
+ return { boundingTop, top: scrollTop + boundingTop, boundingLeft, left: scrollLeft + boundingLeft, visibleHeight, visibleWidth };
120
+ }
121
+ const scrollIntoViewIfNeeded = "scrollIntoViewIfNeeded";
122
+ const scrollIntoView = "scrollIntoView";
123
+ function scrollToView(elem) {
124
+ if (elem) {
125
+ if (elem[scrollIntoViewIfNeeded]) {
126
+ elem[scrollIntoViewIfNeeded]();
127
+ } else if (elem[scrollIntoView]) {
128
+ elem[scrollIntoView]();
129
+ }
130
+ }
131
+ }
132
+ function triggerEvent(targetElem, type) {
133
+ if (targetElem) {
134
+ targetElem.dispatchEvent(new Event(type));
135
+ }
136
+ }
114
137
  exports.addClass = addClass;
138
+ exports.getAbsolutePos = getAbsolutePos;
115
139
  exports.getDomNode = getDomNode;
116
140
  exports.getEventTargetNode = getEventTargetNode;
117
141
  exports.getOffsetHeight = getOffsetHeight;
@@ -125,7 +149,9 @@ exports.isPx = isPx;
125
149
  exports.isScale = isScale;
126
150
  exports.queryElement = queryElement;
127
151
  exports.removeClass = removeClass;
152
+ exports.scrollToView = scrollToView;
128
153
  exports.setScrollLeft = setScrollLeft;
129
154
  exports.setScrollTop = setScrollTop;
130
155
  exports.toCssUnit = toCssUnit;
156
+ exports.triggerEvent = triggerEvent;
131
157
  exports.updateCellTitle = updateCellTitle;
@@ -1,6 +1,32 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const index = require("../../../../../../../../_virtual/index.js");
4
+ function getOnName(type) {
5
+ return "on" + type.substring(0, 1).toLocaleUpperCase() + type.substring(1);
6
+ }
7
+ function getModelEvent(renderOpts) {
8
+ switch (renderOpts.name) {
9
+ case "input":
10
+ case "textarea":
11
+ return "input";
12
+ case "select":
13
+ return "change";
14
+ }
15
+ return "update:modelValue";
16
+ }
17
+ function getChangeEvent(renderOpts) {
18
+ switch (renderOpts.name) {
19
+ case "input":
20
+ case "textarea":
21
+ case "VxeInput":
22
+ case "VxeNumberInput":
23
+ case "VxeTextarea":
24
+ case "$input":
25
+ case "$textarea":
26
+ return "input";
27
+ }
28
+ return "change";
29
+ }
4
30
  function getSlotVNs(vns) {
5
31
  if (vns === null || vns === void 0) {
6
32
  return [];
@@ -10,4 +36,7 @@ function getSlotVNs(vns) {
10
36
  }
11
37
  return [vns];
12
38
  }
39
+ exports.getChangeEvent = getChangeEvent;
40
+ exports.getModelEvent = getModelEvent;
41
+ exports.getOnName = getOnName;
13
42
  exports.getSlotVNs = getSlotVNs;
@@ -8,13 +8,13 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
8
8
  ;/* empty css */
9
9
  ;/* empty css */
10
10
  const vue = require("vue");
11
- ;/* empty css */
12
- const _pluginVue_exportHelper = require("../../../../../../_virtual/_plugin-vue_export-helper.js");
13
11
  ;/* empty css */
14
12
  ;/* empty css */
15
13
  ;/* empty css */
16
14
  ;/* empty css */
17
15
  ;/* empty css */
16
+ ;/* empty css */
17
+ const _pluginVue_exportHelper = require("../../../../../../_virtual/_plugin-vue_export-helper.js");
18
18
  const index$1 = require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/swipe-cell/index.js");
19
19
  const functionCall = require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/dialog/function-call.js");
20
20
  require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/dialog/index.js");
@@ -5,8 +5,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
5
5
  ;/* empty css */
6
6
  ;/* empty css */
7
7
  const vue = require("vue");
8
- require("../../../../../../node_modules/.pnpm/vxe-table@4.13.27_vue@3.5.13_typescript@5.7.3_/node_modules/vxe-table/es/grid/index.js");
9
- ;/* empty css */
8
+ require("../../../../../../node_modules/.pnpm/vxe-table@4.13.27_vue@3.5.13_typescript@5.7.3_/node_modules/vxe-table/es/components.js");
10
9
  const dataSourceUtil = require("../../../utils/dataSourceUtil.js");
11
10
  ;/* empty css */
12
11
  const formatterUtil = require("../../../utils/formatterUtil.js");
@@ -20,11 +19,20 @@ const formatterUtil = require("../../../utils/formatterUtil.js");
20
19
  ;/* empty css */
21
20
  ;/* empty css */
22
21
  const _pluginVue_exportHelper = require("../../../../../../_virtual/_plugin-vue_export-helper.js");
22
+ const index$4 = require("../../../../../../node_modules/.pnpm/vxe-table@4.13.27_vue@3.5.13_typescript@5.7.3_/node_modules/vxe-table/es/grid/index.js");
23
23
  const index = require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/swipe-cell/index.js");
24
24
  const index$1 = require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/button/index.js");
25
25
  const functionCall = require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/dialog/function-call.js");
26
26
  const index$2 = require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/cell-group/index.js");
27
27
  const index$3 = require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/list/index.js");
28
+ const _hoisted_1 = {
29
+ key: 0,
30
+ class: "van-list__finished-text"
31
+ };
32
+ const _hoisted_2 = {
33
+ key: 1,
34
+ class: "van-list__loading"
35
+ };
28
36
  const _sfc_main = {
29
37
  __name: "Table",
30
38
  props: {
@@ -127,7 +135,7 @@ const _sfc_main = {
127
135
  return props.height + "px";
128
136
  }
129
137
  });
130
- vue.computed(() => {
138
+ const columnOptions = vue.computed(() => {
131
139
  const columns = [...props.columns];
132
140
  columns.forEach((col) => {
133
141
  switch (col.dataType) {
@@ -276,6 +284,11 @@ const _sfc_main = {
276
284
  });
277
285
  }
278
286
  };
287
+ const virtualYConfig = {
288
+ enabled: false,
289
+ gt: 0,
290
+ threshold: 0
291
+ };
279
292
  const tableData = vue.computed({
280
293
  get: () => {
281
294
  return props.modelValue;
@@ -374,6 +387,9 @@ const _sfc_main = {
374
387
  initLoading.value = false;
375
388
  });
376
389
  }
390
+ function errReload() {
391
+ call();
392
+ }
377
393
  function checkHasScroll() {
378
394
  if (!props.isFixedHead) {
379
395
  return;
@@ -402,8 +418,6 @@ const _sfc_main = {
402
418
  }
403
419
  }
404
420
  return (_ctx, _cache) => {
405
- const _component_vxe_column = vue.resolveComponent("vxe-column");
406
- const _component_vxe_table = vue.resolveComponent("vxe-table");
407
421
  const _component_van_list = index$3.List;
408
422
  const _component_van_cell_group = index$2.CellGroup;
409
423
  return vue.openBlock(), vue.createBlock(_component_van_cell_group, {
@@ -432,35 +446,100 @@ const _sfc_main = {
432
446
  onLoad
433
447
  }, {
434
448
  default: vue.withCtx(() => [
435
- vue.createVNode(_component_vxe_table, { data: vue.unref(tableData) }, {
436
- default: vue.withCtx(() => [
437
- vue.createVNode(_component_vxe_column, {
438
- type: "seq",
439
- width: "60"
440
- }),
441
- vue.createVNode(_component_vxe_column, {
442
- field: "name",
443
- title: "Name"
444
- }),
445
- vue.createVNode(_component_vxe_column, {
446
- field: "sex",
447
- title: "Sex"
448
- }),
449
- vue.createVNode(_component_vxe_column, {
450
- field: "age",
451
- title: "Age"
452
- })
449
+ vue.createVNode(vue.unref(index$4.VxeGrid), {
450
+ ref_key: "gridRef",
451
+ ref: gridRef,
452
+ class: "fec-table",
453
+ "auto-resize": "",
454
+ data: vue.unref(tableData),
455
+ columns: vue.unref(columnOptions),
456
+ size: __props.size,
457
+ headerAlign: "center",
458
+ footerAlign: "center",
459
+ align: "center",
460
+ border: __props.border,
461
+ round: __props.round || __props.isCard,
462
+ stripe: __props.stripe,
463
+ height: __props.isFixedHead ? vue.unref(compHeight) : "",
464
+ minHeight: 200,
465
+ loading: vue.unref(initLoading),
466
+ showHeader: __props.showHeader,
467
+ onScrollBoundary: onScrollLoads,
468
+ virtualYConfig
469
+ }, vue.createSlots({
470
+ loading: vue.withCtx(() => [
471
+ _cache[2] || (_cache[2] = vue.createElementVNode("div", {
472
+ class: "custom-loading van-loading van-loading--circular van-list__loading-icon",
473
+ "aria-live": "polite",
474
+ "aria-busy": "true"
475
+ }, [
476
+ vue.createElementVNode("span", { class: "van-loading__spinner van-loading__spinner--circular" }, [
477
+ vue.createElementVNode("svg", {
478
+ class: "van-loading__circular",
479
+ viewBox: "25 25 50 50"
480
+ }, [
481
+ vue.createElementVNode("circle", {
482
+ cx: "50",
483
+ cy: "50",
484
+ r: "20",
485
+ fill: "none"
486
+ })
487
+ ])
488
+ ]),
489
+ vue.createElementVNode("span", { class: "van-loading__text" }, "加载中...")
490
+ ], -1))
491
+ ]),
492
+ bottom: vue.withCtx(() => [
493
+ __props.scrollLoad && __props.isFixedHead ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
494
+ vue.unref(finished) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, " 没有更多了 ")) : vue.createCommentVNode("", true),
495
+ vue.unref(loading) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, _cache[3] || (_cache[3] = [
496
+ vue.createElementVNode("div", {
497
+ class: "van-loading van-loading--circular van-list__loading-icon",
498
+ "aria-live": "polite",
499
+ "aria-busy": "true"
500
+ }, [
501
+ vue.createElementVNode("span", { class: "van-loading__spinner van-loading__spinner--circular" }, [
502
+ vue.createElementVNode("svg", {
503
+ class: "van-loading__circular",
504
+ viewBox: "25 25 50 50"
505
+ }, [
506
+ vue.createElementVNode("circle", {
507
+ cx: "50",
508
+ cy: "50",
509
+ r: "20",
510
+ fill: "none"
511
+ })
512
+ ])
513
+ ]),
514
+ vue.createElementVNode("span", { class: "van-loading__text" }, "加载中...")
515
+ ], -1)
516
+ ]))) : vue.createCommentVNode("", true),
517
+ vue.unref(error) ? (vue.openBlock(), vue.createElementBlock("div", {
518
+ key: 2,
519
+ class: "van-list__error-text",
520
+ onClick: errReload
521
+ }, " 请求失败,点击重新加载 ")) : vue.createCommentVNode("", true)
522
+ ], 64)) : vue.createCommentVNode("", true)
453
523
  ]),
454
- _: 1
455
- }, 8, ["data"])
524
+ _: 2
525
+ }, [
526
+ vue.renderList(_ctx.$slots, (item, key) => {
527
+ return {
528
+ name: key,
529
+ fn: vue.withCtx(() => [
530
+ key != "bottom" ? vue.renderSlot(_ctx.$slots, key, { key: 0 }, void 0, true) : vue.createCommentVNode("", true)
531
+ ])
532
+ };
533
+ })
534
+ ]), 1032, ["data", "columns", "size", "border", "round", "stripe", "height", "loading", "showHeader"])
456
535
  ]),
457
- _: 1
536
+ _: 3
458
537
  }, 8, ["class", "loading", "error", "finished", "disabled"])
459
538
  ]),
460
- _: 1
539
+ _: 3
461
540
  }, 8, ["class", "style", "inset"]);
462
541
  };
463
542
  }
464
543
  };
465
- const _Table = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-8b0e4266"]]);
544
+ const _Table = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-a3ac8e87"]]);
466
545
  exports.default = _Table;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fecp/mobile",
3
- "version": "1.1.30",
3
+ "version": "1.1.31",
4
4
  "main": "lib/packages/mobile/index.js",
5
5
  "module": "es/packages/mobile/index.mjs",
6
6
  "files": [