@truenewx/tnxvue3 3.4.4 → 3.4.5
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/package.json +2 -2
- package/src/bootstrap-vue/dialog/Dialog.vue +22 -10
- package/src/element-plus/dialog/Dialog.vue +19 -7
- package/src/element-plus/drawer/Drawer.vue +20 -3
- package/src/element-plus/fss-upload/FssUpload.vue +1 -1
- package/src/element-plus/icon/Icon.vue +3 -0
- package/src/element-plus/tnxel.css +0 -8
- package/src/element-plus/tnxel.ts +58 -72
- package/src/tdesign/mobile/calendar/Calendar.vue +121 -0
- package/src/tdesign/mobile/date-time-picker/DateTimePicker.vue +147 -0
- package/src/tdesign/mobile/dialog/Dialog.vue +179 -0
- package/src/tdesign/mobile/dialog/DialogContent.vue +13 -0
- package/src/tdesign/mobile/drawer/Drawer.vue +176 -0
- package/src/tdesign/mobile/drawer/DrawerContent.vue +13 -0
- package/src/tdesign/mobile/enum-select/EnumSelect.vue +160 -0
- package/src/tdesign/mobile/popup/Popup.vue +106 -0
- package/src/tdesign/mobile/region-picker/RegionPicker.vue +223 -0
- package/src/tdesign/mobile/select/Select.vue +478 -0
- package/src/tdesign/mobile/slide-radio-group/SlideRadioGroup.vue +392 -0
- package/src/tdesign/mobile/tnxtdm.css +132 -0
- package/src/tdesign/mobile/tnxtdm.ts +303 -1
- package/src/tdesign/tnxtd-validator.ts +14 -13
- package/src/tdesign/tnxtd.css +66 -0
- package/src/tdesign/tnxtd.ts +4 -0
- package/src/tnxvue-router.ts +58 -5
- package/src/tnxvue.ts +20 -7
- package/tsconfig.json +1 -0
package/src/tnxvue.ts
CHANGED
|
@@ -27,6 +27,7 @@ export type DialogOptions = {
|
|
|
27
27
|
click?: boolean | ((yes: boolean, close: () => void) => boolean | undefined) | ((close: () => void) => boolean | undefined);
|
|
28
28
|
buttonText?: string | string[];
|
|
29
29
|
buttons?: ButtonOptions[];
|
|
30
|
+
width?: number | string;
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
export type OpenType = 'alert' | 'confirm' | 'close' | 'none';
|
|
@@ -174,7 +175,7 @@ export default class TnxVue extends Tnx {
|
|
|
174
175
|
|
|
175
176
|
protected getDefaultDialogButtons(
|
|
176
177
|
type: OpenType,
|
|
177
|
-
click: boolean | ((yes: boolean, close: () => void) => boolean | undefined) | ((close: () => void) => boolean | undefined),
|
|
178
|
+
click: boolean | string | ((yes: boolean, close: () => void) => boolean | undefined) | ((close: () => void) => boolean | undefined),
|
|
178
179
|
theme?: string): ButtonOptions[] {
|
|
179
180
|
if (click !== false) {
|
|
180
181
|
if (type === 'none') {
|
|
@@ -184,6 +185,9 @@ export default class TnxVue extends Tnx {
|
|
|
184
185
|
text: '确定',
|
|
185
186
|
type: theme || 'primary',
|
|
186
187
|
click(close: () => void) {
|
|
188
|
+
if (typeof click === 'string') {
|
|
189
|
+
click = this[click];
|
|
190
|
+
}
|
|
187
191
|
if (typeof click === 'function') {
|
|
188
192
|
return click.call(this, true, close);
|
|
189
193
|
}
|
|
@@ -191,6 +195,9 @@ export default class TnxVue extends Tnx {
|
|
|
191
195
|
}, {
|
|
192
196
|
text: '取消',
|
|
193
197
|
click(close: () => void) {
|
|
198
|
+
if (typeof click === 'string') {
|
|
199
|
+
click = this[click];
|
|
200
|
+
}
|
|
194
201
|
if (typeof click === 'function') {
|
|
195
202
|
return click.call(this, false, close);
|
|
196
203
|
}
|
|
@@ -201,6 +208,9 @@ export default class TnxVue extends Tnx {
|
|
|
201
208
|
text: '关闭',
|
|
202
209
|
type: theme,
|
|
203
210
|
click(close: () => void) {
|
|
211
|
+
if (typeof click === 'string') {
|
|
212
|
+
click = this[click];
|
|
213
|
+
}
|
|
204
214
|
if (typeof click === 'function') {
|
|
205
215
|
return click.call(this, close);
|
|
206
216
|
}
|
|
@@ -211,6 +221,9 @@ export default class TnxVue extends Tnx {
|
|
|
211
221
|
text: '确定',
|
|
212
222
|
type: theme || 'primary',
|
|
213
223
|
click(close: () => void) {
|
|
224
|
+
if (typeof click === 'string') {
|
|
225
|
+
click = this[click];
|
|
226
|
+
}
|
|
214
227
|
if (typeof click === 'function') {
|
|
215
228
|
return click.call(this, close);
|
|
216
229
|
}
|
|
@@ -221,7 +234,7 @@ export default class TnxVue extends Tnx {
|
|
|
221
234
|
return [];
|
|
222
235
|
}
|
|
223
236
|
|
|
224
|
-
closeDialog(all?: boolean):
|
|
237
|
+
closeDialog(all?: boolean): void {
|
|
225
238
|
// 默认不实现,由UI框架扩展层实现
|
|
226
239
|
throw new Error('Unsupported function');
|
|
227
240
|
}
|
|
@@ -235,7 +248,7 @@ export default class TnxVue extends Tnx {
|
|
|
235
248
|
throw new Error('Unsupported function');
|
|
236
249
|
}
|
|
237
250
|
|
|
238
|
-
closeDrawer(all?: boolean):
|
|
251
|
+
closeDrawer(all?: boolean): void {
|
|
239
252
|
// 默认不实现,由UI框架扩展层实现
|
|
240
253
|
throw new Error('Unsupported function');
|
|
241
254
|
}
|
|
@@ -256,10 +269,10 @@ export default class TnxVue extends Tnx {
|
|
|
256
269
|
|
|
257
270
|
open(component: Vue.Component, props?: Record<string, any>, options: OpenOptions = {}) {
|
|
258
271
|
const c = component as any;
|
|
259
|
-
if (typeof c.
|
|
260
|
-
options = Object.assign({}, c.
|
|
261
|
-
} else if (c.
|
|
262
|
-
options = Object.assign({}, c.
|
|
272
|
+
if (typeof c.openOptions === 'function') {
|
|
273
|
+
options = Object.assign({}, c.openOptions(props), options);
|
|
274
|
+
} else if (c.openOptions) {
|
|
275
|
+
options = Object.assign({}, c.openOptions, options);
|
|
263
276
|
}
|
|
264
277
|
|
|
265
278
|
let mode = options.mode;
|