Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #6068: Documentation Fixes #6069

Merged
merged 14 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions components/doc/common/apidoc/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -43564,6 +43564,13 @@
"type": "SidebarPassThroughType<HTMLAttributes<HTMLSpanElement>>",
"description": "Uses to pass attributes to the close button's DOM element."
},
{
"name": "icons",
"optional": true,
"readonly": false,
"type": "SidebarPassThroughType<HTMLAttributes<HTMLDivElement>>",
"description": "Uses to pass attributes to the custom icons content's DOM element."
},
{
"name": "closeIcon",
"optional": true,
Expand All @@ -43578,13 +43585,6 @@
"type": "SidebarPassThroughType<HTMLAttributes<HTMLDivElement>>",
"description": "Uses to pass attributes to the content's DOM element."
},
{
"name": "icons",
"optional": true,
"readonly": false,
"type": "SidebarPassThroughType<HTMLAttributes<HTMLDivElement>>",
"description": "Uses to pass attributes to the custom icons content's DOM element."
},
{
"name": "mask",
"optional": true,
Expand Down
2 changes: 1 addition & 1 deletion components/doc/organizationchart/basicdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ import { OrganizationChart } from 'primereact/organizationchart';
import { TreeNode } from 'primereact/treenode';

export default function BasicDoc() {
const [data] = useState<TreeNode>([
const [data] = useState<TreeNode[]>([
{
label: 'Argentina',
expanded: true,
Expand Down
2 changes: 1 addition & 1 deletion components/doc/organizationchart/pt/ptdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ import { TreeNode } from 'primereact/treenode';

export default function PTDemo() {
const [selection, setSelection] = useState<TreeNode[]>([]);
const [data] = useState<TreeNode>([
const [data] = useState<TreeNode[]>([
{
label: 'Argentina',
expanded: true,
Expand Down
2 changes: 1 addition & 1 deletion components/doc/organizationchart/templatedoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ import { OrganizationChart } from 'primereact/organizationchart';
import { TreeNode } from 'primereact/treenode';

export default function TemplateDemo() {
const [data] = useState<TreeNode>([
const [data] = useState<TreeNode[]>([
{
label: 'Argentina',
expanded: true,
Expand Down
3 changes: 2 additions & 1 deletion components/doc/tree/eventsdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
8 changes: 4 additions & 4 deletions components/doc/treetable/contextmenudoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<TreeNode>([]);
const [nodes, setNodes] = useState<TreeNode[]>([]);
const [expandedKeys, setExpandedKeys] = useState<TreeTableExpandedKeysType | null>(null);
const [selectedNodeKey, setSelectedNodeKey] = useState<string>(null);
const [selectedNodeKey, setSelectedNodeKey] = useState<string | null>(null);
const toast = useRef<Toast>(null);
const cm = useRef<ContextMenu>(null);
const menu = [
Expand Down
4 changes: 2 additions & 2 deletions components/doc/treetable/filterdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ interface FilterModeOption {
}

export default function FilterDemo() {
const [nodes, setNodes] = useState<TreeNode>([]);
const [nodes, setNodes] = useState<TreeNode[]>([]);
const [globalFilter, setGlobalFilter] = useState<string>('');
const [filterMode, setFilterMode] = useState('lenient');
const [filterMode, setFilterMode] = useState<'lenient' | 'strict'>('lenient');
const [filterOptions] = useState<FilterModeOption[]>([
{ label: 'Lenient', value: 'lenient' },
{ label: 'Strict', value: 'strict' }
Expand Down
2 changes: 1 addition & 1 deletion components/doc/treetable/scroll/frozencolumnsdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<TreeNode[]>([]);

useEffect(() => {
NodeService.getTreeTableNodes().then(data => setNodes(data));
Expand Down
2 changes: 1 addition & 1 deletion components/doc/treetable/scroll/verticaldoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import { TreeNode } from 'primereact/treenode';
import { NodeService } from './service/NodeService';

export default function VerticalScrollDemo() {
const [nodes, setNodes] = useState<TreeNode>([]);
const [nodes, setNodes] = useState<TreeNode[]>([]);

useEffect(() => {
NodeService.getTreeTableNodes().then(data => setNodes(data));
Expand Down
2 changes: 1 addition & 1 deletion components/doc/treetable/selection/multipledoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ import { InputSwitch, InputSwitchChangeEvent } from 'primereact/inputswitch';
import { NodeService } from './service/NodeService';

export default function MultipleRowsSelectionDemo() {
const [nodes, setNodes] = useState<TreeNode>([]);
const [nodes, setNodes] = useState<TreeNode[]>([]);
const [selectedNodeKeys, setSelectedNodeKeys] = useState<TreeTableSelectionKeysType | null>(null);
const [metaKey, setMetaKey] = useState<boolean>(true);

Expand Down
2 changes: 1 addition & 1 deletion components/doc/treetable/selection/singledoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ import { InputSwitch, InputSwitchChangeEvent } from 'primereact/inputswitch';
import { NodeService } from './service/NodeService';

export default function SingleRowSelectionDemo() {
const [nodes, setNodes] = useState<TreeNode>([]);
const [nodes, setNodes] = useState<TreeNode[]>([]);
const [selectedNodeKey, setSelectedNodeKey] = useState<string | null>(null);
const [metaKey, setMetaKey] = useState<boolean>(true);

Expand Down
8 changes: 4 additions & 4 deletions components/lib/sidebar/sidebar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ export interface SidebarPassThroughOptions {
* Uses to pass attributes to the close button's DOM element.
*/
closeButtonIcon?: SidebarPassThroughType<React.HTMLAttributes<HTMLSpanElement>>;
/**
* Uses to pass attributes to the custom icons content's DOM element.
*/
icons?: SidebarPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
/**
* Uses to pass attributes to the close icon's DOM element.
*/
Expand All @@ -50,10 +54,6 @@ export interface SidebarPassThroughOptions {
* Uses to pass attributes to the content's DOM element.
*/
content?: SidebarPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
/**
* Uses to pass attributes to the custom icons content's DOM element.
*/
icons?: SidebarPassThroughType<React.HTMLAttributes<HTMLDivElement>>;
/**
* Uses to pass attributes to the mask's DOM element.
*/
Expand Down
Loading