0.0.36 • Published 3 months ago
@prestojs/ui v0.0.36
UI
Base types and components for UI integration with prestojs.
To use wrap your app with the UiProvider
:
import { render } from 'react-dom';
import { UiProvider } from '@prestojs/ui';
import { getWidgetForField as getDateWidget } from 'customdatepackage';
import { getWidgetForField as getAntdWidget } from '@prestojs/ui-antd';
import App from './App';
function getWidgetForField(field) {
// Add any app specific customisations here
if (field instanceof BooleanField) {
return CustomBooleanWidget;
}
// Otherwise fall back to specific UI library defaults
let widget;
if ((widget = getDateWidget(field))) return widget;
if ((widget = getAntdWidget(field))) return widget;
// Fall through to any parent UiProvider. If there is none or they
// don't provide a widget for this field then an error will be thrown
}
render(
<UiProvider getWidgetForField={getWidgetFromField}>
<App />
</UiProvider>,
document.getElementById('root')
);
0.0.36
3 months ago
0.0.35
3 months ago
0.0.34
2 years ago
0.0.32
2 years ago
0.0.33
2 years ago
0.0.31
2 years ago
0.0.30
2 years ago
0.0.28
2 years ago
0.0.29
2 years ago
0.0.25
2 years ago
0.0.26
2 years ago
0.0.27
2 years ago
0.0.22
3 years ago
0.0.23
2 years ago
0.0.24
2 years ago
0.0.21
3 years ago
0.0.20
3 years ago
0.0.19
3 years ago
0.0.18
3 years ago
0.0.17
3 years ago
0.0.16
3 years ago
0.0.15
3 years ago
0.0.14
3 years ago
0.0.13
3 years ago
0.0.12
3 years ago
0.0.11
3 years ago
0.0.10
3 years ago
0.0.9
3 years ago
0.0.8
4 years ago
0.0.7
4 years ago
0.0.6
4 years ago
0.0.5
4 years ago
0.0.4
4 years ago
0.0.3
4 years ago
0.0.2
4 years ago
0.0.1
4 years ago