@zohodesk/components 1.0.0-alpha-247 → 1.0.0-alpha-248

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -32,6 +32,10 @@ In this Package, we Provide Some Basic Components to Build Web App
32
32
  - TextBoxIcon
33
33
  - Tooltip
34
34
 
35
+ # 1.0.0-alpha-248
36
+
37
+ - preventParentScroll props added for Box and Container
38
+
35
39
  # 1.0.0-alpha-247
36
40
 
37
41
  - Svg path changes
package/es/Card/Card.js CHANGED
@@ -61,13 +61,15 @@ export class CardContent extends Component {
61
61
  isScrollAttribute,
62
62
  dataId,
63
63
  shrink,
64
- customClass
64
+ customClass,
65
+ preventParentScroll
65
66
  } = this.props;
66
67
  return /*#__PURE__*/React.createElement(Box, {
67
68
  flexible: true,
68
69
  onScroll: onScroll,
69
70
  eleRef: eleRef,
70
71
  scroll: scroll,
72
+ preventParentScroll: preventParentScroll,
71
73
  isScrollAttribute: isScrollAttribute,
72
74
  dataId: dataId,
73
75
  shrink: shrink,
@@ -82,13 +84,15 @@ CardContent.propTypes = {
82
84
  eleRef: PropTypes.func,
83
85
  isScrollAttribute: PropTypes.bool,
84
86
  onScroll: PropTypes.func,
85
- scroll: PropTypes.oneOf(['horizontal', 'vertical', 'both', 'none']),
87
+ scroll: PropTypes.PropTypes.oneOf(['vertical', 'horizontal', 'both', 'none']),
86
88
  shrink: PropTypes.bool,
87
- customClass: PropTypes.string
89
+ customClass: PropTypes.string,
90
+ preventParentScroll: PropTypes.PropTypes.oneOf(['vertical', 'horizontal', 'both'])
88
91
  };
89
92
  CardContent.defaultProps = {
90
93
  isScrollAttribute: false,
91
94
  scroll: 'vertical',
95
+ preventParentScroll: 'vertical',
92
96
  dataId: 'CardContent',
93
97
  customClass: ''
94
98
  };
@@ -236,6 +240,7 @@ export default class Card extends Component {
236
240
  role: role,
237
241
  flexible: true,
238
242
  scroll: child.props.scroll,
243
+ preventParentScroll: child.props.preventParentScroll,
239
244
  onScroll: this.onScroll,
240
245
  eleRef: child.props.eleRef,
241
246
  isScrollAttribute: child.props.isScrollAttribute,
package/es/Layout/Box.js CHANGED
@@ -1,34 +1,12 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
2
+ import { BoxProps as propTypes } from './props/propTypes';
3
+ import { BoxDefaultProps as defaultProps } from './props/defaultProps';
3
4
  /* eslint css-modules/no-unused-class: 0 */
4
5
 
5
6
  import { createProps, getClass, setProps } from './utils';
6
7
  import style from './Layout.module.css';
7
8
  /* eslint-disable react/no-unused-prop-types*/
8
9
 
9
- const propTypes = {
10
- adjust: PropTypes.bool,
11
- align: PropTypes.oneOf(['start', 'end', 'center']),
12
- children: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
13
- className: PropTypes.string,
14
- column: PropTypes.oneOf(['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12']),
15
- dataId: PropTypes.string,
16
- eleRef: PropTypes.func,
17
- flexible: PropTypes.bool,
18
- hidden: PropTypes.arrayOf((propValue, key, componentName, location, propFullName) => {
19
- if (['xs', 'sm', 'md', 'lg', 'xl'].indexOf(propValue[key]) === -1) {
20
- return new Error(`Invalid prop \`${propFullName}\` supplied to` + ` \`${componentName}\`. Validation failed.`);
21
- }
22
- }),
23
- isFirst: PropTypes.bool,
24
- isLast: PropTypes.bool,
25
- isScrollAttribute: PropTypes.bool,
26
- scroll: PropTypes.PropTypes.oneOf(['vertical', 'horizontal', 'both', 'none']),
27
- shrink: PropTypes.bool,
28
- tagName: PropTypes.string,
29
- tourId: PropTypes.string
30
- };
31
-
32
10
  function getBoxClassNames(props) {
33
11
  const {
34
12
  hidden,
@@ -40,7 +18,8 @@ function getBoxClassNames(props) {
40
18
  shrink,
41
19
  column,
42
20
  align,
43
- scroll
21
+ scroll,
22
+ preventParentScroll
44
23
  } = props;
45
24
  const modificators = [className];
46
25
 
@@ -100,6 +79,16 @@ function getBoxClassNames(props) {
100
79
  modificators.push(getClass(style, scrollClass));
101
80
  }
102
81
 
82
+ if (preventParentScroll) {
83
+ let ParentScrollClassMapping = {
84
+ horizontal: 'preventScrollBubbleX',
85
+ vertical: 'preventScrollBubbleY',
86
+ both: 'preventScrollBubbleBoth'
87
+ };
88
+ let parentScrollClass = ParentScrollClassMapping[preventParentScroll];
89
+ modificators.push(getClass(style, parentScrollClass));
90
+ }
91
+
103
92
  return modificators;
104
93
  }
105
94
 
@@ -120,8 +109,4 @@ export default function Box(props) {
120
109
  return /*#__PURE__*/React.createElement(tagName, childProps);
121
110
  }
122
111
  Box.propTypes = propTypes;
123
- Box.defaultProps = {
124
- dataId: 'boxComponent',
125
- isScrollAttribute: false,
126
- tagName: 'div'
127
- };
112
+ Box.defaultProps = defaultProps;
@@ -1,29 +1,12 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
2
+ import { ContainerProps as propTypes } from './props/propTypes';
3
+ import { ContainerDefaultProps as defaultProps } from './props/defaultProps';
3
4
  /* eslint css-modules/no-unused-class: 0 */
4
5
 
5
6
  import { createProps, getClass, setProps } from './utils';
6
7
  import style from './Layout.module.css';
7
8
  /* eslint-disable react/no-unused-prop-types*/
8
9
 
9
- const propTypes = {
10
- align: PropTypes.oneOf(['vertical', 'horizontal', 'both', 'top', 'right', 'bottom', 'left', 'between', 'around', 'baseline']),
11
- alignBox: PropTypes.oneOf(['row', 'column', 'row-reverse', 'column-reverse']),
12
- alignContent: PropTypes.oneOf(['start', 'end', 'center', 'around', 'between']),
13
- children: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
14
- className: PropTypes.string,
15
- dataId: PropTypes.string,
16
- eleRef: PropTypes.func,
17
- hidden: PropTypes.array,
18
- isCover: PropTypes.bool,
19
- isInline: PropTypes.bool,
20
- isScrollAttribute: PropTypes.bool,
21
- scroll: PropTypes.oneOf(['vertical', 'horizontal', 'both', 'none']),
22
- tagName: PropTypes.string,
23
- tourId: PropTypes.string,
24
- wrap: PropTypes.oneOf(['wrap', 'wrap-reverse', 'nowrap'])
25
- };
26
-
27
10
  function getContainerClassNames(props) {
28
11
  const {
29
12
  hidden,
@@ -34,7 +17,8 @@ function getContainerClassNames(props) {
34
17
  alignContent,
35
18
  wrap,
36
19
  align,
37
- scroll
20
+ scroll,
21
+ preventParentScroll
38
22
  } = props;
39
23
  const modificators = [className];
40
24
 
@@ -112,6 +96,16 @@ function getContainerClassNames(props) {
112
96
  modificators.push(getClass(style, scrollClass));
113
97
  }
114
98
 
99
+ if (preventParentScroll) {
100
+ let ParentScrollClassMapping = {
101
+ horizontal: 'preventScrollBubbleX',
102
+ vertical: 'preventScrollBubbleY',
103
+ both: 'preventScrollBubbleBoth'
104
+ };
105
+ let parentScrollClass = ParentScrollClassMapping[preventParentScroll];
106
+ modificators.push(getClass(style, parentScrollClass));
107
+ }
108
+
115
109
  return modificators;
116
110
  }
117
111
 
@@ -132,10 +126,4 @@ export default function Container(props) {
132
126
  return /*#__PURE__*/React.createElement(tagName, childProps);
133
127
  }
134
128
  Container.propTypes = propTypes;
135
- Container.defaultProps = {
136
- dataId: 'containerComponent',
137
- isScrollAttribute: false,
138
- isCover: true,
139
- alignBox: 'column',
140
- tagName: 'div'
141
- };
129
+ Container.defaultProps = defaultProps;
@@ -118,6 +118,18 @@
118
118
  overflow: auto;
119
119
  }
120
120
 
121
+ .preventScrollBubbleX {
122
+ overscroll-behavior-x: contain;
123
+ }
124
+
125
+ .preventScrollBubbleY {
126
+ overscroll-behavior-y: contain;
127
+ }
128
+
129
+ .preventScrollBubbleBoth {
130
+ overscroll-behavior: contain;
131
+ }
132
+
121
133
  /*Column Specification*/
122
134
 
123
135
  .col-1 {
@@ -321,4 +333,4 @@
321
333
  .hidden-screen-xl {
322
334
  display: none;
323
335
  }
324
- }
336
+ }
@@ -6,8 +6,7 @@ export default class Layout__four_Column extends React.Component {
6
6
  return /*#__PURE__*/React.createElement("div", {
7
7
  style: {
8
8
  height: '500px',
9
- maxWidth: '1200px',
10
- margin: '0 auto'
9
+ width: '100%'
11
10
  }
12
11
  }, /*#__PURE__*/React.createElement(CodeExtract, null, /*#__PURE__*/React.createElement(Container, {
13
12
  alignBox: "column",
@@ -24,56 +23,51 @@ export default class Layout__four_Column extends React.Component {
24
23
  style: {
25
24
  background: '#f5f5f5'
26
25
  }
27
- }, /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement("div", {
26
+ }, /*#__PURE__*/React.createElement(Box, {
28
27
  style: {
29
28
  background: '#666',
30
29
  height: '45px'
31
30
  }
32
- })), /*#__PURE__*/React.createElement(Box, {
31
+ }), /*#__PURE__*/React.createElement(Box, {
33
32
  flexible: true
34
33
  }, /*#__PURE__*/React.createElement(Container, {
35
34
  alignBox: "row",
36
35
  style: {
37
36
  background: '#f5f5f5'
38
- },
39
- align: "top"
37
+ }
40
38
  }, /*#__PURE__*/React.createElement(Box, {
41
- hidden: ['xs']
42
- }, /*#__PURE__*/React.createElement("div", {
39
+ hidden: ['xs'],
43
40
  style: {
44
41
  background: 'var(--dot_black)',
45
42
  width: '220px',
46
43
  height: '100%'
47
44
  }
48
- })), /*#__PURE__*/React.createElement(Box, {
49
- hidden: ['xs']
50
- }, /*#__PURE__*/React.createElement("div", {
45
+ }), /*#__PURE__*/React.createElement(Box, {
46
+ flexible: true,
47
+ hidden: ['xs'],
51
48
  style: {
52
49
  background: '#4e524e',
53
- width: '320px',
54
50
  height: '100%'
55
51
  }
56
- })), /*#__PURE__*/React.createElement(Box, {
57
- flexible: true
58
- }, /*#__PURE__*/React.createElement("div", {
52
+ }), /*#__PURE__*/React.createElement(Box, {
53
+ flexible: true,
59
54
  style: {
60
55
  background: '#909090',
61
56
  height: '100%'
62
57
  }
63
- })), /*#__PURE__*/React.createElement(Box, {
64
- hidden: ['sm', 'xs', 'md']
65
- }, /*#__PURE__*/React.createElement("div", {
58
+ }), /*#__PURE__*/React.createElement(Box, {
59
+ hidden: ['sm', 'xs', 'md'],
66
60
  style: {
67
61
  background: '#4e524e',
68
- width: '320px',
69
62
  height: '100%'
70
- }
71
- })))))), /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement("div", {
63
+ },
64
+ flexible: true
65
+ }))))), /*#__PURE__*/React.createElement(Box, {
72
66
  style: {
73
67
  background: '#f1f1f1',
74
68
  height: '28px'
75
69
  }
76
- })))));
70
+ }))));
77
71
  }
