@openmrs/esm-stock-management-app 1.0.1-pre.327
Sign up to get free protection for your applications and to get access to all the features.
- package/.editorconfig +12 -0
- package/.eslintignore +2 -0
- package/.eslintrc +39 -0
- package/.husky/pre-commit +4 -0
- package/.husky/pre-push +6 -0
- package/.prettierignore +14 -0
- package/.turbo.json +18 -0
- package/.yarn/plugins/@yarnpkg/plugin-outdated.cjs +35 -0
- package/LICENSE +401 -0
- package/README.md +3 -0
- package/__mocks__/react-i18next.js +55 -0
- package/dist/26.js +2 -0
- package/dist/26.js.LICENSE.txt +32 -0
- package/dist/26.js.map +1 -0
- package/dist/294.js +2 -0
- package/dist/294.js.LICENSE.txt +9 -0
- package/dist/294.js.map +1 -0
- package/dist/375.js +2 -0
- package/dist/375.js.LICENSE.txt +40 -0
- package/dist/375.js.map +1 -0
- package/dist/46.js +1 -0
- package/dist/46.js.map +1 -0
- package/dist/484.js +1 -0
- package/dist/484.js.map +1 -0
- package/dist/574.js +1 -0
- package/dist/629.js +1 -0
- package/dist/629.js.map +1 -0
- package/dist/707.js +1 -0
- package/dist/707.js.map +1 -0
- package/dist/800.js +2 -0
- package/dist/800.js.LICENSE.txt +3 -0
- package/dist/800.js.map +1 -0
- package/dist/935.js +2 -0
- package/dist/935.js.LICENSE.txt +19 -0
- package/dist/935.js.map +1 -0
- package/dist/979.js +1 -0
- package/dist/979.js.map +1 -0
- package/dist/main.js +2 -0
- package/dist/main.js.LICENSE.txt +60 -0
- package/dist/main.js.map +1 -0
- package/dist/openmrs-esm-stock-management-app.js +1 -0
- package/dist/openmrs-esm-stock-management-app.js.buildmanifest.json +356 -0
- package/dist/openmrs-esm-stock-management-app.js.map +1 -0
- package/dist/routes.json +1 -0
- package/i18next-parser.config.js +89 -0
- package/jest.config.js +25 -0
- package/package.json +116 -0
- package/src/config-schema.ts +18 -0
- package/src/constants.ts +214 -0
- package/src/core/api/api.ts +34 -0
- package/src/core/api/types/Auditable.ts +9 -0
- package/src/core/api/types/BaseOpenmrsData.ts +4 -0
- package/src/core/api/types/BaseOpenmrsMetadata.ts +6 -0
- package/src/core/api/types/BaseOpenmrsObject.ts +3 -0
- package/src/core/api/types/BatchJob.ts +121 -0
- package/src/core/api/types/DashboardExtension.ts +8 -0
- package/src/core/api/types/Location.ts +16 -0
- package/src/core/api/types/LocationTree.ts +7 -0
- package/src/core/api/types/OpenmrsData.ts +5 -0
- package/src/core/api/types/OpenmrsMetadata.ts +8 -0
- package/src/core/api/types/OpenmrsObject.ts +3 -0
- package/src/core/api/types/PageableResult.ts +15 -0
- package/src/core/api/types/Party.ts +8 -0
- package/src/core/api/types/RecordPermission.ts +9 -0
- package/src/core/api/types/Retireable.ts +9 -0
- package/src/core/api/types/Voidable.ts +9 -0
- package/src/core/api/types/concept/Concept.ts +24 -0
- package/src/core/api/types/concept/ConceptName.ts +14 -0
- package/src/core/api/types/concept/Drug.ts +14 -0
- package/src/core/api/types/identity/Credentials.ts +4 -0
- package/src/core/api/types/identity/Patient.ts +3 -0
- package/src/core/api/types/identity/Person.ts +4 -0
- package/src/core/api/types/identity/PriviledgeScope.ts +9 -0
- package/src/core/api/types/identity/Privilege.ts +5 -0
- package/src/core/api/types/identity/Role.ts +5 -0
- package/src/core/api/types/identity/Session.ts +16 -0
- package/src/core/api/types/identity/User.ts +19 -0
- package/src/core/api/types/identity/UserRoleScope.ts +17 -0
- package/src/core/api/types/identity/UserRoleScopeLocation.ts +7 -0
- package/src/core/api/types/identity/UserRoleScopeOperationType.ts +6 -0
- package/src/core/api/types/stockItem/ImportResult.ts +9 -0
- package/src/core/api/types/stockItem/StockBatch.ts +8 -0
- package/src/core/api/types/stockItem/StockBatchDTO.ts +8 -0
- package/src/core/api/types/stockItem/StockItem.ts +63 -0
- package/src/core/api/types/stockItem/StockItemInventory.ts +10 -0
- package/src/core/api/types/stockItem/StockItemPackagingUOM.ts +20 -0
- package/src/core/api/types/stockItem/StockItemTransaction.ts +22 -0
- package/src/core/api/types/stockItem/StockRule.ts +28 -0
- package/src/core/api/types/stockOperation/LocationType.ts +4 -0
- package/src/core/api/types/stockOperation/StockOperation.ts +36 -0
- package/src/core/api/types/stockOperation/StockOperationAction.ts +24 -0
- package/src/core/api/types/stockOperation/StockOperationDTO.ts +64 -0
- package/src/core/api/types/stockOperation/StockOperationItem.ts +13 -0
- package/src/core/api/types/stockOperation/StockOperationItemCost.ts +14 -0
- package/src/core/api/types/stockOperation/StockOperationItemDTO.ts +29 -0
- package/src/core/api/types/stockOperation/StockOperationLinkDTO.ts +13 -0
- package/src/core/api/types/stockOperation/StockOperationStatus.ts +18 -0
- package/src/core/api/types/stockOperation/StockOperationType.ts +162 -0
- package/src/core/api/types/stockOperation/StockSource.ts +8 -0
- package/src/core/components/carbon/controlled-combo-box/controlled-combo-box.component.tsx +37 -0
- package/src/core/components/carbon/controlled-combo-box/controlled-combo-box.resource.tsx +0 -0
- package/src/core/components/carbon/controlled-combo-box/controlled-combo-box.scss +0 -0
- package/src/core/components/carbon/controlled-combo-box/controlled-combo-box.test.tsx +8 -0
- package/src/core/components/carbon/controlled-dropdown/controlled-dropdown.component.tsx +40 -0
- package/src/core/components/carbon/controlled-dropdown/controlled-dropdown.resource.tsx +0 -0
- package/src/core/components/carbon/controlled-dropdown/controlled-dropdown.scss +0 -0
- package/src/core/components/carbon/controlled-dropdown/controlled-dropdown.test.tsx +8 -0
- package/src/core/components/carbon/controlled-number-input/controlled-number-input.component.tsx +44 -0
- package/src/core/components/carbon/controlled-number-input/controlled-number-input.resource.tsx +0 -0
- package/src/core/components/carbon/controlled-number-input/controlled-number-input.scss +0 -0
- package/src/core/components/carbon/controlled-number-input/controlled-number-input.test.tsx +8 -0
- package/src/core/components/carbon/controlled-radio-button-group/controlled-radio-button-group.component.tsx +54 -0
- package/src/core/components/carbon/controlled-radio-button-group/controlled-radio-button-group.resource.tsx +0 -0
- package/src/core/components/carbon/controlled-radio-button-group/controlled-radio-button-group.scss +0 -0
- package/src/core/components/carbon/controlled-radio-button-group/controlled-radio-button-group.test.tsx +8 -0
- package/src/core/components/carbon/controlled-text-area/controlled-text-area.component.tsx +37 -0
- package/src/core/components/carbon/controlled-text-area/controlled-text-area.resource.tsx +0 -0
- package/src/core/components/carbon/controlled-text-area/controlled-text-area.scss +0 -0
- package/src/core/components/carbon/controlled-text-area/controlled-text-area.test.tsx +11 -0
- package/src/core/components/carbon/controlled-text-input/controlled-text-input.component.tsx +37 -0
- package/src/core/components/carbon/controlled-text-input/controlled-text-input.resource.tsx +0 -0
- package/src/core/components/carbon/controlled-text-input/controlled-text-input.scss +0 -0
- package/src/core/components/carbon/controlled-text-input/controlled-text-input.test.tsx +8 -0
- package/src/core/components/carbon/types.ts +7 -0
- package/src/core/components/card/metrics-card-component.tsx +102 -0
- package/src/core/components/card/metrics-card.scss +78 -0
- package/src/core/components/overlay/hook.ts +47 -0
- package/src/core/components/overlay/overlay.component.tsx +52 -0
- package/src/core/components/overlay/overlay.scss +97 -0
- package/src/core/components/side-nav/side-nav.component.tsx +62 -0
- package/src/core/components/side-nav/side-nav.scss +126 -0
- package/src/core/components/side-nav/types.ts +6 -0
- package/src/core/components/table/table.component.tsx +239 -0
- package/src/core/components/table/table.scss +173 -0
- package/src/core/components/table/types.ts +8 -0
- package/src/core/components/tabs/types.ts +7 -0
- package/src/core/components/tabs/vertical-tabs.component.tsx +53 -0
- package/src/core/components/tabs/vertical-tabs.scss +126 -0
- package/src/core/hooks/debounce-hook.ts +35 -0
- package/src/core/print/PrintStyles.ts +774 -0
- package/src/core/print/PrintTemplate.ts +65 -0
- package/src/core/print/printUtils.ts +19 -0
- package/src/core/utils/alert.ts +10 -0
- package/src/core/utils/datetimeUtils.ts +84 -0
- package/src/core/utils/debounce.ts +21 -0
- package/src/core/utils/imageUtils.ts +82 -0
- package/src/core/utils/stringUtils.ts +27 -0
- package/src/core/utils/utils.ts +70 -0
- package/src/createDashboardLink.tsx +43 -0
- package/src/dashboard/stock-management-dashboard-side-nav.component.tsx +50 -0
- package/src/dashboard/stock-management-dashboard.component.tsx +41 -0
- package/src/dashboard/stock-management-dashboard.scss +8 -0
- package/src/dashboard.meta.ts +5 -0
- package/src/declarations.d.ts +6 -0
- package/src/index.ts +64 -0
- package/src/root.component.tsx +12 -0
- package/src/root.scss +174 -0
- package/src/routes.json +53 -0
- package/src/setup-tests.ts +1 -0
- package/src/stock-app-menu-item/item.component.tsx +21 -0
- package/src/stock-app-menu-item/item.resource.ts +0 -0
- package/src/stock-app-menu-item/item.scss +17 -0
- package/src/stock-batch/stock-batch.resource.ts +79 -0
- package/src/stock-home/stock-home-detail-card.scss +211 -0
- package/src/stock-home/stock-home-detail-cards.component.tsx +62 -0
- package/src/stock-home/stock-home-inventory-card.component.tsx +80 -0
- package/src/stock-home/stock-home-inventory-expiry.resource.tsx +32 -0
- package/src/stock-home/stock-home-inventory-items.resource.tsx +28 -0
- package/src/stock-home/stock-home-issuing-card.component.tsx +84 -0
- package/src/stock-home/stock-home-issuing.resource.tsx +18 -0
- package/src/stock-home/stock-home-landing-page-component.tsx +14 -0
- package/src/stock-home/stock-home-metrics.tsx +112 -0
- package/src/stock-home/stock-home-receiving-card.component.tsx +66 -0
- package/src/stock-home/stock-home-receiving.resource.tsx +17 -0
- package/src/stock-home/stock-home.scss +13 -0
- package/src/stock-home/useDisposalList.tsx +18 -0
- package/src/stock-home/useStockList.tsx +36 -0
- package/src/stock-items/add-bulk-stock-item/add-stock-items-bulk-import-action-button.component.tsx +26 -0
- package/src/stock-items/add-bulk-stock-item/stock-items-bulk-import.component.tsx +109 -0
- package/src/stock-items/add-bulk-stock-item/stock-items-bulk-import.resource.ts +14 -0
- package/src/stock-items/add-bulk-stock-item/stock-items-bulk-import.scss +0 -0
- package/src/stock-items/add-stock-item/add-stock-action-button.component.tsx +21 -0
- package/src/stock-items/add-stock-item/add-stock-item.component.tsx +84 -0
- package/src/stock-items/add-stock-item/add-stock-item.resource.tsx +36 -0
- package/src/stock-items/add-stock-item/add-stock-item.scss +5 -0
- package/src/stock-items/add-stock-item/batch-information/batch-information.component.tsx +98 -0
- package/src/stock-items/add-stock-item/batch-information/batch-information.resource.tsx +71 -0
- package/src/stock-items/add-stock-item/batch-information/batch-information.scss +0 -0
- package/src/stock-items/add-stock-item/concepts-selector/concepts-selector.component.tsx +79 -0
- package/src/stock-items/add-stock-item/concepts-selector/concepts-selector.resource.tsx +0 -0
- package/src/stock-items/add-stock-item/concepts-selector/concepts-selector.scss +0 -0
- package/src/stock-items/add-stock-item/concepts-selector/concepts-selector.test.tsx +8 -0
- package/src/stock-items/add-stock-item/dispensing-package-measurement/dispensing-package-measurement.component.tsx +76 -0
- package/src/stock-items/add-stock-item/dispensing-unit-selector/dispensing-unit-selector.component.tsx +66 -0
- package/src/stock-items/add-stock-item/dispensing-unit-selector/dispensing-unit-selector.resource.tsx +0 -0
- package/src/stock-items/add-stock-item/dispensing-unit-selector/dispensing-unit-selector.scss +0 -0
- package/src/stock-items/add-stock-item/dispensing-unit-selector/dispensing-unit-selector.test.tsx +8 -0
- package/src/stock-items/add-stock-item/drug-selector/drug-selector.component.tsx +83 -0
- package/src/stock-items/add-stock-item/drug-selector/drug-selector.resource.tsx +50 -0
- package/src/stock-items/add-stock-item/drug-selector/drug-selector.scss +0 -0
- package/src/stock-items/add-stock-item/packaging-units/packaging-units.component.tsx +255 -0
- package/src/stock-items/add-stock-item/packaging-units/packaging-units.resource.tsx +38 -0
- package/src/stock-items/add-stock-item/packaging-units/packaging-units.scss +21 -0
- package/src/stock-items/add-stock-item/packaging-units/validationSchema.ts +14 -0
- package/src/stock-items/add-stock-item/packaging-units-concept-selector/packaging-units-concept-selector.component.tsx +95 -0
- package/src/stock-items/add-stock-item/preferred-vendor-selector/preferred-vendor-selector.component.tsx +70 -0
- package/src/stock-items/add-stock-item/preferred-vendor-selector/preferred-vendor-selector.resource.tsx +0 -0
- package/src/stock-items/add-stock-item/preferred-vendor-selector/preferred-vendor-selector.scss +0 -0
- package/src/stock-items/add-stock-item/preferred-vendor-selector/preferred-vendor-selector.test.tsx +8 -0
- package/src/stock-items/add-stock-item/quantities/quantities.component.tsx +83 -0
- package/src/stock-items/add-stock-item/quantities/quantities.resource.tsx +69 -0
- package/src/stock-items/add-stock-item/quantities/quantities.scss +0 -0
- package/src/stock-items/add-stock-item/stock-item-category-selector/stock-item-category-selector.component.tsx +67 -0
- package/src/stock-items/add-stock-item/stock-item-category-selector/stock-item-category-selector.resource.tsx +0 -0
- package/src/stock-items/add-stock-item/stock-item-category-selector/stock-item-category-selector.scss +0 -0
- package/src/stock-items/add-stock-item/stock-item-category-selector/stock-item-category-selector.test.tsx +8 -0
- package/src/stock-items/add-stock-item/stock-item-details/stock-item-details.component.tsx +239 -0
- package/src/stock-items/add-stock-item/stock-item-details/stock-item-details.resource.tsx +14 -0
- package/src/stock-items/add-stock-item/stock-item-details/stock-item-details.scss +13 -0
- package/src/stock-items/add-stock-item/stock-item-rules/add-stock-rule-button.component.tsx +30 -0
- package/src/stock-items/add-stock-item/stock-item-rules/add-stock-rules.component.tsx +424 -0
- package/src/stock-items/add-stock-item/stock-item-rules/add-stock-rules.scss +18 -0
- package/src/stock-items/add-stock-item/stock-item-rules/delete-stock-rule-modal.component.tsx +47 -0
- package/src/stock-items/add-stock-item/stock-item-rules/edit-stock-rule.component.tsx +37 -0
- package/src/stock-items/add-stock-item/stock-item-rules/edit-stock-rule.scss +0 -0
- package/src/stock-items/add-stock-item/stock-item-rules/stock-item-rules.component.tsx +222 -0
- package/src/stock-items/add-stock-item/stock-item-rules/stock-item-rules.resource.tsx +72 -0
- package/src/stock-items/add-stock-item/stock-item-rules/stock-item-rules.scss +13 -0
- package/src/stock-items/add-stock-item/stock-item-rules/stock-rules-delete.component.tsx +67 -0
- package/src/stock-items/add-stock-item/stock-item-rules/stock-rules-delete.scss +0 -0
- package/src/stock-items/add-stock-item/stock-item-rules/stock-rules-filter.component.tsx +38 -0
- package/src/stock-items/add-stock-item/stock-item-rules/stock-rules-filter.scss +13 -0
- package/src/stock-items/add-stock-item/stock-item-rules/stock-rules.resource.ts +79 -0
- package/src/stock-items/add-stock-item/stock-item-units-edit/stock-item-units-edit.component.tsx +132 -0
- package/src/stock-items/add-stock-item/stock-rules/stock-rules.component.tsx +16 -0
- package/src/stock-items/add-stock-item/stock-rules/stock-rules.resource.tsx +0 -0
- package/src/stock-items/add-stock-item/stock-rules/stock-rules.scss +0 -0
- package/src/stock-items/add-stock-item/transactions/transactions.component.tsx +151 -0
- package/src/stock-items/add-stock-item/transactions/transactions.resource.tsx +109 -0
- package/src/stock-items/add-stock-item/transactions/transactions.scss +0 -0
- package/src/stock-items/components/filter-stock-items/filter-stock-items.component.tsx +28 -0
- package/src/stock-items/components/filter-stock-items/filter-stock-items.resource.tsx +0 -0
- package/src/stock-items/components/filter-stock-items/filter-stock-items.scss +3 -0
- package/src/stock-items/edit-stock-item/edit-stock-item-action-menu.component.tsx +30 -0
- package/src/stock-items/stock-item.utils.tsx +62 -0
- package/src/stock-items/stock-items-table.component.tsx +266 -0
- package/src/stock-items/stock-items-table.resource.ts +58 -0
- package/src/stock-items/stock-items-table.scss +66 -0
- package/src/stock-items/stock-items.component.tsx +12 -0
- package/src/stock-items/stock-items.resource.ts +365 -0
- package/src/stock-items/types.ts +8 -0
- package/src/stock-items/validationSchema.ts +67 -0
- package/src/stock-locations/stock-locations-table.component.tsx +69 -0
- package/src/stock-locations/stock-locations-table.resource.tsx +73 -0
- package/src/stock-locations/stock-locations-table.scss +0 -0
- package/src/stock-locations/stock-locations.component.tsx +12 -0
- package/src/stock-locations/stock-locations.resource.ts +0 -0
- package/src/stock-lookups/stock-lookups.resource.ts +306 -0
- package/src/stock-management-admin-card-link.component.tsx +29 -0
- package/src/stock-management-header/stock-management-Illustration.tsx +35 -0
- package/src/stock-management-header/stock-management-header.component.tsx +37 -0
- package/src/stock-management-header/stock-management-header.scss +58 -0
- package/src/stock-management.component.tsx +6 -0
- package/src/stock-operations/add-stock-operation/add-stock-operation.component.tsx +491 -0
- package/src/stock-operations/add-stock-operation/add-stock-operation.resource.tsx +33 -0
- package/src/stock-operations/add-stock-operation/add-stock-operation.scss +44 -0
- package/src/stock-operations/add-stock-operation/add-stock-operation.utils.tsx +241 -0
- package/src/stock-operations/add-stock-operation/add-stock-utils.ts +110 -0
- package/src/stock-operations/add-stock-operation/base-operation-details.component.tsx +352 -0
- package/src/stock-operations/add-stock-operation/stock-items-addition-row.component.tsx +347 -0
- package/src/stock-operations/add-stock-operation/stock-items-addition-row.resource.tsx +0 -0
- package/src/stock-operations/add-stock-operation/stock-items-addition-row.scss +0 -0
- package/src/stock-operations/add-stock-operation/stock-items-addition-row.test.tsx +11 -0
- package/src/stock-operations/add-stock-operation/stock-items-addition.component.scss +5 -0
- package/src/stock-operations/add-stock-operation/stock-items-addition.component.tsx +272 -0
- package/src/stock-operations/add-stock-operation/stock-operation-context/useStockOperationContext.tsx +22 -0
- package/src/stock-operations/add-stock-operation/stock-operation-submission.component.tsx +188 -0
- package/src/stock-operations/add-stock-operation/types.ts +55 -0
- package/src/stock-operations/add-stock-operation/validationSchema.ts +45 -0
- package/src/stock-operations/batch-no-selector/batch-no-selector.component.tsx +100 -0
- package/src/stock-operations/batch-no-selector/batch-no-selector.resource.tsx +46 -0
- package/src/stock-operations/batch-no-selector/batch-no-selector.scss +0 -0
- package/src/stock-operations/batch-no-selector/batch-no-selector.test.tsx +11 -0
- package/src/stock-operations/edit-stock-operation/edit-stock-operation-action-menu.component.tsx +73 -0
- package/src/stock-operations/party-selector/party-selector.component.tsx +58 -0
- package/src/stock-operations/qty-uom-selector/qty-uom-selector.component.tsx +65 -0
- package/src/stock-operations/qty-uom-selector/qty-uom-selector.resource.tsx +0 -0
- package/src/stock-operations/qty-uom-selector/qty-uom-selector.scss +0 -0
- package/src/stock-operations/qty-uom-selector/qty-uom-selector.test.tsx +11 -0
- package/src/stock-operations/stock-item-selector/stock-item-selector.component.tsx +74 -0
- package/src/stock-operations/stock-item-selector/stock-item-selector.resource.tsx +47 -0
- package/src/stock-operations/stock-item-selector/stock-item-selector.scss +0 -0
- package/src/stock-operations/stock-item-selector/stock-item-selector.test.tsx +11 -0
- package/src/stock-operations/stock-operation-operations-filter/stock-operation-operations-filter.component.tsx +27 -0
- package/src/stock-operations/stock-operation-operations-filter/stock-operation-operations-filter.scss +13 -0
- package/src/stock-operations/stock-operation-reason-selector/stock-operation-reason-selector.component.tsx +65 -0
- package/src/stock-operations/stock-operation-sources-filter/stock-operation-sources-filter.component.tsx +30 -0
- package/src/stock-operations/stock-operation-sources-filter/stock-operation-sources-filter.scss +13 -0
- package/src/stock-operations/stock-operation-statuses-filter/stock-operation-statuses-filter.component.tsx +32 -0
- package/src/stock-operations/stock-operation-statuses-filter/stock-operation-statuses-filter.scss +13 -0
- package/src/stock-operations/stock-operation-types-selector/stock-operation-types-selector.component.tsx +80 -0
- package/src/stock-operations/stock-operation.utils.tsx +106 -0
- package/src/stock-operations/stock-operations-dialog/stock-operations-approve-button.component.tsx +36 -0
- package/src/stock-operations/stock-operations-dialog/stock-operations-approve-dispatch-button.component.tsx +36 -0
- package/src/stock-operations/stock-operations-dialog/stock-operations-cancel-button.component.tsx +37 -0
- package/src/stock-operations/stock-operations-dialog/stock-operations-complete-button.component.tsx +36 -0
- package/src/stock-operations/stock-operations-dialog/stock-operations-completed-dispatch-button.component.tsx +36 -0
- package/src/stock-operations/stock-operations-dialog/stock-operations-dialog.component.tsx +167 -0
- package/src/stock-operations/stock-operations-dialog/stock-operations-dialog.scss +14 -0
- package/src/stock-operations/stock-operations-dialog/stock-operations-issue-stock-button.component.tsx +58 -0
- package/src/stock-operations/stock-operations-dialog/stock-operations-print-button.component.tsx +160 -0
- package/src/stock-operations/stock-operations-dialog/stock-operations-reject-button.component.tsx +37 -0
- package/src/stock-operations/stock-operations-dialog/stock-operations-return-button.component.tsx +37 -0
- package/src/stock-operations/stock-operations-table.component.tsx +524 -0
- package/src/stock-operations/stock-operations-table.resource.tsx +77 -0
- package/src/stock-operations/stock-operations-table.scss +0 -0
- package/src/stock-operations/stock-operations.component.tsx +12 -0
- package/src/stock-operations/stock-operations.resource.ts +238 -0
- package/src/stock-operations/stock-print-reports/GoodsReceivedNote.tsx +147 -0
- package/src/stock-operations/stock-print-reports/RequisitionDocument.tsx +153 -0
- package/src/stock-operations/stock-print-reports/StockOperationReport.tsx +133 -0
- package/src/stock-operations/stock-print-reports/StockTransferDocument.tsx +161 -0
- package/src/stock-operations/swr-revalidation.ts +7 -0
- package/src/stock-operations/users-selector/users-selector.component.tsx +77 -0
- package/src/stock-operations/users-selector/users-selector.resource.tsx +47 -0
- package/src/stock-operations/validation-schema.ts +195 -0
- package/src/stock-reports/ReportType.ts +63 -0
- package/src/stock-reports/stock-reports.component.tsx +0 -0
- package/src/stock-reports/stock-reports.resource.ts +0 -0
- package/src/stock-settings/stock-settings.component.tsx +11 -0
- package/src/stock-settings/stock-settings.resource.ts +0 -0
- package/src/stock-sources/add-stock-source-button.component.tsx +21 -0
- package/src/stock-sources/add-stock-sources/add-stock-sources.component.tsx +152 -0
- package/src/stock-sources/add-stock-sources/add-stock-sources.scss +18 -0
- package/src/stock-sources/delete-stock-modal.component.tsx +47 -0
- package/src/stock-sources/edit-stock-source/edit-stock-source.component.tsx +35 -0
- package/src/stock-sources/edit-stock-source/edit-stock-source.scss +0 -0
- package/src/stock-sources/stock-sources-delete/stock-sources-delate.scss +0 -0
- package/src/stock-sources/stock-sources-delete/stock-sources-delete.component.tsx +72 -0
- package/src/stock-sources/stock-sources-filter/stock-sources-filter.component.tsx +35 -0
- package/src/stock-sources/stock-sources-filter/stock-sources-filter.scss +13 -0
- package/src/stock-sources/stock-sources-items-table.component.tsx +213 -0
- package/src/stock-sources/stock-sources-items-table.resource.ts +56 -0
- package/src/stock-sources/stock-sources.component.tsx +12 -0
- package/src/stock-sources/stock-sources.resource.ts +80 -0
- package/src/stock-sources/stock-sources.scss +220 -0
- package/src/stock-sources/swr-revalidation.ts +7 -0
- package/src/stock-tabs/commodity-tabs.component.tsx +43 -0
- package/src/stock-tabs/commodity-tabs.scss +0 -0
- package/src/stock-user-role-scopes/add-stock-user-role-scope-button.component.tsx +21 -0
- package/src/stock-user-role-scopes/add-stock-user-scope/add-stock-user-role-scope.component.tsx +525 -0
- package/src/stock-user-role-scopes/add-stock-user-scope/add-stock-user-role-scope.scss +37 -0
- package/src/stock-user-role-scopes/delete-stock-user-scope/delete-stock-user-scope.component.tsx +73 -0
- package/src/stock-user-role-scopes/delete-stock-user-scope/delete-stock-user-scope.scss +0 -0
- package/src/stock-user-role-scopes/delete-stock-user-scope-modal.component.tsx +47 -0
- package/src/stock-user-role-scopes/edit-stock-user-scope/edit-stock-user-scope-action-menu.component.tsx +35 -0
- package/src/stock-user-role-scopes/stock-user-role-scopes-items-table.component.tsx +284 -0
- package/src/stock-user-role-scopes/stock-user-role-scopes-items-table.resource.ts +31 -0
- package/src/stock-user-role-scopes/stock-user-role-scopes.component.tsx +12 -0
- package/src/stock-user-role-scopes/stock-user-role-scopes.resource.ts +76 -0
- package/src/stock-user-role-scopes/stock-user-role-scopes.scss +61 -0
- package/src/stock-user-role-scopes/swr-revalidation.ts +7 -0
- package/src/utils.ts +10 -0
- package/translations/en.json +24 -0
- package/tsconfig.json +23 -0
- package/webpack.config.js +1 -0
@@ -0,0 +1,62 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { SideNavItem } from "./types";
|
3
|
+
import { SideNav, SideNavItems, SideNavLink } from "@carbon/react";
|
4
|
+
import styles from "./side-nav.scss";
|
5
|
+
import { navigate } from "@openmrs/esm-framework";
|
6
|
+
|
7
|
+
interface SideNavProps {
|
8
|
+
tabs: SideNavItem[];
|
9
|
+
selectedIndex?: number;
|
10
|
+
onSelectTab: (index: number) => void;
|
11
|
+
}
|
12
|
+
|
13
|
+
const SideNavItemsList: React.FC<SideNavProps> = ({
|
14
|
+
tabs,
|
15
|
+
selectedIndex,
|
16
|
+
onSelectTab,
|
17
|
+
}) => {
|
18
|
+
return (
|
19
|
+
<div
|
20
|
+
className={`
|
21
|
+
${styles.cohortBuilder}
|
22
|
+
`}
|
23
|
+
>
|
24
|
+
<div className={styles.tab}>
|
25
|
+
<SideNav
|
26
|
+
isFixedNav
|
27
|
+
expanded={true}
|
28
|
+
isChildOfHeader={true}
|
29
|
+
aria-label="Side navigation"
|
30
|
+
>
|
31
|
+
<SideNavItems>
|
32
|
+
{tabs.map((tab: SideNavItem, index: number) => (
|
33
|
+
<SideNavLink
|
34
|
+
key={index}
|
35
|
+
isActive={index === selectedIndex}
|
36
|
+
onClick={() => {
|
37
|
+
if (index === tabs.length - 1) {
|
38
|
+
// Check if it's the last item in the list
|
39
|
+
navigate({
|
40
|
+
to: "/openmrs/admin/maintenance/settings.list?show=Stockmanagement",
|
41
|
+
});
|
42
|
+
} else {
|
43
|
+
onSelectTab(index); // Call onSelectTab to update selectedTab in the parent
|
44
|
+
navigate({
|
45
|
+
to: `${window.getOpenmrsSpaBase()}stock-management/${
|
46
|
+
tab.link
|
47
|
+
}`,
|
48
|
+
});
|
49
|
+
}
|
50
|
+
}}
|
51
|
+
>
|
52
|
+
{tab.name}
|
53
|
+
</SideNavLink>
|
54
|
+
))}
|
55
|
+
</SideNavItems>
|
56
|
+
</SideNav>
|
57
|
+
</div>
|
58
|
+
</div>
|
59
|
+
);
|
60
|
+
};
|
61
|
+
|
62
|
+
export default SideNavItemsList;
|
@@ -0,0 +1,126 @@
|
|
1
|
+
@use '@carbon/styles/scss/colors';
|
2
|
+
@use '@carbon/styles/scss/spacing';
|
3
|
+
@use '@carbon/styles/scss/type';
|
4
|
+
@import '~@openmrs/esm-styleguide/src/vars';
|
5
|
+
|
6
|
+
.heading {
|
7
|
+
@include type.type-style('productive-heading-02');
|
8
|
+
color: colors.$gray-70;
|
9
|
+
margin-bottom: spacing.$spacing-05;;
|
10
|
+
}
|
11
|
+
|
12
|
+
.heading:after {
|
13
|
+
content: "";
|
14
|
+
display: block;
|
15
|
+
width: 2rem;
|
16
|
+
padding-top: 0.188rem;
|
17
|
+
border-bottom: 0.375rem solid var(--brand-03);
|
18
|
+
}
|
19
|
+
|
20
|
+
.mainContainer {
|
21
|
+
padding-bottom: 1.5rem;
|
22
|
+
background: $ui-01;
|
23
|
+
display: flex;
|
24
|
+
justify-content: center;
|
25
|
+
}
|
26
|
+
|
27
|
+
.title {
|
28
|
+
padding: 1rem;
|
29
|
+
font-size: 1.2rem;
|
30
|
+
}
|
31
|
+
|
32
|
+
.desktopContainer {
|
33
|
+
width: 50%;
|
34
|
+
}
|
35
|
+
|
36
|
+
.tabletContainer {
|
37
|
+
width: 90%;
|
38
|
+
}
|
39
|
+
|
40
|
+
.cohortBuilder {
|
41
|
+
:global(.cds--date-picker.cds--date-picker--single .cds--date-picker__input) {
|
42
|
+
width: auto;
|
43
|
+
}
|
44
|
+
|
45
|
+
:global(.cds--tab-content) {
|
46
|
+
width: 100% !important;
|
47
|
+
overflow-x: hidden;
|
48
|
+
padding: 0;
|
49
|
+
}
|
50
|
+
|
51
|
+
:global(.cds--tab--list) {
|
52
|
+
flex-direction: column;
|
53
|
+
}
|
54
|
+
|
55
|
+
:global(.cds--tabs) {
|
56
|
+
width: auto;
|
57
|
+
max-height: 20rem;
|
58
|
+
display: flex;
|
59
|
+
flex-direction: column;
|
60
|
+
flex: 1;
|
61
|
+
}
|
62
|
+
|
63
|
+
:global(.cds--tabs__panel) {
|
64
|
+
height: 100%;
|
65
|
+
overflow-y: auto;
|
66
|
+
}
|
67
|
+
|
68
|
+
:global(.cds--tabs .cds--tabs__nav-link) {
|
69
|
+
border-bottom: 0;
|
70
|
+
border-left: 3px solid $ui-03;
|
71
|
+
line-height: 3.5;
|
72
|
+
}
|
73
|
+
|
74
|
+
:global(.cds--tabs .cds--tabs__nav-item--selected) {
|
75
|
+
border-left: 3px solid var(--brand-03);
|
76
|
+
border-bottom: 0;
|
77
|
+
font-weight: 600;
|
78
|
+
}
|
79
|
+
|
80
|
+
:global(.cds--tabs__nav-link) {
|
81
|
+
&:active, &:focus {
|
82
|
+
outline: 0 !important;
|
83
|
+
outline-offset: 0 !important;
|
84
|
+
}
|
85
|
+
|
86
|
+
max-height: 4rem;
|
87
|
+
}
|
88
|
+
|
89
|
+
:global(.cds--col) {
|
90
|
+
padding-left: 0;
|
91
|
+
width: 100%;
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
95
|
+
.tabletTab {
|
96
|
+
width: 25%;
|
97
|
+
}
|
98
|
+
|
99
|
+
.desktopTab {
|
100
|
+
width: 20%;
|
101
|
+
}
|
102
|
+
|
103
|
+
.tab {
|
104
|
+
display: flex;
|
105
|
+
}
|
106
|
+
|
107
|
+
.tabContainer {
|
108
|
+
background: white;
|
109
|
+
padding-left: 1.5rem;
|
110
|
+
padding-right: 1rem;
|
111
|
+
padding-top: 1rem;
|
112
|
+
margin-bottom: 1rem;
|
113
|
+
}
|
114
|
+
|
115
|
+
.optionCell {
|
116
|
+
padding: 0 !important;
|
117
|
+
}
|
118
|
+
|
119
|
+
.optionHeader {
|
120
|
+
width: 1.5rem !important;
|
121
|
+
}
|
122
|
+
|
123
|
+
.text {
|
124
|
+
font-size: 0.9rem;
|
125
|
+
padding: 0.5rem;
|
126
|
+
}
|
@@ -0,0 +1,239 @@
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
2
|
+
import { useTranslation } from "react-i18next";
|
3
|
+
import { saveAs } from "file-saver";
|
4
|
+
import {
|
5
|
+
DataTable,
|
6
|
+
OverflowMenu,
|
7
|
+
OverflowMenuItem,
|
8
|
+
Pagination,
|
9
|
+
Table,
|
10
|
+
TableBody,
|
11
|
+
TableCell,
|
12
|
+
TableContainer,
|
13
|
+
TableHead,
|
14
|
+
TableHeader,
|
15
|
+
TableRow,
|
16
|
+
TableToolbar,
|
17
|
+
TableToolbarContent,
|
18
|
+
TableToolbarSearch,
|
19
|
+
Tile,
|
20
|
+
} from "@carbon/react";
|
21
|
+
import { DocumentDownload } from "@carbon/react/icons";
|
22
|
+
import {
|
23
|
+
isDesktop,
|
24
|
+
useLayoutType,
|
25
|
+
usePagination,
|
26
|
+
} from "@openmrs/esm-framework";
|
27
|
+
import { DataTableRenderProps } from "./types";
|
28
|
+
import styles from "./table.scss";
|
29
|
+
|
30
|
+
type FilterProps = {
|
31
|
+
rowIds: Array<string>;
|
32
|
+
headers: any;
|
33
|
+
cellsById: any;
|
34
|
+
inputValue: string;
|
35
|
+
getCellId: (row, key) => string;
|
36
|
+
};
|
37
|
+
|
38
|
+
interface ListProps {
|
39
|
+
columns: any;
|
40
|
+
data: any;
|
41
|
+
children?: (renderProps: DataTableRenderProps) => React.ReactElement;
|
42
|
+
totalItems?: number;
|
43
|
+
goToPage?: (page: number) => void;
|
44
|
+
hasToolbar?: boolean;
|
45
|
+
}
|
46
|
+
|
47
|
+
const DataList: React.FC<ListProps> = ({
|
48
|
+
columns,
|
49
|
+
data,
|
50
|
+
children,
|
51
|
+
totalItems,
|
52
|
+
goToPage,
|
53
|
+
hasToolbar = true,
|
54
|
+
}) => {
|
55
|
+
const { t } = useTranslation();
|
56
|
+
const layout = useLayoutType();
|
57
|
+
const [allRows, setAllRows] = useState([]);
|
58
|
+
const isTablet = useLayoutType() === "tablet";
|
59
|
+
const [list] = useState(data);
|
60
|
+
const pageSizes = [10, 20, 30, 40, 50];
|
61
|
+
const [currentPageSize, setPageSize] = useState(10);
|
62
|
+
const {
|
63
|
+
goTo,
|
64
|
+
results: paginatedList,
|
65
|
+
currentPage,
|
66
|
+
} = usePagination(list, currentPageSize);
|
67
|
+
|
68
|
+
useEffect(() => {
|
69
|
+
const rows: Array<Record<string, string>> = [];
|
70
|
+
|
71
|
+
paginatedList.map((item: any, index) => {
|
72
|
+
return rows.push({ ...item, id: index++ });
|
73
|
+
});
|
74
|
+
setAllRows(rows);
|
75
|
+
}, [paginatedList, allRows]);
|
76
|
+
|
77
|
+
const handleFilter = ({
|
78
|
+
rowIds,
|
79
|
+
headers,
|
80
|
+
cellsById,
|
81
|
+
inputValue,
|
82
|
+
getCellId,
|
83
|
+
}: FilterProps): Array<string> => {
|
84
|
+
return rowIds.filter((rowId) =>
|
85
|
+
headers.some(({ key }) => {
|
86
|
+
const cellId = getCellId(rowId, key);
|
87
|
+
const filterableValue = cellsById[cellId].value;
|
88
|
+
const filterTerm = inputValue.toLowerCase();
|
89
|
+
|
90
|
+
if (typeof filterableValue === "boolean") {
|
91
|
+
return false;
|
92
|
+
}
|
93
|
+
|
94
|
+
return ("" + filterableValue).toLowerCase().includes(filterTerm);
|
95
|
+
})
|
96
|
+
);
|
97
|
+
};
|
98
|
+
const handleExport = (object) => {
|
99
|
+
const csvString = convertToCSV(list, columns);
|
100
|
+
if (object.currentTarget.innerText == "Download As CSV") {
|
101
|
+
const blob = new Blob([csvString], { type: "text/csv;charset=utf-8" });
|
102
|
+
saveAs(blob, "data.csv");
|
103
|
+
} else if (object.currentTarget.innerText == "Download As Json") {
|
104
|
+
const jsonBlob = new Blob([csvString], { type: "application/json" });
|
105
|
+
saveAs(jsonBlob, "data.json");
|
106
|
+
}
|
107
|
+
};
|
108
|
+
const convertToCSV = (data, columns) => {
|
109
|
+
const header = columns.map((col) => col.header).join(",");
|
110
|
+
const rows = data.map((row) =>
|
111
|
+
columns.map((col) => JSON.stringify(row[col.key])).join(",")
|
112
|
+
);
|
113
|
+
return [header, ...rows].join("\n");
|
114
|
+
};
|
115
|
+
return (
|
116
|
+
<>
|
117
|
+
<DataTable
|
118
|
+
data-floating-menu-container
|
119
|
+
rows={allRows}
|
120
|
+
headers={columns}
|
121
|
+
filterRows={handleFilter}
|
122
|
+
overflowMenuOnHover={isDesktop(layout)}
|
123
|
+
size={isTablet ? "lg" : "md"}
|
124
|
+
useZebraStyles
|
125
|
+
>
|
126
|
+
{({ rows, headers, getHeaderProps, getTableProps, onInputChange }) => (
|
127
|
+
<div>
|
128
|
+
<TableContainer className={styles.tableContainer}>
|
129
|
+
{hasToolbar && (
|
130
|
+
<TableToolbar
|
131
|
+
style={{
|
132
|
+
position: "static",
|
133
|
+
overflow: "visible",
|
134
|
+
backgroundColor: "color",
|
135
|
+
}}
|
136
|
+
>
|
137
|
+
<TableToolbarContent className={styles.toolbarContent}>
|
138
|
+
{children ? (
|
139
|
+
children({
|
140
|
+
onInputChange,
|
141
|
+
})
|
142
|
+
) : (
|
143
|
+
<>
|
144
|
+
<OverflowMenu
|
145
|
+
size="sm"
|
146
|
+
kind="tertiary"
|
147
|
+
renderIcon={DocumentDownload}
|
148
|
+
iconDescription="Download As"
|
149
|
+
focusTrap={false}
|
150
|
+
>
|
151
|
+
<OverflowMenuItem
|
152
|
+
itemText="Download As CSV"
|
153
|
+
onClick={handleExport}
|
154
|
+
/>
|
155
|
+
<OverflowMenuItem
|
156
|
+
itemText="Download As PDF"
|
157
|
+
onClick={handleExport}
|
158
|
+
/>
|
159
|
+
<OverflowMenuItem
|
160
|
+
itemText="Download As Json"
|
161
|
+
onClick={handleExport}
|
162
|
+
/>
|
163
|
+
</OverflowMenu>
|
164
|
+
<TableToolbarSearch
|
165
|
+
className={styles.patientListSearch}
|
166
|
+
expanded
|
167
|
+
onChange={onInputChange}
|
168
|
+
placeholder={t("searchThisList", "Search this list")}
|
169
|
+
size="sm"
|
170
|
+
/>
|
171
|
+
</>
|
172
|
+
)}
|
173
|
+
</TableToolbarContent>
|
174
|
+
</TableToolbar>
|
175
|
+
)}
|
176
|
+
<Table {...getTableProps()}>
|
177
|
+
<TableHead>
|
178
|
+
<TableRow>
|
179
|
+
{headers.map((header) => (
|
180
|
+
<TableHeader {...getHeaderProps({ header })}>
|
181
|
+
{header.header}
|
182
|
+
</TableHeader>
|
183
|
+
))}
|
184
|
+
</TableRow>
|
185
|
+
</TableHead>
|
186
|
+
<TableBody>
|
187
|
+
{rows.map((row) => (
|
188
|
+
<TableRow key={row.id}>
|
189
|
+
{row.cells.map((cell) => (
|
190
|
+
<TableCell key={cell.id}>{cell.value}</TableCell>
|
191
|
+
))}
|
192
|
+
</TableRow>
|
193
|
+
))}
|
194
|
+
</TableBody>
|
195
|
+
</Table>
|
196
|
+
{rows.length === 0 ? (
|
197
|
+
<div className={styles.tileContainer}>
|
198
|
+
<Tile className={styles.tile}>
|
199
|
+
<div className={styles.tileContent}>
|
200
|
+
<p className={styles.content}>
|
201
|
+
{t("No data", "No data to display")}
|
202
|
+
</p>
|
203
|
+
<p className={styles.helper}>
|
204
|
+
{t("checkFilters", "Check the filters above")}
|
205
|
+
</p>
|
206
|
+
</div>
|
207
|
+
</Tile>
|
208
|
+
</div>
|
209
|
+
) : null}
|
210
|
+
<Pagination
|
211
|
+
forwardText="Next page"
|
212
|
+
backwardText="Previous page"
|
213
|
+
page={currentPage}
|
214
|
+
pageSize={currentPageSize}
|
215
|
+
pageSizes={pageSizes}
|
216
|
+
totalItems={totalItems || list?.length}
|
217
|
+
className={styles.pagination}
|
218
|
+
onChange={({ pageSize, page }) => {
|
219
|
+
if (pageSize !== currentPageSize) {
|
220
|
+
setPageSize(pageSize);
|
221
|
+
}
|
222
|
+
if (page !== currentPage) {
|
223
|
+
if (goToPage) {
|
224
|
+
goToPage(page);
|
225
|
+
return;
|
226
|
+
}
|
227
|
+
goTo(page);
|
228
|
+
}
|
229
|
+
}}
|
230
|
+
/>
|
231
|
+
</TableContainer>
|
232
|
+
</div>
|
233
|
+
)}
|
234
|
+
</DataTable>
|
235
|
+
</>
|
236
|
+
);
|
237
|
+
};
|
238
|
+
|
239
|
+
export default DataList;
|
@@ -0,0 +1,173 @@
|
|
1
|
+
@use '@carbon/styles/scss/colors';
|
2
|
+
@use '@carbon/styles/scss/spacing';
|
3
|
+
@use '@carbon/styles/scss/type';
|
4
|
+
@import '~@openmrs/esm-styleguide/src/vars';
|
5
|
+
|
6
|
+
.widgetContainer {
|
7
|
+
background-color: $ui-background;
|
8
|
+
}
|
9
|
+
|
10
|
+
.widgetHeaderContainer {
|
11
|
+
display: flex;
|
12
|
+
justify-content: space-between;
|
13
|
+
align-items: center;
|
14
|
+
padding: spacing.$spacing-04 0 spacing.$spacing-04 spacing.$spacing-05;
|
15
|
+
}
|
16
|
+
|
17
|
+
.widgetHeaderContainer > h4:after {
|
18
|
+
content: '';
|
19
|
+
display: block;
|
20
|
+
width: 2rem;
|
21
|
+
padding-top: 0.188rem;
|
22
|
+
border-bottom: 0.375rem solid var(--brand-01);
|
23
|
+
}
|
24
|
+
|
25
|
+
.toggleButtons {
|
26
|
+
width: fit-content;
|
27
|
+
margin: 0 spacing.$spacing-03;
|
28
|
+
}
|
29
|
+
|
30
|
+
.searchField {
|
31
|
+
width: 100%;
|
32
|
+
max-width: 250px;
|
33
|
+
border: 0px !important;
|
34
|
+
}
|
35
|
+
|
36
|
+
.searchBox {
|
37
|
+
width: 100%;
|
38
|
+
display: flex;
|
39
|
+
justify-content: right;
|
40
|
+
}
|
41
|
+
|
42
|
+
.container {
|
43
|
+
margin-top: 16px;
|
44
|
+
margin-left: inherit;
|
45
|
+
width: 100%;
|
46
|
+
overflow-y: hidden;
|
47
|
+
}
|
48
|
+
|
49
|
+
.tabContainer {
|
50
|
+
margin-top: 16px;
|
51
|
+
padding-left: 1rem;
|
52
|
+
background-color: #ffffff;
|
53
|
+
}
|
54
|
+
|
55
|
+
.patientListSearch {
|
56
|
+
margin-right: 10px;
|
57
|
+
padding-left: 20px;
|
58
|
+
max-width: 16rem;
|
59
|
+
|
60
|
+
input {
|
61
|
+
background-color: $ui-02 !important;
|
62
|
+
}
|
63
|
+
}
|
64
|
+
|
65
|
+
.tabContainer li button {
|
66
|
+
width: 100% !important;
|
67
|
+
}
|
68
|
+
|
69
|
+
.tileContainer {
|
70
|
+
background-color: $ui-02;
|
71
|
+
border-top: 1px solid $ui-03;
|
72
|
+
padding: 5rem 0;
|
73
|
+
}
|
74
|
+
|
75
|
+
.tile {
|
76
|
+
margin: auto;
|
77
|
+
width: fit-content;
|
78
|
+
}
|
79
|
+
|
80
|
+
.tileContent {
|
81
|
+
display: flex;
|
82
|
+
flex-direction: column;
|
83
|
+
align-items: center;
|
84
|
+
}
|
85
|
+
|
86
|
+
.menuItem {
|
87
|
+
max-width: none;
|
88
|
+
}
|
89
|
+
|
90
|
+
.radioButtonGroup {
|
91
|
+
display: flex;
|
92
|
+
flex-direction: column;
|
93
|
+
align-items: flex-start;
|
94
|
+
margin-top: spacing.$spacing-03;
|
95
|
+
min-height: spacing.$spacing-10;
|
96
|
+
width: 100%;
|
97
|
+
@include type.type-style('body-compact-01');
|
98
|
+
}
|
99
|
+
|
100
|
+
.radioButton {
|
101
|
+
padding: spacing.$spacing-02 spacing.$spacing-02;
|
102
|
+
margin: spacing.$spacing-03 0;
|
103
|
+
}
|
104
|
+
|
105
|
+
section {
|
106
|
+
margin: spacing.$spacing-03;
|
107
|
+
}
|
108
|
+
|
109
|
+
.sectionTitle {
|
110
|
+
@include type.type-style('heading-compact-02');
|
111
|
+
color: colors.$gray-70;
|
112
|
+
margin-bottom: spacing.$spacing-04;
|
113
|
+
}
|
114
|
+
|
115
|
+
.modalBody {
|
116
|
+
padding-bottom: spacing.$spacing-05;
|
117
|
+
}
|
118
|
+
|
119
|
+
.tabContainer div[role='tabpanel'] {
|
120
|
+
padding: 0 !important;
|
121
|
+
}
|
122
|
+
|
123
|
+
.tabContainer li button {
|
124
|
+
width: 100% !important;
|
125
|
+
}
|
126
|
+
|
127
|
+
.tableContainer {
|
128
|
+
margin: 0;
|
129
|
+
padding: 0;
|
130
|
+
}
|
131
|
+
|
132
|
+
.search {
|
133
|
+
max-width: 16rem;
|
134
|
+
|
135
|
+
input {
|
136
|
+
background-color: $ui-02 !important;
|
137
|
+
}
|
138
|
+
}
|
139
|
+
|
140
|
+
.tableContainer {
|
141
|
+
background-color: $ui-01;
|
142
|
+
|
143
|
+
a {
|
144
|
+
text-decoration: none;
|
145
|
+
}
|
146
|
+
|
147
|
+
tr {
|
148
|
+
width: spacing.$spacing-01;
|
149
|
+
}
|
150
|
+
|
151
|
+
.toolbarContent {
|
152
|
+
height: spacing.$spacing-09;
|
153
|
+
}
|
154
|
+
}
|
155
|
+
|
156
|
+
.cds--table-sort__description {
|
157
|
+
display: none;
|
158
|
+
}
|
159
|
+
|
160
|
+
.patientListDownload {
|
161
|
+
margin-top: 10px;
|
162
|
+
}
|
163
|
+
|
164
|
+
.content {
|
165
|
+
@include type.type-style('heading-compact-02');
|
166
|
+
color: $text-02;
|
167
|
+
margin-bottom: 0.5rem;
|
168
|
+
}
|
169
|
+
|
170
|
+
.helper {
|
171
|
+
@include type.type-style('body-compact-01');
|
172
|
+
color: $text-02;
|
173
|
+
}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { TabItem } from "./types";
|
3
|
+
import { Tab, TabList, TabPanel, TabPanels, Tabs } from "@carbon/react";
|
4
|
+
import styles from "./vertical-tabs.scss";
|
5
|
+
|
6
|
+
interface VerticalTabsProps {
|
7
|
+
tabs: TabItem[];
|
8
|
+
title?: string;
|
9
|
+
hasContainer?: boolean;
|
10
|
+
selectedIndex?: number;
|
11
|
+
onChange?: (index: number) => void;
|
12
|
+
}
|
13
|
+
|
14
|
+
const VerticalTabs: React.FC<VerticalTabsProps> = ({
|
15
|
+
tabs,
|
16
|
+
title,
|
17
|
+
hasContainer,
|
18
|
+
selectedIndex,
|
19
|
+
onChange,
|
20
|
+
}) => {
|
21
|
+
return (
|
22
|
+
<div
|
23
|
+
className={`
|
24
|
+
${hasContainer ? styles.tabContainer : ""}
|
25
|
+
${styles.cohortBuilder}
|
26
|
+
`}
|
27
|
+
>
|
28
|
+
{title && <p className={styles.heading}>{title}</p>}
|
29
|
+
<div className={styles.tab}>
|
30
|
+
<Tabs
|
31
|
+
className={`${styles.verticalTabs}`}
|
32
|
+
selectedIndex={selectedIndex}
|
33
|
+
onChange={({ selectedIndex }) => onChange?.(selectedIndex)}
|
34
|
+
>
|
35
|
+
<TabList aria-label="navigation">
|
36
|
+
{tabs.map((tab: TabItem, index: number) => (
|
37
|
+
<Tab key={index} disabled={tab.disabled}>
|
38
|
+
{tab.name}
|
39
|
+
</Tab>
|
40
|
+
))}
|
41
|
+
</TabList>
|
42
|
+
<TabPanels>
|
43
|
+
{tabs.map((tab: TabItem, index: number) => (
|
44
|
+
<TabPanel key={index}>{tab.component}</TabPanel>
|
45
|
+
))}
|
46
|
+
</TabPanels>
|
47
|
+
</Tabs>
|
48
|
+
</div>
|
49
|
+
</div>
|
50
|
+
);
|
51
|
+
};
|
52
|
+
|
53
|
+
export default VerticalTabs;
|