w-table-vue 1.0.13 → 1.0.15

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.
Files changed (42) hide show
  1. package/README.md +1 -1
  2. package/dist/w-table-vue.umd.js +3 -3
  3. package/dist/w-table-vue.umd.js.map +1 -1
  4. package/docs/examples/app.html +1 -1
  5. package/docs/examples/app.umd.js +2 -2
  6. package/docs/examples/app.umd.js.map +1 -1
  7. package/docs/examples/w-table-edit_default.html +26 -1
  8. package/docs/examples/w-table-edit_editable.html +26 -1
  9. package/docs/examples/w-table-edit_editable_checkId.html +26 -1
  10. package/docs/examples/w-table-edit_editable_checkId_opt.modifyDataWhenSave_save(call cmp. method).html +26 -1
  11. package/docs/examples/w-table-edit_editable_checkId_successMsgFromAddRow_errorMsgFromAddRow.html +26 -1
  12. package/docs/examples/w-table-edit_editable_inforPaddingStyle_menuBackgroundColor.html +26 -1
  13. package/docs/examples/w-table-edit_editable_language_checkId_tooltipAddRow.html +26 -1
  14. package/docs/examples/w-table-edit_editable_language_textLabelDataName_textPlaceholderDataName.html +26 -1
  15. package/docs/examples/w-table-edit_editable_no enableInfor.html +26 -1
  16. package/docs/examples/w-table-edit_editable_no enableMenu.html +26 -1
  17. package/docs/examples/w-table-edit_editable_opt.beforeAddRow.html +26 -1
  18. package/docs/examples/w-table-edit_editable_opt.kpCellFormat_no useCellFormatWhenDownload.html +543 -0
  19. package/docs/examples/w-table-edit_editable_opt.kpConvertKeysWhenUploadData.html +26 -1
  20. package/docs/examples/w-table-edit_editable_opt.optForUploadData.html +26 -1
  21. package/docs/examples/w-table-edit_editable_slot btns-right.html +26 -1
  22. package/docs/examples/w-table-edit_fixIds (fix id).html +26 -1
  23. package/docs/examples/w-table-edit_hideIds (hide mappingId).html +26 -1
  24. package/docs/examples/w-table-edit_name_description.html +26 -1
  25. package/docs/examples/w-table-edit_no enableInfor.html +26 -1
  26. package/docs/examples/w-table-edit_no enableMenu.html +26 -1
  27. package/docs/examples/w-table-edit_opt.kpCellFormat.html +539 -0
  28. package/docs/examples/w-table-edit_opt.kpHead.html +26 -1
  29. package/docs/examples/w-table-edit_removeIdsWhenDownload (remove id, mappingId, order, isActive).html +26 -1
  30. package/docs/examples/w-table-edit_slot btns-left.html +26 -1
  31. package/docs/examples/w-table-edit_slot btns-right.html +26 -1
  32. package/docs/examples/w-table-edit_slot cell-render.html +26 -1
  33. package/docs/examples/w-table-edit_slot cell-tooltip.html +26 -1
  34. package/docs/examples/w-table-edit_slot head-render.html +26 -1
  35. package/docs/examples/w-table-edit_slot head-tooltip.html +26 -1
  36. package/docs/examples/w-table-edit_slot infor (name_description).html +26 -1
  37. package/docs/examples/w-table-edit_sortColIds (sort by order).html +26 -1
  38. package/docs/index.html +1 -1
  39. package/docs/module-WTableEdit.html +27 -3
  40. package/package.json +3 -3
  41. package/src/AppZoneWTableEdit.vue +61 -0
  42. package/src/components/WTableEdit.vue +12 -5
@@ -43,7 +43,7 @@
43
43
  />
44
44
 
45
45
  <!-- w-table-vue -->
46
- <script src="https://cdn.jsdelivr.net/npm/w-table-vue@1.0.13/dist/w-table-vue.umd.js"></script>
46
+ <script src="https://cdn.jsdelivr.net/npm/w-table-vue@1.0.15/dist/w-table-vue.umd.js"></script>
47
47
 
48
48
  <style>
49
49
  .item {
@@ -482,6 +482,31 @@
482
482
  }
483
483
  return rows;
484
484
  }
