UNPKG

@aokiapp/rjsf-mantine-theme

Version:

Mantine theme, fields and widgets for react-jsonschema-form

76 lines (71 loc) 2.16 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var jsxRuntime = require('react/jsx-runtime'); var core = require('@mantine/core'); function ArrayFieldItemTemplate(props) { const { children, className, disabled, hasToolbar, hasCopy, hasMoveDown, hasMoveUp, hasRemove, index, onCopyIndexClick, onDropIndexClick, onReorderClick, readonly, uiSchema, registry } = props; const { CopyButton, MoveDownButton, MoveUpButton, RemoveButton } = registry.templates.ButtonTemplates; return /* @__PURE__ */ jsxRuntime.jsxs(core.Box, { className: `armt-template-arrayfielditem ${className}`, children: [ children, hasToolbar && (hasMoveUp || hasMoveDown || hasRemove || hasCopy) && /* @__PURE__ */ jsxRuntime.jsxs(core.Group, { justify: "flex-end", children: [ (hasMoveUp || hasMoveDown) && /* @__PURE__ */ jsxRuntime.jsx( MoveUpButton, { className: "armt-template-afit-move-up", disabled: disabled || readonly || !hasMoveUp, onClick: onReorderClick(index, index - 1), uiSchema, registry } ), (hasMoveUp || hasMoveDown) && /* @__PURE__ */ jsxRuntime.jsx( MoveDownButton, { className: "armt-template-afit-move-down", disabled: disabled || readonly || !hasMoveDown, onClick: onReorderClick(index, index + 1), uiSchema, registry } ), hasCopy && /* @__PURE__ */ jsxRuntime.jsx( CopyButton, { className: "armt-template-afit-copy", disabled: disabled || readonly, onClick: onCopyIndexClick(index), uiSchema, registry } ), hasRemove && /* @__PURE__ */ jsxRuntime.jsx( RemoveButton, { className: "armt-template-afit-remove", disabled: disabled || readonly, onClick: onDropIndexClick(index), uiSchema, registry } ) ] }) ] }); } exports.default = ArrayFieldItemTemplate; //# sourceMappingURL=ArrayFieldItemTemplate.cjs.map