@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 _AGBM3YM2cjs = require('./AGBM3YM2.cjs');
var _NUG2M4ODcjs = require('./NUG2M4OD.cjs');
var _E4LRYSXNcjs = require('./E4LRYSXN.cjs');
var _EMYYI4CZcjs = require('./EMYYI4CZ.cjs');
var _MZ2HG624cjs = require('./MZ2HG624.cjs');
// src/combobox/combobox-store.ts
var _comboboxstore = require('@ariakit/core/combobox/combobox-store'); var Core = _interopRequireWildcard(_comboboxstore);
function useComboboxStoreOptions(props) {
const tag = _AGBM3YM2cjs.useTagContext.call(void 0, );
props = {
...props,
tag: props.tag !== void 0 ? props.tag : tag
};
return _E4LRYSXNcjs.useCompositeStoreOptions.call(void 0, props);
}
function useComboboxStoreProps(store, update, props) {
_MZ2HG624cjs.useUpdateEffect.call(void 0, update, [props.tag]);
_EMYYI4CZcjs.useStoreProps.call(void 0, store, props, "value", "setValue");
_EMYYI4CZcjs.useStoreProps.call(void 0, store, props, "selectedValue", "setSelectedValue");
_EMYYI4CZcjs.useStoreProps.call(void 0, store, props, "resetValueOnHide");
_EMYYI4CZcjs.useStoreProps.call(void 0, store, props, "resetValueOnSelect");
return Object.assign(
_E4LRYSXNcjs.useCompositeStoreProps.call(void 0,
_NUG2M4ODcjs.usePopoverStoreProps.call(void 0, store, update, props),
update,
props
),
{ tag: props.tag }
);
}
function useComboboxStore(props = {}) {
props = useComboboxStoreOptions(props);
const [store, update] = _EMYYI4CZcjs.useStore.call(void 0, Core.createComboboxStore, props);
return useComboboxStoreProps(store, update, props);
}
exports.useComboboxStoreOptions = useComboboxStoreOptions; exports.useComboboxStoreProps = useComboboxStoreProps; exports.useComboboxStore = useComboboxStore;