@workday/canvas-kit-docs
Version:
Documentation components of Canvas Kit components
10 lines (9 loc) • 1.27 kB
JavaScript
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { PropertiesTable, registerWidget, Value } from '../Value';
import { Heading } from '../widgetUtils';
registerWidget('model', ({ value }) => {
return (_jsxs(_Fragment, { children: [_jsx(Heading, { children: "State" }), _jsx(PropertiesTable, { properties: value.state, showDefault: false }), _jsx(Heading, { children: "Events" }), _jsx(PropertiesTable, { properties: value.events, showDefault: false }), value.modelProperties.length > 0 && (_jsxs(_Fragment, { children: [_jsx(Heading, { children: "Additional Properties" }), _jsx(PropertiesTable, { properties: value.modelProperties, showDefault: false })] }))] }));
});
registerWidget('modelHook', ({ value, doc }) => {
return (_jsxs("code", { children: [_jsx("span", { className: "token symbol", children: value.name }), ' ', _jsx("span", { className: "token punctuation", children: "(" }), _jsx("span", { className: "value symbol", children: "config" }), ":", ' ', _jsx(Value, { value: { kind: 'symbol', name: `${value.name.replace('use', '')}Config` } }), _jsx("span", { className: "token punctuation", children: "): " }), _jsx(Value, { value: { kind: 'symbol', name: `${value.name.replace('use', '')}` } })] }));
});