@vc-shell/framework 1.0.260 → 1.0.262
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/CHANGELOG.md +8 -0
- package/dist/framework.js +13931 -13970
- package/dist/index.css +1 -1
- package/dist/ui/components/atoms/vc-badge/vc-badge.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-tooltip/vc-tooltip.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/vc-table.stories.d.ts +30 -30
- package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts +6 -6
- package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +1 -1
- package/package.json +4 -4
- package/shared/modules/dynamic/pages/dynamic-blade-form.vue +1 -1
- package/ui/components/atoms/vc-badge/vc-badge.vue +1 -0
- package/ui/components/atoms/vc-tooltip/vc-tooltip.vue +1 -1
- package/ui/components/atoms/vc-widget/vc-widget.vue +3 -3
- package/ui/components/molecules/vc-checkbox/vc-checkbox.vue +1 -1
- package/ui/components/organisms/vc-blade/vc-blade.vue +1 -1
- package/ui/components/organisms/vc-table/vc-table.vue +98 -80
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
clearable
|
|
96
96
|
name="table_search"
|
|
97
97
|
:model-value="searchValue"
|
|
98
|
-
@update:model-value="$emit('search:change', $event)"
|
|
98
|
+
@update:model-value="$emit('search:change', $event as string)"
|
|
99
99
|
>
|
|
100
100
|
<template #prepend-inner="{ focus }">
|
|
101
101
|
<VcIcon
|
|
@@ -204,12 +204,13 @@
|
|
|
204
204
|
>
|
|
205
205
|
<div class="vc-table__header-row tw-flex tw-flex-row">
|
|
206
206
|
<div
|
|
207
|
-
v-if="
|
|
208
|
-
class="tw-flex-1 tw-flex tw-items-center tw-justify-center tw-w-[
|
|
207
|
+
v-if="multiselect && items && items.length"
|
|
208
|
+
class="tw-flex-1 tw-flex tw-items-center tw-justify-center tw-w-[36px] tw-max-w-[36px] tw-min-w-[36px] tw-bg-[#f9f9f9] !tw-border-0 tw-shadow-[inset_0px_1px_0px_#eaedf3,_inset_0px_-1px_0px_#eaedf3] tw-box-border tw-sticky tw-top-0 tw-select-none tw-overflow-hidden tw-z-[1]"
|
|
209
209
|
>
|
|
210
210
|
<div class="tw-flex tw-justify-center tw-items-center">
|
|
211
211
|
<VcCheckbox
|
|
212
212
|
v-model="headerCheckbox"
|
|
213
|
+
size="m"
|
|
213
214
|
@click.stop
|
|
214
215
|
></VcCheckbox>
|
|
215
216
|
</div>
|
|
@@ -237,7 +238,7 @@
|
|
|
237
238
|
@drop="onColumnHeaderDrop($event, item)"
|
|
238
239
|
@click="handleHeaderClick(item)"
|
|
239
240
|
>
|
|
240
|
-
<div
|
|
241
|
+
<!-- <div
|
|
241
242
|
v-if="!editing && multiselect && index === 0 && items && items.length"
|
|
242
243
|
class="tw-flex tw-pl-5 tw-items-center tw-justify-center tw-w-auto tw-bg-[#f9f9f9] tw-box-border tw-select-none tw-overflow-hidden tw-z-[1] tw-shrink-0"
|
|
243
244
|
>
|
|
@@ -248,7 +249,7 @@
|
|
|
248
249
|
@click.stop
|
|
249
250
|
></VcCheckbox>
|
|
250
251
|
</div>
|
|
251
|
-
</div>
|
|
252
|
+
</div> -->
|
|
252
253
|
<div class="tw-flex tw-items-center tw-flex-nowrap tw-truncate tw-px-3 tw-font-bold">
|
|
253
254
|
<div class="tw-truncate">
|
|
254
255
|
<span
|
|
@@ -361,13 +362,14 @@
|
|
|
361
362
|
@mouseover="showActions(itemIndex)"
|
|
362
363
|
>
|
|
363
364
|
<div
|
|
364
|
-
v-if="
|
|
365
|
-
class="tw-w-[
|
|
365
|
+
v-if="multiselect && typeof item === 'object'"
|
|
366
|
+
class="tw-w-[36px] tw-max-w-[36px] tw-min-w-[36px] tw-relative tw-flex-1 tw-flex tw-items-center tw-justify-center"
|
|
366
367
|
@click.stop
|
|
367
368
|
>
|
|
368
369
|
<div class="tw-flex tw-justify-center tw-items-center">
|
|
369
370
|
<VcCheckbox
|
|
370
371
|
:model-value="isSelected(item)"
|
|
372
|
+
size="m"
|
|
371
373
|
@update:model-value="rowCheckbox(item)"
|
|
372
374
|
></VcCheckbox>
|
|
373
375
|
</div>
|
|
@@ -381,12 +383,27 @@
|
|
|
381
383
|
:class="[cell.class]"
|
|
382
384
|
:style="{ maxWidth: cell.width, width: cell.width }"
|
|
383
385
|
>
|
|
384
|
-
<div class="tw-truncate">
|
|
385
|
-
<renderCellSlot
|
|
386
|
+
<div class="tw-truncate tw-w-full">
|
|
387
|
+
<!-- <renderCellSlot
|
|
388
|
+
:item="item"
|
|
389
|
+
:cell="cell"
|
|
390
|
+
:index="itemIndex"
|
|
391
|
+
/> -->
|
|
392
|
+
<slot
|
|
393
|
+
:name="`item_${cell.id}`"
|
|
386
394
|
:item="item"
|
|
387
395
|
:cell="cell"
|
|
388
396
|
:index="itemIndex"
|
|
389
|
-
|
|
397
|
+
>
|
|
398
|
+
<VcTableCell
|
|
399
|
+
:item="item as TableItem"
|
|
400
|
+
:cell="cell"
|
|
401
|
+
:index="itemIndex"
|
|
402
|
+
:editing="editing"
|
|
403
|
+
@update="$emit('onEditComplete', { event: $event, index: itemIndex })"
|
|
404
|
+
@blur="$emit('onCellBlur', $event)"
|
|
405
|
+
></VcTableCell>
|
|
406
|
+
</slot>
|
|
390
407
|
</div>
|
|
391
408
|
</div>
|
|
392
409
|
<div
|
|
@@ -595,7 +612,7 @@ const props = withDefaults(
|
|
|
595
612
|
const emit = defineEmits<{
|
|
596
613
|
paginationClick: [page: number];
|
|
597
614
|
selectionChanged: [values: T[]];
|
|
598
|
-
"search:change": [value: string |
|
|
615
|
+
"search:change": [value: string | undefined];
|
|
599
616
|
headerClick: [item: ITableColumns];
|
|
600
617
|
itemClick: [item: T];
|
|
601
618
|
"scroll:ptr": [];
|
|
@@ -645,7 +662,7 @@ const draggedColumn = ref();
|
|
|
645
662
|
const draggedElement = ref<HTMLElement>();
|
|
646
663
|
const dropPosition = ref();
|
|
647
664
|
const columnsInit = ref(true);
|
|
648
|
-
const isHovered = ref(undefined) as Ref<{ item: T; state: boolean } | undefined>;
|
|
665
|
+
// const isHovered = ref(undefined) as Ref<{ item: T; state: boolean } | undefined>;
|
|
649
666
|
|
|
650
667
|
// row reordering variables
|
|
651
668
|
const draggedRow = ref<T>();
|
|
@@ -669,70 +686,70 @@ const sortField = computed(() => {
|
|
|
669
686
|
|
|
670
687
|
const hasClickListener = typeof instance?.vnode.props?.["onItemClick"] === "function";
|
|
671
688
|
|
|
672
|
-
const renderCellSlot = ({ item, cell, index }: { item: T; cell: ITableColumns; index: number }) => {
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
};
|
|
731
|
-
|
|
732
|
-
const calculateElWidth = (id: string) => {
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
};
|
|
689
|
+
// const renderCellSlot = ({ item, cell, index }: { item: T; cell: ITableColumns; index: number }) => {
|
|
690
|
+
// const isSlotExist = slots[`item_${cell.id}`];
|
|
691
|
+
|
|
692
|
+
// const isFirstCell = filteredCols.value.indexOf(cell) === 0;
|
|
693
|
+
|
|
694
|
+
// const isRowSelected = isSelected(item);
|
|
695
|
+
|
|
696
|
+
// const checkboxComponent = h(
|
|
697
|
+
// "div",
|
|
698
|
+
// {
|
|
699
|
+
// class: "tw-absolute tw-z-10 tw-top-0 tw-bottom-0 tw-left-[20px] tw-right-0 tw-flex tw-items-center",
|
|
700
|
+
// },
|
|
701
|
+
// h(VcCheckbox, {
|
|
702
|
+
// class: "",
|
|
703
|
+
// size: "m",
|
|
704
|
+
// modelValue: isSelected(item),
|
|
705
|
+
// onClick: (e: Event) => e.stopPropagation(),
|
|
706
|
+
// onMouseover: () => (isHovered.value = { state: true, item: item }),
|
|
707
|
+
// onMouseout: () => (isHovered.value = { state: false, item: item }),
|
|
708
|
+
// "onUpdate:modelValue": () => {
|
|
709
|
+
// rowCheckbox(item);
|
|
710
|
+
// },
|
|
711
|
+
// }),
|
|
712
|
+
// );
|
|
713
|
+
|
|
714
|
+
// const checkboxVisibilityHandler =
|
|
715
|
+
// !props.editing &&
|
|
716
|
+
// props.multiselect &&
|
|
717
|
+
// props.items &&
|
|
718
|
+
// props.items.length &&
|
|
719
|
+
// ((isFirstCell && selectedRowIndex.value === index) || (isRowSelected && isFirstCell));
|
|
720
|
+
|
|
721
|
+
// return h("div", { class: "" }, [
|
|
722
|
+
// checkboxVisibilityHandler ? checkboxComponent : undefined,
|
|
723
|
+
// h(
|
|
724
|
+
// "div",
|
|
725
|
+
// {
|
|
726
|
+
// class: checkboxVisibilityHandler
|
|
727
|
+
// ? isHovered.value?.item === item && isHovered.value.state
|
|
728
|
+
// ? "tw-opacity-5"
|
|
729
|
+
// : "tw-opacity-15"
|
|
730
|
+
// : "",
|
|
731
|
+
// },
|
|
732
|
+
// !isSlotExist
|
|
733
|
+
// ? h(VcTableCell, {
|
|
734
|
+
// cell,
|
|
735
|
+
|
|
736
|
+
// item: item as TableItem,
|
|
737
|
+
// index,
|
|
738
|
+
// editing: props.editing,
|
|
739
|
+
// onUpdate: (event) => {
|
|
740
|
+
// emit("onEditComplete", { event, index });
|
|
741
|
+
// },
|
|
742
|
+
// onBlur: (event) => emit("onCellBlur", event),
|
|
743
|
+
// })
|
|
744
|
+
// : slots[`item_${cell.id}`]?.({ item, cell, index }),
|
|
745
|
+
// ),
|
|
746
|
+
// ]);
|
|
747
|
+
// };
|
|
748
|
+
|
|
749
|
+
// const calculateElWidth = (id: string) => {
|
|
750
|
+
// const el = document.getElementById(id);
|
|
751
|
+
// return el ? el.offsetWidth : 0;
|
|
752
|
+
// };
|
|
736
753
|
|
|
737
754
|
const allColumns = ref([]) as Ref<ITableColumns[]>;
|
|
738
755
|
|
|
@@ -897,14 +914,15 @@ function handleSelectAll() {
|
|
|
897
914
|
}
|
|
898
915
|
|
|
899
916
|
function isSelected(item: T) {
|
|
900
|
-
return selection.value.
|
|
917
|
+
return !!selection.value.find((x) => _.isEqual(x, item));
|
|
901
918
|
}
|
|
902
919
|
|
|
903
920
|
function rowCheckbox(item: T) {
|
|
904
921
|
const clear = item;
|
|
905
|
-
const
|
|
906
|
-
|
|
907
|
-
|
|
922
|
+
const isExist = selection.value.find((x) => _.isEqual(x, clear));
|
|
923
|
+
|
|
924
|
+
if (isExist) {
|
|
925
|
+
selection.value = selection.value.filter((x) => !_.isEqual(x, clear));
|
|
908
926
|
} else {
|
|
909
927
|
selection.value.push(clear);
|
|
910
928
|
}
|