@fluentui/react-button 0.20.5 → 0.20.8

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.json CHANGED
@@ -2,7 +2,52 @@
2
2
  "name": "@fluentui/react-button",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 27 Jul 2022 12:25:50 GMT",
5
+ "date": "Tue, 30 Aug 2022 18:59:20 GMT",
6
+ "tag": "@fluentui/react-button_v0.20.8",
7
+ "version": "0.20.8",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "comment": "Bump @uifabric/styling to v7.22.0",
12
+ "author": "mgodbolt@microsoft.com",
13
+ "commit": "acfc80a933f526df2732fdd43c6d82cffd1d5bc2",
14
+ "package": "@fluentui/react-button"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Tue, 30 Aug 2022 00:07:57 GMT",
21
+ "tag": "@fluentui/react-button_v0.20.7",
22
+ "version": "0.20.7",
23
+ "comments": {
24
+ "patch": [
25
+ {
26
+ "comment": "Bump @uifabric/utilities to v7.36.0",
27
+ "author": "tmichon@microsoft.com",
28
+ "commit": "2d5c41dc344c50b1c54c90b5650643002616c2c3",
29
+ "package": "@fluentui/react-button"
30
+ }
31
+ ]
32
+ }
33
+ },
34
+ {
35
+ "date": "Wed, 17 Aug 2022 12:21:32 GMT",
36
+ "tag": "@fluentui/react-button_v0.20.6",
37
+ "version": "0.20.6",
38
+ "comments": {
39
+ "patch": [
40
+ {
41
+ "comment": "Bump @uifabric/utilities to v7.35.0",
42
+ "author": "tmichon@microsoft.com",
43
+ "commit": "94cb7fbdc1b68428d8ea8d69a19a1bcf1f11484d",
44
+ "package": "@fluentui/react-button"
45
+ }
46
+ ]
47
+ }
48
+ },
49
+ {
50
+ "date": "Wed, 27 Jul 2022 12:27:44 GMT",
6
51
  "tag": "@fluentui/react-button_v0.20.5",
7
52
  "version": "0.20.5",
8
53
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,39 @@
1
1
  # Change Log - @fluentui/react-button
2
2
 
3
- This log was last generated on Wed, 27 Jul 2022 12:25:50 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 30 Aug 2022 18:59:20 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [0.20.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v0.20.8)
8
+
9
+ Tue, 30 Aug 2022 18:59:20 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-button_v0.20.7..@fluentui/react-button_v0.20.8)
11
+
12
+ ### Patches
13
+
14
+ - Bump @uifabric/styling to v7.22.0 ([PR #24572](https://github.com/microsoft/fluentui/pull/24572) by mgodbolt@microsoft.com)
15
+
16
+ ## [0.20.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v0.20.7)
17
+
18
+ Tue, 30 Aug 2022 00:07:57 GMT
19
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-button_v0.20.6..@fluentui/react-button_v0.20.7)
20
+
21
+ ### Patches
22
+
23
+ - Bump @uifabric/utilities to v7.36.0 ([PR #24555](https://github.com/microsoft/fluentui/pull/24555) by tmichon@microsoft.com)
24
+
25
+ ## [0.20.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v0.20.6)
26
+
27
+ Wed, 17 Aug 2022 12:21:32 GMT
28
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-button_v0.20.5..@fluentui/react-button_v0.20.6)
29
+
30
+ ### Patches
31
+
32
+ - Bump @uifabric/utilities to v7.35.0 ([PR #24370](https://github.com/microsoft/fluentui/pull/24370) by tmichon@microsoft.com)
33
+
7
34
  ## [0.20.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v0.20.5)
8
35
 
9
- Wed, 27 Jul 2022 12:25:50 GMT
36
+ Wed, 27 Jul 2022 12:27:44 GMT
10
37
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-button_v0.20.4..@fluentui/react-button_v0.20.5)
11
38
 
12
39
  ### Patches
package/dist/demo-app.js CHANGED
@@ -944,7 +944,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ts
944
944
  /***/ (function(module, exports, __webpack_require__) {
945
945
 
946
946
  "use strict";
947
- eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// Do not modify this file; it is generated as part of publish.\n// The checked in version is a placeholder only and will not be updated.\nvar set_version_1 = __webpack_require__(/*! @uifabric/set-version */ \"../set-version/src/index.ts\");\nset_version_1.setVersion('@uifabric/react-hooks', '7.15.0');\n\n\n//# sourceURL=webpack:///../react-hooks/src/version.ts?");
947
+ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// Do not modify this file; it is generated as part of publish.\n// The checked in version is a placeholder only and will not be updated.\nvar set_version_1 = __webpack_require__(/*! @uifabric/set-version */ \"../set-version/src/index.ts\");\nset_version_1.setVersion('@uifabric/react-hooks', '7.15.2');\n\n\n//# sourceURL=webpack:///../react-hooks/src/version.ts?");
948
948
 
949
949
  /***/ }),
950
950
 
@@ -24811,7 +24811,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ts
24811
24811
  /***/ (function(module, exports, __webpack_require__) {
24812
24812
 
24813
24813
  "use strict";
24814
- eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// Do not modify this file; it is generated as part of publish.\n// The checked in version is a placeholder only and will not be updated.\nvar set_version_1 = __webpack_require__(/*! @uifabric/set-version */ \"../set-version/src/index.ts\");\nset_version_1.setVersion('@fluentui/react-icons', '0.4.4');\n\n\n//# sourceURL=webpack:///../react-icons/src/version.ts?");
24814
+ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// Do not modify this file; it is generated as part of publish.\n// The checked in version is a placeholder only and will not be updated.\nvar set_version_1 = __webpack_require__(/*! @uifabric/set-version */ \"../set-version/src/index.ts\");\nset_version_1.setVersion('@fluentui/react-icons', '0.4.6');\n\n\n//# sourceURL=webpack:///../react-icons/src/version.ts?");
24815
24815
 
24816
24816
  /***/ }),
24817
24817
 
@@ -25219,7 +25219,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar th
25219
25219
  /***/ (function(module, exports, __webpack_require__) {
25220
25220
 
25221
25221
  "use strict";
25222
- eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// Do not modify this file; it is generated as part of publish.\n// The checked in version is a placeholder only and will not be updated.\nvar set_version_1 = __webpack_require__(/*! @uifabric/set-version */ \"../set-version/src/index.ts\");\nset_version_1.setVersion('@fluentui/react-theme-provider', '0.19.4');\n\n\n//# sourceURL=webpack:///../react-theme-provider/src/version.ts?");
25222
+ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// Do not modify this file; it is generated as part of publish.\n// The checked in version is a placeholder only and will not be updated.\nvar set_version_1 = __webpack_require__(/*! @uifabric/set-version */ \"../set-version/src/index.ts\");\nset_version_1.setVersion('@fluentui/react-theme-provider', '0.19.7');\n\n\n//# sourceURL=webpack:///../react-theme-provider/src/version.ts?");
25223
25223
 
25224
25224
  /***/ }),
25225
25225
 
@@ -25651,7 +25651,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar bu
25651
25651
  /***/ (function(module, exports, __webpack_require__) {
25652
25652
 
25653
25653
  "use strict";
25654
- eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// Do not modify this file; it is generated as part of publish.\n// The checked in version is a placeholder only and will not be updated.\nvar set_version_1 = __webpack_require__(/*! @uifabric/set-version */ \"../set-version/src/index.ts\");\nset_version_1.setVersion('@uifabric/styling', '7.21.0');\n\n\n//# sourceURL=webpack:///../styling/src/version.ts?");
25654
+ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// Do not modify this file; it is generated as part of publish.\n// The checked in version is a placeholder only and will not be updated.\nvar set_version_1 = __webpack_require__(/*! @uifabric/set-version */ \"../set-version/src/index.ts\");\nset_version_1.setVersion('@uifabric/styling', '7.21.3');\n\n\n//# sourceURL=webpack:///../styling/src/version.ts?");
25655
25655
 
25656
25656
  /***/ }),
25657
25657
 
@@ -27067,7 +27067,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ge
27067
27067
  /***/ (function(module, exports, __webpack_require__) {
27068
27068
 
27069
27069
  "use strict";
27070
- eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Selection_types_1 = __webpack_require__(/*! ./Selection.types */ \"../utilities/src/selection/Selection.types.ts\");\nvar EventGroup_1 = __webpack_require__(/*! ../EventGroup */ \"../utilities/src/EventGroup.ts\");\n/**\n * {@docCategory Selection}\n */\nvar Selection = /** @class */ (function () {\n /**\n * Create a new Selection. If `TItem` does not have a `key` property, you must provide an options\n * object with a `getKey` implementation. Providing options is optional otherwise.\n * (At most one `options` object is accepted.)\n */\n function Selection() {\n var options = []; // Otherwise, arguments require options with `getKey`.\n for (var _i = 0 // Otherwise, arguments require options with `getKey`.\n ; _i < arguments.length // Otherwise, arguments require options with `getKey`.\n ; _i++ // Otherwise, arguments require options with `getKey`.\n ) {\n options[_i] = arguments[_i]; // Otherwise, arguments require options with `getKey`.\n }\n var _a = options[0] || {}, onSelectionChanged = _a.onSelectionChanged, onItemsChanged = _a.onItemsChanged, getKey = _a.getKey, _b = _a.canSelectItem, canSelectItem = _b === void 0 ? function () { return true; } : _b, items = _a.items, _c = _a.selectionMode, selectionMode = _c === void 0 ? Selection_types_1.SelectionMode.multiple : _c;\n this.mode = selectionMode;\n this._getKey = getKey || defaultGetKey;\n this._changeEventSuppressionCount = 0;\n this._exemptedCount = 0;\n this._anchoredIndex = 0;\n this._unselectableCount = 0;\n this._onSelectionChanged = onSelectionChanged;\n this._onItemsChanged = onItemsChanged;\n this._canSelectItem = canSelectItem;\n this._keyToIndexMap = {};\n this._isModal = false;\n this.setItems(items || [], true);\n this.count = this.getSelectedCount();\n }\n Selection.prototype.canSelectItem = function (item, index) {\n if (typeof index === 'number' && index < 0) {\n return false;\n }\n return this._canSelectItem(item, index);\n };\n Selection.prototype.getKey = function (item, index) {\n var key = this._getKey(item, index);\n return typeof key === 'number' || key ? \"\" + key : '';\n };\n Selection.prototype.setChangeEvents = function (isEnabled, suppressChange) {\n this._changeEventSuppressionCount += isEnabled ? -1 : 1;\n if (this._changeEventSuppressionCount === 0 && this._hasChanged) {\n this._hasChanged = false;\n if (!suppressChange) {\n this._change();\n }\n }\n };\n Selection.prototype.isModal = function () {\n return this._isModal;\n };\n Selection.prototype.setModal = function (isModal) {\n if (this._isModal !== isModal) {\n this.setChangeEvents(false);\n this._isModal = isModal;\n if (!isModal) {\n this.setAllSelected(false);\n }\n this._change();\n this.setChangeEvents(true);\n }\n };\n /**\n * Selection needs the items, call this method to set them. If the set\n * of items is the same, this will re-evaluate selection and index maps.\n * Otherwise, shouldClear should be set to true, so that selection is\n * cleared.\n */\n Selection.prototype.setItems = function (items, shouldClear) {\n if (shouldClear === void 0) { shouldClear = true; }\n var newKeyToIndexMap = {};\n var newUnselectableIndices = {};\n var hasSelectionChanged = false;\n this.setChangeEvents(false);\n // Reset the unselectable count.\n this._unselectableCount = 0;\n var haveItemsChanged = false;\n // Build lookup table for quick selection evaluation.\n for (var i = 0; i < items.length; i++) {\n var item = items[i];\n if (item) {\n var key = this.getKey(item, i);\n if (key) {\n if (!haveItemsChanged && (!(key in this._keyToIndexMap) || this._keyToIndexMap[key] !== i)) {\n haveItemsChanged = true;\n }\n newKeyToIndexMap[key] = i;\n }\n }\n newUnselectableIndices[i] = item && !this.canSelectItem(item);\n if (newUnselectableIndices[i]) {\n this._unselectableCount++;\n }\n }\n if (shouldClear || items.length === 0) {\n this._setAllSelected(false, true);\n }\n // Check the exemption list for discrepencies.\n var newExemptedIndicies = {};\n var newExemptedCount = 0;\n for (var indexProperty in this._exemptedIndices) {\n if (this._exemptedIndices.hasOwnProperty(indexProperty)) {\n var index = Number(indexProperty);\n var item = this._items[index];\n var exemptKey = item ? this.getKey(item, Number(index)) : undefined;\n var newIndex = exemptKey ? newKeyToIndexMap[exemptKey] : index;\n if (newIndex === undefined) {\n // The item has likely been replaced or removed.\n hasSelectionChanged = true;\n }\n else {\n // We know the new index of the item. update the existing exemption table.\n newExemptedIndicies[newIndex] = true;\n newExemptedCount++;\n hasSelectionChanged = hasSelectionChanged || newIndex !== index;\n }\n }\n }\n if (this._items && this._exemptedCount === 0 && items.length !== this._items.length && this._isAllSelected) {\n // If everything was selected but the number of items has changed, selection has changed.\n hasSelectionChanged = true;\n }\n if (!haveItemsChanged) {\n for (var _i = 0, _a = Object.keys(this._keyToIndexMap); _i < _a.length; _i++) {\n var key = _a[_i];\n if (!(key in newKeyToIndexMap)) {\n haveItemsChanged = true;\n break;\n }\n }\n }\n this._exemptedIndices = newExemptedIndicies;\n this._exemptedCount = newExemptedCount;\n this._keyToIndexMap = newKeyToIndexMap;\n this._unselectableIndices = newUnselectableIndices;\n this._items = items;\n this._selectedItems = null;\n if (hasSelectionChanged) {\n this._updateCount();\n }\n if (haveItemsChanged) {\n EventGroup_1.EventGroup.raise(this, Selection_types_1.SELECTION_ITEMS_CHANGE);\n if (this._onItemsChanged) {\n this._onItemsChanged();\n }\n }\n if (hasSelectionChanged) {\n this._change();\n }\n this.setChangeEvents(true);\n };\n Selection.prototype.getItems = function () {\n return this._items;\n };\n Selection.prototype.getSelection = function () {\n if (!this._selectedItems) {\n this._selectedItems = [];\n var items = this._items;\n if (items) {\n for (var i = 0; i < items.length; i++) {\n if (this.isIndexSelected(i)) {\n this._selectedItems.push(items[i]);\n }\n }\n }\n }\n return this._selectedItems;\n };\n Selection.prototype.getSelectedCount = function () {\n return this._isAllSelected\n ? this._items.length - this._exemptedCount - this._unselectableCount\n : this._exemptedCount;\n };\n Selection.prototype.getSelectedIndices = function () {\n if (!this._selectedIndices) {\n this._selectedIndices = [];\n var items = this._items;\n if (items) {\n for (var i = 0; i < items.length; i++) {\n if (this.isIndexSelected(i)) {\n this._selectedIndices.push(i);\n }\n }\n }\n }\n return this._selectedIndices;\n };\n Selection.prototype.getItemIndex = function (key) {\n var index = this._keyToIndexMap[key];\n return (index !== null && index !== void 0 ? index : -1);\n };\n Selection.prototype.isRangeSelected = function (fromIndex, count) {\n if (count === 0) {\n return false;\n }\n var endIndex = fromIndex + count;\n for (var i = fromIndex; i < endIndex; i++) {\n if (!this.isIndexSelected(i)) {\n return false;\n }\n }\n return true;\n };\n Selection.prototype.isAllSelected = function () {\n var selectableCount = this._items.length - this._unselectableCount;\n // In single mode, we can only have a max of 1 item.\n if (this.mode === Selection_types_1.SelectionMode.single) {\n selectableCount = Math.min(selectableCount, 1);\n }\n return ((this.count > 0 && this._isAllSelected && this._exemptedCount === 0) ||\n (!this._isAllSelected && this._exemptedCount === selectableCount && selectableCount > 0));\n };\n Selection.prototype.isKeySelected = function (key) {\n var index = this._keyToIndexMap[key];\n return this.isIndexSelected(index);\n };\n Selection.prototype.isIndexSelected = function (index) {\n return !!((this.count > 0 && this._isAllSelected && !this._exemptedIndices[index] && !this._unselectableIndices[index]) ||\n (!this._isAllSelected && this._exemptedIndices[index]));\n };\n Selection.prototype.setAllSelected = function (isAllSelected) {\n if (isAllSelected && this.mode !== Selection_types_1.SelectionMode.multiple) {\n return;\n }\n var selectableCount = this._items ? this._items.length - this._unselectableCount : 0;\n this.setChangeEvents(false);\n if (selectableCount > 0 && (this._exemptedCount > 0 || isAllSelected !== this._isAllSelected)) {\n this._exemptedIndices = {};\n if (isAllSelected !== this._isAllSelected || this._exemptedCount > 0) {\n this._exemptedCount = 0;\n this._isAllSelected = isAllSelected;\n this._change();\n }\n this._updateCount();\n }\n this.setChangeEvents(true);\n };\n Selection.prototype.setKeySelected = function (key, isSelected, shouldAnchor) {\n var index = this._keyToIndexMap[key];\n if (index >= 0) {\n this.setIndexSelected(index, isSelected, shouldAnchor);\n }\n };\n Selection.prototype.setIndexSelected = function (index, isSelected, shouldAnchor) {\n if (this.mode === Selection_types_1.SelectionMode.none) {\n return;\n }\n // Clamp the index.\n index = Math.min(Math.max(0, index), this._items.length - 1);\n // No-op on out of bounds selections.\n if (index < 0 || index >= this._items.length) {\n return;\n }\n this.setChangeEvents(false);\n var isExempt = this._exemptedIndices[index];\n var canSelect = !this._unselectableIndices[index];\n if (canSelect) {\n if (isSelected && this.mode === Selection_types_1.SelectionMode.single) {\n // If this is single-select, the previous selection should be removed.\n this._setAllSelected(false, true);\n }\n // Determine if we need to remove the exemption.\n if (isExempt && ((isSelected && this._isAllSelected) || (!isSelected && !this._isAllSelected))) {\n delete this._exemptedIndices[index];\n this._exemptedCount--;\n }\n // Determine if we need to add the exemption.\n if (!isExempt && ((isSelected && !this._isAllSelected) || (!isSelected && this._isAllSelected))) {\n this._exemptedIndices[index] = true;\n this._exemptedCount++;\n }\n if (shouldAnchor) {\n this._anchoredIndex = index;\n }\n }\n this._updateCount();\n this.setChangeEvents(true);\n };\n Selection.prototype.selectToKey = function (key, clearSelection) {\n this.selectToIndex(this._keyToIndexMap[key], clearSelection);\n };\n Selection.prototype.selectToIndex = function (index, clearSelection) {\n if (this.mode === Selection_types_1.SelectionMode.none) {\n return;\n }\n if (this.mode === Selection_types_1.SelectionMode.single) {\n this.setIndexSelected(index, true, true);\n return;\n }\n var anchorIndex = this._anchoredIndex || 0;\n var startIndex = Math.min(index, anchorIndex);\n var endIndex = Math.max(index, anchorIndex);\n this.setChangeEvents(false);\n if (clearSelection) {\n this._setAllSelected(false, true);\n }\n for (; startIndex <= endIndex; startIndex++) {\n this.setIndexSelected(startIndex, true, false);\n }\n this.setChangeEvents(true);\n };\n Selection.prototype.toggleAllSelected = function () {\n this.setAllSelected(!this.isAllSelected());\n };\n Selection.prototype.toggleKeySelected = function (key) {\n this.setKeySelected(key, !this.isKeySelected(key), true);\n };\n Selection.prototype.toggleIndexSelected = function (index) {\n this.setIndexSelected(index, !this.isIndexSelected(index), true);\n };\n Selection.prototype.toggleRangeSelected = function (fromIndex, count) {\n if (this.mode === Selection_types_1.SelectionMode.none) {\n return;\n }\n var isRangeSelected = this.isRangeSelected(fromIndex, count);\n var endIndex = fromIndex + count;\n if (this.mode === Selection_types_1.SelectionMode.single && count > 1) {\n return;\n }\n this.setChangeEvents(false);\n for (var i = fromIndex; i < endIndex; i++) {\n this.setIndexSelected(i, !isRangeSelected, false);\n }\n this.setChangeEvents(true);\n };\n Selection.prototype._updateCount = function (preserveModalState) {\n if (preserveModalState === void 0) { preserveModalState = false; }\n var count = this.getSelectedCount();\n if (count !== this.count) {\n this.count = count;\n this._change();\n }\n if (!this.count && !preserveModalState) {\n this.setModal(false);\n }\n };\n Selection.prototype._setAllSelected = function (isAllSelected, preserveModalState) {\n if (preserveModalState === void 0) { preserveModalState = false; }\n if (isAllSelected && this.mode !== Selection_types_1.SelectionMode.multiple) {\n return;\n }\n var selectableCount = this._items ? this._items.length - this._unselectableCount : 0;\n this.setChangeEvents(false);\n if (selectableCount > 0 && (this._exemptedCount > 0 || isAllSelected !== this._isAllSelected)) {\n this._exemptedIndices = {};\n if (isAllSelected !== this._isAllSelected || this._exemptedCount > 0) {\n this._exemptedCount = 0;\n this._isAllSelected = isAllSelected;\n this._change();\n }\n this._updateCount(preserveModalState);\n }\n this.setChangeEvents(true);\n };\n Selection.prototype._change = function () {\n if (this._changeEventSuppressionCount === 0) {\n this._selectedItems = null;\n this._selectedIndices = undefined;\n EventGroup_1.EventGroup.raise(this, Selection_types_1.SELECTION_CHANGE);\n if (this._onSelectionChanged) {\n this._onSelectionChanged();\n }\n }\n else {\n this._hasChanged = true;\n }\n };\n return Selection;\n}());\nexports.Selection = Selection;\nfunction defaultGetKey(item, index) {\n // 0 may be used as a key\n var _a = (item || {}).key, key = _a === void 0 ? \"\" + index : _a;\n return key;\n}\n\n\n//# sourceURL=webpack:///../utilities/src/selection/Selection.ts?");
27070
+ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Selection_types_1 = __webpack_require__(/*! ./Selection.types */ \"../utilities/src/selection/Selection.types.ts\");\nvar EventGroup_1 = __webpack_require__(/*! ../EventGroup */ \"../utilities/src/EventGroup.ts\");\n/**\n * {@docCategory Selection}\n */\nvar Selection = /** @class */ (function () {\n /**\n * Create a new Selection. If `TItem` does not have a `key` property, you must provide an options\n * object with a `getKey` implementation. Providing options is optional otherwise.\n * (At most one `options` object is accepted.)\n */\n function Selection() {\n var options = []; // Otherwise, arguments require options with `getKey`.\n for (var _i = 0 // Otherwise, arguments require options with `getKey`.\n ; _i < arguments.length // Otherwise, arguments require options with `getKey`.\n ; _i++ // Otherwise, arguments require options with `getKey`.\n ) {\n options[_i] = arguments[_i]; // Otherwise, arguments require options with `getKey`.\n }\n var _a = options[0] || {}, onSelectionChanged = _a.onSelectionChanged, onItemsChanged = _a.onItemsChanged, getKey = _a.getKey, _b = _a.canSelectItem, canSelectItem = _b === void 0 ? function () { return true; } : _b, items = _a.items, _c = _a.selectionMode, selectionMode = _c === void 0 ? Selection_types_1.SelectionMode.multiple : _c;\n this.mode = selectionMode;\n this._getKey = getKey || defaultGetKey;\n this._changeEventSuppressionCount = 0;\n this._exemptedCount = 0;\n this._anchoredIndex = 0;\n this._unselectableCount = 0;\n this._onSelectionChanged = onSelectionChanged;\n this._onItemsChanged = onItemsChanged;\n this._canSelectItem = canSelectItem;\n this._keyToIndexMap = {};\n this._isModal = false;\n this.setItems(items || [], true);\n this.count = this.getSelectedCount();\n }\n Selection.prototype.canSelectItem = function (item, index) {\n if (typeof index === 'number' && index < 0) {\n return false;\n }\n return this._canSelectItem(item, index);\n };\n Selection.prototype.getKey = function (item, index) {\n var key = this._getKey(item, index);\n return typeof key === 'number' || key ? \"\" + key : '';\n };\n Selection.prototype.setChangeEvents = function (isEnabled, suppressChange) {\n this._changeEventSuppressionCount += isEnabled ? -1 : 1;\n if (this._changeEventSuppressionCount === 0 && this._hasChanged) {\n this._hasChanged = false;\n if (!suppressChange) {\n this._change();\n }\n }\n };\n Selection.prototype.isModal = function () {\n return this._isModal;\n };\n Selection.prototype.setModal = function (isModal) {\n if (this._isModal !== isModal) {\n this.setChangeEvents(false);\n this._isModal = isModal;\n if (!isModal) {\n this.setAllSelected(false);\n }\n this._change();\n this.setChangeEvents(true);\n }\n };\n /**\n * Selection needs the items, call this method to set them. If the set\n * of items is the same, this will re-evaluate selection and index maps.\n * Otherwise, shouldClear should be set to true, so that selection is\n * cleared.\n */\n Selection.prototype.setItems = function (items, shouldClear) {\n if (shouldClear === void 0) { shouldClear = true; }\n var newKeyToIndexMap = {};\n var newUnselectableIndices = {};\n var hasSelectionChanged = false;\n this.setChangeEvents(false);\n // Reset the unselectable count.\n this._unselectableCount = 0;\n var haveItemsChanged = false;\n // Build lookup table for quick selection evaluation.\n for (var i = 0; i < items.length; i++) {\n var item = items[i];\n if (item) {\n var key = this.getKey(item, i);\n if (key) {\n if (!haveItemsChanged && (!(key in this._keyToIndexMap) || this._keyToIndexMap[key] !== i)) {\n haveItemsChanged = true;\n }\n newKeyToIndexMap[key] = i;\n }\n }\n newUnselectableIndices[i] = item && !this.canSelectItem(item);\n if (newUnselectableIndices[i]) {\n this._unselectableCount++;\n }\n }\n if (shouldClear || items.length === 0) {\n this._setAllSelected(false, true);\n }\n // Check the exemption list for discrepencies.\n var newExemptedIndicies = {};\n var newExemptedCount = 0;\n for (var indexProperty in this._exemptedIndices) {\n if (this._exemptedIndices.hasOwnProperty(indexProperty)) {\n var index = Number(indexProperty);\n var item = this._items[index];\n var exemptKey = item ? this.getKey(item, Number(index)) : undefined;\n var newIndex = exemptKey ? newKeyToIndexMap[exemptKey] : index;\n if (newIndex === undefined) {\n // The item has likely been replaced or removed.\n hasSelectionChanged = true;\n }\n else {\n // We know the new index of the item. update the existing exemption table.\n newExemptedIndicies[newIndex] = true;\n newExemptedCount++;\n hasSelectionChanged = hasSelectionChanged || newIndex !== index;\n }\n }\n }\n if (this._items && this._exemptedCount === 0 && items.length !== this._items.length && this._isAllSelected) {\n // If everything was selected but the number of items has changed, selection has changed.\n hasSelectionChanged = true;\n }\n if (!haveItemsChanged) {\n for (var _i = 0, _a = Object.keys(this._keyToIndexMap); _i < _a.length; _i++) {\n var key = _a[_i];\n if (!(key in newKeyToIndexMap)) {\n haveItemsChanged = true;\n break;\n }\n }\n }\n this._exemptedIndices = newExemptedIndicies;\n this._exemptedCount = newExemptedCount;\n this._keyToIndexMap = newKeyToIndexMap;\n this._unselectableIndices = newUnselectableIndices;\n this._items = items;\n this._selectedItems = null;\n if (hasSelectionChanged) {\n this._updateCount();\n }\n if (haveItemsChanged) {\n EventGroup_1.EventGroup.raise(this, Selection_types_1.SELECTION_ITEMS_CHANGE);\n if (this._onItemsChanged) {\n this._onItemsChanged();\n }\n }\n if (hasSelectionChanged) {\n this._change();\n }\n this.setChangeEvents(true);\n };\n Selection.prototype.getItems = function () {\n return this._items;\n };\n Selection.prototype.getSelection = function () {\n if (!this._selectedItems) {\n this._selectedItems = [];\n var items = this._items;\n if (items) {\n for (var i = 0; i < items.length; i++) {\n if (this.isIndexSelected(i)) {\n this._selectedItems.push(items[i]);\n }\n }\n }\n }\n return this._selectedItems;\n };\n Selection.prototype.getSelectedCount = function () {\n return this._isAllSelected\n ? this._items.length - this._exemptedCount - this._unselectableCount\n : this._exemptedCount;\n };\n Selection.prototype.getSelectedIndices = function () {\n if (!this._selectedIndices) {\n this._selectedIndices = [];\n var items = this._items;\n if (items) {\n for (var i = 0; i < items.length; i++) {\n if (this.isIndexSelected(i)) {\n this._selectedIndices.push(i);\n }\n }\n }\n }\n return this._selectedIndices;\n };\n Selection.prototype.getItemIndex = function (key) {\n var index = this._keyToIndexMap[key];\n return (index !== null && index !== void 0 ? index : -1);\n };\n Selection.prototype.isRangeSelected = function (fromIndex, count) {\n if (count === 0) {\n return false;\n }\n var endIndex = fromIndex + count;\n for (var i = fromIndex; i < endIndex; i++) {\n if (!this.isIndexSelected(i)) {\n return false;\n }\n }\n return true;\n };\n Selection.prototype.isAllSelected = function () {\n var selectableCount = this._items.length - this._unselectableCount;\n // In single mode, we can only have a max of 1 item.\n if (this.mode === Selection_types_1.SelectionMode.single) {\n selectableCount = Math.min(selectableCount, 1);\n }\n return ((this.count > 0 && this._isAllSelected && this._exemptedCount === 0) ||\n (!this._isAllSelected && this._exemptedCount === selectableCount && selectableCount > 0));\n };\n Selection.prototype.isKeySelected = function (key) {\n var index = this._keyToIndexMap[key];\n return this.isIndexSelected(index);\n };\n Selection.prototype.isIndexSelected = function (index) {\n return !!((this.count > 0 && this._isAllSelected && !this._exemptedIndices[index] && !this._unselectableIndices[index]) ||\n (!this._isAllSelected && this._exemptedIndices[index]));\n };\n Selection.prototype.setAllSelected = function (isAllSelected) {\n if (isAllSelected && this.mode !== Selection_types_1.SelectionMode.multiple) {\n return;\n }\n var selectableCount = this._items ? this._items.length - this._unselectableCount : 0;\n this.setChangeEvents(false);\n if (selectableCount > 0 && (this._exemptedCount > 0 || isAllSelected !== this._isAllSelected)) {\n this._exemptedIndices = {};\n if (isAllSelected !== this._isAllSelected || this._exemptedCount > 0) {\n this._exemptedCount = 0;\n this._isAllSelected = isAllSelected;\n this._change();\n }\n this._updateCount();\n }\n this.setChangeEvents(true);\n };\n Selection.prototype.setKeySelected = function (key, isSelected, shouldAnchor) {\n var index = this._keyToIndexMap[key];\n if (index >= 0) {\n this.setIndexSelected(index, isSelected, shouldAnchor);\n }\n };\n Selection.prototype.setIndexSelected = function (index, isSelected, shouldAnchor) {\n if (this.mode === Selection_types_1.SelectionMode.none) {\n return;\n }\n // Clamp the index.\n index = Math.min(Math.max(0, index), this._items.length - 1);\n // No-op on out of bounds selections.\n if (index < 0 || index >= this._items.length) {\n return;\n }\n this.setChangeEvents(false);\n var isExempt = this._exemptedIndices[index];\n var canSelect = !this._unselectableIndices[index];\n if (canSelect) {\n if (isSelected && this.mode === Selection_types_1.SelectionMode.single) {\n // If this is single-select, the previous selection should be removed.\n this._setAllSelected(false, true);\n }\n // Determine if we need to remove the exemption.\n if (isExempt && ((isSelected && this._isAllSelected) || (!isSelected && !this._isAllSelected))) {\n delete this._exemptedIndices[index];\n this._exemptedCount--;\n }\n // Determine if we need to add the exemption.\n if (!isExempt && ((isSelected && !this._isAllSelected) || (!isSelected && this._isAllSelected))) {\n this._exemptedIndices[index] = true;\n this._exemptedCount++;\n }\n if (shouldAnchor) {\n this._anchoredIndex = index;\n }\n }\n this._updateCount();\n this.setChangeEvents(true);\n };\n Selection.prototype.setRangeSelected = function (fromIndex, count, isSelected, shouldAnchor) {\n if (this.mode === Selection_types_1.SelectionMode.none) {\n return;\n }\n // Clamp the index.\n fromIndex = Math.min(Math.max(0, fromIndex), this._items.length - 1);\n // Clamp the range.\n count = Math.min(Math.max(0, count), this._items.length - fromIndex);\n // No-op on out of bounds selections.\n if (fromIndex < 0 || fromIndex >= this._items.length || count === 0) {\n return;\n }\n this.setChangeEvents(false);\n var anchorIndex = this._anchoredIndex || 0;\n var startIndex = fromIndex;\n var endIndex = fromIndex + count - 1;\n var newAnchorIndex = anchorIndex >= endIndex ? startIndex : endIndex;\n for (; startIndex <= endIndex; startIndex++) {\n this.setIndexSelected(startIndex, isSelected, shouldAnchor ? startIndex === newAnchorIndex : false);\n }\n this.setChangeEvents(true);\n };\n Selection.prototype.selectToKey = function (key, clearSelection) {\n this.selectToIndex(this._keyToIndexMap[key], clearSelection);\n };\n Selection.prototype.selectToRange = function (fromIndex, count, clearSelection) {\n if (this.mode === Selection_types_1.SelectionMode.none) {\n return;\n }\n if (this.mode === Selection_types_1.SelectionMode.single) {\n if (count === 1) {\n this.setIndexSelected(fromIndex, true, true);\n }\n return;\n }\n var anchorIndex = this._anchoredIndex || 0;\n var startIndex = Math.min(fromIndex, anchorIndex);\n var endIndex = Math.max(fromIndex + count - 1, anchorIndex);\n this.setChangeEvents(false);\n if (clearSelection) {\n this._setAllSelected(false, true);\n }\n for (; startIndex <= endIndex; startIndex++) {\n this.setIndexSelected(startIndex, true, false);\n }\n this.setChangeEvents(true);\n };\n Selection.prototype.selectToIndex = function (index, clearSelection) {\n if (this.mode === Selection_types_1.SelectionMode.none) {\n return;\n }\n if (this.mode === Selection_types_1.SelectionMode.single) {\n this.setIndexSelected(index, true, true);\n return;\n }\n var anchorIndex = this._anchoredIndex || 0;\n var startIndex = Math.min(index, anchorIndex);\n var endIndex = Math.max(index, anchorIndex);\n this.setChangeEvents(false);\n if (clearSelection) {\n this._setAllSelected(false, true);\n }\n for (; startIndex <= endIndex; startIndex++) {\n this.setIndexSelected(startIndex, true, false);\n }\n this.setChangeEvents(true);\n };\n Selection.prototype.toggleAllSelected = function () {\n this.setAllSelected(!this.isAllSelected());\n };\n Selection.prototype.toggleKeySelected = function (key) {\n this.setKeySelected(key, !this.isKeySelected(key), true);\n };\n Selection.prototype.toggleIndexSelected = function (index) {\n this.setIndexSelected(index, !this.isIndexSelected(index), true);\n };\n Selection.prototype.toggleRangeSelected = function (fromIndex, count) {\n if (this.mode === Selection_types_1.SelectionMode.none) {\n return;\n }\n var isRangeSelected = this.isRangeSelected(fromIndex, count);\n var endIndex = fromIndex + count;\n if (this.mode === Selection_types_1.SelectionMode.single && count > 1) {\n return;\n }\n this.setChangeEvents(false);\n for (var i = fromIndex; i < endIndex; i++) {\n this.setIndexSelected(i, !isRangeSelected, false);\n }\n this.setChangeEvents(true);\n };\n Selection.prototype._updateCount = function (preserveModalState) {\n if (preserveModalState === void 0) { preserveModalState = false; }\n var count = this.getSelectedCount();\n if (count !== this.count) {\n this.count = count;\n this._change();\n }\n if (!this.count && !preserveModalState) {\n this.setModal(false);\n }\n };\n Selection.prototype._setAllSelected = function (isAllSelected, preserveModalState) {\n if (preserveModalState === void 0) { preserveModalState = false; }\n if (isAllSelected && this.mode !== Selection_types_1.SelectionMode.multiple) {\n return;\n }\n var selectableCount = this._items ? this._items.length - this._unselectableCount : 0;\n this.setChangeEvents(false);\n if (selectableCount > 0 && (this._exemptedCount > 0 || isAllSelected !== this._isAllSelected)) {\n this._exemptedIndices = {};\n if (isAllSelected !== this._isAllSelected || this._exemptedCount > 0) {\n this._exemptedCount = 0;\n this._isAllSelected = isAllSelected;\n this._change();\n }\n this._updateCount(preserveModalState);\n }\n this.setChangeEvents(true);\n };\n Selection.prototype._change = function () {\n if (this._changeEventSuppressionCount === 0) {\n this._selectedItems = null;\n this._selectedIndices = undefined;\n EventGroup_1.EventGroup.raise(this, Selection_types_1.SELECTION_CHANGE);\n if (this._onSelectionChanged) {\n this._onSelectionChanged();\n }\n }\n else {\n this._hasChanged = true;\n }\n };\n return Selection;\n}());\nexports.Selection = Selection;\nfunction defaultGetKey(item, index) {\n // 0 may be used as a key\n var _a = (item || {}).key, key = _a === void 0 ? \"\" + index : _a;\n return key;\n}\n\n\n//# sourceURL=webpack:///../utilities/src/selection/Selection.ts?");
27071
27071
 
27072
27072
  /***/ }),
27073
27073
 
@@ -27163,7 +27163,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Re
27163
27163
  /***/ (function(module, exports, __webpack_require__) {
27164
27164
 
27165
27165
  "use strict";
27166
- eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// Do not modify this file; it is generated as part of publish.\n// The checked in version is a placeholder only and will not be updated.\nvar set_version_1 = __webpack_require__(/*! @uifabric/set-version */ \"../set-version/src/index.ts\");\nset_version_1.setVersion('@uifabric/utilities', '7.34.1');\n\n\n//# sourceURL=webpack:///../utilities/src/version.ts?");
27166
+ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// Do not modify this file; it is generated as part of publish.\n// The checked in version is a placeholder only and will not be updated.\nvar set_version_1 = __webpack_require__(/*! @uifabric/set-version */ \"../set-version/src/index.ts\");\nset_version_1.setVersion('@uifabric/utilities', '7.36.0');\n\n\n//# sourceURL=webpack:///../utilities/src/version.ts?");
27167
27167
 
27168
27168
  /***/ }),
27169
27169
 
@@ -27727,7 +27727,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ts
27727
27727
  /***/ (function(module, exports, __webpack_require__) {
27728
27728
 
27729
27729
  "use strict";
27730
- eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// Do not modify this file; it is generated as part of publish.\n// The checked in version is a placeholder only and will not be updated.\nvar set_version_1 = __webpack_require__(/*! @uifabric/set-version */ \"../set-version/src/index.ts\");\nset_version_1.setVersion('@fluentui/react-button', '0.20.4');\n\n\n//# sourceURL=webpack:///./src/version.ts?");
27730
+ eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// Do not modify this file; it is generated as part of publish.\n// The checked in version is a placeholder only and will not be updated.\nvar set_version_1 = __webpack_require__(/*! @uifabric/set-version */ \"../set-version/src/index.ts\");\nset_version_1.setVersion('@fluentui/react-button', '0.20.7');\n\n\n//# sourceURL=webpack:///./src/version.ts?");
27731
27731
 
27732
27732
  /***/ }),
27733
27733
 
@@ -71,4 +71,4 @@
71
71
  }</script><style>#root[hidden],
72
72
  #docs-root[hidden] {
73
73
  display: none !important;
74
- }</style></head><body><div class="sb-nopreview sb-wrapper"><div class="sb-nopreview_main"><h1 class="sb-nopreview_heading sb-heading">No Preview</h1><p>Sorry, but you either have no stories or none are selected somehow.</p><ul><li>Please check the Storybook config.</li><li>Try reloading the page.</li></ul><p>If the problem persists, check the browser console, or the terminal you've run Storybook from.</p></div></div><div class="sb-errordisplay sb-wrapper"><pre id="error-message" class="sb-heading"></pre><pre class="sb-errordisplay_code"><code id="error-stack"></code></pre></div><div id="root"></div><div id="docs-root"></div><script src="runtime~main.b0307caa89b2f44e62f4.bundle.js"></script><script src="vendors~main.b0307caa89b2f44e62f4.bundle.js"></script><script src="main.b0307caa89b2f44e62f4.bundle.js"></script></body></html>
74
+ }</style></head><body><div class="sb-nopreview sb-wrapper"><div class="sb-nopreview_main"><h1 class="sb-nopreview_heading sb-heading">No Preview</h1><p>Sorry, but you either have no stories or none are selected somehow.</p><ul><li>Please check the Storybook config.</li><li>Try reloading the page.</li></ul><p>If the problem persists, check the browser console, or the terminal you've run Storybook from.</p></div></div><div class="sb-errordisplay sb-wrapper"><pre id="error-message" class="sb-heading"></pre><pre class="sb-errordisplay_code"><code id="error-stack"></code></pre></div><div id="root"></div><div id="docs-root"></div><script src="runtime~main.407a790951764bb8c2a5.bundle.js"></script><script src="vendors~main.407a790951764bb8c2a5.bundle.js"></script><script src="main.407a790951764bb8c2a5.bundle.js"></script></body></html>