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