@fangzhongya/fang-ui 0.0.58 → 0.0.60

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 (132) hide show
  1. package/dist/components/array/src/data.cjs +3 -3
  2. package/dist/components/array/src/data.d.ts +0 -3
  3. package/dist/components/array/src/data.js +3 -3
  4. package/dist/components/array/src/index2.cjs +27 -11
  5. package/dist/components/array/src/index2.js +23 -7
  6. package/dist/components/common/use.cjs +1 -1
  7. package/dist/components/common/use.js +1 -1
  8. package/dist/components/dialogs/src/data.cjs +2 -4
  9. package/dist/components/dialogs/src/data.d.ts +0 -2
  10. package/dist/components/dialogs/src/data.js +2 -4
  11. package/dist/components/dialogs/src/index2.cjs +24 -12
  12. package/dist/components/dialogs/src/index2.js +17 -5
  13. package/dist/components/forms/index.css +3 -0
  14. package/dist/components/forms/index.scss +3 -0
  15. package/dist/components/forms/src/index2.cjs +16 -14
  16. package/dist/components/forms/src/index2.js +3 -1
  17. package/dist/components/forms/src/setup.cjs +11 -5
  18. package/dist/components/forms/src/setup.d.ts +1 -1
  19. package/dist/components/forms/src/setup.js +11 -5
  20. package/dist/components/forms/src/util.cjs +5 -4
  21. package/dist/components/forms/src/util.d.ts +1 -1
  22. package/dist/components/forms/src/util.js +5 -4
  23. package/dist/components/forms-drag/src/index2.cjs +96 -45
  24. package/dist/components/forms-drag/src/index2.js +91 -40
  25. package/dist/components/icon-picker/index.css +1 -0
  26. package/dist/components/icon-picker/index.scss +1 -0
  27. package/dist/components/iframe/index.css +4 -0
  28. package/dist/components/iframe/index.scss +4 -0
  29. package/dist/components/iframe/src/index2.cjs +19 -7
  30. package/dist/components/iframe/src/index2.js +20 -8
  31. package/dist/components/iframe/style/index2.scss +3 -0
  32. package/dist/components/index.cjs +110 -108
  33. package/dist/components/index.d.ts +1 -0
  34. package/dist/components/index.js +2 -0
  35. package/dist/components/index.scss +2 -1
  36. package/dist/components/index2.scss +3 -2
  37. package/dist/components/input-history/index.css +7 -17
  38. package/dist/components/input-history/index.scss +34 -42
  39. package/dist/components/input-history/src/index2.cjs +3 -12
  40. package/dist/components/input-history/src/index2.js +3 -12
  41. package/dist/components/inputs/src/index2.cjs +11 -9
  42. package/dist/components/inputs/src/index2.js +3 -1
  43. package/dist/components/keep-com/src/data.d.ts +3 -0
  44. package/dist/components/lists/index.css +0 -5
  45. package/dist/components/lists/index.scss +0 -5
  46. package/dist/components/lists/src/index2.cjs +2 -5
  47. package/dist/components/lists/src/index2.js +3 -6
  48. package/dist/components/listsp/index.css +1 -5
  49. package/dist/components/listsp/src/index2.cjs +11 -9
  50. package/dist/components/listsp/src/index2.js +3 -1
  51. package/dist/components/no-data/index.cjs +9 -0
  52. package/dist/components/no-data/index.css +19 -0
  53. package/dist/components/no-data/index.d.ts +4 -0
  54. package/dist/components/no-data/index.js +9 -0
  55. package/dist/components/no-data/index.scss +8 -0
  56. package/dist/components/no-data/src/data.cjs +24 -0
  57. package/dist/components/no-data/src/data.d.ts +26 -0
  58. package/dist/components/no-data/src/data.js +24 -0
  59. package/dist/components/no-data/src/index.cjs +4 -0
  60. package/dist/components/no-data/src/index.js +4 -0
  61. package/dist/components/no-data/src/index2.cjs +34 -0
  62. package/dist/components/no-data/src/index2.js +34 -0
  63. package/dist/components/page/index.css +4 -0
  64. package/dist/components/page/set-column.css +8 -8
  65. package/dist/components/page/src/index2.cjs +41 -39
  66. package/dist/components/page/src/index2.js +15 -13
  67. package/dist/components/page/src/set-column.cjs +1 -1
  68. package/dist/components/page/src/set-column.js +1 -1
  69. package/dist/components/page/src/set-column2.cjs +3 -6
  70. package/dist/components/page/src/set-column2.js +4 -7
  71. package/dist/components/paging/index.css +1 -0
  72. package/dist/components/paging/index.scss +1 -0
  73. package/dist/components/paging/src/index2.cjs +18 -10
  74. package/dist/components/paging/src/index2.js +12 -4
  75. package/dist/components/selector/src/index2.cjs +17 -15
  76. package/dist/components/selector/src/index2.js +8 -6
  77. package/dist/components/tables/common/pagin.cjs +3 -3
  78. package/dist/components/tables/common/pagin.d.ts +1 -1
  79. package/dist/components/tables/common/pagin.js +3 -3
  80. package/dist/components/tables/src/index2.cjs +4 -7
  81. package/dist/components/tables/src/index2.js +3 -6
  82. package/dist/components/tablesp/index.css +1 -0
  83. package/dist/components/tablesp/src/index2.cjs +11 -9
  84. package/dist/components/tablesp/src/index2.js +3 -1
  85. package/dist/components/tabless/src/index2.cjs +11 -9
  86. package/dist/components/tabless/src/index2.js +3 -1
  87. package/dist/components/tablesv/src/index2.cjs +2 -5
  88. package/dist/components/tablesv/src/index2.js +3 -6
  89. package/dist/components/tablesvp/index.css +1 -0
  90. package/dist/components/tablesvp/src/index2.cjs +9 -7
  91. package/dist/components/tablesvp/src/index2.js +3 -1
  92. package/dist/css/forms.css +3 -0
  93. package/dist/css/icon-picker.css +1 -0
  94. package/dist/css/iframe.css +4 -0
  95. package/dist/css/index.css +44 -22
  96. package/dist/css/input-history.css +7 -17
  97. package/dist/css/lists.css +0 -5
  98. package/dist/css/listsp.css +1 -5
  99. package/dist/css/no-data.css +19 -0
  100. package/dist/css/page/set-column.css +8 -8
  101. package/dist/css/page.css +4 -0
  102. package/dist/css/paging.css +1 -0
  103. package/dist/css/tablesp.css +1 -0
  104. package/dist/css/tablesvp.css +1 -0
  105. package/dist/expand/{chunk-ID2WVA6N.js → chunk-3HYUAX6P.js} +2 -0
  106. package/dist/expand/{chunk-NEHCZ3EJ.cjs → chunk-IPHLXLMM.cjs} +2 -0
  107. package/dist/expand/components.cjs +5 -5
  108. package/dist/expand/components.js +1 -1
  109. package/dist/expand/config.cjs +2 -2
  110. package/dist/expand/config.js +1 -1
  111. package/dist/hooks/index.cjs +2 -0
  112. package/dist/hooks/index.js +3 -1
  113. package/dist/hooks/locale/index.cjs +51 -2
  114. package/dist/hooks/locale/index.d.ts +64 -3
  115. package/dist/hooks/locale/index.js +51 -2
  116. package/dist/icons/index.css +31 -31
  117. package/dist/icons/index.json +7 -7
  118. package/dist/index.cjs +128 -126
  119. package/dist/index.css +44 -22
  120. package/dist/index.js +2 -0
  121. package/dist/locale/en.cjs +38 -15
  122. package/dist/locale/en.d.ts +27 -4
  123. package/dist/locale/en.js +38 -15
  124. package/dist/locale/zh-cn.cjs +24 -3
  125. package/dist/locale/zh-cn.d.ts +23 -2
  126. package/dist/locale/zh-cn.js +24 -3
  127. package/dist/types/locale.d.ts +1 -1
  128. package/package.json +11 -11
  129. /package/dist/components/{forms-item → forms-items}/index.css +0 -0
  130. /package/dist/components/{option → keep-com}/index.css +0 -0
  131. /package/dist/css/{forms-item.css → forms-items.css} +0 -0
  132. /package/dist/css/{option.css → keep-com.css} +0 -0
