sprintify-ui 0.10.13 → 0.10.15
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/README.md +4 -2
- package/dist/BaseCkeditor-C9d4NSCx.js +113 -0
- package/dist/sprintify-ui.es.js +14283 -81751
- package/dist/style.css +3 -3
- package/dist/types/components/BaseActionButtons.vue.d.ts +1 -1
- package/dist/types/components/BaseActionItem.vue.d.ts +7 -10
- package/dist/types/components/BaseAddressForm.vue.d.ts +1 -1
- package/dist/types/components/BaseAlert.vue.d.ts +24 -11
- package/dist/types/components/BaseApp.vue.d.ts +14 -12
- package/dist/types/components/BaseAssign.vue.d.ts +1 -1
- package/dist/types/components/BaseAutocomplete.vue.d.ts +642 -452
- package/dist/types/components/BaseAutocompleteDrawer.vue.d.ts +117 -22
- package/dist/types/components/BaseAutocompleteFetch.vue.d.ts +1029 -410
- package/dist/types/components/BaseAvatar.vue.d.ts +1 -1
- package/dist/types/components/BaseAvatarGroup.vue.d.ts +1 -1
- package/dist/types/components/BaseBadge.vue.d.ts +23 -11
- package/dist/types/components/BaseBelongsTo.vue.d.ts +985 -409
- package/dist/types/components/BaseBelongsToFetch.vue.d.ts +750 -369
- package/dist/types/components/BaseBoolean.vue.d.ts +1 -1
- package/dist/types/components/BaseBreadcrumbs.vue.d.ts +1 -1
- package/dist/types/components/BaseButton.vue.d.ts +57 -13
- package/dist/types/components/BaseButtonGroup.vue.d.ts +166 -15
- package/dist/types/components/BaseCard.vue.d.ts +26 -12
- package/dist/types/components/BaseCardRow.vue.d.ts +20 -11
- package/dist/types/components/BaseCharacterCounter.vue.d.ts +1 -1
- package/dist/types/components/BaseCkeditor.vue.d.ts +32 -0
- package/dist/types/components/BaseClipboard.vue.d.ts +45 -13
- package/dist/types/components/BaseCollapse.vue.d.ts +41 -20
- package/dist/types/components/BaseContainer.vue.d.ts +16 -11
- package/dist/types/components/BaseCounter.vue.d.ts +1 -1
- package/dist/types/components/BaseCropper.vue.d.ts +55 -30
- package/dist/types/components/BaseDataIterator.vue.d.ts +43 -42
- package/dist/types/components/BaseDataIteratorSectionBox.vue.d.ts +15 -12
- package/dist/types/components/BaseDataIteratorSectionColumns.vue.d.ts +1 -1
- package/dist/types/components/BaseDataIteratorSectionModal.vue.d.ts +19 -10
- package/dist/types/components/BaseDataTable.vue.d.ts +2045 -735
- package/dist/types/components/BaseDataTableTemplate.vue.d.ts +563 -100
- package/dist/types/components/BaseDatePicker.vue.d.ts +1 -1
- package/dist/types/components/BaseDateSelect.vue.d.ts +1 -1
- package/dist/types/components/BaseDescriptionList.vue.d.ts +12 -12
- package/dist/types/components/BaseDescriptionListItem.vue.d.ts +16 -15
- package/dist/types/components/BaseDialog.vue.d.ts +114 -407
- package/dist/types/components/BaseDisplayRelativeTime.vue.d.ts +55 -13
- package/dist/types/components/BaseDraggable.vue.d.ts +21 -17
- package/dist/types/components/BaseDropdown.vue.d.ts +155 -17
- package/dist/types/components/BaseDropdownAutocomplete.vue.d.ts +134 -19
- package/dist/types/components/BaseField.vue.d.ts +103 -12
- package/dist/types/components/BaseFieldI18n.vue.d.ts +1 -1
- package/dist/types/components/BaseFilePicker.vue.d.ts +35 -16
- package/dist/types/components/BaseFilePickerCrop.vue.d.ts +87 -42
- package/dist/types/components/BaseFileUploader.vue.d.ts +195 -29
- package/dist/types/components/BaseForm.vue.d.ts +161 -20
- package/dist/types/components/BaseGantt.vue.d.ts +1130 -409
- package/dist/types/components/BaseHasMany.vue.d.ts +586 -345
- package/dist/types/components/BaseHasManyFetch.vue.d.ts +598 -249
- package/dist/types/components/BaseHeader.vue.d.ts +1 -1
- package/dist/types/components/BaseIconPicker.vue.d.ts +1 -1
- package/dist/types/components/BaseInputError.vue.d.ts +23 -11
- package/dist/types/components/BaseJsonReaderItem.vue.d.ts +1 -1
- package/dist/types/components/BaseLayoutNotificationItemContent.vue.d.ts +1 -1
- package/dist/types/components/BaseLayoutSidebar.vue.d.ts +127 -16
- package/dist/types/components/BaseLayoutSidebarConfigurable.vue.d.ts +115 -13
- package/dist/types/components/BaseLayoutStacked.vue.d.ts +69 -22
- package/dist/types/components/BaseLayoutStackedConfigurable.vue.d.ts +120 -10
- package/dist/types/components/BaseLazy.vue.d.ts +20 -15
- package/dist/types/components/BaseMediaGallery.vue.d.ts +1 -1
- package/dist/types/components/BaseMediaGalleryItem.vue.d.ts +1 -1
- package/dist/types/components/BaseMediaItem.vue.d.ts +1 -1
- package/dist/types/components/BaseMediaLibrary.vue.d.ts +234 -34
- package/dist/types/components/BaseMediaList.vue.d.ts +1 -1
- package/dist/types/components/BaseMediaListItem.vue.d.ts +1 -1
- package/dist/types/components/BaseMediaPictures.vue.d.ts +1 -1
- package/dist/types/components/BaseMediaPicturesItem.vue.d.ts +1 -1
- package/dist/types/components/BaseMenu.vue.d.ts +233 -30
- package/dist/types/components/BaseMenuItem.vue.d.ts +1 -1
- package/dist/types/components/BaseModalCenter.vue.d.ts +88 -12
- package/dist/types/components/BaseModalSide.vue.d.ts +72 -12
- package/dist/types/components/BaseNavbar.vue.d.ts +88 -22
- package/dist/types/components/BaseNavbarItem.vue.d.ts +1 -1
- package/dist/types/components/BaseNavbarItemContent.vue.d.ts +1 -1
- package/dist/types/components/BaseNavbarSideItem.vue.d.ts +1 -1
- package/dist/types/components/BaseNavbarSideItemContent.vue.d.ts +1 -1
- package/dist/types/components/BasePagination.vue.d.ts +1 -1
- package/dist/types/components/BaseRadioGroup.vue.d.ts +113 -13
- package/dist/types/components/BaseReadMore.vue.d.ts +31 -12
- package/dist/types/components/BaseRichText.vue.d.ts +1 -1
- package/dist/types/components/BaseSelect.vue.d.ts +149 -12
- package/dist/types/components/BaseShortcut.vue.d.ts +1 -1
- package/dist/types/components/BaseSideNavigation.vue.d.ts +11 -12
- package/dist/types/components/BaseSideNavigationItem.vue.d.ts +22 -13
- package/dist/types/components/BaseSkeleton.vue.d.ts +3 -3
- package/dist/types/components/BaseStepper.vue.d.ts +1 -1
- package/dist/types/components/BaseSwitch.vue.d.ts +118 -10
- package/dist/types/components/BaseSystemAlert.vue.d.ts +58 -11
- package/dist/types/components/BaseTabItem.vue.d.ts +25 -16
- package/dist/types/components/BaseTable.vue.d.ts +29 -14
- package/dist/types/components/BaseTableBody.vue.d.ts +9 -12
- package/dist/types/components/BaseTableCell.vue.d.ts +40 -15
- package/dist/types/components/BaseTableColumn.vue.d.ts +2 -2
- package/dist/types/components/BaseTableHead.vue.d.ts +14 -12
- package/dist/types/components/BaseTableHeader.vue.d.ts +25 -14
- package/dist/types/components/BaseTableRow.vue.d.ts +40 -13
- package/dist/types/components/BaseTabs.vue.d.ts +16 -15
- package/dist/types/components/BaseTagAutocomplete.vue.d.ts +578 -199
- package/dist/types/components/BaseTagAutocompleteFetch.vue.d.ts +803 -346
- package/dist/types/components/BaseTextareaAutoresize.vue.d.ts +1 -1
- package/dist/types/components/BaseTimeline.vue.d.ts +1 -1
- package/dist/types/components/BaseTimelineItem.vue.d.ts +1 -1
- package/dist/types/components/BaseToast.vue.d.ts +1 -1
- package/dist/types/components/BaseTooltip.vue.d.ts +41 -15
- package/dist/types/components/BaseUniqueCode.vue.d.ts +1 -1
- package/dist/types/stories/PageInputSizes.vue.d.ts +1 -1
- package/dist/types/stories/PageShow.vue.d.ts +1 -1
- package/dist/types/svg/BaseEmptyState.vue.d.ts +1 -1
- package/dist/types/svg/BaseSpinnerSmall.vue.d.ts +1 -1
- package/package.json +3 -4
- package/src/components/BaseCkeditor.vue +137 -0
- package/src/components/BaseRichText.vue +10 -100
|
@@ -125,5 +125,5 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
125
125
|
maxHeight: number;
|
|
126
126
|
submitOnEnter: boolean;
|
|
127
127
|
twTextarea: string | string[];
|
|
128
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {},
|
|
128
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
129
129
|
export default _default;
|
|
@@ -10,5 +10,5 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
10
10
|
required: true;
|
|
11
11
|
type: PropType<TimelineItem[]>;
|
|
12
12
|
};
|
|
13
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {},
|
|
13
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
14
14
|
export default _default;
|
|
@@ -10,5 +10,5 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
10
10
|
required: true;
|
|
11
11
|
type: PropType<TimelineItem>;
|
|
12
12
|
};
|
|
13
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {},
|
|
13
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
14
14
|
export default _default;
|
|
@@ -2,5 +2,5 @@ type __VLS_Props = {
|
|
|
2
2
|
text: string;
|
|
3
3
|
color: string;
|
|
4
4
|
};
|
|
5
|
-
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {},
|
|
5
|
+
declare const _default: 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>;
|
|
6
6
|
export default _default;
|
|
@@ -13,19 +13,45 @@ type __VLS_Props = {
|
|
|
13
13
|
dark?: boolean;
|
|
14
14
|
offset?: number;
|
|
15
15
|
};
|
|
16
|
-
declare
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
declare const targetRef: import("vue").Ref<HTMLElement | null, HTMLElement | null>;
|
|
17
|
+
declare const tooltipRef: import("vue").Ref<HTMLElement | null, HTMLElement | null>;
|
|
18
|
+
declare const floatingStyles: Readonly<import("vue").Ref<{
|
|
19
|
+
position: import("@floating-ui/utils").Strategy;
|
|
20
|
+
top: string;
|
|
21
|
+
left: string;
|
|
22
|
+
transform?: string;
|
|
23
|
+
willChange?: string;
|
|
24
|
+
}, {
|
|
25
|
+
position: import("@floating-ui/utils").Strategy;
|
|
26
|
+
top: string;
|
|
27
|
+
left: string;
|
|
28
|
+
transform?: string;
|
|
29
|
+
willChange?: string;
|
|
30
|
+
}>>, showTooltip: import("vue").Ref<boolean, boolean>;
|
|
31
|
+
declare const classInternal: import("vue").ComputedRef<(string | string[] | null)[]>;
|
|
32
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
33
|
+
declare var __VLS_1: {}, __VLS_11: {};
|
|
34
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
35
|
+
default?: (props: typeof __VLS_1) => any;
|
|
36
|
+
} & {
|
|
37
|
+
tooltip?: (props: typeof __VLS_11) => any;
|
|
38
|
+
}>;
|
|
39
|
+
declare const __VLS_self: import("vue").DefineComponent<__VLS_Props, {
|
|
40
|
+
targetRef: typeof targetRef;
|
|
41
|
+
tooltipRef: typeof tooltipRef;
|
|
42
|
+
floatingStyles: typeof floatingStyles;
|
|
43
|
+
showTooltip: typeof showTooltip;
|
|
44
|
+
classInternal: typeof classInternal;
|
|
45
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
46
|
+
dark: boolean;
|
|
47
|
+
class: string | string[] | null;
|
|
48
|
+
text: string | null;
|
|
49
|
+
visible: boolean;
|
|
50
|
+
floatingOptions: UseFloatingOptions;
|
|
51
|
+
interactive: boolean;
|
|
52
|
+
delay: number;
|
|
53
|
+
offset: number;
|
|
54
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
55
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
30
56
|
dark: boolean;
|
|
31
57
|
class: string | string[] | null;
|
|
@@ -36,9 +62,9 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}
|
|
|
36
62
|
delay: number;
|
|
37
63
|
offset: number;
|
|
38
64
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
39
|
-
declare const _default:
|
|
65
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
40
66
|
export default _default;
|
|
41
|
-
type
|
|
67
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
42
68
|
new (): {
|
|
43
69
|
$slots: S;
|
|
44
70
|
};
|
|
@@ -31,5 +31,5 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
31
31
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
32
32
|
}>, {
|
|
33
33
|
type: "numeric" | "alphanumeric";
|
|
34
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {},
|
|
34
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
35
35
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {},
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {},
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {},
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {},
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
2
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sprintify-ui",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "rimraf dist && vue-tsc && vite build",
|
|
@@ -15,11 +15,13 @@
|
|
|
15
15
|
"vue-tsc": "vue-tsc"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
|
+
"@ckeditor/ckeditor5-vue": "^7.3.0",
|
|
18
19
|
"@tailwindcss/aspect-ratio": "^0.4.2",
|
|
19
20
|
"@tailwindcss/forms": "^0.5.3",
|
|
20
21
|
"@tailwindcss/typography": "^0.5.8",
|
|
21
22
|
"@vueuse/core": "^10.0.0",
|
|
22
23
|
"axios": "^0.26.1",
|
|
24
|
+
"ckeditor5": "^44.1.0",
|
|
23
25
|
"croppie": "^2.6.5",
|
|
24
26
|
"flatpickr": "^4.6.13",
|
|
25
27
|
"humanize-duration": "^3.0.0",
|
|
@@ -35,11 +37,8 @@
|
|
|
35
37
|
"vue-router": "^4.0.0"
|
|
36
38
|
},
|
|
37
39
|
"dependencies": {
|
|
38
|
-
"@ckeditor/ckeditor5-image": "^44.1.0",
|
|
39
|
-
"@ckeditor/ckeditor5-vue": "^7.3.0",
|
|
40
40
|
"@floating-ui/vue": "^1.0.6",
|
|
41
41
|
"@headlessui/vue": "^1.7.19",
|
|
42
|
-
"ckeditor5": "^44.1.0",
|
|
43
42
|
"color2k": "^2.0.3",
|
|
44
43
|
"tailwind-merge": "^2.4.0"
|
|
45
44
|
},
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ckeditor
|
|
3
|
+
:model-value="modelValueInternal"
|
|
4
|
+
:editor="editorInternal"
|
|
5
|
+
:config="config"
|
|
6
|
+
:disabled="disabled"
|
|
7
|
+
:name="name"
|
|
8
|
+
@update:model-value="emit('update:modelValue', $event)"
|
|
9
|
+
@focus="emit('focus', $event)"
|
|
10
|
+
@blur="emit('blur', $event)"
|
|
11
|
+
@input="emit('input', $event)"
|
|
12
|
+
/>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script lang="ts" setup>
|
|
16
|
+
import { ClassicEditor, InlineEditor, BalloonEditor, Essentials, MediaEmbed, Paragraph, Bold, Italic, List, Link, Autoformat, Heading, Underline, Code, CodeBlock, Table, TableToolbar, Image, ImageResize, ImageStyle, ImageToolbar, ImageInsert, AutoImage, Base64UploadAdapter, PasteFromOffice, BlockToolbar, Font, FindAndReplace, RemoveFormat } from 'ckeditor5';
|
|
17
|
+
import { Ckeditor } from '@ckeditor/ckeditor5-vue';
|
|
18
|
+
|
|
19
|
+
import { Size } from '@/utils/sizes';
|
|
20
|
+
import { ToolbarOption } from '@/types/ToolbarOption';
|
|
21
|
+
|
|
22
|
+
const props = withDefaults(defineProps<{
|
|
23
|
+
modelValue: string | null | undefined;
|
|
24
|
+
editor?: 'classic' | 'inline' | 'balloon';
|
|
25
|
+
size?: Size;
|
|
26
|
+
toolbar?: ToolbarOption[];
|
|
27
|
+
placeholder?: string;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
required?: boolean;
|
|
30
|
+
name?: string;
|
|
31
|
+
}>(), {
|
|
32
|
+
editor: 'classic',
|
|
33
|
+
size: 'md',
|
|
34
|
+
toolbar() {
|
|
35
|
+
return ['undo', 'redo', '|', 'heading', 'bold', 'italic', 'underline', '|', 'link', 'insertImage', '|', 'numberedList', 'bulletedList', '|', 'code', 'codeblock', '|', 'insertTable'] as ToolbarOption[];
|
|
36
|
+
},
|
|
37
|
+
placeholder: '',
|
|
38
|
+
disabled: false,
|
|
39
|
+
required: false,
|
|
40
|
+
name: '',
|
|
41
|
+
hasError: false,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const emit = defineEmits(['update:modelValue', 'focus', 'blur', 'input']);
|
|
45
|
+
|
|
46
|
+
const editorInternal = computed(() => {
|
|
47
|
+
switch (props.editor) {
|
|
48
|
+
case 'inline':
|
|
49
|
+
return InlineEditor;
|
|
50
|
+
case 'balloon':
|
|
51
|
+
return BalloonEditor;
|
|
52
|
+
default:
|
|
53
|
+
return ClassicEditor;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const modelValueInternal = computed(() => {
|
|
58
|
+
if (props.modelValue === null) {
|
|
59
|
+
return '';
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return props.modelValue;
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const config = computed(() => {
|
|
66
|
+
return {
|
|
67
|
+
licenseKey: 'GPL',
|
|
68
|
+
plugins: [
|
|
69
|
+
Essentials,
|
|
70
|
+
Paragraph,
|
|
71
|
+
Bold,
|
|
72
|
+
Italic,
|
|
73
|
+
Underline,
|
|
74
|
+
Code,
|
|
75
|
+
CodeBlock,
|
|
76
|
+
List,
|
|
77
|
+
Link,
|
|
78
|
+
Autoformat,
|
|
79
|
+
Heading,
|
|
80
|
+
Image,
|
|
81
|
+
AutoImage,
|
|
82
|
+
ImageStyle,
|
|
83
|
+
ImageResize,
|
|
84
|
+
ImageToolbar,
|
|
85
|
+
ImageInsert,
|
|
86
|
+
Base64UploadAdapter,
|
|
87
|
+
Table,
|
|
88
|
+
TableToolbar,
|
|
89
|
+
MediaEmbed,
|
|
90
|
+
PasteFromOffice,
|
|
91
|
+
BlockToolbar,
|
|
92
|
+
Font,
|
|
93
|
+
FindAndReplace,
|
|
94
|
+
RemoveFormat,
|
|
95
|
+
],
|
|
96
|
+
toolbar: {
|
|
97
|
+
items: props.toolbar,
|
|
98
|
+
shouldNotGroupWhenFull: true,
|
|
99
|
+
},
|
|
100
|
+
table: {
|
|
101
|
+
contentToolbar: ['tableColumn', 'tableRow']
|
|
102
|
+
},
|
|
103
|
+
image: {
|
|
104
|
+
resizeOptions: [
|
|
105
|
+
{
|
|
106
|
+
name: 'resizeImage:original',
|
|
107
|
+
label: 'Default image width',
|
|
108
|
+
value: null
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'resizeImage:50',
|
|
112
|
+
label: '50% page width',
|
|
113
|
+
value: '50'
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: 'resizeImage:75',
|
|
117
|
+
label: '75% page width',
|
|
118
|
+
value: '75'
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: 'resizeImage:100',
|
|
122
|
+
label: '100% page width',
|
|
123
|
+
value: '100'
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
toolbar: [
|
|
127
|
+
'imageStyle:alignBlockLeft',
|
|
128
|
+
'imageStyle:block',
|
|
129
|
+
'imageStyle:alignBlockRight',
|
|
130
|
+
'resizeImage'
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
placeholder: props.placeholder,
|
|
134
|
+
};
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
</script>
|
|
@@ -10,11 +10,14 @@
|
|
|
10
10
|
sizeInternal == 'xl' ? 'base-rich-text-xl' : '',
|
|
11
11
|
]"
|
|
12
12
|
>
|
|
13
|
-
<
|
|
14
|
-
:model-value="
|
|
15
|
-
:editor="
|
|
16
|
-
:
|
|
17
|
-
:
|
|
13
|
+
<BaseCkeditor
|
|
14
|
+
:model-value="modelValue"
|
|
15
|
+
:editor="editor"
|
|
16
|
+
:size="sizeInternal"
|
|
17
|
+
:toolbar="toolbar"
|
|
18
|
+
:placeholder="placeholder"
|
|
19
|
+
:disabled="disabled"
|
|
20
|
+
:required="requiredInternal"
|
|
18
21
|
:name="nameInternal"
|
|
19
22
|
@update:model-value="emitUpdate"
|
|
20
23
|
@focus="emit('focus', $event)"
|
|
@@ -26,13 +29,11 @@
|
|
|
26
29
|
|
|
27
30
|
<script lang="ts" setup>
|
|
28
31
|
import { useField } from '@/composables/field';
|
|
29
|
-
|
|
30
|
-
import { ClassicEditor, InlineEditor, BalloonEditor, Essentials, MediaEmbed, Paragraph, Bold, Italic, List, Link, Autoformat, Heading, Underline, Code, CodeBlock, Table, TableToolbar, Image, ImageResize, ImageStyle, ImageToolbar, ImageInsert, AutoImage, Base64UploadAdapter, PasteFromOffice, BlockToolbar, Font, FindAndReplace, RemoveFormat } from 'ckeditor5';
|
|
31
|
-
import { Ckeditor } from '@ckeditor/ckeditor5-vue';
|
|
32
|
-
|
|
33
32
|
import { Size } from '@/utils/sizes';
|
|
34
33
|
import { ToolbarOption } from '@/types/ToolbarOption';
|
|
35
34
|
|
|
35
|
+
const BaseCkeditor = defineAsyncComponent(() => import('./BaseCkeditor.vue'));
|
|
36
|
+
|
|
36
37
|
const props = withDefaults(defineProps<{
|
|
37
38
|
modelValue: string | null | undefined;
|
|
38
39
|
editor?: 'classic' | 'inline' | 'balloon';
|
|
@@ -58,25 +59,6 @@ const props = withDefaults(defineProps<{
|
|
|
58
59
|
|
|
59
60
|
const emit = defineEmits(['update:modelValue', 'focus', 'blur', 'input']);
|
|
60
61
|
|
|
61
|
-
const editorInternal = computed(() => {
|
|
62
|
-
switch (props.editor) {
|
|
63
|
-
case 'inline':
|
|
64
|
-
return InlineEditor;
|
|
65
|
-
case 'balloon':
|
|
66
|
-
return BalloonEditor;
|
|
67
|
-
default:
|
|
68
|
-
return ClassicEditor;
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
const modelValueInternal = computed(() => {
|
|
73
|
-
if (props.modelValue === null) {
|
|
74
|
-
return '';
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return props.modelValue;
|
|
78
|
-
});
|
|
79
|
-
|
|
80
62
|
const { nameInternal, requiredInternal, hasErrorInternal, emitUpdate, sizeInternal } =
|
|
81
63
|
useField({
|
|
82
64
|
name: computed(() => props.name),
|
|
@@ -86,76 +68,4 @@ const { nameInternal, requiredInternal, hasErrorInternal, emitUpdate, sizeIntern
|
|
|
86
68
|
emit: emit,
|
|
87
69
|
});
|
|
88
70
|
|
|
89
|
-
const config = computed(() => {
|
|
90
|
-
return {
|
|
91
|
-
licenseKey: 'GPL',
|
|
92
|
-
plugins: [
|
|
93
|
-
Essentials,
|
|
94
|
-
Paragraph,
|
|
95
|
-
Bold,
|
|
96
|
-
Italic,
|
|
97
|
-
Underline,
|
|
98
|
-
Code,
|
|
99
|
-
CodeBlock,
|
|
100
|
-
List,
|
|
101
|
-
Link,
|
|
102
|
-
Autoformat,
|
|
103
|
-
Heading,
|
|
104
|
-
Image,
|
|
105
|
-
AutoImage,
|
|
106
|
-
ImageStyle,
|
|
107
|
-
ImageResize,
|
|
108
|
-
ImageToolbar,
|
|
109
|
-
ImageInsert,
|
|
110
|
-
Base64UploadAdapter,
|
|
111
|
-
Table,
|
|
112
|
-
TableToolbar,
|
|
113
|
-
MediaEmbed,
|
|
114
|
-
PasteFromOffice,
|
|
115
|
-
BlockToolbar,
|
|
116
|
-
Font,
|
|
117
|
-
FindAndReplace,
|
|
118
|
-
RemoveFormat,
|
|
119
|
-
],
|
|
120
|
-
toolbar: {
|
|
121
|
-
items: props.toolbar,
|
|
122
|
-
shouldNotGroupWhenFull: true,
|
|
123
|
-
},
|
|
124
|
-
table: {
|
|
125
|
-
contentToolbar: ['tableColumn', 'tableRow']
|
|
126
|
-
},
|
|
127
|
-
image: {
|
|
128
|
-
resizeOptions: [
|
|
129
|
-
{
|
|
130
|
-
name: 'resizeImage:original',
|
|
131
|
-
label: 'Default image width',
|
|
132
|
-
value: null
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
name: 'resizeImage:50',
|
|
136
|
-
label: '50% page width',
|
|
137
|
-
value: '50'
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
name: 'resizeImage:75',
|
|
141
|
-
label: '75% page width',
|
|
142
|
-
value: '75'
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
name: 'resizeImage:100',
|
|
146
|
-
label: '100% page width',
|
|
147
|
-
value: '100'
|
|
148
|
-
}
|
|
149
|
-
],
|
|
150
|
-
toolbar: [
|
|
151
|
-
'imageStyle:alignBlockLeft',
|
|
152
|
-
'imageStyle:block',
|
|
153
|
-
'imageStyle:alignBlockRight',
|
|
154
|
-
'resizeImage'
|
|
155
|
-
]
|
|
156
|
-
},
|
|
157
|
-
placeholder: props.placeholder,
|
|
158
|
-
};
|
|
159
|
-
});
|
|
160
|
-
|
|
161
71
|
</script>
|