@razaman2/reactive-view 0.1.0-beta.5 → 0.1.0-beta.7
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 +117 -70
- package/dist/index.mjs +116 -69
- package/package.json +48 -48
package/dist/index.js
CHANGED
|
@@ -35,8 +35,8 @@ var __objRest = (source, exclude) => {
|
|
|
35
35
|
return target;
|
|
36
36
|
};
|
|
37
37
|
var __export = (target, all) => {
|
|
38
|
-
for (var
|
|
39
|
-
__defProp(target,
|
|
38
|
+
for (var name in all)
|
|
39
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
40
40
|
};
|
|
41
41
|
var __copyProps = (to, from, except, desc) => {
|
|
42
42
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
@@ -89,34 +89,34 @@ var Subscription = class _Subscription {
|
|
|
89
89
|
static create() {
|
|
90
90
|
return new _Subscription();
|
|
91
91
|
}
|
|
92
|
-
subscribe(
|
|
93
|
-
if (this.isNameAvailable(
|
|
92
|
+
subscribe(name, handler, data) {
|
|
93
|
+
if (this.isNameAvailable(name)) {
|
|
94
94
|
this.subscriptions.push({
|
|
95
|
-
name
|
|
95
|
+
name,
|
|
96
96
|
handler
|
|
97
97
|
});
|
|
98
|
-
this.data[
|
|
98
|
+
this.data[name] = data;
|
|
99
99
|
}
|
|
100
100
|
return this;
|
|
101
101
|
}
|
|
102
|
-
replace(
|
|
103
|
-
this.unsubscribe(
|
|
104
|
-
return this.subscribe(
|
|
102
|
+
replace(name, handler, data) {
|
|
103
|
+
this.unsubscribe(name);
|
|
104
|
+
return this.subscribe(name, handler, data);
|
|
105
105
|
}
|
|
106
106
|
unsubscribe(param1) {
|
|
107
107
|
if (!Array.isArray(param1)) {
|
|
108
108
|
param1 = param1 ? [param1] : [];
|
|
109
109
|
}
|
|
110
|
-
const log = (
|
|
111
|
-
return console.log(`%cUnsubscribed From Subscription (${
|
|
110
|
+
const log = (name) => {
|
|
111
|
+
return console.log(`%cUnsubscribed From Subscription (${name})`, "background-color: yellow; color: green; font-weight: bold; padding: 3px;");
|
|
112
112
|
};
|
|
113
113
|
if (param1.length) {
|
|
114
|
-
param1.forEach((
|
|
115
|
-
const subscription = this.find(
|
|
114
|
+
param1.forEach((name) => {
|
|
115
|
+
const subscription = this.find(name);
|
|
116
116
|
if (subscription) {
|
|
117
117
|
subscription.handler();
|
|
118
118
|
this.remove(subscription);
|
|
119
|
-
log(
|
|
119
|
+
log(name);
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
} else {
|
|
@@ -131,20 +131,20 @@ var Subscription = class _Subscription {
|
|
|
131
131
|
size() {
|
|
132
132
|
return this.subscriptions.length;
|
|
133
133
|
}
|
|
134
|
-
hasSubscription(
|
|
135
|
-
return Boolean(this.find(
|
|
134
|
+
hasSubscription(name) {
|
|
135
|
+
return Boolean(this.find(name));
|
|
136
136
|
}
|
|
137
137
|
remove(subscription) {
|
|
138
138
|
this.subscriptions.splice(this.subscriptions.indexOf(subscription), 1);
|
|
139
139
|
}
|
|
140
|
-
find(
|
|
140
|
+
find(name) {
|
|
141
141
|
return this.subscriptions.find((subscription) => {
|
|
142
|
-
return subscription.name ===
|
|
142
|
+
return subscription.name === name;
|
|
143
143
|
});
|
|
144
144
|
}
|
|
145
|
-
isNameAvailable(
|
|
146
|
-
if (this.hasSubscription(
|
|
147
|
-
throw new Error(`There is already a subscription called "${
|
|
145
|
+
isNameAvailable(name) {
|
|
146
|
+
if (this.hasSubscription(name)) {
|
|
147
|
+
throw new Error(`There is already a subscription called "${name}".`);
|
|
148
148
|
} else {
|
|
149
149
|
return true;
|
|
150
150
|
}
|
|
@@ -152,12 +152,12 @@ var Subscription = class _Subscription {
|
|
|
152
152
|
registrations() {
|
|
153
153
|
return this.subscriptions;
|
|
154
154
|
}
|
|
155
|
-
get(
|
|
156
|
-
const subscription = this.find(
|
|
155
|
+
get(name) {
|
|
156
|
+
const subscription = this.find(name);
|
|
157
157
|
if (subscription) {
|
|
158
158
|
return subscription;
|
|
159
159
|
} else {
|
|
160
|
-
throw new Error(`Subscription "${
|
|
160
|
+
throw new Error(`Subscription "${name}" doesn't exist!`);
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
};
|
|
@@ -177,8 +177,55 @@ var import_data_manager = __toESM(require("@razaman2/data-manager"));
|
|
|
177
177
|
var import_vue = require("vue");
|
|
178
178
|
|
|
179
179
|
// package.json
|
|
180
|
-
var
|
|
181
|
-
var
|
|
180
|
+
var version = "0.1.0-beta.7";
|
|
181
|
+
var package_default = {
|
|
182
|
+
name: "@razaman2/reactive-view",
|
|
183
|
+
version,
|
|
184
|
+
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.",
|
|
185
|
+
main: "dist/index.js",
|
|
186
|
+
module: "dist/index.mjs",
|
|
187
|
+
types: "dist/index.d.ts",
|
|
188
|
+
scripts: {
|
|
189
|
+
prepublishOnly: "npm run build",
|
|
190
|
+
build: "tsup src/index.ts --format cjs,esm --dts",
|
|
191
|
+
lint: "tsc",
|
|
192
|
+
test: "cd tests/vue-ts && npm run dev",
|
|
193
|
+
pr: "sh pr.sh"
|
|
194
|
+
},
|
|
195
|
+
keywords: [
|
|
196
|
+
"vue",
|
|
197
|
+
"vue-helper",
|
|
198
|
+
"reactive-view",
|
|
199
|
+
"vue-class-component",
|
|
200
|
+
"reactive-ui"
|
|
201
|
+
],
|
|
202
|
+
author: "razaman2",
|
|
203
|
+
license: "MIT",
|
|
204
|
+
dependencies: {
|
|
205
|
+
"@razaman2/data-manager": "^3.3.8",
|
|
206
|
+
"@razaman2/event-emitter": "^2.1.1",
|
|
207
|
+
"@razaman2/object-manager": "^3.4.7",
|
|
208
|
+
"date-fns": "^4.1.0",
|
|
209
|
+
"date-fns-tz": "^3.2.0",
|
|
210
|
+
"tailwind-merge": "^3.5.0",
|
|
211
|
+
uuid: "^13.0.0"
|
|
212
|
+
},
|
|
213
|
+
peerDependencies: {
|
|
214
|
+
vue: ">=3.0.0"
|
|
215
|
+
},
|
|
216
|
+
devDependencies: {
|
|
217
|
+
"@types/uuid": "^11.0.0",
|
|
218
|
+
tsup: "^8.5.1",
|
|
219
|
+
typescript: "^5.9.3",
|
|
220
|
+
vitest: "^4.1.2"
|
|
221
|
+
},
|
|
222
|
+
publishConfig: {
|
|
223
|
+
access: "public"
|
|
224
|
+
},
|
|
225
|
+
files: [
|
|
226
|
+
"dist"
|
|
227
|
+
]
|
|
228
|
+
};
|
|
182
229
|
|
|
183
230
|
// src/ReactiveView.ts
|
|
184
231
|
var setup = {
|
|
@@ -223,6 +270,8 @@ var ReactiveView_default = {
|
|
|
223
270
|
},
|
|
224
271
|
setup(props, context) {
|
|
225
272
|
var _a, _b, _c;
|
|
273
|
+
const subscriptions = [];
|
|
274
|
+
(0, import_vue.onBeforeUnmount)(() => subscriptions.forEach((subscription) => subscription()));
|
|
226
275
|
const diff = (before, after) => {
|
|
227
276
|
const changed = (0, import_vue.ref)(false);
|
|
228
277
|
const paths = Array.from(new Set(before.paths().concat(after.paths())));
|
|
@@ -245,14 +294,14 @@ var ReactiveView_default = {
|
|
|
245
294
|
const template = (component, vue2) => {
|
|
246
295
|
return (0, import_vue.createVNode)("div", context.slots.default ? context.attrs : __spreadValues({
|
|
247
296
|
style: { color: "red", textAlign: "center" }
|
|
248
|
-
}, context.attrs), context.slots.default ? context.slots.default({ component, vue: vue2, props, context }) : `${props.modelName}: ${name}@${version}`);
|
|
297
|
+
}, context.attrs), context.slots.default ? context.slots.default({ component, vue: vue2, props, context }) : `${props.modelName}: ${package_default.name}@${package_default.version}`);
|
|
249
298
|
};
|
|
250
299
|
const isValid = (0, import_vue.ref)(false);
|
|
251
300
|
const isReady = (0, import_vue.ref)(false);
|
|
252
301
|
const defer = (0, import_vue.ref)(typeof props.defer === "function" ? props.defer() : props.defer);
|
|
253
302
|
const isFunctionData = ["Function"].includes((_a = props.data) == null ? void 0 : _a.constructor.name);
|
|
254
303
|
const isAsyncFunctionData = ["AsyncFunction"].includes((_b = props.data) == null ? void 0 : _b.constructor.name);
|
|
255
|
-
const
|
|
304
|
+
const isAsyncData = ["Promise"].includes((_c = props.data) == null ? void 0 : _c.constructor.name) || isAsyncFunctionData;
|
|
256
305
|
const vue = (0, import_vue.getCurrentInstance)();
|
|
257
306
|
const defaultData = props.getDefaultData(
|
|
258
307
|
"defaultData" in vue.vnode.props ? vue.vnode.props.defaultData : "data" in vue.vnode.props ? Array.isArray((0, import_vue.unref)(vue.vnode.props.data)) ? [] : {} : {}
|
|
@@ -300,19 +349,20 @@ var ReactiveView_default = {
|
|
|
300
349
|
});
|
|
301
350
|
};
|
|
302
351
|
const normalize = (data) => {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
352
|
+
if ((0, import_vue.isRef)(data) || (0, import_vue.isReactive)(data)) {
|
|
353
|
+
return data;
|
|
354
|
+
} else if (isFunctionData || isAsyncData) {
|
|
355
|
+
return (0, import_vue.ref)(datatype);
|
|
306
356
|
} else {
|
|
307
357
|
const props2 = "data" in vue.vnode.props;
|
|
308
358
|
try {
|
|
309
359
|
if (["Array", "Object"].includes(data.constructor.name)) {
|
|
310
|
-
return (0, import_vue.
|
|
360
|
+
return (0, import_vue.ref)(data);
|
|
311
361
|
} else {
|
|
312
|
-
return (0, import_vue.
|
|
362
|
+
return (0, import_vue.ref)(props2 ? { "": data } : datatype);
|
|
313
363
|
}
|
|
314
364
|
} catch (e) {
|
|
315
|
-
return (0, import_vue.
|
|
365
|
+
return (0, import_vue.ref)(props2 ? { "": data } : datatype);
|
|
316
366
|
}
|
|
317
367
|
}
|
|
318
368
|
};
|
|
@@ -324,7 +374,7 @@ var ReactiveView_default = {
|
|
|
324
374
|
name: props.modelName,
|
|
325
375
|
logging: props.logging
|
|
326
376
|
};
|
|
327
|
-
const model = props.model ? typeof props.model === "function" ? props.model(config) : props.model :
|
|
377
|
+
const model = props.model ? typeof props.model === "function" ? props.model(config) : props.model : import_data_manager.default.setConfig({ beforeGetData: (data) => (0, import_vue.isRef)(data) ? (0, import_vue.unref)(data) : data }, config);
|
|
328
378
|
const component = (0, import_vue.ref)({ parent: { self: vue.proxy }, self: { template, diff, emit, dataPath: dataPath2, model: proxy(model), isValid } });
|
|
329
379
|
if (context.attrs["onUpdate:model"] || context.attrs["update:model"]) {
|
|
330
380
|
const config2 = {
|
|
@@ -336,7 +386,7 @@ var ReactiveView_default = {
|
|
|
336
386
|
}
|
|
337
387
|
};
|
|
338
388
|
const source = () => import_object_manager.default.on(model.getData()).clone();
|
|
339
|
-
(0, import_vue.watch)(source, (after, before) => {
|
|
389
|
+
subscriptions.push((0, import_vue.watch)(source, (after, before) => {
|
|
340
390
|
const diff2 = access(component).diff(import_object_manager.default.on(before), import_object_manager.default.on(after));
|
|
341
391
|
if (props.debug) {
|
|
342
392
|
console.warn(`[${props.modelName}]:model`, { diff: diff2, before, after });
|
|
@@ -344,30 +394,27 @@ var ReactiveView_default = {
|
|
|
344
394
|
if (diff2.changed) {
|
|
345
395
|
config2.callback(diff2, { component });
|
|
346
396
|
}
|
|
347
|
-
}, config2.options);
|
|
397
|
+
}, config2.options));
|
|
348
398
|
}
|
|
349
399
|
setTimeout(async () => {
|
|
350
400
|
var _a3, _b2, _c2;
|
|
351
|
-
if (props.model !== false) {
|
|
352
|
-
if (
|
|
353
|
-
console.warn(`${props.modelName}: defaultData is required for promise or
|
|
401
|
+
if (props.model !== false && (isFunctionData || isAsyncData)) {
|
|
402
|
+
if (!("defaultData" in vue.vnode.props)) {
|
|
403
|
+
console.warn(`${props.modelName}: defaultData is required for promise or function data.`, props.data);
|
|
354
404
|
}
|
|
355
|
-
const [data] =
|
|
405
|
+
const [data] = isAsyncData ? await Promise.all([
|
|
356
406
|
isAsyncFunctionData ? props.data() : props.data,
|
|
357
407
|
(_a3 = defer.value) != null ? _a3 : true
|
|
358
408
|
]) : [props.data];
|
|
359
|
-
const
|
|
360
|
-
|
|
361
|
-
const source = isRefData || isReactiveData || isFunctionData ? data : typeof data === "function" ? data : (() => data);
|
|
362
|
-
(0, import_vue.watch)(source, async (after, before) => {
|
|
363
|
-
var _a4;
|
|
409
|
+
const source = typeof data === "function" ? data : (() => data);
|
|
410
|
+
subscriptions.push((0, import_vue.watch)(source, async (after, before) => {
|
|
364
411
|
const diff2 = access(component).diff(import_object_manager.default.on(before), import_object_manager.default.on(after));
|
|
365
412
|
const callback = context.attrs["data:callback"];
|
|
366
413
|
if (props.debug) {
|
|
367
|
-
console.warn(`[${props.modelName}]:data`, { diff: diff2, data, callback, before, after, props, context, component
|
|
414
|
+
console.warn(`[${props.modelName}]:data`, { diff: diff2, data, callback, before, after, props, context, component });
|
|
368
415
|
}
|
|
369
416
|
if (typeof callback === "function") {
|
|
370
|
-
|
|
417
|
+
callback(diff2, { component });
|
|
371
418
|
} else {
|
|
372
419
|
model.replaceData(after);
|
|
373
420
|
}
|
|
@@ -375,7 +422,7 @@ var ReactiveView_default = {
|
|
|
375
422
|
immediate: (_b2 = context.attrs["data:immediate"]) != null ? _b2 : true,
|
|
376
423
|
deep: (_c2 = context.attrs["data:deep"]) != null ? _c2 : true,
|
|
377
424
|
once: context.attrs["data:once"]
|
|
378
|
-
});
|
|
425
|
+
}));
|
|
379
426
|
}
|
|
380
427
|
});
|
|
381
428
|
setTimeout(async () => {
|
|
@@ -430,7 +477,7 @@ var ReactiveView_default = {
|
|
|
430
477
|
if ((0, import_vue.isReactive)(data)) {
|
|
431
478
|
return data;
|
|
432
479
|
} else {
|
|
433
|
-
if ((0, import_vue.isRef)(data) || isFunctionData ||
|
|
480
|
+
if ((0, import_vue.isRef)(data) || isFunctionData || isAsyncData) {
|
|
434
481
|
return (0, import_vue.reactive)(datatype);
|
|
435
482
|
} else {
|
|
436
483
|
const props2 = "data" in vue.vnode.props;
|
|
@@ -448,7 +495,7 @@ var ReactiveView_default = {
|
|
|
448
495
|
};
|
|
449
496
|
const config = {
|
|
450
497
|
data: props.beta ? normalize((_a2 = vue.vnode.props) == null ? void 0 : _a2.data) : (0, import_vue.reactive)(import_object_manager.default.on(
|
|
451
|
-
|
|
498
|
+
isAsyncData || isFunctionData || (0, import_vue.isRef)(props.data) || (0, import_vue.isReactive)(props.data) ? datatype : "data" in vue.vnode.props ? props.data : datatype
|
|
452
499
|
).clone()),
|
|
453
500
|
defaultData: import_object_manager.default.on(defaultData).clone(),
|
|
454
501
|
notifications: props.notifications,
|
|
@@ -480,7 +527,7 @@ var ReactiveView_default = {
|
|
|
480
527
|
});
|
|
481
528
|
const component = (0, import_vue.ref)({ parent: { self: vue.proxy }, self: { template, model, diff, emit, dataPath: dataPath2, isValid } });
|
|
482
529
|
if (props.debug) {
|
|
483
|
-
console.warn("[ReactiveView]:", { props, context, vue, defer, config, model, component, datatype, defaultData, isValid, isReady, isFunctionData, isAsyncFunctionData,
|
|
530
|
+
console.warn("[ReactiveView]:", { props, context, vue, defer, config, model, component, datatype, defaultData, isValid, isReady, isFunctionData, isAsyncFunctionData, isAsyncData });
|
|
484
531
|
}
|
|
485
532
|
const watchDataProp = (dataProp) => {
|
|
486
533
|
var _a3, _b3, _c3, _d2;
|
|
@@ -493,14 +540,14 @@ var ReactiveView_default = {
|
|
|
493
540
|
if (context.attrs["data:log"]) {
|
|
494
541
|
console.warn(`[ReactiveView]:data`, { config: config2, dataProp });
|
|
495
542
|
}
|
|
496
|
-
(0, import_vue.watch)(isFunctionData || (0, import_vue.isRef)(dataProp) || (0, import_vue.isReactive)(dataProp) ? dataProp : () => dataProp, (after, before) => {
|
|
543
|
+
subscriptions.push((0, import_vue.watch)(isFunctionData || (0, import_vue.isRef)(dataProp) || (0, import_vue.isReactive)(dataProp) ? dataProp : () => dataProp, (after, before) => {
|
|
497
544
|
var _a4;
|
|
498
545
|
if (typeof config2.callback === "function") {
|
|
499
546
|
model.replaceData((_a4 = config2.callback(access(component).diff(import_object_manager.default.on(before), import_object_manager.default.on(after)), { component })) != null ? _a4 : after);
|
|
500
547
|
} else {
|
|
501
548
|
model.replaceData(after);
|
|
502
549
|
}
|
|
503
|
-
}, config2.options);
|
|
550
|
+
}, config2.options));
|
|
504
551
|
};
|
|
505
552
|
if (context.attrs["onUpdate:model"] || context.attrs["update:model"]) {
|
|
506
553
|
const config2 = typeof context.attrs["onUpdate:model"] === "function" ? {
|
|
@@ -512,20 +559,20 @@ var ReactiveView_default = {
|
|
|
512
559
|
if (context.attrs["model:log"]) {
|
|
513
560
|
console.warn(`[ReactiveView]:model`, { config: config2 });
|
|
514
561
|
}
|
|
515
|
-
(0, import_vue.watch)(() => import_object_manager.default.on(model.getData()).clone(), (after, before) => {
|
|
562
|
+
subscriptions.push((0, import_vue.watch)(() => import_object_manager.default.on(model.getData()).clone(), (after, before) => {
|
|
516
563
|
config2.callback(access(component).diff(import_object_manager.default.on(before), import_object_manager.default.on(after)), { component });
|
|
517
|
-
}, config2.options);
|
|
564
|
+
}, config2.options));
|
|
518
565
|
}
|
|
519
566
|
if (props.beta) {
|
|
520
567
|
const isRefData = (0, import_vue.isRef)(props.data);
|
|
521
|
-
if (isRefData || isFunctionData ||
|
|
568
|
+
if (isRefData || isFunctionData || isAsyncData) {
|
|
522
569
|
setTimeout(async () => {
|
|
523
570
|
var _a3, _b3, _c3;
|
|
524
|
-
const [data] =
|
|
571
|
+
const [data] = isAsyncData ? await Promise.all([
|
|
525
572
|
isAsyncFunctionData ? props.data() : props.data,
|
|
526
573
|
(_a3 = defer.value) != null ? _a3 : true
|
|
527
574
|
]) : [props.data];
|
|
528
|
-
(0, import_vue.watch)(isRefData ? data : isFunctionData ? data : typeof data === "function" ? data : () => data, (after, before) => {
|
|
575
|
+
subscriptions.push((0, import_vue.watch)(isRefData ? data : isFunctionData ? data : typeof data === "function" ? data : () => data, (after, before) => {
|
|
529
576
|
var _a4;
|
|
530
577
|
if (before !== void 0 || after !== void 0) {
|
|
531
578
|
const callback = context.attrs["data:callback"];
|
|
@@ -540,7 +587,7 @@ var ReactiveView_default = {
|
|
|
540
587
|
immediate: (_b3 = context.attrs["data:immediate"]) != null ? _b3 : true,
|
|
541
588
|
deep: (_c3 = context.attrs["data:deep"]) != null ? _c3 : true,
|
|
542
589
|
once: context.attrs["data:once"]
|
|
543
|
-
});
|
|
590
|
+
}));
|
|
544
591
|
});
|
|
545
592
|
}
|
|
546
593
|
} else {
|
|
@@ -698,24 +745,24 @@ function useSubscription() {
|
|
|
698
745
|
const subscriptions = [];
|
|
699
746
|
const subscription = Subscriptions.get();
|
|
700
747
|
return {
|
|
701
|
-
addSubscription(
|
|
702
|
-
subscription.subscribe(
|
|
703
|
-
subscriptions.push(() => subscription.unsubscribe(
|
|
748
|
+
addSubscription(name, handler = () => false, data) {
|
|
749
|
+
subscription.subscribe(name, handler, data);
|
|
750
|
+
subscriptions.push(() => subscription.unsubscribe(name));
|
|
704
751
|
},
|
|
705
|
-
replaceSubscription(
|
|
706
|
-
subscription.replace(
|
|
707
|
-
subscriptions.push(() => subscription.unsubscribe(
|
|
752
|
+
replaceSubscription(name, handler = () => false, data) {
|
|
753
|
+
subscription.replace(name, handler, data);
|
|
754
|
+
subscriptions.push(() => subscription.unsubscribe(name));
|
|
708
755
|
},
|
|
709
756
|
removeSubscriptions() {
|
|
710
757
|
subscriptions.forEach((subscription2) => safeRequest({
|
|
711
758
|
try: () => subscription2()
|
|
712
759
|
}));
|
|
713
760
|
},
|
|
714
|
-
removeSubscription(
|
|
715
|
-
subscription.unsubscribe(
|
|
761
|
+
removeSubscription(name) {
|
|
762
|
+
subscription.unsubscribe(name);
|
|
716
763
|
},
|
|
717
|
-
hasSubscription(
|
|
718
|
-
return subscription.hasSubscription(
|
|
764
|
+
hasSubscription(name) {
|
|
765
|
+
return subscription.hasSubscription(name);
|
|
719
766
|
},
|
|
720
767
|
subscriptions,
|
|
721
768
|
subscription
|
package/dist/index.mjs
CHANGED
|
@@ -42,34 +42,34 @@ var Subscription = class _Subscription {
|
|
|
42
42
|
static create() {
|
|
43
43
|
return new _Subscription();
|
|
44
44
|
}
|
|
45
|
-
subscribe(
|
|
46
|
-
if (this.isNameAvailable(
|
|
45
|
+
subscribe(name, handler, data) {
|
|
46
|
+
if (this.isNameAvailable(name)) {
|
|
47
47
|
this.subscriptions.push({
|
|
48
|
-
name
|
|
48
|
+
name,
|
|
49
49
|
handler
|
|
50
50
|
});
|
|
51
|
-
this.data[
|
|
51
|
+
this.data[name] = data;
|
|
52
52
|
}
|
|
53
53
|
return this;
|
|
54
54
|
}
|
|
55
|
-
replace(
|
|
56
|
-
this.unsubscribe(
|
|
57
|
-
return this.subscribe(
|
|
55
|
+
replace(name, handler, data) {
|
|
56
|
+
this.unsubscribe(name);
|
|
57
|
+
return this.subscribe(name, handler, data);
|
|
58
58
|
}
|
|
59
59
|
unsubscribe(param1) {
|
|
60
60
|
if (!Array.isArray(param1)) {
|
|
61
61
|
param1 = param1 ? [param1] : [];
|
|
62
62
|
}
|
|
63
|
-
const log = (
|
|
64
|
-
return console.log(`%cUnsubscribed From Subscription (${
|
|
63
|
+
const log = (name) => {
|
|
64
|
+
return console.log(`%cUnsubscribed From Subscription (${name})`, "background-color: yellow; color: green; font-weight: bold; padding: 3px;");
|
|
65
65
|
};
|
|
66
66
|
if (param1.length) {
|
|
67
|
-
param1.forEach((
|
|
68
|
-
const subscription = this.find(
|
|
67
|
+
param1.forEach((name) => {
|
|
68
|
+
const subscription = this.find(name);
|
|
69
69
|
if (subscription) {
|
|
70
70
|
subscription.handler();
|
|
71
71
|
this.remove(subscription);
|
|
72
|
-
log(
|
|
72
|
+
log(name);
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
75
|
} else {
|
|
@@ -84,20 +84,20 @@ var Subscription = class _Subscription {
|
|
|
84
84
|
size() {
|
|
85
85
|
return this.subscriptions.length;
|
|
86
86
|
}
|
|
87
|
-
hasSubscription(
|
|
88
|
-
return Boolean(this.find(
|
|
87
|
+
hasSubscription(name) {
|
|
88
|
+
return Boolean(this.find(name));
|
|
89
89
|
}
|
|
90
90
|
remove(subscription) {
|
|
91
91
|
this.subscriptions.splice(this.subscriptions.indexOf(subscription), 1);
|
|
92
92
|
}
|
|
93
|
-
find(
|
|
93
|
+
find(name) {
|
|
94
94
|
return this.subscriptions.find((subscription) => {
|
|
95
|
-
return subscription.name ===
|
|
95
|
+
return subscription.name === name;
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
-
isNameAvailable(
|
|
99
|
-
if (this.hasSubscription(
|
|
100
|
-
throw new Error(`There is already a subscription called "${
|
|
98
|
+
isNameAvailable(name) {
|
|
99
|
+
if (this.hasSubscription(name)) {
|
|
100
|
+
throw new Error(`There is already a subscription called "${name}".`);
|
|
101
101
|
} else {
|
|
102
102
|
return true;
|
|
103
103
|
}
|
|
@@ -105,12 +105,12 @@ var Subscription = class _Subscription {
|
|
|
105
105
|
registrations() {
|
|
106
106
|
return this.subscriptions;
|
|
107
107
|
}
|
|
108
|
-
get(
|
|
109
|
-
const subscription = this.find(
|
|
108
|
+
get(name) {
|
|
109
|
+
const subscription = this.find(name);
|
|
110
110
|
if (subscription) {
|
|
111
111
|
return subscription;
|
|
112
112
|
} else {
|
|
113
|
-
throw new Error(`Subscription "${
|
|
113
|
+
throw new Error(`Subscription "${name}" doesn't exist!`);
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
};
|
|
@@ -127,11 +127,58 @@ var Subscriptions = _Subscriptions;
|
|
|
127
127
|
// src/ReactiveView.ts
|
|
128
128
|
import ObjectManager from "@razaman2/object-manager";
|
|
129
129
|
import DataManager from "@razaman2/data-manager";
|
|
130
|
-
import { ref, reactive, watch, isRef, isReactive, createVNode, getCurrentInstance,
|
|
130
|
+
import { ref, reactive, watch, unref, isRef, isReactive, createVNode, getCurrentInstance, onBeforeUnmount } from "vue";
|
|
131
131
|
|
|
132
132
|
// package.json
|
|
133
|
-
var
|
|
134
|
-
var
|
|
133
|
+
var version = "0.1.0-beta.7";
|
|
134
|
+
var package_default = {
|
|
135
|
+
name: "@razaman2/reactive-view",
|
|
136
|
+
version,
|
|
137
|
+
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.",
|
|
138
|
+
main: "dist/index.js",
|
|
139
|
+
module: "dist/index.mjs",
|
|
140
|
+
types: "dist/index.d.ts",
|
|
141
|
+
scripts: {
|
|
142
|
+
prepublishOnly: "npm run build",
|
|
143
|
+
build: "tsup src/index.ts --format cjs,esm --dts",
|
|
144
|
+
lint: "tsc",
|
|
145
|
+
test: "cd tests/vue-ts && npm run dev",
|
|
146
|
+
pr: "sh pr.sh"
|
|
147
|
+
},
|
|
148
|
+
keywords: [
|
|
149
|
+
"vue",
|
|
150
|
+
"vue-helper",
|
|
151
|
+
"reactive-view",
|
|
152
|
+
"vue-class-component",
|
|
153
|
+
"reactive-ui"
|
|
154
|
+
],
|
|
155
|
+
author: "razaman2",
|
|
156
|
+
license: "MIT",
|
|
157
|
+
dependencies: {
|
|
158
|
+
"@razaman2/data-manager": "^3.3.8",
|
|
159
|
+
"@razaman2/event-emitter": "^2.1.1",
|
|
160
|
+
"@razaman2/object-manager": "^3.4.7",
|
|
161
|
+
"date-fns": "^4.1.0",
|
|
162
|
+
"date-fns-tz": "^3.2.0",
|
|
163
|
+
"tailwind-merge": "^3.5.0",
|
|
164
|
+
uuid: "^13.0.0"
|
|
165
|
+
},
|
|
166
|
+
peerDependencies: {
|
|
167
|
+
vue: ">=3.0.0"
|
|
168
|
+
},
|
|
169
|
+
devDependencies: {
|
|
170
|
+
"@types/uuid": "^11.0.0",
|
|
171
|
+
tsup: "^8.5.1",
|
|
172
|
+
typescript: "^5.9.3",
|
|
173
|
+
vitest: "^4.1.2"
|
|
174
|
+
},
|
|
175
|
+
publishConfig: {
|
|
176
|
+
access: "public"
|
|
177
|
+
},
|
|
178
|
+
files: [
|
|
179
|
+
"dist"
|
|
180
|
+
]
|
|
181
|
+
};
|
|
135
182
|
|
|
136
183
|
// src/ReactiveView.ts
|
|
137
184
|
var setup = {
|
|
@@ -176,6 +223,8 @@ var ReactiveView_default = {
|
|
|
176
223
|
},
|
|
177
224
|
setup(props, context) {
|
|
178
225
|
var _a, _b, _c;
|
|
226
|
+
const subscriptions = [];
|
|
227
|
+
onBeforeUnmount(() => subscriptions.forEach((subscription) => subscription()));
|
|
179
228
|
const diff = (before, after) => {
|
|
180
229
|
const changed = ref(false);
|
|
181
230
|
const paths = Array.from(new Set(before.paths().concat(after.paths())));
|
|
@@ -198,14 +247,14 @@ var ReactiveView_default = {
|
|
|
198
247
|
const template = (component, vue2) => {
|
|
199
248
|
return createVNode("div", context.slots.default ? context.attrs : __spreadValues({
|
|
200
249
|
style: { color: "red", textAlign: "center" }
|
|
201
|
-
}, context.attrs), context.slots.default ? context.slots.default({ component, vue: vue2, props, context }) : `${props.modelName}: ${name}@${version}`);
|
|
250
|
+
}, context.attrs), context.slots.default ? context.slots.default({ component, vue: vue2, props, context }) : `${props.modelName}: ${package_default.name}@${package_default.version}`);
|
|
202
251
|
};
|
|
203
252
|
const isValid = ref(false);
|
|
204
253
|
const isReady = ref(false);
|
|
205
254
|
const defer = ref(typeof props.defer === "function" ? props.defer() : props.defer);
|
|
206
255
|
const isFunctionData = ["Function"].includes((_a = props.data) == null ? void 0 : _a.constructor.name);
|
|
207
256
|
const isAsyncFunctionData = ["AsyncFunction"].includes((_b = props.data) == null ? void 0 : _b.constructor.name);
|
|
208
|
-
const
|
|
257
|
+
const isAsyncData = ["Promise"].includes((_c = props.data) == null ? void 0 : _c.constructor.name) || isAsyncFunctionData;
|
|
209
258
|
const vue = getCurrentInstance();
|
|
210
259
|
const defaultData = props.getDefaultData(
|
|
211
260
|
"defaultData" in vue.vnode.props ? vue.vnode.props.defaultData : "data" in vue.vnode.props ? Array.isArray(unref(vue.vnode.props.data)) ? [] : {} : {}
|
|
@@ -253,19 +302,20 @@ var ReactiveView_default = {
|
|
|
253
302
|
});
|
|
254
303
|
};
|
|
255
304
|
const normalize = (data) => {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
305
|
+
if (isRef(data) || isReactive(data)) {
|
|
306
|
+
return data;
|
|
307
|
+
} else if (isFunctionData || isAsyncData) {
|
|
308
|
+
return ref(datatype);
|
|
259
309
|
} else {
|
|
260
310
|
const props2 = "data" in vue.vnode.props;
|
|
261
311
|
try {
|
|
262
312
|
if (["Array", "Object"].includes(data.constructor.name)) {
|
|
263
|
-
return
|
|
313
|
+
return ref(data);
|
|
264
314
|
} else {
|
|
265
|
-
return
|
|
315
|
+
return ref(props2 ? { "": data } : datatype);
|
|
266
316
|
}
|
|
267
317
|
} catch (e) {
|
|
268
|
-
return
|
|
318
|
+
return ref(props2 ? { "": data } : datatype);
|
|
269
319
|
}
|
|
270
320
|
}
|
|
271
321
|
};
|
|
@@ -277,7 +327,7 @@ var ReactiveView_default = {
|
|
|
277
327
|
name: props.modelName,
|
|
278
328
|
logging: props.logging
|
|
279
329
|
};
|
|
280
|
-
const model = props.model ? typeof props.model === "function" ? props.model(config) : props.model :
|
|
330
|
+
const model = props.model ? typeof props.model === "function" ? props.model(config) : props.model : DataManager.setConfig({ beforeGetData: (data) => isRef(data) ? unref(data) : data }, config);
|
|
281
331
|
const component = ref({ parent: { self: vue.proxy }, self: { template, diff, emit, dataPath: dataPath2, model: proxy(model), isValid } });
|
|
282
332
|
if (context.attrs["onUpdate:model"] || context.attrs["update:model"]) {
|
|
283
333
|
const config2 = {
|
|
@@ -289,7 +339,7 @@ var ReactiveView_default = {
|
|
|
289
339
|
}
|
|
290
340
|
};
|
|
291
341
|
const source = () => ObjectManager.on(model.getData()).clone();
|
|
292
|
-
watch(source, (after, before) => {
|
|
342
|
+
subscriptions.push(watch(source, (after, before) => {
|
|
293
343
|
const diff2 = access(component).diff(ObjectManager.on(before), ObjectManager.on(after));
|
|
294
344
|
if (props.debug) {
|
|
295
345
|
console.warn(`[${props.modelName}]:model`, { diff: diff2, before, after });
|
|
@@ -297,30 +347,27 @@ var ReactiveView_default = {
|
|
|
297
347
|
if (diff2.changed) {
|
|
298
348
|
config2.callback(diff2, { component });
|
|
299
349
|
}
|
|
300
|
-
}, config2.options);
|
|
350
|
+
}, config2.options));
|
|
301
351
|
}
|
|
302
352
|
setTimeout(async () => {
|
|
303
353
|
var _a3, _b2, _c2;
|
|
304
|
-
if (props.model !== false) {
|
|
305
|
-
if (
|
|
306
|
-
console.warn(`${props.modelName}: defaultData is required for promise or
|
|
354
|
+
if (props.model !== false && (isFunctionData || isAsyncData)) {
|
|
355
|
+
if (!("defaultData" in vue.vnode.props)) {
|
|
356
|
+
console.warn(`${props.modelName}: defaultData is required for promise or function data.`, props.data);
|
|
307
357
|
}
|
|
308
|
-
const [data] =
|
|
358
|
+
const [data] = isAsyncData ? await Promise.all([
|
|
309
359
|
isAsyncFunctionData ? props.data() : props.data,
|
|
310
360
|
(_a3 = defer.value) != null ? _a3 : true
|
|
311
361
|
]) : [props.data];
|
|
312
|
-
const
|
|
313
|
-
|
|
314
|
-
const source = isRefData || isReactiveData || isFunctionData ? data : typeof data === "function" ? data : (() => data);
|
|
315
|
-
watch(source, async (after, before) => {
|
|
316
|
-
var _a4;
|
|
362
|
+
const source = typeof data === "function" ? data : (() => data);
|
|
363
|
+
subscriptions.push(watch(source, async (after, before) => {
|
|
317
364
|
const diff2 = access(component).diff(ObjectManager.on(before), ObjectManager.on(after));
|
|
318
365
|
const callback = context.attrs["data:callback"];
|
|
319
366
|
if (props.debug) {
|
|
320
|
-
console.warn(`[${props.modelName}]:data`, { diff: diff2, data, callback, before, after, props, context, component
|
|
367
|
+
console.warn(`[${props.modelName}]:data`, { diff: diff2, data, callback, before, after, props, context, component });
|
|
321
368
|
}
|
|
322
369
|
if (typeof callback === "function") {
|
|
323
|
-
|
|
370
|
+
callback(diff2, { component });
|
|
324
371
|
} else {
|
|
325
372
|
model.replaceData(after);
|
|
326
373
|
}
|
|
@@ -328,7 +375,7 @@ var ReactiveView_default = {
|
|
|
328
375
|
immediate: (_b2 = context.attrs["data:immediate"]) != null ? _b2 : true,
|
|
329
376
|
deep: (_c2 = context.attrs["data:deep"]) != null ? _c2 : true,
|
|
330
377
|
once: context.attrs["data:once"]
|
|
331
|
-
});
|
|
378
|
+
}));
|
|
332
379
|
}
|
|
333
380
|
});
|
|
334
381
|
setTimeout(async () => {
|
|
@@ -383,7 +430,7 @@ var ReactiveView_default = {
|
|
|
383
430
|
if (isReactive(data)) {
|
|
384
431
|
return data;
|
|
385
432
|
} else {
|
|
386
|
-
if (isRef(data) || isFunctionData ||
|
|
433
|
+
if (isRef(data) || isFunctionData || isAsyncData) {
|
|
387
434
|
return reactive(datatype);
|
|
388
435
|
} else {
|
|
389
436
|
const props2 = "data" in vue.vnode.props;
|
|
@@ -401,7 +448,7 @@ var ReactiveView_default = {
|
|
|
401
448
|
};
|
|
402
449
|
const config = {
|
|
403
450
|
data: props.beta ? normalize((_a2 = vue.vnode.props) == null ? void 0 : _a2.data) : reactive(ObjectManager.on(
|
|
404
|
-
|
|
451
|
+
isAsyncData || isFunctionData || isRef(props.data) || isReactive(props.data) ? datatype : "data" in vue.vnode.props ? props.data : datatype
|
|
405
452
|
).clone()),
|
|
406
453
|
defaultData: ObjectManager.on(defaultData).clone(),
|
|
407
454
|
notifications: props.notifications,
|
|
@@ -433,7 +480,7 @@ var ReactiveView_default = {
|
|
|
433
480
|
});
|
|
434
481
|
const component = ref({ parent: { self: vue.proxy }, self: { template, model, diff, emit, dataPath: dataPath2, isValid } });
|
|
435
482
|
if (props.debug) {
|
|
436
|
-
console.warn("[ReactiveView]:", { props, context, vue, defer, config, model, component, datatype, defaultData, isValid, isReady, isFunctionData, isAsyncFunctionData,
|
|
483
|
+
console.warn("[ReactiveView]:", { props, context, vue, defer, config, model, component, datatype, defaultData, isValid, isReady, isFunctionData, isAsyncFunctionData, isAsyncData });
|
|
437
484
|
}
|
|
438
485
|
const watchDataProp = (dataProp) => {
|
|
439
486
|
var _a3, _b3, _c3, _d2;
|
|
@@ -446,14 +493,14 @@ var ReactiveView_default = {
|
|
|
446
493
|
if (context.attrs["data:log"]) {
|
|
447
494
|
console.warn(`[ReactiveView]:data`, { config: config2, dataProp });
|
|
448
495
|
}
|
|
449
|
-
watch(isFunctionData || isRef(dataProp) || isReactive(dataProp) ? dataProp : () => dataProp, (after, before) => {
|
|
496
|
+
subscriptions.push(watch(isFunctionData || isRef(dataProp) || isReactive(dataProp) ? dataProp : () => dataProp, (after, before) => {
|
|
450
497
|
var _a4;
|
|
451
498
|
if (typeof config2.callback === "function") {
|
|
452
499
|
model.replaceData((_a4 = config2.callback(access(component).diff(ObjectManager.on(before), ObjectManager.on(after)), { component })) != null ? _a4 : after);
|
|
453
500
|
} else {
|
|
454
501
|
model.replaceData(after);
|
|
455
502
|
}
|
|
456
|
-
}, config2.options);
|
|
503
|
+
}, config2.options));
|
|
457
504
|
};
|
|
458
505
|
if (context.attrs["onUpdate:model"] || context.attrs["update:model"]) {
|
|
459
506
|
const config2 = typeof context.attrs["onUpdate:model"] === "function" ? {
|
|
@@ -465,20 +512,20 @@ var ReactiveView_default = {
|
|
|
465
512
|
if (context.attrs["model:log"]) {
|
|
466
513
|
console.warn(`[ReactiveView]:model`, { config: config2 });
|
|
467
514
|
}
|
|
468
|
-
watch(() => ObjectManager.on(model.getData()).clone(), (after, before) => {
|
|
515
|
+
subscriptions.push(watch(() => ObjectManager.on(model.getData()).clone(), (after, before) => {
|
|
469
516
|
config2.callback(access(component).diff(ObjectManager.on(before), ObjectManager.on(after)), { component });
|
|
470
|
-
}, config2.options);
|
|
517
|
+
}, config2.options));
|
|
471
518
|
}
|
|
472
519
|
if (props.beta) {
|
|
473
520
|
const isRefData = isRef(props.data);
|
|
474
|
-
if (isRefData || isFunctionData ||
|
|
521
|
+
if (isRefData || isFunctionData || isAsyncData) {
|
|
475
522
|
setTimeout(async () => {
|
|
476
523
|
var _a3, _b3, _c3;
|
|
477
|
-
const [data] =
|
|
524
|
+
const [data] = isAsyncData ? await Promise.all([
|
|
478
525
|
isAsyncFunctionData ? props.data() : props.data,
|
|
479
526
|
(_a3 = defer.value) != null ? _a3 : true
|
|
480
527
|
]) : [props.data];
|
|
481
|
-
watch(isRefData ? data : isFunctionData ? data : typeof data === "function" ? data : () => data, (after, before) => {
|
|
528
|
+
subscriptions.push(watch(isRefData ? data : isFunctionData ? data : typeof data === "function" ? data : () => data, (after, before) => {
|
|
482
529
|
var _a4;
|
|
483
530
|
if (before !== void 0 || after !== void 0) {
|
|
484
531
|
const callback = context.attrs["data:callback"];
|
|
@@ -493,7 +540,7 @@ var ReactiveView_default = {
|
|
|
493
540
|
immediate: (_b3 = context.attrs["data:immediate"]) != null ? _b3 : true,
|
|
494
541
|
deep: (_c3 = context.attrs["data:deep"]) != null ? _c3 : true,
|
|
495
542
|
once: context.attrs["data:once"]
|
|
496
|
-
});
|
|
543
|
+
}));
|
|
497
544
|
});
|
|
498
545
|
}
|
|
499
546
|
} else {
|
|
@@ -651,24 +698,24 @@ function useSubscription() {
|
|
|
651
698
|
const subscriptions = [];
|
|
652
699
|
const subscription = Subscriptions.get();
|
|
653
700
|
return {
|
|
654
|
-
addSubscription(
|
|
655
|
-
subscription.subscribe(
|
|
656
|
-
subscriptions.push(() => subscription.unsubscribe(
|
|
701
|
+
addSubscription(name, handler = () => false, data) {
|
|
702
|
+
subscription.subscribe(name, handler, data);
|
|
703
|
+
subscriptions.push(() => subscription.unsubscribe(name));
|
|
657
704
|
},
|
|
658
|
-
replaceSubscription(
|
|
659
|
-
subscription.replace(
|
|
660
|
-
subscriptions.push(() => subscription.unsubscribe(
|
|
705
|
+
replaceSubscription(name, handler = () => false, data) {
|
|
706
|
+
subscription.replace(name, handler, data);
|
|
707
|
+
subscriptions.push(() => subscription.unsubscribe(name));
|
|
661
708
|
},
|
|
662
709
|
removeSubscriptions() {
|
|
663
710
|
subscriptions.forEach((subscription2) => safeRequest({
|
|
664
711
|
try: () => subscription2()
|
|
665
712
|
}));
|
|
666
713
|
},
|
|
667
|
-
removeSubscription(
|
|
668
|
-
subscription.unsubscribe(
|
|
714
|
+
removeSubscription(name) {
|
|
715
|
+
subscription.unsubscribe(name);
|
|
669
716
|
},
|
|
670
|
-
hasSubscription(
|
|
671
|
-
return subscription.hasSubscription(
|
|
717
|
+
hasSubscription(name) {
|
|
718
|
+
return subscription.hasSubscription(name);
|
|
672
719
|
},
|
|
673
720
|
subscriptions,
|
|
674
721
|
subscription
|
package/package.json
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@razaman2/reactive-view",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
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
|
-
"main": "dist/index.js",
|
|
6
|
-
"module": "dist/index.mjs",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"prepublishOnly": "npm run build",
|
|
10
|
-
"build": "tsup src/index.ts --format cjs,esm --dts",
|
|
11
|
-
"lint": "tsc",
|
|
12
|
-
"test": "cd tests/vue-ts && npm run dev",
|
|
13
|
-
"pr": "sh pr.sh"
|
|
14
|
-
},
|
|
15
|
-
"keywords": [
|
|
16
|
-
"vue",
|
|
17
|
-
"vue-helper",
|
|
18
|
-
"reactive-view",
|
|
19
|
-
"vue-class-component",
|
|
20
|
-
"reactive-ui"
|
|
21
|
-
],
|
|
22
|
-
"author": "razaman2",
|
|
23
|
-
"license": "MIT",
|
|
24
|
-
"dependencies": {
|
|
25
|
-
"@razaman2/data-manager": "^3.3.
|
|
26
|
-
"@razaman2/event-emitter": "^2.1.1",
|
|
27
|
-
"@razaman2/object-manager": "^3.4.7",
|
|
28
|
-
"date-fns": "^4.1.0",
|
|
29
|
-
"date-fns-tz": "^3.2.0",
|
|
30
|
-
"tailwind-merge": "^3.5.0",
|
|
31
|
-
"uuid": "^13.0.0"
|
|
32
|
-
},
|
|
33
|
-
"peerDependencies": {
|
|
34
|
-
"vue": ">=3.0.0"
|
|
35
|
-
},
|
|
36
|
-
"devDependencies": {
|
|
37
|
-
"@types/uuid": "^11.0.0",
|
|
38
|
-
"tsup": "^8.5.1",
|
|
39
|
-
"typescript": "^5.9.3",
|
|
40
|
-
"vitest": "^4.1.2"
|
|
41
|
-
},
|
|
42
|
-
"publishConfig": {
|
|
43
|
-
"access": "public"
|
|
44
|
-
},
|
|
45
|
-
"files": [
|
|
46
|
-
"dist"
|
|
47
|
-
]
|
|
48
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@razaman2/reactive-view",
|
|
3
|
+
"version": "0.1.0-beta.7",
|
|
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
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"prepublishOnly": "npm run build",
|
|
10
|
+
"build": "tsup src/index.ts --format cjs,esm --dts",
|
|
11
|
+
"lint": "tsc",
|
|
12
|
+
"test": "cd tests/vue-ts && npm run dev",
|
|
13
|
+
"pr": "sh pr.sh"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"vue",
|
|
17
|
+
"vue-helper",
|
|
18
|
+
"reactive-view",
|
|
19
|
+
"vue-class-component",
|
|
20
|
+
"reactive-ui"
|
|
21
|
+
],
|
|
22
|
+
"author": "razaman2",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@razaman2/data-manager": "^3.3.8",
|
|
26
|
+
"@razaman2/event-emitter": "^2.1.1",
|
|
27
|
+
"@razaman2/object-manager": "^3.4.7",
|
|
28
|
+
"date-fns": "^4.1.0",
|
|
29
|
+
"date-fns-tz": "^3.2.0",
|
|
30
|
+
"tailwind-merge": "^3.5.0",
|
|
31
|
+
"uuid": "^13.0.0"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"vue": ">=3.0.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/uuid": "^11.0.0",
|
|
38
|
+
"tsup": "^8.5.1",
|
|
39
|
+
"typescript": "^5.9.3",
|
|
40
|
+
"vitest": "^4.1.2"
|
|
41
|
+
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"files": [
|
|
46
|
+
"dist"
|
|
47
|
+
]
|
|
48
|
+
}
|