ui-soxo-bootstrap-core 2.4.24
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/.babelrc +9 -0
- package/.github/workflows/npm-publish.yml +33 -0
- package/.husky/pre-commit +12 -0
- package/.prettierrc.json +11 -0
- package/babel.config.js +3 -0
- package/core/assets/images/vector.png +0 -0
- package/core/components/component-loader/component-loader.js +125 -0
- package/core/components/component-wrapper/component-wrapper.js +122 -0
- package/core/components/extra-info/extra-info-details.js +172 -0
- package/core/components/extra-info/extra-info-details.scss +27 -0
- package/core/components/extra-info/extra-info.js +134 -0
- package/core/components/index.js +18 -0
- package/core/components/landing-api/landing-api.js +492 -0
- package/core/components/landing-api/landing-api.scss +19 -0
- package/core/components/menu-template-api/menu-template-api.js +321 -0
- package/core/components/root-application-api/root-application-api.js +174 -0
- package/core/components/root-application-api/root-application.api.scss +0 -0
- package/core/index.js +14 -0
- package/core/lib/Store.js +363 -0
- package/core/lib/assets/Tick-icon.png +0 -0
- package/core/lib/assets/blue-slate-theme.png +0 -0
- package/core/lib/assets/dark-theme.png +0 -0
- package/core/lib/assets/deep-purple-theme.png +0 -0
- package/core/lib/assets/light-theme.png +0 -0
- package/core/lib/assets/nura-theme.png +0 -0
- package/core/lib/assets/plant.png +0 -0
- package/core/lib/assets/welcome-image.png +0 -0
- package/core/lib/assets/white-haze-theme.png +0 -0
- package/core/lib/components/application-bootstrap/application-bootstrap.js +115 -0
- package/core/lib/components/application-bootstrap/application-bootstrap.scss +0 -0
- package/core/lib/components/approval-form/approval-form.js +280 -0
- package/core/lib/components/approval-form/approval-form.scss +184 -0
- package/core/lib/components/approval-list/approval-list.js +143 -0
- package/core/lib/components/approval-list/approval-list.scss +3 -0
- package/core/lib/components/approval-list/components/request-card/request-card.js +43 -0
- package/core/lib/components/approval-list/components/request-card/request-card.scss +31 -0
- package/core/lib/components/camera/camera.js +231 -0
- package/core/lib/components/camera/camera.scss +86 -0
- package/core/lib/components/comment-block/comment-block.js +139 -0
- package/core/lib/components/comment-block/comment-block.scss +3 -0
- package/core/lib/components/confirm-modal/confirm-modal.js +82 -0
- package/core/lib/components/confirm-modal/confirm-modal.scss +3 -0
- package/core/lib/components/consent/consent.js +67 -0
- package/core/lib/components/consent/consent.scss +0 -0
- package/core/lib/components/consent/pdf-signature.js +299 -0
- package/core/lib/components/consent/signature-pad.js +90 -0
- package/core/lib/components/consent/signature-pad.scss +14 -0
- package/core/lib/components/file-upload/file-upload.js +133 -0
- package/core/lib/components/finger-print-reader/finger-print-reader.js +296 -0
- package/core/lib/components/finger-print-reader/finger-print-reader.scss +47 -0
- package/core/lib/components/finger-print-search/finger-print-search.js +200 -0
- package/core/lib/components/finger-print-search/finger-print-search.scss +47 -0
- package/core/lib/components/global-header/animations.js +18 -0
- package/core/lib/components/global-header/global-header.js +413 -0
- package/core/lib/components/global-header/global-header.scss +369 -0
- package/core/lib/components/header/generic-header.js +76 -0
- package/core/lib/components/header/generic-header.scss +99 -0
- package/core/lib/components/image-preview/image-preview.js +33 -0
- package/core/lib/components/image-wrapper/image-wrapper.js +108 -0
- package/core/lib/components/image-wrapper/image-wrapper.scss +13 -0
- package/core/lib/components/index.js +203 -0
- package/core/lib/components/landing/landing.js +404 -0
- package/core/lib/components/landing/landing.scss +0 -0
- package/core/lib/components/language-switcher/language-switcher.js +50 -0
- package/core/lib/components/menu-context/menu-context.js +70 -0
- package/core/lib/components/menu-template/menu-template.js +250 -0
- package/core/lib/components/menu-template/menu-template.scss +9 -0
- package/core/lib/components/modal-search/modal-search.js +153 -0
- package/core/lib/components/modal-search/modal-search.scss +79 -0
- package/core/lib/components/modal-wrapper/modal-manager.js +16 -0
- package/core/lib/components/modal-wrapper/modal-wrapper.js +108 -0
- package/core/lib/components/modal-wrapper/modal-wrapper.scss +14 -0
- package/core/lib/components/notice-board/notice-board.js +132 -0
- package/core/lib/components/notice-board/notice-board.scss +65 -0
- package/core/lib/components/page-container/page-container.js +55 -0
- package/core/lib/components/page-container/page-container.scss +8 -0
- package/core/lib/components/page-header/page-header.js +23 -0
- package/core/lib/components/page-header/page-header.scss +18 -0
- package/core/lib/components/pdf-viewer/pdf-viewer.js +56 -0
- package/core/lib/components/portlet-table/components/table-actions/table-actions.js +58 -0
- package/core/lib/components/portlet-table/components/table-actions/table-actions.scss +1 -0
- package/core/lib/components/portlet-table/components/table-data/table-data.js +107 -0
- package/core/lib/components/portlet-table/components/table-data/table-data.scss +0 -0
- package/core/lib/components/portlet-table/portlet-table.js +63 -0
- package/core/lib/components/portlet-table/portlet-table.scss +90 -0
- package/core/lib/components/progress-bar/progress-bar.js +58 -0
- package/core/lib/components/progress-bar/progress-bar.scss +15 -0
- package/core/lib/components/request-form/request-form.js +110 -0
- package/core/lib/components/request-form/request-form.scss +0 -0
- package/core/lib/components/root-application/root-application.js +70 -0
- package/core/lib/components/rupee/rupee.js +14 -0
- package/core/lib/components/script-input/script-input.js +169 -0
- package/core/lib/components/script-input/script-input.scss +8 -0
- package/core/lib/components/sidemenu/animations.js +52 -0
- package/core/lib/components/sidemenu/sidemenu.js +617 -0
- package/core/lib/components/sidemenu/sidemenu.scss +264 -0
- package/core/lib/components/spotlight-search/spotlight-search.component.js +636 -0
- package/core/lib/components/spotlight-search/spotlight-search.component.scss +78 -0
- package/core/lib/components/table-wrapper/table-wrapper.js +136 -0
- package/core/lib/components/table-wrapper/table-wrapper.scss +72 -0
- package/core/lib/components/ui_elements/Loader.js +13 -0
- package/core/lib/components/ui_elements/Notify.js +13 -0
- package/core/lib/components/ui_elements/PlaceHolder.js +34 -0
- package/core/lib/components/web-camera/web-camera.js +162 -0
- package/core/lib/components/web-camera/web-camera.scss +28 -0
- package/core/lib/core.md +9 -0
- package/core/lib/elements/Elements.md +3 -0
- package/core/lib/elements/basic/LoggedUserRedirect.js +21 -0
- package/core/lib/elements/basic/PrivateRoute.js +16 -0
- package/core/lib/elements/basic/button/Button.md +43 -0
- package/core/lib/elements/basic/button/button.js +170 -0
- package/core/lib/elements/basic/button/button.scss +0 -0
- package/core/lib/elements/basic/card/Card.md +15 -0
- package/core/lib/elements/basic/card/card.js +40 -0
- package/core/lib/elements/basic/card/card.scss +14 -0
- package/core/lib/elements/basic/checkbox/checkbox.js +23 -0
- package/core/lib/elements/basic/col/col.js +16 -0
- package/core/lib/elements/basic/copy-to-clipboard/Readme.md +40 -0
- package/core/lib/elements/basic/copy-to-clipboard/copy-to-clipboard.js +62 -0
- package/core/lib/elements/basic/country-phone-input/Readme.md +98 -0
- package/core/lib/elements/basic/country-phone-input/country-phone-input.js +107 -0
- package/core/lib/elements/basic/country-phone-input/phone-input.scss +62 -0
- package/core/lib/elements/basic/datepicker/datepicker.js +33 -0
- package/core/lib/elements/basic/dragabble-wrapper/draggable-wrapper.js +61 -0
- package/core/lib/elements/basic/empty/empty.js +15 -0
- package/core/lib/elements/basic/fingerprint-protrected/fingerprint-protected.js +118 -0
- package/core/lib/elements/basic/fingerprint-protrected/fingerprint-protected.scss +10 -0
- package/core/lib/elements/basic/form/Readme.md +0 -0
- package/core/lib/elements/basic/form/form.js +70 -0
- package/core/lib/elements/basic/form/form.scss +4 -0
- package/core/lib/elements/basic/image/image.js +45 -0
- package/core/lib/elements/basic/image/image.scss +17 -0
- package/core/lib/elements/basic/image/readme.md +26 -0
- package/core/lib/elements/basic/image-viewer/image-viewer.js +109 -0
- package/core/lib/elements/basic/image-viewer/image-viewer.scss +8 -0
- package/core/lib/elements/basic/input/input.js +81 -0
- package/core/lib/elements/basic/input/readme.md +77 -0
- package/core/lib/elements/basic/json-input/json-input.js +51 -0
- package/core/lib/elements/basic/menu-dashboard/menu-dashboard.js +216 -0
- package/core/lib/elements/basic/menu-dashboard/menu-dashboard.scss +28 -0
- package/core/lib/elements/basic/modal/modal.js +64 -0
- package/core/lib/elements/basic/modal/readme.md +62 -0
- package/core/lib/elements/basic/popconfirm/popconfirm.js +18 -0
- package/core/lib/elements/basic/popover/popover.js +13 -0
- package/core/lib/elements/basic/radio/radio.js +18 -0
- package/core/lib/elements/basic/rangepicker/rangepicker.js +51 -0
- package/core/lib/elements/basic/rangepicker/rangepicker.scss +18 -0
- package/core/lib/elements/basic/rangepicker/readme.md +82 -0
- package/core/lib/elements/basic/reference-select/readme.md +19 -0
- package/core/lib/elements/basic/reference-select/reference-select.js +337 -0
- package/core/lib/elements/basic/row/row.js +16 -0
- package/core/lib/elements/basic/select/select.js +47 -0
- package/core/lib/elements/basic/select-box/readme.md +53 -0
- package/core/lib/elements/basic/select-box/select-box.js +63 -0
- package/core/lib/elements/basic/skeleton/readme.md +35 -0
- package/core/lib/elements/basic/skeleton/skeleton.js +36 -0
- package/core/lib/elements/basic/skeleton/skeleton.scss +53 -0
- package/core/lib/elements/basic/space/space.js +13 -0
- package/core/lib/elements/basic/switch/readme.md +29 -0
- package/core/lib/elements/basic/switch/switch.js +58 -0
- package/core/lib/elements/basic/tab/tab.js +15 -0
- package/core/lib/elements/basic/table/readme.md +9 -0
- package/core/lib/elements/basic/table/table.js +100 -0
- package/core/lib/elements/basic/table/table.scss +0 -0
- package/core/lib/elements/basic/tag/tag.js +63 -0
- package/core/lib/elements/basic/tag/tag.scss +3 -0
- package/core/lib/elements/basic/timeline/timeline.js +14 -0
- package/core/lib/elements/basic/title/readme.md +20 -0
- package/core/lib/elements/basic/title/title.js +38 -0
- package/core/lib/elements/basic/title/title.scss +0 -0
- package/core/lib/elements/basic/user-search/user-search.js +192 -0
- package/core/lib/elements/complex/barcode/barcode.js +27 -0
- package/core/lib/elements/complex/bargraph/bar-graph.js +262 -0
- package/core/lib/elements/complex/basic-table/basic-table.js +111 -0
- package/core/lib/elements/complex/basic-table/basic-table.scss +4 -0
- package/core/lib/elements/complex/date-display/date-display.js +37 -0
- package/core/lib/elements/complex/error-boundary/error-boundary.js +29 -0
- package/core/lib/elements/complex/google-location-input/map-container-library-load.js +93 -0
- package/core/lib/elements/complex/google-map/google-map.js +230 -0
- package/core/lib/elements/complex/google-map/google-map.scss +13 -0
- package/core/lib/elements/complex/line-graph/line-graph.js +108 -0
- package/core/lib/elements/complex/location-search-input/location-search-input.js +100 -0
- package/core/lib/elements/complex/maps/maps.js +0 -0
- package/core/lib/elements/complex/pie-chart/pie-chart.js +203 -0
- package/core/lib/elements/complex/qr-code/qr-code.js +27 -0
- package/core/lib/elements/complex/qrscanner/qrscanner.js +57 -0
- package/core/lib/elements/complex/search-debounce/search-debounce.js +37 -0
- package/core/lib/elements/complex/statistic-card/dashboard-statistic-card.js +76 -0
- package/core/lib/elements/complex/statistic-card/statistic-card.js +28 -0
- package/core/lib/elements/index.js +226 -0
- package/core/lib/hooks/device-detect.js +26 -0
- package/core/lib/hooks/index.js +19 -0
- package/core/lib/hooks/use-location.js +33 -0
- package/core/lib/hooks/use-window-size.js +34 -0
- package/core/lib/i18n.js +70 -0
- package/core/lib/index.js +106 -0
- package/core/lib/introduction.md +74 -0
- package/core/lib/js-styleguide.md +4112 -0
- package/core/lib/models/actions/actions.js +128 -0
- package/core/lib/models/actions/components/action-detail/action-detail.js +190 -0
- package/core/lib/models/actions/components/action-detail/action-detail.scss +0 -0
- package/core/lib/models/actions/components/custom-actions/custom-actions.js +186 -0
- package/core/lib/models/actions/components/custom-actions/custom-actions.scss +0 -0
- package/core/lib/models/attachments/attachments.js +231 -0
- package/core/lib/models/base-loader.js +99 -0
- package/core/lib/models/base.js +716 -0
- package/core/lib/models/branches/branches.js +125 -0
- package/core/lib/models/checklists/checklists.js +115 -0
- package/core/lib/models/columns/columns.js +169 -0
- package/core/lib/models/columns/components/columns-add/columns-add.js +172 -0
- package/core/lib/models/columns/components/columns-add/columns-add.scss +0 -0
- package/core/lib/models/comments/comments.js +213 -0
- package/core/lib/models/departments/departments.js +107 -0
- package/core/lib/models/financial-years/financial_years.js +127 -0
- package/core/lib/models/forms/components/form-creator/form-creator.js +624 -0
- package/core/lib/models/forms/components/form-creator/form-creator.scss +30 -0
- package/core/lib/models/forms/components/form-detail/form-detail.js +224 -0
- package/core/lib/models/forms/components/form-detail/form-detail.scss +0 -0
- package/core/lib/models/forms/forms.js +122 -0
- package/core/lib/models/index.js +203 -0
- package/core/lib/models/invoice-numbers/invoice_numbers.js +204 -0
- package/core/lib/models/lookup-types/components/lookup-detail/lookup-detail.js +145 -0
- package/core/lib/models/lookup-types/components/lookup-detail/lookup-detail.scss +0 -0
- package/core/lib/models/lookup-types/lookup-types.js +113 -0
- package/core/lib/models/lookup-values/components/lookup-values-add/lookup-values-add.js +126 -0
- package/core/lib/models/lookup-values/components/lookup-values-add/lookup-values-add.scss +0 -0
- package/core/lib/models/lookup-values/lookup-values.js +107 -0
- package/core/lib/models/menu-roles/menu-roles.js +127 -0
- package/core/lib/models/menus/components/menu-add/menu-add.js +228 -0
- package/core/lib/models/menus/components/menu-add/menu-add.scss +0 -0
- package/core/lib/models/menus/components/menu-detail/menu-detail.js +170 -0
- package/core/lib/models/menus/components/menu-detail/menu-detail.scss +0 -0
- package/core/lib/models/menus/components/menu-list/menu-list.js +593 -0
- package/core/lib/models/menus/components/menu-list/menu-list.scss +6 -0
- package/core/lib/models/menus/components/menu-roles-add/menu-roles-add.js +183 -0
- package/core/lib/models/menus/components/menu-roles-add/menu-roles-add.scss +0 -0
- package/core/lib/models/menus/menus.js +499 -0
- package/core/lib/models/models/components/model-detail/model-detail.js +137 -0
- package/core/lib/models/models/components/model-detail/model-detail.scss +0 -0
- package/core/lib/models/models/components/models.js +128 -0
- package/core/lib/models/modules/modules.js +204 -0
- package/core/lib/models/outbox/outbox.js +73 -0
- package/core/lib/models/pages/pages.js +107 -0
- package/core/lib/models/permissions/permissions.js +71 -0
- package/core/lib/models/process/components/process-add/process-add.js +181 -0
- package/core/lib/models/process/components/process-add/process-add.scss +0 -0
- package/core/lib/models/process/components/process-dashboard/process-dashboard.js +602 -0
- package/core/lib/models/process/components/process-dashboard/process-dashboard.scss +62 -0
- package/core/lib/models/process/components/process-detail/process-detail.js +140 -0
- package/core/lib/models/process/components/process-detail/process-detail.scss +0 -0
- package/core/lib/models/process/components/process-timeline/process-timeline.js +140 -0
- package/core/lib/models/process/components/task-detail/task-detail.js +240 -0
- package/core/lib/models/process/components/task-detail/task-detail.scss +27 -0
- package/core/lib/models/process/components/task-form/task-form.js +529 -0
- package/core/lib/models/process/components/task-form/task-form.scss +7 -0
- package/core/lib/models/process/components/task-list/task-list.js +221 -0
- package/core/lib/models/process/components/task-list/task-list.scss +14 -0
- package/core/lib/models/process/components/task-overview/task-overview.js +300 -0
- package/core/lib/models/process/components/task-overview/task-overview.scss +0 -0
- package/core/lib/models/process/components/task-overview-legacy/task-overview-legacy.js +192 -0
- package/core/lib/models/process/components/task-overview-legacy/task-overview.scss +0 -0
- package/core/lib/models/process/components/task-routes/task-routes.js +45 -0
- package/core/lib/models/process/components/task-status/task-status.js +176 -0
- package/core/lib/models/process/components/task-status/task-status.scss +11 -0
- package/core/lib/models/process/process.js +781 -0
- package/core/lib/models/process-transactions/process-transactions.js +124 -0
- package/core/lib/models/roles/roles.js +106 -0
- package/core/lib/models/scripts/scripts.js +111 -0
- package/core/lib/models/step-transactions/step-transcations.js +148 -0
- package/core/lib/models/steps/components/step-add/step-add.js +261 -0
- package/core/lib/models/steps/components/step-add/step-add.scss +0 -0
- package/core/lib/models/steps/components/step-detail/step-detail.js +157 -0
- package/core/lib/models/steps/components/step-detail/step-detail.scss +0 -0
- package/core/lib/models/steps/steps.js +357 -0
- package/core/lib/models/user-preferences/user-preferences.js +83 -0
- package/core/lib/models/users/components/user-add/user-add.js +226 -0
- package/core/lib/models/users/components/user-add/user-add.scss +0 -0
- package/core/lib/models/users/users.js +120 -0
- package/core/lib/modules/business/launch-page/launch-page.js +29 -0
- package/core/lib/modules/business/launch-page/launch-page.scss +6 -0
- package/core/lib/modules/business/slots/slots.js +231 -0
- package/core/lib/modules/business/slots/slots.scss +108 -0
- package/core/lib/modules/forms/components/field-customizer/field-customizer.js +139 -0
- package/core/lib/modules/forms/components/field-customizer/field-customizer.scss +0 -0
- package/core/lib/modules/forms/components/field-selector/field-selector.js +157 -0
- package/core/lib/modules/forms/components/field-selector/field-selector.scss +25 -0
- package/core/lib/modules/forms/components/form-display/form-display.js +203 -0
- package/core/lib/modules/forms/components/form-display/form-display.scss +9 -0
- package/core/lib/modules/forms/components/tab-customizer/tab-customizer.js +125 -0
- package/core/lib/modules/forms/components/tab-customizer/tab-customizer.scss +0 -0
- package/core/lib/modules/generic/generic-add/generic-add.js +213 -0
- package/core/lib/modules/generic/generic-add/generic-add.scss +0 -0
- package/core/lib/modules/generic/generic-detail/generic-detail.js +199 -0
- package/core/lib/modules/generic/generic-detail/generic-detail.scss +0 -0
- package/core/lib/modules/generic/generic-edit/generic-edit.js +120 -0
- package/core/lib/modules/generic/generic-edit/generic-edit.scss +0 -0
- package/core/lib/modules/generic/generic-list/ExportReactCSV.js +62 -0
- package/core/lib/modules/generic/generic-list/generic-list.js +705 -0
- package/core/lib/modules/generic/generic-list/generic-list.scss +34 -0
- package/core/lib/modules/generic/generic-upload/generic-upload.js +484 -0
- package/core/lib/modules/generic/generic-upload/generic-upload.scss +0 -0
- package/core/lib/modules/generic/table-settings/table-settings.js +226 -0
- package/core/lib/modules/generic/table-settings/table-settings.scss +37 -0
- package/core/lib/modules/index.js +52 -0
- package/core/lib/modules/modules-routes/module-routes.js +35 -0
- package/core/lib/modules/modules-routes/module-routes.scss +0 -0
- package/core/lib/pages/change-password/change-password.js +211 -0
- package/core/lib/pages/change-password/change-password.scss +76 -0
- package/core/lib/pages/homepage/homepage.js +53 -0
- package/core/lib/pages/index.js +20 -0
- package/core/lib/pages/login/login.js +617 -0
- package/core/lib/pages/login/login.scss +346 -0
- package/core/lib/pages/manage-users/manage-users.js +429 -0
- package/core/lib/pages/manage-users/manage-users.scss +26 -0
- package/core/lib/pages/profile/profile.js +247 -0
- package/core/lib/pages/profile/profile.scss +107 -0
- package/core/lib/pages/profile/theme-config.js +18 -0
- package/core/lib/pages/profile/themes-backup.json +311 -0
- package/core/lib/pages/profile/themes.json +254 -0
- package/core/lib/pages/register/register.js +177 -0
- package/core/lib/pages/register/register.scss +128 -0
- package/core/lib/react-styleguide.md +757 -0
- package/core/lib/utils/api/api.utils.js +188 -0
- package/core/lib/utils/api/readme.md +426 -0
- package/core/lib/utils/async.js +36 -0
- package/core/lib/utils/common/common.utils.js +123 -0
- package/core/lib/utils/common/readme.md +30 -0
- package/core/lib/utils/date/date.utils.js +295 -0
- package/core/lib/utils/date/readme.md +2 -0
- package/core/lib/utils/firebase.support.utils.js +99 -0
- package/core/lib/utils/firebase.utils.js +808 -0
- package/core/lib/utils/form/Form.md +0 -0
- package/core/lib/utils/form/form.utils.js +256 -0
- package/core/lib/utils/generic/generic.utils.js +69 -0
- package/core/lib/utils/http/auth.helper.js +95 -0
- package/core/lib/utils/http/http.utils.js +157 -0
- package/core/lib/utils/http/readme.md +14 -0
- package/core/lib/utils/index.js +46 -0
- package/core/lib/utils/location/location.utils.js +137 -0
- package/core/lib/utils/location/readme.md +18 -0
- package/core/lib/utils/modal.utils.js +16 -0
- package/core/lib/utils/notification.utils.js +35 -0
- package/core/lib/utils/pwa/pwa.utils.js +88 -0
- package/core/lib/utils/script.utils.js +235 -0
- package/core/lib/utils/setting.utils.js +69 -0
- package/core/lib/utils/upload.utils.js +30 -0
- package/core/models/Preference/Preferences.js +46 -0
- package/core/models/base/base.js +399 -0
- package/core/models/base-clone-loader.js +107 -0
- package/core/models/base-clone.js +187 -0
- package/core/models/base-loader.js +97 -0
- package/core/models/core-scripts/core-scripts.js +150 -0
- package/core/models/dashboard/dashboard.js +187 -0
- package/core/models/detail-loader.js +88 -0
- package/core/models/groups.js +82 -0
- package/core/models/index.js +94 -0
- package/core/models/lookup-types/components/lookup-detail/lookup-detail.js +129 -0
- package/core/models/lookup-types/lookup-types.js +96 -0
- package/core/models/lookup-values/components/lookup-values-modal/lookup-values-modal.js +95 -0
- package/core/models/lookup-values/components/lookup-values-modal/lookup-values-modal.scss +0 -0
- package/core/models/lookup-values/lookup-values.js +92 -0
- package/core/models/menu-roles/components/menu-roles-add/menu-roles-add.js +153 -0
- package/core/models/menu-roles/components/menu-roles-add/menu-roles-add.scss +0 -0
- package/core/models/menu-roles/menu-roles.js +158 -0
- package/core/models/menus/components/menu-add/menu-add.js +325 -0
- package/core/models/menus/components/menu-add/menu-add.scss +31 -0
- package/core/models/menus/components/menu-detail/menu-detail.js +263 -0
- package/core/models/menus/components/menu-list/menu-list.js +392 -0
- package/core/models/menus/components/menu-lists/menu-lists.js +429 -0
- package/core/models/menus/components/menu-lists/menu-lists.scss +41 -0
- package/core/models/menus/menus.js +291 -0
- package/core/models/model-columns.js +121 -0
- package/core/models/models/components/model-detail/model-add.js +120 -0
- package/core/models/models/components/model-detail/model-detail.js +133 -0
- package/core/models/models/components/model-detail/model-detail.scss +0 -0
- package/core/models/models/models.js +154 -0
- package/core/models/pages/components/page-add/page-add.js +163 -0
- package/core/models/pages/components/page-add/page-add.scss +31 -0
- package/core/models/pages/components/page-details/page-details.js +210 -0
- package/core/models/pages/components/page-list/page-list.js +248 -0
- package/core/models/pages/pages.js +142 -0
- package/core/models/pages/pages.scss +0 -0
- package/core/models/pages.js +142 -0
- package/core/models/roles/components/role-add/role-add.js +248 -0
- package/core/models/roles/components/role-list/role-list.js +408 -0
- package/core/models/roles/roles.js +188 -0
- package/core/models/user-roles/components/user-roles-add/user-roles-add.js +149 -0
- package/core/models/user-roles/components/user-roles-add/user-roles-add.scss +0 -0
- package/core/models/user-roles/user-roles.js +99 -0
- package/core/models/users/components/user-add/user-add.js +458 -0
- package/core/models/users/components/user-detail/user-detail.js +236 -0
- package/core/models/users/components/user-detail/user-detail.scss +0 -0
- package/core/models/users/components/user-list/user-list.js +397 -0
- package/core/models/users/users.js +185 -0
- package/core/modules/Informations/change-info/change-info.js +618 -0
- package/core/modules/Informations/change-info/change-info.scss +135 -0
- package/core/modules/dashboard/components/dashboard-card/animations.js +65 -0
- package/core/modules/dashboard/components/dashboard-card/dashboard-card.js +197 -0
- package/core/modules/dashboard/components/dashboard-card/menu-dashboard-card.js +430 -0
- package/core/modules/dashboard/components/dashboard-card/menu-dashboard-card.scss +60 -0
- package/core/modules/dashboard/components/pop-query-dashboard/pop-query-dashboard.js +66 -0
- package/core/modules/generic/components/generic-add/generic-add.js +121 -0
- package/core/modules/generic/components/generic-add/generic-add.scss +13 -0
- package/core/modules/generic/components/generic-add-modal/generic-add-modal.js +125 -0
- package/core/modules/generic/components/generic-add-modal/generic-add-modal.scss +13 -0
- package/core/modules/generic/components/generic-detail/generic-detail.js +184 -0
- package/core/modules/generic/components/generic-detail/generic-detail.scss +25 -0
- package/core/modules/generic/components/generic-edit/generic-edit.js +123 -0
- package/core/modules/generic/components/generic-edit/generic-edit.scss +0 -0
- package/core/modules/generic/components/generic-list/generic-list.js +335 -0
- package/core/modules/generic/components/generic-list/generic-list.scss +35 -0
- package/core/modules/index.js +54 -0
- package/core/modules/module-routes/module-routes.js +37 -0
- package/core/modules/module-routes/module-routes.scss +0 -0
- package/core/modules/reporting/components/reporting-dashboard/reporting-dashboard.js +1101 -0
- package/core/modules/reporting/components/reporting-dashboard/reporting-dashboard.scss +171 -0
- package/core/pages/homepage-api/homepage-api.js +106 -0
- package/core/pages/homepage-api/homepage-api.scss +234 -0
- package/core/pages/homepage-api/menu-dashboard.js +169 -0
- package/core/pages/homepage-api/menu-dashboard.scss +12 -0
- package/core/translation.json +54 -0
- package/core/translations.json +20 -0
- package/core/utils/script.utils.js +130 -0
- package/core/utils/settings.utils.js +26 -0
- package/eslint.config.mjs +79 -0
- package/index.js +36 -0
- package/package.json +118 -0
- package/tsconfig.json +27 -0
- package/webpack.config.js +174 -0
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Generic Form create accepts an array of fields to update any resource
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React, { useState, useEffect } from 'react';
|
|
7
|
+
|
|
8
|
+
import { Select } from 'antd';
|
|
9
|
+
|
|
10
|
+
import { BaseLoader } from '../../..';
|
|
11
|
+
|
|
12
|
+
const { Option } = Select;
|
|
13
|
+
|
|
14
|
+
// #TODO
|
|
15
|
+
/**
|
|
16
|
+
* Below is the plan for clearing the pending list
|
|
17
|
+
*
|
|
18
|
+
* nura single needs to be removed ,
|
|
19
|
+
*
|
|
20
|
+
* as it has no dependency , Passing path should be a feature of both firebase and SQL Implementation
|
|
21
|
+
* Or the component should accept model
|
|
22
|
+
*
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Component for selecting head
|
|
28
|
+
*
|
|
29
|
+
* @param {*} param0
|
|
30
|
+
* @returns
|
|
31
|
+
*/
|
|
32
|
+
function ReferenceSelect({
|
|
33
|
+
model,
|
|
34
|
+
path = '',
|
|
35
|
+
config,
|
|
36
|
+
value,
|
|
37
|
+
queries = [],
|
|
38
|
+
onChange,
|
|
39
|
+
label = 'name',
|
|
40
|
+
mode = '',
|
|
41
|
+
field = 'id',
|
|
42
|
+
allowClear,
|
|
43
|
+
sortKey, // Key for sorting
|
|
44
|
+
sortOrder = 'asc', // default to ascending,
|
|
45
|
+
...componentProps
|
|
46
|
+
}) {
|
|
47
|
+
let [options, setOptions] = useState([]);
|
|
48
|
+
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
loadOptions();
|
|
51
|
+
}, []);
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Conditionally sorts an array of objects based on a specified key and order.
|
|
55
|
+
*
|
|
56
|
+
* @param {Array} data - The array of objects to be sorted.
|
|
57
|
+
* @returns {Array} - The sorted array if sorting is enabled and data is an array; otherwise, returns the original data.
|
|
58
|
+
*
|
|
59
|
+
* Sorting behavior:
|
|
60
|
+
* - Only proceeds if `sortKey` is truthy and `data` is a valid array.
|
|
61
|
+
* - Sorts in ascending order by default; descending if `sortOrder` is `'desc'`.
|
|
62
|
+
* - Case-insensitive sorting using `String.prototype.localeCompare`.
|
|
63
|
+
*
|
|
64
|
+
* Assumptions:
|
|
65
|
+
* - `sortKey`, `label`, and `sortOrder` are variables available in the enclosing scope.
|
|
66
|
+
*/
|
|
67
|
+
function sortIfNeeded(data) {
|
|
68
|
+
if (!sortKey || !Array.isArray(data)) return data;
|
|
69
|
+
|
|
70
|
+
const key = sortKey;
|
|
71
|
+
const order = sortOrder === 'desc' ? -1 : 1;
|
|
72
|
+
|
|
73
|
+
return [...data].sort((a, b) => {
|
|
74
|
+
const aVal = a?.[key]?.toString().toLowerCase() || '';
|
|
75
|
+
const bVal = b?.[key]?.toString().toLowerCase() || '';
|
|
76
|
+
return aVal.localeCompare(bVal) * order;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Loads and sets options based on the current `mode`, fetching data via the `model` or `BaseLoader`.
|
|
82
|
+
* Handles optional sorting and applying a default value condition if specified.
|
|
83
|
+
*/
|
|
84
|
+
function loadOptions() {
|
|
85
|
+
// Destructure defaultValueCondition from componentProps, with a fallback of null
|
|
86
|
+
const { defaultValueCondition = null } = componentProps;
|
|
87
|
+
|
|
88
|
+
// Case 1: 'nura-base' mode – used for general fetch via config
|
|
89
|
+
if (mode === 'nura-base') {
|
|
90
|
+
// Fetch data from model using config
|
|
91
|
+
model.get({ ...config }).then((response) => {
|
|
92
|
+
// Extract result from response or fallback to response directly
|
|
93
|
+
let data = response.result || response;
|
|
94
|
+
|
|
95
|
+
// Conditionally sort the data using external sortIfNeeded function
|
|
96
|
+
data = sortIfNeeded(data);
|
|
97
|
+
|
|
98
|
+
// Set the sorted (or original) data to options
|
|
99
|
+
setOptions(data);
|
|
100
|
+
|
|
101
|
+
// If a defaultValueCondition is defined and data is not empty, apply it
|
|
102
|
+
if (defaultValueCondition && data.length) {
|
|
103
|
+
triggerDefaultValue(data);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
// Case 2: 'nura-single' mode – fetches based on 'queries'
|
|
108
|
+
} else if (mode === 'nura-single') {
|
|
109
|
+
// Fetch data from model with given queries
|
|
110
|
+
model.get(queries).then(({ result }) => {
|
|
111
|
+
// Sort the result if needed
|
|
112
|
+
const data = sortIfNeeded(result);
|
|
113
|
+
|
|
114
|
+
// Set the (possibly sorted) data to options
|
|
115
|
+
setOptions(data);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
// Case 3: All other modes
|
|
119
|
+
} else {
|
|
120
|
+
// Determine fetcher: use BaseLoader if path is provided, otherwise use model
|
|
121
|
+
const fetcher = path ? new BaseLoader({ path }) : model;
|
|
122
|
+
|
|
123
|
+
// Fetch data using the selected fetcher
|
|
124
|
+
fetcher.get(queries).then((result) => {
|
|
125
|
+
// Extract data using fetcher's name property
|
|
126
|
+
let data = path ? result[fetcher.name] : result[model.name];
|
|
127
|
+
|
|
128
|
+
// Sort the data if sorting is enabled
|
|
129
|
+
data = sortIfNeeded(data);
|
|
130
|
+
|
|
131
|
+
// Set the sorted (or original) data to options
|
|
132
|
+
setOptions(data);
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Function defaults the value from the matching record
|
|
139
|
+
* @param {*} records
|
|
140
|
+
*/
|
|
141
|
+
function triggerDefaultValue(records) {
|
|
142
|
+
const { defaultValueCondition = null } = componentProps;
|
|
143
|
+
|
|
144
|
+
let matching = defaultValueCondition(records);
|
|
145
|
+
|
|
146
|
+
if (matching) {
|
|
147
|
+
onChange(matching[field]);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
let props = {};
|
|
152
|
+
|
|
153
|
+
if (mode == 'multiple') {
|
|
154
|
+
props.mode = mode;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return (
|
|
158
|
+
<div className="head-selector">
|
|
159
|
+
<Select
|
|
160
|
+
allowClear={allowClear}
|
|
161
|
+
showSearch // Enables the search functionality in the Select dropdown
|
|
162
|
+
filterOption={(input, option) => {
|
|
163
|
+
// Custom filtering function to match the search input with the options
|
|
164
|
+
const searchText = input.toLowerCase().trim(); // Converts the search input to lowercase and trims whitespace
|
|
165
|
+
|
|
166
|
+
const optionLabel = option.children?.toString().toLowerCase().trim(); // Converts the option label to lowercase and trims whitespace
|
|
167
|
+
|
|
168
|
+
return optionLabel.includes(searchText); // Checks if the option label includes the search text
|
|
169
|
+
}}
|
|
170
|
+
{...props}
|
|
171
|
+
style={{ width: '100%' }}
|
|
172
|
+
onChange={onChange}
|
|
173
|
+
value={value}
|
|
174
|
+
{...componentProps}
|
|
175
|
+
>
|
|
176
|
+
{options.map((option, key) => (
|
|
177
|
+
<Option key={key} value={option[field]} record={option}>
|
|
178
|
+
{option[label]}
|
|
179
|
+
</Option>
|
|
180
|
+
))}
|
|
181
|
+
</Select>
|
|
182
|
+
</div>
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export default ReferenceSelect;
|
|
187
|
+
|
|
188
|
+
// import React, { useState } from "react";
|
|
189
|
+
|
|
190
|
+
// import PropTypes from "prop-types";
|
|
191
|
+
|
|
192
|
+
// import 'antd/dist/antd.css';
|
|
193
|
+
|
|
194
|
+
// /**
|
|
195
|
+
// * A reference Select component.
|
|
196
|
+
// */
|
|
197
|
+
// function ReferenceSelect({ options, onSelect, defaultValue }) {
|
|
198
|
+
// const [selectedValue, setSelectedValue] = useState(defaultValue);
|
|
199
|
+
|
|
200
|
+
// const handleChange = (event) => {
|
|
201
|
+
// const value = event.target.value;
|
|
202
|
+
// setSelectedValue(value);
|
|
203
|
+
// onSelect(value);
|
|
204
|
+
// };
|
|
205
|
+
|
|
206
|
+
// useEffect(() => {
|
|
207
|
+
// loadOptions()
|
|
208
|
+
// }, [])
|
|
209
|
+
|
|
210
|
+
// /**
|
|
211
|
+
// * Load the matching heads
|
|
212
|
+
// */
|
|
213
|
+
// function loadOptions() {
|
|
214
|
+
|
|
215
|
+
// const { defaultValueCondition = null } = componentProps
|
|
216
|
+
|
|
217
|
+
// // Mode to handle all cases of Nura/StopTB/Medicant
|
|
218
|
+
// if (mode === 'nura-base') {
|
|
219
|
+
|
|
220
|
+
// model.get({ ...config }).then((response) => {
|
|
221
|
+
|
|
222
|
+
// // Since base class implementation , data is available under data.
|
|
223
|
+
// if (response.result) {
|
|
224
|
+
// setOptions(response.result);
|
|
225
|
+
// } else {
|
|
226
|
+
// setOptions(response)
|
|
227
|
+
// }
|
|
228
|
+
|
|
229
|
+
// // Default value
|
|
230
|
+
// if (defaultValueCondition) {
|
|
231
|
+
|
|
232
|
+
// // If the response
|
|
233
|
+
// if (response.result.length) {
|
|
234
|
+
|
|
235
|
+
// // Trigger the default value
|
|
236
|
+
// triggerDefaultValue(response.result);
|
|
237
|
+
// }
|
|
238
|
+
|
|
239
|
+
// // #Temporary Handling
|
|
240
|
+
// if (response.length) {
|
|
241
|
+
|
|
242
|
+
// triggerDefaultValue(response);
|
|
243
|
+
// }
|
|
244
|
+
// }
|
|
245
|
+
// })
|
|
246
|
+
|
|
247
|
+
// } else if (mode === 'nura-single') {
|
|
248
|
+
|
|
249
|
+
// model.get(queries).then(({ result }) => {
|
|
250
|
+
|
|
251
|
+
// setOptions(result);
|
|
252
|
+
|
|
253
|
+
// })
|
|
254
|
+
|
|
255
|
+
// } else {
|
|
256
|
+
|
|
257
|
+
// if (path) {
|
|
258
|
+
|
|
259
|
+
// let dynamicModel = new BaseLoader({ path })
|
|
260
|
+
|
|
261
|
+
// dynamicModel.get(queries).then((result) => {
|
|
262
|
+
|
|
263
|
+
// setOptions(result[dynamicModel.name]);
|
|
264
|
+
|
|
265
|
+
// })
|
|
266
|
+
|
|
267
|
+
// } else {
|
|
268
|
+
|
|
269
|
+
// model.get(queries).then((result) => {
|
|
270
|
+
|
|
271
|
+
// setOptions(result[model.name]);
|
|
272
|
+
|
|
273
|
+
// })
|
|
274
|
+
// }
|
|
275
|
+
// }
|
|
276
|
+
// }
|
|
277
|
+
|
|
278
|
+
// /**
|
|
279
|
+
// * Function defaults the value from the matching record
|
|
280
|
+
// */
|
|
281
|
+
// function triggerDefaultValue(records) {
|
|
282
|
+
|
|
283
|
+
// const { defaultValueCondition = null } = componentProps
|
|
284
|
+
|
|
285
|
+
// let matching = defaultValueCondition(records);
|
|
286
|
+
|
|
287
|
+
// if (matching) {
|
|
288
|
+
|
|
289
|
+
// onChange(matching[field]);
|
|
290
|
+
// }
|
|
291
|
+
// }
|
|
292
|
+
|
|
293
|
+
// let props = {}
|
|
294
|
+
|
|
295
|
+
// if (mode == 'multiple') {
|
|
296
|
+
// props.mode = mode;
|
|
297
|
+
// }
|
|
298
|
+
|
|
299
|
+
// return (
|
|
300
|
+
// <div className="head-selector">
|
|
301
|
+
// <Select {...props} style={{ width: '100%' }} onChange={onChange} value={value} {...componentProps}>
|
|
302
|
+
// {options.map((option, key) => (
|
|
303
|
+
// <Option key={key} value={option[field]} record={option}>
|
|
304
|
+
// {option[label]}
|
|
305
|
+
// </Option>
|
|
306
|
+
// ))}
|
|
307
|
+
// </Select>
|
|
308
|
+
// </div>
|
|
309
|
+
// );
|
|
310
|
+
// }
|
|
311
|
+
|
|
312
|
+
// ReferenceSelect.propTypes = {
|
|
313
|
+
// /**
|
|
314
|
+
// * An array of reference options for the Select component.
|
|
315
|
+
// */
|
|
316
|
+
// options: PropTypes.arrayOf(
|
|
317
|
+
// PropTypes.shape({
|
|
318
|
+
// value: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
319
|
+
// .isRequired,
|
|
320
|
+
// label: PropTypes.string.isRequired,
|
|
321
|
+
// })
|
|
322
|
+
// ).isRequired,
|
|
323
|
+
// /**
|
|
324
|
+
// * A callback function that is called when a reference is selected.
|
|
325
|
+
// */
|
|
326
|
+
// onSelect: PropTypes.func.isRequired,
|
|
327
|
+
// /**
|
|
328
|
+
// * The default value for the Select component.
|
|
329
|
+
// */
|
|
330
|
+
// defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
331
|
+
// };
|
|
332
|
+
|
|
333
|
+
// ReferenceSelect.defaultProps = {
|
|
334
|
+
// defaultValue: "",
|
|
335
|
+
// };
|
|
336
|
+
|
|
337
|
+
// export default ReferenceSelect;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Component for antd Row
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React from "react";
|
|
7
|
+
|
|
8
|
+
import { Row as AntdRow } from 'antd';
|
|
9
|
+
|
|
10
|
+
export default function Row({ children, gutter }) {
|
|
11
|
+
return (
|
|
12
|
+
<AntdRow gutter={gutter}>
|
|
13
|
+
{children}
|
|
14
|
+
</AntdRow>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Component for antd select
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import React, { useState, useEffect } from 'react';
|
|
8
|
+
|
|
9
|
+
import { Select as AntdSelect} from 'antd';
|
|
10
|
+
|
|
11
|
+
const { Option } = AntdSelect;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Component for selecting head
|
|
18
|
+
*
|
|
19
|
+
* @param {*} param0
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
function Select({
|
|
23
|
+
options,
|
|
24
|
+
|
|
25
|
+
onSelect,
|
|
26
|
+
value,
|
|
27
|
+
|
|
28
|
+
label = "label",
|
|
29
|
+
field = 'id',
|
|
30
|
+
|
|
31
|
+
...componentProps
|
|
32
|
+
}) {
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<div className="select-box" style={{ width: '150px' }}>
|
|
36
|
+
<AntdSelect style={{ width: '100%' }} onSelect={onSelect} value={value} {...componentProps}>
|
|
37
|
+
{options.map((option, key) => (
|
|
38
|
+
<Option key={key} value={option.field}>
|
|
39
|
+
{option[label]}
|
|
40
|
+
</Option>
|
|
41
|
+
))}
|
|
42
|
+
</AntdSelect>
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export default (Select);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
## Usage
|
|
2
|
+
|
|
3
|
+
Install the "react-select" library using the below code
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
Install the "react-select" library:
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```jsx
|
|
10
|
+
import React from "react";
|
|
11
|
+
import SelectBox from "./select-box";
|
|
12
|
+
|
|
13
|
+
<select>
|
|
14
|
+
<option value="option1">Option 1</option>
|
|
15
|
+
<option value="option2">Option 2</option>
|
|
16
|
+
<option value="option3">Option 3</option>
|
|
17
|
+
</select>;
|
|
18
|
+
```
|
|
19
|
+
```sh
|
|
20
|
+
import React, { useState, useEffect } from "react";
|
|
21
|
+
|
|
22
|
+
const { Option } = Select;
|
|
23
|
+
|
|
24
|
+
function SelectBox({
|
|
25
|
+
options,
|
|
26
|
+
onChange,
|
|
27
|
+
value,
|
|
28
|
+
label = "label",
|
|
29
|
+
field = "id",
|
|
30
|
+
|
|
31
|
+
...componentProps
|
|
32
|
+
}) {
|
|
33
|
+
return (
|
|
34
|
+
<div className="select-box" style={{ width: "150px" }}>
|
|
35
|
+
<Select
|
|
36
|
+
style={{ width: "100%" }}
|
|
37
|
+
onChange={onChange}
|
|
38
|
+
value={value}
|
|
39
|
+
{...componentProps}
|
|
40
|
+
>
|
|
41
|
+
{options.map((option, key) => (
|
|
42
|
+
<Option key={key} value={option[field]}>
|
|
43
|
+
{option[label]}
|
|
44
|
+
</Option>
|
|
45
|
+
))}
|
|
46
|
+
</Select>
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default SelectBox;
|
|
52
|
+
|
|
53
|
+
```
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Select Box
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React, { useState, useEffect } from "react";
|
|
7
|
+
|
|
8
|
+
import { Select } from "antd";
|
|
9
|
+
|
|
10
|
+
const { Option } = Select;
|
|
11
|
+
|
|
12
|
+
import PropTypes from "prop-types";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Component for selecting head
|
|
19
|
+
*
|
|
20
|
+
* @param {*} param0
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
function SelectBox({
|
|
24
|
+
options,
|
|
25
|
+
onChange,
|
|
26
|
+
value,
|
|
27
|
+
label = "label",
|
|
28
|
+
field = "id",
|
|
29
|
+
|
|
30
|
+
...componentProps
|
|
31
|
+
}) {
|
|
32
|
+
return (
|
|
33
|
+
<div className="select-box" style={{ width: "150px" }}>
|
|
34
|
+
<Select
|
|
35
|
+
style={{ width: "100%" }}
|
|
36
|
+
onChange={onChange}
|
|
37
|
+
value={value}
|
|
38
|
+
{...componentProps}
|
|
39
|
+
>
|
|
40
|
+
{options.map((option, key) => (
|
|
41
|
+
<Option key={key} value={option[field]}>
|
|
42
|
+
{option[label]}
|
|
43
|
+
</Option>
|
|
44
|
+
))}
|
|
45
|
+
</Select>
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
SelectBox.propTypes = {
|
|
51
|
+
/** An array of objects representing the options for the select box. Each object in the array should have a label and a value property. */
|
|
52
|
+
options: PropTypes.array.isRequired,
|
|
53
|
+
/** A function that will be called whenever the value of the select box changes. The new value of the select box will be passed as an argument to this function. */
|
|
54
|
+
onChange: PropTypes.func.isRequired,
|
|
55
|
+
/** The current value of the select box. This value should correspond to the value property of one of the objects in the options array. */
|
|
56
|
+
value: PropTypes.string.isRequired,
|
|
57
|
+
/** A string representing the label for the select box. This will be displayed above the select box. */
|
|
58
|
+
label: PropTypes.string,
|
|
59
|
+
/** A string representing the name of the field in each object of the options array that should be used as the value of the select box. By default, this is set to "id". */
|
|
60
|
+
field: PropTypes.string,
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export default SelectBox;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
## Usage
|
|
2
|
+
|
|
3
|
+
Use the `Skeleton` component to provide a visual placeholder for content that is being loaded asynchronously or has not yet been fetched from an API.
|
|
4
|
+
|
|
5
|
+
```jsx
|
|
6
|
+
import Skeleton from "./skeleton";
|
|
7
|
+
|
|
8
|
+
<Skeleton />;
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
import React, { useState, useEffect } from "react";
|
|
13
|
+
import "./skeleton.scss";
|
|
14
|
+
|
|
15
|
+
export default function Skeleton({
|
|
16
|
+
caption = "Simplifying your business | Soxo",
|
|
17
|
+
}) {
|
|
18
|
+
return (
|
|
19
|
+
<div class="skeleton-card">
|
|
20
|
+
<h3 class="loading-animation-text">{caption}</h3>
|
|
21
|
+
|
|
22
|
+
<div class="skeleton"></div>
|
|
23
|
+
|
|
24
|
+
<div class="skeleton"></div>
|
|
25
|
+
|
|
26
|
+
<div class="skeleton"></div>
|
|
27
|
+
|
|
28
|
+
<div class="skeleton"></div>
|
|
29
|
+
|
|
30
|
+
<div class="skeleton"></div>
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skeleton Components
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// Base Imports
|
|
7
|
+
import React, { useState, useEffect } from "react";
|
|
8
|
+
import "./skeleton.scss";
|
|
9
|
+
import PropTypes from "prop-types";
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
export default function Skeleton({
|
|
13
|
+
caption = "Simplifying your business | Soxo",
|
|
14
|
+
}) {
|
|
15
|
+
return (
|
|
16
|
+
<div className="skeleton-card">
|
|
17
|
+
<h3 className="loading-animation-text">{caption}</h3>
|
|
18
|
+
|
|
19
|
+
<div className="skeleton"></div>
|
|
20
|
+
|
|
21
|
+
<div className="skeleton"></div>
|
|
22
|
+
|
|
23
|
+
<div className="skeleton"></div>
|
|
24
|
+
|
|
25
|
+
<div className="skeleton"></div>
|
|
26
|
+
|
|
27
|
+
<div className="skeleton"></div>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
Skeleton.propTypes = {
|
|
34
|
+
/** "caption" is expected to be of type string. */
|
|
35
|
+
caption: PropTypes.string,
|
|
36
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
.skeleton-card {
|
|
2
|
+
background-color: #ffffff;
|
|
3
|
+
border-radius: 6px;
|
|
4
|
+
// box-shadow: 1px 0 8px 0 rgb(0 0 0 / 5%), 8px 8px 18px 0 rgb(0 0 0 / 5%);
|
|
5
|
+
margin: 20px auto;
|
|
6
|
+
/* max-width: 500px; */
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
position: relative;
|
|
9
|
+
// width: 100%;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.skeleton {
|
|
13
|
+
background-color: #f2f2f2;
|
|
14
|
+
border-radius: 5px;
|
|
15
|
+
height: 20px;
|
|
16
|
+
margin: 20px 0;
|
|
17
|
+
width: 100%;
|
|
18
|
+
animation: loading 1s ease-in-out infinite;
|
|
19
|
+
transform-origin: 0% 50%;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.skeleton + .skeleton {
|
|
23
|
+
animation-delay: 0.5s;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.skeleton + .skeleton + .skeleton {
|
|
27
|
+
animation-delay: 0.3s;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.skeleton + .skeleton + .skeleton + .skeleton {
|
|
31
|
+
animation-delay: 0.6s;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.skeleton + .skeleton + .skeleton + .skeleton + .skeleton {
|
|
35
|
+
animation-delay: 0.5s;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@keyframes loading {
|
|
39
|
+
0% {
|
|
40
|
+
transform: translateX(-100%) skewX(-30deg);
|
|
41
|
+
}
|
|
42
|
+
100% {
|
|
43
|
+
transform: translateX(200%) skewX(30deg);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.loading-animation-text {
|
|
48
|
+
font-family: sans-serif;
|
|
49
|
+
margin: 10px;
|
|
50
|
+
color: #838383;
|
|
51
|
+
font-size: 16px;
|
|
52
|
+
font-weight: 100;
|
|
53
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
## Usage
|
|
2
|
+
|
|
3
|
+
To use the switch component, you can simply include it in your JSX:
|
|
4
|
+
|
|
5
|
+
```jsx
|
|
6
|
+
import SwitchComponent from "./switch";
|
|
7
|
+
import { Switch } from "antd";
|
|
8
|
+
|
|
9
|
+
<Switch />;
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
import React, { useState, useContext } from "react";
|
|
14
|
+
import { Switch } from "antd";
|
|
15
|
+
|
|
16
|
+
export default function SwitchComponent({ onChange, value }) {
|
|
17
|
+
return (
|
|
18
|
+
<>
|
|
19
|
+
<Switch
|
|
20
|
+
checked={value}
|
|
21
|
+
onChange={onChange}
|
|
22
|
+
// checked={ }
|
|
23
|
+
listType="picture-card"
|
|
24
|
+
/>
|
|
25
|
+
</>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
```
|