@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.cjs.prod.js
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var vueKit = require('@fastkit/vue-kit');
|
|
6
|
+
var vueRouter = require('vue-router');
|
|
6
7
|
var vueUtils = require('@fastkit/vue-utils');
|
|
7
8
|
var vue = require('vue');
|
|
8
9
|
var vueColorScheme = require('@fastkit/vue-color-scheme');
|
|
9
10
|
var vueLoading = require('@fastkit/vue-loading');
|
|
10
11
|
var iconFont = require('@fastkit/icon-font');
|
|
11
12
|
var helpers = require('@fastkit/helpers');
|
|
12
|
-
var vueRouter = require('vue-router');
|
|
13
13
|
var vueAppLayout = require('@fastkit/vue-app-layout');
|
|
14
14
|
var vueScroller = require('@fastkit/vue-scroller');
|
|
15
15
|
|
|
@@ -435,7 +435,7 @@ function resolveRawVButtonIcon(raw, type = 'main') {
|
|
|
435
435
|
}
|
|
436
436
|
|
|
437
437
|
const vueButtonProps = vueUtils.createPropsOptions({ ...vueColorScheme.colorSchemeProps(),
|
|
438
|
-
...vueUtils.
|
|
438
|
+
...vueUtils.navigationableInheritProps,
|
|
439
439
|
spacer: [Boolean, String],
|
|
440
440
|
loading: Boolean,
|
|
441
441
|
rounded: Boolean,
|
|
@@ -451,9 +451,8 @@ const LOADING_SIZE_MAP = {
|
|
|
451
451
|
};
|
|
452
452
|
const VButton = vue.defineComponent({
|
|
453
453
|
name: 'VButton',
|
|
454
|
+
inheritAttrs: false,
|
|
454
455
|
props: vueButtonProps,
|
|
455
|
-
emits: { ...vueUtils.navigationableEmits
|
|
456
|
-
},
|
|
457
456
|
|
|
458
457
|
setup(props, ctx) {
|
|
459
458
|
const vui = useVui();
|
|
@@ -479,48 +478,25 @@ const VButton = vue.defineComponent({
|
|
|
479
478
|
variant: () => props.variant || (icon.value ? vui.setting('plainVariant') : defaults.variant)
|
|
480
479
|
});
|
|
481
480
|
const isPlain = vue.computed(() => color.variant.value.value === vui.setting('plainVariant') && color.color.value.value === defaults.color);
|
|
482
|
-
const
|
|
483
|
-
|
|
484
|
-
const isDisabled = vue.computed(() => props.disabled);
|
|
481
|
+
const isLoading = vue.computed(() => props.loading); // const isDisabled = computed(() => props.disabled);
|
|
482
|
+
|
|
485
483
|
const isRounded = vue.computed(() => props.rounded || !!icon.value);
|
|
486
484
|
const spacer = vue.computed(() => {
|
|
487
485
|
const _spacer = props.spacer;
|
|
488
486
|
if (!_spacer) return;
|
|
489
487
|
return _spacer === true ? 'left' : _spacer;
|
|
490
488
|
});
|
|
491
|
-
const classes = vue.computed(() => [color.colorClasses.value, navigationable.value.classes,
|
|
489
|
+
const classes = vue.computed(() => [color.colorClasses.value, // navigationable.value.classes,
|
|
490
|
+
spacer.value ? `v-button--spacer-${spacer.value}` : undefined, `v-button--${control.size.value}`, {
|
|
492
491
|
'v-button--loading': isLoading.value,
|
|
493
492
|
'v-button--icon': !!icon.value,
|
|
494
493
|
'v-button--rounded': isRounded.value,
|
|
495
494
|
'v-button--plain': isPlain.value
|
|
496
495
|
}]);
|
|
497
496
|
return () => {
|
|
498
|
-
const
|
|
499
|
-
|
|
500
|
-
attrs
|
|
501
|
-
} = navigationable.value;
|
|
502
|
-
const children = vueUtils.renderSlotOrEmpty(ctx.slots, 'default');
|
|
503
|
-
const _attrs = { ...attrs
|
|
504
|
-
};
|
|
505
|
-
|
|
506
|
-
if (isDisabled.value) {
|
|
507
|
-
_attrs.disabled = true;
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
return vue.createVNode(Tag, vue.mergeProps({
|
|
497
|
+
const children = vueUtils.renderSlotOrEmpty(ctx.slots);
|
|
498
|
+
return vue.createVNode(vueUtils.VLink, vue.mergeProps(ctx.attrs, {
|
|
511
499
|
"class": ['v-button', classes.value]
|
|
512
|
-
}, _attrs, {
|
|
513
|
-
"onClick": ev => {
|
|
514
|
-
if (isDisabled.value || isLoading.value) {
|
|
515
|
-
ev.preventDefault();
|
|
516
|
-
|
|
517
|
-
if (isDisabled.value) {
|
|
518
|
-
return;
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
ctx.emit('click', ev);
|
|
523
|
-
}
|
|
524
500
|
}), {
|
|
525
501
|
default: () => [vue.createVNode("span", {
|
|
526
502
|
"class": "v-button__content"
|
|
@@ -535,7 +511,7 @@ const VButton = vue.defineComponent({
|
|
|
535
511
|
|
|
536
512
|
});
|
|
537
513
|
|
|
538
|
-
function _isSlot$
|
|
514
|
+
function _isSlot$c(s) {
|
|
539
515
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
540
516
|
}
|
|
541
517
|
|
|
@@ -783,7 +759,7 @@ const VPagination = vue.defineComponent({
|
|
|
783
759
|
"class": classes,
|
|
784
760
|
"to": to,
|
|
785
761
|
"key": key
|
|
786
|
-
}, _isSlot$
|
|
762
|
+
}, _isSlot$c(children) ? children : {
|
|
787
763
|
default: () => [children]
|
|
788
764
|
});
|
|
789
765
|
} else {
|
|
@@ -830,11 +806,11 @@ const VPagination = vue.defineComponent({
|
|
|
830
806
|
|
|
831
807
|
function createListTileProps() {
|
|
832
808
|
const icon = rawIconProp();
|
|
833
|
-
return { ...vueUtils.
|
|
809
|
+
return { ...vueUtils.navigationableInheritProps,
|
|
834
810
|
...vueUtils.createPropsOptions({
|
|
835
811
|
startIcon: icon,
|
|
836
812
|
endIcon: icon,
|
|
837
|
-
|
|
813
|
+
linkFallbackTag: {
|
|
838
814
|
type: String,
|
|
839
815
|
default: 'div'
|
|
840
816
|
},
|
|
@@ -844,11 +820,12 @@ function createListTileProps() {
|
|
|
844
820
|
})
|
|
845
821
|
};
|
|
846
822
|
}
|
|
847
|
-
const listTileEmits = {
|
|
823
|
+
const listTileEmits = {
|
|
848
824
|
changeActive: isActive => true
|
|
849
825
|
};
|
|
850
826
|
const VListTile = vue.defineComponent({
|
|
851
827
|
name: 'VListTile',
|
|
828
|
+
inheritAttrs: false,
|
|
852
829
|
props: createListTileProps(),
|
|
853
830
|
emits: { ...listTileEmits
|
|
854
831
|
},
|
|
@@ -864,10 +841,9 @@ const VListTile = vue.defineComponent({
|
|
|
864
841
|
return icon;
|
|
865
842
|
});
|
|
866
843
|
const endIcon = vue.computed(() => resolveRawIconProp(false, props.endIcon));
|
|
867
|
-
const
|
|
868
|
-
const hasTo = vue.computed(() => !!props.to);
|
|
844
|
+
const hasTo = vue.computed(() => !!ctx.attrs.to);
|
|
869
845
|
const link = vueRouter.useLink({
|
|
870
|
-
to:
|
|
846
|
+
to: ctx.attrs.to || ''
|
|
871
847
|
});
|
|
872
848
|
const isActive = vue.computed(() => {
|
|
873
849
|
if (!hasTo.value) return false;
|
|
@@ -877,10 +853,7 @@ const VListTile = vue.defineComponent({
|
|
|
877
853
|
const classes = vue.computed(() => {
|
|
878
854
|
const _color = color.value;
|
|
879
855
|
const hasColor = !!_color.value;
|
|
880
|
-
|
|
881
|
-
const clickable = _navigationable.clickable;
|
|
882
|
-
return [color.value.className, _navigationable.classes, {
|
|
883
|
-
'v-list-tile--clickable': clickable,
|
|
856
|
+
return [color.value.className, {
|
|
884
857
|
'v-list-tile--plain': !hasColor,
|
|
885
858
|
'v-list-tile--has-color': hasColor,
|
|
886
859
|
'v-list-tile--active': isActive.value
|
|
@@ -894,16 +867,9 @@ const VListTile = vue.defineComponent({
|
|
|
894
867
|
return () => {
|
|
895
868
|
const _startIcon = startIcon.value;
|
|
896
869
|
const _endIcon = endIcon.value;
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
} = navigationable.value;
|
|
901
|
-
return vue.createVNode(Tag, vue.mergeProps({
|
|
902
|
-
"class": ['v-list-tile', classes.value]
|
|
903
|
-
}, attrs, {
|
|
904
|
-
"onClick": ev => {
|
|
905
|
-
ctx.emit('click', ev);
|
|
906
|
-
}
|
|
870
|
+
return vue.createVNode(vueUtils.VLink, vue.mergeProps(ctx.attrs, {
|
|
871
|
+
"class": ['v-list-tile', classes.value],
|
|
872
|
+
"clickableClassName": "v-list-tile--clickable"
|
|
907
873
|
}), {
|
|
908
874
|
default: () => [_startIcon && vue.createVNode("span", {
|
|
909
875
|
"class": "v-list-tile__icon v-list-tile__icon--start"
|
|
@@ -948,7 +914,7 @@ const VDrawerLayout = vue.defineComponent({
|
|
|
948
914
|
|
|
949
915
|
});
|
|
950
916
|
|
|
951
|
-
function _isSlot$
|
|
917
|
+
function _isSlot$b(s) {
|
|
952
918
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
953
919
|
}
|
|
954
920
|
|
|
@@ -983,7 +949,7 @@ const VHero = vue.defineComponent({
|
|
|
983
949
|
}, {
|
|
984
950
|
default: () => [vue.createVNode(HTagName, {
|
|
985
951
|
"class": "v-hero__title"
|
|
986
|
-
}, _isSlot$
|
|
952
|
+
}, _isSlot$b(_slot = vueUtils.renderSlotOrEmpty(ctx.slots, 'default')) ? _slot : {
|
|
987
953
|
default: () => [_slot]
|
|
988
954
|
})]
|
|
989
955
|
})]
|
|
@@ -993,13 +959,17 @@ const VHero = vue.defineComponent({
|
|
|
993
959
|
|
|
994
960
|
});
|
|
995
961
|
|
|
996
|
-
function _isSlot$
|
|
962
|
+
function _isSlot$a(s) {
|
|
997
963
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
998
964
|
}
|
|
999
965
|
|
|
1000
966
|
function createNavigationItemProps() {
|
|
1001
967
|
return { ...createListTileProps(),
|
|
1002
|
-
match: String
|
|
968
|
+
match: String // key: {
|
|
969
|
+
// type: [String, Number],
|
|
970
|
+
// required: true,
|
|
971
|
+
// },
|
|
972
|
+
|
|
1003
973
|
};
|
|
1004
974
|
}
|
|
1005
975
|
function resolveNavigationItemInput(input) {
|
|
@@ -1024,7 +994,7 @@ function renderNavigationItemInput(input, extraProps) {
|
|
|
1024
994
|
} = resolveNavigationItemInput(input);
|
|
1025
995
|
return vue.createVNode(VNavigationItem, { ...props,
|
|
1026
996
|
...extraProps
|
|
1027
|
-
}, _isSlot$
|
|
997
|
+
}, _isSlot$a(label) ? label : {
|
|
1028
998
|
default: () => [label]
|
|
1029
999
|
});
|
|
1030
1000
|
}
|
|
@@ -1044,7 +1014,7 @@ const VNavigationItem = vue.defineComponent({
|
|
|
1044
1014
|
const c = props.children;
|
|
1045
1015
|
return c && c.length ? c : undefined;
|
|
1046
1016
|
});
|
|
1047
|
-
const to = vue.computed(() =>
|
|
1017
|
+
const to = vue.computed(() => ctx.attrs.to);
|
|
1048
1018
|
const match = vue.computed(() => {
|
|
1049
1019
|
const {
|
|
1050
1020
|
match,
|
|
@@ -1119,6 +1089,7 @@ const VNavigationItem = vue.defineComponent({
|
|
|
1119
1089
|
});
|
|
1120
1090
|
|
|
1121
1091
|
function open() {
|
|
1092
|
+
if (!children.value) return;
|
|
1122
1093
|
opened.value = true;
|
|
1123
1094
|
}
|
|
1124
1095
|
|
|
@@ -1132,10 +1103,13 @@ const VNavigationItem = vue.defineComponent({
|
|
|
1132
1103
|
|
|
1133
1104
|
const onClick = ev => {
|
|
1134
1105
|
if (!to.value) {
|
|
1135
|
-
toggle();
|
|
1106
|
+
return toggle();
|
|
1136
1107
|
}
|
|
1137
1108
|
|
|
1138
|
-
|
|
1109
|
+
open(); // if (!to.value) {
|
|
1110
|
+
// toggle();
|
|
1111
|
+
// }
|
|
1112
|
+
// ctx.emit('click', ev);
|
|
1139
1113
|
};
|
|
1140
1114
|
|
|
1141
1115
|
const onChangeActive = isActive => {
|
|
@@ -1157,18 +1131,21 @@ const VNavigationItem = vue.defineComponent({
|
|
|
1157
1131
|
ctx.emit('changeActive', isActive);
|
|
1158
1132
|
};
|
|
1159
1133
|
|
|
1134
|
+
ctx.expose({
|
|
1135
|
+
close
|
|
1136
|
+
});
|
|
1160
1137
|
return () => {
|
|
1161
1138
|
let _slot;
|
|
1162
1139
|
|
|
1163
1140
|
const _children = children.value;
|
|
1164
1141
|
const fallbackTag = _children ? 'button' : undefined;
|
|
1165
|
-
return vue.createVNode(vue.Fragment, null, [vue.createVNode(VListTile, vue.mergeProps(_props.value, {
|
|
1142
|
+
return vue.createVNode(vue.Fragment, null, [vue.createVNode(VListTile, vue.mergeProps(ctx.attrs, _props.value, {
|
|
1166
1143
|
"fallbackTag": fallbackTag,
|
|
1167
1144
|
"endIcon": _props.value.endIcon,
|
|
1168
1145
|
"class": ['v-navigation-item', classes.value],
|
|
1169
1146
|
"onClick": onClick,
|
|
1170
1147
|
"onChangeActive": onChangeActive
|
|
1171
|
-
}), _isSlot$
|
|
1148
|
+
}), _isSlot$a(_slot = vueUtils.renderSlotOrEmpty(ctx.slots, 'default')) ? _slot : {
|
|
1172
1149
|
default: () => [_slot]
|
|
1173
1150
|
}), _children && vue.createVNode(vueUtils.VExpandTransition, null, {
|
|
1174
1151
|
default: () => [vue.withDirectives(vue.createVNode("div", {
|
|
@@ -1208,6 +1185,28 @@ const VNavigation = vue.defineComponent({
|
|
|
1208
1185
|
const c = props.caption;
|
|
1209
1186
|
return typeof c === 'function' ? c() : c;
|
|
1210
1187
|
});
|
|
1188
|
+
const itemsRef = vue.ref([]);
|
|
1189
|
+
vue.onBeforeUpdate(() => {
|
|
1190
|
+
itemsRef.value = [];
|
|
1191
|
+
});
|
|
1192
|
+
|
|
1193
|
+
function setItemRef(item, itemRef) {
|
|
1194
|
+
itemsRef.value.push({
|
|
1195
|
+
key: item.key,
|
|
1196
|
+
ref: itemRef
|
|
1197
|
+
});
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
function onItemActivated(item) {
|
|
1201
|
+
itemsRef.value.forEach(({
|
|
1202
|
+
key,
|
|
1203
|
+
ref
|
|
1204
|
+
}) => {
|
|
1205
|
+
if (key === item.key) return;
|
|
1206
|
+
ref.close();
|
|
1207
|
+
});
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1211
1210
|
return () => {
|
|
1212
1211
|
const $caption = caption.value;
|
|
1213
1212
|
return vue.createVNode("nav", {
|
|
@@ -1216,7 +1215,17 @@ const VNavigation = vue.defineComponent({
|
|
|
1216
1215
|
"class": "v-navigation__caption"
|
|
1217
1216
|
}, [$caption]), items.value.map(item => renderNavigationItemInput(item, {
|
|
1218
1217
|
class: 'v-navigation__item',
|
|
1219
|
-
startIconEmptySpace: startIconEmptySpace.value
|
|
1218
|
+
startIconEmptySpace: startIconEmptySpace.value,
|
|
1219
|
+
ref: ref => {
|
|
1220
|
+
setItemRef(item, ref);
|
|
1221
|
+
},
|
|
1222
|
+
onChangeActive: isActive => {
|
|
1223
|
+
if (isActive
|
|
1224
|
+
/* && item.children && item.children.length*/
|
|
1225
|
+
) {
|
|
1226
|
+
onItemActivated(item);
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1220
1229
|
}))]);
|
|
1221
1230
|
};
|
|
1222
1231
|
}
|
|
@@ -1316,7 +1325,7 @@ const VCheckbox = vue.defineComponent({
|
|
|
1316
1325
|
|
|
1317
1326
|
});
|
|
1318
1327
|
|
|
1319
|
-
function _isSlot$
|
|
1328
|
+
function _isSlot$9(s) {
|
|
1320
1329
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
1321
1330
|
}
|
|
1322
1331
|
|
|
@@ -1328,7 +1337,7 @@ const VCheckboxGroup = defineFormSelectorComponent({
|
|
|
1328
1337
|
itemRenderer: ({
|
|
1329
1338
|
attrs,
|
|
1330
1339
|
slots
|
|
1331
|
-
}) => vue.createVNode(VCheckbox, attrs, _isSlot$
|
|
1340
|
+
}) => vue.createVNode(VCheckbox, attrs, _isSlot$9(slots) ? slots : {
|
|
1332
1341
|
default: () => [slots]
|
|
1333
1342
|
})
|
|
1334
1343
|
});
|
|
@@ -1380,7 +1389,7 @@ const VRadio = vue.defineComponent({
|
|
|
1380
1389
|
|
|
1381
1390
|
});
|
|
1382
1391
|
|
|
1383
|
-
function _isSlot$
|
|
1392
|
+
function _isSlot$8(s) {
|
|
1384
1393
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
1385
1394
|
}
|
|
1386
1395
|
|
|
@@ -1391,7 +1400,7 @@ const VRadioGroup = defineFormSelectorComponent({
|
|
|
1391
1400
|
itemRenderer: ({
|
|
1392
1401
|
attrs,
|
|
1393
1402
|
slots
|
|
1394
|
-
}) => vue.createVNode(VRadio, attrs, _isSlot$
|
|
1403
|
+
}) => vue.createVNode(VRadio, attrs, _isSlot$8(slots) ? slots : {
|
|
1395
1404
|
default: () => [slots]
|
|
1396
1405
|
})
|
|
1397
1406
|
});
|
|
@@ -1453,7 +1462,7 @@ const VSwitch = vue.defineComponent({
|
|
|
1453
1462
|
|
|
1454
1463
|
});
|
|
1455
1464
|
|
|
1456
|
-
function _isSlot$
|
|
1465
|
+
function _isSlot$7(s) {
|
|
1457
1466
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
1458
1467
|
}
|
|
1459
1468
|
|
|
@@ -1465,7 +1474,7 @@ const VSwitchGroup = defineFormSelectorComponent({
|
|
|
1465
1474
|
itemRenderer: ({
|
|
1466
1475
|
attrs,
|
|
1467
1476
|
slots
|
|
1468
|
-
}) => vue.createVNode(VSwitch, attrs, _isSlot$
|
|
1477
|
+
}) => vue.createVNode(VSwitch, attrs, _isSlot$7(slots) ? slots : {
|
|
1469
1478
|
default: () => [slots]
|
|
1470
1479
|
})
|
|
1471
1480
|
});
|
|
@@ -2024,7 +2033,7 @@ const VForm = vue.defineComponent({
|
|
|
2024
2033
|
|
|
2025
2034
|
});
|
|
2026
2035
|
|
|
2027
|
-
function _isSlot$
|
|
2036
|
+
function _isSlot$6(s) {
|
|
2028
2037
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
2029
2038
|
}
|
|
2030
2039
|
|
|
@@ -2073,7 +2082,7 @@ const VTab = vue.defineComponent({
|
|
|
2073
2082
|
"class": classes,
|
|
2074
2083
|
"to": to,
|
|
2075
2084
|
"replace": replace
|
|
2076
|
-
}, _isSlot$
|
|
2085
|
+
}, _isSlot$6(children) ? children : {
|
|
2077
2086
|
default: () => [children]
|
|
2078
2087
|
});
|
|
2079
2088
|
} else {
|
|
@@ -2091,7 +2100,7 @@ const VTab = vue.defineComponent({
|
|
|
2091
2100
|
|
|
2092
2101
|
});
|
|
2093
2102
|
|
|
2094
|
-
function _isSlot$
|
|
2103
|
+
function _isSlot$5(s) {
|
|
2095
2104
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
2096
2105
|
}
|
|
2097
2106
|
|
|
@@ -2346,7 +2355,7 @@ const VTabs = vue.defineComponent({
|
|
|
2346
2355
|
to(value);
|
|
2347
2356
|
}
|
|
2348
2357
|
}
|
|
2349
|
-
}, _isSlot$
|
|
2358
|
+
}, _isSlot$5(children) ? children : {
|
|
2350
2359
|
default: () => [children]
|
|
2351
2360
|
});
|
|
2352
2361
|
});
|
|
@@ -2368,6 +2377,119 @@ const VTabs = vue.defineComponent({
|
|
|
2368
2377
|
|
|
2369
2378
|
});
|
|
2370
2379
|
|
|
2380
|
+
function _isSlot$4(s) {
|
|
2381
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
2382
|
+
}
|
|
2383
|
+
|
|
2384
|
+
const VBreadcrumbs = vue.defineComponent({
|
|
2385
|
+
name: 'VBreadcrumbs',
|
|
2386
|
+
props: {
|
|
2387
|
+
items: {
|
|
2388
|
+
type: Array,
|
|
2389
|
+
default: () => []
|
|
2390
|
+
},
|
|
2391
|
+
divider: [String, Function] // ...defineSlotsProps<{}>(),
|
|
2392
|
+
|
|
2393
|
+
},
|
|
2394
|
+
|
|
2395
|
+
setup(props, ctx) {
|
|
2396
|
+
const vui = useVui();
|
|
2397
|
+
const computedItemsRef = vue.computed(() => {
|
|
2398
|
+
const items = props.items.map(rawItem => {
|
|
2399
|
+
return typeof rawItem === 'string' ? {
|
|
2400
|
+
text: rawItem
|
|
2401
|
+
} : rawItem;
|
|
2402
|
+
});
|
|
2403
|
+
return items.map(item => {
|
|
2404
|
+
const {
|
|
2405
|
+
to,
|
|
2406
|
+
text
|
|
2407
|
+
} = item;
|
|
2408
|
+
const {
|
|
2409
|
+
disabled = vui.location.match(to) || !vui.location.isAvairable(to)
|
|
2410
|
+
} = item;
|
|
2411
|
+
return { ...item,
|
|
2412
|
+
disabled,
|
|
2413
|
+
text: typeof text === 'function' ? text(vui) : text
|
|
2414
|
+
};
|
|
2415
|
+
});
|
|
2416
|
+
});
|
|
2417
|
+
const lengthRef = vue.computed(() => computedItemsRef.value.length);
|
|
2418
|
+
|
|
2419
|
+
const defaultDividerSlot = () => {
|
|
2420
|
+
return [vue.createVNode("i", {
|
|
2421
|
+
"class": "v-breadcrumbs__divider__icon"
|
|
2422
|
+
}, null)];
|
|
2423
|
+
};
|
|
2424
|
+
|
|
2425
|
+
return () => {
|
|
2426
|
+
if (lengthRef.value < 1) return;
|
|
2427
|
+
let dividerSlot;
|
|
2428
|
+
const propDivider = props.divider;
|
|
2429
|
+
|
|
2430
|
+
if (propDivider) {
|
|
2431
|
+
dividerSlot = typeof propDivider === 'function' ? propDivider : () => propDivider;
|
|
2432
|
+
} else {
|
|
2433
|
+
dividerSlot = defaultDividerSlot;
|
|
2434
|
+
}
|
|
2435
|
+
|
|
2436
|
+
const children = [];
|
|
2437
|
+
computedItemsRef.value.forEach((item, index) => {
|
|
2438
|
+
const {
|
|
2439
|
+
text,
|
|
2440
|
+
icon,
|
|
2441
|
+
disabled,
|
|
2442
|
+
to
|
|
2443
|
+
} = item;
|
|
2444
|
+
|
|
2445
|
+
if (index > 0) {
|
|
2446
|
+
const divider = dividerSlot(vui);
|
|
2447
|
+
|
|
2448
|
+
if (divider) {
|
|
2449
|
+
children.push(vue.createVNode("li", {
|
|
2450
|
+
"class": "v-breadcrumbs__divider",
|
|
2451
|
+
"key": `divider-${index}`
|
|
2452
|
+
}, [divider]));
|
|
2453
|
+
}
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2456
|
+
const myChildren = [];
|
|
2457
|
+
|
|
2458
|
+
if (icon) {
|
|
2459
|
+
const $icon = resolveRawIconProp(false, icon, {
|
|
2460
|
+
class: 'v-breadcrumbs__icon'
|
|
2461
|
+
});
|
|
2462
|
+
|
|
2463
|
+
if ($icon) {
|
|
2464
|
+
myChildren.push($icon);
|
|
2465
|
+
}
|
|
2466
|
+
}
|
|
2467
|
+
|
|
2468
|
+
if (text) myChildren.push(text);
|
|
2469
|
+
const itemChild = to ? vue.createVNode(vueUtils.VLink, {
|
|
2470
|
+
"class": "v-breadcrumbs__link",
|
|
2471
|
+
"to": to,
|
|
2472
|
+
"exactActiveClass": "v-breadcrumbs__link--active"
|
|
2473
|
+
}, _isSlot$4(myChildren) ? myChildren : {
|
|
2474
|
+
default: () => [myChildren]
|
|
2475
|
+
}) : myChildren;
|
|
2476
|
+
children.push(vue.createVNode("li", {
|
|
2477
|
+
"class": ['v-breadcrumbs__item', {
|
|
2478
|
+
'v-breadcrumbs__item--disabled': disabled
|
|
2479
|
+
}],
|
|
2480
|
+
"key": `link-${index}`
|
|
2481
|
+
}, [itemChild]));
|
|
2482
|
+
});
|
|
2483
|
+
return vue.createVNode("nav", {
|
|
2484
|
+
"class": "v-breadcrumbs"
|
|
2485
|
+
}, [vue.createVNode("ul", {
|
|
2486
|
+
"class": "v-breadcrumbs__list"
|
|
2487
|
+
}, [children])]);
|
|
2488
|
+
};
|
|
2489
|
+
}
|
|
2490
|
+
|
|
2491
|
+
});
|
|
2492
|
+
|
|
2371
2493
|
function _isSlot$3(s) {
|
|
2372
2494
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
2373
2495
|
}
|
|
@@ -3274,6 +3396,7 @@ class VuiService {
|
|
|
3274
3396
|
location;
|
|
3275
3397
|
constructor(options) {
|
|
3276
3398
|
this.options = options;
|
|
3399
|
+
this.configure();
|
|
3277
3400
|
const { selectionSeparator = () => ', ', autoScrollToElementOffsetTop = DEFAULT_AUTO_SCROLL_TO_ELEMENT_OFFSET_TOP, textareaRows = DEFAULT_TEXTAREA_ROWS, requiredChip = () => '*', } = options;
|
|
3278
3401
|
this.selectionSeparator = selectionSeparator;
|
|
3279
3402
|
this.autoScrollToElementOffsetTop = autoScrollToElementOffsetTop;
|
|
@@ -3284,6 +3407,13 @@ class VuiService {
|
|
|
3284
3407
|
router: this.router,
|
|
3285
3408
|
});
|
|
3286
3409
|
}
|
|
3410
|
+
configure(options) {
|
|
3411
|
+
options && Object.assign(this.options, options);
|
|
3412
|
+
vueUtils.setDefaultRouterLink(this.getRouterLink());
|
|
3413
|
+
}
|
|
3414
|
+
getRouterLink() {
|
|
3415
|
+
return this.options.RouterLink || vueRouter.RouterLink;
|
|
3416
|
+
}
|
|
3287
3417
|
setting(key) {
|
|
3288
3418
|
return this.options.uiSettings[key];
|
|
3289
3419
|
}
|
|
@@ -3368,6 +3498,7 @@ exports.CONTROL_FIELD_VARIANTS = CONTROL_FIELD_VARIANTS;
|
|
|
3368
3498
|
exports.CONTROL_SIZES = CONTROL_SIZES;
|
|
3369
3499
|
exports.PAGINATION_ALIGNS = PAGINATION_ALIGNS;
|
|
3370
3500
|
exports.VApp = VApp;
|
|
3501
|
+
exports.VBreadcrumbs = VBreadcrumbs;
|
|
3371
3502
|
exports.VButton = VButton;
|
|
3372
3503
|
exports.VCard = VCard;
|
|
3373
3504
|
exports.VCardActions = VCardActions;
|
package/dist/vui.css
CHANGED
|
@@ -409,6 +409,7 @@ template {
|
|
|
409
409
|
--typo-subtitle2-weight: 500;
|
|
410
410
|
--typo-subtitle2-height: 1.57;
|
|
411
411
|
--typo-subtitle2-spacing: 0.00714em;
|
|
412
|
+
--typo-sm-size: calc(var(--root-em) * 0.875);
|
|
412
413
|
--control-field-rem-sm: 0.875rem;
|
|
413
414
|
--control-field-rem-md: 1rem;
|
|
414
415
|
--control-field-rem-lg: 1.125rem;
|
|
@@ -543,6 +544,7 @@ template {
|
|
|
543
544
|
--tabs-height: calc(var(--root-em) * 3);
|
|
544
545
|
--tabs-bar-height: calc(var(--root-em) * 0.375);
|
|
545
546
|
--tabs-font-size: calc(var(--root-em) * 0.875);
|
|
547
|
+
--breadcrumbs-font-size: var(--typo-sm-size);
|
|
546
548
|
}
|
|
547
549
|
|
|
548
550
|
:root,
|
|
@@ -1809,6 +1811,57 @@ thead th {
|
|
|
1809
1811
|
.v-tab--active::before {
|
|
1810
1812
|
transform: scaleX(1);
|
|
1811
1813
|
}
|
|
1814
|
+
.v-breadcrumbs {
|
|
1815
|
+
display: block;
|
|
1816
|
+
margin: 1.5em auto;
|
|
1817
|
+
font-size: var(--breadcrumbs-font-size);
|
|
1818
|
+
}
|
|
1819
|
+
.v-breadcrumbs__list {
|
|
1820
|
+
display: inline-flex;
|
|
1821
|
+
flex-wrap: wrap;
|
|
1822
|
+
align-items: center;
|
|
1823
|
+
padding: 0;
|
|
1824
|
+
margin: 0;
|
|
1825
|
+
vertical-align: bottom;
|
|
1826
|
+
list-style: none;
|
|
1827
|
+
}
|
|
1828
|
+
.v-breadcrumbs__item, .v-breadcrumbs__divider {
|
|
1829
|
+
padding: 0;
|
|
1830
|
+
margin: 0;
|
|
1831
|
+
list-style: none;
|
|
1832
|
+
}
|
|
1833
|
+
.v-breadcrumbs__link {
|
|
1834
|
+
display: inline-flex;
|
|
1835
|
+
align-items: center;
|
|
1836
|
+
text-decoration: none;
|
|
1837
|
+
white-space: nowrap;
|
|
1838
|
+
vertical-align: middle;
|
|
1839
|
+
}
|
|
1840
|
+
.v-breadcrumbs__item--disabled .v-breadcrumbs__link {
|
|
1841
|
+
color: inherit;
|
|
1842
|
+
pointer-events: none;
|
|
1843
|
+
}
|
|
1844
|
+
.v-breadcrumbs__icon {
|
|
1845
|
+
margin-right: 0.2em;
|
|
1846
|
+
font-size: 140%;
|
|
1847
|
+
}
|
|
1848
|
+
.v-breadcrumbs__divider {
|
|
1849
|
+
position: relative;
|
|
1850
|
+
top: 1px;
|
|
1851
|
+
display: flex;
|
|
1852
|
+
align-items: center;
|
|
1853
|
+
justify-content: center;
|
|
1854
|
+
margin: 0 1.25em;
|
|
1855
|
+
}
|
|
1856
|
+
.v-breadcrumbs__divider__icon {
|
|
1857
|
+
display: block;
|
|
1858
|
+
width: 0.5em;
|
|
1859
|
+
height: 0.5em;
|
|
1860
|
+
margin-left: -0.25em;
|
|
1861
|
+
border-top: solid 1px currentColor;
|
|
1862
|
+
border-right: solid 1px currentColor;
|
|
1863
|
+
transform: rotate(45deg);
|
|
1864
|
+
}
|
|
1812
1865
|
.v-content-switcher {
|
|
1813
1866
|
position: relative;
|
|
1814
1867
|
display: block;
|