@vc-shell/framework 1.0.38 → 1.0.40
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/core/api/index.ts +1 -0
- package/core/api/platform.ts +8332 -0
- package/core/composables/index.ts +8 -0
- package/core/composables/useAutosave/index.ts +57 -0
- package/core/composables/useFunctions/debounce.ts +18 -0
- package/core/composables/useFunctions/delay.ts +7 -0
- package/core/composables/useFunctions/index.ts +21 -0
- package/core/composables/useFunctions/once.ts +14 -0
- package/core/composables/useFunctions/sleep.ts +4 -0
- package/core/composables/useFunctions/throttle.ts +17 -0
- package/core/composables/useI18n/index.ts +28 -0
- package/core/composables/useLogger/index.ts +24 -0
- package/core/composables/useNotifications/index.ts +116 -0
- package/core/composables/usePermissions/index.ts +32 -0
- package/core/composables/useSettings/index.ts +62 -0
- package/core/composables/useUser/index.ts +266 -0
- package/core/directives/autofocus/index.ts +9 -0
- package/core/directives/click-outside/index.ts +21 -0
- package/core/directives/index.ts +4 -0
- package/core/directives/loading/index.ts +28 -0
- package/core/directives/permissions/index.ts +20 -0
- package/core/plugins/index.ts +1 -0
- package/core/plugins/validation/index.ts +2 -0
- package/core/plugins/validation/rules.ts +196 -0
- package/core/types/index.ts +92 -0
- package/core/utilities/camelToSnake.ts +7 -0
- package/core/utilities/index.ts +1 -0
- package/dist/core/composables/useNotifications/index.d.ts +1 -1
- package/dist/core/composables/useNotifications/index.d.ts.map +1 -1
- package/dist/core/composables/useSettings/index.d.ts +10 -1
- package/dist/core/composables/useSettings/index.d.ts.map +1 -1
- package/dist/core/composables/useUser/index.d.ts +2 -2
- package/dist/core/composables/useUser/index.d.ts.map +1 -1
- package/dist/core/plugins/validation/index.d.ts.map +1 -1
- package/dist/core/types/index.d.ts +1 -1
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/framework.js +72 -99
- package/dist/framework.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/shared/app-switcher/composables/useAppSwitcher/index.d.ts +1 -1
- package/dist/shared/app-switcher/composables/useAppSwitcher/index.d.ts.map +1 -1
- package/dist/shared/app-switcher/index.d.ts +2 -2
- package/dist/shared/app-switcher/index.d.ts.map +1 -1
- package/dist/shared/blade-navigation/composables/useBladeNavigation/index.d.ts +1 -1
- package/dist/shared/blade-navigation/composables/useBladeNavigation/index.d.ts.map +1 -1
- package/dist/shared/blade-navigation/types/index.d.ts +1 -1
- package/dist/shared/blade-navigation/types/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/ui/components/atoms/vc-badge/index.d.ts +5 -0
- package/dist/ui/components/atoms/vc-badge/index.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-badge/vc-badge-model.d.ts +28 -0
- package/dist/ui/components/atoms/vc-badge/vc-badge-model.d.ts.map +1 -0
- package/dist/{components → ui/components}/atoms/vc-badge/vc-badge.stories.d.ts +0 -0
- package/dist/ui/components/atoms/vc-badge/vc-badge.stories.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-button/index.d.ts +5 -0
- package/dist/ui/components/atoms/vc-button/index.d.ts.map +1 -0
- package/dist/ui/components/atoms/vc-button/vc-button-model.d.ts +28 -0
- package/dist/ui/components/atoms/vc-button/vc-button-model.d.ts.map +1 -0
- package/dist/{components → ui/components}/atoms/vc-button/vc-button.stories.d.ts +0 -0
- package/dist/ui/components/atoms/vc-button/vc-button.stories.d.ts.map +1 -0
- package/dist/{components → ui/components}/atoms/vc-checkbox/vc-checkbox.stories.d.ts +0 -0
- package/dist/ui/components/atoms/vc-checkbox/vc-checkbox.stories.d.ts.map +1 -0
- package/dist/{components → ui/components}/atoms/vc-container/vc-container.stories.d.ts +0 -0
- package/dist/ui/components/atoms/vc-container/vc-container.stories.d.ts.map +1 -0
- package/dist/{components → ui/components}/atoms/vc-hint/vc-hint.stories.d.ts +0 -0
- package/dist/ui/components/atoms/vc-hint/vc-hint.stories.d.ts.map +1 -0
- package/dist/{components → ui/components}/atoms/vc-icon/vc-icon.stories.d.ts +0 -0
- package/dist/ui/components/atoms/vc-icon/vc-icon.stories.d.ts.map +1 -0
- package/dist/{components → ui/components}/atoms/vc-image/vc-image.stories.d.ts +0 -0
- package/dist/ui/components/atoms/vc-image/vc-image.stories.d.ts.map +1 -0
- package/dist/{components → ui/components}/atoms/vc-label/vc-label.stories.d.ts +0 -0
- package/dist/ui/components/atoms/vc-label/vc-label.stories.d.ts.map +1 -0
- package/dist/{components → ui/components}/atoms/vc-link/vc-link.stories.d.ts +0 -0
- package/dist/ui/components/atoms/vc-link/vc-link.stories.d.ts.map +1 -0
- package/dist/{components → ui/components}/atoms/vc-progress/vc-progress.stories.d.ts +0 -0
- package/dist/ui/components/atoms/vc-progress/vc-progress.stories.d.ts.map +1 -0
- package/dist/{components → ui/components}/atoms/vc-status/vc-status.stories.d.ts +0 -0
- package/dist/ui/components/atoms/vc-status/vc-status.stories.d.ts.map +1 -0
- package/dist/{components → ui/components}/atoms/vc-switch/vc-switch.stories.d.ts +0 -0
- package/dist/ui/components/atoms/vc-switch/vc-switch.stories.d.ts.map +1 -0
- package/dist/{components → ui/components}/index.d.ts +4 -3
- package/dist/ui/components/index.d.ts.map +1 -0
- package/dist/{components → ui/components}/molecules/vc-breadcrumbs/vc-breadcrumbs.stories.d.ts +0 -0
- package/dist/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.stories.d.ts.map +1 -0
- package/dist/{components → ui/components}/molecules/vc-form/vc-form.stories.d.ts +0 -0
- package/dist/ui/components/molecules/vc-form/vc-form.stories.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-input/index.d.ts +5 -0
- package/dist/ui/components/molecules/vc-input/index.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-input/vc-input-model.d.ts +140 -0
- package/dist/ui/components/molecules/vc-input/vc-input-model.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-input-currency/index.d.ts +5 -0
- package/dist/ui/components/molecules/vc-input-currency/index.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency-model.d.ts +124 -0
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency-model.d.ts.map +1 -0
- package/dist/{components → ui/components}/molecules/vc-pagination/vc-pagination.stories.d.ts +0 -0
- package/dist/ui/components/molecules/vc-pagination/vc-pagination.stories.d.ts.map +1 -0
- package/dist/{components → ui/components}/molecules/vc-rating/vc-rating.stories.d.ts +0 -0
- package/dist/ui/components/molecules/vc-rating/vc-rating.stories.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-select/index.d.ts +5 -0
- package/dist/ui/components/molecules/vc-select/index.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-select/vc-select-model.d.ts +207 -0
- package/dist/ui/components/molecules/vc-select/vc-select-model.d.ts.map +1 -0
- package/dist/{components → ui/components}/molecules/vc-textarea/vc-textarea.stories.d.ts +0 -0
- package/dist/ui/components/molecules/vc-textarea/vc-textarea.stories.d.ts.map +1 -0
- package/dist/{components → ui/components}/organisms/vc-app/vc-app.stories.d.ts +0 -0
- package/dist/ui/components/organisms/vc-app/vc-app.stories.d.ts.map +1 -0
- package/dist/{components → ui/components}/organisms/vc-blade/vc-blade.stories.d.ts +0 -0
- package/dist/ui/components/organisms/vc-blade/vc-blade.stories.d.ts.map +1 -0
- package/dist/{components → ui/components}/organisms/vc-login-form/vc-login-form.stories.d.ts +0 -0
- package/dist/ui/components/organisms/vc-login-form/vc-login-form.stories.d.ts.map +1 -0
- package/dist/{components → ui/components}/organisms/vc-popup/vc-popup.stories.d.ts +0 -0
- package/dist/ui/components/organisms/vc-popup/vc-popup.stories.d.ts.map +1 -0
- package/dist/{components → ui/components}/organisms/vc-table/vc-table.stories.d.ts +0 -0
- package/dist/ui/components/organisms/vc-table/vc-table.stories.d.ts.map +1 -0
- package/dist/ui/types/index.d.ts +13 -0
- package/dist/ui/types/index.d.ts.map +1 -0
- package/dist/ui/types/ts-helpers.d.ts +13 -0
- package/dist/ui/types/ts-helpers.d.ts.map +1 -0
- package/dist/vite.config.d.ts.map +1 -1
- package/package.json +30 -10
- package/shared/app-switcher/components/index.ts +1 -0
- package/shared/app-switcher/components/vc-app-switcher/vc-app-switcher.vue +90 -0
- package/shared/app-switcher/composables/index.ts +1 -0
- package/shared/app-switcher/composables/useAppSwitcher/index.ts +54 -0
- package/shared/app-switcher/index.ts +14 -0
- package/shared/assets/components/assets-details/assets-details.vue +138 -0
- package/shared/assets/components/index.ts +1 -0
- package/shared/assets/index.ts +19 -0
- package/shared/assets/locales/en.json +29 -0
- package/shared/assets/locales/index.ts +2 -0
- package/shared/blade-navigation/components/index.ts +1 -0
- package/shared/blade-navigation/components/vc-blade-navigation/vc-blade-navigation.vue +84 -0
- package/shared/blade-navigation/composables/index.ts +1 -0
- package/shared/blade-navigation/composables/useBladeNavigation/index.ts +216 -0
- package/shared/blade-navigation/index.ts +15 -0
- package/shared/blade-navigation/types/index.ts +52 -0
- package/shared/index.ts +16 -0
- package/tailwind.config.js +4 -3
- package/ui/components/atoms/vc-badge/index.ts +7 -0
- package/ui/components/atoms/vc-badge/vc-badge-model.ts +30 -0
- package/ui/components/atoms/vc-badge/vc-badge.stories.ts +27 -0
- package/ui/components/atoms/vc-badge/vc-badge.vue +57 -0
- package/ui/components/atoms/vc-button/index.ts +7 -0
- package/ui/components/atoms/vc-button/vc-button-model.ts +30 -0
- package/ui/components/atoms/vc-button/vc-button.stories.ts +34 -0
- package/ui/components/atoms/vc-button/vc-button.vue +219 -0
- package/ui/components/atoms/vc-card/vc-card.vue +137 -0
- package/ui/components/atoms/vc-checkbox/vc-checkbox.stories.ts +25 -0
- package/ui/components/atoms/vc-checkbox/vc-checkbox.vue +130 -0
- package/ui/components/atoms/vc-col/vc-col.vue +22 -0
- package/ui/components/atoms/vc-container/vc-container.stories.ts +31 -0
- package/ui/components/atoms/vc-container/vc-container.vue +222 -0
- package/ui/components/atoms/vc-hint/vc-hint.stories.ts +23 -0
- package/ui/components/atoms/vc-hint/vc-hint.vue +11 -0
- package/ui/components/atoms/vc-icon/vc-icon.stories.ts +32 -0
- package/ui/components/atoms/vc-icon/vc-icon.vue +36 -0
- package/ui/components/atoms/vc-image/vc-image.stories.ts +40 -0
- package/ui/components/atoms/vc-image/vc-image.vue +122 -0
- package/ui/components/atoms/vc-info-row/vc-info-row.vue +42 -0
- package/ui/components/atoms/vc-label/vc-label.stories.ts +23 -0
- package/ui/components/atoms/vc-label/vc-label.vue +49 -0
- package/ui/components/atoms/vc-link/vc-link.stories.ts +30 -0
- package/ui/components/atoms/vc-link/vc-link.vue +46 -0
- package/ui/components/atoms/vc-loading/vc-loading.vue +33 -0
- package/ui/components/atoms/vc-progress/vc-progress.stories.ts +25 -0
- package/ui/components/atoms/vc-progress/vc-progress.vue +65 -0
- package/ui/components/atoms/vc-row/vc-row.vue +13 -0
- package/ui/components/atoms/vc-status/vc-status.stories.ts +26 -0
- package/ui/components/atoms/vc-status/vc-status.vue +78 -0
- package/ui/components/atoms/vc-status-icon/vc-status-icon.vue +21 -0
- package/ui/components/atoms/vc-switch/vc-switch.stories.ts +27 -0
- package/ui/components/atoms/vc-switch/vc-switch.vue +100 -0
- package/ui/components/atoms/vc-widget/vc-widget.vue +85 -0
- package/ui/components/index.ts +44 -0
- package/ui/components/molecules/vc-breadcrumbs/_internal/vc-breadcrumbs-item/vc-breadcrumbs-item.vue +103 -0
- package/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.stories.ts +39 -0
- package/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue +21 -0
- package/ui/components/molecules/vc-currency-input/vc-input.vue +436 -0
- package/ui/components/molecules/vc-editor/vc-editor.vue +117 -0
- package/ui/components/molecules/vc-file-upload/vc-file-upload.vue +134 -0
- package/ui/components/molecules/vc-form/vc-form.stories.ts +23 -0
- package/ui/components/molecules/vc-form/vc-form.vue +5 -0
- package/ui/components/molecules/vc-input/index.ts +8 -0
- package/ui/components/molecules/vc-input/vc-input-model.ts +150 -0
- package/ui/components/molecules/vc-input/vc-input.vue +324 -0
- package/ui/components/molecules/vc-input-currency/index.ts +8 -0
- package/ui/components/molecules/vc-input-currency/vc-input-currency-model.ts +128 -0
- package/ui/components/molecules/vc-input-currency/vc-input-currency.vue +86 -0
- package/ui/components/molecules/vc-multivalue/vc-multivalue.vue +447 -0
- package/ui/components/molecules/vc-notification/vc-notification.vue +101 -0
- package/ui/components/molecules/vc-pagination/vc-pagination.stories.ts +23 -0
- package/ui/components/molecules/vc-pagination/vc-pagination.vue +169 -0
- package/ui/components/molecules/vc-rating/vc-rating.stories.ts +23 -0
- package/ui/components/molecules/vc-rating/vc-rating.vue +77 -0
- package/ui/components/molecules/vc-select/index.ts +7 -0
- package/ui/components/molecules/vc-select/vc-select-model.ts +216 -0
- package/ui/components/molecules/vc-select/vc-select.vue +727 -0
- package/ui/components/molecules/vc-slider/vc-slider.vue +106 -0
- package/ui/components/molecules/vc-textarea/vc-textarea.stories.ts +23 -0
- package/ui/components/molecules/vc-textarea/vc-textarea.vue +155 -0
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +150 -0
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue +148 -0
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue +157 -0
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue +110 -0
- package/ui/components/organisms/vc-app/vc-app.stories.ts +75 -0
- package/ui/components/organisms/vc-app/vc-app.vue +169 -0
- package/ui/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue +126 -0
- package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue +223 -0
- package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/vc-blade-toolbar.vue +67 -0
- package/ui/components/organisms/vc-blade/vc-blade.stories.ts +46 -0
- package/ui/components/organisms/vc-blade/vc-blade.vue +87 -0
- package/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue +426 -0
- package/ui/components/organisms/vc-gallery/_internal/vc-gallery-item/vc-gallery-item.vue +123 -0
- package/ui/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue +93 -0
- package/ui/components/organisms/vc-gallery/vc-gallery.vue +186 -0
- package/ui/components/organisms/vc-login-form/vc-login-form.stories.ts +55 -0
- package/ui/components/organisms/vc-login-form/vc-login-form.vue +48 -0
- package/ui/components/organisms/vc-popup/vc-popup.stories.ts +23 -0
- package/ui/components/organisms/vc-popup/vc-popup.vue +97 -0
- package/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue +113 -0
- package/ui/components/organisms/vc-table/_internal/vc-table-counter/vc-table-counter.vue +29 -0
- package/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue +152 -0
- package/ui/components/organisms/vc-table/_internal/vc-table-mobile-item/vc-table-mobile-item.vue +272 -0
- package/ui/components/organisms/vc-table/vc-table.stories.ts +99 -0
- package/ui/components/organisms/vc-table/vc-table.vue +638 -0
- package/ui/types/index.ts +38 -0
- package/ui/types/ts-helpers.ts +46 -0
- package/dist/components/atoms/vc-badge/vc-badge.stories.d.ts.map +0 -1
- package/dist/components/atoms/vc-button/vc-button.stories.d.ts.map +0 -1
- package/dist/components/atoms/vc-checkbox/vc-checkbox.stories.d.ts.map +0 -1
- package/dist/components/atoms/vc-container/vc-container.stories.d.ts.map +0 -1
- package/dist/components/atoms/vc-hint/vc-hint.stories.d.ts.map +0 -1
- package/dist/components/atoms/vc-icon/vc-icon.stories.d.ts.map +0 -1
- package/dist/components/atoms/vc-image/vc-image.stories.d.ts.map +0 -1
- package/dist/components/atoms/vc-label/vc-label.stories.d.ts.map +0 -1
- package/dist/components/atoms/vc-link/vc-link.stories.d.ts.map +0 -1
- package/dist/components/atoms/vc-progress/vc-progress.stories.d.ts.map +0 -1
- package/dist/components/atoms/vc-status/vc-status.stories.d.ts.map +0 -1
- package/dist/components/atoms/vc-switch/vc-switch.stories.d.ts.map +0 -1
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/molecules/vc-breadcrumbs/vc-breadcrumbs.stories.d.ts.map +0 -1
- package/dist/components/molecules/vc-form/vc-form.stories.d.ts.map +0 -1
- package/dist/components/molecules/vc-input/vc-input.stories.d.ts +0 -7
- package/dist/components/molecules/vc-input/vc-input.stories.d.ts.map +0 -1
- package/dist/components/molecules/vc-pagination/vc-pagination.stories.d.ts.map +0 -1
- package/dist/components/molecules/vc-rating/vc-rating.stories.d.ts.map +0 -1
- package/dist/components/molecules/vc-select/vc-select.stories.d.ts +0 -7
- package/dist/components/molecules/vc-select/vc-select.stories.d.ts.map +0 -1
- package/dist/components/molecules/vc-textarea/vc-textarea.stories.d.ts.map +0 -1
- package/dist/components/organisms/vc-app/vc-app.stories.d.ts.map +0 -1
- package/dist/components/organisms/vc-blade/vc-blade.stories.d.ts.map +0 -1
- package/dist/components/organisms/vc-login-form/vc-login-form.stories.d.ts.map +0 -1
- package/dist/components/organisms/vc-popup/vc-popup.stories.d.ts.map +0 -1
- package/dist/components/organisms/vc-table/vc-table.stories.d.ts.map +0 -1
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Field
|
|
3
|
+
v-if="
|
|
4
|
+
(property.dictionary || property.isDictionary) && !property.multivalue
|
|
5
|
+
"
|
|
6
|
+
v-slot="{ field, errorMessage, handleChange, errors }"
|
|
7
|
+
:name="property.displayName || property.name"
|
|
8
|
+
:modelValue="getter(property, true)"
|
|
9
|
+
:rules="rules"
|
|
10
|
+
>
|
|
11
|
+
<VcSelect
|
|
12
|
+
v-bind="$attrs"
|
|
13
|
+
:error="!!errors.length"
|
|
14
|
+
:error-message="errorMessage"
|
|
15
|
+
:label="handleDisplayName || property.displayName"
|
|
16
|
+
:modelValue="getter(property, true)"
|
|
17
|
+
@update:modelValue="
|
|
18
|
+
(e) => {
|
|
19
|
+
handleChange(e);
|
|
20
|
+
setter(property, e, items);
|
|
21
|
+
}
|
|
22
|
+
"
|
|
23
|
+
:required="property.required || property.isRequired"
|
|
24
|
+
:placeholder="handleDisplayName || property.defaultValue"
|
|
25
|
+
:options="items"
|
|
26
|
+
option-value="id"
|
|
27
|
+
:option-label="handleDisplayProperty"
|
|
28
|
+
:disabled="disabled"
|
|
29
|
+
searchable
|
|
30
|
+
@search="onSearch"
|
|
31
|
+
@close="onClose"
|
|
32
|
+
></VcSelect>
|
|
33
|
+
</Field>
|
|
34
|
+
|
|
35
|
+
<Field
|
|
36
|
+
v-else-if="
|
|
37
|
+
property.valueType === 'ShortText' &&
|
|
38
|
+
property.multivalue &&
|
|
39
|
+
!(property.dictionary || property.isDictionary)
|
|
40
|
+
"
|
|
41
|
+
v-slot="{ field, errorMessage, handleChange }"
|
|
42
|
+
:name="property.name"
|
|
43
|
+
:modelValue="property.values"
|
|
44
|
+
:rules="rules"
|
|
45
|
+
>
|
|
46
|
+
<VcMultivalue
|
|
47
|
+
v-bind="$attrs"
|
|
48
|
+
:error-message="errorMessage"
|
|
49
|
+
:label="handleDisplayName"
|
|
50
|
+
:modelValue="property.values"
|
|
51
|
+
@update:modelValue="
|
|
52
|
+
(e) => {
|
|
53
|
+
handleChange(e);
|
|
54
|
+
setter(property, e);
|
|
55
|
+
}
|
|
56
|
+
"
|
|
57
|
+
:required="property.required || property.isRequired"
|
|
58
|
+
placeholder="Add value"
|
|
59
|
+
:disabled="disabled"
|
|
60
|
+
></VcMultivalue>
|
|
61
|
+
</Field>
|
|
62
|
+
|
|
63
|
+
<Field
|
|
64
|
+
v-else-if="
|
|
65
|
+
property.valueType === 'ShortText' &&
|
|
66
|
+
property.multivalue &&
|
|
67
|
+
(property.dictionary || property.isDictionary)
|
|
68
|
+
"
|
|
69
|
+
v-slot="{ field, errorMessage, handleChange }"
|
|
70
|
+
:name="property.name"
|
|
71
|
+
:modelValue="property.values"
|
|
72
|
+
:rules="rules"
|
|
73
|
+
>
|
|
74
|
+
<VcMultivalue
|
|
75
|
+
v-bind="$attrs"
|
|
76
|
+
:error-message="errorMessage"
|
|
77
|
+
:label="handleDisplayName"
|
|
78
|
+
:modelValue="property.values"
|
|
79
|
+
@update:modelValue="
|
|
80
|
+
(e) => {
|
|
81
|
+
handleChange(e);
|
|
82
|
+
setter(property, e, items);
|
|
83
|
+
}
|
|
84
|
+
"
|
|
85
|
+
:required="property.required || property.isRequired"
|
|
86
|
+
placeholder="Add value"
|
|
87
|
+
:multivalue="property.multivalue"
|
|
88
|
+
:disabled="disabled"
|
|
89
|
+
:options="items"
|
|
90
|
+
keyProperty="id"
|
|
91
|
+
displayProperty="alias"
|
|
92
|
+
@search="onSearch"
|
|
93
|
+
@close="onClose"
|
|
94
|
+
></VcMultivalue>
|
|
95
|
+
</Field>
|
|
96
|
+
|
|
97
|
+
<Field
|
|
98
|
+
v-else-if="property.valueType === 'ShortText'"
|
|
99
|
+
v-slot="{ field, errorMessage, handleChange, errors }"
|
|
100
|
+
:name="property.displayName || property.name"
|
|
101
|
+
:modelValue="getter(property)"
|
|
102
|
+
:rules="rules"
|
|
103
|
+
>
|
|
104
|
+
<VcInput
|
|
105
|
+
v-bind="$attrs"
|
|
106
|
+
:error="!!errors.length"
|
|
107
|
+
:error-message="errorMessage"
|
|
108
|
+
:label="handleDisplayName || property.displayName"
|
|
109
|
+
:modelValue="getter(property)"
|
|
110
|
+
@update:modelValue="
|
|
111
|
+
(e) => {
|
|
112
|
+
handleChange(e);
|
|
113
|
+
setter(property, e);
|
|
114
|
+
}
|
|
115
|
+
"
|
|
116
|
+
clearable
|
|
117
|
+
:required="property.required || property.isRequired"
|
|
118
|
+
:placeholder="handleDisplayName || 'Add value'"
|
|
119
|
+
:disabled="disabled"
|
|
120
|
+
></VcInput>
|
|
121
|
+
</Field>
|
|
122
|
+
|
|
123
|
+
<Field
|
|
124
|
+
v-else-if="property.valueType === 'Number' && property.multivalue"
|
|
125
|
+
v-slot="{ field, errorMessage, handleChange }"
|
|
126
|
+
:name="property.name"
|
|
127
|
+
:modelValue="property.values"
|
|
128
|
+
:rules="rules"
|
|
129
|
+
>
|
|
130
|
+
<VcMultivalue
|
|
131
|
+
v-bind="$attrs"
|
|
132
|
+
:error-message="errorMessage"
|
|
133
|
+
:label="handleDisplayName"
|
|
134
|
+
:modelValue="property.values"
|
|
135
|
+
@update:modelValue="
|
|
136
|
+
(e) => {
|
|
137
|
+
handleChange(e);
|
|
138
|
+
setter(property, e);
|
|
139
|
+
}
|
|
140
|
+
"
|
|
141
|
+
type="number"
|
|
142
|
+
:required="property.required || property.isRequired"
|
|
143
|
+
placeholder="Add value"
|
|
144
|
+
:disabled="disabled"
|
|
145
|
+
></VcMultivalue>
|
|
146
|
+
</Field>
|
|
147
|
+
|
|
148
|
+
<Field
|
|
149
|
+
v-else-if="property.valueType === 'Number'"
|
|
150
|
+
v-slot="{ field, errorMessage, handleChange, errors }"
|
|
151
|
+
:name="property.name"
|
|
152
|
+
:modelValue="getter(property)"
|
|
153
|
+
:rules="rules"
|
|
154
|
+
>
|
|
155
|
+
<VcInput
|
|
156
|
+
v-bind="$attrs"
|
|
157
|
+
:error="!!errors.length"
|
|
158
|
+
:error-message="errorMessage"
|
|
159
|
+
:label="handleDisplayName"
|
|
160
|
+
:modelValue="getter(property)"
|
|
161
|
+
@update:modelValue="
|
|
162
|
+
(e) => {
|
|
163
|
+
handleChange(e);
|
|
164
|
+
setter(property, e);
|
|
165
|
+
}
|
|
166
|
+
"
|
|
167
|
+
clearable
|
|
168
|
+
type="number"
|
|
169
|
+
:required="property.required || property.isRequired"
|
|
170
|
+
:placeholder="handleDisplayName || property.defaultValue"
|
|
171
|
+
:disabled="disabled"
|
|
172
|
+
></VcInput>
|
|
173
|
+
</Field>
|
|
174
|
+
|
|
175
|
+
<Field
|
|
176
|
+
v-else-if="property.valueType === 'Integer'"
|
|
177
|
+
v-slot="{ field, errorMessage, handleChange, errors }"
|
|
178
|
+
:name="property.name"
|
|
179
|
+
:modelValue="getter(property)"
|
|
180
|
+
:rules="rules"
|
|
181
|
+
>
|
|
182
|
+
<VcInput
|
|
183
|
+
v-bind="$attrs"
|
|
184
|
+
:error="!!errors.length"
|
|
185
|
+
:error-message="errorMessage"
|
|
186
|
+
:label="handleDisplayName"
|
|
187
|
+
:modelValue="getter(property)"
|
|
188
|
+
@update:modelValue="
|
|
189
|
+
(e) => {
|
|
190
|
+
handleChange(e);
|
|
191
|
+
setter(property, e);
|
|
192
|
+
}
|
|
193
|
+
"
|
|
194
|
+
clearable
|
|
195
|
+
type="number"
|
|
196
|
+
step="1"
|
|
197
|
+
:required="property.required || property.isRequired"
|
|
198
|
+
:placeholder="handleDisplayName || property.defaultValue"
|
|
199
|
+
:disabled="disabled"
|
|
200
|
+
></VcInput>
|
|
201
|
+
</Field>
|
|
202
|
+
|
|
203
|
+
<Field
|
|
204
|
+
v-else-if="property.valueType === 'DateTime'"
|
|
205
|
+
v-slot="{ field, errorMessage, handleChange, errors }"
|
|
206
|
+
:name="property.name"
|
|
207
|
+
:modelValue="getter(property)"
|
|
208
|
+
:rules="rules"
|
|
209
|
+
>
|
|
210
|
+
<VcInput
|
|
211
|
+
v-bind="$attrs"
|
|
212
|
+
:error="!!errors.length"
|
|
213
|
+
:error-message="errorMessage"
|
|
214
|
+
:label="handleDisplayName"
|
|
215
|
+
:modelValue="getter(property)"
|
|
216
|
+
@update:modelValue="
|
|
217
|
+
(e) => {
|
|
218
|
+
handleChange(e);
|
|
219
|
+
setter(property, e);
|
|
220
|
+
}
|
|
221
|
+
"
|
|
222
|
+
type="datetime-local"
|
|
223
|
+
:required="property.required || property.isRequired"
|
|
224
|
+
:placeholder="handleDisplayName || property.defaultValue"
|
|
225
|
+
:disabled="disabled"
|
|
226
|
+
></VcInput>
|
|
227
|
+
</Field>
|
|
228
|
+
|
|
229
|
+
<Field
|
|
230
|
+
v-else-if="property.valueType === 'LongText'"
|
|
231
|
+
v-slot="{ field, errorMessage, handleChange }"
|
|
232
|
+
:name="property.name"
|
|
233
|
+
:modelValue="getter(property)"
|
|
234
|
+
:rules="rules"
|
|
235
|
+
>
|
|
236
|
+
<VcTextarea
|
|
237
|
+
v-bind="$attrs"
|
|
238
|
+
:error-message="errorMessage"
|
|
239
|
+
:label="handleDisplayName"
|
|
240
|
+
:modelValue="getter(property)"
|
|
241
|
+
@update:modelValue="
|
|
242
|
+
(e) => {
|
|
243
|
+
handleChange(e);
|
|
244
|
+
setter(property, e);
|
|
245
|
+
}
|
|
246
|
+
"
|
|
247
|
+
:isRequired="property.required || property.isRequired"
|
|
248
|
+
:placeholder="handleDisplayName || property.defaultValue"
|
|
249
|
+
:disabled="disabled"
|
|
250
|
+
></VcTextarea>
|
|
251
|
+
</Field>
|
|
252
|
+
|
|
253
|
+
<Field
|
|
254
|
+
v-else-if="property.valueType === 'Boolean'"
|
|
255
|
+
v-slot="{ field, errorMessage, handleChange }"
|
|
256
|
+
:name="property.displayName || property.name"
|
|
257
|
+
:modelValue="getter(property)"
|
|
258
|
+
:rules="rules"
|
|
259
|
+
>
|
|
260
|
+
<VcCheckbox
|
|
261
|
+
v-bind="$attrs"
|
|
262
|
+
:error-message="errorMessage"
|
|
263
|
+
:modelValue="getter(property)"
|
|
264
|
+
@update:modelValue="
|
|
265
|
+
(e) => {
|
|
266
|
+
handleChange(e);
|
|
267
|
+
setter(property, e);
|
|
268
|
+
}
|
|
269
|
+
"
|
|
270
|
+
:required="property.required || property.isRequired"
|
|
271
|
+
:disabled="disabled"
|
|
272
|
+
:name="property.displayName || property.name"
|
|
273
|
+
>
|
|
274
|
+
{{ handleDisplayName || property.displayName }}
|
|
275
|
+
</VcCheckbox>
|
|
276
|
+
</Field>
|
|
277
|
+
|
|
278
|
+
<Field
|
|
279
|
+
v-else-if="property.valueType === 'Html'"
|
|
280
|
+
v-slot="{ field, errorMessage, handleChange }"
|
|
281
|
+
:name="property.displayName || property.name"
|
|
282
|
+
:modelValue="getter(property)"
|
|
283
|
+
:rules="rules"
|
|
284
|
+
>
|
|
285
|
+
<VcEditor
|
|
286
|
+
v-bind="$attrs"
|
|
287
|
+
:label="handleDisplayName || property.displayName"
|
|
288
|
+
:modelValue="getter(property)"
|
|
289
|
+
@update:modelValue="
|
|
290
|
+
(e) => {
|
|
291
|
+
handleChange(e);
|
|
292
|
+
setter(property, e);
|
|
293
|
+
}
|
|
294
|
+
"
|
|
295
|
+
:required="property.required || property.isRequired"
|
|
296
|
+
:placeholder="handleDisplayName || 'Add value'"
|
|
297
|
+
:disabled="disabled"
|
|
298
|
+
:name="property.displayName || property.name"
|
|
299
|
+
:error-message="errorMessage"
|
|
300
|
+
>
|
|
301
|
+
</VcEditor>
|
|
302
|
+
</Field>
|
|
303
|
+
</template>
|
|
304
|
+
|
|
305
|
+
<script lang="ts" setup>
|
|
306
|
+
import { ref, onMounted, computed } from "vue";
|
|
307
|
+
import { useI18n } from "@/core/composables";
|
|
308
|
+
import { Field } from "vee-validate";
|
|
309
|
+
|
|
310
|
+
interface IValidationRules {
|
|
311
|
+
required?: boolean;
|
|
312
|
+
min?: number;
|
|
313
|
+
max?: number;
|
|
314
|
+
regex?: RegExp;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
interface IDisplayName {
|
|
318
|
+
languageCode: string;
|
|
319
|
+
name?: string;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
const props = defineProps({
|
|
323
|
+
property: {
|
|
324
|
+
type: Object,
|
|
325
|
+
default: () => ({}),
|
|
326
|
+
},
|
|
327
|
+
|
|
328
|
+
dictionaries: {
|
|
329
|
+
type: Object,
|
|
330
|
+
default: () => ({}),
|
|
331
|
+
},
|
|
332
|
+
|
|
333
|
+
getter: {
|
|
334
|
+
type: Function,
|
|
335
|
+
},
|
|
336
|
+
|
|
337
|
+
optionsGetter: {
|
|
338
|
+
type: Function,
|
|
339
|
+
},
|
|
340
|
+
|
|
341
|
+
setter: {
|
|
342
|
+
type: Function,
|
|
343
|
+
},
|
|
344
|
+
|
|
345
|
+
culture: {
|
|
346
|
+
type: String,
|
|
347
|
+
default: "en-US",
|
|
348
|
+
},
|
|
349
|
+
|
|
350
|
+
disabled: {
|
|
351
|
+
type: Boolean,
|
|
352
|
+
default: false,
|
|
353
|
+
},
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
const { locale, te, t } = useI18n();
|
|
357
|
+
|
|
358
|
+
const rules: IValidationRules = {};
|
|
359
|
+
const items = ref([]);
|
|
360
|
+
const handleDisplayProperty = computed(() => {
|
|
361
|
+
return items.value?.some((x: { alias: string }) => x.alias)
|
|
362
|
+
? "alias"
|
|
363
|
+
: "name";
|
|
364
|
+
});
|
|
365
|
+
const handleDisplayName = computed(() => {
|
|
366
|
+
let localized: string;
|
|
367
|
+
const isLocaleExists = props.property.displayNames?.find((x: IDisplayName) =>
|
|
368
|
+
x.languageCode
|
|
369
|
+
?.toLowerCase()
|
|
370
|
+
.startsWith((locale.value as string)?.toLowerCase())
|
|
371
|
+
);
|
|
372
|
+
if (isLocaleExists && isLocaleExists.name) {
|
|
373
|
+
localized = isLocaleExists.name;
|
|
374
|
+
} else {
|
|
375
|
+
const fallback = props.property.displayNames?.find((x: IDisplayName) =>
|
|
376
|
+
x.languageCode?.toLowerCase().includes(props.culture?.toLowerCase())
|
|
377
|
+
);
|
|
378
|
+
localized =
|
|
379
|
+
fallback && fallback?.name ? fallback.name : props.property.name;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
return localized && te(localized.toUpperCase())
|
|
383
|
+
? t(localized.toUpperCase())
|
|
384
|
+
: localized;
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
onMounted(async () => {
|
|
388
|
+
if (props.optionsGetter) {
|
|
389
|
+
items.value = await props.optionsGetter(props.property);
|
|
390
|
+
}
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
if (props.property.required || props.property.isRequired) {
|
|
394
|
+
rules.required = true;
|
|
395
|
+
}
|
|
396
|
+
if (props.property.validationRule?.charCountMin) {
|
|
397
|
+
rules.min = Number(props.property.validationRule.charCountMin);
|
|
398
|
+
}
|
|
399
|
+
if (props.property.validationRule?.charCountMax) {
|
|
400
|
+
rules.max = Number(props.property.validationRule.charCountMax);
|
|
401
|
+
}
|
|
402
|
+
if (props.property.validationRule?.regExp) {
|
|
403
|
+
rules.regex = new RegExp(props.property.validationRule?.regExp);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/*function getLabel() {
|
|
407
|
+
return (
|
|
408
|
+
(props.property.displayNames as { culture: string }[]).find(
|
|
409
|
+
(item) => item.culture === props.culture
|
|
410
|
+
) || props.property.name
|
|
411
|
+
);
|
|
412
|
+
}
|
|
413
|
+
*/
|
|
414
|
+
|
|
415
|
+
async function onSearch(keyword: string) {
|
|
416
|
+
if (props.optionsGetter) {
|
|
417
|
+
items.value = await props.optionsGetter(props.property, keyword);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
async function onClose() {
|
|
422
|
+
if (props.optionsGetter) {
|
|
423
|
+
items.value = await props.optionsGetter(props.property);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
</script>
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="vc-gallery-item"
|
|
4
|
+
:class="{
|
|
5
|
+
'vc-gallery-item_readonly': readonly,
|
|
6
|
+
'vc-gallery-item_hover': hover,
|
|
7
|
+
}"
|
|
8
|
+
@tap.stop="hover = !hover"
|
|
9
|
+
v-click-outside="onClose"
|
|
10
|
+
>
|
|
11
|
+
<VcImage aspect="1x1" :src="image.url" background="contain"></VcImage>
|
|
12
|
+
<div class="vc-gallery-item__overlay">
|
|
13
|
+
<div class= "tw-flex">
|
|
14
|
+
<VcIcon
|
|
15
|
+
v-if="!readonly && !disableDrag"
|
|
16
|
+
class="vc-gallery-item__move"
|
|
17
|
+
icon="fas fa-arrows-alt"
|
|
18
|
+
size="s"
|
|
19
|
+
></VcIcon>
|
|
20
|
+
<div class="tw-truncate" :title="image.name">
|
|
21
|
+
{{ image.name }}
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
<div class= "tw-flex tw-grow tw-basis-0 tw-items-center tw-justify-around">
|
|
25
|
+
<div
|
|
26
|
+
class="vc-gallery-item__button"
|
|
27
|
+
@click="$emit('preview', image)"
|
|
28
|
+
v-if="actions && actions.preview"
|
|
29
|
+
>
|
|
30
|
+
<VcIcon
|
|
31
|
+
class="vc-gallery-item__button-icon"
|
|
32
|
+
icon="fas fa-eye"
|
|
33
|
+
></VcIcon>
|
|
34
|
+
<div class="tw-mt-2">Fullscreen</div>
|
|
35
|
+
</div>
|
|
36
|
+
<div
|
|
37
|
+
v-if="!readonly && actions && actions.edit"
|
|
38
|
+
class="vc-gallery-item__button"
|
|
39
|
+
@click="$emit('edit', image)"
|
|
40
|
+
>
|
|
41
|
+
<VcIcon
|
|
42
|
+
class="vc-gallery-item__button-icon"
|
|
43
|
+
icon="fas fa-pen"
|
|
44
|
+
></VcIcon>
|
|
45
|
+
<div class="tw-mt-2">Edit</div>
|
|
46
|
+
</div>
|
|
47
|
+
<div
|
|
48
|
+
v-if="!readonly && actions && actions.remove"
|
|
49
|
+
class="vc-gallery-item__button"
|
|
50
|
+
@click="$emit('remove', image)"
|
|
51
|
+
>
|
|
52
|
+
<VcIcon
|
|
53
|
+
class="vc-gallery-item__button-icon"
|
|
54
|
+
icon="fas fa-trash"
|
|
55
|
+
></VcIcon>
|
|
56
|
+
<div class="tw-mt-2">Delete</div>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</template>
|
|
62
|
+
|
|
63
|
+
<script lang="ts" setup>
|
|
64
|
+
import { ref } from "vue";
|
|
65
|
+
import { clickOutside as vClickOutside } from "@/core/directives";
|
|
66
|
+
|
|
67
|
+
defineProps({
|
|
68
|
+
image: {
|
|
69
|
+
type: Object,
|
|
70
|
+
default: () => ({}),
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
readonly: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: false,
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
actions: {
|
|
79
|
+
type: Object,
|
|
80
|
+
default: () => ({}),
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
disableDrag: {
|
|
84
|
+
type: Boolean,
|
|
85
|
+
default: false,
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
defineEmits(["preview", "edit", "remove"]);
|
|
90
|
+
|
|
91
|
+
const hover = ref(false);
|
|
92
|
+
|
|
93
|
+
function onClose() {
|
|
94
|
+
hover.value = false;
|
|
95
|
+
}
|
|
96
|
+
</script>
|
|
97
|
+
|
|
98
|
+
<style lang="scss">
|
|
99
|
+
.vc-gallery-item {
|
|
100
|
+
@apply tw-relative tw-w-[155px] tw-h-[155px] tw-box-border tw-border tw-border-solid tw-border-[#d3dae9] tw-rounded-md tw-p-1;
|
|
101
|
+
|
|
102
|
+
&__overlay {
|
|
103
|
+
@apply tw-bg-[rgba(238,246,252,0.97)] tw-flex-col tw-p-2 tw-opacity-0 tw-flex tw-absolute tw-left-0 tw-top-0 tw-right-0 tw-bottom-0 tw-transition tw-duration-200;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&:hover &__overlay,
|
|
107
|
+
.vc-app_touch &_hover &__overlay {
|
|
108
|
+
@apply tw-opacity-100;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&__move {
|
|
112
|
+
@apply tw-text-[#a1c0d4] tw-cursor-pointer tw-mr-2;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&__button {
|
|
116
|
+
@apply tw-cursor-pointer tw-flex tw-flex-col tw-items-center;
|
|
117
|
+
|
|
118
|
+
&-icon {
|
|
119
|
+
@apply tw-text-[#319ed4];
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
</style>
|
package/ui/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<VcPopup :title="currentImage.title" @close="$emit('close')">
|
|
3
|
+
<template v-slot:title>
|
|
4
|
+
<div>
|
|
5
|
+
<span>{{ currentImage.name }} (</span>
|
|
6
|
+
<VcLink @click="copyLink(currentImage.url)">copy image link</VcLink>
|
|
7
|
+
<span>)</span>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
<div class="tw-w-full tw-h-full tw-box-border tw-flex tw-flex-col tw-items-center">
|
|
11
|
+
<div class="tw-box-border p-5 tw-grow tw-basis-0 tw-w-full">
|
|
12
|
+
<div
|
|
13
|
+
class="bg-contain tw-bg-no-repeat tw-bg-center tw-w-full tw-h-full tw-box-border"
|
|
14
|
+
:style="{ backgroundImage: 'url(' + currentImage.url + ')' }"
|
|
15
|
+
></div>
|
|
16
|
+
<div
|
|
17
|
+
v-if="localIndex > 0"
|
|
18
|
+
class="tw-absolute tw-top-2/4 -tw-mt-9 tw-h-[72px] tw-w-[72px] tw-flex tw-items-center tw-justify-center tw-rounded-full tw-bg-[#f1f6fa] tw-cursor-pointer tw-text-[#a1c0d4] [--icon-size-xl: 36px] hover:tw-shadow-[0_0_20px_rgba(31,40,50,0.15)] tw-left-[25px]"
|
|
19
|
+
@click="localIndex--"
|
|
20
|
+
>
|
|
21
|
+
<VcIcon icon="fas fa-arrow-left" size="xl"></VcIcon>
|
|
22
|
+
</div>
|
|
23
|
+
<div
|
|
24
|
+
v-if="localIndex < images.length - 1"
|
|
25
|
+
class="tw-absolute tw-top-2/4 -tw-mt-9 tw-h-[72px] tw-w-[72px] tw-flex tw-items-center tw-justify-center tw-rounded-full tw-bg-[#f1f6fa] tw-cursor-pointer tw-text-[#a1c0d4] [--icon-size-xl: 36px] hover:tw-shadow-[0_0_20px_rgba(31,40,50,0.15)] tw-right-[25px]"
|
|
26
|
+
@click="localIndex++"
|
|
27
|
+
>
|
|
28
|
+
<VcIcon icon="fas fa-arrow-right" size="xl"></VcIcon>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
<div
|
|
32
|
+
class="tw-p-4 tw-pb-[40px] tw-max-w-full tw-overflow-x-auto tw-box-border tw-shrink tw-flex"
|
|
33
|
+
>
|
|
34
|
+
<div
|
|
35
|
+
v-for="(item, i) in images"
|
|
36
|
+
:key="i"
|
|
37
|
+
class="tw-m-1 tw-opacity-60"
|
|
38
|
+
:class="{
|
|
39
|
+
'vc-gallery-preview__images-item_current': i === localIndex,
|
|
40
|
+
}"
|
|
41
|
+
>
|
|
42
|
+
<VcImage
|
|
43
|
+
:src="item.url"
|
|
44
|
+
size="xl"
|
|
45
|
+
:bordered="true"
|
|
46
|
+
:clickable="true"
|
|
47
|
+
@click="localIndex = i"
|
|
48
|
+
></VcImage>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</VcPopup>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<script lang="ts" setup>
|
|
56
|
+
import { computed, ref } from "vue";
|
|
57
|
+
import { VcPopup } from "@/ui/components";
|
|
58
|
+
|
|
59
|
+
const props = defineProps({
|
|
60
|
+
images: {
|
|
61
|
+
type: Array,
|
|
62
|
+
default: () => [],
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
index: {
|
|
66
|
+
type: Number,
|
|
67
|
+
default: 0,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const localIndex = ref(props.index);
|
|
72
|
+
const currentImage = computed(() => props.images[localIndex.value] || {});
|
|
73
|
+
|
|
74
|
+
const copyLink = (link: string) => {
|
|
75
|
+
if (link.charAt(0) === "/") {
|
|
76
|
+
navigator.clipboard?.writeText(`${location.origin}${link}`);
|
|
77
|
+
} else {
|
|
78
|
+
navigator.clipboard?.writeText(link);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
</script>
|
|
82
|
+
|
|
83
|
+
<style lang="scss">
|
|
84
|
+
.vc-gallery-preview {
|
|
85
|
+
&__images {
|
|
86
|
+
&-item {
|
|
87
|
+
&_current {
|
|
88
|
+
@apply tw-relative tw-opacity-100 after:tw-content-[""] after:tw-bg-[#43b0e6] after:tw-h-1 after:tw-w-full after:tw-rounded-[5px] after:tw-absolute after:tw-left-0 after:-tw-bottom-[12px];
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
</style>
|