485
+ },
486
+ opt8: {
487
+ keys: keys1,
488
+ kpHeadFilterType: kpHeadFilterType1,
489
+ rows: rows1,
490
+ kpCellFormat: {
491
+ //格式化僅影響顯示與下載, 排序、過濾、編輯與save回傳之rows仍為原值
492
+ make: function(value, key, row, params) {
493
+ //空值(null、undefined、空字串)會原樣傳入, 編輯模式新增列之各欄為空字串, 回傳null代表不格式化維持原值
494
+ if (value === null || value === undefined || value === "") {
495
+ return null;
496
+ }
497
+ return String(value).toUpperCase();
498
+ },
499
+ price: function(value, key, row, params) {
500
+ //空值不可直接Number(), 否則''與null會變成0.00
501
+ if (value === null || value === undefined || value === "") {
502
+ return null;
503
+ }
504
+ return Number(value).toLocaleString("en-US", {
505
+ minimumFractionDigits: 2,
506
+ maximumFractionDigits: 2
507
+ });
508
+ }
509
+ }
485
510
  }
486
511
  },
487
512
  actions: []
@@ -43,7 +43,7 @@
43
43
  />
44
44
 
45
45
  <!-- w-table-vue -->
46
- <script src="https://cdn.jsdelivr.net/npm/w-table-vue@1.0.13/dist/w-table-vue.umd.js"></script>
46
+ <script src="https://cdn.jsdelivr.net/npm/w-table-vue@1.0.15/dist/w-table-vue.umd.js"></script>
47
47
 
48
48
  <style>
49
49
  .item {
@@ -485,6 +485,31 @@
485
485
  }
486
486
  return rows;
487
487
  }
488
+ },
489
+ opt8: {
490
+ keys: keys1,
491
+ kpHeadFilterType: kpHeadFilterType1,
492
+ rows: rows1,
493
+ kpCellFormat: {
494
+ //格式化僅影響顯示與下載, 排序、過濾、編輯與save回傳之rows仍為原值
495
+ make: function(value, key, row, params) {
496
+ //空值(null、undefined、空字串)會原樣傳入, 編輯模式新增列之各欄為空字串, 回傳null代表不格式化維持原值
497
+ if (value === null || value === undefined || value === "") {
498
+ return null;
499
+ }
500
+ return String(value).toUpperCase();
501
+ },
502
+ price: function(value, key, row, params) {
503
+ //空值不可直接Number(), 否則''與null會變成0.00
504
+ if (value === null || value === undefined || value === "") {
505
+ return null;
506
+ }
507
+ return Number(value).toLocaleString("en-US", {
508
+ minimumFractionDigits: 2,
509
+ maximumFractionDigits: 2
510
+ });
511
+ }
512
+ }
488
513
  }
489
514
  },
490
515
  actions: []
@@ -43,7 +43,7 @@
43
43
  />
44
44
 
45
45
  <!-- w-table-vue -->
46
- <script src="https://cdn.jsdelivr.net/npm/w-table-vue@1.0.13/dist/w-table-vue.umd.js"></script>
46
+ <script src="https://cdn.jsdelivr.net/npm/w-table-vue@1.0.15/dist/w-table-vue.umd.js"></script>
47
47
 
48
48
  <style>
49
49
  .item {
@@ -506,6 +506,31 @@
506
506
  }
507
507
  return rows;
508
508
  }
509
+ },
510
+ opt8: {
511
+ keys: keys1,
512
+ kpHeadFilterType: kpHeadFilterType1,
513
+ rows: rows1,
514
+ kpCellFormat: {
515
+ //格式化僅影響顯示與下載, 排序、過濾、編輯與save回傳之rows仍為原值
516
+ make: function(value, key, row, params) {
517
+ //空值(null、undefined、空字串)會原樣傳入, 編輯模式新增列之各欄為空字串, 回傳null代表不格式化維持原值
518
+ if (value === null || value === undefined || value === "") {
519
+ return null;
520
+ }
521
+ return String(value).toUpperCase();
522
+ },
523
+ price: function(value, key, row, params) {
524
+ //空值不可直接Number(), 否則''與null會變成0.00
525
+ if (value === null || value === undefined || value === "") {
526
+ return null;
527
+ }
528
+ return Number(value).toLocaleString("en-US", {
529
+ minimumFractionDigits: 2,
530
+ maximumFractionDigits: 2
531
+ });
532
+ }
533
+ }
509
534
  }
510
535
  },
511
536
  actions: []
@@ -43,7 +43,7 @@
43
43
  />
44
44
 
45
45
  <!-- w-table-vue -->
46
- <script src="https://cdn.jsdelivr.net/npm/w-table-vue@1.0.13/dist/w-table-vue.umd.js"></script>
46
+ <script src="https://cdn.jsdelivr.net/npm/w-table-vue@1.0.15/dist/w-table-vue.umd.js"></script>
47
47
 
