@vitrosoftware/common-ui-ts 1.1.55 → 1.1.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,13 @@
1
1
  /// <reference types="react" />
2
2
  import 'jstree';
3
3
  import { TreeViewContext } from './TreeViewContext';
4
- interface TreeViewProps {
4
+ export interface TreeViewProps {
5
5
  id: string;
6
6
  getData: (obj: any, cb: any) => any;
7
7
  onInit: (jsTreeView: TreeViewContext) => any;
8
8
  isCheckboxSelect?: boolean;
9
9
  isSaveCheckboxState?: boolean;
10
+ expandNodeIdList?: string[];
11
+ selectNodeId?: string;
10
12
  }
11
13
  export declare const TreeView: (props: TreeViewProps) => JSX.Element;
12
- export {};
@@ -1,6 +1,6 @@
1
1
  import { PLUGIN, CASCADE, NODE_TYPE } from './TreeViewConstants';
2
2
  export declare class TreeViewConfig {
3
- static getConfig(id: string, checkboxSelect?: boolean, saveChecked?: boolean): {
3
+ static getConfig(id: string, checkboxSelect?: boolean, saveChecked?: boolean, expandNodeIdList?: string[], selectNodeId?: string): {
4
4
  core: {
5
5
  check_callback: boolean;
6
6
  themes: {
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import commonRu from './locale/common-ru.json';
4
4
  export { commonRu, commonEn };
5
5
  import { Breadcrumbs } from './controls/Breadcrumbs/Breadcrumbs';
6
6
  import { TopLevelMenu } from './controls/TopLevelMenu/TopLevelMenu';
7
- import { TreeView } from './controls/TreeView/TreeView';
7
+ import { TreeView, TreeViewProps } from './controls/TreeView/TreeView';
8
8
  import { TreeViewContext } from './controls/TreeView/TreeViewContext';
9
9
  import * as TREE_VIEW from './controls/TreeView/TreeViewConstants';
10
10
  import { TableView } from './controls/TableView/TableView';
@@ -73,7 +73,7 @@ import { Tooltip } from './controls/Tooltip/Tooltip';
73
73
  import * as TOOLTIP from './controls/Tooltip/TooltipConstants';
74
74
  export { Breadcrumbs };
75
75
  export { TopLevelMenu };
76
- export { TreeView, TreeViewContext, TREE_VIEW };
76
+ export { TreeView, TreeViewContext, TREE_VIEW, TreeViewProps };
77
77
  export { TableView, TableViewContext, TableViewRow, TableViewCol, TABLE_VIEW };
78
78
  export { MicroFrontend };
79
79
  export { TelerikUploader, TelerikUploaderContext, TelerikUploaderContextImpl, TelerikUploaderSettings };
package/dist/index.js CHANGED
@@ -20189,7 +20189,7 @@ var TreeViewConstants = {
20189
20189
 
20190
20190
  var TreeViewConfig = /*#__PURE__*/function () {
20191
20191
  function TreeViewConfig() {}
20192
- TreeViewConfig.getConfig = function getConfig(id, checkboxSelect, saveChecked) {
20192
+ TreeViewConfig.getConfig = function getConfig(id, checkboxSelect, saveChecked, expandNodeIdList, selectNodeId) {
20193
20193
  return {
20194
20194
  core: {
20195
20195
  check_callback: true,
@@ -20221,6 +20221,18 @@ var TreeViewConfig = /*#__PURE__*/function () {
20221
20221
  if (!saveChecked) {
20222
20222
  delete state.checkbox;
20223
20223
  }
20224
+ if (expandNodeIdList) {
20225
+ if (!state.core) {
20226
+ state.core = {};
20227
+ }
20228
+ state.core.open = expandNodeIdList;
20229
+ }
20230
+ if (selectNodeId) {
20231
+ if (!state.core) {
20232
+ state.core = {};
20233
+ }
20234
+ state.core.selected = [selectNodeId];
20235
+ }
20224
20236
  return state;
20225
20237
  }
20226
20238
  },
@@ -20355,7 +20367,7 @@ var TreeView = function TreeView(props) {
20355
20367
  jsTreeTreeView = _useState[0],
20356
20368
  setJsTreeTreeView = _useState[1];
20357
20369
  var jsTreeRef = React.useRef(null);
20358
- var config = TreeViewConfig.getConfig(props.id, props.isCheckboxSelect, props.isSaveCheckboxState);
20370
+ var config = TreeViewConfig.getConfig(props.id, props.isCheckboxSelect, props.isSaveCheckboxState, props.expandNodeIdList, props.selectNodeId);
20359
20371
  var jsTreeView;
20360
20372
  React.useEffect(function () {
20361
20373
  config.core.data = props.getData;