@fastkit/vui 0.6.44 → 0.7.0

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
@@ -439,10 +439,10 @@ const VGridContainer = vue.defineComponent({
439
439
  });
440
440
 
441
441
  function createPaperBaseProps() {
442
- return {
442
+ return { ...vueUtils.htmlAttributesPropOptions,
443
443
  color: String,
444
444
  tag: {
445
- type: String,
445
+ type: [String, Object],
446
446
  default: 'div'
447
447
  },
448
448
  ...vueUtils.defineSlotsProps()
@@ -454,11 +454,13 @@ function createPaperProps() {
454
454
  square: Boolean,
455
455
  headerProps: Object,
456
456
  bodyProps: Object,
457
- footerProps: Object
457
+ footerProps: Object,
458
+ innerClass: [String, Array, Object]
458
459
  };
459
460
  }
460
461
  const VPaper = vue.defineComponent({
461
462
  name: 'VPaper',
463
+ inheritAttrs: false,
462
464
  props: createPaperProps(),
463
465
 
464
466
  setup(props, ctx) {
@@ -469,7 +471,7 @@ const VPaper = vue.defineComponent({
469
471
  const scope = vueColorScheme.useScopeColorClass(props);
470
472
  const classes = vue.computed(() => [elevation.elevationClassName.value, scope.value.className, {
471
473
  'v-paper--plain': !scope.value.value,
472
- 'v-paper--has-color': !!scope.value.value,
474
+ 'v-paper--has-color': !!scope.value.value || !!ctx.attrs.disabled,
473
475
  'v-paper--square': props.square
474
476
  }]);
475
477
  const headerProps = vue.computed(() => props.headerProps);
@@ -479,16 +481,18 @@ const VPaper = vue.defineComponent({
479
481
  const TagName = tag.value;
480
482
  const header = vueUtils.renderSlotOrEmpty(ctx.slots, 'header');
481
483
  const footer = vueUtils.renderSlotOrEmpty(ctx.slots, 'footer');
482
- return vue.createVNode(TagName, {
484
+ return vue.createVNode(TagName, vue.mergeProps({
483
485
  "class": ['v-paper', classes.value]
484
- }, {
485
- default: () => [header && vue.createVNode("div", vue.mergeProps({
486
+ }, ctx.attrs), {
487
+ default: () => [vue.createVNode("div", {
488
+ "class": ['v-paper__inner', props.innerClass]
489
+ }, [header && vue.createVNode("div", vue.mergeProps({
486
490
  "class": "v-paper__header"
487
491
  }, headerProps.value), [header]), vue.createVNode("div", vue.mergeProps({
488
492
  "class": "v-paper__body"
489
493
  }, bodyProps.value), [vueUtils.renderSlotOrEmpty(ctx.slots, 'default')]), footer && vue.createVNode("div", vue.mergeProps({
490
494
  "class": "v-paper__footer"
491
- }, footerProps.value), [footer])]
495
+ }, footerProps.value), [footer])])]
492
496
  });
493
497
  };
494
498
  }
@@ -496,20 +500,42 @@ const VPaper = vue.defineComponent({
496
500
  });
497
501
 
498
502
  function createCardProps() {
499
- return { ...createPaperProps()
503
+ return { ...createPaperProps(),
504
+ ...vueUtils.navigationableInheritProps,
505
+ disabled: Boolean
500
506
  };
501
507
  }
502
508
  const VCard = vue.defineComponent({
503
509
  name: 'VCard',
510
+ inheritAttrs: false,
504
511
  props: createCardProps(),
505
512
 
506
513
  setup(props, ctx) {
507
514
  const _props = vue.computed(() => props);
508
515
 
516
+ const data = vue.computed(() => {
517
+ const hasLink = !!ctx.attrs.href || !!ctx.attrs.to;
518
+ const attrs = { ..._props.value,
519
+ ...ctx.attrs,
520
+ class: ['v-card', ctx.attrs.class, typeof ctx.attrs.onClick === 'function' && 'clickable'],
521
+ tag: hasLink ? vueUtils.VLink : 'div'
522
+ };
523
+
524
+ if (props.disabled) {
525
+ attrs.disabled = 'disabled';
526
+ delete attrs.onClick;
527
+ delete attrs.href;
528
+ delete attrs.to;
529
+ } else {
530
+ delete attrs.disabled;
531
+ }
532
+
533
+ return {
534
+ attrs
535
+ };
536
+ });
509
537
  return () => {
510
- return vue.createVNode(VPaper, vue.mergeProps({
511
- "class": "v-card"
512
- }, _props.value), ctx.slots);
538
+ return vue.createVNode(VPaper, data.value.attrs, ctx.slots);
513
539
  };
514
540
  }
515
541
 
@@ -801,7 +827,8 @@ const VPagination = vue.defineComponent({
801
827
  name: 'VPagination',
802
828
  props: paginationProps(),
803
829
  emits: {
804
- change: page => true
830
+ change: page => true,
831
+ 'update:modelValue': page => true
805
832
  },
806
833
 
807
834
  setup(props, ctx) {
@@ -1136,7 +1163,8 @@ const VDrawerLayout = vue.defineComponent({
1136
1163
  tag: props.tag
1137
1164
  }));
1138
1165
  return vue.createVNode(VPaper, vue.mergeProps({
1139
- "class": "v-drawer-layout"
1166
+ "class": "v-drawer-layout",
1167
+ "innerClass": "v-drawer-layout__inner"
1140
1168
  }, paperProps.value, {
1141
1169
  "square": true,
1142
1170
  "headerProps": {
@@ -1209,7 +1237,12 @@ function _isSlot$b(s) {
1209
1237
 
1210
1238
  function createNavigationItemProps() {
1211
1239
  return { ...createListTileProps(),
1212
- match: String // key: {
1240
+ match: String,
1241
+ depth: {
1242
+ type: Number,
1243
+ default: 0
1244
+ },
1245
+ nested: Boolean // key: {
1213
1246
  // type: [String, Number],
1214
1247
  // required: true,
1215
1248
  // },
@@ -1272,7 +1305,8 @@ const VNavigationItem = vue.defineComponent({
1272
1305
  return to.path;
1273
1306
  });
1274
1307
  const classes = vue.computed(() => [{
1275
- 'v-navigation-item--opened': opened.value
1308
+ 'v-navigation-item--opened': opened.value,
1309
+ [`v-navigation-item--depth-${props.depth}`]: props.depth > 0
1276
1310
  }]);
1277
1311
  const route = vueRouter.useRoute(); // const classes = computed(() => [
1278
1312
  // // {
@@ -1397,7 +1431,8 @@ const VNavigationItem = vue.defineComponent({
1397
1431
  default: () => [vue.withDirectives(vue.createVNode("div", {
1398
1432
  "class": "v-navigation-item__expand"
1399
1433
  }, [_children.map(child => renderNavigationItemInput(child, {
1400
- startIconEmptySpace: _props.value.startIconEmptySpace // onClick,
1434
+ startIconEmptySpace: _props.value.startIconEmptySpace,
1435
+ depth: props.nested ? props.depth + 1 : props.depth // onClick,
1401
1436
  // onChangeActive,
1402
1437
 
1403
1438
  }))]), [[vue.vShow, opened.value]])]
@@ -3622,7 +3657,7 @@ const VDataTable = vue.defineComponent({
3622
3657
  "class": "v-data-table__controls__info"
3623
3658
  }, [vue.createVNode("small", {
3624
3659
  "class": "v-data-table__controls__info__length"
3625
- }, [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", {
3660
+ }, [`全 ${total} 件中 ${offset + 1} ${offset + length} 件を表示`])]), vue.createVNode("div", {
3626
3661
  "class": "v-data-table__controls__select-limit"
3627
3662
  }, [vue.createVNode("span", {
3628
3663
  "class": "v-data-table__controls__select-limit__prefix"
@@ -439,10 +439,10 @@ const VGridContainer = vue.defineComponent({
439
439
  });
440
440
 
441
441
  function createPaperBaseProps() {
442
- return {
442
+ return { ...vueUtils.htmlAttributesPropOptions,
443
443
  color: String,
444
444
  tag: {
445
- type: String,
445
+ type: [String, Object],
446
446
  default: 'div'
447
447
  },
448
448
  ...vueUtils.defineSlotsProps()
@@ -454,11 +454,13 @@ function createPaperProps() {
454
454
  square: Boolean,
455
455
  headerProps: Object,
456
456
  bodyProps: Object,
457
- footerProps: Object
457
+ footerProps: Object,
458
+ innerClass: [String, Array, Object]
458
459
  };
459
460
  }
460
461
  const VPaper = vue.defineComponent({
461
462
  name: 'VPaper',
463
+ inheritAttrs: false,
462
464
  props: createPaperProps(),
463
465
 
464
466
  setup(props, ctx) {
@@ -469,7 +471,7 @@ const VPaper = vue.defineComponent({
469
471
  const scope = vueColorScheme.useScopeColorClass(props);
470
472
  const classes = vue.computed(() => [elevation.elevationClassName.value, scope.value.className, {
471
473
  'v-paper--plain': !scope.value.value,
472
- 'v-paper--has-color': !!scope.value.value,
474
+ 'v-paper--has-color': !!scope.value.value || !!ctx.attrs.disabled,
473
475
  'v-paper--square': props.square
474
476
  }]);
475
477
  const headerProps = vue.computed(() => props.headerProps);
@@ -479,16 +481,18 @@ const VPaper = vue.defineComponent({
479
481
  const TagName = tag.value;
480
482
  const header = vueUtils.renderSlotOrEmpty(ctx.slots, 'header');
481
483
  const footer = vueUtils.renderSlotOrEmpty(ctx.slots, 'footer');
482
- return vue.createVNode(TagName, {
484
+ return vue.createVNode(TagName, vue.mergeProps({
483
485
  "class": ['v-paper', classes.value]
484
- }, {
485
- default: () => [header && vue.createVNode("div", vue.mergeProps({
486
+ }, ctx.attrs), {
487
+ default: () => [vue.createVNode("div", {
488
+ "class": ['v-paper__inner', props.innerClass]
489
+ }, [header && vue.createVNode("div", vue.mergeProps({
486
490
  "class": "v-paper__header"
487
491
  }, headerProps.value), [header]), vue.createVNode("div", vue.mergeProps({
488
492
  "class": "v-paper__body"
489
493
  }, bodyProps.value), [vueUtils.renderSlotOrEmpty(ctx.slots, 'default')]), footer && vue.createVNode("div", vue.mergeProps({
490
494
  "class": "v-paper__footer"
491
- }, footerProps.value), [footer])]
495
+ }, footerProps.value), [footer])])]
492
496
  });
493
497
  };
494
498
  }
@@ -496,20 +500,42 @@ const VPaper = vue.defineComponent({
496
500
  });
497
501
 
498
502
  function createCardProps() {
499
- return { ...createPaperProps()
503
+ return { ...createPaperProps(),
504
+ ...vueUtils.navigationableInheritProps,
505
+ disabled: Boolean
500
506
  };
501
507
  }
502
508
  const VCard = vue.defineComponent({
503
509
  name: 'VCard',
510
+ inheritAttrs: false,
504
511
  props: createCardProps(),
505
512
 
506
513
  setup(props, ctx) {
507
514
  const _props = vue.computed(() => props);
508
515
 
516
+ const data = vue.computed(() => {
517
+ const hasLink = !!ctx.attrs.href || !!ctx.attrs.to;
518
+ const attrs = { ..._props.value,
519
+ ...ctx.attrs,
520
+ class: ['v-card', ctx.attrs.class, typeof ctx.attrs.onClick === 'function' && 'clickable'],
521
+ tag: hasLink ? vueUtils.VLink : 'div'
522
+ };
523
+
524
+ if (props.disabled) {
525
+ attrs.disabled = 'disabled';
526
+ delete attrs.onClick;
527
+ delete attrs.href;
528
+ delete attrs.to;
529
+ } else {
530
+ delete attrs.disabled;
531
+ }
532
+
533
+ return {
534
+ attrs
535
+ };
536
+ });
509
537
  return () => {
510
- return vue.createVNode(VPaper, vue.mergeProps({
511
- "class": "v-card"
512
- }, _props.value), ctx.slots);
538
+ return vue.createVNode(VPaper, data.value.attrs, ctx.slots);
513
539
  };
514
540
  }
515
541
 
@@ -801,7 +827,8 @@ const VPagination = vue.defineComponent({
801
827
  name: 'VPagination',
802
828
  props: paginationProps(),
803
829
  emits: {
804
- change: page => true
830
+ change: page => true,
831
+ 'update:modelValue': page => true
805
832
  },
806
833
 
807
834
  setup(props, ctx) {
@@ -1136,7 +1163,8 @@ const VDrawerLayout = vue.defineComponent({
1136
1163
  tag: props.tag
1137
1164
  }));
1138
1165
  return vue.createVNode(VPaper, vue.mergeProps({
1139
- "class": "v-drawer-layout"
1166
+ "class": "v-drawer-layout",
1167
+ "innerClass": "v-drawer-layout__inner"
1140
1168
  }, paperProps.value, {
1141
1169
  "square": true,
1142
1170
  "headerProps": {
@@ -1209,7 +1237,12 @@ function _isSlot$b(s) {
1209
1237
 
1210
1238
  function createNavigationItemProps() {
1211
1239
  return { ...createListTileProps(),
1212
- match: String // key: {
1240
+ match: String,
1241
+ depth: {
1242
+ type: Number,
1243
+ default: 0
1244
+ },
1245
+ nested: Boolean // key: {
1213
1246
  // type: [String, Number],
1214
1247
  // required: true,
1215
1248
  // },
@@ -1272,7 +1305,8 @@ const VNavigationItem = vue.defineComponent({
1272
1305
  return to.path;
1273
1306
  });
1274
1307
  const classes = vue.computed(() => [{
1275
- 'v-navigation-item--opened': opened.value
1308
+ 'v-navigation-item--opened': opened.value,
1309
+ [`v-navigation-item--depth-${props.depth}`]: props.depth > 0
1276
1310
  }]);
1277
1311
  const route = vueRouter.useRoute(); // const classes = computed(() => [
1278
1312
  // // {
@@ -1397,7 +1431,8 @@ const VNavigationItem = vue.defineComponent({
1397
1431
  default: () => [vue.withDirectives(vue.createVNode("div", {
1398
1432
  "class": "v-navigation-item__expand"
1399
1433
  }, [_children.map(child => renderNavigationItemInput(child, {
1400
- startIconEmptySpace: _props.value.startIconEmptySpace // onClick,
1434
+ startIconEmptySpace: _props.value.startIconEmptySpace,
1435
+ depth: props.nested ? props.depth + 1 : props.depth // onClick,
1401
1436
  // onChangeActive,
1402
1437
 
1403
1438
  }))]), [[vue.vShow, opened.value]])]
@@ -3622,7 +3657,7 @@ const VDataTable = vue.defineComponent({
3622
3657
  "class": "v-data-table__controls__info"
3623
3658
  }, [vue.createVNode("small", {
3624
3659
  "class": "v-data-table__controls__info__length"
3625
- }, [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", {
3660
+ }, [`全 ${total} 件中 ${offset + 1} ${offset + length} 件を表示`])]), vue.createVNode("div", {
3626
3661
  "class": "v-data-table__controls__select-limit"
3627
3662
  }, [vue.createVNode("span", {
3628
3663
  "class": "v-data-table__controls__select-limit__prefix"
package/dist/vui.css CHANGED
@@ -551,6 +551,7 @@ template {
551
551
  --tabs-bar-height: calc(var(--root-em) * 0.375);
552
552
  --tabs-font-size: calc(var(--root-em) * 0.875);
553
553
  --breadcrumbs-font-size: var(--typo-sm-size);
554
+ --list-tile-padding: calc(var(--root-em) * 0.625);
554
555
  }
555
556
 
556
557
  :root,
@@ -898,6 +899,7 @@ thead th {
898
899
  }
899
900
  .v-paper {
900
901
  --paper-radius: var(--control-field-radius);
902
+ display: block;
901
903
  color: var(--paper-text-color);
902
904
  background-color: var(--paper-background--color);
903
905
  border-radius: var(--paper-radius);
@@ -912,12 +914,13 @@ thead th {
912
914
  --paper-text-color: var(--text-color);
913
915
  --paper-link-color: var(--nav-color);
914
916
  }
917
+ .v-paper__inner {
918
+ position: relative;
919
+ border-radius: inherit;
920
+ }
915
921
  .v-paper--square {
916
922
  --paper-radius: 0px;
917
923
  }
918
- .v-paper a {
919
- color: var(--paper-link-color);
920
- }
921
924
  .v-paper__header {
922
925
  border-top-left-radius: inherit;
923
926
  border-top-right-radius: inherit;
@@ -926,7 +929,48 @@ thead th {
926
929
  border-bottom-right-radius: inherit;
927
930
  border-bottom-left-radius: inherit;
928
931
  }
929
-
932
+ .v-card {
933
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
934
+ position: relative;
935
+ width: 100%;
936
+ padding: 0;
937
+ text-align: left;
938
+ touch-action: manipulation;
939
+ user-select: none;
940
+ border: 0;
941
+ outline: 0;
942
+ appearance: none;
943
+ }
944
+ .v-card::-moz-focus-inner {
945
+ border: 0;
946
+ }
947
+ .v-card, .v-card:hover, .v-card:focus {
948
+ text-decoration: none;
949
+ }
950
+ .v-card.clickable {
951
+ cursor: pointer;
952
+ }
953
+ .v-card.clickable::before {
954
+ position: absolute;
955
+ top: 0;
956
+ right: 0;
957
+ bottom: 0;
958
+ left: 0;
959
+ content: "";
960
+ background: currentColor;
961
+ border-radius: inherit;
962
+ opacity: 0;
963
+ transition: 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);
964
+ }
965
+ .v-card.clickable:hover::before, .v-card.clickable:focus::before {
966
+ opacity: 0.125;
967
+ }
968
+ .v-card[disabled] {
969
+ pointer-events: none;
970
+ }
971
+ .v-card[disabled]::before {
972
+ content: none;
973
+ }
930
974
  .v-card-content {
931
975
  padding: var(--card-content-padding);
932
976
  }
@@ -1178,10 +1222,12 @@ thead th {
1178
1222
  --tile-text-active-color: var(--text-color);
1179
1223
  --tile-pin-color: transparent;
1180
1224
  --paper-link-color: var(--tile-text-color);
1225
+ --depth-padding: var(--list-tile-padding);
1181
1226
  display: flex;
1182
1227
  align-items: center;
1183
1228
  width: 100%;
1184
- padding: 10px;
1229
+ padding: var(--list-tile-padding);
1230
+ padding-left: var(--depth-padding);
1185
1231
  color: var(--tile-text-color);
1186
1232
  text-align: left;
1187
1233
  text-decoration: none;
@@ -1221,6 +1267,11 @@ thead th {
1221
1267
  text-align: right;
1222
1268
  }
1223
1269
  .v-drawer-layout {
1270
+ display: block;
1271
+ width: 100%;
1272
+ height: 100%;
1273
+ }
1274
+ .v-drawer-layout__inner {
1224
1275
  display: flex;
1225
1276
  flex-direction: column;
1226
1277
  align-items: stretch;
@@ -1276,6 +1327,15 @@ thead th {
1276
1327
  .v-navigation-item__expand .v-navigation-item {
1277
1328
  --tile-background: var(--tile-active-background);
1278
1329
  }
1330
+ .v-navigation-item--depth-1 {
1331
+ --depth-padding: calc(var(--list-tile-padding) * 2);
1332
+ }
1333
+ .v-navigation-item--depth-2 {
1334
+ --depth-padding: calc(var(--list-tile-padding) * 3);
1335
+ }
1336
+ .v-navigation-item--depth-3 {
1337
+ --depth-padding: calc(var(--list-tile-padding) * 4);
1338
+ }
1279
1339
  .v-navigation__caption {
1280
1340
  display: block;
1281
1341
  padding: calc(var(--root-em) * 0.625) calc(var(--root-em) * 1.5625);