UNPKG

@hisptz/react-ui

Version:

A collection of reusable complex DHIS2 react ui components.

166 lines (160 loc) 3.78 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.WithUserOptions = exports.WithSearch = exports.WithLevelsAndGroups = exports.WithLevels = exports.WithGroups = exports.WithAllOptions = exports.SpecifyingRoots = exports.SingleSelection = exports.SelectionDisabledLevels = exports.SelectedOrgUnit = exports.FilterByGroups = exports.Default = void 0; var _react = _interopRequireDefault(require("react")); var _index = _interopRequireDefault(require("./index")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const Template = args => /*#__PURE__*/_react.default.createElement(_index.default, args); const Default = Template.bind({}); exports.Default = Default; Default.args = { value: { orgUnits: [] }, onUpdate: value => { console.log(value); } }; const SelectedOrgUnit = Template.bind({}); exports.SelectedOrgUnit = SelectedOrgUnit; SelectedOrgUnit.args = { value: { orgUnits: [{ path: "/ImspTQPwCqd/Vth0fbpFcsO/LhaAPLxdSFH/AvGz949akv4", children: [], id: "AvGz949akv4" }] }, onUpdate: value => { console.log(value); } }; const SingleSelection = Template.bind({}); exports.SingleSelection = SingleSelection; SingleSelection.args = { value: { orgUnits: [] }, onUpdate: value => { console.log(value); }, singleSelection: true }; const WithUserOptions = Template.bind({}); exports.WithUserOptions = WithUserOptions; WithUserOptions.args = { value: { orgUnits: [] }, onUpdate: value => { console.log(value); }, showUserOptions: true }; const WithLevels = Template.bind({}); exports.WithLevels = WithLevels; WithLevels.args = { value: { orgUnits: [] }, onUpdate: value => { console.log(value); }, showLevels: true }; const WithGroups = Template.bind({}); exports.WithGroups = WithGroups; WithGroups.args = { value: { orgUnits: [] }, onUpdate: value => { console.log(value); }, showGroups: true }; const WithSearch = Template.bind({}); exports.WithSearch = WithSearch; WithSearch.args = { value: { orgUnits: [] }, onUpdate: value => { console.log(value); }, searchable: true }; const WithLevelsAndGroups = Template.bind({}); exports.WithLevelsAndGroups = WithLevelsAndGroups; WithLevelsAndGroups.args = { value: { orgUnits: [] }, onUpdate: value => { console.log(value); }, showLevels: true, showGroups: true }; const WithAllOptions = Template.bind({}); exports.WithAllOptions = WithAllOptions; WithAllOptions.args = { value: { orgUnits: [] }, onUpdate: value => { console.log(value); }, showUserOptions: true, showLevels: true, showGroups: true, searchable: true }; const SelectionDisabledLevels = Template.bind({}); exports.SelectionDisabledLevels = SelectionDisabledLevels; SelectionDisabledLevels.args = { value: { orgUnits: [] }, onUpdate: value => { console.log(value); }, limitSelectionToLevels: [3, 2] }; const FilterByGroups = Template.bind({}); exports.FilterByGroups = FilterByGroups; FilterByGroups.args = { value: { orgUnits: [] }, onUpdate: value => { console.log(value); }, filterByGroups: ["RXL3lPSK8oG"] }; const SpecifyingRoots = Template.bind({}); exports.SpecifyingRoots = SpecifyingRoots; SpecifyingRoots.args = { value: { orgUnits: [] }, onUpdate: value => { console.log(value); }, roots: [{ id: "OjXNuYyLaCJ", children: [] }] }; var _default = { title: "Components/Organisation Unit Selector", component: _index.default, decorators: [Story => /*#__PURE__*/ // <OrgUnitDataProvider> _react.default.createElement(Story, null) // </OrgUnitDataProvider> ] }; exports.default = _default;