first commit

This commit is contained in:
Stefan Hacker
2026-04-03 09:38:48 +02:00
commit 37ad745546
47450 changed files with 3120798 additions and 0 deletions
@@ -0,0 +1,3 @@
import * as React from 'react';
import type { IGroupFooterProps } from './GroupFooter.types';
export declare const GroupFooterBase: React.FunctionComponent<IGroupFooterProps>;
@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GroupFooterBase = void 0;
var React = require("react");
var Utilities_1 = require("../../Utilities");
var GroupSpacer_1 = require("./GroupSpacer");
var getClassNames = (0, Utilities_1.classNamesFunction)();
var GroupFooterBase = function (props) {
var group = props.group, groupLevel = props.groupLevel, footerText = props.footerText, indentWidth = props.indentWidth, styles = props.styles, theme = props.theme;
var classNames = getClassNames(styles, { theme: theme });
if (group && footerText) {
return (React.createElement("div", { className: classNames.root },
React.createElement(GroupSpacer_1.GroupSpacer, { indentWidth: indentWidth, count: groupLevel }),
footerText));
}
return null;
};
exports.GroupFooterBase = GroupFooterBase;
//# sourceMappingURL=GroupFooter.base.js.map
@@ -0,0 +1 @@
{"version":3,"file":"GroupFooter.base.js","sourceRoot":"../src/","sources":["components/GroupedList/GroupFooter.base.tsx"],"names":[],"mappings":";;;AAAA,6BAA+B;AAC/B,6CAAqD;AACrD,6CAA4C;AAG5C,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAA8C,CAAC;AAEhF,IAAM,eAAe,GAA+C,UAAA,KAAK;IACtE,IAAA,KAAK,GAAyD,KAAK,MAA9D,EAAE,UAAU,GAA6C,KAAK,WAAlD,EAAE,UAAU,GAAiC,KAAK,WAAtC,EAAE,WAAW,GAAoB,KAAK,YAAzB,EAAE,MAAM,GAAY,KAAK,OAAjB,EAAE,KAAK,GAAK,KAAK,MAAV,CAAW;IAC5E,IAAM,UAAU,GAAG,aAAa,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,KAAM,EAAE,CAAC,CAAC;IAE5D,IAAI,KAAK,IAAI,UAAU,EAAE,CAAC;QACxB,OAAO,CACL,6BAAK,SAAS,EAAE,UAAU,CAAC,IAAI;YAC7B,oBAAC,yBAAW,IAAC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,UAAW,GAAI;YAC5D,UAAU,CACP,CACP,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAdW,QAAA,eAAe,mBAc1B","sourcesContent":["import * as React from 'react';\nimport { classNamesFunction } from '../../Utilities';\nimport { GroupSpacer } from './GroupSpacer';\nimport type { IGroupFooterStyleProps, IGroupFooterStyles, IGroupFooterProps } from './GroupFooter.types';\n\nconst getClassNames = classNamesFunction<IGroupFooterStyleProps, IGroupFooterStyles>();\n\nexport const GroupFooterBase: React.FunctionComponent<IGroupFooterProps> = props => {\n const { group, groupLevel, footerText, indentWidth, styles, theme } = props;\n const classNames = getClassNames(styles, { theme: theme! });\n\n if (group && footerText) {\n return (\n <div className={classNames.root}>\n <GroupSpacer indentWidth={indentWidth} count={groupLevel!} />\n {footerText}\n </div>\n );\n }\n\n return null;\n};\n"]}
@@ -0,0 +1,4 @@
import * as React from 'react';
import type { IGroupFooterProps } from './GroupFooter.types';
export declare const GroupFooter: React.FunctionComponent<IGroupFooterProps>;
export type { IGroupFooterProps };
@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GroupFooter = void 0;
var Utilities_1 = require("../../Utilities");
var GroupFooter_styles_1 = require("./GroupFooter.styles");
var GroupFooter_base_1 = require("./GroupFooter.base");
exports.GroupFooter = (0, Utilities_1.styled)(GroupFooter_base_1.GroupFooterBase, GroupFooter_styles_1.getStyles, undefined, {
scope: 'GroupFooter',
});
//# sourceMappingURL=GroupFooter.js.map
@@ -0,0 +1 @@
{"version":3,"file":"GroupFooter.js","sourceRoot":"../src/","sources":["components/GroupedList/GroupFooter.ts"],"names":[],"mappings":";;;AACA,6CAAyC;AACzC,2DAAiD;AACjD,uDAAqD;AAGxC,QAAA,WAAW,GAA+C,IAAA,kBAAM,EAI3E,kCAAe,EAAE,8BAAS,EAAE,SAAS,EAAE;IACvC,KAAK,EAAE,aAAa;CACrB,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { styled } from '../../Utilities';\nimport { getStyles } from './GroupFooter.styles';\nimport { GroupFooterBase } from './GroupFooter.base';\nimport type { IGroupFooterProps, IGroupFooterStyles, IGroupFooterStyleProps } from './GroupFooter.types';\n\nexport const GroupFooter: React.FunctionComponent<IGroupFooterProps> = styled<\n IGroupFooterProps,\n IGroupFooterStyleProps,\n IGroupFooterStyles\n>(GroupFooterBase, getStyles, undefined, {\n scope: 'GroupFooter',\n});\n\nexport type { IGroupFooterProps };\n"]}
@@ -0,0 +1,2 @@
import type { IGroupFooterStyleProps, IGroupFooterStyles } from './GroupFooter.types';
export declare const getStyles: (props: IGroupFooterStyleProps) => IGroupFooterStyles;
@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getStyles = void 0;
var Styling_1 = require("../../Styling");
var GlobalClassNames = {
root: 'ms-groupFooter',
};
var getStyles = function (props) {
var theme = props.theme, className = props.className;
var classNames = (0, Styling_1.getGlobalClassNames)(GlobalClassNames, theme);
return {
root: [
theme.fonts.medium,
classNames.root,
{
position: 'relative',
padding: '5px 38px',
},
className,
],
};
};
exports.getStyles = getStyles;
//# sourceMappingURL=GroupFooter.styles.js.map
@@ -0,0 +1 @@
{"version":3,"file":"GroupFooter.styles.js","sourceRoot":"../src/","sources":["components/GroupedList/GroupFooter.styles.ts"],"names":[],"mappings":";;;AAAA,yCAAoD;AAGpD,IAAM,gBAAgB,GAAG;IACvB,IAAI,EAAE,gBAAgB;CACvB,CAAC;AAEK,IAAM,SAAS,GAAG,UAAC,KAA6B;IAC7C,IAAA,KAAK,GAAgB,KAAK,MAArB,EAAE,SAAS,GAAK,KAAK,UAAV,CAAW;IACnC,IAAM,UAAU,GAAG,IAAA,6BAAmB,EAAC,gBAAgB,EAAE,KAAM,CAAC,CAAC;IAEjE,OAAO;QACL,IAAI,EAAE;YACJ,KAAK,CAAC,KAAK,CAAC,MAAM;YAClB,UAAU,CAAC,IAAI;YACf;gBACE,QAAQ,EAAE,UAAU;gBACpB,OAAO,EAAE,UAAU;aACpB;YACD,SAAS;SACV;KACF,CAAC;AACJ,CAAC,CAAC;AAfW,QAAA,SAAS,aAepB","sourcesContent":["import { getGlobalClassNames } from '../../Styling';\nimport type { IGroupFooterStyleProps, IGroupFooterStyles } from './GroupFooter.types';\n\nconst GlobalClassNames = {\n root: 'ms-groupFooter',\n};\n\nexport const getStyles = (props: IGroupFooterStyleProps): IGroupFooterStyles => {\n const { theme, className } = props;\n const classNames = getGlobalClassNames(GlobalClassNames, theme!);\n\n return {\n root: [\n theme.fonts.medium,\n classNames.root,\n {\n position: 'relative',\n padding: '5px 38px',\n },\n className,\n ],\n };\n};\n"]}
@@ -0,0 +1,25 @@
import type { IStyleFunctionOrObject } from '../../Utilities';
import type { IGroupDividerProps } from './GroupedList.types';
import type { IStyle } from '../../Styling';
/**
* {@docCategory GroupedList}
*/
export interface IGroupFooterProps extends IGroupDividerProps {
/**
* Style function to be passed in to override the themed or default styles
*/
styles?: IStyleFunctionOrObject<IGroupFooterStyleProps, IGroupFooterStyles>;
}
/**
* {@docCategory GroupedList}
*/
export type IGroupFooterStyleProps = Required<Pick<IGroupFooterProps, 'theme'>> & Pick<IGroupFooterProps, 'selected' | 'className'> & {
/** Whether the footer is collapsed */
isCollapsed?: boolean;
};
/**
* {@docCategory GroupedList}
*/
export interface IGroupFooterStyles {
root: IStyle;
}
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=GroupFooter.types.js.map
@@ -0,0 +1 @@
{"version":3,"file":"GroupFooter.types.js","sourceRoot":"../src/","sources":["components/GroupedList/GroupFooter.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { IStyleFunctionOrObject } from '../../Utilities';\nimport type { IGroupDividerProps } from './GroupedList.types';\nimport type { IStyle } from '../../Styling';\n\n/**\n * {@docCategory GroupedList}\n */\nexport interface IGroupFooterProps extends IGroupDividerProps {\n /**\n * Style function to be passed in to override the themed or default styles\n */\n styles?: IStyleFunctionOrObject<IGroupFooterStyleProps, IGroupFooterStyles>;\n}\n\n/**\n * {@docCategory GroupedList}\n */\nexport type IGroupFooterStyleProps = Required<Pick<IGroupFooterProps, 'theme'>> &\n Pick<IGroupFooterProps, 'selected' | 'className'> & {\n /** Whether the footer is collapsed */\n isCollapsed?: boolean;\n };\n\n/**\n * {@docCategory GroupedList}\n */\nexport interface IGroupFooterStyles {\n root: IStyle;\n}\n"]}
@@ -0,0 +1,23 @@
import * as React from 'react';
import type { IGroupHeaderProps } from './GroupHeader.types';
import type { JSXElement } from '@fluentui/utilities';
export interface IGroupHeaderState {
isCollapsed: boolean;
isLoadingVisible: boolean;
}
export declare class GroupHeaderBase extends React.Component<IGroupHeaderProps, IGroupHeaderState> {
static defaultProps: IGroupHeaderProps;
private _classNames;
private _id;
static getDerivedStateFromProps(nextProps: IGroupHeaderProps, previousState: IGroupHeaderState): IGroupHeaderState;
constructor(props: IGroupHeaderProps);
render(): JSXElement | null;
private _toggleCollapse;
private _onKeyUp;
private _onToggleClick;
private _onHeaderClick;
private _defaultCheckboxRender;
private _fastDefaultCheckboxRender;
private _onRenderTitle;
private _onRenderName;
}
@@ -0,0 +1,159 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GroupHeaderBase = void 0;
var tslib_1 = require("tslib");
var React = require("react");
var Utilities_1 = require("../../Utilities");
var Selection_1 = require("../../Selection");
var Check_1 = require("../../Check");
var Icon_1 = require("../../Icon");
var GroupSpacer_1 = require("./GroupSpacer");
var Spinner_1 = require("../../Spinner");
var DetailsRowCheck_styles_1 = require("../DetailsList/DetailsRowCheck.styles");
var getClassNames = (0, Utilities_1.classNamesFunction)();
var GroupHeaderBase = /** @class */ (function (_super) {
tslib_1.__extends(GroupHeaderBase, _super);
function GroupHeaderBase(props) {
var _this = _super.call(this, props) || this;
_this._toggleCollapse = function () {
var _a = _this.props, group = _a.group, onToggleCollapse = _a.onToggleCollapse, isGroupLoading = _a.isGroupLoading;
var isCollapsed = _this.state.isCollapsed;
var newCollapsed = !isCollapsed;
var newLoadingVisible = !newCollapsed && isGroupLoading && isGroupLoading(group);
_this.setState({
isCollapsed: newCollapsed,
isLoadingVisible: newLoadingVisible,
});
if (onToggleCollapse) {
onToggleCollapse(group);
}
};
_this._onKeyUp = function (ev) {
var _a = _this.props, group = _a.group, onGroupHeaderKeyUp = _a.onGroupHeaderKeyUp;
if (onGroupHeaderKeyUp) {
onGroupHeaderKeyUp(ev, group);
}
if (!ev.defaultPrevented) {
// eslint-disable-next-line @typescript-eslint/no-deprecated
var shouldOpen = _this.state.isCollapsed && ev.which === (0, Utilities_1.getRTLSafeKeyCode)(Utilities_1.KeyCodes.right, _this.props.theme);
// eslint-disable-next-line @typescript-eslint/no-deprecated
var shouldClose = !_this.state.isCollapsed && ev.which === (0, Utilities_1.getRTLSafeKeyCode)(Utilities_1.KeyCodes.left, _this.props.theme);
if (shouldClose || shouldOpen) {
_this._toggleCollapse();
ev.stopPropagation();
ev.preventDefault();
}
}
};
_this._onToggleClick = function (ev) {
_this._toggleCollapse();
ev.stopPropagation();
ev.preventDefault();
};
_this._onHeaderClick = function () {
var _a = _this.props, group = _a.group, onGroupHeaderClick = _a.onGroupHeaderClick;
if (onGroupHeaderClick) {
onGroupHeaderClick(group);
}
};
_this._onRenderTitle = function (props) {
var group = props.group;
if (!group) {
return null;
}
var onRenderName = props.onRenderName
? (0, Utilities_1.composeRenderFunction)(props.onRenderName, _this._onRenderName)
: _this._onRenderName;
return (React.createElement("div", { className: _this._classNames.title, id: _this._id, onClick: _this._onHeaderClick, role: "gridcell", "aria-colspan": _this.props.ariaColSpan, "data-selection-invoke": true }, onRenderName(props)));
};
_this._onRenderName = function (props) {
var group = props.group;
if (!group) {
return null;
}
return (React.createElement(React.Fragment, null,
React.createElement("span", null, group.name),
React.createElement("span", { className: _this._classNames.headerCount },
"(",
group.count,
group.hasMoreData && '+',
")")));
};
_this._id = (0, Utilities_1.getId)('GroupHeader');
_this.state = {
isCollapsed: (_this.props.group && _this.props.group.isCollapsed),
isLoadingVisible: false,
};
return _this;
}
GroupHeaderBase.getDerivedStateFromProps = function (nextProps, previousState) {
if (nextProps.group) {
var newCollapsed = nextProps.group.isCollapsed;
var isGroupLoading = nextProps.isGroupLoading;
var newLoadingVisible = !newCollapsed && isGroupLoading && isGroupLoading(nextProps.group);
return tslib_1.__assign(tslib_1.__assign({}, previousState), { isCollapsed: newCollapsed || false, isLoadingVisible: newLoadingVisible || false });
}
return previousState;
};
GroupHeaderBase.prototype.render = function () {
var _a = this.props, group = _a.group, _b = _a.groupLevel, groupLevel = _b === void 0 ? 0 : _b, viewport = _a.viewport, selectionMode = _a.selectionMode, loadingText = _a.loadingText,
// eslint-disable-next-line @typescript-eslint/no-deprecated
_c = _a.isSelected,
// eslint-disable-next-line @typescript-eslint/no-deprecated
isSelected = _c === void 0 ? false : _c, _d = _a.selected, selected = _d === void 0 ? false : _d, indentWidth = _a.indentWidth, onRenderGroupHeaderCheckbox = _a.onRenderGroupHeaderCheckbox, _e = _a.isCollapsedGroupSelectVisible, isCollapsedGroupSelectVisible = _e === void 0 ? true : _e,
// eslint-disable-next-line @typescript-eslint/no-deprecated
expandButtonProps = _a.expandButtonProps, expandButtonIcon = _a.expandButtonIcon, selectAllButtonProps = _a.selectAllButtonProps, theme = _a.theme, styles = _a.styles, className = _a.className, compact = _a.compact, ariaLevel = _a.ariaLevel, ariaPosInSet = _a.ariaPosInSet, ariaSetSize = _a.ariaSetSize, ariaRowIndex = _a.ariaRowIndex, useFastIcons = _a.useFastIcons;
var onRenderTitle = this.props.onRenderTitle
? (0, Utilities_1.composeRenderFunction)(this.props.onRenderTitle, this._onRenderTitle)
: this._onRenderTitle;
var defaultCheckboxRender = useFastIcons ? this._fastDefaultCheckboxRender : this._defaultCheckboxRender;
var onRenderCheckbox = onRenderGroupHeaderCheckbox
? (0, Utilities_1.composeRenderFunction)(onRenderGroupHeaderCheckbox, defaultCheckboxRender)
: defaultCheckboxRender;
var _f = this.state, isCollapsed = _f.isCollapsed, isLoadingVisible = _f.isLoadingVisible;
var canSelectGroup = selectionMode === Selection_1.SelectionMode.multiple;
var isSelectionCheckVisible = canSelectGroup && (isCollapsedGroupSelectVisible || !(group && group.isCollapsed));
var currentlySelected = selected || isSelected;
var isRTL = (0, Utilities_1.getRTL)(theme);
this._classNames = getClassNames(styles, {
theme: theme,
className: className,
selected: currentlySelected,
isCollapsed: isCollapsed,
compact: compact,
});
if (!group) {
return null;
}
return (React.createElement("div", { className: this._classNames.root, style: viewport ? { minWidth: viewport.width } : {}, role: "row", "aria-level": ariaLevel, "aria-setsize": ariaSetSize, "aria-posinset": ariaPosInSet, "aria-rowindex": ariaRowIndex, "data-is-focusable": true, onKeyUp: this._onKeyUp, "aria-label": group.ariaLabel, "aria-labelledby": group.ariaLabel ? undefined : this._id, "aria-expanded": !this.state.isCollapsed, "aria-selected": canSelectGroup ? currentlySelected : undefined, "data-selection-index": group.startIndex, "data-selection-span": group.count },
React.createElement("div", { className: this._classNames.groupHeaderContainer, role: "presentation" },
isSelectionCheckVisible ? (React.createElement("div", { role: "gridcell" },
React.createElement("button", tslib_1.__assign({ "data-is-focusable": false, type: "button", className: this._classNames.check, role: "checkbox", id: "".concat(this._id, "-check"), "aria-checked": currentlySelected, "aria-labelledby": "".concat(this._id, "-check ").concat(this._id), "data-selection-toggle": true }, selectAllButtonProps), onRenderCheckbox({ checked: currentlySelected, theme: theme }, onRenderCheckbox)))) : (
// To make the group header align properly with the column headers, this spacer
// needs to be the same width as the check cell in the column header.
selectionMode !== Selection_1.SelectionMode.none && React.createElement(GroupSpacer_1.GroupSpacer, { indentWidth: DetailsRowCheck_styles_1.CHECK_CELL_WIDTH, count: 1 })),
React.createElement(GroupSpacer_1.GroupSpacer, { indentWidth: indentWidth, count: groupLevel }),
React.createElement("div", { className: this._classNames.dropIcon, role: "presentation" },
React.createElement(Icon_1.Icon, { iconName: "Tag" })),
React.createElement("div", { role: "gridcell" },
React.createElement("button", tslib_1.__assign({ "data-is-focusable": false, "data-selection-disabled": true, type: "button", className: this._classNames.expand, onClick: this._onToggleClick, "aria-expanded": !this.state.isCollapsed }, expandButtonProps),
React.createElement(Icon_1.Icon, { className: this._classNames.expandIsCollapsed, iconName: expandButtonIcon || (isRTL ? 'ChevronLeftMed' : 'ChevronRightMed') }))),
onRenderTitle(this.props),
isLoadingVisible && React.createElement(Spinner_1.Spinner, { label: loadingText }))));
};
GroupHeaderBase.prototype._defaultCheckboxRender = function (checkboxProps) {
return React.createElement(Check_1.Check, { checked: checkboxProps.checked });
};
GroupHeaderBase.prototype._fastDefaultCheckboxRender = function (checkboxProps) {
return React.createElement(FastCheck, { theme: checkboxProps.theme, checked: checkboxProps.checked });
};
GroupHeaderBase.defaultProps = {
expandButtonProps: { 'aria-label': 'expand collapse group' },
};
return GroupHeaderBase;
}(React.Component));
exports.GroupHeaderBase = GroupHeaderBase;
var FastCheck = React.memo(function (props) {
return React.createElement(Check_1.Check, { theme: props.theme, checked: props.checked, className: props.className, useFastIcons: true });
});
//# sourceMappingURL=GroupHeader.base.js.map
File diff suppressed because one or more lines are too long
@@ -0,0 +1,4 @@
import * as React from 'react';
import type { IGroupHeaderProps } from './GroupHeader.types';
export declare const GroupHeader: React.FunctionComponent<IGroupHeaderProps>;
export type { IGroupHeaderProps };
@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GroupHeader = void 0;
var Utilities_1 = require("../../Utilities");
var GroupHeader_styles_1 = require("./GroupHeader.styles");
var GroupHeader_base_1 = require("./GroupHeader.base");
exports.GroupHeader = (0, Utilities_1.styled)(GroupHeader_base_1.GroupHeaderBase, GroupHeader_styles_1.getStyles, undefined, {
scope: 'GroupHeader',
});
//# sourceMappingURL=GroupHeader.js.map
@@ -0,0 +1 @@
{"version":3,"file":"GroupHeader.js","sourceRoot":"../src/","sources":["components/GroupedList/GroupHeader.ts"],"names":[],"mappings":";;;AACA,6CAAyC;AACzC,2DAAiD;AACjD,uDAAqD;AAGxC,QAAA,WAAW,GAA+C,IAAA,kBAAM,EAI3E,kCAAe,EAAE,8BAAS,EAAE,SAAS,EAAE;IACvC,KAAK,EAAE,aAAa;CACrB,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { styled } from '../../Utilities';\nimport { getStyles } from './GroupHeader.styles';\nimport { GroupHeaderBase } from './GroupHeader.base';\nimport type { IGroupHeaderProps, IGroupHeaderStyles, IGroupHeaderStyleProps } from './GroupHeader.types';\n\nexport const GroupHeader: React.FunctionComponent<IGroupHeaderProps> = styled<\n IGroupHeaderProps,\n IGroupHeaderStyleProps,\n IGroupHeaderStyles\n>(GroupHeaderBase, getStyles, undefined, {\n scope: 'GroupHeader',\n});\n\nexport type { IGroupHeaderProps };\n"]}
@@ -0,0 +1,2 @@
import type { IGroupHeaderStyleProps, IGroupHeaderStyles } from './GroupHeader.types';
export declare const getStyles: (props: IGroupHeaderStyleProps) => IGroupHeaderStyles;
@@ -0,0 +1,213 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getStyles = void 0;
var Styling_1 = require("../../Styling");
var Utilities_1 = require("../../Utilities");
var DetailsRow_styles_1 = require("../DetailsList/DetailsRow.styles");
var DetailsRowCheck_styles_1 = require("../DetailsList/DetailsRowCheck.styles");
// For every group level there is a GroupSpacer added. Importing this const to have the source value in one place.
var GroupSpacer_1 = require("./GroupSpacer");
var GlobalClassNames = {
root: 'ms-GroupHeader',
compact: 'ms-GroupHeader--compact',
check: 'ms-GroupHeader-check',
dropIcon: 'ms-GroupHeader-dropIcon',
expand: 'ms-GroupHeader-expand',
isCollapsed: 'is-collapsed',
title: 'ms-GroupHeader-title',
isSelected: 'is-selected',
iconTag: 'ms-Icon--Tag',
group: 'ms-GroupedList-group',
isDropping: 'is-dropping',
};
var beziers = {
easeOutCirc: 'cubic-bezier(0.075, 0.820, 0.165, 1.000)',
easeOutSine: 'cubic-bezier(0.390, 0.575, 0.565, 1.000)',
easeInBack: 'cubic-bezier(0.600, -0.280, 0.735, 0.045)',
};
var DEFAULT_GROUP_HEADER_HEIGHT = 48;
var COMPACT_GROUP_HEADER_HEIGHT = 40;
var getStyles = function (props) {
var _a, _b, _c, _d, _e;
var theme = props.theme, className = props.className, selected = props.selected, isCollapsed = props.isCollapsed, compact = props.compact;
// padding from the source to align GroupHeader title with DetailsRow's first cell.
var cellLeftPadding = DetailsRow_styles_1.DEFAULT_CELL_STYLE_PROPS.cellLeftPadding;
var finalRowHeight = compact ? COMPACT_GROUP_HEADER_HEIGHT : DEFAULT_GROUP_HEADER_HEIGHT;
var semanticColors = theme.semanticColors, palette = theme.palette, fonts = theme.fonts;
var classNames = (0, Styling_1.getGlobalClassNames)(GlobalClassNames, theme);
var checkExpandResetStyles = [
(0, Styling_1.getFocusStyle)(theme),
{
cursor: 'default',
background: 'none',
backgroundColor: 'transparent',
border: 'none',
padding: 0, // cancel default <button> padding
},
];
return {
root: [
classNames.root,
(0, Styling_1.getFocusStyle)(theme),
theme.fonts.medium,
{
// keep the border for height but color it so it's invisible.
borderBottom: "1px solid ".concat(semanticColors.listBackground),
cursor: 'default',
userSelect: 'none',
selectors: (_a = {
':hover': {
background: semanticColors.listItemBackgroundHovered,
color: semanticColors.actionLinkHovered,
}
},
_a["&:hover .".concat(classNames.check)] = {
opacity: 1,
},
// eslint-disable-next-line @fluentui/max-len
_a[".".concat(Utilities_1.IsFocusVisibleClassName, " &:focus .").concat(classNames.check, ", :host(.").concat(Utilities_1.IsFocusVisibleClassName, ") &:focus .").concat(classNames.check)] = {
opacity: 1,
},
_a[":global(.".concat(classNames.group, ".").concat(classNames.isDropping, ")")] = {
selectors: (_b = {},
_b["& > .".concat(classNames.root, " .").concat(classNames.dropIcon)] = {
transition: "transform ".concat(Styling_1.AnimationVariables.durationValue4, " ").concat(beziers.easeOutCirc, " ") +
"opacity ".concat(Styling_1.AnimationVariables.durationValue1, " ").concat(beziers.easeOutSine),
transitionDelay: Styling_1.AnimationVariables.durationValue3,
opacity: 1,
transform: "rotate(0.2deg) scale(1);", // rotation prevents jittery motion in IE
},
_b[".".concat(classNames.check)] = {
opacity: 0,
},
_b),
},
_a),
},
selected && [
classNames.isSelected,
{
background: semanticColors.listItemBackgroundChecked,
selectors: (_c = {
':hover': {
background: semanticColors.listItemBackgroundCheckedHovered,
}
},
_c["".concat(classNames.check)] = {
opacity: 1,
},
_c),
},
],
compact && [classNames.compact, { border: 'none' }],
className,
],
groupHeaderContainer: [
{
display: 'flex',
alignItems: 'center',
height: finalRowHeight,
},
],
headerCount: [
{
padding: '0px 4px',
},
],
check: [
classNames.check,
checkExpandResetStyles,
{
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
// paddingTop and marginTop brought from the DetailsRow.styles.ts with explanation below.
// Ensure that the check cell covers the top border of the cell.
// This ensures the click target does not leave a spot which would
// cause other items to be deselected.
paddingTop: 1,
marginTop: -1,
opacity: 0,
width: DetailsRowCheck_styles_1.CHECK_CELL_WIDTH,
height: finalRowHeight,
selectors: (_d = {},
_d[".".concat(Utilities_1.IsFocusVisibleClassName, " &:focus, :host(.").concat(Utilities_1.IsFocusVisibleClassName, ") &:focus")] = {
opacity: 1,
},
_d),
},
],
expand: [
classNames.expand,
checkExpandResetStyles,
{
display: 'flex',
flexShrink: 0,
alignItems: 'center',
justifyContent: 'center',
fontSize: fonts.small.fontSize,
width: GroupSpacer_1.SPACER_WIDTH,
height: finalRowHeight,
color: selected ? palette.neutralPrimary : palette.neutralSecondary,
selectors: {
':hover': {
backgroundColor: selected ? palette.neutralQuaternary : palette.neutralLight,
},
':active': {
backgroundColor: selected ? palette.neutralTertiaryAlt : palette.neutralQuaternaryAlt,
},
},
},
],
expandIsCollapsed: [
isCollapsed
? [
classNames.isCollapsed,
{
transform: 'rotate(0deg)',
transformOrigin: '50% 50%',
transition: 'transform .1s linear',
},
]
: {
transform: (0, Utilities_1.getRTL)(theme) ? 'rotate(-90deg)' : 'rotate(90deg)',
transformOrigin: '50% 50%',
transition: 'transform .1s linear',
},
],
title: [
classNames.title,
{
paddingLeft: cellLeftPadding,
fontSize: compact ? fonts.medium.fontSize : fonts.mediumPlus.fontSize,
fontWeight: isCollapsed ? Styling_1.FontWeights.regular : Styling_1.FontWeights.semibold,
cursor: 'pointer',
outline: 0,
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
overflow: 'hidden',
},
],
dropIcon: [
classNames.dropIcon,
{
position: 'absolute',
left: -26,
fontSize: Styling_1.IconFontSizes.large,
color: palette.neutralSecondary,
transition: "transform ".concat(Styling_1.AnimationVariables.durationValue2, " ").concat(beziers.easeInBack, ", ") +
"opacity ".concat(Styling_1.AnimationVariables.durationValue4, " ").concat(beziers.easeOutSine),
opacity: 0,
transform: 'rotate(0.2deg) scale(0.65)', // rotation prevents jittery motion in IE
transformOrigin: '10px 10px',
selectors: (_e = {},
_e[":global(.".concat(classNames.iconTag, ")")] = {
position: 'absolute',
},
_e),
},
],
};
};
exports.getStyles = getStyles;
//# sourceMappingURL=GroupHeader.styles.js.map
File diff suppressed because one or more lines are too long
@@ -0,0 +1,58 @@
import * as React from 'react';
import type { IStyleFunctionOrObject, IRenderFunction } from '../../Utilities';
import type { IGroupDividerProps } from './GroupedList.types';
import type { IStyle, ITheme } from '../../Styling';
/**
* {@docCategory GroupedList}
*/
export interface IGroupHeaderProps extends IGroupDividerProps {
/** Style function to be passed in to override the themed or default styles */
styles?: IStyleFunctionOrObject<IGroupHeaderStyleProps, IGroupHeaderStyles>;
/** GroupedList id for aria-controls */
groupedListId?: string;
/** Native props for the GroupHeader expand and collapse button */
expandButtonProps?: React.HTMLAttributes<HTMLButtonElement>;
/** Defines the name of a custom icon to be used for group headers. If not set, the default icon will be used */
expandButtonIcon?: string;
/** Native props for the GroupHeader select all button */
selectAllButtonProps?: React.HTMLAttributes<HTMLButtonElement>;
/**
* If provided, can be used to render a custom checkbox
*/
onRenderGroupHeaderCheckbox?: IRenderFunction<IGroupHeaderCheckboxProps>;
/**
* Whether to use fast icon and check components. The icons can't be targeted by customization
* but are still customizable via class names.
* @defaultvalue true
*/
useFastIcons?: boolean;
}
/**
* {@docCategory GroupedList}
*/
export type IGroupHeaderStyleProps = Required<Pick<IGroupHeaderProps, 'theme'>> & Pick<IGroupHeaderProps, 'selected' | 'className'> & {
/** Is Header collapsed */
isCollapsed?: boolean;
/** Whether the group header is in compact mode or not */
compact?: boolean;
};
/**
* {@docCategory GroupedList}
*/
export interface IGroupHeaderStyles {
root: IStyle;
groupHeaderContainer: IStyle;
headerCount: IStyle;
check: IStyle;
dropIcon: IStyle;
expand: IStyle;
expandIsCollapsed: IStyle;
title: IStyle;
}
/**
* {@docCategory GroupedList}
*/
export interface IGroupHeaderCheckboxProps {
checked: boolean;
theme?: ITheme;
}
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=GroupHeader.types.js.map
@@ -0,0 +1 @@
{"version":3,"file":"GroupHeader.types.js","sourceRoot":"../src/","sources":["components/GroupedList/GroupHeader.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { IStyleFunctionOrObject, IRenderFunction } from '../../Utilities';\nimport type { IGroupDividerProps } from './GroupedList.types';\nimport type { IStyle, ITheme } from '../../Styling';\n\n/**\n * {@docCategory GroupedList}\n */\nexport interface IGroupHeaderProps extends IGroupDividerProps {\n /** Style function to be passed in to override the themed or default styles */\n styles?: IStyleFunctionOrObject<IGroupHeaderStyleProps, IGroupHeaderStyles>;\n\n /** GroupedList id for aria-controls */\n groupedListId?: string;\n\n /** Native props for the GroupHeader expand and collapse button */\n expandButtonProps?: React.HTMLAttributes<HTMLButtonElement>;\n\n /** Defines the name of a custom icon to be used for group headers. If not set, the default icon will be used */\n expandButtonIcon?: string;\n\n /** Native props for the GroupHeader select all button */\n selectAllButtonProps?: React.HTMLAttributes<HTMLButtonElement>;\n\n /**\n * If provided, can be used to render a custom checkbox\n */\n onRenderGroupHeaderCheckbox?: IRenderFunction<IGroupHeaderCheckboxProps>;\n\n /**\n * Whether to use fast icon and check components. The icons can't be targeted by customization\n * but are still customizable via class names.\n * @defaultvalue true\n */\n useFastIcons?: boolean;\n}\n\n/**\n * {@docCategory GroupedList}\n */\nexport type IGroupHeaderStyleProps = Required<Pick<IGroupHeaderProps, 'theme'>> &\n Pick<IGroupHeaderProps, 'selected' | 'className'> & {\n /** Is Header collapsed */\n isCollapsed?: boolean;\n\n /** Whether the group header is in compact mode or not */\n compact?: boolean;\n };\n\n/**\n * {@docCategory GroupedList}\n */\nexport interface IGroupHeaderStyles {\n root: IStyle;\n groupHeaderContainer: IStyle;\n headerCount: IStyle;\n check: IStyle;\n dropIcon: IStyle;\n expand: IStyle;\n expandIsCollapsed: IStyle;\n title: IStyle;\n}\n\n/**\n * {@docCategory GroupedList}\n */\nexport interface IGroupHeaderCheckboxProps {\n checked: boolean;\n theme?: ITheme;\n}\n"]}
@@ -0,0 +1,3 @@
import * as React from 'react';
import type { IGroupShowAllProps } from './GroupShowAll.types';
export declare const GroupShowAllBase: React.FunctionComponent<IGroupShowAllProps>;
@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GroupShowAllBase = void 0;
var React = require("react");
var Utilities_1 = require("../../Utilities");
var Link_1 = require("../../Link");
var GroupSpacer_1 = require("./GroupSpacer");
var getClassNames = (0, Utilities_1.classNamesFunction)();
var GroupShowAllBase = function (props) {
var group = props.group, groupLevel = props.groupLevel, _a = props.showAllLinkText, showAllLinkText = _a === void 0 ? 'Show All' : _a, styles = props.styles, theme = props.theme, onToggleSummarize = props.onToggleSummarize;
var classNames = getClassNames(styles, { theme: theme });
var memoizedOnClick = React.useCallback(function (ev) {
onToggleSummarize(group);
ev.stopPropagation();
ev.preventDefault();
}, [onToggleSummarize, group]);
if (group) {
return (React.createElement("div", { className: classNames.root },
React.createElement(GroupSpacer_1.GroupSpacer, { count: groupLevel }),
React.createElement(Link_1.Link, { onClick: memoizedOnClick }, showAllLinkText)));
}
return null;
};
exports.GroupShowAllBase = GroupShowAllBase;
//# sourceMappingURL=GroupShowAll.base.js.map
@@ -0,0 +1 @@
{"version":3,"file":"GroupShowAll.base.js","sourceRoot":"../src/","sources":["components/GroupedList/GroupShowAll.base.tsx"],"names":[],"mappings":";;;AAAA,6BAA+B;AAC/B,6CAAqD;AACrD,mCAAkC;AAClC,6CAA4C;AAG5C,IAAM,aAAa,GAAG,IAAA,8BAAkB,GAAgD,CAAC;AAElF,IAAM,gBAAgB,GAAgD,UAAA,KAAK;IACxE,IAAA,KAAK,GAAiF,KAAK,MAAtF,EAAE,UAAU,GAAqE,KAAK,WAA1E,EAAE,KAAmE,KAAK,gBAA5C,EAA5B,eAAe,mBAAG,UAAU,KAAA,EAAE,MAAM,GAA+B,KAAK,OAApC,EAAE,KAAK,GAAwB,KAAK,MAA7B,EAAE,iBAAiB,GAAK,KAAK,kBAAV,CAAW;IACpG,IAAM,UAAU,GAAG,aAAa,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,KAAM,EAAE,CAAC,CAAC;IAE5D,IAAM,eAAe,GAAG,KAAK,CAAC,WAAW,CACvC,UAAC,EAAiC;QAChC,iBAAkB,CAAC,KAAM,CAAC,CAAC;QAE3B,EAAE,CAAC,eAAe,EAAE,CAAC;QACrB,EAAE,CAAC,cAAc,EAAE,CAAC;IACtB,CAAC,EACD,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAC3B,CAAC;IAEF,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,CACL,6BAAK,SAAS,EAAE,UAAU,CAAC,IAAI;YAC7B,oBAAC,yBAAW,IAAC,KAAK,EAAE,UAAW,GAAI;YACnC,oBAAC,WAAI,IAAC,OAAO,EAAE,eAAe,IAAG,eAAe,CAAQ,CACpD,CACP,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAxBW,QAAA,gBAAgB,oBAwB3B","sourcesContent":["import * as React from 'react';\nimport { classNamesFunction } from '../../Utilities';\nimport { Link } from '../../Link';\nimport { GroupSpacer } from './GroupSpacer';\nimport type { IGroupShowAllProps, IGroupShowAllStyleProps, IGroupShowAllStyles } from './GroupShowAll.types';\n\nconst getClassNames = classNamesFunction<IGroupShowAllStyleProps, IGroupShowAllStyles>();\n\nexport const GroupShowAllBase: React.FunctionComponent<IGroupShowAllProps> = props => {\n const { group, groupLevel, showAllLinkText = 'Show All', styles, theme, onToggleSummarize } = props;\n const classNames = getClassNames(styles, { theme: theme! });\n\n const memoizedOnClick = React.useCallback(\n (ev: React.MouseEvent<HTMLElement>) => {\n onToggleSummarize!(group!);\n\n ev.stopPropagation();\n ev.preventDefault();\n },\n [onToggleSummarize, group],\n );\n\n if (group) {\n return (\n <div className={classNames.root}>\n <GroupSpacer count={groupLevel!} />\n <Link onClick={memoizedOnClick}>{showAllLinkText}</Link>\n </div>\n );\n }\n\n return null;\n};\n"]}
@@ -0,0 +1,4 @@
import * as React from 'react';
import type { IGroupShowAllProps } from './GroupShowAll.types';
export declare const GroupShowAll: React.FunctionComponent<IGroupShowAllProps>;
export type { IGroupShowAllProps };
@@ -0,0 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GroupShowAll = void 0;
var Utilities_1 = require("../../Utilities");
var GroupShowAll_styles_1 = require("./GroupShowAll.styles");
var GroupShowAll_base_1 = require("./GroupShowAll.base");
exports.GroupShowAll = (0, Utilities_1.styled)(GroupShowAll_base_1.GroupShowAllBase, GroupShowAll_styles_1.getStyles, undefined, { scope: 'GroupShowAll' });
//# sourceMappingURL=GroupShowAll.js.map
@@ -0,0 +1 @@
{"version":3,"file":"GroupShowAll.js","sourceRoot":"../src/","sources":["components/GroupedList/GroupShowAll.ts"],"names":[],"mappings":";;;AACA,6CAAyC;AACzC,6DAAkD;AAClD,yDAAuD;AAG1C,QAAA,YAAY,GAAgD,IAAA,kBAAM,EAI7E,oCAAgB,EAAE,+BAAS,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { styled } from '../../Utilities';\nimport { getStyles } from './GroupShowAll.styles';\nimport { GroupShowAllBase } from './GroupShowAll.base';\nimport type { IGroupShowAllProps, IGroupShowAllStyleProps, IGroupShowAllStyles } from './GroupShowAll.types';\n\nexport const GroupShowAll: React.FunctionComponent<IGroupShowAllProps> = styled<\n IGroupShowAllProps,\n IGroupShowAllStyleProps,\n IGroupShowAllStyles\n>(GroupShowAllBase, getStyles, undefined, { scope: 'GroupShowAll' });\n\nexport type { IGroupShowAllProps };\n"]}
@@ -0,0 +1,3 @@
import type { IGroupShowAllProps, IGroupShowAllStyleProps, IGroupShowAllStyles } from './GroupShowAll.types';
export declare const getStyles: (props: IGroupShowAllStyleProps) => IGroupShowAllStyles;
export type { IGroupShowAllProps };
@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getStyles = void 0;
var Styling_1 = require("../../Styling");
var GlobalClassNames = {
root: 'ms-GroupShowAll',
link: 'ms-Link',
};
var getStyles = function (props) {
var _a;
var theme = props.theme;
var fonts = theme.fonts;
var classNames = (0, Styling_1.getGlobalClassNames)(GlobalClassNames, theme);
return {
root: [
classNames.root,
{
position: 'relative',
padding: '10px 84px',
cursor: 'pointer',
selectors: (_a = {},
_a[".".concat(classNames.link)] = {
fontSize: fonts.small.fontSize,
},
_a),
},
],
};
};
exports.getStyles = getStyles;
//# sourceMappingURL=GroupShowAll.styles.js.map
@@ -0,0 +1 @@
{"version":3,"file":"GroupShowAll.styles.js","sourceRoot":"../src/","sources":["components/GroupedList/GroupShowAll.styles.ts"],"names":[],"mappings":";;;AAAA,yCAAoD;AAGpD,IAAM,gBAAgB,GAAG;IACvB,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE,SAAS;CAChB,CAAC;AAEK,IAAM,SAAS,GAAG,UAAC,KAA8B;;IAC9C,IAAA,KAAK,GAAK,KAAK,MAAV,CAAW;IAChB,IAAA,KAAK,GAAK,KAAK,MAAV,CAAW;IAExB,IAAM,UAAU,GAAG,IAAA,6BAAmB,EAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;IAEhE,OAAO;QACL,IAAI,EAAE;YACJ,UAAU,CAAC,IAAI;YACf;gBACE,QAAQ,EAAE,UAAU;gBACpB,OAAO,EAAE,WAAW;gBACpB,MAAM,EAAE,SAAS;gBACjB,SAAS;oBACP,GAAC,WAAI,UAAU,CAAC,IAAI,CAAE,IAAG;wBACvB,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,QAAQ;qBAC/B;uBACF;aACF;SACF;KACF,CAAC;AACJ,CAAC,CAAC;AArBW,QAAA,SAAS,aAqBpB","sourcesContent":["import { getGlobalClassNames } from '../../Styling';\nimport type { IGroupShowAllProps, IGroupShowAllStyleProps, IGroupShowAllStyles } from './GroupShowAll.types';\n\nconst GlobalClassNames = {\n root: 'ms-GroupShowAll',\n link: 'ms-Link',\n};\n\nexport const getStyles = (props: IGroupShowAllStyleProps): IGroupShowAllStyles => {\n const { theme } = props;\n const { fonts } = theme;\n\n const classNames = getGlobalClassNames(GlobalClassNames, theme);\n\n return {\n root: [\n classNames.root,\n {\n position: 'relative',\n padding: '10px 84px',\n cursor: 'pointer',\n selectors: {\n [`.${classNames.link}`]: {\n fontSize: fonts.small.fontSize,\n },\n },\n },\n ],\n };\n};\n\nexport type { IGroupShowAllProps };\n"]}
@@ -0,0 +1,27 @@
import type { IStyle } from '../../Styling';
import type { IGroupDividerProps } from './GroupedList.types';
import type { IStyleFunctionOrObject } from '../../Utilities';
/**
* {@docCategory GroupedList}
*/
export interface IGroupShowAllProps extends IGroupDividerProps {
/**
* Style function to be passed in to override the themed or default styles
*/
styles?: IStyleFunctionOrObject<IGroupShowAllStyleProps, IGroupShowAllStyles>;
/**
* The Show All link text.
* @defaultvalue 'Show All'
*/
showAllLinkText?: string;
}
/**
* {@docCategory GroupedList}
*/
export type IGroupShowAllStyleProps = Required<Pick<IGroupShowAllProps, 'theme'>>;
/**
* {@docCategory GroupedList}
*/
export interface IGroupShowAllStyles {
root: IStyle;
}
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=GroupShowAll.types.js.map
@@ -0,0 +1 @@
{"version":3,"file":"GroupShowAll.types.js","sourceRoot":"../src/","sources":["components/GroupedList/GroupShowAll.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { IStyle } from '../../Styling';\nimport type { IGroupDividerProps } from './GroupedList.types';\nimport type { IStyleFunctionOrObject } from '../../Utilities';\n\n/**\n * {@docCategory GroupedList}\n */\nexport interface IGroupShowAllProps extends IGroupDividerProps {\n /**\n * Style function to be passed in to override the themed or default styles\n */\n styles?: IStyleFunctionOrObject<IGroupShowAllStyleProps, IGroupShowAllStyles>;\n\n /**\n * The Show All link text.\n * @defaultvalue 'Show All'\n */\n showAllLinkText?: string;\n}\n\n/**\n * {@docCategory GroupedList}\n */\nexport type IGroupShowAllStyleProps = Required<Pick<IGroupShowAllProps, 'theme'>>;\n\n/**\n * {@docCategory GroupedList}\n */\nexport interface IGroupShowAllStyles {\n root: IStyle;\n}\n"]}
@@ -0,0 +1,4 @@
import * as React from 'react';
import type { IGroupSpacerProps } from './GroupSpacer.types';
export declare const SPACER_WIDTH = 36;
export declare const GroupSpacer: React.FunctionComponent<IGroupSpacerProps>;
@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GroupSpacer = exports.SPACER_WIDTH = void 0;
var React = require("react");
exports.SPACER_WIDTH = 36;
var GroupSpacer = function (props) {
var count = props.count, _a = props.indentWidth, indentWidth = _a === void 0 ? exports.SPACER_WIDTH : _a, _b = props.role, role = _b === void 0 ? 'presentation' : _b;
var width = count * indentWidth;
return count > 0 ? (React.createElement("span", { className: 'ms-GroupSpacer', style: { display: 'inline-block', width: width }, role: role })) : null;
};
exports.GroupSpacer = GroupSpacer;
//# sourceMappingURL=GroupSpacer.js.map
@@ -0,0 +1 @@
{"version":3,"file":"GroupSpacer.js","sourceRoot":"../src/","sources":["components/GroupedList/GroupSpacer.tsx"],"names":[],"mappings":";;;AAAA,6BAA+B;AAGlB,QAAA,YAAY,GAAG,EAAE,CAAC;AAExB,IAAM,WAAW,GAA+C,UAAA,KAAK;IAClE,IAAA,KAAK,GAAwD,KAAK,MAA7D,EAAE,KAAsD,KAAK,YAAjC,EAA1B,WAAW,mBAAG,oBAAY,KAAA,EAAE,KAA0B,KAAK,KAAV,EAArB,IAAI,mBAAG,cAAc,KAAA,CAAW;IAC3E,IAAM,KAAK,GAAG,KAAK,GAAG,WAAW,CAAC;IAElC,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CACjB,8BAAM,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,OAAA,EAAE,EAAE,IAAI,EAAE,IAAI,GAAI,CAC7F,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CAAC;AAPW,QAAA,WAAW,eAOtB","sourcesContent":["import * as React from 'react';\nimport type { IGroupSpacerProps } from './GroupSpacer.types';\n\nexport const SPACER_WIDTH = 36;\n\nexport const GroupSpacer: React.FunctionComponent<IGroupSpacerProps> = props => {\n const { count, indentWidth = SPACER_WIDTH, role = 'presentation' } = props;\n const width = count * indentWidth;\n\n return count > 0 ? (\n <span className={'ms-GroupSpacer'} style={{ display: 'inline-block', width }} role={role} />\n ) : null;\n};\n"]}
@@ -0,0 +1,35 @@
import type { IStyle, ITheme } from '../../Styling';
import type { IStyleFunctionOrObject } from '../../Utilities';
/**
* {@docCategory GroupedList}
*/
export interface IGroupSpacerProps {
/**
* @deprecated Unused. Will be removed in \>= 7.0
*/
theme?: ITheme;
/**
* @deprecated Unused. Will be removed in \>= 7.0
*/
styles?: IStyleFunctionOrObject<IGroupSpacerStyleProps, IGroupSpacerStyles>;
/** Count of spacer(s) */
count: number;
/** How much to indent */
indentWidth?: number;
/** Override the default role (presentation) */
role?: string;
}
/**
* {@docCategory GroupedList}
* @deprecated Unused. Use `IGroupSpacerProps.indentWidth`. Will be removed in \>= 7.0.
*/
export type IGroupSpacerStyleProps = Required<Pick<IGroupSpacerProps, 'theme'>> & {
width?: number;
};
/**
* {@docCategory GroupedList}
* @deprecated Unused. Will be removed in \>= 7.0.
*/
export interface IGroupSpacerStyles {
root: IStyle;
}
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=GroupSpacer.types.js.map
@@ -0,0 +1 @@
{"version":3,"file":"GroupSpacer.types.js","sourceRoot":"../src/","sources":["components/GroupedList/GroupSpacer.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { IStyle, ITheme } from '../../Styling';\nimport type { IStyleFunctionOrObject } from '../../Utilities';\n\n/**\n * {@docCategory GroupedList}\n */\nexport interface IGroupSpacerProps {\n /**\n * @deprecated Unused. Will be removed in \\>= 7.0\n */\n theme?: ITheme;\n\n /**\n * @deprecated Unused. Will be removed in \\>= 7.0\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n styles?: IStyleFunctionOrObject<IGroupSpacerStyleProps, IGroupSpacerStyles>;\n\n /** Count of spacer(s) */\n count: number;\n\n /** How much to indent */\n indentWidth?: number;\n\n /** Override the default role (presentation) */\n role?: string;\n}\n\n/**\n * {@docCategory GroupedList}\n * @deprecated Unused. Use `IGroupSpacerProps.indentWidth`. Will be removed in \\>= 7.0.\n */\nexport type IGroupSpacerStyleProps = Required<Pick<IGroupSpacerProps, 'theme'>> & {\n width?: number;\n};\n\n/**\n * {@docCategory GroupedList}\n * @deprecated Unused. Will be removed in \\>= 7.0.\n */\nexport interface IGroupSpacerStyles {\n root: IStyle;\n}\n"]}
@@ -0,0 +1,49 @@
import * as React from 'react';
import { ScrollToMode } from '../../List';
import { SelectionMode } from '../../Selection';
import type { IGroupedList, IGroupedListProps, IGroup } from './GroupedList.types';
import type { JSXElement } from '@fluentui/utilities';
export interface IGroupedListState {
selectionMode?: IGroupedListProps['selectionMode'];
compact?: IGroupedListProps['compact'];
groups?: IGroup[];
items?: IGroupedListProps['items'];
listProps?: IGroupedListProps['listProps'];
version: {};
}
export declare class GroupedListBase extends React.Component<IGroupedListProps, IGroupedListState> implements IGroupedList {
static defaultProps: {
selectionMode: SelectionMode;
isHeaderVisible: boolean;
groupProps: {};
compact: boolean;
};
private _classNames;
private _list;
private _isSomeGroupExpanded;
static getDerivedStateFromProps(nextProps: IGroupedListProps, previousState: IGroupedListState): IGroupedListState;
constructor(props: IGroupedListProps);
scrollToIndex(index: number, measureItem?: (itemIndex: number) => number, scrollToMode?: ScrollToMode): void;
getStartItemIndexInView(): number;
componentDidMount(): void;
render(): JSXElement;
forceUpdate(): void;
toggleCollapseAll(allCollapsed: boolean): void;
private _setGroupsCollapsedState;
private _renderGroup;
private _returnOne;
private _getDefaultGroupItemLimit;
private _getGroupItemLimit;
private _getGroupHeight;
private _getPageHeight;
private _getGroupKey;
private _getGroupNestingDepth;
private _onToggleCollapse;
private _onToggleSelectGroup;
private _isInnerZoneKeystroke;
private _forceListUpdates;
private _onToggleSummarize;
private _getPageSpecification;
private _computeIsSomeGroupExpanded;
private _updateIsSomeGroupExpanded;
}
@@ -0,0 +1,229 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GroupedListBase = void 0;
var tslib_1 = require("tslib");
var React = require("react");
var Utilities_1 = require("../../Utilities");
var GroupedListSection_1 = require("./GroupedListSection");
var List_1 = require("../../List");
var Selection_1 = require("../../Selection");
var DetailsRow_styles_1 = require("../DetailsList/DetailsRow.styles");
var FocusZone_1 = require("../../FocusZone");
var getClassNames = (0, Utilities_1.classNamesFunction)();
var ROW_HEIGHT = DetailsRow_styles_1.DEFAULT_ROW_HEIGHTS.rowHeight, COMPACT_ROW_HEIGHT = DetailsRow_styles_1.DEFAULT_ROW_HEIGHTS.compactRowHeight;
var GroupedListBase = /** @class */ (function (_super) {
tslib_1.__extends(GroupedListBase, _super);
function GroupedListBase(props) {
var _this = _super.call(this, props) || this;
_this._list = React.createRef();
_this._renderGroup = function (group, groupIndex) {
var _a = _this.props, dragDropEvents = _a.dragDropEvents, dragDropHelper = _a.dragDropHelper, eventsToRegister = _a.eventsToRegister, groupProps = _a.groupProps, items = _a.items, listProps = _a.listProps, onRenderCell = _a.onRenderCell, selectionMode = _a.selectionMode, selection = _a.selection, viewport = _a.viewport, onShouldVirtualize = _a.onShouldVirtualize, groups = _a.groups, compact = _a.compact;
// override group header/footer props as needed
var dividerProps = {
onToggleSelectGroup: _this._onToggleSelectGroup,
onToggleCollapse: _this._onToggleCollapse,
onToggleSummarize: _this._onToggleSummarize,
};
var headerProps = tslib_1.__assign(tslib_1.__assign({}, groupProps.headerProps), dividerProps);
var showAllProps = tslib_1.__assign(tslib_1.__assign({}, groupProps.showAllProps), dividerProps);
var footerProps = tslib_1.__assign(tslib_1.__assign({}, groupProps.footerProps), dividerProps);
var groupNestingDepth = _this._getGroupNestingDepth();
if (!groupProps.showEmptyGroups && group && group.count === 0) {
return null;
}
var finalListProps = tslib_1.__assign(tslib_1.__assign({}, (listProps || {})), { version: _this.state.version });
return (React.createElement(GroupedListSection_1.GroupedListSection, { key: _this._getGroupKey(group, groupIndex), dragDropEvents: dragDropEvents, dragDropHelper: dragDropHelper, eventsToRegister: eventsToRegister, footerProps: footerProps, getGroupItemLimit: groupProps && groupProps.getGroupItemLimit, group: group, groupIndex: groupIndex, groupNestingDepth: groupNestingDepth, groupProps: groupProps, headerProps: headerProps, listProps: finalListProps, items: items, onRenderCell: onRenderCell, onRenderGroupHeader: groupProps.onRenderHeader, onRenderGroupShowAll: groupProps.onRenderShowAll, onRenderGroupFooter: groupProps.onRenderFooter, selectionMode: selectionMode, selection: selection, showAllProps: showAllProps, viewport: viewport, onShouldVirtualize: onShouldVirtualize, groupedListClassNames: _this._classNames, groups: groups, compact: compact }));
};
_this._getDefaultGroupItemLimit = function (group) {
return group.children && group.children.length > 0 ? group.children.length : group.count;
};
_this._getGroupItemLimit = function (group) {
var groupProps = _this.props.groupProps;
var getGroupItemLimit = groupProps && groupProps.getGroupItemLimit ? groupProps.getGroupItemLimit : _this._getDefaultGroupItemLimit;
return getGroupItemLimit(group);
};
_this._getGroupHeight = function (group) {
var rowHeight = _this.props.compact ? COMPACT_ROW_HEIGHT : ROW_HEIGHT;
return rowHeight + (group.isCollapsed ? 0 : rowHeight * _this._getGroupItemLimit(group));
};
_this._getPageHeight = function (itemIndex) {
var groups = _this.state.groups;
var _a = _this.props.getGroupHeight, getGroupHeight = _a === void 0 ? _this._getGroupHeight : _a;
var pageGroup = groups && groups[itemIndex];
if (pageGroup) {
return getGroupHeight(pageGroup, itemIndex);
}
else {
return 0;
}
};
_this._onToggleCollapse = function (group) {
var groupProps = _this.props.groupProps;
var onToggleCollapse = groupProps && groupProps.headerProps && groupProps.headerProps.onToggleCollapse;
if (group) {
if (onToggleCollapse) {
onToggleCollapse(group);
}
group.isCollapsed = !group.isCollapsed;
_this._updateIsSomeGroupExpanded();
_this.forceUpdate();
}
};
_this._onToggleSelectGroup = function (group) {
var _a = _this.props, selection = _a.selection, selectionMode = _a.selectionMode;
if (group && selection && selectionMode === Selection_1.SelectionMode.multiple) {
selection.toggleRangeSelected(group.startIndex, group.count);
}
};
_this._isInnerZoneKeystroke = function (ev) {
// eslint-disable-next-line @typescript-eslint/no-deprecated
return ev.which === (0, Utilities_1.getRTLSafeKeyCode)(Utilities_1.KeyCodes.right);
};
_this._onToggleSummarize = function (group) {
var groupProps = _this.props.groupProps;
var onToggleSummarize = groupProps && groupProps.showAllProps && groupProps.showAllProps.onToggleSummarize;
if (onToggleSummarize) {
onToggleSummarize(group);
}
else {
if (group) {
group.isShowingAll = !group.isShowingAll;
}
_this.forceUpdate();
}
};
_this._getPageSpecification = function (itemIndex) {
var groups = _this.state.groups;
var pageGroup = groups && groups[itemIndex];
return {
key: pageGroup && pageGroup.key,
};
};
(0, Utilities_1.initializeComponentRef)(_this);
_this._isSomeGroupExpanded = _this._computeIsSomeGroupExpanded(props.groups);
var _a = props.listProps, _b = _a === void 0 ? {} : _a, _c = _b.version, version = _c === void 0 ? {} : _c;
_this.state = {
groups: props.groups,
items: props.items,
listProps: props.listProps,
version: version,
};
return _this;
}
GroupedListBase.getDerivedStateFromProps = function (nextProps, previousState) {
var groups = nextProps.groups, selectionMode = nextProps.selectionMode, compact = nextProps.compact, items = nextProps.items, listProps = nextProps.listProps;
var listVersion = listProps && listProps.version;
var nextState = tslib_1.__assign(tslib_1.__assign({}, previousState), { selectionMode: selectionMode, compact: compact, groups: groups, listProps: listProps, items: items });
var shouldForceUpdates = false;
var previousListVersion = previousState.listProps && previousState.listProps.version;
if (listVersion !== previousListVersion ||
items !== previousState.items ||
groups !== previousState.groups ||
selectionMode !== previousState.selectionMode ||
compact !== previousState.compact) {
// If there are any props not passed explicitly to `List` which have an impact on the behavior of `onRenderCell`,
// these need to 'force-update' this component by revving the version. Otherwise, the List might render with stale
// data.
shouldForceUpdates = true;
}
if (shouldForceUpdates) {
nextState = tslib_1.__assign(tslib_1.__assign({}, nextState), { version: {} });
}
return nextState;
};
GroupedListBase.prototype.scrollToIndex = function (index, measureItem, scrollToMode) {
if (this._list.current) {
this._list.current.scrollToIndex(index, measureItem, scrollToMode);
}
};
GroupedListBase.prototype.getStartItemIndexInView = function () {
return this._list.current.getStartItemIndexInView() || 0;
};
GroupedListBase.prototype.componentDidMount = function () {
var _a = this.props, groupProps = _a.groupProps, _b = _a.groups, groups = _b === void 0 ? [] : _b;
if (groupProps && groupProps.isAllGroupsCollapsed) {
this._setGroupsCollapsedState(groups, groupProps.isAllGroupsCollapsed);
}
};
GroupedListBase.prototype.render = function () {
var _a = this.props, className = _a.className, usePageCache = _a.usePageCache, onShouldVirtualize = _a.onShouldVirtualize, theme = _a.theme, _b = _a.role, role = _b === void 0 ? 'treegrid' : _b, styles = _a.styles, compact = _a.compact, _c = _a.focusZoneProps, focusZoneProps = _c === void 0 ? {} : _c, _d = _a.rootListProps, rootListProps = _d === void 0 ? {} : _d;
var _e = this.state, groups = _e.groups, version = _e.version;
this._classNames = getClassNames(styles, {
theme: theme,
className: className,
compact: compact,
});
var _f = focusZoneProps.shouldEnterInnerZone, shouldEnterInnerZone = _f === void 0 ? this._isInnerZoneKeystroke : _f;
return (React.createElement(FocusZone_1.FocusZone, tslib_1.__assign({ direction: FocusZone_1.FocusZoneDirection.vertical, "data-automationid": "GroupedList", "data-is-scrollable": "false", role: "presentation" }, focusZoneProps, { shouldEnterInnerZone: shouldEnterInnerZone, className: (0, Utilities_1.css)(this._classNames.root, focusZoneProps.className) }),
React.createElement(Utilities_1.FocusRects, null),
!groups ? (this._renderGroup(undefined, 0)) : (React.createElement(List_1.List, tslib_1.__assign({ ref: this._list, role: role, items: groups, onRenderCell: this._renderGroup, getItemCountForPage: this._returnOne, getPageHeight: this._getPageHeight, getPageSpecification: this._getPageSpecification, usePageCache: usePageCache, onShouldVirtualize: onShouldVirtualize, version: version }, rootListProps)))));
};
GroupedListBase.prototype.forceUpdate = function () {
_super.prototype.forceUpdate.call(this);
this._forceListUpdates();
};
GroupedListBase.prototype.toggleCollapseAll = function (allCollapsed) {
var _a = this.state.groups, groups = _a === void 0 ? [] : _a;
var groupProps = this.props.groupProps;
var onToggleCollapseAll = groupProps && groupProps.onToggleCollapseAll;
if (groups.length > 0) {
if (onToggleCollapseAll) {
onToggleCollapseAll(allCollapsed);
}
this._setGroupsCollapsedState(groups, allCollapsed);
this._updateIsSomeGroupExpanded();
this.forceUpdate();
}
};
GroupedListBase.prototype._setGroupsCollapsedState = function (groups, isCollapsed) {
for (var groupIndex = 0; groupIndex < groups.length; groupIndex++) {
groups[groupIndex].isCollapsed = isCollapsed;
}
};
GroupedListBase.prototype._returnOne = function () {
return 1;
};
GroupedListBase.prototype._getGroupKey = function (group, index) {
return 'group-' + (group && group.key ? group.key : String(index));
};
GroupedListBase.prototype._getGroupNestingDepth = function () {
var groups = this.state.groups;
var level = 0;
var groupsInLevel = groups;
while (groupsInLevel && groupsInLevel.length > 0) {
level++;
groupsInLevel = groupsInLevel[0].children;
}
return level;
};
GroupedListBase.prototype._forceListUpdates = function (groups) {
this.setState({
version: {},
});
};
GroupedListBase.prototype._computeIsSomeGroupExpanded = function (groups) {
var _this = this;
return !!(groups &&
groups.some(function (group) { return (group.children ? _this._computeIsSomeGroupExpanded(group.children) : !group.isCollapsed); }));
};
GroupedListBase.prototype._updateIsSomeGroupExpanded = function () {
var groups = this.state.groups;
var onGroupExpandStateChanged = this.props.onGroupExpandStateChanged;
var newIsSomeGroupExpanded = this._computeIsSomeGroupExpanded(groups);
if (this._isSomeGroupExpanded !== newIsSomeGroupExpanded) {
if (onGroupExpandStateChanged) {
onGroupExpandStateChanged(newIsSomeGroupExpanded);
}
this._isSomeGroupExpanded = newIsSomeGroupExpanded;
}
};
GroupedListBase.defaultProps = {
selectionMode: Selection_1.SelectionMode.multiple,
isHeaderVisible: true,
groupProps: {},
compact: false,
};
return GroupedListBase;
}(React.Component));
exports.GroupedListBase = GroupedListBase;
//# sourceMappingURL=GroupedList.base.js.map
File diff suppressed because one or more lines are too long
@@ -0,0 +1,4 @@
import * as React from 'react';
import type { IGroupedListProps } from './GroupedList.types';
export declare const GroupedList: React.FunctionComponent<IGroupedListProps>;
export type { IGroupedListProps };
@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GroupedList = void 0;
var Utilities_1 = require("../../Utilities");
var GroupedList_styles_1 = require("./GroupedList.styles");
var GroupedList_base_1 = require("./GroupedList.base");
exports.GroupedList = (0, Utilities_1.styled)(GroupedList_base_1.GroupedListBase, GroupedList_styles_1.getStyles, undefined, {
scope: 'GroupedList',
});
//# sourceMappingURL=GroupedList.js.map
@@ -0,0 +1 @@
{"version":3,"file":"GroupedList.js","sourceRoot":"../src/","sources":["components/GroupedList/GroupedList.ts"],"names":[],"mappings":";;;AACA,6CAAyC;AACzC,2DAAiD;AACjD,uDAAqD;AAGxC,QAAA,WAAW,GAA+C,IAAA,kBAAM,EAI3E,kCAAe,EAAE,8BAAS,EAAE,SAAS,EAAE;IACvC,KAAK,EAAE,aAAa;CACrB,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { styled } from '../../Utilities';\nimport { getStyles } from './GroupedList.styles';\nimport { GroupedListBase } from './GroupedList.base';\nimport type { IGroupedListProps, IGroupedListStyles, IGroupedListStyleProps } from './GroupedList.types';\n\nexport const GroupedList: React.FunctionComponent<IGroupedListProps> = styled<\n IGroupedListProps,\n IGroupedListStyleProps,\n IGroupedListStyles\n>(GroupedListBase, getStyles, undefined, {\n scope: 'GroupedList',\n});\n\nexport type { IGroupedListProps };\n"]}
@@ -0,0 +1,2 @@
import type { IGroupedListStyleProps, IGroupedListStyles } from './GroupedList.types';
export declare const getStyles: (props: IGroupedListStyleProps) => IGroupedListStyles;
@@ -0,0 +1,56 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getStyles = void 0;
var Styling_1 = require("../../Styling");
var GlobalClassNames = {
root: 'ms-GroupedList',
compact: 'ms-GroupedList--Compact',
group: 'ms-GroupedList-group',
link: 'ms-Link',
listCell: 'ms-List-cell',
};
var beziers = {
easeInOutSine: 'cubic-bezier(0.445, 0.050, 0.550, 0.950)',
};
var getStyles = function (props) {
var _a, _b;
var theme = props.theme, className = props.className, compact = props.compact;
var palette = theme.palette;
var classNames = (0, Styling_1.getGlobalClassNames)(GlobalClassNames, theme);
return {
root: [
classNames.root,
theme.fonts.small,
{
position: 'relative',
selectors: (_a = {},
_a[".".concat(classNames.listCell)] = {
minHeight: 38, // be consistent with DetailsList styles
},
_a),
},
compact && [
classNames.compact,
{
selectors: (_b = {},
_b[".".concat(classNames.listCell)] = {
minHeight: 32, // be consistent with DetailsList styles
},
_b),
},
],
className,
],
group: [
classNames.group,
{
transition: "background-color ".concat(Styling_1.AnimationVariables.durationValue2, " ").concat(beziers.easeInOutSine),
},
],
groupIsDropping: {
backgroundColor: palette.neutralLight,
},
};
};
exports.getStyles = getStyles;
//# sourceMappingURL=GroupedList.styles.js.map
@@ -0,0 +1 @@
{"version":3,"file":"GroupedList.styles.js","sourceRoot":"../src/","sources":["components/GroupedList/GroupedList.styles.ts"],"names":[],"mappings":";;;AAAA,yCAAwE;AAGxE,IAAM,gBAAgB,GAAG;IACvB,IAAI,EAAE,gBAAgB;IACtB,OAAO,EAAE,yBAAyB;IAClC,KAAK,EAAE,sBAAsB;IAC7B,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,cAAc;CACzB,CAAC;AAEF,IAAM,OAAO,GAAG;IACd,aAAa,EAAE,0CAA0C;CAC1D,CAAC;AAEK,IAAM,SAAS,GAAG,UAAC,KAA6B;;IAC7C,IAAA,KAAK,GAAyB,KAAK,MAA9B,EAAE,SAAS,GAAc,KAAK,UAAnB,EAAE,OAAO,GAAK,KAAK,QAAV,CAAW;IACpC,IAAA,OAAO,GAAK,KAAK,QAAV,CAAW;IAC1B,IAAM,UAAU,GAAG,IAAA,6BAAmB,EAAC,gBAAgB,EAAE,KAAM,CAAC,CAAC;IAEjE,OAAO;QACL,IAAI,EAAE;YACJ,UAAU,CAAC,IAAI;YACf,KAAK,CAAC,KAAK,CAAC,KAAK;YACjB;gBACE,QAAQ,EAAE,UAAU;gBACpB,SAAS;oBACP,GAAC,WAAI,UAAU,CAAC,QAAQ,CAAE,IAAG;wBAC3B,SAAS,EAAE,EAAE,EAAE,wCAAwC;qBACxD;uBACF;aACF;YACD,OAAO,IAAI;gBACT,UAAU,CAAC,OAAO;gBAClB;oBACE,SAAS;wBACP,GAAC,WAAI,UAAU,CAAC,QAAQ,CAAE,IAAG;4BAC3B,SAAS,EAAE,EAAE,EAAE,wCAAwC;yBACxD;2BACF;iBACF;aACF;YACD,SAAS;SACV;QACD,KAAK,EAAE;YACL,UAAU,CAAC,KAAK;YAChB;gBACE,UAAU,EAAE,2BAAoB,4BAAkB,CAAC,cAAc,cAAI,OAAO,CAAC,aAAa,CAAE;aAC7F;SACF;QACD,eAAe,EAAE;YACf,eAAe,EAAE,OAAO,CAAC,YAAY;SACtC;KACF,CAAC;AACJ,CAAC,CAAC;AAvCW,QAAA,SAAS,aAuCpB","sourcesContent":["import { getGlobalClassNames, AnimationVariables } from '../../Styling';\nimport type { IGroupedListStyleProps, IGroupedListStyles } from './GroupedList.types';\n\nconst GlobalClassNames = {\n root: 'ms-GroupedList',\n compact: 'ms-GroupedList--Compact',\n group: 'ms-GroupedList-group',\n link: 'ms-Link',\n listCell: 'ms-List-cell',\n};\n\nconst beziers = {\n easeInOutSine: 'cubic-bezier(0.445, 0.050, 0.550, 0.950)',\n};\n\nexport const getStyles = (props: IGroupedListStyleProps): IGroupedListStyles => {\n const { theme, className, compact } = props;\n const { palette } = theme;\n const classNames = getGlobalClassNames(GlobalClassNames, theme!);\n\n return {\n root: [\n classNames.root,\n theme.fonts.small,\n {\n position: 'relative',\n selectors: {\n [`.${classNames.listCell}`]: {\n minHeight: 38, // be consistent with DetailsList styles\n },\n },\n },\n compact && [\n classNames.compact,\n {\n selectors: {\n [`.${classNames.listCell}`]: {\n minHeight: 32, // be consistent with DetailsList styles\n },\n },\n },\n ],\n className,\n ],\n group: [\n classNames.group,\n {\n transition: `background-color ${AnimationVariables.durationValue2} ${beziers.easeInOutSine}`,\n },\n ],\n groupIsDropping: {\n backgroundColor: palette.neutralLight,\n },\n };\n};\n"]}
@@ -0,0 +1,301 @@
import * as React from 'react';
import { GroupedListBase } from './GroupedList.base';
import { SelectionMode } from '../../Selection';
import type { IList, IListProps } from '../../List';
import type { IFocusZoneProps } from '../../FocusZone';
import type { IRefObject, IRenderFunction, IStyleFunctionOrObject } from '../../Utilities';
import type { IDragDropContext, IDragDropEvents, IDragDropHelper } from '../../DragDrop';
import type { ISelection } from '../../Selection';
import type { IViewport } from '../../utilities/decorators/withViewport';
import type { ITheme, IStyle } from '../../Styling';
import type { IGroupHeaderProps } from './GroupHeader.types';
import type { IGroupShowAllProps } from './GroupShowAll.types';
import type { IGroupFooterProps } from './GroupFooter.types';
/**
* {@docCategory GroupedList}
*/
export declare enum CollapseAllVisibility {
hidden = 0,
visible = 1
}
/**
* {@docCategory GroupedList}
*/
export interface IGroupedList extends IList {
/**
* Ensures that the list content is updated. Call this in cases where the list props don't change, but the list still
* needs to be re-evaluated. For example, if a sizer bar is adjusted and causes the list width to change, you can
* call this to force a re-evaluation. Be aware that this can be an expensive operation and should be done sparingly.
*/
forceUpdate: () => void;
/**
* Toggles the collapsed state of all the groups in the list.
*/
toggleCollapseAll: (allCollapsed: boolean) => void;
}
/**
* {@docCategory GroupedList}
*/
export interface IGroupedListProps extends React.ClassAttributes<GroupedListBase> {
/**
* Theme that is passed in from Higher Order Component
*/
theme?: ITheme;
/**
* Style function to be passed in to override the themed or default styles
*/
styles?: IStyleFunctionOrObject<IGroupedListStyleProps, IGroupedListStyles>;
/**
* Optional callback to access the IGroupedList interface. Use this instead of ref for accessing
* the public methods and properties of the component.
*/
componentRef?: IRefObject<IGroupedList>;
/** Optional class name to add to the root element. */
className?: string;
/** Boolean value to indicate if the component should render in compact mode. Set to false by default */
compact?: boolean;
/** Map of callback functions related to drag and drop functionality. */
dragDropEvents?: IDragDropEvents;
/** helper to manage drag/drop across item and groups */
dragDropHelper?: IDragDropHelper;
/** Event names and corresponding callbacks that will be registered to groups and rendered elements */
eventsToRegister?: {
eventName: string;
callback: (context: IDragDropContext, event?: any) => void;
}[];
/** Optional override properties to render groups. */
groupProps?: IGroupRenderProps;
/** Optional grouping instructions. */
groups?: IGroup[];
/** List of items to render. */
items: any[];
/** Optional properties to pass through to the FocusZone. */
focusZoneProps?: IFocusZoneProps;
/** Optional properties to pass through to the list components being rendered. */
listProps?: IListProps;
/** Optional properties to pass through to the root list component being rendered. */
rootListProps?: IListProps;
/** Rendering callback to render the group items. */
onRenderCell: (nestingDepth?: number, item?: any, index?: number) => React.ReactNode;
/** Override the default role for GroupedList. */
role?: string;
/** Optional selection model to track selection state. */
selection?: ISelection;
/** Controls how/if the list manages selection. */
selectionMode?: SelectionMode;
/** Optional Viewport, provided by the parent component. */
viewport?: IViewport;
/** Optional callback when the group expand state changes between all collapsed and at least one group is expanded. */
onGroupExpandStateChanged?: (isSomeGroupExpanded: boolean) => void;
/**
* boolean to control if pages containing unchanged items should be cached, this is a perf optimization
* The same property in List.Props
*/
usePageCache?: boolean;
/**
* Optional callback to determine whether the list should be rendered in full, or virtualized.
* Virtualization will add and remove pages of items as the user scrolls them into the visible range.
* This benefits larger list scenarios by reducing the DOM on the screen, but can negatively affect performance for
* smaller lists.
* The default implementation will virtualize when this callback is not provided.
*/
onShouldVirtualize?: (props: IListProps) => boolean;
/**
* Optional function to override default group height calculation used by list virtualization.
*/
getGroupHeight?: (group: IGroup, groupIndex: number) => number;
}
/**
* {@docCategory GroupedList}
*/
export interface IGroup {
/**
* Unique identifier for the group.
*/
key: string;
/**
* Display name for the group, rendered on the header.
*/
name: string;
/**
* Start index for the group within the given items.
*/
startIndex: number;
/**
* How many items should be rendered within the group.
*/
count: number;
/**
* Nested groups, if any.
*/
children?: IGroup[];
/**
* Number indicating the level of nested groups.
*/
level?: number;
/**
* @deprecated At 1.0.0, selection state wil be controlled by the selection store only.
*/
isSelected?: boolean;
/**
* If all the items in the group are collapsed.
*/
isCollapsed?: boolean;
/**
* If the items within the group are summarized or showing all.
*/
isShowingAll?: boolean;
/**
* If drag/drop is enabled for the group header.
*/
isDropEnabled?: boolean;
/**
* Arbitrary data required to be preserved by the caller.
*/
data?: any;
/**
* Optional accessibility label (aria-label) attribute that will be stamped on to the element.
* If none is specified, the arai-label attribute will contain the group name
*/
ariaLabel?: string;
/**
* Optional flag to indicate the group has more data to load than the current group count indicated.
* This can be used to indicate that a plus should be rendered next to the group count in the header.
*/
hasMoreData?: boolean;
}
/**
* {@docCategory GroupedList}
*/
export interface IGroupRenderProps {
/** Boolean indicating if all groups are in collapsed state. */
isAllGroupsCollapsed?: boolean;
/** Grouping item limit. */
getGroupItemLimit?: (group: IGroup) => number;
/** Callback for when all groups are expanded or collapsed. */
onToggleCollapseAll?: (isAllCollapsed: boolean) => void;
/** Information to pass in to the group header. */
headerProps?: IGroupHeaderProps;
/** Information to pass in to the group Show all footer. */
showAllProps?: IGroupShowAllProps;
/** Information to pass in to the group footer. */
footerProps?: IGroupFooterProps;
/**
* Override which allows the caller to provide a custom header.
*/
onRenderHeader?: IRenderFunction<IGroupHeaderProps>;
/**
* Override which allows the caller to provide a custom Show All link.
*/
onRenderShowAll?: IRenderFunction<IGroupShowAllProps>;
/**
* Override which allows the caller to provide a custom footer.
*/
onRenderFooter?: IRenderFunction<IGroupFooterProps>;
/**
* Flag to indicate whether to ignore the collapsing icon on header.
* @defaultvalue CollapseAllVisibility.visible
*/
collapseAllVisibility?: CollapseAllVisibility;
/**
* Boolean indicating if empty groups are shown
* @defaultvalue false
*/
showEmptyGroups?: boolean;
/**
* Override which allows the caller to provide a custom aria role
*/
role?: string;
}
/**
* {@docCategory GroupedList}
*/
export interface IGroupDividerProps {
componentRef?: IRefObject<{}>;
/** Boolean value to indicate if the component should render in compact mode. Set to false by default */
compact?: boolean;
/** Callback to determine if a group has missing items and needs to load them from the server. */
isGroupLoading?: (group: IGroup) => boolean;
/** Text shown on group headers to indicate the group is being loaded. */
loadingText?: string;
/** The group to be rendered by the header. */
group?: IGroup;
/** The index of the group. */
groupIndex?: number;
/** The indent level of the group. */
groupLevel?: number;
/** Defines the number of columns a group header needs to span in the case of a grid or treegrid */
ariaColSpan?: number;
/** Defines an element's nesting depth in the current set of treeitems */
ariaLevel?: number;
/** Defines the number of items in the current set of treeitems */
ariaSetSize?: number;
/** Defines an element's number or position in the current set of treeitems */
ariaPosInSet?: number;
/** Defines the number of items in the current set of grid items */
ariaRowCount?: number;
/** Defines an element's number or position in the current set of grid items */
ariaRowIndex?: number;
/**
* Width corresponding to a single level.
* This is multiplied by the groupLevel to get the full spacer width for the group.
*/
indentWidth?: number;
/** If all items in the group are selected. */
selected?: boolean;
/**
* @deprecated Use `selected` instead. Deprecated at v.65.1.
*/
isSelected?: boolean;
/** A reference to the viewport in which the header is rendered. */
viewport?: IViewport;
/** The selection mode of the list the group lives within. */
selectionMode?: SelectionMode;
/** Text to display for the group footer. */
footerText?: string;
/** Text to display for the group "Show All" link. */
showAllLinkText?: string;
/** Callback for when the group "Show All" link is clicked */
onToggleSummarize?: (group: IGroup) => void;
/** Callback for when the group header is clicked. */
onGroupHeaderClick?: (group: IGroup) => void;
/** Callback for when the "keyup" event is fired on the group header. */
onGroupHeaderKeyUp?: (ev: React.KeyboardEvent<HTMLElement>, group?: IGroup) => void;
/** Callback for when the group is expanded or collapsed. */
onToggleCollapse?: (group: IGroup) => void;
/** Callback for when the group is selected. */
onToggleSelectGroup?: (group: IGroup) => void;
/** Determines if the group selection check box is shown for collapsed groups. */
isCollapsedGroupSelectVisible?: boolean;
/** Override which allows the caller to provider a custom renderer for the GroupHeader title. */
onRenderTitle?: IRenderFunction<IGroupHeaderProps>;
/** Override which allows the caller to provide a custom renderer for just the name. */
onRenderName?: IRenderFunction<IGroupHeaderProps>;
/** Props for expand/collapse button
* @deprecated Use {@link IGroupHeaderProps.expandButtonProps} instead.
*/
expandButtonProps?: React.HTMLAttributes<HTMLButtonElement>;
/** Stores parent group's children. */
groups?: IGroup[];
/** Custom className */
className?: string;
/** Theme provided by the Higher Order Component */
theme?: ITheme;
}
/**
* {@docCategory GroupedList}
*/
export type IGroupedListStyleProps = Required<Pick<IGroupedListProps, 'theme'>> & Pick<IGroupedListProps, 'className'> & {
/** whether or not the group is collapsed */
isCollapsed?: boolean;
/** Whether the group is in compact mode or not */
compact?: boolean;
};
/**
* {@docCategory GroupedList}
*/
export interface IGroupedListStyles {
root: IStyle;
group: IStyle;
groupIsDropping: IStyle;
}
@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CollapseAllVisibility = void 0;
/**
* {@docCategory GroupedList}
*/
var CollapseAllVisibility;
(function (CollapseAllVisibility) {
CollapseAllVisibility[CollapseAllVisibility["hidden"] = 0] = "hidden";
CollapseAllVisibility[CollapseAllVisibility["visible"] = 1] = "visible";
})(CollapseAllVisibility || (exports.CollapseAllVisibility = CollapseAllVisibility = {}));
//# sourceMappingURL=GroupedList.types.js.map
File diff suppressed because one or more lines are too long
@@ -0,0 +1,124 @@
import * as React from 'react';
import { SelectionMode } from '../../Selection';
import type { IGroup, IGroupRenderProps, IGroupedListStyles } from './GroupedList.types';
import type { IGroupHeaderProps } from './GroupHeader.types';
import type { IGroupFooterProps } from './GroupFooter.types';
import type { IGroupShowAllProps } from './GroupShowAll.types';
import type { IDragDropContext, IDragDropEvents, IDragDropHelper } from '../../DragDrop';
import type { IProcessedStyleSet } from '../../Styling';
import type { IRenderFunction } from '../../Utilities';
import type { ISelection } from '../../Selection';
import type { IListProps } from '../../List';
import type { IViewport } from '../../utilities/decorators/withViewport';
import type { JSXElement } from '@fluentui/utilities';
export interface IGroupedListSectionProps extends React.ClassAttributes<GroupedListSection> {
/** GroupedList resolved class names */
groupedListClassNames?: IProcessedStyleSet<IGroupedListStyles>;
/**
* Gets the component ref.
*/
componentRef?: () => void;
/** Whether to render in compact mode */
compact?: boolean;
/** Map of callback functions related to drag and drop functionality. */
dragDropEvents?: IDragDropEvents;
/** helper to manage drag/drop across item rows and groups */
dragDropHelper?: IDragDropHelper;
/** Event names and corresponding callbacks that will be registered to the group and the rendered elements */
eventsToRegister?: {
eventName: string;
callback: (context: IDragDropContext, event?: any) => void;
}[];
/** Information to pass in to the group footer. */
footerProps?: IGroupFooterProps;
/** Grouping item limit. */
getGroupItemLimit?: (group: IGroup) => number;
/** Optional grouping instructions. */
groupIndex?: number;
/** Optional group nesting level. */
groupNestingDepth?: number;
/** Optional grouping instructions. */
group?: IGroup;
/** Optional override properties to render groups. */
groupProps?: IGroupRenderProps;
/** Information to pass in to the group header. */
headerProps?: IGroupHeaderProps;
/** List of items to render. */
items: any[];
/** Optional list props to pass to list renderer. */
listProps?: IListProps;
/** Rendering callback to render the group items. */
onRenderCell: (nestingDepth?: number, item?: any, index?: number) => React.ReactNode;
/** Optional selection model to track selection state. */
selection?: ISelection;
/** Controls how/if the details list manages selection. */
selectionMode?: SelectionMode;
/** Information to pass in to the group Show All footer. */
showAllProps?: IGroupShowAllProps;
/** Optional Viewport, provided by the parent component. */
viewport?: IViewport;
/** Override for rendering the group header. */
onRenderGroupHeader?: IRenderFunction<IGroupHeaderProps>;
/** Override for rendering the group Show All link. */
onRenderGroupShowAll?: IRenderFunction<IGroupShowAllProps>;
/** Override for rendering the group footer. */
onRenderGroupFooter?: IRenderFunction<IGroupFooterProps>;
/**
* Optional callback to determine whether the list should be rendered in full, or virtualized.
* Virtualization will add and remove pages of items as the user scrolls them into the visible range.
* This benefits larger list scenarios by reducing the DOM on the screen, but can negatively affect performance for
* smaller lists.
* The default implementation will virtualize when this callback is not provided.
*/
onShouldVirtualize?: (props: IListProps) => boolean;
/** Stores parent group's children. */
groups?: IGroup[];
}
export interface IGroupedListSectionState {
isDropping?: boolean;
isSelected?: boolean;
}
export declare class GroupedListSection extends React.Component<IGroupedListSectionProps, IGroupedListSectionState> {
private _root;
private _list;
private _subGroupRefs;
private _id;
private _events;
private _dragDropSubscription?;
private _droppingClassName;
constructor(props: IGroupedListSectionProps);
componentDidMount(): void;
componentWillUnmount(): void;
componentDidUpdate(previousProps: IGroupedListSectionProps): void;
render(): JSXElement;
forceUpdate(): void;
forceListUpdate(): void;
private _onRenderGroupHeader;
private _onRenderGroupShowAll;
private _onRenderGroupFooter;
private _onSelectionChange;
private _onRenderGroupCell;
private _onRenderGroup;
private _renderSubGroup;
private _returnOne;
private _getGroupKey;
/**
* collect all the data we need to enable drag/drop for a group
*/
private _getGroupDragDropOptions;
/**
* update groupIsDropping state based on the input value, which is used to change style during drag and drop
*
* @param newValue - new isDropping state value
* @param event - the event trigger dropping state change which can be dragenter, dragleave etc
*/
private _updateDroppingState;
/**
* get the correct css class to reflect the dropping state for a given group
*
* If the group is the current drop target, return the default dropping class name
* Otherwise, return '';
*
*/
private _getDroppingClassName;
}
@@ -0,0 +1,228 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GroupedListSection = void 0;
var tslib_1 = require("tslib");
var React = require("react");
var Utilities_1 = require("../../Utilities");
var Selection_1 = require("../../Selection");
var GroupHeader_1 = require("./GroupHeader");
var GroupShowAll_1 = require("./GroupShowAll");
var GroupFooter_1 = require("./GroupFooter");
var List_1 = require("../../List");
var DEFAULT_DROPPING_CSS_CLASS = 'is-dropping';
var GroupedListSection = /** @class */ (function (_super) {
tslib_1.__extends(GroupedListSection, _super);
function GroupedListSection(props) {
var _this = _super.call(this, props) || this;
_this._root = React.createRef();
_this._list = React.createRef();
_this._subGroupRefs = {};
_this._droppingClassName = '';
_this._onRenderGroupHeader = function (props) {
return React.createElement(GroupHeader_1.GroupHeader, tslib_1.__assign({}, props));
};
_this._onRenderGroupShowAll = function (props) {
return React.createElement(GroupShowAll_1.GroupShowAll, tslib_1.__assign({}, props));
};
_this._onRenderGroupFooter = function (props) {
return React.createElement(GroupFooter_1.GroupFooter, tslib_1.__assign({}, props));
};
_this._renderSubGroup = function (subGroup, subGroupIndex) {
var _a = _this.props, dragDropEvents = _a.dragDropEvents, dragDropHelper = _a.dragDropHelper, eventsToRegister = _a.eventsToRegister, getGroupItemLimit = _a.getGroupItemLimit, groupNestingDepth = _a.groupNestingDepth, groupProps = _a.groupProps, items = _a.items, headerProps = _a.headerProps, showAllProps = _a.showAllProps, footerProps = _a.footerProps, listProps = _a.listProps, onRenderCell = _a.onRenderCell, selection = _a.selection, selectionMode = _a.selectionMode, viewport = _a.viewport, onRenderGroupHeader = _a.onRenderGroupHeader, onRenderGroupShowAll = _a.onRenderGroupShowAll, onRenderGroupFooter = _a.onRenderGroupFooter, onShouldVirtualize = _a.onShouldVirtualize, group = _a.group, compact = _a.compact;
var nestingDepth = subGroup.level ? subGroup.level + 1 : groupNestingDepth;
return !subGroup || subGroup.count > 0 || (groupProps && groupProps.showEmptyGroups) ? (React.createElement(GroupedListSection, { ref: function (ref) {
_this._subGroupRefs['subGroup_' + subGroupIndex] = ref;
}, key: _this._getGroupKey(subGroup, subGroupIndex), dragDropEvents: dragDropEvents, dragDropHelper: dragDropHelper, eventsToRegister: eventsToRegister, footerProps: footerProps, getGroupItemLimit: getGroupItemLimit, group: subGroup, groupIndex: subGroupIndex, groupNestingDepth: nestingDepth, groupProps: groupProps, headerProps: headerProps, items: items, listProps: listProps, onRenderCell: onRenderCell, selection: selection, selectionMode: selectionMode, showAllProps: showAllProps, viewport: viewport, onRenderGroupHeader: onRenderGroupHeader, onRenderGroupShowAll: onRenderGroupShowAll, onRenderGroupFooter: onRenderGroupFooter, onShouldVirtualize: onShouldVirtualize, groups: group ? group.children : [], compact: compact })) : null;
};
/**
* collect all the data we need to enable drag/drop for a group
*/
_this._getGroupDragDropOptions = function () {
var _a = _this.props, group = _a.group, groupIndex = _a.groupIndex, dragDropEvents = _a.dragDropEvents, eventsToRegister = _a.eventsToRegister;
var options = {
eventMap: eventsToRegister,
selectionIndex: -1,
context: { data: group, index: groupIndex, isGroup: true },
updateDropState: _this._updateDroppingState,
canDrag: dragDropEvents.canDrag,
canDrop: dragDropEvents.canDrop,
onDrop: dragDropEvents.onDrop,
onDragStart: dragDropEvents.onDragStart,
onDragEnter: dragDropEvents.onDragEnter,
onDragLeave: dragDropEvents.onDragLeave,
onDragEnd: dragDropEvents.onDragEnd,
onDragOver: dragDropEvents.onDragOver,
};
return options;
};
/**
* update groupIsDropping state based on the input value, which is used to change style during drag and drop
*
* @param newValue - new isDropping state value
* @param event - the event trigger dropping state change which can be dragenter, dragleave etc
*/
_this._updateDroppingState = function (newIsDropping, event) {
var isDropping = _this.state.isDropping;
var _a = _this.props, dragDropEvents = _a.dragDropEvents, group = _a.group;
if (isDropping !== newIsDropping) {
if (isDropping) {
if (dragDropEvents && dragDropEvents.onDragLeave) {
dragDropEvents.onDragLeave(group, event);
}
}
else {
if (dragDropEvents && dragDropEvents.onDragEnter) {
_this._droppingClassName = dragDropEvents.onDragEnter(group, event);
}
}
_this.setState({ isDropping: newIsDropping });
}
};
var selection = props.selection, group = props.group;
(0, Utilities_1.initializeComponentRef)(_this);
_this._id = (0, Utilities_1.getId)('GroupedListSection');
_this.state = {
isDropping: false,
isSelected: selection && group ? selection.isRangeSelected(group.startIndex, group.count) : false,
};
_this._events = new Utilities_1.EventGroup(_this);
return _this;
}
GroupedListSection.prototype.componentDidMount = function () {
var _a = this.props, dragDropHelper = _a.dragDropHelper, selection = _a.selection;
if (dragDropHelper && this._root.current) {
this._dragDropSubscription = dragDropHelper.subscribe(this._root.current, this._events, this._getGroupDragDropOptions());
}
if (selection) {
this._events.on(selection, Selection_1.SELECTION_CHANGE, this._onSelectionChange);
}
};
GroupedListSection.prototype.componentWillUnmount = function () {
this._events.dispose();
if (this._dragDropSubscription) {
this._dragDropSubscription.dispose();
}
};
GroupedListSection.prototype.componentDidUpdate = function (previousProps) {
if (this.props.group !== previousProps.group ||
this.props.groupIndex !== previousProps.groupIndex ||
this.props.dragDropHelper !== previousProps.dragDropHelper) {
if (this._dragDropSubscription) {
this._dragDropSubscription.dispose();
delete this._dragDropSubscription;
}
if (this.props.dragDropHelper && this._root.current) {
this._dragDropSubscription = this.props.dragDropHelper.subscribe(this._root.current, this._events, this._getGroupDragDropOptions());
}
}
};
GroupedListSection.prototype.render = function () {
var _a = this.props, getGroupItemLimit = _a.getGroupItemLimit, group = _a.group, groupIndex = _a.groupIndex, headerProps = _a.headerProps, showAllProps = _a.showAllProps, footerProps = _a.footerProps, viewport = _a.viewport, selectionMode = _a.selectionMode, _b = _a.onRenderGroupHeader, onRenderGroupHeader = _b === void 0 ? this._onRenderGroupHeader : _b, _c = _a.onRenderGroupShowAll, onRenderGroupShowAll = _c === void 0 ? this._onRenderGroupShowAll : _c, _d = _a.onRenderGroupFooter, onRenderGroupFooter = _d === void 0 ? this._onRenderGroupFooter : _d, onShouldVirtualize = _a.onShouldVirtualize, groupedListClassNames = _a.groupedListClassNames, groups = _a.groups, compact = _a.compact, _e = _a.listProps, listProps = _e === void 0 ? {} : _e;
var isSelected = this.state.isSelected;
var renderCount = group && getGroupItemLimit ? getGroupItemLimit(group) : Infinity;
var isShowAllVisible = group &&
!group.children &&
!group.isCollapsed &&
!group.isShowingAll &&
(group.count > renderCount || group.hasMoreData);
var hasNestedGroups = group && group.children && group.children.length > 0;
var version = listProps.version;
var dividerProps = {
group: group,
groupIndex: groupIndex,
groupLevel: group ? group.level : 0,
isSelected: isSelected,
selected: isSelected,
viewport: viewport,
selectionMode: selectionMode,
groups: groups,
compact: compact,
};
var ariaControlsProps = {
groupedListId: this._id,
ariaLevel: (group === null || group === void 0 ? void 0 : group.level) ? group.level + 1 : 1,
ariaSetSize: groups ? groups.length : undefined,
ariaPosInSet: groupIndex !== undefined ? groupIndex + 1 : undefined,
};
var groupHeaderProps = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, headerProps), dividerProps), ariaControlsProps);
var groupShowAllProps = tslib_1.__assign(tslib_1.__assign({}, showAllProps), dividerProps);
var groupFooterProps = tslib_1.__assign(tslib_1.__assign({}, footerProps), dividerProps);
var isDraggable = !!this.props.dragDropHelper &&
this._getGroupDragDropOptions().canDrag(group) &&
!!this.props.dragDropEvents.canDragGroups;
return (React.createElement("div", tslib_1.__assign({ ref: this._root }, (isDraggable && { draggable: true }), { className: (0, Utilities_1.css)(groupedListClassNames && groupedListClassNames.group, this._getDroppingClassName()), role: "presentation" }),
onRenderGroupHeader(groupHeaderProps, this._onRenderGroupHeader),
group && group.isCollapsed ? null : hasNestedGroups ? (React.createElement(List_1.List, { role: "presentation", ref: this._list, items: group ? group.children : [], onRenderCell: this._renderSubGroup, getItemCountForPage: this._returnOne, onShouldVirtualize: onShouldVirtualize, version: version, id: this._id })) : (this._onRenderGroup(renderCount)),
group && group.isCollapsed
? null
: isShowAllVisible && onRenderGroupShowAll(groupShowAllProps, this._onRenderGroupShowAll),
onRenderGroupFooter(groupFooterProps, this._onRenderGroupFooter)));
};
GroupedListSection.prototype.forceUpdate = function () {
_super.prototype.forceUpdate.call(this);
this.forceListUpdate();
};
GroupedListSection.prototype.forceListUpdate = function () {
var group = this.props.group;
if (this._list.current) {
this._list.current.forceUpdate();
if (group && group.children && group.children.length > 0) {
var subGroupCount = group.children.length;
for (var i = 0; i < subGroupCount; i++) {
var subGroup = this._list.current.pageRefs['subGroup_' + String(i)];
if (subGroup) {
subGroup.forceListUpdate();
}
}
}
}
else {
var subGroup = this._subGroupRefs['subGroup_' + String(0)];
if (subGroup) {
subGroup.forceListUpdate();
}
}
};
GroupedListSection.prototype._onSelectionChange = function () {
var _a = this.props, group = _a.group, selection = _a.selection;
if (selection && group) {
var isSelected = selection.isRangeSelected(group.startIndex, group.count);
if (isSelected !== this.state.isSelected) {
this.setState({ isSelected: isSelected });
}
}
};
GroupedListSection.prototype._onRenderGroupCell = function (onRenderCell, groupNestingDepth, group) {
return function (item, itemIndex) {
return onRenderCell(groupNestingDepth, item, itemIndex, group);
};
};
GroupedListSection.prototype._onRenderGroup = function (renderCount) {
var _a = this.props, group = _a.group, items = _a.items, onRenderCell = _a.onRenderCell, listProps = _a.listProps, groupNestingDepth = _a.groupNestingDepth, onShouldVirtualize = _a.onShouldVirtualize, groupProps = _a.groupProps;
var count = group && !group.isShowingAll ? group.count : items.length;
var startIndex = group ? group.startIndex : 0;
return (React.createElement(List_1.List, tslib_1.__assign({ role: groupProps && groupProps.role ? groupProps.role : 'rowgroup', "aria-label": group === null || group === void 0 ? void 0 : group.name, items: items, onRenderCell: this._onRenderGroupCell(onRenderCell, groupNestingDepth, group), ref: this._list, renderCount: Math.min(count, renderCount), startIndex: startIndex, onShouldVirtualize: onShouldVirtualize, id: this._id }, listProps)));
};
GroupedListSection.prototype._returnOne = function () {
return 1;
};
GroupedListSection.prototype._getGroupKey = function (group, index) {
return 'group-' + (group && group.key ? group.key : String(group.level) + String(index));
};
/**
* get the correct css class to reflect the dropping state for a given group
*
* If the group is the current drop target, return the default dropping class name
* Otherwise, return '';
*
*/
GroupedListSection.prototype._getDroppingClassName = function () {
var isDropping = this.state.isDropping;
var _a = this.props, group = _a.group, groupedListClassNames = _a.groupedListClassNames;
isDropping = !!(group && isDropping);
return (0, Utilities_1.css)(isDropping && this._droppingClassName, isDropping && DEFAULT_DROPPING_CSS_CLASS, isDropping && groupedListClassNames && groupedListClassNames.groupIsDropping);
};
return GroupedListSection;
}(React.Component));
exports.GroupedListSection = GroupedListSection;
//# sourceMappingURL=GroupedListSection.js.map
File diff suppressed because one or more lines are too long
@@ -0,0 +1,27 @@
import * as React from 'react';
import { ScrollToMode } from '../../List';
import type { IGroupedList, IGroup } from './GroupedList.types';
import type { IGroupedListV2Props } from './GroupedListV2.types';
import type { JSXElement } from '@fluentui/utilities';
export interface IGroupedListV2State {
selectionMode?: IGroupedListV2Props['selectionMode'];
compact?: IGroupedListV2Props['compact'];
groups?: IGroup[];
items?: IGroupedListV2Props['items'];
listProps?: IGroupedListV2Props['listProps'];
version: {};
groupExpandedVersion: {};
}
export declare const GroupedListV2FC: React.FC<IGroupedListV2Props>;
export declare class GroupedListV2Wrapper extends React.Component<IGroupedListV2Props, IGroupedListV2State> implements IGroupedList {
static displayName: string;
private _groupedList;
static getDerivedStateFromProps(nextProps: IGroupedListV2Props, previousState: IGroupedListV2State): IGroupedListV2State;
constructor(props: IGroupedListV2Props);
scrollToIndex(index: number, measureItem?: (itemIndex: number) => number, scrollToMode?: ScrollToMode): void;
getStartItemIndexInView(): number;
render(): JSXElement;
forceUpdate(): void;
toggleCollapseAll(allCollapsed: boolean): void;
private _forceListUpdate;
}
@@ -0,0 +1,400 @@
"use strict";
var _this = this;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GroupedListV2Wrapper = exports.GroupedListV2FC = void 0;
var tslib_1 = require("tslib");
var React = require("react");
var Utilities_1 = require("../../Utilities");
var List_1 = require("../../List");
var Selection_1 = require("../../Selection");
var FocusZone_1 = require("../../FocusZone");
var GroupHeader_1 = require("./GroupHeader");
var GroupShowAll_1 = require("./GroupShowAll");
var GroupFooter_1 = require("./GroupFooter");
var flattenItems = function (groups, items, memoItems, getGroupItemLimit) {
if (!groups) {
return items;
}
if (memoItems.length < 1) {
// Not the exact final size but gets us in the ballpark.
// This helps avoid trashing memory when building
// the flattened list.
memoItems = new Array(items.length);
}
var index = 0;
var stack = [];
var j = groups.length - 1;
while (j >= 0) {
stack.push({ group: groups[j], groupIndex: j + 1 });
j--;
}
while (stack.length > 0) {
// eslint-disable-next-line prefer-const
var _a = stack.pop(), group = _a.group, groupIndex = _a.groupIndex;
memoItems[index] = {
group: group,
groupId: (0, Utilities_1.getId)('GroupedListSection'),
type: 'header',
groupIndex: groupIndex,
};
index++;
while (group.isCollapsed !== true && (group === null || group === void 0 ? void 0 : group.children) && group.children.length > 0) {
j = group.children.length - 1;
while (j > 0) {
stack.push({ group: group.children[j], groupIndex: j + 1 });
j--;
}
group = group.children[0];
memoItems[index] = {
group: group,
groupId: (0, Utilities_1.getId)('GroupedListSection'),
type: 'header',
groupIndex: 1,
};
index++;
}
if (group.isCollapsed !== true) {
var itemIndex = group.startIndex;
var renderCount = getGroupItemLimit ? getGroupItemLimit(group) : Infinity;
var count = !group.isShowingAll ? group.count : items.length;
var itemEnd = itemIndex + Math.min(count, renderCount);
while (itemIndex < itemEnd) {
memoItems[index] = {
group: group,
item: items[itemIndex],
itemIndex: itemIndex, // track the index in `item` for later rendering/selection
type: 'item',
};
itemIndex++;
index++;
}
var isShowAllVisible = !group.children &&
!group.isCollapsed &&
!group.isShowingAll &&
(group.count > renderCount || group.hasMoreData);
if (isShowAllVisible) {
memoItems[index] = {
group: group,
type: 'showAll',
};
index++;
}
}
// Placeholder for a potential footer.
// Whether or not a footer is displayed is resolved
// by the footer render function so this is just a marker
// for where a footer may go.
memoItems[index] = {
group: group,
type: 'footer',
};
index++;
}
memoItems.length = index;
// console.log('MEMO ITEMS', memoItems);
return memoItems;
};
var useIsGroupSelected = function (startIndex, count, selection, eventGroup) {
var _a = React.useState(function () { var _a; return (_a = selection === null || selection === void 0 ? void 0 : selection.isRangeSelected(startIndex, count)) !== null && _a !== void 0 ? _a : false; }), isSelected = _a[0], setIsSelected = _a[1];
React.useEffect(function () {
if (selection && eventGroup) {
var changeHandler_1 = function () {
var _a;
setIsSelected((_a = selection === null || selection === void 0 ? void 0 : selection.isRangeSelected(startIndex, count)) !== null && _a !== void 0 ? _a : false);
};
eventGroup.on(selection, Selection_1.SELECTION_CHANGE, changeHandler_1);
return function () {
eventGroup === null || eventGroup === void 0 ? void 0 : eventGroup.off(selection, Selection_1.SELECTION_CHANGE, changeHandler_1);
};
}
}, [startIndex, count, selection, eventGroup]);
return isSelected;
};
var computeIsSomeGroupExpanded = function (groups) {
return !!(groups && groups.some(function (group) { return (group.children ? computeIsSomeGroupExpanded(group.children) : !group.isCollapsed); }));
};
var setGroupsCollapsedState = function (groups, isCollapsed) {
if (groups === undefined) {
return;
}
for (var groupIndex = 0; groupIndex < groups.length; groupIndex++) {
groups[groupIndex].isCollapsed = isCollapsed;
}
};
var isInnerZoneKeystroke = function (ev) {
// eslint-disable-next-line @typescript-eslint/no-deprecated
return ev.which === (0, Utilities_1.getRTLSafeKeyCode)(Utilities_1.KeyCodes.right);
};
var getClassNames = (0, Utilities_1.classNamesFunction)();
var getKey = function (item, _index) {
var _a, _b;
switch (item.type) {
case 'item':
return (_b = (_a = item.item) === null || _a === void 0 ? void 0 : _a.key) !== null && _b !== void 0 ? _b : null;
case 'header':
return item.group.key;
case 'footer':
return "".concat(item.group.key, "-footer");
case 'showAll':
return "".concat(item.group.key, "-showAll");
}
return null;
};
var renderGroupHeader = function (props) {
return React.createElement(GroupHeader_1.GroupHeader, tslib_1.__assign({}, props));
};
var renderGroupShowAll = function (props) {
return React.createElement(GroupShowAll_1.GroupShowAll, tslib_1.__assign({}, props));
};
var renderGroupFooter = function (props) {
if (props.group && props.footerText) {
return React.createElement(GroupFooter_1.GroupFooter, tslib_1.__assign({}, props));
}
return null;
};
var GroupedListV2FC = function (props) {
var selection = props.selection, _a = props.selectionMode, selectionMode = _a === void 0 ? Selection_1.SelectionMode.multiple : _a, _b = props.groupProps, groupProps = _b === void 0 ? {} : _b, _c = props.compact, compact = _c === void 0 ? false : _c, _d = props.items, items = _d === void 0 ? [] : _d, groups = props.groups, onGroupExpandStateChanged = props.onGroupExpandStateChanged, listProps = props.listProps, className = props.className, usePageCache = props.usePageCache, onShouldVirtualize = props.onShouldVirtualize, theme = props.theme, _e = props.role, role = _e === void 0 ? 'treegrid' : _e, styles = props.styles, _f = props.focusZoneProps, focusZoneProps = _f === void 0 ? {} : _f, _g = props.rootListProps, rootListProps = _g === void 0 ? {} : _g, onRenderCell = props.onRenderCell, viewport = props.viewport, groupedListRef = props.groupedListRef, groupExpandedVersion = props.groupExpandedVersion, versionFromProps = props.version;
var _h = groupProps.onRenderHeader, onRenderHeader = _h === void 0 ? renderGroupHeader : _h, _j = groupProps.onRenderFooter, onRenderFooter = _j === void 0 ? renderGroupFooter : _j, _k = groupProps.onRenderShowAll, onRenderShowAll = _k === void 0 ? renderGroupShowAll : _k;
var classNames = getClassNames(styles, {
theme: theme,
className: className,
compact: compact,
});
var events = React.useRef(undefined);
var flatList = React.useRef([]);
var isSomeGroupExpanded = React.useRef(computeIsSomeGroupExpanded(groups));
var listRef = React.useRef(null);
var _l = React.useState({}), version = _l[0], setVersion = _l[1];
var _m = React.useState({}), toggleVersion = _m[0], setToggleVersion = _m[1];
var _o = focusZoneProps.shouldEnterInnerZone, shouldEnterInnerZone = _o === void 0 ? isInnerZoneKeystroke : _o;
var listView = React.useMemo(function () {
return flattenItems(groups, items, flatList.current, groupProps === null || groupProps === void 0 ? void 0 : groupProps.getGroupItemLimit);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [groups, groupProps === null || groupProps === void 0 ? void 0 : groupProps.getGroupItemLimit, items, toggleVersion, flatList, groupExpandedVersion]);
var getPageSpecification = React.useCallback(function (flattenedIndex) {
var pageGroup = listView[flattenedIndex];
return {
key: pageGroup.type === 'header' ? pageGroup.group.key : undefined,
};
}, [listView]);
React.useImperativeHandle(groupedListRef, function () {
var indexMap;
return {
scrollToIndex: function (index, measureItem, scrollToMode) {
var _a;
indexMap =
indexMap !== null && indexMap !== void 0 ? indexMap : listView.reduce(function (map, item, listIndex) {
if (item.type === 'item') {
map[item.itemIndex] = listIndex;
}
return map;
}, []);
var scrollIndex = indexMap[index];
var measure = typeof measureItem === 'function'
? function (itemIndex) {
var _a;
if (((_a = listView[itemIndex]) === null || _a === void 0 ? void 0 : _a.type) === 'item') {
return measureItem(listView[itemIndex].itemIndex);
}
return 0;
}
: undefined;
(_a = listRef.current) === null || _a === void 0 ? void 0 : _a.scrollToIndex(scrollIndex, measure, scrollToMode);
},
getStartItemIndexInView: function () {
var _a;
return ((_a = listRef.current) === null || _a === void 0 ? void 0 : _a.getStartItemIndexInView()) || 0;
},
};
}, [listView, listRef]);
React.useEffect(function () {
if (groupProps === null || groupProps === void 0 ? void 0 : groupProps.isAllGroupsCollapsed) {
setGroupsCollapsedState(groups, groupProps.isAllGroupsCollapsed);
}
events.current = new Utilities_1.EventGroup(_this);
return function () {
var _a;
(_a = events.current) === null || _a === void 0 ? void 0 : _a.dispose();
events.current = undefined;
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
React.useEffect(function () {
setVersion({});
}, [versionFromProps]);
React.useEffect(function () {
var newIsSomeGroupExpanded = computeIsSomeGroupExpanded(groups);
if (newIsSomeGroupExpanded !== isSomeGroupExpanded.current) {
isSomeGroupExpanded.current = newIsSomeGroupExpanded;
onGroupExpandStateChanged === null || onGroupExpandStateChanged === void 0 ? void 0 : onGroupExpandStateChanged(newIsSomeGroupExpanded);
}
}, [groups, toggleVersion, onGroupExpandStateChanged, groupExpandedVersion]);
var onToggleCollapse = React.useCallback(function (group) {
var _a;
var onToggleCollapseFn = (_a = groupProps === null || groupProps === void 0 ? void 0 : groupProps.headerProps) === null || _a === void 0 ? void 0 : _a.onToggleCollapse;
if (group) {
onToggleCollapseFn === null || onToggleCollapseFn === void 0 ? void 0 : onToggleCollapseFn(group);
group.isCollapsed = !group.isCollapsed;
setToggleVersion({});
setVersion({});
}
}, [setToggleVersion, groupProps]);
var onToggleSelectGroup = function (group) {
if (group && selection && selectionMode === Selection_1.SelectionMode.multiple) {
selection.toggleRangeSelected(group.startIndex, group.count);
}
};
var onToggleSummarize = function (group) {
var _a;
var onToggleSummarizeFn = (_a = groupProps === null || groupProps === void 0 ? void 0 : groupProps.showAllProps) === null || _a === void 0 ? void 0 : _a.onToggleSummarize;
if (onToggleSummarizeFn) {
onToggleSummarizeFn(group);
}
else {
if (group) {
group.isShowingAll = !group.isShowingAll;
}
setVersion({});
setToggleVersion({});
}
};
var getDividerProps = function (group, flattenedIndex) {
var _a;
var dividerProps = {
group: group,
groupIndex: flattenedIndex,
groupLevel: (_a = group.level) !== null && _a !== void 0 ? _a : 0,
viewport: viewport,
selectionMode: selectionMode,
groups: groups,
compact: compact,
onToggleSelectGroup: onToggleSelectGroup,
onToggleCollapse: onToggleCollapse,
onToggleSummarize: onToggleSummarize,
};
return dividerProps;
};
var renderHeader = function (item, flattenedIndex) {
var group = item.group;
var ariaProps;
if (role === 'treegrid') {
// GroupedList default role
ariaProps = {
ariaLevel: group.level ? group.level + 1 : 1,
ariaSetSize: groups ? groups.length : undefined,
ariaPosInSet: item.groupIndex,
};
}
else {
// Grouped DetailsList
ariaProps = {
ariaRowIndex: flattenedIndex,
};
}
var headerProps = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, groupProps.headerProps), getDividerProps(item.group, flattenedIndex)), { key: group.key, groupedListId: item.groupId }), ariaProps);
return (React.createElement(GroupItem, { render: onRenderHeader, defaultRender: renderGroupHeader, item: item, selection: selection, eventGroup: events.current, props: headerProps }));
};
var renderShowAll = function (item, flattenedIndex) {
var group = item.group;
var groupShowAllProps = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, groupProps.showAllProps), getDividerProps(group, flattenedIndex)), { key: group.key ? "".concat(group.key, "-show-all") : undefined });
return onRenderShowAll(groupShowAllProps, renderGroupShowAll);
};
var renderFooter = function (item, flattenedIndex) {
var group = item.group;
var groupFooterProps = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, groupProps.footerProps), getDividerProps(group, flattenedIndex)), { key: group.key ? "".concat(group.key, "-footer") : undefined });
return onRenderFooter(groupFooterProps, renderGroupFooter);
};
var renderItem = function (item, flattenedIndex) {
var _a;
if (item.type === 'header') {
return renderHeader(item, flattenedIndex);
}
else if (item.type === 'showAll') {
return renderShowAll(item, flattenedIndex);
}
else if (item.type === 'footer') {
return renderFooter(item, flattenedIndex);
}
else {
var level = item.group.level ? item.group.level + 1 : 1;
return onRenderCell(level, item.item, (_a = item.itemIndex) !== null && _a !== void 0 ? _a : flattenedIndex, item.group);
}
};
return (React.createElement(FocusZone_1.FocusZone, tslib_1.__assign({ direction: FocusZone_1.FocusZoneDirection.vertical, "data-automationid": "GroupedList", "data-is-scrollable": "false", role: "presentation" }, focusZoneProps, { shouldEnterInnerZone: shouldEnterInnerZone, className: (0, Utilities_1.css)(classNames.root, focusZoneProps.className) }),
React.createElement(List_1.List, tslib_1.__assign({ ref: listRef, role: role, items: listView,
// eslint-disable-next-line
onRenderCellConditional: renderItem, usePageCache: usePageCache, onShouldVirtualize: onShouldVirtualize, getPageSpecification: getPageSpecification, version: version, getKey: getKey }, listProps, rootListProps))));
};
exports.GroupedListV2FC = GroupedListV2FC;
var GroupItem = function (_a) {
var render = _a.render, defaultRender = _a.defaultRender, item = _a.item, selection = _a.selection, eventGroup = _a.eventGroup, props = _a.props;
var group = item.group;
var isSelected = useIsGroupSelected(group.startIndex, group.count, selection, eventGroup);
var mergedProps = tslib_1.__assign(tslib_1.__assign({}, props), { isSelected: isSelected, selected: isSelected });
return render(mergedProps, defaultRender);
};
var GroupedListV2Wrapper = /** @class */ (function (_super) {
tslib_1.__extends(GroupedListV2Wrapper, _super);
function GroupedListV2Wrapper(props) {
var _this = _super.call(this, props) || this;
_this._groupedList = React.createRef();
(0, Utilities_1.initializeComponentRef)(_this);
var _a = props.listProps, _b = _a === void 0 ? {} : _a, _c = _b.version, version = _c === void 0 ? {} : _c, groups = props.groups;
_this.state = {
version: version,
groupExpandedVersion: {},
groups: groups,
};
return _this;
}
GroupedListV2Wrapper.getDerivedStateFromProps = function (nextProps, previousState) {
var groups = nextProps.groups, selectionMode = nextProps.selectionMode, compact = nextProps.compact, items = nextProps.items, listProps = nextProps.listProps;
var nextListVersion = listProps && listProps.version;
var nextState = tslib_1.__assign(tslib_1.__assign({}, previousState), { groups: groups });
if (nextListVersion !== previousState.version ||
items !== previousState.items ||
groups !== previousState.groups ||
selectionMode !== previousState.selectionMode ||
compact !== previousState.compact) {
nextState.version = {};
}
return nextState;
};
GroupedListV2Wrapper.prototype.scrollToIndex = function (index, measureItem, scrollToMode) {
var _a;
(_a = this._groupedList.current) === null || _a === void 0 ? void 0 : _a.scrollToIndex(index, measureItem, scrollToMode);
};
GroupedListV2Wrapper.prototype.getStartItemIndexInView = function () {
var _a;
return ((_a = this._groupedList.current) === null || _a === void 0 ? void 0 : _a.getStartItemIndexInView()) || 0;
};
GroupedListV2Wrapper.prototype.render = function () {
return React.createElement(exports.GroupedListV2FC, tslib_1.__assign({}, this.props, this.state, { groupedListRef: this._groupedList }));
};
GroupedListV2Wrapper.prototype.forceUpdate = function () {
_super.prototype.forceUpdate.call(this);
this._forceListUpdate();
};
GroupedListV2Wrapper.prototype.toggleCollapseAll = function (allCollapsed) {
var _a;
var groups = this.state.groups;
var groupProps = this.props.groupProps;
if (groups && groups.length > 0) {
(_a = groupProps === null || groupProps === void 0 ? void 0 : groupProps.onToggleCollapseAll) === null || _a === void 0 ? void 0 : _a.call(groupProps, allCollapsed);
setGroupsCollapsedState(groups, allCollapsed);
this.setState({
groupExpandedVersion: {},
});
this.forceUpdate();
}
};
GroupedListV2Wrapper.prototype._forceListUpdate = function () {
this.setState({
version: {},
});
};
GroupedListV2Wrapper.displayName = 'GroupedListV2';
return GroupedListV2Wrapper;
}(React.Component));
exports.GroupedListV2Wrapper = GroupedListV2Wrapper;
//# sourceMappingURL=GroupedListV2.base.js.map
File diff suppressed because one or more lines are too long
@@ -0,0 +1,14 @@
import * as React from 'react';
import type { IGroupedListV2Props } from './GroupedListV2.types';
/**
* NOTE: GroupedListV2 is "unstable" and meant for preview use. It passes
* the same test suite as GroupedList but it is an entirely new implementation
* so it may have bugs and implementation details may change without notice.
*
* GroupedListV2 is an API-compatible replacement for GroupedList with a new implementation
* that addresses issues GroupedList has with virtualizing nested lists under certain
* conditions.
*/
declare const GroupedListV2: React.FunctionComponent<IGroupedListV2Props>;
export { GroupedListV2 as GroupedListV2_unstable };
export type { IGroupedListV2Props } from './GroupedListV2.types';
@@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GroupedListV2_unstable = void 0;
var Utilities_1 = require("../../Utilities");
var GroupedList_styles_1 = require("./GroupedList.styles");
var GroupedListV2_base_1 = require("./GroupedListV2.base");
/**
* NOTE: GroupedListV2 is "unstable" and meant for preview use. It passes
* the same test suite as GroupedList but it is an entirely new implementation
* so it may have bugs and implementation details may change without notice.
*
* GroupedListV2 is an API-compatible replacement for GroupedList with a new implementation
* that addresses issues GroupedList has with virtualizing nested lists under certain
* conditions.
*/
var GroupedListV2 = (0, Utilities_1.styled)(GroupedListV2_base_1.GroupedListV2Wrapper, GroupedList_styles_1.getStyles, undefined, {
scope: 'GroupedListV2',
});
exports.GroupedListV2_unstable = GroupedListV2;
GroupedListV2.displayName = 'GroupedListV2_unstable';
//# sourceMappingURL=GroupedListV2.js.map
@@ -0,0 +1 @@
{"version":3,"file":"GroupedListV2.js","sourceRoot":"../src/","sources":["components/GroupedList/GroupedListV2.tsx"],"names":[],"mappings":";;;AACA,6CAAyC;AACzC,2DAAiD;AACjD,2DAA4D;AAI5D;;;;;;;;GAQG;AACH,IAAM,aAAa,GAAiD,IAAA,kBAAM,EAIxE,yCAAoB,EAAE,8BAAS,EAAE,SAAS,EAAE;IAC5C,KAAK,EAAE,eAAe;CACvB,CAAC,CAAC;AAIuB,+CAAsB;AAFhD,aAAa,CAAC,WAAW,GAAG,wBAAwB,CAAC","sourcesContent":["import * as React from 'react';\nimport { styled } from '../../Utilities';\nimport { getStyles } from './GroupedList.styles';\nimport { GroupedListV2Wrapper } from './GroupedListV2.base';\nimport type { IGroupedListStyles, IGroupedListStyleProps } from './GroupedList.types';\nimport type { IGroupedListV2Props } from './GroupedListV2.types';\n\n/**\n * NOTE: GroupedListV2 is \"unstable\" and meant for preview use. It passes\n * the same test suite as GroupedList but it is an entirely new implementation\n * so it may have bugs and implementation details may change without notice.\n *\n * GroupedListV2 is an API-compatible replacement for GroupedList with a new implementation\n * that addresses issues GroupedList has with virtualizing nested lists under certain\n * conditions.\n */\nconst GroupedListV2: React.FunctionComponent<IGroupedListV2Props> = styled<\n IGroupedListV2Props,\n IGroupedListStyleProps,\n IGroupedListStyles\n>(GroupedListV2Wrapper, getStyles, undefined, {\n scope: 'GroupedListV2',\n});\n\nGroupedListV2.displayName = 'GroupedListV2_unstable';\n\nexport { GroupedListV2 as GroupedListV2_unstable };\nexport type { IGroupedListV2Props } from './GroupedListV2.types';\n"]}
@@ -0,0 +1,65 @@
import * as React from 'react';
import type { IGroupedListProps } from './GroupedList.types';
import type { List, ScrollToMode } from '../../List';
import type { IGroup } from './GroupedList.types';
export interface IGroupedListV2Props extends IGroupedListProps {
/** Ref to the underlying List control */
listRef?: React.Ref<List>;
/** Ref to the underlying List control */
groupedListRef?: React.Ref<IGroupedListV2>;
/**
* For perf reasons, GroupedList avoids re-rendering unless certain props have changed.
* Use this prop if you need to force it to re-render in other cases. You can pass any type of
* value as long as it only changes (`===` comparison) when a re-render should happen.
*/
version?: {};
/**
* For perf reasons, GroupedList avoids re-rendering unless certain props have changed.
* Use this prop if you need to force it to re-render when a group has expanded or collapsed.
* You can pass any type of value as long as it only changes (`===` comparison)
* when a re-render should happen.
*/
groupExpandedVersion?: {};
/** Rendering callback to render the group items. */
onRenderCell: (nestingDepth?: number, item?: any, index?: number, group?: IGroup) => React.ReactNode;
}
export interface IGroupedListV2 {
scrollToIndex(index: number, measureItem?: (itemIndex: number) => number, scrollToMode?: ScrollToMode): void;
getStartItemIndexInView(): number;
}
/**
* An item rendered in a GroupedList.
*/
export type IItemGroupedItem = {
type: 'item';
group: IGroup;
item: any;
itemIndex: number;
};
/**
* Item used for "show all" in a GroupedList.
*/
export type IShowAllGroupedItem = {
type: 'showAll';
group: IGroup;
};
/**
* A footer in a GroupedList.
*/
export type IFooterGroupedItem = {
type: 'footer';
group: IGroup;
};
/**
* A header in a GroupedList.
*/
export type IHeaderGroupedItem = {
type: 'header';
group: IGroup;
groupId: string;
groupIndex: number;
};
/**
* Union of GroupedList item types.
*/
export type IGroupedItem = IItemGroupedItem | IShowAllGroupedItem | IFooterGroupedItem | IHeaderGroupedItem;
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=GroupedListV2.types.js.map
@@ -0,0 +1 @@
{"version":3,"file":"GroupedListV2.types.js","sourceRoot":"../src/","sources":["components/GroupedList/GroupedListV2.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { IGroupedListProps } from './GroupedList.types';\nimport type { List, ScrollToMode } from '../../List';\nimport type { IGroup } from './GroupedList.types';\n\nexport interface IGroupedListV2Props extends IGroupedListProps {\n /** Ref to the underlying List control */\n listRef?: React.Ref<List>;\n\n /** Ref to the underlying List control */\n groupedListRef?: React.Ref<IGroupedListV2>;\n\n /**\n * For perf reasons, GroupedList avoids re-rendering unless certain props have changed.\n * Use this prop if you need to force it to re-render in other cases. You can pass any type of\n * value as long as it only changes (`===` comparison) when a re-render should happen.\n */\n version?: {};\n\n /**\n * For perf reasons, GroupedList avoids re-rendering unless certain props have changed.\n * Use this prop if you need to force it to re-render when a group has expanded or collapsed.\n * You can pass any type of value as long as it only changes (`===` comparison)\n * when a re-render should happen.\n */\n groupExpandedVersion?: {};\n\n /** Rendering callback to render the group items. */\n onRenderCell: (nestingDepth?: number, item?: any, index?: number, group?: IGroup) => React.ReactNode;\n}\n\nexport interface IGroupedListV2 {\n scrollToIndex(index: number, measureItem?: (itemIndex: number) => number, scrollToMode?: ScrollToMode): void;\n getStartItemIndexInView(): number;\n}\n\n/**\n * An item rendered in a GroupedList.\n */\nexport type IItemGroupedItem = {\n type: 'item';\n group: IGroup;\n item: any;\n itemIndex: number;\n};\n\n/**\n * Item used for \"show all\" in a GroupedList.\n */\nexport type IShowAllGroupedItem = {\n type: 'showAll';\n group: IGroup;\n};\n\n/**\n * A footer in a GroupedList.\n */\nexport type IFooterGroupedItem = {\n type: 'footer';\n group: IGroup;\n};\n\n/**\n * A header in a GroupedList.\n */\nexport type IHeaderGroupedItem = {\n type: 'header';\n group: IGroup;\n groupId: string;\n groupIndex: number;\n};\n\n/**\n * Union of GroupedList item types.\n */\nexport type IGroupedItem = IItemGroupedItem | IShowAllGroupedItem | IFooterGroupedItem | IHeaderGroupedItem;\n"]}
@@ -0,0 +1,15 @@
export * from './GroupedList';
export * from './GroupedList.base';
export * from './GroupedList.types';
export * from './GroupHeader';
export * from './GroupFooter';
export * from './GroupShowAll';
export { GroupSpacer } from './GroupSpacer';
export * from './GroupSpacer.types';
export * from './GroupedListSection';
export type { IGroupHeaderStyleProps, IGroupHeaderStyles, IGroupHeaderCheckboxProps } from './GroupHeader.types';
export type { IGroupFooterStyleProps, IGroupFooterStyles } from './GroupFooter.types';
export type { IGroupShowAllStyleProps, IGroupShowAllStyles } from './GroupShowAll.types';
export * from './GroupedListV2';
export * from './GroupedListV2.base';
export * from './GroupedListV2.types';
@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GroupSpacer = void 0;
var tslib_1 = require("tslib");
tslib_1.__exportStar(require("./GroupedList"), exports);
tslib_1.__exportStar(require("./GroupedList.base"), exports);
tslib_1.__exportStar(require("./GroupedList.types"), exports);
tslib_1.__exportStar(require("./GroupHeader"), exports);
tslib_1.__exportStar(require("./GroupFooter"), exports);
tslib_1.__exportStar(require("./GroupShowAll"), exports);
var GroupSpacer_1 = require("./GroupSpacer");
Object.defineProperty(exports, "GroupSpacer", { enumerable: true, get: function () { return GroupSpacer_1.GroupSpacer; } });
tslib_1.__exportStar(require("./GroupSpacer.types"), exports);
tslib_1.__exportStar(require("./GroupedListSection"), exports);
tslib_1.__exportStar(require("./GroupedListV2"), exports);
tslib_1.__exportStar(require("./GroupedListV2.base"), exports);
tslib_1.__exportStar(require("./GroupedListV2.types"), exports);
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/GroupedList/index.ts"],"names":[],"mappings":";;;;AAAA,wDAA8B;AAC9B,6DAAmC;AACnC,8DAAoC;AACpC,wDAA8B;AAC9B,wDAA8B;AAC9B,yDAA+B;AAC/B,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,8DAAoC;AACpC,+DAAqC;AAKrC,0DAAgC;AAChC,+DAAqC;AACrC,gEAAsC","sourcesContent":["export * from './GroupedList';\nexport * from './GroupedList.base';\nexport * from './GroupedList.types';\nexport * from './GroupHeader';\nexport * from './GroupFooter';\nexport * from './GroupShowAll';\nexport { GroupSpacer } from './GroupSpacer';\nexport * from './GroupSpacer.types';\nexport * from './GroupedListSection';\nexport type { IGroupHeaderStyleProps, IGroupHeaderStyles, IGroupHeaderCheckboxProps } from './GroupHeader.types';\nexport type { IGroupFooterStyleProps, IGroupFooterStyles } from './GroupFooter.types';\nexport type { IGroupShowAllStyleProps, IGroupShowAllStyles } from './GroupShowAll.types';\n\nexport * from './GroupedListV2';\nexport * from './GroupedListV2.base';\nexport * from './GroupedListV2.types';\n"]}