78
72
 
79
73
  }
@@ -0,0 +1,12 @@
1
+ export const BoxDefaultProps = {
2
+ dataId: 'boxComponent',
3
+ isScrollAttribute: false,
4
+ tagName: 'div'
5
+ };
6
+ export const ContainerDefaultProps = {
7
+ dataId: 'containerComponent',
8
+ isScrollAttribute: false,
9
+ isCover: true,
10
+ alignBox: 'column',
11
+ tagName: 'div'
12
+ };
@@ -0,0 +1,42 @@
1
+ import PropTypes from 'prop-types';
2
+ export const BoxProps = {
3
+ adjust: PropTypes.bool,
4
+ align: PropTypes.oneOf(['start', 'end', 'center']),
5
+ children: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
6
+ className: PropTypes.string,
7
+ column: PropTypes.oneOf(['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12']),
8
+ dataId: PropTypes.string,
9
+ eleRef: PropTypes.func,
10
+ flexible: PropTypes.bool,
11
+ hidden: PropTypes.arrayOf((propValue, key, componentName, location, propFullName) => {
12
+ if (['xs', 'sm', 'md', 'lg', 'xl'].indexOf(propValue[key]) === -1) {
13
+ return new Error(`Invalid prop \`${propFullName}\` supplied to` + ` \`${componentName}\`. Validation failed.`);
14
+ }
15
+ }),
16
+ isFirst: PropTypes.bool,
17
+ isLast: PropTypes.bool,
18
+ isScrollAttribute: PropTypes.bool,
19
+ scroll: PropTypes.PropTypes.oneOf(['vertical', 'horizontal', 'both', 'none']),
20
+ shrink: PropTypes.bool,
21
+ tagName: PropTypes.string,
22
+ tourId: PropTypes.string,
23
+ preventParentScroll: PropTypes.PropTypes.oneOf(['vertical', 'horizontal', 'both'])
24
+ };
25
+ export const ContainerProps = {
26
+ align: PropTypes.oneOf(['vertical', 'horizontal', 'both', 'top', 'right', 'bottom', 'left', 'between', 'around', 'baseline']),
27
+ alignBox: PropTypes.oneOf(['row', 'column', 'row-reverse', 'column-reverse']),
28
+ alignContent: PropTypes.oneOf(['start', 'end', 'center', 'around', 'between']),
29
+ children: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
30
+ className: PropTypes.string,
31
+ dataId: PropTypes.string,
32
+ eleRef: PropTypes.func,
33
+ hidden: PropTypes.array,
34
+ isCover: PropTypes.bool,
35
+ isInline: PropTypes.bool,
36
+ isScrollAttribute: PropTypes.bool,
37
+ scroll: PropTypes.oneOf(['vertical', 'horizontal', 'both', 'none']),
38
+ tagName: PropTypes.string,
39
+ tourId: PropTypes.string,
40
+ wrap: PropTypes.oneOf(['wrap', 'wrap-reverse', 'nowrap']),
41
+ preventParentScroll: PropTypes.PropTypes.oneOf(['vertical', 'horizontal', 'both'])
42
+ };
@@ -23,6 +23,19 @@
23
23
  overflow: auto;