48
48
  <style>
49
49
  .item {
@@ -506,6 +506,31 @@
506
506
  }
507
507
  return rows;
508
508
  }
509
+ },
510
+ opt8: {
511
+ keys: keys1,
512
+ kpHeadFilterType: kpHeadFilterType1,
513
+ rows: rows1,
514
+ kpCellFormat: {
515
+ //格式化僅影響顯示與下載, 排序、過濾、編輯與save回傳之rows仍為原值
516
+ make: function(value, key, row, params) {
517
+ //空值(null、undefined、空字串)會原樣傳入, 編輯模式新增列之各欄為空字串, 回傳null代表不格式化維持原值
518
+ if (value === null || value === undefined || value === "") {
519
+ return null;
520
+ }
521
+ return String(value).toUpperCase();
522
+ },
523
+ price: function(value, key, row, params) {
524
+ //空值不可直接Number(), 否則''與null會變成0.00
525
+ if (value === null || value === undefined || value === "") {
526
+ return null;
527
+ }
528
+ return Number(value).toLocaleString("en-US", {
529
+ minimumFractionDigits: 2,
530
+ maximumFractionDigits: 2
531
+ });
532
+ }
533
+ }
509
534
  }
510
535
  },
511
536
  actions: []
@@ -43,7 +43,7 @@
43
43
  />
44
44
 
45
45
  <!-- w-table-vue -->
46
- <script src="https://cdn.jsdelivr.net/npm/w-table-vue@1.0.13/dist/w-table-vue.umd.js"></script>
46
+ <script src="https://cdn.jsdelivr.net/npm/w-table-vue@1.0.15/dist/w-table-vue.umd.js"></script>
47
47
 
48
48
  <style>
49
49
  .item {
@@ -498,6 +498,31 @@
498
498
  }
499
499
  return rows;
500
500
  }
501
+ },
502
+ opt8: {
503
+ keys: keys1,
504
+ kpHeadFilterType: kpHeadFilterType1,
505
+ rows: rows1,
506
+ kpCellFormat: {
507
+ //格式化僅影響顯示與下載, 排序、過濾、編輯與save回傳之rows仍為原值
508
+ make: function(value, key, row, params) {
509
+ //空值(null、undefined、空字串)會原樣傳入, 編輯模式新增列之各欄為空字串, 回傳null代表不格式化維持原值
510
+ if (value === null || value === undefined || value === "") {
511
+ return null;
512
+ }
513
+ return String(value).toUpperCase();
514
+ },
515
+ price: function(value, key, row, params) {
516
+ //空值不可直接Number(), 否則''與null會變成0.00
517
+ if (value === null || value === undefined || value === "") {
518
+ return null;
519
+ }
520
+ return Number(value).toLocaleString("en-US", {
521
+ minimumFractionDigits: 2,
522
+ maximumFractionDigits: 2
523
+ });
524
+ }
525
+ }
501
526
  }
502
527
  },
503
528
  actions: []
@@ -43,7 +43,7 @@
43
43
  />
44
44
 
45
45
  <!-- w-table-vue -->
46
- <script src="https://cdn.jsdelivr.net/npm/w-table-vue@1.0.13/dist/w-table-vue.umd.js"></script>
46
+ <script src="https://cdn.jsdelivr.net/npm/w-table-vue@1.0.15/dist/w-table-vue.umd.js"></script>
47
47
 
48
48
  <style>
49
49
  .item {
@@ -498,6 +498,31 @@
498
498
  }
499
499
  return rows;
500
500
  }
501
+ },
502
+ opt8: {
503
+ keys: keys1,
504
+ kpHeadFilterType: kpHeadFilterType1,
505
+ rows: rows1,
506
+ kpCellFormat: {
507
+ //格式化僅影響顯示與下載, 排序、過濾、編輯與save回傳之rows仍為原值
508
+ make: function(value, key, row, params) {
509
+ //空值(null、undefined、空字串)會原樣傳入, 編輯模式新增列之各欄為空字串, 回傳null代表不格式化維持原值
510
+ if (value === null || value === undefined || value === "") {
511
+ return null;
512
+ }
513
+ return String(value).toUpperCase();
514
+ },
515
+ price: function(value, key, row, params) {
516
+ //空值不可直接Number(), 否則''與null會變成0.00
517
+ if (value === null || value === undefined || value === "") {
518
+ return null;
519
+ }
520
+ return Number(value).toLocaleString("en-US", {
521
+ minimumFractionDigits: 2,
522
+ maximumFractionDigits: 2
523
+ });
524
+ }
525
+ }
501
526
  }
