@razaman2/reactive-view 0.0.15 → 0.0.16
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 +12 -6
- package/dist/index.mjs +15 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -164,7 +164,7 @@ var import_vue = require("vue");
|
|
|
164
164
|
|
|
165
165
|
// package.json
|
|
166
166
|
var name = "@razaman2/reactive-view";
|
|
167
|
-
var version = "0.0.
|
|
167
|
+
var version = "0.0.16";
|
|
168
168
|
|
|
169
169
|
// src/ReactiveView.ts
|
|
170
170
|
var props = {
|
|
@@ -238,12 +238,18 @@ var ReactiveView_default = {
|
|
|
238
238
|
};
|
|
239
239
|
const getState = new Proxy(props2.model ? typeof props2.model === "function" ? props2.model(config) : props2.model : new import_data_manager.default(config), {
|
|
240
240
|
get(target, property, receiver) {
|
|
241
|
-
|
|
242
|
-
const beforeSetData = (_b2 = (_a2 = context.attrs["onUpdate:modelState"]) == null ? void 0 : _a2.beforeSetData) != null ? _b2 : access(component).beforeSetData;
|
|
243
|
-
if (["setData", "replaceData"].includes(property) && typeof beforeSetData === "function") {
|
|
241
|
+
if (["setData", "replaceData"].includes(property)) {
|
|
244
242
|
return (...params) => {
|
|
245
243
|
const type2 = Array.isArray(defaultData) ? [] : {};
|
|
246
|
-
|
|
244
|
+
(0, import_vue.nextTick)(() => {
|
|
245
|
+
var _a2, _b2;
|
|
246
|
+
const beforeSetData = (_b2 = (_a2 = context.attrs["onUpdate:modelState"]) == null ? void 0 : _a2.beforeSetData) != null ? _b2 : access(component).beforeSetData;
|
|
247
|
+
if (typeof beforeSetData === "function") {
|
|
248
|
+
beforeSetData(import_object_manager.default.on(type2).set(...params).get(), target);
|
|
249
|
+
} else {
|
|
250
|
+
target[property](...params);
|
|
251
|
+
}
|
|
252
|
+
});
|
|
247
253
|
};
|
|
248
254
|
} else {
|
|
249
255
|
return Reflect.get(target, property, receiver);
|
|
@@ -251,7 +257,7 @@ var ReactiveView_default = {
|
|
|
251
257
|
}
|
|
252
258
|
});
|
|
253
259
|
const options = {
|
|
254
|
-
parent: { self: component },
|
|
260
|
+
parent: { self: component.value },
|
|
255
261
|
self: { template, getState, isValid }
|
|
256
262
|
};
|
|
257
263
|
const _f = (_e = props2.setup(options)) != null ? _e : options, { parent = {}, self = {} } = _f, rest = __objRest(_f, ["parent", "self"]);
|
package/dist/index.mjs
CHANGED
|
@@ -29,7 +29,7 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
import { formatInTimeZone } from "date-fns-tz";
|
|
32
|
-
import { createVNode
|
|
32
|
+
import { createVNode } from "vue";
|
|
33
33
|
|
|
34
34
|
// src/Subscription.ts
|
|
35
35
|
var Subscription = class _Subscription {
|
|
@@ -126,7 +126,7 @@ import { h, ref, reactive, watch, nextTick, getCurrentInstance } from "vue";
|
|
|
126
126
|
|
|
127
127
|
// package.json
|
|
128
128
|
var name = "@razaman2/reactive-view";
|
|
129
|
-
var version = "0.0.
|
|
129
|
+
var version = "0.0.16";
|
|
130
130
|
|
|
131
131
|
// src/ReactiveView.ts
|
|
132
132
|
var props = {
|
|
@@ -200,12 +200,18 @@ var ReactiveView_default = {
|
|
|
200
200
|
};
|
|
201
201
|
const getState = new Proxy(props2.model ? typeof props2.model === "function" ? props2.model(config) : props2.model : new DataManager(config), {
|
|
202
202
|
get(target, property, receiver) {
|
|
203
|
-
|
|
204
|
-
const beforeSetData = (_b2 = (_a2 = context.attrs["onUpdate:modelState"]) == null ? void 0 : _a2.beforeSetData) != null ? _b2 : access(component).beforeSetData;
|
|
205
|
-
if (["setData", "replaceData"].includes(property) && typeof beforeSetData === "function") {
|
|
203
|
+
if (["setData", "replaceData"].includes(property)) {
|
|
206
204
|
return (...params) => {
|
|
207
205
|
const type2 = Array.isArray(defaultData) ? [] : {};
|
|
208
|
-
|
|
206
|
+
nextTick(() => {
|
|
207
|
+
var _a2, _b2;
|
|
208
|
+
const beforeSetData = (_b2 = (_a2 = context.attrs["onUpdate:modelState"]) == null ? void 0 : _a2.beforeSetData) != null ? _b2 : access(component).beforeSetData;
|
|
209
|
+
if (typeof beforeSetData === "function") {
|
|
210
|
+
beforeSetData(ObjectManager.on(type2).set(...params).get(), target);
|
|
211
|
+
} else {
|
|
212
|
+
target[property](...params);
|
|
213
|
+
}
|
|
214
|
+
});
|
|
209
215
|
};
|
|
210
216
|
} else {
|
|
211
217
|
return Reflect.get(target, property, receiver);
|
|
@@ -213,7 +219,7 @@ var ReactiveView_default = {
|
|
|
213
219
|
}
|
|
214
220
|
});
|
|
215
221
|
const options = {
|
|
216
|
-
parent: { self: component },
|
|
222
|
+
parent: { self: component.value },
|
|
217
223
|
self: { template, getState, isValid }
|
|
218
224
|
};
|
|
219
225
|
const _f = (_e = props2.setup(options)) != null ? _e : options, { parent = {}, self = {} } = _f, rest = __objRest(_f, ["parent", "self"]);
|
|
@@ -334,9 +340,9 @@ function getReactiveViewComponent(component, options = {}) {
|
|
|
334
340
|
};
|
|
335
341
|
const props2 = getProps(options, "setup");
|
|
336
342
|
const slots = typeof component === "function" ? component : () => {
|
|
337
|
-
return (component.type || component).setup ?
|
|
343
|
+
return (component.type || component).setup ? createVNode(component, component.setup ? {} : props2) : component;
|
|
338
344
|
};
|
|
339
|
-
return model(component) ?
|
|
345
|
+
return model(component) ? createVNode(component, props2) : createVNode(ReactiveView_default, props2, slots);
|
|
340
346
|
}
|
|
341
347
|
function getDate(param1, param2) {
|
|
342
348
|
var _a, _b;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@razaman2/reactive-view",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
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",
|