@ariakit/react-core
Version:
Ariakit React core
55 lines (37 loc) • 2.06 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 _5ABIDBW2cjs = require('./5ABIDBW2.cjs');
var _JSAW5CXRcjs = require('./JSAW5CXR.cjs');
var _LRPJMEC3cjs = require('./LRPJMEC3.cjs');
var _RDNUVX4Vcjs = require('./RDNUVX4V.cjs');
var _4KGS3DOWcjs = require('./4KGS3DOW.cjs');
// src/combobox/combobox-store.ts
var _comboboxstore = require('@ariakit/core/combobox/combobox-store'); var Core = _interopRequireWildcard(_comboboxstore);
function useComboboxStoreOptions(props) {
const tag = _5ABIDBW2cjs.useTagContext.call(void 0, );
props = {
...props,
tag: props.tag !== void 0 ? props.tag : tag
};
return _LRPJMEC3cjs.useCompositeStoreOptions.call(void 0, props);
}
function useComboboxStoreProps(store, update, props) {
_4KGS3DOWcjs.useUpdateEffect.call(void 0, update, [props.tag]);
_RDNUVX4Vcjs.useStoreProps.call(void 0, store, props, "value", "setValue");
_RDNUVX4Vcjs.useStoreProps.call(void 0, store, props, "selectedValue", "setSelectedValue");
_RDNUVX4Vcjs.useStoreProps.call(void 0, store, props, "resetValueOnHide");
_RDNUVX4Vcjs.useStoreProps.call(void 0, store, props, "resetValueOnSelect");
return Object.assign(
_LRPJMEC3cjs.useCompositeStoreProps.call(void 0,
_JSAW5CXRcjs.usePopoverStoreProps.call(void 0, store, update, props),
update,
props
),
{ tag: props.tag }
);
}
function useComboboxStore(props = {}) {
props = useComboboxStoreOptions(props);
const [store, update] = _RDNUVX4Vcjs.useStore.call(void 0, Core.createComboboxStore, props);
return useComboboxStoreProps(store, update, props);
}
exports.useComboboxStoreOptions = useComboboxStoreOptions; exports.useComboboxStoreProps = useComboboxStoreProps; exports.useComboboxStore = useComboboxStore;