@tmagic/tdesign-vue-next-adapter 1.7.0-beta.1 → 1.7.0-beta.2
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/dist/tmagic-tdesign-vue-next-adapter.js +94 -21
- package/dist/tmagic-tdesign-vue-next-adapter.umd.cjs +93 -20
- package/package.json +2 -2
- package/src/DatePicker.vue +4 -0
- package/src/Pagination.vue +43 -0
- package/src/index.ts +46 -10
|
@@ -1,7 +1,7 @@
|
|
|
1
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,
|
|
2
|
+
import { Checkbox, DateRangePicker, DatePicker, Dialog, Textarea, InputAdornment, Input, Pagination, Popconfirm, Radio, RadioButton, Table, Tabs, MessagePlugin, LoadingDirective, Upload, Tooltip, TimePicker, Tag, TabPanel, Switch, Steps, StepItem, Select, Row, RadioGroup, OptionGroup, Option, InputNumber, FormItem, Form, Dropdown, DropdownItem, Drawer, Divider, ColorPicker, CollapsePanel, Collapse, Col, CheckboxGroup, Cascader, Card, Button, Badge, DialogPlugin } from 'tdesign-vue-next';
|
|
3
3
|
|
|
4
|
-
const _sfc_main$
|
|
4
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
5
5
|
...{
|
|
6
6
|
name: "TTDesignAdapterCheckbox"
|
|
7
7
|
},
|
|
@@ -65,7 +65,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
|
|
68
|
-
const _sfc_main$
|
|
68
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
69
69
|
__name: "DatePicker",
|
|
70
70
|
props: {
|
|
71
71
|
type: { default: "date" },
|
|
@@ -106,6 +106,9 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
106
106
|
return (_ctx, _cache) => {
|
|
107
107
|
return __props.type.endsWith("range") ? (openBlock(), createBlock(unref(DateRangePicker), {
|
|
108
108
|
key: 0,
|
|
109
|
+
"allow-input": "",
|
|
110
|
+
clearable: "",
|
|
111
|
+
"enable-time-picker": "",
|
|
109
112
|
modelValue: __props.modelValue,
|
|
110
113
|
mode: mode.value,
|
|
111
114
|
placeholder: [__props.startPlaceholder || "", __props.endPlaceholder || ""],
|
|
@@ -118,6 +121,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
118
121
|
"onUpdate:modelValue": updateModelValue
|
|
119
122
|
}, null, 8, ["modelValue", "mode", "placeholder", "disabled", "size", "separator", "format", "valueType"])) : (openBlock(), createBlock(unref(DatePicker), {
|
|
120
123
|
key: 1,
|
|
124
|
+
clearable: "",
|
|
121
125
|
modelValue: __props.modelValue,
|
|
122
126
|
mode: mode.value,
|
|
123
127
|
placeholder: __props.placeholder,
|
|
@@ -133,7 +137,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
133
137
|
}
|
|
134
138
|
});
|
|
135
139
|
|
|
136
|
-
const _sfc_main$
|
|
140
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
137
141
|
...{
|
|
138
142
|
name: "TTDesignAdapterDialog"
|
|
139
143
|
},
|
|
@@ -186,7 +190,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
186
190
|
});
|
|
187
191
|
|
|
188
192
|
const _hoisted_1$1 = { class: "t-t-design-adapter-icon t-icon" };
|
|
189
|
-
const _sfc_main$
|
|
193
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
190
194
|
...{
|
|
191
195
|
name: "TTDesignAdapterIcon"
|
|
192
196
|
},
|
|
@@ -200,7 +204,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
200
204
|
}
|
|
201
205
|
});
|
|
202
206
|
|
|
203
|
-
const _sfc_main$
|
|
207
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
204
208
|
...{
|
|
205
209
|
name: "TTDesignAdapterInput"
|
|
206
210
|
},
|
|
@@ -321,6 +325,51 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
321
325
|
}
|
|
322
326
|
});
|
|
323
327
|
|
|
328
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
329
|
+
...{
|
|
330
|
+
name: "TTDesignAdapterPagination"
|
|
331
|
+
},
|
|
332
|
+
__name: "Pagination",
|
|
333
|
+
props: {
|
|
334
|
+
layout: {},
|
|
335
|
+
hideOnSinglePage: { type: Boolean },
|
|
336
|
+
curPage: {},
|
|
337
|
+
pageSizes: {},
|
|
338
|
+
pageSize: {},
|
|
339
|
+
total: {},
|
|
340
|
+
size: {}
|
|
341
|
+
},
|
|
342
|
+
emits: ["size-change", "current-change", "update:current-page", "update:page-size"],
|
|
343
|
+
setup(__props, { emit: __emit }) {
|
|
344
|
+
const emit = __emit;
|
|
345
|
+
const handleCurrentChange = (...args) => {
|
|
346
|
+
emit("current-change", ...args);
|
|
347
|
+
};
|
|
348
|
+
const handleSizeChange = (...args) => {
|
|
349
|
+
emit("size-change", ...args);
|
|
350
|
+
};
|
|
351
|
+
const updateCurrentPage = (...args) => {
|
|
352
|
+
emit("update:current-page", ...args);
|
|
353
|
+
};
|
|
354
|
+
const updatePageSize = (...args) => {
|
|
355
|
+
emit("update:page-size", ...args);
|
|
356
|
+
};
|
|
357
|
+
return (_ctx, _cache) => {
|
|
358
|
+
return openBlock(), createBlock(unref(Pagination), {
|
|
359
|
+
total: __props.total,
|
|
360
|
+
current: __props.curPage,
|
|
361
|
+
size: __props.size === "small" ? "small" : "medium",
|
|
362
|
+
"page-size": __props.pageSize,
|
|
363
|
+
"page-size-options": __props.pageSizes,
|
|
364
|
+
onCurrentChange: handleCurrentChange,
|
|
365
|
+
onPageSizeChange: handleSizeChange,
|
|
366
|
+
"onUpdate:current": updateCurrentPage,
|
|
367
|
+
"onUpdate:pageSize": updatePageSize
|
|
368
|
+
}, null, 8, ["total", "current", "size", "page-size", "page-size-options"]);
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
|
|
324
373
|
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
325
374
|
...{
|
|
326
375
|
name: "TTDesignAdapterPopconfirm"
|
|
@@ -627,8 +676,36 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
627
676
|
}
|
|
628
677
|
});
|
|
629
678
|
|
|
679
|
+
const messageBox = (options) => MessagePlugin(options.type || "info", {
|
|
680
|
+
duration: options.duration || 3e3,
|
|
681
|
+
content: options.message
|
|
682
|
+
});
|
|
683
|
+
messageBox.success = MessagePlugin.success;
|
|
684
|
+
messageBox.error = MessagePlugin.error;
|
|
685
|
+
messageBox.warning = MessagePlugin.warning;
|
|
686
|
+
messageBox.info = MessagePlugin.info;
|
|
687
|
+
const zIndex = ref(0);
|
|
688
|
+
const DEFAULT_INITIAL_Z_INDEX = 2500;
|
|
689
|
+
const useZIndex = (zIndexOverrides) => {
|
|
690
|
+
const zIndexInjection = zIndexOverrides;
|
|
691
|
+
const initialZIndex = computed(() => {
|
|
692
|
+
const zIndexFromInjection = unref(zIndexInjection);
|
|
693
|
+
return zIndexFromInjection ?? DEFAULT_INITIAL_Z_INDEX;
|
|
694
|
+
});
|
|
695
|
+
const currentZIndex = computed(() => initialZIndex.value + zIndex.value);
|
|
696
|
+
const nextZIndex = () => {
|
|
697
|
+
zIndex.value += 1;
|
|
698
|
+
return currentZIndex.value;
|
|
699
|
+
};
|
|
700
|
+
return {
|
|
701
|
+
initialZIndex,
|
|
702
|
+
currentZIndex,
|
|
703
|
+
nextZIndex
|
|
704
|
+
};
|
|
705
|
+
};
|
|
630
706
|
const adapter = {
|
|
631
|
-
|
|
707
|
+
adapterType: "tdesign-vue-next",
|
|
708
|
+
message: messageBox,
|
|
632
709
|
messageBox: {
|
|
633
710
|
alert: (msg, title) => {
|
|
634
711
|
return new Promise((resolve, reject) => {
|
|
@@ -680,7 +757,7 @@ const adapter = {
|
|
|
680
757
|
props: (props) => ({
|
|
681
758
|
theme: props.type,
|
|
682
759
|
size: props.size === "default" ? "medium" : props.size,
|
|
683
|
-
icon: props.icon ? () => h(_sfc_main$
|
|
760
|
+
icon: props.icon ? () => h(_sfc_main$8, null, { default: () => h(props.icon) }) : void 0,
|
|
684
761
|
variant: props.link || props.text ? "text" : props.variant || "base",
|
|
685
762
|
shape: props.circle ? "circle" : "rectangle"
|
|
686
763
|
})
|
|
@@ -713,7 +790,7 @@ const adapter = {
|
|
|
713
790
|
})
|
|
714
791
|
},
|
|
715
792
|
checkbox: {
|
|
716
|
-
component: _sfc_main$
|
|
793
|
+
component: _sfc_main$b,
|
|
717
794
|
props: (props) => props
|
|
718
795
|
},
|
|
719
796
|
checkboxGroup: {
|
|
@@ -756,11 +833,11 @@ const adapter = {
|
|
|
756
833
|
})
|
|
757
834
|
},
|
|
758
835
|
datePicker: {
|
|
759
|
-
component: _sfc_main$
|
|
836
|
+
component: _sfc_main$a,
|
|
760
837
|
props: (props) => props
|
|
761
838
|
},
|
|
762
839
|
dialog: {
|
|
763
|
-
component: _sfc_main$
|
|
840
|
+
component: _sfc_main$9,
|
|
764
841
|
props: (props) => props
|
|
765
842
|
},
|
|
766
843
|
divider: {
|
|
@@ -833,11 +910,11 @@ const adapter = {
|
|
|
833
910
|
})
|
|
834
911
|
},
|
|
835
912
|
icon: {
|
|
836
|
-
component: _sfc_main$
|
|
913
|
+
component: _sfc_main$8,
|
|
837
914
|
props: (props) => props
|
|
838
915
|
},
|
|
839
916
|
input: {
|
|
840
|
-
component: _sfc_main$
|
|
917
|
+
component: _sfc_main$7,
|
|
841
918
|
props: (props) => props
|
|
842
919
|
},
|
|
843
920
|
inputNumber: {
|
|
@@ -866,13 +943,8 @@ const adapter = {
|
|
|
866
943
|
props: (props) => props
|
|
867
944
|
},
|
|
868
945
|
pagination: {
|
|
869
|
-
component:
|
|
870
|
-
props: (props) =>
|
|
871
|
-
current: props.curPage,
|
|
872
|
-
pageSizeOptions: props.pageSizes,
|
|
873
|
-
pageSize: props.pagesize,
|
|
874
|
-
total: props.total
|
|
875
|
-
})
|
|
946
|
+
component: _sfc_main$6,
|
|
947
|
+
props: (props) => props
|
|
876
948
|
},
|
|
877
949
|
radio: {
|
|
878
950
|
component: _sfc_main$4,
|
|
@@ -988,7 +1060,8 @@ const adapter = {
|
|
|
988
1060
|
props: (props) => props
|
|
989
1061
|
}
|
|
990
1062
|
},
|
|
991
|
-
loading: LoadingDirective
|
|
1063
|
+
loading: LoadingDirective,
|
|
1064
|
+
useZIndex
|
|
992
1065
|
};
|
|
993
1066
|
|
|
994
1067
|
export { adapter as default };
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.TMagicTdesignVueNextAdapter = factory(global.Vue, global.tdesignVueNext));
|
|
5
5
|
})(this, (function (vue, tdesignVueNext) { 'use strict';
|
|
6
6
|
|
|
7
|
-
const _sfc_main$
|
|
7
|
+
const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
8
8
|
...{
|
|
9
9
|
name: "TTDesignAdapterCheckbox"
|
|
10
10
|
},
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
-
const _sfc_main$
|
|
71
|
+
const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
72
72
|
__name: "DatePicker",
|
|
73
73
|
props: {
|
|
74
74
|
type: { default: "date" },
|
|
@@ -109,6 +109,9 @@
|
|
|
109
109
|
return (_ctx, _cache) => {
|
|
110
110
|
return __props.type.endsWith("range") ? (vue.openBlock(), vue.createBlock(vue.unref(tdesignVueNext.DateRangePicker), {
|
|
111
111
|
key: 0,
|
|
112
|
+
"allow-input": "",
|
|
113
|
+
clearable: "",
|
|
114
|
+
"enable-time-picker": "",
|
|
112
115
|
modelValue: __props.modelValue,
|
|
113
116
|
mode: mode.value,
|
|
114
117
|
placeholder: [__props.startPlaceholder || "", __props.endPlaceholder || ""],
|
|
@@ -121,6 +124,7 @@
|
|
|
121
124
|
"onUpdate:modelValue": updateModelValue
|
|
122
125
|
}, null, 8, ["modelValue", "mode", "placeholder", "disabled", "size", "separator", "format", "valueType"])) : (vue.openBlock(), vue.createBlock(vue.unref(tdesignVueNext.DatePicker), {
|
|
123
126
|
key: 1,
|
|
127
|
+
clearable: "",
|
|
124
128
|
modelValue: __props.modelValue,
|
|
125
129
|
mode: mode.value,
|
|
126
130
|
placeholder: __props.placeholder,
|
|
@@ -136,7 +140,7 @@
|
|
|
136
140
|
}
|
|
137
141
|
});
|
|
138
142
|
|
|
139
|
-
const _sfc_main$
|
|
143
|
+
const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
140
144
|
...{
|
|
141
145
|
name: "TTDesignAdapterDialog"
|
|
142
146
|
},
|
|
@@ -189,7 +193,7 @@
|
|
|
189
193
|
});
|
|
190
194
|
|
|
191
195
|
const _hoisted_1$1 = { class: "t-t-design-adapter-icon t-icon" };
|
|
192
|
-
const _sfc_main$
|
|
196
|
+
const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
193
197
|
...{
|
|
194
198
|
name: "TTDesignAdapterIcon"
|
|
195
199
|
},
|
|
@@ -203,7 +207,7 @@
|
|
|
203
207
|
}
|
|
204
208
|
});
|
|
205
209
|
|
|
206
|
-
const _sfc_main$
|
|
210
|
+
const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
207
211
|
...{
|
|
208
212
|
name: "TTDesignAdapterInput"
|
|
209
213
|
},
|
|
@@ -324,6 +328,51 @@
|
|
|
324
328
|
}
|
|
325
329
|
});
|
|
326
330
|
|
|
331
|
+
const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
332
|
+
...{
|
|
333
|
+
name: "TTDesignAdapterPagination"
|
|
334
|
+
},
|
|
335
|
+
__name: "Pagination",
|
|
336
|
+
props: {
|
|
337
|
+
layout: {},
|
|
338
|
+
hideOnSinglePage: { type: Boolean },
|
|
339
|
+
curPage: {},
|
|
340
|
+
pageSizes: {},
|
|
341
|
+
pageSize: {},
|
|
342
|
+
total: {},
|
|
343
|
+
size: {}
|
|
344
|
+
},
|
|
345
|
+
emits: ["size-change", "current-change", "update:current-page", "update:page-size"],
|
|
346
|
+
setup(__props, { emit: __emit }) {
|
|
347
|
+
const emit = __emit;
|
|
348
|
+
const handleCurrentChange = (...args) => {
|
|
349
|
+
emit("current-change", ...args);
|
|
350
|
+
};
|
|
351
|
+
const handleSizeChange = (...args) => {
|
|
352
|
+
emit("size-change", ...args);
|
|
353
|
+
};
|
|
354
|
+
const updateCurrentPage = (...args) => {
|
|
355
|
+
emit("update:current-page", ...args);
|
|
356
|
+
};
|
|
357
|
+
const updatePageSize = (...args) => {
|
|
358
|
+
emit("update:page-size", ...args);
|
|
359
|
+
};
|
|
360
|
+
return (_ctx, _cache) => {
|
|
361
|
+
return vue.openBlock(), vue.createBlock(vue.unref(tdesignVueNext.Pagination), {
|
|
362
|
+
total: __props.total,
|
|
363
|
+
current: __props.curPage,
|
|
364
|
+
size: __props.size === "small" ? "small" : "medium",
|
|
365
|
+
"page-size": __props.pageSize,
|
|
366
|
+
"page-size-options": __props.pageSizes,
|
|
367
|
+
onCurrentChange: handleCurrentChange,
|
|
368
|
+
onPageSizeChange: handleSizeChange,
|
|
369
|
+
"onUpdate:current": updateCurrentPage,
|
|
370
|
+
"onUpdate:pageSize": updatePageSize
|
|
371
|
+
}, null, 8, ["total", "current", "size", "page-size", "page-size-options"]);
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
|
|
327
376
|
const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
328
377
|
...{
|
|
329
378
|
name: "TTDesignAdapterPopconfirm"
|
|
@@ -630,8 +679,36 @@
|
|
|
630
679
|
}
|
|
631
680
|
});
|
|
632
681
|
|
|
682
|
+
const messageBox = (options) => tdesignVueNext.MessagePlugin(options.type || "info", {
|
|
683
|
+
duration: options.duration || 3e3,
|
|
684
|
+
content: options.message
|
|
685
|
+
});
|
|
686
|
+
messageBox.success = tdesignVueNext.MessagePlugin.success;
|
|
687
|
+
messageBox.error = tdesignVueNext.MessagePlugin.error;
|
|
688
|
+
messageBox.warning = tdesignVueNext.MessagePlugin.warning;
|
|
689
|
+
messageBox.info = tdesignVueNext.MessagePlugin.info;
|
|
690
|
+
const zIndex = vue.ref(0);
|
|
691
|
+
const DEFAULT_INITIAL_Z_INDEX = 2500;
|
|
692
|
+
const useZIndex = (zIndexOverrides) => {
|
|
693
|
+
const zIndexInjection = zIndexOverrides;
|
|
694
|
+
const initialZIndex = vue.computed(() => {
|
|
695
|
+
const zIndexFromInjection = vue.unref(zIndexInjection);
|
|
696
|
+
return zIndexFromInjection ?? DEFAULT_INITIAL_Z_INDEX;
|
|
697
|
+
});
|
|
698
|
+
const currentZIndex = vue.computed(() => initialZIndex.value + zIndex.value);
|
|
699
|
+
const nextZIndex = () => {
|
|
700
|
+
zIndex.value += 1;
|
|
701
|
+
return currentZIndex.value;
|
|
702
|
+
};
|
|
703
|
+
return {
|
|
704
|
+
initialZIndex,
|
|
705
|
+
currentZIndex,
|
|
706
|
+
nextZIndex
|
|
707
|
+
};
|
|
708
|
+
};
|
|
633
709
|
const adapter = {
|
|
634
|
-
|
|
710
|
+
adapterType: "tdesign-vue-next",
|
|
711
|
+
message: messageBox,
|
|
635
712
|
messageBox: {
|
|
636
713
|
alert: (msg, title) => {
|
|
637
714
|
return new Promise((resolve, reject) => {
|
|
@@ -683,7 +760,7 @@
|
|
|
683
760
|
props: (props) => ({
|
|
684
761
|
theme: props.type,
|
|
685
762
|
size: props.size === "default" ? "medium" : props.size,
|
|
686
|
-
icon: props.icon ? () => vue.h(_sfc_main$
|
|
763
|
+
icon: props.icon ? () => vue.h(_sfc_main$8, null, { default: () => vue.h(props.icon) }) : void 0,
|
|
687
764
|
variant: props.link || props.text ? "text" : props.variant || "base",
|
|
688
765
|
shape: props.circle ? "circle" : "rectangle"
|
|
689
766
|
})
|
|
@@ -716,7 +793,7 @@
|
|
|
716
793
|
})
|
|
717
794
|
},
|
|
718
795
|
checkbox: {
|
|
719
|
-
component: _sfc_main$
|
|
796
|
+
component: _sfc_main$b,
|
|
720
797
|
props: (props) => props
|
|
721
798
|
},
|
|
722
799
|
checkboxGroup: {
|
|
@@ -759,11 +836,11 @@
|
|
|
759
836
|
})
|
|
760
837
|
},
|
|
761
838
|
datePicker: {
|
|
762
|
-
component: _sfc_main$
|
|
839
|
+
component: _sfc_main$a,
|
|
763
840
|
props: (props) => props
|
|
764
841
|
},
|
|
765
842
|
dialog: {
|
|
766
|
-
component: _sfc_main$
|
|
843
|
+
component: _sfc_main$9,
|
|
767
844
|
props: (props) => props
|
|
768
845
|
},
|
|
769
846
|
divider: {
|
|
@@ -836,11 +913,11 @@
|
|
|
836
913
|
})
|
|
837
914
|
},
|
|
838
915
|
icon: {
|
|
839
|
-
component: _sfc_main$
|
|
916
|
+
component: _sfc_main$8,
|
|
840
917
|
props: (props) => props
|
|
841
918
|
},
|
|
842
919
|
input: {
|
|
843
|
-
component: _sfc_main$
|
|
920
|
+
component: _sfc_main$7,
|
|
844
921
|
props: (props) => props
|
|
845
922
|
},
|
|
846
923
|
inputNumber: {
|
|
@@ -869,13 +946,8 @@
|
|
|
869
946
|
props: (props) => props
|
|
870
947
|
},
|
|
871
948
|
pagination: {
|
|
872
|
-
component:
|
|
873
|
-
props: (props) =>
|
|
874
|
-
current: props.curPage,
|
|
875
|
-
pageSizeOptions: props.pageSizes,
|
|
876
|
-
pageSize: props.pagesize,
|
|
877
|
-
total: props.total
|
|
878
|
-
})
|
|
949
|
+
component: _sfc_main$6,
|
|
950
|
+
props: (props) => props
|
|
879
951
|
},
|
|
880
952
|
radio: {
|
|
881
953
|
component: _sfc_main$4,
|
|
@@ -991,7 +1063,8 @@
|
|
|
991
1063
|
props: (props) => props
|
|
992
1064
|
}
|
|
993
1065
|
},
|
|
994
|
-
loading: tdesignVueNext.LoadingDirective
|
|
1066
|
+
loading: tdesignVueNext.LoadingDirective,
|
|
1067
|
+
useZIndex
|
|
995
1068
|
};
|
|
996
1069
|
|
|
997
1070
|
return adapter;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.7.0-beta.
|
|
2
|
+
"version": "1.7.0-beta.2",
|
|
3
3
|
"name": "@tmagic/tdesign-vue-next-adapter",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/tmagic-tdesign-vue-next-adapter.umd.cjs",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"tdesign-vue-next": "^1.17.1",
|
|
39
39
|
"vue": "^3.5.22",
|
|
40
40
|
"typescript": "^5.9.3",
|
|
41
|
-
"@tmagic/design": "1.7.0-beta.
|
|
41
|
+
"@tmagic/design": "1.7.0-beta.2"
|
|
42
42
|
},
|
|
43
43
|
"peerDependenciesMeta": {
|
|
44
44
|
"typescript": {
|
package/src/DatePicker.vue
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<TDateRangePicker
|
|
3
3
|
v-if="type.endsWith('range')"
|
|
4
|
+
allow-input
|
|
5
|
+
clearable
|
|
6
|
+
enable-time-picker
|
|
4
7
|
:modelValue="modelValue"
|
|
5
8
|
:mode="mode"
|
|
6
9
|
:placeholder="[startPlaceholder || '', endPlaceholder || '']"
|
|
@@ -14,6 +17,7 @@
|
|
|
14
17
|
/>
|
|
15
18
|
<TDatePicker
|
|
16
19
|
v-else
|
|
20
|
+
clearable
|
|
17
21
|
:modelValue="modelValue"
|
|
18
22
|
:mode="mode"
|
|
19
23
|
:placeholder="placeholder"
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<TPagination
|
|
3
|
+
:total="total"
|
|
4
|
+
:current="curPage"
|
|
5
|
+
:size="size === 'small' ? 'small' : 'medium'"
|
|
6
|
+
:page-size="pageSize"
|
|
7
|
+
:page-size-options="pageSizes"
|
|
8
|
+
@current-change="handleCurrentChange"
|
|
9
|
+
@page-size-change="handleSizeChange"
|
|
10
|
+
@update:current="updateCurrentPage"
|
|
11
|
+
@update:page-size="updatePageSize"
|
|
12
|
+
></TPagination>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script setup lang="ts">
|
|
16
|
+
import { Pagination as TPagination } from 'tdesign-vue-next';
|
|
17
|
+
|
|
18
|
+
import type { PaginationProps } from '@tmagic/design';
|
|
19
|
+
|
|
20
|
+
defineOptions({
|
|
21
|
+
name: 'TTDesignAdapterPagination',
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
defineProps<PaginationProps>();
|
|
25
|
+
|
|
26
|
+
const emit = defineEmits(['size-change', 'current-change', 'update:current-page', 'update:page-size']);
|
|
27
|
+
|
|
28
|
+
const handleCurrentChange = (...args: any[]) => {
|
|
29
|
+
emit('current-change', ...args);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const handleSizeChange = (...args: any[]) => {
|
|
33
|
+
emit('size-change', ...args);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const updateCurrentPage = (...args: any[]) => {
|
|
37
|
+
emit('update:current-page', ...args);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const updatePageSize = (...args: any[]) => {
|
|
41
|
+
emit('update:page-size', ...args);
|
|
42
|
+
};
|
|
43
|
+
</script>
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h } from 'vue';
|
|
1
|
+
import { computed, h, Ref, ref, unref } from 'vue';
|
|
2
2
|
import {
|
|
3
3
|
Badge as TBadge,
|
|
4
4
|
Button as TButton,
|
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
MessagePlugin,
|
|
22
22
|
Option as TOption,
|
|
23
23
|
OptionGroup as TOptionGroup,
|
|
24
|
-
Pagination as TPagination,
|
|
25
24
|
RadioGroup as TRadioGroup,
|
|
26
25
|
Row as TRow,
|
|
27
26
|
Select as TSelect,
|
|
@@ -81,6 +80,7 @@ import DatePicker from './DatePicker.vue';
|
|
|
81
80
|
import Dialog from './Dialog.vue';
|
|
82
81
|
import Icon from './Icon.vue';
|
|
83
82
|
import Input from './Input.vue';
|
|
83
|
+
import Pagination from './Pagination.vue';
|
|
84
84
|
import Popconfirm from './Popconfirm.vue';
|
|
85
85
|
import Radio from './Radio.vue';
|
|
86
86
|
import RadioButton from './RadioButton.vue';
|
|
@@ -88,8 +88,48 @@ import Scrollbar from './Scrollbar.vue';
|
|
|
88
88
|
import Table from './Table.vue';
|
|
89
89
|
import Tabs from './Tabs.vue';
|
|
90
90
|
|
|
91
|
+
const messageBox = (options: {
|
|
92
|
+
type?: 'info' | 'success' | 'warning' | 'error';
|
|
93
|
+
message?: string;
|
|
94
|
+
dangerouslyUseHTMLString?: boolean;
|
|
95
|
+
duration?: number;
|
|
96
|
+
}) =>
|
|
97
|
+
MessagePlugin(options.type || 'info', {
|
|
98
|
+
duration: options.duration || 3000,
|
|
99
|
+
content: options.message,
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
messageBox.success = MessagePlugin.success;
|
|
103
|
+
messageBox.error = MessagePlugin.error;
|
|
104
|
+
messageBox.warning = MessagePlugin.warning;
|
|
105
|
+
messageBox.info = MessagePlugin.info;
|
|
106
|
+
|
|
107
|
+
const zIndex = ref(0);
|
|
108
|
+
const DEFAULT_INITIAL_Z_INDEX = 2500;
|
|
109
|
+
|
|
110
|
+
const useZIndex = (zIndexOverrides?: Ref<number>) => {
|
|
111
|
+
const zIndexInjection = zIndexOverrides;
|
|
112
|
+
const initialZIndex = computed(() => {
|
|
113
|
+
const zIndexFromInjection = unref(zIndexInjection);
|
|
114
|
+
return zIndexFromInjection ?? DEFAULT_INITIAL_Z_INDEX;
|
|
115
|
+
});
|
|
116
|
+
const currentZIndex = computed(() => initialZIndex.value + zIndex.value);
|
|
117
|
+
|
|
118
|
+
const nextZIndex = () => {
|
|
119
|
+
zIndex.value += 1;
|
|
120
|
+
return currentZIndex.value;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
return {
|
|
124
|
+
initialZIndex,
|
|
125
|
+
currentZIndex,
|
|
126
|
+
nextZIndex,
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
|
|
91
130
|
const adapter: any = {
|
|
92
|
-
|
|
131
|
+
adapterType: 'tdesign-vue-next',
|
|
132
|
+
message: messageBox,
|
|
93
133
|
messageBox: {
|
|
94
134
|
alert: (msg: string, title?: string) => {
|
|
95
135
|
return new Promise((resolve, reject) => {
|
|
@@ -351,13 +391,8 @@ const adapter: any = {
|
|
|
351
391
|
},
|
|
352
392
|
|
|
353
393
|
pagination: {
|
|
354
|
-
component:
|
|
355
|
-
props: (props: PaginationProps) =>
|
|
356
|
-
current: props.curPage,
|
|
357
|
-
pageSizeOptions: props.pageSizes,
|
|
358
|
-
pageSize: props.pagesize,
|
|
359
|
-
total: props.total,
|
|
360
|
-
}),
|
|
394
|
+
component: Pagination,
|
|
395
|
+
props: (props: PaginationProps) => props,
|
|
361
396
|
},
|
|
362
397
|
|
|
363
398
|
radio: {
|
|
@@ -491,6 +526,7 @@ const adapter: any = {
|
|
|
491
526
|
},
|
|
492
527
|
},
|
|
493
528
|
loading: LoadingDirective,
|
|
529
|
+
useZIndex,
|
|
494
530
|
};
|
|
495
531
|
|
|
496
532
|
export default adapter;
|