@ahmadmubarak98/namozaj 1.8.19 → 1.9.0
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 +18 -2
- package/dist/namozaj.js +11 -3
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ButtonOwnProps } from '@mui/material';
|
|
1
2
|
import { ButtonPropsSizeOverrides } from '@mui/material';
|
|
2
3
|
import { ButtonPropsVariantOverrides } from '@mui/material';
|
|
3
4
|
import { CountryIso2 } from 'react-international-phone';
|
|
@@ -52,6 +53,21 @@ export declare type BaseFormFieldProps = {
|
|
|
52
53
|
|
|
53
54
|
export declare type BasePlacement = "top" | "bottom" | "right" | "left";
|
|
54
55
|
|
|
56
|
+
export declare type ButtonConfig = BaseFieldConfig & {
|
|
57
|
+
type: "text";
|
|
58
|
+
meta: Omit<BaseFieldConfig["meta"], 'defaultValue, placeholder, translated, validations, renderLabelRightSide, dependencies, onValueChange, compute'> & {
|
|
59
|
+
variant?: ButtonOwnProps['variant'];
|
|
60
|
+
startIcon?: React.ReactNode | string;
|
|
61
|
+
size?: ButtonOwnProps['size'];
|
|
62
|
+
color?: ButtonOwnProps['color'];
|
|
63
|
+
endIcon?: React.ReactNode | string;
|
|
64
|
+
onClick: (formMethods: RHFFormMethods) => void | Promise<void>;
|
|
65
|
+
disabled?: boolean;
|
|
66
|
+
hidden?: boolean;
|
|
67
|
+
fullWidth?: boolean;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
|
|
55
71
|
export declare type ButtonFieldConfig = BaseFieldConfig & {
|
|
56
72
|
type: "button";
|
|
57
73
|
meta: BaseFieldConfig["meta"] & {
|
|
@@ -158,7 +174,7 @@ export declare type FieldOptionFetchFunction = (() => Promise<FieldOption[]>) |
|
|
|
158
174
|
|
|
159
175
|
export declare type FieldSize = 'small' | 'medium';
|
|
160
176
|
|
|
161
|
-
export declare type FieldType = "text" | "phone" | "number" | "slider" | "select" | "multi-select" | "checkbox-group" | "radio-group" | "checkbox" | "switch" | "date" | "time" | "datetime" | "file" | "repeater" | "field-array" | "group";
|
|
177
|
+
export declare type FieldType = "text" | "phone" | "number" | "slider" | "select" | "multi-select" | "checkbox-group" | "radio-group" | "checkbox" | "switch" | "date" | "time" | "datetime" | "file" | "repeater" | "field-array" | "group" | "button";
|
|
162
178
|
|
|
163
179
|
export declare type FieldValueType = string | number | boolean | Date | File | (string | undefined)[] | ({
|
|
164
180
|
[x: string]: any;
|
|
@@ -276,7 +292,7 @@ export declare type MultiSelectFieldConfig = BaseFieldConfig & {
|
|
|
276
292
|
|
|
277
293
|
export declare const Namozaj: default_2.ForwardRefExoticComponent<NamozajProps & default_2.RefAttributes<any>>;
|
|
278
294
|
|
|
279
|
-
export declare type NamozajField = TextFieldConfig | NumberFieldConfig | SliderFieldConfig | PhoneFieldConfig | GroupFieldConfig | SelectFieldConfig | MultiSelectFieldConfig | CheckBoxGroupFieldConfig | RadioGroupFieldConfig | SwitchFieldConfig | CheckboxFieldConfig | DateFieldConfig | FileFieldConfig | ComputedFieldConfig | SectionFieldConfig | ButtonFieldConfig | RepeaterFieldConfig | FieldArrayFieldConfig;
|
|
295
|
+
export declare type NamozajField = ButtonConfig | TextFieldConfig | NumberFieldConfig | SliderFieldConfig | PhoneFieldConfig | GroupFieldConfig | SelectFieldConfig | MultiSelectFieldConfig | CheckBoxGroupFieldConfig | RadioGroupFieldConfig | SwitchFieldConfig | CheckboxFieldConfig | DateFieldConfig | FileFieldConfig | ComputedFieldConfig | SectionFieldConfig | ButtonFieldConfig | RepeaterFieldConfig | FieldArrayFieldConfig;
|
|
280
296
|
|
|
281
297
|
export declare type NamozajFormMethods = RHFFormMethods & {
|
|
282
298
|
validateForm: () => Promise<boolean>;
|
package/dist/namozaj.js
CHANGED
|
@@ -47999,7 +47999,7 @@ const moment = /* @__PURE__ */ getDefaultExportFromCjs(momentTimezoneExports), D
|
|
|
47999
47999
|
value: I,
|
|
48000
48000
|
onChange: H,
|
|
48001
48001
|
disabled: g,
|
|
48002
|
-
ampm: !N,
|
|
48002
|
+
ampm: ["time", "datetime"].includes(p) ? !N : void 0,
|
|
48003
48003
|
onError: (je) => {
|
|
48004
48004
|
var Xe, Ge, Be, Ue;
|
|
48005
48005
|
je === "minDate" && v ? u.setError(c, {
|
|
@@ -48038,10 +48038,16 @@ const moment = /* @__PURE__ */ getDefaultExportFromCjs(momentTimezoneExports), D
|
|
|
48038
48038
|
},
|
|
48039
48039
|
...["datetime"].includes(p) && {
|
|
48040
48040
|
minDateTime: L ? moment(
|
|
48041
|
-
(ve = (Re = K(
|
|
48041
|
+
(ve = (Re = K(
|
|
48042
|
+
L,
|
|
48043
|
+
"min"
|
|
48044
|
+
)) == null ? void 0 : Re.date) == null ? void 0 : ve.toISOString()
|
|
48042
48045
|
) : void 0,
|
|
48043
48046
|
maxDateTime: D ? moment(
|
|
48044
|
-
(we = (ye = K(
|
|
48047
|
+
(we = (ye = K(
|
|
48048
|
+
D,
|
|
48049
|
+
"max"
|
|
48050
|
+
)) == null ? void 0 : ye.date) == null ? void 0 : we.toISOString()
|
|
48045
48051
|
) : void 0
|
|
48046
48052
|
},
|
|
48047
48053
|
slotProps: {
|
|
@@ -86045,6 +86051,8 @@ const ConfirmationDialog = ({
|
|
|
86045
86051
|
return /* @__PURE__ */ jsx(FieldArrayField, { ...D });
|
|
86046
86052
|
case "group":
|
|
86047
86053
|
return /* @__PURE__ */ jsx(GroupField, { ...D });
|
|
86054
|
+
case "button":
|
|
86055
|
+
return /* @__PURE__ */ jsx(GroupField, { ...D });
|
|
86048
86056
|
default:
|
|
86049
86057
|
return null;
|
|
86050
86058
|
}
|