@workday/canvas-kit-react 5.3.0-next.9 → 5.3.3
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.
- package/common/lib/styles/accessibleHide.ts +2 -2
- package/cookie-banner/README.md +10 -15
- package/cookie-banner/index.ts +3 -3
- package/cookie-banner/lib/CookieBanner.tsx +4 -29
- package/dist/commonjs/common/lib/styles/accessibleHide.d.ts +2 -2
- package/dist/commonjs/common/lib/styles/accessibleHide.d.ts.map +1 -1
- package/dist/commonjs/cookie-banner/index.d.ts +3 -3
- package/dist/commonjs/cookie-banner/index.d.ts.map +1 -1
- package/dist/commonjs/cookie-banner/index.js +1 -1
- package/dist/commonjs/cookie-banner/lib/CookieBanner.d.ts +2 -19
- package/dist/commonjs/cookie-banner/lib/CookieBanner.d.ts.map +1 -1
- package/dist/commonjs/cookie-banner/lib/CookieBanner.js +8 -19
- package/dist/commonjs/page-header/index.d.ts +3 -3
- package/dist/commonjs/page-header/index.d.ts.map +1 -1
- package/dist/commonjs/page-header/index.js +1 -1
- package/dist/commonjs/page-header/lib/PageHeader.d.ts +2 -19
- package/dist/commonjs/page-header/lib/PageHeader.d.ts.map +1 -1
- package/dist/commonjs/page-header/lib/PageHeader.js +7 -18
- package/dist/commonjs/pagination/lib/Pagination/GoTo/Label.d.ts +3 -0
- package/dist/commonjs/pagination/lib/Pagination/GoTo/Label.d.ts.map +1 -1
- package/dist/commonjs/pagination/lib/Pagination/types.d.ts +39 -0
- package/dist/commonjs/pagination/lib/Pagination/types.d.ts.map +1 -1
- package/dist/commonjs/pagination/lib/Pagination/usePaginationModel.d.ts +19 -0
- package/dist/commonjs/pagination/lib/Pagination/usePaginationModel.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/Tab.d.ts.map +1 -1
- package/dist/commonjs/tabs/lib/Tab.js +18 -24
- package/dist/commonjs/tooltip/lib/OverflowTooltip.d.ts +10 -0
- package/dist/commonjs/tooltip/lib/OverflowTooltip.d.ts.map +1 -1
- package/dist/commonjs/tooltip/lib/OverflowTooltip.js +8 -6
- package/dist/commonjs/tooltip/lib/Tooltip.d.ts +9 -1
- package/dist/commonjs/tooltip/lib/Tooltip.d.ts.map +1 -1
- package/dist/commonjs/tooltip/lib/Tooltip.js +7 -2
- package/dist/commonjs/tooltip/lib/useTooltip.d.ts +9 -1
- package/dist/commonjs/tooltip/lib/useTooltip.d.ts.map +1 -1
- package/dist/commonjs/tooltip/lib/useTooltip.js +13 -8
- package/dist/es6/common/lib/styles/accessibleHide.d.ts +2 -2
- package/dist/es6/common/lib/styles/accessibleHide.d.ts.map +1 -1
- package/dist/es6/cookie-banner/index.d.ts +3 -3
- package/dist/es6/cookie-banner/index.d.ts.map +1 -1
- package/dist/es6/cookie-banner/index.js +3 -3
- package/dist/es6/cookie-banner/lib/CookieBanner.d.ts +2 -19
- package/dist/es6/cookie-banner/lib/CookieBanner.d.ts.map +1 -1
- package/dist/es6/cookie-banner/lib/CookieBanner.js +8 -19
- package/dist/es6/page-header/index.d.ts +3 -3
- package/dist/es6/page-header/index.d.ts.map +1 -1
- package/dist/es6/page-header/index.js +3 -3
- package/dist/es6/page-header/lib/PageHeader.d.ts +2 -19
- package/dist/es6/page-header/lib/PageHeader.d.ts.map +1 -1
- package/dist/es6/page-header/lib/PageHeader.js +7 -18
- package/dist/es6/pagination/lib/Pagination/GoTo/Label.d.ts +3 -0
- package/dist/es6/pagination/lib/Pagination/GoTo/Label.d.ts.map +1 -1
- package/dist/es6/pagination/lib/Pagination/types.d.ts +39 -0
- package/dist/es6/pagination/lib/Pagination/types.d.ts.map +1 -1
- package/dist/es6/pagination/lib/Pagination/usePaginationModel.d.ts +19 -0
- package/dist/es6/pagination/lib/Pagination/usePaginationModel.d.ts.map +1 -1
- package/dist/es6/tabs/lib/Tab.d.ts.map +1 -1
- package/dist/es6/tabs/lib/Tab.js +18 -24
- package/dist/es6/tooltip/lib/OverflowTooltip.d.ts +10 -0
- package/dist/es6/tooltip/lib/OverflowTooltip.d.ts.map +1 -1
- package/dist/es6/tooltip/lib/OverflowTooltip.js +5 -3
- package/dist/es6/tooltip/lib/Tooltip.d.ts +9 -1
- package/dist/es6/tooltip/lib/Tooltip.d.ts.map +1 -1
- package/dist/es6/tooltip/lib/Tooltip.js +7 -2
- package/dist/es6/tooltip/lib/useTooltip.d.ts +9 -1
- package/dist/es6/tooltip/lib/useTooltip.d.ts.map +1 -1
- package/dist/es6/tooltip/lib/useTooltip.js +13 -8
- package/package.json +5 -5
- package/page-header/README.md +6 -11
- package/page-header/index.ts +3 -3
- package/page-header/lib/PageHeader.tsx +3 -28
- package/pagination/lib/Pagination/GoTo/Label.tsx +3 -0
- package/pagination/lib/Pagination/types.ts +44 -5
- package/pagination/lib/Pagination/usePaginationModel.ts +19 -0
- package/tabs/lib/Tab.tsx +53 -59
- package/tooltip/lib/OverflowTooltip.tsx +5 -3
- package/tooltip/lib/Tooltip.tsx +16 -1
- package/tooltip/lib/useTooltip.tsx +21 -6
- package/ts3.5/dist/commonjs/common/lib/styles/accessibleHide.d.ts +2 -2
- package/ts3.5/dist/commonjs/cookie-banner/index.d.ts +3 -3
- package/ts3.5/dist/commonjs/cookie-banner/lib/CookieBanner.d.ts +2 -19
- package/ts3.5/dist/commonjs/page-header/index.d.ts +3 -3
- package/ts3.5/dist/commonjs/page-header/lib/PageHeader.d.ts +2 -19
- package/ts3.5/dist/commonjs/pagination/lib/Pagination/GoTo/Label.d.ts +3 -0
- package/ts3.5/dist/commonjs/pagination/lib/Pagination/types.d.ts +39 -0
- package/ts3.5/dist/commonjs/pagination/lib/Pagination/usePaginationModel.d.ts +19 -0
- package/ts3.5/dist/commonjs/tooltip/lib/OverflowTooltip.d.ts +10 -0
- package/ts3.5/dist/commonjs/tooltip/lib/Tooltip.d.ts +9 -1
- package/ts3.5/dist/commonjs/tooltip/lib/useTooltip.d.ts +9 -1
- package/ts3.5/dist/es6/common/lib/styles/accessibleHide.d.ts +2 -2
- package/ts3.5/dist/es6/cookie-banner/index.d.ts +3 -3
- package/ts3.5/dist/es6/cookie-banner/lib/CookieBanner.d.ts +2 -19
- package/ts3.5/dist/es6/page-header/index.d.ts +3 -3
- package/ts3.5/dist/es6/page-header/lib/PageHeader.d.ts +2 -19
- package/ts3.5/dist/es6/pagination/lib/Pagination/GoTo/Label.d.ts +3 -0
- package/ts3.5/dist/es6/pagination/lib/Pagination/types.d.ts +39 -0
- package/ts3.5/dist/es6/pagination/lib/Pagination/usePaginationModel.d.ts +19 -0
- package/ts3.5/dist/es6/tooltip/lib/OverflowTooltip.d.ts +10 -0
- package/ts3.5/dist/es6/tooltip/lib/Tooltip.d.ts +9 -1
- package/ts3.5/dist/es6/tooltip/lib/useTooltip.d.ts +9 -1
|
@@ -3,6 +3,9 @@ import * as React from 'react';
|
|
|
3
3
|
import { PaginationModel } from '../types';
|
|
4
4
|
export interface GoToLabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
5
5
|
model: PaginationModel;
|
|
6
|
+
/**
|
|
7
|
+
* Accepts child elements or a render prop.
|
|
8
|
+
*/
|
|
6
9
|
children?: (model: PaginationModel) => React.ReactNode | React.ReactNode;
|
|
7
10
|
}
|
|
8
11
|
export declare const GoToLabel: ({ css: cssProp, model, children, ...elemProps }: GoToLabelProps) => JSX.Element;
|
|
@@ -1,16 +1,55 @@
|
|
|
1
1
|
export interface PaginationState {
|
|
2
|
+
/**
|
|
3
|
+
* The page number for the current page
|
|
4
|
+
*/
|
|
2
5
|
currentPage: number;
|
|
6
|
+
/**
|
|
7
|
+
* The page number for the first page
|
|
8
|
+
*/
|
|
3
9
|
firstPage: number;
|
|
10
|
+
/**
|
|
11
|
+
* The page number for the last page (it can also be used as a total page
|
|
12
|
+
* count)
|
|
13
|
+
*/
|
|
4
14
|
lastPage: number;
|
|
15
|
+
/**
|
|
16
|
+
* An array of page numbers included in the pagination range
|
|
17
|
+
*/
|
|
5
18
|
range: number[];
|
|
19
|
+
/**
|
|
20
|
+
* The size of the pagination range
|
|
21
|
+
*/
|
|
6
22
|
rangeSize: number;
|
|
7
23
|
}
|
|
8
24
|
export interface PaginationEvents {
|
|
25
|
+
/**
|
|
26
|
+
* Sets the current page to a given page number (no safeguards)
|
|
27
|
+
*/
|
|
9
28
|
setCurrentPage: (page: number) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Sets the current page to the first page
|
|
31
|
+
*/
|
|
10
32
|
first: () => void;
|
|
33
|
+
/**
|
|
34
|
+
* Sets the current page to the last page
|
|
35
|
+
*/
|
|
11
36
|
last: () => void;
|
|
37
|
+
/**
|
|
38
|
+
* Increments the current page by 1
|
|
39
|
+
*/
|
|
12
40
|
next: () => void;
|
|
41
|
+
/**
|
|
42
|
+
* Decrements the current page by 1
|
|
43
|
+
*/
|
|
13
44
|
previous: () => void;
|
|
45
|
+
/**
|
|
46
|
+
* Sets the current page to a given page number (with safeguards). `goTo`
|
|
47
|
+
* is very similar to `setCurrentPage`, but it has some built-in safeguards.
|
|
48
|
+
* If the page number provided is below the first page (e.g: `0`),
|
|
49
|
+
* `currentPage` will be set to the `firstPage`. Similarly, if the number
|
|
50
|
+
* provided is larger than the `lastPage`, it will set `currentPage` to the
|
|
51
|
+
* `lastPage`.
|
|
52
|
+
*/
|
|
14
53
|
goTo: (page: number) => void;
|
|
15
54
|
}
|
|
16
55
|
export interface PaginationModel {
|
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
import { PaginationModel } from './types';
|
|
2
2
|
export declare type UsePaginationModelConfig = {
|
|
3
|
+
/**
|
|
4
|
+
* The page number for the last page (it can also be used as a total page
|
|
5
|
+
* count)
|
|
6
|
+
*/
|
|
3
7
|
lastPage: number;
|
|
8
|
+
/**
|
|
9
|
+
* The page number for the first page
|
|
10
|
+
* @default 1
|
|
11
|
+
*/
|
|
4
12
|
firstPage?: number;
|
|
13
|
+
/**
|
|
14
|
+
* The initial current page
|
|
15
|
+
* @default 1
|
|
16
|
+
*/
|
|
5
17
|
initialCurrentPage?: number;
|
|
18
|
+
/**
|
|
19
|
+
* The function called when the page changes
|
|
20
|
+
*/
|
|
6
21
|
onPageChange?: (pageNumber: number) => void;
|
|
22
|
+
/**
|
|
23
|
+
* The size of the pagination range
|
|
24
|
+
* @default 5
|
|
25
|
+
*/
|
|
7
26
|
rangeSize?: number;
|
|
8
27
|
};
|
|
9
28
|
export declare const usePaginationModel: ({ firstPage, initialCurrentPage, lastPage, rangeSize, onPageChange, }: UsePaginationModelConfig) => PaginationModel;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Placement } from '@workday/canvas-kit-react/popup';
|
|
3
|
+
/**
|
|
4
|
+
* Look for an element within the tree for an overflow element (auto, scroll, clip, or hidden).
|
|
5
|
+
* This could be the passed element, or a descendant. If no element is found, `null` is returned.
|
|
6
|
+
*/
|
|
7
|
+
export declare const findOverflowElement: (element: Element) => Element | null;
|
|
8
|
+
/**
|
|
9
|
+
* Look for an element within the tree for a `text-overflow` CSS property of `ellipsis`.
|
|
10
|
+
* This could be the passed element, or a descendant. If no element is found, `null` is returned.
|
|
11
|
+
*/
|
|
12
|
+
export declare const findEllipsisElement: (element: Element) => Element | null;
|
|
3
13
|
export interface OverflowTooltipProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
4
14
|
/**
|
|
5
15
|
* The target (anchor element) for the Tooltip.
|
|
@@ -37,6 +37,14 @@ export interface TooltipProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
|
|
|
37
37
|
* @default 'label'
|
|
38
38
|
*/
|
|
39
39
|
type?: 'label' | 'describe' | 'muted';
|
|
40
|
+
/**
|
|
41
|
+
* Amount of time (in ms) to delay before showing the tooltip
|
|
42
|
+
*/
|
|
43
|
+
showDelay?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Amount of time (in ms) to delay before hiding the tooltip
|
|
46
|
+
*/
|
|
47
|
+
hideDelay?: number;
|
|
40
48
|
}
|
|
41
|
-
export declare const Tooltip: ({ type, placement, title, children, ...elemProps }: TooltipProps) => JSX.Element;
|
|
49
|
+
export declare const Tooltip: ({ type, placement, title, children, showDelay, hideDelay, ...elemProps }: TooltipProps) => JSX.Element;
|
|
42
50
|
//# sourceMappingURL=Tooltip.d.ts.map
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
* Convenience hook for creating components with tooltips. It will return an object of properties to mix
|
|
4
4
|
* into a target, popper and tooltip
|
|
5
5
|
*/
|
|
6
|
-
export declare function useTooltip<T extends Element = Element>({ type, titleText, }?: {
|
|
6
|
+
export declare function useTooltip<T extends Element = Element>({ type, titleText, showDelay, hideDelay, }?: {
|
|
7
7
|
/**
|
|
8
8
|
* Determines the tooltip type for accessibility.
|
|
9
9
|
*
|
|
@@ -25,6 +25,14 @@ export declare function useTooltip<T extends Element = Element>({ type, titleTex
|
|
|
25
25
|
* The content of the `aria-label` if `type` is `label.
|
|
26
26
|
*/
|
|
27
27
|
titleText?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Amount of time (in ms) to delay before showing the tooltip
|
|
30
|
+
*/
|
|
31
|
+
showDelay?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Amount of time (in ms) to delay before hiding the tooltip
|
|
34
|
+
*/
|
|
35
|
+
hideDelay?: number;
|
|
28
36
|
}): {
|
|
29
37
|
/** Mix these properties into the target element. **Must be an Element** */
|
|
30
38
|
targetProps: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CSSObject } from '@emotion/core';
|
|
2
2
|
/**
|
|
3
3
|
* A utility to hide content normal users while still making accessible to screenreaders
|
|
4
4
|
* See https://a11y-101.com/development/skip-link
|
|
5
5
|
*/
|
|
6
|
-
export declare const accessibleHide:
|
|
6
|
+
export declare const accessibleHide: CSSObject;
|
|
7
7
|
//# sourceMappingURL=accessibleHide.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default
|
|
3
|
-
export {
|
|
1
|
+
import CookieBanner from './lib/CookieBanner';
|
|
2
|
+
export default CookieBanner;
|
|
3
|
+
export { CookieBanner };
|
|
4
4
|
export * from './lib/CookieBanner';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
* ### Deprecated Cookie Banner Props
|
|
4
|
-
*
|
|
5
|
-
* As of Canvas Kit v6, CookieBanner is being soft-deprecated.
|
|
6
|
-
* It will be hard-deprecated (completely removed) in v7. Please see the
|
|
7
|
-
* [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
|
|
8
|
-
* for more information.
|
|
9
|
-
*/
|
|
10
|
-
export interface DeprecatedCookieBannerProps {
|
|
2
|
+
export interface CookieBannerProps {
|
|
11
3
|
/**
|
|
12
4
|
* If true, set the CookieBanner to the closed state.
|
|
13
5
|
* @default false
|
|
@@ -32,16 +24,7 @@ export interface DeprecatedCookieBannerProps {
|
|
|
32
24
|
*/
|
|
33
25
|
settingsLabel?: string;
|
|
34
26
|
}
|
|
35
|
-
|
|
36
|
-
* ### Deprecated Cookie Banner
|
|
37
|
-
*
|
|
38
|
-
* As of Canvas Kit v6, this component is being soft-deprecated.
|
|
39
|
-
* It will be hard-deprecated (completely removed) in v7. Please see the
|
|
40
|
-
* [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
|
|
41
|
-
* for more information.
|
|
42
|
-
*/
|
|
43
|
-
export default class DeprecatedCookieBanner extends React.Component<DeprecatedCookieBannerProps> {
|
|
44
|
-
componentDidMount(): void;
|
|
27
|
+
export default class CookieBanner extends React.Component<CookieBannerProps> {
|
|
45
28
|
static DefaultNotice: string;
|
|
46
29
|
render(): React.ReactNode;
|
|
47
30
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default
|
|
3
|
-
export {
|
|
1
|
+
import PageHeader from './lib/PageHeader';
|
|
2
|
+
export default PageHeader;
|
|
3
|
+
export { PageHeader };
|
|
4
4
|
export * from './lib/PageHeader';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
* ### Deprecated Page Header Props
|
|
4
|
-
*
|
|
5
|
-
* As of Canvas Kit v6, PageHeader is being soft-deprecated.
|
|
6
|
-
* It will be hard-deprecated (completely removed) in v7. Please see the
|
|
7
|
-
* [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
|
|
8
|
-
* for more information.
|
|
9
|
-
*/
|
|
10
|
-
export interface DeprecatedPageHeaderProps {
|
|
2
|
+
export interface PageHeaderProps {
|
|
11
3
|
/**
|
|
12
4
|
* The text of the PageHeader title.
|
|
13
5
|
*/
|
|
@@ -23,16 +15,7 @@ export interface DeprecatedPageHeaderProps {
|
|
|
23
15
|
*/
|
|
24
16
|
breakpoint?: number;
|
|
25
17
|
}
|
|
26
|
-
|
|
27
|
-
* ### Deprecated Page Header
|
|
28
|
-
*
|
|
29
|
-
* As of Canvas Kit v6, this component is being soft-deprecated.
|
|
30
|
-
* It will be hard-deprecated (completely removed) in v7. Please see the
|
|
31
|
-
* [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
|
|
32
|
-
* for more information.
|
|
33
|
-
*/
|
|
34
|
-
export default class DeprecatedPageHeader extends React.Component<DeprecatedPageHeaderProps> {
|
|
35
|
-
componentDidMount(): void;
|
|
18
|
+
export default class PageHeader extends React.Component<PageHeaderProps> {
|
|
36
19
|
private renderChildren;
|
|
37
20
|
render(): JSX.Element;
|
|
38
21
|
}
|
|
@@ -3,6 +3,9 @@ import * as React from 'react';
|
|
|
3
3
|
import { PaginationModel } from '../types';
|
|
4
4
|
export interface GoToLabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
5
5
|
model: PaginationModel;
|
|
6
|
+
/**
|
|
7
|
+
* Accepts child elements or a render prop.
|
|
8
|
+
*/
|
|
6
9
|
children?: (model: PaginationModel) => React.ReactNode | React.ReactNode;
|
|
7
10
|
}
|
|
8
11
|
export declare const GoToLabel: ({ css: cssProp, model, children, ...elemProps }: GoToLabelProps) => JSX.Element;
|
|
@@ -1,16 +1,55 @@
|
|
|
1
1
|
export interface PaginationState {
|
|
2
|
+
/**
|
|
3
|
+
* The page number for the current page
|
|
4
|
+
*/
|
|
2
5
|
currentPage: number;
|
|
6
|
+
/**
|
|
7
|
+
* The page number for the first page
|
|
8
|
+
*/
|
|
3
9
|
firstPage: number;
|
|
10
|
+
/**
|
|
11
|
+
* The page number for the last page (it can also be used as a total page
|
|
12
|
+
* count)
|
|
13
|
+
*/
|
|
4
14
|
lastPage: number;
|
|
15
|
+
/**
|
|
16
|
+
* An array of page numbers included in the pagination range
|
|
17
|
+
*/
|
|
5
18
|
range: number[];
|
|
19
|
+
/**
|
|
20
|
+
* The size of the pagination range
|
|
21
|
+
*/
|
|
6
22
|
rangeSize: number;
|
|
7
23
|
}
|
|
8
24
|
export interface PaginationEvents {
|
|
25
|
+
/**
|
|
26
|
+
* Sets the current page to a given page number (no safeguards)
|
|
27
|
+
*/
|
|
9
28
|
setCurrentPage: (page: number) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Sets the current page to the first page
|
|
31
|
+
*/
|
|
10
32
|
first: () => void;
|
|
33
|
+
/**
|
|
34
|
+
* Sets the current page to the last page
|
|
35
|
+
*/
|
|
11
36
|
last: () => void;
|
|
37
|
+
/**
|
|
38
|
+
* Increments the current page by 1
|
|
39
|
+
*/
|
|
12
40
|
next: () => void;
|
|
41
|
+
/**
|
|
42
|
+
* Decrements the current page by 1
|
|
43
|
+
*/
|
|
13
44
|
previous: () => void;
|
|
45
|
+
/**
|
|
46
|
+
* Sets the current page to a given page number (with safeguards). `goTo`
|
|
47
|
+
* is very similar to `setCurrentPage`, but it has some built-in safeguards.
|
|
48
|
+
* If the page number provided is below the first page (e.g: `0`),
|
|
49
|
+
* `currentPage` will be set to the `firstPage`. Similarly, if the number
|
|
50
|
+
* provided is larger than the `lastPage`, it will set `currentPage` to the
|
|
51
|
+
* `lastPage`.
|
|
52
|
+
*/
|
|
14
53
|
goTo: (page: number) => void;
|
|
15
54
|
}
|
|
16
55
|
export interface PaginationModel {
|
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
import { PaginationModel } from './types';
|
|
2
2
|
export declare type UsePaginationModelConfig = {
|
|
3
|
+
/**
|
|
4
|
+
* The page number for the last page (it can also be used as a total page
|
|
5
|
+
* count)
|
|
6
|
+
*/
|
|
3
7
|
lastPage: number;
|
|
8
|
+
/**
|
|
9
|
+
* The page number for the first page
|
|
10
|
+
* @default 1
|
|
11
|
+
*/
|
|
4
12
|
firstPage?: number;
|
|
13
|
+
/**
|
|
14
|
+
* The initial current page
|
|
15
|
+
* @default 1
|
|
16
|
+
*/
|
|
5
17
|
initialCurrentPage?: number;
|
|
18
|
+
/**
|
|
19
|
+
* The function called when the page changes
|
|
20
|
+
*/
|
|
6
21
|
onPageChange?: (pageNumber: number) => void;
|
|
22
|
+
/**
|
|
23
|
+
* The size of the pagination range
|
|
24
|
+
* @default 5
|
|
25
|
+
*/
|
|
7
26
|
rangeSize?: number;
|
|
8
27
|
};
|
|
9
28
|
export declare const usePaginationModel: ({ firstPage, initialCurrentPage, lastPage, rangeSize, onPageChange, }: UsePaginationModelConfig) => PaginationModel;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Placement } from '@workday/canvas-kit-react/popup';
|
|
3
|
+
/**
|
|
4
|
+
* Look for an element within the tree for an overflow element (auto, scroll, clip, or hidden).
|
|
5
|
+
* This could be the passed element, or a descendant. If no element is found, `null` is returned.
|
|
6
|
+
*/
|
|
7
|
+
export declare const findOverflowElement: (element: Element) => Element | null;
|
|
8
|
+
/**
|
|
9
|
+
* Look for an element within the tree for a `text-overflow` CSS property of `ellipsis`.
|
|
10
|
+
* This could be the passed element, or a descendant. If no element is found, `null` is returned.
|
|
11
|
+
*/
|
|
12
|
+
export declare const findEllipsisElement: (element: Element) => Element | null;
|
|
3
13
|
export interface OverflowTooltipProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
4
14
|
/**
|
|
5
15
|
* The target (anchor element) for the Tooltip.
|
|
@@ -37,6 +37,14 @@ export interface TooltipProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
|
|
|
37
37
|
* @default 'label'
|
|
38
38
|
*/
|
|
39
39
|
type?: 'label' | 'describe' | 'muted';
|
|
40
|
+
/**
|
|
41
|
+
* Amount of time (in ms) to delay before showing the tooltip
|
|
42
|
+
*/
|
|
43
|
+
showDelay?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Amount of time (in ms) to delay before hiding the tooltip
|
|
46
|
+
*/
|
|
47
|
+
hideDelay?: number;
|
|
40
48
|
}
|
|
41
|
-
export declare const Tooltip: ({ type, placement, title, children, ...elemProps }: TooltipProps) => JSX.Element;
|
|
49
|
+
export declare const Tooltip: ({ type, placement, title, children, showDelay, hideDelay, ...elemProps }: TooltipProps) => JSX.Element;
|
|
42
50
|
//# sourceMappingURL=Tooltip.d.ts.map
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
* Convenience hook for creating components with tooltips. It will return an object of properties to mix
|
|
4
4
|
* into a target, popper and tooltip
|
|
5
5
|
*/
|
|
6
|
-
export declare function useTooltip<T extends Element = Element>({ type, titleText, }?: {
|
|
6
|
+
export declare function useTooltip<T extends Element = Element>({ type, titleText, showDelay, hideDelay, }?: {
|
|
7
7
|
/**
|
|
8
8
|
* Determines the tooltip type for accessibility.
|
|
9
9
|
*
|
|
@@ -25,6 +25,14 @@ export declare function useTooltip<T extends Element = Element>({ type, titleTex
|
|
|
25
25
|
* The content of the `aria-label` if `type` is `label.
|
|
26
26
|
*/
|
|
27
27
|
titleText?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Amount of time (in ms) to delay before showing the tooltip
|
|
30
|
+
*/
|
|
31
|
+
showDelay?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Amount of time (in ms) to delay before hiding the tooltip
|
|
34
|
+
*/
|
|
35
|
+
hideDelay?: number;
|
|
28
36
|
}): {
|
|
29
37
|
/** Mix these properties into the target element. **Must be an Element** */
|
|
30
38
|
targetProps: {
|