znyg-frontend-common 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.
- package/cdn/index.cdn.js +2 -0
- package/cdn/index.cdn.js.map +1 -0
- package/cdn/index.cdn.mjs +2 -0
- package/cdn/index.cdn.mjs.map +1 -0
- package/cdn/index.css +1 -0
- package/es/_virtual/_plugin-vue_export-helper.mjs +10 -0
- package/es/_virtual/_plugin-vue_export-helper.mjs.map +1 -0
- package/es/components/button/index.d.ts +14 -0
- package/es/components/button/index.mjs +7 -0
- package/es/components/button/index.mjs.map +1 -0
- package/es/components/button/src/button.d.ts +11 -0
- package/es/components/button/src/button.mjs +9 -0
- package/es/components/button/src/button.mjs.map +1 -0
- package/es/components/button/src/button.vue.d.ts +14 -0
- package/es/components/button/src/button.vue.mjs +24 -0
- package/es/components/button/src/button.vue.mjs.map +1 -0
- package/es/components/button/src/button.vue2.mjs +19 -0
- package/es/components/button/src/button.vue2.mjs.map +1 -0
- package/es/components/index.d.ts +1 -0
- package/es/components/index.mjs +2 -0
- package/es/components/index.mjs.map +1 -0
- package/es/hooks/index.d.ts +2 -0
- package/es/hooks/index.mjs +4 -0
- package/es/hooks/index.mjs.map +1 -0
- package/es/hooks/useDeveloper/index.d.ts +3 -0
- package/es/hooks/useDeveloper/index.mjs +12 -0
- package/es/hooks/useDeveloper/index.mjs.map +1 -0
- package/es/hooks/usePopWindow/index.d.ts +10 -0
- package/es/hooks/usePopWindow/index.mjs +14 -0
- package/es/hooks/usePopWindow/index.mjs.map +1 -0
- package/es/hooks/usePopWindow/src/index.d.ts +15 -0
- package/es/hooks/usePopWindow/src/index.mjs +121 -0
- package/es/hooks/usePopWindow/src/index.mjs.map +1 -0
- package/es/hooks/usePopWindow/src/interface/index.d.ts +27 -0
- package/es/hooks/usePopWindow/src/interface/index.mjs +2 -0
- package/es/hooks/usePopWindow/src/interface/index.mjs.map +1 -0
- package/es/index.d.ts +6 -0
- package/es/index.mjs +16 -0
- package/es/index.mjs.map +1 -0
- package/es/installer.d.ts +6 -0
- package/es/installer.mjs +14 -0
- package/es/installer.mjs.map +1 -0
- package/es/types.d.ts +6 -0
- package/es/types.mjs +2 -0
- package/es/types.mjs.map +1 -0
- package/es/utils/index.d.ts +2 -0
- package/es/utils/index.mjs +3 -0
- package/es/utils/index.mjs.map +1 -0
- package/es/utils/install.d.ts +7 -0
- package/es/utils/install.mjs +20 -0
- package/es/utils/install.mjs.map +1 -0
- package/es/utils/myDevelop.d.ts +1 -0
- package/es/utils/myDevelop.mjs +9 -0
- package/es/utils/myDevelop.mjs.map +1 -0
- package/global.d.ts +10 -0
- package/lib/_virtual/_plugin-vue_export-helper.js +14 -0
- package/lib/_virtual/_plugin-vue_export-helper.js.map +1 -0
- package/lib/components/button/index.d.ts +14 -0
- package/lib/components/button/index.js +12 -0
- package/lib/components/button/index.js.map +1 -0
- package/lib/components/button/src/button.d.ts +11 -0
- package/lib/components/button/src/button.js +11 -0
- package/lib/components/button/src/button.js.map +1 -0
- package/lib/components/button/src/button.vue.d.ts +14 -0
- package/lib/components/button/src/button.vue.js +28 -0
- package/lib/components/button/src/button.vue.js.map +1 -0
- package/lib/components/button/src/button.vue2.js +23 -0
- package/lib/components/button/src/button.vue2.js.map +1 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +8 -0
- package/lib/components/index.js.map +1 -0
- package/lib/hooks/index.d.ts +2 -0
- package/lib/hooks/index.js +14 -0
- package/lib/hooks/index.js.map +1 -0
- package/lib/hooks/useDeveloper/index.d.ts +3 -0
- package/lib/hooks/useDeveloper/index.js +14 -0
- package/lib/hooks/useDeveloper/index.js.map +1 -0
- package/lib/hooks/usePopWindow/index.d.ts +10 -0
- package/lib/hooks/usePopWindow/index.js +18 -0
- package/lib/hooks/usePopWindow/index.js.map +1 -0
- package/lib/hooks/usePopWindow/src/index.d.ts +15 -0
- package/lib/hooks/usePopWindow/src/index.js +127 -0
- package/lib/hooks/usePopWindow/src/index.js.map +1 -0
- package/lib/hooks/usePopWindow/src/interface/index.d.ts +27 -0
- package/lib/hooks/usePopWindow/src/interface/index.js +3 -0
- package/lib/hooks/usePopWindow/src/interface/index.js.map +1 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +29 -0
- package/lib/index.js.map +1 -0
- package/lib/installer.d.ts +6 -0
- package/lib/installer.js +19 -0
- package/lib/installer.js.map +1 -0
- package/lib/types.d.ts +6 -0
- package/lib/types.js +3 -0
- package/lib/types.js.map +1 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +11 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/install.d.ts +7 -0
- package/lib/utils/install.js +23 -0
- package/lib/utils/install.js.map +1 -0
- package/lib/utils/myDevelop.d.ts +1 -0
- package/lib/utils/myDevelop.js +11 -0
- package/lib/utils/myDevelop.js.map +1 -0
- package/package.json +85 -0
- package/theme-default/button.css +1 -0
- package/theme-default/index.css +1 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
const withInstall = /* @__PURE__ */ __name((main) => {
|
|
4
|
+
main.install = (app) => {
|
|
5
|
+
const comp = main;
|
|
6
|
+
app.component(comp.name, comp);
|
|
7
|
+
};
|
|
8
|
+
return main;
|
|
9
|
+
}, "withInstall");
|
|
10
|
+
const withInstallDirectives = /* @__PURE__ */ __name((main, name) => {
|
|
11
|
+
return {
|
|
12
|
+
install: /* @__PURE__ */ __name((app) => {
|
|
13
|
+
app.directive(name, main);
|
|
14
|
+
}, "install"),
|
|
15
|
+
directive: main
|
|
16
|
+
};
|
|
17
|
+
}, "withInstallDirectives");
|
|
18
|
+
|
|
19
|
+
export { withInstall, withInstallDirectives };
|
|
20
|
+
//# sourceMappingURL=install.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.mjs","sources":["../../../../packages/utils/install.ts"],"sourcesContent":["import type { App, Directive } from 'vue';\nimport type { SFCWithInstall } from '../types';\n\n// 注册组件\nexport const withInstall = <T>(main: T) => {\n (main as SFCWithInstall<T>).install = (app): void => {\n const comp: Record<string, any> = main as Record<string, any>;\n app.component(comp.name, comp);\n };\n return main as SFCWithInstall<T>;\n};\n\n// 注册指令\nexport const withInstallDirectives = <T extends Directive>(main: T, name: string) => {\n return {\n install: (app: App): void => {\n app.directive(name, main);\n },\n directive: main,\n };\n};\n"],"names":[],"mappings":";;AAIa,MAAA,WAAA,2BAAkB,IAAY,KAAA;AACzC,EAAC,IAAA,CAA2B,OAAU,GAAA,CAAC,GAAc,KAAA;AACnD,IAAA,MAAM,IAA4B,GAAA,IAAA,CAAA;AAClC,IAAI,GAAA,CAAA,SAAA,CAAU,IAAK,CAAA,IAAA,EAAM,IAAI,CAAA,CAAA;AAAA,GAC/B,CAAA;AACA,EAAO,OAAA,IAAA,CAAA;AACT,CAN2B,EAAA,aAAA,EAAA;AASd,MAAA,qBAAA,mBAA8C,MAAA,CAAA,CAAA,IAAA,EAAS,IAAiB,KAAA;AACnF,EAAO,OAAA;AAAA,IACL,OAAA,0BAAU,GAAmB,KAAA;AAC3B,MAAI,GAAA,CAAA,SAAA,CAAU,MAAM,IAAI,CAAA,CAAA;AAAA,KADjB,EAAA,SAAA,CAAA;AAAA,IAGT,SAAW,EAAA,IAAA;AAAA,GACb,CAAA;AACF,CAPqC,EAAA,uBAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function developFn(): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
function developFn() {
|
|
4
|
+
console.log("developFn");
|
|
5
|
+
}
|
|
6
|
+
__name(developFn, "developFn");
|
|
7
|
+
|
|
8
|
+
export { developFn };
|
|
9
|
+
//# sourceMappingURL=myDevelop.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"myDevelop.mjs","sources":["../../../../packages/utils/myDevelop.ts"],"sourcesContent":["// utils 用例\nexport function developFn() {\n console.log('developFn');\n}\n"],"names":[],"mappings":";;AACO,SAAS,SAAY,GAAA;AAC1B,EAAA,OAAA,CAAQ,IAAI,WAAW,CAAA,CAAA;AACzB,CAAA;AAFgB,MAAA,CAAA,SAAA,EAAA,WAAA,CAAA;;;;"}
|
package/global.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _export_sfc = (sfc, props) => {
|
|
6
|
+
const target = sfc.__vccOpts || sfc;
|
|
7
|
+
for (const [key, val] of props) {
|
|
8
|
+
target[key] = val;
|
|
9
|
+
}
|
|
10
|
+
return target;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
exports.default = _export_sfc;
|
|
14
|
+
//# sourceMappingURL=_plugin-vue_export-helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_plugin-vue_export-helper.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const IButton: import("../../types").SFCWithInstall<import("vue").DefineComponent<{
|
|
2
|
+
type: {
|
|
3
|
+
type: import("vue").PropType<import("./src/button").Type>;
|
|
4
|
+
default: string;
|
|
5
|
+
};
|
|
6
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
7
|
+
type: {
|
|
8
|
+
type: import("vue").PropType<import("./src/button").Type>;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
}>>, {
|
|
12
|
+
type: import("./src/button").Type;
|
|
13
|
+
}, {}>>;
|
|
14
|
+
export default IButton;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var install = require('../../utils/install.js');
|
|
6
|
+
var button = require('./src/button.vue.js');
|
|
7
|
+
|
|
8
|
+
const IButton = install.withInstall(button.default);
|
|
9
|
+
|
|
10
|
+
exports.IButton = IButton;
|
|
11
|
+
exports.default = IButton;
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../packages/components/button/index.ts"],"sourcesContent":["import { withInstall } from '../../utils/install';\nimport Button from './src/button.vue';\n\nexport const IButton = withInstall(Button); // 增加类型\n\nexport default IButton;\n"],"names":["withInstall","Button"],"mappings":";;;;;;;AAGa,MAAA,OAAA,GAAUA,oBAAYC,cAAM;;;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
import type button from './button.vue';
|
|
3
|
+
export type Type = 'primary' | 'success' | 'error';
|
|
4
|
+
export declare const ButtonProps: {
|
|
5
|
+
type: {
|
|
6
|
+
type: PropType<Type>;
|
|
7
|
+
default: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export type ButtonPropsType = ExtractPropTypes<typeof ButtonProps>;
|
|
11
|
+
export type ButtonInstanceType = InstanceType<typeof button>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sources":["../../../../../../packages/components/button/src/button.ts"],"sourcesContent":["import type { ExtractPropTypes, PropType } from 'vue';\nimport type button from './button.vue';\n\nexport type Type = 'primary' | 'success' | 'error';\n\nexport const ButtonProps = {\n type: {\n type: String as PropType<Type>,\n default: 'default',\n },\n};\n\nexport type ButtonPropsType = ExtractPropTypes<typeof ButtonProps>;\nexport type ButtonInstanceType = InstanceType<typeof button>;\n"],"names":[],"mappings":";;AAKO,MAAM,WAAc,GAAA;AAAA,EACzB,IAAM,EAAA;AAAA,IACJ,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,SAAA;AAAA,GACX;AACF;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
type: {
|
|
3
|
+
type: import("vue").PropType<import("./button").Type>;
|
|
4
|
+
default: string;
|
|
5
|
+
};
|
|
6
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
7
|
+
type: {
|
|
8
|
+
type: import("vue").PropType<import("./button").Type>;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
}>>, {
|
|
12
|
+
type: import("./button").Type;
|
|
13
|
+
}, {}>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var button_vue_vue_type_script_setup_true_lang = require('./button.vue2.js');
|
|
6
|
+
var vue = require('vue');
|
|
7
|
+
var _pluginVue_exportHelper = require('../../../_virtual/_plugin-vue_export-helper.js');
|
|
8
|
+
|
|
9
|
+
var __defProp = Object.defineProperty;
|
|
10
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
11
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
12
|
+
return vue.openBlock(), vue.createElementBlock(
|
|
13
|
+
"button",
|
|
14
|
+
{
|
|
15
|
+
class: vue.normalizeClass(["mu-button", _ctx.type])
|
|
16
|
+
},
|
|
17
|
+
[
|
|
18
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
19
|
+
],
|
|
20
|
+
2
|
|
21
|
+
/* CLASS */
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
__name(_sfc_render, "_sfc_render");
|
|
25
|
+
var Button = /* @__PURE__ */ _pluginVue_exportHelper.default(button_vue_vue_type_script_setup_true_lang.default, [["render", _sfc_render], ["__file", "button.vue"]]);
|
|
26
|
+
|
|
27
|
+
exports.default = Button;
|
|
28
|
+
//# sourceMappingURL=button.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.vue.js","sources":["../../../../../../packages/components/button/src/button.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { ButtonProps } from './button';\n\n defineProps(ButtonProps);\n\n defineOptions({\n name: 'IButton',\n });\n</script>\n\n<template>\n <button class=\"mu-button\" :class=\"type\">\n <slot></slot>\n </button>\n</template>\n"],"names":["type","_normalizeClass"],"mappings":";;;;;;;;;;SAWe,YAXf,IAAA,EAAA,MAAA,EAWgB,MAAoBA,EAAAA,MAAAA,EAAI,OAAA,QAAA,EAAA;;;;MACpC,OAAaC,kBAAA,CAAA,CAAA,WAAA,EAAA,IAAA,CAAA,IAAA,CAAA,CAAA;AAAA,KAAA;AAAA;;;;;;;AADF,MAAA,CAAA,WAAA,EAAA,aAAA,CAAA,CAAA;;;;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var button = require('./button.js');
|
|
7
|
+
|
|
8
|
+
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
9
|
+
...{
|
|
10
|
+
name: "IButton"
|
|
11
|
+
},
|
|
12
|
+
__name: "button",
|
|
13
|
+
props: button.ButtonProps,
|
|
14
|
+
setup(__props, { expose: __expose }) {
|
|
15
|
+
__expose();
|
|
16
|
+
const __returned__ = {};
|
|
17
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
18
|
+
return __returned__;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
exports.default = _sfc_main;
|
|
23
|
+
//# sourceMappingURL=button.vue2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.vue2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './button';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./useDeveloper/index.js');
|
|
4
|
+
var index$2 = require('./usePopWindow/index.js');
|
|
5
|
+
var index$1 = require('./usePopWindow/src/index.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.useDeveloper = index.useDeveloper;
|
|
10
|
+
exports.usePopWindow = index$2.usePopWindow;
|
|
11
|
+
exports.closePopWindowById = index$1.closePopWindowById;
|
|
12
|
+
exports.closePopWindowByTag = index$1.closePopWindowByTag;
|
|
13
|
+
exports.showPopWindow = index$1.showPopWindow;
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
function useDeveloper() {
|
|
8
|
+
const num = vue.ref(0);
|
|
9
|
+
return { num };
|
|
10
|
+
}
|
|
11
|
+
__name(useDeveloper, "useDeveloper");
|
|
12
|
+
|
|
13
|
+
exports.useDeveloper = useDeveloper;
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../packages/hooks/useDeveloper/index.ts"],"sourcesContent":["import { ref } from 'vue';\n\nexport function useDeveloper() {\n const num = ref<number>(0);\n return { num };\n}\n"],"names":["ref"],"mappings":";;;;;;AAEO,SAAS,YAAe,GAAA;AAC7B,EAAM,MAAA,GAAA,GAAMA,QAAY,CAAC,CAAA,CAAA;AACzB,EAAA,OAAO,EAAE,GAAI,EAAA,CAAA;AACf,CAAA;AAHgB,MAAA,CAAA,YAAA,EAAA,cAAA,CAAA;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { closePopWindowById, closePopWindowByTag, showPopWindow } from './src/index';
|
|
2
|
+
import { type PopWindowInfoProps, type PopWindowProps } from './src/interface';
|
|
3
|
+
export { showPopWindow, closePopWindowById, closePopWindowByTag };
|
|
4
|
+
export type { PopWindowInfoProps, PopWindowProps };
|
|
5
|
+
export declare const usePopWindow: (ctx?: any) => {
|
|
6
|
+
showPopWindow: (props: PopWindowProps, component?: import("vue").Component, componentProps?: any) => {
|
|
7
|
+
id: string;
|
|
8
|
+
close: () => void;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
var index = require('./src/index.js');
|
|
5
|
+
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
+
const usePopWindow = /* @__PURE__ */ __name((ctx) => {
|
|
9
|
+
const thisAppContext = ctx || vue.getCurrentInstance();
|
|
10
|
+
const { showPopWindow: showPopWindow2 } = index.initPopWindow(thisAppContext);
|
|
11
|
+
return { showPopWindow: showPopWindow2 };
|
|
12
|
+
}, "usePopWindow");
|
|
13
|
+
|
|
14
|
+
exports.closePopWindowById = index.closePopWindowById;
|
|
15
|
+
exports.closePopWindowByTag = index.closePopWindowByTag;
|
|
16
|
+
exports.showPopWindow = index.showPopWindow;
|
|
17
|
+
exports.usePopWindow = usePopWindow;
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../packages/hooks/usePopWindow/index.ts"],"sourcesContent":["import { type ComponentInternalInstance, getCurrentInstance } from 'vue'\n\nimport { closePopWindowById, closePopWindowByTag, initPopWindow, showPopWindow } from './src/index'\nimport { type PopWindowInfoProps, type PopWindowProps } from './src/interface'\n\nexport { showPopWindow, closePopWindowById, closePopWindowByTag }\nexport type { PopWindowInfoProps, PopWindowProps }\nexport const usePopWindow = (ctx?: any) => {\n const thisAppContext = ctx || (getCurrentInstance() as ComponentInternalInstance)\n const { showPopWindow } = initPopWindow(thisAppContext)\n return { showPopWindow }\n}\n"],"names":["getCurrentInstance","showPopWindow","initPopWindow"],"mappings":";;;;;;;AAOa,MAAA,YAAA,2BAAgB,GAAc,KAAA;AACzC,EAAM,MAAA,cAAA,GAAiB,OAAQA,sBAAmB,EAAA,CAAA;AAClD,EAAA,MAAM,EAAE,aAAA,EAAAC,cAAc,EAAA,GAAIC,oBAAc,cAAc,CAAA,CAAA;AACtD,EAAO,OAAA,EAAE,eAAAD,cAAc,EAAA,CAAA;AACzB,CAJ4B,EAAA,cAAA;;;;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Component, type ComponentInternalInstance } from 'vue';
|
|
2
|
+
import { type PopWindowInfoProps, type PopWindowProps } from './interface';
|
|
3
|
+
export declare const showPopWindow: (props: PopWindowProps, component?: Component, componentProps?: any) => {
|
|
4
|
+
id: string;
|
|
5
|
+
close: () => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const closePopWindowById: (id: string) => void;
|
|
8
|
+
export declare const closePopWindowByTag: (tag: string) => void;
|
|
9
|
+
export declare const getAllPopWindows: () => PopWindowInfoProps[];
|
|
10
|
+
export declare const initPopWindow: (ctx?: ComponentInternalInstance) => {
|
|
11
|
+
showPopWindow: (props: PopWindowProps, component?: Component, componentProps?: any) => {
|
|
12
|
+
id: string;
|
|
13
|
+
close: () => void;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
var elementPlus = require('element-plus');
|
|
5
|
+
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
+
let appContextConst;
|
|
9
|
+
let popWindowList = [];
|
|
10
|
+
const getBody = /* @__PURE__ */ __name(() => {
|
|
11
|
+
return document.querySelector("body");
|
|
12
|
+
}, "getBody");
|
|
13
|
+
const showPopWindow = /* @__PURE__ */ __name((props, component, componentProps) => {
|
|
14
|
+
var _a;
|
|
15
|
+
const op = {
|
|
16
|
+
left: "0",
|
|
17
|
+
top: "0",
|
|
18
|
+
width: "100px",
|
|
19
|
+
height: "100px",
|
|
20
|
+
position: "absolute",
|
|
21
|
+
id: "popwindow_" + Math.ceil(Math.random() * 1e6),
|
|
22
|
+
animate: false,
|
|
23
|
+
animateInClass: "animate__animated animate__faster animate__fadeIn",
|
|
24
|
+
animateOutClass: "animate__animated animate__faster animate__fadeOut"
|
|
25
|
+
};
|
|
26
|
+
const option = Object.assign(op, props);
|
|
27
|
+
const close = /* @__PURE__ */ __name(() => {
|
|
28
|
+
closePopWindowById(option.id);
|
|
29
|
+
}, "close");
|
|
30
|
+
closePopWindowById(option.id);
|
|
31
|
+
let animateClass = option.animate ? option.animateInClass : "";
|
|
32
|
+
const vm = vue.createVNode("div", {
|
|
33
|
+
"class": "popWindow " + animateClass,
|
|
34
|
+
"style": {
|
|
35
|
+
width: option.width,
|
|
36
|
+
height: option.height,
|
|
37
|
+
left: option.left,
|
|
38
|
+
top: option.top,
|
|
39
|
+
position: option.position
|
|
40
|
+
}
|
|
41
|
+
}, [vue.createVNode(elementPlus.ElScrollbar, null, {
|
|
42
|
+
default: /* @__PURE__ */ __name(() => [props.render ? props.render({
|
|
43
|
+
close,
|
|
44
|
+
option
|
|
45
|
+
}) : vue.createVNode(component, vue.mergeProps({
|
|
46
|
+
"is": component
|
|
47
|
+
}, componentProps, {
|
|
48
|
+
"onClose": /* @__PURE__ */ __name(() => close(), "onClose")
|
|
49
|
+
}), null)], "default")
|
|
50
|
+
})]);
|
|
51
|
+
vm.appContext = appContextConst;
|
|
52
|
+
if ((_a = vm.children) == null ? void 0 : _a.length) {
|
|
53
|
+
vm.children[0].appContext = appContextConst;
|
|
54
|
+
}
|
|
55
|
+
const container = document.createElement("div");
|
|
56
|
+
container.id = "popwindow_" + Math.ceil(Math.random() * 1e6);
|
|
57
|
+
let parentEl = getBody();
|
|
58
|
+
if (props.appendParent) {
|
|
59
|
+
parentEl = document.getElementById(props.appendParent);
|
|
60
|
+
}
|
|
61
|
+
parentEl.appendChild(container);
|
|
62
|
+
vue.render(vm, container);
|
|
63
|
+
vue.nextTick(() => {
|
|
64
|
+
const popWindowInfo = {
|
|
65
|
+
id: option.id,
|
|
66
|
+
tag: option.tag,
|
|
67
|
+
node: container,
|
|
68
|
+
option
|
|
69
|
+
};
|
|
70
|
+
popWindowList.push(popWindowInfo);
|
|
71
|
+
});
|
|
72
|
+
return {
|
|
73
|
+
id: option.id,
|
|
74
|
+
close
|
|
75
|
+
};
|
|
76
|
+
}, "showPopWindow");
|
|
77
|
+
const removePopWindow = /* @__PURE__ */ __name((popWindowInfo) => {
|
|
78
|
+
var _a;
|
|
79
|
+
if (!popWindowInfo) return;
|
|
80
|
+
const {
|
|
81
|
+
option,
|
|
82
|
+
node
|
|
83
|
+
} = popWindowInfo;
|
|
84
|
+
(_a = option.onClose) == null ? void 0 : _a.call(option);
|
|
85
|
+
if (option.animate) {
|
|
86
|
+
const popWindowNode = node.querySelector(".popWindow");
|
|
87
|
+
popWindowNode.className = "popWindow " + option.animateOutClass;
|
|
88
|
+
popWindowNode.addEventListener("animationend", () => {
|
|
89
|
+
vue.render(null, node);
|
|
90
|
+
node.remove();
|
|
91
|
+
popWindowList.splice(popWindowList.indexOf(popWindowInfo), 1);
|
|
92
|
+
});
|
|
93
|
+
} else {
|
|
94
|
+
vue.render(null, node);
|
|
95
|
+
node.remove();
|
|
96
|
+
popWindowList.splice(popWindowList.indexOf(popWindowInfo), 1);
|
|
97
|
+
}
|
|
98
|
+
}, "removePopWindow");
|
|
99
|
+
const closePopWindowById = /* @__PURE__ */ __name((id) => {
|
|
100
|
+
const popWindowItem = popWindowList.find((item) => item.id === id);
|
|
101
|
+
if (popWindowItem) {
|
|
102
|
+
removePopWindow(popWindowItem);
|
|
103
|
+
}
|
|
104
|
+
}, "closePopWindowById");
|
|
105
|
+
const closePopWindowByTag = /* @__PURE__ */ __name((tag) => {
|
|
106
|
+
const popWindows = popWindowList.filter((item) => item.tag === tag);
|
|
107
|
+
popWindows.forEach((item) => removePopWindow(item));
|
|
108
|
+
}, "closePopWindowByTag");
|
|
109
|
+
const getAllPopWindows = /* @__PURE__ */ __name(() => {
|
|
110
|
+
return popWindowList;
|
|
111
|
+
}, "getAllPopWindows");
|
|
112
|
+
const initPopWindow = /* @__PURE__ */ __name((ctx) => {
|
|
113
|
+
const {
|
|
114
|
+
appContext
|
|
115
|
+
} = ctx || vue.getCurrentInstance() || {};
|
|
116
|
+
appContextConst = appContext;
|
|
117
|
+
return {
|
|
118
|
+
showPopWindow
|
|
119
|
+
};
|
|
120
|
+
}, "initPopWindow");
|
|
121
|
+
|
|
122
|
+
exports.closePopWindowById = closePopWindowById;
|
|
123
|
+
exports.closePopWindowByTag = closePopWindowByTag;
|
|
124
|
+
exports.getAllPopWindows = getAllPopWindows;
|
|
125
|
+
exports.initPopWindow = initPopWindow;
|
|
126
|
+
exports.showPopWindow = showPopWindow;
|
|
127
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../packages/hooks/usePopWindow/src/index.tsx"],"sourcesContent":["import { type AppContext, type Component, type ComponentInternalInstance, getCurrentInstance, nextTick, render } from 'vue'\n\nimport { type PopWindowInfoProps, type PopWindowProps } from './interface'\nimport { ElScrollbar } from 'element-plus'\n\nlet appContextConst: AppContext | undefined\nlet popWindowList: Array<any> = []\nconst getBody = (): Element => {\n return document.querySelector('body') as HTMLBodyElement\n}\n/**\n * 显示弹出窗口\n *\n * 此函数用于创建并显示一个弹出窗口,支持自定义样式和内容通过参数传递\n * 可以选择附加到特定的父元素,并且在渲染后会将自身添加到弹出窗口列表中\n *\n * @param props 弹出窗口的属性,包括位置、尺寸等样式属性以及附加属性\n * @param component 可选参数,用于指定弹出窗口内渲染的自定义组件类型,如果props中传了render函数,则无效\n * @param componentProps 可选参数,传递给自定义组件的属性\n */\nexport const showPopWindow = (props: PopWindowProps, component?: Component, componentProps?: any) => {\n const op = {\n left: '0',\n top: '0',\n width: '100px',\n height: '100px',\n position: 'absolute',\n id: 'popwindow_' + Math.ceil(Math.random() * 1000000),\n animate: false,\n animateInClass: 'animate__animated animate__faster animate__fadeIn',\n animateOutClass: 'animate__animated animate__faster animate__fadeOut'\n }\n const option: PopWindowProps = Object.assign(op, props)\n const close = () => {\n closePopWindowById(option.id)\n }\n\n // 相同的id只会存在一个\n closePopWindowById(option.id)\n let animateClass = option.animate ? option.animateInClass : ''\n\n const vm = (\n <div\n class={'popWindow ' + animateClass}\n style={{ width: option.width, height: option.height, left: option.left, top: option.top, position: option.position }}>\n <ElScrollbar>\n {props.render ? props.render({ close, option }) : <component is={component} {...componentProps} onClose={() => close()}></component>}\n </ElScrollbar>\n </div>\n )\n vm.appContext = appContextConst\n // 这里是为了让插槽的子组件能获取到appContext\n if (vm.children?.length) {\n vm.children[0].appContext = appContextConst\n }\n const container = document.createElement('div')\n container.id = 'popwindow_' + Math.ceil(Math.random() * 1000000)\n\n let parentEl = getBody()\n if (props.appendParent) {\n parentEl = document.getElementById(props.appendParent)\n }\n parentEl.appendChild(container)\n render(vm, container)\n\n nextTick(() => {\n const popWindowInfo = { id: option.id, tag: option.tag, node: container, option }\n popWindowList.push(popWindowInfo)\n })\n return { id: option.id, close }\n}\nconst removePopWindow = (popWindowInfo: PopWindowInfoProps) => {\n if (!popWindowInfo) return\n const { option, node } = popWindowInfo\n option.onClose?.()\n if (option.animate) {\n const popWindowNode = node.querySelector('.popWindow')\n popWindowNode.className = 'popWindow ' + option.animateOutClass\n popWindowNode.addEventListener('animationend', () => {\n render(null, node)\n node.remove()\n popWindowList.splice(popWindowList.indexOf(popWindowInfo), 1)\n })\n } else {\n render(null, node)\n node.remove()\n popWindowList.splice(popWindowList.indexOf(popWindowInfo), 1)\n }\n}\n\n/**\n * 根据ID关闭弹出窗口\n *\n * @param id 弹出窗口的唯一标识符\n */\nexport const closePopWindowById = (id: string) => {\n const popWindowItem = popWindowList.find((item) => item.id === id)\n if (popWindowItem) {\n removePopWindow(popWindowItem)\n }\n}\n\n/**\n * 根据tag关闭弹出窗口\n *\n * @param tag 弹出窗口的tag\n */\nexport const closePopWindowByTag = (tag: string) => {\n const popWindows = popWindowList.filter((item) => item.tag === tag)\n popWindows.forEach((item) => removePopWindow(item))\n}\n\n/**\n * 获取所有弹窗信息\n * \n * @returns {PopWindowInfoProps[]} 所有弹窗的列表\n */\nexport const getAllPopWindows = (): PopWindowInfoProps[] => {\n return popWindowList\n}\n\nexport const initPopWindow = (ctx?: ComponentInternalInstance) => {\n const { appContext } = ctx || getCurrentInstance() || {}\n appContextConst = appContext\n\n return { showPopWindow }\n}\n"],"names":["appContextConst","popWindowList","getBody","document","querySelector","showPopWindow","props","component","componentProps","op","left","top","width","height","position","id","Math","ceil","random","animate","animateInClass","animateOutClass","option","Object","assign","close","closePopWindowById","animateClass","vm","_createVNode","ElScrollbar","default","render","_mergeProps","onClose","appContext","children","length","container","createElement","parentEl","appendParent","getElementById","appendChild","nextTick","popWindowInfo","tag","node","push","removePopWindow","popWindowNode","className","addEventListener","remove","splice","indexOf","popWindowItem","find","item","closePopWindowByTag","popWindows","filter","forEach","getAllPopWindows","initPopWindow","ctx","getCurrentInstance"],"mappings":";;;;;;;AAKA,IAAIA,eAAAA,CAAAA;AACJ,IAAIC,gBAA4B,EAAE,CAAA;AAClC,MAAMC,0BAAyB,MAAA,CAAA,MAAA;AAC7B,EAAOC,OAAAA,QAAAA,CAASC,cAAc,MAAM,CAAA,CAAA;AACtC,CAFgBF,EAAAA,SAAAA,CAAAA,CAAAA;AAaT,MAAMG,aAAgBA,mBAAAA,MAAAA,CAAAA,CAACC,KAAuBC,EAAAA,SAAAA,EAAuBC,cAAyB,KAAA;;AACnG,EAAA,MAAMC,EAAK,GAAA;AAAA,IACTC,IAAM,EAAA,GAAA;AAAA,IACNC,GAAK,EAAA,GAAA;AAAA,IACLC,KAAO,EAAA,OAAA;AAAA,IACPC,MAAQ,EAAA,OAAA;AAAA,IACRC,QAAU,EAAA,UAAA;AAAA,IACVC,IAAI,YAAeC,GAAAA,IAAAA,CAAKC,KAAKD,IAAKE,CAAAA,MAAAA,KAAW,GAAO,CAAA;AAAA,IACpDC,OAAS,EAAA,KAAA;AAAA,IACTC,cAAgB,EAAA,mDAAA;AAAA,IAChBC,eAAiB,EAAA,oDAAA;AAAA,GACnB,CAAA;AACA,EAAA,MAAMC,MAAyBC,GAAAA,MAAAA,CAAOC,MAAOf,CAAAA,EAAAA,EAAIH,KAAK,CAAA,CAAA;AACtD,EAAA,MAAMmB,wBAAc,MAAA,CAAA,MAAA;AAClBC,IAAAA,kBAAAA,CAAmBJ,OAAOP,EAAE,CAAA,CAAA;AAAA,GADhBU,EAAAA,OAAAA,CAAAA,CAAAA;AAKdC,EAAAA,kBAAAA,CAAmBJ,OAAOP,EAAE,CAAA,CAAA;AAC5B,EAAA,IAAIY,YAAeL,GAAAA,MAAAA,CAAOH,OAAUG,GAAAA,MAAAA,CAAOF,cAAiB,GAAA,EAAA,CAAA;AAE5D,EAAMQ,MAAAA,EAAAA,GAAEC,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AAG,CAAA,CAAA;AAClEc,EAAAA,UAAAA,CAAWE,OAASJ,CAAAA,CAAAA,IAAAA,KAAST,eAAgBS,CAAAA,IAAI,CAAC,CAAA,CAAA;AACpD,CAHoCZ,EAAAA,qBAAAA,EAAAA;AAU7B,MAAMiB,mCAA+C,MAAA,CAAA,MAAA;AAC1D,EAAO9D,OAAAA,aAAAA,CAAAA;AACT,CAFgC8D,EAAAA,kBAAAA,EAAAA;AAIzB,MAAMC,gCAAqD,MAAA,CAAA,CAAA,GAAA,KAAA;AAChE,EAAM,MAAA;AAAA,IAAE7B,UAAAA;AAAAA,GAAe8B,GAAAA,GAAAA,IAAOC,sBAAmB,EAAA,IAAK,EAAC,CAAA;AACvDlE,EAAkBmC,eAAAA,GAAAA,UAAAA,CAAAA;AAElB,EAAO,OAAA;AAAA,IAAE9B,aAAAA;AAAAA,GAAc,CAAA;AACzB,CAL8B4D,EAAAA,eAAAA;;;;;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { VNode } from 'vue';
|
|
2
|
+
export interface PopWindowProps {
|
|
3
|
+
left?: string;
|
|
4
|
+
top?: string;
|
|
5
|
+
width: string;
|
|
6
|
+
height: string;
|
|
7
|
+
position?: 'absolute' | 'relative';
|
|
8
|
+
id?: string;
|
|
9
|
+
tag?: string;
|
|
10
|
+
appendParent?: string;
|
|
11
|
+
animate?: boolean;
|
|
12
|
+
animateInClass?: string;
|
|
13
|
+
animateOutClass?: string;
|
|
14
|
+
onClose?: () => void;
|
|
15
|
+
render?: (scope: PopWindowRenderScope) => VNode;
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}
|
|
18
|
+
export interface PopWindowInfoProps {
|
|
19
|
+
id: string;
|
|
20
|
+
tag?: string;
|
|
21
|
+
node: any;
|
|
22
|
+
option: PopWindowProps;
|
|
23
|
+
}
|
|
24
|
+
export interface PopWindowRenderScope {
|
|
25
|
+
close: () => void;
|
|
26
|
+
option: PopWindowProps;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var installer = require('./installer.js');
|
|
6
|
+
require('./components/index.js');
|
|
7
|
+
require('./hooks/index.js');
|
|
8
|
+
require('./utils/index.js');
|
|
9
|
+
var index = require('./components/button/index.js');
|
|
10
|
+
var index$1 = require('./hooks/useDeveloper/index.js');
|
|
11
|
+
var index$2 = require('./hooks/usePopWindow/src/index.js');
|
|
12
|
+
var index$3 = require('./hooks/usePopWindow/index.js');
|
|
13
|
+
var install = require('./utils/install.js');
|
|
14
|
+
var myDevelop = require('./utils/myDevelop.js');
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
exports.default = installer.default;
|
|
19
|
+
exports.install = installer.install;
|
|
20
|
+
exports.IButton = index.IButton;
|
|
21
|
+
exports.useDeveloper = index$1.useDeveloper;
|
|
22
|
+
exports.closePopWindowById = index$2.closePopWindowById;
|
|
23
|
+
exports.closePopWindowByTag = index$2.closePopWindowByTag;
|
|
24
|
+
exports.showPopWindow = index$2.showPopWindow;
|
|
25
|
+
exports.usePopWindow = index$3.usePopWindow;
|
|
26
|
+
exports.withInstall = install.withInstall;
|
|
27
|
+
exports.withInstallDirectives = install.withInstallDirectives;
|
|
28
|
+
exports.developFn = myDevelop.developFn;
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/lib/installer.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var index = require('./components/button/index.js');
|
|
6
|
+
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
|
+
const component = [index.IButton];
|
|
10
|
+
const install = /* @__PURE__ */ __name(function(app) {
|
|
11
|
+
component.forEach((i) => app.use(i));
|
|
12
|
+
}, "install");
|
|
13
|
+
var installer = {
|
|
14
|
+
install
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
exports.default = installer;
|
|
18
|
+
exports.install = install;
|
|
19
|
+
//# sourceMappingURL=installer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installer.js","sources":["../../../packages/installer.ts"],"sourcesContent":["import type { App, Plugin } from 'vue';\n\nimport { IButton } from './components/button';\n\nconst component = [IButton] as Plugin[];\n\nexport const install = function (app: App) {\n component.forEach((i) => app.use(i));\n};\n\nexport default {\n install,\n};\n"],"names":["IButton"],"mappings":";;;;;;;;AAIA,MAAM,SAAA,GAAY,CAACA,aAAO,CAAA,CAAA;AAEb,MAAA,OAAA,mCAAoB,GAAU,EAAA;AACzC,EAAA,SAAA,CAAU,QAAQ,CAAC,CAAA,KAAM,GAAI,CAAA,GAAA,CAAI,CAAC,CAAC,CAAA,CAAA;AACrC,CAFuB,EAAA,SAAA,EAAA;AAIvB,gBAAe;AAAA,EACb,OAAA;AACF,CAAA;;;;;"}
|
package/lib/types.d.ts
ADDED
package/lib/types.js
ADDED
package/lib/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var install = require('./install.js');
|
|
4
|
+
var myDevelop = require('./myDevelop.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.withInstall = install.withInstall;
|
|
9
|
+
exports.withInstallDirectives = install.withInstallDirectives;
|
|
10
|
+
exports.developFn = myDevelop.developFn;
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|