@fastkit/vui 0.6.19 → 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 +14 -3
- package/dist/tool/vite-plugin.d.ts.map +1 -1
- package/dist/vui.cjs.js +1691 -127
- package/dist/vui.cjs.prod.js +1691 -127
- package/dist/vui.css +553 -0
- package/dist/vui.d.ts +741 -180
- package/dist/vui.esm-bundler.js +1690 -135
- package/dist/vui.min.css +1 -1
- package/dist/vui.min.css.map +1 -1
- package/package.json +6 -6
package/dist/vui.cjs.js
CHANGED
|
@@ -3,12 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var vueKit = require('@fastkit/vue-kit');
|
|
6
|
+
var vueRouter = require('vue-router');
|
|
7
|
+
var vueUtils = require('@fastkit/vue-utils');
|
|
6
8
|
var vue = require('vue');
|
|
7
9
|
var vueColorScheme = require('@fastkit/vue-color-scheme');
|
|
8
|
-
var vueUtils = require('@fastkit/vue-utils');
|
|
9
10
|
var vueLoading = require('@fastkit/vue-loading');
|
|
10
11
|
var iconFont = require('@fastkit/icon-font');
|
|
11
|
-
var
|
|
12
|
+
var helpers = require('@fastkit/helpers');
|
|
13
|
+
var vueAppLayout = require('@fastkit/vue-app-layout');
|
|
14
|
+
var vueScroller = require('@fastkit/vue-scroller');
|
|
12
15
|
|
|
13
16
|
const CONTROL_SIZES = ['sm', 'md', 'lg'];
|
|
14
17
|
const CONTROL_FIELD_VARIANTS = ['outlined', 'filled', 'flat'];
|
|
@@ -162,7 +165,7 @@ const VFormControl = vue.defineComponent({
|
|
|
162
165
|
}
|
|
163
166
|
}, [label, control.required && vui.getRequiredChip()]), vue.createVNode("div", {
|
|
164
167
|
"class": "v-form-control__body"
|
|
165
|
-
}, [vueKit.renderSlotOrEmpty(ctx.slots, 'default', control), vue.createVNode("div", {
|
|
168
|
+
}, [vueKit.renderSlotOrEmpty(ctx.slots, 'default', control), !props.hiddenInfo && vue.createVNode("div", {
|
|
166
169
|
"class": "v-form-control__info"
|
|
167
170
|
}, [!!message && vue.createVNode("div", {
|
|
168
171
|
"class": "v-form-control__message"
|
|
@@ -215,6 +218,7 @@ function defineFormSelectorComponent(opts) {
|
|
|
215
218
|
return vue.createVNode(VFormControl, {
|
|
216
219
|
"nodeControl": this.nodeControl,
|
|
217
220
|
"focused": this.nodeControl.focused,
|
|
221
|
+
"hiddenInfo": this.hiddenInfo,
|
|
218
222
|
"class": ['v-form-selector', className, { ...this.classes,
|
|
219
223
|
'v-form-selector--stacked': this.stacked
|
|
220
224
|
}],
|
|
@@ -431,7 +435,7 @@ function resolveRawVButtonIcon(raw, type = 'main') {
|
|
|
431
435
|
}
|
|
432
436
|
|
|
433
437
|
const vueButtonProps = vueUtils.createPropsOptions({ ...vueColorScheme.colorSchemeProps(),
|
|
434
|
-
...vueUtils.
|
|
438
|
+
...vueUtils.navigationableInheritProps,
|
|
435
439
|
spacer: [Boolean, String],
|
|
436
440
|
loading: Boolean,
|
|
437
441
|
rounded: Boolean,
|
|
@@ -447,9 +451,8 @@ const LOADING_SIZE_MAP = {
|
|
|
447
451
|
};
|
|
448
452
|
const VButton = vue.defineComponent({
|
|
449
453
|
name: 'VButton',
|
|
454
|
+
inheritAttrs: false,
|
|
450
455
|
props: vueButtonProps,
|
|
451
|
-
emits: { ...vueUtils.navigationableEmits
|
|
452
|
-
},
|
|
453
456
|
|
|
454
457
|
setup(props, ctx) {
|
|
455
458
|
const vui = useVui();
|
|
@@ -475,48 +478,25 @@ const VButton = vue.defineComponent({
|
|
|
475
478
|
variant: () => props.variant || (icon.value ? vui.setting('plainVariant') : defaults.variant)
|
|
476
479
|
});
|
|
477
480
|
const isPlain = vue.computed(() => color.variant.value.value === vui.setting('plainVariant') && color.color.value.value === defaults.color);
|
|
478
|
-
const
|
|
479
|
-
|
|
480
|
-
const isDisabled = vue.computed(() => props.disabled);
|
|
481
|
+
const isLoading = vue.computed(() => props.loading); // const isDisabled = computed(() => props.disabled);
|
|
482
|
+
|
|
481
483
|
const isRounded = vue.computed(() => props.rounded || !!icon.value);
|
|
482
484
|
const spacer = vue.computed(() => {
|
|
483
485
|
const _spacer = props.spacer;
|
|
484
486
|
if (!_spacer) return;
|
|
485
487
|
return _spacer === true ? 'left' : _spacer;
|
|
486
488
|
});
|
|
487
|
-
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}`, {
|
|
488
491
|
'v-button--loading': isLoading.value,
|
|
489
492
|
'v-button--icon': !!icon.value,
|
|
490
493
|
'v-button--rounded': isRounded.value,
|
|
491
494
|
'v-button--plain': isPlain.value
|
|
492
495
|
}]);
|
|
493
496
|
return () => {
|
|
494
|
-
const
|
|
495
|
-
|
|
496
|
-
attrs
|
|
497
|
-
} = navigationable.value;
|
|
498
|
-
const children = vueUtils.renderSlotOrEmpty(ctx.slots, 'default');
|
|
499
|
-
const _attrs = { ...attrs
|
|
500
|
-
};
|
|
501
|
-
|
|
502
|
-
if (isDisabled.value) {
|
|
503
|
-
_attrs.disabled = true;
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
return vue.createVNode(Tag, vue.mergeProps({
|
|
497
|
+
const children = vueUtils.renderSlotOrEmpty(ctx.slots);
|
|
498
|
+
return vue.createVNode(vueUtils.VLink, vue.mergeProps(ctx.attrs, {
|
|
507
499
|
"class": ['v-button', classes.value]
|
|
508
|
-
}, _attrs, {
|
|
509
|
-
"onClick": ev => {
|
|
510
|
-
if (isDisabled.value || isLoading.value) {
|
|
511
|
-
ev.preventDefault();
|
|
512
|
-
|
|
513
|
-
if (isDisabled.value) {
|
|
514
|
-
return;
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
ctx.emit('click', ev);
|
|
519
|
-
}
|
|
520
500
|
}), {
|
|
521
501
|
default: () => [vue.createVNode("span", {
|
|
522
502
|
"class": "v-button__content"
|
|
@@ -531,13 +511,306 @@ const VButton = vue.defineComponent({
|
|
|
531
511
|
|
|
532
512
|
});
|
|
533
513
|
|
|
514
|
+
function _isSlot$c(s) {
|
|
515
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
const PAGINATION_ALIGNS = ['left', 'center', 'right'];
|
|
519
|
+
function paginationProps() {
|
|
520
|
+
return vueUtils.createPropsOptions({
|
|
521
|
+
/**
|
|
522
|
+
* Active Pages
|
|
523
|
+
*/
|
|
524
|
+
modelValue: {
|
|
525
|
+
type: vueUtils.rawNumberPropType,
|
|
526
|
+
default: 1
|
|
527
|
+
},
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Total number of pages
|
|
531
|
+
*/
|
|
532
|
+
length: {
|
|
533
|
+
type: vueUtils.rawNumberPropType,
|
|
534
|
+
default: 0
|
|
535
|
+
},
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* Maximum number of links to display.
|
|
539
|
+
*/
|
|
540
|
+
totalVisible: vueUtils.rawNumberPropType,
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* true when narrowing
|
|
544
|
+
*/
|
|
545
|
+
dense: Boolean,
|
|
546
|
+
disabled: Boolean,
|
|
547
|
+
align: {
|
|
548
|
+
type: String,
|
|
549
|
+
default: 'center'
|
|
550
|
+
},
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* To synchronize with a query, use the query name
|
|
554
|
+
*/
|
|
555
|
+
routeQuery: String,
|
|
556
|
+
beforeChange: Function,
|
|
557
|
+
color: String
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
const VPagination = vue.defineComponent({
|
|
561
|
+
name: 'VPagination',
|
|
562
|
+
props: paginationProps(),
|
|
563
|
+
emits: {
|
|
564
|
+
change: page => true
|
|
565
|
+
},
|
|
566
|
+
|
|
567
|
+
setup(props, ctx) {
|
|
568
|
+
const vui = useVui();
|
|
569
|
+
const elRef = vue.ref(null);
|
|
570
|
+
const router = vueRouter.useRouter();
|
|
571
|
+
const internalValue = vue.ref(1);
|
|
572
|
+
const containerWidth = vue.ref(0);
|
|
573
|
+
const itemSize = vue.ref(0);
|
|
574
|
+
const capacityLength = vue.computed(() => {
|
|
575
|
+
const _itemSize = itemSize.value;
|
|
576
|
+
if (!_itemSize) return 0;
|
|
577
|
+
return Math.floor(containerWidth.value / _itemSize);
|
|
578
|
+
});
|
|
579
|
+
const colorScope = vueColorScheme.useScopeColorClass({
|
|
580
|
+
color: () => props.color || vui.setting('primaryScope')
|
|
581
|
+
});
|
|
582
|
+
const computedLength = vue.computed(() => vueUtils.resolveNumberish(props.length));
|
|
583
|
+
const computedTotalVisible = vue.computed(() => vueUtils.resolveNumberish(props.totalVisible));
|
|
584
|
+
const computedNumbersLength = vue.computed(() => capacityLength.value - 2 - 2);
|
|
585
|
+
const computedPage = vue.computed(() => {
|
|
586
|
+
const {
|
|
587
|
+
routeQuery
|
|
588
|
+
} = props;
|
|
589
|
+
|
|
590
|
+
if (routeQuery) {
|
|
591
|
+
return vui.location.getQuery(routeQuery, Number, 1);
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
return internalValue.value;
|
|
595
|
+
});
|
|
596
|
+
|
|
597
|
+
const _range = (from, to) => {
|
|
598
|
+
const range = [];
|
|
599
|
+
from = from > 0 ? from : 1;
|
|
600
|
+
|
|
601
|
+
for (let i = from; i <= to; i++) {
|
|
602
|
+
range.push(i);
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
return range;
|
|
606
|
+
};
|
|
607
|
+
|
|
608
|
+
const computedItems = vue.computed(() => {
|
|
609
|
+
const maxButtons = computedNumbersLength.value;
|
|
610
|
+
const totalVisible = computedTotalVisible.value;
|
|
611
|
+
const length = computedLength.value;
|
|
612
|
+
const pageValue = computedPage.value;
|
|
613
|
+
const maxLength = Math.min(Math.max(0, totalVisible || 0) || length, Math.max(0, maxButtons) || length, length);
|
|
614
|
+
|
|
615
|
+
if (length <= maxLength) {
|
|
616
|
+
return _range(1, length);
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
const even = maxLength % 2 === 0 ? 1 : 0;
|
|
620
|
+
const left = Math.floor(maxLength / 2);
|
|
621
|
+
const right = length - left + 1 + even;
|
|
622
|
+
|
|
623
|
+
if (pageValue > left && pageValue < right) {
|
|
624
|
+
const start = pageValue - left + 2;
|
|
625
|
+
const end = pageValue + left - 2 - even;
|
|
626
|
+
return [1, 'truncate', ..._range(start, end), 'truncate', length];
|
|
627
|
+
} else if (pageValue === left) {
|
|
628
|
+
const end = pageValue + left - 1 - even;
|
|
629
|
+
return [..._range(1, end), 'truncate', length];
|
|
630
|
+
} else if (pageValue === right) {
|
|
631
|
+
const start = pageValue - left + 1;
|
|
632
|
+
return [1, 'truncate', ..._range(start, length)];
|
|
633
|
+
} else {
|
|
634
|
+
return [..._range(1, left), 'truncate', ..._range(right, length)];
|
|
635
|
+
}
|
|
636
|
+
});
|
|
637
|
+
const isActive = vue.computed(() => computedLength.value > 1);
|
|
638
|
+
const isTransitioning = vue.computed(() => {
|
|
639
|
+
const {
|
|
640
|
+
routeQuery
|
|
641
|
+
} = props;
|
|
642
|
+
return vui.location.isQueryOnlyTransitioning(routeQuery);
|
|
643
|
+
});
|
|
644
|
+
const isDisabled = vue.computed(() => props.disabled || isTransitioning.value);
|
|
645
|
+
const classes = vue.computed(() => [{
|
|
646
|
+
'v-pagination--disabled': isDisabled.value,
|
|
647
|
+
'v-pagination--dense': props.dense,
|
|
648
|
+
[`v-pagination--${props.align}`]: true
|
|
649
|
+
}, colorScope.value.className]);
|
|
650
|
+
|
|
651
|
+
async function setPage(value) {
|
|
652
|
+
if (isDisabled.value) return;
|
|
653
|
+
const {
|
|
654
|
+
beforeChange,
|
|
655
|
+
routeQuery
|
|
656
|
+
} = props;
|
|
657
|
+
const newPage = vueUtils.resolveNumberish(value);
|
|
658
|
+
if (computedPage.value === newPage) return;
|
|
659
|
+
|
|
660
|
+
if (beforeChange) {
|
|
661
|
+
try {
|
|
662
|
+
let result = beforeChange(newPage);
|
|
663
|
+
if (helpers.isPromise(result)) result = await result;
|
|
664
|
+
if (result === false) return;
|
|
665
|
+
} catch (e) {}
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
if (routeQuery) {
|
|
669
|
+
const to = createRoutableLocationByPage(newPage, routeQuery);
|
|
670
|
+
return router.push(to).then(failure => {
|
|
671
|
+
!failure && ctx.emit('change', newPage);
|
|
672
|
+
});
|
|
673
|
+
} else {
|
|
674
|
+
internalValue.value = newPage;
|
|
675
|
+
ctx.emit('update:modelValue', newPage);
|
|
676
|
+
ctx.emit('change', newPage);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
function createPageInfo(source) {
|
|
681
|
+
const currentPage = computedPage.value;
|
|
682
|
+
const length = computedLength.value;
|
|
683
|
+
let number;
|
|
684
|
+
let page;
|
|
685
|
+
let active;
|
|
686
|
+
let disabled;
|
|
687
|
+
|
|
688
|
+
if (typeof source === 'number') {
|
|
689
|
+
number = true;
|
|
690
|
+
page = source;
|
|
691
|
+
active = currentPage === page;
|
|
692
|
+
disabled = false;
|
|
693
|
+
} else if (source === 'truncate') {
|
|
694
|
+
number = false;
|
|
695
|
+
active = false;
|
|
696
|
+
disabled = false;
|
|
697
|
+
} else {
|
|
698
|
+
number = false;
|
|
699
|
+
const isPrev = source === 'prev';
|
|
700
|
+
const ammount = isPrev ? -1 : 1;
|
|
701
|
+
page = currentPage + ammount;
|
|
702
|
+
active = false;
|
|
703
|
+
disabled = page < 1 || page > length;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
return {
|
|
707
|
+
number,
|
|
708
|
+
page,
|
|
709
|
+
active,
|
|
710
|
+
disabled
|
|
711
|
+
};
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
function createRoutableLocationByPage(page, routeQuery) {
|
|
715
|
+
return vui.location.getQueryMergedLocation({
|
|
716
|
+
[routeQuery]: page
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
function genItem(source, index) {
|
|
721
|
+
const {
|
|
722
|
+
number,
|
|
723
|
+
page,
|
|
724
|
+
active,
|
|
725
|
+
disabled
|
|
726
|
+
} = createPageInfo(source);
|
|
727
|
+
const type = number ? 'num' : source;
|
|
728
|
+
const classes = ['v-pagination__item', {
|
|
729
|
+
[`v-pagination__item--${type}`]: true,
|
|
730
|
+
'v-pagination__item--active': active,
|
|
731
|
+
'v-pagination__item--disabled': disabled
|
|
732
|
+
}];
|
|
733
|
+
const children = number ? page : (() => {
|
|
734
|
+
if (type === 'truncate') {
|
|
735
|
+
return vue.createVNode("span", null, [vue.createTextVNode("...")]);
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
const isPrev = type === 'prev';
|
|
739
|
+
const icon = isPrev ? vui.icon('prev') : vui.icon('next');
|
|
740
|
+
return resolveRawIconProp(false, icon, {
|
|
741
|
+
class: 'v-pagination__item__icon'
|
|
742
|
+
});
|
|
743
|
+
})();
|
|
744
|
+
|
|
745
|
+
const onClick = ev => {
|
|
746
|
+
ev.preventDefault();
|
|
747
|
+
if (page === undefined || active || disabled) return;
|
|
748
|
+
setPage(page);
|
|
749
|
+
};
|
|
750
|
+
|
|
751
|
+
const key = `${source}-${index}`;
|
|
752
|
+
const {
|
|
753
|
+
routeQuery
|
|
754
|
+
} = props;
|
|
755
|
+
|
|
756
|
+
if (page !== undefined && routeQuery) {
|
|
757
|
+
const to = createRoutableLocationByPage(page, routeQuery);
|
|
758
|
+
return vue.createVNode(vueRouter.RouterLink, {
|
|
759
|
+
"class": classes,
|
|
760
|
+
"to": to,
|
|
761
|
+
"key": key
|
|
762
|
+
}, _isSlot$c(children) ? children : {
|
|
763
|
+
default: () => [children]
|
|
764
|
+
});
|
|
765
|
+
} else {
|
|
766
|
+
return vue.createVNode("button", {
|
|
767
|
+
"class": classes,
|
|
768
|
+
"type": "button",
|
|
769
|
+
"value": page,
|
|
770
|
+
"onClick": onClick,
|
|
771
|
+
"key": key
|
|
772
|
+
}, [children]);
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
vue.watch(() => props.modelValue, modelValue => {
|
|
777
|
+
internalValue.value = vueUtils.resolveNumberish(modelValue);
|
|
778
|
+
}, {
|
|
779
|
+
immediate: true
|
|
780
|
+
});
|
|
781
|
+
return () => {
|
|
782
|
+
if (!isActive.value) return undefined;
|
|
783
|
+
const $items = ['prev', ...computedItems.value, 'next'].map((i, index) => genItem(i, index));
|
|
784
|
+
return vue.withDirectives(vue.createVNode("nav", {
|
|
785
|
+
"class": ['v-pagination', classes.value],
|
|
786
|
+
"ref": elRef
|
|
787
|
+
}, [$items]), [vueUtils.resizeDirectiveArgument(({
|
|
788
|
+
width
|
|
789
|
+
}) => {
|
|
790
|
+
const el = elRef.value;
|
|
791
|
+
|
|
792
|
+
if (el) {
|
|
793
|
+
const style = window.getComputedStyle(el, 'before');
|
|
794
|
+
const width = style.getPropertyValue('width');
|
|
795
|
+
const margin = style.getPropertyValue('margin');
|
|
796
|
+
const size = parseFloat(width) + parseFloat(margin) * 0.5;
|
|
797
|
+
itemSize.value = size;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
containerWidth.value = width;
|
|
801
|
+
})]);
|
|
802
|
+
};
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
});
|
|
806
|
+
|
|
534
807
|
function createListTileProps() {
|
|
535
808
|
const icon = rawIconProp();
|
|
536
|
-
return { ...vueUtils.
|
|
809
|
+
return { ...vueUtils.navigationableInheritProps,
|
|
537
810
|
...vueUtils.createPropsOptions({
|
|
538
811
|
startIcon: icon,
|
|
539
812
|
endIcon: icon,
|
|
540
|
-
|
|
813
|
+
linkFallbackTag: {
|
|
541
814
|
type: String,
|
|
542
815
|
default: 'div'
|
|
543
816
|
},
|
|
@@ -547,11 +820,12 @@ function createListTileProps() {
|
|
|
547
820
|
})
|
|
548
821
|
};
|
|
549
822
|
}
|
|
550
|
-
const listTileEmits = {
|
|
823
|
+
const listTileEmits = {
|
|
551
824
|
changeActive: isActive => true
|
|
552
825
|
};
|
|
553
826
|
const VListTile = vue.defineComponent({
|
|
554
827
|
name: 'VListTile',
|
|
828
|
+
inheritAttrs: false,
|
|
555
829
|
props: createListTileProps(),
|
|
556
830
|
emits: { ...listTileEmits
|
|
557
831
|
},
|
|
@@ -567,7 +841,6 @@ const VListTile = vue.defineComponent({
|
|
|
567
841
|
return icon;
|
|
568
842
|
});
|
|
569
843
|
const endIcon = vue.computed(() => resolveRawIconProp(false, props.endIcon));
|
|
570
|
-
const navigationable = vueUtils.useNavigationable(props, () => props.fallbackTag, ctx);
|
|
571
844
|
const hasTo = vue.computed(() => !!props.to);
|
|
572
845
|
const link = vueRouter.useLink({
|
|
573
846
|
to: props.to || ''
|
|
@@ -580,10 +853,7 @@ const VListTile = vue.defineComponent({
|
|
|
580
853
|
const classes = vue.computed(() => {
|
|
581
854
|
const _color = color.value;
|
|
582
855
|
const hasColor = !!_color.value;
|
|
583
|
-
|
|
584
|
-
const clickable = _navigationable.clickable;
|
|
585
|
-
return [color.value.className, _navigationable.classes, {
|
|
586
|
-
'v-list-tile--clickable': clickable,
|
|
856
|
+
return [color.value.className, {
|
|
587
857
|
'v-list-tile--plain': !hasColor,
|
|
588
858
|
'v-list-tile--has-color': hasColor,
|
|
589
859
|
'v-list-tile--active': isActive.value
|
|
@@ -597,16 +867,9 @@ const VListTile = vue.defineComponent({
|
|
|
597
867
|
return () => {
|
|
598
868
|
const _startIcon = startIcon.value;
|
|
599
869
|
const _endIcon = endIcon.value;
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
} = navigationable.value;
|
|
604
|
-
return vue.createVNode(Tag, vue.mergeProps({
|
|
605
|
-
"class": ['v-list-tile', classes.value]
|
|
606
|
-
}, attrs, {
|
|
607
|
-
"onClick": ev => {
|
|
608
|
-
ctx.emit('click', ev);
|
|
609
|
-
}
|
|
870
|
+
return vue.createVNode(vueUtils.VLink, vue.mergeProps(ctx.attrs, {
|
|
871
|
+
"class": ['v-list-tile', classes.value],
|
|
872
|
+
"clickableClassName": "v-list-tile--clickable"
|
|
610
873
|
}), {
|
|
611
874
|
default: () => [_startIcon && vue.createVNode("span", {
|
|
612
875
|
"class": "v-list-tile__icon v-list-tile__icon--start"
|
|
@@ -651,7 +914,52 @@ const VDrawerLayout = vue.defineComponent({
|
|
|
651
914
|
|
|
652
915
|
});
|
|
653
916
|
|
|
654
|
-
function _isSlot$
|
|
917
|
+
function _isSlot$b(s) {
|
|
918
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
const VHero = vue.defineComponent({
|
|
922
|
+
name: 'VHero',
|
|
923
|
+
props: {
|
|
924
|
+
color: {
|
|
925
|
+
type: String,
|
|
926
|
+
default: 'primary'
|
|
927
|
+
},
|
|
928
|
+
tag: {
|
|
929
|
+
type: String,
|
|
930
|
+
default: 'header'
|
|
931
|
+
},
|
|
932
|
+
hTag: {
|
|
933
|
+
type: String,
|
|
934
|
+
default: 'h1'
|
|
935
|
+
}
|
|
936
|
+
},
|
|
937
|
+
|
|
938
|
+
setup(props, ctx) {
|
|
939
|
+
return () => {
|
|
940
|
+
let _slot;
|
|
941
|
+
|
|
942
|
+
const TagName = props.tag;
|
|
943
|
+
const HTagName = props.hTag;
|
|
944
|
+
return vue.createVNode(vueAppLayout.VAppContainer, {
|
|
945
|
+
"pulled": true
|
|
946
|
+
}, {
|
|
947
|
+
default: () => [vue.createVNode(TagName, {
|
|
948
|
+
"class": ['v-hero', vueColorScheme.toScopeColorClass(props.color)]
|
|
949
|
+
}, {
|
|
950
|
+
default: () => [vue.createVNode(HTagName, {
|
|
951
|
+
"class": "v-hero__title"
|
|
952
|
+
}, _isSlot$b(_slot = vueUtils.renderSlotOrEmpty(ctx.slots, 'default')) ? _slot : {
|
|
953
|
+
default: () => [_slot]
|
|
954
|
+
})]
|
|
955
|
+
})]
|
|
956
|
+
});
|
|
957
|
+
};
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
});
|
|
961
|
+
|
|
962
|
+
function _isSlot$a(s) {
|
|
655
963
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
656
964
|
}
|
|
657
965
|
|
|
@@ -682,7 +990,7 @@ function renderNavigationItemInput(input, extraProps) {
|
|
|
682
990
|
} = resolveNavigationItemInput(input);
|
|
683
991
|
return vue.createVNode(VNavigationItem, { ...props,
|
|
684
992
|
...extraProps
|
|
685
|
-
}, _isSlot$
|
|
993
|
+
}, _isSlot$a(label) ? label : {
|
|
686
994
|
default: () => [label]
|
|
687
995
|
});
|
|
688
996
|
}
|
|
@@ -791,9 +1099,8 @@ const VNavigationItem = vue.defineComponent({
|
|
|
791
1099
|
const onClick = ev => {
|
|
792
1100
|
if (!to.value) {
|
|
793
1101
|
toggle();
|
|
794
|
-
}
|
|
1102
|
+
} // ctx.emit('click', ev);
|
|
795
1103
|
|
|
796
|
-
ctx.emit('click', ev);
|
|
797
1104
|
};
|
|
798
1105
|
|
|
799
1106
|
const onChangeActive = isActive => {
|
|
@@ -820,13 +1127,13 @@ const VNavigationItem = vue.defineComponent({
|
|
|
820
1127
|
|
|
821
1128
|
const _children = children.value;
|
|
822
1129
|
const fallbackTag = _children ? 'button' : undefined;
|
|
823
|
-
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, {
|
|
824
1131
|
"fallbackTag": fallbackTag,
|
|
825
1132
|
"endIcon": _props.value.endIcon,
|
|
826
1133
|
"class": ['v-navigation-item', classes.value],
|
|
827
1134
|
"onClick": onClick,
|
|
828
1135
|
"onChangeActive": onChangeActive
|
|
829
|
-
}), _isSlot$
|
|
1136
|
+
}), _isSlot$a(_slot = vueUtils.renderSlotOrEmpty(ctx.slots, 'default')) ? _slot : {
|
|
830
1137
|
default: () => [_slot]
|
|
831
1138
|
}), _children && vue.createVNode(vueUtils.VExpandTransition, null, {
|
|
832
1139
|
default: () => [vue.withDirectives(vue.createVNode("div", {
|
|
@@ -974,7 +1281,7 @@ const VCheckbox = vue.defineComponent({
|
|
|
974
1281
|
|
|
975
1282
|
});
|
|
976
1283
|
|
|
977
|
-
function _isSlot$
|
|
1284
|
+
function _isSlot$9(s) {
|
|
978
1285
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
979
1286
|
}
|
|
980
1287
|
|
|
@@ -986,7 +1293,7 @@ const VCheckboxGroup = defineFormSelectorComponent({
|
|
|
986
1293
|
itemRenderer: ({
|
|
987
1294
|
attrs,
|
|
988
1295
|
slots
|
|
989
|
-
}) => vue.createVNode(VCheckbox, attrs, _isSlot$
|
|
1296
|
+
}) => vue.createVNode(VCheckbox, attrs, _isSlot$9(slots) ? slots : {
|
|
990
1297
|
default: () => [slots]
|
|
991
1298
|
})
|
|
992
1299
|
});
|
|
@@ -1038,7 +1345,7 @@ const VRadio = vue.defineComponent({
|
|
|
1038
1345
|
|
|
1039
1346
|
});
|
|
1040
1347
|
|
|
1041
|
-
function _isSlot$
|
|
1348
|
+
function _isSlot$8(s) {
|
|
1042
1349
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
1043
1350
|
}
|
|
1044
1351
|
|
|
@@ -1049,7 +1356,7 @@ const VRadioGroup = defineFormSelectorComponent({
|
|
|
1049
1356
|
itemRenderer: ({
|
|
1050
1357
|
attrs,
|
|
1051
1358
|
slots
|
|
1052
|
-
}) => vue.createVNode(VRadio, attrs, _isSlot$
|
|
1359
|
+
}) => vue.createVNode(VRadio, attrs, _isSlot$8(slots) ? slots : {
|
|
1053
1360
|
default: () => [slots]
|
|
1054
1361
|
})
|
|
1055
1362
|
});
|
|
@@ -1111,7 +1418,7 @@ const VSwitch = vue.defineComponent({
|
|
|
1111
1418
|
|
|
1112
1419
|
});
|
|
1113
1420
|
|
|
1114
|
-
function _isSlot$
|
|
1421
|
+
function _isSlot$7(s) {
|
|
1115
1422
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
1116
1423
|
}
|
|
1117
1424
|
|
|
@@ -1123,7 +1430,7 @@ const VSwitchGroup = defineFormSelectorComponent({
|
|
|
1123
1430
|
itemRenderer: ({
|
|
1124
1431
|
attrs,
|
|
1125
1432
|
slots
|
|
1126
|
-
}) => vue.createVNode(VSwitch, attrs, _isSlot$
|
|
1433
|
+
}) => vue.createVNode(VSwitch, attrs, _isSlot$7(slots) ? slots : {
|
|
1127
1434
|
default: () => [slots]
|
|
1128
1435
|
})
|
|
1129
1436
|
});
|
|
@@ -1407,6 +1714,7 @@ const VSelect = vue.defineComponent({
|
|
|
1407
1714
|
"class": ['v-select', this.classes],
|
|
1408
1715
|
"label": this.label,
|
|
1409
1716
|
"hint": this.hint,
|
|
1717
|
+
"hiddenInfo": this.hiddenInfo,
|
|
1410
1718
|
"onClickLabel": ev => {
|
|
1411
1719
|
this.focus();
|
|
1412
1720
|
}
|
|
@@ -1433,7 +1741,20 @@ const VSelect = vue.defineComponent({
|
|
|
1433
1741
|
"focused": this.menuOpened,
|
|
1434
1742
|
"onClick": ev => {
|
|
1435
1743
|
if (this.canOperation && !control.isActive) {
|
|
1436
|
-
|
|
1744
|
+
let t = ev.target;
|
|
1745
|
+
const count = 0;
|
|
1746
|
+
let hit = false;
|
|
1747
|
+
|
|
1748
|
+
while (count < 5) {
|
|
1749
|
+
if (t.classList.contains('v-select__input')) {
|
|
1750
|
+
hit = true;
|
|
1751
|
+
break;
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
t = t.parentElement;
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
control.show(hit ? t : ev);
|
|
1437
1758
|
}
|
|
1438
1759
|
}
|
|
1439
1760
|
}, { ...this.$slots,
|
|
@@ -1518,6 +1839,7 @@ const VTextField = vue.defineComponent({
|
|
|
1518
1839
|
return vue.createVNode(VFormControl, {
|
|
1519
1840
|
"nodeControl": this.nodeControl,
|
|
1520
1841
|
"focused": this.nodeControl.focused,
|
|
1842
|
+
"hiddenInfo": this.hiddenInfo,
|
|
1521
1843
|
"class": ['v-text-field', this.classes],
|
|
1522
1844
|
"label": this.label,
|
|
1523
1845
|
"hint": this.hint,
|
|
@@ -1581,6 +1903,7 @@ const VTextarea = vue.defineComponent({
|
|
|
1581
1903
|
"class": ['v-textarea', this.classes],
|
|
1582
1904
|
"label": this.label,
|
|
1583
1905
|
"hint": this.hint,
|
|
1906
|
+
"hiddenInfo": this.hiddenInfo,
|
|
1584
1907
|
"onClickLabel": ev => {
|
|
1585
1908
|
this.focus();
|
|
1586
1909
|
}
|
|
@@ -1666,93 +1989,1311 @@ const VForm = vue.defineComponent({
|
|
|
1666
1989
|
|
|
1667
1990
|
});
|
|
1668
1991
|
|
|
1669
|
-
function _isSlot$
|
|
1992
|
+
function _isSlot$6(s) {
|
|
1670
1993
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
1671
1994
|
}
|
|
1672
1995
|
|
|
1673
|
-
const
|
|
1674
|
-
name: '
|
|
1996
|
+
const VTab = vue.defineComponent({
|
|
1997
|
+
name: 'VTab',
|
|
1998
|
+
props: {
|
|
1999
|
+
value: {
|
|
2000
|
+
type: String,
|
|
2001
|
+
required: true
|
|
2002
|
+
},
|
|
2003
|
+
active: Boolean,
|
|
2004
|
+
to: [String, Object],
|
|
2005
|
+
icon: [String, Function]
|
|
2006
|
+
},
|
|
2007
|
+
emits: {
|
|
2008
|
+
click: ev => true
|
|
2009
|
+
},
|
|
1675
2010
|
|
|
1676
2011
|
setup(props, ctx) {
|
|
1677
|
-
|
|
2012
|
+
const classesRef = vue.computed(() => ({
|
|
2013
|
+
'v-tab--active': props.active
|
|
2014
|
+
}));
|
|
2015
|
+
const exposeValues = {
|
|
2016
|
+
value: props.value,
|
|
2017
|
+
active: props.active
|
|
2018
|
+
};
|
|
2019
|
+
ctx.expose(exposeValues);
|
|
1678
2020
|
return () => {
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
2021
|
+
const {
|
|
2022
|
+
to,
|
|
2023
|
+
value,
|
|
2024
|
+
icon,
|
|
2025
|
+
active
|
|
2026
|
+
} = props;
|
|
2027
|
+
const classes = ['v-tab', classesRef.value];
|
|
2028
|
+
|
|
2029
|
+
const children = vue.createVNode("span", {
|
|
2030
|
+
"class": "v-tab__content"
|
|
2031
|
+
}, [icon && resolveRawIconProp(active, icon, {
|
|
2032
|
+
class: 'v-tab__icon'
|
|
2033
|
+
}), vueUtils.renderSlotOrEmpty(ctx.slots)]);
|
|
2034
|
+
|
|
2035
|
+
if (to) {
|
|
2036
|
+
const replace = typeof to === 'string' ? undefined : to.replace;
|
|
2037
|
+
return vue.createVNode(vueRouter.RouterLink, {
|
|
2038
|
+
"class": classes,
|
|
2039
|
+
"to": to,
|
|
2040
|
+
"replace": replace
|
|
2041
|
+
}, _isSlot$6(children) ? children : {
|
|
2042
|
+
default: () => [children]
|
|
2043
|
+
});
|
|
2044
|
+
} else {
|
|
2045
|
+
return vue.createVNode("button", {
|
|
2046
|
+
"class": classes,
|
|
2047
|
+
"type": "button",
|
|
2048
|
+
"value": value,
|
|
2049
|
+
"onClick": ev => {
|
|
2050
|
+
ctx.emit('click', ev);
|
|
2051
|
+
}
|
|
2052
|
+
}, [children]);
|
|
2053
|
+
}
|
|
1684
2054
|
};
|
|
1685
2055
|
}
|
|
1686
2056
|
|
|
1687
2057
|
});
|
|
1688
2058
|
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
2059
|
+
function _isSlot$5(s) {
|
|
2060
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
2061
|
+
}
|
|
2062
|
+
|
|
2063
|
+
const VTabs = vue.defineComponent({
|
|
2064
|
+
name: 'VTabs',
|
|
2065
|
+
props: {
|
|
2066
|
+
modelValue: String,
|
|
2067
|
+
items: {
|
|
2068
|
+
type: Array,
|
|
2069
|
+
required: true // validator: (value: VTabsItem[]) => {
|
|
2070
|
+
// return Array.isArray(value) && value.length > 0;
|
|
2071
|
+
// },
|
|
2072
|
+
|
|
2073
|
+
},
|
|
2074
|
+
|
|
2075
|
+
/**
|
|
2076
|
+
* 自動スクロールする際の余剰オフセット幅(px)
|
|
2077
|
+
*/
|
|
2078
|
+
autoScrollOffset: {
|
|
2079
|
+
type: Number,
|
|
2080
|
+
default: 20
|
|
2081
|
+
},
|
|
2082
|
+
|
|
2083
|
+
/**
|
|
2084
|
+
* ルーター同期する場合設定する
|
|
2085
|
+
*/
|
|
2086
|
+
router: Function,
|
|
2087
|
+
|
|
2088
|
+
/**
|
|
2089
|
+
* ルーティング連携を行う際に、クエリベースのURLマッチングを行う
|
|
2090
|
+
* タブのURLが /page1?tab=xxx のようになる時に設定する
|
|
2091
|
+
*/
|
|
2092
|
+
withQuery: Boolean,
|
|
2093
|
+
...vueUtils.defineSlotsProps(),
|
|
2094
|
+
color: String
|
|
2095
|
+
},
|
|
2096
|
+
emits: {
|
|
2097
|
+
'update:modelValue': newValue => true,
|
|
2098
|
+
change: newValue => true
|
|
1694
2099
|
},
|
|
1695
2100
|
|
|
1696
2101
|
setup(props, ctx) {
|
|
1697
2102
|
const vui = useVui();
|
|
1698
|
-
const
|
|
1699
|
-
|
|
2103
|
+
const internalValueRef = vue.ref(null);
|
|
2104
|
+
const scrollerRef = vueKit.useVScrollerRef();
|
|
2105
|
+
const elRef = vue.ref(null);
|
|
2106
|
+
let scrollResult;
|
|
2107
|
+
const tabRefs = vue.ref([]);
|
|
2108
|
+
const currentRef = vue.computed({
|
|
2109
|
+
get: () => internalValueRef.value,
|
|
2110
|
+
set: value => {
|
|
2111
|
+
if (internalValueRef.value !== value) {
|
|
2112
|
+
internalValueRef.value = value;
|
|
2113
|
+
ctx.emit('update:modelValue', value);
|
|
2114
|
+
ctx.emit('change', value);
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
1700
2117
|
});
|
|
1701
|
-
const
|
|
1702
|
-
|
|
1703
|
-
color: () => props.color,
|
|
1704
|
-
variant: () => props.variant || vui.setting('containedVariant')
|
|
2118
|
+
const colorScope = vueColorScheme.useScopeColorClass({
|
|
2119
|
+
color: () => props.color || vui.setting('tabDefault').color
|
|
1705
2120
|
});
|
|
1706
|
-
const classes = vue.computed(() =>
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
2121
|
+
const classes = vue.computed(() => [colorScope.value.className]);
|
|
2122
|
+
const computedItemsRef = vue.computed(() => {
|
|
2123
|
+
const current = currentRef.value;
|
|
2124
|
+
const {
|
|
2125
|
+
router
|
|
2126
|
+
} = props;
|
|
2127
|
+
return props.items.map(item => {
|
|
2128
|
+
const {
|
|
2129
|
+
value
|
|
2130
|
+
} = item;
|
|
2131
|
+
const active = current === value;
|
|
2132
|
+
let location;
|
|
2133
|
+
|
|
2134
|
+
if (router) {
|
|
2135
|
+
const to = router(value);
|
|
2136
|
+
const route = vui.router.resolve(to);
|
|
2137
|
+
location = {
|
|
2138
|
+
to,
|
|
2139
|
+
route
|
|
2140
|
+
};
|
|
2141
|
+
}
|
|
2142
|
+
|
|
2143
|
+
return { ...item,
|
|
2144
|
+
active,
|
|
2145
|
+
location
|
|
2146
|
+
};
|
|
2147
|
+
});
|
|
1711
2148
|
});
|
|
1712
|
-
return () => {
|
|
1713
|
-
return vue.createVNode("div", {
|
|
1714
|
-
"class": ['v-toolbar', classes.value]
|
|
1715
|
-
}, [vueUtils.renderSlotOrEmpty(ctx.slots, 'default')]);
|
|
1716
|
-
};
|
|
1717
|
-
}
|
|
1718
2149
|
|
|
1719
|
-
|
|
2150
|
+
const setTabRef = ref => {
|
|
2151
|
+
tabRefs.value.push(ref);
|
|
2152
|
+
}; // const isMountedRef = ref(false);
|
|
1720
2153
|
|
|
1721
|
-
function _isSlot$1(s) {
|
|
1722
|
-
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
1723
|
-
}
|
|
1724
2154
|
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
inheritAttrs: false,
|
|
1728
|
-
props: {},
|
|
2155
|
+
function setupInternalValue(routable) {
|
|
2156
|
+
let value = props.modelValue;
|
|
1729
2157
|
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
2158
|
+
if (value == null || value === '') {
|
|
2159
|
+
const firstItem = props.items[0];
|
|
2160
|
+
if (!firstItem) return;
|
|
2161
|
+
value = firstItem.value;
|
|
2162
|
+
}
|
|
1735
2163
|
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
2164
|
+
if (internalValueRef.value !== value) {
|
|
2165
|
+
internalValueRef.value = value;
|
|
2166
|
+
|
|
2167
|
+
if (routable) {
|
|
2168
|
+
const {
|
|
2169
|
+
router
|
|
2170
|
+
} = props;
|
|
2171
|
+
if (!router) return;
|
|
2172
|
+
const hit = computedItemsRef.value.find(item => item.value === value);
|
|
2173
|
+
if (!hit) return;
|
|
2174
|
+
const {
|
|
2175
|
+
location
|
|
2176
|
+
} = hit;
|
|
2177
|
+
if (!location) return;
|
|
2178
|
+
const {
|
|
2179
|
+
to,
|
|
2180
|
+
route
|
|
2181
|
+
} = location;
|
|
2182
|
+
if (route.fullPath === vui.location.currentRoute.fullPath) return;
|
|
2183
|
+
vui.router[to.replace ? 'replace' : 'push'](to);
|
|
2184
|
+
} else if (!props.router && props.modelValue !== value) {
|
|
2185
|
+
ctx.emit('update:modelValue', value);
|
|
2186
|
+
ctx.emit('change', value);
|
|
2187
|
+
}
|
|
2188
|
+
}
|
|
2189
|
+
}
|
|
1745
2190
|
|
|
1746
|
-
|
|
2191
|
+
function to(value) {
|
|
2192
|
+
currentRef.value = value;
|
|
2193
|
+
}
|
|
1747
2194
|
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
required: true
|
|
2195
|
+
function cancelScroll() {
|
|
2196
|
+
if (scrollResult) {
|
|
2197
|
+
scrollResult.cancel();
|
|
2198
|
+
scrollResult = undefined;
|
|
2199
|
+
}
|
|
1754
2200
|
}
|
|
1755
|
-
|
|
2201
|
+
|
|
2202
|
+
const findTab = tab => {
|
|
2203
|
+
return tabRefs.value.find(t => t.value === tab);
|
|
2204
|
+
};
|
|
2205
|
+
|
|
2206
|
+
function scrollToTab(tabValue) {
|
|
2207
|
+
const tab = findTab(tabValue);
|
|
2208
|
+
if (!tab) return;
|
|
2209
|
+
const $tab = tab.$el;
|
|
2210
|
+
if (!$tab) return;
|
|
2211
|
+
const scroller = scrollerRef.value;
|
|
2212
|
+
if (!scroller) return;
|
|
2213
|
+
const container = scroller.scroller.element();
|
|
2214
|
+
if (!container) return;
|
|
2215
|
+
const {
|
|
2216
|
+
autoScrollOffset
|
|
2217
|
+
} = props;
|
|
2218
|
+
const tabLeft = $tab.offsetLeft;
|
|
2219
|
+
const tabWidth = $tab.offsetWidth;
|
|
2220
|
+
const tabRight = tabLeft + tabWidth;
|
|
2221
|
+
let hiddenLeft = 0;
|
|
2222
|
+
let hiddenRight = 0;
|
|
2223
|
+
const {
|
|
2224
|
+
scrollLeft,
|
|
2225
|
+
offsetWidth: scrollerWidth
|
|
2226
|
+
} = container;
|
|
2227
|
+
hiddenLeft = Math.max(scrollLeft - tabLeft, 0);
|
|
2228
|
+
hiddenRight = Math.max(tabRight - scrollerWidth - scrollLeft, 0);
|
|
2229
|
+
if (hiddenLeft > 0) hiddenLeft += autoScrollOffset;
|
|
2230
|
+
if (hiddenRight > 0) hiddenRight += autoScrollOffset;
|
|
2231
|
+
let scrollAmmount = 0;
|
|
2232
|
+
|
|
2233
|
+
if (hiddenRight > 0) {
|
|
2234
|
+
scrollAmmount = hiddenRight;
|
|
2235
|
+
}
|
|
2236
|
+
|
|
2237
|
+
if (hiddenLeft > 0) {
|
|
2238
|
+
scrollAmmount = -hiddenLeft;
|
|
2239
|
+
}
|
|
2240
|
+
|
|
2241
|
+
if (Math.abs(scrollAmmount) > 0) {
|
|
2242
|
+
cancelScroll();
|
|
2243
|
+
scrollResult = scroller.scroller.by(scrollAmmount, 0, {
|
|
2244
|
+
duration: 150
|
|
2245
|
+
});
|
|
2246
|
+
}
|
|
2247
|
+
}
|
|
2248
|
+
|
|
2249
|
+
vue.watch(() => props.modelValue, () => setupInternalValue(true));
|
|
2250
|
+
vue.watch(() => props.items, () => setupInternalValue(), {
|
|
2251
|
+
deep: true
|
|
2252
|
+
});
|
|
2253
|
+
vue.watch(() => internalValueRef.value, newValue => {
|
|
2254
|
+
scrollToTab(newValue);
|
|
2255
|
+
});
|
|
2256
|
+
vui.location.watchRoute(route => {
|
|
2257
|
+
if (!props.router) return;
|
|
2258
|
+
const path = props.withQuery ? route.fullPath : route.path;
|
|
2259
|
+
const hit = computedItemsRef.value.find(({
|
|
2260
|
+
location
|
|
2261
|
+
}) => {
|
|
2262
|
+
return location && location.route.fullPath === path;
|
|
2263
|
+
});
|
|
2264
|
+
|
|
2265
|
+
if (hit) {
|
|
2266
|
+
currentRef.value = hit.value;
|
|
2267
|
+
}
|
|
2268
|
+
}, {
|
|
2269
|
+
immediate: true
|
|
2270
|
+
});
|
|
2271
|
+
vue.onMounted(() => {
|
|
2272
|
+
scrollToTab(currentRef.value);
|
|
2273
|
+
});
|
|
2274
|
+
vue.onBeforeUnmount(() => {
|
|
2275
|
+
cancelScroll();
|
|
2276
|
+
});
|
|
2277
|
+
vue.onBeforeUpdate(() => {
|
|
2278
|
+
tabRefs.value = [];
|
|
2279
|
+
});
|
|
2280
|
+
setupInternalValue();
|
|
2281
|
+
return () => {
|
|
2282
|
+
const items = computedItemsRef.value;
|
|
2283
|
+
const itemSlot = ctx.slots.item;
|
|
2284
|
+
const children = items.map(({
|
|
2285
|
+
value,
|
|
2286
|
+
active,
|
|
2287
|
+
label,
|
|
2288
|
+
icon,
|
|
2289
|
+
location
|
|
2290
|
+
}) => {
|
|
2291
|
+
if (!label) {
|
|
2292
|
+
label = itemSlot;
|
|
2293
|
+
}
|
|
2294
|
+
|
|
2295
|
+
const children = typeof label === 'function' ? label({
|
|
2296
|
+
value,
|
|
2297
|
+
active,
|
|
2298
|
+
vui
|
|
2299
|
+
}) : label;
|
|
2300
|
+
|
|
2301
|
+
const _to = location && location.to || undefined;
|
|
2302
|
+
|
|
2303
|
+
return vue.createVNode(VTab, {
|
|
2304
|
+
"value": value,
|
|
2305
|
+
"to": _to,
|
|
2306
|
+
"icon": icon,
|
|
2307
|
+
"active": active,
|
|
2308
|
+
"ref": setTabRef,
|
|
2309
|
+
"onClick": e => {
|
|
2310
|
+
if (!e.defaultPrevented) {
|
|
2311
|
+
to(value);
|
|
2312
|
+
}
|
|
2313
|
+
}
|
|
2314
|
+
}, _isSlot$5(children) ? children : {
|
|
2315
|
+
default: () => [children]
|
|
2316
|
+
});
|
|
2317
|
+
});
|
|
2318
|
+
return vue.createVNode("div", {
|
|
2319
|
+
"class": ['v-tabs', classes.value],
|
|
2320
|
+
"ref": elRef
|
|
2321
|
+
}, [vue.createVNode(vueKit.VScroller, {
|
|
2322
|
+
"class": "v-tabs__scroller",
|
|
2323
|
+
"containerClass": "v-tabs__scroller__container",
|
|
2324
|
+
"guide": true,
|
|
2325
|
+
"ref": scrollerRef
|
|
2326
|
+
}, {
|
|
2327
|
+
default: () => [vue.createVNode("div", {
|
|
2328
|
+
"class": "v-tabs__content"
|
|
2329
|
+
}, [children])]
|
|
2330
|
+
})]);
|
|
2331
|
+
};
|
|
2332
|
+
}
|
|
2333
|
+
|
|
2334
|
+
});
|
|
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
|
+
|
|
2449
|
+
function _isSlot$3(s) {
|
|
2450
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
2451
|
+
}
|
|
2452
|
+
|
|
2453
|
+
const VContentSwitcher = vue.defineComponent({
|
|
2454
|
+
name: 'VContentSwitcher',
|
|
2455
|
+
props: {
|
|
2456
|
+
modelValue: String,
|
|
2457
|
+
order: {
|
|
2458
|
+
type: Array,
|
|
2459
|
+
default: () => []
|
|
2460
|
+
},
|
|
2461
|
+
autotop: [Boolean, Object]
|
|
2462
|
+
},
|
|
2463
|
+
emits: {
|
|
2464
|
+
'update:modelValue': modelValue => true
|
|
2465
|
+
},
|
|
2466
|
+
|
|
2467
|
+
setup(props, ctx) {
|
|
2468
|
+
const internalValueRef = vue.ref('');
|
|
2469
|
+
const transitionRef = vue.ref('');
|
|
2470
|
+
const elRef = vue.ref(null);
|
|
2471
|
+
const anchorRef = vue.ref(null);
|
|
2472
|
+
const computedOrderRef = vue.computed(() => props.order.map(row => {
|
|
2473
|
+
return typeof row === 'string' ? row : row.value;
|
|
2474
|
+
}));
|
|
2475
|
+
const currentRef = vue.computed({
|
|
2476
|
+
get: () => internalValueRef.value,
|
|
2477
|
+
set: current => {
|
|
2478
|
+
if (internalValueRef.value !== current) {
|
|
2479
|
+
internalValueRef.value = current;
|
|
2480
|
+
ctx.emit('update:modelValue', current);
|
|
2481
|
+
}
|
|
2482
|
+
}
|
|
2483
|
+
});
|
|
2484
|
+
const autotopSettingsRef = vue.computed(() => {
|
|
2485
|
+
let {
|
|
2486
|
+
autotop: settings
|
|
2487
|
+
} = props;
|
|
2488
|
+
if (settings === true) settings = {};
|
|
2489
|
+
if (!settings) return;
|
|
2490
|
+
return { ...settings
|
|
2491
|
+
};
|
|
2492
|
+
});
|
|
2493
|
+
|
|
2494
|
+
function seeTop(options) {
|
|
2495
|
+
const scoller = vueScroller.getDocumentScroller();
|
|
2496
|
+
const {
|
|
2497
|
+
value: anchor
|
|
2498
|
+
} = anchorRef;
|
|
2499
|
+
|
|
2500
|
+
if (anchor) {
|
|
2501
|
+
scoller.toElement(anchor, options);
|
|
2502
|
+
}
|
|
2503
|
+
}
|
|
2504
|
+
|
|
2505
|
+
function getEl() {
|
|
2506
|
+
const el = elRef.value;
|
|
2507
|
+
|
|
2508
|
+
if (!el) {
|
|
2509
|
+
throw new Error('missing element');
|
|
2510
|
+
}
|
|
2511
|
+
|
|
2512
|
+
return el;
|
|
2513
|
+
}
|
|
2514
|
+
|
|
2515
|
+
vue.watch(() => props.modelValue, (value, beforeValue) => {
|
|
2516
|
+
if (value == null) return;
|
|
2517
|
+
internalValueRef.value = value;
|
|
2518
|
+
if (beforeValue == null) return;
|
|
2519
|
+
const order = computedOrderRef.value;
|
|
2520
|
+
const index = order.indexOf(value);
|
|
2521
|
+
const beforeIndex = order.indexOf(beforeValue);
|
|
2522
|
+
let transition = 'fade';
|
|
2523
|
+
|
|
2524
|
+
if (index !== -1 && beforeIndex !== -1) {
|
|
2525
|
+
if (index > beforeIndex) transition = 'v-content-switcher-next';
|
|
2526
|
+
if (index < beforeIndex) transition = 'v-content-switcher-prev';
|
|
2527
|
+
}
|
|
2528
|
+
|
|
2529
|
+
transitionRef.value = transition;
|
|
2530
|
+
}, {
|
|
2531
|
+
immediate: true
|
|
2532
|
+
});
|
|
2533
|
+
vue.watch(currentRef, () => {
|
|
2534
|
+
const autotopSettings = autotopSettingsRef.value;
|
|
2535
|
+
|
|
2536
|
+
if (autotopSettings && props.modelValue != null) {
|
|
2537
|
+
seeTop(autotopSettings);
|
|
2538
|
+
}
|
|
2539
|
+
});
|
|
2540
|
+
return () => {
|
|
2541
|
+
const current = currentRef.value;
|
|
2542
|
+
const children = vueUtils.renderSlotOrEmpty(ctx.slots) || [];
|
|
2543
|
+
const currentSlot = ctx.slots[current];
|
|
2544
|
+
|
|
2545
|
+
if (currentSlot) {
|
|
2546
|
+
children.push(vue.createVNode("div", {
|
|
2547
|
+
"class": "v-content-switcher__content",
|
|
2548
|
+
"key": current
|
|
2549
|
+
}, [currentSlot(this)]));
|
|
2550
|
+
}
|
|
2551
|
+
|
|
2552
|
+
return vue.createVNode("div", {
|
|
2553
|
+
"class": "v-content-switcher",
|
|
2554
|
+
"ref": elRef
|
|
2555
|
+
}, [vue.createVNode("div", {
|
|
2556
|
+
"class": "v-content-switcher__anchor",
|
|
2557
|
+
"ref": anchorRef
|
|
2558
|
+
}, null), vue.createVNode(vue.Transition, {
|
|
2559
|
+
"name": transitionRef.value,
|
|
2560
|
+
"onBeforeLeave": el => {
|
|
2561
|
+
getEl().style.height = el.offsetHeight + 'px';
|
|
2562
|
+
},
|
|
2563
|
+
"onEnter": el => {
|
|
2564
|
+
getEl().style.height = el.offsetHeight + 'px';
|
|
2565
|
+
},
|
|
2566
|
+
"onAfterEnter": () => {
|
|
2567
|
+
getEl().style.height = '';
|
|
2568
|
+
},
|
|
2569
|
+
"onEnterCancelled": () => {
|
|
2570
|
+
getEl().style.height = '';
|
|
2571
|
+
},
|
|
2572
|
+
"onLeaveCancelled": () => {
|
|
2573
|
+
getEl().style.height = '';
|
|
2574
|
+
}
|
|
2575
|
+
}, _isSlot$3(children) ? children : {
|
|
2576
|
+
default: () => [children]
|
|
2577
|
+
})]);
|
|
2578
|
+
};
|
|
2579
|
+
}
|
|
2580
|
+
|
|
2581
|
+
});
|
|
2582
|
+
|
|
2583
|
+
const DATA_TABLE_DEFAULTS = {
|
|
2584
|
+
itemKey: 'id',
|
|
2585
|
+
pageQuery: 'page',
|
|
2586
|
+
sortQuery: 'sort',
|
|
2587
|
+
orderQuery: 'order',
|
|
2588
|
+
limitQuery: 'limit',
|
|
2589
|
+
defaultOrder: 'ASC',
|
|
2590
|
+
ascQueryValue: 'ASC',
|
|
2591
|
+
descQueryValue: 'DESC',
|
|
2592
|
+
limits: [5, 10, 20, 50, 100],
|
|
2593
|
+
limitDefault: 20,
|
|
2594
|
+
contorolThreshold: 10
|
|
2595
|
+
};
|
|
2596
|
+
function configureDataTableDefaults(defaults) {
|
|
2597
|
+
Object.assign(DATA_TABLE_DEFAULTS, defaults);
|
|
2598
|
+
|
|
2599
|
+
if (!defaults.defaultOrder && defaults.ascQueryValue) {
|
|
2600
|
+
DATA_TABLE_DEFAULTS.defaultOrder = defaults.ascQueryValue;
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
const SELECTABLE_HEADER_SYMBOL = '__selectable_header__';
|
|
2604
|
+
const VDataTable = vue.defineComponent({
|
|
2605
|
+
name: 'VDataTable',
|
|
2606
|
+
props: {
|
|
2607
|
+
/** 選択中のkeyの配列 */
|
|
2608
|
+
modelValue: {
|
|
2609
|
+
type: Array,
|
|
2610
|
+
default: () => []
|
|
2611
|
+
},
|
|
2612
|
+
itemKey: {
|
|
2613
|
+
type: String,
|
|
2614
|
+
default: () => DATA_TABLE_DEFAULTS.itemKey
|
|
2615
|
+
},
|
|
2616
|
+
|
|
2617
|
+
/**
|
|
2618
|
+
* ページネーションクエリ名
|
|
2619
|
+
*/
|
|
2620
|
+
pageQuery: {
|
|
2621
|
+
type: String,
|
|
2622
|
+
default: () => DATA_TABLE_DEFAULTS.pageQuery
|
|
2623
|
+
},
|
|
2624
|
+
|
|
2625
|
+
/**
|
|
2626
|
+
* ソートクエリ名
|
|
2627
|
+
*/
|
|
2628
|
+
sortQuery: {
|
|
2629
|
+
type: String,
|
|
2630
|
+
default: () => DATA_TABLE_DEFAULTS.sortQuery
|
|
2631
|
+
},
|
|
2632
|
+
|
|
2633
|
+
/**
|
|
2634
|
+
* 表示順クエリ名
|
|
2635
|
+
*/
|
|
2636
|
+
orderQuery: {
|
|
2637
|
+
type: String,
|
|
2638
|
+
default: () => DATA_TABLE_DEFAULTS.orderQuery
|
|
2639
|
+
},
|
|
2640
|
+
|
|
2641
|
+
/**
|
|
2642
|
+
* リミット件数クエリ名
|
|
2643
|
+
*/
|
|
2644
|
+
limitQuery: {
|
|
2645
|
+
type: String,
|
|
2646
|
+
default: () => DATA_TABLE_DEFAULTS.limitQuery
|
|
2647
|
+
},
|
|
2648
|
+
defaultOrder: {
|
|
2649
|
+
type: String,
|
|
2650
|
+
default: () => DATA_TABLE_DEFAULTS.defaultOrder
|
|
2651
|
+
},
|
|
2652
|
+
ascQueryValue: {
|
|
2653
|
+
type: String,
|
|
2654
|
+
default: () => DATA_TABLE_DEFAULTS.ascQueryValue
|
|
2655
|
+
},
|
|
2656
|
+
descQueryValue: {
|
|
2657
|
+
type: String,
|
|
2658
|
+
default: () => DATA_TABLE_DEFAULTS.descQueryValue
|
|
2659
|
+
},
|
|
2660
|
+
limits: {
|
|
2661
|
+
type: Array,
|
|
2662
|
+
default: () => DATA_TABLE_DEFAULTS.limits
|
|
2663
|
+
},
|
|
2664
|
+
limitDefault: {
|
|
2665
|
+
type: Number,
|
|
2666
|
+
default: () => DATA_TABLE_DEFAULTS.limitDefault
|
|
2667
|
+
},
|
|
2668
|
+
contorolThreshold: {
|
|
2669
|
+
type: Number,
|
|
2670
|
+
default: () => DATA_TABLE_DEFAULTS.contorolThreshold
|
|
2671
|
+
},
|
|
2672
|
+
headers: {
|
|
2673
|
+
type: Array,
|
|
2674
|
+
required: true
|
|
2675
|
+
},
|
|
2676
|
+
items: {
|
|
2677
|
+
type: Array,
|
|
2678
|
+
default: () => []
|
|
2679
|
+
},
|
|
2680
|
+
total: {
|
|
2681
|
+
type: Number,
|
|
2682
|
+
default: 0
|
|
2683
|
+
},
|
|
2684
|
+
selectable: Boolean,
|
|
2685
|
+
fixedHeader: Boolean,
|
|
2686
|
+
maxHeight: [Number, String]
|
|
2687
|
+
},
|
|
2688
|
+
emits: {
|
|
2689
|
+
input: selecteds => true
|
|
2690
|
+
},
|
|
2691
|
+
|
|
2692
|
+
setup(props, ctx) {
|
|
2693
|
+
const vui = useVui();
|
|
2694
|
+
const bootedRef = vue.ref(false);
|
|
2695
|
+
const footerHeightRef = vue.ref(0);
|
|
2696
|
+
const internalValues = vue.ref(props.modelValue.slice());
|
|
2697
|
+
const sortedItemKeysRef = vue.computed(() => props.items.map(item => item[props.itemKey]));
|
|
2698
|
+
const isEmptyRef = vue.computed(() => props.items.length === 0);
|
|
2699
|
+
const headersRef = vue.computed(() => {
|
|
2700
|
+
const {
|
|
2701
|
+
headers,
|
|
2702
|
+
selectable
|
|
2703
|
+
} = props;
|
|
2704
|
+
const ret = [];
|
|
2705
|
+
|
|
2706
|
+
if (selectable) {
|
|
2707
|
+
ret.push({
|
|
2708
|
+
key: SELECTABLE_HEADER_SYMBOL
|
|
2709
|
+
});
|
|
2710
|
+
}
|
|
2711
|
+
|
|
2712
|
+
ret.push(...headers.filter(h => !h.hidden));
|
|
2713
|
+
return ret;
|
|
2714
|
+
});
|
|
2715
|
+
const classesRef = vue.computed(() => [{
|
|
2716
|
+
'v-data-table--fixed-header': props.fixedHeader
|
|
2717
|
+
}]);
|
|
2718
|
+
const layout = vueAppLayout.VAppLayoutControl.use();
|
|
2719
|
+
const bodyInnerStylesRef = vue.computed(() => {
|
|
2720
|
+
if (!bootedRef.value) return;
|
|
2721
|
+
const {
|
|
2722
|
+
fixedHeader,
|
|
2723
|
+
maxHeight
|
|
2724
|
+
} = props;
|
|
2725
|
+
const footerHeight = footerHeightRef.value;
|
|
2726
|
+
|
|
2727
|
+
const _maxHeight = maxHeight || (fixedHeader ? '100%' : maxHeight);
|
|
2728
|
+
|
|
2729
|
+
if (!_maxHeight) {
|
|
2730
|
+
return;
|
|
2731
|
+
}
|
|
2732
|
+
|
|
2733
|
+
return {
|
|
2734
|
+
maxHeight: layout.calicurateViewHeight(_maxHeight, -footerHeight - 100, 200)
|
|
2735
|
+
};
|
|
2736
|
+
});
|
|
2737
|
+
const defaultOrderQueryRef = vue.computed(() => props.defaultOrder === props.ascQueryValue ? props.ascQueryValue : props.descQueryValue);
|
|
2738
|
+
const isTransitioningRef = vue.computed(() => {
|
|
2739
|
+
return vui.location.isQueryOnlyTransitioning([props.pageQuery, props.sortQuery, props.orderQuery, props.limitQuery]);
|
|
2740
|
+
});
|
|
2741
|
+
const pageRef = vue.computed(() => vui.location.getQuery(props.pageQuery, Number, 1));
|
|
2742
|
+
const needShowHeaderControlRef = vue.computed(() => props.items.length > props.contorolThreshold);
|
|
2743
|
+
const sortByRef = vue.computed({
|
|
2744
|
+
get: () => {
|
|
2745
|
+
return vui.location.getQuery(props.sortQuery);
|
|
2746
|
+
},
|
|
2747
|
+
|
|
2748
|
+
set(value) {
|
|
2749
|
+
vui.location.pushQuery({
|
|
2750
|
+
[props.sortQuery]: value || null,
|
|
2751
|
+
[props.pageQuery]: 1
|
|
2752
|
+
});
|
|
2753
|
+
}
|
|
2754
|
+
|
|
2755
|
+
});
|
|
2756
|
+
const ordersRef = vue.computed(() => [props.ascQueryValue, props.descQueryValue]);
|
|
2757
|
+
const usePaigingRef = vue.computed(() => props.limits.length > 0);
|
|
2758
|
+
const orderByRef = vue.computed({
|
|
2759
|
+
get: () => {
|
|
2760
|
+
const value = vui.location.getQuery(props.orderQuery);
|
|
2761
|
+
|
|
2762
|
+
if (typeof value !== 'string' || !ordersRef.value.includes(value)) {
|
|
2763
|
+
return;
|
|
2764
|
+
}
|
|
2765
|
+
|
|
2766
|
+
return value;
|
|
2767
|
+
},
|
|
2768
|
+
|
|
2769
|
+
set(value) {
|
|
2770
|
+
vui.location.pushQuery({
|
|
2771
|
+
[props.orderQuery]: value || null,
|
|
2772
|
+
[props.pageQuery]: 1
|
|
2773
|
+
});
|
|
2774
|
+
}
|
|
2775
|
+
|
|
2776
|
+
});
|
|
2777
|
+
const offsetRef = vue.computed(() => (pageRef.value - 1) * limitRef.value);
|
|
2778
|
+
const limitRef = vue.computed({
|
|
2779
|
+
get: () => vui.location.getQuery(props.limitQuery, Number, props.limitDefault),
|
|
2780
|
+
set: value => {
|
|
2781
|
+
const page = Math.floor(offsetRef.value / value) + 1;
|
|
2782
|
+
vui.location.pushQuery({
|
|
2783
|
+
[props.limitQuery]: value,
|
|
2784
|
+
[props.pageQuery]: page
|
|
2785
|
+
});
|
|
2786
|
+
}
|
|
2787
|
+
});
|
|
2788
|
+
const pageLengthRef = vue.computed(() => {
|
|
2789
|
+
const {
|
|
2790
|
+
total
|
|
2791
|
+
} = props;
|
|
2792
|
+
const _limit = limitRef.value;
|
|
2793
|
+
if (!total) return 0;
|
|
2794
|
+
return Math.ceil(total / _limit);
|
|
2795
|
+
});
|
|
2796
|
+
const lengthRef = vue.computed(() => props.items.length);
|
|
2797
|
+
const isASCRef = vue.computed(() => orderByRef.value === props.ascQueryValue); // const isDESCRef = computed(() => orderByRef.value === props.descQueryValue);
|
|
2798
|
+
|
|
2799
|
+
const sortIconRef = vue.computed(() => {
|
|
2800
|
+
let icon = vui.icon('sort');
|
|
2801
|
+
|
|
2802
|
+
if (typeof icon === 'string') {
|
|
2803
|
+
const name = icon;
|
|
2804
|
+
|
|
2805
|
+
icon = gen => {
|
|
2806
|
+
return gen({
|
|
2807
|
+
name,
|
|
2808
|
+
rotate: isASCRef.value ? 180 : 0
|
|
2809
|
+
});
|
|
2810
|
+
};
|
|
2811
|
+
}
|
|
2812
|
+
|
|
2813
|
+
return icon;
|
|
2814
|
+
});
|
|
2815
|
+
const isIndeterminateRef = vue.computed(() => {
|
|
2816
|
+
const {
|
|
2817
|
+
length
|
|
2818
|
+
} = internalValues.value;
|
|
2819
|
+
return length > 0 && length < sortedItemKeysRef.value.length;
|
|
2820
|
+
});
|
|
2821
|
+
const isAllSelectedRef = vue.computed(() => internalValues.value.length === sortedItemKeysRef.value.length);
|
|
2822
|
+
|
|
2823
|
+
function setSort(settings) {
|
|
2824
|
+
const {
|
|
2825
|
+
sort,
|
|
2826
|
+
order
|
|
2827
|
+
} = settings;
|
|
2828
|
+
if ((sort === undefined || sortByRef.value === sort) && (order === undefined || orderByRef.value === order)) return;
|
|
2829
|
+
const queries = {};
|
|
2830
|
+
|
|
2831
|
+
if (sort) {
|
|
2832
|
+
queries[props.sortQuery] = sort;
|
|
2833
|
+
}
|
|
2834
|
+
|
|
2835
|
+
if (order) {
|
|
2836
|
+
queries[props.orderQuery] = order;
|
|
2837
|
+
}
|
|
2838
|
+
|
|
2839
|
+
vui.location.pushQuery({ ...queries,
|
|
2840
|
+
[props.pageQuery]: 1
|
|
2841
|
+
});
|
|
2842
|
+
}
|
|
2843
|
+
|
|
2844
|
+
function toggleOrderBy() {
|
|
2845
|
+
return setSort({
|
|
2846
|
+
order: orderByRef.value === props.ascQueryValue ? props.descQueryValue : props.ascQueryValue
|
|
2847
|
+
});
|
|
2848
|
+
}
|
|
2849
|
+
|
|
2850
|
+
function isSelected(key) {
|
|
2851
|
+
return internalValues.value.includes(key);
|
|
2852
|
+
}
|
|
2853
|
+
|
|
2854
|
+
function select(key) {
|
|
2855
|
+
if (!internalValues.value.includes(key)) {
|
|
2856
|
+
const values = internalValues.value.slice();
|
|
2857
|
+
values.push(key);
|
|
2858
|
+
const sortedKeys = sortedItemKeysRef.value;
|
|
2859
|
+
values.sort((a, b) => {
|
|
2860
|
+
const ai = sortedKeys.indexOf(a);
|
|
2861
|
+
const bi = sortedKeys.indexOf(b);
|
|
2862
|
+
if (ai < bi) return -1;
|
|
2863
|
+
if (ai > bi) return 1;
|
|
2864
|
+
return 0;
|
|
2865
|
+
});
|
|
2866
|
+
internalValues.value = values;
|
|
2867
|
+
ctx.emit('input', values);
|
|
2868
|
+
}
|
|
2869
|
+
}
|
|
2870
|
+
|
|
2871
|
+
function selectAll() {
|
|
2872
|
+
if (!isAllSelectedRef.value) {
|
|
2873
|
+
const values = sortedItemKeysRef.value.slice();
|
|
2874
|
+
internalValues.value = values;
|
|
2875
|
+
ctx.emit('input', values);
|
|
2876
|
+
}
|
|
2877
|
+
}
|
|
2878
|
+
|
|
2879
|
+
function deselectAll() {
|
|
2880
|
+
if (internalValues.value.length) {
|
|
2881
|
+
const values = [];
|
|
2882
|
+
internalValues.value = values;
|
|
2883
|
+
ctx.emit('input', values);
|
|
2884
|
+
}
|
|
2885
|
+
}
|
|
2886
|
+
|
|
2887
|
+
function deselect(key) {
|
|
2888
|
+
const values = internalValues.value.slice();
|
|
2889
|
+
const index = values.indexOf(key);
|
|
2890
|
+
|
|
2891
|
+
if (index !== -1) {
|
|
2892
|
+
values.splice(index, 1);
|
|
2893
|
+
internalValues.value = values;
|
|
2894
|
+
ctx.emit('input', values);
|
|
2895
|
+
}
|
|
2896
|
+
}
|
|
2897
|
+
|
|
2898
|
+
function handleClickSortHeader(header, ev) {
|
|
2899
|
+
const {
|
|
2900
|
+
sortQuery
|
|
2901
|
+
} = header;
|
|
2902
|
+
if (!sortQuery) return;
|
|
2903
|
+
|
|
2904
|
+
if (sortByRef.value === sortQuery) {
|
|
2905
|
+
return toggleOrderBy();
|
|
2906
|
+
}
|
|
2907
|
+
|
|
2908
|
+
return setSort({
|
|
2909
|
+
sort: sortQuery,
|
|
2910
|
+
order: defaultOrderQueryRef.value
|
|
2911
|
+
});
|
|
2912
|
+
}
|
|
2913
|
+
|
|
2914
|
+
function genPagination() {
|
|
2915
|
+
return vue.createVNode(VPagination, {
|
|
2916
|
+
"class": "v-data-table__pagination",
|
|
2917
|
+
"dense": true,
|
|
2918
|
+
"align": "right",
|
|
2919
|
+
"routeQuery": props.pageQuery,
|
|
2920
|
+
"modelValue": pageRef.value,
|
|
2921
|
+
"length": pageLengthRef.value
|
|
2922
|
+
}, null);
|
|
2923
|
+
}
|
|
2924
|
+
|
|
2925
|
+
function genControls() {
|
|
2926
|
+
const {
|
|
2927
|
+
total
|
|
2928
|
+
} = props;
|
|
2929
|
+
const offset = offsetRef.value;
|
|
2930
|
+
const length = lengthRef.value;
|
|
2931
|
+
return vue.createVNode("div", {
|
|
2932
|
+
"class": "v-data-table__controls"
|
|
2933
|
+
}, [vue.createVNode("div", {
|
|
2934
|
+
"class": "v-data-table__controls__info"
|
|
2935
|
+
}, [vue.createVNode("small", {
|
|
2936
|
+
"class": "v-data-table__controls__info__length"
|
|
2937
|
+
}, [vue.createTextVNode("\u5168 "), total, vue.createTextVNode(" \u4EF6\u4E2D "), offset + 1, vue.createTextVNode(" \u4EF6 \u301C "), offset + length, vue.createTextVNode(" \u4EF6\u3092\u8868\u793A")])]), vue.createVNode("div", {
|
|
2938
|
+
"class": "v-data-table__controls__select-limit"
|
|
2939
|
+
}, [vue.createVNode("span", {
|
|
2940
|
+
"class": "v-data-table__controls__select-limit__prefix"
|
|
2941
|
+
}, [vue.createTextVNode("1\u30DA\u30FC\u30B8\u306B")]), vue.createVNode(VSelect, {
|
|
2942
|
+
"class": "v-data-table__controls__select-limit__node",
|
|
2943
|
+
"size": "sm",
|
|
2944
|
+
"hiddenInfo": true,
|
|
2945
|
+
"disabled": isTransitioningRef.value,
|
|
2946
|
+
"items": props.limits.map(limit => {
|
|
2947
|
+
return {
|
|
2948
|
+
label: `${limit}件`,
|
|
2949
|
+
value: limit
|
|
2950
|
+
};
|
|
2951
|
+
}),
|
|
2952
|
+
"modelValue": limitRef.value,
|
|
2953
|
+
"onUpdate:modelValue": $event => limitRef.value = $event
|
|
2954
|
+
}, null)]), vue.createVNode("div", {
|
|
2955
|
+
"class": "v-data-table__controls__pagination"
|
|
2956
|
+
}, [genPagination()])]);
|
|
2957
|
+
}
|
|
2958
|
+
|
|
2959
|
+
function genTableHeader() {
|
|
2960
|
+
const sortBy = sortByRef.value;
|
|
2961
|
+
const isIndeterminate = isIndeterminateRef.value;
|
|
2962
|
+
const isAllSelected = isAllSelectedRef.value;
|
|
2963
|
+
const {
|
|
2964
|
+
defaultOrder,
|
|
2965
|
+
ascQueryValue
|
|
2966
|
+
} = props;
|
|
2967
|
+
const usePaiging = usePaigingRef.value;
|
|
2968
|
+
const children = headersRef.value.map(header => {
|
|
2969
|
+
const {
|
|
2970
|
+
label,
|
|
2971
|
+
sortQuery,
|
|
2972
|
+
align,
|
|
2973
|
+
key
|
|
2974
|
+
} = header;
|
|
2975
|
+
const headerChildren = [];
|
|
2976
|
+
|
|
2977
|
+
if (label != null && typeof label !== 'boolean') {
|
|
2978
|
+
let _children = typeof label === 'function' ? label(vui) : label;
|
|
2979
|
+
|
|
2980
|
+
if (_children && !Array.isArray(_children) && typeof _children === 'object') {
|
|
2981
|
+
_children = JSON.stringify(_children);
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2984
|
+
headerChildren.push(_children);
|
|
2985
|
+
}
|
|
2986
|
+
|
|
2987
|
+
if (key === SELECTABLE_HEADER_SYMBOL) {
|
|
2988
|
+
headerChildren.push(vue.createVNode(VCheckbox, {
|
|
2989
|
+
"modelValue": isAllSelected,
|
|
2990
|
+
"indeterminate": isIndeterminate,
|
|
2991
|
+
"onChange": ev => {
|
|
2992
|
+
if (isAllSelectedRef.value) {
|
|
2993
|
+
deselectAll();
|
|
2994
|
+
} else {
|
|
2995
|
+
selectAll();
|
|
2996
|
+
}
|
|
2997
|
+
}
|
|
2998
|
+
}, null));
|
|
2999
|
+
} // if (key === DELETOR_HEADER_SYMBOL) {
|
|
3000
|
+
// headerChildren.push('削除');
|
|
3001
|
+
// }
|
|
3002
|
+
|
|
3003
|
+
|
|
3004
|
+
const sortActive = sortBy === sortQuery;
|
|
3005
|
+
|
|
3006
|
+
if (sortQuery && usePaiging) {
|
|
3007
|
+
const isASC = sortActive ? isASCRef.value : defaultOrder === ascQueryValue;
|
|
3008
|
+
headerChildren.unshift(vue.createVNode(VIcon, {
|
|
3009
|
+
"class": "v-data-table__table__sort-icon v-data-table__table__sort-icon--empty",
|
|
3010
|
+
"name": "$empty"
|
|
3011
|
+
}, null));
|
|
3012
|
+
headerChildren.push(resolveRawIconProp(false, sortIconRef.value, {
|
|
3013
|
+
class: ['v-data-table__table__sort-icon v-data-table__table__sort-icon--arrow', {
|
|
3014
|
+
'v-data-table__table__sort-icon--asc': isASC,
|
|
3015
|
+
'v-data-table__table__sort-icon--desc': !isASC
|
|
3016
|
+
}]
|
|
3017
|
+
}));
|
|
3018
|
+
}
|
|
3019
|
+
|
|
3020
|
+
const classes = ['v-data-table__table__cell', {
|
|
3021
|
+
'v-data-table__table__cell--active': sortActive
|
|
3022
|
+
}];
|
|
3023
|
+
|
|
3024
|
+
if (align) {
|
|
3025
|
+
classes.push(`v-data-table__table__cell--${align}`);
|
|
3026
|
+
}
|
|
3027
|
+
|
|
3028
|
+
return vue.createVNode("th", {
|
|
3029
|
+
"class": classes,
|
|
3030
|
+
"key": header.key,
|
|
3031
|
+
"tabindex": sortQuery && usePaiging ? 0 : undefined,
|
|
3032
|
+
"onClick": ev => {
|
|
3033
|
+
if (!sortQuery || !usePaiging) return;
|
|
3034
|
+
handleClickSortHeader(header);
|
|
3035
|
+
}
|
|
3036
|
+
}, [vue.createVNode("div", {
|
|
3037
|
+
"class": "v-data-table__table__cell__tile"
|
|
3038
|
+
}, [headerChildren])]);
|
|
3039
|
+
});
|
|
3040
|
+
return vue.createVNode("thead", {
|
|
3041
|
+
"class": "v-data-table__table__header"
|
|
3042
|
+
}, [vue.createVNode("tr", null, [children])]);
|
|
3043
|
+
}
|
|
3044
|
+
|
|
3045
|
+
function toggleSelect(key) {
|
|
3046
|
+
return isSelected(key) ? deselect(key) : select(key);
|
|
3047
|
+
}
|
|
3048
|
+
|
|
3049
|
+
function defaultItemSlot(payload) {
|
|
3050
|
+
const {
|
|
3051
|
+
key,
|
|
3052
|
+
item,
|
|
3053
|
+
selected
|
|
3054
|
+
} = payload;
|
|
3055
|
+
const headers = headersRef.value; // const { $scopedSlots, $createElement, deletor } = this;
|
|
3056
|
+
|
|
3057
|
+
const children = headers.map(header => {
|
|
3058
|
+
const {
|
|
3059
|
+
cell,
|
|
3060
|
+
align,
|
|
3061
|
+
key: headerKey
|
|
3062
|
+
} = header;
|
|
3063
|
+
const cellSlot = cell || ctx.slots.cell;
|
|
3064
|
+
let cellChildren;
|
|
3065
|
+
|
|
3066
|
+
if (cellSlot) {
|
|
3067
|
+
const cellPayload = {
|
|
3068
|
+
vui,
|
|
3069
|
+
item,
|
|
3070
|
+
selected
|
|
3071
|
+
};
|
|
3072
|
+
|
|
3073
|
+
let _children = cellSlot(cellPayload);
|
|
3074
|
+
|
|
3075
|
+
if (_children && !Array.isArray(_children) && typeof _children === 'object') {
|
|
3076
|
+
_children = JSON.stringify(_children);
|
|
3077
|
+
}
|
|
3078
|
+
|
|
3079
|
+
cellChildren = _children;
|
|
3080
|
+
}
|
|
3081
|
+
|
|
3082
|
+
if (!cellChildren) {
|
|
3083
|
+
switch (headerKey) {
|
|
3084
|
+
case SELECTABLE_HEADER_SYMBOL:
|
|
3085
|
+
{
|
|
3086
|
+
cellChildren = [vue.createVNode(VCheckbox, {
|
|
3087
|
+
"modelValue": selected,
|
|
3088
|
+
"onChange": ev => {
|
|
3089
|
+
toggleSelect(key);
|
|
3090
|
+
}
|
|
3091
|
+
}, null)];
|
|
3092
|
+
break;
|
|
3093
|
+
}
|
|
3094
|
+
// case DELETOR_HEADER_SYMBOL: {
|
|
3095
|
+
// if (deletor) {
|
|
3096
|
+
// const onClick = async (event: MouseEvent) => {
|
|
3097
|
+
// if (
|
|
3098
|
+
// await this.$confirm(`${key}を削除します。よろしいですか?`)
|
|
3099
|
+
// ) {
|
|
3100
|
+
// this.deletingTargets.push(key);
|
|
3101
|
+
// await deletor(item);
|
|
3102
|
+
// this.deletingTargets.splice(
|
|
3103
|
+
// this.deletingTargets.indexOf(key),
|
|
3104
|
+
// 1,
|
|
3105
|
+
// );
|
|
3106
|
+
// }
|
|
3107
|
+
// };
|
|
3108
|
+
// cellChildren = [
|
|
3109
|
+
// <VBtn
|
|
3110
|
+
// icon="trush"
|
|
3111
|
+
// onClick={onClick}
|
|
3112
|
+
// disabled={this.deletingTargets.includes(key)}
|
|
3113
|
+
// />,
|
|
3114
|
+
// ];
|
|
3115
|
+
// }
|
|
3116
|
+
// break;
|
|
3117
|
+
// }
|
|
3118
|
+
}
|
|
3119
|
+
}
|
|
3120
|
+
|
|
3121
|
+
const classes = align ? {
|
|
3122
|
+
[`v-data-table__table__cell--${align}`]: true
|
|
3123
|
+
} : undefined;
|
|
3124
|
+
return vue.createVNode("td", {
|
|
3125
|
+
"class": ['v-data-table__table__cell', classes],
|
|
3126
|
+
"key": header.key
|
|
3127
|
+
}, [cellChildren]);
|
|
3128
|
+
});
|
|
3129
|
+
return vue.createVNode("tr", {
|
|
3130
|
+
"class": ['v-data-table__table__item', {
|
|
3131
|
+
'v-data-table__table__item--selected': selected
|
|
3132
|
+
}],
|
|
3133
|
+
"key": key
|
|
3134
|
+
}, [children]);
|
|
3135
|
+
}
|
|
3136
|
+
|
|
3137
|
+
function genBody() {
|
|
3138
|
+
const {
|
|
3139
|
+
items,
|
|
3140
|
+
itemKey
|
|
3141
|
+
} = props;
|
|
3142
|
+
const {
|
|
3143
|
+
item: itemSlot = defaultItemSlot
|
|
3144
|
+
} = ctx.slots;
|
|
3145
|
+
const children = items.map(item => {
|
|
3146
|
+
const key = item[itemKey];
|
|
3147
|
+
const payload = {
|
|
3148
|
+
key,
|
|
3149
|
+
item,
|
|
3150
|
+
selected: isSelected(key)
|
|
3151
|
+
};
|
|
3152
|
+
return itemSlot(payload);
|
|
3153
|
+
});
|
|
3154
|
+
return vue.createVNode("tbody", {
|
|
3155
|
+
"class": "v-data-table__table__body"
|
|
3156
|
+
}, [children]);
|
|
3157
|
+
}
|
|
3158
|
+
|
|
3159
|
+
vue.watch(() => props.modelValue, modelValue => {
|
|
3160
|
+
internalValues.value = modelValue.slice();
|
|
3161
|
+
});
|
|
3162
|
+
vue.watch(() => props.items, items => {
|
|
3163
|
+
internalValues.value = internalValues.value.filter(key => {
|
|
3164
|
+
return sortedItemKeysRef.value.includes(key);
|
|
3165
|
+
});
|
|
3166
|
+
});
|
|
3167
|
+
vue.onMounted(() => {
|
|
3168
|
+
bootedRef.value = true;
|
|
3169
|
+
});
|
|
3170
|
+
return () => {
|
|
3171
|
+
const isEmpty = isEmptyRef.value;
|
|
3172
|
+
const usePaiging = usePaigingRef.value;
|
|
3173
|
+
return vue.createVNode("div", {
|
|
3174
|
+
"class": ['v-data-table', classesRef.value]
|
|
3175
|
+
}, [!isEmpty && usePaiging && needShowHeaderControlRef.value && vue.createVNode("div", {
|
|
3176
|
+
"class": "v-data-table__header"
|
|
3177
|
+
}, [genControls()]), vue.createVNode("div", {
|
|
3178
|
+
"class": "v-data-table__body container-pull"
|
|
3179
|
+
}, [isEmpty ? vue.createVNode("div", {
|
|
3180
|
+
"class": "v-data-table__empty--message"
|
|
3181
|
+
}, null) : vue.createVNode(VPaper, {
|
|
3182
|
+
"class": "v-data-table__body__inner",
|
|
3183
|
+
"style": bodyInnerStylesRef.value
|
|
3184
|
+
}, {
|
|
3185
|
+
default: () => [vue.createVNode("div", {
|
|
3186
|
+
"class": "v-data-table__table-wrapper"
|
|
3187
|
+
}, [vue.createVNode("table", {
|
|
3188
|
+
"class": "v-data-table__table"
|
|
3189
|
+
}, [genTableHeader(), genBody()])])]
|
|
3190
|
+
}), vue.createVNode(vue.Transition, {
|
|
3191
|
+
"name": "fade"
|
|
3192
|
+
}, {
|
|
3193
|
+
default: () => [isTransitioningRef.value && vue.createVNode("div", {
|
|
3194
|
+
"class": "v-data-table__loading"
|
|
3195
|
+
}, [vue.createVNode(vueLoading.VProgressCircular, {
|
|
3196
|
+
"indeterminate": true
|
|
3197
|
+
}, null)])]
|
|
3198
|
+
})]), !isEmpty && usePaiging && vue.withDirectives(vue.createVNode("div", {
|
|
3199
|
+
"class": "v-data-table__footer"
|
|
3200
|
+
}, [genControls()]), [vueUtils.resizeDirectiveArgument(({
|
|
3201
|
+
height
|
|
3202
|
+
}) => {
|
|
3203
|
+
footerHeightRef.value = height;
|
|
3204
|
+
})])]);
|
|
3205
|
+
};
|
|
3206
|
+
}
|
|
3207
|
+
|
|
3208
|
+
});
|
|
3209
|
+
|
|
3210
|
+
function _isSlot$2(s) {
|
|
3211
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
3212
|
+
}
|
|
3213
|
+
|
|
3214
|
+
const VApp = vue.defineComponent({
|
|
3215
|
+
name: 'VApp',
|
|
3216
|
+
|
|
3217
|
+
setup(props, ctx) {
|
|
3218
|
+
vueKit.useInjectTheme();
|
|
3219
|
+
return () => {
|
|
3220
|
+
let _slot;
|
|
3221
|
+
|
|
3222
|
+
return vue.createVNode(vueKit.VStackRoot, null, _isSlot$2(_slot = vueKit.renderSlotOrEmpty(ctx.slots, 'default')) ? _slot : {
|
|
3223
|
+
default: () => [_slot]
|
|
3224
|
+
});
|
|
3225
|
+
};
|
|
3226
|
+
}
|
|
3227
|
+
|
|
3228
|
+
});
|
|
3229
|
+
|
|
3230
|
+
const VToolbar = vue.defineComponent({
|
|
3231
|
+
name: 'VToolbar',
|
|
3232
|
+
props: { ...createElevationProps(),
|
|
3233
|
+
...vueColorScheme.colorSchemeProps(),
|
|
3234
|
+
dense: Boolean
|
|
3235
|
+
},
|
|
3236
|
+
|
|
3237
|
+
setup(props, ctx) {
|
|
3238
|
+
const vui = useVui();
|
|
3239
|
+
const elevation = useElevation(props, {
|
|
3240
|
+
defaultValue: 4
|
|
3241
|
+
});
|
|
3242
|
+
const dense = vue.computed(() => props.dense);
|
|
3243
|
+
const color = vueColorScheme.useColorClasses({
|
|
3244
|
+
color: () => props.color,
|
|
3245
|
+
variant: () => props.variant || vui.setting('containedVariant')
|
|
3246
|
+
});
|
|
3247
|
+
const classes = vue.computed(() => {
|
|
3248
|
+
return [elevation.elevationClassName.value, color.colorClasses.value, {
|
|
3249
|
+
'v-toolbar--plain': !color.color.value.value,
|
|
3250
|
+
'v-toolbar--dense': dense.value
|
|
3251
|
+
}];
|
|
3252
|
+
});
|
|
3253
|
+
return () => {
|
|
3254
|
+
return vue.createVNode("div", {
|
|
3255
|
+
"class": ['v-toolbar', classes.value]
|
|
3256
|
+
}, [vueUtils.renderSlotOrEmpty(ctx.slots, 'default')]);
|
|
3257
|
+
};
|
|
3258
|
+
}
|
|
3259
|
+
|
|
3260
|
+
});
|
|
3261
|
+
|
|
3262
|
+
function _isSlot$1(s) {
|
|
3263
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
3264
|
+
}
|
|
3265
|
+
|
|
3266
|
+
const VToolbarMenu = vue.defineComponent({
|
|
3267
|
+
name: 'VToolbarMenu',
|
|
3268
|
+
inheritAttrs: false,
|
|
3269
|
+
props: {},
|
|
3270
|
+
|
|
3271
|
+
setup(props, ctx) {
|
|
3272
|
+
const vui = useVui();
|
|
3273
|
+
const plain = vui.setting('plainVariant');
|
|
3274
|
+
return () => {
|
|
3275
|
+
let _slot;
|
|
3276
|
+
|
|
3277
|
+
const variant = props.variant || plain;
|
|
3278
|
+
return vue.createVNode(VButton, vue.mergeProps(ctx.attrs, {
|
|
3279
|
+
"variant": variant,
|
|
3280
|
+
"class": ['v-toolbar-menu']
|
|
3281
|
+
}), _isSlot$1(_slot = vueUtils.renderSlotOrEmpty(ctx.slots)) ? _slot : {
|
|
3282
|
+
default: () => [_slot]
|
|
3283
|
+
});
|
|
3284
|
+
};
|
|
3285
|
+
}
|
|
3286
|
+
|
|
3287
|
+
});
|
|
3288
|
+
|
|
3289
|
+
const VToolbarEdge = vue.defineComponent({
|
|
3290
|
+
name: 'VToolbarEdge',
|
|
3291
|
+
props: {
|
|
3292
|
+
edge: {
|
|
3293
|
+
type: String,
|
|
3294
|
+
required: true
|
|
3295
|
+
}
|
|
3296
|
+
},
|
|
1756
3297
|
|
|
1757
3298
|
setup(props, ctx) {
|
|
1758
3299
|
const edge = vue.computed(() => props.edge);
|
|
@@ -1807,13 +3348,27 @@ class VuiService {
|
|
|
1807
3348
|
autoScrollToElementOffsetTop;
|
|
1808
3349
|
textareaRows;
|
|
1809
3350
|
requiredChip;
|
|
3351
|
+
router;
|
|
3352
|
+
location;
|
|
1810
3353
|
constructor(options) {
|
|
1811
3354
|
this.options = options;
|
|
3355
|
+
this.configure();
|
|
1812
3356
|
const { selectionSeparator = () => ', ', autoScrollToElementOffsetTop = DEFAULT_AUTO_SCROLL_TO_ELEMENT_OFFSET_TOP, textareaRows = DEFAULT_TEXTAREA_ROWS, requiredChip = () => '*', } = options;
|
|
1813
3357
|
this.selectionSeparator = selectionSeparator;
|
|
1814
3358
|
this.autoScrollToElementOffsetTop = autoScrollToElementOffsetTop;
|
|
1815
3359
|
this.textareaRows = textareaRows;
|
|
1816
3360
|
this.requiredChip = requiredChip;
|
|
3361
|
+
this.router = options.router;
|
|
3362
|
+
this.location = new vueUtils.LocationService({
|
|
3363
|
+
router: this.router,
|
|
3364
|
+
});
|
|
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;
|
|
1817
3372
|
}
|
|
1818
3373
|
setting(key) {
|
|
1819
3374
|
return this.options.uiSettings[key];
|
|
@@ -1897,27 +3452,34 @@ exports.VSnackbar = vueKit.VSnackbar;
|
|
|
1897
3452
|
exports.ICON_NAMES = iconFont.ICON_NAMES;
|
|
1898
3453
|
exports.CONTROL_FIELD_VARIANTS = CONTROL_FIELD_VARIANTS;
|
|
1899
3454
|
exports.CONTROL_SIZES = CONTROL_SIZES;
|
|
3455
|
+
exports.PAGINATION_ALIGNS = PAGINATION_ALIGNS;
|
|
1900
3456
|
exports.VApp = VApp;
|
|
3457
|
+
exports.VBreadcrumbs = VBreadcrumbs;
|
|
1901
3458
|
exports.VButton = VButton;
|
|
1902
3459
|
exports.VCard = VCard;
|
|
1903
3460
|
exports.VCardActions = VCardActions;
|
|
1904
3461
|
exports.VCardContent = VCardContent;
|
|
1905
3462
|
exports.VCheckbox = VCheckbox;
|
|
1906
3463
|
exports.VCheckboxGroup = VCheckboxGroup;
|
|
3464
|
+
exports.VContentSwitcher = VContentSwitcher;
|
|
3465
|
+
exports.VDataTable = VDataTable;
|
|
1907
3466
|
exports.VDrawerLayout = VDrawerLayout;
|
|
1908
3467
|
exports.VForm = VForm;
|
|
3468
|
+
exports.VHero = VHero;
|
|
1909
3469
|
exports.VIcon = VIcon;
|
|
1910
3470
|
exports.VListTile = VListTile;
|
|
1911
3471
|
exports.VNavigation = VNavigation;
|
|
1912
3472
|
exports.VNavigationItem = VNavigationItem;
|
|
1913
3473
|
exports.VOption = VOption;
|
|
1914
3474
|
exports.VOptionGroup = VOptionGroup;
|
|
3475
|
+
exports.VPagination = VPagination;
|
|
1915
3476
|
exports.VPaper = VPaper;
|
|
1916
3477
|
exports.VRadio = VRadio;
|
|
1917
3478
|
exports.VRadioGroup = VRadioGroup;
|
|
1918
3479
|
exports.VSelect = VSelect;
|
|
1919
3480
|
exports.VSwitch = VSwitch;
|
|
1920
3481
|
exports.VSwitchGroup = VSwitchGroup;
|
|
3482
|
+
exports.VTabs = VTabs;
|
|
1921
3483
|
exports.VTextField = VTextField;
|
|
1922
3484
|
exports.VTextarea = VTextarea;
|
|
1923
3485
|
exports.VToolbar = VToolbar;
|
|
@@ -1941,6 +3503,7 @@ exports.VuiControlInjectionKey = VuiControlInjectionKey;
|
|
|
1941
3503
|
exports.VuiInjectionKey = VuiInjectionKey;
|
|
1942
3504
|
exports.VuiPlugin = VuiPlugin;
|
|
1943
3505
|
exports.VuiService = VuiService;
|
|
3506
|
+
exports.configureDataTableDefaults = configureDataTableDefaults;
|
|
1944
3507
|
exports.createCardProps = createCardProps;
|
|
1945
3508
|
exports.createControlFieldProviderProps = createControlFieldProviderProps;
|
|
1946
3509
|
exports.createControlProps = createControlProps;
|
|
@@ -1953,6 +3516,7 @@ exports.defineFormSelectorComponent = defineFormSelectorComponent;
|
|
|
1953
3516
|
exports.iconProps = iconProps;
|
|
1954
3517
|
exports.installVuiPlugin = installVuiPlugin;
|
|
1955
3518
|
exports.listTileEmits = listTileEmits;
|
|
3519
|
+
exports.paginationProps = paginationProps;
|
|
1956
3520
|
exports.rawIconProp = rawIconProp;
|
|
1957
3521
|
exports.renderNavigationItemInput = renderNavigationItemInput;
|
|
1958
3522
|
exports.resolveNavigationItemInput = resolveNavigationItemInput;
|