@hywax/cms 1.10.1 → 2.0.1
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/.nuxt/cms/config.ts +6 -0
- package/.nuxt/cms/editor/uplora-image.ts +5 -0
- package/.nuxt/cms/index.ts +4 -1
- package/.nuxt/cms/input-seo.ts +5 -0
- package/.nuxt/cms/input-slug.ts +5 -0
- package/.nuxt/cms/input-uplora-image.ts +27 -0
- package/.nuxt/cms.css +18 -30
- package/dist/module.d.mts +20 -5
- package/dist/module.json +1 -1
- package/dist/module.mjs +287 -96
- package/dist/runtime/components/AutocompleteSelect.d.vue.ts +3 -3
- package/dist/runtime/components/AutocompleteSelect.vue.d.ts +3 -3
- package/dist/runtime/components/ButtonCopyText.d.vue.ts +2 -2
- package/dist/runtime/components/ButtonCopyText.vue.d.ts +2 -2
- package/dist/runtime/components/ButtonDeleteConfirm.vue +3 -3
- package/dist/runtime/components/DatePicker.d.vue.ts +3 -3
- package/dist/runtime/components/DatePicker.vue +1 -2
- package/dist/runtime/components/DatePicker.vue.d.ts +3 -3
- package/dist/runtime/components/EditorFull.d.vue.ts +7 -6
- package/dist/runtime/components/EditorFull.vue +23 -8
- package/dist/runtime/components/EditorFull.vue.d.ts +7 -6
- package/dist/runtime/components/FormPanelAsideSection.vue +2 -1
- package/dist/runtime/components/FormPanelSection.vue +2 -1
- package/dist/runtime/components/InputSeo.d.vue.ts +20 -0
- package/dist/runtime/components/InputSeo.vue +74 -0
- package/dist/runtime/components/InputSeo.vue.d.ts +20 -0
- package/dist/runtime/components/InputSlug.d.vue.ts +30 -0
- package/dist/runtime/components/InputSlug.vue +71 -0
- package/dist/runtime/components/InputSlug.vue.d.ts +30 -0
- package/dist/runtime/components/InputUploraImage.d.vue.ts +40 -0
- package/dist/runtime/components/InputUploraImage.vue +181 -0
- package/dist/runtime/components/InputUploraImage.vue.d.ts +40 -0
- package/dist/runtime/components/ModalConfirm.d.vue.ts +0 -1
- package/dist/runtime/components/ModalConfirm.vue +2 -4
- package/dist/runtime/components/ModalConfirm.vue.d.ts +0 -1
- package/dist/runtime/components/TableColumnVisibility.vue +1 -2
- package/dist/runtime/components/TableFilters.d.vue.ts +1 -1
- package/dist/runtime/components/TableFilters.vue +12 -11
- package/dist/runtime/components/TableFilters.vue.d.ts +1 -1
- package/dist/runtime/components/TablePanel.vue +6 -6
- package/dist/runtime/components/UploraImage.d.vue.ts +2 -1
- package/dist/runtime/components/UploraImage.vue +7 -4
- package/dist/runtime/components/UploraImage.vue.d.ts +2 -1
- package/dist/runtime/components/prose/UploraImage.d.vue.ts +3 -3
- package/dist/runtime/components/prose/UploraImage.vue +11 -5
- package/dist/runtime/components/prose/UploraImage.vue.d.ts +3 -3
- package/dist/runtime/composables/useEditorDragHandle.d.ts +2 -1
- package/dist/runtime/composables/useEditorDragHandle.js +2 -2
- package/dist/runtime/composables/useEditorSuggestions.d.ts +7 -1
- package/dist/runtime/composables/useEditorSuggestions.js +2 -1
- package/dist/runtime/composables/useEditorToolbar.d.ts +2 -1
- package/dist/runtime/composables/useFormState.js +2 -2
- package/dist/runtime/composables/useModal.js +1 -1
- package/dist/runtime/composables/useSeoStats.d.ts +12 -0
- package/dist/runtime/composables/useSeoStats.js +44 -0
- package/dist/runtime/composables/useTable.d.ts +1 -2
- package/dist/runtime/composables/useTable.js +2 -2
- package/dist/runtime/composables/useTableColumns.js +1 -2
- package/dist/runtime/editor/uplora-image/EditorUploraImage.d.ts +18 -0
- package/dist/runtime/editor/uplora-image/EditorUploraImage.js +43 -0
- package/dist/runtime/editor/uplora-image/EditorUploraImageNode.d.vue.ts +9 -0
- package/dist/runtime/editor/uplora-image/EditorUploraImageNode.vue +28 -0
- package/dist/runtime/editor/uplora-image/EditorUploraImageNode.vue.d.ts +9 -0
- package/dist/runtime/editor/utils.d.ts +13 -0
- package/dist/runtime/editor/utils.js +73 -0
- package/dist/runtime/index.css +1 -1
- package/dist/runtime/server/api/uplora/index.post.d.ts +1 -0
- package/dist/runtime/server/api/uplora/index.post.js +1 -0
- package/dist/runtime/types/index.d.ts +36 -3
- package/dist/runtime/types/index.js +36 -1
- package/dist/runtime/types/tv.d.ts +1 -1
- package/dist/runtime/utils/date.d.ts +0 -4
- package/dist/runtime/utils/date.js +0 -15
- package/dist/runtime/utils/formatters.d.ts +2 -1
- package/dist/runtime/utils/index.d.ts +0 -1
- package/dist/runtime/utils/index.js +0 -1
- package/dist/runtime/utils/slugify.js +2 -1
- package/dist/types.d.mts +2 -0
- package/package.json +19 -25
- package/cli/commands/make/component.mjs +0 -75
- package/cli/commands/make/index.mjs +0 -12
- package/cli/index.mjs +0 -15
- package/cli/package.json +0 -13
- package/cli/templates.mjs +0 -102
- package/cli/utils.mjs +0 -31
- package/dist/runtime/composables/useRowSelection.d.ts +0 -8
- package/dist/runtime/composables/useRowSelection.js +0 -46
- package/dist/runtime/types/dictionaries.d.ts +0 -1
- package/dist/runtime/types/dictionaries.js +0 -0
- package/dist/runtime/utils/features.d.ts +0 -4
- package/dist/runtime/utils/features.js +0 -13
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
3
|
+
<template v-if="modelValue.image">
|
|
4
|
+
<UPopover
|
|
5
|
+
:content="{ align: 'center', side: 'top', sideOffset: 8 }"
|
|
6
|
+
:ui="{ content: 'p-1' }"
|
|
7
|
+
>
|
|
8
|
+
<CUploraImage
|
|
9
|
+
:image="modelValue.image"
|
|
10
|
+
:alt="modelValue.alt"
|
|
11
|
+
:color="modelValue.color"
|
|
12
|
+
:lqip="modelValue.lqip"
|
|
13
|
+
:class="ui.image({ class: [props.ui?.image] })"
|
|
14
|
+
/>
|
|
15
|
+
|
|
16
|
+
<div v-if="!modelValue.alt" :class="ui.imageActionsWarning({ class: [props.ui?.imageActionsWarning] })">
|
|
17
|
+
<UIcon :name="appConfig.ui.icons.warning" class="size-4" />
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<template #content>
|
|
21
|
+
<div class="flex items-center gap-0.5">
|
|
22
|
+
<UPopover :ui="{ content: 'p-1' }" @update:open="syncState">
|
|
23
|
+
<UButton
|
|
24
|
+
color="neutral"
|
|
25
|
+
size="sm"
|
|
26
|
+
variant="ghost"
|
|
27
|
+
:icon="appConfig.ui.icons.editLine"
|
|
28
|
+
/>
|
|
29
|
+
<template #content>
|
|
30
|
+
<UTextarea
|
|
31
|
+
v-model="state.alt"
|
|
32
|
+
placeholder="Введите описание..."
|
|
33
|
+
autoresize
|
|
34
|
+
variant="none"
|
|
35
|
+
size="xs"
|
|
36
|
+
/>
|
|
37
|
+
</template>
|
|
38
|
+
</UPopover>
|
|
39
|
+
|
|
40
|
+
<UButton
|
|
41
|
+
color="neutral"
|
|
42
|
+
size="sm"
|
|
43
|
+
variant="ghost"
|
|
44
|
+
:icon="appConfig.ui.icons.refresh"
|
|
45
|
+
@click="resetState()"
|
|
46
|
+
/>
|
|
47
|
+
|
|
48
|
+
<ButtonDeleteConfirm
|
|
49
|
+
color="error"
|
|
50
|
+
size="sm"
|
|
51
|
+
variant="ghost"
|
|
52
|
+
label=""
|
|
53
|
+
:icon="appConfig.ui.icons.trash"
|
|
54
|
+
@confirm="deleteExecute(modelValue.image)"
|
|
55
|
+
/>
|
|
56
|
+
</div>
|
|
57
|
+
</template>
|
|
58
|
+
</UPopover>
|
|
59
|
+
</template>
|
|
60
|
+
<div v-else :id="id" :class="ui.uploader({ class: [props.ui?.uploader] })">
|
|
61
|
+
<template v-if="uploadStatus === 'pending'">
|
|
62
|
+
<UIcon :name="appConfig.ui.icons.loading" :class="ui.uploaderPendingIcon({ class: [props.ui?.uploaderPendingIcon] })" />
|
|
63
|
+
</template>
|
|
64
|
+
<template v-else-if="uploadStatus === 'idle'">
|
|
65
|
+
<button
|
|
66
|
+
type="button"
|
|
67
|
+
:class="ui.uploaderIdleButton({ class: [props.ui?.uploaderIdleButton] })"
|
|
68
|
+
:disabled="disabled"
|
|
69
|
+
v-bind="ariaAttrs"
|
|
70
|
+
@click="open"
|
|
71
|
+
>
|
|
72
|
+
<UAvatar :icon="appConfig.ui.icons.image" size="lg" />
|
|
73
|
+
|
|
74
|
+
<p :class="ui.uploaderIdleText({ class: [props.ui?.uploaderIdleText] })">
|
|
75
|
+
Загрузить изображение
|
|
76
|
+
</p>
|
|
77
|
+
<p :class="ui.uploaderIdleExtensions({ class: [props.ui?.uploaderIdleExtensions] })">
|
|
78
|
+
{{ extensions }}
|
|
79
|
+
</p>
|
|
80
|
+
</button>
|
|
81
|
+
</template>
|
|
82
|
+
<template v-else-if="uploadStatus === 'error'">
|
|
83
|
+
<p :class="ui.uploaderErrorText({ class: [props.ui?.uploaderErrorText] })">
|
|
84
|
+
Произошла ошибка при загрузке изображения
|
|
85
|
+
</p>
|
|
86
|
+
<div :class="ui.uploaderErrorActions({ class: [props.ui?.uploaderErrorActions] })">
|
|
87
|
+
<UButton
|
|
88
|
+
label="Отменить"
|
|
89
|
+
variant="ghost"
|
|
90
|
+
color="neutral"
|
|
91
|
+
@click="resetUpload"
|
|
92
|
+
/>
|
|
93
|
+
<UButton
|
|
94
|
+
label="Повторить"
|
|
95
|
+
variant="soft"
|
|
96
|
+
color="neutral"
|
|
97
|
+
@click="uploadExecute"
|
|
98
|
+
/>
|
|
99
|
+
</div>
|
|
100
|
+
</template>
|
|
101
|
+
</div>
|
|
102
|
+
</Primitive>
|
|
103
|
+
</template>
|
|
104
|
+
|
|
105
|
+
<script>
|
|
106
|
+
import theme from "#build/cms/input-uplora-image";
|
|
107
|
+
import { useAppConfig, useFormField, useUploraDelete, useUploraUpload } from "#imports";
|
|
108
|
+
import { imagesExtensions } from "@uplora/formats";
|
|
109
|
+
import { Primitive } from "reka-ui";
|
|
110
|
+
import { computed, reactive, useId } from "vue";
|
|
111
|
+
import { tv } from "../tv";
|
|
112
|
+
import ButtonDeleteConfirm from "./ButtonDeleteConfirm.vue";
|
|
113
|
+
</script>
|
|
114
|
+
|
|
115
|
+
<script setup>
|
|
116
|
+
const props = defineProps({
|
|
117
|
+
showExtensions: { type: Boolean, required: false, default: true },
|
|
118
|
+
id: { type: String, required: false },
|
|
119
|
+
name: { type: String, required: false },
|
|
120
|
+
disabled: { type: Boolean, required: false },
|
|
121
|
+
as: { type: null, required: false },
|
|
122
|
+
class: { type: null, required: false },
|
|
123
|
+
ui: { type: null, required: false }
|
|
124
|
+
});
|
|
125
|
+
const emit = defineEmits(["upload", "delete"]);
|
|
126
|
+
const modelValue = defineModel({ type: Object, ...{
|
|
127
|
+
default: () => ({
|
|
128
|
+
image: void 0,
|
|
129
|
+
alt: void 0,
|
|
130
|
+
lqip: void 0,
|
|
131
|
+
color: void 0
|
|
132
|
+
})
|
|
133
|
+
} });
|
|
134
|
+
const appConfig = useAppConfig();
|
|
135
|
+
const extensions = computed(() => imagesExtensions.filter((extension) => extension !== "jpeg").join(", "));
|
|
136
|
+
const state = reactive({
|
|
137
|
+
alt: modelValue.value.alt
|
|
138
|
+
});
|
|
139
|
+
const { id: _id, disabled, emitFormChange, emitFormInput, ariaAttrs } = useFormField(props);
|
|
140
|
+
const id = _id.value ?? useId();
|
|
141
|
+
const { open, execute: uploadExecute, status: uploadStatus, reset: resetUpload, onUploaded } = useUploraUpload({
|
|
142
|
+
accept: "image/*"
|
|
143
|
+
});
|
|
144
|
+
const { execute: deleteExecute, onDeleted } = useUploraDelete();
|
|
145
|
+
function syncState() {
|
|
146
|
+
modelValue.value = {
|
|
147
|
+
...modelValue.value,
|
|
148
|
+
alt: state.alt || void 0
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
function resetState() {
|
|
152
|
+
modelValue.value = {
|
|
153
|
+
image: void 0,
|
|
154
|
+
alt: void 0,
|
|
155
|
+
lqip: void 0,
|
|
156
|
+
color: void 0
|
|
157
|
+
};
|
|
158
|
+
emitFormChange();
|
|
159
|
+
emitFormInput();
|
|
160
|
+
}
|
|
161
|
+
onUploaded((file) => {
|
|
162
|
+
modelValue.value = {
|
|
163
|
+
...modelValue.value,
|
|
164
|
+
image: file.id,
|
|
165
|
+
lqip: file.lqip,
|
|
166
|
+
color: file.color
|
|
167
|
+
};
|
|
168
|
+
emit("upload", modelValue.value);
|
|
169
|
+
emitFormChange();
|
|
170
|
+
emitFormInput();
|
|
171
|
+
});
|
|
172
|
+
onDeleted(() => {
|
|
173
|
+
resetUpload();
|
|
174
|
+
resetState();
|
|
175
|
+
emit("delete");
|
|
176
|
+
});
|
|
177
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.cms?.inputUploraImage || {} })({
|
|
178
|
+
disabled: disabled.value,
|
|
179
|
+
uploaded: modelValue.value.image !== ""
|
|
180
|
+
}));
|
|
181
|
+
</script>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
2
|
+
import type { ComponentConfig } from '../types';
|
|
3
|
+
import theme from '#build/cms/input-uplora-image';
|
|
4
|
+
type InputUploraImage = ComponentConfig<typeof theme, AppConfig, 'inputUploraImage'>;
|
|
5
|
+
export interface InputUploraImageProps {
|
|
6
|
+
showExtensions?: boolean;
|
|
7
|
+
id?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
as?: any;
|
|
11
|
+
class?: any;
|
|
12
|
+
ui?: InputUploraImage['slots'];
|
|
13
|
+
}
|
|
14
|
+
export interface InputUploraImageEmits {
|
|
15
|
+
upload: [InputUploraImageModelValue];
|
|
16
|
+
delete: [];
|
|
17
|
+
}
|
|
18
|
+
export interface InputUploraImageModelValue {
|
|
19
|
+
image?: string;
|
|
20
|
+
alt?: string;
|
|
21
|
+
color?: string;
|
|
22
|
+
lqip?: string;
|
|
23
|
+
}
|
|
24
|
+
declare const _default: typeof __VLS_export;
|
|
25
|
+
export default _default;
|
|
26
|
+
declare const __VLS_export: import("vue").DefineComponent<InputUploraImageProps & {
|
|
27
|
+
modelValue?: InputUploraImageModelValue;
|
|
28
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
29
|
+
delete: () => any;
|
|
30
|
+
"update:modelValue": (value: InputUploraImageModelValue) => any;
|
|
31
|
+
upload: (args_0: InputUploraImageModelValue) => any;
|
|
32
|
+
}, string, import("vue").PublicProps, Readonly<InputUploraImageProps & {
|
|
33
|
+
modelValue?: InputUploraImageModelValue;
|
|
34
|
+
}> & Readonly<{
|
|
35
|
+
onDelete?: (() => any) | undefined;
|
|
36
|
+
"onUpdate:modelValue"?: ((value: InputUploraImageModelValue) => any) | undefined;
|
|
37
|
+
onUpload?: ((args_0: InputUploraImageModelValue) => any) | undefined;
|
|
38
|
+
}>, {
|
|
39
|
+
showExtensions: boolean;
|
|
40
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -48,7 +48,6 @@
|
|
|
48
48
|
:disabled="state.confirmTextValue !== confirmText"
|
|
49
49
|
:loading="form?.loading"
|
|
50
50
|
:color="color"
|
|
51
|
-
:variant="variant"
|
|
52
51
|
:size="size"
|
|
53
52
|
/>
|
|
54
53
|
<UButton
|
|
@@ -56,7 +55,6 @@
|
|
|
56
55
|
label="Подтвердить"
|
|
57
56
|
loading-auto
|
|
58
57
|
:color="color"
|
|
59
|
-
:variant="variant"
|
|
60
58
|
:size="size"
|
|
61
59
|
@click="handleConfirmClick()"
|
|
62
60
|
/>
|
|
@@ -66,7 +64,8 @@
|
|
|
66
64
|
|
|
67
65
|
<script>
|
|
68
66
|
import theme from "#build/cms/modal-confirm";
|
|
69
|
-
import {
|
|
67
|
+
import { useAppConfig } from "#imports";
|
|
68
|
+
import { computed, reactive, useTemplateRef } from "vue";
|
|
70
69
|
import { tv } from "../tv";
|
|
71
70
|
</script>
|
|
72
71
|
|
|
@@ -77,7 +76,6 @@ const props = defineProps({
|
|
|
77
76
|
confirmText: { type: String, required: false },
|
|
78
77
|
confirmLabel: { type: String, required: false, default: "\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C" },
|
|
79
78
|
color: { type: null, required: false },
|
|
80
|
-
variant: { type: null, required: false },
|
|
81
79
|
size: { type: null, required: false, default: "lg" },
|
|
82
80
|
onConfirm: { type: Function, required: false },
|
|
83
81
|
class: { type: null, required: false },
|
|
@@ -47,11 +47,10 @@
|
|
|
47
47
|
</template>
|
|
48
48
|
|
|
49
49
|
<script setup>
|
|
50
|
-
import { useAppConfig, useRoute } from "#imports";
|
|
50
|
+
import { getCmsStorageKey, useAppConfig, useRoute } from "#imports";
|
|
51
51
|
import { syncRef, useLocalStorage } from "@vueuse/core";
|
|
52
52
|
import { useSortable } from "@vueuse/integrations/useSortable";
|
|
53
53
|
import { computed, ref, useTemplateRef, watch } from "vue";
|
|
54
|
-
import { getCmsStorageKey } from "../utils";
|
|
55
54
|
const props = defineProps({
|
|
56
55
|
storageKey: { type: String, required: false, default: () => useRoute().name },
|
|
57
56
|
table: { type: Object, required: false }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FormData, FormFieldProps, FormProps, FormSchema, SelectItem, SelectProps, SelectValue } from '@nuxt/ui';
|
|
2
2
|
import type { MaybeRef, VNode } from 'vue';
|
|
3
3
|
import type { KeysMatching } from '../types';
|
|
4
|
-
import type {
|
|
4
|
+
import type { DatePickerProps } from './DatePicker.vue';
|
|
5
5
|
type EnumSelectItem = SelectValue | Required<Pick<Extract<SelectItem, object>, 'value' | 'label'>>;
|
|
6
6
|
interface Presets {
|
|
7
7
|
Input: {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
<UButton
|
|
54
54
|
color="neutral"
|
|
55
55
|
label="Сбросить"
|
|
56
|
-
variant="
|
|
56
|
+
variant="ghost"
|
|
57
57
|
@click="reset"
|
|
58
58
|
/>
|
|
59
59
|
|
|
@@ -69,55 +69,56 @@
|
|
|
69
69
|
</template>
|
|
70
70
|
|
|
71
71
|
<script>
|
|
72
|
-
import {
|
|
72
|
+
import { UCheckbox, UForm, UInput, USelect, USwitch } from "#components";
|
|
73
73
|
import { useAppConfig } from "#imports";
|
|
74
74
|
import { useCloned } from "@vueuse/core";
|
|
75
|
-
import copy from "fast-copy";
|
|
75
|
+
import { copy } from "fast-copy";
|
|
76
76
|
import { deepEqual } from "fast-equals";
|
|
77
77
|
import { computed, h, nextTick, ref, toValue, unref, useId, useTemplateRef, watch } from "vue";
|
|
78
|
+
import CDatePicker from "./DatePicker.vue";
|
|
78
79
|
const presets = {
|
|
79
|
-
Date: (state, field) => h(
|
|
80
|
+
Date: (state, field) => h(CDatePicker, {
|
|
80
81
|
"modelValue": state[field.name],
|
|
81
82
|
"withTime": toValue(field.withTime),
|
|
82
83
|
"onUpdate:modelValue": (value) => state[field.name] = value
|
|
83
84
|
}),
|
|
84
|
-
DateRange: (state, field) => h(
|
|
85
|
+
DateRange: (state, field) => h(CDatePicker, {
|
|
85
86
|
"modelValue": state[field.name],
|
|
86
87
|
"range": true,
|
|
87
88
|
"withTime": unref(field.withTime),
|
|
88
89
|
"onUpdate:modelValue": (value) => state[field.name] = value
|
|
89
90
|
}),
|
|
90
|
-
Input: (state, field) => h(
|
|
91
|
+
Input: (state, field) => h(UInput, {
|
|
91
92
|
"modelValue": state[field.name],
|
|
92
93
|
"modelModifiers": { trim: true, optional: true },
|
|
93
94
|
"placeholder": unref(field.placeholder) ?? `\u0412\u0432\u0435\u0434\u0438\u0442\u0435 ${field.label?.toLowerCase() ?? "\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"}`,
|
|
94
95
|
"onUpdate:modelValue": (value) => state[field.name] = value
|
|
95
96
|
}, {}),
|
|
96
|
-
InputNumber: (state, field) => h(
|
|
97
|
+
InputNumber: (state, field) => h(UInput, {
|
|
97
98
|
"modelValue": state[field.name],
|
|
98
99
|
"modelModifiers": { number: true, optional: true },
|
|
99
100
|
"placeholder": unref(field.placeholder) ?? `\u0412\u0432\u0435\u0434\u0438\u0442\u0435 ${field.label?.toLowerCase() ?? "\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"}`,
|
|
100
101
|
"onUpdate:modelValue": (value) => state[field.name] = value
|
|
101
102
|
}, {}),
|
|
102
|
-
Select: (state, field) => h(
|
|
103
|
+
Select: (state, field) => h(USelect, {
|
|
103
104
|
"modelValue": state[field.name],
|
|
104
105
|
"items": unref(field.items),
|
|
105
106
|
"placeholder": unref(field.placeholder) ?? `\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 ${field.label?.toLowerCase() ?? "\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"}`,
|
|
106
107
|
"onUpdate:modelValue": (value) => state[field.name] = value
|
|
107
108
|
}, {}),
|
|
108
|
-
MultiSelect: (state, field) => h(
|
|
109
|
+
MultiSelect: (state, field) => h(USelect, {
|
|
109
110
|
"modelValue": state[field.name],
|
|
110
111
|
"items": unref(field.items),
|
|
111
112
|
"placeholder": unref(field.placeholder) ?? `\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 ${field.label?.toLowerCase() ?? "\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"}`,
|
|
112
113
|
"multiple": true,
|
|
113
114
|
"onUpdate:modelValue": (value) => state[field.name] = value
|
|
114
115
|
}, {}),
|
|
115
|
-
Checkbox: (state, field) => h(
|
|
116
|
+
Checkbox: (state, field) => h(UCheckbox, {
|
|
116
117
|
"modelValue": state[field.name],
|
|
117
118
|
"label": unref(field.label),
|
|
118
119
|
"onUpdate:modelValue": (value) => state[field.name] = Boolean(value) || void 0
|
|
119
120
|
}),
|
|
120
|
-
Switch: (state, field) => h(
|
|
121
|
+
Switch: (state, field) => h(USwitch, {
|
|
121
122
|
"modelValue": state[field.name],
|
|
122
123
|
"label": unref(field.label),
|
|
123
124
|
"onUpdate:modelValue": (value) => state[field.name] = value || void 0
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FormData, FormFieldProps, FormProps, FormSchema, SelectItem, SelectProps, SelectValue } from '@nuxt/ui';
|
|
2
2
|
import type { MaybeRef, VNode } from 'vue';
|
|
3
3
|
import type { KeysMatching } from '../types';
|
|
4
|
-
import type {
|
|
4
|
+
import type { DatePickerProps } from './DatePicker.vue';
|
|
5
5
|
type EnumSelectItem = SelectValue | Required<Pick<Extract<SelectItem, object>, 'value' | 'label'>>;
|
|
6
6
|
interface Presets {
|
|
7
7
|
Input: {
|
|
@@ -128,15 +128,15 @@
|
|
|
128
128
|
|
|
129
129
|
<script>
|
|
130
130
|
import theme from "#build/cms/table-panel";
|
|
131
|
-
import {
|
|
132
|
-
import { useAppConfig } from "#imports";
|
|
133
|
-
import { useOverlay } from "@nuxt/ui/composables/useOverlay";
|
|
131
|
+
import { UButton, UCheckbox, UDropdownMenu, UTable } from "#components";
|
|
132
|
+
import { useAppConfig, useOverlay } from "#imports";
|
|
134
133
|
import { getGroupedRowModel } from "@tanstack/vue-table";
|
|
135
134
|
import { reactivePick } from "@vueuse/core";
|
|
136
135
|
import { defu } from "defu";
|
|
137
136
|
import { useForwardProps } from "reka-ui";
|
|
138
137
|
import { computed, h, ref, useTemplateRef, watch } from "vue";
|
|
139
138
|
import { tv } from "../tv";
|
|
139
|
+
import CModalConfirm from "./ModalConfirm.vue";
|
|
140
140
|
import TableColumnSorting from "./TableColumnSorting.vue";
|
|
141
141
|
import TableColumnVisibility from "./TableColumnVisibility.vue";
|
|
142
142
|
import TableFilters from "./TableFilters.vue";
|
|
@@ -187,7 +187,7 @@ watch(() => props.resetRowSelection && props.data, (value) => {
|
|
|
187
187
|
watch(() => props.data, () => {
|
|
188
188
|
tableRef.value?.tableRef?.parentElement?.scrollTo({ top: 0 });
|
|
189
189
|
});
|
|
190
|
-
const modalConfirm = useOverlay().create(
|
|
190
|
+
const modalConfirm = useOverlay().create(CModalConfirm);
|
|
191
191
|
function createActionCell(action) {
|
|
192
192
|
if (action.visibility && !action.visibility()) {
|
|
193
193
|
return;
|
|
@@ -205,7 +205,7 @@ function createActionCell(action) {
|
|
|
205
205
|
onClick: () => modalConfirm.open(defu(action.delete, {
|
|
206
206
|
title: "\u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435",
|
|
207
207
|
message: "\u0412\u044B \u0434\u0435\u0438\u0306\u0441\u0442\u0432\u0438\u0442\u0435\u043B\u044C\u043D\u043E \u0445\u043E\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043B\u0438\u0442\u044C \u044D\u043B\u0435\u043C\u0435\u043D\u0442?",
|
|
208
|
-
|
|
208
|
+
color: "error"
|
|
209
209
|
}))
|
|
210
210
|
};
|
|
211
211
|
}
|
|
@@ -229,7 +229,7 @@ const tableColumns = computed(() => {
|
|
|
229
229
|
return;
|
|
230
230
|
}
|
|
231
231
|
return h(
|
|
232
|
-
|
|
232
|
+
UDropdownMenu,
|
|
233
233
|
{
|
|
234
234
|
items,
|
|
235
235
|
content: { align: "end" }
|
|
@@ -5,10 +5,11 @@ import theme from '#build/cms/uplora-image';
|
|
|
5
5
|
export type UploraImage = ComponentConfig<typeof theme, AppConfig, 'uploraImage'>;
|
|
6
6
|
export interface UploraImageProps {
|
|
7
7
|
image: string;
|
|
8
|
-
alt
|
|
8
|
+
alt?: string;
|
|
9
9
|
formats?: ImageFormat[];
|
|
10
10
|
sizes?: ImageSize[];
|
|
11
11
|
lqip?: string;
|
|
12
|
+
color?: string;
|
|
12
13
|
loading?: 'lazy' | 'eager';
|
|
13
14
|
preload?: boolean | {
|
|
14
15
|
fetchPriority: 'auto' | 'high' | 'low';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<figure :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
3
3
|
<div
|
|
4
|
-
v-if="lqip"
|
|
4
|
+
v-if="lqip || color"
|
|
5
5
|
:class="ui.lqip({ class: props.ui?.lqip })"
|
|
6
6
|
:style="{
|
|
7
|
-
|
|
7
|
+
backgroundColor: color,
|
|
8
|
+
backgroundImage: lqip ? `url(${lqip})` : void 0
|
|
8
9
|
}"
|
|
9
10
|
/>
|
|
10
11
|
<picture :class="ui.picture({ class: props.ui?.picture })">
|
|
@@ -32,7 +33,8 @@
|
|
|
32
33
|
|
|
33
34
|
<script>
|
|
34
35
|
import theme from "#build/cms/uplora-image";
|
|
35
|
-
import {
|
|
36
|
+
import { useAppConfig, useHead, useNuxtApp } from "#imports";
|
|
37
|
+
import { computed, onMounted, useTemplateRef } from "vue";
|
|
36
38
|
import { tv } from "../tv";
|
|
37
39
|
import { buildUploraImage } from "../utils";
|
|
38
40
|
</script>
|
|
@@ -40,10 +42,11 @@ import { buildUploraImage } from "../utils";
|
|
|
40
42
|
<script setup>
|
|
41
43
|
const props = defineProps({
|
|
42
44
|
image: { type: String, required: true },
|
|
43
|
-
alt: { type: String, required:
|
|
45
|
+
alt: { type: String, required: false },
|
|
44
46
|
formats: { type: Array, required: false },
|
|
45
47
|
sizes: { type: Array, required: false },
|
|
46
48
|
lqip: { type: String, required: false },
|
|
49
|
+
color: { type: String, required: false },
|
|
47
50
|
loading: { type: String, required: false, default: "lazy" },
|
|
48
51
|
preload: { type: [Boolean, Object], required: false },
|
|
49
52
|
nonce: { type: String, required: false },
|
|
@@ -5,10 +5,11 @@ import theme from '#build/cms/uplora-image';
|
|
|
5
5
|
export type UploraImage = ComponentConfig<typeof theme, AppConfig, 'uploraImage'>;
|
|
6
6
|
export interface UploraImageProps {
|
|
7
7
|
image: string;
|
|
8
|
-
alt
|
|
8
|
+
alt?: string;
|
|
9
9
|
formats?: ImageFormat[];
|
|
10
10
|
sizes?: ImageSize[];
|
|
11
11
|
lqip?: string;
|
|
12
|
+
color?: string;
|
|
12
13
|
loading?: 'lazy' | 'eager';
|
|
13
14
|
preload?: boolean | {
|
|
14
15
|
fetchPriority: 'auto' | 'high' | 'low';
|
|
@@ -3,9 +3,9 @@ import type { ComponentConfig } from '../../types';
|
|
|
3
3
|
import theme from '#build/cms/prose/uplora-image';
|
|
4
4
|
export type ProseUploraImage = ComponentConfig<typeof theme, AppConfig, 'uploraImage', 'cms.prose'>;
|
|
5
5
|
export interface ProseUploraImageProps {
|
|
6
|
-
image
|
|
7
|
-
alt
|
|
8
|
-
|
|
6
|
+
image?: string;
|
|
7
|
+
alt?: string;
|
|
8
|
+
color?: string;
|
|
9
9
|
class?: any;
|
|
10
10
|
ui?: ProseUploraImage['slots'];
|
|
11
11
|
}
|
|
@@ -4,25 +4,31 @@
|
|
|
4
4
|
:image="image"
|
|
5
5
|
:class="ui.base({ class: [props.ui?.base, props.class] })"
|
|
6
6
|
:alt="alt"
|
|
7
|
-
:
|
|
7
|
+
:color="color"
|
|
8
|
+
:formats="formats"
|
|
9
|
+
:sizes="sizes"
|
|
8
10
|
/>
|
|
9
11
|
</template>
|
|
10
12
|
|
|
11
13
|
<script>
|
|
12
14
|
import theme from "#build/cms/prose/uplora-image";
|
|
13
|
-
import {
|
|
15
|
+
import { getCmsConfig, useAppConfig } from "#imports";
|
|
16
|
+
import { computed } from "vue";
|
|
14
17
|
import { tv } from "../../tv";
|
|
15
18
|
import BaseUploraImage from "../UploraImage.vue";
|
|
16
19
|
</script>
|
|
17
20
|
|
|
18
21
|
<script setup>
|
|
19
22
|
const props = defineProps({
|
|
20
|
-
image: { type: String, required:
|
|
21
|
-
alt: { type: String, required:
|
|
22
|
-
|
|
23
|
+
image: { type: String, required: false },
|
|
24
|
+
alt: { type: String, required: false },
|
|
25
|
+
color: { type: String, required: false },
|
|
23
26
|
class: { type: null, required: false },
|
|
24
27
|
ui: { type: null, required: false }
|
|
25
28
|
});
|
|
26
29
|
const appConfig = useAppConfig();
|
|
30
|
+
const cmsConfig = getCmsConfig();
|
|
31
|
+
const formats = cmsConfig?.prose?.uploraImage?.formats.length > 0 ? cmsConfig?.prose?.uploraImage?.formats : void 0;
|
|
32
|
+
const sizes = cmsConfig?.prose?.uploraImage?.sizes.length > 0 ? cmsConfig?.prose?.uploraImage?.sizes : void 0;
|
|
27
33
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.cms?.prose?.uploraImage || {} })());
|
|
28
34
|
</script>
|
|
@@ -3,9 +3,9 @@ import type { ComponentConfig } from '../../types';
|
|
|
3
3
|
import theme from '#build/cms/prose/uplora-image';
|
|
4
4
|
export type ProseUploraImage = ComponentConfig<typeof theme, AppConfig, 'uploraImage', 'cms.prose'>;
|
|
5
5
|
export interface ProseUploraImageProps {
|
|
6
|
-
image
|
|
7
|
-
alt
|
|
8
|
-
|
|
6
|
+
image?: string;
|
|
7
|
+
alt?: string;
|
|
8
|
+
color?: string;
|
|
9
9
|
class?: any;
|
|
10
10
|
ui?: ProseUploraImage['slots'];
|
|
11
11
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { DropdownMenuItem, EditorCustomHandlers } from '@nuxt/ui';
|
|
2
2
|
import type { Editor, JSONContent } from '@tiptap/vue-3';
|
|
3
|
-
|
|
3
|
+
import type { MaybeRefOrGetter } from 'vue';
|
|
4
|
+
export declare function useEditorDragHandle<T extends EditorCustomHandlers>(customHandlers?: MaybeRefOrGetter<T>): {
|
|
4
5
|
selectedNode: import("vue").Ref<{
|
|
5
6
|
node: JSONContent | null;
|
|
6
7
|
pos: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useAppConfig } from "#imports";
|
|
2
2
|
import { mapEditorItems } from "@nuxt/ui/utils/editor";
|
|
3
3
|
import { upperFirst } from "scule";
|
|
4
|
-
import { ref } from "vue";
|
|
4
|
+
import { ref, toValue } from "vue";
|
|
5
5
|
export function useEditorDragHandle(customHandlers) {
|
|
6
6
|
const appConfig = useAppConfig();
|
|
7
7
|
const selectedNode = ref();
|
|
@@ -82,7 +82,7 @@ export function useEditorDragHandle(customHandlers) {
|
|
|
82
82
|
icon: appConfig.ui.icons.trash
|
|
83
83
|
}
|
|
84
84
|
]
|
|
85
|
-
], customHandlers);
|
|
85
|
+
], toValue(customHandlers));
|
|
86
86
|
};
|
|
87
87
|
const onNodeChange = (event) => {
|
|
88
88
|
selectedNode.value = event;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { EditorCustomHandlers } from '@nuxt/ui';
|
|
2
|
-
|
|
2
|
+
import type { MaybeRefOrGetter } from 'vue';
|
|
3
|
+
export declare function useEditorSuggestions<T extends EditorCustomHandlers>(_customHandlers?: MaybeRefOrGetter<T>): {
|
|
3
4
|
items: (({
|
|
4
5
|
type: "label";
|
|
5
6
|
label: string;
|
|
@@ -64,5 +65,10 @@ export declare function useEditorSuggestions<T extends EditorCustomHandlers>(_cu
|
|
|
64
65
|
label: string;
|
|
65
66
|
icon: any;
|
|
66
67
|
type?: undefined;
|
|
68
|
+
} | {
|
|
69
|
+
kind: "uplora-image";
|
|
70
|
+
label: string;
|
|
71
|
+
icon: any;
|
|
72
|
+
type?: undefined;
|
|
67
73
|
})[])[];
|
|
68
74
|
};
|
|
@@ -15,7 +15,8 @@ export function useEditorSuggestions(_customHandlers) {
|
|
|
15
15
|
],
|
|
16
16
|
[
|
|
17
17
|
{ type: "label", label: "\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C" },
|
|
18
|
-
{ kind: "horizontalRule", label: "\u0413\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u0430\u044F \u043B\u0438\u043D\u0438\u044F", icon: appConfig.ui.icons.horizontalRule }
|
|
18
|
+
{ kind: "horizontalRule", label: "\u0413\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u0430\u044F \u043B\u0438\u043D\u0438\u044F", icon: appConfig.ui.icons.horizontalRule },
|
|
19
|
+
{ kind: "uplora-image", label: "\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435", icon: appConfig.ui.icons.image }
|
|
19
20
|
]
|
|
20
21
|
];
|
|
21
22
|
return {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { EditorCustomHandlers, EditorToolbarItem } from '@nuxt/ui';
|
|
2
2
|
import type { Editor } from '@tiptap/vue-3';
|
|
3
|
-
|
|
3
|
+
import type { MaybeRefOrGetter } from 'vue';
|
|
4
|
+
export declare function useEditorToolbar<T extends EditorCustomHandlers>(_customHandlers?: MaybeRefOrGetter<T>): {
|
|
4
5
|
toolbarItems: EditorToolbarItem<T>[][];
|
|
5
6
|
bubbleToolbarItems: import("vue").ComputedRef<({
|
|
6
7
|
label: string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createEventHook, useCloned } from "@vueuse/core";
|
|
2
|
-
import
|
|
2
|
+
import { copy } from "fast-copy";
|
|
3
3
|
import { computed, ref, toValue } from "vue";
|
|
4
4
|
import { useNotification } from "./useNotification.js";
|
|
5
5
|
export function useFormState(schema, source = {}, options) {
|
|
6
6
|
const notification = useNotification();
|
|
7
7
|
const submitHook = createEventHook();
|
|
8
|
-
const { cloned: state, isModified, sync: reset } = useCloned(source, { clone });
|
|
8
|
+
const { cloned: state, isModified, sync: reset } = useCloned(source, { clone: copy });
|
|
9
9
|
const isLoading = ref(false);
|
|
10
10
|
const onSubmit = async (event) => {
|
|
11
11
|
isLoading.value = true;
|