502
527
  },
503
528
  actions: []
@@ -43,7 +43,7 @@
43
43
  />
44
44
 
45
45
  <!-- w-table-vue -->
46
- <script src="https://cdn.jsdelivr.net/npm/w-table-vue@1.0.13/dist/w-table-vue.umd.js"></script>
46
+ <script src="https://cdn.jsdelivr.net/npm/w-table-vue@1.0.15/dist/w-table-vue.umd.js"></script>
47
47
 
48
48
  <style>
49
49
  .item {
@@ -498,6 +498,31 @@
498
498
  }
499
499
  return rows;
500
500
  }
501
+ },
502
+ opt8: {
503
+ keys: keys1,
504
+ kpHeadFilterType: kpHeadFilterType1,
505
+ rows: rows1,
506
+ kpCellFormat: {
507
+ //格式化僅影響顯示與下載, 排序、過濾、編輯與save回傳之rows仍為原值
508
+ make: function(value, key, row, params) {
509
+ //空值(null、undefined、空字串)會原樣傳入, 編輯模式新增列之各欄為空字串, 回傳null代表不格式化維持原值
510
+ if (value === null || value === undefined || value === "") {
511
+ return null;
512
+ }
513
+ return String(value).toUpperCase();
514
+ },
515
+ price: function(value, key, row, params) {
516
+ //空值不可直接Number(), 否則''與null會變成0.00
517
+ if (value === null || value === undefined || value === "") {
518
+ return null;
519
+ }
520
+ return Number(value).toLocaleString("en-US", {
521
+ minimumFractionDigits: 2,
522
+ maximumFractionDigits: 2
523
+ });
524
+ }
525
+ }
501
526
  }
502
527
  },
503
528
  actions: []
@@ -43,7 +43,7 @@
43
43
  />
44
44
 
45
45
  <!-- w-table-vue -->
46
- <script src="https://cdn.jsdelivr.net/npm/w-table-vue@1.0.13/dist/w-table-vue.umd.js"></script>
46
+ <script src="https://cdn.jsdelivr.net/npm/w-table-vue@1.0.15/dist/w-table-vue.umd.js"></script>
47
47
 
48
48
  <style>
49
49
  .item {
@@ -504,6 +504,31 @@
504
504
  }
505
505
  return rows;
506
506
  }
507
+ },
508
+ opt8: {
509
+ keys: keys1,
510
+ kpHeadFilterType: kpHeadFilterType1,
511
+ rows: rows1,
512
+ kpCellFormat: {
513
+ //格式化僅影響顯示與下載, 排序、過濾、編輯與save回傳之rows仍為原值
514
+ make: function(value, key, row, params) {
515
+ //空值(null、undefined、空字串)會原樣傳入, 編輯模式新增列之各欄為空字串, 回傳null代表不格式化維持原值
516
+ if (value === null || value === undefined || value === "") {
517
+ return null;
518
+ }
519
+ return String(value).toUpperCase();
520
+ },
521
+ price: function(value, key, row, params) {
522
+ //空值不可直接Number(), 否則''與null會變成0.00
523
+ if (value === null || value === undefined || value === "") {
524
+ return null;
525
+ }
526
+ return Number(value).toLocaleString("en-US", {
527
+ minimumFractionDigits: 2,
528
+ maximumFractionDigits: 2
529
+ });
530
+ }
531
+ }
507
532
  }
508
533
  },
509
534
  actions: []
@@ -43,7 +43,7 @@
43
43
  />
44
44
 
45
45
  <!-- w-table-vue -->
46
- <script src="https://cdn.jsdelivr.net/npm/w-table-vue@1.0.13/dist/w-table-vue.umd.js"></script>
46
+ <script src="https://cdn.jsdelivr.net/npm/w-table-vue@1.0.15/dist/w-table-vue.umd.js"></script>
47
47
 
48
48
  <style>
49
49
  .item {
@@ -499,6 +499,31 @@
499
499
  }
500
500
  return rows;
501
501
  }
