@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.
@@ -434,10 +434,10 @@ const VGridContainer = defineComponent({
434
434
  });
435
435
 
436
436
  function createPaperBaseProps() {
437
- return {
437
+ return { ...htmlAttributesPropOptions,
438
438
  color: String,
439
439
  tag: {
440
- type: String,
440
+ type: [String, Object],
441
441
  default: 'div'
442
442
  },
443
443
  ...defineSlotsProps$1()
@@ -449,11 +449,13 @@ function createPaperProps() {
449
449
  square: Boolean,
450
450
  headerProps: Object,
451
451
  bodyProps: Object,
452
- footerProps: Object
452
+ footerProps: Object,
453
+ innerClass: [String, Array, Object]
453
454
  };
454
455
  }
455
456
  const VPaper = defineComponent({
456
457
  name: 'VPaper',
458
+ inheritAttrs: false,
457
459
  props: createPaperProps(),
458
460
 
459
461
  setup(props, ctx) {
@@ -464,7 +466,7 @@ const VPaper = defineComponent({
464
466
  const scope = useScopeColorClass(props);
465
467
  const classes = computed(() => [elevation.elevationClassName.value, scope.value.className, {
466
468
  'v-paper--plain': !scope.value.value,
467
- 'v-paper--has-color': !!scope.value.value,
469
+ 'v-paper--has-color': !!scope.value.value || !!ctx.attrs.disabled,
468
470
  'v-paper--square': props.square
469
471
  }]);
470
472
  const headerProps = computed(() => props.headerProps);
@@ -474,16 +476,18 @@ const VPaper = defineComponent({
474
476
  const TagName = tag.value;
475
477
  const header = renderSlotOrEmpty$1(ctx.slots, 'header');
476
478
  const footer = renderSlotOrEmpty$1(ctx.slots, 'footer');
477
- return createVNode(TagName, {
479
+ return createVNode(TagName, mergeProps({
478
480
  "class": ['v-paper', classes.value]
479
- }, {
480
- default: () => [header && createVNode("div", mergeProps({
481
+ }, ctx.attrs), {
482
+ default: () => [createVNode("div", {
483
+ "class": ['v-paper__inner', props.innerClass]
484
+ }, [header && createVNode("div", mergeProps({
481
485
  "class": "v-paper__header"
482
486
  }, headerProps.value), [header]), createVNode("div", mergeProps({
483
487
  "class": "v-paper__body"
484
488
  }, bodyProps.value), [renderSlotOrEmpty$1(ctx.slots, 'default')]), footer && createVNode("div", mergeProps({
485
489
  "class": "v-paper__footer"
486
- }, footerProps.value), [footer])]
490
+ }, footerProps.value), [footer])])]
487
491
  });
488
492
  };
489
493
  }
@@ -491,20 +495,42 @@ const VPaper = defineComponent({
491
495
  });
492
496
 
493
497
  function createCardProps() {
494
- return { ...createPaperProps()
498
+ return { ...createPaperProps(),
499
+ ...navigationableInheritProps,
500
+ disabled: Boolean
495
501
  };
496
502
  }
497
503
  const VCard = defineComponent({
498
504
  name: 'VCard',
505
+ inheritAttrs: false,
499
506
  props: createCardProps(),
500
507
 
501
508
  setup(props, ctx) {
502
509
  const _props = computed(() => props);
503
510
 
511
+ const data = computed(() => {
512
+ const hasLink = !!ctx.attrs.href || !!ctx.attrs.to;
513
+ const attrs = { ..._props.value,
514
+ ...ctx.attrs,
515
+ class: ['v-card', ctx.attrs.class, typeof ctx.attrs.onClick === 'function' && 'clickable'],
516
+ tag: hasLink ? VLink : 'div'
517
+ };
518
+
519
+ if (props.disabled) {
520
+ attrs.disabled = 'disabled';
521
+ delete attrs.onClick;
522
+ delete attrs.href;
523
+ delete attrs.to;
524
+ } else {
525
+ delete attrs.disabled;
526
+ }
527
+
528
+ return {
529
+ attrs
530
+ };
531
+ });
504
532
  return () => {
505
- return createVNode(VPaper, mergeProps({
506
- "class": "v-card"
507
- }, _props.value), ctx.slots);
533
+ return createVNode(VPaper, data.value.attrs, ctx.slots);
508
534
  };
509
535
  }
510
536
 
@@ -796,7 +822,8 @@ const VPagination = defineComponent({
796
822
  name: 'VPagination',
797
823
  props: paginationProps(),
798
824
  emits: {
799
- change: page => true
825
+ change: page => true,
826
+ 'update:modelValue': page => true
800
827
  },
801
828
 
802
829
  setup(props, ctx) {
@@ -1131,7 +1158,8 @@ const VDrawerLayout = defineComponent({
1131
1158
  tag: props.tag
1132
1159
  }));
1133
1160
  return createVNode(VPaper, mergeProps({
1134
- "class": "v-drawer-layout"
1161
+ "class": "v-drawer-layout",
1162
+ "innerClass": "v-drawer-layout__inner"
1135
1163
  }, paperProps.value, {
1136
1164
  "square": true,
1137
1165
  "headerProps": {
@@ -1204,7 +1232,12 @@ function _isSlot$b(s) {
1204
1232
 
1205
1233
  function createNavigationItemProps() {
1206
1234
  return { ...createListTileProps(),
1207
- match: String // key: {
1235
+ match: String,
1236
+ depth: {
1237
+ type: Number,
1238
+ default: 0
1239
+ },
1240
+ nested: Boolean // key: {
1208
1241
  // type: [String, Number],
1209
1242
  // required: true,
1210
1243
  // },
@@ -1267,7 +1300,8 @@ const VNavigationItem = defineComponent({
1267
1300
  return to.path;
1268
1301
  });
1269
1302
  const classes = computed(() => [{
1270
- 'v-navigation-item--opened': opened.value
1303
+ 'v-navigation-item--opened': opened.value,
1304
+ [`v-navigation-item--depth-${props.depth}`]: props.depth > 0
1271
1305
  }]);
1272
1306
  const route = useRoute(); // const classes = computed(() => [
1273
1307
  // // {
@@ -1392,7 +1426,8 @@ const VNavigationItem = defineComponent({
1392
1426
  default: () => [withDirectives(createVNode("div", {
1393
1427
  "class": "v-navigation-item__expand"
1394
1428
  }, [_children.map(child => renderNavigationItemInput(child, {
1395
- startIconEmptySpace: _props.value.startIconEmptySpace // onClick,
1429
+ startIconEmptySpace: _props.value.startIconEmptySpace,
1430
+ depth: props.nested ? props.depth + 1 : props.depth // onClick,
1396
1431
  // onChangeActive,
1397
1432
 
1398
1433
  }))]), [[vShow, opened.value]])]
@@ -3617,7 +3652,7 @@ const VDataTable = defineComponent({
3617
3652
  "class": "v-data-table__controls__info"
3618
3653
  }, [createVNode("small", {
3619
3654
  "class": "v-data-table__controls__info__length"
3620
- }, [createTextVNode("\u5168 "), total, createTextVNode(" \u4EF6\u4E2D "), offset + 1, createTextVNode(" \u4EF6 \u301C "), offset + length, createTextVNode(" \u4EF6\u3092\u8868\u793A")])]), createVNode("div", {
3655
+ }, [`全 ${total} 件中 ${offset + 1} ${offset + length} 件を表示`])]), createVNode("div", {
3621
3656
  "class": "v-data-table__controls__select-limit"
3622
3657
  }, [createVNode("span", {
3623
3658
  "class": "v-data-table__controls__select-limit__prefix"
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@fastkit/vui",
3
- "version": "0.6.44",
3
+ "version": "0.7.0",
4
4
  "description": "@fastkit/vui",
5
5
  "buildOptions": {
6
6
  "name": "Vui",
7
7
  "tool": true
8
8
  },
9
9
  "main": "index.js",
10
- "module": "dist/vui.esm-bundler.js",
10
+ "module": "dist/vui.mjs",
11
11
  "files": [
12
12
  "index.js",
13
13
  "dist",
@@ -32,11 +32,11 @@
32
32
  "vue": "^3.2.20"
33
33
  },
34
34
  "dependencies": {
35
- "@fastkit/color-scheme": "0.6.44",
36
- "@fastkit/icon-font": "0.6.44",
37
- "@fastkit/tiny-logger": "0.6.44",
38
- "@fastkit/vite-kit": "0.6.44",
39
- "@fastkit/vue-kit": "0.6.44",
35
+ "@fastkit/color-scheme": "0.7.0",
36
+ "@fastkit/icon-font": "0.7.0",
37
+ "@fastkit/tiny-logger": "0.7.0",
38
+ "@fastkit/vite-kit": "0.7.0",
39
+ "@fastkit/vue-kit": "0.7.0",
40
40
  "eta": "^1.12.3",
41
41
  "fs-extra": "^9.1.0",
42
42
  "@tiptap/extension-link": "^2.0.0-beta.33",
@@ -13,6 +13,7 @@ import {
13
13
  createPropsOptions,
14
14
  renderSlotOrEmpty,
15
15
  htmlAttributesPropOptions,
16
+ VLink,
16
17
  } from '@fastkit/vue-utils';
17
18
  import { useVui } from '../../injections';
18
19
  import { createControlProps, useControl } from '../../composables';
@@ -20,7 +21,6 @@ import { VProgressCircular } from '../loading';
20
21
  import { ControlSize } from '../../schemes/control';
21
22
  import { VIcon } from '../VIcon';
22
23
  import type { IconName } from '../VIcon';
23
- import { VLink } from '@fastkit/vue-utils';
24
24
 
25
25
  export type VButtonSpacer = 'left' | 'right';
26
26
 
@@ -1,3 +1,54 @@
1
+ @use '../../styles/core.scss';
2
+
1
3
  .v-card {
4
+ @include core.remove-tap-highlight();
5
+
6
+ position: relative;
7
+ width: 100%;
8
+ padding: 0;
9
+ text-align: left;
10
+ touch-action: manipulation;
11
+ user-select: none;
12
+ border: 0;
13
+ outline: 0;
14
+ appearance: none;
15
+
16
+ &,
17
+ &:hover,
18
+ &:focus {
19
+ text-decoration: none;
20
+ }
21
+
22
+ &.clickable {
23
+ cursor: pointer;
24
+
25
+ &::before {
26
+ position: absolute;
27
+ top: 0;
28
+ right: 0;
29
+ bottom: 0;
30
+ left: 0;
31
+ content: '';
32
+ background: currentColor;
33
+ border-radius: inherit;
34
+ opacity: 0;
35
+ transition: 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);
36
+ }
37
+
38
+ &:hover,
39
+ &:focus {
40
+ &::before {
41
+ opacity: 0.125;
42
+ }
43
+ }
44
+ }
45
+
46
+ &[disabled] {
47
+ pointer-events: none;
48
+
49
+ &::before {
50
+ content: none;
51
+ }
52
+ }
2
53
  // noop
3
54
  }
@@ -1,20 +1,56 @@
1
1
  import './VCard.scss';
2
2
  import { defineComponent, computed } from 'vue';
3
3
  import { VPaper, createPaperProps } from '../VPaper';
4
+ import { navigationableInheritProps, VLink } from '@fastkit/vue-utils';
4
5
 
5
6
  export function createCardProps() {
6
7
  return {
7
8
  ...createPaperProps(),
9
+ ...navigationableInheritProps,
10
+ disabled: Boolean,
8
11
  };
9
12
  }
10
13
 
11
14
  export const VCard = defineComponent({
12
15
  name: 'VCard',
16
+ inheritAttrs: false,
13
17
  props: createCardProps(),
14
18
  setup(props, ctx) {
15
19
  const _props = computed(() => props);
20
+ const data = computed(() => {
21
+ const hasLink = !!ctx.attrs.href || !!ctx.attrs.to;
22
+ const attrs = {
23
+ ..._props.value,
24
+ ...ctx.attrs,
25
+ class: [
26
+ 'v-card',
27
+ ctx.attrs.class,
28
+ typeof ctx.attrs.onClick === 'function' && 'clickable',
29
+ ],
30
+ tag: hasLink ? VLink : 'div',
31
+ };
32
+ if (props.disabled) {
33
+ attrs.disabled = 'disabled' as any;
34
+ delete (attrs as any).onClick;
35
+ delete (attrs as any).href;
36
+ delete (attrs as any).to;
37
+ } else {
38
+ delete (attrs as any).disabled;
39
+ }
40
+ return { attrs };
41
+ });
42
+
16
43
  return () => {
17
- return <VPaper class="v-card" {..._props.value} v-slots={ctx.slots} />;
44
+ return (
45
+ <VPaper
46
+ {...data.value.attrs}
47
+ // {..._props.value}
48
+ // {...ctx.attrs}
49
+ // class="v-card"
50
+ // tag={VLink}
51
+ v-slots={ctx.slots}
52
+ />
53
+ );
18
54
  };
19
55
  },
20
56
  });
@@ -443,7 +443,9 @@ export const VDataTable = defineComponent({
443
443
  <div class="v-data-table__controls">
444
444
  <div class="v-data-table__controls__info">
445
445
  <small class="v-data-table__controls__info__length">
446
- {total} 件中 {offset + 1} 件 〜 {offset + length} 件を表示
446
+ {`全 ${total} 件中 ${offset + 1} 件 〜 ${
447
+ offset + length
448
+ } 件を表示`}
447
449
  </small>
448
450
  </div>
449
451
  <div class="v-data-table__controls__select-limit">
@@ -1,10 +1,19 @@
1
1
  .v-drawer-layout {
2
- display: flex;
3
- flex-direction: column;
4
- align-items: stretch;
2
+ // display: flex;
3
+ // flex-direction: column;
4
+ // align-items: stretch;
5
+ display: block;
5
6
  width: 100%;
6
7
  height: 100%;
7
8
 
9
+ &__inner {
10
+ display: flex;
11
+ flex-direction: column;
12
+ align-items: stretch;
13
+ width: 100%;
14
+ height: 100%;
15
+ }
16
+
8
17
  &__header {
9
18
  display: flex;
10
19
  flex: 0 0 var(--v-app-layout-vertial-fixed-height);
@@ -17,6 +17,7 @@ export const VDrawerLayout = defineComponent({
17
17
  return (
18
18
  <VPaper
19
19
  class="v-drawer-layout"
20
+ innerClass="v-drawer-layout__inner"
20
21
  {...paperProps.value}
21
22
  square
22
23
  headerProps={{
@@ -5,6 +5,7 @@
5
5
  --tile-text-active-color: var(--text-color);
6
6
  --tile-pin-color: transparent;
7
7
  --paper-link-color: var(--tile-text-color);
8
+ --depth-padding: var(--list-tile-padding);
8
9
 
9
10
  // &--has-color {
10
11
  // --tile-text-color: var(--nav-color);
@@ -14,7 +15,8 @@
14
15
  display: flex;
15
16
  align-items: center;
16
17
  width: 100%;
17
- padding: 10px;
18
+ padding: var(--list-tile-padding);
19
+ padding-left: var(--depth-padding);
18
20
  color: var(--tile-text-color);
19
21
  text-align: left;
20
22
  text-decoration: none;
@@ -11,4 +11,18 @@
11
11
  --tile-background: var(--tile-active-background);
12
12
  }
13
13
  }
14
+
15
+ &--depth {
16
+ &-1 {
17
+ --depth-padding: calc(var(--list-tile-padding) * 2);
18
+ }
19
+
20
+ &-2 {
21
+ --depth-padding: calc(var(--list-tile-padding) * 3);
22
+ }
23
+
24
+ &-3 {
25
+ --depth-padding: calc(var(--list-tile-padding) * 4);
26
+ }
27
+ }
14
28
  }
@@ -22,6 +22,11 @@ export function createNavigationItemProps() {
22
22
  return {
23
23
  ...createListTileProps(),
24
24
  match: String,
25
+ depth: {
26
+ type: Number,
27
+ default: 0,
28
+ },
29
+ nested: Boolean,
25
30
  // key: {
26
31
  // type: [String, Number],
27
32
  // required: true,
@@ -98,6 +103,7 @@ export const VNavigationItem = defineComponent({
98
103
  const classes = computed(() => [
99
104
  {
100
105
  'v-navigation-item--opened': opened.value,
106
+ [`v-navigation-item--depth-${props.depth}`]: props.depth > 0,
101
107
  },
102
108
  ]);
103
109
 
@@ -238,6 +244,7 @@ export const VNavigationItem = defineComponent({
238
244
  {_children.map((child) =>
239
245
  renderNavigationItemInput(child, {
240
246
  startIconEmptySpace: _props.value.startIconEmptySpace,
247
+ depth: props.nested ? props.depth + 1 : props.depth,
241
248
  // onClick,
242
249
  // onChangeActive,
243
250
  }),
@@ -77,6 +77,7 @@ export const VPagination = defineComponent({
77
77
  props: paginationProps(),
78
78
  emits: {
79
79
  change: (page: number) => true,
80
+ 'update:modelValue': (page: number) => true,
80
81
  },
81
82
  setup(props, ctx) {
82
83
  const vui = useVui();
@@ -13,17 +13,23 @@
13
13
  --paper-link-color: var(--nav-color);
14
14
  }
15
15
 
16
+ display: block;
16
17
  color: var(--paper-text-color);
17
18
  background-color: var(--paper-background--color);
18
19
  border-radius: var(--paper-radius);
19
20
 
21
+ &__inner {
22
+ position: relative;
23
+ border-radius: inherit;
24
+ }
25
+
20
26
  &--square {
21
27
  --paper-radius: 0px;
22
28
  }
23
29
 
24
- a {
25
- color: var(--paper-link-color);
26
- }
30
+ // a:not(.v-paper) {
31
+ // color: var(--paper-link-color);
32
+ // }
27
33
 
28
34
  &__header {
29
35
  border-top-left-radius: inherit;
@@ -1,14 +1,19 @@
1
1
  import './VPaper.scss';
2
2
  import { defineComponent, computed, PropType, VNodeProps } from 'vue';
3
3
  import { createElevationProps, useElevation } from '../../composables';
4
- import { renderSlotOrEmpty, defineSlotsProps } from '@fastkit/vue-utils';
4
+ import {
5
+ renderSlotOrEmpty,
6
+ defineSlotsProps,
7
+ htmlAttributesPropOptions,
8
+ } from '@fastkit/vue-utils';
5
9
  import { useScopeColorClass, ScopeName } from '@fastkit/vue-color-scheme';
6
10
 
7
11
  export function createPaperBaseProps() {
8
12
  return {
13
+ ...htmlAttributesPropOptions,
9
14
  color: String as PropType<ScopeName>,
10
15
  tag: {
11
- type: String,
16
+ type: [String, Object] as PropType<any>,
12
17
  default: 'div',
13
18
  },
14
19
  ...defineSlotsProps<{
@@ -29,11 +34,13 @@ export function createPaperProps() {
29
34
  headerProps: Object as PropType<ARGS>,
30
35
  bodyProps: Object as PropType<ARGS>,
31
36
  footerProps: Object as PropType<ARGS>,
37
+ innerClass: [String, Array, Object] as PropType<any>,
32
38
  };
33
39
  }
34
40
 
35
41
  export const VPaper = defineComponent({
36
42
  name: 'VPaper',
43
+ inheritAttrs: false,
37
44
  props: createPaperProps(),
38
45
  setup(props, ctx) {
39
46
  const tag = computed(() => props.tag);
@@ -44,7 +51,7 @@ export const VPaper = defineComponent({
44
51
  scope.value.className,
45
52
  {
46
53
  'v-paper--plain': !scope.value.value,
47
- 'v-paper--has-color': !!scope.value.value,
54
+ 'v-paper--has-color': !!scope.value.value || !!ctx.attrs.disabled,
48
55
  'v-paper--square': props.square,
49
56
  },
50
57
  ]);
@@ -57,20 +64,22 @@ export const VPaper = defineComponent({
57
64
  const header = renderSlotOrEmpty(ctx.slots, 'header');
58
65
  const footer = renderSlotOrEmpty(ctx.slots, 'footer');
59
66
  return (
60
- <TagName class={['v-paper', classes.value]}>
61
- {header && (
62
- <div class="v-paper__header" {...headerProps.value}>
63
- {header}
67
+ <TagName class={['v-paper', classes.value]} {...ctx.attrs}>
68
+ <div class={['v-paper__inner', props.innerClass]}>
69
+ {header && (
70
+ <div class="v-paper__header" {...headerProps.value}>
71
+ {header}
72
+ </div>
73
+ )}
74
+ <div class="v-paper__body" {...bodyProps.value}>
75
+ {renderSlotOrEmpty(ctx.slots, 'default')}
64
76
  </div>
65
- )}
66
- <div class="v-paper__body" {...bodyProps.value}>
67
- {renderSlotOrEmpty(ctx.slots, 'default')}
77
+ {footer && (
78
+ <div class="v-paper__footer" {...footerProps.value}>
79
+ {footer}
80
+ </div>
81
+ )}
68
82
  </div>
69
- {footer && (
70
- <div class="v-paper__footer" {...footerProps.value}>
71
- {footer}
72
- </div>
73
- )}
74
83
  </TagName>
75
84
  );
76
85
  };
@@ -296,6 +296,11 @@
296
296
 
297
297
  // breadcrumbs
298
298
  --breadcrumbs-font-size: var(--typo-sm-size);
299
+
300
+ // =============================================
301
+ // tiles
302
+ // =============================================
303
+ --list-tile-padding: calc(var(--root-em) * 0.625);
299
304
  }
300
305
 
301
306
  :root,