@instincthub/react-ui 0.1.55 → 0.1.57
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/src/assets/css/forms/input-fields.css +2 -2
- package/dist/src/assets/css/ui/action.css +11 -14
- package/dist/src/assets/css/ui/dropdown-styles.css +14 -0
- package/dist/src/components/forms/DateRangePicker.js +1 -1
- package/dist/src/components/ui/Action.js +1 -1
- package/dist/src/components/ui/Action.js.map +1 -1
- package/dist/src/components/ui/Dropdown.js +1 -1
- package/dist/src/components/ui/tables/IHubTableServer.js +1 -1
- 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 +2 -3
- 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/ui/Dropdown.d.ts +6 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +17 -17
- package/dist/src/types/__examples__/.next/types/app/api/auth/[...nextauth]/route.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/api/auth/login/route.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/api/components/docs/route.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/api/components/recommend/route.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/api/components/search/route.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/api/fallback/route.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/api/generate/route.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/api/help/route.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/api/mcp/route.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/auth/layout.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/auth/login/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/auth/password-match/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/code-display/layout.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/code-display/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/auth/client-detector/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/auth/login-form/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/auth/signup-form/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/auth/username-email-checker/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/charts/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/action-dropdown/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/animated-box/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/checkboxes/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/chips-input/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/date-input/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/date-input-picker/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/date-range-picker/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/drop-file/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/email-list/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/file-uploader/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/filter-array/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/filter-objects/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/form-error/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/input-amount/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/input-number/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/input-text/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/input-textarea/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/layout.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/message-display/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/multiple-email/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/password-field/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/phone-number-input/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/radio-button/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/search-field/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/search-objects-from-db/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/searchable-dropdown/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/time-picker/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/toggle-button/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/forms/uploads/ihub-file-uploader/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/layout.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/navbars/breadcrumb/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/navbars/responsive-navbar/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/navbars/sidenav/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/navbars/tabs/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/ui/actions/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/ui/badges/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/ui/card-grid/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/ui/card-list/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/ui/cards/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/ui/color-picker/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/ui/content-view-or-edit/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/ui/content-viewer/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/ui/create-button/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/ui/dangerous-renderer/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/ui/dialogs/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/ui/dropdowns/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/ui/ihub-text-editor/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/ui/modals/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/ui/or-divider/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/ui/pagination/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/ui/random-gradient-image/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/ui/s3-multi-uploader/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/ui/table-examples/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/ui/table-server-examples/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/components/ui/text-editor/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/cursors/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/examples/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/layout.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/libs/examples/loadscript/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/libs/examples/modals/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/libs/examples/paystacks/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/libs/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/app/page.d.ts +0 -13
- package/dist/src/types/__examples__/.next/types/validator.d.ts +0 -1
- package/dist/src/types/__examples__/next.config.d.ts +0 -3
- package/dist/src/types/__examples__/src/app/api/auth/[...nextauth]/route.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/api/auth/login/route.d.ts +0 -2
- package/dist/src/types/__examples__/src/app/api/components/docs/route.d.ts +0 -14
- package/dist/src/types/__examples__/src/app/api/components/recommend/route.d.ts +0 -14
- package/dist/src/types/__examples__/src/app/api/components/search/route.d.ts +0 -50
- package/dist/src/types/__examples__/src/app/api/fallback/route.d.ts +0 -34
- package/dist/src/types/__examples__/src/app/api/generate/route.d.ts +0 -14
- package/dist/src/types/__examples__/src/app/api/help/route.d.ts +0 -14
- package/dist/src/types/__examples__/src/app/api/mcp/route.d.ts +0 -10
- package/dist/src/types/__examples__/src/app/auth/layout.d.ts +0 -4
- package/dist/src/types/__examples__/src/app/auth/login/page.d.ts +0 -2
- package/dist/src/types/__examples__/src/app/auth/password-match/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/code-display/layout.d.ts +0 -4
- package/dist/src/types/__examples__/src/app/code-display/page.d.ts +0 -3
- package/dist/src/types/__examples__/src/app/components/auth/client-detector/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/auth/login-form/page.d.ts +0 -2
- package/dist/src/types/__examples__/src/app/components/auth/signup-form/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/auth/username-email-checker/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/charts/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/action-dropdown/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/animated-box/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/checkboxes/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/chips-input/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/date-input/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/date-input-picker/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/date-range-picker/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/drop-file/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/email-list/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/file-uploader/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/filter-array/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/filter-objects/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/form-error/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/input-amount/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/input-number/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/input-text/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/input-textarea/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/layout.d.ts +0 -4
- package/dist/src/types/__examples__/src/app/components/forms/message-display/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/multiple-email/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/password-field/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/phone-number-input/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/radio-button/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/search-field/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/search-objects-from-db/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/searchable-dropdown/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/time-picker/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/toggle-button/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/forms/uploads/ihub-file-uploader/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/layout.d.ts +0 -4
- package/dist/src/types/__examples__/src/app/components/navbars/breadcrumb/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/navbars/responsive-navbar/page.d.ts +0 -2
- package/dist/src/types/__examples__/src/app/components/navbars/sidenav/page.d.ts +0 -2
- package/dist/src/types/__examples__/src/app/components/navbars/tabs/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/ui/actions/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/ui/badges/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/ui/card-grid/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/ui/card-list/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/ui/cards/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/ui/color-picker/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/ui/content-view-or-edit/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/ui/content-viewer/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/ui/create-button/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/ui/dangerous-renderer/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/ui/dialogs/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/ui/dropdowns/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/ui/ihub-text-editor/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/ui/modals/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/ui/or-divider/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/ui/pagination/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/ui/random-gradient-image/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/ui/s3-multi-uploader/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/ui/table-examples/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/ui/table-server-examples/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/components/ui/text-editor/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/cursors/page.d.ts +0 -2
- package/dist/src/types/__examples__/src/app/examples/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/layout.d.ts +0 -11
- package/dist/src/types/__examples__/src/app/libs/examples/loadscript/page.d.ts +0 -8
- package/dist/src/types/__examples__/src/app/libs/examples/modals/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/libs/examples/paystacks/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/libs/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/app/page.d.ts +0 -1
- package/dist/src/types/__examples__/src/components/ComponentListing.d.ts +0 -1
- package/dist/src/types/__examples__/src/components/Forms.d.ts +0 -2
- package/dist/src/types/__examples__/src/components/Modals.d.ts +0 -1
- package/dist/src/types/__examples__/src/components/TestComponent.d.ts +0 -1
- package/dist/src/types/__examples__/src/components/TestPage.d.ts +0 -2
- package/dist/src/types/__examples__/src/components/auth/ClientDetectorExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/auth/IsUsernameEmailTakenExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/auth/LoginFormExample.d.ts +0 -4
- package/dist/src/types/__examples__/src/components/auth/SignUpFormExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/auths/LoginExample.d.ts +0 -4
- package/dist/src/types/__examples__/src/components/auths/PasswordsMatchExample.d.ts +0 -2
- package/dist/src/types/__examples__/src/components/forms/ActionDropdownExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/AnimatedBoxExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/CheckboxesFieldExamples.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/ChipsInputExample.d.ts +0 -6
- package/dist/src/types/__examples__/src/components/forms/DateInputExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/DateInputPickerExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/DateInputPickerTimeExample.d.ts +0 -10
- package/dist/src/types/__examples__/src/components/forms/DateRangePickerExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/DateTimePickerExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/DropFileExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/EmailListExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/FileUploaderExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/FilterArrayExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/FilterObjectsExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/FormErrorExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/InputAmountExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/InputNumberExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/InputTextExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/InputTextareaExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/MessageDisplayExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/MultipleEmailExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/PasswordFieldExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/PhoneNumberInputExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/RadioButtonExample.d.ts +0 -6
- package/dist/src/types/__examples__/src/components/forms/SearchFieldExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/SearchObjectsFromDBExample.d.ts +0 -1
- package/dist/src/types/__examples__/src/components/forms/SearchableDropdownExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/SignUpFormExample.d.ts +0 -6
- package/dist/src/types/__examples__/src/components/forms/SubmitBtnExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/TextFieldExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/TimePickerExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/ToggleButtonExample.d.ts +0 -1
- package/dist/src/types/__examples__/src/components/forms/uploads/IhubFileUploaderDocs.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/forms/uploads/IhubFileUploaderSample.d.ts +0 -6
- package/dist/src/types/__examples__/src/components/navbars/BreadcrumbExample.d.ts +0 -1
- package/dist/src/types/__examples__/src/components/navbars/CursorProviders.d.ts +0 -1
- package/dist/src/types/__examples__/src/components/navbars/MainFooter.d.ts +0 -2
- package/dist/src/types/__examples__/src/components/navbars/MainNavigation.d.ts +0 -2
- package/dist/src/types/__examples__/src/components/navbars/PageNavigation.d.ts +0 -2
- package/dist/src/types/__examples__/src/components/navbars/ResponsiveNavbarControlledExample.d.ts +0 -1
- package/dist/src/types/__examples__/src/components/navbars/ResponsiveNavbarExample.d.ts +0 -2
- package/dist/src/types/__examples__/src/components/navbars/SideNavbarExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/navbars/TabsExample.d.ts +0 -1
- package/dist/src/types/__examples__/src/components/tabs/TabsDemo.d.ts +0 -2
- package/dist/src/types/__examples__/src/components/tabs/TabsExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/tabs/VerticalTabsExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/ui/ActionExamples.d.ts +0 -2
- package/dist/src/types/__examples__/src/components/ui/BadgeExamples.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/ui/CardExamples.d.ts +0 -1
- package/dist/src/types/__examples__/src/components/ui/CardGridExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/ui/CardListExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/ui/ChartExamples.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/ui/CodebaseLink.d.ts +0 -4
- package/dist/src/types/__examples__/src/components/ui/ColorPickerExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/ui/ContentFormTextEditor.d.ts +0 -1
- package/dist/src/types/__examples__/src/components/ui/ContentViewOrEditExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/ui/ContentViewOrEditSample.d.ts +0 -1
- package/dist/src/types/__examples__/src/components/ui/ContentViewerExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/ui/CreateButtonExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/ui/CustomTextEditorExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/ui/DangerousRendererExample.d.ts +0 -1
- package/dist/src/types/__examples__/src/components/ui/DialogExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/ui/DropdownExamples.d.ts +0 -2
- package/dist/src/types/__examples__/src/components/ui/IHubTextEditorExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/ui/ListStylesDemo.d.ts +0 -1
- package/dist/src/types/__examples__/src/components/ui/ListStylesDemoTwo.d.ts +0 -1
- package/dist/src/types/__examples__/src/components/ui/OrDividerExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/ui/PaginationExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/ui/RandomGradientImageExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/ui/S3MultiUploaderExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/ui/StatusIconExample.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/ui/TableExamples.d.ts +0 -3
- package/dist/src/types/__examples__/src/components/ui/TableServerExamples.d.ts +0 -1
- package/dist/src/types/__examples__/src/lib/api.d.ts +0 -29
- package/dist/src/types/__examples__/src/lib/hooks.d.ts +0 -76
- package/dist/src/types/__examples__/src/types/components.d.ts +0 -144
- package/dist/src/types/assets/svgs/SVGs.d.ts +0 -36
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
|
|
42
42
|
.ihub-wrapper .ihub-input:disabled,
|
|
43
43
|
.ihub-wrapper .ihub-input:read-only {
|
|
44
|
-
background:
|
|
44
|
+
background: var(--OpacityBackground);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.ihub-wrapper .ihub-input:focus + .ihub-text-label,
|
|
@@ -245,7 +245,7 @@
|
|
|
245
245
|
}
|
|
246
246
|
|
|
247
247
|
.ihub-email-item {
|
|
248
|
-
background-color:
|
|
248
|
+
background-color: var(--OpacityBackground);
|
|
249
249
|
display: inline-block;
|
|
250
250
|
font-size: 14px;
|
|
251
251
|
border-radius: 30px;
|
|
@@ -169,14 +169,15 @@
|
|
|
169
169
|
transition: transform 0.2s ease;
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
.ihub-action-dropdown-
|
|
173
|
-
.ihub-action-dropdown-icon {
|
|
172
|
+
.ihub-action-with-dropdown[aria-expanded="true"] .ihub-action-dropdown-icon {
|
|
174
173
|
transform: rotate(180deg);
|
|
175
174
|
}
|
|
176
175
|
|
|
176
|
+
/* Fixed, not absolute: the menu is portalled to <body> and positioned from
|
|
177
|
+
the trigger's bounding box, so no scrolling ancestor can clip it. The
|
|
178
|
+
coordinates are set inline by the component. */
|
|
177
179
|
.ihub-action-dropdown-menu {
|
|
178
|
-
position:
|
|
179
|
-
top: calc(100% + 8px);
|
|
180
|
+
position: fixed;
|
|
180
181
|
min-width: 160px;
|
|
181
182
|
background: var(--White);
|
|
182
183
|
border-radius: 5px;
|
|
@@ -188,17 +189,13 @@
|
|
|
188
189
|
overflow-y: auto;
|
|
189
190
|
}
|
|
190
191
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
.ihub-action-dropdown-right {
|
|
196
|
-
right: 0;
|
|
197
|
-
}
|
|
198
|
-
|
|
192
|
+
/* Alignment is resolved in JS when the menu is positioned; these remain only
|
|
193
|
+
so existing markup keeps a stable hook. */
|
|
194
|
+
.ihub-action-dropdown-left,
|
|
195
|
+
.ihub-action-dropdown-right,
|
|
199
196
|
.ihub-action-dropdown-center {
|
|
200
|
-
|
|
201
|
-
transform:
|
|
197
|
+
right: auto;
|
|
198
|
+
transform: none;
|
|
202
199
|
}
|
|
203
200
|
|
|
204
201
|
.ihub-action-dropdown-item {
|
|
@@ -76,6 +76,20 @@
|
|
|
76
76
|
animation: ihub-dropdown-appear 0.2s ease;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
/*
|
|
80
|
+
* Portalled variant: the menu is a child of <body>, so it is positioned from
|
|
81
|
+
* the trigger's viewport rect instead of its own offset parent. Keeping the
|
|
82
|
+
* absolute rule above means any consumer still rendering the menu inline
|
|
83
|
+
* behaves as before.
|
|
84
|
+
*/
|
|
85
|
+
.ihub-dropdown-menu-portal {
|
|
86
|
+
position: fixed;
|
|
87
|
+
top: 0;
|
|
88
|
+
left: 0;
|
|
89
|
+
right: auto;
|
|
90
|
+
z-index: 1200;
|
|
91
|
+
}
|
|
92
|
+
|
|
79
93
|
@keyframes ihub-dropdown-appear {
|
|
80
94
|
from {
|
|
81
95
|
opacity: 0;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{slicedToArray as e}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";import a from"@mui/icons-material/CalendarMonthOutlined";import{useState as d,useRef as o,useEffect as i,useCallback as r,useMemo as l}from"react";import{endOfWeek as s}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfWeek.js";import{startOfWeek as u}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfWeek.js";import{endOfMonth as c}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfMonth.js";import{subDays as m}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subDays.js";import{formatDate as f}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/format.js";import{isBefore as p}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isBefore.js";import{startOfDay as h}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfDay.js";import{isAfter as b}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isAfter.js";import{endOfDay as y}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfDay.js";import{startOfMonth as v}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfMonth.js";import{getDay as N}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDay.js";import{getDaysInMonth as _}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDaysInMonth.js";import{isSameDay as D}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameDay.js";import{isValid as M}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isValid.js";import{subMonths as g}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subMonths.js";import{addMonths as k}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addMonths.js";var w=function(w){var j=w.label,C=w.startLabel,O=void 0===C?"From":C,x=w.endLabel,L=void 0===x?"To":x,T=w.value,F=w.onChange,S=w.required,I=void 0!==S&&S,W=w.minDate,A=w.maxDate,E=w.disabledDates,q=void 0===E?[]:E,B=w.dateFormat,P=void 0===B?"yyyy-MM-dd":B,H=w.placeholder,Q=w.errorMessage,V=w.className,Y=void 0===V?"":V,z=w.name,G=w.id,J=w.disabled,K=void 0!==J&&J,R=w.showCalendarIcon,U=void 0===R||R,X=w.showQuickActions,Z=void 0===X||X,$=w.ariaLabel,ee=function(e){if(!e)return null;try{var t=new Date(e);return M(t)?h(t):null}catch(e){return null}},te=d(ee(null==T?void 0:T.startDate)),ne=e(te,2),ae=ne[0],de=ne[1],oe=d(ee(null==T?void 0:T.endDate)),ie=e(oe,2),re=ie[0],le=ie[1],se=d(!1),ue=e(se,2),ce=ue[0],me=ue[1],fe=d(ae||new Date),pe=e(fe,2),he=pe[0],be=pe[1],ye=d("start"),ve=e(ye,2),Ne=ve[0],_e=ve[1],De=d(null),Me=e(De,2),ge=Me[0],ke=Me[1],we=d(null),je=e(we,2),Ce=je[0],Oe=je[1],xe=d(Q||null),Le=e(xe,2),Te=Le[0],Fe=Le[1],Se=o(null),Ie=o(null);i(function(){T&&(de(ee(T.startDate)),le(ee(T.endDate)))},[null==T?void 0:T.startDate,null==T?void 0:T.endDate]),i(function(){var e=function(e){Ie.current&&!Ie.current.contains(e.target)&&(me(!1),Oe(null))};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[]);var We=r(function(e){var t=f(e,"yyyy-MM-dd");return q.includes(t)},[q]),Ae=r(function(e){return(!W||!p(e,h(new Date(W))))&&(!A||!b(e,y(new Date(A))))},[W,A]),Ee=r(function(e){if(!e)return"";try{return f(e,P)}catch(e){return""}},[P]),qe=r(function(e,t){null==F||F({startDate:e?f(e,"yyyy-MM-dd"):"",endDate:t?f(t,"yyyy-MM-dd"):""})},[F]),Be=l(function(){for(var e=he.getFullYear(),t=he.getMonth(),n=v(he),a=N(n),d=_(he),o=[],i=0;i<a;i++)o.push(null);for(var r=1;r<=d;r++)o.push(new Date(e,t,r));return o},[he]),Pe=function(e,t){de(e),le(t),_e("start"),Fe(null),qe(e,t),me(!1),Oe(null)},He=function(e){K||(me(!0),Oe(e),"start"===e?(_e("start"),ae&&be(ae)):(_e(ae&&!re?"end":"start"),re?be(re):ae&&be(ae)))};return t("div",{ref:Ie,className:"ihub-daterange-picker-wrapper ".concat(Y),children:[j&&t("label",{className:"ihub-datetime-label",htmlFor:G,children:[j,I&&n("span",{className:"ihub-required",children:"*"})]}),t("div",{className:"ihub-daterange-inputs",children:[t("div",{className:"ihub-daterange-input-container ".concat("start"===Ce?"active":""),onClick:function(){return He("start")},children:[n("input",{type:"text",className:"ihub-datetime-input",value:Ee(ae),readOnly:!0,placeholder:(null==H?void 0:H.start)||O,disabled:K,"aria-label":$?"".concat($," start date"):"".concat(O)}),U&&n("div",{className:"ihub-datetime-icons",children:n("button",{type:"button",className:"ihub-datetime-icon-btn",disabled:K,"aria-label":"Open calendar for start date",tabIndex:-1,children:n(a,{})})})]}),n("span",{className:"ihub-daterange-separator-arrow","aria-hidden":"true",children:"→"}),t("div",{className:"ihub-daterange-input-container ".concat("end"===Ce?"active":""),onClick:function(){return He("end")},children:[n("input",{type:"text",className:"ihub-datetime-input",value:Ee(re),readOnly:!0,placeholder:(null==H?void 0:H.end)||L,disabled:K,"aria-label":$?"".concat($," end date"):"".concat(L)}),U&&n("div",{className:"ihub-datetime-icons",children:n("button",{type:"button",className:"ihub-datetime-icon-btn",disabled:K,"aria-label":"Open calendar for end date",tabIndex:-1,children:n(a,{})})})]})]}),Te&&n("div",{className:"ihub-datetime-error",id:G?"".concat(G,"-error"):void 0,children:Te}),ce&&!K&&t("div",{ref:Se,className:"ihub-datetime-picker-dropdown",role:"dialog","aria-label":"Date range picker",children:[n("div",{className:"ihub-daterange-phase-indicator",children:"start"===Ne?"Select start date":"Select end date"}),t("div",{className:"ihub-datetime-calendar",children:[t("div",{className:"ihub-datetime-month-nav",children:[n("button",{type:"button",onClick:function(){return be(g(he,1))},className:"ihub-datetime-nav-btn","aria-label":"Previous month",children:"‹"}),n("span",{className:"ihub-datetime-month-year",children:f(he,"MMMM yyyy")}),n("button",{type:"button",onClick:function(){return be(k(he,1))},className:"ihub-datetime-nav-btn","aria-label":"Next month",children:"›"})]}),n("div",{className:"ihub-datetime-weekdays",children:["Su","Mo","Tu","We","Th","Fr","Sa"].map(function(e){return n("div",{className:"ihub-datetime-weekday",children:e},e)})}),n("div",{className:"ihub-datetime-days",children:Be.map(function(e,t){if(!e)return n("div",{className:"ihub-datetime-day-empty"},"empty-".concat(t));var a=ae&&D(e,ae)||re&&D(e,re),d=D(e,new Date),o=We(e)||!Ae(e),i=function(e){var t=[],n="end"===Ne&&ge?ge:re,a=ae;if(!a)return"";if(D(e,a)&&t.push("range-start"),n&&D(e,n)&&t.push("range-end"),n){var d=a,o=n;p(o,d)&&(d=n,o=a),b(e,d)&&p(e,o)&&!D(e,d)&&!D(e,o)&&t.push("in-range")}return t.join(" ")}(e);return n("button",{type:"button",className:"ihub-datetime-day ".concat(a?"selected":""," ").concat(d?"today":""," ").concat(o?"disabled":""," ").concat(i),onClick:function(){return function(e){if(!We(e)&&Ae(e))if("start"===Ne)de(e),le(null),_e("end"),Oe("end"),Fe(null);else{var t=ae,n=e;t&&p(e,t)&&(n=t,de(t=e)),le(n),_e("start"),Fe(null),qe(t,n),me(!1),Oe(null)}}(e)},onMouseEnter:function(){"end"===Ne&&ke(e)},onMouseLeave:function(){return ke(null)},disabled:o,"aria-label":f(e,"MMMM d, yyyy"),"aria-selected":a||void 0,children:e.getDate()},e.getTime())})})]}),Z&&t("div",{className:"ihub-daterange-presets",children:[n("button",{type:"button",className:"ihub-datetime-action-btn",onClick:function(){var e=h(new Date);Pe(e,e)},children:"Today"}),n("button",{type:"button",className:"ihub-datetime-action-btn",onClick:function(){var e=new Date;Pe(u(e),s(e))},children:"This Week"}),n("button",{type:"button",className:"ihub-datetime-action-btn",onClick:function(){var e=new Date;Pe(v(e),c(e))},children:"This Month"}),n("button",{type:"button",className:"ihub-datetime-action-btn",onClick:function(){var e=h(new Date);Pe(m(e,6),e)},children:"Last 7 Days"}),n("button",{type:"button",className:"ihub-datetime-action-btn",onClick:function(){var e=h(new Date);Pe(m(e,29),e)},children:"Last 30 Days"}),n("button",{type:"button",className:"ihub-datetime-action-btn",onClick:function(){de(null),le(null),_e("start"),Fe(null),qe(null,null)},children:"Clear"})]})]}),(null==z?void 0:z.start)&&n("input",{type:"hidden",name:z.start,value:ae?f(ae,"yyyy-MM-dd"):""}),(null==z?void 0:z.end)&&n("input",{type:"hidden",name:z.end,value:re?f(re,"yyyy-MM-dd"):""})]})};export{w as default};
|
|
1
|
+
import{slicedToArray as e}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as n,jsx as t}from"react/jsx-runtime";import a from"@mui/icons-material/CalendarMonthOutlined";import r,{useState as d,useRef as i,useMemo as o,useEffect as l,useCallback as u}from"react";import{endOfWeek as s}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfWeek.js";import{startOfWeek as c}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfWeek.js";import{endOfMonth as m}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfMonth.js";import{subDays as f}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subDays.js";import{formatDate as p}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/format.js";import{startOfDay as h}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfDay.js";import{isBefore as b}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isBefore.js";import{isAfter as v}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isAfter.js";import{startOfMonth as y}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfMonth.js";import{getDay as D}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDay.js";import{getDaysInMonth as N}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDaysInMonth.js";import{isSameDay as M}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameDay.js";import{isValid as _}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isValid.js";import{subMonths as g}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subMonths.js";import{addMonths as k}from"../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addMonths.js";var w=function(e){if(!e)return null;var n=/^(\d{4})-(\d{2})-(\d{2})/.exec(e.trim());if(n){var t=Number(n[1]),a=Number(n[2])-1,r=Number(n[3]),d=new Date(t,a,r);return d.getFullYear()!==t||d.getMonth()!==a||d.getDate()!==r?null:_(d)?d:null}var i=new Date(e);return _(i)?h(i):null},j=function(_){var j=_.label,C=_.startLabel,O=void 0===C?"From":C,T=_.endLabel,x=void 0===T?"To":T,L=_.value,F=_.onChange,P=_.required,E=void 0!==P&&P,S=_.minDate,A=_.maxDate,W=_.disabledDates,B=void 0===W?[]:W,I=_.dateFormat,K=void 0===I?"yyyy-MM-dd":I,q=_.placeholder,Y=_.errorMessage,H=_.className,Q=void 0===H?"":H,V=_.name,z=_.id,G=_.disabled,J=void 0!==G&&G,R=_.showCalendarIcon,U=void 0===R||R,X=_.showQuickActions,Z=void 0===X||X,$=_.ariaLabel,ee=d(w(null==L?void 0:L.startDate)),ne=e(ee,2),te=ne[0],ae=ne[1],re=d(w(null==L?void 0:L.endDate)),de=e(re,2),ie=de[0],oe=de[1],le=d(null),ue=e(le,2),se=ue[0],ce=ue[1],me=d(!1),fe=e(me,2),pe=fe[0],he=fe[1],be=d(w(null==L?void 0:L.startDate)||new Date),ve=e(be,2),ye=ve[0],De=ve[1],Ne=d("start"),Me=e(Ne,2),_e=Me[0],ge=Me[1],ke=d(null),we=e(ke,2),je=we[0],Ce=we[1],Oe=d(null),Te=e(Oe,2),xe=Te[0],Le=Te[1],Fe=d(null),Pe=e(Fe,2),Ee=Pe[0],Se=Pe[1],Ae=Y||Ee,We=i(null),Be=i(null),Ie=i(null),Ke=i(null),qe=r.useId(),Ye=z||"ihub-daterange-".concat(qe),He="".concat(Ye,"-error"),Qe=Ye,Ve="".concat(Ye,"-end"),ze=o(function(){return w(S)},[S]),Ge=o(function(){return w(A)},[A]);l(function(){if(L){var e=w(L.startDate);ae(e),oe(w(L.endDate)),ce(null),e&&!pe&&De(e)}},[null==L?void 0:L.startDate,null==L?void 0:L.endDate]),l(function(){Y&&Se(null)},[Y]);var Je=u(function(){ce(null),Ce(null),ge("start"),he(!1),Le(null)},[]);l(function(){var e=function(e){Be.current&&!Be.current.contains(e.target)&&Je()};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[Je]);var Re=u(function(e){var n=p(e,"yyyy-MM-dd");return B.includes(n)},[B]),Ue=u(function(e){var n=h(e);return(!ze||!b(n,ze))&&(!Ge||!v(n,Ge))},[ze,Ge]),Xe=u(function(e){var n=h(e);return ze&&b(n,ze)&&(n=ze),Ge&&v(n,Ge)&&(n=Ge),ze&&b(n,ze)?null:n},[ze,Ge]),Ze=u(function(e){if(!e)return"";try{return p(e,K)}catch(e){return""}},[K]),$e=u(function(e,n){null==F||F({startDate:e?p(e,"yyyy-MM-dd"):"",endDate:n?p(n,"yyyy-MM-dd"):""})},[F]),en=o(function(){for(var e=ye.getFullYear(),n=ye.getMonth(),t=y(ye),a=D(t),r=N(ye),d=[],i=0;i<a;i++)d.push(null);for(var o=1;o<=r;o++)d.push(new Date(e,n,o));return d},[ye]),nn=function(e,n){var t=Xe(e),a=Xe(n);t&&a&&!v(t,a)?Re(t)||Re(a)?Se("That preset starts or ends on an unavailable date."):(ae(t),oe(a),ce(null),Ce(null),ge("start"),Se(null),De(t),$e(t,a),he(!1),Le(null)):Se("That preset falls outside the allowed date range.")},tn=function(e){if(!J){if(he(!0),Le(e),"start"===e)return ce(null),ge("start"),void(te&&De(te));te&&!ie?(ce(te),ge("end")):(ce(null),ge("start")),ie?De(ie):te&&De(te)}},an=function(e,n){"Enter"!==e.key&&" "!==e.key&&"ArrowDown"!==e.key||(e.preventDefault(),tn(n))},rn=Ze(null!=se?se:te),dn=se?"":Ze(ie);return n("div",{ref:Be,className:"ihub-daterange-picker-wrapper ".concat(Q),onKeyDown:function(e){var n,t;if("Escape"===e.key&&pe){e.stopPropagation();var a=xe;Je(),"end"===a?null===(n=Ke.current)||void 0===n||n.focus():null===(t=Ie.current)||void 0===t||t.focus()}},children:[j&&n("label",{className:"ihub-datetime-label",htmlFor:Qe,children:[j,E&&t("span",{className:"ihub-required",children:"*"})]}),n("div",{className:"ihub-daterange-inputs",children:[n("div",{className:"ihub-daterange-input-container ".concat("start"===xe?"active":""),onClick:function(){return tn("start")},children:[t("input",{ref:Ie,id:Qe,type:"text",className:"ihub-datetime-input",value:rn,readOnly:!0,placeholder:(null==q?void 0:q.start)||O,disabled:J,onKeyDown:function(e){return an(e,"start")},"aria-label":$?"".concat($," start date"):"".concat(O),"aria-invalid":!!Ae||void 0,"aria-describedby":Ae?He:void 0}),U&&t("div",{className:"ihub-datetime-icons",children:t("button",{type:"button",className:"ihub-datetime-icon-btn",disabled:J,"aria-label":"Open calendar for start date","aria-expanded":pe&&"start"===xe,onClick:function(e){e.stopPropagation(),tn("start")},children:t(a,{})})})]}),t("span",{className:"ihub-daterange-separator-arrow","aria-hidden":"true",children:"→"}),n("div",{className:"ihub-daterange-input-container ".concat("end"===xe?"active":""),onClick:function(){return tn("end")},children:[t("input",{ref:Ke,id:Ve,type:"text",className:"ihub-datetime-input",value:dn,readOnly:!0,placeholder:(null==q?void 0:q.end)||x,disabled:J,onKeyDown:function(e){return an(e,"end")},"aria-label":$?"".concat($," end date"):"".concat(x),"aria-invalid":!!Ae||void 0,"aria-describedby":Ae?He:void 0}),U&&t("div",{className:"ihub-datetime-icons",children:t("button",{type:"button",className:"ihub-datetime-icon-btn",disabled:J,"aria-label":"Open calendar for end date","aria-expanded":pe&&"end"===xe,onClick:function(e){e.stopPropagation(),tn("end")},children:t(a,{})})})]})]}),Ae&&t("div",{className:"ihub-datetime-error",id:He,role:"alert",children:Ae}),pe&&!J&&n("div",{ref:We,className:"ihub-datetime-picker-dropdown",role:"dialog","aria-label":"Date range picker",children:[t("div",{className:"ihub-daterange-phase-indicator",children:"start"===_e?"Select start date":"Select end date"}),n("div",{className:"ihub-datetime-calendar",children:[n("div",{className:"ihub-datetime-month-nav",children:[t("button",{type:"button",onClick:function(){return De(g(ye,1))},className:"ihub-datetime-nav-btn","aria-label":"Previous month",children:"‹"}),t("span",{className:"ihub-datetime-month-year","aria-live":"polite",children:p(ye,"MMMM yyyy")}),t("button",{type:"button",onClick:function(){return De(k(ye,1))},className:"ihub-datetime-nav-btn","aria-label":"Next month",children:"›"})]}),t("div",{className:"ihub-datetime-weekdays",children:["Su","Mo","Tu","We","Th","Fr","Sa"].map(function(e){return t("div",{className:"ihub-datetime-weekday",children:e},e)})}),t("div",{className:"ihub-datetime-days",children:en.map(function(e,n){if(!e)return t("div",{className:"ihub-datetime-day-empty"},"empty-".concat(n));var a=Boolean(se&&M(e,se)||!se&&(te&&M(e,te)||ie&&M(e,ie))),r=M(e,new Date),d=Re(e)||!Ue(e),i=function(e){var n=null!=se?se:te;if(!n)return"";var t=se?je:ie,a=n,r=null!=t?t:n;if(b(r,a)){var d=[r,a];a=d[0],r=d[1]}var i=[];return M(e,a)&&i.push("range-start"),t&&M(e,r)&&i.push("range-end"),t&&v(e,a)&&b(e,r)&&!M(e,a)&&!M(e,r)&&i.push("in-range"),i.join(" ")}(e);return t("button",{type:"button",className:"ihub-datetime-day ".concat(a?"selected":""," ").concat(r?"today":""," ").concat(d?"disabled":""," ").concat(i),onClick:function(){return function(e){if(!Re(e)&&Ue(e)){if("start"===_e||!se)return ce(e),ge("end"),Le("end"),void Se(null);var n=se,t=e;if(b(t,n)){var a=[t,n];n=a[0],t=a[1]}ae(n),oe(t),ce(null),Ce(null),ge("start"),Se(null),$e(n,t),he(!1),Le(null)}}(e)},onMouseEnter:function(){se&&Ce(e)},onMouseLeave:function(){return Ce(null)},onFocus:function(){se&&Ce(e)},disabled:d,"aria-label":p(e,"MMMM d, yyyy"),"aria-pressed":a,"aria-current":r?"date":void 0,children:e.getDate()},e.getTime())})})]}),Z&&n("div",{className:"ihub-daterange-presets",children:[t("button",{type:"button",className:"ihub-datetime-action-btn",onClick:function(){var e=h(new Date);nn(e,e)},children:"Today"}),t("button",{type:"button",className:"ihub-datetime-action-btn",onClick:function(){var e=new Date;nn(c(e),h(s(e)))},children:"This Week"}),t("button",{type:"button",className:"ihub-datetime-action-btn",onClick:function(){var e=new Date;nn(y(e),h(m(e)))},children:"This Month"}),t("button",{type:"button",className:"ihub-datetime-action-btn",onClick:function(){var e=h(new Date);nn(f(e,6),e)},children:"Last 7 Days"}),t("button",{type:"button",className:"ihub-datetime-action-btn",onClick:function(){var e=h(new Date);nn(f(e,29),e)},children:"Last 30 Days"}),t("button",{type:"button",className:"ihub-datetime-action-btn",onClick:function(){ae(null),oe(null),ce(null),Ce(null),ge("start"),Le("start"),Se(E?"Please select a date range.":null),$e(null,null)},children:"Clear"})]})]}),(null==V?void 0:V.start)&&t("input",{type:"hidden",name:V.start,value:te?p(te,"yyyy-MM-dd"):""}),(null==V?void 0:V.end)&&t("input",{type:"hidden",name:V.end,value:ie?p(ie,"yyyy-MM-dd"):""})]})};export{j as default};
|
|
2
2
|
//# sourceMappingURL=DateRangePicker.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{slicedToArray as
|
|
1
|
+
import{slicedToArray as n,objectSpread2 as e}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as i,Fragment as o,jsx as t}from"react/jsx-runtime";import r from"react";import{createPortal as a}from"react-dom";import d from"next/link";var c=function(c){var l=c.label,s=c.onClick,u=c.href,h=c.variant,m=void 0===h?"primary":h,f=c.size,p=void 0===f?"medium":f,b=c.fullWidth,v=void 0!==b&&b,w=c.disabled,g=void 0!==w&&w,k=c.iconBefore,N=c.iconAfter,C=c.className,y=void 0===C?"":C,L=c.target,x=c.type,B=void 0===x?"button":x,E=c.animated,j=void 0!==E&&E,M=c.dropdown,P=void 0!==M&&M,z=c.dropdownItems,R=void 0===z?[]:z,S=c.dropdownPosition,W=void 0===S?"right":S,A=r.useState(!1),H=n(A,2),_=H[0],D=H[1],I=r.useRef(null),T=r.useRef(null),q=r.useState({top:0,left:0}),F=n(q,2),G=F[0],J=F[1],K=r.useCallback(function(){var n=I.current;if(n){var e=n.getBoundingClientRect(),i=Math.min(40*R.length+8,300),o=Math.max(e.width,160),t=window.innerHeight-e.bottom<i&&e.top>i,r=e.left;"right"===W?r=e.right-o:"center"===W&&(r=e.left+e.width/2-o/2),J({top:t?e.top-i-8:e.bottom+8,left:Math.max(8,Math.min(r,window.innerWidth-o-8))})}},[R.length,W]);r.useEffect(function(){if(_){var n=function(n){var e,i,o=n.target;null!==(e=I.current)&&void 0!==e&&e.contains(o)||null!==(i=T.current)&&void 0!==i&&i.contains(o)||D(!1)},e=function(){return D(!1)};return document.addEventListener("mousedown",n),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),function(){document.removeEventListener("mousedown",n),window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}}},[_]);var O=["ihub-action","ihub-action-".concat(m),"ihub-action-".concat(p),v?"ihub-action-full-width":"",g?"ihub-action-disabled":"",j?"ihub-action-animated":"",P?"ihub-action-with-dropdown":"",y].filter(Boolean).join(" "),Q=i(o,{children:[k&&t("span",{className:"ihub-action-icon-before",children:k}),t("span",{className:"ihub-action-label",children:l}),P&&t("span",{className:"ihub-action-dropdown-icon",children:t("svg",{width:"12",height:"7",viewBox:"0 0 12 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:"primary"===m?{color:"#fff"}:{},children:t("path",{d:"M1 1L6 6L11 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),!P&&N&&t("span",{className:"ihub-action-icon-after",children:N})]}),U=_&&P&&R.length>0&&t("div",{ref:T,className:"ihub-action-dropdown-menu ihub-action-dropdown-".concat(W),style:{top:G.top,left:G.left},onClick:function(n){return n.stopPropagation()},children:R.map(function(n,e){var r=["ihub-action-dropdown-item",n.disabled?"ihub-action-dropdown-item-disabled":"",n.className||""].filter(Boolean).join(" "),a=i(o,{children:[n.iconBefore&&t("span",{className:"ihub-action-dropdown-item-icon",children:n.iconBefore}),t("span",{className:"ihub-action-dropdown-item-label",children:n.label})]});return n.href&&!n.disabled?t(d,{href:n.href,className:r,onClick:function(){n.onClick&&n.onClick(),D(!1)},children:a},e):t("button",{className:r,onClick:function(){!n.disabled&&n.onClick&&(n.onClick(),D(!1))},disabled:n.disabled,type:"button",children:a},e)})});return function(n){return P?i("div",{className:"ihub-action-dropdown-container",ref:I,children:[n,U&&"undefined"!=typeof document&&a(U,document.body)]}):n}(!u||g||P?t("button",e(e({type:B,className:O,onClick:P?function(n){P&&(n.preventDefault(),n.stopPropagation(),_||K(),D(function(n){return!n}))}:s,disabled:g},P?{"aria-haspopup":"menu","aria-expanded":_}:{}),{},{children:Q})):t(d,{href:u,className:O,target:L,onClick:s,children:Q}))};export{c as default};
|
|
2
2
|
//# sourceMappingURL=Action.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Action.js","sources":["../../../../src/components/ui/Action.tsx"],"sourcesContent":["import React from \"react\";\nimport Link from \"next/link\";\n\n/**\n * Defines the structure of a dropdown item\n */\nexport interface ActionDropdownItem {\n /** Text label to display for the dropdown item */\n label: string | React.ReactNode;\n /** Click handler function */\n onClick?: () => void;\n /** Link destination if the dropdown item is a link */\n href?: string;\n /** Icon to display before the label */\n iconBefore?: React.ReactNode;\n /** Whether the item is disabled */\n disabled?: boolean;\n /** Optional additional class names */\n className?: string;\n}\n\n/**\n * ActionProps interface defines all possible props for the Action component\n */\ninterface ActionProps {\n /** Text label to display in the action element */\n label: string | React.ReactNode;\n /** Click handler function */\n onClick?: () => void;\n /** Link destination if the action is a link */\n href?: string;\n /** Visual style variant */\n variant?: \"primary\" | \"secondary\" | \"outline\" | \"danger\" | \"text\";\n /** Size variation */\n size?: \"small\" | \"medium\" | \"large\";\n /** Whether the action should take up full width of container */\n fullWidth?: boolean;\n /** Whether the action is disabled */\n disabled?: boolean;\n /** Icon to display before the label */\n iconBefore?: React.ReactNode;\n /** Icon to display after the label */\n iconAfter?: React.ReactNode;\n /** Optional additional class names */\n className?: string;\n /** Target attribute for links */\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\";\n /** Type attribute for buttons */\n type?: \"button\" | \"submit\" | \"reset\";\n /** Whether to add animation effect */\n animated?: boolean;\n /** Whether to show a dropdown menu */\n dropdown?: boolean;\n /** Items to display in the dropdown menu */\n dropdownItems?: ActionDropdownItem[];\n /** Position of the dropdown menu */\n dropdownPosition?: \"left\" | \"right\" | \"center\";\n}\n\n/**\n * Action component\n * A versatile Action component that can be rendered as a button or link\n * with various styles, sizes, icon options, and dropdown functionality\n * @example\n * <Action\n * label=\"Click Me\"\n * onClick={() => alert('Action clicked!')}\n * variant=\"primary\"\n * size=\"medium\"\n * fullWidth={false}\n * disabled={false}\n * iconBefore={<Icon />}\n * />\n */\nconst Action: React.FC<ActionProps> = ({\n label,\n onClick,\n href,\n variant = \"primary\",\n size = \"medium\",\n fullWidth = false,\n disabled = false,\n iconBefore,\n iconAfter,\n className = \"\",\n target,\n type = \"button\",\n animated = false,\n dropdown = false,\n dropdownItems = [],\n dropdownPosition = \"right\",\n}) => {\n // State to manage dropdown visibility\n const [isDropdownOpen, setIsDropdownOpen] = React.useState(false);\n const dropdownRef = React.useRef<HTMLDivElement>(null);\n\n // Handle opening/closing the dropdown\n const toggleDropdown = (e: React.MouseEvent) => {\n if (dropdown) {\n e.preventDefault();\n e.stopPropagation();\n setIsDropdownOpen((prev) => !prev);\n }\n };\n\n // Close dropdown when clicking outside\n React.useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (\n dropdownRef.current &&\n !dropdownRef.current.contains(event.target as Node)\n ) {\n setIsDropdownOpen(false);\n }\n };\n\n if (isDropdownOpen) {\n document.addEventListener(\"mousedown\", handleClickOutside);\n }\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }, [isDropdownOpen]);\n\n // Construct class names based on props\n const baseClasses = [\n \"ihub-action\",\n `ihub-action-${variant}`,\n `ihub-action-${size}`,\n fullWidth ? \"ihub-action-full-width\" : \"\",\n disabled ? \"ihub-action-disabled\" : \"\",\n animated ? \"ihub-action-animated\" : \"\",\n dropdown ? \"ihub-action-with-dropdown\" : \"\",\n className,\n ]\n .filter(Boolean)\n .join(\" \");\n\n // Common content for both button and link\n const content = (\n <>\n {iconBefore && (\n <span className=\"ihub-action-icon-before\">{iconBefore}</span>\n )}\n <span className=\"ihub-action-label\">{label}</span>\n {dropdown && (\n <span className=\"ihub-action-dropdown-icon\">\n <svg\n width=\"12\"\n height=\"7\"\n viewBox=\"0 0 12 7\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style={variant === \"primary\" ? { color: \"#fff\" } : {}}\n >\n <path\n d=\"M1 1L6 6L11 1\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </span>\n )}\n {!dropdown && iconAfter && (\n <span className=\"ihub-action-icon-after\">{iconAfter}</span>\n )}\n </>\n );\n\n // Dropdown menu\n const dropdownMenu = isDropdownOpen &&\n dropdown &&\n dropdownItems.length > 0 && (\n <div\n className={`ihub-action-dropdown-menu ihub-action-dropdown-${dropdownPosition}`}\n onClick={(e) => e.stopPropagation()}\n >\n {dropdownItems.map((item, index) => {\n const itemClasses = [\n \"ihub-action-dropdown-item\",\n item.disabled ? \"ihub-action-dropdown-item-disabled\" : \"\",\n item.className || \"\",\n ]\n .filter(Boolean)\n .join(\" \");\n\n const itemContent = (\n <>\n {item.iconBefore && (\n <span className=\"ihub-action-dropdown-item-icon\">\n {item.iconBefore}\n </span>\n )}\n <span className=\"ihub-action-dropdown-item-label\">\n {item.label}\n </span>\n </>\n );\n\n if (item.href && !item.disabled) {\n return (\n <Link\n key={index}\n href={item.href}\n className={itemClasses}\n onClick={() => {\n if (item.onClick) item.onClick();\n setIsDropdownOpen(false);\n }}\n >\n {itemContent}\n </Link>\n );\n }\n\n return (\n <button\n key={index}\n className={itemClasses}\n onClick={() => {\n if (!item.disabled && item.onClick) {\n item.onClick();\n setIsDropdownOpen(false);\n }\n }}\n disabled={item.disabled}\n type=\"button\"\n >\n {itemContent}\n </button>\n );\n })}\n </div>\n );\n\n // Wrapper to contain both the action and dropdown\n const renderWithDropdown = (actionElement: React.ReactElement) => {\n if (!dropdown) return actionElement;\n\n return (\n <div className=\"ihub-action-dropdown-container\" ref={dropdownRef}>\n {actionElement}\n {dropdownMenu}\n </div>\n );\n };\n\n // Render the appropriate element\n const actionElement =\n href && !disabled && !dropdown ? (\n <Link\n href={href}\n className={baseClasses}\n target={target}\n onClick={onClick}\n >\n {content}\n </Link>\n ) : (\n <button\n type={type}\n className={baseClasses}\n onClick={dropdown ? toggleDropdown : onClick}\n disabled={disabled}\n >\n {content}\n </button>\n );\n\n return renderWithDropdown(actionElement);\n};\n\nexport default Action;\n"],"names":["Action","_ref","label","onClick","href","_ref$variant","variant","_ref$size","size","_ref$fullWidth","fullWidth","_ref$disabled","disabled","iconBefore","iconAfter","_ref$className","className","target","_ref$type","type","_ref$animated","animated","_ref$dropdown","dropdown","_ref$dropdownItems","dropdownItems","_ref$dropdownPosition","dropdownPosition","_React$useState","React","useState","_React$useState2","_slicedToArray","isDropdownOpen","setIsDropdownOpen","dropdownRef","useRef","useEffect","handleClickOutside","event","current","contains","document","addEventListener","removeEventListener","baseClasses","concat","filter","Boolean","join","content","_jsxs","_Fragment","children","_jsx","width","height","viewBox","fill","xmlns","style","color","d","stroke","strokeWidth","strokeLinecap","strokeLinejoin","dropdownMenu","length","e","stopPropagation","map","item","index","itemClasses","itemContent","Link","actionElement","ref","renderWithDropdown","preventDefault","prev"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"Action.js","sources":["../../../../src/components/ui/Action.tsx"],"sourcesContent":["import React from \"react\";\nimport { createPortal } from \"react-dom\";\nimport Link from \"next/link\";\n\n/**\n * Defines the structure of a dropdown item\n */\nexport interface ActionDropdownItem {\n /** Text label to display for the dropdown item */\n label: string | React.ReactNode;\n /** Click handler function */\n onClick?: () => void;\n /** Link destination if the dropdown item is a link */\n href?: string;\n /** Icon to display before the label */\n iconBefore?: React.ReactNode;\n /** Whether the item is disabled */\n disabled?: boolean;\n /** Optional additional class names */\n className?: string;\n}\n\n/**\n * ActionProps interface defines all possible props for the Action component\n */\ninterface ActionProps {\n /** Text label to display in the action element */\n label: string | React.ReactNode;\n /** Click handler function */\n onClick?: () => void;\n /** Link destination if the action is a link */\n href?: string;\n /** Visual style variant */\n variant?: \"primary\" | \"secondary\" | \"outline\" | \"danger\" | \"text\";\n /** Size variation */\n size?: \"small\" | \"medium\" | \"large\";\n /** Whether the action should take up full width of container */\n fullWidth?: boolean;\n /** Whether the action is disabled */\n disabled?: boolean;\n /** Icon to display before the label */\n iconBefore?: React.ReactNode;\n /** Icon to display after the label */\n iconAfter?: React.ReactNode;\n /** Optional additional class names */\n className?: string;\n /** Target attribute for links */\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\";\n /** Type attribute for buttons */\n type?: \"button\" | \"submit\" | \"reset\";\n /** Whether to add animation effect */\n animated?: boolean;\n /** Whether to show a dropdown menu */\n dropdown?: boolean;\n /** Items to display in the dropdown menu */\n dropdownItems?: ActionDropdownItem[];\n /** Position of the dropdown menu */\n dropdownPosition?: \"left\" | \"right\" | \"center\";\n}\n\n/**\n * Action component\n * A versatile Action component that can be rendered as a button or link\n * with various styles, sizes, icon options, and dropdown functionality\n * @example\n * <Action\n * label=\"Click Me\"\n * onClick={() => alert('Action clicked!')}\n * variant=\"primary\"\n * size=\"medium\"\n * fullWidth={false}\n * disabled={false}\n * iconBefore={<Icon />}\n * />\n */\nconst Action: React.FC<ActionProps> = ({\n label,\n onClick,\n href,\n variant = \"primary\",\n size = \"medium\",\n fullWidth = false,\n disabled = false,\n iconBefore,\n iconAfter,\n className = \"\",\n target,\n type = \"button\",\n animated = false,\n dropdown = false,\n dropdownItems = [],\n dropdownPosition = \"right\",\n}) => {\n // State to manage dropdown visibility\n const [isDropdownOpen, setIsDropdownOpen] = React.useState(false);\n const dropdownRef = React.useRef<HTMLDivElement>(null);\n const menuRef = React.useRef<HTMLDivElement>(null);\n const [menuPosition, setMenuPosition] = React.useState<{\n top: number;\n left: number;\n }>({ top: 0, left: 0 });\n\n /**\n * Positions the menu from the trigger's bounding box.\n *\n * The menu is rendered into `document.body` rather than beside the trigger,\n * because an absolutely-positioned menu is clipped by any scrolling ancestor\n * — and the most common host for this component is a table row inside\n * `IHubTableServer`'s `.ihub-scroll-container` (`overflow: auto`), which is\n * only as tall as its rows. On a long table the menu had room and looked\n * fine; on a one-row table it was cut to a sliver. Filtering a table down to\n * a single result is exactly when someone reaches for that row's actions, so\n * the broken case was the common one.\n *\n * Flips above the trigger when there is not enough room below, and clamps to\n * the viewport horizontally.\n */\n const positionMenu = React.useCallback(() => {\n const trigger = dropdownRef.current;\n if (!trigger) return;\n\n const rect = trigger.getBoundingClientRect();\n const estimatedHeight = Math.min(dropdownItems.length * 40 + 8, 300);\n const menuWidth = Math.max(rect.width, 160);\n const openUpward =\n window.innerHeight - rect.bottom < estimatedHeight &&\n rect.top > estimatedHeight;\n\n let left = rect.left;\n if (dropdownPosition === \"right\") left = rect.right - menuWidth;\n else if (dropdownPosition === \"center\")\n left = rect.left + rect.width / 2 - menuWidth / 2;\n\n setMenuPosition({\n top: openUpward\n ? rect.top - estimatedHeight - 8\n : rect.bottom + 8,\n left: Math.max(8, Math.min(left, window.innerWidth - menuWidth - 8)),\n });\n }, [dropdownItems.length, dropdownPosition]);\n\n // Handle opening/closing the dropdown\n const toggleDropdown = (e: React.MouseEvent) => {\n if (dropdown) {\n e.preventDefault();\n e.stopPropagation();\n if (!isDropdownOpen) positionMenu();\n setIsDropdownOpen((prev) => !prev);\n }\n };\n\n // Close dropdown when clicking outside\n React.useEffect(() => {\n if (!isDropdownOpen) return;\n\n // Both refs are checked: the menu now lives outside the trigger's subtree,\n // so testing only the container would close it on its own menu items.\n const handleClickOutside = (event: MouseEvent) => {\n const target = event.target as Node;\n if (\n dropdownRef.current?.contains(target) ||\n menuRef.current?.contains(target)\n ) {\n return;\n }\n setIsDropdownOpen(false);\n };\n\n // Fixed coordinates go stale as soon as anything scrolls. Capture phase,\n // because the table's own scroll container never bubbles to window.\n const handleReflow = () => setIsDropdownOpen(false);\n\n document.addEventListener(\"mousedown\", handleClickOutside);\n window.addEventListener(\"scroll\", handleReflow, true);\n window.addEventListener(\"resize\", handleReflow);\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n window.removeEventListener(\"scroll\", handleReflow, true);\n window.removeEventListener(\"resize\", handleReflow);\n };\n }, [isDropdownOpen]);\n\n // Construct class names based on props\n const baseClasses = [\n \"ihub-action\",\n `ihub-action-${variant}`,\n `ihub-action-${size}`,\n fullWidth ? \"ihub-action-full-width\" : \"\",\n disabled ? \"ihub-action-disabled\" : \"\",\n animated ? \"ihub-action-animated\" : \"\",\n dropdown ? \"ihub-action-with-dropdown\" : \"\",\n className,\n ]\n .filter(Boolean)\n .join(\" \");\n\n // Common content for both button and link\n const content = (\n <>\n {iconBefore && (\n <span className=\"ihub-action-icon-before\">{iconBefore}</span>\n )}\n <span className=\"ihub-action-label\">{label}</span>\n {dropdown && (\n <span className=\"ihub-action-dropdown-icon\">\n <svg\n width=\"12\"\n height=\"7\"\n viewBox=\"0 0 12 7\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style={variant === \"primary\" ? { color: \"#fff\" } : {}}\n >\n <path\n d=\"M1 1L6 6L11 1\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </span>\n )}\n {!dropdown && iconAfter && (\n <span className=\"ihub-action-icon-after\">{iconAfter}</span>\n )}\n </>\n );\n\n // Dropdown menu\n const dropdownMenu = isDropdownOpen &&\n dropdown &&\n dropdownItems.length > 0 && (\n <div\n ref={menuRef}\n className={`ihub-action-dropdown-menu ihub-action-dropdown-${dropdownPosition}`}\n style={{ top: menuPosition.top, left: menuPosition.left }}\n onClick={(e) => e.stopPropagation()}\n >\n {dropdownItems.map((item, index) => {\n const itemClasses = [\n \"ihub-action-dropdown-item\",\n item.disabled ? \"ihub-action-dropdown-item-disabled\" : \"\",\n item.className || \"\",\n ]\n .filter(Boolean)\n .join(\" \");\n\n const itemContent = (\n <>\n {item.iconBefore && (\n <span className=\"ihub-action-dropdown-item-icon\">\n {item.iconBefore}\n </span>\n )}\n <span className=\"ihub-action-dropdown-item-label\">\n {item.label}\n </span>\n </>\n );\n\n if (item.href && !item.disabled) {\n return (\n <Link\n key={index}\n href={item.href}\n className={itemClasses}\n onClick={() => {\n if (item.onClick) item.onClick();\n setIsDropdownOpen(false);\n }}\n >\n {itemContent}\n </Link>\n );\n }\n\n return (\n <button\n key={index}\n className={itemClasses}\n onClick={() => {\n if (!item.disabled && item.onClick) {\n item.onClick();\n setIsDropdownOpen(false);\n }\n }}\n disabled={item.disabled}\n type=\"button\"\n >\n {itemContent}\n </button>\n );\n })}\n </div>\n );\n\n // Wrapper to contain both the action and dropdown\n const renderWithDropdown = (actionElement: React.ReactElement) => {\n if (!dropdown) return actionElement;\n\n return (\n <div className=\"ihub-action-dropdown-container\" ref={dropdownRef}>\n {actionElement}\n {dropdownMenu &&\n typeof document !== \"undefined\" &&\n createPortal(dropdownMenu, document.body)}\n </div>\n );\n };\n\n // Render the appropriate element\n const actionElement =\n href && !disabled && !dropdown ? (\n <Link\n href={href}\n className={baseClasses}\n target={target}\n onClick={onClick}\n >\n {content}\n </Link>\n ) : (\n <button\n type={type}\n className={baseClasses}\n onClick={dropdown ? toggleDropdown : onClick}\n disabled={disabled}\n {...(dropdown\n ? { \"aria-haspopup\": \"menu\" as const, \"aria-expanded\": isDropdownOpen }\n : {})}\n >\n {content}\n </button>\n );\n\n return renderWithDropdown(actionElement);\n};\n\nexport default Action;\n"],"names":["Action","_ref","label","onClick","href","_ref$variant","variant","_ref$size","size","_ref$fullWidth","fullWidth","_ref$disabled","disabled","iconBefore","iconAfter","_ref$className","className","target","_ref$type","type","_ref$animated","animated","_ref$dropdown","dropdown","_ref$dropdownItems","dropdownItems","_ref$dropdownPosition","dropdownPosition","_React$useState","React","useState","_React$useState2","_slicedToArray","isDropdownOpen","setIsDropdownOpen","dropdownRef","useRef","menuRef","_React$useState3","top","left","_React$useState4","menuPosition","setMenuPosition","positionMenu","useCallback","trigger","current","rect","getBoundingClientRect","estimatedHeight","Math","min","length","menuWidth","max","width","openUpward","window","innerHeight","bottom","right","innerWidth","useEffect","handleClickOutside","event","_dropdownRef$current","_menuRef$current","contains","handleReflow","document","addEventListener","removeEventListener","baseClasses","concat","filter","Boolean","join","content","_jsxs","_Fragment","children","_jsx","height","viewBox","fill","xmlns","style","color","d","stroke","strokeWidth","strokeLinecap","strokeLinejoin","dropdownMenu","ref","e","stopPropagation","map","item","index","itemClasses","itemContent","Link","actionElement","createPortal","body","renderWithDropdown","_objectSpread","preventDefault","prev"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{slicedToArray as e,toConsumableArray as n}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as
|
|
1
|
+
import{slicedToArray as e,toConsumableArray as n}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as o,jsx as i}from"react/jsx-runtime";import{useState as r,useRef as a,useEffect as t,useCallback as l,useLayoutEffect as d,useMemo as c}from"react";import{createPortal as u}from"react-dom";import s from"@mui/icons-material/CloseOutlined";import p from"@mui/icons-material/KeyboardArrowDownOutlined";import h from"@mui/icons-material/SearchOutlined";var v=function(v){var m=v.label,b=v.name,f=v.key_name,w=v.required,g=v.options,y=v.selectedValue,N=v.onChange,x=v.placeholder,C=void 0===x?"Select...":x,A=v.className,L=void 0===A?"":A,E=v.isMulti,k=void 0!==E&&E,D=v.isSearchable,O=void 0!==D&&D,H=v.noOptionsMessage,M=void 0===H?"No options available":H,S=v.isDisabled,K=void 0!==S&&S,P=v.maxHeight,_=void 0===P?250:P,j=v.renderOption,q=r(!1),z=e(q,2),B=z[0],R=z[1],F=r(""),I=e(F,2),T=I[0],U=I[1],V=r(y),G=e(V,2),J=G[0],Q=G[1],W=a(null),X=a(null),Y=a(null),Z=r({top:0,left:0,width:0}),$=e(Z,2),ee=$[0],ne=$[1];t(function(){Q(y)},[y]);var oe=l(function(){var e,n=null===(e=W.current)||void 0===e?void 0:e.getBoundingClientRect();if(n){var o=window.innerHeight-n.bottom,i=o<_&&n.top>o;ne({top:i?Math.max(8,n.top-Math.min(_,n.top-8)-5):n.bottom+5,left:n.left,width:n.width})}},[_]);d(function(){B&&oe()},[B,oe]),t(function(){if(B){var e=function(e){var n,o,i=e.target;null!==(n=W.current)&&void 0!==n&&n.contains(i)||null!==(o=X.current)&&void 0!==o&&o.contains(i)||R(!1)},n=function(){return R(!1)};return document.addEventListener("mousedown",e),window.addEventListener("scroll",n,!0),window.addEventListener("resize",n),function(){document.removeEventListener("mousedown",e),window.removeEventListener("scroll",n,!0),window.removeEventListener("resize",n)}}},[B]),t(function(){B&&O&&Y.current&&Y.current.focus()},[B,O]);var ie=c(function(){return T?g.filter(function(e){return f?(e[f]||"").toLowerCase().includes((T||"").toLowerCase()):((null==e?void 0:e.label)||"").toLowerCase().includes((T||"").toLowerCase())}):g},[g,T]),re=function(e){if(!K)switch(e.key){case"Enter":case"ArrowDown":case"ArrowUp":B||R(!0);break;case"Escape":R(!1)}},ae=J?Array.isArray(J)?g.filter(function(e){return J.includes(e.value)}):g.filter(function(e){return e.value===J}):[];return o("div",{className:"ihub-wrapper ihub-dropdown-field ".concat(L," ").concat(K?"ihub-dropdown-disabled":""," ").concat(B?"active":""),ref:W,tabIndex:K?-1:0,onKeyDown:re,"aria-expanded":B,"aria-disabled":K,"aria-haspopup":"listbox",role:"combobox",children:[o("div",{className:"ihub-dropdown-trigger ".concat(B?"ihub-dropdown-open":""),onClick:function(){K||(R(!B),U(""))},children:[i("div",{className:"ihub-dropdown-value",children:ae.length>0?k?i("div",{className:"ihub-dropdown-tags",children:ae.map(function(e){return o("div",{className:"ihub-dropdown-tag",children:[f?e[f]:null==e?void 0:e.label,i("button",{type:"button",className:"ihub-dropdown-tag-remove",onClick:function(n){return function(e,n){if(n.stopPropagation(),Array.isArray(J)){var o=J.filter(function(n){return n!==e});Q(o),null==N||N(o)}}(e.value,n)},"aria-label":"Remove ".concat(f?e[f]:null==e?void 0:e.label),children:i(s,{})})]},e.value)})}):f?ae[0][f]:ae[0].label:i("span",{className:"ihub-dropdown-placeholder",children:C})}),i("div",{className:"ihub-dropdown-indicator",children:i(p,{className:B?"ihub-dropdown-chevron-up":""})}),m&&o("label",{htmlFor:b,className:"ihub-chips-label ihub-text-label",children:[m,w&&i("span",{className:"ihub-required",children:"*"})]}),b?i("input",{name:b,type:"hidden",value:"".concat(J),onChange:function(){}}):""]}),B&&"undefined"!=typeof document&&u(o("div",{ref:X,className:"ihub-dropdown-menu ihub-dropdown-menu-portal",style:{maxHeight:"".concat(_,"px"),top:"".concat(ee.top,"px"),left:"".concat(ee.left,"px"),width:"".concat(ee.width,"px")},role:"listbox","aria-multiselectable":k,onKeyDown:re,children:[O&&o("div",{className:"ihub-dropdown-search",children:[i(h,{className:"ihub-dropdown-search-icon"}),i("input",{type:"text",value:T,onChange:function(e){return U(e.target.value)},placeholder:"Search...",ref:Y,className:"ihub-dropdown-search-input",onClick:function(e){return e.stopPropagation()}})]}),i("div",{className:"ihub-dropdown-options",children:ie.length>0?ie.map(function(e){var o=Array.isArray(J)?J.includes(e.value):J===e.value;return i("div",{className:"ihub-dropdown-option ".concat(o?"ihub-dropdown-selected":""," ").concat(e.disabled?"ihub-dropdown-disabled-option":""),onClick:function(){return function(e){if(!e.disabled)if(k){var o=Array.isArray(J)?J:[];if(o.includes(e.value)){var i=o.filter(function(n){return n!==e.value});Q(i),null==N||N(i)}else{var r=[].concat(n(o),[e.value]);Q(r),null==N||N(r)}}else Q(e.value),null==N||N(e.value),R(!1)}(e)},role:"option","aria-selected":o,"aria-disabled":e.disabled,children:j?j(e):f?e[f]:null==e?void 0:e.label},e.value)}):i("div",{className:"ihub-dropdown-no-options",children:M})})]}),document.body)]})};export{v as default};
|
|
2
2
|
//# sourceMappingURL=Dropdown.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{slicedToArray as e,objectSpread2 as t,toConsumableArray as n,asyncToGenerator as a,regenerator as r}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as i,jsxs as o}from"react/jsx-runtime";import c,{forwardRef as l,useRef as s,useState as u,useCallback as d,useImperativeHandle as h,useEffect as p}from"react";import m from"@mui/icons-material/FileDownloadOutlined";import b from"@mui/icons-material/RefreshOutlined";import f from"@mui/icons-material/InventoryOutlined";import g from"@mui/icons-material/ExpandMoreOutlined";import v from"@mui/icons-material/ExpandLessOutlined";import"../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js";import{getNestedValue as N,reqOptions as P,API_HOST_URL as w}from"../../lib/helpFunction.js";import{openToast as x}from"../../lib/modals/modals.js";import"../../lib/utils.js";import"../../lib/phoneUtils.js";import{exportTableData as y,resolveExportOptions as k}from"./utils/tableExport.js";import{l as C}from"../../../../_virtual/lodash.js";var S=l(function(l,S){var E=l.token,j=l.columns,R=l.defaultData,O=l.endpointPath,F=l.initialParams,M=void 0===F?{}:F,A=l.searchParams,H=l.dataAdapter,T=l.title,_=l.emptyStateMessage,D=void 0===_?"No data available":_,I=l.emptyStateIcon,L=void 0===I?i(f,{}):I,G=l.actions,U=l.showSearch,z=void 0===U||U,B=l.searchPlaceholder,J=void 0===B?"Search...":B,V=l.searchDebounceMs,W=void 0===V?1e3:V,q=l.enableSorting,K=void 0===q||q,Q=l.enableExport,X=void 0!==Q&&Q,Y=l.exportOptions,Z=void 0===Y?{csv:!0}:Y,$=l.rowsPerPageOptions,ee=void 0===$?[10,25,50,100]:$,te=l.defaultRowsPerPage,ne=void 0===te?10:te,ae=l.onRowClick,re=l.onFetchError,ie=l.expandable,oe=void 0!==ie&&ie,ce=l.renderExpandedRow,le=l.keyExtractor,se=void 0===le?function(e){return JSON.stringify(e)}:le,ue=l.stickyHeader,de=void 0!==ue&&ue,he=l.maxHeight,pe=l.hideHeaderOnMobile,me=void 0!==pe&&pe,be=l.showRowNumbers,fe=void 0!==be&&be,ge=l.rowNumberStartFrom,ve=void 0===ge?1:ge,Ne=s(!0),Pe=s(null),we=u(R||[]),xe=e(we,2),ye=xe[0],ke=xe[1],Ce=u(!0),Se=e(Ce,2),Ee=Se[0],je=Se[1],Re=u(null),Oe=e(Re,2),Fe=Oe[0],Me=Oe[1],Ae=u({totalCount:0,currentPage:1,perPage:ne,totalPages:0}),He=e(Ae,2),Te=He[0],_e=He[1],De=u(t({page:1,limit:ne},M)),Ie=e(De,2),Le=Ie[0],Ge=Ie[1],Ue=u([]),ze=e(Ue,2),Be=ze[0],Je=ze[1],Ve=u(M.search||""),We=e(Ve,2),qe=We[0],Ke=We[1],Qe=d(C.exports.debounce(function(e){Ge(function(n){return t(t({},n),{},{search:e,page:1})})},W),[]),Xe=(R||[]).length,Ye={data:R||[],pagination:{totalCount:Xe,currentPage:1,perPage:10,totalPages:Math.ceil(Xe/10)||1},links:{next:null,previous:null}},Ze=d(function(){var t=a(r().m(function t(n){var a,i,o,c,l,s,u,d;return r().w(function(t){for(;;)switch(t.p=t.n){case 0:if(je(!0),t.p=1,O){t.n=2;break}return t.a(2,Ye);case 2:return a=new URLSearchParams({limit:n.limit.toString(),offset:((n.page-1)*n.limit).toString()}),n.search&&a.append("search",n.search),n.sort&&(i="desc"===n.direction?"-":"",a.append("ordering","".concat(i).concat(n.sort))),A&&Object.entries(A).forEach(function(t){var n=e(t,2),r=n[0],i=n[1];null!=i&&""!==i&&a.append(r,String(i))}),o=P("GET",null,E),c="".concat(w).concat(O,"?").concat(a.toString()),t.n=3,fetch(c,o);case 3:return l=t.v,t.n=4,l.json();case 4:if(s=t.v,l.ok){t.n=5;break}throw u=s.detail||s.error||"Failed to fetch data",new Error(u);case 5:return t.a(2,{data:s.results,pagination:{totalCount:s.count,currentPage:n.page,perPage:n.limit,totalPages:Math.ceil(s.count/n.limit)},links:{next:s.next,previous:s.previous}});case 6:throw t.p=6,d=t.v,console.error("Error fetching program courses:",d),d;case 7:return t.p=7,je(!1),t.f(7);case 8:return t.a(2)}},t,null,[[1,6,7,8]])}));return function(e){return t.apply(this,arguments)}}(),[A]),$e=d(function(e){var t=e.target.value;Ke(t),Qe(t)},[Qe]),et=d(function(e){Ge(function(n){return t(t({},n),{},{page:e})})},[]),tt=d(function(e){Ge(function(n){return t(t({},n),{},{page:1,limit:e})})},[]),nt=d(function(e){if(K&&e.sortable&&"string"==typeof e.accessor){var n=e.accessor;Ge(function(e){return e.sort===n?t(t({},e),{},{direction:"asc"===e.direction?"desc":"asc"}):t(t({},e),{},{sort:n,direction:"asc"})})}},[K]),at=d(function(){Ge(function(e){return t({},e)})},[]);h(S,function(){return{refresh:at}},[at]);var rt=d(function(){var e=a(r().m(function e(a,i){var o,c,l,s,u,d,h;return r().w(function(e){for(;;)switch(e.n){case 0:o=[],c=1,l=1/0;case 1:if(!(o.length<Math.min(l,i))){e.n=4;break}return e.n=2,Ze(t(t({},Le),{},{page:c,limit:a}));case 2:if(u=e.v,d=H?H(u):u,h=(null==d?void 0:d.data)||[],o.push.apply(o,n(h)),void 0!==(null==d||null===(s=d.pagination)||void 0===s?void 0:s.totalCount)&&(l=d.pagination.totalCount),h.length===a){e.n=3;break}return e.a(3,4);case 3:c+=1,e.n=1;break;case 4:return e.a(2,o.slice(0,i))}},e)}));return function(t,n){return e.apply(this,arguments)}}(),[Le,H,Ze]),it=d(function(){var e=a(r().m(function e(t){var n,a,i,o,c;return r().w(function(e){for(;;)switch(e.p=e.n){case 0:if(X){e.n=1;break}return e.a(2);case 1:return n=k(Z),a=n.batchSize,i=n.maxRows,e.p=2,je(!0),e.n=3,rt(a,i);case 3:if((o=e.v).length){e.n=4;break}return x("There is no data to export.",400),e.a(2);case 4:return e.n=5,y({data:o,columns:j,format:t,fileName:n.fileName,title:T,showRowNumbers:fe,rowNumberStartFrom:ve,fields:n.fields,allFields:n.allFields});case 5:o.length>=i&&x("Export capped at ".concat(i," rows. Increase exportOptions.maxRows for more."),400),e.n=7;break;case 6:e.p=6,c=e.v,console.error("Export error:",c),x(c instanceof Error?c.message:"Export failed. Try again.",400),re&&re(c);case 7:return e.p=7,je(!1),e.f(7);case 8:return e.a(2)}},e,null,[[2,6,7,8]])}));return function(t){return e.apply(this,arguments)}}(),[j,X,Z,rt,re,ve,fe,T]),ot=d(function(e,t){t.stopPropagation(),Je(function(t){return t.includes(e)?t.filter(function(t){return t!==e}):[].concat(n(t),[e])})},[]);return p(function(){var e=!0,t=function(){var t=a(r().m(function t(){var n,a,i;return r().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,je(!0),t.n=1,Ze(Le);case 1:n=t.v,e&&(H?(a=H(n),ke(a.data),a.pagination&&_e(a.pagination)):n&&(ke(n.data),n.pagination&&_e(n.pagination)),Me(null)),t.n=3;break;case 2:t.p=2,i=t.v,console.error("Error fetching data:",i),e&&(Me(i),re&&re(i));case 3:return t.p=3,e&&(je(!1),Ne.current=!1),t.f(3);case 4:return t.a(2)}},t,null,[[0,2,3,4]])}));return function(){return t.apply(this,arguments)}}();return t(),function(){e=!1}},[Le,H,re]),p(function(){A&&!Ne.current&&Ge(function(e){return t({},e)})},[A]),Ee&&Ne.current?o("div",{className:"ihub-data-list-container",children:[T&&i("h2",{children:T}),i("div",{className:"ihub-loading-state",children:i("p",{children:"Loading data..."})})]}):Fe&&!Ee&&0===(ye||[]).length?o("div",{className:"ihub-data-list-container",children:[T&&i("h2",{children:T}),o("div",{className:"ihub-error-state",children:[i("p",{children:Fe.message||"Error loading data. Please try again."}),i("button",{className:"ihub-important-btn",onClick:at,children:"Retry"})]})]}):o("div",{className:"ihub-data-list-container",ref:Pe,children:[(T||G||z||X)&&o("div",{className:"ihub-data-list-header ihub-table-header ihub-p-0",children:[i("div",{children:T&&i("h2",{children:T})}),o("div",{className:"ihub-table-controls",children:[z&&i("div",{className:"ihub-table-search",children:o("div",{className:"ihub-search-input-wrapper",children:[i("input",{type:"text",placeholder:J,value:qe,onChange:$e,className:"ihub-search-input"}),Ee&&i("div",{className:"ihub-search-loading-indicator",children:i("span",{className:"ihub-loading-dot"})})]})}),X&&o("div",{className:"ihub-export-buttons",children:[Z.csv&&o("button",{className:"ihub-export-button ihub-export-csv",onClick:function(){return it("csv")},disabled:Ee,children:[i(m,{}),"CSV"]}),Z.excel&&o("button",{className:"ihub-export-button ihub-export-excel",onClick:function(){return it("excel")},disabled:Ee,children:[i(m,{}),"Excel"]}),Z.pdf&&o("button",{className:"ihub-export-button ihub-export-pdf",onClick:function(){return it("pdf")},disabled:Ee,children:[i(m,{}),"PDF"]})]}),o("button",{className:"ihub-refresh-button",onClick:at,disabled:Ee,children:[i(b,{}),"Refresh"]}),G&&i("div",{className:"ihub-data-controls ihub-mb-0",children:G})]})]}),Ee&&!Ne.current&&i("div",{className:"ihub-table-loading-overlay",children:i("div",{className:"ihub-loading-spinner"})}),o("div",{className:"ihub-scroll-container ".concat(de?"ihub-sticky-header":""),style:he?{maxHeight:he}:void 0,children:[o("table",{className:"ihub-table ihub-scroll-container",children:[i("thead",{className:me?"ihub-hide-on-mobile":"",children:o("tr",{children:[fe&&i("th",{style:{width:"60px",textAlign:"center"},children:"#"}),oe&&ce&&i("th",{style:{width:"40px"}}),j.map(function(e,t){return i("th",{className:"".concat(e.sortable&&K?"ihub-sortable-column":""," ").concat(Le.sort===e.accessor?"ihub-sorted-".concat(Le.direction):""),style:e.width?{width:e.width}:void 0,onClick:function(){return e.sortable&&K?nt(e):void 0},children:o("div",{className:"ihub-column-header",children:[i("span",{children:e.header}),e.sortable&&K&&i("span",{className:"ihub-sort-icon",children:Le.sort===e.accessor&&"asc"===Le.direction?"▲":Le.sort===e.accessor&&"desc"===Le.direction?"▼":"⇅"})]})},t)})]})}),Ee||0!==(ye||[]).length?i("tbody",{children:ye.map(function(e,t){var n=se(e),a=Be.includes(n);return o(c.Fragment,{children:[o("tr",{onClick:function(){return ae&&ae(e)},className:ae?"ihub-clickable-row":"",children:[fe&&i("td",{style:{textAlign:"center",fontWeight:"500"},children:(Te.currentPage-1)*Te.perPage+t+ve}),oe&&ce&&i("td",{onClick:function(e){return ot(n,e)},children:i(a?v:g,{})}),j.map(function(t,n){return i("td",{"data-label":me?t.header:void 0,children:t.tooltip&&"string"==typeof t.accessor?i("div",{className:"ihub-cell-tooltip","data-tooltip":String(N(e,t.accessor)),children:t.cell?t.cell(e):N(e,t.accessor)}):t.cell?t.cell(e):"function"==typeof t.accessor?t.accessor(e):N(e,t.accessor)},n)})]}),oe&&ce&&a&&i("tr",{className:"ihub-expanded-row",children:i("td",{colSpan:(j||[]).length+1+(fe?1:0),children:i("div",{className:"ihub-row-details",children:ce(e)})})})]},n)})}):""]}),Ee||0!==(ye||[]).length?"":o("div",{className:"ihub-data-list-container",children:[G&&i("div",{className:"ihub-data-controls ihub-mb-0",children:G}),i("div",{className:"ihub-empty-state",children:o("div",{children:[L,i("p",{children:D})]})})]})]}),Te&&Te.totalPages>1&&o("div",{className:"ihub-table-pagination",children:[o("div",{className:"ihub-pagination-info",children:["Showing ",(Te.currentPage-1)*Te.perPage+1," to"," ",Math.min(Te.currentPage*Te.perPage,Te.totalCount)," ","of ",Te.totalCount," entries"]}),o("div",{className:"ihub-pagination-controls",children:[i("button",{className:"ihub-pagination-button",disabled:1===Te.currentPage||Ee,onClick:function(){return et(1)},children:"«"}),i("button",{className:"ihub-pagination-button",disabled:1===Te.currentPage||Ee,onClick:function(){return et(Te.currentPage-1)},children:"‹"}),Array.from({length:Math.min(5,Te.totalPages)},function(e,t){var n;return n=Te.totalPages<=5||Te.currentPage<=3?t+1:Te.currentPage>=Te.totalPages-2?Te.totalPages-4+t:Te.currentPage-2+t,i("button",{className:"ihub-pagination-button ".concat(Te.currentPage===n?"ihub-active":""),onClick:function(){return et(Number(n))},disabled:Ee,children:n},n)}),i("button",{className:"ihub-pagination-button",disabled:Te.currentPage===Te.totalPages||Ee,onClick:function(){return et(Te.currentPage+1)},children:"›"}),i("button",{className:"ihub-pagination-button",disabled:Te.currentPage===Te.totalPages||Ee,onClick:function(){return et(Te.totalPages)},children:"»"})]}),o("div",{className:"ihub-rows-per-page",children:[i("span",{children:"Rows per page:"}),i("select",{value:Te.perPage,onChange:function(e){return tt(Number(e.target.value))},className:"ihub-rows-select",disabled:Ee,children:ee.map(function(e){return i("option",{value:e,children:e},e)})})]})]})]})});S.displayName="IHubTableServer";export{S as IHubTableServer,S as default};
|
|
1
|
+
import{slicedToArray as e,objectSpread2 as t,toConsumableArray as n,asyncToGenerator as r,regenerator as a}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as i,jsxs as o}from"react/jsx-runtime";import c,{forwardRef as l,useRef as s,useMemo as u,useEffect as d,useState as h,useCallback as p,useImperativeHandle as b}from"react";import m from"@mui/icons-material/FileDownloadOutlined";import f from"@mui/icons-material/RefreshOutlined";import g from"@mui/icons-material/InventoryOutlined";import v from"@mui/icons-material/ExpandMoreOutlined";import N from"@mui/icons-material/ExpandLessOutlined";import"../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js";import{getNestedValue as P,reqOptions as w,API_HOST_URL as x}from"../../lib/helpFunction.js";import{openToast as y}from"../../lib/modals/modals.js";import"../../lib/utils.js";import"../../lib/phoneUtils.js";import{exportTableData as k,resolveExportOptions as C}from"./utils/tableExport.js";import{l as S}from"../../../../_virtual/lodash.js";var E=l(function(l,E){var O=l.token,j=l.columns,R=l.defaultData,F=l.endpointPath,A=l.initialParams,M=void 0===A?{}:A,T=l.searchParams,H=l.dataAdapter,_=l.title,D=l.emptyStateMessage,I=void 0===D?"No data available":D,J=l.emptyStateIcon,L=void 0===J?i(g,{}):J,G=l.actions,U=l.showSearch,q=void 0===U||U,z=l.searchPlaceholder,B=void 0===z?"Search...":z,V=l.searchDebounceMs,W=void 0===V?1e3:V,K=l.enableSorting,Q=void 0===K||K,X=l.enableExport,Y=void 0!==X&&X,Z=l.exportOptions,$=void 0===Z?{csv:!0}:Z,ee=l.rowsPerPageOptions,te=void 0===ee?[10,25,50,100]:ee,ne=l.defaultRowsPerPage,re=void 0===ne?10:ne,ae=l.onRowClick,ie=l.onFetchError,oe=l.expandable,ce=void 0!==oe&&oe,le=l.renderExpandedRow,se=l.keyExtractor,ue=void 0===se?function(e){return JSON.stringify(e)}:se,de=l.stickyHeader,he=void 0!==de&&de,pe=l.maxHeight,be=l.hideHeaderOnMobile,me=void 0!==be&&be,fe=l.showRowNumbers,ge=void 0!==fe&&fe,ve=l.rowNumberStartFrom,Ne=void 0===ve?1:ve,Pe=s(!0),we=s(null),xe=s(H),ye=s(ie),ke=s(T),Ce=u(function(){if(!T)return"";var t=Object.entries(T).sort(function(t,n){var r=e(t,1)[0],a=e(n,1)[0];return r<a?-1:r>a?1:0});return JSON.stringify(t)},[JSON.stringify(T)]);d(function(){xe.current=H,ye.current=ie,ke.current=T});var Se=s(0),Ee=h(R||[]),Oe=e(Ee,2),je=Oe[0],Re=Oe[1],Fe=h(!0),Ae=e(Fe,2),Me=Ae[0],Te=Ae[1],He=h(null),_e=e(He,2),De=_e[0],Ie=_e[1],Je=h(!1),Le=e(Je,2),Ge=Le[0],Ue=Le[1],qe=h({totalCount:0,currentPage:1,perPage:re,totalPages:0}),ze=e(qe,2),Be=ze[0],Ve=ze[1],We=h(t({page:1,limit:re},M)),Ke=e(We,2),Qe=Ke[0],Xe=Ke[1],Ye=h([]),Ze=e(Ye,2),$e=Ze[0],et=Ze[1],tt=h(M.search||""),nt=e(tt,2),rt=nt[0],at=nt[1],it=h(Ce),ot=e(it,2),ct=ot[0],lt=ot[1];ct!==Ce&&(lt(Ce),Ue(!1),Xe(function(e){return 1===e.page?e:t(t({},e),{},{page:1})}));var st=u(function(){return S.exports.debounce(function(e){Xe(function(n){return t(t({},n),{},{search:e,page:1})})},W)},[W]);d(function(){return function(){return st.cancel()}},[st]);var ut=(R||[]).length,dt={data:R||[],pagination:{totalCount:ut,currentPage:1,perPage:10,totalPages:Math.ceil(ut/10)||1},links:{next:null,previous:null}},ht=p(function(){var n=r(a().m(function n(r,i){var o,c,l,s,u,d,h,p,b,m,f,g;return a().w(function(n){for(;;)switch(n.p=n.n){case 0:if(Te(!0),n.p=1,F){n.n=2;break}return n.a(2,dt);case 2:return o=new URLSearchParams({limit:r.limit.toString(),offset:((r.page-1)*r.limit).toString()}),r.search&&o.append("search",r.search),r.sort&&(c="desc"===r.direction?"-":"",o.append("ordering","".concat(c).concat(r.sort))),(l=ke.current)&&Object.entries(l).forEach(function(t){var n=e(t,2),r=n[0],a=n[1];null!=a&&""!==a&&o.append(r,String(a))}),s=w("GET",null,O),u="".concat(x).concat(F,"?").concat(o.toString()),n.n=3,fetch(u,t(t({},s),{},{signal:i}));case 3:return d=n.v,h=null,n.p=4,n.n=5,d.json();case 5:h=n.v,n.n=7;break;case 6:n.p=6,n.v,h=null;case 7:if(d.ok){n.n=8;break}throw m=(null===(p=h)||void 0===p?void 0:p.detail)||(null===(b=h)||void 0===b?void 0:b.error)||(429===d.status?"Too many requests. Please wait a moment and try again.":"Failed to fetch data"),(f=new Error(m)).status=d.status,f;case 8:return n.a(2,{data:h.results,pagination:{totalCount:h.count,currentPage:r.page,perPage:r.limit,totalPages:Math.ceil(h.count/r.limit)},links:{next:h.next,previous:h.previous}});case 9:throw n.p=9,(g=n.v)instanceof Error&&"AbortError"===g.name||console.error("Error fetching table data:",g),g;case 10:return n.p=10,null!=i&&i.aborted||Te(!1),n.f(10);case 11:return n.a(2)}},n,null,[[4,6],[1,9,10,11]])}));return function(e,t){return n.apply(this,arguments)}}(),[O,F,Ce]),pt=p(function(e){var t=e.target.value;at(t),st(t)},[st]),bt=p(function(e){Xe(function(n){return t(t({},n),{},{page:e})})},[]),mt=p(function(e){Xe(function(n){return t(t({},n),{},{page:1,limit:e})})},[]),ft=p(function(e){if(Q&&e.sortable&&"string"==typeof e.accessor){var n=e.accessor;Xe(function(e){return e.sort===n?t(t({},e),{},{direction:"asc"===e.direction?"desc":"asc"}):t(t({},e),{},{sort:n,direction:"asc"})})}},[Q]),gt=p(function(){Ue(!1),Xe(function(e){return t({},e)})},[]);b(E,function(){return{refresh:gt}},[gt]);var vt=p(function(){var e=r(a().m(function e(r,i){var o,c,l,s,u,d,h,p;return a().w(function(e){for(;;)switch(e.n){case 0:o=[],c=1,l=1/0;case 1:if(!(o.length<Math.min(l,i))){e.n=4;break}return e.n=2,ht(t(t({},Qe),{},{page:c,limit:r}));case 2:if(u=e.v,d=xe.current,h=d?d(u):u,p=(null==h?void 0:h.data)||[],o.push.apply(o,n(p)),void 0!==(null==h||null===(s=h.pagination)||void 0===s?void 0:s.totalCount)&&(l=h.pagination.totalCount),p.length===r){e.n=3;break}return e.a(3,4);case 3:c+=1,e.n=1;break;case 4:return e.a(2,o.slice(0,i))}},e)}));return function(t,n){return e.apply(this,arguments)}}(),[Qe,ht]),Nt=p(function(){var e=r(a().m(function e(t){var n,r,i,o,c;return a().w(function(e){for(;;)switch(e.p=e.n){case 0:if(Y){e.n=1;break}return e.a(2);case 1:return n=C($),r=n.batchSize,i=n.maxRows,e.p=2,Te(!0),e.n=3,vt(r,i);case 3:if((o=e.v).length){e.n=4;break}return y("There is no data to export.",400),e.a(2);case 4:return e.n=5,k({data:o,columns:j,format:t,fileName:n.fileName,title:_,showRowNumbers:ge,rowNumberStartFrom:Ne,fields:n.fields,allFields:n.allFields});case 5:o.length>=i&&y("Export capped at ".concat(i," rows. Increase exportOptions.maxRows for more."),400),e.n=7;break;case 6:e.p=6,c=e.v,console.error("Export error:",c),y(c instanceof Error?c.message:"Export failed. Try again.",400),ie&&ie(c);case 7:return e.p=7,Te(!1),e.f(7);case 8:return e.a(2)}},e,null,[[2,6,7,8]])}));return function(t){return e.apply(this,arguments)}}(),[j,Y,$,vt,ie,Ne,ge,_]),Pt=p(function(e,t){t.stopPropagation(),et(function(t){return t.includes(e)?t.filter(function(t){return t!==e}):[].concat(n(t),[e])})},[]);return d(function(){if(!Ge){var e=new AbortController,t=++Se.current,n=function(){return t===Se.current&&!e.signal.aborted},i=function(){var t=r(a().m(function t(){var r,i,o,c,l;return a().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,ht(Qe,e.signal);case 1:if(r=t.v,n()){t.n=2;break}return t.a(2);case 2:(i=xe.current)?(o=i(r),Re(o.data),o.pagination&&Ve(o.pagination)):r&&(Re(r.data),r.pagination&&Ve(r.pagination)),Ie(null),t.n=6;break;case 3:if(t.p=3,!((l=t.v)instanceof Error&&"AbortError"===l.name)){t.n=4;break}return t.a(2);case 4:if(n()){t.n=5;break}return t.a(2);case 5:429===(null==l?void 0:l.status)&&Ue(!0),Ie(l),null===(c=ye.current)||void 0===c||c.call(ye,l);case 6:return t.p=6,n()&&(Te(!1),Pe.current=!1),t.f(6);case 7:return t.a(2)}},t,null,[[0,3,6,7]])}));return function(){return t.apply(this,arguments)}}();return i(),function(){e.abort()}}},[Qe,ht,Ge]),Me&&Pe.current?o("div",{className:"ihub-data-list-container",children:[_&&i("h2",{children:_}),i("div",{className:"ihub-loading-state",children:i("p",{children:"Loading data..."})})]}):De&&!Me&&0===(je||[]).length?o("div",{className:"ihub-data-list-container",children:[_&&i("h2",{children:_}),o("div",{className:"ihub-error-state",children:[i("p",{children:De.message||"Error loading data. Please try again."}),i("button",{className:"ihub-important-btn",onClick:gt,children:"Retry"})]})]}):o("div",{className:"ihub-data-list-container",ref:we,children:[(_||G||q||Y)&&o("div",{className:"ihub-data-list-header ihub-table-header ihub-p-0",children:[i("div",{children:_&&i("h2",{children:_})}),o("div",{className:"ihub-table-controls",children:[q&&i("div",{className:"ihub-table-search",children:o("div",{className:"ihub-search-input-wrapper",children:[i("input",{type:"text",placeholder:B,value:rt,onChange:pt,className:"ihub-search-input"}),Me&&i("div",{className:"ihub-search-loading-indicator",children:i("span",{className:"ihub-loading-dot"})})]})}),Y&&o("div",{className:"ihub-export-buttons",children:[$.csv&&o("button",{className:"ihub-export-button ihub-export-csv",onClick:function(){return Nt("csv")},disabled:Me,children:[i(m,{}),"CSV"]}),$.excel&&o("button",{className:"ihub-export-button ihub-export-excel",onClick:function(){return Nt("excel")},disabled:Me,children:[i(m,{}),"Excel"]}),$.pdf&&o("button",{className:"ihub-export-button ihub-export-pdf",onClick:function(){return Nt("pdf")},disabled:Me,children:[i(m,{}),"PDF"]})]}),o("button",{className:"ihub-refresh-button",onClick:gt,disabled:Me,children:[i(f,{}),"Refresh"]}),G&&i("div",{className:"ihub-data-controls ihub-mb-0",children:G})]})]}),Me&&!Pe.current&&i("div",{className:"ihub-table-loading-overlay",children:i("div",{className:"ihub-loading-spinner"})}),o("div",{className:"ihub-scroll-container ".concat(he?"ihub-sticky-header":""),style:pe?{maxHeight:pe}:void 0,children:[o("table",{className:"ihub-table ihub-scroll-container",children:[i("thead",{className:me?"ihub-hide-on-mobile":"",children:o("tr",{children:[ge&&i("th",{style:{width:"60px",textAlign:"center"},children:"#"}),ce&&le&&i("th",{style:{width:"40px"}}),j.map(function(e,t){return i("th",{className:"".concat(e.sortable&&Q?"ihub-sortable-column":""," ").concat(Qe.sort===e.accessor?"ihub-sorted-".concat(Qe.direction):""),style:e.width?{width:e.width}:void 0,onClick:function(){return e.sortable&&Q?ft(e):void 0},children:o("div",{className:"ihub-column-header",children:[i("span",{children:e.header}),e.sortable&&Q&&i("span",{className:"ihub-sort-icon",children:Qe.sort===e.accessor&&"asc"===Qe.direction?"▲":Qe.sort===e.accessor&&"desc"===Qe.direction?"▼":"⇅"})]})},t)})]})}),Me||0!==(je||[]).length?i("tbody",{children:je.map(function(e,t){var n=ue(e),r=$e.includes(n);return o(c.Fragment,{children:[o("tr",{onClick:function(){return ae&&ae(e)},className:ae?"ihub-clickable-row":"",children:[ge&&i("td",{style:{textAlign:"center",fontWeight:"500"},children:(Be.currentPage-1)*Be.perPage+t+Ne}),ce&&le&&i("td",{onClick:function(e){return Pt(n,e)},children:i(r?N:v,{})}),j.map(function(t,n){return i("td",{"data-label":me?t.header:void 0,children:t.tooltip&&"string"==typeof t.accessor?i("div",{className:"ihub-cell-tooltip","data-tooltip":String(P(e,t.accessor)),children:t.cell?t.cell(e):P(e,t.accessor)}):t.cell?t.cell(e):"function"==typeof t.accessor?t.accessor(e):P(e,t.accessor)},n)})]}),ce&&le&&r&&i("tr",{className:"ihub-expanded-row",children:i("td",{colSpan:(j||[]).length+1+(ge?1:0),children:i("div",{className:"ihub-row-details",children:le(e)})})})]},n)})}):""]}),Me||0!==(je||[]).length?"":o("div",{className:"ihub-data-list-container",children:[G&&i("div",{className:"ihub-data-controls ihub-mb-0",children:G}),i("div",{className:"ihub-empty-state",children:o("div",{children:[L,i("p",{children:I})]})})]})]}),Be&&Be.totalPages>1&&o("div",{className:"ihub-table-pagination",children:[o("div",{className:"ihub-pagination-info",children:["Showing ",(Be.currentPage-1)*Be.perPage+1," to"," ",Math.min(Be.currentPage*Be.perPage,Be.totalCount)," ","of ",Be.totalCount," entries"]}),o("div",{className:"ihub-pagination-controls",children:[i("button",{className:"ihub-pagination-button",disabled:1===Be.currentPage||Me,onClick:function(){return bt(1)},children:"«"}),i("button",{className:"ihub-pagination-button",disabled:1===Be.currentPage||Me,onClick:function(){return bt(Be.currentPage-1)},children:"‹"}),Array.from({length:Math.min(5,Be.totalPages)},function(e,t){var n;return n=Be.totalPages<=5||Be.currentPage<=3?t+1:Be.currentPage>=Be.totalPages-2?Be.totalPages-4+t:Be.currentPage-2+t,i("button",{className:"ihub-pagination-button ".concat(Be.currentPage===n?"ihub-active":""),onClick:function(){return bt(Number(n))},disabled:Me,children:n},n)}),i("button",{className:"ihub-pagination-button",disabled:Be.currentPage===Be.totalPages||Me,onClick:function(){return bt(Be.currentPage+1)},children:"›"}),i("button",{className:"ihub-pagination-button",disabled:Be.currentPage===Be.totalPages||Me,onClick:function(){return bt(Be.totalPages)},children:"»"})]}),o("div",{className:"ihub-rows-per-page",children:[i("span",{children:"Rows per page:"}),i("select",{value:Be.perPage,onChange:function(e){return mt(Number(e.target.value))},className:"ihub-rows-select",disabled:Me,children:te.map(function(e){return i("option",{value:e,children:e},e)})})]})]})]})});E.displayName="IHubTableServer";export{E as IHubTableServer,E as default};
|
|
2
2
|
//# sourceMappingURL=IHubTableServer.js.map
|
|
@@ -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: "failed" | "loading" | "idle";
|
|
7
7
|
id: string;
|
|
8
8
|
}, action: PayloadAction<object>) => void;
|
|
9
9
|
}, "channelDetails", "channelDetails", import("@reduxjs/toolkit").SliceSelectors<channelDetailsSliceState>>;
|
|
@@ -3,8 +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: "failed" | "loading" | "idle";
|
|
7
7
|
id: string;
|
|
8
|
-
}, action: PayloadAction<[
|
|
9
|
-
]>) => void;
|
|
8
|
+
}, action: PayloadAction<[]>) => void;
|
|
10
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: "failed" | "loading" | "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: "failed" | "loading" | "idle";
|
|
7
7
|
}, action: PayloadAction<string>) => void;
|
|
8
8
|
decrement: (state: {
|
|
9
9
|
value: string[];
|
|
10
|
-
status: "
|
|
10
|
+
status: "failed" | "loading" | "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: "failed" | "loading" | "idle";
|
|
7
7
|
}, action: PayloadAction<string>) => void;
|
|
8
8
|
decrement: (state: {
|
|
9
9
|
value: string[];
|
|
10
|
-
status: "
|
|
10
|
+
status: "failed" | "loading" | "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: "failed" | "loading" | "idle";
|
|
7
7
|
}, action: PayloadAction<number>) => void;
|
|
8
8
|
decrement: (state: {
|
|
9
9
|
value: number[];
|
|
10
|
-
status: "
|
|
10
|
+
status: "failed" | "loading" | "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: "failed" | "loading" | "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: "failed" | "loading" | "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: "failed" | "loading" | "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: "failed" | "loading" | "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: "failed" | "loading" | "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: "failed" | "loading" | "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: "failed" | "loading" | "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: "failed" | "loading" | "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: "failed" | "loading" | "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: "failed" | "loading" | "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: "failed" | "loading" | "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: "failed" | "loading" | "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: "failed" | "loading" | "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: "failed" | "loading" | "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: "failed" | "loading" | "idle";
|
|
7
7
|
}, action: PayloadAction<object>) => void;
|
|
8
8
|
}, "IPAdress", "IPAdress", import("@reduxjs/toolkit").SliceSelectors<IPAdressSliceState>>;
|
|
@@ -50,6 +50,12 @@ import { DropdownPropsType } from "@/types";
|
|
|
50
50
|
* @prop {boolean} isDisabled - Whether the dropdown is disabled
|
|
51
51
|
* @prop {number} maxHeight - The maximum height of the dropdown menu
|
|
52
52
|
* @prop {function} renderOption - The function to render the option label
|
|
53
|
+
*
|
|
54
|
+
* The menu is rendered through a portal on `document.body` at fixed
|
|
55
|
+
* coordinates taken from the trigger. An absolutely positioned menu is clipped
|
|
56
|
+
* by any ancestor with `overflow: auto|hidden` — a table's scroll container, a
|
|
57
|
+
* modal body, a card — which made the component unusable in exactly the places
|
|
58
|
+
* a compact picker is most wanted.
|
|
53
59
|
*/
|
|
54
60
|
declare const Dropdown: React.FC<DropdownPropsType>;
|
|
55
61
|
export default Dropdown;
|