502
+ },
503
+ opt8: {
504
+ keys: keys1,
505
+ kpHeadFilterType: kpHeadFilterType1,
506
+ rows: rows1,
507
+ kpCellFormat: {
508
+ //格式化僅影響顯示與下載, 排序、過濾、編輯與save回傳之rows仍為原值
509
+ make: function(value, key, row, params) {
510
+ //空值(null、undefined、空字串)會原樣傳入, 編輯模式新增列之各欄為空字串, 回傳null代表不格式化維持原值
511
+ if (value === null || value === undefined || value === "") {
512
+ return null;
513
+ }
514
+ return String(value).toUpperCase();
515
+ },
516
+ price: function(value, key, row, params) {
517
+ //空值不可直接Number(), 否則''與null會變成0.00
518
+ if (value === null || value === undefined || value === "") {
519
+ return null;
520
+ }
521
+ return Number(value).toLocaleString("en-US", {
522
+ minimumFractionDigits: 2,
523
+ maximumFractionDigits: 2
524
+ });
525
+ }
526
+ }
502
527
  }
503
528
  },
504
529
  actions: []
@@ -43,7 +43,7 @@
43
43
  />
44
44
 
45
45
  <!-- w-table-vue -->
46
- <script src="https://cdn.jsdelivr.net/npm/w-table-vue@1.0.13/dist/w-table-vue.umd.js"></script>
46
+ <script src="https://cdn.jsdelivr.net/npm/w-table-vue@1.0.15/dist/w-table-vue.umd.js"></script>
47
47
 
48
48
  <style>
49
49
  .item {
@@ -483,6 +483,31 @@
483
483
  }
484
484
  return rows;
485
485
  }
486
+ },
487
+ opt8: {
488
+ keys: keys1,
489
+ kpHeadFilterType: kpHeadFilterType1,
490
+ rows: rows1,
491
+ kpCellFormat: {
492
+ //格式化僅影響顯示與下載, 排序、過濾、編輯與save回傳之rows仍為原值
493
+ make: function(value, key, row, params) {
494
+ //空值(null、undefined、空字串)會原樣傳入, 編輯模式新增列之各欄為空字串, 回傳null代表不格式化維持原值
495
+ if (value === null || value === undefined || value === "") {
496
+ return null;
497
+ }
498
+ return String(value).toUpperCase();
499
+ },
500
+ price: function(value, key, row, params) {
501
+ //空值不可直接Number(), 否則''與null會變成0.00
502
+ if (value === null || value === undefined || value === "") {
503
+ return null;
504
+ }
505
+ return Number(value).toLocaleString("en-US", {
506
+ minimumFractionDigits: 2,
507
+ maximumFractionDigits: 2
508
+ });
509
+ }
510
+ }
486
511
  }
487
512
  },
488
513
  actions: []
package/docs/index.html CHANGED
@@ -71,7 +71,7 @@
71
71
  <br class="clear">
72
72
 
73
73
  <footer>
74
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Fri Sep 04 2026 23:49:46 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
74
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Sat Sep 05 2026 15:13:53 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
75
75
  </footer>
76
76
 
77
77
  <script>prettyPrint();</script>
@@ -163,11 +163,17 @@
163
163
  <td>No</td>
164
164
  <td>輸入下載Excel檔案時針對mat數據階段的攔截處理函數,預設為null</td>
165
165
  </tr><tr>
166
- <td><code>enableHeadWhenDownload</code></td>
166
+ <td><code>useHeadWhenDownload</code></td>
167
167
  <td>Boolean</td>
168
168
  <td><code>false</code></td>
169
169
  <td>No</td>
170
170
  <td>輸入下載Excel檔案時是否將欄位鍵值轉換成head布林值,此需提供opt.kpHead物件,預設為false</td>
171
+ </tr><tr>
172
+ <td><code>useCellFormatWhenDownload</code></td>
173
+ <td>Boolean</td>
174
+ <td><code>true</code></td>
175
+ <td>No</td>
176
+ <td>輸入下載Excel檔案時是否依opt.kpCellFormat格式化各欄值布林值,true時下載內容與畫面一致(有格式化函數之欄為格式化後字串),false時下載原值,無opt.kpCellFormat時無作用,對應w-aggrid-vue之downloadData與downloadDisplayData之useFormat,預設為true</td>
171
177
  </tr><tr>
172
178
  <td><code>fileNameWhenDownload</code></td>
173
179
  <td>String</td>
@@ -522,6 +528,12 @@
522
528
  <td><code>{}</code></td>
523
529
  <td>No</td>
524
530
  <td>輸入key對應cell之是否可編輯物件,預設各key值為defCellEditable</td>
