@razaman2/reactive-view 0.0.34-beta.2 → 0.0.34-beta.3
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 +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +13 -11
- package/dist/index.mjs +13 -11
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -53,7 +53,9 @@ declare const _default: {
|
|
|
53
53
|
notifications: ObjectConstructor;
|
|
54
54
|
subscriptions: ObjectConstructor;
|
|
55
55
|
beforeSetData: FunctionConstructor;
|
|
56
|
-
data: {
|
|
56
|
+
data: {
|
|
57
|
+
default: () => {};
|
|
58
|
+
};
|
|
57
59
|
defaultData: {};
|
|
58
60
|
getDefaultData: {
|
|
59
61
|
type: FunctionConstructor;
|
package/dist/index.d.ts
CHANGED
|
@@ -53,7 +53,9 @@ declare const _default: {
|
|
|
53
53
|
notifications: ObjectConstructor;
|
|
54
54
|
subscriptions: ObjectConstructor;
|
|
55
55
|
beforeSetData: FunctionConstructor;
|
|
56
|
-
data: {
|
|
56
|
+
data: {
|
|
57
|
+
default: () => {};
|
|
58
|
+
};
|
|
57
59
|
defaultData: {};
|
|
58
60
|
getDefaultData: {
|
|
59
61
|
type: FunctionConstructor;
|
package/dist/index.js
CHANGED
|
@@ -168,7 +168,7 @@ var import_vue = require("vue");
|
|
|
168
168
|
|
|
169
169
|
// package.json
|
|
170
170
|
var name = "@razaman2/reactive-view";
|
|
171
|
-
var version = "0.0.34-beta.
|
|
171
|
+
var version = "0.0.34-beta.3";
|
|
172
172
|
|
|
173
173
|
// src/ReactiveView.ts
|
|
174
174
|
var setup = {
|
|
@@ -189,7 +189,9 @@ var ReactiveView_default = {
|
|
|
189
189
|
notifications: Object,
|
|
190
190
|
subscriptions: Object,
|
|
191
191
|
beforeSetData: Function,
|
|
192
|
-
data: {
|
|
192
|
+
data: {
|
|
193
|
+
default: () => ({})
|
|
194
|
+
},
|
|
193
195
|
defaultData: {},
|
|
194
196
|
getDefaultData: {
|
|
195
197
|
type: Function,
|
|
@@ -212,7 +214,7 @@ var ReactiveView_default = {
|
|
|
212
214
|
}
|
|
213
215
|
},
|
|
214
216
|
setup(props, context) {
|
|
215
|
-
var _a, _b, _c, _d, _e, _f
|
|
217
|
+
var _a, _b, _c, _d, _e, _f;
|
|
216
218
|
const template = (component2, vue2) => {
|
|
217
219
|
return (0, import_vue.createVNode)(
|
|
218
220
|
"div",
|
|
@@ -224,21 +226,21 @@ var ReactiveView_default = {
|
|
|
224
226
|
};
|
|
225
227
|
const isValid = (0, import_vue.ref)(false);
|
|
226
228
|
const isReady = (0, import_vue.ref)(false);
|
|
227
|
-
const isFunctionData = ["Function"].includes(
|
|
228
|
-
const isAsyncFunctionData = ["AsyncFunction"].includes(
|
|
229
|
-
const isPromiseData = ["Promise"].includes(
|
|
229
|
+
const isFunctionData = ["Function"].includes(props.data.constructor.name);
|
|
230
|
+
const isAsyncFunctionData = ["AsyncFunction"].includes(props.data.constructor.name);
|
|
231
|
+
const isPromiseData = ["Promise"].includes(props.data.constructor.name) || isAsyncFunctionData;
|
|
230
232
|
const defer = (0, import_vue.ref)(typeof props.defer === "function" ? props.defer() : props.defer);
|
|
231
233
|
const vue = (0, import_vue.getCurrentInstance)();
|
|
232
234
|
if ((isPromiseData || isFunctionData) && !("defaultData" in vue.vnode.props)) {
|
|
233
235
|
console.error("[ReactiveView]: defaultData is required for promise or async function data.");
|
|
234
236
|
}
|
|
235
237
|
const defaultData = props.getDefaultData(
|
|
236
|
-
((
|
|
238
|
+
((_a = vue.vnode.props) == null ? void 0 : _a.hasOwnProperty("defaultData")) ? vue.vnode.props.defaultData : ((_b = vue.vnode.props) == null ? void 0 : _b.hasOwnProperty("data")) ? Array.isArray(vue.vnode.props.data) ? [] : {} : {}
|
|
237
239
|
);
|
|
238
240
|
const datatype = Array.isArray(defaultData) ? [] : {};
|
|
239
241
|
const config = {
|
|
240
242
|
data: (0, import_vue.reactive)(import_object_manager.default.on(
|
|
241
|
-
isPromiseData || isFunctionData || (0, import_vue.isRef)(props.data) || (0, import_vue.isReactive)(props.data) ? datatype : ((
|
|
243
|
+
isPromiseData || isFunctionData || (0, import_vue.isRef)(props.data) || (0, import_vue.isReactive)(props.data) ? datatype : ((_c = vue.vnode.props) == null ? void 0 : _c.hasOwnProperty("data")) ? props.data : datatype
|
|
242
244
|
).clone()),
|
|
243
245
|
defaultData: import_object_manager.default.on(defaultData).clone(),
|
|
244
246
|
notifications: props.notifications,
|
|
@@ -295,9 +297,9 @@ var ReactiveView_default = {
|
|
|
295
297
|
const config2 = typeof context.attrs["onUpdate:model"] === "function" ? {
|
|
296
298
|
callback: context.attrs["onUpdate:model"],
|
|
297
299
|
options: Object.assign(__spreadValues(__spreadValues({
|
|
298
|
-
deep: (
|
|
299
|
-
}, context.attrs["model:immediate"] ? { immediate: context.attrs["model:immediate"] } : {}), context.attrs["model:once"] ? { once: context.attrs["model:once"] } : {}), ((
|
|
300
|
-
} : (
|
|
300
|
+
deep: (_d = context.attrs["model:deep"]) != null ? _d : true
|
|
301
|
+
}, context.attrs["model:immediate"] ? { immediate: context.attrs["model:immediate"] } : {}), context.attrs["model:once"] ? { once: context.attrs["model:once"] } : {}), ((_e = context.attrs["onUpdate:model"]) != null ? _e : {}).options)
|
|
302
|
+
} : (_f = context.attrs["onUpdate:model"]) != null ? _f : {};
|
|
301
303
|
if (context.attrs["model:log"]) {
|
|
302
304
|
console.log(`[ReactiveView]:model`, { config: config2 });
|
|
303
305
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -125,7 +125,7 @@ import { ref, reactive, watch, isRef, isReactive, createVNode, getCurrentInstanc
|
|
|
125
125
|
|
|
126
126
|
// package.json
|
|
127
127
|
var name = "@razaman2/reactive-view";
|
|
128
|
-
var version = "0.0.34-beta.
|
|
128
|
+
var version = "0.0.34-beta.3";
|
|
129
129
|
|
|
130
130
|
// src/ReactiveView.ts
|
|
131
131
|
var setup = {
|
|
@@ -146,7 +146,9 @@ var ReactiveView_default = {
|
|
|
146
146
|
notifications: Object,
|
|
147
147
|
subscriptions: Object,
|
|
148
148
|
beforeSetData: Function,
|
|
149
|
-
data: {
|
|
149
|
+
data: {
|
|
150
|
+
default: () => ({})
|
|
151
|
+
},
|
|
150
152
|
defaultData: {},
|
|
151
153
|
getDefaultData: {
|
|
152
154
|
type: Function,
|
|
@@ -169,7 +171,7 @@ var ReactiveView_default = {
|
|
|
169
171
|
}
|
|
170
172
|
},
|
|
171
173
|
setup(props, context) {
|
|
172
|
-
var _a, _b, _c, _d, _e, _f
|
|
174
|
+
var _a, _b, _c, _d, _e, _f;
|
|
173
175
|
const template = (component2, vue2) => {
|
|
174
176
|
return createVNode(
|
|
175
177
|
"div",
|
|
@@ -181,21 +183,21 @@ var ReactiveView_default = {
|
|
|
181
183
|
};
|
|
182
184
|
const isValid = ref(false);
|
|
183
185
|
const isReady = ref(false);
|
|
184
|
-
const isFunctionData = ["Function"].includes(
|
|
185
|
-
const isAsyncFunctionData = ["AsyncFunction"].includes(
|
|
186
|
-
const isPromiseData = ["Promise"].includes(
|
|
186
|
+
const isFunctionData = ["Function"].includes(props.data.constructor.name);
|
|
187
|
+
const isAsyncFunctionData = ["AsyncFunction"].includes(props.data.constructor.name);
|
|
188
|
+
const isPromiseData = ["Promise"].includes(props.data.constructor.name) || isAsyncFunctionData;
|
|
187
189
|
const defer = ref(typeof props.defer === "function" ? props.defer() : props.defer);
|
|
188
190
|
const vue = getCurrentInstance();
|
|
189
191
|
if ((isPromiseData || isFunctionData) && !("defaultData" in vue.vnode.props)) {
|
|
190
192
|
console.error("[ReactiveView]: defaultData is required for promise or async function data.");
|
|
191
193
|
}
|
|
192
194
|
const defaultData = props.getDefaultData(
|
|
193
|
-
((
|
|
195
|
+
((_a = vue.vnode.props) == null ? void 0 : _a.hasOwnProperty("defaultData")) ? vue.vnode.props.defaultData : ((_b = vue.vnode.props) == null ? void 0 : _b.hasOwnProperty("data")) ? Array.isArray(vue.vnode.props.data) ? [] : {} : {}
|
|
194
196
|
);
|
|
195
197
|
const datatype = Array.isArray(defaultData) ? [] : {};
|
|
196
198
|
const config = {
|
|
197
199
|
data: reactive(ObjectManager.on(
|
|
198
|
-
isPromiseData || isFunctionData || isRef(props.data) || isReactive(props.data) ? datatype : ((
|
|
200
|
+
isPromiseData || isFunctionData || isRef(props.data) || isReactive(props.data) ? datatype : ((_c = vue.vnode.props) == null ? void 0 : _c.hasOwnProperty("data")) ? props.data : datatype
|
|
199
201
|
).clone()),
|
|
200
202
|
defaultData: ObjectManager.on(defaultData).clone(),
|
|
201
203
|
notifications: props.notifications,
|
|
@@ -252,9 +254,9 @@ var ReactiveView_default = {
|
|
|
252
254
|
const config2 = typeof context.attrs["onUpdate:model"] === "function" ? {
|
|
253
255
|
callback: context.attrs["onUpdate:model"],
|
|
254
256
|
options: Object.assign(__spreadValues(__spreadValues({
|
|
255
|
-
deep: (
|
|
256
|
-
}, context.attrs["model:immediate"] ? { immediate: context.attrs["model:immediate"] } : {}), context.attrs["model:once"] ? { once: context.attrs["model:once"] } : {}), ((
|
|
257
|
-
} : (
|
|
257
|
+
deep: (_d = context.attrs["model:deep"]) != null ? _d : true
|
|
258
|
+
}, context.attrs["model:immediate"] ? { immediate: context.attrs["model:immediate"] } : {}), context.attrs["model:once"] ? { once: context.attrs["model:once"] } : {}), ((_e = context.attrs["onUpdate:model"]) != null ? _e : {}).options)
|
|
259
|
+
} : (_f = context.attrs["onUpdate:model"]) != null ? _f : {};
|
|
258
260
|
if (context.attrs["model:log"]) {
|
|
259
261
|
console.log(`[ReactiveView]:model`, { config: config2 });
|
|
260
262
|
}
|
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.3",
|
|
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",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"uuid": "^11.1.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"vue": "^3.5.
|
|
32
|
+
"vue": "^3.5.19"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/uuid": "^10.0.0",
|