@94ai/nf-search-form 8.0.14 → 8.0.16

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.
@@ -557,8 +557,16 @@ __sfc_main$3.setup = (__props, __ctx) => {
557
557
  };
558
558
  const handleInput = (event) => {
559
559
  var _a2, _b;
560
+ if (typeof event === "string") {
561
+ currentVal.value = event.trim();
562
+ }
560
563
  if ((_b = (_a2 = props.itemOptions) == null ? void 0 : _a2.events) == null ? void 0 : _b.keyup) {
561
- props.itemOptions.events.keyup(event, instance);
564
+ props.itemOptions.events.keyup(currentVal.value, instance);
565
+ }
566
+ };
567
+ const trimInput = (event) => {
568
+ if (typeof event.target.value === "string") {
569
+ event.target.value = event.target.value.trim();
562
570
  }
563
571
  };
564
572
  return {
@@ -600,7 +608,8 @@ __sfc_main$3.setup = (__props, __ctx) => {
600
608
  isNumberRange,
601
609
  isTransferSelect,
602
610
  handleChange,
603
- handleInput
611
+ handleInput,
612
+ trimInput
604
613
  };
605
614
  };
606
615
  __sfc_main$3.components = Object.assign({
@@ -663,6 +672,11 @@ var _sfc_render$3 = function render3() {
663
672
  on: {
664
673
  "change": _vm.handleChange
665
674
  },
675
+ nativeOn: {
676
+ "input": function($event) {
677
+ return _vm.trimInput.apply(null, arguments);
678
+ }
679
+ },
666
680
  model: {
667
681
  value: _vm.currentVal,
668
682
  callback: function($$v) {
@@ -679,6 +693,11 @@ var _sfc_render$3 = function render3() {
679
693
  on: {
680
694
  "change": _vm.handleChange
681
695
  },
696
+ nativeOn: {
697
+ "input": function($event) {
698
+ return _vm.trimInput.apply(null, arguments);
699
+ }
700
+ },
682
701
  model: {
683
702
  value: _vm.currentVal,
684
703
  callback: function($$v) {
@@ -6518,6 +6537,9 @@ __sfc_main$1.setup = (__props, __ctx) => {
6518
6537
  });
6519
6538
  throw new Error(props.selectEmptyWarningTips);
6520
6539
  }
6540
+ currentTable.value.filter((item) => item.initHidden).forEach((item) => {
6541
+ newTableColumns.push(item);
6542
+ });
6521
6543
  const columnState = {};
6522
6544
  const obj = {};
6523
6545
  newTableColumns.map((i, index2) => {
@@ -555,8 +555,16 @@ __sfc_main$3.setup = (__props, __ctx) => {
555
555
  };
556
556
  const handleInput = (event) => {
557
557
  var _a2, _b;
558
+ if (typeof event === "string") {
559
+ currentVal.value = event.trim();
560
+ }
558
561
  if ((_b = (_a2 = props.itemOptions) == null ? void 0 : _a2.events) == null ? void 0 : _b.keyup) {
559
- props.itemOptions.events.keyup(event, instance);
562
+ props.itemOptions.events.keyup(currentVal.value, instance);
563
+ }
564
+ };
565
+ const trimInput = (event) => {
566
+ if (typeof event.target.value === "string") {
567
+ event.target.value = event.target.value.trim();
560
568
  }
561
569
  };
562
570
  return {
@@ -598,7 +606,8 @@ __sfc_main$3.setup = (__props, __ctx) => {
598
606
  isNumberRange,
599
607
  isTransferSelect,
600
608
  handleChange,
601
- handleInput
609
+ handleInput,
610
+ trimInput
602
611
  };
603
612
  };
604
613
  __sfc_main$3.components = Object.assign({
@@ -661,6 +670,11 @@ var _sfc_render$3 = function render3() {
661
670
  on: {
662
671
  "change": _vm.handleChange
663
672
  },
673
+ nativeOn: {
674
+ "input": function($event) {
675
+ return _vm.trimInput.apply(null, arguments);
676
+ }
677
+ },
664
678
  model: {
665
679
  value: _vm.currentVal,
666
680
  callback: function($$v) {
@@ -677,6 +691,11 @@ var _sfc_render$3 = function render3() {
677
691
  on: {
678
692
  "change": _vm.handleChange
679
693
  },
694
+ nativeOn: {
695
+ "input": function($event) {
696
+ return _vm.trimInput.apply(null, arguments);
697
+ }
698
+ },
680
699
  model: {
681
700
  value: _vm.currentVal,
682
701
  callback: function($$v) {
@@ -6516,6 +6535,9 @@ __sfc_main$1.setup = (__props, __ctx) => {
6516
6535
  });
6517
6536
  throw new Error(props.selectEmptyWarningTips);
6518
6537
  }
6538
+ currentTable.value.filter((item) => item.initHidden).forEach((item) => {
6539
+ newTableColumns.push(item);
6540
+ });
6519
6541
  const columnState = {};
6520
6542
  const obj = {};
6521
6543
  newTableColumns.map((i, index2) => {
@@ -446,21 +446,24 @@ const syncTableColumnsToCookies = () => {
446
446
  })
447
447
  throw new Error(props.selectEmptyWarningTips)
448
448
  }
449
- const columnState = {}
450
- const obj: Record<string, any> = {}
451
- newTableColumns.map((i, index) => {
452
- columnState[i.prop] = {
453
- initHidden: i.initHidden || false,
454
- fixed: i.attr?.fixed || false,
455
- prop: i.prop,
456
- index
457
- }
458
- obj[i.prop] = !columnState[i.prop].initHidden
459
- })
460
- if (props.columnEdit) {
461
- CachedManager.syncCachedSet(props.storageKey, columnState)
449
+ currentTable.value.filter(item => item.initHidden).forEach(item => {
450
+ newTableColumns.push(item)
451
+ })
452
+ const columnState = {}
453
+ const obj: Record<string, any> = {}
454
+ newTableColumns.map((i, index) => {
455
+ columnState[i.prop] = {
456
+ initHidden: i.initHidden || false,
457
+ fixed: i.attr?.fixed || false,
458
+ prop: i.prop,
459
+ index
462
460
  }
463
- return obj
461
+ obj[i.prop] = !columnState[i.prop].initHidden
462
+ })
463
+ if (props.columnEdit) {
464
+ CachedManager.syncCachedSet(props.storageKey, columnState)
465
+ }
466
+ return obj
464
467
  }
465
468
 
466
469
  /**
@@ -31,6 +31,7 @@
31
31
  </el-input-number>
32
32
 
33
33
  <nf-virtual-select
34
+ @input.native="trimInput"
34
35
  v-if="isSelect"
35
36
  :width="width"
36
37
  v-model="currentVal"
@@ -42,6 +43,7 @@
42
43
  />
43
44
 
44
45
  <nf-lazy-select
46
+ @input.native="trimInput"
45
47
  v-if="isLazySelect"
46
48
  :width="width"
47
49
  v-model="currentVal"
@@ -569,7 +571,7 @@ const isTransferSelect = computed(() => {
569
571
  })
570
572
 
571
573
  const handleChange = (event) => {
572
- if (props.itemOptions?.events?.change) {
574
+ if (props.itemOptions?.events?.change) { // 回补change事件
573
575
  props.itemOptions.events.change(event, instance, props.nfSearchFormModel)
574
576
  }
575
577
  // 初始化关联属性
@@ -578,8 +580,17 @@ const handleChange = (event) => {
578
580
  }
579
581
  }
580
582
  const handleInput = (event) => {
581
- if (props.itemOptions?.events?.keyup) {
582
- props.itemOptions.events.keyup(event, instance)
583
+ if (typeof event === 'string') {
584
+ currentVal.value = event.trim()
585
+ }
586
+ if (props.itemOptions?.events?.keyup) { // 新增keyup事件
587
+ props.itemOptions.events.keyup(currentVal.value, instance)
588
+ }
589
+ }
590
+
591
+ const trimInput = (event) => { // 表单类trim左右空格方便复制粘贴
592
+ if (typeof event.target.value === 'string') {
593
+ event.target.value = event.target.value.trim()
583
594
  }
584
595
  }
585
596
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@94ai/nf-search-form",
3
- "version": "8.0.14",
3
+ "version": "8.0.16",
4
4
  "description": "> TODO: description",
5
5
  "keywords": [],
6
6
  "author": "zoujiahe <zoujiahe@94ai.com>",
@@ -14,23 +14,23 @@
14
14
  "url": "http://94ai.gitlab.com/zoujiahe/common-ui.git"
15
15
  },
16
16
  "dependencies": {
17
- "@94ai/common-constants": "^8.0.14",
18
- "@94ai/common-utils": "^8.0.14",
19
- "@94ai/nf-button": "^8.0.14",
20
- "@94ai/nf-double-half-year": "^8.0.14",
21
- "@94ai/nf-double-quarter": "^8.0.14",
22
- "@94ai/nf-double-week": "^8.0.14",
23
- "@94ai/nf-double-year": "^8.0.14",
24
- "@94ai/nf-drawer": "^8.0.14",
25
- "@94ai/nf-form": "^8.0.14",
26
- "@94ai/nf-form-item": "^8.0.14",
27
- "@94ai/nf-half-year-picker": "^8.0.14",
28
- "@94ai/nf-lazy-select": "^8.0.14",
29
- "@94ai/nf-message": "^8.0.14",
30
- "@94ai/nf-quarter-picker": "^8.0.14",
31
- "@94ai/nf-theme-chalk": "^8.0.14",
32
- "@94ai/nf-transfer-select": "^8.0.14",
33
- "@94ai/nf-virtual-select": "^8.0.14",
17
+ "@94ai/common-constants": "^8.0.16",
18
+ "@94ai/common-utils": "^8.0.16",
19
+ "@94ai/nf-button": "^8.0.16",
20
+ "@94ai/nf-double-half-year": "^8.0.16",
21
+ "@94ai/nf-double-quarter": "^8.0.16",
22
+ "@94ai/nf-double-week": "^8.0.16",
23
+ "@94ai/nf-double-year": "^8.0.16",
24
+ "@94ai/nf-drawer": "^8.0.16",
25
+ "@94ai/nf-form": "^8.0.16",
26
+ "@94ai/nf-form-item": "^8.0.16",
27
+ "@94ai/nf-half-year-picker": "^8.0.16",
28
+ "@94ai/nf-lazy-select": "^8.0.16",
29
+ "@94ai/nf-message": "^8.0.16",
30
+ "@94ai/nf-quarter-picker": "^8.0.16",
31
+ "@94ai/nf-theme-chalk": "^8.0.16",
32
+ "@94ai/nf-transfer-select": "^8.0.16",
33
+ "@94ai/nf-virtual-select": "^8.0.16",
34
34
  "idb-keyval": "^6.2.1",
35
35
  "resize-observer-polyfill": "^1.5.1",
36
36
  "vue-demi": "^0.14.5",
@@ -50,5 +50,5 @@
50
50
  "types": "lib/index.d.ts",
51
51
  "main": "lib/nf-search-form.cjs.js",
52
52
  "module": "lib/nf-search-form.esm-bundler.js",
53
- "gitHead": "d72020ef037faebeb18b1e628a46bacb30006437"
53
+ "gitHead": "76a87fbc00a3fafca89d2a7592cb99e4feacf225"
54
54
  }