@razaman2/reactive-view 0.0.34-beta.30 → 0.0.34-beta.31
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.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -3
- package/dist/index.mjs +16 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -177,7 +177,7 @@ var import_vue = require("vue");
|
|
|
177
177
|
|
|
178
178
|
// package.json
|
|
179
179
|
var name = "@razaman2/reactive-view";
|
|
180
|
-
var version = "0.0.34-beta.
|
|
180
|
+
var version = "0.0.34-beta.31";
|
|
181
181
|
|
|
182
182
|
// src/ReactiveView.ts
|
|
183
183
|
var setup = {
|
|
@@ -193,7 +193,7 @@ var ReactiveView_default = {
|
|
|
193
193
|
type: Boolean,
|
|
194
194
|
default: true
|
|
195
195
|
},
|
|
196
|
-
instance: { default: (
|
|
196
|
+
instance: { default: (0, import_vue.ref)() },
|
|
197
197
|
notifications: Object,
|
|
198
198
|
subscriptions: Object,
|
|
199
199
|
beforeSetData: Function,
|
|
@@ -254,6 +254,19 @@ var ReactiveView_default = {
|
|
|
254
254
|
const isPromiseData = ["Promise"].includes((_c = props.data) == null ? void 0 : _c.constructor.name) || isAsyncFunctionData;
|
|
255
255
|
const defer = (0, import_vue.ref)(typeof props.defer === "function" ? props.defer() : props.defer);
|
|
256
256
|
const vue = (0, import_vue.getCurrentInstance)();
|
|
257
|
+
const emit = (after, before) => {
|
|
258
|
+
if (vue && vue.vnode.el) {
|
|
259
|
+
const event = new CustomEvent("data:emit", {
|
|
260
|
+
bubbles: true,
|
|
261
|
+
// Key: allows it to travel up
|
|
262
|
+
composed: true,
|
|
263
|
+
// Key: allows it to cross Shadow DOM boundaries
|
|
264
|
+
detail: { before, after }
|
|
265
|
+
// Payload goes here
|
|
266
|
+
});
|
|
267
|
+
vue.vnode.el.dispatchEvent(event);
|
|
268
|
+
}
|
|
269
|
+
};
|
|
257
270
|
if ((isFunctionData || isPromiseData) && !("defaultData" in vue.vnode.props)) {
|
|
258
271
|
console.warn("[ReactiveView]: defaultData is required for promise or async function data.", props.data);
|
|
259
272
|
}
|
|
@@ -316,7 +329,7 @@ var ReactiveView_default = {
|
|
|
316
329
|
}
|
|
317
330
|
}
|
|
318
331
|
});
|
|
319
|
-
const component = (0, import_vue.ref)({ parent: { self: vue.proxy }, self: { template, model, diff, dataPath: dataPath2, isValid } });
|
|
332
|
+
const component = (0, import_vue.ref)({ parent: { self: vue.proxy }, self: { template, model, diff, emit, dataPath: dataPath2, isValid } });
|
|
320
333
|
if (props.debug) {
|
|
321
334
|
console.warn("[ReactiveView]:", { props, context, vue, defer, config, model, component, datatype, defaultData, isValid, isReady, isFunctionData, isAsyncFunctionData, isPromiseData });
|
|
322
335
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -131,7 +131,7 @@ import { ref, reactive, watch, isRef, isReactive, createVNode, getCurrentInstanc
|
|
|
131
131
|
|
|
132
132
|
// package.json
|
|
133
133
|
var name = "@razaman2/reactive-view";
|
|
134
|
-
var version = "0.0.34-beta.
|
|
134
|
+
var version = "0.0.34-beta.31";
|
|
135
135
|
|
|
136
136
|
// src/ReactiveView.ts
|
|
137
137
|
var setup = {
|
|
@@ -147,7 +147,7 @@ var ReactiveView_default = {
|
|
|
147
147
|
type: Boolean,
|
|
148
148
|
default: true
|
|
149
149
|
},
|
|
150
|
-
instance: { default:
|
|
150
|
+
instance: { default: ref() },
|
|
151
151
|
notifications: Object,
|
|
152
152
|
subscriptions: Object,
|
|
153
153
|
beforeSetData: Function,
|
|
@@ -208,6 +208,19 @@ var ReactiveView_default = {
|
|
|
208
208
|
const isPromiseData = ["Promise"].includes((_c = props.data) == null ? void 0 : _c.constructor.name) || isAsyncFunctionData;
|
|
209
209
|
const defer = ref(typeof props.defer === "function" ? props.defer() : props.defer);
|
|
210
210
|
const vue = getCurrentInstance();
|
|
211
|
+
const emit = (after, before) => {
|
|
212
|
+
if (vue && vue.vnode.el) {
|
|
213
|
+
const event = new CustomEvent("data:emit", {
|
|
214
|
+
bubbles: true,
|
|
215
|
+
// Key: allows it to travel up
|
|
216
|
+
composed: true,
|
|
217
|
+
// Key: allows it to cross Shadow DOM boundaries
|
|
218
|
+
detail: { before, after }
|
|
219
|
+
// Payload goes here
|
|
220
|
+
});
|
|
221
|
+
vue.vnode.el.dispatchEvent(event);
|
|
222
|
+
}
|
|
223
|
+
};
|
|
211
224
|
if ((isFunctionData || isPromiseData) && !("defaultData" in vue.vnode.props)) {
|
|
212
225
|
console.warn("[ReactiveView]: defaultData is required for promise or async function data.", props.data);
|
|
213
226
|
}
|
|
@@ -270,7 +283,7 @@ var ReactiveView_default = {
|
|
|
270
283
|
}
|
|
271
284
|
}
|
|
272
285
|
});
|
|
273
|
-
const component = ref({ parent: { self: vue.proxy }, self: { template, model, diff, dataPath: dataPath2, isValid } });
|
|
286
|
+
const component = ref({ parent: { self: vue.proxy }, self: { template, model, diff, emit, dataPath: dataPath2, isValid } });
|
|
274
287
|
if (props.debug) {
|
|
275
288
|
console.warn("[ReactiveView]:", { props, context, vue, defer, config, model, component, datatype, defaultData, isValid, isReady, isFunctionData, isAsyncFunctionData, isPromiseData });
|
|
276
289
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@razaman2/reactive-view",
|
|
3
|
-
"version": "0.0.34-beta.
|
|
3
|
+
"version": "0.0.34-beta.31",
|
|
4
4
|
"description": "This library enables you to build vue apps in an object oriented way. It provides a convenient approach to extend and override ui components. It provides a built in eventing system along with component data management.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|