@tmagic/tdesign-vue-next-adapter 1.6.1 → 1.7.0-beta.1

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.
@@ -1,7 +1,71 @@
1
- import { defineComponent, computed, createBlock, openBlock, unref, createElementBlock, renderSlot, createSlots, withCtx, createElementVNode, h } from 'vue';
2
- import { DateRangePicker, DatePicker, Textarea, Input, Upload, Tooltip, TimePicker, Tag, Tabs, TabPanel, Table, Switch, Steps, StepItem, Select, Row, RadioGroup, RadioButton, Radio, Pagination, OptionGroup, Option, InputNumber, FormItem, Form, Dropdown, DropdownItem, Drawer, Divider, Dialog, ColorPicker, CollapsePanel, Collapse, Col, CheckboxGroup, Checkbox, Cascader, Card, Button, Badge, MessagePlugin, DialogPlugin } from 'tdesign-vue-next';
1
+ import { defineComponent, ref, watch, createBlock, openBlock, unref, createSlots, withCtx, renderSlot, computed, createElementBlock, useTemplateRef, createVNode, createElementVNode, h } from 'vue';
2
+ import { Checkbox, DateRangePicker, DatePicker, Dialog, Textarea, InputAdornment, Input, Popconfirm, Radio, RadioButton, Table, Tabs, LoadingDirective, Upload, Tooltip, TimePicker, Tag, TabPanel, Switch, Steps, StepItem, Select, Row, RadioGroup, Pagination, OptionGroup, Option, InputNumber, FormItem, Form, Dropdown, DropdownItem, Drawer, Divider, ColorPicker, CollapsePanel, Collapse, Col, CheckboxGroup, Cascader, Card, Button, Badge, MessagePlugin, DialogPlugin } from 'tdesign-vue-next';
3
3
 
4
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
4
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
5
+ ...{
6
+ name: "TTDesignAdapterCheckbox"
7
+ },
8
+ __name: "Checkbox",
9
+ props: {
10
+ modelValue: { type: [String, Number, Boolean] },
11
+ value: { type: [String, Number, Boolean] },
12
+ label: {},
13
+ trueValue: {},
14
+ falseValue: {},
15
+ disabled: { type: Boolean },
16
+ size: {}
17
+ },
18
+ emits: ["change", "update:modelValue"],
19
+ setup(__props, { emit: __emit }) {
20
+ const props = __props;
21
+ const emit = __emit;
22
+ const checked = ref(false);
23
+ watch(
24
+ () => props.modelValue,
25
+ (v) => {
26
+ if (typeof props.trueValue !== "undefined") {
27
+ checked.value = v === props.trueValue;
28
+ } else if (typeof props.falseValue !== "undefined") {
29
+ checked.value = v !== props.falseValue;
30
+ } else {
31
+ checked.value = Boolean(v);
32
+ }
33
+ },
34
+ {
35
+ immediate: true
36
+ }
37
+ );
38
+ const changeHandler = (v) => {
39
+ updateModelValue(v);
40
+ emit("change", v ? props.trueValue ?? true : props.falseValue ?? false);
41
+ };
42
+ const updateModelValue = (v) => {
43
+ emit("update:modelValue", v ? props.trueValue ?? true : props.falseValue ?? false);
44
+ };
45
+ return (_ctx, _cache) => {
46
+ return openBlock(), createBlock(unref(Checkbox), {
47
+ modelValue: checked.value,
48
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => checked.value = $event),
49
+ disabled: __props.disabled,
50
+ value: __props.value,
51
+ onChange: changeHandler
52
+ }, createSlots({
53
+ _: 2
54
+ /* DYNAMIC */
55
+ }, [
56
+ _ctx.$slots.default ? {
57
+ name: "default",
58
+ fn: withCtx(() => [
59
+ renderSlot(_ctx.$slots, "default")
60
+ ]),
61
+ key: "0"
62
+ } : void 0
63
+ ]), 1032, ["modelValue", "disabled", "value"]);
64
+ };
65
+ }
66
+ });
67
+
68
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
5
69
  __name: "DatePicker",
