@razaman2/reactive-view 0.0.34-beta.10 → 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 +14 -13
- package/dist/index.mjs +15 -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,
|
|
@@ -370,6 +366,7 @@ var ReactiveView_default = {
|
|
|
370
366
|
var import_vue2 = require("vue");
|
|
371
367
|
var import_date_fns_tz = require("date-fns-tz");
|
|
372
368
|
var import_tailwind_merge = require("tailwind-merge");
|
|
369
|
+
console.log(`%c[ReactiveView]: ${version}`, "background-color: red; color: yellow;");
|
|
373
370
|
var index_default = ReactiveView_default;
|
|
374
371
|
function safeRequest(request) {
|
|
375
372
|
return new Promise(async (resolve) => {
|
|
@@ -465,9 +462,8 @@ function access(view = {}, alternative) {
|
|
|
465
462
|
});
|
|
466
463
|
};
|
|
467
464
|
try {
|
|
468
|
-
const component = typeof view === "function" ? view() : view;
|
|
469
|
-
|
|
470
|
-
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);
|
|
471
467
|
} catch (e) {
|
|
472
468
|
return resolve(view);
|
|
473
469
|
}
|
|
@@ -551,7 +547,7 @@ var extendVnode = (component, element) => {
|
|
|
551
547
|
return (props = {}, slots) => {
|
|
552
548
|
var _a;
|
|
553
549
|
const _b = getProps((_a = vnode.props) != null ? _a : {}, []), { class: classes, style: styles } = _b, rest = __objRest(_b, ["class", "style"]);
|
|
554
|
-
const finalClasses = (0, import_tailwind_merge.twMerge)(MergeStyles(
|
|
550
|
+
const finalClasses = (0, import_tailwind_merge.twMerge)(MergeStyles(typeof props.class === "function" ? props.class(classes) : props.class).string);
|
|
555
551
|
const finalStyles = MergeStyles(styles, typeof props.style === "function" ? props.style(styles) : props.style);
|
|
556
552
|
const functionalProps = Object.entries(props).reduce((props2, [key2, value]) => {
|
|
557
553
|
var _a2;
|
|
@@ -568,11 +564,16 @@ var extendVnode = (component, element) => {
|
|
|
568
564
|
});
|
|
569
565
|
};
|
|
570
566
|
var getData = (component, path, alternative) => {
|
|
571
|
-
|
|
567
|
+
const data = import_object_manager2.default.on((0, import_vue2.unref)(component.$attrs.state));
|
|
568
|
+
if (path) {
|
|
569
|
+
return data.get(dataPath(component, path), alternative);
|
|
570
|
+
} else {
|
|
571
|
+
return data.get();
|
|
572
|
+
}
|
|
572
573
|
};
|
|
573
574
|
var setData = (component, data, path) => {
|
|
574
575
|
return component.$emit("update:state", {
|
|
575
|
-
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(),
|
|
576
577
|
after: path ? import_object_manager2.default.on({}).set(dataPath(component, path), data).get() : data
|
|
577
578
|
});
|
|
578
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,9 +319,10 @@ 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";
|
|
325
|
+
console.log(`%c[ReactiveView]: ${version}`, "background-color: red; color: yellow;");
|
|
329
326
|
var index_default = ReactiveView_default;
|
|
330
327
|
function safeRequest(request) {
|
|
331
328
|
return new Promise(async (resolve) => {
|
|
@@ -421,9 +418,8 @@ function access(view = {}, alternative) {
|
|
|
421
418
|
});
|
|
422
419
|
};
|
|
423
420
|
try {
|
|
424
|
-
const component = typeof view === "function" ? view() : view;
|
|
425
|
-
|
|
426
|
-
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);
|
|
427
423
|
} catch (e) {
|
|
428
424
|
return resolve(view);
|
|
429
425
|
}
|
|
@@ -507,7 +503,7 @@ var extendVnode = (component, element) => {
|
|
|
507
503
|
return (props = {}, slots) => {
|
|
508
504
|
var _a;
|
|
509
505
|
const _b = getProps((_a = vnode.props) != null ? _a : {}, []), { class: classes, style: styles } = _b, rest = __objRest(_b, ["class", "style"]);
|
|
510
|
-
const finalClasses = twMerge(MergeStyles(
|
|
506
|
+
const finalClasses = twMerge(MergeStyles(typeof props.class === "function" ? props.class(classes) : props.class).string);
|
|
511
507
|
const finalStyles = MergeStyles(styles, typeof props.style === "function" ? props.style(styles) : props.style);
|
|
512
508
|
const functionalProps = Object.entries(props).reduce((props2, [key2, value]) => {
|
|
513
509
|
var _a2;
|
|
@@ -524,11 +520,16 @@ var extendVnode = (component, element) => {
|
|
|
524
520
|
});
|
|
525
521
|
};
|
|
526
522
|
var getData = (component, path, alternative) => {
|
|
527
|
-
|
|
523
|
+
const data = ObjectManager2.on(unref2(component.$attrs.state));
|
|
524
|
+
if (path) {
|
|
525
|
+
return data.get(dataPath(component, path), alternative);
|
|
526
|
+
} else {
|
|
527
|
+
return data.get();
|
|
528
|
+
}
|
|
528
529
|
};
|
|
529
530
|
var setData = (component, data, path) => {
|
|
530
531
|
return component.$emit("update:state", {
|
|
531
|
-
before: ObjectManager2.on(unref2(component.state)).clone(),
|
|
532
|
+
before: ObjectManager2.on(unref2(component.$attrs.state)).clone(),
|
|
532
533
|
after: path ? ObjectManager2.on({}).set(dataPath(component, path), data).get() : data
|
|
533
534
|
});
|
|
534
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",
|