39 lines
1.2 KiB
JavaScript
39 lines
1.2 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, {
|
|
TreeContext: function() {
|
|
return TreeContext;
|
|
},
|
|
useTreeContext_unstable: function() {
|
|
return useTreeContext_unstable;
|
|
}
|
|
});
|
|
const _reactcontextselector = require("@fluentui/react-context-selector");
|
|
const _ImmutableSet = require("../utils/ImmutableSet");
|
|
const _ImmutableMap = require("../utils/ImmutableMap");
|
|
/**
|
|
* @internal
|
|
*/ const defaultTreeContextValue = {
|
|
level: 0,
|
|
contextType: 'root',
|
|
treeType: 'nested',
|
|
selectionMode: 'none',
|
|
openItems: _ImmutableSet.ImmutableSet.empty,
|
|
checkedItems: _ImmutableMap.ImmutableMap.empty,
|
|
requestTreeResponse: noop,
|
|
appearance: 'subtle',
|
|
size: 'medium'
|
|
};
|
|
function noop() {
|
|
/* noop */ }
|
|
const TreeContext = (0, _reactcontextselector.createContext)(undefined);
|
|
const useTreeContext_unstable = (selector)=>(0, _reactcontextselector.useContextSelector)(TreeContext, (ctx = defaultTreeContextValue)=>selector(ctx));
|