UNPKG

@ariakit/react-core

Version:

Ariakit React core

53 lines (35 loc) 1.9 kB
"use strict";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 _JSAW5CXRcjs = require('./JSAW5CXR.cjs'); var _LRPJMEC3cjs = require('./LRPJMEC3.cjs'); var _IOFHSY3Lcjs = require('./IOFHSY3L.cjs'); var _RDNUVX4Vcjs = require('./RDNUVX4V.cjs'); var _4KGS3DOWcjs = require('./4KGS3DOW.cjs'); // src/select/select-store.ts var _selectstore = require('@ariakit/core/select/select-store'); var Core = _interopRequireWildcard(_selectstore); function useSelectStoreOptions(props) { const combobox = _IOFHSY3Lcjs.useComboboxProviderContext.call(void 0, ); props = { ...props, combobox: props.combobox !== void 0 ? props.combobox : combobox }; return _LRPJMEC3cjs.useCompositeStoreOptions.call(void 0, props); } function useSelectStoreProps(store, update, props) { _4KGS3DOWcjs.useUpdateEffect.call(void 0, update, [props.combobox]); _RDNUVX4Vcjs.useStoreProps.call(void 0, store, props, "value", "setValue"); _RDNUVX4Vcjs.useStoreProps.call(void 0, store, props, "setValueOnMove"); return Object.assign( _JSAW5CXRcjs.usePopoverStoreProps.call(void 0, _LRPJMEC3cjs.useCompositeStoreProps.call(void 0, store, update, props), update, props ), { combobox: props.combobox } ); } function useSelectStore(props = {}) { props = useSelectStoreOptions(props); const [store, update] = _RDNUVX4Vcjs.useStore.call(void 0, Core.createSelectStore, props); return useSelectStoreProps(store, update, props); } exports.useSelectStoreOptions = useSelectStoreOptions; exports.useSelectStoreProps = useSelectStoreProps; exports.useSelectStore = useSelectStore;