phecda-vue 1.2.1 → 1.2.5
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/index.d.ts +19 -24
- package/dist/index.js +49 -46
- package/dist/index.mjs +49 -45
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { EventType, Handler, Emitter } from 'mitt';
|
|
3
|
-
import * as vue from 'vue';
|
|
4
|
-
import { Ref, App, UnwrapNestedRefs, Component, DefineComponent, ExtractPropTypes, VNode } from 'vue';
|
|
5
|
-
import { Phecda } from 'phecda-core';
|
|
1
|
+
import { PhecdaEvents } from 'phecda-core';
|
|
6
2
|
export * from 'phecda-core';
|
|
3
|
+
import * as vue from 'vue';
|
|
4
|
+
import { Ref, App, UnwrapNestedRefs, Component, DefineComponent, VNode } from 'vue';
|
|
5
|
+
import { Handler } from 'mitt';
|
|
7
6
|
|
|
8
7
|
type ReadonlyValue<T> = {
|
|
9
8
|
readonly [K in keyof T]: K extends 'value' ? T[K] : ReadonlyValue<T[K]>;
|
|
@@ -17,15 +16,13 @@ type ReplaceInstanceValues<I> = {
|
|
|
17
16
|
type SchemaToObj<S> = {
|
|
18
17
|
[P in keyof S]: S[P] extends object ? SchemaToObj<S[P]> : (S[P] extends string ? any : S[P]);
|
|
19
18
|
};
|
|
20
|
-
interface
|
|
21
|
-
|
|
19
|
+
interface PhecdaEmitter {
|
|
20
|
+
on<N extends keyof PhecdaEvents>(eventName: N, cb: (args: PhecdaEvents[N]) => void): void;
|
|
21
|
+
off<N extends keyof PhecdaEvents>(eventName: N, cb?: (args: PhecdaEvents[N]) => void): void;
|
|
22
|
+
emit<N extends keyof PhecdaEvents>(eventName: N, param: PhecdaEvents[N]): void;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
declare const emitter:
|
|
25
|
-
declare const invokeAction: {
|
|
26
|
-
<Key extends keyof PhecdaEvents>(type: Key, event: PhecdaEvents[Key]): void;
|
|
27
|
-
<Key_1 extends keyof PhecdaEvents>(type: undefined extends PhecdaEvents[Key_1] ? Key_1 : never): void;
|
|
28
|
-
};
|
|
25
|
+
declare const emitter: PhecdaEmitter;
|
|
29
26
|
|
|
30
27
|
declare const phecdaSymbol: unique symbol;
|
|
31
28
|
declare function createPhecda(symbol?: string): vue.Raw<{
|
|
@@ -81,16 +78,6 @@ declare function createFilter<Data extends Record<string, any>>(initState?: Obje
|
|
|
81
78
|
clearStore: (key: string) => void;
|
|
82
79
|
};
|
|
83
80
|
|
|
84
|
-
declare class P {
|
|
85
|
-
protected static emitter: Emitter<PhecdaEvents>;
|
|
86
|
-
protected _namespace: Phecda['_namespace'];
|
|
87
|
-
constructor();
|
|
88
|
-
get tag(): string;
|
|
89
|
-
on<Key extends keyof PhecdaEvents>(type: Key, handler: Handler<PhecdaEvents[Key]>): void;
|
|
90
|
-
emit(type: keyof PhecdaEvents, event: PhecdaEvents[keyof PhecdaEvents]): void;
|
|
91
|
-
off<Key extends keyof PhecdaEvents>(type: Key, handler?: Handler<PhecdaEvents[Key]>): void;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
81
|
declare function createForm<P extends {
|
|
95
82
|
$props: any;
|
|
96
83
|
}>(compSet: Record<string, Component> | any, form: Component<P>, formItem: Component | false, modelKey?: string): DefineComponent<{
|
|
@@ -114,7 +101,7 @@ declare const getAntDRules: typeof getNaiveUIRules;
|
|
|
114
101
|
declare function getNutUIRules<M, O extends object>(Model: M, options?: O): any;
|
|
115
102
|
declare const getVantRules: typeof getNutUIRules;
|
|
116
103
|
|
|
117
|
-
declare const createModal: <
|
|
104
|
+
declare const createModal: <T>(wrapComp: Component<T>, props?: Partial<T>, modelKey?: string) => <P>(comp: Component<P>, props?: P) => void;
|
|
118
105
|
|
|
119
106
|
declare function createTable<P extends {
|
|
120
107
|
$props: any;
|
|
@@ -136,4 +123,12 @@ interface PipeRet {
|
|
|
136
123
|
get: Record<string, () => VNode>;
|
|
137
124
|
}
|
|
138
125
|
|
|
139
|
-
|
|
126
|
+
declare class PV {
|
|
127
|
+
constructor();
|
|
128
|
+
get tag(): any;
|
|
129
|
+
on<Key extends keyof PhecdaEvents>(type: Key, handler: (arg: PhecdaEvents[Key]) => void): void;
|
|
130
|
+
emit<Key extends keyof PhecdaEvents>(type: Key, param: PhecdaEvents[Key]): void;
|
|
131
|
+
off<Key extends keyof PhecdaEvents>(type: Key, handler?: (arg: PhecdaEvents[Key]) => void): void;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export { EXPRESS_RE, FN_RE, GetDevUIRules, PV, PhecdaEmitter, PublicOnly, ReplaceInstanceValues, SchemaToObj, clearStorage, createFilter, createForm, createFormData, createModal, createPhecda, createPipe, createTable, deleteStorage, emitter, getActivePhecda, getAntDRules, getElementPlusRules, getNaiveUIRules, getNutUIRules, getReactiveMap, getVantRules, initalize, phecdaSymbol, setActivePhecda, useEvent, useO, usePatch, useR, useV };
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
8
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
10
9
|
var __export = (target, all) => {
|
|
11
10
|
for (var name in all)
|
|
@@ -25,10 +24,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
24
|
mod
|
|
26
25
|
));
|
|
27
26
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var __publicField = (obj, key, value) => {
|
|
29
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
30
|
-
return value;
|
|
31
|
-
};
|
|
32
27
|
|
|
33
28
|
// src/index.ts
|
|
34
29
|
var src_exports = {};
|
|
@@ -36,7 +31,7 @@ __export(src_exports, {
|
|
|
36
31
|
EXPRESS_RE: () => EXPRESS_RE,
|
|
37
32
|
FN_RE: () => FN_RE,
|
|
38
33
|
GetDevUIRules: () => GetDevUIRules,
|
|
39
|
-
|
|
34
|
+
PV: () => PV,
|
|
40
35
|
clearStorage: () => clearStorage,
|
|
41
36
|
createFilter: () => createFilter,
|
|
42
37
|
createForm: () => createForm,
|
|
@@ -55,7 +50,6 @@ __export(src_exports, {
|
|
|
55
50
|
getReactiveMap: () => getReactiveMap,
|
|
56
51
|
getVantRules: () => getVantRules,
|
|
57
52
|
initalize: () => initalize,
|
|
58
|
-
invokeAction: () => invokeAction,
|
|
59
53
|
phecdaSymbol: () => phecdaSymbol,
|
|
60
54
|
setActivePhecda: () => setActivePhecda,
|
|
61
55
|
useEvent: () => useEvent,
|
|
@@ -69,7 +63,6 @@ module.exports = __toCommonJS(src_exports);
|
|
|
69
63
|
// src/emitter.ts
|
|
70
64
|
var import_mitt = __toESM(require("mitt"));
|
|
71
65
|
var emitter = (0, import_mitt.default)();
|
|
72
|
-
var invokeAction = emitter.emit.bind(emitter);
|
|
73
66
|
|
|
74
67
|
// src/vue/phecda.ts
|
|
75
68
|
var import_vue = require("vue");
|
|
@@ -96,18 +89,31 @@ function createPhecda(symbol) {
|
|
|
96
89
|
}
|
|
97
90
|
};
|
|
98
91
|
}
|
|
99
|
-
|
|
100
|
-
(0, import_phecda_core.injectProperty)("watcher", ({ eventName, instance, key }) => {
|
|
92
|
+
let eventRecord = [];
|
|
93
|
+
(0, import_phecda_core.injectProperty)("watcher", ({ eventName, instance, key, options }) => {
|
|
101
94
|
const fn = typeof instance[key] === "function" ? instance[key].bind(instance) : (v) => instance[key] = v;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
95
|
+
if (options?.once) {
|
|
96
|
+
const handler = /* @__PURE__ */ __name((...args) => {
|
|
97
|
+
fn(...args);
|
|
98
|
+
emitter.off(eventName, handler);
|
|
99
|
+
}, "handler");
|
|
100
|
+
emitter.on(eventName, handler);
|
|
101
|
+
eventRecord.push([
|
|
102
|
+
eventName,
|
|
103
|
+
handler
|
|
104
|
+
]);
|
|
105
|
+
} else {
|
|
106
|
+
eventRecord.push([
|
|
107
|
+
eventName,
|
|
108
|
+
fn
|
|
109
|
+
]);
|
|
110
|
+
emitter.on(eventName, fn);
|
|
111
|
+
}
|
|
107
112
|
});
|
|
108
113
|
const originUnmount = app.unmount.bind(app);
|
|
109
114
|
app.unmount = () => {
|
|
110
115
|
eventRecord.forEach(([eventName, handler]) => emitter.off(eventName, handler));
|
|
116
|
+
eventRecord = [];
|
|
111
117
|
if (symbol)
|
|
112
118
|
delete window.__PHECDA_VUE__[symbol];
|
|
113
119
|
originUnmount();
|
|
@@ -428,28 +434,6 @@ __name(createFilter, "createFilter");
|
|
|
428
434
|
// src/index.ts
|
|
429
435
|
__reExport(src_exports, require("phecda-core"), module.exports);
|
|
430
436
|
|
|
431
|
-
// src/wrapper.ts
|
|
432
|
-
var _P = class {
|
|
433
|
-
_namespace;
|
|
434
|
-
constructor() {
|
|
435
|
-
}
|
|
436
|
-
get tag() {
|
|
437
|
-
return this._namespace.__TAG__;
|
|
438
|
-
}
|
|
439
|
-
on(type, handler) {
|
|
440
|
-
_P.emitter.on(type, handler);
|
|
441
|
-
}
|
|
442
|
-
emit(type, event) {
|
|
443
|
-
_P.emitter.emit(type, event);
|
|
444
|
-
}
|
|
445
|
-
off(type, handler) {
|
|
446
|
-
_P.emitter.off(type, handler);
|
|
447
|
-
}
|
|
448
|
-
};
|
|
449
|
-
var P = _P;
|
|
450
|
-
__name(P, "P");
|
|
451
|
-
__publicField(P, "emitter", emitter);
|
|
452
|
-
|
|
453
437
|
// src/components/createForm.ts
|
|
454
438
|
var import_vue5 = require("vue");
|
|
455
439
|
function createForm(compSet, form, formItem, modelKey = "modelValue") {
|
|
@@ -560,7 +544,7 @@ __name(createFormData, "createFormData");
|
|
|
560
544
|
// src/components/formResolve.ts
|
|
561
545
|
var import_phecda_core3 = require("phecda-core");
|
|
562
546
|
function getElementPlusRules(Model, options = {}) {
|
|
563
|
-
const stateVars = (0, import_phecda_core3.
|
|
547
|
+
const stateVars = (0, import_phecda_core3.getExposeKey)(Model);
|
|
564
548
|
const ret = {};
|
|
565
549
|
for (const item of stateVars) {
|
|
566
550
|
const handlers = (0, import_phecda_core3.getHandler)(Model, item);
|
|
@@ -589,7 +573,7 @@ function getElementPlusRules(Model, options = {}) {
|
|
|
589
573
|
__name(getElementPlusRules, "getElementPlusRules");
|
|
590
574
|
var GetDevUIRules = getElementPlusRules;
|
|
591
575
|
function getNaiveUIRules(Model, options = {}) {
|
|
592
|
-
const stateVars = (0, import_phecda_core3.
|
|
576
|
+
const stateVars = (0, import_phecda_core3.getExposeKey)(Model);
|
|
593
577
|
const ret = {};
|
|
594
578
|
for (const item of stateVars) {
|
|
595
579
|
const handlers = (0, import_phecda_core3.getHandler)(Model, item);
|
|
@@ -618,7 +602,7 @@ function getNaiveUIRules(Model, options = {}) {
|
|
|
618
602
|
__name(getNaiveUIRules, "getNaiveUIRules");
|
|
619
603
|
var getAntDRules = getNaiveUIRules;
|
|
620
604
|
function getNutUIRules(Model, options = {}) {
|
|
621
|
-
const stateVars = (0, import_phecda_core3.
|
|
605
|
+
const stateVars = (0, import_phecda_core3.getExposeKey)(Model);
|
|
622
606
|
const ret = {};
|
|
623
607
|
for (const item of stateVars) {
|
|
624
608
|
const handlers = (0, import_phecda_core3.getHandler)(Model, item);
|
|
@@ -650,7 +634,7 @@ var getVantRules = getNutUIRules;
|
|
|
650
634
|
|
|
651
635
|
// src/components/createModal.ts
|
|
652
636
|
var import_vue6 = require("vue");
|
|
653
|
-
var createModal = /* @__PURE__ */ __name(function(modalWrapper, modelKey = "modelValue") {
|
|
637
|
+
var createModal = /* @__PURE__ */ __name(function(modalWrapper, props = {}, modelKey = "modelValue") {
|
|
654
638
|
let isMounted = false;
|
|
655
639
|
const isShow = (0, import_vue6.ref)(true);
|
|
656
640
|
const content = (0, import_vue6.shallowRef)();
|
|
@@ -661,15 +645,16 @@ var createModal = /* @__PURE__ */ __name(function(modalWrapper, modelKey = "mode
|
|
|
661
645
|
[modelKey]: isShow.value,
|
|
662
646
|
[`onUpdate:${modelKey}`]: (v) => {
|
|
663
647
|
isShow.value = v;
|
|
664
|
-
}
|
|
648
|
+
},
|
|
649
|
+
...props
|
|
665
650
|
}, {
|
|
666
651
|
default: () => content.value && (0, import_vue6.h)(content.value, propsRef.value)
|
|
667
652
|
});
|
|
668
653
|
}
|
|
669
654
|
});
|
|
670
|
-
return (comp,
|
|
655
|
+
return (comp, props2) => {
|
|
671
656
|
content.value = comp;
|
|
672
|
-
propsRef.value =
|
|
657
|
+
propsRef.value = props2;
|
|
673
658
|
if (!isMounted) {
|
|
674
659
|
const el = document.createElement("div");
|
|
675
660
|
const vnode = (0, import_vue6.h)(wrapper);
|
|
@@ -757,12 +742,31 @@ function createPipe(comp, props, to = "default", slot) {
|
|
|
757
742
|
};
|
|
758
743
|
}
|
|
759
744
|
__name(createPipe, "createPipe");
|
|
745
|
+
|
|
746
|
+
// src/wrapper.ts
|
|
747
|
+
var PV = class {
|
|
748
|
+
constructor() {
|
|
749
|
+
}
|
|
750
|
+
get tag() {
|
|
751
|
+
return this._namespace.__TAG__;
|
|
752
|
+
}
|
|
753
|
+
on(type, handler) {
|
|
754
|
+
emitter.on(type, handler);
|
|
755
|
+
}
|
|
756
|
+
emit(type, param) {
|
|
757
|
+
emitter.emit(type, param);
|
|
758
|
+
}
|
|
759
|
+
off(type, handler) {
|
|
760
|
+
emitter.off(type, handler);
|
|
761
|
+
}
|
|
762
|
+
};
|
|
763
|
+
__name(PV, "PV");
|
|
760
764
|
// Annotate the CommonJS export names for ESM import in node:
|
|
761
765
|
0 && (module.exports = {
|
|
762
766
|
EXPRESS_RE,
|
|
763
767
|
FN_RE,
|
|
764
768
|
GetDevUIRules,
|
|
765
|
-
|
|
769
|
+
PV,
|
|
766
770
|
clearStorage,
|
|
767
771
|
createFilter,
|
|
768
772
|
createForm,
|
|
@@ -781,7 +785,6 @@ __name(createPipe, "createPipe");
|
|
|
781
785
|
getReactiveMap,
|
|
782
786
|
getVantRules,
|
|
783
787
|
initalize,
|
|
784
|
-
invokeAction,
|
|
785
788
|
phecdaSymbol,
|
|
786
789
|
setActivePhecda,
|
|
787
790
|
useEvent,
|
package/dist/index.mjs
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4
|
-
var __publicField = (obj, key, value) => {
|
|
5
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6
|
-
return value;
|
|
7
|
-
};
|
|
8
3
|
|
|
9
4
|
// src/emitter.ts
|
|
10
5
|
import mitt from "mitt";
|
|
11
6
|
var emitter = mitt();
|
|
12
|
-
var invokeAction = emitter.emit.bind(emitter);
|
|
13
7
|
|
|
14
8
|
// src/vue/phecda.ts
|
|
15
9
|
import { markRaw } from "vue";
|
|
@@ -36,18 +30,31 @@ function createPhecda(symbol) {
|
|
|
36
30
|
}
|
|
37
31
|
};
|
|
38
32
|
}
|
|
39
|
-
|
|
40
|
-
injectProperty("watcher", ({ eventName, instance, key }) => {
|
|
33
|
+
let eventRecord = [];
|
|
34
|
+
injectProperty("watcher", ({ eventName, instance, key, options }) => {
|
|
41
35
|
const fn = typeof instance[key] === "function" ? instance[key].bind(instance) : (v) => instance[key] = v;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
36
|
+
if (options?.once) {
|
|
37
|
+
const handler = /* @__PURE__ */ __name((...args) => {
|
|
38
|
+
fn(...args);
|
|
39
|
+
emitter.off(eventName, handler);
|
|
40
|
+
}, "handler");
|
|
41
|
+
emitter.on(eventName, handler);
|
|
42
|
+
eventRecord.push([
|
|
43
|
+
eventName,
|
|
44
|
+
handler
|
|
45
|
+
]);
|
|
46
|
+
} else {
|
|
47
|
+
eventRecord.push([
|
|
48
|
+
eventName,
|
|
49
|
+
fn
|
|
50
|
+
]);
|
|
51
|
+
emitter.on(eventName, fn);
|
|
52
|
+
}
|
|
47
53
|
});
|
|
48
54
|
const originUnmount = app.unmount.bind(app);
|
|
49
55
|
app.unmount = () => {
|
|
50
56
|
eventRecord.forEach(([eventName, handler]) => emitter.off(eventName, handler));
|
|
57
|
+
eventRecord = [];
|
|
51
58
|
if (symbol)
|
|
52
59
|
delete window.__PHECDA_VUE__[symbol];
|
|
53
60
|
originUnmount();
|
|
@@ -368,28 +375,6 @@ __name(createFilter, "createFilter");
|
|
|
368
375
|
// src/index.ts
|
|
369
376
|
export * from "phecda-core";
|
|
370
377
|
|
|
371
|
-
// src/wrapper.ts
|
|
372
|
-
var _P = class {
|
|
373
|
-
_namespace;
|
|
374
|
-
constructor() {
|
|
375
|
-
}
|
|
376
|
-
get tag() {
|
|
377
|
-
return this._namespace.__TAG__;
|
|
378
|
-
}
|
|
379
|
-
on(type, handler) {
|
|
380
|
-
_P.emitter.on(type, handler);
|
|
381
|
-
}
|
|
382
|
-
emit(type, event) {
|
|
383
|
-
_P.emitter.emit(type, event);
|
|
384
|
-
}
|
|
385
|
-
off(type, handler) {
|
|
386
|
-
_P.emitter.off(type, handler);
|
|
387
|
-
}
|
|
388
|
-
};
|
|
389
|
-
var P = _P;
|
|
390
|
-
__name(P, "P");
|
|
391
|
-
__publicField(P, "emitter", emitter);
|
|
392
|
-
|
|
393
378
|
// src/components/createForm.ts
|
|
394
379
|
import { defineComponent, h, onMounted, ref as ref2 } from "vue";
|
|
395
380
|
function createForm(compSet, form, formItem, modelKey = "modelValue") {
|
|
@@ -498,9 +483,9 @@ function createFormData(schema, initData = {}, options = {}) {
|
|
|
498
483
|
__name(createFormData, "createFormData");
|
|
499
484
|
|
|
500
485
|
// src/components/formResolve.ts
|
|
501
|
-
import { getHandler as getHandler2,
|
|
486
|
+
import { getExposeKey, getHandler as getHandler2, validate } from "phecda-core";
|
|
502
487
|
function getElementPlusRules(Model, options = {}) {
|
|
503
|
-
const stateVars =
|
|
488
|
+
const stateVars = getExposeKey(Model);
|
|
504
489
|
const ret = {};
|
|
505
490
|
for (const item of stateVars) {
|
|
506
491
|
const handlers = getHandler2(Model, item);
|
|
@@ -529,7 +514,7 @@ function getElementPlusRules(Model, options = {}) {
|
|
|
529
514
|
__name(getElementPlusRules, "getElementPlusRules");
|
|
530
515
|
var GetDevUIRules = getElementPlusRules;
|
|
531
516
|
function getNaiveUIRules(Model, options = {}) {
|
|
532
|
-
const stateVars =
|
|
517
|
+
const stateVars = getExposeKey(Model);
|
|
533
518
|
const ret = {};
|
|
534
519
|
for (const item of stateVars) {
|
|
535
520
|
const handlers = getHandler2(Model, item);
|
|
@@ -558,7 +543,7 @@ function getNaiveUIRules(Model, options = {}) {
|
|
|
558
543
|
__name(getNaiveUIRules, "getNaiveUIRules");
|
|
559
544
|
var getAntDRules = getNaiveUIRules;
|
|
560
545
|
function getNutUIRules(Model, options = {}) {
|
|
561
|
-
const stateVars =
|
|
546
|
+
const stateVars = getExposeKey(Model);
|
|
562
547
|
const ret = {};
|
|
563
548
|
for (const item of stateVars) {
|
|
564
549
|
const handlers = getHandler2(Model, item);
|
|
@@ -590,7 +575,7 @@ var getVantRules = getNutUIRules;
|
|
|
590
575
|
|
|
591
576
|
// src/components/createModal.ts
|
|
592
577
|
import { defineComponent as defineComponent2, h as h2, ref as ref3, render, shallowRef } from "vue";
|
|
593
|
-
var createModal = /* @__PURE__ */ __name(function(modalWrapper, modelKey = "modelValue") {
|
|
578
|
+
var createModal = /* @__PURE__ */ __name(function(modalWrapper, props = {}, modelKey = "modelValue") {
|
|
594
579
|
let isMounted = false;
|
|
595
580
|
const isShow = ref3(true);
|
|
596
581
|
const content = shallowRef();
|
|
@@ -601,15 +586,16 @@ var createModal = /* @__PURE__ */ __name(function(modalWrapper, modelKey = "mode
|
|
|
601
586
|
[modelKey]: isShow.value,
|
|
602
587
|
[`onUpdate:${modelKey}`]: (v) => {
|
|
603
588
|
isShow.value = v;
|
|
604
|
-
}
|
|
589
|
+
},
|
|
590
|
+
...props
|
|
605
591
|
}, {
|
|
606
592
|
default: () => content.value && h2(content.value, propsRef.value)
|
|
607
593
|
});
|
|
608
594
|
}
|
|
609
595
|
});
|
|
610
|
-
return (comp,
|
|
596
|
+
return (comp, props2) => {
|
|
611
597
|
content.value = comp;
|
|
612
|
-
propsRef.value =
|
|
598
|
+
propsRef.value = props2;
|
|
613
599
|
if (!isMounted) {
|
|
614
600
|
const el = document.createElement("div");
|
|
615
601
|
const vnode = h2(wrapper);
|
|
@@ -697,11 +683,30 @@ function createPipe(comp, props, to = "default", slot) {
|
|
|
697
683
|
};
|
|
698
684
|
}
|
|
699
685
|
__name(createPipe, "createPipe");
|
|
686
|
+
|
|
687
|
+
// src/wrapper.ts
|
|
688
|
+
var PV = class {
|
|
689
|
+
constructor() {
|
|
690
|
+
}
|
|
691
|
+
get tag() {
|
|
692
|
+
return this._namespace.__TAG__;
|
|
693
|
+
}
|
|
694
|
+
on(type, handler) {
|
|
695
|
+
emitter.on(type, handler);
|
|
696
|
+
}
|
|
697
|
+
emit(type, param) {
|
|
698
|
+
emitter.emit(type, param);
|
|
699
|
+
}
|
|
700
|
+
off(type, handler) {
|
|
701
|
+
emitter.off(type, handler);
|
|
702
|
+
}
|
|
703
|
+
};
|
|
704
|
+
__name(PV, "PV");
|
|
700
705
|
export {
|
|
701
706
|
EXPRESS_RE,
|
|
702
707
|
FN_RE,
|
|
703
708
|
GetDevUIRules,
|
|
704
|
-
|
|
709
|
+
PV,
|
|
705
710
|
clearStorage,
|
|
706
711
|
createFilter,
|
|
707
712
|
createForm,
|
|
@@ -720,7 +725,6 @@ export {
|
|
|
720
725
|
getReactiveMap,
|
|
721
726
|
getVantRules,
|
|
722
727
|
initalize,
|
|
723
|
-
invokeAction,
|
|
724
728
|
phecdaSymbol,
|
|
725
729
|
setActivePhecda,
|
|
726
730
|
useEvent,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "phecda-vue",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"mitt": "^3.0.0",
|
|
16
16
|
"vue": "^3.2.45",
|
|
17
|
-
"phecda-core": "1.
|
|
17
|
+
"phecda-core": "1.1.1"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"tsup": "^6.5.0"
|