@salesforce/design-system-react 0.10.46 → 0.10.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/components/combobox/combobox.jsx +1 -1
  2. package/components/component-docs.json +1 -2
  3. package/components/popover/__tests__/popover.browser-test.jsx +28 -0
  4. package/components/progress-indicator.d.ts +29 -8
  5. package/design-system-react-components.js +62406 -0
  6. package/design-system-react-components.js.map +1 -0
  7. package/design-system-react-components.min.js +3 -0
  8. package/design-system-react-components.min.js.LICENSE.txt +83 -0
  9. package/design-system-react-components.min.js.map +1 -0
  10. package/design-system-react.js +73800 -0
  11. package/design-system-react.js.map +1 -0
  12. package/design-system-react.min.js +3 -0
  13. package/design-system-react.min.js.LICENSE.txt +83 -0
  14. package/design-system-react.min.js.map +1 -0
  15. package/lib/components/combobox/combobox.js +1 -1
  16. package/lib/components/component-docs.json +1 -2
  17. package/lib/components/popover/__tests__/popover.browser-test.jsx +28 -0
  18. package/lib/components/progress-indicator.d.ts +29 -8
  19. package/lib/design-system-react-components.min.js.LICENSE.txt +83 -0
  20. package/lib/design-system-react.min.js.LICENSE.txt +83 -0
  21. package/lib/package.json +1 -1
  22. package/lib/utilities/keyboard-navigable-dialog.js +6 -1
  23. package/module/components/combobox/combobox.js +1 -1
  24. package/module/components/combobox/combobox.js.map +1 -1
  25. package/module/components/component-docs.json +1 -2
  26. package/module/components/popover/__tests__/popover.browser-test.js +25 -0
  27. package/module/components/popover/__tests__/popover.browser-test.js.map +1 -1
  28. package/module/components/progress-indicator.d.ts +29 -8
  29. package/module/utilities/keyboard-navigable-dialog.js +4 -1
  30. package/module/utilities/keyboard-navigable-dialog.js.map +1 -1
  31. package/package.json +1 -1
  32. package/utilities/keyboard-navigable-dialog.js +3 -0
@@ -326,7 +326,7 @@ var propTypes = {
326
326
  subTitle: _propTypes.default.string,
327
327
  title: _propTypes.default.string,
328
328
  type: _propTypes.default.string,
329
- disabled: _propTypes.default.boolean,
329
+ disabled: _propTypes.default.bool,
330
330
  tooltipContent: _propTypes.default.node
331
331
  })),
332
332
 
@@ -4967,8 +4967,7 @@
4967
4967
  "required": false
4968
4968
  },
4969
4969
  "disabled": {
4970
- "name": "custom",
4971
- "raw": "PropTypes.boolean",
4970
+ "name": "bool",
4972
4971
  "required": false
4973
4972
  },
4974
4973
  "tooltipContent": {
@@ -238,6 +238,34 @@ describe('SLDSPopover', function () {
238
238
  const trigger = wrapper.find(defaultIds.trigger);
239
239
  trigger.simulate('click');
240
240
  });
241
+
242
+ it('stops event propagation after closing on ESC', function (done) {
243
+ const mockEvent = {
244
+ key: 'Esc',
245
+ keyCode: 27,
246
+ which: 27,
247
+ stopPropagation: sinon.spy(),
248
+ };
249
+ wrapper = mount(
250
+ <DemoComponent
251
+ onOpen={() => {
252
+ wrapper.update();
253
+ const popover = wrapper.find(`#${defaultIds.popover}`);
254
+ popover.simulate('keyDown', mockEvent);
255
+ }}
256
+ onKeyDown={() => {
257
+ setTimeout(() => {
258
+ expect(mockEvent.stopPropagation.callCount).to.equal(1);
259
+ done();
260
+ }, 0);
261
+ }}
262
+ />,
263
+ { attachTo: mountNode }
264
+ );
265
+
266
+ const trigger = wrapper.find(defaultIds.trigger);
267
+ trigger.simulate('click');
268
+ });
241
269
  });
242
270
  });
243
271
 
