cosey 0.1.5 → 0.2.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/README.md +3 -1
- package/components/close/style/index.js +2 -2
- package/components/col/col.vue.js +1 -1
- package/components/col/style/index.js +3 -3
- package/components/config-provider/config-provider.d.ts +2 -0
- package/components/config-provider/config-provider.vue.js +13 -3
- package/components/context-menu/context-menu.vue.js +4 -4
- package/components/context-menu/context-sub-menu.vue.js +2 -2
- package/components/context-menu/style/index.js +2 -2
- package/components/editor/components/color-picker/color-picker.vue.js +15 -11
- package/components/editor/components/color-picker/useHistoryColor.js +3 -3
- package/components/editor/components/resize/resize.js +9 -9
- package/components/editor/components/resize/resize.style.js +20 -20
- package/components/editor/components/resize/resize.vue.js +2 -2
- package/components/editor/components/table-toolbar/table-toolbar.style.js +2 -2
- package/components/editor/components/table-toolbar/table-toolbar.vue.js +2 -2
- package/components/editor/components/toolbar/formats/font.vue.js +5 -1
- package/components/editor/components/toolbar/formats/header.vue.js +6 -2
- package/components/editor/components/toolbar/formats/link.vue.js +17 -13
- package/components/editor/components/toolbar/formats/size.vue.js +5 -1
- package/components/editor/components/toolbar/formats/source.vue.d.ts +2 -0
- package/components/editor/components/toolbar/formats/source.vue.js +78 -0
- package/components/editor/components/toolbar/formats/table.style.js +2 -2
- package/components/editor/components/toolbar/formats/video.vue.js +9 -5
- package/components/editor/components/toolbar/toolbar.vue.js +5 -0
- package/components/editor/formats/font.js +2 -2
- package/components/editor/formats/indent.js +1 -1
- package/components/editor/formats/kbd.d.ts +7 -0
- package/components/editor/formats/kbd.js +13 -0
- package/components/editor/modules/image-uploader/formats/image-loading.style.js +2 -2
- package/components/editor/quill.js +8 -6
- package/components/editor/style/index.js +25 -16
- package/components/field/components/autocomplete/autocomplete.vue.js +5 -1
- package/components/field/components/cascader/cascader.vue.js +5 -1
- package/components/field/components/checkbox-group/checkbox-group.vue.js +1 -1
- package/components/field/components/checkbox-group/panel.vue.js +10 -5
- package/components/field/components/date/date.vue.js +5 -1
- package/components/field/components/date-range/date-range.vue.js +6 -2
- package/components/field/components/date-time/date-time.vue.js +5 -1
- package/components/field/components/date-time-range/date-time-range.vue.js +6 -2
- package/components/field/components/dates/dates.vue.js +5 -1
- package/components/field/components/input/input.vue.js +5 -1
- package/components/field/components/input-tag/input-tag.vue.js +5 -1
- package/components/field/components/mention/mention.vue.js +5 -1
- package/components/field/components/month/month.vue.js +5 -1
- package/components/field/components/month-range/month-range.vue.js +6 -2
- package/components/field/components/months/months.vue.js +5 -1
- package/components/field/components/password/password.vue.js +5 -1
- package/components/field/components/select/select.d.ts +2 -2
- package/components/field/components/select/select.js +3 -3
- package/components/field/components/select/select.vue.js +5 -1
- package/components/field/components/select-v2/select-v2.d.ts +6 -3
- package/components/field/components/select-v2/select-v2.js +9 -0
- package/components/field/components/select-v2/select-v2.vue.js +21 -3
- package/components/field/components/textarea/textarea.vue.js +5 -1
- package/components/field/components/time/time.vue.js +5 -1
- package/components/field/components/time-range/time-range.vue.js +6 -2
- package/components/field/components/time-select/time-select.vue.js +5 -1
- package/components/field/components/tree-select/tree-select.vue.js +5 -1
- package/components/field/components/week/week.vue.js +6 -2
- package/components/field/components/year/year.vue.js +5 -1
- package/components/field/components/year-range/year-range.vue.js +6 -2
- package/components/field/components/years/years.vue.js +5 -1
- package/components/form/form-item.d.ts +1 -1
- package/components/form/form.d.ts +2 -0
- package/components/form/form.js +2 -2
- package/components/form/form.vue.d.ts +5 -0
- package/components/form/form.vue.js +6 -2
- package/components/form/index.d.ts +10 -1
- package/components/form/useBubbleTemplate.js +13 -5
- package/components/form-dialog/form-dialog.js +2 -2
- package/components/form-dialog/index.d.ts +4 -1552
- package/components/form-list/form-list.js +1 -1
- package/components/form-list/form-list.vue.js +5 -1
- package/components/form-list/index.d.ts +1 -1
- package/components/form-query/form-query.d.ts +2 -0
- package/components/form-query/form-query.vue.d.ts +5 -0
- package/components/form-query/form-query.vue.js +13 -7
- package/components/form-query/index.d.ts +9 -0
- package/components/highlight/style/index.js +2 -2
- package/components/horizontal-tree/horizontal-tree.vue.js +11 -6
- package/components/image-card/image-card.d.ts +1 -8
- package/components/image-card/image-card.vue.d.ts +4 -18
- package/components/image-card/index.d.ts +8 -29
- package/components/long-text/style/index.js +2 -2
- package/components/mask/style/index.js +2 -2
- package/components/row/row.vue.js +1 -1
- package/components/scroll-view/scroll-view.vue.js +1 -1
- package/components/scroll-view/style/index.js +9 -9
- package/components/table/index.d.ts +73 -78
- package/components/table/table-column/renderer.d.ts +2 -1
- package/components/table/table-column/renderer.js +2 -2
- package/components/table/table-column/table-column.d.ts +15 -15
- package/components/table/table-column/table-column.vue.d.ts +9 -5
- package/components/table/table-column/table-column.vue.js +5 -1
- package/components/table/table-column-editor/table-column-editor.vue.js +22 -14
- package/components/table/table-export/table-export.vue.js +31 -26
- package/components/table/table-query/table-query.d.ts +2 -0
- package/components/table/table-query/table-query.vue.d.ts +5 -0
- package/components/table/table.d.ts +22 -25
- package/components/table/table.vue.d.ts +45 -51
- package/components/table/table.vue.js +13 -9
- package/components/table/useTable.d.ts +2 -1
- package/components/table/useTable.js +2 -2
- package/components/table-action/index.d.ts +48 -6
- package/components/table-action/item.d.ts +16 -2
- package/components/table-action/item.vue.d.ts +34 -6
- package/components/table-action/item.vue.js +15 -9
- package/components/table-action/table-action.vue.d.ts +16 -2
- package/components/toggle/toggle.vue.js +5 -1
- package/components/upload/style/index.js +2 -2
- package/components/upload/upload-item.vue.d.ts +2 -2
- package/components/upload/upload-item.vue.js +16 -9
- package/components/upload/upload.vue.js +7 -1
- package/config/index.d.ts +1 -2
- package/config/index.js +2 -2
- package/config/nprogress.style.js +5 -5
- package/config/root-config-provider.vue.js +5 -5
- package/constant.d.ts +2 -2
- package/constant.js +2 -2
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +2 -1
- package/hooks/useColorScheme.js +4 -4
- package/hooks/useDir.d.ts +2 -0
- package/hooks/useDir.js +20 -0
- package/hooks/useEcharts.d.ts +3 -2
- package/hooks/useEcharts.js +15 -3
- package/hooks/useLocale.d.ts +23 -371
- package/hooks/useLocale.js +26 -35
- package/hooks/useUpsert.d.ts +5 -3
- package/hooks/useUpsert.js +33 -25
- package/index.d.ts +1 -1
- package/index.js +4 -4
- package/layout/layout-auth/style/index.js +6 -6
- package/layout/layout-breadcrumb/layout-breadcrumb.vue.js +6 -2
- package/layout/layout-change-password/layout-change-password.vue.js +28 -22
- package/layout/layout-content/layout-content.vue.js +1 -1
- package/layout/layout-content/style/index.js +1 -1
- package/layout/layout-forbidden/layout-forbidden.vue.js +11 -6
- package/layout/layout-header/layout-header.vue.js +4 -4
- package/layout/layout-header/style/index.js +3 -3
- package/layout/layout-iframe/style/index.js +2 -2
- package/layout/layout-internal-server-error/layout-internal-server-error.vue.js +11 -6
- package/layout/layout-login/layout-login.vue.js +19 -14
- package/layout/layout-main/layout-main.vue.js +1 -1
- package/layout/layout-menu/layout-menu.vue.js +5 -1
- package/layout/layout-menu/style/index.js +1 -1
- package/layout/layout-not-found/layout-not-found.vue.js +11 -6
- package/layout/layout-search/layout-search.vue.js +22 -14
- package/layout/layout-sidebar/layout-sidebar.vue.js +8 -5
- package/layout/layout-sidebar/style/index.js +2 -2
- package/layout/layout-snug-aside/style/index.js +1 -1
- package/layout/layout-tabbar/layout-tabbar.vue.js +21 -13
- package/layout/layout-tabbar/style/index.js +1 -1
- package/layout/layout-top-snug-menu/layout-top-snug-menu.vue.js +24 -17
- package/layout/layout-user-menu/layout-user-menu.vue.js +10 -6
- package/locale/index.d.ts +10 -0
- package/locale/index.js +2 -0
- package/locale/lang/ar.d.ts +280 -0
- package/locale/lang/ar.js +129 -0
- package/locale/lang/en.d.ts +302 -0
- package/locale/lang/en.js +129 -0
- package/locale/lang/zh-cn.d.ts +301 -0
- package/locale/lang/zh-cn.js +129 -0
- package/package.json +10 -8
- package/request/useRequest.js +31 -23
- package/store/index.d.ts +1 -1
- package/store/index.js +6 -3
- package/store/layout.js +208 -190
- package/store/plugin.d.ts +9 -0
- package/store/plugin.js +22 -0
- package/store/user.d.ts +1 -1
- package/utils/css.d.ts +4 -0
- package/utils/css.js +5 -2
- package/utils/excel/bookFormats.js +5 -5
- package/utils/excel/xlsx.js +2 -2
- package/utils/index.js +1 -1
- package/utils/message-box.js +3 -1
- package/utils/tree.js +2 -2
- package/components/form-dialog/form-dialog.vue.d.ts +0 -675
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<
|
|
2
|
+
<p>
|
|
3
|
+
<img width="160" src="https://fastly.jsdelivr.net/npm/@gunny/files@latest/cosey-logo.svg" />
|
|
4
|
+
</p>
|
|
3
5
|
|
|
4
6
|
<p>一个基于 Vue3 + TypeScript + Vite 的后台管理框架</p>
|
|
5
7
|
|
|
@@ -106,7 +106,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
106
106
|
const colStyle = computed(() => {
|
|
107
107
|
const styles = {};
|
|
108
108
|
if (rowContext.gutter) {
|
|
109
|
-
styles.
|
|
109
|
+
styles.paddingInlineStart = styles.paddingInlineEnd = `${rowContext.gutter / 2}px`;
|
|
110
110
|
}
|
|
111
111
|
return styles;
|
|
112
112
|
});
|
|
@@ -17,15 +17,15 @@ const getColSizeStyle = (token, size) => {
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
[`${prefixCls}-${sizeFrag}offset-${i}`]: {
|
|
20
|
-
|
|
20
|
+
marginInlineStart: 1 / rowColumns * i * 100 + "%"
|
|
21
21
|
},
|
|
22
22
|
[`${prefixCls}-${sizeFrag}pull-${i}`]: {
|
|
23
23
|
position: "relative",
|
|
24
|
-
|
|
24
|
+
insetInlineEnd: 1 / rowColumns * i * 100 + "%"
|
|
25
25
|
},
|
|
26
26
|
[`${prefixCls}-${sizeFrag}push-${i}`]: {
|
|
27
27
|
position: "relative",
|
|
28
|
-
|
|
28
|
+
insetInlineEnd: 1 / rowColumns * i * 100 + "%"
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
}).reduce((mergedCssbject, cssbject) => {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { type ComputedRef } from 'vue';
|
|
2
2
|
import { type TableConfig } from '../table';
|
|
3
3
|
import { type ThemeConfig } from '../theme';
|
|
4
|
+
import { type Language } from '../../locale';
|
|
4
5
|
export interface ConfigProviderProps {
|
|
5
6
|
prefixCls?: string;
|
|
6
7
|
theme?: ThemeConfig;
|
|
7
8
|
table?: TableConfig;
|
|
9
|
+
locale?: Language;
|
|
8
10
|
}
|
|
9
11
|
export interface ConfigProviderInnerProps {
|
|
10
12
|
getPrefixCls: (suffixCls?: string, customizePrefixCls?: string) => string;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { defineComponent, computed, onUnmounted, onMounted, createElementBlock, openBlock, normalizeClass, unref, renderSlot } from 'vue';
|
|
1
|
+
import { defineComponent, computed, provide, watch, onUnmounted, onMounted, createElementBlock, openBlock, normalizeClass, unref, renderSlot } from 'vue';
|
|
2
2
|
import useMergeTheme from './useMergeTheme.js';
|
|
3
3
|
import { useConfig, useConfigProvide } from './config-provider.js';
|
|
4
4
|
import { ThemeManager, useThemeProvide } from '../theme/theme-context.js';
|
|
5
|
-
import stdin_default$
|
|
5
|
+
import stdin_default$2 from './override-element-plus.js';
|
|
6
|
+
import stdin_default$1 from '../../locale/lang/en.js';
|
|
7
|
+
import { localeContextKey, outsideLocale } from '../../hooks/useLocale.js';
|
|
6
8
|
|
|
7
9
|
var stdin_default = /* @__PURE__ */defineComponent({
|
|
8
10
|
...{
|
|
@@ -21,6 +23,10 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
21
23
|
table: {
|
|
22
24
|
type: Object,
|
|
23
25
|
required: false
|
|
26
|
+
},
|
|
27
|
+
locale: {
|
|
28
|
+
type: Object,
|
|
29
|
+
required: false
|
|
24
30
|
}
|
|
25
31
|
},
|
|
26
32
|
setup(__props) {
|
|
@@ -38,6 +44,10 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
38
44
|
prefixCls: mergedPrefixCls
|
|
39
45
|
};
|
|
40
46
|
useConfigProvide(configProvider);
|
|
47
|
+
provide(localeContextKey, computed(() => props.locale));
|
|
48
|
+
watch(() => props.locale, () => {
|
|
49
|
+
outsideLocale.value = props.locale || stdin_default$1;
|
|
50
|
+
});
|
|
41
51
|
const themeManager = new ThemeManager(mergedTheme);
|
|
42
52
|
onUnmounted(() => {
|
|
43
53
|
themeManager.destroy();
|
|
@@ -45,7 +55,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
45
55
|
useThemeProvide(themeManager);
|
|
46
56
|
const {
|
|
47
57
|
hashId
|
|
48
|
-
} = stdin_default$
|
|
58
|
+
} = stdin_default$2(themeManager);
|
|
49
59
|
onMounted(() => {
|
|
50
60
|
if (!parentContext.theme) {
|
|
51
61
|
document.documentElement.classList.add(hashId.value);
|
|
@@ -61,8 +61,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
61
61
|
});
|
|
62
62
|
const pointStyle = computed(() => {
|
|
63
63
|
return {
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
insetInlineStart: `${pointX.value}px`,
|
|
65
|
+
insetBlockStart: `${pointY.value}px`,
|
|
66
66
|
zIndex: zIndex.value
|
|
67
67
|
};
|
|
68
68
|
});
|
|
@@ -73,8 +73,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
73
73
|
});
|
|
74
74
|
const menuStyle = computed(() => {
|
|
75
75
|
return {
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
insetInlineStart: `${x.value}px`,
|
|
77
|
+
insetBlockStart: `${y.value}px`,
|
|
78
78
|
zIndex: zIndex.value
|
|
79
79
|
};
|
|
80
80
|
});
|
|
@@ -83,8 +83,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
83
83
|
const zIndex = ref(0);
|
|
84
84
|
const subStyle = computed(() => {
|
|
85
85
|
return {
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
insetBlockStart: `${y.value}px`,
|
|
87
|
+
insetInlineStart: `${x.value}px`,
|
|
88
88
|
zIndex: zIndex.value
|
|
89
89
|
};
|
|
90
90
|
});
|
|
@@ -49,8 +49,8 @@ const getCommonPanelStyle = (token) => {
|
|
|
49
49
|
const { componentCls } = token;
|
|
50
50
|
return {
|
|
51
51
|
position: "fixed",
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
insetInlineStart: 0,
|
|
53
|
+
insetBlockStart: 0,
|
|
54
54
|
paddingBlock: token.paddingXXS,
|
|
55
55
|
border: `${token.lineWidth} ${token.lineType} ${token.colorBorderSecondary}`,
|
|
56
56
|
borderRadius: token.borderRadius,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, computed, ref, createBlock, openBlock, unref, withCtx, renderSlot, createElementVNode, normalizeClass, createElementBlock, Fragment, renderList, normalizeStyle, createCommentVNode, createVNode } from 'vue';
|
|
1
|
+
import { defineComponent, computed, ref, createBlock, openBlock, unref, withCtx, renderSlot, createElementVNode, normalizeClass, toDisplayString, createElementBlock, Fragment, renderList, normalizeStyle, createCommentVNode, createVNode } from 'vue';
|
|
2
2
|
import stdin_default$2 from '../picker/picker.vue.js';
|
|
3
3
|
import stdin_default$1 from './color-picker.style.js';
|
|
4
4
|
import { colorNames, colorPalettes } from './color-picker.js';
|
|
@@ -7,6 +7,7 @@ import { ElInput } from 'element-plus';
|
|
|
7
7
|
import { TinyColor } from '@ctrl/tinycolor';
|
|
8
8
|
import { useHistoryColor } from './useHistoryColor.js';
|
|
9
9
|
import { useComponentConfig } from '../../../config-provider/config-provider.js';
|
|
10
|
+
import { useLocale } from '../../../../hooks/useLocale.js';
|
|
10
11
|
|
|
11
12
|
const _hoisted_1 = ["onClick"];
|
|
12
13
|
const _hoisted_2 = ["onClick"];
|
|
@@ -22,14 +23,17 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
22
23
|
setup(__props, {
|
|
23
24
|
emit: __emit
|
|
24
25
|
}) {
|
|
26
|
+
const props = __props;
|
|
27
|
+
const emit = __emit;
|
|
25
28
|
const {
|
|
26
29
|
prefixCls
|
|
27
30
|
} = useComponentConfig("editor-color-picker");
|
|
28
31
|
const {
|
|
29
32
|
hashId
|
|
30
33
|
} = stdin_default$1(prefixCls);
|
|
31
|
-
const
|
|
32
|
-
|
|
34
|
+
const {
|
|
35
|
+
t
|
|
36
|
+
} = useLocale();
|
|
33
37
|
const innerVisible = computed({
|
|
34
38
|
get() {
|
|
35
39
|
return props.visible;
|
|
@@ -81,8 +85,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
81
85
|
}, {
|
|
82
86
|
content: withCtx(() => [createElementVNode("div", {
|
|
83
87
|
class: normalizeClass(`${unref(prefixCls)}-title`)
|
|
84
|
-
}, "
|
|
85
|
-
/* CLASS */), createElementVNode("div", {
|
|
88
|
+
}, toDisplayString(unref(t)("co.colorPicker.preset")), 3
|
|
89
|
+
/* TEXT, CLASS */), createElementVNode("div", {
|
|
86
90
|
class: normalizeClass(`${unref(prefixCls)}-preset`)
|
|
87
91
|
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(colorPalettes), (row, i) => {
|
|
88
92
|
return openBlock(), createElementBlock("div", {
|
|
@@ -108,8 +112,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
108
112
|
/* KEYED_FRAGMENT */))], 2
|
|
109
113
|
/* CLASS */), createElementVNode("div", {
|
|
110
114
|
class: normalizeClass(`${unref(prefixCls)}-title`)
|
|
111
|
-
}, "
|
|
112
|
-
/* CLASS */), createElementVNode("div", {
|
|
115
|
+
}, toDisplayString(unref(t)("co.colorPicker.recents")), 3
|
|
116
|
+
/* TEXT, CLASS */), createElementVNode("div", {
|
|
113
117
|
class: normalizeClass(`${unref(prefixCls)}-row`)
|
|
114
118
|
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(mapHistoryColors.value, (color, i) => {
|
|
115
119
|
return openBlock(), createElementBlock("div", {
|
|
@@ -130,8 +134,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
130
134
|
/* KEYED_FRAGMENT */))], 2
|
|
131
135
|
/* CLASS */), createElementVNode("div", {
|
|
132
136
|
class: normalizeClass(`${unref(prefixCls)}-title`)
|
|
133
|
-
}, "
|
|
134
|
-
/* CLASS */), createElementVNode("div", {
|
|
137
|
+
}, toDisplayString(unref(t)("co.colorPicker.manual")), 3
|
|
138
|
+
/* TEXT, CLASS */), createElementVNode("div", {
|
|
135
139
|
class: normalizeClass(`${unref(prefixCls)}-manual`)
|
|
136
140
|
}, [isEyeDropperSupported.value ? (openBlock(), createElementBlock("button", {
|
|
137
141
|
key: 0,
|
|
@@ -146,9 +150,9 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
146
150
|
modelValue: inputColor.value,
|
|
147
151
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => inputColor.value = $event),
|
|
148
152
|
size: "small",
|
|
149
|
-
placeholder: "
|
|
153
|
+
placeholder: unref(t)("co.common.pleaseInput"),
|
|
150
154
|
class: normalizeClass([`${unref(prefixCls)}-input`])
|
|
151
|
-
}, null, 8, ["modelValue", "class"]), createElementVNode("button", {
|
|
155
|
+
}, null, 8, ["modelValue", "placeholder", "class"]), createElementVNode("button", {
|
|
152
156
|
type: "button",
|
|
153
157
|
class: normalizeClass([`${unref(prefixCls)}-color`, `${unref(prefixCls)}-btn`]),
|
|
154
158
|
style: normalizeStyle({
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ref } from 'vue';
|
|
2
2
|
import { usePersist } from '../../../../hooks/usePersist.js';
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
const historyColorKey = "Cosey:historyColor";
|
|
5
5
|
let historyColors = null;
|
|
6
6
|
function useHistoryColor() {
|
|
7
7
|
const persist = usePersist();
|
|
8
8
|
if (!historyColors) {
|
|
9
|
-
historyColors = ref(persist.get(
|
|
9
|
+
historyColors = ref(persist.get(historyColorKey) || []);
|
|
10
10
|
}
|
|
11
11
|
const pushHistory = (color) => {
|
|
12
12
|
const hist = historyColors.value;
|
|
@@ -14,7 +14,7 @@ function useHistoryColor() {
|
|
|
14
14
|
hist.splice(hist.indexOf(color), 1);
|
|
15
15
|
}
|
|
16
16
|
hist.unshift(color);
|
|
17
|
-
persist.set(
|
|
17
|
+
persist.set(historyColorKey, historyColors.value);
|
|
18
18
|
};
|
|
19
19
|
return {
|
|
20
20
|
historyColors,
|
|
@@ -14,7 +14,7 @@ const getAlign = (el) => {
|
|
|
14
14
|
if (style.float === "right") {
|
|
15
15
|
return "right";
|
|
16
16
|
}
|
|
17
|
-
if (style.
|
|
17
|
+
if (style.marginInlineStart === "auto" && style.marginInlineEnd === "auto" && style.display === "block") {
|
|
18
18
|
return "center";
|
|
19
19
|
}
|
|
20
20
|
return null;
|
|
@@ -53,32 +53,32 @@ const setAlignStyle = (el, align) => {
|
|
|
53
53
|
style = {
|
|
54
54
|
display: "",
|
|
55
55
|
float: "",
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
marginInlineStart: "",
|
|
57
|
+
marginInlineEnd: ""
|
|
58
58
|
};
|
|
59
59
|
break;
|
|
60
60
|
case "left":
|
|
61
61
|
style = {
|
|
62
62
|
display: "",
|
|
63
63
|
float: "left",
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
marginInlineStart: "",
|
|
65
|
+
marginInlineEnd: ""
|
|
66
66
|
};
|
|
67
67
|
break;
|
|
68
68
|
case "center":
|
|
69
69
|
style = {
|
|
70
70
|
display: "block",
|
|
71
71
|
float: "",
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
marginInlineStart: "auto",
|
|
73
|
+
marginInlineEnd: "auto"
|
|
74
74
|
};
|
|
75
75
|
break;
|
|
76
76
|
case "right":
|
|
77
77
|
style = {
|
|
78
78
|
display: "",
|
|
79
79
|
float: "right",
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
marginInlineStart: "",
|
|
81
|
+
marginInlineEnd: ""
|
|
82
82
|
};
|
|
83
83
|
break;
|
|
84
84
|
}
|
|
@@ -5,8 +5,8 @@ var stdin_default = getSimpleStyleHook("EditorResize", (token) => {
|
|
|
5
5
|
return {
|
|
6
6
|
[componentCls]: {
|
|
7
7
|
position: "absolute",
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
insetBlockStart: 0,
|
|
9
|
+
insetInlineStart: 0,
|
|
10
10
|
display: "none",
|
|
11
11
|
outline: `3px solid ${token.colorPrimaryBorder}`,
|
|
12
12
|
"&.is-show": {
|
|
@@ -19,33 +19,33 @@ var stdin_default = getSimpleStyleHook("EditorResize", (token) => {
|
|
|
19
19
|
backgroundColor: token.colorPrimary,
|
|
20
20
|
"&-nw": {
|
|
21
21
|
cursor: "nw-resize",
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
insetBlockStart: 0,
|
|
23
|
+
insetInlineStart: 0,
|
|
24
24
|
transform: "translate(-50%, -50%)"
|
|
25
25
|
},
|
|
26
26
|
"&-ne": {
|
|
27
27
|
cursor: "ne-resize",
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
insetBlockStart: 0,
|
|
29
|
+
insetInlineEnd: 0,
|
|
30
30
|
transform: "translate(50%, -50%)"
|
|
31
31
|
},
|
|
32
32
|
"&-sw": {
|
|
33
33
|
cursor: "sw-resize",
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
insetBlockEnd: 0,
|
|
35
|
+
insetInlineStart: 0,
|
|
36
36
|
transform: "translate(-50%, 50%)"
|
|
37
37
|
},
|
|
38
38
|
"&-se": {
|
|
39
39
|
cursor: "se-resize",
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
insetBlockEnd: 0,
|
|
41
|
+
insetInlineEnd: 0,
|
|
42
42
|
transform: "translate(50%, 50%)"
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
[`${componentCls}-align`]: {
|
|
46
46
|
position: "absolute",
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
insetBlockEnd: "100%",
|
|
48
|
+
insetInlineStart: "50%",
|
|
49
49
|
display: "flex",
|
|
50
50
|
columnGap: token.padding,
|
|
51
51
|
paddingInline: token.paddingXS,
|
|
@@ -58,8 +58,8 @@ var stdin_default = getSimpleStyleHook("EditorResize", (token) => {
|
|
|
58
58
|
},
|
|
59
59
|
[`${componentCls}-size`]: {
|
|
60
60
|
position: "absolute",
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
insetInlineEnd: token.sizeXXS,
|
|
62
|
+
insetBlockEnd: token.sizeXXS,
|
|
63
63
|
paddingInline: token.paddingXXS,
|
|
64
64
|
fontSize: token.fontSizeSM,
|
|
65
65
|
lineHeight: token.lineHeight,
|
|
@@ -68,12 +68,12 @@ var stdin_default = getSimpleStyleHook("EditorResize", (token) => {
|
|
|
68
68
|
borderRadius: token.borderRadiusXS,
|
|
69
69
|
backgroundColor: token.colorBgElevated,
|
|
70
70
|
"&.is-outside": {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
71
|
+
insetInlineStart: "100%",
|
|
72
|
+
insetInlineEnd: "auto",
|
|
73
|
+
insetBlockStart: "100%",
|
|
74
|
+
insetBlockEnd: "auto",
|
|
75
|
+
marginInlineStart: token.sizeXS,
|
|
76
|
+
marginBlockStart: token.sizeXS
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
}
|
|
@@ -40,8 +40,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
40
40
|
const width = ~~rect.width;
|
|
41
41
|
const height = ~~rect.height;
|
|
42
42
|
overlayStyle.value = {
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
insetInlineStart: ~~(rect.x - parentRect.x) + "px",
|
|
44
|
+
insetBlockStart: ~~(rect.y - parentRect.y) + "px",
|
|
45
45
|
width: width + "px",
|
|
46
46
|
height: height + "px"
|
|
47
47
|
};
|
|
@@ -5,8 +5,8 @@ var stdin_default = getSimpleStyleHook("EditorTableToolbar", (token) => {
|
|
|
5
5
|
return {
|
|
6
6
|
[componentCls]: {
|
|
7
7
|
position: "absolute",
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
insetBlockStart: 0,
|
|
9
|
+
insetInlineStart: 0,
|
|
10
10
|
display: "flex",
|
|
11
11
|
columnGap: token.padding,
|
|
12
12
|
paddingInline: token.paddingXS,
|
|
@@ -38,8 +38,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
38
38
|
const floatingStyle = computed(() => {
|
|
39
39
|
return {
|
|
40
40
|
display: floating.value ? "flex" : "none",
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
insetBlockStart: y.value + "px",
|
|
42
|
+
insetInlineStart: x.value + "px"
|
|
43
43
|
};
|
|
44
44
|
});
|
|
45
45
|
const {
|
|
@@ -3,10 +3,14 @@ import stdin_default$1 from '../../select.vue.js';
|
|
|
3
3
|
import { Toolbar } from '../toolbar.js';
|
|
4
4
|
import { toolbarContextKey } from '../toolbarContext.js';
|
|
5
5
|
import { fonts } from '../../../formats/font.js';
|
|
6
|
+
import { useLocale } from '../../../../../hooks/useLocale.js';
|
|
6
7
|
|
|
7
8
|
var stdin_default = /* @__PURE__ */defineComponent({
|
|
8
9
|
__name: "font",
|
|
9
10
|
setup(__props) {
|
|
11
|
+
const {
|
|
12
|
+
t
|
|
13
|
+
} = useLocale();
|
|
10
14
|
const {
|
|
11
15
|
toolbar
|
|
12
16
|
} = inject(toolbarContextKey);
|
|
@@ -21,7 +25,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
21
25
|
};
|
|
22
26
|
});
|
|
23
27
|
return [{
|
|
24
|
-
label: "
|
|
28
|
+
label: t("co.editor.defaultFont"),
|
|
25
29
|
value: false
|
|
26
30
|
}, ...sizeList];
|
|
27
31
|
});
|
|
@@ -3,10 +3,14 @@ import stdin_default$1 from '../../select.vue.js';
|
|
|
3
3
|
import { useToken } from '../../../../theme/util/useToken.js';
|
|
4
4
|
import { Toolbar } from '../toolbar.js';
|
|
5
5
|
import { toolbarContextKey } from '../toolbarContext.js';
|
|
6
|
+
import { useLocale } from '../../../../../hooks/useLocale.js';
|
|
6
7
|
|
|
7
8
|
var stdin_default = /* @__PURE__ */defineComponent({
|
|
8
9
|
__name: "header",
|
|
9
10
|
setup(__props) {
|
|
11
|
+
const {
|
|
12
|
+
t
|
|
13
|
+
} = useLocale();
|
|
10
14
|
const {
|
|
11
15
|
token
|
|
12
16
|
} = useToken();
|
|
@@ -17,7 +21,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
17
21
|
const list = computed(() => {
|
|
18
22
|
const headingList = headings.map(heading => {
|
|
19
23
|
return {
|
|
20
|
-
label:
|
|
24
|
+
label: `${t("co.editor.leading")} ${heading}`,
|
|
21
25
|
value: heading,
|
|
22
26
|
style: {
|
|
23
27
|
fontSize: token.value[`fontSizeHeading${heading}`] + "px",
|
|
@@ -27,7 +31,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
27
31
|
};
|
|
28
32
|
});
|
|
29
33
|
return [{
|
|
30
|
-
label: "
|
|
34
|
+
label: t("co.editor.mainBody"),
|
|
31
35
|
value: false,
|
|
32
36
|
style: {
|
|
33
37
|
lineHeight: token.value["lineHeight"],
|
|
@@ -8,10 +8,14 @@ import { Form as _Form, FormItem as _FormItem } from '../../../../form/index.js'
|
|
|
8
8
|
import { ContextMenu as _ContextMenu, ContextMenuItem as _ContextMenuItem } from '../../../../context-menu/index.js';
|
|
9
9
|
import Quill, { Range } from 'quill';
|
|
10
10
|
import { Link } from '../../../formats/link.js';
|
|
11
|
+
import { useLocale } from '../../../../../hooks/useLocale.js';
|
|
11
12
|
|
|
12
13
|
var stdin_default = /* @__PURE__ */defineComponent({
|
|
13
14
|
__name: "link",
|
|
14
15
|
setup(__props) {
|
|
16
|
+
const {
|
|
17
|
+
t
|
|
18
|
+
} = useLocale();
|
|
15
19
|
const {
|
|
16
20
|
quill,
|
|
17
21
|
toolbar
|
|
@@ -43,7 +47,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
43
47
|
const contextMenuRef = useTemplateRef("contextMenu");
|
|
44
48
|
const visible = ref(false);
|
|
45
49
|
const actionType = ref("insert");
|
|
46
|
-
const title = computed(() => `${actionType.value === "update" ? "
|
|
50
|
+
const title = computed(() => `${actionType.value === "update" ? t("co.editor.edit") : t("co.editor.insert")}${t("co.editor.link")}`);
|
|
47
51
|
const formModel = reactive({
|
|
48
52
|
url: "",
|
|
49
53
|
text: "",
|
|
@@ -51,10 +55,10 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
51
55
|
target: ""
|
|
52
56
|
});
|
|
53
57
|
const targetOptions = [{
|
|
54
|
-
label: "
|
|
58
|
+
label: t("co.editor.currentWindow"),
|
|
55
59
|
value: "_self"
|
|
56
60
|
}, {
|
|
57
|
-
label: "
|
|
61
|
+
label: t("co.editor.newWindow"),
|
|
58
62
|
value: "_blank"
|
|
59
63
|
}];
|
|
60
64
|
const getSelectedInfo = () => {
|
|
@@ -159,24 +163,24 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
159
163
|
modelValue: formModel.text,
|
|
160
164
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = $event => formModel.text = $event),
|
|
161
165
|
prop: "text",
|
|
162
|
-
label: "
|
|
166
|
+
label: unref(t)("co.editor.displayedText"),
|
|
163
167
|
"field-type": "input"
|
|
164
|
-
}, null, 8, ["modelValue"]), createVNode(unref(_FormItem), {
|
|
168
|
+
}, null, 8, ["modelValue", "label"]), createVNode(unref(_FormItem), {
|
|
165
169
|
modelValue: formModel.title,
|
|
166
170
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = $event => formModel.title = $event),
|
|
167
171
|
prop: "title",
|
|
168
|
-
label: "
|
|
172
|
+
label: unref(t)("co.editor.leading"),
|
|
169
173
|
"field-type": "input"
|
|
170
|
-
}, null, 8, ["modelValue"]), createVNode(unref(_FormItem), {
|
|
174
|
+
}, null, 8, ["modelValue", "label"]), createVNode(unref(_FormItem), {
|
|
171
175
|
modelValue: formModel.target,
|
|
172
176
|
"onUpdate:modelValue": _cache[3] || (_cache[3] = $event => formModel.target = $event),
|
|
173
177
|
prop: "target",
|
|
174
|
-
label: "
|
|
178
|
+
label: unref(t)("co.editor.openLinkAt"),
|
|
175
179
|
"field-type": "select",
|
|
176
180
|
"field-props": {
|
|
177
181
|
options: targetOptions
|
|
178
182
|
}
|
|
179
|
-
}, null, 8, ["modelValue", "field-props"])]),
|
|
183
|
+
}, null, 8, ["modelValue", "label", "field-props"])]),
|
|
180
184
|
_: 1
|
|
181
185
|
/* STABLE */
|
|
182
186
|
}, 8, ["model"])]),
|
|
@@ -194,13 +198,13 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
194
198
|
key: 0
|
|
195
199
|
}, [createVNode(unref(_ContextMenuItem), {
|
|
196
200
|
icon: "co:unlink",
|
|
197
|
-
title: "
|
|
201
|
+
title: unref(t)("co.editor.removeLink"),
|
|
198
202
|
command: "remove"
|
|
199
|
-
}), createVNode(unref(_ContextMenuItem), {
|
|
203
|
+
}, null, 8, ["title"]), createVNode(unref(_ContextMenuItem), {
|
|
200
204
|
icon: "co:launch",
|
|
201
|
-
title: "
|
|
205
|
+
title: unref(t)("co.editor.openLink"),
|
|
202
206
|
command: "open"
|
|
203
|
-
})], 64
|
|
207
|
+
}, null, 8, ["title"])], 64
|
|
204
208
|
/* STABLE_FRAGMENT */)) : createCommentVNode("v-if", true)]),
|
|
205
209
|
_: 1
|
|
206
210
|
/* STABLE */
|
|
@@ -2,10 +2,14 @@ import { defineComponent, inject, computed, ref, watch, createBlock, openBlock }
|
|
|
2
2
|
import stdin_default$1 from '../../select.vue.js';
|
|
3
3
|
import { Toolbar } from '../toolbar.js';
|
|
4
4
|
import { toolbarContextKey } from '../toolbarContext.js';
|
|
5
|
+
import { useLocale } from '../../../../../hooks/useLocale.js';
|
|
5
6
|
|
|
6
7
|
var stdin_default = /* @__PURE__ */defineComponent({
|
|
7
8
|
__name: "size",
|
|
8
9
|
setup(__props) {
|
|
10
|
+
const {
|
|
11
|
+
t
|
|
12
|
+
} = useLocale();
|
|
9
13
|
const {
|
|
10
14
|
toolbar
|
|
11
15
|
} = inject(toolbarContextKey);
|
|
@@ -18,7 +22,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
18
22
|
};
|
|
19
23
|
});
|
|
20
24
|
return [{
|
|
21
|
-
label: "
|
|
25
|
+
label: t("co.editor.defaultFontSize"),
|
|
22
26
|
value: false
|
|
23
27
|
}, ...sizeList];
|
|
24
28
|
});
|
|
@@ -0,0 +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, {}, any>;
|
|
2
|
+
export default _default;
|