@progress/kendo-react-layout 5.10.0-dev.202301121619 → 5.10.0-dev.202301161904

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.
Files changed (38) hide show
  1. package/NOTICE.txt +28 -22
  2. package/dist/cdn/js/kendo-react-layout.js +1 -1
  3. package/dist/es/actionsheet/ActionSheet.d.ts +68 -0
  4. package/dist/es/actionsheet/ActionSheet.js +116 -0
  5. package/dist/es/actionsheet/ActionSheetContent.d.ts +10 -0
  6. package/dist/es/actionsheet/ActionSheetContent.js +19 -0
  7. package/dist/es/actionsheet/ActionSheetFooter.d.ts +10 -0
  8. package/dist/es/actionsheet/ActionSheetFooter.js +19 -0
  9. package/dist/es/actionsheet/ActionSheetHeader.d.ts +10 -0
  10. package/dist/es/actionsheet/ActionSheetHeader.js +19 -0
  11. package/dist/es/actionsheet/ActionSheetItem.d.ts +6 -0
  12. package/dist/es/actionsheet/ActionSheetItem.js +28 -0
  13. package/dist/es/actionsheet/interfaces/ActionSheetChildrenProps.d.ts +9 -0
  14. package/dist/es/actionsheet/interfaces/ActionSheetChildrenProps.js +5 -0
  15. package/dist/es/actionsheet/interfaces/ActionSheetItemProps.d.ts +46 -0
  16. package/dist/es/actionsheet/interfaces/ActionSheetItemProps.js +1 -0
  17. package/dist/es/main.d.ts +6 -0
  18. package/dist/es/main.js +6 -0
  19. package/dist/es/package-metadata.js +1 -1
  20. package/dist/npm/actionsheet/ActionSheet.d.ts +68 -0
  21. package/dist/npm/actionsheet/ActionSheet.js +119 -0
  22. package/dist/npm/actionsheet/ActionSheetContent.d.ts +10 -0
  23. package/dist/npm/actionsheet/ActionSheetContent.js +23 -0
  24. package/dist/npm/actionsheet/ActionSheetFooter.d.ts +10 -0
  25. package/dist/npm/actionsheet/ActionSheetFooter.js +23 -0
  26. package/dist/npm/actionsheet/ActionSheetHeader.d.ts +10 -0
  27. package/dist/npm/actionsheet/ActionSheetHeader.js +23 -0
  28. package/dist/npm/actionsheet/ActionSheetItem.d.ts +6 -0
  29. package/dist/npm/actionsheet/ActionSheetItem.js +32 -0
  30. package/dist/npm/actionsheet/interfaces/ActionSheetChildrenProps.d.ts +9 -0
  31. package/dist/npm/actionsheet/interfaces/ActionSheetChildrenProps.js +6 -0
  32. package/dist/npm/actionsheet/interfaces/ActionSheetItemProps.d.ts +46 -0
  33. package/dist/npm/actionsheet/interfaces/ActionSheetItemProps.js +2 -0
  34. package/dist/npm/main.d.ts +6 -0
  35. package/dist/npm/main.js +6 -0
  36. package/dist/npm/package-metadata.js +1 -1
  37. package/dist/systemjs/kendo-react-layout.js +1 -1
  38. package/package.json +15 -15
