@g1cloud/bluesea 5.0.0-alpha.73 → 5.0.0-alpha.74
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/css/layout.scss +9 -1
- package/css/user-text.scss +42 -0
- package/dist/{BSAlertModal-C5edoLZA.js → BSAlertModal-rrjfHNUt.js} +1 -1
- package/dist/BSGridColumnSettingModal-0Tbe9wmr.js +146 -0
- package/dist/{BSYesNoModal-CbWdMdod.js → BSYesNoModal-CzH4CIFN.js} +1 -1
- package/dist/ImageInsertModal-EBMu3avV.js +140 -0
- package/dist/ImagePropertiesModal-Br8em1ci.js +138 -0
- package/dist/LinkPropertiesModal-yh8YHA6y.js +102 -0
- package/dist/TableInsertModal-m0v7YlvM.js +74 -0
- package/dist/YoutubeInsertModal-Ct90XsaZ.js +101 -0
- package/dist/YoutubePropertiesModal-D1C6yhHp.js +133 -0
- package/dist/bluesea.js +179 -178
- package/dist/bluesea.umd.cjs +4549 -2498
- package/dist/component/global/BSNameInput.vue.d.ts +1 -1
- package/dist/component/grid/BSDateRangeFilter.vue.d.ts +1 -1
- package/dist/component/grid/BSGrid.vue.d.ts +17 -5
- package/dist/component/grid/BSGridCell.vue.d.ts +1 -1
- package/dist/component/grid/BSGridColumnSettingModal.vue.d.ts +25 -0
- package/dist/component/grid/BSGridControl.vue.d.ts +9 -1
- package/dist/component/grid/BSGridHeaderCell.vue.d.ts +6 -0
- package/dist/component/grid/BSGridRow.vue.d.ts +1 -1
- package/dist/component/grid/GridModel.d.ts +25 -4
- package/dist/component/input/BSCheckbox.vue.d.ts +1 -1
- package/dist/component/input/BSCheckboxGroup.vue.d.ts +13 -13
- package/dist/component/input/BSColorInput.vue.d.ts +1 -1
- package/dist/component/input/BSDateInput.vue.d.ts +1 -1
- package/dist/component/input/BSDateRange.vue.d.ts +1 -1
- package/dist/component/input/BSDateRangePresets.vue.d.ts +2 -28
- package/dist/component/input/BSImageUpload.vue.d.ts +1 -1
- package/dist/component/input/BSMultiSelect.vue.d.ts +16 -16
- package/dist/component/input/BSNumberInput.vue.d.ts +1 -1
- package/dist/component/input/BSPopupSelect.vue.d.ts +7 -7
- package/dist/component/input/BSPriceInput.vue.d.ts +1 -1
- package/dist/component/input/BSRadioButton.vue.d.ts +13 -13
- package/dist/component/input/BSRadioButtonGroup.vue.d.ts +16 -16
- package/dist/component/input/BSSelect.vue.d.ts +19 -19
- package/dist/component/input/BSSelectPopup.vue.d.ts +4 -4
- package/dist/component/input/BSTextArea.vue.d.ts +1 -1
- package/dist/component/input/BSTextInput.vue.d.ts +1 -1
- package/dist/component/input/BSTreeMultiSelect.vue.d.ts +19 -19
- package/dist/component/input/BSTreeSelect.vue.d.ts +19 -19
- package/dist/component/layout/BSListControl.vue.d.ts +1 -1
- package/dist/component/layout/BSListLayout.vue.d.ts +1 -1
- package/dist/component/layout/BSListLayoutItem.vue.d.ts +1 -1
- package/dist/component/multilang/BSMultiLangRichText.vue.d.ts +1 -1
- package/dist/component/multilang/BSMultiLangTextArea.vue.d.ts +1 -1
- package/dist/component/multilang/BSMultiLangTextInput.vue.d.ts +1 -1
- package/dist/component/richtext/BSRichText.vue.d.ts +5 -0
- package/dist/component/richtext/RichTextLib.d.ts +5 -0
- package/dist/component/richtext/image/ImageInsertModal.vue.d.ts +22 -0
- package/dist/component/richtext/image/ImagePropertiesModal.vue.d.ts +17 -0
- package/dist/component/richtext/image/RichTextImage.d.ts +7 -0
- package/dist/component/richtext/image/RichTextImageLib.d.ts +18 -0
- package/dist/component/richtext/image/ToolButtonImage.vue.d.ts +19 -0
- package/dist/component/richtext/link/LinkPropertiesModal.vue.d.ts +17 -0
- package/dist/component/richtext/link/ToolButtonLink.vue.d.ts +19 -0
- package/dist/component/richtext/table/RichTextTable.d.ts +8 -0
- package/dist/component/richtext/table/RichTextTableLib.d.ts +14 -0
- package/dist/component/richtext/table/RichTextTableView.d.ts +18 -0
- package/dist/component/richtext/table/TableInsertModal.vue.d.ts +17 -0
- package/dist/component/richtext/table/TablePropertiesModal.vue.d.ts +17 -0
- package/dist/component/richtext/table/ToolButtonTable.vue.d.ts +19 -0
- package/dist/component/richtext/youtube/RichTextYoutube.d.ts +8 -0
- package/dist/component/richtext/youtube/RichTextYoutubeLib.d.ts +12 -0
- package/dist/component/richtext/youtube/ToolButtonYoutube.vue.d.ts +19 -0
- package/dist/component/richtext/youtube/YoutubeInsertModal.vue.d.ts +17 -0
- package/dist/component/richtext/youtube/YoutubePropertiesModal.vue.d.ts +17 -0
- package/dist/component/tree/BSTree.vue.d.ts +4 -4
- package/dist/component/tree/BSTreeControl.vue.d.ts +1 -1
- package/dist/component/tree/BSTreeRow.vue.d.ts +4 -4
- package/dist/config/config.d.ts +34 -107
- package/dist/{index-ePRTd5aG.js → index-B2-vA9S0.js} +3696 -2469
- package/dist/style.css +152 -29
- package/dist/util/elementUtil.d.ts +1 -1
- package/dist/validator/FormValidator.d.ts +1 -1
- package/package.json +15 -13
- package/text/bluesea_text_en.json +128 -0
- package/text/bluesea_text_ja.json +128 -0
- package/text/bluesea_text_ko.json +128 -0
- package/text/bluesea_text_zh.json +128 -0
package/css/layout.scss
CHANGED
|
@@ -128,6 +128,14 @@
|
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
+
&.title-w-8 > div > .title {
|
|
132
|
+
width: 8em;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&.title-w-10 > div > .title {
|
|
136
|
+
width: 10em;
|
|
137
|
+
}
|
|
138
|
+
|
|
131
139
|
&.title-w-14 > div > .title {
|
|
132
140
|
width: 14em;
|
|
133
141
|
}
|
|
@@ -161,7 +169,7 @@ $table-row-even-color: $gray-100;
|
|
|
161
169
|
.bs-layout-table {
|
|
162
170
|
border-collapse: collapse;
|
|
163
171
|
|
|
164
|
-
> tr > td, > tr > th, tbody > tr > td, tbody > tr > th {
|
|
172
|
+
> tr > td, > tr > th, > tbody > tr > td, > tbody > tr > th {
|
|
165
173
|
padding: 8px;
|
|
166
174
|
border: 1px solid $color-border;
|
|
167
175
|
vertical-align: middle;
|
package/css/user-text.scss
CHANGED
|
@@ -84,4 +84,46 @@
|
|
|
84
84
|
em {
|
|
85
85
|
font-style: italic;
|
|
86
86
|
}
|
|
87
|
+
|
|
88
|
+
.table-wrapper {
|
|
89
|
+
margin: 0.5rem 0;
|
|
90
|
+
overflow-x: auto;
|
|
91
|
+
display: flex;
|
|
92
|
+
flex-direction: column;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
table {
|
|
96
|
+
border-collapse: collapse;
|
|
97
|
+
text-align: left;
|
|
98
|
+
|
|
99
|
+
> tr, > tbody > tr {
|
|
100
|
+
> th, > td {
|
|
101
|
+
border: 1px solid #ccc;
|
|
102
|
+
box-sizing: border-box;
|
|
103
|
+
padding: 6px 8px;
|
|
104
|
+
vertical-align: top;
|
|
105
|
+
|
|
106
|
+
> p {
|
|
107
|
+
margin-bottom: 0;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
img {
|
|
114
|
+
display: inline-block;
|
|
115
|
+
height: auto;
|
|
116
|
+
margin: 0.5rem 0;
|
|
117
|
+
max-width: 100%;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
span[data-youtube-video] {
|
|
121
|
+
padding-right: 0.5rem;
|
|
122
|
+
display: inline-block;
|
|
123
|
+
|
|
124
|
+
iframe {
|
|
125
|
+
border: 0.5rem solid var(--black-contrast);
|
|
126
|
+
outline: 0 solid transparent;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
87
129
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createBlock, withCtx, createElementVNode, withDirectives, createVNode, unref } from "vue";
|
|
2
|
-
import { u as useModalHandle, _ as _sfc_main$1, B as BSButton, v as vFocusOnLoad,
|
|
2
|
+
import { u as useModalHandle, _ as _sfc_main$1, B as BSButton, v as vFocusOnLoad, h as vT } from "./index-B2-vA9S0.js";
|
|
3
3
|
const _hoisted_1 = { class: "text-right" };
|
|
4
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
5
|
__name: "BSAlertModal",
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { defineComponent, ref, onMounted, openBlock, createBlock, withCtx, createVNode, mergeProps, unref, toHandlers, createElementVNode, nextTick } from "vue";
|
|
2
|
+
import { d as createInputGridHandler, u as useModalHandle, _ as _sfc_main$1, e as _sfc_main$2, f as _sfc_main$3, g as _sfc_main$4, B as BSButton, n as notNull } from "./index-B2-vA9S0.js";
|
|
3
|
+
const _hoisted_1 = { class: "text-center" };
|
|
4
|
+
const _hoisted_2 = { class: "text-center" };
|
|
5
|
+
const _hoisted_3 = { class: "bs-layout-horizontal" };
|
|
6
|
+
const _hoisted_4 = { class: "bs-layout-horizontal flex-grow-1 justify-content-end gap-8" };
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "BSGridColumnSettingModal",
|
|
9
|
+
props: {
|
|
10
|
+
columns: {},
|
|
11
|
+
columnSettings: {},
|
|
12
|
+
fixedColumnCount: {}
|
|
13
|
+
},
|
|
14
|
+
emits: ["settingChanged"],
|
|
15
|
+
setup(__props, { emit: __emit }) {
|
|
16
|
+
const props = __props;
|
|
17
|
+
const emit = __emit;
|
|
18
|
+
const settingColumns = [
|
|
19
|
+
{ propertyId: "caption", caption: { key: "bs.grid.caption" }, width: 200, cellType: "MULTI_LANG_STRING" },
|
|
20
|
+
{ propertyId: "visible", caption: { key: "bs.grid.visible" }, width: 60 },
|
|
21
|
+
{ propertyId: "fixed", caption: { key: "bs.grid.fixed" }, width: 60 },
|
|
22
|
+
{ propertyId: "width", caption: { key: "bs.width" }, width: 100 }
|
|
23
|
+
];
|
|
24
|
+
const gridHandler = createInputGridHandler({
|
|
25
|
+
getRowKey: (row) => row.propertyId
|
|
26
|
+
});
|
|
27
|
+
const editingColumns = ref([]);
|
|
28
|
+
const margeColumnSettingsAndOrigColumns = (columnSettings, columns) => {
|
|
29
|
+
const origColumns = [...columns];
|
|
30
|
+
const result = columnSettings.map((col) => {
|
|
31
|
+
const origIndex = origColumns.findIndex((orig) => orig.propertyId === col.propertyId);
|
|
32
|
+
if (origIndex >= 0) {
|
|
33
|
+
const orig = origColumns.splice(origIndex, 1)[0];
|
|
34
|
+
return { ...orig, hidden: col.hidden, width: col.width || orig.width };
|
|
35
|
+
} else {
|
|
36
|
+
return void 0;
|
|
37
|
+
}
|
|
38
|
+
}).filter(notNull);
|
|
39
|
+
origColumns.forEach((orig) => {
|
|
40
|
+
result.push({ ...orig, width: orig.width });
|
|
41
|
+
});
|
|
42
|
+
return result;
|
|
43
|
+
};
|
|
44
|
+
onMounted(() => {
|
|
45
|
+
const columns = props.columnSettings ? margeColumnSettingsAndOrigColumns(props.columnSettings, props.columns) : props.columns.map((orig) => ({ ...orig }));
|
|
46
|
+
editingColumns.value = columns.map((col, idx) => ({ ...col, fixed: idx < (props.fixedColumnCount || 0) }));
|
|
47
|
+
gridHandler.setGridData(editingColumns.value);
|
|
48
|
+
});
|
|
49
|
+
const updateFixedColumn = async (value, row) => {
|
|
50
|
+
const rowIndex = editingColumns.value.indexOf(row);
|
|
51
|
+
await nextTick();
|
|
52
|
+
const fixedIndex = !value && rowIndex === 0 ? -1 : rowIndex;
|
|
53
|
+
editingColumns.value.forEach((col, idx) => col.fixed = idx <= fixedIndex);
|
|
54
|
+
};
|
|
55
|
+
const modalHandle = useModalHandle();
|
|
56
|
+
const save = () => {
|
|
57
|
+
const columnSettings = editingColumns.value.map((col) => {
|
|
58
|
+
const orig = props.columns.find((c) => c.propertyId === col.propertyId);
|
|
59
|
+
return {
|
|
60
|
+
propertyId: col.propertyId,
|
|
61
|
+
hidden: col.hidden ? true : void 0,
|
|
62
|
+
width: col.width !== (orig == null ? void 0 : orig.width) ? col.width : void 0
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
const fixedColumnCount = editingColumns.value.findLastIndex((col) => col.fixed) + 1;
|
|
66
|
+
emit("settingChanged", columnSettings, fixedColumnCount);
|
|
67
|
+
modalHandle.close();
|
|
68
|
+
};
|
|
69
|
+
const close = () => {
|
|
70
|
+
modalHandle.close();
|
|
71
|
+
};
|
|
72
|
+
const restore = () => {
|
|
73
|
+
emit("settingChanged", void 0, void 0);
|
|
74
|
+
modalHandle.close();
|
|
75
|
+
};
|
|
76
|
+
modalHandle.setDefaultStyle({
|
|
77
|
+
maxWidth: "600px",
|
|
78
|
+
maxHeight: "80%"
|
|
79
|
+
});
|
|
80
|
+
return (_ctx, _cache) => {
|
|
81
|
+
return openBlock(), createBlock(_sfc_main$1, { title: { key: "bs.gridcontrol.columnSetting" } }, {
|
|
82
|
+
default: withCtx(() => [
|
|
83
|
+
createVNode(_sfc_main$2, mergeProps({
|
|
84
|
+
columns: settingColumns,
|
|
85
|
+
height: "100%",
|
|
86
|
+
"show-drag-handle": "",
|
|
87
|
+
"show-serial": ""
|
|
88
|
+
}, unref(gridHandler).grid, toHandlers(unref(gridHandler).gridEventListener)), {
|
|
89
|
+
visible: withCtx(({ row }) => [
|
|
90
|
+
createElementVNode("div", _hoisted_1, [
|
|
91
|
+
createVNode(_sfc_main$3, {
|
|
92
|
+
"model-value": !row.hidden,
|
|
93
|
+
class: "reverted",
|
|
94
|
+
"onUpdate:modelValue": (value) => row.hidden = !value
|
|
95
|
+
}, null, 8, ["model-value", "onUpdate:modelValue"])
|
|
96
|
+
])
|
|
97
|
+
]),
|
|
98
|
+
fixed: withCtx(({ row }) => [
|
|
99
|
+
createElementVNode("div", _hoisted_2, [
|
|
100
|
+
createVNode(_sfc_main$3, {
|
|
101
|
+
modelValue: row.fixed,
|
|
102
|
+
"onUpdate:modelValue": [($event) => row.fixed = $event, ($event) => updateFixedColumn($event, row)],
|
|
103
|
+
class: "reverted"
|
|
104
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
105
|
+
])
|
|
106
|
+
]),
|
|
107
|
+
width: withCtx(({ row }) => [
|
|
108
|
+
createVNode(_sfc_main$4, {
|
|
109
|
+
modelValue: row.width,
|
|
110
|
+
"onUpdate:modelValue": ($event) => row.width = $event,
|
|
111
|
+
width: "100%"
|
|
112
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
113
|
+
]),
|
|
114
|
+
_: 1
|
|
115
|
+
}, 16)
|
|
116
|
+
]),
|
|
117
|
+
buttons: withCtx(() => [
|
|
118
|
+
createElementVNode("div", _hoisted_3, [
|
|
119
|
+
createElementVNode("div", null, [
|
|
120
|
+
createVNode(BSButton, {
|
|
121
|
+
caption: { key: "bs.grid.restoreSetting" },
|
|
122
|
+
"button-color": "gray",
|
|
123
|
+
onClick: restore
|
|
124
|
+
})
|
|
125
|
+
]),
|
|
126
|
+
createElementVNode("div", _hoisted_4, [
|
|
127
|
+
createVNode(BSButton, {
|
|
128
|
+
caption: { key: "bs.cancel" },
|
|
129
|
+
onClick: close
|
|
130
|
+
}),
|
|
131
|
+
createVNode(BSButton, {
|
|
132
|
+
caption: { key: "bs.ok" },
|
|
133
|
+
"button-color": "blue",
|
|
134
|
+
onClick: save
|
|
135
|
+
})
|
|
136
|
+
])
|
|
137
|
+
])
|
|
138
|
+
]),
|
|
139
|
+
_: 1
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
export {
|
|
145
|
+
_sfc_main as default
|
|
146
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createBlock, withCtx, createElementVNode, createVNode, withDirectives, unref } from "vue";
|
|
2
|
-
import { u as useModalHandle, _ as _sfc_main$1, B as BSButton,
|
|
2
|
+
import { u as useModalHandle, _ as _sfc_main$1, B as BSButton, h as vT } from "./index-B2-vA9S0.js";
|
|
3
3
|
const _hoisted_1 = { class: "text-right" };
|
|
4
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
5
|
__name: "BSYesNoModal",
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { defineComponent, ref, openBlock, createBlock, withCtx, createVNode, withDirectives, createElementVNode, vShow } from "vue";
|
|
2
|
+
import { u as useModalHandle, _ as _sfc_main$1, a as _sfc_main$2, b as _sfc_main$3, c as _sfc_main$4, B as BSButton } from "./index-B2-vA9S0.js";
|
|
3
|
+
const _hoisted_1 = { class: "bs-layout-form title-w-8" };
|
|
4
|
+
const _hoisted_2 = { class: "title" };
|
|
5
|
+
const _hoisted_3 = { class: "title" };
|
|
6
|
+
const _hoisted_4 = { class: "title" };
|
|
7
|
+
const _hoisted_5 = { class: "title" };
|
|
8
|
+
const _hoisted_6 = { class: "bs-layout-horizontal justify-content-end gap-8" };
|
|
9
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
10
|
+
__name: "ImageInsertModal",
|
|
11
|
+
props: {
|
|
12
|
+
editor: {}
|
|
13
|
+
},
|
|
14
|
+
emits: ["insertImage"],
|
|
15
|
+
setup(__props, { emit: __emit }) {
|
|
16
|
+
const emit = __emit;
|
|
17
|
+
const tabs = [
|
|
18
|
+
// {tabId: 'upload', caption: {key: 'Upload'}},
|
|
19
|
+
{ tabId: "input", caption: { key: "bs.url" } }
|
|
20
|
+
];
|
|
21
|
+
const currentTab = ref("upload");
|
|
22
|
+
const image = ref();
|
|
23
|
+
const data = ref({ url: "" });
|
|
24
|
+
const modalHandle = useModalHandle();
|
|
25
|
+
const insert = () => {
|
|
26
|
+
if (currentTab.value === "upload" && (image.value && image.value.fileUrl)) {
|
|
27
|
+
emit("insertImage", {
|
|
28
|
+
url: image.value.fileUrl,
|
|
29
|
+
alt: image.value.altText
|
|
30
|
+
});
|
|
31
|
+
modalHandle.close();
|
|
32
|
+
} else if (currentTab.value === "input" && data.value.url) {
|
|
33
|
+
emit("insertImage", data.value);
|
|
34
|
+
modalHandle.close();
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const close = () => modalHandle.close();
|
|
38
|
+
modalHandle.setDefaultStyle({
|
|
39
|
+
width: "460px",
|
|
40
|
+
height: "420px"
|
|
41
|
+
});
|
|
42
|
+
return (_ctx, _cache) => {
|
|
43
|
+
return openBlock(), createBlock(_sfc_main$1, { title: { key: "bs.richtext.insertImage" } }, {
|
|
44
|
+
default: withCtx(() => [
|
|
45
|
+
createVNode(_sfc_main$2, {
|
|
46
|
+
"tab-id": currentTab.value,
|
|
47
|
+
"onUpdate:tabId": _cache[4] || (_cache[4] = ($event) => currentTab.value = $event),
|
|
48
|
+
tabs,
|
|
49
|
+
class: "compact",
|
|
50
|
+
"keep-tabs": ""
|
|
51
|
+
}, {
|
|
52
|
+
input: withCtx(({ active }) => [
|
|
53
|
+
withDirectives(createElementVNode("div", _hoisted_1, [
|
|
54
|
+
createElementVNode("div", null, [
|
|
55
|
+
createElementVNode("div", _hoisted_2, [
|
|
56
|
+
createVNode(_sfc_main$3, {
|
|
57
|
+
label: { key: "bs.url" },
|
|
58
|
+
required: ""
|
|
59
|
+
})
|
|
60
|
+
]),
|
|
61
|
+
createElementVNode("div", null, [
|
|
62
|
+
createVNode(_sfc_main$4, {
|
|
63
|
+
modelValue: data.value.url,
|
|
64
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => data.value.url = $event),
|
|
65
|
+
class: "flex-grow-1",
|
|
66
|
+
name: "url",
|
|
67
|
+
width: "100%"
|
|
68
|
+
}, null, 8, ["modelValue"])
|
|
69
|
+
])
|
|
70
|
+
]),
|
|
71
|
+
createElementVNode("div", null, [
|
|
72
|
+
createElementVNode("div", _hoisted_3, [
|
|
73
|
+
createVNode(_sfc_main$3, { label: { key: "bs.fileupload.alt" } })
|
|
74
|
+
]),
|
|
75
|
+
createElementVNode("div", null, [
|
|
76
|
+
createVNode(_sfc_main$4, {
|
|
77
|
+
modelValue: data.value.alt,
|
|
78
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => data.value.alt = $event),
|
|
79
|
+
class: "flex-grow-1",
|
|
80
|
+
name: "altText",
|
|
81
|
+
width: "100%"
|
|
82
|
+
}, null, 8, ["modelValue"])
|
|
83
|
+
])
|
|
84
|
+
]),
|
|
85
|
+
createElementVNode("div", null, [
|
|
86
|
+
createElementVNode("div", _hoisted_4, [
|
|
87
|
+
createVNode(_sfc_main$3, { label: { key: "bs.width" } })
|
|
88
|
+
]),
|
|
89
|
+
createElementVNode("div", null, [
|
|
90
|
+
createVNode(_sfc_main$4, {
|
|
91
|
+
modelValue: data.value.width,
|
|
92
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => data.value.width = $event),
|
|
93
|
+
name: "width",
|
|
94
|
+
width: "100px"
|
|
95
|
+
}, null, 8, ["modelValue"])
|
|
96
|
+
])
|
|
97
|
+
]),
|
|
98
|
+
createElementVNode("div", null, [
|
|
99
|
+
createElementVNode("div", _hoisted_5, [
|
|
100
|
+
createVNode(_sfc_main$3, { label: { key: "bs.height" } })
|
|
101
|
+
]),
|
|
102
|
+
createElementVNode("div", null, [
|
|
103
|
+
createVNode(_sfc_main$4, {
|
|
104
|
+
modelValue: data.value.height,
|
|
105
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => data.value.height = $event),
|
|
106
|
+
name: "height",
|
|
107
|
+
width: "100px"
|
|
108
|
+
}, null, 8, ["modelValue"])
|
|
109
|
+
])
|
|
110
|
+
])
|
|
111
|
+
], 512), [
|
|
112
|
+
[vShow, active]
|
|
113
|
+
])
|
|
114
|
+
]),
|
|
115
|
+
_: 1
|
|
116
|
+
}, 8, ["tab-id"])
|
|
117
|
+
]),
|
|
118
|
+
buttons: withCtx(() => [
|
|
119
|
+
createElementVNode("div", _hoisted_6, [
|
|
120
|
+
createVNode(BSButton, {
|
|
121
|
+
caption: { key: "btn.ok" },
|
|
122
|
+
"button-color": "blue",
|
|
123
|
+
"data-id": "okBtn",
|
|
124
|
+
onClick: insert
|
|
125
|
+
}),
|
|
126
|
+
createVNode(BSButton, {
|
|
127
|
+
caption: { key: "btn.cancel" },
|
|
128
|
+
"data-id": "cancelBtn",
|
|
129
|
+
onClick: close
|
|
130
|
+
})
|
|
131
|
+
])
|
|
132
|
+
]),
|
|
133
|
+
_: 1
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
export {
|
|
139
|
+
_sfc_main as default
|
|
140
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { defineComponent, ref, onMounted, useTemplateRef, openBlock, createBlock, withCtx, createElementBlock, createElementVNode, createVNode, createCommentVNode } from "vue";
|
|
2
|
+
import { i as findImageNode, u as useModalHandle, _ as _sfc_main$1, b as _sfc_main$2, c as _sfc_main$3, B as BSButton, j as numberToPixel, k as formValidator } from "./index-B2-vA9S0.js";
|
|
3
|
+
const _hoisted_1 = { class: "title" };
|
|
4
|
+
const _hoisted_2 = { class: "title" };
|
|
5
|
+
const _hoisted_3 = { class: "title" };
|
|
6
|
+
const _hoisted_4 = { class: "title" };
|
|
7
|
+
const _hoisted_5 = { class: "bs-layout-horizontal justify-content-end gap-8" };
|
|
8
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
+
__name: "ImagePropertiesModal",
|
|
10
|
+
props: {
|
|
11
|
+
editor: {}
|
|
12
|
+
},
|
|
13
|
+
setup(__props) {
|
|
14
|
+
const props = __props;
|
|
15
|
+
const data = ref();
|
|
16
|
+
onMounted(() => {
|
|
17
|
+
const selection = props.editor.state.selection;
|
|
18
|
+
const { node } = findImageNode(selection);
|
|
19
|
+
if (node) {
|
|
20
|
+
data.value = {
|
|
21
|
+
url: node.attrs.src,
|
|
22
|
+
alt: node.attrs.alt,
|
|
23
|
+
width: node.attrs.width,
|
|
24
|
+
height: node.attrs.height
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const modalHandle = useModalHandle();
|
|
29
|
+
const form = useTemplateRef("form");
|
|
30
|
+
const validator = formValidator({ element: form });
|
|
31
|
+
const save = async () => {
|
|
32
|
+
await validator.validate();
|
|
33
|
+
props.editor.chain().focus().command(({ tr }) => {
|
|
34
|
+
const { node, nodePos } = findImageNode(tr.selection);
|
|
35
|
+
if (node && nodePos && data.value) {
|
|
36
|
+
tr.setNodeMarkup(nodePos - 1, null, {
|
|
37
|
+
...node.attrs,
|
|
38
|
+
src: data.value.url,
|
|
39
|
+
alt: data.value.alt,
|
|
40
|
+
width: numberToPixel(data.value.width),
|
|
41
|
+
height: numberToPixel(data.value.height)
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return true;
|
|
45
|
+
}).run();
|
|
46
|
+
modalHandle.close();
|
|
47
|
+
};
|
|
48
|
+
const close = () => modalHandle.close();
|
|
49
|
+
modalHandle.setDefaultStyle({
|
|
50
|
+
width: "500px"
|
|
51
|
+
});
|
|
52
|
+
return (_ctx, _cache) => {
|
|
53
|
+
return openBlock(), createBlock(_sfc_main$1, { title: { key: "bs.contenteditor.image" } }, {
|
|
54
|
+
default: withCtx(() => [
|
|
55
|
+
data.value ? (openBlock(), createElementBlock("div", {
|
|
56
|
+
key: 0,
|
|
57
|
+
ref_key: "form",
|
|
58
|
+
ref: form,
|
|
59
|
+
class: "bs-layout-form title-w-8"
|
|
60
|
+
}, [
|
|
61
|
+
createElementVNode("div", null, [
|
|
62
|
+
createElementVNode("div", _hoisted_1, [
|
|
63
|
+
createVNode(_sfc_main$2, { label: { key: "bs.url" } })
|
|
64
|
+
]),
|
|
65
|
+
createElementVNode("div", null, [
|
|
66
|
+
createVNode(_sfc_main$3, {
|
|
67
|
+
modelValue: data.value.url,
|
|
68
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => data.value.url = $event),
|
|
69
|
+
name: "url",
|
|
70
|
+
required: "",
|
|
71
|
+
width: "100%"
|
|
72
|
+
}, null, 8, ["modelValue"])
|
|
73
|
+
])
|
|
74
|
+
]),
|
|
75
|
+
createElementVNode("div", null, [
|
|
76
|
+
createElementVNode("div", _hoisted_2, [
|
|
77
|
+
createVNode(_sfc_main$2, { label: { key: "bs.fileupload.alt" } })
|
|
78
|
+
]),
|
|
79
|
+
createElementVNode("div", null, [
|
|
80
|
+
createVNode(_sfc_main$3, {
|
|
81
|
+
modelValue: data.value.alt,
|
|
82
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => data.value.alt = $event),
|
|
83
|
+
name: "alt",
|
|
84
|
+
width: "100%"
|
|
85
|
+
}, null, 8, ["modelValue"])
|
|
86
|
+
])
|
|
87
|
+
]),
|
|
88
|
+
createElementVNode("div", null, [
|
|
89
|
+
createElementVNode("div", _hoisted_3, [
|
|
90
|
+
createVNode(_sfc_main$2, { label: { key: "bs.width" } })
|
|
91
|
+
]),
|
|
92
|
+
createElementVNode("div", null, [
|
|
93
|
+
createVNode(_sfc_main$3, {
|
|
94
|
+
modelValue: data.value.width,
|
|
95
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => data.value.width = $event),
|
|
96
|
+
name: "width",
|
|
97
|
+
width: "100px"
|
|
98
|
+
}, null, 8, ["modelValue"])
|
|
99
|
+
])
|
|
100
|
+
]),
|
|
101
|
+
createElementVNode("div", null, [
|
|
102
|
+
createElementVNode("div", _hoisted_4, [
|
|
103
|
+
createVNode(_sfc_main$2, { label: { key: "bs.height" } })
|
|
104
|
+
]),
|
|
105
|
+
createElementVNode("div", null, [
|
|
106
|
+
createVNode(_sfc_main$3, {
|
|
107
|
+
modelValue: data.value.height,
|
|
108
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => data.value.height = $event),
|
|
109
|
+
name: "height",
|
|
110
|
+
width: "100px"
|
|
111
|
+
}, null, 8, ["modelValue"])
|
|
112
|
+
])
|
|
113
|
+
])
|
|
114
|
+
], 512)) : createCommentVNode("", true)
|
|
115
|
+
]),
|
|
116
|
+
buttons: withCtx(() => [
|
|
117
|
+
createElementVNode("div", _hoisted_5, [
|
|
118
|
+
createVNode(BSButton, {
|
|
119
|
+
caption: { key: "btn.ok" },
|
|
120
|
+
"button-color": "blue",
|
|
121
|
+
"data-id": "okBtn",
|
|
122
|
+
onClick: save
|
|
123
|
+
}),
|
|
124
|
+
createVNode(BSButton, {
|
|
125
|
+
caption: { key: "btn.cancel" },
|
|
126
|
+
"data-id": "cancelBtn",
|
|
127
|
+
onClick: close
|
|
128
|
+
})
|
|
129
|
+
])
|
|
130
|
+
]),
|
|
131
|
+
_: 1
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
export {
|
|
137
|
+
_sfc_main as default
|
|
138
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { defineComponent, ref, onMounted, openBlock, createBlock, withCtx, createElementVNode, createVNode } from "vue";
|
|
2
|
+
import { u as useModalHandle, _ as _sfc_main$1, b as _sfc_main$2, c as _sfc_main$3, B as BSButton } from "./index-B2-vA9S0.js";
|
|
3
|
+
const _hoisted_1 = { class: "bs-layout-form title-w-8" };
|
|
4
|
+
const _hoisted_2 = { class: "title" };
|
|
5
|
+
const _hoisted_3 = { class: "title" };
|
|
6
|
+
const _hoisted_4 = { class: "bs-layout-horizontal justify-content-end gap-8" };
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "LinkPropertiesModal",
|
|
9
|
+
props: {
|
|
10
|
+
editor: {}
|
|
11
|
+
},
|
|
12
|
+
setup(__props) {
|
|
13
|
+
const props = __props;
|
|
14
|
+
const link = ref({});
|
|
15
|
+
const hasLink = ref(false);
|
|
16
|
+
onMounted(() => {
|
|
17
|
+
const oldUrl = props.editor.getAttributes("link").href;
|
|
18
|
+
link.value.url = oldUrl;
|
|
19
|
+
hasLink.value = !!oldUrl;
|
|
20
|
+
});
|
|
21
|
+
const modalHandle = useModalHandle();
|
|
22
|
+
const PROTOCOLS = ["http://", "https://", "tel:", "mailto:"];
|
|
23
|
+
const save = () => {
|
|
24
|
+
if (link.value.url) {
|
|
25
|
+
let url = link.value.url;
|
|
26
|
+
if (!PROTOCOLS.find((proto) => url.startsWith(proto))) {
|
|
27
|
+
url = "https://" + url;
|
|
28
|
+
}
|
|
29
|
+
props.editor.chain().focus().extendMarkRange("link").setLink({ href: url, target: link.value.target || "_self" }).run();
|
|
30
|
+
modalHandle.close();
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const removeLink = () => {
|
|
34
|
+
props.editor.chain().focus().extendMarkRange("link").unsetLink().run();
|
|
35
|
+
modalHandle.close();
|
|
36
|
+
};
|
|
37
|
+
const close = () => {
|
|
38
|
+
modalHandle.close();
|
|
39
|
+
};
|
|
40
|
+
modalHandle.setDefaultStyle({
|
|
41
|
+
width: "500px"
|
|
42
|
+
});
|
|
43
|
+
return (_ctx, _cache) => {
|
|
44
|
+
return openBlock(), createBlock(_sfc_main$1, { title: { key: "bs.link" } }, {
|
|
45
|
+
default: withCtx(() => [
|
|
46
|
+
createElementVNode("div", _hoisted_1, [
|
|
47
|
+
createElementVNode("div", null, [
|
|
48
|
+
createElementVNode("div", _hoisted_2, [
|
|
49
|
+
createVNode(_sfc_main$2, { label: { key: "bs.linkUrl" } })
|
|
50
|
+
]),
|
|
51
|
+
createElementVNode("div", null, [
|
|
52
|
+
createVNode(_sfc_main$3, {
|
|
53
|
+
modelValue: link.value.url,
|
|
54
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => link.value.url = $event),
|
|
55
|
+
name: "url",
|
|
56
|
+
width: "100%"
|
|
57
|
+
}, null, 8, ["modelValue"])
|
|
58
|
+
])
|
|
59
|
+
]),
|
|
60
|
+
createElementVNode("div", null, [
|
|
61
|
+
createElementVNode("div", _hoisted_3, [
|
|
62
|
+
createVNode(_sfc_main$2, { label: { key: "bs.linkTarget" } })
|
|
63
|
+
]),
|
|
64
|
+
createElementVNode("div", null, [
|
|
65
|
+
createVNode(_sfc_main$3, {
|
|
66
|
+
modelValue: link.value.target,
|
|
67
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => link.value.target = $event),
|
|
68
|
+
name: "target",
|
|
69
|
+
width: "100px"
|
|
70
|
+
}, null, 8, ["modelValue"])
|
|
71
|
+
])
|
|
72
|
+
])
|
|
73
|
+
])
|
|
74
|
+
]),
|
|
75
|
+
buttons: withCtx(() => [
|
|
76
|
+
createElementVNode("div", _hoisted_4, [
|
|
77
|
+
createVNode(BSButton, {
|
|
78
|
+
caption: { key: "bs.richtext.removeLink" },
|
|
79
|
+
"data-id": "removeLinkBtn",
|
|
80
|
+
onClick: removeLink
|
|
81
|
+
}),
|
|
82
|
+
createVNode(BSButton, {
|
|
83
|
+
caption: { key: "btn.ok" },
|
|
84
|
+
"button-color": "blue",
|
|
85
|
+
"data-id": "okBtn",
|
|
86
|
+
onClick: save
|
|
87
|
+
}),
|
|
88
|
+
createVNode(BSButton, {
|
|
89
|
+
caption: { key: "btn.cancel" },
|
|
90
|
+
"data-id": "cancelBtn",
|
|
91
|
+
onClick: close
|
|
92
|
+
})
|
|
93
|
+
])
|
|
94
|
+
]),
|
|
95
|
+
_: 1
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
export {
|
|
101
|
+
_sfc_main as default
|
|
102
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { defineComponent, ref, openBlock, createBlock, withCtx, createElementVNode, createVNode } from "vue";
|
|
2
|
+
import { u as useModalHandle, _ as _sfc_main$1, b as _sfc_main$2, g as _sfc_main$3, B as BSButton } from "./index-B2-vA9S0.js";
|
|
3
|
+
const _hoisted_1 = { class: "bs-layout-form" };
|
|
4
|
+
const _hoisted_2 = { class: "bs-form-label" };
|
|
5
|
+
const _hoisted_3 = { class: "bs-form-label" };
|
|
6
|
+
const _hoisted_4 = { class: "bs-layout-horizontal justify-content-end gap-8" };
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "TableInsertModal",
|
|
9
|
+
props: {
|
|
10
|
+
editor: {}
|
|
11
|
+
},
|
|
12
|
+
setup(__props) {
|
|
13
|
+
const props = __props;
|
|
14
|
+
const rows = ref(3);
|
|
15
|
+
const columns = ref(3);
|
|
16
|
+
const modalHandle = useModalHandle();
|
|
17
|
+
const insert = () => {
|
|
18
|
+
props.editor.chain().focus().insertTable({ rows: rows.value, cols: columns.value, withHeaderRow: false }).run();
|
|
19
|
+
modalHandle.close();
|
|
20
|
+
};
|
|
21
|
+
const close = () => modalHandle.close();
|
|
22
|
+
return (_ctx, _cache) => {
|
|
23
|
+
return openBlock(), createBlock(_sfc_main$1, { title: { key: "bs.richtext.insertTable" } }, {
|
|
24
|
+
default: withCtx(() => [
|
|
25
|
+
createElementVNode("div", _hoisted_1, [
|
|
26
|
+
createElementVNode("div", null, [
|
|
27
|
+
createElementVNode("div", _hoisted_2, [
|
|
28
|
+
createVNode(_sfc_main$2, { label: { key: "bs.richtext.rows" } })
|
|
29
|
+
]),
|
|
30
|
+
createElementVNode("div", null, [
|
|
31
|
+
createVNode(_sfc_main$3, {
|
|
32
|
+
modelValue: rows.value,
|
|
33
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => rows.value = $event),
|
|
34
|
+
width: "100px"
|
|
35
|
+
}, null, 8, ["modelValue"])
|
|
36
|
+
])
|
|
37
|
+
]),
|
|
38
|
+
createElementVNode("div", null, [
|
|
39
|
+
createElementVNode("div", _hoisted_3, [
|
|
40
|
+
createVNode(_sfc_main$2, { label: { key: "bs.richtext.columns" } })
|
|
41
|
+
]),
|
|
42
|
+
createElementVNode("div", null, [
|
|
43
|
+
createVNode(_sfc_main$3, {
|
|
44
|
+
modelValue: columns.value,
|
|
45
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => columns.value = $event),
|
|
46
|
+
width: "100px"
|
|
47
|
+
}, null, 8, ["modelValue"])
|
|
48
|
+
])
|
|
49
|
+
])
|
|
50
|
+
])
|
|
51
|
+
]),
|
|
52
|
+
buttons: withCtx(() => [
|
|
53
|
+
createElementVNode("div", _hoisted_4, [
|
|
54
|
+
createVNode(BSButton, {
|
|
55
|
+
caption: { key: "btn.ok" },
|
|
56
|
+
"button-color": "blue",
|
|
57
|
+
"data-id": "okBtn",
|
|
58
|
+
onClick: insert
|
|
59
|
+
}),
|
|
60
|
+
createVNode(BSButton, {
|
|
61
|
+
caption: { key: "btn.cancel" },
|
|
62
|
+
"data-id": "cancelBtn",
|
|
63
|
+
onClick: close
|
|
64
|
+
})
|
|
65
|
+
])
|
|
66
|
+
]),
|
|
67
|
+
_: 1
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
export {
|
|
73
|
+
_sfc_main as default
|
|
74
|
+
};
|