@finema/core 3.7.0 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.json +1 -1
- package/dist/module.mjs +7 -2
- package/dist/runtime/components/FlexDeck/index.vue +79 -79
- package/dist/runtime/components/Form/FieldWrapper.vue +13 -13
- package/dist/runtime/components/Form/Fields.vue +13 -13
- package/dist/runtime/components/Form/InputCheckbox/index.vue +18 -18
- package/dist/runtime/components/Form/InputCheckboxGroup/index.vue +21 -21
- package/dist/runtime/components/Form/InputCurrency/index.vue +49 -49
- package/dist/runtime/components/Form/InputDateTime/date_time_field.types.d.ts +1 -0
- package/dist/runtime/components/Form/InputDateTime/index.d.vue.ts +1 -0
- package/dist/runtime/components/Form/InputDateTime/index.vue +63 -61
- package/dist/runtime/components/Form/InputDateTime/index.vue.d.ts +1 -0
- package/dist/runtime/components/Form/InputDateTimeRange/index.vue +57 -56
- package/dist/runtime/components/Form/InputNumber/index.vue +20 -20
- package/dist/runtime/components/Form/InputSelect/index.vue +46 -46
- package/dist/runtime/components/Form/InputSelectMultiple/index.vue +62 -62
- package/dist/runtime/components/Form/InputTags/index.vue +54 -54
- package/dist/runtime/components/Form/InputTextarea/index.vue +18 -18
- package/dist/runtime/components/Form/InputTime/index.vue +38 -38
- package/dist/runtime/components/Form/InputToggle/index.vue +17 -17
- package/dist/runtime/components/Form/InputUploadDropzone/index.vue +30 -30
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue +50 -50
- package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.vue +50 -50
- package/dist/runtime/components/Form/InputUploadImageAuto/index.vue +50 -50
- package/dist/runtime/components/Form/InputWYSIWYG/EditorImageUploadExtension.d.ts +9 -0
- package/dist/runtime/components/Form/InputWYSIWYG/EditorImageUploadExtension.js +38 -0
- package/dist/runtime/components/Form/InputWYSIWYG/EditorImageUploadNode.d.vue.ts +4 -0
- package/dist/runtime/components/Form/InputWYSIWYG/EditorImageUploadNode.vue +104 -0
- package/dist/runtime/components/Form/InputWYSIWYG/EditorImageUploadNode.vue.d.ts +4 -0
- package/dist/runtime/components/Form/InputWYSIWYG/EditorLinkPopover.d.vue.ts +8 -0
- package/dist/runtime/components/Form/InputWYSIWYG/EditorLinkPopover.vue +147 -0
- package/dist/runtime/components/Form/InputWYSIWYG/EditorLinkPopover.vue.d.ts +8 -0
- package/dist/runtime/components/Form/InputWYSIWYG/index.d.vue.ts +14 -2
- package/dist/runtime/components/Form/InputWYSIWYG/index.vue +309 -210
- package/dist/runtime/components/Form/InputWYSIWYG/index.vue.d.ts +14 -2
- package/dist/runtime/components/Form/InputWYSIWYG/types.d.ts +12 -52
- package/dist/runtime/components/Form/fileState/EmptyState.vue +21 -21
- package/dist/runtime/components/Form/fileState/FailedState.vue +33 -33
- package/dist/runtime/components/Form/fileState/LoadingState.vue +24 -24
- package/dist/runtime/components/Form/fileState/MultipleFilesState.vue +75 -75
- package/dist/runtime/components/Form/fileState/PreviewModal.vue +23 -23
- package/dist/runtime/components/Form/index.vue +5 -5
- package/dist/runtime/components/Image.vue +28 -28
- package/dist/runtime/components/Log/index.vue +17 -17
- package/dist/runtime/components/Table/ColumnDate.vue +1 -1
- package/dist/runtime/components/Table/ColumnDateTime.vue +1 -1
- package/dist/runtime/components/Table/ColumnImage.vue +4 -4
- package/dist/runtime/components/Table/ColumnText.vue +1 -1
- package/dist/runtime/components/Table/Pagination.vue +46 -46
- package/dist/runtime/components/Table/Simple.vue +16 -16
- package/dist/runtime/server/tsconfig.json +3 -3
- package/package.json +3 -11
- package/dist/runtime/components/Form/InputWYSIWYG/UploadImageForm.d.vue.ts +0 -12
- package/dist/runtime/components/Form/InputWYSIWYG/UploadImageForm.vue +0 -38
- package/dist/runtime/components/Form/InputWYSIWYG/UploadImageForm.vue.d.ts +0 -12
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, ref, watch } from "vue";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
editor: { type: Object, required: true },
|
|
5
|
+
autoOpen: { type: Boolean, required: false }
|
|
6
|
+
});
|
|
7
|
+
const open = ref(false);
|
|
8
|
+
const url = ref("");
|
|
9
|
+
const active = computed(() => props.editor.isActive("link"));
|
|
10
|
+
const disabled = computed(() => {
|
|
11
|
+
if (!props.editor.isEditable) return true;
|
|
12
|
+
const {
|
|
13
|
+
selection
|
|
14
|
+
} = props.editor.state;
|
|
15
|
+
return selection.empty && !props.editor.isActive("link");
|
|
16
|
+
});
|
|
17
|
+
watch(() => props.editor, (editor, _, onCleanup) => {
|
|
18
|
+
if (!editor) return;
|
|
19
|
+
const updateUrl = () => {
|
|
20
|
+
const {
|
|
21
|
+
href
|
|
22
|
+
} = editor.getAttributes("link");
|
|
23
|
+
url.value = href || "";
|
|
24
|
+
};
|
|
25
|
+
updateUrl();
|
|
26
|
+
editor.on("selectionUpdate", updateUrl);
|
|
27
|
+
onCleanup(() => {
|
|
28
|
+
editor.off("selectionUpdate", updateUrl);
|
|
29
|
+
});
|
|
30
|
+
}, {
|
|
31
|
+
immediate: true
|
|
32
|
+
});
|
|
33
|
+
watch(active, (isActive) => {
|
|
34
|
+
if (isActive && props.autoOpen) {
|
|
35
|
+
open.value = true;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
const setLink = () => {
|
|
39
|
+
if (!url.value) return;
|
|
40
|
+
const {
|
|
41
|
+
selection
|
|
42
|
+
} = props.editor.state;
|
|
43
|
+
const isEmpty = selection.empty;
|
|
44
|
+
const hasCode = props.editor.isActive("code");
|
|
45
|
+
let chain = props.editor.chain().focus();
|
|
46
|
+
if (hasCode && !isEmpty) {
|
|
47
|
+
chain = chain.extendMarkRange("code").setLink({
|
|
48
|
+
href: url.value
|
|
49
|
+
});
|
|
50
|
+
} else {
|
|
51
|
+
chain = chain.extendMarkRange("link").setLink({
|
|
52
|
+
href: url.value
|
|
53
|
+
});
|
|
54
|
+
if (isEmpty) {
|
|
55
|
+
chain = chain.insertContent({
|
|
56
|
+
type: "text",
|
|
57
|
+
text: url.value
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
chain.run();
|
|
62
|
+
open.value = false;
|
|
63
|
+
};
|
|
64
|
+
const removeLink = () => {
|
|
65
|
+
props.editor.chain().focus().extendMarkRange("link").unsetLink().setMeta("preventAutolink", true).run();
|
|
66
|
+
url.value = "";
|
|
67
|
+
open.value = false;
|
|
68
|
+
};
|
|
69
|
+
const openLink = () => {
|
|
70
|
+
if (!url.value) return;
|
|
71
|
+
window.open(url.value, "_blank", "noopener,noreferrer");
|
|
72
|
+
};
|
|
73
|
+
const handleKeyDown = (event) => {
|
|
74
|
+
if (event.key === "Enter") {
|
|
75
|
+
event.preventDefault();
|
|
76
|
+
setLink();
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
</script>
|
|
80
|
+
|
|
81
|
+
<template>
|
|
82
|
+
<Popover
|
|
83
|
+
v-model:open="open"
|
|
84
|
+
:ui="{ content: 'p-0.5' }"
|
|
85
|
+
>
|
|
86
|
+
<Tooltip text="Link">
|
|
87
|
+
<Button
|
|
88
|
+
icon="i-lucide-link"
|
|
89
|
+
color="neutral"
|
|
90
|
+
active-color="primary"
|
|
91
|
+
variant="ghost"
|
|
92
|
+
active-variant="soft"
|
|
93
|
+
size="sm"
|
|
94
|
+
:active="active"
|
|
95
|
+
:disabled="disabled"
|
|
96
|
+
/>
|
|
97
|
+
</Tooltip>
|
|
98
|
+
|
|
99
|
+
<template #content>
|
|
100
|
+
<Input
|
|
101
|
+
v-model="url"
|
|
102
|
+
autofocus
|
|
103
|
+
name="url"
|
|
104
|
+
type="url"
|
|
105
|
+
variant="none"
|
|
106
|
+
placeholder="Paste a link..."
|
|
107
|
+
@keydown="handleKeyDown"
|
|
108
|
+
>
|
|
109
|
+
<div class="mr-0.5 flex items-center">
|
|
110
|
+
<Button
|
|
111
|
+
icon="i-lucide-corner-down-left"
|
|
112
|
+
variant="ghost"
|
|
113
|
+
size="sm"
|
|
114
|
+
:disabled="!url && !active"
|
|
115
|
+
title="Apply link"
|
|
116
|
+
@click="setLink"
|
|
117
|
+
/>
|
|
118
|
+
|
|
119
|
+
<Separator
|
|
120
|
+
orientation="vertical"
|
|
121
|
+
class="mx-1 h-6"
|
|
122
|
+
/>
|
|
123
|
+
|
|
124
|
+
<Button
|
|
125
|
+
icon="i-lucide-external-link"
|
|
126
|
+
color="neutral"
|
|
127
|
+
variant="ghost"
|
|
128
|
+
size="sm"
|
|
129
|
+
:disabled="!url && !active"
|
|
130
|
+
title="Open in new window"
|
|
131
|
+
@click="openLink"
|
|
132
|
+
/>
|
|
133
|
+
|
|
134
|
+
<Button
|
|
135
|
+
icon="i-lucide-trash"
|
|
136
|
+
color="neutral"
|
|
137
|
+
variant="ghost"
|
|
138
|
+
size="sm"
|
|
139
|
+
:disabled="!url && !active"
|
|
140
|
+
title="Remove link"
|
|
141
|
+
@click="removeLink"
|
|
142
|
+
/>
|
|
143
|
+
</div>
|
|
144
|
+
</Input>
|
|
145
|
+
</template>
|
|
146
|
+
</Popover>
|
|
147
|
+
</template>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/vue-3';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
editor: Editor;
|
|
4
|
+
autoOpen?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import type { IWYSIWYGFieldProps } from '#core/components/Form/InputWYSIWYG/types';
|
|
2
2
|
declare const __VLS_export: import("vue").DefineComponent<IWYSIWYGFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IWYSIWYGFieldProps> & Readonly<{}>, {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
image: {
|
|
4
|
+
requestOptions?: Omit<import("axios").AxiosRequestConfig, "baseURL"> & {
|
|
5
|
+
baseURL: string;
|
|
6
|
+
};
|
|
7
|
+
uploadPathURL?: string;
|
|
8
|
+
bodyKey?: string;
|
|
9
|
+
responseURL?: string;
|
|
10
|
+
responsePath?: string;
|
|
11
|
+
responseName?: string;
|
|
12
|
+
responseSize?: string;
|
|
13
|
+
responseID?: string;
|
|
14
|
+
maxSize?: number;
|
|
15
|
+
};
|
|
16
|
+
editable: boolean;
|
|
5
17
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
18
|
declare const _default: typeof __VLS_export;
|
|
7
19
|
export default _default;
|