Outlook_Addin_LLM/node_modules/@fluentui/react-tree/lib-commonjs/contexts/treeItemContext.js

43 lines
1.6 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
TreeItemContext: function() {
return TreeItemContext;
},
TreeItemProvider: function() {
return TreeItemProvider;
},
useTreeItemContext_unstable: function() {
return useTreeItemContext_unstable;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactcontextselector = require("@fluentui/react-context-selector");
const _createHeadlessTree = require("../utils/createHeadlessTree");
const defaultContextValue = {
value: _createHeadlessTree.headlessTreeRootId,
selectionRef: /*#__PURE__*/ _react.createRef(),
layoutRef: /*#__PURE__*/ _react.createRef(),
treeItemRef: /*#__PURE__*/ _react.createRef(),
subtreeRef: /*#__PURE__*/ _react.createRef(),
actionsRef: /*#__PURE__*/ _react.createRef(),
expandIconRef: /*#__PURE__*/ _react.createRef(),
isActionsVisible: false,
isAsideVisible: false,
itemType: 'leaf',
open: false,
checked: false
};
const TreeItemContext = (0, _reactcontextselector.createContext)(undefined);
const { Provider: TreeItemProvider } = TreeItemContext;
const useTreeItemContext_unstable = (selector)=>(0, _reactcontextselector.useContextSelector)(TreeItemContext, (ctx = defaultContextValue)=>selector(ctx));