24
24
  }
25
25
 
26
+ .preventScrollBubbleX {
27
+ overscroll-behavior-x: contain;
28
+ }
29
+
30
+ .preventScrollBubbleY {
31
+ overscroll-behavior-y: contain;
32
+ }
33
+
34
+ .preventScrollBubbleBoth {
35
+ overscroll-behavior: contain;
36
+ }
37
+
38
+
26
39
  /* --Position Props-- */
27
40
  .posrel {
28
41
  position: relative;
@@ -53,14 +66,17 @@
53
66
  .clboth {
54
67
  clear: both;
55
68
  }
69
+
56
70
  .disable,
57
71
  .disabled {
58
72
  position: relative;
59
73
  }
74
+
60
75
  .disable::after {
61
76
  cursor: no-drop;
62
77
  background: var(--zdt_disable_bg);
63
78
  }
79
+
64
80
  .disable::after,
65
81
  .disabled::after,
66
82
  .readonly::after {
@@ -71,10 +87,12 @@
71
87
  content: '';
72
88
  user-select: none;
73
89
  }
90
+
74
91
  [dir=ltr] .disable::after, [dir=ltr] .disabled::after, [dir=ltr] .readonly::after {
75
92
  left: 0;
76
93
  right: 0;
77
94
  }
95
+
78
96
  [dir=rtl] .disable::after, [dir=rtl] .disabled::after, [dir=rtl] .readonly::after {
79
97
  right: 0;
80
98
  left: 0;
@@ -83,6 +101,7 @@
83
101
  .disabled, .readonly {
84
102
  cursor: not-allowed;
85
103
  }
104
+
86
105
  .disabled::after, .readonly::after {
87
106
  cursor: not-allowed;
88
107
  }
@@ -217,6 +236,7 @@
217
236
  -ms-flex-align: end;
218
237
  align-items: flex-end;
219
238
  }
239
+
220
240
  .alignBaseline {
221
241
  -webkit-box-align: baseline;
222
242
  -ms-flex-align: baseline;
@@ -466,6 +486,7 @@
466
486
  word-wrap: normal;
467
487
  text-overflow: ellipsis;
468
488
  }
489
+
469
490
  .clamp {
470
491
  -webkit-line-clamp: 2;
471
492
  -webkit-box-orient: vertical;
@@ -492,11 +513,13 @@
492
513
  position: sticky;
493
514
  position: -webkit-sticky;
494
515
  }
495
- .fitContWidth{
516
+
517
+ .fitContWidth {
496
518
  width: fit-content;
497
519
  width: -moz-fit-content;
498
520
  }
499
- .fitContHeight{
521
+
522
+ .fitContHeight {
500
523
  height: fit-content;
501
524
  height: -moz-fit-content;
502
- }
525
+ }
package/lib/Card/Card.js CHANGED
@@ -131,12 +131,14 @@ var CardContent = /*#__PURE__*/function (_Component2) {
131
131
  isScrollAttribute = _this$props2.isScrollAttribute,
132
132
  dataId = _this$props2.dataId,
133
133
  shrink = _this$props2.shrink,
134
- customClass = _this$props2.customClass;
134
+ customClass = _this$props2.customClass,
135
+ preventParentScroll = _this$props2.preventParentScroll;
135
136
  return /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
136
137
  flexible: true,
137
138
  onScroll: onScroll,
138
139
  eleRef: eleRef,
139
140
  scroll: scroll,
141
+ preventParentScroll: preventParentScroll,
140
142
  isScrollAttribute: isScrollAttribute,
141
143
  dataId: dataId,
142
144
  shrink: shrink,
@@ -155,13 +157,15 @@ CardContent.propTypes = {
155
157
  eleRef: _propTypes["default"].func,
156
158
  isScrollAttribute: _propTypes["default"].bool,
157
159
  onScroll: _propTypes["default"].func,
158
- scroll: _propTypes["default"].oneOf(['horizontal', 'vertical', 'both', 'none']),
160
+ scroll: _propTypes["default"].PropTypes.oneOf(['vertical', 'horizontal', 'both', 'none']),
159
161
  shrink: _propTypes["default"].bool,
160
- customClass: _propTypes["default"].string
162
+ customClass: _propTypes["default"].string,
163
+ preventParentScroll: _propTypes["default"].PropTypes.oneOf(['vertical', 'horizontal', 'both'])
161
164
  };
162
165
  CardContent.defaultProps = {
163
166
  isScrollAttribute: false,
164
167
  scroll: 'vertical',
168
+ preventParentScroll: 'vertical',
165
169
  dataId: 'CardContent',
166
170
  customClass: ''
167
171
  };
@@ -312,6 +316,7 @@ var Card = /*#__PURE__*/function (_Component3) {
312
316
  role: role,
313
317
  flexible: true,
314
318
  scroll: child.props.scroll,
319
+ preventParentScroll: child.props.preventParentScroll,
315
320
  onScroll: _this4.onScroll,
316
321
  eleRef: child.props.eleRef,
317
322
  isScrollAttribute: child.props.isScrollAttribute,
package/lib/Layout/Box.js CHANGED
@@ -8,7 +8,9 @@ exports.getBoxProps = getBoxProps;
8
8
 
9
9
  var _react = _interopRequireDefault(require("react"));
10
10
 
11
- var _propTypes = _interopRequireDefault(require("prop-types"));
11
+ var _propTypes = require("./props/propTypes");
12
+
13
+ var _defaultProps = require("./props/defaultProps");
12
14
 
13
15
  var _utils = require("./utils");
14
16
 
@@ -19,29 +21,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
19
21
  /* eslint css-modules/no-unused-class: 0 */
20
22
 
21
23
  /* eslint-disable react/no-unused-prop-types*/
22
- var propTypes = {
23
- adjust: _propTypes["default"].bool,
24
- align: _propTypes["default"].oneOf(['start', 'end', 'center']),
25
- children: _propTypes["default"].oneOfType([_propTypes["default"].node, _propTypes["default"].string]),
26
- className: _propTypes["default"].string,
27
- column: _propTypes["default"].oneOf(['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12']),
28
- dataId: _propTypes["default"].string,
29
- eleRef: _propTypes["default"].func,
30
- flexible: _propTypes["default"].bool,
31
- hidden: _propTypes["default"].arrayOf(function (propValue, key, componentName, location, propFullName) {
32
- if (['xs', 'sm', 'md', 'lg', 'xl'].indexOf(propValue[key]) === -1) {
33
- return new Error("Invalid prop `".concat(propFullName, "` supplied to") + " `".concat(componentName, "`. Validation failed."));
34
- }
35
- }),
36
- isFirst: _propTypes["default"].bool,
37
- isLast: _propTypes["default"].bool,
38
- isScrollAttribute: _propTypes["default"].bool,
39
- scroll: _propTypes["default"].PropTypes.oneOf(['vertical', 'horizontal', 'both', 'none']),
40
- shrink: _propTypes["default"].bool,
41
- tagName: _propTypes["default"].string,
42
- tourId: _propTypes["default"].string
43
- };
44
-
45
24
  function getBoxClassNames(props) {
46
25
  var hidden = props.hidden,
47
26
  className = props.className,
@@ -52,7 +31,8 @@ function getBoxClassNames(props) {
52
31
  shrink = props.shrink,
53
32
  column = props.column,
54
33
  align = props.align,
55
- scroll = props.scroll;
34
+ scroll = props.scroll,
35
+ preventParentScroll = props.preventParentScroll;
56
36
  var modificators = [className];
57
37
 
58
38
  if (flexible && !adjust) {
@@ -111,11 +91,21 @@ function getBoxClassNames(props) {
111
91
  modificators.push((0, _utils.getClass)(_LayoutModule["default"], scrollClass));
112
92
  }
113
93
 
94
+ if (preventParentScroll) {
95
+ var ParentScrollClassMapping = {
96
+ horizontal: 'preventScrollBubbleX',
97
+ vertical: 'preventScrollBubbleY',
98
+ both: 'preventScrollBubbleBoth'
99
+ };
100
+ var parentScrollClass = ParentScrollClassMapping[preventParentScroll];
101
+ modificators.push((0, _utils.getClass)(_LayoutModule["default"], parentScrollClass));
102
+ }
103
+
114
104
  return modificators;
115
105
  }
116
106
 
117
107
  function getBoxProps(props) {
118
- return (0, _utils.createProps)(propTypes, props, getBoxClassNames(props));
108
+ return (0, _utils.createProps)(_propTypes.BoxProps, props, getBoxClassNames(props));
119
109
  }
120
110
 
121
111
  function Box(props) {
@@ -130,9 +120,5 @@ function Box(props) {
130
120
  return /*#__PURE__*/_react["default"].createElement(tagName, childProps);
131
121
  }
132
122
 
133
- Box.propTypes = propTypes;
134
- Box.defaultProps = {
135
- dataId: 'boxComponent',
136
- isScrollAttribute: false,
137
- tagName: 'div'
138
- };
123
+ Box.propTypes = _propTypes.BoxProps;
124
+ Box.defaultProps = _defaultProps.BoxDefaultProps;
@@ -8,7 +8,9 @@ exports.getContainerProps = getContainerProps;
8
8
 
9
9
  var _react = _interopRequireDefault(require("react"));
10
10
 
11
- var _propTypes = _interopRequireDefault(require("prop-types"));
11
+ var _propTypes = require("./props/propTypes");
12
+
13
+ var _defaultProps = require("./props/defaultProps");
12
14
 
13
15
  var _utils = require("./utils");
14
16
 
@@ -19,24 +21,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
19
21
  /* eslint css-modules/no-unused-class: 0 */
20
22
 
21
23
  /* eslint-disable react/no-unused-prop-types*/
22
- var propTypes = {
23
- align: _propTypes["default"].oneOf(['vertical', 'horizontal', 'both', 'top', 'right', 'bottom', 'left', 'between', 'around', 'baseline']),
24
- alignBox: _propTypes["default"].oneOf(['row', 'column', 'row-reverse', 'column-reverse']),
25
- alignContent: _propTypes["default"].oneOf(['start', 'end', 'center', 'around', 'between']),
26
- children: _propTypes["default"].oneOfType([_propTypes["default"].node, _propTypes["default"].string]),
27
- className: _propTypes["default"].string,
28
- dataId: _propTypes["default"].string,
29
- eleRef: _propTypes["default"].func,
30
- hidden: _propTypes["default"].array,
31
- isCover: _propTypes["default"].bool,
32
- isInline: _propTypes["default"].bool,
33
- isScrollAttribute: _propTypes["default"].bool,
34
- scroll: _propTypes["default"].oneOf(['vertical', 'horizontal', 'both', 'none']),
35
- tagName: _propTypes["default"].string,
36
- tourId: _propTypes["default"].string,
37
- wrap: _propTypes["default"].oneOf(['wrap', 'wrap-reverse', 'nowrap'])
38
- };
39
-
40
24
  function getContainerClassNames(props) {
41
25
  var hidden = props.hidden,
42
26
  className = props.className,
@@ -46,7 +30,8 @@ function getContainerClassNames(props) {
46
30
  alignContent = props.alignContent,
47
31
  wrap = props.wrap,
48
32
  align = props.align,
49
- scroll = props.scroll;
33
+ scroll = props.scroll,
34
+ preventParentScroll = props.preventParentScroll;
50
35
  var modificators = [className];
51
36
 
52
37
  if (hidden) {
@@ -123,11 +108,21 @@ function getContainerClassNames(props) {
123
108
  modificators.push((0, _utils.getClass)(_LayoutModule["default"], scrollClass));
124
109
  }
125
110
 
111
+ if (preventParentScroll) {
112
+ var ParentScrollClassMapping = {
113
+ horizontal: 'preventScrollBubbleX',
114
+ vertical: 'preventScrollBubbleY',
115
+ both: 'preventScrollBubbleBoth'
116
+ };
117
+ var parentScrollClass = ParentScrollClassMapping[preventParentScroll];
118
+ modificators.push((0, _utils.getClass)(_LayoutModule["default"], parentScrollClass));
119
+ }
120
+
126
121
  return modificators;
127
122
  }
128
123
 
129
124
  function getContainerProps(props) {
130
- return (0, _utils.createProps)(propTypes, props, getContainerClassNames(props));
125
+ return (0, _utils.createProps)(_propTypes.ContainerProps, props, getContainerClassNames(props));
131
126
  }
132
127
 
133
128
  function Container(props) {
@@ -142,11 +137,5 @@ function Container(props) {
142
137
  return /*#__PURE__*/_react["default"].createElement(tagName, childProps);
143
138
  }
144
139
 
145
- Container.propTypes = propTypes;
146
- Container.defaultProps = {
147
- dataId: 'containerComponent',
148
- isScrollAttribute: false,
149
- isCover: true,
150
- alignBox: 'column',
151
- tagName: 'div'
152
- };
140
+ Container.propTypes = _propTypes.ContainerProps;
141
+ Container.defaultProps = _defaultProps.ContainerDefaultProps;
@@ -118,6 +118,18 @@
118
118
  overflow: auto;
119
119
  }
120
120
 
121
+ .preventScrollBubbleX {
122
+ overscroll-behavior-x: contain;
123
+ }
124
+
125
+ .preventScrollBubbleY {
126
+ overscroll-behavior-y: contain;
127
+ }
128
+
129
+ .preventScrollBubbleBoth {
130
+ overscroll-behavior: contain;
131
+ }
132
+
121
133
  /*Column Specification*/
122
134
 
123
135
  .col-1 {
@@ -321,4 +333,4 @@
321
333
  .hidden-screen-xl {
322
334
  display: none;
323
335
  }
324
- }
336
+ }
@@ -52,8 +52,7 @@ var Layout__four_Column = /*#__PURE__*/function (_React$Component) {
52
52
  return /*#__PURE__*/_react["default"].createElement("div", {
53
53
  style: {
54
54
  height: '500px',
55
- maxWidth: '1200px',
56
- margin: '0 auto'
55
+ width: '100%'
57
56
  }
58
57
  }, /*#__PURE__*/_react["default"].createElement(_CodeExtractor["default"], null, /*#__PURE__*/_react["default"].createElement(_.Container, {
59
58
  alignBox: "column",
@@ -70,56 +69,51 @@ var Layout__four_Column = /*#__PURE__*/function (_React$Component) {
70
69
  style: {
71
70
  background: '#f5f5f5'
72
71
  }
73
- }, /*#__PURE__*/_react["default"].createElement(_.Box, null, /*#__PURE__*/_react["default"].createElement("div", {
72
+ }, /*#__PURE__*/_react["default"].createElement(_.Box, {
74
73
  style: {
75
74
  background: '#666',
76
75
  height: '45px'
77
76
  }
78
- })), /*#__PURE__*/_react["default"].createElement(_.Box, {
77
+ }), /*#__PURE__*/_react["default"].createElement(_.Box, {
79
78
  flexible: true
80
79
  }, /*#__PURE__*/_react["default"].createElement(_.Container, {
81
80
  alignBox: "row",
82
81
  style: {
83
82
  background: '#f5f5f5'
84
- },
85
- align: "top"
83
+ }
86
84
  }, /*#__PURE__*/_react["default"].createElement(_.Box, {
87
- hidden: ['xs']
88
- }, /*#__PURE__*/_react["default"].createElement("div", {
85
+ hidden: ['xs'],
89
86
  style: {
90
87
  background: 'var(--dot_black)',
91
88
  width: '220px',
92
89
  height: '100%'
93
90
  }
94
- })), /*#__PURE__*/_react["default"].createElement(_.Box, {
95
- hidden: ['xs']
96
- }, /*#__PURE__*/_react["default"].createElement("div", {
91
+ }), /*#__PURE__*/_react["default"].createElement(_.Box, {
92
+ flexible: true,
93
+ hidden: ['xs'],
97
94
  style: {
98
95
  background: '#4e524e',
99
- width: '320px',
100
96
  height: '100%'
101
97
  }
102
- })), /*#__PURE__*/_react["default"].createElement(_.Box, {
103
- flexible: true
104
- }, /*#__PURE__*/_react["default"].createElement("div", {
98
+ }), /*#__PURE__*/_react["default"].createElement(_.Box, {
99
+ flexible: true,
105
100
  style: {
106
101
  background: '#909090',
107
102
  height: '100%'
108
103
  }
109
- })), /*#__PURE__*/_react["default"].createElement(_.Box, {
110
- hidden: ['sm', 'xs', 'md']
111
- }, /*#__PURE__*/_react["default"].createElement("div", {
104
+ }), /*#__PURE__*/_react["default"].createElement(_.Box, {
105
+ hidden: ['sm', 'xs', 'md'],
112
106
  style: {
113
107
  background: '#4e524e',
114
- width: '320px',
115
108
  height: '100%'
116
- }
117
- })))))), /*#__PURE__*/_react["default"].createElement(_.Box, null, /*#__PURE__*/_react["default"].createElement("div", {
109
+ },
110
+ flexible: true
111
+ }))))), /*#__PURE__*/_react["default"].createElement(_.Box, {
118
112
  style: {
119
113
  background: '#f1f1f1',
120
114
  height: '28px'
121
115
  }
122
- })))));
116
+ }))));
123
117
  }