6
70
  props: {
7
71
  type: { default: "date" },
@@ -31,6 +95,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
31
95
  };
32
96
  return map[props.type] || props.type;
33
97
  });
98
+ const valueType = computed(() => props.valueFormat === "s" ? "time-stamp" : props.valueFormat.replace(/\//g, "-"));
34
99
  const emit = __emit;
35
100
  const changeHandler = (v) => {
36
101
  emit("change", v);
@@ -48,7 +113,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
48
113
  size: __props.size === "default" ? "medium" : __props.size,
49
114
  separator: __props.rangeSeparator,
50
115
  format: __props.format,
51
- valueType: __props.valueFormat === "s" ? "time-stamp" : __props.valueFormat,
116
+ valueType: valueType.value,
52
117
  onChange: changeHandler,
53
118
  "onUpdate:modelValue": updateModelValue
54
119
  }, null, 8, ["modelValue", "mode", "placeholder", "disabled", "size", "separator", "format", "valueType"])) : (openBlock(), createBlock(unref(DatePicker), {
@@ -60,7 +125,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
60
125
  size: __props.size === "default" ? "medium" : __props.size,
61
126
  format: __props.format,
62
127
  enableTimePicker: __props.type.includes("time"),
63
- valueType: __props.valueFormat === "s" ? "time-stamp" : __props.valueFormat,
128
+ valueType: valueType.value,
64
129
  onChange: changeHandler,
65
130
  "onUpdate:modelValue": updateModelValue
66
131
  }, null, 8, ["modelValue", "mode", "placeholder", "disabled", "size", "format", "enableTimePicker", "valueType"]));
@@ -68,24 +133,77 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
68
133
  }
69
134
  });
70
135
 
71
- const _export_sfc = (sfc, props) => {
72
- const target = sfc.__vccOpts || sfc;
73
- for (const [key, val] of props) {
74
- target[key] = val;
136
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
137
+ ...{
138
+ name: "TTDesignAdapterDialog"
139
+ },
140
+ __name: "Dialog",
141
+ props: {
142
+ modelValue: { type: Boolean },
143
+ appendToBody: { type: Boolean },
144
+ beforeClose: {},
145
+ title: {},
146
+ width: {},
147
+ fullscreen: { type: Boolean },
148
+ closeOnClickModal: { type: Boolean },
149
+ closeOnPressEscape: { type: Boolean },
150
+ destroyOnClose: { type: Boolean }
151
+ },
152
+ emits: ["close", "update:modelValue"],
153
+ setup(__props, { emit: __emit }) {
154
+ const emit = __emit;
155
+ const closeHandler = (...args) => {
156
+ emit("close", ...args);
157
+ };
158
+ const updateModelValue = (v) => {
159
+ emit("update:modelValue", v);
160
+ };
161
+ return (_ctx, _cache) => {
162
+ return openBlock(), createBlock(unref(Dialog), {
163
+ visible: __props.modelValue,
164
+ attach: __props.appendToBody ? "body" : void 0,
165
+ header: __props.title,
166
+ width: __props.width,
167
+ mode: __props.fullscreen ? "full-screen" : "modal",
168
+ "close-on-overlay-click": __props.closeOnClickModal,
169
+ "close-on-esc-keydown": __props.closeOnPressEscape,
170
+ "destroy-on-close": __props.destroyOnClose,
171
+ onBeforeOpen: __props.beforeClose,
172
+ onClose: closeHandler,
173
+ "onUpdate:visible": updateModelValue
174
+ }, {
175
+ footer: withCtx(() => [
176
+ renderSlot(_ctx.$slots, "footer")
177
+ ]),
178
+ default: withCtx(() => [
179
+ renderSlot(_ctx.$slots, "default")
180
+ ]),
181
+ _: 3
182
+ /* FORWARDED */
183
+ }, 8, ["visible", "attach", "header", "width", "mode", "close-on-overlay-click", "close-on-esc-keydown", "destroy-on-close", "onBeforeOpen"]);
184
+ };
75
185
  }
76
- return target;
77
- };
78
-
79
- const _sfc_main$3 = { };
186
+ });
80
187
 