531
+ </tr><tr>
532
+ <td><code>opt.kpCellFormat</code></td>
533
+ <td>Object</td>
534
+ <td><code>{}</code></td>
535
+ <td>No</td>
536
+ <td>輸入key對應cell之值格式化函數物件,函數簽名為(value, key, row, params),回傳顯示字串,回傳null或undefined代表不格式化維持原值;所有原值(含null、undefined、空字串)皆原樣傳入,編輯模式新增列之各欄為空字串,故函數內須自行處理空值(如回傳null);作用於顯示與下載(下載時params為null,可由組件useCellFormatWhenDownload關閉),排序、過濾、編輯與save回傳之rows仍為原值;與cell-render slot可並用,預設各key值為undefined</td>
525
537
  </tr><tr>
526
538
  <td><code>opt.kpConvertKeysWhenUploadData</code></td>
527
539
  <td>Object</td>
@@ -801,11 +813,17 @@
801
813
  <td>No</td>
802
814
  <td>輸入下載Excel檔案時針對mat數據階段的攔截處理函數,預設為null</td>
803
815
  </tr><tr>
804
- <td><code>enableHeadWhenDownload</code></td>
816
+ <td><code>useHeadWhenDownload</code></td>
805
817
  <td>Boolean</td>
806
818
  <td><code>false</code></td>
807
819
  <td>No</td>
808
820
  <td>輸入下載Excel檔案時是否將欄位鍵值轉換成head布林值,此需提供opt.kpHead物件,預設為false</td>
821
+ </tr><tr>
822
+ <td><code>useCellFormatWhenDownload</code></td>
823
+ <td>Boolean</td>
824
+ <td><code>true</code></td>
825
+ <td>No</td>
826
+ <td>輸入下載Excel檔案時是否依opt.kpCellFormat格式化各欄值布林值,true時下載內容與畫面一致(有格式化函數之欄為格式化後字串),false時下載原值,無opt.kpCellFormat時無作用,對應w-aggrid-vue之downloadData與downloadDisplayData之useFormat,預設為true</td>
809
827
  </tr><tr>
810
828
  <td><code>fileNameWhenDownload</code></td>
811
829
  <td>String</td>
@@ -1160,6 +1178,12 @@
1160
1178
  <td><code>{}</code></td>
1161
1179
  <td>No</td>
1162
1180
  <td>輸入key對應cell之是否可編輯物件,預設各key值為defCellEditable</td>
1181
+ </tr><tr>
1182
+ <td><code>opt.kpCellFormat</code></td>
1183
+ <td>Object</td>
1184
+ <td><code>{}</code></td>
1185
+ <td>No</td>
1186
+ <td>輸入key對應cell之值格式化函數物件,函數簽名為(value, key, row, params),回傳顯示字串,回傳null或undefined代表不格式化維持原值;所有原值(含null、undefined、空字串)皆原樣傳入,編輯模式新增列之各欄為空字串,故函數內須自行處理空值(如回傳null);作用於顯示與下載(下載時params為null,可由組件useCellFormatWhenDownload關閉),排序、過濾、編輯與save回傳之rows仍為原值;與cell-render slot可並用,預設各key值為undefined</td>
1163
1187
  </tr><tr>
1164
1188
  <td><code>opt.kpConvertKeysWhenUploadData</code></td>
1165
1189
  <td>Object</td>
@@ -1425,7 +1449,7 @@
1425
1449
  <br class="clear">
1426
1450
 
1427
1451
  <footer>
1428
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Fri Sep 04 2026 23:49:46 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1452
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Sat Sep 05 2026 15:13:53 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1429
1453
  </footer>
1430
1454
 
1431
1455
  <script>prettyPrint();</script>
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "w-table-vue",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "main": "dist/w-table-vue.umd.js",
5
5
  "dependencies": {
6
- "w-aggrid-vue": "^2.0.82",
7
- "w-component-vue": "^2.5.10",
6
+ "w-aggrid-vue": "^2.0.84",
7
+ "w-component-vue": "^2.5.11",
8
8
  "wsemi": "^1.8.84"
9
9
  },
