@fastkit/vui 0.6.30 → 0.6.34
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/tool/index.js +2 -0
- package/dist/tool/vite-plugin.d.ts.map +1 -1
- package/dist/vui.cjs.js +207 -76
- package/dist/vui.cjs.prod.js +207 -76
- package/dist/vui.css +53 -0
- package/dist/vui.d.ts +269 -180
- package/dist/vui.esm-bundler.js +209 -79
- package/dist/vui.min.css +1 -1
- package/dist/vui.min.css.map +1 -1
- package/package.json +8 -8
package/dist/vui.esm-bundler.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { createPropsOptions, createFormControlSettings, defineSlotsProps, useFormControl, renderSlotOrEmpty, createFormSelectorSettings, createFormControlProps, useFormSelectorControl, createFormSelectorItemSettings, useFormSelectorItemControl, createFormSelectorItemGroupProps, useFormSelectorItemGroupControl, resolveVNodeChildOrSlots, useParentFormNode, VMenu, createTextInputSettings, useTextInputControl, createTextareaSettings, useTextareaControl, createFormSettings, useForm, getDocumentScroller, useVScrollerRef, VScroller, useInjectTheme, VStackRoot, VueColorSchemePlugin, installVueStackPlugin } from '@fastkit/vue-kit';
|
|
2
2
|
export * from '@fastkit/vue-kit';
|
|
3
3
|
export { VDialog, VMenu, VSnackbar } from '@fastkit/vue-kit';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { useRouter, RouterLink, useLink, useRoute } from 'vue-router';
|
|
5
|
+
import { createPropsOptions as createPropsOptions$1, defineSlotsProps as defineSlotsProps$1, renderSlotOrEmpty as renderSlotOrEmpty$1, navigationableInheritProps, VLink, rawNumberPropType, resolveNumberish, resizeDirectiveArgument, VExpandTransition, LocationService, setDefaultRouterLink } from '@fastkit/vue-utils';
|
|
6
|
+
import { inject, computed, provide, defineComponent, createVNode, mergeProps, ref, watch, withDirectives, createTextVNode, isVNode, Fragment, vShow, onBeforeUpdate, vModelSelect, onMounted, onBeforeUnmount, Transition } from 'vue';
|
|
6
7
|
import { useScopeColorClass, colorSchemeProps, useColorClasses, toScopeColorClass } from '@fastkit/vue-color-scheme';
|
|
7
8
|
import { VProgressCircular } from '@fastkit/vue-loading';
|
|
8
9
|
export * from '@fastkit/vue-loading';
|
|
9
10
|
export { ICON_NAMES } from '@fastkit/icon-font';
|
|
10
11
|
import { isPromise } from '@fastkit/helpers';
|
|
11
|
-
import { useRouter, RouterLink, useLink, useRoute } from 'vue-router';
|
|
12
12
|
import { VAppContainer, VAppLayoutControl } from '@fastkit/vue-app-layout';
|
|
13
13
|
import { getDocumentScroller as getDocumentScroller$1 } from '@fastkit/vue-scroller';
|
|
14
14
|
|
|
@@ -434,7 +434,7 @@ function resolveRawVButtonIcon(raw, type = 'main') {
|
|
|
434
434
|
}
|
|
435
435
|
|
|
436
436
|
const vueButtonProps = createPropsOptions$1({ ...colorSchemeProps(),
|
|
437
|
-
...
|
|
437
|
+
...navigationableInheritProps,
|
|
438
438
|
spacer: [Boolean, String],
|
|
439
439
|
loading: Boolean,
|
|
440
440
|
rounded: Boolean,
|
|
@@ -450,9 +450,8 @@ const LOADING_SIZE_MAP = {
|
|
|
450
450
|
};
|
|
451
451
|
const VButton = defineComponent({
|
|
452
452
|
name: 'VButton',
|
|
453
|
+
inheritAttrs: false,
|
|
453
454
|
props: vueButtonProps,
|
|
454
|
-
emits: { ...navigationableEmits
|
|
455
|
-
},
|
|
456
455
|
|
|
457
456
|
setup(props, ctx) {
|
|
458
457
|
const vui = useVui();
|
|
@@ -478,48 +477,25 @@ const VButton = defineComponent({
|
|
|
478
477
|
variant: () => props.variant || (icon.value ? vui.setting('plainVariant') : defaults.variant)
|
|
479
478
|
});
|
|
480
479
|
const isPlain = computed(() => color.variant.value.value === vui.setting('plainVariant') && color.color.value.value === defaults.color);
|
|
481
|
-
const
|
|
482
|
-
|
|
483
|
-
const isDisabled = computed(() => props.disabled);
|
|
480
|
+
const isLoading = computed(() => props.loading); // const isDisabled = computed(() => props.disabled);
|
|
481
|
+
|
|
484
482
|
const isRounded = computed(() => props.rounded || !!icon.value);
|
|
485
483
|
const spacer = computed(() => {
|
|
486
484
|
const _spacer = props.spacer;
|
|
487
485
|
if (!_spacer) return;
|
|
488
486
|
return _spacer === true ? 'left' : _spacer;
|
|
489
487
|
});
|
|
490
|
-
const classes = computed(() => [color.colorClasses.value, navigationable.value.classes,
|
|
488
|
+
const classes = computed(() => [color.colorClasses.value, // navigationable.value.classes,
|
|
489
|
+
spacer.value ? `v-button--spacer-${spacer.value}` : undefined, `v-button--${control.size.value}`, {
|
|
491
490
|
'v-button--loading': isLoading.value,
|
|
492
491
|
'v-button--icon': !!icon.value,
|
|
493
492
|
'v-button--rounded': isRounded.value,
|
|
494
493
|
'v-button--plain': isPlain.value
|
|
495
494
|
}]);
|
|
496
495
|
return () => {
|
|
497
|
-
const
|
|
498
|
-
|
|
499
|
-
attrs
|
|
500
|
-
} = navigationable.value;
|
|
501
|
-
const children = renderSlotOrEmpty$1(ctx.slots, 'default');
|
|
502
|
-
const _attrs = { ...attrs
|
|
503
|
-
};
|
|
504
|
-
|
|
505
|
-
if (isDisabled.value) {
|
|
506
|
-
_attrs.disabled = true;
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
return createVNode(Tag, mergeProps({
|
|
496
|
+
const children = renderSlotOrEmpty$1(ctx.slots);
|
|
497
|
+
return createVNode(VLink, mergeProps(ctx.attrs, {
|
|
510
498
|
"class": ['v-button', classes.value]
|
|
511
|
-
}, _attrs, {
|
|
512
|
-
"onClick": ev => {
|
|
513
|
-
if (isDisabled.value || isLoading.value) {
|
|
514
|
-
ev.preventDefault();
|
|
515
|
-
|
|
516
|
-
if (isDisabled.value) {
|
|
517
|
-
return;
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
ctx.emit('click', ev);
|
|
522
|
-
}
|
|
523
499
|
}), {
|
|
524
500
|
default: () => [createVNode("span", {
|
|
525
501
|
"class": "v-button__content"
|
|
@@ -534,7 +510,7 @@ const VButton = defineComponent({
|
|
|
534
510
|
|
|
535
511
|
});
|
|
536
512
|
|
|
537
|
-
function _isSlot$
|
|
513
|
+
function _isSlot$c(s) {
|
|
538
514
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
539
515
|
}
|
|
540
516
|
|
|
@@ -782,7 +758,7 @@ const VPagination = defineComponent({
|
|
|
782
758
|
"class": classes,
|
|
783
759
|
"to": to,
|
|
784
760
|
"key": key
|
|
785
|
-
}, _isSlot$
|
|
761
|
+
}, _isSlot$c(children) ? children : {
|
|
786
762
|
default: () => [children]
|
|
787
763
|
});
|
|
788
764
|
} else {
|
|
@@ -829,11 +805,11 @@ const VPagination = defineComponent({
|
|
|
829
805
|
|
|
830
806
|
function createListTileProps() {
|
|
831
807
|
const icon = rawIconProp();
|
|
832
|
-
return { ...
|
|
808
|
+
return { ...navigationableInheritProps,
|
|
833
809
|
...createPropsOptions$1({
|
|
834
810
|
startIcon: icon,
|
|
835
811
|
endIcon: icon,
|
|
836
|
-
|
|
812
|
+
linkFallbackTag: {
|
|
837
813
|
type: String,
|
|
838
814
|
default: 'div'
|
|
839
815
|
},
|
|
@@ -843,11 +819,12 @@ function createListTileProps() {
|
|
|
843
819
|
})
|
|
844
820
|
};
|
|
845
821
|
}
|
|
846
|
-
const listTileEmits = {
|
|
822
|
+
const listTileEmits = {
|
|
847
823
|
changeActive: isActive => true
|
|
848
824
|
};
|
|
849
825
|
const VListTile = defineComponent({
|
|
850
826
|
name: 'VListTile',
|
|
827
|
+
inheritAttrs: false,
|
|
851
828
|
props: createListTileProps(),
|
|
852
829
|
emits: { ...listTileEmits
|
|
853
830
|
},
|
|
@@ -863,10 +840,9 @@ const VListTile = defineComponent({
|
|
|
863
840
|
return icon;
|
|
864
841
|
});
|
|
865
842
|
const endIcon = computed(() => resolveRawIconProp(false, props.endIcon));
|
|
866
|
-
const
|
|
867
|
-
const hasTo = computed(() => !!props.to);
|
|
843
|
+
const hasTo = computed(() => !!ctx.attrs.to);
|
|
868
844
|
const link = useLink({
|
|
869
|
-
to:
|
|
845
|
+
to: ctx.attrs.to || ''
|
|
870
846
|
});
|
|
871
847
|
const isActive = computed(() => {
|
|
872
848
|
if (!hasTo.value) return false;
|
|
@@ -876,10 +852,7 @@ const VListTile = defineComponent({
|
|
|
876
852
|
const classes = computed(() => {
|
|
877
853
|
const _color = color.value;
|
|
878
854
|
const hasColor = !!_color.value;
|
|
879
|
-
|
|
880
|
-
const clickable = _navigationable.clickable;
|
|
881
|
-
return [color.value.className, _navigationable.classes, {
|
|
882
|
-
'v-list-tile--clickable': clickable,
|
|
855
|
+
return [color.value.className, {
|
|
883
856
|
'v-list-tile--plain': !hasColor,
|
|
884
857
|
'v-list-tile--has-color': hasColor,
|
|
885
858
|
'v-list-tile--active': isActive.value
|
|
@@ -893,16 +866,9 @@ const VListTile = defineComponent({
|
|
|
893
866
|
return () => {
|
|
894
867
|
const _startIcon = startIcon.value;
|
|
895
868
|
const _endIcon = endIcon.value;
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
} = navigationable.value;
|
|
900
|
-
return createVNode(Tag, mergeProps({
|
|
901
|
-
"class": ['v-list-tile', classes.value]
|
|
902
|
-
}, attrs, {
|
|
903
|
-
"onClick": ev => {
|
|
904
|
-
ctx.emit('click', ev);
|
|
905
|
-
}
|
|
869
|
+
return createVNode(VLink, mergeProps(ctx.attrs, {
|
|
870
|
+
"class": ['v-list-tile', classes.value],
|
|
871
|
+
"clickableClassName": "v-list-tile--clickable"
|
|
906
872
|
}), {
|
|
907
873
|
default: () => [_startIcon && createVNode("span", {
|
|
908
874
|
"class": "v-list-tile__icon v-list-tile__icon--start"
|
|
@@ -947,7 +913,7 @@ const VDrawerLayout = defineComponent({
|
|
|
947
913
|
|
|
948
914
|
});
|
|
949
915
|
|
|
950
|
-
function _isSlot$
|
|
916
|
+
function _isSlot$b(s) {
|
|
951
917
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
952
918
|
}
|
|
953
919
|
|
|
@@ -982,7 +948,7 @@ const VHero = defineComponent({
|
|
|
982
948
|
}, {
|
|
983
949
|
default: () => [createVNode(HTagName, {
|
|
984
950
|
"class": "v-hero__title"
|
|
985
|
-
}, _isSlot$
|
|
951
|
+
}, _isSlot$b(_slot = renderSlotOrEmpty$1(ctx.slots, 'default')) ? _slot : {
|
|
986
952
|
default: () => [_slot]
|
|
987
953
|
})]
|
|
988
954
|
})]
|
|
@@ -992,13 +958,17 @@ const VHero = defineComponent({
|
|
|
992
958
|
|
|
993
959
|
});
|
|
994
960
|
|
|
995
|
-
function _isSlot$
|
|
961
|
+
function _isSlot$a(s) {
|
|
996
962
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
997
963
|
}
|
|
998
964
|
|
|
999
965
|
function createNavigationItemProps() {
|
|
1000
966
|
return { ...createListTileProps(),
|
|
1001
|
-
match: String
|
|
967
|
+
match: String // key: {
|
|
968
|
+
// type: [String, Number],
|
|
969
|
+
// required: true,
|
|
970
|
+
// },
|
|
971
|
+
|
|
1002
972
|
};
|
|
1003
973
|
}
|
|
1004
974
|
function resolveNavigationItemInput(input) {
|
|
@@ -1023,7 +993,7 @@ function renderNavigationItemInput(input, extraProps) {
|
|
|
1023
993
|
} = resolveNavigationItemInput(input);
|
|
1024
994
|
return createVNode(VNavigationItem, { ...props,
|
|
1025
995
|
...extraProps
|
|
1026
|
-
}, _isSlot$
|
|
996
|
+
}, _isSlot$a(label) ? label : {
|
|
1027
997
|
default: () => [label]
|
|
1028
998
|
});
|
|
1029
999
|
}
|
|
@@ -1043,7 +1013,7 @@ const VNavigationItem = defineComponent({
|
|
|
1043
1013
|
const c = props.children;
|
|
1044
1014
|
return c && c.length ? c : undefined;
|
|
1045
1015
|
});
|
|
1046
|
-
const to = computed(() =>
|
|
1016
|
+
const to = computed(() => ctx.attrs.to);
|
|
1047
1017
|
const match = computed(() => {
|
|
1048
1018
|
const {
|
|
1049
1019
|
match,
|
|
@@ -1118,6 +1088,7 @@ const VNavigationItem = defineComponent({
|
|
|
1118
1088
|
});
|
|
1119
1089
|
|
|
1120
1090
|
function open() {
|
|
1091
|
+
if (!children.value) return;
|
|
1121
1092
|
opened.value = true;
|
|
1122
1093
|
}
|
|
1123
1094
|
|
|
@@ -1131,10 +1102,13 @@ const VNavigationItem = defineComponent({
|
|
|
1131
1102
|
|
|
1132
1103
|
const onClick = ev => {
|
|
1133
1104
|
if (!to.value) {
|
|
1134
|
-
toggle();
|
|
1105
|
+
return toggle();
|
|
1135
1106
|
}
|
|
1136
1107
|
|
|
1137
|
-
|
|
1108
|
+
open(); // if (!to.value) {
|
|
1109
|
+
// toggle();
|
|
1110
|
+
// }
|
|
1111
|
+
// ctx.emit('click', ev);
|
|
1138
1112
|
};
|
|
1139
1113
|
|
|
1140
1114
|
const onChangeActive = isActive => {
|
|
@@ -1156,18 +1130,21 @@ const VNavigationItem = defineComponent({
|
|
|
1156
1130
|
ctx.emit('changeActive', isActive);
|
|
1157
1131
|
};
|
|
1158
1132
|
|
|
1133
|
+
ctx.expose({
|
|
1134
|
+
close
|
|
1135
|
+
});
|
|
1159
1136
|
return () => {
|
|
1160
1137
|
let _slot;
|
|
1161
1138
|
|
|
1162
1139
|
const _children = children.value;
|
|
1163
1140
|
const fallbackTag = _children ? 'button' : undefined;
|
|
1164
|
-
return createVNode(Fragment, null, [createVNode(VListTile, mergeProps(_props.value, {
|
|
1141
|
+
return createVNode(Fragment, null, [createVNode(VListTile, mergeProps(ctx.attrs, _props.value, {
|
|
1165
1142
|
"fallbackTag": fallbackTag,
|
|
1166
1143
|
"endIcon": _props.value.endIcon,
|
|
1167
1144
|
"class": ['v-navigation-item', classes.value],
|
|
1168
1145
|
"onClick": onClick,
|
|
1169
1146
|
"onChangeActive": onChangeActive
|
|
1170
|
-
}), _isSlot$
|
|
1147
|
+
}), _isSlot$a(_slot = renderSlotOrEmpty$1(ctx.slots, 'default')) ? _slot : {
|
|
1171
1148
|
default: () => [_slot]
|
|
1172
1149
|
}), _children && createVNode(VExpandTransition, null, {
|
|
1173
1150
|
default: () => [withDirectives(createVNode("div", {
|
|
@@ -1207,6 +1184,28 @@ const VNavigation = defineComponent({
|
|
|
1207
1184
|
const c = props.caption;
|
|
1208
1185
|
return typeof c === 'function' ? c() : c;
|
|
1209
1186
|
});
|
|
1187
|
+
const itemsRef = ref([]);
|
|
1188
|
+
onBeforeUpdate(() => {
|
|
1189
|
+
itemsRef.value = [];
|
|
1190
|
+
});
|
|
1191
|
+
|
|
1192
|
+
function setItemRef(item, itemRef) {
|
|
1193
|
+
itemsRef.value.push({
|
|
1194
|
+
key: item.key,
|
|
1195
|
+
ref: itemRef
|
|
1196
|
+
});
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
function onItemActivated(item) {
|
|
1200
|
+
itemsRef.value.forEach(({
|
|
1201
|
+
key,
|
|
1202
|
+
ref
|
|
1203
|
+
}) => {
|
|
1204
|
+
if (key === item.key) return;
|
|
1205
|
+
ref.close();
|
|
1206
|
+
});
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1210
1209
|
return () => {
|
|
1211
1210
|
const $caption = caption.value;
|
|
1212
1211
|
return createVNode("nav", {
|
|
@@ -1215,7 +1214,17 @@ const VNavigation = defineComponent({
|
|
|
1215
1214
|
"class": "v-navigation__caption"
|
|
1216
1215
|
}, [$caption]), items.value.map(item => renderNavigationItemInput(item, {
|
|
1217
1216
|
class: 'v-navigation__item',
|
|
1218
|
-
startIconEmptySpace: startIconEmptySpace.value
|
|
1217
|
+
startIconEmptySpace: startIconEmptySpace.value,
|
|
1218
|
+
ref: ref => {
|
|
1219
|
+
setItemRef(item, ref);
|
|
1220
|
+
},
|
|
1221
|
+
onChangeActive: isActive => {
|
|
1222
|
+
if (isActive
|
|
1223
|
+
/* && item.children && item.children.length*/
|
|
1224
|
+
) {
|
|
1225
|
+
onItemActivated(item);
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1219
1228
|
}))]);
|
|
1220
1229
|
};
|
|
1221
1230
|
}
|
|
@@ -1315,7 +1324,7 @@ const VCheckbox = defineComponent({
|
|
|
1315
1324
|
|
|
1316
1325
|
});
|
|
1317
1326
|
|
|
1318
|
-
function _isSlot$
|
|
1327
|
+
function _isSlot$9(s) {
|
|
1319
1328
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
1320
1329
|
}
|
|
1321
1330
|
|
|
@@ -1327,7 +1336,7 @@ const VCheckboxGroup = defineFormSelectorComponent({
|
|
|
1327
1336
|
itemRenderer: ({
|
|
1328
1337
|
attrs,
|
|
1329
1338
|
slots
|
|
1330
|
-
}) => createVNode(VCheckbox, attrs, _isSlot$
|
|
1339
|
+
}) => createVNode(VCheckbox, attrs, _isSlot$9(slots) ? slots : {
|
|
1331
1340
|
default: () => [slots]
|
|
1332
1341
|
})
|
|
1333
1342
|
});
|
|
@@ -1379,7 +1388,7 @@ const VRadio = defineComponent({
|
|
|
1379
1388
|
|
|
1380
1389
|
});
|
|
1381
1390
|
|
|
1382
|
-
function _isSlot$
|
|
1391
|
+
function _isSlot$8(s) {
|
|
1383
1392
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
1384
1393
|
}
|
|
1385
1394
|
|
|
@@ -1390,7 +1399,7 @@ const VRadioGroup = defineFormSelectorComponent({
|
|
|
1390
1399
|
itemRenderer: ({
|
|
1391
1400
|
attrs,
|
|
1392
1401
|
slots
|
|
1393
|
-
}) => createVNode(VRadio, attrs, _isSlot$
|
|
1402
|
+
}) => createVNode(VRadio, attrs, _isSlot$8(slots) ? slots : {
|
|
1394
1403
|
default: () => [slots]
|
|
1395
1404
|
})
|
|
1396
1405
|
});
|
|
@@ -1452,7 +1461,7 @@ const VSwitch = defineComponent({
|
|
|
1452
1461
|
|
|
1453
1462
|
});
|
|
1454
1463
|
|
|
1455
|
-
function _isSlot$
|
|
1464
|
+
function _isSlot$7(s) {
|
|
1456
1465
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
1457
1466
|
}
|
|
1458
1467
|
|
|
@@ -1464,7 +1473,7 @@ const VSwitchGroup = defineFormSelectorComponent({
|
|
|
1464
1473
|
itemRenderer: ({
|
|
1465
1474
|
attrs,
|
|
1466
1475
|
slots
|
|
1467
|
-
}) => createVNode(VSwitch, attrs, _isSlot$
|
|
1476
|
+
}) => createVNode(VSwitch, attrs, _isSlot$7(slots) ? slots : {
|
|
1468
1477
|
default: () => [slots]
|
|
1469
1478
|
})
|
|
1470
1479
|
});
|
|
@@ -2023,7 +2032,7 @@ const VForm = defineComponent({
|
|
|
2023
2032
|
|
|
2024
2033
|
});
|
|
2025
2034
|
|
|
2026
|
-
function _isSlot$
|
|
2035
|
+
function _isSlot$6(s) {
|
|
2027
2036
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
2028
2037
|
}
|
|
2029
2038
|
|
|
@@ -2072,7 +2081,7 @@ const VTab = defineComponent({
|
|
|
2072
2081
|
"class": classes,
|
|
2073
2082
|
"to": to,
|
|
2074
2083
|
"replace": replace
|
|
2075
|
-
}, _isSlot$
|
|
2084
|
+
}, _isSlot$6(children) ? children : {
|
|
2076
2085
|
default: () => [children]
|
|
2077
2086
|
});
|
|
2078
2087
|
} else {
|
|
@@ -2090,7 +2099,7 @@ const VTab = defineComponent({
|
|
|
2090
2099
|
|
|
2091
2100
|
});
|
|
2092
2101
|
|
|
2093
|
-
function _isSlot$
|
|
2102
|
+
function _isSlot$5(s) {
|
|
2094
2103
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
2095
2104
|
}
|
|
2096
2105
|
|
|
@@ -2345,7 +2354,7 @@ const VTabs = defineComponent({
|
|
|
2345
2354
|
to(value);
|
|
2346
2355
|
}
|
|
2347
2356
|
}
|
|
2348
|
-
}, _isSlot$
|
|
2357
|
+
}, _isSlot$5(children) ? children : {
|
|
2349
2358
|
default: () => [children]
|
|
2350
2359
|
});
|
|
2351
2360
|
});
|
|
@@ -2367,6 +2376,119 @@ const VTabs = defineComponent({
|
|
|
2367
2376
|
|
|
2368
2377
|
});
|
|
2369
2378
|
|
|
2379
|
+
function _isSlot$4(s) {
|
|
2380
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
2381
|
+
}
|
|
2382
|
+
|
|
2383
|
+
const VBreadcrumbs = defineComponent({
|
|
2384
|
+
name: 'VBreadcrumbs',
|
|
2385
|
+
props: {
|
|
2386
|
+
items: {
|
|
2387
|
+
type: Array,
|
|
2388
|
+
default: () => []
|
|
2389
|
+
},
|
|
2390
|
+
divider: [String, Function] // ...defineSlotsProps<{}>(),
|
|
2391
|
+
|
|
2392
|
+
},
|
|
2393
|
+
|
|
2394
|
+
setup(props, ctx) {
|
|
2395
|
+
const vui = useVui();
|
|
2396
|
+
const computedItemsRef = computed(() => {
|
|
2397
|
+
const items = props.items.map(rawItem => {
|
|
2398
|
+
return typeof rawItem === 'string' ? {
|
|
2399
|
+
text: rawItem
|
|
2400
|
+
} : rawItem;
|
|
2401
|
+
});
|
|
2402
|
+
return items.map(item => {
|
|
2403
|
+
const {
|
|
2404
|
+
to,
|
|
2405
|
+
text
|
|
2406
|
+
} = item;
|
|
2407
|
+
const {
|
|
2408
|
+
disabled = vui.location.match(to) || !vui.location.isAvairable(to)
|
|
2409
|
+
} = item;
|
|
2410
|
+
return { ...item,
|
|
2411
|
+
disabled,
|
|
2412
|
+
text: typeof text === 'function' ? text(vui) : text
|
|
2413
|
+
};
|
|
2414
|
+
});
|
|
2415
|
+
});
|
|
2416
|
+
const lengthRef = computed(() => computedItemsRef.value.length);
|
|
2417
|
+
|
|
2418
|
+
const defaultDividerSlot = () => {
|
|
2419
|
+
return [createVNode("i", {
|
|
2420
|
+
"class": "v-breadcrumbs__divider__icon"
|
|
2421
|
+
}, null)];
|
|
2422
|
+
};
|
|
2423
|
+
|
|
2424
|
+
return () => {
|
|
2425
|
+
if (lengthRef.value < 1) return;
|
|
2426
|
+
let dividerSlot;
|
|
2427
|
+
const propDivider = props.divider;
|
|
2428
|
+
|
|
2429
|
+
if (propDivider) {
|
|
2430
|
+
dividerSlot = typeof propDivider === 'function' ? propDivider : () => propDivider;
|
|
2431
|
+
} else {
|
|
2432
|
+
dividerSlot = defaultDividerSlot;
|
|
2433
|
+
}
|
|
2434
|
+
|
|
2435
|
+
const children = [];
|
|
2436
|
+
computedItemsRef.value.forEach((item, index) => {
|
|
2437
|
+
const {
|
|
2438
|
+
text,
|
|
2439
|
+
icon,
|
|
2440
|
+
disabled,
|
|
2441
|
+
to
|
|
2442
|
+
} = item;
|
|
2443
|
+
|
|
2444
|
+
if (index > 0) {
|
|
2445
|
+
const divider = dividerSlot(vui);
|
|
2446
|
+
|
|
2447
|
+
if (divider) {
|
|
2448
|
+
children.push(createVNode("li", {
|
|
2449
|
+
"class": "v-breadcrumbs__divider",
|
|
2450
|
+
"key": `divider-${index}`
|
|
2451
|
+
}, [divider]));
|
|
2452
|
+
}
|
|
2453
|
+
}
|
|
2454
|
+
|
|
2455
|
+
const myChildren = [];
|
|
2456
|
+
|
|
2457
|
+
if (icon) {
|
|
2458
|
+
const $icon = resolveRawIconProp(false, icon, {
|
|
2459
|
+
class: 'v-breadcrumbs__icon'
|
|
2460
|
+
});
|
|
2461
|
+
|
|
2462
|
+
if ($icon) {
|
|
2463
|
+
myChildren.push($icon);
|
|
2464
|
+
}
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2467
|
+
if (text) myChildren.push(text);
|
|
2468
|
+
const itemChild = to ? createVNode(VLink, {
|
|
2469
|
+
"class": "v-breadcrumbs__link",
|
|
2470
|
+
"to": to,
|
|
2471
|
+
"exactActiveClass": "v-breadcrumbs__link--active"
|
|
2472
|
+
}, _isSlot$4(myChildren) ? myChildren : {
|
|
2473
|
+
default: () => [myChildren]
|
|
2474
|
+
}) : myChildren;
|
|
2475
|
+
children.push(createVNode("li", {
|
|
2476
|
+
"class": ['v-breadcrumbs__item', {
|
|
2477
|
+
'v-breadcrumbs__item--disabled': disabled
|
|
2478
|
+
}],
|
|
2479
|
+
"key": `link-${index}`
|
|
2480
|
+
}, [itemChild]));
|
|
2481
|
+
});
|
|
2482
|
+
return createVNode("nav", {
|
|
2483
|
+
"class": "v-breadcrumbs"
|
|
2484
|
+
}, [createVNode("ul", {
|
|
2485
|
+
"class": "v-breadcrumbs__list"
|
|
2486
|
+
}, [children])]);
|
|
2487
|
+
};
|
|
2488
|
+
}
|
|
2489
|
+
|
|
2490
|
+
});
|
|
2491
|
+
|
|
2370
2492
|
function _isSlot$3(s) {
|
|
2371
2493
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
2372
2494
|
}
|
|
@@ -3273,6 +3395,7 @@ class VuiService {
|
|
|
3273
3395
|
location;
|
|
3274
3396
|
constructor(options) {
|
|
3275
3397
|
this.options = options;
|
|
3398
|
+
this.configure();
|
|
3276
3399
|
const { selectionSeparator = () => ', ', autoScrollToElementOffsetTop = DEFAULT_AUTO_SCROLL_TO_ELEMENT_OFFSET_TOP, textareaRows = DEFAULT_TEXTAREA_ROWS, requiredChip = () => '*', } = options;
|
|
3277
3400
|
this.selectionSeparator = selectionSeparator;
|
|
3278
3401
|
this.autoScrollToElementOffsetTop = autoScrollToElementOffsetTop;
|
|
@@ -3283,6 +3406,13 @@ class VuiService {
|
|
|
3283
3406
|
router: this.router,
|
|
3284
3407
|
});
|
|
3285
3408
|
}
|
|
3409
|
+
configure(options) {
|
|
3410
|
+
options && Object.assign(this.options, options);
|
|
3411
|
+
setDefaultRouterLink(this.getRouterLink());
|
|
3412
|
+
}
|
|
3413
|
+
getRouterLink() {
|
|
3414
|
+
return this.options.RouterLink || RouterLink;
|
|
3415
|
+
}
|
|
3286
3416
|
setting(key) {
|
|
3287
3417
|
return this.options.uiSettings[key];
|
|
3288
3418
|
}
|
|
@@ -3359,4 +3489,4 @@ function installVuiPlugin(app, opts) {
|
|
|
3359
3489
|
return app.use(VuiPlugin, opts);
|
|
3360
3490
|
}
|
|
3361
3491
|
|
|
3362
|
-
export { CONTROL_FIELD_VARIANTS, CONTROL_SIZES, PAGINATION_ALIGNS, VApp, VButton, VCard, VCardActions, VCardContent, VCheckbox, VCheckboxGroup, VContentSwitcher, VDataTable, VDrawerLayout, VForm, VHero, VIcon, VListTile, VNavigation, VNavigationItem, VOption, VOptionGroup, VPagination, VPaper, VRadio, VRadioGroup, VSelect, VSwitch, VSwitchGroup, VTabs, VTextField, VTextarea, VToolbar, VToolbarEdge, VToolbarMenu, VToolbarTitle, VUI_CHECKBOX_GROUP_SYMBOL, VUI_CHECKBOX_SYMBOL, VUI_FORM_SYMBOL, VUI_OPTION_SYMBOL, VUI_RADIO_GROUP_SYMBOL, VUI_RADIO_SYMBOL, VUI_SELECT_SYMBOL, VUI_SWITCH_GROUP_SYMBOL, VUI_SWITCH_SYMBOL, VUI_TEXTAREA_SYMBOL, VUI_TEXT_FIELD_SYMBOL, VuiColorProviderInjectionKey, VuiControlFieldInjectionKey, VuiControlInjectionKey, VuiInjectionKey, VuiPlugin, VuiService, configureDataTableDefaults, createCardProps, createControlFieldProviderProps, createControlProps, createElevationProps, createListTileProps, createNavigationItemProps, createPaperBaseProps, createPaperProps, defineFormSelectorComponent, iconProps, installVuiPlugin, listTileEmits, paginationProps, rawIconProp, renderNavigationItemInput, resolveNavigationItemInput, resolveRawIconProp, useControl, useControlField, useElevation, useVui, useVuiColorProvider, vueButtonProps };
|
|
3492
|
+
export { CONTROL_FIELD_VARIANTS, CONTROL_SIZES, PAGINATION_ALIGNS, VApp, VBreadcrumbs, VButton, VCard, VCardActions, VCardContent, VCheckbox, VCheckboxGroup, VContentSwitcher, VDataTable, VDrawerLayout, VForm, VHero, VIcon, VListTile, VNavigation, VNavigationItem, VOption, VOptionGroup, VPagination, VPaper, VRadio, VRadioGroup, VSelect, VSwitch, VSwitchGroup, VTabs, VTextField, VTextarea, VToolbar, VToolbarEdge, VToolbarMenu, VToolbarTitle, VUI_CHECKBOX_GROUP_SYMBOL, VUI_CHECKBOX_SYMBOL, VUI_FORM_SYMBOL, VUI_OPTION_SYMBOL, VUI_RADIO_GROUP_SYMBOL, VUI_RADIO_SYMBOL, VUI_SELECT_SYMBOL, VUI_SWITCH_GROUP_SYMBOL, VUI_SWITCH_SYMBOL, VUI_TEXTAREA_SYMBOL, VUI_TEXT_FIELD_SYMBOL, VuiColorProviderInjectionKey, VuiControlFieldInjectionKey, VuiControlInjectionKey, VuiInjectionKey, VuiPlugin, VuiService, configureDataTableDefaults, createCardProps, createControlFieldProviderProps, createControlProps, createElevationProps, createListTileProps, createNavigationItemProps, createPaperBaseProps, createPaperProps, defineFormSelectorComponent, iconProps, installVuiPlugin, listTileEmits, paginationProps, rawIconProp, renderNavigationItemInput, resolveNavigationItemInput, resolveRawIconProp, useControl, useControlField, useElevation, useVui, useVuiColorProvider, vueButtonProps };
|