@epic-designer/antd 1.1.5-beta.0 → 1.1.5-beta.1

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.
@@ -1,32 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  const vue = require('vue');
4
- require('epic-designer');
4
+ const epicDesigner = require('epic-designer');
5
5
  const antDesignVue = require('ant-design-vue');
6
6
 
7
- const PAGE_MANAGER_KEY = Symbol("pageManager");
8
- function usePageManager() {
9
- const pageManager = vue.inject(PAGE_MANAGER_KEY);
10
- if (!pageManager) {
11
- throw new Error("\u672A\u83B7\u53D6\u5230 pageManager \u5B9E\u4F8B");
12
- }
13
- return pageManager;
14
- }
15
-
16
- const FORM_CONTEXT_KEY = Symbol("FormContext");
17
- const FORM_INSTANCES_KEY = Symbol("FormInstances");
18
- function useForm(formName) {
19
- const pageManager = usePageManager();
20
- const formData = pageManager.setFormData({}, formName);
21
- const formInstances = vue.inject(
22
- FORM_INSTANCES_KEY,
23
- vue.ref({})
24
- );
25
- vue.provide(FORM_CONTEXT_KEY, formData);
26
- vue.provide("formData", formData);
27
- return { formData, formInstances };
28
- }
29
-
30
7
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
31
8
  ...{
32
9
  inheritAttrs: false
@@ -40,7 +17,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
40
17
  var _a, _b, _c;
41
18
  const props = __props;
42
19
  const form = vue.ref(null);
43
- const { formData, formInstances } = useForm(
20
+ const { formData, formInstances } = epicDesigner.useForm(
44
21
  (_c = (_b = (_a = props.componentSchema) == null ? void 0 : _a.props) == null ? void 0 : _b.name) != null ? _c : "default"
45
22
  );
46
23
  function getData() {
@@ -1,30 +1,7 @@
1
- import { inject, ref, provide, defineComponent, computed, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot, createElementBlock, Fragment, renderList } from 'vue';
2
- import 'epic-designer';
1
+ import { defineComponent, ref, computed, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot, createElementBlock, Fragment, renderList } from 'vue';
2
+ import { useForm } from 'epic-designer';
3
3
  import { Form } from 'ant-design-vue';
4
4
 
5
- const PAGE_MANAGER_KEY = Symbol("pageManager");
6
- function usePageManager() {
7
- const pageManager = inject(PAGE_MANAGER_KEY);
8
- if (!pageManager) {
9
- throw new Error("\u672A\u83B7\u53D6\u5230 pageManager \u5B9E\u4F8B");
10
- }
11
- return pageManager;
12
- }
13
-
14
- const FORM_CONTEXT_KEY = Symbol("FormContext");
15
- const FORM_INSTANCES_KEY = Symbol("FormInstances");
16
- function useForm(formName) {
17
- const pageManager = usePageManager();
18
- const formData = pageManager.setFormData({}, formName);
19
- const formInstances = inject(
20
- FORM_INSTANCES_KEY,
21
- ref({})
22
- );
23
- provide(FORM_CONTEXT_KEY, formData);
24
- provide("formData", formData);
25
- return { formData, formInstances };
26
- }
27
-
28
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
29
6
  ...{
30
7
  inheritAttrs: false
@@ -1,15 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  const vue = require('vue');
4
- require('epic-designer');
4
+ const epicDesigner = require('epic-designer');
5
5
  const antDesignVue = require('ant-design-vue');
6
6
 
7
- const EVENT_BUS_KEY = Symbol("EventBusContext");
8
- function useEventBus() {
9
- const eventBus = vue.inject(EVENT_BUS_KEY, null);
10
- return eventBus;
11
- }
12
-
13
7
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
14
8
  __name: "input",
15
9
  props: {
@@ -23,7 +17,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
23
17
  setup(__props) {
24
18
  const props = __props;
25
19
  const formData = vue.inject("formData", {});
26
- const eventBus = useEventBus();
20
+ const eventBus = epicDesigner.useEventBus();
27
21
  const handleDataSelector = () => {
28
22
  eventBus == null ? void 0 : eventBus.emit("openDataSelector", props.componentSchema, props.options);
29
23
  };
@@ -1,13 +1,7 @@
1
- import { inject, defineComponent, createBlock, openBlock, unref, withCtx, createElementBlock, createCommentVNode, renderSlot } from 'vue';
2
- import 'epic-designer';
1
+ import { defineComponent, inject, createBlock, openBlock, unref, withCtx, createElementBlock, createCommentVNode, renderSlot } from 'vue';
2
+ import { useEventBus } from 'epic-designer';
3
3
  import { Input } from 'ant-design-vue';
4
4
 
5
- const EVENT_BUS_KEY = Symbol("EventBusContext");
6
- function useEventBus() {
7
- const eventBus = inject(EVENT_BUS_KEY, null);
8
- return eventBus;
9
- }
10
-
11
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
12
6
  __name: "input",
13
7
  props: {
@@ -1,15 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  const vue = require('vue');
4
- require('epic-designer');
4
+ const epicDesigner = require('epic-designer');
5
5
  const antDesignVue = require('ant-design-vue');
6
6
 
7
- const NODE_ATTRS_KEY = Symbol("nodeAttrs");
8
- function useNodeAttrs() {
9
- const nodeAttrs = vue.inject(NODE_ATTRS_KEY, {});
10
- return nodeAttrs;
11
- }
12
-
13
7
  const tabPane = vue.defineComponent({
14
8
  props: {
15
9
  componentSchema: {
@@ -19,7 +13,7 @@ const tabPane = vue.defineComponent({
19
13
  }
20
14
  },
21
15
  setup(props, { slots }) {
22
- const nodeAttrs = useNodeAttrs();
16
+ const nodeAttrs = epicDesigner.useNodeAttrs();
23
17
  return () => {
24
18
  var _a;
25
19
  const componentSchema = {
@@ -1,13 +1,7 @@
1
- import { inject, defineComponent, h, renderSlot } from 'vue';
2
- import 'epic-designer';
1
+ import { defineComponent, h, renderSlot } from 'vue';
2
+ import { useNodeAttrs } from 'epic-designer';
3
3
  import { TabPane } from 'ant-design-vue';
4
4
 
5
- const NODE_ATTRS_KEY = Symbol("nodeAttrs");
6
- function useNodeAttrs() {
7
- const nodeAttrs = inject(NODE_ATTRS_KEY, {});
8
- return nodeAttrs;
9
- }
10
-
11
5
  const tabPane = defineComponent({
12
6
  props: {
13
7
  componentSchema: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epic-designer/antd",
3
- "version": "1.1.5-beta.0",
3
+ "version": "1.1.5-beta.1",
4
4
  "description": "epic-designer base antd ui",
5
5
  "private": false,
6
6
  "author": "kchengz",