@chobantonov/jsonforms-react-antd-extended-renderers 0.0.0-stage → 0.1.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.
Files changed (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +46 -2
  3. package/lib/cells/asCell.d.ts +32 -0
  4. package/lib/components/AntdArrayFrame.d.ts +8 -0
  5. package/lib/components/AntdEditorButton.d.ts +10 -0
  6. package/lib/components/AntdEditorFrame.d.ts +3 -0
  7. package/lib/components/AntdEditorLoading.d.ts +8 -0
  8. package/lib/components/AntdEditorSurface.d.ts +7 -0
  9. package/lib/components/AntdMaskInput.d.ts +40 -0
  10. package/lib/components/PickerFormItem.d.ts +6 -0
  11. package/lib/hooks/useAntdEditorTheme.d.ts +8 -0
  12. package/lib/index.d.ts +45 -0
  13. package/lib/jsonforms-react-antd-extended.cjs.js +2 -0
  14. package/lib/jsonforms-react-antd-extended.cjs.js.map +1 -0
  15. package/lib/jsonforms-react-antd-extended.esm.js +906 -0
  16. package/lib/jsonforms-react-antd-extended.esm.js.map +1 -0
  17. package/lib/renderers/AntdAgGridControlRenderer.d.ts +2 -0
  18. package/lib/renderers/AntdButtonRenderer.d.ts +3 -0
  19. package/lib/renderers/AntdColorControlRenderer.d.ts +30 -0
  20. package/lib/renderers/AntdCronControlRenderer.d.ts +43 -0
  21. package/lib/renderers/AntdDurationControlRenderer.d.ts +5 -0
  22. package/lib/renderers/AntdMarkupLabelRenderer.d.ts +18 -0
  23. package/lib/renderers/AntdMaskControlRenderer.d.ts +9 -0
  24. package/lib/renderers/AntdMonacoControlRenderer.d.ts +1 -0
  25. package/lib/renderers/AntdNullControlRenderer.d.ts +5 -0
  26. package/lib/renderers/AntdSplitLayoutRenderer.d.ts +6 -0
  27. package/lib/renderers/index.d.ts +8 -0
  28. package/lib/util/colorFormat.d.ts +11 -0
  29. package/package.json +78 -3
  30. package/src/cells/asCell.tsx +47 -0
  31. package/src/components/AntdArrayFrame.tsx +69 -0
  32. package/src/components/AntdEditorButton.tsx +37 -0
  33. package/src/components/AntdEditorFrame.tsx +16 -0
  34. package/src/components/AntdEditorLoading.tsx +13 -0
  35. package/src/components/AntdEditorSurface.tsx +52 -0
  36. package/src/components/AntdMaskInput.tsx +95 -0
  37. package/src/components/PickerFormItem.tsx +23 -0
  38. package/src/hooks/useAntdEditorTheme.ts +63 -0
  39. package/src/index.tsx +166 -0
  40. package/src/renderers/AntdAgGridControlRenderer.tsx +56 -0
  41. package/src/renderers/AntdButtonRenderer.tsx +49 -0
  42. package/src/renderers/AntdColorControlRenderer.tsx +313 -0
  43. package/src/renderers/AntdCronControlRenderer.tsx +393 -0
  44. package/src/renderers/AntdDurationControlRenderer.tsx +274 -0
  45. package/src/renderers/AntdMarkupLabelRenderer.tsx +27 -0
  46. package/src/renderers/AntdMaskControlRenderer.tsx +19 -0
  47. package/src/renderers/AntdMonacoControlRenderer.tsx +21 -0
  48. package/src/renderers/AntdNullControlRenderer.tsx +70 -0
  49. package/src/renderers/AntdSplitLayoutRenderer.tsx +122 -0
  50. package/src/renderers/index.ts +8 -0
  51. package/src/util/colorFormat.ts +42 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsonforms-react-antd-extended.esm.js","names":["_Fragment","antTheme","antTheme","antTheme","antTheme","antTheme","React","ScheduleOutlined","ClockCircleOutlined","CloseOutlined","_objectWithoutPropertiesLoose","r","t","n","e","_objectWithoutProperties","o","s","_typeof","toPrimitive","i","toPropertyKey","_defineProperty","ownKeys","_objectSpread2","_excluded$1","_excluded2","AntdEditorButton","_ref","props","Button","variant","AntdEditorToggleButton","_variant","_ref2","Typography","AntdArrayFrame","ArrayPanel","label","Fragment","Row","Col","Title","ValidationIcon","errors","description","Card","actions","Tooltip","action","_excluded","AntdEditorFrame","ControlFormItem","AntdEditorLoading","Skeleton","AntdEditorLoadError","Alert","useAntdEditorTheme","_token$colorBorderSec","_token$colorFillAlter","_token$colorTextHeadi","theme","isDark","firstColor","token","candidates","value","_color$match","color","rgb","hexToRgb","hex","full","c","useAgGridRemoveConfirmation","createDeleteConfirmation","useConfirmation","AntdAgGridControlRenderer","createAgGridControlRenderer","message","EditOutlined","EyeOutlined","EyeInvisibleOutlined","ConnectedCellFrame","PlusOutlined","DeleteOutlined","AntdMonacoControlRenderer","createMonacoControlRenderer","FullscreenOutlined","FullscreenExitOutlined","borderColor","invalid","focused","hovered","disabled","maximized","antdButtonRendererTester","buttonRendererTester","COLORS","AntdButtonRenderer","createButtonRenderer","_uischema$options","_COLORS$color","pending","uischema","pickerFormatFor","format","antdColorControlTester","extendedColorTester","toRgba","a","AntdColorControl","_shared$placeholder","useI18n","filteredErrors","onBlurTouch","usePreTouchErrors","useExtendedTranslator","refused","setRefused","useState","panelFormat","setPanelFormat","useClearAffordance","options","shared","clearable","saveFormat","asColorSaveFormat","resolveExtendedOption","DEFAULT_COLOR_SAVE_FORMAT","textEntry","commit","next","commitColor","serializeColor","normalize","parsed","parseColor","guidance","cssColor","toCssColor","swatch","size","savedPanelFormat","picker","ColorPicker","open","panel","Input","allowClear","affordanceProps","placeholderKeyFor","event","AntdColorControlRenderer","withJsonFormsControlProps","PickerFormItem","error","antdCronControlTester","rankWith","and","isStringControl","or","formatIs","uiTypeIs","optionIs","periods","labelColumn","FieldPicker","name","field","values","parseField","text","low","high","FIELD_RANGE","addon","Space","AntdClearableInput","onChange","clear","selected","Select","index","labelFor","formatField","AntdCronControl","useCronPicker","Flex","period","each","changePeriod","shownFields","_draft$CRON_FIELDS$in","draft","CRON_FIELDS","changeField","hasCustomField","changeText","DEFAULT_CRON","editedProblem","showActions","setOpen","accept","localError","_options$placeholder","expression","Popover","openOn","AntdCronControlRenderer","antdDurationControlTester","fieldLabelKeys","AntdDurationControl","_t","_t2","_state$options$placeh","state","useDurationControl","parts","unitColumn","durationComponentFields","Segmented","InputNumber","durationFieldMax","AntdDurationControlRenderer","AntdMaskInput","_appliedUiSchemaOptio","inputRef","useRef","getInput","useCallback","_inputRef$current","useMaskedInput","appliedUiSchemaOptions","display","enabled","settings","inputProps","antdMaskControlTester","extendedMaskTester","AntdMaskControl","InputControl","AntdMaskControlRenderer","antdNullControlTester","schemaMatches","schema","AntdNullControl","Checkbox","AntdNullControlRenderer","hasAntdSplitLayoutVariant","_uischema$options$var","antdSplitLayoutTester","AntdSplitLayout","_splitCssSize","layout","vertical","elements","useEffectiveElements","shares","initialSplitSizes","resizable","Splitter","splitCssSize","JsonFormsDispatch","element","AntdSplitLayoutRenderer","withJsonFormsLayoutProps","AntdMarkupLabelRenderer","createMarkupLabelRenderer","asCell","_Control$displayName","Cell","Control","createAntdExtendedRenderers","extendedAgGridTester","monacoControlTester","markupLabelTester","createExtendedRenderers","antdExtendedRenderers","createAntdExtendedCells","antdExtendedCells","advancedAntdRenderers","COLOR_SAVE_FORMATS","DEFAULT_MASK_SETTINGS","DEFAULT_MASK_TOKENS","EMPTY_DURATION","MASKA_DEFAULT_TOKENS","codePointLength","compileTokenPattern","createMask","displayValue","fitsMask","formatDuration","hsbToRgb","hslToRgb","isColor","isTransparent","maskEdit","nextCaret","normalizeHue","parseDuration","resolveMaskSettings","rgbToHsb","storedValue","toMaskTokens","withinMaxLength"],"sources":["../src/components/AntdEditorButton.tsx","../src/components/AntdArrayFrame.tsx","../src/components/AntdEditorFrame.tsx","../src/components/AntdEditorLoading.tsx","../src/hooks/useAntdEditorTheme.ts","../src/renderers/AntdAgGridControlRenderer.tsx","../src/components/AntdEditorSurface.tsx","../src/renderers/AntdMonacoControlRenderer.tsx","../src/renderers/AntdButtonRenderer.tsx","../src/util/colorFormat.ts","../src/renderers/AntdColorControlRenderer.tsx","../src/components/PickerFormItem.tsx","../src/renderers/AntdCronControlRenderer.tsx","../src/renderers/AntdDurationControlRenderer.tsx","../src/components/AntdMaskInput.tsx","../src/renderers/AntdMaskControlRenderer.tsx","../src/renderers/AntdNullControlRenderer.tsx","../src/renderers/AntdSplitLayoutRenderer.tsx","../src/renderers/AntdMarkupLabelRenderer.tsx","../src/cells/asCell.tsx","../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport { Button } from 'antd';\nimport type { EditorActionProps } from '@chobantonov/jsonforms-react-extended-renderers';\n\n/**\n * Maps the renderer-agnostic action props onto antd's Button.\n * Follows Ant Design Pro's toolbar convention: the primary action carries an\n * icon and a label, destructive ones are icon-only with a tooltip.\n */\nexport const AntdEditorButton = ({\n variant,\n icon,\n children,\n ...props\n}: EditorActionProps) => (\n <Button\n {...props}\n icon={icon}\n type={variant === 'primary' ? 'primary' : 'default'}\n danger={variant === 'danger'}\n >\n {children}\n </Button>\n);\n\n/** Borderless variant used for the editor's maximize/restore toggle. */\nexport const AntdEditorToggleButton = ({\n icon,\n children,\n // our own union; antd's Button has an unrelated `variant` prop\n variant: _variant,\n ...props\n}: EditorActionProps) => (\n <Button {...props} icon={icon} type='text' size='small'>\n {children}\n </Button>\n);\n","import React from 'react';\nimport { Button, Card, Col, Row, Tooltip, Typography } from 'antd';\nimport {\n ArrayPanel,\n ValidationIcon,\n} from '@chobantonov/jsonforms-react-antd-renderers';\nimport type { EditorArrayFrameProps } from '@chobantonov/jsonforms-react-extended-renderers';\n\nconst { Title } = Typography;\n\n/**\n * Mirrors ArrayLayoutToolbar from the antd renderer set so grid-backed arrays\n * and the regular array renderers share one header: title with the validation\n * indicator beside it, circular icon actions with tooltips on the right.\n */\nexport const AntdArrayFrame = ({\n options,\n config,\n label,\n description,\n errors,\n actions = [],\n children,\n}: EditorArrayFrameProps) => (\n <ArrayPanel\n options={options}\n config={config}\n panelLabel={label}\n style={{ width: '100%' }}\n size='small'\n type='inner'\n title={\n <>\n <Row align='middle'>\n <Col>\n <Title level={5} style={{ marginBottom: 0 }}>\n {label}\n </Title>\n </Col>\n <Col style={{ paddingLeft: 8 }}>\n <ValidationIcon\n local\n id='tooltip-validation'\n errorMessages={errors ?? ''}\n />\n </Col>\n </Row>\n {description && <Card.Meta description={description} />}\n </>\n }\n extra={actions.map((action) => (\n <Tooltip key={action.key} title={action.label} placement='bottom'>\n {/* span keeps the tooltip working while the button is disabled */}\n <span style={{ display: 'inline-flex' }}>\n <Button\n disabled={action.disabled}\n danger={action.danger}\n aria-label={action.label}\n onClick={action.onClick}\n shape='circle'\n icon={action.icon}\n />\n </span>\n </Tooltip>\n ))}\n >\n {children}\n </ArrayPanel>\n);\n","import { ControlFormItem } from '@chobantonov/jsonforms-react-antd-renderers';\nimport React from 'react';\nimport { EditorControlFrameProps } from '@chobantonov/jsonforms-react-extended-renderers';\nexport const AntdEditorFrame = ({\n children,\n ...props\n}: EditorControlFrameProps) => (\n <ControlFormItem\n label={props.label}\n required={props.required}\n errors={props.errors || undefined}\n help={props.errors || props.description}\n >\n {children}\n </ControlFormItem>\n);\n","import React from 'react';\nimport { Alert, Skeleton } from 'antd';\n\n/** Placeholder while a lazily loaded control (Monaco, AG Grid) is fetched. */\nexport const AntdEditorLoading = ({ label }: { label?: string }) => (\n <Skeleton.Node active style={{ width: '100%', height: 120 }}>\n <span style={{ fontSize: 12 }}>{label}</span>\n </Skeleton.Node>\n);\n\nexport const AntdEditorLoadError = ({ label }: { label?: string }) => (\n <Alert type='error' showIcon message={label} />\n);\n","import { theme as antTheme } from 'antd';\nimport type { EditorTheme } from '@chobantonov/jsonforms-react-extended-renderers';\n\n/**\n * antd exposes no `isDark` flag, but `colorBgBase` is the seed background the\n * active algorithm sets (#fff for defaultAlgorithm, #000 for darkAlgorithm), so\n * its luminance is an exact read of the configured theme - unlike inspecting the\n * DOM it works even when the host paints no background of its own.\n */\nexport const useAntdEditorTheme = (): EditorTheme => {\n const { token } = antTheme.useToken();\n // antd's seed leaves colorBgBase as '' unless the host sets it, and the\n // algorithms do not fill it in - so `??` is not enough, empty strings have to\n // be skipped too. colorBgContainer is always a real color.\n const base = firstColor(token.colorBgBase, token.colorBgContainer);\n return {\n isDark: isDark(base),\n background: token.colorBgContainer,\n foreground: token.colorText,\n border: token.colorBorderSecondary ?? token.colorBorder,\n accent: token.colorPrimary,\n headerBackground: token.colorFillAlter ?? token.colorFillQuaternary,\n headerForeground: token.colorTextHeading ?? token.colorText,\n rowHover: token.controlItemBgHover,\n selectedRowBackground: token.controlItemBgActive,\n fontFamily: token.fontFamily,\n };\n};\n\nconst firstColor = (...candidates: unknown[]): string | undefined =>\n candidates.find(\n (value): value is string =>\n typeof value === 'string' && value.trim() !== '',\n );\n\nconst isDark = (color: unknown): boolean | undefined => {\n if (typeof color !== 'string') return undefined;\n const rgb = color.startsWith('#')\n ? hexToRgb(color)\n : color\n .match(/[\\d.]+/g)\n ?.map(Number)\n .slice(0, 3);\n if (!rgb || rgb.length < 3) return undefined;\n return rgb[0] * 0.299 + rgb[1] * 0.587 + rgb[2] * 0.114 < 128;\n};\n\nconst hexToRgb = (hex: string): number[] | undefined => {\n const value = hex.replace('#', '');\n const full =\n value.length === 3\n ? value\n .split('')\n .map((c) => c + c)\n .join('')\n : value;\n if (full.length < 6) return undefined;\n return [\n parseInt(full.slice(0, 2), 16),\n parseInt(full.slice(2, 4), 16),\n parseInt(full.slice(4, 6), 16),\n ];\n};\n","import { createDeleteConfirmation } from '@chobantonov/jsonforms-react-renderer-common/interaction/createDeleteConfirmation';\nimport React from 'react';\nimport {\n ValidationIcon,\n ConnectedCellFrame,\n RowDetailFrame,\n useConfirmation,\n} from '@chobantonov/jsonforms-react-antd-renderers';\nimport { createAgGridControlRenderer } from '@chobantonov/jsonforms-react-extended-renderers';\nimport {\n DeleteOutlined,\n PlusOutlined,\n EditOutlined,\n EyeOutlined,\n EyeInvisibleOutlined,\n} from '@ant-design/icons';\nimport { AntdEditorButton } from '../components/AntdEditorButton';\nimport { AntdArrayFrame } from '../components/AntdArrayFrame';\nimport { AntdEditorFrame } from '../components/AntdEditorFrame';\nimport {\n AntdEditorLoadError,\n AntdEditorLoading,\n} from '../components/AntdEditorLoading';\nimport { useAntdEditorTheme } from '../hooks/useAntdEditorTheme';\n/**\n * The grid's own confirmation, supplied from this side of the boundary.\n *\n * The agnostic renderer knows only that something would be discarded; the\n * catalog id - `agGrid`, section 14's name for this renderer - belongs here,\n * with the renderer set that actually registers it. That keeps the\n * framework-agnostic package free of both antd and the policy vocabulary.\n */\nconst useAgGridRemoveConfirmation = createDeleteConfirmation(\n useConfirmation,\n 'agGrid',\n);\n\nexport const AntdAgGridControlRenderer = createAgGridControlRenderer({\n RowErrorIndicator: ({ message }) => (\n <ValidationIcon errorMessages={message} id={React.useId()} />\n ),\n Frame: AntdEditorFrame,\n RowDetailFrame,\n EditIcon: EditOutlined,\n ShowDetailsIcon: EyeOutlined,\n HideDetailsIcon: EyeInvisibleOutlined,\n ArrayFrame: AntdArrayFrame,\n CellFrame: ConnectedCellFrame,\n Button: AntdEditorButton,\n AddIcon: PlusOutlined,\n RemoveIcon: DeleteOutlined,\n useEditorTheme: useAntdEditorTheme,\n Loading: AntdEditorLoading,\n LoadError: AntdEditorLoadError,\n useRemoveConfirmation: useAgGridRemoveConfirmation,\n});\n","import React from 'react';\nimport { theme as antTheme } from 'antd';\nimport type { EditorSurfaceProps } from '@chobantonov/jsonforms-react-extended-renderers';\n\n/**\n * Chrome matching antd's Input.TextArea: same border, radius, background and\n * hover/focus/error transitions, with the editor in place of the textarea.\n */\nexport const AntdEditorSurface = ({\n children,\n hovered,\n focused,\n disabled,\n invalid,\n maximized,\n}: EditorSurfaceProps) => {\n const { token } = antTheme.useToken();\n const borderColor = invalid\n ? focused || hovered\n ? token.colorErrorBorderHover\n : token.colorError\n : disabled\n ? token.colorBorder\n : focused\n ? token.colorPrimary\n : hovered\n ? token.colorPrimaryHover\n : token.colorBorder;\n return (\n <div\n style={{\n position: 'relative',\n height: maximized ? '100%' : undefined,\n overflow: 'hidden',\n boxSizing: 'border-box',\n border: `${token.lineWidth}px ${token.lineType} ${borderColor}`,\n borderRadius: token.borderRadius,\n background: disabled\n ? token.colorBgContainerDisabled\n : token.colorBgContainer,\n boxShadow: focused\n ? `0 0 0 ${token.controlOutlineWidth}px ${\n invalid ? token.colorErrorOutline : token.controlOutline\n }`\n : undefined,\n transition: `border-color ${token.motionDurationMid}, box-shadow ${token.motionDurationMid}`,\n }}\n >\n {children}\n </div>\n );\n};\n","import { createMonacoControlRenderer } from '@chobantonov/jsonforms-react-extended-renderers';\nimport { FullscreenExitOutlined, FullscreenOutlined } from '@ant-design/icons';\nimport { AntdEditorToggleButton } from '../components/AntdEditorButton';\nimport { AntdEditorFrame } from '../components/AntdEditorFrame';\nimport {\n AntdEditorLoadError,\n AntdEditorLoading,\n} from '../components/AntdEditorLoading';\nimport { AntdEditorSurface } from '../components/AntdEditorSurface';\nimport { useAntdEditorTheme } from '../hooks/useAntdEditorTheme';\n\nexport const AntdMonacoControlRenderer = createMonacoControlRenderer({\n Frame: AntdEditorFrame,\n Button: AntdEditorToggleButton,\n MaximizeIcon: FullscreenOutlined,\n MinimizeIcon: FullscreenExitOutlined,\n Surface: AntdEditorSurface,\n useEditorTheme: useAntdEditorTheme,\n Loading: AntdEditorLoading,\n LoadError: AntdEditorLoadError,\n});\n","import { RankedTester } from '@jsonforms/core';\nimport {\n buttonRendererTester,\n createButtonRenderer,\n} from '@chobantonov/jsonforms-react-extended-renderers';\n\n/*\n Section 14's closed set, restated rather than imported: the base package\n publishes its types from a build, and a renderer set should not need that\n build to be up to date before it can compile.\n*/\ntype ButtonSemanticColor =\n | 'primary'\n | 'secondary'\n | 'alternative'\n | 'success'\n | 'warning'\n | 'error';\nimport { Button } from 'antd';\n\nexport const antdButtonRendererTester = buttonRendererTester as RankedTester;\n\n/**\n * Section 14's semantic colors, mapped onto antd's button props.\n *\n * The names are semantic rather than visual on purpose - `error` rather than\n * `red` - so a theme decides what they look like. antd expresses the\n * destructive one as a separate `danger` flag rather than a type, and has no\n * distinct `warning` button, which takes the same treatment.\n */\nconst COLORS: Record<ButtonSemanticColor, Record<string, unknown>> = {\n primary: { type: 'primary' },\n secondary: { type: 'default' },\n alternative: { type: 'dashed' },\n success: { type: 'primary' },\n warning: { type: 'default', danger: true },\n error: { type: 'primary', danger: true },\n};\n\nexport const AntdButtonRenderer = createButtonRenderer({\n ButtonComponent: Button,\n buttonProps: { htmlType: 'button', type: 'primary' },\n getButtonProps: ({ pending, color, uischema }: any) => ({\n // \"Pending/loading covers the complete fireActionEvent promise.\"\n loading: pending,\n block: uischema.options?.fullWidth === true,\n ...(color ? (COLORS[color] ?? {}) : {}),\n }),\n});\n","import type { ColorSaveFormat } from '@chobantonov/jsonforms-react-renderer-common/formats/colorFormat';\nexport {\n COLOR_SAVE_FORMATS,\n DEFAULT_COLOR_SAVE_FORMAT,\n asColorSaveFormat,\n normalizeHue,\n parseColor,\n isColor,\n isTransparent,\n hslToRgb,\n hsbToRgb,\n rgbToHsb,\n serializeColor,\n toCssColor,\n placeholderKeyFor,\n} from '@chobantonov/jsonforms-react-renderer-common/formats/colorFormat';\nexport type {\n ColorSaveFormat,\n Rgba,\n} from '@chobantonov/jsonforms-react-renderer-common/formats/colorFormat';\n\n/**\n * Which of antd's three picker panels matches a save format.\n *\n * Total, because every save format is one the picker can edit - that is why\n * `hsl` output was dropped. `hex3` edits on the hex panel and is quantized on\n * commit; it is a narrower hex, not a different model.\n */\nexport const pickerFormatFor = (\n format: ColorSaveFormat,\n): 'hex' | 'rgb' | 'hsb' => {\n switch (format) {\n case 'rgb':\n return 'rgb';\n case 'hsb':\n return 'hsb';\n case 'hex':\n case 'hex3':\n default:\n return 'hex';\n }\n};\n","import {\n ControlFormItem,\n usePreTouchErrors,\n useClearAffordance,\n useI18n,\n} from '@chobantonov/jsonforms-react-antd-renderers';\nimport { ControlProps, RankedTester } from '@jsonforms/core';\nimport { withJsonFormsControlProps } from '@jsonforms/react';\nimport { Button, ColorPicker, Input, theme as antTheme } from 'antd';\nimport type { AggregationColor } from 'antd/es/color-picker/color';\nimport type { ColorFormatType } from 'antd/es/color-picker/interface';\nimport {\n extendedColorTester,\n resolveExtendedOption,\n useExtendedTranslator,\n} from '@chobantonov/jsonforms-react-extended-renderers';\nimport React, { useState } from 'react';\nimport {\n DEFAULT_COLOR_SAVE_FORMAT,\n Rgba,\n asColorSaveFormat,\n parseColor,\n pickerFormatFor,\n placeholderKeyFor,\n serializeColor,\n toCssColor,\n} from '../util/colorFormat';\n\n/**\n * Selection follows section 18: schema `format: \"color\"` **or** UI\n * `options.format: \"color\"` on a plain string. The shared tester carries both;\n * the antd-local one used to test the schema format alone, so a UI-driven\n * color field on an unannotated string silently rendered as a text box.\n */\nexport const antdColorControlTester: RankedTester = extendedColorTester;\n\n/** antd's color object to the channels {@link serializeColor} works in. */\nconst toRgba = (color: AggregationColor): Rgba => {\n const { r, g, b, a } = color.toRgb();\n return { r, g, b, a: typeof a === 'number' ? a : 1 };\n};\n\n/**\n * One field rather than three widgets in a row: the swatch is the input's\n * prefix, the color stays editable as text, and the input and picker each\n * provide a clear affordance.\n *\n * Three things the widget layout has to serve, all from section 18 and\n * Adjustment 8:\n *\n * - **Text and picker share one storage contract.** Whatever either produces is\n * written in `colorSaveFormat`, and neither rewrites a value the user has not\n * edited. Typed text is committed as typed and normalized on blur, so\n * `#ff0` does not turn into `rgb(255, 255, 0)` between two keystrokes and\n * move the caret.\n * - **The picker can clear.** A footer action clears from inside the panel,\n * including when text entry is off.\n * - **An unparseable value stays visible.** It is left in the data for the\n * validator to report rather than being replaced by the picker's fallback\n * black.\n */\nexport const AntdColorControl = (props: ControlProps) => {\n const { token } = antTheme.useToken();\n const message = useI18n();\n /*\n See `usePreTouchErrors` in the base package: the filtered message, plus the\n touch state it needs. Unchanged unless filtering is switched on.\n */\n const { errors: filteredErrors, onBlur: onBlurTouch } = usePreTouchErrors({\n errors: props.errors,\n path: props.path,\n schema: props.schema,\n uischema: props.uischema as any,\n config: props.config,\n });\n\n const t = useExtendedTranslator();\n const value = typeof props.data === 'string' ? props.data : undefined;\n // Set when an edit was refused rather than committed - currently only\n // `hex3` + transparency, which the specification says must not be quietly\n // flattened to an opaque color.\n const [refused, setRefused] = useState(false);\n // Which channel set the panel is showing. Controlled rather than left to\n // antd, so that every opening starts on the format the value is stored in.\n const [panelFormat, setPanelFormat] = useState<ColorFormatType>();\n // hooks run before the visibility guard\n const { allowClear, affordanceProps } = useClearAffordance(Boolean(value));\n\n const options = props.uischema.options;\n // `placeholder`, `focus` and `clearable` are the shared control options the\n // specification lists for this renderer; they are upstream conventions, so\n // they stay flat and are read from the merged element/config view rather\n // than from the `jsonformsExtended` namespace.\n const shared = { ...props.config, ...options } as Record<string, unknown>;\n const clearable = shared.clearable !== false;\n const disabled = !props.enabled || Boolean(props.readonly);\n const saveFormat = asColorSaveFormat(\n resolveExtendedOption(\n options,\n props.config,\n 'colorSaveFormat',\n DEFAULT_COLOR_SAVE_FORMAT,\n ),\n );\n const textEntry =\n resolveExtendedOption<boolean>(\n options,\n props.config,\n 'colorTextEntry',\n true,\n ) !== false;\n\n if (!props.visible) return null;\n\n const commit = (next?: string) => {\n setRefused(false);\n props.handleChange(props.path, next || undefined);\n };\n\n /** Serializes an edit, or refuses it when the format cannot carry it. */\n const commitColor = (color: AggregationColor) => {\n if (color.cleared) {\n commit(undefined);\n return;\n }\n const next = serializeColor(toRgba(color), saveFormat);\n if (next === undefined) {\n setRefused(true);\n return;\n }\n commit(next);\n };\n\n /**\n * Rewrites a typed color into the configured representation once the user\n * leaves the field. Text that does not parse is left exactly as typed: it is\n * the validator's job to explain it, not this control's job to guess.\n */\n const normalize = () => {\n const parsed = parseColor(value);\n if (!parsed) return;\n const next = serializeColor(parsed, saveFormat);\n if (next === undefined) {\n // A transparent value under `hex3`. Rejected without committing an\n // opaque replacement, per section 18.\n setRefused(true);\n return;\n }\n setRefused(false);\n if (next !== value) {\n props.handleChange(props.path, next);\n }\n };\n\n const guidance = refused ? t('color.hex3Transparency') : undefined;\n const cssColor = toCssColor(value);\n\n const swatch = (size: number) => (\n <span\n style={{\n display: 'block',\n width: size,\n height: size,\n borderRadius: token.borderRadiusSM,\n border: `1px solid ${token.colorBorder}`,\n background: cssColor ?? 'transparent',\n cursor: props.enabled ? 'pointer' : 'not-allowed',\n }}\n />\n );\n\n const savedPanelFormat = pickerFormatFor(saveFormat);\n\n const picker = (children: React.ReactNode) => (\n <ColorPicker\n disabled={disabled}\n // Never the stored text: `hsb(...)` is not CSS, and handing it to the\n // picker would parse as black. An unrecognized value opens the panel\n // empty rather than pretending to be a color.\n value={cssColor ?? null}\n /*\n Controlled, and reset on every open, so the panel always starts on the\n channels the value is actually stored in - `rgb` for an rgb-saving\n field, `hsb` for an hsb-saving one. `defaultFormat` only seeds the\n first render, so a field left on another tab reopened on that tab and\n showed numbers in a model it does not store. Switching tabs while the\n panel is open still works; it changes what is being edited, never what\n is written.\n */\n format={panelFormat ?? savedPanelFormat}\n onFormatChange={setPanelFormat}\n onOpenChange={(open) => {\n if (open) setPanelFormat(savedPanelFormat);\n }}\n panelRender={(panel) => (\n <div>\n {panel}\n {clearable && value !== undefined && value !== '' && (\n <Button\n block\n type='text'\n disabled={disabled}\n data-color-panel-clear=''\n onClick={() => commit(undefined)}\n >\n {message('control.clearValue')}\n </Button>\n )}\n </div>\n )}\n onChangeComplete={commitColor}\n >\n {children}\n </ColorPicker>\n );\n\n return (\n <ControlFormItem\n adornmentSchema={props.schema}\n adornmentOptions={props.uischema.options as Record<string, unknown>}\n id={props.id}\n label={props.label}\n required={props.required}\n errors={filteredErrors || undefined}\n help={\n filteredErrors ||\n (guidance ? (\n <span role='alert' data-color-guidance>\n {guidance}\n </span>\n ) : (\n props.description\n ))\n }\n >\n {textEntry ? (\n <Input\n allowClear={clearable && allowClear}\n {...affordanceProps}\n onBlur={() => {\n affordanceProps.onBlur();\n onBlurTouch();\n normalize();\n }}\n // lineHeight 0 stops the prefix span from inheriting the text line box\n styles={{\n prefix: { lineHeight: 0, display: 'flex', alignItems: 'center' },\n }}\n disabled={disabled}\n // An authored hint wins; otherwise the hint is the syntax of the\n // configured representation, which section 18 requires it to reflect.\n placeholder={\n (shared.placeholder as string | undefined) ??\n t(placeholderKeyFor(saveFormat))\n }\n autoFocus={shared.focus === true}\n status={filteredErrors ? 'error' : refused ? 'warning' : undefined}\n value={value ?? ''}\n onChange={(event) => commit(event.currentTarget.value)}\n prefix={picker(\n /*\n A custom trigger rather than antd's default one: that trigger\n carries its own border, padding and min-height, which makes it\n taller than the input's text line and sit off-centre in a prefix.\n A plain swatch can be sized to the line box instead.\n */\n <span role='button' aria-label={t('editor.chooseColor')}>\n {swatch(14)}\n </span>,\n )}\n />\n ) : (\n /*\n `colorTextEntry: false`. The value is not typeable, so the picker is\n the whole control - but the trigger is a real button, because\n removing text entry must not remove keyboard access. The stored text\n is shown verbatim beside the swatch rather than through antd's\n `showText`, which would render the picker's interpretation of the\n value and so display `#000000` for anything it failed to parse.\n */\n picker(\n <button\n type='button'\n disabled={disabled}\n aria-label={t('editor.chooseColor')}\n autoFocus={shared.focus === true}\n data-color-trigger\n style={{\n display: 'inline-flex',\n alignItems: 'center',\n gap: token.paddingXS,\n padding: `${token.paddingXXS}px ${token.paddingXS}px`,\n borderRadius: token.borderRadius,\n border: `1px solid ${\n filteredErrors ? token.colorError : token.colorBorder\n }`,\n background: token.colorBgContainer,\n color: token.colorText,\n font: 'inherit',\n cursor: props.enabled ? 'pointer' : 'not-allowed',\n }}\n >\n {swatch(16)}\n <span>{value ?? ''}</span>\n </button>,\n )\n )}\n </ControlFormItem>\n );\n};\n\nexport const AntdColorControlRenderer =\n withJsonFormsControlProps(AntdColorControl);\n","import React from 'react';\nimport type { ControlProps } from '@jsonforms/core';\nimport { ControlFormItem } from '@chobantonov/jsonforms-react-antd-renderers';\n\nexport function PickerFormItem({\n props,\n error,\n children,\n}: React.PropsWithChildren<{ props: ControlProps; error?: string }>) {\n return (\n <ControlFormItem\n adornmentSchema={props.schema}\n adornmentOptions={props.uischema.options as Record<string, unknown>}\n id={props.id}\n required={props.required}\n errors={error || undefined}\n label={props.label}\n help={error || props.description}\n >\n {children}\n </ControlFormItem>\n );\n}\n","import { PickerFormItem } from '../components/PickerFormItem';\nimport {\n AntdClearableInput,\n usePreTouchErrors,\n} from '@chobantonov/jsonforms-react-antd-renderers';\nimport ScheduleOutlined from '@ant-design/icons/ScheduleOutlined';\nimport {\n and,\n ControlElement,\n ControlProps,\n formatIs,\n isStringControl,\n optionIs,\n or,\n RankedTester,\n rankWith,\n uiTypeIs,\n} from '@jsonforms/core';\nimport { withJsonFormsControlProps } from '@jsonforms/react';\nimport {\n Button,\n Flex,\n Input,\n Popover,\n Select,\n Space,\n Typography,\n theme as antTheme,\n} from 'antd';\nimport React from 'react';\nimport {\n useCronPicker,\n CRON_FIELDS,\n CronField,\n CronPeriod,\n DEFAULT_CRON,\n FIELD_RANGE,\n formatField,\n labelFor,\n parseField,\n} from '@chobantonov/jsonforms-react-extended-renderers';\n\n/**\n * Selected the two ways section 5 describes, like every other temporal control.\n *\n * `format: \"cron\"` in the **schema** is the route that also gives a validator\n * something to check, where the profile defines the keyword; `options.format`\n * in the **UI schema** picks the same renderer for a plain string and leaves\n * validation to `pattern`. Rank 3 is the shared rank for a format-selected\n * control.\n */\nexport const antdCronControlTester: RankedTester = rankWith(\n 3,\n and(\n isStringControl,\n or(formatIs('cron'), and(uiTypeIs('Control'), optionIs('format', 'cron'))),\n ),\n);\n\n/** Offered coarsest-repeating first, which is how a schedule is described out loud. */\nconst periods: CronPeriod[] = [\n 'year',\n 'month',\n 'week',\n 'day',\n 'hour',\n 'minute',\n 'second',\n];\n\n/** The width of the label column, in characters, from the longest label shown. */\nconst labelColumn = 15;\n\n/**\n * One field's choices, or its text when it has none.\n *\n * A multi-select rather than a syntax: picking Monday and Friday is the natural\n * way to say `MON,FRI`, and the expression underneath is written from the\n * selection rather than typed. An empty selection is **every value** - which is\n * what `*` means and what clearing this field does, so the clear action and the\n * schedule agree.\n *\n * A field whose value is `L`, `W` or `#` has no list to offer, so it is shown\n * as the text it is. That is the whole of the special-syntax support: it is\n * never reinterpreted, never widened into a list that would mean something\n * else, and never taken away from whoever wrote it.\n */\nconst FieldPicker = ({\n field,\n text,\n disabled,\n label,\n onChange,\n}: {\n field: CronField;\n text: string;\n disabled: boolean;\n label: (key: any, values?: Record<string, string | number>) => string;\n onChange: (text: string) => void;\n}) => {\n const name = label(`cron.${field}` as any);\n const values = parseField(text, field);\n const [low, high] = FIELD_RANGE[field];\n\n const addon = (\n <Space.Addon\n disabled={disabled}\n style={{ width: `${labelColumn}ch`, justifyContent: 'flex-start' }}\n >\n {name}\n </Space.Addon>\n );\n\n if (values === undefined) {\n return (\n <AntdClearableInput\n data={text}\n enabled={!disabled}\n onClear={() => onChange('')}\n >\n {(clear) => (\n <Space.Compact block>\n {addon}\n <Input\n style={{ flex: 1, minWidth: 0 }}\n disabled={disabled}\n value={text}\n aria-label={name}\n suffix={clear}\n onChange={(event) => onChange(event.currentTarget.value)}\n />\n </Space.Compact>\n )}\n </AntdClearableInput>\n );\n }\n\n /*\n \"Every\" is the empty selection, so a field standing for all of its values\n shows nothing chosen rather than every chip at once - which for seconds\n would be sixty of them.\n */\n const selected = values.length === high - low + 1 ? [] : values;\n\n return (\n <Space.Compact block>\n {addon}\n <Select\n style={{ flex: 1, minWidth: 0 }}\n mode='multiple'\n disabled={disabled}\n value={selected}\n placeholder={label('cron.every')}\n aria-label={name}\n maxTagCount='responsive'\n /*\n antd's own clear rather than the shared button: this is a row of the\n picker and not the control's value, and what it clears to is \"every\"\n rather than nothing at all.\n */\n allowClear\n options={Array.from({ length: high - low + 1 }, (_, index) => ({\n value: low + index,\n label: labelFor(low + index, field),\n }))}\n onChange={(next: number[]) => onChange(formatField(next, field))}\n />\n </Space.Compact>\n );\n};\n\n/**\n * When something runs, as a schedule rather than as six fields of punctuation.\n *\n * Built like the duration control: **one field, not two widgets**. The\n * expression is the value, it stays editable as text, and the picker hangs off\n * an icon inside the input rather than sitting above it. Clearing follows the\n * shared clear-value contract - `AntdClearableInput`, so the button has a\n * localized name, appears on hover or focus, and returns the property to a\n * missing state rather than to an empty string.\n *\n * The picker asks **how often it repeats** first, because that decides which of\n * the six fields are worth showing: a schedule that runs every hour has nothing\n * to say about which day it is, and five dropdowns reading \"every\" is a form\n * that hides its own answer. Each field it does show is a list to choose from,\n * and an empty one means every value.\n *\n * The period is a **lens, not data**. It selects nothing on its own - a\n * property with no schedule in it opens with no period chosen and no rows - and\n * the one thing changing it writes is the conditions it is about to hide. What\n * does fill a value in is choosing one: see `withTimeDefaults`, because in cron\n * a field left alone means *every* value, so \"nine o'clock\" with nothing else\n * said is 3600 executions rather than one.\n *\n * Two things it will not do. It **edits only the field that was touched**, so\n * the other five keep the spelling they were written with. And it **does not\n * write at all** unless the schedule actually changed: OK on an untouched\n * picker leaves the value alone, which is the rule the duration control keeps\n * for `P1DT0H` against `P1D`.\n */\nexport const AntdCronControl = (props: ControlProps) => {\n const { token } = antTheme.useToken();\n const {\n label,\n expression,\n open,\n setOpen,\n text,\n period,\n options,\n showActions,\n disabled,\n localError,\n draft,\n changeField,\n changeText,\n changePeriod,\n editedProblem,\n shownFields,\n hasCustomField,\n openOn,\n accept,\n } = useCronPicker(props);\n const { errors: filteredErrors, onBlur: onBlurTouch } = usePreTouchErrors({\n errors: props.errors,\n path: props.path,\n schema: props.schema,\n uischema: props.uischema as ControlElement,\n config: props.config,\n });\n if (!props.visible) return null;\n\n const picker = (\n <Flex vertical gap='small' style={{ width: 340 }}>\n <Space.Compact block>\n <Space.Addon\n disabled={disabled}\n style={{ width: `${labelColumn}ch`, justifyContent: 'flex-start' }}\n >\n {label('cron.repeats')}\n </Space.Addon>\n <Select\n style={{ flex: 1, minWidth: 0 }}\n disabled={disabled}\n value={period}\n placeholder={label('cron.chooseRepeats')}\n aria-label={label('cron.repeats')}\n options={periods.map((each) => ({\n value: each,\n label: label(`cron.period.${each}` as any),\n }))}\n onChange={(value) => changePeriod(value as CronPeriod)}\n />\n </Space.Compact>\n\n {shownFields.map((field) => (\n <FieldPicker\n key={field}\n field={field}\n text={draft[CRON_FIELDS.indexOf(field)] ?? '*'}\n disabled={disabled}\n label={label}\n onChange={(value) => changeField(field, value)}\n />\n ))}\n\n {hasCustomField && (\n <Typography.Text\n type='secondary'\n style={{ fontSize: token.fontSizeSM }}\n >\n {label('cron.advanced')}\n </Typography.Text>\n )}\n\n {/*\n The expression the picker is building, inside the picker.\n\n Somewhere to see what a selection just wrote without closing the panel,\n and the way in for anything the dropdowns cannot say. With `showActions`\n the field below shows what is saved and this shows what is being edited.\n */}\n <AntdClearableInput\n data={text}\n enabled={!disabled}\n onClear={() => changeText('')}\n >\n {(clear) => (\n <Space.Compact block>\n <Space.Addon\n disabled={disabled}\n style={{\n width: `${labelColumn}ch`,\n justifyContent: 'flex-start',\n }}\n >\n {label('cron.expression')}\n </Space.Addon>\n <Input\n style={{ flex: 1, minWidth: 0 }}\n disabled={disabled}\n value={text}\n placeholder={DEFAULT_CRON}\n status={editedProblem ? 'error' : undefined}\n aria-label={label('cron.expression')}\n suffix={clear}\n onChange={(event) => changeText(event.currentTarget.value)}\n />\n </Space.Compact>\n )}\n </AntdClearableInput>\n\n {showActions && (\n <Flex justify='end' gap='small'>\n <Button onClick={() => setOpen(false)}>{label('cron.cancel')}</Button>\n <Button\n type='primary'\n disabled={disabled || Boolean(editedProblem)}\n onClick={accept}\n >\n {label('cron.ok')}\n </Button>\n </Flex>\n )}\n </Flex>\n );\n\n /**\n * Opened on what the field currently says, and on nothing when it says\n * nothing.\n *\n * So Cancel restores it, and a schedule edited as text is what the picker\n * picks up rather than whatever was left behind last time.\n */\n return (\n <PickerFormItem props={props} error={localError || filteredErrors}>\n {/*\n One field, like the duration and color controls: the expression stays\n editable as text and the picker hangs off an icon inside the input\n rather than sitting beside it as a second widget.\n */}\n <AntdClearableInput\n clearable={options.clearable !== false}\n data={props.data}\n enabled={!disabled}\n onClear={() => props.handleChange(props.path, undefined)}\n >\n {(clear: React.ReactNode) => (\n <Input\n id={props.id}\n disabled={disabled}\n value={expression}\n placeholder={options.placeholder ?? DEFAULT_CRON}\n autoFocus={options.focus}\n status={localError || filteredErrors ? 'error' : undefined}\n onChange={(event) =>\n props.handleChange(\n props.path,\n event.currentTarget.value || undefined,\n )\n }\n onBlur={onBlurTouch}\n styles={{\n prefix: { lineHeight: 0, display: 'flex', alignItems: 'center' },\n }}\n suffix={clear}\n prefix={\n <Popover\n content={picker}\n open={open}\n placement='bottomLeft'\n trigger='click'\n onOpenChange={openOn}\n >\n <ScheduleOutlined\n role='button'\n aria-label={label('cron.choose')}\n style={{\n cursor: disabled ? 'not-allowed' : 'pointer',\n color: token.colorTextTertiary,\n }}\n />\n </Popover>\n }\n />\n )}\n </AntdClearableInput>\n </PickerFormItem>\n );\n};\n\nexport const AntdCronControlRenderer =\n withJsonFormsControlProps(AntdCronControl);\n","import { PickerFormItem } from '../components/PickerFormItem';\nimport {\n useExtendedTranslator,\n useDurationControl,\n durationComponentFields,\n durationFieldMax,\n} from '@chobantonov/jsonforms-react-extended-renderers';\nimport {\n usePreTouchErrors,\n useClearAffordance,\n useI18n,\n} from '@chobantonov/jsonforms-react-antd-renderers';\nimport ClockCircleOutlined from '@ant-design/icons/ClockCircleOutlined';\nimport {\n and,\n ControlProps,\n formatIs,\n isStringControl,\n RankedTester,\n rankWith,\n} from '@jsonforms/core';\nimport { withJsonFormsControlProps } from '@jsonforms/react';\nimport {\n Button,\n Flex,\n Input,\n InputNumber,\n Popover,\n Segmented,\n Select,\n Space,\n theme as antTheme,\n} from 'antd';\nimport CloseOutlined from '@ant-design/icons/CloseOutlined';\nimport React from 'react';\n\nexport const antdDurationControlTester: RankedTester = rankWith(\n 3,\n and(isStringControl, formatIs('duration')),\n);\n\n/** Each picker component's translation key, so none is a bare English word. */\nconst fieldLabelKeys = {\n weeks: 'duration.weeks',\n years: 'duration.years',\n months: 'duration.months',\n days: 'duration.days',\n hours: 'duration.hours',\n minutes: 'duration.minutes',\n seconds: 'duration.seconds',\n} as const;\n\nexport const AntdDurationControl = (props: ControlProps) => {\n const { token } = antTheme.useToken();\n /*\n See `usePreTouchErrors` in the base package: the filtered message, plus the\n touch state it needs. Unchanged unless filtering is switched on.\n */\n const { errors: filteredErrors, onBlur: onBlurTouch } = usePreTouchErrors({\n errors: props.errors,\n path: props.path,\n schema: props.schema,\n uischema: props.uischema as any,\n config: props.config,\n });\n\n const t = useExtendedTranslator();\n const label = useI18n();\n const state = useDurationControl(props);\n const { open, draft: parts } = state;\n // hooks run before the visibility guard\n const { allowClear, affordanceProps } = useClearAffordance(\n Boolean(state.value),\n );\n if (!props.visible) return null;\n const value = state.value;\n const localError = state.error;\n /*\n Only the units in play, and weeks as a mode rather than a row.\n\n The previous picker drew all seven components, so \"2 days, 3 hours\" was two\n useful rows among five zeros - and Weeks sat first, greyed, with nothing\n saying that it cannot be combined with the others. Both are fixed here;\n see `useDurationControl` for why weeks is a mode.\n */\n /*\n The unit column's width, in characters, taken from the longest label the\n panel can show rather than from the rows it happens to be showing: adding\n or removing a unit must not resize the ones already on screen.\n */\n const unitColumn =\n Math.max(\n ...(state.mode === 'weeks'\n ? ['weeks' as const]\n : durationComponentFields\n ).map((field) => label(fieldLabelKeys[field]).length),\n ) + 2;\n const picker = (\n <Flex vertical gap='small' style={{ width: 300 }}>\n <Segmented\n block\n size='small'\n disabled={state.disabled}\n value={state.mode}\n onChange={(next) => state.setMode(next as 'weeks' | 'components')}\n options={[\n { value: 'components', label: label('duration.modeComponents') },\n { value: 'weeks', label: label('duration.modeWeeks') },\n ]}\n />\n {state.activeFields.map((field) => (\n /*\n A two-column grid, not a flex row. A flex item keeps its natural\n width, which is why the number-and-unit group sat at about half the\n panel while the add control below it ran the full width; a grid item\n stretches, and the second column stays open whether or not a remove\n button is drawn, so the rows line up with each other and with the\n add control.\n */\n <div\n key={field}\n style={{\n display: 'grid',\n gridTemplateColumns: `1fr ${token.controlHeight}px`,\n alignItems: 'center',\n columnGap: token.paddingXXS,\n }}\n >\n {/*\n `Space.Compact` rather than the input's `addonAfter`: antd 6\n deprecates the addon props on `InputNumber` in favour of this and\n warns about them in development. It also renders the addon itself,\n which is what lets the unit column below have a width.\n */}\n <Space.Compact block>\n <InputNumber\n style={{ flex: 1, minWidth: 0 }}\n /*\n Floored at zero and capped only at the exact-integer limit:\n a duration's components are quantities, so `PT90M` and\n `P400D` are ordinary values, not overflow.\n */\n min={0}\n max={durationFieldMax}\n disabled={state.disabled}\n aria-label={label(fieldLabelKeys[field])}\n onChange={(next) => state.changePart(field, Number(next ?? 0))}\n value={parts[field]}\n />\n <Space.Addon\n disabled={state.disabled}\n style={{\n /*\n One width for every unit in the panel, measured from the\n longest label rather than fixed in pixels: the labels are\n translated, and \"Minutes\" and \"Минути\" are not the same\n width. Sizing to the longest keeps every input box the same\n size in every locale instead of leaving a ragged edge.\n */\n width: `${unitColumn}ch`,\n justifyContent: 'center',\n }}\n >\n {label(fieldLabelKeys[field])}\n </Space.Addon>\n </Space.Compact>\n {state.mode === 'components' && state.activeFields.length > 1 ? (\n <Button\n size='small'\n type='text'\n disabled={state.disabled}\n aria-label={label('duration.removeUnit', {\n unit: label(fieldLabelKeys[field]),\n })}\n onClick={() => state.removeField(field)}\n >\n <CloseOutlined />\n </Button>\n ) : (\n /* Holds the column open so a row without a button still aligns. */\n <span aria-hidden='true' />\n )}\n </div>\n ))}\n {state.addableFields.length > 0 && (\n <Select<(typeof state.addableFields)[number]>\n size='small'\n /* Stops where the inputs do: the button column plus its gap. */\n style={{\n width: `calc(100% - ${token.controlHeight + token.paddingXXS}px)`,\n }}\n value={undefined}\n disabled={state.disabled}\n placeholder={label('duration.addUnit')}\n aria-label={label('duration.addUnit')}\n onChange={(field) => state.addField(field)}\n options={state.addableFields.map((field) => ({\n value: field,\n label: label(fieldLabelKeys[field]),\n }))}\n />\n )}\n {state.showActions && (\n <Flex justify='end' gap='small'>\n <Button onClick={() => state.close()}>\n {/*\n The temporal-action convention: an explicit label is translated\n as a key first and used literally if it does not resolve.\n */}\n {state.options.cancelLabel\n ? (t(state.options.cancelLabel) ?? state.options.cancelLabel)\n : label('duration.cancel')}\n </Button>\n <Button\n onClick={() => {\n state.apply();\n }}\n type='primary'\n >\n {state.options.okLabel\n ? (t(state.options.okLabel) ?? state.options.okLabel)\n : label('duration.ok')}\n </Button>\n </Flex>\n )}\n </Flex>\n );\n return (\n <PickerFormItem props={props} error={localError || filteredErrors}>\n {/*\n One field, like the color control: the ISO 8601 value stays editable as\n text and the picker hangs off an icon inside the input rather than\n sitting beside it as a second widget.\n */}\n <Input\n allowClear={allowClear}\n {...affordanceProps}\n disabled={state.disabled}\n onChange={(event) =>\n props.handleChange(props.path, event.currentTarget.value || undefined)\n }\n onBlur={onBlurTouch}\n placeholder={state.options.placeholder ?? 'P1DT2H'}\n autoFocus={state.options.focus}\n status={localError || filteredErrors ? 'error' : undefined}\n value={value ?? ''}\n styles={{\n prefix: { lineHeight: 0, display: 'flex', alignItems: 'center' },\n }}\n prefix={\n <Popover\n content={picker}\n onOpenChange={(next) => (next ? state.openPicker() : state.close())}\n open={open}\n placement='bottomLeft'\n trigger='click'\n >\n <ClockCircleOutlined\n role='button'\n aria-label={t('editor.chooseDuration')}\n style={{\n cursor: state.disabled ? 'not-allowed' : 'pointer',\n color: token.colorTextTertiary,\n }}\n />\n </Popover>\n }\n />\n </PickerFormItem>\n );\n};\n\nexport const AntdDurationControlRenderer =\n withJsonFormsControlProps(AntdDurationControl);\n","import { CellProps, WithClassname } from '@jsonforms/core';\nimport { AntdClearableInput } from '@chobantonov/jsonforms-react-antd-renderers';\nimport { Input } from 'antd';\nimport type { InputRef } from 'antd';\nimport React, { useRef, useCallback } from 'react';\nimport { useMaskedInput } from '@chobantonov/jsonforms-react-renderer-common/formats/useMaskedInput';\n\n/**\n * The masked text field.\n *\n * Written in the shape of a cell rather than as a whole control, so the frame\n * comes from `InputControl` like every other antd input - label, description,\n * required marker and error message included. It is registered as a renderer\n * only; see Adjustment 11.10 for why there is no masked table cell.\n *\n * Three decisions are worth reading before changing anything here.\n *\n * **The engine is driven by hand, not through maska's `MaskInput`.** That class\n * assigns `input.value` directly and announces the result with a\n * `CustomEvent('input')`. React tracks a controlled input's value through a\n * patched `value` setter, so the assignment updates React's tracker and the\n * synthetic `onChange` that would follow is suppressed; the CustomEvent does\n * not bubble, so React's root listener never sees it either. The binding would\n * silently stop reporting edits. `MaskInput` also normalizes the field's value\n * in a microtask after it attaches, which is exactly the mount-time rewrite the\n * specification forbids. Only the pure `Mask` is used, and the binding is here.\n *\n * **Edits commit immediately.** The text control debounces by 300ms; this one\n * does not, because the displayed text and the stored value are two different\n * strings and keeping a third, in-flight one would mean the field could not\n * tell a draft from data the host had replaced underneath it. Committing in\n * step makes the rule below exact, and leaves nothing for a detail dialog's\n * Apply to flush.\n *\n * **The draft is only trusted while it still means the stored value.** There is\n * no effect synchronizing state to props: the typed text is used when it still\n * round-trips to what is in the data, and otherwise the display is derived from\n * the data. An external replacement therefore wins automatically, which is what\n * the pending-edit contract asks for - \"data replacement policy must not\n * silently let an outdated draft overwrite the replacement.\"\n */\nexport const AntdMaskInput = React.memo(function AntdMaskInput(\n props: CellProps &\n WithClassname & {\n inputProps?: React.ComponentProps<typeof Input>;\n },\n) {\n const { data, className, id, enabled, inputProps } = props;\n const inputRef = useRef<InputRef>(null);\n const getInput = useCallback(() => inputRef.current?.input, []);\n const {\n appliedUiSchemaOptions,\n settings,\n display,\n onClear,\n onChange,\n onCompositionStart,\n onCompositionEnd,\n } = useMaskedInput(props, getInput, 'commit');\n\n return (\n <AntdClearableInput\n clearable={appliedUiSchemaOptions.clearable !== false}\n data={data}\n enabled={enabled}\n onClear={onClear}\n >\n <Input\n ref={inputRef}\n value={display}\n onChange={onChange}\n onCompositionStart={onCompositionStart}\n onCompositionEnd={onCompositionEnd}\n className={className}\n id={id}\n disabled={!enabled}\n autoFocus={appliedUiSchemaOptions.focus}\n style={{ width: '100%' }}\n /*\n The mask is the fallback hint, which is the convention in the\n neighbouring Vuetify family and which the specification permits so\n long as a renderer says which it does: `###-###` shows the shape of\n the field without claiming to be a real value. An explicit empty\n placeholder suppresses it, as section 18 requires.\n */\n placeholder={\n appliedUiSchemaOptions.placeholder ??\n (typeof settings?.mask === 'string' ? settings.mask : undefined)\n }\n data-mask-input\n {...inputProps}\n />\n </AntdClearableInput>\n );\n});\n","import { ControlProps, RankedTester } from '@jsonforms/core';\nimport { withJsonFormsControlProps } from '@jsonforms/react';\nimport { InputControl } from '@chobantonov/jsonforms-react-antd-renderers';\nimport { extendedMaskTester } from '@chobantonov/jsonforms-react-extended-renderers';\nimport React from 'react';\nimport { AntdMaskInput } from '../components/AntdMaskInput';\n\n/**\n * Selection is `options.mask` carrying a pattern, on a string with no format of\n * its own. See `maskControls.ts` for why presence alone is not enough.\n */\nexport const antdMaskControlTester: RankedTester = extendedMaskTester;\n\nexport const AntdMaskControl = (props: ControlProps) => (\n <InputControl {...props} input={AntdMaskInput} />\n);\n\nexport const AntdMaskControlRenderer =\n withJsonFormsControlProps(AntdMaskControl);\n","import {\n ControlFormItem,\n usePreTouchErrors,\n} from '@chobantonov/jsonforms-react-antd-renderers';\nimport {\n and,\n ControlProps,\n JsonSchema,\n RankedTester,\n rankWith,\n schemaMatches,\n uiTypeIs,\n} from '@jsonforms/core';\nimport { withJsonFormsControlProps } from '@jsonforms/react';\nimport { Checkbox } from 'antd';\nimport React from 'react';\n\nexport const antdNullControlTester: RankedTester = rankWith(\n 3,\n and(\n uiTypeIs('Control'),\n schemaMatches((schema: JsonSchema) => schema.type === 'null'),\n ),\n);\n\nexport const AntdNullControl = (props: ControlProps) => {\n // See `usePreTouchErrors`; unchanged unless filtering is on.\n const { errors, onFocus, onBlur } = usePreTouchErrors({\n errors: props.errors,\n path: props.path,\n schema: props.schema,\n uischema: props.uischema as any,\n config: props.config,\n });\n if (!props.visible) return null;\n return (\n <ControlFormItem\n errors={errors || undefined}\n help={errors || props.description}\n >\n <Checkbox\n checked={props.data === null}\n disabled={!props.enabled}\n onFocus={onFocus}\n onBlur={onBlur}\n /*\n Indeterminate means \"neither of the two states this control has\" -\n a value that is not `null` and is not absent either. It used to be\n `data !== null`, which made an absent property indeterminate too: the\n commonest state of all, nothing recorded yet, was drawn as though the\n data were broken. Section 19 wants the genuinely out-of-domain value\n marked, not the empty one.\n */\n indeterminate={props.data !== null && props.data !== undefined}\n onChange={(event) =>\n props.handleChange(\n props.path,\n event.target.checked ? null : undefined,\n )\n }\n >\n {props.label}\n {props.required ? ' *' : ''}\n </Checkbox>\n </ControlFormItem>\n );\n};\n\nexport const AntdNullControlRenderer =\n withJsonFormsControlProps(AntdNullControl);\n","import { useEffectiveElements } from '@chobantonov/jsonforms-react-renderer-common/layout/layoutContext';\nimport {\n initialSplitSizes,\n splitCssSize,\n} from '@chobantonov/jsonforms-react-extended-renderers';\nimport {\n and,\n Layout,\n LayoutProps,\n or,\n RankedTester,\n rankWith,\n UISchemaElement,\n uiTypeIs,\n} from '@jsonforms/core';\nimport { JsonFormsDispatch, withJsonFormsLayoutProps } from '@jsonforms/react';\nimport { Splitter } from 'antd';\nimport React from 'react';\n\nexport const hasAntdSplitLayoutVariant = (uischema: UISchemaElement) =>\n String(uischema.options?.variant ?? '').toLowerCase() === 'splitter';\n\nexport const antdSplitLayoutTester: RankedTester = rankWith(\n 5,\n and(\n or(uiTypeIs('HorizontalLayout'), uiTypeIs('VerticalLayout')),\n hasAntdSplitLayoutVariant,\n ),\n);\n\nexport const AntdSplitLayout = (props: LayoutProps) => {\n const layout = props.uischema as Layout;\n const vertical = layout.type === 'VerticalLayout';\n const options = { ...props.config, ...layout.options };\n /*\n \"Only effective visible UI-schema children participate. Hidden children\n leave layout.\" A hidden pane used to keep its share and its separator.\n */\n const elements = useEffectiveElements(\n layout.elements,\n props.path,\n props.config,\n );\n /* \"Initial sizes use normal sizing\", not equal shares. */\n const shares = initialSplitSizes(elements);\n /* \"`resizable` defaults true.\" */\n const resizable = (options as any).resizable !== false;\n if (!props.visible) return null;\n return (\n <Splitter\n /*\n Remount when the number of panes changes.\n\n antd applies `defaultSize` once, on mount. A pane revealed by a rule\n therefore arrives beside siblings whose sizes were resolved without it\n - the previous single pane stays at `flex-basis: 100%` and the new one\n falls back to `auto`, so it is squeezed to nothing and looks as though\n it never rendered. It did; it just had no width.\n\n The cost is that the panes remount, losing focus and any local state\n inside them at that moment. That is the better trade: the set of panes\n just changed, so the old sizes no longer describe this layout, and a\n pane you cannot see is worse than one that re-mounts.\n\n The shared splitter needs none of this - it recomputes whenever the\n stored size count stops matching the pane count.\n */\n key={elements.length}\n orientation={vertical ? 'vertical' : 'horizontal'}\n {...((options as any)?.wrap === true\n ? {\n 'data-layout-diagnostic':\n '`wrap` is not supported together with the splitter variant; ignored.',\n }\n : {})}\n style={{\n height: vertical\n ? (splitCssSize(options.height) ?? '20rem')\n : undefined,\n minHeight: vertical ? splitCssSize(options.minHeight) : undefined,\n }}\n >\n {elements.map((element, index) => (\n <Splitter.Panel\n defaultSize={`${shares[index]}%`}\n key={index}\n min='10%'\n resizable={resizable}\n >\n <div\n /*\n `border-box` is load-bearing, not tidiness: this pane is sized to\n the full height of its slot and then given padding. Under the\n default `content-box` the padding is added *outside* that height,\n so every pane overflows by exactly its padding and shows a\n scrollbar over content that fits.\n */\n style={{\n boxSizing: 'border-box',\n height: '100%',\n minWidth: 0,\n overflow: 'auto',\n padding: 12,\n }}\n >\n <JsonFormsDispatch\n cells={props.cells}\n enabled={props.enabled}\n path={props.path}\n renderers={props.renderers}\n schema={props.schema}\n uischema={element}\n />\n </div>\n </Splitter.Panel>\n ))}\n </Splitter>\n );\n};\n\nexport const AntdSplitLayoutRenderer =\n withJsonFormsLayoutProps(AntdSplitLayout);\n","import { createMarkupLabelRenderer } from '@chobantonov/jsonforms-react-extended-renderers';\nimport { Typography } from 'antd';\nimport React from 'react';\n\n/**\n * The markup label, wearing antd's typography.\n *\n * The `block` flag is ignored, and that is the interesting part: antd's\n * `Typography.Paragraph` renders a **`div`**, not a `<p>` (checked - antd's\n * own `component` default for it is `\"div\"`; `Typography` is an `article` and\n * `Typography.Text` a `span`). So it is safe to wrap parsed Markdown in,\n * which for a library whose paragraph really is a `<p>` it would not be.\n * Using it for both modes keeps the two looking identical, which matters more\n * here than honouring a distinction antd does not draw.\n *\n * `marginBottom: 0`: antd gives a paragraph a bottom margin, which inside a\n * form's own vertical rhythm reads as an unexplained gap under one label. A\n * host that wants the margin back switches `typography` off and styles the\n * text itself, which is what that option is for.\n */\nexport const AntdMarkupLabelRenderer = createMarkupLabelRenderer(\n ({ children }) => (\n <Typography.Paragraph style={{ marginBottom: 0 }}>\n {children}\n </Typography.Paragraph>\n ),\n);\n","import { UISchemaElement } from '@jsonforms/core';\nimport React from 'react';\n\n/**\n * Lets a **control** renderer serve as a **cell**.\n *\n * The two registries agree on almost everything and disagree on the one thing\n * that matters, which is why this is not a plain cast:\n *\n * - `mapStateToCellProps` reads `ownProps.path` **as the path to the value**.\n * - `mapStateToControlProps` reads `composeWithUi(uischema, ownProps.path)`,\n * which **appends** the element's scope to that path.\n *\n * `DispatchCell` hands a column both a full path (`people.0.favoriteColor`)\n * and a scoped uischema (`#/properties/favoriteColor`), because a cell\n * ignores the second. A control does not, and reads\n * `people.0.favoriteColor.favoriteColor` - which resolves to nothing. The\n * symptom is a control that renders perfectly and is simply **empty**, and an\n * edit that writes to a path no one reads. It looks like a data problem and\n * is a registry-contract problem.\n *\n * Rewriting the scope to `#` is the fix: `composeWithUi` returns `path`\n * unchanged when the scope has no data-path segments, so the control reads and\n * writes exactly the value the column is for. The schema `DispatchCell`\n * supplies is already the field's own, so `#` is the correct scope for it.\n *\n * Nothing else is adapted, and nothing needs to be: the label and the inline\n * message are dropped by `ControlFormItem` inside a `CellModeProvider`, which\n * is what makes one component able to serve both places.\n */\n/*\n Constrained on `uischema` alone, not on `ControlProps`. A renderer that has\n been through `withJsonFormsControlProps` is typed by its *own* props -\n `OwnPropsOfControl` - and requiring the full `ControlProps` here would\n reject every renderer this is meant to wrap.\n*/\nexport const asCell = <P extends { uischema?: UISchemaElement }>(\n Control: React.ComponentType<P>,\n): React.ComponentType<P> => {\n const Cell = (props: P) => (\n <Control {...props} uischema={{ ...props.uischema, scope: '#' } as any} />\n );\n Cell.displayName = `asCell(${\n Control.displayName ?? Control.name ?? 'Control'\n })`;\n return Cell;\n};\n","import {\n extendedAgGridTester,\n markupLabelTester,\n monacoControlTester,\n createExtendedRenderers,\n} from '@chobantonov/jsonforms-react-extended-renderers';\nimport { AntdAgGridControlRenderer } from './renderers/AntdAgGridControlRenderer';\nimport { AntdMonacoControlRenderer } from './renderers/AntdMonacoControlRenderer';\nimport {\n JsonFormsCellRendererRegistryEntry,\n JsonFormsRendererRegistryEntry,\n} from '@jsonforms/core';\nimport { Alert, Button } from 'antd';\nimport React from 'react';\nimport {\n AntdButtonRenderer,\n AntdColorControlRenderer,\n AntdCronControlRenderer,\n AntdMarkupLabelRenderer,\n AntdDurationControlRenderer,\n AntdMaskControlRenderer,\n AntdNullControlRenderer,\n AntdSplitLayoutRenderer,\n antdButtonRendererTester,\n antdColorControlTester,\n antdCronControlTester,\n antdDurationControlTester,\n antdMaskControlTester,\n antdNullControlTester,\n antdSplitLayoutTester,\n} from './renderers';\nimport { asCell } from './cells/asCell';\n\nexport type AntdExtendedRendererOptions = {\n components?: Record<string, React.ComponentType<any>>;\n};\n\nexport const createAntdExtendedRenderers = (\n options: AntdExtendedRendererOptions = {},\n): JsonFormsRendererRegistryEntry[] => {\n return [\n { tester: extendedAgGridTester, renderer: AntdAgGridControlRenderer },\n { tester: monacoControlTester, renderer: AntdMonacoControlRenderer },\n {\n tester: antdButtonRendererTester,\n renderer: AntdButtonRenderer,\n },\n { tester: antdColorControlTester, renderer: AntdColorControlRenderer },\n /*\n Ahead of the extended set's own entry for the same tester: both rank 3,\n and JSON Forms breaks a tie by taking the first maximum, so the one with\n antd's typography wins.\n */\n { tester: markupLabelTester, renderer: AntdMarkupLabelRenderer },\n { tester: antdCronControlTester, renderer: AntdCronControlRenderer },\n {\n tester: antdDurationControlTester,\n renderer: AntdDurationControlRenderer,\n },\n { tester: antdMaskControlTester, renderer: AntdMaskControlRenderer },\n { tester: antdNullControlTester, renderer: AntdNullControlRenderer },\n { tester: antdSplitLayoutTester, renderer: AntdSplitLayoutRenderer },\n ...createExtendedRenderers({\n components: {\n Alert,\n Button,\n ...options.components,\n },\n includeButtonRenderer: false,\n }),\n ];\n};\n\nexport const antdExtendedRenderers = createAntdExtendedRenderers();\n\n/**\n * The extended controls, registered as **cells**.\n *\n * Both array presentations - the AG Grid renderer and the antd table - draw a\n * column through `DispatchCell` against the *cells* registry, never the\n * renderer registry, because dispatching a renderer would pick the object\n * renderer and inline a whole detail form in the cell. The consequence is\n * easy to miss: a control that exists only as a **renderer** is unreachable\n * in a column, and the column silently falls back to `TextCell` - a colour\n * field shows `#3366ff` as text, a duration shows `P2DT3H`.\n *\n * These entries close that. They are the **same components**, not cell-only\n * copies: `ControlFormItem` already drops the label and the inline message\n * when it is inside a `CellModeProvider`, which is exactly what a column\n * needs, so there is nothing for a second implementation to do.\n *\n * Kept out of the base `antdCells` because the components live here, and the\n * base renderer set must not depend on the extended one. That makes this\n * opt-in: a host that does not concatenate it keeps the text fallback.\n *\n * `monacoControlTester` is deliberately absent. A code editor is not a cell -\n * it draws no `ControlFormItem`, it wants height a row does not have, and the\n * composite detail dialog is where a value that large belongs.\n */\nexport const createAntdExtendedCells =\n (): JsonFormsCellRendererRegistryEntry[] =>\n [\n {\n tester: antdColorControlTester,\n cell: asCell(AntdColorControlRenderer),\n },\n {\n tester: antdCronControlTester,\n cell: asCell(AntdCronControlRenderer),\n },\n {\n tester: antdDurationControlTester,\n cell: asCell(AntdDurationControlRenderer),\n },\n { tester: antdMaskControlTester, cell: asCell(AntdMaskControlRenderer) },\n { tester: antdNullControlTester, cell: asCell(AntdNullControlRenderer) },\n /*\n `asCell` is why these are not registered directly, and the cast is\n what is left after it: a cell entry is typed `CellProps` while these\n read `ControlProps`. See `asCell.tsx` for the one field the two\n registries genuinely disagree about.\n */\n ] as unknown as JsonFormsCellRendererRegistryEntry[];\n\nexport const antdExtendedCells = createAntdExtendedCells();\nexport const advancedAntdRenderers = antdExtendedRenderers;\n\nexport * from '@chobantonov/jsonforms-react-extended-renderers';\nexport * from './renderers';\nexport * from './components/AntdMaskInput';\nexport {\n EMPTY_DURATION,\n parseDuration,\n formatDuration,\n} from '@chobantonov/jsonforms-react-renderer-common/formats/duration';\nexport type { DurationParts } from '@chobantonov/jsonforms-react-renderer-common/formats/duration';\nexport * from './cells/asCell';\n\nexport * from './renderers/AntdMonacoControlRenderer';\n\nexport * from './renderers/AntdAgGridControlRenderer';\n\nexport * from './util/colorFormat';\n\nexport {\n DEFAULT_MASK_TOKENS,\n MASKA_DEFAULT_TOKENS,\n compileTokenPattern,\n toMaskTokens,\n DEFAULT_MASK_SETTINGS,\n resolveMaskSettings,\n createMask,\n storedValue,\n fitsMask,\n displayValue,\n codePointLength,\n withinMaxLength,\n nextCaret,\n maskEdit,\n} from '@chobantonov/jsonforms-react-renderer-common/formats/maskFormat';\nexport type {\n MaskPattern,\n MaskTokenSpec,\n MaskTokenSpecs,\n MaskSettings,\n} from '@chobantonov/jsonforms-react-renderer-common/formats/maskFormat';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAUE;CACA;CACA;;CAeA;CACA;CAEA;A,GArBW2B,MAAoB,MAM/B;CAN+B,IAAA,EAC/B,YACA,SACA,gBAAAC,GACGC,IAAAd,EAAAa,GAAAH,EAAA;CAEH,OAAA,kBAACK,GAAAN,EAAAA,EAAA,CAAA,GACKK,CAAA,GAAA,CAAA,GAAA;EACE;EACN,MAAME,MAAY,YAAY,YAAY;EAC1C,QAAQA,MAAY;EAEnB;CACK,CAAA,CAAA;A,GAIGC,MAA0B,MAOrC;CAPqC,IAAA,EACrC,SACA,aAEA,SAASC,MAAAC,GACNL,IAAAd,EAAAmB,GAAAR,EAAA;CAEH,OAAA,kBAACI,GAAAN,EAAAA,EAAA,CAAA,GAAWK,CAAA,GAAA,CAAA,GAAA;EAAa;EAAM,MAAK;EAAO,MAAK;EAC7C;CACK,CAAA,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derer: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl>;
@@ -0,0 +1,3 @@
1
+ import { RankedTester } from '@jsonforms/core';
2
+ export declare const antdButtonRendererTester: RankedTester;
3
+ export declare const AntdButtonRenderer: import("react").ComponentType<import("@jsonforms/core").LayoutProps & import("@jsonforms/core").OwnPropsOfLayout> | ((props: import("@chobantonov/jsonforms-react-extended-renderers").ButtonRendererComponentProps) => React.JSX.Element | null);
@@ -0,0 +1,30 @@
1
+ import { ControlProps, RankedTester } from '@jsonforms/core';
2
+ import React from 'react';
3
+ /**
4
+ * Selection follows section 18: schema `format: "color"` **or** UI
5
+ * `options.format: "color"` on a plain string. The shared tester carries both;
6
+ * the antd-local one used to test the schema format alone, so a UI-driven
7
+ * color field on an unannotated string silently rendered as a text box.
8
+ */
9
+ export declare const antdColorControlTester: RankedTester;
10
+ /**
11
+ * One field rather than three widgets in a row: the swatch is the input's
12
+ * prefix, the color stays editable as text, and the input and picker each
13
+ * provide a clear affordance.
14
+ *
15
+ * Three things the widget layout has to serve, all from section 18 and
16
+ * Adjustment 8:
17
+ *
18
+ * - **Text and picker share one storage contract.** Whatever either produces is
19
+ * written in `colorSaveFormat`, and neither rewrites a value the user has not
20
+ * edited. Typed text is committed as typed and normalized on blur, so
21
+ * `#ff0` does not turn into `rgb(255, 255, 0)` between two keystrokes and
22
+ * move the caret.
23
+ * - **The picker can clear.** A footer action clears from inside the panel,
24
+ * including when text entry is off.
25
+ * - **An unparseable value stays visible.** It is left in the data for the
26
+ * validator to report rather than being replaced by the picker's fallback
27
+ * black.
28
+ */
29
+ export declare const AntdColorControl: (props: ControlProps) => React.JSX.Element | null;
30
+ export declare const AntdColorControlRenderer: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl>;
@@ -0,0 +1,43 @@
1
+ import { ControlProps, RankedTester } from '@jsonforms/core';
2
+ import React from 'react';
3
+ /**
4
+ * Selected the two ways section 5 describes, like every other temporal control.
5
+ *
6
+ * `format: "cron"` in the **schema** is the route that also gives a validator
7
+ * something to check, where the profile defines the keyword; `options.format`
8
+ * in the **UI schema** picks the same renderer for a plain string and leaves
9
+ * validation to `pattern`. Rank 3 is the shared rank for a format-selected
10
+ * control.
11
+ */
12
+ export declare const antdCronControlTester: RankedTester;
13
+ /**
14
+ * When something runs, as a schedule rather than as six fields of punctuation.
15
+ *
16
+ * Built like the duration control: **one field, not two widgets**. The
17
+ * expression is the value, it stays editable as text, and the picker hangs off
18
+ * an icon inside the input rather than sitting above it. Clearing follows the
19
+ * shared clear-value contract - `AntdClearableInput`, so the button has a
20
+ * localized name, appears on hover or focus, and returns the property to a
21
+ * missing state rather than to an empty string.
22
+ *
23
+ * The picker asks **how often it repeats** first, because that decides which of
24
+ * the six fields are worth showing: a schedule that runs every hour has nothing
25
+ * to say about which day it is, and five dropdowns reading "every" is a form
26
+ * that hides its own answer. Each field it does show is a list to choose from,
27
+ * and an empty one means every value.
28
+ *
29
+ * The period is a **lens, not data**. It selects nothing on its own - a
30
+ * property with no schedule in it opens with no period chosen and no rows - and
31
+ * the one thing changing it writes is the conditions it is about to hide. What
32
+ * does fill a value in is choosing one: see `withTimeDefaults`, because in cron
33
+ * a field left alone means *every* value, so "nine o'clock" with nothing else
34
+ * said is 3600 executions rather than one.
35
+ *
36
+ * Two things it will not do. It **edits only the field that was touched**, so
37
+ * the other five keep the spelling they were written with. And it **does not
38
+ * write at all** unless the schedule actually changed: OK on an untouched
39
+ * picker leaves the value alone, which is the rule the duration control keeps
40
+ * for `P1DT0H` against `P1D`.
41
+ */
42
+ export declare const AntdCronControl: (props: ControlProps) => React.JSX.Element | null;
43
+ export declare const AntdCronControlRenderer: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl>;
@@ -0,0 +1,5 @@
1
+ import { ControlProps, RankedTester } from '@jsonforms/core';
2
+ import React from 'react';
3
+ export declare const antdDurationControlTester: RankedTester;
4
+ export declare const AntdDurationControl: (props: ControlProps) => React.JSX.Element | null;
5
+ export declare const AntdDurationControlRenderer: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl>;
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ /**
3
+ * The markup label, wearing antd's typography.
4
+ *
5
+ * The `block` flag is ignored, and that is the interesting part: antd's
6
+ * `Typography.Paragraph` renders a **`div`**, not a `<p>` (checked - antd's
7
+ * own `component` default for it is `"div"`; `Typography` is an `article` and
8
+ * `Typography.Text` a `span`). So it is safe to wrap parsed Markdown in,
9
+ * which for a library whose paragraph really is a `<p>` it would not be.
10
+ * Using it for both modes keeps the two looking identical, which matters more
11
+ * here than honouring a distinction antd does not draw.
12
+ *
13
+ * `marginBottom: 0`: antd gives a paragraph a bottom margin, which inside a
14
+ * form's own vertical rhythm reads as an unexplained gap under one label. A
15
+ * host that wants the margin back switches `typography` off and styles the
16
+ * text itself, which is what that option is for.
17
+ */
18
+ export declare const AntdMarkupLabelRenderer: React.ComponentType<import("@jsonforms/core").OwnPropsOfLabel>;
@@ -0,0 +1,9 @@
1
+ import { ControlProps, RankedTester } from '@jsonforms/core';
2
+ import React from 'react';
3
+ /**
4
+ * Selection is `options.mask` carrying a pattern, on a string with no format of
5
+ * its own. See `maskControls.ts` for why presence alone is not enough.
6
+ */
7
+ export declare const antdMaskControlTester: RankedTester;
8
+ export declare const AntdMaskControl: (props: ControlProps) => React.JSX.Element;
9
+ export declare const AntdMaskControlRenderer: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl>;
@@ -0,0 +1 @@
1
+ export declare const AntdMonacoControlRenderer: import("react").ComponentType<import("@jsonforms/core").OwnPropsOfControl>;
@@ -0,0 +1,5 @@
1
+ import { ControlProps, RankedTester } from '@jsonforms/core';
2
+ import React from 'react';
3
+ export declare const antdNullControlTester: RankedTester;
4
+ export declare const AntdNullControl: (props: ControlProps) => React.JSX.Element | null;
5
+ export declare const AntdNullControlRenderer: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl>;
@@ -0,0 +1,6 @@
1
+ import { LayoutProps, RankedTester, UISchemaElement } from '@jsonforms/core';
2
+ import React from 'react';
3
+ export declare const hasAntdSplitLayoutVariant: (uischema: UISchemaElement) => boolean;
4
+ export declare const antdSplitLayoutTester: RankedTester;
5
+ export declare const AntdSplitLayout: (props: LayoutProps) => React.JSX.Element | null;
6
+ export declare const AntdSplitLayoutRenderer: React.ComponentType<LayoutProps & import("@jsonforms/core").OwnPropsOfLayout>;
@@ -0,0 +1,8 @@
1
+ export * from './AntdButtonRenderer';
2
+ export * from './AntdColorControlRenderer';
3
+ export * from './AntdCronControlRenderer';
4
+ export * from './AntdDurationControlRenderer';
5
+ export * from './AntdMaskControlRenderer';
6
+ export * from './AntdNullControlRenderer';
7
+ export * from './AntdSplitLayoutRenderer';
8
+ export * from './AntdMarkupLabelRenderer';
@@ -0,0 +1,11 @@
1
+ import type { ColorSaveFormat } from '@chobantonov/jsonforms-react-renderer-common/formats/colorFormat';
2
+ export { COLOR_SAVE_FORMATS, DEFAULT_COLOR_SAVE_FORMAT, asColorSaveFormat, normalizeHue, parseColor, isColor, isTransparent, hslToRgb, hsbToRgb, rgbToHsb, serializeColor, toCssColor, placeholderKeyFor, } from '@chobantonov/jsonforms-react-renderer-common/formats/colorFormat';
3
+ export type { ColorSaveFormat, Rgba, } from '@chobantonov/jsonforms-react-renderer-common/formats/colorFormat';
4
+ /**
5
+ * Which of antd's three picker panels matches a save format.
6
+ *
7
+ * Total, because every save format is one the picker can edit - that is why
8
+ * `hsl` output was dropped. `hex3` edits on the hex panel and is quantized on
9
+ * commit; it is a narrower hex, not a different model.
10
+ */
11
+ export declare const pickerFormatFor: (format: ColorSaveFormat) => "hex" | "rgb" | "hsb";
package/package.json CHANGED
@@ -1,6 +1,81 @@
1
1
  {
2
2
  "name": "@chobantonov/jsonforms-react-antd-extended-renderers",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "Extended Ant Design renderers for JSON Forms React",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/kchobantonov/jsonforms-react-renderers.git",
8
+ "directory": "packages/jsonforms-react-antd-extended-renderers"
9
+ },
10
+ "bugs": "https://github.com/kchobantonov/jsonforms-react-renderers/issues",
11
+ "homepage": "https://github.com/kchobantonov/jsonforms-react-renderers",
12
+ "license": "MIT",
13
+ "directories": {
14
+ "src": "src"
15
+ },
16
+ "files": [
17
+ "lib",
18
+ "src"
19
+ ],
20
+ "keywords": [
21
+ "antd",
22
+ "react",
23
+ "renderer",
24
+ "jsonforms",
25
+ "template",
26
+ "actions"
27
+ ],
28
+ "main": "lib/jsonforms-react-antd-extended.cjs.js",
29
+ "module": "lib/jsonforms-react-antd-extended.esm.js",
30
+ "typings": "lib/index.d.ts",
31
+ "peerDependencies": {
32
+ "@ant-design/icons": "^6.3.2",
33
+ "@jsonforms/core": "3.9.0-alpha.4",
34
+ "@jsonforms/react": "3.9.0-alpha.4",
35
+ "antd": "^6.6.5",
36
+ "react": "^18.0.0 || ^19.0.0",
37
+ "@chobantonov/jsonforms-react-antd-renderers": "0.1.0",
38
+ "@chobantonov/jsonforms-react-extended-renderers": "0.1.0"
39
+ },
40
+ "devDependencies": {
41
+ "@ant-design/icons": "6.3.2",
42
+ "@jsonforms/core": "3.9.0-alpha.4",
43
+ "@jsonforms/react": "3.9.0-alpha.4",
44
+ "@monaco-editor/react": "^4.6.0",
45
+ "@types/react": "^18.3.23",
46
+ "@types/react-dom": "^18.3.7",
47
+ "@vitest/coverage-v8": "5.1.1",
48
+ "antd": "6.6.5",
49
+ "jsdom": "^22.0.0",
50
+ "react": "^18.3.1",
51
+ "react-dom": "^18.3.1",
52
+ "rimraf": "^6.1.4",
53
+ "typedoc": "~0.28.20",
54
+ "typescript": "~6.0.3",
55
+ "vite": "npm:@voidzero-dev/vite-plus-core@8.3.8001",
56
+ "vitest": "5.1.1",
57
+ "@types/node": "^22.0.0",
58
+ "ag-grid-react": "36.1.0",
59
+ "@chobantonov/jsonforms-extended-spec": "0.2.0",
60
+ "@chobantonov/jsonforms-react-extended-renderers": "0.1.0",
61
+ "@chobantonov/jsonforms-react-antd-renderers": "0.1.0"
62
+ },
63
+ "dependencies": {
64
+ "@chobantonov/jsonforms-react-renderer-common": "0.1.0"
65
+ },
66
+ "publishConfig": {
67
+ "access": "public"
68
+ },
69
+ "scripts": {
70
+ "build": "vp build && tsc --emitDeclarationOnly && tsc --noEmit -p test/tsconfig.json",
71
+ "clean": "rimraf lib coverage dist .nyc_output 2> /dev/null",
72
+ "lint": "vp lint .",
73
+ "lint:fix": "vp run lint --fix",
74
+ "test": "vp test run",
75
+ "test:watch": "vp test",
76
+ "doc": "typedoc --name 'JSON Forms React Ant Design Extended Renderers' --excludeExternals --out docs src",
77
+ "tsc": "tsc --build tsconfig.json",
78
+ "typecheck": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p test/tsconfig.json",
79
+ "test-cov": "vp test run --coverage"
80
+ }
6
81
  }
@@ -0,0 +1,47 @@
1
+ import { UISchemaElement } from '@jsonforms/core';
2
+ import React from 'react';
3
+
4
+ /**
5
+ * Lets a **control** renderer serve as a **cell**.
6
+ *
7
+ * The two registries agree on almost everything and disagree on the one thing
8
+ * that matters, which is why this is not a plain cast:
9
+ *
10
+ * - `mapStateToCellProps` reads `ownProps.path` **as the path to the value**.
11
+ * - `mapStateToControlProps` reads `composeWithUi(uischema, ownProps.path)`,
12
+ * which **appends** the element's scope to that path.
13
+ *
14
+ * `DispatchCell` hands a column both a full path (`people.0.favoriteColor`)
15
+ * and a scoped uischema (`#/properties/favoriteColor`), because a cell
16
+ * ignores the second. A control does not, and reads
17
+ * `people.0.favoriteColor.favoriteColor` - which resolves to nothing. The
18
+ * symptom is a control that renders perfectly and is simply **empty**, and an
19
+ * edit that writes to a path no one reads. It looks like a data problem and
20
+ * is a registry-contract problem.
21
+ *
22
+ * Rewriting the scope to `#` is the fix: `composeWithUi` returns `path`
23
+ * unchanged when the scope has no data-path segments, so the control reads and
24
+ * writes exactly the value the column is for. The schema `DispatchCell`
25
+ * supplies is already the field's own, so `#` is the correct scope for it.
26
+ *
27
+ * Nothing else is adapted, and nothing needs to be: the label and the inline
28
+ * message are dropped by `ControlFormItem` inside a `CellModeProvider`, which
29
+ * is what makes one component able to serve both places.
30
+ */
31
+ /*
32
+ Constrained on `uischema` alone, not on `ControlProps`. A renderer that has
33
+ been through `withJsonFormsControlProps` is typed by its *own* props -
34
+ `OwnPropsOfControl` - and requiring the full `ControlProps` here would
35
+ reject every renderer this is meant to wrap.
36
+ */
37
+ export const asCell = <P extends { uischema?: UISchemaElement }>(
38
+ Control: React.ComponentType<P>,
39
+ ): React.ComponentType<P> => {
40
+ const Cell = (props: P) => (
41
+ <Control {...props} uischema={{ ...props.uischema, scope: '#' } as any} />
42
+ );
43
+ Cell.displayName = `asCell(${
44
+ Control.displayName ?? Control.name ?? 'Control'
45
+ })`;
46
+ return Cell;
47
+ };
@@ -0,0 +1,69 @@
1
+ import React from 'react';
2
+ import { Button, Card, Col, Row, Tooltip, Typography } from 'antd';
3
+ import {
4
+ ArrayPanel,
5
+ ValidationIcon,
6
+ } from '@chobantonov/jsonforms-react-antd-renderers';
7
+ import type { EditorArrayFrameProps } from '@chobantonov/jsonforms-react-extended-renderers';
8
+
9
+ const { Title } = Typography;
10
+
11
+ /**
12
+ * Mirrors ArrayLayoutToolbar from the antd renderer set so grid-backed arrays
13
+ * and the regular array renderers share one header: title with the validation
14
+ * indicator beside it, circular icon actions with tooltips on the right.
15
+ */
16
+ export const AntdArrayFrame = ({
17
+ options,
18
+ config,
19
+ label,
20
+ description,
21
+ errors,
22
+ actions = [],
23
+ children,
24
+ }: EditorArrayFrameProps) => (
25
+ <ArrayPanel
26
+ options={options}
27
+ config={config}
28
+ panelLabel={label}
29
+ style={{ width: '100%' }}
30
+ size='small'
31
+ type='inner'
32
+ title={
33
+ <>
34
+ <Row align='middle'>
35
+ <Col>
36
+ <Title level={5} style={{ marginBottom: 0 }}>
37
+ {label}
38
+ </Title>
39
+ </Col>
40
+ <Col style={{ paddingLeft: 8 }}>
41
+ <ValidationIcon
42
+ local
43
+ id='tooltip-validation'
44
+ errorMessages={errors ?? ''}
45
+ />
46
+ </Col>
47
+ </Row>
48
+ {description && <Card.Meta description={description} />}
49
+ </>
50
+ }
51
+ extra={actions.map((action) => (
52
+ <Tooltip key={action.key} title={action.label} placement='bottom'>
53
+ {/* span keeps the tooltip working while the button is disabled */}
54
+ <span style={{ display: 'inline-flex' }}>
55
+ <Button
56
+ disabled={action.disabled}
57
+ danger={action.danger}
58
+ aria-label={action.label}
59
+ onClick={action.onClick}
60
+ shape='circle'
61
+ icon={action.icon}
62
+ />
63
+ </span>
64
+ </Tooltip>
65
+ ))}
66
+ >
67
+ {children}
68
+ </ArrayPanel>
69
+ );