@@ -1,5 +1,20 @@
1
1
  declare module '@salesforce/design-system-react/components/progress-indicator' {
2
2
  import React from 'react';
3
+
4
+ type Step = {
5
+ id: string | number;
6
+ label: string | JSX.Element;
7
+ assistiveText?: string;
8
+ };
9
+
10
+ type StepState = {
11
+ isCompleted: boolean;
12
+ isDisabled: boolean;
13
+ isError: boolean;
14
+ isSelected: boolean;
15
+ step: Step;
16
+ };
17
+
3
18
  type Props = {
4
19
  /**
5
20
  * **Assistive text for accessibility**
@@ -23,16 +38,16 @@ declare module '@salesforce/design-system-react/components/progress-indicator' {
23
38
  /**
24
39
  * Stores all completed steps. It is an array of step objects.
25
40
  */
26
- completedSteps?: any[];
41
+ completedSteps?: Step[];
27
42
  /**
28
43
  * Stores all disabled steps. It is an array of step objects. Steps are still clickable/focusable,
29
44
  * this only disables cursor change and removes onClick and onFocus event callbacks.
30
45
  */
31
- disabledSteps?: any[];
46
+ disabledSteps?: Step[];
32
47
  /**
33
48
  * Stores all error steps. It is an array of step objects and usually there is only one error step, the current step. If an error occurs a second error icon should be placed to the left of related confirmation buttons (e.g. Cancel, Save) and an Error Popover should appear indicating there are errors. These additional items are NOT part of this component. This note was included for visibility purposes. Please refer to [SLDS website](https://www.lightningdesignsystem.com/components/progress-indicator/) for full details **
34
49
  */
35
- errorSteps?: any[];
50
+ errorSteps?: Step[];
36
51
  /**
37
52
  * HTML id for component.
38
53
  */
@@ -48,7 +63,10 @@ declare module '@salesforce/design-system-react/components/progress-indicator' {
48
63
  * <ProgressIndicator onStepClick={handleStepClick} />
49
64
  * ```
50
65
  */
51
- onStepClick?: (v: any) => any;
66
+ onStepClick?: (
67
+ event: React.ChangeEvent<HTMLInputElement>,
68
+ data: StepState
69
+ ) => void;
52
70
  /**
53
71
  * Triggered when an individual step is focused. By default, it receives an event and returns step state and the step object clicked: `{ isCompleted, isDisabled, isError, isSelected, step }`. Users are able to pass a callback handleClick function in forms of: <function name>(event, data) where data is the callback result.
54
72
  * ```
@@ -56,11 +74,14 @@ declare module '@salesforce/design-system-react/components/progress-indicator' {
56
74
  * <ProgressIndicator onStepFocus={handleStepFocus} />
57
75
  * ```
58
76
  */
59
- onStepFocus?: (v: any) => any;
77
+ onStepFocus?: (
78
+ event: React.ChangeEvent<HTMLInputElement>,
79
+ data: StepState
80
+ ) => void;
60
81
  /**
61
82
  * Represents the currently selected or active step. It is a step object.
62
83
  */
63
- selectedStep: Record<string, any> /*.isRequired*/;
84
+ selectedStep: Step /* .isRequired */;
64
85
  /**
65
86
  * It is an array of step objects in the following form:
66
87
  * ```
@@ -71,11 +92,11 @@ declare module '@salesforce/design-system-react/components/progress-indicator' {
71
92
  * }],
72
93
  * ```
73
94
  */
74
- steps: any[] /*.isRequired*/;
95
+ steps: Step[] /* .isRequired */;
75
96
  /**
76
97
  * Stores all steps with opened tooltips. This property is mainly for development purposes. The tooltip should only show on hover for the user.
77
98
  */
78
- tooltipIsOpenSteps?: any[];
99
+ tooltipIsOpenSteps?: Step[];
79
100
  /**
80
101
  * Determines component style.
81
102
  */
@@ -0,0 +1,83 @@
1
+ /*
2
+ object-assign
3
+ (c) Sindre Sorhus
4
+ @license MIT
5
+ */
6
+
7
+ /*!
8
+ Copyright (c) 2015 Jed Watson.
9
+ Based on code that is Copyright 2013-2015, Facebook, Inc.
10
+ All rights reserved.
11
+ */
12
+
13
+ /*!
14
+ Copyright (c) 2017 Jed Watson.
15
+ Licensed under the MIT License (MIT), see
16
+ http://jedwatson.github.io/classnames
17
+ */
18
+
19
+ /*!
20
+ * Adapted from jQuery UI core
21
+ *
22
+ * http://jqueryui.com
23
+ *
24
+ * Copyright 2014 jQuery Foundation and other contributors
25
+ * Released under the MIT license.
26
+ * http://jquery.org/license
27
+ *
28
+ * http://api.jqueryui.com/category/ui-core/
29
+ */
30
+
31
+ /*!
32
+ * design-system-react
33
+ * v0.10.47
34
+ * Copyright (c) 2015-present, Salesforce.com, Inc.
35
+ * All rights reserved.
36
+ *
37
+ * Redistribution and use in source and binary forms, with or without
38
+ * modification, are permitted provided that the following conditions are met:
39
+ * * Redistributions of source code must retain the above copyright
40
+ * notice, this list of conditions and the following disclaimer.
41
+ * * Redistributions in binary form must reproduce the above copyright
42
+ * notice, this list of conditions and the following disclaimer in the
43
+ * documentation and/or other materials provided with the distribution.
44
+ * * Neither the name of the Salesforce.com nor the
45
+ * names of its contributors may be used to endorse or promote products
46
+ * derived from this software without specific prior written permission.
47
+ *
48
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
49
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
50
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
51
+ * DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
52
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
53
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
54
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
55
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
56
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
57
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
58
+ */
59
+
60
+ /**!
61
+ * @fileOverview Kickass library to create and place poppers near their reference elements.
62
+ * @version 1.12.9
63
+ * @license
64
+ * Copyright (c) 2016 Federico Zivolo and contributors
65
+ *
66
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
67
+ * of this software and associated documentation files (the "Software"), to deal
68
+ * in the Software without restriction, including without limitation the rights
69
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
70
+ * copies of the Software, and to permit persons to whom the Software is
71
+ * furnished to do so, subject to the following conditions:
72
+ *
73
+ * The above copyright notice and this permission notice shall be included in all
74
+ * copies or substantial portions of the Software.
75
+ *
76
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
77
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
78
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
79
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
80
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
81
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
82
+ * SOFTWARE.
83
+ */
@@ -0,0 +1,83 @@
1
+ /*
2
+ object-assign
3
+ (c) Sindre Sorhus
4
+ @license MIT
5
+ */
6
+
7
+ /*!
8
+ Copyright (c) 2015 Jed Watson.
9
+ Based on code that is Copyright 2013-2015, Facebook, Inc.
10
+ All rights reserved.
11
+ */
12
+
13
+ /*!
14
+ Copyright (c) 2017 Jed Watson.
15
+ Licensed under the MIT License (MIT), see
16
+ http://jedwatson.github.io/classnames
17
+ */
18
+
19
+ /*!
20
+ * Adapted from jQuery UI core
21
+ *
22
+ * http://jqueryui.com
23
+ *
24
+ * Copyright 2014 jQuery Foundation and other contributors
25
+ * Released under the MIT license.
26
+ * http://jquery.org/license
27
+ *
28
+ * http://api.jqueryui.com/category/ui-core/
29
+ */
30
+
31
+ /*!
32
+ * design-system-react
33
+ * v0.10.47
34
+ * Copyright (c) 2015-present, Salesforce.com, Inc.
35
+ * All rights reserved.
36
+ *
37
+ * Redistribution and use in source and binary forms, with or without
38
+ * modification, are permitted provided that the following conditions are met:
39
+ * * Redistributions of source code must retain the above copyright
40
+ * notice, this list of conditions and the following disclaimer.
41
+ * * Redistributions in binary form must reproduce the above copyright
42
+ * notice, this list of conditions and the following disclaimer in the
43
+ * documentation and/or other materials provided with the distribution.
44
+ * * Neither the name of the Salesforce.com nor the
45
+ * names of its contributors may be used to endorse or promote products
46
+ * derived from this software without specific prior written permission.
47
+ *
48
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
49
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
50
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
51
+ * DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
52
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
53
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
54
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
55
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
56
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
57
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
58
+ */
59
+
60
+ /**!
61
+ * @fileOverview Kickass library to create and place poppers near their reference elements.
62
+ * @version 1.12.9
63
+ * @license
64
+ * Copyright (c) 2016 Federico Zivolo and contributors
65
+ *
66
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
67
+ * of this software and associated documentation files (the "Software"), to deal
68
+ * in the Software without restriction, including without limitation the rights
69
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
70
+ * copies of the Software, and to permit persons to whom the Software is
71
+ * furnished to do so, subject to the following conditions:
72
+ *
73
+ * The above copyright notice and this permission notice shall be included in all
74
+ * copies or substantial portions of the Software.
75
+ *
76
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
77
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
78
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
79
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
80
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
81
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
82
+ * SOFTWARE.
83
+ */
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "design-system-react",
3
- "version": "0.10.46",
3
+ "version": "0.10.47",
4
4
  "description": "Salesforce Lightning Design System for React",
5
5
  "license": "BSD-3-Clause",
6
6
  "engines": {},
@@ -9,6 +9,8 @@ var _reactDom = _interopRequireDefault(require("react-dom"));
9
9
 
10
10
  var _keyCode = _interopRequireDefault(require("./key-code"));
11
11
 
12
+ var _event = _interopRequireDefault(require("./event"));
13
+
12
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
15
 
14
16
  /* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */
@@ -44,7 +46,8 @@ var internalHandleClick = function internalHandleClick(_ref) {
44
46
  };
45
47
 
46
48
  var KeyboardNavigableDialog = function KeyboardNavigableDialog(_ref2) {
47
- var isOpen = _ref2.isOpen,
49
+ var event = _ref2.event,
50
+ isOpen = _ref2.isOpen,
48
51
  handleClick = _ref2.handleClick,
49
52
  keyCode = _ref2.keyCode,
50
53
  eventTarget = _ref2.eventTarget,
@@ -55,6 +58,8 @@ var KeyboardNavigableDialog = function KeyboardNavigableDialog(_ref2) {
55
58
  case _keyCode.default.ESCAPE:
56
59
  if (isOpen) {
57
60
  toggleOpen();
61
+
62
+ _event.default.trapEvent(event);
58
63
  }
59
64
 
60
65
  break;
@@ -296,7 +296,7 @@ var propTypes = {
296
296
  subTitle: PropTypes.string,
297
297
  title: PropTypes.string,
298
298
  type: PropTypes.string,
299
- disabled: PropTypes.boolean,
299
+ disabled: PropTypes.bool,
300
300
  tooltipContent: PropTypes.node
301
301
  })),
302
302