@ariakit/react-core
Version:
Ariakit React core
58 lines (37 loc) • 2.19 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 _I64JXNZFcjs = require('./I64JXNZF.cjs');
var _UD6FJPUHcjs = require('./UD6FJPUH.cjs');
var _HWGKYR5Tcjs = require('./HWGKYR5T.cjs');
var _25BPIGZHcjs = require('./25BPIGZH.cjs');
var _OZM4QA2Vcjs = require('./OZM4QA2V.cjs');
var _7EQBAZ46cjs = require('./7EQBAZ46.cjs');
// src/combobox/combobox-store.ts
var _comboboxstore = require('@ariakit/core/combobox/combobox-store'); var Core = _interopRequireWildcard(_comboboxstore);
function useComboboxStoreOptions(props) {
const tag = _I64JXNZFcjs.useTagContext.call(void 0, );
props = _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
tag: props.tag !== void 0 ? props.tag : tag
});
return _HWGKYR5Tcjs.useCompositeStoreOptions.call(void 0, props);
}
function useComboboxStoreProps(store, update, props) {
_OZM4QA2Vcjs.useUpdateEffect.call(void 0, update, [props.tag]);
_25BPIGZHcjs.useStoreProps.call(void 0, store, props, "value", "setValue");
_25BPIGZHcjs.useStoreProps.call(void 0, store, props, "selectedValue", "setSelectedValue");
_25BPIGZHcjs.useStoreProps.call(void 0, store, props, "resetValueOnHide");
_25BPIGZHcjs.useStoreProps.call(void 0, store, props, "resetValueOnSelect");
return Object.assign(
_HWGKYR5Tcjs.useCompositeStoreProps.call(void 0,
_UD6FJPUHcjs.usePopoverStoreProps.call(void 0, store, update, props),
update,
props
),
{ tag: props.tag }
);
}
function useComboboxStore(props = {}) {
props = useComboboxStoreOptions(props);
const [store, update] = _25BPIGZHcjs.useStore.call(void 0, Core.createComboboxStore, props);
return useComboboxStoreProps(store, update, props);
}
exports.useComboboxStoreOptions = useComboboxStoreOptions; exports.useComboboxStoreProps = useComboboxStoreProps; exports.useComboboxStore = useComboboxStore;