@applica-software-guru/react-admin 1.5.282 → 1.5.284
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/components/ra-forms/LongForm/Tab.d.ts.map +1 -1
- package/dist/components/ra-forms/WizardForm/Content.d.ts +15 -0
- package/dist/components/ra-forms/WizardForm/Content.d.ts.map +1 -0
- package/dist/components/ra-forms/WizardForm/Form.d.ts +38 -0
- package/dist/components/ra-forms/WizardForm/Form.d.ts.map +1 -0
- package/dist/components/ra-forms/WizardForm/Provider.d.ts +48 -0
- package/dist/components/ra-forms/WizardForm/Provider.d.ts.map +1 -0
- package/dist/components/ra-forms/WizardForm/Stepper.d.ts +18 -0
- package/dist/components/ra-forms/WizardForm/Stepper.d.ts.map +1 -0
- package/dist/components/ra-forms/WizardForm/Toolbar.d.ts +20 -0
- package/dist/components/ra-forms/WizardForm/Toolbar.d.ts.map +1 -0
- package/dist/components/ra-forms/WizardForm/index.d.ts +4 -0
- package/dist/components/ra-forms/WizardForm/index.d.ts.map +1 -0
- package/dist/components/ra-forms/index.d.ts +1 -0
- package/dist/components/ra-forms/index.d.ts.map +1 -1
- package/dist/react-admin.cjs.js +54 -54
- package/dist/react-admin.cjs.js.gz +0 -0
- package/dist/react-admin.cjs.js.map +1 -1
- package/dist/react-admin.es.js +8609 -8403
- package/dist/react-admin.es.js.gz +0 -0
- package/dist/react-admin.es.js.map +1 -1
- package/dist/react-admin.umd.js +54 -54
- package/dist/react-admin.umd.js.gz +0 -0
- package/dist/react-admin.umd.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/react.d.ts +14 -0
- package/dist/utils/react.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/ra-forms/LongForm/Tab.tsx +2 -11
- package/src/components/ra-forms/WizardForm/Content.tsx +94 -0
- package/src/components/ra-forms/WizardForm/Form.tsx +107 -0
- package/src/components/ra-forms/WizardForm/Provider.tsx +62 -0
- package/src/components/ra-forms/WizardForm/Stepper.tsx +113 -0
- package/src/components/ra-forms/WizardForm/Toolbar.tsx +58 -0
- package/src/components/ra-forms/WizardForm/index.ts +4 -0
- package/src/components/ra-forms/index.ts +1 -0
- package/src/playground/App.jsx +2 -1
- package/src/playground/components/ra-forms/TestWizardForm/AdvancedUsage.jsx +176 -0
- package/src/playground/components/ra-forms/TestWizardForm/BaseUsage.jsx +115 -0
- package/src/playground/components/ra-forms/TestWizardForm/TestWizardForm.jsx +27 -0
- package/src/playground/components/ra-forms/TestWizardForm/index.jsx +1 -0
- package/src/playground/components/ra-forms/index.jsx +1 -0
- package/src/playground/menu.jsx +8 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/react.ts +25 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tab.d.ts","sourceRoot":"","sources":["../../../../../src/components/ra-forms/LongForm/Tab.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAE7D,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Tab.d.ts","sourceRoot":"","sources":["../../../../../src/components/ra-forms/LongForm/Tab.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAE7D,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAInC,OAAO,KAAqE,MAAM,OAAO,CAAC;AAG1F,KAAK,cAAc,GAAG,KAAK,CAAC,iBAAiB,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,GAAG,OAAO,CAAC,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC,CAAC;AAC5G,KAAK,SAAS,GAAG,cAAc,CAAC;AAChC,KAAK,WAAW,GAAG,cAAc,CAAC;AAsDlC,iBAAS,KAAK,CAAC,KAAK,EAAE,WAAW,2CAWhC;AAED,iBAAS,GAAG,CAAC,KAAK,EAAE,SAAS,2CAE5B;AAED,iBAAS,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,iBAAiB,GAAG,KAAK,CAAC,KAAK,CAAC,wBAAwB,CAAC,cAAc,CAAC,CAAC,CAYlH;AAED,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
interface ContentProps {
|
|
3
|
+
title?: ReactNode | string;
|
|
4
|
+
subheader?: ReactNode | string;
|
|
5
|
+
secondary?: ReactNode | string;
|
|
6
|
+
toolbar?: ReactElement;
|
|
7
|
+
progress?: ReactNode;
|
|
8
|
+
isSmall: boolean;
|
|
9
|
+
modal: boolean;
|
|
10
|
+
sx?: any;
|
|
11
|
+
setCurrentStep: (step: number) => void;
|
|
12
|
+
}
|
|
13
|
+
declare function Content({ title, subheader, secondary, toolbar, progress, isSmall, modal, sx, setCurrentStep }: ContentProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export { Content };
|
|
15
|
+
//# sourceMappingURL=Content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../../../../src/components/ra-forms/WizardForm/Content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,YAAY,EAAE,SAAS,EAA2B,MAAM,OAAO,CAAC;AAUnF,UAAU,YAAY;IACpB,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC/B,SAAS,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC/B,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAED,iBAAS,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,YAAY,2CAqEpH;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { FormProps } from 'react-admin';
|
|
3
|
+
type WizardFormProps = FormProps & {
|
|
4
|
+
toolbar?: ReactElement;
|
|
5
|
+
progress?: ReactElement;
|
|
6
|
+
title?: ReactNode | string;
|
|
7
|
+
subheader?: ReactNode | string;
|
|
8
|
+
secondary?: ReactNode | string;
|
|
9
|
+
sx?: any;
|
|
10
|
+
modal?: boolean;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Form component for handling wizard-style forms with multiple steps.
|
|
14
|
+
*
|
|
15
|
+
* @param {object} props - The properties object.
|
|
16
|
+
* @param {React.ReactNode} props.children - The child components representing each step of the wizard.
|
|
17
|
+
* @param {React.ReactNode} props.toolbar - The toolbar component to be displayed.
|
|
18
|
+
* @param {React.ReactNode} props.progress - The progress indicator component.
|
|
19
|
+
* @param {string} props.title - The title of the form.
|
|
20
|
+
* @param {string | null} [props.subheader=null] - The subheader text of the form.
|
|
21
|
+
* @param {React.ReactNode | null} [props.secondary=null] - The secondary content of the form.
|
|
22
|
+
* @param {object} props.sx - The style object for custom styling.
|
|
23
|
+
* @param {boolean} [props.modal=false] - Flag indicating if the form is displayed in a modal.
|
|
24
|
+
* @param {object} props.rest - Additional properties passed to the form.
|
|
25
|
+
*
|
|
26
|
+
* @returns {JSX.Element | null} The rendered form component.
|
|
27
|
+
*/
|
|
28
|
+
declare function Form({ children, toolbar, progress, title, subheader, secondary, sx, modal, ...props }: WizardFormProps): JSX.Element | null;
|
|
29
|
+
declare namespace Form {
|
|
30
|
+
var Step: ({ children }: {
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
label: string;
|
|
33
|
+
icon?: ReactNode;
|
|
34
|
+
sources?: string[] | undefined;
|
|
35
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
}
|
|
37
|
+
export { Form };
|
|
38
|
+
//# sourceMappingURL=Form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../../../src/components/ra-forms/WizardForm/Form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,YAAY,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAkB,MAAM,aAAa,CAAC;AAIxD,KAAK,eAAe,GAAG,SAAS,GAAG;IACjC,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC/B,SAAS,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC/B,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAYF;;;;;;;;;;;;;;;GAeG;AACH,iBAAS,IAAI,CAAC,EACZ,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,KAAK,EACL,SAAgB,EAChB,SAAgB,EAChB,EAAE,EACF,KAAa,EACb,GAAG,KAAK,EACT,EAAE,eAAe,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CA8CtC;kBAxDQ,IAAI;;;;;;;;AAgEb,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
interface WizardFormContextValue {
|
|
3
|
+
currentStep: number;
|
|
4
|
+
steps: Array<ReactElement>;
|
|
5
|
+
hasNextStep: () => boolean;
|
|
6
|
+
hasPreviousStep: () => boolean;
|
|
7
|
+
goToNextStep: () => void;
|
|
8
|
+
goToPreviousStep: () => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Custom hook to access the wizard form context.
|
|
12
|
+
* This hook provides access to the current step, steps, and navigation methods
|
|
13
|
+
* for a wizard form.
|
|
14
|
+
*
|
|
15
|
+
* @throws Will throw an error if used outside of a `WizardFormProvider`.
|
|
16
|
+
*
|
|
17
|
+
* @property {number} currentStep - The index of the current step in the wizard form.
|
|
18
|
+
* @property {Array<ReactElement>} steps - An array of React elements representing the steps of the wizard form.
|
|
19
|
+
*
|
|
20
|
+
* @method hasNextStep
|
|
21
|
+
* @returns {boolean} - Returns true if there is a next step available, otherwise false.
|
|
22
|
+
*
|
|
23
|
+
* @method hasPreviousStep
|
|
24
|
+
* @returns {boolean} - Returns true if there is a previous step available, otherwise false.
|
|
25
|
+
*
|
|
26
|
+
* @method goToNextStep
|
|
27
|
+
* @returns {void} - Advances to the next step in the wizard form.
|
|
28
|
+
*
|
|
29
|
+
* @method goToPreviousStep
|
|
30
|
+
* @returns {void} - Goes back to the previous step in the wizard form.
|
|
31
|
+
*
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* const { hasNextStep, goToNextStep } = useWizardFormContext();
|
|
35
|
+
* return (
|
|
36
|
+
* <Button disabled={!hasNextStep} onClick={goToNextStep}>
|
|
37
|
+
* Next
|
|
38
|
+
* </Button>
|
|
39
|
+
* );
|
|
40
|
+
*/
|
|
41
|
+
declare function useWizardFormContext(): WizardFormContextValue;
|
|
42
|
+
interface WizardFormProviderProps {
|
|
43
|
+
value: WizardFormContextValue;
|
|
44
|
+
children: ReactNode;
|
|
45
|
+
}
|
|
46
|
+
declare function Provider({ value, children }: WizardFormProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export { Provider, useWizardFormContext };
|
|
48
|
+
//# sourceMappingURL=Provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../../../src/components/ra-forms/WizardForm/Provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAA6B,MAAM,OAAO,CAAC;AAE3E,UAAU,sBAAsB;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;IAC3B,WAAW,EAAE,MAAM,OAAO,CAAC;IAC3B,eAAe,EAAE,MAAM,OAAO,CAAC;IAC/B,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,iBAAS,oBAAoB,2BAM5B;AAED,UAAU,uBAAuB;IAC/B,KAAK,EAAE,sBAAsB,CAAC;IAC9B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,iBAAS,QAAQ,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,uBAAuB,2CAE7D;AAED,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface WizardStepperProps {
|
|
2
|
+
isHorizontal: boolean;
|
|
3
|
+
setCurrentStep: (step: number) => void;
|
|
4
|
+
stepFields: Array<Array<string>>;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Stepper component for rendering a step-by-step navigation UI.
|
|
8
|
+
*
|
|
9
|
+
* @param {Object} props - The properties object.
|
|
10
|
+
* @param {boolean} props.isHorizontal - Determines the orientation of the stepper (horizontal or vertical).
|
|
11
|
+
* @param {function} props.setCurrentStep - Function to set the current step index.
|
|
12
|
+
* @param {Array} props.stepFields - Array of fields associated with each step.
|
|
13
|
+
*
|
|
14
|
+
* @returns {JSX.Element} The rendered Stepper component.
|
|
15
|
+
*/
|
|
16
|
+
declare function Stepper({ isHorizontal, setCurrentStep, stepFields }: WizardStepperProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export { Stepper };
|
|
18
|
+
//# sourceMappingURL=Stepper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stepper.d.ts","sourceRoot":"","sources":["../../../../../src/components/ra-forms/WizardForm/Stepper.tsx"],"names":[],"mappings":"AAMA,UAAU,kBAAkB;IAC1B,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;CAClC;AAqDD;;;;;;;;;GASG;AACH,iBAAS,OAAO,CAAC,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,EAAE,kBAAkB,2CAqChF;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ToolbarProps } from '../../../components/ra-forms/Toolbar';
|
|
3
|
+
interface WizardToolbarProps extends ToolbarProps {
|
|
4
|
+
cancelButton?: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Toolbar component for the WizardForm.
|
|
8
|
+
*
|
|
9
|
+
* This component renders a toolbar with navigation buttons for a multi-step form.
|
|
10
|
+
* It includes buttons to navigate to the previous and next steps, as well as a cancel button.
|
|
11
|
+
*
|
|
12
|
+
* @param {WizardToolbarProps} props - The properties for the Toolbar component.
|
|
13
|
+
* @param {React.ReactElement} props.cancelButton - An optional cancel button element.
|
|
14
|
+
* @param {object} props.toolbarProps - Additional properties to pass to the RaToolbar component.
|
|
15
|
+
*
|
|
16
|
+
* @returns {JSX.Element} The rendered Toolbar component.
|
|
17
|
+
*/
|
|
18
|
+
declare function Toolbar({ cancelButton, ...props }: WizardToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export { Toolbar };
|
|
20
|
+
//# sourceMappingURL=Toolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../../../src/components/ra-forms/WizardForm/Toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA6B,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAwB,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAMnF,UAAU,kBAAmB,SAAQ,YAAY;IAC/C,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B;AAED;;;;;;;;;;;GAWG;AACH,iBAAS,OAAO,CAAC,EAAE,YAAY,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,2CA+B9D;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ra-forms/WizardForm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAElD,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ra-forms/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ra-forms/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC"}
|