jky-component-lib 0.0.56 → 0.0.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/add-input/AddInput.vue.d.ts +27 -0
- package/dist/es/add-input/AddInput.vue.js +151 -0
- package/dist/es/add-input/AddInput.vue3.js +5 -0
- package/dist/es/add-input/index.d.ts +4 -0
- package/dist/es/add-input/index.js +8 -0
- package/dist/es/add-input/style.css +35 -0
- package/dist/es/button-nav/ButtonNav.vue.d.ts +4 -4
- package/dist/es/code-mirror-editor/CodeMirrorEditor.vue.d.ts +4 -4
- package/dist/es/components.d.ts +3 -0
- package/dist/es/components.js +10 -1
- package/dist/es/form/Form.vue.d.ts +2 -2
- package/dist/es/form/FormItem.vue.js +12 -0
- package/dist/es/index.js +6 -0
- package/dist/es/node_modules/@element-plus/icons-vue/dist/index.js +32 -0
- package/dist/es/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/ScriptLoader.js +52 -0
- package/dist/es/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/TinyMCE.js +10 -0
- package/dist/es/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/Utils.js +145 -0
- package/dist/es/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/components/Editor.js +160 -0
- package/dist/es/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/components/EditorPropTypes.js +26 -0
- package/dist/es/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/index.js +4 -0
- package/dist/es/package.json.js +1 -1
- package/dist/es/page-header/PopoverMenu.vue.d.ts +1 -1
- package/dist/es/page-table/PageTable.vue.d.ts +6087 -0
- package/dist/es/page-table/PageTable.vue.js +378 -0
- package/dist/es/page-table/PageTable.vue3.js +5 -0
- package/dist/es/page-table/Toolbar.vue.d.ts +32 -0
- package/dist/es/page-table/Toolbar.vue.js +271 -0
- package/dist/es/page-table/Toolbar.vue3.js +5 -0
- package/dist/es/page-table/index.d.ts +4 -0
- package/dist/es/page-table/index.js +8 -0
- package/dist/es/page-table/style.css +4 -0
- package/dist/es/rich-editor/RichEditor.vue.d.ts +78 -0
- package/dist/es/rich-editor/RichEditor.vue.js +105 -0
- package/dist/es/rich-editor/RichEditor.vue3.js +5 -0
- package/dist/es/rich-editor/index.d.ts +4 -0
- package/dist/es/rich-editor/index.js +8 -0
- package/dist/es/rich-editor/style.css +34 -0
- package/dist/es/style.css +28 -0
- package/dist/es/styles.css +1 -1
- package/dist/es/utils/index.d.ts +1 -0
- package/dist/es/utils/responsive-toolbar.d.ts +78 -0
- package/dist/es/utils/responsive-toolbar.js +64 -0
- package/dist/lib/add-input/AddInput.vue.d.ts +27 -0
- package/dist/lib/add-input/AddInput.vue.js +151 -0
- package/dist/lib/add-input/AddInput.vue3.js +5 -0
- package/dist/lib/add-input/index.d.ts +4 -0
- package/dist/lib/add-input/index.js +8 -0
- package/dist/lib/add-input/style.css +35 -0
- package/dist/lib/button-nav/ButtonNav.vue.d.ts +4 -4
- package/dist/lib/code-mirror-editor/CodeMirrorEditor.vue.d.ts +4 -4
- package/dist/lib/components.d.ts +3 -0
- package/dist/lib/components.js +30 -21
- package/dist/lib/form/Form.vue.d.ts +2 -2
- package/dist/lib/form/FormItem.vue.js +20 -8
- package/dist/lib/index.js +20 -14
- package/dist/lib/node_modules/@element-plus/icons-vue/dist/index.js +32 -0
- package/dist/lib/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/ScriptLoader.js +52 -0
- package/dist/lib/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/TinyMCE.js +10 -0
- package/dist/lib/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/Utils.js +145 -0
- package/dist/lib/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/components/Editor.js +160 -0
- package/dist/lib/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/components/EditorPropTypes.js +26 -0
- package/dist/lib/node_modules/@tinymce/tinymce-vue/lib/es2015/main/ts/index.js +4 -0
- package/dist/lib/package.json.js +1 -1
- package/dist/lib/page-header/PopoverMenu.vue.d.ts +1 -1
- package/dist/lib/page-table/PageTable.vue.d.ts +6087 -0
- package/dist/lib/page-table/PageTable.vue.js +378 -0
- package/dist/lib/page-table/PageTable.vue3.js +5 -0
- package/dist/lib/page-table/Toolbar.vue.d.ts +32 -0
- package/dist/lib/page-table/Toolbar.vue.js +271 -0
- package/dist/lib/page-table/Toolbar.vue3.js +5 -0
- package/dist/lib/page-table/index.d.ts +4 -0
- package/dist/lib/page-table/index.js +8 -0
- package/dist/lib/page-table/style.css +4 -0
- package/dist/lib/rich-editor/RichEditor.vue.d.ts +78 -0
- package/dist/lib/rich-editor/RichEditor.vue.js +105 -0
- package/dist/lib/rich-editor/RichEditor.vue3.js +5 -0
- package/dist/lib/rich-editor/index.d.ts +4 -0
- package/dist/lib/rich-editor/index.js +8 -0
- package/dist/lib/rich-editor/style.css +34 -0
- package/dist/lib/style.css +28 -0
- package/dist/lib/styles.css +1 -1
- package/dist/lib/utils/index.d.ts +1 -0
- package/dist/lib/utils/responsive-toolbar.d.ts +78 -0
- package/dist/lib/utils/responsive-toolbar.js +64 -0
- package/package.json +4 -1
- package/dist/umd/index.js +0 -3966
- package/dist/umd/styles.css +0 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AddInputItem, AddInputProps } from './types';
|
|
2
|
+
type __VLS_Props = AddInputProps;
|
|
3
|
+
type __VLS_PublicProps = {
|
|
4
|
+
modelValue?: AddInputItem[];
|
|
5
|
+
} & __VLS_Props;
|
|
6
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
"update:modelValue": (value: AddInputItem[]) => any;
|
|
8
|
+
} & {
|
|
9
|
+
"update:modelValue": (value: AddInputItem[]) => any;
|
|
10
|
+
change: (value: AddInputItem[]) => any;
|
|
11
|
+
add: () => any;
|
|
12
|
+
delete: (index: number) => any;
|
|
13
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
14
|
+
"onUpdate:modelValue"?: ((value: AddInputItem[]) => any) | undefined;
|
|
15
|
+
onChange?: ((value: AddInputItem[]) => any) | undefined;
|
|
16
|
+
onAdd?: (() => any) | undefined;
|
|
17
|
+
onDelete?: ((index: number) => any) | undefined;
|
|
18
|
+
}>, {
|
|
19
|
+
modelValue: AddInputItem[];
|
|
20
|
+
disabled: boolean;
|
|
21
|
+
readonly: boolean;
|
|
22
|
+
keyPlaceholder: string;
|
|
23
|
+
valuePlaceholder: string;
|
|
24
|
+
addButtonText: string;
|
|
25
|
+
deleteButtonText: string;
|
|
26
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { defineComponent, useModel, ref, watch, openBlock, createElementBlock, Fragment, renderList, createVNode, unref, createElementVNode, createBlock, withCtx, createTextVNode, toDisplayString, mergeModels } from "vue";
|
|
21
|
+
import { Plus as plus_default, Delete as delete_default } from "../node_modules/@element-plus/icons-vue/dist/index.js";
|
|
22
|
+
import { ElInput, ElButton } from "element-plus";
|
|
23
|
+
const _hoisted_1 = { class: "jky-add-input" };
|
|
24
|
+
const _hoisted_2 = { class: "jky-add-input__actions" };
|
|
25
|
+
const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
|
|
26
|
+
name: "JkyAddInput"
|
|
27
|
+
}), {
|
|
28
|
+
__name: "AddInput",
|
|
29
|
+
props: /* @__PURE__ */ mergeModels({
|
|
30
|
+
modelValue: { default: () => [] },
|
|
31
|
+
disabled: { type: Boolean, default: false },
|
|
32
|
+
readonly: { type: Boolean, default: false },
|
|
33
|
+
keyPlaceholder: { default: "key" },
|
|
34
|
+
valuePlaceholder: { default: "value" },
|
|
35
|
+
addButtonText: { default: "添加" },
|
|
36
|
+
deleteButtonText: { default: "删除" }
|
|
37
|
+
}, {
|
|
38
|
+
"modelValue": {
|
|
39
|
+
default: () => []
|
|
40
|
+
},
|
|
41
|
+
"modelModifiers": {}
|
|
42
|
+
}),
|
|
43
|
+
emits: /* @__PURE__ */ mergeModels(["update:modelValue", "change", "add", "delete"], ["update:modelValue"]),
|
|
44
|
+
setup(__props, { emit: __emit }) {
|
|
45
|
+
const props = __props;
|
|
46
|
+
const emit = __emit;
|
|
47
|
+
const modelValue = useModel(__props, "modelValue");
|
|
48
|
+
const items = ref([]);
|
|
49
|
+
function initData() {
|
|
50
|
+
if (!props.modelValue || props.modelValue.length === 0) {
|
|
51
|
+
items.value = [{ key: "", value: "" }];
|
|
52
|
+
} else {
|
|
53
|
+
items.value = props.modelValue.map((item) => __spreadValues({}, item));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
watch(
|
|
57
|
+
() => props.modelValue,
|
|
58
|
+
(newValue) => {
|
|
59
|
+
if (!newValue || newValue.length === 0) {
|
|
60
|
+
items.value = [{ key: "", value: "" }];
|
|
61
|
+
} else {
|
|
62
|
+
items.value = newValue.map((item) => __spreadValues({}, item));
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{ deep: true }
|
|
66
|
+
);
|
|
67
|
+
function updateModelValue() {
|
|
68
|
+
modelValue.value = items.value.map((item) => __spreadValues({}, item));
|
|
69
|
+
emit("change", items.value.map((item) => __spreadValues({}, item)));
|
|
70
|
+
}
|
|
71
|
+
function handleAdd() {
|
|
72
|
+
if (props.disabled || props.readonly)
|
|
73
|
+
return;
|
|
74
|
+
items.value = [
|
|
75
|
+
...items.value,
|
|
76
|
+
{ key: "", value: "" }
|
|
77
|
+
];
|
|
78
|
+
updateModelValue();
|
|
79
|
+
emit("add");
|
|
80
|
+
}
|
|
81
|
+
function handleDelete(index) {
|
|
82
|
+
if (props.disabled || props.readonly)
|
|
83
|
+
return;
|
|
84
|
+
if (items.value.length <= 1)
|
|
85
|
+
return;
|
|
86
|
+
items.value.splice(index, 1);
|
|
87
|
+
updateModelValue();
|
|
88
|
+
emit("delete", index);
|
|
89
|
+
}
|
|
90
|
+
initData();
|
|
91
|
+
return (_ctx, _cache) => {
|
|
92
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
93
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(items.value, (item, index) => {
|
|
94
|
+
return openBlock(), createElementBlock("div", {
|
|
95
|
+
key: index,
|
|
96
|
+
class: "jky-add-input__row"
|
|
97
|
+
}, [
|
|
98
|
+
createVNode(unref(ElInput), {
|
|
99
|
+
"model-value": item.key,
|
|
100
|
+
placeholder: __props.keyPlaceholder,
|
|
101
|
+
disabled: __props.disabled || __props.readonly,
|
|
102
|
+
class: "jky-add-input__key",
|
|
103
|
+
"onUpdate:modelValue": (val) => {
|
|
104
|
+
item.key = val;
|
|
105
|
+
updateModelValue();
|
|
106
|
+
}
|
|
107
|
+
}, null, 8, ["model-value", "placeholder", "disabled", "onUpdate:modelValue"]),
|
|
108
|
+
createVNode(unref(ElInput), {
|
|
109
|
+
"model-value": item.value,
|
|
110
|
+
placeholder: __props.valuePlaceholder,
|
|
111
|
+
disabled: __props.disabled || __props.readonly,
|
|
112
|
+
class: "jky-add-input__value",
|
|
113
|
+
"onUpdate:modelValue": (val) => {
|
|
114
|
+
item.value = val;
|
|
115
|
+
updateModelValue();
|
|
116
|
+
}
|
|
117
|
+
}, null, 8, ["model-value", "placeholder", "disabled", "onUpdate:modelValue"]),
|
|
118
|
+
createElementVNode("div", _hoisted_2, [
|
|
119
|
+
index === 0 || __props.readonly ? (openBlock(), createBlock(unref(ElButton), {
|
|
120
|
+
key: 0,
|
|
121
|
+
type: "primary",
|
|
122
|
+
disabled: __props.disabled || __props.readonly,
|
|
123
|
+
icon: unref(plus_default),
|
|
124
|
+
onClick: handleAdd
|
|
125
|
+
}, {
|
|
126
|
+
default: withCtx(() => [
|
|
127
|
+
createTextVNode(toDisplayString(__props.addButtonText), 1)
|
|
128
|
+
]),
|
|
129
|
+
_: 1
|
|
130
|
+
}, 8, ["disabled", "icon"])) : (openBlock(), createBlock(unref(ElButton), {
|
|
131
|
+
key: 1,
|
|
132
|
+
type: "danger",
|
|
133
|
+
disabled: __props.disabled || __props.readonly,
|
|
134
|
+
icon: unref(delete_default),
|
|
135
|
+
onClick: ($event) => handleDelete(index)
|
|
136
|
+
}, {
|
|
137
|
+
default: withCtx(() => [
|
|
138
|
+
createTextVNode(toDisplayString(__props.deleteButtonText), 1)
|
|
139
|
+
]),
|
|
140
|
+
_: 1
|
|
141
|
+
}, 8, ["disabled", "icon", "onClick"]))
|
|
142
|
+
])
|
|
143
|
+
]);
|
|
144
|
+
}), 128))
|
|
145
|
+
]);
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
}));
|
|
149
|
+
export {
|
|
150
|
+
_sfc_main as default
|
|
151
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
/* 禁止使用 @apply,所有 TailwindCSS 工具类直接写在 class 中 */
|
|
3
|
+
/* 样式文件仅用于定义组件特定的自定义纯 CSS 样式 */
|
|
4
|
+
/* AddInput 组件样式变量 */
|
|
5
|
+
:root {
|
|
6
|
+
--jky-add-input-gap: 12px;
|
|
7
|
+
--jky-add-input-row-gap: 8px;
|
|
8
|
+
--jky-add-input-min-width: 100px;
|
|
9
|
+
--jky-add-input-action-width: 80px;
|
|
10
|
+
}
|
|
11
|
+
.jky-add-input {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
gap: var(--jky-add-input-row-gap);
|
|
15
|
+
min-width: var(--jky-add-input-min-width);
|
|
16
|
+
}
|
|
17
|
+
.jky-add-input__row {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
gap: var(--jky-add-input-gap);
|
|
21
|
+
}
|
|
22
|
+
.jky-add-input__key {
|
|
23
|
+
flex: 1;
|
|
24
|
+
min-width: 0;
|
|
25
|
+
}
|
|
26
|
+
.jky-add-input__value {
|
|
27
|
+
flex: 1;
|
|
28
|
+
min-width: 0;
|
|
29
|
+
}
|
|
30
|
+
.jky-add-input__actions {
|
|
31
|
+
display: flex;
|
|
32
|
+
gap: var(--jky-add-input-gap);
|
|
33
|
+
flex-shrink: 0;
|
|
34
|
+
width: var(--jky-add-input-action-width);
|
|
35
|
+
}
|
|
@@ -18,19 +18,19 @@ interface NavItem {
|
|
|
18
18
|
to?: RouteLocationRaw;
|
|
19
19
|
}
|
|
20
20
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
21
|
-
change: (value: string | number) => any;
|
|
22
21
|
"update:modelValue": (value: string | number) => any;
|
|
22
|
+
change: (value: string | number) => any;
|
|
23
23
|
navClick: (item: NavItem) => any;
|
|
24
24
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
25
|
-
onChange?: ((value: string | number) => any) | undefined;
|
|
26
25
|
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
26
|
+
onChange?: ((value: string | number) => any) | undefined;
|
|
27
27
|
onNavClick?: ((item: NavItem) => any) | undefined;
|
|
28
28
|
}>, {
|
|
29
29
|
size: "" | "default" | "large" | "small";
|
|
30
|
-
type: "" | "default" | "
|
|
30
|
+
type: "" | "default" | "text" | "primary" | "success" | "warning" | "info" | "danger";
|
|
31
|
+
plain: boolean;
|
|
31
32
|
items: NavItem[];
|
|
32
33
|
limit: number;
|
|
33
|
-
plain: boolean;
|
|
34
34
|
route: boolean;
|
|
35
35
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
36
36
|
export default _default;
|
|
@@ -5,15 +5,15 @@ declare const _default: import('vue').DefineComponent<CodeMirrorEditorProps, {
|
|
|
5
5
|
getContent: () => string;
|
|
6
6
|
setContent: (content: string) => void;
|
|
7
7
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
8
|
-
change: (value: string) => any;
|
|
9
8
|
"update:modelValue": (value: string) => any;
|
|
9
|
+
change: (value: string) => any;
|
|
10
10
|
}, string, import('vue').PublicProps, Readonly<CodeMirrorEditorProps> & Readonly<{
|
|
11
|
-
onChange?: ((value: string) => any) | undefined;
|
|
12
11
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
12
|
+
onChange?: ((value: string) => any) | undefined;
|
|
13
13
|
}>, {
|
|
14
|
-
disabled: boolean;
|
|
15
|
-
modelValue: string;
|
|
16
14
|
height: string;
|
|
15
|
+
modelValue: string;
|
|
16
|
+
disabled: boolean;
|
|
17
17
|
readonly: boolean;
|
|
18
18
|
language: "javascript" | "typescript" | "json" | "css" | "markdown" | "html" | "vue";
|
|
19
19
|
theme: "oneDark" | "default";
|
package/dist/es/components.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { Plugin } from 'vue';
|
|
2
|
+
export * from './add-input';
|
|
2
3
|
export * from './button';
|
|
3
4
|
export * from './button-nav';
|
|
4
5
|
export * from './code-mirror-editor';
|
|
5
6
|
export * from './form';
|
|
6
7
|
export * from './menu';
|
|
7
8
|
export * from './page-header';
|
|
9
|
+
export * from './page-table';
|
|
10
|
+
export * from './rich-editor';
|
|
8
11
|
export * from './say-hello';
|
|
9
12
|
export declare const components: Plugin[];
|
|
10
13
|
export default components;
|
package/dist/es/components.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { JkyAddInput } from "./add-input/index.js";
|
|
1
2
|
import { JkyButton } from "./button/index.js";
|
|
2
3
|
import { JkyButtonNav } from "./button-nav/index.js";
|
|
3
4
|
import { JkyCodeMirrorEditor } from "./code-mirror-editor/index.js";
|
|
4
5
|
import { JkyForm } from "./form/index.js";
|
|
5
6
|
import { JkyMenu } from "./menu/index.js";
|
|
6
7
|
import { JkyPageHeader } from "./page-header/index.js";
|
|
8
|
+
import { JkyPageTable } from "./page-table/index.js";
|
|
9
|
+
import { JkyRichEditor } from "./rich-editor/index.js";
|
|
7
10
|
import { JkySayHello } from "./say-hello/index.js";
|
|
8
11
|
const components = [
|
|
9
12
|
JkySayHello,
|
|
@@ -12,15 +15,21 @@ const components = [
|
|
|
12
15
|
JkyPageHeader,
|
|
13
16
|
JkyMenu,
|
|
14
17
|
JkyForm,
|
|
15
|
-
JkyCodeMirrorEditor
|
|
18
|
+
JkyCodeMirrorEditor,
|
|
19
|
+
JkyAddInput,
|
|
20
|
+
JkyRichEditor,
|
|
21
|
+
JkyPageTable
|
|
16
22
|
];
|
|
17
23
|
export {
|
|
24
|
+
JkyAddInput,
|
|
18
25
|
JkyButton,
|
|
19
26
|
JkyButtonNav,
|
|
20
27
|
JkyCodeMirrorEditor,
|
|
21
28
|
JkyForm,
|
|
22
29
|
JkyMenu,
|
|
23
30
|
JkyPageHeader,
|
|
31
|
+
JkyPageTable,
|
|
32
|
+
JkyRichEditor,
|
|
24
33
|
JkySayHello,
|
|
25
34
|
components
|
|
26
35
|
};
|
|
@@ -308,19 +308,19 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
|
308
308
|
};
|
|
309
309
|
}) | undefined>;
|
|
310
310
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
311
|
+
"update:modelValue": (value: Record<string, any>) => any;
|
|
311
312
|
change: (value: Record<string, any>) => any;
|
|
312
313
|
reset: () => any;
|
|
313
314
|
submit: (data: Record<string, any>) => any;
|
|
314
|
-
"update:modelValue": (value: Record<string, any>) => any;
|
|
315
315
|
validate: (result: {
|
|
316
316
|
valid: boolean;
|
|
317
317
|
fields?: any;
|
|
318
318
|
}) => any;
|
|
319
319
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
320
|
+
"onUpdate:modelValue"?: ((value: Record<string, any>) => any) | undefined;
|
|
320
321
|
onChange?: ((value: Record<string, any>) => any) | undefined;
|
|
321
322
|
onReset?: (() => any) | undefined;
|
|
322
323
|
onSubmit?: ((data: Record<string, any>) => any) | undefined;
|
|
323
|
-
"onUpdate:modelValue"?: ((value: Record<string, any>) => any) | undefined;
|
|
324
324
|
onValidate?: ((result: {
|
|
325
325
|
valid: boolean;
|
|
326
326
|
fields?: any;
|
|
@@ -52,7 +52,9 @@ var __async = (__this, __arguments, generator) => {
|
|
|
52
52
|
import { defineComponent, ref, watch, computed, openBlock, createElementBlock, createBlock, unref, mergeProps, withCtx, createElementVNode, resolveDynamicComponent, Fragment, createTextVNode, toDisplayString, createCommentVNode, createSlots, h } from "vue";
|
|
53
53
|
import { Plus as plus_default, CircleCloseFilled as circle_close_filled_default, CircleCheckFilled as circle_check_filled_default, WarningFilled as warning_filled_default, QuestionFilled as question_filled_default } from "../node_modules/@element-plus/icons-vue/dist/index.js";
|
|
54
54
|
import { ElFormItem, ElDivider, ElInput, ElUpload, ElButton, ElIcon, ElInputNumber, ElRate, ElColorPicker, ElTreeSelect, ElCascader, ElSlider, ElSwitch, ElCheckboxGroup, ElCheckbox, ElRadioGroup, ElRadio, ElTimeSelect, ElTimePicker, ElDatePicker, ElAutocomplete, ElSelect, ElTooltip } from "element-plus";
|
|
55
|
+
import { JkyAddInput } from "../add-input/index.js";
|
|
55
56
|
import { JkyCodeMirrorEditor } from "../code-mirror-editor/index.js";
|
|
57
|
+
import { JkyRichEditor } from "../rich-editor/index.js";
|
|
56
58
|
const _hoisted_1 = {
|
|
57
59
|
key: 0,
|
|
58
60
|
style: { "display": "none" }
|
|
@@ -360,6 +362,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
360
362
|
const codeMirrorProps = __spreadValues(__spreadValues({}, commonProps), componentProps.value);
|
|
361
363
|
return h(JkyCodeMirrorEditor, codeMirrorProps);
|
|
362
364
|
}
|
|
365
|
+
// RichEditor 富文本编辑器
|
|
366
|
+
case "rich-editor": {
|
|
367
|
+
const richEditorProps = __spreadValues(__spreadValues({}, commonProps), componentProps.value);
|
|
368
|
+
return h(JkyRichEditor, richEditorProps);
|
|
369
|
+
}
|
|
370
|
+
// AddInput 动态键值对输入框
|
|
371
|
+
case "add-input": {
|
|
372
|
+
const addInputProps = __spreadValues(__spreadValues({}, commonProps), componentProps.value);
|
|
373
|
+
return h(JkyAddInput, addInputProps);
|
|
374
|
+
}
|
|
363
375
|
case "custom":
|
|
364
376
|
return (_b = (_a = props.config).render) == null ? void 0 : _b.call(_a, commonProps);
|
|
365
377
|
default:
|
package/dist/es/index.js
CHANGED
|
@@ -2,17 +2,21 @@ import { components } from "./components.js";
|
|
|
2
2
|
import { createInstaller } from "./utils/installer.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import { JkyComponentLibResolver } from "./resolver.js";
|
|
5
|
+
import { JkyAddInput } from "./add-input/index.js";
|
|
5
6
|
import { JkyButton } from "./button/index.js";
|
|
6
7
|
import { JkyButtonNav } from "./button-nav/index.js";
|
|
7
8
|
import { JkyCodeMirrorEditor } from "./code-mirror-editor/index.js";
|
|
8
9
|
import { JkyForm } from "./form/index.js";
|
|
9
10
|
import { JkyMenu } from "./menu/index.js";
|
|
10
11
|
import { JkyPageHeader } from "./page-header/index.js";
|
|
12
|
+
import { JkyPageTable } from "./page-table/index.js";
|
|
13
|
+
import { JkyRichEditor } from "./rich-editor/index.js";
|
|
11
14
|
import { JkySayHello } from "./say-hello/index.js";
|
|
12
15
|
const installer = createInstaller(components);
|
|
13
16
|
const install = installer.install;
|
|
14
17
|
const version = installer.version;
|
|
15
18
|
export {
|
|
19
|
+
JkyAddInput,
|
|
16
20
|
JkyButton,
|
|
17
21
|
JkyButtonNav,
|
|
18
22
|
JkyCodeMirrorEditor,
|
|
@@ -20,6 +24,8 @@ export {
|
|
|
20
24
|
JkyForm,
|
|
21
25
|
JkyMenu,
|
|
22
26
|
JkyPageHeader,
|
|
27
|
+
JkyPageTable,
|
|
28
|
+
JkyRichEditor,
|
|
23
29
|
JkySayHello,
|
|
24
30
|
components,
|
|
25
31
|
installer as default,
|
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createElementBlock, createElementVNode } from "vue";
|
|
2
2
|
/*! Element Plus Icons Vue v2.3.2 */
|
|
3
|
+
var _sfc_main6 = /* @__PURE__ */ defineComponent({
|
|
4
|
+
name: "ArrowDown",
|
|
5
|
+
__name: "arrow-down",
|
|
6
|
+
setup(__props) {
|
|
7
|
+
return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
9
|
+
viewBox: "0 0 1024 1024"
|
|
10
|
+
}, [
|
|
11
|
+
createElementVNode("path", {
|
|
12
|
+
fill: "currentColor",
|
|
13
|
+
d: "M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"
|
|
14
|
+
})
|
|
15
|
+
]));
|
|
16
|
+
}
|
|
17
|
+
}), arrow_down_default = _sfc_main6;
|
|
3
18
|
var _sfc_main48 = /* @__PURE__ */ defineComponent({
|
|
4
19
|
name: "CircleCheckFilled",
|
|
5
20
|
__name: "circle-check-filled",
|
|
@@ -30,6 +45,21 @@ var _sfc_main50 = /* @__PURE__ */ defineComponent({
|
|
|
30
45
|
]));
|
|
31
46
|
}
|
|
32
47
|
}), circle_close_filled_default = _sfc_main50;
|
|
48
|
+
var _sfc_main80 = /* @__PURE__ */ defineComponent({
|
|
49
|
+
name: "Delete",
|
|
50
|
+
__name: "delete",
|
|
51
|
+
setup(__props) {
|
|
52
|
+
return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
|
|
53
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
54
|
+
viewBox: "0 0 1024 1024"
|
|
55
|
+
}, [
|
|
56
|
+
createElementVNode("path", {
|
|
57
|
+
fill: "currentColor",
|
|
58
|
+
d: "M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"
|
|
59
|
+
})
|
|
60
|
+
]));
|
|
61
|
+
}
|
|
62
|
+
}), delete_default = _sfc_main80;
|
|
33
63
|
var _sfc_main201 = /* @__PURE__ */ defineComponent({
|
|
34
64
|
name: "Plus",
|
|
35
65
|
__name: "plus",
|
|
@@ -76,8 +106,10 @@ var _sfc_main287 = /* @__PURE__ */ defineComponent({
|
|
|
76
106
|
}
|
|
77
107
|
}), warning_filled_default = _sfc_main287;
|
|
78
108
|
export {
|
|
109
|
+
arrow_down_default as ArrowDown,
|
|
79
110
|
circle_check_filled_default as CircleCheckFilled,
|
|
80
111
|
circle_close_filled_default as CircleCloseFilled,
|
|
112
|
+
delete_default as Delete,
|
|
81
113
|
plus_default as Plus,
|
|
82
114
|
question_filled_default as QuestionFilled,
|
|
83
115
|
warning_filled_default as WarningFilled
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { uuid } from "./Utils.js";
|
|
2
|
+
var createState = function() {
|
|
3
|
+
return {
|
|
4
|
+
listeners: [],
|
|
5
|
+
scriptId: uuid("tiny-script"),
|
|
6
|
+
scriptLoaded: false
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
var CreateScriptLoader = function() {
|
|
10
|
+
var state = createState();
|
|
11
|
+
var injectScriptTag = function(scriptId, doc, url, callback) {
|
|
12
|
+
var scriptTag = doc.createElement("script");
|
|
13
|
+
scriptTag.referrerPolicy = "origin";
|
|
14
|
+
scriptTag.type = "application/javascript";
|
|
15
|
+
scriptTag.id = scriptId;
|
|
16
|
+
scriptTag.src = url;
|
|
17
|
+
var handler = function() {
|
|
18
|
+
scriptTag.removeEventListener("load", handler);
|
|
19
|
+
callback();
|
|
20
|
+
};
|
|
21
|
+
scriptTag.addEventListener("load", handler);
|
|
22
|
+
if (doc.head) {
|
|
23
|
+
doc.head.appendChild(scriptTag);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
var load = function(doc, url, callback) {
|
|
27
|
+
if (state.scriptLoaded) {
|
|
28
|
+
callback();
|
|
29
|
+
} else {
|
|
30
|
+
state.listeners.push(callback);
|
|
31
|
+
if (!doc.getElementById(state.scriptId)) {
|
|
32
|
+
injectScriptTag(state.scriptId, doc, url, function() {
|
|
33
|
+
state.listeners.forEach(function(fn) {
|
|
34
|
+
return fn();
|
|
35
|
+
});
|
|
36
|
+
state.scriptLoaded = true;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var reinitialize = function() {
|
|
42
|
+
state = createState();
|
|
43
|
+
};
|
|
44
|
+
return {
|
|
45
|
+
load,
|
|
46
|
+
reinitialize
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
var ScriptLoader = CreateScriptLoader();
|
|
50
|
+
export {
|
|
51
|
+
ScriptLoader
|
|
52
|
+
};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { watch } from "vue";
|
|
2
|
+
var validEvents = [
|
|
3
|
+
"onActivate",
|
|
4
|
+
"onAddUndo",
|
|
5
|
+
"onBeforeAddUndo",
|
|
6
|
+
"onBeforeExecCommand",
|
|
7
|
+
"onBeforeGetContent",
|
|
8
|
+
"onBeforeRenderUI",
|
|
9
|
+
"onBeforeSetContent",
|
|
10
|
+
"onBeforePaste",
|
|
11
|
+
"onBlur",
|
|
12
|
+
"onChange",
|
|
13
|
+
"onClearUndos",
|
|
14
|
+
"onClick",
|
|
15
|
+
"onContextMenu",
|
|
16
|
+
"onCommentChange",
|
|
17
|
+
"onCompositionEnd",
|
|
18
|
+
"onCompositionStart",
|
|
19
|
+
"onCompositionUpdate",
|
|
20
|
+
"onCopy",
|
|
21
|
+
"onCut",
|
|
22
|
+
"onDblclick",
|
|
23
|
+
"onDeactivate",
|
|
24
|
+
"onDirty",
|
|
25
|
+
"onDrag",
|
|
26
|
+
"onDragDrop",
|
|
27
|
+
"onDragEnd",
|
|
28
|
+
"onDragGesture",
|
|
29
|
+
"onDragOver",
|
|
30
|
+
"onDrop",
|
|
31
|
+
"onExecCommand",
|
|
32
|
+
"onFocus",
|
|
33
|
+
"onFocusIn",
|
|
34
|
+
"onFocusOut",
|
|
35
|
+
"onGetContent",
|
|
36
|
+
"onHide",
|
|
37
|
+
"onInit",
|
|
38
|
+
"onInput",
|
|
39
|
+
"onKeyDown",
|
|
40
|
+
"onKeyPress",
|
|
41
|
+
"onKeyUp",
|
|
42
|
+
"onLoadContent",
|
|
43
|
+
"onMouseDown",
|
|
44
|
+
"onMouseEnter",
|
|
45
|
+
"onMouseLeave",
|
|
46
|
+
"onMouseMove",
|
|
47
|
+
"onMouseOut",
|
|
48
|
+
"onMouseOver",
|
|
49
|
+
"onMouseUp",
|
|
50
|
+
"onNodeChange",
|
|
51
|
+
"onObjectResizeStart",
|
|
52
|
+
"onObjectResized",
|
|
53
|
+
"onObjectSelected",
|
|
54
|
+
"onPaste",
|
|
55
|
+
"onPostProcess",
|
|
56
|
+
"onPostRender",
|
|
57
|
+
"onPreProcess",
|
|
58
|
+
"onProgressState",
|
|
59
|
+
"onRedo",
|
|
60
|
+
"onRemove",
|
|
61
|
+
"onReset",
|
|
62
|
+
"onSaveContent",
|
|
63
|
+
"onSelectionChange",
|
|
64
|
+
"onSetAttrib",
|
|
65
|
+
"onSetContent",
|
|
66
|
+
"onShow",
|
|
67
|
+
"onSubmit",
|
|
68
|
+
"onUndo",
|
|
69
|
+
"onVisualAid"
|
|
70
|
+
];
|
|
71
|
+
var isValidKey = function(key) {
|
|
72
|
+
return validEvents.map(function(event) {
|
|
73
|
+
return event.toLowerCase();
|
|
74
|
+
}).indexOf(key.toLowerCase()) !== -1;
|
|
75
|
+
};
|
|
76
|
+
var bindHandlers = function(initEvent, listeners, editor) {
|
|
77
|
+
Object.keys(listeners).filter(isValidKey).forEach(function(key) {
|
|
78
|
+
var handler = listeners[key];
|
|
79
|
+
if (typeof handler === "function") {
|
|
80
|
+
if (key === "onInit") {
|
|
81
|
+
handler(initEvent, editor);
|
|
82
|
+
} else {
|
|
83
|
+
editor.on(key.substring(2), function(e) {
|
|
84
|
+
return handler(e, editor);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
var bindModelHandlers = function(props, ctx, editor, modelValue) {
|
|
91
|
+
var modelEvents = props.modelEvents ? props.modelEvents : null;
|
|
92
|
+
var normalizedEvents = Array.isArray(modelEvents) ? modelEvents.join(" ") : modelEvents;
|
|
93
|
+
watch(modelValue, function(val, prevVal) {
|
|
94
|
+
if (editor && typeof val === "string" && val !== prevVal && val !== editor.getContent({ format: props.outputFormat })) {
|
|
95
|
+
editor.setContent(val);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
editor.on(normalizedEvents ? normalizedEvents : "change input undo redo", function() {
|
|
99
|
+
ctx.emit("update:modelValue", editor.getContent({ format: props.outputFormat }));
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
var initEditor = function(initEvent, props, ctx, editor, modelValue, content) {
|
|
103
|
+
editor.setContent(content());
|
|
104
|
+
if (ctx.attrs["onUpdate:modelValue"]) {
|
|
105
|
+
bindModelHandlers(props, ctx, editor, modelValue);
|
|
106
|
+
}
|
|
107
|
+
bindHandlers(initEvent, ctx.attrs, editor);
|
|
108
|
+
};
|
|
109
|
+
var unique = 0;
|
|
110
|
+
var uuid = function(prefix) {
|
|
111
|
+
var time = Date.now();
|
|
112
|
+
var random = Math.floor(Math.random() * 1e9);
|
|
113
|
+
unique++;
|
|
114
|
+
return prefix + "_" + random + unique + String(time);
|
|
115
|
+
};
|
|
116
|
+
var isTextarea = function(element) {
|
|
117
|
+
return element !== null && element.tagName.toLowerCase() === "textarea";
|
|
118
|
+
};
|
|
119
|
+
var normalizePluginArray = function(plugins) {
|
|
120
|
+
if (typeof plugins === "undefined" || plugins === "") {
|
|
121
|
+
return [];
|
|
122
|
+
}
|
|
123
|
+
return Array.isArray(plugins) ? plugins : plugins.split(" ");
|
|
124
|
+
};
|
|
125
|
+
var mergePlugins = function(initPlugins, inputPlugins) {
|
|
126
|
+
return normalizePluginArray(initPlugins).concat(normalizePluginArray(inputPlugins));
|
|
127
|
+
};
|
|
128
|
+
var isNullOrUndefined = function(value) {
|
|
129
|
+
return value === null || value === void 0;
|
|
130
|
+
};
|
|
131
|
+
var isDisabledOptionSupported = function(editor) {
|
|
132
|
+
var _a;
|
|
133
|
+
return typeof ((_a = editor.options) === null || _a === void 0 ? void 0 : _a.set) === "function" && editor.options.isRegistered("disabled");
|
|
134
|
+
};
|
|
135
|
+
export {
|
|
136
|
+
bindHandlers,
|
|
137
|
+
bindModelHandlers,
|
|
138
|
+
initEditor,
|
|
139
|
+
isDisabledOptionSupported,
|
|
140
|
+
isNullOrUndefined,
|
|
141
|
+
isTextarea,
|
|
142
|
+
isValidKey,
|
|
143
|
+
mergePlugins,
|
|
144
|
+
uuid
|
|
145
|
+
};
|