UNPKG

@hisptz/react-ui

Version:

A collection of reusable complex DHIS2 react ui components.

45 lines (37 loc) 1.61 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.RHFLegendDefinitionWithVerification = exports.RHFLegendDefinition = void 0; var _react = _interopRequireDefault(require("react")); var _reactHookForm = require("react-hook-form"); var _ConfirmDialog = require("../ConfirmDialog"); var _RHF = _interopRequireDefault(require("./components/RHF")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const Template = args => /*#__PURE__*/_react.default.createElement(_RHF.default, args); const RHFLegendDefinition = Template.bind({}); exports.RHFLegendDefinition = RHFLegendDefinition; RHFLegendDefinition.args = { shouldVerify: false, label: "Legend Definitions", name: "legendDefinitions" }; const RHFLegendDefinitionWithVerification = Template.bind({}); exports.RHFLegendDefinitionWithVerification = RHFLegendDefinitionWithVerification; RHFLegendDefinitionWithVerification.args = { shouldVerify: true, label: "Legend Definitions", name: "legendDefinitions", onResetLegends: () => { console.log("Reset legends"); } }; var _default = { title: "Components/Legend Definitions/RHF", component: RHFLegendDefinition, decorators: [LegendDefinitionStory => { const form = (0, _reactHookForm.useForm)(); return /*#__PURE__*/_react.default.createElement(_ConfirmDialog.ConfirmDialogProvider, null, /*#__PURE__*/_react.default.createElement(_reactHookForm.FormProvider, form, /*#__PURE__*/_react.default.createElement(LegendDefinitionStory, null))); }] }; exports.default = _default;