@razaman2/reactive-view 0.0.34-beta.11 → 0.0.34-beta.12
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 +9 -13
- package/dist/index.mjs +10 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -172,7 +172,7 @@ var import_vue = require("vue");
|
|
|
172
172
|
|
|
173
173
|
// package.json
|
|
174
174
|
var name = "@razaman2/reactive-view";
|
|
175
|
-
var version = "0.0.34-beta.
|
|
175
|
+
var version = "0.0.34-beta.12";
|
|
176
176
|
|
|
177
177
|
// src/ReactiveView.ts
|
|
178
178
|
var setup = {
|
|
@@ -187,15 +187,11 @@ var ReactiveView_default = {
|
|
|
187
187
|
type: Boolean,
|
|
188
188
|
default: true
|
|
189
189
|
},
|
|
190
|
-
instance: {
|
|
191
|
-
default: () => (0, import_vue.ref)()
|
|
192
|
-
},
|
|
190
|
+
instance: { default: () => (0, import_vue.ref)() },
|
|
193
191
|
notifications: Object,
|
|
194
192
|
subscriptions: Object,
|
|
195
193
|
beforeSetData: Function,
|
|
196
|
-
data: {
|
|
197
|
-
default: () => ({})
|
|
198
|
-
},
|
|
194
|
+
data: { default: () => ({}) },
|
|
199
195
|
defaultData: {},
|
|
200
196
|
getDefaultData: {
|
|
201
197
|
type: Function,
|
|
@@ -466,9 +462,8 @@ function access(view = {}, alternative) {
|
|
|
466
462
|
});
|
|
467
463
|
};
|
|
468
464
|
try {
|
|
469
|
-
const component = typeof view === "function" ? view() : view;
|
|
470
|
-
|
|
471
|
-
return resolve(ref2.ReactiveView ? access(ref2.instance) : ref2);
|
|
465
|
+
const component = (0, import_vue2.unref)(typeof view === "function" ? view() : view);
|
|
466
|
+
return resolve("instance" in component ? component.instance : component);
|
|
472
467
|
} catch (e) {
|
|
473
468
|
return resolve(view);
|
|
474
469
|
}
|
|
@@ -569,15 +564,16 @@ var extendVnode = (component, element) => {
|
|
|
569
564
|
});
|
|
570
565
|
};
|
|
571
566
|
var getData = (component, path, alternative) => {
|
|
567
|
+
const data = import_object_manager2.default.on((0, import_vue2.unref)(component.$attrs.state));
|
|
572
568
|
if (path) {
|
|
573
|
-
return
|
|
569
|
+
return data.get(dataPath(component, path), alternative);
|
|
574
570
|
} else {
|
|
575
|
-
return
|
|
571
|
+
return data.get();
|
|
576
572
|
}
|
|
577
573
|
};
|
|
578
574
|
var setData = (component, data, path) => {
|
|
579
575
|
return component.$emit("update:state", {
|
|
580
|
-
before: import_object_manager2.default.on((0, import_vue2.unref)(component.state)).clone(),
|
|
576
|
+
before: import_object_manager2.default.on((0, import_vue2.unref)(component.$attrs.state)).clone(),
|
|
581
577
|
after: path ? import_object_manager2.default.on({}).set(dataPath(component, path), data).get() : data
|
|
582
578
|
});
|
|
583
579
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -128,7 +128,7 @@ import { ref, reactive, watch, isRef, isReactive, createVNode, getCurrentInstanc
|
|
|
128
128
|
|
|
129
129
|
// package.json
|
|
130
130
|
var name = "@razaman2/reactive-view";
|
|
131
|
-
var version = "0.0.34-beta.
|
|
131
|
+
var version = "0.0.34-beta.12";
|
|
132
132
|
|
|
133
133
|
// src/ReactiveView.ts
|
|
134
134
|
var setup = {
|
|
@@ -143,15 +143,11 @@ var ReactiveView_default = {
|
|
|
143
143
|
type: Boolean,
|
|
144
144
|
default: true
|
|
145
145
|
},
|
|
146
|
-
instance: {
|
|
147
|
-
default: () => ref()
|
|
148
|
-
},
|
|
146
|
+
instance: { default: () => ref() },
|
|
149
147
|
notifications: Object,
|
|
150
148
|
subscriptions: Object,
|
|
151
149
|
beforeSetData: Function,
|
|
152
|
-
data: {
|
|
153
|
-
default: () => ({})
|
|
154
|
-
},
|
|
150
|
+
data: { default: () => ({}) },
|
|
155
151
|
defaultData: {},
|
|
156
152
|
getDefaultData: {
|
|
157
153
|
type: Function,
|
|
@@ -323,7 +319,7 @@ var ReactiveView_default = {
|
|
|
323
319
|
};
|
|
324
320
|
|
|
325
321
|
// src/index.ts
|
|
326
|
-
import { h, unref as unref2,
|
|
322
|
+
import { h, unref as unref2, toRaw, createVNode as createVNode2 } from "vue";
|
|
327
323
|
import { formatInTimeZone } from "date-fns-tz";
|
|
328
324
|
import { twMerge } from "tailwind-merge";
|
|
329
325
|
console.log(`%c[ReactiveView]: ${version}`, "background-color: red; color: yellow;");
|
|
@@ -422,9 +418,8 @@ function access(view = {}, alternative) {
|
|
|
422
418
|
});
|
|
423
419
|
};
|
|
424
420
|
try {
|
|
425
|
-
const component = typeof view === "function" ? view() : view;
|
|
426
|
-
|
|
427
|
-
return resolve(ref2.ReactiveView ? access(ref2.instance) : ref2);
|
|
421
|
+
const component = unref2(typeof view === "function" ? view() : view);
|
|
422
|
+
return resolve("instance" in component ? component.instance : component);
|
|
428
423
|
} catch (e) {
|
|
429
424
|
return resolve(view);
|
|
430
425
|
}
|
|
@@ -525,15 +520,16 @@ var extendVnode = (component, element) => {
|
|
|
525
520
|
});
|
|
526
521
|
};
|
|
527
522
|
var getData = (component, path, alternative) => {
|
|
523
|
+
const data = ObjectManager2.on(unref2(component.$attrs.state));
|
|
528
524
|
if (path) {
|
|
529
|
-
return
|
|
525
|
+
return data.get(dataPath(component, path), alternative);
|
|
530
526
|
} else {
|
|
531
|
-
return
|
|
527
|
+
return data.get();
|
|
532
528
|
}
|
|
533
529
|
};
|
|
534
530
|
var setData = (component, data, path) => {
|
|
535
531
|
return component.$emit("update:state", {
|
|
536
|
-
before: ObjectManager2.on(unref2(component.state)).clone(),
|
|
532
|
+
before: ObjectManager2.on(unref2(component.$attrs.state)).clone(),
|
|
537
533
|
after: path ? ObjectManager2.on({}).set(dataPath(component, path), data).get() : data
|
|
538
534
|
});
|
|
539
535
|
};
|
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.12",
|
|
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",
|