starfish-form-custom 1.0.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.
Files changed (73) hide show
  1. package/README.md +2 -0
  2. package/auto-imports.d.ts +9 -0
  3. package/components.d.ts +68 -0
  4. package/dist/formAction-28d86b6a.mjs +446 -0
  5. package/dist/index-04830c0b.mjs +126 -0
  6. package/dist/index-eab8ef70.mjs +519 -0
  7. package/dist/index-f7ea052c.mjs +241 -0
  8. package/dist/main-96327b2e.mjs +5051 -0
  9. package/dist/starfish-form-a18a5409.mjs +328 -0
  10. package/dist/starfish-form.mjs +36 -0
  11. package/dist/style.css +377 -0
  12. package/dist/types/form/src/common/Loading.vue.d.ts +3 -0
  13. package/dist/types/form/src/env.d.ts +15 -0
  14. package/dist/types/form/src/main.d.ts +43 -0
  15. package/dist/types/form/src/starfish-form.vue.d.ts +40 -0
  16. package/dist/types/form/src/utils/customHooks.d.ts +2 -0
  17. package/dist/types/form/src/utils/fieldConfig.d.ts +78 -0
  18. package/dist/types/form/src/utils/fieldProps.d.ts +43 -0
  19. package/dist/types/starfish-form.d.ts +3 -0
  20. package/package.json +42 -0
  21. package/src/common/KeyValueConfig.vue +145 -0
  22. package/src/common/KeyValueConfigMult.vue +139 -0
  23. package/src/common/Loading.vue +14 -0
  24. package/src/common/action.vue +76 -0
  25. package/src/common/formAction.vue +298 -0
  26. package/src/common/listConfig.vue +45 -0
  27. package/src/common/panel.vue +61 -0
  28. package/src/common/radiogroup.vue +31 -0
  29. package/src/components/CheckBox/index.vue +42 -0
  30. package/src/components/ColorSelect/index.vue +49 -0
  31. package/src/components/Date/index.vue +39 -0
  32. package/src/components/DateTime/index.vue +39 -0
  33. package/src/components/InputNumber/index.vue +48 -0
  34. package/src/components/JsonEditor/index.vue +167 -0
  35. package/src/components/Radio/index.vue +42 -0
  36. package/src/components/RichText/index.vue +60 -0
  37. package/src/components/Rule/index.vue +365 -0
  38. package/src/components/Rule/ruleform.json +315 -0
  39. package/src/components/Rule/rules.js +91 -0
  40. package/src/components/Selected/index.vue +50 -0
  41. package/src/components/Selecteds/index.vue +50 -0
  42. package/src/components/ShowRule/index.vue +50 -0
  43. package/src/components/Slider/index.vue +38 -0
  44. package/src/components/Switch/index.vue +61 -0
  45. package/src/components/Text/index.vue +48 -0
  46. package/src/components/TextArea/index.vue +49 -0
  47. package/src/components/Time/index.vue +36 -0
  48. package/src/env.d.ts +15 -0
  49. package/src/layout/Divider.vue +30 -0
  50. package/src/layout/Info.vue +69 -0
  51. package/src/layout/Tabs.vue +75 -0
  52. package/src/layout/collapse.vue +78 -0
  53. package/src/layout/grid.vue +88 -0
  54. package/src/layout/table.vue +80 -0
  55. package/src/main.ts +62 -0
  56. package/src/starfish-form.vue +265 -0
  57. package/src/styles/action.scss +25 -0
  58. package/src/styles/collapse.scss +15 -0
  59. package/src/styles/custom-cpm.scss +5 -0
  60. package/src/styles/divider.scss +16 -0
  61. package/src/styles/form-action.scss +92 -0
  62. package/src/styles/formedit.scss +69 -0
  63. package/src/styles/grid.scss +12 -0
  64. package/src/styles/index.scss +12 -0
  65. package/src/styles/keyvalueConfig.scss +56 -0
  66. package/src/styles/rule.scss +17 -0
  67. package/src/styles/showrule.scss +5 -0
  68. package/src/styles/table.scss +19 -0
  69. package/src/styles/tabs.scss +5 -0
  70. package/src/utils/customHooks.ts +22 -0
  71. package/src/utils/fieldConfig.ts +961 -0
  72. package/src/utils/fieldProps.ts +50 -0
  73. package/stats.html +4949 -0
