@fastkit/vui 0.6.30 → 0.6.31
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 +158 -71
- package/dist/vui.cjs.prod.js +158 -71
- package/dist/vui.css +53 -0
- package/dist/vui.d.ts +269 -180
- package/dist/vui.esm-bundler.js +159 -73
- package/dist/vui.min.css +1 -1
- package/dist/vui.min.css.map +1 -1
- package/package.json +6 -6
package/dist/tool/index.js
CHANGED
|
@@ -32,6 +32,7 @@ import '@fastkit/vui/dist/vui.css';
|
|
|
32
32
|
import './setup.scss';
|
|
33
33
|
import type { App } from 'vue';
|
|
34
34
|
import type { Router } from 'vue-router';
|
|
35
|
+
import { VPageLink } from '@fastkit/vue-page';
|
|
35
36
|
import { installVuiPlugin as _installVuiPlugin, VuiPluginOptions } from '@fastkit/vui';
|
|
36
37
|
import { colorScheme } from '<%~ it.colorScheme %>';
|
|
37
38
|
import '<%~ it.mediaMatch %>';
|
|
@@ -39,6 +40,7 @@ import './icon-font';
|
|
|
39
40
|
|
|
40
41
|
export function installVui(settings: { app: App, router: Router }) {
|
|
41
42
|
_installVuiPlugin(settings.app, {
|
|
43
|
+
RouterLink: VPageLink,
|
|
42
44
|
colorScheme,
|
|
43
45
|
uiSettings: <%~ it.uiSettings %>,
|
|
44
46
|
icons: <%~ it.icons %>,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../../../../../../../packages/vui/src/tool/vite-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAK9B,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../../../../../../../packages/vui/src/tool/vite-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAK9B,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAwF/C,MAAM,WAAW,oBACf,SAAQ,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,YAAY,GAAG,OAAO,CAAC,CAAC;IAChE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC9B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,GAAG,CAAC;IACrB,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,GAAG,CAAC;IACpC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAGD,MAAM,WAAW,2BACf,SAAQ,IAAI,CAAC,iBAAiB,EAAE,YAAY,GAAG,OAAO,CAAC;IACvD,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,2BAA2B,CAAC;IACtC,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC,EAAE,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,aAAa,CAC3B,OAAO,GAAE,oBAAyB,GACjC,mBAAmB,CA6IrB"}
|
package/dist/vui.cjs.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,7 +841,6 @@ const VListTile = vue.defineComponent({
|
|
|
864
841
|
return icon;
|
|
865
842
|
});
|
|
866
843
|
const endIcon = vue.computed(() => resolveRawIconProp(false, props.endIcon));
|
|
867
|
-
const navigationable = vueUtils.useNavigationable(props, () => props.fallbackTag, ctx);
|
|
868
844
|
const hasTo = vue.computed(() => !!props.to);
|
|
869
845
|
const link = vueRouter.useLink({
|
|
870
846
|
to: props.to || ''
|
|
@@ -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,7 +959,7 @@ 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
|
|
|
@@ -1024,7 +990,7 @@ function renderNavigationItemInput(input, extraProps) {
|
|
|
1024
990
|
} = resolveNavigationItemInput(input);
|
|
1025
991
|
return vue.createVNode(VNavigationItem, { ...props,
|
|
1026
992
|
...extraProps
|
|
1027
|
-
}, _isSlot$
|
|
993
|
+
}, _isSlot$a(label) ? label : {
|
|
1028
994
|
default: () => [label]
|
|
1029
995
|
});
|
|
1030
996
|
}
|
|
@@ -1133,9 +1099,8 @@ const VNavigationItem = vue.defineComponent({
|
|
|
1133
1099
|
const onClick = ev => {
|
|
1134
1100
|
if (!to.value) {
|
|
1135
1101
|
toggle();
|
|
1136
|
-
}
|
|
1102
|
+
} // ctx.emit('click', ev);
|
|
1137
1103
|
|
|
1138
|
-
ctx.emit('click', ev);
|
|
1139
1104
|
};
|
|
1140
1105
|
|
|
1141
1106
|
const onChangeActive = isActive => {
|
|
@@ -1162,13 +1127,13 @@ const VNavigationItem = vue.defineComponent({
|
|
|
1162
1127
|
|
|
1163
1128
|
const _children = children.value;
|
|
1164
1129
|
const fallbackTag = _children ? 'button' : undefined;
|
|
1165
|
-
return vue.createVNode(vue.Fragment, null, [vue.createVNode(VListTile, vue.mergeProps(_props.value, {
|
|
1130
|
+
return vue.createVNode(vue.Fragment, null, [vue.createVNode(VListTile, vue.mergeProps(ctx.attrs, _props.value, {
|
|
1166
1131
|
"fallbackTag": fallbackTag,
|
|
1167
1132
|
"endIcon": _props.value.endIcon,
|
|
1168
1133
|
"class": ['v-navigation-item', classes.value],
|
|
1169
1134
|
"onClick": onClick,
|
|
1170
1135
|
"onChangeActive": onChangeActive
|
|
1171
|
-
}), _isSlot$
|
|
1136
|
+
}), _isSlot$a(_slot = vueUtils.renderSlotOrEmpty(ctx.slots, 'default')) ? _slot : {
|
|
1172
1137
|
default: () => [_slot]
|
|
1173
1138
|
}), _children && vue.createVNode(vueUtils.VExpandTransition, null, {
|
|
1174
1139
|
default: () => [vue.withDirectives(vue.createVNode("div", {
|
|
@@ -1316,7 +1281,7 @@ const VCheckbox = vue.defineComponent({
|
|
|
1316
1281
|
|
|
1317
1282
|
});
|
|
1318
1283
|
|
|
1319
|
-
function _isSlot$
|
|
1284
|
+
function _isSlot$9(s) {
|
|
1320
1285
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
1321
1286
|
}
|
|
1322
1287
|
|
|
@@ -1328,7 +1293,7 @@ const VCheckboxGroup = defineFormSelectorComponent({
|
|
|
1328
1293
|
itemRenderer: ({
|
|
1329
1294
|
attrs,
|
|
1330
1295
|
slots
|
|
1331
|
-
}) => vue.createVNode(VCheckbox, attrs, _isSlot$
|
|
1296
|
+
}) => vue.createVNode(VCheckbox, attrs, _isSlot$9(slots) ? slots : {
|
|
1332
1297
|
default: () => [slots]
|
|
1333
1298
|
})
|
|
1334
1299
|
});
|
|
@@ -1380,7 +1345,7 @@ const VRadio = vue.defineComponent({
|
|
|
1380
1345
|
|
|
1381
1346
|
});
|
|
1382
1347
|
|
|
1383
|
-
function _isSlot$
|
|
1348
|
+
function _isSlot$8(s) {
|
|
1384
1349
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
1385
1350
|
}
|
|
1386
1351
|
|
|
@@ -1391,7 +1356,7 @@ const VRadioGroup = defineFormSelectorComponent({
|
|
|
1391
1356
|
itemRenderer: ({
|
|
1392
1357
|
attrs,
|
|
1393
1358
|
slots
|
|
1394
|
-
}) => vue.createVNode(VRadio, attrs, _isSlot$
|
|
1359
|
+
}) => vue.createVNode(VRadio, attrs, _isSlot$8(slots) ? slots : {
|
|
1395
1360
|
default: () => [slots]
|
|
1396
1361
|
})
|
|
1397
1362
|
});
|
|
@@ -1453,7 +1418,7 @@ const VSwitch = vue.defineComponent({
|
|
|
1453
1418
|
|
|
1454
1419
|
});
|
|
1455
1420
|
|
|
1456
|
-
function _isSlot$
|
|
1421
|
+
function _isSlot$7(s) {
|
|
1457
1422
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
1458
1423
|
}
|
|
1459
1424
|
|
|
@@ -1465,7 +1430,7 @@ const VSwitchGroup = defineFormSelectorComponent({
|
|
|
1465
1430
|
itemRenderer: ({
|
|
1466
1431
|
attrs,
|
|
1467
1432
|
slots
|
|
1468
|
-
}) => vue.createVNode(VSwitch, attrs, _isSlot$
|
|
1433
|
+
}) => vue.createVNode(VSwitch, attrs, _isSlot$7(slots) ? slots : {
|
|
1469
1434
|
default: () => [slots]
|
|
1470
1435
|
})
|
|
1471
1436
|
});
|
|
@@ -2024,7 +1989,7 @@ const VForm = vue.defineComponent({
|
|
|
2024
1989
|
|
|
2025
1990
|
});
|
|
2026
1991
|
|
|
2027
|
-
function _isSlot$
|
|
1992
|
+
function _isSlot$6(s) {
|
|
2028
1993
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
2029
1994
|
}
|
|
2030
1995
|
|
|
@@ -2073,7 +2038,7 @@ const VTab = vue.defineComponent({
|
|
|
2073
2038
|
"class": classes,
|
|
2074
2039
|
"to": to,
|
|
2075
2040
|
"replace": replace
|
|
2076
|
-
}, _isSlot$
|
|
2041
|
+
}, _isSlot$6(children) ? children : {
|
|
2077
2042
|
default: () => [children]
|
|
2078
2043
|
});
|
|
2079
2044
|
} else {
|
|
@@ -2091,7 +2056,7 @@ const VTab = vue.defineComponent({
|
|
|
2091
2056
|
|
|
2092
2057
|
});
|
|
2093
2058
|
|
|
2094
|
-
function _isSlot$
|
|
2059
|
+
function _isSlot$5(s) {
|
|
2095
2060
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
2096
2061
|
}
|
|
2097
2062
|
|
|
@@ -2346,7 +2311,7 @@ const VTabs = vue.defineComponent({
|
|
|
2346
2311
|
to(value);
|
|
2347
2312
|
}
|
|
2348
2313
|
}
|
|
2349
|
-
}, _isSlot$
|
|
2314
|
+
}, _isSlot$5(children) ? children : {
|
|
2350
2315
|
default: () => [children]
|
|
2351
2316
|
});
|
|
2352
2317
|
});
|
|
@@ -2368,6 +2333,119 @@ const VTabs = vue.defineComponent({
|
|
|
2368
2333
|
|
|
2369
2334
|
});
|
|
2370
2335
|
|
|
2336
|
+
function _isSlot$4(s) {
|
|
2337
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
2338
|
+
}
|
|
2339
|
+
|
|
2340
|
+
const VBreadcrumbs = vue.defineComponent({
|
|
2341
|
+
name: 'VBreadcrumbs',
|
|
2342
|
+
props: {
|
|
2343
|
+
items: {
|
|
2344
|
+
type: Array,
|
|
2345
|
+
default: () => []
|
|
2346
|
+
},
|
|
2347
|
+
divider: [String, Function] // ...defineSlotsProps<{}>(),
|
|
2348
|
+
|
|
2349
|
+
},
|
|
2350
|
+
|
|
2351
|
+
setup(props, ctx) {
|
|
2352
|
+
const vui = useVui();
|
|
2353
|
+
const computedItemsRef = vue.computed(() => {
|
|
2354
|
+
const items = props.items.map(rawItem => {
|
|
2355
|
+
return typeof rawItem === 'string' ? {
|
|
2356
|
+
text: rawItem
|
|
2357
|
+
} : rawItem;
|
|
2358
|
+
});
|
|
2359
|
+
return items.map(item => {
|
|
2360
|
+
const {
|
|
2361
|
+
to,
|
|
2362
|
+
text
|
|
2363
|
+
} = item;
|
|
2364
|
+
const {
|
|
2365
|
+
disabled = vui.location.match(to) || !vui.location.isAvairable(to)
|
|
2366
|
+
} = item;
|
|
2367
|
+
return { ...item,
|
|
2368
|
+
disabled,
|
|
2369
|
+
text: typeof text === 'function' ? text(vui) : text
|
|
2370
|
+
};
|
|
2371
|
+
});
|
|
2372
|
+
});
|
|
2373
|
+
const lengthRef = vue.computed(() => computedItemsRef.value.length);
|
|
2374
|
+
|
|
2375
|
+
const defaultDividerSlot = () => {
|
|
2376
|
+
return [vue.createVNode("i", {
|
|
2377
|
+
"class": "v-breadcrumbs__divider__icon"
|
|
2378
|
+
}, null)];
|
|
2379
|
+
};
|
|
2380
|
+
|
|
2381
|
+
return () => {
|
|
2382
|
+
if (lengthRef.value < 1) return;
|
|
2383
|
+
let dividerSlot;
|
|
2384
|
+
const propDivider = props.divider;
|
|
2385
|
+
|
|
2386
|
+
if (propDivider) {
|
|
2387
|
+
dividerSlot = typeof propDivider === 'function' ? propDivider : () => propDivider;
|
|
2388
|
+
} else {
|
|
2389
|
+
dividerSlot = defaultDividerSlot;
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2392
|
+
const children = [];
|
|
2393
|
+
computedItemsRef.value.forEach((item, index) => {
|
|
2394
|
+
const {
|
|
2395
|
+
text,
|
|
2396
|
+
icon,
|
|
2397
|
+
disabled,
|
|
2398
|
+
to
|
|
2399
|
+
} = item;
|
|
2400
|
+
|
|
2401
|
+
if (index > 0) {
|
|
2402
|
+
const divider = dividerSlot(vui);
|
|
2403
|
+
|
|
2404
|
+
if (divider) {
|
|
2405
|
+
children.push(vue.createVNode("li", {
|
|
2406
|
+
"class": "v-breadcrumbs__divider",
|
|
2407
|
+
"key": `divider-${index}`
|
|
2408
|
+
}, [divider]));
|
|
2409
|
+
}
|
|
2410
|
+
}
|
|
2411
|
+
|
|
2412
|
+
const myChildren = [];
|
|
2413
|
+
|
|
2414
|
+
if (icon) {
|
|
2415
|
+
const $icon = resolveRawIconProp(false, icon, {
|
|
2416
|
+
class: 'v-breadcrumbs__icon'
|
|
2417
|
+
});
|
|
2418
|
+
|
|
2419
|
+
if ($icon) {
|
|
2420
|
+
myChildren.push($icon);
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2424
|
+
if (text) myChildren.push(text);
|
|
2425
|
+
const itemChild = to ? vue.createVNode(vueUtils.VLink, {
|
|
2426
|
+
"class": "v-breadcrumbs__link",
|
|
2427
|
+
"to": to,
|
|
2428
|
+
"exactActiveClass": "v-breadcrumbs__link--active"
|
|
2429
|
+
}, _isSlot$4(myChildren) ? myChildren : {
|
|
2430
|
+
default: () => [myChildren]
|
|
2431
|
+
}) : myChildren;
|
|
2432
|
+
children.push(vue.createVNode("li", {
|
|
2433
|
+
"class": ['v-breadcrumbs__item', {
|
|
2434
|
+
'v-breadcrumbs__item--disabled': disabled
|
|
2435
|
+
}],
|
|
2436
|
+
"key": `link-${index}`
|
|
2437
|
+
}, [itemChild]));
|
|
2438
|
+
});
|
|
2439
|
+
return vue.createVNode("nav", {
|
|
2440
|
+
"class": "v-breadcrumbs"
|
|
2441
|
+
}, [vue.createVNode("ul", {
|
|
2442
|
+
"class": "v-breadcrumbs__list"
|
|
2443
|
+
}, [children])]);
|
|
2444
|
+
};
|
|
2445
|
+
}
|
|
2446
|
+
|
|
2447
|
+
});
|
|
2448
|
+
|
|
2371
2449
|
function _isSlot$3(s) {
|
|
2372
2450
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
2373
2451
|
}
|
|
@@ -3274,6 +3352,7 @@ class VuiService {
|
|
|
3274
3352
|
location;
|
|
3275
3353
|
constructor(options) {
|
|
3276
3354
|
this.options = options;
|
|
3355
|
+
this.configure();
|
|
3277
3356
|
const { selectionSeparator = () => ', ', autoScrollToElementOffsetTop = DEFAULT_AUTO_SCROLL_TO_ELEMENT_OFFSET_TOP, textareaRows = DEFAULT_TEXTAREA_ROWS, requiredChip = () => '*', } = options;
|
|
3278
3357
|
this.selectionSeparator = selectionSeparator;
|
|
3279
3358
|
this.autoScrollToElementOffsetTop = autoScrollToElementOffsetTop;
|
|
@@ -3284,6 +3363,13 @@ class VuiService {
|
|
|
3284
3363
|
router: this.router,
|
|
3285
3364
|
});
|
|
3286
3365
|
}
|
|
3366
|
+
configure(options) {
|
|
3367
|
+
options && Object.assign(this.options, options);
|
|
3368
|
+
vueUtils.setDefaultRouterLink(this.getRouterLink());
|
|
3369
|
+
}
|
|
3370
|
+
getRouterLink() {
|
|
3371
|
+
return this.options.RouterLink || vueRouter.RouterLink;
|
|
3372
|
+
}
|
|
3287
3373
|
setting(key) {
|
|
3288
3374
|
return this.options.uiSettings[key];
|
|
3289
3375
|
}
|
|
@@ -3368,6 +3454,7 @@ exports.CONTROL_FIELD_VARIANTS = CONTROL_FIELD_VARIANTS;
|
|
|
3368
3454
|
exports.CONTROL_SIZES = CONTROL_SIZES;
|
|
3369
3455
|
exports.PAGINATION_ALIGNS = PAGINATION_ALIGNS;
|
|
3370
3456
|
exports.VApp = VApp;
|
|
3457
|
+
exports.VBreadcrumbs = VBreadcrumbs;
|
|
3371
3458
|
exports.VButton = VButton;
|
|
3372
3459
|
exports.VCard = VCard;
|
|
3373
3460
|
exports.VCardActions = VCardActions;
|