@zohodesk/components 1.2.4 → 1.2.6
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 +8 -0
- package/coverage/Button/Button.js.html +1 -1
- package/coverage/Button/css/Button.module.css.html +1 -1
- package/coverage/Button/css/cssJSLogic.js.html +1 -1
- package/coverage/Button/css/index.html +1 -1
- package/coverage/Button/index.html +1 -1
- package/coverage/Button/props/defaultProps.js.html +1 -1
- package/coverage/Button/props/index.html +1 -1
- package/coverage/Button/props/propTypes.js.html +1 -1
- package/coverage/Buttongroup/Buttongroup.js.html +1 -1
- package/coverage/Buttongroup/Buttongroup.module.css.html +1 -1
- package/coverage/Buttongroup/index.html +1 -1
- package/coverage/Buttongroup/props/defaultProps.js.html +1 -1
- package/coverage/Buttongroup/props/index.html +1 -1
- package/coverage/Buttongroup/props/propTypes.js.html +1 -1
- package/coverage/index.html +1 -1
- package/coverage/utils/dummyFunction.js.html +1 -1
- package/coverage/utils/index.html +1 -1
- package/es/AppContainer/AppContainer.js +3 -0
- package/es/v1/Accordion/Accordion.js +65 -0
- package/es/v1/Accordion/AccordionItem.js +57 -0
- package/es/v1/Accordion/index.js +2 -0
- package/es/v1/Animation/Animation.js +127 -0
- package/es/v1/AppContainer/AppContainer.js +137 -0
- package/es/v1/Avatar/Avatar.js +189 -0
- package/es/v1/AvatarTeam/AvatarTeam.js +70 -0
- package/es/v1/Button/Button.js +68 -0
- package/es/v1/Buttongroup/Buttongroup.js +31 -0
- package/es/v1/Card/Card.js +271 -0
- package/es/v1/CheckBox/CheckBox.js +155 -0
- package/es/v1/DateTime/CalendarView.js +218 -0
- package/es/v1/DateTime/DateTime.js +783 -0
- package/es/v1/DateTime/DateTimePopupFooter.js +47 -0
- package/es/v1/DateTime/DateTimePopupHeader.js +105 -0
- package/es/v1/DateTime/DateWidget.js +1098 -0
- package/es/v1/DateTime/DaysRow.js +31 -0
- package/es/v1/DateTime/Time.js +166 -0
- package/es/v1/DateTime/YearView.js +264 -0
- package/es/v1/DateTime/index.js +1 -0
- package/es/v1/DropBox/DropBox.js +91 -0
- package/es/v1/DropBox/DropBoxElement/DropBoxElement.js +132 -0
- package/es/v1/DropDown/DropDown.js +73 -0
- package/es/v1/DropDown/DropDownHeading.js +44 -0
- package/es/v1/DropDown/DropDownItem.js +76 -0
- package/es/v1/DropDown/DropDownSearch.js +63 -0
- package/es/v1/DropDown/DropDownSeparator.js +15 -0
- package/es/v1/Heading/Heading.js +32 -0
- package/es/v1/Label/Label.js +40 -0
- package/es/v1/Layout/Box.js +115 -0
- package/es/v1/Layout/Container.js +132 -0
- package/es/v1/Layout/index.js +2 -0
- package/es/v1/ListItem/ListContainer.js +102 -0
- package/es/v1/ListItem/ListItem.js +124 -0
- package/es/v1/ListItem/ListItemWithAvatar.js +145 -0
- package/es/v1/ListItem/ListItemWithCheckBox.js +104 -0
- package/es/v1/ListItem/ListItemWithIcon.js +127 -0
- package/es/v1/ListItem/ListItemWithRadio.js +105 -0
- package/es/v1/ListItem/index.js +6 -0
- package/es/v1/Modal/Modal.js +154 -0
- package/es/v1/MultiSelect/AdvancedGroupMultiSelect.js +1079 -0
- package/es/v1/MultiSelect/AdvancedMultiSelect.js +568 -0
- package/es/v1/MultiSelect/EmptyState.js +64 -0
- package/es/v1/MultiSelect/MobileHeader/MobileHeader.js +50 -0
- package/es/v1/MultiSelect/MultiSelect.js +1120 -0
- package/es/v1/MultiSelect/MultiSelectHeader.js +32 -0
- package/es/v1/MultiSelect/MultiSelectWithAvatar.js +216 -0
- package/es/v1/MultiSelect/SelectedOptions.js +82 -0
- package/es/v1/MultiSelect/Suggestions.js +142 -0
- package/es/v1/MultiSelect/index.js +4 -0
- package/es/v1/PopOver/PopOver.js +211 -0
- package/es/v1/Popup/Popup.js +645 -0
- package/es/v1/Radio/Radio.js +115 -0
- package/es/v1/Responsive/CustomResponsive.js +195 -0
- package/es/v1/Responsive/RefWrapper.js +39 -0
- package/es/v1/Responsive/ResizeComponent.js +197 -0
- package/es/v1/Responsive/ResizeObserver.js +140 -0
- package/es/v1/Responsive/Responsive.js +194 -0
- package/es/v1/Responsive/index.js +9 -0
- package/es/v1/ResponsiveDropBox/ResponsiveDropBox.js +58 -0
- package/es/v1/Ribbon/Ribbon.js +33 -0
- package/es/v1/RippleEffect/RippleEffect.js +24 -0
- package/es/v1/Select/GroupSelect.js +803 -0
- package/es/v1/Select/Select.js +969 -0
- package/es/v1/Select/SelectWithAvatar.js +344 -0
- package/es/v1/Select/SelectWithIcon.js +535 -0
- package/es/v1/Select/index.js +4 -0
- package/es/v1/Stencils/Stencils.js +26 -0
- package/es/v1/Switch/Switch.js +94 -0
- package/es/v1/Tab/Tab.js +108 -0
- package/es/v1/Tab/TabContent.js +30 -0
- package/es/v1/Tab/TabContentWrapper.js +29 -0
- package/es/v1/Tab/TabWrapper.js +57 -0
- package/es/v1/Tab/Tabs.js +612 -0
- package/es/v1/Tab/index.js +5 -0
- package/es/v1/Tag/Tag.js +134 -0
- package/es/v1/TextBox/TextBox.js +154 -0
- package/es/v1/TextBoxIcon/TextBoxIcon.js +158 -0
- package/es/v1/Textarea/Textarea.js +102 -0
- package/es/v1/Tooltip/Tooltip.js +518 -0
- package/es/v1/Typography/Typography.js +38 -0
- package/es/v1/Typography/css/Typography.module.css +376 -0
- package/es/v1/Typography/css/cssJSLogic.js +46 -0
- package/es/v1/Typography/css/letterSpacingMap.js +12 -0
- package/es/v1/Typography/props/defaultProps.js +8 -0
- package/es/v1/Typography/props/propTypes.js +24 -0
- package/es/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +69 -0
- package/es/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +100 -0
- package/es/v1/semantic/Button/Button.js +53 -0
- package/es/v1/semantic/index.js +1 -0
- package/lib/AppContainer/AppContainer.js +5 -0
- package/lib/v1/Accordion/Accordion.js +96 -0
- package/lib/v1/Accordion/AccordionItem.js +68 -0
- package/lib/v1/Accordion/index.js +23 -0
- package/lib/v1/Animation/Animation.js +143 -0
- package/lib/v1/AppContainer/AppContainer.js +209 -0
- package/lib/v1/Avatar/Avatar.js +246 -0
- package/lib/v1/AvatarTeam/AvatarTeam.js +81 -0
- package/lib/v1/Button/Button.js +82 -0
- package/lib/v1/Buttongroup/Buttongroup.js +44 -0
- package/lib/v1/Card/Card.js +365 -0
- package/lib/v1/CheckBox/CheckBox.js +166 -0
- package/lib/v1/DateTime/CalendarView.js +285 -0
- package/lib/v1/DateTime/DateTime.js +872 -0
- package/lib/v1/DateTime/DateTimePopupFooter.js +96 -0
- package/lib/v1/DateTime/DateTimePopupHeader.js +166 -0
- package/lib/v1/DateTime/DateWidget.js +1125 -0
- package/lib/v1/DateTime/DaysRow.js +80 -0
- package/lib/v1/DateTime/Time.js +254 -0
- package/lib/v1/DateTime/YearView.js +325 -0
- package/lib/v1/DateTime/index.js +15 -0
- package/lib/v1/DropBox/DropBox.js +119 -0
- package/lib/v1/DropBox/DropBoxElement/DropBoxElement.js +145 -0
- package/lib/v1/DropDown/DropDown.js +170 -0
- package/lib/v1/DropDown/DropDownHeading.js +93 -0
- package/lib/v1/DropDown/DropDownItem.js +127 -0
- package/lib/v1/DropDown/DropDownSearch.js +113 -0
- package/lib/v1/DropDown/DropDownSeparator.js +64 -0
- package/lib/v1/Heading/Heading.js +49 -0
- package/lib/v1/Label/Label.js +51 -0
- package/lib/v1/Layout/Box.js +128 -0
- package/lib/v1/Layout/Container.js +145 -0
- package/lib/v1/Layout/index.js +23 -0
- package/lib/v1/ListItem/ListContainer.js +120 -0
- package/lib/v1/ListItem/ListItem.js +138 -0
- package/lib/v1/ListItem/ListItemWithAvatar.js +162 -0
- package/lib/v1/ListItem/ListItemWithCheckBox.js +125 -0
- package/lib/v1/ListItem/ListItemWithIcon.js +143 -0
- package/lib/v1/ListItem/ListItemWithRadio.js +126 -0
- package/lib/v1/ListItem/index.js +55 -0
- package/lib/v1/Modal/Modal.js +212 -0
- package/lib/v1/MultiSelect/AdvancedGroupMultiSelect.js +1167 -0
- package/lib/v1/MultiSelect/AdvancedMultiSelect.js +634 -0
- package/lib/v1/MultiSelect/EmptyState.js +112 -0
- package/lib/v1/MultiSelect/MobileHeader/MobileHeader.js +62 -0
- package/lib/v1/MultiSelect/MultiSelect.js +1201 -0
- package/lib/v1/MultiSelect/MultiSelectHeader.js +78 -0
- package/lib/v1/MultiSelect/MultiSelectWithAvatar.js +270 -0
- package/lib/v1/MultiSelect/SelectedOptions.js +126 -0
- package/lib/v1/MultiSelect/Suggestions.js +195 -0
- package/lib/v1/MultiSelect/index.js +39 -0
- package/lib/v1/PopOver/PopOver.js +293 -0
- package/lib/v1/Popup/Popup.js +715 -0
- package/lib/v1/Radio/Radio.js +126 -0
- package/lib/v1/Responsive/CustomResponsive.js +242 -0
- package/lib/v1/Responsive/RefWrapper.js +57 -0
- package/lib/v1/Responsive/ResizeComponent.js +268 -0
- package/lib/v1/Responsive/ResizeObserver.js +168 -0
- package/lib/v1/Responsive/Responsive.js +274 -0
- package/lib/v1/Responsive/index.js +55 -0
- package/lib/v1/ResponsiveDropBox/ResponsiveDropBox.js +79 -0
- package/lib/v1/Ribbon/Ribbon.js +44 -0
- package/lib/v1/RippleEffect/RippleEffect.js +39 -0
- package/lib/v1/Select/GroupSelect.js +877 -0
- package/lib/v1/Select/Select.js +1013 -0
- package/lib/v1/Select/SelectWithAvatar.js +394 -0
- package/lib/v1/Select/SelectWithIcon.js +597 -0
- package/lib/v1/Select/index.js +39 -0
- package/lib/v1/Stencils/Stencils.js +43 -0
- package/lib/v1/Switch/Switch.js +108 -0
- package/lib/v1/Tab/Tab.js +132 -0
- package/lib/v1/Tab/TabContent.js +42 -0
- package/lib/v1/Tab/TabContentWrapper.js +42 -0
- package/lib/v1/Tab/TabWrapper.js +89 -0
- package/lib/v1/Tab/Tabs.js +680 -0
- package/lib/v1/Tab/index.js +47 -0
- package/lib/v1/Tag/Tag.js +154 -0
- package/lib/v1/TextBox/TextBox.js +168 -0
- package/lib/v1/TextBoxIcon/TextBoxIcon.js +196 -0
- package/lib/v1/Textarea/Textarea.js +118 -0
- package/lib/v1/Tooltip/Tooltip.js +586 -0
- package/lib/v1/Typography/Typography.js +56 -0
- package/lib/v1/Typography/css/Typography.module.css +376 -0
- package/lib/v1/Typography/css/cssJSLogic.js +41 -0
- package/lib/v1/Typography/css/letterSpacingMap.js +20 -0
- package/lib/v1/Typography/props/defaultProps.js +15 -0
- package/lib/v1/Typography/props/propTypes.js +35 -0
- package/lib/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +90 -0
- package/lib/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +126 -0
- package/lib/v1/semantic/Button/Button.js +63 -0
- package/lib/v1/semantic/index.js +15 -0
- package/package.json +1 -1
- package/result.json +1 -1
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = exports.CardHeader = exports.CardFooter = exports.CardContent = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = require("../../Card/props/propTypes");
|
|
13
|
+
|
|
14
|
+
var _defaultProps = require("../../Card/props/defaultProps");
|
|
15
|
+
|
|
16
|
+
var _Layout = require("../Layout");
|
|
17
|
+
|
|
18
|
+
var _Config = require("../../Provider/Config");
|
|
19
|
+
|
|
20
|
+
var _CardModule = _interopRequireDefault(require("../../Card/Card.module.css"));
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
+
|
|
24
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
+
|
|
26
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
+
|
|
28
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
29
|
+
|
|
30
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
31
|
+
|
|
32
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
33
|
+
|
|
34
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
35
|
+
|
|
36
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
37
|
+
|
|
38
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
39
|
+
|
|
40
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
41
|
+
|
|
42
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
43
|
+
|
|
44
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
45
|
+
|
|
46
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
47
|
+
|
|
48
|
+
/* eslint-disable react/forbid-component-props */
|
|
49
|
+
|
|
50
|
+
/*
|
|
51
|
+
isscroll header border change use ref
|
|
52
|
+
scroll logic remove from here
|
|
53
|
+
scroll logic move to virtualizer list
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
/* performance handling pending in card component moving to ref instead of setState */
|
|
57
|
+
var CardHeader = /*#__PURE__*/function (_Component) {
|
|
58
|
+
_inherits(CardHeader, _Component);
|
|
59
|
+
|
|
60
|
+
var _super = _createSuper(CardHeader);
|
|
61
|
+
|
|
62
|
+
function CardHeader(props) {
|
|
63
|
+
var _this;
|
|
64
|
+
|
|
65
|
+
_classCallCheck(this, CardHeader);
|
|
66
|
+
|
|
67
|
+
_this = _super.call(this, props);
|
|
68
|
+
_this.getCardHeaderDom = _this.getCardHeaderDom.bind(_assertThisInitialized(_this));
|
|
69
|
+
_this.cardHeader = null;
|
|
70
|
+
return _this;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
_createClass(CardHeader, [{
|
|
74
|
+
key: "getCardHeaderDom",
|
|
75
|
+
value: function getCardHeaderDom(ele) {
|
|
76
|
+
this.cardHeader = ele;
|
|
77
|
+
}
|
|
78
|
+
}, {
|
|
79
|
+
key: "setScrollClassName",
|
|
80
|
+
value: function setScrollClassName() {
|
|
81
|
+
if (!this.cardHeader) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}, {
|
|
86
|
+
key: "render",
|
|
87
|
+
value: function render() {
|
|
88
|
+
var _this$props = this.props,
|
|
89
|
+
isScroll = _this$props.isScroll,
|
|
90
|
+
children = _this$props.children,
|
|
91
|
+
dataId = _this$props.dataId,
|
|
92
|
+
dataSelectorId = _this$props.dataSelectorId,
|
|
93
|
+
customClass = _this$props.customClass;
|
|
94
|
+
return /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
95
|
+
className: "".concat(isScroll ? _CardModule["default"].scroll : _CardModule["default"].notScroll, " ").concat(customClass),
|
|
96
|
+
eleRef: this.getCardHeaderDom,
|
|
97
|
+
dataId: dataId,
|
|
98
|
+
dataSelectorId: dataSelectorId
|
|
99
|
+
}, children);
|
|
100
|
+
}
|
|
101
|
+
}]);
|
|
102
|
+
|
|
103
|
+
return CardHeader;
|
|
104
|
+
}(_react.Component);
|
|
105
|
+
|
|
106
|
+
exports.CardHeader = CardHeader;
|
|
107
|
+
CardHeader.propTypes = _propTypes.CardHeader_propTypes;
|
|
108
|
+
CardHeader.defaultProps = _defaultProps.CardHeader_defaultProps;
|
|
109
|
+
|
|
110
|
+
var CardContent = /*#__PURE__*/function (_Component2) {
|
|
111
|
+
_inherits(CardContent, _Component2);
|
|
112
|
+
|
|
113
|
+
var _super2 = _createSuper(CardContent);
|
|
114
|
+
|
|
115
|
+
function CardContent() {
|
|
116
|
+
_classCallCheck(this, CardContent);
|
|
117
|
+
|
|
118
|
+
return _super2.apply(this, arguments);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
_createClass(CardContent, [{
|
|
122
|
+
key: "render",
|
|
123
|
+
value: function render() {
|
|
124
|
+
var _this$props2 = this.props,
|
|
125
|
+
onScroll = _this$props2.onScroll,
|
|
126
|
+
eleRef = _this$props2.eleRef,
|
|
127
|
+
children = _this$props2.children,
|
|
128
|
+
scroll = _this$props2.scroll,
|
|
129
|
+
isScrollAttribute = _this$props2.isScrollAttribute,
|
|
130
|
+
dataId = _this$props2.dataId,
|
|
131
|
+
dataSelectorId = _this$props2.dataSelectorId,
|
|
132
|
+
shrink = _this$props2.shrink,
|
|
133
|
+
customClass = _this$props2.customClass,
|
|
134
|
+
preventParentScroll = _this$props2.preventParentScroll;
|
|
135
|
+
return /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
136
|
+
flexible: true,
|
|
137
|
+
onScroll: onScroll,
|
|
138
|
+
eleRef: eleRef,
|
|
139
|
+
scroll: scroll,
|
|
140
|
+
preventParentScroll: preventParentScroll,
|
|
141
|
+
isScrollAttribute: isScrollAttribute,
|
|
142
|
+
dataId: dataId,
|
|
143
|
+
shrink: shrink,
|
|
144
|
+
className: customClass,
|
|
145
|
+
dataSelectorId: dataSelectorId
|
|
146
|
+
}, children);
|
|
147
|
+
}
|
|
148
|
+
}]);
|
|
149
|
+
|
|
150
|
+
return CardContent;
|
|
151
|
+
}(_react.Component);
|
|
152
|
+
|
|
153
|
+
exports.CardContent = CardContent;
|
|
154
|
+
CardContent.propTypes = _propTypes.CardContent_propTypes;
|
|
155
|
+
CardContent.defaultProps = _defaultProps.CardContent_defaultProps;
|
|
156
|
+
|
|
157
|
+
var Card = /*#__PURE__*/function (_Component3) {
|
|
158
|
+
_inherits(Card, _Component3);
|
|
159
|
+
|
|
160
|
+
var _super3 = _createSuper(Card);
|
|
161
|
+
|
|
162
|
+
function Card(props) {
|
|
163
|
+
var _this2;
|
|
164
|
+
|
|
165
|
+
_classCallCheck(this, Card);
|
|
166
|
+
|
|
167
|
+
_this2 = _super3.call(this, props);
|
|
168
|
+
_this2.state = {
|
|
169
|
+
isScroll: false
|
|
170
|
+
};
|
|
171
|
+
var from = props.from,
|
|
172
|
+
limit = props.limit;
|
|
173
|
+
_this2.from = from;
|
|
174
|
+
_this2.limit = limit;
|
|
175
|
+
_this2.to = from + 3 * limit;
|
|
176
|
+
_this2.isFetching = false;
|
|
177
|
+
_this2.lastScrollTop = 0;
|
|
178
|
+
_this2.onScroll = _this2.onScroll.bind(_assertThisInitialized(_this2)); //this.onSetScroll = debounce(this.setScroll.bind(this, true), 10, true);
|
|
179
|
+
//this.onClearScroll = debounce(this.setScroll.bind(this, false), 500);
|
|
180
|
+
|
|
181
|
+
return _this2;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
_createClass(Card, [{
|
|
185
|
+
key: "UNSAFE_componentWillReceiveProps",
|
|
186
|
+
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
187
|
+
if (this.from !== nextProps.from) {
|
|
188
|
+
this.from = nextProps.from;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}, {
|
|
192
|
+
key: "onScroll",
|
|
193
|
+
value: function onScroll(e) {
|
|
194
|
+
var _this3 = this;
|
|
195
|
+
|
|
196
|
+
var scrollContainerObj = e.currentTarget;
|
|
197
|
+
var scrollHeight = scrollContainerObj.scrollHeight;
|
|
198
|
+
var scrollTop = scrollContainerObj.scrollTop;
|
|
199
|
+
var offsetHeight = scrollContainerObj.offsetHeight;
|
|
200
|
+
var onScroll = this.props.onScroll;
|
|
201
|
+
onScroll && onScroll(e);
|
|
202
|
+
var _this$props3 = this.props,
|
|
203
|
+
fetchData = _this$props3.fetchData,
|
|
204
|
+
noMoreData = _this$props3.noMoreData,
|
|
205
|
+
scrollAt = _this$props3.scrollAt,
|
|
206
|
+
noNeedUpScroll = _this$props3.noNeedUpScroll,
|
|
207
|
+
isPercentageScroll = _this$props3.isPercentageScroll;
|
|
208
|
+
|
|
209
|
+
if (scrollTop > this.lastScrollTop) {
|
|
210
|
+
this.scrollDirection = 'down';
|
|
211
|
+
} else {
|
|
212
|
+
this.scrollDirection = 'up';
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
this.lastScrollTop = scrollTop;
|
|
216
|
+
|
|
217
|
+
if (fetchData && !this.isFetching) {
|
|
218
|
+
if (this.scrollDirection === 'down' && !noMoreData) {
|
|
219
|
+
var scrollingPercentage = (scrollTop + offsetHeight) / (scrollHeight - scrollAt) * 100;
|
|
220
|
+
var prefetch = isPercentageScroll ? scrollingPercentage >= (0, _Config.getLibraryConfig)('scrollFetchLimit') : scrollHeight - scrollAt <= scrollTop + offsetHeight;
|
|
221
|
+
|
|
222
|
+
if (prefetch) {
|
|
223
|
+
this.isFetching = true;
|
|
224
|
+
fetchData(this.from + this.limit, this.limit + this.to, this.scrollDirection).then(function () {
|
|
225
|
+
_this3.to = _this3.limit + _this3.to;
|
|
226
|
+
_this3.isFetching = false;
|
|
227
|
+
}, function () {
|
|
228
|
+
_this3.isFetching = false;
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
} else {
|
|
232
|
+
if (0 >= scrollTop - scrollAt && this.from !== 0 && !noNeedUpScroll) {
|
|
233
|
+
this.isFetching = true;
|
|
234
|
+
fetchData(this.from - this.limit, this.to - this.limit, this.scrollDirection).then(function () {
|
|
235
|
+
_this3.to = _this3.to - _this3.limit;
|
|
236
|
+
_this3.isFetching = false;
|
|
237
|
+
}, function () {
|
|
238
|
+
_this3.isFetching = false;
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if (fetchData && !noNeedUpScroll) {
|
|
245
|
+
if (this.from !== 0 && scrollTop === 0 && !noNeedUpScroll) {
|
|
246
|
+
scrollContainerObj.scrollTop = scrollTop + offsetHeight / 3;
|
|
247
|
+
} else if (scrollHeight === scrollTop + offsetHeight && !noMoreData) {
|
|
248
|
+
scrollContainerObj.scrollTop = scrollTop - offsetHeight / 2;
|
|
249
|
+
}
|
|
250
|
+
} // if (isScrollShadow) {
|
|
251
|
+
// this.onSetScroll();
|
|
252
|
+
// }
|
|
253
|
+
|
|
254
|
+
} // setScroll(isScroll) {
|
|
255
|
+
// let { isScroll: stateIsScroll } = this.state;
|
|
256
|
+
// if (isScroll && !stateIsScroll) {
|
|
257
|
+
// this.setState({ isScroll: true }, () => {
|
|
258
|
+
// this.onClearScroll();
|
|
259
|
+
// });
|
|
260
|
+
// } else if (!isScroll && stateIsScroll) {
|
|
261
|
+
// this.setState({ isScroll: false });
|
|
262
|
+
// }
|
|
263
|
+
// }
|
|
264
|
+
|
|
265
|
+
}, {
|
|
266
|
+
key: "render",
|
|
267
|
+
value: function render() {
|
|
268
|
+
var _this4 = this;
|
|
269
|
+
|
|
270
|
+
var _this$props4 = this.props,
|
|
271
|
+
onClick = _this$props4.onClick,
|
|
272
|
+
children = _this$props4.children,
|
|
273
|
+
isScrollAttribute = _this$props4.isScrollAttribute,
|
|
274
|
+
dataId = _this$props4.dataId,
|
|
275
|
+
eleRef = _this$props4.eleRef,
|
|
276
|
+
_this$props4$customCl = _this$props4.customClass,
|
|
277
|
+
customClass = _this$props4$customCl === void 0 ? '' : _this$props4$customCl,
|
|
278
|
+
htmlId = _this$props4.htmlId,
|
|
279
|
+
a11y = _this$props4.a11y;
|
|
280
|
+
var isScroll = this.state.isScroll;
|
|
281
|
+
var role = a11y.role;
|
|
282
|
+
return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
283
|
+
className: "".concat(customClass),
|
|
284
|
+
isScrollAttribute: isScrollAttribute,
|
|
285
|
+
onClick: onClick,
|
|
286
|
+
dataId: dataId,
|
|
287
|
+
eleRef: eleRef
|
|
288
|
+
}, _react["default"].Children.map(children, function (child) {
|
|
289
|
+
if (!child) {
|
|
290
|
+
return child;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
if (child.type === CardHeader || _this4.props.childTypes && child.type === _this4.props.childTypes.cardHeader) {
|
|
294
|
+
return /*#__PURE__*/_react["default"].cloneElement(child, {
|
|
295
|
+
isScroll: isScroll
|
|
296
|
+
});
|
|
297
|
+
} else if (child.type === CardContent || _this4.props.childTypes && child.type === _this4.props.childTypes.cardContent) {
|
|
298
|
+
return /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
299
|
+
id: htmlId,
|
|
300
|
+
role: role,
|
|
301
|
+
flexible: true,
|
|
302
|
+
scroll: child.props.scroll,
|
|
303
|
+
preventParentScroll: child.props.preventParentScroll,
|
|
304
|
+
onScroll: _this4.onScroll,
|
|
305
|
+
eleRef: child.props.eleRef,
|
|
306
|
+
isScrollAttribute: child.props.isScrollAttribute,
|
|
307
|
+
dataId: child.props.dataId,
|
|
308
|
+
shrink: child.props.shrink,
|
|
309
|
+
className: child.props.customClass,
|
|
310
|
+
dataSelectorId: child.props.dataSelectorId
|
|
311
|
+
}, child.props.children);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
return child;
|
|
315
|
+
}));
|
|
316
|
+
}
|
|
317
|
+
}]);
|
|
318
|
+
|
|
319
|
+
return Card;
|
|
320
|
+
}(_react.Component);
|
|
321
|
+
|
|
322
|
+
exports["default"] = Card;
|
|
323
|
+
Card.propTypes = _propTypes.Card_propTypes;
|
|
324
|
+
Card.defaultProps = _defaultProps.Card_defaultProps; // if (__DOCS__) {
|
|
325
|
+
// Card.docs = {
|
|
326
|
+
// componentGroup: 'Template',
|
|
327
|
+
// folderName: 'Style Guide',
|
|
328
|
+
// external: true,
|
|
329
|
+
// description: ' '
|
|
330
|
+
// };
|
|
331
|
+
// }
|
|
332
|
+
|
|
333
|
+
var CardFooter = /*#__PURE__*/function (_Component4) {
|
|
334
|
+
_inherits(CardFooter, _Component4);
|
|
335
|
+
|
|
336
|
+
var _super4 = _createSuper(CardFooter);
|
|
337
|
+
|
|
338
|
+
function CardFooter() {
|
|
339
|
+
_classCallCheck(this, CardFooter);
|
|
340
|
+
|
|
341
|
+
return _super4.apply(this, arguments);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
_createClass(CardFooter, [{
|
|
345
|
+
key: "render",
|
|
346
|
+
value: function render() {
|
|
347
|
+
var _this$props5 = this.props,
|
|
348
|
+
children = _this$props5.children,
|
|
349
|
+
dataId = _this$props5.dataId,
|
|
350
|
+
customClass = _this$props5.customClass,
|
|
351
|
+
dataSelectorId = _this$props5.dataSelectorId;
|
|
352
|
+
return /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
353
|
+
className: "".concat(customClass),
|
|
354
|
+
dataId: dataId,
|
|
355
|
+
dataSelectorId: dataSelectorId
|
|
356
|
+
}, children);
|
|
357
|
+
}
|
|
358
|
+
}]);
|
|
359
|
+
|
|
360
|
+
return CardFooter;
|
|
361
|
+
}(_react.Component);
|
|
362
|
+
|
|
363
|
+
exports.CardFooter = CardFooter;
|
|
364
|
+
CardFooter.propTypes = _propTypes.CardFooter_propTypes;
|
|
365
|
+
CardFooter.defaultProps = _defaultProps.CardFooter_defaultProps;
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = require("../../CheckBox/props/propTypes");
|
|
11
|
+
|
|
12
|
+
var _defaultProps = require("../../CheckBox/props/defaultProps");
|
|
13
|
+
|
|
14
|
+
var _Label = _interopRequireDefault(require("../Label/Label"));
|
|
15
|
+
|
|
16
|
+
var _Layout = require("../Layout");
|
|
17
|
+
|
|
18
|
+
var _CssProvider = _interopRequireDefault(require("../../Provider/CssProvider"));
|
|
19
|
+
|
|
20
|
+
var _CheckBoxModule = _interopRequireDefault(require("../../CheckBox/CheckBox.module.css"));
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
+
|
|
24
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
25
|
+
|
|
26
|
+
var CheckBox = function CheckBox(props) {
|
|
27
|
+
var id = props.id,
|
|
28
|
+
checked = props.checked,
|
|
29
|
+
disabled = props.disabled,
|
|
30
|
+
isReadOnly = props.isReadOnly,
|
|
31
|
+
disabledTitle = props.disabledTitle,
|
|
32
|
+
title = props.title,
|
|
33
|
+
palette = props.palette,
|
|
34
|
+
text = props.text,
|
|
35
|
+
size = props.size,
|
|
36
|
+
labelPalette = props.labelPalette,
|
|
37
|
+
labelSize = props.labelSize,
|
|
38
|
+
isFilled = props.isFilled,
|
|
39
|
+
isClipped = props.isClipped,
|
|
40
|
+
getRef = props.getRef,
|
|
41
|
+
variant = props.variant,
|
|
42
|
+
active = props.active,
|
|
43
|
+
dataId = props.dataId,
|
|
44
|
+
name = props.name,
|
|
45
|
+
activeStyle = props.activeStyle,
|
|
46
|
+
a11y = props.a11y,
|
|
47
|
+
customClass = props.customClass,
|
|
48
|
+
customProps = props.customProps,
|
|
49
|
+
dataSelectorId = props.dataSelectorId;
|
|
50
|
+
|
|
51
|
+
function onChange(e) {
|
|
52
|
+
var onChange = props.onChange;
|
|
53
|
+
onChange && onChange(!checked, e);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
var _customProps$CheckBox = customProps.CheckBoxProps,
|
|
57
|
+
CheckBoxProps = _customProps$CheckBox === void 0 ? {} : _customProps$CheckBox,
|
|
58
|
+
_customProps$LabelPro = customProps.LabelProps,
|
|
59
|
+
LabelProps = _customProps$LabelPro === void 0 ? {} : _customProps$LabelPro;
|
|
60
|
+
var _customClass$customCh = customClass.customCheckBox,
|
|
61
|
+
customCheckBox = _customClass$customCh === void 0 ? '' : _customClass$customCh,
|
|
62
|
+
_customClass$customLa = customClass.customLabel,
|
|
63
|
+
customLabel = _customClass$customLa === void 0 ? '' : _customClass$customLa,
|
|
64
|
+
_customClass$customCB = customClass.customCBoxSize,
|
|
65
|
+
customCBoxSize = _customClass$customCB === void 0 ? '' : _customClass$customCB,
|
|
66
|
+
_customClass$customTi = customClass.customTickSize,
|
|
67
|
+
customTickSize = _customClass$customTi === void 0 ? '' : _customClass$customTi;
|
|
68
|
+
var accessMode = isReadOnly ? _CheckBoxModule["default"].readonly : disabled ? (0, _CssProvider["default"])('isDisabled') : _CheckBoxModule["default"].pointer;
|
|
69
|
+
var toolTip = disabled ? disabledTitle : title ? title : null;
|
|
70
|
+
var ariaLabel = a11y.ariaLabel,
|
|
71
|
+
ariaLabelledby = a11y.ariaLabelledby,
|
|
72
|
+
ariaHidden = a11y.ariaHidden,
|
|
73
|
+
_a11y$role = a11y.role,
|
|
74
|
+
role = _a11y$role === void 0 ? 'checkbox' : _a11y$role,
|
|
75
|
+
_a11y$ariaChecked = a11y.ariaChecked,
|
|
76
|
+
ariaChecked = _a11y$ariaChecked === void 0 ? checked : _a11y$ariaChecked;
|
|
77
|
+
return /*#__PURE__*/_react["default"].createElement(_Layout.Container, _extends({
|
|
78
|
+
dataId: dataId,
|
|
79
|
+
isCover: false,
|
|
80
|
+
isInline: text ? false : true,
|
|
81
|
+
alignBox: "row",
|
|
82
|
+
align: "vertical",
|
|
83
|
+
className: "".concat(_CheckBoxModule["default"].container, " ").concat(accessMode, " ").concat(isReadOnly || disabled ? '' : "".concat(_CheckBoxModule["default"][palette]), " \n ").concat(checked ? "".concat(_CheckBoxModule["default"]["checked".concat(palette)]) : '', " ").concat(customCheckBox),
|
|
84
|
+
"data-title": toolTip,
|
|
85
|
+
onClick: isReadOnly || disabled ? null : onChange,
|
|
86
|
+
tabIndex: isReadOnly || disabled || ariaHidden ? '-1' : '0',
|
|
87
|
+
"aria-checked": ariaChecked,
|
|
88
|
+
role: role,
|
|
89
|
+
"aria-label": ariaLabel,
|
|
90
|
+
"aria-labelledby": ariaLabelledby,
|
|
91
|
+
"aria-hidden": ariaHidden,
|
|
92
|
+
"data-selector-id": dataSelectorId || id
|
|
93
|
+
}, CheckBoxProps), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
94
|
+
className: "".concat(_CheckBoxModule["default"].boxContainer, " ").concat(_CheckBoxModule["default"][size], " ").concat(customCBoxSize, " ").concat(isFilled ? _CheckBoxModule["default"].filled : '')
|
|
95
|
+
}, /*#__PURE__*/_react["default"].createElement("input", {
|
|
96
|
+
type: "hidden",
|
|
97
|
+
id: id,
|
|
98
|
+
ref: getRef,
|
|
99
|
+
name: name
|
|
100
|
+
}), /*#__PURE__*/_react["default"].createElement("label", {
|
|
101
|
+
className: "".concat(_CheckBoxModule["default"].checkbox, " ").concat(accessMode, " ").concat(_CheckBoxModule["default"][size], " ").concat(customCBoxSize)
|
|
102
|
+
}, activeStyle == 'tick' ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("svg", {
|
|
103
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
104
|
+
viewBox: "0 0 40 40"
|
|
105
|
+
}, checked ? /*#__PURE__*/_react["default"].createElement("path", {
|
|
106
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
107
|
+
d: "M39,20V35a4,4,0,0,1-4,4H5a4,4,0,0,1-4-4V5A4,4,0,0,1,5,1H28.44",
|
|
108
|
+
className: "".concat(_CheckBoxModule["default"].cbBox)
|
|
109
|
+
}) : /*#__PURE__*/_react["default"].createElement("rect", {
|
|
110
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
111
|
+
x: "1",
|
|
112
|
+
y: "1",
|
|
113
|
+
width: "38",
|
|
114
|
+
height: "38",
|
|
115
|
+
rx: "4",
|
|
116
|
+
className: "".concat(_CheckBoxModule["default"].cbBox)
|
|
117
|
+
})), checked ? /*#__PURE__*/_react["default"].createElement("svg", {
|
|
118
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
119
|
+
viewBox: "0 0 44 44",
|
|
120
|
+
className: "".concat(_CheckBoxModule["default"].tick, " ").concat(_CheckBoxModule["default"]["".concat(size, "tick")], " ").concat(customTickSize, " ").concat(disabled ? (0, _CssProvider["default"])('isDisabled') : '')
|
|
121
|
+
}, /*#__PURE__*/_react["default"].createElement("polyline", {
|
|
122
|
+
points: "12.56 19 19.61 26.06 40.39 5.28",
|
|
123
|
+
className: "".concat(_CheckBoxModule["default"].tickPath, " ").concat(_CheckBoxModule["default"].checkedtickPath)
|
|
124
|
+
})) : null) : /*#__PURE__*/_react["default"].createElement("svg", {
|
|
125
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
126
|
+
viewBox: "0 0 40 40"
|
|
127
|
+
}, /*#__PURE__*/_react["default"].createElement("rect", {
|
|
128
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
129
|
+
x: "1",
|
|
130
|
+
y: "1",
|
|
131
|
+
width: "38",
|
|
132
|
+
height: "38",
|
|
133
|
+
rx: "4",
|
|
134
|
+
className: "".concat(_CheckBoxModule["default"].cbBox)
|
|
135
|
+
}), checked ? /*#__PURE__*/_react["default"].createElement("line", {
|
|
136
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
137
|
+
className: "".concat(_CheckBoxModule["default"].linePath, " ").concat(_CheckBoxModule["default"].cbBox),
|
|
138
|
+
x1: "11.47",
|
|
139
|
+
y1: "20",
|
|
140
|
+
x2: "28.53",
|
|
141
|
+
y2: "20"
|
|
142
|
+
}) : null))), text && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
143
|
+
flexible: true,
|
|
144
|
+
className: _CheckBoxModule["default"].text
|
|
145
|
+
}, /*#__PURE__*/_react["default"].createElement(_Label["default"], _extends({
|
|
146
|
+
text: text,
|
|
147
|
+
palette: disabled ? 'disable' : labelPalette,
|
|
148
|
+
id: id,
|
|
149
|
+
size: labelSize,
|
|
150
|
+
type: "title",
|
|
151
|
+
clipped: isClipped,
|
|
152
|
+
variant: variant,
|
|
153
|
+
customClass: "".concat(active && !disabled ? "".concat(_CheckBoxModule["default"]["active".concat(palette, "Label")]) : '', "\n ").concat(checked && active ? "".concat(_CheckBoxModule["default"]["checked".concat(palette, "Label")]) : '', " \n ").concat(accessMode, " ").concat(customLabel),
|
|
154
|
+
title: toolTip ? toolTip : text
|
|
155
|
+
}, LabelProps))));
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
var _default = CheckBox;
|
|
159
|
+
exports["default"] = _default;
|
|
160
|
+
CheckBox.defaultProps = _defaultProps.defaultProps;
|
|
161
|
+
CheckBox.propTypes = _propTypes.propTypes; // if (__DOCS__) {
|
|
162
|
+
// CheckBox.docs = {
|
|
163
|
+
// componentGroup: 'Form Elements',
|
|
164
|
+
// folderName: 'Style Guide'
|
|
165
|
+
// };
|
|
166
|
+
// }
|