@instincthub/react-ui 0.1.49 → 0.1.51
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/README.md +23 -8
- package/dist/node_modules/.pnpm/xlsx@https___cdn.sheetjs.com_xlsx-0.20.3_xlsx-0.20.3.tgz/node_modules/xlsx/xlsx.mjs.js +2 -2
- package/dist/node_modules/.pnpm/xlsx@https___cdn.sheetjs.com_xlsx-0.20.3_xlsx-0.20.3.tgz/node_modules/xlsx/xlsx.mjs.js.map +1 -1
- package/dist/src/assets/css/forms/forms-index.css +1 -0
- package/dist/src/assets/css/forms/input-fields.css +163 -11
- package/dist/src/assets/css/forms/s3-multi-uploader.css +208 -0
- package/dist/src/components/auth/LoginForm.js +1 -1
- package/dist/src/components/auth/ReactClientProviders.js +1 -1
- package/dist/src/components/forms/ChipsInput.js +1 -1
- package/dist/src/components/forms/PhoneNumberInput.js +1 -1
- package/dist/src/components/forms/SearchFieldDB.js +1 -1
- package/dist/src/components/forms/SearchObjectsFromDB.js +1 -1
- package/dist/src/components/forms/SearchableDropdown.js +1 -1
- package/dist/src/components/forms/uploads/S3MultiUploader.js +2 -0
- package/dist/src/components/forms/uploads/S3MultiUploader.js.map +1 -0
- package/dist/src/components/lib/index.js +1 -1
- package/dist/src/components/lib/index.js.map +1 -1
- package/dist/src/components/lib/phoneUtils.js +2 -0
- package/dist/src/components/lib/phoneUtils.js.map +1 -0
- package/dist/src/components/navbar/ChannelListAvatar.js +1 -1
- package/dist/src/components/navbar/ResponsiveNavbar.js +1 -1
- package/dist/src/components/navbar/SideNavbar.js +1 -1
- package/dist/src/components/status/ModalExamples.js +1 -1
- package/dist/src/components/ui/ComponentLists.js +1 -1
- package/dist/src/components/ui/pagination/Pagination.js +1 -1
- package/dist/src/components/ui/pagination/PaginationDemo.js +1 -1
- package/dist/src/components/ui/tables/IHubTable.js +1 -1
- package/dist/src/components/ui/tables/IHubTableServer.js +1 -1
- package/dist/src/components/ui/tables/utils/exportValues.js +2 -0
- package/dist/src/components/ui/tables/utils/exportValues.js.map +1 -0
- package/dist/src/components/ui/tables/utils/exportWriters.js +2 -0
- package/dist/src/components/ui/tables/utils/exportWriters.js.map +1 -0
- package/dist/src/components/ui/tables/utils/tableExport.js +2 -0
- package/dist/src/components/ui/tables/utils/tableExport.js.map +1 -0
- package/dist/src/index.js +1 -1
- package/dist/src/types/__examples__/.next/types/app/components/forms/layout.d.ts +13 -0
- package/dist/src/types/__examples__/.next/types/app/components/forms/phone-number-input/page.d.ts +13 -0
- package/dist/src/types/__examples__/.next/types/app/components/layout.d.ts +13 -0
- package/dist/src/types/__examples__/.next/types/app/components/page.d.ts +13 -0
- package/dist/src/types/__examples__/.next/types/app/components/ui/s3-multi-uploader/page.d.ts +13 -0
- package/dist/src/types/__examples__/.next/types/app/layout.d.ts +13 -0
- package/dist/src/types/__examples__/.next/types/app/page.d.ts +13 -0
- package/dist/src/types/__examples__/.next/types/validator.d.ts +1 -0
- package/dist/src/types/__examples__/next.config.d.ts +3 -0
- package/dist/src/types/__examples__/src/app/api/auth/[...nextauth]/route.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/api/auth/login/route.d.ts +2 -0
- package/dist/src/types/__examples__/src/app/api/components/docs/route.d.ts +14 -0
- package/dist/src/types/__examples__/src/app/api/components/recommend/route.d.ts +14 -0
- package/dist/src/types/__examples__/src/app/api/components/search/route.d.ts +50 -0
- package/dist/src/types/__examples__/src/app/api/fallback/route.d.ts +34 -0
- package/dist/src/types/__examples__/src/app/api/generate/route.d.ts +14 -0
- package/dist/src/types/__examples__/src/app/api/help/route.d.ts +14 -0
- package/dist/src/types/__examples__/src/app/api/mcp/route.d.ts +10 -0
- package/dist/src/types/__examples__/src/app/auth/layout.d.ts +4 -0
- package/dist/src/types/__examples__/src/app/auth/login/page.d.ts +2 -0
- package/dist/src/types/__examples__/src/app/auth/password-match/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/code-display/layout.d.ts +4 -0
- package/dist/src/types/__examples__/src/app/code-display/page.d.ts +3 -0
- package/dist/src/types/__examples__/src/app/components/auth/client-detector/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/auth/login-form/page.d.ts +2 -0
- package/dist/src/types/__examples__/src/app/components/auth/signup-form/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/auth/username-email-checker/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/charts/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/action-dropdown/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/animated-box/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/checkboxes/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/chips-input/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/date-input/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/date-input-picker/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/date-range-picker/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/drop-file/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/email-list/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/file-uploader/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/filter-array/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/filter-objects/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/form-error/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/input-amount/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/input-number/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/input-text/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/input-textarea/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/layout.d.ts +4 -0
- package/dist/src/types/__examples__/src/app/components/forms/message-display/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/multiple-email/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/password-field/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/phone-number-input/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/radio-button/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/search-field/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/search-objects-from-db/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/searchable-dropdown/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/time-picker/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/toggle-button/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/forms/uploads/ihub-file-uploader/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/layout.d.ts +4 -0
- package/dist/src/types/__examples__/src/app/components/navbars/breadcrumb/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/navbars/responsive-navbar/page.d.ts +2 -0
- package/dist/src/types/__examples__/src/app/components/navbars/sidenav/page.d.ts +2 -0
- package/dist/src/types/__examples__/src/app/components/navbars/tabs/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/actions/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/badges/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/card-grid/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/card-list/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/cards/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/color-picker/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/content-view-or-edit/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/content-viewer/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/create-button/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/dangerous-renderer/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/dialogs/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/dropdowns/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/ihub-text-editor/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/modals/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/or-divider/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/pagination/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/random-gradient-image/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/s3-multi-uploader/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/table-examples/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/table-server-examples/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/components/ui/text-editor/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/cursors/page.d.ts +2 -0
- package/dist/src/types/__examples__/src/app/examples/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/layout.d.ts +11 -0
- package/dist/src/types/__examples__/src/app/libs/examples/loadscript/page.d.ts +8 -0
- package/dist/src/types/__examples__/src/app/libs/examples/modals/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/libs/examples/paystacks/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/libs/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/app/page.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/ComponentListing.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/Forms.d.ts +2 -0
- package/dist/src/types/__examples__/src/components/Modals.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/TestComponent.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/TestPage.d.ts +2 -0
- package/dist/src/types/__examples__/src/components/auth/ClientDetectorExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/auth/IsUsernameEmailTakenExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/auth/LoginFormExample.d.ts +4 -0
- package/dist/src/types/__examples__/src/components/auth/SignUpFormExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/auths/LoginExample.d.ts +4 -0
- package/dist/src/types/__examples__/src/components/auths/PasswordsMatchExample.d.ts +2 -0
- package/dist/src/types/__examples__/src/components/forms/ActionDropdownExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/AnimatedBoxExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/CheckboxesFieldExamples.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/ChipsInputExample.d.ts +6 -0
- package/dist/src/types/__examples__/src/components/forms/DateInputExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/DateInputPickerExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/DateInputPickerTimeExample.d.ts +10 -0
- package/dist/src/types/__examples__/src/components/forms/DateRangePickerExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/DateTimePickerExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/DropFileExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/EmailListExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/FileUploaderExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/FilterArrayExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/FilterObjectsExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/FormErrorExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/InputAmountExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/InputNumberExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/InputTextExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/InputTextareaExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/MessageDisplayExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/MultipleEmailExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/PasswordFieldExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/PhoneNumberInputExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/RadioButtonExample.d.ts +6 -0
- package/dist/src/types/__examples__/src/components/forms/SearchFieldExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/SearchObjectsFromDBExample.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/forms/SearchableDropdownExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/SignUpFormExample.d.ts +6 -0
- package/dist/src/types/__examples__/src/components/forms/SubmitBtnExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/TextFieldExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/TimePickerExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/ToggleButtonExample.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/forms/uploads/IhubFileUploaderDocs.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/forms/uploads/IhubFileUploaderSample.d.ts +6 -0
- package/dist/src/types/__examples__/src/components/navbars/BreadcrumbExample.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/navbars/CursorProviders.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/navbars/MainFooter.d.ts +2 -0
- package/dist/src/types/__examples__/src/components/navbars/MainNavigation.d.ts +2 -0
- package/dist/src/types/__examples__/src/components/navbars/PageNavigation.d.ts +2 -0
- package/dist/src/types/__examples__/src/components/navbars/ResponsiveNavbarControlledExample.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/navbars/ResponsiveNavbarExample.d.ts +2 -0
- package/dist/src/types/__examples__/src/components/navbars/SideNavbarExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/navbars/TabsExample.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/tabs/TabsDemo.d.ts +2 -0
- package/dist/src/types/__examples__/src/components/tabs/TabsExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/tabs/VerticalTabsExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/ActionExamples.d.ts +2 -0
- package/dist/src/types/__examples__/src/components/ui/BadgeExamples.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/CardExamples.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/ui/CardGridExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/CardListExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/ChartExamples.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/CodebaseLink.d.ts +4 -0
- package/dist/src/types/__examples__/src/components/ui/ColorPickerExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/ContentFormTextEditor.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/ui/ContentViewOrEditExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/ContentViewOrEditSample.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/ui/ContentViewerExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/CreateButtonExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/CustomTextEditorExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/DangerousRendererExample.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/ui/DialogExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/DropdownExamples.d.ts +2 -0
- package/dist/src/types/__examples__/src/components/ui/IHubTextEditorExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/ListStylesDemo.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/ui/ListStylesDemoTwo.d.ts +1 -0
- package/dist/src/types/__examples__/src/components/ui/OrDividerExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/PaginationExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/RandomGradientImageExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/S3MultiUploaderExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/StatusIconExample.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/TableExamples.d.ts +3 -0
- package/dist/src/types/__examples__/src/components/ui/TableServerExamples.d.ts +1 -0
- package/dist/src/types/__examples__/src/lib/api.d.ts +29 -0
- package/dist/src/types/__examples__/src/lib/hooks.d.ts +76 -0
- package/dist/src/types/__examples__/src/types/components.d.ts +144 -0
- package/dist/src/types/assets/svgs/SVGs.d.ts +36 -0
- package/dist/src/types/components/forms/PhoneNumberInput.d.ts +56 -13
- package/dist/src/types/components/forms/index.d.ts +1 -0
- package/dist/src/types/components/forms/uploads/S3MultiUploader.d.ts +19 -0
- package/dist/src/types/components/lib/index.d.ts +1 -0
- package/dist/src/types/components/lib/phoneUtils.d.ts +99 -0
- package/dist/src/types/components/lib/redux/slices/channelSlice/channelDetails.d.ts +1 -1
- package/dist/src/types/components/lib/redux/slices/channelSlice/instructorChannelList.d.ts +1 -1
- package/dist/src/types/components/lib/redux/slices/courseSlice/courseDetails.d.ts +1 -1
- package/dist/src/types/components/lib/redux/slices/courseSlice/courseFilterDuration.d.ts +2 -2
- package/dist/src/types/components/lib/redux/slices/courseSlice/courseFilterLevel.d.ts +2 -2
- package/dist/src/types/components/lib/redux/slices/courseSlice/courseFilterSubject.d.ts +2 -2
- package/dist/src/types/components/lib/redux/slices/courseSlice/courseModules.d.ts +3 -3
- package/dist/src/types/components/lib/redux/slices/courseSlice/courseOverview.d.ts +1 -1
- package/dist/src/types/components/lib/redux/slices/courseSlice/courseSearch.d.ts +1 -1
- package/dist/src/types/components/lib/redux/slices/courseSlice/stepContent.d.ts +1 -1
- package/dist/src/types/components/lib/redux/slices/courseSlice/stepQuestions.d.ts +6 -6
- package/dist/src/types/components/lib/redux/slices/courseSlice/videoTimestamp.d.ts +1 -1
- package/dist/src/types/components/lib/redux/slices/courseSlice/videoTimestampObject.d.ts +1 -1
- package/dist/src/types/components/lib/redux/slices/navigationSlice/IPAdress.d.ts +1 -1
- package/dist/src/types/components/navbar/ResponsiveNavbar.d.ts +2 -0
- package/dist/src/types/components/ui/tables/IHubTable.d.ts +5 -8
- package/dist/src/types/components/ui/tables/IHubTableServer.d.ts +5 -8
- package/dist/src/types/components/ui/tables/utils/exportValues.d.ts +32 -0
- package/dist/src/types/components/ui/tables/utils/exportWriters.d.ts +17 -0
- package/dist/src/types/components/ui/tables/utils/tableExport.d.ts +42 -0
- package/dist/src/types/index.d.ts +4 -0
- package/dist/src/types/types/index.d.ts +111 -5
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { S3MultiUploaderProps } from "@/types";
|
|
2
|
+
/**
|
|
3
|
+
* S3MultiUploader — multi-file queue uploader with per-file progress.
|
|
4
|
+
*
|
|
5
|
+
* Security model: this component never touches AWS credentials. It calls
|
|
6
|
+
* `getPresignedUrl(file)` — a consumer-supplied async function that must
|
|
7
|
+
* hit a server endpoint. The server validates the request (auth, MIME,
|
|
8
|
+
* size, location) and returns a short-lived presigned PUT URL together
|
|
9
|
+
* with the resolved object key and CDN URL.
|
|
10
|
+
*
|
|
11
|
+
* Example server route (Next.js API):
|
|
12
|
+
*
|
|
13
|
+
* POST /api/upload/presign
|
|
14
|
+
* Body: { name, type, size }
|
|
15
|
+
* → { url, key, cdnUrl } (url = S3 presigned PUT, expires in 60s)
|
|
16
|
+
*
|
|
17
|
+
* CSS: import "@instincthub/react-ui/assets/css/forms/s3-multi-uploader.css"
|
|
18
|
+
*/
|
|
19
|
+
export default function S3MultiUploader({ accepts, maxFileSizeBytes, maxFiles, concurrency, getPresignedUrl, label, hint, onFileComplete, onQueueComplete, onError, disabled, className, }: S3MultiUploaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -13,6 +13,7 @@ export { default as getPriceObjects } from "./getPriceObjects";
|
|
|
13
13
|
export { default as convertArrayToObject } from "./convertArrayToObject";
|
|
14
14
|
export { default as loadScript } from "./loadScript";
|
|
15
15
|
export * from "./format";
|
|
16
|
+
export * from "./phoneUtils";
|
|
16
17
|
export * from "./helpFunction";
|
|
17
18
|
export * from "./oauth_json";
|
|
18
19
|
export * from "./paystack";
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A country entry augmented with a normalised, digits-only dial code.
|
|
3
|
+
* The raw dataset stores `phonecode` inconsistently ("234", "+1-242",
|
|
4
|
+
* "0055", "+1-787 and 1-939"), so `dialCode` is the value to rely on.
|
|
5
|
+
*/
|
|
6
|
+
export interface PhoneCountryType {
|
|
7
|
+
name: string;
|
|
8
|
+
isoCode: string;
|
|
9
|
+
flag: string;
|
|
10
|
+
phonecode: string;
|
|
11
|
+
dialCode: string;
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}
|
|
14
|
+
export interface ParsedPhoneNumberType {
|
|
15
|
+
/** Country detected from an explicit dial code, if any. */
|
|
16
|
+
country?: PhoneCountryType;
|
|
17
|
+
/** Digits-only dial code that was stripped off, if any. */
|
|
18
|
+
dialCode?: string;
|
|
19
|
+
/** Subscriber number with the dial code and trunk prefix removed. */
|
|
20
|
+
nationalNumber: string;
|
|
21
|
+
/** True when a dial code was found and removed from the input. */
|
|
22
|
+
matchedCountryCode: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface PhoneNumberValueType {
|
|
25
|
+
/** Display form of the dial code, e.g. "+234". */
|
|
26
|
+
phoneCode: string;
|
|
27
|
+
/** Digits-only dial code, e.g. "234". */
|
|
28
|
+
dialCode: string;
|
|
29
|
+
/** Subscriber number without dial code or trunk prefix, e.g. "8031234567". */
|
|
30
|
+
nationalNumber: string;
|
|
31
|
+
/** Storage form, e.g. "+2348031234567". Empty when there is no number. */
|
|
32
|
+
e164: string;
|
|
33
|
+
/** Human readable form, e.g. "+234 803 123 4567". */
|
|
34
|
+
formatted: string;
|
|
35
|
+
isoCode: string;
|
|
36
|
+
countryName: string;
|
|
37
|
+
flag: string;
|
|
38
|
+
isValid: boolean;
|
|
39
|
+
}
|
|
40
|
+
/** E.164 caps dial code + national number at 15 digits. */
|
|
41
|
+
export declare const E164_MAX_DIGITS = 15;
|
|
42
|
+
/** Shortest national number we treat as plausible when splitting a paste. */
|
|
43
|
+
export declare const MIN_NATIONAL_DIGITS = 4;
|
|
44
|
+
/**
|
|
45
|
+
* A national number (no dial code) never exceeds this in practice. Anything
|
|
46
|
+
* longer that was pasted without a "+" almost certainly embeds a dial code.
|
|
47
|
+
*/
|
|
48
|
+
export declare const MAX_NATIONAL_DIGITS = 11;
|
|
49
|
+
/**
|
|
50
|
+
* Reduce a raw `phonecode` to digits only.
|
|
51
|
+
* "+1-242" -> "1242", "0055" -> "55", "+1-787 and 1-939" -> "1787".
|
|
52
|
+
*/
|
|
53
|
+
export declare const normalizeDialCode: (phonecode?: string | null) => string;
|
|
54
|
+
/** Every country, with a usable `dialCode`, sorted alphabetically by name. */
|
|
55
|
+
export declare const PHONE_COUNTRIES: PhoneCountryType[];
|
|
56
|
+
/** Strip everything except digits. */
|
|
57
|
+
export declare const digitsOnly: (value?: string | null) => string;
|
|
58
|
+
/** Longest national number allowed for a dial code, per E.164. */
|
|
59
|
+
export declare const maxNationalDigits: (dialCode?: string | null) => number;
|
|
60
|
+
export declare const findCountryByIso: (isoCode?: string | null) => PhoneCountryType | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Resolve the country that owns a dial code. `preferIso` wins when it is one
|
|
63
|
+
* of the holders, which keeps the current selection stable while typing.
|
|
64
|
+
*/
|
|
65
|
+
export declare const findCountryByDialCode: (dialCode: string, preferIso?: string | null) => PhoneCountryType | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Accepts anything a caller might pass as a country: "234", "+234", "+1-242",
|
|
68
|
+
* "NG", "ng" or "Nigeria".
|
|
69
|
+
*/
|
|
70
|
+
export declare const resolveCountry: (value?: string | null, preferIso?: string | null) => PhoneCountryType | undefined;
|
|
71
|
+
/** Greedy longest-prefix dial code match against a digits-only string. */
|
|
72
|
+
export declare const matchDialCode: (digits: string, preferIso?: string | null) => ParsedPhoneNumberType | null;
|
|
73
|
+
/**
|
|
74
|
+
* Split a phone number into a country and a national number.
|
|
75
|
+
*
|
|
76
|
+
* Explicit international input ("+234…" or "00234…") always attempts a dial
|
|
77
|
+
* code match. Input without that prefix is treated as national — a leading
|
|
78
|
+
* trunk "0" is dropped and the current country is kept — unless `aggressive`
|
|
79
|
+
* is set, which is what paste and blur use to also recognise a bare
|
|
80
|
+
* "2348031234567".
|
|
81
|
+
*/
|
|
82
|
+
export declare const parsePhoneNumber: (raw: string, options?: {
|
|
83
|
+
currentCountry?: PhoneCountryType | null;
|
|
84
|
+
aggressive?: boolean;
|
|
85
|
+
}) => ParsedPhoneNumberType;
|
|
86
|
+
/** Group a national number for display: "8031234567" -> "803 123 4567". */
|
|
87
|
+
export declare const formatNationalNumber: (nationalNumber?: string | null) => string;
|
|
88
|
+
/** Build the full value object a consumer stores or submits. */
|
|
89
|
+
export declare const buildPhoneValue: (country: PhoneCountryType, nationalNumber?: string | null) => PhoneNumberValueType;
|
|
90
|
+
/**
|
|
91
|
+
* Filter countries by name, ISO code or dial code, ranked so the most likely
|
|
92
|
+
* match sorts first. "ng", "nigeria", "234" and "+234" all find Nigeria.
|
|
93
|
+
*/
|
|
94
|
+
export declare const searchCountries: (query?: string | null, countries?: PhoneCountryType[]) => PhoneCountryType[];
|
|
95
|
+
/**
|
|
96
|
+
* Move a set of ISO codes to the top of the list, preserving their given
|
|
97
|
+
* order. Used for the `preferredCountries` prop.
|
|
98
|
+
*/
|
|
99
|
+
export declare const withPreferredCountries: (preferredIsoCodes?: string[] | null, countries?: PhoneCountryType[]) => PhoneCountryType[];
|
|
@@ -3,7 +3,7 @@ import { channelDetailsSliceState } from "@/types/redux";
|
|
|
3
3
|
export declare const channelDetails: import("@reduxjs/toolkit").Slice<channelDetailsSliceState, {
|
|
4
4
|
set: (state: {
|
|
5
5
|
value: object;
|
|
6
|
-
status: "
|
|
6
|
+
status: "loading" | "failed" | "idle";
|
|
7
7
|
id: string;
|
|
8
8
|
}, action: PayloadAction<object>) => void;
|
|
9
9
|
}, "channelDetails", "channelDetails", import("@reduxjs/toolkit").SliceSelectors<channelDetailsSliceState>>;
|
|
@@ -3,7 +3,7 @@ import { instructorChannelListSliceState } from "@/types/redux";
|
|
|
3
3
|
export declare const instructorChannelList: import("@reduxjs/toolkit").Slice<instructorChannelListSliceState, {
|
|
4
4
|
set: (state: {
|
|
5
5
|
value: string[];
|
|
6
|
-
status: "
|
|
6
|
+
status: "loading" | "failed" | "idle";
|
|
7
7
|
id: string;
|
|
8
8
|
}, action: PayloadAction<[]>) => void;
|
|
9
9
|
}, "instructorChannelList", "instructorChannelList", import("@reduxjs/toolkit").SliceSelectors<instructorChannelListSliceState>>;
|
|
@@ -3,7 +3,7 @@ import { courseDetailsSliceState } from "@/types/redux";
|
|
|
3
3
|
export declare const courseDetails: import("@reduxjs/toolkit").Slice<courseDetailsSliceState, {
|
|
4
4
|
set: (state: {
|
|
5
5
|
value: object;
|
|
6
|
-
status: "
|
|
6
|
+
status: "loading" | "failed" | "idle";
|
|
7
7
|
id: string;
|
|
8
8
|
}, action: PayloadAction<object>) => void;
|
|
9
9
|
}, "courseDetails", "courseDetails", import("@reduxjs/toolkit").SliceSelectors<courseDetailsSliceState>>;
|
|
@@ -3,10 +3,10 @@ import { courseFilterDurationSliceState } from "@/types/redux";
|
|
|
3
3
|
export declare const courseFilterDuration: import("@reduxjs/toolkit").Slice<courseFilterDurationSliceState, {
|
|
4
4
|
increment: (state: {
|
|
5
5
|
value: string[];
|
|
6
|
-
status: "
|
|
6
|
+
status: "loading" | "failed" | "idle";
|
|
7
7
|
}, action: PayloadAction<string>) => void;
|
|
8
8
|
decrement: (state: {
|
|
9
9
|
value: string[];
|
|
10
|
-
status: "
|
|
10
|
+
status: "loading" | "failed" | "idle";
|
|
11
11
|
}, action: PayloadAction<string>) => void;
|
|
12
12
|
}, "filterDuration", "filterDuration", import("@reduxjs/toolkit").SliceSelectors<courseFilterDurationSliceState>>;
|
|
@@ -3,10 +3,10 @@ import { courseFilterLevelSliceState } from "@/types/redux";
|
|
|
3
3
|
export declare const courseFilterLevel: import("@reduxjs/toolkit").Slice<courseFilterLevelSliceState, {
|
|
4
4
|
increment: (state: {
|
|
5
5
|
value: string[];
|
|
6
|
-
status: "
|
|
6
|
+
status: "loading" | "failed" | "idle";
|
|
7
7
|
}, action: PayloadAction<string>) => void;
|
|
8
8
|
decrement: (state: {
|
|
9
9
|
value: string[];
|
|
10
|
-
status: "
|
|
10
|
+
status: "loading" | "failed" | "idle";
|
|
11
11
|
}, action: PayloadAction<string>) => void;
|
|
12
12
|
}, "filterLevel", "filterLevel", import("@reduxjs/toolkit").SliceSelectors<courseFilterLevelSliceState>>;
|
|
@@ -3,10 +3,10 @@ import { courseFilterSubjectSliceState } from "@/types/redux";
|
|
|
3
3
|
export declare const courseFilterSubject: import("@reduxjs/toolkit").Slice<courseFilterSubjectSliceState, {
|
|
4
4
|
increment: (state: {
|
|
5
5
|
value: number[];
|
|
6
|
-
status: "
|
|
6
|
+
status: "loading" | "failed" | "idle";
|
|
7
7
|
}, action: PayloadAction<number>) => void;
|
|
8
8
|
decrement: (state: {
|
|
9
9
|
value: number[];
|
|
10
|
-
status: "
|
|
10
|
+
status: "loading" | "failed" | "idle";
|
|
11
11
|
}, action: PayloadAction<number>) => void;
|
|
12
12
|
}, "filterSubject", "filterSubject", import("@reduxjs/toolkit").SliceSelectors<courseFilterSubjectSliceState>>;
|
|
@@ -6,20 +6,20 @@ export declare const courseModules: import("@reduxjs/toolkit").Slice<CourseModul
|
|
|
6
6
|
id: string;
|
|
7
7
|
title: string;
|
|
8
8
|
}[];
|
|
9
|
-
status: "
|
|
9
|
+
status: "loading" | "failed" | "idle";
|
|
10
10
|
}, action: PayloadAction<CourseModule[]>) => void;
|
|
11
11
|
addModule: (state: {
|
|
12
12
|
value: {
|
|
13
13
|
id: string;
|
|
14
14
|
title: string;
|
|
15
15
|
}[];
|
|
16
|
-
status: "
|
|
16
|
+
status: "loading" | "failed" | "idle";
|
|
17
17
|
}, action: PayloadAction<CourseModule>) => void;
|
|
18
18
|
decrement: (state: {
|
|
19
19
|
value: {
|
|
20
20
|
id: string;
|
|
21
21
|
title: string;
|
|
22
22
|
}[];
|
|
23
|
-
status: "
|
|
23
|
+
status: "loading" | "failed" | "idle";
|
|
24
24
|
}, action: PayloadAction<string>) => void;
|
|
25
25
|
}, "courseModules", "courseModules", import("@reduxjs/toolkit").SliceSelectors<CourseModulesSliceState>>;
|
|
@@ -3,7 +3,7 @@ import { courseOverviewSliceState } from "@/types/redux";
|
|
|
3
3
|
export declare const courseOverview: import("@reduxjs/toolkit").Slice<courseOverviewSliceState, {
|
|
4
4
|
set: (state: {
|
|
5
5
|
value: object;
|
|
6
|
-
status: "
|
|
6
|
+
status: "loading" | "failed" | "idle";
|
|
7
7
|
id: string;
|
|
8
8
|
}, action: PayloadAction<object>) => void;
|
|
9
9
|
}, "courseOverview", "courseOverview", import("@reduxjs/toolkit").SliceSelectors<courseOverviewSliceState>>;
|
|
@@ -3,6 +3,6 @@ import { courseSearchSliceState } from "@/types/redux";
|
|
|
3
3
|
export declare const courseSearch: import("@reduxjs/toolkit").Slice<courseSearchSliceState, {
|
|
4
4
|
input: (state: {
|
|
5
5
|
value: string;
|
|
6
|
-
status: "
|
|
6
|
+
status: "loading" | "failed" | "idle";
|
|
7
7
|
}, action: PayloadAction<string>) => void;
|
|
8
8
|
}, "courseSearch", "courseSearch", import("@reduxjs/toolkit").SliceSelectors<courseSearchSliceState>>;
|
|
@@ -3,7 +3,7 @@ import { stepContentSliceState } from "@/types/redux";
|
|
|
3
3
|
export declare const stepContent: import("@reduxjs/toolkit").Slice<stepContentSliceState, {
|
|
4
4
|
set: (state: {
|
|
5
5
|
value: object;
|
|
6
|
-
status: "
|
|
6
|
+
status: "loading" | "failed" | "idle";
|
|
7
7
|
id: string;
|
|
8
8
|
}, action: PayloadAction<object>) => void;
|
|
9
9
|
}, "stepContent", "stepContent", import("@reduxjs/toolkit").SliceSelectors<stepContentSliceState>>;
|
|
@@ -13,7 +13,7 @@ export declare const stepQuestions: import("@reduxjs/toolkit").Slice<CourseFilte
|
|
|
13
13
|
likes: number;
|
|
14
14
|
types: string;
|
|
15
15
|
}[];
|
|
16
|
-
status: "
|
|
16
|
+
status: "loading" | "failed" | "idle";
|
|
17
17
|
id: string;
|
|
18
18
|
}, action: PayloadAction<Question[]>) => void;
|
|
19
19
|
increment: (state: {
|
|
@@ -28,7 +28,7 @@ export declare const stepQuestions: import("@reduxjs/toolkit").Slice<CourseFilte
|
|
|
28
28
|
likes: number;
|
|
29
29
|
types: string;
|
|
30
30
|
}[];
|
|
31
|
-
status: "
|
|
31
|
+
status: "loading" | "failed" | "idle";
|
|
32
32
|
id: string;
|
|
33
33
|
}, action: PayloadAction<Question>) => void;
|
|
34
34
|
decrement: (state: {
|
|
@@ -43,7 +43,7 @@ export declare const stepQuestions: import("@reduxjs/toolkit").Slice<CourseFilte
|
|
|
43
43
|
likes: number;
|
|
44
44
|
types: string;
|
|
45
45
|
}[];
|
|
46
|
-
status: "
|
|
46
|
+
status: "loading" | "failed" | "idle";
|
|
47
47
|
id: string;
|
|
48
48
|
}, action: PayloadAction<string>) => void;
|
|
49
49
|
answer: (state: {
|
|
@@ -58,7 +58,7 @@ export declare const stepQuestions: import("@reduxjs/toolkit").Slice<CourseFilte
|
|
|
58
58
|
likes: number;
|
|
59
59
|
types: string;
|
|
60
60
|
}[];
|
|
61
|
-
status: "
|
|
61
|
+
status: "loading" | "failed" | "idle";
|
|
62
62
|
id: string;
|
|
63
63
|
}, action: PayloadAction<{
|
|
64
64
|
question: string;
|
|
@@ -76,7 +76,7 @@ export declare const stepQuestions: import("@reduxjs/toolkit").Slice<CourseFilte
|
|
|
76
76
|
likes: number;
|
|
77
77
|
types: string;
|
|
78
78
|
}[];
|
|
79
|
-
status: "
|
|
79
|
+
status: "loading" | "failed" | "idle";
|
|
80
80
|
id: string;
|
|
81
81
|
}, action: PayloadAction<{
|
|
82
82
|
question: string;
|
|
@@ -96,7 +96,7 @@ export declare const stepQuestions: import("@reduxjs/toolkit").Slice<CourseFilte
|
|
|
96
96
|
likes: number;
|
|
97
97
|
types: string;
|
|
98
98
|
}[];
|
|
99
|
-
status: "
|
|
99
|
+
status: "loading" | "failed" | "idle";
|
|
100
100
|
id: string;
|
|
101
101
|
}, action: PayloadAction<{
|
|
102
102
|
answer_question_id: string;
|
|
@@ -3,6 +3,6 @@ import { videoTimestampSliceState } from "@/types/redux";
|
|
|
3
3
|
export declare const videoTimestamp: import("@reduxjs/toolkit").Slice<videoTimestampSliceState, {
|
|
4
4
|
seconds: (state: {
|
|
5
5
|
value: object;
|
|
6
|
-
status: "
|
|
6
|
+
status: "loading" | "failed" | "idle";
|
|
7
7
|
}, action: PayloadAction<object>) => void;
|
|
8
8
|
}, "videoTimestamp", "videoTimestamp", import("@reduxjs/toolkit").SliceSelectors<videoTimestampSliceState>>;
|
|
@@ -3,6 +3,6 @@ import { videoTimestampObjectSliceState } from "@/types/redux";
|
|
|
3
3
|
export declare const videoTimestampObject: import("@reduxjs/toolkit").Slice<videoTimestampObjectSliceState, {
|
|
4
4
|
add: (state: {
|
|
5
5
|
value: object;
|
|
6
|
-
status: "
|
|
6
|
+
status: "loading" | "failed" | "idle";
|
|
7
7
|
}, action: PayloadAction<object>) => void;
|
|
8
8
|
}, "videoTimestampObject", "videoTimestampObject", import("@reduxjs/toolkit").SliceSelectors<videoTimestampObjectSliceState>>;
|
|
@@ -3,6 +3,6 @@ import { IPAdressSliceState } from "@/types/redux";
|
|
|
3
3
|
export declare const IPAdress: import("@reduxjs/toolkit").Slice<IPAdressSliceState, {
|
|
4
4
|
set: (state: {
|
|
5
5
|
value: object;
|
|
6
|
-
status: "
|
|
6
|
+
status: "loading" | "failed" | "idle";
|
|
7
7
|
}, action: PayloadAction<object>) => void;
|
|
8
8
|
}, "IPAdress", "IPAdress", import("@reduxjs/toolkit").SliceSelectors<IPAdressSliceState>>;
|
|
@@ -24,6 +24,8 @@ import { NavbarPropsType } from "../../types";
|
|
|
24
24
|
* @param {React.ReactNode | JSX.Element | null} bottomBanner - The bottom banner
|
|
25
25
|
* @param {boolean} hideTopBanner - Whether to hide the top banner
|
|
26
26
|
* @param {boolean} hideBottomBanner - Whether to hide the bottom banner
|
|
27
|
+
* @remarks `renderUserDropdown` — when provided, its return value is rendered directly with no
|
|
28
|
+
* wrapper div. Returning null completely suppresses the built-in panel.
|
|
27
29
|
* */
|
|
28
30
|
declare const ResponsiveNavbar: ({ session, logoSrc, logoAlt, navLinks, userAreaLinks, theme: initialTheme, containerClass, topBanner, bottomBanner, hideTopBanner, hideBottomBanner, signoutUrl, userDropdownOpen: controlledDropdownOpen, onUserDropdownToggle, renderUserDropdown, }: NavbarPropsType) => import("react/jsx-runtime").JSX.Element;
|
|
29
31
|
export default ResponsiveNavbar;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { TableColumnType } from "@/types";
|
|
2
|
+
import { TableColumnType, TableExportOptionsType } from "@/types";
|
|
3
3
|
export interface FilterState {
|
|
4
4
|
[key: string]: string | string[] | null;
|
|
5
5
|
}
|
|
@@ -33,12 +33,7 @@ export interface TableProps<T> {
|
|
|
33
33
|
onSelectionChange?: (selectedRows: T[]) => void;
|
|
34
34
|
expandable?: boolean;
|
|
35
35
|
renderExpandedRow?: (row: T) => React.ReactNode;
|
|
36
|
-
exportOptions?:
|
|
37
|
-
csv?: boolean;
|
|
38
|
-
excel?: boolean;
|
|
39
|
-
pdf?: boolean;
|
|
40
|
-
fileName?: string;
|
|
41
|
-
};
|
|
36
|
+
exportOptions?: TableExportOptionsType;
|
|
42
37
|
refreshable?: boolean;
|
|
43
38
|
onRefresh?: () => Promise<void>;
|
|
44
39
|
/** Error message to display (e.g. from API response `detail` or `error` key) */
|
|
@@ -109,7 +104,9 @@ export interface TableProps<T> {
|
|
|
109
104
|
* @prop {function} onSelectionChange - The function to call when selection changes
|
|
110
105
|
* @prop {boolean} expandable - Whether to allow row expansion
|
|
111
106
|
* @prop {function} renderExpandedRow - The function to call to render the expanded row
|
|
112
|
-
* @prop {
|
|
107
|
+
* @prop {TableExportOptionsType} exportOptions - Export settings: which buttons to
|
|
108
|
+
* show (csv/excel/pdf), fileName, allFields (export the whole record) and maxRows.
|
|
109
|
+
* Exports cover the filtered + sorted data, not just the current page.
|
|
113
110
|
* @prop {boolean} refreshable - Whether to allow refreshing the table
|
|
114
111
|
* @prop {function} onRefresh - The function to call when the table is refreshed
|
|
115
112
|
* @prop {string} error - Error message to display (e.g. from API response detail or error key)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ApiResponseType, SearchParamsType, TableColumnType } from "@/types";
|
|
2
|
+
import { ApiResponseType, SearchParamsType, TableColumnType, TableExportOptionsType } from "@/types";
|
|
3
3
|
import { FetchParamsType } from "@/types";
|
|
4
4
|
export interface IHubTableServerRef {
|
|
5
5
|
refresh: () => void;
|
|
@@ -24,12 +24,7 @@ interface IHubTableServerPropsType<T> {
|
|
|
24
24
|
searchDebounceMs?: number;
|
|
25
25
|
enableSorting?: boolean;
|
|
26
26
|
enableExport?: boolean;
|
|
27
|
-
exportOptions?:
|
|
28
|
-
csv?: boolean;
|
|
29
|
-
excel?: boolean;
|
|
30
|
-
pdf?: boolean;
|
|
31
|
-
fileName?: string;
|
|
32
|
-
};
|
|
27
|
+
exportOptions?: TableExportOptionsType;
|
|
33
28
|
rowsPerPageOptions?: number[];
|
|
34
29
|
defaultRowsPerPage?: number;
|
|
35
30
|
onRowClick?: (row: T) => void;
|
|
@@ -98,7 +93,9 @@ interface IHubTableServerPropsType<T> {
|
|
|
98
93
|
* @prop {boolean} showSearch - Whether to show the search input
|
|
99
94
|
* @prop {boolean} enableSorting - Whether to enable sorting
|
|
100
95
|
* @prop {boolean} enableExport - Whether to enable export
|
|
101
|
-
* @prop {
|
|
96
|
+
* @prop {TableExportOptionsType} exportOptions - Export settings: which buttons to
|
|
97
|
+
* show (csv/excel/pdf), fileName, allFields (export the whole record), batchSize
|
|
98
|
+
* and maxRows. Exports cover every page matching the current filters.
|
|
102
99
|
* @prop {number[]} rowsPerPageOptions - The options for the rows per page
|
|
103
100
|
* @prop {number} defaultRowsPerPage - The default rows per page
|
|
104
101
|
* @prop {Function} onRowClick - The callback for the row click
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TableColumnType } from "../../../../types";
|
|
3
|
+
/** Pull readable text out of a React node so `cell`/function accessors can be exported. */
|
|
4
|
+
export declare const extractTextFromNode: (node: React.ReactNode) => string;
|
|
5
|
+
/**
|
|
6
|
+
* Flatten any cell value into a single export-safe string.
|
|
7
|
+
* Arrays become "a | b | c", objects fall back to a label key then JSON.
|
|
8
|
+
*/
|
|
9
|
+
export declare const stringifyExportValue: (value: unknown) => string;
|
|
10
|
+
/**
|
|
11
|
+
* Resolve the export value for a single column/row pair.
|
|
12
|
+
*
|
|
13
|
+
* Resolution order:
|
|
14
|
+
* 1. `column.exportValue` — explicit, always wins.
|
|
15
|
+
* 2. String accessor — nested lookup (`user.email` works), falling back to
|
|
16
|
+
* `cell` when the raw value is empty.
|
|
17
|
+
* 3. Function accessor — invoked, then flattened (React nodes become text).
|
|
18
|
+
* 4. `cell` — invoked, then flattened.
|
|
19
|
+
*/
|
|
20
|
+
export declare const resolveColumnExportValue: <T>(row: T, column: TableColumnType<T>, index: number) => string;
|
|
21
|
+
/** Columns that should appear in an export (anything not opted out via `exportable: false`). */
|
|
22
|
+
export declare const getExportableColumns: <T>(columns: TableColumnType<T>[]) => TableColumnType<T>[];
|
|
23
|
+
/**
|
|
24
|
+
* Flatten a raw record into `{ header: value }` pairs covering every leaf field,
|
|
25
|
+
* used when `exportOptions.allFields` is enabled so nothing in the API payload is lost.
|
|
26
|
+
*/
|
|
27
|
+
export declare const flattenRecord: (record: Record<string, any>, parentKey?: string, accumulator?: Record<string, string>) => Record<string, string>;
|
|
28
|
+
/** Build headers + rows from every leaf field across the dataset (union of keys, stable order). */
|
|
29
|
+
export declare const buildAllFieldsMatrix: <T>(data: T[]) => {
|
|
30
|
+
headers: string[];
|
|
31
|
+
rows: string[][];
|
|
32
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser file writers for table exports.
|
|
3
|
+
* CSV is dependency-free; Excel uses `xlsx` and PDF uses `jspdf`, both loaded
|
|
4
|
+
* lazily so tables that never export don't pay the bundle cost.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Escape a single CSV cell: quote when needed, double inner quotes, and
|
|
8
|
+
* neutralise spreadsheet formula injection (`=`, `+`, `-`, `@` prefixes).
|
|
9
|
+
*/
|
|
10
|
+
export declare const escapeCsvValue: (value: string) => string;
|
|
11
|
+
/** Build the CSV text (with UTF-8 BOM so Excel renders accents correctly). */
|
|
12
|
+
export declare const buildCsv: (headers: string[], rows: string[][]) => string;
|
|
13
|
+
export declare const downloadCsv: (headers: string[], rows: string[][], fileName: string) => void;
|
|
14
|
+
/** Write a real .xlsx workbook via SheetJS. Throws if `xlsx` cannot be loaded. */
|
|
15
|
+
export declare const downloadExcel: (headers: string[], rows: string[][], fileName: string, sheetName?: string) => Promise<void>;
|
|
16
|
+
/** Render a paginated landscape table to PDF via jsPDF. Throws if `jspdf` is missing. */
|
|
17
|
+
export declare const downloadPdf: (headers: string[], rows: string[][], fileName: string, title?: string) => Promise<void>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { TableColumnType, TableExportOptionsType } from "../../../../types";
|
|
2
|
+
export type TableExportFormatType = "csv" | "excel" | "pdf";
|
|
3
|
+
interface BuildMatrixParamsType<T> {
|
|
4
|
+
data: T[];
|
|
5
|
+
columns: TableColumnType<T>[];
|
|
6
|
+
showRowNumbers?: boolean;
|
|
7
|
+
rowNumberStartFrom?: number;
|
|
8
|
+
/** Export every leaf field of the raw record instead of the visible columns. */
|
|
9
|
+
allFields?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Turn table data into a headers/rows matrix.
|
|
13
|
+
* Unlike the previous implementation this keeps columns with function accessors,
|
|
14
|
+
* resolves dotted accessors, and falls back to `cell` output — so no column is
|
|
15
|
+
* silently dropped from the file.
|
|
16
|
+
*/
|
|
17
|
+
export declare const buildExportMatrix: <T>({ data, columns, showRowNumbers, rowNumberStartFrom, allFields, }: BuildMatrixParamsType<T>) => {
|
|
18
|
+
headers: string[];
|
|
19
|
+
rows: string[][];
|
|
20
|
+
};
|
|
21
|
+
interface ExportTableDataParamsType<T> extends BuildMatrixParamsType<T> {
|
|
22
|
+
format: TableExportFormatType;
|
|
23
|
+
fileName?: string;
|
|
24
|
+
/** Used as the PDF heading and the Excel sheet name. */
|
|
25
|
+
title?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Build the matrix for `data` and download it in the requested format.
|
|
29
|
+
* Rejects on failure (missing optional dependency, write error) so callers can
|
|
30
|
+
* surface the problem instead of the button doing nothing.
|
|
31
|
+
*/
|
|
32
|
+
export declare const exportTableData: <T>({ format, fileName, title, ...matrixParams }: ExportTableDataParamsType<T>) => Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Fill in file-generation defaults. Button visibility flags (csv/excel/pdf) are
|
|
35
|
+
* left untouched so the caller keeps control of which buttons render.
|
|
36
|
+
*/
|
|
37
|
+
export declare const resolveExportOptions: (exportOptions?: TableExportOptionsType) => TableExportOptionsType & {
|
|
38
|
+
fileName: string;
|
|
39
|
+
batchSize: number;
|
|
40
|
+
maxRows: number;
|
|
41
|
+
};
|
|
42
|
+
export {};
|
|
@@ -21,6 +21,8 @@ export { default as FromInstinctHub } from "./components/auth/FromInstinctHub";
|
|
|
21
21
|
export { default as LoginForm } from "./components/auth/LoginForm";
|
|
22
22
|
export { default as ReactClientProviders } from "./components/auth/ReactClientProviders";
|
|
23
23
|
export { default as PhoneNumberInput } from "./components/forms/PhoneNumberInput";
|
|
24
|
+
export type { PhoneNumberInputPropsType } from "./components/forms/PhoneNumberInput";
|
|
25
|
+
export type { PhoneNumberValueType, PhoneCountryType, ParsedPhoneNumberType, } from "./components/lib/phoneUtils";
|
|
24
26
|
export { default as RadioField } from "./components/forms/RadioField";
|
|
25
27
|
export { default as RadioSimple } from "./components/forms/RadioSimple";
|
|
26
28
|
export { default as ReactTimeAgo } from "./components/forms/ReactTimeAgo";
|
|
@@ -67,6 +69,8 @@ export { default as ResponsiveNavbar } from "./components/navbar/ResponsiveNavba
|
|
|
67
69
|
export { default as SideNavbar } from "./components/navbar/SideNavbar";
|
|
68
70
|
export { default as FileUploader } from "./components/forms/uploads/FileUploader";
|
|
69
71
|
export { default as IhubFileUploader } from "./components/forms/uploads/IhubFileUploader";
|
|
72
|
+
export { default as S3MultiUploader } from "./components/forms/uploads/S3MultiUploader";
|
|
73
|
+
export type { S3UploadResponseType, S3MultiUploaderProps, PresignedUploadResult } from "./types";
|
|
70
74
|
export { default as CustomTextEditor } from "./components/ui/editor/CustomTextEditor";
|
|
71
75
|
export { default as IHubTextEditor } from "./components/ui/editor/ihub-editor";
|
|
72
76
|
export type { IHubTextEditorProps, IHubEditorFeatures } from "./components/ui/editor/ihub-editor";
|