@erpsquad/common 1.8.81 → 1.8.82
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/CHANGELOG.md +253 -253
- package/README.md +979 -979
- package/dist/_virtual/index/index.esm10.js +3 -3
- package/dist/_virtual/index/index.esm11.js +3 -3
- package/dist/_virtual/index/index.esm4.js +1 -1
- package/dist/_virtual/index/index.esm5.js +3 -3
- package/dist/_virtual/index/index.esm6.js +3 -3
- package/dist/_virtual/index/index.esm7.js +3 -3
- package/dist/_virtual/index/index.esm8.js +3 -3
- package/dist/_virtual/index/index.esm9.js +3 -3
- package/dist/_virtual/index/index10.js +1 -1
- package/dist/_virtual/index/index11.js +1 -1
- package/dist/_virtual/index/index4.js +1 -1
- package/dist/_virtual/index/index5.js +1 -1
- package/dist/_virtual/index/index6.js +1 -1
- package/dist/_virtual/index/index7.js +1 -1
- package/dist/_virtual/index/index8.js +1 -1
- package/dist/_virtual/index/index9.js +1 -1
- package/dist/api-client/api.accounting/api/index.esm.js.map +1 -1
- package/dist/api-client/api.accounting/api/index.js.map +1 -1
- package/dist/api-client/api.accounting/api-types.d.ts +15883 -15883
- package/dist/api-client/api.drive/api/index.esm.js.map +1 -1
- package/dist/api-client/api.drive/api/index.js.map +1 -1
- package/dist/api-client/api.drive/api-types.d.ts +696 -696
- package/dist/api-client/api.hrms/api/index.esm.js.map +1 -1
- package/dist/api-client/api.hrms/api/index.js.map +1 -1
- package/dist/api-client/api.inventory/api/index.esm.js.map +1 -1
- package/dist/api-client/api.inventory/api/index.js.map +1 -1
- package/dist/api-client/api.inventory/api-types.d.ts +6110 -6110
- package/dist/api-client/api.manufacturing/api/index.esm.js.map +1 -1
- package/dist/api-client/api.manufacturing/api/index.js.map +1 -1
- package/dist/api-client/api.manufacturing/api-types.d.ts +10066 -10066
- package/dist/api-client/api.purchase/api/index.esm.js.map +1 -1
- package/dist/api-client/api.purchase/api/index.js.map +1 -1
- package/dist/api-client/api.purchase/api-types.d.ts +6715 -6715
- package/dist/api-client/api.rbac/api/index.esm.js.map +1 -1
- package/dist/api-client/api.rbac/api/index.esm2.js.map +1 -1
- package/dist/api-client/api.rbac/api/index.js.map +1 -1
- package/dist/api-client/api.rbac/api/index2.js.map +1 -1
- package/dist/api-client/api.rbac/api-types.d.ts +1753 -1753
- package/dist/api-client/api.rental/api/index.esm.js.map +1 -1
- package/dist/api-client/api.rental/api/index.js.map +1 -1
- package/dist/api-client/api.rental/api-types.d.ts +15666 -15666
- package/dist/api-client/api.sales/api/index.esm.js.map +1 -1
- package/dist/api-client/api.sales/api/index.js.map +1 -1
- package/dist/api-client/api.sales/api-types.d.ts +8258 -8258
- package/dist/api-client/api.system-feature/api/index.esm.js.map +1 -1
- package/dist/api-client/api.system-feature/api/index.js.map +1 -1
- package/dist/api-client/api.system-feature/api-types.d.ts +2875 -2875
- package/dist/api-client/api.user/api/index.esm.js.map +1 -1
- package/dist/api-client/api.user/api/index.js.map +1 -1
- package/dist/api-client/api.user/api-types.d.ts +95 -95
- package/dist/api-client/api.workflow-automation/api/index.esm.js.map +1 -1
- package/dist/api-client/api.workflow-automation/api/index.js.map +1 -1
- package/dist/api-client/index.d.ts +39 -39
- package/dist/components/accordion/accordion/index.esm.js.map +1 -1
- package/dist/components/accordion/accordion/index.js.map +1 -1
- package/dist/components/accordion/accordion.d.ts +1 -1
- package/dist/components/action-bar/action-bar/index.esm.js +1 -1
- package/dist/components/action-bar/action-bar/index.esm.js.map +1 -1
- package/dist/components/action-bar/action-bar/index.js +5 -5
- package/dist/components/action-bar/action-bar/index.js.map +1 -1
- package/dist/components/action-bar/action-bar.d.ts +1 -1
- package/dist/components/activity-tag/activity-tag/index.esm.js.map +1 -1
- package/dist/components/activity-tag/activity-tag/index.js.map +1 -1
- package/dist/components/alert/alert/index.esm.js.map +1 -1
- package/dist/components/alert/alert/index.js.map +1 -1
- package/dist/components/button/button/index.esm.js.map +1 -1
- package/dist/components/button/button/index.js.map +1 -1
- package/dist/components/change-user-password-modal/change-user-password-modal/index.esm.js.map +1 -1
- package/dist/components/change-user-password-modal/change-user-password-modal/index.js.map +1 -1
- package/dist/components/checkbox/checkbox/index.esm.js.map +1 -1
- package/dist/components/checkbox/checkbox/index.js.map +1 -1
- package/dist/components/checkbox/checkbox.d.ts +1 -1
- package/dist/components/chip/chip/index.esm.js.map +1 -1
- package/dist/components/chip/chip/index.js.map +1 -1
- package/dist/components/chip-generator/chip-generator/index.esm.js.map +1 -1
- package/dist/components/chip-generator/chip-generator/index.js.map +1 -1
- package/dist/components/date-picker/date-picker/index.esm.js.map +1 -1
- package/dist/components/date-picker/date-picker/index.js.map +1 -1
- package/dist/components/date-picker/date-picker.d.ts +1 -1
- package/dist/components/date-time-picker/date-time-picker/index.esm.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker/index.js.map +1 -1
- package/dist/components/editor/custom-editor/index.esm.js.map +1 -1
- package/dist/components/editor/custom-editor/index.js.map +1 -1
- package/dist/components/filter/components/delete-group/index.esm.js +0 -1
- package/dist/components/filter/components/delete-group/index.esm.js.map +1 -1
- package/dist/components/filter/components/delete-group/index.js +1 -1
- package/dist/components/filter/components/delete-group/index.js.map +1 -1
- package/dist/components/filter/filter/index.esm.js +1 -1
- package/dist/components/filter/filter/index.esm.js.map +1 -1
- package/dist/components/filter/filter/index.js +7 -7
- package/dist/components/filter/filter/index.js.map +1 -1
- package/dist/components/footer/footer.d.ts +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/dynamic-select/index.esm.js.map +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/dynamic-select/index.js.map +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/media.d.ts +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/phone.d.ts +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/select.d.ts +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/text.d.ts +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/time.d.ts +1 -1
- package/dist/components/form-control/form-parser/form-switcher.d.ts +1 -1
- package/dist/components/header/header/index.esm.js.map +1 -1
- package/dist/components/header/header/index.js.map +1 -1
- package/dist/components/header/redux/actionCreator/index.esm.js +1 -1
- package/dist/components/header/redux/actionCreator/index.esm.js.map +1 -1
- package/dist/components/header/redux/actionCreator/index.js +1 -1
- package/dist/components/header/redux/actionCreator/index.js.map +1 -1
- package/dist/components/icons/action/index.esm.js.map +1 -1
- package/dist/components/icons/action/index.js.map +1 -1
- package/dist/components/icons/action-arrow.d.ts +3 -3
- package/dist/components/icons/add-circle.d.ts +3 -3
- package/dist/components/icons/arrow-bidirectional.d.ts +3 -3
- package/dist/components/icons/arrow-circle-down.d.ts +3 -3
- package/dist/components/icons/arrow-down-three.d.ts +3 -3
- package/dist/components/icons/arrow-down-two.d.ts +3 -3
- package/dist/components/icons/arrow-down.d.ts +3 -3
- package/dist/components/icons/arrow-up-down.d.ts +3 -3
- package/dist/components/icons/arrow-up-two.d.ts +3 -3
- package/dist/components/icons/assignments.d.ts +3 -3
- package/dist/components/icons/blank-circle.d.ts +3 -3
- package/dist/components/icons/block-filled.d.ts +3 -3
- package/dist/components/icons/calendar-add.d.ts +3 -3
- package/dist/components/icons/calendar.d.ts +3 -3
- package/dist/components/icons/checkbox-square.d.ts +3 -3
- package/dist/components/icons/circular-arrow-setting.d.ts +3 -3
- package/dist/components/icons/clock.d.ts +3 -3
- package/dist/components/icons/close.d.ts +3 -3
- package/dist/components/icons/coin-outline.d.ts +3 -3
- package/dist/components/icons/copy.d.ts +3 -3
- package/dist/components/icons/coupon.d.ts +3 -3
- package/dist/components/icons/criteria/index.esm.js.map +1 -1
- package/dist/components/icons/criteria/index.js.map +1 -1
- package/dist/components/icons/cross/index.esm.js.map +1 -1
- package/dist/components/icons/cross/index.js.map +1 -1
- package/dist/components/icons/cross-hire.d.ts +3 -3
- package/dist/components/icons/custom-styled-icon.d.ts +3 -3
- package/dist/components/icons/dashboard.d.ts +3 -3
- package/dist/components/icons/document-download.d.ts +3 -3
- package/dist/components/icons/document.d.ts +3 -3
- package/dist/components/icons/dollar-circle-filled.d.ts +3 -3
- package/dist/components/icons/dollar-circle.d.ts +3 -3
- package/dist/components/icons/edit.d.ts +3 -3
- package/dist/components/icons/email.d.ts +3 -3
- package/dist/components/icons/export.d.ts +3 -3
- package/dist/components/icons/eye-off.d.ts +3 -3
- package/dist/components/icons/eye-plus-circle.d.ts +3 -3
- package/dist/components/icons/eye.d.ts +3 -3
- package/dist/components/icons/filled-circle.d.ts +3 -3
- package/dist/components/icons/filter-remove.d.ts +3 -3
- package/dist/components/icons/filter.d.ts +3 -3
- package/dist/components/icons/folder-save.d.ts +3 -3
- package/dist/components/icons/grid.d.ts +3 -3
- package/dist/components/icons/hashtag.d.ts +3 -3
- package/dist/components/icons/image.d.ts +3 -3
- package/dist/components/icons/import.d.ts +3 -3
- package/dist/components/icons/info-circle.d.ts +3 -3
- package/dist/components/icons/info.d.ts +3 -3
- package/dist/components/icons/link-horizontal.d.ts +3 -3
- package/dist/components/icons/link.d.ts +3 -3
- package/dist/components/icons/location.d.ts +3 -3
- package/dist/components/icons/lowest-lead-time.d.ts +3 -3
- package/dist/components/icons/lowest-min-qty.d.ts +3 -3
- package/dist/components/icons/lowest-price.d.ts +3 -3
- package/dist/components/icons/more.d.ts +3 -3
- package/dist/components/icons/notification.d.ts +3 -3
- package/dist/components/icons/paper-clip.d.ts +3 -3
- package/dist/components/icons/paragraph.d.ts +3 -3
- package/dist/components/icons/payment-request.d.ts +3 -3
- package/dist/components/icons/phone.d.ts +3 -3
- package/dist/components/icons/printer.d.ts +3 -3
- package/dist/components/icons/process-calendar.d.ts +3 -3
- package/dist/components/icons/promotion.d.ts +3 -3
- package/dist/components/icons/radio-button.d.ts +3 -3
- package/dist/components/icons/receipt-filled.d.ts +3 -3
- package/dist/components/icons/receipt-outline.d.ts +3 -3
- package/dist/components/icons/receipt.d.ts +3 -3
- package/dist/components/icons/refresh-icon.d.ts +3 -3
- package/dist/components/icons/replace.d.ts +3 -3
- package/dist/components/icons/save.d.ts +3 -3
- package/dist/components/icons/search-status.d.ts +3 -3
- package/dist/components/icons/search.d.ts +3 -3
- package/dist/components/icons/settings-fallback.d.ts +3 -3
- package/dist/components/icons/share/index.esm.js.map +1 -1
- package/dist/components/icons/share/index.js.map +1 -1
- package/dist/components/icons/sort-arrow-icon.d.ts +3 -3
- package/dist/components/icons/stacked-layer.d.ts +3 -3
- package/dist/components/icons/start-filled.d.ts +3 -3
- package/dist/components/icons/three-dot-icon.d.ts +3 -3
- package/dist/components/icons/tick-circle-filled.d.ts +3 -3
- package/dist/components/icons/tick-circle.d.ts +3 -3
- package/dist/components/icons/tick-octagon.d.ts +3 -3
- package/dist/components/icons/tick.d.ts +3 -3
- package/dist/components/icons/toggle-switch.d.ts +3 -3
- package/dist/components/icons/trash.d.ts +3 -3
- package/dist/components/icons/wave.d.ts +3 -3
- package/dist/components/icons/with-out-tick-octagon.d.ts +3 -3
- package/dist/components/icons/work-centre.d.ts +3 -3
- package/dist/components/inventory-reports-title-bar/redux/actionCreator/index.esm.js +1 -1
- package/dist/components/inventory-reports-title-bar/redux/actionCreator/index.esm.js.map +1 -1
- package/dist/components/inventory-reports-title-bar/redux/actionCreator/index.js +1 -1
- package/dist/components/inventory-reports-title-bar/redux/actionCreator/index.js.map +1 -1
- package/dist/components/label-value/label-value/index.esm.js.map +1 -1
- package/dist/components/label-value/label-value/index.js.map +1 -1
- package/dist/components/listing/listing/index.esm.js.map +1 -1
- package/dist/components/listing/listing/index.js.map +1 -1
- package/dist/components/loaders/erp-loader/index.esm.js.map +1 -1
- package/dist/components/loaders/erp-loader/index.js.map +1 -1
- package/dist/components/loaders/form-loader/index.esm.js.map +1 -1
- package/dist/components/loaders/form-loader/index.js.map +1 -1
- package/dist/components/loaders/modal-loader/index.esm.js.map +1 -1
- package/dist/components/loaders/modal-loader/index.js.map +1 -1
- package/dist/components/loaders/page-loader/index.esm.js.map +1 -1
- package/dist/components/loaders/page-loader/index.js.map +1 -1
- package/dist/components/location-select.d.ts +1 -1
- package/dist/components/material-editable-table/components/inline-edit-fields/index.esm.js.map +1 -1
- package/dist/components/material-editable-table/components/inline-edit-fields/index.js.map +1 -1
- package/dist/components/material-editable-table/material-editable-table/index.esm.js.map +1 -1
- package/dist/components/material-editable-table/material-editable-table/index.js.map +1 -1
- package/dist/components/material-editable-table/material-editable-table.d.ts +1 -1
- package/dist/components/material-table/material-table.d.ts +1 -1
- package/dist/components/menu/menu/index.esm.js.map +1 -1
- package/dist/components/menu/menu/index.js.map +1 -1
- package/dist/components/modal/modal/index.esm.js.map +1 -1
- package/dist/components/modal/modal/index.js.map +1 -1
- package/dist/components/page-navigator/page-navigator/index.esm.js.map +1 -1
- package/dist/components/page-navigator/page-navigator/index.js.map +1 -1
- package/dist/components/phone-input/phone-input.d.ts +1 -1
- package/dist/components/providers/ERPUIProvider/index.esm.js.map +1 -1
- package/dist/components/providers/ERPUIProvider/index.js.map +1 -1
- package/dist/components/radio/radio.d.ts +1 -1
- package/dist/components/reports-title-bar/redux/actionCreator/index.esm.js +1 -1
- package/dist/components/reports-title-bar/redux/actionCreator/index.esm.js.map +1 -1
- package/dist/components/reports-title-bar/redux/actionCreator/index.js +1 -1
- package/dist/components/reports-title-bar/redux/actionCreator/index.js.map +1 -1
- package/dist/components/reset-password-modal/reset-password-modal/index.esm.js.map +1 -1
- package/dist/components/reset-password-modal/reset-password-modal/index.js.map +1 -1
- package/dist/components/search-bar/search-bar/index.esm.js.map +1 -1
- package/dist/components/search-bar/search-bar/index.js.map +1 -1
- package/dist/components/searchable-select/index.esm.js.map +1 -1
- package/dist/components/searchable-select/index.js.map +1 -1
- package/dist/components/select/controller/chip-or-placeholder/index.esm.js.map +1 -1
- package/dist/components/select/controller/chip-or-placeholder/index.js.map +1 -1
- package/dist/components/select/select/index.esm.js.map +1 -1
- package/dist/components/select/select/index.js.map +1 -1
- package/dist/components/select/select-search/index.esm.js.map +1 -1
- package/dist/components/select/select-search/index.js.map +1 -1
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/share-modal/redux/actionCreator/index.esm.js +1 -1
- package/dist/components/share-modal/redux/actionCreator/index.esm.js.map +1 -1
- package/dist/components/share-modal/redux/actionCreator/index.js +1 -1
- package/dist/components/share-modal/redux/actionCreator/index.js.map +1 -1
- package/dist/components/sub-header-doc/sub-header-doc/index.esm.js.map +1 -1
- package/dist/components/sub-header-doc/sub-header-doc/index.js.map +1 -1
- package/dist/components/switches/android-12-switch/index.esm.js.map +1 -1
- package/dist/components/switches/android-12-switch/index.js.map +1 -1
- package/dist/components/switches/android-12-switch.d.ts +3 -1
- package/dist/components/text-area/text-area/index.esm.js.map +1 -1
- package/dist/components/text-area/text-area/index.js.map +1 -1
- package/dist/components/text-field/text-field/index.esm.js.map +1 -1
- package/dist/components/text-field/text-field/index.js.map +1 -1
- package/dist/components/text-field/text-field.d.ts +1 -1
- package/dist/components/time-picker/time-picker/index.esm.js.map +1 -1
- package/dist/components/time-picker/time-picker/index.js.map +1 -1
- package/dist/components/time-picker/time-picker.d.ts +1 -1
- package/dist/components/toast/toast/index.esm.js.map +1 -1
- package/dist/components/toast/toast/index.js.map +1 -1
- package/dist/components/toggle/toggle/index.esm.js.map +1 -1
- package/dist/components/toggle/toggle/index.js.map +1 -1
- package/dist/components/typography/typography/index.esm.js.map +1 -1
- package/dist/components/typography/typography/index.js.map +1 -1
- package/dist/components/upload/upload/index.esm.js +2 -2
- package/dist/components/upload/upload/index.esm.js.map +1 -1
- package/dist/components/upload/upload/index.js +11 -11
- package/dist/components/upload/upload/index.js.map +1 -1
- package/dist/components/upload-media/upload-media.d.ts +1 -1
- package/dist/constants/defaultColumns/index.esm.js.map +1 -1
- package/dist/constants/defaultColumns/index.js.map +1 -1
- package/dist/constants/modules/index.esm.js.map +1 -1
- package/dist/constants/modules/index.js.map +1 -1
- package/dist/constants/pathnames/pathname/index.esm.js.map +1 -1
- package/dist/constants/pathnames/pathname/index.js.map +1 -1
- package/dist/constants/pathnames/pathname.accounting/index.esm.js.map +1 -1
- package/dist/constants/pathnames/pathname.accounting/index.js.map +1 -1
- package/dist/constants/pathnames/pathname.crm/index.esm.js.map +1 -1
- package/dist/constants/pathnames/pathname.crm/index.js.map +1 -1
- package/dist/constants/pathnames/pathname.document/index.esm.js.map +1 -1
- package/dist/constants/pathnames/pathname.document/index.js.map +1 -1
- package/dist/constants/pathnames/pathname.hrms/index.esm.js.map +1 -1
- package/dist/constants/pathnames/pathname.hrms/index.js.map +1 -1
- package/dist/constants/pathnames/pathname.inventory/index.esm.js.map +1 -1
- package/dist/constants/pathnames/pathname.inventory/index.js.map +1 -1
- package/dist/constants/pathnames/pathname.manufacturing/index.esm.js.map +1 -1
- package/dist/constants/pathnames/pathname.manufacturing/index.js.map +1 -1
- package/dist/constants/pathnames/pathname.office/index.esm.js.map +1 -1
- package/dist/constants/pathnames/pathname.office/index.js.map +1 -1
- package/dist/constants/pathnames/pathname.procurement/index.esm.js.map +1 -1
- package/dist/constants/pathnames/pathname.procurement/index.js.map +1 -1
- package/dist/constants/pathnames/pathname.project/index.esm.js.map +1 -1
- package/dist/constants/pathnames/pathname.project/index.js.map +1 -1
- package/dist/constants/pathnames/pathname.quotes/index.esm.js.map +1 -1
- package/dist/constants/pathnames/pathname.quotes/index.js.map +1 -1
- package/dist/constants/pathnames/pathname.rental/index.esm.js.map +1 -1
- package/dist/constants/pathnames/pathname.rental/index.js.map +1 -1
- package/dist/constants/pathnames/pathname.user/index.esm.js.map +1 -1
- package/dist/constants/pathnames/pathname.user/index.js.map +1 -1
- package/dist/constants/route-page-map/index.esm.js.map +1 -1
- package/dist/constants/route-page-map/index.js.map +1 -1
- package/dist/constants/status/index.esm.js.map +1 -1
- package/dist/constants/status/index.js.map +1 -1
- package/dist/contexts/AuthContext/index.esm.js +1 -1
- package/dist/contexts/AuthContext/index.esm.js.map +1 -1
- package/dist/contexts/AuthContext/index.js +1 -1
- package/dist/contexts/AuthContext/index.js.map +1 -1
- package/dist/contexts/languageContext/index.esm.js +1 -1
- package/dist/contexts/languageContext/index.esm.js.map +1 -1
- package/dist/contexts/languageContext/index.js +1 -1
- package/dist/contexts/languageContext/index.js.map +1 -1
- package/dist/contexts/page-context/index.esm.js.map +1 -1
- package/dist/contexts/page-context/index.js.map +1 -1
- package/dist/hooks/use-translations/index.esm.js.map +1 -1
- package/dist/hooks/use-translations/index.js.map +1 -1
- package/dist/hooks/useApi/index.esm.js.map +1 -1
- package/dist/hooks/useApi/index.js.map +1 -1
- package/dist/hooks/useDataFetcher/index.esm.js.map +1 -1
- package/dist/hooks/useDataFetcher/index.js.map +1 -1
- package/dist/layout/fullScreen/fullScreen/index.esm.js.map +1 -1
- package/dist/layout/fullScreen/fullScreen/index.js.map +1 -1
- package/dist/layout/sidebarScreen/sidebarScreen/index.esm.js.map +1 -1
- package/dist/layout/sidebarScreen/sidebarScreen/index.js.map +1 -1
- package/dist/node_modules/@glideapps/glide-data-grid-cells/dist/js/article-cell-editor-JDI676YI/index.esm.js +1 -1
- package/dist/node_modules/@glideapps/glide-data-grid-cells/dist/js/article-cell-editor-JDI676YI/index.js +2 -2
- package/dist/node_modules/@glideapps/glide-data-grid-cells/dist/js/article-cell-editor-JDI676YI/index.js.map +1 -1
- package/dist/node_modules/@mui/system/colorManipulator/index.esm.js +2 -2
- package/dist/node_modules/@mui/system/colorManipulator/index.js +1 -1
- package/dist/node_modules/@mui/system/colorManipulator/index.js.map +1 -1
- package/dist/node_modules/@mui/system/createStyled/index.esm.js +6 -6
- package/dist/node_modules/@mui/system/createStyled/index.js +1 -1
- package/dist/node_modules/@mui/system/createStyled/index.js.map +1 -1
- package/dist/node_modules/@mui/system/useThemeWithoutDefault/index.esm.js +1 -1
- package/dist/node_modules/@mui/system/useThemeWithoutDefault/index.js +1 -1
- package/dist/node_modules/{material-react-table/node_modules/@tanstack → @tanstack}/react-virtual/dist/esm/index/index.esm.js +2 -2
- package/dist/node_modules/@tanstack/react-virtual/dist/esm/index/index.esm.js.map +1 -0
- package/dist/node_modules/@tanstack/react-virtual/dist/esm/index/index.js +2 -0
- package/dist/node_modules/@tanstack/react-virtual/dist/esm/index/index.js.map +1 -0
- package/dist/node_modules/{@glideapps/glide-data-grid-cells/node_modules/@toast-ui → @toast-ui}/react-editor/dist/esm/index/index.esm.js +2 -2
- package/dist/node_modules/@toast-ui/react-editor/dist/esm/index/index.esm.js.map +1 -0
- package/dist/node_modules/@toast-ui/react-editor/dist/esm/index/index.js +2 -0
- package/dist/node_modules/@toast-ui/react-editor/dist/esm/index/index.js.map +1 -0
- package/dist/node_modules/material-react-table/dist/index.esm/index.esm.js +1 -1
- package/dist/node_modules/material-react-table/dist/index.esm/index.js +1 -1
- package/dist/node_modules/material-react-table/dist/index.esm/index.js.map +1 -1
- package/dist/redux/actionCreator/index.esm.js.map +1 -1
- package/dist/redux/actionCreator/index.js.map +1 -1
- package/dist/redux/module-reducer/index.esm.js.map +1 -1
- package/dist/redux/module-reducer/index.js.map +1 -1
- package/dist/redux/store/index.esm.js.map +1 -1
- package/dist/redux/store/index.js.map +1 -1
- package/dist/server/index.esm.js.map +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/src/components/accordion/accordion.d.ts +1 -1
- package/dist/src/components/action-bar/action-bar.d.ts +1 -1
- package/dist/src/components/checkbox/checkbox.d.ts +1 -1
- package/dist/src/components/date-picker/date-picker.d.ts +1 -1
- package/dist/src/components/footer/footer.d.ts +1 -1
- package/dist/src/components/form-control/form-builder/form-builder-element/media.d.ts +1 -1
- package/dist/src/components/form-control/form-builder/form-builder-element/phone.d.ts +1 -1
- package/dist/src/components/form-control/form-builder/form-builder-element/select.d.ts +1 -1
- package/dist/src/components/form-control/form-builder/form-builder-element/text.d.ts +1 -1
- package/dist/src/components/form-control/form-builder/form-builder-element/time.d.ts +1 -1
- package/dist/src/components/form-control/form-parser/form-switcher.d.ts +1 -1
- package/dist/src/components/icons/action-arrow.d.ts +3 -3
- package/dist/src/components/icons/add-circle.d.ts +3 -3
- package/dist/src/components/icons/arrow-bidirectional.d.ts +3 -3
- package/dist/src/components/icons/arrow-circle-down.d.ts +3 -3
- package/dist/src/components/icons/arrow-down-three.d.ts +3 -3
- package/dist/src/components/icons/arrow-down-two.d.ts +3 -3
- package/dist/src/components/icons/arrow-down.d.ts +3 -3
- package/dist/src/components/icons/arrow-up-down.d.ts +3 -3
- package/dist/src/components/icons/arrow-up-two.d.ts +3 -3
- package/dist/src/components/icons/assignments.d.ts +3 -3
- package/dist/src/components/icons/blank-circle.d.ts +3 -3
- package/dist/src/components/icons/block-filled.d.ts +3 -3
- package/dist/src/components/icons/calendar-add.d.ts +3 -3
- package/dist/src/components/icons/calendar.d.ts +3 -3
- package/dist/src/components/icons/checkbox-square.d.ts +3 -3
- package/dist/src/components/icons/circular-arrow-setting.d.ts +3 -3
- package/dist/src/components/icons/clock.d.ts +3 -3
- package/dist/src/components/icons/close.d.ts +3 -3
- package/dist/src/components/icons/coin-outline.d.ts +3 -3
- package/dist/src/components/icons/copy.d.ts +3 -3
- package/dist/src/components/icons/coupon.d.ts +3 -3
- package/dist/src/components/icons/cross-hire.d.ts +3 -3
- package/dist/src/components/icons/custom-styled-icon.d.ts +3 -3
- package/dist/src/components/icons/dashboard.d.ts +3 -3
- package/dist/src/components/icons/document-download.d.ts +3 -3
- package/dist/src/components/icons/document.d.ts +3 -3
- package/dist/src/components/icons/dollar-circle-filled.d.ts +3 -3
- package/dist/src/components/icons/dollar-circle.d.ts +3 -3
- package/dist/src/components/icons/edit.d.ts +3 -3
- package/dist/src/components/icons/email.d.ts +3 -3
- package/dist/src/components/icons/export.d.ts +3 -3
- package/dist/src/components/icons/eye-off.d.ts +3 -3
- package/dist/src/components/icons/eye-plus-circle.d.ts +3 -3
- package/dist/src/components/icons/eye.d.ts +3 -3
- package/dist/src/components/icons/filled-circle.d.ts +3 -3
- package/dist/src/components/icons/filter-remove.d.ts +3 -3
- package/dist/src/components/icons/filter.d.ts +3 -3
- package/dist/src/components/icons/folder-save.d.ts +3 -3
- package/dist/src/components/icons/grid.d.ts +3 -3
- package/dist/src/components/icons/hashtag.d.ts +3 -3
- package/dist/src/components/icons/image.d.ts +3 -3
- package/dist/src/components/icons/import.d.ts +3 -3
- package/dist/src/components/icons/info-circle.d.ts +3 -3
- package/dist/src/components/icons/info.d.ts +3 -3
- package/dist/src/components/icons/link-horizontal.d.ts +3 -3
- package/dist/src/components/icons/link.d.ts +3 -3
- package/dist/src/components/icons/location.d.ts +3 -3
- package/dist/src/components/icons/lowest-lead-time.d.ts +3 -3
- package/dist/src/components/icons/lowest-min-qty.d.ts +3 -3
- package/dist/src/components/icons/lowest-price.d.ts +3 -3
- package/dist/src/components/icons/more.d.ts +3 -3
- package/dist/src/components/icons/notification.d.ts +3 -3
- package/dist/src/components/icons/paper-clip.d.ts +3 -3
- package/dist/src/components/icons/paragraph.d.ts +3 -3
- package/dist/src/components/icons/payment-request.d.ts +3 -3
- package/dist/src/components/icons/phone.d.ts +3 -3
- package/dist/src/components/icons/printer.d.ts +3 -3
- package/dist/src/components/icons/process-calendar.d.ts +3 -3
- package/dist/src/components/icons/promotion.d.ts +3 -3
- package/dist/src/components/icons/radio-button.d.ts +3 -3
- package/dist/src/components/icons/receipt-filled.d.ts +3 -3
- package/dist/src/components/icons/receipt-outline.d.ts +3 -3
- package/dist/src/components/icons/receipt.d.ts +3 -3
- package/dist/src/components/icons/refresh-icon.d.ts +3 -3
- package/dist/src/components/icons/replace.d.ts +3 -3
- package/dist/src/components/icons/save.d.ts +3 -3
- package/dist/src/components/icons/search-status.d.ts +3 -3
- package/dist/src/components/icons/search.d.ts +3 -3
- package/dist/src/components/icons/settings-fallback.d.ts +3 -3
- package/dist/src/components/icons/sort-arrow-icon.d.ts +3 -3
- package/dist/src/components/icons/stacked-layer.d.ts +3 -3
- package/dist/src/components/icons/start-filled.d.ts +3 -3
- package/dist/src/components/icons/three-dot-icon.d.ts +3 -3
- package/dist/src/components/icons/tick-circle-filled.d.ts +3 -3
- package/dist/src/components/icons/tick-circle.d.ts +3 -3
- package/dist/src/components/icons/tick-octagon.d.ts +3 -3
- package/dist/src/components/icons/tick.d.ts +3 -3
- package/dist/src/components/icons/toggle-switch.d.ts +3 -3
- package/dist/src/components/icons/trash.d.ts +3 -3
- package/dist/src/components/icons/wave.d.ts +3 -3
- package/dist/src/components/icons/with-out-tick-octagon.d.ts +3 -3
- package/dist/src/components/icons/work-centre.d.ts +3 -3
- package/dist/src/components/location-select.d.ts +1 -1
- package/dist/src/components/material-editable-table/material-editable-table.d.ts +1 -1
- package/dist/src/components/material-table/material-table.d.ts +1 -1
- package/dist/src/components/phone-input/phone-input.d.ts +1 -1
- package/dist/src/components/radio/radio.d.ts +1 -1
- package/dist/src/components/select/select.d.ts +1 -1
- package/dist/src/components/switches/android-12-switch.d.ts +3 -1
- package/dist/src/components/text-field/text-field.d.ts +1 -1
- package/dist/src/components/time-picker/time-picker.d.ts +1 -1
- package/dist/src/components/upload-media/upload-media.d.ts +1 -1
- package/dist/src/utils/common-utility.d.ts +1 -1
- package/dist/style.css +69 -69
- package/dist/styles/index.d.ts +1 -1
- package/dist/theme/theme-impl/index.esm.js.map +1 -1
- package/dist/theme/theme-impl/index.js.map +1 -1
- package/dist/utils/api/index.esm.js +6 -6
- package/dist/utils/api/index.esm.js.map +1 -1
- package/dist/utils/api/index.js +1 -1
- package/dist/utils/api/index.js.map +1 -1
- package/dist/utils/common/index.esm.js +6 -6
- package/dist/utils/common/index.esm.js.map +1 -1
- package/dist/utils/common/index.js +1 -1
- package/dist/utils/common/index.js.map +1 -1
- package/dist/utils/common-utility.d.ts +1 -1
- package/dist/utils/date-range/index.esm.js.map +1 -1
- package/dist/utils/date-range/index.js.map +1 -1
- package/dist/utils/i18n/index.esm.js.map +1 -1
- package/dist/utils/i18n/index.js.map +1 -1
- package/dist/utils/menu-filter/index.esm.js.map +1 -1
- package/dist/utils/menu-filter/index.js.map +1 -1
- package/dist/views/404/index.esm.js.map +1 -1
- package/dist/views/404/index.js.map +1 -1
- package/dist/views/afterAuth/dashboard/dashboard/index.esm.js.map +1 -1
- package/dist/views/afterAuth/dashboard/dashboard/index.js.map +1 -1
- package/dist/views/afterAuth/dashboard/redux/actionCreator/index.esm.js.map +1 -1
- package/dist/views/afterAuth/dashboard/redux/actionCreator/index.js.map +1 -1
- package/dist/views/afterAuth/dashboard/redux/reducer/index.esm.js.map +1 -1
- package/dist/views/afterAuth/dashboard/redux/reducer/index.js.map +1 -1
- package/dist/views/afterAuth/dashboard/redux/state/index.esm.js.map +1 -1
- package/dist/views/afterAuth/dashboard/redux/state/index.js.map +1 -1
- package/dist/views/afterAuth/page-view/page-view/index.esm.js.map +1 -1
- package/dist/views/afterAuth/page-view/page-view/index.js.map +1 -1
- package/dist/views/afterAuth/page-view/redux/actionCreator/index.esm.js.map +1 -1
- package/dist/views/afterAuth/page-view/redux/actionCreator/index.js.map +1 -1
- package/dist/views/afterAuth/page-view/redux/reducer/index.esm.js.map +1 -1
- package/dist/views/afterAuth/page-view/redux/reducer/index.js.map +1 -1
- package/dist/views/afterAuth/page-view/redux/state/index.esm.js.map +1 -1
- package/dist/views/afterAuth/page-view/redux/state/index.js.map +1 -1
- package/dist/views/afterAuth/page-view/utils/default-data/index.esm.js.map +1 -1
- package/dist/views/afterAuth/page-view/utils/default-data/index.js.map +1 -1
- package/dist/views/afterAuth/page-view/utils/local-data/index.esm.js.map +1 -1
- package/dist/views/afterAuth/page-view/utils/local-data/index.js.map +1 -1
- package/dist/views/beforeAuth/change-password/change-password/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/change-password/change-password/index.js.map +1 -1
- package/dist/views/beforeAuth/components/activity-tag-data/activity-tag-data/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/components/activity-tag-data/activity-tag-data/index.js.map +1 -1
- package/dist/views/beforeAuth/components/calendar-data/calendar-data/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/components/calendar-data/calendar-data/index.js.map +1 -1
- package/dist/views/beforeAuth/components/gantt-data/gantt-data/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/components/gantt-data/gantt-data/index.js.map +1 -1
- package/dist/views/beforeAuth/components/grid-data/grid-data/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/components/grid-data/grid-data/index.js.map +1 -1
- package/dist/views/beforeAuth/components/kanbann-content/kanbann-raw/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/components/kanbann-content/kanbann-raw/index.js.map +1 -1
- package/dist/views/beforeAuth/components/list-content/column-raw/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/components/list-content/column-raw/index.js.map +1 -1
- package/dist/views/beforeAuth/components/list-content/list-data/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/components/list-content/list-data/index.js.map +1 -1
- package/dist/views/beforeAuth/components/multiline-data/multiline-data/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/components/multiline-data/multiline-data/index.js.map +1 -1
- package/dist/views/beforeAuth/components/share-modal-data/share-modal-data/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/components/share-modal-data/share-modal-data/index.js.map +1 -1
- package/dist/views/beforeAuth/components/shared-pages-data/shared-pages-data/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/components/shared-pages-data/shared-pages-data/index.js.map +1 -1
- package/dist/views/beforeAuth/components/tabs-data/tabs-data/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/components/tabs-data/tabs-data/index.js.map +1 -1
- package/dist/views/beforeAuth/components/user-dashboard-data/user-dashboard-data/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/components/user-dashboard-data/user-dashboard-data/index.js.map +1 -1
- package/dist/views/beforeAuth/components/user-dropdown-data/user-dropdown-data/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/components/user-dropdown-data/user-dropdown-data/index.js.map +1 -1
- package/dist/views/beforeAuth/forgot-password/forgot-password/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/forgot-password/forgot-password/index.js.map +1 -1
- package/dist/views/beforeAuth/landing/landing/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/landing/landing/index.js.map +1 -1
- package/dist/views/beforeAuth/reset-password/reset-password/index.esm.js.map +1 -1
- package/dist/views/beforeAuth/reset-password/reset-password/index.js.map +1 -1
- package/dist/views/form-builder/custom-form/index.esm.js.map +1 -1
- package/dist/views/form-builder/custom-form/index.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/checkbox/index.esm.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/checkbox/index.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/column-width/index.esm.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/column-width/index.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/field-select/index.esm.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/field-select/index.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/section/index.esm.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/section/index.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/select/index.esm.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/select/index.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/table-form/index.esm.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/table-form/index.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/text/index.esm.js.map +1 -1
- package/dist/views/form-builder/element-edit-forms/text/index.js.map +1 -1
- package/dist/views/form-builder/field_properties/index.esm.js.map +1 -1
- package/dist/views/form-builder/field_properties/index.js.map +1 -1
- package/dist/views/form-builder/form-fields/index.esm.js.map +1 -1
- package/dist/views/form-builder/form-fields/index.js.map +1 -1
- package/dist/views/form-builder/redux/actionCreator/index.esm.js +1 -1
- package/dist/views/form-builder/redux/actionCreator/index.esm.js.map +1 -1
- package/dist/views/form-builder/redux/actionCreator/index.js +1 -1
- package/dist/views/form-builder/redux/actionCreator/index.js.map +1 -1
- package/dist/views/form-builder/redux/reducer/index.esm.js.map +1 -1
- package/dist/views/form-builder/redux/reducer/index.js.map +1 -1
- package/dist/views/form-builder/redux/state/index.esm.js.map +1 -1
- package/dist/views/form-builder/redux/state/index.js.map +1 -1
- package/dist/views/form-builder/utils/common/index.esm.js.map +1 -1
- package/dist/views/form-builder/utils/common/index.js.map +1 -1
- package/dist/views/index.d.ts +8 -8
- package/dist/views/privateRoute/index.esm.js.map +1 -1
- package/dist/views/privateRoute/index.js.map +1 -1
- package/dist/views/template-editor/add-template/add-template/index.esm.js.map +1 -1
- package/dist/views/template-editor/add-template/add-template/index.js.map +1 -1
- package/dist/views/template-editor/company-selection-modal/company-selection-modal/index.esm.js.map +1 -1
- package/dist/views/template-editor/company-selection-modal/company-selection-modal/index.js.map +1 -1
- package/dist/views/template-editor/components/EditorCanvas/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/EditorCanvas/index.js.map +1 -1
- package/dist/views/template-editor/components/EditorHeader/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/EditorHeader/index.js.map +1 -1
- package/dist/views/template-editor/components/EditorSection/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/EditorSection/index.js.map +1 -1
- package/dist/views/template-editor/components/EditorSidebar/index.esm.js +1 -1
- package/dist/views/template-editor/components/EditorSidebar/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/EditorSidebar/index.js +1 -1
- package/dist/views/template-editor/components/EditorSidebar/index.js.map +1 -1
- package/dist/views/template-editor/components/SectionFlowEditor/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/SectionFlowEditor/index.js.map +1 -1
- package/dist/views/template-editor/components/SectionFormatPanel/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/SectionFormatPanel/index.js.map +1 -1
- package/dist/views/template-editor/components/controllers/AlignmentControl/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/controllers/AlignmentControl/index.js.map +1 -1
- package/dist/views/template-editor/components/controllers/ButtonControls/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/controllers/ButtonControls/index.js.map +1 -1
- package/dist/views/template-editor/components/controllers/CodeControls/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/controllers/CodeControls/index.js.map +1 -1
- package/dist/views/template-editor/components/controllers/DividerControls/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/controllers/DividerControls/index.js.map +1 -1
- package/dist/views/template-editor/components/controllers/ImageControls/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/controllers/ImageControls/index.js.map +1 -1
- package/dist/views/template-editor/components/controllers/SignatureControls/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/controllers/SignatureControls/index.js.map +1 -1
- package/dist/views/template-editor/components/controllers/TableControls/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/controllers/TableControls/index.js.map +1 -1
- package/dist/views/template-editor/components/controllers/TextControls/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/controllers/TextControls/index.js.map +1 -1
- package/dist/views/template-editor/components/controllers/border-control/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/controllers/border-control/index.js.map +1 -1
- package/dist/views/template-editor/edit-section-modal/edit-section-modal/index.esm.js.map +1 -1
- package/dist/views/template-editor/edit-section-modal/edit-section-modal/index.js.map +1 -1
- package/dist/views/template-editor/routes/index.esm.js.map +1 -1
- package/dist/views/template-editor/routes/index.js.map +1 -1
- package/dist/views/template-editor/template-modal/html-thumbnail-preview/index.esm.js.map +1 -1
- package/dist/views/template-editor/template-modal/html-thumbnail-preview/index.js.map +1 -1
- package/dist/views/template-editor/template-modal/template-modal/index.esm.js.map +1 -1
- package/dist/views/template-editor/template-modal/template-modal/index.js.map +1 -1
- package/dist/views/template-editor/template-name-modal/template-name-modal/index.esm.js.map +1 -1
- package/dist/views/template-editor/template-name-modal/template-name-modal/index.js.map +1 -1
- package/dist/views/template-editor/templates/index.esm.js +1 -1
- package/dist/views/template-editor/templates/index.esm.js.map +1 -1
- package/dist/views/template-editor/templates/index.js +1 -1
- package/dist/views/template-editor/templates/index.js.map +1 -1
- package/dist/views/template-editor/utils/common/index.esm.js.map +1 -1
- package/dist/views/template-editor/utils/common/index.js.map +1 -1
- package/dist/views/template-editor/utils/constant/index.esm.js.map +1 -1
- package/dist/views/template-editor/utils/constant/index.js.map +1 -1
- package/dist/views/template-editor/utils/default-data/index.esm.js.map +1 -1
- package/dist/views/template-editor/utils/default-data/index.js.map +1 -1
- package/dist/views/template-editor/utils/style-extractor/index.esm.js.map +1 -1
- package/dist/views/template-editor/utils/style-extractor/index.js.map +1 -1
- package/dist/vite-env.d.ts +23 -23
- package/package.json +299 -299
- package/src/styles/README.md +287 -287
- package/src/styles/all.scss +7 -7
- package/src/styles/animations.scss +5 -5
- package/src/styles/css/reset.css +1 -1
- package/src/styles/index.d.ts +1 -1
- package/src/styles/index.ts +1 -1
- package/src/styles/mixins.scss +5 -5
- package/src/styles/sass/main.scss +11 -11
- package/src/styles/utils.scss +5 -5
- package/src/styles/variables.scss +4 -4
- package/dist/node_modules/@glideapps/glide-data-grid-cells/node_modules/@toast-ui/react-editor/dist/esm/index/index.esm.js.map +0 -1
- package/dist/node_modules/@glideapps/glide-data-grid-cells/node_modules/@toast-ui/react-editor/dist/esm/index/index.js +0 -2
- package/dist/node_modules/@glideapps/glide-data-grid-cells/node_modules/@toast-ui/react-editor/dist/esm/index/index.js.map +0 -1
- package/dist/node_modules/material-react-table/node_modules/@tanstack/react-virtual/dist/esm/index/index.esm.js.map +0 -1
- package/dist/node_modules/material-react-table/node_modules/@tanstack/react-virtual/dist/esm/index/index.js +0 -2
- package/dist/node_modules/material-react-table/node_modules/@tanstack/react-virtual/dist/esm/index/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,979 +1,979 @@
|
|
|
1
|
-
# @erpsquad/common
|
|
2
|
-
|
|
3
|
-
A comprehensive React component library for ERP applications, built with Material-UI and TypeScript. This library provides 100+ reusable UI components, theming system, utilities, hooks, and optional Redux integration for building modern ERP applications.
|
|
4
|
-
|
|
5
|
-
## 🚀 Features
|
|
6
|
-
|
|
7
|
-
- **100+ UI Components**: Comprehensive set of form controls, data display, navigation, and layout components
|
|
8
|
-
- **Material-UI Integration**: Built on top of Material-UI with custom theming
|
|
9
|
-
- **TypeScript Support**: Full TypeScript definitions for all components and utilities
|
|
10
|
-
- **Flexible Redux Integration**: Optional Redux support - components work with or without Redux
|
|
11
|
-
- **Theme System**: Light/dark themes with RTL/LTR support and customizable colors
|
|
12
|
-
- **Internationalization**: Built-in i18n support with language switching
|
|
13
|
-
- **Tree Shaking**: Optimized for bundle size with proper tree shaking support
|
|
14
|
-
- **Accessibility**: WCAG compliant components with proper ARIA attributes
|
|
15
|
-
- **Modular Architecture**: Import only what you need to minimize bundle size
|
|
16
|
-
- **Peer Dependency Management**: Flexible dependency management for different project setups
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
### Development Environment
|
|
20
|
-
For local development, you can create a `.env` file in your project root with these variables. Make sure to add `.env` to your `.gitignore` file to keep sensitive information secure.
|
|
21
|
-
|
|
22
|
-
### Production Deployment
|
|
23
|
-
For production deployments, set these environment variables in your hosting environment's configuration panel.
|
|
24
|
-
|
|
25
|
-
## 📦 Installation
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
npm install @erpsquad/common
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Peer Dependencies
|
|
32
|
-
|
|
33
|
-
The library uses peer dependencies to avoid version conflicts and reduce bundle size. Install the dependencies you need based on your usage:
|
|
34
|
-
|
|
35
|
-
#### Required (Core functionality)
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
npm install react react-dom @mui/material @emotion/react @emotion/styled @mui/icons-material
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
#### Optional (Feature-specific)
|
|
42
|
-
|
|
43
|
-
For Redux integration:
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
npm install @reduxjs/toolkit react-redux
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
For date components:
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
npm install @mui/x-date-pickers date-fns
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
For data grid components:
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
npm install @mui/x-data-grid
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
For routing utilities:
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
npm install react-router-dom
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
For internationalization:
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
npm install react-i18next i18next
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
For utility functions:
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
npm install lodash axios
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
#### Complete Installation (All features)
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
# Install all peer dependencies for full functionality
|
|
83
|
-
npm install react react-dom @mui/material @emotion/react @emotion/styled @mui/icons-material @reduxjs/toolkit react-redux @mui/x-date-pickers @mui/x-data-grid date-fns react-router-dom react-i18next i18next lodash axios
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
## 🎯 Quick Start
|
|
87
|
-
|
|
88
|
-
### ⚠️ IMPORTANT: Import Styles
|
|
89
|
-
|
|
90
|
-
**Before using any components, you MUST import the CSS file in your main application file:**
|
|
91
|
-
|
|
92
|
-
```tsx
|
|
93
|
-
// main.tsx or App.tsx or index.tsx
|
|
94
|
-
import '@erpsquad/common/style.css'; // 👈 REQUIRED - Import this first!
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
Without this import, components will render but have **no styling**.
|
|
98
|
-
|
|
99
|
-
---
|
|
100
|
-
|
|
101
|
-
### Core Usage (Minimal dependencies)
|
|
102
|
-
|
|
103
|
-
The library provides core functionality without requiring all peer dependencies:
|
|
104
|
-
|
|
105
|
-
```tsx
|
|
106
|
-
import React from 'react';
|
|
107
|
-
// ⚠️ IMPORTANT: Import styles first (in your main file)
|
|
108
|
-
import '@erpsquad/common/style.css';
|
|
109
|
-
|
|
110
|
-
import {
|
|
111
|
-
configureLibrary,
|
|
112
|
-
getLibraryConfig,
|
|
113
|
-
images,
|
|
114
|
-
DEFAULT_LANG,
|
|
115
|
-
type LibraryConfig
|
|
116
|
-
} from '@erpsquad/common';
|
|
117
|
-
|
|
118
|
-
// Configure library for your application
|
|
119
|
-
const config: LibraryConfig = {
|
|
120
|
-
routes: {
|
|
121
|
-
login: '/auth/login',
|
|
122
|
-
dashboard: '/dashboard'
|
|
123
|
-
},
|
|
124
|
-
validation: {
|
|
125
|
-
emailRequired: true,
|
|
126
|
-
phoneRequired: false
|
|
127
|
-
},
|
|
128
|
-
dataTransforms: {
|
|
129
|
-
dateFormat: 'dd/MM/yyyy'
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
configureLibrary(config);
|
|
134
|
-
|
|
135
|
-
function App() {
|
|
136
|
-
const currentConfig = getLibraryConfig();
|
|
137
|
-
|
|
138
|
-
return (
|
|
139
|
-
<div>
|
|
140
|
-
<img src={images.logo} alt='Logo' />
|
|
141
|
-
<p>Default language: {DEFAULT_LANG}</p>
|
|
142
|
-
<p>Login route: {currentConfig.routes?.login}</p>
|
|
143
|
-
</div>
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
export default App;
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
### Available Core Exports
|
|
151
|
-
|
|
152
|
-
The following exports are available without peer dependencies:
|
|
153
|
-
|
|
154
|
-
```tsx
|
|
155
|
-
// Configuration system
|
|
156
|
-
import {
|
|
157
|
-
configureLibrary,
|
|
158
|
-
getLibraryConfig,
|
|
159
|
-
getConfigFunction,
|
|
160
|
-
type LibraryConfig
|
|
161
|
-
} from '@erpsquad/common';
|
|
162
|
-
|
|
163
|
-
// Static assets
|
|
164
|
-
import { default as images } from '@erpsquad/common';
|
|
165
|
-
|
|
166
|
-
// Constants
|
|
167
|
-
import { DEFAULT_LANG, LANGUAGES, S3_BUCKET_URL } from '@erpsquad/common';
|
|
168
|
-
|
|
169
|
-
// TypeScript types
|
|
170
|
-
import type {
|
|
171
|
-
BaseComponentProps,
|
|
172
|
-
ThemeConfig,
|
|
173
|
-
SelectOption,
|
|
174
|
-
TableColumn,
|
|
175
|
-
User,
|
|
176
|
-
Permission
|
|
177
|
-
} from '@erpsquad/common';
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
### Full Usage (With peer dependencies)
|
|
181
|
-
|
|
182
|
-
After installing peer dependencies, you can use all components:
|
|
183
|
-
|
|
184
|
-
```tsx
|
|
185
|
-
import React from 'react';
|
|
186
|
-
// ⚠️ Import styles first!
|
|
187
|
-
import '@erpsquad/common/style.css';
|
|
188
|
-
|
|
189
|
-
// Note: Import from specific paths to avoid dependency issues
|
|
190
|
-
import { ERPUIProvider } from '@erpsquad/common/contexts';
|
|
191
|
-
import { Button, TextField } from '@erpsquad/common/components';
|
|
192
|
-
|
|
193
|
-
function App() {
|
|
194
|
-
return (
|
|
195
|
-
<ERPUIProvider>
|
|
196
|
-
<div>
|
|
197
|
-
<TextField label='Name' variant='outlined' />
|
|
198
|
-
<Button variant='contained' color='primary'>
|
|
199
|
-
Submit
|
|
200
|
-
</Button>
|
|
201
|
-
</div>
|
|
202
|
-
</ERPUIProvider>
|
|
203
|
-
);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
export default App;
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
### With Custom Theme
|
|
210
|
-
|
|
211
|
-
```tsx
|
|
212
|
-
import React from 'react';
|
|
213
|
-
// ⚠️ Import styles first!
|
|
214
|
-
import '@erpsquad/common/style.css';
|
|
215
|
-
|
|
216
|
-
import { ERPUIProvider } from '@erpsquad/common/contexts';
|
|
217
|
-
import { Button } from '@erpsquad/common/components';
|
|
218
|
-
import { createLightTheme } from '@erpsquad/common/theme';
|
|
219
|
-
|
|
220
|
-
function App() {
|
|
221
|
-
const { theme } = createLightTheme('#2196f3', 'ltr');
|
|
222
|
-
|
|
223
|
-
return (
|
|
224
|
-
<ERPUIProvider
|
|
225
|
-
theme={theme}
|
|
226
|
-
themeMode='dark'
|
|
227
|
-
primaryColor='#2196f3'
|
|
228
|
-
enableCssBaseline={true}>
|
|
229
|
-
<Button variant='contained'>Dark Theme Button</Button>
|
|
230
|
-
</ERPUIProvider>
|
|
231
|
-
);
|
|
232
|
-
}
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
## 🎨 Theme System
|
|
236
|
-
|
|
237
|
-
The library includes a comprehensive theming system with support for light/dark modes, RTL/LTR direction, and custom colors.
|
|
238
|
-
|
|
239
|
-
### Theme Configuration
|
|
240
|
-
|
|
241
|
-
```tsx
|
|
242
|
-
import { ERPUIProvider } from '@erpsquad/common/contexts';
|
|
243
|
-
|
|
244
|
-
<ERPUIProvider
|
|
245
|
-
themeMode='light' // 'light' | 'dark'
|
|
246
|
-
primaryColor='#1976d2' // Any valid color
|
|
247
|
-
direction='ltr' // 'ltr' | 'rtl'
|
|
248
|
-
enableCssBaseline={true}>
|
|
249
|
-
<App />
|
|
250
|
-
</ERPUIProvider>;
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
### Custom Theme Object
|
|
254
|
-
|
|
255
|
-
```tsx
|
|
256
|
-
import { createLightTheme, createDarkTheme } from '@erpsquad/common/theme';
|
|
257
|
-
import { ERPUIProvider } from '@erpsquad/common/contexts';
|
|
258
|
-
|
|
259
|
-
// Create custom theme
|
|
260
|
-
const { theme } = createLightTheme('#1976d2', 'ltr');
|
|
261
|
-
|
|
262
|
-
// Or create dark theme
|
|
263
|
-
const { darkTheme } = createDarkTheme('#1976d2', 'ltr');
|
|
264
|
-
|
|
265
|
-
<ERPUIProvider theme={theme}>
|
|
266
|
-
<App />
|
|
267
|
-
</ERPUIProvider>;
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
### Available Colors
|
|
271
|
-
|
|
272
|
-
The library supports various color formats:
|
|
273
|
-
|
|
274
|
-
- Hex colors: `#1976d2`
|
|
275
|
-
- RGB: `rgb(25, 118, 210)`
|
|
276
|
-
- Color names: `blue`, `red`, `green`
|
|
277
|
-
- Material-UI color objects
|
|
278
|
-
|
|
279
|
-
## 🎨 Styles & SCSS
|
|
280
|
-
|
|
281
|
-
The library provides a comprehensive styling system with compiled CSS, SCSS variables, mixins, utility classes, and animations.
|
|
282
|
-
|
|
283
|
-
### Import Compiled CSS (Recommended)
|
|
284
|
-
|
|
285
|
-
Add this to your main application file:
|
|
286
|
-
|
|
287
|
-
```tsx
|
|
288
|
-
// main.tsx or App.tsx
|
|
289
|
-
import '@erpsquad/common/style.css';
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
This gives you:
|
|
293
|
-
- All component styles
|
|
294
|
-
- Utility classes for rapid development
|
|
295
|
-
- Responsive styles
|
|
296
|
-
- Animations
|
|
297
|
-
|
|
298
|
-
### Using Utility Classes
|
|
299
|
-
|
|
300
|
-
```tsx
|
|
301
|
-
<div className="d-flex justify-content-center align-items-center mb-2">
|
|
302
|
-
<h1 className="h2 bold">Welcome</h1>
|
|
303
|
-
<p className="s2 normal text-center">Description text</p>
|
|
304
|
-
</div>
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
Available utility classes:
|
|
308
|
-
- **Layout**: `d-flex`, `flex-direction-column`, `justify-content-center`, `align-items-center`
|
|
309
|
-
- **Spacing**: `mb-1`, `mt-2`, `p-0`, `pl-2` (padding/margin utilities)
|
|
310
|
-
- **Typography**: `h1`-`h5` (headings), `s1`-`s5` (body text), `bold`, `medium`, `normal`
|
|
311
|
-
- **Width/Height**: `w-100`, `w-50`, `h-100`, `vh-100`
|
|
312
|
-
- **Text Alignment**: `text-center`, `text-left`, `text-right`
|
|
313
|
-
|
|
314
|
-
### Using SCSS Variables (Advanced)
|
|
315
|
-
|
|
316
|
-
Import SCSS variables in your `.scss` files:
|
|
317
|
-
|
|
318
|
-
```scss
|
|
319
|
-
// your-component.scss
|
|
320
|
-
@import '@erpsquad/common/styles/variables';
|
|
321
|
-
|
|
322
|
-
.custom-component {
|
|
323
|
-
background-color: $primary-600;
|
|
324
|
-
color: $neutral-100;
|
|
325
|
-
border: 1px solid $neutral-300;
|
|
326
|
-
}
|
|
327
|
-
```
|
|
328
|
-
|
|
329
|
-
Available color scales (100-1000):
|
|
330
|
-
- `$primary-*` (green), `$neutral-*` (gray), `$error-*` (red)
|
|
331
|
-
- `$blue-*`, `$magenta-*`, `$olive-*`, `$green-*`, `$lightGreen-*`
|
|
332
|
-
|
|
333
|
-
### Using SCSS Mixins (Advanced)
|
|
334
|
-
|
|
335
|
-
```scss
|
|
336
|
-
// your-component.scss
|
|
337
|
-
@import '@erpsquad/common/styles/mixins';
|
|
338
|
-
|
|
339
|
-
.responsive-layout {
|
|
340
|
-
@include flex(center, space-between, row);
|
|
341
|
-
|
|
342
|
-
@include media-md {
|
|
343
|
-
flex-direction: column;
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
```
|
|
347
|
-
|
|
348
|
-
Available mixins:
|
|
349
|
-
- `@include flex($align, $justify, $direction)` - Flexbox shorthand
|
|
350
|
-
- `@include transition($time, $motion)` - Transition shorthand
|
|
351
|
-
- `@include center` - Absolute center positioning
|
|
352
|
-
- Responsive breakpoints: `@include media-sm`, `@include media-md`, `@include media-l`, etc.
|
|
353
|
-
|
|
354
|
-
### Import All SCSS Features
|
|
355
|
-
|
|
356
|
-
```scss
|
|
357
|
-
// For complete access to variables, mixins, utilities, and animations
|
|
358
|
-
@import '@erpsquad/common/styles/all';
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
**📚 For detailed styles documentation, see:**
|
|
362
|
-
- [Complete Styles Documentation](./src/styles/README.md)
|
|
363
|
-
- [Styles Usage Guide](./STYLES_USAGE.md)
|
|
364
|
-
- [Migration Guide](./STYLES_MIGRATION.md)
|
|
365
|
-
|
|
366
|
-
## 📁 Modular Import System
|
|
367
|
-
|
|
368
|
-
The library uses a modular import system to prevent dependency issues. Import from specific paths based on your needs:
|
|
369
|
-
|
|
370
|
-
```tsx
|
|
371
|
-
// Core functionality (no peer dependencies required)
|
|
372
|
-
import { configureLibrary, images } from '@erpsquad/common';
|
|
373
|
-
|
|
374
|
-
// Components (requires React, MUI peer dependencies)
|
|
375
|
-
import { Button, TextField } from '@erpsquad/common/components';
|
|
376
|
-
|
|
377
|
-
// Hooks (requires React peer dependencies)
|
|
378
|
-
import { useAuth, useLanguage } from '@erpsquad/common/hooks';
|
|
379
|
-
|
|
380
|
-
// Contexts (requires React peer dependencies)
|
|
381
|
-
import { ERPUIProvider, AuthProvider } from '@erpsquad/common/contexts';
|
|
382
|
-
|
|
383
|
-
// Theme utilities (requires MUI peer dependencies)
|
|
384
|
-
import { createLightTheme, createDarkTheme } from '@erpsquad/common/theme';
|
|
385
|
-
|
|
386
|
-
// Utility functions (may require specific peer dependencies)
|
|
387
|
-
import { formatDate, validateEmail } from '@erpsquad/common/utils';
|
|
388
|
-
|
|
389
|
-
// Redux integration (requires Redux peer dependencies)
|
|
390
|
-
import { createLibraryStore, slices } from '@erpsquad/common/redux';
|
|
391
|
-
|
|
392
|
-
// API clients (requires axios peer dependency)
|
|
393
|
-
import { AccountingAPI, InventoryAPI } from '@erpsquad/common/api-client';
|
|
394
|
-
|
|
395
|
-
// Styles (CSS bundle - recommended)
|
|
396
|
-
import '@erpsquad/common/style.css';
|
|
397
|
-
|
|
398
|
-
// Styles (SCSS imports for advanced usage)
|
|
399
|
-
// Import in .scss files only:
|
|
400
|
-
// @import '@erpsquad/common/styles/variables';
|
|
401
|
-
// @import '@erpsquad/common/styles/mixins';
|
|
402
|
-
// @import '@erpsquad/common/styles/all';
|
|
403
|
-
```
|
|
404
|
-
|
|
405
|
-
## 🔌 API Clients
|
|
406
|
-
|
|
407
|
-
The library includes pre-configured API clients for different ERP modules:
|
|
408
|
-
|
|
409
|
-
```tsx
|
|
410
|
-
import {
|
|
411
|
-
AccountingAPI,
|
|
412
|
-
InventoryAPI,
|
|
413
|
-
ManufacturingAPI,
|
|
414
|
-
PurchaseAPI,
|
|
415
|
-
SalesAPI,
|
|
416
|
-
RentalAPI,
|
|
417
|
-
RbacAPI,
|
|
418
|
-
DriveAPI,
|
|
419
|
-
SystemFeatureAPI
|
|
420
|
-
} from '@erpsquad/common/api-client';
|
|
421
|
-
|
|
422
|
-
// Configure base API client
|
|
423
|
-
const baseConfig = {
|
|
424
|
-
baseURL: 'https://api.example.com',
|
|
425
|
-
timeout: 10000,
|
|
426
|
-
headers: {
|
|
427
|
-
'Content-Type': 'application/json'
|
|
428
|
-
}
|
|
429
|
-
};
|
|
430
|
-
|
|
431
|
-
// Use specific API clients
|
|
432
|
-
const accountingClient = new AccountingAPI(baseConfig);
|
|
433
|
-
const inventoryClient = new InventoryAPI(baseConfig);
|
|
434
|
-
|
|
435
|
-
// Example usage
|
|
436
|
-
const users = await accountingClient.getUsers();
|
|
437
|
-
const products = await inventoryClient.getProducts();
|
|
438
|
-
```
|
|
439
|
-
|
|
440
|
-
## 🔧 Components
|
|
441
|
-
|
|
442
|
-
### Form Controls
|
|
443
|
-
|
|
444
|
-
```tsx
|
|
445
|
-
import {
|
|
446
|
-
TextField,
|
|
447
|
-
Select,
|
|
448
|
-
DatePicker,
|
|
449
|
-
Checkbox,
|
|
450
|
-
Radio,
|
|
451
|
-
ToggleSwitch,
|
|
452
|
-
Button
|
|
453
|
-
} from '@erpsquad/common/components';
|
|
454
|
-
|
|
455
|
-
// Text input
|
|
456
|
-
<TextField
|
|
457
|
-
label="Email"
|
|
458
|
-
type="email"
|
|
459
|
-
variant="outlined"
|
|
460
|
-
required
|
|
461
|
-
/>
|
|
462
|
-
|
|
463
|
-
// Select dropdown
|
|
464
|
-
<Select
|
|
465
|
-
label="Country"
|
|
466
|
-
options={countries}
|
|
467
|
-
value={selectedCountry}
|
|
468
|
-
onChange={handleCountryChange}
|
|
469
|
-
/>
|
|
470
|
-
|
|
471
|
-
// Date picker (requires @mui/x-date-pickers)
|
|
472
|
-
<DatePicker
|
|
473
|
-
label="Birth Date"
|
|
474
|
-
value={birthDate}
|
|
475
|
-
onChange={setBirthDate}
|
|
476
|
-
/>
|
|
477
|
-
```
|
|
478
|
-
|
|
479
|
-
### Data Display
|
|
480
|
-
|
|
481
|
-
```tsx
|
|
482
|
-
import {
|
|
483
|
-
MaterialTable,
|
|
484
|
-
Grid,
|
|
485
|
-
CardWrapper,
|
|
486
|
-
Avatar,
|
|
487
|
-
Chip
|
|
488
|
-
} from '@erpsquad/common/components';
|
|
489
|
-
|
|
490
|
-
// Data table (requires @mui/x-data-grid)
|
|
491
|
-
<MaterialTable
|
|
492
|
-
columns={columns}
|
|
493
|
-
data={data}
|
|
494
|
-
title="Users"
|
|
495
|
-
options={{
|
|
496
|
-
search: true,
|
|
497
|
-
pagination: true,
|
|
498
|
-
sorting: true
|
|
499
|
-
}}
|
|
500
|
-
/>
|
|
501
|
-
|
|
502
|
-
// Grid layout
|
|
503
|
-
<Grid container spacing={2}>
|
|
504
|
-
<Grid item xs={12} md={6}>
|
|
505
|
-
<CardWrapper>Content</CardWrapper>
|
|
506
|
-
</Grid>
|
|
507
|
-
</Grid>
|
|
508
|
-
```
|
|
509
|
-
|
|
510
|
-
### Navigation
|
|
511
|
-
|
|
512
|
-
```tsx
|
|
513
|
-
import {
|
|
514
|
-
Sidebar,
|
|
515
|
-
BreadCrumb,
|
|
516
|
-
Pagination,
|
|
517
|
-
Tabs
|
|
518
|
-
} from '@erpsquad/common/components';
|
|
519
|
-
|
|
520
|
-
// Sidebar navigation
|
|
521
|
-
<Sidebar
|
|
522
|
-
items={navigationItems}
|
|
523
|
-
collapsed={isCollapsed}
|
|
524
|
-
onItemClick={handleNavigation}
|
|
525
|
-
/>
|
|
526
|
-
|
|
527
|
-
// Breadcrumb (requires react-router-dom for navigation)
|
|
528
|
-
<BreadCrumb
|
|
529
|
-
items={[
|
|
530
|
-
{ label: 'Home', href: '/' },
|
|
531
|
-
{ label: 'Users', href: '/users' },
|
|
532
|
-
{ label: 'Profile' }
|
|
533
|
-
]}
|
|
534
|
-
/>
|
|
535
|
-
```
|
|
536
|
-
|
|
537
|
-
### Feedback
|
|
538
|
-
|
|
539
|
-
```tsx
|
|
540
|
-
import {
|
|
541
|
-
CustomSnackbar,
|
|
542
|
-
Toast,
|
|
543
|
-
Loader,
|
|
544
|
-
Alert,
|
|
545
|
-
Modal
|
|
546
|
-
} from '@erpsquad/common/components';
|
|
547
|
-
|
|
548
|
-
// Loading indicator
|
|
549
|
-
<Loader size="large" text="Loading data..." />
|
|
550
|
-
|
|
551
|
-
// Alert message
|
|
552
|
-
<Alert severity="success" onClose={handleClose}>
|
|
553
|
-
Operation completed successfully!
|
|
554
|
-
</Alert>
|
|
555
|
-
|
|
556
|
-
// Snackbar notification
|
|
557
|
-
<CustomSnackbar
|
|
558
|
-
open={isOpen}
|
|
559
|
-
message="Operation completed successfully!"
|
|
560
|
-
severity="success"
|
|
561
|
-
onClose={handleClose}
|
|
562
|
-
/>
|
|
563
|
-
|
|
564
|
-
// Modal dialog
|
|
565
|
-
<Modal
|
|
566
|
-
open={isOpen}
|
|
567
|
-
onClose={handleClose}
|
|
568
|
-
title="Confirm Action"
|
|
569
|
-
actions={[
|
|
570
|
-
{ label: 'Cancel', onClick: handleClose },
|
|
571
|
-
{ label: 'Confirm', onClick: handleConfirm, variant: 'contained' }
|
|
572
|
-
]}
|
|
573
|
-
>
|
|
574
|
-
Are you sure you want to proceed?
|
|
575
|
-
</Modal>
|
|
576
|
-
```
|
|
577
|
-
|
|
578
|
-
## 🔄 Redux Integration
|
|
579
|
-
|
|
580
|
-
The library provides flexible Redux integration that works with or without Redux. Requires `@reduxjs/toolkit` and `react-redux` peer dependencies.
|
|
581
|
-
|
|
582
|
-
### With Redux (Recommended for complex applications)
|
|
583
|
-
|
|
584
|
-
```tsx
|
|
585
|
-
import { ERPUIProvider } from '@erpsquad/common/contexts';
|
|
586
|
-
import {
|
|
587
|
-
createLibraryStore,
|
|
588
|
-
createConfiguredApiClient
|
|
589
|
-
} from '@erpsquad/common/redux';
|
|
590
|
-
import { ShareModal } from '@erpsquad/common/components';
|
|
591
|
-
|
|
592
|
-
// Configure API client
|
|
593
|
-
const apiClient = createConfiguredApiClient(baseApiClient, () => ({
|
|
594
|
-
authorization: `Bearer ${getAuthToken()}`
|
|
595
|
-
}));
|
|
596
|
-
|
|
597
|
-
// Create store with library slices
|
|
598
|
-
const store = createLibraryStore(
|
|
599
|
-
{
|
|
600
|
-
// Your app reducers
|
|
601
|
-
app: appReducer,
|
|
602
|
-
user: userReducer
|
|
603
|
-
},
|
|
604
|
-
apiClient
|
|
605
|
-
);
|
|
606
|
-
|
|
607
|
-
function App() {
|
|
608
|
-
return (
|
|
609
|
-
<ERPUIProvider useRedux={true} reduxStore={store} apiClient={apiClient}>
|
|
610
|
-
<ShareModal useRedux={true} />
|
|
611
|
-
</ERPUIProvider>
|
|
612
|
-
);
|
|
613
|
-
}
|
|
614
|
-
```
|
|
615
|
-
|
|
616
|
-
### Without Redux (Simpler applications)
|
|
617
|
-
|
|
618
|
-
```tsx
|
|
619
|
-
import { ERPUIProvider } from '@erpsquad/common/contexts';
|
|
620
|
-
import { ShareModal } from '@erpsquad/common/components';
|
|
621
|
-
|
|
622
|
-
function App() {
|
|
623
|
-
const [users, setUsers] = useState([]);
|
|
624
|
-
const [loading, setLoading] = useState(false);
|
|
625
|
-
|
|
626
|
-
const fetchUsers = async () => {
|
|
627
|
-
setLoading(true);
|
|
628
|
-
try {
|
|
629
|
-
const response = await api.getUsers();
|
|
630
|
-
setUsers(response.data);
|
|
631
|
-
} finally {
|
|
632
|
-
setLoading(false);
|
|
633
|
-
}
|
|
634
|
-
};
|
|
635
|
-
|
|
636
|
-
return (
|
|
637
|
-
<ERPUIProvider useRedux={false}>
|
|
638
|
-
<ShareModal
|
|
639
|
-
useRedux={false}
|
|
640
|
-
users={users}
|
|
641
|
-
loading={loading}
|
|
642
|
-
onFetchUsersAndDepartments={fetchUsers}
|
|
643
|
-
/>
|
|
644
|
-
</ERPUIProvider>
|
|
645
|
-
);
|
|
646
|
-
}
|
|
647
|
-
```
|
|
648
|
-
|
|
649
|
-
### Available Redux Slices
|
|
650
|
-
|
|
651
|
-
- **shareSlice**: User and department data for sharing functionality
|
|
652
|
-
- **headerSlice**: Language data and current language selection
|
|
653
|
-
- **reportsTitleBarSlice**: Company data for reports filtering
|
|
654
|
-
- **inventoryReportsTitleBarSlice**: Inventory-related data for reports
|
|
655
|
-
|
|
656
|
-
## 🪝 Hooks
|
|
657
|
-
|
|
658
|
-
### Custom Hooks
|
|
659
|
-
|
|
660
|
-
```tsx
|
|
661
|
-
import {
|
|
662
|
-
useAuth,
|
|
663
|
-
useLanguage,
|
|
664
|
-
usePermissions,
|
|
665
|
-
usePages,
|
|
666
|
-
useDeepMemo,
|
|
667
|
-
useReduxIntegration
|
|
668
|
-
} from '@erpsquad/common/hooks';
|
|
669
|
-
|
|
670
|
-
// Authentication hook
|
|
671
|
-
const { user, isAuthenticated, login, logout } = useAuth();
|
|
672
|
-
|
|
673
|
-
// Language hook (requires react-i18next)
|
|
674
|
-
const { currentLanguage, changeLanguage, t } = useLanguage();
|
|
675
|
-
|
|
676
|
-
// Permissions hook
|
|
677
|
-
const { hasPermission, checkPermission } = usePermissions();
|
|
678
|
-
|
|
679
|
-
// Deep memoization hook
|
|
680
|
-
const memoizedValue = useDeepMemo(() => expensiveCalculation(data), [data]);
|
|
681
|
-
```
|
|
682
|
-
|
|
683
|
-
### Redux Integration Hook
|
|
684
|
-
|
|
685
|
-
```tsx
|
|
686
|
-
import { useReduxIntegration } from '@erpsquad/common/hooks';
|
|
687
|
-
|
|
688
|
-
const MyComponent = ({ useRedux, ...props }) => {
|
|
689
|
-
const { data, loading, error, actions } = useReduxIntegration({
|
|
690
|
-
useRedux,
|
|
691
|
-
sliceName: 'share',
|
|
692
|
-
fallbackData: props.users,
|
|
693
|
-
fallbackLoading: props.loading,
|
|
694
|
-
fallbackActions: {
|
|
695
|
-
fetchData: props.onFetchUsers
|
|
696
|
-
}
|
|
697
|
-
});
|
|
698
|
-
|
|
699
|
-
// Component logic using unified interface
|
|
700
|
-
};
|
|
701
|
-
```
|
|
702
|
-
|
|
703
|
-
## 🛠️ Utilities
|
|
704
|
-
|
|
705
|
-
### Common Utilities
|
|
706
|
-
|
|
707
|
-
```tsx
|
|
708
|
-
import {
|
|
709
|
-
formatDate,
|
|
710
|
-
formatFileSize,
|
|
711
|
-
formatText,
|
|
712
|
-
deformatText,
|
|
713
|
-
colorUtils
|
|
714
|
-
} from '@erpsquad/common/utils';
|
|
715
|
-
|
|
716
|
-
// Date formatting (requires date-fns)
|
|
717
|
-
const formattedDate = formatDate(new Date(), 'dd/MM/yyyy');
|
|
718
|
-
|
|
719
|
-
// File size formatting
|
|
720
|
-
const fileSize = formatFileSize(1024000); // "1.02 MB"
|
|
721
|
-
|
|
722
|
-
// Text formatting
|
|
723
|
-
const formatted = formatText('hello world', 'title'); // "Hello World"
|
|
724
|
-
|
|
725
|
-
// Color utilities
|
|
726
|
-
const hexColor = colorUtils.rgbToHex(255, 0, 0); // "#ff0000"
|
|
727
|
-
```
|
|
728
|
-
|
|
729
|
-
## 🌐 Internationalization
|
|
730
|
-
|
|
731
|
-
Requires `react-i18next` and `i18next` peer dependencies.
|
|
732
|
-
|
|
733
|
-
### Language Provider
|
|
734
|
-
|
|
735
|
-
```tsx
|
|
736
|
-
import { ERPUIProvider } from '@erpsquad/common/contexts';
|
|
737
|
-
|
|
738
|
-
<ERPUIProvider
|
|
739
|
-
enableLanguage={true}
|
|
740
|
-
// Other props
|
|
741
|
-
>
|
|
742
|
-
<App />
|
|
743
|
-
</ERPUIProvider>;
|
|
744
|
-
```
|
|
745
|
-
|
|
746
|
-
### Using Translations
|
|
747
|
-
|
|
748
|
-
```tsx
|
|
749
|
-
import { useLanguage } from '@erpsquad/common/hooks';
|
|
750
|
-
|
|
751
|
-
const MyComponent = () => {
|
|
752
|
-
const { t, currentLanguage, changeLanguage } = useLanguage();
|
|
753
|
-
|
|
754
|
-
return (
|
|
755
|
-
<div>
|
|
756
|
-
<p>{t('common.welcome')}</p>
|
|
757
|
-
<button onClick={() => changeLanguage('es')}>Switch to Spanish</button>
|
|
758
|
-
</div>
|
|
759
|
-
);
|
|
760
|
-
};
|
|
761
|
-
```
|
|
762
|
-
|
|
763
|
-
## 🧪 Testing
|
|
764
|
-
|
|
765
|
-
The library includes comprehensive testing utilities:
|
|
766
|
-
|
|
767
|
-
```tsx
|
|
768
|
-
import { render, screen } from '@testing-library/react';
|
|
769
|
-
import { ERPUIProvider } from '@erpsquad/common/contexts';
|
|
770
|
-
import { Button } from '@erpsquad/common/components';
|
|
771
|
-
|
|
772
|
-
test('renders button correctly', () => {
|
|
773
|
-
render(
|
|
774
|
-
<ERPUIProvider>
|
|
775
|
-
<Button>Click me</Button>
|
|
776
|
-
</ERPUIProvider>
|
|
777
|
-
);
|
|
778
|
-
|
|
779
|
-
expect(screen.getByRole('button')).toBeInTheDocument();
|
|
780
|
-
});
|
|
781
|
-
```
|
|
782
|
-
|
|
783
|
-
## 📚 API Reference
|
|
784
|
-
|
|
785
|
-
### ERPUIProvider Props
|
|
786
|
-
|
|
787
|
-
| Prop | Type | Default | Description |
|
|
788
|
-
| ---------------- | ------------------- | ----------- | ------------------------ |
|
|
789
|
-
| `useRedux` | `boolean` | `false` | Enable Redux integration |
|
|
790
|
-
| `reduxStore` | `Store` | `undefined` | Custom Redux store |
|
|
791
|
-
| `apiClient` | `ApiClientConfig` | `undefined` | API client configuration |
|
|
792
|
-
| `themeMode` | `'light' \| 'dark'` | `'light'` | Theme mode |
|
|
793
|
-
| `primaryColor` | `string` | `undefined` | Primary theme color |
|
|
794
|
-
| `direction` | `'ltr' \| 'rtl'` | `'ltr'` | Text direction |
|
|
795
|
-
| `enableAuth` | `boolean` | `true` | Enable auth context |
|
|
796
|
-
| `enableLanguage` | `boolean` | `true` | Enable language context |
|
|
797
|
-
| `enableRouter` | `boolean` | `false` | Enable router provider |
|
|
798
|
-
| `enableSnackbar` | `boolean` | `true` | Enable snackbar provider |
|
|
799
|
-
|
|
800
|
-
### Component Props
|
|
801
|
-
|
|
802
|
-
All components extend their respective Material-UI component props with additional ERP-specific functionality. Refer to individual component documentation for detailed prop information.
|
|
803
|
-
|
|
804
|
-
## 🔧 Development
|
|
805
|
-
|
|
806
|
-
### Building the Library
|
|
807
|
-
|
|
808
|
-
```bash
|
|
809
|
-
# Production build
|
|
810
|
-
npm run build
|
|
811
|
-
|
|
812
|
-
# Build with analysis
|
|
813
|
-
npm run build:analyze
|
|
814
|
-
|
|
815
|
-
# Build with validation
|
|
816
|
-
npm run build:validate
|
|
817
|
-
|
|
818
|
-
# Clean build artifacts
|
|
819
|
-
npm run clean
|
|
820
|
-
```
|
|
821
|
-
|
|
822
|
-
### Running Tests
|
|
823
|
-
|
|
824
|
-
```bash
|
|
825
|
-
# Run all tests
|
|
826
|
-
npm test
|
|
827
|
-
|
|
828
|
-
# Run tests in CI mode
|
|
829
|
-
npm run test:ci
|
|
830
|
-
|
|
831
|
-
# Type checking
|
|
832
|
-
npm run type-check
|
|
833
|
-
|
|
834
|
-
# Linting
|
|
835
|
-
npm run lint
|
|
836
|
-
npm run lint:fix
|
|
837
|
-
```
|
|
838
|
-
|
|
839
|
-
### Package Validation
|
|
840
|
-
|
|
841
|
-
```bash
|
|
842
|
-
# Validate package structure
|
|
843
|
-
npm run validate:package
|
|
844
|
-
|
|
845
|
-
# Check bundle size limits
|
|
846
|
-
npm run size-check
|
|
847
|
-
|
|
848
|
-
# Full validation (lint + type-check + test + build)
|
|
849
|
-
npm run validate
|
|
850
|
-
```
|
|
851
|
-
|
|
852
|
-
## 📈 Bundle Analysis
|
|
853
|
-
|
|
854
|
-
```bash
|
|
855
|
-
# Analyze bundle size and composition
|
|
856
|
-
npm run build:analyze
|
|
857
|
-
|
|
858
|
-
# Check size limits against configuration
|
|
859
|
-
npm run size-check
|
|
860
|
-
|
|
861
|
-
# Validate package contents before publishing
|
|
862
|
-
npm run validate:package
|
|
863
|
-
```
|
|
864
|
-
|
|
865
|
-
## 🚨 Troubleshooting
|
|
866
|
-
|
|
867
|
-
### Common Issues
|
|
868
|
-
|
|
869
|
-
#### ⚠️ Components Have No Styling
|
|
870
|
-
|
|
871
|
-
**Problem**: Components render but have no styling / look unstyled.
|
|
872
|
-
|
|
873
|
-
**Solution**: You MUST import the CSS file in your application:
|
|
874
|
-
|
|
875
|
-
```tsx
|
|
876
|
-
// In your main file (main.tsx, App.tsx, or index.tsx)
|
|
877
|
-
import '@erpsquad/common/style.css'; // 👈 Add this!
|
|
878
|
-
|
|
879
|
-
// Then import components
|
|
880
|
-
import { Button } from '@erpsquad/common/components';
|
|
881
|
-
```
|
|
882
|
-
|
|
883
|
-
**Why**: Component styles are bundled separately for optimal tree-shaking and loading performance. The CSS file must be explicitly imported once in your application entry point.
|
|
884
|
-
|
|
885
|
-
#### Import Errors
|
|
886
|
-
|
|
887
|
-
```bash
|
|
888
|
-
# Error: Cannot resolve '@erpsquad/common/components'
|
|
889
|
-
# Solution: Install required peer dependencies
|
|
890
|
-
npm install @mui/material @emotion/react @emotion/styled
|
|
891
|
-
|
|
892
|
-
# Error: Module not found
|
|
893
|
-
# Solution: Use correct import paths
|
|
894
|
-
import { Button } from '@erpsquad/common/components'; // ✅ Correct
|
|
895
|
-
import { Button } from '@erpsquad/common'; // ❌ Incorrect for components
|
|
896
|
-
```
|
|
897
|
-
|
|
898
|
-
#### Peer Dependency Warnings
|
|
899
|
-
|
|
900
|
-
```bash
|
|
901
|
-
# Warning: peer dependency not installed
|
|
902
|
-
# Solution: Install the specific peer dependency
|
|
903
|
-
npm install react-redux @reduxjs/toolkit
|
|
904
|
-
|
|
905
|
-
# Or install all peer dependencies
|
|
906
|
-
npm install react react-dom @mui/material @emotion/react @emotion/styled @mui/icons-material
|
|
907
|
-
```
|
|
908
|
-
|
|
909
|
-
#### TypeScript Errors
|
|
910
|
-
|
|
911
|
-
```bash
|
|
912
|
-
# Error: Cannot find type definitions
|
|
913
|
-
# Solution: Ensure TypeScript types are properly imported
|
|
914
|
-
import type { LibraryConfig } from '@erpsquad/common';
|
|
915
|
-
|
|
916
|
-
# Error: Module has no exported member
|
|
917
|
-
# Solution: Check if the export requires peer dependencies
|
|
918
|
-
import { useAuth } from '@erpsquad/common/hooks'; // Requires React
|
|
919
|
-
```
|
|
920
|
-
|
|
921
|
-
#### Build Issues
|
|
922
|
-
|
|
923
|
-
```bash
|
|
924
|
-
# Error: Module not found during build
|
|
925
|
-
# Solution: Check if all peer dependencies are installed
|
|
926
|
-
# and properly configured in your build tool
|
|
927
|
-
|
|
928
|
-
# For Vite projects, add to vite.config.ts:
|
|
929
|
-
export default defineConfig({
|
|
930
|
-
optimizeDeps: {
|
|
931
|
-
include: ['@erpsquad/common']
|
|
932
|
-
}
|
|
933
|
-
});
|
|
934
|
-
|
|
935
|
-
# For Webpack projects, ensure proper externals configuration
|
|
936
|
-
```
|
|
937
|
-
|
|
938
|
-
### Getting Help
|
|
939
|
-
|
|
940
|
-
- Check the [troubleshooting guide](./TROUBLESHOOTING.md)
|
|
941
|
-
- Review [migration documentation](./MIGRATION.md)
|
|
942
|
-
- Search [existing issues](https://github.com/erpforce/common/issues)
|
|
943
|
-
- Create a [new issue](https://github.com/erpforce/common/issues/new)
|
|
944
|
-
|
|
945
|
-
## 🤝 Contributing
|
|
946
|
-
|
|
947
|
-
1. Fork the repository
|
|
948
|
-
2. Create a feature branch: `git checkout -b feature/new-component`
|
|
949
|
-
3. Make your changes and add tests
|
|
950
|
-
4. Run tests: `npm test`
|
|
951
|
-
5. Run linting: `npm run lint`
|
|
952
|
-
6. Commit your changes: `git commit -m 'Add new component'`
|
|
953
|
-
7. Push to the branch: `git push origin feature/new-component`
|
|
954
|
-
8. Submit a pull request
|
|
955
|
-
|
|
956
|
-
### Development Guidelines
|
|
957
|
-
|
|
958
|
-
- Follow TypeScript best practices
|
|
959
|
-
- Write comprehensive tests for new components
|
|
960
|
-
- Update documentation for API changes
|
|
961
|
-
- Ensure accessibility compliance
|
|
962
|
-
- Maintain backward compatibility
|
|
963
|
-
|
|
964
|
-
## 📄 License
|
|
965
|
-
|
|
966
|
-
MIT License - see the [LICENSE](LICENSE) file for details.
|
|
967
|
-
|
|
968
|
-
## 🆘 Support
|
|
969
|
-
|
|
970
|
-
- **Documentation**: [Library Docs](https://github.com/erpforce/erpforce-common-hub-fe/tree/dev#readme)
|
|
971
|
-
- **Issues**: [GitHub Issues](https://github.com/erpforce/erpforce-common-hub-fe/issues)
|
|
972
|
-
- **NPM Package**: [@erpsquad/common](https://www.npmjs.com/package/@erpsquad/common)
|
|
973
|
-
- **Changelog**: [CHANGELOG.md](./CHANGELOG.md)
|
|
974
|
-
- **Migration Guide**: [MIGRATION.md](./MIGRATION.md)
|
|
975
|
-
- **Troubleshooting**: [TROUBLESHOOTING.md](./TROUBLESHOOTING.md)
|
|
976
|
-
|
|
977
|
-
## 📋 Changelog
|
|
978
|
-
|
|
979
|
-
See [CHANGELOG.md](CHANGELOG.md) for a detailed list of changes and version history.
|
|
1
|
+
# @erpsquad/common
|
|
2
|
+
|
|
3
|
+
A comprehensive React component library for ERP applications, built with Material-UI and TypeScript. This library provides 100+ reusable UI components, theming system, utilities, hooks, and optional Redux integration for building modern ERP applications.
|
|
4
|
+
|
|
5
|
+
## 🚀 Features
|
|
6
|
+
|
|
7
|
+
- **100+ UI Components**: Comprehensive set of form controls, data display, navigation, and layout components
|
|
8
|
+
- **Material-UI Integration**: Built on top of Material-UI with custom theming
|
|
9
|
+
- **TypeScript Support**: Full TypeScript definitions for all components and utilities
|
|
10
|
+
- **Flexible Redux Integration**: Optional Redux support - components work with or without Redux
|
|
11
|
+
- **Theme System**: Light/dark themes with RTL/LTR support and customizable colors
|
|
12
|
+
- **Internationalization**: Built-in i18n support with language switching
|
|
13
|
+
- **Tree Shaking**: Optimized for bundle size with proper tree shaking support
|
|
14
|
+
- **Accessibility**: WCAG compliant components with proper ARIA attributes
|
|
15
|
+
- **Modular Architecture**: Import only what you need to minimize bundle size
|
|
16
|
+
- **Peer Dependency Management**: Flexible dependency management for different project setups
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Development Environment
|
|
20
|
+
For local development, you can create a `.env` file in your project root with these variables. Make sure to add `.env` to your `.gitignore` file to keep sensitive information secure.
|
|
21
|
+
|
|
22
|
+
### Production Deployment
|
|
23
|
+
For production deployments, set these environment variables in your hosting environment's configuration panel.
|
|
24
|
+
|
|
25
|
+
## 📦 Installation
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install @erpsquad/common
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Peer Dependencies
|
|
32
|
+
|
|
33
|
+
The library uses peer dependencies to avoid version conflicts and reduce bundle size. Install the dependencies you need based on your usage:
|
|
34
|
+
|
|
35
|
+
#### Required (Core functionality)
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm install react react-dom @mui/material @emotion/react @emotion/styled @mui/icons-material
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
#### Optional (Feature-specific)
|
|
42
|
+
|
|
43
|
+
For Redux integration:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npm install @reduxjs/toolkit react-redux
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
For date components:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npm install @mui/x-date-pickers date-fns
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
For data grid components:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npm install @mui/x-data-grid
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
For routing utilities:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm install react-router-dom
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
For internationalization:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
npm install react-i18next i18next
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
For utility functions:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
npm install lodash axios
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
#### Complete Installation (All features)
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# Install all peer dependencies for full functionality
|
|
83
|
+
npm install react react-dom @mui/material @emotion/react @emotion/styled @mui/icons-material @reduxjs/toolkit react-redux @mui/x-date-pickers @mui/x-data-grid date-fns react-router-dom react-i18next i18next lodash axios
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## 🎯 Quick Start
|
|
87
|
+
|
|
88
|
+
### ⚠️ IMPORTANT: Import Styles
|
|
89
|
+
|
|
90
|
+
**Before using any components, you MUST import the CSS file in your main application file:**
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
// main.tsx or App.tsx or index.tsx
|
|
94
|
+
import '@erpsquad/common/style.css'; // 👈 REQUIRED - Import this first!
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Without this import, components will render but have **no styling**.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
### Core Usage (Minimal dependencies)
|
|
102
|
+
|
|
103
|
+
The library provides core functionality without requiring all peer dependencies:
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
import React from 'react';
|
|
107
|
+
// ⚠️ IMPORTANT: Import styles first (in your main file)
|
|
108
|
+
import '@erpsquad/common/style.css';
|
|
109
|
+
|
|
110
|
+
import {
|
|
111
|
+
configureLibrary,
|
|
112
|
+
getLibraryConfig,
|
|
113
|
+
images,
|
|
114
|
+
DEFAULT_LANG,
|
|
115
|
+
type LibraryConfig
|
|
116
|
+
} from '@erpsquad/common';
|
|
117
|
+
|
|
118
|
+
// Configure library for your application
|
|
119
|
+
const config: LibraryConfig = {
|
|
120
|
+
routes: {
|
|
121
|
+
login: '/auth/login',
|
|
122
|
+
dashboard: '/dashboard'
|
|
123
|
+
},
|
|
124
|
+
validation: {
|
|
125
|
+
emailRequired: true,
|
|
126
|
+
phoneRequired: false
|
|
127
|
+
},
|
|
128
|
+
dataTransforms: {
|
|
129
|
+
dateFormat: 'dd/MM/yyyy'
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
configureLibrary(config);
|
|
134
|
+
|
|
135
|
+
function App() {
|
|
136
|
+
const currentConfig = getLibraryConfig();
|
|
137
|
+
|
|
138
|
+
return (
|
|
139
|
+
<div>
|
|
140
|
+
<img src={images.logo} alt='Logo' />
|
|
141
|
+
<p>Default language: {DEFAULT_LANG}</p>
|
|
142
|
+
<p>Login route: {currentConfig.routes?.login}</p>
|
|
143
|
+
</div>
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export default App;
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Available Core Exports
|
|
151
|
+
|
|
152
|
+
The following exports are available without peer dependencies:
|
|
153
|
+
|
|
154
|
+
```tsx
|
|
155
|
+
// Configuration system
|
|
156
|
+
import {
|
|
157
|
+
configureLibrary,
|
|
158
|
+
getLibraryConfig,
|
|
159
|
+
getConfigFunction,
|
|
160
|
+
type LibraryConfig
|
|
161
|
+
} from '@erpsquad/common';
|
|
162
|
+
|
|
163
|
+
// Static assets
|
|
164
|
+
import { default as images } from '@erpsquad/common';
|
|
165
|
+
|
|
166
|
+
// Constants
|
|
167
|
+
import { DEFAULT_LANG, LANGUAGES, S3_BUCKET_URL } from '@erpsquad/common';
|
|
168
|
+
|
|
169
|
+
// TypeScript types
|
|
170
|
+
import type {
|
|
171
|
+
BaseComponentProps,
|
|
172
|
+
ThemeConfig,
|
|
173
|
+
SelectOption,
|
|
174
|
+
TableColumn,
|
|
175
|
+
User,
|
|
176
|
+
Permission
|
|
177
|
+
} from '@erpsquad/common';
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Full Usage (With peer dependencies)
|
|
181
|
+
|
|
182
|
+
After installing peer dependencies, you can use all components:
|
|
183
|
+
|
|
184
|
+
```tsx
|
|
185
|
+
import React from 'react';
|
|
186
|
+
// ⚠️ Import styles first!
|
|
187
|
+
import '@erpsquad/common/style.css';
|
|
188
|
+
|
|
189
|
+
// Note: Import from specific paths to avoid dependency issues
|
|
190
|
+
import { ERPUIProvider } from '@erpsquad/common/contexts';
|
|
191
|
+
import { Button, TextField } from '@erpsquad/common/components';
|
|
192
|
+
|
|
193
|
+
function App() {
|
|
194
|
+
return (
|
|
195
|
+
<ERPUIProvider>
|
|
196
|
+
<div>
|
|
197
|
+
<TextField label='Name' variant='outlined' />
|
|
198
|
+
<Button variant='contained' color='primary'>
|
|
199
|
+
Submit
|
|
200
|
+
</Button>
|
|
201
|
+
</div>
|
|
202
|
+
</ERPUIProvider>
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export default App;
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### With Custom Theme
|
|
210
|
+
|
|
211
|
+
```tsx
|
|
212
|
+
import React from 'react';
|
|
213
|
+
// ⚠️ Import styles first!
|
|
214
|
+
import '@erpsquad/common/style.css';
|
|
215
|
+
|
|
216
|
+
import { ERPUIProvider } from '@erpsquad/common/contexts';
|
|
217
|
+
import { Button } from '@erpsquad/common/components';
|
|
218
|
+
import { createLightTheme } from '@erpsquad/common/theme';
|
|
219
|
+
|
|
220
|
+
function App() {
|
|
221
|
+
const { theme } = createLightTheme('#2196f3', 'ltr');
|
|
222
|
+
|
|
223
|
+
return (
|
|
224
|
+
<ERPUIProvider
|
|
225
|
+
theme={theme}
|
|
226
|
+
themeMode='dark'
|
|
227
|
+
primaryColor='#2196f3'
|
|
228
|
+
enableCssBaseline={true}>
|
|
229
|
+
<Button variant='contained'>Dark Theme Button</Button>
|
|
230
|
+
</ERPUIProvider>
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## 🎨 Theme System
|
|
236
|
+
|
|
237
|
+
The library includes a comprehensive theming system with support for light/dark modes, RTL/LTR direction, and custom colors.
|
|
238
|
+
|
|
239
|
+
### Theme Configuration
|
|
240
|
+
|
|
241
|
+
```tsx
|
|
242
|
+
import { ERPUIProvider } from '@erpsquad/common/contexts';
|
|
243
|
+
|
|
244
|
+
<ERPUIProvider
|
|
245
|
+
themeMode='light' // 'light' | 'dark'
|
|
246
|
+
primaryColor='#1976d2' // Any valid color
|
|
247
|
+
direction='ltr' // 'ltr' | 'rtl'
|
|
248
|
+
enableCssBaseline={true}>
|
|
249
|
+
<App />
|
|
250
|
+
</ERPUIProvider>;
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Custom Theme Object
|
|
254
|
+
|
|
255
|
+
```tsx
|
|
256
|
+
import { createLightTheme, createDarkTheme } from '@erpsquad/common/theme';
|
|
257
|
+
import { ERPUIProvider } from '@erpsquad/common/contexts';
|
|
258
|
+
|
|
259
|
+
// Create custom theme
|
|
260
|
+
const { theme } = createLightTheme('#1976d2', 'ltr');
|
|
261
|
+
|
|
262
|
+
// Or create dark theme
|
|
263
|
+
const { darkTheme } = createDarkTheme('#1976d2', 'ltr');
|
|
264
|
+
|
|
265
|
+
<ERPUIProvider theme={theme}>
|
|
266
|
+
<App />
|
|
267
|
+
</ERPUIProvider>;
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### Available Colors
|
|
271
|
+
|
|
272
|
+
The library supports various color formats:
|
|
273
|
+
|
|
274
|
+
- Hex colors: `#1976d2`
|
|
275
|
+
- RGB: `rgb(25, 118, 210)`
|
|
276
|
+
- Color names: `blue`, `red`, `green`
|
|
277
|
+
- Material-UI color objects
|
|
278
|
+
|
|
279
|
+
## 🎨 Styles & SCSS
|
|
280
|
+
|
|
281
|
+
The library provides a comprehensive styling system with compiled CSS, SCSS variables, mixins, utility classes, and animations.
|
|
282
|
+
|
|
283
|
+
### Import Compiled CSS (Recommended)
|
|
284
|
+
|
|
285
|
+
Add this to your main application file:
|
|
286
|
+
|
|
287
|
+
```tsx
|
|
288
|
+
// main.tsx or App.tsx
|
|
289
|
+
import '@erpsquad/common/style.css';
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
This gives you:
|
|
293
|
+
- All component styles
|
|
294
|
+
- Utility classes for rapid development
|
|
295
|
+
- Responsive styles
|
|
296
|
+
- Animations
|
|
297
|
+
|
|
298
|
+
### Using Utility Classes
|
|
299
|
+
|
|
300
|
+
```tsx
|
|
301
|
+
<div className="d-flex justify-content-center align-items-center mb-2">
|
|
302
|
+
<h1 className="h2 bold">Welcome</h1>
|
|
303
|
+
<p className="s2 normal text-center">Description text</p>
|
|
304
|
+
</div>
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
Available utility classes:
|
|
308
|
+
- **Layout**: `d-flex`, `flex-direction-column`, `justify-content-center`, `align-items-center`
|
|
309
|
+
- **Spacing**: `mb-1`, `mt-2`, `p-0`, `pl-2` (padding/margin utilities)
|
|
310
|
+
- **Typography**: `h1`-`h5` (headings), `s1`-`s5` (body text), `bold`, `medium`, `normal`
|
|
311
|
+
- **Width/Height**: `w-100`, `w-50`, `h-100`, `vh-100`
|
|
312
|
+
- **Text Alignment**: `text-center`, `text-left`, `text-right`
|
|
313
|
+
|
|
314
|
+
### Using SCSS Variables (Advanced)
|
|
315
|
+
|
|
316
|
+
Import SCSS variables in your `.scss` files:
|
|
317
|
+
|
|
318
|
+
```scss
|
|
319
|
+
// your-component.scss
|
|
320
|
+
@import '@erpsquad/common/styles/variables';
|
|
321
|
+
|
|
322
|
+
.custom-component {
|
|
323
|
+
background-color: $primary-600;
|
|
324
|
+
color: $neutral-100;
|
|
325
|
+
border: 1px solid $neutral-300;
|
|
326
|
+
}
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
Available color scales (100-1000):
|
|
330
|
+
- `$primary-*` (green), `$neutral-*` (gray), `$error-*` (red)
|
|
331
|
+
- `$blue-*`, `$magenta-*`, `$olive-*`, `$green-*`, `$lightGreen-*`
|
|
332
|
+
|
|
333
|
+
### Using SCSS Mixins (Advanced)
|
|
334
|
+
|
|
335
|
+
```scss
|
|
336
|
+
// your-component.scss
|
|
337
|
+
@import '@erpsquad/common/styles/mixins';
|
|
338
|
+
|
|
339
|
+
.responsive-layout {
|
|
340
|
+
@include flex(center, space-between, row);
|
|
341
|
+
|
|
342
|
+
@include media-md {
|
|
343
|
+
flex-direction: column;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
Available mixins:
|
|
349
|
+
- `@include flex($align, $justify, $direction)` - Flexbox shorthand
|
|
350
|
+
- `@include transition($time, $motion)` - Transition shorthand
|
|
351
|
+
- `@include center` - Absolute center positioning
|
|
352
|
+
- Responsive breakpoints: `@include media-sm`, `@include media-md`, `@include media-l`, etc.
|
|
353
|
+
|
|
354
|
+
### Import All SCSS Features
|
|
355
|
+
|
|
356
|
+
```scss
|
|
357
|
+
// For complete access to variables, mixins, utilities, and animations
|
|
358
|
+
@import '@erpsquad/common/styles/all';
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
**📚 For detailed styles documentation, see:**
|
|
362
|
+
- [Complete Styles Documentation](./src/styles/README.md)
|
|
363
|
+
- [Styles Usage Guide](./STYLES_USAGE.md)
|
|
364
|
+
- [Migration Guide](./STYLES_MIGRATION.md)
|
|
365
|
+
|
|
366
|
+
## 📁 Modular Import System
|
|
367
|
+
|
|
368
|
+
The library uses a modular import system to prevent dependency issues. Import from specific paths based on your needs:
|
|
369
|
+
|
|
370
|
+
```tsx
|
|
371
|
+
// Core functionality (no peer dependencies required)
|
|
372
|
+
import { configureLibrary, images } from '@erpsquad/common';
|
|
373
|
+
|
|
374
|
+
// Components (requires React, MUI peer dependencies)
|
|
375
|
+
import { Button, TextField } from '@erpsquad/common/components';
|
|
376
|
+
|
|
377
|
+
// Hooks (requires React peer dependencies)
|
|
378
|
+
import { useAuth, useLanguage } from '@erpsquad/common/hooks';
|
|
379
|
+
|
|
380
|
+
// Contexts (requires React peer dependencies)
|
|
381
|
+
import { ERPUIProvider, AuthProvider } from '@erpsquad/common/contexts';
|
|
382
|
+
|
|
383
|
+
// Theme utilities (requires MUI peer dependencies)
|
|
384
|
+
import { createLightTheme, createDarkTheme } from '@erpsquad/common/theme';
|
|
385
|
+
|
|
386
|
+
// Utility functions (may require specific peer dependencies)
|
|
387
|
+
import { formatDate, validateEmail } from '@erpsquad/common/utils';
|
|
388
|
+
|
|
389
|
+
// Redux integration (requires Redux peer dependencies)
|
|
390
|
+
import { createLibraryStore, slices } from '@erpsquad/common/redux';
|
|
391
|
+
|
|
392
|
+
// API clients (requires axios peer dependency)
|
|
393
|
+
import { AccountingAPI, InventoryAPI } from '@erpsquad/common/api-client';
|
|
394
|
+
|
|
395
|
+
// Styles (CSS bundle - recommended)
|
|
396
|
+
import '@erpsquad/common/style.css';
|
|
397
|
+
|
|
398
|
+
// Styles (SCSS imports for advanced usage)
|
|
399
|
+
// Import in .scss files only:
|
|
400
|
+
// @import '@erpsquad/common/styles/variables';
|
|
401
|
+
// @import '@erpsquad/common/styles/mixins';
|
|
402
|
+
// @import '@erpsquad/common/styles/all';
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
## 🔌 API Clients
|
|
406
|
+
|
|
407
|
+
The library includes pre-configured API clients for different ERP modules:
|
|
408
|
+
|
|
409
|
+
```tsx
|
|
410
|
+
import {
|
|
411
|
+
AccountingAPI,
|
|
412
|
+
InventoryAPI,
|
|
413
|
+
ManufacturingAPI,
|
|
414
|
+
PurchaseAPI,
|
|
415
|
+
SalesAPI,
|
|
416
|
+
RentalAPI,
|
|
417
|
+
RbacAPI,
|
|
418
|
+
DriveAPI,
|
|
419
|
+
SystemFeatureAPI
|
|
420
|
+
} from '@erpsquad/common/api-client';
|
|
421
|
+
|
|
422
|
+
// Configure base API client
|
|
423
|
+
const baseConfig = {
|
|
424
|
+
baseURL: 'https://api.example.com',
|
|
425
|
+
timeout: 10000,
|
|
426
|
+
headers: {
|
|
427
|
+
'Content-Type': 'application/json'
|
|
428
|
+
}
|
|
429
|
+
};
|
|
430
|
+
|
|
431
|
+
// Use specific API clients
|
|
432
|
+
const accountingClient = new AccountingAPI(baseConfig);
|
|
433
|
+
const inventoryClient = new InventoryAPI(baseConfig);
|
|
434
|
+
|
|
435
|
+
// Example usage
|
|
436
|
+
const users = await accountingClient.getUsers();
|
|
437
|
+
const products = await inventoryClient.getProducts();
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
## 🔧 Components
|
|
441
|
+
|
|
442
|
+
### Form Controls
|
|
443
|
+
|
|
444
|
+
```tsx
|
|
445
|
+
import {
|
|
446
|
+
TextField,
|
|
447
|
+
Select,
|
|
448
|
+
DatePicker,
|
|
449
|
+
Checkbox,
|
|
450
|
+
Radio,
|
|
451
|
+
ToggleSwitch,
|
|
452
|
+
Button
|
|
453
|
+
} from '@erpsquad/common/components';
|
|
454
|
+
|
|
455
|
+
// Text input
|
|
456
|
+
<TextField
|
|
457
|
+
label="Email"
|
|
458
|
+
type="email"
|
|
459
|
+
variant="outlined"
|
|
460
|
+
required
|
|
461
|
+
/>
|
|
462
|
+
|
|
463
|
+
// Select dropdown
|
|
464
|
+
<Select
|
|
465
|
+
label="Country"
|
|
466
|
+
options={countries}
|
|
467
|
+
value={selectedCountry}
|
|
468
|
+
onChange={handleCountryChange}
|
|
469
|
+
/>
|
|
470
|
+
|
|
471
|
+
// Date picker (requires @mui/x-date-pickers)
|
|
472
|
+
<DatePicker
|
|
473
|
+
label="Birth Date"
|
|
474
|
+
value={birthDate}
|
|
475
|
+
onChange={setBirthDate}
|
|
476
|
+
/>
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
### Data Display
|
|
480
|
+
|
|
481
|
+
```tsx
|
|
482
|
+
import {
|
|
483
|
+
MaterialTable,
|
|
484
|
+
Grid,
|
|
485
|
+
CardWrapper,
|
|
486
|
+
Avatar,
|
|
487
|
+
Chip
|
|
488
|
+
} from '@erpsquad/common/components';
|
|
489
|
+
|
|
490
|
+
// Data table (requires @mui/x-data-grid)
|
|
491
|
+
<MaterialTable
|
|
492
|
+
columns={columns}
|
|
493
|
+
data={data}
|
|
494
|
+
title="Users"
|
|
495
|
+
options={{
|
|
496
|
+
search: true,
|
|
497
|
+
pagination: true,
|
|
498
|
+
sorting: true
|
|
499
|
+
}}
|
|
500
|
+
/>
|
|
501
|
+
|
|
502
|
+
// Grid layout
|
|
503
|
+
<Grid container spacing={2}>
|
|
504
|
+
<Grid item xs={12} md={6}>
|
|
505
|
+
<CardWrapper>Content</CardWrapper>
|
|
506
|
+
</Grid>
|
|
507
|
+
</Grid>
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
### Navigation
|
|
511
|
+
|
|
512
|
+
```tsx
|
|
513
|
+
import {
|
|
514
|
+
Sidebar,
|
|
515
|
+
BreadCrumb,
|
|
516
|
+
Pagination,
|
|
517
|
+
Tabs
|
|
518
|
+
} from '@erpsquad/common/components';
|
|
519
|
+
|
|
520
|
+
// Sidebar navigation
|
|
521
|
+
<Sidebar
|
|
522
|
+
items={navigationItems}
|
|
523
|
+
collapsed={isCollapsed}
|
|
524
|
+
onItemClick={handleNavigation}
|
|
525
|
+
/>
|
|
526
|
+
|
|
527
|
+
// Breadcrumb (requires react-router-dom for navigation)
|
|
528
|
+
<BreadCrumb
|
|
529
|
+
items={[
|
|
530
|
+
{ label: 'Home', href: '/' },
|
|
531
|
+
{ label: 'Users', href: '/users' },
|
|
532
|
+
{ label: 'Profile' }
|
|
533
|
+
]}
|
|
534
|
+
/>
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
### Feedback
|
|
538
|
+
|
|
539
|
+
```tsx
|
|
540
|
+
import {
|
|
541
|
+
CustomSnackbar,
|
|
542
|
+
Toast,
|
|
543
|
+
Loader,
|
|
544
|
+
Alert,
|
|
545
|
+
Modal
|
|
546
|
+
} from '@erpsquad/common/components';
|
|
547
|
+
|
|
548
|
+
// Loading indicator
|
|
549
|
+
<Loader size="large" text="Loading data..." />
|
|
550
|
+
|
|
551
|
+
// Alert message
|
|
552
|
+
<Alert severity="success" onClose={handleClose}>
|
|
553
|
+
Operation completed successfully!
|
|
554
|
+
</Alert>
|
|
555
|
+
|
|
556
|
+
// Snackbar notification
|
|
557
|
+
<CustomSnackbar
|
|
558
|
+
open={isOpen}
|
|
559
|
+
message="Operation completed successfully!"
|
|
560
|
+
severity="success"
|
|
561
|
+
onClose={handleClose}
|
|
562
|
+
/>
|
|
563
|
+
|
|
564
|
+
// Modal dialog
|
|
565
|
+
<Modal
|
|
566
|
+
open={isOpen}
|
|
567
|
+
onClose={handleClose}
|
|
568
|
+
title="Confirm Action"
|
|
569
|
+
actions={[
|
|
570
|
+
{ label: 'Cancel', onClick: handleClose },
|
|
571
|
+
{ label: 'Confirm', onClick: handleConfirm, variant: 'contained' }
|
|
572
|
+
]}
|
|
573
|
+
>
|
|
574
|
+
Are you sure you want to proceed?
|
|
575
|
+
</Modal>
|
|
576
|
+
```
|
|
577
|
+
|
|
578
|
+
## 🔄 Redux Integration
|
|
579
|
+
|
|
580
|
+
The library provides flexible Redux integration that works with or without Redux. Requires `@reduxjs/toolkit` and `react-redux` peer dependencies.
|
|
581
|
+
|
|
582
|
+
### With Redux (Recommended for complex applications)
|
|
583
|
+
|
|
584
|
+
```tsx
|
|
585
|
+
import { ERPUIProvider } from '@erpsquad/common/contexts';
|
|
586
|
+
import {
|
|
587
|
+
createLibraryStore,
|
|
588
|
+
createConfiguredApiClient
|
|
589
|
+
} from '@erpsquad/common/redux';
|
|
590
|
+
import { ShareModal } from '@erpsquad/common/components';
|
|
591
|
+
|
|
592
|
+
// Configure API client
|
|
593
|
+
const apiClient = createConfiguredApiClient(baseApiClient, () => ({
|
|
594
|
+
authorization: `Bearer ${getAuthToken()}`
|
|
595
|
+
}));
|
|
596
|
+
|
|
597
|
+
// Create store with library slices
|
|
598
|
+
const store = createLibraryStore(
|
|
599
|
+
{
|
|
600
|
+
// Your app reducers
|
|
601
|
+
app: appReducer,
|
|
602
|
+
user: userReducer
|
|
603
|
+
},
|
|
604
|
+
apiClient
|
|
605
|
+
);
|
|
606
|
+
|
|
607
|
+
function App() {
|
|
608
|
+
return (
|
|
609
|
+
<ERPUIProvider useRedux={true} reduxStore={store} apiClient={apiClient}>
|
|
610
|
+
<ShareModal useRedux={true} />
|
|
611
|
+
</ERPUIProvider>
|
|
612
|
+
);
|
|
613
|
+
}
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
### Without Redux (Simpler applications)
|
|
617
|
+
|
|
618
|
+
```tsx
|
|
619
|
+
import { ERPUIProvider } from '@erpsquad/common/contexts';
|
|
620
|
+
import { ShareModal } from '@erpsquad/common/components';
|
|
621
|
+
|
|
622
|
+
function App() {
|
|
623
|
+
const [users, setUsers] = useState([]);
|
|
624
|
+
const [loading, setLoading] = useState(false);
|
|
625
|
+
|
|
626
|
+
const fetchUsers = async () => {
|
|
627
|
+
setLoading(true);
|
|
628
|
+
try {
|
|
629
|
+
const response = await api.getUsers();
|
|
630
|
+
setUsers(response.data);
|
|
631
|
+
} finally {
|
|
632
|
+
setLoading(false);
|
|
633
|
+
}
|
|
634
|
+
};
|
|
635
|
+
|
|
636
|
+
return (
|
|
637
|
+
<ERPUIProvider useRedux={false}>
|
|
638
|
+
<ShareModal
|
|
639
|
+
useRedux={false}
|
|
640
|
+
users={users}
|
|
641
|
+
loading={loading}
|
|
642
|
+
onFetchUsersAndDepartments={fetchUsers}
|
|
643
|
+
/>
|
|
644
|
+
</ERPUIProvider>
|
|
645
|
+
);
|
|
646
|
+
}
|
|
647
|
+
```
|
|
648
|
+
|
|
649
|
+
### Available Redux Slices
|
|
650
|
+
|
|
651
|
+
- **shareSlice**: User and department data for sharing functionality
|
|
652
|
+
- **headerSlice**: Language data and current language selection
|
|
653
|
+
- **reportsTitleBarSlice**: Company data for reports filtering
|
|
654
|
+
- **inventoryReportsTitleBarSlice**: Inventory-related data for reports
|
|
655
|
+
|
|
656
|
+
## 🪝 Hooks
|
|
657
|
+
|
|
658
|
+
### Custom Hooks
|
|
659
|
+
|
|
660
|
+
```tsx
|
|
661
|
+
import {
|
|
662
|
+
useAuth,
|
|
663
|
+
useLanguage,
|
|
664
|
+
usePermissions,
|
|
665
|
+
usePages,
|
|
666
|
+
useDeepMemo,
|
|
667
|
+
useReduxIntegration
|
|
668
|
+
} from '@erpsquad/common/hooks';
|
|
669
|
+
|
|
670
|
+
// Authentication hook
|
|
671
|
+
const { user, isAuthenticated, login, logout } = useAuth();
|
|
672
|
+
|
|
673
|
+
// Language hook (requires react-i18next)
|
|
674
|
+
const { currentLanguage, changeLanguage, t } = useLanguage();
|
|
675
|
+
|
|
676
|
+
// Permissions hook
|
|
677
|
+
const { hasPermission, checkPermission } = usePermissions();
|
|
678
|
+
|
|
679
|
+
// Deep memoization hook
|
|
680
|
+
const memoizedValue = useDeepMemo(() => expensiveCalculation(data), [data]);
|
|
681
|
+
```
|
|
682
|
+
|
|
683
|
+
### Redux Integration Hook
|
|
684
|
+
|
|
685
|
+
```tsx
|
|
686
|
+
import { useReduxIntegration } from '@erpsquad/common/hooks';
|
|
687
|
+
|
|
688
|
+
const MyComponent = ({ useRedux, ...props }) => {
|
|
689
|
+
const { data, loading, error, actions } = useReduxIntegration({
|
|
690
|
+
useRedux,
|
|
691
|
+
sliceName: 'share',
|
|
692
|
+
fallbackData: props.users,
|
|
693
|
+
fallbackLoading: props.loading,
|
|
694
|
+
fallbackActions: {
|
|
695
|
+
fetchData: props.onFetchUsers
|
|
696
|
+
}
|
|
697
|
+
});
|
|
698
|
+
|
|
699
|
+
// Component logic using unified interface
|
|
700
|
+
};
|
|
701
|
+
```
|
|
702
|
+
|
|
703
|
+
## 🛠️ Utilities
|
|
704
|
+
|
|
705
|
+
### Common Utilities
|
|
706
|
+
|
|
707
|
+
```tsx
|
|
708
|
+
import {
|
|
709
|
+
formatDate,
|
|
710
|
+
formatFileSize,
|
|
711
|
+
formatText,
|
|
712
|
+
deformatText,
|
|
713
|
+
colorUtils
|
|
714
|
+
} from '@erpsquad/common/utils';
|
|
715
|
+
|
|
716
|
+
// Date formatting (requires date-fns)
|
|
717
|
+
const formattedDate = formatDate(new Date(), 'dd/MM/yyyy');
|
|
718
|
+
|
|
719
|
+
// File size formatting
|
|
720
|
+
const fileSize = formatFileSize(1024000); // "1.02 MB"
|
|
721
|
+
|
|
722
|
+
// Text formatting
|
|
723
|
+
const formatted = formatText('hello world', 'title'); // "Hello World"
|
|
724
|
+
|
|
725
|
+
// Color utilities
|
|
726
|
+
const hexColor = colorUtils.rgbToHex(255, 0, 0); // "#ff0000"
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
## 🌐 Internationalization
|
|
730
|
+
|
|
731
|
+
Requires `react-i18next` and `i18next` peer dependencies.
|
|
732
|
+
|
|
733
|
+
### Language Provider
|
|
734
|
+
|
|
735
|
+
```tsx
|
|
736
|
+
import { ERPUIProvider } from '@erpsquad/common/contexts';
|
|
737
|
+
|
|
738
|
+
<ERPUIProvider
|
|
739
|
+
enableLanguage={true}
|
|
740
|
+
// Other props
|
|
741
|
+
>
|
|
742
|
+
<App />
|
|
743
|
+
</ERPUIProvider>;
|
|
744
|
+
```
|
|
745
|
+
|
|
746
|
+
### Using Translations
|
|
747
|
+
|
|
748
|
+
```tsx
|
|
749
|
+
import { useLanguage } from '@erpsquad/common/hooks';
|
|
750
|
+
|
|
751
|
+
const MyComponent = () => {
|
|
752
|
+
const { t, currentLanguage, changeLanguage } = useLanguage();
|
|
753
|
+
|
|
754
|
+
return (
|
|
755
|
+
<div>
|
|
756
|
+
<p>{t('common.welcome')}</p>
|
|
757
|
+
<button onClick={() => changeLanguage('es')}>Switch to Spanish</button>
|
|
758
|
+
</div>
|
|
759
|
+
);
|
|
760
|
+
};
|
|
761
|
+
```
|
|
762
|
+
|
|
763
|
+
## 🧪 Testing
|
|
764
|
+
|
|
765
|
+
The library includes comprehensive testing utilities:
|
|
766
|
+
|
|
767
|
+
```tsx
|
|
768
|
+
import { render, screen } from '@testing-library/react';
|
|
769
|
+
import { ERPUIProvider } from '@erpsquad/common/contexts';
|
|
770
|
+
import { Button } from '@erpsquad/common/components';
|
|
771
|
+
|
|
772
|
+
test('renders button correctly', () => {
|
|
773
|
+
render(
|
|
774
|
+
<ERPUIProvider>
|
|
775
|
+
<Button>Click me</Button>
|
|
776
|
+
</ERPUIProvider>
|
|
777
|
+
);
|
|
778
|
+
|
|
779
|
+
expect(screen.getByRole('button')).toBeInTheDocument();
|
|
780
|
+
});
|
|
781
|
+
```
|
|
782
|
+
|
|
783
|
+
## 📚 API Reference
|
|
784
|
+
|
|
785
|
+
### ERPUIProvider Props
|
|
786
|
+
|
|
787
|
+
| Prop | Type | Default | Description |
|
|
788
|
+
| ---------------- | ------------------- | ----------- | ------------------------ |
|
|
789
|
+
| `useRedux` | `boolean` | `false` | Enable Redux integration |
|
|
790
|
+
| `reduxStore` | `Store` | `undefined` | Custom Redux store |
|
|
791
|
+
| `apiClient` | `ApiClientConfig` | `undefined` | API client configuration |
|
|
792
|
+
| `themeMode` | `'light' \| 'dark'` | `'light'` | Theme mode |
|
|
793
|
+
| `primaryColor` | `string` | `undefined` | Primary theme color |
|
|
794
|
+
| `direction` | `'ltr' \| 'rtl'` | `'ltr'` | Text direction |
|
|
795
|
+
| `enableAuth` | `boolean` | `true` | Enable auth context |
|
|
796
|
+
| `enableLanguage` | `boolean` | `true` | Enable language context |
|
|
797
|
+
| `enableRouter` | `boolean` | `false` | Enable router provider |
|
|
798
|
+
| `enableSnackbar` | `boolean` | `true` | Enable snackbar provider |
|
|
799
|
+
|
|
800
|
+
### Component Props
|
|
801
|
+
|
|
802
|
+
All components extend their respective Material-UI component props with additional ERP-specific functionality. Refer to individual component documentation for detailed prop information.
|
|
803
|
+
|
|
804
|
+
## 🔧 Development
|
|
805
|
+
|
|
806
|
+
### Building the Library
|
|
807
|
+
|
|
808
|
+
```bash
|
|
809
|
+
# Production build
|
|
810
|
+
npm run build
|
|
811
|
+
|
|
812
|
+
# Build with analysis
|
|
813
|
+
npm run build:analyze
|
|
814
|
+
|
|
815
|
+
# Build with validation
|
|
816
|
+
npm run build:validate
|
|
817
|
+
|
|
818
|
+
# Clean build artifacts
|
|
819
|
+
npm run clean
|
|
820
|
+
```
|
|
821
|
+
|
|
822
|
+
### Running Tests
|
|
823
|
+
|
|
824
|
+
```bash
|
|
825
|
+
# Run all tests
|
|
826
|
+
npm test
|
|
827
|
+
|
|
828
|
+
# Run tests in CI mode
|
|
829
|
+
npm run test:ci
|
|
830
|
+
|
|
831
|
+
# Type checking
|
|
832
|
+
npm run type-check
|
|
833
|
+
|
|
834
|
+
# Linting
|
|
835
|
+
npm run lint
|
|
836
|
+
npm run lint:fix
|
|
837
|
+
```
|
|
838
|
+
|
|
839
|
+
### Package Validation
|
|
840
|
+
|
|
841
|
+
```bash
|
|
842
|
+
# Validate package structure
|
|
843
|
+
npm run validate:package
|
|
844
|
+
|
|
845
|
+
# Check bundle size limits
|
|
846
|
+
npm run size-check
|
|
847
|
+
|
|
848
|
+
# Full validation (lint + type-check + test + build)
|
|
849
|
+
npm run validate
|
|
850
|
+
```
|
|
851
|
+
|
|
852
|
+
## 📈 Bundle Analysis
|
|
853
|
+
|
|
854
|
+
```bash
|
|
855
|
+
# Analyze bundle size and composition
|
|
856
|
+
npm run build:analyze
|
|
857
|
+
|
|
858
|
+
# Check size limits against configuration
|
|
859
|
+
npm run size-check
|
|
860
|
+
|
|
861
|
+
# Validate package contents before publishing
|
|
862
|
+
npm run validate:package
|
|
863
|
+
```
|
|
864
|
+
|
|
865
|
+
## 🚨 Troubleshooting
|
|
866
|
+
|
|
867
|
+
### Common Issues
|
|
868
|
+
|
|
869
|
+
#### ⚠️ Components Have No Styling
|
|
870
|
+
|
|
871
|
+
**Problem**: Components render but have no styling / look unstyled.
|
|
872
|
+
|
|
873
|
+
**Solution**: You MUST import the CSS file in your application:
|
|
874
|
+
|
|
875
|
+
```tsx
|
|
876
|
+
// In your main file (main.tsx, App.tsx, or index.tsx)
|
|
877
|
+
import '@erpsquad/common/style.css'; // 👈 Add this!
|
|
878
|
+
|
|
879
|
+
// Then import components
|
|
880
|
+
import { Button } from '@erpsquad/common/components';
|
|
881
|
+
```
|
|
882
|
+
|
|
883
|
+
**Why**: Component styles are bundled separately for optimal tree-shaking and loading performance. The CSS file must be explicitly imported once in your application entry point.
|
|
884
|
+
|
|
885
|
+
#### Import Errors
|
|
886
|
+
|
|
887
|
+
```bash
|
|
888
|
+
# Error: Cannot resolve '@erpsquad/common/components'
|
|
889
|
+
# Solution: Install required peer dependencies
|
|
890
|
+
npm install @mui/material @emotion/react @emotion/styled
|
|
891
|
+
|
|
892
|
+
# Error: Module not found
|
|
893
|
+
# Solution: Use correct import paths
|
|
894
|
+
import { Button } from '@erpsquad/common/components'; // ✅ Correct
|
|
895
|
+
import { Button } from '@erpsquad/common'; // ❌ Incorrect for components
|
|
896
|
+
```
|
|
897
|
+
|
|
898
|
+
#### Peer Dependency Warnings
|
|
899
|
+
|
|
900
|
+
```bash
|
|
901
|
+
# Warning: peer dependency not installed
|
|
902
|
+
# Solution: Install the specific peer dependency
|
|
903
|
+
npm install react-redux @reduxjs/toolkit
|
|
904
|
+
|
|
905
|
+
# Or install all peer dependencies
|
|
906
|
+
npm install react react-dom @mui/material @emotion/react @emotion/styled @mui/icons-material
|
|
907
|
+
```
|
|
908
|
+
|
|
909
|
+
#### TypeScript Errors
|
|
910
|
+
|
|
911
|
+
```bash
|
|
912
|
+
# Error: Cannot find type definitions
|
|
913
|
+
# Solution: Ensure TypeScript types are properly imported
|
|
914
|
+
import type { LibraryConfig } from '@erpsquad/common';
|
|
915
|
+
|
|
916
|
+
# Error: Module has no exported member
|
|
917
|
+
# Solution: Check if the export requires peer dependencies
|
|
918
|
+
import { useAuth } from '@erpsquad/common/hooks'; // Requires React
|
|
919
|
+
```
|
|
920
|
+
|
|
921
|
+
#### Build Issues
|
|
922
|
+
|
|
923
|
+
```bash
|
|
924
|
+
# Error: Module not found during build
|
|
925
|
+
# Solution: Check if all peer dependencies are installed
|
|
926
|
+
# and properly configured in your build tool
|
|
927
|
+
|
|
928
|
+
# For Vite projects, add to vite.config.ts:
|
|
929
|
+
export default defineConfig({
|
|
930
|
+
optimizeDeps: {
|
|
931
|
+
include: ['@erpsquad/common']
|
|
932
|
+
}
|
|
933
|
+
});
|
|
934
|
+
|
|
935
|
+
# For Webpack projects, ensure proper externals configuration
|
|
936
|
+
```
|
|
937
|
+
|
|
938
|
+
### Getting Help
|
|
939
|
+
|
|
940
|
+
- Check the [troubleshooting guide](./TROUBLESHOOTING.md)
|
|
941
|
+
- Review [migration documentation](./MIGRATION.md)
|
|
942
|
+
- Search [existing issues](https://github.com/erpforce/common/issues)
|
|
943
|
+
- Create a [new issue](https://github.com/erpforce/common/issues/new)
|
|
944
|
+
|
|
945
|
+
## 🤝 Contributing
|
|
946
|
+
|
|
947
|
+
1. Fork the repository
|
|
948
|
+
2. Create a feature branch: `git checkout -b feature/new-component`
|
|
949
|
+
3. Make your changes and add tests
|
|
950
|
+
4. Run tests: `npm test`
|
|
951
|
+
5. Run linting: `npm run lint`
|
|
952
|
+
6. Commit your changes: `git commit -m 'Add new component'`
|
|
953
|
+
7. Push to the branch: `git push origin feature/new-component`
|
|
954
|
+
8. Submit a pull request
|
|
955
|
+
|
|
956
|
+
### Development Guidelines
|
|
957
|
+
|
|
958
|
+
- Follow TypeScript best practices
|
|
959
|
+
- Write comprehensive tests for new components
|
|
960
|
+
- Update documentation for API changes
|
|
961
|
+
- Ensure accessibility compliance
|
|
962
|
+
- Maintain backward compatibility
|
|
963
|
+
|
|
964
|
+
## 📄 License
|
|
965
|
+
|
|
966
|
+
MIT License - see the [LICENSE](LICENSE) file for details.
|
|
967
|
+
|
|
968
|
+
## 🆘 Support
|
|
969
|
+
|
|
970
|
+
- **Documentation**: [Library Docs](https://github.com/erpforce/erpforce-common-hub-fe/tree/dev#readme)
|
|
971
|
+
- **Issues**: [GitHub Issues](https://github.com/erpforce/erpforce-common-hub-fe/issues)
|
|
972
|
+
- **NPM Package**: [@erpsquad/common](https://www.npmjs.com/package/@erpsquad/common)
|
|
973
|
+
- **Changelog**: [CHANGELOG.md](./CHANGELOG.md)
|
|
974
|
+
- **Migration Guide**: [MIGRATION.md](./MIGRATION.md)
|
|
975
|
+
- **Troubleshooting**: [TROUBLESHOOTING.md](./TROUBLESHOOTING.md)
|
|
976
|
+
|
|
977
|
+
## 📋 Changelog
|
|
978
|
+
|
|
979
|
+
See [CHANGELOG.md](CHANGELOG.md) for a detailed list of changes and version history.
|