aibox-custom-component-packages 0.0.21 → 0.0.22

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 (118) hide show
  1. package/es/AiboxTabs.mjs +71 -0
  2. package/es/ExampleComponent.mjs +35 -0
  3. package/es/SourcePublish.mjs +1 -1
  4. package/es/assets/AiboxTabs.css +1 -0
  5. package/es/assets/BackBar.css +1 -0
  6. package/es/assets/ExampleComponent.css +1 -0
  7. package/es/assets/SourcePublish.css +1 -1
  8. package/es/assets/index.css +1 -0
  9. package/es/assets/index2.css +1 -0
  10. package/es/assets/index3.css +1 -0
  11. package/es/assets/index4.css +1 -0
  12. package/es/chunks/AiboxTable.CF4T_OCu.js +645 -0
  13. package/es/chunks/BackBar.Bc2NIuzk.js +645 -0
  14. package/es/chunks/{SourcePublish.BjY8OTLS.js → SourcePublish.CjzqOFwj.js} +23 -10
  15. package/es/chunks/_plugin-vue_export-helper.CHgC5LLL.js +9 -0
  16. package/es/chunks/config.8htFF04x.js +325 -0
  17. package/es/chunks/config.BU21Gda2.js +49 -0
  18. package/es/chunks/config.DPkdwjwD.js +49 -0
  19. package/es/chunks/config.gNZ_rT87.js +325 -0
  20. package/es/chunks/enums.CfSBDD6u.js +83 -0
  21. package/es/chunks/enums.WrpwbF4w.js +14 -0
  22. package/es/chunks/field-types.CPnMOjle.js +13 -0
  23. package/es/chunks/files.cduUqjHX.js +16 -0
  24. package/es/chunks/i18n.DmqkiK-h.js +444 -0
  25. package/es/chunks/i18n.k9Q_HVMs.js +443 -0
  26. package/es/chunks/index.BDd6hHiU.js +172 -0
  27. package/es/chunks/index.CF_YHLP5.js +257 -0
  28. package/es/chunks/index.DM3o2YX3.js +398 -0
  29. package/es/chunks/index.Dx-mCS4E.js +1298 -0
  30. package/es/chunks/index.bCzIhWFw.js +7 -0
  31. package/es/chunks/index.ml5i7aB5.js +257 -0
  32. package/es/chunks/layout.CygCXa6s.js +26 -0
  33. package/es/chunks/publish.D6friivo.js +50 -0
  34. package/es/chunks/publish.DlD0o09n.js +50 -0
  35. package/es/chunks/request.24c3shPx.js +5 -0
  36. package/es/chunks/usePreview.BHvXwaNi.js +157 -0
  37. package/es/index.mjs +1 -1
  38. package/lib/AiboxTabs.js +1 -0
  39. package/lib/ExampleComponent.js +1 -0
  40. package/lib/SourcePublish.js +1 -1
  41. package/lib/assets/AiboxTabs.css +1 -0
  42. package/lib/assets/BackBar.css +1 -0
  43. package/lib/assets/ExampleComponent.css +1 -0
  44. package/lib/assets/SourcePublish.css +1 -1
  45. package/lib/assets/index.css +1 -0
  46. package/lib/assets/index2.css +1 -0
  47. package/lib/assets/index3.css +1 -0
  48. package/lib/assets/index4.css +1 -0
  49. package/lib/chunks/AiboxTable.CJOPGJtU.js +1 -0
  50. package/lib/chunks/BackBar.CZsNxoX1.js +1 -0
  51. package/lib/chunks/SourcePublish.eOSEULjP.js +1 -0
  52. package/lib/chunks/_plugin-vue_export-helper.BHFhmbuH.js +1 -0
  53. package/lib/chunks/config.1oaIKLGn.js +1 -0
  54. package/lib/chunks/config.B0XKkp1w.js +1 -0
  55. package/lib/chunks/config.BCAuBVxV.js +1 -0
  56. package/lib/chunks/config.BF7MO0O5.js +1 -0
  57. package/lib/chunks/enums.Dmq4PdUc.js +1 -0
  58. package/lib/chunks/enums.DpU2er5r.js +1 -0
  59. package/lib/chunks/field-types.Ch_2yDfg.js +1 -0
  60. package/lib/chunks/files.B3-8UC0v.js +1 -0
  61. package/lib/chunks/i18n.CL5L6nx6.js +1 -0
  62. package/lib/chunks/i18n.DgOp_D7R.js +1 -0
  63. package/lib/chunks/index.4hFddClT.js +6 -0
  64. package/lib/chunks/index.BNivYbtq.js +1 -0
  65. package/lib/chunks/index.B_keI1Aq.js +1 -0
  66. package/lib/chunks/index.Bk-RwmaH.js +1 -0
  67. package/lib/chunks/index.CJFk1R2u.js +59 -0
  68. package/lib/chunks/index.CkihWzK6.js +1 -0
  69. package/lib/chunks/layout.DbBSbLgm.js +1 -0
  70. package/lib/chunks/publish.3TrK3fZf.js +1 -0
  71. package/lib/chunks/publish.Bw1acrSu.js +1 -0
  72. package/lib/chunks/request.D8T4MgGX.js +1 -0
  73. package/lib/chunks/usePreview.BojIDW7Z.js +1 -0
  74. package/lib/index.js +1 -1
  75. package/package.json +3 -3
  76. package/es/chunks/AddOrEditSupplierDialog.BCiXcUBu.js +0 -721
  77. package/es/chunks/AiboxTable.B_Yli5E8.js +0 -635
  78. package/es/chunks/ApplicationTypeTag.BbJwXyVa.js +0 -47
  79. package/es/chunks/AuthSection.CLi8HcIx.js +0 -201
  80. package/es/chunks/AvailableRangePreview.BgeL_bMq.js +0 -194
  81. package/es/chunks/AvailableRangeSetting.CGJxgfPT.js +0 -229
  82. package/es/chunks/CodeView.CWbewuHs.js +0 -148
  83. package/es/chunks/CommonTagsList.CJdBie2N.js +0 -156
  84. package/es/chunks/CreateMcpForm.C0HqvD-g.js +0 -308
  85. package/es/chunks/DocSyncSelect.DlJXL1lq.js +0 -2290
  86. package/es/chunks/FileUploader.BSIhrd9M.js +0 -216
  87. package/es/chunks/McpFormDialog.CDH31D2Q.js +0 -297
  88. package/es/chunks/McpParamsSet.Bx3aRL9j.js +0 -501
  89. package/es/chunks/MdEditor.Bb9S_hso.js +0 -163
  90. package/es/chunks/ParameterTable.CoRz_932.js +0 -2010
  91. package/es/chunks/PublishRecord.C8h1tu3w.js +0 -133
  92. package/es/chunks/SourcePublish.CebmryAz.js +0 -966
  93. package/es/chunks/SourcePublish.Dk7O9GzI.js +0 -968
  94. package/es/chunks/config.CIQoQGOb.js +0 -35
  95. package/es/chunks/config.lm2B-n0s.js +0 -270
  96. package/es/chunks/i18n.CIhVBbR3.js +0 -418
  97. package/lib/chunks/AddOrEditSupplierDialog.XtPxc5yr.js +0 -1
  98. package/lib/chunks/AiboxTable.DFyqwoGc.js +0 -1
  99. package/lib/chunks/ApplicationTypeTag.CZReMt-9.js +0 -1
  100. package/lib/chunks/AuthSection.CP9c-YTW.js +0 -1
  101. package/lib/chunks/AvailableRangePreview.DvREyHNH.js +0 -1
  102. package/lib/chunks/AvailableRangeSetting.DDHTOLJA.js +0 -1
  103. package/lib/chunks/CodeView.DeBxLqyC.js +0 -1
  104. package/lib/chunks/CommonTagsList.QEP4G-Em.js +0 -1
  105. package/lib/chunks/CreateMcpForm.B2o0Ghjg.js +0 -1
  106. package/lib/chunks/DocSyncSelect.1gaXRzps.js +0 -2
  107. package/lib/chunks/FileUploader.6IW_QL-h.js +0 -1
  108. package/lib/chunks/McpFormDialog.FwXnBBd2.js +0 -6
  109. package/lib/chunks/McpParamsSet.BYrxVvDL.js +0 -1
  110. package/lib/chunks/MdEditor.Cp24y4DJ.js +0 -1
  111. package/lib/chunks/ParameterTable.CeufAEXh.js +0 -1
  112. package/lib/chunks/PublishRecord.BVndvj7F.js +0 -5
  113. package/lib/chunks/SourcePublish.Bz8MaRPm.js +0 -1
  114. package/lib/chunks/SourcePublish.I7ORXPok.js +0 -1
  115. package/lib/chunks/SourcePublish.OeB6i-Iu.js +0 -1
  116. package/lib/chunks/config.B9Di8LtU.js +0 -1
  117. package/lib/chunks/config.CZl1kYtI.js +0 -1
  118. package/lib/chunks/i18n.BGe5gOau.js +0 -1
