@dou-ui/pivot 0.0.0-stage → 0.1.0-alpha.0
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.
- package/LICENSE +21 -0
- package/README.md +10 -2
- package/dist/assets/default-PXde2wzm.js.map +1 -0
- package/dist/core/format.js +116 -0
- package/dist/core/format.js.map +1 -0
- package/dist/core/labels.js +28 -0
- package/dist/core/labels.js.map +1 -0
- package/dist/core/layout.js +190 -0
- package/dist/core/layout.js.map +1 -0
- package/dist/core/source.js +46 -0
- package/dist/core/source.js.map +1 -0
- package/dist/core/table.js +154 -0
- package/dist/core/table.js.map +1 -0
- package/dist/engine/aggregate.js +51 -0
- package/dist/engine/aggregate.js.map +1 -0
- package/dist/engine/compute.js +735 -0
- package/dist/engine/compute.js.map +1 -0
- package/dist/engine/engine.js +46 -0
- package/dist/engine/engine.js.map +1 -0
- package/dist/engine/formula.js +225 -0
- package/dist/engine/formula.js.map +1 -0
- package/dist/engine/group.js +107 -0
- package/dist/engine/group.js.map +1 -0
- package/dist/engine/hash.js +108 -0
- package/dist/engine/hash.js.map +1 -0
- package/dist/engine/index.js +8 -0
- package/dist/engine/show.js +132 -0
- package/dist/engine/show.js.map +1 -0
- package/dist/engine/source.js +339 -0
- package/dist/engine/source.js.map +1 -0
- package/dist/engine/tree.js +226 -0
- package/dist/engine/tree.js.map +1 -0
- package/dist/fields/fields.js +6 -0
- package/dist/fields/fields.js.map +1 -0
- package/dist/fields/fields.vue_vue_type_script_setup_true_lang.js +881 -0
- package/dist/fields/fields.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/fields/filter-list.js +6 -0
- package/dist/fields/filter-list.js.map +1 -0
- package/dist/fields/filter-list.vue_vue_type_script_setup_true_lang.js +184 -0
- package/dist/fields/filter-list.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/fields/formula-dialog.js +6 -0
- package/dist/fields/formula-dialog.js.map +1 -0
- package/dist/fields/formula-dialog.vue_vue_type_script_setup_true_lang.js +165 -0
- package/dist/fields/formula-dialog.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/fields/model.js +200 -0
- package/dist/fields/model.js.map +1 -0
- package/dist/fields/top-dialog.js +6 -0
- package/dist/fields/top-dialog.js.map +1 -0
- package/dist/fields/top-dialog.vue_vue_type_script_setup_true_lang.js +174 -0
- package/dist/fields/top-dialog.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/locale.js +508 -0
- package/dist/locale.js.map +1 -0
- package/dist/pivot.js +6 -0
- package/dist/pivot.js.map +1 -0
- package/dist/pivot.vue_vue_type_script_setup_true_lang.js +1711 -0
- package/dist/pivot.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/style.css +1 -0
- package/dist/style.d.ts +1 -0
- package/dist/style.js +13 -0
- package/dist/types/core/format.d.ts +26 -0
- package/dist/types/core/labels.d.ts +14 -0
- package/dist/types/core/layout.d.ts +72 -0
- package/dist/types/core/source.d.ts +7 -0
- package/dist/types/core/table.d.ts +73 -0
- package/dist/types/engine/aggregate.d.ts +35 -0
- package/dist/types/engine/compute.d.ts +173 -0
- package/dist/types/engine/engine.d.ts +29 -0
- package/dist/types/engine/formula.d.ts +44 -0
- package/dist/types/engine/group.d.ts +34 -0
- package/dist/types/engine/hash.d.ts +36 -0
- package/dist/types/engine/index.d.ts +15 -0
- package/dist/types/engine/show.d.ts +27 -0
- package/dist/types/engine/source.d.ts +108 -0
- package/dist/types/engine/tree.d.ts +87 -0
- package/dist/types/engine/types.d.ts +148 -0
- package/dist/types/fields/fields.vue.d.ts +26 -0
- package/dist/types/fields/filter-list.vue.d.ts +20 -0
- package/dist/types/fields/formula-dialog.vue.d.ts +30 -0
- package/dist/types/fields/model.d.ts +52 -0
- package/dist/types/fields/top-dialog.vue.d.ts +25 -0
- package/dist/types/index.d.ts +458 -0
- package/dist/types/locale.d.ts +184 -0
- package/dist/types/pivot.vue.d.ts +29 -0
- package/dist/types/types.d.ts +199 -0
- package/dist/types/worker/client.d.ts +19 -0
- package/dist/types/worker/default.d.ts +1 -0
- package/dist/types/worker/index.d.ts +5 -0
- package/dist/types/worker/protocol.d.ts +60 -0
- package/dist/types/worker/serve.d.ts +22 -0
- package/dist/worker/client.js +191 -0
- package/dist/worker/client.js.map +1 -0
- package/dist/worker/default.js +20 -0
- package/dist/worker/default.js.map +1 -0
- package/dist/worker/index.js +3 -0
- package/dist/worker/serve.js +101 -0
- package/dist/worker/serve.js.map +1 -0
- package/package.json +64 -4
package/dist/locale.js
ADDED
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
import { useLocale } from "dou-ui";
|
|
2
|
+
import { computed, toValue } from "vue";
|
|
3
|
+
// src/locale.ts
|
|
4
|
+
var zhCN = {
|
|
5
|
+
pivot: "数据透视表",
|
|
6
|
+
total: "总计",
|
|
7
|
+
subtotal: "{label} 合计",
|
|
8
|
+
empty: "(空)",
|
|
9
|
+
yes: "是",
|
|
10
|
+
no: "否",
|
|
11
|
+
value: "{field} · {aggregate}",
|
|
12
|
+
values: "值",
|
|
13
|
+
aggregates: {
|
|
14
|
+
sum: "求和",
|
|
15
|
+
count: "计数",
|
|
16
|
+
avg: "平均值",
|
|
17
|
+
min: "最小值",
|
|
18
|
+
max: "最大值",
|
|
19
|
+
distinct: "去重计数",
|
|
20
|
+
median: "中位数"
|
|
21
|
+
},
|
|
22
|
+
shows: {
|
|
23
|
+
percentOfTotal: "占总计",
|
|
24
|
+
percentOfRow: "占行合计",
|
|
25
|
+
percentOfColumn: "占列合计",
|
|
26
|
+
percentOfParent: "占上级",
|
|
27
|
+
difference: "差值",
|
|
28
|
+
percentDifference: "差值百分比",
|
|
29
|
+
runningTotal: "累计",
|
|
30
|
+
rank: "排名"
|
|
31
|
+
},
|
|
32
|
+
shownValue: "{value} · {show}",
|
|
33
|
+
expand: "展开",
|
|
34
|
+
collapse: "折叠",
|
|
35
|
+
sortField: "按{field}排序",
|
|
36
|
+
sortValue: "按这一列排序",
|
|
37
|
+
noData: "没有数据",
|
|
38
|
+
busy: "正在汇总…",
|
|
39
|
+
yearLabel: "{year} 年",
|
|
40
|
+
quarterLabel: "{year} 年 Q{quarter}",
|
|
41
|
+
weekLabel: "{year} 年第 {week} 周",
|
|
42
|
+
rangeLabel: "{from} – {to}",
|
|
43
|
+
subtotalRow: "{label} 小计",
|
|
44
|
+
resizeColumn: "拖动调整列宽,双击适应内容",
|
|
45
|
+
columnWidth: "{column}的列宽",
|
|
46
|
+
selected: "已选中 {rows} 行 {columns} 列",
|
|
47
|
+
copied: "已复制 {cells} 个格子",
|
|
48
|
+
expanded: "已展开{label}",
|
|
49
|
+
collapsed: "已折叠{label}",
|
|
50
|
+
fields: {
|
|
51
|
+
panel: "字段",
|
|
52
|
+
list: "全部字段",
|
|
53
|
+
search: "搜索字段",
|
|
54
|
+
noFields: "没有匹配的字段",
|
|
55
|
+
areas: {
|
|
56
|
+
filters: "筛选",
|
|
57
|
+
columns: "列",
|
|
58
|
+
rows: "行",
|
|
59
|
+
values: "值"
|
|
60
|
+
},
|
|
61
|
+
dropHere: "拖动字段到这里",
|
|
62
|
+
menu: "{field}的选项",
|
|
63
|
+
sort: "排序",
|
|
64
|
+
asc: "升序",
|
|
65
|
+
desc: "降序",
|
|
66
|
+
byValueDesc: "按{value}从高到低",
|
|
67
|
+
byValueAsc: "按{value}从低到高",
|
|
68
|
+
groupBy: "分组",
|
|
69
|
+
noGroup: "不分组",
|
|
70
|
+
periods: {
|
|
71
|
+
year: "按年",
|
|
72
|
+
quarter: "按季度",
|
|
73
|
+
month: "按月",
|
|
74
|
+
week: "按周",
|
|
75
|
+
day: "按日"
|
|
76
|
+
},
|
|
77
|
+
step: "每 {step} 一组",
|
|
78
|
+
grouped: "{field} · {group}",
|
|
79
|
+
subtotal: "显示小计",
|
|
80
|
+
aggregate: "汇总方式",
|
|
81
|
+
filter: "筛选…",
|
|
82
|
+
filtered: "已筛选",
|
|
83
|
+
moveTo: "移到",
|
|
84
|
+
moveUp: "上移",
|
|
85
|
+
moveDown: "下移",
|
|
86
|
+
remove: "移除",
|
|
87
|
+
valuesOnRows: "值放在行上",
|
|
88
|
+
showAs: "显示方式",
|
|
89
|
+
showPlain: "原值",
|
|
90
|
+
mark: "条件格式",
|
|
91
|
+
noMark: "无",
|
|
92
|
+
bar: "数据条",
|
|
93
|
+
scale: "色阶",
|
|
94
|
+
top: "前 N 项",
|
|
95
|
+
topN: "前 {count} 项",
|
|
96
|
+
bottomN: "后 {count} 项",
|
|
97
|
+
noTop: "不限",
|
|
98
|
+
topped: "{field} · {top}",
|
|
99
|
+
between: "合计 {range}",
|
|
100
|
+
customTop: "自定义…",
|
|
101
|
+
addFormula: "添加计算值",
|
|
102
|
+
editFormula: "编辑公式…",
|
|
103
|
+
open: "字段"
|
|
104
|
+
},
|
|
105
|
+
topDialog: {
|
|
106
|
+
title: "按合计筛选{field}",
|
|
107
|
+
top: "前 N 项",
|
|
108
|
+
bottom: "后 N 项",
|
|
109
|
+
between: "合计范围",
|
|
110
|
+
by: "按",
|
|
111
|
+
count: "项数",
|
|
112
|
+
min: "最小",
|
|
113
|
+
max: "最大",
|
|
114
|
+
help: "按合计保留组,被排除的组不计入总计。",
|
|
115
|
+
clear: "不限",
|
|
116
|
+
apply: "确定",
|
|
117
|
+
cancel: "取消"
|
|
118
|
+
},
|
|
119
|
+
formula: {
|
|
120
|
+
title: "计算值",
|
|
121
|
+
name: "名称",
|
|
122
|
+
namePlaceholder: "不填时用公式作名称",
|
|
123
|
+
formula: "公式",
|
|
124
|
+
placeholder: "如 (销售额 - 成本) / 销售额",
|
|
125
|
+
help: "字段名表示它的合计,可以用 + - * / 和括号,也可以用 sum、avg、min、max、count。",
|
|
126
|
+
fields: "插入字段",
|
|
127
|
+
apply: "确定",
|
|
128
|
+
cancel: "取消",
|
|
129
|
+
errors: {
|
|
130
|
+
empty: "请填写公式",
|
|
131
|
+
incomplete: "公式不完整",
|
|
132
|
+
unknownChar: "无法识别“{detail}”",
|
|
133
|
+
unexpected: "这里不应出现“{detail}”",
|
|
134
|
+
expected: "缺少“{detail}”",
|
|
135
|
+
unclosedBracket: "缺少“]”",
|
|
136
|
+
emptyName: "方括号里没有字段名",
|
|
137
|
+
unknownFunction: "没有名为“{detail}”的函数",
|
|
138
|
+
needsField: "{detail}() 里需要一个字段",
|
|
139
|
+
needsName: "这里应当是字段名",
|
|
140
|
+
unknownField: "没有名为“{detail}”的字段",
|
|
141
|
+
notNumber: "“{detail}”不是数字字段"
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
filter: {
|
|
145
|
+
title: "筛选{field}",
|
|
146
|
+
search: "搜索",
|
|
147
|
+
all: "全选",
|
|
148
|
+
noMatch: "没有匹配的值",
|
|
149
|
+
apply: "确定",
|
|
150
|
+
cancel: "取消",
|
|
151
|
+
count: "已选 {picked} / {total}"
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
var zhTW = {
|
|
155
|
+
pivot: "樞紐分析表",
|
|
156
|
+
total: "總計",
|
|
157
|
+
subtotal: "{label} 合計",
|
|
158
|
+
empty: "(空)",
|
|
159
|
+
yes: "是",
|
|
160
|
+
no: "否",
|
|
161
|
+
value: "{field} · {aggregate}",
|
|
162
|
+
values: "值",
|
|
163
|
+
aggregates: {
|
|
164
|
+
sum: "加總",
|
|
165
|
+
count: "計數",
|
|
166
|
+
avg: "平均值",
|
|
167
|
+
min: "最小值",
|
|
168
|
+
max: "最大值",
|
|
169
|
+
distinct: "不重複計數",
|
|
170
|
+
median: "中位數"
|
|
171
|
+
},
|
|
172
|
+
shows: {
|
|
173
|
+
percentOfTotal: "佔總計",
|
|
174
|
+
percentOfRow: "佔列合計",
|
|
175
|
+
percentOfColumn: "佔欄合計",
|
|
176
|
+
percentOfParent: "佔上層",
|
|
177
|
+
difference: "差異",
|
|
178
|
+
percentDifference: "差異百分比",
|
|
179
|
+
runningTotal: "累計",
|
|
180
|
+
rank: "排名"
|
|
181
|
+
},
|
|
182
|
+
shownValue: "{value} · {show}",
|
|
183
|
+
expand: "展開",
|
|
184
|
+
collapse: "摺疊",
|
|
185
|
+
sortField: "依{field}排序",
|
|
186
|
+
sortValue: "依這一欄排序",
|
|
187
|
+
noData: "沒有資料",
|
|
188
|
+
busy: "正在彙總…",
|
|
189
|
+
yearLabel: "{year} 年",
|
|
190
|
+
quarterLabel: "{year} 年 Q{quarter}",
|
|
191
|
+
weekLabel: "{year} 年第 {week} 週",
|
|
192
|
+
rangeLabel: "{from} – {to}",
|
|
193
|
+
subtotalRow: "{label} 小計",
|
|
194
|
+
resizeColumn: "拖曳調整欄寬,按兩下符合內容",
|
|
195
|
+
columnWidth: "{column}的欄寬",
|
|
196
|
+
selected: "已選取 {rows} 列 {columns} 欄",
|
|
197
|
+
copied: "已複製 {cells} 個儲存格",
|
|
198
|
+
expanded: "已展開{label}",
|
|
199
|
+
collapsed: "已摺疊{label}",
|
|
200
|
+
fields: {
|
|
201
|
+
panel: "欄位",
|
|
202
|
+
list: "所有欄位",
|
|
203
|
+
search: "搜尋欄位",
|
|
204
|
+
noFields: "沒有符合的欄位",
|
|
205
|
+
areas: {
|
|
206
|
+
filters: "篩選",
|
|
207
|
+
columns: "欄",
|
|
208
|
+
rows: "列",
|
|
209
|
+
values: "值"
|
|
210
|
+
},
|
|
211
|
+
dropHere: "拖曳欄位到這裡",
|
|
212
|
+
menu: "{field}的選項",
|
|
213
|
+
sort: "排序",
|
|
214
|
+
asc: "遞增",
|
|
215
|
+
desc: "遞減",
|
|
216
|
+
byValueDesc: "依{value}由高到低",
|
|
217
|
+
byValueAsc: "依{value}由低到高",
|
|
218
|
+
groupBy: "分組",
|
|
219
|
+
noGroup: "不分組",
|
|
220
|
+
periods: {
|
|
221
|
+
year: "依年",
|
|
222
|
+
quarter: "依季",
|
|
223
|
+
month: "依月",
|
|
224
|
+
week: "依週",
|
|
225
|
+
day: "依日"
|
|
226
|
+
},
|
|
227
|
+
step: "每 {step} 一組",
|
|
228
|
+
grouped: "{field} · {group}",
|
|
229
|
+
subtotal: "顯示小計",
|
|
230
|
+
aggregate: "摘要方式",
|
|
231
|
+
filter: "篩選…",
|
|
232
|
+
filtered: "已篩選",
|
|
233
|
+
moveTo: "移到",
|
|
234
|
+
moveUp: "上移",
|
|
235
|
+
moveDown: "下移",
|
|
236
|
+
remove: "移除",
|
|
237
|
+
valuesOnRows: "值放在列上",
|
|
238
|
+
showAs: "值的顯示方式",
|
|
239
|
+
showPlain: "原始值",
|
|
240
|
+
mark: "設定格式化的條件",
|
|
241
|
+
noMark: "無",
|
|
242
|
+
bar: "資料橫條",
|
|
243
|
+
scale: "色階",
|
|
244
|
+
top: "前 N 項",
|
|
245
|
+
topN: "前 {count} 項",
|
|
246
|
+
bottomN: "後 {count} 項",
|
|
247
|
+
noTop: "不限",
|
|
248
|
+
topped: "{field} · {top}",
|
|
249
|
+
between: "合計 {range}",
|
|
250
|
+
customTop: "自訂…",
|
|
251
|
+
addFormula: "新增計算值",
|
|
252
|
+
editFormula: "編輯公式…",
|
|
253
|
+
open: "欄位"
|
|
254
|
+
},
|
|
255
|
+
topDialog: {
|
|
256
|
+
title: "依合計篩選{field}",
|
|
257
|
+
top: "前 N 項",
|
|
258
|
+
bottom: "後 N 項",
|
|
259
|
+
between: "合計範圍",
|
|
260
|
+
by: "依",
|
|
261
|
+
count: "項數",
|
|
262
|
+
min: "最小",
|
|
263
|
+
max: "最大",
|
|
264
|
+
help: "依合計保留群組,被排除的群組不計入總計。",
|
|
265
|
+
clear: "不限",
|
|
266
|
+
apply: "確定",
|
|
267
|
+
cancel: "取消"
|
|
268
|
+
},
|
|
269
|
+
formula: {
|
|
270
|
+
title: "計算值",
|
|
271
|
+
name: "名稱",
|
|
272
|
+
namePlaceholder: "不填時以公式作為名稱",
|
|
273
|
+
formula: "公式",
|
|
274
|
+
placeholder: "如 (銷售額 - 成本) / 銷售額",
|
|
275
|
+
help: "欄位名稱代表它的合計,可以用 + - * / 和括號,也可以用 sum、avg、min、max、count。",
|
|
276
|
+
fields: "插入欄位",
|
|
277
|
+
apply: "確定",
|
|
278
|
+
cancel: "取消",
|
|
279
|
+
errors: {
|
|
280
|
+
empty: "請填寫公式",
|
|
281
|
+
incomplete: "公式不完整",
|
|
282
|
+
unknownChar: "無法辨識「{detail}」",
|
|
283
|
+
unexpected: "這裡不應出現「{detail}」",
|
|
284
|
+
expected: "缺少「{detail}」",
|
|
285
|
+
unclosedBracket: "缺少「]」",
|
|
286
|
+
emptyName: "方括號裡沒有欄位名稱",
|
|
287
|
+
unknownFunction: "沒有名為「{detail}」的函式",
|
|
288
|
+
needsField: "{detail}() 裡需要一個欄位",
|
|
289
|
+
needsName: "這裡應該是欄位名稱",
|
|
290
|
+
unknownField: "沒有名為「{detail}」的欄位",
|
|
291
|
+
notNumber: "「{detail}」不是數字欄位"
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
filter: {
|
|
295
|
+
title: "篩選{field}",
|
|
296
|
+
search: "搜尋",
|
|
297
|
+
all: "全選",
|
|
298
|
+
noMatch: "沒有符合的值",
|
|
299
|
+
apply: "確定",
|
|
300
|
+
cancel: "取消",
|
|
301
|
+
count: "已選 {picked} / {total}"
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
var en = {
|
|
305
|
+
pivot: "Pivot table",
|
|
306
|
+
total: "Total",
|
|
307
|
+
subtotal: "{label} total",
|
|
308
|
+
empty: "(blank)",
|
|
309
|
+
yes: "Yes",
|
|
310
|
+
no: "No",
|
|
311
|
+
value: "{aggregate} of {field}",
|
|
312
|
+
values: "Values",
|
|
313
|
+
aggregates: {
|
|
314
|
+
sum: "Sum",
|
|
315
|
+
count: "Count",
|
|
316
|
+
avg: "Average",
|
|
317
|
+
min: "Min",
|
|
318
|
+
max: "Max",
|
|
319
|
+
distinct: "Distinct count",
|
|
320
|
+
median: "Median"
|
|
321
|
+
},
|
|
322
|
+
shows: {
|
|
323
|
+
percentOfTotal: "% of total",
|
|
324
|
+
percentOfRow: "% of row",
|
|
325
|
+
percentOfColumn: "% of column",
|
|
326
|
+
percentOfParent: "% of parent",
|
|
327
|
+
difference: "Difference",
|
|
328
|
+
percentDifference: "% difference",
|
|
329
|
+
runningTotal: "Running total",
|
|
330
|
+
rank: "Rank"
|
|
331
|
+
},
|
|
332
|
+
shownValue: "{value} ({show})",
|
|
333
|
+
expand: "Expand",
|
|
334
|
+
collapse: "Collapse",
|
|
335
|
+
sortField: "Sort by {field}",
|
|
336
|
+
sortValue: "Sort by this column",
|
|
337
|
+
noData: "No data",
|
|
338
|
+
busy: "Summing up…",
|
|
339
|
+
yearLabel: "{year}",
|
|
340
|
+
quarterLabel: "Q{quarter} {year}",
|
|
341
|
+
weekLabel: "Week {week}, {year}",
|
|
342
|
+
rangeLabel: "{from} – {to}",
|
|
343
|
+
subtotalRow: "{label} subtotal",
|
|
344
|
+
resizeColumn: "Drag to resize, double-click to fit",
|
|
345
|
+
columnWidth: "Width of {column}",
|
|
346
|
+
selected: "{rows} rows by {columns} columns selected",
|
|
347
|
+
copied: "{cells} cells copied",
|
|
348
|
+
expanded: "{label} expanded",
|
|
349
|
+
collapsed: "{label} collapsed",
|
|
350
|
+
fields: {
|
|
351
|
+
panel: "Fields",
|
|
352
|
+
list: "All fields",
|
|
353
|
+
search: "Search fields",
|
|
354
|
+
noFields: "No matching fields",
|
|
355
|
+
areas: {
|
|
356
|
+
filters: "Filters",
|
|
357
|
+
columns: "Columns",
|
|
358
|
+
rows: "Rows",
|
|
359
|
+
values: "Values"
|
|
360
|
+
},
|
|
361
|
+
dropHere: "Drag fields here",
|
|
362
|
+
menu: "Options for {field}",
|
|
363
|
+
sort: "Sort",
|
|
364
|
+
asc: "Ascending",
|
|
365
|
+
desc: "Descending",
|
|
366
|
+
byValueDesc: "{value}, high to low",
|
|
367
|
+
byValueAsc: "{value}, low to high",
|
|
368
|
+
groupBy: "Group",
|
|
369
|
+
noGroup: "No grouping",
|
|
370
|
+
periods: {
|
|
371
|
+
year: "By year",
|
|
372
|
+
quarter: "By quarter",
|
|
373
|
+
month: "By month",
|
|
374
|
+
week: "By week",
|
|
375
|
+
day: "By day"
|
|
376
|
+
},
|
|
377
|
+
step: "Every {step}",
|
|
378
|
+
grouped: "{field} · {group}",
|
|
379
|
+
subtotal: "Show subtotals",
|
|
380
|
+
aggregate: "Summarize by",
|
|
381
|
+
filter: "Filter…",
|
|
382
|
+
filtered: "Filtered",
|
|
383
|
+
moveTo: "Move to",
|
|
384
|
+
moveUp: "Move up",
|
|
385
|
+
moveDown: "Move down",
|
|
386
|
+
remove: "Remove",
|
|
387
|
+
valuesOnRows: "Values on rows",
|
|
388
|
+
showAs: "Show values as",
|
|
389
|
+
showPlain: "No calculation",
|
|
390
|
+
mark: "Conditional format",
|
|
391
|
+
noMark: "None",
|
|
392
|
+
bar: "Data bars",
|
|
393
|
+
scale: "Color scale",
|
|
394
|
+
top: "Top N",
|
|
395
|
+
topN: "Top {count}",
|
|
396
|
+
bottomN: "Bottom {count}",
|
|
397
|
+
noTop: "All",
|
|
398
|
+
topped: "{field} · {top}",
|
|
399
|
+
between: "Total {range}",
|
|
400
|
+
customTop: "Custom…",
|
|
401
|
+
addFormula: "Add calculated value",
|
|
402
|
+
editFormula: "Edit formula…",
|
|
403
|
+
open: "Fields"
|
|
404
|
+
},
|
|
405
|
+
topDialog: {
|
|
406
|
+
title: "Filter {field} by totals",
|
|
407
|
+
top: "Top N",
|
|
408
|
+
bottom: "Bottom N",
|
|
409
|
+
between: "Range",
|
|
410
|
+
by: "By",
|
|
411
|
+
count: "Count",
|
|
412
|
+
min: "Min",
|
|
413
|
+
max: "Max",
|
|
414
|
+
help: "Keeps groups by their totals; the groups left out are not in the totals.",
|
|
415
|
+
clear: "All",
|
|
416
|
+
apply: "Apply",
|
|
417
|
+
cancel: "Cancel"
|
|
418
|
+
},
|
|
419
|
+
formula: {
|
|
420
|
+
title: "Calculated value",
|
|
421
|
+
name: "Name",
|
|
422
|
+
namePlaceholder: "The formula, when left empty",
|
|
423
|
+
formula: "Formula",
|
|
424
|
+
placeholder: "e.g. (amount - cost) / amount",
|
|
425
|
+
help: "A field name stands for its total. Use + - * / and parentheses, or sum, avg, min, max and count.",
|
|
426
|
+
fields: "Insert field",
|
|
427
|
+
apply: "Apply",
|
|
428
|
+
cancel: "Cancel",
|
|
429
|
+
errors: {
|
|
430
|
+
empty: "Enter a formula",
|
|
431
|
+
incomplete: "The formula is not complete",
|
|
432
|
+
unknownChar: "Unknown character \"{detail}\"",
|
|
433
|
+
unexpected: "Unexpected \"{detail}\"",
|
|
434
|
+
expected: "Missing \"{detail}\"",
|
|
435
|
+
unclosedBracket: "Missing \"]\"",
|
|
436
|
+
emptyName: "No field name in the brackets",
|
|
437
|
+
unknownFunction: "No function named \"{detail}\"",
|
|
438
|
+
needsField: "{detail}() needs a field",
|
|
439
|
+
needsName: "A field name should go here",
|
|
440
|
+
unknownField: "No field named \"{detail}\"",
|
|
441
|
+
notNumber: "\"{detail}\" is not a number field"
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
filter: {
|
|
445
|
+
title: "Filter {field}",
|
|
446
|
+
search: "Search",
|
|
447
|
+
all: "Select all",
|
|
448
|
+
noMatch: "No matching values",
|
|
449
|
+
apply: "Apply",
|
|
450
|
+
cancel: "Cancel",
|
|
451
|
+
count: "{picked} of {total} selected"
|
|
452
|
+
}
|
|
453
|
+
};
|
|
454
|
+
var pivotLocales = {
|
|
455
|
+
"zh-CN": zhCN,
|
|
456
|
+
"zh-TW": zhTW,
|
|
457
|
+
en
|
|
458
|
+
};
|
|
459
|
+
/**
|
|
460
|
+
* The pivot table's texts, picked by the name of DouUI's current locale.
|
|
461
|
+
* Pass `messages` to override any of them.
|
|
462
|
+
*/
|
|
463
|
+
function usePivotMessages(override) {
|
|
464
|
+
const { locale } = useLocale();
|
|
465
|
+
return computed(() => {
|
|
466
|
+
const name = locale.value.name;
|
|
467
|
+
const base = pivotLocales[name] ?? pivotLocales[name.split("-")[0]] ?? (name.startsWith("zh") ? zhCN : en);
|
|
468
|
+
const extra = toValue(override);
|
|
469
|
+
if (!extra) return base;
|
|
470
|
+
return {
|
|
471
|
+
...base,
|
|
472
|
+
...extra,
|
|
473
|
+
aggregates: {
|
|
474
|
+
...base.aggregates,
|
|
475
|
+
...extra.aggregates
|
|
476
|
+
},
|
|
477
|
+
shows: {
|
|
478
|
+
...base.shows,
|
|
479
|
+
...extra.shows
|
|
480
|
+
},
|
|
481
|
+
fields: {
|
|
482
|
+
...base.fields,
|
|
483
|
+
...extra.fields
|
|
484
|
+
},
|
|
485
|
+
topDialog: {
|
|
486
|
+
...base.topDialog,
|
|
487
|
+
...extra.topDialog
|
|
488
|
+
},
|
|
489
|
+
formula: {
|
|
490
|
+
...base.formula,
|
|
491
|
+
...extra.formula,
|
|
492
|
+
errors: {
|
|
493
|
+
...base.formula.errors,
|
|
494
|
+
...extra.formula?.errors
|
|
495
|
+
}
|
|
496
|
+
},
|
|
497
|
+
filter: {
|
|
498
|
+
...base.filter,
|
|
499
|
+
...extra.filter
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
/** Fills `{name}` placeholders. */
|
|
505
|
+
var format = (text, params) => text.replace(/\{(\w+)\}/g, (match, key) => String(params[key] ?? match));
|
|
506
|
+
export { format, pivotLocales, usePivotMessages };
|
|
507
|
+
|
|
508
|
+
//# sourceMappingURL=locale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locale.js","names":[],"sources":["../src/locale.ts"],"sourcesContent":["import { useLocale } from 'dou-ui'\nimport { computed, toValue, type MaybeRefOrGetter } from 'vue'\nimport type { PivotFormulaErrorCode } from './engine/formula'\nimport type { PivotShowAs } from './engine/types'\n\nexport interface PivotMessages {\n /** The table's accessible name. */\n pivot: string\n /** The grand total row and column. */\n total: string\n /** The column with an open group's total: `{label}`. */\n subtotal: string\n /** The group of records without a value. */\n empty: string\n yes: string\n no: string\n /** The header of a value: `{field}` and `{aggregate}`. Sums are headed by the field alone. */\n value: string\n /** The header of the column of value names, when the values run down the rows. */\n values: string\n /** The words for the built-in ways to sum up. */\n aggregates: Record<'sum' | 'count' | 'avg' | 'min' | 'max' | 'distinct' | 'median', string>\n /** The ways of showing a value: after the value's name in its header, and in the menu. */\n shows: Record<PivotShowAs, string>\n /** The header of a value with a `show`: `{value}` and `{show}`. */\n shownValue: string\n expand: string\n collapse: string\n /** On a field name in the corner: `{field}`. */\n sortField: string\n /** On a value header: what clicking does. */\n sortValue: string\n /** Shown, and read out, when no record passes the filters. */\n noData: string\n /** Shown over the table while a worker sums up. */\n busy: string\n /** Group labels when a date field is grouped by a period: `{year}`, `{quarter}`, `{week}`. */\n yearLabel: string\n quarterLabel: string\n weekLabel: string\n /** A range of numbers: `{from}` and `{to}`. */\n rangeLabel: string\n /** The line of an open group in the tabular layout that holds its total: `{label}`. */\n subtotalRow: string\n /** What dragging the edge of a column header does. */\n resizeColumn: string\n /** The accessible name of a column's resize handle: `{column}`. */\n columnWidth: string\n /** Read out when a range is selected: `{rows}` and `{columns}`. */\n selected: string\n /** Read out after copying: `{cells}`. */\n copied: string\n /** Read out when a group opens or closes: `{label}`. */\n expanded: string\n collapsed: string\n /** The field panel. */\n fields: {\n /** The panel's accessible name. */\n panel: string\n /** The list of all fields. */\n list: string\n search: string\n noFields: string\n areas: Record<'filters' | 'columns' | 'rows' | 'values', string>\n /** In an empty area. */\n dropHere: string\n /** On a field's menu button: `{field}`. */\n menu: string\n sort: string\n asc: string\n desc: string\n /** Sorting the row groups by a value's grand total: `{value}`. */\n byValueDesc: string\n byValueAsc: string\n groupBy: string\n noGroup: string\n periods: Record<'year' | 'quarter' | 'month' | 'week' | 'day', string>\n /** A grouping in ranges: `{step}`. */\n step: string\n /** A chip whose field is grouped: `{field}` and `{group}` (as in the grouping menu). */\n grouped: string\n subtotal: string\n aggregate: string\n filter: string\n /** On a field with a filter. */\n filtered: string\n /** The submenu that moves the field to another area. */\n moveTo: string\n /** Move the field one place up or down in its area (the order of the rows makes the levels). */\n moveUp: string\n moveDown: string\n remove: string\n /** In the values area: puts several values down the rows. */\n valuesOnRows: string\n /** The submenu of a value's ways of showing, and its first item (as summed up). */\n showAs: string\n showPlain: string\n /** The submenu of a value's marks. */\n mark: string\n noMark: string\n bar: string\n scale: string\n /** The submenu that keeps the groups with the largest (or smallest) totals: `{count}`. */\n top: string\n topN: string\n bottomN: string\n noTop: string\n /** A chip whose field keeps only some groups by their totals: `{field}` and `{top}`. */\n topped: string\n /** A range of totals on a chip: `{range}`. */\n between: string\n /** The item that opens the dialog for any number, or a range of totals. */\n customTop: string\n /** The button that adds a calculated value, and the item that changes one. */\n addFormula: string\n editFormula: string\n /** The button that opens the panel in a drawer on a narrow screen. */\n open: string\n }\n /** The dialog that keeps the groups of a field by their totals. */\n topDialog: {\n /** `{field}` */\n title: string\n top: string\n bottom: string\n between: string\n /** Which value's totals rank the groups. */\n by: string\n count: string\n min: string\n max: string\n help: string\n clear: string\n apply: string\n cancel: string\n }\n /** The dialog that writes a calculated value. */\n formula: {\n title: string\n name: string\n /** In the name box: what the header says when it is left empty. */\n namePlaceholder: string\n formula: string\n placeholder: string\n /** Under the box: how to write a formula. */\n help: string\n /** The list of fields to put in the formula. */\n fields: string\n apply: string\n cancel: string\n /** Why the formula cannot be used: `{detail}` is the text it is about. */\n errors: Record<PivotFormulaErrorCode, string>\n }\n /** The filter popover. */\n filter: {\n /** Its accessible name: `{field}`. */\n title: string\n search: string\n all: string\n noMatch: string\n apply: string\n cancel: string\n /** How many values are picked: `{picked}` of `{total}`. */\n count: string\n }\n}\n\nconst zhCN: PivotMessages = {\n pivot: '数据透视表',\n total: '总计',\n subtotal: '{label} 合计',\n empty: '(空)',\n yes: '是',\n no: '否',\n value: '{field} · {aggregate}',\n values: '值',\n aggregates: {\n sum: '求和',\n count: '计数',\n avg: '平均值',\n min: '最小值',\n max: '最大值',\n distinct: '去重计数',\n median: '中位数',\n },\n shows: {\n percentOfTotal: '占总计',\n percentOfRow: '占行合计',\n percentOfColumn: '占列合计',\n percentOfParent: '占上级',\n difference: '差值',\n percentDifference: '差值百分比',\n runningTotal: '累计',\n rank: '排名',\n },\n shownValue: '{value} · {show}',\n expand: '展开',\n collapse: '折叠',\n sortField: '按{field}排序',\n sortValue: '按这一列排序',\n noData: '没有数据',\n busy: '正在汇总…',\n yearLabel: '{year} 年',\n quarterLabel: '{year} 年 Q{quarter}',\n weekLabel: '{year} 年第 {week} 周',\n rangeLabel: '{from} – {to}',\n subtotalRow: '{label} 小计',\n resizeColumn: '拖动调整列宽,双击适应内容',\n columnWidth: '{column}的列宽',\n selected: '已选中 {rows} 行 {columns} 列',\n copied: '已复制 {cells} 个格子',\n expanded: '已展开{label}',\n collapsed: '已折叠{label}',\n fields: {\n panel: '字段',\n list: '全部字段',\n search: '搜索字段',\n noFields: '没有匹配的字段',\n areas: { filters: '筛选', columns: '列', rows: '行', values: '值' },\n dropHere: '拖动字段到这里',\n menu: '{field}的选项',\n sort: '排序',\n asc: '升序',\n desc: '降序',\n byValueDesc: '按{value}从高到低',\n byValueAsc: '按{value}从低到高',\n groupBy: '分组',\n noGroup: '不分组',\n periods: { year: '按年', quarter: '按季度', month: '按月', week: '按周', day: '按日' },\n step: '每 {step} 一组',\n grouped: '{field} · {group}',\n subtotal: '显示小计',\n aggregate: '汇总方式',\n filter: '筛选…',\n filtered: '已筛选',\n moveTo: '移到',\n moveUp: '上移',\n moveDown: '下移',\n remove: '移除',\n valuesOnRows: '值放在行上',\n showAs: '显示方式',\n showPlain: '原值',\n mark: '条件格式',\n noMark: '无',\n bar: '数据条',\n scale: '色阶',\n top: '前 N 项',\n topN: '前 {count} 项',\n bottomN: '后 {count} 项',\n noTop: '不限',\n topped: '{field} · {top}',\n between: '合计 {range}',\n customTop: '自定义…',\n addFormula: '添加计算值',\n editFormula: '编辑公式…',\n open: '字段',\n },\n topDialog: {\n title: '按合计筛选{field}',\n top: '前 N 项',\n bottom: '后 N 项',\n between: '合计范围',\n by: '按',\n count: '项数',\n min: '最小',\n max: '最大',\n help: '按合计保留组,被排除的组不计入总计。',\n clear: '不限',\n apply: '确定',\n cancel: '取消',\n },\n formula: {\n title: '计算值',\n name: '名称',\n namePlaceholder: '不填时用公式作名称',\n formula: '公式',\n placeholder: '如 (销售额 - 成本) / 销售额',\n help: '字段名表示它的合计,可以用 + - * / 和括号,也可以用 sum、avg、min、max、count。',\n fields: '插入字段',\n apply: '确定',\n cancel: '取消',\n errors: {\n empty: '请填写公式',\n incomplete: '公式不完整',\n unknownChar: '无法识别“{detail}”',\n unexpected: '这里不应出现“{detail}”',\n expected: '缺少“{detail}”',\n unclosedBracket: '缺少“]”',\n emptyName: '方括号里没有字段名',\n unknownFunction: '没有名为“{detail}”的函数',\n needsField: '{detail}() 里需要一个字段',\n needsName: '这里应当是字段名',\n unknownField: '没有名为“{detail}”的字段',\n notNumber: '“{detail}”不是数字字段',\n },\n },\n filter: {\n title: '筛选{field}',\n search: '搜索',\n all: '全选',\n noMatch: '没有匹配的值',\n apply: '确定',\n cancel: '取消',\n count: '已选 {picked} / {total}',\n },\n}\n\nconst zhTW: PivotMessages = {\n pivot: '樞紐分析表',\n total: '總計',\n subtotal: '{label} 合計',\n empty: '(空)',\n yes: '是',\n no: '否',\n value: '{field} · {aggregate}',\n values: '值',\n aggregates: {\n sum: '加總',\n count: '計數',\n avg: '平均值',\n min: '最小值',\n max: '最大值',\n distinct: '不重複計數',\n median: '中位數',\n },\n shows: {\n percentOfTotal: '佔總計',\n percentOfRow: '佔列合計',\n percentOfColumn: '佔欄合計',\n percentOfParent: '佔上層',\n difference: '差異',\n percentDifference: '差異百分比',\n runningTotal: '累計',\n rank: '排名',\n },\n shownValue: '{value} · {show}',\n expand: '展開',\n collapse: '摺疊',\n sortField: '依{field}排序',\n sortValue: '依這一欄排序',\n noData: '沒有資料',\n busy: '正在彙總…',\n yearLabel: '{year} 年',\n quarterLabel: '{year} 年 Q{quarter}',\n weekLabel: '{year} 年第 {week} 週',\n rangeLabel: '{from} – {to}',\n subtotalRow: '{label} 小計',\n resizeColumn: '拖曳調整欄寬,按兩下符合內容',\n columnWidth: '{column}的欄寬',\n selected: '已選取 {rows} 列 {columns} 欄',\n copied: '已複製 {cells} 個儲存格',\n expanded: '已展開{label}',\n collapsed: '已摺疊{label}',\n fields: {\n panel: '欄位',\n list: '所有欄位',\n search: '搜尋欄位',\n noFields: '沒有符合的欄位',\n areas: { filters: '篩選', columns: '欄', rows: '列', values: '值' },\n dropHere: '拖曳欄位到這裡',\n menu: '{field}的選項',\n sort: '排序',\n asc: '遞增',\n desc: '遞減',\n byValueDesc: '依{value}由高到低',\n byValueAsc: '依{value}由低到高',\n groupBy: '分組',\n noGroup: '不分組',\n periods: { year: '依年', quarter: '依季', month: '依月', week: '依週', day: '依日' },\n step: '每 {step} 一組',\n grouped: '{field} · {group}',\n subtotal: '顯示小計',\n aggregate: '摘要方式',\n filter: '篩選…',\n filtered: '已篩選',\n moveTo: '移到',\n moveUp: '上移',\n moveDown: '下移',\n remove: '移除',\n valuesOnRows: '值放在列上',\n showAs: '值的顯示方式',\n showPlain: '原始值',\n mark: '設定格式化的條件',\n noMark: '無',\n bar: '資料橫條',\n scale: '色階',\n top: '前 N 項',\n topN: '前 {count} 項',\n bottomN: '後 {count} 項',\n noTop: '不限',\n topped: '{field} · {top}',\n between: '合計 {range}',\n customTop: '自訂…',\n addFormula: '新增計算值',\n editFormula: '編輯公式…',\n open: '欄位',\n },\n topDialog: {\n title: '依合計篩選{field}',\n top: '前 N 項',\n bottom: '後 N 項',\n between: '合計範圍',\n by: '依',\n count: '項數',\n min: '最小',\n max: '最大',\n help: '依合計保留群組,被排除的群組不計入總計。',\n clear: '不限',\n apply: '確定',\n cancel: '取消',\n },\n formula: {\n title: '計算值',\n name: '名稱',\n namePlaceholder: '不填時以公式作為名稱',\n formula: '公式',\n placeholder: '如 (銷售額 - 成本) / 銷售額',\n help: '欄位名稱代表它的合計,可以用 + - * / 和括號,也可以用 sum、avg、min、max、count。',\n fields: '插入欄位',\n apply: '確定',\n cancel: '取消',\n errors: {\n empty: '請填寫公式',\n incomplete: '公式不完整',\n unknownChar: '無法辨識「{detail}」',\n unexpected: '這裡不應出現「{detail}」',\n expected: '缺少「{detail}」',\n unclosedBracket: '缺少「]」',\n emptyName: '方括號裡沒有欄位名稱',\n unknownFunction: '沒有名為「{detail}」的函式',\n needsField: '{detail}() 裡需要一個欄位',\n needsName: '這裡應該是欄位名稱',\n unknownField: '沒有名為「{detail}」的欄位',\n notNumber: '「{detail}」不是數字欄位',\n },\n },\n filter: {\n title: '篩選{field}',\n search: '搜尋',\n all: '全選',\n noMatch: '沒有符合的值',\n apply: '確定',\n cancel: '取消',\n count: '已選 {picked} / {total}',\n },\n}\n\nconst en: PivotMessages = {\n pivot: 'Pivot table',\n total: 'Total',\n subtotal: '{label} total',\n empty: '(blank)',\n yes: 'Yes',\n no: 'No',\n value: '{aggregate} of {field}',\n values: 'Values',\n aggregates: {\n sum: 'Sum',\n count: 'Count',\n avg: 'Average',\n min: 'Min',\n max: 'Max',\n distinct: 'Distinct count',\n median: 'Median',\n },\n shows: {\n percentOfTotal: '% of total',\n percentOfRow: '% of row',\n percentOfColumn: '% of column',\n percentOfParent: '% of parent',\n difference: 'Difference',\n percentDifference: '% difference',\n runningTotal: 'Running total',\n rank: 'Rank',\n },\n shownValue: '{value} ({show})',\n expand: 'Expand',\n collapse: 'Collapse',\n sortField: 'Sort by {field}',\n sortValue: 'Sort by this column',\n noData: 'No data',\n busy: 'Summing up…',\n yearLabel: '{year}',\n quarterLabel: 'Q{quarter} {year}',\n weekLabel: 'Week {week}, {year}',\n rangeLabel: '{from} – {to}',\n subtotalRow: '{label} subtotal',\n resizeColumn: 'Drag to resize, double-click to fit',\n columnWidth: 'Width of {column}',\n selected: '{rows} rows by {columns} columns selected',\n copied: '{cells} cells copied',\n expanded: '{label} expanded',\n collapsed: '{label} collapsed',\n fields: {\n panel: 'Fields',\n list: 'All fields',\n search: 'Search fields',\n noFields: 'No matching fields',\n areas: { filters: 'Filters', columns: 'Columns', rows: 'Rows', values: 'Values' },\n dropHere: 'Drag fields here',\n menu: 'Options for {field}',\n sort: 'Sort',\n asc: 'Ascending',\n desc: 'Descending',\n byValueDesc: '{value}, high to low',\n byValueAsc: '{value}, low to high',\n groupBy: 'Group',\n noGroup: 'No grouping',\n periods: {\n year: 'By year',\n quarter: 'By quarter',\n month: 'By month',\n week: 'By week',\n day: 'By day',\n },\n step: 'Every {step}',\n grouped: '{field} · {group}',\n subtotal: 'Show subtotals',\n aggregate: 'Summarize by',\n filter: 'Filter…',\n filtered: 'Filtered',\n moveTo: 'Move to',\n moveUp: 'Move up',\n moveDown: 'Move down',\n remove: 'Remove',\n valuesOnRows: 'Values on rows',\n showAs: 'Show values as',\n showPlain: 'No calculation',\n mark: 'Conditional format',\n noMark: 'None',\n bar: 'Data bars',\n scale: 'Color scale',\n top: 'Top N',\n topN: 'Top {count}',\n bottomN: 'Bottom {count}',\n noTop: 'All',\n topped: '{field} · {top}',\n between: 'Total {range}',\n customTop: 'Custom…',\n addFormula: 'Add calculated value',\n editFormula: 'Edit formula…',\n open: 'Fields',\n },\n topDialog: {\n title: 'Filter {field} by totals',\n top: 'Top N',\n bottom: 'Bottom N',\n between: 'Range',\n by: 'By',\n count: 'Count',\n min: 'Min',\n max: 'Max',\n help: 'Keeps groups by their totals; the groups left out are not in the totals.',\n clear: 'All',\n apply: 'Apply',\n cancel: 'Cancel',\n },\n formula: {\n title: 'Calculated value',\n name: 'Name',\n namePlaceholder: 'The formula, when left empty',\n formula: 'Formula',\n placeholder: 'e.g. (amount - cost) / amount',\n help: 'A field name stands for its total. Use + - * / and parentheses, or sum, avg, min, max and count.',\n fields: 'Insert field',\n apply: 'Apply',\n cancel: 'Cancel',\n errors: {\n empty: 'Enter a formula',\n incomplete: 'The formula is not complete',\n unknownChar: 'Unknown character \"{detail}\"',\n unexpected: 'Unexpected \"{detail}\"',\n expected: 'Missing \"{detail}\"',\n unclosedBracket: 'Missing \"]\"',\n emptyName: 'No field name in the brackets',\n unknownFunction: 'No function named \"{detail}\"',\n needsField: '{detail}() needs a field',\n needsName: 'A field name should go here',\n unknownField: 'No field named \"{detail}\"',\n notNumber: '\"{detail}\" is not a number field',\n },\n },\n filter: {\n title: 'Filter {field}',\n search: 'Search',\n all: 'Select all',\n noMatch: 'No matching values',\n apply: 'Apply',\n cancel: 'Cancel',\n count: '{picked} of {total} selected',\n },\n}\n\nexport const pivotLocales: Record<string, PivotMessages> = {\n 'zh-CN': zhCN,\n 'zh-TW': zhTW,\n en,\n}\n\nexport type PivotMessagesOverride = Partial<\n Omit<PivotMessages, 'aggregates' | 'shows' | 'fields' | 'topDialog' | 'formula' | 'filter'>\n> & {\n aggregates?: Partial<PivotMessages['aggregates']> & Record<string, string>\n shows?: Partial<PivotMessages['shows']>\n fields?: Partial<PivotMessages['fields']>\n topDialog?: Partial<PivotMessages['topDialog']>\n formula?: Partial<Omit<PivotMessages['formula'], 'errors'>> & {\n errors?: Partial<PivotMessages['formula']['errors']>\n }\n filter?: Partial<PivotMessages['filter']>\n}\n\n/**\n * The pivot table's texts, picked by the name of DouUI's current locale.\n * Pass `messages` to override any of them.\n */\nexport function usePivotMessages(override?: MaybeRefOrGetter<PivotMessagesOverride | undefined>) {\n const { locale } = useLocale()\n return computed<PivotMessages & { aggregates: Record<string, string> }>(() => {\n const name = locale.value.name\n const base =\n pivotLocales[name] ?? pivotLocales[name.split('-')[0]!] ?? (name.startsWith('zh') ? zhCN : en)\n const extra = toValue(override)\n if (!extra) return base\n return {\n ...base,\n ...extra,\n aggregates: { ...base.aggregates, ...extra.aggregates },\n shows: { ...base.shows, ...extra.shows },\n fields: { ...base.fields, ...extra.fields },\n topDialog: { ...base.topDialog, ...extra.topDialog },\n formula: {\n ...base.formula,\n ...extra.formula,\n errors: { ...base.formula.errors, ...extra.formula?.errors },\n },\n filter: { ...base.filter, ...extra.filter },\n }\n })\n}\n\n/** Fills `{name}` placeholders. */\nexport const format = (text: string, params: Record<string, string | number>) =>\n text.replace(/\\{(\\w+)\\}/g, (match, key: string) => String(params[key] ?? match))\n"],"mappings":";;;AAuKA,IAAM,OAAsB;CAC1B,OAAO;CACP,OAAO;CACP,UAAU;CACV,OAAO;CACP,KAAK;CACL,IAAI;CACJ,OAAO;CACP,QAAQ;CACR,YAAY;EACV,KAAK;EACL,OAAO;EACP,KAAK;EACL,KAAK;EACL,KAAK;EACL,UAAU;EACV,QAAQ;CACV;CACA,OAAO;EACL,gBAAgB;EAChB,cAAc;EACd,iBAAiB;EACjB,iBAAiB;EACjB,YAAY;EACZ,mBAAmB;EACnB,cAAc;EACd,MAAM;CACR;CACA,YAAY;CACZ,QAAQ;CACR,UAAU;CACV,WAAW;CACX,WAAW;CACX,QAAQ;CACR,MAAM;CACN,WAAW;CACX,cAAc;CACd,WAAW;CACX,YAAY;CACZ,aAAa;CACb,cAAc;CACd,aAAa;CACb,UAAU;CACV,QAAQ;CACR,UAAU;CACV,WAAW;CACX,QAAQ;EACN,OAAO;EACP,MAAM;EACN,QAAQ;EACR,UAAU;EACV,OAAO;GAAE,SAAS;GAAM,SAAS;GAAK,MAAM;GAAK,QAAQ;EAAI;EAC7D,UAAU;EACV,MAAM;EACN,MAAM;EACN,KAAK;EACL,MAAM;EACN,aAAa;EACb,YAAY;EACZ,SAAS;EACT,SAAS;EACT,SAAS;GAAE,MAAM;GAAM,SAAS;GAAO,OAAO;GAAM,MAAM;GAAM,KAAK;EAAK;EAC1E,MAAM;EACN,SAAS;EACT,UAAU;EACV,WAAW;EACX,QAAQ;EACR,UAAU;EACV,QAAQ;EACR,QAAQ;EACR,UAAU;EACV,QAAQ;EACR,cAAc;EACd,QAAQ;EACR,WAAW;EACX,MAAM;EACN,QAAQ;EACR,KAAK;EACL,OAAO;EACP,KAAK;EACL,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;EACR,SAAS;EACT,WAAW;EACX,YAAY;EACZ,aAAa;EACb,MAAM;CACR;CACA,WAAW;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c;GACd,WAAW;EACb;CACF;CACA,QAAQ;EACN,OAAO;EACP,QAAQ;EACR,KAAK;EACL,SAAS;EACT,OAAO;EACP,QAAQ;EACR,OAAO;CACT;AACF;AAEA,IAAa,eAA8C;CACzD,SAAS;CACT,SAAS;CACT;AACF;;;;;AAmBA,SAAgB,iBAAiB,UAAgE;CAC/F,MAAM,EAAE,WAAW,UAAU;CAC7B,OAAO,eAAuE;EAC5E,MAAM,OAAO,OAAO,MAAM;EAC1B,MAAM,OACJ,aAAa,SAAS,aAAa,KAAK,MAAM,GAAG,CAAC,CAAC,QAAS,KAAK,WAAW,IAAI,IAAI,OAAO;EAC7F,MAAM,QAAQ,QAAQ,QAAQ;EAC9B,IAAI,CAAC,OAAO,OAAO;EACnB,OAAO;GACL,GAAG;GACH,GAAG;GACH,YAAY;IAAE,GAAG,KAAK;IAAY,GAAG,MAAM;GAAW;GACtD,OAAO;IAAE,GAAG,KAAK;IAAO,GAAG,MAAM;GAAM;GACvC,QAAQ;IAAE,GAAG,KAAK;IAAQ,GAAG,MAAM;GAAO;GAC1C,WAAW;IAAE,GAAG,KAAK;IAAW,GAAG,MAAM;GAAU;GACnD,SAAS;IACP,GAAG,KAAK;IACR,GAAG,MAAM;IACT,QAAQ;KAAE,GAAG,KAAK,QAAQ;KAAQ,GAAG,MAAM,SAAS;IAAO;GAC7D;GACA,QAAQ;IAAE,GAAG,KAAK;IAAQ,GAAG,MAAM;GAAO;EAC5C;CACF,CAAC;AACH;;AAGA,IAAa,UAAU,MAAc,WACnC,KAAK,QAAQ,eAAe,OAAO,QAAgB,OAAO,OAAO,QAAQ,KAAK,CAAC"}
|
package/dist/pivot.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import pivot_vue_vue_type_script_setup_true_lang_default from "./pivot.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
// src/pivot.vue
|
|
3
|
+
var pivot_default = pivot_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
export { pivot_default as default };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=pivot.js.map
|