10
10
  "devDependencies": {
@@ -375,6 +375,25 @@
375
375
  </div>
376
376
 
377
377
 
378
+ <div class="bk">
379
+ <demolink
380
+ :pkgname="'w-table-vue'"
381
+ :kbname="'w-table-edit'"
382
+ :casename="'opt.kpCellFormat'"
383
+ ></demolink>
384
+
385
+ <w-table-edit
386
+ style="width:600px; height:400px;"
387
+ :name="WTableEdit.name"
388
+ :description="WTableEdit.description"
389
+ :opt="WTableEdit.opt8"
390
+ @success="evSuccess"
391
+ @error="evError"
392
+ ></w-table-edit>
393
+
394
+ </div>
395
+
396
+
378
397
  <div class="bk">
379
398
  <demolink
380
399
  :pkgname="'w-table-vue'"
@@ -655,6 +674,27 @@
655
674
  </div>
656
675
 
657
676
 
677
+ <div class="bk">
678
+ <demolink
679
+ :pkgname="'w-table-vue'"
680
+ :kbname="'w-table-edit'"
681
+ :casename="'editable & opt.kpCellFormat & no useCellFormatWhenDownload'"
682
+ ></demolink>
683
+
684
+ <w-table-edit
685
+ style="width:600px; height:400px;"
686
+ :name="WTableEdit.name"
687
+ :description="WTableEdit.description"
688
+ :opt="WTableEdit.opt8"
689
+ :editable="true"
690
+ :useCellFormatWhenDownload="false"
691
+ @success="evSuccess"
692
+ @error="evError"
693
+ ></w-table-edit>
694
+
695
+ </div>
696
+
697
+
658
698
  <div class="bk">
659
699
  <demolink
660
700
  :pkgname="'w-table-vue'"
@@ -844,6 +884,27 @@ export default {
844
884
  return rows
845
885
  },
846
886
  },
887
+ 'opt8': {
888
+ keys: keys1,
889
+ kpHeadFilterType: kpHeadFilterType1,
890
+ rows: rows1,
891
+ kpCellFormat: { //格式化僅影響顯示與下載, 排序、過濾、編輯與save回傳之rows仍為原值
892
+ 'make': function(value, key, row, params) {
893
+ //空值(null、undefined、空字串)會原樣傳入, 編輯模式新增列之各欄為空字串, 回傳null代表不格式化維持原值
894
+ if (value === null || value === undefined || value === '') {
895
+ return null
896
+ }
897
+ return String(value).toUpperCase()
898
+ },
899
+ 'price': function(value, key, row, params) {
900
+ //空值不可直接Number(), 否則''與null會變成0.00
901
+ if (value === null || value === undefined || value === '') {
902
+ return null
903
+ }
904
+ return Number(value).toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
905
+ },
906
+ },
907
+ },
847
908
  },
848
909
  'actions': [
849
910
  ],
@@ -302,7 +302,8 @@ import WAggridVue from 'w-aggrid-vue/src/components/WAggridVue.vue'
302
302
  * @vue-prop {String|Array} [removeIdsWhenDownload=''] 輸入下載Excel檔案時欲移除的欄位字串或陣列,預設''
303
303
  * @vue-prop {Boolean} [funGetLtdtHookWhenDownload=null] 輸入下載Excel檔案時針對ltdt數據階段的攔截處理函數,預設為null
304
304
  * @vue-prop {Boolean} [funGetMatHookWhenDownload=null] 輸入下載Excel檔案時針對mat數據階段的攔截處理函數,預設為null
305
- * @vue-prop {Boolean} [enableHeadWhenDownload=false] 輸入下載Excel檔案時是否將欄位鍵值轉換成head布林值,此需提供opt.kpHead物件,預設為false
305
+ * @vue-prop {Boolean} [useHeadWhenDownload=false] 輸入下載Excel檔案時是否將欄位鍵值轉換成head布林值,此需提供opt.kpHead物件,預設為false
306
+ * @vue-prop {Boolean} [useCellFormatWhenDownload=true] 輸入下載Excel檔案時是否依opt.kpCellFormat格式化各欄值布林值,true時下載內容與畫面一致(有格式化函數之欄為格式化後字串),false時下載原值,無opt.kpCellFormat時無作用,對應w-aggrid-vue之downloadData與downloadDisplayData之useFormat,預設為true
306
307
  * @vue-prop {String} [fileNameWhenDownload='data.xlsx'] 輸入下載Excel檔案時儲存檔名稱字串,預設'data.xlsx'
307
308
  * @vue-prop {String} [sheetNameWhenDownload='data'] 輸入下載Excel檔案時sheet名稱字串,預設'data'
308
309
  * @vue-prop {Boolean} [editable=false] 輸入是否可編輯布林值,可被opt.defCellEditable複寫,預設為false
@@ -335,8 +336,8 @@ import WAggridVue from 'w-aggrid-vue/src/components/WAggridVue.vue'
335
336
  * @vue-slot {Object} infor 顯示模式下資訊區之渲染slot,slot props為{ infor },infor為{ name, description }
336
337
  * @vue-slot {Object} btns-left 選單按鈕區最左側之插入slot,slot props為{ editable }
