@razaman2/reactive-view 0.0.34-beta.5 → 0.0.34-beta.6

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.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.5";
171
+ var version = "0.0.34-beta.6";
172
172
 
173
173
  // src/ReactiveView.ts
174
174
  var setup = {
@@ -214,7 +214,7 @@ var ReactiveView_default = {
214
214
  }
215
215
  },
216
216
  setup(props, context) {
217
- var _a, _b, _c, _d, _e, _f;
217
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
218
218
  const diff = (before, after) => {
219
219
  const change = after.paths().reduce((change2, path) => {
220
220
  if (before.get(path) !== after.get(path)) {
@@ -235,21 +235,21 @@ var ReactiveView_default = {
235
235
  };
236
236
  const isValid = (0, import_vue.ref)(false);
237
237
  const isReady = (0, import_vue.ref)(false);
238
- const isFunctionData = ["Function"].includes(props.data.constructor.name);
239
- const isAsyncFunctionData = ["AsyncFunction"].includes(props.data.constructor.name);
240
- const isPromiseData = ["Promise"].includes(props.data.constructor.name) || isAsyncFunctionData;
238
+ const isFunctionData = ["Function"].includes((_a = props.data) == null ? void 0 : _a.constructor.name);
239
+ const isAsyncFunctionData = ["AsyncFunction"].includes((_b = props.data) == null ? void 0 : _b.constructor.name);
240
+ const isPromiseData = ["Promise"].includes((_c = props.data) == null ? void 0 : _c.constructor.name) || isAsyncFunctionData;
241
241
  const defer = (0, import_vue.ref)(typeof props.defer === "function" ? props.defer() : props.defer);
242
242
  const vue = (0, import_vue.getCurrentInstance)();
243
243
  if ((isPromiseData || isFunctionData) && !("defaultData" in vue.vnode.props)) {
244
244
  console.error("[ReactiveView]: defaultData is required for promise or async function data.");
245
245
  }
246
246
  const defaultData = props.getDefaultData(
247
- ((_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) ? [] : {} : {}
247
+ ((_d = vue.vnode.props) == null ? void 0 : _d.hasOwnProperty("defaultData")) ? vue.vnode.props.defaultData : ((_e = vue.vnode.props) == null ? void 0 : _e.hasOwnProperty("data")) ? Array.isArray(vue.vnode.props.data) ? [] : {} : {}
248
248
  );
249
249
  const datatype = Array.isArray(defaultData) ? [] : {};
250
250
  const config = {
251
251
  data: (0, import_vue.reactive)(import_object_manager.default.on(
252
- 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
252
+ isPromiseData || isFunctionData || (0, import_vue.isRef)(props.data) || (0, import_vue.isReactive)(props.data) ? datatype : ((_f = vue.vnode.props) == null ? void 0 : _f.hasOwnProperty("data")) ? props.data : datatype
253
253
  ).clone()),
254
254
  defaultData: import_object_manager.default.on(defaultData).clone(),
255
255
  notifications: props.notifications,
@@ -305,9 +305,9 @@ var ReactiveView_default = {
305
305
  const config2 = typeof context.attrs["onUpdate:model"] === "function" ? {
306
306
  callback: context.attrs["onUpdate:model"],
307
307
  options: Object.assign(__spreadValues(__spreadValues({
308
- deep: (_d = context.attrs["model:deep"]) != null ? _d : true
309
- }, 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)
310
- } : (_f = context.attrs["onUpdate:model"]) != null ? _f : {};
308
+ deep: (_g = context.attrs["model:deep"]) != null ? _g : true
309
+ }, context.attrs["model:immediate"] ? { immediate: context.attrs["model:immediate"] } : {}), context.attrs["model:once"] ? { once: context.attrs["model:once"] } : {}), ((_h = context.attrs["onUpdate:model"]) != null ? _h : {}).options)
310
+ } : (_i = context.attrs["onUpdate:model"]) != null ? _i : {};
311
311
  if (context.attrs["model:log"]) {
312
312
  console.log(`[ReactiveView]:model`, { config: config2 });
313
313
  }
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.5";
128
+ var version = "0.0.34-beta.6";
129
129
 
130
130
  // src/ReactiveView.ts
131
131
  var setup = {
@@ -171,7 +171,7 @@ var ReactiveView_default = {
171
171
  }
172
172
  },
173
173
  setup(props, context) {
174
- var _a, _b, _c, _d, _e, _f;
174
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
175
175
  const diff = (before, after) => {
176
176
  const change = after.paths().reduce((change2, path) => {
177
177
  if (before.get(path) !== after.get(path)) {
@@ -192,21 +192,21 @@ var ReactiveView_default = {
192
192
  };
193
193
  const isValid = ref(false);
194
194
  const isReady = ref(false);
195
- const isFunctionData = ["Function"].includes(props.data.constructor.name);
196
- const isAsyncFunctionData = ["AsyncFunction"].includes(props.data.constructor.name);
197
- const isPromiseData = ["Promise"].includes(props.data.constructor.name) || isAsyncFunctionData;
195
+ const isFunctionData = ["Function"].includes((_a = props.data) == null ? void 0 : _a.constructor.name);
196
+ const isAsyncFunctionData = ["AsyncFunction"].includes((_b = props.data) == null ? void 0 : _b.constructor.name);
197
+ const isPromiseData = ["Promise"].includes((_c = props.data) == null ? void 0 : _c.constructor.name) || isAsyncFunctionData;
198
198
  const defer = ref(typeof props.defer === "function" ? props.defer() : props.defer);
199
199
  const vue = getCurrentInstance();
200
200
  if ((isPromiseData || isFunctionData) && !("defaultData" in vue.vnode.props)) {
201
201
  console.error("[ReactiveView]: defaultData is required for promise or async function data.");
202
202
  }
203
203
  const defaultData = props.getDefaultData(
204
- ((_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) ? [] : {} : {}
204
+ ((_d = vue.vnode.props) == null ? void 0 : _d.hasOwnProperty("defaultData")) ? vue.vnode.props.defaultData : ((_e = vue.vnode.props) == null ? void 0 : _e.hasOwnProperty("data")) ? Array.isArray(vue.vnode.props.data) ? [] : {} : {}
205
205
  );
206
206
  const datatype = Array.isArray(defaultData) ? [] : {};
207
207
  const config = {
208
208
  data: reactive(ObjectManager.on(
209
- isPromiseData || isFunctionData || isRef(props.data) || isReactive(props.data) ? datatype : ((_c = vue.vnode.props) == null ? void 0 : _c.hasOwnProperty("data")) ? props.data : datatype
209
+ isPromiseData || isFunctionData || isRef(props.data) || isReactive(props.data) ? datatype : ((_f = vue.vnode.props) == null ? void 0 : _f.hasOwnProperty("data")) ? props.data : datatype
210
210
  ).clone()),
211
211
  defaultData: ObjectManager.on(defaultData).clone(),
212
212
  notifications: props.notifications,
@@ -262,9 +262,9 @@ var ReactiveView_default = {
262
262
  const config2 = typeof context.attrs["onUpdate:model"] === "function" ? {
263
263
  callback: context.attrs["onUpdate:model"],
264
264
  options: Object.assign(__spreadValues(__spreadValues({
265
- deep: (_d = context.attrs["model:deep"]) != null ? _d : true
266
- }, 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)
267
- } : (_f = context.attrs["onUpdate:model"]) != null ? _f : {};
265
+ deep: (_g = context.attrs["model:deep"]) != null ? _g : true
266
+ }, context.attrs["model:immediate"] ? { immediate: context.attrs["model:immediate"] } : {}), context.attrs["model:once"] ? { once: context.attrs["model:once"] } : {}), ((_h = context.attrs["onUpdate:model"]) != null ? _h : {}).options)
267
+ } : (_i = context.attrs["onUpdate:model"]) != null ? _i : {};
268
268
  if (context.attrs["model:log"]) {
269
269
  console.log(`[ReactiveView]:model`, { config: config2 });
270
270
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@razaman2/reactive-view",
3
- "version": "0.0.34-beta.5",
3
+ "version": "0.0.34-beta.6",
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",