@fastkit/vui 0.6.12 → 0.6.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/vui.cjs.js CHANGED
@@ -4,7 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vueKit = require('@fastkit/vue-kit');
6
6
  var vue = require('vue');
7
+ var vueColorScheme = require('@fastkit/vue-color-scheme');
8
+ var vueUtils = require('@fastkit/vue-utils');
9
+ var vueLoading = require('@fastkit/vue-loading');
7
10
  var iconFont = require('@fastkit/icon-font');
11
+ var vueRouter = require('vue-router');
8
12
 
9
13
  const CONTROL_SIZES = ['sm', 'md', 'lg'];
10
14
  const CONTROL_FIELD_VARIANTS = ['outlined', 'filled', 'flat'];
@@ -37,8 +41,8 @@ function useVuiColorProvider() {
37
41
  return parent;
38
42
  }
39
43
  const vui = useVui();
40
- const primary = vue.computed(() => vui.color('primary'));
41
- const error = vue.computed(() => vui.color('error'));
44
+ const primary = vue.computed(() => vui.setting('primaryScope'));
45
+ const error = vue.computed(() => vui.setting('errorScope'));
42
46
  const provider = {
43
47
  primary,
44
48
  error,
@@ -233,16 +237,162 @@ function defineFormSelectorComponent(opts) {
233
237
  });
234
238
  }
235
239
 
