starfish-form-custom 1.0.44 → 1.0.46

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.
Files changed (39) hide show
  1. package/.pnpm-debug.log +828 -828
  2. package/components.d.ts +0 -2
  3. package/dist/{formAction-48f1f081.mjs → formAction-b76664af.mjs} +44 -52
  4. package/dist/{index-e7b2d7c0.mjs → index-0aa74f91.mjs} +40 -93
  5. package/dist/{index-e8b18d70.mjs → index-7fc8db96.mjs} +17 -22
  6. package/dist/{index-c2fdc90f.mjs → index-d1c1ba4b.mjs} +55 -81
  7. package/dist/{main-c6aa3683.mjs → main-d99755be.mjs} +273 -518
  8. package/dist/{starfish-form-ac5dbff7.mjs → starfish-form-0baee1df.mjs} +13 -9
  9. package/dist/starfish-form.mjs +1 -1
  10. package/dist/style.css +23 -130
  11. package/dist/types/form/src/common/Loading.vue.d.ts +2 -2
  12. package/dist/types/form/src/main.d.ts +17 -10
  13. package/dist/types/form/src/starfish-form.vue.d.ts +17 -10
  14. package/dist/types/form/src/utils/fieldProps.d.ts +4 -0
  15. package/package.json +43 -52
  16. package/src/components/CheckBox/index.vue +2 -2
  17. package/src/components/Date/index.vue +2 -2
  18. package/src/components/DateTime/index.vue +2 -2
  19. package/src/components/InputNumber/index.vue +2 -2
  20. package/src/components/Radio/index.vue +9 -1
  21. package/src/components/RichText/index.vue +65 -180
  22. package/src/components/Rule/index.vue +2 -2
  23. package/src/components/Rule/rules.js +3 -3
  24. package/src/components/Selected/index.vue +2 -2
  25. package/src/components/Selecteds/index.vue +2 -2
  26. package/src/components/Switch/index.vue +1 -1
  27. package/src/components/Text/index.vue +2 -2
  28. package/src/components/TextArea/index.vue +2 -2
  29. package/src/starfish-form.vue +8 -3
  30. package/src/styles/formedit.scss +115 -115
  31. package/src/styles/keyvalueConfig.scss +56 -56
  32. package/src/utils/customHooks.ts +0 -1
  33. package/src/utils/fieldProps.ts +5 -1
  34. package/stats.html +2230 -2123
  35. package/dist/types/form/src/common/formAction.vue.d.ts +0 -85
  36. package/dist/types/form/src/components/RichText/MenuBar.vue.d.ts +0 -34
  37. package/dist/types/form/src/components/RichText/MenuItem.vue.d.ts +0 -42
  38. package/src/components/RichText/MenuBar.vue +0 -144
  39. package/src/components/RichText/MenuItem.vue +0 -98
