@ozen-ui/kit
Version:
React component library
49 lines (48 loc) • 1.67 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.useDataListBaseContext = exports.DataListBaseContext = exports.DataListBaseContextDefaultValue = void 0;
var react_1 = require("react");
var environment_1 = require("../../constants/environment");
exports.DataListBaseContextDefaultValue = {
optionsStore: {
setFocused: function () { },
availableOptions: { current: [] },
options: {
current: [],
},
currentOption: { current: null },
focused: { current: null },
setCurrentOption: function () { },
getOptionFullInfo: function () { return null; },
getOptionIndex: function () { return null; },
unregisterOption: function () { },
registerOption: function () { },
hasOptions: false,
},
optionsControl: {
isFocused: function () { return false; },
isSelected: function () { return false; },
},
scrollControl: {
scrollToOption: function () { },
},
valueControl: {
value: null,
hasValue: false,
setValue: function () { },
selectedOptionsLength: 0,
lastSelected: null,
},
multiple: false,
active: false,
disabled: true,
};
exports.DataListBaseContext = (0, react_1.createContext)(exports.DataListBaseContextDefaultValue);
var useDataListBaseContext = function () {
return (0, react_1.useContext)(exports.DataListBaseContext);
};
exports.useDataListBaseContext = useDataListBaseContext;
// Именованный провайдер
if (environment_1.isDev) {
exports.DataListBaseContext.displayName = 'DataListBaseContext';
}
;