@fruits-chain/react-native-xiaoshu
Version:
🌈 React Native UI library
35 lines (34 loc) • 950 B
JavaScript
import React from 'react';
import Portal from "../portal/index.js";
import StepSelector from "./step-selector.js";
import StopSelectorMethod from "./step-selector-method.js";
import { jsx as _jsx } from "react/jsx-runtime";
export const Instance = opts => {
return new Promise((resolve, reject) => {
const key = Portal.add(/*#__PURE__*/_jsx(StopSelectorMethod, {
...opts,
onClosed: () => {
Portal.remove(key);
opts.onClosed?.();
},
onConfirm: (v, o, isEnd) => {
opts.onConfirm?.(v, o, isEnd);
resolve(v);
},
onCancel: () => {
opts.onCancel?.();
reject(new Error());
}
}));
});
};
export const Component = props => {
return /*#__PURE__*/_jsx(Portal, {
children: /*#__PURE__*/_jsx(StepSelector, {
...props
})
});
};
export const StepSelectorComponent = StepSelector;
//# sourceMappingURL=step-selector-instance.js.map
;