81
- function _sfc_render$2(_ctx, _cache) {
82
- return (openBlock(), createElementBlock("i", null, [
83
- renderSlot(_ctx.$slots, "default")
84
- ]))
85
- }
86
- const Icon = /*#__PURE__*/_export_sfc(_sfc_main$3, [['render',_sfc_render$2]]);
188
+ const _hoisted_1$1 = { class: "t-t-design-adapter-icon t-icon" };
189
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
190
+ ...{
191
+ name: "TTDesignAdapterIcon"
192
+ },
193
+ __name: "Icon",
194
+ setup(__props) {
195
+ return (_ctx, _cache) => {
196
+ return openBlock(), createElementBlock("i", _hoisted_1$1, [
197
+ renderSlot(_ctx.$slots, "default")
198
+ ]);
199
+ };
200
+ }
201
+ });
87
202
 
88
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
203
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
204
+ ...{
205
+ name: "TTDesignAdapterInput"
206
+ },
89
207
  __name: "Input",
90
208
  props: {
91
209
  modelValue: {},
@@ -96,61 +214,231 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
96
214
  type: {},
97
215
  size: {}
98
216
  },
99
- emits: ["change", "input", "update:modelValue"],
217
+ emits: ["change", "input", "blur", "focus", "update:modelValue"],
100
218
  setup(__props, { emit: __emit }) {
219
+ const props = __props;
101
220
  const emit = __emit;
221
+ const textareaRef = useTemplateRef("textarea");
222
+ watch(
223
+ [textareaRef, () => props.rows],
224
+ ([val, rows]) => {
225
+ if (val && rows) {
226
+ const el = val.$el.querySelector("textarea");
227
+ if (el) {
228
+ el.rows = rows;
229
+ }
230
+ }
231
+ },
232
+ { immediate: true }
233
+ );
102
234
  const changeHandler = (...args) => {
103
235
  emit("change", ...args);
104
236
  };
105
237
  const inputHandler = (...args) => {
106
238
  emit("input", ...args);
107
239
  };
240
+ const blurHandler = (...args) => {
241
+ emit("blur", ...args);
242
+ };
243
+ const focusHandler = (...args) => {
244
+ emit("focus", ...args);
245
+ };
108
246
  const updateModelValue = (...args) => {
109
247
  emit("update:modelValue", ...args);
110
248
  };
111
249
  return (_ctx, _cache) => {
112
250
  return __props.type === "textarea" ? (openBlock(), createBlock(unref(Textarea), {
113
251
  key: 0,
252
+ ref: "textarea",
114
253
  modelValue: __props.modelValue,
115
254
  size: __props.size === "default" ? "medium" : __props.size,
116
255
  disabled: __props.disabled,
117
256
  placeholder: __props.placeholder,
118
- onKeypress: inputHandler,
119
- onChange: changeHandler
120
- }, null, 8, ["modelValue", "size", "disabled", "placeholder"])) : (openBlock(), createBlock(unref(Input), {
121
- key: 1,
122
- modelValue: __props.modelValue,
123
- size: __props.size === "default" ? "medium" : __props.size,
124
- clearable: __props.clearable,
125
- disabled: __props.disabled,
126
- placeholder: __props.placeholder,
257
+ rows: __props.rows,
127
258
  onKeypress: inputHandler,
128
259
  onChange: changeHandler,
260
+ onBlur: blurHandler,
261
+ onFocus: focusHandler,
129
262
  "onUpdate:modelValue": updateModelValue
263
+ }, null, 8, ["modelValue", "size", "disabled", "placeholder", "rows"])) : (openBlock(), createBlock(
264
+ unref(InputAdornment),
265
+ { key: 1 },
266
+ createSlots({
267
+ default: withCtx(() => [
268
+ createVNode(unref(Input), {
269
+ modelValue: __props.modelValue,
270
+ size: __props.size === "default" ? "medium" : __props.size,
271
+ clearable: __props.clearable,
272
+ disabled: __props.disabled,
273
+ placeholder: __props.placeholder,
274
+ onKeypress: inputHandler,
275
+ onChange: changeHandler,
276
+ onBlur: blurHandler,
277
+ onFocus: focusHandler,
278
+ "onUpdate:modelValue": updateModelValue
279
+ }, createSlots({
280
+ _: 2
281
+ /* DYNAMIC */
282
+ }, [
283
+ _ctx.$slots.prefix ? {
284
+ name: "prefix-icon",
285
+ fn: withCtx(() => [
286
+ renderSlot(_ctx.$slots, "prefix")
287
+ ]),
288
+ key: "0"
289
+ } : void 0,
290
+ _ctx.$slots.suffix ? {
291
+ name: "suffix",
292
+ fn: withCtx(() => [
293
+ renderSlot(_ctx.$slots, "suffix")
294
+ ]),
295
+ key: "1"
296
+ } : void 0
297
+ ]), 1032, ["modelValue", "size", "clearable", "disabled", "placeholder"])
298
+ ]),
299
+ _: 2
300
+ /* DYNAMIC */
301
+ }, [
302
+ _ctx.$slots.prepend ? {
303
+ name: "prepend",
304
+ fn: withCtx(() => [
305
+ renderSlot(_ctx.$slots, "prepend")
306
+ ]),
307
+ key: "0"
308
+ } : void 0,
309
+ _ctx.$slots.append ? {
310
+ name: "append",
311
+ fn: withCtx(() => [
312
+ renderSlot(_ctx.$slots, "append")
313
+ ]),
314
+ key: "1"
315
+ } : void 0
316
+ ]),
317
+ 1024
318
+ /* DYNAMIC_SLOTS */
319
+ ));
320
+ };
321
+ }
322
+ });
323
+
324
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
325
+ ...{
326
+ name: "TTDesignAdapterPopconfirm"
327
+ },
328
+ __name: "Popconfirm",
329
+ props: {
330
+ title: {},
331
+ placement: {}
332
+ },
333
+ emits: ["confirm", "cancel"],
334
+ setup(__props, { emit: __emit }) {
335
+ const emit = __emit;
336
+ const confirmHandler = (...args) => {
337
+ emit("confirm", ...args);
338
+ };
339
+ const cancelHandler = (...args) => {
340
+ emit("cancel", ...args);
341
+ };
342
+ return (_ctx, _cache) => {
343
+ return openBlock(), createBlock(unref(Popconfirm), {
344
+ content: __props.title,
345
+ placement: __props.placement,
346
+ onConfirm: confirmHandler,
347
+ onCancel: cancelHandler
348
+ }, {
349
+ default: withCtx(() => [
350
+ renderSlot(_ctx.$slots, "reference")
351
+ ]),
352
+ _: 3
353
+ /* FORWARDED */
354
+ }, 8, ["content", "placement"]);
355
+ };
356
+ }
357
+ });
358
+
359
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
360
+ ...{
361
+ name: "TTDesignAdapterRadio"
362
+ },
363
+ __name: "Radio",
364
+ props: {
365
+ modelValue: { type: [String, Number, Boolean] },
366
+ value: { type: [String, Number, Boolean] },
367
+ label: { type: [String, Number, Boolean] }
368
+ },
369
+ emits: ["click"],
370
+ setup(__props, { emit: __emit }) {
371
+ const emit = __emit;
372
+ const clickHandler = () => {
373
+ emit("click");
374
+ };
375
+ return (_ctx, _cache) => {
376
+ return openBlock(), createBlock(unref(Radio), {
377
+ value: __props.value,
378
+ onClick: clickHandler
130
379
  }, createSlots({
131
380
  _: 2
132
381
  /* DYNAMIC */
133
382
  }, [
134
- _ctx.$slots.prefix ? {
135
- name: "prefix-icon",
383
+ _ctx.$slots.default ? {
384
+ name: "default",
136
385
  fn: withCtx(() => [
137
- renderSlot(_ctx.$slots, "prefix")
386
+ renderSlot(_ctx.$slots, "default")
138
387
  ]),
139
388
  key: "0"
140
- } : void 0,
141
- _ctx.$slots.suffix ? {
142
- name: "suffix",
389
+ } : void 0
390
+ ]), 1032, ["value"]);
391
+ };
392
+ }
393
+ });
394
+
395
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
396
+ ...{
397
+ name: "TTDesignAdapterRadioButton"
398
+ },
399
+ __name: "RadioButton",
400
+ props: {
401
+ value: { type: [String, Number, Boolean] },
402
+ label: { type: [String, Number, Boolean] },
403
+ disabled: { type: Boolean },
404
+ name: {}
405
+ },
406
+ emits: ["click"],
407
+ setup(__props, { emit: __emit }) {
408
+ const emit = __emit;
409
+ const clickHandler = () => {
410
+ emit("click");
411
+ };
412
+ return (_ctx, _cache) => {
413
+ return openBlock(), createBlock(unref(RadioButton), {
414
+ value: __props.value,
415
+ disabled: __props.disabled,
416
+ onClick: clickHandler
417
+ }, createSlots({
418
+ _: 2
419
+ /* DYNAMIC */
420
+ }, [
421
+ _ctx.$slots.default ? {
422
+ name: "default",
143
423
  fn: withCtx(() => [
144
- renderSlot(_ctx.$slots, "suffix")
424
+ renderSlot(_ctx.$slots, "default")
145
425
  ]),
146
- key: "1"
426
+ key: "0"
147
427
  } : void 0
148
- ]), 1032, ["modelValue", "size", "clearable", "disabled", "placeholder"]));
428
+ ]), 1032, ["value", "disabled"]);
149
429
  };