@@ -99,6 +99,9 @@
99
99
  .forms-elf.center .el-form-item__label {
100
100
  justify-content: center;
101
101
  }
102
+ .forms .forms-li.forms-buts {
103
+ margin-right: 0;
104
+ }
102
105
  .forms-buts-div .el-button {
103
106
  height: inherit;
104
107
  }
@@ -234,6 +237,12 @@
234
237
  padding: 20px 20px;
235
238
  }
236
239
 
240
+ .no-data {
241
+ text-align: center;
242
+ margin-top: 20px;
243
+ color: #999;
244
+ }
245
+
237
246
  .popup {
238
247
  position: fixed;
239
248
  width: 100vw;
@@ -420,6 +429,7 @@
420
429
  cursor: pointer;
421
430
  }
422
431
  .icon-picker .icon-picker-dialog-list-item:hover {
432
+ background-color: #e5e5e5;
423
433
  color: var(--on-icon-picker);
424
434
  }
425
435
  .icon-picker .icon-picker-dialog-list-icon {
@@ -463,6 +473,10 @@
463
473
  width: 100%;
464
474
  height: 100%;
465
475
  }
476
+ .iframe > iframe {
477
+ width: 100%;
478
+ height: 100%;
479
+ }
466
480
 
467
481
  .menus .menu-li-item {
468
482
  display: flex;
@@ -584,6 +598,7 @@
584
598
  }
