@vc-shell/framework 1.0.207 → 1.0.209
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 +14 -0
- package/core/types/index.ts +2 -0
- package/dist/core/types/index.d.ts +2 -0
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/framework.js +6743 -6655
- package/dist/shared/modules/assets-manager/components/assets-manager/assets-manager.vue.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/SchemaRender.d.ts +3 -0
- package/dist/shared/modules/dynamic/components/SchemaRender.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/Button.d.ts +1 -0
- package/dist/shared/modules/dynamic/components/fields/Button.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/Card.d.ts +1 -0
- package/dist/shared/modules/dynamic/components/fields/Card.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/Checkbox.d.ts +1 -0
- package/dist/shared/modules/dynamic/components/fields/Checkbox.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/ContentField.d.ts +1 -0
- package/dist/shared/modules/dynamic/components/fields/ContentField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/CustomComponent.d.ts +1 -0
- package/dist/shared/modules/dynamic/components/fields/CustomComponent.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/DynamicProperty.d.ts +1 -0
- package/dist/shared/modules/dynamic/components/fields/DynamicProperty.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/EditorField.d.ts +1 -0
- package/dist/shared/modules/dynamic/components/fields/EditorField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/Fieldset.d.ts +1 -0
- package/dist/shared/modules/dynamic/components/fields/Fieldset.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/GalleryField.d.ts +1 -0
- package/dist/shared/modules/dynamic/components/fields/GalleryField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/ImageField.d.ts +1 -0
- package/dist/shared/modules/dynamic/components/fields/ImageField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/InputCurrency.d.ts +1 -0
- package/dist/shared/modules/dynamic/components/fields/InputCurrency.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/InputField.d.ts +1 -0
- package/dist/shared/modules/dynamic/components/fields/InputField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/MultivalueField.d.ts +1 -0
- package/dist/shared/modules/dynamic/components/fields/MultivalueField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/RatingField.d.ts +1 -0
- package/dist/shared/modules/dynamic/components/fields/RatingField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/SelectField.d.ts +1 -0
- package/dist/shared/modules/dynamic/components/fields/SelectField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/StatusField.d.ts +1 -0
- package/dist/shared/modules/dynamic/components/fields/StatusField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/SwitchField.d.ts +1 -0
- package/dist/shared/modules/dynamic/components/fields/SwitchField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/Table.d.ts +1 -0
- package/dist/shared/modules/dynamic/components/fields/Table.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/TextareaField.d.ts +1 -0
- package/dist/shared/modules/dynamic/components/fields/TextareaField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/VideoField.d.ts +1 -0
- package/dist/shared/modules/dynamic/components/fields/VideoField.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/props.d.ts +1 -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 +3 -0
- 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 +3 -0
- 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 +3 -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 +3 -0
- 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 +3 -0
- 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 +3 -0
- 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 +3 -0
- 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 +3 -0
- 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 +3 -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 +3 -0
- 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 +3 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/MultivalueField.stories.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/RatingField.stories.d.ts +3 -0
- 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 +3 -0
- 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 +3 -0
- 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 +3 -0
- 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 +3 -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 +3 -0
- package/dist/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/factories/types/index.d.ts +2 -1
- package/dist/shared/modules/dynamic/factories/types/index.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts +1 -0
- package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/types/index.d.ts +1 -0
- package/dist/shared/modules/dynamic/types/index.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/molecules/vc-file-upload/index.d.ts +1 -153
- package/dist/ui/components/molecules/vc-file-upload/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.stories.d.ts +4 -8
- package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.stories.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.vue.d.ts +4 -2
- package/dist/ui/components/molecules/vc-file-upload/vc-file-upload.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.stories.d.ts +19 -0
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.stories.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts +8 -0
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue.d.ts +12 -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/vc-table.stories.d.ts +225 -15
- 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 +45 -3
- package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +1 -1
- package/package.json +4 -4
- package/shared/modules/assets-manager/components/assets-manager/assets-manager.vue +26 -1
- package/shared/modules/dynamic/components/fields/Table.ts +15 -1
- package/shared/modules/dynamic/factories/types/index.ts +2 -1
- package/shared/modules/dynamic/pages/dynamic-blade-form.vue +2 -0
- package/shared/modules/dynamic/types/index.ts +1 -1
- package/ui/components/molecules/vc-file-upload/index.ts +1 -10
- package/ui/components/molecules/vc-file-upload/vc-file-upload.vue +5 -1
- package/ui/components/molecules/vc-input-currency/vc-input-currency.vue +15 -8
- package/ui/components/organisms/vc-gallery/vc-gallery.vue +27 -1
- package/ui/components/organisms/vc-table/_internal/vc-table-cell/vc-table-cell.vue +56 -9
- package/ui/components/organisms/vc-table/vc-table.vue +4 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vc-table.vue.d.ts","sourceRoot":"","sources":["../../../../../ui/components/organisms/vc-table/vc-table.vue.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,QAAQ,EACR,GAAG,EAUJ,MAAM,KAAK,CAAC;AAGb,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAO/E,OAAO,iCAAiC,CAAC;AACzC,OAAO,gCAAgC,CAAC;AAExC,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,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1F,wBAujE2E;AAQ3E,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vc-shell/framework",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.209",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/framework.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@types/dompurify": "^3.0.5",
|
|
61
61
|
"@types/quill": "^2.0.14",
|
|
62
|
-
"@vc-shell/api-client-generator": "^1.0.
|
|
63
|
-
"@vc-shell/config-generator": "^1.0.
|
|
64
|
-
"@vc-shell/ts-config": "^1.0.
|
|
62
|
+
"@vc-shell/api-client-generator": "^1.0.209",
|
|
63
|
+
"@vc-shell/config-generator": "^1.0.209",
|
|
64
|
+
"@vc-shell/ts-config": "^1.0.209",
|
|
65
65
|
"@vitejs/plugin-vue": "^5.0.3",
|
|
66
66
|
"sass": "^1.69.6",
|
|
67
67
|
"shx": "^0.3.4",
|
|
@@ -320,8 +320,33 @@ function toggleUploader() {
|
|
|
320
320
|
|
|
321
321
|
async function upload(files: FileList) {
|
|
322
322
|
if (files && files.length) {
|
|
323
|
+
const uploadedFiles: File[] = [];
|
|
324
|
+
const existingImageNames = defaultAssets.value.map((asset) => asset.name);
|
|
325
|
+
|
|
326
|
+
Array.from(files).forEach((file: File) => {
|
|
327
|
+
let fileName = file.name;
|
|
328
|
+
|
|
329
|
+
if (existingImageNames.includes(fileName)) {
|
|
330
|
+
let index = 1;
|
|
331
|
+
const baseName = fileName.replace(/\.[^/.]+$/, "");
|
|
332
|
+
|
|
333
|
+
while (existingImageNames.includes(fileName)) {
|
|
334
|
+
fileName = `${baseName}_${index}.${file.name.split(".").pop()}`;
|
|
335
|
+
index++;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
const modifiedFile = new File([file], fileName, { type: file.type });
|
|
340
|
+
|
|
341
|
+
uploadedFiles.push(modifiedFile);
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
const modifiedFileList = new DataTransfer();
|
|
345
|
+
uploadedFiles.forEach((file) => {
|
|
346
|
+
modifiedFileList.items.add(file);
|
|
347
|
+
});
|
|
323
348
|
if (props.options.assetsUploadHandler && typeof props.options.assetsUploadHandler === "function")
|
|
324
|
-
defaultAssets.value = await props.options.assetsUploadHandler(files);
|
|
349
|
+
defaultAssets.value = await props.options.assetsUploadHandler(modifiedFileList.files);
|
|
325
350
|
}
|
|
326
351
|
}
|
|
327
352
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
import { useTableTemplates } from "./../../composables";
|
|
3
|
-
import { Component, ExtractPropTypes, computed, h, unref } from "vue";
|
|
3
|
+
import { Component, ExtractPropTypes, computed, h, inject, unref } from "vue";
|
|
4
4
|
import { Table } from "../factories";
|
|
5
5
|
import componentProps from "./props";
|
|
6
6
|
import { TableSchema } from "../../types";
|
|
7
7
|
import { useI18n } from "vue-i18n";
|
|
8
8
|
import { unrefNested } from "../../helpers/unrefNested";
|
|
9
|
+
import { setModel } from "../../helpers/setters";
|
|
9
10
|
|
|
10
11
|
type TableItemData = Record<string, any>;
|
|
11
12
|
|
|
@@ -15,6 +16,8 @@ export default {
|
|
|
15
16
|
setup(props: ExtractPropTypes<typeof componentProps> & { element: TableSchema }) {
|
|
16
17
|
const { tableTemplates } = useTableTemplates(props.element);
|
|
17
18
|
const { t } = useI18n({ useScope: "global" });
|
|
19
|
+
const enableEdit = inject("isBladeEditable", false);
|
|
20
|
+
const enableEditComputed = computed(() => unref(enableEdit));
|
|
18
21
|
|
|
19
22
|
return () => {
|
|
20
23
|
const field = Table({
|
|
@@ -24,10 +27,21 @@ export default {
|
|
|
24
27
|
header: !!props.element.header,
|
|
25
28
|
footer: !!props.element.footer,
|
|
26
29
|
multiselect: !!props.element.multiselect,
|
|
30
|
+
editable: !!props.element.editable,
|
|
27
31
|
columns: props.element.columns?.map((col) => ({ ...col, title: computed(() => t(col.title)) })),
|
|
28
32
|
items: unrefNested(props.baseProps).modelValue ?? [],
|
|
29
33
|
stateKey: props.element.id,
|
|
30
34
|
class: `!tw-flex-auto ${unrefNested(props.baseProps).classNames ?? ""}`,
|
|
35
|
+
cellEditActive: enableEditComputed.value,
|
|
36
|
+
onOnEditComplete: (data: any) => {
|
|
37
|
+
if (props.fieldContext) {
|
|
38
|
+
setModel({
|
|
39
|
+
context: props.fieldContext,
|
|
40
|
+
property: `${props.element.property}.${data.index}.${data.event.field}`,
|
|
41
|
+
value: data.event.value,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
},
|
|
31
45
|
},
|
|
32
46
|
unrefNested(props.baseProps),
|
|
33
47
|
),
|
|
@@ -84,7 +84,8 @@ export interface ListBaseBladeScope<Item = Record<string, any>, Query = Record<s
|
|
|
84
84
|
export type TOpenBladeArgs = Omit<Parameters<ReturnType<typeof useBladeNavigation>["openBlade"]>["0"], "blade">;
|
|
85
85
|
|
|
86
86
|
export interface DetailsBaseBladeScope extends BaseBladeScope {
|
|
87
|
-
disabled?: ComputedRef<boolean | undefined>;
|
|
87
|
+
disabled?: ComputedRef<boolean | undefined> | Ref<boolean | undefined>;
|
|
88
|
+
isBladeEditable?: ComputedRef<boolean | undefined> | Ref<boolean | undefined>;
|
|
88
89
|
multilanguage?: {
|
|
89
90
|
loading: ComputedRef<boolean>;
|
|
90
91
|
currentLocale: Ref<string>;
|
|
@@ -80,6 +80,7 @@ import {
|
|
|
80
80
|
ConcreteComponent,
|
|
81
81
|
toRefs,
|
|
82
82
|
provide,
|
|
83
|
+
toRef,
|
|
83
84
|
} from "vue";
|
|
84
85
|
import { DynamicDetailsSchema, FormContentSchema, SettingsSchema } from "../types";
|
|
85
86
|
import { reactiveComputed, toReactive, useMounted, useTemplateRefsList } from "@vueuse/core";
|
|
@@ -352,6 +353,7 @@ onBeforeClose(async () => {
|
|
|
352
353
|
});
|
|
353
354
|
|
|
354
355
|
provide("bladeContext", toReactive(bladeContext));
|
|
356
|
+
provide("isBladeEditable", toRef(toValue(scope ?? {}), "isBladeEditable"));
|
|
355
357
|
|
|
356
358
|
defineExpose({
|
|
357
359
|
title: bladeTitle ?? "",
|
|
@@ -149,6 +149,7 @@ export interface ListContentSchema {
|
|
|
149
149
|
multiselect?: boolean;
|
|
150
150
|
header?: boolean;
|
|
151
151
|
footer?: boolean;
|
|
152
|
+
editable?: boolean;
|
|
152
153
|
columns?: (Omit<ITableColumns, "visible"> & {
|
|
153
154
|
id: string;
|
|
154
155
|
title: string;
|
|
@@ -184,7 +185,6 @@ export interface ListContentSchema {
|
|
|
184
185
|
component: string;
|
|
185
186
|
};
|
|
186
187
|
}
|
|
187
|
-
|
|
188
188
|
export interface FormContentSchema {
|
|
189
189
|
id: string;
|
|
190
190
|
component: "vc-form";
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import _FileUpload from "./vc-file-upload.vue";
|
|
3
|
-
|
|
4
|
-
export const VcFileUpload = _FileUpload as typeof _FileUpload & {
|
|
5
|
-
new (): {
|
|
6
|
-
$slots: {
|
|
7
|
-
error?: () => VNode[];
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
};
|
|
1
|
+
export { default as VcFileUpload } from "./vc-file-upload.vue";
|
|
@@ -74,13 +74,17 @@ export interface Emits {
|
|
|
74
74
|
|
|
75
75
|
const props = withDefaults(defineProps<Props>(), {
|
|
76
76
|
variant: "gallery",
|
|
77
|
-
accept: ".jpg, .png, .jpeg",
|
|
77
|
+
accept: ".jpg, .png, .jpeg, .webp, .heic",
|
|
78
78
|
name: "Gallery",
|
|
79
79
|
icon: "fas fa-cloud-upload-alt",
|
|
80
80
|
});
|
|
81
81
|
|
|
82
82
|
const emit = defineEmits<Emits>();
|
|
83
83
|
|
|
84
|
+
defineSlots<{
|
|
85
|
+
error: void;
|
|
86
|
+
}>();
|
|
87
|
+
|
|
84
88
|
const { t } = useI18n({ useScope: "global" });
|
|
85
89
|
|
|
86
90
|
// TODO refactor component and remove field-level validation
|
|
@@ -36,12 +36,14 @@
|
|
|
36
36
|
name="button"
|
|
37
37
|
:toggle-handler="toggleHandler"
|
|
38
38
|
>
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
<template v-if="options && options.length">
|
|
40
|
+
<button
|
|
41
|
+
class="tw-text-[#43b0e6] tw-not-italic tw-font-medium tw-text-[13px] tw-leading-[20px] tw-cursor-pointer"
|
|
42
|
+
@click.stop.prevent="toggleHandler"
|
|
43
|
+
>
|
|
44
|
+
{{ unref(option) }}
|
|
45
|
+
</button>
|
|
46
|
+
</template>
|
|
45
47
|
</slot>
|
|
46
48
|
</template>
|
|
47
49
|
<template #control="{ placeholder: holder }">
|
|
@@ -158,6 +160,10 @@ export interface Props {
|
|
|
158
160
|
* @returns Label of the current option
|
|
159
161
|
*/
|
|
160
162
|
optionLabel?: OptionProp<unknown>;
|
|
163
|
+
/**
|
|
164
|
+
* Currency sign display settings
|
|
165
|
+
*/
|
|
166
|
+
currencyDisplay?: `${CurrencyDisplay}`;
|
|
161
167
|
}
|
|
162
168
|
|
|
163
169
|
export interface Emits {
|
|
@@ -168,6 +174,7 @@ export interface Emits {
|
|
|
168
174
|
|
|
169
175
|
const props = withDefaults(defineProps<Props>(), {
|
|
170
176
|
debounce: 0,
|
|
177
|
+
currencyDisplay: CurrencyDisplay.hidden,
|
|
171
178
|
});
|
|
172
179
|
|
|
173
180
|
defineSlots<{
|
|
@@ -189,7 +196,7 @@ const { inputRef, setOptions, numberValue } = useCurrencyInput(
|
|
|
189
196
|
{
|
|
190
197
|
locale: navigator.language,
|
|
191
198
|
currency: props.option || "USD",
|
|
192
|
-
currencyDisplay: CurrencyDisplay
|
|
199
|
+
currencyDisplay: props.currencyDisplay as CurrencyDisplay,
|
|
193
200
|
hideGroupingSeparatorOnFocus: false,
|
|
194
201
|
},
|
|
195
202
|
false,
|
|
@@ -203,7 +210,7 @@ watch(
|
|
|
203
210
|
setOptions({
|
|
204
211
|
locale: navigator.language,
|
|
205
212
|
currency: newVal,
|
|
206
|
-
currencyDisplay: CurrencyDisplay
|
|
213
|
+
currencyDisplay: props.currencyDisplay as CurrencyDisplay,
|
|
207
214
|
hideGroupingSeparatorOnFocus: false,
|
|
208
215
|
});
|
|
209
216
|
},
|
|
@@ -149,7 +149,33 @@ watch(
|
|
|
149
149
|
|
|
150
150
|
const onUpload = (files: FileList) => {
|
|
151
151
|
if (files && files.length) {
|
|
152
|
-
|
|
152
|
+
const uploadedFiles: File[] = [];
|
|
153
|
+
const existingImageNames = defaultImages.value.map((image) => image.name);
|
|
154
|
+
|
|
155
|
+
Array.from(files).forEach((file: File) => {
|
|
156
|
+
let fileName = file.name;
|
|
157
|
+
|
|
158
|
+
if (existingImageNames.includes(fileName)) {
|
|
159
|
+
let index = 1;
|
|
160
|
+
const baseName = fileName.replace(/\.[^/.]+$/, "");
|
|
161
|
+
|
|
162
|
+
while (existingImageNames.includes(fileName)) {
|
|
163
|
+
fileName = `${baseName}_${index}.${file.name.split(".").pop()}`;
|
|
164
|
+
index++;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const modifiedFile = new File([file], fileName, { type: file.type });
|
|
169
|
+
|
|
170
|
+
uploadedFiles.push(modifiedFile);
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
const modifiedFileList = new DataTransfer();
|
|
174
|
+
uploadedFiles.forEach((file) => {
|
|
175
|
+
modifiedFileList.items.add(file);
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
emit("upload", modifiedFileList.files, props.images[props.images.length - 1]?.sortOrder);
|
|
153
179
|
}
|
|
154
180
|
};
|
|
155
181
|
|
|
@@ -3,16 +3,25 @@
|
|
|
3
3
|
<!-- Money cell -->
|
|
4
4
|
<template v-if="cell.type === 'money'">
|
|
5
5
|
<div
|
|
6
|
-
v-if="typeof Number(value) === 'number'
|
|
6
|
+
v-if="typeof Number(value) === 'number'"
|
|
7
7
|
class="tw-truncate"
|
|
8
8
|
:class="cell.class"
|
|
9
9
|
>
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
<template v-if="cellEditActive">
|
|
11
|
+
<VcInputCurrency
|
|
12
|
+
:model-value="value"
|
|
13
|
+
:options="[]"
|
|
14
|
+
:option="(item[cell.currencyField || 'currency'] as string) || 'USD'"
|
|
15
|
+
currency-display="symbol"
|
|
16
|
+
class="tw-w-full"
|
|
17
|
+
@update:model-value="$emit('update', { field: cell.id, value: $event })"
|
|
18
|
+
/>
|
|
19
|
+
</template>
|
|
20
|
+
<template v-else>
|
|
21
|
+
<span class="tw-truncate">{{ intlMoney(Number(value)) }}</span>
|
|
22
|
+
</template>
|
|
14
23
|
</div>
|
|
15
|
-
<template v-else>
|
|
24
|
+
<template v-else-if="!cellEditActive">
|
|
16
25
|
<div
|
|
17
26
|
class="tw-truncate"
|
|
18
27
|
:class="cell.class"
|
|
@@ -116,7 +125,17 @@
|
|
|
116
125
|
class="tw-text-right tw-truncate"
|
|
117
126
|
:class="cell.class"
|
|
118
127
|
>
|
|
119
|
-
|
|
128
|
+
<template v-if="cellEditActive">
|
|
129
|
+
<VcInput
|
|
130
|
+
:model-value="value"
|
|
131
|
+
class="tw-w-full"
|
|
132
|
+
type="number"
|
|
133
|
+
@update:model-value="$emit('update', { field: cell.id, value: $event })"
|
|
134
|
+
></VcInput>
|
|
135
|
+
</template>
|
|
136
|
+
<template v-else>
|
|
137
|
+
{{ typeof Number(value) === "number" && Number(value) >= 0 ? Number(value).toFixed(0) : "N/A" }}
|
|
138
|
+
</template>
|
|
120
139
|
</div>
|
|
121
140
|
|
|
122
141
|
<!-- Link cell -->
|
|
@@ -143,7 +162,16 @@
|
|
|
143
162
|
class="tw-truncate"
|
|
144
163
|
:class="cell.class"
|
|
145
164
|
>
|
|
146
|
-
|
|
165
|
+
<template v-if="cellEditActive">
|
|
166
|
+
<VcInput
|
|
167
|
+
:model-value="value"
|
|
168
|
+
class="tw-w-full"
|
|
169
|
+
@update:model-value="$emit('update', { field: cell.id, value: $event })"
|
|
170
|
+
></VcInput>
|
|
171
|
+
</template>
|
|
172
|
+
<template v-else>
|
|
173
|
+
{{ value }}
|
|
174
|
+
</template>
|
|
147
175
|
</div>
|
|
148
176
|
</div>
|
|
149
177
|
</template>
|
|
@@ -155,18 +183,26 @@ import { ITableColumns } from "./../../../../../../core/types";
|
|
|
155
183
|
import * as _ from "lodash-es";
|
|
156
184
|
import htmlTruncate from "truncate-html";
|
|
157
185
|
import * as DOMPurify from "dompurify";
|
|
186
|
+
import VcInputCurrency from "../../../../molecules/vc-input-currency/vc-input-currency.vue";
|
|
187
|
+
import VcInput from "../../../../molecules/vc-input/vc-input.vue";
|
|
158
188
|
|
|
159
189
|
export interface Props {
|
|
160
190
|
cell: ITableColumns;
|
|
161
191
|
item: Record<string, unknown>;
|
|
162
192
|
width?: number;
|
|
193
|
+
cellEditActive?: boolean;
|
|
163
194
|
}
|
|
164
195
|
|
|
165
196
|
const props = defineProps<Props>();
|
|
197
|
+
defineEmits<{
|
|
198
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
199
|
+
(event: "update", payload: { field: string; value: any }): void;
|
|
200
|
+
}>();
|
|
166
201
|
|
|
167
202
|
const locale = window.navigator.language;
|
|
168
203
|
|
|
169
|
-
|
|
204
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
205
|
+
const value = computed((): any => _.get(props.item, props.cell.field || props.cell.id));
|
|
170
206
|
|
|
171
207
|
const sanitizedHtml = computed(() => {
|
|
172
208
|
if (props.cell.type === "html") {
|
|
@@ -178,4 +214,15 @@ const sanitizedHtml = computed(() => {
|
|
|
178
214
|
const truncatedHtml = computed(() =>
|
|
179
215
|
htmlTruncate(sanitizedHtml.value, +(typeof props.width !== "undefined" ? Math.floor(props.width / 5) : 30)),
|
|
180
216
|
);
|
|
217
|
+
|
|
218
|
+
function intlMoney(value: number) {
|
|
219
|
+
if (props.cell.type !== "money") {
|
|
220
|
+
return value;
|
|
221
|
+
}
|
|
222
|
+
const currencyProp = props.cell.currencyField || "currency";
|
|
223
|
+
return new Intl.NumberFormat(locale, {
|
|
224
|
+
style: "currency",
|
|
225
|
+
currency: (props.item[currencyProp] as string) || "USD",
|
|
226
|
+
}).format(value);
|
|
227
|
+
}
|
|
181
228
|
</script>
|
|
@@ -353,11 +353,13 @@
|
|
|
353
353
|
v-if="typeof item === 'object'"
|
|
354
354
|
:cell="cell"
|
|
355
355
|
:item="item"
|
|
356
|
+
:cell-edit-active="cellEditActive"
|
|
356
357
|
:width="
|
|
357
358
|
calculateElWidth(
|
|
358
359
|
`${(typeof item === 'object' && 'id' in item && item.id) || itemIndex}_${cell.id}`,
|
|
359
360
|
)
|
|
360
361
|
"
|
|
362
|
+
@update="$emit('onEditComplete', { event: $event, index: itemIndex })"
|
|
361
363
|
></VcTableCell>
|
|
362
364
|
</slot>
|
|
363
365
|
</td>
|
|
@@ -517,6 +519,7 @@ const props = withDefaults(
|
|
|
517
519
|
stateKey: string;
|
|
518
520
|
selectAll?: boolean;
|
|
519
521
|
enableItemActions?: boolean;
|
|
522
|
+
cellEditActive?: boolean;
|
|
520
523
|
}>(),
|
|
521
524
|
{
|
|
522
525
|
items: () => [],
|
|
@@ -546,6 +549,7 @@ const emit = defineEmits<{
|
|
|
546
549
|
"scroll:ptr": [];
|
|
547
550
|
"row:reorder": [args: { dragIndex: number; dropIndex: number; value: T[] }];
|
|
548
551
|
"select:all": [values: boolean];
|
|
552
|
+
onEditComplete: [args: { event: { field: string; value: string | number }; index: number }];
|
|
549
553
|
}>();
|
|
550
554
|
|
|
551
555
|
const { t } = useI18n({ useScope: "global" });
|