@fastkit/vui 0.18.31 → 0.18.33
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/vui.d.ts +214 -214
- package/dist/vui.mjs +402 -484
- package/dist/vui.mjs.map +1 -1
- package/package.json +25 -25
- package/src/components/VApp/VApp.tsx +5 -7
- package/src/components/VAvatar/VAvatar.tsx +1 -0
- package/src/components/VBreadcrumbs/VBreadcrumbs.tsx +8 -7
- package/src/components/VButton/VButton.tsx +28 -28
- package/src/components/VButton/VButtonGroup.tsx +2 -2
- package/src/components/VCard/VCard.tsx +2 -13
- package/src/components/VCard/VCardActions.tsx +1 -3
- package/src/components/VCard/VCardContent.tsx +1 -3
- package/src/components/VCheckable/VCheckable.tsx +12 -14
- package/src/components/VCheckbox/VCheckbox.tsx +11 -12
- package/src/components/VChip/VChip.tsx +1 -0
- package/src/components/VContentSwitcher/VContentSwitcher.tsx +5 -7
- package/src/components/VControlField/VControlField.tsx +19 -20
- package/src/components/VDataTable/VDataTable.tsx +20 -23
- package/src/components/VDialog/VDialog.tsx +1 -2
- package/src/components/VForm/VForm.tsx +12 -13
- package/src/components/VFormControl/VFormControl.tsx +7 -2
- package/src/components/VFormGroup/VFormGroup.tsx +1 -0
- package/src/components/VGrid/schemes.ts +7 -5
- package/src/components/VListTile/VListTile.tsx +4 -1
- package/src/components/VMenu/VMenu.tsx +5 -7
- package/src/components/VNavigation/VNavigation.tsx +5 -3
- package/src/components/VNavigation/VNavigationItem.tsx +13 -66
- package/src/components/VNumberField/VNumberField.tsx +13 -14
- package/src/components/VOption/VOption.tsx +20 -23
- package/src/components/VOptionGroup/VOptionGroup.tsx +9 -11
- package/src/components/VPagination/VPagination.tsx +21 -20
- package/src/components/VPaper/VPaper.tsx +1 -1
- package/src/components/VRadio/VRadio.tsx +11 -12
- package/src/components/VSelect/VSelect.tsx +85 -95
- package/src/components/VSheetModal/VSheetModal.tsx +20 -36
- package/src/components/VSnackbar/VSnackbar.tsx +2 -4
- package/src/components/VSwitch/VSwitch.tsx +11 -12
- package/src/components/VTabs/VTab.tsx +13 -20
- package/src/components/VTabs/VTabs.tsx +12 -15
- package/src/components/VTextField/VTextField.tsx +34 -37
- package/src/components/VTextarea/VTextarea.tsx +36 -43
- package/src/components/VToolbar/VToolbar.tsx +11 -15
- package/src/components/VToolbar/VToolbarMenu.tsx +1 -0
- package/src/components/VTooltip/VTooltip.tsx +3 -7
- package/src/composables/control.ts +9 -16
- package/src/composables/form-selector.tsx +61 -67
- package/src/composables/vui.ts +2 -1
- package/src/injections.ts +5 -5
- package/src/plugin.tsx +8 -7
- package/src/service.tsx +42 -32
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
resolveVNodeChildOrSlots,
|
|
23
23
|
} from '@fastkit/vue-utils';
|
|
24
24
|
import { useKeyboard } from '@fastkit/vue-keyboard';
|
|
25
|
+
import { VStackActivatorPayload, MenuAPI } from '@fastkit/vue-stack';
|
|
25
26
|
import { VFormControl } from '../VFormControl';
|
|
26
27
|
import {
|
|
27
28
|
VControlField,
|
|
@@ -37,11 +38,9 @@ import {
|
|
|
37
38
|
import { VUI_SELECT_SYMBOL, useVui } from '../../injections';
|
|
38
39
|
import { VIcon } from '../VIcon';
|
|
39
40
|
import { VMenu } from '../VMenu';
|
|
40
|
-
import { VStackActivatorPayload } from '@fastkit/vue-stack';
|
|
41
41
|
import { VOptionGroup } from '../VOptionGroup';
|
|
42
42
|
import { VOption } from '../VOption';
|
|
43
43
|
import { VButton } from '../VButton';
|
|
44
|
-
import { MenuAPI } from '@fastkit/vue-stack';
|
|
45
44
|
|
|
46
45
|
export const ARROW_KEY_TYPES = useKeyboard.Key(['ArrowUp', 'ArrowDown']);
|
|
47
46
|
|
|
@@ -84,6 +83,7 @@ export const VSelect = defineComponent({
|
|
|
84
83
|
},
|
|
85
84
|
slots,
|
|
86
85
|
emits,
|
|
86
|
+
// eslint-disable-next-line no-shadow
|
|
87
87
|
setup(props, ctx) {
|
|
88
88
|
const menuRef: Ref<{ menu: MenuAPI } | null> = ref(null);
|
|
89
89
|
const menuOpened = ref(false);
|
|
@@ -247,6 +247,7 @@ export const VSelect = defineComponent({
|
|
|
247
247
|
);
|
|
248
248
|
|
|
249
249
|
if (currentEl) {
|
|
250
|
+
// eslint-disable-next-line no-shadow
|
|
250
251
|
const ev = new MouseEvent('click', {
|
|
251
252
|
view: window,
|
|
252
253
|
bubbles: true,
|
|
@@ -288,24 +289,22 @@ export const VSelect = defineComponent({
|
|
|
288
289
|
|
|
289
290
|
return () => {
|
|
290
291
|
const children = ctx.slots.default?.() || [];
|
|
291
|
-
const propGroups = inputControl.propGroups.map((group) =>
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
);
|
|
308
|
-
});
|
|
292
|
+
const propGroups = inputControl.propGroups.map((group) => (
|
|
293
|
+
<VOptionGroup
|
|
294
|
+
key={group.id}
|
|
295
|
+
groupId={group.id}
|
|
296
|
+
label={group.label(inputControl)}
|
|
297
|
+
disabled={group.disabled}>
|
|
298
|
+
{group.items.map((item) => (
|
|
299
|
+
<VOption
|
|
300
|
+
disabled={item.disabled}
|
|
301
|
+
value={item.value}
|
|
302
|
+
key={item.value}>
|
|
303
|
+
{item.label(inputControl)}
|
|
304
|
+
</VOption>
|
|
305
|
+
))}
|
|
306
|
+
</VOptionGroup>
|
|
307
|
+
));
|
|
309
308
|
|
|
310
309
|
const classes = computed(() => [
|
|
311
310
|
'v-select',
|
|
@@ -315,32 +314,28 @@ export const VSelect = defineComponent({
|
|
|
315
314
|
},
|
|
316
315
|
]);
|
|
317
316
|
|
|
318
|
-
const controlDefaultSlot = () =>
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
{
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
</div>
|
|
341
|
-
</div>,
|
|
342
|
-
];
|
|
343
|
-
};
|
|
317
|
+
const controlDefaultSlot = () => [
|
|
318
|
+
<select
|
|
319
|
+
class="v-select__input__element"
|
|
320
|
+
name={inputControl.name}
|
|
321
|
+
tabindex={inputControl.tabindex}
|
|
322
|
+
disabled={inputControl.isDisabled}
|
|
323
|
+
multiple={inputControl.multiple}
|
|
324
|
+
onFocus={inputControl.focusHandler}
|
|
325
|
+
onBlur={inputControl.blurHandler}
|
|
326
|
+
v-model={inputControl.value}>
|
|
327
|
+
{inputControl.items.map((item) => (
|
|
328
|
+
<option value={item.propValue} key={item.propValue}>
|
|
329
|
+
{item.renderDefaultSlot()}
|
|
330
|
+
</option>
|
|
331
|
+
))}
|
|
332
|
+
</select>,
|
|
333
|
+
<div class="v-select__selections">
|
|
334
|
+
<div class="v-select__selections__inner">
|
|
335
|
+
{renderSelections(inputControl.selectedItems)}
|
|
336
|
+
</div>
|
|
337
|
+
</div>,
|
|
338
|
+
];
|
|
344
339
|
|
|
345
340
|
const endAdornmentSlot = () => {
|
|
346
341
|
if (inputControl.itemsLoadFailed) {
|
|
@@ -380,41 +375,39 @@ export const VSelect = defineComponent({
|
|
|
380
375
|
);
|
|
381
376
|
};
|
|
382
377
|
|
|
383
|
-
const menuActivatorSlot = ({ control: menu }: VStackActivatorPayload) =>
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
break;
|
|
404
|
-
}
|
|
405
|
-
t = t.parentElement as HTMLElement;
|
|
378
|
+
const menuActivatorSlot = ({ control: menu }: VStackActivatorPayload) => (
|
|
379
|
+
<VControlField
|
|
380
|
+
class="v-select__input"
|
|
381
|
+
ref={fieldRef}
|
|
382
|
+
loading={inputControl.itemsLoading}
|
|
383
|
+
error={inputControl.itemsLoadFailed}
|
|
384
|
+
startAdornment={props.startAdornment}
|
|
385
|
+
endAdornment={props.endAdornment}
|
|
386
|
+
size={control.size.value}
|
|
387
|
+
focused={menuOpened.value}
|
|
388
|
+
autoHeight={inputControl.multiple}
|
|
389
|
+
onClick={(ev) => {
|
|
390
|
+
if (inputControl.canOperation && !menu.isActive) {
|
|
391
|
+
let t = ev.target as HTMLElement;
|
|
392
|
+
const count = 0;
|
|
393
|
+
let hit = false;
|
|
394
|
+
while (count < 5) {
|
|
395
|
+
if (t.classList.contains('v-select__input')) {
|
|
396
|
+
hit = true;
|
|
397
|
+
break;
|
|
406
398
|
}
|
|
407
|
-
|
|
399
|
+
t = t.parentElement as HTMLElement;
|
|
408
400
|
}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
401
|
+
menu.setActivator(hit ? t : ev).show();
|
|
402
|
+
}
|
|
403
|
+
}}
|
|
404
|
+
v-slots={{
|
|
405
|
+
...ctx.slots,
|
|
406
|
+
default: controlDefaultSlot,
|
|
407
|
+
endAdornment: endAdornmentSlot,
|
|
408
|
+
}}
|
|
409
|
+
/>
|
|
410
|
+
);
|
|
418
411
|
|
|
419
412
|
const menuSlots = {
|
|
420
413
|
activator: menuActivatorSlot,
|
|
@@ -426,26 +419,23 @@ export const VSelect = defineComponent({
|
|
|
426
419
|
),
|
|
427
420
|
};
|
|
428
421
|
|
|
429
|
-
const defaultSlot = () =>
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
);
|
|
443
|
-
};
|
|
422
|
+
const defaultSlot = () => (
|
|
423
|
+
<VMenu
|
|
424
|
+
width="fit"
|
|
425
|
+
maxWidth="fit"
|
|
426
|
+
closeOnNavigation={props.closeOnNavigation}
|
|
427
|
+
distance={0}
|
|
428
|
+
alwaysRender
|
|
429
|
+
v-model={menuOpened.value}
|
|
430
|
+
ref={menuRef}
|
|
431
|
+
onClose={clearKeyFocused}
|
|
432
|
+
v-slots={menuSlots}
|
|
433
|
+
/>
|
|
434
|
+
);
|
|
444
435
|
|
|
445
436
|
return (
|
|
446
437
|
<VFormControl
|
|
447
438
|
nodeControl={inputControl}
|
|
448
|
-
// focused={this.nodeControl.focused}
|
|
449
439
|
class={classes.value}
|
|
450
440
|
label={props.label}
|
|
451
441
|
hint={props.hint}
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
import './VSheetModal.scss';
|
|
2
|
-
import {
|
|
3
|
-
defineComponent,
|
|
4
|
-
// ExtractPropTypes,
|
|
5
|
-
PropType,
|
|
6
|
-
VNodeChild,
|
|
7
|
-
computed,
|
|
8
|
-
} from 'vue';
|
|
2
|
+
import { defineComponent, PropType, VNodeChild, computed } from 'vue';
|
|
9
3
|
import {
|
|
10
4
|
createStackableDefine,
|
|
11
5
|
VStackSlots,
|
|
12
6
|
VStackControl,
|
|
13
7
|
useStackControl,
|
|
14
8
|
} from '@fastkit/vue-stack';
|
|
15
|
-
// import { } from '../schemes';
|
|
16
|
-
// import { useStackControl } from '../composables';
|
|
17
|
-
// import { ExtractPropInput } from '@fastkit/vue-utils';
|
|
18
9
|
|
|
19
10
|
const { props, emits } = createStackableDefine({
|
|
20
11
|
defaultTransition: 'v-sheet-modal',
|
|
@@ -40,6 +31,7 @@ export const VSheetModal = defineComponent({
|
|
|
40
31
|
inheritAttrs: false,
|
|
41
32
|
props: sheetModalProps,
|
|
42
33
|
emits,
|
|
34
|
+
// eslint-disable-next-line no-shadow
|
|
43
35
|
setup(props, ctx) {
|
|
44
36
|
const stackControl = useStackControl(props, ctx, {
|
|
45
37
|
stackType: SHEET_STACK_TYPE,
|
|
@@ -57,32 +49,24 @@ export const VSheetModal = defineComponent({
|
|
|
57
49
|
};
|
|
58
50
|
},
|
|
59
51
|
render() {
|
|
60
|
-
const {
|
|
61
|
-
render,
|
|
62
|
-
// color,
|
|
63
|
-
} = this.stackControl;
|
|
52
|
+
const { render } = this.stackControl;
|
|
64
53
|
const headerSlot = this.$slots.header || this.header;
|
|
65
|
-
return render((children) =>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
</div>
|
|
83
|
-
);
|
|
84
|
-
});
|
|
54
|
+
return render((children) => (
|
|
55
|
+
<div
|
|
56
|
+
class={[
|
|
57
|
+
'v-sheet-modal',
|
|
58
|
+
{
|
|
59
|
+
'v-sheet-modal--has-active-child': this.hasActiveChild,
|
|
60
|
+
},
|
|
61
|
+
]}
|
|
62
|
+
tabindex="0">
|
|
63
|
+
{headerSlot && (
|
|
64
|
+
<div class="v-sheet-modal__header">
|
|
65
|
+
{headerSlot(this.stackControl)}
|
|
66
|
+
</div>
|
|
67
|
+
)}
|
|
68
|
+
<div class="v-sheet-modal__scroller">{children}</div>
|
|
69
|
+
</div>
|
|
70
|
+
));
|
|
85
71
|
},
|
|
86
72
|
});
|
|
87
|
-
|
|
88
|
-
// export type VSheetModalStatic = typeof VSheetModal;
|
|
@@ -5,9 +5,8 @@ import {
|
|
|
5
5
|
createStackActionProps,
|
|
6
6
|
useStackAction,
|
|
7
7
|
} from '@fastkit/vue-stack';
|
|
8
|
-
import { colorSchemeProps } from '@fastkit/vue-color-scheme';
|
|
8
|
+
import { colorSchemeProps, useColorClasses } from '@fastkit/vue-color-scheme';
|
|
9
9
|
import { useVui } from '../../injections';
|
|
10
|
-
import { useColorClasses } from '@fastkit/vue-color-scheme';
|
|
11
10
|
|
|
12
11
|
const colorProps = colorSchemeProps();
|
|
13
12
|
|
|
@@ -24,9 +23,8 @@ export const VSnackbar = defineSnackbarComponent({
|
|
|
24
23
|
resolver: (actions) => {
|
|
25
24
|
if (actions.length === 0) {
|
|
26
25
|
return [vui.stackAction('close')];
|
|
27
|
-
} else {
|
|
28
|
-
return actions;
|
|
29
26
|
}
|
|
27
|
+
return actions;
|
|
30
28
|
},
|
|
31
29
|
});
|
|
32
30
|
const color = useColorClasses(props, { useRootThemeDefault: true });
|
|
@@ -17,6 +17,7 @@ export const VSwitch = defineComponent({
|
|
|
17
17
|
...createControlProps(),
|
|
18
18
|
},
|
|
19
19
|
emits,
|
|
20
|
+
// eslint-disable-next-line no-shadow
|
|
20
21
|
setup(props, ctx) {
|
|
21
22
|
const nodeControl = useFormSelectorItemControl(props, ctx, {
|
|
22
23
|
nodeType: VUI_SWITCH_SYMBOL,
|
|
@@ -51,17 +52,15 @@ export const VSwitch = defineComponent({
|
|
|
51
52
|
control: nodeControl,
|
|
52
53
|
});
|
|
53
54
|
|
|
54
|
-
return () =>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
);
|
|
65
|
-
};
|
|
55
|
+
return () => (
|
|
56
|
+
<VCheckable
|
|
57
|
+
class={classes.value}
|
|
58
|
+
checked={nodeControl.selected}
|
|
59
|
+
invalid={nodeControl.invalid}
|
|
60
|
+
disabled={nodeControl.isDisabled}
|
|
61
|
+
readonly={nodeControl.isReadonly}
|
|
62
|
+
v-slots={slots}
|
|
63
|
+
/>
|
|
64
|
+
);
|
|
66
65
|
},
|
|
67
66
|
});
|
|
@@ -6,9 +6,8 @@ import {
|
|
|
6
6
|
computed,
|
|
7
7
|
ComponentPublicInstance,
|
|
8
8
|
} from 'vue';
|
|
9
|
-
import { RouteLocationRaw } from 'vue-router';
|
|
9
|
+
import { RouteLocationRaw, RouterLink } from 'vue-router';
|
|
10
10
|
import { RawIconProp, resolveRawIconProp } from '../VIcon';
|
|
11
|
-
import { RouterLink } from 'vue-router';
|
|
12
11
|
|
|
13
12
|
export interface VTabExpose {
|
|
14
13
|
value: string;
|
|
@@ -60,28 +59,22 @@ export const VTab = defineComponent({
|
|
|
60
59
|
if (to) {
|
|
61
60
|
const replace = typeof to === 'string' ? undefined : to.replace;
|
|
62
61
|
return (
|
|
63
|
-
<RouterLink
|
|
64
|
-
class={classes}
|
|
65
|
-
to={to}
|
|
66
|
-
replace={replace}
|
|
67
|
-
// disableScrollBehavior
|
|
68
|
-
>
|
|
62
|
+
<RouterLink class={classes} to={to} replace={replace}>
|
|
69
63
|
{children}
|
|
70
64
|
</RouterLink>
|
|
71
65
|
);
|
|
72
|
-
} else {
|
|
73
|
-
return (
|
|
74
|
-
<button
|
|
75
|
-
class={classes}
|
|
76
|
-
type="button"
|
|
77
|
-
value={value}
|
|
78
|
-
onClick={(ev) => {
|
|
79
|
-
ctx.emit('click', ev);
|
|
80
|
-
}}>
|
|
81
|
-
{children}
|
|
82
|
-
</button>
|
|
83
|
-
);
|
|
84
66
|
}
|
|
67
|
+
return (
|
|
68
|
+
<button
|
|
69
|
+
class={classes}
|
|
70
|
+
type="button"
|
|
71
|
+
value={value}
|
|
72
|
+
onClick={(ev) => {
|
|
73
|
+
ctx.emit('click', ev);
|
|
74
|
+
}}>
|
|
75
|
+
{children}
|
|
76
|
+
</button>
|
|
77
|
+
);
|
|
85
78
|
};
|
|
86
79
|
},
|
|
87
80
|
});
|
|
@@ -10,15 +10,15 @@ import {
|
|
|
10
10
|
onBeforeUpdate,
|
|
11
11
|
onMounted,
|
|
12
12
|
} from 'vue';
|
|
13
|
-
import { RawIconProp } from '../VIcon';
|
|
14
|
-
import { VuiService } from '../../service';
|
|
15
|
-
import { useVui } from '../../injections';
|
|
16
13
|
import { defineSlots } from '@fastkit/vue-utils';
|
|
17
14
|
import { RouteLocationRaw, RouteLocation } from 'vue-router';
|
|
18
|
-
import { VTab, VTabRef } from './VTab';
|
|
19
15
|
import { VScroller, ScrollResult } from '@fastkit/vue-scroller';
|
|
20
16
|
import { useScopeColorClass, ScopeName } from '@fastkit/vue-color-scheme';
|
|
21
17
|
import { isPromise } from '@fastkit/helpers';
|
|
18
|
+
import { VTab, VTabRef } from './VTab';
|
|
19
|
+
import { useVui } from '../../injections';
|
|
20
|
+
import { VuiService } from '../../service';
|
|
21
|
+
import { RawIconProp } from '../VIcon';
|
|
22
22
|
|
|
23
23
|
export interface VTabsItemLabelSlotCtx {
|
|
24
24
|
value: string;
|
|
@@ -53,9 +53,6 @@ export const VTabs = defineComponent({
|
|
|
53
53
|
items: {
|
|
54
54
|
type: Array as PropType<VTabsItem[]>,
|
|
55
55
|
required: true,
|
|
56
|
-
// validator: (value: VTabsItem[]) => {
|
|
57
|
-
// return Array.isArray(value) && value.length > 0;
|
|
58
|
-
// },
|
|
59
56
|
},
|
|
60
57
|
|
|
61
58
|
/**
|
|
@@ -127,6 +124,7 @@ export const VTabs = defineComponent({
|
|
|
127
124
|
| undefined;
|
|
128
125
|
|
|
129
126
|
if (router) {
|
|
127
|
+
// eslint-disable-next-line no-shadow
|
|
130
128
|
const to = router(value);
|
|
131
129
|
const route = vui.router.resolve(to);
|
|
132
130
|
location = { to, route };
|
|
@@ -140,12 +138,11 @@ export const VTabs = defineComponent({
|
|
|
140
138
|
});
|
|
141
139
|
});
|
|
142
140
|
|
|
141
|
+
// eslint-disable-next-line no-shadow
|
|
143
142
|
const setTabRef = (ref: VTabRef) => {
|
|
144
143
|
tabRefs.value.push(ref);
|
|
145
144
|
};
|
|
146
145
|
|
|
147
|
-
// const isMountedRef = ref(false);
|
|
148
|
-
|
|
149
146
|
function setupInternalValue(routable?: boolean) {
|
|
150
147
|
let value = props.modelValue;
|
|
151
148
|
if (value == null || value === '') {
|
|
@@ -165,6 +162,7 @@ export const VTabs = defineComponent({
|
|
|
165
162
|
if (!hit) return;
|
|
166
163
|
const { location } = hit;
|
|
167
164
|
if (!location) return;
|
|
165
|
+
// eslint-disable-next-line no-shadow
|
|
168
166
|
const { to, route } = location;
|
|
169
167
|
if (route.fullPath === vui.location.currentRoute.fullPath) return;
|
|
170
168
|
vui.router[to.replace ? 'replace' : 'push'](to);
|
|
@@ -200,9 +198,7 @@ export const VTabs = defineComponent({
|
|
|
200
198
|
}
|
|
201
199
|
}
|
|
202
200
|
|
|
203
|
-
const findTab = (tab: string) =>
|
|
204
|
-
return tabRefs.value.find((t) => t.value === tab);
|
|
205
|
-
};
|
|
201
|
+
const findTab = (tab: string) => tabRefs.value.find((t) => t.value === tab);
|
|
206
202
|
|
|
207
203
|
function scrollToTab(tabValue: string) {
|
|
208
204
|
const tab = findTab(tabValue);
|
|
@@ -267,9 +263,9 @@ export const VTabs = defineComponent({
|
|
|
267
263
|
(route) => {
|
|
268
264
|
if (!props.router) return;
|
|
269
265
|
const path = props.withQuery ? route.fullPath : route.path;
|
|
270
|
-
const hit = computedItemsRef.value.find(
|
|
271
|
-
|
|
272
|
-
|
|
266
|
+
const hit = computedItemsRef.value.find(
|
|
267
|
+
({ location }) => location && location.route.fullPath === path,
|
|
268
|
+
);
|
|
273
269
|
if (hit) {
|
|
274
270
|
currentRef.value = hit.value;
|
|
275
271
|
}
|
|
@@ -299,6 +295,7 @@ export const VTabs = defineComponent({
|
|
|
299
295
|
label = itemSlot;
|
|
300
296
|
}
|
|
301
297
|
|
|
298
|
+
// eslint-disable-next-line no-shadow
|
|
302
299
|
const children =
|
|
303
300
|
typeof label === 'function' ? label({ value, active, vui }) : label;
|
|
304
301
|
|
|
@@ -51,6 +51,7 @@ export const VTextField = defineComponent({
|
|
|
51
51
|
props: createTextFieldProps(),
|
|
52
52
|
emits,
|
|
53
53
|
slots,
|
|
54
|
+
// eslint-disable-next-line no-shadow
|
|
54
55
|
setup(props, ctx) {
|
|
55
56
|
const inputControl = useTextInputNodeControl(props, ctx, {
|
|
56
57
|
nodeType: VUI_TEXT_FIELD_SYMBOL,
|
|
@@ -64,23 +65,21 @@ export const VTextField = defineComponent({
|
|
|
64
65
|
inputControl.focus();
|
|
65
66
|
};
|
|
66
67
|
|
|
67
|
-
const defaultSlot = () =>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
);
|
|
83
|
-
};
|
|
68
|
+
const defaultSlot = () => (
|
|
69
|
+
<VControlField
|
|
70
|
+
class="v-text-field__input"
|
|
71
|
+
startAdornment={props.startAdornment}
|
|
72
|
+
endAdornment={props.endAdornment}
|
|
73
|
+
size={control.size.value}
|
|
74
|
+
v-slots={{
|
|
75
|
+
...ctx.slots,
|
|
76
|
+
default: () =>
|
|
77
|
+
inputControl.createInputElement({
|
|
78
|
+
class: 'v-text-field__input__element',
|
|
79
|
+
}),
|
|
80
|
+
}}
|
|
81
|
+
/>
|
|
82
|
+
);
|
|
84
83
|
|
|
85
84
|
const infoAppendsSlot = () => {
|
|
86
85
|
const { counterResult } = inputControl;
|
|
@@ -92,25 +91,23 @@ export const VTextField = defineComponent({
|
|
|
92
91
|
control: inputControl,
|
|
93
92
|
});
|
|
94
93
|
|
|
95
|
-
return () =>
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
);
|
|
114
|
-
};
|
|
94
|
+
return () => (
|
|
95
|
+
<VFormControl
|
|
96
|
+
nodeControl={inputControl}
|
|
97
|
+
// focused={inputControl.focused}
|
|
98
|
+
hiddenInfo={props.hiddenInfo}
|
|
99
|
+
class={classes.value}
|
|
100
|
+
label={props.label}
|
|
101
|
+
hint={props.hint}
|
|
102
|
+
hinttip={props.hinttip}
|
|
103
|
+
requiredChip={props.requiredChip}
|
|
104
|
+
onClickLabel={handleClickLabel}
|
|
105
|
+
v-slots={{
|
|
106
|
+
...ctx.slots,
|
|
107
|
+
default: defaultSlot,
|
|
108
|
+
infoAppends: infoAppendsSlot,
|
|
109
|
+
}}
|
|
110
|
+
/>
|
|
111
|
+
);
|
|
115
112
|
},
|
|
116
113
|
});
|