150
430
  }
151
431
  });
152
432
 
153
- const _sfc_main$1 = { };
433
+ const _export_sfc = (sfc, props) => {
434
+ const target = sfc.__vccOpts || sfc;
435
+ for (const [key, val] of props) {
436
+ target[key] = val;
437
+ }
438
+ return target;
439
+ };
440
+
441
+ const _sfc_main$2 = { };
154
442
 
155
443
  const _hoisted_1 = {
156
444
  class: "tdesign-scrollbar",
@@ -162,7 +450,7 @@ const _hoisted_2 = {
162
450
  };
163
451
  const _hoisted_3 = { class: "tdesign-scrollbar-view" };
164
452
 
165
- function _sfc_render$1(_ctx, _cache) {
453
+ function _sfc_render(_ctx, _cache) {
166
454
  return (openBlock(), createElementBlock("div", _hoisted_1, [
167
455
  createElementVNode("div", _hoisted_2, [
168
456
  createElementVNode("div", _hoisted_3, [
@@ -171,26 +459,207 @@ function _sfc_render$1(_ctx, _cache) {
171
459
  ])
172
460
  ]))
173
461
  }
174
- const Scrollbar = /*#__PURE__*/_export_sfc(_sfc_main$1, [['render',_sfc_render$1]]);
462
+ const Scrollbar = /*#__PURE__*/_export_sfc(_sfc_main$2, [['render',_sfc_render]]);
175
463
 
176
- const _sfc_main = { };
464
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
465
+ ...{
466
+ name: "TTDesignAdapterTable"
467
+ },
468
+ __name: "Table",
469
+ props: {
470
+ columns: {},
471
+ data: {},
472
+ border: { type: Boolean },
473
+ maxHeight: {},
474
+ defaultExpandAll: { type: Boolean },
475
+ showHeader: { type: Boolean },
476
+ rowKey: {},
477
+ treeProps: {},
478
+ emptyText: {},
479
+ tooltipEffect: {},
480
+ tooltipOptions: {},
481
+ showOverflowTooltip: { type: Boolean },
482
+ spanMethod: { type: Function }
483
+ },
484
+ emits: ["sort-change", "select", "select-all", "selection-change", "expand-change", "cell-click"],
485
+ setup(__props, { expose: __expose, emit: __emit }) {
486
+ const emit = __emit;
487
+ const props = __props;
488
+ const tableRef = useTemplateRef("table");
489
+ const tableColumns = computed(() => {
490
+ if (!props.columns) return [];
491
+ const columns = [];
492
+ for (const item of props.columns) {
493
+ if (item.props.type === "expand") {
494
+ continue;
495
+ }
496
+ let colKey = item.props?.prop || item.props?.type;
497
+ if (!colKey) {
498
+ colKey = "tmagic_table_operation";
499
+ }
500
+ const column = {
501
+ thClassName: item.props?.class,
502
+ colKey,
503
+ title: item.props?.label,
504
+ width: item.props?.width,
505
+ fixed: item.props?.fixed === true ? "left" : item.props?.fixed || void 0,
506
+ ellipsis: props.showOverflowTooltip,
507
+ sorter: item.props?.sortable,
508
+ align: item.props?.align
509
+ };
510
+ if (item.cell) {
511
+ column.cell = (h, { row, rowIndex }) => {
512
+ return item.cell?.({ row, $index: rowIndex });
513
+ };
514
+ }
515
+ columns.push(column);
516
+ }
517
+ return columns;
518
+ });
519
+ const sortChange = (data) => {
520
+ emit("sort-change", data);
521
+ };
522
+ const selectHandler = (selectedRowKeys, options) => {
523
+ const { selectedRowData, type } = options;
524
+ if (type === "check") {
525
+ emit("select", selectedRowData);
526
+ } else if (type === "uncheck") {
527
+ emit("select", selectedRowData);
528
+ }
529
+ emit("selection-change", selectedRowData);
530
+ };
531
+ const cellClickHandler = (context) => {
532
+ const { row, col, e } = context;
533
+ emit("cell-click", row, col, void 0, e);
534
+ };
535
+ const expandChange = (expandedRowKeys, options) => {
536
+ emit("expand-change", options.expandedRowData, options.currentRowData);
537
+ };
538
+ const toggleRowSelection = (_row, _selected) => {
539
+ console.warn("toggleRowSelection needs to be implemented based on TDesign API");
540
+ };
541
+ const toggleRowExpansion = (_row, _expanded) => {
542
+ console.warn("toggleRowExpansion needs to be implemented based on TDesign API");
543
+ };
544
+ const clearSelection = () => {
545
+ console.warn("clearSelection needs to be implemented based on TDesign API");
546
+ };
547
+ __expose({
548
+ getEl: () => tableRef.value?.$el,
549
+ getTableRef: () => tableRef.value,
550
+ clearSelection,
551
+ toggleRowSelection,
552
+ toggleRowExpansion
553
+ });
554
+ return (_ctx, _cache) => {
555
+ return openBlock(), createBlock(unref(Table), {
556
+ ref: "table",
557
+ data: __props.data,
558
+ bordered: __props.border,
559
+ "max-height": __props.maxHeight,
560
+ "default-expand-all": __props.defaultExpandAll,
561
+ "show-header": __props.showHeader,
562
+ "row-key": __props.rowKey,
563
+ tree: __props.treeProps,
564
+ empty: __props.emptyText,
565
+ columns: tableColumns.value,
566
+ onSortChange: sortChange,
567
+ onSelectChange: selectHandler,
568
+ onCellClick: cellClickHandler,
569
+ onExpandChange: expandChange
570
+ }, null, 8, ["data", "bordered", "max-height", "default-expand-all", "show-header", "row-key", "tree", "empty", "columns"]);
571
+ };
572
+ }
573
+ });
177
574
 
178
- function _sfc_render(_ctx, _cache) {
179
- return (openBlock(), createElementBlock("div"))
180
- }
181
- const TableColumn = /*#__PURE__*/_export_sfc(_sfc_main, [['render',_sfc_render]]);
575
+ const _sfc_main = /* @__PURE__ */ defineComponent({
576
+ ...{
577
+ name: "TTDesignAdapterTabs"
578
+ },
579
+ __name: "Tabs",
580
+ props: {
581
+ type: {},
582
+ editable: { type: Boolean },
583
+ tabPosition: {},
584
+ modelValue: {}
585
+ },
586
+ emits: ["tab-click", "tab-add", "tab-remove", "update:model-value"],
587
+ setup(__props, { emit: __emit }) {
588
+ const emit = __emit;
589
+ const tabClickHandler = (...args) => {
590
+ emit("tab-click", ...args);
591
+ };
592
+ const onTabAdd = (...args) => {
593
+ emit("tab-add", ...args);
594
+ };
595
+ const onTabRemove = (...args) => {
596
+ emit("tab-remove", ...args);
597
+ };
598
+ const updateModelName = (...args) => {
599
+ emit("update:model-value", ...args);
600
+ };
601
+ return (_ctx, _cache) => {
602
+ return openBlock(), createBlock(unref(Tabs), {
603
+ "model-value": __props.modelValue,
604
+ addable: __props.editable,
605
+ theme: __props.type === "card" ? "card" : "normal",
606
+ placement: __props.tabPosition,
607
+ onAdd: onTabAdd,
608
+ onChange: tabClickHandler,
609
+ onRemove: onTabRemove,
610
+ "onUpdate:modelValue": updateModelName
611
+ }, createSlots({
612
+ default: withCtx(() => [
613
+ renderSlot(_ctx.$slots, "default")
614
+ ]),
615
+ _: 2
616
+ /* DYNAMIC */
617
+ }, [
618
+ _ctx.$slots["add-icon"] ? {
619
+ name: "action",
620
+ fn: withCtx(() => [
621
+ renderSlot(_ctx.$slots, "add-icon")
622
+ ]),
623
+ key: "0"
624
+ } : void 0
625
+ ]), 1032, ["model-value", "addable", "theme", "placement"]);
626
+ };
627
+ }
628
+ });
182
629
 
183
630
  const adapter = {
184
631
  message: MessagePlugin,
185
632
  messageBox: {
186
- alert: (msg) => {
187
- DialogPlugin.alert({
188
- body: msg
633
+ alert: (msg, title) => {
634
+ return new Promise((resolve, reject) => {
635
+ const dia = DialogPlugin.alert({
636
+ header: title,
637
+ body: msg,
638
+ onConfirm: (e) => {
639
+ dia.hide();
640
+ resolve(e);
641
+ },
642
+ onClose: (e) => {
643
+ dia.hide();
644
+ reject(e);
645
+ }
646
+ });
189
647
  });
190
648
  },
191
- confirm: (msg) => {
192
- DialogPlugin.confirm({
193
- body: msg
649
+ confirm: (msg, title) => {
650
+ return new Promise((resolve, reject) => {
651
+ const dia = DialogPlugin.confirm({
652
+ header: title,
653
+ body: msg,
654
+ onConfirm: (e) => {
655
+ dia.hide();
656
+ resolve(e);
657
+ },
658
+ onClose: (e) => {
659
+ dia.hide();
660
+ reject(e);
661
+ }
662
+ });
194
663
  });
195
664
  },
196
665
  close: (msg) => {
@@ -211,8 +680,8 @@ const adapter = {
211
680
  props: (props) => ({
212
681
  theme: props.type,
213
682
  size: props.size === "default" ? "medium" : props.size,
214
- icon: () => props.icon ? h(props.icon) : null,
215
- variant: props.link || props.text ? "text" : "base",
683
+ icon: props.icon ? () => h(_sfc_main$7, null, { default: () => h(props.icon) }) : void 0,
684
+ variant: props.link || props.text ? "text" : props.variant || "base",
216
685
  shape: props.circle ? "circle" : "rectangle"
217
686
  })
218
687
  },
@@ -221,7 +690,9 @@ const adapter = {
221
690
  props: (props) => ({
222
691
  shadow: props.shadow !== "never",
223
692
  hoverShadow: props.shadow === "hover",
224
- header: props.header
693
+ header: props.header,
694
+ bodyStyle: props.bodyStyle,
695
+ headerBordered: true
225
696
  })
226
697
  },
227
698
  cascader: {
@@ -242,13 +713,8 @@ const adapter = {
242
713
  })
243
714
  },
244
715
  checkbox: {
245
- component: Checkbox,
246
- props: (props) => ({
247
- modelValue: props.modelValue,
248
- label: props.label,
249
- value: props.value,
250
- disabled: props.disabled
251
- })
716
+ component: _sfc_main$a,
717
+ props: (props) => props
252
718
  },
253
719
  checkboxGroup: {
254
720
  component: CheckboxGroup,
@@ -261,13 +727,13 @@ const adapter = {
261
727
  col: {
262
728
  component: Col,
263
729
  props: (props) => ({
264
- span: props.span
730
+ span: props.span ? props.span / 2 : 12
265
731
  })
266
732
  },
267
733
  collapse: {
268
734
  component: Collapse,
269
735
  props: (props) => ({
270
- value: props.modelValue,
736
+ modelValue: props.modelValue,
271
737
  expandIconPlacement: "right"
272
738
  })
273
739
  },
@@ -290,19 +756,12 @@ const adapter = {
290
756
  })
291
757
  },
292
758
  datePicker: {
293
- component: _sfc_main$4,
759
+ component: _sfc_main$9,
294
760
  props: (props) => props
295
761
  },
296
762
  dialog: {
297
- component: Dialog,
298
- props: (props) => ({
299
- visible: props.modelValue,
300
- attach: props.appendToBody ? "body" : "",
301
- header: props.title,
302
- width: props.width,
303
- mode: props.fullscreen ? "full-screen" : "modal",
304
- closeOnOverlayClick: props.closeOnClickModal
305
- })
763
+ component: _sfc_main$8,
764
+ props: (props) => props
306
765
  },
307
766
  divider: {
308
767
  component: Divider,
@@ -369,15 +828,16 @@ const adapter = {
369
828
  props: (props) => ({
370
829
  labelWidth: props.labelWidth,
371
830
  name: props.prop,
372
- rules: props.rules
831
+ rules: props.rules,
832
+ help: props.extra
373
833
  })
374
834
  },
375
835
  icon: {
376
- component: Icon,
836
+ component: _sfc_main$7,
377
837
  props: (props) => props
378
838
  },
379
839
  input: {
380
- component: _sfc_main$2,
840
+ component: _sfc_main$6,
381
841
  props: (props) => props
382
842
  },
383
843
  inputNumber: {
@@ -415,17 +875,12 @@ const adapter = {
415
875
  })
416
876
  },
417
877
  radio: {
418
- component: Radio,
419
- props: (props) => ({
420
- label: props.label,
421
- value: props.value
422
- })
878
+ component: _sfc_main$4,
879
+ props: (props) => props
423
880
  },
424
881
  radioButton: {
425
- component: RadioButton,
426
- props: (props) => ({
427
- label: props.label
428
- })
882
+ component: _sfc_main$3,
883
+ props: (props) => props
429
884
  },
430
885
  radioGroup: {
431
886
  component: RadioGroup,
@@ -483,11 +938,7 @@ const adapter = {
483
938
  })
484
939
  },
485
940
  table: {
486
- component: Table,
487
- props: (props) => props
488
- },
489
- tableColumn: {
490
- component: TableColumn,
941
+ component: _sfc_main$1,
491
942
  props: (props) => props
492
943
  },
493
944
  tabPane: {
@@ -498,13 +949,8 @@ const adapter = {
498
949
  })
499
950
  },
500
951
  tabs: {
501
- component: Tabs,
502
- props: (props) => ({
503
- addable: props.editable,
504
- theme: props.type === "card" ? "card" : "normal",
505
- placement: props.tabPosition,
506
- value: props.modelValue
507
- })
952
+ component: _sfc_main,
953
+ props: (props) => props
508
954
  },
509
955
  tag: {
510
956
  component: Tag,
@@ -525,7 +971,7 @@ const adapter = {
525
971
  component: Tooltip,
526
972
  props: (props) => ({
527
973
  ...props,
528
- placement: props.placement,
974
+ placement: props.placement?.replace(/\B([A-Z])/g, "-$1").toLowerCase(),
529
975
  content: props.content
530
976
  })
531
977
  },
@@ -536,8 +982,13 @@ const adapter = {
536
982
  disabled: props.disabled,
537
983
  autoUpload: props.autoUpload
538
984
  })
985
+ },
986
+ popconfirm: {
987
+ component: _sfc_main$5,
988
+ props: (props) => props
539
989
  }
540
- }
990
+ },
991
+ loading: LoadingDirective
541
992
  };
542
993
 
543
994
  export { adapter as default };