124
118
  }]);
125
119
 
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ContainerDefaultProps = exports.BoxDefaultProps = void 0;
7
+ var BoxDefaultProps = {
8
+ dataId: 'boxComponent',
9
+ isScrollAttribute: false,
10
+ tagName: 'div'
11
+ };
12
+ exports.BoxDefaultProps = BoxDefaultProps;
13
+ var ContainerDefaultProps = {
14
+ dataId: 'containerComponent',
15
+ isScrollAttribute: false,
16
+ isCover: true,
17
+ alignBox: 'column',
18
+ tagName: 'div'
19
+ };
20
+ exports.ContainerDefaultProps = ContainerDefaultProps;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ContainerProps = exports.BoxProps = void 0;
7
+
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
+
12
+ var BoxProps = {
13
+ adjust: _propTypes["default"].bool,
14
+ align: _propTypes["default"].oneOf(['start', 'end', 'center']),
15
+ children: _propTypes["default"].oneOfType([_propTypes["default"].node, _propTypes["default"].string]),
16
+ className: _propTypes["default"].string,
17
+ column: _propTypes["default"].oneOf(['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12']),
18
+ dataId: _propTypes["default"].string,
19
+ eleRef: _propTypes["default"].func,
20
+ flexible: _propTypes["default"].bool,
21
+ hidden: _propTypes["default"].arrayOf(function (propValue, key, componentName, location, propFullName) {
22
+ if (['xs', 'sm', 'md', 'lg', 'xl'].indexOf(propValue[key]) === -1) {
23
+ return new Error("Invalid prop `".concat(propFullName, "` supplied to") + " `".concat(componentName, "`. Validation failed."));
24
+ }
25
+ }),
26
+ isFirst: _propTypes["default"].bool,
27
+ isLast: _propTypes["default"].bool,
28
+ isScrollAttribute: _propTypes["default"].bool,
29
+ scroll: _propTypes["default"].PropTypes.oneOf(['vertical', 'horizontal', 'both', 'none']),
30
+ shrink: _propTypes["default"].bool,
31
+ tagName: _propTypes["default"].string,
32
+ tourId: _propTypes["default"].string,
33
+ preventParentScroll: _propTypes["default"].PropTypes.oneOf(['vertical', 'horizontal', 'both'])
34
+ };
35
+ exports.BoxProps = BoxProps;
36
+ var ContainerProps = {
37
+ align: _propTypes["default"].oneOf(['vertical', 'horizontal', 'both', 'top', 'right', 'bottom', 'left', 'between', 'around', 'baseline']),
38
+ alignBox: _propTypes["default"].oneOf(['row', 'column', 'row-reverse', 'column-reverse']),
39
+ alignContent: _propTypes["default"].oneOf(['start', 'end', 'center', 'around', 'between']),
40
+ children: _propTypes["default"].oneOfType([_propTypes["default"].node, _propTypes["default"].string]),
41
+ className: _propTypes["default"].string,
42
+ dataId: _propTypes["default"].string,
43
+ eleRef: _propTypes["default"].func,
44
+ hidden: _propTypes["default"].array,
45
+ isCover: _propTypes["default"].bool,
46
+ isInline: _propTypes["default"].bool,
47
+ isScrollAttribute: _propTypes["default"].bool,
48
+ scroll: _propTypes["default"].oneOf(['vertical', 'horizontal', 'both', 'none']),
49
+ tagName: _propTypes["default"].string,
50
+ tourId: _propTypes["default"].string,
51
+ wrap: _propTypes["default"].oneOf(['wrap', 'wrap-reverse', 'nowrap']),
52
+ preventParentScroll: _propTypes["default"].PropTypes.oneOf(['vertical', 'horizontal', 'both'])
53
+ };
54
+ exports.ContainerProps = ContainerProps;
@@ -23,6 +23,19 @@
23
23
  overflow: auto;