337
338
  * @vue-slot {Object} btns-right 選單按鈕區最右側之插入slot,slot props為{ editable }
338
- * @vue-slot {Object} cell-render 輸入cell之渲染slot,轉發至w-aggrid-vue,slot props為{ value, key, row }
339
- * @vue-slot {Object} cell-tooltip 輸入cell之tooltip渲染slot,轉發至w-aggrid-vue,slot props為{ value, key, row },slot內容於掛載時取靜態HTML快照,不支援事件綁定、子組件狀態與響應式更新
339
+ * @vue-slot {Object} cell-render 輸入cell之渲染slot,轉發至w-aggrid-vue,slot props為{ value, valueFormatted, key, row },value為原值,valueFormatted為該欄有opt.kpCellFormat時之格式化值,否則為undefined
340
+ * @vue-slot {Object} cell-tooltip 輸入cell之tooltip渲染slot,轉發至w-aggrid-vue,slot props為{ value, valueFormatted, key, row },value為原值,valueFormatted為該欄有opt.kpCellFormat時之格式化值,否則為undefined,slot內容於掛載時取靜態HTML快照,不支援事件綁定、子組件狀態與響應式更新
340
341
  * @vue-slot {Object} head-render 輸入head之渲染slot,轉發至w-aggrid-vue,slot props為{ value, key }
341
342
  * @vue-slot {Object} head-tooltip 輸入head之tooltip渲染slot,轉發至w-aggrid-vue,slot props為{ value, key },slot內容於掛載時取靜態HTML快照,不支援事件綁定、子組件狀態與響應式更新
342
343
  * @vue-prop {Object} [opt={}] 輸入w-aggrid-vue設定物件,預設{}
@@ -372,6 +373,7 @@ import WAggridVue from 'w-aggrid-vue/src/components/WAggridVue.vue'
372
373
  * @vue-prop {Object} [opt.kpCellAlignH={}] 輸入key對應cell之左右對齊字串物件,預設各key值為defCellAlignH
373
374
  * @vue-prop {Boolean} [opt.defCellEditable=false] 輸入cell預設之是否可編輯布林值,由組件editable複寫,預設為false
374
375
  * @vue-prop {Object} [opt.kpCellEditable={}] 輸入key對應cell之是否可編輯物件,預設各key值為defCellEditable
376
+ * @vue-prop {Object} [opt.kpCellFormat={}] 輸入key對應cell之值格式化函數物件,函數簽名為(value, key, row, params),回傳顯示字串,回傳null或undefined代表不格式化維持原值;所有原值(含null、undefined、空字串)皆原樣傳入,編輯模式新增列之各欄為空字串,故函數內須自行處理空值(如回傳null);作用於顯示與下載(下載時params為null,可由組件useCellFormatWhenDownload關閉),排序、過濾、編輯與save回傳之rows仍為原值;與cell-render slot可並用,預設各key值為undefined
375
377
  * @vue-prop {Object} [opt.kpConvertKeysWhenUploadData={}] 輸入上傳Excel檔案時,當key轉會成對應新key值物件,預設{}
376
378
  * @vue-prop {Function} [opt.rowsChange=function(){}] 輸入rows change之觸發事件,預設為function(){}
377
379
  * @vue-prop {Function} [opt.rowClick=function(){}] 輸入row click之觸發事件,預設為function(){}
@@ -489,10 +491,14 @@ export default {
489
491
  type: Function,
490
492
  default: null,
491
493
  },
492
- enableHeadWhenDownload: {
494
+ useHeadWhenDownload: {
493
495
  type: Boolean,
494
496
  default: false,
495
497
  },
498
+ useCellFormatWhenDownload: {
499
+ type: Boolean,
500
+ default: true,
501
+ },
496
502
  fileNameWhenDownload: {
497
503
  type: String,
498
504
  default: 'data.xlsx',
@@ -1133,7 +1139,8 @@ export default {
1133
1139
  // return mat
1134
1140
  // },
1135
1141
  funGetMatHook: vo.funGetMatHookWhenDownload,
1136
- useHead: vo.enableHeadWhenDownload, //default: false
1142
+ useHead: vo.useHeadWhenDownload, //default: false
1143
+ useFormat: vo.useCellFormatWhenDownload, //default: true, 依opt.kpCellFormat格式化使下載與畫面一致
1137
1144
  fileName: vo.fileNameWhenDownload, //default: 'data.xlsx'
1138
1145
  sheetName: vo.sheetNameWhenDownload, //default: data
1139
1146
  })