@vc-shell/framework 1.0.223 → 1.0.224
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 +20 -0
- package/core/types/index.ts +2 -1
- package/dist/core/plugins/modularity/index.d.ts +3 -3
- package/dist/core/plugins/modularity/index.d.ts.map +1 -1
- package/dist/core/types/index.d.ts +2 -1
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/framework.js +20957 -20792
- package/dist/index.css +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/locales/en.json +2 -1
- package/dist/shared/components/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue.d.ts.map +1 -1
- package/dist/shared/components/blade-navigation/composables/useBladeNavigation/index.d.ts.map +1 -1
- package/dist/shared/components/error-interceptor/index.d.ts.map +1 -1
- package/dist/shared/components/notifications/components/notification-container/index.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/SchemaRender.d.ts +6 -0
- package/dist/shared/modules/dynamic/components/SchemaRender.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/Button.d.ts +2 -0
- package/dist/shared/modules/dynamic/components/fields/Button.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/Card.d.ts +2 -0
- package/dist/shared/modules/dynamic/components/fields/Card.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/Checkbox.d.ts +2 -0
- package/dist/shared/modules/dynamic/components/fields/Checkbox.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/ContentField.d.ts +2 -0
- package/dist/shared/modules/dynamic/components/fields/ContentField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/CustomComponent.d.ts +2 -0
- package/dist/shared/modules/dynamic/components/fields/CustomComponent.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/DynamicProperty.d.ts +2 -0
- package/dist/shared/modules/dynamic/components/fields/DynamicProperty.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/EditorField.d.ts +2 -0
- package/dist/shared/modules/dynamic/components/fields/EditorField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/Fieldset.d.ts +2 -0
- package/dist/shared/modules/dynamic/components/fields/Fieldset.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/GalleryField.d.ts +2 -0
- package/dist/shared/modules/dynamic/components/fields/GalleryField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/ImageField.d.ts +2 -0
- package/dist/shared/modules/dynamic/components/fields/ImageField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/InputCurrency.d.ts +2 -0
- package/dist/shared/modules/dynamic/components/fields/InputCurrency.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/InputField.d.ts +2 -0
- package/dist/shared/modules/dynamic/components/fields/InputField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/MultivalueField.d.ts +2 -0
- package/dist/shared/modules/dynamic/components/fields/MultivalueField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/RadioButtonGroup.d.ts +2 -0
- package/dist/shared/modules/dynamic/components/fields/RadioButtonGroup.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/RatingField.d.ts +2 -0
- package/dist/shared/modules/dynamic/components/fields/RatingField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/SelectField.d.ts +2 -0
- package/dist/shared/modules/dynamic/components/fields/SelectField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/StatusField.d.ts +2 -0
- package/dist/shared/modules/dynamic/components/fields/StatusField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/SwitchField.d.ts +2 -0
- package/dist/shared/modules/dynamic/components/fields/SwitchField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/Table.d.ts +10 -8
- package/dist/shared/modules/dynamic/components/fields/Table.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/TextareaField.d.ts +2 -0
- package/dist/shared/modules/dynamic/components/fields/TextareaField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/VideoField.d.ts +2 -0
- package/dist/shared/modules/dynamic/components/fields/VideoField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/props.d.ts +2 -0
- package/dist/shared/modules/dynamic/components/fields/props.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/Button.stories.d.ts +15 -9
- package/dist/shared/modules/dynamic/components/fields/storybook/Button.stories.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/Card.stories.d.ts +19 -3
- package/dist/shared/modules/dynamic/components/fields/storybook/Card.stories.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/Checkbox.stories.d.ts +6 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/Checkbox.stories.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/ContentField.stories.d.ts +10 -4
- package/dist/shared/modules/dynamic/components/fields/storybook/ContentField.stories.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/EditorField.stories.d.ts +7 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/EditorField.stories.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/Fieldset.stories.d.ts +9 -3
- package/dist/shared/modules/dynamic/components/fields/storybook/Fieldset.stories.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/GalleryField.stories.d.ts +8 -2
- package/dist/shared/modules/dynamic/components/fields/storybook/GalleryField.stories.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/ImageField.stories.d.ts +11 -5
- package/dist/shared/modules/dynamic/components/fields/storybook/ImageField.stories.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/InputCurrency.stories.d.ts +6 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/InputCurrency.stories.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/InputField.stories.d.ts +9 -3
- package/dist/shared/modules/dynamic/components/fields/storybook/InputField.stories.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/MultivalueField.stories.d.ts +10 -4
- package/dist/shared/modules/dynamic/components/fields/storybook/MultivalueField.stories.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/RadioButtonGroup.stories.d.ts +6 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/RadioButtonGroup.stories.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/RatingField.stories.d.ts +8 -2
- package/dist/shared/modules/dynamic/components/fields/storybook/RatingField.stories.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/SelectField.stories.d.ts +13 -7
- package/dist/shared/modules/dynamic/components/fields/storybook/SelectField.stories.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/StatusField.stories.d.ts +9 -3
- package/dist/shared/modules/dynamic/components/fields/storybook/StatusField.stories.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/TextareaField.stories.d.ts +7 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/TextareaField.stories.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/VideoField.stories.d.ts +6 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/VideoField.stories.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.d.ts +6 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/composables/useFilterBuilder/index.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/factories/base/useDetailsFactory.d.ts +3 -1
- package/dist/shared/modules/dynamic/factories/base/useDetailsFactory.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/factories/base/useListFactory.d.ts +1 -1
- package/dist/shared/modules/dynamic/factories/base/useListFactory.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/factories/types/index.d.ts +1 -0
- package/dist/shared/modules/dynamic/factories/types/index.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/helpers/override.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/helpers/visibilityHandler.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/index.d.ts +4 -4
- package/dist/shared/modules/dynamic/index.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts +2 -0
- package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/types/index.d.ts +6 -17
- package/dist/shared/modules/dynamic/types/index.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/atoms/vc-badge/vc-badge.stories.d.ts +4 -4
- package/dist/ui/components/atoms/vc-button/vc-button.stories.d.ts +11 -11
- package/dist/ui/components/atoms/vc-card/vc-card.stories.d.ts +7 -7
- package/dist/ui/components/atoms/vc-container/vc-container.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-hint/vc-hint.stories.d.ts +1 -1
- package/dist/ui/components/atoms/vc-icon/vc-icon.stories.d.ts +3 -3
- package/dist/ui/components/atoms/vc-image/vc-image.stories.d.ts +3 -3
- package/dist/ui/components/atoms/vc-label/vc-label.stories.d.ts +2 -2
- package/dist/ui/components/atoms/vc-link/vc-link.stories.d.ts +1 -1
- package/dist/ui/components/atoms/vc-progress/vc-progress.stories.d.ts +2 -2
- package/dist/ui/components/atoms/vc-status/vc-status.stories.d.ts +4 -4
- package/dist/ui/components/atoms/vc-switch/vc-switch.stories.d.ts +1 -1
- package/dist/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.stories.d.ts +1 -1
- package/dist/ui/components/molecules/vc-checkbox/vc-checkbox.stories.d.ts +10 -10
- package/dist/ui/components/molecules/vc-editor/vc-editor.stories.d.ts +1 -1
- package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-field/vc-field.stories.d.ts +95 -2
- package/dist/ui/components/molecules/vc-field/vc-field.stories.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.stories.d.ts +2 -2
- package/dist/ui/components/molecules/vc-input/vc-input.stories.d.ts +2 -2
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.stories.d.ts +2 -2
- package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-radio-button/vc-radio-button.stories.d.ts +8 -8
- package/dist/ui/components/molecules/vc-rating/vc-rating.stories.d.ts +1 -1
- package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-slider/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-slider/vc-slider.stories.d.ts +3 -3
- package/dist/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-gallery/vc-gallery.stories.d.ts +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-add-new/vc-table-add-new.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-column-switcher/vc-table-column-switcher.vue.d.ts +1 -0
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-column-switcher/vc-table-column-switcher.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-empty/vc-table-empty.vue.d.ts +42 -0
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-empty/vc-table-empty.vue.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-mobile-item/vc-table-mobile-item.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/vc-table.stories.d.ts +15 -105
- package/dist/ui/components/organisms/vc-table/vc-table.stories.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts +3 -21
- package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +1 -1
- package/package.json +4 -4
- package/shared/components/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue +1 -0
- package/shared/components/blade-navigation/composables/useBladeNavigation/index.ts +20 -9
- package/shared/modules/dynamic/components/fields/Card.ts +1 -0
- package/shared/modules/dynamic/components/fields/GalleryField.ts +3 -2
- package/shared/modules/dynamic/components/fields/Table.ts +61 -21
- package/shared/modules/dynamic/components/fields/storybook/Card.stories.ts +10 -0
- package/shared/modules/dynamic/components/fields/storybook/ContentField.stories.ts +1 -1
- package/shared/modules/dynamic/components/fields/storybook/Fieldset.stories.ts +1 -1
- package/shared/modules/dynamic/components/fields/storybook/InputField.stories.ts +1 -1
- package/shared/modules/dynamic/components/fields/storybook/SelectField.stories.ts +4 -4
- package/shared/modules/dynamic/factories/base/useDetailsFactory.ts +12 -1
- package/shared/modules/dynamic/factories/types/index.ts +1 -0
- package/shared/modules/dynamic/helpers/nodeBuilder.ts +6 -6
- package/shared/modules/dynamic/pages/dynamic-blade-list.vue +5 -2
- package/shared/modules/dynamic/types/index.ts +6 -16
- package/ui/components/atoms/vc-card/vc-card.vue +2 -2
- package/ui/components/atoms/vc-container/vc-container.vue +71 -128
- package/ui/components/atoms/vc-progress/vc-progress.stories.ts +1 -1
- package/ui/components/atoms/vc-status/vc-status.stories.ts +1 -1
- package/ui/components/molecules/vc-editor/vc-editor.vue +3 -0
- package/ui/components/molecules/vc-field/vc-field.stories.ts +2 -2
- package/ui/components/molecules/vc-input/vc-input.stories.ts +1 -1
- package/ui/components/molecules/vc-select/vc-select.vue +3 -3
- package/ui/components/organisms/vc-app/vc-app.vue +2 -2
- package/ui/components/organisms/vc-table/_internal/vc-table-add-new/vc-table-add-new.vue +18 -20
- package/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue +23 -16
- package/ui/components/organisms/vc-table/_internal/vc-table-column-switcher/vc-table-column-switcher.vue +8 -1
- package/ui/components/organisms/vc-table/_internal/vc-table-empty/vc-table-empty.vue +76 -0
- package/ui/components/organisms/vc-table/_internal/vc-table-mobile-item/vc-table-mobile-item.vue +9 -7
- package/ui/components/organisms/vc-table/vc-table.vue +188 -358
|
@@ -7,38 +7,41 @@
|
|
|
7
7
|
'vc-container_nopadding': noPadding,
|
|
8
8
|
},
|
|
9
9
|
]"
|
|
10
|
-
@touchstart="
|
|
11
|
-
@touchmove="
|
|
12
|
-
@touchend="
|
|
10
|
+
@touchstart="onTouchstart"
|
|
11
|
+
@touchmove="onTouchmove"
|
|
12
|
+
@touchend="onTouchend"
|
|
13
13
|
>
|
|
14
14
|
<div
|
|
15
|
-
|
|
16
|
-
class="vc-container__inner"
|
|
15
|
+
:class="['vc-container__overscroll', { 'vc-container__overscroll_touching': touching }]"
|
|
17
16
|
:style="{
|
|
18
|
-
|
|
17
|
+
top: -1 * pullDist + topOffset + 'px',
|
|
18
|
+
height: pullDist + 'px',
|
|
19
19
|
}"
|
|
20
20
|
>
|
|
21
|
-
<div
|
|
22
|
-
v-if="usePtr && dist > 0"
|
|
23
|
-
class="vc-container__overscroll"
|
|
24
|
-
:class="{ 'vc-container__overscroll_passed': status === 'loosing' }"
|
|
25
|
-
:style="{ height: dist ? `${dist}px` : '0px' }"
|
|
26
|
-
>
|
|
21
|
+
<div class="vc-container__status">
|
|
27
22
|
<VcIcon
|
|
28
|
-
:icon="
|
|
29
|
-
|
|
30
|
-
:style="{ transform: status === 'pulling' ? `rotate(${dist * 3}deg)` : '' }"
|
|
23
|
+
:icon="canRefresh || goingUp ? 'fas fa-arrow-up' : 'fas fa-arrow-down'"
|
|
24
|
+
class="vc-container__overscroll-icon"
|
|
31
25
|
></VcIcon>
|
|
32
|
-
<span v-if="
|
|
33
|
-
<span v-else
|
|
26
|
+
<span v-if="!(canRefresh || goingUp)">{{ $t("COMPONENTS.ATOMS.VC_CONTAINER.PULL_TO_REFRESH") }}</span>
|
|
27
|
+
<span v-else>{{ $t("COMPONENTS.ATOMS.VC_CONTAINER.REFRESHING") }}</span>
|
|
34
28
|
</div>
|
|
29
|
+
</div>
|
|
30
|
+
<div
|
|
31
|
+
ref="component"
|
|
32
|
+
class="vc-container__inner"
|
|
33
|
+
:class="{
|
|
34
|
+
'vc-container__inner_touching': touching,
|
|
35
|
+
}"
|
|
36
|
+
:style="{ top: topOffset + 'px' }"
|
|
37
|
+
>
|
|
35
38
|
<slot></slot>
|
|
36
39
|
</div>
|
|
37
40
|
</div>
|
|
38
41
|
</template>
|
|
39
42
|
|
|
40
43
|
<script lang="ts" setup>
|
|
41
|
-
import { ref, onMounted, computed,
|
|
44
|
+
import { ref, onMounted, computed, shallowRef, watch } from "vue";
|
|
42
45
|
import { VcIcon } from "./../vc-icon";
|
|
43
46
|
|
|
44
47
|
export interface Props {
|
|
@@ -51,39 +54,21 @@ export interface Emits {
|
|
|
51
54
|
(event: "scroll:ptr"): void;
|
|
52
55
|
}
|
|
53
56
|
|
|
54
|
-
|
|
57
|
+
defineProps<Props>();
|
|
55
58
|
|
|
56
59
|
const emit = defineEmits<Emits>();
|
|
57
60
|
|
|
58
61
|
const component = ref<HTMLElement>();
|
|
59
62
|
const scroll = ref(false);
|
|
60
|
-
const startY = ref(0);
|
|
61
|
-
const ceiling = ref();
|
|
62
63
|
const pullDist = ref(60);
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
const
|
|
64
|
+
const touchDiff = shallowRef(0);
|
|
65
|
+
let touchstartY = 0;
|
|
66
|
+
const refreshing = shallowRef(false);
|
|
67
|
+
const goingUp = shallowRef(false);
|
|
68
|
+
const touching = shallowRef(false);
|
|
66
69
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
scroll.value = (component.value && component.value.clientHeight < component.value.scrollHeight) as boolean;
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
if (component.value) {
|
|
73
|
-
observer.observe(component.value);
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
const touchable = computed(() => status.value !== "refresh" && status.value !== "success");
|
|
78
|
-
|
|
79
|
-
const iconClass = computed(() => {
|
|
80
|
-
if (status.value === "loosing") {
|
|
81
|
-
return "vc-container__overscroll-icon_refresh";
|
|
82
|
-
} else if (status.value === "pulling") {
|
|
83
|
-
return "vc-container__overscroll-icon_pulling";
|
|
84
|
-
}
|
|
85
|
-
return "vc-container__overscroll-icon";
|
|
86
|
-
});
|
|
70
|
+
const topOffset = computed(() => Math.max(0, Math.min(pullDist.value, touchDiff.value)));
|
|
71
|
+
const canRefresh = computed(() => touchDiff.value >= pullDist.value && !refreshing.value);
|
|
87
72
|
|
|
88
73
|
const scrollTop = () => {
|
|
89
74
|
if (component.value) {
|
|
@@ -91,81 +76,48 @@ const scrollTop = () => {
|
|
|
91
76
|
}
|
|
92
77
|
};
|
|
93
78
|
|
|
94
|
-
function
|
|
95
|
-
if (
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
checkPullStart(e);
|
|
79
|
+
function onTouchstart(e: TouchEvent | MouseEvent) {
|
|
80
|
+
if (refreshing.value) return;
|
|
81
|
+
touching.value = true;
|
|
82
|
+
touchstartY = "clientY" in e ? e.clientY : e.touches[0].clientY;
|
|
99
83
|
}
|
|
100
84
|
|
|
101
|
-
function
|
|
102
|
-
if (
|
|
103
|
-
const touch = e.touches[0];
|
|
104
|
-
if (!touchable.value) {
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
85
|
+
function onTouchmove(e: TouchEvent | MouseEvent) {
|
|
86
|
+
if (refreshing.value || !touching.value) return;
|
|
107
87
|
|
|
108
|
-
|
|
109
|
-
checkPullStart(e);
|
|
110
|
-
}
|
|
88
|
+
const touchY = "clientY" in e ? e.clientY : e.touches[0].clientY;
|
|
111
89
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
if (ceiling.value && delta.value >= 0 && delta.value < 80) {
|
|
115
|
-
e.preventDefault();
|
|
116
|
-
|
|
117
|
-
setStatus(ease(delta.value));
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function touchEnd(): void {
|
|
123
|
-
if (delta.value && touchable.value) {
|
|
124
|
-
if (status.value === "loosing") {
|
|
125
|
-
nextTick(() => emit("scroll:ptr"));
|
|
126
|
-
}
|
|
127
|
-
setStatus(0);
|
|
90
|
+
if (scroll.value) {
|
|
91
|
+
touchDiff.value = touchY - touchstartY;
|
|
128
92
|
}
|
|
129
93
|
}
|
|
130
94
|
|
|
131
|
-
function
|
|
132
|
-
|
|
95
|
+
function onTouchend() {
|
|
96
|
+
if (refreshing.value) return;
|
|
97
|
+
touching.value = false;
|
|
133
98
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
ceiling.value = getScrollTop(component.value as HTMLElement) === 0;
|
|
139
|
-
|
|
140
|
-
if (ceiling.value) {
|
|
141
|
-
startY.value = e.touches[0].clientY;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function setStatus(distance: number) {
|
|
146
|
-
let stat;
|
|
147
|
-
if (distance === 0) {
|
|
148
|
-
stat = "normal";
|
|
99
|
+
if (canRefresh.value) {
|
|
100
|
+
touchDiff.value = 0;
|
|
101
|
+
refreshing.value = false;
|
|
102
|
+
emit("scroll:ptr");
|
|
149
103
|
} else {
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
dist.value = distance;
|
|
153
|
-
if (stat !== status.value) {
|
|
154
|
-
status.value = stat;
|
|
104
|
+
touchDiff.value = 0;
|
|
155
105
|
}
|
|
156
106
|
}
|
|
157
107
|
|
|
158
|
-
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
108
|
+
onMounted(() => {
|
|
109
|
+
const observer = new ResizeObserver(() => {
|
|
110
|
+
scroll.value = (component.value && component.value.clientHeight < component.value.scrollHeight) as boolean;
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
if (component.value) {
|
|
114
|
+
observer.observe(component.value);
|
|
166
115
|
}
|
|
167
|
-
|
|
168
|
-
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
watch(topOffset, (newVal, oldVal) => {
|
|
119
|
+
goingUp.value = newVal < oldVal;
|
|
120
|
+
});
|
|
169
121
|
|
|
170
122
|
defineExpose({
|
|
171
123
|
scrollTop,
|
|
@@ -190,33 +142,29 @@ defineExpose({
|
|
|
190
142
|
}
|
|
191
143
|
|
|
192
144
|
&__overscroll {
|
|
193
|
-
@apply tw-
|
|
145
|
+
@apply tw-absolute tw-w-full [transition:top_0.3s_ease-out];
|
|
194
146
|
|
|
195
|
-
&
|
|
196
|
-
@apply tw-
|
|
147
|
+
&_touching {
|
|
148
|
+
@apply tw-transition-none;
|
|
197
149
|
}
|
|
198
150
|
}
|
|
199
151
|
|
|
152
|
+
&__status {
|
|
153
|
+
@apply tw-flex tw-w-full tw-h-full tw-justify-center tw-items-center tw-pb-[10px];
|
|
154
|
+
}
|
|
155
|
+
|
|
200
156
|
&__overscroll-icon {
|
|
201
157
|
@apply tw-text-[color:#a1c0d4];
|
|
202
|
-
|
|
203
|
-
&_pulling {
|
|
204
|
-
@apply tw-text-[color:#a1c0d4];
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
&_refresh {
|
|
208
|
-
animation: tw-spin 2s linear infinite;
|
|
209
|
-
}
|
|
210
158
|
}
|
|
211
159
|
|
|
212
160
|
&__overscroll span {
|
|
213
|
-
@apply tw-
|
|
161
|
+
@apply tw-ml-2 tw-text-sm tw-text-gray-500;
|
|
214
162
|
}
|
|
215
163
|
|
|
216
164
|
&__inner {
|
|
217
165
|
@apply tw-relative tw-overflow-y-auto tw-overflow-x-hidden
|
|
218
166
|
tw-flex-1 tw-p-[var(--container-scroll-padding)]
|
|
219
|
-
|
|
167
|
+
[transition:top_0.3s_ease-out] [scrollbar-color:var(--container-scroll-color)] [scrollbar-width:thin];
|
|
220
168
|
|
|
221
169
|
&::-webkit-scrollbar {
|
|
222
170
|
@apply tw-w-[var(--container-scroll-width)] tw-bg-transparent;
|
|
@@ -232,19 +180,14 @@ defineExpose({
|
|
|
232
180
|
tw-overflow-x-hidden
|
|
233
181
|
hover:tw-bg-[color:var(--container-scroll-color-hover)];
|
|
234
182
|
}
|
|
183
|
+
|
|
184
|
+
&_touching {
|
|
185
|
+
transition: none;
|
|
186
|
+
}
|
|
235
187
|
}
|
|
236
188
|
|
|
237
189
|
&_nopadding &__inner {
|
|
238
190
|
@apply tw-p-0;
|
|
239
191
|
}
|
|
240
192
|
}
|
|
241
|
-
|
|
242
|
-
@keyframes tw-spin {
|
|
243
|
-
from {
|
|
244
|
-
transform: rotate(0deg);
|
|
245
|
-
}
|
|
246
|
-
to {
|
|
247
|
-
transform: rotate(360deg);
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
193
|
</style>
|
|
@@ -36,7 +36,7 @@ export default {
|
|
|
36
36
|
},
|
|
37
37
|
},
|
|
38
38
|
aspectRatio: {
|
|
39
|
-
control: "
|
|
39
|
+
control: "object",
|
|
40
40
|
table: {
|
|
41
41
|
type: {
|
|
42
42
|
summary: "number[]",
|
|
@@ -44,7 +44,7 @@ export default {
|
|
|
44
44
|
},
|
|
45
45
|
},
|
|
46
46
|
},
|
|
47
|
-
}
|
|
47
|
+
} satisfies Meta;
|
|
48
48
|
|
|
49
49
|
const Template: StoryFn = (args) => ({
|
|
50
50
|
components: { VcField },
|
|
@@ -164,11 +164,11 @@
|
|
|
164
164
|
<!-- Select chevron-->
|
|
165
165
|
<div
|
|
166
166
|
v-if="!disabled"
|
|
167
|
-
class="tw-flex tw-items-center tw-flex-nowrap tw-pl-3"
|
|
167
|
+
class="tw-flex tw-items-center tw-flex-nowrap tw-pl-3 tw-cursor-pointer"
|
|
168
|
+
@click.stop="toggleDropdown"
|
|
168
169
|
>
|
|
169
170
|
<div
|
|
170
|
-
class="vc-select__chevron tw-
|
|
171
|
-
@click.stop="toggleDropdown"
|
|
171
|
+
class="vc-select__chevron tw-flex-nowrap tw-text-[color:var(--select-chevron-color)] hover:tw-text-[color:var(--select-chevron-color-hover)]"
|
|
172
172
|
>
|
|
173
173
|
<VcIcon
|
|
174
174
|
size="s"
|
|
@@ -173,7 +173,7 @@ const onMenuItemClick = function (item: MenuItem) {
|
|
|
173
173
|
if (typeof menuRoute === "undefined") {
|
|
174
174
|
openRoot();
|
|
175
175
|
} else {
|
|
176
|
-
router.
|
|
176
|
+
router.push({ name: menuRoute?.name, params: route.params });
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
};
|
|
@@ -185,7 +185,7 @@ const openRoot = async () => {
|
|
|
185
185
|
const mainRoute = routes.find((route) => route.meta?.root);
|
|
186
186
|
const mainRouteAlias = routes.find((route) => route.aliasOf?.path === mainRoute?.path) ?? mainRoute;
|
|
187
187
|
|
|
188
|
-
router.
|
|
188
|
+
router.push({ name: mainRouteAlias?.name, params: route.params });
|
|
189
189
|
}
|
|
190
190
|
};
|
|
191
191
|
|
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
o
|
|
2
2
|
<template>
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
>
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
</td>
|
|
22
|
-
</tr>
|
|
3
|
+
<div v-if="editing && addNewRowButton">
|
|
4
|
+
<div class="tw-p-3">
|
|
5
|
+
<VcButton
|
|
6
|
+
v-if="addNewRowButton.show"
|
|
7
|
+
text
|
|
8
|
+
@click="$emit('onAddNewRow')"
|
|
9
|
+
>
|
|
10
|
+
<div class="tw-flex tw-flex-row tw-gap-2 tw-items-center">
|
|
11
|
+
<VcIcon
|
|
12
|
+
icon="fas fa-plus"
|
|
13
|
+
size="m"
|
|
14
|
+
class="tw-text-[#41afe6]"
|
|
15
|
+
/>
|
|
16
|
+
{{ unref(addNewRowButton.title) }}
|
|
17
|
+
</div>
|
|
18
|
+
</VcButton>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
23
21
|
</template>
|
|
24
22
|
|
|
25
23
|
<script lang="ts" setup>
|
|
@@ -2,8 +2,16 @@
|
|
|
2
2
|
<div>
|
|
3
3
|
<!-- Money cell -->
|
|
4
4
|
<template v-if="cell.type === 'money'">
|
|
5
|
+
<template v-if="!isEditable && (typeof value === 'undefined' || Number(value) === 0)">
|
|
6
|
+
<div
|
|
7
|
+
class="tw-truncate"
|
|
8
|
+
:class="cell.class"
|
|
9
|
+
>
|
|
10
|
+
{{ $t("COMPONENTS.ORGANISMS.VC_TABLE.NOT_SET") }}
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
5
13
|
<div
|
|
6
|
-
v-if="typeof Number(value) === 'number'"
|
|
14
|
+
v-else-if="typeof Number(value) === 'number'"
|
|
7
15
|
class="tw-truncate"
|
|
8
16
|
:class="cell.class"
|
|
9
17
|
>
|
|
@@ -22,11 +30,12 @@
|
|
|
22
30
|
currency-display="symbol"
|
|
23
31
|
class="tw-w-full"
|
|
24
32
|
:error="errors.length > 0"
|
|
33
|
+
:error-message="$isMobile.value ? errorMessage : undefined"
|
|
25
34
|
@update:model-value="$emit('update', { field: cell.id, value: $event })"
|
|
26
35
|
@blur="onBlur({ row: index, field: cell.id, errors })"
|
|
27
36
|
>
|
|
28
37
|
<template
|
|
29
|
-
v-if="errors.length > 0"
|
|
38
|
+
v-if="$isDesktop.value && errors.length > 0"
|
|
30
39
|
#append-inner
|
|
31
40
|
>
|
|
32
41
|
<VcTooltip placement="bottom-end">
|
|
@@ -43,14 +52,6 @@
|
|
|
43
52
|
<span class="tw-truncate">{{ intlMoney(Number(value)) }}</span>
|
|
44
53
|
</template>
|
|
45
54
|
</div>
|
|
46
|
-
<template v-else-if="!isEditable">
|
|
47
|
-
<div
|
|
48
|
-
class="tw-truncate"
|
|
49
|
-
:class="cell.class"
|
|
50
|
-
>
|
|
51
|
-
N/A
|
|
52
|
-
</div>
|
|
53
|
-
</template>
|
|
54
55
|
</template>
|
|
55
56
|
|
|
56
57
|
<!-- Date ago cell -->
|
|
@@ -70,7 +71,7 @@
|
|
|
70
71
|
v-else
|
|
71
72
|
class="tw-truncate"
|
|
72
73
|
>
|
|
73
|
-
|
|
74
|
+
{{ $t("COMPONENTS.ORGANISMS.VC_TABLE.NOT_SET") }}
|
|
74
75
|
</div>
|
|
75
76
|
</span>
|
|
76
77
|
|
|
@@ -112,7 +113,7 @@
|
|
|
112
113
|
v-else
|
|
113
114
|
class="tw-truncate"
|
|
114
115
|
>
|
|
115
|
-
|
|
116
|
+
{{ $t("COMPONENTS.ORGANISMS.VC_TABLE.NOT_SET") }}
|
|
116
117
|
</div>
|
|
117
118
|
</div>
|
|
118
119
|
|
|
@@ -144,7 +145,7 @@
|
|
|
144
145
|
<!-- Number cell -->
|
|
145
146
|
<div
|
|
146
147
|
v-else-if="cell.type === 'number'"
|
|
147
|
-
class="tw-
|
|
148
|
+
class="tw-truncate"
|
|
148
149
|
:class="cell.class"
|
|
149
150
|
>
|
|
150
151
|
<template v-if="isEditable">
|
|
@@ -160,11 +161,12 @@
|
|
|
160
161
|
class="tw-w-full"
|
|
161
162
|
type="number"
|
|
162
163
|
:error="errors.length > 0"
|
|
164
|
+
:error-message="$isMobile.value ? errorMessage : undefined"
|
|
163
165
|
@update:model-value="$emit('update', { field: cell.id, value: $event })"
|
|
164
166
|
@blur="onBlur({ row: index, field: cell.id, errors })"
|
|
165
167
|
>
|
|
166
168
|
<template
|
|
167
|
-
v-if="errors.length > 0"
|
|
169
|
+
v-if="$isDesktop.value && errors.length > 0"
|
|
168
170
|
#append-inner
|
|
169
171
|
>
|
|
170
172
|
<VcTooltip placement="bottom-end">
|
|
@@ -178,7 +180,11 @@
|
|
|
178
180
|
</Field>
|
|
179
181
|
</template>
|
|
180
182
|
<template v-else>
|
|
181
|
-
{{
|
|
183
|
+
{{
|
|
184
|
+
typeof Number(value) === "number" && Number(value) >= 0
|
|
185
|
+
? Number(value).toFixed(0)
|
|
186
|
+
: $t("COMPONENTS.ORGANISMS.VC_TABLE.NOT_SET")
|
|
187
|
+
}}
|
|
182
188
|
</template>
|
|
183
189
|
</div>
|
|
184
190
|
|
|
@@ -218,11 +224,12 @@
|
|
|
218
224
|
:model-value="value"
|
|
219
225
|
class="tw-w-full"
|
|
220
226
|
:error="errors.length > 0"
|
|
227
|
+
:error-message="$isMobile.value ? errorMessage : undefined"
|
|
221
228
|
@update:model-value="$emit('update', { field: cell.id, value: $event })"
|
|
222
229
|
@blur="onBlur({ row: index, field: cell.id, errors })"
|
|
223
230
|
>
|
|
224
231
|
<template
|
|
225
|
-
v-if="errors.length > 0"
|
|
232
|
+
v-if="$isDesktop.value && errors.length > 0"
|
|
226
233
|
#append-inner
|
|
227
234
|
>
|
|
228
235
|
<VcTooltip placement="bottom-end">
|
|
@@ -31,7 +31,13 @@
|
|
|
31
31
|
size="s"
|
|
32
32
|
class="tw-w-4"
|
|
33
33
|
/>
|
|
34
|
-
<p class="tw-ml-2">
|
|
34
|
+
<p class="tw-ml-2">
|
|
35
|
+
{{
|
|
36
|
+
$te(`COMPONENTS.ORGANISMS.VC_TABLE.${stateKey}.${item.id}`)
|
|
37
|
+
? $t(`COMPONENTS.ORGANISMS.VC_TABLE.${stateKey}.${item.id}`)
|
|
38
|
+
: item.title
|
|
39
|
+
}}
|
|
40
|
+
</p>
|
|
35
41
|
</div>
|
|
36
42
|
</div>
|
|
37
43
|
</VcContainer>
|
|
@@ -48,6 +54,7 @@ import { useFloating, flip, shift, autoUpdate } from "@floating-ui/vue";
|
|
|
48
54
|
|
|
49
55
|
export interface Props {
|
|
50
56
|
items: ITableColumns[];
|
|
57
|
+
stateKey: string;
|
|
51
58
|
}
|
|
52
59
|
|
|
53
60
|
export interface Emits {
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- Empty table view -->
|
|
3
|
+
<template v-if="!(items && items.length && !columnsInit)">
|
|
4
|
+
<slot
|
|
5
|
+
v-if="searchValue || searchValue === '' || activeFilterCount"
|
|
6
|
+
name="notfound"
|
|
7
|
+
>
|
|
8
|
+
<div class="tw-w-full tw-h-full tw-box-border tw-flex tw-flex-col tw-items-center tw-justify-center">
|
|
9
|
+
<img
|
|
10
|
+
v-if="notfound?.image"
|
|
11
|
+
:src="notfound.image"
|
|
12
|
+
/>
|
|
13
|
+
<div class="tw-m-4 vc-table__empty-text">
|
|
14
|
+
{{ notfound?.text || $t("COMPONENTS.ORGANISMS.VC_TABLE.NOT_FOUND") }}
|
|
15
|
+
</div>
|
|
16
|
+
<VcButton
|
|
17
|
+
v-if="notfound?.action"
|
|
18
|
+
@click="notfound?.clickHandler"
|
|
19
|
+
>
|
|
20
|
+
{{ notfound.action }}
|
|
21
|
+
</VcButton>
|
|
22
|
+
</div>
|
|
23
|
+
</slot>
|
|
24
|
+
<slot
|
|
25
|
+
v-else
|
|
26
|
+
name="empty"
|
|
27
|
+
>
|
|
28
|
+
<div class="tw-w-full tw-h-full tw-box-border tw-flex tw-flex-col tw-items-center tw-justify-center">
|
|
29
|
+
<img
|
|
30
|
+
v-if="empty?.image"
|
|
31
|
+
:src="empty.image"
|
|
32
|
+
/>
|
|
33
|
+
<div class="tw-m-4 tw-text-xl tw-font-medium">
|
|
34
|
+
{{ empty?.text || $t("COMPONENTS.ORGANISMS.VC_TABLE.EMPTY") }}
|
|
35
|
+
</div>
|
|
36
|
+
<VcButton
|
|
37
|
+
v-if="empty?.action"
|
|
38
|
+
@click="empty?.clickHandler"
|
|
39
|
+
>
|
|
40
|
+
{{ empty.action }}
|
|
41
|
+
</VcButton>
|
|
42
|
+
</div>
|
|
43
|
+
</slot>
|
|
44
|
+
</template>
|
|
45
|
+
</template>
|
|
46
|
+
<!-- eslint-disable @typescript-eslint/no-explicit-any -->
|
|
47
|
+
<script lang="ts" setup>
|
|
48
|
+
import { Ref } from "vue";
|
|
49
|
+
|
|
50
|
+
export interface Props {
|
|
51
|
+
items: any[];
|
|
52
|
+
columnsInit: boolean;
|
|
53
|
+
searchValue?: string;
|
|
54
|
+
activeFilterCount: number;
|
|
55
|
+
notfound?: {
|
|
56
|
+
image?: string;
|
|
57
|
+
text: string | Ref<string>;
|
|
58
|
+
action?: string;
|
|
59
|
+
clickHandler?: () => void;
|
|
60
|
+
};
|
|
61
|
+
empty?: {
|
|
62
|
+
image?: string;
|
|
63
|
+
text: string | Ref<string>;
|
|
64
|
+
action?: string;
|
|
65
|
+
clickHandler?: () => void;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
defineProps<Props>();
|
|
70
|
+
defineSlots<{
|
|
71
|
+
notfound: void;
|
|
72
|
+
empty: void;
|
|
73
|
+
}>();
|
|
74
|
+
</script>
|
|
75
|
+
|
|
76
|
+
<style lang="scss" scoped></style>
|
package/ui/components/organisms/vc-table/_internal/vc-table-mobile-item/vc-table-mobile-item.vue
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
<div
|
|
29
29
|
class="tw-flex tw-grow tw-basis-[1] tw-flex-col tw-justify-center tw-items-center tw-text-white"
|
|
30
30
|
:class="[`vc-table-mobile__item-action_${leftSwipeActions[0].type}`]"
|
|
31
|
-
@click.stop="leftSwipeActions[0].clickHandler(item as T)"
|
|
31
|
+
@click.stop="leftSwipeActions?.[0].clickHandler(item as T)"
|
|
32
32
|
>
|
|
33
33
|
<VcIcon :icon="leftSwipeActions[0].icon" />
|
|
34
34
|
<div class="tw-mt-1 tw-text-lg tw-text-center">
|
|
@@ -191,15 +191,17 @@ const { isSwiping, lengthX } = useSwipe(target, {
|
|
|
191
191
|
|
|
192
192
|
const rightSwipeActions = computed(
|
|
193
193
|
() =>
|
|
194
|
-
itemActions.value &&
|
|
195
|
-
|
|
196
|
-
|
|
194
|
+
(itemActions.value &&
|
|
195
|
+
itemActions.value.length &&
|
|
196
|
+
itemActions.value.filter((actions: IActionBuilderResult) => actions.position === "right")) ||
|
|
197
|
+
undefined,
|
|
197
198
|
);
|
|
198
199
|
const leftSwipeActions = computed(
|
|
199
200
|
() =>
|
|
200
|
-
itemActions.value &&
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
(itemActions.value &&
|
|
202
|
+
itemActions.value.length &&
|
|
203
|
+
itemActions.value.filter((actions: IActionBuilderResult) => actions.position === "left")) ||
|
|
204
|
+
undefined,
|
|
203
205
|
);
|
|
204
206
|
|
|
205
207
|
watch(
|