585
599
  .paging-slot > span {
586
600
  margin-right: 10px;
601
+ white-space: nowrap;
587
602
  }
588
603
  .paging .el-pagination__total {
589
604
  font-size: 14px;
@@ -940,7 +955,7 @@
940
955
  padding: 0;
941
956
  box-sizing: border-box;
942
957
  }
943
- .input-history-select-li {
958
+ .input-history-select-ul .input-history-select-li {
944
959
  padding: 0 32px 0 20px;
945
960
  position: relative;
946
961
  white-space: nowrap;
@@ -952,36 +967,26 @@
952
967
  box-sizing: border-box;
953
968
  cursor: pointer;
954
969
  }
955
- .input-history-select-li.hover, .input-history-select-li:hover {
970
+ .input-history-select-ul .input-history-select-li.hover, .input-history-select-ul .input-history-select-li:hover {
956
971
  background-color: #f5f7fa;
957
972
  }
958
- .input-history-select-li.hover .input-history-select-li-clean, .input-history-select-li:hover .input-history-select-li-clean {
973
+ .input-history-select-ul .input-history-select-li.hover .input-history-select-li-clean, .input-history-select-ul .input-history-select-li:hover .input-history-select-li-clean {
959
974
  display: inline-flex;
960
975
  }
961
- .input-history-select-li.selected {
976
+ .input-history-select-ul .input-history-select-li.selected {
962
977
  color: var(--bv-color-primary);
963
978
  font-weight: 700;
964
979
  }
965
- .input-history-select-li.is-disabled {
980
+ .input-history-select-ul .input-history-select-li.is-disabled {
966
981
  background-color: #ffffff;
967
982
  color: #a8abb2;
968
983
  cursor: not-allowed;
969
984
  }
970
- .input-history-select-li-clean {
971
- position: absolute;
985
+ .input-history-select-ul .input-history-select-li-clean {
972
986
  align-items: center;
973
987
  justify-content: center;
974
- right: 16px;
975
- height: 100%;
976
988
  display: none;
977
- }
978
- .input-history-select-clean {
979
- padding: 0 20px;
980
- }
981
- .input-history-select-clean-but {
982
- float: right;
983
- color: #ccc;
984
- cursor: pointer;
989
+ margin-left: 5px;
985
990
  }
986
991
 
987
992
  .input-num-input {
@@ -1190,11 +1195,6 @@
1190
1195
  .lists-list-item .el-card {
1191
1196
  background-color: transparent;
1192
1197
  }
1193
- .lists-list .lists-no-data {
1194
- text-align: center;
1195
- margin-top: 20px;
1196
- color: #999;
1197
- }
1198
1198
 
1199
1199
  .listsp {
1200
1200
  width: 100%;
@@ -1324,4 +1324,26 @@
1324
1324
  left: 0;
1325
1325
  z-index: 1;
1326
1326
  opacity: 0;
1327
+ }
1328
+
1329
+ .tablesvp {
1330
+ width: 100%;
1331
+ height: var(--tablesvp-height);
1332
+ display: flex;
1333
+ flex-direction: column;
1334
+ }
1335
+ .tablesvp-main {
1336
+ display: flex;
1337
+ flex-direction: column;
1338
+ flex: 1;
1339
+ width: 100%;
1340
+ }
1341
+ .tablesvp-main.is-radio .el-table__header .el-table-column--selection .el-checkbox {
1342
+ display: none;
1343
+ }
1344
+ .tablesvp-paginat {
1345
+ overflow: hidden;
1346
+ }
1347
+ .tablesvp-paginat .el-pagination {
1348
+ justify-content: flex-end;
1327
1349
  }
@@ -29,7 +29,7 @@
29
29
  padding: 0;
30
30
  box-sizing: border-box;
31
31
  }
32
- .input-history-select-li {
32
+ .input-history-select-ul .input-history-select-li {
33
33
  padding: 0 32px 0 20px;
34
34
  position: relative;
35
35
  white-space: nowrap;
@@ -41,34 +41,24 @@
41
41
  box-sizing: border-box;
42
42
  cursor: pointer;
43
43
  }
44
- .input-history-select-li.hover, .input-history-select-li:hover {
44
+ .input-history-select-ul .input-history-select-li.hover, .input-history-select-ul .input-history-select-li:hover {
45
45
  background-color: #f5f7fa;
46
46
  }
47
- .input-history-select-li.hover .input-history-select-li-clean, .input-history-select-li:hover .input-history-select-li-clean {
47
+ .input-history-select-ul .input-history-select-li.hover .input-history-select-li-clean, .input-history-select-ul .input-history-select-li:hover .input-history-select-li-clean {
48
48
  display: inline-flex;
49
49
  }
50
- .input-history-select-li.selected {
50
+ .input-history-select-ul .input-history-select-li.selected {
51
51
  color: var(--bv-color-primary);
52
52
  font-weight: 700;
53
53
  }
54
- .input-history-select-li.is-disabled {
54
+ .input-history-select-ul .input-history-select-li.is-disabled {
55
55
  background-color: #ffffff;
56
56
  color: #a8abb2;
57
57
  cursor: not-allowed;
58
58
  }
59
- .input-history-select-li-clean {
60
- position: absolute;
59
+ .input-history-select-ul .input-history-select-li-clean {
61
60
  align-items: center;
62
61
  justify-content: center;
63
- right: 16px;
64
- height: 100%;
65
62
  display: none;
66
- }
67
- .input-history-select-clean {
68
- padding: 0 20px;
69
- }
70
- .input-history-select-clean-but {
71
- float: right;
72
- color: #ccc;
73
- cursor: pointer;
63
+ margin-left: 5px;
74
64
  }
@@ -48,9 +48,4 @@
48
48
  }
49
49
  .lists-list-item .el-card {
50
50
  background-color: transparent;
51
- }
52
- .lists-list .lists-no-data {
53
- text-align: center;
54
- margin-top: 20px;
55
- color: #999;
56
51
  }
@@ -49,11 +49,6 @@
49
49
  .lists-list-item .el-card {
50
50
  background-color: transparent;
51
51
  }
52
- .lists-list .lists-no-data {
53
- text-align: center;
54
- margin-top: 20px;
55
- color: #999;
56
- }
57
52
 
58
53
  .paging {
59
54
  padding: 10px;
@@ -67,6 +62,7 @@
67
62
  }
68
63
  .paging-slot > span {
69
64
  margin-right: 10px;
65
+ white-space: nowrap;
70
66
  }
71
67
  .paging .el-pagination__total {
72
68
  font-size: 14px;
@@ -0,0 +1,19 @@
1
+ :root {
2
+ --on: rgb(91, 189, 246);
3
+ --color-primary: #409eff;
4
+ --bag-primary: #409eff;
5
+ --bag-primary-text: #fff;
6
+ --border: #eee;
7
+ --layout-panel-gap: 10px;
8
+ --layout-panel-padding: 20px;
9
+ --layout-form-item-padding-right: var(
10
+ --layout-panel-gap
11
+ );
12
+ --g-main-bg: var(--bg-color-page);
13
+ }
14
+
15
+ .no-data {
16
+ text-align: center;
17
+ margin-top: 20px;
18
+ color: #999;
19
+ }
@@ -1,29 +1,29 @@
1
- .set-column-dialog-main[data-v-f249195f] {
1
+ .set-column-dialog-main[data-v-f43f186a] {
2
2
  font-size: 16px;
3
3
  display: flex;
4
4
  }
5
- .set-column-dialog-main .set-column-check[data-v-f249195f] {
5
+ .set-column-dialog-main .set-column-check[data-v-f43f186a] {
6
6
  flex: 1;
7
7
  }
8
- .set-column-dialog-main .set-column-check .set-column-check-list[data-v-f249195f] {
8
+ .set-column-dialog-main .set-column-check .set-column-check-list[data-v-f43f186a] {
9
9
  padding: 10px;
10
10
  display: flex;
11
11
  flex-direction: row;
12
12
  flex-wrap: wrap;
13
13
  overflow-y: auto;
14
14
  }
15
- .set-column-dialog-main .set-column-check .set-column-check-list .set-column-check-list-li[data-v-f249195f] {
15
+ .set-column-dialog-main .set-column-check .set-column-check-list .set-column-check-list-li[data-v-f43f186a] {
16
16
  width: 130px;
17
17
  }
18
- .set-column-dialog-main .set-column-already[data-v-f249195f] {
18
+ .set-column-dialog-main .set-column-already[data-v-f43f186a] {
19
19
  border-left: 1px solid #999;
20
20
  padding-left: 20px;
21
21
  width: 260px;
22
22
  }
23
- .set-column-dialog-main .set-column-already .set-column-already-list[data-v-f249195f] {
23
+ .set-column-dialog-main .set-column-already .set-column-already-list[data-v-f43f186a] {
24
24
  padding: 10px 10px 10px 0;
25
25
  }
26
- .set-column-dialog-main .set-column-already .set-column-already-list .set-column-already-li[data-v-f249195f] {
26
+ .set-column-dialog-main .set-column-already .set-column-already-list .set-column-already-li[data-v-f43f186a] {
27
27
  height: 40px;
28
28
  line-height: 40px;
29
29
  border-bottom: 1px solid #ccc;
@@ -31,7 +31,7 @@
31
31
  align-items: center;
32
32
  justify-content: space-between;
33
33
  }
34
- .set-column-dialog-main .set-column-already .set-column-already-list .set-column-already-li .set-column-already-li-v[data-v-f249195f] {
34
+ .set-column-dialog-main .set-column-already .set-column-already-list .set-column-already-li .set-column-already-li-v[data-v-f43f186a] {
35
35
  display: flex;
36
36
  flex: 1;
37
37
  align-items: center;
package/dist/css/page.css CHANGED
@@ -99,6 +99,9 @@
99
99
  .forms-elf.center .el-form-item__label {
100
100
  justify-content: center;
101
101
  }
102
+ .forms .forms-li.forms-buts {
103
+ margin-right: 0;
104
+ }
102
105
  .forms-buts-div .el-button {
103
106
  height: inherit;
104
107
  }
@@ -215,6 +218,7 @@
215
218
  }
216
219
  .paging-slot > span {
217
220
  margin-right: 10px;
221
+ white-space: nowrap;
218
222
  }
219
223
  .paging .el-pagination__total {
220
224
  font-size: 14px;
@@ -24,6 +24,7 @@
24
24
  }
25
25
  .paging-slot > span {
26
26
  margin-right: 10px;
27
+ white-space: nowrap;
27
28
  }
28
29
  .paging .el-pagination__total {
29
30
  font-size: 14px;
@@ -41,6 +41,7 @@
41
41
  }
42
42
  .paging-slot > span {
43
43
  margin-right: 10px;
44
+ white-space: nowrap;
44
45
  }
45
46
  .paging .el-pagination__total {
46
47
  font-size: 14px;
@@ -107,6 +107,7 @@
107
107
  }
108
108
  .paging-slot > span {
109
109
  margin-right: 10px;
110
+ white-space: nowrap;
110
111
  }
111
112
  .paging .el-pagination__total {
112
113
  font-size: 14px;
@@ -61,6 +61,7 @@ var config_default = {
61
61
  "box-teleport",
62
62
  "box-title",
63
63
  "dialogs",
64
+ "no-data",
64
65
  "popup",
65
66
  "right-key",
66
67
  "seamless-scroll",
@@ -148,6 +149,7 @@ var config_default = {
148
149
  "box-mask",
149
150
  "box-title",
150
151
  "dialogs",
152
+ "no-data",
151
153
  "popup",
152
154
  "right-key",
153
155
  "seamless-scroll",
@@ -61,6 +61,7 @@ var config_default = {
61
61
  "box-teleport",
62
62
  "box-title",
63
63
  "dialogs",
64
+ "no-data",
64
65
  "popup",
65
66
  "right-key",
66
67
  "seamless-scroll",
@@ -148,6 +149,7 @@ var config_default = {
148
149
  "box-mask",
149
150
  "box-title",
150
151
  "dialogs",
152
+ "no-data",
151
153
  "popup",
152
154
  "right-key",
153
155
  "seamless-scroll",
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkNEHCZ3EJcjs = require('./chunk-NEHCZ3EJ.cjs');
3
+ var _chunkIPHLXLMMcjs = require('./chunk-IPHLXLMM.cjs');
4
4
 
5
5
  // expand/components.ts
6
6
  var _humpToLine = require('@fangzhongya/utils/name/humpToLine');
@@ -29,11 +29,11 @@ function namefilter(c, name) {
29
29
  function getFrom(mc, type, conf) {
30
30
  const filename = mc.replace(new RegExp("^" + config.prefix + "-"), "");
31
31
  if (type == 1) {
32
- if (_chunkNEHCZ3EJcjs.config_default.components.includes(filename)) {
32
+ if (_chunkIPHLXLMMcjs.config_default.components.includes(filename)) {
33
33
  const name = _lineToLargeHump.lineToLargeHump.call(void 0, mc);
34
34
  const from = `${config.name}/components/${filename}/index`;
35
35
  let sideEffects;
36
- if (_chunkNEHCZ3EJcjs.config_default.sideEffects.includes(filename)) {
36
+ if (_chunkIPHLXLMMcjs.config_default.sideEffects.includes(filename)) {
37
37
  if (conf.css) {
38
38
  sideEffects = `${config.name}/components/${filename}/style/index2/.scss`;
39
39
  } else {
@@ -49,14 +49,14 @@ function getFrom(mc, type, conf) {
49
49
  return;
50
50
  }
51
51
  } else {
52
- if (_chunkNEHCZ3EJcjs.config_default.directives.includes(filename)) {
52
+ if (_chunkIPHLXLMMcjs.config_default.directives.includes(filename)) {
53
53
  const name = "default";
54
54
  const from = `${config.name}/directives/${filename}/index`;
55
55
  return {
56
56
  name,
57
57
  from
58
58
  };
59
- } else if (_chunkNEHCZ3EJcjs.config_default.directives.includes("v-" + filename)) {
59
+ } else if (_chunkIPHLXLMMcjs.config_default.directives.includes("v-" + filename)) {
60
60
  const name = "default";
61
61
  const from = `${config.name}/directives/${"v-" + filename}/index`;
62
62
  return {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  config_default
3
- } from "./chunk-ID2WVA6N.js";
3
+ } from "./chunk-3HYUAX6P.js";
4
4
 
5
5
  // expand/components.ts
6
6
  import { humpToLine } from "@fangzhongya/utils/name/humpToLine";
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkNEHCZ3EJcjs = require('./chunk-NEHCZ3EJ.cjs');
3
+ var _chunkIPHLXLMMcjs = require('./chunk-IPHLXLMM.cjs');
4
4
 
5
5
 
6
- exports.default = _chunkNEHCZ3EJcjs.config_default;
6
+ exports.default = _chunkIPHLXLMMcjs.config_default;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  config_default
3
- } from "./chunk-ID2WVA6N.js";
3
+ } from "./chunk-3HYUAX6P.js";
4
4
  export {
5
5
  config_default as default
6
6
  };
@@ -11,7 +11,9 @@ exports.eventAliass = index$1.eventAliass;
11
11
  exports.provideGlobalConfig = index$2.provideGlobalConfig;
12
12
  exports.setGlobalConfig = index$2.setGlobalConfig;
13
13
  exports.useGlobalConfig = index$2.useGlobalConfig;
14
+ exports.buildLocaleAdd = index$3.buildLocaleAdd;
14
15
  exports.buildLocaleContext = index$3.buildLocaleContext;
16
+ exports.buildPropsDefault = index$3.buildPropsDefault;
15
17
  exports.buildTranslator = index$3.buildTranslator;
16
18
  exports.useLocale = index$3.useLocale;
17
19
  exports.useAttrValue = index$4.useAttrValue;
@@ -2,10 +2,12 @@ import { useCssName } from "./cssname/index.js";
2
2
  import "./default-config/index.js";
3
3
  import { eventAliass } from "./event-aliass/index.js";
4
4
  import { provideGlobalConfig, setGlobalConfig, useGlobalConfig } from "./global-config/index.js";
5
- import { buildLocaleContext, buildTranslator, useLocale } from "./locale/index.js";
5
+ import { buildLocaleAdd, buildLocaleContext, buildPropsDefault, buildTranslator, useLocale } from "./locale/index.js";
6
6
  import { useAttrValue, useInherit } from "./inherit/index.js";
7
7
  export {
8
+ buildLocaleAdd,
8
9
  buildLocaleContext,
10
+ buildPropsDefault,
9
11
  buildTranslator,
10
12
  eventAliass,
11
13
  provideGlobalConfig,
@@ -17,7 +17,52 @@ function getValue(key, locale) {
17
17
  return obj;
18
18
  }
19
19
  function buildTranslator(locale) {
20
- return (path) => getValue(path, vue.unref(locale).value);
20
+ return (path, ...values) => {
21
+ let v = getValue(path, vue.unref(locale).value);
22
+ if (values.length > 0) {
23
+ values.forEach((z, i) => {
24
+ v = v.replaceAll("$" + (i + 1), z);
25
+ });
26
+ }
27
+ return v;
28
+ };
29
+ }
30
+ function getPropsDefault(props, arr, getLocale) {
31
+ const keys = [];
32
+ const keyObj = {};
33
+ arr.forEach((v) => {
34
+ keys.push(v.prop);
35
+ keyObj[v.prop] = v;
36
+ });
37
+ return new Proxy(props, {
38
+ get(_target, k) {
39
+ if (typeof k === "string" && keys.includes(k)) {
40
+ const v = _target[k];
41
+ if (v === void 0) {
42
+ const o = keyObj[k];
43
+ const l = getLocale(o.locale);
44
+ if (o.filter) {
45
+ return o.filter(l);
46
+ }
47
+ return l;
48
+ }
49
+ return v;
50
+ }
51
+ return _target[k];
52
+ }
53
+ });
54
+ }
55
+ function buildPropsDefault(getLocale) {
56
+ return (props, arr) => getPropsDefault(props, arr, getLocale);
57
+ }
58
+ function buildLocaleAdd(locale, lang) {
59
+ return (...arr) => {
60
+ if (lang.value == "zh-cn") {
61
+ return arr.map((o) => getValue(o, vue.unref(locale).value)).join("");
62
+ } else {
63
+ return arr.map((o) => getValue(o, vue.unref(locale).value)).join(" ");
64
+ }
65
+ };
21
66
  }
22
67
  function buildLocaleContext(locale) {
23
68
  const lang = vue.computed(() => vue.unref(locale).name);
@@ -25,7 +70,9 @@ function buildLocaleContext(locale) {
25
70
  return {
26
71
  lang,
27
72
  locale: localeRef,
28
- getLocale: buildTranslator(locale)
73
+ getPropsDefault: buildPropsDefault(buildTranslator(locale)),
74
+ getLocale: buildTranslator(locale),
75
+ getLocaleAdd: buildLocaleAdd(locale, lang)
29
76
  };
30
77
  }
31
78
  function useLocale() {
@@ -43,6 +90,8 @@ function useLocale() {
43
90
  })
44
91
  );
45
92
  }
93
+ exports.buildLocaleAdd = buildLocaleAdd;
46
94
  exports.buildLocaleContext = buildLocaleContext;
95
+ exports.buildPropsDefault = buildPropsDefault;
47
96
  exports.buildTranslator = buildTranslator;
48
97
  exports.useLocale = useLocale;
@@ -1,5 +1,66 @@
1
- import { Locale, LocaleContext, Translator } from '../../types/locale';
1
+ import { Locale, Translator } from '../../types/locale';
2
2
  import { MaybeRef } from '../../types/hooks';
3
+ import { ComputedRef, Ref } from 'vue';
3
4
  export declare function buildTranslator(locale: MaybeRef<Locale>): Translator;
4
- export declare function buildLocaleContext(locale: MaybeRef<Locale>): LocaleContext;
5
- export declare function useLocale(): LocaleContext;
5
+ type PropsDefault = {
6
+ prop: string;
7
+ locale: string;
8
+ filter?: (locale: string) => string;
9
+ };
10
+ export declare function buildPropsDefault(getLocale: Translator): (props: any, arr: Array<PropsDefault>) => any;
11
+ export declare function buildLocaleAdd(locale: MaybeRef<Locale>, lang: ComputedRef<string>): (...arr: string[]) => string;
12
+ export declare function buildLocaleContext(locale: MaybeRef<Locale>): {
13
+ lang: ComputedRef<string>;
14
+ locale: Ref<{
15
+ name: string;
16
+ value: {
17
+ [key: string]: any;
18
+ };
19
+ } | {
20
+ readonly name: string;
21
+ readonly value: {
22
+ [key: string]: any;
23
+ };
24
+ }, Locale | {
25
+ name: string;
26
+ value: {
27
+ [key: string]: any;
28
+ };
29
+ } | Readonly<Locale> | {
30
+ readonly name: string;
31
+ readonly value: {
32
+ [key: string]: any;
33
+ };
34
+ }>;
35
+ getPropsDefault: (props: any, arr: Array<PropsDefault>) => any;
36
+ getLocale: Translator;
37
+ getLocaleAdd: (...arr: string[]) => string;
38
+ };
39
+ export declare function useLocale(): {
40
+ lang: ComputedRef<string>;
41
+ locale: Ref<{
42
+ name: string;
43
+ value: {
44
+ [key: string]: any;
45
+ };
46
+ } | {
47
+ readonly name: string;
48
+ readonly value: {
49
+ [key: string]: any;
50
+ };
51
+ }, Locale | {
52
+ name: string;
53
+ value: {
54
+ [key: string]: any;
55
+ };
56
+ } | Readonly<Locale> | {
57
+ readonly name: string;
58
+ readonly value: {
59
+ [key: string]: any;
60
+ };
61
+ }>;
62
+ getPropsDefault: (props: any, arr: Array<PropsDefault>) => any;
63
+ getLocale: Translator;
64
+ getLocaleAdd: (...arr: string[]) => string;
65
+ };
66
+ export {};
@@ -15,7 +15,52 @@ function getValue(key, locale) {
15
15
  return obj;
16
16
  }
17
17
  function buildTranslator(locale) {
18
- return (path) => getValue(path, unref(locale).value);
18
+ return (path, ...values) => {
19
+ let v = getValue(path, unref(locale).value);
20
+ if (values.length > 0) {
21
+ values.forEach((z, i) => {
22
+ v = v.replaceAll("$" + (i + 1), z);
23
+ });
24
+ }
25
+ return v;
26
+ };
27
+ }
28
+ function getPropsDefault(props, arr, getLocale) {
29
+ const keys = [];
30
+ const keyObj = {};
31
+ arr.forEach((v) => {
32
+ keys.push(v.prop);
33
+ keyObj[v.prop] = v;
34
+ });
35
+ return new Proxy(props, {
36
+ get(_target, k) {
37
+ if (typeof k === "string" && keys.includes(k)) {
38
+ const v = _target[k];
39
+ if (v === void 0) {
40
+ const o = keyObj[k];
41
+ const l = getLocale(o.locale);
42
+ if (o.filter) {
43
+ return o.filter(l);
44
+ }
45
+ return l;
46
+ }
47
+ return v;
48
+ }
49
+ return _target[k];
50
+ }
51
+ });
52
+ }
53
+ function buildPropsDefault(getLocale) {
54
+ return (props, arr) => getPropsDefault(props, arr, getLocale);
55
+ }
56
+ function buildLocaleAdd(locale, lang) {
57
+ return (...arr) => {
58
+ if (lang.value == "zh-cn") {
59
+ return arr.map((o) => getValue(o, unref(locale).value)).join("");
60
+ } else {
61
+ return arr.map((o) => getValue(o, unref(locale).value)).join(" ");
62
+ }
63
+ };
19
64
  }
20
65
  function buildLocaleContext(locale) {
21
66
  const lang = computed(() => unref(locale).name);
@@ -23,7 +68,9 @@ function buildLocaleContext(locale) {
23
68
  return {
24
69
  lang,
25
70
  locale: localeRef,
26
- getLocale: buildTranslator(locale)
71
+ getPropsDefault: buildPropsDefault(buildTranslator(locale)),
72
+ getLocale: buildTranslator(locale),
73
+ getLocaleAdd: buildLocaleAdd(locale, lang)
27
74
  };
28
75
  }
29
76
  function useLocale() {
@@ -42,7 +89,9 @@ function useLocale() {
42
89
  );
43
90
  }
44
91
  export {
92
+ buildLocaleAdd,
45
93
  buildLocaleContext,
94
+ buildPropsDefault,
46
95
  buildTranslator,
47
96
  useLocale
48
97
  };