From 3cad026c0170abb8d3391635cd11d008dd12d296 Mon Sep 17 00:00:00 2001 From: Magnus Ellinge Date: Sun, 31 Mar 2019 01:16:52 +0100 Subject: [PATCH] fix: Missing 'the' and jsdoclint-fixes --- README.md | 2 +- types/react-dropdown-tree-select.d.ts | 62 ++++++++++++++++++--------- 2 files changed, 42 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 2b245060..b42d6716 100644 --- a/README.md +++ b/README.md @@ -327,7 +327,7 @@ Type: `bool` (default: `false`) Type: `string` -Specific id for container. The container renders with a default id of `rdtsN` where N is count of the current component rendered. +Specific id for container. The container renders with a default id of `rdtsN` where N is the count of the current component rendered. Use to ensure a own unique id when a simple counter is not sufficient, e.g in a partial server render (SSR) diff --git a/types/react-dropdown-tree-select.d.ts b/types/react-dropdown-tree-select.d.ts index c98ea1c9..9bc49257 100644 --- a/types/react-dropdown-tree-select.d.ts +++ b/types/react-dropdown-tree-select.d.ts @@ -1,58 +1,74 @@ -declare module 'react-dropdown-tree-select' { - import * as React from 'react'; - +// tslint:disable:interface-name +declare module "react-dropdown-tree-select" { + import * as React from "react"; + export type TreeData = Object | TreeNodeProps[]; - + export interface DropdownTreeSelectProps { data: TreeData; /** Clear the input search if a node has been selected/unselected */ clearSearchOnChange?: boolean; /** Displays search results as a tree instead of flattened results */ keepTreeOnSearch?: boolean; - /** Displays children of found nodes to allow searching for a parent node on then selecting any child node of the found node. Defaults to false - * NOTE this works only in combination with keepTreeOnSearch */ + /** Displays children of found nodes to allow searching for a parent node on + * then selecting any child node of the found node. Defaults to false + * NOTE this works only in combination with keepTreeOnSearch + */ keepChildrenOnSearch?: boolean; /** The text to display as placeholder on the search box. Defaults to Choose... */ placeholderText?: string; - /** If set to true, shows the dropdown when rendered. This can be used to render the component with the dropdown open as its initial state */ + /** If set to true, shows the dropdown when rendered. + * This can be used to render the component with the dropdown open as its initial state + */ showDropdown?: boolean; /** Additional classname for container. - * The container renders with a default classname of react-dropdown-tree-select */ + * The container renders with a default classname of react-dropdown-tree-select + */ className?: string; /** Fires when a node change event occurs. Currently the following actions trigger a node change: * Checkbox click which checks/unchecks the item * Closing of pill (which unchecks the corresponding checkbox item) - * - * Calls the handler with the current node object and all selected nodes (if any) */ + * + * Calls the handler with the current node object and all selected nodes (if any) + */ onChange?: (currentNode: TreeNode, selectedNodes: TreeNode[]) => void; /** Fired on click of the action */ onAction?: (event: ActionEvent) => void; /** Fires when a node is expanded or collapsed. - * Calls the handler with the current node object */ + * Calls the handler with the current node object + */ onNodeToggle?: (currentNode: TreeNode) => void; /** Fires when input box receives focus or the dropdown arrow is clicked. - * This is helpful for setting dirty or touched flags with forms */ + * This is helpful for setting dirty or touched flags with forms + */ onFocus?: () => void; /** Fires when input box loses focus or the dropdown arrow is clicked again (and the dropdown collapses). - * This is helpful for setting dirty or touched flags with forms */ + * This is helpful for setting dirty or touched flags with forms + */ onBlur?: () => void; /** Turns the dropdown into a simple, single select dropdown. - * If you pass tree data, only immediate children are picked, grandchildren nodes are ignored. Defaults to false */ + * If you pass tree data, only immediate children are picked, grandchildren nodes are ignored. + * Defaults to false + */ simpleSelect?: boolean; /** The text to display when the search does not find results in the content list. Defaults to No matches found */ noMatchesText?: string; /** If set to true, shows checkboxes in a partial state when one, but not all of their children are selected. * Allows styling of partially selected nodes as well, by using :indeterminate pseudo class. - * Simply add desired styles to .node.partial .checkbox-item:indeterminate { ... } in your CSS */ + * Simply add desired styles to .node.partial .checkbox-item:indeterminate { ... } in your CSS + */ showPartiallySelected?: boolean; /** disabled=true disables the dropdown completely. This is useful during form submit events */ disabled?: boolean; - /** readOnly=true makes the dropdown read only, which means that the user can still interact with it but cannot change any of its values. - * This can be useful for display only forms */ + /** readOnly=true makes the dropdown read only, + * which means that the user can still interact with it but cannot change any of its values. + * This can be useful for display only forms + */ readOnly?: boolean; hierarchical?: boolean; /** Specific id for container. The container renders with a default id of `rdtsN` where N is count of the current component rendered - * Use to ensure a own unique id when a simple counter is not sufficient, e.g in a partial server render (SSR) */ + * Use to ensure a own unique id when a simple counter is not sufficient, e.g in a partial server render (SSR) + */ id?: string; } @@ -80,7 +96,9 @@ declare module 'react-dropdown-tree-select' { checked?: boolean; /** Selectable state of checkbox. if true, the checkbox is disabled and the node is not selectable. */ disabled?: boolean; - /** If true, the node is expanded (children of children nodes are not expanded by default unless children nodes also have expanded: true). */ + /** If true, the node is expanded + * (children of children nodes are not expanded by default unless children nodes also have expanded: true). + */ expanded?: boolean; /** Additional css class for the node. This is helpful to style the nodes your way */ className?: string; @@ -90,8 +108,10 @@ declare module 'react-dropdown-tree-select' { actions?: NodeAction[]; /** Allows data-* attributes to be set on the node and tag elements */ dataset?: NodeDataSet; - /** Indicate if a node is a default value. When true, the dropdown will automatically select the node(s) when there is no other selected node. - * Can be used on more than one node. */ + /** Indicate if a node is a default value. + * When true, the dropdown will automatically select the node(s) when there is no other selected node. + * Can be used on more than one node. + */ isDefaultValue?: boolean; /** Any extra properties that you'd like to receive during `onChange` event */ [property: string]: any;