@razaman2/reactive-view 0.0.11 → 0.0.13
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 +6 -6
- package/dist/index.mjs +6 -6
- package/package.json +9 -10
package/dist/index.js
CHANGED
|
@@ -162,7 +162,7 @@ var import_vue = require("vue");
|
|
|
162
162
|
|
|
163
163
|
// package.json
|
|
164
164
|
var name = "@razaman2/reactive-view";
|
|
165
|
-
var version = "0.0.
|
|
165
|
+
var version = "0.0.13";
|
|
166
166
|
|
|
167
167
|
// src/ReactiveView.ts
|
|
168
168
|
var props = {
|
|
@@ -218,7 +218,6 @@ var ReactiveView_default = {
|
|
|
218
218
|
return (_c2 = (_b2 = (_a2 = context.slots).template) == null ? void 0 : _b2.call(_a2, { $vue: vue, vnode })) != null ? _c2 : vnode;
|
|
219
219
|
};
|
|
220
220
|
const isValid = (0, import_vue.ref)(false);
|
|
221
|
-
const isRendered = (0, import_vue.ref)(false);
|
|
222
221
|
const defaultData = props2.getDefaultData(
|
|
223
222
|
Array.isArray(props2.state) ? (_a = props2.defaultData) != null ? _a : [] : (_b = props2.defaultData) != null ? _b : {}
|
|
224
223
|
);
|
|
@@ -234,6 +233,7 @@ var ReactiveView_default = {
|
|
|
234
233
|
};
|
|
235
234
|
const getState = props2.model ? typeof props2.model === "function" ? props2.model(config) : props2.model : new import_data_manager.default(config);
|
|
236
235
|
const sync = (0, import_vue.ref)(false);
|
|
236
|
+
const rendered = (0, import_vue.ref)(false);
|
|
237
237
|
const options = {
|
|
238
238
|
parent: { self: (0, import_vue.getCurrentInstance)().proxy },
|
|
239
239
|
self: { template, isValid, getState }
|
|
@@ -247,10 +247,10 @@ var ReactiveView_default = {
|
|
|
247
247
|
if (props2.defer instanceof Promise) {
|
|
248
248
|
(0, import_vue.nextTick)(async () => {
|
|
249
249
|
var _a2;
|
|
250
|
-
|
|
250
|
+
rendered.value = (_a2 = await props2.defer) != null ? _a2 : true;
|
|
251
251
|
});
|
|
252
252
|
} else {
|
|
253
|
-
|
|
253
|
+
rendered.value = true;
|
|
254
254
|
}
|
|
255
255
|
if (context.attrs["onUpdate:modelState"]) {
|
|
256
256
|
const config2 = typeof context.attrs["onUpdate:modelState"] === "function" ? { callback: context.attrs["onUpdate:modelState"] } : context.attrs["onUpdate:modelState"];
|
|
@@ -270,7 +270,7 @@ var ReactiveView_default = {
|
|
|
270
270
|
if (context.attrs["onUpdate:propsState"] || props2.sync) {
|
|
271
271
|
const config2 = (_f = typeof context.attrs["onUpdate:propsState"] === "function" ? { callback: context.attrs["onUpdate:propsState"] } : context.attrs["onUpdate:propsState"]) != null ? _f : {};
|
|
272
272
|
(0, import_vue.onMounted)(() => {
|
|
273
|
-
(0, import_vue.watch)(() => props2.state, (after, before) => {
|
|
273
|
+
(0, import_vue.watch)(() => import_object_manager.default.on(props2.state).clone(), (after, before) => {
|
|
274
274
|
if (props2.sync && typeof config2.callback !== "function") {
|
|
275
275
|
getState.replaceData(after);
|
|
276
276
|
} else if (typeof config2.callback === "function") {
|
|
@@ -292,7 +292,7 @@ var ReactiveView_default = {
|
|
|
292
292
|
setup2.options = setup2.options.parent;
|
|
293
293
|
setup2.$vue = setup2.$vue.$parent;
|
|
294
294
|
}
|
|
295
|
-
if (
|
|
295
|
+
if (rendered.value) {
|
|
296
296
|
return access($vue).template($vue, { parent, self });
|
|
297
297
|
}
|
|
298
298
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -125,7 +125,7 @@ import { h, ref, reactive, watch, nextTick, getCurrentInstance, onMounted } from
|
|
|
125
125
|
|
|
126
126
|
// package.json
|
|
127
127
|
var name = "@razaman2/reactive-view";
|
|
128
|
-
var version = "0.0.
|
|
128
|
+
var version = "0.0.13";
|
|
129
129
|
|
|
130
130
|
// src/ReactiveView.ts
|
|
131
131
|
var props = {
|
|
@@ -181,7 +181,6 @@ var ReactiveView_default = {
|
|
|
181
181
|
return (_c2 = (_b2 = (_a2 = context.slots).template) == null ? void 0 : _b2.call(_a2, { $vue: vue, vnode })) != null ? _c2 : vnode;
|
|
182
182
|
};
|
|
183
183
|
const isValid = ref(false);
|
|
184
|
-
const isRendered = ref(false);
|
|
185
184
|
const defaultData = props2.getDefaultData(
|
|
186
185
|
Array.isArray(props2.state) ? (_a = props2.defaultData) != null ? _a : [] : (_b = props2.defaultData) != null ? _b : {}
|
|
187
186
|
);
|
|
@@ -197,6 +196,7 @@ var ReactiveView_default = {
|
|
|
197
196
|
};
|
|
198
197
|
const getState = props2.model ? typeof props2.model === "function" ? props2.model(config) : props2.model : new DataManager(config);
|
|
199
198
|
const sync = ref(false);
|
|
199
|
+
const rendered = ref(false);
|
|
200
200
|
const options = {
|
|
201
201
|
parent: { self: getCurrentInstance().proxy },
|
|
202
202
|
self: { template, isValid, getState }
|
|
@@ -210,10 +210,10 @@ var ReactiveView_default = {
|
|
|
210
210
|
if (props2.defer instanceof Promise) {
|
|
211
211
|
nextTick(async () => {
|
|
212
212
|
var _a2;
|
|
213
|
-
|
|
213
|
+
rendered.value = (_a2 = await props2.defer) != null ? _a2 : true;
|
|
214
214
|
});
|
|
215
215
|
} else {
|
|
216
|
-
|
|
216
|
+
rendered.value = true;
|
|
217
217
|
}
|
|
218
218
|
if (context.attrs["onUpdate:modelState"]) {
|
|
219
219
|
const config2 = typeof context.attrs["onUpdate:modelState"] === "function" ? { callback: context.attrs["onUpdate:modelState"] } : context.attrs["onUpdate:modelState"];
|
|
@@ -233,7 +233,7 @@ var ReactiveView_default = {
|
|
|
233
233
|
if (context.attrs["onUpdate:propsState"] || props2.sync) {
|
|
234
234
|
const config2 = (_f = typeof context.attrs["onUpdate:propsState"] === "function" ? { callback: context.attrs["onUpdate:propsState"] } : context.attrs["onUpdate:propsState"]) != null ? _f : {};
|
|
235
235
|
onMounted(() => {
|
|
236
|
-
watch(() => props2.state, (after, before) => {
|
|
236
|
+
watch(() => ObjectManager.on(props2.state).clone(), (after, before) => {
|
|
237
237
|
if (props2.sync && typeof config2.callback !== "function") {
|
|
238
238
|
getState.replaceData(after);
|
|
239
239
|
} else if (typeof config2.callback === "function") {
|
|
@@ -255,7 +255,7 @@ var ReactiveView_default = {
|
|
|
255
255
|
setup2.options = setup2.options.parent;
|
|
256
256
|
setup2.$vue = setup2.$vue.$parent;
|
|
257
257
|
}
|
|
258
|
-
if (
|
|
258
|
+
if (rendered.value) {
|
|
259
259
|
return access($vue).template($vue, { parent, self });
|
|
260
260
|
}
|
|
261
261
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@razaman2/reactive-view",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
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",
|
|
@@ -20,19 +20,18 @@
|
|
|
20
20
|
"author": "razaman2",
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@razaman2/
|
|
24
|
-
"@razaman2/data-manager": "^3.2.9",
|
|
23
|
+
"@razaman2/data-manager": "^3.2.11",
|
|
25
24
|
"@razaman2/object-manager": "^3.3.9",
|
|
26
|
-
"date-fns": "^
|
|
27
|
-
"date-fns-tz": "^3.
|
|
28
|
-
"uuid": "^
|
|
29
|
-
"vue": "^3.5.
|
|
25
|
+
"date-fns": "^4.1.0",
|
|
26
|
+
"date-fns-tz": "^3.2.0",
|
|
27
|
+
"uuid": "^11.0.2",
|
|
28
|
+
"vue": "^3.5.12"
|
|
30
29
|
},
|
|
31
30
|
"devDependencies": {
|
|
32
31
|
"@types/uuid": "^10.0.0",
|
|
33
|
-
"tsup": "^8.
|
|
34
|
-
"typescript": "^5.
|
|
35
|
-
"vitest": "^2.
|
|
32
|
+
"tsup": "^8.3.5",
|
|
33
|
+
"typescript": "^5.6.3",
|
|
34
|
+
"vitest": "^2.1.4"
|
|
36
35
|
},
|
|
37
36
|
"publishConfig": {
|
|
38
37
|
"access": "public"
|