@@ -1,85 +0,0 @@
1
- import type { Ref } from '@vue/reactivity';
2
- import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
3
- declare const _sfc_main: DefineComponent<{
4
- item: {
5
- type: ObjectConstructor;
6
- default: () => {};
7
- };
8
- data: {
9
- type: ObjectConstructor;
10
- default: () => {};
11
- };
12
- drag: {
13
- type: BooleanConstructor;
14
- default: boolean;
15
- };
16
- labelalign: {
17
- type: StringConstructor;
18
- default: string;
19
- };
20
- labelWidth: {
21
- type: NumberConstructor;
22
- };
23
- size: {
24
- type: StringConstructor;
25
- };
26
- isForm: {
27
- type: BooleanConstructor;
28
- default: boolean;
29
- };
30
- }, {
31
- rules: {
32
- funcName: {
33
- required: boolean;
34
- message: string;
35
- trigger: string;
36
- }[];
37
- };
38
- actionRef: Ref<any>;
39
- action: any;
40
- currentAction: any;
41
- getField(methods: string): any;
42
- onAction(type?: string | undefined): void;
43
- onEditAction(key: any, type: string): void;
44
- handleAction(item: any): void;
45
- onSave(): void;
46
- onCancel(): void;
47
- copyAction(item: any): void;
48
- deleteAction(item: any): void;
49
- addAction(type?: string | undefined): void;
50
- onConfirm(): void;
51
- }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, Record<string, any>, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
52
- item: {
53
- type: ObjectConstructor;
54
- default: () => {};
55
- };
56
- data: {
57
- type: ObjectConstructor;
58
- default: () => {};
59
- };
60
- drag: {
61
- type: BooleanConstructor;
62
- default: boolean;
63
- };
64
- labelalign: {
65
- type: StringConstructor;
66
- default: string;
67
- };
68
- labelWidth: {
69
- type: NumberConstructor;
70
- };
71
- size: {
72
- type: StringConstructor;
73
- };
74
- isForm: {
75
- type: BooleanConstructor;
76
- default: boolean;
77
- };
78
- }>>, {
79
- data: Record<string, any>;
80
- drag: boolean;
81
- item: Record<string, any>;
82
- labelalign: string;
83
- isForm: boolean;
84
- }>;
85
- export default _sfc_main;
@@ -1,34 +0,0 @@
1
- import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
2
- import { PropType } from 'vue';
3
- declare const _sfc_main: DefineComponent<{
4
- editor: {
5
- type: PropType<any>;
6
- required: true;
7
- };
8
- }, {
9
- items: ({
10
- icon: string;
11
- title: string;
12
- action: () => any;
13
- isActive: () => any;
14
- type?: undefined;
15
- } | {
16
- type: string;
17
- icon?: undefined;
18
- title?: undefined;
19
- action?: undefined;
20
- isActive?: undefined;
21
- } | {
22
- icon: string;
23
- title: string;
24
- action: () => any;
25
- isActive?: undefined;
26
- type?: undefined;
27
- })[];
28
- }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, Record<string, any>, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
29
- editor: {
30
- type: PropType<any>;
31
- required: true;
32
- };
33
- }>>, {}>;
34
- export default _sfc_main;
@@ -1,42 +0,0 @@
1
- import type { ComputedRef } from '@vue/reactivity';
2
- import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
3
- declare const _sfc_main: DefineComponent<{
4
- icon: {
5
- type: StringConstructor;
6
- required: true;
7
- };
8
- title: {
9
- type: StringConstructor;
10
- required: true;
11
- };
12
- action: {
13
- type: FunctionConstructor;
14
- required: true;
15
- };
16
- isActive: {
17
- type: FunctionConstructor;
18
- default: null;
19
- };
20
- }, {
21
- chineseTitle: ComputedRef<string>;
22
- }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, Record<string, any>, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
23
- icon: {
24
- type: StringConstructor;
25
- required: true;
26
- };
27
- title: {
28
- type: StringConstructor;
29
- required: true;
30
- };
31
- action: {
32
- type: FunctionConstructor;
33
- required: true;
34
- };
35
- isActive: {
36
- type: FunctionConstructor;
37
- default: null;
38
- };
39
- }>>, {
40
- isActive: Function;
41
- }>;
42
- export default _sfc_main;
@@ -1,144 +0,0 @@
1
- <template>
2
- <div class="editor__header">
3
- <template v-for="(item, index) in items" :key="index">
4
- <div v-if="item.type === 'divider'" class="divider" />
5
- <MenuItem v-else :icon="item.icon" :title="item.title" :action="item.action" :is-active="item.isActive" />
6
- </template>
7
- </div>
8
- </template>
9
-
10
- <script lang="ts">
11
- import { defineComponent, PropType } from 'vue'
12
- import MenuItem from './MenuItem.vue'
13
-
14
- export default defineComponent({
15
- name: 'MenuBar',
16
- components: {
17
- MenuItem
18
- },
19
- props: {
20
- editor: {
21
- type: Object as PropType<any>,
22
- required: true
23
- }
24
- },
25
- setup(props) {
26
- const items = [
27
- {
28
- icon: 'bold',
29
- title: 'Bold',
30
- action: () => props.editor.chain().focus().toggleBold().run(),
31
- isActive: () => props.editor.isActive('bold'),
32
- },
33
- {
34
- icon: 'italic',
35
- title: 'Italic',
36
- action: () => props.editor.chain().focus().toggleItalic().run(),
37
- isActive: () => props.editor.isActive('italic'),
38
- },
39
- {
40
- icon: 'strikethrough',
41
- title: 'Strike',
42
- action: () => props.editor.chain().focus().toggleStrike().run(),
43
- isActive: () => props.editor.isActive('strike'),
44
- },
45
- {
46
- icon: 'code-view',
47
- title: 'Code',
48
- action: () => props.editor.chain().focus().toggleCode().run(),
49
- isActive: () => props.editor.isActive('code'),
50
- },
51
- {
52
- type: 'divider',
53
- },
54
- {
55
- icon: 'h-1',
56
- title: 'Heading 1',
57
- action: () => props.editor.chain().focus().toggleHeading({ level: 1 }).run(),
58
- isActive: () => props.editor.isActive('heading', { level: 1 }),
59
- },
60
- {
61
- icon: 'h-2',
62
- title: 'Heading 2',
63
- action: () => props.editor.chain().focus().toggleHeading({ level: 2 }).run(),
64
- isActive: () => props.editor.isActive('heading', { level: 2 }),
65
- },
66
- {
67
- icon: 'paragraph',
68
- title: 'Paragraph',
69
- action: () => props.editor.chain().focus().setParagraph().run(),
70
- isActive: () => props.editor.isActive('paragraph'),
71
- },
72
- {
73
- icon: 'list-unordered',
74
- title: 'Bullet list',
75
- action: () => props.editor.chain().focus().toggleBulletList().run(),
76
- isActive: () => props.editor.isActive('bulletList'),
77
- },
78
- {
79
- icon: 'list-ordered',
80
- title: 'Ordered list',
81
- action: () => props.editor.chain().focus().toggleOrderedList().run(),
82
- isActive: () => props.editor.isActive('orderedList'),
83
- },
84
- {
85
- icon: 'code-box-line',
86
- title: 'Code block',
87
- action: () => props.editor.chain().focus().toggleCodeBlock().run(),
88
- isActive: () => props.editor.isActive('codeBlock'),
89
- },
90
- {
91
- type: 'divider',
92
- },
93
- {
94
- icon: 'double-quotes-l',
95
- title: 'Blockquote',
96
- action: () => props.editor.chain().focus().toggleBlockquote().run(),
97
- isActive: () => props.editor.isActive('blockquote'),
98
- },
99
- {
100
- icon: 'separator',
101
- title: 'Horizontal rule',
102
- action: () => props.editor.chain().focus().setHorizontalRule().run(),
103
- },
104
- {
105
- type: 'divider',
106
- },
107
- {
108
- icon: 'arrow-go-back-line',
109
- title: 'Undo',
110
- action: () => props.editor.chain().focus().undo().run(),
111
- },
112
- {
113
- icon: 'arrow-go-forward-line',
114
- title: 'Redo',
115
- action: () => props.editor.chain().focus().redo().run(),
116
- },
117
- ]
118
-
119
- return {
120
- items
121
- }
122
- }
123
- })
124
- </script>
125
-
126
- <style scoped>
127
- .editor__header {
128
- display: flex;
129
- align-items: center;
130
- gap: 4px;
131
- padding: 8px 12px;
132
- border: 1px solid #DCDFE6;
133
- border-bottom: none;
134
- background-color: #f8f9fa;
135
- flex-wrap: wrap;
136
- }
137
-
138
- .divider {
139
- width: 1px;
140
- height: 20px;
141
- background-color: #DCDFE6;
142
- margin: 0 4px;
143
- }
144
- </style>
@@ -1,98 +0,0 @@
1
- <template>
2
- <el-tooltip
3
- effect="dark"
4
- :content="chineseTitle"
5
- placement="top"
6
- >
7
- <button
8
- class="menu-item"
9
- :class="{ 'is-active': isActive && isActive() }"
10
- @click.stop="action"
11
- >
12
- <i :class="`ri-${icon}`" class="menu-icon"></i>
13
- </button>
14
- </el-tooltip>
15
- </template>
16
-
17
- <script lang="ts">
18
- import { defineComponent, computed } from 'vue'
19
-
20
- export default defineComponent({
21
- name: 'MenuItem',
22
- props: {
23
- icon: {
24
- type: String,
25
- required: true
26
- },
27
- title: {
28
- type: String,
29
- required: true
30
- },
31
- action: {
32
- type: Function,
33
- required: true
34
- },
35
- isActive: {
36
- type: Function,
37
- default: null
38
- }
39
- },
40
- setup(props) {
41
- const titleMap: Record<string, string> = {
42
- 'Bold': '粗体',
43
- 'Italic': '斜体',
44
- 'Strike': '删除线',
45
- 'Code': '行内代码',
46
- 'Heading 1': '标题 1',
47
- 'Heading 2': '标题 2',
48
- 'Paragraph': '段落',
49
- 'Bullet list': '无序列表',
50
- 'Ordered list': '有序列表',
51
- 'Code block': '代码块',
52
- 'Blockquote': '引用块',
53
- 'Horizontal rule': '水平分割线',
54
- 'Undo': '撤销',
55
- 'Redo': '重做'
56
- }
57
-
58
- const chineseTitle = computed(() => {
59
- return titleMap[props.title] || props.title
60
- })
61
-
62
- return {
63
- chineseTitle
64
- }
65
- }
66
- })
67
- </script>
68
-
69
- <style scoped>
70
- .menu-item {
71
- display: flex;
72
- align-items: center;
73
- justify-content: center;
74
- width: 32px;
75
- height: 32px;
76
- background: white;
77
- border: 1px solid #ddd;
78
- border-radius: 4px;
79
- cursor: pointer;
80
- transition: all 0.2s ease;
81
- font-style: normal;
82
- }
83
-
84
- .menu-item:hover {
85
- background-color: #f0f0f0;
86
- border-color: #999;
87
- }
88
-
89
- .menu-item.is-active {
90
- background-color: #e0e0e0;
91
- border-color: #666;
92
- }
93
-
94
- .menu-icon {
95
- font-size: 16px;
96
- color: #333;
97
- }
98
- </style>