@razaman2/reactive-view 0.0.34-beta.3 → 0.0.34-beta.4
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 +11 -14
- package/dist/index.mjs +11 -14
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -168,7 +168,7 @@ var import_vue = require("vue");
|
|
|
168
168
|
|
|
169
169
|
// package.json
|
|
170
170
|
var name = "@razaman2/reactive-view";
|
|
171
|
-
var version = "0.0.34-beta.
|
|
171
|
+
var version = "0.0.34-beta.4";
|
|
172
172
|
|
|
173
173
|
// src/ReactiveView.ts
|
|
174
174
|
var setup = {
|
|
@@ -348,6 +348,7 @@ var ReactiveView_default = {
|
|
|
348
348
|
// src/index.ts
|
|
349
349
|
var import_vue2 = require("vue");
|
|
350
350
|
var import_date_fns_tz = require("date-fns-tz");
|
|
351
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
351
352
|
var index_default = ReactiveView_default;
|
|
352
353
|
function safeRequest(request) {
|
|
353
354
|
return new Promise(async (resolve) => {
|
|
@@ -377,7 +378,7 @@ function safeRequest(request) {
|
|
|
377
378
|
}
|
|
378
379
|
});
|
|
379
380
|
}
|
|
380
|
-
function getProps(props, param2) {
|
|
381
|
+
function getProps(props = {}, param2) {
|
|
381
382
|
var _a;
|
|
382
383
|
const exclude = Array.isArray(param2) || typeof param2 === "string" ? param2 : param2.exclude;
|
|
383
384
|
const exclusions = (Array.isArray(exclude) ? exclude : [exclude]).join("|");
|
|
@@ -529,22 +530,18 @@ var extendVnode = (component, element) => {
|
|
|
529
530
|
return (props = {}, slots) => {
|
|
530
531
|
var _a;
|
|
531
532
|
const _b = getProps((_a = vnode.props) != null ? _a : {}, []), { class: classes, style: styles } = _b, rest = __objRest(_b, ["class", "style"]);
|
|
532
|
-
const finalClasses = MergeStyles(classes, typeof props.class === "function" ? props.class(classes) : props.class);
|
|
533
|
+
const finalClasses = (0, import_tailwind_merge.twMerge)(MergeStyles(classes).string, MergeStyles(typeof props.class === "function" ? props.class(classes) : props.class).string);
|
|
534
|
+
const finalStyles = MergeStyles(styles, typeof props.style === "function" ? props.style(styles) : props.style);
|
|
533
535
|
const functionalProps = Object.entries(props).reduce((props2, [key2, value]) => {
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
].includes(key2) && typeof value === "function") {
|
|
538
|
-
props2[key2] = value(vnode.props[key2]);
|
|
536
|
+
var _a2;
|
|
537
|
+
if (!["class", "style"].includes(key2) && typeof value === "function") {
|
|
538
|
+
props2[key2] = value((_a2 = vnode.props) == null ? void 0 : _a2[key2]);
|
|
539
539
|
}
|
|
540
540
|
return props2;
|
|
541
541
|
}, props);
|
|
542
|
-
const finalProps = Object.assign(rest, functionalProps, {
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
});
|
|
546
|
-
const finalSlots = typeof slots === "function" ? slots(vnode.children) : vnode.children;
|
|
547
|
-
return (0, import_vue2.h)(["string", "undefined"].includes(typeof element) ? vnode : element, finalProps, finalSlots);
|
|
542
|
+
const finalProps = Object.assign(rest, functionalProps, { class: finalClasses, style: finalStyles });
|
|
543
|
+
const finalSlots = slots ? typeof slots === "function" ? slots(vnode.children) : slots : vnode.children;
|
|
544
|
+
return (0, import_vue2.h)(["undefined"].includes(typeof element) ? vnode.type : element, finalProps, finalSlots);
|
|
548
545
|
};
|
|
549
546
|
}
|
|
550
547
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -125,7 +125,7 @@ import { ref, reactive, watch, isRef, isReactive, createVNode, getCurrentInstanc
|
|
|
125
125
|
|
|
126
126
|
// package.json
|
|
127
127
|
var name = "@razaman2/reactive-view";
|
|
128
|
-
var version = "0.0.34-beta.
|
|
128
|
+
var version = "0.0.34-beta.4";
|
|
129
129
|
|
|
130
130
|
// src/ReactiveView.ts
|
|
131
131
|
var setup = {
|
|
@@ -305,6 +305,7 @@ var ReactiveView_default = {
|
|
|
305
305
|
// src/index.ts
|
|
306
306
|
import { createVNode as createVNode2, isRef as isRef2, h } from "vue";
|
|
307
307
|
import { formatInTimeZone } from "date-fns-tz";
|
|
308
|
+
import { twMerge } from "tailwind-merge";
|
|
308
309
|
var index_default = ReactiveView_default;
|
|
309
310
|
function safeRequest(request) {
|
|
310
311
|
return new Promise(async (resolve) => {
|
|
@@ -334,7 +335,7 @@ function safeRequest(request) {
|
|
|
334
335
|
}
|
|
335
336
|
});
|
|
336
337
|
}
|
|
337
|
-
function getProps(props, param2) {
|
|
338
|
+
function getProps(props = {}, param2) {
|
|
338
339
|
var _a;
|
|
339
340
|
const exclude = Array.isArray(param2) || typeof param2 === "string" ? param2 : param2.exclude;
|
|
340
341
|
const exclusions = (Array.isArray(exclude) ? exclude : [exclude]).join("|");
|
|
@@ -486,22 +487,18 @@ var extendVnode = (component, element) => {
|
|
|
486
487
|
return (props = {}, slots) => {
|
|
487
488
|
var _a;
|
|
488
489
|
const _b = getProps((_a = vnode.props) != null ? _a : {}, []), { class: classes, style: styles } = _b, rest = __objRest(_b, ["class", "style"]);
|
|
489
|
-
const finalClasses = MergeStyles(classes, typeof props.class === "function" ? props.class(classes) : props.class);
|
|
490
|
+
const finalClasses = twMerge(MergeStyles(classes).string, MergeStyles(typeof props.class === "function" ? props.class(classes) : props.class).string);
|
|
491
|
+
const finalStyles = MergeStyles(styles, typeof props.style === "function" ? props.style(styles) : props.style);
|
|
490
492
|
const functionalProps = Object.entries(props).reduce((props2, [key2, value]) => {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
].includes(key2) && typeof value === "function") {
|
|
495
|
-
props2[key2] = value(vnode.props[key2]);
|
|
493
|
+
var _a2;
|
|
494
|
+
if (!["class", "style"].includes(key2) && typeof value === "function") {
|
|
495
|
+
props2[key2] = value((_a2 = vnode.props) == null ? void 0 : _a2[key2]);
|
|
496
496
|
}
|
|
497
497
|
return props2;
|
|
498
498
|
}, props);
|
|
499
|
-
const finalProps = Object.assign(rest, functionalProps, {
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
});
|
|
503
|
-
const finalSlots = typeof slots === "function" ? slots(vnode.children) : vnode.children;
|
|
504
|
-
return h(["string", "undefined"].includes(typeof element) ? vnode : element, finalProps, finalSlots);
|
|
499
|
+
const finalProps = Object.assign(rest, functionalProps, { class: finalClasses, style: finalStyles });
|
|
500
|
+
const finalSlots = slots ? typeof slots === "function" ? slots(vnode.children) : slots : vnode.children;
|
|
501
|
+
return h(["undefined"].includes(typeof element) ? vnode.type : element, finalProps, finalSlots);
|
|
505
502
|
};
|
|
506
503
|
}
|
|
507
504
|
});
|
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.4",
|
|
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",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"@razaman2/object-manager": "^3.4.2",
|
|
27
27
|
"date-fns": "^4.1.0",
|
|
28
28
|
"date-fns-tz": "^3.2.0",
|
|
29
|
+
"tailwind-merge": "^3.3.1",
|
|
29
30
|
"uuid": "^11.1.0"
|
|
30
31
|
},
|
|
31
32
|
"peerDependencies": {
|