@@ -0,0 +1,443 @@
1
+ import { createI18n as i } from "vue-i18n";
2
+ import { ElMessageBox as l } from "element-plus";
3
+ import { g as u } from "./request.24c3shPx.js";
4
+ var s = {
5
+ name: "zh-cn",
6
+ el: {
7
+ breadcrumb: { label: "面包屑" },
8
+ colorpicker: {
9
+ confirm: "确定",
10
+ clear: "清空",
11
+ defaultLabel: "颜色选择器",
12
+ description: "当前颜色 {color},按 Enter 键选择新颜色",
13
+ alphaLabel: "选择透明度的值",
14
+ alphaDescription: "透明度 {alpha}, 当前颜色 {color}",
15
+ hueLabel: "选择色相值",
16
+ hueDescription: "色相 {hue}, 当前颜色 {color}",
17
+ svLabel: "选择饱和度与明度的值",
18
+ svDescription: "饱和度 {saturation}, 明度 {brightness}, 当前颜色 {color}",
19
+ predefineDescription: "选择 {value} 作为颜色"
20
+ },
21
+ datepicker: {
22
+ now: "此刻",
23
+ today: "今天",
24
+ cancel: "取消",
25
+ clear: "清空",
26
+ confirm: "确定",
27
+ dateTablePrompt: "使用方向键与 Enter 键可选择日期",
28
+ monthTablePrompt: "使用方向键与 Enter 键可选择月份",
29
+ yearTablePrompt: "使用方向键与 Enter 键可选择年份",
30
+ selectedDate: "已选日期",
31
+ selectDate: "选择日期",
32
+ selectTime: "选择时间",
33
+ startDate: "开始日期",
34
+ startTime: "开始时间",
35
+ endDate: "结束日期",
36
+ endTime: "结束时间",
37
+ prevYear: "前一年",
38
+ nextYear: "后一年",
39
+ prevMonth: "上个月",
40
+ nextMonth: "下个月",
41
+ year: "年",
42
+ month1: "1 月",
43
+ month2: "2 月",
44
+ month3: "3 月",
45
+ month4: "4 月",
46
+ month5: "5 月",
47
+ month6: "6 月",
48
+ month7: "7 月",
49
+ month8: "8 月",
50
+ month9: "9 月",
51
+ month10: "10 月",
52
+ month11: "11 月",
53
+ month12: "12 月",
54
+ weeks: {
55
+ sun: "日",
56
+ mon: "一",
57
+ tue: "二",
58
+ wed: "三",
59
+ thu: "四",
60
+ fri: "五",
61
+ sat: "六"
62
+ },
63
+ weeksFull: {
64
+ sun: "星期日",
65
+ mon: "星期一",
66
+ tue: "星期二",
67
+ wed: "星期三",
68
+ thu: "星期四",
69
+ fri: "星期五",
70
+ sat: "星期六"
71
+ },
72
+ months: {
73
+ jan: "一月",
74
+ feb: "二月",
75
+ mar: "三月",
76
+ apr: "四月",
77
+ may: "五月",
78
+ jun: "六月",
79
+ jul: "七月",
80
+ aug: "八月",
81
+ sep: "九月",
82
+ oct: "十月",
83
+ nov: "十一月",
84
+ dec: "十二月"
85
+ }
86
+ },
87
+ inputNumber: {
88
+ decrease: "减少数值",
89
+ increase: "增加数值"
90
+ },
91
+ select: {
92
+ loading: "加载中",
93
+ noMatch: "无匹配数据",
94
+ noData: "无数据",
95
+ placeholder: "请选择"
96
+ },
97
+ mention: { loading: "加载中" },
98
+ dropdown: { toggleDropdown: "切换下拉选项" },
99
+ cascader: {
100
+ noMatch: "无匹配数据",
101
+ loading: "加载中",
102
+ placeholder: "请选择",
103
+ noData: "暂无数据"
104
+ },
105
+ pagination: {
106
+ goto: "前往",
107
+ pagesize: "条/页",
108
+ total: "共 {total} 条",
109
+ pageClassifier: "页",
110
+ page: "页",
111
+ prev: "上一页",
112
+ next: "下一页",
113
+ currentPage: "第 {pager} 页",
114
+ prevPages: "向前 {pager} 页",
115
+ nextPages: "向后 {pager} 页",
116
+ deprecationWarning: "你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"
117
+ },
118
+ dialog: { close: "关闭此对话框" },
119
+ drawer: { close: "关闭此对话框" },
120
+ messagebox: {
121
+ title: "提示",
122
+ confirm: "确定",
123
+ cancel: "取消",
124
+ error: "输入的数据不合法!",
125
+ close: "关闭此对话框"
126
+ },
127
+ upload: {
128
+ deleteTip: "按 Delete 键可删除",
129
+ delete: "删除",
130
+ preview: "查看图片",
131
+ continue: "继续上传"
132
+ },
133
+ slider: {
134
+ defaultLabel: "滑块介于 {min} 至 {max}",
135
+ defaultRangeStartLabel: "选择起始值",
136
+ defaultRangeEndLabel: "选择结束值"
137
+ },
138
+ table: {
139
+ emptyText: "暂无数据",
140
+ confirmFilter: "筛选",
141
+ resetFilter: "重置",
142
+ clearFilter: "全部",
143
+ sumText: "合计",
144
+ selectAllLabel: "选择所有行",
145
+ selectRowLabel: "选择当前行",
146
+ expandRowLabel: "展开当前行",
147
+ collapseRowLabel: "收起当前行",
148
+ sortLabel: "按 {column} 排序",
149
+ filterLabel: "按 {column} 过滤"
150
+ },
151
+ tag: { close: "关闭此标签" },
152
+ tour: {
153
+ next: "下一步",
154
+ previous: "上一步",
155
+ finish: "结束导览",
156
+ close: "关闭此对话框"
157
+ },
158
+ tree: { emptyText: "暂无数据" },
159
+ transfer: {
160
+ noMatch: "无匹配数据",
161
+ noData: "无数据",
162
+ titles: ["列表 1", "列表 2"],
163
+ filterPlaceholder: "请输入搜索内容",
164
+ noCheckedFormat: "共 {total} 项",
165
+ hasCheckedFormat: "已选 {checked}/{total} 项"
166
+ },
167
+ image: { error: "加载失败" },
168
+ pageHeader: { title: "返回" },
169
+ popconfirm: {
170
+ confirmButtonText: "确定",
171
+ cancelButtonText: "取消"
172
+ },
173
+ carousel: {
174
+ leftArrow: "上一张幻灯片",
175
+ rightArrow: "下一张幻灯片",
176
+ indicator: "幻灯片切换至索引 {index}"
177
+ }
178
+ }
179
+ };
180
+ var d = {
181
+ name: "en",
182
+ el: {
183
+ breadcrumb: { label: "Breadcrumb" },
184
+ colorpicker: {
185
+ confirm: "OK",
186
+ clear: "Clear",
187
+ defaultLabel: "color picker",
188
+ description: "current color is {color}. press enter to select a new color.",
189
+ alphaLabel: "pick alpha value",
190
+ alphaDescription: "alpha {alpha}, current color is {color}",
191
+ hueLabel: "pick hue value",
192
+ hueDescription: "hue {hue}, current color is {color}",
193
+ svLabel: "pick saturation and brightness value",
194
+ svDescription: "saturation {saturation}, brightness {brightness}, current color is {color}",
195
+ predefineDescription: "select {value} as the color"
196
+ },
197
+ datepicker: {
198
+ now: "Now",
199
+ today: "Today",
200
+ cancel: "Cancel",
201
+ clear: "Clear",
202
+ confirm: "OK",
203
+ dateTablePrompt: "Use the arrow keys and enter to select the day of the month",
204
+ monthTablePrompt: "Use the arrow keys and enter to select the month",
205
+ yearTablePrompt: "Use the arrow keys and enter to select the year",
206
+ selectedDate: "Selected date",
207
+ selectDate: "Select date",
208
+ selectTime: "Select time",
209
+ startDate: "Start Date",
210
+ startTime: "Start Time",
211
+ endDate: "End Date",
212
+ endTime: "End Time",
213
+ prevYear: "Previous Year",
214
+ nextYear: "Next Year",
215
+ prevMonth: "Previous Month",
216
+ nextMonth: "Next Month",
217
+ year: "",
218
+ month1: "January",
219
+ month2: "February",
220
+ month3: "March",
221
+ month4: "April",
222
+ month5: "May",
223
+ month6: "June",
224
+ month7: "July",
225
+ month8: "August",
226
+ month9: "September",
227
+ month10: "October",
228
+ month11: "November",
229
+ month12: "December",
230
+ weeks: {
231
+ sun: "Sun",
232
+ mon: "Mon",
233
+ tue: "Tue",
234
+ wed: "Wed",
235
+ thu: "Thu",
236
+ fri: "Fri",
237
+ sat: "Sat"
238
+ },
239
+ weeksFull: {
240
+ sun: "Sunday",
241
+ mon: "Monday",
242
+ tue: "Tuesday",
243
+ wed: "Wednesday",
244
+ thu: "Thursday",
245
+ fri: "Friday",
246
+ sat: "Saturday"
247
+ },
248
+ months: {
249
+ jan: "Jan",
250
+ feb: "Feb",
251
+ mar: "Mar",
252
+ apr: "Apr",
253
+ may: "May",
254
+ jun: "Jun",
255
+ jul: "Jul",
256
+ aug: "Aug",
257
+ sep: "Sep",
258
+ oct: "Oct",
259
+ nov: "Nov",
260
+ dec: "Dec"
261
+ }
262
+ },
263
+ inputNumber: {
264
+ decrease: "decrease number",
265
+ increase: "increase number"
266
+ },
267
+ select: {
268
+ loading: "Loading",
269
+ noMatch: "No matching data",
270
+ noData: "No data",
271
+ placeholder: "Select"
272
+ },
273
+ mention: { loading: "Loading" },
274
+ dropdown: { toggleDropdown: "Toggle Dropdown" },
275
+ cascader: {
276
+ noMatch: "No matching data",
277
+ loading: "Loading",
278
+ placeholder: "Select",
279
+ noData: "No data"
280
+ },
281
+ pagination: {
282
+ goto: "Go to",
283
+ pagesize: "/page",
284
+ total: "Total {total}",
285
+ pageClassifier: "",
286
+ page: "Page",
287
+ prev: "Go to previous page",
288
+ next: "Go to next page",
289
+ currentPage: "page {pager}",
290
+ prevPages: "Previous {pager} pages",
291
+ nextPages: "Next {pager} pages",
292
+ deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details"
293
+ },
294
+ dialog: { close: "Close this dialog" },
295
+ drawer: { close: "Close this dialog" },
296
+ messagebox: {
297
+ title: "Message",
298
+ confirm: "OK",
299
+ cancel: "Cancel",
300
+ error: "Illegal input",
301
+ close: "Close this dialog"
302
+ },
303
+ upload: {
304
+ deleteTip: "press delete to remove",
305
+ delete: "Delete",
306
+ preview: "Preview",
307
+ continue: "Continue"
308
+ },
309
+ slider: {
310
+ defaultLabel: "slider between {min} and {max}",
311
+ defaultRangeStartLabel: "pick start value",
312
+ defaultRangeEndLabel: "pick end value"
313
+ },
314
+ table: {
315
+ emptyText: "No Data",
316
+ confirmFilter: "Confirm",
317
+ resetFilter: "Reset",
318
+ clearFilter: "All",
319
+ sumText: "Sum",
320
+ selectAllLabel: "Select all rows",
321
+ selectRowLabel: "Select this row",
322
+ expandRowLabel: "Expand this row",
323
+ collapseRowLabel: "Collapse this row",
324
+ sortLabel: "Sort by {column}",
325
+ filterLabel: "Filter by {column}"
326
+ },
327
+ tag: { close: "Close this tag" },
328
+ tour: {
329
+ next: "Next",
330
+ previous: "Previous",
331
+ finish: "Finish",
332
+ close: "Close this dialog"
333
+ },
334
+ tree: { emptyText: "No Data" },
335
+ transfer: {
336
+ noMatch: "No matching data",
337
+ noData: "No data",
338
+ titles: ["List 1", "List 2"],
339
+ filterPlaceholder: "Enter keyword",
340
+ noCheckedFormat: "{total} items",
341
+ hasCheckedFormat: "{checked}/{total} checked"
342
+ },
343
+ image: { error: "FAILED" },
344
+ pageHeader: { title: "Back" },
345
+ popconfirm: {
346
+ confirmButtonText: "Yes",
347
+ cancelButtonText: "No"
348
+ },
349
+ carousel: {
350
+ leftArrow: "Carousel arrow left",
351
+ rightArrow: "Carousel arrow right",
352
+ indicator: "Carousel switch to index {index}"
353
+ }
354
+ }
355
+ };
356
+ const a = {
357
+ zhCn: "zh-cn",
358
+ en: "en"
359
+ }, g = {
360
+ [a.zhCn]: s,
361
+ [a.en]: d
362
+ }, h = (e = !1) => e || (navigator?.language || navigator?.userLanguage)?.startsWith("zh") ? a.zhCn : a.en;
363
+ let o = null, n = null;
364
+ const L = (e = {}, t = !1) => {
365
+ o = h(t);
366
+ const r = i({
367
+ legacy: !1,
368
+ locale: o,
369
+ fallbackLocale: a.zhCn,
370
+ messages: e,
371
+ globalInjection: !0
372
+ });
373
+ return p(r, !t), n = r, r;
374
+ }, C = (e, t) => {
375
+ if (n && n.global)
376
+ try {
377
+ return n.global.t(e, t);
378
+ } catch (r) {
379
+ return console.warn("i18n t error:", r), e;
380
+ }
381
+ return e;
382
+ }, T = () => g[o] || s, v = () => ({
383
+ [a.zhCn]: "zh_cn",
384
+ [a.en]: "en_us"
385
+ })[o], x = () => ({
386
+ [a.zhCn]: "zh-CN",
387
+ [a.en]: "en-US"
388
+ })[o], y = () => ({
389
+ [a.zhCn]: "zh",
390
+ [a.en]: a.en
391
+ })[o], D = (e) => (t, r = {}) => e.global.t(t, r), c = (e) => () => {
392
+ setTimeout(async () => {
393
+ try {
394
+ l.close();
395
+ } catch {
396
+ }
397
+ l.confirm(
398
+ e.global.t("LANGUAGE_CHANGE.CONTENT"),
399
+ e.global.t("LANGUAGE_CHANGE.TITLE"),
400
+ {
401
+ confirmButtonText: e.global.t("LANGUAGE_CHANGE.CONFIRM"),
402
+ cancelButtonText: e.global.t("LANGUAGE_CHANGE.CANCEL"),
403
+ type: "warning",
404
+ dangerouslyUseHTMLString: !0,
405
+ customClass: "language-change-confirm"
406
+ }
407
+ ).then(() => {
408
+ window.location.reload();
409
+ });
410
+ }, 0);
411
+ }, p = (e, t = !0) => {
412
+ if (!t)
413
+ return;
414
+ const r = c(e);
415
+ window.addEventListener("languagechange", r);
416
+ }, N = (e) => {
417
+ if (!e)
418
+ return;
419
+ const t = c(e);
420
+ window.removeEventListener("languagechange", t);
421
+ }, m = () => {
422
+ const { t: e } = u();
423
+ return { t: e };
424
+ }, k = (e, t) => {
425
+ const { t: r } = m();
426
+ return r(e, t);
427
+ };
428
+ export {
429
+ g as a,
430
+ h as b,
431
+ L as c,
432
+ T as d,
433
+ v as e,
434
+ x as f,
435
+ k as g,
436
+ y as h,
437
+ D as i,
438
+ N as j,
439
+ a as l,
440
+ p as s,
441
+ C as t,
442
+ m as u
443
+ };
@@ -0,0 +1,172 @@
1
+ import { ref as w, shallowRef as O, watch as B, onMounted as k, createElementBlock as A, openBlock as m, normalizeClass as N, createBlock as I, createCommentVNode as M, createVNode as u, unref as s, withCtx as y } from "vue";
2
+ import { ElMessage as g, ElIcon as P, ElScrollbar as b } from "element-plus";
3
+ import { Codemirror as L } from "vue-codemirror";
4
+ import { EditorView as h } from "@codemirror/view";
5
+ import { json as x } from "@codemirror/lang-json";
6
+ import { oneDark as V } from "@codemirror/theme-one-dark";
7
+ import { codeFolding as _ } from "@codemirror/language";
8
+ import { IconCopy1 as R } from "color-message-aibox-vue";
9
+ import { u as T } from "./i18n.k9Q_HVMs.js";
10
+ import F from "copy-to-clipboard";
11
+ import { _ as j } from "./_plugin-vue_export-helper.CHgC5LLL.js";
12
+ import '../assets/index.css';const D = () => {
13
+ const { t: a } = T();
14
+ return {
15
+ copyText: (l) => {
16
+ F(l) ? g({
17
+ message: a("MESSAGE_REMIND.COPY_SUCCESS"),
18
+ type: "success"
19
+ }) : g({
20
+ message: a("COMMON_STORE_LIBRARY.LABEL_COPY_FAIL"),
21
+ type: "error"
22
+ });
23
+ }
24
+ };
25
+ }, J = {
26
+ __name: "index",
27
+ props: {
28
+ code: {
29
+ type: String,
30
+ default: ""
31
+ },
32
+ language: {
33
+ type: String,
34
+ default: "json"
35
+ },
36
+ customExpandDepth: {
37
+ type: Number,
38
+ default: 1 / 0
39
+ },
40
+ sort: {
41
+ type: Boolean,
42
+ default: !0
43
+ },
44
+ noPadding: {
45
+ type: Boolean,
46
+ default: !1
47
+ },
48
+ theme: {
49
+ type: String,
50
+ default: "light"
51
+ },
52
+ showLength: {
53
+ type: Boolean,
54
+ default: !1
55
+ },
56
+ maxHeight: {
57
+ type: String,
58
+ default: "calc(100% - 125px)"
59
+ },
60
+ showCopy: {
61
+ type: Boolean,
62
+ default: !1
63
+ },
64
+ // 是否自定义折叠
65
+ enableFolding: {
66
+ type: Boolean,
67
+ default: !1
68
+ }
69
+ },
70
+ setup(a) {
71
+ const { copyText: d } = D(), l = a, i = w(""), p = {
72
+ json: () => x()
73
+ }, C = () => {
74
+ const r = l.language.toLowerCase();
75
+ return p[r] ? p[r]() : x();
76
+ }, f = O([]), E = (r) => {
77
+ const t = r.trim(), n = (o) => {
78
+ try {
79
+ return JSON.parse(o);
80
+ } catch {
81
+ return null;
82
+ }
83
+ };
84
+ let e = null;
85
+ if ((t.startsWith("{") || t.startsWith("[")) && (e = n(t)), !e) {
86
+ const o = `{${t.replace(/,\s*$/, "")}}`;
87
+ e = n(o);
88
+ }
89
+ if (e && typeof e == "object" && !Array.isArray(e)) {
90
+ const o = e.role;
91
+ if (o) return "role: " + o;
92
+ }
93
+ return "";
94
+ }, S = () => {
95
+ const r = [
96
+ C(),
97
+ h.editable.of(!1),
98
+ // 只读模式
99
+ h.lineWrapping
100
+ // 自动换行
101
+ ];
102
+ l.enableFolding && r.push(
103
+ // 配置代码折叠,自定义折叠后的显示内容
104
+ _({
105
+ preparePlaceholder: (t, n) => {
106
+ try {
107
+ const e = t.doc.sliceString(n.from, n.to);
108
+ return E(e);
109
+ } catch (e) {
110
+ return console.error("Error getting fold preview:", e), "...";
111
+ }
112
+ },
113
+ placeholderDOM: (t, n, e) => {
114
+ const o = document.createElement("span");
115
+ return o.className = "cm-foldPlaceholder", o.onclick = n, o.style.cursor = "pointer", o.style.color = "#888", o.style.padding = "0 4px", o.style.borderRadius = "3px", o.textContent = e ? `${e}...` : "...", o;
116
+ }
117
+ })
118
+ ), l.theme === "dark" && r.push(V), f.value = r;
119
+ }, v = (r) => {
120
+ try {
121
+ const t = JSON.parse(r);
122
+ if (l.sort && typeof t == "object" && t !== null) {
123
+ const n = (e) => Array.isArray(e) ? e.map(n) : typeof e == "object" && e !== null ? Object.keys(e).sort().reduce((o, c) => (o[c] = n(e[c]), o), {}) : e;
124
+ return JSON.stringify(n(t), null, 2);
125
+ }
126
+ return JSON.stringify(t, null, 2);
127
+ } catch {
128
+ return r;
129
+ }
130
+ };
131
+ return B(
132
+ () => l.code,
133
+ (r) => {
134
+ l.language === "json" ? i.value = v(r) : i.value = r;
135
+ },
136
+ { immediate: !0 }
137
+ ), k(() => {
138
+ S();
139
+ }), (r, t) => (m(), A("div", {
140
+ class: N(["code-viewer", { "no-padding": a.noPadding, dark: a.theme === "dark" }])
141
+ }, [
142
+ a.showCopy ? (m(), I(s(P), {
143
+ key: 0,
144
+ onClick: t[0] || (t[0] = (n) => s(d)(a.code)),
145
+ class: "code-viewer__copy",
146
+ color: "#96A0AB",
147
+ size: "18px"
148
+ }, {
149
+ default: y(() => [
150
+ u(s(R))
151
+ ]),
152
+ _: 1
153
+ })) : M("", !0),
154
+ u(s(b), { "max-height": a.maxHeight }, {
155
+ default: y(() => [
156
+ u(s(L), {
157
+ modelValue: i.value,
158
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => i.value = n),
159
+ style: { height: "100%", minHeight: "100px" },
160
+ extensions: f.value,
161
+ disabled: !0
162
+ }, null, 8, ["modelValue", "extensions"])
163
+ ]),
164
+ _: 1
165
+ }, 8, ["max-height"])
166
+ ], 2));
167
+ }
168
+ }, Z = /* @__PURE__ */ j(J, [["__scopeId", "data-v-011cdc70"]]);
169
+ export {
170
+ Z as C,
171
+ D as u
172
+ };