236
- const VIcon = vue.defineComponent({
237
- name: 'VIcon',
238
- props: {
239
- name: {
240
+ function createElevationProps() {
241
+ return vueUtils.createPropsOptions({
242
+ elevation: Number,
243
+ });
244
+ }
245
+ function useElevation(props, opts = {}) {
246
+ const elevationValue = vue.computed(() => props.elevation == null ? opts.defaultValue : props.elevation);
247
+ const elevationClassName = vue.computed(() => {
248
+ const v = elevationValue.value;
249
+ return v == null ? undefined : `elevation-${v}`;
250
+ });
251
+ return {
252
+ elevationValue,
253
+ elevationClassName,
254
+ };
255
+ }
256
+
257
+ function createPaperBaseProps() {
258
+ return {
259
+ color: String,
260
+ tag: {
240
261
  type: String,
241
- required: true
262
+ default: 'div'
242
263
  },
243
- rotate: {
244
- type: Number
245
- }
264
+ ...vueUtils.defineSlotsProps()
265
+ };
266
+ }
267
+ function createPaperProps() {
268
+ return { ...createElevationProps(),
269
+ ...createPaperBaseProps(),
270
+ square: Boolean,
271
+ headerProps: Object,
272
+ bodyProps: Object,
273
+ footerProps: Object
274
+ };
275
+ }
276
+ const VPaper = vue.defineComponent({
277
+ name: 'VPaper',
278
+ props: createPaperProps(),
279
+
280
+ setup(props, ctx) {
281
+ const tag = vue.computed(() => props.tag);
282
+ const elevation = useElevation(props, {
283
+ defaultValue: 1
284
+ });
285
+ const scope = vueColorScheme.useScopeColorClass(props);
286
+ const classes = vue.computed(() => [elevation.elevationClassName.value, scope.value.className, {
287
+ 'v-paper--plain': !scope.value.value,
288
+ 'v-paper--has-color': !!scope.value.value,
289
+ 'v-paper--square': props.square
290
+ }]);
291
+ const headerProps = vue.computed(() => props.headerProps);
292
+ const bodyProps = vue.computed(() => props.bodyProps);
293
+ const footerProps = vue.computed(() => props.footerProps);
294
+ return () => {
295
+ const TagName = tag.value;
296
+ const header = vueUtils.renderSlotOrEmpty(ctx.slots, 'header');
297
+ const footer = vueUtils.renderSlotOrEmpty(ctx.slots, 'footer');
298
+ return vue.createVNode(TagName, {
299
+ "class": ['v-paper', classes.value]
300
+ }, {
301
+ default: () => [header && vue.createVNode("div", vue.mergeProps({
302
+ "class": "v-paper__header"
303
+ }, headerProps.value), [header]), vue.createVNode("div", vue.mergeProps({
304
+ "class": "v-paper__body"
305
+ }, bodyProps.value), [vueUtils.renderSlotOrEmpty(ctx.slots, 'default')]), footer && vue.createVNode("div", vue.mergeProps({
306
+ "class": "v-paper__footer"
307
+ }, footerProps.value), [footer])]
308
+ });
309
+ };
310
+ }
311
+
312
+ });
313
+
314
+ function createCardProps() {
315
+ return { ...createPaperProps()
316
+ };
317
+ }
318
+ const VCard = vue.defineComponent({
319
+ name: 'VCard',
320
+ props: createCardProps(),
321
+
322
+ setup(props, ctx) {
323
+ const _props = vue.computed(() => props);
324
+
325
+ return () => {
326
+ return vue.createVNode(VPaper, vue.mergeProps({
327
+ "class": "v-card"
328
+ }, _props.value), ctx.slots);
329
+ };
330
+ }
331
+
332
+ });
333
+
334
+ const VCardContent = vue.defineComponent({
335
+ name: 'VCardContent',
336
+
337
+ setup(props, ctx) {
338
+ return () => {
339
+ return vue.createVNode("div", {
340
+ "class": "v-card-content"
341
+ }, [vueUtils.renderSlotOrEmpty(ctx.slots, 'default')]);
342
+ };
343
+ }
344
+
345
+ });
346
+
347
+ const VCardActions = vue.defineComponent({
348
+ name: 'VCardActions',
349
+
350
+ setup(props, ctx) {
351
+ return () => {
352
+ return vue.createVNode("div", {
353
+ "class": "v-card-actions"
354
+ }, [vueUtils.renderSlotOrEmpty(ctx.slots, 'default')]);
355
+ };
356
+ }
357
+
358
+ });
359
+
360
+ // prop: RawIconProp<T>,
361
+ // payload: () => T,
362
+ // ): RawIconProp {
363
+ // if (!prop || typeof prop !== 'function') {
364
+ // return prop;
365
+ // }
366
+ // const fn = (gen: IconGenerator): VNodeChild => {
367
+ // const t = payload();
368
+ // return prop(gen, t);
369
+ // };
370
+ // return fn;
371
+ // }
372
+ // export const rawRawIconProp = [String, Function] as PropType<RawIconProp>;
373
+
374
+ const _rawIconProp = [String, Function];
375
+ function rawIconProp() {
376
+ return _rawIconProp;
377
+ }
378
+ function resolveRawIconProp(payload, prop, extraProps) {
379
+ if (!prop) return;
380
+ return typeof prop === 'function' ? prop(input => vue.createVNode(VIcon, vue.mergeProps(input, extraProps), null), payload) : vue.createVNode(VIcon, vue.mergeProps(extraProps, {
381
+ "name": prop
382
+ }), null);
383
+ }
384
+ const iconProps = vueUtils.createPropsOptions({
385
+ name: {
386
+ type: String,
387
+ required: true
388
+ },
389
+ rotate: {
390
+ type: Number
391
+ }
392
+ });
393
+ const VIcon = vue.defineComponent({
394
+ name: 'VIcon',
395
+ props: { ...iconProps
246
396
  },
247
397
  emits: {},
248
398
 
@@ -272,6 +422,464 @@ const VIcon = vue.defineComponent({
272
422
 
273
423
  });
274
424
 
425
+ function resolveRawVButtonIcon(raw, type = 'main') {
426
+ if (!raw) return;
427
+ return typeof raw === 'function' ? raw : () => vue.createVNode(VIcon, {
428
+ "class": ['v-button__icon', `v-button__icon--${type}`],
429
+ "name": raw
430
+ }, null);
431
+ }
432
+
433
+ const vueButtonProps = vueUtils.createPropsOptions({ ...vueColorScheme.colorSchemeProps(),
434
+ ...vueUtils.navigationableProps,
435
+ spacer: [Boolean, String],
436
+ loading: Boolean,
437
+ rounded: Boolean,
438
+ icon: [String, Function],
439
+ startIcon: [String, Function],
440
+ endIcon: [String, Function],
441
+ ...createControlProps()
442
+ });
443
+ const LOADING_SIZE_MAP = {
444
+ sm: 14,
445
+ md: 20,
446
+ lg: 28
447
+ };
448
+ const VButton = vue.defineComponent({
449
+ name: 'VButton',
450
+ props: vueButtonProps,
451
+ emits: { ...vueUtils.navigationableEmits
452
+ },
453
+
454
+ setup(props, ctx) {
455
+ const vui = useVui();
456
+ const control = useControl(props);
457
+ const defaults = vui.setting('buttonDefault');
458
+ const icon = vue.computed(() => {
459
+ const _icon = resolveRawVButtonIcon(props.icon);
460
+
461
+ return _icon && _icon();
462
+ });
463
+ const startIcon = vue.computed(() => {
464
+ const _icon = resolveRawVButtonIcon(props.startIcon, 'start');
465
+
466
+ return _icon && _icon();
467
+ });
468
+ const endIcon = vue.computed(() => {
469
+ const _icon = resolveRawVButtonIcon(props.endIcon, 'end');
470
+
471
+ return _icon && _icon();
472
+ });
473
+ const color = vueColorScheme.useColorClasses({
474
+ color: () => props.color || defaults.color,
475
+ variant: () => props.variant || (icon.value ? vui.setting('plainVariant') : defaults.variant)
476
+ });
477
+ const isPlain = vue.computed(() => color.variant.value.value === vui.setting('plainVariant') && color.color.value.value === defaults.color);
478
+ const navigationable = vueUtils.useNavigationable(props);
479
+ const isLoading = vue.computed(() => props.loading);
480
+ const isDisabled = vue.computed(() => props.disabled);
481
+ const isRounded = vue.computed(() => props.rounded || !!icon.value);
482
+ const spacer = vue.computed(() => {
483
+ const _spacer = props.spacer;
484
+ if (!_spacer) return;
485
+ return _spacer === true ? 'left' : _spacer;
486
+ });
487
+ const classes = vue.computed(() => [color.colorClasses.value, navigationable.value.classes, spacer.value ? `v-button--spacer-${spacer.value}` : undefined, `v-button--${control.size.value}`, {
488
+ 'v-button--loading': isLoading.value,
489
+ 'v-button--icon': !!icon.value,
490
+ 'v-button--rounded': isRounded.value,
491
+ 'v-button--plain': isPlain.value
492
+ }]);
493
+ return () => {
494
+ const {
495
+ Tag,
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({
507
+ "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
+ }), {
521
+ default: () => [vue.createVNode("span", {
522
+ "class": "v-button__content"
523
+ }, [startIcon.value, children, icon.value, endIcon.value]), isLoading.value && vue.createVNode(vueLoading.VProgressCircular, {
524
+ "class": "v-button__loading",
525
+ "indeterminate": true,
526
+ "size": LOADING_SIZE_MAP[control.size.value]
527
+ }, null)]
528
+ });
529
+ };
530
+ }
531
+
532
+ });
533
+
534
+ function createListTileProps() {
535
+ const icon = rawIconProp();
536
+ return { ...vueUtils.navigationableProps,
537
+ ...vueUtils.createPropsOptions({
538
+ startIcon: icon,
539
+ endIcon: icon,
540
+ fallbackTag: {
541
+ type: String,
542
+ default: 'div'
543
+ },
544
+ startIconEmptySpace: Boolean,
545
+ color: String
546
+ })
547
+ };
548
+ }
549
+ const listTileEmits = { ...vueUtils.navigationableEmits,
550
+ changeActive: isActive => true
551
+ };
552
+ const VListTile = vue.defineComponent({
553
+ name: 'VListTile',
554
+ props: createListTileProps(),
555
+ emits: { ...listTileEmits
556
+ },
557
+
558
+ setup(props, ctx) {
559
+ const startIcon = vue.computed(() => {
560
+ let icon = resolveRawIconProp(false, props.startIcon);
561
+
562
+ if (!icon && props.startIconEmptySpace) {
563
+ icon = resolveRawIconProp(false, '$empty');
564
+ }
565
+
566
+ return icon;
567
+ });
568
+ const endIcon = vue.computed(() => resolveRawIconProp(false, props.endIcon));
569
+ const navigationable = vueUtils.useNavigationable(props, () => props.fallbackTag, ctx);
570
+ const hasTo = vue.computed(() => !!props.to);
571
+ const link = vueRouter.useLink({
572
+ to: props.to || ''
573
+ });
574
+ const isActive = vue.computed(() => {
575
+ if (!hasTo.value) return false;
576
+ return link.isActive.value;
577
+ });
578
+ const color = vueColorScheme.useScopeColorClass(props);
579
+ const classes = vue.computed(() => {
580
+ const _color = color.value;
581
+ const hasColor = !!_color.value;
582
+ const _navigationable = navigationable.value;
583
+ const clickable = _navigationable.clickable;
584
+ return [color.value.className, _navigationable.classes, {
585
+ 'v-list-tile--clickable': clickable,
586
+ 'v-list-tile--plain': !hasColor,
587
+ 'v-list-tile--has-color': hasColor,
588
+ 'v-list-tile--active': isActive.value
589
+ }];
590
+ });
591
+ vue.watch(() => isActive.value, isActive => {
592
+ ctx.emit('changeActive', isActive);
593
+ }, {
594
+ immediate: true
595
+ });
596
+ return () => {
597
+ const _startIcon = startIcon.value;
598
+ const _endIcon = endIcon.value;
599
+ const {
600
+ Tag,
601
+ attrs
602
+ } = navigationable.value;
603
+ return vue.createVNode(Tag, vue.mergeProps({
604
+ "class": ['v-list-tile', classes.value]
605
+ }, attrs, {
606
+ "onClick": ev => {
607
+ ctx.emit('click', ev);
608
+ }
609
+ }), {
610
+ default: () => [_startIcon && vue.createVNode("span", {
611
+ "class": "v-list-tile__icon v-list-tile__icon--start"
612
+ }, [_startIcon]), vue.createVNode("span", {
613
+ "class": "v-list-tile__body"
614
+ }, [vueUtils.renderSlotOrEmpty(ctx.slots, 'default')]), _endIcon && vue.createVNode("span", {
615
+ "class": "v-list-tile__icon v-list-tile__icon--end"
616
+ }, [_endIcon])]
617
+ });
618
+ };
619
+ }
620
+
621
+ });
622
+
623
+ const VDrawerLayout = vue.defineComponent({
624
+ name: 'VDrawerLayout',
625
+ props: { ...createPaperBaseProps()
626
+ },
627
+
628
+ setup(props, ctx) {
629
+ return () => {
630
+ const paperProps = vue.computed(() => ({
631
+ color: props.color,
632
+ tag: props.tag
633
+ }));
634
+ return vue.createVNode(VPaper, vue.mergeProps({
635
+ "class": "v-drawer-layout"
636
+ }, paperProps.value, {
637
+ "square": true,
638
+ "headerProps": {
639
+ class: 'v-drawer-layout__header'
640
+ },
641
+ "bodyProps": {
642
+ class: 'v-drawer-layout__body'
643
+ },
644
+ "footerProps": {
645
+ class: 'v-drawer-layout__footer'
646
+ }
647
+ }), ctx.slots);
648
+ };
649
+ }
650
+
651
+ });
652
+
653
+ function _isSlot$5(s) {
654
+ return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
655
+ }
656
+
657
+ function createNavigationItemProps() {
658
+ return { ...createListTileProps(),
659
+ match: String
660
+ };
661
+ }
662
+ function resolveNavigationItemInput(input) {
663
+ let label = input.label;
664
+ const props = { ...input
665
+ };
666
+
667
+ if (typeof label === 'function') {
668
+ label = label();
669
+ }
670
+
671
+ delete props.label;
672
+ return {
673
+ label,
674
+ props
675
+ };
676
+ }
677
+ function renderNavigationItemInput(input, extraProps) {
678
+ const {
679
+ label,
680
+ props
681
+ } = resolveNavigationItemInput(input);
682
+ return vue.createVNode(VNavigationItem, { ...props,
683
+ ...extraProps
684
+ }, _isSlot$5(label) ? label : {
685
+ default: () => [label]
686
+ });
687
+ }
688
+ const VNavigationItem = vue.defineComponent({
689
+ name: 'VNavigationItem',
690
+ inheritAttrs: false,
691
+ props: { ...createNavigationItemProps(),
692
+ children: Array
693
+ },
694
+ emits: { ...listTileEmits
695
+ },
696
+
697
+ setup(props, ctx) {
698
+ const vui = useVui();
699
+ const opened = vue.ref(false);
700
+ const children = vue.computed(() => {
701
+ const c = props.children;
702
+ return c && c.length ? c : undefined;
703
+ });
704
+ const to = vue.computed(() => props.to);
705
+ const match = vue.computed(() => {
706
+ const {
707
+ match,
708
+ to
709
+ } = props;
710
+ if (match) return match;
711
+ if (!to) return;
712
+ if (typeof to === 'string') return to;
713
+ return to.path;
714
+ });
715
+ const classes = vue.computed(() => [{
716
+ 'v-navigation-item--opened': opened.value
717
+ }]);
718
+ const route = vueRouter.useRoute(); // const classes = computed(() => [
719
+ // // {
720
+ // // 'v-navigation-item--matched': matched.value,
721
+ // // },
722
+ // ]);
723
+
724
+ vue.watch(() => route.path, newPath => {
725
+ const c = children.value;
726
+ const m = match.value;
727
+
728
+ if (!c || !m) {
729
+ // matched.value = false;
730
+ return;
731
+ }
732
+
733
+ if (newPath.match(m)) {
734
+ open(); // matched.value = true;
735
+ } else {
736
+ close(); // matched.value = false;
737
+ }
738
+ }, {
739
+ immediate: true
740
+ }); // const iconPayload = () => opened.value;
741
+
742
+ const _props = vue.computed(() => {
743
+ const c = children.value;
744
+ let {
745
+ endIcon
746
+ } = props;
747
+
748
+ if (c && !endIcon) {
749
+ endIcon = vui.icon('navigationExpand');
750
+
751
+ if (typeof endIcon === 'string') {
752
+ const name = endIcon;
753
+
754
+ endIcon = gen => {
755
+ return gen({
756
+ name,
757
+ rotate: opened.value ? 180 : 0
758
+ });
759
+ };
760
+ }
761
+ }
762
+
763
+ const __props = { ...props,
764
+ endIcon
765
+ };
766
+ delete __props.children; // const _activeClass = props.activeClass;
767
+ // const activeClass = `v-navigation-item--active${
768
+ // _activeClass ? ` ${_activeClass}` : ''
769
+ // }`;
770
+
771
+ return { ...__props // activeClass,
772
+ // startIcon: toRawIconProp(__props.startIcon, iconPayload),
773
+ // endIcon: toRawIconProp(__props.endIcon, iconPayload),
774
+
775
+ };
776
+ });
777
+
778
+ function open() {
779
+ opened.value = true;
780
+ }
781
+
782
+ function close() {
783
+ opened.value = false;
784
+ }
785
+
786
+ function toggle() {
787
+ return opened.value ? close() : open();
788
+ }
789
+
790
+ const onClick = ev => {
791
+ if (!to.value) {
792
+ toggle();
793
+ }
794
+
795
+ ctx.emit('click', ev);
796
+ };
797
+
798
+ const onChangeActive = isActive => {
799
+ // if (isActive) {
800
+ // // open();
801
+ // // if (typeof window !== 'undefined') {
802
+ // // // open();
803
+ // // // console.log('hoge', window);
804
+ // // setTimeout(() => {
805
+ // // open();
806
+ // // }, 1000);
807
+ // // }
808
+ // // open();
809
+ // // console.log(props);
810
+ // // setTimeout(() => {
811
+ // // open();
812
+ // // }, 500);
813
+ // }
814
+ ctx.emit('changeActive', isActive);
815
+ };
816
+
817
+ return () => {
818
+ let _slot;
819
+
820
+ const _children = children.value;
821
+ const fallbackTag = _children ? 'button' : undefined;
822
+ return vue.createVNode(vue.Fragment, null, [vue.createVNode(VListTile, vue.mergeProps(_props.value, {
823
+ "fallbackTag": fallbackTag,
824
+ "endIcon": _props.value.endIcon,
825
+ "class": ['v-navigation-item', classes.value],
826
+ "onClick": onClick,
827
+ "onChangeActive": onChangeActive
828
+ }), _isSlot$5(_slot = vueUtils.renderSlotOrEmpty(ctx.slots, 'default')) ? _slot : {
829
+ default: () => [_slot]
830
+ }), _children && vue.createVNode(vueUtils.VExpandTransition, null, {
831
+ default: () => [vue.withDirectives(vue.createVNode("div", {
832
+ "class": "v-navigation-item__expand"
833
+ }, [_children.map(child => renderNavigationItemInput(child, {
834
+ startIconEmptySpace: _props.value.startIconEmptySpace // onClick,
835
+ // onChangeActive,
836
+
837
+ }))]), [[vue.vShow, opened.value]])]
838
+ })]);
839
+ };
840
+ }
841
+
842
+ });
843
+
844
+ const VNavigation = vue.defineComponent({
845
+ name: 'VNavigation',
846
+ props: {
847
+ items: {
848
+ type: Array,
849
+ required: true
850
+ },
851
+ color: String,
852
+ startIconEmptySpace: {
853
+ type: Boolean,
854
+ default: true
855
+ },
856
+ caption: [String, Function]
857
+ },
858
+
859
+ setup(props, ctx) {
860
+ const items = vue.computed(() => props.items);
861
+ const color = vueColorScheme.useScopeColorClass(props);
862
+ const classes = vue.computed(() => [color.value.className]);
863
+ const startIconEmptySpace = vue.computed(() => props.startIconEmptySpace);
864
+ const caption = vue.computed(() => {
865
+ const c = props.caption;
866
+ return typeof c === 'function' ? c() : c;
867
+ });
868
+ return () => {
869
+ const $caption = caption.value;
870
+ return vue.createVNode("nav", {
871
+ "class": ['v-navigation', classes.value]
872
+ }, [!!$caption && vue.createVNode("div", {
873
+ "class": "v-navigation__caption"
874
+ }, [$caption]), items.value.map(item => renderNavigationItemInput(item, {
875
+ class: 'v-navigation__item',
876
+ startIconEmptySpace: startIconEmptySpace.value
877
+ }))]);
878
+ };
879
+ }
880
+
881
+ });
882
+
275
883
  const VCheckable = vue.defineComponent({
276
884
  name: 'VCheckable',
277
885
  props: {
@@ -365,7 +973,7 @@ const VCheckbox = vue.defineComponent({
365
973
 
366
974
  });
367
975
 
368
- function _isSlot$3(s) {
976
+ function _isSlot$4(s) {
369
977
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
370
978
  }
371
979
 
@@ -377,7 +985,7 @@ const VCheckboxGroup = defineFormSelectorComponent({
377
985
  itemRenderer: ({
378
986
  attrs,
379
987
  slots
380
- }) => vue.createVNode(VCheckbox, attrs, _isSlot$3(slots) ? slots : {
988
+ }) => vue.createVNode(VCheckbox, attrs, _isSlot$4(slots) ? slots : {
381
989
  default: () => [slots]
382
990
  })
383
991
  });
@@ -429,7 +1037,7 @@ const VRadio = vue.defineComponent({
429
1037
 
430
1038
  });
431
1039
 
432
- function _isSlot$2(s) {
1040
+ function _isSlot$3(s) {
433
1041
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
434
1042
  }
435
1043
 
@@ -440,7 +1048,7 @@ const VRadioGroup = defineFormSelectorComponent({
440
1048
  itemRenderer: ({
441
1049
  attrs,
442
1050
  slots
443
- }) => vue.createVNode(VRadio, attrs, _isSlot$2(slots) ? slots : {
1051
+ }) => vue.createVNode(VRadio, attrs, _isSlot$3(slots) ? slots : {
444
1052
  default: () => [slots]
445
1053
  })
446
1054
  });
@@ -502,7 +1110,7 @@ const VSwitch = vue.defineComponent({
502
1110
 
503
1111
  });
504
1112
 
505
- function _isSlot$1(s) {
1113
+ function _isSlot$2(s) {
506
1114
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
507
1115
  }
508
1116
 
@@ -514,7 +1122,7 @@ const VSwitchGroup = defineFormSelectorComponent({
514
1122
  itemRenderer: ({
515
1123
  attrs,
516
1124
  slots
517
- }) => vue.createVNode(VSwitch, attrs, _isSlot$1(slots) ? slots : {
1125
+ }) => vue.createVNode(VSwitch, attrs, _isSlot$2(slots) ? slots : {
518
1126
  default: () => [slots]
519
1127
  })
520
1128
  });
@@ -1057,7 +1665,7 @@ const VForm = vue.defineComponent({
1057
1665
 
1058
1666
  });
1059
1667
 
1060
- function _isSlot(s) {
1668
+ function _isSlot$1(s) {
1061
1669
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
1062
1670
  }
1063
1671
 
@@ -1069,7 +1677,93 @@ const VApp = vue.defineComponent({
1069
1677
  return () => {
1070
1678
  let _slot;
1071
1679
 
1072
- return vue.createVNode(vueKit.VStackRoot, null, _isSlot(_slot = vueKit.renderSlotOrEmpty(ctx.slots, 'default')) ? _slot : {
1680
+ return vue.createVNode(vueKit.VStackRoot, null, _isSlot$1(_slot = vueKit.renderSlotOrEmpty(ctx.slots, 'default')) ? _slot : {
1681
+ default: () => [_slot]
1682
+ });
1683
+ };
1684
+ }
1685
+
1686
+ });
1687
+
1688
+ const VToolbar = vue.defineComponent({
1689
+ name: 'VToolbar',
1690
+ props: { ...createElevationProps(),
1691
+ ...vueColorScheme.colorSchemeProps(),
1692
+ dense: Boolean
1693
+ },
1694
+
1695
+ setup(props, ctx) {
1696
+ const vui = useVui();
1697
+ const elevation = useElevation(props, {
1698
+ defaultValue: 4
1699
+ });
1700
+ const dense = vue.computed(() => props.dense);
1701
+ const color = vueColorScheme.useColorClasses({
1702
+ color: () => props.color,
1703
+ variant: () => props.variant || vui.setting('containedVariant')
1704
+ });
1705
+ const classes = vue.computed(() => {
1706
+ return [elevation.elevationClassName.value, color.colorClasses.value, {
1707
+ 'v-toolbar--plain': !color.color.value.value,
1708
+ 'v-toolbar--dense': dense.value
1709
+ }];
1710
+ });
1711
+ return () => {
1712
+ return vue.createVNode("div", {
1713
+ "class": ['v-toolbar', classes.value]
1714
+ }, [vueUtils.renderSlotOrEmpty(ctx.slots, 'default')]);
1715
+ };
1716
+ }
1717
+
1718
+ });
1719
+
1720
+ const VToolbarMenu = vue.defineComponent({
1721
+ name: 'VToolbarMenu',
1722
+ props: {
1723
+ edge: {
1724
+ type: String,
1725
+ required: true
1726
+ }
1727
+ },
1728
+
1729
+ setup(props, ctx) {
1730
+ const edge = vue.computed(() => props.edge);
1731
+ return () => {
1732
+ const children = vueUtils.renderSlotOrEmpty(ctx.slots, 'default');
1733
+ const hasChildren = !!children && children.length > 0;
1734
+ return vue.createVNode("div", {
1735
+ "class": ['v-toolbar-menu', `v-toolbar-menu--${edge.value}`, {
1736
+ [`v-toolbar-menu--empty`]: !hasChildren
1737
+ }]
1738
+ }, [children]);
1739
+ };
1740
+ }
1741
+
1742
+ });
1743
+
1744
+ function _isSlot(s) {
1745
+ return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
1746
+ }
1747
+
1748
+ const VToolbarTitle = vue.defineComponent({
1749
+ name: 'VToolbarTitle',
1750
+ props: {
1751
+ tag: {
1752
+ type: String,
1753
+ default: 'span'
1754
+ }
1755
+ },
1756
+
1757
+ setup(props, ctx) {
1758
+ const _TagName = vue.computed(() => props.tag);
1759
+
1760
+ return () => {
1761
+ let _slot;
1762
+
1763
+ const TagName = _TagName.value;
1764
+ return vue.createVNode(TagName, {
1765
+ "class": "v-toolbar-title"
1766
+ }, _isSlot(_slot = vueUtils.renderSlotOrEmpty(ctx.slots, 'default')) ? _slot : {
1073
1767
  default: () => [_slot]
1074
1768
  });
1075
1769
  };
@@ -1093,8 +1787,8 @@ class VuiService {
1093
1787
  this.textareaRows = textareaRows;
1094
1788
  this.requiredChip = requiredChip;
1095
1789
  }
1096
- color(colorType) {
1097
- return this.options.colors[colorType];
1790
+ setting(key) {
1791
+ return this.options.uiSettings[key];
1098
1792
  }
1099
1793
  icon(iconType) {
1100
1794
  return this.options.icons[iconType];
@@ -1112,39 +1806,63 @@ class VuiService {
1112
1806
  }
1113
1807
  }
1114
1808
 
1115
- class VuiPlugin {
1116
- static installedApps = new Set();
1117
- static install(app, opts) {
1118
- const { installedApps } = this;
1119
- if (installedApps.has(app))
1120
- return;
1121
- const unmountApp = app.unmount;
1122
- installedApps.add(app);
1123
- const { colors, colorScheme, stack } = opts;
1124
- // ColorScheme
1125
- const vueColorSchemePlugin = new vueKit.VueColorSchemePlugin(colorScheme);
1126
- app.use(vueColorSchemePlugin);
1127
- // Stack
1128
- vueKit.installVueStackPlugin(app, {
1129
- primaryColor: colors.primary,
1130
- ...stack,
1131
- });
1132
- // Vui
1133
- const $vui = new VuiService(opts);
1134
- app.provide(VuiInjectionKey, $vui);
1135
- app.config.globalProperties.$vui = $vui;
1136
- app.unmount = function () {
1137
- installedApps.delete(app);
1138
- delete app.config.globalProperties.$vui;
1139
- unmountApp();
1140
- };
1141
- }
1142
- }
1143
- function installVuiPlugin(app, opts) {
1144
- return app.use(VuiPlugin, opts);
1809
+ class VuiPlugin {
1810
+ static installedApps = new Set();
1811
+
1812
+ static install(app, opts) {
1813
+ const {
1814
+ installedApps
1815
+ } = this;
1816
+ if (installedApps.has(app)) return;
1817
+ const unmountApp = app.unmount;
1818
+ installedApps.add(app);
1819
+ const {
1820
+ colorScheme,
1821
+ stack,
1822
+ uiSettings
1823
+ } = opts; // ColorScheme
1824
+
1825
+ const vueColorSchemePlugin = new vueKit.VueColorSchemePlugin(colorScheme);
1826
+ app.use(vueColorSchemePlugin); // Stack
1827
+
1828
+ vueKit.installVueStackPlugin(app, {
1829
+ actions: {
1830
+ ok: ({
1831
+ bindings
1832
+ }) => vue.createVNode(VButton, vue.mergeProps(uiSettings.dialogOk, bindings), {
1833
+ default: () => [vue.createTextVNode("OK")]
1834
+ }),
1835
+ cancel: ({
1836
+ bindings
1837
+ }) => vue.createVNode(VButton, vue.mergeProps(uiSettings.dialogCancel, bindings), {
1838
+ default: () => [vue.createTextVNode("CANCEL")]
1839
+ }),
1840
+ close: ({
1841
+ bindings
1842
+ }) => vue.createVNode(VButton, vue.mergeProps(uiSettings.dialogClose, bindings), {
1843
+ default: () => [vue.createTextVNode("CLOSE")]
1844
+ }),
1845
+ ...(stack ? stack.actions : {})
1846
+ },
1847
+ ...stack
1848
+ }); // Vui
1849
+
1850
+ const $vui = new VuiService(opts);
1851
+ app.provide(VuiInjectionKey, $vui);
1852
+ app.config.globalProperties.$vui = $vui;
1853
+
1854
+ app.unmount = function () {
1855
+ installedApps.delete(app);
1856
+ delete app.config.globalProperties.$vui;
1857
+ unmountApp();
1858
+ };
1859
+ }
1860
+
1861
+ }
1862
+ function installVuiPlugin(app, opts) {
1863
+ return app.use(VuiPlugin, opts);
1145
1864
  }
1146
1865
 
1147
- exports.VButton = vueKit.VStackBtn;
1148
1866
  exports.VDialog = vueKit.VDialog;
1149
1867
  exports.VMenu = vueKit.VMenu;
1150
1868
  exports.VSnackbar = vueKit.VSnackbar;
@@ -1152,12 +1870,21 @@ exports.ICON_NAMES = iconFont.ICON_NAMES;
1152
1870
  exports.CONTROL_FIELD_VARIANTS = CONTROL_FIELD_VARIANTS;
1153
1871
  exports.CONTROL_SIZES = CONTROL_SIZES;
1154
1872
  exports.VApp = VApp;
1873
+ exports.VButton = VButton;
1874
+ exports.VCard = VCard;
1875
+ exports.VCardActions = VCardActions;
1876
+ exports.VCardContent = VCardContent;
1155
1877
  exports.VCheckbox = VCheckbox;
1156
1878
  exports.VCheckboxGroup = VCheckboxGroup;
1879
+ exports.VDrawerLayout = VDrawerLayout;
1157
1880
  exports.VForm = VForm;
1158
1881
  exports.VIcon = VIcon;
1882
+ exports.VListTile = VListTile;
1883
+ exports.VNavigation = VNavigation;
1884
+ exports.VNavigationItem = VNavigationItem;
1159
1885
  exports.VOption = VOption;
1160
1886
  exports.VOptionGroup = VOptionGroup;
1887
+ exports.VPaper = VPaper;
1161
1888
  exports.VRadio = VRadio;
1162
1889
  exports.VRadioGroup = VRadioGroup;
1163
1890
  exports.VSelect = VSelect;
@@ -1165,15 +1892,51 @@ exports.VSwitch = VSwitch;
1165
1892
  exports.VSwitchGroup = VSwitchGroup;
1166
1893
  exports.VTextField = VTextField;
1167
1894
  exports.VTextarea = VTextarea;
1895
+ exports.VToolbar = VToolbar;
1896
+ exports.VToolbarMenu = VToolbarMenu;
1897
+ exports.VToolbarTitle = VToolbarTitle;
1898
+ exports.VUI_CHECKBOX_GROUP_SYMBOL = VUI_CHECKBOX_GROUP_SYMBOL;
1899
+ exports.VUI_CHECKBOX_SYMBOL = VUI_CHECKBOX_SYMBOL;
1900
+ exports.VUI_FORM_SYMBOL = VUI_FORM_SYMBOL;
1901
+ exports.VUI_OPTION_SYMBOL = VUI_OPTION_SYMBOL;
1902
+ exports.VUI_RADIO_GROUP_SYMBOL = VUI_RADIO_GROUP_SYMBOL;
1903
+ exports.VUI_RADIO_SYMBOL = VUI_RADIO_SYMBOL;
1904
+ exports.VUI_SELECT_SYMBOL = VUI_SELECT_SYMBOL;
1905
+ exports.VUI_SWITCH_GROUP_SYMBOL = VUI_SWITCH_GROUP_SYMBOL;
1906
+ exports.VUI_SWITCH_SYMBOL = VUI_SWITCH_SYMBOL;
1907
+ exports.VUI_TEXTAREA_SYMBOL = VUI_TEXTAREA_SYMBOL;
1908
+ exports.VUI_TEXT_FIELD_SYMBOL = VUI_TEXT_FIELD_SYMBOL;
1909
+ exports.VuiColorProviderInjectionKey = VuiColorProviderInjectionKey;
1910
+ exports.VuiControlFieldInjectionKey = VuiControlFieldInjectionKey;
1911
+ exports.VuiControlInjectionKey = VuiControlInjectionKey;
1168
1912
  exports.VuiInjectionKey = VuiInjectionKey;
1169
1913
  exports.VuiPlugin = VuiPlugin;
1170
1914
  exports.VuiService = VuiService;
1915
+ exports.createCardProps = createCardProps;
1171
1916
  exports.createControlFieldProviderProps = createControlFieldProviderProps;
1172
1917
  exports.createControlProps = createControlProps;
1918
+ exports.createElevationProps = createElevationProps;
1919
+ exports.createListTileProps = createListTileProps;
1920
+ exports.createNavigationItemProps = createNavigationItemProps;
1921
+ exports.createPaperBaseProps = createPaperBaseProps;
1922
+ exports.createPaperProps = createPaperProps;
1173
1923
  exports.defineFormSelectorComponent = defineFormSelectorComponent;
1924
+ exports.iconProps = iconProps;
1174
1925
  exports.installVuiPlugin = installVuiPlugin;
1926
+ exports.listTileEmits = listTileEmits;
1927
+ exports.rawIconProp = rawIconProp;
1928
+ exports.renderNavigationItemInput = renderNavigationItemInput;
1929
+ exports.resolveNavigationItemInput = resolveNavigationItemInput;
1930
+ exports.resolveRawIconProp = resolveRawIconProp;
1175
1931
  exports.useControl = useControl;
1176
1932
  exports.useControlField = useControlField;
1933
+ exports.useElevation = useElevation;
1934
+ exports.useVui = useVui;
1935
+ exports.useVuiColorProvider = useVuiColorProvider;
1936
+ exports.vueButtonProps = vueButtonProps;
1177
1937
  for (var k in vueKit) {
1178
1938
  if (k !== 'default' && !exports.hasOwnProperty(k)) exports[k] = vueKit[k];
1179
1939
  }
1940
+ for (var k in vueLoading) {
1941
+ if (k !== 'default' && !exports.hasOwnProperty(k)) exports[k] = vueLoading[k];
1942
+ }