@94ai/nf-table 8.3.4 → 8.3.6

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.
@@ -38,7 +38,7 @@ declare const _default: import("vue-demi").DefineComponent<__VLS_WithDefaults<__
38
38
  isIndeterminate: import("vue-demi").Ref<boolean>;
39
39
  columnName: import("vue-demi").Ref<string>;
40
40
  searchValue: Record<string, any>[];
41
- checkedCount: import("vue-demi").Ref<number>;
41
+ checkedCount: import("vue-demi").Ref<string[]>;
42
42
  fields: import("vue-demi").Ref<{
43
43
  name: string;
44
44
  list: Record<string, any>[];
@@ -5360,7 +5360,7 @@ __sfc_main$1.setup = (__props, __ctx) => {
5360
5360
  updateColumn();
5361
5361
  if (currentTable.value.every((i) => !i.initHidden)) {
5362
5362
  showColumn.value = currentTable.value.map((i) => i.prop);
5363
- checkedCount.value = list.length;
5363
+ checkedCount.value = list.map((item) => item.prop || item.type);
5364
5364
  checkAll2.value = true;
5365
5365
  isIndeterminate.value = false;
5366
5366
  }
@@ -5387,7 +5387,10 @@ __sfc_main$1.setup = (__props, __ctx) => {
5387
5387
  }
5388
5388
  fields.value = items;
5389
5389
  };
5390
- const checkedCount = vueDemi.ref(0);
5390
+ const checkedCount = vueDemi.ref([]);
5391
+ const showCheckCount = vueDemi.computed(() => {
5392
+ return checkedCount.value.filter((item) => !(item === "selection" || item === props.operationPropKey)).length;
5393
+ });
5391
5394
  const updateColumn = () => {
5392
5395
  fixedColumn.value = [];
5393
5396
  unFixedColumn.value = [];
@@ -5427,14 +5430,14 @@ __sfc_main$1.setup = (__props, __ctx) => {
5427
5430
  const updateCheckStatus = () => {
5428
5431
  showColumn.value = currentTable.value.filter((i) => !i.initHidden).map((item) => item.prop);
5429
5432
  if (columnName.value && fields.value.length) {
5430
- checkedCount.value = searchValue.filter((i) => !i.initHidden).length;
5431
- checkAll2.value = checkedCount.value === searchValue.length;
5432
- isIndeterminate.value = checkedCount.value > 0 && checkedCount.value < searchValue.length;
5433
+ checkedCount.value = searchValue.filter((i) => !i.initHidden).map((item) => item.prop || item.type);
5434
+ checkAll2.value = checkedCount.value.length === searchValue.length;
5435
+ isIndeterminate.value = checkedCount.value.length > 0 && checkedCount.value.length < searchValue.length;
5433
5436
  return;
5434
5437
  }
5435
- checkedCount.value = showColumn.value.length;
5436
- checkAll2.value = checkedCount.value === currentTable.value.length;
5437
- isIndeterminate.value = checkedCount.value > 0 && checkedCount.value < currentTable.value.length;
5438
+ checkedCount.value = showColumn.value;
5439
+ checkAll2.value = checkedCount.value.length === currentTable.value.length;
5440
+ isIndeterminate.value = checkedCount.value.length > 0 && checkedCount.value.length < currentTable.value.length;
5438
5441
  };
5439
5442
  const columnName = vueDemi.ref("");
5440
5443
  let searchValue = [];
@@ -5619,7 +5622,7 @@ __sfc_main$1.setup = (__props, __ctx) => {
5619
5622
  fixedColumn,
5620
5623
  unFixedColumn,
5621
5624
  fields,
5622
- checkedCount,
5625
+ showCheckCount,
5623
5626
  columnName,
5624
5627
  handleSearch,
5625
5628
  checkAll: checkAll2,
@@ -5696,7 +5699,7 @@ var _sfc_render$2 = function render2() {
5696
5699
  },
5697
5700
  expression: "checkAll"
5698
5701
  }
5699
- }, [_vm._v(_vm._s(_vm.getAllCheckDesc(_vm.checkedCount)))]) : _vm._e()], 1), _c("div", {
5702
+ }, [_vm._v(_vm._s(_vm.getAllCheckDesc(_vm.showCheckCount)))]) : _vm._e()], 1), _c("div", {
5700
5703
  staticClass: "nf-select-column"
5701
5704
  }, _vm._l(_vm.fields, function(item, index2) {
5702
5705
  return _c("div", {
@@ -5358,7 +5358,7 @@ __sfc_main$1.setup = (__props, __ctx) => {
5358
5358
  updateColumn();
5359
5359
  if (currentTable.value.every((i) => !i.initHidden)) {
5360
5360
  showColumn.value = currentTable.value.map((i) => i.prop);
5361
- checkedCount.value = list.length;
5361
+ checkedCount.value = list.map((item) => item.prop || item.type);
5362
5362
  checkAll2.value = true;
5363
5363
  isIndeterminate.value = false;
5364
5364
  }
@@ -5385,7 +5385,10 @@ __sfc_main$1.setup = (__props, __ctx) => {
5385
5385
  }
5386
5386
  fields.value = items;
5387
5387
  };
5388
- const checkedCount = ref(0);
5388
+ const checkedCount = ref([]);
5389
+ const showCheckCount = computed(() => {
5390
+ return checkedCount.value.filter((item) => !(item === "selection" || item === props.operationPropKey)).length;
5391
+ });
5389
5392
  const updateColumn = () => {
5390
5393
  fixedColumn.value = [];
5391
5394
  unFixedColumn.value = [];
@@ -5425,14 +5428,14 @@ __sfc_main$1.setup = (__props, __ctx) => {
5425
5428
  const updateCheckStatus = () => {
5426
5429
  showColumn.value = currentTable.value.filter((i) => !i.initHidden).map((item) => item.prop);
5427
5430
  if (columnName.value && fields.value.length) {
5428
- checkedCount.value = searchValue.filter((i) => !i.initHidden).length;
5429
- checkAll2.value = checkedCount.value === searchValue.length;
5430
- isIndeterminate.value = checkedCount.value > 0 && checkedCount.value < searchValue.length;
5431
+ checkedCount.value = searchValue.filter((i) => !i.initHidden).map((item) => item.prop || item.type);
5432
+ checkAll2.value = checkedCount.value.length === searchValue.length;
5433
+ isIndeterminate.value = checkedCount.value.length > 0 && checkedCount.value.length < searchValue.length;
5431
5434
  return;
5432
5435
  }
5433
- checkedCount.value = showColumn.value.length;
5434
- checkAll2.value = checkedCount.value === currentTable.value.length;
5435
- isIndeterminate.value = checkedCount.value > 0 && checkedCount.value < currentTable.value.length;
5436
+ checkedCount.value = showColumn.value;
5437
+ checkAll2.value = checkedCount.value.length === currentTable.value.length;
5438
+ isIndeterminate.value = checkedCount.value.length > 0 && checkedCount.value.length < currentTable.value.length;
5436
5439
  };
5437
5440
  const columnName = ref("");
5438
5441
  let searchValue = [];
@@ -5617,7 +5620,7 @@ __sfc_main$1.setup = (__props, __ctx) => {
5617
5620
  fixedColumn,
5618
5621
  unFixedColumn,
5619
5622
  fields,
5620
- checkedCount,
5623
+ showCheckCount,
5621
5624
  columnName,
5622
5625
  handleSearch,
5623
5626
  checkAll: checkAll2,
@@ -5694,7 +5697,7 @@ var _sfc_render$2 = function render2() {
5694
5697
  },
5695
5698
  expression: "checkAll"
5696
5699
  }
5697
- }, [_vm._v(_vm._s(_vm.getAllCheckDesc(_vm.checkedCount)))]) : _vm._e()], 1), _c("div", {
5700
+ }, [_vm._v(_vm._s(_vm.getAllCheckDesc(_vm.showCheckCount)))]) : _vm._e()], 1), _c("div", {
5698
5701
  staticClass: "nf-select-column"
5699
5702
  }, _vm._l(_vm.fields, function(item, index2) {
5700
5703
  return _c("div", {
@@ -17,7 +17,7 @@
17
17
  v-model="checkAll"
18
18
  :indeterminate="isIndeterminate"
19
19
  @change="handleCheckAllChange"
20
- >{{ getAllCheckDesc(checkedCount) }}</el-checkbox>
20
+ >{{ getAllCheckDesc(showCheckCount) }}</el-checkbox>
21
21
  </div>
22
22
  <div class="nf-select-column">
23
23
  <div v-for="(item,index) in fields" :key="index + item.name" class="nf-column-category">
@@ -214,7 +214,7 @@ onBeforeMount(() => {
214
214
  updateColumn()
215
215
  if (currentTable.value.every(i => !i.initHidden)) {
216
216
  showColumn.value = currentTable.value.map(i => i.prop)
217
- checkedCount.value = list.length
217
+ checkedCount.value = list.map(item => item.prop || item.type)
218
218
  checkAll.value = true
219
219
  isIndeterminate.value = false
220
220
  }
@@ -260,7 +260,11 @@ const setFields = async(tableColumns) => {
260
260
  /**
261
261
  * 更新已选列表
262
262
  */
263
- const checkedCount = ref(0) // 勾选的数量
263
+ const checkedCount = ref<string[]>([]) // 勾选的
264
+
265
+ const showCheckCount = computed(() => {
266
+ return checkedCount.value.filter(item => !(item === 'selection' || item === props.operationPropKey)).length
267
+ })
264
268
  const updateColumn = () => {
265
269
  fixedColumn.value = []
266
270
  unFixedColumn.value = []
@@ -307,14 +311,14 @@ const updateCheckStatus = () => {
307
311
  // [全选 checkbox] 展示状态
308
312
  if (columnName.value && fields.value.length) {
309
313
  // 搜索时
310
- checkedCount.value = searchValue.filter(i => !i.initHidden).length
311
- checkAll.value = checkedCount.value === searchValue.length
312
- isIndeterminate.value = checkedCount.value > 0 && checkedCount.value < searchValue.length
314
+ checkedCount.value = searchValue.filter(i => !i.initHidden).map(item => item.prop || item.type)
315
+ checkAll.value = checkedCount.value.length === searchValue.length
316
+ isIndeterminate.value = checkedCount.value.length > 0 && checkedCount.value.length < searchValue.length
313
317
  return
314
318
  }
315
- checkedCount.value = showColumn.value.length
316
- checkAll.value = checkedCount.value === currentTable.value.length
317
- isIndeterminate.value = checkedCount.value > 0 && checkedCount.value < currentTable.value.length
319
+ checkedCount.value = showColumn.value
320
+ checkAll.value = checkedCount.value.length === currentTable.value.length
321
+ isIndeterminate.value = checkedCount.value.length > 0 && checkedCount.value.length < currentTable.value.length
318
322
  }
319
323
 
320
324
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@94ai/nf-table",
3
- "version": "8.3.4",
3
+ "version": "8.3.6",
4
4
  "description": "> TODO: description",
5
5
  "keywords": [],
6
6
  "author": "zoujiahe <zoujiahe@94ai.com>",
@@ -14,13 +14,13 @@
14
14
  "url": "http://94ai.gitlab.com/zoujiahe/common-ui.git"
15
15
  },
16
16
  "dependencies": {
17
- "@94ai/common-utils": "^8.3.4",
18
- "@94ai/nf-button": "^8.3.4",
19
- "@94ai/nf-drawer": "^8.3.4",
20
- "@94ai/nf-message": "^8.3.4",
21
- "@94ai/nf-search-form": "^8.3.4",
22
- "@94ai/nf-tag": "^8.3.4",
23
- "@94ai/nf-theme-chalk": "^8.3.4",
17
+ "@94ai/common-utils": "^8.3.6",
18
+ "@94ai/nf-button": "^8.3.6",
19
+ "@94ai/nf-drawer": "^8.3.6",
20
+ "@94ai/nf-message": "^8.3.6",
21
+ "@94ai/nf-search-form": "^8.3.6",
22
+ "@94ai/nf-tag": "^8.3.6",
23
+ "@94ai/nf-theme-chalk": "^8.3.6",
24
24
  "idb-keyval": "^6.2.1",
25
25
  "vue-demi": "^0.14.5",
26
26
  "vue-router": "3.6.4",
@@ -39,5 +39,5 @@
39
39
  "types": "lib/index.d.ts",
40
40
  "main": "lib/nf-table.cjs.js",
41
41
  "module": "lib/nf-table.esm-bundler.js",
42
- "gitHead": "d79d17da5054791bd9aac0240fd5ef916e2b0ab3"
42
+ "gitHead": "1ddd91dce7a3ef5d1f3f923ca0997cdd4e023d7a"
43
43
  }