@@ -0,0 +1,68 @@
1
+ import * as React from 'react';
2
+ import * as PropTypes from 'prop-types';
3
+ import { ActionSheetItemProps } from './interfaces/ActionSheetItemProps';
4
+ /**
5
+ * The props of the ActionSheet component.
6
+ */
7
+ export interface ActionSheetProps {
8
+ /**
9
+ * The collection of items that will be rendered in the ActionSheet.
10
+ */
11
+ items?: ActionSheetItemProps[];
12
+ /**
13
+ * Specifies the text that is rendered under the title.
14
+ */
15
+ subTitle?: string;
16
+ /**
17
+ * Specifies the text that is rendered as title.
18
+ */
19
+ title?: string;
20
+ /**
21
+ * Fires when the modal overlay is clicked.
22
+ */
23
+ onOverlayClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
24
+ /**
25
+ * Fires when an ActionSheet item is clicked.
26
+ */
27
+ onItemClick?: (event: {
28
+ syntheticEvent: React.MouseEvent<HTMLSpanElement>;
29
+ title?: string;
30
+ }) => void;
31
+ /**
32
+ * Represents the children that are passed to the ActionSheet.
33
+ */
34
+ children?: any;
35
+ }
36
+ /**
37
+ * The KendoReact ActionSheet component.
38
+ */
39
+ export declare class ActionSheet extends React.Component<ActionSheetProps, {}> {
40
+ /**
41
+ * @hidden
42
+ */
43
+ static displayName: string;
44
+ /**
45
+ * @hidden
46
+ */
47
+ static propTypes: {
48
+ items: PropTypes.Requireable<any[]>;
49
+ subTitle: PropTypes.Requireable<string>;
50
+ title: PropTypes.Requireable<string>;
51
+ };
52
+ private actionSheetAnimationRef;
53
+ private actionSheetTitleClass;
54
+ private ariaLabeledBy;
55
+ /**
56
+ * @hidden
57
+ */
58
+ constructor(props: ActionSheetProps);
59
+ /**
60
+ * @hidden
61
+ */
62
+ componentDidMount(): void;
63
+ /**
64
+ * @hidden
65
+ */
66
+ render(): JSX.Element;
67
+ private children;
68
+ }
@@ -0,0 +1,116 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ var __assign = (this && this.__assign) || function () {
17
+ __assign = Object.assign || function(t) {
18
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
19
+ s = arguments[i];
20
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
21
+ t[p] = s[p];
22
+ }
23
+ return t;
24
+ };
25
+ return __assign.apply(this, arguments);
26
+ };
27
+ import * as React from 'react';
28
+ import * as PropTypes from 'prop-types';
29
+ import { validatePackage } from '@progress/kendo-react-common';
30
+ import { packageMetadata } from '../package-metadata';
31
+ import { ActionSheetItem } from './ActionSheetItem';
32
+ import { headerDisplayName } from './ActionSheetHeader';
33
+ import { footerDisplayName } from './ActionSheetFooter';
34
+ import { contentDisplayName } from './ActionSheetContent';
35
+ /**
36
+ * The KendoReact ActionSheet component.
37
+ */
38
+ var ActionSheet = /** @class */ (function (_super) {
39
+ __extends(ActionSheet, _super);
40
+ /**
41
+ * @hidden
42
+ */
43
+ function ActionSheet(props) {
44
+ var _this = _super.call(this, props) || this;
45
+ _this.actionSheetAnimationRef = React.createRef();
46
+ _this.actionSheetTitleClass = 'k-actionsheet-title';
47
+ _this.ariaLabeledBy = _this.actionSheetTitleClass + 1;
48
+ validatePackage(packageMetadata);
49
+ return _this;
50
+ }
51
+ /**
52
+ * @hidden
53
+ */
54
+ ActionSheet.prototype.componentDidMount = function () {
55
+ if (this.actionSheetAnimationRef.current) {
56
+ this.actionSheetAnimationRef.current.style.setProperty('--kendo-actionsheet-height', 'auto');
57
+ this.actionSheetAnimationRef.current.style.setProperty('--kendo-actionsheet-max-height', 'none');
58
+ }
59
+ };
60
+ /**
61
+ * @hidden
62
+ */
63
+ ActionSheet.prototype.render = function () {
64
+ var _this = this;
65
+ var _a, _b;
66
+ var topGroupItems = (_a = this.props.items) === null || _a === void 0 ? void 0 : _a.filter(function (item) { return !item.group || item.group === 'top'; });
67
+ var bottomGroupItems = (_b = this.props.items) === null || _b === void 0 ? void 0 : _b.filter(function (item) { return item.group === 'bottom'; });
68
+ var shouldRenderSeparator = (topGroupItems && topGroupItems.length > 0) && (bottomGroupItems && bottomGroupItems.length > 0);
69
+ var children = this.children(this.props.children);
70
+ return (React.createElement("div", { className: "k-actionsheet-container" },
71
+ React.createElement("div", { className: "k-overlay", onClick: this.props.onOverlayClick }),
72
+ React.createElement("div", { className: "k-animation-container" },
73
+ React.createElement("div", { className: "k-child-animation-container", style: { bottom: '0px', width: '100%' } },
74
+ React.createElement("div", { className: "k-actionsheet k-actionsheet-bottom", role: "dialog", "aria-modal": "true", "aria-hidden": false, "aria-labelledby": this.ariaLabeledBy, ref: this.actionSheetAnimationRef },
75
+ (children[headerDisplayName] || this.props.title || this.props.subTitle) && (React.createElement("div", { className: "k-actionsheet-titlebar" },
76
+ React.createElement("div", { className: "k-actionsheet-titlebar-group k-hbox" },
77
+ React.createElement("div", { className: this.actionSheetTitleClass, id: this.ariaLabeledBy }, children[headerDisplayName] ||
78
+ React.createElement(React.Fragment, null,
79
+ React.createElement("div", { className: "k-text-center" }, this.props.title),
80
+ this.props.subTitle && React.createElement("div", { className: "k-actionsheet-subtitle k-text-center" }, this.props.subTitle)))))),
81
+ React.createElement("div", { className: "k-actionsheet-content" }, children[contentDisplayName] ||
82
+ React.createElement(React.Fragment, null,
83
+ React.createElement("div", { className: "k-list-ul", role: "group" }, topGroupItems && topGroupItems.map(function (props, idx) {
84
+ return React.createElement(ActionSheetItem, __assign({ key: idx }, props, { onClick: _this.props.onItemClick }));
85
+ })),
86
+ shouldRenderSeparator && React.createElement("hr", { className: "k-hr" }),
87
+ React.createElement("div", { className: "k-list-ul", role: "group" }, bottomGroupItems && bottomGroupItems.map(function (props, idx) {
88
+ return React.createElement(ActionSheetItem, __assign({ key: idx }, props, { onClick: _this.props.onItemClick }));
89
+ })))),
90
+ children[footerDisplayName])))));
91
+ };
92
+ ;
93
+ ActionSheet.prototype.children = function (children) {
94
+ var components = {};
95
+ React.Children.forEach(children, function (child) {
96
+ components[child.type.displayName] = child;
97
+ });
98
+ return components;
99
+ };
100
+ ;
101
+ /**
102
+ * @hidden
103
+ */
104
+ ActionSheet.displayName = 'KendoReactActionSheet';
105
+ /**
106
+ * @hidden
107
+ */
108
+ ActionSheet.propTypes = {
109
+ items: PropTypes.array,
110
+ subTitle: PropTypes.string,
111
+ title: PropTypes.string
112
+ };
113
+ return ActionSheet;
114
+ }(React.Component));
115
+ export { ActionSheet };
116
+ ;
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { ActionSheetChildrenProps } from './interfaces/ActionSheetChildrenProps';
3
+ /**
4
+ * @hidden
5
+ */
6
+ export declare const contentDisplayName = "ActionSheetContent";
7
+ /**
8
+ * The KendoReact ActionSheetContent component.
9
+ */
10
+ export declare const ActionSheetContent: React.FunctionComponent<ActionSheetChildrenProps>;
@@ -0,0 +1,19 @@
1
+ import * as PropTypes from 'prop-types';
2
+ /**
3
+ * @hidden
4
+ */
5
+ export var contentDisplayName = 'ActionSheetContent';
6
+ /**
7
+ * The KendoReact ActionSheetContent component.
8
+ */
9
+ export var ActionSheetContent = function (props) { return props.children; };
10
+ /**
11
+ * @hidden
12
+ */
13
+ ActionSheetContent.displayName = contentDisplayName;
14
+ /**
15
+ * @hidden
16
+ */
17
+ ActionSheetContent.propTypes = {
18
+ children: PropTypes.any
19
+ };
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { ActionSheetChildrenProps } from './interfaces/ActionSheetChildrenProps';
3
+ /**
4
+ * @hidden
5
+ */
6
+ export declare const footerDisplayName = "ActionSheetFooter";
7
+ /**
8
+ * The KendoReact ActionSheetFooter component.
9
+ */
10
+ export declare const ActionSheetFooter: React.FunctionComponent<ActionSheetChildrenProps>;
@@ -0,0 +1,19 @@
1
+ import * as PropTypes from 'prop-types';
2
+ /**
3
+ * @hidden
4
+ */
5
+ export var footerDisplayName = 'ActionSheetFooter';
6
+ /**
7
+ * The KendoReact ActionSheetFooter component.
8
+ */
9
+ export var ActionSheetFooter = function (props) { return props.children; };
10
+ /**
11
+ * @hidden
12
+ */
13
+ ActionSheetFooter.displayName = footerDisplayName;
14
+ /**
15
+ * @hidden
16
+ */
17
+ ActionSheetFooter.propTypes = {
18
+ children: PropTypes.any
19
+ };
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { ActionSheetChildrenProps } from './interfaces/ActionSheetChildrenProps';
3
+ /**
4
+ * @hidden
5
+ */
6
+ export declare const headerDisplayName = "ActionSheetHeader";
7
+ /**
8
+ * The KendoReact ActionSheetHeader component.
9
+ */
10
+ export declare const ActionSheetHeader: React.FunctionComponent<ActionSheetChildrenProps>;
@@ -0,0 +1,19 @@
1
+ import * as PropTypes from 'prop-types';
2
+ /**
3
+ * @hidden
4
+ */
5
+ export var headerDisplayName = 'ActionSheetHeader';
6
+ /**
7
+ * The KendoReact ActionSheetHeader component.
8
+ */
9
+ export var ActionSheetHeader = function (props) { return props.children; };
10
+ /**
11
+ * @hidden
12
+ */
13
+ ActionSheetHeader.displayName = headerDisplayName;
14
+ /**
15
+ * @hidden
16
+ */
17
+ ActionSheetHeader.propTypes = {
18
+ children: PropTypes.any
19
+ };
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ import { ActionSheetItemProps } from './interfaces/ActionSheetItemProps';
3
+ /**
4
+ * The KendoReact ActionSheetItem component.
5
+ */
6
+ export declare const ActionSheetItem: React.FunctionComponent<ActionSheetItemProps>;
@@ -0,0 +1,28 @@
1
+ import * as React from 'react';
2
+ import * as PropTypes from 'prop-types';
3
+ import { classNames } from '@progress/kendo-react-common';
4
+ /**
5
+ * The KendoReact ActionSheetItem component.
6
+ */
7
+ export var ActionSheetItem = function (props) {
8
+ var onClick = React.useCallback(function (event) {
9
+ if (props.onClick) {
10
+ props.onClick.call(undefined, { syntheticEvent: event, title: props.title });
11
+ }
12
+ }, [props.title, props.onClick]);
13
+ return (React.createElement("span", { style: props.style, className: classNames('k-actionsheet-item', 'k-cursor-pointer', props.disabled && 'k-disabled', props.className), role: "button", "aria-disabled": props.disabled, tabIndex: props.tabIndex, onClick: onClick },
14
+ React.createElement("span", { className: "k-actionsheet-action" },
15
+ props.icon,
16
+ (props.title || props.description) && (React.createElement("span", { className: "k-actionsheet-item-text" },
17
+ React.createElement("span", { className: "k-actionsheet-item-title" }, props.title),
18
+ React.createElement("span", { className: "k-actionsheet-item-description" }, props.description))))));
19
+ };
20
+ ActionSheetItem.propTypes = {
21
+ className: PropTypes.string,
22
+ style: PropTypes.object,
23
+ description: PropTypes.string,
24
+ disabled: PropTypes.bool,
25
+ group: PropTypes.oneOf(['top', 'bottom']),
26
+ icon: PropTypes.element,
27
+ title: PropTypes.string
28
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Represents the props of the KendoReact ActionSheetChildren component.
3
+ */
4
+ export interface ActionSheetChildrenProps {
5
+ /**
6
+ * Represents the children that are passed to the ActionSheet.
7
+ */
8
+ children?: any;
9
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Represents the props of the KendoReact ActionSheetChildren component.
3
+ */
4
+ ;
5
+ export {};
@@ -0,0 +1,46 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Represents the props of the KendoReact ActionSheet component.
4
+ */
5
+ export interface ActionSheetItemProps {
6
+ /**
7
+ * Sets additional CSS classes to the ActionSheet.
8
+ */
9
+ className?: string;
10
+ /**
11
+ * Sets additional CSS styles to the ActionSheet.
12
+ */
13
+ style?: React.CSSProperties;
14
+ /**
15
+ * Specifies the `tabIndex` of the ActionSheet.
16
+ */
17
+ tabIndex?: number;
18
+ /**
19
+ * Specifies additional text rendered under the item's title.
20
+ */
21
+ description?: string;
22
+ /**
23
+ * Specifies if the ActionSheet item is initially disabled.
24
+ */
25
+ disabled?: boolean;
26
+ /**
27
+ * Defines the group of the item. Items can be segregated in two groups - `top` and `bottom`.
28
+ * Each specifying whether the ActionSheet item will be rendered over the separator or under it.
29
+ */
30
+ group?: 'top' | 'bottom';
31
+ /**
32
+ * Defines the icon rendered inside the ActionSheet item.
33
+ */
34
+ icon?: React.ReactElement;
35
+ /**
36
+ * Specifies the text content of the ActionSheet item.
37
+ */
38
+ title?: string;
39
+ /**
40
+ * @hidden
41
+ */
42
+ onClick?: (event: {
43
+ syntheticEvent: React.MouseEvent<HTMLSpanElement>;
44
+ title?: string;
45
+ }) => void;
46
+ }
package/dist/es/main.d.ts CHANGED
@@ -78,4 +78,10 @@ export * from './breadcrumb/BreadcrumbOrderedList';
78
78
  export * from './breadcrumb/BreadcrumbListItem';
79
79
  export * from './breadcrumb/BreadcrumbDelimiter';
80
80
  export * from './breadcrumb/BreadcrumbLink';
81
+ export * from './actionsheet/ActionSheet';
82
+ export * from './actionsheet/ActionSheetItem';
83
+ export * from './actionsheet/interfaces/ActionSheetItemProps';
84
+ export * from './actionsheet/ActionSheetHeader';
85
+ export * from './actionsheet/ActionSheetContent';
86
+ export * from './actionsheet/ActionSheetFooter';
81
87
  export * from './expansionpanel';
package/dist/es/main.js CHANGED
@@ -78,4 +78,10 @@ export * from './breadcrumb/BreadcrumbOrderedList';
78
78
  export * from './breadcrumb/BreadcrumbListItem';
79
79
  export * from './breadcrumb/BreadcrumbDelimiter';
80
80
  export * from './breadcrumb/BreadcrumbLink';
81
+ export * from './actionsheet/ActionSheet';
82
+ export * from './actionsheet/ActionSheetItem';
83
+ export * from './actionsheet/interfaces/ActionSheetItemProps';
84
+ export * from './actionsheet/ActionSheetHeader';
85
+ export * from './actionsheet/ActionSheetContent';
86
+ export * from './actionsheet/ActionSheetFooter';
81
87
  export * from './expansionpanel';
@@ -5,7 +5,7 @@ export var packageMetadata = {
5
5
  name: '@progress/kendo-react-layout',
6
6
  productName: 'KendoReact',
7
7
  productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
8
- publishDate: 1673538867,
8
+ publishDate: 1673894807,
9
9
  version: '',
10
10
  licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
11
11
  };
@@ -0,0 +1,68 @@
1
+ import * as React from 'react';
2
+ import * as PropTypes from 'prop-types';
3
+ import { ActionSheetItemProps } from './interfaces/ActionSheetItemProps';
4
+ /**
5
+ * The props of the ActionSheet component.
6
+ */
7
+ export interface ActionSheetProps {
8
+ /**
9
+ * The collection of items that will be rendered in the ActionSheet.
10
+ */
11
+ items?: ActionSheetItemProps[];
12
+ /**
13
+ * Specifies the text that is rendered under the title.
14
+ */
15
+ subTitle?: string;
16
+ /**
17
+ * Specifies the text that is rendered as title.
18
+ */
19
+ title?: string;
20
+ /**
21
+ * Fires when the modal overlay is clicked.
22
+ */
23
+ onOverlayClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
24
+ /**
25
+ * Fires when an ActionSheet item is clicked.
26
+ */
27
+ onItemClick?: (event: {
28
+ syntheticEvent: React.MouseEvent<HTMLSpanElement>;
29
+ title?: string;
30
+ }) => void;
31
+ /**
32
+ * Represents the children that are passed to the ActionSheet.
33
+ */
34
+ children?: any;
35
+ }
36
+ /**
37
+ * The KendoReact ActionSheet component.
38
+ */
39
+ export declare class ActionSheet extends React.Component<ActionSheetProps, {}> {
40
+ /**
41
+ * @hidden
42
+ */
43
+ static displayName: string;
44
+ /**
45
+ * @hidden
46
+ */
47
+ static propTypes: {
48
+ items: PropTypes.Requireable<any[]>;
49
+ subTitle: PropTypes.Requireable<string>;
50
+ title: PropTypes.Requireable<string>;
51
+ };
52
+ private actionSheetAnimationRef;
53
+ private actionSheetTitleClass;
54
+ private ariaLabeledBy;
55
+ /**
56
+ * @hidden
57
+ */
58
+ constructor(props: ActionSheetProps);
59
+ /**
60
+ * @hidden
61
+ */
62
+ componentDidMount(): void;
63
+ /**
64
+ * @hidden
65
+ */
66
+ render(): JSX.Element;
67
+ private children;
68
+ }
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __assign = (this && this.__assign) || function () {
18
+ __assign = Object.assign || function(t) {
19
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
20
+ s = arguments[i];
21
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
+ t[p] = s[p];
23
+ }
24
+ return t;
25
+ };
26
+ return __assign.apply(this, arguments);
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.ActionSheet = void 0;
30
+ var React = require("react");
31
+ var PropTypes = require("prop-types");
32
+ var kendo_react_common_1 = require("@progress/kendo-react-common");
33
+ var package_metadata_1 = require("../package-metadata");
34
+ var ActionSheetItem_1 = require("./ActionSheetItem");
35
+ var ActionSheetHeader_1 = require("./ActionSheetHeader");
36
+ var ActionSheetFooter_1 = require("./ActionSheetFooter");
37
+ var ActionSheetContent_1 = require("./ActionSheetContent");
38
+ /**
39
+ * The KendoReact ActionSheet component.
40
+ */
41
+ var ActionSheet = /** @class */ (function (_super) {
42
+ __extends(ActionSheet, _super);
43
+ /**
44
+ * @hidden
45
+ */
46
+ function ActionSheet(props) {
47
+ var _this = _super.call(this, props) || this;
48
+ _this.actionSheetAnimationRef = React.createRef();
49
+ _this.actionSheetTitleClass = 'k-actionsheet-title';
50
+ _this.ariaLabeledBy = _this.actionSheetTitleClass + 1;
51
+ (0, kendo_react_common_1.validatePackage)(package_metadata_1.packageMetadata);
52
+ return _this;
53
+ }
54
+ /**
55
+ * @hidden
56
+ */
57
+ ActionSheet.prototype.componentDidMount = function () {
58
+ if (this.actionSheetAnimationRef.current) {
59
+ this.actionSheetAnimationRef.current.style.setProperty('--kendo-actionsheet-height', 'auto');
60
+ this.actionSheetAnimationRef.current.style.setProperty('--kendo-actionsheet-max-height', 'none');
61
+ }
62
+ };
63
+ /**
64
+ * @hidden
65
+ */
66
+ ActionSheet.prototype.render = function () {
67
+ var _this = this;
68
+ var _a, _b;
69
+ var topGroupItems = (_a = this.props.items) === null || _a === void 0 ? void 0 : _a.filter(function (item) { return !item.group || item.group === 'top'; });
70
+ var bottomGroupItems = (_b = this.props.items) === null || _b === void 0 ? void 0 : _b.filter(function (item) { return item.group === 'bottom'; });
71
+ var shouldRenderSeparator = (topGroupItems && topGroupItems.length > 0) && (bottomGroupItems && bottomGroupItems.length > 0);
72
+ var children = this.children(this.props.children);
73
+ return (React.createElement("div", { className: "k-actionsheet-container" },
74
+ React.createElement("div", { className: "k-overlay", onClick: this.props.onOverlayClick }),
75
+ React.createElement("div", { className: "k-animation-container" },
76
+ React.createElement("div", { className: "k-child-animation-container", style: { bottom: '0px', width: '100%' } },
77
+ React.createElement("div", { className: "k-actionsheet k-actionsheet-bottom", role: "dialog", "aria-modal": "true", "aria-hidden": false, "aria-labelledby": this.ariaLabeledBy, ref: this.actionSheetAnimationRef },
78
+ (children[ActionSheetHeader_1.headerDisplayName] || this.props.title || this.props.subTitle) && (React.createElement("div", { className: "k-actionsheet-titlebar" },
79
+ React.createElement("div", { className: "k-actionsheet-titlebar-group k-hbox" },
80
+ React.createElement("div", { className: this.actionSheetTitleClass, id: this.ariaLabeledBy }, children[ActionSheetHeader_1.headerDisplayName] ||
81
+ React.createElement(React.Fragment, null,
82
+ React.createElement("div", { className: "k-text-center" }, this.props.title),
83
+ this.props.subTitle && React.createElement("div", { className: "k-actionsheet-subtitle k-text-center" }, this.props.subTitle)))))),
84
+ React.createElement("div", { className: "k-actionsheet-content" }, children[ActionSheetContent_1.contentDisplayName] ||
85
+ React.createElement(React.Fragment, null,
86
+ React.createElement("div", { className: "k-list-ul", role: "group" }, topGroupItems && topGroupItems.map(function (props, idx) {
87
+ return React.createElement(ActionSheetItem_1.ActionSheetItem, __assign({ key: idx }, props, { onClick: _this.props.onItemClick }));
88
+ })),
89
+ shouldRenderSeparator && React.createElement("hr", { className: "k-hr" }),
90
+ React.createElement("div", { className: "k-list-ul", role: "group" }, bottomGroupItems && bottomGroupItems.map(function (props, idx) {
91
+ return React.createElement(ActionSheetItem_1.ActionSheetItem, __assign({ key: idx }, props, { onClick: _this.props.onItemClick }));
92
+ })))),
93
+ children[ActionSheetFooter_1.footerDisplayName])))));
94
+ };
95
+ ;
96
+ ActionSheet.prototype.children = function (children) {
97
+ var components = {};
98
+ React.Children.forEach(children, function (child) {
99
+ components[child.type.displayName] = child;
100
+ });
101
+ return components;
102
+ };
103
+ ;
104
+ /**
105
+ * @hidden
106
+ */
107
+ ActionSheet.displayName = 'KendoReactActionSheet';
108
+ /**
109
+ * @hidden
110
+ */
111
+ ActionSheet.propTypes = {
112
+ items: PropTypes.array,
113
+ subTitle: PropTypes.string,
114
+ title: PropTypes.string
115
+ };
116
+ return ActionSheet;
117
+ }(React.Component));
118
+ exports.ActionSheet = ActionSheet;
119
+ ;
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { ActionSheetChildrenProps } from './interfaces/ActionSheetChildrenProps';
3
+ /**
4
+ * @hidden
5
+ */
6
+ export declare const contentDisplayName = "ActionSheetContent";
7
+ /**
8
+ * The KendoReact ActionSheetContent component.
9
+ */
10
+ export declare const ActionSheetContent: React.FunctionComponent<ActionSheetChildrenProps>;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ActionSheetContent = exports.contentDisplayName = void 0;
4
+ var PropTypes = require("prop-types");
5
+ /**
6
+ * @hidden
7
+ */
8
+ exports.contentDisplayName = 'ActionSheetContent';
9
+ /**
10
+ * The KendoReact ActionSheetContent component.
11
+ */
12
+ var ActionSheetContent = function (props) { return props.children; };
13
+ exports.ActionSheetContent = ActionSheetContent;
14
+ /**
15
+ * @hidden
16
+ */
17
+ exports.ActionSheetContent.displayName = exports.contentDisplayName;
18
+ /**
19
+ * @hidden
20
+ */
21
+ exports.ActionSheetContent.propTypes = {
22
+ children: PropTypes.any
23
+ };
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { ActionSheetChildrenProps } from './interfaces/ActionSheetChildrenProps';
3
+ /**
4
+ * @hidden
5
+ */
6
+ export declare const footerDisplayName = "ActionSheetFooter";
7
+ /**
8
+ * The KendoReact ActionSheetFooter component.
9
+ */
10
+ export declare const ActionSheetFooter: React.FunctionComponent<ActionSheetChildrenProps>;