@ahmadmubarak98/namozaj 1.11.76 → 1.11.78
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/namozaj.js +19 -5
- package/package.json +1 -1
package/dist/namozaj.js
CHANGED
|
@@ -9956,11 +9956,25 @@ function handleComparison(e, t, a) {
|
|
|
9956
9956
|
const getDefaultValue = (e) => {
|
|
9957
9957
|
var t, a, l, c, p;
|
|
9958
9958
|
return e.type === "date" ? e.meta.defaultValue ? new Date(e.meta.defaultValue) : null : e.type === "checkbox" || e.type === "switch" ? e.meta.defaultValue === !0 : e.type === "checkbox-group" ? e.meta.defaultValue ?? [] : e.type === "multi-select" ? e.meta.defaultValue ?? [] : e.type === "time" || e.type === "datetime" ? e.meta.defaultValue ? new Date(e.meta.defaultValue) : "" : e.type === "number" ? ((t = e.meta) == null ? void 0 : t.defaultValue) ?? null : e.type === "repeater" || e.type === "field-array" ? ((a = e.meta) == null ? void 0 : a.defaultValue) ?? [] : e.type === "file" ? e.meta.multiple ? ((l = e.meta) == null ? void 0 : l.defaultValue) ?? [] : ((c = e.meta) == null ? void 0 : c.defaultValue) ?? "" : FIELDS_EXCLUDE_AS_VALUE.includes(e.type) ? void 0 : ((p = e.meta) == null ? void 0 : p.defaultValue) ?? "";
|
|
9959
|
-
}, getDefaultValues = (e) => e.filter((
|
|
9960
|
-
l.
|
|
9961
|
-
|
|
9962
|
-
|
|
9963
|
-
|
|
9959
|
+
}, getDefaultValues = (e, t = {}) => e.filter((a) => !FIELDS_EXCLUDE_AS_VALUE.includes(a.type)).reduce((a, l) => (evaluateVisibilityRules(
|
|
9960
|
+
l.meta.visibilityRules || [],
|
|
9961
|
+
(l.meta.visibilityRules || []).reduce((p, d, u) => ({ ...p, [d.ref]: t[u] }), {})
|
|
9962
|
+
) && (l.type === "group" ? l.meta.fields.filter((p) => !FIELDS_EXCLUDE_AS_VALUE.includes(p.type)).forEach((p) => {
|
|
9963
|
+
evaluateVisibilityRules(
|
|
9964
|
+
p.meta.visibilityRules || [],
|
|
9965
|
+
(p.meta.visibilityRules || []).reduce((u, b, h) => ({ ...u, [b.ref]: t[h] }), {})
|
|
9966
|
+
) && (p.type === "group" ? p.meta.fields.filter(
|
|
9967
|
+
(u) => !FIELDS_EXCLUDE_AS_VALUE.includes(u.type)
|
|
9968
|
+
).forEach((u) => {
|
|
9969
|
+
!evaluateVisibilityRules(
|
|
9970
|
+
u.meta.visibilityRules || [],
|
|
9971
|
+
(u.meta.visibilityRules || []).reduce(
|
|
9972
|
+
(h, g, m) => ({ ...h, [g.ref]: t[m] }),
|
|
9973
|
+
{}
|
|
9974
|
+
)
|
|
9975
|
+
) || (a[u.name] = getDefaultValue(u));
|
|
9976
|
+
}) : a[p.name] = getDefaultValue(p));
|
|
9977
|
+
}) : a[l.name] = getDefaultValue(l)), a), {}), shouldRenderLabel = (e) => !FIELDS_EXCLUDE_LABEL.includes(e), shouldRenderHelperText = (e) => !FIELDS_EXCLUDE_HELPER_TEXT.includes(e), evaluateVisibilityRules = (visibilityRules, values) => {
|
|
9964
9978
|
if (!visibilityRules) return !0;
|
|
9965
9979
|
values = Object.fromEntries(
|
|
9966
9980
|
Object.entries(values).filter(([e]) => !e.includes("."))
|