@@ -0,0 +1,15 @@
1
+ .collapse_box {
2
+ .draggable-box {
3
+ min-height: 50px;
4
+ background: white;
5
+ border: 1px #ccc dashed;
6
+ box-sizing: border-box;
7
+ width: 100%;
8
+ }
9
+ :deep(.el-collapse-item__content) {
10
+ padding-bottom: 5px;
11
+ > * {
12
+ width: 100%;
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,5 @@
1
+ .starfish-formitem-nomiddle {
2
+ .label {
3
+ align-self: flex-start;
4
+ }
5
+ }
@@ -0,0 +1,16 @@
1
+ .starfish-form-divider {
2
+ top: 6px;
3
+ .control {
4
+ display: flex;
5
+ align-items: center;
6
+ justify-content: center;
7
+ font-weight: bold;
8
+ .divider {
9
+ flex: 1;
10
+ height: 2px;
11
+ background: #000;
12
+ border-radius: 2px;
13
+ margin-left: 10px;
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,92 @@
1
+ .common-layout {
2
+ padding: 15px;
3
+ height: 100%;
4
+ box-sizing: border-box;
5
+ .action-header {
6
+ height: 40px;
7
+ padding: 5px;
8
+ border-bottom: 1px solid #eee;
9
+ background: #f2f6fc;
10
+ width: 100%;
11
+ box-sizing: border-box;
12
+ display: flex;
13
+ align-items: center;
14
+ justify-content: flex-start;
15
+ }
16
+ .is-vertical {
17
+ flex-direction: column;
18
+ }
19
+ .event-script-aside {
20
+ border-right: 1px solid #eee;
21
+ }
22
+ .el-main {
23
+ padding: 0;
24
+ overflow: hidden;
25
+ }
26
+ .coding {
27
+ display: flex;
28
+ flex-direction: column;
29
+ width: 100%;
30
+ }
31
+ .action-list {
32
+ margin: 10px;
33
+ .action {
34
+ border: 1px solid #dcdfe6;
35
+ background: #fff;
36
+ border-radius: 3px;
37
+ box-sizing: border-box;
38
+ padding: 10px !important;
39
+ height: auto;
40
+ line-height: 1;
41
+ cursor: default;
42
+ position: relative;
43
+ font-size: 14px;
44
+ white-space: nowrap;
45
+ &.selectAction {
46
+ background: #e4e7ed;
47
+ color: #303133;
48
+ }
49
+ .event-script-menu-i {
50
+ position: absolute;
51
+ font-size: 12px;
52
+ left: 5px;
53
+ top: 13px;
54
+ width: 45px;
55
+ text-align: center;
56
+ color: #67c23a;
57
+ }
58
+ .event-script-menu-label {
59
+ overflow: hidden;
60
+ text-overflow: ellipsis;
61
+ white-space: nowrap;
62
+ display: inline-block;
63
+ width: 170px;
64
+ margin-left: 50px;
65
+ vertical-align: middle;
66
+ }
67
+ .event-script-menu-action {
68
+ display: inline-block;
69
+ padding-right: 10px;
70
+ color: #666;
71
+ font-weight: 600;
72
+ vertical-align: middle;
73
+ > i {
74
+ margin-left: 3px;
75
+ }
76
+ }
77
+ }
78
+ .action + .action {
79
+ margin-top: 6px;
80
+ }
81
+ }
82
+ .func_main {
83
+ padding: 10px;
84
+ }
85
+ .event-script-main {
86
+ padding: 0;
87
+ .event-script-main-header {
88
+ text-align: right;
89
+ justify-content: flex-end;
90
+ }
91
+ }
92
+ }
@@ -0,0 +1,69 @@
1
+ .starfish-editor,
2
+ .starfish-form,
3
+ .starfish-dynamicform {
4
+ .el-form-item__content {
5
+ margin-left: 0 !important;
6
+ margin-bottom: 12px;
7
+ display: block;
8
+ }
9
+ .el-form-item {
10
+ margin-bottom: 0 !important;
11
+ }
12
+ .el-form-item__error {
13
+ top: 100%;
14
+ left: 15px !important;
15
+ }
16
+ .el-form {
17
+ padding-bottom: 64px;
18
+ }
19
+ .jsoneditor-poweredBy {
20
+ display: none;
21
+ }
22
+ .starfish-formitem {
23
+ text-align: left;
24
+ position: relative;
25
+ margin: 0 12px;
26
+ &.starfish-vertical {
27
+ display: flex;
28
+ align-items: center;
29
+ .control {
30
+ width: 100%;
31
+ }
32
+ }
33
+ &.formCover {
34
+ padding-bottom: 12px;
35
+ }
36
+ .label {
37
+ font-size: 14px;
38
+ height: 25px;
39
+ line-height: 25px;
40
+ padding-right: 12px;
41
+ box-sizing: border-box;
42
+ white-space: nowrap;
43
+ &.label_right {
44
+ float: left;
45
+ text-align: right;
46
+ position: absolute;
47
+ }
48
+ &.label_left {
49
+ float: left;
50
+ text-align: left;
51
+ position: absolute;
52
+ }
53
+ }
54
+ .item_require {
55
+ color: red;
56
+ }
57
+ }
58
+ }
59
+
60
+ // #app .fullscreen {
61
+ // position: fixed;
62
+ // left: 0;
63
+ // top: 0;
64
+ // height: 100%;
65
+ // width: 100%;
66
+ // z-index: 1810;
67
+ // transform: translate(0, 0);
68
+ // -webkit-transform: translate(0, 0);
69
+ // }
@@ -0,0 +1,12 @@
1
+ .starfish-grid_box {
2
+ padding: 5px;
3
+ .grid-col {
4
+ min-height: 60px;
5
+ }
6
+ .draggable-box {
7
+ height: 100%;
8
+ background: white;
9
+ border: 1px #ccc dashed;
10
+ box-sizing: border-box;
11
+ }
12
+ }
@@ -0,0 +1,12 @@
1
+ @import "./formedit.scss";
2
+ @import "./rule.scss";
3
+ @import "./keyvalueConfig.scss";
4
+ @import "./action.scss";
5
+ @import "./showrule.scss";
6
+ @import "./custom-cpm.scss";
7
+ @import "./grid.scss";
8
+ @import "./table.scss";
9
+ @import "./divider.scss";
10
+ @import "./collapse.scss";
11
+ @import "./tabs.scss";
12
+ @import "./form-action.scss";
@@ -0,0 +1,56 @@
1
+ .starfish-keyValueItem {
2
+ display: flex;
3
+ justify-content: space-around;
4
+ align-items: center;
5
+ font-size: 12px;
6
+ border: 1px solid #eee;
7
+ margin-bottom: 6px;
8
+ border-radius: 10px;
9
+ padding: 10px 0;
10
+ .keyValueSelect {
11
+ width: 30px;
12
+ text-align: center;
13
+ }
14
+ .keyValueInput {
15
+ flex: 1;
16
+ .inputItem {
17
+ line-height: 20px;
18
+ }
19
+ > div {
20
+ margin-bottom: 7px;
21
+ span {
22
+ display: block;
23
+ margin-bottom: 6px;
24
+ }
25
+ }
26
+ }
27
+ .keyValueControl {
28
+ width: 40px;
29
+ display: flex;
30
+ flex-direction: column;
31
+ justify-content: space-around;
32
+ align-items: center;
33
+ > div {
34
+ width: 17px;
35
+ height: 17px;
36
+ border: 1px solid #eee;
37
+ border-radius: 50%;
38
+ background: #fff;
39
+ display: flex;
40
+ align-items: center;
41
+ justify-content: center;
42
+ margin: 5px 0;
43
+ }
44
+ .add {
45
+ background: #409eff;
46
+ color: white;
47
+ }
48
+ .remove {
49
+ background: red;
50
+ color: white;
51
+ }
52
+ i {
53
+ font-size: 12px;
54
+ }
55
+ }
56
+ }
@@ -0,0 +1,17 @@
1
+ .starfish-editor,
2
+ .starfish-form,
3
+ .starfish-dynamicform {
4
+ #jsoneditor {
5
+ position: relative;
6
+ z-index: 1;
7
+ .fullScreen {
8
+ position: absolute;
9
+ right: 10px;
10
+ line-height: 1;
11
+ z-index: 2;
12
+ top: 10px;
13
+ color: white;
14
+ font-size: 18px;
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,5 @@
1
+ .starfish-editor-showrule {
2
+ .label {
3
+ align-self: flex-start;
4
+ }
5
+ }
@@ -0,0 +1,19 @@
1
+ .starfish-table_box {
2
+ .table_layout {
3
+ width: 100%;
4
+ &.table_layout_border {
5
+ border: 1px solid #ccc;
6
+ }
7
+ td {
8
+ vertical-align: top;
9
+ }
10
+ .draggable-box {
11
+ min-height: 60px;
12
+ background: white;
13
+ border: 1px #ccc dashed;
14
+ box-sizing: border-box;
15
+ min-width: 50px;
16
+ height: 100%;
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,5 @@
1
+ .starfish-tabs_box {
2
+ .draggable-box {
3
+ min-height: 50px;
4
+ }
5
+ }
@@ -0,0 +1,22 @@
1
+ import { watch, getCurrentInstance, ComponentInternalInstance } from "vue";
2
+
3
+ function useWatch(props: any) {
4
+ const vm = getCurrentInstance() as ComponentInternalInstance;
5
+ // 预览模式下才有效
6
+ if (!props.data.fieldName && !props.item.controlItems) {
7
+ watch(
8
+ () => props.data[props.item.data.fieldName],
9
+ (val, oldVal) => {
10
+ if (props.item.data.action && props.item.data.action.onChange) {
11
+ window.VApp.$Flex.funcExec(props.item.data.action.onChange, vm.proxy, [val, oldVal, props.data]);
12
+ }
13
+ vm.emit("change");
14
+ },
15
+ {
16
+ deep: true,
17
+ }
18
+ );
19
+ }
20
+ }
21
+
22
+ export { useWatch };