@arkyn/components 3.0.1-beta.143 → 3.0.1-beta.144
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/alert/alertContainer/index.d.ts +27 -43
- package/dist/components/alert/alertContainer/index.d.ts.map +1 -1
- package/dist/components/alert/alertContainer/index.js +20 -40
- package/dist/components/alert/alertContent/index.d.ts +11 -36
- package/dist/components/alert/alertContent/index.d.ts.map +1 -1
- package/dist/components/alert/alertContent/index.js +11 -31
- package/dist/components/alert/alertDescription/index.d.ts +10 -38
- package/dist/components/alert/alertDescription/index.d.ts.map +1 -1
- package/dist/components/alert/alertDescription/index.js +10 -33
- package/dist/components/alert/alertIcon/index.d.ts +14 -38
- package/dist/components/alert/alertIcon/index.d.ts.map +1 -1
- package/dist/components/alert/alertIcon/index.js +14 -32
- package/dist/components/alert/alertTitle/index.d.ts +12 -35
- package/dist/components/alert/alertTitle/index.d.ts.map +1 -1
- package/dist/components/alert/alertTitle/index.js +12 -27
- package/dist/components/audioPlayer/index.d.ts +24 -32
- package/dist/components/audioPlayer/index.d.ts.map +1 -1
- package/dist/components/audioPlayer/index.js +15 -18
- package/dist/components/audioUpload/index.d.ts +37 -48
- package/dist/components/audioUpload/index.d.ts.map +1 -1
- package/dist/components/audioUpload/index.js +23 -48
- package/dist/components/badge/index.d.ts +31 -22
- package/dist/components/badge/index.d.ts.map +1 -1
- package/dist/components/badge/index.js +14 -22
- package/dist/components/button/index.d.ts +38 -28
- package/dist/components/button/index.d.ts.map +1 -1
- package/dist/components/button/index.js +18 -28
- package/dist/components/cardTab/cardTabButton/index.d.ts +14 -52
- package/dist/components/cardTab/cardTabButton/index.d.ts.map +1 -1
- package/dist/components/cardTab/cardTabButton/index.js +12 -52
- package/dist/components/cardTab/cardTabContainer/index.d.ts +16 -58
- package/dist/components/cardTab/cardTabContainer/index.d.ts.map +1 -1
- package/dist/components/cardTab/cardTabContainer/index.js +12 -58
- package/dist/components/checkbox/index.d.ts +38 -37
- package/dist/components/checkbox/index.d.ts.map +1 -1
- package/dist/components/checkbox/index.js +21 -37
- package/dist/components/clientOnly.d.ts +13 -66
- package/dist/components/clientOnly.d.ts.map +1 -1
- package/dist/components/clientOnly.js +11 -66
- package/dist/components/currencyInput/index.d.ts +67 -50
- package/dist/components/currencyInput/index.d.ts.map +1 -1
- package/dist/components/currencyInput/index.js +28 -50
- package/dist/components/divider/index.d.ts +12 -25
- package/dist/components/divider/index.d.ts.map +1 -1
- package/dist/components/divider/index.js +8 -25
- package/dist/components/drawer/drawerContainer/index.d.ts +16 -50
- package/dist/components/drawer/drawerContainer/index.d.ts.map +1 -1
- package/dist/components/drawer/drawerContainer/index.js +13 -50
- package/dist/components/drawer/drawerHeader/index.d.ts +9 -33
- package/dist/components/drawer/drawerHeader/index.d.ts.map +1 -1
- package/dist/components/drawer/drawerHeader/index.js +8 -33
- package/dist/components/facebookPixel/index.d.ts +47 -0
- package/dist/components/facebookPixel/index.d.ts.map +1 -1
- package/dist/components/facebookPixel/index.js +35 -0
- package/dist/components/fieldError/index.d.ts +4 -11
- package/dist/components/fieldError/index.d.ts.map +1 -1
- package/dist/components/fieldError/index.js +4 -11
- package/dist/components/fieldLabel/index.d.ts +6 -21
- package/dist/components/fieldLabel/index.d.ts.map +1 -1
- package/dist/components/fieldLabel/index.js +5 -21
- package/dist/components/fieldWrapper/index.d.ts +12 -22
- package/dist/components/fieldWrapper/index.d.ts.map +1 -1
- package/dist/components/fieldWrapper/index.js +7 -22
- package/dist/components/fileUpload/index.d.ts +36 -61
- package/dist/components/fileUpload/index.d.ts.map +1 -1
- package/dist/components/fileUpload/index.js +23 -61
- package/dist/components/googleAnalytics/index.d.ts +11 -7
- package/dist/components/googleAnalytics/index.d.ts.map +1 -1
- package/dist/components/googleAnalytics/index.js +9 -7
- package/dist/components/googleTagManager/index.d.ts +27 -21
- package/dist/components/googleTagManager/index.d.ts.map +1 -1
- package/dist/components/googleTagManager/index.js +20 -21
- package/dist/components/iconButton/index.d.ts +31 -15
- package/dist/components/iconButton/index.d.ts.map +1 -1
- package/dist/components/iconButton/index.js +12 -15
- package/dist/components/imageUpload/index.d.ts +47 -75
- package/dist/components/imageUpload/index.d.ts.map +1 -1
- package/dist/components/imageUpload/index.js +27 -75
- package/dist/components/input/index.d.ts +51 -44
- package/dist/components/input/index.d.ts.map +1 -1
- package/dist/components/input/index.js +24 -44
- package/dist/components/mapView/index.d.ts +44 -0
- package/dist/components/mapView/index.d.ts.map +1 -1
- package/dist/components/mapView/index.js +35 -0
- package/dist/components/maskedInput/index.d.ts +66 -51
- package/dist/components/maskedInput/index.d.ts.map +1 -1
- package/dist/components/maskedInput/index.js +28 -51
- package/dist/components/modal/modalContainer/index.d.ts +17 -57
- package/dist/components/modal/modalContainer/index.d.ts.map +1 -1
- package/dist/components/modal/modalContainer/index.js +15 -57
- package/dist/components/modal/modalFooter/index.d.ts +17 -50
- package/dist/components/modal/modalFooter/index.d.ts.map +1 -1
- package/dist/components/modal/modalFooter/index.js +10 -50
- package/dist/components/modal/modalHeader/index.d.ts +13 -47
- package/dist/components/modal/modalHeader/index.d.ts.map +1 -1
- package/dist/components/modal/modalHeader/index.js +12 -47
- package/dist/components/multiSelect/index.d.ts +67 -62
- package/dist/components/multiSelect/index.d.ts.map +1 -1
- package/dist/components/multiSelect/index.js +28 -62
- package/dist/components/pagination/index.d.ts +18 -9
- package/dist/components/pagination/index.d.ts.map +1 -1
- package/dist/components/pagination/index.js +18 -9
- package/dist/components/phoneInput/index.d.ts +65 -30
- package/dist/components/phoneInput/index.d.ts.map +1 -1
- package/dist/components/phoneInput/index.js +35 -30
- package/dist/components/popover/index.d.ts +34 -114
- package/dist/components/popover/index.d.ts.map +1 -1
- package/dist/components/popover/index.js +25 -114
- package/dist/components/radio/radioBox/index.d.ts +17 -65
- package/dist/components/radio/radioBox/index.d.ts.map +1 -1
- package/dist/components/radio/radioBox/index.js +14 -65
- package/dist/components/radio/radioGroup/index.d.ts +36 -67
- package/dist/components/radio/radioGroup/index.d.ts.map +1 -1
- package/dist/components/radio/radioGroup/index.js +25 -67
- package/dist/components/richText/index.d.ts +33 -47
- package/dist/components/richText/index.d.ts.map +1 -1
- package/dist/components/richText/index.js +30 -44
- package/dist/components/searchPlaces.d.ts +52 -50
- package/dist/components/searchPlaces.d.ts.map +1 -1
- package/dist/components/searchPlaces.js +23 -30
- package/dist/components/select/index.d.ts +68 -63
- package/dist/components/select/index.d.ts.map +1 -1
- package/dist/components/select/index.js +29 -63
- package/dist/components/slider/index.d.ts +20 -34
- package/dist/components/slider/index.d.ts.map +1 -1
- package/dist/components/slider/index.js +15 -33
- package/dist/components/switch/index.d.ts +42 -58
- package/dist/components/switch/index.d.ts.map +1 -1
- package/dist/components/switch/index.js +24 -58
- package/dist/components/tab/tabButton/index.d.ts +14 -52
- package/dist/components/tab/tabButton/index.d.ts.map +1 -1
- package/dist/components/tab/tabButton/index.js +12 -52
- package/dist/components/tab/tabContainer/index.d.ts +16 -58
- package/dist/components/tab/tabContainer/index.d.ts.map +1 -1
- package/dist/components/tab/tabContainer/index.js +12 -58
- package/dist/components/table/tableBody/index.d.ts +13 -47
- package/dist/components/table/tableBody/index.d.ts.map +1 -1
- package/dist/components/table/tableBody/index.js +12 -47
- package/dist/components/table/tableCaption/index.d.ts +6 -46
- package/dist/components/table/tableCaption/index.d.ts.map +1 -1
- package/dist/components/table/tableCaption/index.js +6 -46
- package/dist/components/table/tableContainer/index.d.ts +12 -41
- package/dist/components/table/tableContainer/index.d.ts.map +1 -1
- package/dist/components/table/tableContainer/index.js +12 -41
- package/dist/components/table/tableFooter/index.d.ts +5 -29
- package/dist/components/table/tableFooter/index.d.ts.map +1 -1
- package/dist/components/table/tableFooter/index.js +5 -29
- package/dist/components/table/tableHeader/index.d.ts +4 -25
- package/dist/components/table/tableHeader/index.d.ts.map +1 -1
- package/dist/components/table/tableHeader/index.js +4 -25
- package/dist/components/textarea/index.d.ts +32 -64
- package/dist/components/textarea/index.d.ts.map +1 -1
- package/dist/components/textarea/index.js +16 -64
- package/dist/components/tooltip/index.d.ts +27 -55
- package/dist/components/tooltip/index.d.ts.map +1 -1
- package/dist/components/tooltip/index.js +16 -55
- package/dist/hooks/useAutomation.d.ts +18 -26
- package/dist/hooks/useAutomation.d.ts.map +1 -1
- package/dist/hooks/useAutomation.js +18 -26
- package/dist/hooks/useDrawer.d.ts +19 -64
- package/dist/hooks/useDrawer.d.ts.map +1 -1
- package/dist/hooks/useForm.d.ts +12 -29
- package/dist/hooks/useForm.d.ts.map +1 -1
- package/dist/hooks/useForm.js +12 -29
- package/dist/hooks/useHydrated.d.ts +8 -63
- package/dist/hooks/useHydrated.d.ts.map +1 -1
- package/dist/hooks/useHydrated.js +8 -63
- package/dist/hooks/useModal.d.ts +19 -59
- package/dist/hooks/useModal.d.ts.map +1 -1
- package/dist/hooks/useScopedParams.d.ts +17 -69
- package/dist/hooks/useScopedParams.d.ts.map +1 -1
- package/dist/hooks/useScopedParams.js +17 -69
- package/dist/hooks/useScrollLock.d.ts +11 -27
- package/dist/hooks/useScrollLock.d.ts.map +1 -1
- package/dist/hooks/useScrollLock.js +11 -33
- package/dist/hooks/useSearchAutomation.d.ts +16 -34
- package/dist/hooks/useSearchAutomation.d.ts.map +1 -1
- package/dist/hooks/useSearchAutomation.js +16 -34
- package/dist/hooks/useSlider.d.ts +5 -19
- package/dist/hooks/useSlider.d.ts.map +1 -1
- package/dist/hooks/useSlider.js +5 -19
- package/dist/hooks/useToast.d.ts +8 -52
- package/dist/hooks/useToast.d.ts.map +1 -1
- package/dist/hooks/useToast.js +8 -52
- package/dist/providers/drawerProvider.d.ts +15 -81
- package/dist/providers/drawerProvider.d.ts.map +1 -1
- package/dist/providers/drawerProvider.js +15 -81
- package/dist/providers/formProvider.d.ts +17 -53
- package/dist/providers/formProvider.d.ts.map +1 -1
- package/dist/providers/formProvider.js +17 -53
- package/dist/providers/modalProvider.d.ts +16 -77
- package/dist/providers/modalProvider.d.ts.map +1 -1
- package/dist/providers/modalProvider.js +16 -77
- package/dist/providers/placesProvider.d.ts +16 -11
- package/dist/providers/placesProvider.d.ts.map +1 -1
- package/dist/providers/placesProvider.js +16 -11
- package/dist/providers/toastProvider.d.ts +10 -21
- package/dist/providers/toastProvider.d.ts.map +1 -1
- package/dist/providers/toastProvider.js +10 -21
- package/dist/services/toHtml.d.ts +11 -10
- package/dist/services/toHtml.d.ts.map +1 -1
- package/dist/services/toHtml.js +11 -10
- package/dist/services/toRichTextValue.d.ts +11 -17
- package/dist/services/toRichTextValue.d.ts.map +1 -1
- package/dist/services/toRichTextValue.js +11 -17
- package/package.json +1 -1
|
@@ -1,64 +1,30 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
2
|
import "./styles.css";
|
|
3
3
|
type ModalHeaderProps = HTMLAttributes<HTMLElement> & {
|
|
4
|
+
/** Whether to render the X close button. @default true */
|
|
4
5
|
showCloseButton?: boolean;
|
|
5
6
|
};
|
|
6
7
|
/**
|
|
7
|
-
* ModalHeader
|
|
8
|
+
* ModalHeader — header section for a `ModalContainer`, with an optional close button.
|
|
8
9
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
10
|
+
* The close button calls `makeInvisible` from the nearest `ModalContainer` context.
|
|
11
|
+
* Must be rendered inside a `ModalContainer`.
|
|
11
12
|
*
|
|
12
|
-
*
|
|
13
|
+
* @param props.showCloseButton - Renders the X close button. Default: true
|
|
13
14
|
*
|
|
14
|
-
*
|
|
15
|
+
* **...Other valid HTML `<header>` properties**
|
|
16
|
+
*
|
|
17
|
+
* @returns ModalHeader JSX element.
|
|
15
18
|
*
|
|
16
19
|
* @example
|
|
17
20
|
* ```tsx
|
|
18
|
-
* // Basic modal header with close button
|
|
19
|
-
* <ModalHeader>
|
|
20
|
-
* <h2>Modal Title</h2>
|
|
21
|
-
* </ModalHeader>
|
|
22
|
-
*
|
|
23
|
-
* // Header without close button
|
|
24
|
-
* <ModalHeader showCloseButton={false}>
|
|
25
|
-
* <h2>Important Notice</h2>
|
|
26
|
-
* </ModalHeader>
|
|
27
|
-
*
|
|
28
|
-
* // Header with subtitle
|
|
29
|
-
* <ModalHeader>
|
|
30
|
-
* <div>
|
|
31
|
-
* <h2>Settings</h2>
|
|
32
|
-
* <p>Manage your preferences</p>
|
|
33
|
-
* </div>
|
|
34
|
-
* </ModalHeader>
|
|
35
|
-
*
|
|
36
|
-
* // Complete modal example
|
|
37
21
|
* <ModalContainer isVisible={isOpen} makeInvisible={() => setIsOpen(false)}>
|
|
38
|
-
* <
|
|
39
|
-
* <
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* <main>
|
|
45
|
-
* <p>Are you sure you want to delete this item?</p>
|
|
46
|
-
* </main>
|
|
47
|
-
*
|
|
48
|
-
* <ModalFooter>
|
|
49
|
-
* <button onClick={() => setIsOpen(false)}>Cancel</button>
|
|
50
|
-
* <button onClick={handleDelete}>Delete</button>
|
|
51
|
-
* </ModalFooter>
|
|
52
|
-
* </div>
|
|
22
|
+
* <ModalHeader>
|
|
23
|
+
* <h2>Edit profile</h2>
|
|
24
|
+
* </ModalHeader>
|
|
25
|
+
* <main>...</main>
|
|
26
|
+
* <ModalFooter><Button onClick={onSave}>Save</Button></ModalFooter>
|
|
53
27
|
* </ModalContainer>
|
|
54
|
-
*
|
|
55
|
-
* // Custom styled header
|
|
56
|
-
* <ModalHeader className="custom-header">
|
|
57
|
-
* <div className="header-content">
|
|
58
|
-
* <img src="/icon.png" alt="Icon" />
|
|
59
|
-
* <h1>Welcome</h1>
|
|
60
|
-
* </div>
|
|
61
|
-
* </ModalHeader>
|
|
62
28
|
* ```
|
|
63
29
|
*/
|
|
64
30
|
declare function ModalHeader(args: ModalHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/modal/modalHeader/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,cAAc,CAAC;AAEtB,KAAK,gBAAgB,GAAG,cAAc,CAAC,WAAW,CAAC,GAAG;IACpD,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/modal/modalHeader/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,cAAc,CAAC;AAEtB,KAAK,gBAAgB,GAAG,cAAc,CAAC,WAAW,CAAC,GAAG;IACpD,0DAA0D;IAC1D,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,iBAAS,WAAW,CAAC,IAAI,EAAE,gBAAgB,2CA2B1C;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -3,61 +3,26 @@ import { X } from "lucide-react";
|
|
|
3
3
|
import { useModal } from "../modalContext";
|
|
4
4
|
import "./styles.css";
|
|
5
5
|
/**
|
|
6
|
-
* ModalHeader
|
|
6
|
+
* ModalHeader — header section for a `ModalContainer`, with an optional close button.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* The close button calls `makeInvisible` from the nearest `ModalContainer` context.
|
|
9
|
+
* Must be rendered inside a `ModalContainer`.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
11
|
+
* @param props.showCloseButton - Renders the X close button. Default: true
|
|
12
12
|
*
|
|
13
|
-
*
|
|
13
|
+
* **...Other valid HTML `<header>` properties**
|
|
14
|
+
*
|
|
15
|
+
* @returns ModalHeader JSX element.
|
|
14
16
|
*
|
|
15
17
|
* @example
|
|
16
18
|
* ```tsx
|
|
17
|
-
* // Basic modal header with close button
|
|
18
|
-
* <ModalHeader>
|
|
19
|
-
* <h2>Modal Title</h2>
|
|
20
|
-
* </ModalHeader>
|
|
21
|
-
*
|
|
22
|
-
* // Header without close button
|
|
23
|
-
* <ModalHeader showCloseButton={false}>
|
|
24
|
-
* <h2>Important Notice</h2>
|
|
25
|
-
* </ModalHeader>
|
|
26
|
-
*
|
|
27
|
-
* // Header with subtitle
|
|
28
|
-
* <ModalHeader>
|
|
29
|
-
* <div>
|
|
30
|
-
* <h2>Settings</h2>
|
|
31
|
-
* <p>Manage your preferences</p>
|
|
32
|
-
* </div>
|
|
33
|
-
* </ModalHeader>
|
|
34
|
-
*
|
|
35
|
-
* // Complete modal example
|
|
36
19
|
* <ModalContainer isVisible={isOpen} makeInvisible={() => setIsOpen(false)}>
|
|
37
|
-
* <
|
|
38
|
-
* <
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* <main>
|
|
44
|
-
* <p>Are you sure you want to delete this item?</p>
|
|
45
|
-
* </main>
|
|
46
|
-
*
|
|
47
|
-
* <ModalFooter>
|
|
48
|
-
* <button onClick={() => setIsOpen(false)}>Cancel</button>
|
|
49
|
-
* <button onClick={handleDelete}>Delete</button>
|
|
50
|
-
* </ModalFooter>
|
|
51
|
-
* </div>
|
|
20
|
+
* <ModalHeader>
|
|
21
|
+
* <h2>Edit profile</h2>
|
|
22
|
+
* </ModalHeader>
|
|
23
|
+
* <main>...</main>
|
|
24
|
+
* <ModalFooter><Button onClick={onSave}>Save</Button></ModalFooter>
|
|
52
25
|
* </ModalContainer>
|
|
53
|
-
*
|
|
54
|
-
* // Custom styled header
|
|
55
|
-
* <ModalHeader className="custom-header">
|
|
56
|
-
* <div className="header-content">
|
|
57
|
-
* <img src="/icon.png" alt="Icon" />
|
|
58
|
-
* <h1>Welcome</h1>
|
|
59
|
-
* </div>
|
|
60
|
-
* </ModalHeader>
|
|
61
26
|
* ```
|
|
62
27
|
*/
|
|
63
28
|
function ModalHeader(args) {
|
|
@@ -1,127 +1,132 @@
|
|
|
1
1
|
import { LucideIcon } from "lucide-react";
|
|
2
2
|
import { FocusEvent } from "react";
|
|
3
3
|
type MultiSelectProps = {
|
|
4
|
+
/** Field name for form submission. Required. */
|
|
4
5
|
name: string;
|
|
6
|
+
/** Array of selectable options. Required. */
|
|
5
7
|
options: {
|
|
6
8
|
label: string;
|
|
7
9
|
value: string;
|
|
8
10
|
}[];
|
|
11
|
+
/** Optional HTML id for the underlying hidden input. */
|
|
9
12
|
id?: string;
|
|
13
|
+
/** Controlled array of selected values. */
|
|
10
14
|
value?: string[];
|
|
15
|
+
/** Uncontrolled default array of selected values. @default [] */
|
|
11
16
|
defaultValue?: string[];
|
|
17
|
+
/** Displays an asterisk on the label to signal a required field. */
|
|
12
18
|
showAsterisk?: boolean;
|
|
19
|
+
/** Optional label text displayed above the multiselect. */
|
|
13
20
|
label?: string;
|
|
21
|
+
/** Validation error message displayed below the multiselect. */
|
|
14
22
|
errorMessage?: string;
|
|
23
|
+
/** Placeholder text shown when no options are selected. @default "Selecione..." */
|
|
15
24
|
placeholder?: string;
|
|
25
|
+
/** Text shown when no options match the search query. @default "Sem opções disponíveis" */
|
|
16
26
|
notFoundText?: string;
|
|
27
|
+
/** Additional CSS class applied to the wrapper element. */
|
|
17
28
|
className?: string;
|
|
29
|
+
/** Disables all interactions. @default false */
|
|
18
30
|
disabled?: boolean;
|
|
31
|
+
/** Prevents value changes while keeping the current selection visible. @default false */
|
|
19
32
|
readOnly?: boolean;
|
|
33
|
+
/** Shows a loading spinner and disables interactions. @default false */
|
|
20
34
|
isLoading?: boolean;
|
|
35
|
+
/** Enables search/filter within the dropdown. @default false */
|
|
21
36
|
isSearchable?: boolean;
|
|
37
|
+
/** Closes the dropdown after an option is selected or deselected. @default false */
|
|
22
38
|
closeOnSelect?: boolean;
|
|
39
|
+
/** Callback fired when the search query changes. Use for async option loading. */
|
|
23
40
|
onSearch?: (value: string) => void;
|
|
41
|
+
/** Callback fired when the selected values array changes. */
|
|
24
42
|
onChange?: (value: string[]) => void;
|
|
43
|
+
/** Callback fired when the multiselect gains focus. */
|
|
25
44
|
onFocus?: () => void;
|
|
45
|
+
/** Callback fired when the multiselect loses focus. */
|
|
26
46
|
onBlur?: (e: FocusEvent<HTMLDivElement>) => void;
|
|
47
|
+
/**
|
|
48
|
+
* MultiSelect size.
|
|
49
|
+
* @default "md"
|
|
50
|
+
*/
|
|
27
51
|
size?: "md" | "lg";
|
|
52
|
+
/**
|
|
53
|
+
* Visual style variant.
|
|
54
|
+
* - `solid`: filled background.
|
|
55
|
+
* - `outline`: bordered, transparent background.
|
|
56
|
+
* - `underline`: bottom border only.
|
|
57
|
+
* @default "solid"
|
|
58
|
+
*/
|
|
28
59
|
variant?: "solid" | "outline" | "underline";
|
|
60
|
+
/** Text or icon rendered at the far left, outside the select area. */
|
|
29
61
|
prefix?: string | LucideIcon;
|
|
62
|
+
/** Lucide icon rendered inside the select on the left. */
|
|
30
63
|
leftIcon?: LucideIcon;
|
|
64
|
+
/** Maximum height (in px) of the options dropdown. */
|
|
31
65
|
optionMaxHeight?: number;
|
|
66
|
+
/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */
|
|
32
67
|
unShowFieldTemplate?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Layout direction forwarded to `FieldTemplate`.
|
|
70
|
+
* @default "horizontal"
|
|
71
|
+
*/
|
|
33
72
|
orientation?: "horizontal" | "vertical" | "horizontalReverse";
|
|
34
73
|
};
|
|
35
74
|
/**
|
|
36
|
-
* MultiSelect
|
|
75
|
+
* MultiSelect — multi-option dropdown with optional search, label, validation, and form integration.
|
|
37
76
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* @param props.options - Array of options with label and value properties
|
|
41
|
-
* @param props.id - Optional unique identifier for the component
|
|
42
|
-
* @param props.value - Controlled value array of selected option values
|
|
43
|
-
* @param props.defaultValue - Default selected values. Default: []
|
|
44
|
-
* @param props.showAsterisk - Whether to show asterisk on label for required fields
|
|
45
|
-
* @param props.label - Optional label text to display above the multiselect
|
|
46
|
-
* @param props.errorMessage - Error message to display below the multiselect
|
|
47
|
-
* @param props.placeholder - Placeholder text when no options are selected. Default: "Selecione..."
|
|
48
|
-
* @param props.notFoundText - Text to display when no options match search. Default: "Sem opções disponíveis"
|
|
49
|
-
* @param props.className - Additional CSS classes to apply
|
|
50
|
-
* @param props.disabled - Whether the multiselect is disabled. Default: false
|
|
51
|
-
* @param props.readOnly - Whether the multiselect is read-only. Default: false
|
|
52
|
-
* @param props.isLoading - Controls loading state with spinner. Default: false
|
|
53
|
-
* @param props.isSearchable - Whether the multiselect supports search functionality. Default: false
|
|
54
|
-
* @param props.closeOnSelect - Whether to close dropdown after selecting an option. Default: false
|
|
55
|
-
* @param props.onSearch - Callback function called when search value changes
|
|
56
|
-
* @param props.onChange - Callback function called when selected values change
|
|
57
|
-
* @param props.onFocus - Callback function called when multiselect gains focus
|
|
58
|
-
* @param props.onBlur - Callback function called when multiselect loses focus
|
|
59
|
-
* @param props.size - MultiSelect size. Default: "md"
|
|
60
|
-
* @param props.variant - Visual variant of the multiselect. Default: "solid"
|
|
61
|
-
* @param props.prefix - Text or icon to display at the beginning of the multiselect
|
|
62
|
-
* @param props.leftIcon - Optional icon to display on the left side
|
|
63
|
-
* @param props.optionMaxHeight - Maximum height for the options dropdown
|
|
64
|
-
* @param props.unShowFieldTemplate - When true, skips `FieldTemplate` structure (wrapper, label and error text) and renders only the checkbox button content.
|
|
65
|
-
* @param props.orientation - Layout direction forwarded to `FieldTemplate`/`FieldWrapper` (`horizontal`, `vertical`, `horizontalReverse`). Default: "horizontalReverse"
|
|
77
|
+
* Selected values are stored as a JSON array in a hidden `<input>` for form submission.
|
|
78
|
+
* Integrates with `useForm` to display validation errors by field name.
|
|
66
79
|
*
|
|
67
|
-
* @
|
|
80
|
+
* @param props.name - Field name for form submission. Required.
|
|
81
|
+
* @param props.options - Array of selectable options (`{ label, value }`). Required.
|
|
82
|
+
* @param props.value - Controlled array of selected values.
|
|
83
|
+
* @param props.defaultValue - Uncontrolled default selection. Default: []
|
|
84
|
+
* @param props.label - Label text displayed above the multiselect.
|
|
85
|
+
* @param props.placeholder - Placeholder shown when nothing is selected. Default: "Selecione..."
|
|
86
|
+
* @param props.errorMessage - Validation error message.
|
|
87
|
+
* @param props.isSearchable - Enables search/filter within the dropdown. Default: false
|
|
88
|
+
* @param props.isLoading - Shows a loading spinner and disables interactions. Default: false
|
|
89
|
+
* @param props.closeOnSelect - Closes the dropdown after toggling an option. Default: false
|
|
90
|
+
* @param props.onChange - Callback fired when the selection changes.
|
|
91
|
+
* @param props.onSearch - Callback fired when the search query changes.
|
|
92
|
+
* @param props.size - MultiSelect size (`md` | `lg`). Default: "md"
|
|
93
|
+
* @param props.variant - Visual style variant. Default: "solid"
|
|
94
|
+
* @param props.orientation - Layout direction. Default: "horizontal"
|
|
95
|
+
* @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false
|
|
96
|
+
*
|
|
97
|
+
* @returns MultiSelect JSX element wrapped in `FieldTemplate`.
|
|
68
98
|
*
|
|
69
99
|
* @example
|
|
70
100
|
* ```tsx
|
|
71
|
-
* // Basic
|
|
101
|
+
* // Basic
|
|
72
102
|
* <MultiSelect
|
|
73
103
|
* name="categories"
|
|
74
104
|
* options={[
|
|
75
105
|
* { label: "Technology", value: "tech" },
|
|
76
106
|
* { label: "Design", value: "design" },
|
|
77
|
-
* { label: "Marketing", value: "marketing" }
|
|
78
107
|
* ]}
|
|
79
108
|
* />
|
|
80
109
|
*
|
|
81
|
-
* //
|
|
110
|
+
* // With label, validation, and searchable
|
|
82
111
|
* <MultiSelect
|
|
83
112
|
* name="skills"
|
|
84
|
-
* label="
|
|
113
|
+
* label="Skills"
|
|
85
114
|
* showAsterisk
|
|
86
|
-
* errorMessage="Please select at least one skill"
|
|
87
|
-
* options={skillOptions}
|
|
88
|
-
* placeholder="Choose your skills..."
|
|
89
|
-
* />
|
|
90
|
-
*
|
|
91
|
-
* // Searchable multiselect with custom styling
|
|
92
|
-
* <MultiSelect
|
|
93
|
-
* name="countries"
|
|
94
|
-
* label="Countries"
|
|
95
115
|
* isSearchable
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
* leftIcon={GlobeIcon}
|
|
99
|
-
* options={countryOptions}
|
|
100
|
-
* notFoundText="No countries found"
|
|
116
|
+
* options={skillOptions}
|
|
117
|
+
* errorMessage={errors.skills}
|
|
101
118
|
* />
|
|
102
119
|
*
|
|
103
|
-
* // Controlled
|
|
120
|
+
* // Controlled with async search
|
|
104
121
|
* <MultiSelect
|
|
105
122
|
* name="tags"
|
|
106
123
|
* label="Tags"
|
|
107
124
|
* value={selectedTags}
|
|
108
125
|
* onChange={setSelectedTags}
|
|
109
|
-
* onSearch={
|
|
110
|
-
* closeOnSelect={false}
|
|
126
|
+
* onSearch={fetchTagOptions}
|
|
111
127
|
* isLoading={isLoadingTags}
|
|
112
128
|
* options={tagOptions}
|
|
113
129
|
* />
|
|
114
|
-
*
|
|
115
|
-
* // MultiSelect with prefix and custom behavior
|
|
116
|
-
* <MultiSelect
|
|
117
|
-
* name="departments"
|
|
118
|
-
* label="Departments"
|
|
119
|
-
* prefix="Dept:"
|
|
120
|
-
* closeOnSelect={true}
|
|
121
|
-
* variant="underline"
|
|
122
|
-
* defaultValue={["hr", "it"]}
|
|
123
|
-
* options={departmentOptions}
|
|
124
|
-
* />
|
|
125
130
|
* ```
|
|
126
131
|
*/
|
|
127
132
|
declare function MultiSelect(props: MultiSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/multiSelect/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAA2B,MAAM,OAAO,CAAC;AAe5D,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/multiSelect/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAA2B,MAAM,OAAO,CAAC;AAe5D,KAAK,gBAAgB,GAAG;IACtB,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5C,wDAAwD;IACxD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,iEAAiE;IACjE,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,oEAAoE;IACpE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mFAAmF;IACnF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2FAA2F;IAC3F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yFAAyF;IACzF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wEAAwE;IACxE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gEAAgE;IAChE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,oFAAoF;IACpF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACrC,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,uDAAuD;IACvD,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IACjD;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;IAC5C,sEAAsE;IACtE,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAC7B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,sDAAsD;IACtD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,sFAAsF;IACtF,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;OAGG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,mBAAmB,CAAC;CAC/D,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEH,iBAAS,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CA8K3C;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -12,95 +12,61 @@ import { MultiSelectOptionsContainer } from "./multiSelectOptionsContainer";
|
|
|
12
12
|
import { MultiSelectOverlay } from "./multiSelectOverlay";
|
|
13
13
|
import { MultiSelectSpinner } from "./multiSelectSpinner";
|
|
14
14
|
/**
|
|
15
|
-
* MultiSelect
|
|
15
|
+
* MultiSelect — multi-option dropdown with optional search, label, validation, and form integration.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* @param props.options - Array of options with label and value properties
|
|
20
|
-
* @param props.id - Optional unique identifier for the component
|
|
21
|
-
* @param props.value - Controlled value array of selected option values
|
|
22
|
-
* @param props.defaultValue - Default selected values. Default: []
|
|
23
|
-
* @param props.showAsterisk - Whether to show asterisk on label for required fields
|
|
24
|
-
* @param props.label - Optional label text to display above the multiselect
|
|
25
|
-
* @param props.errorMessage - Error message to display below the multiselect
|
|
26
|
-
* @param props.placeholder - Placeholder text when no options are selected. Default: "Selecione..."
|
|
27
|
-
* @param props.notFoundText - Text to display when no options match search. Default: "Sem opções disponíveis"
|
|
28
|
-
* @param props.className - Additional CSS classes to apply
|
|
29
|
-
* @param props.disabled - Whether the multiselect is disabled. Default: false
|
|
30
|
-
* @param props.readOnly - Whether the multiselect is read-only. Default: false
|
|
31
|
-
* @param props.isLoading - Controls loading state with spinner. Default: false
|
|
32
|
-
* @param props.isSearchable - Whether the multiselect supports search functionality. Default: false
|
|
33
|
-
* @param props.closeOnSelect - Whether to close dropdown after selecting an option. Default: false
|
|
34
|
-
* @param props.onSearch - Callback function called when search value changes
|
|
35
|
-
* @param props.onChange - Callback function called when selected values change
|
|
36
|
-
* @param props.onFocus - Callback function called when multiselect gains focus
|
|
37
|
-
* @param props.onBlur - Callback function called when multiselect loses focus
|
|
38
|
-
* @param props.size - MultiSelect size. Default: "md"
|
|
39
|
-
* @param props.variant - Visual variant of the multiselect. Default: "solid"
|
|
40
|
-
* @param props.prefix - Text or icon to display at the beginning of the multiselect
|
|
41
|
-
* @param props.leftIcon - Optional icon to display on the left side
|
|
42
|
-
* @param props.optionMaxHeight - Maximum height for the options dropdown
|
|
43
|
-
* @param props.unShowFieldTemplate - When true, skips `FieldTemplate` structure (wrapper, label and error text) and renders only the checkbox button content.
|
|
44
|
-
* @param props.orientation - Layout direction forwarded to `FieldTemplate`/`FieldWrapper` (`horizontal`, `vertical`, `horizontalReverse`). Default: "horizontalReverse"
|
|
17
|
+
* Selected values are stored as a JSON array in a hidden `<input>` for form submission.
|
|
18
|
+
* Integrates with `useForm` to display validation errors by field name.
|
|
45
19
|
*
|
|
46
|
-
* @
|
|
20
|
+
* @param props.name - Field name for form submission. Required.
|
|
21
|
+
* @param props.options - Array of selectable options (`{ label, value }`). Required.
|
|
22
|
+
* @param props.value - Controlled array of selected values.
|
|
23
|
+
* @param props.defaultValue - Uncontrolled default selection. Default: []
|
|
24
|
+
* @param props.label - Label text displayed above the multiselect.
|
|
25
|
+
* @param props.placeholder - Placeholder shown when nothing is selected. Default: "Selecione..."
|
|
26
|
+
* @param props.errorMessage - Validation error message.
|
|
27
|
+
* @param props.isSearchable - Enables search/filter within the dropdown. Default: false
|
|
28
|
+
* @param props.isLoading - Shows a loading spinner and disables interactions. Default: false
|
|
29
|
+
* @param props.closeOnSelect - Closes the dropdown after toggling an option. Default: false
|
|
30
|
+
* @param props.onChange - Callback fired when the selection changes.
|
|
31
|
+
* @param props.onSearch - Callback fired when the search query changes.
|
|
32
|
+
* @param props.size - MultiSelect size (`md` | `lg`). Default: "md"
|
|
33
|
+
* @param props.variant - Visual style variant. Default: "solid"
|
|
34
|
+
* @param props.orientation - Layout direction. Default: "horizontal"
|
|
35
|
+
* @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false
|
|
36
|
+
*
|
|
37
|
+
* @returns MultiSelect JSX element wrapped in `FieldTemplate`.
|
|
47
38
|
*
|
|
48
39
|
* @example
|
|
49
40
|
* ```tsx
|
|
50
|
-
* // Basic
|
|
41
|
+
* // Basic
|
|
51
42
|
* <MultiSelect
|
|
52
43
|
* name="categories"
|
|
53
44
|
* options={[
|
|
54
45
|
* { label: "Technology", value: "tech" },
|
|
55
46
|
* { label: "Design", value: "design" },
|
|
56
|
-
* { label: "Marketing", value: "marketing" }
|
|
57
47
|
* ]}
|
|
58
48
|
* />
|
|
59
49
|
*
|
|
60
|
-
* //
|
|
50
|
+
* // With label, validation, and searchable
|
|
61
51
|
* <MultiSelect
|
|
62
52
|
* name="skills"
|
|
63
|
-
* label="
|
|
53
|
+
* label="Skills"
|
|
64
54
|
* showAsterisk
|
|
65
|
-
* errorMessage="Please select at least one skill"
|
|
66
|
-
* options={skillOptions}
|
|
67
|
-
* placeholder="Choose your skills..."
|
|
68
|
-
* />
|
|
69
|
-
*
|
|
70
|
-
* // Searchable multiselect with custom styling
|
|
71
|
-
* <MultiSelect
|
|
72
|
-
* name="countries"
|
|
73
|
-
* label="Countries"
|
|
74
55
|
* isSearchable
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* leftIcon={GlobeIcon}
|
|
78
|
-
* options={countryOptions}
|
|
79
|
-
* notFoundText="No countries found"
|
|
56
|
+
* options={skillOptions}
|
|
57
|
+
* errorMessage={errors.skills}
|
|
80
58
|
* />
|
|
81
59
|
*
|
|
82
|
-
* // Controlled
|
|
60
|
+
* // Controlled with async search
|
|
83
61
|
* <MultiSelect
|
|
84
62
|
* name="tags"
|
|
85
63
|
* label="Tags"
|
|
86
64
|
* value={selectedTags}
|
|
87
65
|
* onChange={setSelectedTags}
|
|
88
|
-
* onSearch={
|
|
89
|
-
* closeOnSelect={false}
|
|
66
|
+
* onSearch={fetchTagOptions}
|
|
90
67
|
* isLoading={isLoadingTags}
|
|
91
68
|
* options={tagOptions}
|
|
92
69
|
* />
|
|
93
|
-
*
|
|
94
|
-
* // MultiSelect with prefix and custom behavior
|
|
95
|
-
* <MultiSelect
|
|
96
|
-
* name="departments"
|
|
97
|
-
* label="Departments"
|
|
98
|
-
* prefix="Dept:"
|
|
99
|
-
* closeOnSelect={true}
|
|
100
|
-
* variant="underline"
|
|
101
|
-
* defaultValue={["hr", "it"]}
|
|
102
|
-
* options={departmentOptions}
|
|
103
|
-
* />
|
|
104
70
|
* ```
|
|
105
71
|
*/
|
|
106
72
|
function MultiSelect(props) {
|
|
@@ -29,22 +29,31 @@ type PaginationProps = {
|
|
|
29
29
|
onChange?: (page: number) => void;
|
|
30
30
|
} & Omit<HTMLAttributes<HTMLDivElement>, "onChange">;
|
|
31
31
|
/**
|
|
32
|
-
* Pagination
|
|
32
|
+
* Pagination — navigation control for paginated data sets.
|
|
33
|
+
*
|
|
34
|
+
* Renders page number buttons, prev/next arrows, and spread indicators (…)
|
|
35
|
+
* when the page count exceeds the visible range.
|
|
36
|
+
*
|
|
37
|
+
* @param props.totalCountRegisters - Total number of records. Required.
|
|
38
|
+
* @param props.currentPage - The currently active page (1-indexed). Required.
|
|
39
|
+
* @param props.registerPerPage - Records per page. Default: 10
|
|
40
|
+
* @param props.siblingsCount - Number of sibling pages visible on each side of the current page. Default: 1
|
|
41
|
+
* @param props.onChange - Callback fired when the user selects a different page.
|
|
42
|
+
*
|
|
43
|
+
* **...Other valid HTML properties for `<div>`**
|
|
44
|
+
*
|
|
45
|
+
* @returns Pagination JSX element.
|
|
33
46
|
*
|
|
34
|
-
* @component
|
|
35
47
|
* @example
|
|
36
48
|
* ```tsx
|
|
37
49
|
* <Pagination
|
|
38
|
-
* totalCountRegisters={
|
|
39
|
-
* currentPage={
|
|
40
|
-
* registerPerPage={
|
|
50
|
+
* totalCountRegisters={250}
|
|
51
|
+
* currentPage={page}
|
|
52
|
+
* registerPerPage={20}
|
|
41
53
|
* siblingsCount={1}
|
|
42
|
-
* onChange={(
|
|
54
|
+
* onChange={(p) => setPage(p)}
|
|
43
55
|
* />
|
|
44
56
|
* ```
|
|
45
|
-
*
|
|
46
|
-
* @param props - The component props
|
|
47
|
-
* @returns A pagination navigation component with page numbers and navigation buttons
|
|
48
57
|
*/
|
|
49
58
|
declare function Pagination(props: PaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
50
59
|
export { Pagination };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/pagination/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAQvC,OAAO,cAAc,CAAC;AAEtB;;GAEG;AACH,KAAK,eAAe,GAAG;IACrB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,CAAC;AAErD
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/pagination/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAQvC,OAAO,cAAc,CAAC;AAEtB;;GAEG;AACH,KAAK,eAAe,GAAG;IACrB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,iBAAS,UAAU,CAAC,KAAK,EAAE,eAAe,2CA6EzC;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -6,22 +6,31 @@ import { PaginationService } from "./paginationService";
|
|
|
6
6
|
import { Spread } from "./spread";
|
|
7
7
|
import "./styles.css";
|
|
8
8
|
/**
|
|
9
|
-
* Pagination
|
|
9
|
+
* Pagination — navigation control for paginated data sets.
|
|
10
|
+
*
|
|
11
|
+
* Renders page number buttons, prev/next arrows, and spread indicators (…)
|
|
12
|
+
* when the page count exceeds the visible range.
|
|
13
|
+
*
|
|
14
|
+
* @param props.totalCountRegisters - Total number of records. Required.
|
|
15
|
+
* @param props.currentPage - The currently active page (1-indexed). Required.
|
|
16
|
+
* @param props.registerPerPage - Records per page. Default: 10
|
|
17
|
+
* @param props.siblingsCount - Number of sibling pages visible on each side of the current page. Default: 1
|
|
18
|
+
* @param props.onChange - Callback fired when the user selects a different page.
|
|
19
|
+
*
|
|
20
|
+
* **...Other valid HTML properties for `<div>`**
|
|
21
|
+
*
|
|
22
|
+
* @returns Pagination JSX element.
|
|
10
23
|
*
|
|
11
|
-
* @component
|
|
12
24
|
* @example
|
|
13
25
|
* ```tsx
|
|
14
26
|
* <Pagination
|
|
15
|
-
* totalCountRegisters={
|
|
16
|
-
* currentPage={
|
|
17
|
-
* registerPerPage={
|
|
27
|
+
* totalCountRegisters={250}
|
|
28
|
+
* currentPage={page}
|
|
29
|
+
* registerPerPage={20}
|
|
18
30
|
* siblingsCount={1}
|
|
19
|
-
* onChange={(
|
|
31
|
+
* onChange={(p) => setPage(p)}
|
|
20
32
|
* />
|
|
21
33
|
* ```
|
|
22
|
-
*
|
|
23
|
-
* @param props - The component props
|
|
24
|
-
* @returns A pagination navigation component with page numbers and navigation buttons
|
|
25
34
|
*/
|
|
26
35
|
function Pagination(props) {
|
|
27
36
|
const { totalCountRegisters: baseTotalCountRegisters, siblingsCount: baseSiblingsCount, currentPage: baseCurrentPage, registerPerPage: baseRegisterPerPage, onChange: baseOnChange, ...rest } = props;
|