@fastkit/vui 0.16.44 → 0.16.46
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.d.ts +6 -6
- package/dist/vui.mjs +11 -11
- package/dist/vui.mjs.map +1 -1
- package/package.json +24 -24
- package/src/components/VDataTable/VDataTable.tsx +12 -43
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fastkit/vui",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.46",
|
|
4
4
|
"description": "A simple, extensible UI kit for Vue applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fastkit",
|
|
@@ -44,31 +44,31 @@
|
|
|
44
44
|
"src"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@fastkit/color-scheme": "1.0.
|
|
48
|
-
"@fastkit/color-scheme-gen": "0.13.
|
|
49
|
-
"@fastkit/dom": "0.1.4",
|
|
47
|
+
"@fastkit/color-scheme": "1.0.12",
|
|
48
|
+
"@fastkit/color-scheme-gen": "0.13.12",
|
|
50
49
|
"@fastkit/icon-font": "1.0.9",
|
|
51
|
-
"@fastkit/
|
|
52
|
-
"@fastkit/media-match": "
|
|
53
|
-
"@fastkit/tiny-logger": "0.13.4",
|
|
54
|
-
"@fastkit/media-match-gen": "0.13.11",
|
|
55
|
-
"@fastkit/rules": "0.13.5",
|
|
50
|
+
"@fastkit/dom": "0.1.5",
|
|
51
|
+
"@fastkit/media-match-gen": "0.13.12",
|
|
56
52
|
"@fastkit/stylebase": "0.13.1",
|
|
57
|
-
"@fastkit/
|
|
58
|
-
"@fastkit/vue-action": "0.2.
|
|
59
|
-
"@fastkit/
|
|
60
|
-
"@fastkit/
|
|
61
|
-
"@fastkit/
|
|
62
|
-
"@fastkit/vue-
|
|
63
|
-
"@fastkit/vue-
|
|
64
|
-
"@fastkit/vue-
|
|
65
|
-
"@fastkit/vue-
|
|
66
|
-
"@fastkit/vue-
|
|
67
|
-
"@fastkit/vue-
|
|
68
|
-
"@fastkit/vue-
|
|
69
|
-
"@fastkit/vue-
|
|
70
|
-
"@fastkit/vue-
|
|
71
|
-
"@fastkit/vue-
|
|
53
|
+
"@fastkit/media-match": "1.0.9",
|
|
54
|
+
"@fastkit/vue-action": "0.2.12",
|
|
55
|
+
"@fastkit/helpers": "0.13.5",
|
|
56
|
+
"@fastkit/rules": "0.13.6",
|
|
57
|
+
"@fastkit/tiny-logger": "0.13.5",
|
|
58
|
+
"@fastkit/vue-body-scroll-lock": "0.1.12",
|
|
59
|
+
"@fastkit/vue-app-layout": "0.14.15",
|
|
60
|
+
"@fastkit/vue-click-outside": "0.1.13",
|
|
61
|
+
"@fastkit/vue-form-control": "0.15.30",
|
|
62
|
+
"@fastkit/vue-keyboard": "0.1.5",
|
|
63
|
+
"@fastkit/vue-location": "0.1.12",
|
|
64
|
+
"@fastkit/vue-color-scheme": "0.14.12",
|
|
65
|
+
"@fastkit/vue-resize": "0.1.12",
|
|
66
|
+
"@fastkit/vue-media-match": "0.13.12",
|
|
67
|
+
"@fastkit/vue-scroller": "0.14.14",
|
|
68
|
+
"@fastkit/vue-loading": "0.14.13",
|
|
69
|
+
"@fastkit/vue-utils": "0.14.10",
|
|
70
|
+
"@fastkit/vue-stack": "0.15.24",
|
|
71
|
+
"@fastkit/vue-transitions": "0.1.13"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
74
|
"vue": "^3.3.0",
|
|
@@ -41,7 +41,7 @@ const DATA_TABLE_DEFAULTS = {
|
|
|
41
41
|
descQueryValue: 'DESC',
|
|
42
42
|
limits: [5, 10, 20, 50, 100],
|
|
43
43
|
limitDefault: 20,
|
|
44
|
-
|
|
44
|
+
controlThreshold: 10,
|
|
45
45
|
searchQuery: [] as string | string[],
|
|
46
46
|
};
|
|
47
47
|
|
|
@@ -179,9 +179,9 @@ export const VDataTable = defineComponent({
|
|
|
179
179
|
type: Number,
|
|
180
180
|
default: () => DATA_TABLE_DEFAULTS.limitDefault,
|
|
181
181
|
},
|
|
182
|
-
|
|
182
|
+
controlThreshold: {
|
|
183
183
|
type: Number,
|
|
184
|
-
default: () => DATA_TABLE_DEFAULTS.
|
|
184
|
+
default: () => DATA_TABLE_DEFAULTS.controlThreshold,
|
|
185
185
|
},
|
|
186
186
|
headers: {
|
|
187
187
|
type: Array as PropType<DataTableHeader<any>[]>,
|
|
@@ -205,7 +205,7 @@ export const VDataTable = defineComponent({
|
|
|
205
205
|
rowSettings: [Object, Function] as PropType<RawDataTableRowSettings>,
|
|
206
206
|
},
|
|
207
207
|
emits: {
|
|
208
|
-
input: (
|
|
208
|
+
input: (selectedValues: string[]) => true,
|
|
209
209
|
},
|
|
210
210
|
setup(props, ctx) {
|
|
211
211
|
const vui = useVui();
|
|
@@ -300,7 +300,7 @@ export const VDataTable = defineComponent({
|
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
return {
|
|
303
|
-
maxHeight: layout.
|
|
303
|
+
maxHeight: layout.calculateViewHeight(
|
|
304
304
|
_maxHeight,
|
|
305
305
|
-footerHeight - 100,
|
|
306
306
|
200,
|
|
@@ -328,7 +328,7 @@ export const VDataTable = defineComponent({
|
|
|
328
328
|
);
|
|
329
329
|
|
|
330
330
|
const needShowHeaderControlRef = computed(
|
|
331
|
-
() => props.items.length > props.
|
|
331
|
+
() => props.items.length > props.controlThreshold,
|
|
332
332
|
);
|
|
333
333
|
|
|
334
334
|
const sortByRef = computed({
|
|
@@ -348,7 +348,7 @@ export const VDataTable = defineComponent({
|
|
|
348
348
|
props.descQueryValue,
|
|
349
349
|
]);
|
|
350
350
|
|
|
351
|
-
const
|
|
351
|
+
const usePagingRef = computed(() => props.limits.length > 0);
|
|
352
352
|
|
|
353
353
|
const orderByRef = computed({
|
|
354
354
|
get: () => {
|
|
@@ -432,7 +432,7 @@ export const VDataTable = defineComponent({
|
|
|
432
432
|
|
|
433
433
|
vui.location.pushQuery({
|
|
434
434
|
...queries,
|
|
435
|
-
...(
|
|
435
|
+
...(usePagingRef.value
|
|
436
436
|
? {
|
|
437
437
|
[props.pageQuery]: 1,
|
|
438
438
|
}
|
|
@@ -565,7 +565,7 @@ export const VDataTable = defineComponent({
|
|
|
565
565
|
const isIndeterminate = isIndeterminateRef.value;
|
|
566
566
|
const isAllSelected = isAllSelectedRef.value;
|
|
567
567
|
const { defaultOrder, ascQueryValue } = props;
|
|
568
|
-
// const
|
|
568
|
+
// const usePaging = usePagingRef.value;
|
|
569
569
|
|
|
570
570
|
const children = headersRef.value.map((header) => {
|
|
571
571
|
const { label, sortQuery, align, key } = header;
|
|
@@ -596,9 +596,6 @@ export const VDataTable = defineComponent({
|
|
|
596
596
|
/>,
|
|
597
597
|
);
|
|
598
598
|
}
|
|
599
|
-
// if (key === DELETOR_HEADER_SYMBOL) {
|
|
600
|
-
// headerChildren.push('削除');
|
|
601
|
-
// }
|
|
602
599
|
|
|
603
600
|
const sortActive = sortBy === sortQuery;
|
|
604
601
|
|
|
@@ -673,7 +670,6 @@ export const VDataTable = defineComponent({
|
|
|
673
670
|
function defaultItemSlot(payload: DataTableItemSlotPayload) {
|
|
674
671
|
const { key, item, selected } = payload;
|
|
675
672
|
const headers = headersRef.value;
|
|
676
|
-
// const { $scopedSlots, $createElement, deletor } = this;
|
|
677
673
|
const children = headers.map((header) => {
|
|
678
674
|
const { cell, align, key: headerKey } = header;
|
|
679
675
|
const cellSlot = cell || ctx.slots.cell;
|
|
@@ -705,37 +701,10 @@ export const VDataTable = defineComponent({
|
|
|
705
701
|
onChange={(ev) => {
|
|
706
702
|
toggleSelect(key);
|
|
707
703
|
}}
|
|
708
|
-
// checkHandler={(e) => {
|
|
709
|
-
// this.toggleSelect(key as T[K]);
|
|
710
|
-
// }}
|
|
711
704
|
/>,
|
|
712
705
|
];
|
|
713
706
|
break;
|
|
714
707
|
}
|
|
715
|
-
// case DELETOR_HEADER_SYMBOL: {
|
|
716
|
-
// if (deletor) {
|
|
717
|
-
// const onClick = async (event: MouseEvent) => {
|
|
718
|
-
// if (
|
|
719
|
-
// await this.$confirm(`${key}を削除します。よろしいですか?`)
|
|
720
|
-
// ) {
|
|
721
|
-
// this.deletingTargets.push(key);
|
|
722
|
-
// await deletor(item);
|
|
723
|
-
// this.deletingTargets.splice(
|
|
724
|
-
// this.deletingTargets.indexOf(key),
|
|
725
|
-
// 1,
|
|
726
|
-
// );
|
|
727
|
-
// }
|
|
728
|
-
// };
|
|
729
|
-
// cellChildren = [
|
|
730
|
-
// <VBtn
|
|
731
|
-
// icon="trush"
|
|
732
|
-
// onClick={onClick}
|
|
733
|
-
// disabled={this.deletingTargets.includes(key)}
|
|
734
|
-
// />,
|
|
735
|
-
// ];
|
|
736
|
-
// }
|
|
737
|
-
// break;
|
|
738
|
-
// }
|
|
739
708
|
}
|
|
740
709
|
}
|
|
741
710
|
|
|
@@ -809,10 +778,10 @@ export const VDataTable = defineComponent({
|
|
|
809
778
|
|
|
810
779
|
return () => {
|
|
811
780
|
const isEmpty = isEmptyRef.value;
|
|
812
|
-
const
|
|
781
|
+
const usePaging = usePagingRef.value;
|
|
813
782
|
return (
|
|
814
783
|
<div class={['v-data-table', classesRef.value]}>
|
|
815
|
-
{!isEmpty &&
|
|
784
|
+
{!isEmpty && usePaging && needShowHeaderControlRef.value && (
|
|
816
785
|
<div class="v-data-table__header">{genControls()}</div>
|
|
817
786
|
)}
|
|
818
787
|
<div class="v-data-table__body container-pull">
|
|
@@ -841,7 +810,7 @@ export const VDataTable = defineComponent({
|
|
|
841
810
|
</Transition>
|
|
842
811
|
</div>
|
|
843
812
|
{!isEmpty &&
|
|
844
|
-
|
|
813
|
+
usePaging &&
|
|
845
814
|
withDirectives(
|
|
846
815
|
<div class="v-data-table__footer">{genControls()}</div>,
|
|
847
816
|
[
|