@ariakit/react-core
Version:
Ariakit React core
41 lines (28 loc) • 1.93 kB
JavaScript
;Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }
var _SZKZ5GQPcjs = require('./SZKZ5GQP.cjs');
var _EMYYI4CZcjs = require('./EMYYI4CZ.cjs');
var _MZ2HG624cjs = require('./MZ2HG624.cjs');
// src/composite/composite-store.ts
var _compositestore = require('@ariakit/core/composite/composite-store'); var Core = _interopRequireWildcard(_compositestore);
function useCompositeStoreOptions(props) {
const id = _MZ2HG624cjs.useId.call(void 0, props.id);
return { id, ...props };
}
function useCompositeStoreProps(store, update, props) {
store = _SZKZ5GQPcjs.useCollectionStoreProps.call(void 0, store, update, props);
_EMYYI4CZcjs.useStoreProps.call(void 0, store, props, "activeId", "setActiveId");
_EMYYI4CZcjs.useStoreProps.call(void 0, store, props, "includesBaseElement");
_EMYYI4CZcjs.useStoreProps.call(void 0, store, props, "virtualFocus");
_EMYYI4CZcjs.useStoreProps.call(void 0, store, props, "orientation");
_EMYYI4CZcjs.useStoreProps.call(void 0, store, props, "rtl");
_EMYYI4CZcjs.useStoreProps.call(void 0, store, props, "focusLoop");
_EMYYI4CZcjs.useStoreProps.call(void 0, store, props, "focusWrap");
_EMYYI4CZcjs.useStoreProps.call(void 0, store, props, "focusShift");
return store;
}
function useCompositeStore(props = {}) {
props = useCompositeStoreOptions(props);
const [store, update] = _EMYYI4CZcjs.useStore.call(void 0, Core.createCompositeStore, props);
return useCompositeStoreProps(store, update, props);
}
exports.useCompositeStoreOptions = useCompositeStoreOptions; exports.useCompositeStoreProps = useCompositeStoreProps; exports.useCompositeStore = useCompositeStore;