diff --git a/components/doc/common/apidoc/index.json b/components/doc/common/apidoc/index.json index 8d450870ca..e3593efab1 100644 --- a/components/doc/common/apidoc/index.json +++ b/components/doc/common/apidoc/index.json @@ -43564,6 +43564,13 @@ "type": "SidebarPassThroughType>", "description": "Uses to pass attributes to the close button's DOM element." }, + { + "name": "icons", + "optional": true, + "readonly": false, + "type": "SidebarPassThroughType>", + "description": "Uses to pass attributes to the custom icons content's DOM element." + }, { "name": "closeIcon", "optional": true, @@ -43578,13 +43585,6 @@ "type": "SidebarPassThroughType>", "description": "Uses to pass attributes to the content's DOM element." }, - { - "name": "icons", - "optional": true, - "readonly": false, - "type": "SidebarPassThroughType>", - "description": "Uses to pass attributes to the custom icons content's DOM element." - }, { "name": "mask", "optional": true, diff --git a/components/doc/organizationchart/basicdoc.js b/components/doc/organizationchart/basicdoc.js index 88c93c3b4b..086050c441 100644 --- a/components/doc/organizationchart/basicdoc.js +++ b/components/doc/organizationchart/basicdoc.js @@ -92,7 +92,7 @@ import { OrganizationChart } from 'primereact/organizationchart'; import { TreeNode } from 'primereact/treenode'; export default function BasicDoc() { - const [data] = useState([ + const [data] = useState([ { label: 'Argentina', expanded: true, diff --git a/components/doc/organizationchart/pt/ptdoc.js b/components/doc/organizationchart/pt/ptdoc.js index f6cd6ce570..3d13edc645 100644 --- a/components/doc/organizationchart/pt/ptdoc.js +++ b/components/doc/organizationchart/pt/ptdoc.js @@ -115,7 +115,7 @@ import { TreeNode } from 'primereact/treenode'; export default function PTDemo() { const [selection, setSelection] = useState([]); - const [data] = useState([ + const [data] = useState([ { label: 'Argentina', expanded: true, diff --git a/components/doc/organizationchart/templatedoc.js b/components/doc/organizationchart/templatedoc.js index 08b3b25b97..a13e629aa7 100644 --- a/components/doc/organizationchart/templatedoc.js +++ b/components/doc/organizationchart/templatedoc.js @@ -124,7 +124,7 @@ import { OrganizationChart } from 'primereact/organizationchart'; import { TreeNode } from 'primereact/treenode'; export default function TemplateDemo() { - const [data] = useState([ + const [data] = useState([ { label: 'Argentina', expanded: true, diff --git a/components/doc/tree/eventsdoc.js b/components/doc/tree/eventsdoc.js index 6760470ace..c4e8b9a7d4 100644 --- a/components/doc/tree/eventsdoc.js +++ b/components/doc/tree/eventsdoc.js @@ -80,8 +80,9 @@ export default function EventsDemo() { `, typescript: ` import React, { useState, useEffect, useRef } from 'react'; -import { Tree, TreeNode, TreeEventNodeEvent } from 'primereact/tree'; +import { Tree, TreeEventNodeEvent } from 'primereact/tree'; import { Toast } from 'primereact/toast'; +import { TreeNode } from "primereact/treenode"; import { NodeService } from './service/NodeService'; export default function EventsDemo() { diff --git a/components/doc/treetable/contextmenudoc.js b/components/doc/treetable/contextmenudoc.js index 08b3d02197..f39340863a 100644 --- a/components/doc/treetable/contextmenudoc.js +++ b/components/doc/treetable/contextmenudoc.js @@ -106,17 +106,17 @@ export default function ContextMenuDemo() { `, typescript: ` import React, { useState, useEffect, useRef } from 'react'; -import { TreeTable } from 'primereact/treetable'; +import { TreeTable, TreeTableExpandedKeysType } from 'primereact/treetable'; import { ContextMenu } from 'primereact/contextmenu'; import { Toast } from 'primereact/toast'; import { Column } from 'primereact/column'; -import { TreeNode } from 'primereact/column'; +import { TreeNode } from 'primereact/treenode'; import { NodeService } from './service/NodeService'; export default function ContextMenuDemo() { - const [nodes, setNodes] = useState([]); + const [nodes, setNodes] = useState([]); const [expandedKeys, setExpandedKeys] = useState(null); - const [selectedNodeKey, setSelectedNodeKey] = useState(null); + const [selectedNodeKey, setSelectedNodeKey] = useState(null); const toast = useRef(null); const cm = useRef(null); const menu = [ diff --git a/components/doc/treetable/filterdoc.js b/components/doc/treetable/filterdoc.js index 9d23d38b2d..4108534b1a 100644 --- a/components/doc/treetable/filterdoc.js +++ b/components/doc/treetable/filterdoc.js @@ -106,9 +106,9 @@ interface FilterModeOption { } export default function FilterDemo() { - const [nodes, setNodes] = useState([]); + const [nodes, setNodes] = useState([]); const [globalFilter, setGlobalFilter] = useState(''); - const [filterMode, setFilterMode] = useState('lenient'); + const [filterMode, setFilterMode] = useState<'lenient' | 'strict'>('lenient'); const [filterOptions] = useState([ { label: 'Lenient', value: 'lenient' }, { label: 'Strict', value: 'strict' } diff --git a/components/doc/treetable/scroll/frozencolumnsdoc.js b/components/doc/treetable/scroll/frozencolumnsdoc.js index 68f36c1207..f02d898bd0 100644 --- a/components/doc/treetable/scroll/frozencolumnsdoc.js +++ b/components/doc/treetable/scroll/frozencolumnsdoc.js @@ -60,7 +60,7 @@ import { TreeNode } from 'primereact/treenode'; import { NodeService } from './service/NodeService'; export default function FrozenColumnsDemo() { - const [nodes, setNodes] = useState([]); + const [nodes, setNodes] = useState([]); useEffect(() => { NodeService.getTreeTableNodes().then(data => setNodes(data)); diff --git a/components/doc/treetable/scroll/verticaldoc.js b/components/doc/treetable/scroll/verticaldoc.js index 7a45e532d0..e20e8f350b 100644 --- a/components/doc/treetable/scroll/verticaldoc.js +++ b/components/doc/treetable/scroll/verticaldoc.js @@ -52,7 +52,7 @@ import { TreeNode } from 'primereact/treenode'; import { NodeService } from './service/NodeService'; export default function VerticalScrollDemo() { - const [nodes, setNodes] = useState([]); + const [nodes, setNodes] = useState([]); useEffect(() => { NodeService.getTreeTableNodes().then(data => setNodes(data)); diff --git a/components/doc/treetable/selection/multipledoc.js b/components/doc/treetable/selection/multipledoc.js index 5575c0ddfe..b19b6924c9 100644 --- a/components/doc/treetable/selection/multipledoc.js +++ b/components/doc/treetable/selection/multipledoc.js @@ -75,7 +75,7 @@ import { InputSwitch, InputSwitchChangeEvent } from 'primereact/inputswitch'; import { NodeService } from './service/NodeService'; export default function MultipleRowsSelectionDemo() { - const [nodes, setNodes] = useState([]); + const [nodes, setNodes] = useState([]); const [selectedNodeKeys, setSelectedNodeKeys] = useState(null); const [metaKey, setMetaKey] = useState(true); diff --git a/components/doc/treetable/selection/singledoc.js b/components/doc/treetable/selection/singledoc.js index 80c63330bd..eb3878ea93 100644 --- a/components/doc/treetable/selection/singledoc.js +++ b/components/doc/treetable/selection/singledoc.js @@ -66,7 +66,7 @@ import { InputSwitch, InputSwitchChangeEvent } from 'primereact/inputswitch'; import { NodeService } from './service/NodeService'; export default function SingleRowSelectionDemo() { - const [nodes, setNodes] = useState([]); + const [nodes, setNodes] = useState([]); const [selectedNodeKey, setSelectedNodeKey] = useState(null); const [metaKey, setMetaKey] = useState(true); diff --git a/components/lib/sidebar/sidebar.d.ts b/components/lib/sidebar/sidebar.d.ts index b49d7c7bd5..2738e763d4 100644 --- a/components/lib/sidebar/sidebar.d.ts +++ b/components/lib/sidebar/sidebar.d.ts @@ -42,6 +42,10 @@ export interface SidebarPassThroughOptions { * Uses to pass attributes to the close button's DOM element. */ closeButtonIcon?: SidebarPassThroughType>; + /** + * Uses to pass attributes to the custom icons content's DOM element. + */ + icons?: SidebarPassThroughType>; /** * Uses to pass attributes to the close icon's DOM element. */ @@ -50,10 +54,6 @@ export interface SidebarPassThroughOptions { * Uses to pass attributes to the content's DOM element. */ content?: SidebarPassThroughType>; - /** - * Uses to pass attributes to the custom icons content's DOM element. - */ - icons?: SidebarPassThroughType>; /** * Uses to pass attributes to the mask's DOM element. */