@vention/machine-apps-components 1.31.10 → 1.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -0
- package/index.esm.js +273 -1955
- package/layout.d.ts +1 -0
- package/layout.esm.js +4 -0
- package/package.json +16 -3
- package/page-load-error.esm.js +1794 -0
- package/src/entries/layout.d.ts +4 -0
- package/src/index.d.ts +3 -0
- package/src/lib/load-state/load-state.d.ts +23 -0
- package/src/lib/page-load-error/page-load-error.d.ts +8 -0
- package/src/lib/page-loading/page-loading.d.ts +1 -0
package/README.md
CHANGED
|
@@ -811,6 +811,36 @@ import { LogsPagination } from "@vention/machine-apps-components"
|
|
|
811
811
|
;<LogsPagination currentPage={currentPage} totalPages={totalPages} onPageChange={page => setCurrentPage(page)} />
|
|
812
812
|
```
|
|
813
813
|
|
|
814
|
+
### Layout and page states
|
|
815
|
+
|
|
816
|
+
`FlexContainer`, `LoadState`, `PageLoading` and `PageLoadError`. They're also exported from
|
|
817
|
+
`@vention/machine-apps-components/layout`, which doesn't run the root entry's i18n setup. Apps with their own
|
|
818
|
+
i18next instance import them from there.
|
|
819
|
+
|
|
820
|
+
```tsx
|
|
821
|
+
import { LoadState, PageLoadError } from "@vention/machine-apps-components/layout"
|
|
822
|
+
|
|
823
|
+
<LoadState
|
|
824
|
+
isLoading={isLoading}
|
|
825
|
+
isError={isError}
|
|
826
|
+
setupError={setupError}
|
|
827
|
+
onRetry={refetch}
|
|
828
|
+
isEmpty={devices.length === 0}
|
|
829
|
+
errorText={t("devices.loadFailed")}
|
|
830
|
+
emptyText={t("devices.empty")}
|
|
831
|
+
retryText={t("retry")}
|
|
832
|
+
>
|
|
833
|
+
<DeviceList devices={devices} />
|
|
834
|
+
</LoadState>
|
|
835
|
+
|
|
836
|
+
<PageLoadError message={t("device.loadFailed")} actionText={t("goBack")} onAction={() => navigate("/")} />
|
|
837
|
+
```
|
|
838
|
+
|
|
839
|
+
- `LoadState`: a spinner while loading, `errorText` with the backend's `setupError` or a retry button, `emptyText`
|
|
840
|
+
when empty, otherwise its children.
|
|
841
|
+
- `PageLoading`: a centered spinner that fills the page.
|
|
842
|
+
- `PageLoadError`: a full-page message with one action.
|
|
843
|
+
|
|
814
844
|
## Development
|
|
815
845
|
|
|
816
846
|
### Running Tests
|