24
24
  }
25
25
 
26
+ .preventScrollBubbleX {
27
+ overscroll-behavior-x: contain;
28
+ }
29
+
30
+ .preventScrollBubbleY {
31
+ overscroll-behavior-y: contain;
32
+ }
33
+
34
+ .preventScrollBubbleBoth {
35
+ overscroll-behavior: contain;
36
+ }
37
+
38
+
26
39
  /* --Position Props-- */
27
40
  .posrel {
28
41
  position: relative;
@@ -53,14 +66,17 @@
53
66
  .clboth {
54
67
  clear: both;
55
68
  }
69
+
56
70
  .disable,
57
71
  .disabled {
58
72
  position: relative;
59
73
  }
74
+
60
75
  .disable::after {
61
76
  cursor: no-drop;
62
77
  background: var(--zdt_disable_bg);
63
78
  }
79
+
64
80
  .disable::after,
65
81
  .disabled::after,
66
82
  .readonly::after {
@@ -71,10 +87,12 @@
71
87
  content: '';
72
88
  user-select: none;
73
89
  }
90
+
74
91
  [dir=ltr] .disable::after, [dir=ltr] .disabled::after, [dir=ltr] .readonly::after {
75
92
  left: 0;
76
93
  right: 0;
77
94
  }
95
+
78
96
  [dir=rtl] .disable::after, [dir=rtl] .disabled::after, [dir=rtl] .readonly::after {
79
97
  right: 0;
80
98
  left: 0;
@@ -83,6 +101,7 @@
83
101
  .disabled, .readonly {
84
102
  cursor: not-allowed;
85
103
  }
104
+
86
105
  .disabled::after, .readonly::after {
87
106
  cursor: not-allowed;
88
107
  }
@@ -217,6 +236,7 @@
217
236
  -ms-flex-align: end;
218
237
  align-items: flex-end;
219
238
  }
239
+
220
240
  .alignBaseline {
221
241
  -webkit-box-align: baseline;
222
242
  -ms-flex-align: baseline;
@@ -466,6 +486,7 @@
466
486
  word-wrap: normal;
467
487
  text-overflow: ellipsis;
468
488
  }
489
+
469
490
  .clamp {
470
491
  -webkit-line-clamp: 2;
471
492
  -webkit-box-orient: vertical;
@@ -492,11 +513,13 @@
492
513
  position: sticky;
493
514
  position: -webkit-sticky;
494
515
  }
495
- .fitContWidth{
516
+
517
+ .fitContWidth {
496
518
  width: fit-content;
497
519
  width: -moz-fit-content;
498
520
  }
499
- .fitContHeight{
521
+
522
+ .fitContHeight {
500
523
  height: fit-content;
501
524
  height: -moz-fit-content;
502
- }
525
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/components",
3
- "version": "1.0.0-alpha-247",
3
+ "version": "1.0.0-alpha-248",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.js",
6
6
  "jsnext:main": "es/index.js",
@@ -16,8 +16,9 @@
16
16
  "init": "npm run clean && cd ../assets && npm run componentsassets && cd ../components && npm run build:variables",
17
17
  "build:variables": "node ./preprocess/index",
18
18
  "rtl": "react-cli rtl ./src ./lib && react-cli rtl ./src ./es",
19
+ "common_package_build":"cd ../common && npm run build && cd ../components",
19
20
  "start": "react-cli start",
20
- "docs": "npm run dubCheck && react-cli docs",
21
+ "docs": "npm run common_package_build && npm run dubCheck && react-cli docs",
21
22
  "build": " react-cli build:component:cmjs",
22
23
  "buildlocal": " react-cli build:component:cmjs && npm run rtl",
23
24
  "build:dev": "npm run build:variables && npm run build && npm run build:es --module:mode=dev -- -w",