@ahmadmubarak98/namozaj 1.6.4 → 1.6.6
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/main.d.ts +2 -1
- package/dist/namozaj.js +36 -9
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export declare type BaseFieldConfig = {
|
|
|
21
21
|
helperText?: HelperTextConfig;
|
|
22
22
|
validations?: ValidationRule[];
|
|
23
23
|
grid?: GridColumnConfig;
|
|
24
|
+
fullRow?: boolean;
|
|
24
25
|
className?: string;
|
|
25
26
|
disabled?: boolean;
|
|
26
27
|
visibilityRules?: VisibilityRule[];
|
|
@@ -268,7 +269,7 @@ export declare type HelperTextConfig = {
|
|
|
268
269
|
color?: BaseColors | string;
|
|
269
270
|
};
|
|
270
271
|
|
|
271
|
-
export declare type InputRestriction = "alpha" | "alphanumeric" | "numeric" | "alpha-with-spaces" | "alphanumeric-with-spaces" | "numeric-with-spaces" | RegExp;
|
|
272
|
+
export declare type InputRestriction = "alpha" | "alphanumeric" | "numeric" | "alpha-with-spaces" | "alphanumeric-with-spaces" | "numeric-with-spaces" | 'email' | RegExp;
|
|
272
273
|
|
|
273
274
|
export declare type ModalSize = "small" | "medium" | "large" | "full";
|
|
274
275
|
|
package/dist/namozaj.js
CHANGED
|
@@ -4582,6 +4582,8 @@ const getDefaultValue = (e) => {
|
|
|
4582
4582
|
return /^[\p{L}\0-9\s]*$/u;
|
|
4583
4583
|
case "numeric-with-spaces":
|
|
4584
4584
|
return /^[0-9\s]*$/;
|
|
4585
|
+
case "email":
|
|
4586
|
+
return /^[a-zA-Z0-9._@-]*$/;
|
|
4585
4587
|
default:
|
|
4586
4588
|
return /.*/;
|
|
4587
4589
|
}
|
|
@@ -80539,7 +80541,7 @@ const RowActions = ({
|
|
|
80539
80541
|
{
|
|
80540
80542
|
onClick: () => d && d(e),
|
|
80541
80543
|
variant: "outlined",
|
|
80542
|
-
color: "
|
|
80544
|
+
color: "error",
|
|
80543
80545
|
size: "small",
|
|
80544
80546
|
children: a
|
|
80545
80547
|
}
|
|
@@ -80795,7 +80797,7 @@ const ConfirmationDialog = ({
|
|
|
80795
80797
|
error: p
|
|
80796
80798
|
}) => {
|
|
80797
80799
|
var Ze;
|
|
80798
|
-
const { enableRtl: d } = useLocalDynamicFormProvider(), { meta: u } = t, b = typeof u.inline == "boolean" ? u.inline : !0, h = useFormContext(), g = useRef(null), [m, y] = useState(!1), [C, v] = useState(!1), [w, S] = useState(null), [x, L] = useState(!1), D = u.addEditModalTitle || `Add ${u.label}`, N = u.removeDialogTitle ||
|
|
80800
|
+
const { enableRtl: d } = useLocalDynamicFormProvider(), { meta: u } = t, b = typeof u.inline == "boolean" ? u.inline : !0, h = useFormContext(), g = useRef(null), [m, y] = useState(!1), [C, v] = useState(!1), [w, S] = useState(null), [x, L] = useState(!1), D = u.addEditModalTitle || `Add ${u.label}`, N = u.removeDialogTitle || `${t.meta.removeBtn || "Remove"} ${u.label}`, I = u.removeDialogDescription || `Are you sure you want to remove this ${u.label}?`, k = t.meta.saveBtn || "Save", H = t.meta.cancelBtn || "Cancel", G = t.meta.addBtn || `Add ${u.label}`, Y = t.meta.editBtn || "Edit", V = t.meta.removeBtn || "Remove", j = u.minEntries ?? void 0, Z = u.maxEntries ?? void 0, te = Z ? l.length < Z : u.canAdd ?? !0, re = u.canEdit ?? !0, oe = j ? l.length > j : u.canRemove ?? !0, be = () => {
|
|
80799
80801
|
Ye();
|
|
80800
80802
|
}, ve = (Ve) => {
|
|
80801
80803
|
S(Ve), Ye();
|
|
@@ -80980,7 +80982,7 @@ const ConfirmationDialog = ({
|
|
|
80980
80982
|
control: b,
|
|
80981
80983
|
name: a,
|
|
80982
80984
|
keyName: "_id"
|
|
80983
|
-
}), [g, m] = useState(!1), [y, C] = useState(null), [v, w] = useState(!1), S = d.removeDialogTitle ||
|
|
80985
|
+
}), [g, m] = useState(!1), [y, C] = useState(null), [v, w] = useState(!1), S = d.removeDialogTitle || `${t.meta.removeBtn || "Remove"} ${d.label}`, x = d.removeDialogDescription || `Are you sure you want to remove this ${d.label}?`, L = t.meta.addBtn || `Add ${d.label}`, D = t.meta.removeBtn || "Remove", N = t.meta.cancelBtn || "Cancel", I = d.minEntries ?? void 0, k = d.maxEntries ?? void 0, H = k ? h.fields.length < k : d.canAdd ?? !0, G = I ? h.fields.length > I : d.canRemove ?? !0, Y = (be) => {
|
|
80984
80986
|
be.preventDefault(), be.stopPropagation(), h.append({
|
|
80985
80987
|
...d.fields.reduce((ve, Re) => (ve[Re.name] = getDefaultValue(Re), ve), {})
|
|
80986
80988
|
});
|
|
@@ -81053,7 +81055,7 @@ const ConfirmationDialog = ({
|
|
|
81053
81055
|
Button$1,
|
|
81054
81056
|
{
|
|
81055
81057
|
variant: "outlined",
|
|
81056
|
-
color: "
|
|
81058
|
+
color: "error",
|
|
81057
81059
|
onClick: () => V(ve),
|
|
81058
81060
|
size: "small",
|
|
81059
81061
|
children: /* @__PURE__ */ jsx(Fragment, { children: D })
|
|
@@ -85102,7 +85104,17 @@ const Form = React__default.forwardRef(
|
|
|
85102
85104
|
({ ...H }, (G = e.onSubmit) == null || G.call(e, H));
|
|
85103
85105
|
}, b = async () => (await c.trigger()).valueOf(), h = () => {
|
|
85104
85106
|
var H, G;
|
|
85105
|
-
return /* @__PURE__ */ jsx(Fragment, { children: !((H = e.submitButtonProps) != null && H.hidden) && /* @__PURE__ */ jsx(
|
|
85107
|
+
return /* @__PURE__ */ jsx(Fragment, { children: !((H = e.submitButtonProps) != null && H.hidden) && /* @__PURE__ */ jsx(
|
|
85108
|
+
Button$1,
|
|
85109
|
+
{
|
|
85110
|
+
loading: e.loading,
|
|
85111
|
+
loadingPosition: "start",
|
|
85112
|
+
variant: "contained",
|
|
85113
|
+
color: "primary",
|
|
85114
|
+
type: "submit",
|
|
85115
|
+
children: ((G = e.submitButtonProps) == null ? void 0 : G.label) || "Submit"
|
|
85116
|
+
}
|
|
85117
|
+
) });
|
|
85106
85118
|
}, g = () => /* @__PURE__ */ jsx(Fragment, {});
|
|
85107
85119
|
useEffect(() => {
|
|
85108
85120
|
const H = c.watch(
|
|
@@ -85157,15 +85169,30 @@ const Form = React__default.forwardRef(
|
|
|
85157
85169
|
},
|
|
85158
85170
|
...(w = (v = e.slots) == null ? void 0 : v.formBody) == null ? void 0 : w.style
|
|
85159
85171
|
},
|
|
85160
|
-
children: /* @__PURE__ */ jsx(Grid, { container: !0, spacing: 2, children: (e.fields || []).map((H, G) => /* @__PURE__ */ jsx(
|
|
85172
|
+
children: /* @__PURE__ */ jsx(Grid, { container: !0, spacing: 2, children: (e.fields || []).map((H, G) => /* @__PURE__ */ jsx(Fragment$1, { children: H.meta.fullRow ? /* @__PURE__ */ jsx(
|
|
85173
|
+
Grid,
|
|
85174
|
+
{
|
|
85175
|
+
columns: 12,
|
|
85176
|
+
size: {
|
|
85177
|
+
xs: 12
|
|
85178
|
+
},
|
|
85179
|
+
children: /* @__PURE__ */ jsx(Grid, { container: !0, spacing: 2, children: /* @__PURE__ */ jsx(
|
|
85180
|
+
FieldRenderer,
|
|
85181
|
+
{
|
|
85182
|
+
...H,
|
|
85183
|
+
locale: H.locale,
|
|
85184
|
+
control: c.control
|
|
85185
|
+
}
|
|
85186
|
+
) })
|
|
85187
|
+
}
|
|
85188
|
+
) : /* @__PURE__ */ jsx(
|
|
85161
85189
|
FieldRenderer,
|
|
85162
85190
|
{
|
|
85163
85191
|
...H,
|
|
85164
85192
|
locale: H.locale,
|
|
85165
85193
|
control: c.control
|
|
85166
|
-
}
|
|
85167
|
-
|
|
85168
|
-
)) })
|
|
85194
|
+
}
|
|
85195
|
+
) }, H.name || G)) })
|
|
85169
85196
|
}
|
|
85170
85197
|
),
|
|
85171
85198
|
/* @__PURE__ */ jsxs(
|